@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.
@@ -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
  };
@@ -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
- sessionId: string;
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
  }
@@ -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
- * Test-only: reset the auto-hygiene throttle so the next teardown always
14
- * runs hygiene. Used by the regression test to verify the throttle skips
15
- * on the second call within the interval.
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 declare function _resetAutoHygieneThrottleForTesting(): void;
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.303.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/acp": "0.303.0",
46
- "@wrongstack/bench": "0.303.0",
47
- "@wrongstack/core": "0.303.0",
48
- "@wrongstack/plug-lsp": "0.303.0",
49
- "@wrongstack/runtime": "0.303.0",
50
- "@wrongstack/security-scanner": "0.303.0",
51
- "@wrongstack/mcp": "0.303.0",
52
- "@wrongstack/plugins": "0.303.0",
53
- "@wrongstack/providers": "0.303.0",
54
- "@wrongstack/sdd": "0.303.0",
55
- "@wrongstack/kanban": "0.303.0",
56
- "@wrongstack/requirement-intake": "0.303.0",
57
- "@wrongstack/sage": "0.303.0",
58
- "@wrongstack/simpleui": "0.303.0",
59
- "@wrongstack/tui": "0.303.0",
60
- "@wrongstack/tools": "0.303.0",
61
- "@wrongstack/webui-hq": "0.303.0",
62
- "@wrongstack/techstack": "0.303.0",
63
- "@wrongstack/telegram": "0.303.0",
64
- "@wrongstack/webui": "0.303.0",
65
- "@wrongstack/webui-server": "0.303.0"
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.303.0"
68
+ "@wrongstack/desktop": "0.305.0"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@types/node": "^26.1.2",