@gajae-code/coding-agent 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/README.md +1 -1
- package/dist/types/async/job-manager.d.ts +26 -0
- package/dist/types/cli/args.d.ts +1 -0
- package/dist/types/cli/list-models.d.ts +6 -0
- package/dist/types/cli/setup-cli.d.ts +8 -1
- package/dist/types/commands/gc.d.ts +26 -0
- package/dist/types/commands/setup.d.ts +7 -0
- package/dist/types/config/file-lock-gc.d.ts +5 -0
- package/dist/types/config/file-lock.d.ts +29 -0
- package/dist/types/config/model-registry.d.ts +4 -0
- package/dist/types/config/models-config-schema.d.ts +5 -0
- package/dist/types/config/settings-schema.d.ts +62 -0
- package/dist/types/coordinator/contract.d.ts +1 -1
- package/dist/types/defaults/gjc/extensions/grok-build/index.d.ts +1 -0
- package/dist/types/defaults/gjc/extensions/grok-cli-vendor/src/index.d.ts +1 -0
- package/dist/types/defaults/gjc/extensions/grok-cli-vendor/src/models/catalog.d.ts +25 -0
- package/dist/types/defaults/gjc/extensions/grok-cli-vendor/src/payload/sanitize.d.ts +27 -0
- package/dist/types/defaults/gjc/extensions/grok-cli-vendor/src/provider/billing.d.ts +8 -0
- package/dist/types/defaults/gjc/extensions/grok-cli-vendor/src/provider/register.d.ts +5 -0
- package/dist/types/defaults/gjc/extensions/grok-cli-vendor/src/provider/stream.d.ts +10 -0
- package/dist/types/defaults/gjc/extensions/grok-cli-vendor/src/provider/usage.d.ts +2 -0
- package/dist/types/defaults/gjc/extensions/grok-cli-vendor/src/shared/base-url.d.ts +2 -0
- package/dist/types/defaults/gjc/extensions/grok-cli-vendor/src/shared/errors.d.ts +38 -0
- package/dist/types/defaults/gjc-grok-cli.d.ts +5 -0
- package/dist/types/extensibility/extensions/index.d.ts +1 -0
- package/dist/types/extensibility/extensions/prefix-command-bridge.d.ts +35 -0
- package/dist/types/gjc-runtime/deep-interview-recorder.d.ts +103 -0
- package/dist/types/gjc-runtime/deep-interview-runtime.d.ts +2 -0
- package/dist/types/gjc-runtime/deep-interview-state.d.ts +112 -0
- package/dist/types/gjc-runtime/gc-render.d.ts +6 -0
- package/dist/types/gjc-runtime/gc-runtime.d.ts +134 -0
- package/dist/types/gjc-runtime/ledger-event-renderer.d.ts +68 -0
- package/dist/types/gjc-runtime/state-writer.d.ts +64 -2
- package/dist/types/gjc-runtime/team-gc.d.ts +7 -0
- package/dist/types/gjc-runtime/team-runtime.d.ts +5 -0
- package/dist/types/gjc-runtime/tmux-common.d.ts +11 -0
- package/dist/types/gjc-runtime/tmux-gc.d.ts +7 -0
- package/dist/types/gjc-runtime/tmux-sessions.d.ts +13 -0
- package/dist/types/gjc-runtime/ultragoal-guard.d.ts +10 -0
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +29 -0
- package/dist/types/harness-control-plane/gc-adapter.d.ts +3 -0
- package/dist/types/harness-control-plane/owner.d.ts +7 -0
- package/dist/types/harness-control-plane/storage.d.ts +20 -0
- package/dist/types/modes/components/hook-selector.d.ts +7 -1
- package/dist/types/modes/components/provider-onboarding-selector.d.ts +1 -1
- package/dist/types/modes/controllers/command-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +1 -1
- package/dist/types/modes/rpc/rpc-mode.d.ts +72 -2
- package/dist/types/modes/shared/agent-wire/deep-interview-gate.d.ts +13 -0
- package/dist/types/modes/shared/agent-wire/session-registry.d.ts +25 -0
- package/dist/types/modes/shared/agent-wire/unattended-action-policy.d.ts +2 -0
- package/dist/types/modes/shared/agent-wire/unattended-session.d.ts +10 -0
- package/dist/types/modes/theme/defaults/index.d.ts +302 -0
- package/dist/types/modes/theme/theme.d.ts +1 -0
- package/dist/types/modes/types.d.ts +1 -1
- package/dist/types/session/agent-session.d.ts +1 -1
- package/dist/types/session/blob-store.d.ts +39 -3
- package/dist/types/session/history-storage.d.ts +2 -2
- package/dist/types/session/session-manager.d.ts +10 -1
- package/dist/types/setup/credential-import.d.ts +79 -0
- package/dist/types/skill-state/workflow-hud.d.ts +14 -0
- package/dist/types/task/executor.d.ts +1 -0
- package/dist/types/task/render.d.ts +1 -1
- package/dist/types/tools/ask.d.ts +15 -1
- package/dist/types/tools/subagent-render.d.ts +7 -1
- package/dist/types/tools/subagent.d.ts +27 -0
- package/dist/types/tools/ultragoal-ask-guard.d.ts +5 -0
- package/dist/types/web/search/index.d.ts +4 -4
- package/dist/types/web/search/provider.d.ts +16 -20
- package/dist/types/web/search/providers/base.d.ts +2 -1
- package/dist/types/web/search/providers/openai-compatible.d.ts +9 -0
- package/dist/types/web/search/types.d.ts +14 -2
- package/package.json +7 -7
- package/scripts/build-binary.ts +7 -0
- package/src/async/job-manager.ts +52 -0
- package/src/cli/args.ts +5 -0
- package/src/cli/auth-broker-cli.ts +1 -0
- package/src/cli/fast-help.ts +2 -0
- package/src/cli/list-models.ts +13 -1
- package/src/cli/setup-cli.ts +138 -3
- package/src/cli.ts +1 -0
- package/src/commands/gc.ts +22 -0
- package/src/commands/harness.ts +7 -3
- package/src/commands/setup.ts +5 -1
- package/src/commands/ultragoal.ts +3 -1
- package/src/config/file-lock-gc.ts +193 -0
- package/src/config/file-lock.ts +66 -10
- package/src/config/model-profile-activation.ts +15 -3
- package/src/config/model-profiles.ts +39 -30
- package/src/config/model-registry.ts +21 -1
- package/src/config/models-config-schema.ts +1 -0
- package/src/config/settings-schema.ts +62 -0
- package/src/coordinator/contract.ts +1 -0
- package/src/coordinator-mcp/server.ts +459 -3
- package/src/defaults/gjc/agent.models.grok-cli.yml +36 -0
- package/src/defaults/gjc/extensions/grok-build/index.ts +1 -0
- package/src/defaults/gjc/extensions/grok-build/package.json +7 -0
- package/src/defaults/gjc/extensions/grok-cli-vendor/biome.json +39 -0
- package/src/defaults/gjc/extensions/grok-cli-vendor/package.json +8 -0
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/index.ts +1 -0
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/models/catalog.ts +155 -0
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/payload/sanitize.ts +361 -0
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/provider/billing.ts +57 -0
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/provider/register.ts +99 -0
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/provider/stream.ts +50 -0
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/provider/usage.ts +56 -0
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/shared/base-url.ts +36 -0
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/shared/errors.ts +44 -0
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +131 -113
- package/src/defaults/gjc/skills/deep-interview/lateral-review-panel.md +49 -0
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +30 -8
- package/src/defaults/gjc-defaults.ts +7 -0
- package/src/defaults/gjc-grok-cli.ts +22 -0
- package/src/extensibility/extensions/index.ts +1 -0
- package/src/extensibility/extensions/prefix-command-bridge.ts +128 -0
- package/src/gjc-runtime/deep-interview-recorder.ts +457 -0
- package/src/gjc-runtime/deep-interview-runtime.ts +18 -26
- package/src/gjc-runtime/deep-interview-state.ts +324 -0
- package/src/gjc-runtime/gc-render.ts +70 -0
- package/src/gjc-runtime/gc-runtime.ts +403 -0
- package/src/gjc-runtime/launch-tmux.ts +3 -4
- package/src/gjc-runtime/ledger-event-renderer.ts +164 -0
- package/src/gjc-runtime/ralplan-runtime.ts +232 -19
- package/src/gjc-runtime/state-renderer.ts +12 -3
- package/src/gjc-runtime/state-runtime.ts +48 -30
- package/src/gjc-runtime/state-writer.ts +254 -7
- package/src/gjc-runtime/team-gc.ts +49 -0
- package/src/gjc-runtime/team-runtime.ts +179 -2
- package/src/gjc-runtime/tmux-common.ts +14 -0
- package/src/gjc-runtime/tmux-gc.ts +177 -0
- package/src/gjc-runtime/tmux-sessions.ts +49 -1
- package/src/gjc-runtime/ultragoal-guard.ts +155 -0
- package/src/gjc-runtime/ultragoal-runtime.ts +1239 -31
- package/src/gjc-runtime/workflow-manifest.generated.json +44 -0
- package/src/gjc-runtime/workflow-manifest.ts +12 -0
- package/src/harness-control-plane/gc-adapter.ts +184 -0
- package/src/harness-control-plane/owner.ts +14 -2
- package/src/harness-control-plane/rpc-adapter.ts +1 -1
- package/src/harness-control-plane/storage.ts +70 -0
- package/src/hooks/skill-state.ts +121 -2
- package/src/internal-urls/docs-index.generated.ts +22 -12
- package/src/lsp/defaults.json +1 -0
- package/src/main.ts +18 -3
- package/src/modes/acp/acp-agent.ts +4 -2
- package/src/modes/bridge/bridge-mode.ts +2 -1
- package/src/modes/components/history-search.ts +5 -2
- package/src/modes/components/hook-selector.ts +19 -0
- package/src/modes/components/model-selector.ts +51 -8
- package/src/modes/components/provider-onboarding-selector.ts +6 -1
- package/src/modes/components/status-line/segments.ts +1 -1
- package/src/modes/controllers/command-controller.ts +25 -6
- package/src/modes/controllers/extension-ui-controller.ts +3 -0
- package/src/modes/controllers/selector-controller.ts +81 -1
- package/src/modes/interactive-mode.ts +11 -1
- package/src/modes/rpc/rpc-mode.ts +266 -34
- package/src/modes/shared/agent-wire/command-dispatch.ts +281 -261
- package/src/modes/shared/agent-wire/deep-interview-gate.ts +30 -1
- package/src/modes/shared/agent-wire/host-tool-bridge.ts +3 -0
- package/src/modes/shared/agent-wire/session-registry.ts +109 -0
- package/src/modes/shared/agent-wire/unattended-action-policy.ts +24 -0
- package/src/modes/shared/agent-wire/unattended-run-controller.ts +23 -3
- package/src/modes/shared/agent-wire/unattended-session.ts +32 -2
- package/src/modes/theme/defaults/claude-code.json +100 -0
- package/src/modes/theme/defaults/codex.json +100 -0
- package/src/modes/theme/defaults/index.ts +6 -0
- package/src/modes/theme/defaults/opencode.json +102 -0
- package/src/modes/theme/theme.ts +2 -2
- package/src/modes/types.ts +1 -1
- package/src/prompts/agents/executor.md +5 -2
- package/src/sdk.ts +29 -4
- package/src/session/agent-session.ts +99 -19
- package/src/session/blob-store.ts +59 -3
- package/src/session/history-storage.ts +32 -11
- package/src/session/session-manager.ts +72 -20
- package/src/setup/credential-import.ts +429 -0
- package/src/setup/hermes/templates/operator-instructions.v1.md +7 -1
- package/src/skill-state/deep-interview-mutation-guard.ts +2 -1
- package/src/skill-state/workflow-hud.ts +106 -10
- package/src/slash-commands/builtin-registry.ts +3 -2
- package/src/task/executor.ts +16 -1
- package/src/task/render.ts +18 -7
- package/src/tools/ask.ts +59 -2
- package/src/tools/cron.ts +1 -1
- package/src/tools/job.ts +3 -2
- package/src/tools/monitor.ts +36 -1
- package/src/tools/subagent-render.ts +128 -29
- package/src/tools/subagent.ts +173 -9
- package/src/tools/ultragoal-ask-guard.ts +39 -0
- package/src/web/search/index.ts +25 -25
- package/src/web/search/provider.ts +178 -87
- package/src/web/search/providers/base.ts +2 -1
- package/src/web/search/providers/openai-compatible.ts +151 -0
- package/src/web/search/types.ts +47 -22
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.5.2] - 2026-06-15
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Prevented `gjc --tmux` partial-launch diagnostics from throwing when stderr is already closed during shutdown.
|
|
10
|
+
- Fixed v0.5.1-style macOS/Linux standalone binaries crashing before the first model request with `Cannot find module '@gajae-code/natives' from '/$bunfs/root/gjc-*'` when pre-prompt context maintenance invokes the native tokenizer.
|
|
11
|
+
- Mapped the retired `codex-standard` model profile name to `codex-medium` during profile activation, **as a fallback only** so a user-defined profile literally named `codex-standard` is never shadowed, letting stale `modelProfile.default: codex-standard` configs reach activation instead of blocking startup after the rebuilt profile catalog.
|
|
12
|
+
- Fixed interactive goal-mode auto-continuation looping `Error: Agent is already processing…` (`AgentBusyError`) while the session is busy. A wedged/orphaned subagent turn — or an in-progress compaction — can leave the session non-idle while the interactive loop is back at `getUserInput()`; the 800 ms continuation timer then fired `prompt()`, threw `AgentBusyError`, surfaced it via `showError`, and re-armed — spamming the error roughly every 800 ms. The continuation now skips and re-arms while `isStreaming`/`isCompacting`, firing only once the session returns to idle.
|
|
13
|
+
- Fixed the built-in `minimax-eco`/`minimax-medium`/`minimax-pro` model profiles 400ing on activation because every role pinned the non-existent `minimax-code/minimax-v3`. All three profiles now pin `minimax-code/minimax-m3`, the canonical `minimax-code` default already present in the bundled models catalog (#656).
|
|
14
|
+
- Fixed the native Stop hook letting a deep-interview run terminalize through the ordinary stop path without crystallizing its distilled interview state. A deep-interview mode-state that would release the Stop block (e.g. `active:true` with a `complete`/`completed`/`inactive` phase) is now held until it has actually persisted a final spec — a `spec_path` that still resolves to a real `.gjc/specs/` artifact — and the public-safe diagnostic points the agent at `gjc deep-interview --write --stage final` (optionally `--handoff ralplan`). The guard is scoped to deep-interview only: explicit abort/cancel phases (`failed`/`cancelled`/`canceled`) and the `active:false` demotion/clear outcome remain legitimate terminals, and no other workflow's stop behavior changes (#674).
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Added three bundled dark TUI migration themes — `claude-code`, `codex`, and `opencode` — whose palettes mirror the Claude Code, OpenAI Codex CLI, and opencode TUIs for easy eye-migration. They join the crustacean defaults (`red-claw` dark, `blue-crab` light) as selectable built-ins via Settings or `/theme`; defaults are unchanged and the new themes keep GJC's default symbol identity. A built-in inventory test now validates every bundled theme against the required `THEME_COLOR_KEYS` token set, name/key equality, var resolution, dark classification, and brand-vs-semantic token separation.
|
|
19
|
+
- Documented and regression-guarded the `gjc --tmux` scroll/mouse profile so WSL/Linux launches are not left guessing about mouse-wheel scrolling. The GJC-managed tmux session already applies `mouse on` (plus `set-clipboard on` and a readable copy-mode `mode-style`) scoped to the GJC session only, on macOS/Linux/WSL alike (only native `win32` skips the tmux launch); a new launch-path test asserts a WSL/Linux `--tmux` launch issues session-scoped `set-option ... mouse on` (never global `set -g`) and that `GJC_MOUSE=off` opts out without dropping the ownership tags. `docs/environment-variables.md` now documents the `--tmux` startup env vars (`GJC_LAUNCH_POLICY`, `GJC_TMUX_SESSION`, `GJC_TMUX_COMMAND`, `GJC_TMUX_PROFILE`, `GJC_MOUSE`) and the WSL/Windows Terminal scroll behavior (tmux copy-mode wheel scroll vs. native scrollback, copy-mode keyboard fallback, and that GJC never modifies tmux sessions you started yourself), and `gjc --help` surfaces `GJC_TMUX_PROFILE`/`GJC_MOUSE` (#650).
|
|
20
|
+
- Added a subagent-scoped `task.serviceTier` setting (default `"inherit"`) so the service tier / fast mode applied to task-tool subagents can be controlled independently of the main session. `"inherit"` keeps the current behavior (the main session tier is copied into each subagent's isolated settings snapshot), while any explicit value (`none`, `priority`, `openai-only`, `claude-only`, …) overrides only the subagent sessions, which already read `serviceTier` from their own settings. Implemented in `createSubagentSettings` with a focused test covering inherit and explicit-override behavior (#664).
|
|
21
|
+
|
|
22
|
+
## [0.5.1] - 2026-06-14
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- `gjc --mode rpc` registers each live session in a cross-process registry (`<agent-dir>/rpc-sessions/<id>.json`) on start and removes it on shutdown, so other processes can enumerate running RPC sessions. The Python `gjc_rpc` client exposes `list_sessions()` / `RpcClient.list_sessions()` returning typed `SessionHandle`s and reaps records whose owning process is gone (issue 10; foundation for reattach/issue 09).
|
|
27
|
+
- `gjc --mode rpc --listen <socket-path>` runs a persistent Unix-domain-socket RPC server: the `AgentSession` outlives client disconnects (no stdin-EOF teardown) and a client can disconnect and reconnect to the same live session over the socket. The session is registered with `transport: "socket"` and the socket path as its `endpoint`, so it is discoverable/attachable via the registry. The stdio path is unchanged (frame output routes through a swappable sink shared by both transports) (issue 09).
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- Subagent/job status panels now freeze a job's elapsed timer the moment it stops running (`completed`/`failed`/`cancelled`/`paused`) instead of counting up against `Date.now()` forever. `AsyncJob` records an `endTime` on the first terminal/pause transition and a shared `jobElapsedMs` helper backs the `subagent` panel, the `job` tool, `/jobs`, and the command-controller job line, so a finished subagent stops at its real duration while siblings keep ticking.
|
|
32
|
+
- RPC control-plane hardening (from dogfooding `gjc --mode rpc`): `dispatchRpcCommand` now wraps the command switch so failures return a correlated response carrying the request `id` and the real command name, instead of dropping the id and mislabeling handler exceptions as `parse`; `set_thinking_level`/`set_steering_mode`/`set_follow_up_mode`/`set_interrupt_mode` validate their inputs and reject out-of-contract values instead of silently corrupting session state; `negotiate_unattended` rejects unknown scopes/action classes with `invalid_unattended_declaration` and merges the mandatory `prompt` scope plus its `command.prompt` action floor into the accepted grant (so prompt/`workflow_gate_response` are never locked out); and read-only/control RPC commands no longer consume the unattended `max_tool_calls` budget while wall-time enforcement is preserved. `docs/rpc.md`'s first `workflow_gate` example now matches the canonical `RpcWorkflowGate` shape.
|
|
33
|
+
- RPC mode no longer head-of-line-blocks control/cancellation commands behind a long-running command: the stdin loop now dispatches ordered commands through a serial chain (so causal order is preserved — e.g. `get_state` after `bash` still observes the bash result) without blocking the reader, and routes `abort`/`abort_bash`/`abort_retry` on an immediate fast lane so they reach in-flight work. `abort_bash` can now cancel a running `bash`, and a slow `compact`/`handoff`/`login` no longer freezes the whole control plane. Shutdown drains in-flight commands (bounded) so their responses are still emitted on stdin EOF.
|
|
34
|
+
- Counted active prompts and agent-initiated custom messages in pre-prompt context maintenance so background task notifications trigger compaction before they can overflow the next model request.
|
|
35
|
+
- Bounded monitor task-notification payloads to a compact tail window while preserving full background job output for job inspection.
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- Expanded coordinator MCP coordination status into a canonical polling snapshot for sessions, session states, turns, questions, reports, and bounded event summaries, and documented that Hermes/coordinator consumption is polling/await rather than push subscription.
|
|
40
|
+
|
|
5
41
|
## [0.5.0] - 2026-06-13
|
|
6
42
|
|
|
7
43
|
### Fixed
|
package/README.md
CHANGED
|
@@ -34,4 +34,4 @@ Switching backends mid-session is honoured on the next system-prompt rebuild and
|
|
|
34
34
|
|
|
35
35
|
## Red-claw TUI theme
|
|
36
36
|
|
|
37
|
-
The interactive TUI defaults to the bundled `red-claw` crustacean theme for dark terminals and the bundled `blue-crab` theme for light-appearance terminals, with matching welcome/icon assets. Explicit user theme settings still win; set `theme.dark: red-claw` and `theme.light: blue-crab` in `~/.gjc/agent/config.yml` to pin them.
|
|
37
|
+
The interactive TUI defaults to the bundled `red-claw` crustacean theme for dark terminals and the bundled `blue-crab` theme for light-appearance terminals, with matching welcome/icon assets. Three additional bundled migration themes — `claude-code`, `codex`, and `opencode` — mirror the look of those tools for easy eye-migration and are selectable from Settings or `/theme`. Explicit user theme settings still win; set `theme.dark: red-claw` and `theme.light: blue-crab` in `~/.gjc/agent/config.yml` to pin them.
|
|
@@ -4,6 +4,13 @@ export interface AsyncJob {
|
|
|
4
4
|
type: "bash" | "task";
|
|
5
5
|
status: "running" | "completed" | "failed" | "cancelled" | "paused";
|
|
6
6
|
startTime: number;
|
|
7
|
+
/**
|
|
8
|
+
* Wall-clock ms when the job left the `running` state (completed, failed,
|
|
9
|
+
* cancelled, or paused). Undefined while running. Frozen on the first
|
|
10
|
+
* terminal/pause transition so elapsed-time renderers stop counting once a
|
|
11
|
+
* job is no longer active instead of growing forever against `Date.now()`.
|
|
12
|
+
*/
|
|
13
|
+
endTime?: number;
|
|
7
14
|
label: string;
|
|
8
15
|
abortController: AbortController;
|
|
9
16
|
promise: Promise<void>;
|
|
@@ -18,6 +25,13 @@ export interface AsyncJob {
|
|
|
18
25
|
*/
|
|
19
26
|
ownerId?: string;
|
|
20
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Elapsed wall-clock ms for a job, frozen once it stops running. While the job
|
|
30
|
+
* is active (`endTime` undefined) this counts against `now`; after it stops it
|
|
31
|
+
* returns the fixed `endTime - startTime` span so status renderers do not keep
|
|
32
|
+
* incrementing a completed job's timer.
|
|
33
|
+
*/
|
|
34
|
+
export declare function jobElapsedMs(job: Pick<AsyncJob, "startTime" | "endTime">, now?: number): number;
|
|
21
35
|
export interface AsyncJobMetadata {
|
|
22
36
|
subagent?: {
|
|
23
37
|
id: string;
|
|
@@ -77,6 +91,12 @@ export interface SubagentRecord {
|
|
|
77
91
|
message?: string;
|
|
78
92
|
createdAt: number;
|
|
79
93
|
};
|
|
94
|
+
/** Resolved model the subagent was asked to use, e.g. "openai-codex/gpt-5.5". */
|
|
95
|
+
requestedModel?: string;
|
|
96
|
+
/** Model actually used after auth fallback (#985); equals requestedModel when no fallback. */
|
|
97
|
+
effectiveModel?: string;
|
|
98
|
+
/** True when the requested model lacked credentials and the subagent fell back to the parent model. */
|
|
99
|
+
modelFellBack?: boolean;
|
|
80
100
|
}
|
|
81
101
|
/** Lightweight, manager-owned resume payload. The async layer treats `data` as opaque. */
|
|
82
102
|
export interface ResumeDescriptor {
|
|
@@ -184,6 +204,12 @@ export declare class AsyncJobManager {
|
|
|
184
204
|
};
|
|
185
205
|
/** Register or replace the canonical record for a subagent. */
|
|
186
206
|
registerSubagentRecord(record: SubagentRecord): void;
|
|
207
|
+
/** Patch model metadata onto an existing subagent record (best-effort; no-op if unknown). */
|
|
208
|
+
updateSubagentModel(subagentId: string, model: {
|
|
209
|
+
requestedModel?: string;
|
|
210
|
+
effectiveModel?: string;
|
|
211
|
+
modelFellBack?: boolean;
|
|
212
|
+
}): void;
|
|
187
213
|
getSubagentRecord(subagentId: string, filter?: AsyncJobFilter): SubagentRecord | undefined;
|
|
188
214
|
getSubagentRecords(filter?: AsyncJobFilter): SubagentRecord[];
|
|
189
215
|
registerLiveHandle(subagentId: string, handle: SubagentLiveHandle): void;
|
package/dist/types/cli/args.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ModelRegistry } from "../config/model-registry";
|
|
2
|
+
import { type ExtensionFactory } from "../extensibility/extensions";
|
|
2
3
|
/**
|
|
3
4
|
* List available models, optionally filtered by search pattern
|
|
4
5
|
*/
|
|
@@ -11,6 +12,11 @@ export interface RunListModelsOptions {
|
|
|
11
12
|
cwd: string;
|
|
12
13
|
/** CLI-supplied extension paths (e.g. from `-e <path>`). */
|
|
13
14
|
additionalExtensionPaths?: string[];
|
|
15
|
+
/** In-process extension factories to load without filesystem discovery. */
|
|
16
|
+
extensionFactories?: Array<{
|
|
17
|
+
factory: ExtensionFactory;
|
|
18
|
+
name: string;
|
|
19
|
+
}>;
|
|
14
20
|
/** Extension paths configured under `extensions:` in user settings. */
|
|
15
21
|
settingsExtensions?: string[];
|
|
16
22
|
/** Disabled extension ids from settings (`disabledExtensions`). */
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Setup CLI command handler.
|
|
3
|
+
*
|
|
4
|
+
* Handles `gjc setup [component]` to install the normal defaults or optional feature dependencies.
|
|
5
|
+
*/
|
|
6
|
+
export type SetupComponent = "credentials" | "defaults" | "hermes" | "hooks" | "provider" | "python" | "stt";
|
|
2
7
|
export interface SetupCommandArgs {
|
|
3
8
|
component: SetupComponent;
|
|
4
9
|
flags: {
|
|
@@ -27,6 +32,8 @@ export interface SetupCommandArgs {
|
|
|
27
32
|
gjcCommand?: string;
|
|
28
33
|
target?: string;
|
|
29
34
|
profileDir?: string;
|
|
35
|
+
yes?: boolean;
|
|
36
|
+
dryRun?: boolean;
|
|
30
37
|
};
|
|
31
38
|
}
|
|
32
39
|
/**
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Command } from "@gajae-code/utils/cli";
|
|
2
|
+
export default class Gc extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static strict: boolean;
|
|
5
|
+
static flags: {
|
|
6
|
+
json: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
|
|
7
|
+
char: string;
|
|
8
|
+
description: string;
|
|
9
|
+
default: boolean;
|
|
10
|
+
};
|
|
11
|
+
prune: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
|
|
12
|
+
description: string;
|
|
13
|
+
default: boolean;
|
|
14
|
+
};
|
|
15
|
+
force: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
|
|
16
|
+
description: string;
|
|
17
|
+
default: boolean;
|
|
18
|
+
};
|
|
19
|
+
"dry-run": import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
|
|
20
|
+
description: string;
|
|
21
|
+
default: boolean;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
static examples: string[];
|
|
25
|
+
run(): Promise<void>;
|
|
26
|
+
}
|
|
@@ -93,6 +93,13 @@ export default class Setup extends Command {
|
|
|
93
93
|
"models-path": import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
|
|
94
94
|
description: string;
|
|
95
95
|
};
|
|
96
|
+
yes: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
|
|
97
|
+
char: string;
|
|
98
|
+
description: string;
|
|
99
|
+
};
|
|
100
|
+
"dry-run": import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
|
|
101
|
+
description: string;
|
|
102
|
+
};
|
|
96
103
|
};
|
|
97
104
|
run(): Promise<void>;
|
|
98
105
|
}
|
|
@@ -3,4 +3,33 @@ export interface FileLockOptions {
|
|
|
3
3
|
retries?: number;
|
|
4
4
|
retryDelayMs?: number;
|
|
5
5
|
}
|
|
6
|
+
/** @internal */
|
|
7
|
+
export declare function readFileLockInfoForGc(lockDir: string): Promise<{
|
|
8
|
+
pid: number;
|
|
9
|
+
timestamp: number;
|
|
10
|
+
} | null>;
|
|
11
|
+
/** Owner identity stamped into a `<file>.lock/info` record. */
|
|
12
|
+
export interface FileLockOwnerToken {
|
|
13
|
+
pid: number;
|
|
14
|
+
timestamp: number;
|
|
15
|
+
}
|
|
16
|
+
/** Outcome of a guarded GC removal attempt (`removeFileLockDirForGc`). */
|
|
17
|
+
export type FileLockGcRemoval = "removed" | "owner_changed" | "missing";
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
* Fail-closed removal of a dead lock dir for GC. Re-reads the on-disk owner
|
|
21
|
+
* token as close to the unlink as possible and only deletes the dir when it
|
|
22
|
+
* STILL holds the exact `{pid, timestamp}` identity the caller observed dead.
|
|
23
|
+
*
|
|
24
|
+
* Closes the prune-time TOCTOU window (#606): between GC's dead re-read/probe
|
|
25
|
+
* and the unlink, a live process can reclaim a stale lock at the same path
|
|
26
|
+
* (`acquireLock` rms the stale dir, then re-`mkdir`s and rewrites `info` with a
|
|
27
|
+
* fresh pid+timestamp). Deleting by path alone would reap that LIVE lock. Any
|
|
28
|
+
* mismatch (`owner_changed`) or absent/unreadable info (`missing` — e.g. a
|
|
29
|
+
* fresh acquirer between `mkdir` and `writeLockInfo`) refuses the delete and
|
|
30
|
+
* leaves the dir intact. POSIX has no atomic compare-and-delete for a
|
|
31
|
+
* directory, so the residual read->unlink window cannot be fully eliminated,
|
|
32
|
+
* but the reclaim-after-stale scenario the issue describes is now guarded.
|
|
33
|
+
*/
|
|
34
|
+
export declare function removeFileLockDirForGc(lockDir: string, expected: FileLockOwnerToken): Promise<FileLockGcRemoval>;
|
|
6
35
|
export declare function withFileLock<T>(filePath: string, fn: () => Promise<T>, options?: FileLockOptions): Promise<T>;
|
|
@@ -2,6 +2,7 @@ import { type Api, type AssistantMessageEventStream, type CacheRetention, type C
|
|
|
2
2
|
import type { OAuthCredentials, OAuthLoginCallbacks } from "@gajae-code/ai/utils/oauth/types";
|
|
3
3
|
import { type ThemeColor } from "../modes/theme/theme";
|
|
4
4
|
import type { AuthStorage } from "../session/auth-storage";
|
|
5
|
+
import type { ActiveSearchModelContext, WebSearchMode } from "../web/search/types";
|
|
5
6
|
import { type ConfigError, ConfigFile } from "./config-file";
|
|
6
7
|
import { type CanonicalModelIndex, type CanonicalModelRecord, type CanonicalModelVariant, type ModelEquivalenceConfig } from "./model-equivalence";
|
|
7
8
|
import { type ModelProfileDefinition } from "./model-profiles";
|
|
@@ -87,6 +88,7 @@ export declare const ModelsConfigFile: ConfigFile<{
|
|
|
87
88
|
supportsStrictMode?: boolean | undefined;
|
|
88
89
|
toolStrictMode?: "all_strict" | "none" | undefined;
|
|
89
90
|
} | undefined;
|
|
91
|
+
webSearch?: "auto" | "off" | "on" | undefined;
|
|
90
92
|
authHeader?: boolean | undefined;
|
|
91
93
|
auth?: "apiKey" | "none" | "oauth" | undefined;
|
|
92
94
|
discovery?: {
|
|
@@ -364,6 +366,8 @@ export declare class ModelRegistry {
|
|
|
364
366
|
* Get the base URL associated with a provider, if any model defines one.
|
|
365
367
|
*/
|
|
366
368
|
getProviderBaseUrl(provider: string): string | undefined;
|
|
369
|
+
getProviderWebSearchMode(provider: string): WebSearchMode | undefined;
|
|
370
|
+
getActiveSearchModelContext(model: Model<Api>): ActiveSearchModelContext;
|
|
367
371
|
/**
|
|
368
372
|
* Get API key for a model.
|
|
369
373
|
*/
|
|
@@ -333,6 +333,11 @@ export declare const ModelsConfigSchema: z.ZodObject<{
|
|
|
333
333
|
none: "none";
|
|
334
334
|
}>>;
|
|
335
335
|
}, z.core.$strip>>;
|
|
336
|
+
webSearch: z.ZodOptional<z.ZodEnum<{
|
|
337
|
+
auto: "auto";
|
|
338
|
+
off: "off";
|
|
339
|
+
on: "on";
|
|
340
|
+
}>>;
|
|
336
341
|
authHeader: z.ZodOptional<z.ZodBoolean>;
|
|
337
342
|
auth: z.ZodOptional<z.ZodEnum<{
|
|
338
343
|
apiKey: "apiKey";
|
|
@@ -86,6 +86,9 @@ interface EnumDef<T extends readonly string[]> {
|
|
|
86
86
|
interface ArrayDef<T> {
|
|
87
87
|
type: "array";
|
|
88
88
|
default: T[];
|
|
89
|
+
items?: {
|
|
90
|
+
enum: readonly string[];
|
|
91
|
+
};
|
|
89
92
|
ui?: UiBase;
|
|
90
93
|
}
|
|
91
94
|
interface RecordDef<T> {
|
|
@@ -956,6 +959,53 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
956
959
|
}];
|
|
957
960
|
};
|
|
958
961
|
};
|
|
962
|
+
readonly "task.serviceTier": {
|
|
963
|
+
readonly type: "enum";
|
|
964
|
+
readonly values: readonly ["inherit", "none", "auto", "default", "flex", "scale", "priority", "openai-only", "claude-only"];
|
|
965
|
+
readonly default: "inherit";
|
|
966
|
+
readonly ui: {
|
|
967
|
+
readonly tab: "tasks";
|
|
968
|
+
readonly label: "Subagent Service Tier";
|
|
969
|
+
readonly description: 'Service tier applied to task-tool subagents only. "inherit" copies the main session tier; any explicit value overrides it for subagents without touching the main session.';
|
|
970
|
+
readonly options: readonly [{
|
|
971
|
+
readonly value: "inherit";
|
|
972
|
+
readonly label: "Inherit";
|
|
973
|
+
readonly description: "Use the main session's service tier (default)";
|
|
974
|
+
}, {
|
|
975
|
+
readonly value: "none";
|
|
976
|
+
readonly label: "None";
|
|
977
|
+
readonly description: "Omit service_tier for subagents";
|
|
978
|
+
}, {
|
|
979
|
+
readonly value: "auto";
|
|
980
|
+
readonly label: "Auto";
|
|
981
|
+
readonly description: "Use provider default tier selection (OpenAI)";
|
|
982
|
+
}, {
|
|
983
|
+
readonly value: "default";
|
|
984
|
+
readonly label: "Default";
|
|
985
|
+
readonly description: "Standard priority processing (OpenAI)";
|
|
986
|
+
}, {
|
|
987
|
+
readonly value: "flex";
|
|
988
|
+
readonly label: "Flex";
|
|
989
|
+
readonly description: "Flexible capacity tier when available (OpenAI)";
|
|
990
|
+
}, {
|
|
991
|
+
readonly value: "scale";
|
|
992
|
+
readonly label: "Scale";
|
|
993
|
+
readonly description: "Scale Tier credits when available (OpenAI)";
|
|
994
|
+
}, {
|
|
995
|
+
readonly value: "priority";
|
|
996
|
+
readonly label: "Priority";
|
|
997
|
+
readonly description: "Priority on every supported provider (OpenAI `service_tier`, Anthropic fast mode)";
|
|
998
|
+
}, {
|
|
999
|
+
readonly value: "openai-only";
|
|
1000
|
+
readonly label: "Priority (OpenAI only)";
|
|
1001
|
+
readonly description: "Priority on OpenAI/OpenAI-Codex requests; ignored elsewhere";
|
|
1002
|
+
}, {
|
|
1003
|
+
readonly value: "claude-only";
|
|
1004
|
+
readonly label: "Priority (Claude only)";
|
|
1005
|
+
readonly description: "Anthropic fast mode on direct Claude requests; ignored elsewhere (incl. Bedrock/Vertex)";
|
|
1006
|
+
}];
|
|
1007
|
+
};
|
|
1008
|
+
};
|
|
959
1009
|
readonly "retry.enabled": {
|
|
960
1010
|
readonly type: "boolean";
|
|
961
1011
|
readonly default: true;
|
|
@@ -2411,6 +2461,18 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
2411
2461
|
readonly description: "Enable the web_search tool for web searching";
|
|
2412
2462
|
};
|
|
2413
2463
|
};
|
|
2464
|
+
readonly "web_search.fallback": {
|
|
2465
|
+
readonly type: "array";
|
|
2466
|
+
readonly default: string[];
|
|
2467
|
+
readonly items: {
|
|
2468
|
+
readonly enum: readonly ["duckduckgo", "exa", "brave", "jina", "kimi", "zai", "anthropic", "perplexity", "gemini", "codex", "tavily", "parallel", "kagi", "synthetic", "searxng"];
|
|
2469
|
+
};
|
|
2470
|
+
readonly ui: {
|
|
2471
|
+
readonly tab: "tools";
|
|
2472
|
+
readonly label: "Web Search Fallback";
|
|
2473
|
+
readonly description: "Ordered fallback web search providers after the active model native provider";
|
|
2474
|
+
};
|
|
2475
|
+
};
|
|
2414
2476
|
readonly "browser.enabled": {
|
|
2415
2477
|
readonly type: "boolean";
|
|
2416
2478
|
readonly default: true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const COORDINATOR_MCP_PROTOCOL_VERSION = "2024-11-05";
|
|
2
2
|
export declare const COORDINATOR_MCP_SERVER_NAME = "gjc-coordinator-mcp";
|
|
3
|
-
export declare const COORDINATOR_MCP_TOOL_NAMES: readonly ["gjc_coordinator_list_sessions", "gjc_coordinator_read_status", "gjc_coordinator_read_tail", "gjc_coordinator_list_questions", "gjc_coordinator_list_artifacts", "gjc_coordinator_read_artifact", "gjc_coordinator_read_coordination_status", "gjc_coordinator_register_session", "gjc_coordinator_start_session", "gjc_coordinator_send_prompt", "gjc_coordinator_submit_question_answer", "gjc_coordinator_read_turn", "gjc_coordinator_await_turn", "gjc_coordinator_report_status"];
|
|
3
|
+
export declare const COORDINATOR_MCP_TOOL_NAMES: readonly ["gjc_coordinator_list_sessions", "gjc_coordinator_read_status", "gjc_coordinator_read_tail", "gjc_coordinator_list_questions", "gjc_coordinator_list_artifacts", "gjc_coordinator_read_artifact", "gjc_coordinator_read_coordination_status", "gjc_coordinator_watch_events", "gjc_coordinator_register_session", "gjc_coordinator_start_session", "gjc_coordinator_send_prompt", "gjc_coordinator_submit_question_answer", "gjc_coordinator_read_turn", "gjc_coordinator_await_turn", "gjc_coordinator_report_status"];
|
|
4
4
|
export type CoordinatorToolName = (typeof COORDINATOR_MCP_TOOL_NAMES)[number];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "../grok-cli-vendor/src/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './provider/register.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model definitions for Grok CLI's API.
|
|
3
|
+
*/
|
|
4
|
+
export interface GrokCliModelConfig {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
reasoning: boolean;
|
|
8
|
+
input: ('text' | 'image')[];
|
|
9
|
+
cost: {
|
|
10
|
+
input: number;
|
|
11
|
+
output: number;
|
|
12
|
+
cacheRead: number;
|
|
13
|
+
cacheWrite: number;
|
|
14
|
+
};
|
|
15
|
+
contextWindow: number;
|
|
16
|
+
maxTokens: number;
|
|
17
|
+
/** Models that don't support reasoning.effort get a thinkingLevelMap. */
|
|
18
|
+
thinkingLevelMap?: Record<string, string | null>;
|
|
19
|
+
}
|
|
20
|
+
export declare function supportsReasoningEffort(modelId: string): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Resolve the active model list. If `GJC_GROK_CLI_MODELS` is set,
|
|
23
|
+
* it filters/reorders the fallback list; unknown IDs get sensible defaults.
|
|
24
|
+
*/
|
|
25
|
+
export declare function resolveModels(): GrokCliModelConfig[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payload sanitization for xAI's Responses API via cli-chat-proxy.grok.com.
|
|
3
|
+
*
|
|
4
|
+
* xAI's endpoint has quirks compared to stock OpenAI:
|
|
5
|
+
* - Replayed or encrypted `reasoning` items in input cause 400 errors.
|
|
6
|
+
* - `reasoning.effort` is only supported on a subset of models.
|
|
7
|
+
* - Empty-string content items cause validation failures.
|
|
8
|
+
* - `function_call_output.output` cannot contain image arrays.
|
|
9
|
+
* - `image_url` parts must be normalized to `input_image` with data URIs.
|
|
10
|
+
* - Local image paths must be resolved to base64 data URIs.
|
|
11
|
+
* - xAI rejects `role: "developer"` and `role: "system"` in the input
|
|
12
|
+
* array; these must be moved to top-level `instructions`.
|
|
13
|
+
* - xAI uses `text.format` instead of OpenAI's `response_format`.
|
|
14
|
+
* - xAI uses `prompt_cache_key` for conversation caching.
|
|
15
|
+
* - xAI doesn't support `prompt_cache_retention`.
|
|
16
|
+
*
|
|
17
|
+
* Additional Grok CLI-specific behavior:
|
|
18
|
+
* - Adds x-grok-* headers for client identification
|
|
19
|
+
* - Uses prompt_cache_key for session affinity
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Sanitize a provider request payload for xAI's Responses API via
|
|
23
|
+
* cli-chat-proxy.grok.com.
|
|
24
|
+
*
|
|
25
|
+
* Returns the modified payload. Mutates the input in place for efficiency.
|
|
26
|
+
*/
|
|
27
|
+
export declare function sanitizePayload(params: Record<string, unknown>, modelId: string, sessionId: string | undefined, cwd: string): Record<string, unknown>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface BillingUsage {
|
|
2
|
+
monthlyLimit: number;
|
|
3
|
+
used: number;
|
|
4
|
+
billingPeriodEnd: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function fetchBillingUsage(token: string): Promise<BillingUsage>;
|
|
7
|
+
export declare function formatQuota(usage: BillingUsage | undefined): string[];
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Api, AssistantMessageEventStream, Context, Model, SimpleStreamOptions } from '@gajae-code/ai';
|
|
2
|
+
/**
|
|
3
|
+
* Stream function that adds Grok CLI-specific headers to requests.
|
|
4
|
+
*
|
|
5
|
+
* GJC Grok Build extension sends cli-chat-proxy headers (see agent.models.grok-cli.yml):
|
|
6
|
+
* - x-grok-conv-id: <session/conversation ID>
|
|
7
|
+
* - x-grok-model-override: <model ID>
|
|
8
|
+
* - x-xai-token-auth: xai-grok-cli
|
|
9
|
+
*/
|
|
10
|
+
export declare function streamGrokCli(model: Model<Api>, context: Context, options?: SimpleStreamOptions): AssistantMessageEventStream;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed error for xAI OAuth failures.
|
|
3
|
+
*
|
|
4
|
+
* Codes allow the login flow and stream handlers to distinguish
|
|
5
|
+
* retryable failures (network) from fatal ones (revoked refresh token).
|
|
6
|
+
*/
|
|
7
|
+
export declare class XaiOAuthError extends Error {
|
|
8
|
+
readonly code: string;
|
|
9
|
+
readonly reloginRequired: boolean;
|
|
10
|
+
constructor(message: string, code: string, reloginRequired?: boolean);
|
|
11
|
+
}
|
|
12
|
+
/** Well-known error codes. */
|
|
13
|
+
export declare const XaiErrorCode: {
|
|
14
|
+
/** OIDC discovery failed (network, invalid response). */
|
|
15
|
+
readonly DISCOVERY_FAILED: 'discovery_failed';
|
|
16
|
+
/** Discovery endpoint returned a non-xAI origin. */
|
|
17
|
+
readonly DISCOVERY_INVALID_ORIGIN: 'discovery_invalid_origin';
|
|
18
|
+
/** Authorization was denied or errored in the browser. */
|
|
19
|
+
readonly AUTHORIZATION_FAILED: 'authorization_failed';
|
|
20
|
+
/** CSRF state mismatch between request and callback. */
|
|
21
|
+
readonly STATE_MISMATCH: 'state_mismatch';
|
|
22
|
+
/** Callback did not include an authorization code. */
|
|
23
|
+
readonly CODE_MISSING: 'code_missing';
|
|
24
|
+
/** Token exchange failed (network, invalid response). */
|
|
25
|
+
readonly TOKEN_EXCHANGE_FAILED: 'token_exchange_failed';
|
|
26
|
+
/** Token exchange returned an invalid payload. */
|
|
27
|
+
readonly TOKEN_EXCHANGE_INVALID: 'token_exchange_invalid';
|
|
28
|
+
/** Refresh token is missing or empty. */
|
|
29
|
+
readonly REFRESH_MISSING: 'refresh_missing';
|
|
30
|
+
/** Token refresh failed (expired, revoked). */
|
|
31
|
+
readonly REFRESH_FAILED: 'refresh_failed';
|
|
32
|
+
/** No credentials stored. */
|
|
33
|
+
readonly AUTH_MISSING: 'auth_missing';
|
|
34
|
+
/** Loopback callback server could not bind. */
|
|
35
|
+
readonly CALLBACK_BIND_FAILED: 'callback_bind_failed';
|
|
36
|
+
/** Loopback callback timed out. */
|
|
37
|
+
readonly CALLBACK_TIMEOUT: 'callback_timeout';
|
|
38
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ExtensionFactory } from "../extensibility/extensions/types";
|
|
2
|
+
export declare const BUNDLED_GROK_BUILD_EXTENSION_ID = "bundled:grok-build";
|
|
3
|
+
export declare function getBundledGrokBuildExtensionFactory(): ExtensionFactory;
|
|
4
|
+
export declare function getBundledGrokCliModelDefaults(): string;
|
|
5
|
+
export declare function assertBundledGrokCliDefaults(): Promise<void>;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export type { SlashCommandInfo, SlashCommandLocation, SlashCommandSource } from "../slash-commands";
|
|
5
5
|
export { discoverAndLoadExtensions, ExtensionRuntimeNotInitializedError, loadExtensionFromFactory, loadExtensions, } from "./loader";
|
|
6
|
+
export * from "./prefix-command-bridge";
|
|
6
7
|
export * from "./runner";
|
|
7
8
|
export * from "./types";
|
|
8
9
|
export * from "./wrapper";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ExecResult } from "../../exec/exec";
|
|
2
|
+
import type { ExtensionContext, InputEvent, InputEventResult } from "./types";
|
|
3
|
+
export declare const OOO_BRIDGE_RECURSION_ENV = "_OUROBOROS_GJC_BRIDGE_DEPTH";
|
|
4
|
+
export declare const OOO_BRIDGE_CONTINUE_EXIT_CODE = 78;
|
|
5
|
+
export declare const OOO_BRIDGE_TIMEOUT_ENV = "OUROBOROS_GJC_BRIDGE_TIMEOUT_MS";
|
|
6
|
+
export interface ExactPrefixCommandBridgeOptions {
|
|
7
|
+
/** Bare command prefix to intercept, without trailing whitespace. */
|
|
8
|
+
prefix: string;
|
|
9
|
+
/** Command executable to run when the prefix matches. */
|
|
10
|
+
command: string;
|
|
11
|
+
/** Arguments inserted before the intercepted input text. */
|
|
12
|
+
args?: string[];
|
|
13
|
+
/** Environment variable used as the recursion-depth guard. */
|
|
14
|
+
recursionEnv?: string;
|
|
15
|
+
/** Exit code that maps to extension pass-through instead of handled input. */
|
|
16
|
+
continueExitCode?: number;
|
|
17
|
+
/** Optional dispatch timeout in milliseconds. */
|
|
18
|
+
timeout?: number;
|
|
19
|
+
/** Dispatch implementation. Defaults to the shared command executor in the extension context cwd. */
|
|
20
|
+
dispatch?: (command: string, args: string[], ctx: ExtensionContext, options: {
|
|
21
|
+
timeout?: number;
|
|
22
|
+
}) => Promise<ExecResult>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Build an extension `input` handler for an exact-prefix command bridge.
|
|
26
|
+
*
|
|
27
|
+
* Matching input is passed to `command` as `args + [event.text]`. A zero exit code
|
|
28
|
+
* handles the input, `continueExitCode` returns pass-through, and any other
|
|
29
|
+
* non-zero exit code surfaces an error and handles the input so the failed
|
|
30
|
+
* command is not forwarded to the model. The recursion
|
|
31
|
+
* guard prevents extension-originated or nested dispatch from re-entering the
|
|
32
|
+
* bridge while the child command runs.
|
|
33
|
+
*/
|
|
34
|
+
export declare function createExactPrefixCommandBridge(options: ExactPrefixCommandBridgeOptions): (event: InputEvent, ctx: ExtensionContext) => Promise<InputEventResult>;
|
|
35
|
+
export declare function createOuroborosOooBridge(): (event: InputEvent, ctx: ExtensionContext) => Promise<InputEventResult>;
|