@gajae-code/coding-agent 0.7.10 → 0.7.11
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 +25 -0
- package/README.md +1 -1
- package/dist/types/config/keybindings.d.ts +11 -5
- package/dist/types/defaults/gjc-defaults.d.ts +7 -0
- package/dist/types/gjc-runtime/launch-tmux.d.ts +3 -0
- package/dist/types/gjc-runtime/ralplan-runtime.d.ts +3 -2
- package/dist/types/gjc-runtime/restricted-role-agent-bash.d.ts +1 -0
- package/dist/types/gjc-runtime/state-writer.d.ts +1 -0
- package/dist/types/modes/components/custom-editor.d.ts +2 -1
- package/dist/types/modes/components/skill-message.d.ts +1 -0
- package/dist/types/modes/controllers/command-controller.d.ts +1 -0
- package/dist/types/modes/controllers/input-controller.d.ts +4 -0
- package/dist/types/modes/interactive-mode.d.ts +1 -0
- package/dist/types/modes/prompt-action-autocomplete.d.ts +2 -0
- package/dist/types/modes/slash-command-visibility.d.ts +1 -0
- package/dist/types/modes/types.d.ts +1 -0
- package/dist/types/sdk.d.ts +1 -1
- package/dist/types/session/agent-session.d.ts +8 -5
- package/dist/types/slash-commands/types.d.ts +2 -0
- package/dist/types/utils/cmux-workspace.d.ts +30 -1
- package/dist/types/web/search/index.d.ts +3 -1
- package/dist/types/web/search/provider.d.ts +9 -0
- package/dist/types/web/search/providers/utils.d.ts +42 -13
- package/package.json +7 -7
- package/src/cli/update-cli.ts +24 -0
- package/src/cli/web-search-cli.ts +2 -5
- package/src/cli.ts +1 -1
- package/src/commands/launch.ts +1 -1
- package/src/commands/ralplan.ts +1 -0
- package/src/config/keybindings.ts +14 -5
- package/src/config/model-profiles.ts +16 -0
- package/src/coordinator-mcp/server.ts +9 -3
- package/src/defaults/gjc/skills/ralplan/SKILL.md +16 -14
- package/src/defaults/gjc-defaults.ts +16 -0
- package/src/extensibility/extensions/runner.ts +2 -1
- package/src/gjc-runtime/launch-tmux.ts +164 -42
- package/src/gjc-runtime/ralplan-runtime.ts +22 -6
- package/src/gjc-runtime/restricted-role-agent-bash.ts +1 -0
- package/src/gjc-runtime/state-runtime.ts +8 -5
- package/src/gjc-runtime/state-writer.ts +5 -5
- package/src/internal-urls/docs-index.generated.ts +5 -4
- package/src/main.ts +2 -2
- package/src/migrate/executor.ts +23 -6
- package/src/modes/components/custom-editor.ts +8 -0
- package/src/modes/components/model-selector.ts +6 -2
- package/src/modes/components/settings-selector.ts +0 -2
- package/src/modes/components/skill-message.ts +18 -10
- package/src/modes/controllers/command-controller.ts +23 -0
- package/src/modes/controllers/input-controller.ts +41 -9
- package/src/modes/interactive-mode.ts +16 -7
- package/src/modes/prompt-action-autocomplete.ts +23 -1
- package/src/modes/slash-command-visibility.ts +9 -0
- package/src/modes/types.ts +1 -0
- package/src/modes/utils/hotkeys-markdown.ts +5 -2
- package/src/modes/utils/ui-helpers.ts +76 -3
- package/src/notifications/telegram-daemon.ts +4 -4
- package/src/prompts/agents/architect.md +7 -4
- package/src/prompts/agents/critic.md +15 -6
- package/src/prompts/agents/planner.md +8 -3
- package/src/prompts/tools/bash.md +1 -1
- package/src/sdk.ts +3 -6
- package/src/session/agent-session.ts +60 -17
- package/src/slash-commands/builtin-registry.ts +30 -10
- package/src/slash-commands/types.ts +2 -0
- package/src/tools/bash.ts +24 -8
- package/src/utils/cmux-workspace.ts +134 -7
- package/src/utils/title-generator.ts +1 -1
- package/src/web/kagi.ts +1 -1
- package/src/web/parallel.ts +2 -2
- package/src/web/search/index.ts +118 -45
- package/src/web/search/provider.ts +65 -0
- package/src/web/search/providers/anthropic.ts +1 -1
- package/src/web/search/providers/brave.ts +1 -1
- package/src/web/search/providers/codex.ts +1 -1
- package/src/web/search/providers/duckduckgo.ts +1 -1
- package/src/web/search/providers/exa.ts +1 -1
- package/src/web/search/providers/gemini.ts +7 -3
- package/src/web/search/providers/jina.ts +1 -1
- package/src/web/search/providers/kimi.ts +6 -1
- package/src/web/search/providers/openai-compatible.ts +1 -1
- package/src/web/search/providers/parallel.ts +1 -1
- package/src/web/search/providers/perplexity.ts +2 -2
- package/src/web/search/providers/searxng.ts +1 -1
- package/src/web/search/providers/synthetic.ts +1 -1
- package/src/web/search/providers/tavily.ts +1 -1
- package/src/web/search/providers/utils.ts +67 -17
- package/src/web/search/providers/xai.ts +1 -1
- package/src/web/search/providers/zai.ts +1 -1
|
@@ -251,7 +251,7 @@ async function callPerplexityApi(
|
|
|
251
251
|
"Content-Type": "application/json",
|
|
252
252
|
},
|
|
253
253
|
body: JSON.stringify(request),
|
|
254
|
-
signal: withHardTimeout(signal),
|
|
254
|
+
signal: withHardTimeout(signal, "llm"),
|
|
255
255
|
});
|
|
256
256
|
|
|
257
257
|
if (!response.ok) {
|
|
@@ -370,7 +370,7 @@ async function callPerplexityOAuth(
|
|
|
370
370
|
skip_search_enabled: true,
|
|
371
371
|
},
|
|
372
372
|
}),
|
|
373
|
-
signal: withHardTimeout(params.signal),
|
|
373
|
+
signal: withHardTimeout(params.signal, "llm"),
|
|
374
374
|
});
|
|
375
375
|
|
|
376
376
|
if (!response.ok) {
|
|
@@ -96,7 +96,7 @@ async function callTavilySearch(apiKey: string, params: TavilySearchParams): Pro
|
|
|
96
96
|
Authorization: `Bearer ${apiKey}`,
|
|
97
97
|
},
|
|
98
98
|
body: JSON.stringify(buildRequestBody(params)),
|
|
99
|
-
signal: withHardTimeout(params.signal),
|
|
99
|
+
signal: withHardTimeout(params.signal, "api"),
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
if (!response.ok) {
|
|
@@ -44,38 +44,81 @@ export function findCredential(
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* Pure search APIs (brave, exa, jina, tavily, searxng, synthetic, zai)
|
|
53
|
-
* settle far faster in practice; reusing the same ceiling keeps the wiring
|
|
54
|
-
* uniform without compromising correctness.
|
|
47
|
+
* Legacy hard ceiling for a single web-search round-trip, retained as the
|
|
48
|
+
* fallback for call sites that do not declare a timeout class. 300s tolerates
|
|
49
|
+
* pathological cases while still guaranteeing the session unfreezes if Bun's
|
|
50
|
+
* `AbortSignal` fails to propagate on Windows.
|
|
55
51
|
*/
|
|
56
52
|
export const SEARCH_HARD_TIMEOUT_MS = 300_000;
|
|
57
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Hard ceiling for pure search APIs (brave, exa, jina, tavily, kagi,
|
|
56
|
+
* parallel, searxng, synthetic, zai, duckduckgo). These settle in ~1-3s in
|
|
57
|
+
* practice; a hung TCP/TLS connection should fall through to the next
|
|
58
|
+
* provider in seconds, not minutes. Kimi is the exception: it declares an
|
|
59
|
+
* explicit ceiling aligned with its upstream 30s request budget.
|
|
60
|
+
*/
|
|
61
|
+
export const SEARCH_API_TIMEOUT_MS = 15_000;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Hard ceiling for LLM-mediated search providers (anthropic, codex, gemini,
|
|
65
|
+
* perplexity, xai, openai-compatible). These legitimately take tens of
|
|
66
|
+
* seconds because a model performs the search and synthesizes an answer.
|
|
67
|
+
*/
|
|
68
|
+
export const SEARCH_LLM_TIMEOUT_MS = 120_000;
|
|
69
|
+
|
|
70
|
+
/** Timeout class a provider declares for its outbound round-trips. */
|
|
71
|
+
export type SearchTimeoutClass = "api" | "llm";
|
|
72
|
+
|
|
73
|
+
const TIMEOUT_CLASS_MS: Record<SearchTimeoutClass, number> = {
|
|
74
|
+
api: SEARCH_API_TIMEOUT_MS,
|
|
75
|
+
llm: SEARCH_LLM_TIMEOUT_MS,
|
|
76
|
+
};
|
|
77
|
+
|
|
58
78
|
/**
|
|
59
79
|
* Runtime-configurable hard timeout, seeded from the `web_search.timeout`
|
|
60
|
-
* setting via {@link setSearchHardTimeoutMs}.
|
|
61
|
-
*
|
|
80
|
+
* setting via {@link setSearchHardTimeoutMs}. When set, it overrides every
|
|
81
|
+
* class default so users keep a single knob. Unset means class defaults apply.
|
|
62
82
|
*/
|
|
63
|
-
let configuredHardTimeoutMs
|
|
83
|
+
let configuredHardTimeoutMs: number | undefined;
|
|
64
84
|
|
|
65
85
|
/**
|
|
66
86
|
* Override the hard timeout applied to every web-search round-trip.
|
|
67
87
|
*
|
|
68
88
|
* @param ms - Hard timeout in milliseconds. Non-finite or non-positive
|
|
69
|
-
* values
|
|
89
|
+
* values clear the override so per-class defaults apply.
|
|
70
90
|
*/
|
|
71
91
|
export function setSearchHardTimeoutMs(ms: number | undefined): void {
|
|
72
|
-
configuredHardTimeoutMs = typeof ms === "number" && Number.isFinite(ms) && ms > 0 ? ms :
|
|
92
|
+
configuredHardTimeoutMs = typeof ms === "number" && Number.isFinite(ms) && ms > 0 ? ms : undefined;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Structural settings source for {@link applyConfiguredSearchTimeout}. */
|
|
96
|
+
export interface SearchTimeoutSettingSource {
|
|
97
|
+
get(path: "web_search.timeout"): unknown;
|
|
98
|
+
has(path: "web_search.timeout"): boolean;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Install the `web_search.timeout` override from settings — but only when the
|
|
103
|
+
* user explicitly configured it. The settings schema ships a default value
|
|
104
|
+
* (300), and consuming that default via `get()` alone would reinstall a
|
|
105
|
+
* uniform 300s ceiling on every session, silently disabling the per-class
|
|
106
|
+
* timeout defaults. `has()` distinguishes loaded/overridden settings from
|
|
107
|
+
* schema defaults; unset clears any previous override so class defaults apply.
|
|
108
|
+
*/
|
|
109
|
+
export function applyConfiguredSearchTimeout(settings: SearchTimeoutSettingSource): void {
|
|
110
|
+
if (!settings.has("web_search.timeout")) {
|
|
111
|
+
setSearchHardTimeoutMs(undefined);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const value = settings.get("web_search.timeout");
|
|
115
|
+
setSearchHardTimeoutMs(typeof value === "number" && Number.isFinite(value) && value > 0 ? value * 1000 : undefined);
|
|
73
116
|
}
|
|
74
117
|
|
|
75
118
|
/**
|
|
76
119
|
* Compose a caller-supplied {@link AbortSignal} with a hard timeout so an
|
|
77
|
-
* outbound `fetch()` is guaranteed to settle
|
|
78
|
-
*
|
|
120
|
+
* outbound `fetch()` is guaranteed to settle even when the runtime fails to
|
|
121
|
+
* propagate cancellation to the underlying transport.
|
|
79
122
|
*
|
|
80
123
|
* Bun's WinHTTP backend on Windows is known to ignore `AbortSignal` once a
|
|
81
124
|
* TCP/TLS connection stalls (oven-sh/bun#15275, oven-sh/bun#18536); without
|
|
@@ -83,9 +126,16 @@ export function setSearchHardTimeoutMs(ms: number | undefined): void {
|
|
|
83
126
|
* because the user's Esc is never delivered to the native layer.
|
|
84
127
|
*
|
|
85
128
|
* @param signal - Caller cancellation signal, if any.
|
|
86
|
-
* @param
|
|
129
|
+
* @param msOrClass - Explicit timeout in milliseconds, or a
|
|
130
|
+
* {@link SearchTimeoutClass} resolved to its class default. Omitted falls
|
|
131
|
+
* back to the legacy {@link SEARCH_HARD_TIMEOUT_MS} ceiling. A user-set
|
|
132
|
+
* `web_search.timeout` overrides class defaults (but not explicit ms).
|
|
87
133
|
*/
|
|
88
|
-
export function withHardTimeout(signal: AbortSignal | undefined,
|
|
134
|
+
export function withHardTimeout(signal: AbortSignal | undefined, msOrClass?: number | SearchTimeoutClass): AbortSignal {
|
|
135
|
+
const ms =
|
|
136
|
+
typeof msOrClass === "number"
|
|
137
|
+
? msOrClass
|
|
138
|
+
: (configuredHardTimeoutMs ?? (msOrClass ? TIMEOUT_CLASS_MS[msOrClass] : SEARCH_HARD_TIMEOUT_MS));
|
|
89
139
|
const timeout = AbortSignal.timeout(ms);
|
|
90
140
|
return signal ? AbortSignal.any([signal, timeout]) : timeout;
|
|
91
141
|
}
|
|
@@ -441,7 +441,7 @@ export async function searchXai(params: XaiSearchParams): Promise<SearchResponse
|
|
|
441
441
|
noInlineCitations: params.no_inline_citations,
|
|
442
442
|
}),
|
|
443
443
|
),
|
|
444
|
-
signal: withHardTimeout(params.signal),
|
|
444
|
+
signal: withHardTimeout(params.signal, "llm"),
|
|
445
445
|
});
|
|
446
446
|
|
|
447
447
|
const text = await response.text();
|