@nervekit/desktop 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/app/startup-sequence.d.ts +28 -0
- package/dist/app/startup-sequence.d.ts.map +1 -0
- package/dist/app/startup-sequence.js +46 -0
- package/dist/app/startup-sequence.js.map +1 -0
- package/dist/main.js +56 -31
- package/dist/main.js.map +1 -1
- package/dist/settings/desktop-settings.d.ts +2 -1
- package/dist/settings/desktop-settings.d.ts.map +1 -1
- package/dist/settings/desktop-settings.js +7 -3
- package/dist/settings/desktop-settings.js.map +1 -1
- package/dist/window/initial-zoom.d.ts +3 -0
- package/dist/window/initial-zoom.d.ts.map +1 -0
- package/dist/window/initial-zoom.js +9 -0
- package/dist/window/initial-zoom.js.map +1 -0
- package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation-runtime.d.ts +2 -1
- package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation-runtime.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation-runtime.js +15 -10
- package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation-runtime.js.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation.operations.schema.d.ts +4 -0
- package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation.operations.schema.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation.operations.schema.js +1 -0
- package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation.operations.schema.js.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation.schema.d.ts +28 -2
- package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation.schema.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation.schema.js +17 -2
- package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation.schema.js.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/events/bounded-public-data.schema.d.ts +2 -0
- package/node_modules/@nervekit/contracts/dist/domains/events/bounded-public-data.schema.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/events/bounded-public-data.schema.js +5 -5
- package/node_modules/@nervekit/contracts/dist/domains/events/bounded-public-data.schema.js.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/protocol/http.schema.d.ts +4 -0
- package/node_modules/@nervekit/contracts/dist/domains/protocol/http.schema.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/protocol/messages.schema.d.ts +2 -0
- package/node_modules/@nervekit/contracts/dist/domains/protocol/messages.schema.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/protocol/operation-catalog.schema.d.ts +5 -0
- package/node_modules/@nervekit/contracts/dist/domains/protocol/operation-catalog.schema.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/package.json +1 -1
- package/node_modules/@nervekit/harness/dist/{agent.d.ts → agent/agent.d.ts} +2 -2
- package/node_modules/@nervekit/harness/dist/agent/agent.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/{agent.js → agent/agent.js} +2 -2
- package/node_modules/@nervekit/harness/dist/agent/agent.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/{runtime → agent}/loop/agent-loop.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/agent/loop/agent-loop.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/agent/loop/agent-loop.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/{runtime → agent}/loop/events.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/agent/loop/events.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/agent/loop/events.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/{runtime → agent}/loop/stream-assistant.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/agent/loop/stream-assistant.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/{runtime → agent}/loop/stream-assistant.js +2 -2
- package/node_modules/@nervekit/harness/dist/agent/loop/stream-assistant.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/{runtime → agent}/loop/tool-execution.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/agent/loop/tool-execution.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/{runtime → agent}/loop/tool-execution.js +1 -1
- package/node_modules/@nervekit/harness/dist/agent/loop/tool-execution.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/{runtime → agent}/loop/turn-loop.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/agent/loop/turn-loop.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/agent/loop/turn-loop.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/{suspension.d.ts → agent/suspension.d.ts} +1 -1
- package/node_modules/@nervekit/harness/dist/agent/suspension.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/agent/suspension.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/{tool-adapter.d.ts → agent/tool-adapter.d.ts} +1 -1
- package/node_modules/@nervekit/harness/dist/agent/tool-adapter.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/agent/tool-adapter.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/agent/types/agent.d.ts +83 -0
- package/node_modules/@nervekit/harness/dist/agent/types/agent.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/agent/types/agent.js +2 -0
- package/node_modules/@nervekit/harness/dist/agent/types/agent.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/agent/types/common.d.ts +26 -0
- package/node_modules/@nervekit/harness/dist/agent/types/common.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/agent/types/common.js +2 -0
- package/node_modules/@nervekit/harness/dist/agent/types/common.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/agent/types/index.d.ts +6 -0
- package/node_modules/@nervekit/harness/dist/agent/types/index.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/agent/types/index.js +6 -0
- package/node_modules/@nervekit/harness/dist/agent/types/index.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/{types.d.ts → agent/types/loop.d.ts} +5 -197
- package/node_modules/@nervekit/harness/dist/agent/types/loop.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/agent/types/loop.js +2 -0
- package/node_modules/@nervekit/harness/dist/agent/types/loop.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/agent/types/messages.d.ts +24 -0
- package/node_modules/@nervekit/harness/dist/agent/types/messages.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/agent/types/messages.js +2 -0
- package/node_modules/@nervekit/harness/dist/agent/types/messages.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/agent/types/tools.d.ts +74 -0
- package/node_modules/@nervekit/harness/dist/agent/types/tools.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/agent/types/tools.js +2 -0
- package/node_modules/@nervekit/harness/dist/agent/types/tools.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/agent-harness.d.ts +6 -5
- package/node_modules/@nervekit/harness/dist/harness/agent-harness.d.ts.map +1 -1
- package/node_modules/@nervekit/harness/dist/harness/agent-harness.js +67 -191
- package/node_modules/@nervekit/harness/dist/harness/agent-harness.js.map +1 -1
- package/node_modules/@nervekit/harness/dist/harness/compaction/branch-summarization.d.ts +2 -2
- package/node_modules/@nervekit/harness/dist/harness/compaction/branch-summarization.d.ts.map +1 -1
- package/node_modules/@nervekit/harness/dist/harness/compaction/branch-summarization.js +1 -1
- package/node_modules/@nervekit/harness/dist/harness/compaction/branch-summarization.js.map +1 -1
- package/node_modules/@nervekit/harness/dist/harness/compaction/compaction.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/harness/compaction/compaction.d.ts.map +1 -1
- package/node_modules/@nervekit/harness/dist/harness/compaction/compaction.js +1 -1
- package/node_modules/@nervekit/harness/dist/harness/compaction/compaction.js.map +1 -1
- package/node_modules/@nervekit/harness/dist/harness/compaction/types.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/harness/compaction/types.d.ts.map +1 -1
- package/node_modules/@nervekit/harness/dist/harness/compaction/usage.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/harness/compaction/usage.d.ts.map +1 -1
- package/node_modules/@nervekit/harness/dist/harness/compaction/utils.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/harness/compaction/utils.d.ts.map +1 -1
- package/node_modules/@nervekit/harness/dist/harness/{harness-configuration-methods.d.ts → configuration/operations.d.ts} +4 -4
- package/node_modules/@nervekit/harness/dist/harness/configuration/operations.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{harness-configuration-methods.js → configuration/operations.js} +5 -5
- package/node_modules/@nervekit/harness/dist/harness/configuration/operations.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{options.d.ts → configuration/options.d.ts} +3 -3
- package/node_modules/@nervekit/harness/dist/harness/configuration/options.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/configuration/options.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/configuration/stream-options.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/configuration/stream-options.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{configuration.d.ts → configuration/tools.d.ts} +3 -3
- package/node_modules/@nervekit/harness/dist/harness/configuration/tools.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{configuration.js → configuration/tools.js} +2 -2
- package/node_modules/@nervekit/harness/dist/harness/configuration/tools.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{turn-state.d.ts → configuration/turn-state.d.ts} +3 -3
- package/node_modules/@nervekit/harness/dist/harness/configuration/turn-state.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/configuration/turn-state.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/conversation/context.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/harness/conversation/context.d.ts.map +1 -1
- package/node_modules/@nervekit/harness/dist/harness/conversation/conversation.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/harness/conversation/conversation.d.ts.map +1 -1
- package/node_modules/@nervekit/harness/dist/harness/conversation/entries.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/harness/conversation/entries.d.ts.map +1 -1
- package/node_modules/@nervekit/harness/dist/harness/conversation/jsonl-repo.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/harness/conversation/jsonl-repo.d.ts.map +1 -1
- package/node_modules/@nervekit/harness/dist/harness/conversation/jsonl-storage.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/harness/conversation/jsonl-storage.d.ts.map +1 -1
- package/node_modules/@nervekit/harness/dist/harness/environment/nodejs.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/environment/nodejs.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/environment/types.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/environment/types.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{harness-events.d.ts → lifecycle/event-hub.d.ts} +4 -4
- package/node_modules/@nervekit/harness/dist/harness/lifecycle/event-hub.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{harness-events.js → lifecycle/event-hub.js} +4 -4
- package/node_modules/@nervekit/harness/dist/harness/lifecycle/event-hub.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/lifecycle/event-processing.d.ts +26 -0
- package/node_modules/@nervekit/harness/dist/harness/lifecycle/event-processing.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/lifecycle/event-processing.js +52 -0
- package/node_modules/@nervekit/harness/dist/harness/lifecycle/event-processing.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{events.d.ts → lifecycle/events.d.ts} +3 -3
- package/node_modules/@nervekit/harness/dist/harness/lifecycle/events.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{events.js.map → lifecycle/events.js.map} +1 -1
- package/node_modules/@nervekit/harness/dist/harness/{harness-maintenance.d.ts → maintenance/operations.d.ts} +5 -5
- package/node_modules/@nervekit/harness/dist/harness/maintenance/operations.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{harness-maintenance.js → maintenance/operations.js} +6 -6
- package/node_modules/@nervekit/harness/dist/harness/maintenance/operations.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/messages.d.ts +2 -2
- package/node_modules/@nervekit/harness/dist/harness/messages.d.ts.map +1 -1
- package/node_modules/@nervekit/harness/dist/harness/{utils/env-path.d.ts → path-utils.d.ts} +1 -1
- package/node_modules/@nervekit/harness/dist/harness/path-utils.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{utils/env-path.js → path-utils.js} +1 -1
- package/node_modules/@nervekit/harness/dist/harness/path-utils.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{harness-queue-coalescing.d.ts → queue/coalescing.d.ts} +3 -3
- package/node_modules/@nervekit/harness/dist/harness/queue/coalescing.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{harness-queue-coalescing.js → queue/coalescing.js} +2 -2
- package/node_modules/@nervekit/harness/dist/harness/queue/coalescing.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{harness-queue-methods.d.ts → queue/operations.d.ts} +14 -4
- package/node_modules/@nervekit/harness/dist/harness/queue/operations.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{harness-queue-methods.js → queue/operations.js} +35 -5
- package/node_modules/@nervekit/harness/dist/harness/queue/operations.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{harness-invocations.d.ts → resources/invocations.d.ts} +4 -4
- package/node_modules/@nervekit/harness/dist/harness/resources/invocations.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{harness-invocations.js → resources/invocations.js} +3 -3
- package/node_modules/@nervekit/harness/dist/harness/resources/invocations.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{prompt-templates.d.ts → resources/prompt-templates.d.ts} +2 -2
- package/node_modules/@nervekit/harness/dist/harness/resources/prompt-templates.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{prompt-templates.js → resources/prompt-templates.js} +2 -2
- package/node_modules/@nervekit/harness/dist/harness/resources/prompt-templates.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{skills → resources/skills}/format.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/harness/resources/skills/format.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{skills → resources/skills}/format.js +1 -1
- package/node_modules/@nervekit/harness/dist/harness/resources/skills/format.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/resources/skills/index.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/resources/skills/index.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{skills → resources/skills}/loader.d.ts +2 -2
- package/node_modules/@nervekit/harness/dist/harness/resources/skills/loader.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{skills → resources/skills}/loader.js +1 -1
- package/node_modules/@nervekit/harness/dist/harness/resources/skills/loader.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{skills → resources/skills}/parser.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/harness/resources/skills/parser.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{skills → resources/skills}/parser.js +1 -1
- package/node_modules/@nervekit/harness/dist/harness/resources/skills/parser.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/resources/skills/validation.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/resources/skills/validation.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/resources/system-prompt.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/resources/system-prompt.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{harness-continuation.d.ts → run/continuation.d.ts} +4 -4
- package/node_modules/@nervekit/harness/dist/harness/run/continuation.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{harness-continuation.js → run/continuation.js} +6 -6
- package/node_modules/@nervekit/harness/dist/harness/run/continuation.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/{conversation-writes.d.ts → run/conversation-writes.d.ts} +3 -3
- package/node_modules/@nervekit/harness/dist/harness/run/conversation-writes.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/run/conversation-writes.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/run/execution.d.ts +42 -0
- package/node_modules/@nervekit/harness/dist/harness/run/execution.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/run/execution.js +118 -0
- package/node_modules/@nervekit/harness/dist/harness/run/execution.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/harness/run/messages.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/harness/run/messages.d.ts.map +1 -1
- package/node_modules/@nervekit/harness/dist/index.d.ts +22 -13
- package/node_modules/@nervekit/harness/dist/index.d.ts.map +1 -1
- package/node_modules/@nervekit/harness/dist/index.js +22 -13
- package/node_modules/@nervekit/harness/dist/index.js.map +1 -1
- package/node_modules/@nervekit/harness/dist/models/image-normalization.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/models/image-normalization.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/models/prompt-stream.d.ts +4 -0
- package/node_modules/@nervekit/harness/dist/models/prompt-stream.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/models/prompt-stream.js +23 -0
- package/node_modules/@nervekit/harness/dist/models/prompt-stream.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/{pi-ai-models.d.ts → models/provider-registry.d.ts} +1 -1
- package/node_modules/@nervekit/harness/dist/models/provider-registry.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/{pi-ai-models.js → models/provider-registry.js} +1 -1
- package/node_modules/@nervekit/harness/dist/models/provider-registry.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/models/resolution.d.ts +17 -0
- package/node_modules/@nervekit/harness/dist/models/resolution.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/{runtime.js → models/resolution.js} +5 -74
- package/node_modules/@nervekit/harness/dist/models/resolution.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/models/scripted-provider.d.ts +10 -0
- package/node_modules/@nervekit/harness/dist/models/scripted-provider.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/models/scripted-provider.js +55 -0
- package/node_modules/@nervekit/harness/dist/models/scripted-provider.js.map +1 -0
- package/node_modules/@nervekit/harness/dist/{runtime.d.ts → models/types.d.ts} +3 -23
- package/node_modules/@nervekit/harness/dist/models/types.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/{harness/env → models}/types.js.map +1 -1
- package/node_modules/@nervekit/harness/dist/node.d.ts +1 -1
- package/node_modules/@nervekit/harness/dist/node.d.ts.map +1 -1
- package/node_modules/@nervekit/harness/dist/node.js +1 -1
- package/node_modules/@nervekit/harness/dist/node.js.map +1 -1
- package/node_modules/@nervekit/harness/dist/{proxy.d.ts → transport/proxy.d.ts} +1 -1
- package/node_modules/@nervekit/harness/dist/transport/proxy.d.ts.map +1 -0
- package/node_modules/@nervekit/harness/dist/transport/proxy.js.map +1 -0
- package/node_modules/@nervekit/harness/package.json +3 -3
- package/node_modules/@nervekit/host-runtime/dist/task-service.d.ts +1 -2
- package/node_modules/@nervekit/host-runtime/dist/task-service.d.ts.map +1 -1
- package/node_modules/@nervekit/host-runtime/dist/task-service.js +21 -6
- package/node_modules/@nervekit/host-runtime/dist/task-service.js.map +1 -1
- package/node_modules/@nervekit/host-runtime/package.json +4 -4
- package/node_modules/@nervekit/protocol/package.json +2 -2
- package/node_modules/@nervekit/tools/dist/execution/common/html-to-markdown.worker.d.ts +2 -0
- package/node_modules/@nervekit/tools/dist/execution/common/html-to-markdown.worker.d.ts.map +1 -0
- package/node_modules/@nervekit/tools/dist/execution/common/html-to-markdown.worker.js +59 -0
- package/node_modules/@nervekit/tools/dist/execution/common/html-to-markdown.worker.js.map +1 -0
- package/node_modules/@nervekit/tools/dist/execution/common/isolated-html-to-markdown.d.ts +17 -0
- package/node_modules/@nervekit/tools/dist/execution/common/isolated-html-to-markdown.d.ts.map +1 -0
- package/node_modules/@nervekit/tools/dist/execution/common/isolated-html-to-markdown.js +162 -0
- package/node_modules/@nervekit/tools/dist/execution/common/isolated-html-to-markdown.js.map +1 -0
- package/node_modules/@nervekit/tools/dist/execution/common/live-output.d.ts +15 -0
- package/node_modules/@nervekit/tools/dist/execution/common/live-output.d.ts.map +1 -0
- package/node_modules/@nervekit/tools/dist/execution/common/live-output.js +47 -0
- package/node_modules/@nervekit/tools/dist/execution/common/live-output.js.map +1 -0
- package/node_modules/@nervekit/tools/dist/execution/common/output-budget.d.ts +5 -1
- package/node_modules/@nervekit/tools/dist/execution/common/output-budget.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/common/output-budget.js +24 -10
- package/node_modules/@nervekit/tools/dist/execution/common/output-budget.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/confluence/files.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/confluence/files.js +2 -2
- package/node_modules/@nervekit/tools/dist/execution/confluence/files.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/confluence/markdown.d.ts +1 -1
- package/node_modules/@nervekit/tools/dist/execution/confluence/markdown.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/confluence/markdown.js +6 -31
- package/node_modules/@nervekit/tools/dist/execution/confluence/markdown.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/index.d.ts +2 -1
- package/node_modules/@nervekit/tools/dist/execution/index.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/index.js +2 -1
- package/node_modules/@nervekit/tools/dist/execution/index.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/python/python.js +7 -12
- package/node_modules/@nervekit/tools/dist/execution/python/python.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/shell/bash.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/shell/bash.js +8 -13
- package/node_modules/@nervekit/tools/dist/execution/shell/bash.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/web/web-fetch.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/web/web-fetch.js +49 -4
- package/node_modules/@nervekit/tools/dist/execution/web/web-fetch.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/index.d.ts +1 -1
- package/node_modules/@nervekit/tools/dist/index.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/index.js +1 -1
- package/node_modules/@nervekit/tools/dist/index.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/runtime/dispatcher.js +3 -3
- package/node_modules/@nervekit/tools/dist/runtime/dispatcher.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/runtime/types.d.ts +1 -1
- package/node_modules/@nervekit/tools/dist/runtime/types.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/runtime/types.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/types.d.ts +1 -1
- package/node_modules/@nervekit/tools/dist/types.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/package.json +2 -2
- package/node_modules/@nervekit/workbench-server/dist/app/orchestrator-state.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/app/orchestrator-state.js +8 -0
- package/node_modules/@nervekit/workbench-server/dist/app/orchestrator-state.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/auto-compaction-runner.d.ts +5 -0
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/auto-compaction-runner.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/auto-compaction-runner.js +10 -4
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/auto-compaction-runner.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/workbench-agent-mechanics.d.ts +3 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/workbench-agent-mechanics.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/workbench-agent-mechanics.js +7 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/workbench-agent-mechanics.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/workbench-harness-execution.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/workbench-harness-execution.js +2 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/workbench-harness-execution.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/auth/oauth-flow-manager.d.ts +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/auth/oauth-flow-manager.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/auth/oauth-flow-manager.js +5 -5
- package/node_modules/@nervekit/workbench-server/dist/domains/auth/oauth-flow-manager.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/conversations/conversation-lifecycle.service.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/conversations/conversation-lifecycle.service.js +5 -3
- package/node_modules/@nervekit/workbench-server/dist/domains/conversations/conversation-lifecycle.service.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/conversations/conversation-service.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/conversations/conversation-service.js +3 -3
- package/node_modules/@nervekit/workbench-server/dist/domains/conversations/conversation-service.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/conversations/conversation.repository.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/conversations/conversation.repository.js +5 -7
- package/node_modules/@nervekit/workbench-server/dist/domains/conversations/conversation.repository.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/conversations/operations/compaction-service.d.ts +5 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/conversations/operations/compaction-service.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/conversations/operations/compaction-service.js +210 -145
- package/node_modules/@nervekit/workbench-server/dist/domains/conversations/operations/compaction-service.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/runs/run-transition.repository.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/runs/run-transition.repository.js +2 -3
- package/node_modules/@nervekit/workbench-server/dist/domains/runs/run-transition.repository.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tasks/workbench-task-adapters.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tasks/workbench-task-adapters.js +23 -4
- package/node_modules/@nervekit/workbench-server/dist/domains/tasks/workbench-task-adapters.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tasks/workbench-task-service.d.ts +3 -3
- package/node_modules/@nervekit/workbench-server/dist/domains/tasks/workbench-task-service.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/live-tool-output-publisher.d.ts +17 -0
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/live-tool-output-publisher.d.ts.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/live-tool-output-publisher.js +75 -0
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/live-tool-output-publisher.js.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/orchestration-tool-dispatcher-handlers.d.ts +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/orchestration-tool-dispatcher-handlers.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/orchestration-tool-dispatcher-handlers.js +5 -31
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/orchestration-tool-dispatcher-handlers.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/orchestration-tool-dispatcher.d.ts +5 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/orchestration-tool-dispatcher.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/orchestration-tool-dispatcher.js +15 -7
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/orchestration-tool-dispatcher.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-call.repository.d.ts +17 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-call.repository.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-call.repository.js +44 -4
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-call.repository.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-service.d.ts +1 -0
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-service.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-service.js +16 -0
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-service.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/usage/subscription-usage-service.d.ts +2 -0
- package/node_modules/@nervekit/workbench-server/dist/domains/usage/subscription-usage-service.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/usage/subscription-usage-service.js +9 -2
- package/node_modules/@nervekit/workbench-server/dist/domains/usage/subscription-usage-service.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/diagnostics/logging.d.ts +1 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/diagnostics/logging.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/diagnostics/logging.js +20 -4
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/diagnostics/logging.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/events/stream-log-registry.d.ts +8 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/events/stream-log-registry.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/events/stream-log-registry.js +26 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/events/stream-log-registry.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/index-store/index-store.d.ts +2 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/index-store/index-store.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/index-store/index-store.js +49 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/index-store/index-store.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/json.d.ts +7 -3
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/json.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/json.js +67 -21
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/json.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/main.js +21 -14
- package/node_modules/@nervekit/workbench-server/dist/main.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/protocol/http-dispatcher.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/protocol/http-dispatcher.js +3 -11
- package/node_modules/@nervekit/workbench-server/dist/protocol/http-dispatcher.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handler-registry.d.ts +17 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handler-registry.d.ts.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handler-registry.js +54 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handler-registry.js.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/conversation-agent-method-handlers.d.ts +505 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/conversation-agent-method-handlers.d.ts.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/conversation-agent-method-handlers.js +88 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/conversation-agent-method-handlers.js.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/git-method-handlers.d.ts +433 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/git-method-handlers.d.ts.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/git-method-handlers.js +24 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/git-method-handlers.js.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/interaction-method-handlers.d.ts +400 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/interaction-method-handlers.d.ts.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/interaction-method-handlers.js +68 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/interaction-method-handlers.js.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/platform-method-handlers.d.ts +1099 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/platform-method-handlers.d.ts.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/platform-method-handlers.js +127 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/platform-method-handlers.js.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/project-task-method-handlers.d.ts +910 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/project-task-method-handlers.d.ts.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/project-task-method-handlers.js +82 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/project-task-method-handlers.js.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers.d.ts +3 -1
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers.js +18 -566
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/routes/auth-routes.js +1 -1
- package/node_modules/@nervekit/workbench-server/dist/routes/auth-routes.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/runtime/runtime-registry.d.ts +13 -1
- package/node_modules/@nervekit/workbench-server/dist/runtime/runtime-registry.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/runtime/runtime-registry.js +72 -18
- package/node_modules/@nervekit/workbench-server/dist/runtime/runtime-registry.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-CUNRgpDl.js → dist-CFWIYh0s.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/index-maZKRPqe.css +1 -0
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{index-CEGKY4zN.js → index-uoIbQOdM.js} +145 -144
- package/node_modules/@nervekit/workbench-server/dist/web/index.html +31 -2
- package/node_modules/@nervekit/workbench-server/dist/web/sw.js +1 -1
- package/node_modules/@nervekit/workbench-server/package.json +5 -5
- package/package.json +8 -8
- package/node_modules/@nervekit/harness/dist/agent-loop.d.ts +0 -2
- package/node_modules/@nervekit/harness/dist/agent-loop.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/agent-loop.js +0 -2
- package/node_modules/@nervekit/harness/dist/agent-loop.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/agent.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/agent.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/configuration.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/configuration.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/conversation-writes.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/conversation-writes.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/env/nodejs.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/env/nodejs.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/env/types.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/events.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/harness-configuration-methods.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/harness-configuration-methods.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/harness-continuation.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/harness-continuation.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/harness-events.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/harness-events.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/harness-invocations.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/harness-invocations.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/harness-maintenance.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/harness-maintenance.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/harness-queue-coalescing.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/harness-queue-coalescing.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/harness-queue-methods.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/harness-queue-methods.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/options.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/options.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/prompt-templates.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/prompt-templates.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/skills/format.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/skills/format.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/skills/index.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/skills/index.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/skills/loader.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/skills/loader.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/skills/parser.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/skills/parser.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/skills/validation.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/skills/validation.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/skills.d.ts +0 -2
- package/node_modules/@nervekit/harness/dist/harness/skills.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/skills.js +0 -2
- package/node_modules/@nervekit/harness/dist/harness/skills.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/stream-options.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/stream-options.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/system-prompt.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/system-prompt.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/turn-state.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/turn-state.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/types.d.ts +0 -9
- package/node_modules/@nervekit/harness/dist/harness/types.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/types.js +0 -8
- package/node_modules/@nervekit/harness/dist/harness/types.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/utils/env-path.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/harness/utils/env-path.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/pi-ai-models.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/pi-ai-models.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/proxy.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/proxy.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/runtime/image-normalization.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/runtime/image-normalization.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/runtime/loop/agent-loop.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/runtime/loop/agent-loop.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/runtime/loop/events.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/runtime/loop/events.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/runtime/loop/index.d.ts +0 -6
- package/node_modules/@nervekit/harness/dist/runtime/loop/index.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/runtime/loop/index.js +0 -6
- package/node_modules/@nervekit/harness/dist/runtime/loop/index.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/runtime/loop/stream-assistant.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/runtime/loop/stream-assistant.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/runtime/loop/tool-execution.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/runtime/loop/tool-execution.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/runtime/loop/turn-loop.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/runtime/loop/turn-loop.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/runtime.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/runtime.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/suspension.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/suspension.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/tool-adapter.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/tool-adapter.js.map +0 -1
- package/node_modules/@nervekit/harness/dist/types.d.ts.map +0 -1
- package/node_modules/@nervekit/harness/dist/types.js.map +0 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/conversations/conversation-runtime.d.ts +0 -114
- package/node_modules/@nervekit/workbench-server/dist/domains/conversations/conversation-runtime.d.ts.map +0 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/conversations/conversation-runtime.js +0 -452
- package/node_modules/@nervekit/workbench-server/dist/domains/conversations/conversation-runtime.js.map +0 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/index-oDY02_0Y.css +0 -2
- /package/node_modules/@nervekit/harness/dist/{runtime → agent}/loop/agent-loop.js +0 -0
- /package/node_modules/@nervekit/harness/dist/{runtime → agent}/loop/events.js +0 -0
- /package/node_modules/@nervekit/harness/dist/{runtime → agent}/loop/turn-loop.js +0 -0
- /package/node_modules/@nervekit/harness/dist/{suspension.js → agent/suspension.js} +0 -0
- /package/node_modules/@nervekit/harness/dist/{tool-adapter.js → agent/tool-adapter.js} +0 -0
- /package/node_modules/@nervekit/harness/dist/harness/{options.js → configuration/options.js} +0 -0
- /package/node_modules/@nervekit/harness/dist/harness/{stream-options.d.ts → configuration/stream-options.d.ts} +0 -0
- /package/node_modules/@nervekit/harness/dist/harness/{stream-options.js → configuration/stream-options.js} +0 -0
- /package/node_modules/@nervekit/harness/dist/harness/{turn-state.js → configuration/turn-state.js} +0 -0
- /package/node_modules/@nervekit/harness/dist/harness/{env → environment}/nodejs.d.ts +0 -0
- /package/node_modules/@nervekit/harness/dist/harness/{env → environment}/nodejs.js +0 -0
- /package/node_modules/@nervekit/harness/dist/harness/{env → environment}/types.d.ts +0 -0
- /package/node_modules/@nervekit/harness/dist/harness/{env → environment}/types.js +0 -0
- /package/node_modules/@nervekit/harness/dist/harness/{events.js → lifecycle/events.js} +0 -0
- /package/node_modules/@nervekit/harness/dist/harness/{skills → resources/skills}/index.d.ts +0 -0
- /package/node_modules/@nervekit/harness/dist/harness/{skills → resources/skills}/index.js +0 -0
- /package/node_modules/@nervekit/harness/dist/harness/{skills → resources/skills}/validation.d.ts +0 -0
- /package/node_modules/@nervekit/harness/dist/harness/{skills → resources/skills}/validation.js +0 -0
- /package/node_modules/@nervekit/harness/dist/harness/{system-prompt.d.ts → resources/system-prompt.d.ts} +0 -0
- /package/node_modules/@nervekit/harness/dist/harness/{system-prompt.js → resources/system-prompt.js} +0 -0
- /package/node_modules/@nervekit/harness/dist/harness/{conversation-writes.js → run/conversation-writes.js} +0 -0
- /package/node_modules/@nervekit/harness/dist/{runtime → models}/image-normalization.d.ts +0 -0
- /package/node_modules/@nervekit/harness/dist/{runtime → models}/image-normalization.js +0 -0
- /package/node_modules/@nervekit/harness/dist/{types.js → models/types.js} +0 -0
- /package/node_modules/@nervekit/harness/dist/{proxy.js → transport/proxy.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compaction-service.d.ts","sourceRoot":"","sources":["../../../../src/domains/conversations/operations/compaction-service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"compaction-service.d.ts","sourceRoot":"","sources":["../../../../src/domains/conversations/operations/compaction-service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,YAAY,EAMlB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EACV,0BAA0B,EAC1B,4BAA4B,EAC5B,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAGrF,MAAM,WAAW,4BAA4B;IAC3C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,uBAAuB,GAAG,CACpC,KAAK,EAAE,4BAA4B,EACnC,OAAO,CAAC,EAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;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CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC;IAX7B,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAuC;gBAGtD,eAAe,EAAE,CAChC,cAAc,EAAE,MAAM,KACnB,kBAAkB,EACN,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,aAAa,EAChD,WAAW,EAAE,uBAAuB,EACpC,cAAc,EAAE,0BAA0B,EAC1C,oBAAoB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACzC,MAAM,EAAE,iBAAiB,EACzB,SAAS,CAAC,EAAE,oBAAoB,YAAA;IAG7C,mBAAmB,CACvB,cAAc,EAAE,MAAM,EACtB,OAAO,GAAE,0BAA+B,EACxC,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC;QAAE,YAAY,EAAE,kBAAkB,CAAC;QAAC,KAAK,EAAE,iBAAiB,CAAA;KAAE,CAAC;IA0PpE,gBAAgB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;YAQlD,qBAAqB;CA6BpC"}
|
|
@@ -4,6 +4,13 @@ import { buildExtractiveSummary } from "./summary.js";
|
|
|
4
4
|
function errorMessage(error) {
|
|
5
5
|
return error instanceof Error ? error.message : String(error);
|
|
6
6
|
}
|
|
7
|
+
function throwIfCompactionAborted(signal) {
|
|
8
|
+
if (!signal.aborted)
|
|
9
|
+
return;
|
|
10
|
+
throw signal.reason instanceof Error
|
|
11
|
+
? signal.reason
|
|
12
|
+
: new Error("Compaction cancelled.");
|
|
13
|
+
}
|
|
7
14
|
export class CompactionService {
|
|
8
15
|
getConversation;
|
|
9
16
|
getProject;
|
|
@@ -12,6 +19,7 @@ export class CompactionService {
|
|
|
12
19
|
rebuildConversations;
|
|
13
20
|
events;
|
|
14
21
|
summarize;
|
|
22
|
+
activeCompactions = new Map();
|
|
15
23
|
constructor(getConversation, getProject, appendEntry, harnessStorage, rebuildConversations, events, summarize) {
|
|
16
24
|
this.getConversation = getConversation;
|
|
17
25
|
this.getProject = getProject;
|
|
@@ -22,165 +30,218 @@ export class CompactionService {
|
|
|
22
30
|
this.summarize = summarize;
|
|
23
31
|
}
|
|
24
32
|
async compactConversation(conversationId, request = {}, options = {}) {
|
|
33
|
+
if (this.activeCompactions.has(conversationId)) {
|
|
34
|
+
throw new HttpError(409, "COMPACTION_IN_PROGRESS", "Conversation compaction is already in progress.");
|
|
35
|
+
}
|
|
25
36
|
const reason = options.reason ?? "manual";
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
...DEFAULT_COMPACTION_SETTINGS,
|
|
36
|
-
reserveTokens: summaryReserveTokens,
|
|
37
|
-
keepRecentTokens: request.keepRecentTokens ??
|
|
38
|
-
(options.keepRecentTokens && options.keepRecentTokens > 0
|
|
39
|
-
? options.keepRecentTokens
|
|
40
|
-
: DEFAULT_COMPACTION_SETTINGS.keepRecentTokens),
|
|
37
|
+
let complete;
|
|
38
|
+
const completion = new Promise((resolve) => {
|
|
39
|
+
complete = resolve;
|
|
40
|
+
});
|
|
41
|
+
const operation = {
|
|
42
|
+
controller: new AbortController(),
|
|
43
|
+
committing: false,
|
|
44
|
+
completion,
|
|
45
|
+
complete,
|
|
41
46
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
const preparation = prepared.value;
|
|
50
|
-
let firstKeptEntryId = preparation.firstKeptEntryId;
|
|
51
|
-
let messagesToSummarize = [
|
|
52
|
-
...preparation.messagesToSummarize,
|
|
53
|
-
...preparation.turnPrefixMessages,
|
|
54
|
-
];
|
|
55
|
-
if (messagesToSummarize.length === 0) {
|
|
56
|
-
const messageEntries = branch.filter((entry) => entry.type === "message");
|
|
57
|
-
const fallbackKept = messageEntries.at(-1);
|
|
58
|
-
messagesToSummarize = messageEntries
|
|
59
|
-
.slice(0, -1)
|
|
60
|
-
.map((entry) => entry.message);
|
|
61
|
-
if (fallbackKept)
|
|
62
|
-
firstKeptEntryId = fallbackKept.id;
|
|
63
|
-
}
|
|
64
|
-
if (messagesToSummarize.length === 0) {
|
|
65
|
-
throw new HttpError(409, "NOTHING_TO_COMPACT", "No prior messages to compact.");
|
|
66
|
-
}
|
|
67
|
-
const startedAt = new Date().toISOString();
|
|
68
|
-
let started = false;
|
|
47
|
+
this.activeCompactions.set(conversationId, operation);
|
|
48
|
+
const abortFromOwner = () => operation.controller.abort(options.signal?.reason);
|
|
49
|
+
if (options.signal?.aborted)
|
|
50
|
+
abortFromOwner();
|
|
51
|
+
else
|
|
52
|
+
options.signal?.addEventListener("abort", abortFromOwner, { once: true });
|
|
69
53
|
try {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
buildExtractiveSummary({
|
|
88
|
-
title: "Context checkpoint",
|
|
89
|
-
messages: messagesToSummarize,
|
|
90
|
-
previousSummary: preparation.previousSummary,
|
|
91
|
-
instructions: request.instructions,
|
|
92
|
-
maxChars: Math.max(1_000, Math.floor(summaryReserveTokens * 3.2)),
|
|
93
|
-
});
|
|
94
|
-
const tokensAfter = estimatePostCompactionTokens(branch, firstKeptEntryId, summary, preparation.tokensBefore);
|
|
95
|
-
if (reason !== "manual" && tokensAfter >= preparation.tokensBefore) {
|
|
96
|
-
throw new HttpError(409, "INEFFECTIVE_COMPACTION", "Compaction would not reduce context usage.");
|
|
97
|
-
}
|
|
98
|
-
const freedTokens = Math.max(0, preparation.tokensBefore - tokensAfter);
|
|
99
|
-
const fileOps = {
|
|
100
|
-
read: [...preparation.fileOps.read].sort(),
|
|
101
|
-
written: [...preparation.fileOps.written].sort(),
|
|
102
|
-
edited: [...preparation.fileOps.edited].sort(),
|
|
54
|
+
const conversation = this.getConversation(conversationId);
|
|
55
|
+
const project = this.getProject(conversation.projectId);
|
|
56
|
+
const storage = options.activeConversation?.getStorage() ??
|
|
57
|
+
(await this.harnessStorage.openStorage(conversation, project.dir));
|
|
58
|
+
throwIfCompactionAborted(operation.controller.signal);
|
|
59
|
+
const branch = await storage.getPathToRoot(await storage.getLeafId());
|
|
60
|
+
const branchLeafId = branch.at(-1)?.id ?? null;
|
|
61
|
+
const summaryReserveTokens = options.summaryReserveTokens && options.summaryReserveTokens > 0
|
|
62
|
+
? options.summaryReserveTokens
|
|
63
|
+
: DEFAULT_COMPACTION_SETTINGS.reserveTokens;
|
|
64
|
+
const settings = {
|
|
65
|
+
...DEFAULT_COMPACTION_SETTINGS,
|
|
66
|
+
reserveTokens: summaryReserveTokens,
|
|
67
|
+
keepRecentTokens: request.keepRecentTokens ??
|
|
68
|
+
(options.keepRecentTokens && options.keepRecentTokens > 0
|
|
69
|
+
? options.keepRecentTokens
|
|
70
|
+
: DEFAULT_COMPACTION_SETTINGS.keepRecentTokens),
|
|
103
71
|
};
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
72
|
+
const prepared = prepareCompaction(branch, settings);
|
|
73
|
+
if (!prepared.ok) {
|
|
74
|
+
throw new HttpError(400, "COMPACTION_FAILED", prepared.error.message);
|
|
75
|
+
}
|
|
76
|
+
if (!prepared.value) {
|
|
77
|
+
throw new HttpError(409, "NOTHING_TO_COMPACT", "Nothing to compact.");
|
|
78
|
+
}
|
|
79
|
+
const preparation = prepared.value;
|
|
80
|
+
let firstKeptEntryId = preparation.firstKeptEntryId;
|
|
81
|
+
let messagesToSummarize = [
|
|
82
|
+
...preparation.messagesToSummarize,
|
|
83
|
+
...preparation.turnPrefixMessages,
|
|
84
|
+
];
|
|
85
|
+
if (messagesToSummarize.length === 0) {
|
|
86
|
+
const messageEntries = branch.filter((entry) => entry.type === "message");
|
|
87
|
+
const fallbackKept = messageEntries.at(-1);
|
|
88
|
+
messagesToSummarize = messageEntries
|
|
89
|
+
.slice(0, -1)
|
|
90
|
+
.map((entry) => entry.message);
|
|
91
|
+
if (fallbackKept)
|
|
92
|
+
firstKeptEntryId = fallbackKept.id;
|
|
93
|
+
}
|
|
94
|
+
if (messagesToSummarize.length === 0) {
|
|
95
|
+
throw new HttpError(409, "NOTHING_TO_COMPACT", "No prior messages to compact.");
|
|
96
|
+
}
|
|
97
|
+
const startedAt = new Date().toISOString();
|
|
98
|
+
let started = false;
|
|
99
|
+
try {
|
|
100
|
+
await this.events.publish("conversation.compaction.started", {
|
|
101
|
+
conversationId,
|
|
102
|
+
agentId: options.agentId,
|
|
103
|
+
runId: options.runId,
|
|
104
|
+
reason,
|
|
105
|
+
startedAt,
|
|
112
106
|
contextWindow: options.contextWindow,
|
|
107
|
+
contextTokens: options.contextTokens ?? preparation.tokensBefore,
|
|
113
108
|
thresholdTokens: options.thresholdTokens,
|
|
114
109
|
triggerReserveTokens: options.triggerReserveTokens,
|
|
115
110
|
keepRecentTokens: settings.keepRecentTokens,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
catch (error) {
|
|
167
|
-
if (started) {
|
|
168
|
-
await this.events
|
|
169
|
-
.publish("conversation.compaction.failed", {
|
|
111
|
+
failedEntryId: options.failedEntryId,
|
|
112
|
+
});
|
|
113
|
+
started = true;
|
|
114
|
+
const modelSummary = await this.summarizeWithFallback(conversationId, options.agentId, messagesToSummarize, preparation.previousSummary, request.instructions, summaryReserveTokens, operation.controller.signal);
|
|
115
|
+
throwIfCompactionAborted(operation.controller.signal);
|
|
116
|
+
const generatedBy = modelSummary?.generatedBy ?? "orchestrator-extractive";
|
|
117
|
+
const summary = modelSummary?.text ??
|
|
118
|
+
buildExtractiveSummary({
|
|
119
|
+
title: "Context checkpoint",
|
|
120
|
+
messages: messagesToSummarize,
|
|
121
|
+
previousSummary: preparation.previousSummary,
|
|
122
|
+
instructions: request.instructions,
|
|
123
|
+
maxChars: Math.max(1_000, Math.floor(summaryReserveTokens * 3.2)),
|
|
124
|
+
});
|
|
125
|
+
const tokensAfter = estimatePostCompactionTokens(branch, firstKeptEntryId, summary, preparation.tokensBefore);
|
|
126
|
+
if (reason !== "manual" && tokensAfter >= preparation.tokensBefore) {
|
|
127
|
+
throw new HttpError(409, "INEFFECTIVE_COMPACTION", "Compaction would not reduce context usage.");
|
|
128
|
+
}
|
|
129
|
+
const freedTokens = Math.max(0, preparation.tokensBefore - tokensAfter);
|
|
130
|
+
const fileOps = {
|
|
131
|
+
read: [...preparation.fileOps.read].sort(),
|
|
132
|
+
written: [...preparation.fileOps.written].sort(),
|
|
133
|
+
edited: [...preparation.fileOps.edited].sort(),
|
|
134
|
+
};
|
|
135
|
+
const details = {
|
|
136
|
+
generatedBy,
|
|
137
|
+
compactedMessages: messagesToSummarize.length,
|
|
138
|
+
splitTurn: preparation.isSplitTurn,
|
|
139
|
+
tokensAfter,
|
|
140
|
+
freedTokens,
|
|
141
|
+
reason,
|
|
142
|
+
policy: {
|
|
143
|
+
contextWindow: options.contextWindow,
|
|
144
|
+
thresholdTokens: options.thresholdTokens,
|
|
145
|
+
triggerReserveTokens: options.triggerReserveTokens,
|
|
146
|
+
keepRecentTokens: settings.keepRecentTokens,
|
|
147
|
+
summaryReserveTokens,
|
|
148
|
+
profile: options.profile,
|
|
149
|
+
thresholdPercent: options.thresholdPercent,
|
|
150
|
+
keepRecentPercent: options.keepRecentPercent,
|
|
151
|
+
safetyHeadroomTokens: options.safetyHeadroomTokens,
|
|
152
|
+
},
|
|
153
|
+
fileOps,
|
|
154
|
+
readFiles: fileOps.read,
|
|
155
|
+
modifiedFiles: Array.from(new Set([...fileOps.written, ...fileOps.edited])).sort(),
|
|
156
|
+
};
|
|
157
|
+
throwIfCompactionAborted(operation.controller.signal);
|
|
158
|
+
operation.committing = true;
|
|
159
|
+
const entry = await this.appendEntry({
|
|
170
160
|
conversationId,
|
|
171
161
|
agentId: options.agentId,
|
|
172
162
|
runId: options.runId,
|
|
163
|
+
parentEntryId: branchLeafId,
|
|
164
|
+
role: "system",
|
|
165
|
+
kind: "compaction",
|
|
166
|
+
text: summary,
|
|
167
|
+
summary,
|
|
168
|
+
tokensBefore: preparation.tokensBefore,
|
|
169
|
+
firstKeptEntryId,
|
|
170
|
+
details,
|
|
171
|
+
}, { mirrorToHarness: false });
|
|
172
|
+
await storage.appendEntry({
|
|
173
|
+
type: "compaction",
|
|
174
|
+
id: entry.id,
|
|
175
|
+
parentId: entry.parentEntryId ?? null,
|
|
176
|
+
timestamp: entry.createdAt,
|
|
177
|
+
summary,
|
|
178
|
+
firstKeptEntryId,
|
|
179
|
+
tokensBefore: preparation.tokensBefore,
|
|
180
|
+
details,
|
|
181
|
+
});
|
|
182
|
+
await this.rebuildConversations();
|
|
183
|
+
await this.events.publish("conversation.compacted", {
|
|
184
|
+
conversationId,
|
|
185
|
+
entry,
|
|
186
|
+
tokensBefore: preparation.tokensBefore,
|
|
187
|
+
firstKeptEntryId,
|
|
173
188
|
reason,
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
.
|
|
189
|
+
agentId: options.agentId,
|
|
190
|
+
runId: options.runId,
|
|
191
|
+
contextWindow: options.contextWindow,
|
|
192
|
+
thresholdTokens: options.thresholdTokens,
|
|
193
|
+
keepRecentTokens: settings.keepRecentTokens,
|
|
194
|
+
tokensAfter,
|
|
195
|
+
freedTokens,
|
|
196
|
+
});
|
|
197
|
+
return { conversation: this.getConversation(conversationId), entry };
|
|
179
198
|
}
|
|
180
|
-
|
|
199
|
+
catch (error) {
|
|
200
|
+
if (started) {
|
|
201
|
+
const cancelled = operation.controller.signal.aborted && !operation.committing;
|
|
202
|
+
await this.events
|
|
203
|
+
.publish(cancelled
|
|
204
|
+
? "conversation.compaction.cancelled"
|
|
205
|
+
: "conversation.compaction.failed", cancelled
|
|
206
|
+
? {
|
|
207
|
+
conversationId,
|
|
208
|
+
agentId: options.agentId,
|
|
209
|
+
runId: options.runId,
|
|
210
|
+
reason,
|
|
211
|
+
cancelledAt: new Date().toISOString(),
|
|
212
|
+
failedEntryId: options.failedEntryId,
|
|
213
|
+
}
|
|
214
|
+
: {
|
|
215
|
+
conversationId,
|
|
216
|
+
agentId: options.agentId,
|
|
217
|
+
runId: options.runId,
|
|
218
|
+
reason,
|
|
219
|
+
failedAt: new Date().toISOString(),
|
|
220
|
+
message: errorMessage(error),
|
|
221
|
+
failedEntryId: options.failedEntryId,
|
|
222
|
+
})
|
|
223
|
+
.catch(() => undefined);
|
|
224
|
+
}
|
|
225
|
+
throw error;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
finally {
|
|
229
|
+
options.signal?.removeEventListener("abort", abortFromOwner);
|
|
230
|
+
if (this.activeCompactions.get(conversationId) === operation) {
|
|
231
|
+
this.activeCompactions.delete(conversationId);
|
|
232
|
+
}
|
|
233
|
+
operation.complete();
|
|
181
234
|
}
|
|
182
235
|
}
|
|
183
|
-
async
|
|
236
|
+
async cancelCompaction(conversationId) {
|
|
237
|
+
const operation = this.activeCompactions.get(conversationId);
|
|
238
|
+
if (!operation || operation.committing)
|
|
239
|
+
return false;
|
|
240
|
+
operation.controller.abort(new Error("Compaction cancelled."));
|
|
241
|
+
await operation.completion;
|
|
242
|
+
return true;
|
|
243
|
+
}
|
|
244
|
+
async summarizeWithFallback(conversationId, agentId, messages, previousSummary, instructions, summaryReserveTokens, signal) {
|
|
184
245
|
if (!this.summarize)
|
|
185
246
|
return undefined;
|
|
186
247
|
try {
|
|
@@ -191,12 +252,16 @@ export class CompactionService {
|
|
|
191
252
|
previousSummary,
|
|
192
253
|
instructions,
|
|
193
254
|
summaryReserveTokens,
|
|
255
|
+
signal,
|
|
194
256
|
});
|
|
257
|
+
throwIfCompactionAborted(signal);
|
|
195
258
|
return summary?.text.trim()
|
|
196
259
|
? { text: summary.text.trim(), generatedBy: summary.generatedBy }
|
|
197
260
|
: undefined;
|
|
198
261
|
}
|
|
199
|
-
catch {
|
|
262
|
+
catch (error) {
|
|
263
|
+
if (signal.aborted)
|
|
264
|
+
throw error;
|
|
200
265
|
return undefined;
|
|
201
266
|
}
|
|
202
267
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compaction-service.js","sourceRoot":"","sources":["../../../../src/domains/conversations/operations/compaction-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,wBAAwB,
|
|
1
|
+
{"version":3,"file":"compaction-service.js","sourceRoot":"","sources":["../../../../src/domains/conversations/operations/compaction-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,wBAAwB,EAGxB,8BAA8B,EAC9B,2BAA2B,EAC3B,cAAc,EACd,iBAAi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OAAO,CAAC,EAC/C,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/node_modules/@nervekit/workbench-server/dist/domains/runs/run-transition.repository.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-transition.repository.d.ts","sourceRoot":"","sources":["../../../src/domains/runs/run-transition.repository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-transition.repository.d.ts","sourceRoot":"","sources":["../../../src/domains/runs/run-transition.repository.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAQL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAQhC,qBAAa,sBAAuB,YAAW,iBAAiB;IAS5D,OAAO,CAAC,QAAQ,CAAC,IAAI;IARvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoC;IAC1D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuB;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAGpB;gBAGgB,IAAI,EAAE,MAAM,EAC7B,YAAY,SAAK;IAKb,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAW1D,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAW/D,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAIlE,UAAU,IAAI,OAAO,CAAC,SAAS,gBAAgB,EAAE,CAAC;IAIlD,mBAAmB,CACvB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAIlC,2BAA2B,CAC/B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAIlC,cAAc,CAClB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAIlC,IAAI,IAAI,OAAO,CAAC,SAAS,gBAAgB,EAAE,CAAC;IAkB5C,MAAM,CACV,gBAAgB,EAAE,MAAM,EACxB,UAAU,EAAE,mBAAmB,GAC9B,OAAO,CAAC,gBAAgB,CAAC;IAoBtB,mBAAmB;eAEd,MAAM;kBACH,MAAM;gBACR,mBAAmB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC;;IAuB3C,kBAAkB,CAAC,QAAQ,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAYnE,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;YAc3C,OAAO;IAarB,OAAO,CAAC,IAAI;IAIZ,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,cAAc;YAIR,SAAS;CAiBxB"}
|
package/node_modules/@nervekit/workbench-server/dist/domains/runs/run-transition.repository.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises";
|
|
2
1
|
import { join } from "node:path";
|
|
3
2
|
import { runEventDeliveryRecordSchema, runTransitionRecordSchema, } from "@nervekit/contracts";
|
|
4
3
|
import { ACTIVE_STATUSES, ActiveRunLookup, applyRunEventDelivery, applyRunTransition, BoundedRunStateCache, reduceRunTransitions, RunRevisionConflictError, } from "@nervekit/host-runtime";
|
|
5
|
-
import { appendJsonLine, atomicWriteJson, listChildDirs, } from "../../infrastructure/storage/index.js";
|
|
4
|
+
import { appendJsonLine, atomicWriteJson, listChildDirs, readTextFileConsistent, } from "../../infrastructure/storage/index.js";
|
|
6
5
|
export class WorkbenchRunUnitOfWork {
|
|
7
6
|
home;
|
|
8
7
|
locks = new Map();
|
|
@@ -159,7 +158,7 @@ export class WorkbenchRunUnitOfWork {
|
|
|
159
158
|
async function strictJsonLines(path, schema) {
|
|
160
159
|
let raw;
|
|
161
160
|
try {
|
|
162
|
-
raw = await
|
|
161
|
+
raw = await readTextFileConsistent(path);
|
|
163
162
|
}
|
|
164
163
|
catch (error) {
|
|
165
164
|
if (isNotFound(error))
|
package/node_modules/@nervekit/workbench-server/dist/domains/runs/run-transition.repository.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-transition.repository.js","sourceRoot":"","sources":["../../../src/domains/runs/run-transition.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"run-transition.repository.js","sourceRoot":"","sources":["../../../src/domains/runs/run-transition.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKjC,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,GAGzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,cAAc,EACd,eAAe,EACf,aAAa,EACb,sBAAsB,GACvB,MAAM,uCAAuC,CAAC;AAE/C,MAAM,OAAO,sBAAsB;IASd;IARF,KAAK,GAAG,IAAI,GAAG,EAAyB,CAAC;IACzC,KAAK,CAAuB;IAC5B,MAAM,GAAG,IAAI,eAAe,CAAC;QAC5C,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;QACjC,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE;KAC9B,CAAC,CAAC;IAEH,YACmB,IAAY,EAC7B,YAAY,GAAG,EAAE;QADA,SAAI,GAAJ,IAAI,CAAQ;QAG7B,IAAI,CAAC,KAAK,GAAG,IAAI,oBAAoB,CAAC,YAAY,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAa;QACtB,M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AI,EAAE,KAAK,EAAE,EAAE;QACnB,IAAI,CAAC;YACH,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC,CAAC;QACnD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,IAAI,KAAK,GAAG,CAAC,EAAE,EAAE;gBAC1D,KAAK,EAAE,KAAK;aACb,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,UAAU,CAAC,KAAc;IAChC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,IAAI,KAAK;QACd,KAA4B,CAAC,IAAI,KAAK,QAAQ,CAChD,CAAC;AACJ,CAAC;AAED,SAAS,IAAI,CAAC,KAAa;IACzB,OAAO,KAAK,CAAC,OAAO,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;AAChD,CAAC"}
|
package/node_modules/@nervekit/workbench-server/dist/domains/tasks/workbench-task-adapters.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workbench-task-adapters.d.ts","sourceRoot":"","sources":["../../../src/domains/tasks/workbench-task-adapters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"workbench-task-adapters.d.ts","sourceRoot":"","sources":["../../../src/domains/tasks/workbench-task-adapters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIvD,OAAO,KAAK,EAGV,gBAAgB,EAChB,cAAc,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAoB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,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AC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACtC,aAAa,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC3C,UAAU,EAAE,cAAc,CAAC;IAC3B,IAAI,EAAE,cAAc,CAAC;IACrB,UAAU,EAAE,cAAc,CAAC;IAC3B,aAAa,EAAE,qBAAqB,CAAC;IACrC,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,aAAa,CAAC,EAAE,qBAAqB,CAAC;CACvC,CAAC;AAEF,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,iBAAiB,GAAG,SAAS,EACrC,OAAO,EAAE,2BAA2B,GACnC,sBAAsB,CA4SxB"}
|
package/node_modules/@nervekit/workbench-server/dist/domains/tasks/workbench-task-adapters.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { mkdir } from "node:fs/promises";
|
|
2
2
|
import { join, parse } from "node:path";
|
|
3
|
+
import { StringDecoder } from "node:string_decoder";
|
|
3
4
|
import { UnconfiguredTaskLaunchConfigStore, } from "./task-launch-config.store.js";
|
|
4
5
|
import { createTaskLogCursor, TaskLogService, } from "./task-log.service.js";
|
|
5
6
|
import { defaultTaskSupervisor, } from "./task-supervisor.js";
|
|
@@ -203,21 +204,39 @@ export function createWorkbenchTaskResources(storage, events, index, logger, opt
|
|
|
203
204
|
onOutput: input.onOutput,
|
|
204
205
|
};
|
|
205
206
|
managed.set(input.taskId, state);
|
|
206
|
-
const
|
|
207
|
+
const decoders = {
|
|
208
|
+
stdout: new StringDecoder("utf8"),
|
|
209
|
+
stderr: new StringDecoder("utf8"),
|
|
210
|
+
};
|
|
211
|
+
const queueDecodedOutput = (stream, text, source) => {
|
|
212
|
+
if (!text)
|
|
213
|
+
return;
|
|
214
|
+
const canPause = typeof source?.pause === "function";
|
|
215
|
+
if (canPause)
|
|
216
|
+
source.pause();
|
|
207
217
|
state.outputPending = (state.outputPending ?? Promise.resolve())
|
|
208
218
|
.catch(() => undefined)
|
|
209
219
|
.then(async () => {
|
|
210
|
-
|
|
220
|
+
try {
|
|
221
|
+
await callbacks.onOutput?.(stream, text);
|
|
222
|
+
}
|
|
223
|
+
finally {
|
|
224
|
+
if (canPause && typeof source?.resume === "function") {
|
|
225
|
+
source.resume();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
211
228
|
});
|
|
212
229
|
};
|
|
213
|
-
child.stdout?.on("data", (chunk) =>
|
|
214
|
-
child.stderr?.on("data", (chunk) =>
|
|
230
|
+
child.stdout?.on("data", (chunk) => queueDecodedOutput("stdout", decoders.stdout.write(chunk), child.stdout ?? undefined));
|
|
231
|
+
child.stderr?.on("data", (chunk) => queueDecodedOutput("stderr", decoders.stderr.write(chunk), child.stderr ?? undefined));
|
|
215
232
|
let settled = false;
|
|
216
233
|
const finish = async (exit) => {
|
|
217
234
|
if (settled)
|
|
218
235
|
return;
|
|
219
236
|
settled = true;
|
|
220
237
|
state.finalized = true;
|
|
238
|
+
queueDecodedOutput("stdout", decoders.stdout.end());
|
|
239
|
+
queueDecodedOutput("stderr", decoders.stderr.end());
|
|
221
240
|
await state.outputPending?.catch(() => undefined);
|
|
222
241
|
const current = tasks.get(input.taskId);
|
|
223
242
|
if (current)
|