@ai-ecoverse/slicc-agent 7.12.2 → 7.13.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 +14 -13
- package/dist/agent.js +2 -2
- package/dist/agent.js.map +2 -2
- package/dist/approvals/index.js +13 -9
- package/dist/approvals/index.js.map +2 -2
- package/dist/changes/index.js +1 -1
- package/dist/changes/index.js.map +2 -2
- package/dist/codemode/index.js +4 -4
- package/dist/codemode/index.js.map +2 -2
- package/dist/control.js +12 -9
- package/dist/control.js.map +2 -2
- package/dist/guests/index.js +18 -11
- package/dist/guests/index.js.map +2 -2
- package/dist/guests/review.js +2 -2
- package/dist/guests/review.js.map +2 -2
- package/dist/guests/scoop.js +6 -6
- package/dist/guests/scoop.js.map +2 -2
- package/dist/host.js +16 -11
- package/dist/host.js.map +2 -2
- package/dist/inventory.js +21 -12
- package/dist/inventory.js.map +2 -2
- package/dist/kernel/env.js +7 -7
- package/dist/kernel/env.js.map +2 -2
- package/dist/kernel/watch.js +5 -5
- package/dist/kernel/watch.js.map +2 -2
- package/dist/licks/extension.js +4 -6
- package/dist/licks/extension.js.map +2 -2
- package/dist/licks/fswatch.js +4 -4
- package/dist/licks/fswatch.js.map +2 -2
- package/dist/licks/sources.js +2 -2
- package/dist/licks/sources.js.map +2 -2
- package/dist/main.js +19 -6
- package/dist/main.js.map +2 -2
- package/dist/mcp/catalog.js +35 -19
- package/dist/mcp/catalog.js.map +2 -2
- package/dist/mcp/runtime.js +2 -1
- package/dist/mcp/runtime.js.map +2 -2
- package/dist/mcp/tools.js +6 -2
- package/dist/mcp/tools.js.map +3 -3
- package/dist/memory/extract.js +18 -9
- package/dist/memory/extract.js.map +2 -2
- package/dist/memory/prompt.js +8 -12
- package/dist/memory/prompt.js.map +2 -2
- package/dist/memory/runtime.js +1 -1
- package/dist/memory/runtime.js.map +2 -2
- package/dist/monitor/index.js +10 -4
- package/dist/monitor/index.js.map +2 -2
- package/dist/remote/busy.js +15 -10
- package/dist/remote/busy.js.map +2 -2
- package/dist/remote/events.js +141 -67
- package/dist/remote/events.js.map +2 -2
- package/dist/remote/host.js +244 -103
- package/dist/remote/host.js.map +2 -2
- package/dist/reports.js +11 -11
- package/dist/reports.js.map +3 -3
- package/dist/roles/frontmatter.js +96 -73
- package/dist/roles/frontmatter.js.map +3 -3
- package/dist/scoops/cli.js +3 -3
- package/dist/scoops/cli.js.map +2 -2
- package/dist/scoops/extension.js +10 -4
- package/dist/scoops/extension.js.map +2 -2
- package/dist/scoops/requests.js +1 -1
- package/dist/scoops/requests.js.map +2 -2
- package/dist/scoops/retry.js +5 -11
- package/dist/scoops/retry.js.map +2 -2
- package/dist/scoops/service.js +7 -4
- package/dist/scoops/service.js.map +2 -2
- package/dist/serving.js +4 -4
- package/dist/serving.js.map +2 -2
- package/dist/skills/index.js +2 -2
- package/dist/skills/index.js.map +2 -2
- package/dist/spectrum/monitor-port.js +5 -16
- package/dist/spectrum/monitor-port.js.map +2 -2
- package/dist/sprinkles/index.js +2 -2
- package/dist/sprinkles/index.js.map +2 -2
- package/dist/sqlite.js +8 -0
- package/dist/sqlite.js.map +2 -2
- package/dist/titles/extension.js +97 -34
- package/dist/titles/extension.js.map +2 -2
- package/dist/types/approvals/index.d.ts +1 -1
- package/dist/types/codemode/index.d.ts +1 -1
- package/dist/types/guests/index.d.ts +1 -1
- package/dist/types/host.d.ts +6 -0
- package/dist/types/inventory.d.ts +1 -1
- package/dist/types/kernel/env.d.ts +2 -2
- package/dist/types/kernel/watch.d.ts +3 -3
- package/dist/types/main.d.ts +9 -2
- package/dist/types/mcp/catalog.d.ts +2 -1
- package/dist/types/mcp/runtime.d.ts +1 -0
- package/dist/types/mcp/tools.d.ts +2 -2
- package/dist/types/monitor/index.d.ts +1 -1
- package/dist/types/remote/busy.d.ts +10 -3
- package/dist/types/remote/events.d.ts +13 -2
- package/dist/types/remote/host.d.ts +3 -5
- package/dist/types/reports.d.ts +3 -3
- package/dist/types/scoops/cli.d.ts +1 -1
- package/dist/types/scoops/extension.d.ts +1 -1
- package/dist/types/scoops/retry.d.ts +1 -3
- package/dist/types/sqlite.d.ts +2 -0
- package/dist/views.js +12 -10
- package/dist/views.js.map +2 -2
- package/dist/workflow/index.js +12 -18
- package/dist/workflow/index.js.map +2 -2
- package/dist/workflow/step.js +5 -4
- package/dist/workflow/step.js.map +2 -2
- package/package.json +10 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/remote/events.ts"],
|
|
4
|
-
"sourcesContent": ["import type { AgentEvent, EntryRecord } from '@earendil-works/pi-durable';\nimport { entryLick } from '../licks/state.ts';\nimport { mcpLabel } from '../mcp/label.ts';\nimport { redactSecrets } from '../memory/format.ts';\nimport type { Delivered } from '../services.ts';\n\nexport const SUMMARY = 200;\n\nexport type EndReason = 'stop' | 'aborted' | 'error';\n\nexport type RemoteEvent =\n | { t: 'user'; id: string; text: string; delivered: Delivered }\n | { t: 'text'; id: string; delta: string }\n | { t: 'thinking'; id: string; delta: string }\n | { t: 'tool'; id: string; call: string; name: string; summary: string }\n | { t: 'tool-result'; id: string; call: string; ok: boolean; summary: string }\n | { t: 'run'; state: 'start' | 'end'; reason?: EndReason }\n | { t: 'notice'; id: string; text: string }\n | { t: 'error'; id: string; message: string; detail?: string }\n | { t: 'busy'; busy: boolean; why?: string[] }\n | { t: 'end'; reason: EndReason; message?: string };\n\ntype Json = Record<string, unknown>;\n\ninterface Block {\n type: string;\n text?: string;\n thinking?: string;\n id?: string;\n name?: string;\n arguments?: Json;\n}\n\ninterface ModelMessage {\n role?: string;\n content?: string | Block[];\n timestamp?: number;\n stopReason?: string;\n errorMessage?: string;\n toolCallId?: string;\n toolName?: string;\n isError?: boolean;\n}\n\nexport function clip(text: string, limit = SUMMARY): string {\n const flat = redactSecrets(text).text.replace(/\\s+/g, ' ').trim();\n return flat.length > limit ? `${flat.slice(0, limit - 1)}\u2026` : flat;\n}\n\nfunction textOf(content: ModelMessage['content']): string {\n if (typeof content === 'string') return content;\n return (content ?? []).map((block) => (block.type === 'text' ? (block.text ?? '') : '')).join('');\n}\n\nconst SUBJECTS = ['command', 'path', 'pattern', 'url', 'query', 'code', 'name'];\n\nexport function toolSummary(name: string, args: Json | undefined): string {\n const subject = SUBJECTS.map((key) => args?.[key]).find((value) => typeof value === 'string');\n const detail = typeof subject === 'string' ? subject : JSON.stringify(args ?? {});\n return clip(`${mcpLabel(name) ?? name} ${detail}`);\n}\n\nexport function resultSummary(message: ModelMessage): string {\n const text = textOf(message.content);\n if (message.isError)\n return clip(\n text.split('\\n').find((line) => line.trim() && !/^<\\/?harness>$/.test(line.trim())) ??\n 'failed'\n );\n const lines = text ? text.split('\\n').length : 0;\n return lines === 1 ? '1 line' : `${lines} lines`;\n}\n\nexport function keyOf(timestamp: number | undefined, at: number): string {\n return at > 0 ? `a${timestamp ?? 0}~${at}` : `a${timestamp ?? 0}`;\n}\n\nfunction reasonOf(stopReason: string | undefined): EndReason {\n if (stopReason === 'aborted') return 'aborted';\n return stopReason === 'error' ? 'error' : 'stop';\n}\n\nexport class Mapper {\n readonly #thinking: boolean;\n readonly #emitted = new Map<string, number>();\n readonly #seen = new Set<number>();\n #current: string | undefined;\n #previous: string | undefined;\n #ending: readonly number[] = [];\n readonly #stamps = new Map<number, number[]>();\n reason: EndReason = 'stop';\n error: string | undefined;\n\n constructor(thinking: boolean) {\n this.#thinking = thinking;\n }\n\n #key(message: ModelMessage | undefined, entry?: number): string {\n const stamp = message?.timestamp ?? 0;\n const list = this.#stamps.get(stamp) ?? [];\n this.#stamps.set(stamp, list);\n if (entry === undefined) return keyOf(stamp, list.length);\n if (!list.includes(entry)) list.push(entry);\n return keyOf(stamp, list.indexOf(entry));\n }\n\n #delta(t: 'text' | 'thinking', id: string, full: string): RemoteEvent[] {\n if (t === 'thinking' && !this.#thinking) return [];\n const done = this.#emitted.get(id) ?? 0;\n if (full.length <= done) return [];\n this.#emitted.set(id, full.length);\n return [{ t, id, delta: full.slice(done) }];\n }\n\n partial(message: ModelMessage | undefined): RemoteEvent[] {\n if (!message || !Array.isArray(message.content)) return [];\n const key = this.#key(message);\n this.#current = key;\n return message.content.flatMap((block, at) => {\n if (block.type === 'text') return this.#delta('text', `${key}.${at}`, block.text ?? '');\n if (block.type === 'thinking')\n return this.#delta('thinking', `${key}.${at}`, block.thinking ?? '');\n return [];\n });\n }\n\n #assistant(message: ModelMessage, entry: EntryRecord): RemoteEvent[] {\n const key = this.#key(message, entry.id);\n const blocks = Array.isArray(message.content) ? message.content : [];\n const out = blocks.flatMap((block, at): RemoteEvent[] => {\n const id = `${key}.${at}`;\n if (block.type === 'text') return this.#delta('text', id, block.text ?? '');\n if (block.type === 'thinking') return this.#delta('thinking', id, block.thinking ?? '');\n if (block.type !== 'toolCall') return [];\n const name = block.name ?? 'tool';\n return [\n { t: 'tool', id, call: block.id ?? '', name, summary: toolSummary(name, block.arguments) },\n ];\n });\n if (typeof message.content === 'string')\n out.push(...this.#delta('text', `${key}.0`, message.content));\n this.reason = reasonOf(message.stopReason);\n this.error =\n message.stopReason === 'error' ? clip(message.errorMessage ?? 'error', 1000) : undefined;\n if (this.error) out.push({ t: 'error', id: String(entry.id), message: this.error });\n return out;\n }\n\n #delivered(entry: EntryRecord): Delivered {\n if (entry.byTaskId === undefined) return 'run';\n return this.#previous === 'pi.tool-result' ? 'steer' : 'follow-up';\n }\n\n entry(entry: EntryRecord, delivered: Delivered = this.#delivered(entry)): RemoteEvent[] {\n if (this.#seen.has(entry.id)) return [];\n this.#seen.add(entry.id);\n this.#previous = entry.kind;\n const id = String(entry.id);\n const message = entry.model?.[0] as ModelMessage | undefined;\n if (entry.kind === 'pi.user' && message) {\n const lick = entryLick(entry);\n if (lick) return [{ t: 'notice', id, text: clip(`lick ${lick.channel}: ${lick.title}`) }];\n return [{ t: 'user', id, text: redactSecrets(textOf(message.content)).text, delivered }];\n }\n if (entry.kind === 'pi.assistant' && message) return this.#assistant(message, entry);\n if (entry.kind === 'pi.tool-result' && message)\n return [\n {\n t: 'tool-result',\n id,\n call: message.toolCallId ?? '',\n ok: !message.isError,\n summary: resultSummary(message),\n },\n ];\n if (entry.kind === 'pi.compaction') return [{ t: 'notice', id, text: 'compacted' }];\n if (entry.kind === 'slicc.rewound') return [{ t: 'notice', id, text: 'rewound' }];\n return [];\n }\n\n #ended(reason: EndReason): RemoteEvent[] {\n if (!this.#ending.length) return [];\n this.#ending = [];\n this.reason = reason;\n return [{ t: 'run', state: 'end', reason }];\n }\n\n #settled(record: { id: number; status: string; reason?: unknown }): RemoteEvent[] {\n if (!this.#ending.includes(record.id) || ['queued', 'placed'].includes(record.status))\n return [];\n if (record.status !== 'unanswered') return this.#ended(this.reason);\n if (record.reason === 'aborted') return this.#ended('aborted');\n this.error ??= clip(String(record.reason ?? 'error'), 1000);\n return this.#ended('error');\n }\n\n last(): number {\n return Math.max(0, ...this.#seen);\n }\n\n event(event: AgentEvent): RemoteEvent[] {\n switch (event.type) {\n case 'run_start': {\n const ended = this.#ended(this.reason);\n this.reason = 'stop';\n this.error = undefined;\n return [...ended, { t: 'run', state: 'start' }];\n }\n case 'run_end':\n this.#ending = event.inputs;\n return [];\n case 'submission':\n return this.#settled(event.record);\n case 'message_start':\n if ((event.message as ModelMessage).role === 'assistant')\n this.#current = this.#key(event.message as ModelMessage);\n return [];\n case 'message_update':\n return event.changes.flatMap((change) => {\n if (change.type !== 'text_delta' && change.type !== 'thinking_delta') return [];\n const id = `${this.#current}.${change.contentIndex}`;\n const t = change.type === 'text_delta' ? 'text' : 'thinking';\n const done = this.#emitted.get(id) ?? 0;\n if (t === 'thinking' && !this.#thinking) return [];\n this.#emitted.set(id, done + change.delta.length);\n return [{ t, id, delta: change.delta }];\n });\n case 'message_end':\n return this.entry(event.entry);\n case 'tool_execution_end':\n return event.entry\n ? this.entry(event.entry)\n : [\n {\n t: 'tool-result',\n id: `x${event.toolCallId}`,\n call: event.toolCallId,\n ok: false,\n summary: 'the tool did not finish',\n },\n ];\n case 'auto_retry_start':\n return [\n {\n t: 'notice',\n id: `retry-${event.at}`,\n text: clip(`retrying (attempt ${event.attempt}): ${event.errorMessage}`),\n },\n ];\n case 'compaction_start':\n return [{ t: 'notice', id: `compaction-${event.taskId}`, text: 'compacting' }];\n case 'task_failed':\n return [{ t: 'error', id: `task-${event.taskId}`, message: clip(event.message, 1000) }];\n default:\n return [];\n }\n }\n}\n\nexport function replayOf(\n entries: readonly EntryRecord[],\n partial: ModelMessage | undefined,\n thinking: boolean\n): RemoteEvent[] {\n const mapper = new Mapper(thinking);\n const out: RemoteEvent[] = [];\n for (const entry of entries) out.push(...mapper.entry(entry));\n out.push(...mapper.partial(partial));\n return out;\n}\n\nexport function idOf(event: RemoteEvent): string | undefined {\n return 'id' in event ? event.id : undefined;\n}\n"],
|
|
5
|
-
"mappings": "AACA,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAGvB,MAAM,UAAU;AAsChB,SAAS,KAAK,MAAc,QAAQ,SAAiB;AAC1D,QAAM,OAAO,cAAc,IAAI,EAAE,KAAK,QAAQ,QAAQ,GAAG,EAAE,KAAK;AAChE,SAAO,KAAK,SAAS,QAAQ,GAAG,KAAK,MAAM,GAAG,QAAQ,CAAC,CAAC,WAAM;AAChE;AAEA,SAAS,OAAO,SAA0C;AACxD,MAAI,OAAO,YAAY,SAAU,QAAO;AACxC,UAAQ,WAAW,CAAC,GAAG,IAAI,CAAC,UAAW,MAAM,SAAS,SAAU,MAAM,QAAQ,KAAM,EAAG,EAAE,KAAK,EAAE;AAClG;AAEA,MAAM,WAAW,CAAC,WAAW,QAAQ,WAAW,OAAO,SAAS,QAAQ,MAAM;AAEvE,SAAS,YAAY,MAAc,MAAgC;AACxE,QAAM,UAAU,SAAS,IAAI,CAAC,QAAQ,OAAO,GAAG,CAAC,EAAE,KAAK,CAAC,UAAU,OAAO,UAAU,QAAQ;AAC5F,QAAM,SAAS,OAAO,YAAY,WAAW,UAAU,KAAK,UAAU,QAAQ,CAAC,CAAC;AAChF,SAAO,KAAK,GAAG,SAAS,IAAI,KAAK,IAAI,IAAI,MAAM,EAAE;AACnD;AAEO,SAAS,cAAc,SAA+B;AAC3D,QAAM,OAAO,OAAO,QAAQ,OAAO;AACnC,MAAI,QAAQ;AACV,WAAO;AAAA,MACL,KAAK,MAAM,IAAI,EAAE,KAAK,CAAC,SAAS,KAAK,KAAK,KAAK,CAAC,iBAAiB,KAAK,KAAK,KAAK,CAAC,CAAC,KAChF;AAAA,IACJ;AACF,QAAM,QAAQ,OAAO,KAAK,MAAM,IAAI,EAAE,SAAS;AAC/C,SAAO,UAAU,IAAI,WAAW,GAAG,KAAK;AAC1C;AAEO,SAAS,MAAM,WAA+B,IAAoB;AACvE,SAAO,KAAK,IAAI,IAAI,aAAa,CAAC,IAAI,EAAE,KAAK,IAAI,aAAa,CAAC;AACjE;AAEA,SAAS,SAAS,YAA2C;AAC3D,MAAI,eAAe,UAAW,QAAO;AACrC,SAAO,eAAe,UAAU,UAAU;AAC5C;AAEO,MAAM,OAAO;AAAA,EACT;AAAA,EACA,WAAW,oBAAI,IAAoB;AAAA,EACnC,QAAQ,oBAAI,IAAY;AAAA,
|
|
4
|
+
"sourcesContent": ["import type { EntryRecord, LiveState } from '@earendil-works/pi-durable';\nimport { entryLick } from '../licks/state.ts';\nimport { mcpLabel } from '../mcp/label.ts';\nimport { redactSecrets } from '../memory/format.ts';\nimport type { Delivered } from '../services.ts';\n\nexport const SUMMARY = 200;\n\nexport type EndReason = 'stop' | 'aborted' | 'error';\n\nexport type RemoteEvent =\n | { t: 'user'; id: string; text: string; delivered: Delivered }\n | { t: 'text'; id: string; delta: string }\n | { t: 'thinking'; id: string; delta: string }\n | { t: 'tool'; id: string; call: string; name: string; summary: string }\n | { t: 'tool-result'; id: string; call: string; ok: boolean; summary: string }\n | { t: 'run'; state: 'start' | 'end'; reason?: EndReason }\n | { t: 'notice'; id: string; text: string }\n | { t: 'error'; id: string; message: string; detail?: string }\n | { t: 'busy'; busy: boolean; why?: string[] }\n | { t: 'end'; reason: EndReason; message?: string };\n\ntype Json = Record<string, unknown>;\n\ninterface Block {\n type: string;\n text?: string;\n thinking?: string;\n id?: string;\n name?: string;\n arguments?: Json;\n}\n\ninterface ModelMessage {\n role?: string;\n content?: string | Block[];\n timestamp?: number;\n stopReason?: string;\n errorMessage?: string;\n toolCallId?: string;\n toolName?: string;\n isError?: boolean;\n}\n\nexport function clip(text: string, limit = SUMMARY): string {\n const flat = redactSecrets(text).text.replace(/\\s+/g, ' ').trim();\n return flat.length > limit ? `${flat.slice(0, limit - 1)}\u2026` : flat;\n}\n\nfunction textOf(content: ModelMessage['content']): string {\n if (typeof content === 'string') return content;\n return (content ?? []).map((block) => (block.type === 'text' ? (block.text ?? '') : '')).join('');\n}\n\nconst SUBJECTS = ['command', 'path', 'pattern', 'url', 'query', 'code', 'name'];\n\nexport function toolSummary(name: string, args: Json | undefined): string {\n const subject = SUBJECTS.map((key) => args?.[key]).find((value) => typeof value === 'string');\n const detail = typeof subject === 'string' ? subject : JSON.stringify(args ?? {});\n return clip(`${mcpLabel(name) ?? name} ${detail}`);\n}\n\nexport function resultSummary(message: ModelMessage): string {\n const text = textOf(message.content);\n if (message.isError)\n return clip(\n text.split('\\n').find((line) => line.trim() && !/^<\\/?harness>$/.test(line.trim())) ??\n 'failed'\n );\n const lines = text ? text.split('\\n').length : 0;\n return lines === 1 ? '1 line' : `${lines} lines`;\n}\n\nexport function keyOf(timestamp: number | undefined, at: number): string {\n return at > 0 ? `a${timestamp ?? 0}~${at}` : `a${timestamp ?? 0}`;\n}\n\nfunction reasonOf(stopReason: string | undefined): EndReason {\n if (stopReason === 'aborted') return 'aborted';\n return stopReason === 'error' ? 'error' : 'stop';\n}\n\nexport class Mapper {\n readonly #thinking: boolean;\n readonly #emitted = new Map<string, number>();\n readonly #seen = new Set<number>();\n readonly #compactions = new Set<string>();\n readonly #orphans = new Set<string>();\n #current: string | undefined;\n #previous: string | undefined;\n #deliver: { id: number; delivered: Delivered } | undefined;\n #runTask: string | undefined;\n #runFirst: string | undefined;\n #retryAt: number | undefined;\n readonly #stamps = new Map<number, number[]>();\n holdUsers = false;\n reason: EndReason = 'stop';\n error: string | undefined;\n endedRun: string | undefined;\n endedFirst: string | undefined;\n endedReason: EndReason = 'stop';\n endedError: string | undefined;\n\n constructor(thinking: boolean) {\n this.#thinking = thinking;\n }\n\n #key(message: ModelMessage | undefined, entry?: number): string {\n const stamp = message?.timestamp ?? 0;\n const list = this.#stamps.get(stamp) ?? [];\n this.#stamps.set(stamp, list);\n if (entry === undefined) return keyOf(stamp, list.length);\n if (!list.includes(entry)) list.push(entry);\n return keyOf(stamp, list.indexOf(entry));\n }\n\n #delta(t: 'text' | 'thinking', id: string, full: string): RemoteEvent[] {\n if (t === 'thinking' && !this.#thinking) return [];\n const done = this.#emitted.get(id) ?? 0;\n if (full.length <= done) return [];\n this.#emitted.set(id, full.length);\n return [{ t, id, delta: full.slice(done) }];\n }\n\n partial(message: ModelMessage | undefined): RemoteEvent[] {\n if (!message || !Array.isArray(message.content)) return [];\n const key = this.#key(message);\n this.#current = key;\n return message.content.flatMap((block, at) => {\n if (block.type === 'text') return this.#delta('text', `${key}.${at}`, block.text ?? '');\n if (block.type === 'thinking')\n return this.#delta('thinking', `${key}.${at}`, block.thinking ?? '');\n return [];\n });\n }\n\n #assistant(message: ModelMessage, entry: EntryRecord): RemoteEvent[] {\n const key = this.#key(message, entry.id);\n const blocks = Array.isArray(message.content) ? message.content : [];\n const out = blocks.flatMap((block, at): RemoteEvent[] => {\n const id = `${key}.${at}`;\n if (block.type === 'text') return this.#delta('text', id, block.text ?? '');\n if (block.type === 'thinking') return this.#delta('thinking', id, block.thinking ?? '');\n if (block.type !== 'toolCall') return [];\n const name = block.name ?? 'tool';\n return [\n { t: 'tool', id, call: block.id ?? '', name, summary: toolSummary(name, block.arguments) },\n ];\n });\n if (typeof message.content === 'string')\n out.push(...this.#delta('text', `${key}.0`, message.content));\n this.reason = reasonOf(message.stopReason);\n this.error =\n message.stopReason === 'error' ? clip(message.errorMessage ?? 'error', 1000) : undefined;\n if (this.error) out.push({ t: 'error', id: String(entry.id), message: this.error });\n return out;\n }\n\n deliverAs(id: number, delivered: Delivered): void {\n this.#deliver = { id, delivered };\n }\n\n #delivered(entry: EntryRecord): Delivered {\n if (this.#deliver && Number(entry.id) === this.#deliver.id) return this.#deliver.delivered;\n if (entry.byTaskId === undefined) return 'run';\n return this.#previous === 'pi.tool-result' ? 'steer' : 'follow-up';\n }\n\n entry(entry: EntryRecord, delivered: Delivered = this.#delivered(entry)): RemoteEvent[] {\n if (this.#seen.has(entry.id)) return [];\n if (\n this.holdUsers &&\n entry.kind === 'pi.user' &&\n (this.#deliver === undefined || Number(entry.id) !== this.#deliver.id)\n )\n return [];\n this.#seen.add(entry.id);\n this.#previous = entry.kind;\n const id = String(entry.id);\n const message = entry.model?.[0] as ModelMessage | undefined;\n if (entry.kind === 'pi.user' && message) {\n const lick = entryLick(entry);\n if (lick) return [{ t: 'notice', id, text: clip(`lick ${lick.channel}: ${lick.title}`) }];\n return [{ t: 'user', id, text: redactSecrets(textOf(message.content)).text, delivered }];\n }\n if (entry.kind === 'pi.assistant' && message) return this.#assistant(message, entry);\n if (entry.kind === 'pi.tool-result' && message)\n return [\n {\n t: 'tool-result',\n id,\n call: message.toolCallId ?? '',\n ok: !message.isError,\n summary: resultSummary(message),\n },\n ];\n if (entry.kind === 'pi.compaction') return [{ t: 'notice', id, text: 'compacted' }];\n if (entry.kind === 'slicc.rewound') return [{ t: 'notice', id, text: 'rewound' }];\n return [];\n }\n\n last(): number {\n return Math.max(0, ...this.#seen);\n }\n\n see(live: LiveState | undefined): void {\n this.#project(live, false);\n const message = live?.generation?.message as ModelMessage | undefined;\n if (message) this.partial(message);\n }\n\n apply(\n entries: readonly EntryRecord[],\n live: LiveState | undefined\n ): { entryEvents: RemoteEvent[]; liveEvents: RemoteEvent[] } {\n const entryEvents: RemoteEvent[] = [];\n for (const entry of entries) entryEvents.push(...this.entry(entry));\n const liveEvents = this.#project(live, true);\n const message = live?.generation?.message as ModelMessage | undefined;\n if (message) liveEvents.push(...this.partial(message));\n return { entryEvents, liveEvents };\n }\n\n #same(nextFirst: string | undefined): boolean {\n if (this.#runFirst !== undefined && nextFirst === undefined) return false;\n if (this.#runFirst !== undefined && nextFirst !== undefined)\n return this.#runFirst === nextFirst;\n return true;\n }\n\n #project(live: LiveState | undefined, emit: boolean): RemoteEvent[] {\n this.endedRun = undefined;\n this.endedFirst = undefined;\n const out: RemoteEvent[] = [];\n const run = live?.run;\n const nextTask = run === undefined ? undefined : String(run.taskId);\n const nextFirst = run?.first === undefined ? undefined : String(run.first);\n if (this.#runTask !== undefined && (run === undefined || !this.#same(nextFirst))) {\n this.endedRun = this.#runTask;\n this.endedFirst = this.#runFirst ?? `task:${this.#runTask}`;\n if (emit) out.push(...this.#finish(live));\n this.#runTask = undefined;\n this.#runFirst = undefined;\n }\n if (this.#runTask === undefined && run !== undefined) {\n this.#runTask = nextTask;\n this.#runFirst = nextFirst;\n this.reason = 'stop';\n this.error = undefined;\n if (emit) out.push({ t: 'run', state: 'start' });\n } else if (run !== undefined) {\n this.#runTask = nextTask;\n if (nextFirst !== undefined) this.#runFirst = nextFirst;\n }\n out.push(\n ...this.#retries(live, emit),\n ...this.#compactionsOf(live, emit),\n ...this.#orphansOf(live, emit)\n );\n return out;\n }\n\n #finish(live: LiveState | undefined): RemoteEvent[] {\n const ended = this.endedRun ?? '';\n const failure = live?.runFailure;\n const matched = failure !== undefined && String(failure.taskId) === ended;\n if (matched && failure.reason === 'aborted') {\n this.reason = 'aborted';\n this.endedReason = 'aborted';\n this.endedError = undefined;\n return [{ t: 'run', state: 'end', reason: 'aborted' }];\n }\n if (matched) {\n this.reason = 'error';\n this.error = clip(failure.detail ?? failure.reason, 1000);\n this.endedReason = 'error';\n this.endedError = this.error;\n return [\n { t: 'error', id: `run-${ended}`, message: this.error },\n { t: 'run', state: 'end', reason: 'error' },\n ];\n }\n this.endedReason = this.reason;\n this.endedError = this.error;\n return [{ t: 'run', state: 'end', reason: this.reason }];\n }\n\n #retries(live: LiveState | undefined, emit: boolean): RemoteEvent[] {\n const retry = live?.generation?.retry;\n if (retry === undefined) {\n this.#retryAt = undefined;\n return [];\n }\n if (retry.at === this.#retryAt) return [];\n this.#retryAt = retry.at;\n if (!emit) return [];\n const attempt = live?.generation?.attempt ?? 1;\n return [\n {\n t: 'notice',\n id: `retry-${retry.at}`,\n text: clip(`retrying (attempt ${attempt}): ${retry.error}`),\n },\n ];\n }\n\n #compactionsOf(live: LiveState | undefined, emit: boolean): RemoteEvent[] {\n const out: RemoteEvent[] = [];\n for (const compaction of live?.compactions ?? []) {\n const id = String(compaction.taskId);\n if (this.#compactions.has(id)) continue;\n this.#compactions.add(id);\n if (emit) out.push({ t: 'notice', id: `compaction-${id}`, text: 'compacting' });\n }\n return out;\n }\n\n #orphansOf(live: LiveState | undefined, emit: boolean): RemoteEvent[] {\n const out: RemoteEvent[] = [];\n for (const slot of live?.tools ?? []) {\n if (slot.status !== 'done' || slot.entry !== undefined || this.#orphans.has(slot.callId))\n continue;\n this.#orphans.add(slot.callId);\n if (!emit) continue;\n out.push({\n t: 'tool-result',\n id: `x${slot.callId}`,\n call: slot.callId,\n ok: false,\n summary: 'the tool did not finish',\n });\n }\n return out;\n }\n}\n\nexport function arrange(\n entryEvents: readonly RemoteEvent[],\n liveEvents: readonly RemoteEvent[],\n userId?: string\n): RemoteEvent[] {\n const own =\n userId === undefined\n ? []\n : entryEvents.filter((event) => event.t === 'user' && event.id === userId);\n const entries =\n userId === undefined ? [...entryEvents] : entryEvents.filter((event) => event.t !== 'user');\n const start = liveEvents.findIndex((event) => event.t === 'run' && event.state === 'start');\n if (start < 0) return [...own, ...entries, ...liveEvents];\n return [...own, ...liveEvents.slice(0, start + 1), ...entries, ...liveEvents.slice(start + 1)];\n}\n\nexport function replayOf(\n entries: readonly EntryRecord[],\n partial: ModelMessage | undefined,\n thinking: boolean\n): RemoteEvent[] {\n const mapper = new Mapper(thinking);\n const out: RemoteEvent[] = [];\n for (const entry of entries) out.push(...mapper.entry(entry));\n out.push(...mapper.partial(partial));\n return out;\n}\n\nexport function idOf(event: RemoteEvent): string | undefined {\n return 'id' in event ? event.id : undefined;\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAGvB,MAAM,UAAU;AAsChB,SAAS,KAAK,MAAc,QAAQ,SAAiB;AAC1D,QAAM,OAAO,cAAc,IAAI,EAAE,KAAK,QAAQ,QAAQ,GAAG,EAAE,KAAK;AAChE,SAAO,KAAK,SAAS,QAAQ,GAAG,KAAK,MAAM,GAAG,QAAQ,CAAC,CAAC,WAAM;AAChE;AAEA,SAAS,OAAO,SAA0C;AACxD,MAAI,OAAO,YAAY,SAAU,QAAO;AACxC,UAAQ,WAAW,CAAC,GAAG,IAAI,CAAC,UAAW,MAAM,SAAS,SAAU,MAAM,QAAQ,KAAM,EAAG,EAAE,KAAK,EAAE;AAClG;AAEA,MAAM,WAAW,CAAC,WAAW,QAAQ,WAAW,OAAO,SAAS,QAAQ,MAAM;AAEvE,SAAS,YAAY,MAAc,MAAgC;AACxE,QAAM,UAAU,SAAS,IAAI,CAAC,QAAQ,OAAO,GAAG,CAAC,EAAE,KAAK,CAAC,UAAU,OAAO,UAAU,QAAQ;AAC5F,QAAM,SAAS,OAAO,YAAY,WAAW,UAAU,KAAK,UAAU,QAAQ,CAAC,CAAC;AAChF,SAAO,KAAK,GAAG,SAAS,IAAI,KAAK,IAAI,IAAI,MAAM,EAAE;AACnD;AAEO,SAAS,cAAc,SAA+B;AAC3D,QAAM,OAAO,OAAO,QAAQ,OAAO;AACnC,MAAI,QAAQ;AACV,WAAO;AAAA,MACL,KAAK,MAAM,IAAI,EAAE,KAAK,CAAC,SAAS,KAAK,KAAK,KAAK,CAAC,iBAAiB,KAAK,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AQ,MAAM,KAAK;AACpC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/remote/host.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { BACKGROUND_CONTEXT, withCancel } from "@earendil-works/chord/context";
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
ConversationTranscript,
|
|
4
|
+
InboxDoc,
|
|
5
|
+
LiveDoc
|
|
4
6
|
} from "@earendil-works/pi-durable";
|
|
5
7
|
import { holdText } from "../secrets/vault.js";
|
|
6
8
|
import { watchBusy } from "./busy.js";
|
|
7
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
arrange,
|
|
11
|
+
clip,
|
|
12
|
+
idOf,
|
|
13
|
+
Mapper,
|
|
14
|
+
replayOf
|
|
15
|
+
} from "./events.js";
|
|
8
16
|
const VAULT_BACK = "the vault is answering again";
|
|
9
17
|
function vaultNotices(vault, push) {
|
|
10
18
|
if (!vault) return () => void 0;
|
|
@@ -79,69 +87,204 @@ function headOf(events) {
|
|
|
79
87
|
}
|
|
80
88
|
return null;
|
|
81
89
|
}
|
|
82
|
-
|
|
83
|
-
|
|
90
|
+
const LIVE = LiveDoc.definition.kind;
|
|
91
|
+
const INBOX = InboxDoc.definition.kind;
|
|
92
|
+
const PAGES = 40;
|
|
93
|
+
function liveOf(view) {
|
|
94
|
+
return view.docs[LIVE];
|
|
95
|
+
}
|
|
96
|
+
function inboxOf(view) {
|
|
97
|
+
const inbox = view.docs[INBOX];
|
|
98
|
+
return inbox?.items ?? [];
|
|
99
|
+
}
|
|
100
|
+
function entryId(record) {
|
|
101
|
+
if (record && "entry" in record && typeof record.entry === "number") return record.entry;
|
|
102
|
+
return void 0;
|
|
103
|
+
}
|
|
104
|
+
function abandoned(record) {
|
|
105
|
+
return record !== void 0 && record.status !== "queued" && record.status !== "placed";
|
|
106
|
+
}
|
|
107
|
+
function settled(record, user) {
|
|
108
|
+
if (!record || user === void 0) return false;
|
|
109
|
+
return record.status === "done" || record.status === "unanswered";
|
|
110
|
+
}
|
|
111
|
+
function endReason(record, mapper) {
|
|
112
|
+
if (record?.status === "unanswered") return record.reason === "aborted" ? "aborted" : "error";
|
|
113
|
+
return mapper.reason;
|
|
84
114
|
}
|
|
85
|
-
function
|
|
86
|
-
|
|
87
|
-
return
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
115
|
+
function endMessage(record, mapper, reason) {
|
|
116
|
+
if (reason !== "error") return void 0;
|
|
117
|
+
if (mapper.error) return mapper.error;
|
|
118
|
+
if (record?.status !== "unanswered") return "error";
|
|
119
|
+
const detail = record.detail;
|
|
120
|
+
return clip(typeof detail === "string" && detail ? detail : record.reason, 1e3);
|
|
91
121
|
}
|
|
92
|
-
function
|
|
93
|
-
const
|
|
94
|
-
return
|
|
122
|
+
async function submissionOf(harness, id, context) {
|
|
123
|
+
const submission = await harness.submission(id, context);
|
|
124
|
+
return submission?.status(context);
|
|
125
|
+
}
|
|
126
|
+
async function caughtUp(transcript, view, context) {
|
|
127
|
+
let merged = transcript.merge(view);
|
|
128
|
+
for (let page = 0; page < PAGES; page++) {
|
|
129
|
+
const gap = merged.items.find((item) => item.kind === "gap");
|
|
130
|
+
if (gap?.kind !== "gap") break;
|
|
131
|
+
merged = await transcript.fillGap(gap, context);
|
|
132
|
+
}
|
|
133
|
+
return merged.items.flatMap((item) => item.kind === "entry" ? [item.entry] : []);
|
|
134
|
+
}
|
|
135
|
+
async function recall(transcript, view, since, thinking, context) {
|
|
136
|
+
let merged = transcript.merge(view);
|
|
137
|
+
const partial = liveOf(view)?.generation?.message;
|
|
138
|
+
const pack = () => {
|
|
139
|
+
const entries = merged.items.flatMap((item) => item.kind === "entry" ? [item.entry] : []);
|
|
140
|
+
return { entries, events: replayOf(entries, partial, thinking) };
|
|
141
|
+
};
|
|
142
|
+
let packed = pack();
|
|
143
|
+
const has = () => since !== null && packed.events.some((event) => idOf(event) === since);
|
|
144
|
+
for (let page = 0; page < PAGES && since !== null && !has(); page++) {
|
|
145
|
+
const gap = merged.items.find((item) => item.kind === "gap");
|
|
146
|
+
if (gap?.kind === "gap") merged = await transcript.fillGap(gap, context);
|
|
147
|
+
else if (merged.items[0]?.kind === "earlier") merged = await transcript.loadEarlier(context);
|
|
148
|
+
else break;
|
|
149
|
+
packed = pack();
|
|
150
|
+
}
|
|
151
|
+
return { ...packed, gap: since !== null && !has() };
|
|
152
|
+
}
|
|
153
|
+
function sealFolded(events, announced, submission, record, mapper) {
|
|
154
|
+
const reason = endReason(record, mapper);
|
|
155
|
+
const message = endMessage(record, mapper, reason);
|
|
156
|
+
if (!announced && !events.some((event) => event.t === "run" && event.state === "start")) {
|
|
157
|
+
const at = events.findIndex((event) => event.t !== "user");
|
|
158
|
+
const start = { t: "run", state: "start" };
|
|
159
|
+
if (at < 0) events.push(start);
|
|
160
|
+
else events.splice(at, 0, start);
|
|
161
|
+
}
|
|
162
|
+
if (reason === "error" && message && !events.some((event) => event.t === "error"))
|
|
163
|
+
events.push({ t: "error", id: `run-${submission}`, message });
|
|
164
|
+
events.push({ t: "run", state: "end", reason });
|
|
165
|
+
return { reason, message };
|
|
95
166
|
}
|
|
96
167
|
class Follower {
|
|
97
168
|
#mapper;
|
|
98
|
-
#entries;
|
|
99
169
|
#submission;
|
|
100
170
|
#delivered;
|
|
101
171
|
#out = [];
|
|
102
172
|
#user;
|
|
103
173
|
#started = false;
|
|
104
|
-
|
|
174
|
+
#announced = false;
|
|
175
|
+
#oursFirst;
|
|
176
|
+
constructor(mapper, submission, delivered) {
|
|
105
177
|
this.#mapper = mapper;
|
|
106
|
-
this.#
|
|
107
|
-
this.#submission = submission;
|
|
178
|
+
this.#submission = Number(submission);
|
|
108
179
|
this.#delivered = delivered;
|
|
109
|
-
this.#user = placedEntry(record);
|
|
110
180
|
}
|
|
111
181
|
drain() {
|
|
112
182
|
return this.#out.splice(0);
|
|
113
183
|
}
|
|
114
|
-
#begin() {
|
|
115
|
-
const entry = this.#user === void 0 ? void 0 : this.#entries.get(this.#user);
|
|
116
|
-
if (!entry) return;
|
|
117
|
-
this.#started = true;
|
|
118
|
-
this.#out.push(...this.#mapper.entry(entry, this.#delivered));
|
|
119
|
-
}
|
|
120
184
|
#end(reason, message) {
|
|
121
185
|
this.#out.push({ t: "end", reason, ...message ? { message } : {} });
|
|
122
186
|
return true;
|
|
123
187
|
}
|
|
124
|
-
#
|
|
125
|
-
if (
|
|
126
|
-
|
|
127
|
-
|
|
188
|
+
#claim(run) {
|
|
189
|
+
if (!run || this.#user === void 0) return;
|
|
190
|
+
const task = String(run.taskId);
|
|
191
|
+
const first = run.first === void 0 ? void 0 : String(run.first);
|
|
192
|
+
const key = first ?? `task:${task}`;
|
|
193
|
+
if (this.#oursFirst === `task:${task}`) {
|
|
194
|
+
this.#oursFirst = key;
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if (this.#oursFirst !== void 0) return;
|
|
198
|
+
const owns = run.inputs.some((id) => Number(id) === this.#submission);
|
|
199
|
+
if (owns || first === String(this.#user)) this.#oursFirst = key;
|
|
128
200
|
}
|
|
129
|
-
take(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
201
|
+
take(entries, live, record) {
|
|
202
|
+
const placed = entryId(record);
|
|
203
|
+
if (placed !== void 0) this.#user = placed;
|
|
204
|
+
if (this.#user === void 0 && abandoned(record)) return this.#end("aborted");
|
|
205
|
+
if (this.#user !== void 0) this.#mapper.deliverAs(this.#user, this.#delivered);
|
|
206
|
+
this.#claim(live?.run);
|
|
207
|
+
const mapped = this.#mapper.apply(entries, live);
|
|
208
|
+
const done = settled(record, this.#user);
|
|
209
|
+
const endedOurs = this.#oursFirst !== void 0 && this.#mapper.endedFirst === this.#oursFirst;
|
|
210
|
+
let events = arrange(
|
|
211
|
+
mapped.entryEvents,
|
|
212
|
+
mapped.liveEvents,
|
|
213
|
+
this.#user === void 0 ? void 0 : String(this.#user)
|
|
214
|
+
);
|
|
215
|
+
if (!(endedOurs || done))
|
|
216
|
+
events = events.filter((event) => event.t !== "run" || event.state !== "end");
|
|
217
|
+
if (!this.#started) {
|
|
218
|
+
if (this.#user === void 0 || !entries.some((entry) => entry.id === this.#user))
|
|
219
|
+
return false;
|
|
220
|
+
this.#started = true;
|
|
221
|
+
}
|
|
222
|
+
if (events.some((event) => event.t === "run" && event.state === "start"))
|
|
223
|
+
this.#announced = true;
|
|
224
|
+
const hasEnd = events.some((event) => event.t === "run" && event.state === "end");
|
|
225
|
+
if (this.#started && done && live?.run === void 0 && !hasEnd) {
|
|
226
|
+
const sealed = sealFolded(events, this.#announced, this.#submission, record, this.#mapper);
|
|
227
|
+
this.#out.push(...events);
|
|
228
|
+
return this.#end(sealed.reason, sealed.message);
|
|
141
229
|
}
|
|
230
|
+
this.#out.push(...events);
|
|
231
|
+
if (hasEnd && (endedOurs || done && live?.run === void 0))
|
|
232
|
+
return this.#end(this.#mapper.endedReason, this.#mapper.endedError);
|
|
142
233
|
return false;
|
|
143
234
|
}
|
|
144
235
|
}
|
|
236
|
+
async function attachWatch(host, agentId, context, now, track) {
|
|
237
|
+
const conversation = await host.conversation(agentId, context);
|
|
238
|
+
const cancel = withCancel(BACKGROUND_CONTEXT);
|
|
239
|
+
let watch;
|
|
240
|
+
try {
|
|
241
|
+
watch = await conversation.watch(cancel.context);
|
|
242
|
+
} catch (error) {
|
|
243
|
+
cancel.cancel();
|
|
244
|
+
throw error;
|
|
245
|
+
}
|
|
246
|
+
const view = watch.value;
|
|
247
|
+
const transcript = new ConversationTranscript(
|
|
248
|
+
(query, limit, ctx) => conversation.entries(query, limit, void 0, ctx)
|
|
249
|
+
);
|
|
250
|
+
const open = (onView, ended) => {
|
|
251
|
+
let off = () => void 0;
|
|
252
|
+
const stream = new Stream(
|
|
253
|
+
async () => {
|
|
254
|
+
off();
|
|
255
|
+
ended?.();
|
|
256
|
+
await watch.stop();
|
|
257
|
+
cancel.cancel();
|
|
258
|
+
},
|
|
259
|
+
now,
|
|
260
|
+
host.limit ?? MAX_QUEUED,
|
|
261
|
+
[{ t: "end", reason: "error", message: "the stream fell too far behind" }]
|
|
262
|
+
);
|
|
263
|
+
const id = track(stream);
|
|
264
|
+
off = vaultNotices(host.vault, (notices) => stream.push(notices));
|
|
265
|
+
watch.start(async (call, frame) => {
|
|
266
|
+
if (call.kind !== "value") return;
|
|
267
|
+
try {
|
|
268
|
+
await onView(call.value, frame);
|
|
269
|
+
} catch (error) {
|
|
270
|
+
const message = error instanceof Error ? error.message : "the stream failed";
|
|
271
|
+
stream.push([{ t: "end", reason: "error", message: clip(message, 1e3) }]);
|
|
272
|
+
await stream.finish();
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
return { id, stream };
|
|
276
|
+
};
|
|
277
|
+
return {
|
|
278
|
+
conversation,
|
|
279
|
+
view,
|
|
280
|
+
transcript,
|
|
281
|
+
open,
|
|
282
|
+
stop: async () => {
|
|
283
|
+
await watch.stop();
|
|
284
|
+
cancel.cancel();
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
}
|
|
145
288
|
function createRemote(host) {
|
|
146
289
|
const now = host.now ?? Date.now;
|
|
147
290
|
const streams = /* @__PURE__ */ new Map();
|
|
@@ -158,44 +301,19 @@ function createRemote(host) {
|
|
|
158
301
|
timer = void 0;
|
|
159
302
|
}
|
|
160
303
|
};
|
|
161
|
-
const track = (
|
|
304
|
+
const track = (stream) => {
|
|
305
|
+
const id = `s${++serial}-${crypto.randomUUID()}`;
|
|
162
306
|
streams.set(id, stream);
|
|
163
307
|
timer ??= setInterval(sweep, host.sweepMs ?? IDLE_MS / 4);
|
|
308
|
+
return id;
|
|
164
309
|
};
|
|
165
|
-
const watching =
|
|
166
|
-
const conversation = await host.conversation(agentId, context);
|
|
167
|
-
const cancel = withCancel(BACKGROUND_CONTEXT);
|
|
168
|
-
const events = await watchEvents(
|
|
169
|
-
host.harness,
|
|
170
|
-
conversation.id,
|
|
171
|
-
cancel.context
|
|
172
|
-
);
|
|
173
|
-
const open = (onEvents, ended) => {
|
|
174
|
-
let off = () => void 0;
|
|
175
|
-
const stream = new Stream(
|
|
176
|
-
async () => {
|
|
177
|
-
off();
|
|
178
|
-
ended?.();
|
|
179
|
-
await events.stop();
|
|
180
|
-
cancel.cancel();
|
|
181
|
-
},
|
|
182
|
-
now(),
|
|
183
|
-
host.limit ?? MAX_QUEUED,
|
|
184
|
-
[{ t: "end", reason: "error", message: "the stream fell too far behind" }]
|
|
185
|
-
);
|
|
186
|
-
const id = `s${++serial}-${crypto.randomUUID()}`;
|
|
187
|
-
track(id, stream);
|
|
188
|
-
off = vaultNotices(host.vault, (notices) => stream.push(notices));
|
|
189
|
-
events.start(async (batch) => onEvents(batch));
|
|
190
|
-
return { id, stream };
|
|
191
|
-
};
|
|
192
|
-
return { conversation, snapshot: events.snapshot, open, stop: () => events.stop() };
|
|
193
|
-
};
|
|
310
|
+
const watching = (agentId, context) => attachWatch(host, agentId, context, now(), track);
|
|
194
311
|
return {
|
|
195
312
|
async prompt(request, context) {
|
|
196
313
|
sweep();
|
|
197
314
|
const watched = await watching(request.agentId, context);
|
|
198
|
-
const
|
|
315
|
+
const live = liveOf(watched.view);
|
|
316
|
+
const busy = Boolean(live?.run);
|
|
199
317
|
const response = await host.send(
|
|
200
318
|
{
|
|
201
319
|
text: request.text,
|
|
@@ -215,52 +333,74 @@ function createRemote(host) {
|
|
|
215
333
|
};
|
|
216
334
|
}
|
|
217
335
|
const submission = Number(response.submissionId);
|
|
218
|
-
const record = await (
|
|
336
|
+
const record = await submissionOf(host.harness, submission, context);
|
|
219
337
|
const delivered = deliveredOf(record, request.whenBusy, busy);
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
)
|
|
227
|
-
|
|
228
|
-
const
|
|
338
|
+
const mapper = new Mapper(request.thinking);
|
|
339
|
+
watched.transcript.merge(watched.view);
|
|
340
|
+
for (const entry of watched.view.entries) mapper.entry(entry);
|
|
341
|
+
mapper.see(live);
|
|
342
|
+
mapper.holdUsers = true;
|
|
343
|
+
const follower = new Follower(mapper, submission, delivered);
|
|
344
|
+
const { id, stream } = watched.open(async (view, frame) => {
|
|
345
|
+
const status = await submissionOf(host.harness, submission, frame);
|
|
346
|
+
const entries = await caughtUp(watched.transcript, view, frame);
|
|
347
|
+
const ended = follower.take(entries, liveOf(view), status);
|
|
229
348
|
stream.push(follower.drain());
|
|
230
|
-
if (ended)
|
|
349
|
+
if (ended) await stream.finish();
|
|
231
350
|
});
|
|
232
351
|
return { ok: true, stream: id, delivered, head: null, gap: false };
|
|
233
352
|
},
|
|
234
353
|
async watch(request, context) {
|
|
235
354
|
sweep();
|
|
236
355
|
const watched = await watching(request.agentId, context);
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
356
|
+
const recalled = await recall(
|
|
357
|
+
watched.transcript,
|
|
358
|
+
watched.view,
|
|
359
|
+
request.since,
|
|
360
|
+
request.thinking,
|
|
361
|
+
context
|
|
362
|
+
);
|
|
363
|
+
const head = headOf(recalled.events);
|
|
364
|
+
const at = request.since === null ? -1 : recalled.events.findIndex((event) => idOf(event) === request.since);
|
|
242
365
|
const mapper = new Mapper(request.thinking);
|
|
243
|
-
for (const entry of
|
|
244
|
-
mapper.
|
|
245
|
-
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
|
|
366
|
+
for (const entry of recalled.entries) mapper.entry(entry);
|
|
367
|
+
mapper.see(liveOf(watched.view));
|
|
368
|
+
let sink;
|
|
369
|
+
const busy = request.busy ? await watchBusy(
|
|
370
|
+
host.harness,
|
|
371
|
+
{
|
|
372
|
+
conversation: watched.conversation,
|
|
373
|
+
snapshot: { run: liveOf(watched.view)?.run, inbox: inboxOf(watched.view) },
|
|
374
|
+
stop: () => watched.stop()
|
|
375
|
+
},
|
|
376
|
+
(events) => sink?.push(events),
|
|
377
|
+
context
|
|
378
|
+
).catch(async (error) => {
|
|
379
|
+
await watched.stop();
|
|
380
|
+
throw error;
|
|
381
|
+
}) : void 0;
|
|
382
|
+
const { id, stream } = watched.open(async (view, frame) => {
|
|
383
|
+
const entries = await caughtUp(watched.transcript, view, frame);
|
|
384
|
+
const mapped = mapper.apply(entries, liveOf(view));
|
|
385
|
+
const events = arrange(mapped.entryEvents, mapped.liveEvents);
|
|
386
|
+
stream.push(busy ? busy.gate.before(events) : events);
|
|
249
387
|
}, busy?.stop);
|
|
388
|
+
sink = stream;
|
|
250
389
|
if (at >= 0) {
|
|
251
|
-
const own =
|
|
390
|
+
const own = recalled.events[at];
|
|
252
391
|
const sinceId = idOf(own);
|
|
253
392
|
let last = at;
|
|
254
|
-
while (last + 1 <
|
|
393
|
+
while (last + 1 < recalled.events.length && idOf(recalled.events[last + 1]) === sinceId)
|
|
394
|
+
last++;
|
|
255
395
|
const replay = own.t === "text" || own.t === "thinking" ? [own] : [];
|
|
256
|
-
stream.push([...replay, ...
|
|
396
|
+
stream.push([...replay, ...recalled.events.slice(last + 1)]);
|
|
257
397
|
}
|
|
258
398
|
return {
|
|
259
399
|
ok: true,
|
|
260
400
|
stream: id,
|
|
261
401
|
delivered: null,
|
|
262
402
|
head,
|
|
263
|
-
gap,
|
|
403
|
+
gap: recalled.gap,
|
|
264
404
|
...busy ? { busy: busy.opened } : {}
|
|
265
405
|
};
|
|
266
406
|
},
|
|
@@ -282,10 +422,13 @@ function createRemote(host) {
|
|
|
282
422
|
},
|
|
283
423
|
async abort(agentId, context) {
|
|
284
424
|
const conversation = await host.conversation(agentId, context);
|
|
285
|
-
const watched = await
|
|
286
|
-
const busy = Boolean(watched.
|
|
287
|
-
|
|
288
|
-
|
|
425
|
+
const watched = await conversation.watch(context);
|
|
426
|
+
const busy = Boolean(liveOf(watched.value)?.run);
|
|
427
|
+
try {
|
|
428
|
+
if (busy) await conversation.abort(context);
|
|
429
|
+
} finally {
|
|
430
|
+
await watched.stop();
|
|
431
|
+
}
|
|
289
432
|
return { aborted: busy };
|
|
290
433
|
},
|
|
291
434
|
async dispose() {
|
|
@@ -304,8 +447,6 @@ export {
|
|
|
304
447
|
Stream,
|
|
305
448
|
VAULT_BACK,
|
|
306
449
|
createRemote,
|
|
307
|
-
followed,
|
|
308
|
-
resync,
|
|
309
450
|
vaultNotices
|
|
310
451
|
};
|
|
311
452
|
//# sourceMappingURL=host.js.map
|