@gajae-code/coding-agent 0.17.4 → 0.17.5
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 +73 -0
- package/dist/types/config/autorouting-tier-map.d.ts +1031 -3
- package/dist/types/config/file-lock.d.ts +4 -2
- package/dist/types/config/model-registry.d.ts +3 -1
- package/dist/types/config/model-resolver.d.ts +1 -1
- package/dist/types/exec/bash-executor.d.ts +2 -0
- package/dist/types/extensibility/gjc-plugins/runtime-adapters.d.ts +11 -2
- package/dist/types/gjc-runtime/state-writer.d.ts +14 -1
- package/dist/types/harness-control-plane/control-endpoint.d.ts +4 -1
- package/dist/types/harness-control-plane/finalize.d.ts +14 -3
- package/dist/types/main.d.ts +1 -1
- package/dist/types/runtime-mcp/loader.d.ts +2 -0
- package/dist/types/runtime-mcp/manager.d.ts +13 -6
- package/dist/types/sdk/broker/broker.d.ts +4 -2
- package/dist/types/sdk/broker/ensure.d.ts +3 -0
- package/dist/types/sdk/broker/identity.d.ts +2 -0
- package/dist/types/sdk/broker/managed-task-dag.d.ts +1335 -0
- package/dist/types/sdk/broker/managed-task-verification.d.ts +37 -0
- package/dist/types/sdk/broker/spawn-authority.d.ts +8 -0
- package/dist/types/sdk/broker/startup-failure.d.ts +4 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +5 -1
- package/dist/types/sdk/prompt-deadline-flush.d.ts +2 -0
- package/dist/types/sdk/session.d.ts +3 -3
- package/dist/types/session/agent-session.d.ts +7 -2
- package/dist/types/task/types.d.ts +2 -0
- package/dist/types/tools/bash-interactive.d.ts +1 -0
- package/dist/types/tools/fetch.d.ts +10 -1
- package/dist/types/tools/subagent.d.ts +8 -1
- package/package.json +7 -7
- package/src/cli/public-command-registry.ts +8 -2
- package/src/cli/setup-cli.ts +1 -0
- package/src/cli/stats-cli.ts +11 -1
- package/src/config/autorouting-tier-map.ts +529 -3
- package/src/config/file-lock.ts +59 -14
- package/src/config/model-discovery-manager.ts +4 -4
- package/src/config/model-profile-activation.ts +83 -23
- package/src/config/model-registry.ts +72 -12
- package/src/config/model-resolver.ts +6 -1
- package/src/coordinator-mcp/question-state.ts +4 -1
- package/src/coordinator-mcp/server.ts +14 -6
- package/src/exec/bash-executor.ts +3 -0
- package/src/extensibility/gjc-plugins/runtime-adapters.ts +46 -8
- package/src/gjc-runtime/state-writer.ts +317 -6
- package/src/harness-control-plane/control-endpoint.ts +24 -6
- package/src/harness-control-plane/finalize.ts +312 -25
- package/src/harness-control-plane/owner.ts +323 -89
- package/src/internal-urls/docs-index.generated.ts +6 -4
- package/src/main.ts +69 -19
- package/src/modes/acp/acp-agent.ts +581 -37
- package/src/modes/components/gjc-bundle-settings.ts +21 -1
- package/src/modes/components/tool-status-header.ts +72 -6
- package/src/modes/controllers/runtime-mcp-command-controller.ts +1 -1
- package/src/runtime-mcp/loader.ts +6 -3
- package/src/runtime-mcp/manager.ts +177 -75
- package/src/sdk/broker/broker.ts +1057 -150
- package/src/sdk/broker/ensure.ts +21 -3
- package/src/sdk/broker/identity.ts +13 -0
- package/src/sdk/broker/managed-task-dag.ts +1927 -0
- package/src/sdk/broker/managed-task-verification.ts +642 -0
- package/src/sdk/broker/spawn-authority.ts +140 -7
- package/src/sdk/broker/startup-failure.ts +80 -1
- package/src/sdk/broker/transport.ts +1 -0
- package/src/sdk/bus/chat-daemon-control.ts +2 -2
- package/src/sdk/bus/index.ts +22 -6
- package/src/sdk/bus/telegram-daemon-contract.ts +5 -1
- package/src/sdk/cli/session-cli.ts +18 -0
- package/src/sdk/host/session-runtime.test.ts +46 -0
- package/src/sdk/host/session-runtime.ts +13 -6
- package/src/sdk/lifecycle/service.ts +2 -0
- package/src/sdk/prompt-deadline-flush.ts +26 -4
- package/src/sdk/session.ts +587 -115
- package/src/session/agent-session.ts +40 -12
- package/src/session/internal/managed-session-scope.ts +10 -0
- package/src/session/internal/managed-session-storage.ts +30 -1
- package/src/setup/provider-presets.json +2 -1
- package/src/slash-commands/builtin-registry.ts +1 -1
- package/src/task/executor.ts +46 -17
- package/src/task/types.ts +2 -0
- package/src/tools/bash-interactive.ts +2 -0
- package/src/tools/bash.ts +20 -0
- package/src/tools/fetch.ts +21 -5
- package/src/tools/subagent-render.ts +24 -1
- package/src/tools/subagent.ts +27 -1
- package/src/utils/mupdf.ts +11 -4
|
@@ -63,6 +63,8 @@ export interface PromptDeadlineFlushResult {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
export interface PromptDeadlineFlushOptions {
|
|
66
|
+
/** Active session's agent directory, used to keep volatile broker state out of the WIP commit. */
|
|
67
|
+
readonly agentDir?: string;
|
|
66
68
|
/**
|
|
67
69
|
* Whether the caller resolved `sdk.flushWorktreeOnDeadline` to `true` from a
|
|
68
70
|
* value the user actually wrote, rather than from the schema default. Only an
|
|
@@ -87,6 +89,23 @@ const UNMERGED_STATUS_CODES = new Set(["DD", "AU", "UD", "UA", "DU", "AA", "UU"]
|
|
|
87
89
|
|
|
88
90
|
const AUTOSAVE_PATHS = [":(top)**", ":(top,exclude).gjc/agents/**", ":(top,exclude).gjc/skills/**"] as const;
|
|
89
91
|
|
|
92
|
+
function autosavePaths(worktreeRoot: string, agentDir: string | undefined): readonly string[] {
|
|
93
|
+
if (!agentDir) return AUTOSAVE_PATHS;
|
|
94
|
+
const sdkDir = path.resolve(agentDir, "sdk");
|
|
95
|
+
const relativeSdkDir = path.relative(path.resolve(worktreeRoot), sdkDir);
|
|
96
|
+
if (
|
|
97
|
+
!relativeSdkDir ||
|
|
98
|
+
relativeSdkDir === ".." ||
|
|
99
|
+
relativeSdkDir.startsWith(`..${path.sep}`) ||
|
|
100
|
+
path.isAbsolute(relativeSdkDir)
|
|
101
|
+
)
|
|
102
|
+
return AUTOSAVE_PATHS;
|
|
103
|
+
// Git pathspecs always use `/`. Literal mode avoids interpreting special
|
|
104
|
+
// characters in an agent directory's name as pathspec patterns.
|
|
105
|
+
const pathspec = relativeSdkDir.split(path.sep).join("/");
|
|
106
|
+
return [...AUTOSAVE_PATHS, `:(top,exclude,literal)${pathspec}`];
|
|
107
|
+
}
|
|
108
|
+
|
|
90
109
|
type IndexSnapshot = Uint8Array | undefined;
|
|
91
110
|
|
|
92
111
|
async function snapshotIndex(indexPath: string): Promise<IndexSnapshot> {
|
|
@@ -159,6 +178,7 @@ export async function flushWorktreeOnPromptDeadline(
|
|
|
159
178
|
options?: AbortSignal | PromptDeadlineFlushOptions,
|
|
160
179
|
): Promise<PromptDeadlineFlushResult | undefined> {
|
|
161
180
|
const {
|
|
181
|
+
agentDir,
|
|
162
182
|
explicitOptIn = false,
|
|
163
183
|
isCurrent,
|
|
164
184
|
signal,
|
|
@@ -179,7 +199,8 @@ export async function flushWorktreeOnPromptDeadline(
|
|
|
179
199
|
);
|
|
180
200
|
return undefined;
|
|
181
201
|
}
|
|
182
|
-
const
|
|
202
|
+
const paths = autosavePaths(worktreeRoot, agentDir);
|
|
203
|
+
const statusText = await git.status(worktreeRoot, { pathspecs: paths, porcelainV1: true, signal: bound });
|
|
183
204
|
const summary = git.status.parse(statusText);
|
|
184
205
|
if (summary.staged + summary.unstaged + summary.untracked === 0) return undefined;
|
|
185
206
|
if (hasUnmergedPaths(statusText)) {
|
|
@@ -211,7 +232,7 @@ export async function flushWorktreeOnPromptDeadline(
|
|
|
211
232
|
() =>
|
|
212
233
|
autosave(
|
|
213
234
|
repository,
|
|
214
|
-
{ headState, headSha, indexPath, indexSnapshot, message: wipCommitMessage(branch), refName },
|
|
235
|
+
{ headState, headSha, indexPath, indexSnapshot, message: wipCommitMessage(branch), paths, refName },
|
|
215
236
|
bound,
|
|
216
237
|
isCurrent,
|
|
217
238
|
),
|
|
@@ -243,13 +264,14 @@ async function autosave(
|
|
|
243
264
|
indexPath: string;
|
|
244
265
|
indexSnapshot: IndexSnapshot;
|
|
245
266
|
message: string;
|
|
267
|
+
paths: readonly string[];
|
|
246
268
|
refName: string;
|
|
247
269
|
},
|
|
248
270
|
bound: AbortSignal,
|
|
249
271
|
isCurrent?: () => boolean,
|
|
250
272
|
): Promise<string | undefined> {
|
|
251
273
|
const worktreeRoot = repository.repoRoot;
|
|
252
|
-
const { headSha, headState, indexPath, indexSnapshot, message, refName } = target;
|
|
274
|
+
const { headSha, headState, indexPath, indexSnapshot, message, paths, refName } = target;
|
|
253
275
|
// Inside the git dir, never the worktree (where it would show up as untracked
|
|
254
276
|
// and be staged by our own `add -A`) and never /tmp (a different filesystem
|
|
255
277
|
// breaks git's rename-into-place).
|
|
@@ -277,7 +299,7 @@ async function autosave(
|
|
|
277
299
|
!sameBytes(await snapshotIndex(indexPath), indexSnapshot)
|
|
278
300
|
)
|
|
279
301
|
return undefined;
|
|
280
|
-
await git.stage.files(worktreeRoot,
|
|
302
|
+
await git.stage.files(worktreeRoot, paths, { env, signal: bound });
|
|
281
303
|
const tree = await git.writeTree(worktreeRoot, { env, signal: bound });
|
|
282
304
|
// `git status` counts paths git will not necessarily commit (a dirty
|
|
283
305
|
// submodule at the same SHA, for one). Without this an autosave could land
|