@gajae-code/coding-agent 0.11.6 → 0.11.8
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 +92 -0
- package/dist/types/capability/index.d.ts +10 -20
- package/dist/types/capability/types.d.ts +3 -0
- package/dist/types/cli/args.d.ts +0 -2
- package/dist/types/commands/daemon.d.ts +2 -2
- package/dist/types/commands/sdk.d.ts +20 -2
- package/dist/types/config/keybindings.d.ts +34 -4
- package/dist/types/config/model-profile-activation.d.ts +4 -3
- package/dist/types/config/model-profile-contract.d.ts +38 -0
- package/dist/types/config/settings-schema.d.ts +70 -7
- package/dist/types/edit/modes/patch.d.ts +13 -0
- package/dist/types/edit/path-mutation-lock.d.ts +15 -0
- package/dist/types/eval/py/executor.d.ts +1 -1
- package/dist/types/eval/py/runner-artifact.d.ts +8 -0
- package/dist/types/eval/py/tool-bridge.d.ts +1 -2
- package/dist/types/gjc-runtime/repository-binding.d.ts +63 -0
- package/dist/types/gjc-runtime/ultragoal-guard.d.ts +6 -5
- package/dist/types/gjc-runtime/ultragoal-receipt-freshness.d.ts +20 -0
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +43 -5
- package/dist/types/main.d.ts +32 -1
- package/dist/types/modes/components/btw-panel.d.ts +1 -0
- package/dist/types/modes/components/model-selector.d.ts +2 -0
- package/dist/types/modes/components/runtime-mcp-add-wizard.d.ts +2 -1
- package/dist/types/modes/components/tool-status-header.d.ts +4 -2
- package/dist/types/modes/components/welcome.d.ts +2 -0
- package/dist/types/modes/controllers/btw-controller.d.ts +5 -0
- package/dist/types/modes/controllers/command-controller.d.ts +2 -0
- package/dist/types/modes/controllers/selector-controller.d.ts +2 -1
- package/dist/types/modes/interactive-mode.d.ts +7 -2
- package/dist/types/modes/prompt-action-autocomplete.d.ts +6 -1
- package/dist/types/modes/prompt-suggestion-controller.d.ts +35 -0
- package/dist/types/modes/shared/agent-wire/workflow-gate-broker.d.ts +2 -2
- package/dist/types/modes/types.d.ts +4 -0
- package/dist/types/modes/utils/hotkeys-markdown.d.ts +2 -1
- package/dist/types/runtime-mcp/content-limits.d.ts +7 -0
- package/dist/types/runtime-mcp/manager.d.ts +1 -1
- package/dist/types/runtime-mcp/oauth-flow.d.ts +0 -5
- package/dist/types/runtime-mcp/plugin-network-boundary.d.ts +14 -0
- package/dist/types/sdk/broker/broker.d.ts +2 -0
- package/dist/types/sdk/broker/lifecycle.d.ts +6 -0
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +6 -1
- package/dist/types/sdk/bus/config-commands.d.ts +2 -2
- package/dist/types/sdk/bus/config.d.ts +2 -0
- package/dist/types/sdk/bus/conversation-store.d.ts +1 -0
- package/dist/types/sdk/bus/index.d.ts +26 -1
- package/dist/types/sdk/bus/lifecycle-commands.d.ts +5 -4
- package/dist/types/sdk/bus/notification-orchestration.d.ts +1 -0
- package/dist/types/sdk/bus/notification-service.d.ts +34 -0
- package/dist/types/sdk/bus/prompt-reconciliation.d.ts +105 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +18 -3
- package/dist/types/sdk/bus/telegram-daemon-control.d.ts +5 -1
- package/dist/types/sdk/bus/telegram-daemon.d.ts +189 -4
- package/dist/types/sdk/bus/telegram-reference.d.ts +2 -0
- package/dist/types/sdk/bus/topic-registry.d.ts +88 -2
- package/dist/types/sdk/client/discovery.d.ts +2 -0
- package/dist/types/sdk/client/liveness.d.ts +7 -0
- package/dist/types/sdk/host/control/operations.d.ts +1 -1
- package/dist/types/sdk/host/host.d.ts +1 -1
- package/dist/types/sdk/host/query/handlers.d.ts +9 -0
- package/dist/types/sdk/index.d.ts +2 -0
- package/dist/types/sdk/prompt-status.d.ts +88 -0
- package/dist/types/sdk/session-directory.d.ts +1 -1
- package/dist/types/sdk/startup-capability.d.ts +3 -0
- package/dist/types/sdk/transport/auth-preface.d.ts +9 -0
- package/dist/types/sdk/transport/index.d.ts +12 -0
- package/dist/types/sdk/transport/relay.d.ts +43 -0
- package/dist/types/sdk/transport/serve-cli.d.ts +4 -0
- package/dist/types/sdk/transport/socket.d.ts +7 -0
- package/dist/types/sdk/transport/stdio.d.ts +3 -0
- package/dist/types/session/agent-session.d.ts +30 -5
- package/dist/types/session/btw-contract.d.ts +16 -0
- package/dist/types/session/internal/managed-session-scope.d.ts +32 -9
- package/dist/types/session/internal/managed-session-storage.d.ts +27 -10
- package/dist/types/session/internal/native-publish-outcome.d.ts +48 -0
- package/dist/types/session/session-manager.d.ts +25 -4
- package/dist/types/session/session-storage.d.ts +18 -0
- package/dist/types/setup/credential-import.d.ts +5 -1
- package/dist/types/setup/provider-onboarding.d.ts +2 -0
- package/dist/types/ssh/utils.d.ts +1 -0
- package/dist/types/task/discovery.d.ts +3 -1
- package/dist/types/task/index.d.ts +3 -1
- package/dist/types/task/receipt.d.ts +2 -0
- package/dist/types/task/types.d.ts +94 -0
- package/dist/types/tools/ask.d.ts +454 -174
- package/dist/types/tools/fetch.d.ts +5 -8
- package/dist/types/tools/image-gen.d.ts +63 -1
- package/dist/types/tools/index.d.ts +4 -0
- package/dist/types/tools/skill-discovery.d.ts +7 -0
- package/dist/types/tools/sqlite-reader.d.ts +7 -0
- package/dist/types/utils/prompt-suggestion.d.ts +33 -0
- package/dist/types/utils/shell-snapshot.d.ts +12 -0
- package/dist/types/web/insane/bridge.d.ts +1 -0
- package/dist/types/web/insane/url-guard.d.ts +17 -0
- package/package.json +8 -8
- package/scripts/capture-platform-shortcut-labels-showcase.ts +342 -0
- package/scripts/dogfood-repository-binding.ts +209 -0
- package/scripts/generate-sdk-operation-inventory.ts +4 -0
- package/scripts/run-test-manifest.ts +4 -4
- package/src/capability/index.ts +50 -42
- package/src/capability/types.ts +3 -0
- package/src/cli/args.ts +2 -92
- package/src/cli/notify-cli.ts +5 -38
- package/src/cli/setup-cli.ts +10 -4
- package/src/cli.ts +52 -9
- package/src/commands/daemon.ts +22 -5
- package/src/commands/sdk.ts +44 -11
- package/src/config/keybindings.ts +158 -25
- package/src/config/model-profile-activation.ts +7 -18
- package/src/config/model-profile-contract.ts +161 -0
- package/src/config/model-profiles.ts +18 -0
- package/src/config/model-registry.ts +11 -1
- package/src/config/settings-schema.ts +73 -7
- package/src/coordinator-mcp/model-preset.ts +21 -74
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +2 -2
- package/src/defaults/gjc/skills/ralplan/SKILL.md +3 -1
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +42 -1
- package/src/discovery/ssh.ts +12 -1
- package/src/edit/index.ts +3 -6
- package/src/edit/modes/patch.ts +38 -1
- package/src/edit/modes/replace.ts +42 -0
- package/src/edit/path-mutation-lock.ts +112 -0
- package/src/eval/py/executor.ts +30 -11
- package/src/eval/py/kernel.ts +1 -21
- package/src/eval/py/prelude.py +2 -2
- package/src/eval/py/runner-artifact.ts +84 -0
- package/src/eval/py/tool-bridge.ts +34 -18
- package/src/extensibility/gjc-plugins/runtime-adapters.ts +2 -1
- package/src/extensibility/plugins/marketplace/fetcher.ts +191 -7
- package/src/gjc-runtime/launch-tmux.ts +1 -1
- package/src/gjc-runtime/managed-owner-supervisor.ts +83 -4
- package/src/gjc-runtime/ralplan-runtime.ts +75 -3
- package/src/gjc-runtime/repository-binding.ts +267 -0
- package/src/gjc-runtime/session-state-sidecar.ts +25 -9
- package/src/gjc-runtime/tmux-owner-isolation.ts +2 -1
- package/src/gjc-runtime/tmux-sessions.ts +45 -6
- package/src/gjc-runtime/ultragoal-guard.ts +93 -15
- package/src/gjc-runtime/ultragoal-receipt-freshness.ts +103 -0
- package/src/gjc-runtime/ultragoal-runtime.ts +456 -31
- package/src/gjc-runtime/workflow-manifest.generated.json +58 -0
- package/src/gjc-runtime/workflow-manifest.ts +23 -0
- package/src/internal-urls/docs-index.generated.ts +12 -10
- package/src/internal-urls/local-protocol.ts +64 -21
- package/src/internal-urls/mcp-protocol.ts +73 -11
- package/src/main.ts +111 -37
- package/src/modes/DESIGN.md +5 -0
- package/src/modes/acp/acp-agent.ts +50 -16
- package/src/modes/action-registry.ts +1 -1
- package/src/modes/components/btw-panel.ts +82 -16
- package/src/modes/components/model-selector.ts +73 -11
- package/src/modes/components/plan-preview-overlay.ts +1 -1
- package/src/modes/components/runtime-mcp-add-wizard.ts +5 -0
- package/src/modes/components/tool-status-header.ts +25 -4
- package/src/modes/components/welcome.ts +22 -18
- package/src/modes/controllers/btw-controller.ts +119 -36
- package/src/modes/controllers/command-controller.ts +97 -54
- package/src/modes/controllers/event-controller.ts +10 -0
- package/src/modes/controllers/input-controller.ts +38 -2
- package/src/modes/controllers/runtime-mcp-command-controller.ts +29 -6
- package/src/modes/controllers/selector-controller.ts +149 -63
- package/src/modes/interactive-mode.ts +57 -34
- package/src/modes/prompt-action-autocomplete.ts +32 -13
- package/src/modes/prompt-suggestion-controller.ts +96 -0
- package/src/modes/shared/agent-wire/workflow-gate-broker.ts +2 -2
- package/src/modes/types.ts +4 -0
- package/src/modes/utils/hotkeys-markdown.ts +64 -36
- package/src/modes/utils/ui-helpers.ts +5 -3
- package/src/prompts/agents/architect.md +0 -1
- package/src/prompts/agents/critic.md +0 -1
- package/src/prompts/system/btw-user.md +3 -8
- package/src/prompts/system/prompt-suggestion-system.md +32 -0
- package/src/prompts/system/system-prompt.md +6 -4
- package/src/prompts/tools/cron.md +3 -1
- package/src/prompts/tools/skill-discovery.md +1 -0
- package/src/runtime-mcp/client.ts +41 -55
- package/src/runtime-mcp/content-limits.ts +71 -0
- package/src/runtime-mcp/json-rpc.ts +23 -9
- package/src/runtime-mcp/manager.ts +51 -53
- package/src/runtime-mcp/oauth-flow.ts +0 -72
- package/src/runtime-mcp/plugin-network-boundary.ts +101 -0
- package/src/runtime-mcp/transports/http.ts +63 -22
- package/src/sdk/broker/broker.ts +34 -20
- package/src/sdk/broker/lifecycle.ts +185 -36
- package/src/sdk/bus/chat-daemon-control.ts +19 -5
- package/src/sdk/bus/config-commands.ts +2 -2
- package/src/sdk/bus/config.ts +9 -1
- package/src/sdk/bus/conversation-store.ts +40 -6
- package/src/sdk/bus/index.ts +244 -70
- package/src/sdk/bus/lifecycle-commands.ts +63 -10
- package/src/sdk/bus/lifecycle-control-runtime.ts +11 -2
- package/src/sdk/bus/lifecycle-orchestrator.ts +32 -1
- package/src/sdk/bus/notification-orchestration.ts +12 -0
- package/src/sdk/bus/notification-service.ts +68 -20
- package/src/sdk/bus/prompt-reconciliation.ts +239 -0
- package/src/sdk/bus/recent-activity.ts +90 -26
- package/src/sdk/bus/telegram-daemon-contract.ts +18 -3
- package/src/sdk/bus/telegram-daemon-control.ts +147 -35
- package/src/sdk/bus/telegram-daemon.ts +2463 -450
- package/src/sdk/bus/telegram-reference.ts +20 -2
- package/src/sdk/bus/topic-registry.ts +451 -12
- package/src/sdk/cli/session-cli.ts +15 -2
- package/src/sdk/client/discovery.ts +19 -3
- package/src/sdk/client/liveness.ts +49 -0
- package/src/sdk/host/control/dispatch.ts +1 -1
- package/src/sdk/host/control/operations.ts +1 -1
- package/src/sdk/host/host.ts +2 -6
- package/src/sdk/host/query/handlers.ts +70 -5
- package/src/sdk/index.ts +12 -0
- package/src/sdk/prompt-status.ts +97 -0
- package/src/sdk/protocol/operation-inventory.generated.json +58 -0
- package/src/sdk/protocol/operation-registry.ts +18 -4
- package/src/sdk/session-directory.ts +5 -1
- package/src/sdk/session.ts +31 -5
- package/src/sdk/startup-capability.ts +9 -1
- package/src/sdk/transport/auth-preface.ts +82 -0
- package/src/sdk/transport/index.ts +18 -0
- package/src/sdk/transport/relay.ts +252 -0
- package/src/sdk/transport/serve-cli.ts +105 -0
- package/src/sdk/transport/socket.ts +197 -0
- package/src/sdk/transport/stdio.ts +17 -0
- package/src/session/agent-session.ts +292 -154
- package/src/session/blob-store.ts +25 -7
- package/src/session/btw-contract.ts +59 -0
- package/src/session/internal/managed-session-scope.ts +1163 -137
- package/src/session/internal/managed-session-storage.ts +397 -234
- package/src/session/internal/native-publish-outcome.ts +266 -0
- package/src/session/session-manager.ts +620 -403
- package/src/session/session-storage.ts +128 -11
- package/src/setup/credential-import.ts +28 -3
- package/src/setup/provider-onboarding.ts +30 -1
- package/src/setup/provider-presets.json +2 -1
- package/src/slash-commands/builtin-registry.ts +1 -1
- package/src/ssh/utils.ts +14 -0
- package/src/task/discovery.ts +8 -2
- package/src/task/gjc-command.ts +2 -2
- package/src/task/index.ts +121 -15
- package/src/task/receipt.ts +3 -0
- package/src/task/types.ts +34 -3
- package/src/tools/ask.ts +199 -89
- package/src/tools/ast-edit.ts +2 -2
- package/src/tools/bash-pty-selection.ts +2 -2
- package/src/tools/browser/screenshot-format.ts +6 -1
- package/src/tools/cron.ts +1 -1
- package/src/tools/fetch.ts +13 -131
- package/src/tools/image-gen.ts +476 -23
- package/src/tools/index.ts +4 -0
- package/src/tools/read.ts +2 -0
- package/src/tools/render-utils.ts +7 -1
- package/src/tools/skill-discovery.ts +39 -3
- package/src/tools/sqlite-reader.ts +63 -5
- package/src/utils/edit-mode.ts +2 -2
- package/src/utils/pasted-image-path.ts +15 -6
- package/src/utils/prompt-suggestion.ts +265 -0
- package/src/utils/shell-snapshot.ts +173 -63
- package/src/utils/sixel.ts +3 -3
- package/src/web/insane/bridge.ts +5 -1
- package/src/web/insane/url-guard.ts +140 -27
- package/src/web/scrapers/docs-rs.ts +30 -5
- package/src/web/scrapers/types.ts +19 -49
- package/src/web/scrapers/utils.ts +12 -26
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type GitRepository } from "../utils/git";
|
|
2
|
+
export declare const REPOSITORY_BINDING_SCHEMA: "gjc.repository_binding.v1";
|
|
3
|
+
export interface RepositoryBinding {
|
|
4
|
+
schema: typeof REPOSITORY_BINDING_SCHEMA;
|
|
5
|
+
/** Canonical realpath of the git worktree root (or resolved cwd root). */
|
|
6
|
+
worktreeRoot: string;
|
|
7
|
+
/** Git common dir realpath when available; null outside a git checkout. */
|
|
8
|
+
commonDir: string | null;
|
|
9
|
+
/** Optional repo-relative subdirectory the lane should operate under. */
|
|
10
|
+
relativeSubdir?: string;
|
|
11
|
+
/** Optional display path (may be non-canonical); never used for authority. */
|
|
12
|
+
displayPath?: string;
|
|
13
|
+
/** Optional baseline HEAD at capture time. */
|
|
14
|
+
head?: string;
|
|
15
|
+
/** Optional branch name at capture time (when not detached). */
|
|
16
|
+
branch?: string;
|
|
17
|
+
}
|
|
18
|
+
export type RepositoryBindingErrorCode = "not_a_repository" | "identity_mismatch" | "path_outside_root" | "invalid_binding";
|
|
19
|
+
export declare class RepositoryBindingError extends Error {
|
|
20
|
+
readonly code: RepositoryBindingErrorCode;
|
|
21
|
+
constructor(code: RepositoryBindingErrorCode, message: string);
|
|
22
|
+
}
|
|
23
|
+
/** Capture a durable binding from the active cwd/worktree. */
|
|
24
|
+
export declare function captureRepositoryBinding(cwd: string, options?: {
|
|
25
|
+
relativeSubdir?: string;
|
|
26
|
+
displayPath?: string;
|
|
27
|
+
}): Promise<RepositoryBinding>;
|
|
28
|
+
/** Parse a binding from JSON/plan payload; fail closed on malformed shapes. */
|
|
29
|
+
export declare function parseRepositoryBinding(value: unknown): RepositoryBinding;
|
|
30
|
+
/** True when two bindings refer to the same repository identity (linked worktrees ok). */
|
|
31
|
+
export declare function repositoryBindingsMatch(left: RepositoryBinding, right: RepositoryBinding): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Ensure `cwd` is inside the bound repository (or the same linked worktree family).
|
|
34
|
+
* Fails closed on sibling-repo drift.
|
|
35
|
+
*/
|
|
36
|
+
export declare function assertCwdMatchesRepositoryBinding(cwd: string, binding: RepositoryBinding): Promise<RepositoryBinding>;
|
|
37
|
+
/** Ensure a declared target path resolves under the bound worktree root. */
|
|
38
|
+
export declare function assertPathUnderRepositoryBinding(binding: RepositoryBinding, targetPath: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Public identity snapshot for receipts/handoffs (no display-only fields required).
|
|
41
|
+
* Always includes the schema + durable roots so downstream lanes can re-verify.
|
|
42
|
+
*/
|
|
43
|
+
export declare function publicRepositoryBinding(binding: RepositoryBinding): RepositoryBinding;
|
|
44
|
+
/**
|
|
45
|
+
* Resolve the authoritative binding for a delegated task before discovery/spawn.
|
|
46
|
+
*
|
|
47
|
+
* - Missing declaration → stamp from session cwd (never leave authority implicit).
|
|
48
|
+
* - Declared binding → parse + fail closed unless it matches the active session worktree.
|
|
49
|
+
* - relativeSubdir (when present) must resolve under the bound root.
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveTaskRepositoryBinding(sessionCwd: string, declared: unknown | undefined): Promise<RepositoryBinding>;
|
|
52
|
+
/**
|
|
53
|
+
* Ensure an execution/isolation root (cwd or worktree) still matches the bound identity.
|
|
54
|
+
* Used after isolation workspace creation so linked worktrees keep the source repository.
|
|
55
|
+
*/
|
|
56
|
+
export declare function assertExecutionRootMatchesRepositoryBinding(executionRoot: string, binding: RepositoryBinding): Promise<RepositoryBinding>;
|
|
57
|
+
/** Optional helper for tests and diagnostics. */
|
|
58
|
+
export declare function bindingFromGitRepository(repository: GitRepository, options?: {
|
|
59
|
+
relativeSubdir?: string;
|
|
60
|
+
displayPath?: string;
|
|
61
|
+
head?: string;
|
|
62
|
+
branch?: string;
|
|
63
|
+
}): RepositoryBinding;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type UltragoalGoal, type UltragoalLedgerEvent, type UltragoalNudgeSurface, type UltragoalPlan, type UltragoalReceiptKind } from "./ultragoal-runtime";
|
|
2
|
-
export type UltragoalGuardState = "inactive" | "unrelated_goal" | "active_verified_complete" | "active_missing_receipt" | "active_stale_receipt" | "active_missing_final_receipt" | "active_dirty_quality_gate" | "active_review_blocked_unrecorded" | "active_review_blocked_recorded" | "unreadable_fail_closed";
|
|
2
|
+
export type UltragoalGuardState = "inactive" | "unrelated_goal" | "active_verified_complete" | "active_missing_receipt" | "active_stale_receipt" | "active_missing_final_receipt" | "active_dirty_quality_gate" | "active_review_blocked_unrecorded" | "active_review_blocked_recorded" | "active_missing_critic_verdict" | "unreadable_fail_closed";
|
|
3
3
|
export interface UltragoalGuardDiagnostic {
|
|
4
4
|
state: UltragoalGuardState;
|
|
5
5
|
message: string;
|
|
@@ -25,6 +25,7 @@ export interface CurrentGoalLike {
|
|
|
25
25
|
source: "user";
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
+
export declare function isKnownUltragoalObjective(currentObjective: string): boolean;
|
|
28
29
|
export declare function validateCompletionReceipt(input: {
|
|
29
30
|
plan: UltragoalPlan;
|
|
30
31
|
ledger: readonly UltragoalLedgerEvent[];
|
|
@@ -78,10 +79,10 @@ export interface UltragoalPauseBlockDiagnostic {
|
|
|
78
79
|
}
|
|
79
80
|
/**
|
|
80
81
|
* While an Ultragoal run is active, `goal({"op":"pause"})` is only allowed when the
|
|
81
|
-
* current durable Ultragoal state is readable
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* blocks pause rather than silently allowing a give-up.
|
|
82
|
+
* current durable Ultragoal state is readable, the latest `blocker_classified`
|
|
83
|
+
* event is `human_blocked`, and a later fresh clean pause terminal critic verdict is bound to
|
|
84
|
+
* that exact classification. Reads fail closed so unreadable durable state or
|
|
85
|
+
* ledger data blocks pause rather than silently allowing a give-up.
|
|
85
86
|
*/
|
|
86
87
|
export declare function isUltragoalPauseBlocked(cwd: string): Promise<UltragoalPauseBlockDiagnostic>;
|
|
87
88
|
export declare function assertUltragoalPauseAllowed(cwd: string): Promise<void>;
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
import type { UltragoalCompletionVerification, UltragoalGoal, UltragoalGoalStatus, UltragoalLedgerEvent, UltragoalPlan, UltragoalReceiptKind } from "./ultragoal-runtime";
|
|
2
|
+
export declare const CRITIC_VERDICT_EVENT = "critic_verdict";
|
|
3
|
+
export declare const CRITIC_GATE_HARD_STOP_EVENT = "critic_gate_hard_stop";
|
|
4
|
+
export declare const CRITIC_GATE_OVERRIDE_EVENT = "critic_gate_override";
|
|
5
|
+
export declare const TERMINAL_CRITIC_CEILING = 5;
|
|
6
|
+
export type CriticVerdict = "OKAY" | "ITERATE" | "REJECT";
|
|
2
7
|
export type UltragoalReceiptFreshnessDiagnostic = {
|
|
3
8
|
state: "inactive" | "unrelated_goal" | "active_verified_complete" | "active_missing_receipt" | "active_stale_receipt" | "active_missing_final_receipt" | "active_dirty_quality_gate" | "active_review_blocked_unrecorded" | "active_review_blocked_recorded" | "unreadable_fail_closed";
|
|
4
9
|
message: string;
|
|
5
10
|
goalId?: string;
|
|
6
11
|
};
|
|
7
12
|
export declare function requiredUltragoalGoals(plan: UltragoalPlan): UltragoalGoal[];
|
|
13
|
+
/** Hash the current required-goal set for terminal critic verdict freshness. */
|
|
14
|
+
export declare function computeCriticVerdictPlanGeneration(plan: UltragoalPlan): string;
|
|
15
|
+
export declare function isCleanPauseCriticVerdictShape(candidate: UltragoalLedgerEvent, planGeneration: string, classificationEventId: string): boolean;
|
|
16
|
+
export declare function isCleanPauseCriticVerdict(event: UltragoalLedgerEvent, opts: {
|
|
17
|
+
planGeneration: string;
|
|
18
|
+
classificationEventId: string;
|
|
19
|
+
}): boolean;
|
|
20
|
+
export declare function findCleanPauseCriticVerdict(plan: UltragoalPlan, ledger: readonly UltragoalLedgerEvent[], classificationEventId: string): UltragoalLedgerEvent | null;
|
|
21
|
+
/** Pure: count all ledger `critic_verdict` rows for an exact plan generation. */
|
|
22
|
+
export declare function countTerminalCriticVerdicts(ledger: readonly UltragoalLedgerEvent[], planGeneration: string): number;
|
|
23
|
+
/** Pure: count every non-OKAY terminal critic verdict recorded for this run. */
|
|
24
|
+
export declare function countNonOkayTerminalCriticVerdicts(ledger: readonly UltragoalLedgerEvent[], _legacyPlanGeneration?: string): number;
|
|
25
|
+
export declare function terminalCriticHardStopReached(ledger: readonly UltragoalLedgerEvent[], _legacyPlanGeneration?: string): boolean;
|
|
26
|
+
export declare function terminalCriticGateOverridden(ledger: readonly UltragoalLedgerEvent[]): boolean;
|
|
27
|
+
export declare function terminalCriticCeilingReached(ledger: readonly UltragoalLedgerEvent[], _legacyPlanGeneration?: string): boolean;
|
|
8
28
|
export declare function receiptRelevantGoals(plan: UltragoalPlan, goal: UltragoalGoal, receiptKind: UltragoalReceiptKind): UltragoalGoal[];
|
|
9
29
|
export declare function computeUltragoalPlanGeneration(input: {
|
|
10
30
|
plan: UltragoalPlan;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { WorkflowHudSummary } from "../skill-state/active-state";
|
|
2
|
-
|
|
2
|
+
import { type RepositoryBinding } from "./repository-binding";
|
|
3
|
+
import { type CriticVerdict } from "./ultragoal-receipt-freshness";
|
|
4
|
+
export { CRITIC_GATE_HARD_STOP_EVENT, CRITIC_GATE_OVERRIDE_EVENT, CRITIC_VERDICT_EVENT, type CriticVerdict, computeUltragoalPlanGeneration, countTerminalCriticVerdicts, receiptRelevantGoals, TERMINAL_CRITIC_CEILING, terminalCriticCeilingReached, terminalCriticGateOverridden, } from "./ultragoal-receipt-freshness";
|
|
3
5
|
export { captureUltragoalRecoverySnapshot, parseStrictTerminalTranscript, persistUltragoalRecoveryDecision, planUltragoalOwnerLossRecovery, type UltragoalOwnerLossReceipt, type UltragoalRecoveryBinding, type UltragoalRecoveryDecision, type UltragoalRecoverySnapshot, validateOwnerLossBinding, validateRawUltragoalEvidence, validateRecoveryAdmission, validateRecoveryPath, } from "./ultragoal-owner-loss-recovery";
|
|
4
6
|
export type UltragoalGjcGoalMode = "aggregate" | "per-story";
|
|
5
7
|
export type UltragoalGoalStatus = "pending" | "active" | "complete" | "failed" | "blocked" | "review_blocked" | "superseded";
|
|
@@ -95,6 +97,8 @@ export interface UltragoalPlan {
|
|
|
95
97
|
gjcObjective: string;
|
|
96
98
|
gjcObjectiveAliases?: string[];
|
|
97
99
|
goals: UltragoalGoal[];
|
|
100
|
+
/** Authoritative repository identity for multi-repo fail-closed spawn (#2901). */
|
|
101
|
+
repositoryBinding?: RepositoryBinding;
|
|
98
102
|
createdAt: string;
|
|
99
103
|
updatedAt: string;
|
|
100
104
|
[key: string]: unknown;
|
|
@@ -307,6 +311,26 @@ export { joinUltragoalPipelineOverlap, rebaselineUltragoalPipelineOverlap, start
|
|
|
307
311
|
export declare function getUltragoalRunCompletionState(plan: UltragoalPlan, options?: {
|
|
308
312
|
retryFailed?: boolean;
|
|
309
313
|
}): UltragoalRunCompletionState;
|
|
314
|
+
/**
|
|
315
|
+
* Discriminated next-action for `complete-goals` handoff (#2903).
|
|
316
|
+
* `none` is reserved for genuine completion; `execute-goal` always carries a goal.
|
|
317
|
+
*/
|
|
318
|
+
export type UltragoalCompleteNextActionKind = "none" | "execute-goal" | "retry-failed" | "resolve-blockers" | "final-aggregate-receipt";
|
|
319
|
+
export type UltragoalCompleteNextAction = {
|
|
320
|
+
kind: UltragoalCompleteNextActionKind;
|
|
321
|
+
goal?: UltragoalGoal;
|
|
322
|
+
blockedGoals?: UltragoalGoal[];
|
|
323
|
+
failedGoals?: UltragoalGoal[];
|
|
324
|
+
};
|
|
325
|
+
/**
|
|
326
|
+
* Resolve the actionable next step after scheduling / complete-goals.
|
|
327
|
+
* Blocked and review_blocked goals remain unschedulable; they surface as
|
|
328
|
+
* `resolve-blockers` instead of a contradictory `execute-goal` without goal_id.
|
|
329
|
+
*/
|
|
330
|
+
export declare function resolveUltragoalCompleteNextAction(plan: UltragoalPlan, options?: {
|
|
331
|
+
retryFailed?: boolean;
|
|
332
|
+
selectedGoal?: UltragoalGoal;
|
|
333
|
+
}): UltragoalCompleteNextAction;
|
|
310
334
|
export declare function startNextUltragoalGoal(input: {
|
|
311
335
|
cwd: string;
|
|
312
336
|
retryFailed?: boolean;
|
|
@@ -315,6 +339,7 @@ export declare function startNextUltragoalGoal(input: {
|
|
|
315
339
|
plan: UltragoalPlan;
|
|
316
340
|
goal?: UltragoalGoal;
|
|
317
341
|
allComplete: boolean;
|
|
342
|
+
nextAction: UltragoalCompleteNextAction;
|
|
318
343
|
}>;
|
|
319
344
|
export declare function qualityGateObject(value: unknown): JsonObject | null;
|
|
320
345
|
export declare function nonEmptyStringArray(value: unknown): string[] | null;
|
|
@@ -401,10 +426,10 @@ export declare function recordUltragoalReviewBlockers(input: {
|
|
|
401
426
|
}): Promise<UltragoalPlan>;
|
|
402
427
|
export type UltragoalBlockerClassification = "human_blocked" | "resolvable";
|
|
403
428
|
/**
|
|
404
|
-
* Record an audited blocker triage classification in the durable ledger.
|
|
405
|
-
* `
|
|
406
|
-
*
|
|
407
|
-
* audit note and never unblocks pause.
|
|
429
|
+
* Record an audited blocker triage classification in the durable ledger. Pause
|
|
430
|
+
* requires the latest `blocker_classified` event to be `human_blocked` and a
|
|
431
|
+
* later clean pause terminal critic verdict bound to that classification; `resolvable`
|
|
432
|
+
* is an audit note and never unblocks pause.
|
|
408
433
|
*/
|
|
409
434
|
export declare function recordUltragoalBlockerClassification(input: {
|
|
410
435
|
cwd: string;
|
|
@@ -412,6 +437,19 @@ export declare function recordUltragoalBlockerClassification(input: {
|
|
|
412
437
|
evidence: string;
|
|
413
438
|
goalId?: string;
|
|
414
439
|
}): Promise<UltragoalLedgerEvent>;
|
|
440
|
+
export declare function recordUltragoalCriticVerdict(input: {
|
|
441
|
+
cwd: string;
|
|
442
|
+
terminus: "completion" | "pause";
|
|
443
|
+
verdict: CriticVerdict;
|
|
444
|
+
evidence: string;
|
|
445
|
+
blockers?: string[];
|
|
446
|
+
goalId?: string;
|
|
447
|
+
classificationEventId?: string;
|
|
448
|
+
}): Promise<UltragoalLedgerEvent>;
|
|
449
|
+
export declare function recordUltragoalCriticGateOverride(input: {
|
|
450
|
+
cwd: string;
|
|
451
|
+
evidence: string;
|
|
452
|
+
}): Promise<UltragoalLedgerEvent>;
|
|
415
453
|
type UltragoalReviewContractStrength = "strong" | "thin-derived";
|
|
416
454
|
interface UltragoalReviewFinding extends JsonObject {
|
|
417
455
|
severity: "blocker";
|
package/dist/types/main.d.ts
CHANGED
|
@@ -85,11 +85,15 @@ interface InteractiveModeFactoryOptions {
|
|
|
85
85
|
}
|
|
86
86
|
type CreateInteractiveMode = (options: InteractiveModeFactoryOptions) => InteractiveMode;
|
|
87
87
|
type ResumePickerTerminalCheck = () => boolean;
|
|
88
|
-
type ListForResumePickerReadOnly = (cwd: string, sessionDir?: string) => Promise<SessionInfo[]>;
|
|
88
|
+
type ListForResumePickerReadOnly = (cwd: string, sessionDir?: string, storage?: undefined) => Promise<SessionInfo[]>;
|
|
89
|
+
type ListManagedForResumePickerReadOnly = (cwd: string, managedAgentDir?: string, storage?: undefined) => Promise<SessionInfo[]>;
|
|
90
|
+
type ResolveManagedAgentDirForScope = (cwd: string) => string;
|
|
89
91
|
type SelectResumeSession = (sessions: SessionInfo[]) => Promise<SessionSelectionResult>;
|
|
90
92
|
type OpenExistingSessionStrict = (identity: ResumeSessionIdentity, destination: SessionDestination, storage?: undefined, migrationPolicy?: SessionDirectoryMigrationPolicy) => Promise<StrictSessionOpenResult>;
|
|
91
93
|
export declare const BARE_RESUME_CONFLICT_ERROR = "--resume without a session cannot be combined with --continue, --fork, or --no-session.";
|
|
92
94
|
export declare const BARE_RESUME_INTERACTIVE_ERROR = "--resume requires an interactive terminal; use --resume <id>.";
|
|
95
|
+
/** Resolves only the managed agent root needed for pre-consent picker inventory. */
|
|
96
|
+
export declare function resolveManagedAgentDirForScope(_cwd: string): string;
|
|
93
97
|
export declare const BARE_RESUME_OPEN_ERROR = "Could not open the selected session. Use --resume <id>.";
|
|
94
98
|
export declare function runInteractiveMode(session: AgentSession, version: string, changelogMarkdown: string | undefined, notifs: (InteractiveModeNotify | null)[], startupUpdate: StartupUpdateOrchestrator, initialMessages: string[], setExtensionUIContext: (uiContext: ExtensionUIContext, hasUI: boolean) => void, lspServers: LspStartupServerInfo[] | undefined, mcpManager: MCPManager | undefined, eventBus?: EventBus, initialMessage?: string, initialImages?: ImageContent[], createInteractiveMode?: CreateInteractiveMode, resumeAction?: "continue-tail" | "open-idle"): Promise<void>;
|
|
95
99
|
declare function getChangelogForDisplay(parsed: Args): Promise<string | undefined>;
|
|
@@ -125,11 +129,38 @@ export interface RunRootCommandDependencies {
|
|
|
125
129
|
runPrintMode?: RunPrintMode;
|
|
126
130
|
isResumePickerTerminal?: ResumePickerTerminalCheck;
|
|
127
131
|
listForResumePickerReadOnly?: ListForResumePickerReadOnly;
|
|
132
|
+
listManagedForResumePickerReadOnly?: ListManagedForResumePickerReadOnly;
|
|
133
|
+
resolveManagedAgentDirForScope?: ResolveManagedAgentDirForScope;
|
|
128
134
|
selectResumeSession?: SelectResumeSession;
|
|
129
135
|
openExistingSessionStrict?: OpenExistingSessionStrict;
|
|
130
136
|
initializeSettings?: typeof Settings.init;
|
|
131
137
|
loadSettingsForScope?: typeof Settings.loadForScope;
|
|
132
138
|
}
|
|
139
|
+
export interface ModelRoleOverrides {
|
|
140
|
+
smol?: string;
|
|
141
|
+
slow?: string;
|
|
142
|
+
plan?: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Resolve the ephemeral `smol`/`slow`/`plan` model-role overrides.
|
|
146
|
+
*
|
|
147
|
+
* Precedence per role is CLI flag > documented `GJC_*_MODEL` > legacy
|
|
148
|
+
* `PI_*_MODEL`, matching the repo-wide GJC-first/PI-fallback convention.
|
|
149
|
+
* Resolution reads the process environment via `$pickenv`, which trims values
|
|
150
|
+
* and treats empty/whitespace as unset; it is deliberately kept separate from
|
|
151
|
+
* credential env resolution (`$credentialEnv`/`$pickCredentialEnv`). The
|
|
152
|
+
* function is pure and stateless, so it reads fresh each call and a later
|
|
153
|
+
* invocation never inherits an earlier one's values.
|
|
154
|
+
*/
|
|
155
|
+
export declare function resolveModelRoleOverrides(parsed: Pick<Args, "smol" | "slow" | "plan">): ModelRoleOverrides;
|
|
156
|
+
/**
|
|
157
|
+
* Apply the `--no-pty` / `--no-title` terminal-control flags to the environment.
|
|
158
|
+
*
|
|
159
|
+
* Sets the canonical `GJC_*` name (so an explicit flag wins over a user-set
|
|
160
|
+
* `GJC_*` value under the GJC-first resolver — CLI authority) and the legacy
|
|
161
|
+
* `PI_*` name for backward compatibility. `--acp` mode implies `--no-title`.
|
|
162
|
+
*/
|
|
163
|
+
export declare function applyTerminalControlFlagsToEnv(parsed: Pick<Args, "noPty" | "noTitle" | "mode">, env?: NodeJS.ProcessEnv): void;
|
|
133
164
|
export declare function runRootCommand(parsed: Args, rawArgs: string[], deps?: RunRootCommandDependencies): Promise<void>;
|
|
134
165
|
export declare function main(args: string[]): Promise<void>;
|
|
135
166
|
export {};
|
|
@@ -6,6 +6,7 @@ interface BtwPanelComponentOptions {
|
|
|
6
6
|
export declare class BtwPanelComponent extends Container {
|
|
7
7
|
#private;
|
|
8
8
|
constructor(options: BtwPanelComponentOptions);
|
|
9
|
+
beginTurn(question: string): void;
|
|
9
10
|
appendText(delta: string): void;
|
|
10
11
|
setAnswer(text: string): void;
|
|
11
12
|
markComplete(): void;
|
|
@@ -14,12 +14,13 @@ type Scope = "user" | "project";
|
|
|
14
14
|
*/
|
|
15
15
|
export interface MCPAddWizardOAuthResult {
|
|
16
16
|
credentialId: string;
|
|
17
|
+
tokenEndpoint: string;
|
|
17
18
|
clientId?: string;
|
|
18
19
|
clientSecret?: string;
|
|
19
20
|
}
|
|
20
21
|
export declare class MCPAddWizard extends Container {
|
|
21
22
|
#private;
|
|
22
|
-
constructor(onComplete: (name: string, config: MCPServerConfig, scope: Scope) => void, onCancel: () => void, onOAuth?: (authUrl: string, tokenUrl: string, clientId: string, clientSecret: string, scopes: string) => Promise<MCPAddWizardOAuthResult>, onTestConnection?: (config: MCPServerConfig) => Promise<void>, onRender?: () => void, initialName?: string);
|
|
23
|
+
constructor(onComplete: (name: string, config: MCPServerConfig, scope: Scope) => void, onCancel: () => void, onOAuth?: (endpointUrl: string, authUrl: string, tokenUrl: string, clientId: string, clientSecret: string, scopes: string) => Promise<MCPAddWizardOAuthResult>, onTestConnection?: (config: MCPServerConfig) => Promise<void>, onRender?: () => void, initialName?: string);
|
|
23
24
|
dispose(): void;
|
|
24
25
|
handleInput(keyData: string): void;
|
|
25
26
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Component } from "@gajae-code/tui";
|
|
2
|
-
import type
|
|
2
|
+
import { type AppKeybinding, type KeybindingsManager, type KeyDisplayContext } from "../../config/keybindings";
|
|
3
3
|
import type { StatusLinePreset, StatusLineSegmentId, StatusLineSeparatorStyle } from "../../config/settings-schema";
|
|
4
4
|
import type { AgentSession } from "../../session/agent-session";
|
|
5
5
|
import { type SkillActiveEntry } from "../../skill-state/active-state";
|
|
@@ -38,6 +38,7 @@ export interface StatusLineSettings {
|
|
|
38
38
|
previewHighlightSegment?: StatusLineSegmentId;
|
|
39
39
|
showHookStatus?: boolean;
|
|
40
40
|
showSkillHud?: boolean;
|
|
41
|
+
showActionHints?: boolean;
|
|
41
42
|
sessionAccent?: boolean;
|
|
42
43
|
maxRows?: number;
|
|
43
44
|
}
|
|
@@ -46,6 +47,7 @@ export interface StatusLineComponentOptions {
|
|
|
46
47
|
actionRegistry?: ActionRegistry<void>;
|
|
47
48
|
getKeybindings?: () => KeybindingsManager;
|
|
48
49
|
focusDomain?: FocusDomain;
|
|
50
|
+
keyDisplayContext?: KeyDisplayContext;
|
|
49
51
|
}
|
|
50
52
|
export interface StatusLineActionHint {
|
|
51
53
|
id: AppKeybinding;
|
|
@@ -56,7 +58,7 @@ export interface StatusLineActionHint {
|
|
|
56
58
|
* remains the authority for availability; KEYBINDINGS remains the authority for
|
|
57
59
|
* whether an action has a binding and the active manager supplies overrides.
|
|
58
60
|
*/
|
|
59
|
-
export declare function getAvailableActionHints(actionRegistry: ActionRegistry<void> | undefined, getKeybindings: (() => KeybindingsManager) | undefined, width: number, domain?: FocusDomain): StatusLineActionHint[];
|
|
61
|
+
export declare function getAvailableActionHints(actionRegistry: ActionRegistry<void> | undefined, getKeybindings: (() => KeybindingsManager) | undefined, width: number, domain?: FocusDomain, keyDisplayContext?: KeyDisplayContext): StatusLineActionHint[];
|
|
60
62
|
export declare class StatusLineComponent implements Component {
|
|
61
63
|
#private;
|
|
62
64
|
private readonly session;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Component } from "@gajae-code/tui";
|
|
2
|
+
import { type KeyDisplayContext } from "../../config/keybindings";
|
|
2
3
|
export interface RecentSession {
|
|
3
4
|
name: string;
|
|
4
5
|
timeAgo: string;
|
|
@@ -15,6 +16,7 @@ export interface WelcomeComponentOptions {
|
|
|
15
16
|
changelogMarkdown?: string;
|
|
16
17
|
collapseChangelog?: boolean;
|
|
17
18
|
buildLabel?: string;
|
|
19
|
+
keyDisplayContext?: KeyDisplayContext;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* GJC-native launch surface with compact command affordances, project
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import type { InteractiveModeContext } from "../types";
|
|
2
|
+
type BtwFollowUpResult = "accepted" | "busy" | "closed" | "rejected";
|
|
2
3
|
export declare class BtwController {
|
|
3
4
|
#private;
|
|
4
5
|
private readonly ctx;
|
|
5
6
|
constructor(ctx: InteractiveModeContext);
|
|
6
7
|
hasActiveRequest(): boolean;
|
|
8
|
+
hasOpenPanel(): boolean;
|
|
9
|
+
isTurnInFlight(): boolean;
|
|
7
10
|
handleEscape(): boolean;
|
|
8
11
|
dispose(): void;
|
|
9
12
|
start(question: string): Promise<void>;
|
|
13
|
+
submitFollowUp(question: string): Promise<BtwFollowUpResult>;
|
|
10
14
|
}
|
|
15
|
+
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type CompactionOutcome } from "@gajae-code/agent-core/compaction";
|
|
2
2
|
import { type ProviderDetails, type UsageReport } from "@gajae-code/ai";
|
|
3
|
+
import type { KeybindingsManager } from "../../config/keybindings";
|
|
3
4
|
import type { CompactOptions } from "../../extensibility/extensions/types";
|
|
4
5
|
import { theme } from "../../modes/theme/theme";
|
|
5
6
|
import type { InteractiveModeContext } from "../../modes/types";
|
|
7
|
+
export declare function buildHelpMarkdown(keybindings: Pick<KeybindingsManager, "getAccessibleDisplayString">): string;
|
|
6
8
|
export declare class CommandController {
|
|
7
9
|
#private;
|
|
8
10
|
private readonly ctx;
|
|
@@ -5,7 +5,7 @@ import type { InteractiveModeContext, OAuthSelectorOptions } from "../../modes/t
|
|
|
5
5
|
import { getNotificationConfig, maskToken } from "../../sdk/bus/config";
|
|
6
6
|
import { proposedTelegramIdentity, reconcileCommittedTelegramConfiguration, removeTelegramConfiguration, saveTelegramInactive } from "../../sdk/bus/notification-orchestration";
|
|
7
7
|
import { buildNotificationStatusReport, checkNotificationHealth, recoverNotifications, sanitizeDiagnostic, sendNotificationTest } from "../../sdk/bus/notification-service";
|
|
8
|
-
import { ensureTelegramDaemonRunningDetailed, unregisterNotificationRoot } from "../../sdk/bus/telegram-daemon";
|
|
8
|
+
import { ensureTelegramDaemonRunningDetailed, resolveTelegramSetupPreflight, unregisterNotificationRoot } from "../../sdk/bus/telegram-daemon";
|
|
9
9
|
import { runTelegramSetup } from "../../sdk/bus/telegram-setup";
|
|
10
10
|
import { type CredentialAutoImportStateStore } from "../../setup/credential-auto-import";
|
|
11
11
|
import { type CommandPaletteAction } from "../components/command-palette";
|
|
@@ -38,6 +38,7 @@ export interface NotificationsEditorOperationDependencies {
|
|
|
38
38
|
sanitizeDiagnostic: typeof sanitizeDiagnostic;
|
|
39
39
|
ensureTelegramDaemonRunningDetailed: typeof ensureTelegramDaemonRunningDetailed;
|
|
40
40
|
runTelegramSetup: typeof runTelegramSetup;
|
|
41
|
+
resolveTelegramSetupPreflight: typeof resolveTelegramSetupPreflight;
|
|
41
42
|
proposedTelegramIdentity: typeof proposedTelegramIdentity;
|
|
42
43
|
reconcileCommittedTelegramConfiguration: typeof reconcileCommittedTelegramConfiguration;
|
|
43
44
|
saveTelegramInactive: typeof saveTelegramInactive;
|
|
@@ -3,7 +3,7 @@ import type { CompactionOutcome } from "@gajae-code/agent-core/compaction";
|
|
|
3
3
|
import type { AssistantMessage, ImageContent, Message, UsageReport } from "@gajae-code/ai";
|
|
4
4
|
import type { Component, EditorTheme, SlashCommand } from "@gajae-code/tui";
|
|
5
5
|
import { Container, Loader, Spacer, Text, TUI } from "@gajae-code/tui";
|
|
6
|
-
import { KeybindingsManager } from "../config/keybindings";
|
|
6
|
+
import { KeybindingsManager, type KeyDisplayContext } from "../config/keybindings";
|
|
7
7
|
import { type Settings } from "../config/settings";
|
|
8
8
|
import type { ExtensionUIContext, ExtensionUIDialogOptions, ExtensionWidgetContent, ExtensionWidgetOptions } from "../extensibility/extensions";
|
|
9
9
|
import type { CompactOptions } from "../extensibility/extensions/types";
|
|
@@ -30,9 +30,11 @@ import { GoalModeController } from "./controllers/goal-mode-controller";
|
|
|
30
30
|
import { PlanModeController } from "./controllers/plan-mode-controller";
|
|
31
31
|
import { IrcObservationLedger } from "./irc-observation-ledger";
|
|
32
32
|
import { OAuthManualInputManager } from "./oauth-manual-input";
|
|
33
|
+
import { PromptSuggestionController } from "./prompt-suggestion-controller";
|
|
33
34
|
import type { Theme } from "./theme/theme";
|
|
34
35
|
import { type CompactionQueuedMessage, type ComposerSubmissionOptions, type InteractiveModeContext, type IrcArrivalSnapshot, type SubmittedUserInput, type TodoItem, type TodoPhase, type TranscriptRebuildPolicy } from "./types";
|
|
35
36
|
import type { ParsedIrcMessage } from "./utils/irc-message";
|
|
37
|
+
export declare function getDefaultComposerPlaceholder(context?: KeyDisplayContext): string;
|
|
36
38
|
export declare const DEFAULT_COMPOSER_PLACEHOLDER: string;
|
|
37
39
|
export declare function getWelcomeTranscriptReservedRows(chatContainer: Container, width: number): number;
|
|
38
40
|
export type WelcomeBannerSettingMode = "auto" | "unicode" | "square" | "ascii";
|
|
@@ -50,6 +52,7 @@ export interface InteractiveModeOptions {
|
|
|
50
52
|
/** Additional initial messages to queue */
|
|
51
53
|
initialMessages?: string[];
|
|
52
54
|
}
|
|
55
|
+
export declare function selectShutdownDraft(editorText: string, hasActiveBtw: boolean): string;
|
|
53
56
|
export declare class InteractiveMode implements InteractiveModeContext {
|
|
54
57
|
#private;
|
|
55
58
|
session: AgentSession;
|
|
@@ -114,12 +117,13 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
114
117
|
fileSlashCommands: Set<string>;
|
|
115
118
|
skillCommands: Map<string, Skill>;
|
|
116
119
|
oauthManualInput: OAuthManualInputManager;
|
|
120
|
+
promptSuggestion: PromptSuggestionController;
|
|
117
121
|
readonly lspServers: LspStartupServerInfo[] | undefined;
|
|
118
122
|
mcpManager?: import("../runtime-mcp").MCPManager;
|
|
119
123
|
/** Direct controller capabilities for consumers that coordinate mode transitions. */
|
|
120
124
|
get planModeController(): PlanModeController;
|
|
121
125
|
get goalModeController(): GoalModeController;
|
|
122
|
-
constructor(session: AgentSession, version: string, changelogMarkdown?: string | undefined, setToolUIContext?: (uiContext: ExtensionUIContext, hasUI: boolean) => void, lspServers?: LspStartupServerInfo[] | undefined, mcpManager?: import("../runtime-mcp").MCPManager, eventBus?: EventBus);
|
|
126
|
+
constructor(session: AgentSession, version: string, changelogMarkdown?: string | undefined, setToolUIContext?: (uiContext: ExtensionUIContext, hasUI: boolean) => void, lspServers?: LspStartupServerInfo[] | undefined, mcpManager?: import("../runtime-mcp").MCPManager, eventBus?: EventBus, keyDisplayContext?: KeyDisplayContext);
|
|
123
127
|
getCurrentSessionNotificationStatus(): NotificationSessionStatus | undefined;
|
|
124
128
|
setCurrentSessionNotificationsEnabled(enabled: boolean): Promise<NotificationSessionReconcileResult | undefined>;
|
|
125
129
|
init(): Promise<void>;
|
|
@@ -261,6 +265,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
261
265
|
handleImagePaste(): Promise<boolean>;
|
|
262
266
|
handleBtwCommand(question: string): Promise<void>;
|
|
263
267
|
hasActiveBtw(): boolean;
|
|
268
|
+
handleBtwFollowUp(question: string): Promise<"accepted" | "busy" | "closed" | "rejected">;
|
|
264
269
|
handleBtwEscape(): boolean;
|
|
265
270
|
cycleThinkingLevel(): void;
|
|
266
271
|
cycleRoleModel(options?: {
|
|
@@ -22,10 +22,15 @@ interface PromptActionAutocompleteOptions {
|
|
|
22
22
|
moveCursorToMessageStart: () => void;
|
|
23
23
|
moveCursorToLineStart: () => void;
|
|
24
24
|
moveCursorToLineEnd: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Ghost-text next-prompt prediction shown in the empty composer as a dim
|
|
27
|
+
* inline hint (Tab accepts it via the editor's onTab handler).
|
|
28
|
+
*/
|
|
29
|
+
getPromptSuggestion?: () => string | null;
|
|
25
30
|
}
|
|
26
31
|
export declare class PromptActionAutocompleteProvider implements AutocompleteProvider {
|
|
27
32
|
#private;
|
|
28
|
-
constructor(commands: SlashCommand[], basePath: string, actions: PromptActionDefinition[]);
|
|
33
|
+
constructor(commands: SlashCommand[], basePath: string, actions: PromptActionDefinition[], getPromptSuggestion?: () => string | null);
|
|
29
34
|
getSuggestions(lines: string[], cursorLine: number, cursorCol: number): Promise<{
|
|
30
35
|
items: AutocompleteItem[];
|
|
31
36
|
prefix: string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { InteractiveModeContext } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Owns the ghost-text next-prompt prediction lifecycle for interactive mode.
|
|
4
|
+
*
|
|
5
|
+
* After each agent turn ends (and only when `promptSuggestions` is enabled
|
|
6
|
+
* and the composer is empty), a smol-model prediction of the user's next
|
|
7
|
+
* prompt is generated in the background. The result renders as dim ghost
|
|
8
|
+
* text in the empty composer via the autocomplete provider's inline hint;
|
|
9
|
+
* Tab accepts it, typing dismisses it, and a new turn clears it.
|
|
10
|
+
*/
|
|
11
|
+
export declare class PromptSuggestionController {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(ctx: InteractiveModeContext);
|
|
14
|
+
/** Current suggestion to render as ghost text, or null. */
|
|
15
|
+
get current(): string | null;
|
|
16
|
+
/** Drop the current suggestion and invalidate any in-flight generation. */
|
|
17
|
+
clear(): void;
|
|
18
|
+
/** A new agent turn started; any pending suggestion is stale. */
|
|
19
|
+
onAgentStart(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Editor content changed. A non-empty composer means the user is writing
|
|
22
|
+
* their own prompt: dismiss the suggestion and cancel pending generation.
|
|
23
|
+
*/
|
|
24
|
+
notifyEditorChanged(text: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Agent turn ended; kick off background generation when the feature is
|
|
27
|
+
* enabled and the composer is idle and empty.
|
|
28
|
+
*/
|
|
29
|
+
onAgentEnd(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Tab handler for the composer: accept the suggestion when the composer
|
|
32
|
+
* is empty. Returns true when Tab was consumed.
|
|
33
|
+
*/
|
|
34
|
+
tryAcceptOnTab(text: string): boolean;
|
|
35
|
+
}
|
|
@@ -59,7 +59,7 @@ export interface AskSelectedAckRecoveryParticipant {
|
|
|
59
59
|
}
|
|
60
60
|
/** SDK-native surface for emitting a workflow gate and awaiting its answer. */
|
|
61
61
|
export interface WorkflowGateEmitter {
|
|
62
|
-
|
|
62
|
+
supportsRemoteGateAnswers(): boolean;
|
|
63
63
|
emitGate(input: OpenGateInput): Promise<unknown>;
|
|
64
64
|
onGateEmitted?(listener: (gate: WorkflowGate) => void): () => void;
|
|
65
65
|
resolveGate?(response: WorkflowGateResponse): Promise<WorkflowGateResolution>;
|
|
@@ -96,7 +96,7 @@ export interface WorkflowGateEmitter {
|
|
|
96
96
|
export declare class BrokerWorkflowGateEmitter implements WorkflowGateEmitter {
|
|
97
97
|
#private;
|
|
98
98
|
constructor(runId: string, store: GateStore, emitterHooks?: Pick<BrokerHooks, "advance">);
|
|
99
|
-
|
|
99
|
+
supportsRemoteGateAnswers(): boolean;
|
|
100
100
|
setRuntimeTurnProvider(provider: (() => string | undefined) | null): void;
|
|
101
101
|
emitGate(input: OpenGateInput): Promise<unknown>;
|
|
102
102
|
onGateEmitted(listener: (gate: WorkflowGate) => void): () => void;
|
|
@@ -27,6 +27,7 @@ import type { ToolExecutionHandle } from "./components/tool-execution";
|
|
|
27
27
|
import type { StatusLineComponent } from "./components/tool-status-header";
|
|
28
28
|
import type { IrcObservationLedger } from "./irc-observation-ledger";
|
|
29
29
|
import type { OAuthManualInputManager } from "./oauth-manual-input";
|
|
30
|
+
import type { PromptSuggestionController } from "./prompt-suggestion-controller";
|
|
30
31
|
import type { Theme } from "./theme/theme";
|
|
31
32
|
import type { ParsedIrcMessage } from "./utils/irc-message";
|
|
32
33
|
export type TranscriptRebuildPolicy = "replace-identity" | "reconcile-same-transcript";
|
|
@@ -133,6 +134,8 @@ export interface InteractiveModeContext {
|
|
|
133
134
|
skillCommands: Map<string, Skill>;
|
|
134
135
|
oauthManualInput: OAuthManualInputManager;
|
|
135
136
|
todoPhases: TodoPhase[];
|
|
137
|
+
/** Ghost-text next-prompt prediction; absent in ACP/lightweight test contexts. */
|
|
138
|
+
promptSuggestion?: PromptSuggestionController;
|
|
136
139
|
init(): Promise<void>;
|
|
137
140
|
shutdown(): Promise<void>;
|
|
138
141
|
checkShutdownRequested(): Promise<void>;
|
|
@@ -295,6 +298,7 @@ export interface InteractiveModeContext {
|
|
|
295
298
|
handleBackgroundCommand(): void;
|
|
296
299
|
handleImagePaste(): Promise<boolean>;
|
|
297
300
|
handleBtwCommand(question: string): Promise<void>;
|
|
301
|
+
handleBtwFollowUp(question: string): Promise<"accepted" | "busy" | "closed" | "rejected">;
|
|
298
302
|
hasActiveBtw(): boolean;
|
|
299
303
|
handleBtwEscape(): boolean;
|
|
300
304
|
cycleThinkingLevel(): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { KeybindingsManager } from "../../config/keybindings";
|
|
2
2
|
export interface HotkeysMarkdownBindings {
|
|
3
|
-
keybindings: Pick<KeybindingsManager, "
|
|
3
|
+
keybindings: Pick<KeybindingsManager, "formatAccessibleKeyHint" | "getAccessibleDisplayString">;
|
|
4
4
|
}
|
|
5
|
+
export declare function formatHotkeyMarkdownCode(label: string, escapeTablePipes?: boolean): string;
|
|
5
6
|
export declare function buildHotkeysMarkdown(bindings: HotkeysMarkdownBindings): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const MCP_MAX_CONTENT_BYTES: number;
|
|
2
|
+
export declare const MCP_MAX_ERROR_BYTES: number;
|
|
3
|
+
export declare const MCP_MAX_SSE_REQUEST_MESSAGES = 1024;
|
|
4
|
+
export declare const MCP_MAX_SSE_BATCH_MESSAGES = 1024;
|
|
5
|
+
export declare const MCP_HTTP_TIMEOUT_MS = 30000;
|
|
6
|
+
export declare function cancelMCPStream(stream: ReadableStream<Uint8Array> | null): void;
|
|
7
|
+
export declare function readMCPResponseText(response: Response, limit: number, truncate?: boolean, signal?: AbortSignal): Promise<string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type TSchema } from "@gajae-code/ai";
|
|
2
2
|
import type { SourceMeta } from "../capability/types";
|
|
3
3
|
import type { CustomTool } from "../extensibility/custom-tools/types";
|
|
4
4
|
import type { AuthStorage } from "../session/auth-storage";
|
|
@@ -52,8 +52,3 @@ export declare class MCPOAuthFlow extends OAuthCallbackFlow {
|
|
|
52
52
|
}>;
|
|
53
53
|
exchangeToken(code: string, _state: string, redirectUri: string): Promise<OAuthCredentials>;
|
|
54
54
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Refresh an MCP OAuth token using the standard refresh_token grant.
|
|
57
|
-
* Returns updated credentials; preserves the old refresh token if the server doesn't rotate it.
|
|
58
|
-
*/
|
|
59
|
-
export declare function refreshMCPOAuthToken(tokenUrl: string, refreshToken: string, clientId?: string, clientSecret?: string): Promise<OAuthCredentials>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type AddressResolver } from "../web/insane/url-guard";
|
|
2
|
+
import type { MCPHttpServerConfig, MCPSseServerConfig } from "./types";
|
|
3
|
+
/** Mark an in-memory plugin-bundle remote MCP config for connection-bound public-network enforcement. */
|
|
4
|
+
export declare function bindPluginMcpToPublicNetwork<T extends MCPHttpServerConfig | MCPSseServerConfig>(config: T): T;
|
|
5
|
+
/** The marker is an internal symbol, so persisted user MCP configs cannot opt into or forge this path. */
|
|
6
|
+
export declare function isPluginMcpPublicNetworkBound(config: MCPHttpServerConfig | MCPSseServerConfig): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Fetch a plugin-bundle MCP request through a DNS-pinned public address. Every
|
|
9
|
+
* redirect is handled manually and revalidated before the next connection.
|
|
10
|
+
*/
|
|
11
|
+
export declare function fetchPluginMcpRequest(rawUrl: string, init: BunFetchRequestInit, options?: {
|
|
12
|
+
resolver?: AddressResolver;
|
|
13
|
+
maxRedirects?: number;
|
|
14
|
+
}): Promise<Response>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { NativeDirectoryTreeSnapshot } from "@gajae-code/natives";
|
|
2
|
+
import type { ModelProfileErrorDetails } from "../../config/model-profile-contract";
|
|
2
3
|
import { type DirectoryMigrationPolicy } from "../session-directory";
|
|
3
4
|
import { type BrokerDiscovery, type RedactedBrokerDiscovery } from "./discovery";
|
|
4
5
|
import { type LifecycleDurableEffectsReceipt, LifecycleLedger, type LifecycleStartupFailureReceipt } from "./lifecycle-ledger";
|
|
@@ -93,6 +94,7 @@ export type BrokerResponse = {
|
|
|
93
94
|
error: {
|
|
94
95
|
code: BrokerErrorCode;
|
|
95
96
|
message: string;
|
|
97
|
+
details?: ModelProfileErrorDetails;
|
|
96
98
|
endpoint?: "unavailable";
|
|
97
99
|
cleanup?: BrokerCleanupEvidence;
|
|
98
100
|
};
|