@ai-ecoverse/slicc-agent 7.11.5 → 7.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/agent.js +1 -0
- package/dist/agent.js.map +2 -2
- package/dist/client.js +16 -1
- package/dist/client.js.map +2 -2
- package/dist/host.js +18 -3
- package/dist/host.js.map +2 -2
- package/dist/index.js +5 -1
- package/dist/index.js.map +2 -2
- package/dist/inventory.js +119 -0
- package/dist/inventory.js.map +7 -0
- package/dist/monitor/index.js +1 -0
- package/dist/monitor/index.js.map +2 -2
- package/dist/page.js.map +2 -2
- package/dist/remote/busy.js +13 -12
- package/dist/remote/busy.js.map +2 -2
- package/dist/remote/client.js +58 -0
- package/dist/remote/client.js.map +2 -2
- package/dist/remote/inventory.js +15 -0
- package/dist/remote/inventory.js.map +7 -0
- package/dist/services.js +13 -0
- package/dist/services.js.map +2 -2
- package/dist/types/agent.d.ts +1 -0
- package/dist/types/client.d.ts +3 -1
- package/dist/types/host.d.ts +2 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/inventory.d.ts +32 -0
- package/dist/types/monitor/index.d.ts +9 -0
- package/dist/types/page.d.ts +1 -0
- package/dist/types/remote/busy.d.ts +19 -0
- package/dist/types/remote/client.d.ts +8 -2
- package/dist/types/remote/inventory.d.ts +2 -0
- package/dist/types/services.d.ts +31 -0
- package/package.json +7 -7
package/dist/services.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/services.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Context, JsonValue, RemoteContract, ReplicatedState } from '@earendil-works/chord';\nimport type { BlockedReason, ConversationView } from '@earendil-works/pi-durable';\nimport type { Approval, ApprovalAnswer, ApprovalDecided } from './approvals/index.ts';\nimport type {\n ApprovalPolicy,\n ApprovalPolicyChange,\n ApprovalPolicySet,\n} from './approvals/policy.ts';\nimport type { AgentSudo } from './approvals/sudo.ts';\nimport type { SendAttachment, ShownAttachment } from './attachments.ts';\nimport type { ChangesView } from './changes/git.ts';\nimport type { FrozenCone } from './freezer/index.ts';\nimport type { ImportProgress, ImportResult } from './freezer/v6.ts';\nimport type { GuestOpened, Proposed, ProposeRequest } from './guests/index.ts';\nimport type { GuestDraft, GuestGates, GuestSeat } from './guests/seats.ts';\nimport type { MemoryEntry, MemoryScope, MemoryTag } from './memory/format.ts';\nimport type { AgentRemote } from './remote/host.ts';\nimport type { AgentPages } from './remote/pages.ts';\nimport type { VaultState } from './secrets/vault.ts';\nimport { contract } from './serving.ts';\nimport type { DeviceSignIn } from './sign-ins.ts';\nimport type { SkillPackage, SkillSource } from './skills/skills.ts';\nimport type { Sprinkle } from './sprinkles/kind.ts';\n\nexport type SendMode = 'steer' | 'followUp' | 'reject';\n\nexport interface SendRequest {\n text: string;\n whenBusy: SendMode;\n requestId: string | null;\n agentId?: string | null;\n attachments?: SendAttachment[];\n}\n\nexport interface OperationError {\n code: string;\n message: string;\n}\n\nexport type SendResponse =\n | { accepted: true; submissionId: string; error: null }\n | { accepted: false; submissionId: null; error: OperationError };\n\nexport type PromptResult =\n | { status: 'done'; text: string; reason: null }\n | { status: 'unanswered'; text: null; reason: string };\n\nexport interface AgentControl {\n send(request: SendRequest, context: Context): Promise<SendResponse>;\n wait(submissionId: string, context: Context): Promise<PromptResult>;\n withdraw(\n submissionId: string,\n context: Context\n ): Promise<{ outcome: 'withdrawn' | 'already_placed' | 'not_found' }>;\n abort(context: Context): Promise<void>;\n compact(instructions: string | null, context: Context): Promise<SendResponse>;\n compactAgent(\n agentId: string,\n instructions: string | null,\n context: Context\n ): Promise<SendResponse>;\n reset(handoff: string | null, context: Context): Promise<void>;\n configure(change: AgentSettingsChange, context: Context): Promise<void>;\n rewind(messageId: string | null, context: Context): Promise<Rewound>;\n rewindAgent(agentId: string, messageId: string | null, context: Context): Promise<Rewound>;\n resolveLick(\n lickId: string,\n state: 'confirmed' | 'dismissed',\n context: Context\n ): Promise<LickResolved>;\n resolveAgentLick(\n agentId: string,\n lickId: string,\n state: 'confirmed' | 'dismissed',\n context: Context\n ): Promise<LickResolved>;\n webhook(\n name: string,\n delivery: WebhookRequest,\n context: Context\n ): Promise<{ delivered: boolean }>;\n stopAgent(agentId: string, context: Context): Promise<void>;\n selectCone(agentId: string, context: Context): Promise<void>;\n createCone(name: string, context: Context): Promise<Created>;\n createScoop(parentId: string, name: string, context: Context): Promise<Created>;\n drop(agentId: string, context: Context): Promise<Created>;\n unqueue(\n agentId: string | null,\n submissionId: string,\n context: Context\n ): Promise<{ outcome: 'withdrawn' | 'already_placed' | 'not_found' }>;\n sprinkleSend(\n sprinkleId: string,\n payload: { action: string; data: JsonValue | null; target: string | null },\n context: Context\n ): Promise<{ delivered: boolean }>;\n sprinkleCall(\n sprinkleId: string,\n method: string,\n args: JsonValue[],\n context: Context\n ): Promise<JsonValue>;\n memorySave(draft: MemoryDraft, context: Context): Promise<MemoryEntry>;\n memoryRemove(id: string, context: Context): Promise<{ removed: boolean }>;\n freeze(agentId: string, context: Context): Promise<Created>;\n newChat(agentId: string, context: Context): Promise<Created>;\n thaw(frozenId: string, context: Context): Promise<Created>;\n discard(frozenId: string, context: Context): Promise<Created>;\n importProfile(request: ImportRequest, context: Context): Promise<ImportResult>;\n importCancel(context: Context): Promise<void>;\n changesOpen(context: Context): Promise<void>;\n changeAccept(path: string, context: Context): Promise<Created>;\n changeRevert(path: string, context: Context): Promise<Created>;\n monitorOpen(lease: string | null, resync: boolean, context: Context): Promise<MonitorLease>;\n monitorClose(lease: string, context: Context): Promise<void>;\n image(ref: ImageRef, context: Context): Promise<StoredImage>;\n agentCommands(agentId: string, context: Context): Promise<Command[]>;\n toolLabel(agentId: string, callIds: string[], context: Context): Promise<string | null>;\n guestOpen(draft: GuestDraft, context: Context): Promise<GuestOpened>;\n guestRevoke(id: string, context: Context): Promise<{ revoked: boolean }>;\n guestAlwaysForget(\n seat: string,\n approval: string,\n context: Context\n ): Promise<{ removed: boolean }>;\n approvalPolicySet(change: ApprovalPolicyChange, context: Context): Promise<ApprovalPolicySet>;\n decide(\n id: string,\n decision: ApprovalAnswer,\n reason: string | null,\n context: Context\n ): Promise<ApprovalDecided>;\n}\n\nexport interface ImportRequest {\n upload: string | null;\n data: string | null;\n inPlace?: string | null;\n again: boolean;\n preview: boolean;\n}\n\nexport interface ImageRef {\n entry: number;\n message: number;\n part: number;\n}\n\nexport type StoredImage = { data: string; mimeType: string } | { data: null; mimeType: null };\n\nexport interface MonitorLease {\n lease: string;\n ttlMs: number;\n}\n\nexport interface MonitorAgent {\n id: string;\n name: string;\n kind: 'cone' | 'scoop';\n parentId: string | null;\n model: string | null;\n running: boolean;\n queued: number;\n tool: string | null;\n retry: { attempt: number; since: number; error: string } | null;\n failed: string | null;\n context: number | null;\n cpu?: number | null;\n}\n\nexport interface MonitorTask {\n id: string;\n kind: string;\n detail: string | null;\n agentId: string | null;\n owner: string | null;\n status: 'pending' | 'running' | 'waiting' | 'sleeping' | 'completing';\n phase: string;\n background: boolean;\n aborting: number | null;\n since: number;\n waits: number;\n until: number | null;\n blocked: BlockedReason | null;\n}\n\nexport interface MonitorProcess {\n pid: number;\n ppid: number;\n pgid: number;\n user: string | null;\n agentId: string | null;\n command: string;\n state: 'S' | 'Z';\n started: number;\n zombie: number | null;\n tty: boolean;\n rss: number | null;\n utime?: number;\n stime?: number;\n cpu?: number | null;\n}\n\nexport interface MonitorProblem {\n id: string;\n at: number;\n agentId: string | null;\n kind: 'task' | 'retry' | 'turn' | 'report';\n message: string;\n report?: { type: string; source: string | null };\n taskId?: string;\n}\n\nexport interface MonitorFeed {\n open: boolean;\n at: number;\n usage: { tokens: number; cost: number; free: boolean } | null;\n agents: MonitorAgent[];\n tasks: MonitorTask[];\n processes: MonitorProcess[] | null;\n kernel: 'checking' | 'ok' | 'unreachable';\n problems: MonitorProblem[];\n paused: boolean;\n latency?: MonitorLatency | null;\n}\n\nexport interface MonitorLatency {\n requests: number;\n medianMs: number;\n firstChunkMedianMs: number | null;\n errors: number;\n series: number[];\n models: { model: string; requests: number; medianMs: number }[];\n}\n\nexport interface MemoryDraft {\n id: string | null;\n scope: string;\n section: string;\n title: string;\n body: string;\n tag: MemoryTag | null;\n}\n\nexport type Created = { id: string; error: null } | { id: null; error: string };\n\nexport interface AgentSummary {\n id: string;\n name: string;\n kind: 'cone' | 'scoop';\n parentId: string | null;\n role: string | null;\n}\n\nexport interface AgentsSummary {\n active: string;\n agents: AgentSummary[];\n}\n\nexport type LickResolved =\n | { done: true; text: string; error: null }\n | { done: false; text: null; error: string };\n\nexport interface WebhookRequest {\n id: string | null;\n headers: Record<string, string>;\n body: string;\n}\n\nexport type Rewound =\n | { done: true; text: string; reason: null; attachments?: ShownAttachment[] }\n | { done: false; text: null; reason: 'busy' | 'no-turn' };\n\nexport interface AgentSettingsChange {\n model: { provider: string; modelId: string } | null;\n thinkingLevel: 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null;\n agentId?: string | null;\n}\n\nconst keys = <T>(record: Record<keyof T, true>) => Object.keys(record) as (keyof T & string)[];\n\nexport const CONTROL_METHODS = keys<AgentControl>({\n send: true,\n wait: true,\n withdraw: true,\n abort: true,\n compact: true,\n compactAgent: true,\n reset: true,\n configure: true,\n rewind: true,\n rewindAgent: true,\n resolveLick: true,\n resolveAgentLick: true,\n webhook: true,\n stopAgent: true,\n selectCone: true,\n createCone: true,\n createScoop: true,\n drop: true,\n unqueue: true,\n sprinkleSend: true,\n sprinkleCall: true,\n memorySave: true,\n memoryRemove: true,\n freeze: true,\n newChat: true,\n thaw: true,\n discard: true,\n importProfile: true,\n importCancel: true,\n changesOpen: true,\n changeAccept: true,\n changeRevert: true,\n monitorOpen: true,\n monitorClose: true,\n image: true,\n agentCommands: true,\n toolLabel: true,\n guestOpen: true,\n guestRevoke: true,\n guestAlwaysForget: true,\n approvalPolicySet: true,\n decide: true,\n});\n\nexport const OWNER_DEVICE_METHODS: readonly (keyof AgentControl & string)[] = [\n 'decide',\n 'guestOpen',\n 'guestRevoke',\n 'guestAlwaysForget',\n 'approvalPolicySet',\n];\n\nexport const CONTROL_READS: readonly (keyof AgentControl & string)[] = [\n 'wait',\n 'changesOpen',\n 'monitorOpen',\n 'monitorClose',\n 'image',\n 'toolLabel',\n];\n\nexport const AgentControl: RemoteContract = contract('slicc.agent.control', {\n control: { methods: CONTROL_METHODS },\n view: { methods: [...CONTROL_READS, ...OWNER_DEVICE_METHODS] },\n});\n\nexport type Delivered = 'run' | 'steer' | 'follow-up';\n\nexport interface AgentTranscript {\n readonly state: ReplicatedState<ConversationView>;\n readonly deliveries: ReplicatedState<Record<string, Delivered>>;\n readonly agents: ReplicatedState<AgentsSummary>;\n readonly views: ReplicatedState<Record<string, ConversationView>>;\n readonly commands: ReplicatedState<Command[]>;\n readonly privateRevision: ReplicatedState<PrivateRevision>;\n readonly sprinkles: ReplicatedState<Sprinkle[]>;\n readonly memories: ReplicatedState<MemoryEntry[]>;\n readonly memoryScopes: ReplicatedState<MemoryScope[]>;\n readonly frozen: ReplicatedState<FrozenCone[]>;\n readonly importing: ReplicatedState<ImportProgress>;\n readonly changes: ReplicatedState<ChangesView>;\n readonly monitor: ReplicatedState<MonitorFeed>;\n readonly vault: ReplicatedState<VaultState>;\n readonly labels: ReplicatedState<Record<string, string>>;\n readonly guests: ReplicatedState<GuestSeat[]>;\n readonly approvals: ReplicatedState<Approval[]>;\n readonly approvalPolicy: ReplicatedState<ApprovalPolicy>;\n}\n\nexport interface PrivateRevision {\n revision: number;\n}\n\nexport interface Command {\n name: string;\n description: string;\n kind: 'prompt' | 'skill' | 'action';\n source?: SkillSource;\n package?: SkillPackage;\n}\n\nexport const TRANSCRIPT_STATES = keys<AgentTranscript>({\n state: true,\n deliveries: true,\n agents: true,\n views: true,\n commands: true,\n privateRevision: true,\n sprinkles: true,\n memories: true,\n memoryScopes: true,\n frozen: true,\n importing: true,\n changes: true,\n monitor: true,\n vault: true,\n labels: true,\n guests: true,\n approvals: true,\n approvalPolicy: true,\n});\n\nexport const AgentTranscript: RemoteContract = contract('slicc.agent.transcript', {\n transcript: { state: TRANSCRIPT_STATES },\n});\n\nexport const REMOTE_METHODS = keys<AgentRemote>({\n prompt: true,\n watch: true,\n next: true,\n close: true,\n abort: true,\n});\n\nexport const REMOTE_READS: readonly (keyof AgentRemote & string)[] = ['watch', 'next', 'close'];\n\nexport interface GuestShown {\n id: string;\n label: string;\n agentId: string;\n name: string;\n expiresAt: number | null;\n gates: GuestGates;\n}\n\nexport interface GuestProposal {\n id: string;\n text: string;\n state: 'queued' | 'pending' | 'approved' | 'rejected' | 'unanswered' | 'withdrawn';\n reason: string | null;\n createdAt: number;\n decidedAt: number | null;\n}\n\nexport interface AgentGuest {\n readonly transcript: ReplicatedState<ConversationView>;\n readonly seat: ReplicatedState<GuestShown>;\n readonly proposals: ReplicatedState<GuestProposal[]>;\n propose(request: ProposeRequest, context: Context): Promise<Proposed>;\n guestOpen(draft: GuestDraft, context: Context): Promise<GuestOpened>;\n guestRevoke(id: string, context: Context): Promise<{ revoked: boolean }>;\n}\n\nexport const GUEST_STATES = ['transcript', 'seat', 'proposals'] as const;\n\nexport const GUEST_METHODS = ['propose', 'guestOpen', 'guestRevoke'] as const;\n\nexport const AgentGuestService: RemoteContract = contract('slicc.agent.guest', {\n guest: { state: GUEST_STATES, methods: GUEST_METHODS },\n none: {},\n});\n\nexport const AgentRemoteService: RemoteContract = contract('slicc.agent.remote', {\n remote: { methods: REMOTE_METHODS },\n watch: { methods: REMOTE_READS },\n});\n\nexport const PAGE_METHODS = keys<AgentPages>({\n open: true,\n report: true,\n next: true,\n answer: true,\n close: true,\n});\n\nexport const AgentPagesService: RemoteContract = contract('slicc.agent.pages', {\n pages: { methods: PAGE_METHODS },\n none: {},\n});\n\nexport const SUDO_METHODS = keys<Omit<AgentSudo, 'approvals'>>({\n request: true,\n withdraw: true,\n});\n\nexport const AgentSudoService: RemoteContract = contract('slicc.agent.sudo', {\n sudo: { state: ['approvals'], methods: SUDO_METHODS },\n none: {},\n});\n\nexport interface ModelChoice {\n id: string;\n label: string;\n provider: string;\n kind: 'chat' | 'classifier';\n reasoning: boolean;\n images?: boolean;\n contextWindow: number;\n}\n\nexport interface AccountState {\n id: string;\n provider: string;\n identity: string;\n status: 'connected' | 'disconnected' | 'expired';\n auth: 'api-key' | 'oauth' | 'local';\n needs: 'cors-free-transport' | null;\n blocked?: 'cors-free-transport';\n group?: 'providers' | 'mcp';\n secret?: 'api-key' | 'token';\n store?: 'vault';\n fields?: AccountField[];\n description?: string;\n keyUrl?: string;\n vaultName?: string;\n state?: McpServerState;\n}\n\nexport type McpServerState =\n | 'connecting'\n | 'connected'\n | 'needs-secret'\n | 'needs-auth'\n | 'failed'\n | 'disabled'\n | 'refused';\n\nexport type McpRefusalCode =\n | 'bad-name'\n | 'duplicate'\n | 'not-found'\n | 'not-object'\n | 'bad-token'\n | 'token-conflict'\n | 'url-secret'\n | 'header-secret'\n | 'stdio'\n | 'sse'\n | 'bad-url'\n | 'insecure-url'\n | 'file-invalid'\n | 'file-unreadable'\n | 'file-unwritable'\n | 'not-owner'\n | 'invalid';\n\nexport interface McpRefusal {\n code: McpRefusalCode;\n reason: string;\n}\n\nexport type McpRefusals = Record<string, McpRefusal>;\n\nexport type McpEdit = { ok: true } | ({ ok: false } & McpRefusal);\n\nexport interface AccountField {\n name: string;\n label: string;\n required?: boolean;\n placeholder?: string;\n help?: string;\n customBase?: true;\n vaultSetting?: string;\n options?: readonly { value: string; label: string }[];\n value?: string;\n}\n\nexport interface ProviderOption {\n id: string;\n name: string;\n description?: string;\n auth: 'api-key' | 'oauth' | 'fields' | 'local';\n fields?: AccountField[];\n keyUrl?: string;\n needs?: 'cors-free-transport';\n blocked?: 'cors-free-transport';\n vaultName?: string;\n}\n\nexport interface BudgetState {\n provider: string;\n percent: number;\n window: 'weekly';\n resets: string;\n}\n\nexport interface SignIn {\n clientId: string;\n scopes: string;\n imsEnvironment: string;\n}\n\nexport interface McpSignIn {\n url: string;\n state: string;\n}\n\nexport interface SettingsState {\n models: ModelChoice[];\n accounts: AccountState[];\n providers?: ProviderOption[];\n budget?: BudgetState | null;\n budgets?: BudgetState[];\n moved?: { kind: 'model' | 'mcp'; label: string }[];\n labels?: Record<string, string>;\n}\n\nexport interface AgentSettings {\n readonly state: ReplicatedState<SettingsState>;\n connect(\n providerId: string,\n secret: string | null,\n fields: Record<string, string> | null,\n context: Context\n ): Promise<void>;\n disconnect(providerId: string, context: Context): Promise<void>;\n remove(providerId: string, context: Context): Promise<void>;\n serverUrl(providerId: string, context: Context): Promise<string | null>;\n signIn(providerId: string, context: Context): Promise<SignIn | McpSignIn | DeviceSignIn | null>;\n dismissMoved(context: Context): Promise<void>;\n addServer(name: string, entry: unknown, context: Context): Promise<McpEdit>;\n removeServer(id: string, context: Context): Promise<McpEdit>;\n refusals(context: Context): Promise<McpRefusals>;\n}\n\nexport const SETTINGS_METHODS = keys<\n Omit<AgentSettings, 'state' | 'addServer' | 'removeServer' | 'refusals'>\n>({\n connect: true,\n disconnect: true,\n remove: true,\n serverUrl: true,\n signIn: true,\n dismissMoved: true,\n});\n\nexport const OWNER_SETTINGS_METHODS: readonly (keyof Omit<AgentSettings, 'state'> & string)[] = [\n ...SETTINGS_METHODS,\n 'addServer',\n 'removeServer',\n 'refusals',\n];\n\nexport const AgentSettings: RemoteContract = contract('slicc.agent.settings', {\n owner: { state: ['state'], methods: OWNER_SETTINGS_METHODS },\n settings: { state: ['state'], methods: SETTINGS_METHODS },\n view: { state: ['state'] },\n});\n"],
|
|
5
|
-
"mappings": "AAmBA,SAAS,gBAAgB;AAoQzB,MAAM,OAAO,CAAI,WAAkC,OAAO,KAAK,MAAM;AAE9D,MAAM,kBAAkB,KAAmB;AAAA,EAChD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,cAAc;AAAA,EACd,OAAO;AAAA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B,CAAC;AAEM,MAAM,yBAAmF;AAAA,EAC9F,GAAG;AAAA,EACH;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,gBAAgC,SAAS,wBAAwB;AAAA,EAC5E,OAAO,EAAE,OAAO,CAAC,OAAO,GAAG,SAAS,uBAAuB;AAAA,EAC3D,UAAU,EAAE,OAAO,CAAC,OAAO,GAAG,SAAS,iBAAiB;AAAA,EACxD,MAAM,EAAE,OAAO,CAAC,OAAO,EAAE;AAC3B,CAAC;",
|
|
4
|
+
"sourcesContent": ["import type { Context, JsonValue, RemoteContract, ReplicatedState } from '@earendil-works/chord';\nimport type { BlockedReason, ConversationView } from '@earendil-works/pi-durable';\nimport type { Approval, ApprovalAnswer, ApprovalDecided } from './approvals/index.ts';\nimport type {\n ApprovalPolicy,\n ApprovalPolicyChange,\n ApprovalPolicySet,\n} from './approvals/policy.ts';\nimport type { AgentSudo } from './approvals/sudo.ts';\nimport type { SendAttachment, ShownAttachment } from './attachments.ts';\nimport type { ChangesView } from './changes/git.ts';\nimport type { FrozenCone } from './freezer/index.ts';\nimport type { ImportProgress, ImportResult } from './freezer/v6.ts';\nimport type { GuestOpened, Proposed, ProposeRequest } from './guests/index.ts';\nimport type { GuestDraft, GuestGates, GuestSeat } from './guests/seats.ts';\nimport type { MemoryEntry, MemoryScope, MemoryTag } from './memory/format.ts';\nimport type { AgentRemote } from './remote/host.ts';\nimport type { AgentPages } from './remote/pages.ts';\nimport type { VaultState } from './secrets/vault.ts';\nimport { contract } from './serving.ts';\nimport type { DeviceSignIn } from './sign-ins.ts';\nimport type { SkillPackage, SkillSource } from './skills/skills.ts';\nimport type { Sprinkle } from './sprinkles/kind.ts';\n\nexport type SendMode = 'steer' | 'followUp' | 'reject';\n\nexport interface SendRequest {\n text: string;\n whenBusy: SendMode;\n requestId: string | null;\n agentId?: string | null;\n attachments?: SendAttachment[];\n}\n\nexport interface OperationError {\n code: string;\n message: string;\n}\n\nexport type SendResponse =\n | { accepted: true; submissionId: string; error: null }\n | { accepted: false; submissionId: null; error: OperationError };\n\nexport type PromptResult =\n | { status: 'done'; text: string; reason: null }\n | { status: 'unanswered'; text: null; reason: string };\n\nexport interface AgentControl {\n send(request: SendRequest, context: Context): Promise<SendResponse>;\n wait(submissionId: string, context: Context): Promise<PromptResult>;\n withdraw(\n submissionId: string,\n context: Context\n ): Promise<{ outcome: 'withdrawn' | 'already_placed' | 'not_found' }>;\n abort(context: Context): Promise<void>;\n compact(instructions: string | null, context: Context): Promise<SendResponse>;\n compactAgent(\n agentId: string,\n instructions: string | null,\n context: Context\n ): Promise<SendResponse>;\n reset(handoff: string | null, context: Context): Promise<void>;\n configure(change: AgentSettingsChange, context: Context): Promise<void>;\n rewind(messageId: string | null, context: Context): Promise<Rewound>;\n rewindAgent(agentId: string, messageId: string | null, context: Context): Promise<Rewound>;\n resolveLick(\n lickId: string,\n state: 'confirmed' | 'dismissed',\n context: Context\n ): Promise<LickResolved>;\n resolveAgentLick(\n agentId: string,\n lickId: string,\n state: 'confirmed' | 'dismissed',\n context: Context\n ): Promise<LickResolved>;\n webhook(\n name: string,\n delivery: WebhookRequest,\n context: Context\n ): Promise<{ delivered: boolean }>;\n stopAgent(agentId: string, context: Context): Promise<void>;\n selectCone(agentId: string, context: Context): Promise<void>;\n createCone(name: string, context: Context): Promise<Created>;\n createScoop(parentId: string, name: string, context: Context): Promise<Created>;\n drop(agentId: string, context: Context): Promise<Created>;\n unqueue(\n agentId: string | null,\n submissionId: string,\n context: Context\n ): Promise<{ outcome: 'withdrawn' | 'already_placed' | 'not_found' }>;\n sprinkleSend(\n sprinkleId: string,\n payload: { action: string; data: JsonValue | null; target: string | null },\n context: Context\n ): Promise<{ delivered: boolean }>;\n sprinkleCall(\n sprinkleId: string,\n method: string,\n args: JsonValue[],\n context: Context\n ): Promise<JsonValue>;\n memorySave(draft: MemoryDraft, context: Context): Promise<MemoryEntry>;\n memoryRemove(id: string, context: Context): Promise<{ removed: boolean }>;\n freeze(agentId: string, context: Context): Promise<Created>;\n newChat(agentId: string, context: Context): Promise<Created>;\n thaw(frozenId: string, context: Context): Promise<Created>;\n discard(frozenId: string, context: Context): Promise<Created>;\n importProfile(request: ImportRequest, context: Context): Promise<ImportResult>;\n importCancel(context: Context): Promise<void>;\n changesOpen(context: Context): Promise<void>;\n changeAccept(path: string, context: Context): Promise<Created>;\n changeRevert(path: string, context: Context): Promise<Created>;\n monitorOpen(lease: string | null, resync: boolean, context: Context): Promise<MonitorLease>;\n monitorClose(lease: string, context: Context): Promise<void>;\n image(ref: ImageRef, context: Context): Promise<StoredImage>;\n agentCommands(agentId: string, context: Context): Promise<Command[]>;\n toolLabel(agentId: string, callIds: string[], context: Context): Promise<string | null>;\n guestOpen(draft: GuestDraft, context: Context): Promise<GuestOpened>;\n guestRevoke(id: string, context: Context): Promise<{ revoked: boolean }>;\n guestAlwaysForget(\n seat: string,\n approval: string,\n context: Context\n ): Promise<{ removed: boolean }>;\n approvalPolicySet(change: ApprovalPolicyChange, context: Context): Promise<ApprovalPolicySet>;\n decide(\n id: string,\n decision: ApprovalAnswer,\n reason: string | null,\n context: Context\n ): Promise<ApprovalDecided>;\n}\n\nexport interface ImportRequest {\n upload: string | null;\n data: string | null;\n inPlace?: string | null;\n again: boolean;\n preview: boolean;\n}\n\nexport interface ImageRef {\n entry: number;\n message: number;\n part: number;\n}\n\nexport type StoredImage = { data: string; mimeType: string } | { data: null; mimeType: null };\n\nexport interface MonitorLease {\n lease: string;\n ttlMs: number;\n}\n\nexport interface MonitorAgent {\n id: string;\n name: string;\n kind: 'cone' | 'scoop';\n parentId: string | null;\n model: string | null;\n running: boolean;\n queued: number;\n tool: string | null;\n retry: { attempt: number; since: number; error: string } | null;\n failed: string | null;\n context: number | null;\n cpu?: number | null;\n}\n\nexport interface MonitorTask {\n id: string;\n kind: string;\n detail: string | null;\n agentId: string | null;\n owner: string | null;\n status: 'pending' | 'running' | 'waiting' | 'sleeping' | 'completing';\n phase: string;\n background: boolean;\n aborting: number | null;\n since: number;\n waits: number;\n until: number | null;\n blocked: BlockedReason | null;\n}\n\nexport interface MonitorProcess {\n pid: number;\n ppid: number;\n pgid: number;\n user: string | null;\n agentId: string | null;\n command: string;\n state: 'S' | 'Z';\n started: number;\n zombie: number | null;\n tty: boolean;\n rss: number | null;\n utime?: number;\n stime?: number;\n cpu?: number | null;\n}\n\nexport interface MonitorProblem {\n id: string;\n at: number;\n agentId: string | null;\n kind: 'task' | 'retry' | 'turn' | 'report';\n message: string;\n report?: { type: string; source: string | null };\n taskId?: string;\n}\n\nexport interface MonitorFeed {\n open: boolean;\n at: number;\n usage: { tokens: number; cost: number; free: boolean } | null;\n agents: MonitorAgent[];\n tasks: MonitorTask[];\n processes: MonitorProcess[] | null;\n kernel: 'checking' | 'ok' | 'unreachable';\n problems: MonitorProblem[];\n paused: boolean;\n latency?: MonitorLatency | null;\n}\n\nexport interface MonitorLatency {\n requests: number;\n medianMs: number;\n firstChunkMedianMs: number | null;\n errors: number;\n series: number[];\n models: { model: string; requests: number; medianMs: number }[];\n}\n\nexport interface MemoryDraft {\n id: string | null;\n scope: string;\n section: string;\n title: string;\n body: string;\n tag: MemoryTag | null;\n}\n\nexport type Created = { id: string; error: null } | { id: null; error: string };\n\nexport interface AgentSummary {\n id: string;\n name: string;\n kind: 'cone' | 'scoop';\n parentId: string | null;\n role: string | null;\n}\n\nexport interface AgentsSummary {\n active: string;\n agents: AgentSummary[];\n}\n\nexport type LickResolved =\n | { done: true; text: string; error: null }\n | { done: false; text: null; error: string };\n\nexport interface WebhookRequest {\n id: string | null;\n headers: Record<string, string>;\n body: string;\n}\n\nexport type Rewound =\n | { done: true; text: string; reason: null; attachments?: ShownAttachment[] }\n | { done: false; text: null; reason: 'busy' | 'no-turn' };\n\nexport interface AgentSettingsChange {\n model: { provider: string; modelId: string } | null;\n thinkingLevel: 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null;\n agentId?: string | null;\n}\n\nconst keys = <T>(record: Record<keyof T, true>) => Object.keys(record) as (keyof T & string)[];\n\nexport const CONTROL_METHODS = keys<AgentControl>({\n send: true,\n wait: true,\n withdraw: true,\n abort: true,\n compact: true,\n compactAgent: true,\n reset: true,\n configure: true,\n rewind: true,\n rewindAgent: true,\n resolveLick: true,\n resolveAgentLick: true,\n webhook: true,\n stopAgent: true,\n selectCone: true,\n createCone: true,\n createScoop: true,\n drop: true,\n unqueue: true,\n sprinkleSend: true,\n sprinkleCall: true,\n memorySave: true,\n memoryRemove: true,\n freeze: true,\n newChat: true,\n thaw: true,\n discard: true,\n importProfile: true,\n importCancel: true,\n changesOpen: true,\n changeAccept: true,\n changeRevert: true,\n monitorOpen: true,\n monitorClose: true,\n image: true,\n agentCommands: true,\n toolLabel: true,\n guestOpen: true,\n guestRevoke: true,\n guestAlwaysForget: true,\n approvalPolicySet: true,\n decide: true,\n});\n\nexport const OWNER_DEVICE_METHODS: readonly (keyof AgentControl & string)[] = [\n 'decide',\n 'guestOpen',\n 'guestRevoke',\n 'guestAlwaysForget',\n 'approvalPolicySet',\n];\n\nexport const CONTROL_READS: readonly (keyof AgentControl & string)[] = [\n 'wait',\n 'changesOpen',\n 'monitorOpen',\n 'monitorClose',\n 'image',\n 'toolLabel',\n];\n\nexport const AgentControl: RemoteContract = contract('slicc.agent.control', {\n control: { methods: CONTROL_METHODS },\n view: { methods: [...CONTROL_READS, ...OWNER_DEVICE_METHODS] },\n});\n\nexport type Delivered = 'run' | 'steer' | 'follow-up';\n\nexport interface AgentTranscript {\n readonly state: ReplicatedState<ConversationView>;\n readonly deliveries: ReplicatedState<Record<string, Delivered>>;\n readonly agents: ReplicatedState<AgentsSummary>;\n readonly views: ReplicatedState<Record<string, ConversationView>>;\n readonly commands: ReplicatedState<Command[]>;\n readonly privateRevision: ReplicatedState<PrivateRevision>;\n readonly sprinkles: ReplicatedState<Sprinkle[]>;\n readonly memories: ReplicatedState<MemoryEntry[]>;\n readonly memoryScopes: ReplicatedState<MemoryScope[]>;\n readonly frozen: ReplicatedState<FrozenCone[]>;\n readonly importing: ReplicatedState<ImportProgress>;\n readonly changes: ReplicatedState<ChangesView>;\n readonly monitor: ReplicatedState<MonitorFeed>;\n readonly vault: ReplicatedState<VaultState>;\n readonly labels: ReplicatedState<Record<string, string>>;\n readonly guests: ReplicatedState<GuestSeat[]>;\n readonly approvals: ReplicatedState<Approval[]>;\n readonly approvalPolicy: ReplicatedState<ApprovalPolicy>;\n}\n\nexport interface PrivateRevision {\n revision: number;\n}\n\nexport interface Command {\n name: string;\n description: string;\n kind: 'prompt' | 'skill' | 'action';\n source?: SkillSource;\n package?: SkillPackage;\n}\n\nexport const TRANSCRIPT_STATES = keys<AgentTranscript>({\n state: true,\n deliveries: true,\n agents: true,\n views: true,\n commands: true,\n privateRevision: true,\n sprinkles: true,\n memories: true,\n memoryScopes: true,\n frozen: true,\n importing: true,\n changes: true,\n monitor: true,\n vault: true,\n labels: true,\n guests: true,\n approvals: true,\n approvalPolicy: true,\n});\n\nexport const AgentTranscript: RemoteContract = contract('slicc.agent.transcript', {\n transcript: { state: TRANSCRIPT_STATES },\n});\n\nexport const REMOTE_METHODS = keys<AgentRemote>({\n prompt: true,\n watch: true,\n next: true,\n close: true,\n abort: true,\n});\n\nexport const REMOTE_READS: readonly (keyof AgentRemote & string)[] = ['watch', 'next', 'close'];\n\nexport interface GuestShown {\n id: string;\n label: string;\n agentId: string;\n name: string;\n expiresAt: number | null;\n gates: GuestGates;\n}\n\nexport interface GuestProposal {\n id: string;\n text: string;\n state: 'queued' | 'pending' | 'approved' | 'rejected' | 'unanswered' | 'withdrawn';\n reason: string | null;\n createdAt: number;\n decidedAt: number | null;\n}\n\nexport interface AgentGuest {\n readonly transcript: ReplicatedState<ConversationView>;\n readonly seat: ReplicatedState<GuestShown>;\n readonly proposals: ReplicatedState<GuestProposal[]>;\n propose(request: ProposeRequest, context: Context): Promise<Proposed>;\n guestOpen(draft: GuestDraft, context: Context): Promise<GuestOpened>;\n guestRevoke(id: string, context: Context): Promise<{ revoked: boolean }>;\n}\n\nexport const GUEST_STATES = ['transcript', 'seat', 'proposals'] as const;\n\nexport const GUEST_METHODS = ['propose', 'guestOpen', 'guestRevoke'] as const;\n\nexport const AgentGuestService: RemoteContract = contract('slicc.agent.guest', {\n guest: { state: GUEST_STATES, methods: GUEST_METHODS },\n none: {},\n});\n\nexport const AgentRemoteService: RemoteContract = contract('slicc.agent.remote', {\n remote: { methods: REMOTE_METHODS },\n watch: { methods: REMOTE_READS },\n});\n\nexport const PAGE_METHODS = keys<AgentPages>({\n open: true,\n report: true,\n next: true,\n answer: true,\n close: true,\n});\n\nexport const AgentPagesService: RemoteContract = contract('slicc.agent.pages', {\n pages: { methods: PAGE_METHODS },\n none: {},\n});\n\nexport const SUDO_METHODS = keys<Omit<AgentSudo, 'approvals'>>({\n request: true,\n withdraw: true,\n});\n\nexport const AgentSudoService: RemoteContract = contract('slicc.agent.sudo', {\n sudo: { state: ['approvals'], methods: SUDO_METHODS },\n none: {},\n});\n\nexport interface ModelChoice {\n id: string;\n label: string;\n provider: string;\n kind: 'chat' | 'classifier';\n reasoning: boolean;\n images?: boolean;\n contextWindow: number;\n}\n\nexport interface AccountState {\n id: string;\n provider: string;\n identity: string;\n status: 'connected' | 'disconnected' | 'expired';\n auth: 'api-key' | 'oauth' | 'local';\n needs: 'cors-free-transport' | null;\n blocked?: 'cors-free-transport';\n group?: 'providers' | 'mcp';\n secret?: 'api-key' | 'token';\n store?: 'vault';\n fields?: AccountField[];\n description?: string;\n keyUrl?: string;\n vaultName?: string;\n state?: McpServerState;\n}\n\nexport type McpServerState =\n | 'connecting'\n | 'connected'\n | 'needs-secret'\n | 'needs-auth'\n | 'failed'\n | 'disabled'\n | 'refused';\n\nexport type McpRefusalCode =\n | 'bad-name'\n | 'duplicate'\n | 'not-found'\n | 'not-object'\n | 'bad-token'\n | 'token-conflict'\n | 'url-secret'\n | 'header-secret'\n | 'stdio'\n | 'sse'\n | 'bad-url'\n | 'insecure-url'\n | 'file-invalid'\n | 'file-unreadable'\n | 'file-unwritable'\n | 'not-owner'\n | 'invalid';\n\nexport interface McpRefusal {\n code: McpRefusalCode;\n reason: string;\n}\n\nexport type McpRefusals = Record<string, McpRefusal>;\n\nexport type McpEdit = { ok: true } | ({ ok: false } & McpRefusal);\n\nexport interface AccountField {\n name: string;\n label: string;\n required?: boolean;\n placeholder?: string;\n help?: string;\n customBase?: true;\n vaultSetting?: string;\n options?: readonly { value: string; label: string }[];\n value?: string;\n}\n\nexport interface ProviderOption {\n id: string;\n name: string;\n description?: string;\n auth: 'api-key' | 'oauth' | 'fields' | 'local';\n fields?: AccountField[];\n keyUrl?: string;\n needs?: 'cors-free-transport';\n blocked?: 'cors-free-transport';\n vaultName?: string;\n}\n\nexport interface BudgetState {\n provider: string;\n percent: number;\n window: 'weekly';\n resets: string;\n}\n\nexport interface SignIn {\n clientId: string;\n scopes: string;\n imsEnvironment: string;\n}\n\nexport interface McpSignIn {\n url: string;\n state: string;\n}\n\nexport interface SettingsState {\n models: ModelChoice[];\n accounts: AccountState[];\n providers?: ProviderOption[];\n budget?: BudgetState | null;\n budgets?: BudgetState[];\n moved?: { kind: 'model' | 'mcp'; label: string }[];\n labels?: Record<string, string>;\n}\n\nexport interface AgentSettings {\n readonly state: ReplicatedState<SettingsState>;\n connect(\n providerId: string,\n secret: string | null,\n fields: Record<string, string> | null,\n context: Context\n ): Promise<void>;\n disconnect(providerId: string, context: Context): Promise<void>;\n remove(providerId: string, context: Context): Promise<void>;\n serverUrl(providerId: string, context: Context): Promise<string | null>;\n signIn(providerId: string, context: Context): Promise<SignIn | McpSignIn | DeviceSignIn | null>;\n dismissMoved(context: Context): Promise<void>;\n addServer(name: string, entry: unknown, context: Context): Promise<McpEdit>;\n removeServer(id: string, context: Context): Promise<McpEdit>;\n refusals(context: Context): Promise<McpRefusals>;\n}\n\nexport const SETTINGS_METHODS = keys<\n Omit<AgentSettings, 'state' | 'addServer' | 'removeServer' | 'refusals'>\n>({\n connect: true,\n disconnect: true,\n remove: true,\n serverUrl: true,\n signIn: true,\n dismissMoved: true,\n});\n\nexport const OWNER_SETTINGS_METHODS: readonly (keyof Omit<AgentSettings, 'state'> & string)[] = [\n ...SETTINGS_METHODS,\n 'addServer',\n 'removeServer',\n 'refusals',\n];\n\nexport const AgentSettings: RemoteContract = contract('slicc.agent.settings', {\n owner: { state: ['state'], methods: OWNER_SETTINGS_METHODS },\n settings: { state: ['state'], methods: SETTINGS_METHODS },\n view: { state: ['state'] },\n});\n\nexport type InventoryStatus = 'running' | 'queued' | 'waiting' | 'error' | 'idle';\n\nexport const INVENTORY_STATUSES: readonly InventoryStatus[] = [\n 'running',\n 'queued',\n 'waiting',\n 'error',\n 'idle',\n];\n\nexport interface InventoryAgent {\n id: string;\n kind: 'cone' | 'scoop';\n parent?: string;\n status: InventoryStatus;\n queued: number;\n provider?: string;\n model?: string;\n since: number;\n}\n\nexport interface InventoryRow extends InventoryAgent {\n cone: string;\n}\n\nexport interface InventoryState {\n seq: number;\n changedAt: number;\n active: string;\n agents: InventoryRow[];\n}\n\nexport interface InventorySnapshot {\n seq: number;\n changedAt: number;\n counts: Record<InventoryStatus, number>;\n agents: InventoryAgent[];\n}\n\nexport interface AgentInventory {\n readonly inventory: ReplicatedState<InventoryState>;\n}\n\nexport const AgentInventoryService: RemoteContract = contract('slicc.agent.inventory', {\n owner: { state: ['inventory'] },\n none: {},\n});\n"],
|
|
5
|
+
"mappings": "AAmBA,SAAS,gBAAgB;AAoQzB,MAAM,OAAO,CAAI,WAAkC,OAAO,KAAK,MAAM;AAE9D,MAAM,kBAAkB,KAAmB;AAAA,EAChD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,cAAc;AAAA,EACd,OAAO;AAAA,EACP,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,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C5E,OAAO,EAAE,OAAO,CAAC,OAAO,GAAG,SAAS,uBAAuB;AAAA,EAC3D,UAAU,EAAE,OAAO,CAAC,OAAO,GAAG,SAAS,iBAAiB;AAAA,EACxD,MAAM,EAAE,OAAO,CAAC,OAAO,EAAE;AAC3B,CAAC;AAIM,MAAM,qBAAiD;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAmCO,MAAM,wBAAwC,SAAS,yBAAyB;AAAA,EACrF,OAAO,EAAE,OAAO,CAAC,WAAW,EAAE;AAAA,EAC9B,MAAM,CAAC;AACT,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/types/agent.d.ts
CHANGED
package/dist/types/client.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { MemoryEntry, MemoryScope } from './memory/format.ts';
|
|
|
10
10
|
import type { AgentRemote } from './remote/host.ts';
|
|
11
11
|
import type { AgentPages } from './remote/pages.ts';
|
|
12
12
|
import type { VaultState } from './secrets/vault.ts';
|
|
13
|
-
import { AgentControl, AgentSettings, type AgentsSummary, type Command, type Delivered, type GuestProposal, type GuestShown, type MonitorFeed, type PrivateRevision, type SendMode } from './services.ts';
|
|
13
|
+
import { AgentControl, AgentSettings, type AgentsSummary, type Command, type Delivered, type GuestProposal, type GuestShown, type InventoryState, type MonitorFeed, type PrivateRevision, type SendMode } from './services.ts';
|
|
14
14
|
import { type AgentPrincipal, type Remote } from './serving.ts';
|
|
15
15
|
import type { Sprinkle } from './sprinkles/kind.ts';
|
|
16
16
|
import { type PortEndpoint, PortLink } from './wire.ts';
|
|
@@ -42,6 +42,7 @@ export interface AgentConnection {
|
|
|
42
42
|
readonly settings: AgentSettings;
|
|
43
43
|
readonly remote?: AgentRemote;
|
|
44
44
|
readonly pages?: AgentPages;
|
|
45
|
+
readonly inventory?: ReplicatedState<InventoryState>;
|
|
45
46
|
readonly closed: Promise<Error | undefined>;
|
|
46
47
|
readonly readOnly?: boolean;
|
|
47
48
|
prompt(text: string, whenBusy?: SendMode): Promise<string>;
|
|
@@ -65,6 +66,7 @@ export declare const ended: (link: PortLink) => Promise<never>;
|
|
|
65
66
|
type Contract = Parameters<Host<AgentPrincipal>['get']>[0];
|
|
66
67
|
export declare function clientHost(link: PortLink, name: string): Host<AgentPrincipal>;
|
|
67
68
|
export declare function holding(host: Host<AgentPrincipal>, link: PortLink, contracts: readonly Contract[]): Promise<Remote[]>;
|
|
69
|
+
export declare function optional(host: Host<AgentPrincipal>, link: PortLink, contract: Contract): Promise<Remote | undefined>;
|
|
68
70
|
export declare function connectAgent(endpoint: PortEndpoint, options?: {
|
|
69
71
|
context?: Context;
|
|
70
72
|
}): Promise<AgentConnection>;
|
package/dist/types/host.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { type AgentRemote } from './remote/host.ts';
|
|
|
15
15
|
import { type Pages } from './remote/pages.ts';
|
|
16
16
|
import type { SecretListing } from './secrets/names.ts';
|
|
17
17
|
import type { VaultState } from './secrets/vault.ts';
|
|
18
|
-
import { AgentControl, type AgentGuest, AgentSettings, AgentTranscript } from './services.ts';
|
|
18
|
+
import { AgentControl, type AgentGuest, AgentSettings, AgentTranscript, type InventoryState } from './services.ts';
|
|
19
19
|
import { type AgentPrincipal, type GuestPrincipal } from './serving.ts';
|
|
20
20
|
import type { SkillsRuntime } from './skills/index.ts';
|
|
21
21
|
import type { SprinklesRuntime } from './sprinkles/index.ts';
|
|
@@ -81,6 +81,7 @@ interface Served {
|
|
|
81
81
|
settings: AgentSettings;
|
|
82
82
|
remote: AgentRemote;
|
|
83
83
|
pages: Pages;
|
|
84
|
+
inventory?: ReplicatedState<InventoryState>;
|
|
84
85
|
guest?: (principal: GuestPrincipal) => {
|
|
85
86
|
value: AgentGuest;
|
|
86
87
|
dispose(): void;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export { type Loopback, type Transport, type TransportResponse, transportFetch,
|
|
|
20
20
|
export { AGENT_LOCK, type AgentOwner, type AgentWorker, type KernelSource, type OwnerOptions, startAgent, } from './owner.ts';
|
|
21
21
|
export { SliccPrompt, sliccPrompt } from './prompt.ts';
|
|
22
22
|
export { type AgentPages, createPages, type PageBatch, type PageCaller, type PageRequest, type PageResult, type Pages, type PagesOpened, type PageTab, } from './remote/pages.ts';
|
|
23
|
-
export { type AccountState, AgentControl, AgentPagesService, AgentSettings, type AgentSettingsChange, AgentTranscript, type BudgetState, type McpEdit, type McpRefusal, type McpRefusalCode, type McpRefusals, type ModelChoice, type OperationError, type PromptResult, type SendMode, type SendRequest, type SendResponse, type SettingsState, type SignIn, } from './services.ts';
|
|
23
|
+
export { type AccountState, AgentControl, type AgentInventory, AgentInventoryService, AgentPagesService, AgentSettings, type AgentSettingsChange, AgentTranscript, type BudgetState, INVENTORY_STATUSES, type InventoryAgent, type InventoryRow, type InventorySnapshot, type InventoryState, type InventoryStatus, type McpEdit, type McpRefusal, type McpRefusalCode, type McpRefusals, type ModelChoice, type OperationError, type PromptResult, type SendMode, type SendRequest, type SendResponse, type SettingsState, type SignIn, } from './services.ts';
|
|
24
24
|
export { BEDROCK, createAgentSettings, createSliccModels, DEFAULT_MODEL, DEFAULT_REGIONS, PREFERRED_MODELS, preferredModel, resolveDefaultModel, sliccProviders, withDefaultRegions, } from './settings.ts';
|
|
25
25
|
export { AGENT_DIRECTORY, type OpfsSqliteOptions, openMemorySqliteStorage, openOpfsSqliteStorage, WasmSqliteDatabase, } from './sqlite.ts';
|
|
26
26
|
export { type SystemFacts, systemSection } from './system.ts';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Context, ReplicatedState } from '@earendil-works/chord';
|
|
2
|
+
import type { ConversationView, Harness } from '@earendil-works/pi-durable';
|
|
3
|
+
import { type AgentsState } from './agents.ts';
|
|
4
|
+
import { type Outbox, type Work } from './remote/busy.ts';
|
|
5
|
+
import type { InventoryAgent, InventoryRow, InventoryState } from './services.ts';
|
|
6
|
+
export interface InventoryModels {
|
|
7
|
+
getModel(provider: string, modelId: string): unknown;
|
|
8
|
+
getModels(provider: string): readonly unknown[];
|
|
9
|
+
}
|
|
10
|
+
export interface InventoryOptions {
|
|
11
|
+
agents: {
|
|
12
|
+
state(): Readonly<AgentsState>;
|
|
13
|
+
onChange(listener: () => void): () => void;
|
|
14
|
+
};
|
|
15
|
+
views: ReplicatedState<Record<string, ConversationView>>;
|
|
16
|
+
harness: Pick<Harness, 'subscribeCommits' | 'snapshot'>;
|
|
17
|
+
models?: InventoryModels;
|
|
18
|
+
now?: () => number;
|
|
19
|
+
context: Context;
|
|
20
|
+
}
|
|
21
|
+
export interface Inventory {
|
|
22
|
+
readonly state: ReplicatedState<InventoryState>;
|
|
23
|
+
dispose(): void;
|
|
24
|
+
}
|
|
25
|
+
interface Signals {
|
|
26
|
+
work: Readonly<Work> | undefined;
|
|
27
|
+
outbox: Readonly<Outbox> | undefined;
|
|
28
|
+
}
|
|
29
|
+
export declare function modelOf(view: ConversationView | undefined, models: InventoryModels | undefined): Pick<InventoryAgent, 'provider' | 'model'>;
|
|
30
|
+
export declare function inventoryRows(state: Readonly<AgentsState>, views: Readonly<Record<string, ConversationView>>, signals: Signals, models: InventoryModels | undefined): Omit<InventoryRow, 'since'>[];
|
|
31
|
+
export declare function createInventory(options: InventoryOptions): Inventory;
|
|
32
|
+
export {};
|
|
@@ -76,12 +76,21 @@ export declare const USAGE_MS = 2000;
|
|
|
76
76
|
export declare const PROBLEMS_MAX = 50;
|
|
77
77
|
export declare const globalTimers: Timers;
|
|
78
78
|
export declare function emptyFeed(): MonitorFeed;
|
|
79
|
+
interface ModelMessage {
|
|
80
|
+
stopReason?: string;
|
|
81
|
+
errorMessage?: string;
|
|
82
|
+
}
|
|
79
83
|
export declare function totals(usage: UsageState): {
|
|
80
84
|
tokens: number;
|
|
81
85
|
cost: number;
|
|
82
86
|
free: boolean;
|
|
83
87
|
};
|
|
88
|
+
export declare function lastAssistant(view: ConversationView | undefined): {
|
|
89
|
+
id: string;
|
|
90
|
+
message: ModelMessage;
|
|
91
|
+
} | undefined;
|
|
84
92
|
export declare function narrowed(feed: MonitorFeed, programs: ReadonlyMap<number, string>): MonitorFeed;
|
|
85
93
|
export declare const LATENCY_WINDOW = 20;
|
|
86
94
|
export declare function latencyOf(timings: readonly ModelTiming[]): MonitorLatency | null;
|
|
87
95
|
export declare function createMonitor(options: MonitorOptions): Monitor;
|
|
96
|
+
export {};
|
package/dist/types/page.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ export { connectGuest, GUEST_ONLY, type GuestConnection, SEAT_REFUSED, } from '.
|
|
|
5
5
|
export { type ByteSink, bridgePort, encodeFrame, FrameReader, type LinkEnd, linkEndpoint, MAX_FRAME, } from './link.ts';
|
|
6
6
|
export { AGENT_LOCK, type AgentOwner, type AgentWorker, type KernelSource, type OwnerOptions, type PortOptions, startAgent, } from './owner.ts';
|
|
7
7
|
export { type RemoteControl, type RemoteEvent, type RemoteOptions, remoteControl, } from './remote/client.ts';
|
|
8
|
+
export type { InventoryAgent, InventorySnapshot, InventoryStatus, } from './services.ts';
|
|
8
9
|
export { VIEW_ONLY } from './view-only.ts';
|
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
import type { Context } from '@earendil-works/chord';
|
|
2
2
|
import { type CommitPublication, type Harness, type SnapshotEvent } from '@earendil-works/pi-durable';
|
|
3
|
+
import { type AgentsState } from '../agents.ts';
|
|
3
4
|
import type { RemoteEvent } from './events.ts';
|
|
4
5
|
export interface BusyState {
|
|
5
6
|
busy: boolean;
|
|
6
7
|
why: string[];
|
|
7
8
|
}
|
|
9
|
+
export type Work = {
|
|
10
|
+
feeds: Record<string, {
|
|
11
|
+
scoop: string;
|
|
12
|
+
}>;
|
|
13
|
+
waits: Record<string, {
|
|
14
|
+
cone: string;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
17
|
+
export type Outbox = {
|
|
18
|
+
queues: Record<string, {
|
|
19
|
+
pending: {
|
|
20
|
+
lick: {
|
|
21
|
+
channel: string;
|
|
22
|
+
};
|
|
23
|
+
} | null;
|
|
24
|
+
}>;
|
|
25
|
+
};
|
|
26
|
+
export declare function landsOn(state: Readonly<AgentsState> | undefined, key: string, channel: string): number | undefined;
|
|
8
27
|
export declare function snapshotBusy(snapshot: SnapshotEvent): boolean;
|
|
9
28
|
export declare class BusyTracker {
|
|
10
29
|
#private;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SendAttachment } from '../attachments.ts';
|
|
2
2
|
import type { AgentConnection } from '../client.ts';
|
|
3
|
-
import type { Delivered, SendMode } from '../services.ts';
|
|
3
|
+
import type { Delivered, InventorySnapshot, SendMode } from '../services.ts';
|
|
4
4
|
import type { RemoteEvent } from './events.ts';
|
|
5
5
|
export type { RemoteEvent } from './events.ts';
|
|
6
6
|
export declare const POLL_MS = 25000;
|
|
@@ -30,5 +30,11 @@ export interface RemoteControl {
|
|
|
30
30
|
abort(): Promise<{
|
|
31
31
|
aborted: boolean;
|
|
32
32
|
}>;
|
|
33
|
+
inventory(request?: {
|
|
34
|
+
watch?: boolean;
|
|
35
|
+
}): Promise<{
|
|
36
|
+
snapshot: InventorySnapshot;
|
|
37
|
+
events?: AsyncIterable<InventorySnapshot>;
|
|
38
|
+
}>;
|
|
33
39
|
}
|
|
34
|
-
export declare function remoteControl(connection: Pick<AgentConnection, 'remote'>, options?: RemoteOptions): RemoteControl;
|
|
40
|
+
export declare function remoteControl(connection: Pick<AgentConnection, 'remote'> & Pick<Partial<AgentConnection>, 'inventory'>, options?: RemoteOptions): RemoteControl;
|
package/dist/types/services.d.ts
CHANGED
|
@@ -454,3 +454,34 @@ export interface AgentSettings {
|
|
|
454
454
|
export declare const SETTINGS_METHODS: ("connect" | "disconnect" | "dismissMoved" | "remove" | "serverUrl" | "signIn")[];
|
|
455
455
|
export declare const OWNER_SETTINGS_METHODS: readonly (keyof Omit<AgentSettings, 'state'> & string)[];
|
|
456
456
|
export declare const AgentSettings: RemoteContract;
|
|
457
|
+
export type InventoryStatus = 'running' | 'queued' | 'waiting' | 'error' | 'idle';
|
|
458
|
+
export declare const INVENTORY_STATUSES: readonly InventoryStatus[];
|
|
459
|
+
export interface InventoryAgent {
|
|
460
|
+
id: string;
|
|
461
|
+
kind: 'cone' | 'scoop';
|
|
462
|
+
parent?: string;
|
|
463
|
+
status: InventoryStatus;
|
|
464
|
+
queued: number;
|
|
465
|
+
provider?: string;
|
|
466
|
+
model?: string;
|
|
467
|
+
since: number;
|
|
468
|
+
}
|
|
469
|
+
export interface InventoryRow extends InventoryAgent {
|
|
470
|
+
cone: string;
|
|
471
|
+
}
|
|
472
|
+
export interface InventoryState {
|
|
473
|
+
seq: number;
|
|
474
|
+
changedAt: number;
|
|
475
|
+
active: string;
|
|
476
|
+
agents: InventoryRow[];
|
|
477
|
+
}
|
|
478
|
+
export interface InventorySnapshot {
|
|
479
|
+
seq: number;
|
|
480
|
+
changedAt: number;
|
|
481
|
+
counts: Record<InventoryStatus, number>;
|
|
482
|
+
agents: InventoryAgent[];
|
|
483
|
+
}
|
|
484
|
+
export interface AgentInventory {
|
|
485
|
+
readonly inventory: ReplicatedState<InventoryState>;
|
|
486
|
+
}
|
|
487
|
+
export declare const AgentInventoryService: RemoteContract;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-agent",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.12.0",
|
|
4
4
|
"description": "SLICC's agent core on pi durable: an agent worker, session storage, remoting and pi extensions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -74,18 +74,18 @@
|
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@ai-ecoverse/slicc-kernel": "1.171.0",
|
|
76
76
|
"@ai-ecoverse/slicc-scrub": "1.1.0",
|
|
77
|
-
"@ai-ecoverse/slicc-shared-web": "2.13.
|
|
78
|
-
"@ai-ecoverse/slicc-spectrum": "1.108.
|
|
79
|
-
"@ai-ecoverse/wasi-fnox": "1.42.
|
|
77
|
+
"@ai-ecoverse/slicc-shared-web": "2.13.8",
|
|
78
|
+
"@ai-ecoverse/slicc-spectrum": "1.108.3",
|
|
79
|
+
"@ai-ecoverse/wasi-fnox": "1.42.1-1",
|
|
80
80
|
"@ai-ecoverse/wasm-bash": "5.3.0-23",
|
|
81
81
|
"@ai-ecoverse/wasm-coreutils": "9.12.0-15",
|
|
82
82
|
"@ai-ecoverse/wasm-git": "2.55.0-22",
|
|
83
|
-
"@biomejs/biome": "2.6.
|
|
83
|
+
"@biomejs/biome": "2.6.3",
|
|
84
84
|
"@types/node": "26.6.5",
|
|
85
85
|
"esbuild": "0.28.2",
|
|
86
86
|
"fake-indexeddb": "6.2.6",
|
|
87
87
|
"lefthook": "2.2.2",
|
|
88
|
-
"monocart-coverage-reports": "
|
|
88
|
+
"monocart-coverage-reports": "3.1.0",
|
|
89
89
|
"playwright-core": "1.64.1",
|
|
90
90
|
"semantic-release": "25.0.9",
|
|
91
91
|
"slicc-agent-5": "npm:@ai-ecoverse/slicc-agent@5.10.1",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
95
|
"@ai-ecoverse/slicc-browsers": "1.18.21",
|
|
96
|
-
"@ai-ecoverse/slicc-vault": "1.
|
|
96
|
+
"@ai-ecoverse/slicc-vault": "1.20.0",
|
|
97
97
|
"@aws-sdk/middleware-websocket": "^3.972.54",
|
|
98
98
|
"@earendil-works/chord": "1.4.0",
|
|
99
99
|
"@earendil-works/pi-ai": "1.4.0",
|