Documentation
¶
Overview ¶
Package clients holds the canonical ZAP-typed inter-subsystem clients used by cloud.Deps.
Per HIP-0106 "Inter-subsystem contract": ZAP (the Hanzo native binary protocol). Every subsystem ships its public interface as a .zap schema; zapc generates Go bindings; cloud wires the in-process ZAP-typed Go interfaces when subsystems are co-resident, falls back to ZAP RPC over the wire when split.
This package provides three factories per subsystem:
<Subsystem>InProcess(impl): wraps a co-resident implementation as a ZAP-typed client. Direct Go method calls. No marshalling, no network.
<Subsystem>RPC(addr): builds a ZAP-RPC client targeting a remote endpoint (used in split deployments).
Disabled<Subsystem>(): returns a typed nil that fails closed with a clear error message when called. Lets subsystem mount code defensively detect "the dep isn't wired" without nil dereferences.
cloud.BuildDeps picks the right one for each subsystem based on cfg.Enabled(name) and the configured RPC endpoint.
Note (zapc): the ZAP RPC wire format is exercised by hanzoai/zap (Rust impl) and hanzoai/zap-go (Go bindings). The current Go scaffolding here ships stubs sufficient to enforce the contract; the actual RPC dispatch sits behind a transport layer that subsystems will swap in as each subsystem ships its .zap schema + zapc-generated client. TODO(zapc-gen) markers identify the expansion points.
Index ¶
- func AIHTTPAt(baseURL, apiKey, defaultModel string) types.AIClient
- func AIHTTPM2M(baseURL, tokenURL, clientID, clientSecret, defaultModel string) types.AIClient
- func AIInProcess(impl types.AIClient) types.AIClient
- func AIRPCAt(addr string) types.AIClient
- func BaseInProcess(impl types.BaseClient) types.BaseClient
- func BaseRPCAt(addr string) types.BaseClient
- func CommerceInProcess(impl types.CommerceClient) types.CommerceClient
- func CommerceRPCAt(addr string) types.CommerceClient
- func DisabledAI() types.AIClient
- func DisabledBase() types.BaseClient
- func DisabledCommerce() types.CommerceClient
- func DisabledIAM() types.IAMClient
- func DisabledKMS() types.KMSClient
- func DisabledMQ() types.MQClient
- func DisabledO11y() types.O11yClient
- func DisabledPayments() types.PaymentsClient
- func DisabledVFS() types.VFSClient
- func DisabledVault() types.VaultClient
- func IAMInProcess(impl types.IAMClient) types.IAMClient
- func IAMRPCAt(addr string) types.IAMClient
- func IsDisabled(err error) bool
- func KMSInProcess(impl types.KMSClient) types.KMSClient
- func KMSRPCAt(addr string) types.KMSClient
- func MQInProcess(impl types.MQClient) types.MQClient
- func MQRPCAt(addr string) types.MQClient
- func O11yInProcess(impl types.O11yClient) types.O11yClient
- func O11yRPCAt(addr string) types.O11yClient
- func PaymentsRPCAt(addr string) types.PaymentsClient
- func VFSInProcess(impl types.VFSClient) types.VFSClient
- func VFSRPCAt(addr string) types.VFSClient
- func VaultRPCAt(addr string) types.VaultClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AIHTTPAt ¶ added in v1.786.32
AIHTTPAt returns a types.AIClient that POSTs OpenAI-compatible chat completions to baseURL, authenticated with apiKey. baseURL is the gateway /v1 root (the go-openai client appends /chat/completions). defaultModel is substituted when a ChatRequest carries no explicit model.
apiKey is a KMS-injected secret and is NEVER logged: it lives only inside the go-openai client's Authorization header. Callers log the base URL and default model, never the key.
func AIHTTPM2M ¶ added in v1.786.32
AIHTTPM2M returns a types.AIClient that authenticates to the gateway with an IAM client-credentials (M2M) token instead of a static key. This is the durable Hanzo credential path: the cloud binary mints and auto-refreshes a short-lived token from its OWN service identity (IAM_CLIENT_ID/SECRET), so there is NO static key to rotate and no expiry cliff. On the Hanzo deployment that identity resolves to admin/hanzo-cloud, which the gateway treats as balance-exempt — so cloud's own per-org ResourceMeter stays the single revenue debit (no double-bill).
tokenURL is the IAM token endpoint ({issuer}/v1/iam/oauth/token). clientSecret is a KMS-injected secret and is NEVER logged: it lives only inside the oauth2 token source. The token is fetched lazily on first use (boot never blocks on IAM) and cached+refreshed automatically by the oauth2 client.
go-openai sets its own Authorization header only when its authToken is non-empty; here it is empty, so the sole auth header is the fresh Bearer the oauth2 transport injects on every request.
func AIInProcess ¶
AIInProcess wraps a co-resident AI implementation.
func BaseInProcess ¶
func BaseInProcess(impl types.BaseClient) types.BaseClient
BaseInProcess wraps a co-resident Base implementation.
func BaseRPCAt ¶
func BaseRPCAt(addr string) types.BaseClient
BaseRPCAt returns a ZAP-RPC Base client targeting addr.
func CommerceInProcess ¶
func CommerceInProcess(impl types.CommerceClient) types.CommerceClient
CommerceInProcess wraps a co-resident Commerce implementation.
func CommerceRPCAt ¶
func CommerceRPCAt(addr string) types.CommerceClient
CommerceRPCAt returns a ZAP-RPC Commerce client targeting addr.
func DisabledBase ¶
func DisabledBase() types.BaseClient
DisabledBase returns a fail-closed Base client.
func DisabledCommerce ¶
func DisabledCommerce() types.CommerceClient
DisabledCommerce returns a fail-closed Commerce client.
func DisabledO11y ¶
func DisabledO11y() types.O11yClient
DisabledO11y returns an O11y client that emits to /dev/null. Used when o11y isn't mounted; subsystems get no-op metrics rather than nil deref or error spam.
func DisabledPayments ¶
func DisabledPayments() types.PaymentsClient
DisabledPayments returns a fail-closed Payments client.
func DisabledVault ¶
func DisabledVault() types.VaultClient
DisabledVault returns a fail-closed Vault client.
func IAMInProcess ¶
IAMInProcess wraps a co-resident IAM implementation. Subsystems call deps.IAM.VerifyJWT(...) etc. without knowing whether IAM is in-process or remote.
func IsDisabled ¶
IsDisabled reports whether err originated from a disabled client. Subsystem mount code can use this to log a friendly warning instead of cascading a 500.
func KMSInProcess ¶
KMSInProcess wraps a co-resident KMS implementation.
func MQInProcess ¶
MQInProcess wraps a co-resident MQ implementation.
func O11yInProcess ¶
func O11yInProcess(impl types.O11yClient) types.O11yClient
O11yInProcess wraps a co-resident O11y implementation.
func O11yRPCAt ¶
func O11yRPCAt(addr string) types.O11yClient
O11yRPCAt returns a ZAP-RPC O11y client targeting addr.
func PaymentsRPCAt ¶
func PaymentsRPCAt(addr string) types.PaymentsClient
PaymentsRPCAt returns a ZAP-RPC Payments client targeting addr. Payments is ALWAYS split-deployed (PCI scope isolation per HIP-0106 solo-vault CDE), so there is no in-process variant.
func VFSInProcess ¶
VFSInProcess wraps a co-resident VFS implementation.
func VaultRPCAt ¶
func VaultRPCAt(addr string) types.VaultClient
VaultRPCAt returns a ZAP-RPC Vault client targeting addr. Vault is ALWAYS split-deployed (PCI-CDE, the only system that touches PAN), so there is no in-process variant.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package admin mounts the god-mode admin surface (/v1/admin/*) the Hanzo Admin Console (admin.hanzo.ai, apps/operator) calls, per the api.ts contract.
|
Package admin mounts the god-mode admin surface (/v1/admin/*) the Hanzo Admin Console (admin.hanzo.ai, apps/operator) calls, per the api.ts contract. |
|
Package agents mounts the Hanzo Cloud /v1/agents surface: per-org autonomous agent definitions and their runs.
|
Package agents mounts the Hanzo Cloud /v1/agents surface: per-org autonomous agent definitions and their runs. |
|
Package analytics mounts the Hanzo Cloud /v1/analytics/* surface: a native-Go, per-org analytics read API over the `hanzo` ClickHouse warehouse (the `datastore` cluster).
|
Package analytics mounts the Hanzo Cloud /v1/analytics/* surface: a native-Go, per-org analytics read API over the `hanzo` ClickHouse warehouse (the `datastore` cluster). |
|
Package billing mounts the CUSTOMER-facing, org-scoped billing surface (/v1/billing/{usage,balance,gpu-eligibility,gpu-charge,payment-methods}) on the unified cloud binary.
|
Package billing mounts the CUSTOMER-facing, org-scoped billing surface (/v1/billing/{usage,balance,gpu-eligibility,gpu-charge,payment-methods}) on the unified cloud binary. |
|
Package botsvc mounts /v1/bot/* — a reverse proxy to the in-cluster bot-gateway (the OpenAI-compatible agent gateway that owns channels, skills, and the agent API).
|
Package botsvc mounts /v1/bot/* — a reverse proxy to the in-cluster bot-gateway (the OpenAI-compatible agent gateway that owns channels, skills, and the agent API). |
|
Package cms declares the Hanzo CMS content model as DocType fixtures on the framework engine (clients/framework).
|
Package cms declares the Hanzo CMS content model as DocType fixtures on the framework engine (clients/framework). |
|
billing.go — the per-tenant billing DATA bridge, the Go port of console2's app/billing/v1/[...path]/route.ts (task #41, the BFF catch-all sweep).
|
billing.go — the per-tenant billing DATA bridge, the Go port of console2's app/billing/v1/[...path]/route.ts (task #41, the BFF catch-all sweep). |
|
Package crm mounts the Hanzo Cloud /v1/crm/* surface: a native-Go, per-org CRM (companies, contacts, opportunities) on Base/SQLite.
|
Package crm mounts the Hanzo Cloud /v1/crm/* surface: a native-Go, per-org CRM (companies, contacts, opportunities) on Base/SQLite. |
|
Package do mounts the Hanzo Cloud DigitalOcean-native infra surface — /v1/vpcs and /v1/load-balancers — on the unified cloud binary (HIP-0106).
|
Package do mounts the Hanzo Cloud DigitalOcean-native infra surface — /v1/vpcs and /v1/load-balancers — on the unified cloud binary (HIP-0106). |
|
Package erp declares the ERPNext-core business model as DocType fixtures on the framework engine (clients/framework).
|
Package erp declares the ERPNext-core business model as DocType fixtures on the framework engine (clients/framework). |
|
Package eval mounts the Hanzo Cloud /v1/evals/* surface: a NATIVE, org-scoped evaluation system that replaces the retired 3.x observability-console fork (the crash-looping console proxy this file used to be).
|
Package eval mounts the Hanzo Cloud /v1/evals/* surface: a NATIVE, org-scoped evaluation system that replaces the retired 3.x observability-console fork (the crash-looping console proxy this file used to be). |
|
Package execsvc exposes the Code Interpreter ("Run Code") surface on the unified cloud-api /v1 plane, per HIP-0106.
|
Package execsvc exposes the Code Interpreter ("Run Code") surface on the unified cloud-api /v1 plane, per HIP-0106. |
|
Package framework is the Hanzo Framework: a metadata-driven DocType engine, native Go on Base/SQLite, mounted in the unified cloud binary at /v1/framework/*.
|
Package framework is the Hanzo Framework: a metadata-driven DocType engine, native Go on Base/SQLite, mounted in the unified cloud binary at /v1/framework/*. |
|
Package functions mounts the Hanzo Cloud /v1/functions surface: a per-org serverless function registry.
|
Package functions mounts the Hanzo Cloud /v1/functions surface: a per-org serverless function registry. |
|
Package git mounts the Hanzo Cloud /v1/git surface: S3-backed Git hosting native in the unified cloud binary — the "internal Gitea" foundation agents push code into.
|
Package git mounts the Hanzo Cloud /v1/git surface: S3-backed Git hosting native in the unified cloud binary — the "internal Gitea" foundation agents push code into. |
|
Package gojahost runs a Hanzo Node service's goja bundle (a self-contained, ESM-free JS file exposing globalThis.handle(req)) inside the unified cloud binary, per HIP-0106.
|
Package gojahost runs a Hanzo Node service's goja bundle (a self-contained, ESM-free JS file exposing globalThis.handle(req)) inside the unified cloud binary, per HIP-0106. |
|
client.go is the ONE HTTP path from this subsystem to the Lux chain-data plane.
|
client.go is the ONE HTTP path from this subsystem to the Lux chain-data plane. |
|
Package help declares the Hanzo Help Center (Frappe Helpdesk-core) model as DocType fixtures on the framework engine (clients/framework).
|
Package help declares the Hanzo Help Center (Frappe Helpdesk-core) model as DocType fixtures on the framework engine (clients/framework). |
|
Package integrations is the generic, provider-agnostic OAuth connector plane for the unified Hanzo Cloud binary — the /v1/integrations surface that lets an org connect a third-party account (Slack today; GitHub scaffolded; Google / Salesforce plug into the SAME registry later) and hands the resulting per-org tokens to KMS custody.
|
Package integrations is the generic, provider-agnostic OAuth connector plane for the unified Hanzo Cloud binary — the /v1/integrations surface that lets an org connect a third-party account (Slack today; GitHub scaffolded; Google / Salesforce plug into the SAME registry later) and hands the resulting per-org tokens to KMS custody. |
|
connectors.go is the per-org app-connector control plane: OAuth into Slack / GitHub / Google, store the token in KMS (never plaintext, never logged), and sync external documents INTO the same per-org knowledge store + vector index as manual pages.
|
connectors.go is the per-org app-connector control plane: OAuth into Slack / GitHub / Google, store the token in KMS (never plaintext, never logged), and sync external documents INTO the same per-org knowledge store + vector index as manual pages. |
|
Package kms embeds luxfi/kms in-process inside the unified Hanzo Cloud binary per HIP-0106 ("all Go embeds in cloud"), replacing the legacy Infisical fork.
|
Package kms embeds luxfi/kms in-process inside the unified Hanzo Cloud binary per HIP-0106 ("all Go embeds in cloud"), replacing the legacy Infisical fork. |
|
Package kms is the Fiber-facing subsystem that exposes the embedded luxfi/kms secrets-manager as /v1/kms/* on the unified Hanzo Cloud binary (HIP-0106).
|
Package kms is the Fiber-facing subsystem that exposes the embedded luxfi/kms secrets-manager as /v1/kms/* on the unified Hanzo Cloud binary (HIP-0106). |
|
Package mlsvc mounts the Hanzo Cloud /v1/ml/* and /v1/train/* surfaces: a thin, tenant-scoped bridge that turns three Kubeflow-family CustomResources into a small REST API.
|
Package mlsvc mounts the Hanzo Cloud /v1/ml/* and /v1/train/* surfaces: a thin, tenant-scoped bridge that turns three Kubeflow-family CustomResources into a small REST API. |
|
Package o11y initializes the o11y subsystem's runtime handler in the unified cloud binary.
|
Package o11y initializes the o11y subsystem's runtime handler in the unified cloud binary. |
|
Package paassvc mounts the native, in-process Hanzo PaaS control plane at /v1/paas/*: the "one and only one way to deploy" made native to the cloud binary.
|
Package paassvc mounts the native, in-process Hanzo PaaS control plane at /v1/paas/*: the "one and only one way to deploy" made native to the cloud binary. |
|
Package plansvc mounts the @hanzo/plans catalog into the unified cloud binary under /v1/plans/*, per HIP-0106.
|
Package plansvc mounts the @hanzo/plans catalog into the unified cloud binary under /v1/plans/*, per HIP-0106. |
|
applylive.go — the ONE version-monotonic deploy mechanic shared by the image-source path (deployImage) and the git build reconciler.
|
applylive.go — the ONE version-monotonic deploy mechanic shared by the image-source path (deployImage) and the git build reconciler. |
|
Package pluginsvc is the runtime plugin loader for the unified cloud binary.
|
Package pluginsvc is the runtime plugin loader for the unified cloud binary. |
|
Admin surface for the catalog enablement overlay (global-admin only).
|
Admin surface for the catalog enablement overlay (global-admin only). |
|
Package principal is the ONE place the cloud data plane turns a request into a tenant.
|
Package principal is the ONE place the cloud data plane turns a request into a tenant. |
|
Package productsvc exposes the read-only Search and Vector product surfaces the Hanzo console panels call at api.cloud.hanzo.ai, per HIP-0106.
|
Package productsvc exposes the read-only Search and Vector product surfaces the Hanzo console panels call at api.cloud.hanzo.ai, per HIP-0106. |
|
Package projectsvc is the Hanzo Cloud projects control plane: the ONE org-scoped store of buildable/deployable sites, shared by every surface that shows a user's projects.
|
Package projectsvc is the Hanzo Cloud projects control plane: the ONE org-scoped store of buildable/deployable sites, shared by every surface that shows a user's projects. |
|
Package prompts mounts the Hanzo Cloud /v1/prompts surface: a per-org, versioned prompt library.
|
Package prompts mounts the Hanzo Cloud /v1/prompts surface: a per-org, versioned prompt library. |
|
Package provisioningsvc is the Hanzo Cloud provisioning control plane.
|
Package provisioningsvc is the Hanzo Cloud provisioning control plane. |
|
Package s3 is the Fiber-facing subsystem that exposes an org-scoped S3 object-storage file manager as /v1/s3/* on the unified Hanzo Cloud binary (HIP-0106).
|
Package s3 is the Fiber-facing subsystem that exposes an org-scoped S3 object-storage file manager as /v1/s3/* on the unified Hanzo Cloud binary (HIP-0106). |
|
Package s3admin is the ONE shared S3 access path for the unified cloud binary.
|
Package s3admin is the ONE shared S3 access path for the unified cloud binary. |
|
detect
Package detect is the pure, dependency-free secret-detection engine behind Hanzo's native code-security surface.
|
Package detect is the pure, dependency-free secret-detection engine behind Hanzo's native code-security surface. |
|
Package sites is the public site-server for published projects: the host-routed edge that turns `<slug>.hanzo.app` into the static site a user deployed to OUR S3.
|
Package sites is the public site-server for published projects: the host-routed edge that turns `<slug>.hanzo.app` into the static site a user deployed to OUR S3. |
|
Package tasksvc mounts the Hanzo Tasks HTTP + UI surface natively onto the unified cloud binary per HIP-0106 — the follow-up named in cloud's durable.go ("consolidating that surface into cloud").
|
Package tasksvc mounts the Hanzo Tasks HTTP + UI surface natively onto the unified cloud binary per HIP-0106 — the follow-up named in cloud's durable.go ("consolidating that surface into cloud"). |
|
Package templates mounts /v1/templates — the read-only Hanzo starter-kit gallery: deployable app/site scaffolds (source of truth: hanzoai/gallery), vendored so the unified `cloud` binary ships the catalog with no external dependency.
|
Package templates mounts /v1/templates — the read-only Hanzo starter-kit gallery: deployable app/site scaffolds (source of truth: hanzoai/gallery), vendored so the unified `cloud` binary ships the catalog with no external dependency. |
|
Package tracker mounts the Hanzo Cloud /v1/tracker/* surface: a native-Go, per-org issue tracker (projects + issues) on SQLite.
|
Package tracker mounts the Hanzo Cloud /v1/tracker/* surface: a native-Go, per-org issue tracker (projects + issues) on SQLite. |
|
bots.go mounts the Hanzo Cloud BOT surface (/v1/bots) plus the machine agent-binding proxies (/v1/machines/:id/{bind-agent,agent-binding}, /v1/agent-bindings).
|
bots.go mounts the Hanzo Cloud BOT surface (/v1/bots) plus the machine agent-binding proxies (/v1/machines/:id/{bind-agent,agent-binding}, /v1/agent-bindings). |
|
Package websearch exposes Hanzo-native Web Search + Scrape on the unified cloud-api /v1 plane, so hanzo.chat's web_search agent tool runs entirely on Hanzo infrastructure with NO external SaaS provider, per HIP-0106.
|
Package websearch exposes Hanzo-native Web Search + Scrape on the unified cloud-api /v1 plane, so hanzo.chat's web_search agent tool runs entirely on Hanzo infrastructure with NO external SaaS provider, per HIP-0106. |
|
client.go is the ONE HTTP path from this subsystem to Hanzo Zero Trust — the OpenZiti-based fabric controller (hanzoai/zt) at zt-controller.hanzo.svc.
|
client.go is the ONE HTTP path from this subsystem to Hanzo Zero Trust — the OpenZiti-based fabric controller (hanzoai/zt) at zt-controller.hanzo.svc. |