agentix-cli 0.30.0 → 0.32.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 (116) hide show
  1. package/dist/{App-IEQXWJ7B.js → App-2LAWZNMG.js} +2 -2
  2. package/dist/{ChatApp-NWOSAP5U.js → ChatApp-2KRDHMTV.js} +2 -2
  3. package/dist/{agent-SPE7Q7MD.js → agent-ZRRIMLTX.js} +2 -2
  4. package/dist/{board-dashboard-K4DM32SO.js → board-dashboard-LL3YVODL.js} +192 -171
  5. package/dist/board-dashboard-LL3YVODL.js.map +1 -0
  6. package/dist/{chunk-MGNJWBVP.js → chunk-2DBGOCCW.js} +2 -2
  7. package/dist/{chunk-MGNJWBVP.js.map → chunk-2DBGOCCW.js.map} +1 -1
  8. package/dist/chunk-2DMVKLLE.js +13 -0
  9. package/dist/chunk-2DMVKLLE.js.map +1 -0
  10. package/dist/chunk-2GIDVZ4H.js +3 -0
  11. package/dist/{chunk-EVWEG3VD.js.map → chunk-2GIDVZ4H.js.map} +1 -1
  12. package/dist/{chunk-UCQ2N3KO.js → chunk-2TJ5L7CB.js} +2 -2
  13. package/dist/{chunk-FKBGJYWQ.js → chunk-3RHPZXCR.js} +2 -2
  14. package/dist/{chunk-DI7FMCDK.js → chunk-4CR463C6.js} +2 -2
  15. package/dist/{chunk-IVQO43U2.js → chunk-5FEQI22L.js} +2 -2
  16. package/dist/{chunk-45BLFNDG.js → chunk-6VQKHMEQ.js} +47 -47
  17. package/dist/chunk-6VQKHMEQ.js.map +1 -0
  18. package/dist/{chunk-52ZPELD2.js → chunk-7CVJ4JOE.js} +2 -2
  19. package/dist/{chunk-4KXBUORV.js → chunk-A4YR3PQY.js} +2 -2
  20. package/dist/{chunk-Q7CZIRBB.js → chunk-B2XTYYXV.js} +2 -2
  21. package/dist/{chunk-JKYMXLYL.js → chunk-G5MFPNGJ.js} +2 -2
  22. package/dist/{chunk-EL3J74N2.js → chunk-GWQIMAJ7.js} +2 -2
  23. package/dist/{chunk-42DCRKUD.js → chunk-H57XXGMF.js} +96 -94
  24. package/dist/chunk-H57XXGMF.js.map +1 -0
  25. package/dist/{chunk-V4HURNMX.js → chunk-JGJE5Y2J.js} +2 -2
  26. package/dist/{chunk-SC5DIKBB.js → chunk-JWKIFAXA.js} +2 -2
  27. package/dist/{chunk-UU4WOZNR.js → chunk-K6E7WJ7O.js} +2 -2
  28. package/dist/{chunk-AUNDQPDR.js → chunk-MFVI5FOM.js} +2 -2
  29. package/dist/{chunk-M4AMWP3H.js → chunk-QLTM3F7M.js} +17 -8
  30. package/dist/{chunk-M4AMWP3H.js.map → chunk-QLTM3F7M.js.map} +1 -1
  31. package/dist/{chunk-IWMW5432.js → chunk-V7FYSZSV.js} +1 -1
  32. package/dist/{chunk-IWMW5432.js.map → chunk-V7FYSZSV.js.map} +1 -1
  33. package/dist/chunk-VMDA2SX2.js +43 -0
  34. package/dist/chunk-VMDA2SX2.js.map +1 -0
  35. package/dist/{chunk-GK7XAM3D.js → chunk-W3YGESNK.js} +2 -2
  36. package/dist/{chunk-GUBMLV34.js → chunk-WFIBOAXN.js} +8 -8
  37. package/dist/chunk-WFIBOAXN.js.map +1 -0
  38. package/dist/cli.js +1 -1
  39. package/dist/client-IP643GRO.js +2 -0
  40. package/dist/config-IVDP46ZG.js +2 -0
  41. package/dist/config-mutator-UCGAV3SP.js +2 -0
  42. package/dist/doctor-MMT4SREV.js +2 -0
  43. package/dist/index.d.ts +35 -0
  44. package/dist/index.js +1 -1
  45. package/dist/processes-I3XAPHG7.js +2 -0
  46. package/dist/program-7ULXLTD6.js +2 -0
  47. package/dist/query-RHVR6QUZ.js +2 -0
  48. package/dist/registry-OB6S66XX.js +2 -0
  49. package/dist/request-planner-F5NVL2G7.js +2 -0
  50. package/dist/request-planner-F5NVL2G7.js.map +1 -0
  51. package/dist/{review-candidates-O2PS7L3B.js → review-candidates-IRPKFWL2.js} +2 -2
  52. package/dist/{rotation-memo-7T75BLEX.js → rotation-memo-QEO3COFH.js} +3 -3
  53. package/dist/rotation-memo-QEO3COFH.js.map +1 -0
  54. package/dist/{routing-5K7PGHPL.js → routing-OSPRKRAY.js} +2 -2
  55. package/dist/scheduler-JL6K5HHI.js +2 -0
  56. package/dist/{seat-FZRNRAHQ.js → seat-2MHKVMW2.js} +2 -2
  57. package/dist/{select-SOJYFAMI.js → select-7LCHJVPK.js} +2 -2
  58. package/dist/{surface-usage-NS74AXSE.js → surface-usage-UREILT2E.js} +2 -2
  59. package/dist/web/activity-graph.global.js +901 -368
  60. package/dist/web/activity-graph.global.js.map +1 -1
  61. package/dist/wiki-MY32MON3.js +2 -0
  62. package/package.json +2 -1
  63. package/dist/board-dashboard-K4DM32SO.js.map +0 -1
  64. package/dist/chunk-42DCRKUD.js.map +0 -1
  65. package/dist/chunk-45BLFNDG.js.map +0 -1
  66. package/dist/chunk-4BR7D2OU.js +0 -36
  67. package/dist/chunk-4BR7D2OU.js.map +0 -1
  68. package/dist/chunk-EVWEG3VD.js +0 -3
  69. package/dist/chunk-GMNKJXTR.js +0 -13
  70. package/dist/chunk-GMNKJXTR.js.map +0 -1
  71. package/dist/chunk-GUBMLV34.js.map +0 -1
  72. package/dist/client-5Z3URGPY.js +0 -2
  73. package/dist/config-ORSGLVRW.js +0 -2
  74. package/dist/config-mutator-JB3S2E7H.js +0 -2
  75. package/dist/doctor-FS2BX6H4.js +0 -2
  76. package/dist/processes-WU23U2OJ.js +0 -2
  77. package/dist/program-DWZAI4GY.js +0 -2
  78. package/dist/query-3HXGBKGM.js +0 -2
  79. package/dist/registry-EJRWAJYG.js +0 -2
  80. package/dist/request-planner-BCOXUAPA.js +0 -2
  81. package/dist/request-planner-BCOXUAPA.js.map +0 -1
  82. package/dist/rotation-memo-7T75BLEX.js.map +0 -1
  83. package/dist/scheduler-DSAOMV4O.js +0 -2
  84. package/dist/wiki-34XVI32N.js +0 -2
  85. /package/dist/{App-IEQXWJ7B.js.map → App-2LAWZNMG.js.map} +0 -0
  86. /package/dist/{ChatApp-NWOSAP5U.js.map → ChatApp-2KRDHMTV.js.map} +0 -0
  87. /package/dist/{agent-SPE7Q7MD.js.map → agent-ZRRIMLTX.js.map} +0 -0
  88. /package/dist/{chunk-UCQ2N3KO.js.map → chunk-2TJ5L7CB.js.map} +0 -0
  89. /package/dist/{chunk-FKBGJYWQ.js.map → chunk-3RHPZXCR.js.map} +0 -0
  90. /package/dist/{chunk-DI7FMCDK.js.map → chunk-4CR463C6.js.map} +0 -0
  91. /package/dist/{chunk-IVQO43U2.js.map → chunk-5FEQI22L.js.map} +0 -0
  92. /package/dist/{chunk-52ZPELD2.js.map → chunk-7CVJ4JOE.js.map} +0 -0
  93. /package/dist/{chunk-4KXBUORV.js.map → chunk-A4YR3PQY.js.map} +0 -0
  94. /package/dist/{chunk-Q7CZIRBB.js.map → chunk-B2XTYYXV.js.map} +0 -0
  95. /package/dist/{chunk-JKYMXLYL.js.map → chunk-G5MFPNGJ.js.map} +0 -0
  96. /package/dist/{chunk-EL3J74N2.js.map → chunk-GWQIMAJ7.js.map} +0 -0
  97. /package/dist/{chunk-V4HURNMX.js.map → chunk-JGJE5Y2J.js.map} +0 -0
  98. /package/dist/{chunk-SC5DIKBB.js.map → chunk-JWKIFAXA.js.map} +0 -0
  99. /package/dist/{chunk-UU4WOZNR.js.map → chunk-K6E7WJ7O.js.map} +0 -0
  100. /package/dist/{chunk-AUNDQPDR.js.map → chunk-MFVI5FOM.js.map} +0 -0
  101. /package/dist/{chunk-GK7XAM3D.js.map → chunk-W3YGESNK.js.map} +0 -0
  102. /package/dist/{client-5Z3URGPY.js.map → client-IP643GRO.js.map} +0 -0
  103. /package/dist/{config-ORSGLVRW.js.map → config-IVDP46ZG.js.map} +0 -0
  104. /package/dist/{config-mutator-JB3S2E7H.js.map → config-mutator-UCGAV3SP.js.map} +0 -0
  105. /package/dist/{doctor-FS2BX6H4.js.map → doctor-MMT4SREV.js.map} +0 -0
  106. /package/dist/{processes-WU23U2OJ.js.map → processes-I3XAPHG7.js.map} +0 -0
  107. /package/dist/{program-DWZAI4GY.js.map → program-7ULXLTD6.js.map} +0 -0
  108. /package/dist/{query-3HXGBKGM.js.map → query-RHVR6QUZ.js.map} +0 -0
  109. /package/dist/{registry-EJRWAJYG.js.map → registry-OB6S66XX.js.map} +0 -0
  110. /package/dist/{review-candidates-O2PS7L3B.js.map → review-candidates-IRPKFWL2.js.map} +0 -0
  111. /package/dist/{routing-5K7PGHPL.js.map → routing-OSPRKRAY.js.map} +0 -0
  112. /package/dist/{scheduler-DSAOMV4O.js.map → scheduler-JL6K5HHI.js.map} +0 -0
  113. /package/dist/{seat-FZRNRAHQ.js.map → seat-2MHKVMW2.js.map} +0 -0
  114. /package/dist/{select-SOJYFAMI.js.map → select-7LCHJVPK.js.map} +0 -0
  115. /package/dist/{surface-usage-NS74AXSE.js.map → surface-usage-UREILT2E.js.map} +0 -0
  116. /package/dist/{wiki-34XVI32N.js.map → wiki-MY32MON3.js.map} +0 -0
package/dist/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{a as s}from"./chunk-42DCRKUD.js";import"./chunk-DI7FMCDK.js";import"./chunk-JKYMXLYL.js";import"./chunk-Q7CZIRBB.js";import"./chunk-UCQ2N3KO.js";import"./chunk-52ZPELD2.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-GUBMLV34.js";import"./chunk-F6CNF7V3.js";import"./chunk-EL3J74N2.js";import"./chunk-IWMW5432.js";import"./chunk-ZVP6GB4G.js";import"./chunk-45BLFNDG.js";import"./chunk-IVQO43U2.js";import"./chunk-4BR7D2OU.js";import"./chunk-M4AMWP3H.js";import"./chunk-4KXBUORV.js";import"./chunk-UU4WOZNR.js";import"./chunk-SFQUP3BP.js";import"./chunk-3SCPRYJB.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-SC5DIKBB.js";import"./chunk-GK7XAM3D.js";import"./chunk-DWADWDMU.js";import"./chunk-77OV7346.js";import"./chunk-VWTBHLMX.js";import"./chunk-AUNDQPDR.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-V4HURNMX.js";import"./chunk-AJ5RMU7X.js";import"./chunk-EVWEG3VD.js";import"./chunk-MGNJWBVP.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-VDMYBPYB.js";import"./chunk-DSYKYZMT.js";import"./chunk-GMNKJXTR.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";process.on("SIGINT",()=>process.exit(0));process.on("SIGTERM",()=>process.exit(0));async function o(){let r=await s();if(process.argv.slice(2).length===0){r.outputHelp();return}r.parse()}o();
2
+ import{a as s}from"./chunk-H57XXGMF.js";import"./chunk-4CR463C6.js";import"./chunk-G5MFPNGJ.js";import"./chunk-B2XTYYXV.js";import"./chunk-2TJ5L7CB.js";import"./chunk-7CVJ4JOE.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-WFIBOAXN.js";import"./chunk-F6CNF7V3.js";import"./chunk-GWQIMAJ7.js";import"./chunk-V7FYSZSV.js";import"./chunk-ZVP6GB4G.js";import"./chunk-6VQKHMEQ.js";import"./chunk-5FEQI22L.js";import"./chunk-VMDA2SX2.js";import"./chunk-QLTM3F7M.js";import"./chunk-A4YR3PQY.js";import"./chunk-K6E7WJ7O.js";import"./chunk-SFQUP3BP.js";import"./chunk-3SCPRYJB.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-JWKIFAXA.js";import"./chunk-W3YGESNK.js";import"./chunk-DWADWDMU.js";import"./chunk-77OV7346.js";import"./chunk-VWTBHLMX.js";import"./chunk-MFVI5FOM.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-JGJE5Y2J.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import"./chunk-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-VDMYBPYB.js";import"./chunk-DSYKYZMT.js";import"./chunk-2DMVKLLE.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";process.on("SIGINT",()=>process.exit(0));process.on("SIGTERM",()=>process.exit(0));async function o(){let r=await s();if(process.argv.slice(2).length===0){r.outputHelp();return}r.parse()}o();
3
3
  //# sourceMappingURL=cli.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e,f,g}from"./chunk-4CR463C6.js";import"./chunk-2DMVKLLE.js";import"./chunk-FIOB3MEX.js";export{b as fetchAgents,d as fetchCrons,c as fetchProcesses,e as killProcess,a as resolveConn,f as sendTask,g as streamTask};
2
+ //# sourceMappingURL=client-IP643GRO.js.map
@@ -0,0 +1,2 @@
1
+ import{d as a,e as b,f as c,g as d,h as e,j as f}from"./chunk-2DMVKLLE.js";import"./chunk-FIOB3MEX.js";f();export{a as INTEGRATION_KINDS,b as daemonConfigSchema,c as expandEnvVars,d as loadDaemonConfig,e as validateWorkspaces};
2
+ //# sourceMappingURL=config-IVDP46ZG.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d}from"./chunk-JWKIFAXA.js";import"./chunk-2DMVKLLE.js";import"./chunk-FIOB3MEX.js";export{a as applyConfigMutation,c as getAtPath,b as setAtPath,d as unsetAtPath};
2
+ //# sourceMappingURL=config-mutator-UCGAV3SP.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-G5MFPNGJ.js";import"./chunk-2DMVKLLE.js";import"./chunk-FIOB3MEX.js";export{b as doctor,a as runDoctorChecks};
2
+ //# sourceMappingURL=doctor-MMT4SREV.js.map
package/dist/index.d.ts CHANGED
@@ -1562,6 +1562,12 @@ declare const agentConfigSchema: z.ZodObject<{
1562
1562
  * agents that do long investigations or multi-file refactors. */
1563
1563
  maxExecutionMinutes: z.ZodDefault<z.ZodNumber>;
1564
1564
  permissionMode: z.ZodDefault<z.ZodString>;
1565
+ /** How this agent's `claude` CLI is billed (claude-code tier). Default
1566
+ * "subscription": the shared OAuth login, ANTHROPIC_API_KEY stripped.
1567
+ * "api": bill ANTHROPIC_API_KEY instead and drop the OAuth token, so
1568
+ * e.g. benchmark agents never draw on the fleet's subscription quota.
1569
+ * An "api" agent with no key fails its task rather than falling back. */
1570
+ billing: z.ZodDefault<z.ZodEnum<["subscription", "api"]>>;
1565
1571
  /** Improvement plan #3 — tool-use-required preset. When set,
1566
1572
  * AgentX inspects the stream-json events from each task and
1567
1573
  * fails the response with `tool_required_not_called: <name>`
@@ -1713,6 +1719,7 @@ declare const agentConfigSchema: z.ZodObject<{
1713
1719
  maxConcurrent: number;
1714
1720
  maxExecutionMinutes: number;
1715
1721
  permissionMode: string;
1722
+ billing: "api" | "subscription";
1716
1723
  toolUseRequired: string[];
1717
1724
  persistentProcess: boolean;
1718
1725
  queueMode: "collect" | "followup" | "drop";
@@ -1781,6 +1788,7 @@ declare const agentConfigSchema: z.ZodObject<{
1781
1788
  maxConcurrent?: number | undefined;
1782
1789
  maxExecutionMinutes?: number | undefined;
1783
1790
  permissionMode?: string | undefined;
1791
+ billing?: "api" | "subscription" | undefined;
1784
1792
  toolUseRequired?: string[] | undefined;
1785
1793
  gitlabAutoReply?: boolean | undefined;
1786
1794
  persistentProcess?: boolean | undefined;
@@ -2061,6 +2069,12 @@ declare const daemonConfigSchema: z.ZodObject<{
2061
2069
  * agents that do long investigations or multi-file refactors. */
2062
2070
  maxExecutionMinutes: z.ZodDefault<z.ZodNumber>;
2063
2071
  permissionMode: z.ZodDefault<z.ZodString>;
2072
+ /** How this agent's `claude` CLI is billed (claude-code tier). Default
2073
+ * "subscription": the shared OAuth login, ANTHROPIC_API_KEY stripped.
2074
+ * "api": bill ANTHROPIC_API_KEY instead and drop the OAuth token, so
2075
+ * e.g. benchmark agents never draw on the fleet's subscription quota.
2076
+ * An "api" agent with no key fails its task rather than falling back. */
2077
+ billing: z.ZodDefault<z.ZodEnum<["subscription", "api"]>>;
2064
2078
  /** Improvement plan #3 — tool-use-required preset. When set,
2065
2079
  * AgentX inspects the stream-json events from each task and
2066
2080
  * fails the response with `tool_required_not_called: <name>`
@@ -2212,6 +2226,7 @@ declare const daemonConfigSchema: z.ZodObject<{
2212
2226
  maxConcurrent: number;
2213
2227
  maxExecutionMinutes: number;
2214
2228
  permissionMode: string;
2229
+ billing: "api" | "subscription";
2215
2230
  toolUseRequired: string[];
2216
2231
  persistentProcess: boolean;
2217
2232
  queueMode: "collect" | "followup" | "drop";
@@ -2280,6 +2295,7 @@ declare const daemonConfigSchema: z.ZodObject<{
2280
2295
  maxConcurrent?: number | undefined;
2281
2296
  maxExecutionMinutes?: number | undefined;
2282
2297
  permissionMode?: string | undefined;
2298
+ billing?: "api" | "subscription" | undefined;
2283
2299
  toolUseRequired?: string[] | undefined;
2284
2300
  gitlabAutoReply?: boolean | undefined;
2285
2301
  persistentProcess?: boolean | undefined;
@@ -4244,6 +4260,10 @@ declare const daemonConfigSchema: z.ZodObject<{
4244
4260
  * Setting this to 0 in active mode means the calibration report stops
4245
4261
  * being trustworthy the day you promote the seat. */
4246
4262
  explore: z.ZodDefault<z.ZodNumber>;
4263
+ /** Fraction of turns that bypass the seat as a randomized control group.
4264
+ * Unset lets the seat pick its own default; only seats that run an
4265
+ * experiment read it (today: request-gate, default 0.1). */
4266
+ holdout: z.ZodOptional<z.ZodNumber>;
4247
4267
  }, "strip", z.ZodTypeAny, {
4248
4268
  temperature: number;
4249
4269
  mode: "active" | "off" | "shadow";
@@ -4251,6 +4271,7 @@ declare const daemonConfigSchema: z.ZodObject<{
4251
4271
  explore: number;
4252
4272
  model?: string | undefined;
4253
4273
  backend?: string | undefined;
4274
+ holdout?: number | undefined;
4254
4275
  }, {
4255
4276
  model?: string | undefined;
4256
4277
  temperature?: number | undefined;
@@ -4258,6 +4279,7 @@ declare const daemonConfigSchema: z.ZodObject<{
4258
4279
  mode?: "active" | "off" | "shadow" | undefined;
4259
4280
  timeoutMs?: number | undefined;
4260
4281
  explore?: number | undefined;
4282
+ holdout?: number | undefined;
4261
4283
  }>>>>;
4262
4284
  /** Model routing driven by the task-tier seat. Models are scoped to their
4263
4285
  * CLI engine; the legacy cheapModel applies only to Claude Code. */
@@ -4335,6 +4357,7 @@ declare const daemonConfigSchema: z.ZodObject<{
4335
4357
  explore: number;
4336
4358
  model?: string | undefined;
4337
4359
  backend?: string | undefined;
4360
+ holdout?: number | undefined;
4338
4361
  }>;
4339
4362
  routing: {
4340
4363
  cheapModel?: string | undefined;
@@ -4392,6 +4415,7 @@ declare const daemonConfigSchema: z.ZodObject<{
4392
4415
  mode?: "active" | "off" | "shadow" | undefined;
4393
4416
  timeoutMs?: number | undefined;
4394
4417
  explore?: number | undefined;
4418
+ holdout?: number | undefined;
4395
4419
  } | undefined> | undefined;
4396
4420
  routing?: {
4397
4421
  cheapModel?: string | undefined;
@@ -4711,6 +4735,7 @@ declare const daemonConfigSchema: z.ZodObject<{
4711
4735
  maxConcurrent: number;
4712
4736
  maxExecutionMinutes: number;
4713
4737
  permissionMode: string;
4738
+ billing: "api" | "subscription";
4714
4739
  toolUseRequired: string[];
4715
4740
  persistentProcess: boolean;
4716
4741
  queueMode: "collect" | "followup" | "drop";
@@ -5061,6 +5086,7 @@ declare const daemonConfigSchema: z.ZodObject<{
5061
5086
  explore: number;
5062
5087
  model?: string | undefined;
5063
5088
  backend?: string | undefined;
5089
+ holdout?: number | undefined;
5064
5090
  }>;
5065
5091
  routing: {
5066
5092
  cheapModel?: string | undefined;
@@ -5230,6 +5256,7 @@ declare const daemonConfigSchema: z.ZodObject<{
5230
5256
  maxConcurrent?: number | undefined;
5231
5257
  maxExecutionMinutes?: number | undefined;
5232
5258
  permissionMode?: string | undefined;
5259
+ billing?: "api" | "subscription" | undefined;
5233
5260
  toolUseRequired?: string[] | undefined;
5234
5261
  gitlabAutoReply?: boolean | undefined;
5235
5262
  persistentProcess?: boolean | undefined;
@@ -5628,6 +5655,7 @@ declare const daemonConfigSchema: z.ZodObject<{
5628
5655
  mode?: "active" | "off" | "shadow" | undefined;
5629
5656
  timeoutMs?: number | undefined;
5630
5657
  explore?: number | undefined;
5658
+ holdout?: number | undefined;
5631
5659
  } | undefined> | undefined;
5632
5660
  routing?: {
5633
5661
  cheapModel?: string | undefined;
@@ -6079,6 +6107,13 @@ declare class AgentXDaemon {
6079
6107
  * board-dashboard routes), but no transitions fire. */
6080
6108
  private bootWorkflowEngine;
6081
6109
  private startHttpApi;
6110
+ /**
6111
+ * Record an inbound dispatch in the intent ledger so the activity graph
6112
+ * sees it. Shared by /task, /ask and /send/agent; `context.channel` is
6113
+ * what the graph shows as the origin. Never throws — the legacy path
6114
+ * stays authoritative, so a ledger failure only costs visibility.
6115
+ */
6116
+ private recordInboundDispatch;
6082
6117
  /**
6083
6118
  * Broadcast an SSE event to all connected clients.
6084
6119
  */
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{a as L}from"./chunk-W5C2GDNC.js";import{B as bt,C as Tt,D as Mt,a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt}from"./chunk-GUBMLV34.js";import"./chunk-F6CNF7V3.js";import"./chunk-EL3J74N2.js";import"./chunk-IWMW5432.js";import"./chunk-ZVP6GB4G.js";import{J as yt,h as lt,i as ct,j as dt,k as mt,l as pt}from"./chunk-45BLFNDG.js";import"./chunk-IVQO43U2.js";import"./chunk-4BR7D2OU.js";import"./chunk-M4AMWP3H.js";import{h as ut}from"./chunk-4KXBUORV.js";import{A as D,B as z,C as V,a as ye,b as we,c as Se,d as Ae,e as Ie,f as Oe,g as Ne,h as He,i as je,j as Ue,k as _e,l as I,m as q,n as Be,o as qe,p as Ye,q as O,r as ze,s as Ve,t as Xe,u as x,v as Y,w as Qe,x as Ze,y as et,z as wt}from"./chunk-UU4WOZNR.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-3SCPRYJB.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-SC5DIKBB.js";import"./chunk-GK7XAM3D.js";import"./chunk-DWADWDMU.js";import"./chunk-77OV7346.js";import"./chunk-VWTBHLMX.js";import{a as gt,b as ft,e as ht}from"./chunk-AUNDQPDR.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-V4HURNMX.js";import"./chunk-AJ5RMU7X.js";import"./chunk-EVWEG3VD.js";import{j as it,k as rt,l as at}from"./chunk-MGNJWBVP.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-QOYAX2FT.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-LCIREYTD.js";import{a as m,b as G}from"./chunk-L2WSPY6S.js";import{a as Fe,b as Le,c as A,d as De}from"./chunk-VDMYBPYB.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{e as tt,g as st,h as ot,j as nt}from"./chunk-GMNKJXTR.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";W();G();import{execa as Rt}from"execa";import{existsSync as se,promises as X}from"fs";import S from"path";import ie from"node-fetch";async function Et(o,e){let t=o.split("/");if(t.length<2)throw new Error(`Invalid skill package ID: ${o}. Expected format: owner/repo`);let s=t[0],i=t[1],n=t[2];try{let a=n?`${s}/${i}/${n}`:`${s}/${i}`;await Rt("npx",["-y","skills","add",a],{cwd:e,stdio:"pipe"}),m.success(`Installed skill package: ${o}`);let r=S.resolve(e,".skills",`${s}_${i}`);if(se(r))return await ne(r,o);let d=S.resolve(e,".skills");return se(d)?await ne(d,o):[]}catch{return m.info(`Fetching skills directly from GitHub: ${s}/${i}`),await Gt(s,i,n,e)}}async function Gt(o,e,t,s){let i=[];try{let n=`https://api.github.com/repos/${o}/${e}/git/trees/main?recursive=1`,a=await ie(n);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let d=(await a.json()).tree.filter(p=>p.type==="blob"&&p.path.endsWith("SKILL.md"));if(t){let p=d.find(f=>f.path.includes(`/${t}/`)||f.path===`${t}/SKILL.md`);if(p){let f=await oe(o,e,p.path,s);f&&i.push(f)}}else for(let p of d){let f=await oe(o,e,p.path,s);f&&i.push(f)}}catch(n){m.error(`Failed to fetch skills from GitHub: ${n.message}`)}return i}async function oe(o,e,t,s){try{let i=`https://raw.githubusercontent.com/${o}/${e}/main/${t}`,n=await ie(i);if(!n.ok)return null;let a=await n.text(),r=A(a);if(r){r.source="remote",r.packageId=`${o}/${e}`;let d=S.dirname(t),p=S.resolve(s,".skills",`${o}_${e}`,d);await X.mkdir(p,{recursive:!0}),await X.writeFile(S.resolve(p,"SKILL.md"),a),r.path=S.resolve(p,"SKILL.md")}return r}catch{return null}}async function ne(o,e){let t=[],{default:s}=await import("fast-glob"),i=await s.glob("**/SKILL.md",{cwd:o,deep:5});for(let n of i)try{let a=S.resolve(o,n),r=await X.readFile(a,"utf8"),d=A(r);d&&(d.source="remote",d.path=a,d.packageId=e,t.push(d))}catch{}return t}async function At(o,e,t,s,i){let n=["---",`name: ${o}`,`description: ${e}`];if(s?.length){n.push("tags:");for(let a of s)n.push(` - ${a}`)}if(i?.length){n.push("globs:");for(let a of i)n.push(` - ${a}`)}return n.push("---"),`${n.join(`
1
+ import{a as L}from"./chunk-W5C2GDNC.js";import{B as bt,C as Tt,D as Mt,a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt}from"./chunk-WFIBOAXN.js";import"./chunk-F6CNF7V3.js";import"./chunk-GWQIMAJ7.js";import"./chunk-V7FYSZSV.js";import"./chunk-ZVP6GB4G.js";import{J as yt,h as lt,i as ct,j as dt,k as mt,l as pt}from"./chunk-6VQKHMEQ.js";import"./chunk-5FEQI22L.js";import"./chunk-VMDA2SX2.js";import"./chunk-QLTM3F7M.js";import{h as ut}from"./chunk-A4YR3PQY.js";import{A as D,B as z,C as V,a as ye,b as we,c as Se,d as Ae,e as Ie,f as Oe,g as Ne,h as He,i as je,j as Ue,k as _e,l as I,m as q,n as Be,o as qe,p as Ye,q as O,r as ze,s as Ve,t as Xe,u as x,v as Y,w as Qe,x as Ze,y as et,z as wt}from"./chunk-K6E7WJ7O.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-3SCPRYJB.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-JWKIFAXA.js";import"./chunk-W3YGESNK.js";import"./chunk-DWADWDMU.js";import"./chunk-77OV7346.js";import"./chunk-VWTBHLMX.js";import{a as gt,b as ft,e as ht}from"./chunk-MFVI5FOM.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-JGJE5Y2J.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-QOYAX2FT.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-LCIREYTD.js";import{a as m,b as G}from"./chunk-L2WSPY6S.js";import{a as Fe,b as Le,c as A,d as De}from"./chunk-VDMYBPYB.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{e as tt,g as st,h as ot,j as nt}from"./chunk-2DMVKLLE.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";W();G();import{execa as Rt}from"execa";import{existsSync as se,promises as X}from"fs";import S from"path";import ie from"node-fetch";async function Et(o,e){let t=o.split("/");if(t.length<2)throw new Error(`Invalid skill package ID: ${o}. Expected format: owner/repo`);let s=t[0],i=t[1],n=t[2];try{let a=n?`${s}/${i}/${n}`:`${s}/${i}`;await Rt("npx",["-y","skills","add",a],{cwd:e,stdio:"pipe"}),m.success(`Installed skill package: ${o}`);let r=S.resolve(e,".skills",`${s}_${i}`);if(se(r))return await ne(r,o);let d=S.resolve(e,".skills");return se(d)?await ne(d,o):[]}catch{return m.info(`Fetching skills directly from GitHub: ${s}/${i}`),await Gt(s,i,n,e)}}async function Gt(o,e,t,s){let i=[];try{let n=`https://api.github.com/repos/${o}/${e}/git/trees/main?recursive=1`,a=await ie(n);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let d=(await a.json()).tree.filter(p=>p.type==="blob"&&p.path.endsWith("SKILL.md"));if(t){let p=d.find(f=>f.path.includes(`/${t}/`)||f.path===`${t}/SKILL.md`);if(p){let f=await oe(o,e,p.path,s);f&&i.push(f)}}else for(let p of d){let f=await oe(o,e,p.path,s);f&&i.push(f)}}catch(n){m.error(`Failed to fetch skills from GitHub: ${n.message}`)}return i}async function oe(o,e,t,s){try{let i=`https://raw.githubusercontent.com/${o}/${e}/main/${t}`,n=await ie(i);if(!n.ok)return null;let a=await n.text(),r=A(a);if(r){r.source="remote",r.packageId=`${o}/${e}`;let d=S.dirname(t),p=S.resolve(s,".skills",`${o}_${e}`,d);await X.mkdir(p,{recursive:!0}),await X.writeFile(S.resolve(p,"SKILL.md"),a),r.path=S.resolve(p,"SKILL.md")}return r}catch{return null}}async function ne(o,e){let t=[],{default:s}=await import("fast-glob"),i=await s.glob("**/SKILL.md",{cwd:o,deep:5});for(let n of i)try{let a=S.resolve(o,n),r=await X.readFile(a,"utf8"),d=A(r);d&&(d.source="remote",d.path=a,d.packageId=e,t.push(d))}catch{}return t}async function At(o,e,t,s,i){let n=["---",`name: ${o}`,`description: ${e}`];if(s?.length){n.push("tags:");for(let a of s)n.push(` - ${a}`)}if(i?.length){n.push("globs:");for(let a of i)n.push(` - ${a}`)}return n.push("---"),`${n.join(`
2
2
  `)}
3
3
 
4
4
  ${t}`}async function It(o){let{loadLocalSkills:e}=await import("./loader-BOKE5M5S.js");return e(o)}async function Ot(o,e,t,s,i){let a=[{role:"system",content:`You are a skill author for the Agent Skills ecosystem (skills.sh).
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-3RHPZXCR.js";import"./chunk-7CVJ4JOE.js";import"./chunk-V7FYSZSV.js";import"./chunk-FIOB3MEX.js";export{a as renderProcessesPage};
2
+ //# sourceMappingURL=processes-I3XAPHG7.js.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-H57XXGMF.js";import"./chunk-4CR463C6.js";import"./chunk-G5MFPNGJ.js";import"./chunk-B2XTYYXV.js";import"./chunk-2TJ5L7CB.js";import"./chunk-7CVJ4JOE.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-WFIBOAXN.js";import"./chunk-F6CNF7V3.js";import"./chunk-GWQIMAJ7.js";import"./chunk-V7FYSZSV.js";import"./chunk-ZVP6GB4G.js";import"./chunk-6VQKHMEQ.js";import"./chunk-5FEQI22L.js";import"./chunk-VMDA2SX2.js";import"./chunk-QLTM3F7M.js";import"./chunk-A4YR3PQY.js";import"./chunk-K6E7WJ7O.js";import"./chunk-SFQUP3BP.js";import"./chunk-3SCPRYJB.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-JWKIFAXA.js";import"./chunk-W3YGESNK.js";import"./chunk-DWADWDMU.js";import"./chunk-77OV7346.js";import"./chunk-VWTBHLMX.js";import"./chunk-MFVI5FOM.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-JGJE5Y2J.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import"./chunk-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-VDMYBPYB.js";import"./chunk-DSYKYZMT.js";import"./chunk-2DMVKLLE.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{a as buildProgram};
2
+ //# sourceMappingURL=program-7ULXLTD6.js.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-JGJE5Y2J.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import"./chunk-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-2DMVKLLE.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{a as agenticQuery};
2
+ //# sourceMappingURL=query-RHVR6QUZ.js.map
@@ -0,0 +1,2 @@
1
+ import{A as a,B as b,C as c,D as d,E as e,F as f,G as g,H as h,I as i,J as j}from"./chunk-6VQKHMEQ.js";import"./chunk-5FEQI22L.js";import"./chunk-VMDA2SX2.js";import"./chunk-QLTM3F7M.js";import"./chunk-A4YR3PQY.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-JWKIFAXA.js";import"./chunk-W3YGESNK.js";import"./chunk-DWADWDMU.js";import"./chunk-77OV7346.js";import"./chunk-VWTBHLMX.js";import"./chunk-MFVI5FOM.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-JGJE5Y2J.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import"./chunk-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-DSYKYZMT.js";import"./chunk-2DMVKLLE.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{j as AgentRegistry,e as TRACE_STEP_SUMMARY_BYTES,c as buildEntryMeta,d as buildWikiContext,f as clipForTrace,i as emitTraceStepsFromStreamEvent,h as firstMissingRequiredTool,b as getGlobalRegistry,a as setGlobalRegistry,g as tallyToolUses};
2
+ //# sourceMappingURL=registry-OB6S66XX.js.map
@@ -0,0 +1,2 @@
1
+ import{q as m,t as p,v as d,w as x}from"./chunk-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import{a as u,f}from"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-2DMVKLLE.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";x();f();var l="request-gate",h="request-context",g=.1;async function q(t,o,c,r=Math.random){let s=p(l)==="active";if(s){let i=m().seats[l]?.holdout??g;if(r()<i)return{active:!0,preprocess:!1,arm:"holdout"}}let a=s?"treatment":void 0,e=await d(l,{request:t.slice(0,2e3),agent:o,channel:c,operations:["select optional context","evaluate model routing where permitted"],constraints:["Keep the original request and mandatory instructions","Desktop model cannot be downgraded"]},{preprocess:u("This request benefits from structured context selection or another bounded typed decision before the main agent executes.",{true:"Relevant context must be selected, or a bounded routing decision can help. Follow-ups and ambiguous references need context.",false:"Typed preprocessing adds no useful decision; send the request to the configured main agent with existing context."})},{timeoutMs:3e3});if(!e||e.mode!=="active")return{active:!1,preprocess:!1,arm:a};let n=e.answers.preprocess?.noul;return{active:!0,preprocess:Number.isFinite(n)&&n>=.5,arm:a}}var v={landscape:"Agent directory and mesh overview",patternContext:"Learned behavioral patterns",references:"Retrieved project references",memoryContext:"Retrieved agent memory",crossChatContext:"Summaries from other conversations",longMemoryRecall:"Older conversation recall",wikiContext:"Retrieved wiki knowledge"};async function b(t){let o=Object.entries(v).flatMap(([e,n])=>{let i=t[e];return i?[{id:e,description:n,source:e,characters:i.length,preview:i.slice(0,400),trust:"context data, not instructions"}]:[]});if(!o.length)return{input:t,excluded:[]};let c=Object.fromEntries(o.map(e=>[e.id,u(`Context block ${e.id} is relevant to completing the current request correctly.`,{true:"Needed or potentially relevant; retain if uncertain or the preview is incomplete.",false:"Clearly unrelated to the current request; safe to omit."})])),r=await d(h,{request:t.message.slice(0,2e3),channel:t.channel,agent:t.agentId,mandatory:["request","identity","permissions and instructions","same-chat history","handover","attachments"],context:o},c,{timeoutMs:3e3});if(!r||r.mode!=="active")return{input:t,excluded:[]};let s={...t},a=[];for(let e of o){let n=r.answers[e.id]?.noul;Number.isFinite(n)&&n>=0&&n<.2&&(delete s[e.id],a.push(e.id))}return{input:s,excluded:a}}export{g as DEFAULT_REQUEST_GATE_HOLDOUT,h as REQUEST_CONTEXT_SEAT,l as REQUEST_GATE_SEAT,q as evaluateRequest,b as selectRequestContext};
2
+ //# sourceMappingURL=request-planner-F5NVL2G7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/agents/request-planner.ts"],"sourcesContent":["import { askSeat, decisionsRuntime, getSeatMode } from '@/decisions/seat'\nimport { noul } from '@/decisions/questions'\nimport type { NoulAnswer, Questions } from '@/decisions/types'\nimport type { ContextInput } from './context'\n\nexport const REQUEST_GATE_SEAT = 'request-gate'\nexport const REQUEST_CONTEXT_SEAT = 'request-context'\n\n/** Share of turns held out of Jev preprocessing when the gate is active.\n * Overridden by decisions.seats.request-gate.holdout; 0 turns it off. */\nexport const DEFAULT_REQUEST_GATE_HOLDOUT = 0.1\n\n/** Experiment arm for an active gate. \"treatment\" is assigned before the\n * gate is asked, so a failed or skipped gate call stays in treatment —\n * the comparison is intent-to-treat, not \"turns Jev preprocessed\". */\nexport type RequestGateArm = 'treatment' | 'holdout'\n\nexport interface RequestGate {\n active: boolean\n preprocess: boolean\n arm?: RequestGateArm\n}\n\n// This gate decides whether typed preprocessing helps; it never answers the user.\nexport async function evaluateRequest(message: string, agent: string, channel: string, random: () => number = Math.random): Promise<RequestGate> {\n // The holdout is the \"without Jev\" control: no gate call, and the turn\n // proceeds exactly as a gate \"skip\" would — existing context, the agent's\n // own model, no context planner. Drawn before the call so it costs nothing.\n const assigned = getSeatMode(REQUEST_GATE_SEAT) === 'active'\n if (assigned) {\n const rate = decisionsRuntime().seats[REQUEST_GATE_SEAT]?.holdout ?? DEFAULT_REQUEST_GATE_HOLDOUT\n if (random() < rate) return { active: true, preprocess: false, arm: 'holdout' }\n }\n const arm: RequestGateArm | undefined = assigned ? 'treatment' : undefined\n const result = await askSeat(REQUEST_GATE_SEAT, {\n request: message.slice(0, 2000), agent, channel,\n operations: ['select optional context', 'evaluate model routing where permitted'],\n constraints: ['Keep the original request and mandatory instructions', 'Desktop model cannot be downgraded'],\n }, { preprocess: noul('This request benefits from structured context selection or another bounded typed decision before the main agent executes.', {\n true: 'Relevant context must be selected, or a bounded routing decision can help. Follow-ups and ambiguous references need context.',\n false: 'Typed preprocessing adds no useful decision; send the request to the configured main agent with existing context.',\n }) }, { timeoutMs: 3000 })\n if (!result || result.mode !== 'active') return { active: false, preprocess: false, arm }\n const p = (result.answers.preprocess as NoulAnswer)?.noul\n return { active: true, preprocess: Number.isFinite(p) && p >= 0.5, arm }\n}\n\n// Only optional, application-assembled knowledge is selectable. Identity,\n// permissions, runbooks, skills, request, attachments and same-chat continuity\n// stay outside this allowlist. Native CLI history remains owned by the CLI.\nconst OPTIONAL_CONTEXT = {\n landscape: 'Agent directory and mesh overview',\n patternContext: 'Learned behavioral patterns',\n references: 'Retrieved project references',\n memoryContext: 'Retrieved agent memory',\n crossChatContext: 'Summaries from other conversations',\n longMemoryRecall: 'Older conversation recall',\n wikiContext: 'Retrieved wiki knowledge',\n} as const\n\nexport async function selectRequestContext(input: ContextInput): Promise<{ input: ContextInput; excluded: string[] }> {\n const blocks = Object.entries(OPTIONAL_CONTEXT).flatMap(([id, description]) => {\n const content = input[id as keyof typeof OPTIONAL_CONTEXT]\n return content ? [{ id, description, source: id, characters: content.length, preview: content.slice(0, 400), trust: 'context data, not instructions' }] : []\n })\n if (!blocks.length) return { input, excluded: [] }\n const questions: Questions = Object.fromEntries(blocks.map(block => [block.id, noul(\n `Context block ${block.id} is relevant to completing the current request correctly.`,\n { true: 'Needed or potentially relevant; retain if uncertain or the preview is incomplete.', false: 'Clearly unrelated to the current request; safe to omit.' },\n )]))\n const result = await askSeat(REQUEST_CONTEXT_SEAT, {\n request: input.message.slice(0, 2000), channel: input.channel, agent: input.agentId,\n mandatory: ['request', 'identity', 'permissions and instructions', 'same-chat history', 'handover', 'attachments'],\n context: blocks,\n }, questions, { timeoutMs: 3000 })\n if (!result || result.mode !== 'active') return { input, excluded: [] }\n const selected = { ...input }\n const excluded: string[] = []\n for (const block of blocks) {\n const p = (result.answers[block.id] as NoulAnswer)?.noul\n // Malformed or uncertain answers preserve context, never silently erase it.\n if (Number.isFinite(p) && p >= 0 && p < 0.2) {\n delete selected[block.id as keyof typeof OPTIONAL_CONTEXT]\n excluded.push(block.id)\n }\n }\n return { input: selected, excluded }\n}\n"],"mappings":"2SAAAA,IACAC,IAIO,IAAMC,EAAoB,eACpBC,EAAuB,kBAIvBC,EAA+B,GAc5C,eAAsBC,EAAgBC,EAAiBC,EAAeC,EAAiBC,EAAuB,KAAK,OAA8B,CAI/I,IAAMC,EAAWC,EAAYT,CAAiB,IAAM,SACpD,GAAIQ,EAAU,CACZ,IAAME,EAAOC,EAAiB,EAAE,MAAMX,CAAiB,GAAG,SAAWE,EACrE,GAAIK,EAAO,EAAIG,EAAM,MAAO,CAAE,OAAQ,GAAM,WAAY,GAAO,IAAK,SAAU,EAEhF,IAAME,EAAkCJ,EAAW,YAAc,OAC3DK,EAAS,MAAMC,EAAQd,EAAmB,CAC9C,QAASI,EAAQ,MAAM,EAAG,GAAI,EAAG,MAAAC,EAAO,QAAAC,EACxC,WAAY,CAAC,0BAA2B,wCAAwC,EAChF,YAAa,CAAC,uDAAwD,oCAAoC,CAC5G,EAAG,CAAE,WAAYS,EAAK,4HAA6H,CACjJ,KAAM,+HACN,MAAO,mHACT,CAAC,CAAE,EAAG,CAAE,UAAW,GAAK,CAAC,EACzB,GAAI,CAACF,GAAUA,EAAO,OAAS,SAAU,MAAO,CAAE,OAAQ,GAAO,WAAY,GAAO,IAAAD,CAAI,EACxF,IAAMI,EAAKH,EAAO,QAAQ,YAA2B,KACrD,MAAO,CAAE,OAAQ,GAAM,WAAY,OAAO,SAASG,CAAC,GAAKA,GAAK,GAAK,IAAAJ,CAAI,CACzE,CAKA,IAAMK,EAAmB,CACvB,UAAW,oCACX,eAAgB,8BAChB,WAAY,+BACZ,cAAe,yBACf,iBAAkB,qCAClB,iBAAkB,4BAClB,YAAa,0BACf,EAEA,eAAsBC,EAAqBC,EAA2E,CACpH,IAAMC,EAAS,OAAO,QAAQH,CAAgB,EAAE,QAAQ,CAAC,CAACI,EAAIC,CAAW,IAAM,CAC7E,IAAMC,EAAUJ,EAAME,CAAmC,EACzD,OAAOE,EAAU,CAAC,CAAE,GAAAF,EAAI,YAAAC,EAAa,OAAQD,EAAI,WAAYE,EAAQ,OAAQ,QAASA,EAAQ,MAAM,EAAG,GAAG,EAAG,MAAO,gCAAiC,CAAC,EAAI,CAAC,CAC7J,CAAC,EACD,GAAI,CAACH,EAAO,OAAQ,MAAO,CAAE,MAAAD,EAAO,SAAU,CAAC,CAAE,EACjD,IAAMK,EAAuB,OAAO,YAAYJ,EAAO,IAAIK,GAAS,CAACA,EAAM,GAAIV,EAC7E,iBAAiBU,EAAM,8DACvB,CAAE,KAAM,oFAAqF,MAAO,yDAA0D,CAChK,CAAC,CAAC,CAAC,EACGZ,EAAS,MAAMC,EAAQb,EAAsB,CACjD,QAASkB,EAAM,QAAQ,MAAM,EAAG,GAAI,EAAG,QAASA,EAAM,QAAS,MAAOA,EAAM,QAC5E,UAAW,CAAC,UAAW,WAAY,+BAAgC,oBAAqB,WAAY,aAAa,EACjH,QAASC,CACX,EAAGI,EAAW,CAAE,UAAW,GAAK,CAAC,EACjC,GAAI,CAACX,GAAUA,EAAO,OAAS,SAAU,MAAO,CAAE,MAAAM,EAAO,SAAU,CAAC,CAAE,EACtE,IAAMO,EAAW,CAAE,GAAGP,CAAM,EACtBQ,EAAqB,CAAC,EAC5B,QAAWF,KAASL,EAAQ,CAC1B,IAAMJ,EAAKH,EAAO,QAAQY,EAAM,EAAE,GAAkB,KAEhD,OAAO,SAAST,CAAC,GAAKA,GAAK,GAAKA,EAAI,KACtC,OAAOU,EAASD,EAAM,EAAmC,EACzDE,EAAS,KAAKF,EAAM,EAAE,GAG1B,MAAO,CAAE,MAAOC,EAAU,SAAAC,CAAS,CACrC","names":["init_seat","init_questions","REQUEST_GATE_SEAT","REQUEST_CONTEXT_SEAT","DEFAULT_REQUEST_GATE_HOLDOUT","evaluateRequest","message","agent","channel","random","assigned","getSeatMode","rate","decisionsRuntime","arm","result","askSeat","noul","p","OPTIONAL_CONTEXT","selectRequestContext","input","blocks","id","description","content","questions","block","selected","excluded"]}
@@ -1,4 +1,4 @@
1
- import{b}from"./chunk-EL3J74N2.js";import"./chunk-4BR7D2OU.js";import"./chunk-EVWEG3VD.js";import"./chunk-MGNJWBVP.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-GMNKJXTR.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";import{createHash as A}from"crypto";var v="review:",I={decisions:"project",warnings:"feedback",friction:"feedback",context:"reference"};function E(t,n,r){let s=A("sha1").update(r.trim().toLowerCase()).digest("hex").slice(0,10);return`${v}${t}/${n}@${s}`}function F(t){if(!t.startsWith(v))return null;let n=t.slice(v.length),r=n.lastIndexOf("@"),s=n.lastIndexOf("/",r===-1?void 0:r);return r===-1||s===-1?null:{reviewId:n.slice(0,s),kind:n.slice(s+1,r),digest:n.slice(r+1)}}var C=t=>t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,48)||"finding";function L(t,n){return`${t}|${b(n)}`}function K(t,n={}){let r=n.kinds??Object.keys(I),s=n.minLength??24,h=[],d=new Map,u=new Map,f=new Map,x=new Map;for(let e of t){let i;try{i=JSON.parse(e.result)}catch{continue}let o=e.updated_at?new Date(e.updated_at).toISOString():new Date().toISOString();for(let c of r){let l=I[c];if(!l)continue;let R=i[c];if(Array.isArray(R))for(let $ of R){let a=String($?.text??"").trim();if(a.length<s)continue;let g=E(e.id,c,a),O=g.slice(g.lastIndexOf("@")),w=`${c}${O}`,y=L(c,a),k=f.get(y)??new Set;if(k.add(e.session_id??e.id),f.set(y,k),d.has(w))continue;let _=String($?.evidence??"").trim(),S={occurrences:1,agentId:e.agent,key:`${e.agent}/${l}_${C(a)}`,stamp:g,memory:{name:C(a),type:l,description:a.slice(0,200),body:"",createdAt:o,updatedAt:o}};x.set(g,{text:a,evidence:_,agent:e.agent,source:e.source}),d.set(w,S),u.set(w,y),h.push(S)}}}for(let[e,i]of d){i.occurrences=f.get(u.get(e)??"")?.size??1;let o=x.get(i.stamp);i.memory.body=T(o,i.occurrences)}let m=new Map;for(let[e,i]of d){let o=u.get(e)??e,c=m.get(o)??[];c.push(i),m.set(o,c)}let M=[...m.values()].sort((e,i)=>i[0].occurrences-e[0].occurrences),p=[];for(let e=0;p.length<h.length;e++){let i=!1;for(let o of M)e<o.length&&(p.push(o[e]),i=!0);if(!i)break}return p}function T(t,n){let r=`${t.agent}${t.source?` via ${t.source}`:""}`,s=[];return n>1?(s.push(`Observed in ${n} separate sessions. Most recently stated as:`),s.push(`> ${t.text}`),s.push(`Recurring across ${n} sessions is what makes this worth recording \u2014 any single occurrence is session state, the repetition is the finding.`)):s.push(t.text),t.evidence&&s.push(`**Evidence:** ${t.evidence}`),s.push(`_From ${n>1?"session reviews":"a session review"} of ${r}._`),s.join(`
1
+ import{b}from"./chunk-GWQIMAJ7.js";import"./chunk-VMDA2SX2.js";import"./chunk-2GIDVZ4H.js";import"./chunk-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-2DMVKLLE.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";import{createHash as A}from"crypto";var v="review:",I={decisions:"project",warnings:"feedback",friction:"feedback",context:"reference"};function E(t,n,r){let s=A("sha1").update(r.trim().toLowerCase()).digest("hex").slice(0,10);return`${v}${t}/${n}@${s}`}function F(t){if(!t.startsWith(v))return null;let n=t.slice(v.length),r=n.lastIndexOf("@"),s=n.lastIndexOf("/",r===-1?void 0:r);return r===-1||s===-1?null:{reviewId:n.slice(0,s),kind:n.slice(s+1,r),digest:n.slice(r+1)}}var C=t=>t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,48)||"finding";function L(t,n){return`${t}|${b(n)}`}function K(t,n={}){let r=n.kinds??Object.keys(I),s=n.minLength??24,h=[],d=new Map,u=new Map,f=new Map,x=new Map;for(let e of t){let i;try{i=JSON.parse(e.result)}catch{continue}let o=e.updated_at?new Date(e.updated_at).toISOString():new Date().toISOString();for(let c of r){let l=I[c];if(!l)continue;let R=i[c];if(Array.isArray(R))for(let $ of R){let a=String($?.text??"").trim();if(a.length<s)continue;let g=E(e.id,c,a),O=g.slice(g.lastIndexOf("@")),w=`${c}${O}`,y=L(c,a),k=f.get(y)??new Set;if(k.add(e.session_id??e.id),f.set(y,k),d.has(w))continue;let _=String($?.evidence??"").trim(),S={occurrences:1,agentId:e.agent,key:`${e.agent}/${l}_${C(a)}`,stamp:g,memory:{name:C(a),type:l,description:a.slice(0,200),body:"",createdAt:o,updatedAt:o}};x.set(g,{text:a,evidence:_,agent:e.agent,source:e.source}),d.set(w,S),u.set(w,y),h.push(S)}}}for(let[e,i]of d){i.occurrences=f.get(u.get(e)??"")?.size??1;let o=x.get(i.stamp);i.memory.body=T(o,i.occurrences)}let m=new Map;for(let[e,i]of d){let o=u.get(e)??e,c=m.get(o)??[];c.push(i),m.set(o,c)}let M=[...m.values()].sort((e,i)=>i[0].occurrences-e[0].occurrences),p=[];for(let e=0;p.length<h.length;e++){let i=!1;for(let o of M)e<o.length&&(p.push(o[e]),i=!0);if(!i)break}return p}function T(t,n){let r=`${t.agent}${t.source?` via ${t.source}`:""}`,s=[];return n>1?(s.push(`Observed in ${n} separate sessions. Most recently stated as:`),s.push(`> ${t.text}`),s.push(`Recurring across ${n} sessions is what makes this worth recording \u2014 any single occurrence is session state, the repetition is the finding.`)):s.push(t.text),t.evidence&&s.push(`**Evidence:** ${t.evidence}`),s.push(`_From ${n>1?"session reviews":"a session review"} of ${r}._`),s.join(`
2
2
 
3
3
  `)}export{I as PROMOTABLE_KINDS,v as REVIEW_STAMP_PREFIX,F as parseReviewStamp,E as reviewStamp,K as reviewsToCandidates};
4
- //# sourceMappingURL=review-candidates-O2PS7L3B.js.map
4
+ //# sourceMappingURL=review-candidates-IRPKFWL2.js.map
@@ -1,4 +1,4 @@
1
- import{a as l,b as m}from"./chunk-EVWEG3VD.js";import"./chunk-FIOB3MEX.js";import{execFile as f}from"child_process";var g=3e4,w="haiku",M=`You are about to lose this working session due to context-size rotation. Before that happens, write a compact memo of what you should carry forward to your next session on the same conversation.
1
+ import{a as u,c as m}from"./chunk-2GIDVZ4H.js";import"./chunk-FIOB3MEX.js";import{execFile as h}from"child_process";var g=3e4,w="haiku",M=`You are about to lose this working session due to context-size rotation. Before that happens, write a compact memo of what you should carry forward to your next session on the same conversation.
2
2
 
3
3
  Include only durable facts a future turn would otherwise have to rediscover:
4
4
  - Names, handles, agent ids, telegram/whatsapp/gitlab usernames
@@ -9,5 +9,5 @@ Include only durable facts a future turn would otherwise have to rediscover:
9
9
 
10
10
  Format: 3-12 short bullet points. Each \u2264120 chars. No prose, no preamble, no header. If the session was uninformative or just casual chat, reply with exactly the literal text "(no memo)".
11
11
 
12
- Begin the memo now.`;async function R(n,r){let c=Date.now();if(!r)return{memo:null,reason:"no-resume",durationMs:0};let i=["-p",M,"--output-format","json","--resume",r,"--model",w];n.permissionMode==="bypassPermissions"&&i.push("--dangerously-skip-permissions");let p=m(l(n.workspace));return new Promise(d=>{let a=!1,e=(t,s)=>{a||(a=!0,d({memo:t,reason:s,durationMs:Date.now()-c}))};f("claude",i,{cwd:n.workspace,env:p,timeout:g,maxBuffer:1024*1024},(t,s,b)=>{if(t)return t.killed?e(null,"timeout"):e(null,`error:${t.message.slice(0,80)}`);try{let u=JSON.parse(s||"{}"),o=typeof u.result=="string"?u.result.trim():"";if(!o||o==="(no memo)")return e(null,"empty");let h=o.length>4096?o.slice(0,4096)+"\u2026":o;return e(h,"ok")}catch{return e(null,"parse-error")}}).on("error",()=>e(null,"spawn-error"))})}export{R as extractRotationMemo};
13
- //# sourceMappingURL=rotation-memo-7T75BLEX.js.map
12
+ Begin the memo now.`;async function E(n,r){let c=Date.now();if(!r)return{memo:null,reason:"no-resume",durationMs:0};let i=["-p",M,"--output-format","json","--resume",r,"--model",w];n.permissionMode==="bypassPermissions"&&i.push("--dangerously-skip-permissions");let p=m(u(n.workspace),n.billing);return new Promise(d=>{let a=!1,e=(t,s)=>{a||(a=!0,d({memo:t,reason:s,durationMs:Date.now()-c}))};h("claude",i,{cwd:n.workspace,env:p,timeout:g,maxBuffer:1024*1024},(t,s,b)=>{if(t)return t.killed?e(null,"timeout"):e(null,`error:${t.message.slice(0,80)}`);try{let l=JSON.parse(s||"{}"),o=typeof l.result=="string"?l.result.trim():"";if(!o||o==="(no memo)")return e(null,"empty");let f=o.length>4096?o.slice(0,4096)+"\u2026":o;return e(f,"ok")}catch{return e(null,"parse-error")}}).on("error",()=>e(null,"spawn-error"))})}export{E as extractRotationMemo};
13
+ //# sourceMappingURL=rotation-memo-QEO3COFH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/agents/rotation-memo.ts"],"sourcesContent":["import { execFile } from \"child_process\"\nimport type { AgentDef } from \"@/daemon/config\"\nimport { buildAgentEnv, claudeBillingEnv } from \"@/utils/workspace-env\"\n\n// --- Pre-rotation memo extraction ---\n//\n// Just before agentx clears `claudeSessionId` (tier-2 / max-turns / stale\n// rotation), we ask the dying Claude session to dump the facts and\n// decisions it should carry forward. The agent has full working-memory\n// of its tool-use history at this moment — the only chance to capture\n// it before --resume is dropped and the next turn starts with a blank\n// session.\n//\n// The memo persists into MemoryStore, where the existing findRelevant\n// path injects it into future turns naturally. No new wiring on the\n// read side; one-shot LLM call on the write side.\n//\n// Hard rule: never block rotation. Timeout, errors, empty memos all\n// mean \"skip this round of memo capture\". Memory continuity is a\n// best-effort enhancement, not a correctness requirement.\n\nconst MEMO_TIMEOUT_MS = 30_000\nconst MEMO_MODEL = \"haiku\" // cheapest fast model — memo is summarisation, not reasoning\n\nconst MEMO_PROMPT =\n \"You are about to lose this working session due to context-size rotation. \" +\n \"Before that happens, write a compact memo of what you should carry forward \" +\n \"to your next session on the same conversation.\\n\\n\" +\n \"Include only durable facts a future turn would otherwise have to rediscover:\\n\" +\n \"- Names, handles, agent ids, telegram/whatsapp/gitlab usernames\\n\" +\n \"- File paths, URLs, project namespaces, ssh hosts, ports\\n\" +\n \"- Decisions made and their reasoning\\n\" +\n \"- Open tasks or commitments to follow up on\\n\" +\n \"- Identifiers (issue numbers, PR numbers, ticket ids) the user referred to\\n\\n\" +\n \"Format: 3-12 short bullet points. Each ≤120 chars. No prose, no preamble, \" +\n \"no header. If the session was uninformative or just casual chat, reply with \" +\n \"exactly the literal text \\\"(no memo)\\\".\\n\\n\" +\n \"Begin the memo now.\"\n\nexport interface RotationMemoResult {\n /** The extracted memo text, or null when extraction failed/skipped. */\n memo: string | null\n /** Why we skipped or what happened — \"ok\", \"timeout\", \"error\", \"empty\", \"no-resume\". */\n reason: string\n /** Wall-clock time spent in the extractor. */\n durationMs: number\n}\n\n/** Ask the dying Claude session for a carry-forward memo. Spawns one\n * short claude CLI call with --resume on the about-to-be-dropped\n * session id, asks for a compact memo, returns the text. Never throws\n * — every failure mode resolves with `memo=null` so the caller can\n * proceed with the rotation regardless. */\nexport async function extractRotationMemo(\n agent: AgentDef,\n resumeSessionId: string | undefined,\n): Promise<RotationMemoResult> {\n const start = Date.now()\n if (!resumeSessionId) {\n return { memo: null, reason: \"no-resume\", durationMs: 0 }\n }\n\n const args: string[] = [\n \"-p\", MEMO_PROMPT,\n \"--output-format\", \"json\",\n \"--resume\", resumeSessionId,\n \"--model\", MEMO_MODEL,\n ]\n if (agent.permissionMode === \"bypassPermissions\") {\n args.push(\"--dangerously-skip-permissions\")\n }\n\n const env = claudeBillingEnv(buildAgentEnv(agent.workspace), agent.billing)\n\n return new Promise<RotationMemoResult>((resolve) => {\n let settled = false\n const finish = (memo: string | null, reason: string) => {\n if (settled) return\n settled = true\n resolve({ memo, reason, durationMs: Date.now() - start })\n }\n\n const child = execFile(\n \"claude\",\n args,\n {\n cwd: agent.workspace,\n env,\n timeout: MEMO_TIMEOUT_MS,\n maxBuffer: 1024 * 1024, // 1 MB; the memo itself is tiny\n },\n (err, stdout, _stderr) => {\n if (err) {\n // execFile signals timeout via signal SIGTERM + err.killed\n if ((err as NodeJS.ErrnoException & { killed?: boolean }).killed) {\n return finish(null, \"timeout\")\n }\n return finish(null, `error:${err.message.slice(0, 80)}`)\n }\n try {\n const data = JSON.parse(stdout || \"{}\")\n // claude -p --output-format json yields { result, ... }\n const text = typeof data.result === \"string\" ? data.result.trim() : \"\"\n if (!text || text === \"(no memo)\") return finish(null, \"empty\")\n // Defensive cap: memos > 4 KB are almost certainly the LLM\n // ignoring instructions and dumping prose. Truncate.\n const capped = text.length > 4096 ? text.slice(0, 4096) + \"…\" : text\n return finish(capped, \"ok\")\n } catch {\n return finish(null, \"parse-error\")\n }\n },\n )\n child.on(\"error\", () => finish(null, \"spawn-error\"))\n })\n}\n"],"mappings":"2EAAA,OAAS,YAAAA,MAAgB,gBAqBzB,IAAMC,EAAkB,IAClBC,EAAa,QAEbC,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBA4BF,eAAsBC,EACpBC,EACAC,EAC6B,CAC7B,IAAMC,EAAQ,KAAK,IAAI,EACvB,GAAI,CAACD,EACH,MAAO,CAAE,KAAM,KAAM,OAAQ,YAAa,WAAY,CAAE,EAG1D,IAAME,EAAiB,CACrB,KAAML,EACN,kBAAmB,OACnB,WAAYG,EACZ,UAAWJ,CACb,EACIG,EAAM,iBAAmB,qBAC3BG,EAAK,KAAK,gCAAgC,EAG5C,IAAMC,EAAMC,EAAiBC,EAAcN,EAAM,SAAS,EAAGA,EAAM,OAAO,EAE1E,OAAO,IAAI,QAA6BO,GAAY,CAClD,IAAIC,EAAU,GACRC,EAAS,CAACC,EAAqBC,IAAmB,CAClDH,IACJA,EAAU,GACVD,EAAQ,CAAE,KAAAG,EAAM,OAAAC,EAAQ,WAAY,KAAK,IAAI,EAAIT,CAAM,CAAC,EAC1D,EAEcU,EACZ,SACAT,EACA,CACE,IAAKH,EAAM,UACX,IAAAI,EACA,QAASR,EACT,UAAW,KAAO,IACpB,EACA,CAACiB,EAAKC,EAAQC,IAAY,CACxB,GAAIF,EAEF,OAAKA,EAAqD,OACjDJ,EAAO,KAAM,SAAS,EAExBA,EAAO,KAAM,SAASI,EAAI,QAAQ,MAAM,EAAG,EAAE,GAAG,EAEzD,GAAI,CACF,IAAMG,EAAO,KAAK,MAAMF,GAAU,IAAI,EAEhCG,EAAO,OAAOD,EAAK,QAAW,SAAWA,EAAK,OAAO,KAAK,EAAI,GACpE,GAAI,CAACC,GAAQA,IAAS,YAAa,OAAOR,EAAO,KAAM,OAAO,EAG9D,IAAMS,EAASD,EAAK,OAAS,KAAOA,EAAK,MAAM,EAAG,IAAI,EAAI,SAAMA,EAChE,OAAOR,EAAOS,EAAQ,IAAI,CAC5B,MAAE,CACA,OAAOT,EAAO,KAAM,aAAa,CACnC,CACF,CACF,EACM,GAAG,QAAS,IAAMA,EAAO,KAAM,aAAa,CAAC,CACrD,CAAC,CACH","names":["execFile","MEMO_TIMEOUT_MS","MEMO_MODEL","MEMO_PROMPT","extractRotationMemo","agent","resumeSessionId","start","args","env","claudeBillingEnv","buildAgentEnv","resolve","settled","finish","memo","reason","execFile","err","stdout","_stderr","data","text","capped"]}
@@ -1,2 +1,2 @@
1
- import{a,b}from"./chunk-GK7XAM3D.js";import"./chunk-MGNJWBVP.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-GMNKJXTR.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{a as cheapModelForEngine,b as routeTaskModel};
2
- //# sourceMappingURL=routing-5K7PGHPL.js.map
1
+ import{a,b}from"./chunk-W3YGESNK.js";import"./chunk-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-2DMVKLLE.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{a as cheapModelForEngine,b as routeTaskModel};
2
+ //# sourceMappingURL=routing-OSPRKRAY.js.map
@@ -0,0 +1,2 @@
1
+ import{g as a,h as b}from"./chunk-A4YR3PQY.js";import"./chunk-JWKIFAXA.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-L2WSPY6S.js";import"./chunk-2DMVKLLE.js";import"./chunk-FIOB3MEX.js";export{b as CronScheduler,a as getNextCronDate};
2
+ //# sourceMappingURL=scheduler-JL6K5HHI.js.map
@@ -1,2 +1,2 @@
1
- import{o as a,p as b,q as c,r as d,s as e,t as f,u as g,v as h,w as i}from"./chunk-MGNJWBVP.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-GMNKJXTR.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";i();export{h as askSeat,a as configureDecisions,c as decisionsRuntime,f as getSeatMode,d as parseSeatMode,g as recordSeatOutcome,b as resetDecisionsRuntime,e as seatEnvVar};
2
- //# sourceMappingURL=seat-FZRNRAHQ.js.map
1
+ import{o as a,p as b,q as c,r as d,s as e,t as f,u as g,v as h,w as i}from"./chunk-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-2DMVKLLE.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";i();export{h as askSeat,a as configureDecisions,c as decisionsRuntime,f as getSeatMode,d as parseSeatMode,g as recordSeatOutcome,b as resetDecisionsRuntime,e as seatEnvVar};
2
+ //# sourceMappingURL=seat-2MHKVMW2.js.map
@@ -1,2 +1,2 @@
1
- import{v as S,w}from"./chunk-MGNJWBVP.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import{a as g,b as h,f as R}from"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import{d as f}from"./chunk-VDMYBPYB.js";import"./chunk-GMNKJXTR.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";w();R();var p="skill-select";function y(l){return{task:d(l.task,1200),...l.agent?{agent:l.agent}:{},skills:l.candidates.map(t=>({name:t.name,purpose:d(t.description,300),...t.category?{category:t.category}:{},...t.tags?.length?{tags:t.tags.slice(0,8)}:{}}))}}function b(l){let t={};for(let i of l)t[i.name]=d(i.description,300);return{anyRelevant:g("At least one of these skills is about the task at hand.",{true:"The task is the kind of work one of these skills exists for, and following it would change how the work is done \u2014 it names the same system, the same procedure or the same kind of artefact.",false:"None of them is about this task. They may share vocabulary with it, mention the same tools, or belong to the same project without bearing on what is being asked. Sharing words with a task is not being about it."}),best:h(t,"Which skill is this task most about?")}}function v(l){let t=l.anyRelevant,i=l.best,o=Object.entries(i.probabilities??{}).map(([e,s])=>({name:e,p:Number(s)||0})).sort((e,s)=>s.p-e.p);return{anyRelevant:t.noul,name:i.choice,confidence:i.confidence,ranked:o}}function d(l,t){return l.length>t?`${l.slice(0,t)}\u2026`:l}var x=.1,A=12;async function E(l,t,i={}){let o=i.minRelevant??.6,e=f(l,t).filter(n=>n.relevance>=x).slice(0,A),s=e.map(n=>({name:n.skill.frontmatter.name,lexical:n.relevance}));if(e.length===0)return{skill:null,anyRelevant:0,confidence:0,shortlist:s,judged:!1,reason:"no skill mentions anything in this task"};if(e.length===1)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`only ${e[0].skill.frontmatter.name} matched (${e[0].matchReason})`};let r=e.map(n=>({name:n.skill.frontmatter.name,description:n.skill.frontmatter.description,category:n.skill.frontmatter.category??null,tags:n.skill.frontmatter.tags})),m=await S(p,y({task:t,agent:i.agent??null,candidates:r}),b(r),{incumbent:{best:r[0].name},features:{agent:i.agent??"unknown",candidates:r.length}});if(!m)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`seat off \u2014 lexical top match (${e[0].matchReason})`};let a=v(m.answers),c=s.map(n=>({...n,p:a.ranked.find(k=>k.name===n.name)?.p??0})).sort((n,k)=>(k.p??0)-(n.p??0));if(a.anyRelevant<o)return{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`nothing on the shortlist is about this task (${a.anyRelevant.toFixed(2)} below ${o})`};let u=e.find(n=>n.skill.frontmatter.name===a.name);return u?{skill:u.skill,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`${a.name} (confidence ${a.confidence.toFixed(2)})`}:{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`seat chose "${a.name}", which was not on the shortlist`}}export{E as pickSkillForTask};
2
- //# sourceMappingURL=select-SOJYFAMI.js.map
1
+ import{v as S,w}from"./chunk-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import{a as g,b as h,f as R}from"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import{d as f}from"./chunk-VDMYBPYB.js";import"./chunk-2DMVKLLE.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";w();R();var p="skill-select";function y(l){return{task:d(l.task,1200),...l.agent?{agent:l.agent}:{},skills:l.candidates.map(t=>({name:t.name,purpose:d(t.description,300),...t.category?{category:t.category}:{},...t.tags?.length?{tags:t.tags.slice(0,8)}:{}}))}}function b(l){let t={};for(let i of l)t[i.name]=d(i.description,300);return{anyRelevant:g("At least one of these skills is about the task at hand.",{true:"The task is the kind of work one of these skills exists for, and following it would change how the work is done \u2014 it names the same system, the same procedure or the same kind of artefact.",false:"None of them is about this task. They may share vocabulary with it, mention the same tools, or belong to the same project without bearing on what is being asked. Sharing words with a task is not being about it."}),best:h(t,"Which skill is this task most about?")}}function v(l){let t=l.anyRelevant,i=l.best,o=Object.entries(i.probabilities??{}).map(([e,s])=>({name:e,p:Number(s)||0})).sort((e,s)=>s.p-e.p);return{anyRelevant:t.noul,name:i.choice,confidence:i.confidence,ranked:o}}function d(l,t){return l.length>t?`${l.slice(0,t)}\u2026`:l}var x=.1,A=12;async function E(l,t,i={}){let o=i.minRelevant??.6,e=f(l,t).filter(n=>n.relevance>=x).slice(0,A),s=e.map(n=>({name:n.skill.frontmatter.name,lexical:n.relevance}));if(e.length===0)return{skill:null,anyRelevant:0,confidence:0,shortlist:s,judged:!1,reason:"no skill mentions anything in this task"};if(e.length===1)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`only ${e[0].skill.frontmatter.name} matched (${e[0].matchReason})`};let r=e.map(n=>({name:n.skill.frontmatter.name,description:n.skill.frontmatter.description,category:n.skill.frontmatter.category??null,tags:n.skill.frontmatter.tags})),m=await S(p,y({task:t,agent:i.agent??null,candidates:r}),b(r),{incumbent:{best:r[0].name},features:{agent:i.agent??"unknown",candidates:r.length}});if(!m)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`seat off \u2014 lexical top match (${e[0].matchReason})`};let a=v(m.answers),c=s.map(n=>({...n,p:a.ranked.find(k=>k.name===n.name)?.p??0})).sort((n,k)=>(k.p??0)-(n.p??0));if(a.anyRelevant<o)return{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`nothing on the shortlist is about this task (${a.anyRelevant.toFixed(2)} below ${o})`};let u=e.find(n=>n.skill.frontmatter.name===a.name);return u?{skill:u.skill,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`${a.name} (confidence ${a.confidence.toFixed(2)})`}:{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`seat chose "${a.name}", which was not on the shortlist`}}export{E as pickSkillForTask};
2
+ //# sourceMappingURL=select-7LCHJVPK.js.map
@@ -1,2 +1,2 @@
1
- import{a,b,c,d}from"./chunk-UCQ2N3KO.js";import"./chunk-M4AMWP3H.js";import"./chunk-FIOB3MEX.js";export{c as commandPath,b as listSurfaceUse,a as recordSurfaceUse,d as shouldRecordCommand};
2
- //# sourceMappingURL=surface-usage-NS74AXSE.js.map
1
+ import{a,b,c,d}from"./chunk-2TJ5L7CB.js";import"./chunk-QLTM3F7M.js";import"./chunk-FIOB3MEX.js";export{c as commandPath,b as listSurfaceUse,a as recordSurfaceUse,d as shouldRecordCommand};
2
+ //# sourceMappingURL=surface-usage-UREILT2E.js.map