agentix-cli 0.69.2 → 0.69.4

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 (145) hide show
  1. package/dist/{App-MMWB4O72.js → App-Z66ABY7H.js} +2 -2
  2. package/dist/{ChatApp-VCHZLQ57.js → ChatApp-Z2LZ7IM3.js} +2 -2
  3. package/dist/agent-IDAWXA3K.js +2 -0
  4. package/dist/{board-dashboard-3WVKEGRZ.js → board-dashboard-MAP6A2N7.js} +4 -4
  5. package/dist/{chunk-NO2HOK4B.js → chunk-23A5K5UW.js} +3 -3
  6. package/dist/chunk-23A5K5UW.js.map +1 -0
  7. package/dist/{chunk-VXDM7JAT.js → chunk-2UYV24UD.js} +2 -2
  8. package/dist/{chunk-M6HJDSLS.js → chunk-535MLOSB.js} +15 -15
  9. package/dist/chunk-535MLOSB.js.map +1 -0
  10. package/dist/{chunk-SZJMS7K4.js → chunk-5MUJZODV.js} +19 -19
  11. package/dist/chunk-5MUJZODV.js.map +1 -0
  12. package/dist/{chunk-U3XQ7USK.js → chunk-5ONI54E6.js} +139 -139
  13. package/dist/chunk-5ONI54E6.js.map +1 -0
  14. package/dist/{chunk-VOS2IW4V.js → chunk-BBIWAJRX.js} +2 -2
  15. package/dist/{chunk-Y57CULGE.js → chunk-C245D4BZ.js} +2 -2
  16. package/dist/{chunk-JSF2THM4.js → chunk-CKBAVCGU.js} +2 -2
  17. package/dist/{chunk-2V7IQUEA.js → chunk-DQQ3BCJW.js} +2 -2
  18. package/dist/{chunk-N5NPJ6DJ.js → chunk-DTX4I5LQ.js} +4 -4
  19. package/dist/chunk-DTX4I5LQ.js.map +1 -0
  20. package/dist/chunk-EKJG63EJ.js +3 -0
  21. package/dist/chunk-EKJG63EJ.js.map +1 -0
  22. package/dist/{chunk-XMW422NO.js → chunk-FSYA4GNU.js} +2 -2
  23. package/dist/{chunk-YBLITM6C.js → chunk-FUR3T3IN.js} +2 -2
  24. package/dist/{chunk-4UMYRIEI.js → chunk-IU6L4V3A.js} +14 -14
  25. package/dist/chunk-IU6L4V3A.js.map +1 -0
  26. package/dist/{chunk-AIV547JW.js → chunk-J7HA7ZTU.js} +6 -6
  27. package/dist/chunk-J7HA7ZTU.js.map +1 -0
  28. package/dist/chunk-JHCI6XCJ.js +5 -0
  29. package/dist/chunk-JHCI6XCJ.js.map +1 -0
  30. package/dist/chunk-K63IOY6A.js +152 -0
  31. package/dist/chunk-K63IOY6A.js.map +1 -0
  32. package/dist/{chunk-APKKQGTG.js → chunk-KLHG5ZQH.js} +2 -2
  33. package/dist/{chunk-56AQBWEJ.js → chunk-M6GPRMCQ.js} +2 -2
  34. package/dist/{chunk-X4FD5OBK.js → chunk-OHRTBD7U.js} +15 -15
  35. package/dist/{chunk-A5ZCMRB3.js → chunk-OPUPVGYP.js} +2 -2
  36. package/dist/{chunk-G3SOCQII.js → chunk-OVX6NRMD.js} +2 -2
  37. package/dist/{chunk-Q2WW2HF4.js → chunk-P2RYUODK.js} +2 -2
  38. package/dist/chunk-P2RYUODK.js.map +1 -0
  39. package/dist/{chunk-KSDVKLHN.js → chunk-V2TLFYKH.js} +2 -2
  40. package/dist/{chunk-F2DEKA2Q.js → chunk-YBF2QVZ7.js} +2 -2
  41. package/dist/{chunk-APKAW7LU.js → chunk-YL223TEU.js} +2 -2
  42. package/dist/cli.js +1 -1
  43. package/dist/client-GDTX6LFH.js +2 -0
  44. package/dist/{compaction-H5U32UU6.js → compaction-MECSN36J.js} +4 -4
  45. package/dist/compaction-MECSN36J.js.map +1 -0
  46. package/dist/{config-VV4X7PEK.js → config-FZ4D4EAV.js} +2 -2
  47. package/dist/config-mutator-ETG5V4C5.js +2 -0
  48. package/dist/{context-planner-LJT5IKH6.js → context-planner-JU7CNXCB.js} +3 -3
  49. package/dist/context-planner-JU7CNXCB.js.map +1 -0
  50. package/dist/doctor-JBIRBRLB.js +2 -0
  51. package/dist/heal-CMQL5SG4.js +2 -0
  52. package/dist/index.d.ts +71 -3
  53. package/dist/index.js +2 -2
  54. package/dist/loader-YFVSSYSL.js +2 -0
  55. package/dist/memory-extract-YCNCARZ2.js +2 -0
  56. package/dist/program-T275Y2V6.js +2 -0
  57. package/dist/{promote-7FMPZKXN.js → promote-VZAUTV6E.js} +2 -2
  58. package/dist/{providers-NRPX2FHP.js → providers-ES5KVLI4.js} +2 -2
  59. package/dist/query-7QQZPMXM.js +2 -0
  60. package/dist/registry-WQ65MQEY.js +2 -0
  61. package/dist/{request-planner-73Y5GI3D.js → request-planner-NMOAOZIM.js} +2 -2
  62. package/dist/{review-candidates-VF5IWP5P.js → review-candidates-FLY6HZEN.js} +2 -2
  63. package/dist/routing-SMIZ77CT.js +2 -0
  64. package/dist/schedule-tool-NJFROYKY.js +2 -0
  65. package/dist/scheduler-5N4FC2FQ.js +2 -0
  66. package/dist/{seat-XNA2O6EO.js → seat-F3S2HG5G.js} +2 -2
  67. package/dist/{select-WOUZIR3Y.js → select-5GC7CTPQ.js} +2 -2
  68. package/dist/{set-enabled-C5RFPCAL.js → set-enabled-53ZPZ5GR.js} +2 -2
  69. package/dist/shutdown-SNI2B4LI.js +2 -0
  70. package/dist/{tool-ZUGNQZGI.js → tool-FRTZS4TT.js} +2 -2
  71. package/dist/wiki-J4MMCONT.js +2 -0
  72. package/package.json +1 -1
  73. package/dist/agent-P2UO35ZW.js +0 -2
  74. package/dist/chunk-4UMYRIEI.js.map +0 -1
  75. package/dist/chunk-AIV547JW.js.map +0 -1
  76. package/dist/chunk-L2K4N3DA.js +0 -152
  77. package/dist/chunk-L2K4N3DA.js.map +0 -1
  78. package/dist/chunk-L53FTKEP.js +0 -3
  79. package/dist/chunk-L53FTKEP.js.map +0 -1
  80. package/dist/chunk-M6HJDSLS.js.map +0 -1
  81. package/dist/chunk-N5NPJ6DJ.js.map +0 -1
  82. package/dist/chunk-NO2HOK4B.js.map +0 -1
  83. package/dist/chunk-Q2WW2HF4.js.map +0 -1
  84. package/dist/chunk-SZJMS7K4.js.map +0 -1
  85. package/dist/chunk-U3XQ7USK.js.map +0 -1
  86. package/dist/chunk-VDMYBPYB.js +0 -5
  87. package/dist/chunk-VDMYBPYB.js.map +0 -1
  88. package/dist/client-SWODYWKD.js +0 -2
  89. package/dist/compaction-H5U32UU6.js.map +0 -1
  90. package/dist/config-mutator-BOE7SMT5.js +0 -2
  91. package/dist/context-planner-LJT5IKH6.js.map +0 -1
  92. package/dist/doctor-XIS4TMBI.js +0 -2
  93. package/dist/heal-HVYQD3EZ.js +0 -2
  94. package/dist/loader-EVHZ2R73.js +0 -2
  95. package/dist/memory-extract-F76BE6KA.js +0 -2
  96. package/dist/program-GUBHJFZS.js +0 -2
  97. package/dist/query-6272PJPD.js +0 -2
  98. package/dist/registry-MUMQPZDM.js +0 -2
  99. package/dist/routing-T24BMMLM.js +0 -2
  100. package/dist/schedule-tool-BY72YNNU.js +0 -2
  101. package/dist/scheduler-XWYFGG2S.js +0 -2
  102. package/dist/shutdown-ZAF7RW25.js +0 -2
  103. package/dist/wiki-LLL7VWRJ.js +0 -2
  104. /package/dist/{App-MMWB4O72.js.map → App-Z66ABY7H.js.map} +0 -0
  105. /package/dist/{ChatApp-VCHZLQ57.js.map → ChatApp-Z2LZ7IM3.js.map} +0 -0
  106. /package/dist/{agent-P2UO35ZW.js.map → agent-IDAWXA3K.js.map} +0 -0
  107. /package/dist/{board-dashboard-3WVKEGRZ.js.map → board-dashboard-MAP6A2N7.js.map} +0 -0
  108. /package/dist/{chunk-VXDM7JAT.js.map → chunk-2UYV24UD.js.map} +0 -0
  109. /package/dist/{chunk-VOS2IW4V.js.map → chunk-BBIWAJRX.js.map} +0 -0
  110. /package/dist/{chunk-Y57CULGE.js.map → chunk-C245D4BZ.js.map} +0 -0
  111. /package/dist/{chunk-JSF2THM4.js.map → chunk-CKBAVCGU.js.map} +0 -0
  112. /package/dist/{chunk-2V7IQUEA.js.map → chunk-DQQ3BCJW.js.map} +0 -0
  113. /package/dist/{chunk-XMW422NO.js.map → chunk-FSYA4GNU.js.map} +0 -0
  114. /package/dist/{chunk-YBLITM6C.js.map → chunk-FUR3T3IN.js.map} +0 -0
  115. /package/dist/{chunk-APKKQGTG.js.map → chunk-KLHG5ZQH.js.map} +0 -0
  116. /package/dist/{chunk-56AQBWEJ.js.map → chunk-M6GPRMCQ.js.map} +0 -0
  117. /package/dist/{chunk-X4FD5OBK.js.map → chunk-OHRTBD7U.js.map} +0 -0
  118. /package/dist/{chunk-A5ZCMRB3.js.map → chunk-OPUPVGYP.js.map} +0 -0
  119. /package/dist/{chunk-G3SOCQII.js.map → chunk-OVX6NRMD.js.map} +0 -0
  120. /package/dist/{chunk-KSDVKLHN.js.map → chunk-V2TLFYKH.js.map} +0 -0
  121. /package/dist/{chunk-F2DEKA2Q.js.map → chunk-YBF2QVZ7.js.map} +0 -0
  122. /package/dist/{chunk-APKAW7LU.js.map → chunk-YL223TEU.js.map} +0 -0
  123. /package/dist/{client-SWODYWKD.js.map → client-GDTX6LFH.js.map} +0 -0
  124. /package/dist/{config-VV4X7PEK.js.map → config-FZ4D4EAV.js.map} +0 -0
  125. /package/dist/{config-mutator-BOE7SMT5.js.map → config-mutator-ETG5V4C5.js.map} +0 -0
  126. /package/dist/{doctor-XIS4TMBI.js.map → doctor-JBIRBRLB.js.map} +0 -0
  127. /package/dist/{heal-HVYQD3EZ.js.map → heal-CMQL5SG4.js.map} +0 -0
  128. /package/dist/{loader-EVHZ2R73.js.map → loader-YFVSSYSL.js.map} +0 -0
  129. /package/dist/{memory-extract-F76BE6KA.js.map → memory-extract-YCNCARZ2.js.map} +0 -0
  130. /package/dist/{program-GUBHJFZS.js.map → program-T275Y2V6.js.map} +0 -0
  131. /package/dist/{promote-7FMPZKXN.js.map → promote-VZAUTV6E.js.map} +0 -0
  132. /package/dist/{providers-NRPX2FHP.js.map → providers-ES5KVLI4.js.map} +0 -0
  133. /package/dist/{query-6272PJPD.js.map → query-7QQZPMXM.js.map} +0 -0
  134. /package/dist/{registry-MUMQPZDM.js.map → registry-WQ65MQEY.js.map} +0 -0
  135. /package/dist/{request-planner-73Y5GI3D.js.map → request-planner-NMOAOZIM.js.map} +0 -0
  136. /package/dist/{review-candidates-VF5IWP5P.js.map → review-candidates-FLY6HZEN.js.map} +0 -0
  137. /package/dist/{routing-T24BMMLM.js.map → routing-SMIZ77CT.js.map} +0 -0
  138. /package/dist/{schedule-tool-BY72YNNU.js.map → schedule-tool-NJFROYKY.js.map} +0 -0
  139. /package/dist/{scheduler-XWYFGG2S.js.map → scheduler-5N4FC2FQ.js.map} +0 -0
  140. /package/dist/{seat-XNA2O6EO.js.map → seat-F3S2HG5G.js.map} +0 -0
  141. /package/dist/{select-WOUZIR3Y.js.map → select-5GC7CTPQ.js.map} +0 -0
  142. /package/dist/{set-enabled-C5RFPCAL.js.map → set-enabled-53ZPZ5GR.js.map} +0 -0
  143. /package/dist/{shutdown-ZAF7RW25.js.map → shutdown-SNI2B4LI.js.map} +0 -0
  144. /package/dist/{tool-ZUGNQZGI.js.map → tool-FRTZS4TT.js.map} +0 -0
  145. /package/dist/{wiki-LLL7VWRJ.js.map → wiki-J4MMCONT.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -29,6 +29,11 @@ interface ProviderOptions {
29
29
  * marks the task aborted in the registry; the underlying request
30
30
  * can hang for hours waiting for the model to finish thinking. */
31
31
  abortSignal?: AbortSignal;
32
+ /** Plain text generation only: no tools, no MCP servers, no hooks, no
33
+ * user/project settings, no session persistence. Helper calls
34
+ * (classifier, summaries, extraction) set this so a CLI-backed provider
35
+ * skips the full interactive startup instead of paying it per call. */
36
+ bare?: boolean;
32
37
  /** Force the model to call one specific tool, making its whole reply the
33
38
  * tool's structured `input`. Anthropic renders this as
34
39
  * `tool_choice: {type:"tool", name}`; OpenAI as
@@ -1569,6 +1574,10 @@ declare const agentConfigSchema: z.ZodObject<{
1569
1574
  * its record marked `timeout` with the step it was stuck in. Applies to
1570
1575
  * every run, whatever started it. */
1571
1576
  preSpawnTimeoutSec: z.ZodDefault<z.ZodNumber>;
1577
+ /** How long a daemon stop waits for this agent's runs before cutting
1578
+ * them off, when that is longer than shutdown.drainTimeoutSeconds. For
1579
+ * agents whose runs are long (renders, builds). */
1580
+ drainTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
1572
1581
  permissionMode: z.ZodDefault<z.ZodString>;
1573
1582
  /** How this agent's `claude` CLI is billed (claude-code tier). Default
1574
1583
  * "subscription": the shared OAuth login, ANTHROPIC_API_KEY stripped.
@@ -1891,6 +1900,7 @@ declare const agentConfigSchema: z.ZodObject<{
1891
1900
  headers?: Record<string, string> | undefined;
1892
1901
  }> | undefined;
1893
1902
  contextStrategy?: "layered" | "planner" | undefined;
1903
+ drainTimeoutSeconds?: number | undefined;
1894
1904
  gitlabAutoReply?: boolean | undefined;
1895
1905
  admin?: boolean | undefined;
1896
1906
  voice?: {
@@ -1939,6 +1949,7 @@ declare const agentConfigSchema: z.ZodObject<{
1939
1949
  maxConcurrent?: number | undefined;
1940
1950
  maxExecutionMinutes?: number | undefined;
1941
1951
  preSpawnTimeoutSec?: number | undefined;
1952
+ drainTimeoutSeconds?: number | undefined;
1942
1953
  permissionMode?: string | undefined;
1943
1954
  billing?: "api" | "subscription" | undefined;
1944
1955
  toolUseRequired?: string[] | undefined;
@@ -2364,6 +2375,10 @@ declare const daemonConfigSchema: z.ZodObject<{
2364
2375
  * its record marked `timeout` with the step it was stuck in. Applies to
2365
2376
  * every run, whatever started it. */
2366
2377
  preSpawnTimeoutSec: z.ZodDefault<z.ZodNumber>;
2378
+ /** How long a daemon stop waits for this agent's runs before cutting
2379
+ * them off, when that is longer than shutdown.drainTimeoutSeconds. For
2380
+ * agents whose runs are long (renders, builds). */
2381
+ drainTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
2367
2382
  permissionMode: z.ZodDefault<z.ZodString>;
2368
2383
  /** How this agent's `claude` CLI is billed (claude-code tier). Default
2369
2384
  * "subscription": the shared OAuth login, ANTHROPIC_API_KEY stripped.
@@ -2686,6 +2701,7 @@ declare const daemonConfigSchema: z.ZodObject<{
2686
2701
  headers?: Record<string, string> | undefined;
2687
2702
  }> | undefined;
2688
2703
  contextStrategy?: "layered" | "planner" | undefined;
2704
+ drainTimeoutSeconds?: number | undefined;
2689
2705
  gitlabAutoReply?: boolean | undefined;
2690
2706
  admin?: boolean | undefined;
2691
2707
  voice?: {
@@ -2734,6 +2750,7 @@ declare const daemonConfigSchema: z.ZodObject<{
2734
2750
  maxConcurrent?: number | undefined;
2735
2751
  maxExecutionMinutes?: number | undefined;
2736
2752
  preSpawnTimeoutSec?: number | undefined;
2753
+ drainTimeoutSeconds?: number | undefined;
2737
2754
  permissionMode?: string | undefined;
2738
2755
  billing?: "api" | "subscription" | undefined;
2739
2756
  toolUseRequired?: string[] | undefined;
@@ -4145,6 +4162,18 @@ declare const daemonConfigSchema: z.ZodObject<{
4145
4162
  laterHours?: number | undefined;
4146
4163
  notifyAgent?: boolean | undefined;
4147
4164
  }>>;
4165
+ /** How a daemon stop treats runs still in flight. */
4166
+ shutdown: z.ZodDefault<z.ZodObject<{
4167
+ /** Wait this long for runs to finish before cutting them off (they are
4168
+ * then resumed or reported after the restart). Unset: the
4169
+ * AGENTX_DRAIN_TIMEOUT_MS env var, else 300 s. Keep the service
4170
+ * manager's stop timeout above it, or it kills the daemon mid-wait. */
4171
+ drainTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
4172
+ }, "strip", z.ZodTypeAny, {
4173
+ drainTimeoutSeconds?: number | undefined;
4174
+ }, {
4175
+ drainTimeoutSeconds?: number | undefined;
4176
+ }>>;
4148
4177
  /** What happens to runs a restart cuts off (agents/resume). Chat messages
4149
4178
  * are resumed in their chat; scheduled jobs never are (the next run
4150
4179
  * covers them); everything else is reported unless its channel is in
@@ -5921,6 +5950,7 @@ declare const daemonConfigSchema: z.ZodObject<{
5921
5950
  headers?: Record<string, string> | undefined;
5922
5951
  }> | undefined;
5923
5952
  contextStrategy?: "layered" | "planner" | undefined;
5953
+ drainTimeoutSeconds?: number | undefined;
5924
5954
  gitlabAutoReply?: boolean | undefined;
5925
5955
  admin?: boolean | undefined;
5926
5956
  voice?: {
@@ -6256,6 +6286,9 @@ declare const daemonConfigSchema: z.ZodObject<{
6256
6286
  laterHours: number;
6257
6287
  notifyAgent: boolean;
6258
6288
  };
6289
+ shutdown: {
6290
+ drainTimeoutSeconds?: number | undefined;
6291
+ };
6259
6292
  reminders: {
6260
6293
  enabled: boolean;
6261
6294
  command: string;
@@ -6542,6 +6575,7 @@ declare const daemonConfigSchema: z.ZodObject<{
6542
6575
  maxConcurrent?: number | undefined;
6543
6576
  maxExecutionMinutes?: number | undefined;
6544
6577
  preSpawnTimeoutSec?: number | undefined;
6578
+ drainTimeoutSeconds?: number | undefined;
6545
6579
  permissionMode?: string | undefined;
6546
6580
  billing?: "api" | "subscription" | undefined;
6547
6581
  toolUseRequired?: string[] | undefined;
@@ -6907,6 +6941,9 @@ declare const daemonConfigSchema: z.ZodObject<{
6907
6941
  laterHours?: number | undefined;
6908
6942
  notifyAgent?: boolean | undefined;
6909
6943
  } | undefined;
6944
+ shutdown?: {
6945
+ drainTimeoutSeconds?: number | undefined;
6946
+ } | undefined;
6910
6947
  reminders?: {
6911
6948
  enabled?: boolean | undefined;
6912
6949
  command?: string | undefined;
@@ -7501,6 +7538,9 @@ interface AgentXEvents {
7501
7538
  chatId: string;
7502
7539
  durationMs: number;
7503
7540
  error?: string;
7541
+ /** A daemon shutdown stopped the run. Its trace stays in flight so the
7542
+ * next boot can resume it. */
7543
+ interrupted?: boolean;
7504
7544
  inputTokens?: number;
7505
7545
  outputTokens?: number;
7506
7546
  cacheReadTokens?: number;
@@ -7798,6 +7838,8 @@ declare class AgentXDaemon {
7798
7838
  private midnightTimer?;
7799
7839
  /** Set on the first stop signal: new work is refused while tasks drain. */
7800
7840
  private shuttingDown;
7841
+ /** Who asked for the current stop, when it said so. */
7842
+ private shutdownRequest;
7801
7843
  /** Runs the previous daemon left in flight (agents/resume). */
7802
7844
  private interruptedRuns;
7803
7845
  private bootTimes;
@@ -8182,7 +8224,7 @@ interface FriendlyError {
8182
8224
  /** Optional next step the user can take. */
8183
8225
  fix?: string;
8184
8226
  /** Machine-readable error category for routing / retries. */
8185
- kind: "out_of_credits" | "overage_disabled" | "usage_cap" | "auth" | "permission" | "rate_limit" | "overloaded" | "context_too_large" | "invalid_request" | "upstream_api" | "timeout" | "cancelled" | "unknown";
8227
+ kind: "out_of_credits" | "overage_disabled" | "usage_cap" | "auth" | "permission" | "rate_limit" | "overloaded" | "context_too_large" | "invalid_request" | "upstream_api" | "timeout" | "cancelled" | "interrupted" | "unknown";
8186
8228
  /** Whether this error is transient — a retry has a reasonable chance of succeeding. */
8187
8229
  retryable: boolean;
8188
8230
  /** Source error text retained for logs / debugging. */
@@ -8689,6 +8731,10 @@ declare class MemoryStore {
8689
8731
  /** Store a fact. Refuses secrets (returns false). Stamps the source's
8690
8732
  * trust, and holds facts from external sources for review. */
8691
8733
  addMemory(agentId: string, fact: Omit<MemoryFact, "id" | "createdAt">): boolean;
8734
+ /** Parsed facts per file, valid while the file's mtime and size hold.
8735
+ * The store is read on every turn and the file only grows, so without
8736
+ * this each task re-parsed a hundred-kilobyte log on the event loop. */
8737
+ private parsedCache;
8692
8738
  getAll(agentId: string): MemoryFact[];
8693
8739
  findRelevant(message: string, agentId: string, limit?: number): MemoryFact[];
8694
8740
  buildContext(memories: MemoryFact[]): string;
@@ -9176,6 +9222,11 @@ declare class WikiStore {
9176
9222
  /**
9177
9223
  * List all articles accessible to an agent.
9178
9224
  */
9225
+ /** Catalog per agent, valid while no article file changed. The walk is
9226
+ * repeated (names, mtimes, sizes) but the frontmatter parse of every
9227
+ * article is not; on a wiki of ten thousand files that parse was the
9228
+ * cost of every fresh session. */
9229
+ private listCache;
9179
9230
  listArticles(agentId: string): WikiArticle[];
9180
9231
  /**
9181
9232
  * Search articles by keyword. Returns articles the agent can read.
@@ -9974,8 +10025,13 @@ declare class GraphStore {
9974
10025
  readRecentClassifications(limit?: number): Classification[];
9975
10026
  /**
9976
10027
  * Hash that represents "this kind of message" for snap-to-path caching.
9977
- * Normalizes casing + whitespace; includes channel + sender so two people
9978
- * writing the same words can still land on different paths if they should.
10028
+ *
10029
+ * Keyed on the normalized wording plus the channel. The sender used to be
10030
+ * part of the key too, and the exact text was: measured over the last
10031
+ * 2,000 classifications, 89% missed, so nearly every task paid an LLM
10032
+ * call for a taxonomy label. Identifiers, numbers, links and mentions
10033
+ * are what differ between two messages that mean the same thing, so
10034
+ * they are folded away (see `normalizeForFingerprint`).
9979
10035
  */
9980
10036
  fingerprint(msg: {
9981
10037
  text: string;
@@ -10270,6 +10326,8 @@ declare class AgentRegistry {
10270
10326
  * to drop the orphan cancelled turn from history so the Update reads as an
10271
10327
  * edit, not a bare follow-up. */
10272
10328
  private taskAborts;
10329
+ /** Runs a daemon shutdown stopped, with the reason each one reports. */
10330
+ private interruptedRuns;
10273
10331
  /** The context each running task was started with, by RunningTask id.
10274
10332
  * Kept apart from RunningTask because /agents serialises that, and a
10275
10333
  * context can carry a whole conversation history. Read by A2A
@@ -10400,6 +10458,9 @@ declare class AgentRegistry {
10400
10458
  /** Total active task count across all agents — used by the daemon's
10401
10459
  * graceful shutdown to drain in-flight runs before exit. */
10402
10460
  getActiveTaskCount(): number;
10461
+ /** drainTimeoutSeconds of each agent with a run in flight (undefined when
10462
+ * unset), so a stop can wait as long as the longest of them asks. */
10463
+ runningAgentDrainSeconds(): Array<number | undefined>;
10403
10464
  list(): Array<{
10404
10465
  id: string;
10405
10466
  name: string;
@@ -10500,6 +10561,13 @@ declare class AgentRegistry {
10500
10561
  channel: string;
10501
10562
  chatId: string;
10502
10563
  } | null;
10564
+ /**
10565
+ * Daemon shutdown: stop every run still going once the drain limit is
10566
+ * spent. Each one ends as `interrupted` with `reason` rather than as a
10567
+ * failure of its own, and its trace stays in flight for resume on boot.
10568
+ * Returns how many runs it stopped.
10569
+ */
10570
+ interruptRunning(reason: string): number;
10503
10571
  /** Stop every in-flight run of `agentId` in one chat. Used when a streaming
10504
10572
  * caller disconnects (the phone app's Stop). Returns how many it aborted. */
10505
10573
  cancelChatTasks(agentId: string, channel: string, chatId: string, reason?: string): number;
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import{a as L}from"./chunk-Y57CULGE.js";import{a as St,b as kt,c as vt,d as xt,da as Tt,e as $t,ea as Mt,f as Ct,g as Pt,h as bt}from"./chunk-U3XQ7USK.js";import"./chunk-JSF2THM4.js";import"./chunk-BYJ3A55Y.js";import"./chunk-NMFXY3QU.js";import"./chunk-F2DEKA2Q.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-2V7IQUEA.js";import"./chunk-2D3RYIDU.js";import"./chunk-L53FTKEP.js";import{S as yt,l as lt,m as ct,n as dt,o as mt,p as pt}from"./chunk-L2K4N3DA.js";import"./chunk-4UMYRIEI.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.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-AIV547JW.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-XMW422NO.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import{s as ut}from"./chunk-A5ZCMRB3.js";import"./chunk-APKAW7LU.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-Q2WW2HF4.js";import"./chunk-DWADWDMU.js";import"./chunk-NO2HOK4B.js";import"./chunk-QD6IICK7.js";import"./chunk-VWTBHLMX.js";import"./chunk-VXDM7JAT.js";import{a as gt,b as ft,e as ht}from"./chunk-M6HJDSLS.js";import"./chunk-4DRNEOOW.js";import"./chunk-64P4QHSZ.js";import"./chunk-KSDVKLHN.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-VOS2IW4V.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.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-SZJMS7K4.js";import{a as m,b as G}from"./chunk-7I7IEX4S.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{u as tt,w as st,x as ot,z as nt}from"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.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-C245D4BZ.js";import{a as St,b as kt,c as vt,d as xt,da as Tt,e as $t,ea as Mt,f as Ct,g as Pt,h as bt}from"./chunk-5ONI54E6.js";import"./chunk-CKBAVCGU.js";import"./chunk-BYJ3A55Y.js";import"./chunk-NMFXY3QU.js";import"./chunk-YBF2QVZ7.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-DQQ3BCJW.js";import"./chunk-2D3RYIDU.js";import"./chunk-EKJG63EJ.js";import{S as yt,l as lt,m as ct,n as dt,o as mt,p as pt}from"./chunk-K63IOY6A.js";import"./chunk-IU6L4V3A.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.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-J7HA7ZTU.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-FSYA4GNU.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import{s as ut}from"./chunk-OPUPVGYP.js";import"./chunk-YL223TEU.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-P2RYUODK.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-VWTBHLMX.js";import"./chunk-2UYV24UD.js";import{a as gt,b as ft,e as ht}from"./chunk-535MLOSB.js";import"./chunk-4DRNEOOW.js";import"./chunk-64P4QHSZ.js";import"./chunk-V2TLFYKH.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-BBIWAJRX.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.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-5MUJZODV.js";import{a as m,b as G}from"./chunk-7I7IEX4S.js";import{b as Fe,c as Le,d as A,e as De}from"./chunk-JHCI6XCJ.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{u as tt,w as st,x as ot,z as nt}from"./chunk-DTX4I5LQ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.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
- ${t}`}async function It(o){let{loadLocalSkills:e}=await import("./loader-EVHZ2R73.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).
4
+ ${t}`}async function It(o){let{loadLocalSkills:e}=await import("./loader-YFVSSYSL.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).
5
5
  You create high-quality SKILL.md files that provide reusable instructions for AI coding agents.
6
6
 
7
7
  A skill is a markdown document with YAML frontmatter that teaches an agent how to perform a specific task.
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e,f}from"./chunk-JHCI6XCJ.js";import"./chunk-QIJLFPWE.js";export{a as clearSkillCache,f as getAutoInjectSkills,b as loadLocalSkills,e as matchSkillsToTask,d as parseSkillContent,c as parseSkillFile};
2
+ //# sourceMappingURL=loader-YFVSSYSL.js.map
@@ -0,0 +1,2 @@
1
+ import{b as a}from"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-QIJLFPWE.js";export{a as extractMemories};
2
+ //# sourceMappingURL=memory-extract-YCNCARZ2.js.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-OHRTBD7U.js";import"./chunk-OVX6NRMD.js";import"./chunk-KLHG5ZQH.js";import"./chunk-M6GPRMCQ.js";import"./chunk-Z3IP66SL.js";import"./chunk-C4CDVE2E.js";import"./chunk-RKPAVWXF.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-5ONI54E6.js";import"./chunk-CKBAVCGU.js";import"./chunk-BYJ3A55Y.js";import"./chunk-NMFXY3QU.js";import"./chunk-YBF2QVZ7.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-DQQ3BCJW.js";import"./chunk-2D3RYIDU.js";import"./chunk-EKJG63EJ.js";import"./chunk-K63IOY6A.js";import"./chunk-IU6L4V3A.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.js";import"./chunk-J7HA7ZTU.js";import"./chunk-SFQUP3BP.js";import"./chunk-FSYA4GNU.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-OPUPVGYP.js";import"./chunk-YL223TEU.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-P2RYUODK.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-VWTBHLMX.js";import"./chunk-2UYV24UD.js";import"./chunk-535MLOSB.js";import"./chunk-4DRNEOOW.js";import"./chunk-64P4QHSZ.js";import"./chunk-V2TLFYKH.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-BBIWAJRX.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-JHCI6XCJ.js";import"./chunk-DSYKYZMT.js";import"./chunk-DTX4I5LQ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as buildProgram};
2
+ //# sourceMappingURL=program-T275Y2V6.js.map
@@ -1,2 +1,2 @@
1
- import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t}from"./chunk-2V7IQUEA.js";import"./chunk-DP7RTNDM.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-M6HJDSLS.js";import"./chunk-4DRNEOOW.js";import"./chunk-64P4QHSZ.js";import"./chunk-TFVUOC2C.js";import"./chunk-VOS2IW4V.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{b as DEFAULT_PROMOTE_TYPES,a as PROMOTER_OWNER,c as PROMOTION_LEDGER_FILE,j as appendPromotionLedger,s as approveProposal,n as callPromotionLlm,p as estimateTokens,r as evidenceFor,m as getUnpromotedMemories,k as groupCandidates,h as listAllAgentMemories,d as memoryKey,e as memoryStamp,g as mergeSources,f as parseMemoryStamp,l as parsePromotionResponse,i as readPromotionLedger,t as rejectProposal,o as runPromotion,q as sourceKind};
2
- //# sourceMappingURL=promote-7FMPZKXN.js.map
1
+ import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t}from"./chunk-DQQ3BCJW.js";import"./chunk-DP7RTNDM.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-535MLOSB.js";import"./chunk-4DRNEOOW.js";import"./chunk-64P4QHSZ.js";import"./chunk-TFVUOC2C.js";import"./chunk-BBIWAJRX.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-DTX4I5LQ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{b as DEFAULT_PROMOTE_TYPES,a as PROMOTER_OWNER,c as PROMOTION_LEDGER_FILE,j as appendPromotionLedger,s as approveProposal,n as callPromotionLlm,p as estimateTokens,r as evidenceFor,m as getUnpromotedMemories,k as groupCandidates,h as listAllAgentMemories,d as memoryKey,e as memoryStamp,g as mergeSources,f as parseMemoryStamp,l as parsePromotionResponse,i as readPromotionLedger,t as rejectProposal,o as runPromotion,q as sourceKind};
2
+ //# sourceMappingURL=promote-VZAUTV6E.js.map
@@ -1,2 +1,2 @@
1
- import{l as a,m as b,n as c,o as d,p as e}from"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-QIJLFPWE.js";e();export{b as ClaudeCodeProvider,a as ClaudeProvider,c as OpenAIProvider,d as createProvider};
2
- //# sourceMappingURL=providers-NRPX2FHP.js.map
1
+ import{l as a,m as b,n as c,o as d,p as e}from"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-QIJLFPWE.js";e();export{b as ClaudeCodeProvider,a as ClaudeProvider,c as OpenAIProvider,d as createProvider};
2
+ //# sourceMappingURL=providers-ES5KVLI4.js.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-V2TLFYKH.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-BBIWAJRX.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-DTX4I5LQ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as agenticQuery};
2
+ //# sourceMappingURL=query-7QQZPMXM.js.map
@@ -0,0 +1,2 @@
1
+ import{I as a,J as b,K as c,L as d,M as e,N as f,O as g,P as h,Q as i,R as j,S as k,T as l}from"./chunk-K63IOY6A.js";import"./chunk-IU6L4V3A.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-OPUPVGYP.js";import"./chunk-YL223TEU.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-P2RYUODK.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-VWTBHLMX.js";import"./chunk-2UYV24UD.js";import"./chunk-535MLOSB.js";import"./chunk-4DRNEOOW.js";import"./chunk-64P4QHSZ.js";import"./chunk-V2TLFYKH.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-BBIWAJRX.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-DSYKYZMT.js";import"./chunk-DTX4I5LQ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{k as AgentRegistry,f as TRACE_STEP_SUMMARY_BYTES,c as buildEntryMeta,d as buildEventDigest,e as buildWikiContext,g as clipForTrace,j as emitTraceStepsFromStreamEvent,i as firstMissingRequiredTool,b as getGlobalRegistry,l as richReplyPrompt,a as setGlobalRegistry,h as tallyToolUses};
2
+ //# sourceMappingURL=registry-WQ65MQEY.js.map
@@ -1,2 +1,2 @@
1
- import{q as m,t as p,v as d,w as x}from"./chunk-VOS2IW4V.js";import"./chunk-FX3D7YON.js";import{a as u,f}from"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.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-73Y5GI3D.js.map
1
+ import{q as m,t as p,v as d,w as x}from"./chunk-BBIWAJRX.js";import"./chunk-FX3D7YON.js";import{a as u,f}from"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-DTX4I5LQ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.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-NMOAOZIM.js.map
@@ -1,4 +1,4 @@
1
- import{b as I}from"./chunk-F2DEKA2Q.js";import"./chunk-WP6KLXTP.js";import"./chunk-2GIDVZ4H.js";import"./chunk-VOS2IW4V.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";import{createHash as E}from"crypto";var v="review:",b={decisions:"project",warnings:"feedback",friction:"feedback",context:"reference"};function A(t,n,r){let s=E("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",L=5;function T(t,n){return`${t}|${I(n)}`}function K(t,n={}){let r=n.kinds??Object.keys(b),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=b[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=A(e.id,c,a),_=g.slice(g.lastIndexOf("@")),w=`${c}${_}`,y=T(c,a),S=f.get(y)??new Set;if(S.add(e.session_id??e.id),f.set(y,S),d.has(w))continue;let O=String($?.evidence??"").trim(),k={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:O,agent:e.agent,source:e.source}),d.set(w,k),u.set(w,y),h.push(k)}}}for(let[e,i]of d){let o=f.get(u.get(e)??"");i.occurrences=o?.size??1,i.sessions=[...o??[]].slice(0,L);let c=x.get(i.stamp);i.memory.body=D(c,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 D(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 as I}from"./chunk-YBF2QVZ7.js";import"./chunk-WP6KLXTP.js";import"./chunk-2GIDVZ4H.js";import"./chunk-BBIWAJRX.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-DTX4I5LQ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";import{createHash as E}from"crypto";var v="review:",b={decisions:"project",warnings:"feedback",friction:"feedback",context:"reference"};function A(t,n,r){let s=E("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",L=5;function T(t,n){return`${t}|${I(n)}`}function K(t,n={}){let r=n.kinds??Object.keys(b),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=b[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=A(e.id,c,a),_=g.slice(g.lastIndexOf("@")),w=`${c}${_}`,y=T(c,a),S=f.get(y)??new Set;if(S.add(e.session_id??e.id),f.set(y,S),d.has(w))continue;let O=String($?.evidence??"").trim(),k={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:O,agent:e.agent,source:e.source}),d.set(w,k),u.set(w,y),h.push(k)}}}for(let[e,i]of d){let o=f.get(u.get(e)??"");i.occurrences=o?.size??1,i.sessions=[...o??[]].slice(0,L);let c=x.get(i.stamp);i.memory.body=D(c,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 D(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{L as MAX_EVIDENCE_SESSIONS,b as PROMOTABLE_KINDS,v as REVIEW_STAMP_PREFIX,F as parseReviewStamp,A as reviewStamp,K as reviewsToCandidates};
4
- //# sourceMappingURL=review-candidates-VF5IWP5P.js.map
4
+ //# sourceMappingURL=review-candidates-FLY6HZEN.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-P2RYUODK.js";import"./chunk-BBIWAJRX.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-DTX4I5LQ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as cheapModelForEngine,b as routeTaskModel};
2
+ //# sourceMappingURL=routing-SMIZ77CT.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-FUR3T3IN.js";import"./chunk-RKPAVWXF.js";import"./chunk-FSYA4GNU.js";import"./chunk-OPUPVGYP.js";import"./chunk-YL223TEU.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-DTX4I5LQ.js";import"./chunk-QIJLFPWE.js";export{b as resolveScheduleCaller,a as runScheduleTool};
2
+ //# sourceMappingURL=schedule-tool-NJFROYKY.js.map
@@ -0,0 +1,2 @@
1
+ import{n as a,o as b,p as c,q as d,r as e,s as f}from"./chunk-OPUPVGYP.js";import"./chunk-YL223TEU.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-DTX4I5LQ.js";import"./chunk-QIJLFPWE.js";export{a as AGENT_RUN_TIMEOUT_FLOOR,f as CronScheduler,b as agentRunTimeout,e as cronRunId,d as getNextCronDate,c as runLinkIds};
2
+ //# sourceMappingURL=scheduler-5N4FC2FQ.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-VOS2IW4V.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.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-XNA2O6EO.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-BBIWAJRX.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-DTX4I5LQ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.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-F3S2HG5G.js.map
@@ -1,2 +1,2 @@
1
- import{v as S,w}from"./chunk-VOS2IW4V.js";import"./chunk-FX3D7YON.js";import{a as g,b as h,f as R}from"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import{d as f}from"./chunk-VDMYBPYB.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.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-WOUZIR3Y.js.map
1
+ import{v as S,w}from"./chunk-BBIWAJRX.js";import"./chunk-FX3D7YON.js";import{a as g,b as h,f as R}from"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import{e as f}from"./chunk-JHCI6XCJ.js";import"./chunk-DTX4I5LQ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.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-5GC7CTPQ.js.map
@@ -1,2 +1,2 @@
1
- import{b as a}from"./chunk-APKAW7LU.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-QIJLFPWE.js";async function i(o,r,s={}){let e=null,n=await a(l=>{let t=l.crons?.[o];if(t?r&&t.approval?.action==="create"?e={ok:!1,status:409,error:`schedule "${o}" is waiting for approval: agentx schedule approve ${o}`}:t.enabled===r&&(e={ok:!0,id:o,enabled:r,changed:!1}):e={ok:!1,status:404,error:`no schedule "${o}"`},e)throw new Error("no write");t.enabled=r,e={ok:!0,id:o,enabled:r,changed:!0}},{configPath:s.configPath,reload:!1});return e&&(!e.ok||!e.changed)?e:n.success?e??{ok:!1,status:500,error:"mutation did not run"}:{ok:!1,status:500,error:n.error||"could not write agentx.json"}}export{i as setCronEnabled};
2
- //# sourceMappingURL=set-enabled-C5RFPCAL.js.map
1
+ import{b as a}from"./chunk-YL223TEU.js";import"./chunk-DTX4I5LQ.js";import"./chunk-QIJLFPWE.js";async function i(o,r,s={}){let e=null,n=await a(l=>{let t=l.crons?.[o];if(t?r&&t.approval?.action==="create"?e={ok:!1,status:409,error:`schedule "${o}" is waiting for approval: agentx schedule approve ${o}`}:t.enabled===r&&(e={ok:!0,id:o,enabled:r,changed:!1}):e={ok:!1,status:404,error:`no schedule "${o}"`},e)throw new Error("no write");t.enabled=r,e={ok:!0,id:o,enabled:r,changed:!0}},{configPath:s.configPath,reload:!1});return e&&(!e.ok||!e.changed)?e:n.success?e??{ok:!1,status:500,error:"mutation did not run"}:{ok:!1,status:500,error:n.error||"could not write agentx.json"}}export{i as setCronEnabled};
2
+ //# sourceMappingURL=set-enabled-53ZPZ5GR.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e,f,g,h,i}from"./chunk-EKJG63EJ.js";import"./chunk-QIJLFPWE.js";export{f as INTERRUPT_SETTLE_MS,a as SHUTDOWN_REQUEST_FILE,e as describeShutdown,g as drainLimitMs,h as interruptionReason,d as serviceManager,i as startsNewWork,c as takeShutdownRequest,b as writeShutdownRequest};
2
+ //# sourceMappingURL=shutdown-SNI2B4LI.js.map
@@ -1,2 +1,2 @@
1
- import{b as p}from"./chunk-YBLITM6C.js";import"./chunk-RKPAVWXF.js";import"./chunk-XMW422NO.js";import"./chunk-A5ZCMRB3.js";import"./chunk-APKAW7LU.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-QIJLFPWE.js";var f=new Set(["cron","heartbeat","api","a2a","mesh","approvals"]);function u(t){return typeof t=="string"?t.trim():""}async function y(t,i){let c=i.fetch??fetch,d=i.daemonUrl.replace(/\/$/,""),s=(u(t.action)||"create").toLowerCase(),r=p(t,i.env??process.env);if(s==="status"){let o=u(t.id);if(!o)return"Error: `id` is required for status (the card id you got when you raised it).";try{let n=await c(`${d}/approvals/${encodeURIComponent(o)}`,{signal:AbortSignal.timeout(1e4)}),a=await n.json().catch(()=>({}));if(!n.ok)return`Error: ${a?.error||`HTTP ${n.status}`}`;let e=a.card;return r&&e.raised_by!==r.agentId?`Error: card "${o}" was raised by another agent.`:e.status==="pending"?`Card ${e.id} is still waiting for the operator. It expires ${e.expires}; then "${e.if_silent}" applies.`:e.status==="decided"?`Card ${e.id}: the operator said ${String(e.verdict).toUpperCase()}.${e.note?` Note: ${e.note}`:""}`:`Card ${e.id} expired unanswered; the default applied: ${e.outcome??e.if_silent}.`}catch(n){return`Error: couldn't reach the daemon (${n?.message??n}).`}}if(s!=="create")return`Error: unknown action "${s}". Use create or status.`;if(!r)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let l=r.channel&&r.chatId&&!f.has(r.channel)?{channel:r.channel,chatId:r.chatId,...r.accountId?{accountId:r.accountId}:{}}:void 0,h={title:t.title,ask:t.ask,recommend:t.recommend,if_silent:t.if_silent,expires:t.expires,source:t.source,raised_by:r.agentId,...l?{reply:l}:{}};try{let o=await c(`${d}/approvals`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(h),signal:AbortSignal.timeout(1e4)}),n=await o.json().catch(()=>({}));if(!o.ok)return`Error: ${n?.error||`HTTP ${o.status}`}`;let a=n.card;return[`Decision card ${a.id} is in the operator's Approvals inbox.`,`If nobody answers by ${a.expires}, "${a.if_silent}" applies.`,"You will get a message with the result. Tell the requester it is waiting for approval; don't ask the operator again in chat."].join(" ")}catch(o){return`Error: couldn't reach the daemon (${o?.message??o}).`}}export{y as runApprovalTool};
2
- //# sourceMappingURL=tool-ZUGNQZGI.js.map
1
+ import{b as p}from"./chunk-FUR3T3IN.js";import"./chunk-RKPAVWXF.js";import"./chunk-FSYA4GNU.js";import"./chunk-OPUPVGYP.js";import"./chunk-YL223TEU.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-DTX4I5LQ.js";import"./chunk-QIJLFPWE.js";var f=new Set(["cron","heartbeat","api","a2a","mesh","approvals"]);function u(t){return typeof t=="string"?t.trim():""}async function y(t,i){let c=i.fetch??fetch,d=i.daemonUrl.replace(/\/$/,""),s=(u(t.action)||"create").toLowerCase(),r=p(t,i.env??process.env);if(s==="status"){let o=u(t.id);if(!o)return"Error: `id` is required for status (the card id you got when you raised it).";try{let n=await c(`${d}/approvals/${encodeURIComponent(o)}`,{signal:AbortSignal.timeout(1e4)}),a=await n.json().catch(()=>({}));if(!n.ok)return`Error: ${a?.error||`HTTP ${n.status}`}`;let e=a.card;return r&&e.raised_by!==r.agentId?`Error: card "${o}" was raised by another agent.`:e.status==="pending"?`Card ${e.id} is still waiting for the operator. It expires ${e.expires}; then "${e.if_silent}" applies.`:e.status==="decided"?`Card ${e.id}: the operator said ${String(e.verdict).toUpperCase()}.${e.note?` Note: ${e.note}`:""}`:`Card ${e.id} expired unanswered; the default applied: ${e.outcome??e.if_silent}.`}catch(n){return`Error: couldn't reach the daemon (${n?.message??n}).`}}if(s!=="create")return`Error: unknown action "${s}". Use create or status.`;if(!r)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let l=r.channel&&r.chatId&&!f.has(r.channel)?{channel:r.channel,chatId:r.chatId,...r.accountId?{accountId:r.accountId}:{}}:void 0,h={title:t.title,ask:t.ask,recommend:t.recommend,if_silent:t.if_silent,expires:t.expires,source:t.source,raised_by:r.agentId,...l?{reply:l}:{}};try{let o=await c(`${d}/approvals`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(h),signal:AbortSignal.timeout(1e4)}),n=await o.json().catch(()=>({}));if(!o.ok)return`Error: ${n?.error||`HTTP ${o.status}`}`;let a=n.card;return[`Decision card ${a.id} is in the operator's Approvals inbox.`,`If nobody answers by ${a.expires}, "${a.if_silent}" applies.`,"You will get a message with the result. Tell the requester it is waiting for approval; don't ask the operator again in chat."].join(" ")}catch(o){return`Error: couldn't reach the daemon (${o?.message??o}).`}}export{y as runApprovalTool};
2
+ //# sourceMappingURL=tool-FRTZS4TT.js.map
@@ -0,0 +1,2 @@
1
+ import"./chunk-VWTBHLMX.js";import{a as b}from"./chunk-2UYV24UD.js";import{e as a}from"./chunk-535MLOSB.js";import"./chunk-4DRNEOOW.js";import"./chunk-64P4QHSZ.js";import{a as c}from"./chunk-V2TLFYKH.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-BBIWAJRX.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-DTX4I5LQ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{b as WikiHub,a as WikiStore,c as agenticQuery};
2
+ //# sourceMappingURL=wiki-J4MMCONT.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentix-cli",
3
- "version": "0.69.2",
3
+ "version": "0.69.4",
4
4
  "description": "AI operations layer for small and medium businesses. Routes Telegram, WhatsApp, GitLab, GitHub, crons, webhooks, and mesh tasks to AI agents. Web wizard for operators, CLI for engineers. Self-hosted.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -1,2 +0,0 @@
1
- import{A as a,B as b,C as c}from"./chunk-AIV547JW.js";import"./chunk-SFQUP3BP.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-VDMYBPYB.js";import"./chunk-DSYKYZMT.js";import"./chunk-QIJLFPWE.js";export{a as createAgentContext,b as generate,c as generateStream};
2
- //# sourceMappingURL=agent-P2UO35ZW.js.map