@wrongstack/core 0.4.1 → 0.5.2

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 (64) hide show
  1. package/dist/{agent-bridge-DaOnnHNW.d.ts → agent-bridge-EiUFe3if.d.ts} +1 -1
  2. package/dist/{compactor-CFky6JKM.d.ts → compactor-BP4xhKVi.d.ts} +1 -1
  3. package/dist/{config-RlhKLjme.d.ts → config-BOD_HQBw.d.ts} +1 -1
  4. package/dist/{context-B1kBj1lY.d.ts → context-PH4DvBZV.d.ts} +60 -1
  5. package/dist/coordination/index.d.ts +10 -891
  6. package/dist/coordination/index.js +500 -238
  7. package/dist/coordination/index.js.map +1 -1
  8. package/dist/defaults/index.d.ts +20 -19
  9. package/dist/defaults/index.js +2210 -264
  10. package/dist/defaults/index.js.map +1 -1
  11. package/dist/director-state-CVzkjKRZ.d.ts +539 -0
  12. package/dist/{events-BBaKeMfb.d.ts → events-oxn-Wkub.d.ts} +58 -1
  13. package/dist/execution/index.d.ts +19 -13
  14. package/dist/execution/index.js +15 -6
  15. package/dist/execution/index.js.map +1 -1
  16. package/dist/extension/index.d.ts +6 -6
  17. package/dist/index-CcbWbcpy.d.ts +899 -0
  18. package/dist/{index-meJRuQtc.d.ts → index-a12jc7-r.d.ts} +8 -6
  19. package/dist/index.d.ts +33 -28
  20. package/dist/index.js +3798 -1237
  21. package/dist/index.js.map +1 -1
  22. package/dist/infrastructure/index.d.ts +6 -6
  23. package/dist/infrastructure/index.js +67 -2
  24. package/dist/infrastructure/index.js.map +1 -1
  25. package/dist/kernel/index.d.ts +10 -9
  26. package/dist/kernel/index.js.map +1 -1
  27. package/dist/{mcp-servers-Cf4-bJnd.d.ts → mcp-servers-uPmBxZ1B.d.ts} +18 -3
  28. package/dist/models/index.d.ts +2 -2
  29. package/dist/models/index.js +106 -0
  30. package/dist/models/index.js.map +1 -1
  31. package/dist/{multi-agent-D5m66hzB.d.ts → multi-agent-D6S4Z7H8.d.ts} +71 -16
  32. package/dist/observability/index.d.ts +2 -2
  33. package/dist/{path-resolver-Bg4OP5fi.d.ts → path-resolver-CprD5DhS.d.ts} +9 -2
  34. package/dist/{provider-runner-CU9gnU2E.d.ts → provider-runner-DGisz_lG.d.ts} +3 -3
  35. package/dist/{skill-DayhFUBb.d.ts → retry-policy-DUJ8-Qc_.d.ts} +2 -28
  36. package/dist/sdd/index.d.ts +419 -5
  37. package/dist/sdd/index.js +1580 -1
  38. package/dist/sdd/index.js.map +1 -1
  39. package/dist/{secret-scrubber-DyUAWS09.d.ts → secret-scrubber-CB11A2P7.d.ts} +1 -1
  40. package/dist/{secret-scrubber-Dyh5LVYL.d.ts → secret-scrubber-EqFa0SyI.d.ts} +1 -1
  41. package/dist/security/index.d.ts +8 -4
  42. package/dist/security/index.js +8 -0
  43. package/dist/security/index.js.map +1 -1
  44. package/dist/{selector-DBEiwXBk.d.ts → selector-yqyxt-Ii.d.ts} +1 -1
  45. package/dist/{session-reader-D-z0AgHs.d.ts → session-reader-1tOyoY1s.d.ts} +1 -1
  46. package/dist/session-rewinder-C9HnMkhP.d.ts +23 -0
  47. package/dist/skill-CxuWrsKK.d.ts +29 -0
  48. package/dist/skills/index.d.ts +136 -0
  49. package/dist/skills/index.js +478 -0
  50. package/dist/skills/index.js.map +1 -0
  51. package/dist/storage/index.d.ts +21 -534
  52. package/dist/storage/index.js +246 -3
  53. package/dist/storage/index.js.map +1 -1
  54. package/dist/{system-prompt-DNetCecu.d.ts → system-prompt-BJlzKGO6.d.ts} +1 -1
  55. package/dist/{tool-executor-B5bgmEgE.d.ts → tool-executor-B6kRcWeF.d.ts} +4 -4
  56. package/dist/types/index.d.ts +17 -15
  57. package/dist/types/index.js +116 -0
  58. package/dist/types/index.js.map +1 -1
  59. package/dist/utils/index.d.ts +35 -2
  60. package/dist/utils/index.js +49 -1
  61. package/dist/utils/index.js.map +1 -1
  62. package/package.json +5 -1
  63. package/skills/sdd/SKILL.md +93 -6
  64. package/skills/skill-creator/SKILL.md +98 -0
@@ -1,4 +1,4 @@
1
- import { B as BridgeTransport, l as BridgeMessage, A as AgentBridge, m as AgentBridgeConfig } from './multi-agent-D5m66hzB.js';
1
+ import { B as BridgeTransport, l as BridgeMessage, A as AgentBridge, m as AgentBridgeConfig } from './multi-agent-D6S4Z7H8.js';
2
2
 
3
3
  /**
4
4
  * In-memory pub/sub transport for agent-to-agent messaging.
@@ -1,4 +1,4 @@
1
- import { a0 as Context } from './context-B1kBj1lY.js';
1
+ import { a1 as Context } from './context-PH4DvBZV.js';
2
2
 
3
3
  interface CompactRepairReport {
4
4
  removedToolUses: string[];
@@ -1,5 +1,5 @@
1
1
  import { W as WireFamily } from './models-registry-Y2xbog0E.js';
2
- import { P as Permission } from './context-B1kBj1lY.js';
2
+ import { P as Permission } from './context-PH4DvBZV.js';
3
3
 
4
4
  type ContextWindowModeId = 'balanced' | 'frugal' | 'deep' | 'archival';
5
5
  type ContextWindowAggressiveOn = 'hard' | 'soft' | 'warn';
@@ -627,6 +627,27 @@ type SessionEvent = {
627
627
  ts: string;
628
628
  before: number;
629
629
  after: number;
630
+ } | {
631
+ type: 'checkpoint';
632
+ ts: string;
633
+ promptIndex: number;
634
+ promptPreview: string;
635
+ } | {
636
+ type: 'file_snapshot';
637
+ ts: string;
638
+ promptIndex: number;
639
+ files: FileSnapshot[];
640
+ } | {
641
+ type: 'rewound';
642
+ ts: string;
643
+ toPromptIndex: number;
644
+ revertedFiles: string[];
645
+ };
646
+ type FileSnapshot = {
647
+ path: string;
648
+ action: 'created' | 'modified' | 'deleted';
649
+ before: string | null;
650
+ after: string | null;
630
651
  };
631
652
  interface SessionSummary {
632
653
  id: string;
@@ -671,6 +692,33 @@ interface SessionWriter {
671
692
  readonly transcriptPath?: string;
672
693
  append(event: SessionEvent): Promise<void>;
673
694
  close(): Promise<void>;
695
+ /**
696
+ * Register a file change for later snapshotting.
697
+ * Called by write/edit/delete tools to track pending changes.
698
+ */
699
+ recordFileChange(input: {
700
+ path: string;
701
+ action: 'created' | 'modified' | 'deleted';
702
+ before: string | null;
703
+ after: string | null;
704
+ }): void;
705
+ /**
706
+ * Write a checkpoint marker after a user input is processed.
707
+ * Also flushes any pending file snapshots.
708
+ */
709
+ writeCheckpoint(promptIndex: number, promptPreview: string): Promise<void>;
710
+ /**
711
+ * Write a file snapshot after file changes are detected.
712
+ * Called by the file watcher or tool interceptor.
713
+ */
714
+ writeFileSnapshot(promptIndex: number, files: FileSnapshot[]): Promise<void>;
715
+ /**
716
+ * Truncate conversation history to a given checkpoint promptIndex.
717
+ * Called after rewind — removes user_input/llm_response/tool_result events
718
+ * that come after the target checkpoint, then writes a rewound event.
719
+ * Returns the number of events removed.
720
+ */
721
+ truncateToCheckpoint(promptIndex: number): Promise<number>;
674
722
  }
675
723
 
676
724
  interface CacheStats {
@@ -683,6 +731,17 @@ interface CacheStats {
683
731
  }
684
732
  interface TokenCounter {
685
733
  account(usage: Usage, model?: string): void;
734
+ /**
735
+ * Tokens from the most recently-accounted request (input + cacheRead).
736
+ * Use this for per-request context pressure tracking (e.g. status bar
737
+ * ctx bar) — tokenCounter.total() is cumulative across all requests
738
+ * and cannot be compared meaningfully against a per-request maxContext
739
+ * ceiling.
740
+ */
741
+ currentRequestTokens(): {
742
+ input: number;
743
+ cacheRead: number;
744
+ };
686
745
  total(): Usage;
687
746
  estimateCost(): {
688
747
  input: number;
@@ -878,4 +937,4 @@ declare class Context implements RunEnv {
878
937
  usage(): Usage;
879
938
  }
880
939
 
881
- export { toWrongStackError as $, AgentError as A, type ToolStreamEvent as B, type Capabilities as C, type ToolUseBlock as D, type ErrorCode as E, asBlocks as F, asText as G, isAgentError as H, type ImageBlock as I, type JSONSchema as J, isConfigError as K, isImageBlock as L, type Message as M, isPluginError as N, isSessionError as O, type Permission as P, isTextBlock as Q, type Request as R, type SessionData as S, type TextBlock as T, type Usage as U, isThinkingBlock as V, WrongStackError as W, isToolError as X, isToolResultBlock as Y, isToolUseBlock as Z, isWrongStackError as _, ConfigError as a, Context as a0, type TokenCounter as a1, type CacheStats as a2, type ContextInit as a3, ConversationState as a4, type ReadonlyConversationState as a5, type RunEnv as a6, type RunOptions as a7, type StateChange as a8, type StateChangeHandler as a9, type TodoItem as aa, extractRunEnv as ab, wrapAsState as ac, type ContentBlock as b, type ErrorSeverity as c, type ErrorSubsystem as d, type MessageRole as e, PluginError as f, type Provider as g, ProviderError as h, type ProviderErrorBody as i, type Response as j, type ResumedSession as k, SessionError as l, type SessionEvent as m, type SessionMetadata as n, type SessionStore as o, type SessionSummary as p, type SessionWriter as q, type StopReason as r, type StreamEvent as s, type ThinkingBlock as t, type Tool as u, type ToolCallContext as v, ToolError as w, type ToolFinalEvent as x, type ToolProgressEvent as y, type ToolResultBlock as z };
940
+ export { isWrongStackError as $, AgentError as A, type ToolStreamEvent as B, type Capabilities as C, type ToolUseBlock as D, type ErrorCode as E, type FileSnapshot as F, asBlocks as G, asText as H, type ImageBlock as I, type JSONSchema as J, isAgentError as K, isConfigError as L, type Message as M, isImageBlock as N, isPluginError as O, type Permission as P, isSessionError as Q, type Request as R, type SessionData as S, type TextBlock as T, type Usage as U, isTextBlock as V, WrongStackError as W, isThinkingBlock as X, isToolError as Y, isToolResultBlock as Z, isToolUseBlock as _, ConfigError as a, toWrongStackError as a0, Context as a1, type TokenCounter as a2, type CacheStats as a3, type ContextInit as a4, ConversationState as a5, type ReadonlyConversationState as a6, type RunEnv as a7, type RunOptions as a8, type StateChange as a9, type StateChangeHandler as aa, type TodoItem as ab, extractRunEnv as ac, wrapAsState as ad, type ContentBlock as b, type ErrorSeverity as c, type ErrorSubsystem as d, type MessageRole as e, PluginError as f, type Provider as g, ProviderError as h, type ProviderErrorBody as i, type Response as j, type ResumedSession as k, SessionError as l, type SessionEvent as m, type SessionMetadata as n, type SessionStore as o, type SessionSummary as p, type SessionWriter as q, type StopReason as r, type StreamEvent as s, type ThinkingBlock as t, type Tool as u, type ToolCallContext as v, ToolError as w, type ToolFinalEvent as x, type ToolProgressEvent as y, type ToolResultBlock as z };