@wrongstack/core 0.9.20 → 0.10.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 (67) hide show
  1. package/README.md +37 -33
  2. package/dist/{agent-bridge-Dti3KXGk.d.ts → agent-bridge-DBBGP5O4.d.ts} +1 -1
  3. package/dist/{agent-subagent-runner-U-rs7kk7.d.ts → agent-subagent-runner-KwufTWwn.d.ts} +3 -3
  4. package/dist/{compactor-D7X96RLZ.d.ts → compactor-D1RHFRmF.d.ts} +1 -1
  5. package/dist/{config-CLXMDOSs.d.ts → config-CJXBka2r.d.ts} +38 -2
  6. package/dist/{context-zkZeILpr.d.ts → context-7u93AcGD.d.ts} +94 -0
  7. package/dist/coordination/index.d.ts +12 -12
  8. package/dist/coordination/index.js +130 -58
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/{default-config-Uzla85H-.d.ts → default-config-DEXI4jsl.d.ts} +10 -1
  11. package/dist/defaults/index.d.ts +24 -24
  12. package/dist/defaults/index.js +611 -95
  13. package/dist/defaults/index.js.map +1 -1
  14. package/dist/{events-DH-9r-_C.d.ts → events-Bw1K5E6K.d.ts} +8 -1
  15. package/dist/execution/index.d.ts +18 -15
  16. package/dist/execution/index.js +309 -61
  17. package/dist/execution/index.js.map +1 -1
  18. package/dist/extension/index.d.ts +6 -6
  19. package/dist/extension/index.js.map +1 -1
  20. package/dist/goal-store-BeRsj7YX.d.ts +188 -0
  21. package/dist/{index-CFO9QmJo.d.ts → index-DIt5TIaF.d.ts} +8 -8
  22. package/dist/{index-BIHJ4uII.d.ts → index-DgQWnZxP.d.ts} +5 -5
  23. package/dist/index.d.ts +56 -35
  24. package/dist/index.js +742 -203
  25. package/dist/index.js.map +1 -1
  26. package/dist/infrastructure/index.d.ts +6 -6
  27. package/dist/kernel/index.d.ts +9 -9
  28. package/dist/kernel/index.js +57 -8
  29. package/dist/kernel/index.js.map +1 -1
  30. package/dist/{mcp-servers-DkESgh0G.d.ts → mcp-servers-BgINZzuo.d.ts} +3 -3
  31. package/dist/models/index.d.ts +3 -3
  32. package/dist/models/index.js +163 -10
  33. package/dist/models/index.js.map +1 -1
  34. package/dist/models-registry-gwMAo6E3.d.ts +86 -0
  35. package/dist/{multi-agent-DNp6lAzg.d.ts → multi-agent-C1O8EFzb.d.ts} +45 -4
  36. package/dist/{multi-agent-coordinator-CAhsegPz.d.ts → multi-agent-coordinator-DoVSBFNx.d.ts} +2 -2
  37. package/dist/{null-fleet-bus-Dnl19vmf.d.ts → null-fleet-bus-T-s3JaOt.d.ts} +8 -6
  38. package/dist/observability/index.d.ts +2 -2
  39. package/dist/{path-resolver-CHiBL0DD.d.ts → path-resolver-BfyK-I7w.d.ts} +2 -2
  40. package/dist/{permission-H35s9Evv.d.ts → permission-B6sldrSp.d.ts} +1 -1
  41. package/dist/{permission-policy-CT-nRmTn.d.ts → permission-policy-CtNscWOA.d.ts} +10 -9
  42. package/dist/{plan-templates-Bs8iRwi6.d.ts → plan-templates-BWs6Je7j.d.ts} +8 -8
  43. package/dist/{provider-runner-BZdDrWrS.d.ts → provider-runner-BmPe2RuU.d.ts} +3 -3
  44. package/dist/{retry-policy-J9N_PM40.d.ts → retry-policy-KF18W4dg.d.ts} +1 -1
  45. package/dist/sdd/index.d.ts +8 -8
  46. package/dist/sdd/index.js +130 -58
  47. package/dist/sdd/index.js.map +1 -1
  48. package/dist/security/index.d.ts +65 -4
  49. package/dist/security/index.js +67 -19
  50. package/dist/security/index.js.map +1 -1
  51. package/dist/{selector-CFTh3Z6p.d.ts → selector-DmXxpFyM.d.ts} +1 -1
  52. package/dist/{session-reader-C7JJlxOw.d.ts → session-reader-CCSBfQmd.d.ts} +1 -1
  53. package/dist/storage/index.d.ts +7 -7
  54. package/dist/storage/index.js +125 -6
  55. package/dist/storage/index.js.map +1 -1
  56. package/dist/{system-prompt-CneIxVip.d.ts → system-prompt-CM6zOhd2.d.ts} +19 -1
  57. package/dist/{tool-executor-flTuxsqO.d.ts → tool-executor-D7RxLtg4.d.ts} +4 -4
  58. package/dist/types/index.d.ts +16 -16
  59. package/dist/types/index.js +344 -14
  60. package/dist/types/index.js.map +1 -1
  61. package/dist/utils/index.d.ts +23 -3
  62. package/dist/utils/index.js +66 -1
  63. package/dist/utils/index.js.map +1 -1
  64. package/dist/{wstack-paths-BCgmTNlG.d.ts → wstack-paths-eMXnY1_X.d.ts} +8 -0
  65. package/package.json +1 -1
  66. package/dist/goal-store-C7jcumEh.d.ts +0 -96
  67. package/dist/models-registry-OG_30xqZ.d.ts +0 -46
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/core",
3
- "version": "0.9.20",
3
+ "version": "0.10.0",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack core: kernel, types, defaults, and shared utilities for the WrongStack CLI agent.",
6
6
  "repository": {
@@ -1,96 +0,0 @@
1
- /**
2
- * Long-running autonomous mission. A goal survives across sessions and
3
- * drives the EternalAutonomyEngine — every iteration of the engine
4
- * consults the goal to choose what to do next.
5
- *
6
- * Storage: `~/.wrongstack/projects/<hash>/goal.json`. Persistent and
7
- * project-scoped on purpose: the goal belongs to the codebase, not the
8
- * REPL session.
9
- */
10
- interface JournalEntry {
11
- /** ISO timestamp of the iteration. */
12
- at: string;
13
- /** Sequential iteration counter (1-based, monotonically increasing). */
14
- iteration: number;
15
- /** Source that produced the action ('todo' | 'git' | 'brainstorm' | 'resume' | 'manual' | 'parallel'). */
16
- source: 'todo' | 'git' | 'brainstorm' | 'resume' | 'manual' | 'parallel';
17
- /** Short one-line description of what the iteration set out to do. */
18
- task: string;
19
- /** Outcome status. */
20
- status: 'success' | 'failure' | 'aborted' | 'skipped';
21
- /** Optional free-form note (error message, summary, etc.). */
22
- note?: string;
23
- /** Optional token usage delta for this iteration. */
24
- tokens?: {
25
- input: number;
26
- output: number;
27
- };
28
- /** Optional USD cost delta for this iteration (provider-estimated). */
29
- costUsd?: number;
30
- }
31
- interface GoalFile {
32
- version: 1;
33
- /** The mission statement. */
34
- goal: string;
35
- /** When the goal was first set or last replaced. */
36
- setAt: string;
37
- /** Updated on every iteration completion. */
38
- lastActivityAt: string;
39
- /** Total iterations the engine has run against this goal (cumulative). */
40
- iterations: number;
41
- /** Engine lifecycle state — 'running' means another process owns this goal. */
42
- engineState: 'idle' | 'running' | 'stopped';
43
- /**
44
- * Mission-level lifecycle. `active` is the default; `completed` is set
45
- * when the engine detects `[GOAL_COMPLETE]` in a successful iteration's
46
- * final text AND a verification pass agrees; `abandoned` is set by the
47
- * user (e.g. `/goal abandon`) or when the engine exceeds a configured
48
- * failure ceiling. Once not `active`, the engine refuses to run further
49
- * iterations against this goal — protects against accidental restarts
50
- * burning through API quota after the work is done.
51
- *
52
- * Optional for backward compatibility — pre-existing `goal.json` files
53
- * without this field load as `active`.
54
- */
55
- goalState?: 'active' | 'paused' | 'completed' | 'abandoned';
56
- /**
57
- * Per-todo attempt counter. Keyed by TodoItem id. Used by the engine
58
- * to skip a todo that has failed N times rather than spinning on it
59
- * forever. Persisted so attempt counts survive restarts (`/autonomy
60
- * stop` + resume should not reset progress against a stuck task).
61
- */
62
- todoAttempts?: Record<string, number>;
63
- /** Bounded ring buffer of recent iterations (newest last). */
64
- journal: JournalEntry[];
65
- }
66
- /** Cap on persisted journal entries — older entries are evicted FIFO. */
67
- declare const MAX_JOURNAL_ENTRIES = 500;
68
- /**
69
- * Resolve the goal file path for a given project root.
70
- * Exposed so the engine and CLI use one canonical path.
71
- * Uses `~/.wrongstack/projects/<hash>/goal.json` .<hash>/`.
72
- */
73
- declare function goalFilePath(projectRoot: string): string;
74
- declare function loadGoal(filePath: string): Promise<GoalFile | null>;
75
- declare function saveGoal(filePath: string, goal: GoalFile): Promise<void>;
76
- declare function emptyGoal(goal: string): GoalFile;
77
- /**
78
- * Append a journal entry, bumping iteration counters and trimming the
79
- * ring buffer. Returns a new GoalFile — does not mutate the argument.
80
- */
81
- declare function appendJournal(goal: GoalFile, entry: Omit<JournalEntry, 'iteration' | 'at'>): GoalFile;
82
- /**
83
- * Aggregate cumulative cost + tokens across all journal entries. Entries
84
- * without telemetry are skipped (legacy entries from before the field
85
- * was added still load cleanly).
86
- */
87
- declare function summarizeUsage(goal: GoalFile): {
88
- totalCostUsd: number;
89
- totalInputTokens: number;
90
- totalOutputTokens: number;
91
- iterationsWithUsage: number;
92
- };
93
- /** Format the goal + recent journal as a human-readable status block. */
94
- declare function formatGoal(goal: GoalFile, journalLimit?: number): string;
95
-
96
- export { type GoalFile as G, type JournalEntry as J, MAX_JOURNAL_ENTRIES as M, appendJournal as a, summarizeUsage as b, emptyGoal as e, formatGoal as f, goalFilePath as g, loadGoal as l, saveGoal as s };
@@ -1,46 +0,0 @@
1
- import { b as ModelsRegistry, M as ModelsDevPayload, c as ResolvedProvider, R as ResolvedModel, W as WireFamily } from './models-registry-BcYJDKLm.js';
2
-
3
- interface DefaultModelsRegistryOptions {
4
- cacheFile: string;
5
- url?: string;
6
- ttlSeconds?: number;
7
- fetchImpl?: typeof fetch;
8
- /** Pre-seeded payload — useful for offline scenarios and tests. */
9
- seed?: ModelsDevPayload;
10
- /**
11
- * Maximum age in seconds for stale cache fallback when network fails.
12
- * Defaults to 7 days. Set to `Infinity` for full offline resilience
13
- * (risk: deprecated models, wrong pricing). Set to `0` to disable
14
- * stale fallback entirely.
15
- */
16
- maxStaleAgeSeconds?: number;
17
- }
18
- declare function classifyFamily(npm: string | undefined): WireFamily;
19
- declare class DefaultModelsRegistry implements ModelsRegistry {
20
- private payload?;
21
- private fetchedAt?;
22
- private readonly cacheFile;
23
- private readonly url;
24
- private readonly ttlMs;
25
- private readonly fetchImpl;
26
- private readonly seed?;
27
- private readonly maxStaleAgeMs;
28
- constructor(opts: DefaultModelsRegistryOptions);
29
- load(opts?: {
30
- force?: boolean;
31
- }): Promise<ModelsDevPayload>;
32
- refresh(): Promise<ModelsDevPayload>;
33
- listProviders(): Promise<ResolvedProvider[]>;
34
- getProvider(id: string): Promise<ResolvedProvider | undefined>;
35
- getModel(providerId: string, modelId: string): Promise<ResolvedModel | undefined>;
36
- suggestModel(providerId: string): Promise<string | undefined>;
37
- ageSeconds(): Promise<number>;
38
- private resolveProvider;
39
- private isFresh;
40
- private isWithinMaxStaleAge;
41
- private readCache;
42
- /** Used by `wstack models refresh` to expose where the cache lives. */
43
- cacheLocation(): string;
44
- }
45
-
46
- export { DefaultModelsRegistry as D, type DefaultModelsRegistryOptions as a, classifyFamily as c };