dispach 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -27
- package/dist/APEv2Parser-x13n424p.js +5 -0
- package/dist/{FlacParser-7t7da7qy.js.map → APEv2Parser-x13n424p.js.map} +1 -1
- package/dist/{AiffParser-y21k3fak.js → AiffParser-ns1y9f0g.js} +3 -3
- package/dist/{AiffParser-y21k3fak.js.map → AiffParser-ns1y9f0g.js.map} +1 -1
- package/dist/App-wkpkwgjt.js +11 -0
- package/dist/{App-4w3qkcs4.js.map → App-wkpkwgjt.js.map} +3 -3
- package/dist/AsfParser-bae2a1yf.js +5 -0
- package/dist/{AsfParser-wd98k2h4.js.map → AsfParser-bae2a1yf.js.map} +1 -1
- package/dist/ConfigEditor-hy9jtas3.js +6 -0
- package/dist/{ConfigEditor-vk7vxaa6.js.map → ConfigEditor-hy9jtas3.js.map} +1 -1
- package/dist/DsdiffParser-s0zvxnfa.js +5 -0
- package/dist/{DsdiffParser-cbfaj500.js.map → DsdiffParser-s0zvxnfa.js.map} +1 -1
- package/dist/{DsfParser-tybrja4x.js → DsfParser-90mvzt4v.js} +3 -3
- package/dist/{DsfParser-tybrja4x.js.map → DsfParser-90mvzt4v.js.map} +1 -1
- package/dist/FlacParser-8xprykrh.js +5 -0
- package/dist/{APEv2Parser-etzjd528.js.map → FlacParser-8xprykrh.js.map} +1 -1
- package/dist/{KeyProbe-5anphmb7.js → KeyProbe-fk5krzks.js} +3 -3
- package/dist/{KeyProbe-5anphmb7.js.map → KeyProbe-fk5krzks.js.map} +1 -1
- package/dist/MP4Parser-nmvbkq21.js +5 -0
- package/dist/{MP4Parser-gc94h1n9.js.map → MP4Parser-nmvbkq21.js.map} +2 -2
- package/dist/{MatroskaParser-cy2k4fac.js → MatroskaParser-tsmz2qfq.js} +3 -3
- package/dist/{MatroskaParser-cy2k4fac.js.map → MatroskaParser-tsmz2qfq.js.map} +1 -1
- package/dist/{MpegParser-c460fwf0.js → MpegParser-y5fjpaz9.js} +3 -3
- package/dist/{MpegParser-c460fwf0.js.map → MpegParser-y5fjpaz9.js.map} +1 -1
- package/dist/MusepackParser-544q0byg.js +5 -0
- package/dist/{MusepackParser-8mq2eabg.js.map → MusepackParser-544q0byg.js.map} +2 -2
- package/dist/OggParser-v77rbjnt.js +5 -0
- package/dist/{OggParser-7dnc6apg.js.map → OggParser-v77rbjnt.js.map} +1 -1
- package/dist/Picker-32m79nmp.js +5 -0
- package/dist/{Picker-j7txnm7w.js.map → Picker-32m79nmp.js.map} +1 -1
- package/dist/SessionPicker-9p06npt5.js +5 -0
- package/dist/{SessionPicker-hpv2ncsb.js.map → SessionPicker-9p06npt5.js.map} +1 -1
- package/dist/SkillBrowser-ezdx3xsh.js +5 -0
- package/dist/{SkillBrowser-qc542n71.js.map → SkillBrowser-ezdx3xsh.js.map} +1 -1
- package/dist/WavPackParser-k623m0hk.js +5 -0
- package/dist/{WavPackParser-kt7cds9c.js.map → WavPackParser-k623m0hk.js.map} +1 -1
- package/dist/WaveParser-nj4p1vx8.js +5 -0
- package/dist/{WaveParser-g47ja0vy.js.map → WaveParser-nj4p1vx8.js.map} +1 -1
- package/dist/WizardApp-p350qspw.js +5 -0
- package/dist/{WizardApp-q4p979d1.js.map → WizardApp-p350qspw.js.map} +1 -1
- package/dist/channels-a9zx9yba.js +31 -0
- package/dist/{channels-4t89qpdt.js.map → channels-a9zx9yba.js.map} +1 -1
- package/dist/client.d.ts +43 -0
- package/dist/client.js +9 -9
- package/dist/client.js.map +5 -5
- package/dist/components/App.d.ts.map +1 -1
- package/dist/config-3mz4zwsf.js +24 -0
- package/dist/{config-35r6n1gh.js.map → config-3mz4zwsf.js.map} +2 -2
- package/dist/credential-ja7zmd4c.js +19 -0
- package/dist/{credential-dpdgg4j6.js.map → credential-ja7zmd4c.js.map} +1 -1
- package/dist/index-039ew35r.js +6 -0
- package/dist/index-039ew35r.js.map +10 -0
- package/dist/index-0dvs3a06.js +6 -0
- package/dist/{index-jc4kmfwa.js.map → index-0dvs3a06.js.map} +1 -1
- package/dist/{index-pszmnhgq.js → index-1cagdzqe.js} +9 -9
- package/dist/{index-pszmnhgq.js.map → index-1cagdzqe.js.map} +1 -1
- package/dist/index-2fw9e5gg.js +6 -0
- package/dist/{index-0444sh6x.js.map → index-2fw9e5gg.js.map} +1 -1
- package/dist/{index-a2eh8dnk.js → index-2td5h856.js} +12 -12
- package/dist/{index-a2eh8dnk.js.map → index-2td5h856.js.map} +1 -1
- package/dist/{index-m6fqx0ch.js → index-446exxcb.js} +7 -7
- package/dist/{index-m6fqx0ch.js.map → index-446exxcb.js.map} +1 -1
- package/dist/{index-snz49ndn.js → index-4fajxhdv.js} +4 -4
- package/dist/{index-snz49ndn.js.map → index-4fajxhdv.js.map} +1 -1
- package/dist/index-4j65jp20.js +9 -0
- package/dist/{index-38gs9anh.js.map → index-4j65jp20.js.map} +1 -1
- package/dist/index-5gn74n56.js +10 -0
- package/dist/{index-ew997be5.js.map → index-5gn74n56.js.map} +2 -2
- package/dist/index-5zpfz4kb.js +9 -0
- package/dist/{index-8h6kewy1.js.map → index-5zpfz4kb.js.map} +1 -1
- package/dist/index-60h4knj6.js +126 -0
- package/dist/{index-zce9gy22.js.map → index-60h4knj6.js.map} +2 -2
- package/dist/index-635wcsh1.js +5 -0
- package/dist/{index-2bsardvh.js.map → index-635wcsh1.js.map} +1 -1
- package/dist/index-67sfck4d.js +110 -0
- package/dist/index-67sfck4d.js.map +13 -0
- package/dist/index-7p8d1gf0.js +63 -0
- package/dist/{index-ytxbw8py.js.map → index-7p8d1gf0.js.map} +1 -1
- package/dist/index-7zgjkbb0.js +5 -0
- package/dist/{index-qgsdgbk8.js.map → index-7zgjkbb0.js.map} +1 -1
- package/dist/{index-zw6wyas6.js → index-86rb86nr.js} +4 -4
- package/dist/{index-zw6wyas6.js.map → index-86rb86nr.js.map} +1 -1
- package/dist/{index-fbsrhcga.js → index-8jejze0z.js} +4 -4
- package/dist/{index-fbsrhcga.js.map → index-8jejze0z.js.map} +1 -1
- package/dist/index-8k8y7edx.js +7 -0
- package/dist/{index-3826kf9t.js.map → index-8k8y7edx.js.map} +1 -1
- package/dist/index-8mkatm20.js +6 -0
- package/dist/{index-42e29zs4.js.map → index-8mkatm20.js.map} +1 -1
- package/dist/{index-3vzf253k.js → index-9k6qa50r.js} +7 -7
- package/dist/{index-3vzf253k.js.map → index-9k6qa50r.js.map} +1 -1
- package/dist/{index-yw3fby4n.js → index-a1axc952.js} +4 -4
- package/dist/{index-yw3fby4n.js.map → index-a1axc952.js.map} +1 -1
- package/dist/index-ayhdn87b.js +6 -0
- package/dist/{index-dzy19wtf.js.map → index-ayhdn87b.js.map} +1 -1
- package/dist/index-b8bfzbfe.js +6 -0
- package/dist/{index-7mn8ack9.js.map → index-b8bfzbfe.js.map} +2 -2
- package/dist/index-brh25jhq.js +6 -0
- package/dist/{index-fa9wvpyw.js.map → index-brh25jhq.js.map} +2 -2
- package/dist/index-c6qrcweh.js +6 -0
- package/dist/{index-nxhqf597.js.map → index-c6qrcweh.js.map} +1 -1
- package/dist/index-cb45233h.js +6 -0
- package/dist/{index-nvc24414.js.map → index-cb45233h.js.map} +1 -1
- package/dist/{index-51x0n5z0.js → index-dcy14zdn.js} +5 -5
- package/dist/{index-51x0n5z0.js.map → index-dcy14zdn.js.map} +1 -1
- package/dist/index-f6r3h2yh.js +8 -0
- package/dist/{index-twn9bfm2.js.map → index-f6r3h2yh.js.map} +1 -1
- package/dist/index-gezqawvw.js +11 -0
- package/dist/{index-fcsg95m5.js.map → index-gezqawvw.js.map} +1 -1
- package/dist/index-h787rq0h.js +12 -0
- package/dist/{index-wc4entme.js.map → index-h787rq0h.js.map} +3 -3
- package/dist/index-hd5nkwd7.js +74 -0
- package/dist/index-hd5nkwd7.js.map +13 -0
- package/dist/index-k6wq0j4q.js +6 -0
- package/dist/{index-gq1npngp.js.map → index-k6wq0j4q.js.map} +1 -1
- package/dist/index-kz01jz58.js +6 -0
- package/dist/{index-323jvr1g.js.map → index-kz01jz58.js.map} +1 -1
- package/dist/{index-kjqksgch.js → index-mgef1n4e.js} +10 -10
- package/dist/{index-kjqksgch.js.map → index-mgef1n4e.js.map} +1 -1
- package/dist/{index-haypwvzd.js → index-n197qdw1.js} +188 -188
- package/dist/{index-haypwvzd.js.map → index-n197qdw1.js.map} +3 -3
- package/dist/index-nndwx2wp.js +153 -0
- package/dist/{index-z157at3s.js.map → index-nndwx2wp.js.map} +2 -2
- package/dist/index-pz92ksp8.js +5 -0
- package/dist/{index-3c5jt6by.js.map → index-pz92ksp8.js.map} +1 -1
- package/dist/index-qj4adnfe.js +14 -0
- package/dist/{index-eqqd4k4f.js.map → index-qj4adnfe.js.map} +2 -2
- package/dist/index-r83jpct7.js +6 -0
- package/dist/{index-gbkma7ds.js.map → index-r83jpct7.js.map} +2 -2
- package/dist/{index-2zjh5zd5.js → index-rqfwd7j5.js} +4 -4
- package/dist/{index-2zjh5zd5.js.map → index-rqfwd7j5.js.map} +1 -1
- package/dist/index-s0f0s6n5.js +6 -0
- package/dist/{index-p1zy871m.js.map → index-s0f0s6n5.js.map} +1 -1
- package/dist/index-s0t15ndj.js +6 -0
- package/dist/{index-8edck2pr.js.map → index-s0t15ndj.js.map} +1 -1
- package/dist/index-tc054tcb.js +6 -0
- package/dist/{index-8tmv33mr.js.map → index-tc054tcb.js.map} +1 -1
- package/dist/{index-095hrkyr.js → index-ts8a1sdn.js} +6 -6
- package/dist/{index-095hrkyr.js.map → index-ts8a1sdn.js.map} +1 -1
- package/dist/index-tv52jhac.js +1252 -0
- package/dist/{index-qg9bn980.js.map → index-tv52jhac.js.map} +15 -14
- package/dist/index-x9nn57kk.js +6 -0
- package/dist/{index-1x8mzvz7.js.map → index-x9nn57kk.js.map} +1 -1
- package/dist/{index-ynsvkqgb.js → index-xyh98x7p.js} +4 -4
- package/dist/{index-ynsvkqgb.js.map → index-xyh98x7p.js.map} +1 -1
- package/dist/{index-ma6p7bt4.js → index-yy4v9kca.js} +4 -4
- package/dist/{index-ma6p7bt4.js.map → index-yy4v9kca.js.map} +1 -1
- package/dist/{index-bqdkm3de.js → index-yz0fcxky.js} +4 -4
- package/dist/{index-bqdkm3de.js.map → index-yz0fcxky.js.map} +1 -1
- package/dist/{index-p6ya59m6.js → index-z4adxmzm.js} +5 -5
- package/dist/{index-p6ya59m6.js.map → index-z4adxmzm.js.map} +1 -1
- package/dist/{index-4fj1k64j.js → index-zzpgsbn3.js} +4 -4
- package/dist/{index-4fj1k64j.js.map → index-zzpgsbn3.js.map} +1 -1
- package/dist/index.js +343 -343
- package/dist/index.js.map +7 -7
- package/dist/lib/source.d.ts +8 -0
- package/dist/lib/source.d.ts.map +1 -1
- package/dist/lib/types.d.ts +8 -2
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/transcript.d.ts.map +1 -1
- package/dist/web-7mdrcb8a.js +14 -0
- package/dist/{web-zph4h3p9.js.map → web-7mdrcb8a.js.map} +1 -1
- package/dist/wire.d.ts +19 -0
- package/dist/wire.js +5 -5
- package/dist/wire.js.map +4 -4
- package/dist/wrapper-4hdmdwft.js +5 -0
- package/dist/{wrapper-f662ny3r.js.map → wrapper-4hdmdwft.js.map} +1 -1
- package/package.json +1 -1
- package/dist/APEv2Parser-etzjd528.js +0 -5
- package/dist/App-4w3qkcs4.js +0 -11
- package/dist/AsfParser-wd98k2h4.js +0 -5
- package/dist/ConfigEditor-vk7vxaa6.js +0 -6
- package/dist/DsdiffParser-cbfaj500.js +0 -5
- package/dist/FlacParser-7t7da7qy.js +0 -5
- package/dist/MP4Parser-gc94h1n9.js +0 -5
- package/dist/MusepackParser-8mq2eabg.js +0 -5
- package/dist/OggParser-7dnc6apg.js +0 -5
- package/dist/Picker-j7txnm7w.js +0 -5
- package/dist/SessionPicker-hpv2ncsb.js +0 -5
- package/dist/SkillBrowser-qc542n71.js +0 -5
- package/dist/WavPackParser-kt7cds9c.js +0 -5
- package/dist/WaveParser-g47ja0vy.js +0 -5
- package/dist/WizardApp-q4p979d1.js +0 -5
- package/dist/channels-4t89qpdt.js +0 -31
- package/dist/config-35r6n1gh.js +0 -24
- package/dist/credential-dpdgg4j6.js +0 -19
- package/dist/index-0444sh6x.js +0 -6
- package/dist/index-1x8mzvz7.js +0 -6
- package/dist/index-2bsardvh.js +0 -5
- package/dist/index-323jvr1g.js +0 -6
- package/dist/index-3826kf9t.js +0 -7
- package/dist/index-38gs9anh.js +0 -9
- package/dist/index-3c5jt6by.js +0 -5
- package/dist/index-42e29zs4.js +0 -6
- package/dist/index-664xcamy.js +0 -110
- package/dist/index-664xcamy.js.map +0 -13
- package/dist/index-7mn8ack9.js +0 -6
- package/dist/index-8edck2pr.js +0 -6
- package/dist/index-8h6kewy1.js +0 -9
- package/dist/index-8tmv33mr.js +0 -6
- package/dist/index-9914wh1d.js +0 -6
- package/dist/index-9914wh1d.js.map +0 -10
- package/dist/index-dzy19wtf.js +0 -6
- package/dist/index-eqqd4k4f.js +0 -14
- package/dist/index-ew997be5.js +0 -10
- package/dist/index-fa9wvpyw.js +0 -6
- package/dist/index-fcsg95m5.js +0 -11
- package/dist/index-gbkma7ds.js +0 -6
- package/dist/index-gq1npngp.js +0 -6
- package/dist/index-jc4kmfwa.js +0 -6
- package/dist/index-nvc24414.js +0 -6
- package/dist/index-nxhqf597.js +0 -6
- package/dist/index-p1zy871m.js +0 -6
- package/dist/index-qg9bn980.js +0 -1213
- package/dist/index-qgsdgbk8.js +0 -5
- package/dist/index-r4ax3x4d.js +0 -74
- package/dist/index-r4ax3x4d.js.map +0 -13
- package/dist/index-twn9bfm2.js +0 -8
- package/dist/index-wc4entme.js +0 -12
- package/dist/index-ytxbw8py.js +0 -63
- package/dist/index-z157at3s.js +0 -153
- package/dist/index-zce9gy22.js +0 -126
- package/dist/web-zph4h3p9.js +0 -14
- package/dist/wrapper-f662ny3r.js +0 -5
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{Rt,So,mn,v}from"./index-tv52jhac.js";import{existsSync as E,readFileSync as h}from"node:fs";import{dirname as l,join as o,resolve as u}from"node:path";function Ft(n){let e=o(l(n),".env"),r={};if(E(e))try{r=Rt(h(e,"utf8"))}catch{}return So(r,v([n]))}function rn(n,e){let r=n[e];return r!==void 0&&r!==""}function f(n,e,r={}){let i=l(n),t=u(r.cwd??process.cwd()),d=r.readDir??mn,g=r.env??process.env,m=v([n],r),p=d(i),y=d(t),a=m[e];if(a!==void 0&&a!==""){let b=u(i)===t,c=y[e];if(!b&&c!==void 0&&g[e]===c)return{kind:"ambiguous",path:o(t,".env")};return{kind:"export"}}let s=p[e];if(s!==void 0&&s!=="")return{kind:"agent",path:o(i,".env")};return{kind:"unset"}}function Xi(n){switch(n.kind){case"export":return"from the environment, not a .env file";case"ambiguous":return"from the environment or ./.env — indistinguishable";case"agent":return;case"unset":return"not set"}}function es(n){let e=[],r=x(n.rawModelId);if(r!==void 0)e.push({field:"model.main.id",variable:r,origin:f(n.manifestPath,r,n.options??{})});if(n.apiKeyEnv!==void 0)e.push({field:"model.main.apiKeyEnv",variable:n.apiKeyEnv,origin:f(n.manifestPath,n.apiKeyEnv,n.options??{})});return e}function x(n){if(n===void 0)return;return/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/.exec(n.trim())?.[1]}
|
|
3
|
+
export{Ft,rn,Xi,es};
|
|
4
|
+
|
|
5
|
+
//# debugId=121B5FE5854A21D464756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-k6wq0j4q.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * Whether a variable an agent depends on is actually set, from that agent's point of view.\n *\n * `ambientEnv` is **not** this. It layers the *cwd*'s `.env` against an agent's — demoting a colliding\n * variable so a project checkout cannot silently change which model a sandbox agent runs on — and it\n * returns `process.env` unchanged whenever nothing is in tension. It never *adds* the agent's own file.\n *\n * The agent's `.env` is merged by `loadManifest`, through core's `layeredEnv`, and that is the answer a\n * question about this agent needs. Reading `process.env` alone reported a variable as unset while the\n * file beside the manifest plainly had it — the same class of mistake `serve` made once, reporting\n * \"unauthenticated\" for a token sitting next to the manifest. It showed up here as an editor row that\n * still read `(not set)` immediately after somebody set it, which is the \"did that work?\" failure this\n * whole surface exists to remove.\n *\n * Precedence is core's, unchanged: the real environment wins, because an operator's export has to beat\n * a file for a container to be able to configure the agent it runs.\n */\n\nimport { existsSync, readFileSync } from \"node:fs\"\nimport { dirname, join, resolve } from \"node:path\"\nimport { type EnvSource, layeredEnv, parseDotEnv } from \"@dispach/core\"\nimport { type AmbientOptions, ambientEnv, readDotEnv } from \"#lib/ambient\"\n\n/** The environment this agent will actually see: its own `.env` under the ambient one. */\nexport function agentEnv(manifestPath: string): EnvSource {\n const path = join(dirname(manifestPath), \".env\")\n let beside: Record<string, string> = {}\n if (existsSync(path)) {\n try {\n beside = parseDotEnv(readFileSync(path, \"utf8\"))\n } catch {\n // An unreadable `.env` is reported by the loader, in the words the loader uses. Here it\n // simply means nothing is known to be set, which is the safe reading for a \"is it set?\"\n // question — claiming a variable is present when the file cannot be read would be worse.\n }\n }\n return layeredEnv(beside, ambientEnv([manifestPath]))\n}\n\n/** Whether `name` has a non-empty value. Empty counts as unset: it fails a load exactly as absent does. */\nexport function isSet(env: EnvSource, name: string): boolean {\n const value = env[name]\n return value !== undefined && value !== \"\"\n}\n\n/**\n * Where a value came from, which is a different question from whether it is set.\n *\n * Three layers can supply one variable and the winner is not obvious from any of them:\n *\n * 1. the real environment — an operator's export, or a container's `environment:` block\n * 2. the `.env` beside the agent's manifest\n * 3. a `.env` in the directory the command was run from, demoted beneath (2) by `ambientEnv`\n *\n * Every one of those is correct on its own, and the composition is unreadable. It produced a real\n * confusion in a container: `docker compose` passes `MODEL_ID` and friends as process environment,\n * so an agent scaffolded inside that container silently ran on the *mounted*\n * agent's model, and the `0600` `.env` that `init` had just written was ignored for exactly those\n * keys — with nothing anywhere saying so.\n *\n * The precedence is not the bug and is not changed here. What was missing is a sentence, and the\n * recorded lesson from the last time this surfaced is that *a warning explained the surprise and\n * did not remove it* — so this reports rather than intervenes.\n */\nexport type EnvOrigin =\n /** The real environment won: an export, or a container's own configuration. */\n | { readonly kind: \"export\" }\n /** The `.env` beside the manifest won. */\n | { readonly kind: \"agent\"; readonly path: string }\n /**\n * Either an export or the cwd's `.env`, and **they cannot be told apart**.\n *\n * Bun auto-loads a `.env` from the current directory into `process.env` before any of this code\n * runs, so once the two agree on a string there is no evidence left distinguishing them. Said\n * rather than guessed: naming one would be a coin toss printed as a fact.\n */\n | { readonly kind: \"ambiguous\"; readonly path: string }\n | { readonly kind: \"unset\" }\n\n/**\n * Which layer supplies `name` for this agent.\n *\n * Mirrors `ambientEnv`'s precedence by *calling* it rather than by restating it — the demotion rule\n * is subtle (a cwd variable is demoted only when the agent's own file also sets it *and* the values\n * match), and a second implementation of that would drift on the first edit.\n */\nexport function sourceOf(\n manifestPath: string,\n name: string,\n options: AmbientOptions = {},\n): EnvOrigin {\n const agentDir = dirname(manifestPath)\n const cwd = resolve(options.cwd ?? process.cwd())\n const read = options.readDir ?? readDotEnv\n const raw = options.env ?? process.env\n\n const ambient = ambientEnv([manifestPath], options)\n const beside = read(agentDir)\n const inCwd = read(cwd)\n\n const fromAmbient = ambient[name]\n if (fromAmbient !== undefined && fromAmbient !== \"\") {\n // The cwd file is only a candidate when it is a *different* directory from the agent's: when\n // they are the same directory, that file **is** the agent's own and `ambientEnv` says so.\n const sameDir = resolve(agentDir) === cwd\n const cwdValue = inCwd[name]\n if (!sameDir && cwdValue !== undefined && raw[name] === cwdValue) {\n return { kind: \"ambiguous\", path: join(cwd, \".env\") }\n }\n return { kind: \"export\" }\n }\n\n const fromFile = beside[name]\n if (fromFile !== undefined && fromFile !== \"\") {\n return { kind: \"agent\", path: join(agentDir, \".env\") }\n }\n\n return { kind: \"unset\" }\n}\n\n/**\n * The phrase for a status line — short, because it rides after a value somebody is already reading.\n *\n * Returns `undefined` for the ordinary case, which is the whole point: a line that always carries a\n * provenance note is a line nobody reads it on. The agent's own `.env` winning is what an author\n * expects, so only the surprising sources say anything.\n */\nexport function describeOrigin(origin: EnvOrigin): string | undefined {\n switch (origin.kind) {\n case \"export\":\n return \"from the environment, not a .env file\"\n case \"ambiguous\":\n return \"from the environment or ./.env — indistinguishable\"\n case \"agent\":\n return undefined\n case \"unset\":\n return \"not set\"\n }\n}\n\n/** One env-backed field, the variable behind it, and where the value came from. */\nexport interface Provenance {\n readonly field: string\n readonly variable: string\n readonly origin: EnvOrigin\n}\n\n/**\n * The env-backed fields worth saying something about, and only when there is something to say.\n *\n * Two fields, chosen because they are the two that produced a real confusion in a container:\n * `docker compose` passes `MODEL_ID` and `MODEL_API_KEY` as process environment, and the ambient\n * environment deliberately beats the agent's own file so an operator can configure the agent their\n * container runs. So an agent scaffolded in that container ran on the *mounted*\n * agent's model and ignored the `0600` `.env` init had just written.\n *\n * The model id is included **only when the manifest writes it as a variable**. A generated manifest\n * carries it literally (which is why `readManifestHeader` can list agents without credentials), and\n * a literal has no provenance to report — printing \"from the environment\" about a value nothing read\n * from the environment would be worse than silence. `apiKeyEnv` is always a variable name by hard\n * rule 10, so it is always askable.\n */\nexport function envProvenance(input: {\n readonly manifestPath: string\n /** The raw, unexpanded `model.main.id` — `readManifestHeader().modelId`. */\n readonly rawModelId: string | undefined\n readonly apiKeyEnv: string | undefined\n readonly options?: AmbientOptions\n}): readonly Provenance[] {\n const rows: Provenance[] = []\n const variable = soleVariable(input.rawModelId)\n if (variable !== undefined) {\n rows.push({\n field: \"model.main.id\",\n variable,\n origin: sourceOf(input.manifestPath, variable, input.options ?? {}),\n })\n }\n if (input.apiKeyEnv !== undefined) {\n rows.push({\n field: \"model.main.apiKeyEnv\",\n variable: input.apiKeyEnv,\n origin: sourceOf(input.manifestPath, input.apiKeyEnv, input.options ?? {}),\n })\n }\n return rows\n}\n\n/**\n * The variable name when a value is exactly one `${VAR}` reference, and nothing otherwise.\n *\n * Deliberately narrow. `prefix-${VAR}` expands from the environment too, but its provenance is a\n * sentence about part of a string, and a half-true note on a compound value is the kind of detail\n * that gets believed whole.\n */\nfunction soleVariable(raw: string | undefined): string | undefined {\n if (raw === undefined) return undefined\n const match = /^\\$\\{([A-Za-z_][A-Za-z0-9_]*)\\}$/.exec(raw.trim())\n return match?.[1]\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";4CAkBA,qBAAS,kBAAY,gBACrB,kBAAS,UAAS,aAAM,kBAKjB,SAAS,EAAQ,CAAC,EAAiC,CACtD,IAAM,EAAO,EAAK,EAAQ,CAAY,EAAG,MAAM,EAC3C,EAAiC,CAAC,EACtC,GAAI,EAAW,CAAI,EACf,GAAI,CACA,EAAS,GAAY,EAAa,EAAM,MAAM,CAAC,EACjD,KAAM,EAMZ,OAAO,GAAW,EAAQ,EAAW,CAAC,CAAY,CAAC,CAAC,EAIjD,SAAS,EAAK,CAAC,EAAgB,EAAuB,CACzD,IAAM,EAAQ,EAAI,GAClB,OAAO,IAAU,QAAa,IAAU,GA4CrC,SAAS,CAAQ,CACpB,EACA,EACA,EAA0B,CAAC,EAClB,CACT,IAAM,EAAW,EAAQ,CAAY,EAC/B,EAAM,EAAQ,EAAQ,KAAO,QAAQ,IAAI,CAAC,EAC1C,EAAO,EAAQ,SAAW,GAC1B,EAAM,EAAQ,KAAO,QAAQ,IAE7B,EAAU,EAAW,CAAC,CAAY,EAAG,CAAO,EAC5C,EAAS,EAAK,CAAQ,EACtB,EAAQ,EAAK,CAAG,EAEhB,EAAc,EAAQ,GAC5B,GAAI,IAAgB,QAAa,IAAgB,GAAI,CAGjD,IAAM,EAAU,EAAQ,CAAQ,IAAM,EAChC,EAAW,EAAM,GACvB,GAAI,CAAC,GAAW,IAAa,QAAa,EAAI,KAAU,EACpD,MAAO,CAAE,KAAM,YAAa,KAAM,EAAK,EAAK,MAAM,CAAE,EAExD,MAAO,CAAE,KAAM,QAAS,EAG5B,IAAM,EAAW,EAAO,GACxB,GAAI,IAAa,QAAa,IAAa,GACvC,MAAO,CAAE,KAAM,QAAS,KAAM,EAAK,EAAU,MAAM,CAAE,EAGzD,MAAO,CAAE,KAAM,OAAQ,EAUpB,SAAS,EAAc,CAAC,EAAuC,CAClE,OAAQ,EAAO,MACX,IAAK,SACD,MAAO,wCACX,IAAK,YACD,MAAO,qDACX,IAAK,QACD,OACJ,IAAK,QACD,MAAO,WA0BZ,SAAS,EAAa,CAAC,EAMJ,CACtB,IAAM,EAAqB,CAAC,EACtB,EAAW,EAAa,EAAM,UAAU,EAC9C,GAAI,IAAa,OACb,EAAK,KAAK,CACN,MAAO,gBACP,WACA,OAAQ,EAAS,EAAM,aAAc,EAAU,EAAM,SAAW,CAAC,CAAC,CACtE,CAAC,EAEL,GAAI,EAAM,YAAc,OACpB,EAAK,KAAK,CACN,MAAO,uBACP,SAAU,EAAM,UAChB,OAAQ,EAAS,EAAM,aAAc,EAAM,UAAW,EAAM,SAAW,CAAC,CAAC,CAC7E,CAAC,EAEL,OAAO,EAUX,SAAS,CAAY,CAAC,EAA6C,CAC/D,GAAI,IAAQ,OAAW,OAEvB,MADc,mCAAmC,KAAK,EAAI,KAAK,CAAC,IACjD",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "121B5FE5854A21D464756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire as t}from"node:module";var l=Object.create;var{getPrototypeOf:m,defineProperty:g,getOwnPropertyNames:n}=Object;var k=Object.prototype.hasOwnProperty;function o(a){return this[a]}var p,q,u=(a,b,c)=>{var h=a!=null&&typeof a==="object";if(h){var i=b?p??=new WeakMap:q??=new WeakMap,j=i.get(a);if(j)return j}c=a!=null?l(m(a)):{};let d=b||!a||!a.__esModule||!k.call(a,"default")?g(c,"default",{value:a,enumerable:!0}):c;if(a&&typeof a==="object"||typeof a==="function"){for(let f of n(a))if(!k.call(d,f))g(d,f,{get:o.bind(a,f),enumerable:!0})}if(h)i.set(a,d);return d};var e=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var r=(a)=>a;function s(a,b){this[a]=r.bind(null,b)}var Li=(a,b)=>{for(var c in b)g(a,c,{get:b[c],enumerable:!0,configurable:!0,set:s.bind(b,c)})};var I=t(import.meta.url);
|
|
3
|
+
export{u,e,Li,I};
|
|
4
|
+
|
|
5
|
+
//# debugId=A67D1B029BB8AFC064756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-kz01jz58.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
2
|
+
import{A,fo,tA}from"./index-tv52jhac.js";var Sr=`---
|
|
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:
|
|
@@ -47,7 +47,7 @@ Replace everything below with the steps.
|
|
|
47
47
|
reason generalises to the case you did not think of.
|
|
48
48
|
3. Say what to report at the end, and what not to do. A procedure that does not say where it stops
|
|
49
49
|
gets carried into the next turn.
|
|
50
|
-
`;var
|
|
50
|
+
`;var I={"AGENTS.md":`---
|
|
51
51
|
tier: static
|
|
52
52
|
editable: none
|
|
53
53
|
budget: 800
|
|
@@ -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 lo(e,n){return e.replace(/\{\{\s*([A-Za-z0-9_]+)\s*\}\}/g,(o,r)=>{let a=n[r];return a===void 0?o:a})}var ze=[{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 Vt(e){return ze.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 S(e){let n=e.replace(/\s+/g," ").trim();return n.length<=200?n:`${n.slice(0,199)}…`}var b=[{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 b.find((n)=>n.value===e)}var u=[{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 u.find((n)=>n.value===e)}function FA(e,n,o){if(n===void 0)return;if(e==="sandbox")return`${o.agentDirBase}/${at(n)}`;if(e==="here")return`./${at(n)}`;return}var c=[{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 c.find((n)=>n.value===e)}var d=[{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 d.find((n)=>n.value===e)}var En="COMPOSIO_API_KEY",m=[{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 m.find((n)=>n.value===e)}var uo="TELEGRAM_BOT_TOKEN",p=[{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 p.find((n)=>n.value===e)}var g=[{value:"none",label:"No"},{value:"connected",label:"Yes — unofficial, and it can get a number banned. Use a spare one."}];function M(e){return g.find((n)=>n.value===e)}var w=[{value:"none",label:"No"},{value:"local",label:"Yes — HTTP, SSE and WebSocket on 127.0.0.1:7420"}];function K(e){return w.find((n)=>n.value===e)}var f=[{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 f.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 l=[{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 E(e){return l.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"],Cn=new Set(["apiKey","webKey","composioKey","telegramToken"]);function at(e){let n=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return n===""?"agent":n}function aA(e,n){let o=e.preset===void 0?void 0:Vt(e.preset);for(let r of Sr){if(e[r]!==void 0)continue;if(r==="apiKey"&&o!==void 0&&o.apiKeyEnv===void 0)continue;if(r==="baseUrl"&&o?.api==="bedrock-converse")continue;if(r==="region"&&o?.api!=="bedrock-converse")continue;if((r==="webBackend"||r==="webKey")&&e.web!=="search")continue;if(r==="dir"&&e.dirChoice!=="custom")continue;if(r==="dirChoice"&&e.dir!==void 0)continue;if(r==="composioKey"&&e.composio!=="connected")continue;if((r==="telegramToken"||r==="telegramAllow")&&e.telegram!=="connected")continue;if(r==="whatsappNumber"&&e.whatsapp!=="connected")continue;switch(r){case"user":return{step:r,prompt:"Your name",fallback:""};case"name":return{step:r,prompt:"The agent's name",fallback:""};case"purpose":return{step:r,prompt:"What is it for, in one line",fallback:"helping with whatever comes up"};case"preset":return{step:r,prompt:"Model endpoint",fallback:"1",options:ze.map((a)=>({value:a.id,label:a.label}))};case"model":return{step:r,prompt:"Model id",fallback:o?.modelId??""};case"baseUrl":return{step:r,prompt:"Base URL",fallback:o?.baseUrl??""};case"region":return{step:r,prompt:"AWS region",fallback:o?.region??"us-east-1"};case"apiKey":return{step:r,prompt:"Model API key",fallback:"",optional:!0};case"system":return{step:r,prompt:"Can it act on this computer?",fallback:"1",options:l.map((a)=>({value:a.value,label:a.label}))};case"web":return{step:r,prompt:"Can it reach the internet?",fallback:"1",options:c.map((a)=>({value:a.value,label:a.label}))};case"webBackend":return{step:r,prompt:"Search backend",fallback:"1",options:d.map((a)=>({value:a.value,label:a.label}))};case"webKey":return{step:r,prompt:`${Io(e.webBackend??"tavily")?.label.split(" —")[0]??"Search"} API key`,fallback:"",optional:!0};case"composio":return{step:r,prompt:"Can it use your other apps?",fallback:"1",options:m.map((a)=>({value:a.value,label:a.label}))};case"composioKey":return{step:r,prompt:"Composio API key",fallback:"",optional:!0};case"telegram":return{step:r,prompt:"Can people message it on Telegram?",fallback:"1",options:p.map((a)=>({value:a.value,label:a.label}))};case"telegramAllow":return{step:r,prompt:"Your Telegram handle — who may message it",fallback:"",optional:!0};case"telegramToken":return{step:r,prompt:"Telegram bot token (from @BotFather)",fallback:"",optional:!0};case"whatsapp":return{step:r,prompt:"Can people message it on WhatsApp?",fallback:"1",options:g.map((a)=>({value:a.value,label:a.label}))};case"whatsappNumber":return{step:r,prompt:"Your WhatsApp number in digits, no + — the account it links to",fallback:"",optional:!0};case"skills":return{step:r,prompt:"Give it a skills directory? A skill is a procedure it follows when the turn calls for one.",fallback:"starter",options:UA.map((a)=>({value:a.value,label:a.label}))};case"daemon":return{step:r,prompt:"Keep it running in the background?",fallback:"service",options:f.map((a)=>({value:a.value,label:a.label}))};case"dirChoice":return{step:r,prompt:"Where should it live?",fallback:"1",options:u.map((a)=>({value:a.value,label:FA(a.value,e.name,n)??a.label,hint:a.hint}))};case"dir":return{step:r,prompt:"Path to create it at",fallback:""}}}return}function oi(e){let n=e.trim();if(/\s/.test(n))return{ok:!1,reason:"is one handle, with no spaces — for example @moeen."};let o=n.startsWith("@")?n.slice(1):n;if(!/^[A-Za-z0-9_]{5,32}$/.test(o))return{ok:!1,reason:/-/.test(o)?"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:`@${o}`}}var H=/^[A-Z_][A-Z0-9_]*$/;function Wt(e,n){let o=n.trim();switch(e){case"user":case"name":case"model":case"purpose":return o===""?{ok:!1,reason:"cannot be empty."}:{ok:!0,value:o};case"preset":{let a=ze[Number(o)-1]??Vt(o.toLowerCase());return a===void 0?{ok:!1,reason:`pick 1-${ze.length}, or a name: ${ze.map((s)=>s.id).join(", ")}.`}:{ok:!0,value:a.id}}case"web":{let a=c[Number(o)-1]??N(o.toLowerCase());return a===void 0?{ok:!1,reason:`pick 1-${c.length}, or a name: ${c.map((s)=>s.value).join(", ")}.`}:{ok:!0,value:a.value}}case"webBackend":{let a=d[Number(o)-1]??Io(o.toLowerCase());return a===void 0?{ok:!1,reason:`pick 1-${d.length}, or a name: ${d.map((s)=>s.value).join(", ")}.`}:{ok:!0,value:a.value}}case"webKey":case"composioKey":case"telegramToken":return{ok:!0,value:o};case"telegramAllow":{let r=o.trim();if(r==="")return{ok:!0,value:""};return oi(r)}case"telegram":{let a=p[Number(o)-1]??P(o.toLowerCase());return a===void 0?{ok:!1,reason:`pick 1-${p.length}, or a name: ${p.map((s)=>s.value).join(", ")}.`}:{ok:!0,value:a.value}}case"whatsapp":{let a=g[Number(o)-1]??M(o.toLowerCase());return a===void 0?{ok:!1,reason:`pick 1-${g.length}, or a name: ${g.map((s)=>s.value).join(", ")}.`}:{ok:!0,value:a.value}}case"whatsappNumber":{let r=o.trim();if(r==="")return{ok:!0,value:""};let a=r.replace(/[^0-9]/g,"");if(!/^[0-9]{6,20}$/.test(a))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:a}}case"server":{let a=w[Number(o)-1]??K(o.toLowerCase());return a===void 0?{ok:!1,reason:`pick 1-${w.length}, or a name: ${w.map((s)=>s.value).join(", ")}.`}:{ok:!0,value:a.value}}case"schedules":{let a=b[Number(o)-1]??C(o.toLowerCase());return a===void 0?{ok:!1,reason:`pick 1-${b.length}, or a name: ${b.map((s)=>s.value).join(", ")}.`}:{ok:!0,value:a.value}}case"skillsPick":return{ok:!0,value:o.trim()};case"skillsSearch":return{ok:!0,value:o.trim()};case"skills":{let a=UA[Number(o)-1]??Y(o.toLowerCase());return a===void 0?{ok:!1,reason:`pick 1-${UA.length}, or a name: ${UA.map((s)=>s.value).join(", ")}.`}:{ok:!0,value:a.value}}case"daemon":{let a=f[Number(o)-1]??W(o.toLowerCase());return a===void 0?{ok:!1,reason:`pick 1-${f.length}, or a name: ${f.map((s)=>s.value).join(", ")}.`}:{ok:!0,value:a.value}}case"composio":{let a=m[Number(o)-1]??x(o.toLowerCase());return a===void 0?{ok:!1,reason:`pick 1-${m.length}, or a name: ${m.map((s)=>s.value).join(", ")}.`}:{ok:!0,value:a.value}}case"region":return/^[a-z]{2}(-[a-z]+)+-\d$/.test(o)?{ok:!0,value:o}:{ok:!1,reason:"is not an AWS region name, such as eu-west-1 or us-east-1."};case"baseUrl":{let r;try{r=new URL(o)}catch{return{ok:!1,reason:"must be an absolute URL, e.g. https://api.example.com/v1."}}if(r.protocol!=="http:"&&r.protocol!=="https:")return{ok:!1,reason:"only http and https are supported."};if(r.pathname.endsWith("/chat/completions"))return{ok:!1,reason:"must end at the version segment — the runtime appends /chat/completions itself."};return{ok:!0,value:o}}case"apiKeyEnv":return H.test(o)?{ok:!0,value:o}:{ok:!1,reason:"must be an env var name, like MODEL_API_KEY."};case"apiKey":return{ok:!0,value:o};case"serverToken":return{ok:!0,value:o};case"system":{let a=l[Number(o)-1]??E(o.toLowerCase());return a===void 0?{ok:!1,reason:`pick 1-${l.length}, or a name: ${l.map((s)=>s.value).join(", ")}.`}:{ok:!0,value:a.value}}case"dirChoice":{let a=u[Number(o)-1]??U(o.toLowerCase());return a===void 0?{ok:!1,reason:`pick 1-${u.length}, or a name: ${u.map((s)=>s.value).join(", ")}.`}:{ok:!0,value:a.value}}case"dir":return o===""?{ok:!1,reason:"cannot be empty."}:{ok:!0,value:o}}}function B(e){let n=e.system,o=E(n)??l[0],r=o?.pinned.includes("exec")===!0,a=o?.pinned.includes("file_read")===!0,s=o?.pinned.includes("file_write")===!0,v=o===void 0||o.pinned.length===0?[" # Nothing is enabled. Add tools here and permit them in the policy block below."]:!a?[" # 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"]:r?[" # 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."]:s?[" # 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=o?.pinned??[],y=N(e.web)?.pinned??[],k=I(e);return[" # ── providers: where tools come from ──",...v," #"," # 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: {}",...r?[" # system: { writeRoots: [~/code/my-project] } # absolute, or relative to this file"]:[],"",...y.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: {}"]:k===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: ${k.value}`,` apiKeyEnv: ${k.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((h)=>` - ${h}`),...y.map((h)=>` - ${h}`),...y.includes("web_search")?[]:[" # - web_search"],...y.includes("web_fetch")?[]:[" # - web_fetch"],...R(e).map((h)=>` - ${h}`),...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",` # \`${t.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=E(e.system)??l[0],o=n?.pinned.includes("exec")===!0,r=[...n?.allow??[],...R(e).filter(F)],a=[" # ── 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(r.length===0)return[...a," allow: []"," deny: []"," onNoApprover: deny"];return[...a," # 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:",...r.map((s)=>` - "${s}"`),...o?[" 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 o=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((r)=>({relPath:`workspace/${r}`,contents:lo(T[r],o)})),...e.skills==="starter"?[{relPath:"skills/starter/SKILL.md",contents:lo(mr,o)}]:[{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 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
|
|
417
417
|
.whatsapp/
|
|
418
418
|
`:`.env
|
|
419
|
-
`}]}function q(e){let{user:n,name:
|
|
420
|
-
What they brought me in for: ${r}.`,REMINDER_RULE:a}}var i=(e)=>`# ── ${e} ${"─".repeat(Math.max(1,88-e.length))}`;function A(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 \`${t.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: ${at(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[i("channels"),"# The channel connects AFTER the runtime is ready and never blocks it. Only",`# \`${t.slug} serve\` starts it; \`${t.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:",...A(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[i("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[i("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 \`${t.slug} serve\` starts it;`,`# \`${t.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/${at(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}"]`],...A(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[i("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. \`${t.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: ${t.envPrefix}API_TOKEN`,""]}function Z(e){let n=[i("schedules"),`# Only \`${t.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 o=at(e.name),r=[`# ${e.name} — generated by \`${t.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: ${t.apiVersion}`,`id: ${o}`,`name: ${e.name}`,...S(e.purpose)===""?[]:[`description: ${JSON.stringify(S(e.purpose))}`],"",i("model"),"model:"," main:",` id: ${e.model}`];if(e.region!==void 0)r.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 r.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)r.push(" # The *name* of an env var, never a value — a literal key fails validation.",` apiKeyEnv: ${e.apiKeyEnv}`);return r.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 }","",i("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","",i("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((a)=>` - ${a.slug.padEnd(14)}# ${a.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","",i("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),i("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",`# ~/${t.stateDir}/plugins/<name>/ where \`${t.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",`# \`${t.slug} plugins list\`, enforced by nothing. Install plugins you trust.`,"# plugins:",`# - "${t.packageScope}/channel-telegram"`,""),r.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
|
|
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(`
|
|
422
422
|
`)}
|
|
423
|
-
`}function
|
|
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(`
|
|
424
424
|
`)}
|
|
425
425
|
`}
|
|
426
|
-
export{
|
|
426
|
+
export{Sr,Io,$e,zt,UA,uo,pn,Eo,xA,wr,Cn,lt,gA,ri,Zt,HA,Dr};
|
|
427
427
|
|
|
428
|
-
//# debugId=
|
|
429
|
-
//# sourceMappingURL=index-
|
|
428
|
+
//# debugId=2427A2BC1A960D6064756E2164756E21
|
|
429
|
+
//# sourceMappingURL=index-mgef1n4e.js.map
|