@wrongstack/cli 0.302.2 → 0.305.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/dist/{acp-XCE4JJF3.js → acp-5ZLGFHWP.js} +5 -2
- package/dist/boot/system-prompt-builder.d.ts +24 -1
- package/dist/boot/tui-project-switch.d.ts +1 -1
- package/dist/boot/tui-runtime-state.d.ts +14 -0
- package/dist/boot/tui-theme-adapter.d.ts +33 -0
- package/dist/{chunk-BXQG3H2Y.js → chunk-53STH6CX.js} +87 -13
- package/dist/{chunk-JW75HY4F.js → chunk-FKWHSFX4.js} +33 -4
- package/dist/{chunk-WOXUE2CN.js → chunk-RHLQT3EV.js} +12 -2
- package/dist/{cli-main-PJMDZHDK.js → cli-main-W3T56YCY.js} +1498 -891
- package/dist/execute-deps.d.ts +16 -0
- package/dist/{execution-LZRYRGDD.js → execution-YMBD7YWC.js} +149 -37
- package/dist/fleet/host-context.d.ts +11 -0
- package/dist/fleet/host-learning-tracker.d.ts +2 -2
- package/dist/fleet/host-learning.d.ts +12 -1
- package/dist/fleet/host-session-writer.d.ts +33 -0
- package/dist/fleet/host-subagent-factory.d.ts +1 -1
- package/dist/fleet/host.d.ts +32 -0
- package/dist/{hq-AHPAE7EN.js → hq-5G6D5YIU.js} +2 -2
- package/dist/{hq-server-KU2Z54QU.js → hq-server-IVZLVCFV.js} +2 -2
- package/dist/index.js +15 -58
- package/dist/{mailbox-serve-DBOOOOWZ.js → mailbox-serve-V3QIJBDH.js} +2 -2
- package/dist/{mcp-E5EBGOHF.js → mcp-MSARYOPN.js} +5 -2
- package/dist/replay-XU6ZD7GM.js +34 -0
- package/dist/slash-commands/agent-improve.d.ts +4 -1
- package/dist/slash-commands/memory-triage.d.ts +4 -17
- package/dist/slash-commands/theme.d.ts +6 -0
- package/dist/subcommands/handlers/update.d.ts +2 -0
- package/dist/{update-LTDJGAFU.js → update-VZSOZGYC.js} +2 -2
- package/dist/{webui-server-E3OPEKU5.js → webui-server-FTG7JAZU.js} +5 -5
- package/dist/wiring/domain-glossary.d.ts +58 -0
- package/dist/wiring/domain-terms-mirror.d.ts +52 -0
- package/dist/wiring/pipeline.d.ts +2 -0
- package/dist/wiring/replay.d.ts +11 -1
- package/dist/wiring/sage.d.ts +4 -16
- package/package.json +23 -23
package/dist/index.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
parseWebuiSessionChildOptions,
|
|
4
|
-
writeWebuiSessionChildError
|
|
5
|
-
} from "./chunk-3JPTNADJ.js";
|
|
6
2
|
import {
|
|
7
3
|
applySimpleUiFullAutoProfile,
|
|
8
4
|
detectProjectFacts,
|
|
@@ -17,6 +13,10 @@ import {
|
|
|
17
13
|
import {
|
|
18
14
|
patchConfig
|
|
19
15
|
} from "./chunk-TYO2OVAD.js";
|
|
16
|
+
import {
|
|
17
|
+
parseWebuiSessionChildOptions,
|
|
18
|
+
writeWebuiSessionChildError
|
|
19
|
+
} from "./chunk-3JPTNADJ.js";
|
|
20
20
|
import {
|
|
21
21
|
parseArgs,
|
|
22
22
|
runPicker,
|
|
@@ -38,12 +38,12 @@ import {
|
|
|
38
38
|
} from "./chunk-YMXXOOFN.js";
|
|
39
39
|
import {
|
|
40
40
|
runUpdateCommand
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-53STH6CX.js";
|
|
42
42
|
import "./chunk-U3SS4NRH.js";
|
|
43
43
|
import "./chunk-NUIHRGPY.js";
|
|
44
44
|
import {
|
|
45
45
|
DEFAULT_PORT
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-RHLQT3EV.js";
|
|
47
47
|
import "./chunk-KE7E7DPX.js";
|
|
48
48
|
import "./chunk-Q5GTM25S.js";
|
|
49
49
|
import {
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
import "./chunk-7OCVIDC7.js";
|
|
60
60
|
|
|
61
61
|
// src/cli-context.ts
|
|
62
|
-
import { TOKENS as
|
|
62
|
+
import { TOKENS as TOKENS3 } from "@wrongstack/core/kernel";
|
|
63
63
|
import { writeErr as writeErr3 } from "@wrongstack/core/utils";
|
|
64
64
|
import { setOAuthTokenPersister } from "@wrongstack/providers";
|
|
65
65
|
|
|
@@ -761,7 +761,7 @@ async function isPortInUse(host, port) {
|
|
|
761
761
|
}
|
|
762
762
|
async function handleHqShortCircuit(flags) {
|
|
763
763
|
if (flags["hq"] !== true) return null;
|
|
764
|
-
const { startHqServer } = await import("./hq-server-
|
|
764
|
+
const { startHqServer } = await import("./hq-server-IVZLVCFV.js");
|
|
765
765
|
const tunnelRequested = flags["tunnel"] === true;
|
|
766
766
|
const host = typeof flags["host"] === "string" ? flags["host"] : tunnelRequested ? "127.0.0.1" : HQ_CLI_DEFAULT_HOST2;
|
|
767
767
|
if (tunnelRequested && !isLoopbackHost(host)) {
|
|
@@ -2306,10 +2306,10 @@ function compactSingleLine(text) {
|
|
|
2306
2306
|
|
|
2307
2307
|
// src/subcommands/index.ts
|
|
2308
2308
|
var loaders = {
|
|
2309
|
-
acp: async () => (await import("./acp-
|
|
2309
|
+
acp: async () => (await import("./acp-5ZLGFHWP.js")).acpCmd,
|
|
2310
2310
|
init: async () => (await import("./init-E2NDDOHI.js")).initCmd,
|
|
2311
2311
|
auth: async () => (await import("./auth-K7CYVVKH.js")).authCmd,
|
|
2312
|
-
update: async () => (await import("./update-
|
|
2312
|
+
update: async () => (await import("./update-VZSOZGYC.js")).updateCmd,
|
|
2313
2313
|
sessions: async () => (await import("./sessions-config-YX2ZPAFM.js")).sessionsCmd,
|
|
2314
2314
|
config: async () => (await import("./sessions-config-YX2ZPAFM.js")).configCmd,
|
|
2315
2315
|
rewind: async () => (await import("./rewind-7RE6ONIC.js")).rewindCmd,
|
|
@@ -2319,7 +2319,7 @@ var loaders = {
|
|
|
2319
2319
|
skills: async () => (await import("./tools-skills-UNKLOB7M.js")).skillsCmd,
|
|
2320
2320
|
providers: async () => (await import("./providers-models-VV74TRQ2.js")).providersCmd,
|
|
2321
2321
|
models: async () => (await import("./providers-models-VV74TRQ2.js")).modelsCmd,
|
|
2322
|
-
mcp: async () => (await import("./mcp-
|
|
2322
|
+
mcp: async () => (await import("./mcp-MSARYOPN.js")).mcpCmd,
|
|
2323
2323
|
plugin: async () => (await import("./plugin-usage-PTEETL3J.js")).pluginCmd,
|
|
2324
2324
|
plugins: async () => (await import("./plugin-usage-PTEETL3J.js")).pluginCmd,
|
|
2325
2325
|
diag: async () => (await import("./diag-doctor-ZF5BF2MK.js")).diagCmd,
|
|
@@ -2333,8 +2333,8 @@ var loaders = {
|
|
|
2333
2333
|
quick: async () => (await import("./quick-VIO2BEHS.js")).quickCmd,
|
|
2334
2334
|
bench: async () => (await import("./bench-XNDUJOSZ.js")).benchCmd,
|
|
2335
2335
|
chronicle: async () => (await import("./chronicle-63MFCZN6.js")).chronicleCmd,
|
|
2336
|
-
hq: async () => (await import("./hq-
|
|
2337
|
-
mailbox: async () => (await import("./mailbox-serve-
|
|
2336
|
+
hq: async () => (await import("./hq-5G6D5YIU.js")).hqCmd,
|
|
2337
|
+
mailbox: async () => (await import("./mailbox-serve-V3QIJBDH.js")).mailboxServeCmd,
|
|
2338
2338
|
permissions: async () => (await import("./permissions-2PWBL4YU.js")).permissionsCmd,
|
|
2339
2339
|
project: async () => (await import("./project-BLQ3ALVL.js")).projectCmd,
|
|
2340
2340
|
governance: async () => (await import("./governance-V2Z42RBE.js")).governanceCmd
|
|
@@ -2916,35 +2916,6 @@ async function runPreflight(config, initialUpdateInfo) {
|
|
|
2916
2916
|
};
|
|
2917
2917
|
}
|
|
2918
2918
|
|
|
2919
|
-
// src/wiring/replay.ts
|
|
2920
|
-
import { runProviderWithRetry } from "@wrongstack/core/agent";
|
|
2921
|
-
import { TOKENS as TOKENS3 } from "@wrongstack/core/kernel";
|
|
2922
|
-
import { ReplayProviderRunner } from "@wrongstack/core/replay";
|
|
2923
|
-
import { ReplayLogStore } from "@wrongstack/core/storage";
|
|
2924
|
-
function bindReplayToContainer(opts) {
|
|
2925
|
-
const { container, wpaths, sessionId, mode, logger } = opts;
|
|
2926
|
-
if (!opts.container.has(TOKENS3.ProviderRunner)) {
|
|
2927
|
-
container.bind(
|
|
2928
|
-
TOKENS3.ProviderRunner,
|
|
2929
|
-
() => ({
|
|
2930
|
-
run: (o) => runProviderWithRetry(o)
|
|
2931
|
-
})
|
|
2932
|
-
);
|
|
2933
|
-
}
|
|
2934
|
-
const inner = container.resolve(TOKENS3.ProviderRunner);
|
|
2935
|
-
const log = new ReplayLogStore({ dir: wpaths.projectSessions });
|
|
2936
|
-
const wrapped = new ReplayProviderRunner(inner, {
|
|
2937
|
-
log,
|
|
2938
|
-
sessionId,
|
|
2939
|
-
mode,
|
|
2940
|
-
logger: logger ? {
|
|
2941
|
-
debug: (m) => logger.debug?.(m),
|
|
2942
|
-
warn: (m) => logger.warn?.(m)
|
|
2943
|
-
} : void 0
|
|
2944
|
-
});
|
|
2945
|
-
container.bind(TOKENS3.ProviderRunner, () => wrapped);
|
|
2946
|
-
}
|
|
2947
|
-
|
|
2948
2919
|
// src/cli-context.ts
|
|
2949
2920
|
async function initializeCli(argv) {
|
|
2950
2921
|
applyNodeEnvDefault();
|
|
@@ -3103,21 +3074,7 @@ async function initializeCli(argv) {
|
|
|
3103
3074
|
renderer,
|
|
3104
3075
|
modelsRegistry
|
|
3105
3076
|
});
|
|
3106
|
-
const
|
|
3107
|
-
const recordFlag = ctx.flags["record"];
|
|
3108
|
-
if (typeof replayFlag === "string" || recordFlag === true) {
|
|
3109
|
-
const sessionId = typeof replayFlag === "string" ? replayFlag : `record-${Date.now()}`;
|
|
3110
|
-
const mode = recordFlag === true ? "record" : "replay";
|
|
3111
|
-
bindReplayToContainer({
|
|
3112
|
-
container,
|
|
3113
|
-
wpaths,
|
|
3114
|
-
sessionId,
|
|
3115
|
-
mode,
|
|
3116
|
-
logger
|
|
3117
|
-
});
|
|
3118
|
-
logger.info(`replay: ProviderRunner bound in '${mode}' mode for session ${sessionId}`);
|
|
3119
|
-
}
|
|
3120
|
-
const configStore = container.resolve(TOKENS4.ConfigStore);
|
|
3077
|
+
const configStore = container.resolve(TOKENS3.ConfigStore);
|
|
3121
3078
|
return {
|
|
3122
3079
|
...ctx,
|
|
3123
3080
|
updateInfo: refreshedUpdateInfo,
|
|
@@ -3132,7 +3089,7 @@ async function initializeCli(argv) {
|
|
|
3132
3089
|
async function main(argv) {
|
|
3133
3090
|
const cliCtx = await initializeCli(argv);
|
|
3134
3091
|
if (typeof cliCtx === "number") return cliCtx;
|
|
3135
|
-
const { runInteractive } = await import("./cli-main-
|
|
3092
|
+
const { runInteractive } = await import("./cli-main-W3T56YCY.js");
|
|
3136
3093
|
return runInteractive(cliCtx);
|
|
3137
3094
|
}
|
|
3138
3095
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
startCliHqConnection
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FKWHSFX4.js";
|
|
4
4
|
import "./chunk-7OCVIDC7.js";
|
|
5
5
|
|
|
6
6
|
// src/subcommands/handlers/mailbox-serve.ts
|
|
@@ -341,4 +341,4 @@ function printHelp(deps) {
|
|
|
341
341
|
export {
|
|
342
342
|
mailboxServeCmd
|
|
343
343
|
};
|
|
344
|
-
//# sourceMappingURL=mailbox-serve-
|
|
344
|
+
//# sourceMappingURL=mailbox-serve-V3QIJBDH.js.map
|
|
@@ -220,7 +220,10 @@ async function serveMcpStdio(deps) {
|
|
|
220
220
|
permissionPolicy,
|
|
221
221
|
secretScrubber: new DefaultSecretScrubber(),
|
|
222
222
|
maxToolTimeoutMs: deps.config.tools?.maxToolTimeoutMs ?? 3e5,
|
|
223
|
-
perIterationOutputCapBytes: 1e6
|
|
223
|
+
perIterationOutputCapBytes: 1e6,
|
|
224
|
+
// Kanban tracks work; it does not gate it. Off unless the operator opts in.
|
|
225
|
+
// See wiring/pipeline.ts for why all four hosts must agree.
|
|
226
|
+
requireKanbanGovernance: deps.config.tools?.kanbanGovernance ?? false
|
|
224
227
|
});
|
|
225
228
|
const allowed = await selectExposedTools(registry, ctx, permissionPolicy, whitelist);
|
|
226
229
|
const allowedNames = new Set(allowed.map((t) => t.name));
|
|
@@ -414,4 +417,4 @@ function isRecord(value) {
|
|
|
414
417
|
export {
|
|
415
418
|
mcpCmd
|
|
416
419
|
};
|
|
417
|
-
//# sourceMappingURL=mcp-
|
|
420
|
+
//# sourceMappingURL=mcp-MSARYOPN.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import "./chunk-7OCVIDC7.js";
|
|
2
|
+
|
|
3
|
+
// src/wiring/replay.ts
|
|
4
|
+
import { runProviderWithRetry } from "@wrongstack/core/agent";
|
|
5
|
+
import { TOKENS } from "@wrongstack/core/kernel";
|
|
6
|
+
import { ReplayProviderRunner } from "@wrongstack/core/replay";
|
|
7
|
+
import { ReplayLogStore } from "@wrongstack/core/storage";
|
|
8
|
+
function bindReplayToContainer(opts) {
|
|
9
|
+
const { container, wpaths, sessionId, mode, logger } = opts;
|
|
10
|
+
if (!opts.container.has(TOKENS.ProviderRunner)) {
|
|
11
|
+
container.bind(
|
|
12
|
+
TOKENS.ProviderRunner,
|
|
13
|
+
() => ({
|
|
14
|
+
run: (o) => runProviderWithRetry(o)
|
|
15
|
+
})
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
const inner = container.resolve(TOKENS.ProviderRunner);
|
|
19
|
+
const log = new ReplayLogStore({ dir: wpaths.projectSessions });
|
|
20
|
+
const wrapped = new ReplayProviderRunner(inner, {
|
|
21
|
+
log,
|
|
22
|
+
sessionId,
|
|
23
|
+
mode,
|
|
24
|
+
logger: logger ? {
|
|
25
|
+
debug: (m) => logger.debug?.(m),
|
|
26
|
+
warn: (m) => logger.warn?.(m)
|
|
27
|
+
} : void 0
|
|
28
|
+
});
|
|
29
|
+
container.bind(TOKENS.ProviderRunner, () => wrapped);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
bindReplayToContainer
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=replay-XU6ZD7GM.js.map
|
|
@@ -7,7 +7,10 @@ import type { SlashCommandContext } from './command-context.js';
|
|
|
7
7
|
* show — display current customization for one or all roles
|
|
8
8
|
* update — write new identity/learned content (prompts for content)
|
|
9
9
|
* refresh — reset identity.md + learned.md to empty templates (keep config/knowledge)
|
|
10
|
-
*
|
|
10
|
+
* capture — re-scan the last turn for ## LEARNED blocks
|
|
11
|
+
* optimize — distil captures into per-skill addenda + a consolidated document
|
|
12
|
+
* (alias: consolidate)
|
|
13
|
+
* skills — list skills with project affinity; show or pin one
|
|
11
14
|
* reset — delete ALL project customizations for a role (rm -rf the dir)
|
|
12
15
|
* reset-all — delete customizations for EVERY role
|
|
13
16
|
*/
|
|
@@ -19,29 +19,16 @@
|
|
|
19
19
|
* `/memory compact`. Falls back to a no-op LLM if the provider is absent
|
|
20
20
|
* (Phase 3 and 4 will degrade to skip-only; report is still useful).
|
|
21
21
|
*/
|
|
22
|
-
import type {
|
|
22
|
+
import type { SageSurface } from '@wrongstack/sage';
|
|
23
23
|
import { type TriageReport } from '@wrongstack/sage';
|
|
24
24
|
import type { SlashCommandContext } from './command-context.js';
|
|
25
25
|
export declare function runTriageCommand(opts: SlashCommandContext, args: string[]): Promise<{
|
|
26
26
|
message: string;
|
|
27
27
|
}>;
|
|
28
|
-
export
|
|
29
|
-
filed: number;
|
|
30
|
-
failed: number;
|
|
31
|
-
total: number;
|
|
32
|
-
failures: Array<{
|
|
33
|
-
memoryId: string;
|
|
34
|
-
error: string;
|
|
35
|
-
}>;
|
|
36
|
-
/** All inputs that were submitted to Sage.createCandidate, for test verification. */
|
|
37
|
-
inputs: CreateCandidateInput[];
|
|
38
|
-
}
|
|
28
|
+
export type { ProposalFileResult } from '@wrongstack/sage';
|
|
39
29
|
/**
|
|
40
30
|
* File triage proposals as MemoryCandidates via the Sage surface.
|
|
41
|
-
*
|
|
42
|
-
* Exported for unit testing — the round-trip path through
|
|
43
|
-
* Sage.createCandidate is the key contract: every proposal must
|
|
44
|
-
* surface in `/memory candidates` for human review.
|
|
31
|
+
* Implementation lives in `@wrongstack/sage` (shared with daily dry-run).
|
|
45
32
|
*/
|
|
46
|
-
export declare function fileProposals(Sage: SageSurface, proposals: TriageReport['dispatch']['proposals']): Promise<ProposalFileResult>;
|
|
33
|
+
export declare function fileProposals(Sage: SageSurface, proposals: TriageReport['dispatch']['proposals']): Promise<import('@wrongstack/sage').ProposalFileResult>;
|
|
47
34
|
//# sourceMappingURL=memory-triage.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { InputReader, SlashCommand } from '@wrongstack/core/types';
|
|
2
|
+
import type { SlashCommandContext } from './command-context.js';
|
|
3
|
+
export declare function buildThemeCommand(opts: SlashCommandContext & {
|
|
4
|
+
inputReader?: InputReader | undefined;
|
|
5
|
+
}): SlashCommand;
|
|
6
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -7,6 +7,8 @@ export interface UpdateCommandDeps {
|
|
|
7
7
|
userHome: string;
|
|
8
8
|
renderer: Pick<TerminalRenderer, 'write'>;
|
|
9
9
|
flags?: SubcommandDeps['flags'] | undefined;
|
|
10
|
+
/** Test seam for a Windows PATH lookup; production uses process.env. */
|
|
11
|
+
environment?: NodeJS.ProcessEnv | undefined;
|
|
10
12
|
}
|
|
11
13
|
/** `wrongstack update` — Update the CLI via the detected global package manager. */
|
|
12
14
|
export declare function runUpdateCommand(args: string[], deps: UpdateCommandDeps): Promise<number>;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
detectUpdatePackageName,
|
|
4
4
|
runUpdateCommand,
|
|
5
5
|
updateCmd
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-53STH6CX.js";
|
|
7
7
|
import "./chunk-U3SS4NRH.js";
|
|
8
8
|
import "./chunk-NUIHRGPY.js";
|
|
9
9
|
import "./chunk-7OCVIDC7.js";
|
|
@@ -13,4 +13,4 @@ export {
|
|
|
13
13
|
runUpdateCommand,
|
|
14
14
|
updateCmd
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=update-
|
|
16
|
+
//# sourceMappingURL=update-VZSOZGYC.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createKanbanRunMirror
|
|
3
|
-
} from "./chunk-VCYZ3WZV.js";
|
|
4
1
|
import {
|
|
5
2
|
createHqCommandDispatcher
|
|
6
3
|
} from "./chunk-7YLN7YUA.js";
|
|
4
|
+
import {
|
|
5
|
+
createKanbanRunMirror
|
|
6
|
+
} from "./chunk-VCYZ3WZV.js";
|
|
7
7
|
import {
|
|
8
8
|
startCliHqConnection
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FKWHSFX4.js";
|
|
10
10
|
import {
|
|
11
11
|
WEBUI_SESSION_CHILD_CAPABILITIES
|
|
12
12
|
} from "./chunk-3JPTNADJ.js";
|
|
@@ -1591,4 +1591,4 @@ async function runWebUI(opts) {
|
|
|
1591
1591
|
export {
|
|
1592
1592
|
runWebUI
|
|
1593
1593
|
};
|
|
1594
|
-
//# sourceMappingURL=webui-server-
|
|
1594
|
+
//# sourceMappingURL=webui-server-FTG7JAZU.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Narrow adapter that bridges the resolved SAGE `MemoryPort` to the
|
|
3
|
+
* `DomainGlossary` shape the prompt builder consumes.
|
|
4
|
+
*
|
|
5
|
+
* Background
|
|
6
|
+
* ----------
|
|
7
|
+
* The agent system prompt wants a compact `[Project Jargon Dictionary]`
|
|
8
|
+
* block listing only the project's `domain-term`-tagged memories. The
|
|
9
|
+
* block must come from SAGE so the same single-owner-of-SQLite invariant
|
|
10
|
+
* holds (per `packages/sage/docs/direct-icp-usage.md`). But the prompt
|
|
11
|
+
* builder runs **before** any per-turn SAGE middleware has filtered the
|
|
12
|
+
* corpus — so we can't simply hand it the legacy `MemoryStore` and ask
|
|
13
|
+
* it to call `list()`. That would scan every memory on every prompt
|
|
14
|
+
* build, which is exactly what the glossary block was supposed to
|
|
15
|
+
* avoid.
|
|
16
|
+
*
|
|
17
|
+
* Instead, we ask SAGE for only the `domain-term`-tagged subset using
|
|
18
|
+
* the typed `SageServiceLike.searchSage({ query: 'domain-term', limit })`
|
|
19
|
+
* op (which performs the tag/keyword filter at the SQL layer), then map
|
|
20
|
+
* the resulting `Sage[]` into the canonical `MemoryEntry` shape that
|
|
21
|
+
* `renderDomainGlossary` in `packages/core/src/core/system-prompt-glossary.ts`
|
|
22
|
+
* is typed against.
|
|
23
|
+
*
|
|
24
|
+
* Architectural rule
|
|
25
|
+
* ------------------
|
|
26
|
+
* This module imports from `@wrongstack/sage` directly — **never** from
|
|
27
|
+
* `@wrongstack/sage-mcp`. The CLI is an in-process consumer; the MCP
|
|
28
|
+
* surface is reserved for out-of-process clients (Claude Desktop, other
|
|
29
|
+
* agent runtimes).
|
|
30
|
+
*/
|
|
31
|
+
import type { MemoryEntry, MemoryPort } from '@wrongstack/core/types';
|
|
32
|
+
/**
|
|
33
|
+
* Narrow `MemoryEntry`-shaped list provider for the `[Project Jargon Dictionary]`
|
|
34
|
+
* block. Returns only `domain-term`-tagged SAGE memories, mapped to the
|
|
35
|
+
* canonical `MemoryEntry` shape `renderDomainGlossary` is typed against.
|
|
36
|
+
*
|
|
37
|
+
* Robustness contract:
|
|
38
|
+
* - If the port is the legacy `LegacyMemoryPortAdapter` (no SAGE
|
|
39
|
+
* capability), the helper returns an empty glossary rather than
|
|
40
|
+
* throwing — the prompt must still assemble.
|
|
41
|
+
* - If `searchSage` rejects, the wrapper returns an empty glossary
|
|
42
|
+
* for this prompt build; SAGE itself remains the source of truth and
|
|
43
|
+
* the next prompt retry can succeed.
|
|
44
|
+
*/
|
|
45
|
+
export interface DomainGlossaryListProvider {
|
|
46
|
+
list(scope: 'project-memory', limit?: number): Promise<ReadonlyArray<MemoryEntry>>;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Build a `DomainGlossaryListProvider` over a SAGE-aware `MemoryPort`.
|
|
50
|
+
*
|
|
51
|
+
* The mapping is honest: every `MemoryEntry` field that core will read
|
|
52
|
+
* (`text`, `tags`, `confidence`, `ts`, `priority`) is populated from the
|
|
53
|
+
* corresponding `Sage` field. `text` is preserved verbatim because
|
|
54
|
+
* `SageDomainTermExtractor` writes the canonical `"Term — Definition"`
|
|
55
|
+
* format that `parseTermEntry` in core splits back apart.
|
|
56
|
+
*/
|
|
57
|
+
export declare function createDomainGlossaryAdapter(memoryStore: MemoryPort): DomainGlossaryListProvider;
|
|
58
|
+
//# sourceMappingURL=domain-glossary.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refresh the `.wrongstack/domain-terms.md` mirror file from the
|
|
3
|
+
* resolved SAGE `MemoryPort` at CLI boot.
|
|
4
|
+
*
|
|
5
|
+
* Background
|
|
6
|
+
* ----------
|
|
7
|
+
* The Project Jargon Dictionary feature splits ownership between two
|
|
8
|
+
* storage backends (per `packages/sage/docs/direct-icp-usage.md`):
|
|
9
|
+
* - SAGE's SQLite store is the authoritative source of truth.
|
|
10
|
+
* - `.wrongstack/domain-terms.md` is a *derived* view of the same
|
|
11
|
+
* data, kept on disk so humans (and ProjectRoot sandboxes) can
|
|
12
|
+
* read the glossary without going through the IPC client.
|
|
13
|
+
*
|
|
14
|
+
* `SageDomainTermExtractor.writeDomainTermsFile` already knows how to
|
|
15
|
+
* regenerate the file from the canonical SAGE state. What it lacks
|
|
16
|
+
* is a runtime host caller — the helper exists only in tests. This
|
|
17
|
+
* module closes that gap for the CLI host.
|
|
18
|
+
*
|
|
19
|
+
* Behaviour
|
|
20
|
+
* ---------
|
|
21
|
+
* - **Fire and forget at boot.** The mirror is a derived artefact;
|
|
22
|
+
* a failure to refresh at startup must not abort the CLI. The
|
|
23
|
+
* helper logs via `writeErr` and returns `null` on failure.
|
|
24
|
+
* - **Idempotent.** Calling this on every boot is safe: the file is
|
|
25
|
+
* regenerated atomically by `writeDomainTermsFile`, and the content
|
|
26
|
+
* is fully derived from SAGE state.
|
|
27
|
+
* - **Honest about scope.** Only the CLI host invokes this. TUI and
|
|
28
|
+
* WebUI hosts share the same SAGE port and read the same file; the
|
|
29
|
+
* CLI boot path is the canonical place to refresh the mirror.
|
|
30
|
+
*/
|
|
31
|
+
import type { MemoryPort } from '@wrongstack/core/types';
|
|
32
|
+
export interface RefreshDomainTermsMirrorOptions {
|
|
33
|
+
/** Absolute project root whose `.wrongstack/domain-terms.md` should be refreshed. */
|
|
34
|
+
projectRoot: string;
|
|
35
|
+
/**
|
|
36
|
+
* Resolved SAGE `MemoryPort`. The extractor reads the `domain-term`
|
|
37
|
+
* tagged subset from this port.
|
|
38
|
+
*/
|
|
39
|
+
memoryStore: MemoryPort;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Regenerate the mirror file from the current SAGE state.
|
|
43
|
+
*
|
|
44
|
+
* Returns the absolute path of the written file, or `null` when the
|
|
45
|
+
* refresh failed (the CLI logs the underlying reason to stderr and
|
|
46
|
+
* continues — the SAGE corpus remains authoritative).
|
|
47
|
+
*
|
|
48
|
+
* Never throws — callers are guaranteed to receive a `string | null`
|
|
49
|
+
* outcome.
|
|
50
|
+
*/
|
|
51
|
+
export declare function refreshDomainTermsMirror(options: RefreshDomainTermsMirrorOptions): Promise<string | null>;
|
|
52
|
+
//# sourceMappingURL=domain-terms-mirror.d.ts.map
|
|
@@ -79,6 +79,8 @@ export declare function createAgent(params: {
|
|
|
79
79
|
maxToolTimeoutMs?: number | undefined;
|
|
80
80
|
defaultExecutionStrategy: 'parallel' | 'sequential' | 'smart';
|
|
81
81
|
perIterationOutputCapBytes: number;
|
|
82
|
+
/** Opt-in Kanban governance gate; see ToolsConfig.kanbanGovernance. */
|
|
83
|
+
kanbanGovernance?: boolean | undefined;
|
|
82
84
|
loopDetection?: import('@wrongstack/core/types').LoopDetectionConfig | undefined;
|
|
83
85
|
};
|
|
84
86
|
};
|
package/dist/wiring/replay.d.ts
CHANGED
|
@@ -23,11 +23,21 @@ import type { WstackPaths } from '@wrongstack/core/utils';
|
|
|
23
23
|
* The log lives next to the session JSONL via
|
|
24
24
|
* `sessionScopedPath(projectSessions, sessionId, '.replay.jsonl')`,
|
|
25
25
|
* colocated with annotations and audit sidecars.
|
|
26
|
+
*
|
|
27
|
+
* Call this AFTER the session exists. `TOKENS.ProviderRunner` is resolved per
|
|
28
|
+
* request inside the agent loop, not at agent construction, so the binding only
|
|
29
|
+
* has to be in place before the first `run()` — which is what lets `--record`
|
|
30
|
+
* name the real session instead of inventing one.
|
|
26
31
|
*/
|
|
27
32
|
export interface BindReplayOptions {
|
|
28
33
|
container: Container;
|
|
29
34
|
wpaths: WstackPaths;
|
|
30
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Explicit id for `--replay <id>`, or a resolver for `--record` so the log
|
|
37
|
+
* lands beside the live session's transcript instead of under a synthetic
|
|
38
|
+
* name. See {@link ReplayProviderRunnerOptions.sessionId}.
|
|
39
|
+
*/
|
|
40
|
+
sessionId: string | (() => string);
|
|
31
41
|
mode: ReplayMode;
|
|
32
42
|
logger?: Logger | undefined;
|
|
33
43
|
}
|
package/dist/wiring/sage.d.ts
CHANGED
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
import type { AgentPipelines } from '@wrongstack/core/agent';
|
|
2
|
-
import type { EventBus } from '@wrongstack/core/kernel';
|
|
3
|
-
import type { Config, Logger, MemoryPort } from '@wrongstack/core/types';
|
|
4
|
-
export interface SageWiringDeps {
|
|
5
|
-
config: Config;
|
|
6
|
-
pipelines: AgentPipelines;
|
|
7
|
-
memoryStore: MemoryPort | undefined;
|
|
8
|
-
logger: Logger;
|
|
9
|
-
events: EventBus;
|
|
10
|
-
getSessionId?: (() => string | undefined) | undefined;
|
|
11
|
-
}
|
|
12
1
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
2
|
+
* CLI host adapter for shared SAGE wiring.
|
|
3
|
+
*
|
|
4
|
+
* Implementation lives in `@wrongstack/sage` so CLI and WebUI cannot drift.
|
|
16
5
|
*/
|
|
17
|
-
export
|
|
18
|
-
export declare function setupSage(deps: SageWiringDeps): () => Promise<void>;
|
|
6
|
+
export { AUTO_HYGIENE_INTERVAL_MS, _resetAutoHygieneThrottleForTesting, sageHygieneOptionsFromConfig, setupSage, type SageHostWiringDeps as SageWiringDeps, } from '@wrongstack/sage';
|
|
19
7
|
//# sourceMappingURL=sage.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.305.0",
|
|
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": [
|
|
@@ -42,30 +42,30 @@
|
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"ws": "^8.21.1",
|
|
45
|
-
"@wrongstack/
|
|
46
|
-
"@wrongstack/
|
|
47
|
-
"@wrongstack/
|
|
48
|
-
"@wrongstack/
|
|
49
|
-
"@wrongstack/plug-lsp": "0.
|
|
50
|
-
"@wrongstack/
|
|
51
|
-
"@wrongstack/requirement-intake": "0.
|
|
52
|
-
"@wrongstack/
|
|
53
|
-
"@wrongstack/
|
|
54
|
-
"@wrongstack/
|
|
55
|
-
"@wrongstack/
|
|
56
|
-
"@wrongstack/
|
|
57
|
-
"@wrongstack/
|
|
58
|
-
"@wrongstack/
|
|
59
|
-
"@wrongstack/
|
|
60
|
-
"@wrongstack/
|
|
61
|
-
"@wrongstack/
|
|
62
|
-
"@wrongstack/
|
|
63
|
-
"@wrongstack/webui
|
|
64
|
-
"@wrongstack/
|
|
65
|
-
"@wrongstack/webui-
|
|
45
|
+
"@wrongstack/bench": "0.305.0",
|
|
46
|
+
"@wrongstack/core": "0.305.0",
|
|
47
|
+
"@wrongstack/acp": "0.305.0",
|
|
48
|
+
"@wrongstack/kanban": "0.305.0",
|
|
49
|
+
"@wrongstack/plug-lsp": "0.305.0",
|
|
50
|
+
"@wrongstack/mcp": "0.305.0",
|
|
51
|
+
"@wrongstack/requirement-intake": "0.305.0",
|
|
52
|
+
"@wrongstack/sdd": "0.305.0",
|
|
53
|
+
"@wrongstack/sage": "0.305.0",
|
|
54
|
+
"@wrongstack/providers": "0.305.0",
|
|
55
|
+
"@wrongstack/runtime": "0.305.0",
|
|
56
|
+
"@wrongstack/plugins": "0.305.0",
|
|
57
|
+
"@wrongstack/security-scanner": "0.305.0",
|
|
58
|
+
"@wrongstack/techstack": "0.305.0",
|
|
59
|
+
"@wrongstack/simpleui": "0.305.0",
|
|
60
|
+
"@wrongstack/tools": "0.305.0",
|
|
61
|
+
"@wrongstack/telegram": "0.305.0",
|
|
62
|
+
"@wrongstack/webui-hq": "0.305.0",
|
|
63
|
+
"@wrongstack/webui": "0.305.0",
|
|
64
|
+
"@wrongstack/tui": "0.305.0",
|
|
65
|
+
"@wrongstack/webui-server": "0.305.0"
|
|
66
66
|
},
|
|
67
67
|
"optionalDependencies": {
|
|
68
|
-
"@wrongstack/desktop": "0.
|
|
68
|
+
"@wrongstack/desktop": "0.305.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/node": "^26.1.2",
|