@sayknow-cli/coding-agent 0.2.7 → 0.3.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 +20 -0
- package/dist/types/async/job-manager.d.ts +3 -1
- package/dist/types/cli/daemon-cli.d.ts +25 -0
- package/dist/types/cli/notify-cli.d.ts +23 -0
- package/dist/types/cli/setup-cli.d.ts +20 -1
- package/dist/types/commands/daemon.d.ts +41 -0
- package/dist/types/commands/notify.d.ts +41 -0
- package/dist/types/config/model-profile-activation.d.ts +12 -0
- package/dist/types/config/model-profiles.d.ts +2 -1
- package/dist/types/config/model-registry.d.ts +3 -3
- package/dist/types/config/models-config-schema.d.ts +5 -0
- package/dist/types/config/settings-schema.d.ts +38 -0
- package/dist/types/coordinator/contract.d.ts +1 -1
- package/dist/types/daemon/builtin.d.ts +20 -0
- package/dist/types/daemon/control-types.d.ts +57 -0
- package/dist/types/daemon/runtime.d.ts +25 -0
- package/dist/types/defaults/skc-defaults.d.ts +13 -2
- package/dist/types/extensibility/extensions/types.d.ts +8 -0
- package/dist/types/modes/components/oauth-selector.d.ts +2 -0
- package/dist/types/modes/controllers/selector-controller.d.ts +2 -2
- package/dist/types/modes/interactive-mode.d.ts +1 -1
- package/dist/types/modes/shared/agent-wire/unattended-session.d.ts +10 -0
- package/dist/types/modes/types.d.ts +7 -1
- package/dist/types/notifications/config-commands.d.ts +26 -0
- package/dist/types/notifications/config.d.ts +61 -0
- package/dist/types/notifications/helpers.d.ts +55 -0
- package/dist/types/notifications/html-format.d.ts +62 -0
- package/dist/types/notifications/index.d.ts +28 -0
- package/dist/types/notifications/rate-limit-pool.d.ts +93 -0
- package/dist/types/notifications/telegram-cli.d.ts +19 -0
- package/dist/types/notifications/telegram-daemon-cli.d.ts +11 -0
- package/dist/types/notifications/telegram-daemon-control.d.ts +56 -0
- package/dist/types/notifications/telegram-daemon.d.ts +276 -0
- package/dist/types/notifications/telegram-reference.d.ts +111 -0
- package/dist/types/notifications/threaded-inbound.d.ts +58 -0
- package/dist/types/notifications/threaded-render.d.ts +66 -0
- package/dist/types/notifications/topic-registry.d.ts +67 -0
- package/dist/types/rlm/index.d.ts +12 -0
- package/dist/types/session/agent-session.d.ts +39 -2
- package/dist/types/session/auth-storage.d.ts +1 -1
- package/dist/types/setup/credential-auto-import.d.ts +63 -0
- package/dist/types/setup/credential-import.d.ts +3 -0
- package/dist/types/setup/host-plugin-setup.d.ts +39 -0
- package/dist/types/skc-runtime/launch-tmux.d.ts +1 -0
- package/dist/types/skc-runtime/state-writer.d.ts +2 -0
- package/dist/types/skc-runtime/tmux-common.d.ts +3 -0
- package/dist/types/skc-runtime/tmux-sessions.d.ts +2 -0
- package/dist/types/skc-runtime/ultragoal-guard.d.ts +15 -0
- package/dist/types/skc-runtime/ultragoal-runtime.d.ts +14 -0
- package/dist/types/tools/ask-answer-registry.d.ts +13 -0
- package/dist/types/tools/index.d.ts +18 -0
- package/dist/types/tools/subagent.d.ts +3 -0
- package/package.json +7 -7
- package/scripts/build-binary.ts +3 -0
- package/src/async/job-manager.ts +5 -1
- package/src/cli/daemon-cli.ts +122 -0
- package/src/cli/notify-cli.ts +274 -0
- package/src/cli/setup-cli.ts +173 -84
- package/src/cli.ts +3 -3
- package/src/commands/daemon.ts +47 -0
- package/src/commands/notify.ts +61 -0
- package/src/commands/setup.ts +11 -1
- package/src/config/model-profile-activation.ts +74 -5
- package/src/config/model-profiles.ts +7 -4
- package/src/config/model-registry.ts +6 -3
- package/src/config/models-config-schema.ts +1 -1
- package/src/config/settings-schema.ts +29 -0
- package/src/coordinator/contract.ts +3 -0
- package/src/coordinator-mcp/server.ts +270 -1
- package/src/daemon/builtin.ts +46 -0
- package/src/daemon/control-types.ts +65 -0
- package/src/daemon/runtime.ts +51 -0
- package/src/defaults/skc/rules/ponytail.md +68 -0
- package/src/defaults/skc/skills/ultragoal/SKILL.md +16 -0
- package/src/defaults/skc-defaults.ts +27 -2
- package/src/edit/modes/replace.ts +1 -1
- package/src/extensibility/extensions/runner.ts +4 -0
- package/src/extensibility/extensions/types.ts +8 -0
- package/src/goals/tools/goal-tool.ts +11 -2
- package/src/hashline/hash.ts +1 -1
- package/src/internal-urls/docs-index.generated.ts +10 -8
- package/src/main.ts +30 -0
- package/src/modes/acp/acp-event-mapper.ts +1 -0
- package/src/modes/components/hook-editor.ts +7 -2
- package/src/modes/components/oauth-selector.ts +19 -0
- package/src/modes/controllers/event-controller.ts +20 -0
- package/src/modes/controllers/selector-controller.ts +80 -17
- package/src/modes/interactive-mode.ts +6 -2
- package/src/modes/runtime-init.ts +1 -0
- package/src/modes/shared/agent-wire/event-contract.ts +1 -0
- package/src/modes/shared/agent-wire/event-envelope.ts +1 -0
- package/src/modes/shared/agent-wire/event-observation.ts +16 -0
- package/src/modes/shared/agent-wire/unattended-session.ts +22 -0
- package/src/modes/types.ts +7 -1
- package/src/modes/utils/ui-helpers.ts +23 -0
- package/src/notifications/config-commands.ts +50 -0
- package/src/notifications/config.ts +107 -0
- package/src/notifications/helpers.ts +135 -0
- package/src/notifications/html-format.ts +389 -0
- package/src/notifications/index.ts +700 -0
- package/src/notifications/rate-limit-pool.ts +179 -0
- package/src/notifications/telegram-cli.ts +194 -0
- package/src/notifications/telegram-daemon-cli.ts +74 -0
- package/src/notifications/telegram-daemon-control.ts +370 -0
- package/src/notifications/telegram-daemon.ts +1370 -0
- package/src/notifications/telegram-reference.ts +335 -0
- package/src/notifications/threaded-inbound.ts +80 -0
- package/src/notifications/threaded-render.ts +155 -0
- package/src/notifications/topic-registry.ts +133 -0
- package/src/rlm/index.ts +19 -0
- package/src/sdk.ts +16 -0
- package/src/session/agent-session.ts +113 -3
- package/src/session/auth-storage.ts +3 -0
- package/src/session/session-dump-format.ts +43 -2
- package/src/session/session-manager.ts +39 -5
- package/src/setup/credential-auto-import.ts +258 -0
- package/src/setup/credential-import.ts +17 -0
- package/src/setup/hermes/templates/operator-instructions.v1.md +10 -0
- package/src/setup/host-plugin-setup.ts +142 -0
- package/src/skc-runtime/deep-interview-recorder.ts +2 -2
- package/src/skc-runtime/launch-tmux.ts +10 -2
- package/src/skc-runtime/state-runtime.ts +18 -10
- package/src/skc-runtime/state-writer.ts +8 -8
- package/src/skc-runtime/tmux-common.ts +8 -0
- package/src/skc-runtime/tmux-sessions.ts +8 -1
- package/src/skc-runtime/ultragoal-guard.ts +57 -2
- package/src/skc-runtime/ultragoal-runtime.ts +105 -19
- package/src/skc-runtime/workflow-manifest.generated.json +27 -2
- package/src/skc-runtime/workflow-manifest.ts +11 -1
- package/src/slash-commands/builtin-registry.ts +4 -1
- package/src/task/executor.ts +5 -1
- package/src/tools/ask-answer-registry.ts +25 -0
- package/src/tools/ask.ts +77 -6
- package/src/tools/image-gen.ts +5 -8
- package/src/tools/index.ts +19 -0
- package/src/tools/inspect-image.ts +16 -11
- package/src/tools/subagent-render.ts +7 -0
- package/src/tools/subagent.ts +38 -7
package/src/tools/subagent.ts
CHANGED
|
@@ -17,6 +17,8 @@ const MAX_LIST_LIMIT = 50;
|
|
|
17
17
|
const RECEIPT_PREVIEW_WIDTH = 280;
|
|
18
18
|
const PREVIEW_WIDTH = 2_000;
|
|
19
19
|
const FULL_PREVIEW_WIDTH = 12_000;
|
|
20
|
+
const STEER_QUEUED_GUIDANCE =
|
|
21
|
+
"The steer message is queued for the subagent's next steering boundary and has not necessarily taken effect yet.";
|
|
20
22
|
|
|
21
23
|
const subagentSchema = z.object({
|
|
22
24
|
action: z
|
|
@@ -63,6 +65,9 @@ export interface SubagentSnapshot {
|
|
|
63
65
|
outputRef?: string;
|
|
64
66
|
truncated?: boolean;
|
|
65
67
|
guidance?: string;
|
|
68
|
+
steerMessage?: string;
|
|
69
|
+
steerState?: "queued" | "resume_queued" | "resume_started";
|
|
70
|
+
steerPauseRequested?: boolean;
|
|
66
71
|
/** Live streaming progress for the awaited subagent (await panel only; UI detail). */
|
|
67
72
|
progress?: AgentProgress;
|
|
68
73
|
/** True when a live in-session progress producer exists for this subagent. */
|
|
@@ -240,6 +245,7 @@ export class SubagentTool implements AgentTool<typeof subagentSchema, SubagentTo
|
|
|
240
245
|
}
|
|
241
246
|
const records: SubagentRecord[] = [];
|
|
242
247
|
const missing: SubagentSnapshot[] = [];
|
|
248
|
+
const steerStates = new Map<string, NonNullable<SubagentSnapshot["steerState"]>>();
|
|
243
249
|
const record = this.#findVisibleRecord(manager, id, ownerFilter);
|
|
244
250
|
const verifiedOutputIds = await this.#verifiedOutputIds(record ? [record] : []);
|
|
245
251
|
if (!record) {
|
|
@@ -249,23 +255,41 @@ export class SubagentTool implements AgentTool<typeof subagentSchema, SubagentTo
|
|
|
249
255
|
if (record.status === "running") {
|
|
250
256
|
const handle = manager.getLiveHandle(record.subagentId);
|
|
251
257
|
if (!handle) throw new ToolError(`Subagent ${record.subagentId} has no live handle.`);
|
|
252
|
-
|
|
258
|
+
const fromAgentId = this.session.getAgentId?.() ?? undefined;
|
|
259
|
+
await handle.injectMessage(message, "steer", { fromAgentId });
|
|
253
260
|
if (params.pause === true) manager.pauseSubagent(record.subagentId, ownerFilter);
|
|
261
|
+
records.push(manager.getSubagentRecord(record.subagentId, ownerFilter) ?? record);
|
|
262
|
+
steerStates.set(record.subagentId, "queued");
|
|
254
263
|
} else {
|
|
255
264
|
const result = manager.resumeSubagent(record.subagentId, ownerFilter, message);
|
|
256
|
-
if (!result.ok && result.reason === "context_unavailable") throw new ToolError("context unavailable");
|
|
257
265
|
if (!result.ok && result.reason === "not_found") {
|
|
258
266
|
missing.push(this.#missingSnapshot(id, "not_found", "No visible detached subagent matches this id."));
|
|
267
|
+
} else if (!result.ok) {
|
|
268
|
+
throw new ToolError(`Failed to resume subagent ${record.subagentId}: ${result.reason ?? "unknown"}.`);
|
|
259
269
|
} else {
|
|
260
|
-
|
|
270
|
+
const snapshotRecord = manager.getSubagentRecord(record.subagentId, ownerFilter) ?? record;
|
|
271
|
+
records.push(snapshotRecord);
|
|
272
|
+
steerStates.set(
|
|
273
|
+
snapshotRecord.subagentId,
|
|
274
|
+
result.queued === true || result.status === "queued" ? "resume_queued" : "resume_started",
|
|
275
|
+
);
|
|
261
276
|
}
|
|
262
277
|
}
|
|
263
|
-
if (record.status === "running")
|
|
264
|
-
records.push(manager.getSubagentRecord(record.subagentId, ownerFilter) ?? record);
|
|
265
278
|
}
|
|
266
279
|
return this.#buildSnapshotResult(
|
|
267
280
|
[
|
|
268
|
-
...records.map(record =>
|
|
281
|
+
...records.map(record => {
|
|
282
|
+
const snapshot = this.#recordSnapshot(manager, record, false, verbosity, verifiedOutputIds);
|
|
283
|
+
return {
|
|
284
|
+
...snapshot,
|
|
285
|
+
steerMessage: message,
|
|
286
|
+
steerState: steerStates.get(record.subagentId) ?? "queued",
|
|
287
|
+
steerPauseRequested: params.pause === true,
|
|
288
|
+
guidance: snapshot.guidance
|
|
289
|
+
? `${snapshot.guidance} ${STEER_QUEUED_GUIDANCE}`
|
|
290
|
+
: STEER_QUEUED_GUIDANCE,
|
|
291
|
+
};
|
|
292
|
+
}),
|
|
269
293
|
...missing,
|
|
270
294
|
],
|
|
271
295
|
"Subagent steer",
|
|
@@ -288,7 +312,7 @@ export class SubagentTool implements AgentTool<typeof subagentSchema, SubagentTo
|
|
|
288
312
|
if (ids.length === 1) return ids[0]!;
|
|
289
313
|
if (ids.length > 1) {
|
|
290
314
|
throw new ToolError(
|
|
291
|
-
`\`${action}\` accepts exactly one target because \`message\`
|
|
315
|
+
`\`${action}\` accepts exactly one target because \`message\` can be queued for only one subagent.`,
|
|
292
316
|
);
|
|
293
317
|
}
|
|
294
318
|
throw new ToolError(`\`${action}\` requires a single subagent id via \`id\`.`);
|
|
@@ -533,6 +557,10 @@ export class SubagentTool implements AgentTool<typeof subagentSchema, SubagentTo
|
|
|
533
557
|
if (snapshot.description) lines.push(`Description: ${snapshot.description}`);
|
|
534
558
|
if (snapshot.outputRef) lines.push(`Output: ${snapshot.outputRef}`);
|
|
535
559
|
if (snapshot.assignment) lines.push("Assignment:", "```", snapshot.assignment, "```");
|
|
560
|
+
if (snapshot.steerMessage) {
|
|
561
|
+
lines.push(`Steer (${snapshot.steerState ?? "queued"}):`, "```", snapshot.steerMessage, "```");
|
|
562
|
+
lines.push(STEER_QUEUED_GUIDANCE);
|
|
563
|
+
}
|
|
536
564
|
if (snapshot.resultPreview) {
|
|
537
565
|
lines.push(snapshot.errorText ? "Error preview:" : "Result preview:", "```", snapshot.resultPreview, "```");
|
|
538
566
|
if (snapshot.truncated)
|
|
@@ -770,6 +798,9 @@ function canonicalizeSnapshotForSignature(snapshot: SubagentSnapshot): unknown {
|
|
|
770
798
|
outputRef: snapshot.outputRef ?? null,
|
|
771
799
|
truncated: snapshot.truncated ?? false,
|
|
772
800
|
guidance: snapshot.guidance ?? null,
|
|
801
|
+
steerMessage: snapshot.steerMessage ?? null,
|
|
802
|
+
steerState: snapshot.steerState ?? null,
|
|
803
|
+
steerPauseRequested: snapshot.steerPauseRequested ?? false,
|
|
773
804
|
liveProgressAvailable: snapshot.liveProgressAvailable ?? null,
|
|
774
805
|
effectiveModel: snapshot.effectiveModel ?? null,
|
|
775
806
|
requestedModel: snapshot.requestedModel ?? null,
|