@gajae-code/coding-agent 0.18.7 → 0.18.9
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 +377 -1
- package/dist/types/async/endpoint-id.d.ts +16 -0
- package/dist/types/async/job-manager.d.ts +1 -1
- package/dist/types/async/support.d.ts +0 -14
- package/dist/types/capability/mcp.d.ts +2 -0
- package/dist/types/capability/skill.d.ts +2 -0
- package/dist/types/capability/types.d.ts +2 -0
- package/dist/types/cli/public-command-errors.d.ts +3 -1
- package/dist/types/cli/setup-cli.d.ts +1 -1
- package/dist/types/commands/deep-interview.d.ts +3 -0
- package/dist/types/commands/mcp-serve.d.ts +4 -0
- package/dist/types/config/autorouting-tier-map.d.ts +348 -9
- package/dist/types/config/file-lock.d.ts +1 -0
- package/dist/types/config/model-bindings-applier.d.ts +2 -0
- package/dist/types/config/model-profile-activation.d.ts +11 -3
- package/dist/types/config/model-registry.d.ts +4 -9
- package/dist/types/config/skill-settings-defaults.d.ts +2 -0
- package/dist/types/cursor-delete-path.d.ts +1 -0
- package/dist/types/cursor-mcp-name.d.ts +8 -0
- package/dist/types/customization/inventory.d.ts +2 -0
- package/dist/types/debug/report-bundle-parent.d.ts +2 -0
- package/dist/types/defaults/gjc/extensions/grok-cli-vendor/src/provider/stream.d.ts +1 -0
- package/dist/types/defaults/gjc/extensions/grok-cli-vendor/src/provider/version-manager.d.ts +31 -0
- package/dist/types/defaults/gjc-skills.generated.d.ts +5 -6
- package/dist/types/discovery/helpers.d.ts +6 -1
- package/dist/types/discovery/mcp-json.d.ts +1 -0
- package/dist/types/eval/py/kernel.d.ts +18 -0
- package/dist/types/export/html/css-color.d.ts +2 -0
- package/dist/types/export/html/html-export-destination.d.ts +2 -0
- package/dist/types/export/html/template.generated.d.ts +1 -1
- package/dist/types/extensibility/extensions/function-hooks-internal.d.ts +5 -0
- package/dist/types/extensibility/extensions/types.d.ts +7 -0
- package/dist/types/extensibility/gjc-plugins/runtime-adapters.d.ts +14 -1
- package/dist/types/extensibility/plugins/marketplace/cache.d.ts +2 -0
- package/dist/types/extensibility/plugins/plugin-link-path.d.ts +2 -0
- package/dist/types/extensibility/runtime-skill-discovery.d.ts +3 -1
- package/dist/types/extensibility/skill-management.d.ts +4 -1
- package/dist/types/extensibility/skills.d.ts +2 -0
- package/dist/types/gjc-runtime/deep-interview-crystallize.d.ts +74 -0
- package/dist/types/gjc-runtime/deep-interview-runtime.d.ts +11 -0
- package/dist/types/gjc-runtime/gc-runtime.d.ts +5 -0
- package/dist/types/gjc-runtime/psmux-detect.d.ts +3 -3
- package/dist/types/gjc-runtime/ralplan-runtime.d.ts +0 -5
- package/dist/types/gjc-runtime/sidecar-bootstrap-env.d.ts +6 -0
- package/dist/types/gjc-runtime/state-argv.d.ts +1 -1
- package/dist/types/gjc-runtime/state-migrations.d.ts +8 -0
- package/dist/types/gjc-runtime/state-runtime.d.ts +95 -0
- package/dist/types/gjc-runtime/state-writer.d.ts +14 -1
- package/dist/types/gjc-runtime/tmux-common.d.ts +8 -5
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +8 -0
- package/dist/types/internal-urls/skill-path.d.ts +1 -0
- package/dist/types/lsp/config.d.ts +8 -5
- package/dist/types/lsp/workspace-path.d.ts +1 -0
- package/dist/types/modes/acp/acp-agent.d.ts +7 -0
- package/dist/types/modes/components/custom-editor.d.ts +6 -0
- package/dist/types/modes/components/customization/customization-dashboard.d.ts +1 -0
- package/dist/types/modes/components/extensions/state-manager.d.ts +4 -3
- package/dist/types/modes/controllers/input-controller.d.ts +9 -0
- package/dist/types/modes/interactive-mode.d.ts +1 -0
- package/dist/types/modes/utils/interrupt-ownership.d.ts +3 -0
- package/dist/types/modes/utils/keybinding-matchers.d.ts +1 -0
- package/dist/types/modes/utils/macos-option-forwarding.d.ts +17 -0
- package/dist/types/progress/collect-project-progress.d.ts +38 -0
- package/dist/types/progress/progress-contract.d.ts +154 -0
- package/dist/types/progress/progress-snapshot.d.ts +11 -0
- package/dist/types/progress/project-progress.d.ts +141 -0
- package/dist/types/progress/render-progress.d.ts +28 -0
- package/dist/types/runtime-mcp/manager.d.ts +2 -1
- package/dist/types/runtime-mcp/mcp-redirect.d.ts +9 -0
- package/dist/types/runtime-mcp/oauth-public-url.d.ts +3 -0
- package/dist/types/runtime-mcp/plugin-network-boundary.d.ts +1 -0
- package/dist/types/runtime-mcp/project-host-values.d.ts +27 -0
- package/dist/types/runtime-mcp/smithery-registry.d.ts +24 -0
- package/dist/types/runtime-mcp/types.d.ts +6 -0
- package/dist/types/sdk/acp/adapter.d.ts +1 -1
- package/dist/types/sdk/broker/broker-exit.d.ts +6 -2
- package/dist/types/sdk/broker/broker.d.ts +24 -2
- package/dist/types/sdk/broker/doctor-restart.d.ts +5 -0
- package/dist/types/sdk/broker/ensure.d.ts +14 -1
- package/dist/types/sdk/broker/session-index.d.ts +12 -6
- package/dist/types/sdk/bus/index.d.ts +12 -1
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +6 -1
- package/dist/types/sdk/client/client.d.ts +2 -0
- package/dist/types/sdk/host/query/handlers.d.ts +3 -0
- package/dist/types/sdk/index.d.ts +1 -0
- package/dist/types/sdk/router/session-router.d.ts +2 -0
- package/dist/types/sdk/session-list.d.ts +1 -1
- package/dist/types/sdk/session.d.ts +8 -0
- package/dist/types/session/agent-session.d.ts +38 -9
- package/dist/types/session/artifacts.d.ts +2 -2
- package/dist/types/session/internal/managed-gc-retirement-codec.d.ts +32 -0
- package/dist/types/session/internal/managed-session-scope.d.ts +79 -2
- package/dist/types/session/internal/managed-session-storage.d.ts +26 -1
- package/dist/types/session/internal/managed-task-owner-cleanup.d.ts +62 -0
- package/dist/types/session/internal/task-artifact-owner-access.d.ts +2 -0
- package/dist/types/session/internal/task-artifact-owner-transcript.d.ts +9 -1
- package/dist/types/session/session-manager.d.ts +31 -5
- package/dist/types/session/session-retirement.d.ts +31 -7
- package/dist/types/session/session-storage.d.ts +69 -2
- package/dist/types/session/task-artifact-owner-codec.d.ts +2 -0
- package/dist/types/setup/credential-auto-import.d.ts +1 -1
- package/dist/types/setup/credential-import.d.ts +6 -4
- package/dist/types/skill-state/active-state.d.ts +38 -0
- package/dist/types/skill-state/workflow-mutation-guard.d.ts +3 -0
- package/dist/types/slash-commands/helpers/progress-report.d.ts +8 -0
- package/dist/types/task/executor.d.ts +3 -0
- package/dist/types/task/isolation-dir.d.ts +26 -0
- package/dist/types/tools/ast-edit-write-path.d.ts +13 -0
- package/dist/types/tools/bash-skill-urls.d.ts +1 -1
- package/dist/types/tools/browser/cdp-url.d.ts +2 -0
- package/dist/types/tools/github-side-effect.d.ts +22 -0
- package/dist/types/tools/index.d.ts +3 -0
- package/dist/types/tools/monitor-mutation.d.ts +9 -0
- package/dist/types/tools/python.d.ts +9 -1
- package/dist/types/tools/recipe/recipe-guard.d.ts +7 -0
- package/dist/types/tools/restricted-cwd.d.ts +1 -0
- package/dist/types/tools/todo-write.d.ts +6 -0
- package/dist/types/utils/tools-checksum.d.ts +7 -0
- package/package.json +7 -7
- package/scripts/generate-sdk-operation-inventory.ts +21 -0
- package/scripts/verify-managed-empty-stop.ts +28 -0
- package/src/async/endpoint-id.ts +26 -0
- package/src/async/job-manager.ts +247 -132
- package/src/async/support.ts +0 -25
- package/src/capability/index.ts +15 -0
- package/src/capability/mcp.ts +2 -0
- package/src/capability/skill.ts +2 -0
- package/src/capability/types.ts +2 -0
- package/src/cli/auth-broker-cli.ts +1 -1
- package/src/cli/customize-doctor.ts +15 -2
- package/src/cli/doctor/repairs.ts +4 -1
- package/src/cli/doctor-supervisor.ts +3 -0
- package/src/cli/public-command-errors.ts +21 -1
- package/src/cli/public-command-registry.ts +28 -6
- package/src/cli/setup-cli.ts +4 -4
- package/src/cli/skills-cli.ts +5 -0
- package/src/commands/deep-interview.ts +47 -8
- package/src/commands/mcp-serve.ts +7 -0
- package/src/commands/sdk.ts +455 -397
- package/src/config/autorouting-tier-map.ts +117 -7
- package/src/config/file-lock.ts +316 -79
- package/src/config/mcp-schema.json +4 -0
- package/src/config/model-bindings-applier.ts +20 -0
- package/src/config/model-profile-activation.ts +240 -46
- package/src/config/model-registry.ts +47 -153
- package/src/config/skill-settings-defaults.ts +7 -0
- package/src/coordinator-mcp/policy.ts +3 -2
- package/src/coordinator-mcp/server.ts +2 -0
- package/src/cursor-delete-path.ts +10 -0
- package/src/cursor-mcp-name.ts +15 -0
- package/src/cursor.ts +13 -2
- package/src/customization/inventory.ts +4 -13
- package/src/dap/config.ts +2 -2
- package/src/debug/report-bundle-parent.ts +22 -0
- package/src/debug/report-bundle.ts +3 -0
- package/src/debug/system-info.ts +13 -1
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/provider/register.ts +10 -6
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/provider/stream.ts +67 -4
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/provider/version-manager.ts +80 -0
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +105 -10
- package/src/defaults/gjc/skills/ralplan/SKILL.md +6 -4
- package/src/defaults/gjc-defaults.test.ts +18 -1
- package/src/defaults/gjc-defaults.ts +3 -0
- package/src/defaults/gjc-skills.generated.ts +58 -36
- package/src/discovery/agents.ts +6 -1
- package/src/discovery/builtin.ts +13 -1
- package/src/discovery/helpers.ts +171 -29
- package/src/discovery/mcp-json.ts +26 -12
- package/src/discovery/ssh.ts +1 -1
- package/src/discovery/substitute-plugin-root.ts +3 -1
- package/src/edit/file-read-cache.ts +1 -1
- package/src/eval/py/executor.ts +796 -154
- package/src/eval/py/kernel.ts +79 -13
- package/src/eval/py/tool-bridge.ts +4 -0
- package/src/export/html/css-color.ts +9 -0
- package/src/export/html/html-export-destination.ts +16 -0
- package/src/export/html/index.ts +7 -10
- package/src/export/html/template.generated.ts +1 -1
- package/src/extensibility/extensions/function-hooks-internal.ts +27 -0
- package/src/extensibility/extensions/runner.ts +15 -1
- package/src/extensibility/extensions/types.ts +7 -0
- package/src/extensibility/gjc-plugins/mcp-policy.ts +2 -1
- package/src/extensibility/gjc-plugins/runtime-adapters.ts +85 -8
- package/src/extensibility/plugins/manager.ts +3 -2
- package/src/extensibility/plugins/marketplace/cache.ts +15 -0
- package/src/extensibility/plugins/marketplace/manager.ts +11 -3
- package/src/extensibility/plugins/plugin-link-path.ts +12 -0
- package/src/extensibility/runtime-skill-discovery.ts +20 -2
- package/src/extensibility/skill-management.ts +9 -2
- package/src/extensibility/skills.ts +6 -1
- package/src/gjc-runtime/deep-interview-crystallize.ts +1814 -0
- package/src/gjc-runtime/deep-interview-recorder.ts +20 -2
- package/src/gjc-runtime/deep-interview-runtime.ts +1415 -13
- package/src/gjc-runtime/deep-interview-stage.ts +98 -21
- package/src/gjc-runtime/gc-runtime.ts +206 -9
- package/src/gjc-runtime/launch-worktree.ts +70 -9
- package/src/gjc-runtime/psmux-detect.ts +28 -4
- package/src/gjc-runtime/ralplan-runtime.ts +447 -52
- package/src/gjc-runtime/session-state-sidecar.ts +3 -2
- package/src/gjc-runtime/sidecar-bootstrap-env.ts +19 -0
- package/src/gjc-runtime/state-argv.ts +2 -0
- package/src/gjc-runtime/state-migrations.ts +91 -29
- package/src/gjc-runtime/state-runtime.ts +3716 -135
- package/src/gjc-runtime/state-writer.ts +105 -16
- package/src/gjc-runtime/tmux-common.ts +8 -5
- package/src/gjc-runtime/ultragoal-runtime.ts +16 -4
- package/src/gjc-runtime/workflow-manifest.generated.json +70 -42
- package/src/gjc-runtime/workflow-manifest.ts +54 -21
- package/src/harness-control-plane/operate.ts +12 -4
- package/src/harness-control-plane/owner.ts +5 -1
- package/src/hashline/parser.ts +48 -9
- package/src/hashline/recovery.ts +13 -4
- package/src/internal-urls/docs-index.generated.ts +20 -19
- package/src/internal-urls/skill-path.ts +19 -0
- package/src/internal-urls/skill-protocol.ts +2 -0
- package/src/lsp/config.ts +12 -63
- package/src/lsp/edits.ts +6 -0
- package/src/lsp/workspace-path.ts +51 -0
- package/src/main.ts +195 -31
- package/src/memories/index.ts +88 -7
- package/src/modes/acp/acp-agent.ts +88 -4
- package/src/modes/components/custom-editor.ts +14 -0
- package/src/modes/components/customization/customization-dashboard.ts +12 -0
- package/src/modes/components/extensions/extension-dashboard.ts +2 -2
- package/src/modes/components/extensions/state-manager.ts +15 -5
- package/src/modes/components/hook-editor.ts +1 -1
- package/src/modes/components/hook-selector.ts +1 -1
- package/src/modes/components/model-selector.ts +1 -4
- package/src/modes/components/provider-onboarding-selector.ts +1 -1
- package/src/modes/components/status-line/segments.ts +4 -0
- package/src/modes/controllers/event-controller.ts +11 -4
- package/src/modes/controllers/input-controller.ts +76 -31
- package/src/modes/controllers/runtime-mcp-command-controller.ts +29 -16
- package/src/modes/controllers/selector-controller.ts +24 -15
- package/src/modes/controllers/todo-command-controller.ts +1 -1
- package/src/modes/interactive-mode.ts +5 -1
- package/src/modes/runtime-init.ts +4 -0
- package/src/modes/utils/abort-message.ts +3 -1
- package/src/modes/utils/interrupt-ownership.ts +12 -0
- package/src/modes/utils/keybinding-matchers.ts +4 -0
- package/src/modes/utils/macos-option-forwarding.ts +80 -0
- package/src/progress/collect-project-progress.ts +153 -0
- package/src/progress/progress-contract.ts +172 -0
- package/src/progress/progress-snapshot.ts +140 -0
- package/src/progress/project-progress.ts +446 -0
- package/src/progress/render-progress.ts +209 -0
- package/src/prompts/system/master-mode.md +1 -0
- package/src/prompts/tools/skill-discovery.md +1 -1
- package/src/runtime-mcp/client.ts +4 -2
- package/src/runtime-mcp/config-writer.ts +10 -6
- package/src/runtime-mcp/config.ts +1 -0
- package/src/runtime-mcp/json-rpc.ts +2 -1
- package/src/runtime-mcp/manager.ts +29 -11
- package/src/runtime-mcp/mcp-redirect.ts +73 -0
- package/src/runtime-mcp/oauth-flow.ts +14 -2
- package/src/runtime-mcp/oauth-public-url.ts +14 -0
- package/src/runtime-mcp/plugin-network-boundary.ts +4 -0
- package/src/runtime-mcp/pool.ts +6 -0
- package/src/runtime-mcp/project-host-values.ts +46 -0
- package/src/runtime-mcp/smithery-registry.ts +22 -3
- package/src/runtime-mcp/transports/http.ts +4 -3
- package/src/runtime-mcp/types.ts +6 -0
- package/src/sdk/acp/adapter.ts +95 -8
- package/src/sdk/broker/broker-exit.ts +52 -23
- package/src/sdk/broker/broker.ts +81 -6
- package/src/sdk/broker/doctor-restart.ts +4 -0
- package/src/sdk/broker/ensure.ts +31 -2
- package/src/sdk/broker/lifecycle.ts +711 -66
- package/src/sdk/broker/session-index.ts +191 -81
- package/src/sdk/bus/chat-daemon-cli.ts +38 -1
- package/src/sdk/bus/chat-daemon-control.ts +2 -2
- package/src/sdk/bus/index.ts +238 -43
- package/src/sdk/bus/telegram-daemon-contract.ts +6 -1
- package/src/sdk/cli/session-cli.ts +17 -3
- package/src/sdk/client/client.ts +28 -8
- package/src/sdk/host/query/handlers.ts +9 -1
- package/src/sdk/host/session-runtime.test.ts +2705 -303
- package/src/sdk/host/session-runtime.ts +490 -143
- package/src/sdk/host/surface-policy.ts +1 -0
- package/src/sdk/index.ts +8 -0
- package/src/sdk/lifecycle-session.ts +3 -1
- package/src/sdk/prompt-deadline-manager.ts +15 -0
- package/src/sdk/protocol/operation-inventory.generated.json +146 -0
- package/src/sdk/protocol/operation-registry.ts +9 -2
- package/src/sdk/router/session-router.ts +82 -18
- package/src/sdk/session-list.ts +1 -0
- package/src/sdk/session.ts +69 -45
- package/src/session/agent-session.ts +679 -238
- package/src/session/artifacts.ts +176 -71
- package/src/session/internal/managed-gc-retirement-codec.ts +319 -0
- package/src/session/internal/managed-session-scope.ts +3779 -462
- package/src/session/internal/managed-session-storage.ts +501 -78
- package/src/session/internal/managed-task-owner-cleanup.ts +473 -0
- package/src/session/internal/task-artifact-owner-access.ts +19 -3
- package/src/session/internal/task-artifact-owner-transcript.ts +547 -1
- package/src/session/session-manager.ts +951 -133
- package/src/session/session-retirement.ts +573 -14
- package/src/session/session-storage.ts +447 -15
- package/src/session/task-artifact-owner-codec.ts +71 -8
- package/src/session/task-artifact-owner-retirement.ts +21 -19
- package/src/setup/credential-auto-import.ts +12 -3
- package/src/setup/credential-import.ts +176 -5
- package/src/setup/paseo/announce.ts +6 -1
- package/src/skill-state/active-state.ts +145 -2
- package/src/skill-state/workflow-mutation-guard.ts +102 -10
- package/src/slash-commands/builtin-registry.ts +39 -9
- package/src/slash-commands/helpers/mcp.ts +8 -4
- package/src/slash-commands/helpers/progress-report.ts +23 -0
- package/src/stt/setup.ts +3 -5
- package/src/task/commands.ts +3 -1
- package/src/task/executor.ts +4 -0
- package/src/task/index.ts +6 -0
- package/src/task/isolation-dir.ts +143 -0
- package/src/task/worktree.ts +16 -7
- package/src/tools/ask.ts +205 -6
- package/src/tools/ast-edit-write-path.ts +68 -0
- package/src/tools/ast-edit.ts +10 -1
- package/src/tools/bash-allowed-prefixes.ts +15 -0
- package/src/tools/bash-skill-urls.ts +56 -3
- package/src/tools/bash.ts +48 -79
- package/src/tools/browser/cdp-url.ts +18 -0
- package/src/tools/browser.ts +8 -1
- package/src/tools/descriptors.ts +5 -1
- package/src/tools/eval.ts +56 -36
- package/src/tools/gh.ts +10 -0
- package/src/tools/github-side-effect.ts +112 -0
- package/src/tools/image-gen.ts +1 -1
- package/src/tools/index.ts +3 -0
- package/src/tools/monitor-mutation.ts +27 -0
- package/src/tools/monitor.ts +7 -0
- package/src/tools/python.ts +188 -66
- package/src/tools/recipe/index.ts +9 -0
- package/src/tools/recipe/recipe-guard.ts +19 -0
- package/src/tools/restricted-cwd.ts +10 -0
- package/src/tools/skill-discovery.ts +5 -0
- package/src/tools/skill.ts +28 -1
- package/src/tools/todo-write.ts +10 -1
- package/src/tools/tool-catalog.generated.ts +1 -1
- package/src/tools/write.ts +1 -0
- package/src/utils/external-editor.ts +3 -2
- package/src/utils/tools-checksum.ts +34 -0
- package/src/utils/tools-manager.ts +24 -6
- package/src/web/insane/url-guard.ts +2 -1
- package/src/web/search/providers/codex.ts +3 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { KeyId } from "@gajae-code/tui";
|
|
2
|
+
/** The Option chord that composes `text` on the macOS US/ABC layout, if any. */
|
|
3
|
+
export declare function macosOptionChordForComposedText(text: string): KeyId | undefined;
|
|
4
|
+
/** Terminal-specific instruction for sending Option as Alt/Meta, when the terminal is known. */
|
|
5
|
+
export declare function macosOptionForwardingInstruction(terminalProgram: string | undefined): string | undefined;
|
|
6
|
+
export interface UnforwardedOptionChordWarnerOptions {
|
|
7
|
+
platform: NodeJS.Platform;
|
|
8
|
+
terminalProgram: string | undefined;
|
|
9
|
+
formatKeyHint: (key: KeyId) => string;
|
|
10
|
+
showWarning: (message: string) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Builds the composer callback that explains, once, why a bound Option shortcut
|
|
14
|
+
* produced a character instead of firing. Returns undefined off macOS, where the
|
|
15
|
+
* composition table does not apply.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createUnforwardedOptionChordWarner(options: UnforwardedOptionChordWarnerOptions): ((key: KeyId, text: string) => void) | undefined;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { SubagentLifecycle } from "../async/job-manager";
|
|
2
|
+
import type { Goal, GoalModeState } from "../goals/state";
|
|
3
|
+
import type { SessionManager } from "../session/session-manager";
|
|
4
|
+
import { type TodoPhase } from "../tools/todo-write";
|
|
5
|
+
import { type ProjectProgressInput, type ProjectProgressReport } from "./project-progress";
|
|
6
|
+
/** Session-owned state the overview reads; everything else comes from durable `.gjc` files. */
|
|
7
|
+
export interface ProjectProgressSessionView {
|
|
8
|
+
cwd: string;
|
|
9
|
+
/** GJC session id that scopes `.gjc/_session-{id}` state; without it no workflow state is read. */
|
|
10
|
+
sessionId: string | undefined;
|
|
11
|
+
goal: Goal | undefined;
|
|
12
|
+
todoPhases: readonly TodoPhase[];
|
|
13
|
+
subagents: readonly SubagentLifecycle[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Gather progress input strictly by reading state. A source that fails to read
|
|
17
|
+
* is reported as unreadable and excluded; it never aborts the overview and is
|
|
18
|
+
* never replaced by a guess. A source rebuilt from authoritative per-entry
|
|
19
|
+
* records after its snapshot failed to read is reported as recovered; one whose
|
|
20
|
+
* readable derived snapshot listed stale rows is reported as discarded; one whose
|
|
21
|
+
* rows could not be attributed to an authority is reported as unresolved.
|
|
22
|
+
*/
|
|
23
|
+
export declare function collectProjectProgressInput(view: ProjectProgressSessionView): Promise<ProjectProgressInput>;
|
|
24
|
+
/** The live session state `/progress` and `session.progress` read; satisfied by `AgentSession`. */
|
|
25
|
+
export interface ProjectProgressSessionSource {
|
|
26
|
+
getGoalModeState(): GoalModeState | undefined;
|
|
27
|
+
getTodoPhases(): TodoPhase[];
|
|
28
|
+
getSubagentLifecycleStatuses(): SubagentLifecycle[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Single entry point shared by the human view and the machine snapshot.
|
|
32
|
+
*
|
|
33
|
+
* Todos come from the persisted branch history, as `/todo` reads them: the live
|
|
34
|
+
* list drops completed and abandoned items when a session is resumed, so it is
|
|
35
|
+
* only the fallback when no todo state was ever persisted. A persisted empty
|
|
36
|
+
* list is authoritative and is not replaced by live state.
|
|
37
|
+
*/
|
|
38
|
+
export declare function buildSessionProjectProgress(session: ProjectProgressSessionSource, sessionManager: Pick<SessionManager, "getCwd" | "getSessionId" | "getBranch">): Promise<ProjectProgressReport>;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/** Ultragoal story status (`UltragoalGoalStatus`). */
|
|
2
|
+
export type ProgressStoryStatus = "pending" | "active" | "complete" | "failed" | "blocked" | "review_blocked" | "superseded";
|
|
3
|
+
/** Session goal status (`GoalStatus`). */
|
|
4
|
+
export type ProgressGoalStatus = "active" | "paused" | "complete" | "dropped";
|
|
5
|
+
/** Todo item status (`TodoStatus`). */
|
|
6
|
+
export type ProgressTodoStatus = "pending" | "in_progress" | "completed" | "abandoned";
|
|
7
|
+
/** Workflow HUD chip severity (`WorkflowHudSeverity`). */
|
|
8
|
+
export type ProgressChipSeverity = "info" | "warning" | "blocked" | "error" | "success";
|
|
9
|
+
/** Durable `.gjc` session-state sources that can fail to read. */
|
|
10
|
+
export type ProgressDurableSource = "workflow-state" | "ultragoal-plan";
|
|
11
|
+
export type ProgressBasisKind = "ultragoal-stories" | "todos" | "goal-status" | "none";
|
|
12
|
+
export type ProgressHeadline = "complete" | "awaiting-completion" | "blocked" | "in-progress" | "not-started" | "paused" | "dropped" | "no-tracked-work";
|
|
13
|
+
export type ProgressSignalKind = "blocker" | "pending" | "note";
|
|
14
|
+
export type ProgressSignalSource = "ultragoal" | "workflow" | "subagents" | "todos" | "goal" | "state";
|
|
15
|
+
export interface ProgressAgentCounts {
|
|
16
|
+
total: number;
|
|
17
|
+
running: number;
|
|
18
|
+
/** Subagents that are queued or paused. */
|
|
19
|
+
waiting: number;
|
|
20
|
+
completed: number;
|
|
21
|
+
failed: number;
|
|
22
|
+
cancelled: number;
|
|
23
|
+
}
|
|
24
|
+
export interface ProgressReviewVerdict {
|
|
25
|
+
skill: string;
|
|
26
|
+
verdict: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const PROJECT_PROGRESS_SNAPSHOT_SCHEMA = "gjc.project_progress.v1";
|
|
29
|
+
/** Bounds keep one snapshot well under a single SDK query page. */
|
|
30
|
+
export declare const PROGRESS_SNAPSHOT_LIMITS: {
|
|
31
|
+
readonly stories: 100;
|
|
32
|
+
readonly todos: 100;
|
|
33
|
+
readonly workflows: 16;
|
|
34
|
+
readonly attention: 50;
|
|
35
|
+
readonly text: 300;
|
|
36
|
+
};
|
|
37
|
+
export interface ProgressSnapshotStory {
|
|
38
|
+
id: string;
|
|
39
|
+
title: string;
|
|
40
|
+
status: ProgressStoryStatus;
|
|
41
|
+
/** A completion-verification (quality-gate) receipt is recorded on the story. */
|
|
42
|
+
verificationReceipt: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface ProgressSnapshotTodo {
|
|
45
|
+
content: string;
|
|
46
|
+
status: ProgressTodoStatus;
|
|
47
|
+
}
|
|
48
|
+
export interface ProgressSnapshotWorkflow {
|
|
49
|
+
skill: string;
|
|
50
|
+
phase: string;
|
|
51
|
+
summary: string | null;
|
|
52
|
+
chips: {
|
|
53
|
+
label: string;
|
|
54
|
+
value: string | null;
|
|
55
|
+
severity: ProgressChipSeverity | null;
|
|
56
|
+
}[];
|
|
57
|
+
}
|
|
58
|
+
export interface ProgressSnapshotAttention {
|
|
59
|
+
kind: ProgressSignalKind;
|
|
60
|
+
source: ProgressSignalSource;
|
|
61
|
+
ref: string | null;
|
|
62
|
+
text: string;
|
|
63
|
+
}
|
|
64
|
+
export interface ProjectProgressSnapshot {
|
|
65
|
+
schema: typeof PROJECT_PROGRESS_SNAPSHOT_SCHEMA;
|
|
66
|
+
/** Overall completion state; identical to the `/progress` headline. */
|
|
67
|
+
state: ProgressHeadline;
|
|
68
|
+
completion: {
|
|
69
|
+
/** Which countable units the indicator was derived from; `none` means nothing is countable. */
|
|
70
|
+
basis: ProgressBasisKind;
|
|
71
|
+
done: number;
|
|
72
|
+
total: number;
|
|
73
|
+
/** Whole percent; `null` when `basis` is `none`. Never 100 while a unit is open. */
|
|
74
|
+
percent: number | null;
|
|
75
|
+
/** Every counted unit is done (the session may still be awaiting goal completion or subagents). */
|
|
76
|
+
allUnitsDone: boolean;
|
|
77
|
+
/** `state === "complete"`: units done, goal (if any) complete, no subagents running, queued, or paused. */
|
|
78
|
+
complete: boolean;
|
|
79
|
+
explanation: string;
|
|
80
|
+
};
|
|
81
|
+
execution: {
|
|
82
|
+
goal: {
|
|
83
|
+
objective: string;
|
|
84
|
+
status: ProgressGoalStatus;
|
|
85
|
+
timeUsedSeconds: number;
|
|
86
|
+
} | null;
|
|
87
|
+
ultragoal: {
|
|
88
|
+
objective: string;
|
|
89
|
+
counts: {
|
|
90
|
+
total: number;
|
|
91
|
+
complete: number;
|
|
92
|
+
active: number;
|
|
93
|
+
pending: number;
|
|
94
|
+
blocked: number;
|
|
95
|
+
superseded: number;
|
|
96
|
+
};
|
|
97
|
+
stories: ProgressSnapshotStory[];
|
|
98
|
+
omittedStories: number;
|
|
99
|
+
} | null;
|
|
100
|
+
todos: {
|
|
101
|
+
counts: {
|
|
102
|
+
total: number;
|
|
103
|
+
completed: number;
|
|
104
|
+
inProgress: number;
|
|
105
|
+
pending: number;
|
|
106
|
+
abandoned: number;
|
|
107
|
+
};
|
|
108
|
+
items: ProgressSnapshotTodo[];
|
|
109
|
+
omittedItems: number;
|
|
110
|
+
} | null;
|
|
111
|
+
};
|
|
112
|
+
activeWork: {
|
|
113
|
+
/**
|
|
114
|
+
* Active story, else the next pending one, matching the Ultragoal scheduler.
|
|
115
|
+
* Blocked, review-blocked, and failed stories are never reported here (failed
|
|
116
|
+
* stories are retried only on explicit request); `null` when nothing is schedulable.
|
|
117
|
+
*/
|
|
118
|
+
story: {
|
|
119
|
+
id: string;
|
|
120
|
+
title: string;
|
|
121
|
+
} | null;
|
|
122
|
+
/** In-progress todo, else the next pending one. */
|
|
123
|
+
todo: string | null;
|
|
124
|
+
workflows: ProgressSnapshotWorkflow[];
|
|
125
|
+
/** Active workflows beyond `PROGRESS_SNAPSHOT_LIMITS.workflows` that `workflows` leaves out. */
|
|
126
|
+
omittedWorkflows: number;
|
|
127
|
+
agents: ProgressAgentCounts;
|
|
128
|
+
};
|
|
129
|
+
verification: {
|
|
130
|
+
/** Present only when at least one story is complete. */
|
|
131
|
+
storyReceipts: {
|
|
132
|
+
complete: number;
|
|
133
|
+
withReceipt: number;
|
|
134
|
+
withoutReceipt: number;
|
|
135
|
+
} | null;
|
|
136
|
+
reviewVerdicts: ProgressReviewVerdict[];
|
|
137
|
+
};
|
|
138
|
+
attention: ProgressSnapshotAttention[];
|
|
139
|
+
omittedAttention: number;
|
|
140
|
+
sources: {
|
|
141
|
+
/** Session-scoped `.gjc` state (workflows, ultragoal plan) was consulted. */
|
|
142
|
+
sessionStateRead: boolean;
|
|
143
|
+
/** Sources that exist but could not be read; excluded from every count. */
|
|
144
|
+
unreadable: ProgressDurableSource[];
|
|
145
|
+
/** Sources whose primary record was unreadable but whose contents were recovered from authoritative per-entry records. */
|
|
146
|
+
recovered: ProgressDurableSource[];
|
|
147
|
+
/** Sources whose readable derived snapshot listed entries the authoritative per-entry records do not; those stale entries were discarded. */
|
|
148
|
+
discarded: ProgressDurableSource[];
|
|
149
|
+
/** Sources listing entries whose authority could not be established; those entries are excluded and their absence is unconfirmed. */
|
|
150
|
+
unresolved: ProgressDurableSource[];
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
/** Strip terminal escapes/control characters and bound length; durable text is untrusted. */
|
|
154
|
+
export declare function boundSnapshotText(text: string, max?: number): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Machine-facing projection of the project progress report (SDK query
|
|
3
|
+
* `session.progress`, Q32). It is a pure re-shaping of `ProjectProgressReport`:
|
|
4
|
+
* every number, state, and attention item comes from the same computation, and
|
|
5
|
+
* the human `/progress` view renders this snapshot (`render-progress.ts`), so
|
|
6
|
+
* the two can never disagree. Absent evidence is `null`/empty, never estimated.
|
|
7
|
+
* Every bounded list reports how many entries it omitted.
|
|
8
|
+
*/
|
|
9
|
+
import { type ProjectProgressSnapshot } from "./progress-contract";
|
|
10
|
+
import type { ProjectProgressReport } from "./project-progress";
|
|
11
|
+
export declare function toProjectProgressSnapshot(report: ProjectProgressReport): ProjectProgressSnapshot;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-only project progress projection. One report is re-shaped into the
|
|
3
|
+
* machine-facing `session.progress` SDK snapshot (`progress-snapshot.ts`), and
|
|
4
|
+
* the human-facing `/progress` view renders that same snapshot
|
|
5
|
+
* (`render-progress.ts`) in the TUI, text mode, and ACP.
|
|
6
|
+
*
|
|
7
|
+
* The completion indicator is derived exclusively from countable units that
|
|
8
|
+
* carry a durable completion status. It never weights units by size, never
|
|
9
|
+
* credits partial work on an open unit, and never infers progress from
|
|
10
|
+
* conversation text, elapsed time, or token spend. When no countable basis
|
|
11
|
+
* exists the indicator is reported as unknown instead of guessed.
|
|
12
|
+
*/
|
|
13
|
+
import type { SubagentLifecycle } from "../async/job-manager";
|
|
14
|
+
import { type UltragoalGoalStatus } from "../gjc-runtime/ultragoal-runtime";
|
|
15
|
+
import type { GoalStatus } from "../goals/state";
|
|
16
|
+
import type { WorkflowHudSeverity } from "../skill-state/active-state";
|
|
17
|
+
import type { TodoStatus } from "../tools/todo-write";
|
|
18
|
+
import type { ProgressAgentCounts, ProgressBasisKind, ProgressDurableSource, ProgressHeadline, ProgressReviewVerdict, ProgressSignalKind, ProgressSignalSource } from "./progress-contract";
|
|
19
|
+
export interface ProgressGoalInput {
|
|
20
|
+
objective: string;
|
|
21
|
+
status: GoalStatus;
|
|
22
|
+
timeUsedSeconds: number;
|
|
23
|
+
}
|
|
24
|
+
export interface ProgressTodoInput {
|
|
25
|
+
content: string;
|
|
26
|
+
status: TodoStatus;
|
|
27
|
+
}
|
|
28
|
+
export interface ProgressWorkflowChip {
|
|
29
|
+
label: string;
|
|
30
|
+
value?: string;
|
|
31
|
+
severity?: WorkflowHudSeverity;
|
|
32
|
+
}
|
|
33
|
+
export interface ProgressWorkflowInput {
|
|
34
|
+
skill: string;
|
|
35
|
+
phase: string;
|
|
36
|
+
summary?: string;
|
|
37
|
+
chips: ProgressWorkflowChip[];
|
|
38
|
+
}
|
|
39
|
+
export interface ProgressStoryInput {
|
|
40
|
+
id: string;
|
|
41
|
+
title: string;
|
|
42
|
+
status: UltragoalGoalStatus;
|
|
43
|
+
/** A completion-verification (quality-gate) receipt is recorded on the story. */
|
|
44
|
+
hasVerificationReceipt: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface ProgressUltragoalInput {
|
|
47
|
+
objective: string;
|
|
48
|
+
stories: ProgressStoryInput[];
|
|
49
|
+
}
|
|
50
|
+
export declare const PROGRESS_SOURCE_LABELS: Record<ProgressDurableSource, string>;
|
|
51
|
+
export interface ProjectProgressInput {
|
|
52
|
+
goal?: ProgressGoalInput;
|
|
53
|
+
todos: ProgressTodoInput[];
|
|
54
|
+
workflows: ProgressWorkflowInput[];
|
|
55
|
+
ultragoal?: ProgressUltragoalInput;
|
|
56
|
+
subagents: SubagentLifecycle[];
|
|
57
|
+
/** Whether session-scoped `.gjc` state (workflows, ultragoal plan) was consulted at all. */
|
|
58
|
+
sessionStateRead: boolean;
|
|
59
|
+
/** Durable sources that exist but could not be read; excluded from the estimate. */
|
|
60
|
+
unreadable: ProgressDurableSource[];
|
|
61
|
+
/** Durable sources whose primary record was unreadable but whose contents were recovered from authoritative per-entry records. */
|
|
62
|
+
recovered: ProgressDurableSource[];
|
|
63
|
+
/** Durable sources whose readable derived snapshot listed entries the authoritative per-entry records do not; those stale entries were discarded. */
|
|
64
|
+
discarded: ProgressDurableSource[];
|
|
65
|
+
/** Durable sources listing entries whose authority could not be established; those entries are excluded and their absence is unconfirmed. */
|
|
66
|
+
unresolved: ProgressDurableSource[];
|
|
67
|
+
}
|
|
68
|
+
export interface ProgressSignal {
|
|
69
|
+
kind: ProgressSignalKind;
|
|
70
|
+
/** Which durable state produced the signal. */
|
|
71
|
+
source: ProgressSignalSource;
|
|
72
|
+
/** Stable identifier inside the source: story id, workflow skill, or durable source key. */
|
|
73
|
+
ref?: string;
|
|
74
|
+
text: string;
|
|
75
|
+
}
|
|
76
|
+
export interface ProgressCompletion {
|
|
77
|
+
basis: ProgressBasisKind;
|
|
78
|
+
done: number;
|
|
79
|
+
total: number;
|
|
80
|
+
/**
|
|
81
|
+
* Displayed whole percent, or undefined when no countable basis exists.
|
|
82
|
+
* Never rounds up to 100 while a unit is open, nor down to 0 once a unit is done.
|
|
83
|
+
*/
|
|
84
|
+
percent: number | undefined;
|
|
85
|
+
}
|
|
86
|
+
export interface ProgressStoryCounts {
|
|
87
|
+
total: number;
|
|
88
|
+
complete: number;
|
|
89
|
+
active: number;
|
|
90
|
+
pending: number;
|
|
91
|
+
blocked: number;
|
|
92
|
+
superseded: number;
|
|
93
|
+
verified: number;
|
|
94
|
+
/** Active story, else the next pending one; blocked, review-blocked, and failed stories are never selected. */
|
|
95
|
+
current?: {
|
|
96
|
+
id: string;
|
|
97
|
+
title: string;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export interface ProgressTodoCounts {
|
|
101
|
+
total: number;
|
|
102
|
+
completed: number;
|
|
103
|
+
inProgress: number;
|
|
104
|
+
pending: number;
|
|
105
|
+
abandoned: number;
|
|
106
|
+
current?: string;
|
|
107
|
+
}
|
|
108
|
+
/** Verification evidence that durable state actually records; nothing is inferred. */
|
|
109
|
+
export interface ProgressVerification {
|
|
110
|
+
/** Complete stories that carry a quality-gate completion receipt (only when stories are complete). */
|
|
111
|
+
storyReceipts?: {
|
|
112
|
+
complete: number;
|
|
113
|
+
withReceipt: number;
|
|
114
|
+
};
|
|
115
|
+
/** Latest review verdict chips published by active workflows. */
|
|
116
|
+
reviewVerdicts: ProgressReviewVerdict[];
|
|
117
|
+
}
|
|
118
|
+
export interface ProjectProgressReport {
|
|
119
|
+
headline: ProgressHeadline;
|
|
120
|
+
completion: ProgressCompletion;
|
|
121
|
+
/** How the completion indicator was derived, in plain words. */
|
|
122
|
+
basisExplanation: string;
|
|
123
|
+
goal?: ProgressGoalInput;
|
|
124
|
+
/** The ultragoal plan the story counts were derived from. */
|
|
125
|
+
ultragoal?: ProgressUltragoalInput;
|
|
126
|
+
stories?: ProgressStoryCounts;
|
|
127
|
+
todoItems: ProgressTodoInput[];
|
|
128
|
+
todos?: ProgressTodoCounts;
|
|
129
|
+
workflows: ProgressWorkflowInput[];
|
|
130
|
+
agents: ProgressAgentCounts;
|
|
131
|
+
verification: ProgressVerification;
|
|
132
|
+
signals: ProgressSignal[];
|
|
133
|
+
sessionStateRead: boolean;
|
|
134
|
+
unreadable: ProgressDurableSource[];
|
|
135
|
+
recovered: ProgressDurableSource[];
|
|
136
|
+
discarded: ProgressDurableSource[];
|
|
137
|
+
unresolved: ProgressDurableSource[];
|
|
138
|
+
}
|
|
139
|
+
/** Whole percent that never overstates (no 100 while open) nor erases (no 0 once started) progress. */
|
|
140
|
+
export declare function displayPercent(done: number, total: number): number | undefined;
|
|
141
|
+
export declare function computeProjectProgress(input: ProjectProgressInput): ProjectProgressReport;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Human-readable `/progress` view. It renders the machine-facing
|
|
3
|
+
* `session.progress` snapshot, so the TUI, text mode, and ACP (which reads the
|
|
4
|
+
* snapshot over the SDK) show exactly what an orchestrator receives.
|
|
5
|
+
*
|
|
6
|
+
* Like `progress-contract.ts`, this module must stay a dependency leaf: the ACP
|
|
7
|
+
* agent imports it, and the ACP entrypoint may not reach the session graph.
|
|
8
|
+
*/
|
|
9
|
+
import { type ProgressHeadline, type ProjectProgressSnapshot } from "./progress-contract";
|
|
10
|
+
/** ACP palette copy for `/progress`, shared by the builtin registry and the production ACP agent. */
|
|
11
|
+
export declare const PROGRESS_COMMAND_ACP_DESCRIPTION = "Show read-only project progress overview";
|
|
12
|
+
export declare const PROGRESS_HEADLINE_LABELS: Record<ProgressHeadline, string>;
|
|
13
|
+
/** Styling hooks so the TUI can colour output while ACP/text mode stays plain. */
|
|
14
|
+
export interface ProgressRenderStyle {
|
|
15
|
+
bold(text: string): string;
|
|
16
|
+
fg(color: "accent" | "success" | "warning" | "error" | "dim" | "muted", text: string): string;
|
|
17
|
+
}
|
|
18
|
+
export interface ProgressRenderOptions {
|
|
19
|
+
style?: ProgressRenderStyle;
|
|
20
|
+
/**
|
|
21
|
+
* Sanitizes and bounds durable text to one display line of at most `max` columns.
|
|
22
|
+
* Defaults to a character-bounded plain-text clip for ACP and text mode.
|
|
23
|
+
*/
|
|
24
|
+
clip?: (text: string, max: number) => string;
|
|
25
|
+
barWidth?: number;
|
|
26
|
+
}
|
|
27
|
+
/** Render the overview as display lines (no trailing newline). */
|
|
28
|
+
export declare function renderProgressSnapshot(snapshot: ProjectProgressSnapshot, options?: ProgressRenderOptions): string[];
|
|
@@ -257,10 +257,11 @@ export declare class MCPManager {
|
|
|
257
257
|
/**
|
|
258
258
|
* Resolve auth and shell-command substitutions in config before connecting.
|
|
259
259
|
*/
|
|
260
|
-
prepareConfig(config: MCPServerConfig): Promise<MCPServerConfig>;
|
|
260
|
+
prepareConfig(config: MCPServerConfig, source?: SourceMeta): Promise<MCPServerConfig>;
|
|
261
261
|
/** Acquire a prepared, pool-owned lease for a scoped transient operation. */
|
|
262
262
|
withPreparedLease<T>(name: string, config: MCPServerConfig, fn: (lease: MCPPoolLease) => Promise<T> | T, options?: {
|
|
263
263
|
signal?: AbortSignal;
|
|
264
|
+
source?: SourceMeta;
|
|
264
265
|
}): Promise<T>;
|
|
265
266
|
/** Read-only test seam for pending retired lease-release records. */
|
|
266
267
|
get retiredLeaseReleaseCountForTests(): number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Follow same-origin MCP redirects only.
|
|
3
|
+
*
|
|
4
|
+
* A cross-origin 307/308 would carry custom credential headers, `Mcp-Session-Id`,
|
|
5
|
+
* and the JSON-RPC body. The first request uses `rawUrl` unchanged so a caller
|
|
6
|
+
* that cannot be parsed (diagnostic redaction) still reaches fetch, but with
|
|
7
|
+
* `redirect: "manual"` so that hop is not followed either.
|
|
8
|
+
*/
|
|
9
|
+
export declare function fetchMcpRespectingOrigin(rawUrl: string, init: BunFetchRequestInit): Promise<Response>;
|
|
@@ -3,6 +3,7 @@ import type { MCPHttpServerConfig, MCPSseServerConfig } from "./types";
|
|
|
3
3
|
/** Mark an in-memory plugin-bundle remote MCP config for connection-bound public-network enforcement. */
|
|
4
4
|
export declare function bindPluginMcpToPublicNetwork<T extends MCPHttpServerConfig | MCPSseServerConfig>(config: T): T;
|
|
5
5
|
/** The marker is an internal symbol, so persisted user MCP configs cannot opt into or forge this path. */
|
|
6
|
+
export declare function usesPublicNetworkMcpFetch(config: MCPHttpServerConfig | MCPSseServerConfig): boolean;
|
|
6
7
|
export declare function isPluginMcpPublicNetworkBound(config: MCPHttpServerConfig | MCPSseServerConfig): boolean;
|
|
7
8
|
/**
|
|
8
9
|
* Fetch a plugin-bundle MCP request through a DNS-pinned public address. Every
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host-value policy for MCP config that comes from an untrusted project file.
|
|
3
|
+
*
|
|
4
|
+
* User mcp.json and an explicit `--mcp-config` file may still substitute
|
|
5
|
+
* secret-named environment variables and run `!` shell commands. A project
|
|
6
|
+
* file (native `.gjc/mcp.json` or a repo-root `mcp.json`) uses the same
|
|
7
|
+
* sensitive-name rule as project `ssh.json`: do not copy those host values
|
|
8
|
+
* into server env or headers, and do not execute `!`.
|
|
9
|
+
*/
|
|
10
|
+
import type { SourceMeta } from "../capability/types";
|
|
11
|
+
export declare function nativeMcpSource(level: "user" | "project", filePath: string): SourceMeta;
|
|
12
|
+
/** True when this server was loaded from untrusted project MCP config. */
|
|
13
|
+
export declare function isUntrustedProjectMcpSource(source: SourceMeta | undefined, toolsOnly: boolean): boolean;
|
|
14
|
+
export type ProjectHostValueDecision = {
|
|
15
|
+
action: "resolve";
|
|
16
|
+
} | {
|
|
17
|
+
action: "drop";
|
|
18
|
+
} | {
|
|
19
|
+
action: "literal";
|
|
20
|
+
value: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Decide how to interpret one env or header value.
|
|
24
|
+
* `drop` means "do not run the shell, and omit the value".
|
|
25
|
+
* `literal` means "do not read process.env".
|
|
26
|
+
*/
|
|
27
|
+
export declare function decideUntrustedProjectConfigValue(value: string, untrusted: boolean): ProjectHostValueDecision;
|
|
@@ -1,4 +1,22 @@
|
|
|
1
|
+
import { type AddressResolver } from "../web/insane/url-guard";
|
|
1
2
|
import type { MCPServerConfig } from "./types";
|
|
3
|
+
type SmitheryConnection = {
|
|
4
|
+
type?: "http" | "stdio";
|
|
5
|
+
deploymentUrl?: string;
|
|
6
|
+
configSchema?: SmitheryConfigSchema;
|
|
7
|
+
};
|
|
8
|
+
type SmitheryConfigSchema = {
|
|
9
|
+
type?: string;
|
|
10
|
+
required?: string[];
|
|
11
|
+
properties?: Record<string, SmitheryConfigProperty>;
|
|
12
|
+
};
|
|
13
|
+
type SmitheryConfigProperty = {
|
|
14
|
+
type?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
default?: unknown;
|
|
17
|
+
enum?: unknown[];
|
|
18
|
+
format?: string;
|
|
19
|
+
};
|
|
2
20
|
type RegistryInputType = "string" | "number" | "boolean";
|
|
3
21
|
export type SmitherySearchResult = {
|
|
4
22
|
id: string;
|
|
@@ -46,6 +64,12 @@ export declare class SmitheryRegistryError extends Error {
|
|
|
46
64
|
status: number;
|
|
47
65
|
constructor(message: string, status: number);
|
|
48
66
|
}
|
|
67
|
+
export declare function resolveSmitheryServerConfig(qualifiedName: string, selected: {
|
|
68
|
+
connection: SmitheryConnection;
|
|
69
|
+
useDirectHttp: boolean;
|
|
70
|
+
}, options?: {
|
|
71
|
+
resolver?: AddressResolver;
|
|
72
|
+
}): Promise<MCPServerConfig | null>;
|
|
49
73
|
export declare function searchSmitheryRegistry(keyword: string, options?: SmitherySearchOptions): Promise<SmitherySearchResult[]>;
|
|
50
74
|
export declare function toConfigName(candidate: string): string;
|
|
51
75
|
export {};
|
|
@@ -119,6 +119,12 @@ export interface MCPHttpServerConfig extends MCPServerConfigBase {
|
|
|
119
119
|
type: "http";
|
|
120
120
|
url: string;
|
|
121
121
|
headers?: Record<string, string>;
|
|
122
|
+
/**
|
|
123
|
+
* When true, every request and redirect for this URL is rechecked against
|
|
124
|
+
* the public-network policy. Persisted so a later process cannot fall back
|
|
125
|
+
* to an unguarded fetch. Ordinary localhost MCP servers leave this unset.
|
|
126
|
+
*/
|
|
127
|
+
publicNetwork?: boolean;
|
|
122
128
|
}
|
|
123
129
|
/** SSE server configuration (deprecated, use HTTP) */
|
|
124
130
|
export interface MCPSseServerConfig extends MCPServerConfigBase {
|
|
@@ -129,5 +129,5 @@ export declare class AcpSdkAdapter {
|
|
|
129
129
|
}): Promise<unknown>;
|
|
130
130
|
/** Dispatches the ACP extension method names without exposing endpoint credentials. */
|
|
131
131
|
handle(method: string, params?: JsonObject): Promise<unknown>;
|
|
132
|
-
registerProvider(provider: AcpProviderRegistration): Promise<void>;
|
|
132
|
+
registerProvider(provider: AcpProviderRegistration, timeoutMs?: number, deadline?: number): Promise<void>;
|
|
133
133
|
}
|
|
@@ -4,7 +4,7 @@ export type { BrokerExitWriterTestBarrier } from "./broker-exit-writer-worker";
|
|
|
4
4
|
export declare function setBrokerExitWriterBarrierForTest(barrier?: BrokerExitWriterTestBarrier): void;
|
|
5
5
|
export type BrokerExitMode = "owned-root" | "lost-root";
|
|
6
6
|
export type BrokerFenceReason = "suspect-unpublished" | "observation-ambiguous" | "heartbeat-ambiguous";
|
|
7
|
-
export type BrokerExitReason = "ownership-fence-expired" | "publication-liveness-timeout" | "restart-committed" | "shutdown-request" | "startup-failure" | "signal";
|
|
7
|
+
export type BrokerExitReason = "ownership-fence-expired" | "publication-liveness-timeout" | "heartbeat-renewal-blocked" | "restart-committed" | "shutdown-request" | "startup-failure" | "signal";
|
|
8
8
|
export type BrokerStopRequest = {
|
|
9
9
|
kind: "shutdown-request";
|
|
10
10
|
} | {
|
|
@@ -20,6 +20,8 @@ export interface BrokerExitRecord {
|
|
|
20
20
|
fenceReason: BrokerFenceReason | null;
|
|
21
21
|
fencedForMs: number;
|
|
22
22
|
uptimeMs: number;
|
|
23
|
+
/** For a blocked heartbeat renewal: retained removal transition path. */
|
|
24
|
+
blockingLockPath?: string;
|
|
23
25
|
pid: number;
|
|
24
26
|
signal: "SIGINT" | "SIGTERM" | null;
|
|
25
27
|
writtenAt: number;
|
|
@@ -27,7 +29,7 @@ export interface BrokerExitRecord {
|
|
|
27
29
|
export interface BrokerStartupExitRecord {
|
|
28
30
|
version: 1;
|
|
29
31
|
mode: "startup";
|
|
30
|
-
reason: "startup-deadline" | "startup-signal";
|
|
32
|
+
reason: "startup-deadline" | "startup-signal" | "startup-lock-blocked";
|
|
31
33
|
fenceReason: null;
|
|
32
34
|
fencedForMs: 0;
|
|
33
35
|
uptimeMs: number;
|
|
@@ -36,6 +38,8 @@ export interface BrokerStartupExitRecord {
|
|
|
36
38
|
exitCode: 1 | 130 | 143;
|
|
37
39
|
timeoutMs: number | null;
|
|
38
40
|
writtenAt: number;
|
|
41
|
+
/** For lock-blocked reason: path to the retained removal transition. */
|
|
42
|
+
blockingLockPath?: string;
|
|
39
43
|
}
|
|
40
44
|
export type BrokerStartupExitWriteStatus = {
|
|
41
45
|
kind: "written";
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { NativeDirectoryTreeSnapshot } from "@gajae-code/natives";
|
|
2
2
|
import type { ModelProfileErrorDetails } from "../../config/model-profile-contract";
|
|
3
|
+
import type { TaskArtifactOwnerDeletionEvidence, TaskArtifactOwnerRetirementContinuation } from "../../session/task-artifact-owner-codec";
|
|
3
4
|
import { type SdkHostModelResolver } from "../host/model-pin";
|
|
4
5
|
import { type DirectoryMigrationPolicy } from "../session-directory";
|
|
5
|
-
import { type BrokerStopRequest } from "./broker-exit";
|
|
6
|
+
import { type BrokerExitMode, type BrokerExitReason, type BrokerStopRequest } from "./broker-exit";
|
|
6
7
|
import { type BrokerDiscovery, type BrokerPublicationObservation, type RedactedBrokerDiscovery } from "./discovery";
|
|
7
8
|
import { type LifecycleDurableEffectsReceipt, LifecycleLedger, type LifecycleStartupFailureReceipt } from "./lifecycle-ledger";
|
|
8
9
|
import { type IndexedSession, SessionIndex } from "./session-index";
|
|
9
10
|
import { type MasterCapabilityVerifier, type SpawnSubstrateFailure, type SpawnSubstrateProvider } from "./spawn-authority";
|
|
11
|
+
import type { BrokerTaskArtifactOwnerRetirementDisposition } from "./task-artifact-owner-validation";
|
|
10
12
|
export interface BrokerSettings {
|
|
11
13
|
agentDir: string;
|
|
12
14
|
packageGeneration?: string;
|
|
@@ -36,6 +38,8 @@ export interface BrokerSettings {
|
|
|
36
38
|
restartRequestId?: string;
|
|
37
39
|
/** Cancel bootstrap before retained publication when the owning CLI receives a signal. */
|
|
38
40
|
startupAbortSignal?: AbortSignal;
|
|
41
|
+
/** Monotonic checkpoint deadline, leaving time for retained publication. */
|
|
42
|
+
startupCheckpointDeadline?: number;
|
|
39
43
|
/** Called synchronously when retained publication establishes broker readiness. */
|
|
40
44
|
onStartupReady?: () => void;
|
|
41
45
|
/** Test-only delay after session checkpoint to verify unpublished discovery ownership. */
|
|
@@ -127,6 +131,19 @@ export type BrokerCleanupEvidence = {
|
|
|
127
131
|
retainedTranscriptSuccessorPath?: string;
|
|
128
132
|
retainedTranscriptPlaceholderPath?: string;
|
|
129
133
|
retainedTranscriptUnknownPath?: string;
|
|
134
|
+
/** Immutable task-artifact owner authority captured before the first deletion effect. */
|
|
135
|
+
taskArtifactOwnerDeletionEvidence?: TaskArtifactOwnerDeletionEvidence;
|
|
136
|
+
/** Latest exact native remnant; it never replaces the original deletion evidence. */
|
|
137
|
+
taskArtifactOwnerRetirementContinuation?: TaskArtifactOwnerRetirementContinuation;
|
|
138
|
+
/** Strict owner-only wire disposition, decoded only with its separately stored evidence. */
|
|
139
|
+
taskArtifactOwnerRetirementOutcome?: BrokerTaskArtifactOwnerRetirementDisposition;
|
|
140
|
+
taskArtifactOwnerPayloadRetired?: true;
|
|
141
|
+
taskArtifactOwnerNamespaceRetained?: true;
|
|
142
|
+
taskArtifactOwnerRetired?: true;
|
|
143
|
+
/** Durable fact that transcript retirement completed while the owner namespace remains. */
|
|
144
|
+
taskArtifactOwnerTranscriptDeleted?: true;
|
|
145
|
+
/** Stable artifacts-phase owner refusal diagnostic. */
|
|
146
|
+
taskArtifactOwnerCleanupError?: string;
|
|
130
147
|
/** Durable proof that artifact cleanup completed before transcript mutation. */
|
|
131
148
|
artifactsRemoved?: boolean;
|
|
132
149
|
artifactsAbsentAtAuthorization?: true;
|
|
@@ -356,13 +373,18 @@ export declare class Broker {
|
|
|
356
373
|
start(): Promise<BrokerDiscovery>;
|
|
357
374
|
get ownsDiscovery(): boolean;
|
|
358
375
|
get completion(): Promise<void>;
|
|
376
|
+
/** Why this broker completed, or null while it is still running. */
|
|
377
|
+
get terminalExit(): {
|
|
378
|
+
readonly mode: BrokerExitMode;
|
|
379
|
+
readonly reason: BrokerExitReason;
|
|
380
|
+
} | null;
|
|
359
381
|
prepareRestart(options: BrokerRestartPrepareOptions): Promise<BrokerRestartResult>;
|
|
360
382
|
commitRestart(options: BrokerRestartCommitOptions): Promise<BrokerRestartResult>;
|
|
361
383
|
cancelRestart(requestId: string): Promise<BrokerRestartResult>;
|
|
362
384
|
status(): RedactedBrokerDiscovery | null;
|
|
363
385
|
heartbeat(): Promise<void>;
|
|
364
386
|
/** Re-observes provably live session hosts and checkpoints their liveness. */
|
|
365
|
-
heartbeatSessions(now?: number): Promise<number>;
|
|
387
|
+
heartbeatSessions(now?: number, abortSignal?: AbortSignal, deadlineAt?: number): Promise<number>;
|
|
366
388
|
/**
|
|
367
389
|
* Revalidate retained publication ownership and begin one synchronous effect in
|
|
368
390
|
* the same stack. The callback is the authority boundary: callers must perform
|
|
@@ -23,6 +23,11 @@ export type DoctorBrokerRestartOutcome = {
|
|
|
23
23
|
} | {
|
|
24
24
|
kind: "owner_unavailable";
|
|
25
25
|
reason: "no_discovery" | "owner_not_confirmed_live";
|
|
26
|
+
}
|
|
27
|
+
/** Attach-only mode: the broker belongs to an external supervisor, so restart through it. */
|
|
28
|
+
| {
|
|
29
|
+
kind: "attach_only_refused";
|
|
30
|
+
reason: "supervisor_owned";
|
|
26
31
|
} | {
|
|
27
32
|
kind: "prepare_refused";
|
|
28
33
|
code: string;
|
|
@@ -152,7 +152,20 @@ export declare function closeBrokerClientBeforeDeadline(client: {
|
|
|
152
152
|
}, deadline: number): Promise<void>;
|
|
153
153
|
/** Reconcile an observed broker generation before entering a startup critical section. */
|
|
154
154
|
export declare function reconcileBrokerGenerationForStartup(settings: EnsureBrokerSettings, deadline?: number): Promise<BrokerDiscovery | undefined>;
|
|
155
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* Attach-only client mode. When `GJC_SDK_BROKER_AUTOSTART=0`, `ensureBroker`
|
|
157
|
+
* never spawns, retires or restarts a broker: it returns a live, reusable
|
|
158
|
+
* discovery or fails with `broker_unavailable`. Hosts that supervise their own
|
|
159
|
+
* broker (for example a system service) set it for every client they run. The
|
|
160
|
+
* broker entrypoints never call `ensureBroker`, so they ignore the variable and
|
|
161
|
+
* their descendants may inherit it.
|
|
162
|
+
*/
|
|
163
|
+
export declare const SDK_BROKER_AUTOSTART_ENV = "GJC_SDK_BROKER_AUTOSTART";
|
|
164
|
+
export declare function isBrokerAttachOnly(env?: NodeJS.ProcessEnv): boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Starts the detached broker entrypoint when discovery has no live owner. In
|
|
167
|
+
* attach-only mode (`SDK_BROKER_AUTOSTART_ENV`) it only attaches.
|
|
168
|
+
*/
|
|
156
169
|
export declare function ensureBroker(settings: EnsureBrokerSettings): Promise<BrokerDiscovery>;
|
|
157
170
|
/** Starts one fresh fixture broker and returns its sole exact-child close lease. */
|
|
158
171
|
export declare function startFixtureBrokerWithLeaseForTest(settings: EnsureBrokerSettings): Promise<StartedFixtureBroker>;
|