@gajae-code/coding-agent 0.12.10 → 0.12.12
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 +47 -2
- package/dist/types/cli/notify-cli.d.ts +42 -1
- package/dist/types/cli/update-cli.d.ts +9 -3
- package/dist/types/commands/notify.d.ts +6 -0
- package/dist/types/config/file-lock.d.ts +3 -0
- package/dist/types/coordinator/contract.d.ts +1 -1
- package/dist/types/coordinator-mcp/question-state.d.ts +3 -1
- package/dist/types/extensibility/extensions/index.d.ts +1 -0
- package/dist/types/extensibility/extensions/ouroboros-ooo-bridge.d.ts +13 -0
- package/dist/types/extensibility/extensions/prefix-command-bridge.d.ts +0 -1
- package/dist/types/extensibility/extensions/types.d.ts +2 -0
- package/dist/types/main.d.ts +6 -2
- package/dist/types/modes/components/session-selector.d.ts +1 -1
- package/dist/types/modes/utils/host-status.d.ts +23 -0
- package/dist/types/runtime-mcp/types.d.ts +2 -0
- package/dist/types/sdk/broker/lifecycle.d.ts +12 -0
- package/dist/types/sdk/bus/chat-daemon-cli.d.ts +3 -0
- package/dist/types/sdk/bus/chat-daemon-command-channel.d.ts +244 -0
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +13 -1
- package/dist/types/sdk/bus/chat-daemon-runtime.d.ts +7 -0
- package/dist/types/sdk/bus/control-plane-frames.d.ts +43 -0
- package/dist/types/sdk/bus/conversation-store.d.ts +18 -0
- package/dist/types/sdk/bus/existing-thread-readiness.d.ts +71 -0
- package/dist/types/sdk/bus/notification-service.d.ts +10 -0
- package/dist/types/sdk/bus/slack-daemon.d.ts +27 -0
- package/dist/types/sdk/bus/slack-live-provider.d.ts +11 -0
- package/dist/types/sdk/bus/slack-provider.d.ts +14 -0
- package/dist/types/sdk/bus/slack-thread-binding.d.ts +140 -0
- package/dist/types/sdk/bus/telegram-daemon-cli.d.ts +2 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +25 -7
- package/dist/types/sdk/bus/telegram-daemon.d.ts +104 -16
- package/dist/types/sdk/bus/telegram-reference.d.ts +10 -1
- package/dist/types/sdk/bus/topic-registry.d.ts +130 -85
- package/dist/types/sdk/host/host.d.ts +52 -0
- package/dist/types/sdk/lifecycle-session.d.ts +6 -0
- package/dist/types/sdk/session-activation.d.ts +41 -0
- package/dist/types/sdk/session.d.ts +18 -0
- package/dist/types/sdk/startup-capability.d.ts +8 -1
- package/dist/types/session/agent-session.d.ts +7 -0
- package/dist/types/session/artifacts.d.ts +2 -2
- package/dist/types/session/internal/managed-session-storage.d.ts +12 -2
- package/dist/types/session/session-manager.d.ts +40 -5
- package/dist/types/session/session-storage.d.ts +1 -0
- package/dist/types/tools/computer.d.ts +35 -2
- package/dist/types/tools/index.d.ts +8 -0
- package/dist/types/tools/todo-write.d.ts +2 -0
- package/dist/types/utils/npm-registry.d.ts +71 -0
- package/examples/extensions/README.md +38 -4
- package/examples/extensions/ooo-bridge.ts +15 -0
- package/package.json +8 -8
- package/scripts/generate-sdk-operation-inventory.ts +4 -0
- package/src/async/job-manager.ts +9 -2
- package/src/cli/notify-cli.ts +226 -2
- package/src/cli/update-cli.ts +90 -23
- package/src/commands/notify.ts +27 -3
- package/src/commands/sdk.ts +1 -0
- package/src/config/file-lock-gc.ts +18 -0
- package/src/config/file-lock.ts +61 -16
- package/src/config/model-profiles.ts +31 -15
- package/src/coordinator/contract.ts +1 -0
- package/src/coordinator-mcp/question-state.ts +2 -0
- package/src/coordinator-mcp/server.ts +358 -7
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +2 -0
- package/src/extensibility/extensions/index.ts +1 -0
- package/src/extensibility/extensions/ouroboros-ooo-bridge.ts +235 -0
- package/src/extensibility/extensions/prefix-command-bridge.ts +4 -9
- package/src/extensibility/extensions/runner.ts +15 -2
- package/src/extensibility/extensions/types.ts +2 -0
- package/src/gjc-runtime/launch-tmux.ts +53 -1
- package/src/internal-urls/docs-index.generated.ts +13 -12
- package/src/main.ts +203 -67
- package/src/modes/DESIGN.md +8 -5
- package/src/modes/components/footer.ts +10 -18
- package/src/modes/components/session-selector.ts +26 -3
- package/src/modes/components/status-line/gh.ts +23 -2
- package/src/modes/controllers/event-controller.ts +3 -0
- package/src/modes/controllers/extension-ui-controller.ts +2 -0
- package/src/modes/controllers/input-controller.ts +11 -0
- package/src/modes/controllers/selector-controller.ts +8 -2
- package/src/modes/interactive-mode.ts +7 -1
- package/src/modes/utils/host-status.ts +38 -0
- package/src/prompts/tools/computer.md +6 -1
- package/src/runtime-mcp/types.ts +2 -0
- package/src/sdk/broker/lifecycle.ts +60 -3
- package/src/sdk/bus/chat-daemon-cli.ts +42 -0
- package/src/sdk/bus/chat-daemon-command-channel.ts +921 -0
- package/src/sdk/bus/chat-daemon-control.ts +18 -3
- package/src/sdk/bus/chat-daemon-runtime.ts +257 -21
- package/src/sdk/bus/control-plane-frames.ts +51 -0
- package/src/sdk/bus/conversation-store.ts +29 -1
- package/src/sdk/bus/existing-thread-readiness.ts +155 -0
- package/src/sdk/bus/index.ts +70 -0
- package/src/sdk/bus/notification-service.ts +28 -1
- package/src/sdk/bus/rich-render.ts +3 -2
- package/src/sdk/bus/slack-daemon.ts +99 -4
- package/src/sdk/bus/slack-live-provider.ts +32 -2
- package/src/sdk/bus/slack-provider.ts +11 -0
- package/src/sdk/bus/slack-thread-binding.ts +641 -0
- package/src/sdk/bus/telegram-daemon-cli.ts +11 -0
- package/src/sdk/bus/telegram-daemon-contract.ts +25 -7
- package/src/sdk/bus/telegram-daemon.ts +1961 -497
- package/src/sdk/bus/telegram-reference.ts +42 -6
- package/src/sdk/bus/topic-registry.ts +674 -181
- package/src/sdk/host/host.ts +180 -1
- package/src/sdk/lifecycle-session.ts +8 -2
- package/src/sdk/protocol/operation-inventory.generated.json +22 -0
- package/src/sdk/session-activation.ts +127 -0
- package/src/sdk/session.ts +139 -28
- package/src/sdk/startup-capability.ts +10 -1
- package/src/session/agent-session.ts +331 -30
- package/src/session/artifacts.ts +56 -13
- package/src/session/internal/managed-session-storage.ts +440 -243
- package/src/session/session-manager.ts +288 -44
- package/src/session/session-storage.ts +3 -0
- package/src/setup/provider-presets.json +1 -1
- package/src/task/index.ts +92 -44
- package/src/tools/computer.ts +322 -45
- package/src/tools/index.ts +8 -0
- package/src/tools/todo-write.ts +29 -11
- package/src/utils/npm-registry.ts +660 -0
package/src/session/artifacts.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
ensureManagedDirectory,
|
|
14
14
|
type ManagedSessionDescendantStore,
|
|
15
15
|
publishManagedFileNoReplace,
|
|
16
|
+
publishManagedFileNoReplaceSync,
|
|
16
17
|
} from "./internal/managed-session-storage";
|
|
17
18
|
import { DEFAULT_ARTIFACT_MAX_BYTES, truncateHeadBytes } from "./streaming-output";
|
|
18
19
|
|
|
@@ -78,7 +79,8 @@ export class ArtifactManager {
|
|
|
78
79
|
readonly #dir: string;
|
|
79
80
|
readonly #store: ManagedSessionDescendantStore | undefined;
|
|
80
81
|
#dirCreated = false;
|
|
81
|
-
#initialized
|
|
82
|
+
#initialized: Promise<void> | undefined;
|
|
83
|
+
#initializedComplete = false;
|
|
82
84
|
|
|
83
85
|
/**
|
|
84
86
|
* @param dir Directory that will hold artifact files. Created lazily on first save.
|
|
@@ -118,10 +120,10 @@ export class ArtifactManager {
|
|
|
118
120
|
else ensureManagedDirectory(this.#dir);
|
|
119
121
|
this.#dirCreated = true;
|
|
120
122
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
// Memoized: concurrent first writers must not each rescan and restart the
|
|
124
|
+
// ID counter at the same value, which would collide on publish.
|
|
125
|
+
this.#initialized ??= this.#scanExistingIds();
|
|
126
|
+
await this.#initialized;
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
#filename(id: string, toolType: string): string {
|
|
@@ -129,6 +131,44 @@ export class ArtifactManager {
|
|
|
129
131
|
return `${id}.${toolType}.log`;
|
|
130
132
|
}
|
|
131
133
|
|
|
134
|
+
#claimFilename(id: number): string {
|
|
135
|
+
return `.artifact-id-${id}`;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
#nextCandidateId(): number {
|
|
139
|
+
const id = this.#nextId++;
|
|
140
|
+
if (!Number.isSafeInteger(id) || id < 0) throw new Error("artifact_id_out_of_range");
|
|
141
|
+
return id;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
async #claimNextId(): Promise<number> {
|
|
145
|
+
while (true) {
|
|
146
|
+
const id = this.#nextCandidateId();
|
|
147
|
+
try {
|
|
148
|
+
await this.#publish("", this.#claimFilename(id));
|
|
149
|
+
return id;
|
|
150
|
+
} catch (error) {
|
|
151
|
+
if (!(error instanceof Error) || error.message !== "destination_conflict") throw error;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
#claimNextIdSync(): number {
|
|
157
|
+
if (!this.#initializedComplete)
|
|
158
|
+
throw new Error("ArtifactManager must be initialized before synchronous allocation");
|
|
159
|
+
while (true) {
|
|
160
|
+
const id = this.#nextCandidateId();
|
|
161
|
+
try {
|
|
162
|
+
const filename = this.#claimFilename(id);
|
|
163
|
+
if (this.#store) this.#store.publishNoReplaceSync(filename, new Uint8Array());
|
|
164
|
+
else publishManagedFileNoReplaceSync(path.join(this.#dir, filename), new Uint8Array());
|
|
165
|
+
return id;
|
|
166
|
+
} catch (error) {
|
|
167
|
+
if (!(error instanceof Error) || error.message !== "destination_conflict") throw error;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
132
172
|
async #publish(content: string, filename: string): Promise<void> {
|
|
133
173
|
if (this.#store) await this.#store.publishNoReplace(filename, Buffer.from(content, "utf8"));
|
|
134
174
|
else await publishManagedFileNoReplace(path.join(this.#dir, filename), Buffer.from(content, "utf8"));
|
|
@@ -250,22 +290,25 @@ export class ArtifactManager {
|
|
|
250
290
|
const files = await this.listFiles();
|
|
251
291
|
let maxId = -1;
|
|
252
292
|
for (const file of files) {
|
|
253
|
-
//
|
|
254
|
-
|
|
293
|
+
// Published artifacts are `{id}.{toolType}.log`; hidden claim files reserve
|
|
294
|
+
// the numeric namespace across independent managers and processes.
|
|
295
|
+
const match = file.match(/^(\d+)\..*\.log$/) ?? file.match(/^\.artifact-id-(\d+)$/);
|
|
255
296
|
if (match) {
|
|
256
|
-
const id =
|
|
297
|
+
const id = Number(match[1]);
|
|
298
|
+
if (!Number.isSafeInteger(id) || id < 0) throw new Error("artifact_id_out_of_range");
|
|
257
299
|
if (id > maxId) maxId = id;
|
|
258
300
|
}
|
|
259
301
|
}
|
|
260
302
|
this.#nextId = maxId + 1;
|
|
303
|
+
this.#initializedComplete = true;
|
|
261
304
|
}
|
|
262
305
|
|
|
263
306
|
/**
|
|
264
|
-
* Atomically
|
|
265
|
-
*
|
|
307
|
+
* Atomically claim the next artifact ID after this manager has been initialized.
|
|
308
|
+
* Prefer `allocatePath` or `save`; this synchronous seam exists for pruning callbacks.
|
|
266
309
|
*/
|
|
267
310
|
allocateId(): number {
|
|
268
|
-
return this.#
|
|
311
|
+
return this.#claimNextIdSync();
|
|
269
312
|
}
|
|
270
313
|
|
|
271
314
|
/**
|
|
@@ -276,7 +319,7 @@ export class ArtifactManager {
|
|
|
276
319
|
*/
|
|
277
320
|
async allocatePath(toolType: string): Promise<{ id: string; path?: string }> {
|
|
278
321
|
await this.#ensureDir();
|
|
279
|
-
const id = String(this
|
|
322
|
+
const id = String(await this.#claimNextId());
|
|
280
323
|
if (this.#store) return { id };
|
|
281
324
|
return { id, path: path.join(this.#dir, this.#filename(id, toolType)) };
|
|
282
325
|
}
|
|
@@ -288,7 +331,7 @@ export class ArtifactManager {
|
|
|
288
331
|
*/
|
|
289
332
|
async save(content: string, toolType: string, options: ArtifactSaveOptions = {}): Promise<string> {
|
|
290
333
|
await this.#ensureDir();
|
|
291
|
-
const id = String(this
|
|
334
|
+
const id = String(await this.#claimNextId());
|
|
292
335
|
const maxBytes = Math.max(0, options.maxBytes ?? DEFAULT_ARTIFACT_MAX_BYTES);
|
|
293
336
|
const contentBytes = Buffer.byteLength(content, "utf-8");
|
|
294
337
|
const published =
|