@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
|
@@ -263,7 +263,10 @@ function buildAcpServerAgentFactory(deps, options = {}) {
|
|
|
263
263
|
iterationTimeoutMs: config.tools?.iterationTimeoutMs ?? 12e4,
|
|
264
264
|
maxToolTimeoutMs: config.tools?.maxToolTimeoutMs ?? 3e5,
|
|
265
265
|
perIterationOutputCapBytes: config.tools?.perIterationOutputCapBytes ?? 1e5,
|
|
266
|
-
tracer: void 0
|
|
266
|
+
tracer: void 0,
|
|
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
|
|
267
270
|
});
|
|
268
271
|
return new Agent({
|
|
269
272
|
container,
|
|
@@ -908,4 +911,4 @@ ${renderAcpBenchText(result)}
|
|
|
908
911
|
export {
|
|
909
912
|
acpCmd
|
|
910
913
|
};
|
|
911
|
-
//# 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. */
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TUI Theme adapter — extracts the getThemePreset/saveThemePreset pair from
|
|
3
|
+
* the runTui() options literal.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the `createSettingsAdapter` shape (see `./tui-settings-adapter.ts`)
|
|
6
|
+
* but is much narrower: theme is a single enum-valued key, so there's no
|
|
7
|
+
* section merge, no schema fan-out, and no encrypted-secret dance (the
|
|
8
|
+
* value is a plain preset name, not a credential).
|
|
9
|
+
*
|
|
10
|
+
* The disk write goes to the active profile's config file (same target
|
|
11
|
+
* `createSettingsAdapter` writes) so both layers share the same source of
|
|
12
|
+
* truth: future TUI boots read `themePreset` from the same JSON file the
|
|
13
|
+
* CLI writes via `/theme` and the WebUI flips via Settings.
|
|
14
|
+
*/
|
|
15
|
+
import type { ConfigStore, ThemePresetId } from '@wrongstack/core/types';
|
|
16
|
+
import { type WstackPaths } from '@wrongstack/core/utils';
|
|
17
|
+
export interface ThemeAdapterDeps {
|
|
18
|
+
configStore: ConfigStore;
|
|
19
|
+
wpaths: Pick<WstackPaths, 'profileConfig'>;
|
|
20
|
+
}
|
|
21
|
+
export interface ThemeAdapter {
|
|
22
|
+
/** Read the live preset (memory-backed). Returns undefined when unset. */
|
|
23
|
+
getThemePreset: () => ThemePresetId | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Persist a new preset to BOTH the in-memory configStore (so the running
|
|
26
|
+
* session sees it immediately) and the active profile's config file on
|
|
27
|
+
* disk (so the next boot starts with this preset applied). Unknown ids
|
|
28
|
+
* are rejected without writing.
|
|
29
|
+
*/
|
|
30
|
+
saveThemePreset: (preset: ThemePresetId) => Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
export declare function createThemeAdapter({ configStore, wpaths }: ThemeAdapterDeps): ThemeAdapter;
|
|
33
|
+
//# sourceMappingURL=tui-theme-adapter.d.ts.map
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
// src/subcommands/handlers/update.ts
|
|
9
9
|
import { spawn } from "node:child_process";
|
|
10
10
|
import { existsSync, realpathSync } from "node:fs";
|
|
11
|
+
import * as path from "node:path";
|
|
11
12
|
var MAX_UPDATE_OUTPUT_CHARS = 256 * 1024;
|
|
12
13
|
async function runUpdateCommand(args, deps) {
|
|
13
14
|
const cwd = deps.cwd;
|
|
@@ -75,9 +76,20 @@ async function runUpdateCommand(args, deps) {
|
|
|
75
76
|
return 0;
|
|
76
77
|
}
|
|
77
78
|
const packageManager = parsed.packageManager ?? detectUpdatePackageManager();
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
let updateCommand;
|
|
80
|
+
try {
|
|
81
|
+
updateCommand = buildUpdateCommand(packageManager, packageName, info.latest, {
|
|
82
|
+
allowScripts: parsed.allowScripts,
|
|
83
|
+
cwd,
|
|
84
|
+
env: deps.environment
|
|
85
|
+
});
|
|
86
|
+
} catch (err) {
|
|
87
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
88
|
+
deps.renderer.write(`
|
|
89
|
+
Update failed: ${msg}
|
|
90
|
+
`);
|
|
91
|
+
return 1;
|
|
92
|
+
}
|
|
81
93
|
deps.renderer.write(`Updating wrongstack from v${info.current} to v${info.latest}...
|
|
82
94
|
`);
|
|
83
95
|
deps.renderer.write(`Running: ${updateCommand.display}
|
|
@@ -122,6 +134,10 @@ Update ${termination}.
|
|
|
122
134
|
${result.stdout}`.trim();
|
|
123
135
|
if (detail) deps.renderer.write(`
|
|
124
136
|
${detail}
|
|
137
|
+
`);
|
|
138
|
+
const lockedFilesGuidance = windowsLockedFilesGuidance(detail);
|
|
139
|
+
if (lockedFilesGuidance) deps.renderer.write(`
|
|
140
|
+
${lockedFilesGuidance}
|
|
125
141
|
`);
|
|
126
142
|
deps.renderer.write(
|
|
127
143
|
`
|
|
@@ -247,36 +263,53 @@ function detectUpdatePackageName(argv = process.argv) {
|
|
|
247
263
|
const entry = (argv[1] ?? "").replace(/\\/g, "/").toLowerCase();
|
|
248
264
|
return entry.includes("/node_modules/@wrongstack/cli/") || entry.includes("/packages/cli/dist/") ? "@wrongstack/cli" : "wrongstack";
|
|
249
265
|
}
|
|
250
|
-
function buildUpdateCommand(packageManager, packageName, version, opts = {
|
|
266
|
+
function buildUpdateCommand(packageManager, packageName, version, opts = {
|
|
267
|
+
allowScripts: false
|
|
268
|
+
}) {
|
|
251
269
|
const ignoreScripts = !opts.allowScripts;
|
|
252
270
|
const target = `${packageName}@${version}`;
|
|
253
271
|
switch (packageManager) {
|
|
254
272
|
case "pnpm":
|
|
255
273
|
return command(
|
|
256
274
|
packageManager,
|
|
257
|
-
ignoreScripts ? ["add", "-g", "--ignore-scripts", target] : ["add", "-g", target]
|
|
275
|
+
ignoreScripts ? ["add", "-g", "--ignore-scripts", target] : ["add", "-g", target],
|
|
276
|
+
opts.cwd,
|
|
277
|
+
opts.env
|
|
258
278
|
);
|
|
259
279
|
case "yarn":
|
|
260
280
|
return command(
|
|
261
281
|
packageManager,
|
|
262
|
-
ignoreScripts ? ["global", "add", "--ignore-scripts", target] : ["global", "add", target]
|
|
282
|
+
ignoreScripts ? ["global", "add", "--ignore-scripts", target] : ["global", "add", target],
|
|
283
|
+
opts.cwd,
|
|
284
|
+
opts.env
|
|
263
285
|
);
|
|
264
286
|
case "bun":
|
|
265
287
|
return command(
|
|
266
288
|
packageManager,
|
|
267
|
-
ignoreScripts ? ["add", "-g", "--ignore-scripts", target] : ["add", "-g", target]
|
|
289
|
+
ignoreScripts ? ["add", "-g", "--ignore-scripts", target] : ["add", "-g", target],
|
|
290
|
+
opts.cwd,
|
|
291
|
+
opts.env
|
|
268
292
|
);
|
|
269
293
|
case "npm":
|
|
270
294
|
return command(
|
|
271
295
|
packageManager,
|
|
272
|
-
ignoreScripts ? ["install", "-g", "--ignore-scripts", target] : ["install", "-g", target]
|
|
296
|
+
ignoreScripts ? ["install", "-g", "--ignore-scripts", target] : ["install", "-g", target],
|
|
297
|
+
opts.cwd,
|
|
298
|
+
opts.env
|
|
273
299
|
);
|
|
274
300
|
}
|
|
275
301
|
}
|
|
276
|
-
function command(pm, args) {
|
|
302
|
+
function command(pm, args, cwd, env = process.env) {
|
|
277
303
|
const display = `${pm} ${args.join(" ")}`;
|
|
278
|
-
|
|
279
|
-
|
|
304
|
+
const resolvedExecutable = cwd ? resolveWin32PackageManagerPath(pm, cwd, env) : void 0;
|
|
305
|
+
if (process.platform === "win32" && cwd && !resolvedExecutable) {
|
|
306
|
+
throw new Error(
|
|
307
|
+
`Could not find ${pm} outside the current project directory. Install ${pm} globally or put its global executable directory on PATH.`
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
const executable = resolvedExecutable ?? pm;
|
|
311
|
+
if (process.platform === "win32" && (pm !== "bun" || /\.(?:cmd|bat)$/i.test(executable))) {
|
|
312
|
+
const shim = buildWin32CmdShimInvocation(executable, args);
|
|
280
313
|
return {
|
|
281
314
|
executable: shim.command,
|
|
282
315
|
args: shim.args,
|
|
@@ -284,7 +317,39 @@ function command(pm, args) {
|
|
|
284
317
|
windowsVerbatimArguments: shim.windowsVerbatimArguments
|
|
285
318
|
};
|
|
286
319
|
}
|
|
287
|
-
return { executable
|
|
320
|
+
return { executable, args, display };
|
|
321
|
+
}
|
|
322
|
+
function resolveWin32PackageManagerPath(packageManager, cwd, env = process.env, pathExists = existsSync) {
|
|
323
|
+
if (process.platform !== "win32") return void 0;
|
|
324
|
+
const pathValue = environmentValue(env, "PATH");
|
|
325
|
+
if (!pathValue) return void 0;
|
|
326
|
+
const cwdPath = path.win32.resolve(cwd).toLowerCase();
|
|
327
|
+
const extensions = packageManager.includes(".") ? [""] : environmentValue(env, "PATHEXT")?.split(";").filter(Boolean) ?? [
|
|
328
|
+
".COM",
|
|
329
|
+
".EXE",
|
|
330
|
+
".BAT",
|
|
331
|
+
".CMD"
|
|
332
|
+
];
|
|
333
|
+
for (const rawEntry of pathValue.split(";")) {
|
|
334
|
+
const entry = rawEntry.trim().replace(/^"|"$/g, "");
|
|
335
|
+
if (!entry || !path.win32.isAbsolute(entry)) continue;
|
|
336
|
+
const directory = path.win32.resolve(entry);
|
|
337
|
+
if (isPathInsideWin32(directory, cwdPath)) continue;
|
|
338
|
+
for (const extension of extensions) {
|
|
339
|
+
const candidate = path.win32.join(directory, `${packageManager}${extension}`);
|
|
340
|
+
if (pathExists(candidate)) return candidate;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return void 0;
|
|
344
|
+
}
|
|
345
|
+
function environmentValue(env, key) {
|
|
346
|
+
const match = Object.entries(env).find(([name]) => name.toUpperCase() === key);
|
|
347
|
+
return typeof match?.[1] === "string" ? match[1] : void 0;
|
|
348
|
+
}
|
|
349
|
+
function isPathInsideWin32(candidate, parent) {
|
|
350
|
+
const normalizedCandidate = path.win32.resolve(candidate).toLowerCase();
|
|
351
|
+
const relative = path.win32.relative(parent, normalizedCandidate);
|
|
352
|
+
return relative === "" || !relative.startsWith("..\\") && relative !== ".." && !path.win32.isAbsolute(relative);
|
|
288
353
|
}
|
|
289
354
|
function otherManagerCommands(selected, packageName, version, opts = { allowScripts: false }) {
|
|
290
355
|
const commands = ["npm", "pnpm", "yarn", "bun"].filter((pm) => pm !== selected).map((pm) => ` ${buildUpdateCommand(pm, packageName, version, opts).display}`);
|
|
@@ -301,6 +366,15 @@ function installWarningSummary(output) {
|
|
|
301
366
|
if (!/allow-scripts|allowScripts/i.test(output)) return null;
|
|
302
367
|
return "Install completed, but npm reported blocked lifecycle scripts. If a native optional feature is missing, rerun the update with npm script approval for the named package.";
|
|
303
368
|
}
|
|
369
|
+
function windowsLockedFilesGuidance(output) {
|
|
370
|
+
if (process.platform !== "win32") return null;
|
|
371
|
+
const hasLockError = /\b(?:EBUSY|EPERM|EACCES|ENOTEMPTY)\b/i.test(output);
|
|
372
|
+
const isWrongStackNativeFile = /(?:\.wrongstack-|wrongstack[\\/]node_modules|electron\.exe|dd_pprof\.node|node-pty)/i.test(
|
|
373
|
+
output
|
|
374
|
+
);
|
|
375
|
+
if (!hasLockError || !isWrongStackNativeFile) return null;
|
|
376
|
+
return "Windows could not replace a native file held by a running WrongStack process. Stop any WrongStack WebUI, Desktop, or background process, then rerun the same update command. Do not remove npm\u2019s .wrongstack-* staging directory until those processes have stopped.";
|
|
377
|
+
}
|
|
304
378
|
|
|
305
379
|
export {
|
|
306
380
|
runUpdateCommand,
|
|
@@ -308,4 +382,4 @@ export {
|
|
|
308
382
|
detectUpdatePackageManager,
|
|
309
383
|
detectUpdatePackageName
|
|
310
384
|
};
|
|
311
|
-
//# sourceMappingURL=chunk-
|
|
385
|
+
//# sourceMappingURL=chunk-53STH6CX.js.map
|
|
@@ -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
|
|
@@ -1998,7 +1998,7 @@ async function handleApiAgentMessages(req, res, match, agentMessages) {
|
|
|
1998
1998
|
async function handleApiSystemUpdate(res) {
|
|
1999
1999
|
const [{ checkForUpdate }, { detectUpdatePackageName }] = await Promise.all([
|
|
2000
2000
|
import("./update-check-WARHSVZA.js"),
|
|
2001
|
-
import("./update-
|
|
2001
|
+
import("./update-VZSOZGYC.js")
|
|
2002
2002
|
]);
|
|
2003
2003
|
const packageName = detectUpdatePackageName();
|
|
2004
2004
|
const info = await checkForUpdate({ packageName });
|
|
@@ -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
|