@wrongstack/core 0.267.0 → 0.268.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 (74) hide show
  1. package/dist/{agent-bridge-STJ3JwwK.d.ts → agent-bridge-UhojbpWx.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-CzPGP3jA.d.ts → agent-subagent-runner-Bvtf1o9K.d.ts} +7 -7
  3. package/dist/{brain-Cdg77tVN.d.ts → brain-69wzMKp1.d.ts} +1 -1
  4. package/dist/{compactor-iMZ84CXq.d.ts → compactor-CBQAJoDc.d.ts} +1 -1
  5. package/dist/{config-Du3pYYln.d.ts → config-VKfOZ-6X.d.ts} +70 -2
  6. package/dist/{context-dT5Ueund.d.ts → context-C0U8B9NF.d.ts} +24 -1
  7. package/dist/coordination/index.d.ts +56 -160
  8. package/dist/coordination/index.js +333 -63
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/defaults/index.d.ts +26 -25
  11. package/dist/defaults/index.js +94 -68
  12. package/dist/defaults/index.js.map +1 -1
  13. package/dist/execution/index.d.ts +72 -16
  14. package/dist/execution/index.js +151 -36
  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-KByEFFBa.d.ts +663 -0
  19. package/dist/{goal-preamble-SulMTowG.d.ts → goal-preamble-CrYjmdw4.d.ts} +9 -9
  20. package/dist/{goal-store-CABDwdFE.d.ts → goal-store-Y_zdLZ3q.d.ts} +1 -1
  21. package/dist/hq/index.d.ts +195 -0
  22. package/dist/hq/index.js +1884 -0
  23. package/dist/hq/index.js.map +1 -0
  24. package/dist/{index-IEuxQd-E.d.ts → index-BfaS-f_m.d.ts} +2 -2
  25. package/dist/{index-DtCVWel4.d.ts → index-CtQnmkaS.d.ts} +8 -8
  26. package/dist/{index-Bms0m4oy.d.ts → index-gCv830d7.d.ts} +5 -5
  27. package/dist/index.d.ts +46 -42
  28. package/dist/index.js +2955 -1498
  29. package/dist/index.js.map +1 -1
  30. package/dist/infrastructure/index.d.ts +6 -6
  31. package/dist/infrastructure/index.js +45 -18
  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-HT3Fi7Bl.d.ts} +10 -4
  36. package/dist/models/index.d.ts +5 -5
  37. package/dist/models/index.js +3 -2
  38. package/dist/models/index.js.map +1 -1
  39. package/dist/{models-registry-BqGZNJQ-.d.ts → models-registry-Bvcl3Vaa.d.ts} +1 -1
  40. package/dist/{multi-agent-coordinator-B8R43uPz.d.ts → multi-agent-coordinator-BACjsmkC.d.ts} +1 -1
  41. package/dist/{null-fleet-bus-CnXa5oTH.d.ts → null-fleet-bus-DA7fvhUg.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-Ci71gYu_.d.ts} +9 -15
  44. package/dist/{path-resolver-COIMLCQL.d.ts → path-resolver-O1IJnmKE.d.ts} +4 -3
  45. package/dist/{permission-B75JAi3-.d.ts → permission-Bd-57Lbl.d.ts} +1 -1
  46. package/dist/{permission-policy-DlR9eJAM.d.ts → permission-policy-uNXC6Kge.d.ts} +2 -3
  47. package/dist/pipeline-BDNvENyV.d.ts +245 -0
  48. package/dist/{plan-templates-DSIKCXZN.d.ts → plan-templates-EMsalEtN.d.ts} +5 -5
  49. package/dist/{provider-model-resolve-BNRsNuJx.d.ts → provider-model-resolve-CEb9x886.d.ts} +3 -3
  50. package/dist/{provider-runner-CX7iIvox.d.ts → provider-runner-DWJbpo70.d.ts} +3 -3
  51. package/dist/{retry-policy-BilV1ujH.d.ts → retry-policy-C3s_lvdK.d.ts} +1 -1
  52. package/dist/sdd/index.d.ts +9 -8
  53. package/dist/sdd/index.js +32 -2
  54. package/dist/sdd/index.js.map +1 -1
  55. package/dist/{secret-vault-gkvEZZfE.d.ts → secret-vault-Cgduf5xL.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-47LBnBVk.d.ts} +1 -1
  60. package/dist/{session-event-bridge-D-araDEz.d.ts → session-event-bridge-Cw7oqmW2.d.ts} +1 -1
  61. package/dist/{session-reader-D7Dapswh.d.ts → session-reader-DD4v2Obw.d.ts} +1 -1
  62. package/dist/storage/index.d.ts +14 -12
  63. package/dist/storage/index.js +63 -36
  64. package/dist/storage/index.js.map +1 -1
  65. package/dist/tools/index.d.ts +2 -2
  66. package/dist/tools/index.js +166 -31
  67. package/dist/tools/index.js.map +1 -1
  68. package/dist/types/index.d.ts +20 -19
  69. package/dist/types/index.js +68 -51
  70. package/dist/types/index.js.map +1 -1
  71. package/dist/utils/index.d.ts +22 -3
  72. package/dist/utils/index.js +139 -1
  73. package/dist/utils/index.js.map +1 -1
  74. package/package.json +5 -1
@@ -1,9 +1,9 @@
1
1
  export { D as DefaultLogger, a as DefaultLoggerOptions, L as LogFormat } from '../logger-DmmQhf4P.js';
2
- export { D as DefaultPathResolver, a as DefaultTokenCounter } from '../path-resolver-COIMLCQL.js';
3
- export { C as ContextManagerAction, a as ContextManagerInput, b as ContextManagerResult, c as ContextManagerToolOptions, d as allServers, e as awsServer, f as blockServer, g as braveSearchServer, h as context7Server, i as contextManagerTool, j as createContextManagerTool, k as everArtServer, l as filesystemServer, m as githubServer, n as googleMapsServer, o as miniMaxVisionServer, p as playwrightServer, s as sentinelServer, q as slackServer, z as zaiVisionServer } from '../mcp-servers-C2cBTxUR.js';
2
+ export { D as DefaultPathResolver, a as DefaultTokenCounter } from '../path-resolver-O1IJnmKE.js';
3
+ export { C as ContextManagerAction, a as ContextManagerInput, b as ContextManagerResult, c as ContextManagerToolOptions, d as allServers, e as awsServer, f as blockServer, g as braveSearchServer, h as context7Server, i as contextManagerTool, j as createContextManagerTool, k as everArtServer, l as filesystemServer, m as githubServer, n as googleMapsServer, o as miniMaxVisionServer, p as playwrightServer, s as sentinelServer, q as slackServer, r as sshManagerServer, z as zaiVisionServer } from '../mcp-servers-HT3Fi7Bl.js';
4
4
  import '../logger-B63L5bTg.js';
5
- import '../brain-Cdg77tVN.js';
6
- import '../context-dT5Ueund.js';
7
- import '../config-Du3pYYln.js';
5
+ import '../brain-69wzMKp1.js';
6
+ import '../context-C0U8B9NF.js';
7
+ import '../config-VKfOZ-6X.js';
8
8
  import '../path-resolver-CPRj4bFY.js';
9
- import '../compactor-iMZ84CXq.js';
9
+ import '../compactor-CBQAJoDc.js';
@@ -287,11 +287,10 @@ var DefaultTokenCounter = class {
287
287
  const price = model ? this.priceCache.get(model) : void 0;
288
288
  if (price) {
289
289
  this.applyPrice(usage, price);
290
- this.events?.emit("token.accounted", {
291
- usage: this.total(),
292
- cost: { input: this.costInput, output: this.costOutput, total: this.costInput + this.costOutput }
293
- });
294
- } else if (this.registry && this.providerId && model) {
290
+ this.emitAccounted();
291
+ return;
292
+ }
293
+ if (this.registry && this.providerId && model) {
295
294
  if (this.priceCache.size >= PRICE_CACHE_MAX_SIZE) {
296
295
  const keys = [...this.priceCache.keys()];
297
296
  this.priceCache.delete(keys[0] ?? "");
@@ -301,16 +300,16 @@ var DefaultTokenCounter = class {
301
300
  const p = priceFromModel(m);
302
301
  this.priceCache.set(model, p);
303
302
  this.applyPrice(usage, p);
304
- this.events?.emit("token.accounted", {
305
- usage: this.total(),
306
- cost: { input: this.costInput, output: this.costOutput, total: this.costInput + this.costOutput }
307
- });
308
303
  }
304
+ this.emitAccounted();
309
305
  }).catch(() => {
310
306
  this.events?.emit("token.cost_estimate_unavailable", { model: model ?? "<unknown>" });
307
+ this.emitAccounted();
311
308
  return void 0;
312
309
  });
310
+ return;
313
311
  }
312
+ this.emitAccounted();
314
313
  }
315
314
  /** Synchronous variant for code paths that have already resolved the model. */
316
315
  accountWithModel(usage, resolved) {
@@ -327,10 +326,7 @@ var DefaultTokenCounter = class {
327
326
  }
328
327
  this.priceCache.set(resolved.modelId, price);
329
328
  this.applyPrice(usage, price);
330
- this.events?.emit("token.accounted", {
331
- usage: this.total(),
332
- cost: { input: this.costInput, output: this.costOutput, total: this.costInput + this.costOutput }
333
- });
329
+ this.emitAccounted();
334
330
  }
335
331
  total() {
336
332
  return {
@@ -363,6 +359,12 @@ var DefaultTokenCounter = class {
363
359
  invalidateCache() {
364
360
  this.priceCache.clear();
365
361
  }
362
+ emitAccounted() {
363
+ this.events?.emit("token.accounted", {
364
+ usage: this.total(),
365
+ cost: { input: this.costInput, output: this.costOutput, total: this.costInput + this.costOutput }
366
+ });
367
+ }
366
368
  reset() {
367
369
  this.input = 0;
368
370
  this.output = 0;
@@ -370,6 +372,9 @@ var DefaultTokenCounter = class {
370
372
  this.cacheWrite = 0;
371
373
  this.costInput = 0;
372
374
  this.costOutput = 0;
375
+ this.lastInput = 0;
376
+ this.lastCacheRead = 0;
377
+ this.emitAccounted();
373
378
  }
374
379
  applyPrice(usage, price) {
375
380
  if (price.input) this.costInput += usage.input / 1e6 * price.input;
@@ -377,8 +382,14 @@ var DefaultTokenCounter = class {
377
382
  if (usage.cacheRead && price.cacheRead) {
378
383
  this.costInput += usage.cacheRead / 1e6 * price.cacheRead;
379
384
  }
380
- if (usage.cacheWrite && price.cacheWrite) {
381
- this.costInput += usage.cacheWrite / 1e6 * price.cacheWrite;
385
+ const hasCacheWriteSplit = usage.cacheWrite5m !== void 0 || usage.cacheWrite1h !== void 0;
386
+ const cacheWrite5m = usage.cacheWrite5m ?? (hasCacheWriteSplit ? 0 : usage.cacheWrite);
387
+ const cacheWrite1h = usage.cacheWrite1h ?? 0;
388
+ if (cacheWrite5m && (price.cacheWrite5m ?? price.cacheWrite)) {
389
+ this.costInput += cacheWrite5m / 1e6 * (price.cacheWrite5m ?? price.cacheWrite ?? 0);
390
+ }
391
+ if (cacheWrite1h && (price.cacheWrite1h ?? price.cacheWrite)) {
392
+ this.costInput += cacheWrite1h / 1e6 * (price.cacheWrite1h ?? price.cacheWrite ?? 0);
382
393
  }
383
394
  }
384
395
  };
@@ -387,7 +398,9 @@ function priceFromModel(m) {
387
398
  input: m.cost?.input,
388
399
  output: m.cost?.output,
389
400
  cacheRead: m.cost?.cache_read,
390
- cacheWrite: m.cost?.cache_write
401
+ cacheWrite: m.cost?.cache_write,
402
+ cacheWrite5m: m.cost?.cache_write_5m ?? m.cost?.cache_write,
403
+ cacheWrite1h: m.cost?.cache_write_1h ?? (m.cost?.input !== void 0 ? m.cost.input * 2 : void 0)
391
404
  };
392
405
  }
393
406
  function round4(n) {
@@ -513,6 +526,19 @@ var miniMaxVisionServer = () => ({
513
526
  allowedTools: ["understand_image"],
514
527
  permission: "auto"
515
528
  });
529
+ var sshManagerServer = () => ({
530
+ name: "ssh",
531
+ description: "Remote SSH management \u2014 execute commands, transfer files, tunnels, health checks (mcp-ssh-manager)",
532
+ transport: "stdio",
533
+ command: "npx",
534
+ args: ["-y", "mcp-ssh-manager"],
535
+ env: {
536
+ MCP_SSH_COMPACT_JSON: "true",
537
+ MCP_SSH_DEFAULT_TIMEOUT: "120000"
538
+ },
539
+ permission: "confirm",
540
+ requestTimeoutMs: 18e4
541
+ });
516
542
  var allServers = () => ({
517
543
  filesystem: { ...filesystemServer(), enabled: false },
518
544
  github: { ...githubServer(), enabled: false },
@@ -526,7 +552,8 @@ var allServers = () => ({
526
552
  sentinel: { ...sentinelServer(), enabled: false },
527
553
  "zai-vision": { ...zaiVisionServer(), enabled: false },
528
554
  "minimax-vision": { ...miniMaxVisionServer(), enabled: false },
529
- playwright: { ...playwrightServer(), enabled: false }
555
+ playwright: { ...playwrightServer(), enabled: false },
556
+ ssh: { ...sshManagerServer(), enabled: false }
530
557
  });
531
558
 
532
559
  // src/utils/expect-defined.ts
@@ -1080,6 +1107,6 @@ function createContextManagerTool(opts = {}) {
1080
1107
  }
1081
1108
  var contextManagerTool = createContextManagerTool();
1082
1109
 
1083
- export { DefaultLogger, DefaultPathResolver, DefaultTokenCounter, allServers, awsServer, blockServer, braveSearchServer, context7Server, contextManagerTool, createContextManagerTool, everArtServer, filesystemServer, githubServer, googleMapsServer, miniMaxVisionServer, playwrightServer, sentinelServer, slackServer, zaiVisionServer };
1110
+ export { DefaultLogger, DefaultPathResolver, DefaultTokenCounter, allServers, awsServer, blockServer, braveSearchServer, context7Server, contextManagerTool, createContextManagerTool, everArtServer, filesystemServer, githubServer, googleMapsServer, miniMaxVisionServer, playwrightServer, sentinelServer, slackServer, sshManagerServer, zaiVisionServer };
1084
1111
  //# sourceMappingURL=index.js.map
1085
1112
  //# sourceMappingURL=index.js.map