@wrongstack/core 0.89.1 → 0.104.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.
Files changed (87) hide show
  1. package/dist/{agent-bridge-B8F2ORwg.d.ts → agent-bridge-mOxbpFcg.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-CQaLFNnA.d.ts → agent-subagent-runner-DukQLUcS.d.ts} +433 -433
  3. package/dist/{events-DzyLtja6.d.ts → brain-Dfv4Y82E.d.ts} +179 -92
  4. package/dist/{compactor-CJq7LQev.d.ts → compactor-DXLxLcmU.d.ts} +2 -2
  5. package/dist/{config-_DZ7dN-T.d.ts → config-BSU-6vah.d.ts} +45 -38
  6. package/dist/{context-ToHAp4-U.d.ts → context-CNRYfhUv.d.ts} +1 -1
  7. package/dist/coordination/index.d.ts +16 -17
  8. package/dist/coordination/index.js +128 -37
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/defaults/index.d.ts +34 -35
  11. package/dist/defaults/index.js +752 -218
  12. package/dist/defaults/index.js.map +1 -1
  13. package/dist/{director-state-CgIc30qi.d.ts → director-state-BfeCUbmk.d.ts} +1 -1
  14. package/dist/execution/index.d.ts +65 -370
  15. package/dist/execution/index.js +446 -53
  16. package/dist/execution/index.js.map +1 -1
  17. package/dist/extension/index.d.ts +9 -10
  18. package/dist/extension/index.js +8 -6
  19. package/dist/extension/index.js.map +1 -1
  20. package/dist/goal-preamble-CI8lxeY1.d.ts +378 -0
  21. package/dist/{goal-store-DvWLNu52.d.ts → goal-store-ht0VmR1A.d.ts} +63 -21
  22. package/dist/{index-Ca_lOmKl.d.ts → index-BWRN6wOb.d.ts} +13 -15
  23. package/dist/{index-Dx-CnrDN.d.ts → index-DIKEcfgC.d.ts} +9 -10
  24. package/dist/index.d.ts +188 -176
  25. package/dist/index.js +1508 -407
  26. package/dist/index.js.map +1 -1
  27. package/dist/infrastructure/index.d.ts +9 -9
  28. package/dist/infrastructure/index.js +4 -2
  29. package/dist/infrastructure/index.js.map +1 -1
  30. package/dist/kernel/index.d.ts +14 -16
  31. package/dist/kernel/index.js.map +1 -1
  32. package/dist/{logger-B72yyPc6.d.ts → logger-B63L5bTg.d.ts} +1 -1
  33. package/dist/{logger-C_27pj9i.d.ts → logger-B9J5puGM.d.ts} +1 -1
  34. package/dist/{mcp-servers-Dck3T85_.d.ts → mcp-servers-CXCsANdY.d.ts} +3 -3
  35. package/dist/{mode-CHo2XtHs.d.ts → mode-ARA3HrkY.d.ts} +1 -1
  36. package/dist/models/index.d.ts +5 -5
  37. package/dist/models/index.js +8 -6
  38. package/dist/models/index.js.map +1 -1
  39. package/dist/{models-registry-Be3osGt5.d.ts → models-registry-B6_KfS65.d.ts} +1 -1
  40. package/dist/{models-registry-Boz639EI.d.ts → models-registry-DU64QxQa.d.ts} +1 -1
  41. package/dist/{multi-agent-coordinator-Da9nd8Ic.d.ts → multi-agent-coordinator-51LvnXkD.d.ts} +2 -2
  42. package/dist/{null-fleet-bus-CHJOXv3t.d.ts → null-fleet-bus-D09hMzFQ.d.ts} +32 -31
  43. package/dist/observability/index.d.ts +3 -3
  44. package/dist/{observability-CoSNZdhX.d.ts → observability-D-HZN_mF.d.ts} +1 -1
  45. package/dist/{parallel-eternal-engine-DyMCj2Pw.d.ts → parallel-eternal-engine-CUtmM_0V.d.ts} +54 -35
  46. package/dist/{path-resolver-TjBlRKyH.d.ts → path-resolver-DDJiMAtX.d.ts} +3 -3
  47. package/dist/{permission-14CChMmO.d.ts → permission-BDv7z0mk.d.ts} +7 -2
  48. package/dist/{permission-policy-gW5htOo1.d.ts → permission-policy-dF74EpDp.d.ts} +2 -2
  49. package/dist/{system-prompt-C0rLCeyn.d.ts → pipeline-BqiA_UMr.d.ts} +73 -73
  50. package/dist/{plan-templates-D9UhwoGh.d.ts → plan-templates-BdDxl9cI.d.ts} +79 -11
  51. package/dist/{provider-runner-BEPWwkxH.d.ts → provider-runner-BUunikwY.d.ts} +5 -5
  52. package/dist/{retry-policy-DSu6O6rD.d.ts → retry-policy-BcmuT_V0.d.ts} +2 -2
  53. package/dist/sdd/index.d.ts +17 -33
  54. package/dist/sdd/index.js +145 -36
  55. package/dist/sdd/index.js.map +1 -1
  56. package/dist/{secret-scrubber-yGBFQYju.d.ts → secret-vault-DrOhc2i5.d.ts} +7 -7
  57. package/dist/security/index.d.ts +4 -5
  58. package/dist/security/index.js +4 -2
  59. package/dist/security/index.js.map +1 -1
  60. package/dist/{selector-11-fm95U.d.ts → selector-C7wcdqMA.d.ts} +1 -1
  61. package/dist/{session-event-bridge-D0u-x576.d.ts → session-event-bridge-BpJ5trO9.d.ts} +2 -2
  62. package/dist/{session-reader-BQU-toaN.d.ts → session-reader-DDz1Ek4V.d.ts} +2 -2
  63. package/dist/{skill-BJeF2DwY.d.ts → skill-Bj6Ezqb8.d.ts} +1 -1
  64. package/dist/skills/index.d.ts +1 -1
  65. package/dist/skills/index.js +3 -9
  66. package/dist/skills/index.js.map +1 -1
  67. package/dist/spec-TBi3Jr6T.d.ts +78 -0
  68. package/dist/storage/index.d.ts +145 -13
  69. package/dist/storage/index.js +990 -172
  70. package/dist/storage/index.js.map +1 -1
  71. package/dist/task-format-vGOIftmK.d.ts +23 -0
  72. package/dist/task-graph-u1q9Jkyk.d.ts +84 -0
  73. package/dist/types/index.d.ts +27 -28
  74. package/dist/types/index.js +19 -31
  75. package/dist/types/index.js.map +1 -1
  76. package/dist/utils/expect-defined.d.ts +7 -0
  77. package/dist/utils/expect-defined.js +11 -0
  78. package/dist/utils/expect-defined.js.map +1 -0
  79. package/dist/utils/index.d.ts +8 -20
  80. package/dist/utils/index.js +120 -41
  81. package/dist/utils/index.js.map +1 -1
  82. package/dist/{wstack-paths-BQMvEllz.d.ts → wstack-paths-_lqjzErq.d.ts} +1 -1
  83. package/package.json +5 -1
  84. package/skills/tech-stack/SKILL.md +177 -0
  85. package/dist/memory-CEXuo7sz.d.ts +0 -16
  86. package/dist/secret-scrubber-3MHDDAtm.d.ts +0 -6
  87. package/dist/task-graph-CikNdRTG.d.ts +0 -161
@@ -93,4 +93,4 @@ interface WstackPathOptions {
93
93
  }
94
94
  declare function resolveWstackPaths(opts: WstackPathOptions): WstackPaths;
95
95
 
96
- export { type WstackPathOptions as W, type WstackPaths as a, projectSlug as b, projectHash as p, resolveWstackPaths as r };
96
+ export { type WstackPaths as W, type WstackPathOptions as a, projectSlug as b, projectHash as p, resolveWstackPaths as r };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/core",
3
- "version": "0.89.1",
3
+ "version": "0.104.0",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack core: kernel, types, defaults, and shared utilities for the WrongStack CLI agent.",
6
6
  "repository": {
@@ -36,6 +36,10 @@
36
36
  "types": "./dist/utils/index.d.ts",
37
37
  "import": "./dist/utils/index.js"
38
38
  },
39
+ "./utils/expect-defined": {
40
+ "types": "./dist/utils/expect-defined.d.ts",
41
+ "import": "./dist/utils/expect-defined.js"
42
+ },
39
43
  "./execution": {
40
44
  "types": "./dist/execution/index.d.ts",
41
45
  "import": "./dist/execution/index.js"
@@ -0,0 +1,177 @@
1
+ ---
2
+ name: tech-stack
3
+ description: |
4
+ Use this skill when choosing, installing, or recommending packages, libraries,
5
+ frameworks, or tooling — any decision that involves a version number or a
6
+ technology name. This skill enforces latest-version verification, blocks
7
+ dead/obsolete choices, and intervenes when the LLM hallucinates version
8
+ numbers or suggests 5+ year-old technology.
9
+ Triggers: user says "install", "package", "dependency", "upgrade",
10
+ "latest version", "add package", "npm install", "pnpm add", "what version",
11
+ "which library", "tech stack", "choose framework".
12
+ version: 1.0.0
13
+ ---
14
+
15
+ # Tech Stack Validator — WrongStack
16
+
17
+ ## Overview
18
+
19
+ Intervening validation layer that fires before a package, library, or framework
20
+ choice is committed. Verifies that the selected technology and version are
21
+ current, exist in reality, and are not dead/abandoned. Runs as a single-shot
22
+ delegate — fast, read-only, fire-and-forget.
23
+
24
+ ## Rules
25
+
26
+ 1. **Verify existence.** Before accepting a package name, search the npm registry
27
+ (`https://registry.npmjs.org/<package>/latest`) or the equivalent package
28
+ index. A package that doesn't exist in the registry is a hallucination.
29
+
30
+ 2. **Check latest version.** Always fetch the actual latest stable version.
31
+ The LLM's training data is stale — never trust a version number from the
32
+ model without checking.
33
+
34
+ 3. **Reject dead packages.** If a package has had no release in >2 years AND
35
+ has unresolved critical issues, flag it as dead. Suggest a maintained
36
+ replacement.
37
+
38
+ 4. **Reject prehistoric technology.** Any package/library/pattern that was
39
+ superseded ≥5 years ago is automatically rejected. Examples that MUST be
40
+ blocked:
41
+ - `axios`, `node-fetch`, `got` → native `fetch` (Node 18+, 2022)
42
+ - `request` (deprecated 2020) → native `fetch`
43
+ - `moment` → `date-fns`, `luxon`, or `Temporal`
44
+ - `left-pad` → native `String.prototype.padStart`
45
+ - `crypto-js` → native `Web Crypto` / `node:crypto`
46
+ - `jQuery` for new projects → vanilla DOM / React
47
+ - `Backbone`, `Ember` → React / Vue / Svelte
48
+ - `Gulp`, `Grunt` → `tsup`, `esbuild`, `vite`
49
+ - `Bower` → npm/pnpm
50
+ - `CoffeeScript` → TypeScript
51
+ - `Flow` → TypeScript
52
+ - `Bluebird` → native Promises
53
+ - `underscore` → `lodash` or native ES2020+
54
+ - `classnames` → `clsx` or native `classList`
55
+
56
+ 5. **Intervene with evidence.** When blocking a choice, output the exact phrase
57
+ **"This isn't code, this is X-year-old technology"** with:
58
+ - The actual age (X = current year − release year)
59
+ - What superseded it
60
+ - A concrete migration path (one package, one import change)
61
+
62
+ 6. **Prefer built-in over third-party.** Every Node.js LTS release adds native
63
+ APIs that obsolete packages. Check Node 22+ built-ins before suggesting an
64
+ npm package:
65
+ - `node:test` over `jest`/`mocha` (for new projects)
66
+ - `node:sqlite` over `better-sqlite3` (Node 22.5+)
67
+ - `fetch`, `WebSocket`, `Web Crypto`, `AbortController`, `EventTarget` —
68
+ all native, no packages needed
69
+
70
+ 7. **Single-shot budget.** This agent is not for deep analysis — it should
71
+ complete in 1–2 iterations. Search → verify → report. Do not recursively
72
+ analyze transitive dependencies.
73
+
74
+ ## Patterns
75
+
76
+ ### Do
77
+
78
+ ```
79
+ User: "Add axios for API calls"
80
+ Agent: ❌ REJECTED
81
+ "This isn't code, this is 10-year-old technology."
82
+ axios was released in 2014. Node.js 18+ (2022) includes native fetch with
83
+ AbortSignal.timeout(), streaming, and FormData. No package needed.
84
+ → Use: `const res = await fetch(url, { signal: AbortSignal.timeout(5000) })`
85
+ ```
86
+
87
+ ```
88
+ User: "What version of React should we use?"
89
+ Agent: ✅ React 19.2.1 (latest stable as of 2026-06-08)
90
+ Verified via npm registry. React 19 includes Server Components,
91
+ use() hook, and ref-as-prop. Pin to ^19.2.0 for semver safety.
92
+ ```
93
+
94
+ ```
95
+ User: "Install typescript"
96
+ Agent: ✅ TypeScript 5.9.3 (latest stable)
97
+ Verified via npm registry. Use `^5.9.0` to receive patch updates.
98
+ ```
99
+
100
+ ### Don't
101
+
102
+ ```
103
+ // ❌ Trusting the LLM's stale training data
104
+ Agent: "Use React 18.3.1 — it's the latest stable."
105
+ // WRONG — React 19 has been stable since Dec 2024. Check npm.
106
+
107
+ // ❌ Suggesting axios without challenge
108
+ Agent: "npm install axios" — no justification, no fetch alternative mentioned.
109
+
110
+ // ❌ Accepting a package that doesn't exist
111
+ Agent: "Install @anthropic/sdk version 2.0.0" — verify this version exists first.
112
+
113
+ // ❌ Suggesting moment.js
114
+ Agent: "Use moment for date formatting" — moment is legacy. Suggest date-fns or Temporal.
115
+ ```
116
+
117
+ ## Workflow
118
+
119
+ ```
120
+ 1. Receive — Package name + proposed version (or "latest")
121
+ 2. Search — npm registry: https://registry.npmjs.org/<pkg>/latest
122
+ OR web search: "<package> latest version npm 2026"
123
+ 3. Verify — Does the package exist? Is the version real?
124
+ 4. Audit — Age check. Last release date > 2 years? Dead?
125
+ Prehistoric check. Was it superseded ≥5 years ago?
126
+ 5. Report — APPROVED (with latest version) or REJECTED (with replacement)
127
+ Use the exact phrase "This isn't code, this is X-year-old technology"
128
+ when rejecting on age grounds.
129
+ ```
130
+
131
+ ## Version checking — web sources
132
+
133
+ When checking a package version, search in this order:
134
+ 1. **npm registry**: `fetch('https://registry.npmjs.org/<package>/latest')` → `version` field
135
+ 2. **npm API**: `fetch('https://api.npmjs.org/versions/<package>/last-week')`
136
+ 3. **Web search**: `"<package> latest version 2026 npm"` on DuckDuckGo/Google
137
+ 4. **GitHub releases**: `fetch('https://api.github.com/repos/<owner>/<repo>/releases/latest')`
138
+
139
+ ## Dead package criteria
140
+
141
+ | Signal | Threshold | Action |
142
+ |--------|-----------|--------|
143
+ | No release | >2 years | Flag + check for replacement |
144
+ | No release + critical CVEs | >1 year | REJECT automatically |
145
+ | Deprecated on npm | Any | REJECT + suggest replacement |
146
+ | Repository archived | Any | REJECT + suggest replacement |
147
+ | <100 weekly downloads | Any | WARN + suggest more popular alternative |
148
+
149
+ ## Output format
150
+
151
+ ```
152
+ ### Tech Stack Validation — <package>
153
+
154
+ **Status**: APPROVED | REJECTED | NEEDS_INVESTIGATION
155
+
156
+ **Package**: <name>@<version>
157
+ **Source**: <npm registry / GitHub / web search — cite the URL>
158
+ **Age**: <first release year> — <last release date>
159
+ **Verdict**: 1–2 sentence explanation.
160
+
161
+ When REJECTED:
162
+ **"This isn't code, this is X-year-old technology."**
163
+ **Replaced by**: <modern alternative>
164
+ **Migration**: <one concrete step>
165
+
166
+ When APPROVED:
167
+ **Install**: `pnpm add <name>@^<major>.<minor>.0`
168
+ **Note**: <any caveats about the version>
169
+ ```
170
+
171
+ ## Skills in scope
172
+
173
+ - `node-modern` — for Node.js built-in vs. third-party decisions
174
+ - `react-modern` — for React version checks
175
+ - `typescript-strict` — for TypeScript version alignment
176
+ - `security-scanner` — for packages with known CVEs
177
+ - `docker-deploy` — for base image version pinning
@@ -1,16 +0,0 @@
1
- type MemoryScope = 'project-agents' | 'project-memory' | 'user-memory';
2
- interface MemoryEntry {
3
- scope: MemoryScope;
4
- text: string;
5
- ts: string;
6
- }
7
- interface MemoryStore {
8
- readAll(): Promise<string>;
9
- read(scope: MemoryScope): Promise<string>;
10
- remember(text: string, scope?: MemoryScope): Promise<void>;
11
- forget(query: string, scope?: MemoryScope): Promise<number>;
12
- consolidate(scope: MemoryScope): Promise<void>;
13
- clear(scope?: MemoryScope): Promise<void>;
14
- }
15
-
16
- export type { MemoryEntry as M, MemoryScope as a, MemoryStore as b };
@@ -1,6 +0,0 @@
1
- interface SecretScrubber {
2
- scrub(text: string): string;
3
- scrubObject<T>(obj: T): T;
4
- }
5
-
6
- export type { SecretScrubber as S };
@@ -1,161 +0,0 @@
1
- type SpecStatus = 'draft' | 'review' | 'approved' | 'implemented' | 'deprecated';
2
- type SpecSectionType = 'overview' | 'requirements' | 'architecture' | 'api' | 'data' | 'security' | 'acceptance';
3
- interface SpecSection {
4
- type: SpecSectionType;
5
- title: string;
6
- content: string;
7
- level: number;
8
- children?: SpecSection[] | undefined;
9
- }
10
- interface SpecRequirement {
11
- id: string;
12
- type: 'functional' | 'non-functional' | 'security' | 'performance' | 'ux';
13
- priority: 'critical' | 'high' | 'medium' | 'low';
14
- description: string;
15
- acceptanceCriteria: string[];
16
- blockedBy?: string[] | undefined;
17
- implements?: string[] | undefined;
18
- }
19
- interface SpecApiEndpoint {
20
- method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
21
- path: string;
22
- description: string;
23
- request?: Record<string, unknown>;
24
- response?: Record<string, unknown>;
25
- auth?: boolean | undefined;
26
- }
27
- interface Specification {
28
- id: string;
29
- title: string;
30
- version: string;
31
- status: SpecStatus;
32
- overview: string;
33
- sections: SpecSection[];
34
- requirements: SpecRequirement[];
35
- apiEndpoints?: SpecApiEndpoint[] | undefined;
36
- dependencies?: string[] | undefined;
37
- createdAt: number;
38
- updatedAt: number;
39
- metadata?: Record<string, unknown>;
40
- }
41
- interface SpecAnalysis {
42
- specId: string;
43
- completeness: number;
44
- coverage: {
45
- requirements: number;
46
- apiEndpoints: number;
47
- edgeCases: number;
48
- errorHandling: number;
49
- };
50
- gaps: string[];
51
- risks: {
52
- requirement: string;
53
- risk: string;
54
- severity: 'high' | 'medium' | 'low';
55
- }[];
56
- suggestions: string[];
57
- }
58
- interface SpecValidationResult {
59
- valid: boolean;
60
- errors: {
61
- path: string;
62
- message: string;
63
- }[];
64
- warnings: {
65
- path: string;
66
- message: string;
67
- }[];
68
- }
69
- interface SpecTemplate {
70
- id: string;
71
- name: string;
72
- description: string;
73
- sections: Omit<SpecSection, 'content'>[];
74
- defaultRequirements: Omit<SpecRequirement, 'id' | 'description'>[];
75
- }
76
- declare const DEFAULT_SPEC_TEMPLATE: SpecTemplate;
77
-
78
- type TaskStatus = 'pending' | 'in_progress' | 'blocked' | 'failed' | 'review' | 'completed';
79
- type TaskPriority = 'critical' | 'high' | 'medium' | 'low';
80
- type TaskType = 'feature' | 'bugfix' | 'refactor' | 'docs' | 'test' | 'chore';
81
- interface TaskNode {
82
- id: string;
83
- title: string;
84
- description: string;
85
- type: TaskType;
86
- priority: TaskPriority;
87
- status: TaskStatus;
88
- assignee?: string | undefined;
89
- estimateHours?: number | undefined;
90
- actualHours?: number | undefined;
91
- tags?: string[] | undefined;
92
- specRequirementId?: string | undefined;
93
- parentId?: string | undefined;
94
- children?: string[] | undefined;
95
- createdAt: number;
96
- updatedAt: number;
97
- startedAt?: number | undefined;
98
- completedAt?: number | undefined;
99
- metadata?: Record<string, unknown>;
100
- }
101
- interface TaskEdge {
102
- id: string;
103
- from: string;
104
- to: string;
105
- type: 'blocks' | 'depends_on' | 'relates_to' | 'implements';
106
- weight?: number | undefined;
107
- }
108
- interface TaskGraph {
109
- id: string;
110
- specId: string;
111
- title: string;
112
- nodes: Map<string, TaskNode>;
113
- edges: TaskEdge[];
114
- rootNodes: string[];
115
- createdAt: number;
116
- updatedAt: number;
117
- }
118
- interface TaskDependency {
119
- taskId: string;
120
- blockedBy: string[];
121
- blocking: string[];
122
- }
123
- interface TaskAssignment {
124
- taskId: string;
125
- assignee: string;
126
- assignedAt: number;
127
- }
128
- interface TaskProgress {
129
- total: number;
130
- pending: number;
131
- inProgress: number;
132
- blocked: number;
133
- failed: number;
134
- review: number;
135
- completed: number;
136
- percentComplete: number;
137
- estimatedHours: number;
138
- actualHours: number;
139
- }
140
- interface TaskFilter {
141
- status?: TaskStatus[] | undefined;
142
- priority?: TaskPriority[] | undefined;
143
- type?: TaskType[] | undefined;
144
- assignee?: string[] | undefined;
145
- tags?: string[] | undefined;
146
- specRequirementId?: string | undefined;
147
- }
148
- interface TaskSort {
149
- field: 'priority' | 'createdAt' | 'updatedAt' | 'status';
150
- direction: 'asc' | 'desc';
151
- }
152
- interface CriticalPathResult {
153
- taskIds: string[];
154
- totalEstimateHours: number;
155
- bottleneckTasks: string[];
156
- }
157
- declare function computeTaskProgress(graph: TaskGraph): TaskProgress;
158
- declare function findCriticalPath(graph: TaskGraph): CriticalPathResult;
159
- declare function topologicalSort(graph: TaskGraph): string[];
160
-
161
- export { type CriticalPathResult as C, DEFAULT_SPEC_TEMPLATE as D, type SpecAnalysis as S, type TaskAssignment as T, type SpecApiEndpoint as a, type SpecRequirement as b, type SpecSection as c, type SpecSectionType as d, type SpecStatus as e, type SpecTemplate as f, type SpecValidationResult as g, type Specification as h, type TaskDependency as i, type TaskEdge as j, type TaskFilter as k, type TaskGraph as l, type TaskNode as m, type TaskPriority as n, type TaskProgress as o, type TaskSort as p, type TaskStatus as q, type TaskType as r, computeTaskProgress as s, findCriticalPath as t, topologicalSort as u };