graft
Import
Section titled “Import”import * as api from "@fungi.computer/graft";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | AuthorizedShiitakeSession | A Session returned by the host’s authorization boundary. |
| type alias | AuthorizedShiitakeSessionDirectory | Directory owner used by ACP lifecycle callbacks. |
| type alias | ShiitakeAcpAdapterOptions | Host directory, agent identity and lifecycle options for an ACP adapter. |
| type alias | ShiitakeClientLease | Host-authorized Agent client and the release action for its lease. |
| type alias | ShiitakeSessionDirectoryOptions | Client leasing and context validation supplied by the host. |
| constant | agentAcpMethods | Maintained ACP method descriptors advertised by this agent adapter. |
| function | createShiitakeAcpAgent() | Projects ACP stable v1 onto Sessions from one host-authorized directory. |
| function | createAuthorizedShiitakeSessionDirectory() | Adapt one host-authorized Shiitake client factory to ACP Session ownership. Every create/load gets its own client lease; closing ACP releases that lease without deleting the durable Session. |
AuthorizedShiitakeSessiontype alias
Section titled “AuthorizedShiitakeSession”type AuthorizedShiitakeSession = Readonly<{ session: ShiitakeSession; sessionId: string; close: () => Promise<void>;}>;A Session returned by the host’s authorization boundary.
AuthorizedShiitakeSessionDirectorytype alias
Section titled “AuthorizedShiitakeSessionDirectory”type AuthorizedShiitakeSessionDirectory = Readonly<{ create: (input) => Promise<AuthorizedShiitakeSession>; list?: (input) => Promise<acp.ListSessionsResponse>; load: (input) => Promise<AuthorizedShiitakeSession>;}>;Directory owner used by ACP lifecycle callbacks.
ShiitakeAcpAdapterOptionstype alias
Section titled “ShiitakeAcpAdapterOptions”type ShiitakeAcpAdapterOptions = Readonly<{ directory: AuthorizedShiitakeSessionDirectory; name?: string; terminalAuth?: acp.AuthMethodTerminal; closeSettleMs?: number;}>;Host directory, agent identity and lifecycle options for an ACP adapter.
ShiitakeClientLeasetype alias
Section titled “ShiitakeClientLease”type ShiitakeClientLease = Readonly<{ client: ShiitakeAgent; close: () => Promise<void>;}>;Host-authorized Agent client and the release action for its lease.
ShiitakeSessionDirectoryOptionstype alias
Section titled “ShiitakeSessionDirectoryOptions”type ShiitakeSessionDirectoryOptions = Readonly<{ openClient: () => Promise<ShiitakeClientLease>; validateContext?: (input) => void;}>;Client leasing and context validation supplied by the host.
agentAcpMethodsconstant
Section titled “agentAcpMethods”const agentAcpMethods: object = acp.methods.agent;Maintained ACP method descriptors advertised by this agent adapter.
createShiitakeAcpAgent()function
Section titled “createShiitakeAcpAgent()”function createShiitakeAcpAgent(options): AgentApp;Projects ACP stable v1 onto Sessions from one host-authorized directory.
The host directory owns Session creation/loading and authorization. ACP request IDs are retained for correlation while Shiitake generates its own idempotency key and returns its own accepted command ID.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
ShiitakeAcpAdapterOptions |
Returns
Section titled “Returns”AgentApp
createAuthorizedShiitakeSessionDirectory()function
Section titled “createAuthorizedShiitakeSessionDirectory()”function createAuthorizedShiitakeSessionDirectory( options,): AuthorizedShiitakeSessionDirectory;Adapt one host-authorized Shiitake client factory to ACP Session ownership. Every create/load gets its own client lease; closing ACP releases that lease without deleting the durable Session.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
ShiitakeSessionDirectoryOptions |