@nervekit/desktop 0.11.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 +166 -135
- package/dist/app/run-runtime-recovery.d.ts +1 -0
- package/dist/app/run-runtime-recovery.d.ts.map +1 -1
- package/dist/app/run-runtime-recovery.js +23 -1
- package/dist/app/run-runtime-recovery.js.map +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/agents/agent.operations.schema.d.ts +1 -1
- 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.events.schema.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation-runtime.events.schema.js +5 -1
- package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation-runtime.events.schema.js.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 +24 -5
- package/node_modules/@nervekit/contracts/dist/domains/protocol/operation-catalog.schema.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/settings/settings.operations.schema.d.ts +12 -3
- package/node_modules/@nervekit/contracts/dist/domains/settings/settings.operations.schema.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/settings/settings.schema.d.ts +8 -2
- package/node_modules/@nervekit/contracts/dist/domains/settings/settings.schema.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/settings/settings.schema.js +13 -2
- package/node_modules/@nervekit/contracts/dist/domains/settings/settings.schema.js.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/skills/skill.operations.schema.d.ts +5 -0
- package/node_modules/@nervekit/contracts/dist/domains/skills/skill.operations.schema.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/skills/skill.schema.d.ts +5 -0
- package/node_modules/@nervekit/contracts/dist/domains/skills/skill.schema.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/skills/skill.schema.js +1 -0
- package/node_modules/@nervekit/contracts/dist/domains/skills/skill.schema.js.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/status/status.schema.d.ts +0 -2
- package/node_modules/@nervekit/contracts/dist/domains/status/status.schema.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/status/status.schema.js +1 -8
- package/node_modules/@nervekit/contracts/dist/domains/status/status.schema.js.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/tools/records.schema.d.ts +5 -5
- package/node_modules/@nervekit/contracts/dist/domains/tools/records.schema.js +2 -2
- package/node_modules/@nervekit/contracts/dist/domains/tools/records.schema.js.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/tools/tool.operations.schema.d.ts +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/run-unit-of-work.d.ts.map +1 -1
- package/node_modules/@nervekit/host-runtime/dist/run-unit-of-work.js +18 -1
- package/node_modules/@nervekit/host-runtime/dist/run-unit-of-work.js.map +1 -1
- 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/catalog/core/python.tools.d.ts +1 -1
- package/node_modules/@nervekit/tools/dist/catalog/core/python.tools.js +6 -6
- package/node_modules/@nervekit/tools/dist/catalog/core/python.tools.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/catalog/core/shell.tools.d.ts +1 -0
- package/node_modules/@nervekit/tools/dist/catalog/core/shell.tools.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/catalog/core/shell.tools.js +3 -0
- package/node_modules/@nervekit/tools/dist/catalog/core/shell.tools.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/common/command-cwd.d.ts +2 -0
- package/node_modules/@nervekit/tools/dist/execution/common/command-cwd.d.ts.map +1 -0
- package/node_modules/@nervekit/tools/dist/execution/common/command-cwd.js +23 -0
- package/node_modules/@nervekit/tools/dist/execution/common/command-cwd.js.map +1 -0
- 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/common/process-result.js +1 -1
- package/node_modules/@nervekit/tools/dist/execution/common/process-result.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/common/process-tree.d.ts +8 -2
- package/node_modules/@nervekit/tools/dist/execution/common/process-tree.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/common/process-tree.js +63 -14
- package/node_modules/@nervekit/tools/dist/execution/common/process-tree.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/filesystem/find.js +3 -2
- package/node_modules/@nervekit/tools/dist/execution/filesystem/find.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/index.d.ts +3 -1
- package/node_modules/@nervekit/tools/dist/execution/index.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/index.js +3 -1
- package/node_modules/@nervekit/tools/dist/execution/index.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/python/python.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/python/python.js +35 -29
- package/node_modules/@nervekit/tools/dist/execution/python/python.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/python/runtime.d.ts +1 -1
- package/node_modules/@nervekit/tools/dist/execution/python/runtime.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/python/runtime.js +6 -29
- package/node_modules/@nervekit/tools/dist/execution/python/runtime.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 +30 -24
- 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/git/git-branches.d.ts +7 -0
- package/node_modules/@nervekit/tools/dist/git/git-branches.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/git/git-branches.js +51 -52
- package/node_modules/@nervekit/tools/dist/git/git-branches.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/git/git-command.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/git/git-command.js +1 -0
- package/node_modules/@nervekit/tools/dist/git/git-command.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/git/git-github-service.d.ts +1 -0
- package/node_modules/@nervekit/tools/dist/git/git-github-service.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/git/git-github-service.js +1 -0
- package/node_modules/@nervekit/tools/dist/git/git-github-service.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/git/git-observability.d.ts +21 -0
- package/node_modules/@nervekit/tools/dist/git/git-observability.d.ts.map +1 -0
- package/node_modules/@nervekit/tools/dist/git/git-observability.js +2 -0
- package/node_modules/@nervekit/tools/dist/git/git-observability.js.map +1 -0
- package/node_modules/@nervekit/tools/dist/git/git-overview.d.ts +6 -0
- package/node_modules/@nervekit/tools/dist/git/git-overview.d.ts.map +1 -0
- package/node_modules/@nervekit/tools/dist/git/git-overview.js +94 -0
- package/node_modules/@nervekit/tools/dist/git/git-overview.js.map +1 -0
- package/node_modules/@nervekit/tools/dist/git/git-repository-metadata.d.ts +21 -0
- package/node_modules/@nervekit/tools/dist/git/git-repository-metadata.d.ts.map +1 -0
- package/node_modules/@nervekit/tools/dist/git/git-repository-metadata.js +59 -0
- package/node_modules/@nervekit/tools/dist/git/git-repository-metadata.js.map +1 -0
- package/node_modules/@nervekit/tools/dist/git/git-service.d.ts +14 -5
- package/node_modules/@nervekit/tools/dist/git/git-service.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/git/git-service.js +97 -109
- package/node_modules/@nervekit/tools/dist/git/git-service.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/index.d.ts +2 -1
- package/node_modules/@nervekit/tools/dist/index.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/index.js +2 -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 +2 -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 +2 -0
- 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 +39 -2
- package/node_modules/@nervekit/workbench-server/dist/app/orchestrator-state.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/agent-lifecycle.service.d.ts +1 -0
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/agent-lifecycle.service.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/agent-lifecycle.service.js +37 -5
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/agent-lifecycle.service.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/prompting/agent-browser-skills.d.ts +16 -0
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/prompting/agent-browser-skills.d.ts.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/prompting/agent-browser-skills.js +137 -0
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/prompting/agent-browser-skills.js.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/prompting/resource-loader.d.ts +3 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/prompting/resource-loader.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/prompting/resource-loader.js +11 -4
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/prompting/resource-loader.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/subagent-runner.d.ts +3 -3
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/subagent-runner.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/subagent-runner.js +2 -5
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/subagent-runner.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/system-prompt-builder.d.ts +3 -0
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/system-prompt-builder.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/system-prompt-builder.js +2 -0
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/system-prompt-builder.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/workbench-agent-mechanics.d.ts +5 -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 +8 -3
- 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 +5 -2
- 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 +1 -0
- 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 +12 -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/runs/workbench-run.service.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/runs/workbench-run.service.js +5 -2
- package/node_modules/@nervekit/workbench-server/dist/domains/runs/workbench-run.service.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tasks/task-supervisor.js +4 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tasks/task-supervisor.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tasks/workbench-task-adapters.d.ts +4 -0
- 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 +28 -7
- 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 +7 -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/tasks/workbench-task-service.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/agent-tool-adapter.js +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/agent-tool-adapter.js.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 +29 -15
- 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/policy.js +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/policy.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-call-transcript-preview.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-call-transcript-preview.js +2 -1
- package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-call-transcript-preview.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 +2 -1
- 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/log-migration.js +3 -3
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/events/log-migration.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/events/stream-log-registry.d.ts +12 -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 +74 -19
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/events/stream-log-registry.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/events/stream-log.d.ts +9 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/events/stream-log.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/events/stream-log.js +85 -62
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/events/stream-log.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/file-mutations.d.ts +20 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/file-mutations.d.ts.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/file-mutations.js +99 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/file-mutations.js.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/index.d.ts +1 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/index.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/index.js +1 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/index.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/initialize.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/initialize.js +43 -2
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/initialize.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 +84 -90
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/json.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/legacy-home-migration.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/legacy-home-migration.js +4 -3
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/legacy-home-migration.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/main.js +32 -14
- package/node_modules/@nervekit/workbench-server/dist/main.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/protocol/file-idempotency-store.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/protocol/file-idempotency-store.js +3 -2
- package/node_modules/@nervekit/workbench-server/dist/protocol/file-idempotency-store.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 -565
- package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/routes/agent-routes.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/routes/agent-routes.js +2 -0
- package/node_modules/@nervekit/workbench-server/dist/routes/agent-routes.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-composition.d.ts +2 -0
- package/node_modules/@nervekit/workbench-server/dist/runtime/runtime-composition.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/runtime/runtime-composition.js +24 -1
- package/node_modules/@nervekit/workbench-server/dist/runtime/runtime-composition.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/runtime/runtime-registry.d.ts +15 -2
- 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 +74 -19
- package/node_modules/@nervekit/workbench-server/dist/runtime/runtime-registry.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-CzAenP9m.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-uoIbQOdM.js +261 -0
- 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-5CMVpr1y.js +0 -260
- package/node_modules/@nervekit/workbench-server/dist/web/assets/index-CtD2pS6K.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
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { parsePorcelainV2, parseShortstat } from "./git-status.js";
|
|
2
|
+
export async function summarizeRepo(service, repoDir, relativePath, name, statusOutput) {
|
|
3
|
+
const [stdout, stable] = await Promise.all([
|
|
4
|
+
statusOutput === undefined
|
|
5
|
+
? service
|
|
6
|
+
.runGit(repoDir, ["status", "--porcelain=v2", "--branch"])
|
|
7
|
+
.then((result) => result.stdout)
|
|
8
|
+
: Promise.resolve(statusOutput),
|
|
9
|
+
service.stableRepoMetadata(repoDir),
|
|
10
|
+
]);
|
|
11
|
+
const { branch, files } = parsePorcelainV2(stdout);
|
|
12
|
+
const onBaseBranch = branch.head === stable.baseBranch;
|
|
13
|
+
return {
|
|
14
|
+
relativePath,
|
|
15
|
+
absDir: repoDir,
|
|
16
|
+
name,
|
|
17
|
+
isRepo: true,
|
|
18
|
+
currentBranch: branch.head,
|
|
19
|
+
detached: branch.detached,
|
|
20
|
+
ahead: branch.upstream ? (branch.ahead ?? 0) : null,
|
|
21
|
+
behind: branch.upstream ? (branch.behind ?? 0) : null,
|
|
22
|
+
hasUpstream: branch.upstream !== null,
|
|
23
|
+
hasRemote: stable.remoteState.hasRemote,
|
|
24
|
+
hasGithubRemote: stable.remoteState.hasGithubRemote,
|
|
25
|
+
baseBranch: stable.baseBranch,
|
|
26
|
+
onBaseBranch,
|
|
27
|
+
mergedToBase: await service.mergedToBaseRef(repoDir, stable.comparisonBaseRef, {
|
|
28
|
+
currentBranch: branch.head,
|
|
29
|
+
detached: branch.detached,
|
|
30
|
+
onBaseBranch,
|
|
31
|
+
}),
|
|
32
|
+
dirty: files.length > 0,
|
|
33
|
+
changeCount: files.length,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export async function overview(service, projectId, relativePath) {
|
|
37
|
+
const repoDir = service.resolveRepoDir(projectId, relativePath);
|
|
38
|
+
const statusPromise = service.runGit(repoDir, [
|
|
39
|
+
"status",
|
|
40
|
+
"--porcelain=v2",
|
|
41
|
+
"--branch",
|
|
42
|
+
]);
|
|
43
|
+
const repoPromise = statusPromise.then(({ stdout }) => service.summarizeRepo(repoDir, relativePath, service.repoName(projectId, relativePath), stdout));
|
|
44
|
+
const [repo, { stdout: statusOut }, unstagedResult, stagedResult, recent] = await Promise.all([
|
|
45
|
+
repoPromise,
|
|
46
|
+
statusPromise,
|
|
47
|
+
service.runGit(repoDir, ["diff", "--shortstat"]),
|
|
48
|
+
service.runGit(repoDir, ["diff", "--staged", "--shortstat"]),
|
|
49
|
+
service.recentCommits(repoDir),
|
|
50
|
+
]);
|
|
51
|
+
const { files } = parsePorcelainV2(statusOut);
|
|
52
|
+
const stagedCount = files.filter((file) => file.staged).length;
|
|
53
|
+
const untrackedCount = files.filter((file) => file.untracked).length;
|
|
54
|
+
const unstagedCount = files.filter((file) => !file.untracked && file.worktree !== " ").length;
|
|
55
|
+
const unstaged = parseShortstat(unstagedResult.stdout);
|
|
56
|
+
const staged = parseShortstat(stagedResult.stdout);
|
|
57
|
+
return {
|
|
58
|
+
repo,
|
|
59
|
+
baseBranch: repo.baseBranch,
|
|
60
|
+
onBaseBranch: repo.onBaseBranch,
|
|
61
|
+
files,
|
|
62
|
+
stagedCount,
|
|
63
|
+
unstagedCount,
|
|
64
|
+
untrackedCount,
|
|
65
|
+
insertions: unstaged.insertions + staged.insertions,
|
|
66
|
+
deletions: unstaged.deletions + staged.deletions,
|
|
67
|
+
recentCommits: recent,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export async function recentCommits(service, repoDir) {
|
|
71
|
+
try {
|
|
72
|
+
const { stdout } = await service.runGit(repoDir, [
|
|
73
|
+
"log",
|
|
74
|
+
"-n",
|
|
75
|
+
"10",
|
|
76
|
+
"--pretty=%h%x00%s%x00%cr",
|
|
77
|
+
]);
|
|
78
|
+
return stdout
|
|
79
|
+
.split("\n")
|
|
80
|
+
.filter((line) => line.length > 0)
|
|
81
|
+
.map((line) => {
|
|
82
|
+
const [hash, subject, relativeDate] = line.split("\u0000");
|
|
83
|
+
return {
|
|
84
|
+
hash: hash ?? "",
|
|
85
|
+
subject: subject ?? "",
|
|
86
|
+
relativeDate: relativeDate ?? "",
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return [];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=git-overview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-overview.js","sourceRoot":"","sources":["../../src/git/git-overview.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEnE,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAAmB,EACnB,OAAe,EACf,YAAoB,EACpB,IAAY,EACZ,YAAqB;IAErB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACzC,YAAY,KAAK,SAAS;YACxB,CAAC,CAAC,OAAO;iBACJ,MAAM,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,gBAAgB,EAAE,UAAU,CAAC,CAAC;iBACzD,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;YACpC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC;QACjC,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC;KACpC,CAAC,CAAC;IACH,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACnD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,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,KAAK;QACL,WAAW;QACX,aAAa;QACb,cAAc;QACd,UAAU,EAAE,QAAQ,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU;QACnD,SAAS,EAAE,QAAQ,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS;QAChD,aAAa,EAAE,MAAM;KACtB,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAAmB,EACnB,OAAe;IAEf,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE;YAC/C,KAAK;YACL,IAAI;YACJ,IAAI;YACJ,0BAA0B;SAC3B,CAAC,CAAC;QACH,OAAO,MAAM;aACV,KAAK,CAAC,IAAI,CAAC;aACX,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;aACjC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACZ,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC3D,OAAO;gBACL,IAAI,EAAE,IAAI,IAAI,EAAE;gBAChB,OAAO,EAAE,OAAO,IAAI,EAAE;gBACtB,YAAY,EAAE,YAAY,IAAI,EAAE;aACjC,CAAC;QACJ,CAAC,CAAC,CAAC;IACP,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type GitRefSnapshot } from "./git-branches.js";
|
|
2
|
+
import type { GitService } from "./git-service.js";
|
|
3
|
+
export type StableRepoMetadata = {
|
|
4
|
+
readonly refSnapshot: GitRefSnapshot;
|
|
5
|
+
readonly baseBranch: string;
|
|
6
|
+
readonly comparisonBaseRef: string;
|
|
7
|
+
readonly remoteState: {
|
|
8
|
+
hasRemote: boolean;
|
|
9
|
+
hasGithubRemote: boolean;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare class GitRepositoryMetadataCache {
|
|
13
|
+
#private;
|
|
14
|
+
private readonly service;
|
|
15
|
+
private readonly ttlMs;
|
|
16
|
+
private readonly now;
|
|
17
|
+
constructor(service: GitService, ttlMs: number, now: () => number);
|
|
18
|
+
get(repoDir: string): Promise<StableRepoMetadata>;
|
|
19
|
+
invalidate(repoDir?: string): void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=git-repository-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-repository-metadata.d.ts","sourceRoot":"","sources":["../../src/git/git-repository-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,eAAe,EAAE,OAAO,CAAA;KAAE,CAAC;CACxE,CAAC;AAOF,qBAAa,0BAA0B;;IAInC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAFH,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,MAAM;IAGpC,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAcjD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;CA8BnC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { baseBranchFromRefSnapshot, comparisonBaseRefFromSnapshot, readRefSnapshot, } from "./git-branches.js";
|
|
2
|
+
export class GitRepositoryMetadataCache {
|
|
3
|
+
service;
|
|
4
|
+
ttlMs;
|
|
5
|
+
now;
|
|
6
|
+
#entries = new Map();
|
|
7
|
+
constructor(service, ttlMs, now) {
|
|
8
|
+
this.service = service;
|
|
9
|
+
this.ttlMs = ttlMs;
|
|
10
|
+
this.now = now;
|
|
11
|
+
}
|
|
12
|
+
get(repoDir) {
|
|
13
|
+
const now = this.now();
|
|
14
|
+
const cached = this.#entries.get(repoDir);
|
|
15
|
+
if (cached && cached.expiresAt > now)
|
|
16
|
+
return cached.value;
|
|
17
|
+
const value = this.#load(repoDir);
|
|
18
|
+
const entry = { expiresAt: now + this.ttlMs, value };
|
|
19
|
+
this.#entries.set(repoDir, entry);
|
|
20
|
+
void value.catch(() => {
|
|
21
|
+
if (this.#entries.get(repoDir) === entry)
|
|
22
|
+
this.#entries.delete(repoDir);
|
|
23
|
+
});
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
invalidate(repoDir) {
|
|
27
|
+
if (repoDir)
|
|
28
|
+
this.#entries.delete(repoDir);
|
|
29
|
+
else
|
|
30
|
+
this.#entries.clear();
|
|
31
|
+
}
|
|
32
|
+
async #load(repoDir) {
|
|
33
|
+
const [refSnapshot, remoteState] = await Promise.all([
|
|
34
|
+
readRefSnapshot.call(this.service, repoDir),
|
|
35
|
+
this.service.repoRemoteState(repoDir),
|
|
36
|
+
]);
|
|
37
|
+
let baseBranch = baseBranchFromRefSnapshot(refSnapshot);
|
|
38
|
+
if (!baseBranch) {
|
|
39
|
+
try {
|
|
40
|
+
const { stdout } = await this.service.runGit(repoDir, [
|
|
41
|
+
"rev-parse",
|
|
42
|
+
"--abbrev-ref",
|
|
43
|
+
"HEAD",
|
|
44
|
+
]);
|
|
45
|
+
baseBranch = stdout.trim() || "main";
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
baseBranch = "main";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
refSnapshot,
|
|
53
|
+
baseBranch,
|
|
54
|
+
comparisonBaseRef: comparisonBaseRefFromSnapshot(refSnapshot, baseBranch),
|
|
55
|
+
remoteState,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=git-repository-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-repository-metadata.js","sourceRoot":"","sources":["../../src/git/git-repository-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,eAAe,GAEhB,MAAM,mBAAmB,CAAC;AAe3B,MAAM,OAAO,0BAA0B;IAIlB;IACA;IACA;IALV,QAAQ,GAAG,IAAI,GAAG,EAAsB,CAAC;IAElD,YACmB,OAAmB,EACnB,KAAa,EACb,GAAiB;QAFjB,YAAO,GAAP,OAAO,CAAY;QACnB,UAAK,GAAL,KAAK,CAAQ;QACb,QAAG,GAAH,GAAG,CAAc;IACjC,CAAC;IAEJ,GAAG,CAAC,OAAe;QACjB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,MAAM,IAAI,MAAM,CAAC,SAAS,GAAG,GAAG;YAAE,OAAO,MAAM,CAAC,KAAK,CAAC;QAE1D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClC,MAAM,KAAK,GAAG,EAAE,SAAS,EAAE,GAAG,GAAG,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC;QACrD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OA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1,15 +1,17 @@
|
|
|
1
1
|
import type { GitBranchListResponse, GitDiscoveryResponse, GithubPrCheckoutResponse, GithubPrDetail, GithubPrListFilters, GithubPrListResponse, GithubStatusResponse, GitMutationResponse, GitOverviewResponse, GitRecentCommit, GitRepoSummary } from "@nervekit/contracts";
|
|
2
2
|
import { type ExecResult } from "./git-command.js";
|
|
3
3
|
import { type GithubServiceContext } from "./git-github-service.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
name: string;
|
|
7
|
-
};
|
|
4
|
+
import type { GitServiceOptions, GitWorkspaceRef } from "./git-observability.js";
|
|
5
|
+
import { type StableRepoMetadata } from "./git-repository-metadata.js";
|
|
8
6
|
export declare class GitService {
|
|
7
|
+
#private;
|
|
9
8
|
readonly getProject: (projectId: string) => GitWorkspaceRef;
|
|
10
|
-
|
|
9
|
+
readonly options: GitServiceOptions;
|
|
10
|
+
constructor(getProject: (projectId: string) => GitWorkspaceRef, options?: GitServiceOptions);
|
|
11
11
|
static forWorkspace(rootDir: string, name?: string): GitService;
|
|
12
12
|
run(bin: "git" | "gh", cwd: string, args: string[]): Promise<ExecResult>;
|
|
13
|
+
private observeCommand;
|
|
14
|
+
private observeOverview;
|
|
13
15
|
runGit(cwd: string, args: string[]): Promise<ExecResult>;
|
|
14
16
|
runGh(cwd: string, args: string[]): Promise<ExecResult>;
|
|
15
17
|
/** Resolve and contain a repo dir relative to the project dir. */
|
|
@@ -20,6 +22,8 @@ export declare class GitService {
|
|
|
20
22
|
hasGithubRemote: boolean;
|
|
21
23
|
}>;
|
|
22
24
|
ensureGithubRemote(repoDir: string): Promise<void>;
|
|
25
|
+
stableRepoMetadata(repoDir: string): Promise<StableRepoMetadata>;
|
|
26
|
+
invalidateStableRepoMetadata(repoDir?: string): void;
|
|
23
27
|
discoverRepos(projectId: string): Promise<GitDiscoveryResponse>;
|
|
24
28
|
walkForRepos(root: string, dir: string, depth: number): Promise<string[]>;
|
|
25
29
|
summarizeRepo(repoDir: string, relativePath: string, name: string, statusOutput?: string): Promise<GitRepoSummary>;
|
|
@@ -35,6 +39,11 @@ export declare class GitService {
|
|
|
35
39
|
detached: boolean;
|
|
36
40
|
onBaseBranch: boolean;
|
|
37
41
|
}): Promise<boolean>;
|
|
42
|
+
mergedToBaseRef(repoDir: string, baseRef: string, state: {
|
|
43
|
+
currentBranch: string | null;
|
|
44
|
+
detached: boolean;
|
|
45
|
+
onBaseBranch: boolean;
|
|
46
|
+
}): Promise<boolean>;
|
|
38
47
|
createBranch(projectId: string, relativePath: string, name: string): Promise<GitMutationResponse>;
|
|
39
48
|
switchBranch(projectId: string, relativePath: string, name: string): Promise<GitMutationResponse>;
|
|
40
49
|
stageFile(projectId: string, relativePath: string, path: string): Promise<GitMutationResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-service.d.ts","sourceRoot":"","sources":["../../src/git/git-service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACf,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAEL,KAAK,oBAAoB,EAI1B,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"git-service.d.ts","sourceRoot":"","sources":["../../src/git/git-service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACf,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAEL,KAA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AAM,GACnB,OAAO,CAAC,mBAAmB,CAAC;IAazB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAc9C,YAAY,CAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,oBAAoB,CAAC;IAI1B,WAAW,CACf,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,oBAAoB,CAAC;IAS1B,QAAQ,CACZ,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,cAAc,CAAC;IASpB,UAAU,CACd,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,wBAAwB,CAAC;IASpC,aAAa,IAAI,oBAAoB;IAqB/B,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAW3C,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAWjD;AAED,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,0BAA0B,GAC3B,MAAM,yBAAyB,CAAC"}
|
|
@@ -6,20 +6,60 @@ import { GitCommandError, runGitCommand, } from "./git-command.js";
|
|
|
6
6
|
import { GitWorkflowError } from "./git-errors.js";
|
|
7
7
|
import { isGithubRemoteUrl, parseGitRemoteUrls } from "./git-github-parsers.js";
|
|
8
8
|
import { checkoutPr as checkoutGithubPr, prDetail as getGithubPrDetail, githubStatus as getGithubStatus, listOpenPrs as listGithubOpenPrs, } from "./git-github-service.js";
|
|
9
|
-
import {
|
|
9
|
+
import { overview as getOverview, recentCommits as getRecentCommits, summarizeRepo as getRepoSummary, } from "./git-overview.js";
|
|
10
|
+
import { GitRepositoryMetadataCache, } from "./git-repository-metadata.js";
|
|
11
|
+
import { parsePorcelainV2 } from "./git-status.js";
|
|
10
12
|
const MAX_DISCOVERY_DEPTH = 2;
|
|
11
13
|
const SKIP_DIRS = new Set(["node_modules", ".git", "dist", "build", ".next"]);
|
|
12
14
|
export class GitService {
|
|
13
15
|
getProject;
|
|
14
|
-
|
|
16
|
+
options;
|
|
17
|
+
#stableMetadataCache;
|
|
18
|
+
constructor(getProject, options = {}) {
|
|
15
19
|
this.getProject = getProject;
|
|
20
|
+
this.options = options;
|
|
21
|
+
this.#stableMetadataCache = new GitRepositoryMetadataCache(this, options.stableMetadataTtlMs ?? 30_000, options.now ?? Date.now);
|
|
16
22
|
}
|
|
17
23
|
static forWorkspace(rootDir, name = basename(rootDir)) {
|
|
18
24
|
return new GitService(() => ({ dir: rootDir, name }));
|
|
19
25
|
}
|
|
20
|
-
// --- low-level exec ---
|
|
21
26
|
async run(bin, cwd, args) {
|
|
22
|
-
|
|
27
|
+
const startedAt = performance.now();
|
|
28
|
+
try {
|
|
29
|
+
const result = await runGitCommand(bin, cwd, args);
|
|
30
|
+
this.observeCommand({
|
|
31
|
+
bin,
|
|
32
|
+
command: args[0] ?? "unknown",
|
|
33
|
+
durationMs: performance.now() - startedAt,
|
|
34
|
+
succeeded: true,
|
|
35
|
+
});
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
this.observeCommand({
|
|
40
|
+
bin,
|
|
41
|
+
command: args[0] ?? "unknown",
|
|
42
|
+
durationMs: performance.now() - startedAt,
|
|
43
|
+
succeeded: false,
|
|
44
|
+
});
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
observeCommand(observation) {
|
|
49
|
+
try {
|
|
50
|
+
this.options.onCommandCompleted?.(observation);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
// Diagnostics must never affect Git operations.
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
observeOverview(observation) {
|
|
57
|
+
try {
|
|
58
|
+
this.options.onOverviewCompleted?.(observation);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// Diagnostics must never affect Git operations.
|
|
62
|
+
}
|
|
23
63
|
}
|
|
24
64
|
runGit(cwd, args) {
|
|
25
65
|
return this.run("git", cwd, args);
|
|
@@ -66,7 +106,7 @@ export class GitService {
|
|
|
66
106
|
}
|
|
67
107
|
}
|
|
68
108
|
async ensureGithubRemote(repoDir) {
|
|
69
|
-
const remoteState = await this.
|
|
109
|
+
const remoteState = (await this.stableRepoMetadata(repoDir)).remoteState;
|
|
70
110
|
if (!remoteState.hasRemote) {
|
|
71
111
|
throw new GitWorkflowError(409, "GH_NO_REMOTE", "This repository does not have a remote configured.");
|
|
72
112
|
}
|
|
@@ -74,7 +114,12 @@ export class GitService {
|
|
|
74
114
|
throw new GitWorkflowError(409, "GH_NO_GITHUB_REMOTE", "This repository does not have a GitHub remote configured.");
|
|
75
115
|
}
|
|
76
116
|
}
|
|
77
|
-
|
|
117
|
+
stableRepoMetadata(repoDir) {
|
|
118
|
+
return this.#stableMetadataCache.get(repoDir);
|
|
119
|
+
}
|
|
120
|
+
invalidateStableRepoMetadata(repoDir) {
|
|
121
|
+
this.#stableMetadataCache.invalidate(repoDir);
|
|
122
|
+
}
|
|
78
123
|
async discoverRepos(projectId) {
|
|
79
124
|
const project = this.getProject(projectId);
|
|
80
125
|
const root = resolve(project.dir);
|
|
@@ -131,102 +176,31 @@ export class GitService {
|
|
|
131
176
|
}
|
|
132
177
|
return found;
|
|
133
178
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
statusOutput === undefined
|
|
137
|
-
? this.runGit(repoDir, ["status", "--porcelain=v2", "--branch"]).then((result) => result.stdout)
|
|
138
|
-
: Promise.resolve(statusOutput),
|
|
139
|
-
this.detectBaseBranch(repoDir),
|
|
140
|
-
this.repoRemoteState(repoDir),
|
|
141
|
-
]);
|
|
142
|
-
const { branch, files } = parsePorcelainV2(stdout);
|
|
143
|
-
const onBaseBranch = branch.head === baseBranch;
|
|
144
|
-
return {
|
|
145
|
-
relativePath,
|
|
146
|
-
absDir: repoDir,
|
|
147
|
-
name,
|
|
148
|
-
isRepo: true,
|
|
149
|
-
currentBranch: branch.head,
|
|
150
|
-
detached: branch.detached,
|
|
151
|
-
ahead: branch.upstream ? (branch.ahead ?? 0) : null,
|
|
152
|
-
behind: branch.upstream ? (branch.behind ?? 0) : null,
|
|
153
|
-
hasUpstream: branch.upstream !== null,
|
|
154
|
-
hasRemote: remoteState.hasRemote,
|
|
155
|
-
hasGithubRemote: remoteState.hasGithubRemote,
|
|
156
|
-
baseBranch,
|
|
157
|
-
onBaseBranch,
|
|
158
|
-
mergedToBase: await this.mergedToBase(repoDir, baseBranch, {
|
|
159
|
-
currentBranch: branch.head,
|
|
160
|
-
detached: branch.detached,
|
|
161
|
-
onBaseBranch,
|
|
162
|
-
}),
|
|
163
|
-
dirty: files.length > 0,
|
|
164
|
-
changeCount: files.length,
|
|
165
|
-
};
|
|
179
|
+
summarizeRepo(repoDir, relativePath, name, statusOutput) {
|
|
180
|
+
return getRepoSummary(this, repoDir, relativePath, name, statusOutput);
|
|
166
181
|
}
|
|
167
182
|
repoName(projectId, relativePath) {
|
|
168
183
|
if (relativePath === ".")
|
|
169
184
|
return this.getProject(projectId).name;
|
|
170
185
|
return basename(relativePath);
|
|
171
186
|
}
|
|
172
|
-
// --- overview ---
|
|
173
187
|
async overview(projectId, relativePath) {
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
"status",
|
|
177
|
-
"--porcelain=v2",
|
|
178
|
-
"--branch",
|
|
179
|
-
]);
|
|
180
|
-
const repoPromise = statusPromise.then(({ stdout }) => this.summarizeRepo(repoDir, relativePath, this.repoName(projectId, relativePath), stdout));
|
|
181
|
-
const [repo, { stdout: statusOut }, unstagedResult, stagedResult, recent] = await Promise.all([
|
|
182
|
-
repoPromise,
|
|
183
|
-
statusPromise,
|
|
184
|
-
this.runGit(repoDir, ["diff", "--shortstat"]),
|
|
185
|
-
this.runGit(repoDir, ["diff", "--staged", "--shortstat"]),
|
|
186
|
-
this.recentCommits(repoDir),
|
|
187
|
-
]);
|
|
188
|
-
const { files } = parsePorcelainV2(statusOut);
|
|
189
|
-
const stagedCount = files.filter((f) => f.staged).length;
|
|
190
|
-
const untrackedCount = files.filter((f) => f.untracked).length;
|
|
191
|
-
const unstagedCount = files.filter((f) => !f.untracked && f.worktree !== " ").length;
|
|
192
|
-
const unstaged = parseShortstat(unstagedResult.stdout);
|
|
193
|
-
const staged = parseShortstat(stagedResult.stdout);
|
|
194
|
-
return {
|
|
195
|
-
repo,
|
|
196
|
-
baseBranch: repo.baseBranch,
|
|
197
|
-
onBaseBranch: repo.onBaseBranch,
|
|
198
|
-
files,
|
|
199
|
-
stagedCount,
|
|
200
|
-
unstagedCount,
|
|
201
|
-
untrackedCount,
|
|
202
|
-
insertions: unstaged.insertions + staged.insertions,
|
|
203
|
-
deletions: unstaged.deletions + staged.deletions,
|
|
204
|
-
recentCommits: recent,
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
async recentCommits(repoDir) {
|
|
188
|
+
const startedAt = performance.now();
|
|
189
|
+
let succeeded = false;
|
|
208
190
|
try {
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
.filter((line) => line.length > 0)
|
|
218
|
-
.map((line) => {
|
|
219
|
-
const [hash, subject, relativeDate] = line.split("\u0000");
|
|
220
|
-
return {
|
|
221
|
-
hash: hash ?? "",
|
|
222
|
-
subject: subject ?? "",
|
|
223
|
-
relativeDate: relativeDate ?? "",
|
|
224
|
-
};
|
|
191
|
+
const result = await getOverview(this, projectId, relativePath);
|
|
192
|
+
succeeded = true;
|
|
193
|
+
return result;
|
|
194
|
+
}
|
|
195
|
+
finally {
|
|
196
|
+
this.observeOverview({
|
|
197
|
+
durationMs: performance.now() - startedAt,
|
|
198
|
+
succeeded,
|
|
225
199
|
});
|
|
226
200
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
201
|
+
}
|
|
202
|
+
recentCommits(repoDir) {
|
|
203
|
+
return getRecentCommits(this, repoDir);
|
|
230
204
|
}
|
|
231
205
|
async listBranches(projectId, relativePath) {
|
|
232
206
|
return await listBranchesImpl.call(this, projectId, relativePath);
|
|
@@ -243,7 +217,23 @@ export class GitService {
|
|
|
243
217
|
async mergedToBase(repoDir, baseBranch, state) {
|
|
244
218
|
return await mergedToBaseImpl.call(this, repoDir, baseBranch, state);
|
|
245
219
|
}
|
|
246
|
-
|
|
220
|
+
async mergedToBaseRef(repoDir, baseRef, state) {
|
|
221
|
+
if (state.detached || state.onBaseBranch || !state.currentBranch) {
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
try {
|
|
225
|
+
await this.runGit(repoDir, [
|
|
226
|
+
"merge-base",
|
|
227
|
+
"--is-ancestor",
|
|
228
|
+
"HEAD",
|
|
229
|
+
baseRef,
|
|
230
|
+
]);
|
|
231
|
+
return true;
|
|
232
|
+
}
|
|
233
|
+
catch {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
247
237
|
async createBranch(projectId, relativePath, name) {
|
|
248
238
|
const repoDir = this.resolveRepoDir(projectId, relativePath);
|
|
249
239
|
try {
|
|
@@ -253,6 +243,7 @@ export class GitService {
|
|
|
253
243
|
throw new GitWorkflowError(400, "GIT_INVALID_BRANCH_NAME", `'${name}' is not a valid git branch name.`);
|
|
254
244
|
}
|
|
255
245
|
await this.mapGit(() => this.runGit(repoDir, ["switch", "-c", name]));
|
|
246
|
+
this.invalidateStableRepoMetadata(repoDir);
|
|
256
247
|
return {
|
|
257
248
|
repo: await this.summarizeRepo(repoDir, relativePath, this.repoName(projectId, relativePath)),
|
|
258
249
|
};
|
|
@@ -266,6 +257,7 @@ export class GitService {
|
|
|
266
257
|
}
|
|
267
258
|
const args = target.remote ? ["switch", "--track", name] : ["switch", name];
|
|
268
259
|
await this.mapGit(() => this.runGit(repoDir, args));
|
|
260
|
+
this.invalidateStableRepoMetadata(repoDir);
|
|
269
261
|
return {
|
|
270
262
|
repo: await this.summarizeRepo(repoDir, relativePath, this.repoName(projectId, relativePath)),
|
|
271
263
|
};
|
|
@@ -318,6 +310,7 @@ export class GitService {
|
|
|
318
310
|
throw new GitWorkflowError(409, "GIT_NO_REMOTE", "This repository does not have a remote configured.");
|
|
319
311
|
}
|
|
320
312
|
await this.mapGit(() => this.runGit(repoDir, ["fetch", "--prune"]));
|
|
313
|
+
this.invalidateStableRepoMetadata(repoDir);
|
|
321
314
|
repo = await this.summarizeRepo(repoDir, relativePath, repoName);
|
|
322
315
|
if (!repo.hasUpstream) {
|
|
323
316
|
await this.mapGit(() => this.runGit(repoDir, ["push", "-u", "origin", currentBranch]));
|
|
@@ -349,23 +342,15 @@ export class GitService {
|
|
|
349
342
|
if (!repo.hasRemote) {
|
|
350
343
|
throw new GitWorkflowError(409, "GIT_NO_REMOTE", "This repository does not have a remote configured.");
|
|
351
344
|
}
|
|
352
|
-
const
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
"--verify",
|
|
356
|
-
"--quiet",
|
|
357
|
-
`refs/heads/${baseBranch}`,
|
|
358
|
-
]).then(() => true, () => false);
|
|
345
|
+
const stable = await this.stableRepoMetadata(repoDir);
|
|
346
|
+
const baseBranch = stable.baseBranch;
|
|
347
|
+
const localBaseExists = stable.refSnapshot.refs.has(`refs/heads/${baseBranch}`);
|
|
359
348
|
if (localBaseExists) {
|
|
360
349
|
await this.mapGit(() => this.runGit(repoDir, ["switch", baseBranch]));
|
|
361
350
|
}
|
|
362
351
|
else {
|
|
363
|
-
const remoteBaseExists =
|
|
364
|
-
|
|
365
|
-
"--verify",
|
|
366
|
-
"--quiet",
|
|
367
|
-
`refs/remotes/origin/${baseBranch}`,
|
|
368
|
-
]).then(() => true, () => false);
|
|
352
|
+
const remoteBaseExists = stable.refSnapshot.refs.has(`refs/remotes/origin/${baseBranch}`) ||
|
|
353
|
+
stable.refSnapshot.originHead === `refs/remotes/origin/${baseBranch}`;
|
|
369
354
|
if (!remoteBaseExists) {
|
|
370
355
|
throw new GitWorkflowError(404, "GIT_BRANCH_NOT_FOUND", `Base branch '${baseBranch}' was not found locally or on origin.`);
|
|
371
356
|
}
|
|
@@ -375,6 +360,7 @@ export class GitService {
|
|
|
375
360
|
throw new GitWorkflowError(409, "GIT_NO_UPSTREAM", `Base branch '${baseBranch}' has no upstream to pull from.`);
|
|
376
361
|
}
|
|
377
362
|
await this.mapGit(() => this.runGit(repoDir, ["pull", "--ff-only"]));
|
|
363
|
+
this.invalidateStableRepoMetadata(repoDir);
|
|
378
364
|
return {
|
|
379
365
|
repo: await this.summarizeRepo(repoDir, relativePath, this.repoName(projectId, relativePath)),
|
|
380
366
|
};
|
|
@@ -394,6 +380,7 @@ export class GitService {
|
|
|
394
380
|
? ["push"]
|
|
395
381
|
: ["push", "-u", "origin", branch];
|
|
396
382
|
await this.mapGit(() => this.runGit(repoDir, args));
|
|
383
|
+
this.invalidateStableRepoMetadata(repoDir);
|
|
397
384
|
return {
|
|
398
385
|
repo: await this.summarizeRepo(repoDir, relativePath, this.repoName(projectId, relativePath)),
|
|
399
386
|
};
|
|
@@ -408,6 +395,7 @@ export class GitService {
|
|
|
408
395
|
throw new GitWorkflowError(409, "GIT_DIRTY_WORKTREE", "Working tree has uncommitted changes. Commit or stash them before pulling.");
|
|
409
396
|
}
|
|
410
397
|
await this.mapGit(() => this.runGit(repoDir, ["pull", "--ff-only"]));
|
|
398
|
+
this.invalidateStableRepoMetadata(repoDir);
|
|
411
399
|
return {
|
|
412
400
|
repo: await this.summarizeRepo(repoDir, relativePath, this.repoName(projectId, relativePath)),
|
|
413
401
|
};
|
|
@@ -415,6 +403,7 @@ export class GitService {
|
|
|
415
403
|
async fetch(projectId, relativePath) {
|
|
416
404
|
const repoDir = this.resolveRepoDir(projectId, relativePath);
|
|
417
405
|
await this.mapGit(() => this.runGit(repoDir, ["fetch", "--prune"]));
|
|
406
|
+
this.invalidateStableRepoMetadata(repoDir);
|
|
418
407
|
return {
|
|
419
408
|
repo: await this.summarizeRepo(repoDir, relativePath, this.repoName(projectId, relativePath)),
|
|
420
409
|
};
|
|
@@ -433,7 +422,6 @@ export class GitService {
|
|
|
433
422
|
return false;
|
|
434
423
|
}
|
|
435
424
|
}
|
|
436
|
-
// --- GitHub via gh ---
|
|
437
425
|
async githubStatus(projectId, relativePath) {
|
|
438
426
|
return getGithubStatus(this.githubContext(), projectId, relativePath);
|
|
439
427
|
}
|
|
@@ -449,17 +437,17 @@ export class GitService {
|
|
|
449
437
|
githubContext() {
|
|
450
438
|
return {
|
|
451
439
|
resolveRepoDir: (projectId, relativePath) => this.resolveRepoDir(projectId, relativePath),
|
|
452
|
-
repoRemoteState: (repoDir) => this.
|
|
440
|
+
repoRemoteState: async (repoDir) => (await this.stableRepoMetadata(repoDir)).remoteState,
|
|
453
441
|
runGh: (repoDir, args) => this.runGh(repoDir, args),
|
|
454
442
|
runGit: (repoDir, args) => this.runGit(repoDir, args),
|
|
455
443
|
ensureGithubRemote: (repoDir) => this.ensureGithubRemote(repoDir),
|
|
444
|
+
invalidateStableMetadata: (repoDir) => this.invalidateStableRepoMetadata(repoDir),
|
|
456
445
|
mapGh: (fn) => this.mapGh(fn),
|
|
457
446
|
summarizeRepo: (repoDir, relativePath, name) => this.summarizeRepo(repoDir, relativePath, name),
|
|
458
447
|
repoName: (projectId, relativePath) => this.repoName(projectId, relativePath),
|
|
459
448
|
isGitCommandError: (error) => error instanceof GitCommandError,
|
|
460
449
|
};
|
|
461
450
|
}
|
|
462
|
-
// --- error mapping ---
|
|
463
451
|
async mapGit(fn) {
|
|
464
452
|
try {
|
|
465
453
|
return await fn();
|