agentix-cli 0.145.0 → 0.147.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 (145) hide show
  1. package/dist/{App-MYHUCIKZ.js → App-AW4OROPH.js} +2 -2
  2. package/dist/{ChatApp-D6QN6HJP.js → ChatApp-USXQHII3.js} +2 -2
  3. package/dist/{absorb-eval-UAGD42BG.js → absorb-eval-WZCC5VPS.js} +2 -2
  4. package/dist/{agent-HEGEDDUE.js → agent-TJ2K7FZG.js} +2 -2
  5. package/dist/{board-dashboard-4KIFLAFO.js → board-dashboard-JY4YQ5TM.js} +230 -217
  6. package/dist/board-dashboard-JY4YQ5TM.js.map +1 -0
  7. package/dist/{chunk-HSRNH4NR.js → chunk-4F5XUF6T.js} +2 -2
  8. package/dist/{chunk-SH5TNMS5.js → chunk-5TGY4RIQ.js} +2 -2
  9. package/dist/chunk-6UP5VD3H.js +64 -0
  10. package/dist/chunk-6UP5VD3H.js.map +1 -0
  11. package/dist/{chunk-YUY35PY7.js → chunk-7HCSLOTP.js} +3 -3
  12. package/dist/{chunk-TM3I6C4V.js → chunk-7ICJCJ43.js} +2 -2
  13. package/dist/{chunk-WUBSX6S5.js → chunk-7T6SMNVY.js} +2 -2
  14. package/dist/{chunk-YWDXRGVC.js → chunk-7W3TLSZQ.js} +78 -78
  15. package/dist/chunk-7W3TLSZQ.js.map +1 -0
  16. package/dist/chunk-E7YHXMJG.js +7 -0
  17. package/dist/chunk-E7YHXMJG.js.map +1 -0
  18. package/dist/{chunk-5E37FADJ.js → chunk-EG7Y2XLK.js} +2 -2
  19. package/dist/{chunk-KAGLCJA3.js → chunk-EKAUOUN2.js} +2 -2
  20. package/dist/{chunk-SANYTBHX.js → chunk-GJMYG53S.js} +2 -2
  21. package/dist/{chunk-JTDQO4LI.js → chunk-GLLHUHX2.js} +41 -41
  22. package/dist/chunk-GLLHUHX2.js.map +1 -0
  23. package/dist/{chunk-YEFEUSB2.js → chunk-GTOQWMRY.js} +2 -2
  24. package/dist/chunk-HAEI2LNC.js +7 -0
  25. package/dist/chunk-HAEI2LNC.js.map +1 -0
  26. package/dist/chunk-JCFVH3NC.js +533 -0
  27. package/dist/chunk-JCFVH3NC.js.map +1 -0
  28. package/dist/{chunk-VDJZ2Q3M.js → chunk-JLEVL66V.js} +2 -2
  29. package/dist/{chunk-WBG6NA7R.js → chunk-KP7KDLZ2.js} +2 -2
  30. package/dist/{chunk-P42M6CYF.js → chunk-KW6SHOAN.js} +2 -2
  31. package/dist/{chunk-GMVWDQFF.js → chunk-MXDTLR45.js} +2 -2
  32. package/dist/{chunk-QXPMWP4R.js → chunk-P5BFFU4Y.js} +2 -2
  33. package/dist/chunk-P6PFTNN4.js +128 -0
  34. package/dist/chunk-P6PFTNN4.js.map +1 -0
  35. package/dist/{chunk-VTVEJ3RA.js → chunk-PUW4C6YO.js} +2 -2
  36. package/dist/{chunk-DG2DC43E.js → chunk-PYHR4HXO.js} +2 -2
  37. package/dist/{chunk-BPOMIEEE.js → chunk-Q2QU32JP.js} +2 -2
  38. package/dist/{chunk-EV76NT3E.js → chunk-QXPX2NGL.js} +2 -2
  39. package/dist/{chunk-HP2NWDCS.js → chunk-UVF3K5YS.js} +2 -2
  40. package/dist/{chunk-OFJKTKRM.js → chunk-YE2X3AFU.js} +2 -2
  41. package/dist/chunk-Z3AI4KXT.js +18 -0
  42. package/dist/chunk-Z3AI4KXT.js.map +1 -0
  43. package/dist/{chunk-HCSIM2QW.js → chunk-ZZNAR6R2.js} +298 -297
  44. package/dist/chunk-ZZNAR6R2.js.map +1 -0
  45. package/dist/cli.js +1 -1
  46. package/dist/{client-ZU5AWBXQ.js → client-GLBNS45C.js} +2 -2
  47. package/dist/config-VRDFC7LW.js +2 -0
  48. package/dist/{config-mutate-DVARJ4KM.js → config-mutate-HU3KKYCD.js} +2 -2
  49. package/dist/config-mutator-JCAIGP6W.js +2 -0
  50. package/dist/{contributions-HKWDGIQV.js → contributions-JXPYCLVB.js} +2 -2
  51. package/dist/doctor-5Y7QSXNQ.js +2 -0
  52. package/dist/{follow-up-tool-2T4SIFY2.js → follow-up-tool-53AYA2UQ.js} +2 -2
  53. package/dist/{hub-3LDKRLTH.js → hub-YCOUZFNU.js} +2 -2
  54. package/dist/index.d.ts +181 -1
  55. package/dist/index.js +1 -1
  56. package/dist/{program-MAM4NX5P.js → program-CIJEGFYG.js} +215 -215
  57. package/dist/program-CIJEGFYG.js.map +1 -0
  58. package/dist/{promote-YOV5ELNF.js → promote-THTEHZHU.js} +2 -2
  59. package/dist/{query-LTKK3M2Y.js → query-N7JBDLR7.js} +2 -2
  60. package/dist/{query-settings-ACXSGMDU.js → query-settings-BJTVDDCH.js} +2 -2
  61. package/dist/{registry-NIAPKDQF.js → registry-LJ66OZYJ.js} +2 -2
  62. package/dist/{request-planner-433C7M3L.js → request-planner-PCELXLK7.js} +2 -2
  63. package/dist/{review-candidates-SI3QBYNH.js → review-candidates-EMJUROJH.js} +2 -2
  64. package/dist/{routing-CXT77HBF.js → routing-D2KNBEMG.js} +2 -2
  65. package/dist/schedule-tool-55MOWHKD.js +2 -0
  66. package/dist/{scheduler-SFHWPWCA.js → scheduler-73UEBYV4.js} +2 -2
  67. package/dist/{seat-CJVTUIM2.js → seat-UFAMWG7M.js} +2 -2
  68. package/dist/{select-JHGDG4H2.js → select-EPWELLAV.js} +2 -2
  69. package/dist/{set-enabled-NOJGCJAL.js → set-enabled-LS65QZQS.js} +2 -2
  70. package/dist/{tool-YOSMTSJM.js → tool-4S3YKLCN.js} +4 -4
  71. package/dist/tool-4S3YKLCN.js.map +1 -0
  72. package/dist/{tool-ERK543LL.js → tool-7LKYIA6D.js} +2 -2
  73. package/dist/{wiki-2LLXQUEP.js → wiki-LHT6X2JF.js} +2 -2
  74. package/dist/wiki-enrich-CBBS3AC7.js +2 -0
  75. package/package.json +1 -1
  76. package/dist/board-dashboard-4KIFLAFO.js.map +0 -1
  77. package/dist/chunk-42BEORFZ.js +0 -7
  78. package/dist/chunk-42BEORFZ.js.map +0 -1
  79. package/dist/chunk-4NKPVTVP.js +0 -62
  80. package/dist/chunk-4NKPVTVP.js.map +0 -1
  81. package/dist/chunk-HCSIM2QW.js.map +0 -1
  82. package/dist/chunk-JTDQO4LI.js.map +0 -1
  83. package/dist/chunk-LJ62ABOZ.js +0 -128
  84. package/dist/chunk-LJ62ABOZ.js.map +0 -1
  85. package/dist/chunk-S2GAEH2F.js +0 -13
  86. package/dist/chunk-S2GAEH2F.js.map +0 -1
  87. package/dist/chunk-VMMCT27Z.js +0 -5
  88. package/dist/chunk-VMMCT27Z.js.map +0 -1
  89. package/dist/chunk-VXBL2DET.js +0 -535
  90. package/dist/chunk-VXBL2DET.js.map +0 -1
  91. package/dist/chunk-YWDXRGVC.js.map +0 -1
  92. package/dist/config-Q4MNOHRI.js +0 -2
  93. package/dist/config-mutator-5NYGSUJD.js +0 -2
  94. package/dist/doctor-RTVGZP3X.js +0 -2
  95. package/dist/program-MAM4NX5P.js.map +0 -1
  96. package/dist/schedule-tool-3R4ISM5R.js +0 -2
  97. package/dist/tool-YOSMTSJM.js.map +0 -1
  98. package/dist/wiki-enrich-6C2O2MNV.js +0 -2
  99. /package/dist/{App-MYHUCIKZ.js.map → App-AW4OROPH.js.map} +0 -0
  100. /package/dist/{ChatApp-D6QN6HJP.js.map → ChatApp-USXQHII3.js.map} +0 -0
  101. /package/dist/{absorb-eval-UAGD42BG.js.map → absorb-eval-WZCC5VPS.js.map} +0 -0
  102. /package/dist/{agent-HEGEDDUE.js.map → agent-TJ2K7FZG.js.map} +0 -0
  103. /package/dist/{chunk-HSRNH4NR.js.map → chunk-4F5XUF6T.js.map} +0 -0
  104. /package/dist/{chunk-SH5TNMS5.js.map → chunk-5TGY4RIQ.js.map} +0 -0
  105. /package/dist/{chunk-YUY35PY7.js.map → chunk-7HCSLOTP.js.map} +0 -0
  106. /package/dist/{chunk-TM3I6C4V.js.map → chunk-7ICJCJ43.js.map} +0 -0
  107. /package/dist/{chunk-WUBSX6S5.js.map → chunk-7T6SMNVY.js.map} +0 -0
  108. /package/dist/{chunk-5E37FADJ.js.map → chunk-EG7Y2XLK.js.map} +0 -0
  109. /package/dist/{chunk-KAGLCJA3.js.map → chunk-EKAUOUN2.js.map} +0 -0
  110. /package/dist/{chunk-SANYTBHX.js.map → chunk-GJMYG53S.js.map} +0 -0
  111. /package/dist/{chunk-YEFEUSB2.js.map → chunk-GTOQWMRY.js.map} +0 -0
  112. /package/dist/{chunk-VDJZ2Q3M.js.map → chunk-JLEVL66V.js.map} +0 -0
  113. /package/dist/{chunk-WBG6NA7R.js.map → chunk-KP7KDLZ2.js.map} +0 -0
  114. /package/dist/{chunk-P42M6CYF.js.map → chunk-KW6SHOAN.js.map} +0 -0
  115. /package/dist/{chunk-GMVWDQFF.js.map → chunk-MXDTLR45.js.map} +0 -0
  116. /package/dist/{chunk-QXPMWP4R.js.map → chunk-P5BFFU4Y.js.map} +0 -0
  117. /package/dist/{chunk-VTVEJ3RA.js.map → chunk-PUW4C6YO.js.map} +0 -0
  118. /package/dist/{chunk-DG2DC43E.js.map → chunk-PYHR4HXO.js.map} +0 -0
  119. /package/dist/{chunk-BPOMIEEE.js.map → chunk-Q2QU32JP.js.map} +0 -0
  120. /package/dist/{chunk-EV76NT3E.js.map → chunk-QXPX2NGL.js.map} +0 -0
  121. /package/dist/{chunk-HP2NWDCS.js.map → chunk-UVF3K5YS.js.map} +0 -0
  122. /package/dist/{chunk-OFJKTKRM.js.map → chunk-YE2X3AFU.js.map} +0 -0
  123. /package/dist/{client-ZU5AWBXQ.js.map → client-GLBNS45C.js.map} +0 -0
  124. /package/dist/{config-Q4MNOHRI.js.map → config-VRDFC7LW.js.map} +0 -0
  125. /package/dist/{config-mutate-DVARJ4KM.js.map → config-mutate-HU3KKYCD.js.map} +0 -0
  126. /package/dist/{config-mutator-5NYGSUJD.js.map → config-mutator-JCAIGP6W.js.map} +0 -0
  127. /package/dist/{contributions-HKWDGIQV.js.map → contributions-JXPYCLVB.js.map} +0 -0
  128. /package/dist/{doctor-RTVGZP3X.js.map → doctor-5Y7QSXNQ.js.map} +0 -0
  129. /package/dist/{follow-up-tool-2T4SIFY2.js.map → follow-up-tool-53AYA2UQ.js.map} +0 -0
  130. /package/dist/{hub-3LDKRLTH.js.map → hub-YCOUZFNU.js.map} +0 -0
  131. /package/dist/{promote-YOV5ELNF.js.map → promote-THTEHZHU.js.map} +0 -0
  132. /package/dist/{query-LTKK3M2Y.js.map → query-N7JBDLR7.js.map} +0 -0
  133. /package/dist/{query-settings-ACXSGMDU.js.map → query-settings-BJTVDDCH.js.map} +0 -0
  134. /package/dist/{registry-NIAPKDQF.js.map → registry-LJ66OZYJ.js.map} +0 -0
  135. /package/dist/{request-planner-433C7M3L.js.map → request-planner-PCELXLK7.js.map} +0 -0
  136. /package/dist/{review-candidates-SI3QBYNH.js.map → review-candidates-EMJUROJH.js.map} +0 -0
  137. /package/dist/{routing-CXT77HBF.js.map → routing-D2KNBEMG.js.map} +0 -0
  138. /package/dist/{schedule-tool-3R4ISM5R.js.map → schedule-tool-55MOWHKD.js.map} +0 -0
  139. /package/dist/{scheduler-SFHWPWCA.js.map → scheduler-73UEBYV4.js.map} +0 -0
  140. /package/dist/{seat-CJVTUIM2.js.map → seat-UFAMWG7M.js.map} +0 -0
  141. /package/dist/{select-JHGDG4H2.js.map → select-EPWELLAV.js.map} +0 -0
  142. /package/dist/{set-enabled-NOJGCJAL.js.map → set-enabled-LS65QZQS.js.map} +0 -0
  143. /package/dist/{tool-ERK543LL.js.map → tool-7LKYIA6D.js.map} +0 -0
  144. /package/dist/{wiki-2LLXQUEP.js.map → wiki-LHT6X2JF.js.map} +0 -0
  145. /package/dist/{wiki-enrich-6C2O2MNV.js.map → wiki-enrich-CBBS3AC7.js.map} +0 -0
package/dist/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{b as o}from"./chunk-JXF54PT7.js";import"./chunk-QIJLFPWE.js";var e=o(process.versions.node);e&&(console.error(e),process.exit(1));var{buildProgram:s}=await import("./program-MAM4NX5P.js"),{installCliSignalExit:r}=await import("./signal-exit-WL7G3EEZ.js"),{applyConnectAttemptTimeout:i,configPathFromArgv:a,readConnectAttemptTimeout:n}=await import("./net-family-X2P3OVDP.js");r();i(n(process.cwd(),a(process.argv.slice(2))));var t=await s();process.argv.slice(2).length===0?t.outputHelp():t.parse();
2
+ import{b as o}from"./chunk-JXF54PT7.js";import"./chunk-QIJLFPWE.js";var e=o(process.versions.node);e&&(console.error(e),process.exit(1));var{buildProgram:s}=await import("./program-CIJEGFYG.js"),{installCliSignalExit:r}=await import("./signal-exit-WL7G3EEZ.js"),{applyConnectAttemptTimeout:i,configPathFromArgv:a,readConnectAttemptTimeout:n}=await import("./net-family-X2P3OVDP.js");r();i(n(process.cwd(),a(process.argv.slice(2))));var t=await s();process.argv.slice(2).length===0?t.outputHelp():t.parse();
3
3
  //# sourceMappingURL=cli.js.map
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g}from"./chunk-OFJKTKRM.js";import"./chunk-4NKPVTVP.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.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-ZU5AWBXQ.js.map
1
+ import{a,b,c,d,e,f,g}from"./chunk-YE2X3AFU.js";import"./chunk-6UP5VD3H.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.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-GLBNS45C.js.map
@@ -0,0 +1,2 @@
1
+ import{Aa as g,Ba as h,Ca as i,Da as j,Ea as k,Fa as l,Ga as m,Ha as n,Ia as o,Ja as p,Ka as q,La as r,Ma as s,Na as t,Oa as u,Pa as v,Qa as w,Ra as x,Sa as y,Ua as z,ua as a,va as b,wa as c,xa as d,ya as e,za as f}from"./chunk-6UP5VD3H.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";z();export{a as INTEGRATION_KINDS,u as WIKI_CONTRIBUTE_JOB,v as WIKI_CONTRIBUTE_MERGE_JOB,x as WIKI_SUMMARIZE_JOB,o as approvalsConfigSchema,e as callsSchema,c as cameraBotSchema,s as crossFieldProblems,p as daemonConfigSchema,b as eventSubscriptionSchema,q as expandEnvVars,d as isCronExpression,r as loadDaemonConfig,l as membersConfigSchema,g as mergePolicyConfigSchema,k as peopleConfigSchema,j as personSchema,n as qualityReportConfigSchema,m as requestStatusConfigSchema,i as requestsConfigSchema,f as reviewGateConfigSchema,t as validateWorkspaces,h as watchersConfigSchema,w as withContributionJobs,y as withSummariesJob};
2
+ //# sourceMappingURL=config-VRDFC7LW.js.map
@@ -1,2 +1,2 @@
1
- import{a,b}from"./chunk-5E37FADJ.js";import"./chunk-4NKPVTVP.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{a as mutateAgentxConfig,b as writeAgentxConfig};
2
- //# sourceMappingURL=config-mutate-DVARJ4KM.js.map
1
+ import{a,b}from"./chunk-EG7Y2XLK.js";import"./chunk-6UP5VD3H.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{a as mutateAgentxConfig,b as writeAgentxConfig};
2
+ //# sourceMappingURL=config-mutate-HU3KKYCD.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e}from"./chunk-E7YHXMJG.js";import"./chunk-6UP5VD3H.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.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-JCAIGP6W.js.map
@@ -1,4 +1,4 @@
1
- import{a as ee}from"./chunk-YEFEUSB2.js";import"./chunk-TM3I6C4V.js";import{f as Q,k as V}from"./chunk-5TTHN7DP.js";import{b as O}from"./chunk-PE5V2LI7.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-OWNQ2FD4.js";import{b as X}from"./chunk-KEXBEUSU.js";import"./chunk-YUY35PY7.js";import"./chunk-SKSYII3K.js";import"./chunk-BPOMIEEE.js";import"./chunk-WPNRDEHW.js";import"./chunk-MWNCS57L.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-SH5TNMS5.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-6TURWSMN.js";import"./chunk-QD6IICK7.js";import{b as N,c as H}from"./chunk-QOYAX2FT.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-4NKPVTVP.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";import{createHash as le}from"crypto";import{existsSync as z,mkdirSync as ne,readdirSync as re,readFileSync as ge,renameSync as se,writeFileSync as pe}from"fs";import{resolve as w}from"path";var _={maxPatches:30,maxCostUsd:.5,maxItems:60},he=12,fe=2e3,me=1500,M=8,U=300,be=12,B="## Checked facts";function S(n){return w(n,"_contributions")}function E(n,r){if(!z(n))return r;try{return JSON.parse(ge(n,"utf-8"))}catch(t){throw new Error(`${n} is not valid JSON: ${t.message}`)}}function L(n,r){ne(w(n,".."),{recursive:!0});let t=`${n}.${process.pid}.tmp`;pe(t,`${JSON.stringify(r,null,2)}
1
+ import{a as ee}from"./chunk-GTOQWMRY.js";import"./chunk-7ICJCJ43.js";import{f as Q,k as V}from"./chunk-5TTHN7DP.js";import{b as O}from"./chunk-PE5V2LI7.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-OWNQ2FD4.js";import{b as X}from"./chunk-KEXBEUSU.js";import"./chunk-7HCSLOTP.js";import"./chunk-SKSYII3K.js";import"./chunk-Q2QU32JP.js";import"./chunk-WPNRDEHW.js";import"./chunk-MWNCS57L.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-5TGY4RIQ.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-6TURWSMN.js";import"./chunk-QD6IICK7.js";import{b as N,c as H}from"./chunk-QOYAX2FT.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-6UP5VD3H.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";import{createHash as le}from"crypto";import{existsSync as z,mkdirSync as ne,readdirSync as re,readFileSync as ge,renameSync as se,writeFileSync as pe}from"fs";import{resolve as w}from"path";var _={maxPatches:30,maxCostUsd:.5,maxItems:60},he=12,fe=2e3,me=1500,M=8,U=300,be=12,B="## Checked facts";function S(n){return w(n,"_contributions")}function E(n,r){if(!z(n))return r;try{return JSON.parse(ge(n,"utf-8"))}catch(t){throw new Error(`${n} is not valid JSON: ${t.message}`)}}function L(n,r){ne(w(n,".."),{recursive:!0});let t=`${n}.${process.pid}.tmp`;pe(t,`${JSON.stringify(r,null,2)}
2
2
  `),se(t,n)}function ie(n){return{agents:E(w(S(n),"state.json"),{agents:{}}).agents??{}}}function ye(n){let r=w(S(n),"pending");return z(r)?re(r).filter(t=>t.endsWith(".json")).sort().map(t=>E(w(r,t),null)).filter(t=>!!t):[]}function G(n){return w(S(n),"held.json")}function K(n,r={}){let t=E(G(n),[]);return r.all?t:t.filter(a=>a.status==="held")}function _e(n){let r=w(S(n),"reports");if(!z(r))return null;let t=re(r).filter(a=>a.endsWith(".json")).sort().pop();return t?E(w(r,t),null):null}function ke(n,r,t,a={}){let o=ie(r).agents[t],c=a.now??Date.now(),e=a.since??o?.lastRunAt??new Date(c-864e5).toISOString(),d=e.slice(0,10),u=new Set(o?.processed??[]),s=[];for(let g of n.getAgentEntries(t))g.date<d||u.has(g.id)||s.push({id:g.id,at:g.date,kind:"chat",title:[g.source,g.sourceContext].filter(Boolean).join(" \xB7 "),text:g.content});if(a.db){let g=Date.parse(e);for(let l of V(a.db,{agentId:t,since:Number.isFinite(g)?g:void 0,limit:500})){if(l.status==="in-flight"||u.has(l.taskId))continue;let k=(Q(a.db,l.taskId)?.steps??[]).filter(b=>b.name==="tool_use"||b.action).slice(0,be).map(b=>`- ${b.action??b.name}${b.inputSummary?` ${x(b.inputSummary,160)}`:""}${b.outputSummary?` \u2192 ${x(b.outputSummary,240)}`:""}${b.error?` \u2717 ${x(b.error,120)}`:""}`),y=[`Request: ${x(l.originalMessage??l.messagePreview??"",600)}`,k.length?`Tool calls:
3
3
  ${k.join(`
4
4
  `)}`:"",l.finalResponse?`Reply: ${x(l.finalResponse,800)}`:""].filter(Boolean).join(`
@@ -54,4 +54,4 @@ _Sources: ${t.sources.join("; ")}._`,a);return n.writeArticle(r,{title:t.title,.
54
54
  `).replace(/\n{3,}/g,`
55
55
 
56
56
  `).trim(),superseded:d}}function Ce(n){let r=n.previous?` (previously: ${n.previous})`:"";return`- **${n.attribute}:** ${n.value} \u2014 ${n.source}; checked ${n.checkedAt.slice(0,10)} by ${n.by}${r}`}function Re(n){let r=n.match(/^- \*\*.+?:\*\* (.*?) — .*?; checked (\S+) by \S+(?: \(previously: (.*)\))?$/);return r?{value:r[1],checkedAt:r[2],...r[3]?{previous:r[3]}:{}}:void 0}function J(n,r){return`contribution:${n}@${r.slice(0,10)}`}var Te={person:"people",project:"projects",place:"places",concept:"concepts",event:"events",decision:"decisions",pattern:"patterns"};function de(n,r,t){let a=r.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,60)||"page",o=t?Te[t]:"contributions",c=`${o}/${a}.md`;for(let e=2;n.readArticle(c);e++)c=`${o}/${a}-${e}.md`;return c}export{_ as DEFAULT_CONTRIBUTION_LIMITS,B as FACTS_HEADING,ue as applyFactLines,De as approveHeld,xe as buildContributionPrompt,S as contributionsDir,_e as latestReport,K as listHeld,ye as listPendingBatches,Be as mergeContributions,W as pageKey,Ae as parseContributionPatches,ke as pendingWork,Se as possibleDuplicate,Fe as rejectHeld,ce as replaceOnce,Me as runContribution};
57
- //# sourceMappingURL=contributions-HKWDGIQV.js.map
57
+ //# sourceMappingURL=contributions-JXPYCLVB.js.map
@@ -0,0 +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}from"./chunk-HAEI2LNC.js";import"./chunk-Z3AI4KXT.js";import"./chunk-IMLAPB7G.js";import"./chunk-TJZGAKIB.js";import"./chunk-VY7TBMJU.js";import"./chunk-KP7KDLZ2.js";import"./chunk-JXF54PT7.js";import"./chunk-6UP5VD3H.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{g as daemonVoiceCheck,b as doctor,a as runDoctorChecks,e as runMirrorChecks,d as runNativeChecks,c as runNotificationChecks,f as runReminderChecks};
2
+ //# sourceMappingURL=doctor-5Y7QSXNQ.js.map
@@ -1,7 +1,7 @@
1
- import{b as h}from"./chunk-EV76NT3E.js";import"./chunk-RKPAVWXF.js";import{b as I}from"./chunk-DG2DC43E.js";import"./chunk-WBG6NA7R.js";import"./chunk-SANYTBHX.js";import"./chunk-LJ62ABOZ.js";import"./chunk-VMMCT27Z.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-4NKPVTVP.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";var p=t=>typeof t=="string"?t.trim():"";function $(t){return[`Run ${t.runId} "${t.title}" [${t.status}] on step ${t.step}: waiting on ${t.waitingOn}.`,t.tags?.length?`Tags: ${t.tags.join(", ")}`:"",...(t.steps??[]).slice(-8).map(s=>`- ${String(s.at).slice(0,16).replace("T"," ")} ${s.step} ${s.status}${s.note?`: ${s.note}`:""}`)].filter(Boolean).join(`
1
+ import{b as h}from"./chunk-QXPX2NGL.js";import"./chunk-RKPAVWXF.js";import{b as I}from"./chunk-PYHR4HXO.js";import"./chunk-KP7KDLZ2.js";import"./chunk-GJMYG53S.js";import"./chunk-P6PFTNN4.js";import"./chunk-E7YHXMJG.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-6UP5VD3H.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";var p=t=>typeof t=="string"?t.trim():"";function $(t){return[`Run ${t.runId} "${t.title}" [${t.status}] on step ${t.step}: waiting on ${t.waitingOn}.`,t.tags?.length?`Tags: ${t.tags.join(", ")}`:"",...(t.steps??[]).slice(-8).map(s=>`- ${String(s.at).slice(0,16).replace("T"," ")} ${s.step} ${s.status}${s.note?`: ${s.note}`:""}`)].filter(Boolean).join(`
2
2
  `)}async function T(t,c){let s=c.fetch??fetch,m=c.daemonUrl.replace(/\/$/,""),r=(p(t.action)||"list").toLowerCase(),f=c.env??process.env,w=async i=>{let l=await s(`${m}${i}`,{signal:AbortSignal.timeout(1e4)}),n=await l.json().catch(()=>({}));return{ok:l.ok,status:l.status,data:n}};try{if(r==="list"){let e=await w("/follow-up");if(!e.ok)return`Error: ${e.data?.error||`HTTP ${e.status}`}`;let o=e.data.groups??[];return o.length?o.map(d=>[`${d.tag}:`,...d.rows.map(a=>`- ${a.runId} "${a.title}" on ${a.step}: waiting on ${a.waitingOn} (since ${String(a.since).slice(0,16).replace("T"," ")} UTC)`)].join(`
3
3
  `)).join(`
4
4
  `):"No follow-up workflows are running."}if(r==="match"){let e=p(t.request)||p(t.title);if(!e)return"Error: match needs `request`: the owner's request in their words.";let o=h(t,f),d=await w(`/follow-up/match?q=${encodeURIComponent(e)}${o?`&agentId=${encodeURIComponent(o.agentId)}`:""}`);if(!d.ok)return`Error: ${d.data?.error||`HTTP ${d.status}`}`;let a=d.data.matches??[];return a.length?["Saved workflows, best fit first (confidence 0-1):",...a.map(u=>`- ${u.workflowId} "${u.title}" (${u.confidence}${u.autoStart?", starts without asking":""}): ${u.steps.map(k=>k.id).join(" \u2192 ")}`),'Start one with {action:"start", workflowId:"<id>", title:"\u2026", tags:["client:<name>"]}. Run its steps through the workflow, not by hand.'].join(`
5
5
  `):"No saved workflow fits. If the request has several steps, build one: start with title and steps."}if(r==="status"){let e=p(t.runId);if(!e)return"Error: status needs runId.";let o=await w(`/follow-up/${encodeURIComponent(e)}`);return o.ok?$(o.data.run):`Error: ${o.data?.error||`HTTP ${o.status}`}`}let i=h(t,f);if(!i)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let l=await s(`${m}/follow-up`,{method:"POST",headers:{"Content-Type":"application/json",...I(f)},body:JSON.stringify({action:r,agentId:i.agentId,workflowId:t.workflowId,title:t.title,description:t.description,tags:t.tags,inputs:t.inputs,steps:t.steps,edges:t.edges,approval:t.approval,autoStart:t.autoStart,requestId:t.requestId,runId:t.runId,step:t.step,evidence:t.evidence,note:t.note,reason:t.reason,fromRun:t.fromRun,status:t.status}),signal:AbortSignal.timeout(2e4)}),n=await l.json().catch(()=>({}));if(!l.ok)return`Error: ${n?.error||`HTTP ${l.status}`}`;if(r==="start"){let e=n.run;return[`Started run ${e.runId} "${e.title}"${n.built?" (built from the steps you gave; propose it with fromRun to keep it)":""}.`,n.awaitingApproval?"It waits for the owner's approval before the first step.":`It is on step ${e.step}: ${e.waitingOn}.`,"AgentX follows it from here: it starts each step, reminds whoever is slow, and tells the owner when it ends. Do not run its steps by hand.",...n.warning?[`Note: ${n.warning}`]:[]].join(" ")}return r==="plan"?[`Plan recorded on run ${n.run?.runId??t.runId}:`,...(n.plan??[]).map(e=>`- ${e.id} ${e.title}`),'Report each step with {action:"step", runId, step:"<id>", status:"started"|"done"|"failed"}.'].join(`
6
6
  `):r==="step"?`Step recorded. ${n.run?$(n.run):""}`.trim():r==="done"?`Step recorded as done. ${n.run?$(n.run):""}`.trim():r==="blocked"?"The step is marked blocked and the owner is told. Nothing more happens on it until it is sorted.":`Saved ${n.workflowId} switched off, and asked the owner (card ${n.cardId}) whether to keep it as a reusable workflow.`}catch(i){return`Error: couldn't reach the daemon (${i?.message??i}).`}}export{T as runWorkflowTool};
7
- //# sourceMappingURL=follow-up-tool-2T4SIFY2.js.map
7
+ //# sourceMappingURL=follow-up-tool-53AYA2UQ.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-VTVEJ3RA.js";import"./chunk-HP2NWDCS.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-BPOMIEEE.js";import"./chunk-WPNRDEHW.js";import"./chunk-SH5TNMS5.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QOYAX2FT.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-4NKPVTVP.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as WikiHub};
2
- //# sourceMappingURL=hub-3LDKRLTH.js.map
1
+ import{a}from"./chunk-PUW4C6YO.js";import"./chunk-UVF3K5YS.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-Q2QU32JP.js";import"./chunk-WPNRDEHW.js";import"./chunk-5TGY4RIQ.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QOYAX2FT.js";import"./chunk-2PJKGZWP.js";import"./chunk-7I7IEX4S.js";import"./chunk-6UP5VD3H.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as WikiHub};
2
+ //# sourceMappingURL=hub-YCOUZFNU.js.map
package/dist/index.d.ts CHANGED
@@ -2195,6 +2195,10 @@ declare const cronJobSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
2195
2195
  * but appending an instruction to the prompt is reliably honored. Use
2196
2196
  * 1500 for briefs, 500 for status pings, 300 for pure classifiers. */
2197
2197
  maxOutputTokens: z.ZodOptional<z.ZodNumber>;
2198
+ /** The task type of each run (`context.taskType`): picks the evidence a
2199
+ * watcher's done needs (`watchers.evidence.<type>`, #1049). Unset: the
2200
+ * `cron` rule, if there is one. */
2201
+ taskType: z.ZodOptional<z.ZodString>;
2198
2202
  /** How much this routine may do: `report` (read-only), `propose` (branch,
2199
2203
  * commit, MR/draft; never merge/deploy/delete) or `act` (the agent's full
2200
2204
  * permissions — the default). Enforced per run by the guard, not by the
@@ -2265,6 +2269,7 @@ declare const cronJobSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
2265
2269
  requestedAt: string;
2266
2270
  } | undefined;
2267
2271
  maxOutputTokens?: number | undefined;
2272
+ taskType?: string | undefined;
2268
2273
  autonomy?: "report" | "propose" | "act" | undefined;
2269
2274
  deliverResult?: boolean | undefined;
2270
2275
  fireToken?: string | undefined;
@@ -2289,6 +2294,7 @@ declare const cronJobSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
2289
2294
  requestedAt: string;
2290
2295
  } | undefined;
2291
2296
  maxOutputTokens?: number | undefined;
2297
+ taskType?: string | undefined;
2292
2298
  autonomy?: "report" | "propose" | "act" | undefined;
2293
2299
  onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
2294
2300
  deliverResult?: boolean | undefined;
@@ -2315,6 +2321,7 @@ declare const cronJobSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
2315
2321
  requestedAt: string;
2316
2322
  } | undefined;
2317
2323
  maxOutputTokens?: number | undefined;
2324
+ taskType?: string | undefined;
2318
2325
  autonomy?: "report" | "propose" | "act" | undefined;
2319
2326
  deliverResult?: boolean | undefined;
2320
2327
  fireToken?: string | undefined;
@@ -2339,6 +2346,7 @@ declare const cronJobSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
2339
2346
  requestedAt: string;
2340
2347
  } | undefined;
2341
2348
  maxOutputTokens?: number | undefined;
2349
+ taskType?: string | undefined;
2342
2350
  autonomy?: "report" | "propose" | "act" | undefined;
2343
2351
  onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
2344
2352
  deliverResult?: boolean | undefined;
@@ -2365,6 +2373,7 @@ declare const cronJobSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
2365
2373
  requestedAt: string;
2366
2374
  } | undefined;
2367
2375
  maxOutputTokens?: number | undefined;
2376
+ taskType?: string | undefined;
2368
2377
  autonomy?: "report" | "propose" | "act" | undefined;
2369
2378
  deliverResult?: boolean | undefined;
2370
2379
  fireToken?: string | undefined;
@@ -2389,6 +2398,7 @@ declare const cronJobSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
2389
2398
  requestedAt: string;
2390
2399
  } | undefined;
2391
2400
  maxOutputTokens?: number | undefined;
2401
+ taskType?: string | undefined;
2392
2402
  autonomy?: "report" | "propose" | "act" | undefined;
2393
2403
  onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
2394
2404
  deliverResult?: boolean | undefined;
@@ -4739,6 +4749,10 @@ declare const daemonConfigSchema: z.ZodObject<{
4739
4749
  * but appending an instruction to the prompt is reliably honored. Use
4740
4750
  * 1500 for briefs, 500 for status pings, 300 for pure classifiers. */
4741
4751
  maxOutputTokens: z.ZodOptional<z.ZodNumber>;
4752
+ /** The task type of each run (`context.taskType`): picks the evidence a
4753
+ * watcher's done needs (`watchers.evidence.<type>`, #1049). Unset: the
4754
+ * `cron` rule, if there is one. */
4755
+ taskType: z.ZodOptional<z.ZodString>;
4742
4756
  /** How much this routine may do: `report` (read-only), `propose` (branch,
4743
4757
  * commit, MR/draft; never merge/deploy/delete) or `act` (the agent's full
4744
4758
  * permissions — the default). Enforced per run by the guard, not by the
@@ -4809,6 +4823,7 @@ declare const daemonConfigSchema: z.ZodObject<{
4809
4823
  requestedAt: string;
4810
4824
  } | undefined;
4811
4825
  maxOutputTokens?: number | undefined;
4826
+ taskType?: string | undefined;
4812
4827
  autonomy?: "report" | "propose" | "act" | undefined;
4813
4828
  deliverResult?: boolean | undefined;
4814
4829
  fireToken?: string | undefined;
@@ -4833,6 +4848,7 @@ declare const daemonConfigSchema: z.ZodObject<{
4833
4848
  requestedAt: string;
4834
4849
  } | undefined;
4835
4850
  maxOutputTokens?: number | undefined;
4851
+ taskType?: string | undefined;
4836
4852
  autonomy?: "report" | "propose" | "act" | undefined;
4837
4853
  onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
4838
4854
  deliverResult?: boolean | undefined;
@@ -4859,6 +4875,7 @@ declare const daemonConfigSchema: z.ZodObject<{
4859
4875
  requestedAt: string;
4860
4876
  } | undefined;
4861
4877
  maxOutputTokens?: number | undefined;
4878
+ taskType?: string | undefined;
4862
4879
  autonomy?: "report" | "propose" | "act" | undefined;
4863
4880
  deliverResult?: boolean | undefined;
4864
4881
  fireToken?: string | undefined;
@@ -4883,6 +4900,7 @@ declare const daemonConfigSchema: z.ZodObject<{
4883
4900
  requestedAt: string;
4884
4901
  } | undefined;
4885
4902
  maxOutputTokens?: number | undefined;
4903
+ taskType?: string | undefined;
4886
4904
  autonomy?: "report" | "propose" | "act" | undefined;
4887
4905
  onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
4888
4906
  deliverResult?: boolean | undefined;
@@ -4909,6 +4927,7 @@ declare const daemonConfigSchema: z.ZodObject<{
4909
4927
  requestedAt: string;
4910
4928
  } | undefined;
4911
4929
  maxOutputTokens?: number | undefined;
4930
+ taskType?: string | undefined;
4912
4931
  autonomy?: "report" | "propose" | "act" | undefined;
4913
4932
  deliverResult?: boolean | undefined;
4914
4933
  fireToken?: string | undefined;
@@ -4933,6 +4952,7 @@ declare const daemonConfigSchema: z.ZodObject<{
4933
4952
  requestedAt: string;
4934
4953
  } | undefined;
4935
4954
  maxOutputTokens?: number | undefined;
4955
+ taskType?: string | undefined;
4936
4956
  autonomy?: "report" | "propose" | "act" | undefined;
4937
4957
  onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
4938
4958
  deliverResult?: boolean | undefined;
@@ -6000,18 +6020,29 @@ declare const daemonConfigSchema: z.ZodObject<{
6000
6020
  approveKinds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
6001
6021
  /** Agents that may not open a plan. */
6002
6022
  disabledAgents: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
6023
+ /** The plan gate (#1048): kinds of work an agent must plan before it
6024
+ * starts. An accept that names one of these as its `work` is refused
6025
+ * without steps. Empty: no kind needs a plan. */
6026
+ requireForWork: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
6027
+ /** An accept whose `estimateMinutes` is over this needs a plan too.
6028
+ * 0: no estimate needs one. */
6029
+ requireOverMinutes: z.ZodDefault<z.ZodNumber>;
6003
6030
  }, "strip", z.ZodTypeAny, {
6004
6031
  enabled: boolean;
6005
6032
  stallMinutes: number;
6006
6033
  maxNudges: number;
6007
6034
  approveKinds: string[];
6008
6035
  disabledAgents: string[];
6036
+ requireForWork: string[];
6037
+ requireOverMinutes: number;
6009
6038
  }, {
6010
6039
  enabled?: boolean | undefined;
6011
6040
  stallMinutes?: number | undefined;
6012
6041
  maxNudges?: number | undefined;
6013
6042
  approveKinds?: string[] | undefined;
6014
6043
  disabledAgents?: string[] | undefined;
6044
+ requireForWork?: string[] | undefined;
6045
+ requireOverMinutes?: number | undefined;
6015
6046
  }>>;
6016
6047
  /** Checkers that close an open loop on evidence (src/requests/checkers,
6017
6048
  * #1039). A loop with a `closeWhen` closes when its check is met; an
@@ -6082,6 +6113,8 @@ declare const daemonConfigSchema: z.ZodObject<{
6082
6113
  maxNudges: number;
6083
6114
  approveKinds: string[];
6084
6115
  disabledAgents: string[];
6116
+ requireForWork: string[];
6117
+ requireOverMinutes: number;
6085
6118
  };
6086
6119
  checkers: {
6087
6120
  enabled: ("reply" | "url" | "issue" | "git-ancestor")[];
@@ -6108,6 +6141,8 @@ declare const daemonConfigSchema: z.ZodObject<{
6108
6141
  maxNudges?: number | undefined;
6109
6142
  approveKinds?: string[] | undefined;
6110
6143
  disabledAgents?: string[] | undefined;
6144
+ requireForWork?: string[] | undefined;
6145
+ requireOverMinutes?: number | undefined;
6111
6146
  } | undefined;
6112
6147
  checkers?: {
6113
6148
  enabled?: ("reply" | "url" | "issue" | "git-ancestor")[] | undefined;
@@ -6158,12 +6193,38 @@ declare const daemonConfigSchema: z.ZodObject<{
6158
6193
  * delegation answers. "explicit": only POST /watchers/:id/done, so a
6159
6194
  * reply that only promises ("I'll publish at 18:00") keeps it open. */
6160
6195
  doneSignal: z.ZodDefault<z.ZodEnum<["result", "explicit"]>>;
6196
+ /** Evidence a done needs, by task type (#1049): the caller's
6197
+ * `context.taskType`, else the watcher's kind (dispatch, delegation,
6198
+ * cron). A task of a type with a rule closes only on a done whose
6199
+ * evidence the rule accepts; its reply never closes it. Types with no
6200
+ * rule close as `doneSignal` says. */
6201
+ evidence: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
6202
+ /** The kinds of proof that count: any one of them closes the task. */
6203
+ accept: z.ZodArray<z.ZodEnum<["test", "output", "link"]>, "many">;
6204
+ /** The shortest output text accepted. */
6205
+ minOutputChars: z.ZodDefault<z.ZodNumber>;
6206
+ /** Hosts a link must be on (or a subdomain of). Empty: any host. */
6207
+ linkHosts: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
6208
+ }, "strip", z.ZodTypeAny, {
6209
+ accept: ("output" | "test" | "link")[];
6210
+ minOutputChars: number;
6211
+ linkHosts: string[];
6212
+ }, {
6213
+ accept: ("output" | "test" | "link")[];
6214
+ minOutputChars?: number | undefined;
6215
+ linkHosts?: string[] | undefined;
6216
+ }>>>;
6161
6217
  }, "strip", z.ZodTypeAny, {
6162
6218
  enabled: boolean;
6163
6219
  owner: {
6164
6220
  channel?: string | undefined;
6165
6221
  chatId?: string | undefined;
6166
6222
  };
6223
+ evidence: Record<string, {
6224
+ accept: ("output" | "test" | "link")[];
6225
+ minOutputChars: number;
6226
+ linkHosts: string[];
6227
+ }>;
6167
6228
  retentionDays: number;
6168
6229
  skipChannels: string[];
6169
6230
  defaultDueMinutes: number;
@@ -6177,6 +6238,11 @@ declare const daemonConfigSchema: z.ZodObject<{
6177
6238
  channel?: string | undefined;
6178
6239
  chatId?: string | undefined;
6179
6240
  } | undefined;
6241
+ evidence?: Record<string, {
6242
+ accept: ("output" | "test" | "link")[];
6243
+ minOutputChars?: number | undefined;
6244
+ linkHosts?: string[] | undefined;
6245
+ }> | undefined;
6180
6246
  retentionDays?: number | undefined;
6181
6247
  skipChannels?: string[] | undefined;
6182
6248
  defaultDueMinutes?: number | undefined;
@@ -6190,6 +6256,11 @@ declare const daemonConfigSchema: z.ZodObject<{
6190
6256
  channel?: string | undefined;
6191
6257
  chatId?: string | undefined;
6192
6258
  };
6259
+ evidence: Record<string, {
6260
+ accept: ("output" | "test" | "link")[];
6261
+ minOutputChars: number;
6262
+ linkHosts: string[];
6263
+ }>;
6193
6264
  retentionDays: number;
6194
6265
  skipChannels: string[];
6195
6266
  defaultDueMinutes: number;
@@ -6203,6 +6274,11 @@ declare const daemonConfigSchema: z.ZodObject<{
6203
6274
  channel?: string | undefined;
6204
6275
  chatId?: string | undefined;
6205
6276
  } | undefined;
6277
+ evidence?: Record<string, {
6278
+ accept: ("output" | "test" | "link")[];
6279
+ minOutputChars?: number | undefined;
6280
+ linkHosts?: string[] | undefined;
6281
+ }> | undefined;
6206
6282
  retentionDays?: number | undefined;
6207
6283
  skipChannels?: string[] | undefined;
6208
6284
  defaultDueMinutes?: number | undefined;
@@ -6430,6 +6506,53 @@ declare const daemonConfigSchema: z.ZodObject<{
6430
6506
  pollSeconds?: number | undefined;
6431
6507
  lookbackHours?: number | undefined;
6432
6508
  }>>;
6509
+ /** The OS layer (src/native, #1062): banners, sounds, Focus and the OS
6510
+ * task app go through one adapter per OS. "none" turns it off here. */
6511
+ native: z.ZodDefault<z.ZodObject<{
6512
+ adapter: z.ZodDefault<z.ZodEnum<["auto", "none"]>>;
6513
+ /** The Reminders mirror (src/approvals/mirror.ts, #1062): each waiting
6514
+ * card and request becomes a task in the OS task app. Off by default. */
6515
+ mirror: z.ZodDefault<z.ZodObject<{
6516
+ enabled: z.ZodDefault<z.ZodBoolean>;
6517
+ /** Not "AgentX": that is reminders.lists' default, and a list both
6518
+ * mirrored and watched would loop. */
6519
+ list: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
6520
+ dueAfterMinutes: z.ZodDefault<z.ZodNumber>;
6521
+ include: z.ZodDefault<z.ZodArray<z.ZodEnum<["card", "request"]>, "many">>;
6522
+ /** Where the owner answers. Unset: the local dashboard's Approvals page. */
6523
+ answerUrl: z.ZodOptional<z.ZodString>;
6524
+ }, "strip", z.ZodTypeAny, {
6525
+ enabled: boolean;
6526
+ list: string;
6527
+ dueAfterMinutes: number;
6528
+ include: ("card" | "request")[];
6529
+ answerUrl?: string | undefined;
6530
+ }, {
6531
+ enabled?: boolean | undefined;
6532
+ list?: string | undefined;
6533
+ dueAfterMinutes?: number | undefined;
6534
+ include?: ("card" | "request")[] | undefined;
6535
+ answerUrl?: string | undefined;
6536
+ }>>;
6537
+ }, "strip", z.ZodTypeAny, {
6538
+ adapter: "auto" | "none";
6539
+ mirror: {
6540
+ enabled: boolean;
6541
+ list: string;
6542
+ dueAfterMinutes: number;
6543
+ include: ("card" | "request")[];
6544
+ answerUrl?: string | undefined;
6545
+ };
6546
+ }, {
6547
+ adapter?: "auto" | "none" | undefined;
6548
+ mirror?: {
6549
+ enabled?: boolean | undefined;
6550
+ list?: string | undefined;
6551
+ dueAfterMinutes?: number | undefined;
6552
+ include?: ("card" | "request")[] | undefined;
6553
+ answerUrl?: string | undefined;
6554
+ } | undefined;
6555
+ }>>;
6433
6556
  /** The phone app (/app) beyond pairing and notifications (#676). */
6434
6557
  app: z.ZodDefault<z.ZodObject<{
6435
6558
  /** The AgentX Android app (apps/android). Chrome shows it full screen,
@@ -8957,6 +9080,8 @@ declare const daemonConfigSchema: z.ZodObject<{
8957
9080
  maxNudges: number;
8958
9081
  approveKinds: string[];
8959
9082
  disabledAgents: string[];
9083
+ requireForWork: string[];
9084
+ requireOverMinutes: number;
8960
9085
  };
8961
9086
  checkers: {
8962
9087
  enabled: ("reply" | "url" | "issue" | "git-ancestor")[];
@@ -9153,6 +9278,7 @@ declare const daemonConfigSchema: z.ZodObject<{
9153
9278
  requestedAt: string;
9154
9279
  } | undefined;
9155
9280
  maxOutputTokens?: number | undefined;
9281
+ taskType?: string | undefined;
9156
9282
  autonomy?: "report" | "propose" | "act" | undefined;
9157
9283
  deliverResult?: boolean | undefined;
9158
9284
  fireToken?: string | undefined;
@@ -9387,6 +9513,11 @@ declare const daemonConfigSchema: z.ZodObject<{
9387
9513
  channel?: string | undefined;
9388
9514
  chatId?: string | undefined;
9389
9515
  };
9516
+ evidence: Record<string, {
9517
+ accept: ("output" | "test" | "link")[];
9518
+ minOutputChars: number;
9519
+ linkHosts: string[];
9520
+ }>;
9390
9521
  retentionDays: number;
9391
9522
  skipChannels: string[];
9392
9523
  defaultDueMinutes: number;
@@ -9436,6 +9567,16 @@ declare const daemonConfigSchema: z.ZodObject<{
9436
9567
  pollSeconds: number;
9437
9568
  lookbackHours: number;
9438
9569
  };
9570
+ native: {
9571
+ adapter: "auto" | "none";
9572
+ mirror: {
9573
+ enabled: boolean;
9574
+ list: string;
9575
+ dueAfterMinutes: number;
9576
+ include: ("card" | "request")[];
9577
+ answerUrl?: string | undefined;
9578
+ };
9579
+ };
9439
9580
  meshVoices: Record<string, {
9440
9581
  system?: string | Record<string, string> | undefined;
9441
9582
  provider?: "system" | "elevenlabs" | undefined;
@@ -10091,6 +10232,8 @@ declare const daemonConfigSchema: z.ZodObject<{
10091
10232
  maxNudges?: number | undefined;
10092
10233
  approveKinds?: string[] | undefined;
10093
10234
  disabledAgents?: string[] | undefined;
10235
+ requireForWork?: string[] | undefined;
10236
+ requireOverMinutes?: number | undefined;
10094
10237
  } | undefined;
10095
10238
  checkers?: {
10096
10239
  enabled?: ("reply" | "url" | "issue" | "git-ancestor")[] | undefined;
@@ -10279,6 +10422,7 @@ declare const daemonConfigSchema: z.ZodObject<{
10279
10422
  requestedAt: string;
10280
10423
  } | undefined;
10281
10424
  maxOutputTokens?: number | undefined;
10425
+ taskType?: string | undefined;
10282
10426
  autonomy?: "report" | "propose" | "act" | undefined;
10283
10427
  onError?: "notify" | "disable" | "log" | ("notify" | "disable" | "log")[] | undefined;
10284
10428
  deliverResult?: boolean | undefined;
@@ -10514,6 +10658,11 @@ declare const daemonConfigSchema: z.ZodObject<{
10514
10658
  channel?: string | undefined;
10515
10659
  chatId?: string | undefined;
10516
10660
  } | undefined;
10661
+ evidence?: Record<string, {
10662
+ accept: ("output" | "test" | "link")[];
10663
+ minOutputChars?: number | undefined;
10664
+ linkHosts?: string[] | undefined;
10665
+ }> | undefined;
10517
10666
  retentionDays?: number | undefined;
10518
10667
  skipChannels?: string[] | undefined;
10519
10668
  defaultDueMinutes?: number | undefined;
@@ -10563,6 +10712,16 @@ declare const daemonConfigSchema: z.ZodObject<{
10563
10712
  pollSeconds?: number | undefined;
10564
10713
  lookbackHours?: number | undefined;
10565
10714
  } | undefined;
10715
+ native?: {
10716
+ adapter?: "auto" | "none" | undefined;
10717
+ mirror?: {
10718
+ enabled?: boolean | undefined;
10719
+ list?: string | undefined;
10720
+ dueAfterMinutes?: number | undefined;
10721
+ include?: ("card" | "request")[] | undefined;
10722
+ answerUrl?: string | undefined;
10723
+ } | undefined;
10724
+ } | undefined;
10566
10725
  meshVoices?: Record<string, {
10567
10726
  system?: string | Record<string, string> | undefined;
10568
10727
  provider?: "system" | "elevenlabs" | undefined;
@@ -10941,6 +11100,9 @@ declare class A2AMesh {
10941
11100
  /** This node checked its own operator key on the forward: tell the
10942
11101
  * peer the turn is the owner's (requests/operator, #407). */
10943
11102
  vouchOwner?: boolean;
11103
+ /** The task's type (#1049): picks the evidence the peer's watcher
11104
+ * asks for before the task counts as done. */
11105
+ taskType?: string;
10944
11106
  }): Promise<string>;
10945
11107
  /**
10946
11108
  * Streaming variant of `sendTask`. POSTs to the peer's `/task` with
@@ -11174,6 +11336,9 @@ interface AgentXEvents {
11174
11336
  /** When the task is due (ms), when the caller gave one in the run's
11175
11337
  * context as `dueAt` (watchers, #1030). */
11176
11338
  dueAt?: number;
11339
+ /** The task's type, when the caller gave one in the run's context as
11340
+ * `taskType`: it picks the evidence a done needs (watchers, #1049). */
11341
+ taskType?: string;
11177
11342
  };
11178
11343
  /** A single step inside an in-flight task — typically a tool call or
11179
11344
  * tool result inside the Claude streaming response. Producer is the
@@ -11439,6 +11604,9 @@ declare class EventBus {
11439
11604
 
11440
11605
  declare class AgentXDaemon {
11441
11606
  private config;
11607
+ /** The OS layer (src/native). Read from the config on each use, so a
11608
+ * reload that changes native.adapter or reminders.command applies. */
11609
+ private get native();
11442
11610
  private registry;
11443
11611
  private router;
11444
11612
  private cron;
@@ -11636,6 +11804,10 @@ declare class AgentXDaemon {
11636
11804
  /** On the push host: the subscriptions table relayed phones use (#711). */
11637
11805
  private pushHost?;
11638
11806
  private approvalsSweeping;
11807
+ private mirroring;
11808
+ /** One pass of the Reminders mirror, when it is on and this machine
11809
+ * has a task app (src/approvals/mirror.ts). */
11810
+ private mirrorTick;
11639
11811
  /** Every minute: expire decision cards, tell agents their results, and
11640
11812
  * send the day's digest when due (src/approvals/sweep.ts). */
11641
11813
  private startApprovalsSweep;
@@ -11689,7 +11861,7 @@ declare class AgentXDaemon {
11689
11861
  /** A follow-up run ended: its request closes with the steps' evidence,
11690
11862
  * or needs attention (the summary already told the owner). */
11691
11863
  private workflowRequestEnded;
11692
- /** A check-in pass when one is due, or `force` now. macOS only. */
11864
+ /** A check-in pass when one is due, or `force` now. Needs the OS task app. */
11693
11865
  runCheckin(force?: PassKind): Promise<PassResult | null>;
11694
11866
  private stopReminders?;
11695
11867
  /** Hand due Apple Reminders back to the agent that created them (src/reminders). */
@@ -15730,6 +15902,8 @@ declare class AgentRegistry {
15730
15902
  * the requested agent before returning "Unknown agent". Duck-typed so
15731
15903
  * we don't create a circular import with src/a2a/mesh.ts. */
15732
15904
  private meshFallback?;
15905
+ /** See setRunNote. */
15906
+ private runNote?;
15733
15907
  /** Workflow auto-runner — invoked when workflow matching is in `mode: "auto"`
15734
15908
  * and a candidate workflow's confidence ≥ autoRunThreshold. Wired by the
15735
15909
  * daemon after the workflow dispatcher is constructed. Returns the runId of
@@ -15808,6 +15982,10 @@ declare class AgentRegistry {
15808
15982
  * after WorkflowDispatcher boot. Pass undefined to detach (e.g. during
15809
15983
  * reload). */
15810
15984
  setWorkflowRunStore(runs: RunStore | undefined): void;
15985
+ /** Wire the watcher's note for a run's prompt (#1049): how to close the
15986
+ * watcher only that run can close. The daemon calls this once watchers
15987
+ * attach; unset, no note is added. */
15988
+ setRunNote(note: ((started: AgentXEvents["task:started"]) => string | undefined) | undefined): void;
15811
15989
  setWorkflowAutoRunner(runner: NonNullable<AgentRegistry["workflowAutoRunner"]> | undefined): void;
15812
15990
  /** Hot-swap the provider map. Daemon reload calls this after agentx.json
15813
15991
  * changes — the next task that executes will resolve credentials through
@@ -17793,6 +17971,8 @@ interface CronJobState {
17793
17971
  * via the prompt tail; reliably honored and keeps cache-hit intact
17794
17972
  * (hint text is per-job, not per-run). */
17795
17973
  maxOutputTokens?: number;
17974
+ /** The run's `context.taskType` (watchers' evidence rules, #1049). */
17975
+ taskType?: string;
17796
17976
  /** Routine autonomy level; unset = act (full agent permissions). */
17797
17977
  autonomy?: AutonomyLevel;
17798
17978
  onError: Array<"log" | "notify" | "disable">;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{Aa as Tt,Ba as Mt,a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,h as bt}from"./chunk-HCSIM2QW.js";import"./chunk-VXBL2DET.js";import"./chunk-GTJIKXDB.js";import"./chunk-WUBSX6S5.js";import"./chunk-S2GAEH2F.js";import"./chunk-7LN4VKDU.js";import"./chunk-IMLAPB7G.js";import"./chunk-ZVP6GB4G.js";import"./chunk-2D3RYIDU.js";import"./chunk-MRIVENBY.js";import"./chunk-MMBFAVBR.js";import"./chunk-TJZGAKIB.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-QXPMWP4R.js";import"./chunk-AQASR6KR.js";import"./chunk-EMGB23H5.js";import"./chunk-JAML6222.js";import"./chunk-YMX3QCV7.js";import"./chunk-JWDJMFU6.js";import"./chunk-5HLD66CW.js";import"./chunk-IS2IWRP7.js";import"./chunk-LQE73AZR.js";import"./chunk-VY7TBMJU.js";import"./chunk-DG2DC43E.js";import"./chunk-WBG6NA7R.js";import"./chunk-SANYTBHX.js";import"./chunk-A5GYG56I.js";import"./chunk-2AXFYDWF.js";import{m as lt,n as ct,na as yt,o as dt,p as mt,q as pt}from"./chunk-YWDXRGVC.js";import"./chunk-P42M6CYF.js";import"./chunk-MEFPXHQJ.js";import{a as L}from"./chunk-UG2OF2EI.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-GMVWDQFF.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-6TTGRTDO.js";import"./chunk-SZDACK6O.js";import"./chunk-VE3SSOQX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-5TTHN7DP.js";import{s as ut}from"./chunk-LJ62ABOZ.js";import"./chunk-VMMCT27Z.js";import"./chunk-3UOTLMXD.js";import"./chunk-36AXN6ZB.js";import"./chunk-PE5V2LI7.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-VWTBHLMX.js";import"./chunk-VTVEJ3RA.js";import{a as ht}from"./chunk-HP2NWDCS.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-YUY35PY7.js";import"./chunk-SKSYII3K.js";import{f as gt,g as ft}from"./chunk-BPOMIEEE.js";import"./chunk-WPNRDEHW.js";import"./chunk-MWNCS57L.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-KAGLCJA3.js";import{j as it,k as rt,l as at}from"./chunk-SH5TNMS5.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-6TURWSMN.js";import"./chunk-AV7T3SYT.js";import"./chunk-Y5MFVVTM.js";import"./chunk-QD6IICK7.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-2PJKGZWP.js";import{a as m,b as G}from"./chunk-7I7IEX4S.js";import{b as Fe,c as Le,d as A,e as De}from"./chunk-JHCI6XCJ.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{Ja as tt,La as st,Ma as ot,Ta as nt}from"./chunk-4NKPVTVP.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.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{Aa as Tt,Ba as Mt,a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,h as bt}from"./chunk-ZZNAR6R2.js";import"./chunk-JCFVH3NC.js";import"./chunk-GTJIKXDB.js";import"./chunk-7T6SMNVY.js";import"./chunk-Z3AI4KXT.js";import"./chunk-7LN4VKDU.js";import"./chunk-IMLAPB7G.js";import"./chunk-ZVP6GB4G.js";import"./chunk-2D3RYIDU.js";import"./chunk-MRIVENBY.js";import"./chunk-MMBFAVBR.js";import"./chunk-TJZGAKIB.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-P5BFFU4Y.js";import"./chunk-AQASR6KR.js";import"./chunk-EMGB23H5.js";import"./chunk-JAML6222.js";import"./chunk-YMX3QCV7.js";import"./chunk-JWDJMFU6.js";import"./chunk-5HLD66CW.js";import"./chunk-IS2IWRP7.js";import"./chunk-LQE73AZR.js";import"./chunk-VY7TBMJU.js";import"./chunk-PYHR4HXO.js";import"./chunk-KP7KDLZ2.js";import"./chunk-GJMYG53S.js";import"./chunk-A5GYG56I.js";import"./chunk-2AXFYDWF.js";import{m as lt,n as ct,o as dt,p as mt,pa as yt,q as pt}from"./chunk-7W3TLSZQ.js";import"./chunk-KW6SHOAN.js";import"./chunk-MEFPXHQJ.js";import{a as L}from"./chunk-UG2OF2EI.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-MXDTLR45.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-6TTGRTDO.js";import"./chunk-SZDACK6O.js";import"./chunk-VE3SSOQX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-5TTHN7DP.js";import{s as ut}from"./chunk-P6PFTNN4.js";import"./chunk-E7YHXMJG.js";import"./chunk-3UOTLMXD.js";import"./chunk-36AXN6ZB.js";import"./chunk-PE5V2LI7.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-VWTBHLMX.js";import"./chunk-PUW4C6YO.js";import{a as ht}from"./chunk-UVF3K5YS.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-7HCSLOTP.js";import"./chunk-SKSYII3K.js";import{f as gt,g as ft}from"./chunk-Q2QU32JP.js";import"./chunk-WPNRDEHW.js";import"./chunk-MWNCS57L.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-EKAUOUN2.js";import{j as it,k as rt,l as at}from"./chunk-5TGY4RIQ.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-6TURWSMN.js";import"./chunk-AV7T3SYT.js";import"./chunk-Y5MFVVTM.js";import"./chunk-QD6IICK7.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-2PJKGZWP.js";import{a as m,b as G}from"./chunk-7I7IEX4S.js";import{b as Fe,c as Le,d as A,e as De}from"./chunk-JHCI6XCJ.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{Ja as tt,La as st,Na as ot,Ua as nt}from"./chunk-6UP5VD3H.js";import"./chunk-BRK6M6LA.js";import"./chunk-UIBUZ2N3.js";import"./chunk-2QNT5JDS.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-YFVSSYSL.js");return e(o)}async function Ot(o,e,t,s,i){let a=[{role:"system",content:`You are a skill author for the Agent Skills ecosystem (skills.sh).