agentix-cli 0.46.2 → 0.47.1

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 (108) hide show
  1. package/dist/{App-QTUGMHG7.js → App-RZDJH6MK.js} +2 -2
  2. package/dist/{ChatApp-634FDG3W.js → ChatApp-6TXOFUDH.js} +2 -2
  3. package/dist/{agent-WT4RB5SO.js → agent-I6RXAEXG.js} +2 -2
  4. package/dist/{board-dashboard-IXCW2KIV.js → board-dashboard-4LAQOB74.js} +4 -4
  5. package/dist/{chunk-QJANPP4C.js → chunk-ANLKBCYH.js} +6 -6
  6. package/dist/{chunk-QJANPP4C.js.map → chunk-ANLKBCYH.js.map} +1 -1
  7. package/dist/{chunk-7A7RC3R4.js → chunk-BHPIAG3E.js} +2 -2
  8. package/dist/{chunk-RY2EULHS.js → chunk-BJWK7FPT.js} +2 -2
  9. package/dist/{chunk-6HMZ5TTM.js → chunk-BZLHS3VF.js} +2 -2
  10. package/dist/{chunk-QLTM3F7M.js → chunk-DJQA2CWD.js} +10 -10
  11. package/dist/{chunk-QLTM3F7M.js.map → chunk-DJQA2CWD.js.map} +1 -1
  12. package/dist/{chunk-V5FZJUK4.js → chunk-FNLGY4UV.js} +2 -2
  13. package/dist/{chunk-V5FZJUK4.js.map → chunk-FNLGY4UV.js.map} +1 -1
  14. package/dist/{chunk-LUSFRS7R.js → chunk-FQBPSL36.js} +2 -2
  15. package/dist/{chunk-HA6RYFST.js → chunk-FXGSSZAP.js} +2 -2
  16. package/dist/{chunk-NSYY5NCR.js → chunk-J63MRNXF.js} +2 -2
  17. package/dist/{chunk-SGFXE5FP.js → chunk-KTM7HSEB.js} +2 -2
  18. package/dist/chunk-LYOXXD4T.js +123 -0
  19. package/dist/chunk-LYOXXD4T.js.map +1 -0
  20. package/dist/{chunk-TNFOGJWZ.js → chunk-MDTKQZC6.js} +2 -2
  21. package/dist/{chunk-ICZPZYYR.js → chunk-NXJBAKBR.js} +2 -2
  22. package/dist/{chunk-WLVQDEOT.js → chunk-OSSI6R4K.js} +2 -2
  23. package/dist/{chunk-L3A2LVWC.js → chunk-QURVHYBP.js} +13 -13
  24. package/dist/{chunk-2TJ5L7CB.js → chunk-SFLF64Q3.js} +2 -2
  25. package/dist/{chunk-E6EW42EA.js → chunk-VHTFHGVW.js} +2 -2
  26. package/dist/{chunk-CTCOWVNL.js → chunk-VZDKE2EZ.js} +2 -2
  27. package/dist/{chunk-LGBBKLUO.js → chunk-W544ZCCO.js} +2 -2
  28. package/dist/chunk-WZGABQ72.js +59 -0
  29. package/dist/chunk-WZGABQ72.js.map +1 -0
  30. package/dist/chunk-XMRI32CY.js +160 -0
  31. package/dist/chunk-XMRI32CY.js.map +1 -0
  32. package/dist/{chunk-NWOGPKD7.js → chunk-XMWOV2D5.js} +2 -2
  33. package/dist/{chunk-5ZWNGD5D.js → chunk-YIXQDOPN.js} +130 -126
  34. package/dist/chunk-YIXQDOPN.js.map +1 -0
  35. package/dist/cli.js +1 -1
  36. package/dist/client-LAIP23IP.js +2 -0
  37. package/dist/config-OZ2OOKFA.js +2 -0
  38. package/dist/config-mutator-EUF7QQ4V.js +2 -0
  39. package/dist/doctor-PEE3F5TX.js +2 -0
  40. package/dist/index.d.ts +147 -6
  41. package/dist/index.js +1 -1
  42. package/dist/program-PMHQRD5E.js +2 -0
  43. package/dist/{promote-R6WVBMT7.js → promote-RNSGW4AJ.js} +2 -2
  44. package/dist/query-BOUVRUU4.js +2 -0
  45. package/dist/registry-GGU43EOI.js +2 -0
  46. package/dist/{request-planner-KYQCJDAW.js → request-planner-5354IOYM.js} +2 -2
  47. package/dist/{review-candidates-ROFQR6XE.js → review-candidates-UTWMO7UO.js} +2 -2
  48. package/dist/{routing-OC3QJI3W.js → routing-JGNWB6VJ.js} +2 -2
  49. package/dist/{schedule-tool-VQCNMBJF.js → schedule-tool-6SNLG2NA.js} +2 -2
  50. package/dist/scheduler-N25EAWF6.js +2 -0
  51. package/dist/{seat-3WT3VJC2.js → seat-STLDEYSO.js} +2 -2
  52. package/dist/{select-KPQWIC22.js → select-VP66P6XB.js} +2 -2
  53. package/dist/{surface-usage-UREILT2E.js → surface-usage-FM2ZHGYE.js} +2 -2
  54. package/dist/wiki-SKIIAVCU.js +2 -0
  55. package/package.json +1 -1
  56. package/dist/chunk-5ZWNGD5D.js.map +0 -1
  57. package/dist/chunk-7KED5NB2.js +0 -160
  58. package/dist/chunk-7KED5NB2.js.map +0 -1
  59. package/dist/chunk-BIFJSQB5.js +0 -123
  60. package/dist/chunk-BIFJSQB5.js.map +0 -1
  61. package/dist/chunk-VMDA2SX2.js +0 -43
  62. package/dist/chunk-VMDA2SX2.js.map +0 -1
  63. package/dist/client-NTC667CA.js +0 -2
  64. package/dist/config-5V444ZFW.js +0 -2
  65. package/dist/config-mutator-E6NQLFWR.js +0 -2
  66. package/dist/doctor-7Z4VLXC4.js +0 -2
  67. package/dist/program-AHTQMAKN.js +0 -2
  68. package/dist/query-6EMTLCHQ.js +0 -2
  69. package/dist/registry-FBWGWB5K.js +0 -2
  70. package/dist/scheduler-NRXPVG7P.js +0 -2
  71. package/dist/wiki-LGHX3WPI.js +0 -2
  72. /package/dist/{App-QTUGMHG7.js.map → App-RZDJH6MK.js.map} +0 -0
  73. /package/dist/{ChatApp-634FDG3W.js.map → ChatApp-6TXOFUDH.js.map} +0 -0
  74. /package/dist/{agent-WT4RB5SO.js.map → agent-I6RXAEXG.js.map} +0 -0
  75. /package/dist/{board-dashboard-IXCW2KIV.js.map → board-dashboard-4LAQOB74.js.map} +0 -0
  76. /package/dist/{chunk-7A7RC3R4.js.map → chunk-BHPIAG3E.js.map} +0 -0
  77. /package/dist/{chunk-RY2EULHS.js.map → chunk-BJWK7FPT.js.map} +0 -0
  78. /package/dist/{chunk-6HMZ5TTM.js.map → chunk-BZLHS3VF.js.map} +0 -0
  79. /package/dist/{chunk-LUSFRS7R.js.map → chunk-FQBPSL36.js.map} +0 -0
  80. /package/dist/{chunk-HA6RYFST.js.map → chunk-FXGSSZAP.js.map} +0 -0
  81. /package/dist/{chunk-NSYY5NCR.js.map → chunk-J63MRNXF.js.map} +0 -0
  82. /package/dist/{chunk-SGFXE5FP.js.map → chunk-KTM7HSEB.js.map} +0 -0
  83. /package/dist/{chunk-TNFOGJWZ.js.map → chunk-MDTKQZC6.js.map} +0 -0
  84. /package/dist/{chunk-ICZPZYYR.js.map → chunk-NXJBAKBR.js.map} +0 -0
  85. /package/dist/{chunk-WLVQDEOT.js.map → chunk-OSSI6R4K.js.map} +0 -0
  86. /package/dist/{chunk-L3A2LVWC.js.map → chunk-QURVHYBP.js.map} +0 -0
  87. /package/dist/{chunk-2TJ5L7CB.js.map → chunk-SFLF64Q3.js.map} +0 -0
  88. /package/dist/{chunk-E6EW42EA.js.map → chunk-VHTFHGVW.js.map} +0 -0
  89. /package/dist/{chunk-CTCOWVNL.js.map → chunk-VZDKE2EZ.js.map} +0 -0
  90. /package/dist/{chunk-LGBBKLUO.js.map → chunk-W544ZCCO.js.map} +0 -0
  91. /package/dist/{chunk-NWOGPKD7.js.map → chunk-XMWOV2D5.js.map} +0 -0
  92. /package/dist/{client-NTC667CA.js.map → client-LAIP23IP.js.map} +0 -0
  93. /package/dist/{config-5V444ZFW.js.map → config-OZ2OOKFA.js.map} +0 -0
  94. /package/dist/{config-mutator-E6NQLFWR.js.map → config-mutator-EUF7QQ4V.js.map} +0 -0
  95. /package/dist/{doctor-7Z4VLXC4.js.map → doctor-PEE3F5TX.js.map} +0 -0
  96. /package/dist/{program-AHTQMAKN.js.map → program-PMHQRD5E.js.map} +0 -0
  97. /package/dist/{promote-R6WVBMT7.js.map → promote-RNSGW4AJ.js.map} +0 -0
  98. /package/dist/{query-6EMTLCHQ.js.map → query-BOUVRUU4.js.map} +0 -0
  99. /package/dist/{registry-FBWGWB5K.js.map → registry-GGU43EOI.js.map} +0 -0
  100. /package/dist/{request-planner-KYQCJDAW.js.map → request-planner-5354IOYM.js.map} +0 -0
  101. /package/dist/{review-candidates-ROFQR6XE.js.map → review-candidates-UTWMO7UO.js.map} +0 -0
  102. /package/dist/{routing-OC3QJI3W.js.map → routing-JGNWB6VJ.js.map} +0 -0
  103. /package/dist/{schedule-tool-VQCNMBJF.js.map → schedule-tool-6SNLG2NA.js.map} +0 -0
  104. /package/dist/{scheduler-NRXPVG7P.js.map → scheduler-N25EAWF6.js.map} +0 -0
  105. /package/dist/{seat-3WT3VJC2.js.map → seat-STLDEYSO.js.map} +0 -0
  106. /package/dist/{select-KPQWIC22.js.map → select-VP66P6XB.js.map} +0 -0
  107. /package/dist/{surface-usage-UREILT2E.js.map → surface-usage-FM2ZHGYE.js.map} +0 -0
  108. /package/dist/{wiki-LGHX3WPI.js.map → wiki-SKIIAVCU.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-L3A2LVWC.js";import"./chunk-7A7RC3R4.js";import"./chunk-E6EW42EA.js";import"./chunk-2TJ5L7CB.js";import"./chunk-7CVJ4JOE.js";import"./chunk-LGBBKLUO.js";import"./chunk-WLVQDEOT.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-5ZWNGD5D.js";import"./chunk-LUSFRS7R.js";import"./chunk-V5FZJUK4.js";import"./chunk-V7FYSZSV.js";import"./chunk-ZVP6GB4G.js";import"./chunk-7L6M3P2N.js";import"./chunk-CTCOWVNL.js";import"./chunk-3SCPRYJB.js";import"./chunk-FRHSQVFN.js";import"./chunk-L53FTKEP.js";import"./chunk-7KED5NB2.js";import"./chunk-HA6RYFST.js";import"./chunk-QLTM3F7M.js";import"./chunk-VMDA2SX2.js";import"./chunk-DP7RTNDM.js";import"./chunk-NWOGPKD7.js";import"./chunk-SFQUP3BP.js";import"./chunk-BIFJSQB5.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-NSYY5NCR.js";import"./chunk-ICZPZYYR.js";import"./chunk-DWADWDMU.js";import"./chunk-CQR6C5FU.js";import"./chunk-VWTBHLMX.js";import"./chunk-RY2EULHS.js";import"./chunk-SGFXE5FP.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-TNFOGJWZ.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import"./chunk-6HMZ5TTM.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-VDMYBPYB.js";import"./chunk-DSYKYZMT.js";import"./chunk-QJANPP4C.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.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-QURVHYBP.js";import"./chunk-BHPIAG3E.js";import"./chunk-VHTFHGVW.js";import"./chunk-SFLF64Q3.js";import"./chunk-7CVJ4JOE.js";import"./chunk-W544ZCCO.js";import"./chunk-OSSI6R4K.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-YIXQDOPN.js";import"./chunk-FQBPSL36.js";import"./chunk-FNLGY4UV.js";import"./chunk-V7FYSZSV.js";import"./chunk-ZVP6GB4G.js";import"./chunk-7L6M3P2N.js";import"./chunk-VZDKE2EZ.js";import"./chunk-3SCPRYJB.js";import"./chunk-FRHSQVFN.js";import"./chunk-L53FTKEP.js";import"./chunk-XMRI32CY.js";import"./chunk-FXGSSZAP.js";import"./chunk-DJQA2CWD.js";import"./chunk-WZGABQ72.js";import"./chunk-DP7RTNDM.js";import"./chunk-XMWOV2D5.js";import"./chunk-SFQUP3BP.js";import"./chunk-LYOXXD4T.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-J63MRNXF.js";import"./chunk-NXJBAKBR.js";import"./chunk-DWADWDMU.js";import"./chunk-CQR6C5FU.js";import"./chunk-VWTBHLMX.js";import"./chunk-BJWK7FPT.js";import"./chunk-KTM7HSEB.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-MDTKQZC6.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import"./chunk-BZLHS3VF.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-VDMYBPYB.js";import"./chunk-DSYKYZMT.js";import"./chunk-ANLKBCYH.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.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-BHPIAG3E.js";import"./chunk-ANLKBCYH.js";import"./chunk-FIOB3MEX.js";export{b as fetchAgents,d as fetchCrons,c as fetchProcesses,e as killProcess,a as resolveConn,f as sendTask,g as streamTask};
2
+ //# sourceMappingURL=client-LAIP23IP.js.map
@@ -0,0 +1,2 @@
1
+ import{i as a,j as b,k as c,l as d,m as e,o as f}from"./chunk-ANLKBCYH.js";import"./chunk-FIOB3MEX.js";f();export{a as INTEGRATION_KINDS,b as daemonConfigSchema,c as expandEnvVars,d as loadDaemonConfig,e as validateWorkspaces};
2
+ //# sourceMappingURL=config-OZ2OOKFA.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e}from"./chunk-J63MRNXF.js";import"./chunk-ANLKBCYH.js";import"./chunk-FIOB3MEX.js";export{b as applyConfigMutation,a as findConfigPath,d as getAtPath,c as setAtPath,e as unsetAtPath};
2
+ //# sourceMappingURL=config-mutator-EUF7QQ4V.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-W544ZCCO.js";import"./chunk-7L6M3P2N.js";import"./chunk-ANLKBCYH.js";import"./chunk-FIOB3MEX.js";export{b as doctor,a as runDoctorChecks};
2
+ //# sourceMappingURL=doctor-PEE3F5TX.js.map
package/dist/index.d.ts CHANGED
@@ -3828,6 +3828,54 @@ declare const daemonConfigSchema: z.ZodObject<{
3828
3828
  accountId?: string | undefined;
3829
3829
  } | undefined;
3830
3830
  }>>;
3831
+ /** What happens to runs a restart cuts off (agents/resume). Chat messages
3832
+ * are resumed in their chat; scheduled jobs never are (the next run
3833
+ * covers them); everything else is reported unless its channel is in
3834
+ * directChannels. */
3835
+ resume: z.ZodDefault<z.ZodObject<{
3836
+ enabled: z.ZodDefault<z.ZodBoolean>;
3837
+ /** Older runs are reported, not resumed. */
3838
+ maxAgeMinutes: z.ZodDefault<z.ZodNumber>;
3839
+ /** A run cut off while resuming is not retried past this. */
3840
+ maxAttempts: z.ZodDefault<z.ZodNumber>;
3841
+ /** Channels whose runs are only reported, even from a chat. */
3842
+ reportOnlyChannels: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
3843
+ /** Non-chat runs (voice, agent-to-agent, webhooks…) resumed on these
3844
+ * channels. Their answer isn't delivered anywhere; opt in only for
3845
+ * runs whose work is the point. */
3846
+ directChannels: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
3847
+ /** This many restarts within the window pauses resuming. */
3848
+ crashLoop: z.ZodDefault<z.ZodObject<{
3849
+ restarts: z.ZodDefault<z.ZodNumber>;
3850
+ windowMinutes: z.ZodDefault<z.ZodNumber>;
3851
+ }, "strip", z.ZodTypeAny, {
3852
+ restarts: number;
3853
+ windowMinutes: number;
3854
+ }, {
3855
+ restarts?: number | undefined;
3856
+ windowMinutes?: number | undefined;
3857
+ }>>;
3858
+ }, "strip", z.ZodTypeAny, {
3859
+ enabled: boolean;
3860
+ maxAgeMinutes: number;
3861
+ maxAttempts: number;
3862
+ reportOnlyChannels: string[];
3863
+ directChannels: string[];
3864
+ crashLoop: {
3865
+ restarts: number;
3866
+ windowMinutes: number;
3867
+ };
3868
+ }, {
3869
+ enabled?: boolean | undefined;
3870
+ maxAgeMinutes?: number | undefined;
3871
+ maxAttempts?: number | undefined;
3872
+ reportOnlyChannels?: string[] | undefined;
3873
+ directChannels?: string[] | undefined;
3874
+ crashLoop?: {
3875
+ restarts?: number | undefined;
3876
+ windowMinutes?: number | undefined;
3877
+ } | undefined;
3878
+ }>>;
3831
3879
  mesh: z.ZodDefault<z.ZodObject<{
3832
3880
  enabled: z.ZodDefault<z.ZodBoolean>;
3833
3881
  peers: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -5314,6 +5362,17 @@ declare const daemonConfigSchema: z.ZodObject<{
5314
5362
  allowActions?: boolean | undefined;
5315
5363
  } | undefined;
5316
5364
  }>;
5365
+ resume: {
5366
+ enabled: boolean;
5367
+ maxAgeMinutes: number;
5368
+ maxAttempts: number;
5369
+ reportOnlyChannels: string[];
5370
+ directChannels: string[];
5371
+ crashLoop: {
5372
+ restarts: number;
5373
+ windowMinutes: number;
5374
+ };
5375
+ };
5317
5376
  mesh: {
5318
5377
  enabled: boolean;
5319
5378
  peers: {
@@ -5869,6 +5928,17 @@ declare const daemonConfigSchema: z.ZodObject<{
5869
5928
  allowActions?: boolean | undefined;
5870
5929
  } | undefined;
5871
5930
  }> | undefined;
5931
+ resume?: {
5932
+ enabled?: boolean | undefined;
5933
+ maxAgeMinutes?: number | undefined;
5934
+ maxAttempts?: number | undefined;
5935
+ reportOnlyChannels?: string[] | undefined;
5936
+ directChannels?: string[] | undefined;
5937
+ crashLoop?: {
5938
+ restarts?: number | undefined;
5939
+ windowMinutes?: number | undefined;
5940
+ } | undefined;
5941
+ } | undefined;
5872
5942
  mesh?: {
5873
5943
  enabled?: boolean | undefined;
5874
5944
  peers?: {
@@ -6705,6 +6775,11 @@ declare class AgentXDaemon {
6705
6775
  private midnightTimer?;
6706
6776
  /** Set on the first stop signal: new work is refused while tasks drain. */
6707
6777
  private shuttingDown;
6778
+ /** Runs the previous daemon left in flight (agents/resume). */
6779
+ private interruptedRuns;
6780
+ private bootTimes;
6781
+ /** Resume, report or skip each run the last restart cut off. Never throws. */
6782
+ private resumeInterruptedRuns;
6708
6783
  /**
6709
6784
  * Watch agentx.json for external edits (e.g. `agentx config set ...`) and
6710
6785
  * reload cron jobs + in-memory config. Channels / agents / mesh changes
@@ -7023,6 +7098,21 @@ declare class TokenTracker {
7023
7098
  private save;
7024
7099
  }
7025
7100
 
7101
+ interface RouterOrigin {
7102
+ kind: "router";
7103
+ /** Channel adapter name. */
7104
+ adapter: string;
7105
+ /** The incoming message, as the router's inflight log stores it. */
7106
+ message: Record<string, unknown>;
7107
+ }
7108
+ interface DirectOrigin {
7109
+ kind: "direct";
7110
+ context?: Record<string, unknown>;
7111
+ model?: string;
7112
+ autonomy?: string;
7113
+ }
7114
+ type RunOrigin = RouterOrigin | DirectOrigin;
7115
+
7026
7116
  interface FriendlyError {
7027
7117
  /** One-line, operator-facing message suitable for a dashboard card or chat reply. */
7028
7118
  message: string;
@@ -7119,6 +7209,13 @@ interface IncomingMessage {
7119
7209
  * Carried alongside the path so per-project customisation applies
7120
7210
  * without the registry re-reading the rule. */
7121
7211
  runbookFiles?: string[];
7212
+ /** Set when this message re-runs one a restart cut off (agents/resume):
7213
+ * the note for the agent, the attempt number, and the run it continues. */
7214
+ resume?: {
7215
+ note: string;
7216
+ attempt: number;
7217
+ resumedFrom: string;
7218
+ };
7122
7219
  }
7123
7220
  interface OutgoingMessage {
7124
7221
  channel: string;
@@ -7259,6 +7356,12 @@ interface AgentTask {
7259
7356
  /** Called with `runningTaskId` as soon as the run starts. Never fires for
7260
7357
  * a message that was queued or dropped instead of run. */
7261
7358
  onStart?: (runningTaskId: string) => void;
7359
+ /** How to re-enter this run if a restart cuts it off (agents/resume).
7360
+ * Absent: recorded as a direct run with this task's context. */
7361
+ origin?: RunOrigin;
7362
+ /** Set on a run that resumes one cut off by a restart. */
7363
+ resumeAttempt?: number;
7364
+ resumedFrom?: string;
7262
7365
  /** Improvement plan #8 — when true, the dispatcher discards any
7263
7366
  * cached session for this (agent, channel, chatId) before
7264
7367
  * executing: the claudeSessionId is cleared (no --resume) and
@@ -8949,6 +9052,9 @@ interface RunningTask {
8949
9052
  sender?: string;
8950
9053
  /** Wall-clock start. */
8951
9054
  startedAt: Date;
9055
+ /** The step the run is in right now (classify, compact, agent, …). A run
9056
+ * that hangs shows here where it stopped. */
9057
+ step?: string;
8952
9058
  }
8953
9059
  type TaskOutputSubscriber = (chunk: string) => void;
8954
9060
  /** Persisted record of a finished task, written to .agentx/task-history. */
@@ -9032,6 +9138,9 @@ declare class AgentRegistry {
9032
9138
  * to drop the orphan cancelled turn from history so the Update reads as an
9033
9139
  * edit, not a bare follow-up. */
9034
9140
  private taskAborts;
9141
+ /** Idempotent cleanup per running task id, for runs that end before their
9142
+ * own `finally` can run. */
9143
+ private runReleases;
9035
9144
  /** Last completed task summary per agent — single-line blurb for the dashboard card. */
9036
9145
  private lastSummaries;
9037
9146
  /** 24-hour sparkline cache per agent — recomputed from disk at most once a minute. */
@@ -9290,12 +9399,7 @@ declare class AgentRegistry {
9290
9399
  totalInput: number;
9291
9400
  totalOutput: number;
9292
9401
  totalCacheRead: number;
9293
- totalCacheCreate: number; /** Workflow auto-runner — invoked when workflow matching is in `mode: "auto"`
9294
- * and a candidate workflow's confidence ≥ autoRunThreshold. Wired by the
9295
- * daemon after the workflow dispatcher is constructed. Returns the runId of
9296
- * the started workflow run; the workflow itself owns posting any reply via
9297
- * its `action.send` / `agent` nodes. Duck-typed to avoid a circular import
9298
- * on WorkflowDispatcher. */
9402
+ totalCacheCreate: number;
9299
9403
  cacheHitRatio: number;
9300
9404
  totalErrors: number;
9301
9405
  totalCost: number;
@@ -10182,6 +10286,37 @@ declare class BusinessLayer {
10182
10286
  summary(): string;
10183
10287
  }
10184
10288
 
10289
+ /** A run that was still going when the previous daemon stopped. */
10290
+ interface InterruptedRun {
10291
+ taskId: string;
10292
+ agentId: string;
10293
+ channel: string | null;
10294
+ chatId: string | null;
10295
+ workflowRunId: string | null;
10296
+ startedAt: number;
10297
+ originalMessage: string | null;
10298
+ resumeOrigin: string | null;
10299
+ resumeAttempt: number;
10300
+ /** Tool calls it had made, in order, for the resume note. */
10301
+ toolCalls: Array<{
10302
+ action: string | null;
10303
+ inputSummary: string | null;
10304
+ }>;
10305
+ }
10306
+
10307
+ interface Resumer {
10308
+ /** Re-enter the run with the note prepended. Resolves once the run has
10309
+ * been handed over, not when it finishes. */
10310
+ resume(input: {
10311
+ origin: RunOrigin;
10312
+ run: InterruptedRun;
10313
+ note: string;
10314
+ attempt: number;
10315
+ }): Promise<void>;
10316
+ /** One line to the chat the run came from. */
10317
+ tell?(origin: RunOrigin, text: string): Promise<void>;
10318
+ }
10319
+
10185
10320
  declare class MessageRouter {
10186
10321
  private registry;
10187
10322
  private config;
@@ -10310,6 +10445,9 @@ declare class MessageRouter {
10310
10445
  * previous process committed to handling but crashed before completing.
10311
10446
  */
10312
10447
  private replayInflight;
10448
+ /** Re-enter chat messages a restart cut off (agents/resume). The message
10449
+ * goes through the normal path, so its answer lands in the same chat. */
10450
+ createResumer(): Resumer;
10313
10451
  stopAll(): Promise<void>;
10314
10452
  /**
10315
10453
  * Returns true if this message id was processed within MESSAGE_ID_TTL_MS.
@@ -10886,6 +11024,9 @@ interface CronRunResult {
10886
11024
  /** Was this a retry attempt? */
10887
11025
  isRetry?: boolean;
10888
11026
  retryAttempt?: number;
11027
+ /** Hard deadline applied to an agent run, in seconds. Absent for command
11028
+ * jobs, whose `timeout` is the shell timeout. */
11029
+ timeout?: number;
10889
11030
  /** Started on demand via POST /routines/:id/fire, not by the schedule. */
10890
11031
  fired?: boolean;
10891
11032
  /** Dashboard task id of the agent run (RunningTask.id / TaskRecord.id),
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{a as L}from"./chunk-W5C2GDNC.js";import{Y as bt,Z as Tt,_ as Mt,a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt}from"./chunk-5ZWNGD5D.js";import"./chunk-LUSFRS7R.js";import"./chunk-V5FZJUK4.js";import"./chunk-V7FYSZSV.js";import"./chunk-ZVP6GB4G.js";import"./chunk-7L6M3P2N.js";import"./chunk-CTCOWVNL.js";import"./chunk-3SCPRYJB.js";import"./chunk-FRHSQVFN.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-7KED5NB2.js";import"./chunk-HA6RYFST.js";import"./chunk-QLTM3F7M.js";import"./chunk-VMDA2SX2.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-NWOGPKD7.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import{k as ut}from"./chunk-BIFJSQB5.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-NSYY5NCR.js";import"./chunk-ICZPZYYR.js";import"./chunk-DWADWDMU.js";import"./chunk-CQR6C5FU.js";import"./chunk-VWTBHLMX.js";import"./chunk-RY2EULHS.js";import{a as gt,b as ft,e as ht}from"./chunk-SGFXE5FP.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-TNFOGJWZ.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-6HMZ5TTM.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-QOYAX2FT.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-LCIREYTD.js";import{a as m,b as G}from"./chunk-L2WSPY6S.js";import{a as Fe,b as Le,c as A,d as De}from"./chunk-VDMYBPYB.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{j as tt,l as st,m as ot,o as nt}from"./chunk-QJANPP4C.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";W();G();import{execa as Rt}from"execa";import{existsSync as se,promises as X}from"fs";import S from"path";import ie from"node-fetch";async function Et(o,e){let t=o.split("/");if(t.length<2)throw new Error(`Invalid skill package ID: ${o}. Expected format: owner/repo`);let s=t[0],i=t[1],n=t[2];try{let a=n?`${s}/${i}/${n}`:`${s}/${i}`;await Rt("npx",["-y","skills","add",a],{cwd:e,stdio:"pipe"}),m.success(`Installed skill package: ${o}`);let r=S.resolve(e,".skills",`${s}_${i}`);if(se(r))return await ne(r,o);let d=S.resolve(e,".skills");return se(d)?await ne(d,o):[]}catch{return m.info(`Fetching skills directly from GitHub: ${s}/${i}`),await Gt(s,i,n,e)}}async function Gt(o,e,t,s){let i=[];try{let n=`https://api.github.com/repos/${o}/${e}/git/trees/main?recursive=1`,a=await ie(n);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let d=(await a.json()).tree.filter(p=>p.type==="blob"&&p.path.endsWith("SKILL.md"));if(t){let p=d.find(f=>f.path.includes(`/${t}/`)||f.path===`${t}/SKILL.md`);if(p){let f=await oe(o,e,p.path,s);f&&i.push(f)}}else for(let p of d){let f=await oe(o,e,p.path,s);f&&i.push(f)}}catch(n){m.error(`Failed to fetch skills from GitHub: ${n.message}`)}return i}async function oe(o,e,t,s){try{let i=`https://raw.githubusercontent.com/${o}/${e}/main/${t}`,n=await ie(i);if(!n.ok)return null;let a=await n.text(),r=A(a);if(r){r.source="remote",r.packageId=`${o}/${e}`;let d=S.dirname(t),p=S.resolve(s,".skills",`${o}_${e}`,d);await X.mkdir(p,{recursive:!0}),await X.writeFile(S.resolve(p,"SKILL.md"),a),r.path=S.resolve(p,"SKILL.md")}return r}catch{return null}}async function ne(o,e){let t=[],{default:s}=await import("fast-glob"),i=await s.glob("**/SKILL.md",{cwd:o,deep:5});for(let n of i)try{let a=S.resolve(o,n),r=await X.readFile(a,"utf8"),d=A(r);d&&(d.source="remote",d.path=a,d.packageId=e,t.push(d))}catch{}return t}async function At(o,e,t,s,i){let n=["---",`name: ${o}`,`description: ${e}`];if(s?.length){n.push("tags:");for(let a of s)n.push(` - ${a}`)}if(i?.length){n.push("globs:");for(let a of i)n.push(` - ${a}`)}return n.push("---"),`${n.join(`
1
+ import{a as L}from"./chunk-W5C2GDNC.js";import{Y as bt,Z as Tt,_ as Mt,a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt}from"./chunk-YIXQDOPN.js";import"./chunk-FQBPSL36.js";import"./chunk-FNLGY4UV.js";import"./chunk-V7FYSZSV.js";import"./chunk-ZVP6GB4G.js";import"./chunk-7L6M3P2N.js";import"./chunk-VZDKE2EZ.js";import"./chunk-3SCPRYJB.js";import"./chunk-FRHSQVFN.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-XMRI32CY.js";import"./chunk-FXGSSZAP.js";import"./chunk-DJQA2CWD.js";import"./chunk-WZGABQ72.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-XMWOV2D5.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import{m as ut}from"./chunk-LYOXXD4T.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-J63MRNXF.js";import"./chunk-NXJBAKBR.js";import"./chunk-DWADWDMU.js";import"./chunk-CQR6C5FU.js";import"./chunk-VWTBHLMX.js";import"./chunk-BJWK7FPT.js";import{a as gt,b as ft,e as ht}from"./chunk-KTM7HSEB.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-MDTKQZC6.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-BZLHS3VF.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-QOYAX2FT.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-LCIREYTD.js";import{a as m,b as G}from"./chunk-L2WSPY6S.js";import{a as Fe,b as Le,c as A,d as De}from"./chunk-VDMYBPYB.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{j as tt,l as st,m as ot,o as nt}from"./chunk-ANLKBCYH.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";W();G();import{execa as Rt}from"execa";import{existsSync as se,promises as X}from"fs";import S from"path";import ie from"node-fetch";async function Et(o,e){let t=o.split("/");if(t.length<2)throw new Error(`Invalid skill package ID: ${o}. Expected format: owner/repo`);let s=t[0],i=t[1],n=t[2];try{let a=n?`${s}/${i}/${n}`:`${s}/${i}`;await Rt("npx",["-y","skills","add",a],{cwd:e,stdio:"pipe"}),m.success(`Installed skill package: ${o}`);let r=S.resolve(e,".skills",`${s}_${i}`);if(se(r))return await ne(r,o);let d=S.resolve(e,".skills");return se(d)?await ne(d,o):[]}catch{return m.info(`Fetching skills directly from GitHub: ${s}/${i}`),await Gt(s,i,n,e)}}async function Gt(o,e,t,s){let i=[];try{let n=`https://api.github.com/repos/${o}/${e}/git/trees/main?recursive=1`,a=await ie(n);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let d=(await a.json()).tree.filter(p=>p.type==="blob"&&p.path.endsWith("SKILL.md"));if(t){let p=d.find(f=>f.path.includes(`/${t}/`)||f.path===`${t}/SKILL.md`);if(p){let f=await oe(o,e,p.path,s);f&&i.push(f)}}else for(let p of d){let f=await oe(o,e,p.path,s);f&&i.push(f)}}catch(n){m.error(`Failed to fetch skills from GitHub: ${n.message}`)}return i}async function oe(o,e,t,s){try{let i=`https://raw.githubusercontent.com/${o}/${e}/main/${t}`,n=await ie(i);if(!n.ok)return null;let a=await n.text(),r=A(a);if(r){r.source="remote",r.packageId=`${o}/${e}`;let d=S.dirname(t),p=S.resolve(s,".skills",`${o}_${e}`,d);await X.mkdir(p,{recursive:!0}),await X.writeFile(S.resolve(p,"SKILL.md"),a),r.path=S.resolve(p,"SKILL.md")}return r}catch{return null}}async function ne(o,e){let t=[],{default:s}=await import("fast-glob"),i=await s.glob("**/SKILL.md",{cwd:o,deep:5});for(let n of i)try{let a=S.resolve(o,n),r=await X.readFile(a,"utf8"),d=A(r);d&&(d.source="remote",d.path=a,d.packageId=e,t.push(d))}catch{}return t}async function At(o,e,t,s,i){let n=["---",`name: ${o}`,`description: ${e}`];if(s?.length){n.push("tags:");for(let a of s)n.push(` - ${a}`)}if(i?.length){n.push("globs:");for(let a of i)n.push(` - ${a}`)}return n.push("---"),`${n.join(`
2
2
  `)}
3
3
 
4
4
  ${t}`}async function It(o){let{loadLocalSkills:e}=await import("./loader-BOKE5M5S.js");return e(o)}async function Ot(o,e,t,s,i){let a=[{role:"system",content:`You are a skill author for the Agent Skills ecosystem (skills.sh).
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-QURVHYBP.js";import"./chunk-BHPIAG3E.js";import"./chunk-VHTFHGVW.js";import"./chunk-SFLF64Q3.js";import"./chunk-7CVJ4JOE.js";import"./chunk-W544ZCCO.js";import"./chunk-OSSI6R4K.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-YIXQDOPN.js";import"./chunk-FQBPSL36.js";import"./chunk-FNLGY4UV.js";import"./chunk-V7FYSZSV.js";import"./chunk-ZVP6GB4G.js";import"./chunk-7L6M3P2N.js";import"./chunk-VZDKE2EZ.js";import"./chunk-3SCPRYJB.js";import"./chunk-FRHSQVFN.js";import"./chunk-L53FTKEP.js";import"./chunk-XMRI32CY.js";import"./chunk-FXGSSZAP.js";import"./chunk-DJQA2CWD.js";import"./chunk-WZGABQ72.js";import"./chunk-DP7RTNDM.js";import"./chunk-XMWOV2D5.js";import"./chunk-SFQUP3BP.js";import"./chunk-LYOXXD4T.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-J63MRNXF.js";import"./chunk-NXJBAKBR.js";import"./chunk-DWADWDMU.js";import"./chunk-CQR6C5FU.js";import"./chunk-VWTBHLMX.js";import"./chunk-BJWK7FPT.js";import"./chunk-KTM7HSEB.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-MDTKQZC6.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import"./chunk-BZLHS3VF.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-VDMYBPYB.js";import"./chunk-DSYKYZMT.js";import"./chunk-ANLKBCYH.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{a as buildProgram};
2
+ //# sourceMappingURL=program-PMHQRD5E.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}from"./chunk-CTCOWVNL.js";import"./chunk-3SCPRYJB.js";import"./chunk-FRHSQVFN.js";import"./chunk-DP7RTNDM.js";import"./chunk-SGFXE5FP.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-AJ5RMU7X.js";import"./chunk-6HMZ5TTM.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-QJANPP4C.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{b as DEFAULT_PROMOTE_TYPES,a as PROMOTER_OWNER,c as PROMOTION_LEDGER_FILE,j as appendPromotionLedger,r as approveProposal,n as callPromotionLlm,p as estimateTokens,q 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,s as rejectProposal,o as runPromotion};
2
- //# sourceMappingURL=promote-R6WVBMT7.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}from"./chunk-VZDKE2EZ.js";import"./chunk-3SCPRYJB.js";import"./chunk-FRHSQVFN.js";import"./chunk-DP7RTNDM.js";import"./chunk-KTM7HSEB.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-AJ5RMU7X.js";import"./chunk-BZLHS3VF.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-ANLKBCYH.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{b as DEFAULT_PROMOTE_TYPES,a as PROMOTER_OWNER,c as PROMOTION_LEDGER_FILE,j as appendPromotionLedger,r as approveProposal,n as callPromotionLlm,p as estimateTokens,q 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,s as rejectProposal,o as runPromotion};
2
+ //# sourceMappingURL=promote-RNSGW4AJ.js.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-MDTKQZC6.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import"./chunk-BZLHS3VF.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-ANLKBCYH.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{a as agenticQuery};
2
+ //# sourceMappingURL=query-BOUVRUU4.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-XMRI32CY.js";import"./chunk-FXGSSZAP.js";import"./chunk-DJQA2CWD.js";import"./chunk-WZGABQ72.js";import"./chunk-DP7RTNDM.js";import"./chunk-LYOXXD4T.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-J63MRNXF.js";import"./chunk-NXJBAKBR.js";import"./chunk-DWADWDMU.js";import"./chunk-CQR6C5FU.js";import"./chunk-VWTBHLMX.js";import"./chunk-BJWK7FPT.js";import"./chunk-KTM7HSEB.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-MDTKQZC6.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import"./chunk-BZLHS3VF.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-DSYKYZMT.js";import"./chunk-ANLKBCYH.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{j as AgentRegistry,e as TRACE_STEP_SUMMARY_BYTES,c as buildEntryMeta,d as buildWikiContext,f as clipForTrace,i as emitTraceStepsFromStreamEvent,h as firstMissingRequiredTool,b as getGlobalRegistry,a as setGlobalRegistry,g as tallyToolUses};
2
+ //# sourceMappingURL=registry-GGU43EOI.js.map
@@ -1,2 +1,2 @@
1
- import{q as m,t as p,v as d,w as x}from"./chunk-6HMZ5TTM.js";import{a as u,f}from"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-QJANPP4C.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";x();f();var l="request-gate",h="request-context",g=.1;async function q(t,o,c,r=Math.random){let s=p(l)==="active";if(s){let i=m().seats[l]?.holdout??g;if(r()<i)return{active:!0,preprocess:!1,arm:"holdout"}}let a=s?"treatment":void 0,e=await d(l,{request:t.slice(0,2e3),agent:o,channel:c,operations:["select optional context","evaluate model routing where permitted"],constraints:["Keep the original request and mandatory instructions","Desktop model cannot be downgraded"]},{preprocess:u("This request benefits from structured context selection or another bounded typed decision before the main agent executes.",{true:"Relevant context must be selected, or a bounded routing decision can help. Follow-ups and ambiguous references need context.",false:"Typed preprocessing adds no useful decision; send the request to the configured main agent with existing context."})},{timeoutMs:3e3});if(!e||e.mode!=="active")return{active:!1,preprocess:!1,arm:a};let n=e.answers.preprocess?.noul;return{active:!0,preprocess:Number.isFinite(n)&&n>=.5,arm:a}}var v={landscape:"Agent directory and mesh overview",patternContext:"Learned behavioral patterns",references:"Retrieved project references",memoryContext:"Retrieved agent memory",crossChatContext:"Summaries from other conversations",longMemoryRecall:"Older conversation recall",wikiContext:"Retrieved wiki knowledge"};async function b(t){let o=Object.entries(v).flatMap(([e,n])=>{let i=t[e];return i?[{id:e,description:n,source:e,characters:i.length,preview:i.slice(0,400),trust:"context data, not instructions"}]:[]});if(!o.length)return{input:t,excluded:[]};let c=Object.fromEntries(o.map(e=>[e.id,u(`Context block ${e.id} is relevant to completing the current request correctly.`,{true:"Needed or potentially relevant; retain if uncertain or the preview is incomplete.",false:"Clearly unrelated to the current request; safe to omit."})])),r=await d(h,{request:t.message.slice(0,2e3),channel:t.channel,agent:t.agentId,mandatory:["request","identity","permissions and instructions","same-chat history","handover","attachments"],context:o},c,{timeoutMs:3e3});if(!r||r.mode!=="active")return{input:t,excluded:[]};let s={...t},a=[];for(let e of o){let n=r.answers[e.id]?.noul;Number.isFinite(n)&&n>=0&&n<.2&&(delete s[e.id],a.push(e.id))}return{input:s,excluded:a}}export{g as DEFAULT_REQUEST_GATE_HOLDOUT,h as REQUEST_CONTEXT_SEAT,l as REQUEST_GATE_SEAT,q as evaluateRequest,b as selectRequestContext};
2
- //# sourceMappingURL=request-planner-KYQCJDAW.js.map
1
+ import{q as m,t as p,v as d,w as x}from"./chunk-BZLHS3VF.js";import{a as u,f}from"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-ANLKBCYH.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";x();f();var l="request-gate",h="request-context",g=.1;async function q(t,o,c,r=Math.random){let s=p(l)==="active";if(s){let i=m().seats[l]?.holdout??g;if(r()<i)return{active:!0,preprocess:!1,arm:"holdout"}}let a=s?"treatment":void 0,e=await d(l,{request:t.slice(0,2e3),agent:o,channel:c,operations:["select optional context","evaluate model routing where permitted"],constraints:["Keep the original request and mandatory instructions","Desktop model cannot be downgraded"]},{preprocess:u("This request benefits from structured context selection or another bounded typed decision before the main agent executes.",{true:"Relevant context must be selected, or a bounded routing decision can help. Follow-ups and ambiguous references need context.",false:"Typed preprocessing adds no useful decision; send the request to the configured main agent with existing context."})},{timeoutMs:3e3});if(!e||e.mode!=="active")return{active:!1,preprocess:!1,arm:a};let n=e.answers.preprocess?.noul;return{active:!0,preprocess:Number.isFinite(n)&&n>=.5,arm:a}}var v={landscape:"Agent directory and mesh overview",patternContext:"Learned behavioral patterns",references:"Retrieved project references",memoryContext:"Retrieved agent memory",crossChatContext:"Summaries from other conversations",longMemoryRecall:"Older conversation recall",wikiContext:"Retrieved wiki knowledge"};async function b(t){let o=Object.entries(v).flatMap(([e,n])=>{let i=t[e];return i?[{id:e,description:n,source:e,characters:i.length,preview:i.slice(0,400),trust:"context data, not instructions"}]:[]});if(!o.length)return{input:t,excluded:[]};let c=Object.fromEntries(o.map(e=>[e.id,u(`Context block ${e.id} is relevant to completing the current request correctly.`,{true:"Needed or potentially relevant; retain if uncertain or the preview is incomplete.",false:"Clearly unrelated to the current request; safe to omit."})])),r=await d(h,{request:t.message.slice(0,2e3),channel:t.channel,agent:t.agentId,mandatory:["request","identity","permissions and instructions","same-chat history","handover","attachments"],context:o},c,{timeoutMs:3e3});if(!r||r.mode!=="active")return{input:t,excluded:[]};let s={...t},a=[];for(let e of o){let n=r.answers[e.id]?.noul;Number.isFinite(n)&&n>=0&&n<.2&&(delete s[e.id],a.push(e.id))}return{input:s,excluded:a}}export{g as DEFAULT_REQUEST_GATE_HOLDOUT,h as REQUEST_CONTEXT_SEAT,l as REQUEST_GATE_SEAT,q as evaluateRequest,b as selectRequestContext};
2
+ //# sourceMappingURL=request-planner-5354IOYM.js.map
@@ -1,4 +1,4 @@
1
- import{b as I}from"./chunk-V5FZJUK4.js";import"./chunk-VMDA2SX2.js";import"./chunk-2GIDVZ4H.js";import"./chunk-6HMZ5TTM.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-QJANPP4C.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.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-FNLGY4UV.js";import"./chunk-WZGABQ72.js";import"./chunk-2GIDVZ4H.js";import"./chunk-BZLHS3VF.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-ANLKBCYH.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.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-ROFQR6XE.js.map
4
+ //# sourceMappingURL=review-candidates-UTWMO7UO.js.map
@@ -1,2 +1,2 @@
1
- import{a,b}from"./chunk-ICZPZYYR.js";import"./chunk-6HMZ5TTM.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-QJANPP4C.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{a as cheapModelForEngine,b as routeTaskModel};
2
- //# sourceMappingURL=routing-OC3QJI3W.js.map
1
+ import{a,b}from"./chunk-NXJBAKBR.js";import"./chunk-BZLHS3VF.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-ANLKBCYH.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{a as cheapModelForEngine,b as routeTaskModel};
2
+ //# sourceMappingURL=routing-JGNWB6VJ.js.map
@@ -1,8 +1,8 @@
1
- import{a as D,b as _,c as q,d as O,e as R,f as B,h as b,i as S,j as E,k as w,l as y}from"./chunk-WLVQDEOT.js";import"./chunk-BIFJSQB5.js";import{a as T,b as C,c as I,d as x,e as P}from"./chunk-NSYY5NCR.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-L2WSPY6S.js";import"./chunk-QJANPP4C.js";import"./chunk-FIOB3MEX.js";import{existsSync as X,readFileSync as F}from"fs";var J=new Set(["cron","heartbeat","api","a2a","mesh"]),M=160;function s(n){return typeof n=="string"&&n.trim()?n.trim():void 0}function A(n,e=M){let t=n.replace(/\s+/g," ").trim();return t.length>e?`${t.slice(0,e-1)}\u2026`:t}function V(n){let e=T(n);if(!X(e))throw new Error(`config not found at ${e}`);return JSON.parse(F(e,"utf-8"))}function W(n,e){return n?.agents?.[e]?.admin===!0}function Y(n,e,t){return W(n,t.agentId)||e?.createdBy===t.agentId}function Z(n,e){let t=e?.createdBy?`agent "${e.createdBy}"`:"the operator";return`Not allowed: "${n}" was created by ${t}. Agents manage only schedules they created (unless configured admin).`}function K(n,e){let t=s(n.notify);if(t!=="none"){if(t&&t!=="here"){let r=t.split(":");return r.length<2||!r[0]||!r[1]?"invalid":{channel:r[0],chatId:r.slice(1).join(":")}}if(e.channel&&e.chatId&&!J.has(e.channel))return{channel:e.channel,chatId:e.chatId,...e.accountId?{accountId:e.accountId}:{}}}}function Q(n,e,t){let r=e.timezone||"UTC",u=e.enabled&&!y(e)?w(E(e.schedule,r,t),r):"\u2014",h=e.approval?`pending ${e.approval.action} approval`:e.enabled?"active":"paused",p=[`- ${n} [${h}] ${e.schedule} \u2014 ${S(e.schedule)} (${r})`,` agent: ${e.agent}; created by: ${e.createdBy||"operator"}; next: ${u}`];return e.notify&&p.push(` notify: ${e.notify.channel} ${e.notify.chatId}`),e.command?p.push(` command: ${A(String(e.command))}`):e.prompt&&p.push(` prompt: ${A(String(e.prompt))}`),p.join(`
1
+ import{a as D,b as _,c as q,d as O,e as R,f as B,h as b,i as S,j as E,k as w,l as y}from"./chunk-OSSI6R4K.js";import"./chunk-LYOXXD4T.js";import{a as T,b as C,c as I,d as x,e as P}from"./chunk-J63MRNXF.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-L2WSPY6S.js";import"./chunk-ANLKBCYH.js";import"./chunk-FIOB3MEX.js";import{existsSync as X,readFileSync as F}from"fs";var J=new Set(["cron","heartbeat","api","a2a","mesh"]),M=160;function s(n){return typeof n=="string"&&n.trim()?n.trim():void 0}function A(n,e=M){let t=n.replace(/\s+/g," ").trim();return t.length>e?`${t.slice(0,e-1)}\u2026`:t}function V(n){let e=T(n);if(!X(e))throw new Error(`config not found at ${e}`);return JSON.parse(F(e,"utf-8"))}function W(n,e){return n?.agents?.[e]?.admin===!0}function Y(n,e,t){return W(n,t.agentId)||e?.createdBy===t.agentId}function Z(n,e){let t=e?.createdBy?`agent "${e.createdBy}"`:"the operator";return`Not allowed: "${n}" was created by ${t}. Agents manage only schedules they created (unless configured admin).`}function K(n,e){let t=s(n.notify);if(t!=="none"){if(t&&t!=="here"){let r=t.split(":");return r.length<2||!r[0]||!r[1]?"invalid":{channel:r[0],chatId:r.slice(1).join(":")}}if(e.channel&&e.chatId&&!J.has(e.channel))return{channel:e.channel,chatId:e.chatId,...e.accountId?{accountId:e.accountId}:{}}}}function Q(n,e,t){let r=e.timezone||"UTC",u=e.enabled&&!y(e)?w(E(e.schedule,r,t),r):"\u2014",h=e.approval?`pending ${e.approval.action} approval`:e.enabled?"active":"paused",p=[`- ${n} [${h}] ${e.schedule} \u2014 ${S(e.schedule)} (${r})`,` agent: ${e.agent}; created by: ${e.createdBy||"operator"}; next: ${u}`];return e.notify&&p.push(` notify: ${e.notify.channel} ${e.notify.chatId}`),e.command?p.push(` command: ${A(String(e.command))}`):e.prompt&&p.push(` prompt: ${A(String(e.prompt))}`),p.join(`
2
2
  `)}async function k(n,e,t){let r=n?.notifications?.destination;if(!r?.channel||!r?.chatId)return"No operator notification destination is configured (notifications.destination); the operator must check `agentx schedule list`.";if(!e.notifyOperator)return"Operator notification is unavailable in this context.";try{return await e.notifyOperator({channel:r.channel,chatId:r.chatId,accountId:r.accountId},t),"The operator has been notified."}catch(u){return`Could not notify the operator (${u?.message??u}); the request is still recorded.`}}async function re(n,e,t={}){let r=(s(n.action)||"list").toLowerCase(),u=t.now?t.now():new Date,h;try{h=V(t.configPath)}catch(a){return`Error: ${a.message}`}let p=h.crons||{};if(r==="list"){let a=n.mine===!0,l=Object.entries(p).filter(([,i])=>!a||e&&i?.createdBy===e.agentId);return l.length?l.map(([i,f])=>Q(i,f,u)).join(`
3
3
  `):a?"You have no schedules.":"No schedules."}if(!e?.agentId)return"Error: caller agent is unknown (AGENTX_AGENT_ID not set). Pass callerAgentId.";if(!h.agents?.[e.agentId])return`Error: caller "${e.agentId}" is not an agent on this node.`;let o=s(n.id),m=a=>C(a,{configPath:t.configPath,reload:t.reload});if(r==="create"){let a=s(n.when),l=s(n.prompt);if(!a||!l)return"Error: create needs `when` (plain English) and `prompt`.";let i=D(a);if(!i)return`Error: couldn't parse "${a}". ${O}.`;let f=s(n.agent)||e.agentId;if(!h.agents?.[f])return`Error: agent "${f}" not found on this node.`;let g=s(n.timezone)||q;if(!B(g))return`Error: unknown timezone "${g}".`;let d=o||_(i.matched,f);if(!R(d))return`Error: invalid id "${d}" (letters, digits, "-" and "_" only).`;if(p[d])return`Error: a schedule "${d}" already exists. Pick another \`id\`.`;let $=K(n,e);if($==="invalid")return'Error: `notify` must be "here", "none", or "channel:chatId".';let z={action:"create",requestedBy:e.agentId,requestedAt:u.toISOString()},L=b({parsed:i,agent:f,prompt:l,timezone:g,notify:$,enabled:!1,createdBy:e.agentId,approval:z}),v=await m(U=>I(U,`crons.${d}`,L));if(!v.success)return`Error: ${v.error}`;let N=w(E(i.cron,g,u),g),G=[`Schedule approval requested by ${e.agentId}`,`Create: ${d}`,`When: ${i.human} \u2014 cron \`${i.cron}\` (${g})`,`Next fire: ${N}`,`Agent: ${f}`,$?`Notify: ${$.channel} ${$.chatId}`:"Notify: none",`Prompt: ${A(l,400)}`,"",`Approve: agentx schedule approve ${d}`,`Reject: agentx schedule reject ${d}`].join(`
4
4
  `),H=await k(h,t,G);return[`Requested schedule "${d}": ${i.human} (cron ${i.cron}, ${g}); next fire would be ${N}.`,"It is saved DISABLED and will not run until the operator approves it.",H].join(`
5
5
  `)}if(!o)return`Error: ${r} needs \`id\`.`;let c=p[o];if(!c)return`Error: schedule "${o}" not found.`;if(!Y(h,c,e))return Z(o,c);if(r==="pause"||r==="resume"){let a=r==="resume";if(a&&y(c))return`"${o}" is still awaiting operator approval; it can't be resumed until approved.`;if(c.enabled===a)return`"${o}" is already ${a?"active":"paused"}.`;let l=await m(i=>I(i,`crons.${o}.enabled`,a));return l.success?`"${o}" ${a?"resumed":"paused"}.`:`Error: ${l.error}`}if(r==="delete"){if(y(c)&&c.approval.requestedBy===e.agentId){let d=await m($=>P($,`crons.${o}`));return d.success?`Withdrew the pending request "${o}".`:`Error: ${d.error}`}if(y(c))return`"${o}" is a creation request still awaiting approval; only its requester or the operator (\`agentx schedule reject ${o}\`) can drop it.`;if(c.approval?.action==="delete")return`Deletion of "${o}" is already awaiting approval.`;let a={action:"delete",requestedBy:e.agentId,requestedAt:u.toISOString()},l=await m(d=>{if(!x(d,`crons.${o}`))throw new Error(`schedule "${o}" not found`);I(d,`crons.${o}.approval`,a)});if(!l.success)return`Error: ${l.error}`;let i=c.timezone||"UTC",f=[`Schedule approval requested by ${e.agentId}`,`Delete: ${o}`,`When: ${S(c.schedule)} \u2014 cron \`${c.schedule}\` (${i})`,`Next fire: ${c.enabled?w(E(c.schedule,i,u),i):"\u2014 (paused)"}`,`Agent: ${c.agent}`,"",`Approve: agentx schedule approve ${o}`,`Reject: agentx schedule reject ${o}`].join(`
6
6
  `),g=await k(h,t,f);return[`Deletion of "${o}" requested. It keeps its current state until the operator approves.`,g].join(`
7
7
  `)}return`Error: unknown action "${r}". Use list, create, pause, resume or delete.`}function oe(n,e=process.env){let t=s(e.AGENTX_AGENT_ID)||s(n.callerAgentId);if(!t)return null;let r=!!(s(e.AGENTX_CHANNEL)&&s(e.AGENTX_CHAT_ID)),u=s(r?e.AGENTX_CHANNEL:n.channel),h=s(r?e.AGENTX_CHAT_ID:n.chatId),p=s(n.accountId);return{agentId:t,channel:u,chatId:h,...p?{accountId:p}:{}}}export{oe as resolveScheduleCaller,re as runScheduleTool};
8
- //# sourceMappingURL=schedule-tool-VQCNMBJF.js.map
8
+ //# sourceMappingURL=schedule-tool-6SNLG2NA.js.map
@@ -0,0 +1,2 @@
1
+ import{h as a,i as b,j as c,k as d,l as e,m as f}from"./chunk-LYOXXD4T.js";import"./chunk-J63MRNXF.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-L2WSPY6S.js";import"./chunk-ANLKBCYH.js";import"./chunk-FIOB3MEX.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-N25EAWF6.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-6HMZ5TTM.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-QJANPP4C.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";i();export{h as askSeat,a as configureDecisions,c as decisionsRuntime,f as getSeatMode,d as parseSeatMode,g as recordSeatOutcome,b as resetDecisionsRuntime,e as seatEnvVar};
2
- //# sourceMappingURL=seat-3WT3VJC2.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-BZLHS3VF.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-ANLKBCYH.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";i();export{h as askSeat,a as configureDecisions,c as decisionsRuntime,f as getSeatMode,d as parseSeatMode,g as recordSeatOutcome,b as resetDecisionsRuntime,e as seatEnvVar};
2
+ //# sourceMappingURL=seat-STLDEYSO.js.map
@@ -1,2 +1,2 @@
1
- import{v as S,w}from"./chunk-6HMZ5TTM.js";import{a as g,b as h,f as R}from"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import{d as f}from"./chunk-VDMYBPYB.js";import"./chunk-QJANPP4C.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";w();R();var p="skill-select";function y(l){return{task:d(l.task,1200),...l.agent?{agent:l.agent}:{},skills:l.candidates.map(t=>({name:t.name,purpose:d(t.description,300),...t.category?{category:t.category}:{},...t.tags?.length?{tags:t.tags.slice(0,8)}:{}}))}}function b(l){let t={};for(let i of l)t[i.name]=d(i.description,300);return{anyRelevant:g("At least one of these skills is about the task at hand.",{true:"The task is the kind of work one of these skills exists for, and following it would change how the work is done \u2014 it names the same system, the same procedure or the same kind of artefact.",false:"None of them is about this task. They may share vocabulary with it, mention the same tools, or belong to the same project without bearing on what is being asked. Sharing words with a task is not being about it."}),best:h(t,"Which skill is this task most about?")}}function v(l){let t=l.anyRelevant,i=l.best,o=Object.entries(i.probabilities??{}).map(([e,s])=>({name:e,p:Number(s)||0})).sort((e,s)=>s.p-e.p);return{anyRelevant:t.noul,name:i.choice,confidence:i.confidence,ranked:o}}function d(l,t){return l.length>t?`${l.slice(0,t)}\u2026`:l}var x=.1,A=12;async function E(l,t,i={}){let o=i.minRelevant??.6,e=f(l,t).filter(n=>n.relevance>=x).slice(0,A),s=e.map(n=>({name:n.skill.frontmatter.name,lexical:n.relevance}));if(e.length===0)return{skill:null,anyRelevant:0,confidence:0,shortlist:s,judged:!1,reason:"no skill mentions anything in this task"};if(e.length===1)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`only ${e[0].skill.frontmatter.name} matched (${e[0].matchReason})`};let r=e.map(n=>({name:n.skill.frontmatter.name,description:n.skill.frontmatter.description,category:n.skill.frontmatter.category??null,tags:n.skill.frontmatter.tags})),m=await S(p,y({task:t,agent:i.agent??null,candidates:r}),b(r),{incumbent:{best:r[0].name},features:{agent:i.agent??"unknown",candidates:r.length}});if(!m)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`seat off \u2014 lexical top match (${e[0].matchReason})`};let a=v(m.answers),c=s.map(n=>({...n,p:a.ranked.find(k=>k.name===n.name)?.p??0})).sort((n,k)=>(k.p??0)-(n.p??0));if(a.anyRelevant<o)return{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`nothing on the shortlist is about this task (${a.anyRelevant.toFixed(2)} below ${o})`};let u=e.find(n=>n.skill.frontmatter.name===a.name);return u?{skill:u.skill,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`${a.name} (confidence ${a.confidence.toFixed(2)})`}:{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`seat chose "${a.name}", which was not on the shortlist`}}export{E as pickSkillForTask};
2
- //# sourceMappingURL=select-KPQWIC22.js.map
1
+ import{v as S,w}from"./chunk-BZLHS3VF.js";import{a as g,b as h,f as R}from"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import{d as f}from"./chunk-VDMYBPYB.js";import"./chunk-ANLKBCYH.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";w();R();var p="skill-select";function y(l){return{task:d(l.task,1200),...l.agent?{agent:l.agent}:{},skills:l.candidates.map(t=>({name:t.name,purpose:d(t.description,300),...t.category?{category:t.category}:{},...t.tags?.length?{tags:t.tags.slice(0,8)}:{}}))}}function b(l){let t={};for(let i of l)t[i.name]=d(i.description,300);return{anyRelevant:g("At least one of these skills is about the task at hand.",{true:"The task is the kind of work one of these skills exists for, and following it would change how the work is done \u2014 it names the same system, the same procedure or the same kind of artefact.",false:"None of them is about this task. They may share vocabulary with it, mention the same tools, or belong to the same project without bearing on what is being asked. Sharing words with a task is not being about it."}),best:h(t,"Which skill is this task most about?")}}function v(l){let t=l.anyRelevant,i=l.best,o=Object.entries(i.probabilities??{}).map(([e,s])=>({name:e,p:Number(s)||0})).sort((e,s)=>s.p-e.p);return{anyRelevant:t.noul,name:i.choice,confidence:i.confidence,ranked:o}}function d(l,t){return l.length>t?`${l.slice(0,t)}\u2026`:l}var x=.1,A=12;async function E(l,t,i={}){let o=i.minRelevant??.6,e=f(l,t).filter(n=>n.relevance>=x).slice(0,A),s=e.map(n=>({name:n.skill.frontmatter.name,lexical:n.relevance}));if(e.length===0)return{skill:null,anyRelevant:0,confidence:0,shortlist:s,judged:!1,reason:"no skill mentions anything in this task"};if(e.length===1)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`only ${e[0].skill.frontmatter.name} matched (${e[0].matchReason})`};let r=e.map(n=>({name:n.skill.frontmatter.name,description:n.skill.frontmatter.description,category:n.skill.frontmatter.category??null,tags:n.skill.frontmatter.tags})),m=await S(p,y({task:t,agent:i.agent??null,candidates:r}),b(r),{incumbent:{best:r[0].name},features:{agent:i.agent??"unknown",candidates:r.length}});if(!m)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`seat off \u2014 lexical top match (${e[0].matchReason})`};let a=v(m.answers),c=s.map(n=>({...n,p:a.ranked.find(k=>k.name===n.name)?.p??0})).sort((n,k)=>(k.p??0)-(n.p??0));if(a.anyRelevant<o)return{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`nothing on the shortlist is about this task (${a.anyRelevant.toFixed(2)} below ${o})`};let u=e.find(n=>n.skill.frontmatter.name===a.name);return u?{skill:u.skill,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`${a.name} (confidence ${a.confidence.toFixed(2)})`}:{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`seat chose "${a.name}", which was not on the shortlist`}}export{E as pickSkillForTask};
2
+ //# sourceMappingURL=select-VP66P6XB.js.map
@@ -1,2 +1,2 @@
1
- import{a,b,c,d}from"./chunk-2TJ5L7CB.js";import"./chunk-QLTM3F7M.js";import"./chunk-FIOB3MEX.js";export{c as commandPath,b as listSurfaceUse,a as recordSurfaceUse,d as shouldRecordCommand};
2
- //# sourceMappingURL=surface-usage-UREILT2E.js.map
1
+ import{a,b,c,d}from"./chunk-SFLF64Q3.js";import"./chunk-DJQA2CWD.js";import"./chunk-FIOB3MEX.js";export{c as commandPath,b as listSurfaceUse,a as recordSurfaceUse,d as shouldRecordCommand};
2
+ //# sourceMappingURL=surface-usage-FM2ZHGYE.js.map
@@ -0,0 +1,2 @@
1
+ import"./chunk-VWTBHLMX.js";import{a as b}from"./chunk-BJWK7FPT.js";import{e as a}from"./chunk-KTM7HSEB.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import{a as c}from"./chunk-MDTKQZC6.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import"./chunk-BZLHS3VF.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-ANLKBCYH.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{b as WikiHub,a as WikiStore,c as agenticQuery};
2
+ //# sourceMappingURL=wiki-SKIIAVCU.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentix-cli",
3
- "version": "0.46.2",
3
+ "version": "0.47.1",
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": {