@gajae-code/coding-agent 0.13.2 → 0.14.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/CHANGELOG.md +215 -8
- package/README.md +2 -0
- package/bin/gajaessi.js +4 -0
- package/dist/types/async/job-manager.d.ts +55 -2
- package/dist/types/async/support.d.ts +14 -0
- package/dist/types/capability/mcp.d.ts +6 -0
- package/dist/types/capability/types.d.ts +6 -0
- package/dist/types/cli/accounts-cli.d.ts +19 -0
- package/dist/types/cli/args.d.ts +3 -0
- package/dist/types/cli/config-cli.d.ts +6 -0
- package/dist/types/cli/crash-cli.d.ts +10 -0
- package/dist/types/cli/customize-doctor.d.ts +145 -0
- package/dist/types/cli/daemon-cli.d.ts +3 -1
- package/dist/types/cli/mcp-cli.d.ts +11 -0
- package/dist/types/cli/notify-cli.d.ts +1 -1
- package/dist/types/cli/root-flags.d.ts +12 -0
- package/dist/types/cli/setup-cli.d.ts +3 -1
- package/dist/types/cli/skills-cli.d.ts +2 -1
- package/dist/types/cli/update-cli.d.ts +19 -1
- package/dist/types/cli.d.ts +6 -0
- package/dist/types/commands/accounts.d.ts +40 -0
- package/dist/types/commands/crash.d.ts +24 -0
- package/dist/types/commands/customize.d.ts +22 -0
- package/dist/types/commands/daemon.d.ts +1 -1
- package/dist/types/commands/launch.d.ts +6 -0
- package/dist/types/commands/setup.d.ts +6 -0
- package/dist/types/commands/skills.d.ts +6 -1
- package/dist/types/commands/update.d.ts +7 -0
- package/dist/types/config/atomic-yaml-patch-worker.d.ts +25 -0
- package/dist/types/config/atomic-yaml-patch.d.ts +62 -2
- package/dist/types/config/config-schema-version.d.ts +10 -0
- package/dist/types/config/file-lock.d.ts +18 -0
- package/dist/types/config/model-profile-activation.d.ts +3 -1
- package/dist/types/config/model-registry.d.ts +10 -1
- package/dist/types/config/models-config-schema.d.ts +2 -0
- package/dist/types/config/settings-schema.d.ts +73 -9
- package/dist/types/config/settings.d.ts +63 -0
- package/dist/types/config/skill-settings-defaults.d.ts +26 -0
- package/dist/types/config/task-delegation.d.ts +39 -0
- package/dist/types/config/update-channel.d.ts +10 -0
- package/dist/types/coordinator-mcp/server.d.ts +5 -1
- package/dist/types/crash/index-store.d.ts +87 -0
- package/dist/types/crash/nudge.d.ts +50 -0
- package/dist/types/crash/record-loader.d.ts +17 -0
- package/dist/types/crash/report.d.ts +134 -0
- package/dist/types/crash/sanitize.d.ts +25 -0
- package/dist/types/cursor.d.ts +13 -2
- package/dist/types/customization/import.d.ts +37 -0
- package/dist/types/customization/index.d.ts +4 -0
- package/dist/types/customization/inventory.d.ts +25 -0
- package/dist/types/customization/mutations.d.ts +32 -0
- package/dist/types/customization/types.d.ts +115 -0
- package/dist/types/daemon/control-types.d.ts +8 -1
- package/dist/types/daemon/operator-contract.d.ts +4 -4
- package/dist/types/discovery/claude.d.ts +39 -1
- package/dist/types/discovery/codex.d.ts +39 -1
- package/dist/types/discovery/index.d.ts +2 -0
- package/dist/types/discovery/mcp-compat.d.ts +30 -0
- package/dist/types/edit/renderer.d.ts +23 -0
- package/dist/types/extensibility/extensions/runner.d.ts +3 -0
- package/dist/types/extensibility/extensions/types.d.ts +21 -4
- package/dist/types/extensibility/gjc-plugins/observability.d.ts +6 -1
- package/dist/types/extensibility/gjc-plugins/registry.d.ts +8 -1
- package/dist/types/extensibility/hooks/loader.d.ts +19 -5
- package/dist/types/extensibility/runtime-skill-discovery.d.ts +22 -1
- package/dist/types/extensibility/skill-management.d.ts +107 -0
- package/dist/types/gjc-runtime/deep-interview-runtime.d.ts +3 -1
- package/dist/types/gjc-runtime/launch-worktree.d.ts +8 -0
- package/dist/types/gjc-runtime/linux-proc.d.ts +3 -0
- package/dist/types/gjc-runtime/ralplan-runtime.d.ts +10 -6
- package/dist/types/gjc-runtime/session-state-lock.d.ts +104 -0
- package/dist/types/gjc-runtime/session-state-sidecar.d.ts +120 -2
- package/dist/types/gjc-runtime/state-writer.d.ts +10 -1
- package/dist/types/gjc-runtime/ultragoal-guard.d.ts +4 -2
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +8 -6
- package/dist/types/gjc-runtime/workflow-settings.d.ts +109 -0
- package/dist/types/hooks/events.d.ts +60 -0
- package/dist/types/hooks/normalize.d.ts +83 -0
- package/dist/types/hooks/skill-state.d.ts +9 -2
- package/dist/types/main.d.ts +2 -1
- package/dist/types/modes/acp/abort-scope.d.ts +13 -0
- package/dist/types/modes/acp/acp-agent.d.ts +7 -4
- package/dist/types/modes/components/customization/customization-dashboard.d.ts +44 -0
- package/dist/types/modes/components/customization/import-wizard.d.ts +21 -0
- package/dist/types/modes/components/customization/index.d.ts +1 -0
- package/dist/types/modes/components/dynamic-theme-text.d.ts +9 -0
- package/dist/types/modes/components/gajae-pet-widget.d.ts +6 -28
- package/dist/types/modes/components/irc-sidebar.d.ts +1 -0
- package/dist/types/modes/components/iterm-pet-transport.d.ts +122 -0
- package/dist/types/modes/components/oauth-selector.d.ts +10 -4
- package/dist/types/modes/components/pet-capability.d.ts +7 -21
- package/dist/types/modes/components/settings-selector.d.ts +5 -0
- package/dist/types/modes/components/status-line/gh.d.ts +6 -2
- package/dist/types/modes/controllers/extension-ui-controller.d.ts +1 -1
- package/dist/types/modes/controllers/selector-controller.d.ts +7 -8
- package/dist/types/modes/controllers/stt-controller.d.ts +1 -1
- package/dist/types/modes/interactive-mode.d.ts +1 -0
- package/dist/types/modes/theme/defaults/index.d.ts +118 -0
- package/dist/types/modes/types.d.ts +1 -0
- package/dist/types/modes/utils/injected-user-submission.d.ts +10 -0
- package/dist/types/runtime-mcp/config.d.ts +9 -0
- package/dist/types/runtime-mcp/manager.d.ts +26 -1
- package/dist/types/runtime-mcp/oauth-discovery.d.ts +4 -0
- package/dist/types/runtime-mcp/oauth-flow.d.ts +24 -1
- package/dist/types/runtime-mcp/pool-key.d.ts +2 -0
- package/dist/types/runtime-mcp/protocol.d.ts +278 -0
- package/dist/types/runtime-mcp/scope-config.d.ts +29 -0
- package/dist/types/runtime-mcp/tool-bridge.d.ts +15 -13
- package/dist/types/runtime-mcp/transports/http.d.ts +9 -0
- package/dist/types/runtime-mcp/types.d.ts +102 -10
- package/dist/types/sdk/acp/adapter.d.ts +26 -5
- package/dist/types/sdk/broker/broker.d.ts +3 -55
- package/dist/types/sdk/broker/lifecycle.d.ts +18 -12
- package/dist/types/sdk/broker/session-index.d.ts +14 -5
- package/dist/types/sdk/broker/startup-failure.d.ts +16 -1
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +51 -1
- package/dist/types/sdk/bus/chat-daemon-runtime.d.ts +4 -41
- package/dist/types/sdk/bus/config.d.ts +11 -0
- package/dist/types/sdk/bus/conversation-store.d.ts +0 -1
- package/dist/types/sdk/bus/daemon-paths.d.ts +6 -0
- package/dist/types/sdk/bus/discord-conversation.d.ts +2 -0
- package/dist/types/sdk/bus/discord-daemon.d.ts +17 -12
- package/dist/types/sdk/bus/existing-thread-readiness.d.ts +4 -34
- package/dist/types/sdk/bus/inbound-reaction-ordering.d.ts +61 -0
- package/dist/types/sdk/bus/index.d.ts +85 -99
- package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +29 -7
- package/dist/types/sdk/bus/managed-daemon.d.ts +2 -32
- package/dist/types/sdk/bus/notification-service.d.ts +52 -0
- package/dist/types/sdk/bus/operator-runtime.d.ts +1 -1
- package/dist/types/sdk/bus/prompt-reconciliation.d.ts +16 -5
- package/dist/types/sdk/bus/reconciliation-store.d.ts +113 -5
- package/dist/types/sdk/bus/session-control.d.ts +25 -1
- package/dist/types/sdk/bus/slack-conversation.d.ts +4 -0
- package/dist/types/sdk/bus/slack-daemon.d.ts +9 -17
- package/dist/types/sdk/bus/slack-live-provider.d.ts +3 -1
- package/dist/types/sdk/bus/slack-provider.d.ts +4 -0
- package/dist/types/sdk/bus/slack-thread-binding.d.ts +6 -40
- package/dist/types/sdk/bus/telegram-adoption-intent.d.ts +30 -104
- package/dist/types/sdk/bus/telegram-daemon-cli.d.ts +10 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +262 -19
- package/dist/types/sdk/bus/telegram-daemon-orphan-reap.d.ts +125 -0
- package/dist/types/sdk/bus/telegram-daemon-owner-registry.d.ts +22 -0
- package/dist/types/sdk/bus/telegram-daemon.d.ts +119 -310
- package/dist/types/sdk/bus/telegram-reference.d.ts +1 -47
- package/dist/types/sdk/bus/threaded-render.d.ts +1 -0
- package/dist/types/sdk/bus/topic-registry.d.ts +33 -17
- package/dist/types/sdk/cli/rows.d.ts +2 -11
- package/dist/types/sdk/cli/session-cli.d.ts +15 -25
- package/dist/types/sdk/client/client.d.ts +97 -1
- package/dist/types/sdk/host/control/dispatch.d.ts +0 -7
- package/dist/types/sdk/host/control/index.d.ts +1 -1
- package/dist/types/sdk/host/control/operations.d.ts +18 -5
- package/dist/types/sdk/host/control/runtime-gate.d.ts +19 -0
- package/dist/types/sdk/host/host.d.ts +15 -1
- package/dist/types/sdk/host/query/handlers.d.ts +5 -0
- package/dist/types/sdk/host/reverse-leases.d.ts +1 -1
- package/dist/types/sdk/host/session-runtime.d.ts +127 -7
- package/dist/types/sdk/host/types.d.ts +1 -1
- package/dist/types/sdk/host/websocket-transport.d.ts +1 -1
- package/dist/types/sdk/index.d.ts +2 -1
- package/dist/types/sdk/lifecycle/broker-client.d.ts +8 -0
- package/dist/types/sdk/lifecycle/client.d.ts +59 -0
- package/dist/types/sdk/lifecycle/index.d.ts +3 -0
- package/dist/types/sdk/lifecycle/service.d.ts +232 -0
- package/dist/types/sdk/mcp/server.d.ts +9 -6
- package/dist/types/sdk/prompt-deadline-lease.d.ts +43 -0
- package/dist/types/sdk/prompt-deadline-manager.d.ts +28 -0
- package/dist/types/sdk/prompt-status.d.ts +10 -3
- package/dist/types/sdk/protocol/operation-registry.d.ts +5 -0
- package/dist/types/sdk/receipt-state.d.ts +17 -0
- package/dist/types/sdk/reconciliation-extensions.d.ts +2 -0
- package/dist/types/sdk/router/index.d.ts +1 -0
- package/dist/types/sdk/router/session-router.d.ts +152 -0
- package/dist/types/sdk/session-list.d.ts +22 -0
- package/dist/types/sdk/session-reconnect.d.ts +43 -1
- package/dist/types/sdk/session.d.ts +34 -1
- package/dist/types/sdk/transport/serve-cli.d.ts +1 -4
- package/dist/types/session/account-inventory.d.ts +86 -0
- package/dist/types/session/agent-session.d.ts +145 -6
- package/dist/types/session/agent-storage.d.ts +10 -0
- package/dist/types/session/coordinator-tool-label.d.ts +28 -0
- package/dist/types/session/internal/managed-session-storage.d.ts +23 -4
- package/dist/types/session/messages.d.ts +1 -1
- package/dist/types/session/secure-token-file.d.ts +3 -0
- package/dist/types/session/session-manager.d.ts +47 -1
- package/dist/types/session/startup-auth-config.d.ts +44 -0
- package/dist/types/session/terminal-abort.d.ts +378 -0
- package/dist/types/session/yield-queue.d.ts +7 -0
- package/dist/types/session-import/claude.d.ts +26 -0
- package/dist/types/session-import/codex.d.ts +88 -0
- package/dist/types/session-import/command.d.ts +35 -0
- package/dist/types/session-import/detect.d.ts +22 -0
- package/dist/types/session-import/index.d.ts +7 -0
- package/dist/types/session-import/provider-codex.d.ts +22 -0
- package/dist/types/session-import/provider-service.d.ts +38 -0
- package/dist/types/session-import/redact.d.ts +23 -0
- package/dist/types/session-import/service.d.ts +47 -0
- package/dist/types/session-import/types.d.ts +120 -0
- package/dist/types/setup/paseo/check.d.ts +16 -0
- package/dist/types/setup/paseo/install-saga.d.ts +115 -0
- package/dist/types/setup/paseo/json-publisher.d.ts +76 -0
- package/dist/types/setup/paseo/orchestration-preferences.d.ts +24 -0
- package/dist/types/setup/paseo/paseo-ownership.d.ts +87 -0
- package/dist/types/setup/paseo/paseo-setup.d.ts +29 -0
- package/dist/types/setup/paseo/provider-config.d.ts +35 -0
- package/dist/types/setup/paseo/remove.d.ts +14 -0
- package/dist/types/setup/paseo/result-types.d.ts +59 -0
- package/dist/types/setup/paseo/setup-deps.d.ts +73 -0
- package/dist/types/setup/paseo/skills-bridge.d.ts +44 -0
- package/dist/types/skill-state/active-state.d.ts +5 -1
- package/dist/types/slash-commands/acp-builtins.d.ts +5 -1
- package/dist/types/slash-commands/builtin-registry.d.ts +2 -0
- package/dist/types/slash-commands/helpers/credential-switch.d.ts +12 -0
- package/dist/types/slash-commands/helpers/usage-report.d.ts +5 -6
- package/dist/types/slash-commands/types.d.ts +7 -1
- package/dist/types/task/executor.d.ts +10 -0
- package/dist/types/task/index.d.ts +3 -1
- package/dist/types/tools/ask-answer-registry.d.ts +6 -3
- package/dist/types/tools/bash-sleep-advisory.d.ts +14 -0
- package/dist/types/tools/bash.d.ts +2 -6
- package/dist/types/tools/browser/attach.d.ts +11 -0
- package/dist/types/tools/browser/launch.d.ts +20 -0
- package/dist/types/tools/browser/profile-discovery.d.ts +6 -0
- package/dist/types/tools/browser/render.d.ts +1 -0
- package/dist/types/tools/browser.d.ts +3 -1
- package/dist/types/tools/image-gen.d.ts +10 -2
- package/dist/types/tools/index.d.ts +8 -0
- package/dist/types/tools/monitor.d.ts +1 -1
- package/dist/types/tools/skill-discovery.d.ts +8 -1
- package/dist/types/tools/subagent.d.ts +2 -0
- package/dist/types/tools/ultragoal-ask-guard.d.ts +2 -2
- package/dist/types/utils/herdr-pane.d.ts +76 -0
- package/package.json +19 -9
- package/scripts/build-binary.ts +2 -1
- package/scripts/build-sdk-package-smoke.ts +2 -13
- package/scripts/capture-sticky-viewport-showcase.ts +0 -1
- package/scripts/compile-args.ts +2 -0
- package/scripts/generate-sdk-adapter-parity-manifest.ts +31 -16
- package/scripts/generate-sdk-operation-inventory.ts +28 -0
- package/scripts/generate-telegram-baseline-manifest.ts +1 -0
- package/scripts/generate-tool-catalog.ts +6 -4
- package/scripts/verify-gjc-sdk-canonicalization.ts +5 -39
- package/src/async/job-manager.ts +352 -17
- package/src/async/support.ts +25 -0
- package/src/autoresearch/dashboard.ts +28 -13
- package/src/capability/index.ts +3 -1
- package/src/capability/mcp.ts +6 -0
- package/src/capability/types.ts +6 -0
- package/src/cli/accounts-cli.ts +395 -0
- package/src/cli/args.ts +23 -0
- package/src/cli/auth-broker-cli.ts +136 -66
- package/src/cli/auth-gateway-cli.ts +94 -70
- package/src/cli/config-cli.ts +27 -2
- package/src/cli/crash-cli.ts +78 -0
- package/src/cli/customize-doctor.ts +1605 -0
- package/src/cli/daemon-cli.ts +12 -3
- package/src/cli/fast-help.ts +1 -0
- package/src/cli/mcp-cli.ts +128 -60
- package/src/cli/notify-cli.ts +8 -14
- package/src/cli/root-flags.ts +8 -0
- package/src/cli/setup-cli.ts +145 -0
- package/src/cli/skills-cli.ts +38 -2
- package/src/cli/update-cli.ts +167 -12
- package/src/cli.ts +4 -0
- package/src/commands/accounts.ts +71 -0
- package/src/commands/crash.ts +35 -0
- package/src/commands/customize.ts +84 -0
- package/src/commands/daemon.ts +2 -2
- package/src/commands/deep-interview.ts +2 -0
- package/src/commands/launch.ts +1 -0
- package/src/commands/mcp.ts +12 -7
- package/src/commands/ralplan.ts +2 -0
- package/src/commands/sdk.ts +65 -32
- package/src/commands/setup.ts +5 -0
- package/src/commands/skills.ts +14 -4
- package/src/commands/ultragoal.ts +10 -1
- package/src/commands/update.ts +26 -15
- package/src/config/atomic-yaml-patch-worker.ts +57 -0
- package/src/config/atomic-yaml-patch.ts +769 -29
- package/src/config/config-schema-version.ts +10 -0
- package/src/config/file-lock.ts +70 -1
- package/src/config/mcp-schema.json +52 -14
- package/src/config/model-profile-activation.ts +23 -2
- package/src/config/model-profiles.ts +88 -21
- package/src/config/model-registry.ts +147 -21
- package/src/config/models-config-schema.ts +1 -1
- package/src/config/settings-schema.ts +77 -7
- package/src/config/settings.ts +4038 -199
- package/src/config/skill-settings-defaults.ts +41 -3
- package/src/config/task-delegation.ts +87 -0
- package/src/config/update-channel.ts +23 -0
- package/src/coordinator-mcp/server.ts +377 -308
- package/src/crash/index-store.ts +723 -0
- package/src/crash/nudge.ts +89 -0
- package/src/crash/record-loader.ts +149 -0
- package/src/crash/report.ts +551 -0
- package/src/crash/sanitize.ts +129 -0
- package/src/cursor.ts +36 -10
- package/src/customization/import.ts +946 -0
- package/src/customization/index.ts +4 -0
- package/src/customization/inventory.ts +335 -0
- package/src/customization/mutations.ts +141 -0
- package/src/customization/types.ts +223 -0
- package/src/daemon/control-types.ts +8 -1
- package/src/daemon/operator-contract.ts +6 -6
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/models/catalog.ts +31 -6
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +11 -22
- package/src/defaults/gjc/skills/ralplan/SKILL.md +36 -23
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +16 -0
- package/src/discovery/claude-hooks.ts +38 -0
- package/src/discovery/claude.ts +142 -209
- package/src/discovery/codex-hooks.ts +38 -0
- package/src/discovery/codex.ts +132 -198
- package/src/discovery/helpers.ts +8 -1
- package/src/discovery/index.ts +2 -0
- package/src/discovery/mcp-compat.ts +234 -0
- package/src/discovery/mcp-json.ts +6 -0
- package/src/edit/renderer.ts +40 -0
- package/src/edit/streaming.ts +4 -2
- package/src/exec/bash-executor.ts +24 -20
- package/src/export/html/index.ts +51 -2
- package/src/extensibility/extensions/loader.ts +9 -1
- package/src/extensibility/extensions/runner.ts +17 -4
- package/src/extensibility/extensions/types.ts +31 -6
- package/src/extensibility/gjc-plugins/constrained-hooks.ts +33 -0
- package/src/extensibility/gjc-plugins/installer.ts +9 -5
- package/src/extensibility/gjc-plugins/observability.ts +8 -2
- package/src/extensibility/gjc-plugins/registry.ts +13 -2
- package/src/extensibility/gjc-plugins/runtime-adapters.ts +3 -1
- package/src/extensibility/gjc-plugins/schema.ts +222 -39
- package/src/extensibility/hooks/loader.ts +154 -10
- package/src/extensibility/runtime-skill-discovery.ts +257 -60
- package/src/extensibility/skill-management.ts +368 -0
- package/src/extensibility/skills.ts +52 -16
- package/src/gjc-runtime/deep-interview-runtime.ts +45 -61
- package/src/gjc-runtime/launch-worktree.ts +56 -2
- package/src/gjc-runtime/linux-proc.ts +7 -1
- package/src/gjc-runtime/ralplan-runtime.ts +100 -164
- package/src/gjc-runtime/session-state-lock.ts +992 -0
- package/src/gjc-runtime/session-state-sidecar.ts +644 -142
- package/src/gjc-runtime/state-writer.ts +39 -14
- package/src/gjc-runtime/tmux-owner-isolation.ts +5 -4
- package/src/gjc-runtime/ultragoal-guard.ts +11 -4
- package/src/gjc-runtime/ultragoal-runtime.ts +44 -41
- package/src/gjc-runtime/workflow-settings.ts +596 -0
- package/src/goals/tools/goal-tool.ts +6 -1
- package/src/hooks/events.ts +291 -0
- package/src/hooks/native-skill-hook.ts +4 -0
- package/src/hooks/normalize.ts +369 -0
- package/src/hooks/skill-state.ts +165 -46
- package/src/internal-urls/docs-index.generated.ts +41 -32
- package/src/main.ts +36 -5
- package/src/migrate/mcp-mapper.ts +25 -2
- package/src/modes/acp/abort-scope.ts +29 -0
- package/src/modes/acp/acp-agent.ts +423 -98
- package/src/modes/components/assistant-message.ts +6 -1
- package/src/modes/components/chrome.ts +4 -3
- package/src/modes/components/customization/customization-dashboard.ts +443 -0
- package/src/modes/components/customization/import-wizard.ts +372 -0
- package/src/modes/components/customization/index.ts +1 -0
- package/src/modes/components/dynamic-theme-text.ts +22 -0
- package/src/modes/components/gajae-pet-widget.ts +607 -193
- package/src/modes/components/irc-sidebar.ts +11 -0
- package/src/modes/components/iterm-pet-transport.ts +585 -0
- package/src/modes/components/model-selector.ts +1 -6
- package/src/modes/components/oauth-selector.ts +277 -86
- package/src/modes/components/pet-capability.ts +35 -31
- package/src/modes/components/settings-selector.ts +29 -5
- package/src/modes/components/status-line/gh.ts +45 -1
- package/src/modes/components/status-line/segments.ts +19 -4
- package/src/modes/components/tool-status-header.ts +13 -3
- package/src/modes/controllers/command-controller.ts +20 -8
- package/src/modes/controllers/extension-ui-controller.ts +56 -257
- package/src/modes/controllers/input-controller.ts +10 -0
- package/src/modes/controllers/runtime-mcp-command-controller.ts +16 -3
- package/src/modes/controllers/selector-controller.ts +238 -77
- package/src/modes/controllers/stt-controller.ts +3 -3
- package/src/modes/interactive-mode.ts +88 -16
- package/src/modes/print-mode.ts +35 -6
- package/src/modes/runtime-init.ts +21 -68
- package/src/modes/theme/defaults/index.ts +2 -0
- package/src/modes/theme/defaults/ouroboros.json +118 -0
- package/src/modes/types.ts +1 -0
- package/src/modes/utils/injected-user-submission.ts +25 -0
- package/src/modes/utils/terminal-bell.ts +15 -1
- package/src/prompts/agent-fragments/ralplan-persistence.md +1 -1
- package/src/prompts/agent-fragments/restricted-bash.md +1 -1
- package/src/prompts/agents/critic.md +1 -1
- package/src/prompts/system/rlm-research.md +1 -1
- package/src/prompts/system/system-prompt.md +0 -2
- package/src/prompts/tools/bash.md +7 -1
- package/src/prompts/tools/browser.md +1 -1
- package/src/prompts/tools/cron.md +6 -6
- package/src/prompts/tools/read.md +0 -2
- package/src/prompts/tools/skill-discovery.md +4 -2
- package/src/runtime-mcp/client.ts +427 -23
- package/src/runtime-mcp/config.ts +37 -5
- package/src/runtime-mcp/manager-pool.test.ts +56 -0
- package/src/runtime-mcp/manager.ts +52 -2
- package/src/runtime-mcp/oauth-discovery.ts +13 -0
- package/src/runtime-mcp/oauth-flow.ts +46 -1
- package/src/runtime-mcp/pool-key.ts +5 -1
- package/src/runtime-mcp/pool.test.ts +9 -0
- package/src/runtime-mcp/protocol.test.ts +353 -0
- package/src/runtime-mcp/protocol.ts +624 -0
- package/src/runtime-mcp/scope-config.ts +78 -0
- package/src/runtime-mcp/tool-bridge.ts +44 -10
- package/src/runtime-mcp/transports/http.ts +84 -13
- package/src/runtime-mcp/types.ts +123 -12
- package/src/sdk/acp/adapter.ts +328 -97
- package/src/sdk/broker/broker.ts +160 -741
- package/src/sdk/broker/ensure.ts +9 -1
- package/src/sdk/broker/lifecycle.ts +510 -116
- package/src/sdk/broker/operation-receipt-ledger.ts +11 -2
- package/src/sdk/broker/process-incarnation.ts +19 -0
- package/src/sdk/broker/session-index.ts +516 -117
- package/src/sdk/broker/startup-failure.ts +28 -5
- package/src/sdk/broker/transport.ts +1 -13
- package/src/sdk/bus/chat-daemon-cli.ts +4 -2
- package/src/sdk/bus/chat-daemon-control.ts +67 -6
- package/src/sdk/bus/chat-daemon-runtime.ts +183 -859
- package/src/sdk/bus/config.ts +13 -0
- package/src/sdk/bus/conversation-store.ts +59 -171
- package/src/sdk/bus/daemon-paths.ts +20 -0
- package/src/sdk/bus/discord-conversation.ts +2 -0
- package/src/sdk/bus/discord-daemon.ts +524 -126
- package/src/sdk/bus/discord-live-provider.ts +206 -79
- package/src/sdk/bus/existing-thread-readiness.ts +4 -97
- package/src/sdk/bus/inbound-reaction-ordering.ts +122 -0
- package/src/sdk/bus/index.ts +2480 -456
- package/src/sdk/bus/kind-aware-reconciliation.ts +204 -34
- package/src/sdk/bus/lifecycle-commands.ts +2 -2
- package/src/sdk/bus/managed-daemon.ts +2 -145
- package/src/sdk/bus/notification-service.ts +196 -0
- package/src/sdk/bus/operator-runtime.ts +1 -1
- package/src/sdk/bus/prompt-reconciliation.ts +24 -15
- package/src/sdk/bus/reconciliation-store.ts +553 -24
- package/src/sdk/bus/session-control.ts +49 -3
- package/src/sdk/bus/slack-conversation.ts +4 -0
- package/src/sdk/bus/slack-daemon.ts +733 -134
- package/src/sdk/bus/slack-live-provider.ts +65 -15
- package/src/sdk/bus/slack-provider.ts +4 -0
- package/src/sdk/bus/slack-thread-binding.ts +9 -104
- package/src/sdk/bus/telegram-adoption-intent.ts +299 -209
- package/src/sdk/bus/telegram-daemon-cli.ts +194 -7
- package/src/sdk/bus/telegram-daemon-contract.ts +265 -19
- package/src/sdk/bus/telegram-daemon-control.ts +3 -13
- package/src/sdk/bus/telegram-daemon-orphan-reap.ts +498 -0
- package/src/sdk/bus/telegram-daemon-owner-registry.ts +176 -0
- package/src/sdk/bus/telegram-daemon.ts +2552 -2280
- package/src/sdk/bus/telegram-reference.ts +1 -226
- package/src/sdk/bus/telegram-setup.ts +2 -2
- package/src/sdk/bus/threaded-render.ts +1 -0
- package/src/sdk/bus/topic-registry.ts +279 -146
- package/src/sdk/cli/rows.ts +2 -35
- package/src/sdk/cli/session-cli.ts +776 -700
- package/src/sdk/client/client.ts +892 -1
- package/src/sdk/host/control/dispatch.ts +93 -58
- package/src/sdk/host/control/index.ts +1 -1
- package/src/sdk/host/control/operations.ts +18 -10
- package/src/sdk/host/control/runtime-gate.ts +40 -0
- package/src/sdk/host/host.ts +63 -12
- package/src/sdk/host/query/handlers.ts +66 -7
- package/src/sdk/host/reverse-leases.ts +2 -2
- package/src/sdk/host/sdk-surface-parity.test.ts +1 -1
- package/src/sdk/host/session-runtime.test.ts +2787 -34
- package/src/sdk/host/session-runtime.ts +1489 -101
- package/src/sdk/host/surface-policy.ts +12 -8
- package/src/sdk/host/types.ts +1 -1
- package/src/sdk/host/websocket-transport.lifecycle.test.ts +31 -59
- package/src/sdk/host/websocket-transport.ts +85 -50
- package/src/sdk/index.ts +2 -1
- package/src/sdk/lifecycle/broker-client.ts +53 -0
- package/src/sdk/lifecycle/client.ts +234 -0
- package/src/sdk/lifecycle/index.ts +3 -0
- package/src/sdk/{bus/recent-activity.ts → lifecycle/recent-sessions.ts} +5 -2
- package/src/sdk/lifecycle/service.ts +720 -0
- package/src/sdk/mcp/server.ts +226 -188
- package/src/sdk/prompt-deadline-lease.ts +55 -0
- package/src/sdk/prompt-deadline-manager.ts +148 -0
- package/src/sdk/prompt-status.ts +11 -3
- package/src/sdk/protocol/operation-inventory.generated.json +272 -129
- package/src/sdk/protocol/operation-registry.ts +71 -8
- package/src/sdk/receipt-state.ts +43 -0
- package/src/sdk/reconciliation-extensions.ts +14 -0
- package/src/sdk/router/index.ts +1 -0
- package/src/sdk/router/session-router.ts +1658 -0
- package/src/sdk/session-list.ts +93 -0
- package/src/sdk/session-reconnect.ts +45 -1
- package/src/sdk/session.ts +716 -120
- package/src/sdk/transport/serve-cli.ts +18 -34
- package/src/session/account-inventory.ts +603 -0
- package/src/session/agent-session.ts +2873 -559
- package/src/session/agent-storage.ts +35 -0
- package/src/session/blob-store.ts +32 -1
- package/src/session/coordinator-tool-label.ts +40 -0
- package/src/session/internal/managed-session-scope.ts +4 -0
- package/src/session/internal/managed-session-storage.ts +199 -31
- package/src/session/messages.ts +1 -1
- package/src/session/secure-token-file.ts +80 -0
- package/src/session/session-manager.ts +757 -57
- package/src/session/session-storage.ts +25 -16
- package/src/session/startup-auth-config.ts +297 -0
- package/src/session/terminal-abort.ts +1253 -0
- package/src/session/yield-queue.ts +57 -15
- package/src/session-import/claude.ts +334 -0
- package/src/session-import/codex.ts +1033 -0
- package/src/session-import/command.ts +77 -0
- package/src/session-import/detect.ts +133 -0
- package/src/session-import/index.ts +7 -0
- package/src/session-import/provider-codex.ts +327 -0
- package/src/session-import/provider-service.ts +457 -0
- package/src/session-import/redact.ts +128 -0
- package/src/session-import/service.ts +1264 -0
- package/src/session-import/types.ts +148 -0
- package/src/setup/paseo/check.ts +213 -0
- package/src/setup/paseo/install-saga.ts +293 -0
- package/src/setup/paseo/json-publisher.ts +263 -0
- package/src/setup/paseo/orchestration-preferences.ts +86 -0
- package/src/setup/paseo/paseo-ownership.ts +224 -0
- package/src/setup/paseo/paseo-setup.ts +253 -0
- package/src/setup/paseo/provider-config.ts +139 -0
- package/src/setup/paseo/remove.ts +183 -0
- package/src/setup/paseo/result-types.ts +79 -0
- package/src/setup/paseo/setup-deps.ts +175 -0
- package/src/setup/paseo/skills-bridge.ts +260 -0
- package/src/skill-state/active-state.ts +21 -11
- package/src/slash-commands/acp-builtins.ts +9 -1
- package/src/slash-commands/builtin-registry.ts +117 -19
- package/src/slash-commands/helpers/credential-switch.ts +143 -0
- package/src/slash-commands/helpers/mcp.ts +9 -3
- package/src/slash-commands/helpers/usage-report.ts +61 -56
- package/src/slash-commands/types.ts +7 -2
- package/src/task/executor.ts +30 -11
- package/src/task/index.ts +66 -7
- package/src/task/render.ts +23 -9
- package/src/tools/ask-answer-registry.ts +23 -7
- package/src/tools/ask.ts +8 -4
- package/src/tools/bash-sleep-advisory.ts +115 -0
- package/src/tools/bash.ts +98 -18
- package/src/tools/browser/attach.ts +71 -3
- package/src/tools/browser/launch.ts +86 -13
- package/src/tools/browser/profile-discovery.ts +57 -7
- package/src/tools/browser/render.ts +8 -1
- package/src/tools/browser.ts +130 -21
- package/src/tools/computer.enforcement.test.ts +1 -1
- package/src/tools/computer.ts +3 -2
- package/src/tools/cron.ts +12 -1
- package/src/tools/image-gen.ts +349 -142
- package/src/tools/index.ts +8 -0
- package/src/tools/job.ts +33 -6
- package/src/tools/monitor.ts +41 -2
- package/src/tools/skill-discovery.ts +21 -29
- package/src/tools/subagent.ts +142 -24
- package/src/tools/todo-contract.ts +55 -3
- package/src/tools/todo-write.ts +4 -3
- package/src/tools/tool-catalog.generated.ts +6 -6
- package/src/tools/ultragoal-ask-guard.ts +10 -3
- package/src/utils/herdr-pane.ts +345 -0
- package/src/utils/title-generator.ts +2 -0
- package/src/web/scrapers/index.ts +6 -4
- package/dist/types/cli/malloc-env-guard.test.d.ts +0 -1
- package/dist/types/defaults/gjc-defaults.test.d.ts +0 -1
- package/dist/types/memory-backend/lazy-loading.test.d.ts +0 -1
- package/dist/types/runtime/boot-ordering.test.d.ts +0 -1
- package/dist/types/runtime/lazy-service.test.d.ts +0 -1
- package/dist/types/runtime/network-prewarm-service.test.d.ts +0 -1
- package/dist/types/runtime/workspace-tree-service.test.d.ts +0 -1
- package/dist/types/runtime-mcp/config.test.d.ts +0 -1
- package/dist/types/runtime-mcp/http.test.d.ts +0 -1
- package/dist/types/runtime-mcp/manager-pool.test.d.ts +0 -1
- package/dist/types/runtime-mcp/pool-key.test.d.ts +0 -1
- package/dist/types/runtime-mcp/pool.test.d.ts +0 -1
- package/dist/types/sdk/bus/lifecycle-control-runtime.d.ts +0 -117
- package/dist/types/sdk/bus/lifecycle-orchestrator.d.ts +0 -141
- package/dist/types/sdk/bus/telegram-cli.d.ts +0 -31
- package/dist/types/sdk/elevation/allowlist.d.ts +0 -20
- package/dist/types/sdk/elevation/audit.d.ts +0 -93
- package/dist/types/sdk/elevation/capability.d.ts +0 -3
- package/dist/types/sdk/elevation/digest.d.ts +0 -72
- package/dist/types/sdk/elevation/dispatch-receipt.d.ts +0 -85
- package/dist/types/sdk/elevation/grant-ledger.d.ts +0 -163
- package/dist/types/sdk/elevation/owner.d.ts +0 -48
- package/dist/types/sdk/host/import-graph.test.d.ts +0 -1
- package/dist/types/sdk/host/sdk-surface-parity.test.d.ts +0 -1
- package/dist/types/sdk/host/session-runtime.test.d.ts +0 -1
- package/dist/types/sdk/host/websocket-transport.lifecycle.test.d.ts +0 -1
- package/dist/types/session/auth-broker-config.d.ts +0 -13
- package/dist/types/session/heap-eviction-artifacts.test.d.ts +0 -1
- package/dist/types/skills/skills.test.d.ts +0 -1
- package/dist/types/slash-commands/notify-command.test.d.ts +0 -1
- package/dist/types/task/token-log.test.d.ts +0 -1
- package/dist/types/tools/computer.enforcement.test.d.ts +0 -1
- package/dist/types/tools/descriptors.test.d.ts +0 -1
- package/scripts/g005-daemon-smoke.ts +0 -180
- package/scripts/g011-daemon-path-smoke.ts +0 -153
- package/src/sdk/bus/lifecycle-control-runtime.ts +0 -1733
- package/src/sdk/bus/lifecycle-orchestrator.ts +0 -489
- package/src/sdk/bus/telegram-cli.ts +0 -212
- package/src/sdk/elevation/allowlist.ts +0 -54
- package/src/sdk/elevation/audit.ts +0 -208
- package/src/sdk/elevation/capability.ts +0 -41
- package/src/sdk/elevation/digest.ts +0 -129
- package/src/sdk/elevation/dispatch-receipt.ts +0 -184
- package/src/sdk/elevation/grant-ledger.ts +0 -1142
- package/src/sdk/elevation/owner.ts +0 -109
- package/src/session/auth-broker-config.ts +0 -109
- /package/dist/types/{ai-core-import-gate.test.d.ts → discovery/claude-hooks.d.ts} +0 -0
- /package/dist/types/{cli/fixture-report.test.d.ts → discovery/codex-hooks.d.ts} +0 -0
- /package/dist/types/sdk/{bus/recent-activity.d.ts → lifecycle/recent-sessions.d.ts} +0 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a `<file>.lock` owner record can be opened safely on this platform.
|
|
3
|
+
*
|
|
4
|
+
* `posix-nofollow` proves the object's TYPE from the descriptor the bytes come off, so the
|
|
5
|
+
* pathname can change freely without ever being followed. Windows has neither `O_NOFOLLOW`
|
|
6
|
+
* nor `O_NONBLOCK`, so no such descriptor exists there and `windows-validated` brackets the
|
|
7
|
+
* open with `lstat`/`fstat` identity proofs instead. `unsupported` is neither, and the
|
|
8
|
+
* owner protocol fails closed rather than reading a pathname it cannot vouch for.
|
|
9
|
+
*/
|
|
10
|
+
export type SessionStateLockOwnerAccessStrategy = "posix-nofollow" | "windows-validated" | "unsupported";
|
|
11
|
+
/**
|
|
12
|
+
* Select the safe owner-record access protocol for one platform/runtime pair.
|
|
13
|
+
*
|
|
14
|
+
* Platform identity comes first. A win32 runtime may expose numeric compatibility constants
|
|
15
|
+
* without providing POSIX no-follow semantics, so their mere presence must never select the
|
|
16
|
+
* POSIX path there.
|
|
17
|
+
*
|
|
18
|
+
* @internal Pure seam for cross-platform detection tests.
|
|
19
|
+
*/
|
|
20
|
+
export declare function detectedSessionStateLockOwnerAccessStrategy(platform: NodeJS.Platform, posixNoFollowAvailable: boolean): SessionStateLockOwnerAccessStrategy;
|
|
21
|
+
/**
|
|
22
|
+
* Test seams for the windows a reclaim passes through: the moment the path's TYPE has just
|
|
23
|
+
* been decided and its owner has not been read yet, the stale verdict, and the FINAL
|
|
24
|
+
* identity validation immediately before the unlink. Production code never sets them.
|
|
25
|
+
*/
|
|
26
|
+
export declare const SessionStateLockTestHooks: {
|
|
27
|
+
afterLockTypeDecision?: (lockFile: string) => void | Promise<void>;
|
|
28
|
+
afterStaleInspection?: (lockFile: string) => void | Promise<void>;
|
|
29
|
+
beforeStaleRemoval?: (lockFile: string) => void | Promise<void>;
|
|
30
|
+
afterTransitionStaleInspection?: (transitionFile: string) => void | Promise<void>;
|
|
31
|
+
beforeTransitionStaleRemoval?: (transitionFile: string) => void | Promise<void>;
|
|
32
|
+
afterLegacyDirectoryStaleVerdict?: (lockDir: string) => void | Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* @internal Which owner-access strategy to exercise, so the Windows path can be proved
|
|
35
|
+
* on the test filesystem this suite actually runs on. Production code never sets it,
|
|
36
|
+
* and it is never serialized or exposed as runtime configuration.
|
|
37
|
+
*/
|
|
38
|
+
ownerAccessStrategy?: SessionStateLockOwnerAccessStrategy;
|
|
39
|
+
/**
|
|
40
|
+
* @internal How an owner pid is probed for liveness. Whether a signal is permitted is a
|
|
41
|
+
* property of the OS and this process's privileges, so it cannot be arranged on disk.
|
|
42
|
+
* Production code never sets it, and it is never serialized or exposed as runtime
|
|
43
|
+
* configuration.
|
|
44
|
+
*/
|
|
45
|
+
probeProcessSignal?: (pid: number) => void;
|
|
46
|
+
/**
|
|
47
|
+
* @internal Runs inside a NEW owner record's write, after the exclusive create has
|
|
48
|
+
* taken the pathname and before the record's bytes land. Throwing from it fails that
|
|
49
|
+
* write exactly as an I/O fault does, which is the only deterministic way to reach the
|
|
50
|
+
* write-failure cleanup and prove what that cleanup is authorized to delete.
|
|
51
|
+
* Production code never sets it, and it is never serialized or exposed as runtime
|
|
52
|
+
* configuration.
|
|
53
|
+
*/
|
|
54
|
+
ownerRecordWriteFault?: (file: string) => void | Promise<void>;
|
|
55
|
+
beforeLegacyDirectoryRemoval?: (lockDir: string) => void | Promise<void>;
|
|
56
|
+
};
|
|
57
|
+
/** Raised when the lock could not be acquired; callers map it to their own refusal. */
|
|
58
|
+
export declare class SessionStateLockUnavailableError extends Error {
|
|
59
|
+
constructor(cause?: unknown);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The identity-bound deletion primitives this lock is built on.
|
|
63
|
+
*
|
|
64
|
+
* There is no portable atomic compare-and-delete in `fs`: validating a record and then
|
|
65
|
+
* unlinking its PATHNAME is always two syscalls, and a successor that claims the path in
|
|
66
|
+
* between loses its brand-new lock to the first reclaimer. These natives close that hole
|
|
67
|
+
* for real — every removal is descriptor-relative, no-follow, and refuses unless the
|
|
68
|
+
* object still carries the exact `dev`/`ino`/`nlink`/`size`/`mtimeNs`/SHA-256 identity the
|
|
69
|
+
* caller proved. A replacement is therefore never deleted, by construction rather than by
|
|
70
|
+
* a narrower window.
|
|
71
|
+
*/
|
|
72
|
+
export type SessionStateLockNativeBindings = Pick<typeof import("@gajae-code/natives"), "exactRemoveDirectoryTree" | "exactUnlink" | "snapshotDirectoryTree">;
|
|
73
|
+
/** How the deletion primitives are obtained. Throwing means they are unavailable. */
|
|
74
|
+
type SessionStateLockNativeLoader = () => SessionStateLockNativeBindings;
|
|
75
|
+
/**
|
|
76
|
+
* @internal The seam focused TS tests bind a faithful in-process implementation to.
|
|
77
|
+
*
|
|
78
|
+
* It exists because the deletion contract — "refuse unless the object on disk still has
|
|
79
|
+
* exactly this identity" — is the thing under test, and a test double that merely reports
|
|
80
|
+
* success would assert nothing.
|
|
81
|
+
*
|
|
82
|
+
* A LOADER rather than a value, so the unavailable case needs no special production
|
|
83
|
+
* branch: a loader that throws is indistinguishable from an addon that will not load,
|
|
84
|
+
* which is the only way to observe that path where the addon is present. Passing
|
|
85
|
+
* `undefined` restores the real addon.
|
|
86
|
+
*/
|
|
87
|
+
export declare function setSessionStateLockNativeBindings(load: SessionStateLockNativeLoader | undefined): void;
|
|
88
|
+
/**
|
|
89
|
+
* Decide what actually occupies the lock path, without following it.
|
|
90
|
+
*
|
|
91
|
+
* @internal exported as the seam these decisions are tested through: a live legacy
|
|
92
|
+
* directory owner must be provably left alone without waiting out a real stale window.
|
|
93
|
+
*/
|
|
94
|
+
export declare function reclaimStaleSessionStateLock(lockFile: string): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Serialize one read-modify-write of `stateFile` against every other holder of
|
|
97
|
+
* `<stateFile>.lock`.
|
|
98
|
+
*
|
|
99
|
+
* Taking the path, cleaning up a failed write, and releasing are all pathname transitions,
|
|
100
|
+
* so each runs under the transition claim — never the caller's operation, which holds the
|
|
101
|
+
* lock file itself and may run for as long as it needs.
|
|
102
|
+
*/
|
|
103
|
+
export declare function withSessionStateFileLock<T>(stateFile: string, operation: () => Promise<T>): Promise<T>;
|
|
104
|
+
export {};
|
|
@@ -19,6 +19,8 @@ export type RuntimeInputReadyMarker = Readonly<{
|
|
|
19
19
|
created_at: string;
|
|
20
20
|
}>;
|
|
21
21
|
export type RuntimeState = "ready_for_input" | "running" | "needs_user_input" | "completed" | "errored";
|
|
22
|
+
/** Recorded whenever the caller could not prove a canonical public label for a tool. */
|
|
23
|
+
export declare const UNPROVEN_TOOL_LABEL = "custom";
|
|
22
24
|
/** Test-only counters for runtime sidecar hot-path assertions. */
|
|
23
25
|
export declare const __sessionStateSidecarPerfCounters: {
|
|
24
26
|
persistFromEventCalls: number;
|
|
@@ -28,9 +30,117 @@ interface RuntimeStateEvent {
|
|
|
28
30
|
type: string;
|
|
29
31
|
messages?: unknown[];
|
|
30
32
|
toolCallId?: unknown;
|
|
31
|
-
toolName?: unknown;
|
|
32
33
|
isError?: unknown;
|
|
33
34
|
}
|
|
35
|
+
export type RuntimeToolActivityPhase = "started" | "finished";
|
|
36
|
+
/**
|
|
37
|
+
* A finished call's outcome. `cancelled` is the only honest answer for a call that was
|
|
38
|
+
* still in flight when the session settled: it neither succeeded nor failed, and nothing
|
|
39
|
+
* observed its end.
|
|
40
|
+
*/
|
|
41
|
+
export type RuntimeToolActivityOutcome = "success" | "failure" | "cancelled";
|
|
42
|
+
/**
|
|
43
|
+
* What a session is doing right now, split into a bounded public projection and the
|
|
44
|
+
* minimum private state needed to keep that projection exact.
|
|
45
|
+
*
|
|
46
|
+
* Deliberately carries no tool arguments, results, command text, paths, output, prompt or
|
|
47
|
+
* model text, environment values, or credentials — only a proven public tool label, a
|
|
48
|
+
* phase, and timing.
|
|
49
|
+
*/
|
|
50
|
+
export interface RuntimeToolActivity {
|
|
51
|
+
seq: number;
|
|
52
|
+
last_activity_at: string;
|
|
53
|
+
tool: string;
|
|
54
|
+
phase: RuntimeToolActivityPhase;
|
|
55
|
+
outcome: RuntimeToolActivityOutcome | null;
|
|
56
|
+
elapsed_ms: number | null;
|
|
57
|
+
/** Exact number of in-flight calls; derived with `active_tools`, so it can never be smaller. */
|
|
58
|
+
active_tool_count: number;
|
|
59
|
+
/** Public projection of the newest in-flight calls, capped at `MAX_ACTIVE_TOOL_ENTRIES`. */
|
|
60
|
+
active_tools: Array<{
|
|
61
|
+
tool: string;
|
|
62
|
+
started_at: string;
|
|
63
|
+
}>;
|
|
64
|
+
/**
|
|
65
|
+
* Private exact correlation state. Each digest is one-way over the session id and the
|
|
66
|
+
* tool call id, so no raw call id is persisted, and the whole field is stripped by
|
|
67
|
+
* `publicRuntimeToolActivity` before any coordinator reader sees the snapshot.
|
|
68
|
+
*/
|
|
69
|
+
in_flight: Array<{
|
|
70
|
+
digest: string;
|
|
71
|
+
tool: string;
|
|
72
|
+
started_at: string;
|
|
73
|
+
}>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Collapses anything the caller could not prove into `custom`.
|
|
77
|
+
*
|
|
78
|
+
* Public safety comes from the caller's proof plus this closed vocabulary, never from a
|
|
79
|
+
* syntax check: a label that merely looks like a token is still model-influenced text.
|
|
80
|
+
*/
|
|
81
|
+
export declare function safeRuntimeToolLabel(value: unknown): string;
|
|
82
|
+
export declare function toolActivityPhaseForEvent(event: RuntimeStateEvent): RuntimeToolActivityPhase | null;
|
|
83
|
+
export type RuntimeToolActivityReadout = {
|
|
84
|
+
kind: "absent";
|
|
85
|
+
} | {
|
|
86
|
+
kind: "malformed";
|
|
87
|
+
} | {
|
|
88
|
+
kind: "valid";
|
|
89
|
+
activity: RuntimeToolActivity;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Re-validates an activity snapshot read back from disk.
|
|
93
|
+
*
|
|
94
|
+
* `absent` and `malformed` are deliberately distinct outcomes: an absent snapshot may be
|
|
95
|
+
* seeded from sequence 1, while a malformed one must never be replaced by a lower
|
|
96
|
+
* sequence. The public counters are re-derived from the private in-flight table rather
|
|
97
|
+
* than trusted from disk, so a hand-edited file cannot publish a contradiction.
|
|
98
|
+
*/
|
|
99
|
+
export declare function classifyRuntimeToolActivity(value: unknown): RuntimeToolActivityReadout;
|
|
100
|
+
export declare function normalizedRuntimeToolActivity(value: unknown): RuntimeToolActivity | null;
|
|
101
|
+
/**
|
|
102
|
+
* The only activity shape a coordinator reader may see: the private correlation digests
|
|
103
|
+
* are dropped here, so no projection can leak them, and a snapshot that contradicts the
|
|
104
|
+
* lifecycle state it accompanies is withheld entirely.
|
|
105
|
+
*
|
|
106
|
+
* Withheld, never repaired: the bytes on disk are preserved exactly as written — a
|
|
107
|
+
* malformed or contradictory snapshot is evidence — while every public projection shows
|
|
108
|
+
* nothing rather than a reconciled guess.
|
|
109
|
+
*/
|
|
110
|
+
export declare function publicRuntimeToolActivity(value: unknown, lifecycleState: unknown): Record<string, unknown> | null;
|
|
111
|
+
/**
|
|
112
|
+
* What the caller observed at the exact moment the agent event was dispatched.
|
|
113
|
+
*
|
|
114
|
+
* Both the timestamp and the label are captured at that synchronous boundary, never
|
|
115
|
+
* re-derived here: a later lookup would see a tool registry that may already have been
|
|
116
|
+
* replaced, and a later clock reading would fold subscriber and lock latency into the
|
|
117
|
+
* measured interval.
|
|
118
|
+
*/
|
|
119
|
+
export interface CoordinatorToolObservation {
|
|
120
|
+
/** Canonical public label proven at the observation boundary; anything else is `custom`. */
|
|
121
|
+
label: string;
|
|
122
|
+
/** Wall clock captured when the agent event was observed, before any queueing or lock wait. */
|
|
123
|
+
observedAt: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Settle the activity snapshot a terminal lifecycle transition inherits.
|
|
127
|
+
*
|
|
128
|
+
* A settled session cannot still be running a tool, and later tool events are fenced out,
|
|
129
|
+
* so an unmatched start would otherwise leave a nonzero `active_tool_count` forever. The
|
|
130
|
+
* orphans are represented honestly — finished, `cancelled`, no elapsed interval — rather
|
|
131
|
+
* than claimed as a success or a failure nothing observed.
|
|
132
|
+
*
|
|
133
|
+
* The same helper serves the runtime `agent_end`/postmortem path and the Coordinator's
|
|
134
|
+
* canonical terminal repair so the two writers cannot settle differently.
|
|
135
|
+
*
|
|
136
|
+
* Two shapes need settling, not one. An orphaned in-flight call is the obvious case. The
|
|
137
|
+
* other is a `phase: started` snapshot with NOTHING correlated — a start whose call id was
|
|
138
|
+
* missing or blank never entered the in-flight table, so no end can ever close it — and
|
|
139
|
+
* leaving it would write the prohibited terminal+started pair, a settled session that
|
|
140
|
+
* still claims a tool is starting. An already-finished snapshot with nothing in flight is
|
|
141
|
+
* returned unchanged: a normal terminal transition is not an activity event.
|
|
142
|
+
*/
|
|
143
|
+
export declare function terminallySettledRuntimeToolActivity(value: unknown, observedAt: string): RuntimeToolActivityReadout;
|
|
34
144
|
export interface OwnerTerminalContext {
|
|
35
145
|
generation: string;
|
|
36
146
|
stateDir: string;
|
|
@@ -68,8 +178,16 @@ export declare function readTerminalRuntimeStateMarker(input: {
|
|
|
68
178
|
platform?: NodeJS.Platform;
|
|
69
179
|
}): Promise<TerminalRuntimeStateStatus>;
|
|
70
180
|
export declare function stateForEvent(event: RuntimeStateEvent): RuntimeState | null;
|
|
181
|
+
/** True for every event the coordinator-shared file records: lifecycle state or tool activity. */
|
|
71
182
|
export declare function eventAffectsCoordinatorRuntimeState(event: RuntimeStateEvent): boolean;
|
|
72
|
-
export declare function persistCoordinatorRuntimeStateFromEvent(event: RuntimeStateEvent, context: RuntimeStateContext
|
|
183
|
+
export declare function persistCoordinatorRuntimeStateFromEvent(event: RuntimeStateEvent, context: RuntimeStateContext,
|
|
184
|
+
/**
|
|
185
|
+
* What the caller observed at the synchronous agent-event boundary: the canonical
|
|
186
|
+
* public label it proved against the ACTIVE tool object, and the wall clock it read
|
|
187
|
+
* there. Without one, a tool event records `custom` at this writer's own clock — the
|
|
188
|
+
* sidecar never trusts a model-supplied name.
|
|
189
|
+
*/
|
|
190
|
+
observation?: CoordinatorToolObservation): Promise<void>;
|
|
73
191
|
export declare function ownerTerminalContextFromEnvironment(): OwnerTerminalContext | "invalid" | null;
|
|
74
192
|
export declare function persistCoordinatorRuntimeStateFromPostmortem(reason: postmortem.Reason, context: RuntimeStateContext): Promise<void>;
|
|
75
193
|
export declare function registerCoordinatorRuntimeStateFinalizer(context: RuntimeStateContext): () => void;
|
|
@@ -74,11 +74,19 @@ export type GuardedWriteResult = {
|
|
|
74
74
|
reason: "stale-skip";
|
|
75
75
|
revision: number;
|
|
76
76
|
};
|
|
77
|
+
export interface GuardedStateWriteReceipt {
|
|
78
|
+
path: string;
|
|
79
|
+
revision: number;
|
|
80
|
+
stamped: unknown;
|
|
81
|
+
}
|
|
82
|
+
export declare function guardedStateWriteReceipt(result: GuardedWriteResult): GuardedStateWriteReceipt | undefined;
|
|
77
83
|
export interface StateWriterOptions {
|
|
78
84
|
cwd?: string;
|
|
79
85
|
receipt?: StateWriterReceiptContext;
|
|
80
86
|
audit?: StateWriterAuditContext;
|
|
81
87
|
sourceRevision?: number;
|
|
88
|
+
/** Advance a cache source revision under the target lock when the value carries none. */
|
|
89
|
+
advanceSourceRevision?: boolean;
|
|
82
90
|
/**
|
|
83
91
|
* Cross-process lock tuning for read-modify-write paths that route through
|
|
84
92
|
* `withWorkflowStateLock` / `updateJsonAtomic`. Omit for the hardened
|
|
@@ -150,6 +158,7 @@ export declare function detectWorkflowEnvelopeIntegrityMismatch(filePath: string
|
|
|
150
158
|
type ActiveStateCacheInvalidator = (cwd?: string, sessionId?: string) => void;
|
|
151
159
|
export declare function setActiveStateCacheInvalidator(invalidator: ActiveStateCacheInvalidator): void;
|
|
152
160
|
export declare function persistedStateRevision(value: unknown): number;
|
|
161
|
+
export declare function matchesGuardedStateWriteReceipt(current: unknown, receipt: GuardedStateWriteReceipt): boolean;
|
|
153
162
|
export declare function writeGuardedJsonAtomic(targetPath: string, value: unknown, options: GuardedStateWriterOptions): Promise<GuardedWriteResult>;
|
|
154
163
|
export declare function writeGuardedWorkflowEnvelopeAtomic(targetPath: string, value: unknown, options: GuardedStateWriterOptions): Promise<GuardedWriteResult>;
|
|
155
164
|
export declare function writeJsonAtomic(targetPath: string, value: unknown, options?: StateWriterOptions): Promise<string>;
|
|
@@ -222,7 +231,7 @@ export declare function removeFileAudited(targetPath: string, options?: StateWri
|
|
|
222
231
|
* those entries, so concurrent snapshot rebuilds can race without losing any
|
|
223
232
|
* writer's per-skill state.
|
|
224
233
|
*/
|
|
225
|
-
export declare function writeActiveEntry(cwd: string, sessionScope: string | ActiveSessionScope | undefined, skill: string, entry: SkillActiveEntry, options?: StateWriterOptions): Promise<
|
|
234
|
+
export declare function writeActiveEntry(cwd: string, sessionScope: string | ActiveSessionScope | undefined, skill: string, entry: SkillActiveEntry, options?: StateWriterOptions): Promise<GuardedWriteResult>;
|
|
226
235
|
export declare function removeActiveEntry(cwd: string, sessionScope: string | ActiveSessionScope | undefined, skill: string, options?: StateWriterOptions): Promise<DeleteResult>;
|
|
227
236
|
export declare function readActiveEntries(cwd: string, sessionScope?: string | ActiveSessionScope): Promise<SkillActiveEntry[]>;
|
|
228
237
|
export declare function rebuildActiveSnapshot(cwd: string, sessionScope?: string | ActiveSessionScope, options?: StateWriterOptions): Promise<string>;
|
|
@@ -61,7 +61,7 @@ export declare function formatUltragoalNudgeMessage(input: {
|
|
|
61
61
|
* Resolves the active (leader) Ultragoal session so subagent/headless asks consume
|
|
62
62
|
* the leader run's budget rather than a fresh child ledger.
|
|
63
63
|
*/
|
|
64
|
-
export declare function consumeUltragoalAskNudge(cwd: string, sessionId?: string | null): Promise<{
|
|
64
|
+
export declare function consumeUltragoalAskNudge(cwd: string, sessionId?: string | null, agentDir?: string): Promise<{
|
|
65
65
|
nudged: true;
|
|
66
66
|
message: string;
|
|
67
67
|
} | {
|
|
@@ -71,6 +71,7 @@ export declare function assertCanCompleteCurrentGoal(input: {
|
|
|
71
71
|
cwd: string;
|
|
72
72
|
currentGoal?: CurrentGoalLike | null;
|
|
73
73
|
sessionId?: string | null;
|
|
74
|
+
agentDir?: string;
|
|
74
75
|
}): Promise<void>;
|
|
75
76
|
export declare function isUltragoalBypassPrompt(prompt: string): boolean;
|
|
76
77
|
export interface UltragoalPauseBlockDiagnostic {
|
|
@@ -85,7 +86,7 @@ export interface UltragoalPauseBlockDiagnostic {
|
|
|
85
86
|
* ledger data blocks pause rather than silently allowing a give-up.
|
|
86
87
|
*/
|
|
87
88
|
export declare function isUltragoalPauseBlocked(cwd: string): Promise<UltragoalPauseBlockDiagnostic>;
|
|
88
|
-
export declare function assertUltragoalPauseAllowed(cwd: string): Promise<void>;
|
|
89
|
+
export declare function assertUltragoalPauseAllowed(cwd: string, agentDir?: string): Promise<void>;
|
|
89
90
|
/**
|
|
90
91
|
* Guard `goal({"op":"drop"})` during an active Ultragoal run. A *real give-up* (an
|
|
91
92
|
* aggregate run still mid-flight with incomplete required stories) is nudged while
|
|
@@ -98,4 +99,5 @@ export declare function assertUltragoalDropAllowed(input: {
|
|
|
98
99
|
cwd: string;
|
|
99
100
|
currentGoal?: CurrentGoalLike | null;
|
|
100
101
|
sessionId?: string | null;
|
|
102
|
+
agentDir?: string;
|
|
101
103
|
}): Promise<void>;
|
|
@@ -170,11 +170,11 @@ export declare const DEFAULT_ULTRAGOAL_NUDGE_BUDGET = 10;
|
|
|
170
170
|
/** Pure: count ledger `nudge` rows for an exact goalId. */
|
|
171
171
|
export declare function countUltragoalNudges(ledger: readonly UltragoalLedgerEvent[], goalId: string): number;
|
|
172
172
|
/**
|
|
173
|
-
* Resolve the per-story nudge budget
|
|
174
|
-
*
|
|
175
|
-
*
|
|
173
|
+
* Resolve the per-story nudge budget through the shared five-layer resolver.
|
|
174
|
+
* Ultragoal stays tolerant: an invalid optional settings file continues to the
|
|
175
|
+
* next layer and finally to the built-in default (10).
|
|
176
176
|
*/
|
|
177
|
-
export declare function resolveUltragoalNudgeBudget(cwd: string): Promise<{
|
|
177
|
+
export declare function resolveUltragoalNudgeBudget(cwd: string, agentDir?: string): Promise<{
|
|
178
178
|
budget: number;
|
|
179
179
|
source: string;
|
|
180
180
|
}>;
|
|
@@ -210,7 +210,7 @@ export declare function writePlan(cwd: string, plan: UltragoalPlan, sessionId?:
|
|
|
210
210
|
export declare function nonEmptyString(value: unknown): string | null;
|
|
211
211
|
export declare function stringArray(value: unknown): string[] | null;
|
|
212
212
|
export declare function readUltragoalPlan(cwd: string, sessionId?: string | null): Promise<UltragoalPlan | null>;
|
|
213
|
-
export declare function getUltragoalStatus(cwd: string, sessionId?: string | null): Promise<UltragoalStatusSummary>;
|
|
213
|
+
export declare function getUltragoalStatus(cwd: string, sessionId?: string | null, agentDir?: string): Promise<UltragoalStatusSummary>;
|
|
214
214
|
export declare function buildUltragoalHudSummary(summary: UltragoalStatusSummary, latestLedger?: UltragoalLedgerEvent): WorkflowHudSummary;
|
|
215
215
|
export declare function createUltragoalPlan(input: {
|
|
216
216
|
cwd: string;
|
|
@@ -442,4 +442,6 @@ export declare class UltragoalReviewBlockerRecursionCapError extends Error {
|
|
|
442
442
|
constructor(blockedGoalId: string, unresolvedDescents: number, cap?: number);
|
|
443
443
|
}
|
|
444
444
|
export declare function runUltragoalReview(cwd: string, args: readonly string[]): Promise<UltragoalReviewResult>;
|
|
445
|
-
export declare function runNativeUltragoalCommand(args: string[], cwd?: string
|
|
445
|
+
export declare function runNativeUltragoalCommand(args: string[], cwd?: string, options?: {
|
|
446
|
+
agentDir?: string;
|
|
447
|
+
}): Promise<UltragoalCommandResult>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of precedence for the workflow settings surfaces.
|
|
3
|
+
*
|
|
4
|
+
* Every workflow runtime (ralplan, ultragoal, deep-interview) reads its
|
|
5
|
+
* settings through {@link resolveWorkflowSetting}; no runtime hand-rolls file
|
|
6
|
+
* discovery, YAML/JSON parsing, or key extraction. The precedence is fixed:
|
|
7
|
+
*
|
|
8
|
+
* 1. project `.gjc/config.yml`
|
|
9
|
+
* 2. user `<agentDir>/config.yml` (default `~/.gjc/agent/config.yml`)
|
|
10
|
+
* 3. built-in default
|
|
11
|
+
*
|
|
12
|
+
* Project configuration always beats user configuration, and `config.yml` is
|
|
13
|
+
* the primary settings surface: the legacy `settings.json` files (project and
|
|
14
|
+
* config-root) are retired, their workflow values migrated into `config.yml` by
|
|
15
|
+
* Settings once. The retained legacy source still applies while the migration
|
|
16
|
+
* has NOT durably recorded ownership/completion for its key: the project source
|
|
17
|
+
* until the per-key migrated-keys marker records the key, the config-root
|
|
18
|
+
* source until the migration retires it. A completed migration owns the value
|
|
19
|
+
* (a later `gjc config unset` sticks), so an owned key is never resurrected;
|
|
20
|
+
* the project legacy sits above the agent config.yml, the config-root legacy
|
|
21
|
+
* below it. Settings therefore writes exactly what the runtimes read: `gjc
|
|
22
|
+
* config set gjc.ralplan.maxIterations 7` is honored by ralplan.
|
|
23
|
+
*
|
|
24
|
+
* `config.yml` uses the nested schema form (`gjc: { ralplan: { maxIterations } }`);
|
|
25
|
+
* flat dotted keys are honored only while parsing a legacy `settings.json`
|
|
26
|
+
* during migration (see Settings) or the retained-legacy fallback layer.
|
|
27
|
+
*
|
|
28
|
+
* This module must stay pure and acyclic: it imports only path helpers and the
|
|
29
|
+
* pure `gjcRoot`/`dirs` utilities, never `Settings`, discovery/capability
|
|
30
|
+
* loaders, or workflow runtimes. All config/agent paths are constructed inside
|
|
31
|
+
* each resolver call (never at module scope) because `dirs.ts` caches directory
|
|
32
|
+
* resolution at module load.
|
|
33
|
+
*/
|
|
34
|
+
export type WorkflowSettingKey = "gjc.deepInterview.ambiguityThreshold" | "gjc.ralplan.autoHandoff" | "gjc.ralplan.maxIterations" | "gjc.ralplan.maxReviewPassesPerLane" | "gjc.ultragoal.nudgeBudget";
|
|
35
|
+
export type WorkflowSettingLayer = "project-config" | "agent-config";
|
|
36
|
+
export type WorkflowSettingParseResult<T> = {
|
|
37
|
+
kind: "valid";
|
|
38
|
+
value: T;
|
|
39
|
+
} | {
|
|
40
|
+
kind: "invalid";
|
|
41
|
+
reason: string;
|
|
42
|
+
};
|
|
43
|
+
export type WorkflowSettingDiagnosticStatus = "missing-file" | "empty-document" | "missing-key" | "invalid" | "valid";
|
|
44
|
+
export interface WorkflowSettingDiagnostic {
|
|
45
|
+
layer: WorkflowSettingLayer;
|
|
46
|
+
/** Lexical absolute candidate; missing paths stay actionable. */
|
|
47
|
+
path: string;
|
|
48
|
+
format: "yaml" | "json";
|
|
49
|
+
status: WorkflowSettingDiagnosticStatus;
|
|
50
|
+
classification?: "read" | "syntax" | "shape" | "value";
|
|
51
|
+
reason?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ResolveWorkflowSettingOptions<T> {
|
|
54
|
+
defaultValue: T;
|
|
55
|
+
parse: (value: unknown) => WorkflowSettingParseResult<T>;
|
|
56
|
+
/** Omitted means "continue"; ralplan passes "throw" explicitly. */
|
|
57
|
+
invalidPolicy?: "throw" | "continue";
|
|
58
|
+
/**
|
|
59
|
+
* The session's effective agent directory. Defaults to the process-global
|
|
60
|
+
* `getAgentDir()`; an SDK embedder that created the session with
|
|
61
|
+
* `createAgentSession({ agentDir })` must pass that directory here so the
|
|
62
|
+
* agent-config layer matches the profile `Settings.init` loaded and
|
|
63
|
+
* migrated, instead of inheriting an unrelated default-profile value.
|
|
64
|
+
*/
|
|
65
|
+
agentDir?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface WorkflowSettingResolution<T> {
|
|
68
|
+
value: T;
|
|
69
|
+
/** Canonical realpath for a winning existing file, or "default". */
|
|
70
|
+
source: string;
|
|
71
|
+
diagnostics: readonly WorkflowSettingDiagnostic[];
|
|
72
|
+
}
|
|
73
|
+
export type WorkflowSettingInvalidClassification = "read" | "syntax" | "shape" | "value";
|
|
74
|
+
/** Raised under the strict ("throw") invalid policy; stable properties for callers. */
|
|
75
|
+
export declare class WorkflowSettingError extends Error {
|
|
76
|
+
readonly diagnostic: WorkflowSettingDiagnostic;
|
|
77
|
+
readonly path: string;
|
|
78
|
+
readonly layer: WorkflowSettingLayer;
|
|
79
|
+
readonly classification: WorkflowSettingInvalidClassification;
|
|
80
|
+
readonly reason: string;
|
|
81
|
+
constructor(diagnostic: WorkflowSettingDiagnostic & {
|
|
82
|
+
classification: WorkflowSettingInvalidClassification;
|
|
83
|
+
reason: string;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Extract a workflow key from a parsed settings document. Flat dotted keys are
|
|
88
|
+
* honored only while parsing a legacy `settings.json` during migration (see
|
|
89
|
+
* Settings) - `config.yml` uses the nested (schema) form, so the public
|
|
90
|
+
* Settings/config CLI path (which addresses nested paths) can manage every
|
|
91
|
+
* effective override. Flat keys are checked before the nested `gjc: { ... }`
|
|
92
|
+
* shape (flat wins); an explicitly present `undefined` value counts as present.
|
|
93
|
+
*/
|
|
94
|
+
export declare function extractWorkflowSetting(document: unknown, key: WorkflowSettingKey, options?: {
|
|
95
|
+
flat?: boolean;
|
|
96
|
+
}): {
|
|
97
|
+
present: boolean;
|
|
98
|
+
value: unknown;
|
|
99
|
+
malformedParent?: boolean;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Resolve a workflow setting across the fixed three-layer precedence (project
|
|
103
|
+
* `.gjc/config.yml`, then user `<agentDir>/config.yml`, then the built-in
|
|
104
|
+
* default). Returns the first valid configured value, otherwise
|
|
105
|
+
* {@link options.defaultValue} with `source: "default"`. Diagnostics are
|
|
106
|
+
* retained for unit tests and optional logging; runtime public wrappers expose
|
|
107
|
+
* their existing compact result shapes.
|
|
108
|
+
*/
|
|
109
|
+
export declare function resolveWorkflowSetting<T>(cwd: string, key: WorkflowSettingKey, options: ResolveWorkflowSettingOptions<T>): Promise<WorkflowSettingResolution<T>>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** Stable canonical names used to compare hook surfaces without replacing runtime event types. */
|
|
2
|
+
export declare const HookEventKind: {
|
|
3
|
+
readonly UserPromptSubmit: "user_prompt_submit";
|
|
4
|
+
readonly PreToolUse: "pre_tool_use";
|
|
5
|
+
readonly PostToolUse: "post_tool_use";
|
|
6
|
+
readonly Stop: "stop";
|
|
7
|
+
readonly SessionStart: "session_start";
|
|
8
|
+
readonly SessionShutdown: "session_shutdown";
|
|
9
|
+
};
|
|
10
|
+
export type HookEventKind = (typeof HookEventKind)[keyof typeof HookEventKind];
|
|
11
|
+
export declare const HookAuthority: {
|
|
12
|
+
readonly Constrained: "constrained";
|
|
13
|
+
readonly Command: "command";
|
|
14
|
+
readonly InProcess: "in-process";
|
|
15
|
+
};
|
|
16
|
+
export type HookAuthority = (typeof HookAuthority)[keyof typeof HookAuthority];
|
|
17
|
+
export declare const HookSourceConvention: {
|
|
18
|
+
readonly NativeGjc: "native-gjc";
|
|
19
|
+
readonly ClaudeCode: "claude-code";
|
|
20
|
+
readonly Codex: "codex";
|
|
21
|
+
readonly CodexManagedJson: "codex-managed-json";
|
|
22
|
+
readonly GjcPlugin: "gjc-plugin";
|
|
23
|
+
readonly InProcess: "in-process";
|
|
24
|
+
};
|
|
25
|
+
export type HookSourceConvention = (typeof HookSourceConvention)[keyof typeof HookSourceConvention];
|
|
26
|
+
export interface HookEventSchemaContract {
|
|
27
|
+
kind: HookEventKind;
|
|
28
|
+
input: string;
|
|
29
|
+
output: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Canonical schema references. These point at existing runtime types; they are not a
|
|
33
|
+
* second runtime event union and do not change payloads dispatched by the hook runners.
|
|
34
|
+
*/
|
|
35
|
+
export declare const HOOK_EVENT_SCHEMAS: Record<HookEventKind, HookEventSchemaContract>;
|
|
36
|
+
export type HookOrdering = "sequential" | "external-runtime";
|
|
37
|
+
export type HookAwaitBehavior = "awaited" | "external-runtime";
|
|
38
|
+
export type HookErrorBehavior = "isolate" | "fail-closed" | "external-runtime";
|
|
39
|
+
export type HookProcessAuthority = "none" | "hook-api" | "command" | "ambient-host";
|
|
40
|
+
export type HookTrustRequirement = "not-enforced" | "provider-owned";
|
|
41
|
+
export type HookRedaction = "none" | "provider-owned";
|
|
42
|
+
export interface HookExecutionContract {
|
|
43
|
+
kind: HookEventKind;
|
|
44
|
+
runtimeEvent: string;
|
|
45
|
+
authority: HookAuthority;
|
|
46
|
+
awaitBehavior: HookAwaitBehavior;
|
|
47
|
+
ordering: HookOrdering;
|
|
48
|
+
canCancel: boolean;
|
|
49
|
+
mutation: readonly string[];
|
|
50
|
+
timeoutMs: number | null;
|
|
51
|
+
errorBehavior: HookErrorBehavior;
|
|
52
|
+
processAuthority: HookProcessAuthority;
|
|
53
|
+
trustRequirement: HookTrustRequirement;
|
|
54
|
+
redaction: HookRedaction;
|
|
55
|
+
logging: string;
|
|
56
|
+
semanticNotes: string;
|
|
57
|
+
}
|
|
58
|
+
/** Per-convention execution truth. Missing entries are unsupported. */
|
|
59
|
+
export declare const CONVENTION_EVENT_CONTRACTS: Record<HookSourceConvention, Partial<Record<HookEventKind, HookExecutionContract>>>;
|
|
60
|
+
export declare const EXTERNAL_EVENT_ALIASES: Readonly<Record<string, HookEventKind>>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { type HookAuthority, HookEventKind, type HookExecutionContract, HookSourceConvention } from "./events";
|
|
2
|
+
export declare const HookDiagnosticSeverity: {
|
|
3
|
+
readonly Error: "error";
|
|
4
|
+
readonly Warning: "warning";
|
|
5
|
+
};
|
|
6
|
+
export type HookDiagnosticSeverity = (typeof HookDiagnosticSeverity)[keyof typeof HookDiagnosticSeverity];
|
|
7
|
+
export declare const HookDiagnosticCode: {
|
|
8
|
+
readonly UnsupportedConventionEvent: "unsupported_convention_event";
|
|
9
|
+
readonly UnrecognizedPluginEvent: "unrecognized_plugin_event";
|
|
10
|
+
readonly InvalidPluginPhase: "invalid_plugin_phase";
|
|
11
|
+
readonly InvalidToolMatcher: "invalid_tool_matcher";
|
|
12
|
+
readonly InvalidSource: "invalid_source";
|
|
13
|
+
readonly InvalidCommand: "invalid_command";
|
|
14
|
+
readonly DuplicateHook: "duplicate_hook";
|
|
15
|
+
readonly InProcessEventOutsideIr: "in_process_event_outside_hook_ir";
|
|
16
|
+
readonly SemanticMismatch: "semantic_mismatch";
|
|
17
|
+
};
|
|
18
|
+
export type HookDiagnosticCode = (typeof HookDiagnosticCode)[keyof typeof HookDiagnosticCode];
|
|
19
|
+
export interface HookNormalizationDiagnostic {
|
|
20
|
+
severity: HookDiagnosticSeverity;
|
|
21
|
+
code: HookDiagnosticCode;
|
|
22
|
+
message: string;
|
|
23
|
+
convention: HookSourceConvention;
|
|
24
|
+
externalEvent?: string;
|
|
25
|
+
canonicalKind?: HookEventKind;
|
|
26
|
+
source?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface NormalizedHook {
|
|
29
|
+
kind: HookEventKind;
|
|
30
|
+
authority: HookAuthority;
|
|
31
|
+
convention: HookSourceConvention;
|
|
32
|
+
runtimeEvent: string;
|
|
33
|
+
toolName: string;
|
|
34
|
+
source: string;
|
|
35
|
+
contract: HookExecutionContract;
|
|
36
|
+
}
|
|
37
|
+
export interface NormalizeHookResult {
|
|
38
|
+
hook: NormalizedHook | null;
|
|
39
|
+
diagnostics: HookNormalizationDiagnostic[];
|
|
40
|
+
}
|
|
41
|
+
export declare function resolveExecutionContract(convention: HookSourceConvention, kind: HookEventKind): HookExecutionContract | null;
|
|
42
|
+
export declare function resolveAuthority(convention: HookSourceConvention, kind: HookEventKind): HookAuthority | null;
|
|
43
|
+
export declare function resolveCanonicalKind(externalEvent: string): HookEventKind | null;
|
|
44
|
+
export declare function unsupportedEventDiagnostic(convention: HookSourceConvention, externalEvent: string, canonicalKind: HookEventKind | null, source?: string): HookNormalizationDiagnostic;
|
|
45
|
+
/** Tool identifiers are logical, case-sensitive runtime names, not filesystem paths. */
|
|
46
|
+
export declare function normalizeToolMatcher(toolName: unknown): string | null;
|
|
47
|
+
export interface DirectoryHookInput {
|
|
48
|
+
convention: HookSourceConvention;
|
|
49
|
+
phase: "pre" | "post";
|
|
50
|
+
toolName: string;
|
|
51
|
+
source: string;
|
|
52
|
+
/** Original discovered filename, when normalization participates in discovery. */
|
|
53
|
+
externalName?: string;
|
|
54
|
+
}
|
|
55
|
+
/** Normalize discovery metadata for native, Claude, or Codex hook modules. */
|
|
56
|
+
export declare function normalizeDirectoryHook(input: DirectoryHookInput): NormalizeHookResult;
|
|
57
|
+
export interface ManagedJsonHookInput {
|
|
58
|
+
externalEvent: string;
|
|
59
|
+
command: string;
|
|
60
|
+
source: string;
|
|
61
|
+
}
|
|
62
|
+
/** Normalize the two GJC-managed Codex hooks.json entries. */
|
|
63
|
+
export declare function normalizeManagedJsonHook(input: ManagedJsonHookInput): NormalizeHookResult;
|
|
64
|
+
export interface PluginHookInput {
|
|
65
|
+
declaredEvent: string;
|
|
66
|
+
target?: unknown;
|
|
67
|
+
phase?: unknown;
|
|
68
|
+
plugin: string;
|
|
69
|
+
source: string;
|
|
70
|
+
}
|
|
71
|
+
/** Normalize only manifest shapes that the constrained plugin compiler accepts. */
|
|
72
|
+
export declare function normalizePluginHook(input: PluginHookInput): NormalizeHookResult;
|
|
73
|
+
export interface InProcessHookInput {
|
|
74
|
+
registeredEvent: string;
|
|
75
|
+
source: string;
|
|
76
|
+
}
|
|
77
|
+
export declare function normalizeInProcessHook(input: InProcessHookInput): NormalizeHookResult;
|
|
78
|
+
export interface BatchNormalizeResult {
|
|
79
|
+
hooks: NormalizedHook[];
|
|
80
|
+
diagnostics: HookNormalizationDiagnostic[];
|
|
81
|
+
}
|
|
82
|
+
/** Stable first-wins deduplication; rejected and duplicate entries remain visible as diagnostics. */
|
|
83
|
+
export declare function normalizeHookBatch(results: ReadonlyArray<NormalizeHookResult>): BatchNormalizeResult;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type SkillActiveState } from "../skill-state/active-state";
|
|
1
|
+
import { type SkillDiscoverySettings } from "../config/skill-settings-defaults";
|
|
2
|
+
import { type SkillActiveEntry, type SkillActiveState } from "../skill-state/active-state";
|
|
3
3
|
import { initialPhaseForSkill } from "../skill-state/initial-phase";
|
|
4
4
|
export { initialPhaseForSkill };
|
|
5
5
|
import { type GjcWorkflowSkill } from "./skill-keywords";
|
|
@@ -75,6 +75,12 @@ export interface EnsureWorkflowSkillActivationInput {
|
|
|
75
75
|
turnId?: string;
|
|
76
76
|
nowIso?: string;
|
|
77
77
|
stateDir?: string;
|
|
78
|
+
activeSubskills?: SkillActiveEntry["active_subskills"];
|
|
79
|
+
}
|
|
80
|
+
export interface WorkflowSkillActivationSeed {
|
|
81
|
+
state: SkillActiveState | null;
|
|
82
|
+
seeded: boolean;
|
|
83
|
+
rollback(): Promise<boolean>;
|
|
78
84
|
}
|
|
79
85
|
/**
|
|
80
86
|
* Idempotently seed `.gjc/state` for a workflow skill that was invoked directly
|
|
@@ -87,6 +93,7 @@ export interface EnsureWorkflowSkillActivationInput {
|
|
|
87
93
|
* `handoff_from`/`handoff_at` lineage), nothing is written so lineage is
|
|
88
94
|
* preserved. Non-workflow skills are ignored.
|
|
89
95
|
*/
|
|
96
|
+
export declare function ensureWorkflowSkillActivationSeed(input: EnsureWorkflowSkillActivationInput): Promise<WorkflowSkillActivationSeed>;
|
|
90
97
|
export declare function ensureWorkflowSkillActivationState(input: EnsureWorkflowSkillActivationInput): Promise<SkillActiveState | null>;
|
|
91
98
|
export declare function buildActiveUltragoalPromptContext(input: UserPromptSubmitStateInput): Promise<string | null>;
|
|
92
99
|
export declare function buildSkillStopOutput(input: StopHookInput): Promise<Record<string, unknown> | null>;
|
package/dist/types/main.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export declare function initializeInteractiveModeWithStartupUpdate(mode: Startup
|
|
|
41
41
|
* Every other local-session flag is rejected so the broker-backed ACP host
|
|
42
42
|
* never appears to accept options it cannot apply to its remote session.
|
|
43
43
|
*/
|
|
44
|
-
export declare function resolveAcpStartupOptions(parsed: Pick<Args, "allowHome" | "apiKey" | "appendSystemPrompt" | "credential" | "continue" | "default" | "cwd" | "fileArgs" | "fork" | "hooks" | "messages" | "mpreset" | "mcpConfig" | "model" | "models" | "noLsp" | "noPty" | "noRules" | "noSession" | "noSkills" | "noTitle" | "noTools" | "pluginDirs" | "print" | "provider" | "providerSessionId" | "resume" | "sessionDir" | "skills" | "slow" | "smol" | "plan" | "systemPrompt" | "thinking" | "tmux" | "tools" | "extensions" | "unknownFlags">, sessionOptions: Pick<CreateAgentSessionOptions, "model" | "modelPattern" | "thinkingLevel">): AcpStartupOptions;
|
|
44
|
+
export declare function resolveAcpStartupOptions(parsed: Pick<Args, "allowHome" | "apiKey" | "appendSystemPrompt" | "credential" | "preferCredential" | "continue" | "default" | "cwd" | "fileArgs" | "fork" | "hooks" | "messages" | "mpreset" | "mcpConfig" | "model" | "models" | "noLsp" | "noMcp" | "noPty" | "noRules" | "noSession" | "noSkills" | "noTitle" | "noTools" | "pluginDirs" | "print" | "provider" | "providerSessionId" | "resume" | "sessionDir" | "skills" | "slow" | "smol" | "plan" | "systemPrompt" | "thinking" | "tmux" | "tools" | "extensions" | "unknownFlags">, sessionOptions: Pick<CreateAgentSessionOptions, "model" | "modelPattern" | "thinkingLevel">): AcpStartupOptions;
|
|
45
45
|
declare function readPipedInput(): Promise<string | undefined>;
|
|
46
46
|
export interface InteractiveModeNotify {
|
|
47
47
|
kind: "warn" | "error" | "info";
|
|
@@ -132,6 +132,7 @@ export interface RunRootCommandDependencies {
|
|
|
132
132
|
getChangelogForDisplay?: typeof getChangelogForDisplay;
|
|
133
133
|
createInteractiveMode?: CreateInteractiveMode;
|
|
134
134
|
runPrintMode?: RunPrintMode;
|
|
135
|
+
quit?: (code: number) => Promise<void>;
|
|
135
136
|
isResumePickerTerminal?: ResumePickerTerminalCheck;
|
|
136
137
|
listForResumePickerReadOnly?: ListForResumePickerReadOnly;
|
|
137
138
|
listManagedForResumePickerReadOnly?: ListManagedForResumePickerReadOnly;
|