dispach 0.2.4 → 0.2.13

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 (187) hide show
  1. package/README.md +32 -33
  2. package/dist/APEv2Parser-rt8hyadd.js +5 -0
  3. package/dist/{FlacParser-8xprykrh.js.map → APEv2Parser-rt8hyadd.js.map} +1 -1
  4. package/dist/{AiffParser-ns1y9f0g.js → AiffParser-gvpmtb2e.js} +3 -3
  5. package/dist/{AiffParser-ns1y9f0g.js.map → AiffParser-gvpmtb2e.js.map} +1 -1
  6. package/dist/{App-wkpkwgjt.js → App-18dvbyev.js} +8 -8
  7. package/dist/{App-wkpkwgjt.js.map → App-18dvbyev.js.map} +1 -1
  8. package/dist/{AsfParser-bae2a1yf.js → AsfParser-h9zyh6cx.js} +3 -3
  9. package/dist/{AsfParser-bae2a1yf.js.map → AsfParser-h9zyh6cx.js.map} +1 -1
  10. package/dist/{ConfigEditor-hy9jtas3.js → ConfigEditor-444m13ta.js} +3 -3
  11. package/dist/{ConfigEditor-hy9jtas3.js.map → ConfigEditor-444m13ta.js.map} +1 -1
  12. package/dist/{DsdiffParser-s0zvxnfa.js → DsdiffParser-gxqv4gn1.js} +3 -3
  13. package/dist/{DsdiffParser-s0zvxnfa.js.map → DsdiffParser-gxqv4gn1.js.map} +1 -1
  14. package/dist/{DsfParser-90mvzt4v.js → DsfParser-sndt4jbk.js} +3 -3
  15. package/dist/{DsfParser-90mvzt4v.js.map → DsfParser-sndt4jbk.js.map} +1 -1
  16. package/dist/FlacParser-rmkpvf9e.js +5 -0
  17. package/dist/{APEv2Parser-x13n424p.js.map → FlacParser-rmkpvf9e.js.map} +1 -1
  18. package/dist/{KeyProbe-fk5krzks.js → KeyProbe-6t531sy6.js} +3 -3
  19. package/dist/{KeyProbe-fk5krzks.js.map → KeyProbe-6t531sy6.js.map} +1 -1
  20. package/dist/{MP4Parser-nmvbkq21.js → MP4Parser-87xfsck4.js} +3 -3
  21. package/dist/{MP4Parser-nmvbkq21.js.map → MP4Parser-87xfsck4.js.map} +1 -1
  22. package/dist/{MatroskaParser-tsmz2qfq.js → MatroskaParser-7krspfgx.js} +3 -3
  23. package/dist/{MatroskaParser-tsmz2qfq.js.map → MatroskaParser-7krspfgx.js.map} +1 -1
  24. package/dist/{MpegParser-y5fjpaz9.js → MpegParser-jcs35q0h.js} +3 -3
  25. package/dist/{MpegParser-y5fjpaz9.js.map → MpegParser-jcs35q0h.js.map} +1 -1
  26. package/dist/{MusepackParser-544q0byg.js → MusepackParser-d4zfnzk3.js} +3 -3
  27. package/dist/{MusepackParser-544q0byg.js.map → MusepackParser-d4zfnzk3.js.map} +1 -1
  28. package/dist/{OggParser-v77rbjnt.js → OggParser-fbspjs7v.js} +3 -3
  29. package/dist/{OggParser-v77rbjnt.js.map → OggParser-fbspjs7v.js.map} +1 -1
  30. package/dist/{Picker-32m79nmp.js → Picker-x6aj42tc.js} +3 -3
  31. package/dist/{Picker-32m79nmp.js.map → Picker-x6aj42tc.js.map} +1 -1
  32. package/dist/{SessionPicker-9p06npt5.js → SessionPicker-pngdv97x.js} +3 -3
  33. package/dist/{SessionPicker-9p06npt5.js.map → SessionPicker-pngdv97x.js.map} +1 -1
  34. package/dist/{SkillBrowser-ezdx3xsh.js → SkillBrowser-3mnzkakr.js} +3 -3
  35. package/dist/{SkillBrowser-ezdx3xsh.js.map → SkillBrowser-3mnzkakr.js.map} +1 -1
  36. package/dist/{WavPackParser-k623m0hk.js → WavPackParser-0x9z4466.js} +3 -3
  37. package/dist/{WavPackParser-k623m0hk.js.map → WavPackParser-0x9z4466.js.map} +1 -1
  38. package/dist/{WaveParser-nj4p1vx8.js → WaveParser-31b6qtef.js} +3 -3
  39. package/dist/{WaveParser-nj4p1vx8.js.map → WaveParser-31b6qtef.js.map} +1 -1
  40. package/dist/{WizardApp-p350qspw.js → WizardApp-c42wc116.js} +3 -3
  41. package/dist/{WizardApp-p350qspw.js.map → WizardApp-c42wc116.js.map} +1 -1
  42. package/dist/{channels-a9zx9yba.js → channels-nf6d8fvx.js} +14 -14
  43. package/dist/{channels-a9zx9yba.js.map → channels-nf6d8fvx.js.map} +1 -1
  44. package/dist/client.d.ts +1 -1
  45. package/dist/client.js +11 -11
  46. package/dist/client.js.map +4 -4
  47. package/dist/{config-3mz4zwsf.js → config-sx40rg8m.js} +21 -21
  48. package/dist/{config-3mz4zwsf.js.map → config-sx40rg8m.js.map} +1 -1
  49. package/dist/{credential-ja7zmd4c.js → credential-vdbkfk65.js} +5 -5
  50. package/dist/{credential-ja7zmd4c.js.map → credential-vdbkfk65.js.map} +1 -1
  51. package/dist/daemon.d.ts.map +1 -1
  52. package/dist/{index-dcy14zdn.js → index-0dcpsfet.js} +5 -5
  53. package/dist/{index-dcy14zdn.js.map → index-0dcpsfet.js.map} +1 -1
  54. package/dist/{index-a1axc952.js → index-1h8s50d9.js} +4 -4
  55. package/dist/{index-a1axc952.js.map → index-1h8s50d9.js.map} +1 -1
  56. package/dist/{index-ayhdn87b.js → index-1hbvhrsj.js} +4 -4
  57. package/dist/{index-ayhdn87b.js.map → index-1hbvhrsj.js.map} +1 -1
  58. package/dist/{index-5gn74n56.js → index-1hfece7s.js} +7 -7
  59. package/dist/{index-5gn74n56.js.map → index-1hfece7s.js.map} +1 -1
  60. package/dist/{index-0dvs3a06.js → index-2h566rtg.js} +4 -4
  61. package/dist/{index-0dvs3a06.js.map → index-2h566rtg.js.map} +1 -1
  62. package/dist/{index-zzpgsbn3.js → index-4fj1k64j.js} +4 -4
  63. package/dist/{index-zzpgsbn3.js.map → index-4fj1k64j.js.map} +1 -1
  64. package/dist/{index-gezqawvw.js → index-4g4smpkk.js} +5 -5
  65. package/dist/{index-gezqawvw.js.map → index-4g4smpkk.js.map} +1 -1
  66. package/dist/index-4gfsf9n8.js +6 -0
  67. package/dist/{index-tc054tcb.js.map → index-4gfsf9n8.js.map} +1 -1
  68. package/dist/{index-mgef1n4e.js → index-5ptbytze.js} +9 -9
  69. package/dist/{index-mgef1n4e.js.map → index-5ptbytze.js.map} +1 -1
  70. package/dist/{index-f6r3h2yh.js → index-5s1cq8np.js} +5 -5
  71. package/dist/{index-f6r3h2yh.js.map → index-5s1cq8np.js.map} +1 -1
  72. package/dist/{index-rqfwd7j5.js → index-659ggfbf.js} +4 -4
  73. package/dist/{index-rqfwd7j5.js.map → index-659ggfbf.js.map} +1 -1
  74. package/dist/index-6ebppx3t.js +6 -0
  75. package/dist/{index-x9nn57kk.js.map → index-6ebppx3t.js.map} +1 -1
  76. package/dist/{index-4j65jp20.js → index-6pym9p8h.js} +6 -6
  77. package/dist/{index-4j65jp20.js.map → index-6pym9p8h.js.map} +1 -1
  78. package/dist/index-9ejax6hp.js +6 -0
  79. package/dist/{index-s0t15ndj.js.map → index-9ejax6hp.js.map} +1 -1
  80. package/dist/{index-86rb86nr.js → index-9hw9j1qg.js} +4 -4
  81. package/dist/{index-86rb86nr.js.map → index-9hw9j1qg.js.map} +1 -1
  82. package/dist/{index-yz0fcxky.js → index-9xhresrg.js} +4 -4
  83. package/dist/{index-yz0fcxky.js.map → index-9xhresrg.js.map} +1 -1
  84. package/dist/{index-2td5h856.js → index-abm0zyc0.js} +6 -6
  85. package/dist/{index-2td5h856.js.map → index-abm0zyc0.js.map} +1 -1
  86. package/dist/{index-8k8y7edx.js → index-ar5c9d2f.js} +5 -5
  87. package/dist/{index-8k8y7edx.js.map → index-ar5c9d2f.js.map} +1 -1
  88. package/dist/index-bhj4pmrx.js +74 -0
  89. package/dist/index-bhj4pmrx.js.map +13 -0
  90. package/dist/{index-brh25jhq.js → index-brt17yfr.js} +3 -3
  91. package/dist/{index-brh25jhq.js.map → index-brt17yfr.js.map} +1 -1
  92. package/dist/index-bysnsdkd.js +6 -0
  93. package/dist/{index-c6qrcweh.js.map → index-bysnsdkd.js.map} +1 -1
  94. package/dist/{index-kz01jz58.js → index-c74wx9pv.js} +4 -4
  95. package/dist/{index-kz01jz58.js.map → index-c74wx9pv.js.map} +1 -1
  96. package/dist/{index-qj4adnfe.js → index-cm3g4t3r.js} +9 -9
  97. package/dist/{index-qj4adnfe.js.map → index-cm3g4t3r.js.map} +1 -1
  98. package/dist/{index-8mkatm20.js → index-dzp6mc5h.js} +4 -4
  99. package/dist/{index-8mkatm20.js.map → index-dzp6mc5h.js.map} +1 -1
  100. package/dist/{index-b8bfzbfe.js → index-fad09b8c.js} +4 -4
  101. package/dist/{index-b8bfzbfe.js.map → index-fad09b8c.js.map} +1 -1
  102. package/dist/{index-2fw9e5gg.js → index-fvb2dxzn.js} +4 -4
  103. package/dist/{index-2fw9e5gg.js.map → index-fvb2dxzn.js.map} +1 -1
  104. package/dist/index-gpq4agva.js +5 -0
  105. package/dist/{index-635wcsh1.js.map → index-gpq4agva.js.map} +1 -1
  106. package/dist/index-hcpvk5de.js +5 -0
  107. package/dist/{index-7zgjkbb0.js.map → index-hcpvk5de.js.map} +1 -1
  108. package/dist/{index-s0f0s6n5.js → index-jv5t63tp.js} +4 -4
  109. package/dist/{index-s0f0s6n5.js.map → index-jv5t63tp.js.map} +1 -1
  110. package/dist/{index-60h4knj6.js → index-kyz4t0j0.js} +59 -59
  111. package/dist/{index-60h4knj6.js.map → index-kyz4t0j0.js.map} +1 -1
  112. package/dist/{index-7p8d1gf0.js → index-m6r2sxcw.js} +23 -23
  113. package/dist/{index-7p8d1gf0.js.map → index-m6r2sxcw.js.map} +1 -1
  114. package/dist/{index-4fajxhdv.js → index-mhw3d7af.js} +4 -4
  115. package/dist/{index-4fajxhdv.js.map → index-mhw3d7af.js.map} +1 -1
  116. package/dist/{index-h787rq0h.js → index-mk7hrzq7.js} +10 -10
  117. package/dist/{index-h787rq0h.js.map → index-mk7hrzq7.js.map} +1 -1
  118. package/dist/{index-r83jpct7.js → index-n0hqgwad.js} +4 -4
  119. package/dist/{index-r83jpct7.js.map → index-n0hqgwad.js.map} +1 -1
  120. package/dist/{index-k6wq0j4q.js → index-ncb840sk.js} +4 -4
  121. package/dist/{index-k6wq0j4q.js.map → index-ncb840sk.js.map} +1 -1
  122. package/dist/{index-8jejze0z.js → index-ntczmwnf.js} +3 -3
  123. package/dist/{index-8jejze0z.js.map → index-ntczmwnf.js.map} +1 -1
  124. package/dist/{index-ts8a1sdn.js → index-p5gy5s7p.js} +6 -6
  125. package/dist/{index-ts8a1sdn.js.map → index-p5gy5s7p.js.map} +1 -1
  126. package/dist/index-p86w0qjw.js +5 -0
  127. package/dist/{index-pz92ksp8.js.map → index-p86w0qjw.js.map} +1 -1
  128. package/dist/{index-cb45233h.js → index-qhh30m9p.js} +4 -4
  129. package/dist/{index-cb45233h.js.map → index-qhh30m9p.js.map} +1 -1
  130. package/dist/{index-z4adxmzm.js → index-rerdsr3d.js} +5 -5
  131. package/dist/{index-z4adxmzm.js.map → index-rerdsr3d.js.map} +1 -1
  132. package/dist/{index-67sfck4d.js → index-s0mfq8t7.js} +18 -18
  133. package/dist/index-s0mfq8t7.js.map +11 -0
  134. package/dist/{index-9k6qa50r.js → index-s9ybp2r1.js} +6 -6
  135. package/dist/{index-9k6qa50r.js.map → index-s9ybp2r1.js.map} +1 -1
  136. package/dist/index-ss77hvwy.js +1246 -0
  137. package/dist/{index-tv52jhac.js.map → index-ss77hvwy.js.map} +32 -31
  138. package/dist/{index-yy4v9kca.js → index-t9bnt6a1.js} +4 -4
  139. package/dist/{index-yy4v9kca.js.map → index-t9bnt6a1.js.map} +1 -1
  140. package/dist/{index-5zpfz4kb.js → index-w2ss9hn5.js} +7 -7
  141. package/dist/{index-5zpfz4kb.js.map → index-w2ss9hn5.js.map} +1 -1
  142. package/dist/{index-1cagdzqe.js → index-w80shmpv.js} +2 -2
  143. package/dist/index-w8e8qxd4.js +337 -0
  144. package/dist/index-w8e8qxd4.js.map +21 -0
  145. package/dist/{index-xyh98x7p.js → index-z9r4e0yq.js} +4 -4
  146. package/dist/{index-xyh98x7p.js.map → index-z9r4e0yq.js.map} +1 -1
  147. package/dist/{index-039ew35r.js → index-zj87j4j2.js} +4 -4
  148. package/dist/{index-039ew35r.js.map → index-zj87j4j2.js.map} +1 -1
  149. package/dist/{index-446exxcb.js → index-zmerx9rc.js} +7 -7
  150. package/dist/{index-446exxcb.js.map → index-zmerx9rc.js.map} +1 -1
  151. package/dist/{index-nndwx2wp.js → index-zqjtjs7c.js} +39 -39
  152. package/dist/{index-nndwx2wp.js.map → index-zqjtjs7c.js.map} +1 -1
  153. package/dist/index.js +318 -305
  154. package/dist/index.js.map +6 -5
  155. package/dist/lib/launchd.d.ts.map +1 -1
  156. package/dist/lib/service-env.d.ts.map +1 -1
  157. package/dist/lib/templates.d.ts.map +1 -1
  158. package/dist/lib/theme.d.ts.map +1 -1
  159. package/dist/lib/watchdog.d.ts +20 -0
  160. package/dist/lib/watchdog.d.ts.map +1 -0
  161. package/dist/serve.d.ts.map +1 -1
  162. package/dist/skills.d.ts.map +1 -1
  163. package/dist/sources.d.ts.map +1 -1
  164. package/dist/{web-7mdrcb8a.js → web-zvf80ns1.js} +5 -5
  165. package/dist/{web-7mdrcb8a.js.map → web-zvf80ns1.js.map} +1 -1
  166. package/dist/wire.js +11 -11
  167. package/dist/wire.js.map +4 -4
  168. package/dist/wrapper-5zhcdmnk.js +5 -0
  169. package/dist/{wrapper-4hdmdwft.js.map → wrapper-5zhcdmnk.js.map} +1 -1
  170. package/package.json +4 -4
  171. package/dist/APEv2Parser-x13n424p.js +0 -5
  172. package/dist/FlacParser-8xprykrh.js +0 -5
  173. package/dist/index-635wcsh1.js +0 -5
  174. package/dist/index-67sfck4d.js.map +0 -13
  175. package/dist/index-7zgjkbb0.js +0 -5
  176. package/dist/index-c6qrcweh.js +0 -6
  177. package/dist/index-hd5nkwd7.js +0 -74
  178. package/dist/index-hd5nkwd7.js.map +0 -13
  179. package/dist/index-n197qdw1.js +0 -308
  180. package/dist/index-n197qdw1.js.map +0 -21
  181. package/dist/index-pz92ksp8.js +0 -5
  182. package/dist/index-s0t15ndj.js +0 -6
  183. package/dist/index-tc054tcb.js +0 -6
  184. package/dist/index-tv52jhac.js +0 -1252
  185. package/dist/index-x9nn57kk.js +0 -6
  186. package/dist/wrapper-4hdmdwft.js +0 -5
  187. /package/dist/{index-1cagdzqe.js.map → index-w80shmpv.js.map} +0 -0
@@ -5,6 +5,6 @@
5
5
  "/**\n * Reading a modifier off the bytes, because Ink's reading of it is lossy.\n *\n * ## The defect this exists for\n *\n * Warp sends `cmd+left` as `CSI 1;9D` — modifier 9, which decodes to the super bit — and **omits the\n * event-type field**. Ink's kitty branch for special keys requires that field (its regex demands a\n * `:<event>` group), so the sequence falls through to its legacy branch, which does:\n *\n * key.meta = key.meta || !!(modifier & 10)\n *\n * `10` is `alt | super`. With modifier 8 that is `8 & 10 === 8`, truthy — so **super arrives as meta**,\n * and `cmd+left` becomes indistinguishable from `option+left` before our keymap is called at all.\n * Reported from a real session: both chords navigated by word, which is the only symptom this can have.\n *\n * Negotiating `reportEventTypes` was supposed to avoid this by making Warp include the field. It does not\n * — measured by the symptom, not assumed — and a fix that depends on a terminal populating an optional\n * field is a fix that works on some terminals. So the modifier is decoded here, from the bytes, where it\n * is unambiguous: bit 8 is super whether or not an event type follows it.\n *\n * ## Why this is not a second parser\n *\n * It reads *one* field. Key identity still comes from Ink — `leftArrow`, `home`, `input` — and this only\n * overrides the four modifier flags, and only when a sequence was actually found and matched to the key\n * Ink reported. Anything unrecognised leaves the key exactly as it arrived, so the worst case is today's\n * behaviour rather than a new class of wrong.\n */\n\nimport type { KeyState } from \"#lib/types\"\n\n/** Modifier bits, per the xterm and kitty encodings: the wire value is `1 + these`. */\nconst SHIFT = 1\nconst ALT = 2\nconst CTRL = 4\nconst SUPER = 8\n\n/** One modified key found in a chunk. `final` identifies the key for CSI forms, `param` for `u`. */\nexport interface CsiKey {\n readonly modifier: number\n readonly final: string\n /** The first parameter: a key number for `~` forms, a codepoint for `u`, else 1. */\n readonly param: number\n readonly eventType: \"press\" | \"repeat\" | \"release\" | undefined\n}\n\n/**\n * Every modified key in a chunk, oldest first.\n *\n * Matches `CSI <param> ; <modifier> [: <event>] <final>`, which covers the arrows (`A`-`D`), Home and End\n * (`H`/`F`), the tilde forms (`1~` `3~` `4~` `5~` `6~` `7~` `8~`) and kitty's letter form (`u`) in one\n * expression, because they differ only in the final byte. A sequence with no modifier parameter is skipped\n * — there is nothing to correct on an unmodified key. The leading escape is not required: Ink strips one\n * from the front of a chunk before a handler sees it, the same reason `lib/mouse.ts` anchors instead.\n */\nexport function csiKeys(chunk: string): readonly CsiKey[] {\n const found: CsiKey[] = []\n const pattern = /\\[(\\d+);(\\d+)(?::(\\d+))?([A-Za-z~])/g\n for (const match of chunk.matchAll(pattern)) {\n const param = Number(match[1])\n const modifier = Number(match[2])\n const event = match[3]\n const final = match[4] ?? \"\"\n if (!Number.isFinite(param) || !Number.isFinite(modifier) || modifier < 1) continue\n found.push({\n modifier,\n final,\n param,\n eventType:\n event === undefined\n ? undefined\n : event === \"3\"\n ? \"release\"\n : event === \"2\"\n ? \"repeat\"\n : \"press\",\n })\n }\n return found\n}\n\n/**\n * A terminal *reply*, not a keystroke: `CSI ? <flags> u`.\n *\n * Ink asks the terminal for its kitty-keyboard flags at mount, waits 200 ms, and strips the answer out of\n * stdin if one arrives in time. Measured in a real Warp session: it arrived **late**, the window had\n * closed, and the bytes fell through to `useInput` as ordinary text — `input \"[?0u\"`, resolving to an\n * insert. Left unclaimed that types `[?0u` into somebody's first message, which is the same class of\n * defect as a mouse report reaching the buffer and is claimed here for the same reason.\n *\n * Deliberately narrow. Only this one reply is recognised, because it is the only one this runtime *asks*\n * for — and the finals it would be tempting to generalise to are dangerous: `CSI 1;2R` is a real modified\n * F3 key, so claiming `R` would swallow a keystroke to catch a reply nobody requested.\n */\nexport function isTerminalReply(input: string): boolean {\n // The optional escape is stripped by code point rather than matched in the pattern: a control\n // character written into a regex is invisible in the source, which is a lint error for good reason —\n // `lib/keys-view.ts` draws the same line for the same reason.\n const body = input.codePointAt(0) === 0x1b ? input.slice(1) : input\n return /^\\[\\?\\d*u$/.test(body)\n}\n\n/** Which Ink flag a CSI final byte identifies, so a record can be matched to the key Ink reported. */\nfunction identifies(record: CsiKey, key: KeyState, input: string): boolean {\n switch (record.final) {\n case \"A\":\n return key.upArrow\n case \"B\":\n return key.downArrow\n case \"C\":\n return key.rightArrow\n case \"D\":\n return key.leftArrow\n case \"H\":\n return key.home\n case \"F\":\n return key.end\n case \"~\":\n switch (record.param) {\n case 1:\n case 7:\n return key.home\n case 3:\n return key.delete\n case 4:\n case 8:\n return key.end\n case 5:\n return key.pageUp\n case 6:\n return key.pageDown\n default:\n return false\n }\n case \"u\":\n // Kitty's letter form. Ink already decodes these correctly, so matching them is only about\n // not consuming a record that belongs to a later keystroke.\n if (record.param === 13) return key.return\n if (record.param === 127) return key.backspace\n if (record.param === 27) return key.escape\n return input !== \"\" && input === String.fromCodePoint(record.param).toLowerCase()\n default:\n return false\n }\n}\n\n/**\n * The key Ink reported, with its modifiers taken from the bytes when they can be.\n *\n * `records` is consumed: the matched entry is removed, so two keys in one chunk stay in step. Matching by\n * identity rather than by position is what makes that safe — a record that does not correspond to the key\n * Ink is reporting is left in the queue for whichever keystroke it belongs to, instead of being applied to\n * this one.\n */\nexport function withRealModifiers(key: KeyState, input: string, records: CsiKey[]): KeyState {\n const at = records.findIndex((record) => identifies(record, key, input))\n if (at === -1) return key\n const [record] = records.splice(at, 1)\n if (record === undefined) return key\n const bits = record.modifier - 1\n return {\n ...key,\n shift: (bits & SHIFT) !== 0,\n // `meta` is Alt/Option only. This is the whole correction: Ink merges super into it and we do not.\n meta: (bits & ALT) !== 0,\n ctrl: (bits & CTRL) !== 0,\n super: (bits & SUPER) !== 0,\n ...(record.eventType === undefined ? {} : { eventType: record.eventType }),\n }\n}\n"
6
6
  ],
7
7
  "mappings": ";AAsDO,SAAS,EAAO,CAAC,EAAkC,CACtD,IAAM,EAAkB,CAAC,EACnB,EAAU,uCAChB,QAAW,KAAS,EAAM,SAAS,CAAO,EAAG,CACzC,IAAM,EAAQ,OAAO,EAAM,EAAE,EACvB,EAAW,OAAO,EAAM,EAAE,EAC1B,EAAQ,EAAM,GACd,EAAQ,EAAM,IAAM,GAC1B,GAAI,CAAC,OAAO,SAAS,CAAK,GAAK,CAAC,OAAO,SAAS,CAAQ,GAAK,EAAW,EAAG,SAC3E,EAAM,KAAK,CACP,WACA,QACA,QACA,UACI,IAAU,OACJ,OACA,IAAU,IACR,UACA,IAAU,IACR,SACA,OAClB,CAAC,EAEL,OAAO,EAgBJ,SAAS,EAAe,CAAC,EAAwB,CAIpD,IAAM,EAAO,EAAM,YAAY,CAAC,IAAM,GAAO,EAAM,MAAM,CAAC,EAAI,EAC9D,MAAO,aAAa,KAAK,CAAI,EAIjC,SAAS,CAAU,CAAC,EAAgB,EAAe,EAAwB,CACvE,OAAQ,EAAO,OACX,IAAK,IACD,OAAO,EAAI,QACf,IAAK,IACD,OAAO,EAAI,UACf,IAAK,IACD,OAAO,EAAI,WACf,IAAK,IACD,OAAO,EAAI,UACf,IAAK,IACD,OAAO,EAAI,KACf,IAAK,IACD,OAAO,EAAI,IACf,IAAK,IACD,OAAQ,EAAO,OACX,IAAK,GACL,IAAK,GACD,OAAO,EAAI,KACf,IAAK,GACD,OAAO,EAAI,OACf,IAAK,GACL,IAAK,GACD,OAAO,EAAI,IACf,IAAK,GACD,OAAO,EAAI,OACf,IAAK,GACD,OAAO,EAAI,SACf,QACI,MAAO,GAEnB,IAAK,IAGD,GAAI,EAAO,QAAU,GAAI,OAAO,EAAI,OACpC,GAAI,EAAO,QAAU,IAAK,OAAO,EAAI,UACrC,GAAI,EAAO,QAAU,GAAI,OAAO,EAAI,OACpC,OAAO,IAAU,IAAM,IAAU,OAAO,cAAc,EAAO,KAAK,EAAE,YAAY,EACpF,QACI,MAAO,IAYZ,SAAS,EAAiB,CAAC,EAAe,EAAe,EAA6B,CACzF,IAAM,EAAK,EAAQ,UAAU,CAAC,IAAW,EAAW,EAAQ,EAAK,CAAK,CAAC,EACvE,GAAI,IAAO,GAAI,OAAO,EACtB,IAAO,GAAU,EAAQ,OAAO,EAAI,CAAC,EACrC,GAAI,IAAW,OAAW,OAAO,EACjC,IAAM,EAAO,EAAO,SAAW,EAC/B,MAAO,IACA,EACH,OAAQ,EAlIF,KAkIoB,EAE1B,MAAO,EAnIH,KAmImB,EACvB,MAAO,EAnIF,KAmImB,EACxB,OAAQ,EAnIF,KAmIoB,KACtB,EAAO,YAAc,OAAY,CAAC,EAAI,CAAE,UAAW,EAAO,SAAU,CAC5E",
8
- "debugId": "FA104468BD741D0F64756E2164756E21",
8
+ "debugId": "85329477CA9EC52B64756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import{n,Fe,yn,Re}from"./index-tv52jhac.js";import{ri}from"./index-mgef1n4e.js";import{ae,Ee}from"./index-n197qdw1.js";import{chmodSync as y,existsSync as _,readFileSync as p,statSync as x,writeFileSync as A}from"node:fs";import{dirname as E,join as b}from"node:path";function u(e){if(!(e===""||/^["']/.test(e)||/\s/.test(e)||e.includes("#")||e!==e.trim()))return e;return`"${e.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`}function f(e,t,o){let r=`${t}=${u(o)}`,i=e.split(`
2
+ import{n,Fe,Bn,Re}from"./index-ss77hvwy.js";import{ri}from"./index-5ptbytze.js";import{ae,Ee}from"./index-w8e8qxd4.js";import{chmodSync as y,existsSync as _,readFileSync as p,statSync as x,writeFileSync as A}from"node:fs";import{dirname as E,join as b}from"node:path";function u(e){if(!(e===""||/^["']/.test(e)||/\s/.test(e)||e.includes("#")||e!==e.trim()))return e;return`"${e.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`}function f(e,t,o){let r=`${t}=${u(o)}`,i=e.split(`
3
3
  `),l=new RegExp(`^\\s*(?:export\\s+)?${t}\\s*=`),a=i.findIndex((d)=>l.test(d));if(a!==-1){let d=i[a]??"",g=/^\s*export\s+/.exec(d)?.[0]??"";return{text:[...i.slice(0,a),`${g}${r}`,...i.slice(a+1)].join(`
4
4
  `),replaced:!0}}let c=e.replace(/\n+$/,"");return{text:c===""?`${r}
5
5
  `:`${c}
6
6
  ${r}
7
- `,replaced:!1}}function Kr(e){return b(E(e),".env")}async function Xn(e,t,o){let r=yn(o),i=await Fe({file:e,path:t.split("."),value:r,providers:ae,mediaProviders:Ee});return{note:`${t} is now ${S(r)}`,reflowed:i.reflowed,before:i.before}}async function eo(e,t,o){let r=p(e,"utf8"),i=Re(r,["channels"]);if(!Array.isArray(i))throw new n({code:"cli_config_no_channels",message:"This agent has no channels, so there is nobody to allow.",hint:"`config set <agent> channels '[{type: telegram, id: tg, tokenEnv: TELEGRAM_BOT_TOKEN, mode: longpoll}]'` declares one first."});let l=i.filter((s)=>typeof s==="object"&&s!==null&&!Array.isArray(s)),a=l.findIndex((s)=>String(s.id??"")===t);if(a===-1)throw new n({code:"cli_config_channel_unknown",message:`No channel with id "${t}".`,hint:`Declared: ${l.map((s)=>String(s.id??"")).join(", ")}.`,field:"channel"});let c=l[a],d=o.map((s)=>Yr(s,String(c.type??""))),g=[...new Set(d)],m=Array.isArray(c.allowFrom)?c.allowFrom.map(String):[],h=await Fe({file:e,path:["channels"],value:l.map((s,w)=>w===a?{...s,allowFrom:g}:s)});return{note:g.length===0?`${t} now allows nobody, which refuses every message`:`${t} now allows ${g.join(", ")}`,reflowed:h.reflowed,before:m}}function Ve(e,t,o){if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(t))throw new n({code:"cli_config_env_name_invalid",message:`"${t}" is not an environment variable name.`,hint:"Letters, digits and underscores, not starting with a digit — MODEL_API_KEY, TELEGRAM_BOT_TOKEN.",field:"name"});if(o==="")throw new n({code:"cli_config_env_empty",message:`An empty value for ${t} would not start the agent.`,hint:"A variable set to nothing fails the load exactly as a missing one does. Nothing was written."});let r=Kr(e),i=_(r)?p(r,"utf8"):"",l=f(i,t,o);A(r,l.text,{encoding:"utf8",mode:384});let a=(x(r).mode&63)!==0;if(a)y(r,384);return{note:`${t} ${l.replaced?"replaced":"written"} in ${r}${a?" (tightened to 0600)":""}`,reflowed:!1,before:void 0}}function Yr(e,t){let o=e.trim();if(o==="")throw new n({code:"cli_config_handle_missing",message:"No handle given.",hint:"On Telegram that is the username, not the display name.",field:"handle"});if(t!=="telegram")return o;let r=ri(o);if(!r.ok)throw new n({code:"cli_config_handle_invalid",message:`"${o}" ${r.reason}`,hint:"A handle that cannot exist matches nobody, and the only symptom is the bot silently refusing every message from the person it was set up for.",field:"handle"});return r.value}function S(e){if(e==="")return"empty";if(typeof e==="string")return e;return JSON.stringify(e)}
8
- export{Kr,Xn,eo,Ve,Yr};
7
+ `,replaced:!1}}function Hr(e){return b(E(e),".env")}async function $n(e,t,o){let r=Bn(o),i=await Fe({file:e,path:t.split("."),value:r,providers:ae,mediaProviders:Ee});return{note:`${t} is now ${S(r)}`,reflowed:i.reflowed,before:i.before}}async function Xn(e,t,o){let r=p(e,"utf8"),i=Re(r,["channels"]);if(!Array.isArray(i))throw new n({code:"cli_config_no_channels",message:"This agent has no channels, so there is nobody to allow.",hint:"`config set <agent> channels '[{type: telegram, id: tg, tokenEnv: TELEGRAM_BOT_TOKEN, mode: longpoll}]'` declares one first."});let l=i.filter((s)=>typeof s==="object"&&s!==null&&!Array.isArray(s)),a=l.findIndex((s)=>String(s.id??"")===t);if(a===-1)throw new n({code:"cli_config_channel_unknown",message:`No channel with id "${t}".`,hint:`Declared: ${l.map((s)=>String(s.id??"")).join(", ")}.`,field:"channel"});let c=l[a],d=o.map((s)=>Kr(s,String(c.type??""))),g=[...new Set(d)],m=Array.isArray(c.allowFrom)?c.allowFrom.map(String):[],h=await Fe({file:e,path:["channels"],value:l.map((s,w)=>w===a?{...s,allowFrom:g}:s)});return{note:g.length===0?`${t} now allows nobody, which refuses every message`:`${t} now allows ${g.join(", ")}`,reflowed:h.reflowed,before:m}}function Ve(e,t,o){if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(t))throw new n({code:"cli_config_env_name_invalid",message:`"${t}" is not an environment variable name.`,hint:"Letters, digits and underscores, not starting with a digit — MODEL_API_KEY, TELEGRAM_BOT_TOKEN.",field:"name"});if(o==="")throw new n({code:"cli_config_env_empty",message:`An empty value for ${t} would not start the agent.`,hint:"A variable set to nothing fails the load exactly as a missing one does. Nothing was written."});let r=Hr(e),i=_(r)?p(r,"utf8"):"",l=f(i,t,o);A(r,l.text,{encoding:"utf8",mode:384});let a=(x(r).mode&63)!==0;if(a)y(r,384);return{note:`${t} ${l.replaced?"replaced":"written"} in ${r}${a?" (tightened to 0600)":""}`,reflowed:!1,before:void 0}}function Kr(e,t){let o=e.trim();if(o==="")throw new n({code:"cli_config_handle_missing",message:"No handle given.",hint:"On Telegram that is the username, not the display name.",field:"handle"});if(t!=="telegram")return o;let r=ri(o);if(!r.ok)throw new n({code:"cli_config_handle_invalid",message:`"${o}" ${r.reason}`,hint:"A handle that cannot exist matches nobody, and the only symptom is the bot silently refusing every message from the person it was set up for.",field:"handle"});return r.value}function S(e){if(e==="")return"empty";if(typeof e==="string")return e;return JSON.stringify(e)}
8
+ export{Hr,$n,Xn,Ve,Kr};
9
9
 
10
- //# debugId=725FA1451563E5D964756E2164756E21
11
- //# sourceMappingURL=index-gezqawvw.js.map
10
+ //# debugId=FEAA776DBE71156464756E2164756E21
11
+ //# sourceMappingURL=index-4g4smpkk.js.map
@@ -6,6 +6,6 @@
6
6
  "/**\n * Setting one variable in a `.env` without disturbing the rest of it. Pure: text in, text out.\n *\n * The same argument as `yaml-edit.ts`, for the same file's neighbour. A generated `.env` carries\n * comments naming what each variable is for and where to get it, and rewriting the file from a parsed\n * map would drop every one of them — which matters more here than in the manifest, because this is the\n * file somebody opens six months later wondering which dashboard a key came from.\n *\n * Deliberately not a `.env` *parser*: reading one is `parseDotEnv` in core, and a second implementation\n * of that would be two things that have to agree about quoting. This only ever finds a line and\n * replaces it, so the two meet at exactly one place — how a value is quoted on the way out, which is\n * written to be read back by that parser and asserted against it in the tests.\n */\n\n/** Whether a value needs quoting to survive `parseDotEnv`, and the quoted form if so. */\nexport function renderEnvValue(value: string): string {\n // Unquoted values stop at ` #`, and a leading quote character would be eaten as an opening quote.\n // Everything else round-trips bare, which keeps a generated file readable.\n const needsQuotes =\n value === \"\" ||\n /^[\"']/.test(value) ||\n /\\s/.test(value) ||\n value.includes(\"#\") ||\n value !== value.trim()\n if (!needsQuotes) return value\n const escaped = value\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\"/g, '\\\\\"')\n .replace(/\\n/g, \"\\\\n\")\n .replace(/\\r/g, \"\\\\r\")\n .replace(/\\t/g, \"\\\\t\")\n return `\"${escaped}\"`\n}\n\nexport interface EnvUpsert {\n readonly text: string\n /** True when the variable was already there and its line was replaced. */\n readonly replaced: boolean\n}\n\n/**\n * Set `name` to `value`, replacing an existing assignment in place or appending a new one.\n *\n * Replacing **in place** rather than appending is what stops the file growing a second, shadowing\n * assignment on every edit — `parseDotEnv` takes the last one, so an append-only writer would leave a\n * file whose earlier lines are lies. A commented-out assignment is left alone: it is documentation,\n * and uncommenting it would resurrect a value somebody deliberately disabled.\n */\nexport function upsertEnv(source: string, name: string, value: string): EnvUpsert {\n const assignment = `${name}=${renderEnvValue(value)}`\n const lines = source.split(\"\\n\")\n // `export FOO=` counts, because `parseDotEnv` reads it. A `#` first does not.\n const pattern = new RegExp(`^\\\\s*(?:export\\\\s+)?${name}\\\\s*=`)\n const at = lines.findIndex((line) => pattern.test(line))\n\n if (at !== -1) {\n const existing = lines[at] ?? \"\"\n // The `export ` prefix is preserved: it is there because something sources this file rather\n // than reading it, and dropping it would break that quietly.\n const prefix = /^\\s*export\\s+/.exec(existing)?.[0] ?? \"\"\n return {\n text: [...lines.slice(0, at), `${prefix}${assignment}`, ...lines.slice(at + 1)].join(\n \"\\n\",\n ),\n replaced: true,\n }\n }\n\n // Appended with exactly one trailing newline, whatever the file ended with. A `.env` that gains a\n // blank line on every edit is a file that looks edited by a machine, which it is, but it should not\n // look careless about it.\n const body = source.replace(/\\n+$/, \"\")\n return { text: body === \"\" ? `${assignment}\\n` : `${body}\\n${assignment}\\n`, replaced: false }\n}\n"
7
7
  ],
8
8
  "mappings": ";uHAaA,oBAAS,gBAAW,kBAAY,cAAc,mBAAU,gBACxD,kBAAS,UAAS,kBCCX,SAAS,CAAc,CAAC,EAAuB,CASlD,GAAI,EALA,IAAU,IACV,QAAQ,KAAK,CAAK,GAClB,KAAK,KAAK,CAAK,GACf,EAAM,SAAS,GAAG,GAClB,IAAU,EAAM,KAAK,GACP,OAAO,EAOzB,MAAO,IANS,EACX,QAAQ,MAAO,MAAM,EACrB,QAAQ,KAAM,MAAK,EACnB,QAAQ,MAAO,KAAK,EACpB,QAAQ,MAAO,KAAK,EACpB,QAAQ,MAAO,KAAK,KAkBtB,SAAS,CAAS,CAAC,EAAgB,EAAc,EAA0B,CAC9E,IAAM,EAAa,GAAG,KAAQ,EAAe,CAAK,IAC5C,EAAQ,EAAO,MAAM;AAAA,CAAI,EAEzB,EAAU,IAAI,OAAO,uBAAuB,QAAW,EACvD,EAAK,EAAM,UAAU,CAAC,IAAS,EAAQ,KAAK,CAAI,CAAC,EAEvD,GAAI,IAAO,GAAI,CACX,IAAM,EAAW,EAAM,IAAO,GAGxB,EAAS,gBAAgB,KAAK,CAAQ,IAAI,IAAM,GACtD,MAAO,CACH,KAAM,CAAC,GAAG,EAAM,MAAM,EAAG,CAAE,EAAG,GAAG,IAAS,IAAc,GAAG,EAAM,MAAM,EAAK,CAAC,CAAC,EAAE,KAC5E;AAAA,CACJ,EACA,SAAU,EACd,EAMJ,IAAM,EAAO,EAAO,QAAQ,OAAQ,EAAE,EACtC,MAAO,CAAE,KAAM,IAAS,GAAK,GAAG;AAAA,EAAiB,GAAG;AAAA,EAAS;AAAA,EAAgB,SAAU,EAAM,ED1C1F,SAAS,EAAS,CAAC,EAA8B,CACpD,OAAO,EAAK,EAAQ,CAAY,EAAG,MAAM,EAGtC,eAAe,EAAQ,CAAC,EAAsB,EAAc,EAA+B,CAC9F,IAAM,EAAQ,GAAkB,CAAG,EAG7B,EAAS,MAAM,GAAa,CAC9B,KAAM,EACN,KAAM,EAAK,MAAM,GAAG,EACpB,QACA,UAAW,GACX,eAAgB,EACpB,CAAC,EACD,MAAO,CACH,KAAM,GAAG,YAAe,EAAS,CAAK,IACtC,SAAU,EAAO,SACjB,OAAQ,EAAO,MACnB,EAYG,eAAe,EAAU,CAC5B,EACA,EACA,EACgB,CAChB,IAAM,EAAS,EAAa,EAAc,MAAM,EAC1C,EAAW,GAAgB,EAAQ,CAAC,UAAU,CAAC,EACrD,GAAI,CAAC,MAAM,QAAQ,CAAQ,EACvB,MAAM,IAAI,EAAa,CACnB,KAAM,yBACN,QAAS,2DACT,KAAM,8HACV,CAAC,EAGL,IAAM,EAAU,EAAS,OACrB,CAAC,IACG,OAAO,IAAU,UAAY,IAAU,MAAQ,CAAC,MAAM,QAAQ,CAAK,CAC3E,EACM,EAAK,EAAQ,UAAU,CAAC,IAAU,OAAO,EAAM,IAAM,EAAE,IAAM,CAAS,EAC5E,GAAI,IAAO,GACP,MAAM,IAAI,EAAa,CACnB,KAAM,6BACN,QAAS,uBAAuB,MAChC,KAAM,aAAa,EAAQ,IAAI,CAAC,IAAU,OAAO,EAAM,IAAM,EAAE,CAAC,EAAE,KAAK,IAAI,KAC3E,MAAO,SACX,CAAC,EAGL,IAAM,EAAS,EAAQ,GACjB,EAAU,EAAQ,IAAI,CAAC,IAAW,GAAc,EAAQ,OAAO,EAAO,MAAQ,EAAE,CAAC,CAAC,EAClF,EAAS,CAAC,GAAG,IAAI,IAAI,CAAO,CAAC,EAC7B,EAAS,MAAM,QAAQ,EAAO,SAAS,EAAI,EAAO,UAAU,IAAI,MAAM,EAAI,CAAC,EAE3E,EAAS,MAAM,GAAa,CAC9B,KAAM,EACN,KAAM,CAAC,UAAU,EACjB,MAAO,EAAQ,IAAI,CAAC,EAAO,IACvB,IAAU,EAAK,IAAK,EAAO,UAAW,CAAO,EAAI,CACrD,CACJ,CAAC,EACD,MAAO,CACH,KACI,EAAO,SAAW,EACZ,GAAG,mDACH,GAAG,gBAAwB,EAAO,KAAK,IAAI,IACrD,SAAU,EAAO,SACjB,QACJ,EAWG,SAAS,EAAW,CAAC,EAAsB,EAAc,EAAwB,CACpF,GAAI,CAAC,2BAA2B,KAAK,CAAI,EACrC,MAAM,IAAI,EAAa,CACnB,KAAM,8BACN,QAAS,IAAI,0CACb,KAAM,kGACN,MAAO,MACX,CAAC,EAEL,GAAI,IAAU,GACV,MAAM,IAAI,EAAa,CACnB,KAAM,uBACN,QAAS,sBAAsB,+BAC/B,KAAM,8FACV,CAAC,EAGL,IAAM,EAAO,GAAU,CAAY,EAC7B,EAAS,EAAW,CAAI,EAAI,EAAa,EAAM,MAAM,EAAI,GACzD,EAAS,EAAU,EAAQ,EAAM,CAAK,EAC5C,EAAc,EAAM,EAAO,KAAM,CAAE,SAAU,OAAQ,KAAM,GAAM,CAAC,EAClE,IAAM,GAAS,EAAS,CAAI,EAAE,KAAO,MAAW,EAChD,GAAI,EAAO,EAAU,EAAM,GAAK,EAEhC,MAAO,CACH,KAAM,GAAG,KAAQ,EAAO,SAAW,WAAa,gBAAgB,IAAO,EAAQ,uBAAyB,KACxG,SAAU,GACV,OAAQ,MACZ,EAUG,SAAS,EAAa,CAAC,EAAa,EAAsB,CAC7D,IAAM,EAAQ,EAAI,KAAK,EACvB,GAAI,IAAU,GACV,MAAM,IAAI,EAAa,CACnB,KAAM,4BACN,QAAS,mBACT,KAAM,0DACN,MAAO,QACX,CAAC,EAEL,GAAI,IAAS,WAAY,OAAO,EAChC,IAAM,EAAU,GAAe,CAAK,EACpC,GAAI,CAAC,EAAQ,GACT,MAAM,IAAI,EAAa,CACnB,KAAM,4BACN,QAAS,IAAI,MAAU,EAAQ,SAC/B,KAAM,gJACN,MAAO,QACX,CAAC,EAEL,OAAO,EAAQ,MAInB,SAAS,CAAQ,CAAC,EAAwB,CACtC,GAAI,IAAU,GAAI,MAAO,QACzB,GAAI,OAAO,IAAU,SAAU,OAAO,EACtC,OAAO,KAAK,UAAU,CAAK",
9
- "debugId": "725FA1451563E5D964756E2164756E21",
9
+ "debugId": "FEAA776DBE71156464756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ var la="\x1B[?25h",ko="\x1B[0m",Ia="\x1B[2m",Rt="\x1B[?1049h",da="\x1B[?1049l",ua="\x1B[<u",Me=80,vo=24,Lo=12,Po="› ",Go=40,Fo=140,EA=8,fA=40,pA=8,Ea=200,Qi=100,Uo=10,fa=4,pa=6,xo=3,Ca=2000,Ho=50,ha=1,o=0,E=1,Ba=143;var ya=3,Qa=23,ma=8,Sa=400,Tr=1,Sn=12,wa=300,Da=2000;
3
+ export{la,ko,Ia,Rt,da,ua,Me,vo,Lo,Po,Go,Fo,EA,fA,pA,Ea,Qi,Uo,fa,pa,xo,Ca,Ho,ha,o,E,Ba,ya,Qa,ma,Sa,Tr,Sn,wa,Da};
4
+
5
+ //# debugId=71A431A39CAAD58B64756E2164756E21
6
+ //# sourceMappingURL=index-4gfsf9n8.js.map
@@ -5,6 +5,6 @@
5
5
  "/**\n * Every constant the CLI uses, in one place.\n *\n * The rule is the one termheat follows: no magic number inline. A width, a limit, or a control\n * sequence buried in a component is invisible to anyone tuning behaviour later, and two copies of\n * the same number drift.\n */\n\n// ─── terminal ────────────────────────────────────────────────────────────────────────────\n\nexport const SHOW_CURSOR = \"\\u001B[?25h\"\nexport const RESET_STYLE = \"\\u001B[0m\"\n/**\n * Faint text, for the one thing written outside Ink that is not the point of the output.\n *\n * SGR 2 rather than a grey foreground: a fixed colour is wrong on half the terminals in existence,\n * and dim is the terminal's own opinion about what recedes on the theme in use. It persists across a\n * newline, so a multi-line note opens it once and resets once — and the reset lands before the final\n * newline, or the shell prompt that follows inherits it.\n */\nexport const DIM_STYLE = \"\\u001B[2m\"\n\n/**\n * The alternate screen buffer — a second, empty screen the terminal swaps in, discards on the way\n * out, and never adds to the scrollback.\n *\n * `1049` rather than the older `47`: it saves the cursor position and clears the new buffer in one\n * sequence, which is what lands the shell prompt back where it was rather than wherever the app left\n * the cursor.\n *\n * The order on the way out is easy to get backwards. A style reset applies to whichever buffer is\n * *current*, so it has to be written before the swap away — reset afterwards and any colour the app\n * left on lands on the shell's screen instead of the one being discarded. `restoreTerminal` does them\n * in that order and says so there too.\n */\nexport const ENTER_ALT_SCREEN = \"\\u001B[?1049h\"\nexport const LEAVE_ALT_SCREEN = \"\\u001B[?1049l\"\n\n/**\n * Pop the kitty keyboard protocol: `CSI < u`, the counterpart to the `CSI > flags u` Ink pushes.\n *\n * Here rather than in `lib/keyboard.ts` so the dependency runs one way — `lib/exit.ts` needs the\n * sequence and `lib/keyboard.ts` needs `markEnhancedKeys`, and only one of those two can import the\n * other. Terminal-mode sequences already live in this module, which makes this the side that moves.\n */\nexport const DISABLE_ENHANCED_KEYS = \"\\u001B[<u\"\n\n/**\n * Fallback width. A pty can genuinely report `columns === 0` — measured, under `script -q`, which\n * is how this repo drives a real TTY in a test harness. Any layout maths that divides by the\n * terminal width has to survive that.\n */\nexport const FALLBACK_COLUMNS = 80\nexport const FALLBACK_ROWS = 24\n\n/**\n * Rows the live pane may occupy before it starts showing only its tail.\n *\n * Ink erases and redraws its whole dynamic tree every frame, so an unbounded live region means\n * redrawing hundreds of lines per token. Finished messages move into `<Static>`, which is written\n * once and never touched again; this cap is what keeps the *unfinished* one cheap.\n */\nexport const LIVE_PANE_MAX_ROWS = 12\n\nexport const PROMPT = \"› \"\n\n/**\n * The width a screen is laid out for, clamped at both ends.\n *\n * The floor is where the row layout drops its description column rather than wrapping — below it\n * nothing sensible is possible, and a wrapped row is what made the first skills list unreadable. The\n * ceiling stops a 300-column window putting a description a screen away from the name it belongs to.\n *\n * Here rather than in the one command that first needed them, because every screen now shares a frame\n * and two screens clamping differently is the drift `render.ts` was written to end.\n */\nexport const MIN_SCREEN_COLUMNS = 40\nexport const MAX_SCREEN_COLUMNS = 140\n\n/** Rows a scrolling list may occupy, before and after the frame takes its share. */\nexport const MIN_SCREEN_ROWS = 8\nexport const MAX_SCREEN_ROWS = 40\n/** Header, footer, margins and the counter — what the frame costs a list. */\nexport const SCREEN_CHROME_ROWS = 8\n\n// ─── commands and input ──────────────────────────────────────────────────────────────────\n\n// The command words themselves live in `session-commands.ts`, beside the summary that documents\n// each one and the dispatch that honours it. Three bare string constants here is how the help text\n// and the parser came to disagree in the first place.\n\n/** Lines of input history kept for the up/down arrows. */\nexport const HISTORY_LIMIT = 200\n\n/**\n * Undo points kept for the input buffer.\n *\n * Bounded because a snapshot holds a whole copy of the text, and a long composing session with a\n * pasted document in it would otherwise keep every intermediate version alive for the life of the\n * process. A run of typing is one point, not one per keystroke, so this is deeper than it looks.\n */\nexport const UNDO_LIMIT = 100\n\n/**\n * Rows the input box may grow to before it scrolls internally.\n *\n * The same reasoning as `LIVE_PANE_MAX_ROWS`: the input is in Ink's dynamic region, which is erased and\n * redrawn every frame, so an unbounded box means redrawing a pasted document on every keystroke. It\n * also stops a long paste pushing the conversation off the screen.\n */\nexport const MAX_INPUT_ROWS = 10\n\n/**\n * Rows of a reasoning block shown before it folds to a count.\n *\n * Reasoning is secondary and routinely the longest item in a conversation — a real turn produced a\n * twenty-three-row block for a one-sentence answer, which filled a thirty-row terminal on its own and made\n * the reply itself something you had to scroll to find. Four rows is enough to see what it was thinking\n * about; `⌥r` shows the rest.\n *\n * Folding is a *view* decision, applied when items become rows. The whole text is always in the item, so\n * expanding needs no re-derivation and nothing is lost.\n */\nexport const REASONING_FOLD_ROWS = 4\n\n/** Matches `^R` shows at once. Enough to recognise one, few enough to leave the prompt on screen. */\nexport const SEARCH_ROWS = 6\n\n/**\n * Rows a single-value field may wrap to before it scrolls to follow the caret.\n *\n * Smaller than `MAX_INPUT_ROWS`, because a *value* is not a message: a wizard answer and a manifest\n * setting are one line of intent that happens to be long. Three is enough for the longest thing a\n * generated manifest holds — `tools.pinned` at 92 characters is two rows on an 80-column terminal — and\n * few enough that the field never pushes the rest of the screen around.\n *\n * There was no bound at all before, because the field passed no width: in the settings editor a long\n * value was clipped at the terminal's edge with the caret past the clip, and you could not see what you\n * were typing. The wizard escaped it — a bordered box bounds its text whatever the field passes.\n */\nexport const FIELD_ROWS = 3\n\n/**\n * Transcript items kept before the oldest are dropped.\n *\n * Load-bearing rather than prudent, and it was missing for three phases. While the conversation lived\n * in `<Static>` a finished item was written once and cost nothing afterwards; the alternate screen took\n * that away, so every item is now re-derived and re-wrapped on every frame — an unbounded buffer means\n * unbounded work per keystroke, and the case that reaches it is an agent looping tool calls overnight\n * rather than anybody typing.\n *\n * Counted in **items**, not rows, because the row count depends on the terminal width and the reducer\n * that owns the buffer is pure and has none. That does not contradict the scroll layer's rule that the\n * unit is a row: that rule is about addressing an *offset*, where paging by item steps over a forty-row\n * reply in one keystroke.\n *\n * Deliberately far past any session a person reads end to end — roughly four hundred turns — so the cap\n * is a backstop nobody meets rather than a limit that shapes ordinary use. Eviction is also gated on the\n * reader following the tail; see `TRIM` in `transcript.ts` for why that gate is not optional.\n */\nexport const MAX_TRANSCRIPT_ITEMS = 2000\n\n// ─── defaults ────────────────────────────────────────────────────────────────────────────\n\nexport const DEFAULT_ROW_LIMIT = 50\nexport const MIN_ROW_LIMIT = 1\n\n// ─── exit codes ──────────────────────────────────────────────────────────────────────────\n\nexport const EXIT_OK = 0\nexport const EXIT_FAILURE = 1\n/** 128 + SIGTERM, the shell convention. */\nexport const EXIT_SIGTERM = 143\n\n/** Rows a pane over the conversation may use — a command's output, or a hosted view. */\nexport const PANE_ROWS = 16\n\n/**\n * The fewest rows a scrolling body is ever given.\n *\n * A floor rather than a target. At eight terminal rows the chrome alone — header, composer, status —\n * accounts for most of the screen, and the alternative to a floor is a body of zero rows: a session\n * that shows the prompt and no conversation at all, which reads as a broken renderer rather than as a\n * window somebody should make taller.\n */\nexport const MIN_BODY_ROWS = 3\n\n/**\n * Rows a list may take while landing — before anything has been sent.\n *\n * Deliberately larger than `SEARCH_ROWS`, which is tuned for a live conversation where every row of list is a\n * row of conversation hidden. There is no conversation yet on the landing screen and its whole job is\n * discovery: showing six of fifteen commands behind a `… 9 below` is the wrong trade on the screen somebody\n * opens before they know what the commands are. The brand mark gives up a tier to pay for it, which the tier\n * ladder already knows how to do.\n *\n * **This tracks the size of the in-session command table**, so a phase that adds a command has to raise it —\n * which is why `commands.test.ts` asserts the relationship rather than leaving it to whoever notices the\n * `… 1 below`. It is not derived from `COMMANDS` directly because `commands.ts` reads this module, and the\n * cycle would cost more than the assertion does.\n */\nexport const LANDING_LIST_ROWS = 23\n\n/**\n * Rows of conversation the landing screen keeps, whatever the brand mark would like.\n *\n * The banner is written into the transcript, so a wordmark that squeezed it to nothing would hide the boot\n * notes and every load warning behind a picture — which is the trimmed-catalogue failure with better\n * typography: true of what is on screen, false of what is the case.\n *\n * Eight rather than four, measured against a real banner: four left the window showing the *tail* of it, so\n * the first thing on screen was the second half of a wrapped store path. The banner runs six to eight rows\n * depending on how many load warnings there are.\n */\nexport const MIN_LANDING_TRANSCRIPT = 8\n\n/**\n * How long after a press a second one still counts as a double-click.\n *\n * A terminal reports three presses and never a \"double click\", so the grouping is ours to infer — from time\n * *and* position, because two clicks 300 ms apart on different words are two clicks. 400 ms is the common\n * platform default; longer makes a deliberate second selection turn into a word-select, shorter makes a\n * real double-click fail on a slow hand.\n */\nexport const MULTI_CLICK_MS = 400\n\n/** The blank row between the brand mark and the one-line header under it. */\nexport const BRAND_GAP_ROWS = 1\n\n/** Conversations the session picker shows at once. The list scrolls inside this. */\nexport const SESSION_PICKER_ROWS = 12\n\n/**\n * How often `daemon logs --follow` checks a service log for new bytes.\n *\n * Polled rather than watched: `fs.watch` on macOS reports another process's appends unreliably, and a\n * follower that misses the line somebody is waiting for is worse than one that arrives a third of a\n * second late — the reason to watch a log live is not trusting what you have been told. Ctrl-C wakes the\n * pending sleep rather than waiting it out, so this interval never delays a stop.\n */\nexport const LOG_POLL_MS = 300\n\n/**\n * How long a ^C at an idle prompt stays armed.\n *\n * The chord is doubled rather than immediate because a single ^C means \"cancel the turn\" everywhere\n * else in this session, and the two are one keystroke apart. Long enough to be a deliberate second\n * press, short enough that an armed prompt left alone goes back to being safe.\n */\nexport const EXIT_ARM_MS = 2000\n"
6
6
  ],
7
7
  "mappings": ";AAUO,IAAM,GAAc,YACd,GAAc,UASd,GAAY,UAeZ,GAAmB,cACnB,GAAmB,cASnB,GAAwB,UAOxB,GAAmB,GACnB,GAAgB,GAShB,GAAqB,GAErB,GAAS,KAYT,GAAqB,GACrB,GAAqB,IAGrB,GAAkB,EAClB,GAAkB,GAElB,GAAqB,EASrB,GAAgB,IAShB,GAAa,IASb,GAAiB,GAajB,GAAsB,EAGtB,GAAc,EAcd,GAAa,EAoBb,GAAuB,KAIvB,GAAoB,GACpB,GAAgB,EAIhB,EAAU,EACV,EAAe,EAEf,GAAe,IAarB,IAAM,GAAgB,EAgBhB,GAAoB,GAapB,GAAyB,EAUzB,GAAiB,IAGjB,GAAiB,EAGjB,GAAsB,GAUtB,GAAc,IASd,GAAc",
8
- "debugId": "B272F8AAAAE2C31C64756E2164756E21",
8
+ "debugId": "71A431A39CAAD58B64756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{A,fo,tA}from"./index-tv52jhac.js";var Sr=`---
2
+ import{A,po,eA}from"./index-ss77hvwy.js";var mr=`---
3
3
  name: {{SKILL_NAME}}
4
4
  description: Replace this description with what the skill does and when to use it, naming the specific words someone would type — file formats, tool names, the error they are looking at. Selection is lexical and this sentence is all it has.
5
5
  metadata:
@@ -413,17 +413,17 @@ precisely the model that cannot derive.
413
413
  # What I refuse to become
414
414
 
415
415
  {{SOUL_REFUSE}}
416
- `};function Io(e,n){return e.replace(/\{\{\s*([A-Za-z0-9_]+)\s*\}\}/g,(t,a)=>{let o=n[a];return o===void 0?t:o})}var $e=[{id:"openai",label:"OpenAI",modelId:"gpt-5-6-sol",baseUrl:"https://api.openai.com/v1",apiKeyEnv:"MODEL_API_KEY"},{id:"anthropic",label:"Anthropic (OpenAI-compatible endpoint)",modelId:"claude-sonnet-5",baseUrl:"https://api.anthropic.com/v1",apiKeyEnv:"MODEL_API_KEY"},{id:"deepseek",label:"DeepSeek",modelId:"deepseek-v4-flash",baseUrl:"https://api.deepseek.com/v1",apiKeyEnv:"MODEL_API_KEY"},{id:"openrouter",label:"OpenRouter (many providers, one key)",modelId:"deepseek/deepseek-chat",baseUrl:"https://openrouter.ai/api/v1",apiKeyEnv:"MODEL_API_KEY"},{id:"groq",label:"Groq",modelId:"llama-3.3-70b-versatile",baseUrl:"https://api.groq.com/openai/v1",apiKeyEnv:"MODEL_API_KEY"},{id:"nvidia",label:"NVIDIA NIM",modelId:"meta/llama-3.3-70b-instruct",baseUrl:"https://integrate.api.nvidia.com/v1",apiKeyEnv:"MODEL_API_KEY"},{id:"ollama",label:"Ollama (local, no key)",modelId:"qwen3.5:9b",baseUrl:"http://localhost:11434/v1"},{id:"ollama-cloud",label:"Ollama Cloud (hosted, needs a key)",modelId:"gpt-oss:120b",baseUrl:"https://ollama.com/v1",apiKeyEnv:"MODEL_API_KEY"},{id:"bedrock",label:"AWS Bedrock (Converse; credentials from the AWS chain)",modelId:"eu.anthropic.claude-sonnet-4-6",baseUrl:"",api:"bedrock-converse",region:"eu-west-1"},{id:"custom",label:"any other OpenAI-compatible endpoint",modelId:"",baseUrl:"",apiKeyEnv:"MODEL_API_KEY"}];function zt(e){return $e.find((n)=>n.id===e)}var _=[{slug:"now",note:"read-only: runs in parallel with other reads"},{slug:"memory_write",note:"mutating: serialises, holds a reserved write slot, never retried"},{slug:"memory_forget",note:"mutating: lists by query, deletes only the ids it listed"},{slug:"artifact_read",note:"read-only: follows the pointer compaction leaves behind"}],re=_.map((e)=>e.slug);function T(e){let n=e.replace(/\s+/g," ").trim();return n.length<=200?n:`${n.slice(0,199)}…`}var y=[{value:"none",label:"no — the block is written commented, with an example"},{value:"daily",label:"a daily briefing at 08:00"},{value:"hourly",label:"an hourly check"}];function C(e){return y.find((n)=>n.value===e)}var h=[{value:"sandbox",label:"the sandbox",hint:"run it by name from anywhere"},{value:"here",label:"the current directory",hint:"every later command needs its path"},{value:"custom",label:"somewhere else",hint:"type a path"}];function U(e){return h.find((n)=>n.value===e)}function UA(e,n,t){if(n===void 0)return;if(e==="sandbox")return`${t.agentDirBase}/${lt(n)}`;if(e==="here")return`./${lt(n)}`;return}var u=[{value:"none",label:"No — but it will know the web tools exist and can ask you to enable them",pinned:[]},{value:"fetch",label:"Read pages — it can open a URL you give it. No account or key needed",pinned:["web_fetch"]},{value:"search",label:"Search and read — needs an API key from a search provider",pinned:["web_search","web_fetch"]}];function N(e){return u.find((n)=>n.value===e)}var l=[{value:"tavily",label:"Tavily — built for agents, generous free tier",apiKeyEnv:"TAVILY_API_KEY"},{value:"brave",label:"Brave Search",apiKeyEnv:"BRAVE_API_KEY"},{value:"exa",label:"Exa — neural search, returns page excerpts",apiKeyEnv:"EXA_API_KEY"}];function uo(e){return l.find((n)=>n.value===e)}var pn="COMPOSIO_API_KEY",c=[{value:"none",label:"No — but it will know the route exists and can tell you how to switch it on",pinned:[]},{value:"connected",label:"Yes — Gmail, Slack, Notion and ~1,000 more, via a Composio account",pinned:["composio_search","composio_connect"]}];function x(e){return c.find((n)=>n.value===e)}var Eo="TELEGRAM_BOT_TOKEN",m=[{value:"none",label:"No — it is reachable through the CLI and the API only"},{value:"connected",label:"Yes — a Telegram bot, long-poll (needs no public URL)"}];function P(e){return m.find((n)=>n.value===e)}var p=[{value:"none",label:"No"},{value:"connected",label:"Yes — unofficial, and it can get a number banned. Use a spare one."}];function M(e){return p.find((n)=>n.value===e)}var b=[{value:"none",label:"No"},{value:"local",label:"Yes — HTTP, SSE and WebSocket on 127.0.0.1:7420"}];function K(e){return b.find((n)=>n.value===e)}var g=[{value:"service",label:"Yes — in the background: starts at login, restarts on crash"},{value:"none",label:"No — it runs while you have `serve` open in a terminal"}];function W(e){return g.find((n)=>n.value===e)}var xA=[{value:"find",label:"Yes — pick from the catalogue: real skills, tick as many as you want"},{value:"starter",label:"Yes — with one worked example to copy"},{value:"none",label:"An empty directory — the concept is there, the procedures are not"}];function Y(e){return xA.find((n)=>n.value===e)}var i=[{value:"none",label:"No — it can talk and remember, and change its own settings when you ask",pinned:["config_read","config_set"],allow:["memory_write","config_set"]},{value:"read",label:"Read only — it can read and search files, but change nothing",pinned:["file_read","glob","grep","config_read","config_set"],allow:["memory_write","config_set"]},{value:"write",label:"Read and write files — confined to its own workspace, no shell",pinned:["file_read","file_write","file_edit","glob","grep","config_read","config_set"],allow:["memory_write","file_write","file_edit","config_set"]},{value:"full",label:"Yes — read and write files, run commands, and change its own configuration",pinned:["file_read","file_write","file_edit","glob","grep","exec","config_read","config_set"],allow:["memory_write","file_write","file_edit","exec","config_set"]}];function k(e){return i.find((n)=>n.value===e)}var wr=["user","name","purpose","preset","model","baseUrl","region","apiKey","system","web","webBackend","webKey","composio","composioKey","telegram","telegramAllow","telegramToken","whatsapp","whatsappNumber","skills","daemon","dirChoice","dir"],Cn=new Set(["apiKey","webKey","composioKey","telegramToken"]);function lt(e){let n=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return n===""?"agent":n}function gA(e,n){let t=e.preset===void 0?void 0:zt(e.preset);for(let a of wr){if(e[a]!==void 0)continue;if(a==="apiKey"&&t!==void 0&&t.apiKeyEnv===void 0)continue;if(a==="baseUrl"&&t?.api==="bedrock-converse")continue;if(a==="region"&&t?.api!=="bedrock-converse")continue;if((a==="webBackend"||a==="webKey")&&e.web!=="search")continue;if(a==="dir"&&e.dirChoice!=="custom")continue;if(a==="dirChoice"&&e.dir!==void 0)continue;if(a==="composioKey"&&e.composio!=="connected")continue;if((a==="telegramToken"||a==="telegramAllow")&&e.telegram!=="connected")continue;if(a==="whatsappNumber"&&e.whatsapp!=="connected")continue;switch(a){case"user":return{step:a,prompt:"Your name",fallback:""};case"name":return{step:a,prompt:"The agent's name",fallback:""};case"purpose":return{step:a,prompt:"What is it for, in one line",fallback:"helping with whatever comes up"};case"preset":return{step:a,prompt:"Model endpoint",fallback:"1",options:$e.map((o)=>({value:o.id,label:o.label}))};case"model":return{step:a,prompt:"Model id",fallback:t?.modelId??""};case"baseUrl":return{step:a,prompt:"Base URL",fallback:t?.baseUrl??""};case"region":return{step:a,prompt:"AWS region",fallback:t?.region??"us-east-1"};case"apiKey":return{step:a,prompt:"Model API key",fallback:"",optional:!0};case"system":return{step:a,prompt:"Can it act on this computer?",fallback:"1",options:i.map((o)=>({value:o.value,label:o.label}))};case"web":return{step:a,prompt:"Can it reach the internet?",fallback:"1",options:u.map((o)=>({value:o.value,label:o.label}))};case"webBackend":return{step:a,prompt:"Search backend",fallback:"1",options:l.map((o)=>({value:o.value,label:o.label}))};case"webKey":return{step:a,prompt:`${uo(e.webBackend??"tavily")?.label.split(" —")[0]??"Search"} API key`,fallback:"",optional:!0};case"composio":return{step:a,prompt:"Can it use your other apps?",fallback:"1",options:c.map((o)=>({value:o.value,label:o.label}))};case"composioKey":return{step:a,prompt:"Composio API key",fallback:"",optional:!0};case"telegram":return{step:a,prompt:"Can people message it on Telegram?",fallback:"1",options:m.map((o)=>({value:o.value,label:o.label}))};case"telegramAllow":return{step:a,prompt:"Your Telegram handle — who may message it",fallback:"",optional:!0};case"telegramToken":return{step:a,prompt:"Telegram bot token (from @BotFather)",fallback:"",optional:!0};case"whatsapp":return{step:a,prompt:"Can people message it on WhatsApp?",fallback:"1",options:p.map((o)=>({value:o.value,label:o.label}))};case"whatsappNumber":return{step:a,prompt:"Your WhatsApp number in digits, no + — the account it links to",fallback:"",optional:!0};case"skills":return{step:a,prompt:"Give it a skills directory? A skill is a procedure it follows when the turn calls for one.",fallback:"starter",options:xA.map((o)=>({value:o.value,label:o.label}))};case"daemon":return{step:a,prompt:"Keep it running in the background?",fallback:"service",options:g.map((o)=>({value:o.value,label:o.label}))};case"dirChoice":return{step:a,prompt:"Where should it live?",fallback:"1",options:h.map((o)=>({value:o.value,label:UA(o.value,e.name,n)??o.label,hint:o.hint}))};case"dir":return{step:a,prompt:"Path to create it at",fallback:""}}}return}function ri(e){let n=e.trim();if(/\s/.test(n))return{ok:!1,reason:"is one handle, with no spaces — for example @moeen."};let t=n.startsWith("@")?n.slice(1):n;if(!/^[A-Za-z0-9_]{5,32}$/.test(t))return{ok:!1,reason:/-/.test(t)?"contains a hyphen, and a Telegram handle cannot — they are letters, digits and underscores only. Did you mean an underscore?":"is not a Telegram handle: 5-32 characters, letters, digits and underscores only. Leave it empty to allow nobody for now."};return{ok:!0,value:`@${t}`}}var H=/^[A-Z_][A-Z0-9_]*$/;function Zt(e,n){let t=n.trim();switch(e){case"user":case"name":case"model":case"purpose":return t===""?{ok:!1,reason:"cannot be empty."}:{ok:!0,value:t};case"preset":{let o=$e[Number(t)-1]??zt(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${$e.length}, or a name: ${$e.map((r)=>r.id).join(", ")}.`}:{ok:!0,value:o.id}}case"web":{let o=u[Number(t)-1]??N(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${u.length}, or a name: ${u.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"webBackend":{let o=l[Number(t)-1]??uo(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${l.length}, or a name: ${l.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"webKey":case"composioKey":case"telegramToken":return{ok:!0,value:t};case"telegramAllow":{let a=t.trim();if(a==="")return{ok:!0,value:""};return ri(a)}case"telegram":{let o=m[Number(t)-1]??P(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${m.length}, or a name: ${m.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"whatsapp":{let o=p[Number(t)-1]??M(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${p.length}, or a name: ${p.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"whatsappNumber":{let a=t.trim();if(a==="")return{ok:!0,value:""};let o=a.replace(/[^0-9]/g,"");if(!/^[0-9]{6,20}$/.test(o))return{ok:!1,reason:"that is not a WhatsApp number — use the digits including the country code, with no + and no spaces."};return{ok:!0,value:o}}case"server":{let o=b[Number(t)-1]??K(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${b.length}, or a name: ${b.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"schedules":{let o=y[Number(t)-1]??C(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${y.length}, or a name: ${y.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"skillsPick":return{ok:!0,value:t.trim()};case"skillsSearch":return{ok:!0,value:t.trim()};case"skills":{let o=xA[Number(t)-1]??Y(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${xA.length}, or a name: ${xA.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"daemon":{let o=g[Number(t)-1]??W(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${g.length}, or a name: ${g.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"composio":{let o=c[Number(t)-1]??x(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${c.length}, or a name: ${c.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"region":return/^[a-z]{2}(-[a-z]+)+-\d$/.test(t)?{ok:!0,value:t}:{ok:!1,reason:"is not an AWS region name, such as eu-west-1 or us-east-1."};case"baseUrl":{let a;try{a=new URL(t)}catch{return{ok:!1,reason:"must be an absolute URL, e.g. https://api.example.com/v1."}}if(a.protocol!=="http:"&&a.protocol!=="https:")return{ok:!1,reason:"only http and https are supported."};if(a.pathname.endsWith("/chat/completions"))return{ok:!1,reason:"must end at the version segment — the runtime appends /chat/completions itself."};return{ok:!0,value:t}}case"apiKeyEnv":return H.test(t)?{ok:!0,value:t}:{ok:!1,reason:"must be an env var name, like MODEL_API_KEY."};case"apiKey":return{ok:!0,value:t};case"serverToken":return{ok:!0,value:t};case"system":{let o=i[Number(t)-1]??k(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${i.length}, or a name: ${i.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"dirChoice":{let o=h[Number(t)-1]??U(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${h.length}, or a name: ${h.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"dir":return t===""?{ok:!1,reason:"cannot be empty."}:{ok:!0,value:t}}}function B(e){let n=e.system,t=k(n)??i[0],a=t?.pinned.includes("exec")===!0,o=t?.pinned.includes("file_read")===!0,r=t?.pinned.includes("file_write")===!0,w=t===void 0||t.pinned.length===0?[" # Nothing is enabled. Add tools here and permit them in the policy block below."]:!o?[" # This agent cannot read, write or run anything. It CAN read this file and change it when"," # you ask — which is how you turn the rest on without editing YAML yourself."," #"," # It is told which tools exist and are not enabled, so ask it for something it cannot do"," # and it will name the tool and offer to add it. A change takes effect on the next start."," #"," # To enable them by hand instead, add to pinned:"," # file_read, glob, grep read and search files"," # file_write, file_edit change files, confined to workspace/"," # exec run shell commands — the confinement does not bind it"]:a?[" # This agent can read and change files and run shell commands. What it may run is decided"," # by the policy block below — narrow it, and prefer the file tools over the shell, whose"," # target a rule cannot see inside a command string."," #"," # Writes are confined to workspace/. To open another directory, give the system"," # provider a writeRoots list — the agent cannot add one to itself, by design."," # That confinement binds the file tools and NOT exec, whose target lives inside a"," # shell string no path check can see."]:r?[" # This agent can read files and change them, and cannot run commands. That combination",' # is the only one in which "confined to workspace/" is a true statement — a shell'," # carries its target inside a string no path check can look inside."," #"," # To open another directory, give the system provider a writeRoots list. The agent"," # cannot add one to itself, by design."]:[" # This agent can read and search files and change nothing. Reading is still not nothing:"," # anything it reads can carry text a stranger wrote, which is why the write gate exists."," #"," # Reading is not confined; changing things would be, but nothing here changes things."],L=t?.pinned??[],f=N(e.web)?.pinned??[],v=E(e);return[" # ── providers: where tools come from ──",...w," #"," # Several may be configured at once — this is a map, not a choice. Each block is that"," # provider's own configuration and it refuses a key it does not read."," providers:"," system: {}",...a?[" # system: { writeRoots: [~/code/my-project] } # absolute, or relative to this file"]:[],"",...f.length===0?[" # Named with nothing pinned. It cannot reach the internet, and it knows the two"," # tools exist and will tell you which one to enable rather than saying it can't."," # web_fetch needs no key; web_search needs one, named here:"," # web: { backend: tavily, apiKeyEnv: TAVILY_API_KEY } # tavily | brave | exa"," web: {}"]:v===void 0?[" # Reading pages only. No key and no account: web_fetch takes a URL you or the"," # person gave it. To add search, pick a backend and name its variable:"," # web: { backend: tavily, apiKeyEnv: TAVILY_API_KEY } # tavily | brave | exa"," web: {}"]:[" # Search and page reading. The key lives in the .env beside this file; this names"," # only the variable, and a literal key here fails validation."," web:",` backend: ${v.value}`,` apiKeyEnv: ${v.apiKeyEnv}`]," # Addresses on this machine or this network are refused and no setting permits them."," # Neither tool can change anything, but what they return is text a stranger wrote — so it"," # is fenced as data, and a tool that CHANGES something needs an allow rule after one runs.","",...G(e),""," # What the model is actually given, from any provider above. A slug no configured provider"," # has fails the load naming it — nothing is ever dropped quietly."," pinned:",...L.map((d)=>` - ${d}`),...f.map((d)=>` - ${d}`),...f.includes("web_search")?[]:[" # - web_search"],...f.includes("web_fetch")?[]:[" # - web_fetch"],...R(e).map((d)=>` - ${d}`),...HA(e)?[" # App tools land here once composio_search has found them — ask the agent for what"," # you want and it writes the slug itself. A slug typed in by hand needs",` # \`${A.slug} tools . --warm\` first: boot resolves from a cache and makes no`," # request, so an unwarmed slug fails the load rather than fetching."," # - GMAIL_FETCH_EMAILS"," # - composio_workbench # runs Python in Composio's sandbox, under no rule here"]:[" # - GMAIL_FETCH_EMAILS"]]}function HA(e){return e.composio==="connected"}function R(e){return x(e.composio)?.pinned??[]}var D=["composio_connect","composio_workbench"];function F(e){return D.includes(e)}function G(e){let n=[" # Your other apps — Gmail, Slack, Notion, ~1,000 more — through a Composio account."," # Two tools do the setup: composio_search finds what a task needs and saves the"," # definitions, composio_connect returns the sign-in link. Ask the agent for an app and it"," # pins the slug itself with config_set; the new tool is live after a restart."];if(!HA(e))return[...n," # Named with nothing pinned, so it knows the route exists and can tell you the line"," # to add. To switch it on: pin the two tools below, put a key in .env, and give this"," # block the two settings shown here.",` # composio: { apiKeyEnv: ${pn}, userId: default }`," composio: {}"];return[...n," composio:",` apiKeyEnv: ${pn}`," # Whose accounts these are, in Composio's terms — not a name of yours. One person on",' # one machine wants "default", and a connection made under it is reused by every later'," # session. Change it only to keep two people's accounts apart on one agent."," userId: default"]}function j(e){let n=k(e.system)??i[0],t=n?.pinned.includes("exec")===!0,a=[...n?.allow??[],...R(e).filter(F)],o=[" # ── which calls run, which ask, and which are refused ──"," # deny wins over allow, first match, and being more specific never reorders that. A rule"," # naming a primary content field — exec(command:rm *) — is refused at load, because a"," # compound command defeats it and a rule that can be defeated reads as protection."," #"," # Below every setting here is a floor that cannot be lowered: rm -rf / and rm -rf ~,"," # --no-preserve-root, fork bombs, mkfs, and dd to a block device are never permitted."," policy:"," mode: allow # allow | ask | deny — for calls no rule mentions"];if(a.length===0)return[...o," allow: []"," deny: []"," onNoApprover: deny"];return[...o," # Authorises these even once untrusted content has entered the turn. Remove one and that"," # tool stops working for the rest of any turn that has read a file — which is the gate"," # doing its job, and worth choosing on purpose rather than discovering."," allow:",...a.map((r)=>` - "${r}"`),...t?[" deny:"," # Narrow these to taste. A pattern matches the command, and every part of a",' # compound must match for an allow — so "git status && rm -rf x" is not allowed'," # by exec(git status:*).",' - "exec(rm *)"',' - "exec(sudo *)"']:[" deny: []"],' onNoApprover: deny # what "ask" means with nobody to ask — a schedule, a pipe']}function V(e){return fo(e).capabilities.nativeTools?[" # native: the model's own function calling. nlt (calls written as text) is the opt-in for"," # a model without it; the harness benchmark in evals/harness/ has both, per model."," dialect: native"]:[" # nlt: calls written as text, because the capability registry does not know this model to"," # call tools natively. If it does, `dialect: native` was ahead on 13 of 14 measured models."," dialect: nlt"]}function Dr(e,n){let t=q(e);return[{relPath:"agent.yaml",contents:X(e,n)},...["SOUL.md","SOUL.compact.md","AGENTS.md","POLICY.md","USER.md","MEMORY.md","REMINDER.md"].map((a)=>({relPath:`workspace/${a}`,contents:Io(I[a],t)})),...e.skills==="starter"?[{relPath:"skills/starter/SKILL.md",contents:Io(Sr,t)}]:[{relPath:"skills/.keep",contents:""}],{relPath:"knowledge/.keep",contents:""},{relPath:".env.example",contents:ee(e)},{relPath:".env",contents:J(e)},{relPath:".gitignore",contents:e.whatsapp==="connected"?`.env
416
+ `};function lo(e,n){return e.replace(/\{\{\s*([A-Za-z0-9_]+)\s*\}\}/g,(t,a)=>{let o=n[a];return o===void 0?t:o})}var $e=[{id:"openai",label:"OpenAI",modelId:"gpt-5-6-sol",baseUrl:"https://api.openai.com/v1",apiKeyEnv:"MODEL_API_KEY"},{id:"anthropic",label:"Anthropic (OpenAI-compatible endpoint)",modelId:"claude-sonnet-5",baseUrl:"https://api.anthropic.com/v1",apiKeyEnv:"MODEL_API_KEY"},{id:"deepseek",label:"DeepSeek",modelId:"deepseek-v4-flash",baseUrl:"https://api.deepseek.com/v1",apiKeyEnv:"MODEL_API_KEY"},{id:"openrouter",label:"OpenRouter (many providers, one key)",modelId:"deepseek/deepseek-chat",baseUrl:"https://openrouter.ai/api/v1",apiKeyEnv:"MODEL_API_KEY"},{id:"groq",label:"Groq",modelId:"llama-3.3-70b-versatile",baseUrl:"https://api.groq.com/openai/v1",apiKeyEnv:"MODEL_API_KEY"},{id:"nvidia",label:"NVIDIA NIM",modelId:"meta/llama-3.3-70b-instruct",baseUrl:"https://integrate.api.nvidia.com/v1",apiKeyEnv:"MODEL_API_KEY"},{id:"ollama",label:"Ollama (local, no key)",modelId:"qwen3.5:9b",baseUrl:"http://localhost:11434/v1"},{id:"ollama-cloud",label:"Ollama Cloud (hosted, needs a key)",modelId:"gpt-oss:120b",baseUrl:"https://ollama.com/v1",apiKeyEnv:"MODEL_API_KEY"},{id:"bedrock",label:"AWS Bedrock (Converse; credentials from the AWS chain)",modelId:"eu.anthropic.claude-sonnet-4-6",baseUrl:"",api:"bedrock-converse",region:"eu-west-1"},{id:"custom",label:"any other OpenAI-compatible endpoint",modelId:"",baseUrl:"",apiKeyEnv:"MODEL_API_KEY"}];function Wt(e){return $e.find((n)=>n.id===e)}var _=[{slug:"now",note:"read-only: runs in parallel with other reads"},{slug:"memory_write",note:"mutating: serialises, holds a reserved write slot, never retried"},{slug:"memory_forget",note:"mutating: lists by query, deletes only the ids it listed"},{slug:"artifact_read",note:"read-only: follows the pointer compaction leaves behind"}],re=_.map((e)=>e.slug);function T(e){let n=e.replace(/\s+/g," ").trim();return n.length<=200?n:`${n.slice(0,199)}…`}var y=[{value:"none",label:"no — the block is written commented, with an example"},{value:"daily",label:"a daily briefing at 08:00"},{value:"hourly",label:"an hourly check"}];function C(e){return y.find((n)=>n.value===e)}var h=[{value:"sandbox",label:"the sandbox",hint:"run it by name from anywhere"},{value:"here",label:"the current directory",hint:"every later command needs its path"},{value:"custom",label:"somewhere else",hint:"type a path"}];function U(e){return h.find((n)=>n.value===e)}function FA(e,n,t){if(n===void 0)return;if(e==="sandbox")return`${t.agentDirBase}/${ct(n)}`;if(e==="here")return`./${ct(n)}`;return}var u=[{value:"none",label:"No — but it will know the web tools exist and can ask you to enable them",pinned:[]},{value:"fetch",label:"Read pages — it can open a URL you give it. No account or key needed",pinned:["web_fetch"]},{value:"search",label:"Search and read — needs an API key from a search provider",pinned:["web_search","web_fetch"]}];function N(e){return u.find((n)=>n.value===e)}var l=[{value:"tavily",label:"Tavily — built for agents, generous free tier",apiKeyEnv:"TAVILY_API_KEY"},{value:"brave",label:"Brave Search",apiKeyEnv:"BRAVE_API_KEY"},{value:"exa",label:"Exa — neural search, returns page excerpts",apiKeyEnv:"EXA_API_KEY"}];function Io(e){return l.find((n)=>n.value===e)}var En="COMPOSIO_API_KEY",c=[{value:"none",label:"No — but it will know the route exists and can tell you how to switch it on",pinned:[]},{value:"connected",label:"Yes — Gmail, Slack, Notion and ~1,000 more, via a Composio account",pinned:["composio_search","composio_connect"]}];function x(e){return c.find((n)=>n.value===e)}var uo="TELEGRAM_BOT_TOKEN",m=[{value:"none",label:"No — it is reachable through the CLI and the API only"},{value:"connected",label:"Yes — a Telegram bot, long-poll (needs no public URL)"}];function P(e){return m.find((n)=>n.value===e)}var p=[{value:"none",label:"No"},{value:"connected",label:"Yes — unofficial, and it can get a number banned. Use a spare one."}];function M(e){return p.find((n)=>n.value===e)}var b=[{value:"none",label:"No"},{value:"local",label:"Yes — HTTP, SSE and WebSocket on 127.0.0.1:7420"}];function K(e){return b.find((n)=>n.value===e)}var g=[{value:"service",label:"Yes — in the background: starts at login, restarts on crash"},{value:"none",label:"No — it runs while you have `serve` open in a terminal"}];function W(e){return g.find((n)=>n.value===e)}var UA=[{value:"find",label:"Yes — pick from the catalogue: real skills, tick as many as you want"},{value:"starter",label:"Yes — with one worked example to copy"},{value:"none",label:"An empty directory — the concept is there, the procedures are not"}];function Y(e){return UA.find((n)=>n.value===e)}var i=[{value:"none",label:"No — it can talk and remember, and change its own settings when you ask",pinned:["config_read","config_set"],allow:["memory_write","config_set"]},{value:"read",label:"Read only — it can read and search files, but change nothing",pinned:["file_read","glob","grep","config_read","config_set"],allow:["memory_write","config_set"]},{value:"write",label:"Read and write files — confined to its own workspace, no shell",pinned:["file_read","file_write","file_edit","glob","grep","config_read","config_set"],allow:["memory_write","file_write","file_edit","config_set"]},{value:"full",label:"Yes — read and write files, run commands, and change its own configuration",pinned:["file_read","file_write","file_edit","glob","grep","exec","config_read","config_set"],allow:["memory_write","file_write","file_edit","exec","config_set"]}];function k(e){return i.find((n)=>n.value===e)}var Sr=["user","name","purpose","preset","model","baseUrl","region","apiKey","system","web","webBackend","webKey","composio","composioKey","telegram","telegramAllow","telegramToken","whatsapp","whatsappNumber","skills","daemon","dirChoice","dir"],fn=new Set(["apiKey","webKey","composioKey","telegramToken"]);function ct(e){let n=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return n===""?"agent":n}function aA(e,n){let t=e.preset===void 0?void 0:Wt(e.preset);for(let a of Sr){if(e[a]!==void 0)continue;if(a==="apiKey"&&t!==void 0&&t.apiKeyEnv===void 0)continue;if(a==="baseUrl"&&t?.api==="bedrock-converse")continue;if(a==="region"&&t?.api!=="bedrock-converse")continue;if((a==="webBackend"||a==="webKey")&&e.web!=="search")continue;if(a==="dir"&&e.dirChoice!=="custom")continue;if(a==="dirChoice"&&e.dir!==void 0)continue;if(a==="composioKey"&&e.composio!=="connected")continue;if((a==="telegramToken"||a==="telegramAllow")&&e.telegram!=="connected")continue;if(a==="whatsappNumber"&&e.whatsapp!=="connected")continue;switch(a){case"user":return{step:a,prompt:"Your name",fallback:""};case"name":return{step:a,prompt:"The agent's name",fallback:""};case"purpose":return{step:a,prompt:"What is it for, in one line",fallback:"helping with whatever comes up"};case"preset":return{step:a,prompt:"Model endpoint",fallback:"1",options:$e.map((o)=>({value:o.id,label:o.label}))};case"model":return{step:a,prompt:"Model id",fallback:t?.modelId??""};case"baseUrl":return{step:a,prompt:"Base URL",fallback:t?.baseUrl??""};case"region":return{step:a,prompt:"AWS region",fallback:t?.region??"us-east-1"};case"apiKey":return{step:a,prompt:"Model API key",fallback:"",optional:!0};case"system":return{step:a,prompt:"Can it act on this computer?",fallback:"1",options:i.map((o)=>({value:o.value,label:o.label}))};case"web":return{step:a,prompt:"Can it reach the internet?",fallback:"1",options:u.map((o)=>({value:o.value,label:o.label}))};case"webBackend":return{step:a,prompt:"Search backend",fallback:"1",options:l.map((o)=>({value:o.value,label:o.label}))};case"webKey":return{step:a,prompt:`${Io(e.webBackend??"tavily")?.label.split(" —")[0]??"Search"} API key`,fallback:"",optional:!0};case"composio":return{step:a,prompt:"Can it use your other apps?",fallback:"1",options:c.map((o)=>({value:o.value,label:o.label}))};case"composioKey":return{step:a,prompt:"Composio API key",fallback:"",optional:!0};case"telegram":return{step:a,prompt:"Can people message it on Telegram?",fallback:"1",options:m.map((o)=>({value:o.value,label:o.label}))};case"telegramAllow":return{step:a,prompt:"Your Telegram handle — who may message it",fallback:"",optional:!0};case"telegramToken":return{step:a,prompt:"Telegram bot token (from @BotFather)",fallback:"",optional:!0};case"whatsapp":return{step:a,prompt:"Can people message it on WhatsApp?",fallback:"1",options:p.map((o)=>({value:o.value,label:o.label}))};case"whatsappNumber":return{step:a,prompt:"Your WhatsApp number in digits, no + — the account it links to",fallback:"",optional:!0};case"skills":return{step:a,prompt:"Give it a skills directory? A skill is a procedure it follows when the turn calls for one.",fallback:"starter",options:UA.map((o)=>({value:o.value,label:o.label}))};case"daemon":return{step:a,prompt:"Keep it running in the background?",fallback:"service",options:g.map((o)=>({value:o.value,label:o.label}))};case"dirChoice":return{step:a,prompt:"Where should it live?",fallback:"1",options:h.map((o)=>({value:o.value,label:FA(o.value,e.name,n)??o.label,hint:o.hint}))};case"dir":return{step:a,prompt:"Path to create it at",fallback:""}}}return}function ri(e){let n=e.trim();if(/\s/.test(n))return{ok:!1,reason:"is one handle, with no spaces — for example @moeen."};let t=n.startsWith("@")?n.slice(1):n;if(!/^[A-Za-z0-9_]{5,32}$/.test(t))return{ok:!1,reason:/-/.test(t)?"contains a hyphen, and a Telegram handle cannot — they are letters, digits and underscores only. Did you mean an underscore?":"is not a Telegram handle: 5-32 characters, letters, digits and underscores only. Leave it empty to allow nobody for now."};return{ok:!0,value:`@${t}`}}var H=/^[A-Z_][A-Z0-9_]*$/;function zt(e,n){let t=n.trim();switch(e){case"user":case"name":case"model":case"purpose":return t===""?{ok:!1,reason:"cannot be empty."}:{ok:!0,value:t};case"preset":{let o=$e[Number(t)-1]??Wt(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${$e.length}, or a name: ${$e.map((r)=>r.id).join(", ")}.`}:{ok:!0,value:o.id}}case"web":{let o=u[Number(t)-1]??N(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${u.length}, or a name: ${u.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"webBackend":{let o=l[Number(t)-1]??Io(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${l.length}, or a name: ${l.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"webKey":case"composioKey":case"telegramToken":return{ok:!0,value:t};case"telegramAllow":{let a=t.trim();if(a==="")return{ok:!0,value:""};return ri(a)}case"telegram":{let o=m[Number(t)-1]??P(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${m.length}, or a name: ${m.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"whatsapp":{let o=p[Number(t)-1]??M(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${p.length}, or a name: ${p.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"whatsappNumber":{let a=t.trim();if(a==="")return{ok:!0,value:""};let o=a.replace(/[^0-9]/g,"");if(!/^[0-9]{6,20}$/.test(o))return{ok:!1,reason:"that is not a WhatsApp number — use the digits including the country code, with no + and no spaces."};return{ok:!0,value:o}}case"server":{let o=b[Number(t)-1]??K(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${b.length}, or a name: ${b.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"schedules":{let o=y[Number(t)-1]??C(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${y.length}, or a name: ${y.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"skillsPick":return{ok:!0,value:t.trim()};case"skillsSearch":return{ok:!0,value:t.trim()};case"skills":{let o=UA[Number(t)-1]??Y(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${UA.length}, or a name: ${UA.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"daemon":{let o=g[Number(t)-1]??W(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${g.length}, or a name: ${g.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"composio":{let o=c[Number(t)-1]??x(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${c.length}, or a name: ${c.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"region":return/^[a-z]{2}(-[a-z]+)+-\d$/.test(t)?{ok:!0,value:t}:{ok:!1,reason:"is not an AWS region name, such as eu-west-1 or us-east-1."};case"baseUrl":{let a;try{a=new URL(t)}catch{return{ok:!1,reason:"must be an absolute URL, e.g. https://api.example.com/v1."}}if(a.protocol!=="http:"&&a.protocol!=="https:")return{ok:!1,reason:"only http and https are supported."};if(a.pathname.endsWith("/chat/completions"))return{ok:!1,reason:"must end at the version segment — the runtime appends /chat/completions itself."};return{ok:!0,value:t}}case"apiKeyEnv":return H.test(t)?{ok:!0,value:t}:{ok:!1,reason:"must be an env var name, like MODEL_API_KEY."};case"apiKey":return{ok:!0,value:t};case"serverToken":return{ok:!0,value:t};case"system":{let o=i[Number(t)-1]??k(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${i.length}, or a name: ${i.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"dirChoice":{let o=h[Number(t)-1]??U(t.toLowerCase());return o===void 0?{ok:!1,reason:`pick 1-${h.length}, or a name: ${h.map((r)=>r.value).join(", ")}.`}:{ok:!0,value:o.value}}case"dir":return t===""?{ok:!1,reason:"cannot be empty."}:{ok:!0,value:t}}}function B(e){let n=e.system,t=k(n)??i[0],a=t?.pinned.includes("exec")===!0,o=t?.pinned.includes("file_read")===!0,r=t?.pinned.includes("file_write")===!0,w=t===void 0||t.pinned.length===0?[" # Nothing is enabled. Add tools here and permit them in the policy block below."]:!o?[" # This agent cannot read, write or run anything. It CAN read this file and change it when"," # you ask — which is how you turn the rest on without editing YAML yourself."," #"," # It is told which tools exist and are not enabled, so ask it for something it cannot do"," # and it will name the tool and offer to add it. A change takes effect on the next start."," #"," # To enable them by hand instead, add to pinned:"," # file_read, glob, grep read and search files"," # file_write, file_edit change files, confined to workspace/"," # exec run shell commands — the confinement does not bind it"]:a?[" # This agent can read and change files and run shell commands. What it may run is decided"," # by the policy block below — narrow it, and prefer the file tools over the shell, whose"," # target a rule cannot see inside a command string."," #"," # Writes are confined to workspace/. To open another directory, give the system"," # provider a writeRoots list — the agent cannot add one to itself, by design."," # That confinement binds the file tools and NOT exec, whose target lives inside a"," # shell string no path check can see."]:r?[" # This agent can read files and change them, and cannot run commands. That combination",' # is the only one in which "confined to workspace/" is a true statement — a shell'," # carries its target inside a string no path check can look inside."," #"," # To open another directory, give the system provider a writeRoots list. The agent"," # cannot add one to itself, by design."]:[" # This agent can read and search files and change nothing. Reading is still not nothing:"," # anything it reads can carry text a stranger wrote, which is why the write gate exists."," #"," # Reading is not confined; changing things would be, but nothing here changes things."],L=t?.pinned??[],f=N(e.web)?.pinned??[],v=E(e);return[" # ── providers: where tools come from ──",...w," #"," # Several may be configured at once — this is a map, not a choice. Each block is that"," # provider's own configuration and it refuses a key it does not read."," providers:"," system: {}",...a?[" # system: { writeRoots: [~/code/my-project] } # absolute, or relative to this file"]:[],"",...f.length===0?[" # Named with nothing pinned. It cannot reach the internet, and it knows the two"," # tools exist and will tell you which one to enable rather than saying it can't."," # web_fetch needs no key; web_search needs one, named here:"," # web: { backend: tavily, apiKeyEnv: TAVILY_API_KEY } # tavily | brave | exa"," web: {}"]:v===void 0?[" # Reading pages only. No key and no account: web_fetch takes a URL you or the"," # person gave it. To add search, pick a backend and name its variable:"," # web: { backend: tavily, apiKeyEnv: TAVILY_API_KEY } # tavily | brave | exa"," web: {}"]:[" # Search and page reading. The key lives in the .env beside this file; this names"," # only the variable, and a literal key here fails validation."," web:",` backend: ${v.value}`,` apiKeyEnv: ${v.apiKeyEnv}`]," # Addresses on this machine or this network are refused and no setting permits them."," # Neither tool can change anything, but what they return is text a stranger wrote — so it"," # is fenced as data, and a tool that CHANGES something needs an allow rule after one runs.","",...G(e),""," # What the model is actually given, from any provider above. A slug no configured provider"," # has fails the load naming it — nothing is ever dropped quietly."," pinned:",...L.map((d)=>` - ${d}`),...f.map((d)=>` - ${d}`),...f.includes("web_search")?[]:[" # - web_search"],...f.includes("web_fetch")?[]:[" # - web_fetch"],...R(e).map((d)=>` - ${d}`),...xA(e)?[" # App tools land here once composio_search has found them — ask the agent for what"," # you want and it writes the slug itself. A slug typed in by hand needs",` # \`${A.slug} tools . --warm\` first: boot resolves from a cache and makes no`," # request, so an unwarmed slug fails the load rather than fetching."," # - GMAIL_FETCH_EMAILS"," # - composio_workbench # runs Python in Composio's sandbox, under no rule here"]:[" # - GMAIL_FETCH_EMAILS"]]}function xA(e){return e.composio==="connected"}function R(e){return x(e.composio)?.pinned??[]}var D=["composio_connect","composio_workbench"];function F(e){return D.includes(e)}function G(e){let n=[" # Your other apps — Gmail, Slack, Notion, ~1,000 more — through a Composio account."," # Two tools do the setup: composio_search finds what a task needs and saves the"," # definitions, composio_connect returns the sign-in link. Ask the agent for an app and it"," # pins the slug itself with config_set; the new tool is live after a restart."];if(!xA(e))return[...n," # Named with nothing pinned, so it knows the route exists and can tell you the line"," # to add. To switch it on: pin the two tools below, put a key in .env, and give this"," # block the two settings shown here.",` # composio: { apiKeyEnv: ${En}, userId: default }`," composio: {}"];return[...n," composio:",` apiKeyEnv: ${En}`," # Whose accounts these are, in Composio's terms — not a name of yours. One person on",' # one machine wants "default", and a connection made under it is reused by every later'," # session. Change it only to keep two people's accounts apart on one agent."," userId: default"]}function j(e){let n=k(e.system)??i[0],t=n?.pinned.includes("exec")===!0,a=[...n?.allow??[],...R(e).filter(F)],o=[" # ── which calls run, which ask, and which are refused ──"," # deny wins over allow, first match, and being more specific never reorders that. A rule"," # naming a primary content field — exec(command:rm *) — is refused at load, because a"," # compound command defeats it and a rule that can be defeated reads as protection."," #"," # Below every setting here is a floor that cannot be lowered: rm -rf / and rm -rf ~,"," # --no-preserve-root, fork bombs, mkfs, and dd to a block device are never permitted."," policy:"," mode: allow # allow | ask | deny — for calls no rule mentions"];if(a.length===0)return[...o," allow: []"," deny: []"," onNoApprover: deny"];return[...o," # Authorises these even once untrusted content has entered the turn. Remove one and that"," # tool stops working for the rest of any turn that has read a file — which is the gate"," # doing its job, and worth choosing on purpose rather than discovering."," allow:",...a.map((r)=>` - "${r}"`),...t?[" deny:"," # Narrow these to taste. A pattern matches the command, and every part of a",' # compound must match for an allow — so "git status && rm -rf x" is not allowed'," # by exec(git status:*).",' - "exec(rm *)"',' - "exec(sudo *)"']:[" deny: []"],' onNoApprover: deny # what "ask" means with nobody to ask — a schedule, a pipe']}function V(e){return po(e).capabilities.nativeTools?[" # native: the model's own function calling. nlt (calls written as text) is the opt-in for"," # a model without it; the harness benchmark in evals/harness/ has both, per model."," dialect: native"]:[" # nlt: calls written as text, because the capability registry does not know this model to"," # call tools natively. If it does, `dialect: native` was ahead on 13 of 14 measured models."," dialect: nlt"]}function wr(e,n){let t=q(e);return[{relPath:"agent.yaml",contents:X(e,n)},...["SOUL.md","SOUL.compact.md","AGENTS.md","POLICY.md","USER.md","MEMORY.md","REMINDER.md"].map((a)=>({relPath:`workspace/${a}`,contents:lo(I[a],t)})),...e.skills==="starter"?[{relPath:"skills/starter/SKILL.md",contents:lo(mr,t)}]:[{relPath:"skills/.keep",contents:""}],{relPath:"knowledge/.keep",contents:""},{relPath:".env.example",contents:ee(e)},{relPath:".env",contents:J(e)},{relPath:".gitignore",contents:e.whatsapp==="connected"?`.env
417
417
  .whatsapp/
418
418
  `:`.env
419
- `}]}function q(e){let{user:n,name:t,purpose:a}=e,o=`I confirm before I send, spend or schedule anything ${n} didn't ask for in so many words, and before I delete anything at all, because I'm wired into live systems and mistakes there are expensive.`,r=`When I don't know something I say so and offer to go find out, rather than producing something plausible and letting ${n} discover the difference later.`,w=`When ${n} tells me something worth keeping — a fact about them, a preference, a decision — I save it with memory_write in the same turn, because the conversation is not memory and a new session starts without it.`;return{AGENT_NAME:t,USER:n,WHEN_NOT_TO_USE_KEY:tA(),SKILL_NAME:"starter",RULE_CONFIRM:o,RULE_HONESTY:r,RULE_MEMORY:w,SOUL_WHO:`I'm ${t}. I work with ${n}, and this is what I'm for: ${a}. `+"The relationship is the point — I'm not a search box; I'm closer to a colleague "+`who holds context so ${n} doesn't have to.`,SOUL_MEASURE:"The measure of whether I'm working is not how impressive my answers are — it's "+`whether ${n}'s day runs smoother because I was in it.`,SOUL_ANSWERS:`I lead with the answer and put the reasoning after it, when the reasoning is worth having. Disagreement is part of the job: if I think an idea is bad I say so once, plainly, with the reason, and then help with it anyway if ${n} still wants it. When I'm unsure I name the part I'm unsure about instead of hedging the whole `+"answer into mush — an unhelpful answer isn't the safe one, it just moves the cost "+`somewhere ${n} can't see it.`,SOUL_VOICE:"I write the way people write to each other: plain sentences, no headers, no bullet lists unless there's genuinely a list. Short is a courtesy. I skip performed "+"enthusiasm and padded pleasantries — warmth, where it shows, is in remembering "+`things ${n} didn't ask me to remember.`,SOUL_REFUSE:"A yes-machine. The moment I optimise for sounding agreeable over being right, I stop being worth talking to.",SOUL_COMPACT_WHO:`I'm ${t}. I work with ${n} — ${a}. The measure of whether I'm working is whether ${n}'s day runs smoother because I was in it.`,SOUL_COMPACT_ANSWERS:"I lead with the answer and put the reasoning after it. When I'm unsure I name the part I'm unsure about instead of hedging the whole answer into mush.",SOUL_COMPACT_VOICE:"I write plain sentences: no headers, no bullet lists unless there's genuinely a list. Short is a courtesy.",RESPONSIBILITIES:`My job: ${a}. A task ${n} hands me stays mine until it's done, handed `+`back, or blocked — and when it's blocked, ${n} hears what's blocking it rather than silence.`,WORKFLOW:`I look at what I already know — the files in my context and what ${n} told me `+`earlier — before asking ${n} to repeat themselves. For anything with more than one step I say the plan in a line first, so a wrong direction costs one message instead of the whole job. Work that touches live systems goes through the confirmation rule in my identity file.`,MEMORY_PROCEDURE:`USER.md is the standing picture of ${n} — name, role, preferences they wrote. `+`MEMORY.md is my working notes: when ${n} tells me something worth keeping I save it with memory_write in the same turn, and those notes come back every turn until older ones overflow into the memory directory, where they return when the question matches. Earlier conversations are searched the same way. When a saved note and what ${n} just said disagree, the person wins and I correct the note.`,BOUNDARIES:`If something involves a person other than ${n} and ${n} hasn't said what to `+`share, I ask before including it — ${n} knows the relationship and I don't.`,UNCERTAINTY_BEHAVIOUR:`When I can't reach a tool or a request is ambiguous, I say which part is unclear and ask, because guessing just moves the cost somewhere ${n} can't see it.`,USER_FACTS:`${n} is the person I work for.
420
- What they brought me in for: ${a}.`,REMINDER_RULE:o}}var s=(e)=>`# ── ${e} ${"─".repeat(Math.max(1,88-e.length))}`;function S(e){if(e.whatsapp!=="connected")return[];let n=e.whatsappNumber??"";return[" # Unofficial: this runs Baileys, which reverse-engineers WhatsApp Web. The number can be"," # banned and there is no appeal — use a spare one.",` # Pairing does not complete under Bun; every install of \`${A.slug}\` runs under Node, so`," # this only matters when running from a checkout with bun. The channel says so at start."," - type: whatsapp"," id: wa # the channel segment of every session key it produces"," authDir: ./.whatsapp # the paired session — 0600, and gitignored for you",' # What the phone lists under Linked devices: "Google Chrome (<deviceName>)". The left'," # half is fixed by the protocol; only the bracket is yours. Some accounts refuse a"," # non-standard name under pairing-by-code — if pairing is refused, remove this and pair"," # again. New pairings only; a linked device keeps the name it was paired with.",` # deviceName: ${lt(e.name)}`,...n===""?[" # No number, so pairing is a QR to scan. Set pairWith to the account's own"," # number, digits with no +, and it becomes a code you type into the phone.",' # pairWith: "8801711223344"']:[" # The account this agent becomes a linked device of. Pairing is an"," # eight-character code typed into the phone, under Linked devices.",` pairWith: "${n}"`],...n===""?[" # INBOUND ONLY, and an empty list permits nobody — which is the safe default."," # Message it and the log prints the exact line to paste here. A + is fine."," allowFrom: []"]:[" # INBOUND ONLY. You are in it, so the chat with yourself works. Add others"," # from the log, which names a refused sender and prints the line. A + is fine.",` allowFrom: ["${n}"]`]]}function z(e){if(e.telegram!=="connected"&&e.whatsapp==="connected")return[s("channels"),"# The channel connects AFTER the runtime is ready and never blocks it. Only",`# \`${A.slug} serve\` starts it; \`${A.slug} run\` builds the same agent with`,"# channels switched off. Pairing is a QR: start it and the channel reports needs_input,","# which the web UI draws and `GET /v1/agents/<id>` carries.","channels:",...S(e),"","# Where a turn with no origin goes — a scheduled run, or an API call asking for delivery.","delivery:"," default: wa",""];if(e.telegram!=="connected")return[s("channels — not configured"),"# Reachable through the CLI and the API only.","#",'# You do not have to edit this by hand: ask the agent — "put yourself on Telegram" —',"# and it writes the block below with config_set, then tells you which variable to fill","# in. Two things stay yours either way, and it will say so rather than doing them:","# the token, because .env is protected, and allowFrom, because who may talk to it is","# not its decision. Get a token from @BotFather with /newbot.","#","# allowFrom is INBOUND ONLY, and omitting it permits nobody — which is safe and","# workable: message the bot and the log prints the exact line to paste here.","# channels:","# - type: telegram","# id: tg",`# tokenEnv: ${Eo}`,"# mode: longpoll",'# allowFrom: ["@your-handle"]',"# delivery:","# default: tg",""];let n=e.telegramAllow??"";return[s("channels"),"# Long-poll: no public URL, no inbound firewall rule. Switch to webhook by setting","# mode: webhook and webhookUrl once this runtime has a public HTTPS address.","#","# The bot connects AFTER the runtime is ready and never blocks it — a bad token surfaces",`# as an event and the HTTP surface keeps serving. Only \`${A.slug} serve\` starts it;`,`# \`${A.slug} run\` builds the same agent with channels switched off.`,"channels:"," - type: telegram"," id: tg # the channel segment of every session key it produces",` tokenEnv: ${Eo}`," mode: longpoll # or webhook, with webhookUrl below",` # webhookUrl: https://your-host/v1/channels/tg/webhook/${lt(e.name)}`,...n===""?[" # INBOUND ONLY, and an empty list permits nobody — which is the safe default."," # Message the bot and the log prints the exact line to paste here."," allowFrom: []"]:[" # INBOUND ONLY. It grants nothing on delivery, and omitting it permits nobody.",` allowFrom: ["${n}"]`],...S(e),"","# Where a turn with no origin goes — a scheduled run, or an API call asking for delivery.","delivery:"," default: tg",""]}function Q(e){let n=e.server==="local";return[s("http api"),...n?["# On, loopback only — the token is in the .env beside this file. Set","# enabled: false to switch it off."]:['# Off — ask the agent to "turn on your HTTP API" and it flips this, or set',`# enabled: true here. \`${A.slug} init --server local\` is the default; this`,"# agent was created with --server none."],"# A non-loopback host REFUSES to start without a token, and host and tokenEnv are the two","# fields the agent may not change: an agent that runs shell commands, exposed on 0.0.0.0,","# looks identical to a safe one until someone finds it.","server:",` enabled: ${n}`," host: 127.0.0.1"," port: 7420",` tokenEnv: ${A.envPrefix}API_TOKEN`,""]}function Z(e){let n=[s("schedules"),`# Only \`${A.slug} serve\` fires these. \`run\` reconciles them so they are listed and`,"# validated, and starts no timer.","#","# cron observes DST: an occurrence whose local time does not exist on a spring-forward day","# is SKIPPED, and a repeated fall-back hour fires ONCE. Avoid 00:00-03:00 and neither","# applies. every is interval-anchored and ignores DST. Each fire carries a fixed offset","# derived from the id — at most a tenth of the interval, capped at 15 minutes — so many","# schedules do not hit one endpoint at the same instant.","#",'# deliver is required: { channel, to }, or the literal "none" for the event stream only.'];if(e.schedules==="daily")return[...n,"schedules:"," - id: morning-brief"," kind: cron",' expr: "0 8 * * *" # 08:00 in the timezone below',` timezone: ${O()}`,' task: "Summarise what is on today and anything left over from yesterday."',' deliver: none # or { channel: tg, to: "@your-handle" } once a channel exists',""];if(e.schedules==="hourly")return[...n,"schedules:"," - id: hourly-check"," kind: every"," expr: 1h",' task: "Check for anything that needs attention and say nothing if all is well."',' deliver: none # or { channel: tg, to: "@your-handle" } once a channel exists',""];return[...n,"# schedules:","# - id: morning-brief","# kind: cron # cron | every | at",'# expr: "0 8 * * *" # cron: 5 or 6 field | every: "15m" | at: ISO 8601',`# timezone: ${O()}`,'# task: "Summarise the day ahead."',"# deliver: none",""]}function O(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}function X(e,n){let t=lt(e.name),a=[`# ${e.name} — generated by \`${A.slug} init\`.`,"#","# Everything active below is what init configured; everything commented arrives with the","# phase named beside it, and is REFUSED AT LOAD if uncommented early — the runtime never","# silently ignores configuration. docs/02-SPEC-MANIFEST.md is the binding reference.","",`apiVersion: ${A.apiVersion}`,`id: ${t}`,`name: ${e.name}`,...T(e.purpose)===""?[]:[`description: ${JSON.stringify(T(e.purpose))}`],"",s("model"),"model:"," main:",` id: ${e.model}`];if(e.region!==void 0)a.push(" # AWS Bedrock over the Converse API. No URL and no key variable: credentials come from"," # the AWS default chain — environment, a named profile, the container or instance role."," api: bedrock-converse"," options:",` region: ${e.region}`," # profile: my-aws-profile");else a.push(" # Must end at the version segment; the runtime appends /chat/completions itself.",` baseUrl: ${e.baseUrl}`," # Both take ${VAR} if you would rather set them from the environment — a container, say."," # The KEY never goes here in either form; the manifest names its variable, below.");if(e.apiKeyEnv!==void 0)a.push(" # The *name* of an env var, never a value — a literal key fails validation.",` apiKeyEnv: ${e.apiKeyEnv}`);return a.push(" # temperature: 0.3 # some models refuse any temperature; leave unset for those"," # reasoningEffort: none # none | minimal | low | medium | high — a reasoning model"," # # bills its thinking to the output budget; verify per endpoint"," # topP: 0.95"," # maxTokens: 4096"," # streamUsage: true # OpenAI extension; needed for real token counts on Ollama"," # Override the shipped capability registry only when it is wrong for your endpoint."," # capabilities:"," # contextWindow: 32768"," # thinking: none # none | anthropic | openai | deepseek"," # promptStyle: # how workspace files render for this model (Phase 3.5)"," # delimiters: plain # xml | markdown | plain"," # intensity: emphatic # emphatic | neutral | soft",""," # A cheap model for tool selection and summarisation. `$ref` reuses a role."," # selector:"," # id: a-cheaper-model",...e.region===void 0?[` # baseUrl: ${e.baseUrl}`]:[" # api: bedrock-converse",` # options: { region: ${e.region} }`]," # compactor: { $ref: model.selector }","",s("context"),"context:"," workspace: ./workspace",""," # Tier 0 — cached, read-only. Identity is NOT listed here: the soul below (or its"," # distilled compact file) ships it. AGENTS.md is operations — what the agent does,"," # not who it is — which is why the two coexist."," static:"," - AGENTS.md"," - POLICY.md",""," # Tier 1 — after the cache breakpoint, so a memory write never invalidates the prefix."," volatile:"," - USER.md"," - MEMORY.md",""," # Tier 2 — re-asserted after the history, where attention is strongest."," reminder: REMINDER.md",""," # How much of the window to keep free for the reply, so the prompt cannot crowd it out."," # This is NOT a cap on what the model may generate — nothing is sent as max_tokens unless"," # you set model.main.maxTokens. Generous because a reasoning model thinks here too."," reserveOutput: 8192",...n===void 0?[]:["",` # The window the endpoint published for ${e.model} when this file was made, from`,` # ${n.source}. A fact about the endpoint, not the model: change it if the`," # model is served somewhere else.",` window: ${n.tokens}`],""," # Capability-gated identity: SOUL.md ships only to a model meeting `requires`; anything"," # else gets the hand-edited compact file. Edit SOUL.md first, then re-derive"," # SOUL.compact.md to match — never the reverse."," soul:"," file: SOUL.md",' requires: { contextWindow: ">=200000", class: frontier }'," onUnmet: distill"," distilled: SOUL.compact.md",""," # Defaults shown; uncomment to change. Budgets fail the load naming the file — never"," # silent truncation."," # observationMaxTokens: 2000 # not a default: absent means 5% of the window, 2,000 to 32,000"," # budgets: { static: 2000, volatile: 3500, reminder: 500, total: 6000 }"," # rules:"," # perRuleSuccess: 0.90 # measure with `bun run eval:rules` in a checkout, do not guess"," # reliabilityTarget: 0.80 # at 0.90 per rule this permits TWO rules, not four"," # onExceed: fail","",s("tools"),"tools:"," # Config only, never auto-detected: behaviour must not drift when the model changes.",...V(e.model),""," # Built-in tools, resolved from memory. Never sent to a remote provider."," local:",..._.map((o)=>` - ${o.slug.padEnd(14)}# ${o.note}`),""," budget:"," max: 24"," reserveWrite: 6 # slots held for mutating tools so reads cannot starve writes","",...B(e),""," # tools.search finds a TOOL in the provider's catalogue — nothing to do with web search."," # Off by design in v1: search-then-execute is two-hop reasoning, where small models fail."," search:"," enabled: false","",...j(e),""," # ── the write gate ──"," # A tool whose output came from outside this conversation taints the turn. After that, a"," # tool that CHANGES something needs explicit authorisation — one of the allow rules above,",' # or a live approval. "refuse" never prompts, which is what makes it right for a schedule.'," untrusted:"," onMutate: refuse # refuse | confirm | allow","",s("limits"),"limits:"," # Generous, because a step budget is not a plan. The old default here was 6 — sized for a"," # two-tool chain, call/observe/call/observe/reply and one spare — and it cut a real agent"," # off one step after it had installed the dependency it needed, with the reply ending on",' # "Let me install it". Real work recovers, and recovery costs steps.'," maxSteps: 40"," # This is what catches a model that is stuck rather than working: identical consecutive"," # calls, same tool AND same arguments. Two is a retry, often correct. Three is a pattern."," noProgress:"," identicalCalls: 3"," # Both of these were overridden here at 120000 and 30000, tighter than the defaults for no"," # stated reason — and 6 steps x 30s already exceeded the 120s turn, so the wall clock would"," # have fired first on slow tools. The schema defaults are 1800000 and 120000; uncomment to"," # change them rather than to restate them."," # turnTimeoutMs: 1800000"," # toolTimeoutMs: 120000","",...z(e),...Q(e),s("later phases — refused at load until they ship"),"# Phase 7 — phase-scoped tool visibility (the strongest published small-model lever)","# phases:",'# triage: { entry: true, allow: ["now"] }','# act: { allow: ["*"] }',"","# Skills — procedures the harness selects from the turn's input, at most maxActive per turn.","# The model does not choose one; ranking happens before the turn. `skills list` shows them.","skills:"," dir: ./skills"," maxActive: 1"," threshold: 0.35 # normalised floor; below it nothing activates"," # # there is no token budget: maxActive is the only limit, and a"," # # skill's size is shown in the catalogue where you choose it","","# Memory — what carries across sessions. Retrieved per turn and BM25-ranked, never pinned:",'# slot 10 is retrieved, and compaction may drop it. `memory search <agent> "..."` shows what a',"# question would recall; `memory rebuild <agent>` re-reads the notes and the conversations.","memory:"," retriever: fts5"," dir: ./memory # where eviction files older notes. Indexed, never carried;"," # # created on first eviction, so its absence is not an error"," maxActive: 5"," threshold: 0.2 # lexical relevance × original-query coverage × recency"," budget: 2000 # a ceiling, not a target. One exchange bills about 370 tokens"," includeHistory: true # index clean prose, not only what was deliberately saved."," # # Tool output and replies derived from it are never indexed: text a"," # # stranger wrote must not outlive the write gate"," shared: true # a saved note is also recalled by your other agents (agents:<you>)."," # # A stand-in or a room never reads it","","# Sessions — how a conversation is chosen. owner: your turns from the web, the terminal and","# every channel share one, and a stranger keeps their own. channel-peer: one per surface.",'# "New conversation" in the web or the terminal starts afresh everywhere at once.',"sessions:"," scope: owner","","# Delegation — ask: your other agents can ask this one a question (ask_agent), and it can",'# ask them. Both have to say yes. Off is "keep me out of it".',"delegation:"," ask: true","","# Knowledge — reference material that activates only on the turns that mention it. Tier 3:","# retrieved, never pinned, outside the workspace budget, and compaction may drop it.","# Every .md in that directory is an entry and must open with frontmatter naming its","# keywords, so a plain README.md there fails the load. An entry looks like:","# ---","# keywords: [invoice, billing, VAT]","# ---","# Whatever this agent should know whenever one of those words comes up.","knowledge:"," dir: ./knowledge"," maxActive: 2 # entries in one turn"," budget: 600 # total across them. One entry over this fails the load: it could"," # # never activate, and silently unreachable is the wrong answer."," # # Matching is whole-word and case-insensitive against the input","",...Z(e),"# Plugins — extra channels, tool providers and script runners, resolved at boot.","# Looked up in three places, in order: this binary's built-in registry, then",`# ~/${A.stateDir}/plugins/<name>/ where \`${A.slug} plugins add\` puts one, then a module`,"# import. A relative path is only ever a path, resolved against this file's directory.","# Nothing is installed while the process runs, so a plugin is one self-contained bundle.","# Trusted in-process code: `permissions` is advisory in v1 — recorded, surfaced by",`# \`${A.slug} plugins list\`, enforced by nothing. Install plugins you trust.`,"# plugins:",`# - "${A.packageScope}/channel-telegram"`,""),a.join(`
421
- `)}function J(e){let n=["# Secrets for this agent. Gitignored, and the only thing that belongs here.","# Everything else — model, endpoint, tools, permissions — is in agent.yaml."];if(e.apiKeyEnv!==void 0)n.push(`${e.apiKeyEnv}=${e.apiKey??""}`);let t=E(e);if(t!==void 0)n.push(""),n.push(`# ${t.label.split(" —")[0]??t.value}, for web_search.`),n.push(`${t.apiKeyEnv}=${e.webKey??""}`);if(HA(e))n.push(""),n.push("# Composio, for your other apps. Needed to warm the cache and to execute."),n.push(`${pn}=${e.composioKey??""}`);if(e.telegram==="connected")n.push(""),n.push("# Telegram. From @BotFather with /newbot; /revoke invalidates it immediately."),n.push(`${Eo}=${e.telegramToken??""}`);if(e.serverToken!==void 0&&e.serverToken!=="")n.push(""),n.push("# The HTTP API's bearer token. Generated. In the sandbox every agent shares the host's,"),n.push("# kept in agents/.api-token — change it there and restart the server."),n.push(`${A.envPrefix}API_TOKEN=${e.serverToken}`);return`${n.join(`
419
+ `}]}function q(e){let{user:n,name:t,purpose:a}=e,o=`I confirm before I send, spend or schedule anything ${n} didn't ask for in so many words, and before I delete anything at all, because I'm wired into live systems and mistakes there are expensive.`,r=`When I don't know something I say so and offer to go find out, rather than producing something plausible and letting ${n} discover the difference later.`,w=`When ${n} tells me something worth keeping — a fact about them, a preference, a decision — I save it with memory_write in the same turn, because the conversation is not memory and a new session starts without it.`;return{AGENT_NAME:t,USER:n,WHEN_NOT_TO_USE_KEY:eA(),SKILL_NAME:"starter",RULE_CONFIRM:o,RULE_HONESTY:r,RULE_MEMORY:w,SOUL_WHO:`I'm ${t}. I work with ${n}, and this is what I'm for: ${a}. `+"The relationship is the point — I'm not a search box; I'm closer to a colleague "+`who holds context so ${n} doesn't have to.`,SOUL_MEASURE:"The measure of whether I'm working is not how impressive my answers are — it's "+`whether ${n}'s day runs smoother because I was in it.`,SOUL_ANSWERS:`I lead with the answer and put the reasoning after it, when the reasoning is worth having. Disagreement is part of the job: if I think an idea is bad I say so once, plainly, with the reason, and then help with it anyway if ${n} still wants it. When I'm unsure I name the part I'm unsure about instead of hedging the whole `+"answer into mush — an unhelpful answer isn't the safe one, it just moves the cost "+`somewhere ${n} can't see it.`,SOUL_VOICE:"I write the way people write to each other: plain sentences, no headers, no bullet lists unless there's genuinely a list. Short is a courtesy. I skip performed "+"enthusiasm and padded pleasantries — warmth, where it shows, is in remembering "+`things ${n} didn't ask me to remember.`,SOUL_REFUSE:"A yes-machine. The moment I optimise for sounding agreeable over being right, I stop being worth talking to.",SOUL_COMPACT_WHO:`I'm ${t}. I work with ${n} — ${a}. The measure of whether I'm working is whether ${n}'s day runs smoother because I was in it.`,SOUL_COMPACT_ANSWERS:"I lead with the answer and put the reasoning after it. When I'm unsure I name the part I'm unsure about instead of hedging the whole answer into mush.",SOUL_COMPACT_VOICE:"I write plain sentences: no headers, no bullet lists unless there's genuinely a list. Short is a courtesy.",RESPONSIBILITIES:`My job: ${a}. A task ${n} hands me stays mine until it's done, handed `+`back, or blocked — and when it's blocked, ${n} hears what's blocking it rather than silence.`,WORKFLOW:`I look at what I already know — the files in my context and what ${n} told me `+`earlier — before asking ${n} to repeat themselves. For anything with more than one step I say the plan in a line first, so a wrong direction costs one message instead of the whole job. Work that touches live systems goes through the confirmation rule in my identity file.`,MEMORY_PROCEDURE:`USER.md is the standing picture of ${n} — name, role, preferences they wrote. `+`MEMORY.md is my working notes: when ${n} tells me something worth keeping I save it with memory_write in the same turn, and those notes come back every turn until older ones overflow into the memory directory, where they return when the question matches. Earlier conversations are searched the same way. When a saved note and what ${n} just said disagree, the person wins and I correct the note.`,BOUNDARIES:`If something involves a person other than ${n} and ${n} hasn't said what to `+`share, I ask before including it — ${n} knows the relationship and I don't.`,UNCERTAINTY_BEHAVIOUR:`When I can't reach a tool or a request is ambiguous, I say which part is unclear and ask, because guessing just moves the cost somewhere ${n} can't see it.`,USER_FACTS:`${n} is the person I work for.
420
+ What they brought me in for: ${a}.`,REMINDER_RULE:o}}var s=(e)=>`# ── ${e} ${"─".repeat(Math.max(1,88-e.length))}`;function S(e){if(e.whatsapp!=="connected")return[];let n=e.whatsappNumber??"";return[" # Unofficial: this runs Baileys, which reverse-engineers WhatsApp Web. The number can be"," # banned and there is no appeal — use a spare one.",` # Pairing does not complete under Bun; every install of \`${A.slug}\` runs under Node, so`," # this only matters when running from a checkout with bun. The channel says so at start."," - type: whatsapp"," id: wa # the channel segment of every session key it produces"," authDir: ./.whatsapp # the paired session — 0600, and gitignored for you",' # What the phone lists under Linked devices: "Google Chrome (<deviceName>)". The left'," # half is fixed by the protocol; only the bracket is yours. Some accounts refuse a"," # non-standard name under pairing-by-code — if pairing is refused, remove this and pair"," # again. New pairings only; a linked device keeps the name it was paired with.",` # deviceName: ${ct(e.name)}`,...n===""?[" # No number, so pairing is a QR to scan. Set pairWith to the account's own"," # number, digits with no +, and it becomes a code you type into the phone.",' # pairWith: "8801711223344"']:[" # The account this agent becomes a linked device of. Pairing is an"," # eight-character code typed into the phone, under Linked devices.",` pairWith: "${n}"`],...n===""?[" # INBOUND ONLY, and an empty list permits nobody — which is the safe default."," # Message it and the log prints the exact line to paste here. A + is fine."," allowFrom: []"]:[" # INBOUND ONLY. You are in it, so the chat with yourself works. Add others"," # from the log, which names a refused sender and prints the line. A + is fine.",` allowFrom: ["${n}"]`]]}function z(e){if(e.telegram!=="connected"&&e.whatsapp==="connected")return[s("channels"),"# The channel connects AFTER the runtime is ready and never blocks it. Only",`# \`${A.slug} serve\` starts it; \`${A.slug} run\` builds the same agent with`,"# channels switched off. Pairing is a QR: start it and the channel reports needs_input,","# which the web UI draws and `GET /v1/agents/<id>` carries.","channels:",...S(e),"","# Where a turn with no origin goes — a scheduled run, or an API call asking for delivery.","delivery:"," default: wa",""];if(e.telegram!=="connected")return[s("channels — not configured"),"# Reachable through the CLI and the API only.","#",'# You do not have to edit this by hand: ask the agent — "put yourself on Telegram" —',"# and it writes the block below with config_set, then tells you which variable to fill","# in. Two things stay yours either way, and it will say so rather than doing them:","# the token, because .env is protected, and allowFrom, because who may talk to it is","# not its decision. Get a token from @BotFather with /newbot.","#","# allowFrom is INBOUND ONLY, and omitting it permits nobody — which is safe and","# workable: message the bot and the log prints the exact line to paste here.","# channels:","# - type: telegram","# id: tg",`# tokenEnv: ${uo}`,"# mode: longpoll",'# allowFrom: ["@your-handle"]',"# delivery:","# default: tg",""];let n=e.telegramAllow??"";return[s("channels"),"# Long-poll: no public URL, no inbound firewall rule. Switch to webhook by setting","# mode: webhook and webhookUrl once this runtime has a public HTTPS address.","#","# The bot connects AFTER the runtime is ready and never blocks it — a bad token surfaces",`# as an event and the HTTP surface keeps serving. Only \`${A.slug} serve\` starts it;`,`# \`${A.slug} run\` builds the same agent with channels switched off.`,"channels:"," - type: telegram"," id: tg # the channel segment of every session key it produces",` tokenEnv: ${uo}`," mode: longpoll # or webhook, with webhookUrl below",` # webhookUrl: https://your-host/v1/channels/tg/webhook/${ct(e.name)}`,...n===""?[" # INBOUND ONLY, and an empty list permits nobody — which is the safe default."," # Message the bot and the log prints the exact line to paste here."," allowFrom: []"]:[" # INBOUND ONLY. It grants nothing on delivery, and omitting it permits nobody.",` allowFrom: ["${n}"]`],...S(e),"","# Where a turn with no origin goes — a scheduled run, or an API call asking for delivery.","delivery:"," default: tg",""]}function Q(e){let n=e.server==="local";return[s("http api"),...n?["# On, loopback only — the token is in the .env beside this file. Set","# enabled: false to switch it off."]:['# Off — ask the agent to "turn on your HTTP API" and it flips this, or set',`# enabled: true here. \`${A.slug} init --server local\` is the default; this`,"# agent was created with --server none."],"# A non-loopback host REFUSES to start without a token, and host and tokenEnv are the two","# fields the agent may not change: an agent that runs shell commands, exposed on 0.0.0.0,","# looks identical to a safe one until someone finds it.","server:",` enabled: ${n}`," host: 127.0.0.1"," port: 7420",` tokenEnv: ${A.envPrefix}API_TOKEN`,""]}function Z(e){let n=[s("schedules"),`# Only \`${A.slug} serve\` fires these. \`run\` reconciles them so they are listed and`,"# validated, and starts no timer.","#","# cron observes DST: an occurrence whose local time does not exist on a spring-forward day","# is SKIPPED, and a repeated fall-back hour fires ONCE. Avoid 00:00-03:00 and neither","# applies. every is interval-anchored and ignores DST. Each fire carries a fixed offset","# derived from the id — at most a tenth of the interval, capped at 15 minutes — so many","# schedules do not hit one endpoint at the same instant.","#",'# deliver is required: { channel, to }, or the literal "none" for the event stream only.'];if(e.schedules==="daily")return[...n,"schedules:"," - id: morning-brief"," kind: cron",' expr: "0 8 * * *" # 08:00 in the timezone below',` timezone: ${O()}`,' task: "Summarise what is on today and anything left over from yesterday."',' deliver: none # or { channel: tg, to: "@your-handle" } once a channel exists',""];if(e.schedules==="hourly")return[...n,"schedules:"," - id: hourly-check"," kind: every"," expr: 1h",' task: "Check for anything that needs attention and say nothing if all is well."',' deliver: none # or { channel: tg, to: "@your-handle" } once a channel exists',""];return[...n,"# schedules:","# - id: morning-brief","# kind: cron # cron | every | at",'# expr: "0 8 * * *" # cron: 5 or 6 field | every: "15m" | at: ISO 8601',`# timezone: ${O()}`,'# task: "Summarise the day ahead."',"# deliver: none",""]}function O(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}function X(e,n){let t=ct(e.name),a=[`# ${e.name} — generated by \`${A.slug} init\`.`,"#","# Everything active below is what init configured; everything commented arrives with the","# phase named beside it, and is REFUSED AT LOAD if uncommented early — the runtime never","# silently ignores configuration. docs/02-SPEC-MANIFEST.md is the binding reference.","",`apiVersion: ${A.apiVersion}`,`id: ${t}`,`name: ${e.name}`,...T(e.purpose)===""?[]:[`description: ${JSON.stringify(T(e.purpose))}`],"",s("model"),"model:"," main:",` id: ${e.model}`];if(e.region!==void 0)a.push(" # AWS Bedrock over the Converse API. No URL and no key variable: credentials come from"," # the AWS default chain — environment, a named profile, the container or instance role."," api: bedrock-converse"," options:",` region: ${e.region}`," # profile: my-aws-profile");else a.push(" # Must end at the version segment; the runtime appends /chat/completions itself.",` baseUrl: ${e.baseUrl}`," # Both take ${VAR} if you would rather set them from the environment — a container, say."," # The KEY never goes here in either form; the manifest names its variable, below.");if(e.apiKeyEnv!==void 0)a.push(" # The *name* of an env var, never a value — a literal key fails validation.",` apiKeyEnv: ${e.apiKeyEnv}`);return a.push(" # temperature: 0.3 # some models refuse any temperature; leave unset for those"," # reasoningEffort: none # none | minimal | low | medium | high — a reasoning model"," # # bills its thinking to the output budget; verify per endpoint"," # topP: 0.95"," # maxTokens: 4096"," # streamUsage: true # OpenAI extension; needed for real token counts on Ollama"," # Override the shipped capability registry only when it is wrong for your endpoint."," # capabilities:"," # contextWindow: 32768"," # thinking: none # none | anthropic | openai | deepseek"," # promptStyle: # how workspace files render for this model (Phase 3.5)"," # delimiters: plain # xml | markdown | plain"," # intensity: emphatic # emphatic | neutral | soft",""," # A cheap model for tool selection and summarisation. `$ref` reuses a role."," # selector:"," # id: a-cheaper-model",...e.region===void 0?[` # baseUrl: ${e.baseUrl}`]:[" # api: bedrock-converse",` # options: { region: ${e.region} }`]," # compactor: { $ref: model.selector }","",s("context"),"context:"," workspace: ./workspace",""," # Tier 0 — cached, read-only. Identity is NOT listed here: the soul below (or its"," # distilled compact file) ships it. AGENTS.md is operations — what the agent does,"," # not who it is — which is why the two coexist."," static:"," - AGENTS.md"," - POLICY.md",""," # Tier 1 — after the cache breakpoint, so a memory write never invalidates the prefix."," volatile:"," - USER.md"," - MEMORY.md",""," # Tier 2 — re-asserted after the history, where attention is strongest."," reminder: REMINDER.md",""," # How much of the window to keep free for the reply, so the prompt cannot crowd it out."," # This is NOT a cap on what the model may generate — nothing is sent as max_tokens unless"," # you set model.main.maxTokens. Generous because a reasoning model thinks here too."," reserveOutput: 8192",...n===void 0?[]:["",` # The window the endpoint published for ${e.model} when this file was made, from`,` # ${n.source}. A fact about the endpoint, not the model: change it if the`," # model is served somewhere else.",` window: ${n.tokens}`],""," # Capability-gated identity: SOUL.md ships only to a model meeting `requires`; anything"," # else gets the hand-edited compact file. Edit SOUL.md first, then re-derive"," # SOUL.compact.md to match — never the reverse."," soul:"," file: SOUL.md",' requires: { contextWindow: ">=200000", class: frontier }'," onUnmet: distill"," distilled: SOUL.compact.md",""," # Defaults shown; uncomment to change. Budgets fail the load naming the file — never"," # silent truncation."," # observationMaxTokens: 2000 # not a default: absent means 5% of the window, 2,000 to 32,000"," # budgets: { static: 2000, volatile: 3500, reminder: 500, total: 6000 }"," # rules:"," # perRuleSuccess: 0.90 # measure with `bun run eval:rules` in a checkout, do not guess"," # reliabilityTarget: 0.80 # at 0.90 per rule this permits TWO rules, not four"," # onExceed: fail","",s("tools"),"tools:"," # Config only, never auto-detected: behaviour must not drift when the model changes.",...V(e.model),""," # Built-in tools, resolved from memory. Never sent to a remote provider."," local:",..._.map((o)=>` - ${o.slug.padEnd(14)}# ${o.note}`),""," budget:"," max: 24"," reserveWrite: 6 # slots held for mutating tools so reads cannot starve writes","",...B(e),""," # tools.search finds a TOOL in the provider's catalogue — nothing to do with web search."," # Off by design in v1: search-then-execute is two-hop reasoning, where small models fail."," search:"," enabled: false","",...j(e),""," # ── the write gate ──"," # A tool whose output came from outside this conversation taints the turn. After that, a"," # tool that CHANGES something needs explicit authorisation — one of the allow rules above,",' # or a live approval. "refuse" never prompts, which is what makes it right for a schedule.'," untrusted:"," onMutate: refuse # refuse | confirm | allow","",s("limits"),"limits:"," # Generous, because a step budget is not a plan. The old default here was 6 — sized for a"," # two-tool chain, call/observe/call/observe/reply and one spare — and it cut a real agent"," # off one step after it had installed the dependency it needed, with the reply ending on",' # "Let me install it". Real work recovers, and recovery costs steps.'," maxSteps: 40"," # This is what catches a model that is stuck rather than working: identical consecutive"," # calls, same tool AND same arguments. Two is a retry, often correct. Three is a pattern."," noProgress:"," identicalCalls: 3"," # Both of these were overridden here at 120000 and 30000, tighter than the defaults for no"," # stated reason — and 6 steps x 30s already exceeded the 120s turn, so the wall clock would"," # have fired first on slow tools. The schema defaults are 1800000 and 120000; uncomment to"," # change them rather than to restate them."," # turnTimeoutMs: 1800000"," # toolTimeoutMs: 120000","",...z(e),...Q(e),s("later phases — refused at load until they ship"),"# Phase 7 — phase-scoped tool visibility (the strongest published small-model lever)","# phases:",'# triage: { entry: true, allow: ["now"] }','# act: { allow: ["*"] }',"","# Skills — procedures the harness selects from the turn's input, at most maxActive per turn.","# The model does not choose one; ranking happens before the turn. `skills list` shows them.","skills:"," dir: ./skills"," maxActive: 1"," threshold: 0.35 # normalised floor; below it nothing activates"," # # there is no token budget: maxActive is the only limit, and a"," # # skill's size is shown in the catalogue where you choose it","","# Memory — what carries across sessions. Retrieved per turn and BM25-ranked, never pinned:",'# slot 10 is retrieved, and compaction may drop it. `memory search <agent> "..."` shows what a',"# question would recall; `memory rebuild <agent>` re-reads the notes and the conversations.","memory:"," retriever: fts5"," dir: ./memory # where eviction files older notes. Indexed, never carried;"," # # created on first eviction, so its absence is not an error"," maxActive: 5"," threshold: 0.2 # lexical relevance × original-query coverage × recency"," budget: 2000 # a ceiling, not a target. One exchange bills about 370 tokens"," includeHistory: true # index clean prose, not only what was deliberately saved."," # # Tool output and replies derived from it are never indexed: text a"," # # stranger wrote must not outlive the write gate"," shared: true # a saved note is also recalled by your other agents (agents:<you>)."," # # A stand-in or a room never reads it","","# Sessions — how a conversation is chosen. owner: your turns from the web, the terminal and","# every channel share one, and a stranger keeps their own. channel-peer: one per surface.",'# "New conversation" in the web or the terminal starts afresh everywhere at once.',"sessions:"," scope: owner","","# Delegation — ask: your other agents can ask this one a question (ask_agent), and it can",'# ask them. Both have to say yes. Off is "keep me out of it".',"delegation:"," ask: true","","# Knowledge — reference material that activates only on the turns that mention it. Tier 3:","# retrieved, never pinned, outside the workspace budget, and compaction may drop it.","# Every .md in that directory is an entry and must open with frontmatter naming its","# keywords, so a plain README.md there fails the load. An entry looks like:","# ---","# keywords: [invoice, billing, VAT]","# ---","# Whatever this agent should know whenever one of those words comes up.","knowledge:"," dir: ./knowledge"," maxActive: 2 # entries in one turn"," budget: 600 # total across them. One entry over this fails the load: it could"," # # never activate, and silently unreachable is the wrong answer."," # # Matching is whole-word and case-insensitive against the input","",...Z(e),"# Plugins — extra channels, tool providers and script runners, resolved at boot.","# Looked up in three places, in order: this binary's built-in registry, then",`# ~/${A.stateDir}/plugins/<name>/ where \`${A.slug} plugins add\` puts one, then a module`,"# import. A relative path is only ever a path, resolved against this file's directory.","# Nothing is installed while the process runs, so a plugin is one self-contained bundle.","# Trusted in-process code: `permissions` is advisory in v1 — recorded, surfaced by",`# \`${A.slug} plugins list\`, enforced by nothing. Install plugins you trust.`,"# plugins:",`# - "${A.packageScope}/channel-telegram"`,""),a.join(`
421
+ `)}function J(e){let n=["# Secrets for this agent. Gitignored, and the only thing that belongs here.","# Everything else — model, endpoint, tools, permissions — is in agent.yaml."];if(e.apiKeyEnv!==void 0)n.push(`${e.apiKeyEnv}=${e.apiKey??""}`);let t=E(e);if(t!==void 0)n.push(""),n.push(`# ${t.label.split(" —")[0]??t.value}, for web_search.`),n.push(`${t.apiKeyEnv}=${e.webKey??""}`);if(xA(e))n.push(""),n.push("# Composio, for your other apps. Needed to warm the cache and to execute."),n.push(`${En}=${e.composioKey??""}`);if(e.telegram==="connected")n.push(""),n.push("# Telegram. From @BotFather with /newbot; /revoke invalidates it immediately."),n.push(`${uo}=${e.telegramToken??""}`);if(e.serverToken!==void 0&&e.serverToken!=="")n.push(""),n.push("# The HTTP API's bearer token. Generated. In the sandbox every agent shares the host's,"),n.push("# kept in agents/.api-token — change it there and restart the server."),n.push(`${A.envPrefix}API_TOKEN=${e.serverToken}`);return`${n.join(`
422
422
  `)}
423
- `}function E(e){if(e.web!=="search")return;return uo(e.webBackend??"tavily")??l[0]}function ee(e){let n=E(e),t=["# Copy to .env beside the manifest and fill in the values. Never commit the copy.","# Only secrets belong here. The model, the endpoint, the tools and the permissions are all","# in agent.yaml, where you can read them without opening a second file.",""];if(e.apiKeyEnv===void 0)t.push("# This endpoint needs no key — agent.yaml omits apiKeyEnv entirely, so there is nothing","# to put here yet. A hosted endpoint would name its variable there and you would set it","# here, like:","# MODEL_API_KEY=");else t.push(`${e.apiKeyEnv}=`);if(n!==void 0)t.push("",`# ${n.label.split(" —")[0]??n.value}, for web_search.`),t.push(`${n.apiKeyEnv}=`);if(HA(e))t.push("","# Composio, for your other apps."),t.push(`${pn}=`);return`${t.join(`
423
+ `}function E(e){if(e.web!=="search")return;return Io(e.webBackend??"tavily")??l[0]}function ee(e){let n=E(e),t=["# Copy to .env beside the manifest and fill in the values. Never commit the copy.","# Only secrets belong here. The model, the endpoint, the tools and the permissions are all","# in agent.yaml, where you can read them without opening a second file.",""];if(e.apiKeyEnv===void 0)t.push("# This endpoint needs no key — agent.yaml omits apiKeyEnv entirely, so there is nothing","# to put here yet. A hosted endpoint would name its variable there and you would set it","# here, like:","# MODEL_API_KEY=");else t.push(`${e.apiKeyEnv}=`);if(n!==void 0)t.push("",`# ${n.label.split(" —")[0]??n.value}, for web_search.`),t.push(`${n.apiKeyEnv}=`);if(xA(e))t.push("","# Composio, for your other apps."),t.push(`${En}=`);return`${t.join(`
424
424
  `)}
425
425
  `}
426
- export{Sr,Io,$e,zt,UA,uo,pn,Eo,xA,wr,Cn,lt,gA,ri,Zt,HA,Dr};
426
+ export{mr,lo,$e,Wt,FA,Io,En,uo,UA,Sr,fn,ct,aA,ri,zt,xA,wr};
427
427
 
428
- //# debugId=2427A2BC1A960D6064756E2164756E21
429
- //# sourceMappingURL=index-mgef1n4e.js.map
428
+ //# debugId=D22B7B90E3A921F164756E2164756E21
429
+ //# sourceMappingURL=index-5ptbytze.js.map