@wrongstack/cli 0.303.0 → 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-AQMGKW6O.js → acp-5ZLGFHWP.js} +4 -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/{chunk-JW75HY4F.js → chunk-FKWHSFX4.js} +33 -4
- package/dist/{chunk-LUAFQIXT.js → chunk-RHLQT3EV.js} +11 -1
- package/dist/{cli-main-37XO26GK.js → cli-main-W3T56YCY.js} +390 -299
- package/dist/execute-deps.d.ts +16 -0
- package/dist/{execution-MVOH6PAQ.js → execution-YMBD7YWC.js} +68 -18
- package/dist/fleet/host-context.d.ts +2 -0
- package/dist/fleet/host-session-writer.d.ts +33 -0
- package/dist/fleet/host.d.ts +10 -0
- package/dist/{hq-CD77GVSS.js → hq-5G6D5YIU.js} +2 -2
- package/dist/{hq-server-DME6EWIO.js → hq-server-IVZLVCFV.js} +2 -2
- package/dist/index.js +13 -56
- package/dist/{mailbox-serve-DBOOOOWZ.js → mailbox-serve-V3QIJBDH.js} +2 -2
- package/dist/{mcp-AX6ZAFJR.js → mcp-MSARYOPN.js} +4 -2
- package/dist/replay-XU6ZD7GM.js +34 -0
- package/dist/slash-commands/memory-triage.d.ts +4 -17
- 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
|
@@ -264,7 +264,9 @@ function buildAcpServerAgentFactory(deps, options = {}) {
|
|
|
264
264
|
maxToolTimeoutMs: config.tools?.maxToolTimeoutMs ?? 3e5,
|
|
265
265
|
perIterationOutputCapBytes: config.tools?.perIterationOutputCapBytes ?? 1e5,
|
|
266
266
|
tracer: void 0,
|
|
267
|
-
|
|
267
|
+
// Kanban tracks work; it does not gate it. Off unless the operator opts
|
|
268
|
+
// in. See wiring/pipeline.ts for why all four hosts must agree.
|
|
269
|
+
requireKanbanGovernance: config.tools?.kanbanGovernance ?? false
|
|
268
270
|
});
|
|
269
271
|
return new Agent({
|
|
270
272
|
container,
|
|
@@ -909,4 +911,4 @@ ${renderAcpBenchText(result)}
|
|
|
909
911
|
export {
|
|
910
912
|
acpCmd
|
|
911
913
|
};
|
|
912
|
-
//# sourceMappingURL=acp-
|
|
914
|
+
//# sourceMappingURL=acp-5ZLGFHWP.js.map
|
|
@@ -23,6 +23,19 @@ export interface SystemPromptBuilderPaths {
|
|
|
23
23
|
interface PathJoiner {
|
|
24
24
|
join(a: string, b: string): string;
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Narrow adapter for the `[Project Jargon Dictionary]` block.
|
|
28
|
+
*
|
|
29
|
+
* Re-exported from `../wiring/domain-glossary.ts` so the helper keeps
|
|
30
|
+
* its zero-coupling contract (no direct import of core's
|
|
31
|
+
* `MemoryStore` / `MemoryEntry` types). The CLI provides a closure
|
|
32
|
+
* over the resolved SAGE `memoryStore` that calls
|
|
33
|
+
* `searchSage('domain-term', { limit })` and maps the result to the
|
|
34
|
+
* canonical `MemoryEntry` shape that `renderDomainGlossary` in core
|
|
35
|
+
* is typed against.
|
|
36
|
+
*/
|
|
37
|
+
import type { DomainGlossaryListProvider as DomainGlossaryAdapter } from '../wiring/domain-glossary.js';
|
|
38
|
+
export type { DomainGlossaryListProvider } from '../wiring/domain-glossary.js';
|
|
26
39
|
interface BindSystemPromptBuilderDeps {
|
|
27
40
|
/**
|
|
28
41
|
* The `container` from main(). The helper only calls
|
|
@@ -74,6 +87,17 @@ interface BindSystemPromptBuilderDeps {
|
|
|
74
87
|
/** `config.systemPrompt.variant` — selects system.md, system-lite.md, or system-pro.md. */
|
|
75
88
|
systemPromptVariant?: SystemInstructionVariant | undefined;
|
|
76
89
|
paths: SystemPromptBuilderPaths;
|
|
90
|
+
/**
|
|
91
|
+
* Optional narrow `domain-term` adapter for the prompt glossary block.
|
|
92
|
+
* The CLI provides a closure over the resolved SAGE `memoryStore` that
|
|
93
|
+
* calls `search({ query: 'domain-term', scope: 'project-memory', limit })`
|
|
94
|
+
* and returns only the tagged subset, then forwards the result through the
|
|
95
|
+
* `DomainGlossary.list` shape consumed by
|
|
96
|
+
* `packages/core/src/core/system-prompt-glossary.ts`.
|
|
97
|
+
*
|
|
98
|
+
* Omit → no `[Project Jargon Dictionary]` block in the prompt.
|
|
99
|
+
*/
|
|
100
|
+
domainGlossary?: DomainGlossaryAdapter | undefined;
|
|
77
101
|
/** `path.join`-shaped helper from the runtime. */
|
|
78
102
|
pathJoiner: PathJoiner;
|
|
79
103
|
/** The `TOKENS.SystemPromptBuilder` token, opaque to the
|
|
@@ -91,5 +115,4 @@ interface BindSystemPromptBuilderDeps {
|
|
|
91
115
|
* matches the pre-refactor inline behavior exactly.
|
|
92
116
|
*/
|
|
93
117
|
export declare function bindSystemPromptBuilder(deps: BindSystemPromptBuilderDeps): void;
|
|
94
|
-
export {};
|
|
95
118
|
//# sourceMappingURL=system-prompt-builder.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Agent, type Context } from '@wrongstack/core/agent';
|
|
2
|
-
import type
|
|
2
|
+
import { type EventBus } from '@wrongstack/core/kernel';
|
|
3
3
|
import type { Config, MemoryPort, ModeStore, SkillLoader } from '@wrongstack/core/types';
|
|
4
4
|
import type { TuiRuntimeState } from './tui-runtime-state.js';
|
|
5
5
|
export interface ProjectSwitchContext {
|
|
@@ -73,6 +73,20 @@ export interface TuiRuntimeState {
|
|
|
73
73
|
activateSessionIdentity?: ((sessionId: string, target?: SessionIdentityTarget) => Promise<void>) | undefined;
|
|
74
74
|
/** Todos checkpoint detach function. Mutated by switchProjectInPlace. */
|
|
75
75
|
detachActiveTodosCheckpoint: (() => void | Promise<void>) | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Forward-declared session ref that lives on the cli-main scope. Mutated by
|
|
78
|
+
* `resumeSession()` when an in-process `/resume` swaps the active writer so
|
|
79
|
+
* provider-side `getSessionId: () => sessionRef.current?.id` callbacks and
|
|
80
|
+
* record-mode bindings follow the resumed session instead of staying pinned
|
|
81
|
+
* to the boot session.
|
|
82
|
+
*
|
|
83
|
+
* Optional: tests/hosts that predate the resume refactor can omit it. The
|
|
84
|
+
* resume handler is then a no-op for the ref, leaving provider calls pinned
|
|
85
|
+
* to the boot session — same behavior as before this field existed.
|
|
86
|
+
*/
|
|
87
|
+
sessionRef?: {
|
|
88
|
+
current: import('@wrongstack/core/types').SessionWriter | undefined;
|
|
89
|
+
} | undefined;
|
|
76
90
|
/** Pending project switch (F1 picker / F10 sessions). Set by onProjectSelect/onSwitchToSession. */
|
|
77
91
|
pendingProjectSwitch: PendingProjectSwitch | null;
|
|
78
92
|
/** Lazy AutonomousCoordinator. Set by ensureAutonomousCoordinator. */
|
|
@@ -4,7 +4,11 @@ import { createHqPublisherFromEnv, resolveHqConfig } from "@wrongstack/core/hq";
|
|
|
4
4
|
import { WebSocket } from "ws";
|
|
5
5
|
|
|
6
6
|
// src/kanban-hq-sync.ts
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
deriveHqProjectId,
|
|
9
|
+
MAX_HQ_KANBAN_BOARD_BYTES,
|
|
10
|
+
redactHqEventPayload
|
|
11
|
+
} from "@wrongstack/core/hq";
|
|
8
12
|
import {
|
|
9
13
|
bridgeKanbanSupervisor,
|
|
10
14
|
deleteBoard,
|
|
@@ -18,6 +22,7 @@ var SYNC_STATE_KEY = "hq-sync-state-v1";
|
|
|
18
22
|
var MAX_KANBAN_SNAPSHOT_PAYLOAD_BYTES = 512 * 1024;
|
|
19
23
|
var KANBAN_TOMBSTONE_RETENTION_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
20
24
|
var MAX_BOARDS_PER_PUBLISH = 50;
|
|
25
|
+
var KANBAN_SNAPSHOT_SUMMARY_CAP = 1e5;
|
|
21
26
|
function warnSyncFailure(error) {
|
|
22
27
|
process.emitWarning(
|
|
23
28
|
`WrongStack kanban HQ sync failed (best-effort, will retry on next change): ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -123,6 +128,14 @@ function createKanbanHqSync(projectRoot, projectId = deriveHqProjectId(projectRo
|
|
|
123
128
|
}
|
|
124
129
|
present.add(boardId);
|
|
125
130
|
const record = boardRecord(board);
|
|
131
|
+
const wireBytes = hqWireBoardBytes(record.board, target.redactionPolicy);
|
|
132
|
+
if (wireBytes > MAX_HQ_KANBAN_BOARD_BYTES) {
|
|
133
|
+
process.emitWarning(
|
|
134
|
+
`Kanban board "${boardId}" serializes to ${wireBytes} bytes for HQ, over the ${MAX_HQ_KANBAN_BOARD_BYTES}-byte per-board limit. It will not appear in HQ until it shrinks; archive completed cards.`,
|
|
135
|
+
{ code: "WRONGSTACK_HQ_KANBAN_BOARD_DROPPED" }
|
|
136
|
+
);
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
126
139
|
const known = state.boards[boardId];
|
|
127
140
|
const hadTombstone = state.tombstones[boardId] !== void 0;
|
|
128
141
|
if (fullSnapshot || hadTombstone || known === void 0 || compareVersions(known.revision, known.updatedAt, record.revision, record.updatedAt) !== 0) {
|
|
@@ -160,7 +173,7 @@ function createKanbanHqSync(projectRoot, projectId = deriveHqProjectId(projectRo
|
|
|
160
173
|
target.publishEvent({
|
|
161
174
|
type: "kanban.snapshot",
|
|
162
175
|
payload,
|
|
163
|
-
maxSummaryLength:
|
|
176
|
+
maxSummaryLength: KANBAN_SNAPSHOT_SUMMARY_CAP
|
|
164
177
|
});
|
|
165
178
|
}
|
|
166
179
|
};
|
|
@@ -270,6 +283,15 @@ function createKanbanHqSync(projectRoot, projectId = deriveHqProjectId(projectRo
|
|
|
270
283
|
}
|
|
271
284
|
};
|
|
272
285
|
}
|
|
286
|
+
function hqWireBoardBytes(board, policy) {
|
|
287
|
+
const raw = Buffer.byteLength(JSON.stringify(board), "utf8");
|
|
288
|
+
if (raw <= MAX_HQ_KANBAN_BOARD_BYTES) return raw;
|
|
289
|
+
const redacted = redactHqEventPayload("kanban.snapshot", board, {
|
|
290
|
+
policy,
|
|
291
|
+
maxSummaryLength: KANBAN_SNAPSHOT_SUMMARY_CAP
|
|
292
|
+
}).value;
|
|
293
|
+
return Buffer.byteLength(JSON.stringify(redacted), "utf8");
|
|
294
|
+
}
|
|
273
295
|
function boardRecord(board) {
|
|
274
296
|
return {
|
|
275
297
|
boardId: board.id,
|
|
@@ -325,7 +347,14 @@ function chunkSnapshotPayload(projectId, generatedAt, boards, tombstones) {
|
|
|
325
347
|
for (const board of boards) append("boards", board);
|
|
326
348
|
for (const tombstone of tombstones) append("tombstones", tombstone);
|
|
327
349
|
pushCurrent();
|
|
328
|
-
|
|
350
|
+
const result = chunks.length > 0 ? chunks : [emptyPayload()];
|
|
351
|
+
if (result.length > 1) {
|
|
352
|
+
result.forEach((payload, index) => {
|
|
353
|
+
payload.chunkIndex = index;
|
|
354
|
+
payload.chunkCount = result.length;
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
return result;
|
|
329
358
|
}
|
|
330
359
|
function coalesceRemoteSnapshots(older, newer) {
|
|
331
360
|
const byBoardId = /* @__PURE__ */ new Map();
|
|
@@ -478,4 +507,4 @@ function startCliHqConnection(options) {
|
|
|
478
507
|
export {
|
|
479
508
|
startCliHqConnection
|
|
480
509
|
};
|
|
481
|
-
//# sourceMappingURL=chunk-
|
|
510
|
+
//# sourceMappingURL=chunk-FKWHSFX4.js.map
|
|
@@ -3921,6 +3921,16 @@ function handleClient(ws, clients, browsers, eventLog, auth, snapshotBroadcaster
|
|
|
3921
3921
|
}
|
|
3922
3922
|
const parsedPayload = parseHqEventPayload(incomingEvent.type, incomingEvent.payload);
|
|
3923
3923
|
if (!parsedPayload.ok) {
|
|
3924
|
+
console.warn(
|
|
3925
|
+
JSON.stringify({
|
|
3926
|
+
level: "warn",
|
|
3927
|
+
event: "hq.event_payload_rejected",
|
|
3928
|
+
eventType: incomingEvent.type,
|
|
3929
|
+
clientId: client.clientId,
|
|
3930
|
+
projectId: client.projectId,
|
|
3931
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
3932
|
+
})
|
|
3933
|
+
);
|
|
3924
3934
|
return;
|
|
3925
3935
|
}
|
|
3926
3936
|
client.lastEventSeq = incomingEvent.seq;
|
|
@@ -4773,4 +4783,4 @@ export {
|
|
|
4773
4783
|
startHqServer,
|
|
4774
4784
|
HqInsecureExposureError2 as HqInsecureExposureError
|
|
4775
4785
|
};
|
|
4776
|
-
//# sourceMappingURL=chunk-
|
|
4786
|
+
//# sourceMappingURL=chunk-RHLQT3EV.js.map
|