@gajae-code/coding-agent 0.17.2 → 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 +194 -0
- 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 +18 -0
- package/dist/types/config/file-lock.d.ts +9 -1
- package/dist/types/config/model-profile-activation.d.ts +45 -1
- package/dist/types/config/model-registry.d.ts +11 -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/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 +55 -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/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/broker/broker.d.ts +13 -2
- 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 +37 -0
- package/dist/types/sdk/prompt-tool-boundary.d.ts +73 -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 +48 -4
- 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/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.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 +22 -1
- 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 +175 -117
- package/src/commands/setup.ts +2 -0
- package/src/commands/skills.ts +11 -0
- package/src/config/autorouting-tier-map.ts +14 -0
- package/src/config/file-lock.ts +147 -51
- package/src/config/model-profile-activation.ts +334 -43
- package/src/config/model-registry.ts +183 -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 +507 -81
- 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/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/session-state-lock.ts +165 -24
- package/src/gjc-runtime/ultragoal-succession.ts +31 -3
- package/src/internal-urls/docs-index.generated.ts +20 -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 +408 -35
- package/src/modes/acp/startup-provenance.ts +59 -0
- package/src/modes/components/custom-provider-wizard.ts +308 -7
- package/src/modes/components/oauth-selector.ts +9 -0
- package/src/modes/components/session-selector.ts +47 -4
- 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 +161 -15
- 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 +27 -8
- package/src/sdk/broker/broker.ts +378 -52
- 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 +690 -80
- 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 +138 -2
- package/src/sdk/host/session-runtime.ts +311 -97
- 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 +133 -1
- package/src/sdk/prompt-tool-boundary.ts +121 -0
- package/src/sdk/protocol/operation-inventory.generated.json +106 -0
- package/src/sdk/router/session-router.ts +9 -1
- package/src/sdk/session.ts +182 -7
- package/src/sdk/startup-capability.ts +1 -1
- package/src/sdk/transport/relay.ts +71 -6
- package/src/sdk/transport/serve-cli.ts +397 -42
- 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/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/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.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
|
@@ -8,25 +8,40 @@ import { type Theme } from "../modes/theme/theme";
|
|
|
8
8
|
import { type SdkSpawnArgs } from "../sdk/cli/master-cli";
|
|
9
9
|
import type { ToolSession } from ".";
|
|
10
10
|
import { type OutputMeta } from "./output-meta";
|
|
11
|
+
export { STEER_FOLD_GRACE_MS, steerFoldReasonLine } from "./steer-fold";
|
|
11
12
|
export declare const BASH_DEFAULT_PREVIEW_LINES = 10;
|
|
12
|
-
/**
|
|
13
|
-
* A user steer folds a running foreground bash call only after it has been
|
|
14
|
-
* running at least this long. Shorter commands finish normally and the steer is
|
|
15
|
-
* consumed at the ordinary tool boundary, so a quick `git status` never turns
|
|
16
|
-
* into a background job plus a wake-up turn.
|
|
17
|
-
*/
|
|
18
|
-
export declare const STEER_FOLD_GRACE_MS = 2000;
|
|
19
|
-
/** Model-facing line appended to a steer-folded background-start result. */
|
|
20
|
-
export declare function steerFoldReasonLine(jobId: string): string;
|
|
21
13
|
export type BashOriginalArtifactSaveResult = BashArtifactSaveResult;
|
|
22
14
|
export declare function suffixPrefixOverlap(source: string, target: string): number;
|
|
23
15
|
export declare function saveBashOriginalArtifactForTests(session: ToolSession, originalText: string, onResult?: (result: BashOriginalArtifactSaveResult) => void): Promise<string | undefined>;
|
|
16
|
+
/**
|
|
17
|
+
* Model-declared activity metadata for the browser-backend routing contract
|
|
18
|
+
* (`browser.backend: aside`). When that contract routes a browser task through
|
|
19
|
+
* Bash, it requires the call to declare the activity structurally so consumers
|
|
20
|
+
* can project it without parsing the command text. The declaration is
|
|
21
|
+
* model-declared and schema-validated only: nothing here verifies that the
|
|
22
|
+
* command actually invokes Aside, and the executor never inspects `command`.
|
|
23
|
+
*/
|
|
24
|
+
export type BashActivityProvider = "aside";
|
|
25
|
+
export type BashActivityMode = "repl" | "exec";
|
|
26
|
+
export interface BashActivityDeclaration {
|
|
27
|
+
kind: "browser";
|
|
28
|
+
provider: BashActivityProvider;
|
|
29
|
+
mode: BashActivityMode;
|
|
30
|
+
}
|
|
24
31
|
declare const bashSchemaBase: z.ZodObject<{
|
|
25
32
|
command: z.ZodString;
|
|
26
33
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
27
34
|
timeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
28
35
|
cwd: z.ZodOptional<z.ZodString>;
|
|
29
36
|
pty: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
activity: z.ZodPreprocess<z.ZodOptional<z.ZodObject<{
|
|
38
|
+
kind: z.ZodLiteral<"browser">;
|
|
39
|
+
provider: z.ZodLiteral<"aside">;
|
|
40
|
+
mode: z.ZodEnum<{
|
|
41
|
+
exec: "exec";
|
|
42
|
+
repl: "repl";
|
|
43
|
+
}>;
|
|
44
|
+
}, z.core.$strict>>>;
|
|
30
45
|
}, z.core.$strip>;
|
|
31
46
|
declare const bashSchemaWithAsync: z.ZodObject<{
|
|
32
47
|
command: z.ZodString;
|
|
@@ -34,6 +49,14 @@ declare const bashSchemaWithAsync: z.ZodObject<{
|
|
|
34
49
|
timeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
35
50
|
cwd: z.ZodOptional<z.ZodString>;
|
|
36
51
|
pty: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
activity: z.ZodPreprocess<z.ZodOptional<z.ZodObject<{
|
|
53
|
+
kind: z.ZodLiteral<"browser">;
|
|
54
|
+
provider: z.ZodLiteral<"aside">;
|
|
55
|
+
mode: z.ZodEnum<{
|
|
56
|
+
exec: "exec";
|
|
57
|
+
repl: "repl";
|
|
58
|
+
}>;
|
|
59
|
+
}, z.core.$strict>>>;
|
|
37
60
|
async: z.ZodOptional<z.ZodBoolean>;
|
|
38
61
|
}, z.core.$strip>;
|
|
39
62
|
type BashToolSchema = typeof bashSchemaBase | typeof bashSchemaWithAsync;
|
|
@@ -44,6 +67,8 @@ export interface BashToolInput {
|
|
|
44
67
|
cwd?: string;
|
|
45
68
|
async?: boolean;
|
|
46
69
|
pty?: boolean;
|
|
70
|
+
/** Accepted activity declaration, mirrored into {@link BashToolDetails.activity}. */
|
|
71
|
+
activity?: BashActivityDeclaration;
|
|
47
72
|
}
|
|
48
73
|
export interface BashToolDetails {
|
|
49
74
|
meta?: OutputMeta;
|
|
@@ -52,6 +77,8 @@ export interface BashToolDetails {
|
|
|
52
77
|
terminalId?: string;
|
|
53
78
|
/** Why the foreground wait was folded, when this result is a background-start after a fold. */
|
|
54
79
|
foldReason?: FoldReason;
|
|
80
|
+
/** The accepted model-declared activity declaration, when the call carried one. */
|
|
81
|
+
activity?: BashActivityDeclaration;
|
|
55
82
|
async?: {
|
|
56
83
|
state: "running" | "completed" | "failed";
|
|
57
84
|
jobId: string;
|
|
@@ -104,7 +131,7 @@ export declare class BashTool implements AgentTool<BashToolSchema, BashToolDetai
|
|
|
104
131
|
label: string;
|
|
105
132
|
commandCwd: string;
|
|
106
133
|
}>;
|
|
107
|
-
execute(toolCallId: string, { command: rawCommand, env: rawEnv, timeout: rawTimeout, cwd, async: asyncRequested, pty, }: BashToolInput, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<BashToolDetails>, ctx?: AgentToolContext): Promise<AgentToolResult<BashToolDetails>>;
|
|
134
|
+
execute(toolCallId: string, { command: rawCommand, env: rawEnv, timeout: rawTimeout, cwd, async: asyncRequested, pty, activity, }: BashToolInput, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<BashToolDetails>, ctx?: AgentToolContext): Promise<AgentToolResult<BashToolDetails>>;
|
|
108
135
|
}
|
|
109
136
|
export interface BashRenderArgs {
|
|
110
137
|
command?: string;
|
|
@@ -173,4 +200,3 @@ export declare const bashToolRenderer: {
|
|
|
173
200
|
mergeCallAndResult: boolean;
|
|
174
201
|
inline: boolean;
|
|
175
202
|
};
|
|
176
|
-
export {};
|
|
@@ -15,7 +15,7 @@ type JobParams = z.infer<typeof jobSchema>;
|
|
|
15
15
|
interface JobSnapshot {
|
|
16
16
|
id: string;
|
|
17
17
|
type: "bash" | "task";
|
|
18
|
-
status: "running" | "completed" | "failed" | "cancelled";
|
|
18
|
+
status: "running" | "paused" | "completed" | "failed" | "cancelled";
|
|
19
19
|
label: string;
|
|
20
20
|
durationMs: number;
|
|
21
21
|
/** Present when the job was folded out of a foreground wait. */
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { FoldReason } from "../async/job-manager";
|
|
2
|
+
import type { ToolSession } from ".";
|
|
3
|
+
/** A short foreground wait stays in the foreground even when a steer is admitted. */
|
|
4
|
+
export declare const STEER_FOLD_GRACE_MS = 2000;
|
|
5
|
+
/** Model-facing line appended to a steer-folded background-start result. */
|
|
6
|
+
export declare function steerFoldReasonLine(jobId: string): string;
|
|
7
|
+
/** Model-facing cause clause for a fold, keyed by the recorded {@link FoldReason}. */
|
|
8
|
+
export declare function foldReasonClause(reason: FoldReason): string;
|
|
9
|
+
/** Model-facing line used when the `job` tool's own wait is folded; states the real trigger. */
|
|
10
|
+
export declare function foldAwaitReasonLine(folded: ReadonlyMap<string, FoldReason>): string;
|
|
11
|
+
type SteerFoldSession = Pick<ToolSession, "settings" | "waitForUserSteering" | "requestForegroundBashBackground">;
|
|
12
|
+
/** The session hooks a steer fold needs, resolved once so callers never re-read and non-null-assert them. */
|
|
13
|
+
interface SteerFoldHooks {
|
|
14
|
+
waitForSteer: NonNullable<ToolSession["waitForUserSteering"]>;
|
|
15
|
+
requestFold: NonNullable<ToolSession["requestForegroundBashBackground"]>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Fold on the first user steer that ARRIVES after the wait has run for
|
|
19
|
+
* {@link STEER_FOLD_GRACE_MS} since `startedAt`. A steer already queued when
|
|
20
|
+
* the wait starts, or one that arrives inside the grace window, never folds:
|
|
21
|
+
* the wait finishes normally and that steer is consumed at the ordinary tool
|
|
22
|
+
* boundary. The watcher keeps observing so a later qualifying steer still
|
|
23
|
+
* folds, and re-checks the gate at that moment so a `busyPromptMode` change
|
|
24
|
+
* during the wait is honored. `requestFold` receives the session's resolved
|
|
25
|
+
* fold request so the caller targets its own adapter without re-reading the
|
|
26
|
+
* optional session hook.
|
|
27
|
+
* Returns a stop function; call it when the wait settles. No-op when steer
|
|
28
|
+
* folding is gated off at start.
|
|
29
|
+
*/
|
|
30
|
+
export declare function watchSteerForFold(session: SteerFoldSession, startedAt: number, requestFold: (fold: SteerFoldHooks["requestFold"]) => Promise<unknown>, jobId?: string): () => void;
|
|
31
|
+
export {};
|
|
@@ -162,8 +162,12 @@ export declare const status: ((cwd: string, options?: StatusOptions) => Promise<
|
|
|
162
162
|
parse: typeof parseStatusPorcelain;
|
|
163
163
|
};
|
|
164
164
|
export declare const stage: {
|
|
165
|
-
/**
|
|
166
|
-
|
|
165
|
+
/**
|
|
166
|
+
* Stage files. Empty array stages all (`git add -A`). Accepts a bare signal or
|
|
167
|
+
* `{ env, signal }`; `env` exists so a caller can stage into an isolated
|
|
168
|
+
* `GIT_INDEX_FILE` instead of the repository's real index.
|
|
169
|
+
*/
|
|
170
|
+
files(cwd: string, files?: readonly string[], options?: AbortSignal | Pick<CommandOptions, "env" | "signal">): Promise<void>;
|
|
167
171
|
/** Selectively stage hunks from the provided diff or the current working tree diff. */
|
|
168
172
|
hunks(cwd: string, selections: HunkSelection[], options?: StageHunksOptions): Promise<void>;
|
|
169
173
|
/** Unstage files. Empty array unstages all (`git reset`). */
|
|
@@ -181,6 +185,17 @@ export declare function fetch(cwd: string, remote: string, source: string, targe
|
|
|
181
185
|
export declare function readTree(cwd: string, treeish: string, options?: Pick<CommandOptions, "env" | "signal">): Promise<void>;
|
|
182
186
|
/** Write the current index as a tree and return its object id. */
|
|
183
187
|
export declare function writeTree(cwd: string, options?: Pick<CommandOptions, "env" | "signal">): Promise<string>;
|
|
188
|
+
export interface CommitTreeOptions {
|
|
189
|
+
readonly env?: Record<string, string | undefined>;
|
|
190
|
+
readonly parents?: readonly string[];
|
|
191
|
+
readonly signal?: AbortSignal;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Create a commit object from an existing tree and return its SHA. Plumbing:
|
|
195
|
+
* unlike `commit` this touches neither the index nor any ref, and runs no
|
|
196
|
+
* `pre-commit`/`commit-msg` hook.
|
|
197
|
+
*/
|
|
198
|
+
export declare function commitTree(cwd: string, tree: string, message: string, options?: CommitTreeOptions): Promise<string>;
|
|
184
199
|
/** Run `git show` on a revision. */
|
|
185
200
|
export declare const show: ((cwd: string, revision: string, options?: {
|
|
186
201
|
format?: string;
|
|
@@ -241,6 +256,17 @@ export declare const ref: {
|
|
|
241
256
|
exists(cwd: string, refName: string, signal?: AbortSignal): Promise<boolean>;
|
|
242
257
|
/** Resolve a ref to its commit SHA. */
|
|
243
258
|
resolve(cwd: string, refName: string, signal?: AbortSignal): Promise<string | null>;
|
|
259
|
+
/**
|
|
260
|
+
* Move a ref to `newValue`, but only while it still holds `expectedOldValue`
|
|
261
|
+
* (the empty string asserts the ref does not exist yet). Git verifies the old
|
|
262
|
+
* value and writes the new one under its own ref lock, so this is an atomic
|
|
263
|
+
* compare-and-swap: a concurrent writer that moved the ref first makes this
|
|
264
|
+
* throw instead of silently clobbering their commit.
|
|
265
|
+
*/
|
|
266
|
+
update(cwd: string, refName: string, newValue: string, expectedOldValue: string, options?: {
|
|
267
|
+
reason?: string;
|
|
268
|
+
signal?: AbortSignal;
|
|
269
|
+
}): Promise<void>;
|
|
244
270
|
/** Tags pointing at a ref. */
|
|
245
271
|
tags(cwd: string, refName?: string, signal?: AbortSignal): Promise<string[]>;
|
|
246
272
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Start a new regeneration and invalidate every older completion. */
|
|
2
|
+
export declare function beginSessionTitleGeneration(owner: object): number;
|
|
3
|
+
/** Invalidate pending regeneration after a newer session mutation is accepted. */
|
|
4
|
+
export declare function invalidateSessionTitleGeneration(owner: object): void;
|
|
5
|
+
/** Return whether a regeneration still owns the latest generation lease. */
|
|
6
|
+
export declare function isSessionTitleGenerationCurrent(owner: object, generation: number): boolean;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
+
import type { AgentMessage } from "@gajae-code/agent-core";
|
|
1
2
|
import { type Api, type Model } from "@gajae-code/ai/core";
|
|
2
3
|
import type { ModelRegistry } from "../config/model-registry";
|
|
3
4
|
import type { Settings } from "../config/settings";
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* Build a bounded conversation digest for title regeneration. Regeneration
|
|
7
|
+
* reads several messages so a throwaway first prompt can be corrected, while
|
|
8
|
+
* the automatic first-message path intentionally uses only its initial input.
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildConversationTitleInput(messages: readonly AgentMessage[]): string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Generate a title for a session based on the provided user-message input.
|
|
13
|
+
* Automatic titles pass the first user message; regeneration passes a bounded
|
|
14
|
+
* conversation digest.
|
|
6
15
|
*
|
|
7
|
-
* @param firstMessage The first user message
|
|
16
|
+
* @param firstMessage The first user message or bounded conversation digest
|
|
8
17
|
* @param registry Model registry
|
|
9
18
|
* @param settings Settings used to resolve the smol role
|
|
10
19
|
* @param sessionId Optional session id for sticky API key selection
|
|
@@ -34,7 +34,10 @@ export interface LoadPageOptions {
|
|
|
34
34
|
}
|
|
35
35
|
export interface LoadPageResult {
|
|
36
36
|
content: string;
|
|
37
|
+
/** The bounded response bytes retained for binary classification/conversion. */
|
|
38
|
+
buffer?: Uint8Array;
|
|
37
39
|
contentType: string;
|
|
40
|
+
contentDisposition?: string;
|
|
38
41
|
finalUrl: string;
|
|
39
42
|
ok: boolean;
|
|
40
43
|
status?: number;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@gajae-code/coding-agent",
|
|
4
|
-
"version": "0.17.
|
|
4
|
+
"version": "0.17.4",
|
|
5
5
|
"description": "Gajae Code CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://gajae-code.com",
|
|
7
7
|
"author": "Yeachan-Heo and Gajae Code Contributors",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"가재씨": "bin/gajaessi.js"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
|
-
"build": "bun scripts/build-binary.ts",
|
|
33
|
-
"check": "biome check . && bun run check:types",
|
|
32
|
+
"build": "bun run verify:markit-vendor && bun scripts/build-binary.ts",
|
|
33
|
+
"check": "bun run verify:markit-vendor && biome check . && bun run check:types",
|
|
34
34
|
"check:runtime": "bun run generate-hotkeys-docs --check && bun run verify:sdk-canonicalization",
|
|
35
35
|
"check:types": "tsc -p tsconfig.json --noEmit",
|
|
36
36
|
"check:autorouting-map": "bun scripts/check-autorouting-tier-map.ts",
|
|
@@ -49,32 +49,40 @@
|
|
|
49
49
|
"generate-template": "bun scripts/generate-template.ts",
|
|
50
50
|
"install:defaults": "bun src/cli.ts setup defaults",
|
|
51
51
|
"verify:insane-vendor": "bun scripts/verify-insane-vendor.ts",
|
|
52
|
+
"verify:markit-vendor": "bun scripts/vendor-markit.ts --check",
|
|
52
53
|
"verify:sdk-canonicalization": "bun scripts/verify-gjc-sdk-canonicalization.ts",
|
|
53
54
|
"check:sdk-closure": "bun ../../scripts/telegram-daemon-generation-guard.ts --validate-current-tree && bun test ../../scripts/telegram-daemon-generation-guard.test.ts && bun scripts/generate-sdk-operation-inventory.ts --check && bun scripts/generate-sdk-adapter-parity-manifest.ts --check && GJC_MANIFEST_RECEIPT_CONCURRENCY=8 bun scripts/run-test-manifest.ts test/manifests/sdk-adapter-parity-v1.json && bun scripts/generate-telegram-baseline-manifest.ts --check && bun scripts/run-test-manifest.ts test/manifests/telegram-baseline-v1.json && bun test test/sdk-downgrade-rollback.test.ts test/sdk-downgrade-unknown-version.test.ts && bun scripts/verify-gjc-sdk-canonicalization.ts --self-test && bun scripts/verify-gjc-sdk-canonicalization.ts && bun scripts/verify-gjc-sdk-rename.ts"
|
|
54
55
|
},
|
|
55
56
|
"dependencies": {
|
|
56
57
|
"@agentclientprotocol/sdk": "1.3.0",
|
|
57
58
|
"@babel/parser": "^7.29.3",
|
|
58
|
-
"@gajae-code/agent-core": "0.17.2",
|
|
59
|
-
"@gajae-code/ai": "0.17.2",
|
|
60
|
-
"@gajae-code/natives": "0.17.2",
|
|
61
|
-
"@gajae-code/stats": "0.17.2",
|
|
62
|
-
"@gajae-code/tui": "0.17.2",
|
|
63
|
-
"@gajae-code/utils": "0.17.2",
|
|
64
59
|
"@mozilla/readability": "^0.6.0",
|
|
60
|
+
"@gajae-code/stats": "0.17.4",
|
|
61
|
+
"@gajae-code/agent-core": "0.17.4",
|
|
62
|
+
"@gajae-code/ai": "0.17.4",
|
|
63
|
+
"@gajae-code/natives": "0.17.4",
|
|
64
|
+
"@gajae-code/tui": "0.17.4",
|
|
65
|
+
"@gajae-code/utils": "0.17.4",
|
|
65
66
|
"@puppeteer/browsers": "^2.13.0",
|
|
66
67
|
"@types/turndown": "5.0.6",
|
|
67
68
|
"@xterm/headless": "^6.0.0",
|
|
68
69
|
"chalk": "^5.6.2",
|
|
70
|
+
"commander": "14.0.3",
|
|
69
71
|
"diff": "^9.0.0",
|
|
72
|
+
"exifr": "7.1.3",
|
|
73
|
+
"fast-xml-parser": "5.10.1",
|
|
70
74
|
"fflate": "0.8.2",
|
|
71
75
|
"handlebars": "^4.7.9",
|
|
72
76
|
"jsonc-parser": "3.3.1",
|
|
77
|
+
"jszip": "3.10.1",
|
|
73
78
|
"linkedom": "^0.18.12",
|
|
74
79
|
"lru-cache": "11.3.6",
|
|
80
|
+
"mammoth": "1.12.0",
|
|
75
81
|
"marked": "18.0.6",
|
|
76
|
-
"
|
|
82
|
+
"mupdf": "1.28.0",
|
|
83
|
+
"music-metadata": "11.14.0",
|
|
77
84
|
"puppeteer-core": "^24.42.0",
|
|
85
|
+
"rss-parser": "3.13.0",
|
|
78
86
|
"turndown": "7.2.4",
|
|
79
87
|
"turndown-plugin-gfm": "1.0.2",
|
|
80
88
|
"zod": "4.4.3"
|
package/scripts/build-binary.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import { signMacOSBinary } from "../../../scripts/macos-code-signing";
|
|
5
5
|
import { buildDevCompileArgs } from "./compile-args";
|
|
6
|
+
import { generateMuPdfAsset, resetMuPdfAsset } from "./embed-mupdf";
|
|
6
7
|
|
|
7
8
|
const packageDir = path.join(import.meta.dir, "..");
|
|
8
9
|
const outputPath = path.join(packageDir, "dist", "gjc");
|
|
@@ -31,10 +32,11 @@ async function stageWorkspaceNativeAddons(): Promise<void> {
|
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
async function main(): Promise<void> {
|
|
34
|
-
await runCommand(["bun", "--cwd=../stats", "scripts/generate-client-bundle.ts", "--generate"]);
|
|
35
35
|
try {
|
|
36
|
-
await runCommand(["bun", "--cwd=../
|
|
36
|
+
await runCommand(["bun", "--cwd=../stats", "scripts/generate-client-bundle.ts", "--generate"]);
|
|
37
37
|
try {
|
|
38
|
+
await generateMuPdfAsset();
|
|
39
|
+
await runCommand(["bun", "--cwd=../natives", "run", "embed:native"]);
|
|
38
40
|
const buildEnv = shouldAdhocSignDarwinBinary() ? { ...Bun.env, BUN_NO_CODESIGN_MACHO_BINARY: "1" } : Bun.env;
|
|
39
41
|
await runCommand(buildDevCompileArgs(), buildEnv);
|
|
40
42
|
|
|
@@ -47,7 +49,11 @@ async function main(): Promise<void> {
|
|
|
47
49
|
await runCommand(["bun", "--cwd=../natives", "run", "embed:native", "--reset"]);
|
|
48
50
|
}
|
|
49
51
|
} finally {
|
|
50
|
-
|
|
52
|
+
try {
|
|
53
|
+
await resetMuPdfAsset();
|
|
54
|
+
} finally {
|
|
55
|
+
await runCommand(["bun", "--cwd=../stats", "scripts/generate-client-bundle.ts", "--reset"]);
|
|
56
|
+
}
|
|
51
57
|
}
|
|
52
58
|
}
|
|
53
59
|
|
package/scripts/compile-args.ts
CHANGED
|
@@ -18,15 +18,6 @@ const compiledDefineFlags = ['process.env.PI_COMPILED="true"'];
|
|
|
18
18
|
const releaseDefineFlags = [...compiledDefineFlags, 'process.env.GJC_BUILD_CHANNEL="release"'];
|
|
19
19
|
const devDefineFlags = [...compiledDefineFlags, 'process.env.GJC_BUILD_CHANNEL="dev"'];
|
|
20
20
|
|
|
21
|
-
// NOTE: mupdf must NOT be marked --external here. Compiled binaries cannot
|
|
22
|
-
// resolve bare "mupdf" imports (and its Emscripten loader cannot find the
|
|
23
|
-
// wasm asset inside the bunfs), which broke markit PDF conversion in every
|
|
24
|
-
// standalone release (#5433). mupdf is bundled instead: its wasm is embedded
|
|
25
|
-
// via `with { type: "file" }` and routed to the loader through the hook in
|
|
26
|
-
// packages/coding-agent/src/utils/mupdf-wasm.ts, and the bundled
|
|
27
|
-
// `require("mupdf")` inside markit-ai is replaced by the patch in
|
|
28
|
-
// patches/markit-ai@0.5.3.patch.
|
|
29
|
-
|
|
30
21
|
export const releaseEntrypoints = [
|
|
31
22
|
"./packages/coding-agent/src/cli.ts",
|
|
32
23
|
"./packages/stats/src/sync-worker.ts",
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import * as fs from "node:fs/promises";
|
|
4
|
+
import * as path from "node:path";
|
|
5
|
+
import * as url from "node:url";
|
|
6
|
+
|
|
7
|
+
const outputPath = url.fileURLToPath(new URL("../src/utils/mupdf-embedded.ts", import.meta.url));
|
|
8
|
+
const sourceMapping = `// AUTOGENERATED FILE -- DO NOT EDIT DIRECTLY
|
|
9
|
+
// See scripts/embed-mupdf.ts. Source installs resolve the package lazily.
|
|
10
|
+
export const embeddedMuPdfWasm: string | undefined = undefined;
|
|
11
|
+
export const embeddedMuPdfModule: string | undefined = undefined;
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
export async function resetMuPdfAsset(): Promise<void> {
|
|
15
|
+
await Bun.write(outputPath, sourceMapping);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export async function generateMuPdfAsset(options: { wasmPath?: string } = {}): Promise<void> {
|
|
19
|
+
const temporaryPath = `${outputPath}.tmp`;
|
|
20
|
+
try {
|
|
21
|
+
const markitModule = url.fileURLToPath(new URL("../vendor/markit-ai/dist/index.js", import.meta.url));
|
|
22
|
+
const modulePath = Bun.resolveSync("mupdf", path.dirname(markitModule));
|
|
23
|
+
const resolvedWasmPath = options.wasmPath ?? path.join(path.dirname(modulePath), "mupdf-wasm.wasm");
|
|
24
|
+
await fs.access(resolvedWasmPath);
|
|
25
|
+
await Bun.write(
|
|
26
|
+
temporaryPath,
|
|
27
|
+
`// AUTOGENERATED FILE -- DO NOT EDIT DIRECTLY
|
|
28
|
+
// See scripts/embed-mupdf.ts. Reset after compiling.
|
|
29
|
+
import wasmAsset from ${JSON.stringify(resolvedWasmPath)} with { type: "file" };
|
|
30
|
+
|
|
31
|
+
export const embeddedMuPdfWasm: string | undefined = wasmAsset;
|
|
32
|
+
export const embeddedMuPdfModule: string | undefined = ${JSON.stringify(modulePath)};
|
|
33
|
+
`,
|
|
34
|
+
);
|
|
35
|
+
await fs.rename(temporaryPath, outputPath);
|
|
36
|
+
} catch (cause) {
|
|
37
|
+
await resetMuPdfAsset();
|
|
38
|
+
throw new Error(
|
|
39
|
+
"Unable to embed MuPDF WASM; check the source-built artifact or installed coding-agent dependency.",
|
|
40
|
+
{
|
|
41
|
+
cause,
|
|
42
|
+
},
|
|
43
|
+
);
|
|
44
|
+
} finally {
|
|
45
|
+
await fs.rm(temporaryPath, { force: true });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (import.meta.main) {
|
|
50
|
+
if (process.argv.includes("--reset")) await resetMuPdfAsset();
|
|
51
|
+
else await generateMuPdfAsset();
|
|
52
|
+
}
|
|
@@ -19,8 +19,12 @@ const LOCKED_EXCLUSIONS: Readonly<Record<string, string>> = {
|
|
|
19
19
|
"internal terminal-abort bus seam, threaded via terminalAbortSeams; not a user-facing SDK control seam",
|
|
20
20
|
"agent_session:abortPromptAndWaitWithTerminal":
|
|
21
21
|
"internal terminal-abort fencing seam, threaded via terminalAbortSeams; not a user-facing SDK control seam",
|
|
22
|
+
"agent_session:pendingToolExecutions":
|
|
23
|
+
"internal read-only run-resource-ledger view, threaded via terminalAbortSeams so the prompt deadline can find a tool-call boundary; not a user-facing SDK control seam",
|
|
22
24
|
"slash_command:routing":
|
|
23
25
|
"visual/local-only autorouting settings toggle and smart-routing panel entry, not a user-facing SDK control seam",
|
|
26
|
+
"slash_command:mcp":
|
|
27
|
+
"interactive exact-config MCP status and session control command; terminal-only handleTui surface is not dispatched through ACP or the public SDK",
|
|
24
28
|
"slash_command:settings": "visual/local-only command, not a user-facing SDK control seam",
|
|
25
29
|
"slash_command:theme": "visual/local-only command, not a user-facing SDK control seam",
|
|
26
30
|
"slash_command:language":
|
|
@@ -162,6 +166,10 @@ const LOCKED_EXCLUSIONS: Readonly<Record<string, string>> = {
|
|
|
162
166
|
"agent_session:refreshSshTool": "internal accessor/plumbing, not a user-facing control seam",
|
|
163
167
|
"agent_session:refreshBaseSystemPrompt": "internal accessor/plumbing, not a user-facing control seam",
|
|
164
168
|
"agent_session:refreshMCPTools": "internal accessor/plumbing, not a user-facing control seam",
|
|
169
|
+
"agent_session:getExactMcpStatusSnapshot":
|
|
170
|
+
"internal exact-config MCP status accessor used only by the terminal-only /mcp command; its capability is granted only to root interactive --mcp-config sessions, not a public SDK query",
|
|
171
|
+
"agent_session:controlExactMcpServer":
|
|
172
|
+
"internal session-local exact-config MCP suspend/resume/reconnect mutation used only by the terminal-only /mcp command; runtime suppression is not persistent user authority or a public SDK control",
|
|
165
173
|
"agent_session:refreshGjcSubskillTools": "internal accessor/plumbing, not a user-facing control seam",
|
|
166
174
|
"agent_session:buildDisplaySessionContext": "internal accessor/plumbing, not a user-facing control seam",
|
|
167
175
|
"agent_session:buildPreparedDisplaySessionContext": "internal accessor/plumbing, not a user-facing control seam",
|
|
@@ -279,6 +287,12 @@ const LOCKED_EXCLUSIONS: Readonly<Record<string, string>> = {
|
|
|
279
287
|
"internal profile and fallback-chain state, not a user-facing SDK control seam",
|
|
280
288
|
"agent_session:setDefaultFallbackRuntimeModel":
|
|
281
289
|
"internal fallback runtime bookkeeping, not a user-facing SDK control seam",
|
|
290
|
+
"agent_session:installRecoveredDefaultFallbackChain":
|
|
291
|
+
"internal recovered fallback-chain installation during session startup, not a user-facing SDK control seam",
|
|
292
|
+
"agent_session:markStartupRecoveryBindingsRequired":
|
|
293
|
+
"internal startup recovery binding marker, not a user-facing SDK control seam",
|
|
294
|
+
"agent_session:hasRecoveredDefaultFallbackChain":
|
|
295
|
+
"internal recovered fallback-chain state query, not a user-facing SDK control seam",
|
|
282
296
|
"agent_session:setCredentialPin":
|
|
283
297
|
"interactive session-scoped OAuth account selector mutation behind the locked /credential and OAuth selector surfaces; the public SDK has no credential-selection operation and must not gain credential authority implicitly",
|
|
284
298
|
"agent_session:setCredentialAuto":
|
|
@@ -287,6 +301,8 @@ const LOCKED_EXCLUSIONS: Readonly<Record<string, string>> = {
|
|
|
287
301
|
"internal fallback resolution bookkeeping, not a user-facing SDK control seam",
|
|
288
302
|
"agent_session:syncEagerDelegation":
|
|
289
303
|
"internal profile-derived eager delegation synchronization, not a user-facing SDK control seam",
|
|
304
|
+
"agent_session:submitUserMessage":
|
|
305
|
+
"public in-process embedder lifecycle API; direct handle surface, not an SDK transport operation",
|
|
290
306
|
};
|
|
291
307
|
/** Maps reviewed source seams to registry SDK operation IDs. */
|
|
292
308
|
const SEAM_TO_SDK: Readonly<Record<string, string>> = {
|
|
@@ -366,6 +382,10 @@ const SEAM_TO_SDK: Readonly<Record<string, string>> = {
|
|
|
366
382
|
"slash_command:login": "auth.login",
|
|
367
383
|
"slash_command:clear": "context.clear",
|
|
368
384
|
"slash_command:new": "session.new",
|
|
385
|
+
// `/fork` opens the user-prompt selector, which commits via
|
|
386
|
+
// `session.branch(entryId)` (selector-controller.ts). Despite the command and
|
|
387
|
+
// keybinding name, it is NOT the exact-state `session.fork` operation.
|
|
388
|
+
"slash_command:fork": "session.branch",
|
|
369
389
|
"slash_command:compact": "compaction.run",
|
|
370
390
|
"slash_command:handoff": "session.handoff",
|
|
371
391
|
"slash_command:resume": "session.resume",
|
|
@@ -811,10 +831,17 @@ export function scanAgentSessionMethods(sourceText: string): string[] {
|
|
|
811
831
|
throw new Error("SDK operation inventory scanner: AgentSession class body is unbalanced.");
|
|
812
832
|
|
|
813
833
|
const methods: string[] = [];
|
|
834
|
+
const seenMethods = new Set<string>();
|
|
814
835
|
for (let memberStart = bodyStart + 1; memberStart < bodyEnd; ) {
|
|
815
836
|
const declaration = scanMethodDeclaration(tokens, memberStart, bodyEnd);
|
|
816
837
|
if (declaration) {
|
|
817
|
-
if (declaration.name)
|
|
838
|
+
if (declaration.name) {
|
|
839
|
+
const sourceId = `agent_session:${declaration.name}`;
|
|
840
|
+
if (!seenMethods.has(sourceId)) {
|
|
841
|
+
seenMethods.add(sourceId);
|
|
842
|
+
methods.push(sourceId);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
818
845
|
memberStart = Math.max(memberStart + 1, declaration.end);
|
|
819
846
|
continue;
|
|
820
847
|
}
|
|
@@ -940,6 +967,7 @@ function validateRegistry(records: InventoryRecord[]): string[] {
|
|
|
940
967
|
const errors: string[] = [];
|
|
941
968
|
const ids = new Set<string>();
|
|
942
969
|
const sdkIds = new Set<string>();
|
|
970
|
+
const sourceIds = new Set<string>();
|
|
943
971
|
for (const operation of OPERATIONS) {
|
|
944
972
|
if (ids.has(operation.id)) errors.push(`Duplicate operation ID: ${operation.id}`);
|
|
945
973
|
ids.add(operation.id);
|
|
@@ -951,6 +979,8 @@ function validateRegistry(records: InventoryRecord[]): string[] {
|
|
|
951
979
|
if (operation.testIds.length === 0) errors.push(`${operation.id} is missing test IDs.`);
|
|
952
980
|
}
|
|
953
981
|
for (const record of records) {
|
|
982
|
+
if (sourceIds.has(record.sourceId)) errors.push(`Duplicate source seam: ${record.sourceId}`);
|
|
983
|
+
sourceIds.add(record.sourceId);
|
|
954
984
|
if (record.decision === "exclude") {
|
|
955
985
|
if (!record.rationale) errors.push(`${record.sourceId} exclusion lacks a locked rationale.`);
|
|
956
986
|
if (
|