@wrongstack/core 0.267.0 → 0.269.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 (78) hide show
  1. package/dist/{agent-bridge-STJ3JwwK.d.ts → agent-bridge-PcHQl_UQ.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-CzPGP3jA.d.ts → agent-subagent-runner-SHJW7t8q.d.ts} +8 -8
  3. package/dist/{brain-Cdg77tVN.d.ts → brain-BYcK__Ym.d.ts} +1 -1
  4. package/dist/{compactor-iMZ84CXq.d.ts → compactor-C2RKEBtC.d.ts} +1 -1
  5. package/dist/{config-Du3pYYln.d.ts → config-C_ae2k86.d.ts} +79 -2
  6. package/dist/{context-dT5Ueund.d.ts → context-Dp87Bcaq.d.ts} +47 -1
  7. package/dist/coordination/index.d.ts +62 -160
  8. package/dist/coordination/index.js +566 -149
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/defaults/index.d.ts +26 -25
  11. package/dist/defaults/index.js +366 -137
  12. package/dist/defaults/index.js.map +1 -1
  13. package/dist/execution/index.d.ts +72 -16
  14. package/dist/execution/index.js +267 -55
  15. package/dist/execution/index.js.map +1 -1
  16. package/dist/execution/prompt-enhancer.d.ts +1 -1
  17. package/dist/extension/index.d.ts +7 -6
  18. package/dist/global-mailbox-Bvrz1P3f.d.ts +664 -0
  19. package/dist/{goal-preamble-SulMTowG.d.ts → goal-preamble-CA_4yiGQ.d.ts} +9 -9
  20. package/dist/{goal-store-CABDwdFE.d.ts → goal-store-DhuJoUNG.d.ts} +1 -1
  21. package/dist/hq/index.d.ts +204 -0
  22. package/dist/hq/index.js +1931 -0
  23. package/dist/hq/index.js.map +1 -0
  24. package/dist/{index-DtCVWel4.d.ts → index-CZQ6Pwbs.d.ts} +8 -8
  25. package/dist/{index-Bms0m4oy.d.ts → index-W4VJCzHa.d.ts} +5 -5
  26. package/dist/{index-IEuxQd-E.d.ts → index-whDfTANu.d.ts} +2 -2
  27. package/dist/index.d.ts +46 -42
  28. package/dist/index.js +3472 -1651
  29. package/dist/index.js.map +1 -1
  30. package/dist/infrastructure/index.d.ts +6 -6
  31. package/dist/infrastructure/index.js +48 -21
  32. package/dist/infrastructure/index.js.map +1 -1
  33. package/dist/kernel/index.d.ts +10 -9
  34. package/dist/{pipeline-BfD2k1rT.d.ts → mailbox-types-Ct2hJq0P.d.ts} +1 -244
  35. package/dist/{mcp-servers-C2cBTxUR.d.ts → mcp-servers-DJdZiRcv.d.ts} +10 -4
  36. package/dist/models/index.d.ts +5 -5
  37. package/dist/models/index.js +4 -3
  38. package/dist/models/index.js.map +1 -1
  39. package/dist/{models-registry-BqGZNJQ-.d.ts → models-registry-C3a-2-Yd.d.ts} +1 -1
  40. package/dist/{multi-agent-coordinator-B8R43uPz.d.ts → multi-agent-coordinator-CJSpTe5O.d.ts} +1 -1
  41. package/dist/{null-fleet-bus-CnXa5oTH.d.ts → null-fleet-bus-QVshIsDx.d.ts} +6 -6
  42. package/dist/observability/index.d.ts +2 -2
  43. package/dist/{parallel-eternal-engine-DdNnw9BQ.d.ts → parallel-eternal-engine-D9y5Pkcc.d.ts} +9 -15
  44. package/dist/{path-resolver-COIMLCQL.d.ts → path-resolver-CnQ8SIfh.d.ts} +4 -3
  45. package/dist/{permission-B75JAi3-.d.ts → permission-CvYQNUqZ.d.ts} +1 -1
  46. package/dist/{permission-policy-DlR9eJAM.d.ts → permission-policy-D5Ss8j4B.d.ts} +2 -3
  47. package/dist/pipeline-l_zzFRh3.d.ts +245 -0
  48. package/dist/{plan-templates-DSIKCXZN.d.ts → plan-templates-NtPgyeJA.d.ts} +6 -5
  49. package/dist/{provider-model-resolve-BNRsNuJx.d.ts → provider-model-resolve-d5poT5y0.d.ts} +3 -3
  50. package/dist/{provider-runner-CX7iIvox.d.ts → provider-runner-gkctlQV_.d.ts} +3 -3
  51. package/dist/{retry-policy-BilV1ujH.d.ts → retry-policy-CtFhfwa8.d.ts} +1 -1
  52. package/dist/sdd/index.d.ts +9 -8
  53. package/dist/sdd/index.js +33 -3
  54. package/dist/sdd/index.js.map +1 -1
  55. package/dist/{secret-vault-gkvEZZfE.d.ts → secret-vault-BLsVmTIK.d.ts} +1 -1
  56. package/dist/security/index.d.ts +5 -5
  57. package/dist/security/index.js +39 -29
  58. package/dist/security/index.js.map +1 -1
  59. package/dist/{selector-Bc7eWtT3.d.ts → selector-CXl2_y9W.d.ts} +1 -1
  60. package/dist/{session-event-bridge-D-araDEz.d.ts → session-event-bridge-Ccud20CC.d.ts} +1 -1
  61. package/dist/{session-reader-D7Dapswh.d.ts → session-reader-ZeXQmsmE.d.ts} +1 -1
  62. package/dist/skills/index.js.map +1 -1
  63. package/dist/storage/index.d.ts +16 -12
  64. package/dist/storage/index.js +273 -100
  65. package/dist/storage/index.js.map +1 -1
  66. package/dist/tools/index.d.ts +2 -2
  67. package/dist/tools/index.js +166 -31
  68. package/dist/tools/index.js.map +1 -1
  69. package/dist/types/index.d.ts +22 -21
  70. package/dist/types/index.js +178 -70
  71. package/dist/types/index.js.map +1 -1
  72. package/dist/utils/index.d.ts +22 -3
  73. package/dist/utils/index.js +197 -25
  74. package/dist/utils/index.js.map +1 -1
  75. package/package.json +5 -1
  76. package/skills/chimera/SKILL.md +1 -1
  77. package/skills/typescript-strict/SKILL.md +3 -3
  78. package/skills/typescript-strict/SKILL.save.md +1 -1
@@ -1,6 +1,3 @@
1
- import { T as Tool, o as TextBlock, g as ContentBlock } from './context-dT5Ueund.js';
2
- import { H as HookEvent, f as HookMatcher, I as InProcessHook, S as ShellHook, g as HookEntry } from './config-Du3pYYln.js';
3
-
4
1
  /**
5
2
  * Mailbox — persistent inter-agent messaging system with cross-session support.
6
3
  *
@@ -345,244 +342,4 @@ interface Mailbox {
345
342
  getClientStatuses(): Promise<ClientStatus[]>;
346
343
  }
347
344
 
348
- /** Model capabilities relevant to prompt composition. */
349
- interface ModelCapabilities {
350
- maxContextTokens: number;
351
- supportsTools: boolean;
352
- supportsVision: boolean;
353
- supportsReasoning: boolean;
354
- }
355
- interface BuildContext {
356
- cwd: string;
357
- projectRoot: string;
358
- tools: Tool[];
359
- /** Provider id (e.g. "anthropic", "minimax-coding-plan"). */
360
- provider?: string | undefined;
361
- /** Model id (e.g. "claude-sonnet-4-6", "MiniMax-M2.7"). */
362
- model?: string | undefined;
363
- /**
364
- * True when the prompt is being built for a SUBAGENT, not the host
365
- * agent. Subagents are scoped to a single task — they should NOT see
366
- * the host's strategic plan board (which is anchoring the host across
367
- * turns, not steering individual subtasks). The plan-injection
368
- * layer short-circuits when this flag is set.
369
- */
370
- subagent?: boolean | undefined;
371
- /**
372
- * List of currently online agents in the shared mailbox system.
373
- * Includes agents from all sessions (TUI, WebUI, CLI) in the same project.
374
- */
375
- onlineAgents?: MailboxAgentStatus[] | undefined;
376
- }
377
- interface SystemPromptBuilder {
378
- build(ctx: BuildContext): Promise<TextBlock[]>;
379
- }
380
-
381
- /**
382
- * Registry of lifecycle hooks (both in-process and shell). One instance is
383
- * shared per session: the boot path loads `config.hooks` as shell entries and
384
- * plugins add in-process entries via `PluginAPI.registerHook`. The
385
- * `HookRunner` reads from it at each lifecycle phase.
386
- */
387
- declare class HookRegistry {
388
- private readonly entries;
389
- /** Register an in-process hook. Returns an unsubscribe function. */
390
- registerInProcess(event: HookEvent, matcher: HookMatcher | undefined, hook: InProcessHook, owner?: string | undefined): () => void;
391
- /** Register a single shell hook. Returns an unsubscribe function. */
392
- registerShell(event: HookEvent, hook: ShellHook): () => void;
393
- /** Bulk-load shell hooks from a `config.hooks` map. */
394
- loadShellHooks(hooks: Partial<Record<HookEvent, ShellHook[]>> | undefined): void;
395
- /** All entries registered for an event, in registration order. */
396
- list(event: HookEvent): readonly HookEntry[];
397
- /** True when any entry is registered for the event. */
398
- has(event: HookEvent): boolean;
399
- /** Drop every registered hook (used in teardown / tests). */
400
- clear(): void;
401
- private remove;
402
- }
403
- /**
404
- * Does a hook matcher apply to a tool name? `*` (or empty) matches everything;
405
- * otherwise the matcher is a case-insensitive pipe-delimited list of exact
406
- * tool names (`"edit|write"`). Non-tool events pass `undefined` and always match.
407
- */
408
- declare function hookMatcherMatches(matcher: HookMatcher, toolName: string | undefined): boolean;
409
-
410
- interface Renderer {
411
- write(text: string | TextBlock): void;
412
- writeLine(text?: string): void;
413
- writeBlock(block: ContentBlock): void;
414
- writeToolCall(name: string, input: unknown): void;
415
- writeToolResult(name: string, content: unknown, isError: boolean): void;
416
- writeDiff(unifiedDiff: string): void;
417
- writeWarning(text: string): void;
418
- writeError(text: string): void;
419
- writeInfo(text: string): void;
420
- clear(): void;
421
- }
422
-
423
- /**
424
- * Container — dependency injection with explicit bind / override / decorate.
425
- *
426
- * Invariants:
427
- * bind() — throws if token already bound
428
- * override() — throws if nothing to replace
429
- * decorate() — stacks; cached value cleared on register
430
- */
431
- type Token<T> = symbol & {
432
- readonly __type?: T;
433
- };
434
- type Factory<T> = (c: Container) => T;
435
- type Decorator<T> = (inner: T, c: Container) => T;
436
- interface BindOptions {
437
- singleton?: boolean | undefined;
438
- owner?: string | undefined;
439
- }
440
- declare class Container {
441
- private readonly entries;
442
- /**
443
- * Tokens currently mid-resolve. Tracked so we can detect circular
444
- * dependencies (A → B → A) and throw a structured error instead of
445
- * overflowing the call stack with "Maximum call stack size exceeded".
446
- *
447
- * Not a memoization cache — the per-entry `cache` field is the source
448
- * of truth for "have I built this before?". This set only lives for
449
- * the duration of a single resolve call.
450
- */
451
- private readonly resolving;
452
- bind<T>(token: Token<T>, factory: Factory<T>, opts?: BindOptions): void;
453
- override<T>(token: Token<T>, factory: Factory<T>, opts?: BindOptions): void;
454
- decorate<T>(token: Token<T>, decorator: Decorator<T>, owner?: string): void;
455
- resolve<T>(token: Token<T>): T;
456
- /**
457
- * Build a human-readable description of the dependency cycle that
458
- * caused the resolution to re-enter. Lists the tokens in the order
459
- * they were entered, then appends the re-entered token to close the
460
- * loop. Falls back to a generic message if the resolving set is
461
- * somehow empty (shouldn't happen, but defensive).
462
- */
463
- private describeCycle;
464
- has<T>(token: Token<T>): boolean;
465
- /**
466
- * Resolve a token if it is bound, otherwise return undefined.
467
- * Unlike resolve(), this does not throw if the token is unbound.
468
- */
469
- safeResolve<T>(token: Token<T>): T | undefined;
470
- ownerOf<T>(token: Token<T>): string | undefined;
471
- /**
472
- * Remove a token's binding (along with any decorators stacked on it).
473
- * Returns true if the token existed. Use this to withdraw temporary
474
- * bindings installed by a short-lived run or plugin — without it, the
475
- * entry persists in the map forever.
476
- */
477
- unbind<T>(token: Token<T>): boolean;
478
- /**
479
- * Drop every binding. Intended for tests and short-lived CLI invocations
480
- * that rebuild the container from scratch. Production code should prefer
481
- * `unbind` on the specific tokens it owns.
482
- */
483
- clear(): void;
484
- list(): Array<{
485
- token: symbol;
486
- owner: string;
487
- }>;
488
- /**
489
- * Inspect a binding's full shape, including decorator count and whether
490
- * a singleton value is cached. Returns null if the token is unbound.
491
- * Decorator and factory function references are not exposed — only counts
492
- * and metadata, to keep internal state hidden.
493
- */
494
- inspect<T>(token: Token<T>): {
495
- owner: string;
496
- singleton: boolean;
497
- decoratorCount: number;
498
- cached: boolean;
499
- } | null;
500
- }
501
-
502
- /**
503
- * Pipeline — Koa-style middleware chain with named middleware
504
- * and position-aware insertion. Generic over input type T.
505
- */
506
- type NextFn<T> = (value: T) => Promise<T>;
507
- type MiddlewareHandler<T> = (value: T, next: NextFn<T>) => Promise<T>;
508
- /**
509
- * Called when a middleware crashes (throws or rejects). Used by the
510
- * Pipeline's error boundary to log the offender without aborting the run.
511
- *
512
- * Return `'rethrow'` to propagate the error (default for core middleware),
513
- * or `'swallow'` to skip past the crashing middleware and continue with the
514
- * value the previous one produced. Plugin middleware should usually be
515
- * swallowed so one bad plugin can't kill an agent run.
516
- */
517
- type PipelineErrorPolicy = 'rethrow' | 'swallow';
518
- interface PipelineErrorEvent {
519
- middleware: string;
520
- owner?: string | undefined;
521
- err: unknown;
522
- }
523
- type PipelineErrorHandler = (ev: PipelineErrorEvent) => PipelineErrorPolicy | Promise<PipelineErrorPolicy>;
524
- interface Middleware<T> {
525
- name: string;
526
- handler: MiddlewareHandler<T>;
527
- owner?: string | undefined;
528
- }
529
- interface PipelineOptions {
530
- /** When true and the target middleware is not found, operations silently no-op instead of throwing. */
531
- optional?: boolean | undefined;
532
- }
533
- /**
534
- * Read-only view of a pipeline. Returned to consumers (plugins, hooks)
535
- * so they can inspect but not mutate the chain.
536
- */
537
- interface ReadonlyPipeline<T> {
538
- readonly size: number;
539
- list(): readonly string[];
540
- run(input: T): Promise<T>;
541
- }
542
- declare class Pipeline<T> {
543
- private readonly chain;
544
- private errorHandler?;
545
- /**
546
- * Install an error boundary. When a middleware throws or rejects, the
547
- * handler is called and decides whether to swallow (continue with the
548
- * pre-handler value) or rethrow. Without a handler, errors propagate.
549
- *
550
- * Wire one per pipeline at boot — the host CLI typically installs a
551
- * single boundary that logs to the operational log and emits a
552
- * `pipeline.error` event for /diag.
553
- */
554
- setErrorHandler(handler: PipelineErrorHandler | undefined): this;
555
- use(mw: Middleware<T> | Middleware<unknown>): this;
556
- prepend(mw: Middleware<T>): this;
557
- /**
558
- * Insert middleware at an explicit index. Out-of-range indices are clamped.
559
- * Use this when insertBefore/insertAfter are insufficient (e.g. to place
560
- * a middleware at a known position regardless of named targets).
561
- */
562
- insertAt(index: number, mw: Middleware<T>): this;
563
- /**
564
- * Insert mw immediately before the first occurrence of target.
565
- * If called multiple times with the same target, each call inserts
566
- * before the target's current position — so after insertBefore('B', X)
567
- * then insertBefore('B', Y), the order is Y → X → B.
568
- */
569
- insertBefore(target: string, mw: Middleware<T>, opts?: PipelineOptions): this;
570
- /**
571
- * Insert mw immediately after the first occurrence of target.
572
- * If called multiple times with the same target, each call inserts
573
- * after the target's current position — so after insertAfter('B', X)
574
- * then insertAfter('B', Y), the order is B → X → Y.
575
- */
576
- insertAfter(target: string, mw: Middleware<T>, opts?: PipelineOptions): this;
577
- replace(target: string, mw: Middleware<T>, opts?: PipelineOptions): this;
578
- remove(name: string, opts?: PipelineOptions): this;
579
- list(): readonly string[];
580
- size(): number;
581
- /** Return a read-only view suitable for passing to plugins. */
582
- asReadonly(): ReadonlyPipeline<T>;
583
- run(input: T): Promise<T>;
584
- private indexOf;
585
- private ensureUnique;
586
- }
587
-
588
- export { type AgentHeartbeatInput as A, type BuildContext as B, Container as C, type Decorator as D, type Factory as F, HookRegistry as H, type MiddlewareHandler as M, type NextFn as N, Pipeline as P, type ReadonlyPipeline as R, type SystemPromptBuilder as S, type Token as T, type Renderer as a, type ModelCapabilities as b, type Mailbox as c, type MailboxMessage as d, type AgentRegistrationInput as e, type BindOptions as f, type MailboxAckInput as g, type MailboxAgentStatus as h, type MailboxMessageType as i, type MailboxQuery as j, type MailboxSendInput as k, type MailboxTaskContext as l, type Middleware as m, type PipelineOptions as n, type ReadReceipts as o, type RegisteredAgent as p, hookMatcherMatches as q, normalizeRecipient as r, type MailboxAckBatchInput as s, type PurgeOptions as t, type PurgeResult as u, type ClientRegistrationInput as v, type ClientHeartbeatInput as w, type ClientStatus as x };
345
+ export { type AgentRegistrationInput as A, type ClientRegistrationInput as C, type MailboxMessage as M, type PurgeOptions as P, type ReadReceipts as R, type MailboxAgentStatus as a, type Mailbox as b, type MailboxSendInput as c, type MailboxQuery as d, type MailboxAckInput as e, type MailboxAckBatchInput as f, type AgentHeartbeatInput as g, type ClientHeartbeatInput as h, type ClientStatus as i, type PurgeResult as j, type MailboxMessageType as k, type MailboxTaskContext as l, type RegisteredAgent as m, normalizeRecipient as n };
@@ -1,6 +1,6 @@
1
- import { C as Compactor } from './compactor-iMZ84CXq.js';
2
- import { M as Message, T as Tool } from './context-dT5Ueund.js';
3
- import { c as MCPServerConfig } from './config-Du3pYYln.js';
1
+ import { C as Compactor } from './compactor-C2RKEBtC.js';
2
+ import { M as Message, T as Tool } from './context-Dp87Bcaq.js';
3
+ import { c as MCPServerConfig } from './config-C_ae2k86.js';
4
4
 
5
5
  type ContextManagerAction = 'check' | 'summary' | 'prune' | 'add_note' | 'compact' | 'repair';
6
6
  interface ContextManagerInput {
@@ -154,7 +154,13 @@ declare const playwrightServer: () => MCPServerConfig;
154
154
  * Requires MINIMAX_API_KEY and uvx on PATH.
155
155
  */
156
156
  declare const miniMaxVisionServer: () => MCPServerConfig;
157
+ /**
158
+ * SSH Manager — remote SSH execution, file transfer, tunnels, health checks, and deployment ops.
159
+ * Server credentials are intentionally NOT embedded here. Configure hosts via mcp-ssh-manager's
160
+ * env/TOML config (for example SSH_SERVER_<NAME>_HOST, USER, KEYPATH/PASSWORD) or ssh-agent.
161
+ */
162
+ declare const sshManagerServer: () => MCPServerConfig;
157
163
  /** Everything bundled — full set of built-in servers. Useful for `wstack mcp add --all`. */
158
164
  declare const allServers: () => Record<string, MCPServerConfig>;
159
165
 
160
- export { type ContextManagerAction as C, type ContextManagerInput as a, type ContextManagerResult as b, type ContextManagerToolOptions as c, allServers as d, awsServer as e, blockServer as f, braveSearchServer as g, context7Server as h, contextManagerTool as i, createContextManagerTool as j, everArtServer as k, filesystemServer as l, githubServer as m, googleMapsServer as n, miniMaxVisionServer as o, playwrightServer as p, slackServer as q, sentinelServer as s, zaiVisionServer as z };
166
+ export { type ContextManagerAction as C, type ContextManagerInput as a, type ContextManagerResult as b, type ContextManagerToolOptions as c, allServers as d, awsServer as e, blockServer as f, braveSearchServer as g, context7Server as h, contextManagerTool as i, createContextManagerTool as j, everArtServer as k, filesystemServer as l, githubServer as m, googleMapsServer as n, miniMaxVisionServer as o, playwrightServer as p, slackServer as q, sshManagerServer as r, sentinelServer as s, zaiVisionServer as z };
@@ -1,9 +1,9 @@
1
- export { D as DefaultModelsRegistry, a as DefaultModelsRegistryOptions, c as classifyFamily } from '../models-registry-BqGZNJQ-.js';
2
- export { D as DefaultModeStore, L as LLMSelector, a as LLMSelectorOptions, M as ModeLoaderOptions, P as ProviderModelDescriptor, d as describeCatalogModel, l as loadProjectModes, b as loadUserModes, r as resolveProviderModelList } from '../provider-model-resolve-BNRsNuJx.js';
3
- import { d as ModelMatrixEntry, P as ProviderConfig } from '../config-Du3pYYln.js';
1
+ export { D as DefaultModelsRegistry, a as DefaultModelsRegistryOptions, c as classifyFamily } from '../models-registry-C3a-2-Yd.js';
2
+ export { D as DefaultModeStore, L as LLMSelector, a as LLMSelectorOptions, M as ModeLoaderOptions, P as ProviderModelDescriptor, d as describeCatalogModel, l as loadProjectModes, b as loadUserModes, r as resolveProviderModelList } from '../provider-model-resolve-d5poT5y0.js';
3
+ import { d as ModelMatrixEntry, P as ProviderConfig } from '../config-C_ae2k86.js';
4
4
  import '../mode-CZlO9iU1.js';
5
- import '../context-dT5Ueund.js';
6
- import '../selector-Bc7eWtT3.js';
5
+ import '../context-Dp87Bcaq.js';
6
+ import '../selector-CXl2_y9W.js';
7
7
 
8
8
  /**
9
9
  * Model Intelligence — knowledge base of model capabilities, strengths,
@@ -349,10 +349,11 @@ var DefaultModelsRegistry = class {
349
349
  capabilities: {
350
350
  tools: model.tool_call ?? false,
351
351
  vision: Boolean(model.modalities?.input?.includes("image")),
352
- reasoning: model.reasoning ?? false,
352
+ reasoning: model.reasoning ?? model.reasoningConfig !== void 0,
353
353
  maxContext: model.limit?.context ?? 0,
354
354
  maxOutput: model.limit?.output,
355
- knowledge: model.knowledge
355
+ knowledge: model.knowledge,
356
+ reasoningConfig: model.reasoningConfig
356
357
  },
357
358
  cost: model.cost
358
359
  };
@@ -837,7 +838,7 @@ function expectDefined(value, label) {
837
838
  // src/utils/token-estimate.ts
838
839
  var RoughTokenEstimate = (text, charsPerToken = 3.5) => Math.max(1, Math.ceil(text.length / charsPerToken));
839
840
  var ESTIMATE_CACHE = /* @__PURE__ */ new Map();
840
- var ESTIMATE_CACHE_MAX_SIZE = 1e4;
841
+ var ESTIMATE_CACHE_MAX_SIZE = 5e4;
841
842
  function getCachedEstimate(key, compute) {
842
843
  const existing = ESTIMATE_CACHE.get(key);
843
844
  if (existing !== void 0) return existing;