--- name: semesh description: Connect a personal agent to Semesh, discover and call authorized Service Unit Actions, and prepare or observe app deployments. Production deployment authorization is currently unavailable, so new source deploys fail closed; use availability, preflight, and existing-resource readbacks without claiming a new live URL. --- # Semesh — Service Unit Actions and deployment readiness Semesh is a Service Unit layer with an intended app runtime contract for login, managed data, and usage billing. Production deployment authorization is currently unavailable: `app_deployments.create` is disabled, and source deploy fails closed with `deployment_authorization_unavailable` before upload, build, payment, publication, or creation of a live URL. Existing app records remain observable, but observing one does not authorize a new release. ## Connect a personal agent from this conversation When asked to install or connect Semesh in a personal agent, use the client’s native connector. The official Agent Skills file is [semesh/SKILL.md](https://raw.githubusercontent.com/StructureIntelligence/Semesh/main/skills/semesh/SKILL.md). Use the client’s skill installer if it supports Agent Skills. A hosted chat can connect through its supported connector independently of skill installation. - For a client supporting Poppy organization discovery, add **Semesh** at **https://semesh.io** in this conversation. Let the client discover the [organization manifest](https://semesh.io/.well-known/poppy.json), its MCP resource and its authorization server. - For a remote MCP client, add the registered Semesh resource `https://api.semesh.net/mcp` using Streamable HTTP. On an HTTP 401 challenge, let the client follow the advertised `resource_metadata`, discover the authorization server and start OAuth for this resource. HTTP 404 means the remote connection is unpublished. The [connection page](https://semesh.io/mcp-server) also shows the published status. - When the client offers the Semesh sign-in link, give the user that link. They sign in and approve the requested permissions in their browser. After the callback, resume the original conversation, refresh the connection’s tools and continue the requested task with the granted permissions and spending limit. Only report an account connection once the client confirms authorization. Public catalog search also works anonymously. - To check private access, first verify that the refreshed `tools/list` includes `store_resources_list`. Use the collection the user chose within the connection’s authorized prefixes. If none was chosen, use `agent-chat` only when its prefix is authorized. Otherwise ask which authorized collection to use. Substitute that collection in this read-only example. Start with an empty `after` and a `limit` from 1 to 100. ```json {"jsonrpc":"2.0","id":"read-1","method":"tools/call","params":{"name":"store_resources_list","arguments":{"collection":"agent-chat","kind":"document","after":"","limit":1}}} ``` Check that `result.isError` is `false`, `result.structuredContent.state` is `succeeded`, and the returned page contains `result.structuredContent.result.documents` and `result.structuredContent.result.next`. If the server supplies a nonempty `result.structuredContent.invocation_id`, you may report it. A successful free read is complete without an invocation ID. Keep the returned page and continue without retrying for an ID. An empty first page with `next` equal to `""` means no documents are visible to this connection in this collection. - If discovery reports that this connection is unpublished, say so. If discovery is unreachable or the client lacks the connector, identify that condition. Keep account credentials in the client’s authorization flow. Never ask a hosted chat user for a personal API key, a device code or a CLI session, or run a CLI login in the hosted agent. ## Try the public catalog When the chat can send HTTPS requests, it can search the public catalog immediately. This read uses no account, cookie, API key or Authorization header. Use the user’s search term in `q`. ```http POST https://api.semesh.net/v1/service-units/semesh.units/actions/search.list/invoke Content-Type: application/json {"input":{"q":"llm","scope":"public","limit":3}} ``` On HTTP 200, check both `success` and `data.success`. Read the matching service IDs from `data.data[].id` and the top-level `request_id` from this response. A successful public search confirms catalog access. Account access is confirmed by the connector’s browser authorization. ## Local CLI setup 1. `npm install -g semesh@latest`. 2. Start with `semesh search ""` to discover the public catalog. Run `semesh login` (a human approves once in the browser) — or set `SEMESH_API_KEY=YOUR_API_KEY` for headless/CI — only when the selected action needs an account. 3. The full agent contract lives at `https://semesh.io/agent.md` — fetch it for the complete recipe set, then `semesh recipes` for the shortest path to any task. `scope=public` Search and Detail are anonymous and read-only. Use an account for accessible or owned views and for Actions that require one. If the selected paid Action reports insufficient funds, report the reason returned for its payer. Offer only funding options published by that deployment. ## Core rule Use the public `semesh.units` `search.list` Action to find a callable Action. Read its published input, effects, price and required authorization in the [live Semesh agent guide](https://api.semesh.net/agent.md) and the Action contract. Send the bounded `meta.catalog_token` as `X-Semesh-Catalog-Token` only on the exact advertised Guide, Group, or Unit GET. `scope=public` Search/Detail is anonymous; `scope=accessible` and `scope=owned` are authenticated actor-specific states and must not enter a shared cache. The public HTTP execution entry is `POST /v1/service-units/{unit}/actions/{action}/invoke`. A hosted agent uses the tools actually advertised by its authorized MCP connection. For a paid or side-effecting Action, keep a stable idempotency key for this intent and submit the published input. The server selects the active contract and applies its authorization, price and spending limits. A direct user request authorizes ordinary paid invocation, deploy, and mechanical publish without a duplicate confirmation. Ask for a separate confirmation only for destructive, high-impact, authorization-expanding, truly irreversible, or explicitly `requires_confirmation` actions. When the server returns `confirmation_required`, show the requested effects, grant changes, and exact price or maximum charge. Follow the supplied confirmation flow with the same intent, input and key. For a delegated payment, including one requested through a personal MCP connector, show the server-supplied `confirm_url` to the payer. Only the payer may approve in their own first-party Semesh session. On `escalate` or when no confirmation link is supplied, stop and report the pending payer action. Never use an agent bearer or a separate CLI session to confirm on the payer’s behalf. For a paid or side-effecting Action, keep the invocation ID and read its terminal record and settlement receipt through the authorized carrier. In a hosted MCP chat, use an observation tool only if this connection advertises it. Otherwise retain the ID and report the last confirmed state. For the HTTP carrier, the read paths are `GET /v1/invocations/{id}` and `GET /v1/invocations/{id}/receipt`. An HTTP client that loses the response uses `GET /v1/invocations/lookup` with its original credential and key before retrying. A pending or unknown invocation stays with its original recovery owner. A same-key byte-identical replay returns the same Invocation, provider result, receipt, and settlement reference without increasing provider effects, captures, or owner grants. Semesh publishes one public Model Service Unit. DeepSeek is a versioned model choice advertised in `actions[].model_choices`. If search returns `matched_choice=deepseek`, use the advertised two-field `model_choice_pin` alongside `input` and keep that selection when observing or retrying the same intent. Retired legacy execution identities and resource-specific execution routes return only effect-zero `410 legacy_protocol_retired`; they never proxy, translate, execute, call a provider, or move money. Passing mechanical protocol checks publish and become discoverable automatically; there is no default human approval queue. Source deployment additionally requires its own authorization. Card top-up is contained and Legal remains unverified; do not claim card funding is available. ## Check deployment readiness ```bash semesh deploy preflight ./my-app --full-stack --json ``` The `semesh.apps` system Service Unit owns deployment and its lifecycle. Read the active Action contract and the preflight fields `admission.can_start_now`, `code`, `message`, and `fix`. If `app_deployments.create` reports `deployment_authorization_unavailable`, stop at preflight. Preflight uploads no source and creates no app, build, hold, publication, or URL. For ids that already exist, observe and recover with `semesh deploy status --json`, `semesh deploy logs --json`, and `semesh deploy url --json`. Existing status or URL readback is not evidence that a new release can start. When deployment authorization becomes available and preflight allows the operation, the intended owner command is `semesh deploy ./my-app --name my-app --full-stack --wait --json`. Report a live URL only from a successful serving response or URL readback; never construct one. ## App payer authorization An already serving App may use end-user payment only when its published Action and active delegation authorize that payer. Use the App carrier’s `Semesh-Delegation` as specified by its active contract. For a personal agent, let the native MCP connector use its own OAuth bearer at `https://api.semesh.net/mcp`. Keep each credential on its authorized carrier and use the paid Action’s terminal receipt to report settlement. ## Call a Service Unit Action from the local CLI ```bash semesh search "" --json semesh show --json semesh call --action --input '' --idempotency-key --wait --json ``` The stable key in this example is for a paid or side-effecting call. For the CLI caller’s own intent, use `--confirm` only for the current server challenge after the user approves. Delegated payer confirmation belongs to the first-party flow above. An uncertain outcome can be looked up with `semesh call --lookup --idempotency-key `. ## Platform billing Semesh denominates prices, quotes, holds, charges, refunds, earnings and settlement in Aev. Amounts use integer atoms with currency `AEV` and exponent `8` (100,000,000 atoms per Aev). A personal agent uses the payer’s platform wallet and the spending allowance granted to its connection. Compare these Aev amounts directly. USD conversion applies only to top-ups and payouts. These operations use the rate in the active `policy/usd-aev-100.v1`. Its default is 1 USD = 100 Aev. ## Local MCP plugin The local plugin starts its stdio MCP server with `npx -y semesh mcp` and uses the local CLI session or `SEMESH_API_KEY`. In a hosted chat use the personal-agent connector and browser authorization described above.