@wrongstack/cli 1.0.12 → 1.0.13
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.
|
@@ -3228,8 +3228,8 @@ import {
|
|
|
3228
3228
|
runtimeToolReferencesFromText
|
|
3229
3229
|
} from "@wrongstack/core/agent-catalog";
|
|
3230
3230
|
import { TOKENS as TOKENS3 } from "@wrongstack/core/kernel";
|
|
3231
|
-
import { formatProjectSuppliedBlock } from "@wrongstack/core/utils";
|
|
3232
|
-
import { getSageRetrieval } from "@wrongstack/sage";
|
|
3231
|
+
import { formatMemoryEvidenceBlock, formatProjectSuppliedBlock } from "@wrongstack/core/utils";
|
|
3232
|
+
import { formatMemoryHintsDetailed, getSageRetrieval } from "@wrongstack/sage";
|
|
3233
3233
|
var EAGER_SKILL_LIMIT = DEFAULT_EAGER_SKILL_LIMIT;
|
|
3234
3234
|
var MIN_TRIMMED_BODY_CHARS = 800;
|
|
3235
3235
|
async function resolveHostSubagentSkillResolution(deps, roster, subCfg, availableToolNames = []) {
|
|
@@ -3344,8 +3344,9 @@ _(body trimmed)_` : body,
|
|
|
3344
3344
|
async function retrieveHostSubagentMemory(deps, getLeaderMode, subCfg, taskContext, owningSessionId) {
|
|
3345
3345
|
const memoryPort = deps.container.safeResolve(TOKENS3.MemoryStore);
|
|
3346
3346
|
const memory = memoryPort ? getSageRetrieval(memoryPort) : void 0;
|
|
3347
|
-
if (!memory?.retrieveForAudience) return
|
|
3347
|
+
if (!memory?.retrieveForAudience) return void 0;
|
|
3348
3348
|
const contextualTaskType = typeof taskContext?.["taskType"] === "string" ? taskContext["taskType"] : void 0;
|
|
3349
|
+
const sessionId = owningSessionId ?? deps.session.id;
|
|
3349
3350
|
try {
|
|
3350
3351
|
const taskType = subCfg.memoryContext?.taskType ?? contextualTaskType;
|
|
3351
3352
|
const mode = subCfg.memoryContext?.mode ?? getLeaderMode?.();
|
|
@@ -3355,18 +3356,30 @@ async function retrieveHostSubagentMemory(deps, getLeaderMode, subCfg, taskConte
|
|
|
3355
3356
|
...taskType !== void 0 ? { taskType } : {},
|
|
3356
3357
|
...mode !== void 0 ? { mode } : {}
|
|
3357
3358
|
},
|
|
3358
|
-
20
|
|
3359
|
+
20,
|
|
3360
|
+
void 0,
|
|
3361
|
+
// The owning conversation's own session-scoped audience memories are
|
|
3362
|
+
// visible to its workers; other sessions' stay hidden.
|
|
3363
|
+
sessionId
|
|
3359
3364
|
);
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
"subagent_audience",
|
|
3363
|
-
owningSessionId ?? deps.session.id
|
|
3365
|
+
const eligible = matches.filter(
|
|
3366
|
+
(item) => item.status === "active" && item.contextPolicy !== "never"
|
|
3364
3367
|
);
|
|
3365
|
-
|
|
3368
|
+
const rendered = formatMemoryHintsDetailed(eligible, {
|
|
3369
|
+
heading: "SAGE: project memory for this agent role",
|
|
3370
|
+
maxChars: SUBAGENT_AUDIENCE_MEMORY_CHARS
|
|
3371
|
+
});
|
|
3372
|
+
if (!rendered.text || rendered.memoryIds.length === 0) return void 0;
|
|
3373
|
+
try {
|
|
3374
|
+
await memory.recordInjection?.(rendered.memoryIds, "subagent_audience", sessionId);
|
|
3375
|
+
} catch {
|
|
3376
|
+
}
|
|
3377
|
+
return formatMemoryEvidenceBlock("sage.subagent-audience", rendered.text);
|
|
3366
3378
|
} catch {
|
|
3367
|
-
return
|
|
3379
|
+
return void 0;
|
|
3368
3380
|
}
|
|
3369
3381
|
}
|
|
3382
|
+
var SUBAGENT_AUDIENCE_MEMORY_CHARS = 4e3;
|
|
3370
3383
|
|
|
3371
3384
|
// src/fleet/host-session-writer.ts
|
|
3372
3385
|
import { stampAgentId } from "@wrongstack/core/storage";
|
|
@@ -3592,13 +3605,7 @@ ${message} Falling back to the assigned checkout.` : `${message} Falling back to
|
|
|
3592
3605
|
task?.context,
|
|
3593
3606
|
owningSessionId
|
|
3594
3607
|
);
|
|
3595
|
-
if (audienceMemory.
|
|
3596
|
-
baseSystem.push({
|
|
3597
|
-
type: "text",
|
|
3598
|
-
text: `Project memory for this agent role:
|
|
3599
|
-
${audienceMemory.map((text) => `- ${text}`).join("\n")}`
|
|
3600
|
-
});
|
|
3601
|
-
}
|
|
3608
|
+
if (audienceMemory) baseSystem.push({ type: "text", text: audienceMemory });
|
|
3602
3609
|
const skillResolution = await resolveHostSubagentSkillResolution(
|
|
3603
3610
|
host.deps,
|
|
3604
3611
|
host.roster,
|
|
@@ -21164,8 +21171,17 @@ async function applyDispatch(Sage, report) {
|
|
|
21164
21171
|
let mergeFail = 0;
|
|
21165
21172
|
for (const merge of report.merges.merges) {
|
|
21166
21173
|
try {
|
|
21167
|
-
await Sage.
|
|
21168
|
-
|
|
21174
|
+
const keeper = await Sage.getSage(merge.keeperId);
|
|
21175
|
+
if (!keeper || keeper.status !== "active" && keeper.status !== "stale") {
|
|
21176
|
+
throw new Error(`keeper ${merge.keeperId} is no longer active`);
|
|
21177
|
+
}
|
|
21178
|
+
await Sage.updateSage(merge.supersededId, {
|
|
21179
|
+
status: "superseded",
|
|
21180
|
+
supersededBy: merge.keeperId
|
|
21181
|
+
});
|
|
21182
|
+
await Sage.updateSage(merge.keeperId, {
|
|
21183
|
+
supersedes: [.../* @__PURE__ */ new Set([...keeper.supersedes ?? [], merge.supersededId])]
|
|
21184
|
+
});
|
|
21169
21185
|
mergeOk++;
|
|
21170
21186
|
} catch (err) {
|
|
21171
21187
|
mergeFail++;
|
|
@@ -21444,12 +21460,58 @@ function buildMemoryCommand(opts) {
|
|
|
21444
21460
|
case "candidates": {
|
|
21445
21461
|
if (!Sage) return requiresSage("candidates");
|
|
21446
21462
|
const action = rest[0]?.toLowerCase() ?? "list";
|
|
21463
|
+
if (action === "resolve") {
|
|
21464
|
+
const decision = rest[2]?.toLowerCase();
|
|
21465
|
+
if (!rest[1] || decision !== "delete" && decision !== "archive" && decision !== "keep") {
|
|
21466
|
+
return {
|
|
21467
|
+
message: "Usage: /memory candidates resolve <candidate-id> delete|archive|keep [reason]"
|
|
21468
|
+
};
|
|
21469
|
+
}
|
|
21470
|
+
try {
|
|
21471
|
+
const resolution = await Sage.resolveCandidate(
|
|
21472
|
+
rest[1],
|
|
21473
|
+
decision,
|
|
21474
|
+
rest.slice(3).join(" ") || void 0
|
|
21475
|
+
);
|
|
21476
|
+
if (!resolution) return { message: `Candidate ${rest[1]} was not found.` };
|
|
21477
|
+
if (resolution.error) {
|
|
21478
|
+
return { message: `Could not resolve ${rest[1]}: ${resolution.error}` };
|
|
21479
|
+
}
|
|
21480
|
+
return {
|
|
21481
|
+
message: `Resolved ${rest[1]}: ${decision}${resolution.applied ? "" : " (target memory unchanged)"}.`
|
|
21482
|
+
};
|
|
21483
|
+
} catch (error) {
|
|
21484
|
+
return {
|
|
21485
|
+
message: `Could not resolve ${rest[1]}: ${error instanceof Error ? error.message : String(error)}`
|
|
21486
|
+
};
|
|
21487
|
+
}
|
|
21488
|
+
}
|
|
21447
21489
|
if (action === "accept") {
|
|
21448
21490
|
if (!rest[1]) return { message: "Usage: /memory candidates accept <candidate-id>" };
|
|
21449
|
-
|
|
21450
|
-
|
|
21451
|
-
|
|
21452
|
-
|
|
21491
|
+
try {
|
|
21492
|
+
const review = (await Sage.listCandidates(false)).find(
|
|
21493
|
+
(c) => c.id === rest[1] && c.kind === "memory_review"
|
|
21494
|
+
);
|
|
21495
|
+
if (review) {
|
|
21496
|
+
const decision = review.suggestedAction === "archive" ? "archive" : "delete";
|
|
21497
|
+
const resolution = await Sage.resolveCandidate(rest[1], decision);
|
|
21498
|
+
if (!resolution) return { message: `Candidate ${rest[1]} was not found.` };
|
|
21499
|
+
if (resolution.error) {
|
|
21500
|
+
return { message: `Could not accept ${rest[1]}: ${resolution.error}` };
|
|
21501
|
+
}
|
|
21502
|
+
return {
|
|
21503
|
+
message: `Accepted review ${rest[1]}: ${decision}${resolution.applied ? "" : " (target memory unchanged)"}.`
|
|
21504
|
+
};
|
|
21505
|
+
}
|
|
21506
|
+
const accepted = await Sage.acceptCandidate(rest[1]);
|
|
21507
|
+
return {
|
|
21508
|
+
message: accepted ? `Accepted ${rest[1]} as ${accepted.id}.` : `Candidate ${rest[1]} was not found.`
|
|
21509
|
+
};
|
|
21510
|
+
} catch (error) {
|
|
21511
|
+
return {
|
|
21512
|
+
message: `Could not accept ${rest[1]}: ${error instanceof Error ? error.message : String(error)}`
|
|
21513
|
+
};
|
|
21514
|
+
}
|
|
21453
21515
|
}
|
|
21454
21516
|
if (action === "reject") {
|
|
21455
21517
|
if (!rest[1])
|
|
@@ -31525,7 +31587,8 @@ function buildTodosCommand(opts) {
|
|
|
31525
31587
|
];
|
|
31526
31588
|
const result = await updateTodos(nextTodos);
|
|
31527
31589
|
const projected = ctx.todos.find((todo) => todo.id === doneItem.id);
|
|
31528
|
-
|
|
31590
|
+
const completedAndCleared = ctx.todos.length === 0 && !result.kanban_warnings?.length;
|
|
31591
|
+
if (isManagedProjection(doneItem) && projected?.status !== "completed" && !completedAndCleared) {
|
|
31529
31592
|
return {
|
|
31530
31593
|
message: result.kanban_warnings?.[0] ?? `Kanban kept ${doneItem.content} at ${projected?.status ?? "its current state"}.`
|
|
31531
31594
|
};
|
|
@@ -38992,4 +39055,4 @@ export {
|
|
|
38992
39055
|
CLI_VERSION,
|
|
38993
39056
|
runInteractive
|
|
38994
39057
|
};
|
|
38995
|
-
//# sourceMappingURL=cli-main-
|
|
39058
|
+
//# sourceMappingURL=cli-main-6JWASRH2.js.map
|
|
@@ -19,5 +19,5 @@ export declare function retrieveHostSubagentMemory(deps: MultiAgentDeps, getLead
|
|
|
19
19
|
* without it every background tab's memory reads were recorded against a
|
|
20
20
|
* conversation that never made them.
|
|
21
21
|
*/
|
|
22
|
-
owningSessionId?: string): Promise<string
|
|
22
|
+
owningSessionId?: string): Promise<string | undefined>;
|
|
23
23
|
//# sourceMappingURL=host-context.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -23,7 +23,7 @@ async function main(argv) {
|
|
|
23
23
|
const { initializeCli } = await import("./cli-context-5IF7ZYEY.js");
|
|
24
24
|
const cliCtx = await initializeCli(argv);
|
|
25
25
|
if (typeof cliCtx === "number") return cliCtx;
|
|
26
|
-
const { runInteractive } = await import("./cli-main-
|
|
26
|
+
const { runInteractive } = await import("./cli-main-6JWASRH2.js");
|
|
27
27
|
return runInteractive(cliCtx);
|
|
28
28
|
}
|
|
29
29
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "WrongStack CLI — terminal AI coding agent with provider catalog from models.dev. Provides `wrongstack` and `wstack` binaries.",
|
|
6
6
|
"keywords": [
|
|
@@ -41,36 +41,36 @@
|
|
|
41
41
|
"data"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@wrongstack/acp": "1.0.
|
|
45
|
-
"@wrongstack/bench": "1.0.
|
|
46
|
-
"@wrongstack/core": "1.0.
|
|
47
|
-
"@wrongstack/kanban": "1.0.
|
|
48
|
-
"@wrongstack/mcp": "1.0.
|
|
49
|
-
"@wrongstack/persistence": "1.0.
|
|
50
|
-
"@wrongstack/plug-lsp": "1.0.
|
|
51
|
-
"@wrongstack/plugins": "1.0.
|
|
52
|
-
"@wrongstack/primitives": "1.0.
|
|
53
|
-
"@wrongstack/providers": "1.0.
|
|
54
|
-
"@wrongstack/requirement-intake": "1.0.
|
|
55
|
-
"@wrongstack/runtime": "1.0.
|
|
56
|
-
"@wrongstack/sage": "1.0.
|
|
57
|
-
"@wrongstack/sdd": "1.0.
|
|
58
|
-
"@wrongstack/security-scanner": "1.0.
|
|
59
|
-
"@wrongstack/simpleui": "1.0.
|
|
60
|
-
"@wrongstack/techstack": "1.0.
|
|
61
|
-
"@wrongstack/telegram": "1.0.
|
|
62
|
-
"@wrongstack/tools": "1.0.
|
|
63
|
-
"@wrongstack/tui": "1.0.
|
|
64
|
-
"@wrongstack/vector-memory": "1.0.
|
|
65
|
-
"@wrongstack/webui": "1.0.
|
|
66
|
-
"@wrongstack/webui-hq": "1.0.
|
|
67
|
-
"@wrongstack/webui-protocol": "1.0.
|
|
68
|
-
"@wrongstack/webui-server": "1.0.
|
|
69
|
-
"@wrongstack/wrongtrace": "1.0.
|
|
44
|
+
"@wrongstack/acp": "1.0.13",
|
|
45
|
+
"@wrongstack/bench": "1.0.13",
|
|
46
|
+
"@wrongstack/core": "1.0.13",
|
|
47
|
+
"@wrongstack/kanban": "1.0.13",
|
|
48
|
+
"@wrongstack/mcp": "1.0.13",
|
|
49
|
+
"@wrongstack/persistence": "1.0.13",
|
|
50
|
+
"@wrongstack/plug-lsp": "1.0.13",
|
|
51
|
+
"@wrongstack/plugins": "1.0.13",
|
|
52
|
+
"@wrongstack/primitives": "1.0.13",
|
|
53
|
+
"@wrongstack/providers": "1.0.13",
|
|
54
|
+
"@wrongstack/requirement-intake": "1.0.13",
|
|
55
|
+
"@wrongstack/runtime": "1.0.13",
|
|
56
|
+
"@wrongstack/sage": "1.0.13",
|
|
57
|
+
"@wrongstack/sdd": "1.0.13",
|
|
58
|
+
"@wrongstack/security-scanner": "1.0.13",
|
|
59
|
+
"@wrongstack/simpleui": "1.0.13",
|
|
60
|
+
"@wrongstack/techstack": "1.0.13",
|
|
61
|
+
"@wrongstack/telegram": "1.0.13",
|
|
62
|
+
"@wrongstack/tools": "1.0.13",
|
|
63
|
+
"@wrongstack/tui": "1.0.13",
|
|
64
|
+
"@wrongstack/vector-memory": "1.0.13",
|
|
65
|
+
"@wrongstack/webui": "1.0.13",
|
|
66
|
+
"@wrongstack/webui-hq": "1.0.13",
|
|
67
|
+
"@wrongstack/webui-protocol": "1.0.13",
|
|
68
|
+
"@wrongstack/webui-server": "1.0.13",
|
|
69
|
+
"@wrongstack/wrongtrace": "1.0.13",
|
|
70
70
|
"ws": "^8.21.3"
|
|
71
71
|
},
|
|
72
72
|
"optionalDependencies": {
|
|
73
|
-
"@wrongstack/desktop": "1.0.
|
|
73
|
+
"@wrongstack/desktop": "1.0.13"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@types/node": "^26.5.1",
|