dispach 0.1.0 → 0.1.2
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 +131 -31
- package/dist/App-b1yrwrcq.js +11 -0
- package/dist/{App-dxqm39zx.js.map → App-b1yrwrcq.js.map} +1 -1
- package/dist/{ConfigEditor-7v5nebvy.js → ConfigEditor-n8hdw6r7.js} +4 -4
- package/dist/{ConfigEditor-7v5nebvy.js.map → ConfigEditor-n8hdw6r7.js.map} +1 -1
- package/dist/{KeyProbe-vjhmdpx6.js → KeyProbe-9jjeze5r.js} +3 -3
- package/dist/{KeyProbe-vjhmdpx6.js.map → KeyProbe-9jjeze5r.js.map} +1 -1
- package/dist/{Picker-jxaesaxy.js → Picker-hfeh1g6m.js} +3 -3
- package/dist/{Picker-jxaesaxy.js.map → Picker-hfeh1g6m.js.map} +1 -1
- package/dist/{SessionPicker-z2t0p4b5.js → SessionPicker-zyqkg4dn.js} +3 -3
- package/dist/{SessionPicker-z2t0p4b5.js.map → SessionPicker-zyqkg4dn.js.map} +1 -1
- package/dist/{SkillBrowser-yyf2gy0q.js → SkillBrowser-3qdp8080.js} +3 -3
- package/dist/{SkillBrowser-yyf2gy0q.js.map → SkillBrowser-3qdp8080.js.map} +1 -1
- package/dist/WizardApp-vzpbydy3.js +5 -0
- package/dist/{WizardApp-12ndxgqv.js.map → WizardApp-vzpbydy3.js.map} +1 -1
- package/dist/client.js +10 -10
- package/dist/client.js.map +5 -5
- package/dist/{config-yz0nz51b.js → config-g7za9x13.js} +13 -13
- package/dist/{config-yz0nz51b.js.map → config-g7za9x13.js.map} +1 -1
- package/dist/credential-npr6z8c8.js +19 -0
- package/dist/{credential-wgt4gvcz.js.map → credential-npr6z8c8.js.map} +2 -2
- package/dist/index-02dn6m2j.js +7 -0
- package/dist/{index-h2yds678.js.map → index-02dn6m2j.js.map} +1 -1
- package/dist/index-0d93hyfc.js +6 -0
- package/dist/{index-rqbtm761.js.map → index-0d93hyfc.js.map} +1 -1
- package/dist/index-1c5113t4.js +66 -0
- package/dist/index-1c5113t4.js.map +12 -0
- package/dist/{index-3nwfz9jq.js → index-258d8bzg.js} +10 -10
- package/dist/{index-3nwfz9jq.js.map → index-258d8bzg.js.map} +1 -1
- package/dist/{index-9d011p3q.js → index-3g3ny01d.js} +4 -4
- package/dist/{index-9d011p3q.js.map → index-3g3ny01d.js.map} +1 -1
- package/dist/{index-8bmhd2hj.js → index-4cf6v9nb.js} +4 -4
- package/dist/{index-8bmhd2hj.js.map → index-4cf6v9nb.js.map} +1 -1
- package/dist/{index-bwckzbf8.js → index-4z7axw4r.js} +4 -4
- package/dist/{index-bwckzbf8.js.map → index-4z7axw4r.js.map} +1 -1
- package/dist/{index-xgqzk5cq.js → index-6p999cx4.js} +6 -6
- package/dist/{index-xgqzk5cq.js.map → index-6p999cx4.js.map} +1 -1
- package/dist/index-6q4wf8e3.js +6 -0
- package/dist/{index-jym27m75.js.map → index-6q4wf8e3.js.map} +1 -1
- package/dist/{index-cx3vz7sf.js → index-9r0wyj6w.js} +4 -4
- package/dist/{index-cx3vz7sf.js.map → index-9r0wyj6w.js.map} +1 -1
- package/dist/{index-j97vttdt.js → index-ammv5st7.js} +6 -6
- package/dist/{index-j97vttdt.js.map → index-ammv5st7.js.map} +1 -1
- package/dist/{index-qc2vrq9z.js → index-cqqb6gaq.js} +5 -5
- package/dist/{index-qc2vrq9z.js.map → index-cqqb6gaq.js.map} +1 -1
- package/dist/{index-jk0def33.js → index-d4x6yvqh.js} +4 -4
- package/dist/{index-jk0def33.js.map → index-d4x6yvqh.js.map} +1 -1
- package/dist/index-fecm8xe7.js +77 -0
- package/dist/index-fecm8xe7.js.map +12 -0
- package/dist/{index-e8n70sgj.js → index-fex44816.js} +4 -4
- package/dist/{index-e8n70sgj.js.map → index-fex44816.js.map} +1 -1
- package/dist/{index-gbnc99j8.js → index-ff514z3y.js} +9 -9
- package/dist/{index-gbnc99j8.js.map → index-ff514z3y.js.map} +1 -1
- package/dist/{index-t1xvacym.js → index-gme2egyq.js} +4 -4
- package/dist/{index-t1xvacym.js.map → index-gme2egyq.js.map} +1 -1
- package/dist/{index-mrtb5y08.js → index-gz9x25tz.js} +4 -4
- package/dist/{index-mrtb5y08.js.map → index-gz9x25tz.js.map} +1 -1
- package/dist/{index-9nsfs0vy.js → index-h9mw7b9d.js} +4 -4
- package/dist/{index-9nsfs0vy.js.map → index-h9mw7b9d.js.map} +1 -1
- package/dist/{index-6b7qvh1x.js → index-hwpvhaza.js} +4 -4
- package/dist/{index-6b7qvh1x.js.map → index-hwpvhaza.js.map} +1 -1
- package/dist/{index-6z0yr17z.js → index-j55s3ehk.js} +7 -7
- package/dist/{index-6z0yr17z.js.map → index-j55s3ehk.js.map} +1 -1
- package/dist/{index-mgdgx22q.js → index-j7gyr5nx.js} +6 -6
- package/dist/{index-mgdgx22q.js.map → index-j7gyr5nx.js.map} +1 -1
- package/dist/{index-7da4fqcr.js → index-mtn0g9vc.js} +5 -5
- package/dist/{index-7da4fqcr.js.map → index-mtn0g9vc.js.map} +1 -1
- package/dist/{index-rqzg861g.js → index-qdbq8crg.js} +4 -4
- package/dist/{index-rqzg861g.js.map → index-qdbq8crg.js.map} +1 -1
- package/dist/{index-xqyms08r.js → index-s9mbq7h6.js} +4 -4
- package/dist/{index-xqyms08r.js.map → index-s9mbq7h6.js.map} +1 -1
- package/dist/{index-9f9pp2ef.js → index-tf71ap9v.js} +4 -4
- package/dist/{index-9f9pp2ef.js.map → index-tf71ap9v.js.map} +1 -1
- package/dist/index-ttwyrdjs.js +427 -0
- package/dist/index-ttwyrdjs.js.map +11 -0
- package/dist/{index-2cvtz0fy.js → index-tv4yv7d2.js} +228 -228
- package/dist/{index-2cvtz0fy.js.map → index-tv4yv7d2.js.map} +9 -9
- package/dist/{index-fvhg0xyd.js → index-ty24n0jh.js} +79 -79
- package/dist/{index-fvhg0xyd.js.map → index-ty24n0jh.js.map} +1 -1
- package/dist/index-v8e92nfw.js +6 -0
- package/dist/{index-b8zwg8a3.js.map → index-v8e92nfw.js.map} +1 -1
- package/dist/index-vgc3y3rm.js +6 -0
- package/dist/{index-my5cjx00.js.map → index-vgc3y3rm.js.map} +1 -1
- package/dist/index-whaw4b18.js +6 -0
- package/dist/index-whaw4b18.js.map +10 -0
- package/dist/index.js +202 -198
- package/dist/index.js.map +6 -6
- package/dist/lib/bootstrap.d.ts +13 -0
- package/dist/lib/bootstrap.d.ts.map +1 -1
- package/dist/lib/commands.d.ts.map +1 -1
- package/dist/lib/init-flow.d.ts +17 -4
- package/dist/lib/init-flow.d.ts.map +1 -1
- package/dist/lib/provision.d.ts.map +1 -1
- package/dist/serve.d.ts.map +1 -1
- package/dist/{web-w7r68df1.js → web-vkb16r62.js} +5 -5
- package/dist/{web-w7r68df1.js.map → web-vkb16r62.js.map} +1 -1
- package/dist/wire.js +10 -10
- package/dist/wire.js.map +4 -4
- package/package.json +2 -2
- package/dist/App-dxqm39zx.js +0 -11
- package/dist/WizardApp-12ndxgqv.js +0 -5
- package/dist/credential-wgt4gvcz.js +0 -19
- package/dist/index-9pj1ws0p.js +0 -77
- package/dist/index-9pj1ws0p.js.map +0 -12
- package/dist/index-b5wwtxzk.js +0 -66
- package/dist/index-b5wwtxzk.js.map +0 -12
- package/dist/index-b8zwg8a3.js +0 -6
- package/dist/index-bry9bzt3.js +0 -427
- package/dist/index-bry9bzt3.js.map +0 -11
- package/dist/index-h2yds678.js +0 -7
- package/dist/index-jym27m75.js +0 -6
- package/dist/index-my5cjx00.js +0 -6
- package/dist/index-rqbtm761.js +0 -6
- package/dist/index-yr25dnf5.js +0 -6
- package/dist/index-yr25dnf5.js.map +0 -10
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * The agent picker: bare `run` at a terminal, one keystroke from any sandbox agent.\n *\n * One `useInput` over the pure list keymap and select reducer; the kit renders. Broken agents\n * are listed with their problem — dim, unselectable-looking but still runnable, because a person\n * debugging a manifest wants to reach it, not to be protected from it.\n */\n\nimport { Box, useApp, useInput } from \"ink\"\nimport { useCallback, useState } from \"react\"\nimport { Banner } from \"#components/Banner\"\nimport { SelectList } from \"#components/SelectList\"\nimport { keyToListIntent } from \"#keymap\"\nimport type { SandboxAgent } from \"#lib/sandbox\"\nimport { moveSelect, type SelectState } from \"#lib/select\"\nimport { GLYPH } from \"#lib/theme\"\n\nexport type PickerResult =\n | { readonly kind: \"run\"; readonly manifestPath: string }\n | { readonly kind: \"create\" }\n | { readonly kind: \"quit\" }\n\nexport interface PickerProps {\n readonly title: string\n readonly agents: readonly SandboxAgent[]\n readonly onDone: (result: PickerResult) => void\n}\n\nexport function Picker({ title, agents, onDone }: PickerProps) {\n const { exit } = useApp()\n // The final row is always \"+ create a new agent\".\n const [select, setSelect] = useState<SelectState>({ index: 0, count: agents.length + 1 })\n\n const finish = useCallback(\n (result: PickerResult) => {\n onDone(result)\n exit()\n },\n [onDone, exit],\n )\n\n useInput((input, key) => {\n const intent = keyToListIntent(input, key)\n switch (intent.kind) {\n case \"move\":\n setSelect((current) => moveSelect(current, intent.move))\n return\n case \"choose\": {\n const agent = agents[select.index]\n finish(\n agent === undefined\n ? { kind: \"create\" }\n : { kind: \"run\", manifestPath: agent.manifestPath },\n )\n return\n }\n case \"back\":\n case \"exit\":\n finish({ kind: \"quit\" })\n return\n case \"none\":\n return\n }\n })\n\n const items = [\n ...agents.map((agent) => ({\n label: agent.name ?? agent.ref,\n hint:\n agent.problem !== undefined\n ? `⚠ ${agent.problem}`\n : `${agent.modelId ?? \"?\"} ${GLYPH.bullet}${agent.ref}`,\n })),\n { label: `${GLYPH.create}create a new agent` },\n ]\n\n return (\n <Box flexDirection=\"column\">\n <Banner title={title} lines={[\"pick an agent · enter runs it · esc quits\"]} />\n <Box marginTop={1}>\n <SelectList items={items} index={select.index} numbered />\n </Box>\n </Box>\n )\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";iJAQA,cAAS,YAAK,cAAQ,YACtB,sBAAS,cAAa,gEAmBf,SAA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|
+
import{o,S}from"./index-d4x6yvqh.js";import{ae,W}from"./index-gz9x25tz.js";import{uo}from"./index-4cf6v9nb.js";import{qe}from"./index-j7gyr5nx.js";import{be}from"./index-j55s3ehk.js";import{Box as f,Text as u,useInput as v}from"ink";import{useState as w}from"react";var k=14,R=28;function p(r,i){let m=r.reduce((e,n)=>Math.max(e,n.sessionKey.length),0),t=Math.max(k,Math.min(R,m)),l=Math.max(12,i.columns-(2+t+2));return r.map((e)=>{let n=[`${e.messages} message${e.messages===1?"":"s"}`,`${e.turns} turn${e.turns===1?"":"s"}`,qe(e.lastActivityAt,i.now)];if(e.phase!==void 0&&e.phase!=="")n.push(e.phase);if(!uo(e.sessionKey))n.push("named");return{key:e.sessionKey,label:S(e.sessionKey,t).padEnd(t),hint:S(n.join(" · "),l)}})}import{jsx as c,jsxs as h}from"react/jsx-runtime";function Y({sessions:r,now:i,columns:m,maxRows:t,current:l,focused:e=!0,onDone:n}){let a=p(r,{now:i,columns:m}),[d,x]=w({index:0,count:a.length});if(v((s,g)=>{let y=be(s,g);switch(y.kind){case"move":x((b)=>W(b,y.move));return;case"choose":n(a[d.index]?.key);return;case"back":case"exit":n(void 0);return;case"none":return}},{isActive:e}),a.length===0)return h(f,{flexDirection:"column",children:[c(u,{color:o.muted,wrap:"truncate",children:" no stored conversations with this agent yet"}),c(u,{dimColor:!0,wrap:"truncate",children:" esc starts a new one"})]});return h(f,{flexDirection:"column",children:[c(ae,{items:a.map((s)=>({label:s.label,hint:s.key===l?`${s.hint} · in use`:s.hint})),index:d.index,numbered:!0,maxRows:t}),c(u,{dimColor:!0,wrap:"truncate",children:" ↑↓ move · enter opens it · esc keeps the one you are in"})]})}export{Y as SessionPicker};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=SessionPicker-
|
|
4
|
+
//# debugId=22195B969752BBDF64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=SessionPicker-zyqkg4dn.js.map
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"/**\n * A stored conversation as a row somebody can pick.\n *\n * Pure, and separate from `sessions.ts` for the reason every layout module here is: the *content* of a\n * row — what identifies a conversation, what makes one worth returning to — is the only interesting part,\n * and it is only observable as strings. The picker renders these; `sessions --plain` keeps its own table,\n * because a listing read by a script and a list navigated with arrows want different shapes.\n *\n * What identifies a conversation is the open question here and the answer is deliberate: the key, because\n * that is what you type back, plus **when it was last touched** and **how much is in it**. Not the first\n * message, tempting as that is — it would need a store read per row, and a session whose first message was\n * \"hey\" is not distinguished by it.\n */\n\nimport { ago } from \"#lib/render\"\nimport { clip } from \"#lib/rows\"\nimport { isGeneratedSessionKey } from \"#lib/session-key\"\n\n/** The narrow slice of a `SessionSummary` this needs. Structural, so no core type is imported. */\nexport interface SessionRowSource {\n readonly sessionKey: string\n readonly messages: number\n readonly turns: number\n readonly lastActivityAt: string\n readonly phase?: string | undefined\n}\n\nexport interface SessionRow {\n readonly key: string\n readonly label: string\n readonly hint: string\n}\n\n/** The key column, wide enough for a generated key and clamped so a hand-written one cannot push the row. */\nconst KEY_MIN = 14\nconst KEY_MAX = 28\n\nexport function sessionRows(\n sessions: readonly SessionRowSource[],\n options: { readonly now: number; readonly columns: number },\n): readonly SessionRow[] {\n const longest = sessions.reduce((widest, row) => Math.max(widest, row.sessionKey.length), 0)\n const keyColumn = Math.max(KEY_MIN, Math.min(KEY_MAX, longest))\n // The gutter the list draws, the key column, and two of gap.\n const room = Math.max(12, options.columns - (2 + keyColumn + 2))\n\n return sessions.map((row) => {\n const parts = [\n `${row.messages} message${row.messages === 1 ? \"\" : \"s\"}`,\n `${row.turns} turn${row.turns === 1 ? \"\" : \"s\"}`,\n ago(row.lastActivityAt, options.now),\n ]\n // A phase is only shown when there is one: an agent with no phases would otherwise spend a column\n // on the word \"none\" in every row.\n if (row.phase !== undefined && row.phase !== \"\") parts.push(row.phase)\n // A key the person chose is worth marking, because it is the one they will recognise — everything\n // else in this list is six characters they have never read before.\n if (!isGeneratedSessionKey(row.sessionKey)) parts.push(\"named\")\n return {\n key: row.sessionKey,\n label: clip(row.sessionKey, keyColumn).padEnd(keyColumn),\n hint: clip(parts.join(\" · \"), room),\n }\n })\n}\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";uLAYA,cAAS,UAAK,cAAM,YACpB,mBAAS,cCqBT,IAAM,EAAU,GACV,EAAU,GAET,SAAS,CAAW,CACvB,EACA,EACqB,CACrB,IAAM,EAAU,EAAS,OAAO,CAAC,EAAQ,IAAQ,KAAK,IAAI,EAAQ,EAAI,WAAW,MAAM,EAAG,CAAC,EACrF,EAAY,KAAK,IAAI,EAAS,KAAK,IAAI,EAAS,CAAO,CAAC,EAExD,EAAO,KAAK,IAAI,GAAI,EAAQ,SAAW,EAAI,EAAY,EAAE,EAE/D,OAAO,EAAS,IAAI,CAAC,IAAQ,CACzB,IAAM,EAAQ,CACV,GAAG,EAAI,mBAAmB,EAAI,WAAa,EAAI,GAAK,MACpD,GAAG,EAAI,aAAa,EAAI,QAAU,EAAI,GAAK,MAC3C,GAAI,EAAI,eAAgB,EAAQ,GAAG,CACvC,EAGA,GAAI,EAAI,QAAU,QAAa,EAAI,QAAU,GAAI,EAAM,KAAK,EAAI,KAAK,EAGrE,GAAI,CAAC,GAAsB,EAAI,UAAU,EAAG,EAAM,KAAK,OAAO,EAC9D,MAAO,CACH,IAAK,EAAI,WACT,MAAO,EAAK,EAAI,WAAY,CAAS,EAAE,OAAO,CAAS,EACvD,KAAM,EAAK,EAAM,KAAK,KAAK,EAAG,CAAI,CACtC,EACH,oDD9BE,SAAS,CAAa,EACzB,WACA,MACA,UACA,UACA,UACA,UAAU,GACV,UACmB,CACnB,IAAM,EAA8B,EAAY,EAAU,CAAE,MAAK,SAAQ,CAAC,GACnE,EAAQ,GAAa,EAAsB,CAAE,MAAO,EAAG,MAAO,EAAK,MAAO,CAAC,EAuBlF,GArBA,EACI,CAAC,EAAO,IAAQ,CACZ,IAAM,EAAS,GAAgB,EAAO,CAAG,EACzC,OAAQ,EAAO,UACN,OACD,EAAU,CAAC,IAAU,EAAW,EAAO,EAAO,IAAI,CAAC,EACnD,WACC,SACD,EAAO,EAAK,EAAO,QAAQ,GAAG,EAC9B,WACC,WACA,OACD,EAAO,MAAS,EAChB,WACC,OACD,SAGZ,CAAE,SAAU,CAAQ,CACxB,EAEI,EAAK,SAAW,EAChB,OACI,EAOE,EAPF,CAAK,cAAc,SAAnB,SAOE,CANE,EAEE,EAFF,CAAM,MAAO,EAAM,MAAO,KAAK,WAA/B,SACK,gDACH,EACF,EAEE,EAFF,CAAM,SAAQ,GAAC,KAAK,WAApB,SACK,yBACH,GACJ,EAIV,OACI,EAaE,EAbF,CAAK,cAAc,SAAnB,SAaE,CAZE,EAAC,GAAD,CACI,MAAO,EAAK,IAAI,CAAC,KAAS,CACtB,MAAO,EAAI,MACX,KAAM,EAAI,MAAQ,EAAU,GAAG,EAAI,gBAAkB,EAAI,IAC7D,EAAE,EACF,MAAO,EAAO,MACd,SAAQ,GACR,QAAS,EACb,EACA,EAEE,EAFF,CAAM,SAAQ,GAAC,KAAK,WAApB,SACK,4DACH,GACJ",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "22195B969752BBDF64756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{o,u,oe}from"./index-
|
|
2
|
+
import{o,u,oe}from"./index-d4x6yvqh.js";import{Qt,ot,en}from"./index-fex44816.js";import{re}from"./index-0d93hyfc.js";import{ae,W}from"./index-gz9x25tz.js";import{de}from"./index-v8e92nfw.js";import{st,tn}from"./index-gme2egyq.js";import{Po,Mo,Lo}from"./index-h9mw7b9d.js";import{zt,be}from"./index-j55s3ehk.js";import{Rn,In,Ge,Ze,Ve}from"./index-vgc3y3rm.js";import{Box as p,Text as f,useInput as X}from"ink";import{useCallback as Y,useEffect as K,useState as L}from"react";import{Box as E,Text as R}from"ink";import{jsx as w,jsxs as H}from"react/jsx-runtime";var D={ok:o.success,warn:o.warning,off:o.muted},B={title:{color:o.accent,bold:!0},summary:{dim:!0},state:{},warning:{color:o.warning}};function U(e){return Math.max(Rn,Math.min(In,e))}function g({header:e,footer:l,children:s}){let x=re(),T=U(x.columns),k=T-4,v=Po(e,k),C=e.state??[];return H(E,{flexDirection:"column",width:T,children:[w(E,{flexDirection:"column",borderStyle:oe,borderColor:o.borderActive,paddingX:1,children:v.map((d)=>d.kind==="state"?w(R,{wrap:"truncate",children:C.map((n,c)=>H(R,{color:D[n.tone],children:[c===0?"":" · ",n.label]},n.label))},d.text):w(R,{wrap:"truncate",bold:B[d.kind].bold===!0,dimColor:B[d.kind].dim===!0,...B[d.kind].color===void 0?{}:{color:B[d.kind].color},children:d.text},d.text))}),w(E,{flexDirection:"column",marginTop:1,children:s}),l===void 0||l.length===0?null:w(E,{marginTop:1,children:H(R,{dimColor:!0,wrap:"truncate",children:[" ",Mo(l,k)]})})]})}import{jsx as t,jsxs as S}from"react/jsx-runtime";function Se({load:e,install:l,agents:s,target:x,focused:T=!0,onDone:k,title:v}){let C=re(),d=Math.max(Ge,Math.min(Ze,C.rows-Ve)),[n,c]=L({kind:"fetching",status:"reading the catalogue"}),[b,O]=L([]),[y,M]=L({cursor:{index:0,count:0},chosen:[]}),[_,A]=L({index:0,count:s.length});K(()=>{let r=!0;return e((i)=>{if(r)c((a)=>a.kind==="fetching"?{...a,status:i}:a)}).then((i)=>{if(!r)return;O(i);let a=st(i);M({cursor:{index:en(a),count:i.length},chosen:[]}),c(i.length===0?{kind:"empty"}:{kind:"picking"})}).catch((i)=>{if(!r)return;c({kind:"failed",message:i instanceof Error?i.message:String(i)})}),()=>{r=!1}},[e]);let P=st(b),I=Y((r)=>{let i=tn(b,y.chosen);c({kind:"installing",count:i.length}),l(i,r).then((a)=>c({kind:"done",report:a})).catch((a)=>c({kind:"failed",message:a instanceof Error?a.message:String(a)}))},[b,y.chosen,l]);X((r,i)=>{if(n.kind==="done"){k(n.report);return}if(n.kind==="failed"||n.kind==="empty"){k(void 0);return}if(n.kind==="fetching"||n.kind==="installing"){if(zt(r,i).kind==="cancel")k(void 0);return}if(n.kind==="picking"){let m=zt(r,i);switch(m.kind){case"move":case"toggle":case"all":M((N)=>ot(N,m.kind==="move"?{kind:"move",move:m.move}:{kind:m.kind},P));return;case"none-selected":M((N)=>ot(N,{kind:"none"},P));return;case"confirm":if(y.chosen.length===0)return;if(x!==void 0)return I(x);if(s.length===1)return I(s[0]?.manifestPath??"");c({kind:"agent"});return;case"cancel":k(void 0);return;case"none":return}}let a=be(r,i);switch(a.kind){case"move":A((m)=>W(m,a.move));return;case"choose":{let m=s[_.index];if(m!==void 0)I(m.manifestPath);return}case"back":c({kind:"picking"});return;case"exit":k(void 0);return;case"none":return}},{isActive:T});let z=y.chosen.length,h={title:v,summary:F(n,b.length,z)};if(n.kind==="fetching")return S(g,{header:h,footer:[{key:"esc",does:"stop waiting"}],children:[t(p,{marginLeft:2,children:t(de,{label:n.status})}),t(p,{marginLeft:2,marginTop:1,children:t(f,{dimColor:!0,children:"once per machine, shared by every agent on it"})})]});if(n.kind==="failed")return t(g,{header:h,footer:[{key:"any key",does:"back"}],children:t(p,{marginLeft:2,children:S(f,{color:o.error,children:[u.error,n.message]})})});if(n.kind==="empty")return t(g,{header:h,footer:[{key:"any key",does:"back"}],children:S(p,{marginLeft:2,flexDirection:"column",children:[t(f,{color:o.muted,children:"no catalogue could be read"}),t(f,{dimColor:!0,children:"`sources update` reports why"})]})});if(n.kind==="installing")return t(g,{header:h,children:t(p,{marginLeft:2,children:t(de,{label:`installing ${n.count} skill${n.count===1?"":"s"}`})})});if(n.kind==="done")return t(g,{header:h,footer:[{key:"any key",does:"back"}],children:t(G,{report:n.report})});if(n.kind==="agent")return t(g,{header:h,footer:[{key:"↑↓",does:"move"},{key:"enter",does:"install"},{key:"esc",does:"back"}],children:t(ae,{items:s.map((r)=>({label:r.name??r.ref,hint:r.problem===void 0?`${r.modelId??"?"} ${u.bullet}${r.ref}`:`⚠ ${r.problem}`})),index:_.index,numbered:!0})});return t(g,{header:h,footer:[{key:"↑↓",does:"move"},{key:"space",does:"tick"},{key:"a/n",does:"all/none"},{key:"enter",does:x===void 0?"continue":"install"},Lo],children:t(Qt,{rows:b,index:y.cursor.index,chosen:y.chosen,window:d,width:C.columns})})}function F(e,l,s){switch(e.kind){case"fetching":return"fetching the catalogue";case"failed":return"could not be read";case"empty":return"nothing to show";case"installing":return"installing";case"done":return`installed ${e.report.installed.length} of ${e.report.total}`;case"agent":return`${s} to install · pick an agent`;case"picking":return s===0?`${l} rows · nothing ticked yet`:`${s} ticked of ${l} rows`}}function G({report:e}){return S(p,{flexDirection:"column",marginLeft:2,children:[S(f,{color:e.failed.length===0?o.success:o.warning,children:[u.check,`installed ${e.installed.length} of ${e.total} skill${e.total===1?"":"s"}`]}),e.installed.length>0?t(f,{dimColor:!0,wrap:"truncate",children:e.installed.join(", ")}):null,e.failed.map((l)=>S(f,{color:o.error,wrap:"truncate",children:[u.error,l.name," — ",l.reason]},l.name)),e.runnable>0?t(p,{marginTop:1,children:t(f,{dimColor:!0,wrap:"truncate",children:`${e.runnable} runnable file${e.runnable===1?"":"s"} across ${e.withCode} skill${e.withCode===1?"":"s"} — \`skills show <agent> <skill>\` names them`})}):null,t(p,{marginTop:1,children:t(f,{dimColor:!0,children:"restart the agent: the catalogue is scanned once at boot"})})]})}export{Se as SkillBrowser};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=SkillBrowser-
|
|
4
|
+
//# debugId=0AAECFE521B6D5EA64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=SkillBrowser-3qdp8080.js.map
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"/**\n * The frame every surface renders inside: header, body, footer.\n *\n * Replaces the three hand-rolled banners that came before it. `Banner` stays for what it is good at —\n * a title and some dim lines — and this composes it with the two things every screen also needed and\n * each solved separately: a live state row, and a footer saying what the keys do.\n *\n * ## It measures the terminal itself\n *\n * Width comes from `useTerminalSize()` rather than from a prop. The alternative was tried and is what\n * shipped in Phase 5: the caller measured once, passed numbers down, and a resized terminal left\n * every row laid out for a width that no longer existed. A component that reads the size cannot\n * forget to, and there is exactly one hook doing it.\n *\n * The clamps stay the kit's rather than the measurement's, because they are policy — 40 columns is\n * where a description column stops being worth having, 140 is where a description stops belonging on\n * the same line as its name. They are applied to the *live* value here.\n *\n * ## No input, no exit\n *\n * Presentational, like every component in this kit: it renders what it is given and owns no keyboard.\n * The focused surface owns the single `useInput`, and this is never it.\n */\n\nimport { Box, Text } from \"ink\"\nimport type { ReactNode } from \"react\"\nimport { useTerminalSize } from \"#hooks/useTerminalSize\"\nimport { MAX_SCREEN_COLUMNS, MIN_SCREEN_COLUMNS } from \"#lib/const\"\nimport {\n type HeaderLine,\n headerLines,\n hintLine,\n type KeyHint,\n type ScreenHeader,\n type StateChip,\n} from \"#lib/screen\"\nimport { BORDER_STYLE, THEME } from \"#lib/theme\"\n\nexport interface ScreenProps {\n readonly header: ScreenHeader\n readonly footer?: readonly KeyHint[]\n /**\n * Optional: a screen whose whole content is its header is a real screen — a one-line report, or a\n * list that came back empty. Required, it also made `createElement(Screen, props, body)` a type\n * error, because the third argument is not matched against a mandatory `children` prop.\n */\n readonly children?: ReactNode\n}\n\n/** Chip tone → colour. The pure module names a role; the mapping to a colour lives with the theme. */\nconst TONE: Record<StateChip[\"tone\"], string> = {\n ok: THEME.success,\n warn: THEME.warning,\n off: THEME.muted,\n}\n\n/** Header line kind → how it is drawn. Exhaustive, so a new kind is a type error rather than a plain line. */\nconst LINE_STYLE: Record<\n HeaderLine[\"kind\"],\n { readonly color?: string; readonly dim?: boolean; readonly bold?: boolean }\n> = {\n title: { color: THEME.accent, bold: true },\n summary: { dim: true },\n state: {},\n warning: { color: THEME.warning },\n}\n\n/** The live columns, clamped. Exported so a body lays its rows out against the same number. */\nexport function screenWidth(columns: number): number {\n return Math.max(MIN_SCREEN_COLUMNS, Math.min(MAX_SCREEN_COLUMNS, columns))\n}\n\nexport function Screen({ header, footer, children }: ScreenProps) {\n const size = useTerminalSize()\n const width = screenWidth(size.columns)\n // Two columns for the border, two for the padding: what the header may actually use.\n const inner = width - 4\n const lines = headerLines(header, inner)\n const chips = header.state ?? []\n\n return (\n <Box flexDirection=\"column\" width={width}>\n <Box\n flexDirection=\"column\"\n borderStyle={BORDER_STYLE}\n borderColor={THEME.borderActive}\n paddingX={1}\n >\n {lines.map((line) =>\n // The state row is the one line whose parts are coloured individually, so it is\n // rendered from the chips rather than from its own already-joined text. The text is\n // still what the tests read, and the two cannot disagree because `headerLines`\n // built that string from the same array.\n line.kind === \"state\" ? (\n <Text key={line.text} wrap=\"truncate\">\n {chips.map((chip, at) => (\n <Text key={chip.label} color={TONE[chip.tone]}>\n {at === 0 ? \"\" : \" · \"}\n {chip.label}\n </Text>\n ))}\n </Text>\n ) : (\n <Text\n key={line.text}\n wrap=\"truncate\"\n bold={LINE_STYLE[line.kind].bold === true}\n dimColor={LINE_STYLE[line.kind].dim === true}\n {...(LINE_STYLE[line.kind].color === undefined\n ? {}\n : { color: LINE_STYLE[line.kind].color })}\n >\n {line.text}\n </Text>\n ),\n )}\n </Box>\n\n <Box flexDirection=\"column\" marginTop={1}>\n {children}\n </Box>\n\n {footer === undefined || footer.length === 0 ? null : (\n <Box marginTop={1}>\n <Text dimColor wrap=\"truncate\">\n {\" \"}\n {hintLine(footer, inner)}\n </Text>\n </Box>\n )}\n </Box>\n )\n}\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";wWAsBA,cAAS,UAAK,cAAM,YACpB,sBAAS,eAAa,cAAW,cCCjC,cAAS,UAAK,8DA0Bd,IAAM,EAA0C,CAC5C,GAAI,EAAM,QACV,KAAM,EAAM,QACZ,IAAK,EAAM,KACf,EAGM,EAGF,CACA,MAAO,CAAE,MAAO,EAAM,OAAQ,KAAM,EAAK,EACzC,QAAS,CAAE,IAAK,EAAK,EACr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G,8BACH,GAAG,eAAoB,UAUzC,SAAS,CAAU,EAAG,UAA8C,CAChE,OACI,EA0BE,EA1BF,CAAK,cAAc,SAAS,WAAY,EAAxC,SA0BE,CAzBE,EAGE,EAHF,CAAM,MAAO,EAAO,OAAO,SAAW,EAAI,EAAM,QAAU,EAAM,QAAhE,SAGE,CAFG,EAAM,MACN,aAAa,EAAO,UAAU,aAAa,EAAO,cAAc,EAAO,QAAU,EAAI,GAAK,OAC7F,EACD,EAAO,UAAU,OAAS,EACvB,EAEE,EAFF,CAAM,SAAQ,GAAC,KAAK,WAApB,SACK,EAAO,UAAU,KAAK,IAAI,EAC7B,EACF,KACH,EAAO,OAAO,IAAI,CAAC,IAChB,EAGE,EAHF,CAAyB,MAAO,EAAM,MAAO,KAAK,WAAlD,SAGE,CAFG,EAAM,MACN,EAAQ,KAFb,MAEsB,EAAQ,SAFnB,EAAQ,IAGjB,CACL,EACA,EAAO,SAAW,EACf,EAIE,EAJF,CAAK,UAAW,EAAhB,SACI,EAEE,EAFF,CAAM,SAAQ,GAAC,KAAK,WAApB,SACK,GAAG,EAAO,yBAAyB,EAAO,WAAa,EAAI,GAAK,cAAc,EAAO,iBAAiB,EAAO,WAAa,EAAI,GAAK,mDACtI,EACJ,EACF,KACJ,EAEE,EAFF,CAAK,UAAW,EAAhB,SACI,EAAyE,EAAzE,CAAM,SAAQ,GAAd,oEAAyE,EAC3E,GACJ",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "0AAECFE521B6D5EA64756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{e}from"./index-tv4yv7d2.js";import{st,tn}from"./index-gme2egyq.js";import{o,u,oe}from"./index-d4x6yvqh.js";import"./index-1c5113t4.js";import{nt}from"./index-ty24n0jh.js";import{it}from"./index-4z7axw4r.js";import{an,dt,ln}from"./index-9r0wyj6w.js";import{Qt,ot,en}from"./index-fex44816.js";import{ae,W}from"./index-gz9x25tz.js";import{de}from"./index-v8e92nfw.js";import"./index-cqqb6gaq.js";import"./index-02dn6m2j.js";import{nn}from"./index-6q4wf8e3.js";import{re}from"./index-0d93hyfc.js";import{he,ct,ut,Ct,Fe,Te}from"./index-ttwyrdjs.js";import"./index-6p999cx4.js";import"./index-mtn0g9vc.js";import{q,Do}from"./index-h9mw7b9d.js";import"./index-j7gyr5nx.js";import{D,V,zt,Sn}from"./index-j55s3ehk.js";import{j,$n,Nn}from"./index-vgc3y3rm.js";import{Box as m,Text as h,useApp as ue,useInput as pe}from"ink";import{useCallback as me,useEffect as I,useReducer as fe,useState as ke}from"react";import{Box as ie,Text as N}from"ink";import{jsx as Q,jsxs as se}from"react/jsx-runtime";function Y({rows:n}){let t=n.reduce((r,c)=>Math.max(r,c.label.length),0);return Q(ie,{flexDirection:"column",borderStyle:oe,borderColor:o.border,paddingX:1,paddingY:1,children:n.map((r)=>se(N,{children:[Q(N,{dimColor:!0,children:r.label.padEnd(t+2)}),r.value]},r.label))})}import{Box as H,Text as v}from"ink";import{jsx as E,jsxs as P}from"react/jsx-runtime";function U({step:n,total:t,answered:r,hint:c,children:l}){return P(H,{flexDirection:"column",children:[r.map((p)=>P(v,{children:[E(v,{color:o.success,children:u.check}),E(v,{dimColor:!0,children:p.label.padEnd(18)}),p.value]},p.label)),E(H,{flexDirection:"column",borderStyle:oe,borderColor:o.border,paddingX:1,paddingY:1,marginTop:r.length>0?1:0,children:l}),P(v,{dimColor:!0,children:["step ",n," of ",t," ",u.bullet,c]})]})}function X(n,t){let r={given:n,log:[],phase:"asking",editor:D,select:{index:0,count:he.length},error:void 0,defaults:t};return f(r)===void 0?A(r):r}function b(n){return{...Object.fromEntries(n.log.map((r)=>[r.step,r.value])),...n.given}}function f(n){return Fe(b(n),n.defaults)}function B(n){return n.phase==="asking"&&f(n)?.options!==void 0}function G(n){return f(n)?.options??[]}function Z(n){let t=f(n)?.step;return n.phase==="asking"&&t!==void 0&&Ct.has(t)}function J(n){let t={...b(n)},r=0;for(;;){let l=Fe(t,n.defaults);if(l===void 0)break;r+=1,t[l.step]=l.fallback===""?"(x)":l.fallback}let c=n.log.length+Object.keys(n.given).length;return{asked:c+(n.phase==="asking"?1:0),total:c+r}}var le=2;function A(n){return{...n,phase:"confirm",editor:D,select:{index:0,count:le},error:void 0}}function z(n){let t=Fe(b(n),n.defaults),r=t?.options;return{editor:D,select:{index:ce(t),count:r===void 0?he.length:r.length},error:void 0}}function ce(n){let t=n?.options;if(t===void 0)return 0;let r=Number(n?.fallback)-1;return Number.isInteger(r)&&r>=0&&r<t.length?r:0}function T(n,t){if(n.phase==="done"||n.phase==="aborted")return n;switch(t.kind){case"abort":return{...n,phase:"aborted"};case"edit":if(n.phase!=="asking")return n;return{...n,editor:V(n.editor,t.intent),error:void 0};case"list":{let r=t.intent;if(r.kind==="move")return{...n,select:W(n.select,r.move),error:void 0};if(r.kind==="choose")return T(n,{kind:"commit"});if(r.kind==="back")return T(n,{kind:"back"});if(r.kind==="exit")return{...n,phase:"aborted"};return n}case"back":{if(n.phase==="confirm"){if(n.log.length===0)return{...n,phase:"asking",...z(n)};let l=n.log.slice(0,-1),p={...n,phase:"asking",log:l};return{...p,...z(p)}}if(n.log.length===0)return n;let r=n.log.slice(0,-1),c={...n,log:r};return{...c,...z(c)}}case"commit":{if(n.phase==="confirm")return n.select.index===0?{...n,phase:"done"}:T(n,{kind:"back"});let r=f(n);if(r===void 0)return A(n);let c=r.options!==void 0?r.options[n.select.index]?.value??"":n.editor.value.trim()===""?r.fallback:n.editor.value,l=Te(r.step,c);if(!l.ok)return{...n,error:l.reason};let p={...n,log:[...n.log,{step:r.step,value:l.value}]},d={...p,...z(p)};return f(d)===void 0?A(d):d}}}function ee(n){if(n==="")return"";if(n.length<=8)return"•".repeat(n.length);return`${n.slice(0,3)}${"•".repeat(6)}${n.slice(-2)}`}function ne(n){let t=b(n),r=t.preset===void 0?void 0:ct(t.preset),c=`${t.model??""} at ${t.baseUrl??""}`,l=t.apiKeyEnv??r?.apiKeyEnv,p=l===void 0?" (no key)":` (${l}=${t.apiKey===void 0||t.apiKey===""?"not set yet":ee(t.apiKey)})`;return[{label:"agent",value:t.name??""},{label:"for",value:`${t.user??""} — ${t.purpose??""}`},{label:"endpoint",value:`${c}${p}`},{label:"directory",value:t.dir??ut(t.dirChoice,t.name,n.defaults)??""}]}function te(n){let t={user:"Your name",name:"Agent name",purpose:"Purpose",preset:"Endpoint",model:"Model",baseUrl:"Base URL",apiKeyEnv:"Key env var",apiKey:"API key",web:"Internet",webBackend:"Search backend",webKey:"Search key",system:"System access",composio:"Other apps",telegram:"Telegram",telegramAllow:"Telegram handle",telegramToken:"Bot token",schedules:"none",server:"HTTP API",skills:"Skills",skillsSearch:"Skill search",skillsPick:"Skills picked",daemon:"Background service",serverToken:"API token",composioKey:"Composio key",dirChoice:"Location",dir:"Directory"};return n.log.map((r)=>({label:t[r.step],value:Ct.has(r.step)?ee(r.value):r.value}))}import{jsx as s,jsxs as g}from"react/jsx-runtime";var ge=16,ye=5;function rn({title:n,given:t,defaults:r,onDone:c}){let{exit:l}=ue(),p=re(),[d,k]=ke({kind:"idle"}),[a,x]=fe((i,y)=>T(i,y),void 0,()=>X(t,r)),C=me((i)=>{c(i),l()},[c,l]),L=a.log.some((i)=>i.step==="skills"&&i.value==="find");if(I(()=>{if(!L||d.kind!=="idle")return;k({kind:"fetching",status:"reading the catalogue"}),(async()=>{try{let i=await nt({onStatus:(S)=>k({kind:"fetching",status:S})});if(i.length===0){k({kind:"failed",message:"no catalogue could be read — carrying on without skills"});return}let y=st(i);k({kind:"picking",rows:i,picked:{cursor:{index:en(y),count:i.length},chosen:[]}})}catch(i){k({kind:"failed",message:i instanceof Error?i.message:String(i)})}})()},[L,d.kind]),I(()=>{if(d.kind!=="failed")return;let i=setTimeout(()=>k({kind:"done",refs:[]}),1400);return()=>clearTimeout(i)},[d]),I(()=>{if(a.phase==="done"){let i=d.kind==="done"?d.refs:[];C({...b(a),...i.length===0?{}:{skillsPick:i.join(",")}})}if(a.phase==="aborted")C(void 0)},[a,C,d]),pe((i,y)=>{if(d.kind==="picking"){let F=d.rows,K=st(F),w=zt(i,y);switch(w.kind){case"move":case"toggle":case"all":k({...d,picked:ot(d.picked,w.kind==="move"?{kind:"move",move:w.move}:{kind:w.kind},K)});return;case"none-selected":k({...d,picked:ot(d.picked,{kind:"none"},K)});return;case"confirm":case"cancel":k({kind:"done",refs:w.kind==="cancel"?[]:tn(F,d.picked.chosen).map((_)=>`${_.source}/${_.skill}`)});return;default:return}}if(d.kind==="fetching"||d.kind==="failed")return;let S=Sn(i,y,{select:B(a)||a.phase==="confirm",empty:a.editor.value===""});switch(S.kind){case"abort":x({kind:"abort"});return;case"back":x({kind:"back"});return;case"commit":x({kind:"commit"});return;case"list":x({kind:"list",intent:S.intent});return;case"edit":x({kind:"edit",intent:S.intent});return}}),a.phase==="done"||a.phase==="aborted")return null;if(d.kind==="fetching")return g(m,{flexDirection:"column",children:[s(it,{title:"Skills",lines:["choosing what this agent knows how to do"]}),s(m,{marginTop:1,paddingLeft:2,children:s(de,{label:d.status})})]});if(d.kind==="failed")return g(m,{flexDirection:"column",children:[s(it,{title:"Skills",lines:["carrying on without them"]}),s(m,{marginTop:1,paddingLeft:2,children:s(h,{color:o.warning,children:d.message})})]});if(d.kind==="picking"){let i=d.picked.chosen.length;return g(m,{flexDirection:"column",children:[s(it,{title:"Skills",lines:["space ticks · a all · n none · enter continues · esc skips"]}),s(m,{marginTop:1,children:s(Qt,{rows:d.rows,index:d.picked.cursor.index,chosen:d.picked.chosen,window:Do(void 0,$n),width:q(void 0,j)})}),s(m,{marginTop:1,paddingLeft:2,children:s(h,{color:i===0?o.muted:o.success,children:i===0?"nothing ticked — enter carries on without any":`${i} ticked`})})]})}let O=J(a),R=ln(e.name,{columns:q(p.columns,j)-dt,rows:Math.min(ye,Math.max(0,p.rows-ge))}),M=a.phase==="confirm"?"enter confirm · esc back · ^C quit — nothing written":"enter accepts · esc back · ^C quit — nothing written";return g(m,{flexDirection:"column",children:[R.lines.length>0?s(an,{lines:R.lines}):null,s(m,{marginTop:R.lines.length>0?1:0,children:g(h,{dimColor:!0,wrap:"truncate",children:[n," · a few questions — nothing is written until you confirm"]})}),a.phase==="confirm"?g(m,{flexDirection:"column",marginTop:1,children:[s(Y,{rows:ne(a)}),g(m,{marginTop:1,flexDirection:"column",children:[s(h,{children:"Write the files?"}),s(ae,{items:[{label:"yes"},{label:"no, go back"}],index:a.select.index})]}),s(h,{dimColor:!0,children:M})]}):s(m,{marginTop:1,children:s(U,{step:O.asked,total:O.total,answered:te(a),hint:M,children:B(a)?g(m,{flexDirection:"column",children:[s(h,{children:f(a)?.prompt??""}),s(ae,{items:G(a).map((i)=>({label:i.label,...i.hint===void 0?{}:{hint:i.hint}})),index:a.select.index,numbered:!0})]}):s(nn,{label:f(a)?.prompt??"",editor:a.editor,columns:q(p.columns,j)-dt,maxRows:Nn,placeholder:f(a)?.fallback??"",...a.error===void 0?{}:{error:a.error},...Z(a)?{secret:!0}:{}})})}),a.error!==void 0&&(B(a)||a.phase==="confirm")?g(h,{color:o.error,children:[u.error,a.error]}):null]})}export{rn as WizardApp};
|
|
3
|
+
|
|
4
|
+
//# debugId=B844BA4BDFDCBE4B64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=WizardApp-vzpbydy3.js.map
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
"/**\n * The init wizard as a pure reducer — a log of answers over `nextQuestion`'s forward-only flow.\n *\n * `nextQuestion` cannot go backwards, so back-navigation is an *answer log*: esc pops the tail\n * and the next question is recomputed from what remains. Popping the tail is always consistent\n * because the log is a prefix of the asking order — re-answering the preset re-derives every\n * downstream default for free. Flag-given answers live in `given` and are never poppable: they\n * were explicit, and backing over them would silently discard something the person typed into a\n * shell.\n *\n * Renderer-free and process-free (PURE-listed): `WizardApp` is one consumer; a test driving the\n * reducer with the same intents is another, and the two cannot diverge.\n */\n\nimport { applyIntent, EMPTY_EDITOR } from \"#editor\"\nimport type { ListIntent } from \"#keymap\"\nimport {\n dirFor,\n type InitStep,\n nextQuestion,\n type PartialAnswers,\n PRESETS,\n presetById,\n type Question,\n type QuestionDefaults,\n SECRET_STEPS,\n validateAnswer,\n} from \"#lib/init-flow\"\nimport { moveSelect, type SelectState } from \"#lib/select\"\nimport type { EditorState, Intent } from \"#lib/types\"\n\nexport type WizardPhase = \"asking\" | \"confirm\" | \"done\" | \"aborted\"\n\nexport interface WizardState {\n /** Flag answers — explicit, never poppable. */\n readonly given: PartialAnswers\n /** What the wizard collected, in asking order. Esc pops the tail. */\n readonly log: readonly { readonly step: InitStep; readonly value: string }[]\n readonly phase: WizardPhase\n /** The current text answer. Reuses the chat editor's state machine wholesale. */\n readonly editor: EditorState\n /** The current select answer (preset step, and the confirm screen's yes/no). */\n readonly select: SelectState\n /** Last validation failure; cleared on the next edit. */\n readonly error: string | undefined\n readonly defaults: QuestionDefaults\n}\n\nexport function startWizard(given: PartialAnswers, defaults: QuestionDefaults): WizardState {\n const state: WizardState = {\n given,\n log: [],\n phase: \"asking\",\n editor: EMPTY_EDITOR,\n select: { index: 0, count: PRESETS.length },\n error: undefined,\n defaults,\n }\n // Flags may already answer everything (`init --user … --name … --preset …` at a TTY): the\n // wizard then opens directly on the confirm screen rather than asking zero questions oddly.\n return currentQuestion(state) === undefined ? enterConfirm(state) : state\n}\n\nexport function partialOf(state: WizardState): PartialAnswers {\n const fromLog = Object.fromEntries(state.log.map((entry) => [entry.step, entry.value]))\n // `given` wins, though overlap cannot occur: nextQuestion never asks an answered step, so the\n // log never contains one.\n return { ...fromLog, ...state.given }\n}\n\nexport function currentQuestion(state: WizardState): Question | undefined {\n return nextQuestion(partialOf(state), state.defaults)\n}\n\n/**\n * Is the current question a fixed set of choices rather than a text field?\n *\n * Read off the question's own `options` rather than compared against a step name. The preset menu was\n * the only select for three phases and \"is this the preset step\" ended up written into the reducer,\n * the renderer and the cursor prefill — so adding a second one had to either repeat all three or\n * generalise them. Generalising is what stops a third repeating them again.\n */\nexport function isSelectStep(state: WizardState): boolean {\n return state.phase === \"asking\" && currentQuestion(state)?.options !== undefined\n}\n\n/** The choices on screen, empty when the question is a text field. */\nexport function selectOptions(state: WizardState): readonly {\n readonly value: string\n readonly label: string\n readonly hint?: string\n}[] {\n return currentQuestion(state)?.options ?? []\n}\n\n/** Whether the question on screen is one whose answer must never be rendered. */\nexport function isSecretStep(state: WizardState): boolean {\n const step = currentQuestion(state)?.step\n return state.phase === \"asking\" && step !== undefined && SECRET_STEPS.has(step)\n}\n\n/**\n * Honest step numbering: walk the flow the same way it will actually be asked, so a keyless\n * preset shrinks the total rather than leaving a count that quietly stops being true.\n */\nexport function stepCounts(state: WizardState): { readonly asked: number; readonly total: number } {\n const walk: Record<string, string> = { ...partialOf(state) }\n let remaining = 0\n for (;;) {\n const question = nextQuestion(walk, state.defaults)\n if (question === undefined) break\n remaining += 1\n walk[question.step] = question.fallback === \"\" ? \"(x)\" : question.fallback\n }\n const asked = state.log.length + Object.keys(state.given).length\n return { asked: asked + (state.phase === \"asking\" ? 1 : 0), total: asked + remaining }\n}\n\nexport type WizardAction =\n | { readonly kind: \"edit\"; readonly intent: Intent }\n | { readonly kind: \"list\"; readonly intent: ListIntent }\n | { readonly kind: \"commit\" }\n | { readonly kind: \"back\" }\n | { readonly kind: \"abort\" }\n\nconst CONFIRM_COUNT = 2 // yes / no\n\nfunction enterConfirm(state: WizardState): WizardState {\n return {\n ...state,\n phase: \"confirm\",\n editor: EMPTY_EDITOR,\n select: { index: 0, count: CONFIRM_COUNT },\n error: undefined,\n }\n}\n\nfunction freshFor(state: WizardState): Pick<WizardState, \"editor\" | \"select\" | \"error\"> {\n const question = nextQuestion(partialOf(state), state.defaults)\n const options = question?.options\n return {\n editor: EMPTY_EDITOR,\n select: {\n index: cursorFor(question),\n count: options === undefined ? PRESETS.length : options.length,\n },\n error: undefined,\n }\n}\n\n/** Prefill the cursor from the question's own fallback (\"1\" → 0). */\nfunction cursorFor(question: Question | undefined): number {\n const options = question?.options\n if (options === undefined) return 0\n const index = Number(question?.fallback) - 1\n return Number.isInteger(index) && index >= 0 && index < options.length ? index : 0\n}\n\nexport function reduceWizard(state: WizardState, action: WizardAction): WizardState {\n if (state.phase === \"done\" || state.phase === \"aborted\") return state\n\n switch (action.kind) {\n case \"abort\":\n return { ...state, phase: \"aborted\" }\n\n case \"edit\":\n if (state.phase !== \"asking\") return state\n return { ...state, editor: applyIntent(state.editor, action.intent), error: undefined }\n\n case \"list\": {\n const intent = action.intent\n if (intent.kind === \"move\") {\n return { ...state, select: moveSelect(state.select, intent.move), error: undefined }\n }\n if (intent.kind === \"choose\") return reduceWizard(state, { kind: \"commit\" })\n if (intent.kind === \"back\") return reduceWizard(state, { kind: \"back\" })\n if (intent.kind === \"exit\") return { ...state, phase: \"aborted\" }\n return state\n }\n\n case \"back\": {\n if (state.phase === \"confirm\") {\n // Back to the last asked question, its previous answer discarded so it re-asks\n // with the same defaults it had the first time.\n if (state.log.length === 0) return { ...state, phase: \"asking\", ...freshFor(state) }\n const log = state.log.slice(0, -1)\n const reopened = { ...state, phase: \"asking\" as const, log }\n return { ...reopened, ...freshFor(reopened) }\n }\n if (state.log.length === 0) return state // nothing wizard-asked to go back to\n const log = state.log.slice(0, -1)\n const popped = { ...state, log }\n return { ...popped, ...freshFor(popped) }\n }\n\n case \"commit\": {\n if (state.phase === \"confirm\") {\n // Index 0 is yes — the summary screen's select. \"no\" backs into the last question.\n return state.select.index === 0\n ? { ...state, phase: \"done\" }\n : reduceWizard(state, { kind: \"back\" })\n }\n\n const question = currentQuestion(state)\n if (question === undefined) return enterConfirm(state)\n\n const raw =\n question.options !== undefined\n ? (question.options[state.select.index]?.value ?? \"\")\n : state.editor.value.trim() === \"\"\n ? question.fallback\n : state.editor.value\n\n const checked = validateAnswer(question.step, raw)\n if (!checked.ok) {\n return { ...state, error: checked.reason }\n }\n\n const advanced: WizardState = {\n ...state,\n log: [...state.log, { step: question.step, value: checked.value }],\n }\n const next = { ...advanced, ...freshFor(advanced) }\n return currentQuestion(next) === undefined ? enterConfirm(next) : next\n }\n }\n}\n\n/**\n * What a secret looks like on screen.\n *\n * Enough to recognise a paste went in, never enough to reconstruct. Short values show nothing at\n * all rather than most of themselves.\n */\nexport function maskSecret(value: string): string {\n if (value === \"\") return \"\"\n if (value.length <= 8) return \"•\".repeat(value.length)\n return `${value.slice(0, 3)}${\"•\".repeat(6)}${value.slice(-2)}`\n}\n\n/** The confirm screen's rows, shared with the plain path's wording. */\nexport function summaryRows(\n state: WizardState,\n): readonly { readonly label: string; readonly value: string }[] {\n const partial = partialOf(state)\n const preset = partial.preset === undefined ? undefined : presetById(partial.preset)\n const endpoint = `${partial.model ?? \"\"} at ${partial.baseUrl ?? \"\"}`\n const keyVar = partial.apiKeyEnv ?? preset?.apiKeyEnv\n const key =\n keyVar === undefined\n ? \" (no key)\"\n : ` (${keyVar}=${partial.apiKey === undefined || partial.apiKey === \"\" ? \"not set yet\" : maskSecret(partial.apiKey)})`\n return [\n { label: \"agent\", value: partial.name ?? \"\" },\n { label: \"for\", value: `${partial.user ?? \"\"} — ${partial.purpose ?? \"\"}` },\n { label: \"endpoint\", value: `${endpoint}${key}` },\n // Derived when the answer was `sandbox` or `here`, because the `dir` question is not asked\n // then — and this row is the last thing read before anything is written, so it has to name\n // the directory that will actually exist. `dirFor` is the same function `complete()` calls;\n // a second derivation here is how a confirm screen comes to describe a different path.\n {\n label: \"directory\",\n value: partial.dir ?? dirFor(partial.dirChoice, partial.name, state.defaults) ?? \"\",\n },\n ]\n}\n\n/** The ✓ lines above the current question. */\nexport function answeredRows(\n state: WizardState,\n): readonly { readonly label: string; readonly value: string }[] {\n const labels: Record<InitStep, string> = {\n user: \"Your name\",\n name: \"Agent name\",\n purpose: \"Purpose\",\n preset: \"Endpoint\",\n model: \"Model\",\n baseUrl: \"Base URL\",\n apiKeyEnv: \"Key env var\",\n apiKey: \"API key\",\n web: \"Internet\",\n webBackend: \"Search backend\",\n webKey: \"Search key\",\n system: \"System access\",\n composio: \"Other apps\",\n telegram: \"Telegram\",\n telegramAllow: \"Telegram handle\",\n telegramToken: \"Bot token\",\n schedules: \"none\",\n server: \"HTTP API\",\n // Was literally `\"starter\"` — a value pasted into the label column, so the confirm screen\n // showed \"starter starter\" for the default answer and \"starter none\" for the other one.\n skills: \"Skills\",\n skillsSearch: \"Skill search\",\n skillsPick: \"Skills picked\",\n daemon: \"Background service\",\n serverToken: \"API token\",\n composioKey: \"Composio key\",\n dirChoice: \"Location\",\n dir: \"Directory\",\n }\n return state.log.map((entry) => ({\n label: labels[entry.step],\n // A secret is never echoed back, not even to the person who just typed it: these lines\n // stay on screen for the rest of the wizard and end up in scrollback.\n value: SECRET_STEPS.has(entry.step) ? maskSecret(entry.value) : entry.value,\n }))\n}\n"
|
|
9
9
|
],
|
|
10
10
|
"mappings": ";qvBAUA,cAAS,UAAK,YAAM,eAAQ,aAC5B,sBAAS,gBAAa,gBAAW,eAAY,eCP7C,cAAS,WAAK,+DAOP,SAAS,CAAW,EAAG,QAA0B,CACpD,IAAM,EAAQ,EAAK,OAAO,CAAC,EAAQ,IAAQ,KAAK,IAAI,EAAQ,EAAI,MAAM,MAAM,EAAG,CAAC,EAChF,OACI,EAaE,GAbF,CACI,cAAc,SACd,YAAa,GACb,YAAa,EAAM,OACnB,SAAU,EACV,SAAU,EALd,SAOK,EAAK,IAAI,CAAC,IACP,GAGE,EAHF,UAGE,CAFE,EAA8C,EAA9C,CAAM,SAAQ,GAAd,SAAgB,EAAI,MAAM,OAAO,EAAQ,CAAC,EAAI,EAC7C,EAAI,QAFE,EAAI,KAGb,CACL,EACH,ECrBV,cAAS,UAAK,8DAaP,SAAS,CAAW,EAAG,OAAM,QAAO,WAAU,OAAM,YAA8B,CACrF,OACI,EAsBE,EAtBF,CAAK,cAAc,SAAnB,SAsBE,CArBG,EAAS,IAAI,CAAC,IACX,EAIE,EAJF,UAIE,CAHE,EAA2C,EAA3C,CAAM,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EAEF,EAsCE,EAtCF,CAAK,UAAW,EAAhB,SACI,EAoCE,EApCF,CACI,KAAM,EAAO,MACb,MAAO,EAAO,MACd,SAAU,GAAa,CAAK,EAC5B,KAAM,EAJV,SAMK,EAAa,CAAK,EACf,EAUE,EAVF,CAAK,cAAc,SAAnB,SAUE,CATE,EAA8C,EAA9C,UAAO,EAAgB,CAAK,GAAG,QAAU,GAAK,EAC9C,EAAC,GAAD,CACI,MAAO,EAAc,CAAK,EAAE,IAAI,CAAC,KAAY,CACzC,MAAO,EAAO,SACV,EAAO,OAAS,OAAY,CAAC,EAAI,CAAE,KAAM,EAAO,IAAK,CAC7D,EAAE,EACF,MAAO,EAAM,OAAO,MACpB,SAAQ,GACZ,GACF,EAEF,EAAC,GAAD,CACI,MAAO,EAAgB,CAAK,GAAG,QAAU,GACzC,OAAQ,EAAM,OAMd,QACI,EAAc,EAAK,QAAS,CAAgB,EAAI,GAEpD,QAAS,GACT,YAAa,EAAgB,CAAK,GAAG,UAAY,MAC5C,EAAM,QAAU,OAAY,CAAC,EAAI,CAAE,MAAO,EAAM,KAAM,KACtD,EAAa,CAAK,EAAI,CAAE,OAAQ,EAAK,EAAI,CAAC,EACnD,EAEN,EACJ,EAEL,EAAM,QAAU,SAAc,EAAa,CAAK,GAAK,EAAM,QAAU,WAClE,EAGE,EAHF,CAAM,MAAO,EAAM,MAAnB,SAGE,CAFG,EAAM,MACN,EAAM,OACT,EACF,MACN",
|
|
11
|
-
"debugId": "
|
|
11
|
+
"debugId": "B844BA4BDFDCBE4B64756E2164756E21",
|
|
12
12
|
"names": []
|
|
13
13
|
}
|
package/dist/client.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var ne="What I already know, carried from before this conversation and kept current. "+"Not a transcript — these are standing facts about the person I work for and my own working notes. "+"If they ask what I know or remember about them, this is the answer.";var
|
|
2
|
-
`),...t===void 0?{}:{id:t},...c===void 0?{}:{retry:c}}}async function*
|
|
3
|
-
`)),e.block.wrapped.add(e.heredocKey),e.heredocKey=void 0,e.heredocLines=[]}function g(e){if(
|
|
4
|
-
${t}`;return}g(e),e.text.push(n)}function z(e){if(/^\s*(?:[-*+]|\d+[.)]?)?\s*$/.test(e))return!0;let n=e.replace(/^\s*(?:[-*+]\s+|\d+[.)]\s+)?/,"").toLowerCase(),s=n.startsWith("<")?n.slice(1):n;if("action:".startsWith(s)||s.startsWith("action:"))return!0;if(/^<\/?$/.test(n)||/^<\/?[a-z_][\w.:-]*>?$/.test(n))return!0;return/^`{1,3}[\w+-]*$/.test(n)}function
|
|
5
|
-
`)},
|
|
6
|
-
`);while(l!==-1){let f=
|
|
7
|
-
`)}let p=
|
|
1
|
+
var ne="What I already know, carried from before this conversation and kept current. "+"Not a transcript — these are standing facts about the person I work for and my own working notes. "+"If they ask what I know or remember about them, this is the answer.";var C=["runtime.ready","store.ready","runtime.stopping","agent.loaded","agent.disposed","agent.warning","plugin.loaded","plugin.slow","approval.requested","approval.resolved","handoff.start","handoff.result","turn.start","context.assembled","context.dropped","context.pressure","compaction.stage","context.reset","phase.changed","model.call","model.chunk","model.retry","model.result","tool.call","tool.result","tool.gated","tool.repair","tools.refreshed","agent.channel.status","agent.channel.error","agent.channel.rejected","delivery.sent","delivery.retry","delivery.failed","delivery.uncertain","runtime.released","schedules.reconciled","schedule.fired","schedule.skipped","schedule.deferred","schedule.error","turn.end","error"],m=(e)=>String.fromCharCode(e),v=m(27),O=m(7),te=new RegExp(`${v}\\[[0-?]*[ -/]*[@-~]`,"g"),re=new RegExp(`${v}\\][\\s\\S]*?(?:${O}|${v}\\\\|$)`,"g"),se=new RegExp(`${v}[P^_X][\\s\\S]*?(?:${v}\\\\|${O}|$)`,"g"),oe=new RegExp(`${v}[@-Z\\\\-_0-9=><]?`,"g"),ie=new RegExp(`[${m(128)}-${m(159)}]`,"g"),ae=new RegExp(`[${m(0)}-${m(8)}${m(11)}${m(12)}${m(14)}-${m(31)}${m(127)}]`,"g");var G=/\r\n\r\n|\n\n|\r\r/;function N(e){let n=[],s,t,c;for(let i of e.split(/\r\n|\n|\r/)){if(i===""||i.startsWith(":"))continue;let u=i.indexOf(":"),h=u===-1?i:i.slice(0,u),y=u===-1?"":i.slice(u+1);if(y.startsWith(" "))y=y.slice(1);switch(h){case"data":n.push(y);break;case"event":s=y;break;case"id":t=y;break;case"retry":{let d=Number.parseInt(y,10);if(Number.isFinite(d))c=d;break}default:break}}if(n.length===0&&s===void 0)return;return{...s===void 0?{}:{event:s},data:n.join(`
|
|
2
|
+
`),...t===void 0?{}:{id:t},...c===void 0?{}:{retry:c}}}async function*I(e){let n=new TextDecoder,s="";for await(let t of e){s+=typeof t==="string"?t:n.decode(t,{stream:!0});while(!0){let c=G.exec(s);if(c===null)break;let i=s.slice(0,c.index);s=s.slice(c.index+c[0].length);let u=N(i);if(u!==void 0)yield u}}if(s+=n.decode(),s.trim()!==""){let t=N(s);if(t!==void 0)yield t}}function M(){return{push:(e)=>e,endStep:()=>"",end:()=>""}}function F(e){return e!=="final"&&e!=="stopped"}function D(e,n={}){switch(e){case"final":return;case"max_steps":return`stopped${n.steps===void 0?"":` after ${n.steps} steps`} without finishing — say "continue" to carry on, or raise limits.maxSteps`;case"no_progress":return'stopped: the same tool call was repeated with no change — say "continue" with more to go on, or check whether that tool is telling it anything useful';case"truncated":return"the reply was cut off at the output limit — raise model.<role>.maxTokens, or ask for less";case"timeout":return`timed out${n.durationMs===void 0?"":` after ${n.durationMs} ms`} — raise limits.turnTimeoutMs`;case"stopped":return n.cancelledAfterMs===void 0?"cancelled":`cancelled after ${n.cancelledAfterMs.toFixed(0)} ms`;case"error":return}}var A="<<<",x=">>>",b=/^\s*(?:[-*+]\s+|\d+[.)]\s+)?<?\s*action\s*:\s*(.+?)\s*>?\s*$/i,q=/^\s*(?:[-*+]\s+|\d+[.)]\s+)?([A-Za-z_][\w.-]*?)\s*:\s*(.*)$/,S=/^\s*`{3,}\s*[\w+-]*\s*$/,k=/^\s*end\s*$/i,H=/^\s*<\s*action\s*>\s*$/i,R=/^\s*<\s*\/\s*action\s*>\s*$/i,W=/^\s*<\/?\s*[A-Za-z_][\w.:-]*\s*\/?\s*>\s*$/;function E(e){return e.replace(/^[`'"*<]+/,"").replace(/[`'"*>]+$/,"").replace(/[.,;:]+$/,"").trim()}function L(e,n,s){let t=e.fields.get(n);if(t===void 0)e.fields.set(n,[s]);else t.push(s)}function P(e){if(e.block===void 0||e.heredocKey===void 0)return;let n=[...e.heredocLines];if(n[n.length-1]==="")n.pop();L(e.block,e.heredocKey,n.join(`
|
|
3
|
+
`)),e.block.wrapped.add(e.heredocKey),e.heredocKey=void 0,e.heredocLines=[]}function g(e){if(P(e),e.block!==void 0)e.blocks.push(e.block);e.block=void 0,e.openKey=void 0,e.awaitingSlug=!1}function _(){return{block:void 0,openKey:void 0,severedKey:void 0,severedPending:void 0,heredocKey:void 0,heredocLines:[],justClosed:!1,awaitingSlug:!1,text:[],blocks:[]}}function B(e,n,s){let t=n.trim();if(e.heredocKey!==void 0){if(t===x){P(e);return}if(k.test(t)){g(e),e.justClosed=!0;return}if(b.test(n)){g(e);let u=b.exec(n),h=E(u?.[1]??"");if(h!=="")e.block={slug:h,fields:new Map,wrapped:new Set,severed:new Set};return}e.heredocLines.push(n);return}let c=b.exec(n);if(c!==null){let u=E(c[1]??"");if(g(e),u==="")return;e.block={slug:u,fields:new Map,wrapped:new Set,severed:new Set};return}if(H.test(n)){g(e),e.awaitingSlug=!0;return}if(e.awaitingSlug){if(t==="")return;if(R.test(n)){e.awaitingSlug=!1;return}let u=E(t);if(e.awaitingSlug=!1,u!=="")e.block={slug:u,fields:new Map,wrapped:new Set,severed:new Set};return}if(R.test(n)){if(e.block!==void 0)g(e),e.justClosed=!0;return}if(W.test(n))return;if(e.block===void 0){if(S.test(n)&&(e.justClosed||s())){e.justClosed=!1;return}if(k.test(t)&&e.severedPending!==void 0){e.severedPending.block.severed.add(e.severedPending.key),e.severedPending=void 0;return}if(b.test(n))e.severedPending=void 0;if(e.text.push(n),t!=="")e.justClosed=!1;return}if(t===""){if(e.openKey!==void 0)e.severedKey=e.openKey;e.openKey=void 0;return}if(k.test(t)){e.severedKey=void 0,g(e),e.justClosed=!0;return}if(S.test(n))return;let i=q.exec(n);if(i!==null){let u=(i[1]??"").trim(),h=(i[2]??"").trim();if(e.severedKey=void 0,h===A)e.heredocKey=u,e.heredocLines=[],e.openKey=void 0;else L(e.block,u,h),e.openKey=u;return}if(e.openKey!==void 0){let u=e.block.fields.get(e.openKey),h=u?.[u.length-1];if(u!==void 0&&h!==void 0)u[u.length-1]=h===""?t:`${h}
|
|
4
|
+
${t}`;return}if(e.severedKey!==void 0)e.severedPending={block:e.block,key:e.severedKey},e.severedKey=void 0;g(e),e.text.push(n)}function z(e){if(/^\s*(?:[-*+]|\d+[.)]?)?\s*$/.test(e))return!0;let n=e.replace(/^\s*(?:[-*+]\s+|\d+[.)]\s+)?/,"").toLowerCase(),s=n.startsWith("<")?n.slice(1):n;if("action:".startsWith(s)||s.startsWith("action:"))return!0;if(/^<\/?$/.test(n)||/^<\/?[a-z_][\w.:-]*>?$/.test(n))return!0;return/^`{1,3}[\w+-]*$/.test(n)}function T(e){return e.endsWith("\r")?e.slice(0,-1):e}function V(){let e=_(),n="",s=0,t,c="",i=!1,u=(r)=>{if(r==="")return"";if(r.trim()==="")return c+=r,"";let o=c+r;if(c="",i)return o;return i=!0,o.replace(/^\s+/,"")},h=(r,o)=>{let l=e.text.length;return B(e,r,()=>o!==void 0&&b.test(o)),e.text.length>l?r:void 0},y=(r,o,l)=>{let p=h(r,o);if(p===void 0)return"";return u(p.slice(l))+u(`
|
|
5
|
+
`)},d=(r)=>{if(t===void 0)return"";let o=t;return t=void 0,y(o,r,0)};return{push(r){let o="";n+=r;let l=n.indexOf(`
|
|
6
|
+
`);while(l!==-1){let f=T(n.slice(0,l));if(n=n.slice(l+1),o+=d(f),e.block===void 0&&S.test(f)&&!e.justClosed)t=f;else o+=y(f,void 0,s);s=0,l=n.indexOf(`
|
|
7
|
+
`)}let p=T(n);if(e.block===void 0&&!e.awaitingSlug&&t===void 0&&!z(p))o+=u(p.slice(s)),s=p.length;return o},endStep(){let r=a();return c=`
|
|
8
8
|
|
|
9
|
-
`,e=_(),r},end:
|
|
9
|
+
`,e=_(),r},end:a};function a(){let r=d(void 0),o=T(n);if(o!==""){let l=h(o,void 0);if(l!==void 0)r+=u(l.slice(s))}return n="",s=0,t=void 0,r}}var de=`# Tools
|
|
10
10
|
|
|
11
11
|
To use a tool, write an ACTION block. Start each line at the left margin, exactly like this:
|
|
12
12
|
|
|
@@ -28,7 +28,7 @@ Rules for a block:
|
|
|
28
28
|
Anything you write outside a block is shown to the person you are talking to, so keep explanations
|
|
29
29
|
short and keep them out of the block. When no tool fits, simply reply — never invent a tool, and
|
|
30
30
|
never guess a value for a required field you have not been given.`;class w extends Error{code;hint;field;status;request;constructor(e,n={}){super(e.hint===void 0?e.message:`${e.message}
|
|
31
|
-
hint: ${e.hint}`);if(this.name="DispachError",this.code=e.code,this.hint=e.hint??"",this.field=e.field,this.status=n.status,this.request=n.method===void 0||n.path===void 0?void 0:{method:n.method,path:n.path},n.cause!==void 0)this.cause=n.cause}}function Y(e,n){let s=e instanceof Error?e.message:String(e);return new w({code:"transport_failed",message:`${n.method} ${n.path} did not reach ${n.baseUrl}: ${s}`,hint:"Check the base URL, that the server is running, and that nothing between you and it is refusing the connection. `GET /v1/health` needs no token and is the cheapest probe."},{...n,cause:e})}async function Z(e,n){let s;try{let t=await e.json();if(typeof t.error?.code==="string"&&typeof t.error.message==="string")s={code:t.error.code,message:t.error.message,...t.error.hint===void 0?{}:{hint:t.error.hint},...t.error.field===void 0?{}:{field:t.error.field}}}catch{}return new w(s??{code:`http_${e.status}`,message:`${n.method} ${n.path} returned ${e.status} with no error body.`,hint:"This is not a response this server produces, so something between you and it answered — a proxy, a gateway, or a load balancer. Check the URL and what is in front of it."},{status:e.status,...n})}var
|
|
31
|
+
hint: ${e.hint}`);if(this.name="DispachError",this.code=e.code,this.hint=e.hint??"",this.field=e.field,this.status=n.status,this.request=n.method===void 0||n.path===void 0?void 0:{method:n.method,path:n.path},n.cause!==void 0)this.cause=n.cause}}function Y(e,n){let s=e instanceof Error?e.message:String(e);return new w({code:"transport_failed",message:`${n.method} ${n.path} did not reach ${n.baseUrl}: ${s}`,hint:"Check the base URL, that the server is running, and that nothing between you and it is refusing the connection. `GET /v1/health` needs no token and is the cheapest probe."},{...n,cause:e})}async function Z(e,n){let s;try{let t=await e.json();if(typeof t.error?.code==="string"&&typeof t.error.message==="string")s={code:t.error.code,message:t.error.message,...t.error.hint===void 0?{}:{hint:t.error.hint},...t.error.field===void 0?{}:{field:t.error.field}}}catch{}return new w(s??{code:`http_${e.status}`,message:`${n.method} ${n.path} returned ${e.status} with no error body.`,hint:"This is not a response this server produces, so something between you and it answered — a proxy, a gateway, or a load balancer. Check the URL and what is in front of it."},{status:e.status,...n})}var K=new Set(C);async function*U(e){for await(let n of I(J(e))){if(n.event===void 0||n.data==="")continue;let s;try{s=JSON.parse(n.data)}catch{continue}yield{name:n.event,data:s}}}async function*J(e){let n=e.getReader();try{while(!0){let{done:s,value:t}=await n.read();if(s)return;if(t!==void 0)yield t}}finally{n.releaseLock()}}async function*X(e){for await(let{name:n,data:s}of U(e)){if(K.has(n)){yield{kind:"event",event:s};continue}let t=s??{};switch(n){case"turn.accepted":yield{kind:"accepted",turnId:String(t.turnId??""),sessionKey:String(t.sessionKey??"")};break;case"stream.replay":yield{kind:"replay",report:{state:t.state==="ended"?"ended":"running",events:Number(t.events??0),truncated:t.truncated===!0,dropped:Number(t.dropped??0),chunks:t.chunks==="start"||t.chunks==="partial"?t.chunks:"none"}};break;case"stream.ended":yield{kind:"ended",turnId:String(t.turnId??""),status:String(t.status??"unknown"),steps:typeof t.steps==="number"?t.steps:void 0,errorCode:typeof t.errorCode==="string"?t.errorCode:void 0};break;case"stream.unavailable":yield{kind:"unavailable",turnId:String(t.turnId??""),reason:String(t.reason??"not observable from this process")};break;default:break}}}async function*Q(e){for await(let{name:n,data:s}of U(e)){if(K.has(n)){yield{kind:"event",event:s};continue}if(n==="stream.subscribed"){let t=s??{};yield{kind:"subscribed",report:{agentId:typeof t.agentId==="string"?t.agentId:null,types:Array.isArray(t.types)?t.types:null,chunks:t.chunks===!0,implied:typeof t.implied==="string"?t.implied:void 0}}}}}async function*ee(e,n={}){for await(let s of e){if(s.kind==="replay"&&s.report.truncated&&n.allowTruncated!==!0)throw new w({code:"replay_truncated",message:`This turn's replay is missing its oldest ${s.report.dropped} event(s), so the text reconstructed from it would be incomplete.`,hint:"Read the finished text from GET /v1/agents/:id/turns/:turnId, or pass { allowTruncated: true } to accept a fragment. Streaming from the start of a turn is never truncated — this only happens when reattaching to one that has already produced more events than the buffer holds."});if(s.kind==="unavailable")throw new w({code:"turn_not_observable",message:`Turn ${s.turnId} is recorded as running but is not observable here: ${s.reason}.`,hint:"Its events are buffered in whichever process is executing it. Poll GET /v1/agents/:id/turns/:turnId for the outcome."});if(s.kind!=="event")continue;if(s.event.type!=="model.chunk")continue;let t=s.event.data;if(t.kind==="reasoning")continue;if(typeof t.delta==="string")yield t.delta}}function he(e,n){return e.type===n}function pe(e){let n=e.baseUrl.replace(/\/+$/,""),s=e.fetch??fetch,t=(d={})=>({...e.token===void 0?{}:{authorization:`Bearer ${e.token}`},...d});async function c(d,a,r={}){let o;try{o=await s(`${n}${a}`,{method:d,headers:t({...r.body===void 0?{}:{"content-type":"application/json"},...r.accept===void 0?{}:{accept:r.accept},...r.headers}),...r.body===void 0?{}:{body:JSON.stringify(r.body)},...r.signal===void 0?{}:{signal:r.signal}})}catch(l){throw Y(l,{method:d,path:a,baseUrl:n})}if(!o.ok)throw await Z(o,{method:d,path:a});return o}async function i(d,a,r){return await(await c(d,a,r??{})).json()}async function u(d,a){let r=await c("GET",d,{accept:"text/event-stream",...a===void 0?{}:{signal:a}});if(r.body===null)throw new w({code:"no_response_body",message:`GET ${d} returned ${r.status} with no body to read.`,hint:"An SSE route always has a body. A missing one means something between you and the server buffered the response — commonly a proxy without streaming enabled."},{status:r.status,method:"GET",path:d});return r.body}function h(d,a,r,o={}){let l=(f)=>f?.chunks===!0?"?chunks=true":"",p={turnId:a,sessionKey:r,replayed:o.replayed===!0,async*stream(f){let j=await u(`/v1/agents/${encodeURIComponent(d)}/turns/${encodeURIComponent(a)}/stream${l(f)}`,f?.signal);yield*X(j)},async*tokens(f){yield*ee(p.stream({chunks:!0,...f}),{...f?.allowTruncated===void 0?{}:{allowTruncated:f.allowTruncated}})},async text(){for await(let f of p.stream()){if(f.kind==="ended")break;if(f.kind==="unavailable")break;if(f.kind==="event"&&f.event.type==="turn.end")break}return(await p.get()).text},get:()=>i("GET",`/v1/agents/${encodeURIComponent(d)}/turns/${encodeURIComponent(a)}`),async stop(){await c("POST",`/v1/agents/${encodeURIComponent(d)}/turns/${encodeURIComponent(a)}/stop`)}};return p}function y(d){let a=(r)=>`/v1/agents/${encodeURIComponent(d)}${r}`;return{id:d,async send(r,o){let l=await i("POST",a("/messages"),{body:{text:r,...o?.sessionKey===void 0?{}:{sessionKey:o.sessionKey},...o?.deliver===void 0?{}:{deliver:o.deliver},...o?.from===void 0?{}:{from:o.from}},...o?.idempotencyKey===void 0?{}:{headers:{"idempotency-key":o.idempotencyKey}},...o?.signal===void 0?{}:{signal:o.signal}});return h(d,l.turnId,l.sessionKey,{replayed:l.replayed===!0})},turn:(r)=>h(d,r,""),describe:()=>i("GET",a("")),tools:()=>i("GET",a("/tools")),skills:()=>i("GET",a("/skills")),sessions:()=>i("GET",a("/sessions")),messages:(r,o)=>{let l=new URLSearchParams;if(o?.before!==void 0)l.set("before",String(o.before));if(o?.limit!==void 0)l.set("limit",String(o.limit));let p=l.size===0?"":`?${l.toString()}`;return i("GET",a(`/sessions/${encodeURIComponent(r)}/messages${p}`))},clearSession:(r)=>i("DELETE",a(`/sessions/${encodeURIComponent(r)}`)),reload:()=>i("POST",a("/reload"),{body:{}}),schedules:async()=>(await i("GET",a("/schedules"))).schedules,approvals:async()=>(await i("GET",a("/approvals"))).approvals,createSchedule:(r)=>i("POST",a("/schedules"),{body:r}),updateSchedule:(r,o)=>i("PATCH",a(`/schedules/${encodeURIComponent(r)}`),{body:o}),deleteSchedule:async(r)=>{await i("DELETE",a(`/schedules/${encodeURIComponent(r)}`))},runSchedule:(r)=>i("POST",a(`/schedules/${encodeURIComponent(r)}/run`),{body:{}}),config:()=>i("GET",a("/config")),setConfig:(r,o,l)=>i("PATCH",a("/config"),{body:{path:r,value:o,...l?.confirm===void 0?{}:{confirm:l.confirm}}}),session:(r)=>i("GET",a(`/sessions/${encodeURIComponent(r)}`)),setPhase:(r,o)=>i("POST",a(`/sessions/${encodeURIComponent(r)}/phase`),{body:{phase:o}}),approve:async(r,o)=>{await i("POST",a(`/approvals/${encodeURIComponent(r)}`),{body:{granted:o}})},stop:(r)=>i("POST",a("/stop"),{body:r===void 0?{}:{reason:r}}),start:()=>i("POST",a("/start"),{body:{}}),context:(r)=>{let o=new URLSearchParams;if(r?.sessionKey!==void 0)o.set("sessionKey",r.sessionKey);if(r?.input!==void 0)o.set("input",r.input);let l=o.size===0?"":`?${o.toString()}`;return i("GET",a(`/context${l}`))}}}return{agent:y,agents:()=>i("GET","/v1/agents"),health:()=>i("GET","/v1/health"),async ready(){try{return await c("GET","/v1/ready"),!0}catch(d){if(d instanceof w&&d.status===503)return!1;throw d}},provision:()=>i("GET","/v1/provision"),keys:()=>i("GET","/v1/keys"),createKey:(d)=>i("POST","/v1/keys",{body:d}),revokeKey:(d)=>i("DELETE",`/v1/keys/${encodeURIComponent(d)}`),createAgent:(d)=>i("POST","/v1/agents",{body:{answers:d}}),async*events(d){let a=new URLSearchParams;if(d?.agentId!==void 0)a.set("agentId",d.agentId);if(d?.types!==void 0&&d.types.length>0)a.set("types",d.types.join(","));if(d?.chunks===!0)a.set("chunks","true");let r=a.size===0?"":`?${a.toString()}`,o=await u(`/v1/events${r}`,d?.signal);yield*Q(o)}}}export{w as DispachError,pe as createClient,he as isEvent};
|
|
32
32
|
|
|
33
|
-
//# debugId=
|
|
33
|
+
//# debugId=4598818C40B68A0964756E2164756E21
|
|
34
34
|
//# sourceMappingURL=client.js.map
|