agentix-cli 0.50.1 → 0.52.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 (123) hide show
  1. package/apps/mac-voice/Sources/AgentXVoice/AgentClient.swift +67 -14
  2. package/apps/mac-voice/Sources/AgentXVoice/Config.swift +20 -3
  3. package/apps/mac-voice/Sources/AgentXVoice/Panel.swift +24 -31
  4. package/apps/mac-voice/Sources/AgentXVoice/Speech.swift +16 -2
  5. package/apps/mac-voice/Sources/AgentXVoice/StatusMenu.swift +173 -0
  6. package/apps/mac-voice/Sources/AgentXVoice/main.swift +62 -15
  7. package/dist/{App-TDUUFVDV.js → App-QVNQ5BQK.js} +2 -2
  8. package/dist/{ChatApp-IOWDXM3R.js → ChatApp-CC57XC23.js} +2 -2
  9. package/dist/{agent-KRLAT3YJ.js → agent-ILH6ANOM.js} +2 -2
  10. package/dist/{board-dashboard-VA4VSCMQ.js → board-dashboard-WG4ZZV4A.js} +346 -137
  11. package/dist/board-dashboard-WG4ZZV4A.js.map +1 -0
  12. package/dist/{chunk-ZWGRRFJI.js → chunk-2KQTE4XI.js} +2 -2
  13. package/dist/{chunk-A6IV2VQY.js → chunk-6HAZ6YWI.js} +2 -2
  14. package/dist/{chunk-WUDXUY7H.js → chunk-BNVF66YL.js} +3 -3
  15. package/dist/chunk-BNVF66YL.js.map +1 -0
  16. package/dist/{chunk-HHY3MSMN.js → chunk-CAA546XN.js} +2 -2
  17. package/dist/{chunk-X5K3HR4V.js → chunk-F7WY24UZ.js} +2 -2
  18. package/dist/{chunk-7WDJW37G.js → chunk-GUJB53QU.js} +2 -2
  19. package/dist/{chunk-FDYGTQVW.js → chunk-H2TWRZC2.js} +2 -2
  20. package/dist/{chunk-F2PEUQW4.js → chunk-JQR3NTHI.js} +2 -2
  21. package/dist/{chunk-4BNQSUWV.js → chunk-KAFO5QZR.js} +2 -2
  22. package/dist/{chunk-ZQSB6IX4.js → chunk-KFALP5NO.js} +2 -2
  23. package/dist/{chunk-RP7GLXOA.js → chunk-NTG5ZXRI.js} +180 -179
  24. package/dist/chunk-NTG5ZXRI.js.map +1 -0
  25. package/dist/{chunk-2BRX2EMT.js → chunk-PSDCRZZM.js} +2 -2
  26. package/dist/{chunk-BVRUDRCM.js → chunk-QP6XNTBB.js} +2 -2
  27. package/dist/{chunk-AVJRATR5.js → chunk-ROCUOXCW.js} +2 -2
  28. package/dist/{chunk-FULEQYM6.js → chunk-S7CVSKOX.js} +2 -2
  29. package/dist/chunk-S7CVSKOX.js.map +1 -0
  30. package/dist/{chunk-XSFXAJDA.js → chunk-SRCXUZM2.js} +4 -4
  31. package/dist/{chunk-XSFXAJDA.js.map → chunk-SRCXUZM2.js.map} +1 -1
  32. package/dist/chunk-U67EG5IF.js +19 -0
  33. package/dist/chunk-U67EG5IF.js.map +1 -0
  34. package/dist/{chunk-JWLTI6NZ.js → chunk-UL4E2CV4.js} +163 -160
  35. package/dist/chunk-UL4E2CV4.js.map +1 -0
  36. package/dist/chunk-V7XZN3MQ.js +123 -0
  37. package/dist/chunk-V7XZN3MQ.js.map +1 -0
  38. package/dist/{chunk-WW6KNRIR.js → chunk-VMS3HVTT.js} +2 -2
  39. package/dist/{chunk-5KCOH5FQ.js → chunk-WDQ3BPFS.js} +2 -2
  40. package/dist/{chunk-ZN7637EF.js → chunk-XZTR5MBJ.js} +2 -2
  41. package/dist/chunk-YE2BUU3Z.js +28 -0
  42. package/dist/chunk-YE2BUU3Z.js.map +1 -0
  43. package/dist/{chunk-ZKDWQJVS.js → chunk-YEV6W34S.js} +55 -55
  44. package/dist/{chunk-ZKDWQJVS.js.map → chunk-YEV6W34S.js.map} +1 -1
  45. package/dist/cli.js +1 -1
  46. package/dist/client-I7GAAM3T.js +2 -0
  47. package/dist/{config-I4GWI22T.js → config-TVW7UCKG.js} +2 -2
  48. package/dist/config-mutator-JHM53P5A.js +2 -0
  49. package/dist/doctor-CXFMV6PT.js +2 -0
  50. package/dist/index.d.ts +256 -6
  51. package/dist/index.js +1 -1
  52. package/dist/processes-NNXSRQSV.js +2 -0
  53. package/dist/program-UXJWH5JG.js +2 -0
  54. package/dist/{promote-EDEG2HQR.js → promote-4T64VW5K.js} +2 -2
  55. package/dist/query-6IKL52WT.js +2 -0
  56. package/dist/registry-E4QUXHMQ.js +2 -0
  57. package/dist/{request-planner-JDBXFNQ4.js → request-planner-BRLDCYU5.js} +2 -2
  58. package/dist/{review-candidates-EBP5CFOB.js → review-candidates-QWW5PDUU.js} +2 -2
  59. package/dist/{routing-Q2EOZ3VW.js → routing-DP6S7OJL.js} +2 -2
  60. package/dist/schedule-tool-TPJ6GR47.js +2 -0
  61. package/dist/scheduler-7QPG6OTY.js +2 -0
  62. package/dist/{seat-LV3STEXI.js → seat-3KUNRM5Z.js} +2 -2
  63. package/dist/{select-5NHY4T5A.js → select-ILXHYJGD.js} +2 -2
  64. package/dist/{tool-2RKPJWDG.js → tool-SF3BCY55.js} +2 -2
  65. package/dist/wiki-WETANN3W.js +2 -0
  66. package/package.json +1 -1
  67. package/dist/board-dashboard-VA4VSCMQ.js.map +0 -1
  68. package/dist/chunk-FULEQYM6.js.map +0 -1
  69. package/dist/chunk-JUJ3TCOE.js +0 -19
  70. package/dist/chunk-JUJ3TCOE.js.map +0 -1
  71. package/dist/chunk-JWLTI6NZ.js.map +0 -1
  72. package/dist/chunk-JY7POTMB.js +0 -123
  73. package/dist/chunk-JY7POTMB.js.map +0 -1
  74. package/dist/chunk-KH6L7GDO.js +0 -28
  75. package/dist/chunk-KH6L7GDO.js.map +0 -1
  76. package/dist/chunk-RP7GLXOA.js.map +0 -1
  77. package/dist/chunk-WUDXUY7H.js.map +0 -1
  78. package/dist/client-PC7OEKSK.js +0 -2
  79. package/dist/config-mutator-3RFKH3OV.js +0 -2
  80. package/dist/doctor-OG6DK52Y.js +0 -2
  81. package/dist/processes-CMTMB7LG.js +0 -2
  82. package/dist/program-RFAHI4SS.js +0 -2
  83. package/dist/query-P5LMGXVS.js +0 -2
  84. package/dist/registry-GJLY5J5E.js +0 -2
  85. package/dist/schedule-tool-N2Z5E6AR.js +0 -2
  86. package/dist/scheduler-WTPERNYJ.js +0 -2
  87. package/dist/wiki-XQMJ2FPU.js +0 -2
  88. /package/dist/{App-TDUUFVDV.js.map → App-QVNQ5BQK.js.map} +0 -0
  89. /package/dist/{ChatApp-IOWDXM3R.js.map → ChatApp-CC57XC23.js.map} +0 -0
  90. /package/dist/{agent-KRLAT3YJ.js.map → agent-ILH6ANOM.js.map} +0 -0
  91. /package/dist/{chunk-ZWGRRFJI.js.map → chunk-2KQTE4XI.js.map} +0 -0
  92. /package/dist/{chunk-A6IV2VQY.js.map → chunk-6HAZ6YWI.js.map} +0 -0
  93. /package/dist/{chunk-HHY3MSMN.js.map → chunk-CAA546XN.js.map} +0 -0
  94. /package/dist/{chunk-X5K3HR4V.js.map → chunk-F7WY24UZ.js.map} +0 -0
  95. /package/dist/{chunk-7WDJW37G.js.map → chunk-GUJB53QU.js.map} +0 -0
  96. /package/dist/{chunk-FDYGTQVW.js.map → chunk-H2TWRZC2.js.map} +0 -0
  97. /package/dist/{chunk-F2PEUQW4.js.map → chunk-JQR3NTHI.js.map} +0 -0
  98. /package/dist/{chunk-4BNQSUWV.js.map → chunk-KAFO5QZR.js.map} +0 -0
  99. /package/dist/{chunk-ZQSB6IX4.js.map → chunk-KFALP5NO.js.map} +0 -0
  100. /package/dist/{chunk-2BRX2EMT.js.map → chunk-PSDCRZZM.js.map} +0 -0
  101. /package/dist/{chunk-BVRUDRCM.js.map → chunk-QP6XNTBB.js.map} +0 -0
  102. /package/dist/{chunk-AVJRATR5.js.map → chunk-ROCUOXCW.js.map} +0 -0
  103. /package/dist/{chunk-WW6KNRIR.js.map → chunk-VMS3HVTT.js.map} +0 -0
  104. /package/dist/{chunk-5KCOH5FQ.js.map → chunk-WDQ3BPFS.js.map} +0 -0
  105. /package/dist/{chunk-ZN7637EF.js.map → chunk-XZTR5MBJ.js.map} +0 -0
  106. /package/dist/{client-PC7OEKSK.js.map → client-I7GAAM3T.js.map} +0 -0
  107. /package/dist/{config-I4GWI22T.js.map → config-TVW7UCKG.js.map} +0 -0
  108. /package/dist/{config-mutator-3RFKH3OV.js.map → config-mutator-JHM53P5A.js.map} +0 -0
  109. /package/dist/{doctor-OG6DK52Y.js.map → doctor-CXFMV6PT.js.map} +0 -0
  110. /package/dist/{processes-CMTMB7LG.js.map → processes-NNXSRQSV.js.map} +0 -0
  111. /package/dist/{program-RFAHI4SS.js.map → program-UXJWH5JG.js.map} +0 -0
  112. /package/dist/{promote-EDEG2HQR.js.map → promote-4T64VW5K.js.map} +0 -0
  113. /package/dist/{query-P5LMGXVS.js.map → query-6IKL52WT.js.map} +0 -0
  114. /package/dist/{registry-GJLY5J5E.js.map → registry-E4QUXHMQ.js.map} +0 -0
  115. /package/dist/{request-planner-JDBXFNQ4.js.map → request-planner-BRLDCYU5.js.map} +0 -0
  116. /package/dist/{review-candidates-EBP5CFOB.js.map → review-candidates-QWW5PDUU.js.map} +0 -0
  117. /package/dist/{routing-Q2EOZ3VW.js.map → routing-DP6S7OJL.js.map} +0 -0
  118. /package/dist/{schedule-tool-N2Z5E6AR.js.map → schedule-tool-TPJ6GR47.js.map} +0 -0
  119. /package/dist/{scheduler-WTPERNYJ.js.map → scheduler-7QPG6OTY.js.map} +0 -0
  120. /package/dist/{seat-LV3STEXI.js.map → seat-3KUNRM5Z.js.map} +0 -0
  121. /package/dist/{select-5NHY4T5A.js.map → select-ILXHYJGD.js.map} +0 -0
  122. /package/dist/{tool-2RKPJWDG.js.map → tool-SF3BCY55.js.map} +0 -0
  123. /package/dist/{wiki-XQMJ2FPU.js.map → wiki-WETANN3W.js.map} +0 -0
package/dist/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{a as n}from"./chunk-JWLTI6NZ.js";import"./chunk-ZQSB6IX4.js";import"./chunk-WUDXUY7H.js";import"./chunk-Z3IP66SL.js";import"./chunk-4BNQSUWV.js";import"./chunk-HHY3MSMN.js";import"./chunk-RKPAVWXF.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-RP7GLXOA.js";import"./chunk-KH6L7GDO.js";import"./chunk-BVRUDRCM.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-FULEQYM6.js";import"./chunk-5KCOH5FQ.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-L53FTKEP.js";import"./chunk-ZKDWQJVS.js";import"./chunk-JUJ3TCOE.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.js";import"./chunk-2BRX2EMT.js";import"./chunk-SFQUP3BP.js";import"./chunk-X5K3HR4V.js";import"./chunk-JY7POTMB.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-WW6KNRIR.js";import"./chunk-FDYGTQVW.js";import"./chunk-DWADWDMU.js";import"./chunk-WKTFP3SK.js";import"./chunk-HRBKSZ34.js";import"./chunk-VWTBHLMX.js";import"./chunk-ZN7637EF.js";import"./chunk-AVJRATR5.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-A6IV2VQY.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-F2PEUQW4.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-VDMYBPYB.js";import"./chunk-DSYKYZMT.js";import"./chunk-XSFXAJDA.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";var r=["SIGINT","SIGTERM"];function o(t=process){for(let i of r)t.on(i,()=>{t.listenerCount(i)<=1&&t.exit(0)})}o();async function s(){let t=await n();if(process.argv.slice(2).length===0){t.outputHelp();return}t.parse()}s();
2
+ import{a as n}from"./chunk-UL4E2CV4.js";import"./chunk-KFALP5NO.js";import"./chunk-BNVF66YL.js";import"./chunk-Z3IP66SL.js";import"./chunk-KAFO5QZR.js";import"./chunk-CAA546XN.js";import"./chunk-RKPAVWXF.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-NTG5ZXRI.js";import"./chunk-YE2BUU3Z.js";import"./chunk-QP6XNTBB.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-S7CVSKOX.js";import"./chunk-WDQ3BPFS.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-L53FTKEP.js";import"./chunk-YEV6W34S.js";import"./chunk-U67EG5IF.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.js";import"./chunk-PSDCRZZM.js";import"./chunk-SFQUP3BP.js";import"./chunk-F7WY24UZ.js";import"./chunk-V7XZN3MQ.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-VMS3HVTT.js";import"./chunk-H2TWRZC2.js";import"./chunk-DWADWDMU.js";import"./chunk-WKTFP3SK.js";import"./chunk-HRBKSZ34.js";import"./chunk-VWTBHLMX.js";import"./chunk-XZTR5MBJ.js";import"./chunk-ROCUOXCW.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-6HAZ6YWI.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-VDMYBPYB.js";import"./chunk-DSYKYZMT.js";import"./chunk-SRCXUZM2.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";var r=["SIGINT","SIGTERM"];function o(t=process){for(let i of r)t.on(i,()=>{t.listenerCount(i)<=1&&t.exit(0)})}o();async function s(){let t=await n();if(process.argv.slice(2).length===0){t.outputHelp();return}t.parse()}s();
3
3
  //# sourceMappingURL=cli.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e,f,g}from"./chunk-KFALP5NO.js";import"./chunk-SRCXUZM2.js";import"./chunk-QIJLFPWE.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-I7GAAM3T.js.map
@@ -1,2 +1,2 @@
1
- import{i as a,j as b,k as c,l as d,m as e,n as f,p as g}from"./chunk-XSFXAJDA.js";import"./chunk-QIJLFPWE.js";g();export{a as INTEGRATION_KINDS,b as approvalsConfigSchema,c as daemonConfigSchema,d as expandEnvVars,e as loadDaemonConfig,f as validateWorkspaces};
2
- //# sourceMappingURL=config-I4GWI22T.js.map
1
+ import{i as a,j as b,k as c,l as d,m as e,n as f,p as g}from"./chunk-SRCXUZM2.js";import"./chunk-QIJLFPWE.js";g();export{a as INTEGRATION_KINDS,b as approvalsConfigSchema,c as daemonConfigSchema,d as expandEnvVars,e as loadDaemonConfig,f as validateWorkspaces};
2
+ //# sourceMappingURL=config-TVW7UCKG.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e}from"./chunk-VMS3HVTT.js";import"./chunk-SRCXUZM2.js";import"./chunk-QIJLFPWE.js";export{b as applyConfigMutation,a as findConfigPath,d as getAtPath,c as setAtPath,e as unsetAtPath};
2
+ //# sourceMappingURL=config-mutator-JHM53P5A.js.map
@@ -0,0 +1,2 @@
1
+ import{b as a,c as b,d as c}from"./chunk-CAA546XN.js";import"./chunk-S7CVSKOX.js";import"./chunk-SRCXUZM2.js";import"./chunk-QIJLFPWE.js";export{b as doctor,a as runDoctorChecks,c as runNotificationChecks};
2
+ //# sourceMappingURL=doctor-CXFMV6PT.js.map
package/dist/index.d.ts CHANGED
@@ -3964,6 +3964,15 @@ declare const daemonConfigSchema: z.ZodObject<{
3964
3964
  windowMinutes?: number | undefined;
3965
3965
  } | undefined;
3966
3966
  }>>;
3967
+ /** The in-process event bus (src/events). `ringSize` bounds how many
3968
+ * recent events GET /events/recent can return. */
3969
+ events: z.ZodDefault<z.ZodObject<{
3970
+ ringSize: z.ZodDefault<z.ZodNumber>;
3971
+ }, "strip", z.ZodTypeAny, {
3972
+ ringSize: number;
3973
+ }, {
3974
+ ringSize?: number | undefined;
3975
+ }>>;
3967
3976
  screen: z.ZodDefault<z.ZodObject<{
3968
3977
  /** Pixel budget for a captured frame; larger captures are downscaled. */
3969
3978
  maxPixels: z.ZodDefault<z.ZodNumber>;
@@ -5821,6 +5830,9 @@ declare const daemonConfigSchema: z.ZodObject<{
5821
5830
  } | undefined;
5822
5831
  };
5823
5832
  };
5833
+ events: {
5834
+ ringSize: number;
5835
+ };
5824
5836
  meshVoices: Record<string, {
5825
5837
  system?: string | Record<string, string> | undefined;
5826
5838
  provider?: "system" | "elevenlabs" | undefined;
@@ -6418,6 +6430,9 @@ declare const daemonConfigSchema: z.ZodObject<{
6418
6430
  } | undefined;
6419
6431
  } | undefined;
6420
6432
  } | undefined;
6433
+ events?: {
6434
+ ringSize?: number | undefined;
6435
+ } | undefined;
6421
6436
  meshVoices?: Record<string, {
6422
6437
  system?: string | Record<string, string> | undefined;
6423
6438
  provider?: "system" | "elevenlabs" | undefined;
@@ -6674,6 +6689,36 @@ declare function loadDaemonConfig(configPath?: string): DaemonConfig;
6674
6689
  */
6675
6690
  declare function validateWorkspaces(config: DaemonConfig): string[];
6676
6691
 
6692
+ interface EventEnvelope {
6693
+ id: string;
6694
+ /** The entry point this event descends from (inbound message, cron fire,
6695
+ * webhook, mesh task). Events with no known entry point are their own
6696
+ * root. Carried across mesh forwards so peers share it. */
6697
+ rootId: string;
6698
+ /** The event that directly caused this one, when known (for example the
6699
+ * mesh forward on the sending node). */
6700
+ parentId?: string;
6701
+ /** Node that published the event. */
6702
+ node: string;
6703
+ agentId?: string;
6704
+ /** Coarse family: message, agent, run, task, signal, mesh, channel, status. */
6705
+ kind: string;
6706
+ /** Specific event within the family, for example "task:started" or "failed". */
6707
+ type: string;
6708
+ at: string;
6709
+ /** Human-readable, at most SUMMARY_MAX characters. */
6710
+ summary: string;
6711
+ /** Pointer to the durable record: a trace id, run id or task id. */
6712
+ ref?: string;
6713
+ }
6714
+ interface RecentQuery {
6715
+ /** An event id (returns events after it) or an ISO timestamp. */
6716
+ since?: string;
6717
+ kind?: string;
6718
+ agent?: string;
6719
+ limit?: number;
6720
+ }
6721
+
6677
6722
  interface PeerState {
6678
6723
  peer: MeshPeer;
6679
6724
  client: A2AClient;
@@ -6868,6 +6913,203 @@ declare class A2AMesh {
6868
6913
  }>;
6869
6914
  }
6870
6915
 
6916
+ /**
6917
+ * Lifecycle events the daemon emits. Keep this list narrow and stable
6918
+ * — every event becomes a public contract once a subscriber depends on
6919
+ * it. Add events sparingly and never remove or rename without a major
6920
+ * version bump.
6921
+ */
6922
+ interface AgentXEvents {
6923
+ /** Inbound message arrived at the router and was matched to an agent.
6924
+ * Fired AFTER the routing pipeline produces a `match` decision. Drops
6925
+ * fire `message:dropped` instead. */
6926
+ "message:matched": {
6927
+ channel: string;
6928
+ chatId: string;
6929
+ msgId: string;
6930
+ accountId?: string;
6931
+ agentId: string;
6932
+ decidingStage: string;
6933
+ at: string;
6934
+ };
6935
+ /** Inbound message dropped by the routing pipeline. */
6936
+ "message:dropped": {
6937
+ channel: string;
6938
+ chatId: string;
6939
+ msgId: string;
6940
+ accountId?: string;
6941
+ decidingStage: string;
6942
+ reason: string;
6943
+ at: string;
6944
+ };
6945
+ /** A task is about to be dispatched to the agent runtime.
6946
+ *
6947
+ * taskId is the ULID for the per-execution trace
6948
+ * (src/storage/traces.ts). Emitters generate it BEFORE firing this
6949
+ * event so it can also be threaded into the runtime call chain;
6950
+ * the SQLite subscriber uses it to open the trace row, and the
6951
+ * streaming parser uses it to record per-step tool_use/tool_result
6952
+ * rows. Optional for backward compatibility — emitters that haven't
6953
+ * been updated still produce a valid event and the subscriber
6954
+ * falls back to allocating its own id. */
6955
+ "task:started": {
6956
+ agentId: string;
6957
+ channel: string;
6958
+ chatId: string;
6959
+ messagePreview: string;
6960
+ /** Full untruncated message — used by SQLite subscriber to populate
6961
+ * task_traces.original_message so `agentx trace replay <taskId>` can
6962
+ * re-fire the exact original task. Optional for back-compat with
6963
+ * older emitters that only carried the preview. */
6964
+ fullMessage?: string;
6965
+ at: string;
6966
+ taskId?: string;
6967
+ /** Resume after restart (#103): how to re-enter the run (JSON), its
6968
+ * attempt number, and the cut-off run it continues. */
6969
+ resumeOrigin?: string | null;
6970
+ resumeAttempt?: number;
6971
+ resumedFrom?: string;
6972
+ };
6973
+ /** A single step inside an in-flight task — typically a tool call or
6974
+ * tool result inside the Claude streaming response. Producer is the
6975
+ * per-event callback inside registry.execute's streaming path; the
6976
+ * SQLite subscriber persists each step into task_trace_steps under
6977
+ * the task's ULID. inputSummary / outputSummary are caller-byte-
6978
+ * capped (typically 8KB) so a runaway tool result can't blow up the
6979
+ * bus payload or DB row size.
6980
+ *
6981
+ * Conventional `name` values: "tool_use" | "tool_result" |
6982
+ * "llm_message" | "session_rotation" | "error" | "preflight". Free-
6983
+ * form strings are accepted to let future capture sites extend
6984
+ * without a schema bump. */
6985
+ "task:step": {
6986
+ taskId: string;
6987
+ agentId: string;
6988
+ name: string;
6989
+ action?: string;
6990
+ status?: "ok" | "error" | "in-flight";
6991
+ inputSummary?: string;
6992
+ outputSummary?: string;
6993
+ error?: string;
6994
+ ms?: number;
6995
+ at: string;
6996
+ };
6997
+ /** Task finished — success or failure. Includes usage so subscribers
6998
+ * can write to billing, sqlite, or analytics without re-querying.
6999
+ *
7000
+ * Tier-2 fields hold the portion of THIS task's tokens that fell into
7001
+ * the "above-threshold" pricing tier (decided at record time by
7002
+ * TokenTracker; see usage_daily v5 in src/storage/sqlite.ts). They are
7003
+ * optional and additive — emitters that don't compute the split simply
7004
+ * omit them and subscribers treat the missing values as 0. */
7005
+ "task:completed": {
7006
+ /** Trace ULID — when present, lets subscribers finalize the exact
7007
+ * trace row that the matching task:started opened, eliminating the
7008
+ * ambiguity when two tasks for the same (agent, channel, chatId)
7009
+ * overlap. Optional for backward compatibility; subscribers fall
7010
+ * back to a pending-map lookup when absent. */
7011
+ taskId?: string;
7012
+ agentId: string;
7013
+ channel: string;
7014
+ chatId: string;
7015
+ durationMs: number;
7016
+ error?: string;
7017
+ inputTokens?: number;
7018
+ outputTokens?: number;
7019
+ cacheReadTokens?: number;
7020
+ cacheCreateTokens?: number;
7021
+ tier2InputTokens?: number;
7022
+ tier2OutputTokens?: number;
7023
+ tier2CacheReadTokens?: number;
7024
+ tier2CacheCreateTokens?: number;
7025
+ /** Whether this turn continued a provider session, and which one. The
7026
+ * resume decision happens after task:started (staleness, rotation,
7027
+ * planner), so it can only be reported here. */
7028
+ resumed?: boolean;
7029
+ resumeSessionId?: string;
7030
+ /** Request-gate experiment arm when the gate was active. */
7031
+ jevArm?: "treatment" | "holdout";
7032
+ /** Runtime-reported turn count, when the runtime reports one. */
7033
+ numTurns?: number;
7034
+ /** Lessons injected into this turn's prompt (memory, procedures, wiki). */
7035
+ injectedContext?: {
7036
+ memory: string[];
7037
+ procedures: string[];
7038
+ wiki: boolean;
7039
+ };
7040
+ /** Agent's final reply text — recorded into task_traces.final_response
7041
+ * so `replay --diff` can show original vs current output side-by-side.
7042
+ * Optional for back-compat. */
7043
+ finalResponse?: string;
7044
+ /** Model the upstream API actually billed (claude-opus-4-7, gpt-5.5, …)
7045
+ * so per-agent / per-tier traffic is priced at its real rate instead
7046
+ * of the daemon-wide default. Producers prefer `response.billedModel`
7047
+ * (parsed from the runtime's reply) and fall back to the agent's
7048
+ * configured `model`. Subscribers fall back to the constant default
7049
+ * passed to attachSqliteSubscribers when this is absent. */
7050
+ billedModel?: string;
7051
+ at: string;
7052
+ };
7053
+ /** Claude session rotation fired (stale / max-turns / tier-2). */
7054
+ "session:rotated": {
7055
+ /** Trace ULID of the in-flight task at rotation time, when known.
7056
+ * When set, the rotation is recorded as a step on that trace. */
7057
+ taskId?: string;
7058
+ agentId: string;
7059
+ channel: string;
7060
+ chatId: string;
7061
+ reason: "stale" | "max-turns" | "tier-2" | "continuity";
7062
+ lastTurnInputTokens?: number;
7063
+ at: string;
7064
+ };
7065
+ }
7066
+ type EventName = keyof AgentXEvents;
7067
+ type Listener$1<E extends EventName> = (payload: AgentXEvents[E]) => void;
7068
+ /** Input to publish(). id, at, node and rootId are filled in when absent;
7069
+ * rootId comes from the current root context (see envelope.ts). `data`
7070
+ * is delivered to subscribers alongside the envelope but is never kept in
7071
+ * the ring buffer; the daemon's /events adapter uses it to keep its wire
7072
+ * shape. */
7073
+ interface PublishInput {
7074
+ kind: string;
7075
+ type: string;
7076
+ summary: string;
7077
+ agentId?: string;
7078
+ ref?: string;
7079
+ id?: string;
7080
+ at?: string;
7081
+ rootId?: string;
7082
+ parentId?: string;
7083
+ data?: Record<string, unknown>;
7084
+ }
7085
+ type EnvelopeListener = (e: EventEnvelope, data?: Record<string, unknown>) => void;
7086
+ /** The one in-process bus. Typed lifecycle events keep their names and
7087
+ * payloads for `on` subscribers; every event, typed or not, is also
7088
+ * published as an EventEnvelope to `subscribe` listeners and the ring. */
7089
+ declare class TypedEventBus {
7090
+ private inner;
7091
+ private envelopeListeners;
7092
+ private ring;
7093
+ private node;
7094
+ constructor();
7095
+ /** Set the publishing node name and ring size (daemon boot / reload). */
7096
+ configure(opts: {
7097
+ node?: string;
7098
+ ringSize?: number;
7099
+ }): this;
7100
+ on<E extends EventName>(event: E, listener: Listener$1<E>): this;
7101
+ off<E extends EventName>(event: E, listener: Listener$1<E>): this;
7102
+ emit<E extends EventName>(event: E, payload: AgentXEvents[E]): boolean;
7103
+ /** The single publish API. Returns the envelope as delivered. */
7104
+ publish(input: PublishInput): EventEnvelope;
7105
+ /** Receive every envelope. Returns an unsubscribe function. */
7106
+ subscribe(fn: EnvelopeListener): () => void;
7107
+ recent(q?: RecentQuery): EventEnvelope[];
7108
+ listenerCount<E extends EventName>(event: E): number;
7109
+ /** Test/dev helper — drop every subscriber and the ring. */
7110
+ removeAllListeners(): this;
7111
+ }
7112
+
6871
7113
  type EventKind = "run" | "task" | "signal" | "mesh" | "channel" | "status";
6872
7114
  interface BaseEvent {
6873
7115
  kind: EventKind;
@@ -6875,6 +7117,10 @@ interface BaseEvent {
6875
7117
  id: string;
6876
7118
  /** ISO-8601 emit time. */
6877
7119
  at: string;
7120
+ /** Entry point this event descends from (set by the bus). */
7121
+ rootId?: string;
7122
+ /** Node that published the event (set by the bus). */
7123
+ node?: string;
6878
7124
  }
6879
7125
  interface RunEvent extends BaseEvent {
6880
7126
  kind: "run";
@@ -6942,13 +7188,14 @@ interface SubscriptionFilter {
6942
7188
  runId?: string;
6943
7189
  }
6944
7190
  type Listener = (e: DaemonEvent) => void;
6945
- /** Simple in-memory publish/subscribe. No ordering guarantees beyond
6946
- * "subscribers see events in the order they were published". No
6947
- * durability. Listener callbacks are invoked synchronously; if a
6948
- * listener throws, the error is swallowed so a single bad subscriber
6949
- * can't break the fanout. */
7191
+ /** Filtered publish/subscribe over the process bus. Subscribers see events
7192
+ * in publish order; listener callbacks run synchronously and a throwing
7193
+ * listener cannot break the fanout. Pass the shared bus in production;
7194
+ * the default gives each instance a private one (tests). */
6950
7195
  declare class EventBus {
6951
- private listeners;
7196
+ private core;
7197
+ private count;
7198
+ constructor(core?: TypedEventBus);
6952
7199
  subscribe(filter: SubscriptionFilter, fn: Listener): () => void;
6953
7200
  /** Publish an event. The `id` and `at` fields are filled in if absent.
6954
7201
  * We deliberately accept a loose input shape — callers construct the
@@ -10744,7 +10991,10 @@ declare class MessageRouter {
10744
10991
  * no resolution to write).
10745
10992
  */
10746
10993
  private recordRouterDecisionInLedger;
10994
+ /** Each inbound message is an entry point: every event it causes
10995
+ * (routing, agent task, workflow run, mesh forward) shares one root id. */
10747
10996
  private handleMessage;
10997
+ private routeMessage;
10748
10998
  /** The actual processing body — split out so handleMessage can wrap it in
10749
10999
  * the inflight try/finally without drowning the happy path in indentation. */
10750
11000
  private processResolvedMessage;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{a as L}from"./chunk-Y57CULGE.js";import{a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,ia as bt,ja as Tt,ka as Mt}from"./chunk-RP7GLXOA.js";import"./chunk-KH6L7GDO.js";import"./chunk-BVRUDRCM.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-FULEQYM6.js";import"./chunk-5KCOH5FQ.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-L53FTKEP.js";import{N as yt,l as lt,m as ct,n as dt,o as mt,p as pt}from"./chunk-ZKDWQJVS.js";import"./chunk-JUJ3TCOE.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-2BRX2EMT.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-X5K3HR4V.js";import{m as ut}from"./chunk-JY7POTMB.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-WW6KNRIR.js";import"./chunk-FDYGTQVW.js";import"./chunk-DWADWDMU.js";import"./chunk-WKTFP3SK.js";import"./chunk-HRBKSZ34.js";import"./chunk-VWTBHLMX.js";import"./chunk-ZN7637EF.js";import{a as gt,b as ft,e as ht}from"./chunk-AVJRATR5.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-A6IV2VQY.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-F2PEUQW4.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.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{k as tt,m as st,n as ot,p as nt}from"./chunk-XSFXAJDA.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-Y57CULGE.js";import{a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,ia as bt,ja as Tt,ka as Mt}from"./chunk-NTG5ZXRI.js";import"./chunk-YE2BUU3Z.js";import"./chunk-QP6XNTBB.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-S7CVSKOX.js";import"./chunk-WDQ3BPFS.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-L53FTKEP.js";import{O as yt,l as lt,m as ct,n as dt,o as mt,p as pt}from"./chunk-YEV6W34S.js";import"./chunk-U67EG5IF.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-PSDCRZZM.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-F7WY24UZ.js";import{s as ut}from"./chunk-V7XZN3MQ.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-VMS3HVTT.js";import"./chunk-H2TWRZC2.js";import"./chunk-DWADWDMU.js";import"./chunk-WKTFP3SK.js";import"./chunk-HRBKSZ34.js";import"./chunk-VWTBHLMX.js";import"./chunk-XZTR5MBJ.js";import{a as gt,b as ft,e as ht}from"./chunk-ROCUOXCW.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-6HAZ6YWI.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.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{k as tt,m as st,n as ot,p as nt}from"./chunk-SRCXUZM2.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
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).
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-GUJB53QU.js";import"./chunk-KAFO5QZR.js";import"./chunk-LQRBGQIR.js";import"./chunk-QIJLFPWE.js";export{a as renderProcessesPage};
2
+ //# sourceMappingURL=processes-NNXSRQSV.js.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-UL4E2CV4.js";import"./chunk-KFALP5NO.js";import"./chunk-BNVF66YL.js";import"./chunk-Z3IP66SL.js";import"./chunk-KAFO5QZR.js";import"./chunk-CAA546XN.js";import"./chunk-RKPAVWXF.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-NTG5ZXRI.js";import"./chunk-YE2BUU3Z.js";import"./chunk-QP6XNTBB.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-S7CVSKOX.js";import"./chunk-WDQ3BPFS.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-L53FTKEP.js";import"./chunk-YEV6W34S.js";import"./chunk-U67EG5IF.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.js";import"./chunk-PSDCRZZM.js";import"./chunk-SFQUP3BP.js";import"./chunk-F7WY24UZ.js";import"./chunk-V7XZN3MQ.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-VMS3HVTT.js";import"./chunk-H2TWRZC2.js";import"./chunk-DWADWDMU.js";import"./chunk-WKTFP3SK.js";import"./chunk-HRBKSZ34.js";import"./chunk-VWTBHLMX.js";import"./chunk-XZTR5MBJ.js";import"./chunk-ROCUOXCW.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-6HAZ6YWI.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-VDMYBPYB.js";import"./chunk-DSYKYZMT.js";import"./chunk-SRCXUZM2.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as buildProgram};
2
+ //# sourceMappingURL=program-UXJWH5JG.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-5KCOH5FQ.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-DP7RTNDM.js";import"./chunk-AVJRATR5.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-TFVUOC2C.js";import"./chunk-F2PEUQW4.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-XSFXAJDA.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-EDEG2HQR.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-WDQ3BPFS.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-DP7RTNDM.js";import"./chunk-ROCUOXCW.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-TFVUOC2C.js";import"./chunk-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.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-4T64VW5K.js.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-6HAZ6YWI.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as agenticQuery};
2
+ //# sourceMappingURL=query-6IKL52WT.js.map
@@ -0,0 +1,2 @@
1
+ import{F as a,G as b,H as c,I as d,J as e,K as f,L as g,M as h,N as i,O as j}from"./chunk-YEV6W34S.js";import"./chunk-U67EG5IF.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.js";import"./chunk-V7XZN3MQ.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-VMS3HVTT.js";import"./chunk-H2TWRZC2.js";import"./chunk-DWADWDMU.js";import"./chunk-WKTFP3SK.js";import"./chunk-HRBKSZ34.js";import"./chunk-VWTBHLMX.js";import"./chunk-XZTR5MBJ.js";import"./chunk-ROCUOXCW.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-6HAZ6YWI.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-DSYKYZMT.js";import"./chunk-SRCXUZM2.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.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-E4QUXHMQ.js.map
@@ -1,2 +1,2 @@
1
- import{q as m,t as p,v as d,w as x}from"./chunk-F2PEUQW4.js";import{a as u,f}from"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-XSFXAJDA.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-JDBXFNQ4.js.map
1
+ import{q as m,t as p,v as d,w as x}from"./chunk-JQR3NTHI.js";import{a as u,f}from"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.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-BRLDCYU5.js.map
@@ -1,4 +1,4 @@
1
- import{b as I}from"./chunk-BVRUDRCM.js";import"./chunk-WP6KLXTP.js";import"./chunk-2GIDVZ4H.js";import"./chunk-F2PEUQW4.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-XSFXAJDA.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-QP6XNTBB.js";import"./chunk-WP6KLXTP.js";import"./chunk-2GIDVZ4H.js";import"./chunk-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.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-EBP5CFOB.js.map
4
+ //# sourceMappingURL=review-candidates-QWW5PDUU.js.map
@@ -1,2 +1,2 @@
1
- import{a,b}from"./chunk-FDYGTQVW.js";import"./chunk-F2PEUQW4.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-XSFXAJDA.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as cheapModelForEngine,b as routeTaskModel};
2
- //# sourceMappingURL=routing-Q2EOZ3VW.js.map
1
+ import{a,b}from"./chunk-H2TWRZC2.js";import"./chunk-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as cheapModelForEngine,b as routeTaskModel};
2
+ //# sourceMappingURL=routing-DP6S7OJL.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-2KQTE4XI.js";import"./chunk-RKPAVWXF.js";import"./chunk-F7WY24UZ.js";import"./chunk-V7XZN3MQ.js";import"./chunk-VMS3HVTT.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.js";import"./chunk-QIJLFPWE.js";export{b as resolveScheduleCaller,a as runScheduleTool};
2
+ //# sourceMappingURL=schedule-tool-TPJ6GR47.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-V7XZN3MQ.js";import"./chunk-VMS3HVTT.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.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-7QPG6OTY.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-F2PEUQW4.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-XSFXAJDA.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-LV3STEXI.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-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.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-3KUNRM5Z.js.map
@@ -1,2 +1,2 @@
1
- import{v as S,w}from"./chunk-F2PEUQW4.js";import{a as g,b as h,f as R}from"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import{d as f}from"./chunk-VDMYBPYB.js";import"./chunk-XSFXAJDA.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-5NHY4T5A.js.map
1
+ import{v as S,w}from"./chunk-JQR3NTHI.js";import{a as g,b as h,f as R}from"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import{d as f}from"./chunk-VDMYBPYB.js";import"./chunk-SRCXUZM2.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-ILXHYJGD.js.map
@@ -1,2 +1,2 @@
1
- import{b as p}from"./chunk-ZWGRRFJI.js";import"./chunk-RKPAVWXF.js";import"./chunk-X5K3HR4V.js";import"./chunk-JY7POTMB.js";import"./chunk-WW6KNRIR.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-XSFXAJDA.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-2RKPJWDG.js.map
1
+ import{b as p}from"./chunk-2KQTE4XI.js";import"./chunk-RKPAVWXF.js";import"./chunk-F7WY24UZ.js";import"./chunk-V7XZN3MQ.js";import"./chunk-VMS3HVTT.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.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-SF3BCY55.js.map
@@ -0,0 +1,2 @@
1
+ import"./chunk-VWTBHLMX.js";import{a as b}from"./chunk-XZTR5MBJ.js";import{e as a}from"./chunk-ROCUOXCW.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import{a as c}from"./chunk-6HAZ6YWI.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-JQR3NTHI.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-SRCXUZM2.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{b as WikiHub,a as WikiStore,c as agenticQuery};
2
+ //# sourceMappingURL=wiki-WETANN3W.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentix-cli",
3
- "version": "0.50.1",
3
+ "version": "0.52.0",
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": {