@ai-ecoverse/slicc-agent 7.33.2 → 7.34.1
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 +4 -3
- package/dist/approvals/run-licks.js +40 -22
- package/dist/approvals/run-licks.js.map +2 -2
- package/dist/approvals/run-notice.js +170 -0
- package/dist/approvals/run-notice.js.map +7 -0
- package/dist/client.js +3 -0
- package/dist/client.js.map +2 -2
- package/dist/control.js.map +2 -2
- package/dist/guests/client.js +1 -0
- package/dist/guests/client.js.map +2 -2
- package/dist/host.js +8 -2
- package/dist/host.js.map +2 -2
- package/dist/index.js +6 -0
- package/dist/index.js.map +2 -2
- package/dist/oauth/mcp-callback.html +24 -4
- package/dist/services.js +3 -1
- package/dist/services.js.map +2 -2
- package/dist/types/approvals/run-licks.d.ts +15 -3
- package/dist/types/approvals/run-notice.d.ts +63 -0
- package/dist/types/client.d.ts +2 -0
- package/dist/types/control.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/services.d.ts +3 -1
- package/package.json +9 -9
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, ApprovalDecided, ApprovalDecision } from './approvals/index.ts';\nimport type {\n ApprovalPolicy,\n ApprovalPolicyChange,\n ApprovalPolicySet,\n} from './approvals/policy.ts';\nimport type { RunAnswer } from './approvals/run.ts';\nimport type { Runnable } from './approvals/runnable.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 { EntriesPage, EntriesRequest } from './remote/history.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 stepLabel(agentId: string, callId: string, context: Context): Promise<string | null>;\n entries(request: EntriesRequest, context: Context): Promise<EntriesPage>;\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: ApprovalDecision,\n reason: string | null,\n context: Context\n ): Promise<ApprovalDecided>;\n approvalRun(id: string, context: Context): Promise<RunAnswer>;\n approvalRunStop(id: string, context: Context): Promise<RunAnswer>;\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 stepLabel: true,\n entries: true,\n guestOpen: true,\n guestRevoke: true,\n guestAlwaysForget: true,\n approvalPolicySet: true,\n decide: true,\n approvalRun: true,\n approvalRunStop: true,\n});\n\nexport const OWNER_DEVICE_METHODS: readonly (keyof AgentControl & string)[] = [\n 'decide',\n 'approvalRun',\n 'approvalRunStop',\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 'stepLabel',\n 'entries',\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 readonly approvalRunnable: ReplicatedState<Record<string, Runnable>>;\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 approvalRunnable: 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 history: true,\n next: true,\n close: true,\n abort: true,\n});\n\nexport const REMOTE_READS: readonly (keyof AgentRemote & string)[] = [\n 'watch',\n 'history',\n 'next',\n 'close',\n];\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 capture: 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 toolIntents?: boolean;\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": "
|
|
4
|
+
"sourcesContent": ["import type { Context, JsonValue, RemoteContract, ReplicatedState } from '@earendil-works/chord';\nimport type { BlockedReason, ConversationView } from '@earendil-works/pi-durable';\nimport type { Approval, ApprovalDecided, ApprovalDecision } from './approvals/index.ts';\nimport type {\n ApprovalPolicy,\n ApprovalPolicyChange,\n ApprovalPolicySet,\n} from './approvals/policy.ts';\nimport type { RunAnswer } from './approvals/run.ts';\nimport type { NoticeAnswer, RunNotice } from './approvals/run-notice.ts';\nimport type { Runnable } from './approvals/runnable.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 { EntriesPage, EntriesRequest } from './remote/history.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 stepLabel(agentId: string, callId: string, context: Context): Promise<string | null>;\n entries(request: EntriesRequest, context: Context): Promise<EntriesPage>;\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: ApprovalDecision,\n reason: string | null,\n context: Context\n ): Promise<ApprovalDecided>;\n approvalRun(id: string, context: Context): Promise<RunAnswer>;\n approvalRunStop(id: string, context: Context): Promise<RunAnswer>;\n approvalRunNotice(notice: RunNotice, context: Context): Promise<NoticeAnswer>;\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 stepLabel: true,\n entries: true,\n guestOpen: true,\n guestRevoke: true,\n guestAlwaysForget: true,\n approvalPolicySet: true,\n decide: true,\n approvalRun: true,\n approvalRunStop: true,\n approvalRunNotice: true,\n});\n\nexport const OWNER_DEVICE_METHODS: readonly (keyof AgentControl & string)[] = [\n 'decide',\n 'approvalRun',\n 'approvalRunStop',\n 'approvalRunNotice',\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 'stepLabel',\n 'entries',\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 readonly approvalRunnable: ReplicatedState<Record<string, Runnable>>;\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 approvalRunnable: 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 history: true,\n next: true,\n close: true,\n abort: true,\n});\n\nexport const REMOTE_READS: readonly (keyof AgentRemote & string)[] = [\n 'watch',\n 'history',\n 'next',\n 'close',\n];\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 capture: 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 toolIntents?: boolean;\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": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Harness } from '@earendil-works/pi-durable';
|
|
2
2
|
import { type AgentsState } from '../agents.ts';
|
|
3
3
|
import type { LickEvent } from '../licks/licks.ts';
|
|
4
|
-
import type { SudoApproval } from './record.ts';
|
|
4
|
+
import type { SudoApproval, SudoRun } from './record.ts';
|
|
5
5
|
export declare const KEEP_HOURS = 24;
|
|
6
6
|
export declare const MIB: number;
|
|
7
7
|
export type LickHost = {
|
|
@@ -14,5 +14,17 @@ export type LickHost = {
|
|
|
14
14
|
export declare const sized: (bytes: number) => string;
|
|
15
15
|
export declare function clock(at: number, now: number): string;
|
|
16
16
|
export declare function duration(ms: number): string;
|
|
17
|
-
export
|
|
18
|
-
|
|
17
|
+
export type RunFacts = {
|
|
18
|
+
id: string;
|
|
19
|
+
agentId: string;
|
|
20
|
+
typed: string;
|
|
21
|
+
where: string;
|
|
22
|
+
requestedAt: number;
|
|
23
|
+
run: SudoRun;
|
|
24
|
+
tags: readonly string[];
|
|
25
|
+
started: string;
|
|
26
|
+
ended: string;
|
|
27
|
+
};
|
|
28
|
+
export declare function itemFacts(item: SudoApproval): RunFacts;
|
|
29
|
+
export declare function startLick(host: LickHost, from: SudoApproval | RunFacts): Promise<LickEvent>;
|
|
30
|
+
export declare function endLick(host: LickHost, from: SudoApproval | RunFacts): Promise<LickEvent>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type Licks } from '../licks/licks.ts';
|
|
2
|
+
import { type LickHost } from './run-licks.ts';
|
|
3
|
+
export type RunNotice = {
|
|
4
|
+
id: string;
|
|
5
|
+
phase: 'start' | 'end';
|
|
6
|
+
agentId: string;
|
|
7
|
+
command: string;
|
|
8
|
+
requestedAt: number;
|
|
9
|
+
at: number;
|
|
10
|
+
pid?: number;
|
|
11
|
+
endedAt?: number;
|
|
12
|
+
status?: number;
|
|
13
|
+
signal?: string;
|
|
14
|
+
survivors?: number[];
|
|
15
|
+
stopped?: boolean;
|
|
16
|
+
capped?: number;
|
|
17
|
+
stdout?: string;
|
|
18
|
+
stderr?: string;
|
|
19
|
+
tags: string[];
|
|
20
|
+
};
|
|
21
|
+
export type NoticeAnswer = {
|
|
22
|
+
delivered: boolean;
|
|
23
|
+
reason?: string;
|
|
24
|
+
};
|
|
25
|
+
export type NoticeHost = LickHost & {
|
|
26
|
+
licks?: Pick<Licks, 'deliver'>;
|
|
27
|
+
};
|
|
28
|
+
export declare const NOTICE_LIMITS: {
|
|
29
|
+
readonly id: 128;
|
|
30
|
+
readonly agentId: 256;
|
|
31
|
+
readonly command: 1024;
|
|
32
|
+
readonly path: 1024;
|
|
33
|
+
readonly tag: 256;
|
|
34
|
+
readonly tags: 16;
|
|
35
|
+
readonly survivors: 64;
|
|
36
|
+
};
|
|
37
|
+
export declare const NOTICE_REASONS: {
|
|
38
|
+
readonly shape: 'A run notice is an object.';
|
|
39
|
+
readonly id: 'A run notice id is bios:<kernel id>.';
|
|
40
|
+
readonly phase: 'A run notice phase is start or end.';
|
|
41
|
+
readonly agentId: 'A run notice needs the agentId of the cone or scoop that asked.';
|
|
42
|
+
readonly command: "A run notice needs its command, at most 1024 characters.";
|
|
43
|
+
readonly time: 'A run notice needs requestedAt and at as times.';
|
|
44
|
+
readonly endedAt: 'endedAt is a time, no earlier than at.';
|
|
45
|
+
readonly pid: 'pid is a process id.';
|
|
46
|
+
readonly status: 'status is an exit status from 0 to 255.';
|
|
47
|
+
readonly signal: 'signal is a signal name such as SIGTERM.';
|
|
48
|
+
readonly survivors: "survivors is a list of at most 64 process ids.";
|
|
49
|
+
readonly stopped: 'stopped is true or false.';
|
|
50
|
+
readonly capped: 'capped is a size in bytes.';
|
|
51
|
+
readonly path: "stdout and stderr are absolute paths, at most 1024 characters.";
|
|
52
|
+
readonly tagsMissing: "A run notice needs tags, the kernel's tags for the run exactly (an empty list when it has none).";
|
|
53
|
+
readonly tags: "tags is a list of at most 16 tags of at most 256 characters.";
|
|
54
|
+
readonly licks: 'This agent has no licks.';
|
|
55
|
+
readonly gone: 'The agent that asked is gone, so nobody was told.';
|
|
56
|
+
readonly seen: 'This notice was already delivered.';
|
|
57
|
+
readonly ended: 'This run already ended.';
|
|
58
|
+
readonly failed: "The notice couldn't be delivered.";
|
|
59
|
+
};
|
|
60
|
+
export declare const unknownKey: (key: string) => string;
|
|
61
|
+
export declare const frozenNoticed: (name: string) => string;
|
|
62
|
+
export declare function checkNotice(raw: unknown): RunNotice | string;
|
|
63
|
+
export declare function deliverNotice(host: NoticeHost, raw: unknown): Promise<NoticeAnswer>;
|
package/dist/types/client.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type Context, type Host, type ReplicatedState } from '@earendil-works/c
|
|
|
2
2
|
import type { ConversationView } from '@earendil-works/pi-durable';
|
|
3
3
|
import type { ApprovalPolicy } from './approvals/policy.ts';
|
|
4
4
|
import type { Approval } from './approvals/record.ts';
|
|
5
|
+
import type { NoticeAnswer, RunNotice } from './approvals/run-notice.ts';
|
|
5
6
|
import type { Runnable } from './approvals/runnable.ts';
|
|
6
7
|
import type { ChangesView } from './changes/git.ts';
|
|
7
8
|
import type { FrozenCone } from './freezer/index.ts';
|
|
@@ -56,6 +57,7 @@ export interface AgentConnection {
|
|
|
56
57
|
}): Promise<{
|
|
57
58
|
delivered: boolean;
|
|
58
59
|
}>;
|
|
60
|
+
approvalRunNotice(notice: RunNotice): Promise<NoticeAnswer>;
|
|
59
61
|
close(): Promise<void>;
|
|
60
62
|
}
|
|
61
63
|
export interface Lasting<T> {
|
package/dist/types/control.d.ts
CHANGED
|
@@ -25,5 +25,5 @@ export interface HostScoops {
|
|
|
25
25
|
export declare function readable(out: string): string;
|
|
26
26
|
type FreezerControl = Pick<FreezerRuntime, 'freeze' | 'newChat' | 'thaw' | 'discard' | 'importProfile' | 'cancelImport'>;
|
|
27
27
|
export declare function submissionId(value: string): SubmissionId | undefined;
|
|
28
|
-
export declare function createAgentControl(harness: Harness, target: Conversation | Cones, deliveries?: Deliveries, licks?: HostLicks, scoops?: HostScoops, skills?: Pick<SkillsRuntime, 'expand' | 'commandsFor'>, sprinkles?: Pick<SprinklesRuntime, 'send' | 'call'>, memory?: Pick<MemoryRuntime, 'save' | 'remove'>, freezer?: FreezerControl, changes?: Pick<ChangesRuntime, 'open' | 'accept' | 'revert'>, monitor?: Pick<Monitor, 'open' | 'close'>, secrets?: () => SecretListing, uploads?: Uploads, labels?: Pick<LabelsRuntime, 'label' | 'step'>, guests?: Pick<Guests, 'open' | 'revoke' | 'forgetAlways'>): Omit<AgentControl, 'approvalPolicySet'>;
|
|
28
|
+
export declare function createAgentControl(harness: Harness, target: Conversation | Cones, deliveries?: Deliveries, licks?: HostLicks, scoops?: HostScoops, skills?: Pick<SkillsRuntime, 'expand' | 'commandsFor'>, sprinkles?: Pick<SprinklesRuntime, 'send' | 'call'>, memory?: Pick<MemoryRuntime, 'save' | 'remove'>, freezer?: FreezerControl, changes?: Pick<ChangesRuntime, 'open' | 'accept' | 'revert'>, monitor?: Pick<Monitor, 'open' | 'close'>, secrets?: () => SecretListing, uploads?: Uploads, labels?: Pick<LabelsRuntime, 'label' | 'step'>, guests?: Pick<Guests, 'open' | 'revoke' | 'forgetAlways'>): Omit<AgentControl, 'approvalPolicySet' | 'approvalRunNotice'>;
|
|
29
29
|
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { APPROVAL_MS, type Approval, type ApprovalAnswer, type ApprovalDecided,
|
|
|
4
4
|
export { type ApprovalPolicy, type ApprovalPolicyChange, type ApprovalPolicySet, DEFAULT_APPROVAL_POLICY, type RunLatePolicy, type SudoPolicy, type SudoPolicyChange, } from './approvals/policy.ts';
|
|
5
5
|
export type { SudoFile, SudoReplay, SudoRun, SudoRunState } from './approvals/record.ts';
|
|
6
6
|
export { RUN_ERRORS, type RunAnswer, SUDO_RUN_TASK, } from './approvals/run.ts';
|
|
7
|
+
export { NOTICE_LIMITS, NOTICE_REASONS, type NoticeAnswer, type RunNotice, } from './approvals/run-notice.ts';
|
|
7
8
|
export { RUN_REASONS, type RunGates, type Runnable, runnable, SUDO_RUN_PROTOCOL, } from './approvals/runnable.ts';
|
|
8
9
|
export type { AgentSudo, SudoAnswer, SudoDenial, SudoReply, SudoRequest, SudoTimestamp, } from './approvals/sudo.ts';
|
|
9
10
|
export type { CaptureAsk } from './approvals/sudo-client.ts';
|
package/dist/types/services.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { BlockedReason, ConversationView } from '@earendil-works/pi-durable
|
|
|
3
3
|
import type { Approval, ApprovalDecided, ApprovalDecision } from './approvals/index.ts';
|
|
4
4
|
import type { ApprovalPolicy, ApprovalPolicyChange, ApprovalPolicySet } from './approvals/policy.ts';
|
|
5
5
|
import type { RunAnswer } from './approvals/run.ts';
|
|
6
|
+
import type { NoticeAnswer, RunNotice } from './approvals/run-notice.ts';
|
|
6
7
|
import type { Runnable } from './approvals/runnable.ts';
|
|
7
8
|
import type { SendAttachment, ShownAttachment } from './attachments.ts';
|
|
8
9
|
import type { ChangesView } from './changes/git.ts';
|
|
@@ -112,6 +113,7 @@ export interface AgentControl {
|
|
|
112
113
|
decide(id: string, decision: ApprovalDecision, reason: string | null, context: Context): Promise<ApprovalDecided>;
|
|
113
114
|
approvalRun(id: string, context: Context): Promise<RunAnswer>;
|
|
114
115
|
approvalRunStop(id: string, context: Context): Promise<RunAnswer>;
|
|
116
|
+
approvalRunNotice(notice: RunNotice, context: Context): Promise<NoticeAnswer>;
|
|
115
117
|
}
|
|
116
118
|
export interface ImportRequest {
|
|
117
119
|
upload: string | null;
|
|
@@ -283,7 +285,7 @@ export interface AgentSettingsChange {
|
|
|
283
285
|
thinkingLevel: 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null;
|
|
284
286
|
agentId?: string | null;
|
|
285
287
|
}
|
|
286
|
-
export declare const CONTROL_METHODS: ("abort" | "agentCommands" | "approvalPolicySet" | "approvalRun" | "approvalRunStop" | "changeAccept" | "changeRevert" | "changesOpen" | "compact" | "compactAgent" | "configure" | "createCone" | "createScoop" | "decide" | "discard" | "drop" | "entries" | "freeze" | "guestAlwaysForget" | "guestOpen" | "guestRevoke" | "image" | "importCancel" | "importProfile" | "memoryRemove" | "memorySave" | "monitorClose" | "monitorOpen" | "newChat" | "reset" | "resolveAgentLick" | "resolveLick" | "rewind" | "rewindAgent" | "selectCone" | "send" | "sprinkleCall" | "sprinkleSend" | "stepLabel" | "stopAgent" | "thaw" | "toolLabel" | "unqueue" | "wait" | "webhook" | "withdraw")[];
|
|
288
|
+
export declare const CONTROL_METHODS: ("abort" | "agentCommands" | "approvalPolicySet" | "approvalRun" | "approvalRunNotice" | "approvalRunStop" | "changeAccept" | "changeRevert" | "changesOpen" | "compact" | "compactAgent" | "configure" | "createCone" | "createScoop" | "decide" | "discard" | "drop" | "entries" | "freeze" | "guestAlwaysForget" | "guestOpen" | "guestRevoke" | "image" | "importCancel" | "importProfile" | "memoryRemove" | "memorySave" | "monitorClose" | "monitorOpen" | "newChat" | "reset" | "resolveAgentLick" | "resolveLick" | "rewind" | "rewindAgent" | "selectCone" | "send" | "sprinkleCall" | "sprinkleSend" | "stepLabel" | "stopAgent" | "thaw" | "toolLabel" | "unqueue" | "wait" | "webhook" | "withdraw")[];
|
|
287
289
|
export declare const OWNER_DEVICE_METHODS: readonly (keyof AgentControl & string)[];
|
|
288
290
|
export declare const CONTROL_READS: readonly (keyof AgentControl & string)[];
|
|
289
291
|
export declare const AgentControl: RemoteContract;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-agent",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.34.1",
|
|
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",
|
|
@@ -73,21 +73,21 @@
|
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@ai-ecoverse/slicc-jsh": "0.64.4",
|
|
76
|
-
"@ai-ecoverse/slicc-kernel": "1.
|
|
77
|
-
"@ai-ecoverse/slicc-scrub": "1.1.
|
|
78
|
-
"@ai-ecoverse/slicc-shared-web": "2.14.
|
|
79
|
-
"@ai-ecoverse/slicc-spectrum": "2.
|
|
80
|
-
"@ai-ecoverse/slicc-vault": "1.
|
|
76
|
+
"@ai-ecoverse/slicc-kernel": "1.189.2",
|
|
77
|
+
"@ai-ecoverse/slicc-scrub": "1.1.1",
|
|
78
|
+
"@ai-ecoverse/slicc-shared-web": "2.14.4",
|
|
79
|
+
"@ai-ecoverse/slicc-spectrum": "2.16.1",
|
|
80
|
+
"@ai-ecoverse/slicc-vault": "1.26.2",
|
|
81
81
|
"@ai-ecoverse/wasi-fnox": "1.47.0-1",
|
|
82
82
|
"@ai-ecoverse/wasm-bash": "5.3.0-23",
|
|
83
83
|
"@ai-ecoverse/wasm-coreutils": "9.12.0-15",
|
|
84
84
|
"@ai-ecoverse/wasm-git": "2.55.0-22",
|
|
85
|
-
"@biomejs/biome": "2.6.
|
|
85
|
+
"@biomejs/biome": "2.6.6",
|
|
86
86
|
"@types/node": "26.6.6",
|
|
87
87
|
"esbuild": "0.28.2",
|
|
88
|
-
"fake-indexeddb": "6.2.
|
|
88
|
+
"fake-indexeddb": "6.2.8",
|
|
89
89
|
"lefthook": "2.2.2",
|
|
90
|
-
"monocart-coverage-reports": "3.2.
|
|
90
|
+
"monocart-coverage-reports": "3.2.1",
|
|
91
91
|
"playwright-core": "1.65.0",
|
|
92
92
|
"semantic-release": "25.0.9",
|
|
93
93
|
"slicc-agent-5": "npm:@ai-ecoverse/slicc-agent@5.10.1",
|