@gajae-code/coding-agent 0.5.1 → 0.5.3
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 +31 -0
- package/README.md +1 -1
- package/dist/types/async/job-manager.d.ts +6 -0
- package/dist/types/cli/setup-cli.d.ts +8 -1
- package/dist/types/commands/setup.d.ts +7 -0
- package/dist/types/config/file-lock.d.ts +24 -2
- 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/dap/client.d.ts +2 -1
- package/dist/types/edit/read-file.d.ts +6 -0
- package/dist/types/eval/js/context-manager.d.ts +3 -0
- package/dist/types/eval/js/executor.d.ts +1 -0
- package/dist/types/exec/bash-executor.d.ts +2 -0
- package/dist/types/gjc-runtime/state-writer.d.ts +64 -2
- package/dist/types/gjc-runtime/tmux-sessions.d.ts +7 -1
- 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/lsp/types.d.ts +2 -0
- package/dist/types/modes/bridge/bridge-mode.d.ts +1 -0
- package/dist/types/modes/components/model-selector.d.ts +2 -0
- package/dist/types/modes/components/oauth-selector.d.ts +1 -0
- package/dist/types/modes/components/provider-onboarding-selector.d.ts +1 -1
- package/dist/types/modes/components/runtime-mcp-add-wizard.d.ts +1 -0
- package/dist/types/modes/components/tool-execution.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +1 -1
- package/dist/types/modes/rpc/rpc-mode.d.ts +56 -1
- 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/runtime/process-lifecycle.d.ts +108 -0
- package/dist/types/runtime-mcp/transports/stdio.d.ts +1 -0
- package/dist/types/runtime-mcp/types.d.ts +2 -0
- package/dist/types/session/agent-session.d.ts +17 -1
- package/dist/types/session/artifacts.d.ts +4 -1
- package/dist/types/session/history-storage.d.ts +2 -2
- package/dist/types/session/session-manager.d.ts +10 -1
- package/dist/types/session/streaming-output.d.ts +5 -0
- package/dist/types/setup/credential-import.d.ts +79 -0
- package/dist/types/slash-commands/helpers/fast-status-report.d.ts +76 -0
- package/dist/types/task/executor.d.ts +1 -0
- package/dist/types/task/render.d.ts +1 -1
- package/dist/types/tools/bash.d.ts +1 -0
- package/dist/types/tools/browser/tab-supervisor.d.ts +9 -0
- package/dist/types/tools/sqlite-reader.d.ts +2 -1
- package/dist/types/tools/subagent-render.d.ts +7 -1
- package/dist/types/tools/subagent.d.ts +21 -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 +153 -39
- package/src/cli/args.ts +2 -0
- package/src/cli/fast-help.ts +2 -0
- package/src/cli/setup-cli.ts +138 -3
- package/src/commands/setup.ts +5 -1
- package/src/commands/ultragoal.ts +3 -1
- package/src/config/file-lock-gc.ts +14 -2
- package/src/config/file-lock.ts +63 -13
- package/src/config/model-profile-activation.ts +15 -3
- package/src/config/model-profiles.ts +15 -15
- 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/dap/client.ts +105 -64
- package/src/dap/session.ts +44 -7
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +30 -8
- package/src/edit/read-file.ts +19 -1
- package/src/eval/js/context-manager.ts +228 -65
- package/src/eval/js/executor.ts +2 -0
- package/src/eval/js/index.ts +1 -0
- package/src/eval/js/worker-core.ts +10 -6
- package/src/eval/py/executor.ts +68 -19
- package/src/eval/py/kernel.ts +46 -22
- package/src/eval/py/runner.py +68 -14
- package/src/exec/bash-executor.ts +49 -13
- package/src/gjc-runtime/deep-interview-recorder.ts +40 -0
- package/src/gjc-runtime/launch-tmux.ts +3 -4
- package/src/gjc-runtime/ralplan-runtime.ts +174 -12
- package/src/gjc-runtime/state-runtime.ts +2 -1
- package/src/gjc-runtime/state-writer.ts +254 -7
- package/src/gjc-runtime/tmux-gc.ts +88 -38
- package/src/gjc-runtime/tmux-sessions.ts +44 -6
- package/src/gjc-runtime/ultragoal-guard.ts +155 -0
- package/src/gjc-runtime/ultragoal-runtime.ts +1227 -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/owner.ts +3 -2
- package/src/harness-control-plane/rpc-adapter.ts +1 -1
- package/src/hooks/skill-state.ts +121 -2
- package/src/internal-urls/artifact-protocol.ts +10 -1
- package/src/internal-urls/docs-index.generated.ts +14 -10
- package/src/lsp/client.ts +64 -26
- package/src/lsp/defaults.json +1 -0
- package/src/lsp/index.ts +2 -1
- package/src/lsp/lspmux.ts +33 -9
- package/src/lsp/types.ts +2 -0
- package/src/main.ts +14 -4
- package/src/modes/acp/acp-agent.ts +4 -2
- package/src/modes/bridge/bridge-mode.ts +23 -1
- package/src/modes/components/assistant-message.ts +10 -2
- package/src/modes/components/bash-execution.ts +5 -1
- package/src/modes/components/eval-execution.ts +5 -1
- package/src/modes/components/history-search.ts +5 -2
- package/src/modes/components/model-selector.ts +60 -2
- package/src/modes/components/oauth-selector.ts +5 -0
- package/src/modes/components/provider-onboarding-selector.ts +6 -1
- package/src/modes/components/runtime-mcp-add-wizard.ts +58 -7
- package/src/modes/components/skill-message.ts +24 -16
- package/src/modes/components/tool-execution.ts +6 -0
- package/src/modes/controllers/extension-ui-controller.ts +33 -6
- package/src/modes/controllers/input-controller.ts +5 -0
- package/src/modes/controllers/selector-controller.ts +86 -2
- package/src/modes/interactive-mode.ts +11 -1
- package/src/modes/rpc/rpc-mode.ts +132 -18
- package/src/modes/shared/agent-wire/command-dispatch.ts +5 -2
- package/src/modes/shared/agent-wire/host-tool-bridge.ts +3 -0
- package/src/modes/shared/agent-wire/unattended-session.ts +16 -1
- 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/modes/utils/ui-helpers.ts +5 -2
- package/src/prompts/agents/executor.md +5 -2
- package/src/runtime/process-lifecycle.ts +400 -0
- package/src/runtime-mcp/manager.ts +164 -50
- package/src/runtime-mcp/transports/http.ts +12 -11
- package/src/runtime-mcp/transports/stdio.ts +64 -38
- package/src/runtime-mcp/types.ts +3 -0
- package/src/sdk.ts +39 -1
- package/src/session/agent-session.ts +190 -33
- package/src/session/artifacts.ts +17 -2
- package/src/session/blob-store.ts +36 -2
- package/src/session/history-storage.ts +32 -11
- package/src/session/session-manager.ts +99 -31
- package/src/session/streaming-output.ts +54 -3
- package/src/setup/credential-import.ts +429 -0
- package/src/skill-state/deep-interview-mutation-guard.ts +2 -1
- package/src/slash-commands/builtin-registry.ts +30 -3
- package/src/slash-commands/helpers/fast-status-report.ts +111 -0
- package/src/task/executor.ts +7 -1
- package/src/task/render.ts +18 -7
- package/src/tools/archive-reader.ts +10 -1
- package/src/tools/ask.ts +4 -2
- package/src/tools/bash.ts +11 -4
- package/src/tools/browser/tab-supervisor.ts +22 -0
- package/src/tools/browser.ts +38 -4
- package/src/tools/cron.ts +1 -1
- package/src/tools/read.ts +11 -12
- package/src/tools/sqlite-reader.ts +19 -5
- package/src/tools/subagent-render.ts +119 -29
- package/src/tools/subagent.ts +147 -7
- 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
|
@@ -2,6 +2,7 @@ import type { AgentToolUpdateCallback } from "@gajae-code/agent-core";
|
|
|
2
2
|
export declare const DEFAULT_MAX_LINES = 3000;
|
|
3
3
|
export declare const DEFAULT_MAX_BYTES: number;
|
|
4
4
|
export declare const DEFAULT_MAX_COLUMN = 1024;
|
|
5
|
+
export declare const DEFAULT_ARTIFACT_MAX_BYTES: number;
|
|
5
6
|
export interface OutputSummary {
|
|
6
7
|
output: string;
|
|
7
8
|
truncated: boolean;
|
|
@@ -19,6 +20,8 @@ export interface OutputSummary {
|
|
|
19
20
|
columnTruncatedLines?: number;
|
|
20
21
|
/** Artifact ID for internal URL access (artifact://<id>) when truncated */
|
|
21
22
|
artifactId?: string;
|
|
23
|
+
/** Bytes omitted from artifact storage after the artifact hard cap was reached. */
|
|
24
|
+
artifactTruncatedBytes?: number;
|
|
22
25
|
}
|
|
23
26
|
export interface OutputSinkOptions {
|
|
24
27
|
artifactPath?: string;
|
|
@@ -38,6 +41,8 @@ export interface OutputSinkOptions {
|
|
|
38
41
|
* writes still respect the budget. Default 0 = no per-line cap.
|
|
39
42
|
*/
|
|
40
43
|
maxColumns?: number;
|
|
44
|
+
/** Hard cap for artifact writes/pending replay. Default DEFAULT_ARTIFACT_MAX_BYTES. */
|
|
45
|
+
artifactMaxBytes?: number;
|
|
41
46
|
onChunk?: (chunk: string) => void;
|
|
42
47
|
/** Minimum ms between onChunk calls. 0 = every chunk (default). */
|
|
43
48
|
chunkThrottleMs?: number;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { AuthCredential } from "@gajae-code/ai";
|
|
2
|
+
/** gjc provider ids that external credentials map onto. */
|
|
3
|
+
export type ExternalProvider = "anthropic" | "openai-codex";
|
|
4
|
+
/** Where a discovered credential came from. */
|
|
5
|
+
export type CredentialOrigin = "claude-code-file" | "claude-code-keychain" | "codex-file";
|
|
6
|
+
/** Human labels for providers, used in redacted summaries. */
|
|
7
|
+
export declare const EXTERNAL_PROVIDER_LABELS: Record<ExternalProvider, string>;
|
|
8
|
+
/** A credential that can be safely imported into gjc's store. */
|
|
9
|
+
export interface ImportableCredential {
|
|
10
|
+
provider: ExternalProvider;
|
|
11
|
+
origin: CredentialOrigin;
|
|
12
|
+
/** Redacted, human-readable description of where this came from. */
|
|
13
|
+
source: string;
|
|
14
|
+
kind: AuthCredential["type"];
|
|
15
|
+
identity?: {
|
|
16
|
+
email?: string;
|
|
17
|
+
accountId?: string;
|
|
18
|
+
};
|
|
19
|
+
/** Epoch-ms expiry for OAuth credentials, when known. */
|
|
20
|
+
expiresAt?: number;
|
|
21
|
+
/** Redacted access token / API key — safe to display. */
|
|
22
|
+
redactedToken: string;
|
|
23
|
+
/** Opaque credential payload. Never include this in any summary output. */
|
|
24
|
+
credential: AuthCredential;
|
|
25
|
+
}
|
|
26
|
+
/** A source that was found but could not be imported. */
|
|
27
|
+
export interface SkippedCredential {
|
|
28
|
+
origin: CredentialOrigin;
|
|
29
|
+
source: string;
|
|
30
|
+
reason: string;
|
|
31
|
+
}
|
|
32
|
+
/** Ambient environment-backed auth that is already usable without import. */
|
|
33
|
+
export interface EnvironmentCredentialHint {
|
|
34
|
+
provider: ExternalProvider;
|
|
35
|
+
variable: string;
|
|
36
|
+
redactedValue: string;
|
|
37
|
+
}
|
|
38
|
+
export interface CredentialDiscoveryResult {
|
|
39
|
+
importable: ImportableCredential[];
|
|
40
|
+
skipped: SkippedCredential[];
|
|
41
|
+
environment: EnvironmentCredentialHint[];
|
|
42
|
+
}
|
|
43
|
+
export interface DiscoveryOptions {
|
|
44
|
+
/** Override the home directory (defaults to `os.homedir()`). */
|
|
45
|
+
homeDir?: string;
|
|
46
|
+
/** Override the environment (defaults to `process.env`). */
|
|
47
|
+
env?: Record<string, string | undefined>;
|
|
48
|
+
/** Override the platform (defaults to `process.platform`). */
|
|
49
|
+
platform?: NodeJS.Platform;
|
|
50
|
+
/**
|
|
51
|
+
* Reader for the macOS Keychain `Claude Code-credentials` entry. Defaults to
|
|
52
|
+
* shelling out to `security`; injected in tests. Returns the raw JSON string,
|
|
53
|
+
* or `null` when no entry exists.
|
|
54
|
+
*/
|
|
55
|
+
readClaudeKeychain?: () => Promise<string | null>;
|
|
56
|
+
}
|
|
57
|
+
export type CredentialUpserter = (provider: string, credential: AuthCredential) => unknown | Promise<unknown>;
|
|
58
|
+
export interface ImportSummary {
|
|
59
|
+
imported: ImportableCredential[];
|
|
60
|
+
failed: Array<{
|
|
61
|
+
credential: ImportableCredential;
|
|
62
|
+
error: string;
|
|
63
|
+
}>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Discover Claude Code and Codex CLI credentials across files, the macOS
|
|
67
|
+
* Keychain, and environment variables. Never throws for individual unreadable or
|
|
68
|
+
* malformed sources — those land in {@link CredentialDiscoveryResult.skipped}.
|
|
69
|
+
*/
|
|
70
|
+
export declare function discoverExternalCredentials(options?: DiscoveryOptions): Promise<CredentialDiscoveryResult>;
|
|
71
|
+
/** Redacted one-line summary of an importable credential. Never includes secrets. */
|
|
72
|
+
export declare function formatCredentialSummary(credential: ImportableCredential): string;
|
|
73
|
+
/** Redacted summary lines for an entire discovery result. Never includes secrets. */
|
|
74
|
+
export declare function formatDiscoverySummary(result: CredentialDiscoveryResult): string[];
|
|
75
|
+
/**
|
|
76
|
+
* Persist discovered credentials via `upsert`. Each credential is imported
|
|
77
|
+
* independently; a failure on one is recorded without aborting the rest.
|
|
78
|
+
*/
|
|
79
|
+
export declare function importCredentials(credentials: readonly ImportableCredential[], upsert: CredentialUpserter): Promise<ImportSummary>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { Model } from "@gajae-code/ai";
|
|
2
|
+
/**
|
|
3
|
+
* A single line in the `/fast status` report: a labelled model and whether fast
|
|
4
|
+
* mode is effective for it. The `fast` flag is resolved by the caller
|
|
5
|
+
* (`buildFastStatusReport`) so each row can use the correct service tier — the
|
|
6
|
+
* main session tier for the current model / `modelRoles` roles, or the subagent
|
|
7
|
+
* tier (`task.serviceTier`) for `task.agentModelOverrides` roles.
|
|
8
|
+
*/
|
|
9
|
+
export interface FastStatusRow {
|
|
10
|
+
/** Display label, e.g. "현재 모델", "DEFAULT", "EXECUTOR". */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Resolved model for this row, if any. */
|
|
13
|
+
model?: Model;
|
|
14
|
+
/** Whether fast mode is effective for this row's model. */
|
|
15
|
+
fast: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface FormatFastStatusReportArgs {
|
|
18
|
+
rows: FastStatusRow[];
|
|
19
|
+
/** The active theme's fast icon token (`theme.icon.fast`). */
|
|
20
|
+
iconFast: string;
|
|
21
|
+
/** Optional decorator for inactive ("off") text, e.g. theme dim in the TUI. */
|
|
22
|
+
formatInactive?: (text: string) => string;
|
|
23
|
+
}
|
|
24
|
+
/** Title line of the `/fast status` report. */
|
|
25
|
+
export declare const FAST_STATUS_TITLE = "Fast \uBAA8\uB4DC \uC0C1\uD0DC";
|
|
26
|
+
/** The inactive marker shown for rows where fast mode does not apply. */
|
|
27
|
+
export declare const FAST_STATUS_OFF = "off";
|
|
28
|
+
/**
|
|
29
|
+
* Format a multiline `/fast status` report. Pure and shared by the CLI
|
|
30
|
+
* (`handle`) and TUI (`handleTui`) command branches so the two never drift.
|
|
31
|
+
* Each row's fast/off state is decided by the caller (see
|
|
32
|
+
* {@link buildFastStatusReport}) so per-row service-tier differences are honored.
|
|
33
|
+
*/
|
|
34
|
+
export declare function formatFastStatusReport(args: FormatFastStatusReportArgs): string;
|
|
35
|
+
/** Minimal session surface needed to build the `/fast status` report. */
|
|
36
|
+
export interface FastStatusSessionLike {
|
|
37
|
+
readonly model?: Model;
|
|
38
|
+
/** Fast predicate against the main session tier (current model + `modelRoles`). */
|
|
39
|
+
isFastForProvider(provider?: string): boolean;
|
|
40
|
+
/** Fast predicate against the effective subagent tier (`task.agentModelOverrides` roles). */
|
|
41
|
+
isFastForSubagentProvider(provider?: string): boolean;
|
|
42
|
+
resolveRoleModelWithThinking(role: string): {
|
|
43
|
+
model?: Model;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/** A role to enumerate in the report, with the tier source its subagent runs under. */
|
|
47
|
+
export interface FastStatusRoleTarget {
|
|
48
|
+
id: string;
|
|
49
|
+
label: string;
|
|
50
|
+
/**
|
|
51
|
+
* True for `task.agentModelOverrides` roles (executor/architect/planner/critic)
|
|
52
|
+
* that run under `task.serviceTier`; false for `modelRoles` roles (default)
|
|
53
|
+
* that run under the main session tier.
|
|
54
|
+
*/
|
|
55
|
+
isSubagentRole: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface BuildFastStatusReportArgs {
|
|
58
|
+
session: FastStatusSessionLike;
|
|
59
|
+
/** Role targets to enumerate, in display order. */
|
|
60
|
+
roleTargets: ReadonlyArray<FastStatusRoleTarget>;
|
|
61
|
+
/** The active theme's fast icon token (`theme.icon.fast`). */
|
|
62
|
+
iconFast: string;
|
|
63
|
+
/** Optional decorator for inactive ("off") text, e.g. theme dim in the TUI. */
|
|
64
|
+
formatInactive?: (text: string) => string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Build the `/fast status` report from a live session: the active/current model
|
|
68
|
+
* followed by each assigned role (subagent) model. Unassigned roles are skipped
|
|
69
|
+
* so the report mirrors the `/model` selector, which only badges assigned roles.
|
|
70
|
+
*
|
|
71
|
+
* Subagent roles (`task.agentModelOverrides`) are evaluated against the
|
|
72
|
+
* effective subagent tier (`task.serviceTier`), while the current model and
|
|
73
|
+
* `modelRoles` roles use the main session tier — matching where each model
|
|
74
|
+
* actually runs.
|
|
75
|
+
*/
|
|
76
|
+
export declare function buildFastStatusReport(args: BuildFastStatusReportArgs): string;
|
|
@@ -105,6 +105,7 @@ interface FinalizeSubprocessOutputResult {
|
|
|
105
105
|
export declare const SUBAGENT_WARNING_NULL_YIELD = "SYSTEM WARNING: Subagent called yield with null data.";
|
|
106
106
|
export declare const SUBAGENT_WARNING_MISSING_YIELD = "SYSTEM WARNING: Subagent exited without calling yield tool after 3 reminders.";
|
|
107
107
|
export declare function finalizeSubprocessOutput(args: FinalizeSubprocessOutputArgs): FinalizeSubprocessOutputResult;
|
|
108
|
+
export declare function createSubagentSettings(baseSettings: Settings): Settings;
|
|
108
109
|
/**
|
|
109
110
|
* Run a single agent in-process.
|
|
110
111
|
*/
|
|
@@ -11,7 +11,7 @@ export declare function renderCall(args: TaskParams, _options: RenderResultOptio
|
|
|
11
11
|
* `subagent` await panel. Reuses the internal task-progress renderer so the
|
|
12
12
|
* await panel stays at parity with the inline task panel.
|
|
13
13
|
*/
|
|
14
|
-
export declare function renderSubagentLiveProgress(progress: AgentProgress, expanded: boolean, theme: Theme, spinnerFrame?: number): string[];
|
|
14
|
+
export declare function renderSubagentLiveProgress(progress: AgentProgress, expanded: boolean, theme: Theme, spinnerFrame?: number, staticTime?: boolean): string[];
|
|
15
15
|
/**
|
|
16
16
|
* Render the tool result.
|
|
17
17
|
*/
|
|
@@ -6,6 +6,7 @@ import { type Theme } from "../modes/theme/theme";
|
|
|
6
6
|
import type { ToolSession } from ".";
|
|
7
7
|
import { type OutputMeta } from "./output-meta";
|
|
8
8
|
export declare const BASH_DEFAULT_PREVIEW_LINES = 10;
|
|
9
|
+
export declare function saveBashOriginalArtifactForTests(session: ToolSession, originalText: string): Promise<string | undefined>;
|
|
9
10
|
declare const bashSchemaBase: z.ZodObject<{
|
|
10
11
|
command: z.ZodString;
|
|
11
12
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -26,6 +26,8 @@ export interface TabSession {
|
|
|
26
26
|
pending: Map<string, PendingRun>;
|
|
27
27
|
dialogPolicy?: DialogPolicy;
|
|
28
28
|
kindTag: BrowserKindTag;
|
|
29
|
+
/** Session that acquired this tab; used for session-scoped teardown (F13). */
|
|
30
|
+
ownerId?: string;
|
|
29
31
|
}
|
|
30
32
|
export interface AcquireTabOptions {
|
|
31
33
|
url?: string;
|
|
@@ -39,6 +41,8 @@ export interface AcquireTabOptions {
|
|
|
39
41
|
signal?: AbortSignal;
|
|
40
42
|
timeoutMs: number;
|
|
41
43
|
dialogs?: DialogPolicy;
|
|
44
|
+
/** Owning session id so dispose can release only this session's tabs (F13). */
|
|
45
|
+
ownerId?: string;
|
|
42
46
|
}
|
|
43
47
|
export interface AcquireTabResult {
|
|
44
48
|
tab: TabSession;
|
|
@@ -58,6 +62,11 @@ export declare function acquireTab(name: string, browser: BrowserHandle, opts: A
|
|
|
58
62
|
export declare function runInTab(name: string, opts: RunInTabOptions): Promise<RunResultOk>;
|
|
59
63
|
export declare function releaseTab(name: string, opts?: ReleaseTabOptions): Promise<boolean>;
|
|
60
64
|
export declare function releaseAllTabs(opts?: ReleaseTabOptions): Promise<number>;
|
|
65
|
+
/**
|
|
66
|
+
* Release only the tabs owned by `ownerId` (F13 session-scoped teardown). Tabs acquired
|
|
67
|
+
* by other sessions (or with no owner) are left untouched. No-op for a null/empty owner.
|
|
68
|
+
*/
|
|
69
|
+
export declare function releaseTabsForOwner(ownerId: string | null | undefined, opts?: ReleaseTabOptions): Promise<number>;
|
|
61
70
|
export declare function dropHeadlessTabs(): Promise<void>;
|
|
62
71
|
export declare function initializeTabWorkerForTest(worker: WorkerHandle, payload: WorkerInitPayload, timeoutMs: number): Promise<ReadyInfo>;
|
|
63
72
|
export {};
|
|
@@ -60,9 +60,10 @@ export declare function getRowByKey(db: Database, table: string, pk: {
|
|
|
60
60
|
type?: string;
|
|
61
61
|
}, key: string): Record<string, unknown> | null;
|
|
62
62
|
export declare function getRowByRowId(db: Database, table: string, key: string): Record<string, unknown> | null;
|
|
63
|
-
export declare function executeReadQuery(db: Database, sql: string): {
|
|
63
|
+
export declare function executeReadQuery(db: Database, sql: string, maxRows?: number): {
|
|
64
64
|
columns: string[];
|
|
65
65
|
rows: Record<string, unknown>[];
|
|
66
|
+
truncated: boolean;
|
|
66
67
|
};
|
|
67
68
|
export declare function insertRow(db: Database, table: string, data: Record<string, unknown>): void;
|
|
68
69
|
export declare function updateRowByKey(db: Database, table: string, pk: {
|
|
@@ -10,7 +10,13 @@
|
|
|
10
10
|
import type { Component } from "@gajae-code/tui";
|
|
11
11
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
12
12
|
import type { Theme } from "../modes/theme/theme";
|
|
13
|
-
import type
|
|
13
|
+
import { type SubagentToolDetails } from "./subagent";
|
|
14
|
+
/** Test-only seam (PR3 deterministic cache-hit assertions). */
|
|
15
|
+
export declare const subagentBodyCacheTestHooks: {
|
|
16
|
+
readonly bodyRenders: number;
|
|
17
|
+
readonly size: number;
|
|
18
|
+
reset(): void;
|
|
19
|
+
};
|
|
14
20
|
export declare const subagentToolRenderer: {
|
|
15
21
|
inline: boolean;
|
|
16
22
|
renderCall(_args: unknown, _options: RenderResultOptions, theme: Theme): Component;
|
|
@@ -90,4 +90,25 @@ export declare class SubagentTool implements AgentTool<typeof subagentSchema, Su
|
|
|
90
90
|
constructor(session: ToolSession);
|
|
91
91
|
execute(_toolCallId: string, params: SubagentParams, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<SubagentToolDetails>, _context?: AgentToolContext): Promise<AgentToolResult<SubagentToolDetails>>;
|
|
92
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Canonical, value-based rendered-state signature for the `subagent` await panel.
|
|
95
|
+
*
|
|
96
|
+
* Producer-side await gating compares this signature against the last emitted one
|
|
97
|
+
* and only fires `onUpdate` when the *rendered* state actually changed. Unchanged
|
|
98
|
+
* idle ticks therefore stop rebuilding the renderer component and stop mutating
|
|
99
|
+
* transcript lines above the viewport, which is what triggers TUI full-redraw
|
|
100
|
+
* storms (`tui.ts` `firstChanged < viewportTop`).
|
|
101
|
+
*
|
|
102
|
+
* It is deliberately value-based, never object identity: `AsyncJobManager.record-
|
|
103
|
+
* SubagentProgress` stores a `structuredClone` but `getSubagentProgress` returns
|
|
104
|
+
* the retained object by reference, so identity comparison would be both noisy and
|
|
105
|
+
* unsafe.
|
|
106
|
+
*
|
|
107
|
+
* Time-derived fields are intentionally excluded so the panel does not churn while
|
|
108
|
+
* idle: raw durations (`durationMs`), current-tool elapsed (`currentToolStartMs`),
|
|
109
|
+
* and retry countdowns (`retryState.startedAtMs`) are omitted. Idle duration and
|
|
110
|
+
* countdown ticking is sacrificed by design; every real transition still changes
|
|
111
|
+
* the signature.
|
|
112
|
+
*/
|
|
113
|
+
export declare function subagentAwaitRenderedStateSignature(subagents: readonly SubagentSnapshot[]): string;
|
|
93
114
|
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AgentTool } from "@gajae-code/agent-core";
|
|
2
|
+
import { type UltragoalAskBlockDiagnostic } from "../gjc-runtime/ultragoal-guard";
|
|
3
|
+
export declare function formatUltragoalAskBlockMessage(diagnostic: UltragoalAskBlockDiagnostic): string;
|
|
4
|
+
export declare function assertUltragoalAskAllowed(cwd: string): Promise<void>;
|
|
5
|
+
export declare function guardToolForUltragoalAsk<T extends AgentTool>(tool: T, getCwd: () => string): T;
|
|
@@ -10,7 +10,7 @@ import * as z from "zod/v4";
|
|
|
10
10
|
import type { CustomTool } from "../../extensibility/custom-tools/types";
|
|
11
11
|
import type { ToolSession } from "../../tools";
|
|
12
12
|
import { type SearchRenderDetails } from "./render";
|
|
13
|
-
import type { SearchProviderId } from "./types";
|
|
13
|
+
import type { ActiveSearchModelContext, SearchProviderId } from "./types";
|
|
14
14
|
/** Web search tool parameters schema */
|
|
15
15
|
export declare const webSearchSchema: z.ZodObject<{
|
|
16
16
|
query: z.ZodString;
|
|
@@ -40,7 +40,7 @@ export declare function runSearchQuery(params: SearchQueryParams, options?: {
|
|
|
40
40
|
authStorage?: AuthStorage;
|
|
41
41
|
sessionId?: string;
|
|
42
42
|
signal?: AbortSignal;
|
|
43
|
-
|
|
43
|
+
activeModelContext?: ActiveSearchModelContext;
|
|
44
44
|
}): Promise<{
|
|
45
45
|
content: Array<{
|
|
46
46
|
type: "text";
|
|
@@ -80,6 +80,6 @@ export declare class WebSearchTool implements AgentTool<typeof webSearchSchema,
|
|
|
80
80
|
/** Web search tool as CustomTool (for TUI rendering support) */
|
|
81
81
|
export declare const webSearchCustomTool: CustomTool<typeof webSearchSchema, SearchRenderDetails>;
|
|
82
82
|
export declare function getSearchTools(): CustomTool<any, any>[];
|
|
83
|
-
export { getSearchProvider, setPreferredSearchProvider } from "./provider";
|
|
83
|
+
export { getSearchProvider, setPreferredSearchProvider, setSearchFallbackProviders } from "./provider";
|
|
84
84
|
export type { SearchProviderId as SearchProvider, SearchResponse } from "./types";
|
|
85
|
-
export { isSearchProviderPreference } from "./types";
|
|
85
|
+
export { isConfigurableSearchProviderId, isSearchProviderPreference } from "./types";
|
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
import type { AuthStorage } from "@gajae-code/ai";
|
|
2
2
|
import type { SearchProvider } from "./providers/base";
|
|
3
|
-
import type { SearchProviderId } from "./types";
|
|
3
|
+
import type { ActiveSearchModelContext, SearchProviderId } from "./types";
|
|
4
4
|
export type { SearchParams } from "./providers/base";
|
|
5
5
|
export { SearchProvider } from "./providers/base";
|
|
6
|
-
/** Cheap, sync metadata accessor — never triggers a provider load. */
|
|
7
6
|
export declare function getSearchProviderLabel(id: SearchProviderId): string;
|
|
8
|
-
/**
|
|
9
|
-
* Resolve and cache a provider instance. First call for a given id loads the
|
|
10
|
-
* underlying module; subsequent calls return the cached singleton.
|
|
11
|
-
*/
|
|
12
7
|
export declare function getSearchProvider(id: SearchProviderId): Promise<SearchProvider>;
|
|
13
8
|
export declare const SEARCH_PROVIDER_ORDER: SearchProviderId[];
|
|
14
|
-
/** Set the preferred web search provider from settings */
|
|
15
9
|
export declare function setPreferredSearchProvider(provider: SearchProviderId | "auto"): void;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export declare function
|
|
10
|
+
export declare function setSearchFallbackProviders(ids: readonly string[]): void;
|
|
11
|
+
export interface ResolveProviderChainOptions {
|
|
12
|
+
authStorage: AuthStorage;
|
|
13
|
+
sessionId?: string;
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
preferredProvider?: SearchProviderId | "auto";
|
|
16
|
+
activeModelContext?: ActiveSearchModelContext;
|
|
17
|
+
fallbackProviders?: readonly SearchProviderId[];
|
|
18
|
+
}
|
|
19
|
+
export declare function looksHostedModelId(modelId: string | undefined): boolean;
|
|
20
|
+
export declare function isLocalBaseUrl(baseUrl: string | undefined): boolean;
|
|
21
|
+
export declare function inferNativeProviderFromModel(ctx: ActiveSearchModelContext | undefined): SearchProviderId | undefined;
|
|
22
|
+
export declare function canUseGenericCredentials(authStorage: AuthStorage, ctx: ActiveSearchModelContext | undefined, sessionId?: string, signal?: AbortSignal): Promise<boolean>;
|
|
23
|
+
export declare function shouldTryGenericOpenAICompat(authStorage: AuthStorage, ctx: ActiveSearchModelContext | undefined, sessionId?: string, signal?: AbortSignal): Promise<boolean>;
|
|
24
|
+
export declare function resolveProviderChain(options: ResolveProviderChainOptions): Promise<SearchProvider[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AuthStorage } from "@gajae-code/ai";
|
|
2
|
-
import type { SearchProviderId, SearchResponse } from "../types";
|
|
2
|
+
import type { ActiveSearchModelContext, SearchProviderId, SearchResponse } from "../types";
|
|
3
3
|
/**
|
|
4
4
|
* Shared web search parameters passed to providers.
|
|
5
5
|
*
|
|
@@ -49,6 +49,7 @@ export interface SearchParams {
|
|
|
49
49
|
* caller's agent session when available; otherwise omit.
|
|
50
50
|
*/
|
|
51
51
|
sessionId?: string;
|
|
52
|
+
activeModelContext?: ActiveSearchModelContext;
|
|
52
53
|
}
|
|
53
54
|
/** Base class for web search providers. */
|
|
54
55
|
export declare abstract class SearchProvider {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SearchResponse } from "../types";
|
|
2
|
+
import type { SearchParams } from "./base";
|
|
3
|
+
import { SearchProvider } from "./base";
|
|
4
|
+
export declare class OpenAICompatibleSearchProvider extends SearchProvider {
|
|
5
|
+
readonly id: "openai-compatible";
|
|
6
|
+
readonly label = "OpenAI-compatible";
|
|
7
|
+
isAvailable(): boolean;
|
|
8
|
+
search(params: SearchParams): Promise<SearchResponse>;
|
|
9
|
+
}
|
|
@@ -4,9 +4,21 @@
|
|
|
4
4
|
* Unified types for web search responses across supported providers.
|
|
5
5
|
*/
|
|
6
6
|
/** Supported web search providers */
|
|
7
|
-
export type SearchProviderId = "duckduckgo" | "exa" | "brave" | "jina" | "kimi" | "zai" | "anthropic" | "perplexity" | "gemini" | "codex" | "tavily" | "parallel" | "kagi" | "synthetic" | "searxng";
|
|
7
|
+
export type SearchProviderId = "duckduckgo" | "exa" | "brave" | "jina" | "kimi" | "zai" | "anthropic" | "perplexity" | "gemini" | "codex" | "tavily" | "parallel" | "kagi" | "synthetic" | "searxng" | "openai-compatible";
|
|
8
|
+
export type WebSearchMode = "on" | "off" | "auto";
|
|
9
|
+
export interface ActiveSearchModelContext {
|
|
10
|
+
provider: string;
|
|
11
|
+
modelId: string;
|
|
12
|
+
wireModelId?: string;
|
|
13
|
+
api: string;
|
|
14
|
+
baseUrl?: string;
|
|
15
|
+
headers?: Record<string, string>;
|
|
16
|
+
webSearch?: WebSearchMode;
|
|
17
|
+
}
|
|
18
|
+
export declare const CONFIGURABLE_SEARCH_PROVIDER_IDS: readonly ["duckduckgo", "exa", "brave", "jina", "kimi", "zai", "anthropic", "perplexity", "gemini", "codex", "tavily", "parallel", "kagi", "synthetic", "searxng"];
|
|
8
19
|
export declare function isSearchProviderId(value: string): value is SearchProviderId;
|
|
9
|
-
export declare function
|
|
20
|
+
export declare function isConfigurableSearchProviderId(value: string): value is (typeof CONFIGURABLE_SEARCH_PROVIDER_IDS)[number];
|
|
21
|
+
export declare function isSearchProviderPreference(value: string): value is (typeof CONFIGURABLE_SEARCH_PROVIDER_IDS)[number] | "auto";
|
|
10
22
|
/** Source returned by search (all providers) */
|
|
11
23
|
export interface SearchSource {
|
|
12
24
|
title: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@gajae-code/coding-agent",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.3",
|
|
5
5
|
"description": "Gajae Code CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://gaebal-gajae.dev",
|
|
7
7
|
"author": "Yeachan-Heo",
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
"@agentclientprotocol/sdk": "0.21.0",
|
|
52
52
|
"@babel/parser": "^7.29.3",
|
|
53
53
|
"@mozilla/readability": "^0.6.0",
|
|
54
|
-
"@gajae-code/stats": "0.5.
|
|
55
|
-
"@gajae-code/agent-core": "0.5.
|
|
56
|
-
"@gajae-code/ai": "0.5.
|
|
57
|
-
"@gajae-code/natives": "0.5.
|
|
58
|
-
"@gajae-code/tui": "0.5.
|
|
59
|
-
"@gajae-code/utils": "0.5.
|
|
54
|
+
"@gajae-code/stats": "0.5.3",
|
|
55
|
+
"@gajae-code/agent-core": "0.5.3",
|
|
56
|
+
"@gajae-code/ai": "0.5.3",
|
|
57
|
+
"@gajae-code/natives": "0.5.3",
|
|
58
|
+
"@gajae-code/tui": "0.5.3",
|
|
59
|
+
"@gajae-code/utils": "0.5.3",
|
|
60
60
|
"@puppeteer/browsers": "^2.13.0",
|
|
61
61
|
"@types/turndown": "5.0.6",
|
|
62
62
|
"@xterm/headless": "^6.0.0",
|
package/scripts/build-binary.ts
CHANGED
|
@@ -5,6 +5,12 @@ import * as path from "node:path";
|
|
|
5
5
|
const packageDir = path.join(import.meta.dir, "..");
|
|
6
6
|
const outputPath = path.join(packageDir, "dist", "gjc");
|
|
7
7
|
const nativeDir = path.join(packageDir, "..", "natives", "native");
|
|
8
|
+
// Lazy native tokenizer entrypoint. `agent-core/compaction` loads this from
|
|
9
|
+
// the explicit native entrypoint instead of a package-name dynamic require of
|
|
10
|
+
// `@gajae-code/natives`, because those fail inside Bun standalone `$bunfs`.
|
|
11
|
+
// Listing the module here makes the absolute target path exist in the compiled
|
|
12
|
+
// bunfs.
|
|
13
|
+
const nativeTokenizerEntrypoint = "../natives/native/index.js";
|
|
8
14
|
|
|
9
15
|
function shouldAdhocSignDarwinBinary(): boolean {
|
|
10
16
|
return process.platform === "darwin";
|
|
@@ -66,6 +72,7 @@ async function main(): Promise<void> {
|
|
|
66
72
|
"../stats/src/sync-worker.ts",
|
|
67
73
|
"./src/tools/browser/tab-worker-entry.ts",
|
|
68
74
|
"./src/eval/js/worker-entry.ts",
|
|
75
|
+
nativeTokenizerEntrypoint,
|
|
69
76
|
"--outfile",
|
|
70
77
|
"dist/gjc",
|
|
71
78
|
],
|