@gajae-code/coding-agent 0.17.1 → 0.17.4
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 +266 -0
- package/dist/types/async/job-manager.d.ts +7 -6
- package/dist/types/cli/daemon-cli.d.ts +3 -1
- package/dist/types/cli/github-release.d.ts +17 -0
- package/dist/types/cli/public-command-entry.d.ts +56 -0
- package/dist/types/cli/public-command-errors.d.ts +126 -0
- package/dist/types/cli/public-command-evidence.d.ts +99 -0
- package/dist/types/cli/public-command-help.d.ts +65 -0
- package/dist/types/cli/public-command-registry.d.ts +69 -0
- package/dist/types/cli/session-picker.d.ts +1 -1
- package/dist/types/cli/setup-cli.d.ts +1 -0
- package/dist/types/cli/skills-cli.d.ts +5 -0
- package/dist/types/cli.d.ts +3 -0
- package/dist/types/commands/daemon.d.ts +4 -50
- package/dist/types/commands/sdk.d.ts +20 -37
- package/dist/types/commands/setup.d.ts +3 -0
- package/dist/types/commands/skills.d.ts +9 -0
- package/dist/types/config/autorouting-tier-map.d.ts +24 -0
- package/dist/types/config/file-lock.d.ts +10 -1
- package/dist/types/config/model-profile-activation.d.ts +63 -4
- package/dist/types/config/model-registry.d.ts +20 -2
- package/dist/types/config/settings-schema.d.ts +11 -0
- package/dist/types/coordinator-mcp/question-state.d.ts +6 -1
- package/dist/types/coordinator-mcp/server.d.ts +3 -0
- package/dist/types/daemon/operator-contract.d.ts +5 -1
- package/dist/types/eval/js/worker-protocol.d.ts +2 -0
- package/dist/types/extensibility/extensions/types.d.ts +12 -0
- package/dist/types/extensibility/gjc-plugins/registry.d.ts +4 -0
- package/dist/types/extensibility/runtime-skill-discovery.d.ts +18 -0
- package/dist/types/extensibility/shared-events.d.ts +3 -1
- package/dist/types/gjc-runtime/session-state-lock.d.ts +61 -0
- package/dist/types/internal-urls/embedded-protocol.d.ts +9 -0
- package/dist/types/internal-urls/index.d.ts +1 -0
- package/dist/types/internal-urls/parse.d.ts +9 -1
- package/dist/types/main.d.ts +22 -0
- package/dist/types/modes/acp/acp-agent.d.ts +94 -1
- package/dist/types/modes/acp/startup-provenance.d.ts +16 -0
- package/dist/types/modes/components/custom-provider-wizard.d.ts +19 -1
- package/dist/types/modes/components/session-selector.d.ts +5 -2
- package/dist/types/modes/components/thinking-selector.d.ts +2 -1
- package/dist/types/modes/components/user-message-selector.d.ts +5 -2
- package/dist/types/modes/controllers/command-controller.d.ts +1 -1
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -1
- package/dist/types/modes/interactive-mode.d.ts +1 -1
- package/dist/types/modes/shared/agent-wire/workflow-gate-broker.d.ts +11 -1
- package/dist/types/modes/shared/agent-wire/workflow-gate-types.d.ts +14 -1
- package/dist/types/modes/types.d.ts +2 -2
- package/dist/types/runtime/process-lifecycle.d.ts +2 -0
- package/dist/types/runtime-mcp/manager.d.ts +56 -0
- package/dist/types/runtime-mcp/pool.d.ts +17 -0
- package/dist/types/runtime-mcp/redaction.d.ts +20 -0
- package/dist/types/runtime-mcp/startup-policy.d.ts +6 -0
- package/dist/types/runtime-mcp/tool-bridge.d.ts +9 -0
- package/dist/types/runtime-mcp/transports/http.d.ts +11 -0
- package/dist/types/sdk/acp/adapter.d.ts +27 -0
- package/dist/types/sdk/acp/final-text.d.ts +8 -0
- package/dist/types/sdk/broker/broker.d.ts +13 -2
- package/dist/types/sdk/broker/ensure.d.ts +46 -1
- package/dist/types/sdk/broker/identity.d.ts +3 -1
- package/dist/types/sdk/broker/lifecycle-ledger.d.ts +23 -3
- package/dist/types/sdk/broker/lifecycle.d.ts +15 -8
- package/dist/types/sdk/broker/runtime.d.ts +1 -1
- package/dist/types/sdk/broker/session-index.d.ts +22 -3
- package/dist/types/sdk/broker/spawn-authority.d.ts +4 -0
- package/dist/types/sdk/broker/stderr-drainer.d.ts +13 -0
- package/dist/types/sdk/bus/index.d.ts +19 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +3 -1
- package/dist/types/sdk/bus/telegram-daemon.d.ts +5 -0
- package/dist/types/sdk/cli/master-cli.d.ts +6 -10
- package/dist/types/sdk/cli/rows.d.ts +19 -1
- package/dist/types/sdk/cli/session-cli.d.ts +22 -5
- package/dist/types/sdk/client/client.d.ts +2 -0
- package/dist/types/sdk/guides/cli.d.ts +3 -4
- package/dist/types/sdk/guides/verify.d.ts +2 -0
- package/dist/types/sdk/host/host.d.ts +9 -0
- package/dist/types/sdk/host/session-runtime.d.ts +31 -0
- package/dist/types/sdk/host/types.d.ts +10 -0
- package/dist/types/sdk/index.d.ts +1 -0
- package/dist/types/sdk/prompt-deadline-flush.d.ts +83 -0
- package/dist/types/sdk/prompt-deadline-manager.d.ts +38 -1
- package/dist/types/sdk/prompt-failure.d.ts +30 -1
- package/dist/types/sdk/prompt-status.d.ts +8 -0
- package/dist/types/sdk/prompt-tool-boundary.d.ts +73 -0
- package/dist/types/sdk/router/replay-retention-gap-cache.d.ts +13 -0
- package/dist/types/sdk/router/session-router.d.ts +2 -0
- package/dist/types/sdk/startup-capability.d.ts +2 -0
- package/dist/types/sdk/transport/relay.d.ts +1 -0
- package/dist/types/sdk/transport/serve-cli.d.ts +73 -2
- package/dist/types/sdk/transport/stdio.d.ts +5 -1
- package/dist/types/session/agent-session.d.ts +168 -21
- package/dist/types/session/fallback-chain-controller.d.ts +6 -6
- package/dist/types/session/fold-coordinator.d.ts +17 -3
- package/dist/types/session/internal/managed-session-storage.d.ts +7 -1
- package/dist/types/session/session-manager.d.ts +64 -1
- package/dist/types/session/session-work-lease.d.ts +14 -0
- package/dist/types/setup/model-onboarding-guidance.d.ts +1 -1
- package/dist/types/setup/provider-onboarding.d.ts +81 -1
- package/dist/types/thinking.d.ts +3 -1
- package/dist/types/tools/bash.d.ts +37 -11
- package/dist/types/tools/job.d.ts +1 -1
- package/dist/types/tools/steer-fold.d.ts +31 -0
- package/dist/types/utils/git.d.ts +28 -2
- package/dist/types/utils/mupdf-embedded.d.ts +2 -0
- package/dist/types/utils/mupdf-wasm-embedded.d.ts +2 -0
- package/dist/types/utils/mupdf.d.ts +4 -0
- package/dist/types/utils/session-title-generation.d.ts +6 -0
- package/dist/types/utils/title-generator.d.ts +11 -2
- package/dist/types/web/scrapers/types.d.ts +3 -0
- package/package.json +18 -10
- package/scripts/build-binary.ts +9 -3
- package/scripts/compile-args.ts +0 -9
- package/scripts/embed-mupdf.ts +52 -0
- package/scripts/generate-sdk-operation-inventory.ts +31 -1
- package/scripts/vendor-markit.ts +196 -0
- package/src/async/job-manager.ts +60 -9
- package/src/cli/daemon-cli.ts +53 -18
- package/src/cli/github-release.ts +87 -5
- package/src/cli/mcp-cli.ts +38 -4
- package/src/cli/public-command-entry.ts +450 -0
- package/src/cli/public-command-errors.ts +581 -0
- package/src/cli/public-command-evidence.ts +717 -0
- package/src/cli/public-command-help.ts +360 -0
- package/src/cli/public-command-registry.ts +535 -0
- package/src/cli/session-picker.ts +2 -1
- package/src/cli/setup-cli.ts +9 -1
- package/src/cli/skills-cli.ts +46 -2
- package/src/cli.ts +61 -1
- package/src/commands/daemon.ts +65 -69
- package/src/commands/sdk.ts +232 -100
- package/src/commands/setup.ts +2 -0
- package/src/commands/skills.ts +11 -0
- package/src/config/autorouting-tier-map.ts +16 -0
- package/src/config/file-lock.ts +199 -68
- package/src/config/model-profile-activation.ts +406 -53
- package/src/config/model-registry.ts +204 -25
- package/src/config/settings-schema.ts +26 -2
- package/src/coordinator-mcp/policy.ts +10 -5
- package/src/coordinator-mcp/question-gate-codec.ts +17 -0
- package/src/coordinator-mcp/question-state.ts +175 -8
- package/src/coordinator-mcp/server.ts +528 -87
- package/src/coordinator-mcp/session-reaper.ts +6 -4
- package/src/crash/record-loader.ts +6 -2
- package/src/daemon/operator-contract.ts +26 -12
- package/src/debug/report-bundle.ts +114 -24
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +1 -1
- package/src/eval/js/context-manager.ts +8 -8
- package/src/eval/js/worker-core.ts +9 -4
- package/src/eval/js/worker-protocol.ts +2 -0
- package/src/extensibility/extensions/runner.ts +52 -4
- package/src/extensibility/extensions/types.ts +10 -0
- package/src/extensibility/gjc-plugins/registry.ts +196 -37
- package/src/extensibility/runtime-skill-discovery.ts +61 -3
- package/src/extensibility/shared-events.ts +3 -1
- package/src/gjc-runtime/managed-owner-admission.ts +67 -50
- package/src/gjc-runtime/session-state-lock.ts +165 -24
- package/src/gjc-runtime/ultragoal-succession.ts +31 -3
- package/src/internal-urls/docs-index.generated.ts +21 -19
- package/src/internal-urls/embedded-protocol.ts +83 -0
- package/src/internal-urls/index.ts +1 -0
- package/src/internal-urls/parse.ts +21 -1
- package/src/internal-urls/router.ts +4 -2
- package/src/main.ts +123 -55
- package/src/modes/acp/acp-agent.ts +593 -47
- package/src/modes/acp/acp-event-mapper.ts +9 -0
- package/src/modes/acp/startup-provenance.ts +59 -0
- package/src/modes/components/custom-provider-wizard.ts +308 -7
- package/src/modes/components/model-selector.ts +31 -15
- package/src/modes/components/oauth-selector.ts +9 -0
- package/src/modes/components/session-selector.ts +47 -4
- package/src/modes/components/status-line/segments.ts +6 -1
- package/src/modes/components/thinking-selector.ts +7 -3
- package/src/modes/components/user-message-selector.ts +57 -15
- package/src/modes/controllers/command-controller.ts +58 -32
- package/src/modes/controllers/extension-ui-controller.ts +33 -7
- package/src/modes/controllers/input-controller.ts +4 -0
- package/src/modes/controllers/selector-controller.ts +177 -18
- package/src/modes/interactive-mode.ts +21 -7
- package/src/modes/runtime-init.ts +1 -0
- package/src/modes/shared/agent-wire/workflow-gate-broker.ts +124 -7
- package/src/modes/shared/agent-wire/workflow-gate-types.ts +16 -2
- package/src/modes/types.ts +2 -2
- package/src/prompts/agent-fragments/browser-aside.md +1 -0
- package/src/prompts/system/title-system.md +1 -1
- package/src/prompts/tools/bash.md +1 -1
- package/src/prompts/tools/job.md +1 -1
- package/src/prompts/tools/read.md +2 -0
- package/src/runtime/network-prewarm-service.test.ts +36 -1
- package/src/runtime/network-prewarm-service.ts +28 -3
- package/src/runtime/process-lifecycle.ts +22 -11
- package/src/runtime-mcp/config.ts +16 -1
- package/src/runtime-mcp/manager.ts +689 -55
- package/src/runtime-mcp/pool.test.ts +31 -0
- package/src/runtime-mcp/pool.ts +304 -28
- package/src/runtime-mcp/redaction.ts +42 -0
- package/src/runtime-mcp/startup-policy.ts +7 -0
- package/src/runtime-mcp/tool-bridge.ts +71 -0
- package/src/runtime-mcp/transports/http.ts +108 -25
- package/src/sdk/acp/adapter.ts +90 -9
- package/src/sdk/acp/final-text.ts +19 -2
- package/src/sdk/broker/broker.ts +378 -52
- package/src/sdk/broker/ensure.ts +97 -19
- package/src/sdk/broker/identity.ts +9 -1
- package/src/sdk/broker/lifecycle-ledger.ts +95 -31
- package/src/sdk/broker/lifecycle.ts +690 -141
- package/src/sdk/broker/runtime.ts +1 -1
- package/src/sdk/broker/session-index.ts +97 -4
- package/src/sdk/broker/spawn-authority.ts +35 -7
- package/src/sdk/broker/stderr-drainer.ts +59 -0
- package/src/sdk/bus/chat-daemon-control.ts +2 -2
- package/src/sdk/bus/chat-daemon-runtime.ts +1 -0
- package/src/sdk/bus/index.ts +721 -84
- package/src/sdk/bus/telegram-daemon-cli.ts +31 -2
- package/src/sdk/bus/telegram-daemon-contract.ts +3 -1
- package/src/sdk/bus/telegram-daemon.ts +10 -3
- package/src/sdk/cli/master-cli.ts +47 -36
- package/src/sdk/cli/rows.ts +30 -7
- package/src/sdk/cli/session-cli.ts +687 -184
- package/src/sdk/client/client.ts +18 -0
- package/src/sdk/guides/catalog.ts +2 -2
- package/src/sdk/guides/cli.ts +20 -62
- package/src/sdk/guides/verify.ts +14 -0
- package/src/sdk/host/host.ts +49 -5
- package/src/sdk/host/session-runtime.test.ts +636 -9
- package/src/sdk/host/session-runtime.ts +499 -118
- package/src/sdk/host/types.ts +12 -1
- package/src/sdk/host/websocket-transport.lifecycle.test.ts +84 -0
- package/src/sdk/host/websocket-transport.ts +40 -6
- package/src/sdk/index.ts +11 -0
- package/src/sdk/prompt-deadline-flush.ts +334 -0
- package/src/sdk/prompt-deadline-manager.ts +136 -4
- package/src/sdk/prompt-failure.ts +43 -1
- package/src/sdk/prompt-status.ts +8 -0
- package/src/sdk/prompt-tool-boundary.ts +121 -0
- package/src/sdk/protocol/operation-inventory.generated.json +106 -0
- package/src/sdk/router/replay-retention-gap-cache.ts +27 -0
- package/src/sdk/router/session-router.ts +31 -4
- package/src/sdk/session.ts +194 -16
- package/src/sdk/startup-capability.ts +1 -1
- package/src/sdk/transport/relay.ts +71 -6
- package/src/sdk/transport/serve-cli.ts +494 -49
- package/src/sdk/transport/socket.ts +12 -11
- package/src/sdk/transport/stdio.ts +7 -3
- package/src/session/agent-session.ts +2437 -400
- package/src/session/fallback-chain-controller.ts +6 -7
- package/src/session/fold-coordinator.ts +24 -5
- package/src/session/internal/managed-session-scope.ts +58 -18
- package/src/session/internal/managed-session-storage.ts +304 -11
- package/src/session/session-manager.ts +382 -44
- package/src/session/session-work-lease.ts +34 -0
- package/src/session-import/codex.ts +12 -3
- package/src/setup/model-onboarding-guidance.ts +1 -1
- package/src/setup/provider-onboarding.ts +397 -24
- package/src/slash-commands/builtin-registry.ts +258 -14
- package/src/task/index.ts +14 -2
- package/src/thinking.ts +21 -2
- package/src/tools/bash.ts +98 -78
- package/src/tools/fetch.ts +119 -20
- package/src/tools/job.ts +151 -25
- package/src/tools/output-meta.ts +15 -2
- package/src/tools/path-utils.ts +27 -3
- package/src/tools/read.ts +3 -3
- package/src/tools/steer-fold.ts +107 -0
- package/src/tools/tool-catalog.generated.ts +29 -2
- package/src/tools/tool-errors.ts +4 -0
- package/src/utils/git.ts +53 -3
- package/src/utils/markit.ts +55 -41
- package/src/utils/mupdf-assets.d.ts +4 -0
- package/src/utils/mupdf-embedded.ts +4 -0
- package/src/utils/mupdf-wasm-embedded.ts +3 -0
- package/src/utils/mupdf-wasm.ts +24 -2
- package/src/utils/mupdf.ts +129 -0
- package/src/utils/session-title-generation.ts +29 -0
- package/src/utils/title-generator.ts +46 -2
- package/src/web/scrapers/types.ts +24 -3
- package/vendor/markit-ai/LICENSE +21 -0
- package/vendor/markit-ai/MANIFEST.json +412 -0
- package/vendor/markit-ai/dist/commands/config.d.ts +4 -0
- package/vendor/markit-ai/dist/commands/config.js +139 -0
- package/vendor/markit-ai/dist/commands/convert.d.ts +6 -0
- package/vendor/markit-ai/dist/commands/convert.js +113 -0
- package/vendor/markit-ai/dist/commands/formats.d.ts +2 -0
- package/vendor/markit-ai/dist/commands/formats.js +92 -0
- package/vendor/markit-ai/dist/commands/init.d.ts +2 -0
- package/vendor/markit-ai/dist/commands/init.js +29 -0
- package/vendor/markit-ai/dist/commands/onboard.d.ts +2 -0
- package/vendor/markit-ai/dist/commands/onboard.js +61 -0
- package/vendor/markit-ai/dist/commands/plugin.d.ts +4 -0
- package/vendor/markit-ai/dist/commands/plugin.js +58 -0
- package/vendor/markit-ai/dist/config.d.ts +26 -0
- package/vendor/markit-ai/dist/config.js +42 -0
- package/vendor/markit-ai/dist/converters/audio.d.ts +7 -0
- package/vendor/markit-ai/dist/converters/audio.js +104 -0
- package/vendor/markit-ai/dist/converters/csv.d.ts +7 -0
- package/vendor/markit-ai/dist/converters/csv.js +83 -0
- package/vendor/markit-ai/dist/converters/docx.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/docx.js +57 -0
- package/vendor/markit-ai/dist/converters/epub.d.ts +8 -0
- package/vendor/markit-ai/dist/converters/epub.js +128 -0
- package/vendor/markit-ai/dist/converters/github.d.ts +18 -0
- package/vendor/markit-ai/dist/converters/github.js +148 -0
- package/vendor/markit-ai/dist/converters/html.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/html.js +30 -0
- package/vendor/markit-ai/dist/converters/image.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/image.js +124 -0
- package/vendor/markit-ai/dist/converters/ipynb.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/ipynb.js +75 -0
- package/vendor/markit-ai/dist/converters/iwork.d.ts +20 -0
- package/vendor/markit-ai/dist/converters/iwork.js +391 -0
- package/vendor/markit-ai/dist/converters/json.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/json.js +21 -0
- package/vendor/markit-ai/dist/converters/pdf/columns.d.ts +35 -0
- package/vendor/markit-ai/dist/converters/pdf/columns.js +93 -0
- package/vendor/markit-ai/dist/converters/pdf/extract.d.ts +19 -0
- package/vendor/markit-ai/dist/converters/pdf/extract.js +514 -0
- package/vendor/markit-ai/dist/converters/pdf/grid.d.ts +25 -0
- package/vendor/markit-ai/dist/converters/pdf/grid.js +795 -0
- package/vendor/markit-ai/dist/converters/pdf/headers.d.ts +24 -0
- package/vendor/markit-ai/dist/converters/pdf/headers.js +108 -0
- package/vendor/markit-ai/dist/converters/pdf/index.d.ts +19 -0
- package/vendor/markit-ai/dist/converters/pdf/index.js +136 -0
- package/vendor/markit-ai/dist/converters/pdf/mupdf-loader.js +9 -0
- package/vendor/markit-ai/dist/converters/pdf/render.d.ts +24 -0
- package/vendor/markit-ai/dist/converters/pdf/render.js +513 -0
- package/vendor/markit-ai/dist/converters/pdf/types.d.ts +75 -0
- package/vendor/markit-ai/dist/converters/pdf/types.js +1 -0
- package/vendor/markit-ai/dist/converters/plain-text.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/plain-text.js +87 -0
- package/vendor/markit-ai/dist/converters/pptx.d.ts +8 -0
- package/vendor/markit-ai/dist/converters/pptx.js +289 -0
- package/vendor/markit-ai/dist/converters/rss.d.ts +11 -0
- package/vendor/markit-ai/dist/converters/rss.js +138 -0
- package/vendor/markit-ai/dist/converters/wikipedia.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/wikipedia.js +33 -0
- package/vendor/markit-ai/dist/converters/xlsx.d.ts +8 -0
- package/vendor/markit-ai/dist/converters/xlsx.js +147 -0
- package/vendor/markit-ai/dist/converters/xml.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/xml.js +18 -0
- package/vendor/markit-ai/dist/converters/yaml.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/yaml.js +17 -0
- package/vendor/markit-ai/dist/converters/zip.d.ts +8 -0
- package/vendor/markit-ai/dist/converters/zip.js +57 -0
- package/vendor/markit-ai/dist/index.d.ts +30 -0
- package/vendor/markit-ai/dist/index.js +26 -0
- package/vendor/markit-ai/dist/main.d.ts +2 -0
- package/vendor/markit-ai/dist/main.js +191 -0
- package/vendor/markit-ai/dist/markit.d.ts +45 -0
- package/vendor/markit-ai/dist/markit.js +267 -0
- package/vendor/markit-ai/dist/plugins/api.d.ts +7 -0
- package/vendor/markit-ai/dist/plugins/api.js +42 -0
- package/vendor/markit-ai/dist/plugins/index.d.ts +4 -0
- package/vendor/markit-ai/dist/plugins/index.js +3 -0
- package/vendor/markit-ai/dist/plugins/installer.d.ts +25 -0
- package/vendor/markit-ai/dist/plugins/installer.js +176 -0
- package/vendor/markit-ai/dist/plugins/loader.d.ts +6 -0
- package/vendor/markit-ai/dist/plugins/loader.js +61 -0
- package/vendor/markit-ai/dist/plugins/types.d.ts +25 -0
- package/vendor/markit-ai/dist/plugins/types.js +1 -0
- package/vendor/markit-ai/dist/providers/anthropic.d.ts +2 -0
- package/vendor/markit-ai/dist/providers/anthropic.js +47 -0
- package/vendor/markit-ai/dist/providers/index.d.ts +21 -0
- package/vendor/markit-ai/dist/providers/index.js +56 -0
- package/vendor/markit-ai/dist/providers/openai.d.ts +2 -0
- package/vendor/markit-ai/dist/providers/openai.js +76 -0
- package/vendor/markit-ai/dist/providers/types.d.ts +26 -0
- package/vendor/markit-ai/dist/providers/types.js +1 -0
- package/vendor/markit-ai/dist/types.d.ts +36 -0
- package/vendor/markit-ai/dist/types.js +1 -0
- package/vendor/markit-ai/dist/utils/exit-codes.d.ts +4 -0
- package/vendor/markit-ai/dist/utils/exit-codes.js +4 -0
- package/vendor/markit-ai/dist/utils/output.d.ts +22 -0
- package/vendor/markit-ai/dist/utils/output.js +31 -0
- package/vendor/markit-ai/dist/utils/turndown.d.ts +8 -0
- package/vendor/markit-ai/dist/utils/turndown.js +70 -0
- package/vendor/markit-ai/package.json +74 -0
- package/vendor/markit-ai.patch +49 -0
package/src/cli/skills-cli.ts
CHANGED
|
@@ -8,7 +8,11 @@ import {
|
|
|
8
8
|
type EmbeddedDefaultGjcSkill,
|
|
9
9
|
getEmbeddedDefaultGjcSkills,
|
|
10
10
|
} from "../defaults/gjc-defaults";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
discoverRuntimeSkills,
|
|
13
|
+
type RuntimeSkillDiscoveryCandidate,
|
|
14
|
+
SKILL_DISCOVERY_MAX_LIMIT,
|
|
15
|
+
} from "../extensibility/runtime-skill-discovery";
|
|
12
16
|
|
|
13
17
|
export type SkillsAction = "list" | "read" | "discover";
|
|
14
18
|
|
|
@@ -18,6 +22,11 @@ export interface SkillsCommandArgs {
|
|
|
18
22
|
flags?: {
|
|
19
23
|
json?: boolean;
|
|
20
24
|
source?: "all" | "project" | "user";
|
|
25
|
+
/** Max discover results; clamped to [1, SKILL_DISCOVERY_MAX_LIMIT] by the library. */
|
|
26
|
+
limit?: number;
|
|
27
|
+
/** Zero-based start of the discover page; normalized by the library. */
|
|
28
|
+
offset?: number;
|
|
29
|
+
query?: string;
|
|
21
30
|
};
|
|
22
31
|
}
|
|
23
32
|
|
|
@@ -54,6 +63,25 @@ function formatCandidate(candidate: RuntimeSkillDiscoveryCandidate): string {
|
|
|
54
63
|
return `${candidate.name}\t${candidate.source}\t${candidate.description}\t${candidate.path}${useWhen}`;
|
|
55
64
|
}
|
|
56
65
|
|
|
66
|
+
/** Shell-quote only when needed, so a single-word query stays copy-pasteable as typed. */
|
|
67
|
+
function quoteArg(value: string): string {
|
|
68
|
+
if (/^[\w.,:/@=+-]+$/.test(value)) return value;
|
|
69
|
+
return `'${value.replaceAll("'", `'\\''`)}'`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The continuation command, echoing back the filters the invocation carried so
|
|
74
|
+
* the printed line is runnable verbatim rather than a hint the user has to
|
|
75
|
+
* reassemble.
|
|
76
|
+
*/
|
|
77
|
+
function formatNextPageCommand(flags: SkillsCommandArgs["flags"], nextOffset: number): string {
|
|
78
|
+
const parts = ["gjc skills discover", `--offset ${nextOffset}`];
|
|
79
|
+
if (flags?.limit !== undefined) parts.push(`--limit ${flags.limit}`);
|
|
80
|
+
if (flags?.query) parts.push(`--query ${quoteArg(flags.query)}`);
|
|
81
|
+
if (flags?.source && flags.source !== "all") parts.push(`--source ${flags.source}`);
|
|
82
|
+
return parts.join(" ");
|
|
83
|
+
}
|
|
84
|
+
|
|
57
85
|
export async function runSkillsCommand(cmd: SkillsCommandArgs): Promise<void> {
|
|
58
86
|
if (cmd.action === "list") {
|
|
59
87
|
const skills = listEmbeddedSkills();
|
|
@@ -74,18 +102,34 @@ export async function runSkillsCommand(cmd: SkillsCommandArgs): Promise<void> {
|
|
|
74
102
|
const result = await discoverRuntimeSkills({
|
|
75
103
|
cwd: process.cwd(),
|
|
76
104
|
source,
|
|
105
|
+
query: cmd.flags?.query,
|
|
106
|
+
// A human paging the catalog defaults to the widest page the library
|
|
107
|
+
// serves; the library default stays sized for the agent tool's context.
|
|
108
|
+
limit: cmd.flags?.limit ?? SKILL_DISCOVERY_MAX_LIMIT,
|
|
109
|
+
offset: cmd.flags?.offset,
|
|
77
110
|
policy: {
|
|
78
111
|
...settings.getGroup("skills"),
|
|
79
112
|
disabledExtensions: settings.get("disabledExtensions"),
|
|
80
113
|
},
|
|
81
114
|
});
|
|
82
115
|
if (cmd.flags?.json) {
|
|
83
|
-
writeJson({
|
|
116
|
+
writeJson({
|
|
117
|
+
candidates: result.candidates,
|
|
118
|
+
scanned: result.scanned,
|
|
119
|
+
matching: result.matching,
|
|
120
|
+
offset: result.offset,
|
|
121
|
+
// Omitted, not null: absence is how the final page is reported.
|
|
122
|
+
...(result.nextOffset === undefined ? {} : { nextOffset: result.nextOffset }),
|
|
123
|
+
diagnostics: result.diagnostics.messages,
|
|
124
|
+
});
|
|
84
125
|
return;
|
|
85
126
|
}
|
|
86
127
|
for (const candidate of result.candidates) {
|
|
87
128
|
process.stdout.write(`${formatCandidate(candidate)}\n`);
|
|
88
129
|
}
|
|
130
|
+
if (result.nextOffset !== undefined) {
|
|
131
|
+
process.stdout.write(`\nNext page: ${formatNextPageCommand(cmd.flags, result.nextOffset)}\n`);
|
|
132
|
+
}
|
|
89
133
|
if (result.diagnostics.messages.length > 0) {
|
|
90
134
|
process.stdout.write("\nDiagnostics:\n");
|
|
91
135
|
for (const message of result.diagnostics.messages) {
|
package/src/cli.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
+
import type { CommandEntry } from "@gajae-code/utils/cli";
|
|
3
4
|
/** Lightweight CLI bootstrap. Heavy command registration is loaded only after
|
|
4
5
|
* security admission; `gjc doctor` stays reachable when normal startup breaks. */
|
|
5
|
-
import { APP_NAME, formatBunRuntimeError, MIN_BUN_VERSION } from "@gajae-code/utils/dirs";
|
|
6
|
+
import { APP_NAME, formatBunRuntimeError, MIN_BUN_VERSION, VERSION } from "@gajae-code/utils/dirs";
|
|
6
7
|
import { startTiming } from "@gajae-code/utils/logger";
|
|
7
8
|
import {
|
|
8
9
|
BASH_SHELL_RUNTIME_ARG,
|
|
9
10
|
BASH_SHELL_SUPERVISOR_ARG,
|
|
10
11
|
BASH_SHELL_WORKER_ARG,
|
|
11
12
|
} from "./exec/bash-shell-worker-protocol";
|
|
13
|
+
import { runSdkStderrDrainerFromArgv } from "./sdk/broker/stderr-drainer";
|
|
12
14
|
|
|
13
15
|
const MANAGED_OWNER_SUPERVISOR_ARG = "--internal-managed-owner-supervisor";
|
|
14
16
|
const MANAGED_OWNER_CHILD_TOKEN_ENV = "GJC_MANAGED_OWNER_CHILD_TOKEN";
|
|
@@ -28,6 +30,49 @@ if (Bun.semver.order(Bun.version, MIN_BUN_VERSION) < 0) {
|
|
|
28
30
|
}
|
|
29
31
|
process.title = APP_NAME;
|
|
30
32
|
|
|
33
|
+
/** Public-family hooks kept available for private-worker tests without loading the full registry. */
|
|
34
|
+
export const commands: CommandEntry[] = [
|
|
35
|
+
{ name: "sdk", load: () => import("./commands/sdk").then(module => module.default) },
|
|
36
|
+
{ name: "daemon", load: () => import("./commands/daemon").then(module => module.default) },
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
async function installRuntimeGlobals(writeNoFileWarning?: (text: string) => void): Promise<void> {
|
|
40
|
+
const { installH2Fetch } = await import("@gajae-code/ai/utils/h2-fetch");
|
|
41
|
+
// Activate HTTP/2 for all `fetch()` calls (provider streams, OAuth, model
|
|
42
|
+
// discovery, web tools). Bun's HTTP/2 client is gated on a startup flag we
|
|
43
|
+
// can't toggle from JS, so we patch globalThis.fetch to pass
|
|
44
|
+
// `protocol: "http2"` per request, with transparent HTTP/1.1 fallback on
|
|
45
|
+
// `HTTP2Unsupported`. See @gajae-code/ai/utils/h2-fetch for details.
|
|
46
|
+
installH2Fetch();
|
|
47
|
+
|
|
48
|
+
const { warnIfMacOSNoFileLimitTooLow } = await import("./cli/nofile-limit");
|
|
49
|
+
warnIfMacOSNoFileLimitTooLow({ writeStderr: writeNoFileWarning });
|
|
50
|
+
|
|
51
|
+
// Secondary in-process scrub of the macOS malloc-stack-logging vars. The real
|
|
52
|
+
// boundary is the darwin re-exec guard at the top of runCli(): Bun snapshots the
|
|
53
|
+
// spawn-default environment at startup, so deleting these here does NOT clean the
|
|
54
|
+
// env children inherit by default — it only tidies `process.env` for code that
|
|
55
|
+
// reads it directly. Kept as belt-and-braces for the rare re-exec-unavailable
|
|
56
|
+
// fallback; managed spawns already use filterProcessEnv and the native PTY lane
|
|
57
|
+
// strips them independently.
|
|
58
|
+
delete process.env.MallocStackLogging;
|
|
59
|
+
delete process.env.MallocStackLoggingNoCompact;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function dispatchPublicFamily(argv: string[]): Promise<void> {
|
|
63
|
+
const family = argv[0];
|
|
64
|
+
if (family !== "sdk" && family !== "daemon") return;
|
|
65
|
+
const { dispatchPublicCommand } = await import("./cli/public-command-entry");
|
|
66
|
+
const load = commands.find(entry => entry.name === family)!.load;
|
|
67
|
+
await dispatchPublicCommand(argv.slice(1), {
|
|
68
|
+
bin: APP_NAME,
|
|
69
|
+
version: VERSION,
|
|
70
|
+
command: family,
|
|
71
|
+
load,
|
|
72
|
+
setup: report => installRuntimeGlobals(text => report({ code: "macos_nofile_limit_low", successStderr: text })),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
31
76
|
function isDoctorArgv(argv: readonly string[]): boolean {
|
|
32
77
|
return argv[0] === "doctor";
|
|
33
78
|
}
|
|
@@ -92,6 +137,21 @@ export async function runCli(argv: string[]): Promise<void> {
|
|
|
92
137
|
return;
|
|
93
138
|
}
|
|
94
139
|
}
|
|
140
|
+
if (argv[0] === "sdk" && argv[1] === "stderr-drain-internal") {
|
|
141
|
+
// Private lifecycle stderr drainer: must stay ahead of the public sdk family
|
|
142
|
+
// dispatcher, which would otherwise reject the private argv as a usage error.
|
|
143
|
+
try {
|
|
144
|
+
await runSdkStderrDrainerFromArgv(argv.slice(2));
|
|
145
|
+
} catch {
|
|
146
|
+
process.stderr.write("gjc sdk: invalid internal stderr drainer invocation\n");
|
|
147
|
+
process.exitCode = 2;
|
|
148
|
+
}
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (argv[0] === "sdk" || argv[0] === "daemon") {
|
|
152
|
+
await dispatchPublicFamily(argv);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
95
155
|
if (argv.length === 1 && argv[0] === "--supports-macos-community-app") {
|
|
96
156
|
process.stdout.write("macos-community-app-offer\n");
|
|
97
157
|
return;
|
package/src/commands/daemon.ts
CHANGED
|
@@ -1,93 +1,89 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/** Manage public daemon operations while keeping worker grammar private. */
|
|
2
|
+
import {
|
|
3
|
+
type ArgDescriptor,
|
|
4
|
+
Args,
|
|
5
|
+
CliParseError,
|
|
6
|
+
Command,
|
|
7
|
+
type FlagDescriptor,
|
|
8
|
+
Flags,
|
|
9
|
+
type ParseOutput,
|
|
10
|
+
} from "@gajae-code/utils/cli";
|
|
5
11
|
import {
|
|
6
12
|
type DaemonCommandAction,
|
|
7
13
|
type DaemonCommandArgs,
|
|
8
14
|
isDaemonInternalAction,
|
|
9
15
|
runDaemonCommand,
|
|
10
16
|
} from "../cli/daemon-cli";
|
|
17
|
+
import { PublicCommandFailure } from "../cli/public-command-errors";
|
|
18
|
+
import { getPublicCommand } from "../cli/public-command-registry";
|
|
11
19
|
import type { DaemonKind } from "../daemon/control-types";
|
|
12
|
-
import {
|
|
20
|
+
import { resolveDaemonAction } from "../daemon/operator-contract";
|
|
13
21
|
import { initTheme } from "../modes/theme/theme";
|
|
14
22
|
|
|
15
|
-
const ACTIONS = [...DAEMON_ACTION_TOKENS, "discord-internal", "slack-internal"] as const;
|
|
16
|
-
|
|
17
|
-
function parsePositiveTimeout(raw: string | undefined, flagName: string): number | undefined {
|
|
18
|
-
if (raw === undefined) return undefined;
|
|
19
|
-
if (!/^[0-9]+$/.test(raw)) {
|
|
20
|
-
throw new CliParseError(`Expected ${flagName} to be a positive safe integer, got "${raw}"`);
|
|
21
|
-
}
|
|
22
|
-
const value = Number(raw);
|
|
23
|
-
if (!Number.isSafeInteger(value) || value <= 0) {
|
|
24
|
-
throw new CliParseError(`Expected ${flagName} to be a positive safe integer, got "${raw}"`);
|
|
25
|
-
}
|
|
26
|
-
return value;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
23
|
export default class Daemon extends Command {
|
|
30
|
-
static description =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
static examples = [
|
|
34
|
-
"# Check the daemon (concise per-daemon result)\n gjc daemon status",
|
|
35
|
-
"# Reload, spawning a fresh owner if none is running\n gjc daemon restart",
|
|
36
|
-
"# Full runtime detail and the roots list\n gjc daemon status --verbose",
|
|
37
|
-
"# Machine-readable output for automation\n gjc daemon status --json",
|
|
38
|
-
"# Stop, hard-killing an unresponsive owner\n gjc daemon stop --force",
|
|
39
|
-
];
|
|
40
|
-
|
|
41
|
-
static args = {
|
|
42
|
-
action: Args.string({
|
|
43
|
-
description: "Daemon action (status, restart, reload, stop, list)",
|
|
44
|
-
required: false,
|
|
45
|
-
options: [...ACTIONS] as string[],
|
|
46
|
-
}),
|
|
47
|
-
kind: Args.string({ description: "Daemon kind(s) to target", required: false, multiple: true }),
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
static flags = {
|
|
51
|
-
verbose: Flags.boolean({ char: "v", description: "Show runtime detail and the full roots list" }),
|
|
52
|
-
all: Flags.boolean({ description: "Target all registered daemon kinds" }),
|
|
53
|
-
json: Flags.boolean({ description: "Emit JSON output" }),
|
|
54
|
-
force: Flags.boolean({ description: "Allow hard-kill escalation when graceful stop times out" }),
|
|
55
|
-
"graceful-timeout-ms": Flags.string({ description: "Cooperative stop timeout before escalation" }),
|
|
56
|
-
"kill-timeout-ms": Flags.string({ description: "Wait for old pid death after SIGKILL" }),
|
|
57
|
-
"spawn-if-stopped": Flags.boolean({ description: "On restart, spawn even when no daemon is running" }),
|
|
58
|
-
smoke: Flags.boolean({ description: "Internal: run worker smoke without configuration or network" }),
|
|
59
|
-
"owner-id": Flags.string({ description: "Internal: daemon owner id" }),
|
|
60
|
-
"agent-dir": Flags.string({ description: "Internal: daemon state directory" }),
|
|
61
|
-
};
|
|
24
|
+
static description = getPublicCommand(["daemon"])!.description;
|
|
25
|
+
static args: Record<string, ArgDescriptor> = getPublicCommand(["daemon"])!.args;
|
|
26
|
+
static flags: Record<string, FlagDescriptor> = getPublicCommand(["daemon"])!.flags;
|
|
62
27
|
|
|
63
28
|
async run(): Promise<void> {
|
|
64
|
-
const
|
|
65
|
-
const
|
|
29
|
+
const internal = isDaemonInternalAction(this.argv[0] as DaemonCommandAction);
|
|
30
|
+
const resolved = resolveDaemonAction(this.argv[0]);
|
|
31
|
+
const action = (internal ? this.argv[0] : (resolved ?? "status")) as DaemonCommandAction;
|
|
32
|
+
const descriptor = getPublicCommand(["daemon", resolved ?? "status"])!;
|
|
33
|
+
class PublicDaemonOperation extends Daemon {
|
|
34
|
+
static args = { kind: { ...descriptor.args.kind!, options: undefined } };
|
|
35
|
+
static flags = descriptor.flags;
|
|
36
|
+
}
|
|
37
|
+
const parser = internal
|
|
38
|
+
? new DaemonWorker(this.argv, this.config)
|
|
39
|
+
: new PublicDaemonOperation(resolved ? this.argv.slice(1) : this.argv, this.config);
|
|
40
|
+
let parsed: ParseOutput;
|
|
41
|
+
try {
|
|
42
|
+
parsed = await parser.parse((internal ? DaemonWorker : PublicDaemonOperation) as typeof Daemon);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
if (!internal && error instanceof CliParseError)
|
|
45
|
+
throw new PublicCommandFailure({ kind: "usage", proof: "pre-effect" });
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
const { args, flags } = parsed;
|
|
49
|
+
const timeout = (name: string): number | undefined => {
|
|
50
|
+
const raw = flags[name];
|
|
51
|
+
if (raw === undefined) return undefined;
|
|
52
|
+
if (
|
|
53
|
+
typeof raw !== "string" ||
|
|
54
|
+
!/^[0-9]+$/.test(raw) ||
|
|
55
|
+
!Number.isSafeInteger(Number(raw)) ||
|
|
56
|
+
Number(raw) <= 0
|
|
57
|
+
) {
|
|
58
|
+
throw new PublicCommandFailure({ kind: "usage", proof: "pre-effect" });
|
|
59
|
+
}
|
|
60
|
+
return Number(raw);
|
|
61
|
+
};
|
|
66
62
|
const positional = Array.isArray(args.kind) ? args.kind : args.kind ? [args.kind] : [];
|
|
67
|
-
const flagRec = flags as Record<string, unknown>;
|
|
68
|
-
const gracefulTimeoutMs = parsePositiveTimeout(
|
|
69
|
-
flagRec["graceful-timeout-ms"] as string | undefined,
|
|
70
|
-
"--graceful-timeout-ms",
|
|
71
|
-
);
|
|
72
|
-
const killTimeoutMs = parsePositiveTimeout(flagRec["kill-timeout-ms"] as string | undefined, "--kill-timeout-ms");
|
|
73
|
-
const action = (resolveDaemonAction(rawAction) ?? rawAction) as DaemonCommandAction;
|
|
74
|
-
const kinds = positional as DaemonKind[];
|
|
75
63
|
const cmd: DaemonCommandArgs = {
|
|
76
64
|
action,
|
|
77
|
-
kinds,
|
|
65
|
+
kinds: positional as DaemonKind[],
|
|
78
66
|
all: Boolean(flags.all),
|
|
79
67
|
json: Boolean(flags.json),
|
|
80
68
|
force: Boolean(flags.force),
|
|
81
69
|
verbose: Boolean(flags.verbose),
|
|
82
|
-
gracefulTimeoutMs,
|
|
83
|
-
killTimeoutMs,
|
|
84
|
-
spawnIfStopped:
|
|
70
|
+
gracefulTimeoutMs: timeout("graceful-timeout-ms"),
|
|
71
|
+
killTimeoutMs: timeout("kill-timeout-ms"),
|
|
72
|
+
spawnIfStopped: flags["spawn-if-stopped"] as boolean | undefined,
|
|
85
73
|
smoke: Boolean(flags.smoke),
|
|
86
|
-
ownerId:
|
|
87
|
-
agentDir:
|
|
74
|
+
ownerId: flags["owner-id"] as string | undefined,
|
|
75
|
+
agentDir: flags["agent-dir"] as string | undefined,
|
|
88
76
|
};
|
|
89
|
-
|
|
90
|
-
if (!isDaemonInternalAction(action)) await initTheme();
|
|
77
|
+
if (!internal) await initTheme();
|
|
91
78
|
await runDaemonCommand(cmd);
|
|
92
79
|
}
|
|
93
80
|
}
|
|
81
|
+
|
|
82
|
+
class DaemonWorker extends Daemon {
|
|
83
|
+
static args = { action: Args.string({ required: true }), kind: Args.string({ multiple: true }) };
|
|
84
|
+
static flags = {
|
|
85
|
+
smoke: Flags.boolean({ description: "Run worker smoke without configuration or network" }),
|
|
86
|
+
"owner-id": Flags.string({ description: "Daemon owner id" }),
|
|
87
|
+
"agent-dir": Flags.string({ description: "Daemon state directory" }),
|
|
88
|
+
};
|
|
89
|
+
}
|