@gajae-code/coding-agent 0.4.4 → 0.5.0
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 +83 -0
- package/dist/types/cli/fast-help.d.ts +1 -0
- package/dist/types/cli/setup-cli.d.ts +2 -0
- package/dist/types/commands/harness.d.ts +6 -0
- package/dist/types/commands/setup.d.ts +6 -0
- package/dist/types/config/model-profile-activation.d.ts +11 -2
- package/dist/types/config/model-profiles.d.ts +7 -0
- package/dist/types/config/model-registry.d.ts +6 -0
- package/dist/types/config/model-resolver.d.ts +2 -0
- package/dist/types/config/models-config-schema.d.ts +35 -0
- package/dist/types/config/settings-schema.d.ts +4 -3
- package/dist/types/coordinator/contract.d.ts +1 -1
- package/dist/types/coordinator-mcp/server.d.ts +8 -2
- package/dist/types/gjc-runtime/team-runtime.d.ts +0 -1
- package/dist/types/gjc-runtime/tmux-common.d.ts +3 -0
- package/dist/types/harness-control-plane/finalize.d.ts +5 -0
- package/dist/types/harness-control-plane/owner.d.ts +1 -1
- package/dist/types/harness-control-plane/phase-rollup.d.ts +23 -0
- package/dist/types/harness-control-plane/receipt-ingest.d.ts +19 -0
- package/dist/types/harness-control-plane/receipt-spool.d.ts +19 -0
- package/dist/types/harness-control-plane/receipts.d.ts +46 -0
- package/dist/types/harness-control-plane/rpc-adapter.d.ts +3 -0
- package/dist/types/harness-control-plane/state-machine.d.ts +6 -1
- package/dist/types/harness-control-plane/types.d.ts +13 -1
- package/dist/types/hindsight/mental-models.d.ts +5 -5
- package/dist/types/main.d.ts +2 -2
- package/dist/types/modes/components/model-selector.d.ts +1 -12
- package/dist/types/modes/rpc/rpc-client.d.ts +2 -2
- package/dist/types/modes/rpc/rpc-types.d.ts +4 -1
- package/dist/types/modes/utils/abort-message.d.ts +4 -0
- package/dist/types/sdk.d.ts +5 -0
- package/dist/types/session/agent-session.d.ts +2 -0
- package/dist/types/session/blob-store.d.ts +20 -1
- package/dist/types/session/session-manager.d.ts +32 -6
- package/dist/types/session/streaming-output.d.ts +3 -2
- package/dist/types/session/tool-choice-queue.d.ts +6 -0
- package/dist/types/setup/hermes-setup.d.ts +7 -0
- package/dist/types/task/fork-context-advisory.d.ts +13 -0
- package/dist/types/task/receipt.d.ts +2 -0
- package/dist/types/task/roi-reconciliation.d.ts +27 -0
- package/dist/types/task/types.d.ts +17 -0
- package/dist/types/thinking-metadata.d.ts +16 -0
- package/dist/types/thinking.d.ts +3 -12
- package/dist/types/tools/index.d.ts +2 -0
- package/dist/types/tools/resolve.d.ts +0 -10
- package/dist/types/utils/tool-choice.d.ts +14 -1
- package/package.json +8 -7
- package/scripts/build-binary.ts +4 -0
- package/src/cli/fast-help.ts +80 -0
- package/src/cli/setup-cli.ts +12 -3
- package/src/cli.ts +112 -17
- package/src/commands/coordinator.ts +44 -1
- package/src/commands/harness.ts +128 -11
- package/src/commands/launch.ts +2 -2
- package/src/commands/mcp-serve.ts +3 -2
- package/src/commands/session.ts +3 -1
- package/src/commands/setup.ts +4 -0
- package/src/config/model-profile-activation.ts +15 -3
- package/src/config/model-profiles.ts +255 -56
- package/src/config/model-resolver.ts +9 -6
- package/src/config/models-config-schema.ts +2 -0
- package/src/config/settings-schema.ts +6 -3
- package/src/coordinator/contract.ts +1 -0
- package/src/coordinator-mcp/server.ts +427 -193
- package/src/cursor.ts +46 -4
- package/src/defaults/gjc/skills/team/SKILL.md +3 -2
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +8 -2
- package/src/export/html/index.ts +13 -9
- package/src/gjc-runtime/launch-worktree.ts +12 -1
- package/src/gjc-runtime/session-state-sidecar.ts +38 -0
- package/src/gjc-runtime/team-runtime.ts +33 -7
- package/src/gjc-runtime/tmux-common.ts +15 -0
- package/src/gjc-runtime/tmux-sessions.ts +19 -11
- package/src/gjc-runtime/ultragoal-runtime.ts +505 -41
- package/src/gjc-runtime/workflow-manifest.generated.json +27 -1
- package/src/gjc-runtime/workflow-manifest.ts +16 -1
- package/src/harness-control-plane/finalize.ts +39 -5
- package/src/harness-control-plane/owner.ts +87 -28
- package/src/harness-control-plane/phase-rollup.ts +96 -0
- package/src/harness-control-plane/receipt-ingest.ts +127 -0
- package/src/harness-control-plane/receipt-spool.ts +128 -0
- package/src/harness-control-plane/receipts.ts +229 -1
- package/src/harness-control-plane/rpc-adapter.ts +8 -0
- package/src/harness-control-plane/state-machine.ts +27 -6
- package/src/harness-control-plane/storage.ts +23 -0
- package/src/harness-control-plane/types.ts +33 -1
- package/src/hindsight/mental-models.ts +17 -16
- package/src/internal-urls/docs-index.generated.ts +8 -7
- package/src/main.ts +7 -3
- package/src/modes/components/assistant-message.ts +26 -14
- package/src/modes/components/diff.ts +97 -0
- package/src/modes/components/model-selector.ts +353 -181
- package/src/modes/components/status-line.ts +6 -6
- package/src/modes/components/tool-execution.ts +30 -13
- package/src/modes/controllers/event-controller.ts +5 -4
- package/src/modes/controllers/selector-controller.ts +33 -42
- package/src/modes/interactive-mode.ts +4 -5
- package/src/modes/print-mode.ts +1 -1
- package/src/modes/rpc/rpc-client.ts +3 -2
- package/src/modes/rpc/rpc-mode.ts +44 -14
- package/src/modes/rpc/rpc-types.ts +5 -2
- package/src/modes/shared/agent-wire/command-dispatch.ts +10 -5
- package/src/modes/shared/agent-wire/command-validation.ts +11 -0
- package/src/modes/theme/theme.ts +2 -2
- package/src/modes/utils/abort-message.ts +41 -0
- package/src/modes/utils/context-usage.ts +15 -8
- package/src/modes/utils/ui-helpers.ts +5 -6
- package/src/sdk.ts +38 -6
- package/src/secrets/obfuscator.ts +102 -27
- package/src/session/agent-session.ts +121 -25
- package/src/session/blob-store.ts +89 -3
- package/src/session/session-manager.ts +328 -57
- package/src/session/streaming-output.ts +185 -122
- package/src/session/tool-choice-queue.ts +23 -0
- package/src/setup/hermes/templates/operator-instructions.v1.md +3 -2
- package/src/setup/hermes-setup.ts +63 -8
- package/src/task/executor.ts +69 -6
- package/src/task/fork-context-advisory.ts +99 -0
- package/src/task/index.ts +31 -2
- package/src/task/receipt.ts +7 -0
- package/src/task/render.ts +21 -1
- package/src/task/roi-reconciliation.ts +90 -0
- package/src/task/types.ts +15 -0
- package/src/thinking-metadata.ts +51 -0
- package/src/thinking.ts +26 -46
- package/src/tools/bash.ts +1 -1
- package/src/tools/index.ts +4 -2
- package/src/tools/resolve.ts +93 -18
- package/src/tools/subagent-render.ts +10 -1
- package/src/utils/edit-mode.ts +1 -1
- package/src/utils/title-generator.ts +16 -2
- package/src/utils/tool-choice.ts +45 -16
|
@@ -95,6 +95,77 @@ export class BlobStore {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
export class EphemeralBlobStore extends BlobStore {
|
|
99
|
+
/**
|
|
100
|
+
* Bounded LRU byte budget for the in-memory buffer cache. Keeps recent
|
|
101
|
+
* resident blobs hot for rematerialization after the weak materialized
|
|
102
|
+
* view is collected, without re-pinning the whole session in RAM.
|
|
103
|
+
*/
|
|
104
|
+
static readonly #BUFFER_CACHE_MAX_BYTES = 8 * 1024 * 1024;
|
|
105
|
+
|
|
106
|
+
#bufferCache = new Map<string, Buffer>();
|
|
107
|
+
#bufferCacheBytes = 0;
|
|
108
|
+
|
|
109
|
+
constructor(dir: string) {
|
|
110
|
+
super(dir);
|
|
111
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
112
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
#cachePut(hash: string, data: Buffer): void {
|
|
116
|
+
const existing = this.#bufferCache.get(hash);
|
|
117
|
+
if (existing) {
|
|
118
|
+
this.#bufferCache.delete(hash);
|
|
119
|
+
this.#bufferCacheBytes -= existing.byteLength;
|
|
120
|
+
}
|
|
121
|
+
if (data.byteLength > EphemeralBlobStore.#BUFFER_CACHE_MAX_BYTES) return;
|
|
122
|
+
this.#bufferCache.set(hash, data);
|
|
123
|
+
this.#bufferCacheBytes += data.byteLength;
|
|
124
|
+
for (const [oldHash, oldData] of this.#bufferCache) {
|
|
125
|
+
if (this.#bufferCacheBytes <= EphemeralBlobStore.#BUFFER_CACHE_MAX_BYTES) break;
|
|
126
|
+
this.#bufferCache.delete(oldHash);
|
|
127
|
+
this.#bufferCacheBytes -= oldData.byteLength;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
putSync(data: Buffer): BlobPutResult {
|
|
132
|
+
const result = super.putSync(data);
|
|
133
|
+
this.#cachePut(result.hash, Buffer.from(data));
|
|
134
|
+
return result;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
getSync(hash: string): Buffer | null {
|
|
138
|
+
const cached = this.#bufferCache.get(hash);
|
|
139
|
+
if (cached) {
|
|
140
|
+
const blobPath = path.join(this.dir, hash);
|
|
141
|
+
if (fs.existsSync(blobPath)) {
|
|
142
|
+
// Refresh LRU recency on hit.
|
|
143
|
+
this.#bufferCache.delete(hash);
|
|
144
|
+
this.#bufferCache.set(hash, cached);
|
|
145
|
+
return Buffer.from(cached);
|
|
146
|
+
}
|
|
147
|
+
this.#bufferCache.delete(hash);
|
|
148
|
+
this.#bufferCacheBytes -= cached.byteLength;
|
|
149
|
+
}
|
|
150
|
+
const data = super.getSync(hash);
|
|
151
|
+
if (data) this.#cachePut(hash, Buffer.from(data));
|
|
152
|
+
return data;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
clear(): void {
|
|
156
|
+
this.#bufferCache.clear();
|
|
157
|
+
this.#bufferCacheBytes = 0;
|
|
158
|
+
fs.rmSync(this.dir, { recursive: true, force: true });
|
|
159
|
+
fs.mkdirSync(this.dir, { recursive: true });
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
dispose(): void {
|
|
163
|
+
this.#bufferCache.clear();
|
|
164
|
+
this.#bufferCacheBytes = 0;
|
|
165
|
+
fs.rmSync(this.dir, { recursive: true, force: true });
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
98
169
|
export class MemoryBlobStore extends BlobStore {
|
|
99
170
|
#blobs = new Map<string, Buffer>();
|
|
100
171
|
|
|
@@ -132,6 +203,18 @@ export class MemoryBlobStore extends BlobStore {
|
|
|
132
203
|
}
|
|
133
204
|
}
|
|
134
205
|
|
|
206
|
+
export class ResidentBlobMissingError extends Error {
|
|
207
|
+
constructor(
|
|
208
|
+
readonly hash: string,
|
|
209
|
+
readonly kind: "text" | "imageUrl" | "imageData",
|
|
210
|
+
readonly sessionId?: string,
|
|
211
|
+
readonly sessionFile?: string,
|
|
212
|
+
) {
|
|
213
|
+
super(`Missing resident ${kind} blob: ${hash}`);
|
|
214
|
+
this.name = "ResidentBlobMissingError";
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
135
218
|
/** Check if a data string is a blob reference. */
|
|
136
219
|
export function isBlobRef(data: string): boolean {
|
|
137
220
|
return data.startsWith(BLOB_PREFIX);
|
|
@@ -240,13 +323,16 @@ export function resolveImageDataSync(blobStore: BlobStore, data: string): string
|
|
|
240
323
|
}
|
|
241
324
|
|
|
242
325
|
/** Synchronously resolve a blob reference back to utf8 text. */
|
|
243
|
-
export function resolveTextBlobSync(
|
|
326
|
+
export function resolveTextBlobSync(
|
|
327
|
+
blobStore: BlobStore,
|
|
328
|
+
data: string,
|
|
329
|
+
context?: { kind?: "text"; sessionId?: string; sessionFile?: string },
|
|
330
|
+
): string {
|
|
244
331
|
const hash = parseBlobRef(data);
|
|
245
332
|
if (!hash) return data;
|
|
246
333
|
const buffer = blobStore.getSync(hash);
|
|
247
334
|
if (!buffer) {
|
|
248
|
-
|
|
249
|
-
return data;
|
|
335
|
+
throw new ResidentBlobMissingError(hash, context?.kind ?? "text", context?.sessionId, context?.sessionFile);
|
|
250
336
|
}
|
|
251
337
|
return buffer.toString("utf8");
|
|
252
338
|
}
|