@robota-sdk/agent-product 3.5.0 → 3.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/coding/index.cjs +1 -1
- package/dist/coding/index.js +1 -1
- package/dist/command/index.cjs +1 -1
- package/dist/command/index.d.cts +11 -2
- package/dist/command/index.d.cts.map +1 -1
- package/dist/command/index.d.ts +11 -2
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +1 -1
- package/dist/{command-BEEZrEw-.cjs → command--ag0fdHz.cjs} +64 -64
- package/dist/{command-0nMdpRQZ.js → command-BXOf0yNQ.js} +7 -7
- package/dist/{command-0nMdpRQZ.js.map → command-BXOf0yNQ.js.map} +1 -1
- package/dist/personal/index.cjs +21 -12
- package/dist/personal/index.d.cts +1105 -4
- package/dist/personal/index.d.cts.map +1 -1
- package/dist/personal/index.d.ts +1105 -4
- package/dist/personal/index.d.ts.map +1 -1
- package/dist/personal/index.js +24 -15
- package/dist/personal/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -114,10 +114,10 @@ import{r as e}from"./load-external-presets-CJeFbxNF.js";import"./preset-nuw37AF-
|
|
|
114
114
|
`:``)+(n.length+r.length===0?`No active loops.`:[...n.map(e=>`- ${Z(e)} [${e.status}] ${e.label}`),...r.map(e=>`- ${e.loopId} [${e.phase}] Loop: ${e.instruction}`+(e.phase===`waiting`&&e.delaySeconds!==void 0&&e.reason?` — next ${e.delaySeconds}s: ${e.reason}`:``))].join(`
|
|
115
115
|
`)),data:{count:n.length+r.length}}}async function Ld(e,t,n){let r=/^stop\s+(\S+)$/.exec(n);if(!r)return{success:!1,message:Td};let i=X(e).find(e=>e.loopId===r[1]);if(i)return e.stopSelfPacedLoop?(await e.stopSelfPacedLoop(i.loopId,`Loop stopped by user`),{success:!0,message:`Loop stopped: ${i.loopId}. An already-running turn may finish.`,data:{loopId:i.loopId}}):{success:!1,message:`This host cannot stop self-paced loops.`};let a=Y(e).find(e=>Z(e)===r[1]);return a?(await t(a.id,`Loop stopped by user`),{success:!0,message:`Loop stopped: ${Z(a)}. An already-running turn may finish.`,data:{loopId:Z(a),taskId:a.id}}):{success:!1,message:`Active loop not found: ${r[1]}`}}async function Rd(e,t,n,r=Ed){let i=t===``||/^\d+(s|m|h|d)$/i.test(t),a=n.defaultPrompt;if(i&&n.resolveDefaultPrompt)try{a=n.resolveDefaultPrompt()}catch(e){return{success:!1,message:`Default loop prompt could not be loaded: ${e instanceof Error?e.message:String(e)}`}}let o=jd(t,a);if(!o){if(/^\d+[a-z](?:\s|$)/i.test(t)||Ad(t))return{success:!1,message:Td};let n=(t||a||``).trim();if(!n||t===``&&n.length>Cd)return{success:!1,message:Td};if(!e.createSelfPacedLoop)return{success:!1,message:`Self-paced loops require a persistent interactive session.`};if(i){let t=await Pd(e,r,n);if(t)return t}let o=q.get(e)??0;if(Y(e).length+X(e).length+o>=3)return{success:!1,message:`At most 3 active loops are allowed. Stop one before creating another.`};q.set(e,o+1);try{let t=i?await e.createSelfPacedLoop(n,{useDefaultPrompt:!0}):await e.createSelfPacedLoop(n);return{success:!0,message:`Self-paced loop ${t.loopId} started. It will choose a 1–60 minute delay after each iteration and expires ${t.expiresAt}. Stop with /loop stop ${t.loopId}.`,data:{loopId:t.loopId,expiresAt:t.expiresAt}}}finally{let t=(q.get(e)??1)-1;t===0?q.delete(e):q.set(e,t)}}if(i){let t=await Pd(e,r,o.instruction);if(t)return t}let s=q.get(e)??0;if(Y(e).length+X(e).length+s>=3)return{success:!1,message:`At most 3 active loops are allowed. Stop one before creating another.`};let c=Md(o.requestedMs),l=`Loop: ${o.instruction.slice(0,48)}`,u=`loop_${h()}`,d=Sd(u,c),f=Date.now(),p=new Date(f+o.requestedMs).toISOString(),m=new Date(f+6048e5).toISOString();q.set(e,s+1);let g;try{g=await e.spawnScheduledWake({label:l,cronExpression:d.cronExpression,agentInstruction:o.instruction,sessionLoop:!0,sessionLoopId:u,...i?{sessionLoopDefaultPrompt:!0}:{},sessionLoopFirstAllowedAt:p,sessionLoopExpiresAt:m})}finally{let t=(q.get(e)??1)-1;t===0?q.delete(e):q.set(e,t)}let _=c.milliseconds===o.requestedMs?``:` (rounded up)`,v=g.kind===`scheduled`&&g.nextFireAt&&g.nextFireAt>=p?` Next fire: ${g.nextFireAt}.`:``;return{success:!0,message:`Loop ${u} uses a ${c.description}${_} local-clock step with stable offset +${d.jitterSeconds}s; elapsed gaps can change with daylight saving. First eligible at or after ${p}.${v} Expires: ${m}. Stop with /loop stop ${u}.`,data:{loopId:u,taskId:g.id,requestedMs:o.requestedMs,cadenceLabel:c.description,cronExpression:d.cronExpression,jitterSeconds:d.jitterSeconds,firstAllowedAt:p,expiresAt:m}}}const zd={s:1e3,m:6e4,h:36e5,d:864e5},Q=`Usage: /schedule in <N><s|m|h|d> <instruction> | /schedule cron "<expr>" <instruction>`;function Bd(e,t){let n=e.trim();if(n.length===0)return{ok:!1,error:Q};if(n.startsWith(`in `)){let e=n.slice(3).trim(),r=e.indexOf(` `);if(r===-1)return{ok:!1,error:`Missing instruction. ${Q}`};let i=e.slice(0,r),a=e.slice(r+1).trim(),o=/^(\d+)(s|m|h|d)$/.exec(i);if(!o)return{ok:!1,error:`Invalid duration "${i}". ${Q}`};if(a.length===0)return{ok:!1,error:`Missing instruction. ${Q}`};let s=parseInt(o[1],10)*zd[o[2]];return{ok:!0,spec:{cronExpression:new Date(t+s).toISOString(),instruction:a,recurring:!1}}}if(n.startsWith(`cron `)){let e=n.slice(5).trim(),t=/^["']([^"']+)["']\s+(\S.*)$/.exec(e);if(!t)return{ok:!1,error:`cron form needs a quoted expression. ${Q}`};let r=t[2].trim();return r.length===0?{ok:!1,error:`Missing instruction. ${Q}`}:{ok:!0,spec:{cronExpression:t[1].trim(),instruction:r,recurring:!0}}}return{ok:!1,error:Q}}function Vd(e,t){return`${e}: ${t.slice(0,48)}${t.length>48?`…`:``}`}const Hd=`Usage: /schedule list | pause <id> | resume <id> | edit <id> <spec> (or a create spec: in <N><s|m|h|d> … | cron "<expr>" …)`;function Ud(e){return e.length===0?`No schedules.`:e.map(e=>{let t=e.kind===`scheduled`?e.schedule?.cronExpression??`(unknown)`:`(unknown)`,n=e.kind===`scheduled`&&e.nextFireAt?`next ${e.nextFireAt}`:`—`;return`- ${e.id} [${e.status}] ${t} — ${e.label} (${n})`}).join(`
|
|
116
116
|
`)}async function Wd(e,t,n,r){if(t===`list`){let t=e.listSchedules();return{message:Ud(t),success:!0,data:{count:t.length}}}if(t===`pause`||t===`resume`){let r=n.split(/\s+/)[0];return r?t===`pause`?(await e.pauseSchedule(r),{message:`Schedule paused: ${r}`,success:!0,data:{taskId:r}}):(await e.resumeSchedule(r),{message:`Schedule resumed: ${r}`,success:!0,data:{taskId:r}}):{message:Hd,success:!1}}if(t===`edit`){let t=n.indexOf(` `),i=t===-1?n:n.slice(0,t),a=t===-1?``:n.slice(t+1).trim();if(!i||!a)return{message:Hd,success:!1};let o=Bd(a,r);return o.ok?(await e.editSchedule(i,{cronExpression:o.spec.cronExpression,agentInstruction:o.spec.instruction,label:Vd(`Scheduled`,o.spec.instruction)}),{message:`Schedule updated: ${i} (cron \`${o.spec.cronExpression}\`).`,success:!0,data:{taskId:i,cronExpression:o.spec.cronExpression}}):{message:o.error,success:!1}}}async function Gd(e,t,n=Date.now()){let r=t.trim(),i=r.indexOf(` `),a=await Wd(e,(i===-1?r:r.slice(0,i)).toLowerCase(),i===-1?``:r.slice(i+1).trim(),n);if(a)return a;let o=Bd(t,n);if(!o.ok)return{message:`${o.error}\n${Hd}`,success:!1};let{cronExpression:s,instruction:c,recurring:l}=o.spec,u=await e.spawnScheduledWake({label:Vd(`Scheduled`,c),cronExpression:s,agentInstruction:c});return{message:`Scheduled wake (${l?`cron \`${s}\``:`once at ${s}`}): "${c}" — task ${u.id}.`,success:!0,data:{taskId:u.id,cronExpression:s,recurring:l}}}function Kd(e){let t=/^["']([^"']+)["']\s+["']([^"']+)["']\s+(\S.*)$/.exec(e.trim());if(!t)return null;let n=t[3].trim();return n.length===0?null:{command:t[1],matchPattern:t[2],instruction:n}}async function qd(e,t){let n=Kd(t);if(!n)return{message:`Usage: /monitor "<command>" "<pattern>" <instruction>`,success:!1};let r;try{r=await e.spawnMonitorWake({label:Vd(`Monitor`,n.instruction),command:n.command,matchPattern:n.matchPattern,agentInstruction:n.instruction})}catch(e){if(e instanceof fe)return{message:e.message,success:!1};throw e}return{message:`Monitoring \`${n.command}\` for /${n.matchPattern}/ — task ${r.id}.`,success:!0,data:{taskId:r.id,matchPattern:n.matchPattern}}}function Jd(e){let t=e.getAgentJobCapability();if(!t)throw Error(`Scheduling requires an active agent runtime.`);return t}function Yd(){return{name:`schedule`,displayName:`Schedule Wake`,description:`Schedule the agent to wake on a timer, and manage schedules (list / pause / resume / edit).`,modelDescription:'Wake yourself later with an instruction. Use it when work must wait (a deploy, a long build, a reply) instead of polling: `in <N><s|m|h|d> <instruction>` or `cron "<expr>" <instruction>`; `list`, `pause`, `resume` and `edit` manage existing schedules. Returns the schedule id, or the schedule list.',source:`schedule`,argumentHint:`in <N><s|m|h|d> <instruction> | cron "<expr>" <instruction> | list | pause <id> | resume <id> | edit <id> <spec>`,modelInvocable:!0}}function Xd(){return{name:`monitor`,displayName:`Monitor Process`,description:`Watch a process’s output and wake the agent when a line matches a pattern.`,modelDescription:`Run a command in the background and wake yourself when a line of its output matches a pattern. Use it to wait for a server to start, a test to fail or a log line to appear instead of polling. The command is allowed, refused or asked about by the same permission rules as a shell tool call. Returns the monitor task id, or a refusal naming what the user must allow.`,source:`schedule`,argumentHint:`"<command>" "<pattern>" <instruction>`,modelInvocable:!0}}function Zd(){return{name:`loop`,displayName:`Repeat Prompt`,description:`Repeat a prompt on a fixed cadence or let each iteration choose its next delay; list or stop active loops.`,modelDescription:"Repeat a prompt on a fixed cadence (`<N><s|m|h|d> <prompt>`) or self-paced (`<prompt>`: each iteration chooses its next delay or stops). Use it when the user asks for recurring work in this session, and always give your own prompt: any form that would fall back to the host's default maintenance prompt — bare `/loop` or an interval alone (`<N><s|m|h|d>`) — needs a person to confirm it and is always refused for you, whether or not one is attached. `list` shows active loops; `stop <id>` ends one, even mid-turn. Returns the loop id and its next fire time, the loop list, or a refusal naming the command to suggest.",source:`schedule`,argumentHint:`[prompt] | <N><s|m|h|d> [prompt] | <prompt> every <N> <unit> | list | stop <id>`,modelInvocable:!0,subcommands:[{name:`list`,description:`List active loops`,source:`schedule`},{name:`stop`,description:`Stop an active loop`,source:`schedule`,argumentHint:`<id>`}]}}function Qd(){let e=Yd();return{name:e.name,displayName:e.displayName,description:e.description,...e.modelDescription===void 0?{}:{modelDescription:e.modelDescription},requiresPermission:!1,userInvocable:!0,modelInvocable:!0,argumentHint:e.argumentHint,lifecycle:`inline`,execute:(e,t)=>Gd(Jd(e),t)}}function $d(){let e=Xd();return{name:e.name,displayName:e.displayName,description:e.description,...e.modelDescription===void 0?{}:{modelDescription:e.modelDescription},requiresPermission:!0,modelRequiresPermission:!1,userInvocable:!0,modelInvocable:!0,argumentHint:e.argumentHint,lifecycle:`inline`,execute:(e,t)=>qd(Jd(e),t)}}function ef(e){let t=Zd();return{name:t.name,displayName:t.displayName,description:t.description,...t.modelDescription===void 0?{}:{modelDescription:t.modelDescription},requiresPermission:!0,userInvocable:!0,modelInvocable:!0,argumentHint:t.argumentHint,subcommands:t.subcommands,lifecycle:`inline`,execute:(t,n)=>Fd(Jd(t),(e,n)=>t.cancelBackgroundTask(e,n),n,e,{ui:t.getUserInteraction(),source:t.getCommandInvocationSource()})}}var tf=class{name=`schedule`;getCommands(){return[Yd(),Xd(),Zd()]}};function nf(e={}){return{name:`agent-command-schedule`,commandSources:[new tf],systemCommands:[Qd(),$d(),ef(e)],sessionRequirements:[`runtime`]}}function rf(e,t,n){return o(e,t,n)}function $(e){return e<.01?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function af(e){return e.toLocaleString(`en-US`)}const of=`Conversation cleared.`;function sf(e,t){let n=t.trim();return n===``?{success:!1,message:`Usage: /cd <directory>`}:{success:!0,message:``,hostActions:[{type:`workspace-move`,path:n}]}}async function cf(e,t){let n=e.getUserInteraction();return n&&!f(await n.ask(s(`clear`,`Clear conversation history?`)))?{success:!0,message:`Clear cancelled.`}:(qe(e),{success:!0,message:of})}function lf(e,t){let n=Rt(t);return n===void 0?{success:!1,message:xe}:{success:!0,message:`Session renamed to "${n}".`,data:{name:n},hostActions:[Qe(n)]}}function uf(){return{success:!0,message:`Opening session picker...`,data:{triggerResumePicker:!0},uiIntents:[et()]}}function df(e){return e.getCommandHostAdapters?.().costBudget}const ff=`Budget persistence is not available on this host (no cost-budget adapter was composed).`;function pf(e){return`Could not write the budget: ${e instanceof Error?e.message:String(e)}`}function mf(e,t){if(e.length===0)return;let n={inputTokens:0,outputTokens:0,partial:!1,models:[]},r=new Set,i=0,a=!1;for(let o of e){n.inputTokens+=o.promptTokens,n.outputTokens+=o.completionTokens;let e=o.source?.scope===`tool`,s=o.costUsd??(!e&&t?rf(t,o.promptTokens,o.completionTokens):void 0);if(s===void 0){n.partial=!0;continue}i+=s,a=!0,r.add(e?o.source?.label??`another model`:t??`main model`)}return a&&(n.costUsd=i),n.models=[...r],n}function hf(e){let t=e.getSession(),n=qt(e),r=t.getModelId(),i=mf(e.getSessionUsage(),r),a=[`Session: ${n.sessionId}`,`Messages: ${n.messageCount}`],o={sessionId:n.sessionId,messageCount:n.messageCount};if(i){a.push(`Tokens: ${af(i.inputTokens)} input / ${af(i.outputTokens)} output`),o.inputTokens=i.inputTokens,o.outputTokens=i.outputTokens;let t=i.costUsd;if(t!==void 0){let n=i.models.length>1?`mixed: ${i.models.join(`, `)}`:i.models[0]??``,r=i.partial?`; some usage could not be priced`:``;a.push(`Cost: ${$(t)} (${n}${r})`),o.estimatedCostUsd=t,o.costModels=i.models,i.partial&&(o.costPartial=!0);let s=df(e)?.read();if(s?.monthly){let e=s.monthly-t,n=Math.min(100,Math.round(t/s.monthly*100));a.push(`Budget: ${$(e)} remaining of ${$(s.monthly)}/mo (${n}% used)`),o.budgetMonthly=s.monthly,o.budgetRemainingUsd=e}}}else a.push(`Tokens: not yet available (no turns completed)`);return{lines:a,data:o}}function gf(e,t){let n=t.trim();if(n.startsWith(`budget`)){let t=n.slice(6).trim(),r=t===`clear`||t===``?void 0:parseFloat(t);if(r!==void 0&&(!Number.isFinite(r)||r<=0))return{success:!1,message:`Usage: /cost budget <amount> (e.g. /cost budget 5.00)`};let i=df(e);if(i===void 0)return{success:!1,message:ff};if(t===`clear`){try{i.clear()}catch(e){return{success:!1,message:pf(e)}}return{success:!0,message:`Monthly budget cleared.`}}if(t===``){let e=i.read();return e?.monthly?{success:!0,message:`Monthly budget: ${$(e.monthly)}`}:{success:!0,message:`No budget set. Use: /cost budget <amount>`}}if(r===void 0)return{success:!1,message:ff};try{i.write({monthly:r})}catch(e){return{success:!1,message:pf(e)}}return{success:!0,message:`Monthly budget set to ${$(r)}.`}}let{lines:r,data:i}=hf(e);return{success:!0,message:r.join(`
|
|
117
|
-
`),data:i}}function _f(e,t){return e===`no-keys`?`The session log is sealed and this process has no keys to open it, so it cannot be validated here.`:`The session log is sealed and locked; ${t===void 0?`unlock`:`run \`${t}\``} to validate it.`}function vf(e,t){let n;try{n=bn(e)}catch(t){if(!d(t))throw t;return{success:!1,message:_f(t.reason===`no-keys`?`no-keys`:`locked`,Zn(e))}}return{success:n.validation.ok,message:ft(n),data:{logFile:n.logFile,entryCount:n.entryCount,issueCount:n.validation.issues.length,ok:n.validation.ok}}}function yf(){return{name:`clear`,displayName:`Clear History`,description:S,source:`session`,modelInvocable:!1,userInvocable:!0}}function bf(){return{name:`rename`,displayName:`Rename Session`,description:be,argumentHint:`<name>`,source:`session`,modelInvocable:!1,userInvocable:!0}}function xf(){return{name:`cd`,displayName:`Change Directory`,description:`Move this session to another working directory`,argumentHint:`<directory>`,source:`session`,modelInvocable:!1,userInvocable:!0}}function Sf(){return{name:`resume`,displayName:`Resume Session`,description:Se,source:`session`,modelInvocable:!1,userInvocable:!0}}function Cf(){return{name:`cost`,displayName:`Session Cost`,description:C,modelDescription:"Report this session’s token usage and estimated cost. Use it before an expensive step (a large refactor, many subagents) or when the user asks what the session has cost. Returns the message count, input/output token totals and the estimated USD cost, with the remaining monthly budget when one is set. Setting or clearing the budget is the user’s decision: suggest `/cost budget <amount>`.",argumentHint:`[budget [<amount>|clear]]`,runsBare:!0,source:`session`,modelInvocable:!0,userInvocable:!0,subcommands:[{name:`budget`,description:`Show, set, or clear the monthly budget`,argumentHint:`[<amount>|clear]`,source:`session`,modelInvocable:!1}]}}function wf(){return{name:`validate-session`,displayName:`Validate Session`,description:ke,source:`session`,modelInvocable:!1,userInvocable:!0}}function Tf(){return A(yf(),{requiresPermission:!1,lifecycle:`inline`,execute:cf})}function Ef(){return A(bf(),{requiresPermission:!1,lifecycle:`inline`,execute:lf})}function Df(){return A(xf(),{requiresPermission:!1,lifecycle:`inline`,execute:sf})}function Of(){return A(Sf(),{requiresPermission:!1,lifecycle:`inline`,execute:uf})}function kf(){return A(Cf(),{requiresPermission:!1,lifecycle:`inline`,execute:gf})}function Af(){return A(wf(),{requiresPermission:!1,lifecycle:`inline`,execute:vf})}
|
|
118
|
-
`):[`Registered skills:`,...e.map(
|
|
119
|
-
`)}function
|
|
120
|
-
`);function
|
|
121
|
-
`)}function
|
|
122
|
-
`)}async function
|
|
123
|
-
//# sourceMappingURL=command-
|
|
117
|
+
`),data:i}}function _f(e,t){return e===`no-keys`?`The session log is sealed and this process has no keys to open it, so it cannot be validated here.`:`The session log is sealed and locked; ${t===void 0?`unlock`:`run \`${t}\``} to validate it.`}function vf(e,t){let n;try{n=bn(e)}catch(t){if(!d(t))throw t;return{success:!1,message:_f(t.reason===`no-keys`?`no-keys`:`locked`,Zn(e))}}return{success:n.validation.ok,message:ft(n),data:{logFile:n.logFile,entryCount:n.entryCount,issueCount:n.validation.issues.length,ok:n.validation.ok}}}function yf(){return{name:`clear`,displayName:`Clear History`,description:S,source:`session`,modelInvocable:!1,userInvocable:!0}}function bf(){return{name:`rename`,displayName:`Rename Session`,description:be,argumentHint:`<name>`,source:`session`,modelInvocable:!1,userInvocable:!0}}function xf(){return{name:`cd`,displayName:`Change Directory`,description:`Move this session to another working directory`,argumentHint:`<directory>`,source:`session`,modelInvocable:!1,userInvocable:!0}}function Sf(){return{name:`resume`,displayName:`Resume Session`,description:Se,source:`session`,modelInvocable:!1,userInvocable:!0}}function Cf(){return{name:`cost`,displayName:`Session Cost`,description:C,modelDescription:"Report this session’s token usage and estimated cost. Use it before an expensive step (a large refactor, many subagents) or when the user asks what the session has cost. Returns the message count, input/output token totals and the estimated USD cost, with the remaining monthly budget when one is set. Setting or clearing the budget is the user’s decision: suggest `/cost budget <amount>`.",argumentHint:`[budget [<amount>|clear]]`,runsBare:!0,source:`session`,modelInvocable:!0,userInvocable:!0,subcommands:[{name:`budget`,description:`Show, set, or clear the monthly budget`,argumentHint:`[<amount>|clear]`,source:`session`,modelInvocable:!1}]}}function wf(){return{name:`validate-session`,displayName:`Validate Session`,description:ke,source:`session`,modelInvocable:!1,userInvocable:!0}}function Tf(){return A(yf(),{requiresPermission:!1,lifecycle:`inline`,execute:cf})}function Ef(){return A(bf(),{requiresPermission:!1,lifecycle:`inline`,execute:lf})}function Df(){return A(xf(),{requiresPermission:!1,lifecycle:`inline`,execute:sf})}function Of(){return A(Sf(),{requiresPermission:!1,lifecycle:`inline`,execute:uf})}function kf(){return A(Cf(),{requiresPermission:!1,lifecycle:`inline`,execute:gf})}function Af(){return A(wf(),{requiresPermission:!1,lifecycle:`inline`,execute:vf})}const jf=[[yf,Tf],[bf,Ef],[xf,Df],[Sf,Of],[Cf,kf],[wf,Af]];function Mf(e){let t=e?.only;return t===void 0?jf:jf.filter(([e])=>t.includes(e().name))}var Nf=class{options;name=`session`;constructor(e){this.options=e}getCommands(){return Mf(this.options).map(([e])=>e())}};function Pf(e){return{name:`agent-command-session`,commandSources:[new Nf(e)],systemCommands:Mf(e).map(([,e])=>e())}}function Ff(){return{name:`settings`,displayName:`Settings`,description:`Open settings — language, output style, preset, permissions and more`,source:`settings`,modelInvocable:!1}}function If(){let e=Ff();return{name:e.name,displayName:e.displayName,description:e.description,requiresPermission:!1,userInvocable:!0,modelInvocable:!1,lifecycle:`inline`,execute:async()=>({success:!0,message:`Opening settings...`,uiIntents:[{type:`show-settings`}]})}}var Lf=class{name=`settings`;getCommands(){return[Ff()]}};function Rf(){return{name:`agent-command-settings`,commandSources:[new Lf],systemCommands:[If()]}}function zf(){return{name:`skill-read`,description:`Read a supporting file from a skill active in this execution`,modelDescription:`Read verified supporting bytes from a skill already activated in this execution. Use when its instructions refer to a resource in the returned manifest. Args are a JSON array ["<skill-name>", "<resource-uri>"]. Returns the verified URI, digest, size and text or base64 blob with optional MIME type. This does not activate nested skills or grant consent; unactivated skills, undeclared resources and ended executions are refused. Binary blobs are returned as encoded data, not a rendered image.`,argumentHint:`["<skill-name>", "<resource-uri>"]`,source:`skills`,userInvocable:!0,modelInvocable:!0,safety:`read-only`}}async function Bf(e,t=``){let n;try{n=JSON.parse(t)}catch{return{success:!1,message:`Use /skill-read ["<skill-name>", "<resource-uri>"]`}}if(!Array.isArray(n)||n.length!==2||n.some(e=>typeof e!=`string`||!e.length))return{success:!1,message:`Use /skill-read ["<skill-name>", "<resource-uri>"]`};if(!e.readSkillResource)return{success:!1,message:`This host does not provide active skill resource reads.`};try{let t=await e.readSkillResource(n[0],n[1]);return{success:!0,message:`Read verified skill resource: ${t.uri}`,data:{...t}}}catch(e){return{success:!1,message:`Skill resource read refused: ${e instanceof Error?e.message:`host refused the read`}`}}}function Vf(){return{...zf(),semanticRole:`skillResourceRead`,requiresPermission:!1,lifecycle:`inline`,execute:Bf}}const Hf=`List registered skills, or activate one by name`;function Uf(e){let t=[];return e.modelInvocable||t.push(`model-disabled`),e.userInvocable||t.push(`model-only`),e.context&&t.push(`context:${e.context}`),e.agent&&t.push(`agent:${e.agent}`),t.length>0?` [${t.join(`, `)}]`:``}function Wf(e){let t=e.argumentHint?` ${e.argumentHint}`:``;return`- ${e.name}${t}: ${e.description}${Uf(e)}`}function Gf(e){return e.length===0?[`No skills are registered for this session.`,``,`Skills are metadata until activated. Do not invent or imitate a skill workflow when no matching registered skill exists.`].join(`
|
|
118
|
+
`):[`Registered skills:`,...e.map(Wf),``,`Activation contract:`,`- Use /skills <skill-name> [args] to activate a matching skill.`,`- Treat /<skill-name> as a virtual alias for /skills <skill-name>.`,`- The system prompt Skills section is skill selection metadata.`,`- Treat descriptions as selection metadata only, not as loaded SKILL.md content.`,`- Do not answer by merely naming, recommending, or imitating a matching skill.`,`- If no listed skill matches the task, continue without claiming a skill was activated.`].join(`
|
|
119
|
+
`)}function Kf(e){let t=e.trim();if(t.length===0||t===`list`)return{action:`list`,skillArgs:``};let[n=``,...r]=t.split(/\s+/);return n.length===0?{action:`list`,skillArgs:``}:{action:`activate`,skillName:n,skillArgs:r.join(` `)}}async function qf(e,t=``){let n=Kf(t);if(n.action===`activate`&&n.skillName!==void 0){let t=`/${n.skillName}${n.skillArgs?` ${n.skillArgs}`:``}`;return await e.executeSkillCommandByName(n.skillName,n.skillArgs,{invocationSource:e.getCommandInvocationSource(),displayInput:t,rawInput:t})??{success:!1,message:`Unknown skill: ${n.skillName}`}}let r=e.listSkills();return{success:!0,message:Gf(r),data:{skills:r,activationContract:{activateWith:`/skills <skill-name> [args]`,activationRequiredBeforeWorkflow:!0,metadataIsNotSkillContent:!0}}}}function Jf(){return{name:`skills`,displayName:`Skills`,description:Hf,modelDescription:`Skill command. Before following a matching registered skill from the system prompt Skills section, invoke the projected skills command tool with args "<skill-name> [args]". Without arguments, list registered skills. With a skill name, activate that skill; a skill that declares it is not model-invocable is refused. Returns the skill list with each skill's description, or the activated skill's instructions to follow. Slash syntax is a UI input/display concern; the SDK command identity is "skills".`,source:`skills`,modelInvocable:!0,userInvocable:!0,argumentHint:`[list | <skill-name> [args]]`,safety:`read-only`}}function Yf(){let e=Jf();return{name:e.name,semanticRole:`skillActivation`,...e.modelDescription===void 0?{}:{modelDescription:e.modelDescription},displayName:e.displayName,description:e.description,requiresPermission:!1,userInvocable:!0,modelInvocable:!0,argumentHint:e.argumentHint,safety:e.safety,lifecycle:`inline`,execute:qf}}var Xf=class{name=`skills`;getCommands(){return[Jf(),zf()]}};function Zf(e){let t=[new Xf];return t.push(new Oe(e.contributionSources,e.skillRoots??[])),{name:`agent-command-skills`,commandSources:t,systemCommands:[Yf(),Vf()]}}const Qf=[`Usage: /statusline on | off | reset | git on | git off`,`Fields: model, context, permission mode, message count, session name, thinking state, git branch.`].join(`
|
|
120
|
+
`);function $f(e){let t=e.trim().toLowerCase().split(/\s+/).filter(e=>e.length>0),[n,r]=t;return n===`on`&&r===void 0?{success:!0,message:`Status line enabled.`,patch:{enabled:!0}}:n===`off`&&r===void 0?{success:!0,message:`Status line disabled.`,patch:{enabled:!1}}:n===`reset`&&r===void 0?{success:!0,message:`Status line settings reset.`,patch:{...E}}:n===`git`&&r===`on`&&t.length===2?{success:!0,message:`Status line git branch shown.`,patch:{gitBranch:!0}}:n===`git`&&r===`off`&&t.length===2?{success:!0,message:`Status line git branch hidden.`,patch:{gitBranch:!1}}:{success:!1,message:Qf}}function ep(e,t){let n=$f(t);return n.success?{success:!0,message:n.message,hostActions:[{type:`statusline-settings-patch`,patch:n.patch}]}:{success:!1,message:n.message}}function tp(){return{name:`statusline`,displayName:`Status Line`,description:Ee,source:`statusline`,argumentHint:Te,subcommands:Ue(`statusline`),modelInvocable:!1}}function np(){let e=tp();return{name:e.name,displayName:e.displayName,description:e.description,requiresPermission:!1,userInvocable:!0,modelInvocable:!1,argumentHint:e.argumentHint,subcommands:e.subcommands,lifecycle:`inline`,execute:ep}}var rp=class{name=`statusline`;getCommands(){return[tp()]}};function ip(){return{name:`agent-command-statusline`,commandSources:[new rp],systemCommands:[np()]}}const ap=`Inspect user-local storage and memory state.`,op=`storage list [--format json] | memory set/list/inspect/disable/delete`,sp=`Usage: user-local storage list [--format json] | user-local memory set <category> <key> <value> --summary <summary> --source <source> | user-local memory list [--format json] | user-local memory inspect <category> <key> [--format json] | user-local memory disable <category> <key> | user-local memory delete <category> <key>`;function cp(e){return e.length===0?`No user-local memory items.`:e.map(e=>`- ${e.category}/${e.key} (${e.enabled?`enabled`:`disabled`})`).join(`
|
|
121
|
+
`)}function lp(e){if(e===void 0)throw Error(`User-local memory category is required.`);return e}async function up(e,t,n,r){let i=await jt({activeRepositoryRoot:e,storageRoot:t,fsAsync:n});return{message:r.format===`json`?JSON.stringify(i,null,2):cp(i.items),success:!0,data:{list:i}}}async function dp(e,t,n,r){let[i,a,o]=r.positional,s=await pn({activeRepositoryRoot:e,storageRoot:t,fsAsync:n,category:lp(i),key:a??``,value:o??``,summary:r.summary??``,source:r.source??``});return{message:`Stored user-local memory item ${s.category}/${s.key} at ${s.storageLocation}`,success:!0,data:{item:s}}}async function fp(e,t,n,r){let[i,a]=r.positional,o=await bt({activeRepositoryRoot:e,storageRoot:t,fsAsync:n,category:lp(i),key:a??``});return{message:r.format===`json`?JSON.stringify(o,null,2):`${o.category}/${o.key}: ${o.summary}`,success:!0,data:{item:o}}}async function pp(e,t,n,r){let[i,a]=r.positional,o=await rt({activeRepositoryRoot:e,storageRoot:t,fsAsync:n,category:lp(i),key:a??``});return{message:`Disabled user-local memory item ${o.category}/${o.key}`,success:!0,data:{item:o}}}async function mp(e,t,n,r){let[i,a]=r.positional,o=await nt({activeRepositoryRoot:e,storageRoot:t,fsAsync:n,category:lp(i),key:a??``});return{message:`Deleted user-local memory item ${o.category}/${o.key}`,success:!0,data:{result:o}}}async function hp(e,t,n,r){return(r.action??`list`)===`list`?up(e,t,n,r):r.action===`set`?dp(e,t,n,r):r.action===`inspect`?fp(e,t,n,r):r.action===`disable`?pp(e,t,n,r):r.action===`delete`?mp(e,t,n,r):{message:sp,success:!1}}function gp(e){if(e===void 0||e===`text`)return`text`;if(e===`json`)return`json`;throw Error(`Unsupported user-local output format: ${e}`)}function _p(e,t,n){return e===`--format`?{format:t[n+1],nextIndex:n+1}:e.startsWith(`--format=`)?{format:e.slice(9),nextIndex:n}:e===`--summary`?{summary:t[n+1],nextIndex:n+1}:e.startsWith(`--summary=`)?{summary:e.slice(10),nextIndex:n}:e===`--source`?{source:t[n+1],nextIndex:n+1}:e.startsWith(`--source=`)?{source:e.slice(9),nextIndex:n}:null}function vp(e,t={}){let n=t.format,r=t.summary,i=t.source,a=[];for(let t=0;t<e.length;t+=1){let o=e[t],s=_p(o,e,t);if(s!==null){n=s.format??n,r=s.summary??r,i=s.source??i,t=s.nextIndex;continue}a.push(o)}return{target:a[0],action:a[1],positional:a.slice(2),format:gp(n),summary:r,source:i}}function yp(e){return e.trim().split(/\s+/).filter(Boolean)}function bp(e,t){let n=t.map(e=>`- ${e.category}`);return[`User-local storage root: ${e}`,`Categories:`,...n].join(`
|
|
122
|
+
`)}async function xp(e,t,n,r){if((r.action??`list`)!==`list`)return{message:sp,success:!1};let i=await xt({activeRepositoryRoot:e,storageRoot:t,fsAsync:n});return{message:r.format===`json`?JSON.stringify(i,null,2):bp(i.root,i.categories),success:!0,data:{root:i.root,categories:i.categories,inspection:i}}}async function Sp(e,t,n,r){return n===void 0?{message:`/user-local is unavailable on this host: it supplies no file system.`,success:!1}:r.target===`storage`?xp(e,t,n,r):r.target===`memory`?hp(e,t,n,r):{message:sp,success:!1}}function Cp(e){return e.includes(`ENOENT`)?`User-local memory item not found.`:e}async function wp(e){try{return await Sp(e.cwd,e.storageRoot,e.fsAsync,vp(e.argv,{format:e.format,summary:e.summary,source:e.source}))}catch(e){return{message:Cp(e instanceof Error?e.message:String(e)),success:!1}}}async function Tp(e,t,n,r){try{return await Sp(e.getCwd(),n,r,vp(yp(t)))}catch(e){return{message:Cp(e instanceof Error?e.message:String(e)),success:!1}}}function Ep(){return{name:`user-local`,displayName:`User Config`,description:ap,source:`user-local`,argumentHint:op,modelInvocable:!1,safety:`read-only`,subcommands:[{name:`storage`,description:`Inspect user-local storage categories`,source:`user-local`},{name:`memory`,description:`Inspect and manage user-local memory items`,source:`user-local`}]}}function Dp(e,t){let n=Ep();return{name:n.name,displayName:n.displayName,description:n.description,requiresPermission:!1,userInvocable:!0,modelInvocable:!1,argumentHint:n.argumentHint,safety:n.safety,subcommands:n.subcommands,execute:(n,r)=>Tp(n,r,e,t)}}var Op=class{name=`user-local`;getCommands(){return[Ep()]}};function kp(e,t){return{name:`agent-command-user-local`,commandSources:[new Op],systemCommands:[Dp(e,t)]}}function Ap(e,t,n){return un(e,t,n)}function jp({cwd:e,userLocalStorageRoot:r,userLocalFileSystem:i,contributionSources:a,skillRoots:o,providerDefinitions:s,providerSettingsAdapter:c,orgPolicy:l,keybindingsFilePort:u,keybindingsEditor:d,themeCataloguePort:f,devicesPort:p,keyCustodyPort:m,doctorInputs:h,doctorDeps:g,doctorDisplay:_,gitProcess:v,formatForkResumeCommand:y,loopOptions:b,enabledCommandModules:x,disabledCommandModules:S,providerEnvironment:C,providerConnectionHost:w,providerCredentialResolver:T,missingEnvironmentCredentialHint:E}){let ee=[Zf({contributionSources:a??[],skillRoots:o}),xo(),rr(),Sa(),ua(),Bc(),Rs(),oc(),wl(),hc(),Fo(),lr(),La(y),so(),Kc(),eo({port:v}),n(u,d),t(f),...h===void 0?[]:[ra(h,g,_)],ks(),ms(),kp(r,i),hr(),Hr(),Da(),Pf(),$u(),xd(),nf(b),ip(),fl(),Rf(),Ic(),Cc(),go(),Ju(),...p===void 0?[]:[Qr(p)],...m===void 0?[]:[ko(m)],Mu({providerDefinitions:s,settings:c,...l===void 0?{}:{orgPolicy:l},...C===void 0?{}:{env:C},...w===void 0?{}:{connectionHost:w},...T===void 0?{}:{resolveCredential:T},...E===void 0?{}:{missingEnvironmentCredentialHint:E}}),Zs({providerDefinitions:s,settings:c,...l===void 0?{}:{orgPolicy:l},...C===void 0?{}:{env:C},...T===void 0?{}:{resolveCredential:T},...E===void 0?{}:{missingEnvironmentCredentialHint:E}})],te=ee.map(e=>e.name);return{modules:Ap(ee,x,S),unknownModuleNames:st(te,x,S)}}export{Ju as $,ni as $n,ps as $t,of as A,Da as An,Bc as At,nf as B,oa as Bn,Xs as Bt,Nf as C,ro as Cn,fl as Ct,Sf as D,Za as Dn,Kc as Dt,bf as E,eo as En,ol as Et,vf as F,_a as Fn,ac as Ft,bd as G,Zi as Gn,Fs as Gt,Gd as H,Qi as Hn,Zs as Ht,tf as I,la as In,oc as It,Xu as J,Mi as Jn,Ms as Jt,xd as K,ji as Kn,Rs as Kt,Zd as L,sa as Ln,B as Lt,gf as M,xa as Mn,fc as Mt,lf as N,ya as Nn,hc as Nt,Pf as O,Ea as On,zc as Ot,uf as P,Sa as Pn,dc as Pt,Gu as Q,ci as Qn,Ts as Qt,Xd as R,ua as Rn,tc as Rt,Rf as S,to as Sn,sl as St,Cf as T,Xa as Tn,al as Tt,Bd as U,ra as Un,Hs as Ut,qd as V,$i as Vn,Js as Vt,Fd as W,Yi as Wn,Ls as Wt,Yu as X,Ii as Xn,Es as Xt,$u as Y,Ni as Yn,Os as Yt,qu as Z,ui as Zn,ks as Zt,Zf as _,go as _n,Yn as _r,Cl as _t,Tp as a,zo as an,mr as ar,Mu as at,Lf as b,io as bn,yl as bt,ap as c,Fo as cn,dr as cr,Ml as ct,tp as d,bo as dn,lr as dr,Tl as dt,us as en,Qr as er,Wu as et,ip as f,vo as fn,ar as fr,Dl as ft,Jf as g,po as gn,tr as gr,Fl as gt,Xf as h,ho as hn,rr as hr,Ol as ht,kp as i,Io as in,Ar as ir,ku as it,cf as j,Ca as jn,mc as jt,wf as k,wa as kn,Lc as kt,sp as l,jo as ln,cr as lr,Nl as lt,ep as m,_o as mn,er as mr,kl as mt,Op as n,$o as nn,zr as nr,Iu as nt,wp as o,Po as on,fr as or,Su as ot,Qf as p,xo as pn,nr as pr,El as pt,_d as q,Li as qn,Ps as qt,Ep as r,Bo as rn,Hr as rr,Au as rt,op as s,Mo as sn,hr as sr,U as st,jp as t,ms as tn,Vr as tr,Lu as tt,rp as u,ko as un,or as ur,Al as ut,Hf as v,uo as vn,xl as vt,yf as w,$a as wn,cl as wt,Ff as x,so as xn,dl as xt,qf as y,oo as yn,wl as yt,Yd as z,ia as zn,$s as zt};
|
|
123
|
+
//# sourceMappingURL=command-BXOf0yNQ.js.map
|