@gajae-code/coding-agent 0.11.1 → 0.11.2
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 +54 -0
- package/dist/types/cli/config-cli.d.ts +11 -1
- package/dist/types/cli/notify-cli.d.ts +1 -0
- package/dist/types/cli/session-picker.d.ts +2 -1
- package/dist/types/cli/setup-cli.d.ts +1 -1
- package/dist/types/commands/mcp-serve.d.ts +33 -0
- package/dist/types/commands/mcp.d.ts +1 -1
- package/dist/types/commands/notify.d.ts +0 -2
- package/dist/types/commands/sdk.d.ts +1 -1
- package/dist/types/config/atomic-yaml-patch.d.ts +18 -0
- package/dist/types/config/file-lock.d.ts +14 -4
- package/dist/types/config/keybindings.d.ts +42 -1
- package/dist/types/config/model-auth.d.ts +3 -0
- package/dist/types/config/model-bindings-applier.d.ts +13 -0
- package/dist/types/config/model-discovery-manager.d.ts +49 -0
- package/dist/types/config/model-equivalence.d.ts +20 -0
- package/dist/types/config/model-registry.d.ts +16 -15
- package/dist/types/config/model-resolver.d.ts +28 -18
- package/dist/types/config/models-config-schema.d.ts +11 -0
- package/dist/types/config/settings-schema.d.ts +56 -1
- package/dist/types/config/settings.d.ts +14 -11
- package/dist/types/coordinator-mcp/policy.d.ts +5 -0
- package/dist/types/coordinator-mcp/question-gate-codec.d.ts +129 -0
- package/dist/types/coordinator-mcp/question-state.d.ts +356 -0
- package/dist/types/coordinator-mcp/server.d.ts +4 -0
- package/dist/types/discovery/helpers.d.ts +0 -6
- package/dist/types/edit/index.d.ts +3 -0
- package/dist/types/eval/py/env.d.ts +9 -0
- package/dist/types/extensibility/extensions/loader.d.ts +2 -1
- package/dist/types/extensibility/extensions/runner.d.ts +2 -2
- package/dist/types/extensibility/extensions/types.d.ts +34 -3
- package/dist/types/extensibility/hooks/runner.d.ts +1 -1
- package/dist/types/extensibility/shared-events.d.ts +2 -0
- package/dist/types/gjc-runtime/deep-interview-recorder.d.ts +10 -1
- package/dist/types/gjc-runtime/deep-interview-state.d.ts +44 -0
- package/dist/types/gjc-runtime/goal-mode-request.d.ts +11 -1
- package/dist/types/gjc-runtime/launch-worktree.d.ts +4 -2
- package/dist/types/gjc-runtime/linux-proc.d.ts +29 -0
- package/dist/types/gjc-runtime/session-resolution.d.ts +2 -2
- package/dist/types/gjc-runtime/state-migrations.d.ts +1 -1
- package/dist/types/gjc-runtime/state-writer.d.ts +2 -1
- package/dist/types/gjc-runtime/team-launch.d.ts +59 -0
- package/dist/types/gjc-runtime/team-notify.d.ts +45 -0
- package/dist/types/gjc-runtime/team-runtime.d.ts +29 -121
- package/dist/types/gjc-runtime/team-store.d.ts +160 -0
- package/dist/types/gjc-runtime/team-workers.d.ts +78 -0
- package/dist/types/gjc-runtime/tmux-owner-isolation.d.ts +8 -0
- package/dist/types/gjc-runtime/ultragoal-change-set.d.ts +13 -0
- package/dist/types/gjc-runtime/ultragoal-evidence.d.ts +38 -0
- package/dist/types/gjc-runtime/ultragoal-guard.d.ts +7 -0
- package/dist/types/gjc-runtime/ultragoal-pipeline.d.ts +23 -0
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +55 -33
- package/dist/types/gjc-runtime/workflow-cli-common.d.ts +8 -0
- package/dist/types/gjc-runtime/workflow-manifest.d.ts +3 -0
- package/dist/types/goals/continuation-timeout-guard.d.ts +22 -0
- package/dist/types/goals/runtime.d.ts +1 -0
- package/dist/types/goals/state.d.ts +8 -0
- package/dist/types/harness-control-plane/lifecycle-reconciliation.d.ts +17 -0
- package/dist/types/harness-control-plane/phase-rollup.d.ts +4 -7
- package/dist/types/harness-control-plane/receipt-ingest.d.ts +5 -0
- package/dist/types/harness-control-plane/receipt-spool.d.ts +4 -0
- package/dist/types/hindsight/state.d.ts +11 -4
- package/dist/types/lsp/lspmux.d.ts +5 -3
- package/dist/types/lsp/path-trust.d.ts +1 -0
- package/dist/types/main.d.ts +3 -2
- package/dist/types/memories/storage.d.ts +1 -0
- package/dist/types/modes/action-registry.d.ts +29 -0
- package/dist/types/modes/components/chrome.d.ts +14 -0
- package/dist/types/modes/components/command-palette.d.ts +27 -0
- package/dist/types/modes/components/custom-provider-wizard.d.ts +1 -0
- package/dist/types/modes/components/index.d.ts +2 -1
- package/dist/types/modes/components/pet-selector.d.ts +1 -1
- package/dist/types/modes/components/plan-preview-overlay.d.ts +43 -0
- package/dist/types/modes/components/queue-mode-selector.d.ts +1 -1
- package/dist/types/modes/components/queue-pane.d.ts +12 -0
- package/dist/types/modes/components/read-tool-group.d.ts +6 -0
- package/dist/types/modes/components/session-observer-overlay.d.ts +3 -4
- package/dist/types/modes/components/sessions-dashboard.d.ts +32 -0
- package/dist/types/modes/components/settings-selector.d.ts +1 -1
- package/dist/types/modes/components/show-images-selector.d.ts +1 -1
- package/dist/types/modes/components/status-line/types.d.ts +1 -1
- package/dist/types/modes/components/status-line.d.ts +1 -94
- package/dist/types/modes/components/tasks-pane.d.ts +15 -0
- package/dist/types/modes/components/theme-selector.d.ts +1 -1
- package/dist/types/modes/components/tool-execution.d.ts +15 -0
- package/dist/types/modes/components/tool-status-header.d.ts +111 -0
- package/dist/types/modes/components/transcript-viewer-overlay.d.ts +42 -0
- package/dist/types/modes/controllers/goal-mode-controller.d.ts +62 -0
- package/dist/types/modes/controllers/input-controller.d.ts +8 -1
- package/dist/types/modes/controllers/mode-gate.d.ts +8 -0
- package/dist/types/modes/controllers/plan-mode-controller.d.ts +65 -0
- package/dist/types/modes/controllers/selector-controller.d.ts +15 -3
- package/dist/types/modes/controllers/stt-controller.d.ts +26 -0
- package/dist/types/modes/interactive-mode.d.ts +19 -17
- package/dist/types/modes/jobs-observer.d.ts +2 -0
- package/dist/types/modes/shared/agent-wire/deep-interview-gate.d.ts +4 -11
- package/dist/types/modes/shared/agent-wire/workflow-gate-broker.d.ts +20 -2
- package/dist/types/modes/shared/agent-wire/workflow-gate-types.d.ts +31 -0
- package/dist/types/modes/tasks-aggregator.d.ts +39 -0
- package/dist/types/modes/transcript-item-registry.d.ts +60 -0
- package/dist/types/modes/types.d.ts +20 -13
- package/dist/types/modes/utils/ui-helpers.d.ts +2 -2
- package/dist/types/runtime-mcp/manager.d.ts +1 -1
- package/dist/types/sdk/broker/broker.d.ts +78 -12
- package/dist/types/sdk/broker/lifecycle-codec.d.ts +4 -0
- package/dist/types/sdk/broker/lifecycle-ledger.d.ts +15 -1
- package/dist/types/sdk/broker/lifecycle.d.ts +6 -2
- package/dist/types/sdk/broker/process-incarnation.d.ts +2 -0
- package/dist/types/sdk/broker/session-index.d.ts +0 -1
- package/dist/types/sdk/broker/state-version.d.ts +2 -0
- package/dist/types/sdk/bus/chat-effect-journal.d.ts +1 -0
- package/dist/types/sdk/bus/config-commands.d.ts +1 -1
- package/dist/types/sdk/bus/config.d.ts +11 -0
- package/dist/types/sdk/bus/daemon-paths.d.ts +1 -0
- package/dist/types/sdk/bus/html-format.d.ts +3 -2
- package/dist/types/sdk/bus/index.d.ts +27 -0
- package/dist/types/sdk/bus/lifecycle-control-runtime.d.ts +4 -0
- package/dist/types/sdk/bus/notification-service.d.ts +20 -0
- package/dist/types/sdk/bus/rate-limit-pool.d.ts +13 -2
- package/dist/types/sdk/bus/recent-activity.d.ts +21 -12
- package/dist/types/sdk/bus/rich-document.d.ts +7 -0
- package/dist/types/sdk/bus/rich-render.d.ts +18 -41
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +9 -4
- package/dist/types/sdk/bus/telegram-daemon.d.ts +46 -3
- package/dist/types/sdk/bus/threaded-inbound.d.ts +1 -1
- package/dist/types/sdk/bus/threaded-render.d.ts +13 -0
- package/dist/types/sdk/bus/topic-registry.d.ts +24 -2
- package/dist/types/sdk/host/control/operations.d.ts +1 -1
- package/dist/types/sdk/host/host.d.ts +2 -0
- package/dist/types/sdk/index.d.ts +1 -0
- package/dist/types/sdk/session-directory.d.ts +56 -0
- package/dist/types/session/agent-session.d.ts +82 -47
- package/dist/types/session/agent-storage.d.ts +7 -0
- package/dist/types/session/fallback-chain-controller.d.ts +10 -2
- package/dist/types/session/internal/managed-session-scope.d.ts +102 -0
- package/dist/types/session/internal/managed-session-storage.d.ts +38 -0
- package/dist/types/session/messages.d.ts +16 -0
- package/dist/types/session/session-manager-internal.d.ts +14 -0
- package/dist/types/session/session-manager.d.ts +82 -12
- package/dist/types/session/session-storage.d.ts +43 -3
- package/dist/types/session/volatile-context-pruning.d.ts +15 -0
- package/dist/types/skill-state/{deep-interview-mutation-guard.d.ts → workflow-mutation-guard.d.ts} +24 -8
- package/dist/types/skill-state/workflow-state-contract.d.ts +1 -3
- package/dist/types/slash-commands/builtin-registry.d.ts +4 -1
- package/dist/types/system-prompt.d.ts +2 -11
- package/dist/types/task/executor.d.ts +3 -1
- package/dist/types/thinking.d.ts +7 -0
- package/dist/types/tool-discovery/tool-index.d.ts +1 -50
- package/dist/types/tools/ask.d.ts +64 -2
- package/dist/types/tools/bash.d.ts +3 -0
- package/dist/types/tools/browser/dead-tab-recovery.d.ts +24 -0
- package/dist/types/tools/browser/tab-supervisor.d.ts +21 -0
- package/dist/types/tools/cron.d.ts +2 -0
- package/dist/types/tools/fetch.d.ts +1 -0
- package/dist/types/tools/index.d.ts +30 -15
- package/dist/types/tools/output-meta.d.ts +1 -0
- package/dist/types/tools/read.d.ts +3 -0
- package/dist/types/tools/search-tool-bm25.d.ts +3 -4
- package/dist/types/utils/event-bus.d.ts +1 -1
- package/dist/types/web/search/index.d.ts +3 -1
- package/package.json +21 -9
- package/scripts/build-sdk-package-smoke.ts +34 -1
- package/scripts/generate-hotkeys-docs.ts +74 -0
- package/scripts/generate-sdk-operation-inventory.ts +64 -20
- package/scripts/verify-gjc-sdk-canonicalization.ts +182 -2
- package/src/async/job-manager.ts +49 -6
- package/src/cli/config-cli.ts +75 -2
- package/src/cli/notify-cli.ts +92 -26
- package/src/cli/session-picker.ts +20 -3
- package/src/cli/setup-cli.ts +1 -1
- package/src/cli.ts +1 -1
- package/src/commands/config.ts +1 -1
- package/src/commands/harness.ts +34 -106
- package/src/commands/launch.ts +6 -4
- package/src/commands/mcp-serve.ts +85 -8
- package/src/commands/mcp.ts +2 -2
- package/src/commands/notify.ts +8 -4
- package/src/commands/sdk.ts +61 -40
- package/src/commands/ultragoal.ts +4 -1
- package/src/config/atomic-yaml-patch.ts +80 -13
- package/src/config/file-lock.ts +105 -43
- package/src/config/keybindings.ts +64 -20
- package/src/config/model-auth.ts +9 -0
- package/src/config/model-bindings-applier.ts +139 -0
- package/src/config/model-discovery-manager.ts +224 -0
- package/src/config/model-equivalence.ts +66 -0
- package/src/config/model-registry.ts +169 -302
- package/src/config/model-resolver.ts +361 -369
- package/src/config/models-config-schema.ts +5 -4
- package/src/config/settings-schema.ts +159 -2
- package/src/config/settings.ts +458 -482
- package/src/coordinator-mcp/policy.ts +76 -11
- package/src/coordinator-mcp/question-gate-codec.ts +274 -0
- package/src/coordinator-mcp/question-state.ts +778 -0
- package/src/coordinator-mcp/server.ts +1702 -238
- package/src/debug/index.ts +1 -1
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +13 -1
- package/src/defaults/gjc/skills/team/SKILL.md +16 -0
- package/src/discovery/helpers.ts +1 -50
- package/src/edit/index.ts +64 -0
- package/src/eval/py/env.ts +26 -0
- package/src/eval/py/kernel.ts +5 -3
- package/src/extensibility/extensions/loader.ts +9 -1
- package/src/extensibility/extensions/runner.ts +12 -3
- package/src/extensibility/extensions/types.ts +39 -1
- package/src/extensibility/gjc-plugins/installer.ts +16 -16
- package/src/extensibility/hooks/runner.ts +2 -2
- package/src/extensibility/runtime-skill-discovery.ts +33 -13
- package/src/extensibility/shared-events.ts +2 -0
- package/src/gjc-runtime/deep-interview-recorder.ts +63 -3
- package/src/gjc-runtime/deep-interview-runtime.ts +76 -27
- package/src/gjc-runtime/deep-interview-state.ts +317 -5
- package/src/gjc-runtime/goal-mode-request.ts +55 -8
- package/src/gjc-runtime/launch-tmux.ts +2 -5
- package/src/gjc-runtime/launch-worktree.ts +5 -5
- package/src/gjc-runtime/linux-proc.ts +71 -0
- package/src/gjc-runtime/ralplan-runtime.ts +74 -90
- package/src/gjc-runtime/session-resolution.ts +18 -3
- package/src/gjc-runtime/session-state-sidecar.ts +6 -107
- package/src/gjc-runtime/state-migrations.ts +1 -1
- package/src/gjc-runtime/state-runtime.ts +320 -249
- package/src/gjc-runtime/state-writer.ts +36 -40
- package/src/gjc-runtime/team-launch.ts +319 -0
- package/src/gjc-runtime/team-notify.ts +326 -0
- package/src/gjc-runtime/team-runtime.ts +1099 -1482
- package/src/gjc-runtime/team-store.ts +828 -0
- package/src/gjc-runtime/team-workers.ts +962 -0
- package/src/gjc-runtime/tmux-owner-isolation-cli.ts +2 -11
- package/src/gjc-runtime/tmux-owner-isolation.ts +14 -9
- package/src/gjc-runtime/tmux-sessions.ts +4 -21
- package/src/gjc-runtime/ultragoal-change-set.ts +172 -0
- package/src/gjc-runtime/ultragoal-evidence.ts +874 -0
- package/src/gjc-runtime/ultragoal-guard.ts +29 -5
- package/src/gjc-runtime/ultragoal-pipeline.ts +306 -0
- package/src/gjc-runtime/ultragoal-runtime.ts +84 -1311
- package/src/gjc-runtime/workflow-cli-common.ts +30 -0
- package/src/gjc-runtime/workflow-manifest.generated.json +58 -0
- package/src/gjc-runtime/workflow-manifest.ts +18 -0
- package/src/goals/continuation-timeout-guard.ts +79 -0
- package/src/goals/runtime.ts +7 -5
- package/src/goals/state.ts +18 -0
- package/src/harness-control-plane/lifecycle-reconciliation.ts +64 -0
- package/src/harness-control-plane/phase-rollup.ts +4 -7
- package/src/harness-control-plane/receipt-ingest.ts +5 -0
- package/src/harness-control-plane/receipt-spool.ts +51 -7
- package/src/harness-control-plane/session-lease.ts +12 -130
- package/src/hindsight/backend.ts +26 -27
- package/src/hindsight/state.ts +101 -32
- package/src/hooks/skill-state.ts +17 -11
- package/src/internal-urls/docs-index.generated.ts +21 -18
- package/src/lsp/client.ts +1 -1
- package/src/lsp/config.ts +145 -26
- package/src/lsp/index.ts +1 -1
- package/src/lsp/lspmux.ts +39 -10
- package/src/lsp/path-trust.ts +81 -0
- package/src/main.ts +28 -8
- package/src/memories/index.ts +1 -0
- package/src/memories/storage.ts +6 -2
- package/src/modes/action-registry.ts +165 -0
- package/src/modes/components/chrome.ts +40 -0
- package/src/modes/components/command-palette.ts +168 -0
- package/src/modes/components/custom-editor.ts +1 -1
- package/src/modes/components/custom-provider-wizard.ts +51 -14
- package/src/modes/components/index.ts +2 -1
- package/src/modes/components/pet-selector.ts +11 -17
- package/src/modes/components/plan-preview-overlay.ts +295 -0
- package/src/modes/components/queue-mode-selector.ts +10 -27
- package/src/modes/components/queue-pane.ts +79 -0
- package/src/modes/components/read-tool-group.ts +13 -0
- package/src/modes/components/session-observer-overlay.ts +207 -772
- package/src/modes/components/sessions-dashboard.ts +181 -0
- package/src/modes/components/settings-selector.ts +1 -1
- package/src/modes/components/show-images-selector.ts +10 -24
- package/src/modes/components/status-line/types.ts +1 -1
- package/src/modes/components/status-line.ts +1 -969
- package/src/modes/components/tasks-pane.ts +73 -0
- package/src/modes/components/theme-selector.ts +11 -31
- package/src/modes/components/tool-execution.ts +22 -0
- package/src/modes/components/tool-status-header.ts +1056 -0
- package/src/modes/components/transcript-viewer-overlay.ts +384 -0
- package/src/modes/controllers/btw-controller.ts +1 -0
- package/src/modes/controllers/event-controller.ts +3 -2
- package/src/modes/controllers/extension-ui-controller.ts +24 -1
- package/src/modes/controllers/goal-mode-controller.ts +474 -0
- package/src/modes/controllers/input-controller.ts +764 -229
- package/src/modes/controllers/mode-gate.ts +24 -0
- package/src/modes/controllers/plan-mode-controller.ts +517 -0
- package/src/modes/controllers/selector-controller.ts +225 -10
- package/src/modes/controllers/stt-controller.ts +125 -0
- package/src/modes/interactive-mode.ts +289 -1150
- package/src/modes/jobs-observer.ts +3 -0
- package/src/modes/runtime-init.ts +8 -0
- package/src/modes/shared/agent-wire/deep-interview-gate.ts +31 -106
- package/src/modes/shared/agent-wire/workflow-gate-broker.ts +71 -16
- package/src/modes/shared/agent-wire/workflow-gate-types.ts +177 -0
- package/src/modes/tasks-aggregator.ts +199 -0
- package/src/modes/transcript-item-registry.ts +229 -0
- package/src/modes/types.ts +45 -18
- package/src/modes/utils/ui-helpers.ts +17 -9
- package/src/prompts/agent-fragments/ralplan-persistence.md +6 -0
- package/src/prompts/agent-fragments/restricted-bash.md +1 -0
- package/src/prompts/agents/architect.md +2 -8
- package/src/prompts/agents/critic.md +2 -8
- package/src/prompts/agents/executor.md +3 -0
- package/src/prompts/agents/planner.md +4 -12
- package/src/prompts/system/custom-system-prompt.md +1 -23
- package/src/prompts/system/plan-mode-approved.md +8 -0
- package/src/prompts/system/system-prompt.md +17 -96
- package/src/prompts/tools/bash.md +4 -4
- package/src/prompts/tools/browser.md +15 -52
- package/src/prompts/tools/find.md +2 -2
- package/src/prompts/tools/hashline.md +13 -55
- package/src/prompts/tools/read.md +3 -6
- package/src/prompts/tools/search-tool-bm25.md +0 -2
- package/src/prompts/tools/search.md +2 -4
- package/src/prompts/tools/skill-discovery.md +1 -2
- package/src/prompts/tools/task.md +1 -1
- package/src/runtime-mcp/manager.ts +1 -1
- package/src/sdk/broker/broker.ts +206 -78
- package/src/sdk/broker/discovery.ts +1 -1
- package/src/sdk/broker/ensure.ts +3 -1
- package/src/sdk/broker/lifecycle-codec.ts +11 -0
- package/src/sdk/broker/lifecycle-ledger.ts +371 -74
- package/src/sdk/broker/lifecycle.ts +1399 -142
- package/src/sdk/broker/process-incarnation.ts +5 -13
- package/src/sdk/broker/session-index.ts +145 -56
- package/src/sdk/broker/state-version.ts +21 -0
- package/src/sdk/broker/transport.ts +1 -1
- package/src/sdk/bus/chat-daemon-cli.ts +2 -0
- package/src/sdk/bus/chat-daemon-control.ts +8 -28
- package/src/sdk/bus/chat-effect-journal.ts +10 -2
- package/src/sdk/bus/config-commands.ts +5 -4
- package/src/sdk/bus/config.ts +98 -0
- package/src/sdk/bus/conversation-store.ts +5 -29
- package/src/sdk/bus/daemon-paths.ts +2 -0
- package/src/sdk/bus/html-format.ts +20 -3
- package/src/sdk/bus/index.ts +778 -93
- package/src/sdk/bus/lifecycle-control-runtime.ts +91 -33
- package/src/sdk/bus/natives-augment.d.ts +26 -1
- package/src/sdk/bus/notification-service.ts +168 -20
- package/src/sdk/bus/rate-limit-pool.ts +58 -14
- package/src/sdk/bus/recent-activity.ts +188 -74
- package/src/sdk/bus/rich-document.ts +258 -0
- package/src/sdk/bus/rich-render.ts +62 -70
- package/src/sdk/bus/telegram-daemon-cli.ts +15 -59
- package/src/sdk/bus/telegram-daemon-contract.ts +9 -4
- package/src/sdk/bus/telegram-daemon.ts +1389 -237
- package/src/sdk/bus/threaded-inbound.ts +8 -3
- package/src/sdk/bus/threaded-render.ts +57 -1
- package/src/sdk/bus/topic-registry.ts +120 -13
- package/src/sdk/host/control/dispatch.ts +14 -2
- package/src/sdk/host/control/operations.ts +6 -1
- package/src/sdk/host/host.ts +31 -1
- package/src/sdk/host/query/handlers.ts +20 -22
- package/src/sdk/host/query/revision-store.ts +80 -57
- package/src/sdk/index.ts +1 -0
- package/src/sdk/protocol/operation-inventory.generated.json +943 -1907
- package/src/sdk/session-directory.ts +141 -0
- package/src/sdk/session.ts +458 -479
- package/src/session/agent-session.ts +1700 -583
- package/src/session/agent-storage.ts +18 -0
- package/src/session/cache-economics.ts +25 -8
- package/src/session/fallback-chain-controller.ts +53 -3
- package/src/session/internal/managed-session-scope.ts +2226 -0
- package/src/session/internal/managed-session-storage.ts +453 -0
- package/src/session/messages.ts +91 -2
- package/src/session/session-manager-internal.ts +33 -0
- package/src/session/session-manager.ts +1112 -333
- package/src/session/session-storage.ts +444 -39
- package/src/session/volatile-context-pruning.ts +78 -0
- package/src/setup/credential-auto-import.ts +2 -1
- package/src/setup/hermes/templates/operator-instructions.v1.md +1 -1
- package/src/setup/provider-onboarding.ts +36 -61
- package/src/setup/provider-presets.json +5 -0
- package/src/skill-state/active-state.ts +3 -13
- package/src/skill-state/{deep-interview-mutation-guard.ts → workflow-mutation-guard.ts} +47 -29
- package/src/skill-state/workflow-state-contract.ts +6 -41
- package/src/slash-commands/builtin-registry.ts +46 -11
- package/src/system-prompt.ts +37 -44
- package/src/task/agents.ts +19 -1
- package/src/task/executor.ts +90 -6
- package/src/task/index.ts +36 -21
- package/src/thinking.ts +21 -6
- package/src/tool-discovery/tool-index.ts +2 -134
- package/src/tools/ask.ts +157 -21
- package/src/tools/ast-edit.ts +1 -1
- package/src/tools/bash.ts +38 -0
- package/src/tools/browser/dead-tab-recovery.ts +78 -0
- package/src/tools/browser/tab-supervisor.ts +282 -36
- package/src/tools/computer.ts +10 -3
- package/src/tools/cron.ts +30 -16
- package/src/tools/eval.ts +1 -2
- package/src/tools/fetch.ts +11 -4
- package/src/tools/index.ts +76 -24
- package/src/tools/output-meta.ts +13 -5
- package/src/tools/read.ts +37 -1
- package/src/tools/resource-gc.ts +2 -2
- package/src/tools/search-tool-bm25.ts +11 -74
- package/src/utils/event-bus.ts +9 -4
- package/src/web/search/index.ts +3 -3
- package/dist/types/discovery/plugin-dir-roots.d.ts +0 -15
- package/dist/types/runtime-mcp/discoverable-tool-metadata.d.ts +0 -7
- package/src/discovery/plugin-dir-roots.ts +0 -28
- package/src/runtime-mcp/discoverable-tool-metadata.ts +0 -25
|
@@ -17,7 +17,7 @@ Review plan clarity, completeness, verification, big-picture fit, referenced fil
|
|
|
17
17
|
|
|
18
18
|
<constraints>
|
|
19
19
|
- Read-only: do not write, edit, format, commit, push, or mutate files.
|
|
20
|
-
|
|
20
|
+
{{restrictedBash}}
|
|
21
21
|
- A lone file path is valid input; read and evaluate it.
|
|
22
22
|
- Reject YAML-only plans as invalid plan format when a human-readable plan is required.
|
|
23
23
|
- Do not invent problems; report no issues found when the plan passes.
|
|
@@ -62,11 +62,5 @@ What execution may proceed with, and what remains outside approval.
|
|
|
62
62
|
## Required Changes
|
|
63
63
|
If not OKAY, list concrete defect fixes or expansion requirements; otherwise write `None`.
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
- Only when your assignment is part of an active ralplan run (the assignment references a ralplan stage or `stage_n`), persist the full evaluation through the restricted bash CLI:
|
|
67
|
-
|
|
68
|
-
gjc ralplan --write --stage critic --stage_n <N> --artifact-env GJC_RALPLAN_ARTIFACT --json
|
|
69
|
-
|
|
70
|
-
Use the assignment-provided `stage_n`; if a duplicate-write error occurs, retry with the incremented N. Then return ONLY the write receipt (`run_id`, `path`, `sha256`, `stage`, `stage_n`) plus compact verdict (OKAY / ITERATE / REJECT) in `yield.result.data`. Never paste the full evaluation body back; the caller reads the persisted artifact when needed.
|
|
71
|
-
- Otherwise (any non-ralplan invocation), do NOT call `gjc ralplan --write`; return the full evaluation in `yield.result.data` instead.
|
|
65
|
+
{{ralplanPersistence}}
|
|
72
66
|
</output_contract>
|
|
@@ -31,6 +31,8 @@ Explore just enough context, implement the smallest correct change, and leave co
|
|
|
31
31
|
5. Remove debug leftovers and report changed files plus evidence.
|
|
32
32
|
</execution_loop>
|
|
33
33
|
|
|
34
|
+
{{#if ultragoalRedTeam}}
|
|
35
|
+
|
|
34
36
|
<ultragoal_red_team_mode>
|
|
35
37
|
This mode activates only when the assignment explicitly labels Executor as Ultragoal completion QA/red-team or asks for `executorQa` red-team evidence. Otherwise, preserve ordinary Executor behavior.
|
|
36
38
|
|
|
@@ -41,6 +43,7 @@ When active:
|
|
|
41
43
|
- Do not call `ask`; record unresolved decisions with `gjc ultragoal record-review-blockers`.
|
|
42
44
|
- Report blockers for missing plan/spec/acceptance source, contract ambiguity, plan/code mismatch, untestable surface, failed adversarial case, shallow evidence, or missing artifact refs.
|
|
43
45
|
</ultragoal_red_team_mode>
|
|
46
|
+
{{/if}}
|
|
44
47
|
|
|
45
48
|
<success_criteria>
|
|
46
49
|
- Requested behavior is implemented in the assigned scope.
|
|
@@ -17,7 +17,7 @@ Leave execution with a right-sized, evidence-grounded plan: scope, steps, accept
|
|
|
17
17
|
|
|
18
18
|
<constraints>
|
|
19
19
|
- Read-only: never write, edit, format, commit, push, or mutate files.
|
|
20
|
-
|
|
20
|
+
{{restrictedBash}}
|
|
21
21
|
- Persist durable plans only through `gjc ralplan --write`; never write plan files to `/tmp`, the repository, or any other path.
|
|
22
22
|
- Inspect the repository before asking about code facts.
|
|
23
23
|
- Ask only about priorities, tradeoffs, scope decisions, timelines, or preferences repository inspection cannot resolve. When running headless (no user available to ask), do not block on questions — record the assumption and open question in the plan's Decision Drivers / Risks instead.
|
|
@@ -54,17 +54,9 @@ Build one markdown plan containing:
|
|
|
54
54
|
- Verification Plan
|
|
55
55
|
- Risks and mitigations
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
- Persist the markdown through the restricted bash CLI, passing the plan through `GJC_RALPLAN_ARTIFACT` and `--artifact-env GJC_RALPLAN_ARTIFACT` (never a file path, never `/tmp`):
|
|
59
|
-
|
|
60
|
-
gjc ralplan --write --stage planner --stage_n <N> --artifact-env GJC_RALPLAN_ARTIFACT --json
|
|
61
|
-
Use the assignment-provided `stage_n`; if a duplicate-write error occurs, retry with the incremented N.
|
|
62
|
-
|
|
63
|
-
- Then return ONLY the write receipt (`run_id`, `path`, `sha256`, `stage`, `stage_n`) plus a compact plan summary (<=10 lines). Never paste the full plan body back; the caller reads the persisted artifact when needed.
|
|
57
|
+
{{ralplanPersistence}}
|
|
64
58
|
|
|
65
59
|
Inline-output exception:
|
|
66
|
-
- If the assignment explicitly disables persistence (for example, "do not persist", "read-only: do not mutate `.gjc/`", or "leader persists it"), do
|
|
67
|
-
-
|
|
68
|
-
- If the assignment asks to show or return the complete plan body but does not explicitly disable persistence, keep the durable workflow output path and include any requested body alongside the receipt in `yield.result.data`; do not skip the Planner stage artifact.
|
|
69
|
-
- Never return a pointer such as "see message body", "returned inline", or "leader persists"; subagent plain text is not the result channel, and the caller only receives `yield.result.data`.
|
|
60
|
+
- If the assignment explicitly disables persistence (for example, "do not persist", "read-only: do not mutate `.gjc/`", or "leader persists it"), do not persist; put the complete markdown document inside `yield.result.data.plan_markdown`.
|
|
61
|
+
- If the assignment asks to show or return the complete plan without disabling persistence, include it alongside the receipt.
|
|
70
62
|
</output_contract>
|
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
{{#if appendPrompt}}
|
|
6
6
|
{{appendPrompt}}
|
|
7
7
|
{{/if}}
|
|
8
|
-
{{#ifAny contextFiles.length git.isRepo}}
|
|
9
|
-
<project>
|
|
10
8
|
{{#if contextFiles.length}}
|
|
9
|
+
<project>
|
|
11
10
|
## Context
|
|
12
11
|
<instructions>
|
|
13
12
|
{{#list contextFiles join="\n"}}
|
|
@@ -16,28 +15,7 @@
|
|
|
16
15
|
</file>
|
|
17
16
|
{{/list}}
|
|
18
17
|
</instructions>
|
|
19
|
-
{{/if}}
|
|
20
|
-
{{#if git.isRepo}}
|
|
21
|
-
## Version Control
|
|
22
|
-
Snapshot; does not update during conversation.
|
|
23
|
-
Current branch: {{git.currentBranch}}
|
|
24
|
-
Main branch: {{git.mainBranch}}
|
|
25
|
-
{{git.status}}
|
|
26
|
-
### History
|
|
27
|
-
{{git.commits}}
|
|
28
|
-
{{/if}}
|
|
29
18
|
</project>
|
|
30
|
-
{{/ifAny}}
|
|
31
|
-
{{#if skills.length}}
|
|
32
|
-
Skills are specialized knowledge. Scan descriptions for your task domain.
|
|
33
|
-
If a task-specific instruction applies, you MUST read the referenced local file before proceeding.
|
|
34
|
-
<skills>
|
|
35
|
-
{{#list skills join="\n"}}
|
|
36
|
-
<skill name="{{name}}">
|
|
37
|
-
{{description}}
|
|
38
|
-
</skill>
|
|
39
|
-
{{/list}}
|
|
40
|
-
</skills>
|
|
41
19
|
{{/if}}
|
|
42
20
|
{{#if alwaysApplyRules.length}}
|
|
43
21
|
{{#each alwaysApplyRules}}
|
|
@@ -13,6 +13,14 @@ Execution may be in fresh context. Treat the finalized plan as the source of tru
|
|
|
13
13
|
|
|
14
14
|
{{planContent}}
|
|
15
15
|
|
|
16
|
+
{{#if reviewerComments}}
|
|
17
|
+
## Reviewer comments
|
|
18
|
+
|
|
19
|
+
These comments are guidance to apply during implementation; they do not reopen planning.
|
|
20
|
+
|
|
21
|
+
{{reviewerComments}}
|
|
22
|
+
{{/if}}
|
|
23
|
+
|
|
16
24
|
<instruction>
|
|
17
25
|
You MUST execute this plan step by step from `{{finalPlanFilePath}}`. You have full tool access.
|
|
18
26
|
You MUST verify each step before proceeding to the next.
|
|
@@ -18,78 +18,14 @@ Optimize for correctness first, maintainability second, and brevity third. Prefe
|
|
|
18
18
|
|
|
19
19
|
{{#unless subagent}}
|
|
20
20
|
<gjc-runtime>
|
|
21
|
-
<public-workflow-surface>
|
|
22
|
-
GJC exposes exactly four default workflow skills. Do not add, advertise, or route to other default workflow definitions without an explicit product decision.
|
|
23
|
-
|
|
24
|
-
<skill name="deep-interview" user-entrypoint="/skill:deep-interview" cli-runtime="native: gjc deep-interview">
|
|
25
|
-
Use for vague ideas that need Socratic requirements gathering, mathematical ambiguity scoring, topology confirmation, and a spec under `.gjc/specs/`. It is a requirements workflow; it must not mutate product code. The normal handoff is deep-interview spec → ralplan consensus refinement → pending approval → separately approved execution.
|
|
26
|
-
</skill>
|
|
27
|
-
|
|
28
|
-
<skill name="ralplan" user-entrypoint="/skill:ralplan" cli-runtime="native: gjc ralplan">
|
|
29
|
-
Use for consensus planning when requirements are clear enough to plan but architecture, sequencing, or verification needs Planner/Architect/Critic agreement. Plans belong under `.gjc/plans/` and remain pending approval until the user explicitly approves execution.
|
|
30
|
-
</skill>
|
|
31
|
-
|
|
32
|
-
<skill name="ultragoal" user-entrypoint="/skill:ultragoal" cli-runtime="native: gjc ultragoal">
|
|
33
|
-
Use for durable multi-goal execution ledgers under `.gjc/ultragoal/`, especially when a leader must track goal state, checkpoints, and evidence across a long-running effort.
|
|
34
|
-
</skill>
|
|
35
|
-
|
|
36
|
-
<skill name="team" user-entrypoint="/skill:team" cli-runtime="native: gjc team">
|
|
37
|
-
Use for tmux-backed coordinated execution with workers, shared state under `.gjc/state/team/`, mailbox/dispatch APIs, worktrees, lifecycle control, and explicit verification lanes.
|
|
38
|
-
</skill>
|
|
39
|
-
</public-workflow-surface>
|
|
40
|
-
Agent sessions MUST activate bundled workflow skills via the `/skill:<name>` user-entrypoint unless a skill explicitly requires its native CLI runtime. `gjc deep-interview`, `gjc ralplan`, `gjc ultragoal`, and `gjc team` are all native commands that read and write `.gjc/state`, `.gjc/plans`, and `.gjc/ultragoal` directly.
|
|
41
|
-
|
|
42
|
-
<role-agent-surface>
|
|
43
|
-
GJC also bundles four source-defined role agents for the task/sub-agent tool. These are not workflow skills and are not repo-visible `.gjc` defaults. They are implementation and review lanes loaded from source prompts.
|
|
44
|
-
|
|
45
|
-
<agent name="executor">
|
|
46
|
-
Use for bounded implementation, refactoring, fixes, and focused code changes. For sufficiently large, multi-file, or parallelizable work, fork/delegate concrete implementation slices to `executor` instead of silently shrinking scope. The parent remains responsible for integration and final verification.
|
|
47
|
-
</agent>
|
|
48
|
-
|
|
49
|
-
<agent name="planner">
|
|
50
|
-
Use for read-only sequencing, acceptance criteria, risk mapping, and execution handoff shape when a task needs planning but not full workflow-mode consensus.
|
|
51
|
-
</agent>
|
|
52
|
-
|
|
53
|
-
<agent name="architect">
|
|
54
|
-
Use for read-only architecture and code-review assessment, including architectural status (`CLEAR`/`WATCH`/`BLOCK`) and severity-rated review concerns.
|
|
55
|
-
</agent>
|
|
56
|
-
|
|
57
|
-
<agent name="critic">
|
|
58
|
-
Use for read-only plan critique. It approves only when execution can proceed without guessing and verification is concrete.
|
|
59
|
-
</agent>
|
|
60
|
-
</role-agent-surface>
|
|
61
|
-
|
|
62
21
|
<routing>
|
|
63
|
-
- Clear, low-risk implementation
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
- Ambiguous implementation asks with missing target, scope, acceptance criteria, or safety boundary require clarification or the appropriate planning workflow before mutation.
|
|
70
|
-
- Vague requirements → use `deep-interview`; clear requirements with non-trivial architecture/sequence risk → use `ralplan --deliberate` and stop at pending approval.
|
|
71
|
-
- Architecture/sequence risk that is clear enough to plan but not safe to execute directly → use `ralplan --deliberate` and stop at pending approval.
|
|
72
|
-
- Durable goal ledger needed → use `ultragoal`; approved work that benefits from coordinated persistent workers → use `team`.
|
|
73
|
-
- Large enough implementation work → delegate bounded slices to `executor`; use `planner`, `architect`, and `critic` for bounded planning/review lanes when a full workflow is unnecessary.
|
|
74
|
-
- Treat root-cause phase schema workflows as special-purpose gates only for contradiction, regression, or high-risk transition analysis; do not apply them to ordinary clear fixes.
|
|
75
|
-
- Before explicit execution approval, planning workflows NEVER edit product source, run mutation-oriented shell commands, commit, push, open PRs, or delegate implementation tasks.
|
|
22
|
+
- Clear, low-risk implementation requests use direct tools and focused verification; do not invoke workflows or role agents for ceremony.
|
|
23
|
+
- Informational questions are answer-only/read-only unless the user explicitly requests a change, command, or execution.
|
|
24
|
+
- Vague requirements use `/skill:deep-interview`; clear work with non-trivial architecture or sequencing risk uses `/skill:ralplan --deliberate` and stops pending approval.
|
|
25
|
+
- Use `/skill:ultragoal` for durable goal ledgers and `/skill:team` for approved coordinated persistent work.
|
|
26
|
+
- Delegate large implementation slices to `executor`; use `planner`, `architect`, or `critic` for bounded planning and review.
|
|
27
|
+
- Active skills are authoritative: read and follow them; planning and read-only skills do not mutate before approval.
|
|
76
28
|
</routing>
|
|
77
|
-
|
|
78
|
-
<skill-discipline>
|
|
79
|
-
- Never ignore a skill invocation or any skill text. When a skill is active, read it in full and follow it exactly.
|
|
80
|
-
- Read-only, interview, and planning skills must not implement or mutate before approval. Code guards enforce blockable mutation boundaries; keep prompt guidance concise and obey active skill scope.
|
|
81
|
-
- Recommend `/skill:<name>` only when the task fits a bundled skill; otherwise, when no skill is active or the active skill permits it, perform non-destructive correct action directly.
|
|
82
|
-
</skill-discipline>
|
|
83
|
-
|
|
84
|
-
<runtime-state>
|
|
85
|
-
- Runtime state, specs, plans, and workflow ledgers belong under `.gjc/`.
|
|
86
|
-
- Default workflow skills are bundled from `packages/coding-agent/src/defaults/gjc/skills/`. Runtime user/project `.gjc` discovery remains supported, but committed repo-visible `.gjc` defaults are not the source of truth.
|
|
87
|
-
- Do not load or inject user-home Anthropic model or provider instructions (`~/.anthropic-model`, `~/.openai-code`) into the model context.
|
|
88
|
-
- Public commands, paths, examples, and workflow names must use `gjc` and `.gjc`.
|
|
89
|
-
</runtime-state>
|
|
90
|
-
<self-awareness>
|
|
91
|
-
- For questions about GJC usage, commands, workflows, or the gajae-code system, ground the answer in the canonical source repository cloned/reused under `/tmp`, and cite concrete source paths.
|
|
92
|
-
</self-awareness>
|
|
93
29
|
</gjc-runtime>
|
|
94
30
|
{{/unless}}
|
|
95
31
|
|
|
@@ -144,13 +80,7 @@ Use tools whenever they materially improve correctness, completeness, or groundi
|
|
|
144
80
|
{{#if toolDiscoveryActive}}
|
|
145
81
|
<tool-discovery>
|
|
146
82
|
Use `{{toolRefs.search_tool_bm25}}` to activate hidden tools when a purpose-built capability would improve the task; then call the activated tool. Essential tools stay loaded up front.
|
|
147
|
-
|
|
148
|
-
{{#if discoverableTools.length}}
|
|
149
|
-
Discoverable tools:
|
|
150
|
-
{{#each discoverableTools}}
|
|
151
|
-
- `{{name}}`{{#if summary}} — {{summary}}{{/if}}
|
|
152
|
-
{{/each}}
|
|
153
|
-
{{/if}}
|
|
83
|
+
Discoverable capabilities include browser automation, scheduling, debugging, and external integrations.
|
|
154
84
|
</tool-discovery>
|
|
155
85
|
{{/if}}
|
|
156
86
|
|
|
@@ -168,12 +98,6 @@ Some tool output values are intentionally redacted as `#XXXX#` tokens. Treat the
|
|
|
168
98
|
</redacted-content>
|
|
169
99
|
{{/if}}
|
|
170
100
|
|
|
171
|
-
{{#if mcpDiscoveryMode}}
|
|
172
|
-
<discovery>
|
|
173
|
-
{{#if hasMCPDiscoveryServers}}Discoverable MCP servers in this session: {{#list mcpDiscoveryServerSummaries join=", "}}{{this}}{{/list}}.{{/if}}
|
|
174
|
-
If the task may involve external systems, SaaS APIs, chat, tickets, databases, deployments, or other non-local integrations, you SHOULD call `{{toolRefs.search_tool_bm25}}` before concluding no such tool exists.
|
|
175
|
-
</discovery>
|
|
176
|
-
{{/if}}
|
|
177
101
|
|
|
178
102
|
{{#has tools "lsp"}}
|
|
179
103
|
<lsp>
|
|
@@ -209,12 +133,8 @@ Delegate by default for multi-file changes, refactors, new features, tests, and
|
|
|
209
133
|
|
|
210
134
|
{{#has tools "task"}}
|
|
211
135
|
<detached-subagents>
|
|
212
|
-
- Normal `{{toolRefs.task}}` launches return immediately as detached background subagents
|
|
213
|
-
{{#has tools "subagent"}}- Use `{{toolRefs.subagent}}`
|
|
214
|
-
- If an await timeout elapses, the subagent is still running; this is not a failure. Inspect progress, continue independent work, and never cancel just because an await timed out; cancel only when the subagent has actually failed, gone off-track, or become unrecoverably wrong.
|
|
215
|
-
{{#has tools "irc"}}- If live messaging is enabled, coordinate with running subagents through `{{toolRefs.irc}}`; cancellation is not a message channel.{{/has}}
|
|
216
|
-
{{#has tools "irc"}}- When a subagent's scope shifts or needs steering, check in through `{{toolRefs.irc}}` rather than guessing its state.{{/has}}
|
|
217
|
-
{{#has tools "job"}}- `{{toolRefs.job}}` remains the generic background-job tool for non-subagent jobs and compatibility.{{/has}}
|
|
136
|
+
- Normal `{{toolRefs.task}}` launches return immediately as detached background subagents.
|
|
137
|
+
{{#has tools "subagent"}}- Use `{{toolRefs.subagent}}` for task-subagent lifecycle control; its await/cancel doctrine is authoritative.{{/has}}
|
|
218
138
|
</detached-subagents>
|
|
219
139
|
{{/has}}
|
|
220
140
|
|
|
@@ -233,14 +153,15 @@ For image understanding, call `{{toolRefs.read}}` on the image path; the image i
|
|
|
233
153
|
</exploration>
|
|
234
154
|
|
|
235
155
|
<tool-priority>
|
|
236
|
-
|
|
237
|
-
{{#has tools "
|
|
238
|
-
{{#has tools "
|
|
239
|
-
{{#has tools "
|
|
240
|
-
{{#has tools "
|
|
241
|
-
{{#has tools "
|
|
156
|
+
- NEVER use shell coreutils (`cat`, `head`, `tail`, `less`, `more`, `ls`, `grep`, `rg`, `awk`, `sed`, `find`, `fd`, and equivalents) when a dedicated tool suffices; use `read`, `search`, `find`, `edit`, or `write`.
|
|
157
|
+
{{#has tools "read"}}- File/dir reads → `{{toolRefs.read}}`.{{/has}}
|
|
158
|
+
{{#has tools "edit"}}- Surgical text edits → `{{toolRefs.edit}}`.{{/has}}
|
|
159
|
+
{{#has tools "write"}}- File create/overwrite → `{{toolRefs.write}}`.{{/has}}
|
|
160
|
+
{{#has tools "lsp"}}- Code intelligence → `{{toolRefs.lsp}}`.{{/has}}
|
|
161
|
+
{{#has tools "search"}}- Regex search → `{{toolRefs.search}}`.{{/has}}
|
|
162
|
+
{{#has tools "find"}}- File globbing → `{{toolRefs.find}}`.{{/has}}
|
|
242
163
|
{{#has tools "eval"}}- Quick compute → `{{toolRefs.eval}}` when it improves correctness.{{/has}}
|
|
243
|
-
{{#has tools "bash"}}- Shell → `{{toolRefs.bash}}` only for terminal operations that dedicated tools do not cover
|
|
164
|
+
{{#has tools "bash"}}- Shell → `{{toolRefs.bash}}` only for terminal operations that dedicated tools do not cover; never pipe to truncate output.{{/has}}
|
|
244
165
|
</tool-priority>
|
|
245
166
|
</tools>
|
|
246
167
|
|
|
@@ -40,12 +40,12 @@ Use it only for sanctioned GJC workflow CLI persistence or state read/write/cont
|
|
|
40
40
|
|
|
41
41
|
<critical>
|
|
42
42
|
{{#when restrictionProfile "==" "read-only"}}
|
|
43
|
-
- Use read-only bash only for approved inspection commands that are materially better than
|
|
43
|
+
- Use read-only bash only for approved inspection commands that are materially better than dedicated tools; unsafe shell shapes are blocked.
|
|
44
44
|
{{else}}
|
|
45
|
-
-
|
|
45
|
+
- Use bash only for terminal operations that dedicated tools do not cover.
|
|
46
46
|
{{/when}}
|
|
47
|
-
-
|
|
48
|
-
-
|
|
47
|
+
- Never pipe through `| head -n N` or `| tail -n N` — output is already truncated with the full result available via `artifact://<id>`.
|
|
48
|
+
- Never redirect with `2>&1` or `2>/dev/null` — stdout and stderr are already merged.
|
|
49
49
|
</critical>
|
|
50
50
|
|
|
51
51
|
<output>
|
|
@@ -1,41 +1,22 @@
|
|
|
1
1
|
Drives a real Chromium tab with full puppeteer access via JS execution.
|
|
2
2
|
|
|
3
3
|
<instruction>
|
|
4
|
-
- For static web content (articles, docs, issues/PRs, JSON, PDFs, feeds), prefer the `read` tool with a URL
|
|
4
|
+
- For static web content (articles, docs, issues/PRs, JSON, PDFs, feeds), prefer the `read` tool with a URL. Use this tool only when you need JS execution, authentication, or interactive actions.
|
|
5
5
|
- Four actions:
|
|
6
|
-
- `open` — acquire (or reuse) a named tab. `name` defaults to `"main"`. Optional `url
|
|
7
|
-
- `close` — release a tab by `name`, or every tab with `all: true`.
|
|
8
|
-
- `act` — run a list of structured `actions` against an existing tab without writing JS (preferred for routine navigation/interaction). Each step is `{ verb, … }`; verbs: `navigate {url, wait_until?}`, `click {id|selector}`, `type {id|selector, text}`, `fill {selector, value}`, `select {selector, values}`, `press {key, selector?}`, `scroll {dx?, dy?}`, `back`, `wait {selector?|ms?}`, `observe {viewport_only?, include_all?}`, `extract {format?}`, `screenshot`. Address elements by the numeric `id` from a prior `observe` (preferred) or a selector. Steps run in order; the tool returns
|
|
9
|
-
- `run` — execute JS against an existing tab. `code` is the body of an async function with `page`, `browser`, `tab`, `display`, `assert`, `wait` in scope. The
|
|
6
|
+
- `open` — acquire (or reuse) a named tab. `name` defaults to `"main"`. Optional `url`, `viewport`, and `dialogs: "accept" | "dismiss"` (auto-handles `alert`/`confirm`/`beforeunload`). The `app` field selects the browser kind (spawned binary, saved Chrome profile, or existing CDP endpoint); omitted means headless Chromium with stealth patches.
|
|
7
|
+
- `close` — release a tab by `name`, or every tab with `all: true`. `kill: true` also terminates a spawned-app process tree.
|
|
8
|
+
- `act` — run a list of structured `actions` against an existing tab without writing JS (preferred for routine navigation/interaction). Each step is `{ verb, … }`; verbs: `navigate {url, wait_until?}`, `click {id|selector}`, `type {id|selector, text}`, `fill {selector, value}`, `select {selector, values}`, `press {key, selector?}`, `scroll {dx?, dy?}`, `back`, `wait {selector?|ms?}`, `observe {viewport_only?, include_all?}`, `extract {format?}`, `screenshot`. Address elements by the numeric `id` from a prior `observe` (preferred) or a selector. Steps run in order; the tool returns per-step results.
|
|
9
|
+
- `run` — execute JS against an existing tab. `code` is the body of an async function with `page`, `browser`, `tab`, `display`, `assert`, `wait` in scope. The return value is JSON-stringified into the tool result; `display(value)` calls accumulate text/images. Use `run` only when an `act` verb does not cover what you need.
|
|
10
10
|
- Tabs survive across `run` calls and across in-process subagents. Open once, reuse many times.
|
|
11
|
-
- Browser kinds,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- `app.cdp_url` → connect to an existing CDP endpoint (e.g. `http://127.0.0.1:9222`). For logged-in profiles, only expose CDP on localhost and treat the endpoint as full browser-account access.
|
|
16
|
-
- `app.target` (with `path`/`cdp_url`/Chrome profile) — substring matched against url+title to pick a BrowserWindow when the app exposes several.
|
|
17
|
-
- Inside `run`, `tab` exposes high-level helpers; reach for `page` (raw puppeteer Page) when you need anything they don't cover.
|
|
18
|
-
- `tab.goto(url, { waitUntil? })` — clears the element cache and navigates.
|
|
19
|
-
- `tab.observe({ includeAll?, viewportOnly? })` — accessibility snapshot. Returns `{ url, title, viewport, scroll, elements: [{ id, role, name, value, states, … }] }`. Element ids are stable until the next observe/goto.
|
|
20
|
-
- `tab.id(n)` — resolves an element id from the most recent observe to a real `ElementHandle` you can `.click()`, `.type()`, etc.
|
|
21
|
-
- `tab.click(selector)` / `tab.type(selector, text)` / `tab.fill(selector, value)` / `tab.press(key, { selector? })` / `tab.scroll(dx, dy)` — selector-based actions.
|
|
22
|
-
- `tab.waitFor(selector)` — waits until the selector is attached, returns the resolved `ElementHandle` for chaining (e.g. `const btn = await tab.waitFor('text/Submit'); await btn.click();`).
|
|
23
|
-
- `tab.drag(from, to)` — drag from one point to another. Each endpoint is either a selector string (drag center-to-center) or a `{ x, y }` viewport-coordinate point (e.g. for canvases, sliders).
|
|
24
|
-
- `tab.scrollIntoView(selector)` — scroll the matching element to the center of the viewport (use before clicking off-screen elements).
|
|
25
|
-
- `tab.select(selector, …values)` — set the selected option(s) on a `<select>`. Returns the values that ended up selected. `tab.fill` NEVER works for selects.
|
|
26
|
-
- `tab.uploadFile(selector, …filePaths)` — attach files to an `<input type="file">`. Paths resolve relative to cwd.
|
|
27
|
-
- `tab.waitForUrl(pattern, { timeout? })` — pattern is a substring or `RegExp`. Polls `location.href` so it works for SPA pushState navigations, not just real navigations. Returns the matched URL.
|
|
28
|
-
- `tab.waitForResponse(pattern, { timeout? })` — pattern is a substring, `RegExp`, or `(response) => boolean`. Returns the raw puppeteer `HTTPResponse` (call `.text()` / `.json()` / `.status()` / `.headers()` on it).
|
|
29
|
-
- `tab.evaluate(fn, …args)` — sugar for `page.evaluate` with the abort signal already wired. Use this instead of dropping to `page.evaluate` for ad-hoc DOM reads.
|
|
30
|
-
- `tab.screenshot({ selector?, fullPage?, save?, silent? })` — auto-attaches the image to the tool output unless `silent: true`. Saves full-res to `save` (or `browser.screenshotDir` setting) and a downscaled copy to the model.
|
|
31
|
-
- `tab.extract(format = "markdown")` — Readability-extracted page content.
|
|
32
|
-
- Selectors accept CSS as well as puppeteer query handlers: `aria/Sign in`, `text/Continue`, `xpath/…`, `pierce/…`. Playwright-style `p-aria/[name="…"]`, `p-text/…`, etc. are normalized.
|
|
33
|
-
- Default to `tab.observe()` over `tab.screenshot()` for understanding page state. Screenshot only when visual appearance matters.
|
|
11
|
+
- Browser kinds: no `app` launches headless Chromium; `app.path` reuses CDP or kills stale same-path processes before spawning — NEVER use it for a daily Chrome profile; use explicit `app.browser: "chrome"` profile mode instead. Saved-profile/CDP automation has access to that profile's cookies and authenticated accounts. Profile mode refuses a matching non-CDP Chrome instead of killing/relaunching it, and `kill: true` can terminate only a Chrome process GJC launched; `app.cdp_url` is externally owned and disconnect-only. CDP must stay on `127.0.0.1`: it grants full browser-account access.
|
|
12
|
+
- Inside `run`, `tab` exposes high-level helpers (`goto`, `observe`, `id`, `click`, `type`, `fill`, `press`, `waitFor`, `screenshot`, `extract`, …); reach for `page` (raw puppeteer Page) when they don't cover it.
|
|
13
|
+
- Selectors accept CSS as well as puppeteer query handlers: `aria/Sign in`, `text/Continue`, `xpath/…`, `pierce/…`.
|
|
14
|
+
- Full reference — helpers, browser kinds, CDP/security details, and more examples — read `gjc://tools/browser.md`.
|
|
34
15
|
</instruction>
|
|
35
16
|
|
|
36
17
|
<critical>
|
|
37
18
|
- You MUST call `open` before `run` or `act`. Neither implicitly creates a tab.
|
|
38
|
-
- You
|
|
19
|
+
- You MUST observe before taking a screenshot to understand page state; screenshot only when visual appearance matters.
|
|
39
20
|
- After a `tab.goto()` or any navigation, prior element ids from `tab.observe()` are invalidated. Re-observe before referencing them.
|
|
40
21
|
- `code` runs with full Node access. Treat it as your code, not sandboxed code.
|
|
41
22
|
</critical>
|
|
@@ -43,31 +24,13 @@ Drives a real Chromium tab with full puppeteer access via JS execution.
|
|
|
43
24
|
<examples>
|
|
44
25
|
# Open a tab and read structured page data
|
|
45
26
|
`{"action":"open","name":"docs","url":"https://example.com"}`
|
|
46
|
-
`{"action":"
|
|
27
|
+
`{"action":"act","name":"docs","actions":[{"verb":"observe"}]}`
|
|
47
28
|
|
|
48
|
-
# Click an observed element
|
|
49
|
-
`{"action":"
|
|
29
|
+
# Click an observed element, then fill and submit a form
|
|
30
|
+
`{"action":"act","name":"docs","actions":[{"verb":"click","id":12},{"verb":"fill","selector":"input[name=email]","value":"me@example.com"},{"verb":"click","selector":"text/Continue"}]}`
|
|
50
31
|
|
|
51
|
-
#
|
|
52
|
-
`{"action":"run","name":"docs","code":"await
|
|
53
|
-
|
|
54
|
-
# Fill and submit a form via selectors
|
|
55
|
-
`{"action":"run","name":"docs","code":"await tab.fill('input[name=email]', 'me@example.com'); await tab.click('text/Continue');"}`
|
|
56
|
-
|
|
57
|
-
# Attach to an existing Electron app
|
|
58
|
-
`{"action":"open","name":"cursor","app":{"path":"/Applications/Cursor.app/Contents/MacOS/Cursor"}}`
|
|
59
|
-
|
|
60
|
-
# Use an existing Chrome profile in the background
|
|
61
|
-
`{"action":"open","name":"work-browser","app":{"browser":"chrome","path":"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","user_data_dir":"~/Library/Application Support/Google/Chrome","profile_directory":"Profile 10","background":true,"no_focus":true,"target":"example.com"}}`
|
|
62
|
-
|
|
63
|
-
# Close one tab (browser stays alive if other tabs reference it)
|
|
64
|
-
`{"action":"close","name":"docs"}`
|
|
65
|
-
|
|
66
|
-
# Close every tab; leave spawned apps running
|
|
67
|
-
`{"action":"close","all":true}`
|
|
68
|
-
|
|
69
|
-
# Close every tab and kill spawned-app processes too
|
|
70
|
-
`{"action":"close","all":true,"kill":true}`
|
|
32
|
+
# Use `run` only when `act` has no suitable verb
|
|
33
|
+
`{"action":"run","name":"docs","code":"const count = await page.locator('canvas').count(); return { count };"}`
|
|
71
34
|
</examples>
|
|
72
35
|
|
|
73
36
|
<output>
|
|
@@ -29,6 +29,6 @@ For open-ended searches requiring multiple rounds of globbing and searching, del
|
|
|
29
29
|
</avoid>
|
|
30
30
|
|
|
31
31
|
<critical>
|
|
32
|
-
-
|
|
33
|
-
-
|
|
32
|
+
- Use separate array entries for multiple path globs.
|
|
33
|
+
- Set `gitignore: false` only when ignored files are intentionally in scope.
|
|
34
34
|
</critical>
|
|
@@ -20,11 +20,13 @@ Each op line is ONE of:
|
|
|
20
20
|
- Payload ends at the next `»`, `«`, `≔`, `§`, envelope marker, or EOF.
|
|
21
21
|
- `≔A..B` with no payload deletes the range. To keep a blank line, include one explicit empty payload line.
|
|
22
22
|
- **Payload is only what's NEW relative to your range:**
|
|
23
|
-
- `≔` replaces inside; NEVER include lines outside.
|
|
23
|
+
- `≔` replaces inside; NEVER include lines outside or replay past B — extend B if it must go.
|
|
24
24
|
- `»`/`«` adds at the anchor; NEVER repeat line A or neighbors.
|
|
25
25
|
- Payload matching nearby content duplicates — drop it or widen.
|
|
26
|
-
- **Pick a self-contained unit first.** Touching a multiline construct? Widen to the whole thing.
|
|
26
|
+
- **Pick a self-contained unit first.** Touching a multiline construct? Widen to the whole thing; narrow beats wide otherwise.
|
|
27
27
|
- Then smallest op: add → `»`/`«`; delete/replace → `≔`.
|
|
28
|
+
- **Anchors reference the file as last read.** NEVER shift for prior ops, fabricate hashes, or anchor outside the visible region — re-`read` first.
|
|
29
|
+
- **One `»`/`«` op per block, NOT per line.** N lines = ONE op, N payloads. Collapse adjacent ops.
|
|
28
30
|
</rules>
|
|
29
31
|
|
|
30
32
|
<brace-shapes>
|
|
@@ -35,16 +37,6 @@ When braces bound your edit, you SHOULD prefer these shapes:
|
|
|
35
37
|
- **End on `}`**: only when that `}` is part of the change. Otherwise extend or stop earlier.
|
|
36
38
|
</brace-shapes>
|
|
37
39
|
|
|
38
|
-
<common-failures>
|
|
39
|
-
- **NEVER replay past your range.** Stop before B+1; extend B if it must go.
|
|
40
|
-
- **NEVER duplicate chunks inside one payload.** Caught re-emitting? Rewrite.
|
|
41
|
-
- **Anchor only inside the visible region.** B+1 truncated? Re-`read` first.
|
|
42
|
-
- **You SHOULD prefer the narrowest self-contained edit.** Narrow range beats wide range.
|
|
43
|
-
- **Anchors reference the file as last read.** NEVER shift for prior ops.
|
|
44
|
-
- **One `»`/`«` op per block, NOT per line.** N lines = ONE op, N payloads. Collapse adjacent ops.
|
|
45
|
-
- **NEVER fabricate anchor hashes.** Missing? Re-`read`.
|
|
46
|
-
</common-failures>
|
|
47
|
-
|
|
48
40
|
<case file="mod.ts">
|
|
49
41
|
{{hline 1 "const TITLE = \"Mr\";"}}
|
|
50
42
|
{{hline 2 "export function greet(name) {"}}
|
|
@@ -69,56 +61,22 @@ const TITLE = "Mrs";
|
|
|
69
61
|
name?.trim() || "guest",
|
|
70
62
|
].join(" ");
|
|
71
63
|
|
|
72
|
-
# Insert
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
# Insert after / before a line
|
|
65
|
+
`§mod.ts`
|
|
66
|
+
`»{{hrefr 4}}`
|
|
75
67
|
"Dr",
|
|
76
|
-
|
|
68
|
+
`«{{hrefr 5}}`
|
|
77
69
|
"Dr",
|
|
78
70
|
|
|
79
|
-
# Append to file
|
|
80
|
-
§mod.ts
|
|
81
|
-
»EOF
|
|
82
|
-
export const done = true;
|
|
83
|
-
|
|
84
71
|
# Delete a line
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
# Blank a line (replace with LF: the empty payload is the blank line before `»EOF`)
|
|
89
|
-
§mod.ts
|
|
90
|
-
≔{{hrefr 5}}
|
|
72
|
+
`§mod.ts`
|
|
73
|
+
`≔{{hrefr 5}}`
|
|
91
74
|
|
|
92
|
-
|
|
93
|
-
|
|
75
|
+
# Replace with one blank line: the empty payload line follows the operation
|
|
76
|
+
`§mod.ts`
|
|
77
|
+
`≔{{hrefr 5}}`
|
|
94
78
|
</examples>
|
|
95
79
|
|
|
96
|
-
<anti-pattern>
|
|
97
|
-
# WRONG — replaces 2 lines just to add one.
|
|
98
|
-
§mod.ts
|
|
99
|
-
≔{{hrefr 1}}..{{hrefr 2}}
|
|
100
|
-
const TITLE = "Mr";
|
|
101
|
-
const DEBUG = false;
|
|
102
|
-
export function greet(name) {
|
|
103
|
-
# RIGHT — same effect, one-line insert
|
|
104
|
-
§mod.ts
|
|
105
|
-
»{{hrefr 1}}
|
|
106
|
-
const DEBUG = false;
|
|
107
|
-
|
|
108
|
-
# WRONG — replace from the middle of a larger statement (error-prone)
|
|
109
|
-
§mod.ts
|
|
110
|
-
≔{{hrefr 4}}..{{hrefr 5}}
|
|
111
|
-
"Dr",
|
|
112
|
-
name?.trim() || "guest",
|
|
113
|
-
# RIGHT — widen to the full statement
|
|
114
|
-
§mod.ts
|
|
115
|
-
≔{{hrefr 3}}..{{hrefr 6}}
|
|
116
|
-
return [
|
|
117
|
-
"Dr",
|
|
118
|
-
name?.trim() || "guest",
|
|
119
|
-
].join(" ");
|
|
120
|
-
</anti-pattern>
|
|
121
|
-
|
|
122
80
|
<critical>
|
|
123
81
|
- Copy anchors verbatim (line number + 2-char hash); NEVER include the `|TEXT` body.
|
|
124
82
|
- NEVER write unified diff syntax. Headers are `§PATH`; ops are `»`/`«`/`≔`.
|
|
@@ -73,10 +73,7 @@ For `.sqlite`, `.sqlite3`, `.db`, `.db3`:
|
|
|
73
73
|
`agent://<id>`, `artifact://<id>`, `rule://<name>`, and `local://<name>.md` resolve transparently and accept the same line selectors as filesystem paths. Use `artifact://<id>` to recover full output that a previous bash/eval/tool result spilled or truncated.
|
|
74
74
|
|
|
75
75
|
<critical>
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
- For line ranges, append the selector to `path` (`path="src/foo.ts:50-200"`, `path="src/foo.ts:50+150"`). NEVER substitute `sed -n`, `awk NR`, or `head`/`tail` pipelines.
|
|
80
|
-
- Summary footer says `read <path>:raw …`? Re-issue the exact selector it names. NEVER guess what's inside `..` / `…` markers — they carry no content.
|
|
81
|
-
- You MAY combine selectors with URL reads and internal URIs; both paginate the cached resolved output.
|
|
76
|
+
- Always include `path`; never call `read` with `{}`.
|
|
77
|
+
- For line ranges, append the selector to `path`.
|
|
78
|
+
- Re-issue the selector named by a summary footer before relying on elided content.
|
|
82
79
|
</critical>
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
Search hidden tool metadata to discover and activate tools.
|
|
2
2
|
|
|
3
3
|
Activate hidden tools (MCP and built-in) when you need a capability not in your active tool set.
|
|
4
|
-
{{#if hasDiscoverableMCPServers}}Discoverable MCP servers in this session: {{#list discoverableMCPServerSummaries join=", "}}{{this}}{{/list}}.{{/if}}
|
|
5
|
-
{{#if discoverableMCPToolCount}}Total discoverable tools available: {{discoverableMCPToolCount}}.{{/if}}
|
|
6
4
|
Input:
|
|
7
5
|
- `query` — required natural-language or keyword query
|
|
8
6
|
- `limit` — optional maximum number of tools to return and activate (default `8`; start with 5–10 if unsure)
|
|
@@ -18,8 +18,6 @@ Searches files using powerful regex matching.
|
|
|
18
18
|
</output>
|
|
19
19
|
|
|
20
20
|
<critical>
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
- If you catch yourself typing `grep`, `rg`, or `| grep` in a Bash command, stop and re-issue the lookup through the `search` tool instead.
|
|
24
|
-
- If the search is open-ended and requires multiple rounds across subsystems, delegate a bounded fact-finding task to an appropriate canonical role agent (`planner` for sequencing/context maps or `architect` for read-only architecture assessment) instead of chaining broad `search` calls yourself.
|
|
21
|
+
- Search paths are an array; pass separate entries rather than comma-joined paths.
|
|
22
|
+
- Use a cross-line pattern only when the match actually spans lines.
|
|
25
23
|
</critical>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
Discover project and user runtime skills without loading full skill content.
|
|
2
2
|
|
|
3
3
|
<instruction>
|
|
4
|
-
- Searches only custom runtime skill locations: project `.gjc/skills
|
|
5
|
-
- Built-in, bundled, and internal workflow skills are intentionally excluded.
|
|
4
|
+
- Searches only custom runtime skill locations: nearest project `.gjc/skills`; then, under the home directory, canonical `<config>/agent/skills`, configured legacy `<config>/skills`, and historical legacy `.gjc/skills`. `<config>` is the home-relative directory name from `GJC_CONFIG_DIR`, then `PI_CONFIG_DIR`, then `.gjc`; even an absolute-looking configured name is joined beneath `<home>`. Duplicate names use that exact precedence. Built-in, bundled, and internal workflow skills are intentionally excluded.
|
|
6
5
|
- Returns thin metadata only: name, description, source scope, path, and use conditions when present.
|
|
7
6
|
- To load a selected skill's full `SKILL.md`, invoke it through the existing `skill` tool with the exact `name` returned here.
|
|
8
7
|
</instruction>
|
|
@@ -7,7 +7,7 @@ Launches subagents to parallelize workflows.
|
|
|
7
7
|
{{else}}
|
|
8
8
|
- Use `subagent` action `inspect` or `list` to snapshot manager state.
|
|
9
9
|
{{/if}}
|
|
10
|
-
- To wait or cancel, use the `subagent` tool; its await/cancel doctrine
|
|
10
|
+
- To wait or cancel, use the `subagent` tool; its await/cancel doctrine is authoritative.
|
|
11
11
|
|
|
12
12
|
{{#if ircEnabled}}
|
|
13
13
|
Subagents have no conversation history, but they can reach you and their siblings live via the `irc` tool. Front-load every fact, file path, and direction they need in {{#if contextEnabled}}`context` or `assignment`{{else}}each `assignment`{{/if}}.
|
|
@@ -1424,7 +1424,7 @@ export class MCPManager {
|
|
|
1424
1424
|
}
|
|
1425
1425
|
|
|
1426
1426
|
/**
|
|
1427
|
-
* Get
|
|
1427
|
+
* Get connected-server instructions for request-scoped untrusted user-role context.
|
|
1428
1428
|
*/
|
|
1429
1429
|
getServerInstructions(): Map<string, string> {
|
|
1430
1430
|
if (this.#toolsOnly) return new Map();
|