Skip to content
API reference

graft

Import
import * as api from "@fungi.computer/graft";
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”
Signature
type AuthorizedShiitakeSession = Readonly<{
session: ShiitakeSession;
sessionId: string;
close: () => Promise<void>;
}>;

A Session returned by the host’s authorization boundary.


AuthorizedShiitakeSessionDirectorytype alias

Section titled “AuthorizedShiitakeSessionDirectory”
Signature
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”
Signature
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”
Signature
type ShiitakeClientLease = Readonly<{
client: ShiitakeAgent;
close: () => Promise<void>;
}>;

Host-authorized Agent client and the release action for its lease.


ShiitakeSessionDirectoryOptionstype alias

Section titled “ShiitakeSessionDirectoryOptions”
Signature
type ShiitakeSessionDirectoryOptions = Readonly<{
openClient: () => Promise<ShiitakeClientLease>;
validateContext?: (input) => void;
}>;

Client leasing and context validation supplied by the host.

agentAcpMethodsconstant

Section titled “agentAcpMethods”
Signature
const agentAcpMethods: object = acp.methods.agent;

Maintained ACP method descriptors advertised by this agent adapter.

createShiitakeAcpAgent()function

Section titled “createShiitakeAcpAgent()”
Signature
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.

Parameter Type
options ShiitakeAcpAdapterOptions

AgentApp


createAuthorizedShiitakeSessionDirectory()function

Section titled “createAuthorizedShiitakeSessionDirectory()”
Signature
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.

Parameter Type
options ShiitakeSessionDirectoryOptions

AuthorizedShiitakeSessionDirectory