@robota-sdk/agent-command 3.0.0-beta.64
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/LICENSE +21 -0
- package/dist/node/index.cjs +30 -0
- package/dist/node/index.d.ts +293 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +31 -0
- package/dist/node/index.js.map +1 -0
- package/package.json +48 -0
- package/src/agent/__tests__/agent-command.test.ts +504 -0
- package/src/agent/agent-command-module.ts +82 -0
- package/src/agent/agent-command-parser.ts +180 -0
- package/src/agent/agent-command.ts +235 -0
- package/src/agent/index.ts +7 -0
- package/src/background/__tests__/background-command-module.test.ts +255 -0
- package/src/background/background-command-module.ts +53 -0
- package/src/background/background-command.ts +63 -0
- package/src/background/index.ts +6 -0
- package/src/compact/__tests__/compact-command-module.test.ts +162 -0
- package/src/compact/compact-command-module.ts +51 -0
- package/src/compact/compact-command.ts +21 -0
- package/src/compact/index.ts +6 -0
- package/src/context/__tests__/context-command-module.test.ts +294 -0
- package/src/context/context-command-module.ts +54 -0
- package/src/context/context-command.ts +298 -0
- package/src/context/index.ts +6 -0
- package/src/exit/__tests__/exit-command-module.test.ts +35 -0
- package/src/exit/exit-command-module.ts +48 -0
- package/src/exit/exit-command.ts +10 -0
- package/src/exit/index.ts +6 -0
- package/src/help/__tests__/help-command-module.test.ts +106 -0
- package/src/help/help-command-module.ts +48 -0
- package/src/help/help-command.ts +9 -0
- package/src/help/index.ts +6 -0
- package/src/index.ts +20 -0
- package/src/language/__tests__/language-command-module.test.ts +105 -0
- package/src/language/index.ts +6 -0
- package/src/language/language-command-module.ts +56 -0
- package/src/language/language-command.ts +22 -0
- package/src/memory/__tests__/memory-command-module.test.ts +272 -0
- package/src/memory/index.ts +6 -0
- package/src/memory/memory-command-module.ts +57 -0
- package/src/memory/memory-command.ts +234 -0
- package/src/mode/__tests__/mode-command-module.test.ts +143 -0
- package/src/mode/index.ts +6 -0
- package/src/mode/mode-command-module.ts +56 -0
- package/src/mode/mode-command.ts +34 -0
- package/src/model/__tests__/model-command-module.test.ts +273 -0
- package/src/model/index.ts +6 -0
- package/src/model/model-command-module.ts +68 -0
- package/src/model/model-command.ts +40 -0
- package/src/permissions/__tests__/permissions-command-module.test.ts +164 -0
- package/src/permissions/index.ts +6 -0
- package/src/permissions/permissions-command-module.ts +56 -0
- package/src/permissions/permissions-command.ts +45 -0
- package/src/plugin/__tests__/plugin-command-module.test.ts +214 -0
- package/src/plugin/index.ts +7 -0
- package/src/plugin/plugin-command-module.ts +81 -0
- package/src/plugin/plugin-command.ts +230 -0
- package/src/provider/__tests__/provider-command-module.test.ts +488 -0
- package/src/provider/__tests__/provider-setup-flow.test.ts +43 -0
- package/src/provider/index.ts +30 -0
- package/src/provider/provider-command-execution.ts +150 -0
- package/src/provider/provider-command-module.ts +65 -0
- package/src/provider/provider-command-profile-lifecycle.ts +211 -0
- package/src/provider/provider-command-profile-operations.ts +198 -0
- package/src/provider/provider-command-profile.ts +109 -0
- package/src/provider/provider-command-setup.ts +104 -0
- package/src/provider/provider-setup-flow.ts +309 -0
- package/src/reset/__tests__/reset-command-module.test.ts +63 -0
- package/src/reset/index.ts +2 -0
- package/src/reset/reset-command-module.ts +49 -0
- package/src/reset/reset-command.ts +10 -0
- package/src/rewind/__tests__/rewind-command-module.test.ts +215 -0
- package/src/rewind/index.ts +2 -0
- package/src/rewind/rewind-command-module.ts +57 -0
- package/src/rewind/rewind-command.ts +184 -0
- package/src/session/__tests__/session-command-module.test.ts +339 -0
- package/src/session/index.ts +17 -0
- package/src/session/session-command-module.ts +168 -0
- package/src/session/session-command.ts +74 -0
- package/src/settings/index.ts +7 -0
- package/src/settings/settings-command-module.ts +50 -0
- package/src/skills/__tests__/skills-command-module.test.ts +157 -0
- package/src/skills/index.ts +6 -0
- package/src/skills/skills-command-module.ts +62 -0
- package/src/skills/skills-command.ts +110 -0
- package/src/statusline/__tests__/statusline-command-module.test.ts +95 -0
- package/src/statusline/index.ts +6 -0
- package/src/statusline/statusline-command-module.ts +56 -0
- package/src/statusline/statusline-command.ts +79 -0
- package/src/user-local/__tests__/user-local-command.test.ts +145 -0
- package/src/user-local/index.ts +13 -0
- package/src/user-local/user-local-command-constants.ts +5 -0
- package/src/user-local/user-local-command-module.ts +67 -0
- package/src/user-local/user-local-command.ts +205 -0
- package/src/user-local/user-local-memory-command.ts +147 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Robota Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`@robota-sdk/agent-framework`),t=require(`@robota-sdk/agent-core`);function n(e){let t=[],n=``,r,i=!1;for(let a of e){if(i){n+=a,i=!1;continue}if(r&&a===`\\`){i=!0;continue}if(r){a===r?r=void 0:n+=a;continue}if(a===`"`||a===`'`){r=a;continue}if(/\s/.test(a)){n.length>0&&(t.push(n),n=``);continue}n+=a}return n.length>0&&t.push(n),t}function r(e){let t=[],n,r,i;for(let a=0;a<e.length;a+=1){let o=e[a];if(o!==`--background`){if(o===`--agent`||o===`--type`||o===`-a`){n=e[a+1],a+=1;continue}if(o===`--model`){r=e[a+1],a+=1;continue}if(o===`--isolation`){let t=e[a+1];(t===`none`||t===`worktree`)&&(i=t),a+=1;continue}o!==void 0&&t.push(o)}}return{positional:t,...n?{agentType:n}:{},...r?{model:r}:{},...i?{isolation:i}:{}}}function i(e,t,n,r){return{agentType:t,label:n,mode:`background`,prompt:r,...e.model?{model:e.model}:{},...e.isolation?{isolation:e.isolation}:{}}}function a(e,t){let n=r(e),[a,...o]=n.positional,s=n.agentType??`general-purpose`,c=n.positional;!n.agentType&&a&&t.has(a)&&(s=a,c=o);let l=c.join(` `).trim();if(l)return i(n,s,s,l)}function o(e,t){let n=r(e);return n.positional.map(e=>s(e,n,t)).filter(e=>e!==void 0)}function s(e,t,n){let r=e.indexOf(`=`);if(r>0)return c(e.slice(0,r),e.slice(r+1),t,n);let a=e.indexOf(`:`);if(a<=0||a===e.length-1)return;let o=e.slice(0,a),s=e.slice(a+1);return i(t,t.agentType??(n.has(o)?o:`general-purpose`),o,s)}function c(e,t,n,r){let a=t.indexOf(`:`);if(a===-1)return i(n,n.agentType??(r.has(e)?e:`general-purpose`),e,t);if(!(a===0||a===t.length-1))return i(n,t.slice(0,a),e,t.slice(a+1))}function l(e){return e instanceof Error?e.message:String(e)}function ee(e){return new Set(e.listAgentDefinitions().map(e=>e.name))}function te(e,t){let n=e.listAgentDefinitions();if(!n.some(e=>e.name===t))return{message:`Unknown agent type: ${t}\nAvailable agents: ${n.map(e=>e.name).join(`, `)}`,success:!1}}async function ne(e,t){let n=te(e,t.agentType);if(n)return n;try{return{state:await e.spawnAgentJob(t)}}catch(e){return{message:l(e),success:!1}}}function re(){return{message:``,effects:[{type:`agent-switcher-requested`}],success:!0}}async function ie(e){let t=e.listAgentDefinitions(),n=e.listAgentJobs();return{message:[`Available agents:`,...t.map(e=>` ${e.name} - ${e.description}`),``,n.length===0?`No active agent jobs.`:`Agent jobs:`,...n.map(e=>` ${ae(e)}`)].join(`
|
|
2
|
+
`),success:!0,data:{agents:t.length,jobs:n.length}}}function ae(e){let t=[e.worktreePath?`worktree=${e.worktreePath}`:void 0,e.branchName?`branch=${e.branchName}`:void 0].filter(e=>e!==void 0),n=t.length>0?` ${t.join(` `)}`:``;return`${e.id} [${e.status}${n}] ${e.label} - ${e.promptPreview}`}async function oe(e,t){let n=a(t,ee(e));if(!n)return{message:`Usage: agent run [AGENT_NAME] [--agent AGENT_NAME] PROMPT`,success:!1};let r=await ne(e,n);if(`success`in r)return r;let{state:i}=r;return{message:`Started agent job: ${i.id}`,success:!0,data:{agentId:i.id,status:i.status}}}async function se(t,n){let r=n.includes(`--wait`)||!n.includes(`--detach`),i=o(n.filter(e=>e!==`--wait`&&e!==`--detach`),ee(t));if(i.length===0)return{message:`Usage: agent parallel [--wait|--detach] LABEL:"PROMPT" [LABEL=AGENT_NAME:"PROMPT"]`,success:!1};let a=i.map(e=>te(t,e.agentType)).find(e=>e!==void 0);if(a)return a;let s;try{s=await Promise.all(i.map(e=>t.spawnAgentJob(e)))}catch(e){return{message:l(e),success:!1}}let c=t.createBackgroundJobGroup({waitPolicy:`wait_all`,taskIds:s.map(e=>e.id),label:`agent parallel`});if(r){let n=(0,e.summarizeBackgroundJobGroup)(await t.waitBackgroundJobGroup(c.id));return{message:me(n),success:!0,data:{agentIds:s.map(e=>e.id),groupId:c.id,summary:n}}}return{message:[`Started agent jobs:`,...s.map(e=>`${e.label}: ${e.id}`)].join(`
|
|
3
|
+
`),success:!0,data:{agentIds:s.map(e=>e.id),groupId:c.id}}}async function ce(t,n){let[r]=n;if(!r)return{message:`Usage: agent wait GROUP_ID`,success:!1};let i=(0,e.summarizeBackgroundJobGroup)(await t.waitBackgroundJobGroup(r));return{message:me(i),success:!0,data:{groupId:r,summary:i}}}async function le(e,t){let[n,r]=t;if(!n)return{message:`Usage: agent read AGENT_ID [OFFSET]`,success:!1};let i=r?{offset:Number.parseInt(r,10)}:void 0,a=await e.readBackgroundTaskLog(n,i),o=a.nextCursor?`\nNext offset: ${a.nextCursor.offset}`:``;return{message:a.lines.length>0?`${a.lines.join(`
|
|
4
|
+
`)}${o}`:`No log lines: ${n}`,success:!0,data:{agentId:n,nextOffset:a.nextCursor?.offset}}}async function ue(e,t){let[n,...r]=t,i=r.join(` `).trim();return!n||!i?{message:`Usage: agent send AGENT_ID PROMPT`,success:!1}:(await e.sendAgentJob(n,i),{message:`Sent input to agent job: ${n}`,success:!0,data:{agentId:n}})}async function de(e,t){let[n,...r]=t;return n?(await e.cancelAgentJob(n,r.join(` `)||void 0),{message:`Agent job stopped: ${n}`,success:!0,data:{agentId:n}}):{message:`Usage: agent stop AGENT_ID [REASON]`,success:!1}}async function fe(e,t){let[n]=t;return n?(await e.closeAgentJob(n),{message:`Agent job closed: ${n}`,success:!0,data:{agentId:n}}):{message:`Usage: agent close AGENT_ID`,success:!1}}async function pe(e,t){try{if(t.trim()===``)return re();let[r=`list`,...i]=n(t);return r===`list`&&i.length===0?ie(e):r===`run`?oe(e,i):r===`parallel`?se(e,i):r===`wait`?ce(e,i):r===`read`||r===`open`?le(e,i):r===`send`?ue(e,i):r===`stop`||r===`cancel`?de(e,i):r===`close`?fe(e,i):oe(e,[r,...i])}catch(e){return{message:l(e),success:!1}}}function me(e){return[`Background job group ${e.groupId}: ${e.status} (${e.completed}/${e.total} completed, ${e.failed} failed, ${e.cancelled} cancelled, ${e.pending} pending)`,...e.lines].join(`
|
|
5
|
+
`)}function he(e){let t=e.getAgentJobCapability?.();if(!t)throw Error(`Agent job capability is not available in this context.`);return t}function ge(){return[{name:`list`,description:`List available agents and active jobs`,source:`agent`},{name:`run`,description:`Start one background agent job`,source:`agent`},{name:`parallel`,description:`Run multiple agents in parallel`,source:`agent`},{name:`wait`,description:`Wait for a background agent group summary`,source:`agent`},{name:`read`,description:`Read an agent job log page`,source:`agent`},{name:`send`,description:`Send follow-up input to an agent job`,source:`agent`},{name:`stop`,description:`Cancel a running agent job`,source:`agent`},{name:`close`,description:`Dismiss a terminal agent job`,source:`agent`},{name:`open`,description:`Focus an agent job detail view when supported`,source:`agent`}]}function u(){return{name:`agent`,description:[`Subagent jobs command.`,`Natural-language arguments start one background agent job.`,`When the user explicitly asks to create, run, spawn, delegate to, or use agents/subagents, start the requested agent command immediately and do not ask a follow-up question unless execution is impossible or unsafe.`,`If the target item is unspecified, include target selection inside the agent prompt instead of delaying execution.`,`The parallel form starts multiple background agent jobs as a wait_all group and returns a consolidated group summary unless --detach is present.`,`list, wait, read, send, stop, close, and open manage existing agent jobs.`].join(` `),source:`agent`,modelInvocable:!0,argumentHint:`PROMPT | AGENT_NAME PROMPT | list | parallel [--wait|--detach] LABEL:"PROMPT" [LABEL=AGENT_NAME:"PROMPT"] | wait GROUP_ID | read AGENT_ID [OFFSET] | send AGENT_ID PROMPT | stop AGENT_ID | close AGENT_ID`,safety:`background-agent`,subcommands:ge()}}function _e(){let e=u();return{name:e.name,description:e.description,execute:(e,t)=>pe(he(e),t),...e.modelInvocable===void 0?{}:{modelInvocable:e.modelInvocable},...e.userInvocable===void 0?{}:{userInvocable:e.userInvocable},...e.argumentHint===void 0?{}:{argumentHint:e.argumentHint},...e.safety===void 0?{}:{safety:e.safety}}}var ve=class{name=`agent`;getCommands(){return[u()]}};function ye(){return{name:`agent-command-agent`,commandSources:[new ve],systemCommands:[_e()],sessionRequirements:[`agent-runtime`]}}function be(e){return e.trim().split(/\s+/).filter(Boolean)}async function xe(t,n){let[r=`list`,i,...a]=be(n);if(r===`list`){let n=(0,e.listCommandBackgroundTasks)(t);return{message:(0,e.formatCommandBackgroundTaskList)(n),success:!0,data:{count:n.length}}}if(!i)return{message:e.BACKGROUND_COMMAND_USAGE,success:!1};if(r===`read`||r===`log`||r===`open`){let n=await(0,e.readCommandBackgroundTaskLog)(t,i,(0,e.parseCommandBackgroundLogCursor)(a[0])),r=n.nextCursor?`\nNext offset: ${n.nextCursor.offset}`:``;return{message:n.lines.length>0?`${n.lines.join(`
|
|
6
|
+
`)}${r}`:`No log lines: ${i}`,success:!0,data:{taskId:i,nextOffset:n.nextCursor?.offset}}}return r===`cancel`||r===`stop`?(await(0,e.cancelCommandBackgroundTask)(t,i,a.join(` `)||void 0),{message:`Background task cancelled: ${i}`,success:!0,data:{taskId:i}}):r===`close`||r===`dismiss`?(await(0,e.closeCommandBackgroundTask)(t,i),{message:`Background task closed: ${i}`,success:!0,data:{taskId:i}}):{message:`Unknown background action: ${r}`,success:!1}}function d(){return{name:`background`,description:e.BACKGROUND_COMMAND_DESCRIPTION,source:`background`,modelInvocable:!1,subcommands:(0,e.buildBackgroundCommandSubcommands)()}}function Se(){let e=d();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,lifecycle:`inline`,subcommands:e.subcommands,execute:xe}}var Ce=class{name=`background`;getCommands(){return[d()]}};function we(){return{name:`agent-command-background`,commandSources:[new Ce],systemCommands:[Se()]}}function Te(e){let t=e.trim();return t.length>0?t:void 0}async function Ee(t,n){let r=await(0,e.compactCommandContext)(t,Te(n)),i=r.before.usedPercentage,a=r.after.usedPercentage;return{message:`Context compacted: ${Math.round(i)}% -> ${Math.round(a)}%`,success:!0,data:{before:i,after:a}}}function f(){return{name:`compact`,description:`Compress context window`,source:`compact`,modelInvocable:!0,argumentHint:`[instructions]`,safety:`write`}}function De(){let e=f();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:e.modelInvocable,argumentHint:e.argumentHint,safety:e.safety,lifecycle:`blocking`,execute:Ee}}var Oe=class{name=`compact`;getCommands(){return[f()]}};function ke(){return{name:`agent-command-compact`,commandSources:[new Oe],systemCommands:[De()]}}const p=[`Usage: /context [list] | add <path> | remove <path> | clear | auto on | off | <percent> | reset`,`Examples: /context list, /context add AGENTS.md, /context remove AGENTS.md, /context auto 85%`].join(`
|
|
7
|
+
`);function m(e){return e===!1?`disabled`:`${Math.round(e*100)}%`}function Ae(e,t){return e===!1?`Auto compact: disabled (${t})`:`Auto compact: ${m(e)} (${t})`}function je(e){return e?`settings`:`current session only`}async function Me(t,n){let r=n.trim().split(/\s+/).filter(e=>e.length>0);if(r.length>0)return Ne(t,r);let i=(0,e.readCommandContextState)(t),a=(0,e.readAutoCompactThreshold)(t),o=(0,e.readAutoCompactThresholdSource)(t);return{message:[`Context: ${i.usedTokens.toLocaleString()} / ${i.maxTokens.toLocaleString()} tokens (${Math.round(i.usedPercentage)}%)`,Ae(a,o),ze((0,e.listCommandContextReferences)(t))].join(`
|
|
8
|
+
`),success:!0,data:{usedTokens:i.usedTokens,maxTokens:i.maxTokens,percentage:i.usedPercentage,autoCompactThreshold:a,autoCompactThresholdSource:o,references:(0,e.listCommandContextReferences)(t)}}}async function Ne(t,n){let[r,...i]=n;if(r===`list`)return i.length>0?{success:!1,message:p}:Be((0,e.listCommandContextReferences)(t));if(r===`add`)return Fe(t,i);if(r===`remove`)return Ie(t,i);if(r===`clear`){if(i.length>0)return{success:!1,message:p};let n=(0,e.clearCommandContextReferences)(t);return{success:!0,message:`Context references cleared: ${n.removed.length} removed.`,data:{removed:n.removed}}}return r===`auto`?Pe(t,i):{success:!1,message:p}}function Pe(t,n){let[r,i]=n;if(i!==void 0)return{success:!1,message:p};if(r===void 0){let n=(0,e.readAutoCompactThreshold)(t),r=(0,e.readAutoCompactThresholdSource)(t);return{success:!0,message:[Ae(n,r),p].join(`
|
|
9
|
+
`),data:{autoCompactThreshold:n,autoCompactThresholdSource:r}}}if(r===`on`)return h(t,e.DEFAULT_AUTO_COMPACT_THRESHOLD,`enabled`);if(r===`off`)return h(t,!1,`disabled`);if(r===`reset`){let n=(0,e.resetAutoCompactThresholdSetting)(t);return(0,e.setCommandAutoCompactThreshold)(t,e.DEFAULT_AUTO_COMPACT_THRESHOLD,`default`),{success:!0,message:`Auto compact reset to default: ${m(e.DEFAULT_AUTO_COMPACT_THRESHOLD)} (${je(n)}).`,data:{autoCompactThreshold:e.DEFAULT_AUTO_COMPACT_THRESHOLD,autoCompactThresholdSource:`default`,persisted:n}}}let a=Re(r);return a.success?h(t,a.threshold,`threshold set`):{success:!1,message:`${a.message}\n${p}`}}async function Fe(t,n){let r=n.join(` `).trim();if(!r)return{success:!1,message:p};let i=await(0,e.addCommandContextReference)(t,r);return i.reference?{success:!0,message:[`Context reference added: ${g(i.reference)}.`,...i.evicted.length>0?[`Evicted ${i.evicted.length} older context reference(s).`]:[]].join(`
|
|
10
|
+
`),data:{reference:i.reference,evicted:i.evicted}}:{success:!1,message:i.diagnostics.join(`
|
|
11
|
+
`)||`Context reference not found: ${r}`,data:{diagnostics:i.diagnostics}}}function Ie(t,n){let r=n.join(` `).trim();if(!r)return{success:!1,message:p};let i=(0,e.removeCommandContextReference)(t,r);return i.removed?{success:!0,message:`Context reference removed: ${g(i.removed)}.`,data:{removed:i.removed}}:{success:!1,message:`Context reference not found: ${r}`}}function h(t,n,r){let i=(0,e.writeAutoCompactThresholdSetting)(t,n),a=i?`settings`:`session`;return(0,e.setCommandAutoCompactThreshold)(t,n,a),{success:!0,message:Le(r,n,i),data:{autoCompactThreshold:n,autoCompactThresholdSource:a,persisted:i}}}function Le(e,t,n){let r=je(n);return e===`disabled`?`Auto compact disabled (${r}).`:e===`enabled`?`Auto compact enabled at ${m(t)} (${r}).`:`Auto compact threshold set to ${m(t)} (${r}).`}function Re(e){if(e.endsWith(`%`)){let t=Number(e.slice(0,-1));return!Number.isFinite(t)||t<=0||t>100?{success:!1,message:`Auto compact percentage must be greater than 0% and at most 100%.`}:{success:!0,threshold:t/100}}if(e.includes(`.`)){let t=Number(e);return!Number.isFinite(t)||t<=0||t>1?{success:!1,message:`Auto compact fraction must be greater than 0 and at most 1.`}:{success:!0,threshold:t}}return{success:!1,message:`Use a percentage such as 85% or a fraction such as 0.85.`}}function ze(e){return`References: ${e.filter(e=>e.status===`active`).length} active, ${e.filter(e=>e.status===`observed`).length} observed`}function Be(e){return e.length===0?{success:!0,message:`No context references.`,data:{references:e}}:{success:!0,message:[`Context references:`,...e.map(g)].join(`
|
|
12
|
+
`),data:{references:e}}}function g(e){return[e.relativePath,`[${e.loadType}, ${e.status}]`,`${e.byteLength.toLocaleString()} B`].join(` `)}function _(){return{name:`context`,description:`Context window info, reference inventory, and auto-compact controls`,source:`context`,modelInvocable:!1,argumentHint:`list | add <path> | remove <path> | clear | auto ...`,subcommands:[{name:`list`,description:`List loaded context references`,source:`context`},{name:`add`,description:`Add a file to active context references`,source:`context`},{name:`remove`,description:`Remove a context reference`,source:`context`},{name:`clear`,description:`Clear context references`,source:`context`},{name:`auto`,description:`Inspect or change auto-compact policy`,source:`context`}]}}function Ve(){let e=_();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,execute:Me}}var He=class{name=`context`;getCommands(){return[_()]}};function Ue(){return{name:`agent-command-context`,commandSources:[new He],systemCommands:[Ve()]}}function We(t,n){return{success:!0,message:`Exit requested.`,effects:[(0,e.createSessionExitRequestedEffect)()]}}function v(){return{name:`exit`,description:e.EXIT_COMMAND_DESCRIPTION,source:`exit`,modelInvocable:!1}}function Ge(){let e=v();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,lifecycle:`inline`,execute:We}}var Ke=class{name=`exit`;getCommands(){return[v()]}};function qe(){return{name:`agent-command-exit`,commandSources:[new Ke],systemCommands:[Ge()]}}function Je(t,n){return{success:!0,message:(0,e.formatCommandHelpMessage)(t)}}function y(){return{name:`help`,description:e.HELP_COMMAND_DESCRIPTION,source:`help`,modelInvocable:!1}}function Ye(){let e=y();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,lifecycle:`inline`,execute:Je}}var Xe=class{name=`help`;getCommands(){return[y()]}};function Ze(){return{name:`agent-command-help`,commandSources:[new Xe],systemCommands:[Ye()]}}function Qe(t,n){let r=(0,e.parseLanguageArgument)(n);return r===void 0?{message:(0,e.formatLanguageUsageMessage)(),success:!1}:{message:`Language set to "${r}".`,success:!0,data:{language:r},effects:[{type:`language-change-requested`,language:r}]}}function b(){return{name:`language`,description:e.LANGUAGE_COMMAND_DESCRIPTION,source:`language`,argumentHint:e.LANGUAGE_COMMAND_ARGUMENT_HINT,subcommands:(0,e.buildLanguageCommandSubcommands)(`language`),modelInvocable:!1}}function $e(){let e=b();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,argumentHint:e.argumentHint,subcommands:e.subcommands,lifecycle:`inline`,execute:Qe}}var et=class{name=`language`;getCommands(){return[b()]}};function tt(){return{name:`agent-command-language`,commandSources:[new et],systemCommands:[$e()]}}function x(){return{message:e.MEMORY_COMMAND_USAGE,success:!1}}function nt(e){return{message:e instanceof Error?e.message:String(e),success:!1}}function rt(e){let t=e.list(),n=t.topics.length>0?t.topics.map(e=>`- ${e.name}: ${e.path}`).join(`
|
|
13
|
+
`):`(none)`;return{message:[`Memory index: ${t.indexPath}`,`Topics directory: ${t.topicsPath}`,`Topics:`,n].join(`
|
|
14
|
+
`),success:!0,data:{indexPath:t.indexPath,topicsPath:t.topicsPath,topicCount:t.topics.length}}}function it(e,t){if(!t||t===`index`){let t=e.loadStartupMemory();return{message:t.content||`(empty memory index)`,success:!0,data:{path:t.path,lineCount:t.lineCount,truncated:t.truncated}}}return{message:e.readTopic(t)||`(empty memory topic: ${t})`,success:!0,data:{topic:t}}}function at(t){let n=t[1],r=t[2],i=t.slice(3).join(` `).trim();if(!(!n||!(0,e.isCommandMemoryType)(n)||!r||i.length===0))return{type:n,topic:r,text:i}}function ot(e){let t=e.list(`pending`);return{message:[`Pending memory candidates:`,...t.length>0?t.map(e=>`- ${e.id} ${e.type}/${e.topic} confidence=${e.confidence}: ${e.text}`):[`(no pending memory candidates)`]].join(`
|
|
15
|
+
`),success:!0,data:{count:t.length}}}function S(t,n){(0,e.recordCommandMemoryEvent)(t,n)}function st(e,t,n,r){if(!r)return x();try{let i=t.mark(r,`approved`,`approved-by-user`),a=n.append(i),o=t.mark(r,`saved`,`approved-and-saved`);return S(e,{type:`memory_candidate_approved`,candidateId:o.id,topic:o.topic,reason:`approved-by-user`}),S(e,{type:`memory_candidate_saved`,candidateId:o.id,topic:o.topic,reason:a.deduplicated?`deduplicated`:`approved-and-saved`}),{message:a.deduplicated?`Saved memory candidate ${r} was already present in ${a.topicPath}`:`Saved memory candidate ${r} to ${a.topicPath}`,success:!0,data:{id:r,status:o.status,topic:a.topic,topicPath:a.topicPath,deduplicated:a.deduplicated}}}catch(e){return nt(e instanceof Error?e:String(e))}}function ct(e,t,n){if(!n)return x();try{let r=t.mark(n,`rejected`,`rejected-by-user`);return S(e,{type:`memory_candidate_rejected`,candidateId:r.id,topic:r.topic,reason:`rejected-by-user`}),{message:`Rejected memory candidate ${n}`,success:!0,data:{id:n,status:r.status}}}catch(e){return nt(e instanceof Error?e:String(e))}}function lt(t){let n=(0,e.listCommandUsedMemoryReferences)(t);return{message:[`Used memory references:`,...n.length>0?n.map(e=>{let t=e.truncated?` truncated=true`:``;return`- ${e.topic} score=${e.score}${t}: ${e.path}`}):[`(no memory used in current turn)`]].join(`
|
|
16
|
+
`),success:!0,data:{count:n.length,references:[...n]}}}function ut(t,n){let r=n.trim().split(/\s+/).filter(Boolean),i=r[0]??`list`,a=(0,e.createCommandMemoryStores)(t);if(i===`list`)return rt(a.project);if(i===`show`)return it(a.project,r[1]);if(i===`pending`)return ot(a.pending);if(i===`approve`)return st(t,a.pending,a.project,r[1]);if(i===`reject`)return ct(t,a.pending,r[1]);if(i===`used`)return lt(t);if(i===`add`){let t=at(r);if(!t)return x();if((0,e.hasSensitiveCommandMemoryContent)(t.text))return{message:`Refusing to save sensitive memory content.`,success:!1};let n=a.project.append(t);return{message:n.deduplicated?`${t.type} memory already exists in ${n.topicPath}`:`Saved ${t.type} memory to ${n.topicPath}`,success:!0,data:{indexPath:n.indexPath,topicPath:n.topicPath,topic:n.topic,deduplicated:n.deduplicated}}}return x()}function C(){return{name:`memory`,description:e.MEMORY_COMMAND_DESCRIPTION,source:`memory`,argumentHint:e.MEMORY_COMMAND_ARGUMENT_HINT,modelInvocable:!0,safety:`write`,subcommands:(0,e.buildMemoryCommandSubcommands)()}}function dt(){let e=C();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!0,argumentHint:e.argumentHint,safety:e.safety,subcommands:e.subcommands,execute:ut}}var ft=class{name=`memory`;getCommands(){return[C()]}};function pt(){return{name:`agent-command-memory`,commandSources:[new ft],systemCommands:[dt()]}}function mt(t,n){let r=(0,e.parsePermissionModeArgument)(n);if(r===void 0){let n=(0,e.readCommandPermissionMode)(t);return{message:`Current mode: ${n}`,success:!0,data:{mode:n}}}return(0,e.isPermissionMode)(r)?((0,e.writeCommandPermissionMode)(t,r),{message:`Permission mode set to: ${r}`,success:!0,data:{mode:r}}):{message:(0,e.formatInvalidPermissionModeMessage)(),success:!1}}function w(){return{name:`mode`,description:e.PERMISSION_MODE_COMMAND_DESCRIPTION,source:`mode`,argumentHint:e.PERMISSION_MODE_ARGUMENT_HINT,subcommands:(0,e.buildPermissionModeSubcommands)(`mode`),modelInvocable:!1}}function ht(){let e=w();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,argumentHint:e.argumentHint,subcommands:e.subcommands,lifecycle:`inline`,execute:mt}}var gt=class{name=`mode`;getCommands(){return[w()]}};function _t(){return{name:`agent-command-mode`,commandSources:[new gt],systemCommands:[ht()]}}function vt(e){let t=e.trim().split(/\s+/)[0];return t!==void 0&&t.length>0?t:void 0}async function yt(t,n,r){let i=vt(n);return i===void 0?{message:await(0,e.formatModelCommandUsageMessageAsync)({...r?.settings===void 0?{}:{settings:r.settings.readMergedSettings()},...r?.providerDefinitions===void 0?{}:{providerDefinitions:r.providerDefinitions},refresh:!0}),success:!1}:{message:`Model change requested: ${i}`,success:!0,data:{modelId:i},effects:[{type:`model-change-requested`,modelId:i}]}}function T(t){return{name:`model`,description:e.MODEL_COMMAND_DESCRIPTION,source:`model`,argumentHint:e.MODEL_COMMAND_ARGUMENT_HINT,subcommands:Ct(t)}}function bt(e){let t=T(e);return{name:t.name,description:t.description,userInvocable:!0,argumentHint:t.argumentHint,subcommands:t.subcommands,lifecycle:`inline`,execute:(t,n)=>yt(t,n,e)}}var xt=class{options;name=`model`;constructor(e){this.options=e}getCommands(){return[T(this.options)]}};function St(e){return{name:`agent-command-model`,commandSources:[new xt(e)],systemCommands:[bt(e)]}}function Ct(t){return t===void 0?(0,e.buildModelCommandSubcommands)(`model`):(0,e.buildModelCommandSubcommands)({source:`model`,providerDefinitions:t.providerDefinitions,settings:t.settings.readMergedSettings()})}function wt(t,n){let r=(0,e.parsePermissionModeArgument)(n);if(r!==void 0){if(!(0,e.isPermissionMode)(r))return{message:(0,e.formatInvalidPermissionModeMessage)(),success:!1};(0,e.writeCommandPermissionMode)(t,r);let n=(0,e.readCommandPermissionsState)(t);return{message:`Permission mode set to: ${r}\n${(0,e.formatCommandPermissionsMessage)(n)}`,success:!0,data:{mode:n.mode,sessionAllowed:n.sessionAllowed}}}let i=(0,e.readCommandPermissionsState)(t);return{message:(0,e.formatCommandPermissionsMessage)(i),success:!0,data:{mode:i.mode,sessionAllowed:i.sessionAllowed}}}function E(){return{name:`permissions`,description:e.PERMISSIONS_COMMAND_DESCRIPTION,source:`permissions`,argumentHint:e.PERMISSION_MODE_ARGUMENT_HINT,subcommands:(0,e.buildPermissionModeSubcommands)(`permissions`),modelInvocable:!1}}function Tt(){let e=E();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,argumentHint:e.argumentHint,subcommands:e.subcommands,lifecycle:`inline`,execute:wt}}var Et=class{name=`permissions`;getCommands(){return[E()]}};function Dt(){return{name:`agent-command-permissions`,commandSources:[new Et],systemCommands:[Tt()]}}function Ot(e){let t=e.trim().split(/\s+/).filter(e=>e.length>0);return{subcommand:t[0]??``,subArgs:t.slice(1).join(` `).trim()}}function D(e){return{success:!1,message:e}}function kt(t){return(0,e.resolvePluginCommandAdapter)(t)}async function O(e,t){let n=kt(e);if(n===void 0)return{success:!1,message:`Plugin management is not available.`};try{return{success:!0,message:await t(n)}}catch(e){return{success:!1,message:`Plugin error: ${e instanceof Error?e.message:String(e)}`}}}async function At(e,t){let{subcommand:n,subArgs:r}=Ot(t);return n===`add`&&r.length>0?O(e,async e=>{let t=await e.marketplaceAdd(r);return`Added marketplace: "${t}" (from ${r})\nInstall plugins with: /plugin install <name>@${t}`}):n===`remove`&&r.length>0?O(e,async e=>(await e.marketplaceRemove(r),`Removed marketplace "${r}" and uninstalled its plugins.`)):n===`update`&&r.length>0?O(e,async e=>(await e.marketplaceUpdate(r),`Updated marketplace "${r}".`)):n===`list`?O(e,async e=>{let t=await e.marketplaceList();return t.length===0?`No marketplace sources configured.`:`Marketplace sources:\n${t.map(e=>` ${e.name} (${e.type})`).join(`
|
|
17
|
+
`)}`}):D(`Usage: /plugin marketplace add <source> | remove <name> | update <name> | list`)}function k(e,t,n,r){return t.length===0?Promise.resolve(D(n)):O(e,e=>Promise.resolve(r(e,t)))}function jt(){return{success:!0,message:`Opening plugin manager...`,effects:[(0,e.createPluginTuiRequestedEffect)()]}}function Mt(e,t){return k(e,t,`Usage: /plugin install <name>@<marketplace>`,async(e,t)=>(await e.install(t),`Installed plugin: ${t}`))}function Nt(e,t){return k(e,t,`Usage: /plugin uninstall <name>@<marketplace>`,async(e,t)=>(await e.uninstall(t),`Uninstalled plugin: ${t}`))}function Pt(e,t){return k(e,t,`Usage: /plugin enable <name>@<marketplace>`,async(e,t)=>(await e.enable(t),`Enabled plugin: ${t}`))}function Ft(e,t){return k(e,t,`Usage: /plugin disable <name>@<marketplace>`,async(e,t)=>(await e.disable(t),`Disabled plugin: ${t}`))}async function It(e,t){let{subcommand:n,subArgs:r}=Ot(t);switch(n){case``:case`manage`:return jt();case`install`:return Mt(e,r);case`uninstall`:return Nt(e,r);case`enable`:return Pt(e,r);case`disable`:return Ft(e,r);case`marketplace`:return At(e,r);default:return D(`Unknown plugin subcommand: ${n}`)}}async function Lt(t,n){return O(t,async e=>{let t=await e.reloadPlugins();return`Reloaded ${t.loadedPluginCount===1?`1 plugin resource`:`${t.loadedPluginCount} plugin resources`}.`}).then(t=>t.success?{...t,effects:[(0,e.createPluginRegistryReloadRequestedEffect)()]}:t)}function A(){return{name:`plugin`,description:e.PLUGIN_COMMAND_DESCRIPTION,source:`plugin-manager`,modelInvocable:!1,argumentHint:e.PLUGIN_COMMAND_ARGUMENT_HINT,subcommands:(0,e.buildPluginCommandSubcommands)()}}function j(){return{name:`reload-plugins`,description:e.RELOAD_PLUGINS_COMMAND_DESCRIPTION,source:`plugin-manager`,modelInvocable:!1}}function Rt(){let e=A();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,argumentHint:e.argumentHint,lifecycle:`inline`,subcommands:e.subcommands,execute:It}}function zt(){let e=j();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,lifecycle:`inline`,execute:Lt}}var Bt=class{name=`plugin-manager`;getCommands(){return[A(),j()]}};function Vt(){return{name:`agent-command-plugin`,commandSources:[new Bt],systemCommands:[Rt(),zt()]}}function M(e,t,n={}){let r=qt(e,t);return{type:e,steps:Xt(Jt(r),n.initialValues),setupHelpLinks:r.setupHelpLinks??[],stepIndex:0,values:{},existingProfileNames:n.existingProfileNames??[],...n.profileName===void 0?{}:{profileName:n.profileName},...n.setCurrent===void 0?{}:{setCurrent:n.setCurrent}}}function Ht(e){return e.length===0?` No providers are available.`:[` Select provider:`,...e.map((e,t)=>` ${t+1}. ${F(e)}`),` Provider [1-${e.length}] (default: 1): `].join(`
|
|
18
|
+
`)}function Ut(e,n){let r=e.trim(),i=r.length>0?r:`1`,a=Kt(i);if(a!==void 0){let e=n[a];if(e!==void 0)return e.type;throw Error(`Provider selection ${i} is out of range. Currently supported: ${(0,t.formatSupportedProviderTypes)(n)}`)}let o=(0,t.findProviderDefinition)(n,i);if(o===void 0)throw Error(`Unknown provider: ${i}. Currently supported: ${(0,t.formatSupportedProviderTypes)(n)}`);return o.type}function N(e){let t=e.steps[e.stepIndex];if(t===void 0)throw Error(`Provider setup step ${e.stepIndex} is out of range`);return t}function P(e,t){let n=N(e),r=t.trim()||n.defaultValue||``,i=L(n,r);if(i!==void 0)return{status:`error`,state:e,message:i};let a={...e,stepIndex:e.stepIndex+1,values:{...e.values,[n.key]:r}};return a.stepIndex<e.steps.length?{status:`next`,state:a}:{status:`complete`,input:Zt(a)}}async function Wt(e,t,n,r={}){let i=M(e,n,r),a=i.steps.length;for(;i.stepIndex<a;){let e=N(i),n=await t(Gt(e,i.setupHelpLinks),e.masked===!0),r=P(i,n);if(r.status===`complete`)return r.input;if(r.status===`error`)throw Error(r.message);i=r.state}throw Error(`Provider setup flow ended without completion`)}function Gt(e,t=[]){let n=e.defaultValue===void 0?``:` (default: ${e.defaultValue})`,r=I(t);return`${r.length>0?`${r}\n`:``} ${e.title}${n}: `}function F(e){let t=e.displayName===void 0?e.type:`${e.displayName} (${e.type})`;return e.description===void 0?t:`${t} - ${e.description}`}function I(e=[]){return e.length===0?``:e.map(e=>` Setup help: ${Yt(e.kind)}: ${e.label} - ${e.url}`).join(`
|
|
19
|
+
`)}function Kt(e){if(/^\d+$/.test(e))return Number(e)-1}function L(e,t){if(e.required===!0&&t.length===0)return`Required`}function qt(e,n){let r=(0,t.findProviderDefinition)(n,e);if(r===void 0)throw Error(`Unknown provider: ${e}. Currently supported: ${(0,t.formatSupportedProviderTypes)(n)}`);return r}function Jt(e){if(e.setupSteps!==void 0)return[...e.setupSteps];let t=[{key:`model`,title:`${e.type} model`,defaultValue:e.defaults?.model,required:e.defaults?.model===void 0}];return e.defaults?.baseURL!==void 0&&t.unshift({key:`baseURL`,title:`${e.type} base URL`,defaultValue:e.defaults.baseURL}),e.requiresApiKey===!0&&t.push({key:`apiKey`,title:`${e.type} API key`,defaultValue:e.defaults?.apiKey,required:e.defaults?.apiKey===void 0,masked:!0}),t}function Yt(e){return e===`api-key`?`API key`:e===`console`?`Console`:`Official`}function Xt(e,t){return t===void 0?[...e]:e.map(e=>{let n=t[e.key];return n===void 0?e:{...e,defaultValue:n,required:!1}})}function Zt(t){let n=t.profileName??(0,e.suggestProviderProfileName)({type:t.type},{existingProfileNames:t.existingProfileNames}),r=t.values.apiKey;return{profile:n,type:t.type,model:t.values.model,...r!==void 0&&r.length>0&&{apiKey:r},...t.values.baseURL!==void 0&&{baseURL:t.values.baseURL},setCurrent:t.setCurrent??!0}}const Qt={type:`session-restart-requested`,reason:`other`};function $t(e,t){return M(e,t.providerDefinitions,{existingProfileNames:Object.keys(t.settings.readMergedSettings().providers??{})})}function R(e,t){return{prompt:en(e),submit:n=>nn(e,n,t),cancel:()=>({message:`Provider setup cancelled.`,success:!0})}}function en(e){let t=N(e),n=t.masked===!0&&t.defaultValue!==void 0?`(unchanged)`:t.defaultValue;return{kind:`text`,title:t.title,...tn(e),...n===void 0?{}:{placeholder:n},...t.defaultValue===void 0?{}:{allowEmpty:!0},...t.masked===void 0?{}:{masked:t.masked},validate:e=>L(t,e)}}function tn(e){let t=I(e.setupHelpLinks);return t.length>0?{description:t}:{}}function nn(e,t,n){let r=P(e,t);return r.status===`error`?{message:r.message,success:!1,interaction:R(e,n)}:r.status===`complete`?rn(r.input,n):{message:``,success:!0,interaction:R(r.state,n)}}function rn(t,n){let r=n.settings.readTargetSettings(),i=(0,e.buildProviderSetupPatch)(t,{providerDefinitions:n.providerDefinitions});return n.settings.writeTargetSettings((0,e.mergeProviderPatch)(r,i)),{message:`Provider ${t.profile} configured. Restarting...`,success:!0,effects:[{...Qt,message:`Provider setup restart`}]}}const an={type:`session-restart-requested`,reason:`other`};function on(e,t,n){return`${e===n?`* `:``}${e}: ${t.type??`unknown`} ${t.model??`(no model)`}`}function sn(e,t,n){return t?e?.[t]?n.settings.readMergedSettings().currentProvider===t?{message:`Provider profile "${t}" is already current.`,success:!0}:{message:`Provider change requested: ${t}`,success:!0,interaction:cn(t,n)}:{message:`Provider profile "${t}" was not found.`,success:!1}:{message:`Usage: provider use <profile>`,success:!1}}function cn(t,n){return{prompt:{kind:`choice`,title:`Change provider to ${t}? This will restart the session.`,options:[{value:`yes`,label:`Yes`},{value:`no`,label:`No`}]},submit:r=>{if(r!==`yes`)return{message:`Provider change cancelled.`,success:!0};let i=n.settings.readMergedSettings(),a=n.settings.readTargetSettings(),o=a.providers?.[t]!==void 0||i.providers?.[t]!==void 0?{...a,currentProvider:t}:(0,e.setCurrentProvider)(a,t);return n.settings.writeTargetSettings(o),{message:`Provider changed to ${t}. Restarting...`,success:!0,effects:[{...an,message:`Provider change restart`}]}},cancel:()=>({message:`Provider change cancelled.`,success:!0})}}function ln(e,t){let n=t.settings.readMergedSettings().providers?.[e];if(!n)return{message:`Provider profile "${e}" was not found.`,success:!1};if(!n.type)return{message:`Provider profile "${e}" is missing type.`,success:!1};try{let r=M(n.type,t.providerDefinitions,{profileName:e,setCurrent:!1,initialValues:un(n)});return{message:`Provider edit requested: ${e}`,success:!0,interaction:z(r,e,t)}}catch(e){return{message:e instanceof Error?e.message:String(e),success:!1}}}function un(e){return{...typeof e.model==`string`?{model:e.model}:{},...typeof e.apiKey==`string`?{apiKey:e.apiKey}:{},...typeof e.baseURL==`string`?{baseURL:e.baseURL}:{}}}function z(e,t,n){return{prompt:en(e),submit:r=>dn(e,t,r,n),cancel:()=>({message:`Provider edit cancelled.`,success:!0})}}function dn(e,t,n,r){let i=P(e,n);return i.status===`error`?{message:i.message,success:!1,interaction:z(e,t,r)}:i.status===`complete`?fn(i.input,t,r):{message:``,success:!0,interaction:z(i.state,t,r)}}function fn(t,n,r){let i=r.settings.readMergedSettings(),a=i.providers?.[n];if(!a)return{message:`Provider profile "${n}" was not found.`,success:!1};let o=r.settings.readTargetSettings(),s=(0,e.buildProviderSetupPatch)(t,{providerDefinitions:r.providerDefinitions}).providers[n];if(!s)return{message:`Provider profile "${n}" was not updated.`,success:!1};r.settings.writeTargetSettings((0,e.upsertProviderProfile)(o,n,{...a,...s}));let c=i.currentProvider===n;return{message:c?`Provider ${n} updated. Restarting...`:`Provider ${n} updated.`,success:!0,...c?{effects:[{...an,message:`Provider edit restart`}]}:{}}}const pn={type:`session-restart-requested`,reason:`other`};function mn(e,t){let n=t.settings.readMergedSettings();if(!n.providers?.[e])return{message:`Provider profile "${e}" was not found.`,success:!1};let r=Sn(e,Object.keys(n.providers));return{message:`Provider duplicate requested: ${e}`,success:!0,interaction:hn(e,r,t)}}function hn(e,t,n){return{prompt:{kind:`text`,title:`Duplicate ${e} as`,placeholder:t,allowEmpty:!0,validate:e=>gn(e,t,n)},submit:r=>_n(e,r,t,n),cancel:()=>({message:`Provider duplicate cancelled.`,success:!0})}}function gn(e,t,n){let r=Cn(e,t);if(r.length===0)return`Required`;if(n.settings.readMergedSettings().providers?.[r]!==void 0)return`Provider profile "${r}" already exists`}function _n(t,n,r,i){let a=i.settings.readMergedSettings().providers?.[t];if(!a)return{message:`Provider profile "${t}" was not found.`,success:!1};let o=Cn(n,r),s=gn(o,r,i);return s===void 0?(i.settings.writeTargetSettings((0,e.upsertProviderProfile)(i.settings.readTargetSettings(),o,{...a})),{message:`Provider profile duplicated: ${t} -> ${o}.`,success:!0}):{message:s,success:!1}}function vn(e,t){let n=t.settings.readMergedSettings().providers??{};return n[e]?Object.keys(n).length<=1?{message:`Cannot delete the only provider profile.`,success:!1}:t.settings.readTargetSettings().providers?.[e]===void 0?{message:`Provider profile "${e}" is not stored in the active write target; edit its source settings file or override it before deleting.`,success:!1}:{message:`Provider delete requested: ${e}`,success:!0,interaction:yn(e,t)}:{message:`Provider profile "${e}" was not found.`,success:!1}}function yn(e,t){return{prompt:{kind:`choice`,title:`Delete provider profile ${e}?`,options:[{value:`yes`,label:`Yes`},{value:`no`,label:`No`}]},submit:n=>n===`yes`?bn(e,t):{message:`Provider delete cancelled.`,success:!0},cancel:()=>({message:`Provider delete cancelled.`,success:!0})}}function bn(t,n){let r=n.settings.readMergedSettings();if(r.currentProvider!==t)return n.settings.writeTargetSettings((0,e.deleteProviderProfile)(n.settings.readTargetSettings(),t)),{message:`Provider profile deleted: ${t}.`,success:!0};let i=Object.entries(r.providers??{}).filter(([e])=>e!==t).map(([e,t])=>({value:e,label:on(e,t,r.currentProvider)}));return{message:`Select a replacement provider before deleting ${t}.`,success:!0,interaction:{prompt:{kind:`choice`,title:`Replacement provider for ${t}`,options:i,maxVisible:8},submit:e=>xn(t,e,n),cancel:()=>({message:`Provider delete cancelled.`,success:!0})}}}function xn(t,n,r){if(r.settings.readMergedSettings().providers?.[n]===void 0||n===t)return{message:`Provider profile "${n}" was not found.`,success:!1};let i=(0,e.deleteProviderProfile)(r.settings.readTargetSettings(),t);return r.settings.writeTargetSettings({...i,currentProvider:n}),{message:`Provider profile deleted: ${t}. Restarting with ${n}...`,success:!0,effects:[{...pn,message:`Provider delete restart`}]}}function Sn(t,n){let r=(0,e.sanitizeProviderProfileName)(`${t}-copy`)??`provider-copy`;if(!n.includes(r))return r;for(let e=2;e<1e3;e+=1){let t=`${r}-${e}`;if(!n.includes(t))return t}return`${r}-${Date.now()}`}function Cn(t,n){return(0,e.sanitizeProviderProfileName)(t.trim()||n)??``}const wn=`switch`,Tn=`edit`,En=`test`,Dn=`duplicate`,On=`delete`,kn=`cancel`;function An(e,t,n){return{prompt:{kind:`choice`,title:`Select provider profile`,options:Object.entries(t??{}).map(([t,n])=>({value:t,label:on(t,n,e)})),maxVisible:8},submit:e=>jn(e,n),cancel:()=>({message:`Provider profile selection cancelled.`,success:!0})}}function jn(e,t){return t.settings.readMergedSettings().providers?.[e]?{message:`Provider profile selected: ${e}`,success:!0,interaction:Mn(e,t)}:{message:`Provider profile "${e}" was not found.`,success:!1}}function Mn(e,t){return{prompt:{kind:`choice`,title:`Provider profile: ${e}`,options:[{value:wn,label:`Switch`},{value:Tn,label:`Edit`},{value:En,label:`Test`},{value:Dn,label:`Duplicate`},{value:On,label:`Delete`},{value:kn,label:`Cancel`}]},submit:n=>Nn(e,n,t),cancel:()=>({message:`Provider profile action cancelled.`,success:!0})}}async function Nn(t,n,r){let i=r.settings.readMergedSettings();switch(n){case wn:return sn(i.providers,t,r);case Tn:return ln(t,r);case En:return await(0,e.testProviderProfileCommand)(i.currentProvider,i.providers,t,r);case Dn:return mn(t,r);case On:return vn(t,r);case kn:return{message:`Provider profile action cancelled.`,success:!0};default:return{message:`Unknown provider profile action "${n}".`,success:!1}}}async function Pn(t,n){let r=n.settings.readMergedSettings(),i=t.trim();if(i.length===0)return Fn(r.currentProvider,r.providers,n);let[a=`current`,o]=i.split(/\s+/);return a===`list`?Fn(r.currentProvider,r.providers,n):a===`current`||a===``?{message:Ln(r.currentProvider,r.providers),success:!0}:a===`use`?sn(r.providers,o,n):a===`test`?await(0,e.testProviderProfileCommand)(r.currentProvider,r.providers,o,n):a===`add`?Rn(o,n):{message:`Usage: provider [current|list|use <profile>|add <type>|test [profile]]`,success:!1}}function Fn(e,t,n){let r=In(e,t);return Object.keys(t??{}).length===0?{message:r,success:!0}:{message:r,success:!0,interaction:An(e,t,n)}}function In(e,t){let n=Object.entries(t??{});return n.length===0?`No provider profiles configured.`:n.map(([t,n])=>`${t===e?`*`:`-`} ${t}: ${n.type??`unknown`} ${n.model??`(no model)`}`).join(`
|
|
20
|
+
`)}function Ln(e,t){if(!e)return`No current provider configured.`;let n=t?.[e];return n?[`Current provider: ${e}`,`Type: ${n.type??`unknown`}`,`Model: ${n.model??`(no model)`}`,...n.baseURL?[`Base URL: ${n.baseURL}`]:[]].join(`
|
|
21
|
+
`):`Current provider "${e}" was not found in providers.`}function Rn(e,n){return e===void 0||e.length===0?{message:`Provider setup requested. Select a provider to continue.`,success:!0,interaction:zn(n)}:(0,t.findProviderDefinition)(n.providerDefinitions,e)===void 0?{message:`Usage: provider add <type>. Supported: ${(0,t.formatSupportedProviderTypes)(n.providerDefinitions)}`,success:!1}:{message:`Provider setup requested: ${e}`,success:!0,interaction:R($t(e,n),n)}}function zn(e){return{prompt:{kind:`choice`,title:`Select provider`,options:e.providerDefinitions.map(e=>({value:e.type,label:F(e)})),maxVisible:6},submit:t=>{let n=$t(t,e);return{message:`Provider setup requested: ${t}`,success:!0,interaction:R(n,e)}},cancel:()=>({message:`Provider setup cancelled.`,success:!0})}}function Bn(){return[{name:`current`,description:`Show current provider`,source:`provider`},{name:`list`,description:`List provider profiles`,source:`provider`},{name:`use`,description:`Switch provider profile`,source:`provider`},{name:`add`,description:`Configure a provider profile`,source:`provider`},{name:`test`,description:`Test provider profile`,source:`provider`}]}function B(){return{name:`provider`,description:`Manage provider profiles`,source:`provider`,modelInvocable:!1,argumentHint:`current | list | use <profile> | add [type] | test [profile]`,subcommands:Bn()}}var Vn=class{name=`provider`;getCommands(){return[B()]}};function Hn(e){let t=B();return{name:t.name,description:t.description,userInvocable:!0,modelInvocable:!1,argumentHint:t.argumentHint,subcommands:t.subcommands,execute:async(t,n)=>Pn(n,e)}}function Un(e){return{name:`agent-command-provider`,commandSources:[new Vn],systemCommands:[Hn(e)]}}function Wn(e,t){return{success:!0,message:`Reset requested.`,data:{resetRequested:!0},effects:[{type:`settings-reset-requested`}]}}function V(){return{name:`reset`,description:`Delete settings`,source:`reset`,modelInvocable:!1}}function Gn(){let e=V();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,lifecycle:`inline`,execute:Wn}}var Kn=class{name=`reset`;getCommands(){return[V()]}};function qn(){return{name:`agent-command-reset`,commandSources:[new Kn],systemCommands:[Gn()]}}function H(){return{message:`Usage: rewind [list] | rewind inspect <checkpoint-id> | rewind restore <checkpoint-id> | rewind code <checkpoint-id> | rewind rollback <checkpoint-id>`,success:!1}}function Jn(e){let t=e.replace(/\s+/g,` `).trim();return t.length<=120?t:`${t.slice(0,117)}...`}function Yn(e){return{message:[`Edit checkpoints:`,...e.length>0?e.map(e=>`- ${e.id} files=${e.fileCount} ${e.createdAt} ${Jn(e.prompt)}`):[`(no edit checkpoints)`]].join(`
|
|
22
|
+
`),success:!0,data:{count:e.length,checkpoints:[...e]}}}function Xn(e){return e.length>0?e.join(`, `):`(none)`}function Zn(e){let t=e.capturedFiles.length>0?e.capturedFiles.map(e=>{let t=e.snapshotSizeBytes===void 0?``:` size=${e.snapshotSizeBytes}B`;return`- ${e.relativePath} action=${e.restoreAction} snapshot=${String(e.snapshotAvailable)}${t}`}):[`(no files captured)`];return{message:[`Checkpoint ${e.target.id}`,`Prompt: ${Jn(e.target.prompt)}`,`Captured files:`,...t,`Restore later checkpoints: files=${e.restoreToCheckpoint.fileCount} checkpoints=${Xn(e.restoreToCheckpoint.checkpointIds)}`,`Rollback through checkpoint: files=${e.rollbackThroughCheckpoint.fileCount} checkpoints=${Xn(e.rollbackThroughCheckpoint.checkpointIds)}`].join(`
|
|
23
|
+
`),success:!0,data:{inspection:e}}}function Qn(e){return{message:[`Restored code to ${e.target.id}.`,`Restored files: ${e.restoredFileCount}`,`Rolled back checkpoints: ${e.restoredCheckpointCount}`].join(`
|
|
24
|
+
`),success:!0,data:{target:e.target,restoredCheckpointCount:e.restoredCheckpointCount,restoredFileCount:e.restoredFileCount,removedCheckpointCount:e.removedCheckpointCount}}}function $n(e){return{message:[`Rolled back code through ${e.target.id}.`,`Restored files: ${e.restoredFileCount}`,`Removed checkpoints: ${e.removedCheckpointCount}`].join(`
|
|
25
|
+
`),success:!0,data:{target:e.target,restoredCheckpointCount:e.restoredCheckpointCount,restoredFileCount:e.restoredFileCount,removedCheckpointCount:e.removedCheckpointCount}}}function U(e){return{message:e instanceof Error?e.message:String(e),success:!1}}function er(t,n){if(!n)return H();try{return Zn((0,e.inspectCommandEditCheckpoint)(t,n))}catch(e){return U(e instanceof Error?e:String(e))}}async function tr(t,n){if(!n)return H();try{return Qn(await(0,e.restoreCommandEditCheckpoint)(t,n))}catch(e){return U(e instanceof Error?e:String(e))}}async function nr(t,n){if(!n)return H();try{return $n(await(0,e.rollbackCommandEditCheckpoint)(t,n))}catch(e){return U(e instanceof Error?e:String(e))}}async function rr(t,n){let r=n.trim().split(/\s+/).filter(Boolean),i=r[0]??`list`;return i===`list`?Yn((0,e.listCommandEditCheckpoints)(t)):i===`inspect`?er(t,r[1]):i===`restore`||i===`code`?tr(t,r[1]):i===`rollback`?nr(t,r[1]):H()}function ir(){return{name:`rewind`,description:e.REWIND_COMMAND_DESCRIPTION,source:`rewind`,argumentHint:e.REWIND_COMMAND_ARGUMENT_HINT,modelInvocable:!1,safety:`write`,subcommands:(0,e.buildRewindCommandSubcommands)()}}function ar(){let e=ir();return{name:e.name,description:e.description,argumentHint:e.argumentHint,userInvocable:!0,modelInvocable:!1,safety:`write`,subcommands:e.subcommands,execute:rr}}var or=class{name=`rewind`;getCommands(){return[ir()]}};function sr(){return{name:`agent-command-rewind`,commandSources:[new or],systemCommands:[ar()]}}const cr=`Conversation cleared.`;function lr(t,n){return(0,e.clearConversationHistory)(t),{success:!0,message:cr,effects:[{type:`conversation-history-cleared`}]}}function ur(t,n){let r=(0,e.parseSessionNameArgument)(n);return r===void 0?{success:!1,message:e.RENAME_COMMAND_USAGE}:{success:!0,message:`Session renamed to "${r}".`,data:{name:r},effects:[(0,e.createSessionRenamedEffect)(r)]}}function dr(t,n){return{success:!0,message:`Opening session picker...`,data:{triggerResumePicker:!0},effects:[(0,e.createSessionPickerRequestedEffect)()]}}function fr(t,n){let r=(0,e.readCommandSessionInfo)(t);return{success:!0,message:`Session: ${r.sessionId}\nMessages: ${r.messageCount}`,data:{sessionId:r.sessionId,messageCount:r.messageCount}}}function pr(t,n){let r=(0,e.validateCommandSessionReplayLog)(t);return{success:r.validation.ok,message:(0,e.formatCommandSessionReplayValidationReport)(r),data:{logFile:r.logFile,entryCount:r.entryCount,issueCount:r.validation.issues.length,ok:r.validation.ok}}}function W(){return{name:`clear`,description:e.CLEAR_COMMAND_DESCRIPTION,source:`session`,modelInvocable:!1}}function G(){return{name:`rename`,description:e.RENAME_COMMAND_DESCRIPTION,source:`session`,modelInvocable:!1}}function K(){return{name:`resume`,description:e.RESUME_COMMAND_DESCRIPTION,source:`session`,modelInvocable:!1}}function q(){return{name:`cost`,description:e.COST_COMMAND_DESCRIPTION,source:`session`,modelInvocable:!1}}function J(){return{name:`validate-session`,description:e.VALIDATE_SESSION_COMMAND_DESCRIPTION,source:`session`,modelInvocable:!1}}function mr(){let e=W();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,lifecycle:`inline`,execute:lr}}function hr(){let e=G();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,lifecycle:`inline`,execute:ur}}function gr(){let e=K();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,lifecycle:`inline`,execute:dr}}function _r(){let e=q();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,lifecycle:`inline`,execute:fr}}function vr(){let e=J();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,lifecycle:`inline`,execute:pr}}var yr=class{name=`session`;getCommands(){return[W(),G(),K(),q(),J()]}};function br(){return{name:`agent-command-session`,commandSources:[new yr],systemCommands:[mr(),hr(),gr(),_r(),vr()]}}function Y(){return{name:`settings`,description:`Open transport settings — enable/disable transports and configure options`,source:`settings`,modelInvocable:!1}}function xr(){let e=Y();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,lifecycle:`inline`,execute:async()=>({success:!0,message:`Opening settings...`,effects:[{type:`settings-tui-requested`}]})}}var Sr=class{name=`settings`;getCommands(){return[Y()]}};function Cr(){return{name:`agent-command-settings`,commandSources:[new Sr],systemCommands:[xr()]}}const wr=`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. Slash syntax is a UI input/display concern; the SDK command identity is "skills".`;function Tr(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 Er(e){let t=e.argumentHint?` ${e.argumentHint}`:``;return`- ${e.name}${t}: ${e.description}${Tr(e)}`}function Dr(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(`
|
|
26
|
+
`):[`Registered skills:`,...e.map(Er),``,`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(`
|
|
27
|
+
`)}function Or(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 kr(e,t=``){let n=Or(t);if(n.action===`activate`&&n.skillName!==void 0){if(!e.executeSkillCommandByName)return{success:!1,message:`Skill activation is not available in this session.`};let t=`/${n.skillName}${n.skillArgs?` ${n.skillArgs}`:``}`;return await e.executeSkillCommandByName(n.skillName,n.skillArgs,{invocationSource:e.getCommandInvocationSource?.()??`user`,displayInput:t,rawInput:t})??{success:!1,message:`Unknown skill: ${n.skillName}`}}let r=e.listSkills?.()??[];return{success:!0,message:Dr(r),data:{skills:r,activationContract:{activateWith:`/skills <skill-name> [args]`,activationRequiredBeforeWorkflow:!0,metadataIsNotSkillContent:!0}}}}function X(){return{name:`skills`,description:wr,source:`skills`,modelInvocable:!0,userInvocable:!0,argumentHint:`[list | <skill-name> [args]]`,safety:`read-only`}}function Ar(){let e=X();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!0,argumentHint:e.argumentHint,safety:e.safety,lifecycle:`inline`,execute:kr}}var jr=class{name=`skills`;getCommands(){return[X()]}};function Mr(t={}){let n=[new jr];return n.push(new e.SkillCommandSource(t.cwd??process.cwd())),{name:`agent-command-skills`,commandSources:n,systemCommands:[Ar()]}}const Nr=[`Usage: /statusline on | off | reset | git on | git off`,`Fields: model, context, permission mode, message count, session name, thinking state, git branch.`].join(`
|
|
28
|
+
`);function Pr(t){let n=t.trim().toLowerCase().split(/\s+/).filter(e=>e.length>0),[r,i]=n;return r===`on`&&i===void 0?{success:!0,message:`Status line enabled.`,patch:{enabled:!0}}:r===`off`&&i===void 0?{success:!0,message:`Status line disabled.`,patch:{enabled:!1}}:r===`reset`&&i===void 0?{success:!0,message:`Status line settings reset.`,patch:{...e.DEFAULT_STATUS_LINE_COMMAND_SETTINGS}}:r===`git`&&i===`on`&&n.length===2?{success:!0,message:`Status line git branch shown.`,patch:{gitBranch:!0}}:r===`git`&&i===`off`&&n.length===2?{success:!0,message:`Status line git branch hidden.`,patch:{gitBranch:!1}}:{success:!1,message:Nr}}function Fr(e,t){let n=Pr(t);return n.success?{success:!0,message:n.message,effects:[{type:`statusline-settings-patch`,patch:n.patch}]}:{success:!1,message:n.message}}function Z(){return{name:`statusline`,description:e.STATUSLINE_COMMAND_DESCRIPTION,source:`statusline`,argumentHint:e.STATUSLINE_COMMAND_ARGUMENT_HINT,subcommands:(0,e.buildStatusLineCommandSubcommands)(`statusline`),modelInvocable:!1}}function Ir(){let e=Z();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,argumentHint:e.argumentHint,subcommands:e.subcommands,lifecycle:`inline`,execute:Fr}}var Lr=class{name=`statusline`;getCommands(){return[Z()]}};function Rr(){return{name:`agent-command-statusline`,commandSources:[new Lr],systemCommands:[Ir()]}}const zr=`Inspect Robota user-local storage and memory state.`,Br=`storage list [--format json] | memory set/list/inspect/disable/delete`,Q=`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 Vr(e){return e.length===0?`No user-local memory items.`:e.map(e=>`- ${e.category}/${e.key} (${e.enabled?`enabled`:`disabled`})`).join(`
|
|
29
|
+
`)}function $(e){if(e===void 0)throw Error(`User-local memory category is required.`);return e}async function Hr(t,n){let r=await(0,e.listUserLocalMemoryItems)({activeRepositoryRoot:t});return{message:n.format===`json`?JSON.stringify(r,null,2):Vr(r.items),success:!0,data:{list:r}}}async function Ur(t,n){let[r,i,a]=n.positional,o=await(0,e.setUserLocalMemoryItem)({activeRepositoryRoot:t,category:$(r),key:i??``,value:a??``,summary:n.summary??``,source:n.source??``});return{message:`Stored user-local memory item ${o.category}/${o.key} at ${o.storageLocation}`,success:!0,data:{item:o}}}async function Wr(t,n){let[r,i]=n.positional,a=await(0,e.inspectUserLocalMemoryItem)({activeRepositoryRoot:t,category:$(r),key:i??``});return{message:n.format===`json`?JSON.stringify(a,null,2):`${a.category}/${a.key}: ${a.summary}`,success:!0,data:{item:a}}}async function Gr(t,n){let[r,i]=n.positional,a=await(0,e.disableUserLocalMemoryItem)({activeRepositoryRoot:t,category:$(r),key:i??``});return{message:`Disabled user-local memory item ${a.category}/${a.key}`,success:!0,data:{item:a}}}async function Kr(t,n){let[r,i]=n.positional,a=await(0,e.deleteUserLocalMemoryItem)({activeRepositoryRoot:t,category:$(r),key:i??``});return{message:`Deleted user-local memory item ${a.category}/${a.key}`,success:!0,data:{result:a}}}async function qr(e,t){return(t.action??`list`)===`list`?Hr(e,t):t.action===`set`?Ur(e,t):t.action===`inspect`?Wr(e,t):t.action===`disable`?Gr(e,t):t.action===`delete`?Kr(e,t):{message:Q,success:!1}}function Jr(e){if(e===void 0||e===`text`)return`text`;if(e===`json`)return`json`;throw Error(`Unsupported user-local output format: ${e}`)}function Yr(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 Xr(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=Yr(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:Jr(n),summary:r,source:i}}function Zr(e){return e.trim().split(/\s+/).filter(Boolean)}function Qr(e,t){let n=t.map(e=>`- ${e.category}`);return[`User-local storage root: ${e}`,`Categories:`,...n].join(`
|
|
30
|
+
`)}async function $r(t,n){if((n.action??`list`)!==`list`)return{message:Q,success:!1};let r=await(0,e.inspectUserLocalStorage)({activeRepositoryRoot:t});return{message:n.format===`json`?JSON.stringify(r,null,2):Qr(r.root,r.categories),success:!0,data:{root:r.root,categories:r.categories,inspection:r}}}async function ei(e,t){return t.target===`storage`?$r(e,t):t.target===`memory`?qr(e,t):{message:Q,success:!1}}function ti(e){return e.includes(`ENOENT`)?`User-local memory item not found.`:e}async function ni(e){try{return await ei(e.cwd,Xr(e.argv,{format:e.format,summary:e.summary,source:e.source}))}catch(e){return{message:ti(e instanceof Error?e.message:String(e)),success:!1}}}async function ri(e,t){try{return await ei(e.getCwd(),Xr(Zr(t)))}catch(e){return{message:ti(e instanceof Error?e.message:String(e)),success:!1}}}function ii(){return{name:`user-local`,description:zr,source:`user-local`,argumentHint:Br,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 ai(){let e=ii();return{name:e.name,description:e.description,userInvocable:!0,modelInvocable:!1,argumentHint:e.argumentHint,safety:e.safety,subcommands:e.subcommands,execute:ri}}var oi=class{name=`user-local`;getCommands(){return[ii()]}};function si(){return{name:`agent-command-user-local`,commandSources:[new oi],systemCommands:[ai()]}}exports.AgentCommandSource=ve,exports.BackgroundCommandSource=Ce,exports.CLEAR_COMMAND_MESSAGE=cr,exports.CompactCommandSource=Oe,exports.ContextCommandSource=He,exports.ExitCommandSource=Ke,exports.HelpCommandSource=Xe,exports.LanguageCommandSource=et,exports.MemoryCommandSource=ft,exports.ModeCommandSource=gt,exports.ModelCommandSource=xt,exports.PermissionsCommandSource=Et,exports.PluginManagerCommandSource=Bt,exports.ProviderCommandSource=Vn,exports.RewindCommandSource=or,exports.SKILLS_COMMAND_DESCRIPTION=wr,exports.STATUSLINE_USAGE=Nr,exports.SessionCommandSource=yr,exports.SettingsCommandSource=Sr,exports.SkillsCommandSource=jr,exports.StatusLineCommandSource=Lr,exports.USER_LOCAL_COMMAND_ARGUMENT_HINT=Br,exports.USER_LOCAL_COMMAND_DESCRIPTION=zr,exports.USER_LOCAL_COMMAND_USAGE=Q,exports.UserLocalCommandSource=oi,exports.createAgentCommandEntry=u,exports.createAgentCommandModule=ye,exports.createAgentSystemCommand=_e,exports.createBackgroundCommandEntry=d,exports.createBackgroundCommandModule=we,exports.createClearCommandEntry=W,exports.createCompactCommandEntry=f,exports.createCompactCommandModule=ke,exports.createContextCommandEntry=_,exports.createContextCommandModule=Ue,exports.createCostCommandEntry=q,exports.createExitCommandEntry=v,exports.createExitCommandModule=qe,exports.createHelpCommandEntry=y,exports.createHelpCommandModule=Ze,exports.createLanguageCommandEntry=b,exports.createLanguageCommandModule=tt,exports.createMemoryCommandEntry=C,exports.createMemoryCommandModule=pt,exports.createModeCommandEntry=w,exports.createModeCommandModule=_t,exports.createModelCommandEntry=T,exports.createModelCommandModule=St,exports.createPermissionsCommandEntry=E,exports.createPermissionsCommandModule=Dt,exports.createPluginCommandEntry=A,exports.createPluginCommandModule=Vt,exports.createProviderCommandEntry=B,exports.createProviderCommandModule=Un,exports.createProviderSetupFlow=M,exports.createReloadPluginsCommandEntry=j,exports.createRenameCommandEntry=G,exports.createResetCommandEntry=V,exports.createResetCommandModule=qn,exports.createResumeCommandEntry=K,exports.createRewindCommandModule=sr,exports.createSessionCommandModule=br,exports.createSettingsCommandEntry=Y,exports.createSettingsCommandModule=Cr,exports.createSkillsCommandEntry=X,exports.createSkillsCommandModule=Mr,exports.createStatusLineCommandEntry=Z,exports.createStatusLineCommandModule=Rr,exports.createUserLocalCommandEntry=ii,exports.createUserLocalCommandModule=si,exports.createValidateSessionCommandEntry=J,exports.executeAgentCommand=pe,exports.executeBackgroundCommand=xe,exports.executeClearCommand=lr,exports.executeCompactCommand=Ee,exports.executeContextCommand=Me,exports.executeCostCommand=fr,exports.executeExitCommand=We,exports.executeHelpCommand=Je,exports.executeLanguageCommand=Qe,exports.executeMemoryCommand=ut,exports.executeModeCommand=mt,exports.executeModelCommand=yt,exports.executePermissionsCommand=wt,exports.executePluginCommand=It,exports.executeProviderCommand=Pn,exports.executeReloadPluginsCommand=Lt,exports.executeRenameCommand=ur,exports.executeResetCommand=Wn,exports.executeResumeCommand=dr,exports.executeRewindCommand=rr,exports.executeSkillsCommand=kr,exports.executeStatusLineCommand=Fr,exports.executeUserLocalCommand=ri,exports.executeUserLocalDirectCommand=ni,exports.executeValidateSessionCommand=pr,exports.formatProviderSetupChoiceLabel=F,exports.formatProviderSetupHelpLinks=I,exports.formatProviderSetupPromptLabel=Gt,exports.formatProviderSetupSelectionPrompt=Ht,exports.getProviderSetupStep=N,exports.resolveProviderSetupSelection=Ut,exports.runProviderSetupPromptFlow=Wt,exports.submitProviderSetupValue=P,exports.validateProviderSetupValue=L;
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { IAgentJobHostContext, ICommand, ICommandHostContext, ICommandModule, ICommandResult, ICommandSource, IModelCommandModuleOptions, IProviderCommandModuleOptions, IProviderCommandModuleOptions as IProviderCommandModuleOptions$1, IProviderCommandModuleOptions as IProviderCommandModuleOptions$2, IProviderCommandSettingsAdapter, IProviderSetupInput, ISystemCommand } from "@robota-sdk/agent-framework";
|
|
2
|
+
import { IProviderDefinition, IProviderSetupHelpLink, IProviderSetupStepDefinition, TProviderSetupField } from "@robota-sdk/agent-core";
|
|
3
|
+
|
|
4
|
+
//#region src/agent/agent-command-module.d.ts
|
|
5
|
+
declare function createAgentCommandEntry(): ICommand;
|
|
6
|
+
declare function createAgentSystemCommand(): ISystemCommand;
|
|
7
|
+
declare class AgentCommandSource implements ICommandSource {
|
|
8
|
+
readonly name = "agent";
|
|
9
|
+
getCommands(): ICommand[];
|
|
10
|
+
}
|
|
11
|
+
declare function createAgentCommandModule(): ICommandModule;
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/agent/agent-command.d.ts
|
|
14
|
+
declare function executeAgentCommand(session: IAgentJobHostContext, args: string): Promise<ICommandResult>;
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/background/background-command-module.d.ts
|
|
17
|
+
declare function createBackgroundCommandEntry(): ICommand;
|
|
18
|
+
declare class BackgroundCommandSource implements ICommandSource {
|
|
19
|
+
readonly name = "background";
|
|
20
|
+
getCommands(): ICommand[];
|
|
21
|
+
}
|
|
22
|
+
declare function createBackgroundCommandModule(): ICommandModule;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/background/background-command.d.ts
|
|
25
|
+
declare function executeBackgroundCommand(context: ICommandHostContext, args: string): Promise<ICommandResult>;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/compact/compact-command-module.d.ts
|
|
28
|
+
declare function createCompactCommandEntry(): ICommand;
|
|
29
|
+
declare class CompactCommandSource implements ICommandSource {
|
|
30
|
+
readonly name = "compact";
|
|
31
|
+
getCommands(): ICommand[];
|
|
32
|
+
}
|
|
33
|
+
declare function createCompactCommandModule(): ICommandModule;
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/compact/compact-command.d.ts
|
|
36
|
+
declare function executeCompactCommand(context: ICommandHostContext, args: string): Promise<ICommandResult>;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/context/context-command-module.d.ts
|
|
39
|
+
declare function createContextCommandEntry(): ICommand;
|
|
40
|
+
declare class ContextCommandSource implements ICommandSource {
|
|
41
|
+
readonly name = "context";
|
|
42
|
+
getCommands(): ICommand[];
|
|
43
|
+
}
|
|
44
|
+
declare function createContextCommandModule(): ICommandModule;
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/context/context-command.d.ts
|
|
47
|
+
declare function executeContextCommand(context: ICommandHostContext, args: string): Promise<ICommandResult>;
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/exit/exit-command-module.d.ts
|
|
50
|
+
declare function createExitCommandEntry(): ICommand;
|
|
51
|
+
declare class ExitCommandSource implements ICommandSource {
|
|
52
|
+
readonly name = "exit";
|
|
53
|
+
getCommands(): ICommand[];
|
|
54
|
+
}
|
|
55
|
+
declare function createExitCommandModule(): ICommandModule;
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/exit/exit-command.d.ts
|
|
58
|
+
declare function executeExitCommand(_context: ICommandHostContext, _args: string): ICommandResult;
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/help/help-command-module.d.ts
|
|
61
|
+
declare function createHelpCommandEntry(): ICommand;
|
|
62
|
+
declare class HelpCommandSource implements ICommandSource {
|
|
63
|
+
readonly name = "help";
|
|
64
|
+
getCommands(): ICommand[];
|
|
65
|
+
}
|
|
66
|
+
declare function createHelpCommandModule(): ICommandModule;
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/help/help-command.d.ts
|
|
69
|
+
declare function executeHelpCommand(context: ICommandHostContext, _args: string): ICommandResult;
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/language/language-command-module.d.ts
|
|
72
|
+
declare function createLanguageCommandEntry(): ICommand;
|
|
73
|
+
declare class LanguageCommandSource implements ICommandSource {
|
|
74
|
+
readonly name = "language";
|
|
75
|
+
getCommands(): ICommand[];
|
|
76
|
+
}
|
|
77
|
+
declare function createLanguageCommandModule(): ICommandModule;
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/language/language-command.d.ts
|
|
80
|
+
declare function executeLanguageCommand(_context: ICommandHostContext, args: string): ICommandResult;
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/memory/memory-command-module.d.ts
|
|
83
|
+
declare function createMemoryCommandEntry(): ICommand;
|
|
84
|
+
declare class MemoryCommandSource implements ICommandSource {
|
|
85
|
+
readonly name = "memory";
|
|
86
|
+
getCommands(): ICommand[];
|
|
87
|
+
}
|
|
88
|
+
declare function createMemoryCommandModule(): ICommandModule;
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/memory/memory-command.d.ts
|
|
91
|
+
declare function executeMemoryCommand(context: ICommandHostContext, rawArgs: string): ICommandResult;
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/mode/mode-command-module.d.ts
|
|
94
|
+
declare function createModeCommandEntry(): ICommand;
|
|
95
|
+
declare class ModeCommandSource implements ICommandSource {
|
|
96
|
+
readonly name = "mode";
|
|
97
|
+
getCommands(): ICommand[];
|
|
98
|
+
}
|
|
99
|
+
declare function createModeCommandModule(): ICommandModule;
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/mode/mode-command.d.ts
|
|
102
|
+
declare function executeModeCommand(context: ICommandHostContext, args: string): ICommandResult;
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/model/model-command-module.d.ts
|
|
105
|
+
declare function createModelCommandEntry(options?: IModelCommandModuleOptions): ICommand;
|
|
106
|
+
declare class ModelCommandSource implements ICommandSource {
|
|
107
|
+
private readonly options?;
|
|
108
|
+
readonly name = "model";
|
|
109
|
+
constructor(options?: IModelCommandModuleOptions | undefined);
|
|
110
|
+
getCommands(): ICommand[];
|
|
111
|
+
}
|
|
112
|
+
declare function createModelCommandModule(options?: IModelCommandModuleOptions): ICommandModule;
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/model/model-command.d.ts
|
|
115
|
+
declare function executeModelCommand(_context: ICommandHostContext, args: string, options?: IModelCommandModuleOptions): Promise<ICommandResult>;
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/permissions/permissions-command-module.d.ts
|
|
118
|
+
declare function createPermissionsCommandEntry(): ICommand;
|
|
119
|
+
declare class PermissionsCommandSource implements ICommandSource {
|
|
120
|
+
readonly name = "permissions";
|
|
121
|
+
getCommands(): ICommand[];
|
|
122
|
+
}
|
|
123
|
+
declare function createPermissionsCommandModule(): ICommandModule;
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/permissions/permissions-command.d.ts
|
|
126
|
+
declare function executePermissionsCommand(context: ICommandHostContext, args: string): ICommandResult;
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/plugin/plugin-command-module.d.ts
|
|
129
|
+
declare function createPluginCommandEntry(): ICommand;
|
|
130
|
+
declare function createReloadPluginsCommandEntry(): ICommand;
|
|
131
|
+
declare class PluginManagerCommandSource implements ICommandSource {
|
|
132
|
+
readonly name = "plugin-manager";
|
|
133
|
+
getCommands(): ICommand[];
|
|
134
|
+
}
|
|
135
|
+
declare function createPluginCommandModule(): ICommandModule;
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/plugin/plugin-command.d.ts
|
|
138
|
+
declare function executePluginCommand(context: ICommandHostContext, args: string): Promise<ICommandResult>;
|
|
139
|
+
declare function executeReloadPluginsCommand(context: ICommandHostContext, _args: string): Promise<ICommandResult>;
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/provider/provider-command-module.d.ts
|
|
142
|
+
declare function createProviderCommandEntry(): ICommand;
|
|
143
|
+
declare class ProviderCommandSource implements ICommandSource {
|
|
144
|
+
readonly name = "provider";
|
|
145
|
+
getCommands(): ICommand[];
|
|
146
|
+
}
|
|
147
|
+
declare function createProviderCommandModule(options: IProviderCommandModuleOptions$2): ICommandModule;
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/provider/provider-command-execution.d.ts
|
|
150
|
+
declare function executeProviderCommand(args: string, options: IProviderCommandModuleOptions$1): Promise<ICommandResult>;
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/provider/provider-setup-flow.d.ts
|
|
153
|
+
type TProviderSetupType = string;
|
|
154
|
+
type TPromptInput = (label: string, masked?: boolean) => Promise<string>;
|
|
155
|
+
interface IProviderSetupPromptStep extends IProviderSetupStepDefinition {
|
|
156
|
+
key: TProviderSetupField;
|
|
157
|
+
}
|
|
158
|
+
interface IProviderSetupFlowState {
|
|
159
|
+
type: TProviderSetupType;
|
|
160
|
+
steps: readonly IProviderSetupPromptStep[];
|
|
161
|
+
setupHelpLinks: readonly IProviderSetupHelpLink[];
|
|
162
|
+
stepIndex: number;
|
|
163
|
+
values: Partial<Record<TProviderSetupField, string>>;
|
|
164
|
+
existingProfileNames: readonly string[];
|
|
165
|
+
profileName?: string;
|
|
166
|
+
setCurrent?: boolean;
|
|
167
|
+
}
|
|
168
|
+
interface IProviderSetupFlowOptions {
|
|
169
|
+
existingProfileNames?: readonly string[];
|
|
170
|
+
initialValues?: Partial<Record<TProviderSetupField, string>>;
|
|
171
|
+
profileName?: string;
|
|
172
|
+
setCurrent?: boolean;
|
|
173
|
+
}
|
|
174
|
+
type TProviderSetupFlowSubmitResult = {
|
|
175
|
+
status: 'next';
|
|
176
|
+
state: IProviderSetupFlowState;
|
|
177
|
+
} | {
|
|
178
|
+
status: 'complete';
|
|
179
|
+
input: IProviderSetupInput;
|
|
180
|
+
} | {
|
|
181
|
+
status: 'error';
|
|
182
|
+
state: IProviderSetupFlowState;
|
|
183
|
+
message: string;
|
|
184
|
+
};
|
|
185
|
+
declare function createProviderSetupFlow(type: TProviderSetupType, providerDefinitions: readonly IProviderDefinition[], options?: IProviderSetupFlowOptions): IProviderSetupFlowState;
|
|
186
|
+
declare function formatProviderSetupSelectionPrompt(providerDefinitions: readonly IProviderDefinition[]): string;
|
|
187
|
+
declare function resolveProviderSetupSelection(rawValue: string, providerDefinitions: readonly IProviderDefinition[]): TProviderSetupType;
|
|
188
|
+
declare function getProviderSetupStep(state: IProviderSetupFlowState): IProviderSetupPromptStep;
|
|
189
|
+
declare function submitProviderSetupValue(state: IProviderSetupFlowState, rawValue: string): TProviderSetupFlowSubmitResult;
|
|
190
|
+
declare function runProviderSetupPromptFlow(type: TProviderSetupType, promptInput: TPromptInput, providerDefinitions: readonly IProviderDefinition[], options?: IProviderSetupFlowOptions): Promise<IProviderSetupInput>;
|
|
191
|
+
declare function formatProviderSetupPromptLabel(step: IProviderSetupPromptStep, setupHelpLinks?: readonly IProviderSetupHelpLink[]): string;
|
|
192
|
+
declare function formatProviderSetupChoiceLabel(definition: IProviderDefinition): string;
|
|
193
|
+
declare function formatProviderSetupHelpLinks(setupHelpLinks?: readonly IProviderSetupHelpLink[]): string;
|
|
194
|
+
declare function validateProviderSetupValue(step: IProviderSetupPromptStep, value: string): string | undefined;
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/reset/reset-command-module.d.ts
|
|
197
|
+
declare function createResetCommandEntry(): ICommand;
|
|
198
|
+
declare function createResetCommandModule(): ICommandModule;
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/reset/reset-command.d.ts
|
|
201
|
+
declare function executeResetCommand(_context: ICommandHostContext, _args: string): ICommandResult;
|
|
202
|
+
//#endregion
|
|
203
|
+
//#region src/rewind/rewind-command-module.d.ts
|
|
204
|
+
declare class RewindCommandSource implements ICommandSource {
|
|
205
|
+
readonly name = "rewind";
|
|
206
|
+
getCommands(): ICommand[];
|
|
207
|
+
}
|
|
208
|
+
declare function createRewindCommandModule(): ICommandModule;
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region src/rewind/rewind-command.d.ts
|
|
211
|
+
declare function executeRewindCommand(context: ICommandHostContext, rawArgs: string): Promise<ICommandResult>;
|
|
212
|
+
//#endregion
|
|
213
|
+
//#region src/session/session-command.d.ts
|
|
214
|
+
declare const CLEAR_COMMAND_MESSAGE = "Conversation cleared.";
|
|
215
|
+
declare function executeClearCommand(context: ICommandHostContext, _args: string): ICommandResult;
|
|
216
|
+
declare function executeRenameCommand(_context: ICommandHostContext, args: string): ICommandResult;
|
|
217
|
+
declare function executeResumeCommand(_context: ICommandHostContext, _args: string): ICommandResult;
|
|
218
|
+
declare function executeCostCommand(context: ICommandHostContext, _args: string): ICommandResult;
|
|
219
|
+
declare function executeValidateSessionCommand(context: ICommandHostContext, _args: string): ICommandResult;
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region src/session/session-command-module.d.ts
|
|
222
|
+
declare function createClearCommandEntry(): ICommand;
|
|
223
|
+
declare function createRenameCommandEntry(): ICommand;
|
|
224
|
+
declare function createResumeCommandEntry(): ICommand;
|
|
225
|
+
declare function createCostCommandEntry(): ICommand;
|
|
226
|
+
declare function createValidateSessionCommandEntry(): ICommand;
|
|
227
|
+
declare class SessionCommandSource implements ICommandSource {
|
|
228
|
+
readonly name = "session";
|
|
229
|
+
getCommands(): ICommand[];
|
|
230
|
+
}
|
|
231
|
+
declare function createSessionCommandModule(): ICommandModule;
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region src/settings/settings-command-module.d.ts
|
|
234
|
+
declare function createSettingsCommandEntry(): ICommand;
|
|
235
|
+
declare class SettingsCommandSource implements ICommandSource {
|
|
236
|
+
readonly name = "settings";
|
|
237
|
+
getCommands(): ICommand[];
|
|
238
|
+
}
|
|
239
|
+
declare function createSettingsCommandModule(): ICommandModule;
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region src/skills/skills-command-module.d.ts
|
|
242
|
+
interface ISkillsCommandModuleOptions {
|
|
243
|
+
readonly cwd?: string;
|
|
244
|
+
}
|
|
245
|
+
declare function createSkillsCommandEntry(): ICommand;
|
|
246
|
+
declare class SkillsCommandSource implements ICommandSource {
|
|
247
|
+
readonly name = "skills";
|
|
248
|
+
getCommands(): ICommand[];
|
|
249
|
+
}
|
|
250
|
+
declare function createSkillsCommandModule(options?: ISkillsCommandModuleOptions): ICommandModule;
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region src/skills/skills-command.d.ts
|
|
253
|
+
declare const SKILLS_COMMAND_DESCRIPTION = "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. Slash syntax is a UI input/display concern; the SDK command identity is \"skills\".";
|
|
254
|
+
declare function executeSkillsCommand(context: ICommandHostContext, args?: string): Promise<ICommandResult>;
|
|
255
|
+
//#endregion
|
|
256
|
+
//#region src/statusline/statusline-command-module.d.ts
|
|
257
|
+
declare function createStatusLineCommandEntry(): ICommand;
|
|
258
|
+
declare class StatusLineCommandSource implements ICommandSource {
|
|
259
|
+
readonly name = "statusline";
|
|
260
|
+
getCommands(): ICommand[];
|
|
261
|
+
}
|
|
262
|
+
declare function createStatusLineCommandModule(): ICommandModule;
|
|
263
|
+
//#endregion
|
|
264
|
+
//#region src/statusline/statusline-command.d.ts
|
|
265
|
+
declare const STATUSLINE_USAGE: string;
|
|
266
|
+
declare function executeStatusLineCommand(_context: ICommandHostContext, args: string): ICommandResult;
|
|
267
|
+
//#endregion
|
|
268
|
+
//#region src/user-local/user-local-command-module.d.ts
|
|
269
|
+
declare function createUserLocalCommandEntry(): ICommand;
|
|
270
|
+
declare class UserLocalCommandSource implements ICommandSource {
|
|
271
|
+
readonly name = "user-local";
|
|
272
|
+
getCommands(): ICommand[];
|
|
273
|
+
}
|
|
274
|
+
declare function createUserLocalCommandModule(): ICommandModule;
|
|
275
|
+
//#endregion
|
|
276
|
+
//#region src/user-local/user-local-command-constants.d.ts
|
|
277
|
+
declare const USER_LOCAL_COMMAND_DESCRIPTION = "Inspect Robota user-local storage and memory state.";
|
|
278
|
+
declare const USER_LOCAL_COMMAND_ARGUMENT_HINT = "storage list [--format json] | memory set/list/inspect/disable/delete";
|
|
279
|
+
declare const USER_LOCAL_COMMAND_USAGE = "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>";
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region src/user-local/user-local-command.d.ts
|
|
282
|
+
interface IUserLocalDirectCommandOptions {
|
|
283
|
+
readonly cwd: string;
|
|
284
|
+
readonly argv: readonly string[];
|
|
285
|
+
readonly format?: string;
|
|
286
|
+
readonly summary?: string;
|
|
287
|
+
readonly source?: string;
|
|
288
|
+
}
|
|
289
|
+
declare function executeUserLocalDirectCommand(options: IUserLocalDirectCommandOptions): Promise<ICommandResult>;
|
|
290
|
+
declare function executeUserLocalCommand(context: ICommandHostContext, rawArgs: string): Promise<ICommandResult>;
|
|
291
|
+
//#endregion
|
|
292
|
+
export { AgentCommandSource, BackgroundCommandSource, CLEAR_COMMAND_MESSAGE, CompactCommandSource, ContextCommandSource, ExitCommandSource, HelpCommandSource, type IProviderCommandModuleOptions, type IProviderCommandSettingsAdapter, type IProviderSetupFlowOptions, type IProviderSetupFlowState, type IProviderSetupPromptStep, type IUserLocalDirectCommandOptions, LanguageCommandSource, MemoryCommandSource, ModeCommandSource, ModelCommandSource, PermissionsCommandSource, PluginManagerCommandSource, ProviderCommandSource, RewindCommandSource, SKILLS_COMMAND_DESCRIPTION, STATUSLINE_USAGE, SessionCommandSource, SettingsCommandSource, SkillsCommandSource, StatusLineCommandSource, type TPromptInput, type TProviderSetupFlowSubmitResult, type TProviderSetupType, USER_LOCAL_COMMAND_ARGUMENT_HINT, USER_LOCAL_COMMAND_DESCRIPTION, USER_LOCAL_COMMAND_USAGE, UserLocalCommandSource, createAgentCommandEntry, createAgentCommandModule, createAgentSystemCommand, createBackgroundCommandEntry, createBackgroundCommandModule, createClearCommandEntry, createCompactCommandEntry, createCompactCommandModule, createContextCommandEntry, createContextCommandModule, createCostCommandEntry, createExitCommandEntry, createExitCommandModule, createHelpCommandEntry, createHelpCommandModule, createLanguageCommandEntry, createLanguageCommandModule, createMemoryCommandEntry, createMemoryCommandModule, createModeCommandEntry, createModeCommandModule, createModelCommandEntry, createModelCommandModule, createPermissionsCommandEntry, createPermissionsCommandModule, createPluginCommandEntry, createPluginCommandModule, createProviderCommandEntry, createProviderCommandModule, createProviderSetupFlow, createReloadPluginsCommandEntry, createRenameCommandEntry, createResetCommandEntry, createResetCommandModule, createResumeCommandEntry, createRewindCommandModule, createSessionCommandModule, createSettingsCommandEntry, createSettingsCommandModule, createSkillsCommandEntry, createSkillsCommandModule, createStatusLineCommandEntry, createStatusLineCommandModule, createUserLocalCommandEntry, createUserLocalCommandModule, createValidateSessionCommandEntry, executeAgentCommand, executeBackgroundCommand, executeClearCommand, executeCompactCommand, executeContextCommand, executeCostCommand, executeExitCommand, executeHelpCommand, executeLanguageCommand, executeMemoryCommand, executeModeCommand, executeModelCommand, executePermissionsCommand, executePluginCommand, executeProviderCommand, executeReloadPluginsCommand, executeRenameCommand, executeResetCommand, executeResumeCommand, executeRewindCommand, executeSkillsCommand, executeStatusLineCommand, executeUserLocalCommand, executeUserLocalDirectCommand, executeValidateSessionCommand, formatProviderSetupChoiceLabel, formatProviderSetupHelpLinks, formatProviderSetupPromptLabel, formatProviderSetupSelectionPrompt, getProviderSetupStep, resolveProviderSetupSelection, runProviderSetupPromptFlow, submitProviderSetupValue, validateProviderSetupValue };
|
|
293
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/agent/agent-command-module.ts","../../src/agent/agent-command.ts","../../src/background/background-command-module.ts","../../src/background/background-command.ts","../../src/compact/compact-command-module.ts","../../src/compact/compact-command.ts","../../src/context/context-command-module.ts","../../src/context/context-command.ts","../../src/exit/exit-command-module.ts","../../src/exit/exit-command.ts","../../src/help/help-command-module.ts","../../src/help/help-command.ts","../../src/language/language-command-module.ts","../../src/language/language-command.ts","../../src/memory/memory-command-module.ts","../../src/memory/memory-command.ts","../../src/mode/mode-command-module.ts","../../src/mode/mode-command.ts","../../src/model/model-command-module.ts","../../src/model/model-command.ts","../../src/permissions/permissions-command-module.ts","../../src/permissions/permissions-command.ts","../../src/plugin/plugin-command-module.ts","../../src/plugin/plugin-command.ts","../../src/provider/provider-command-module.ts","../../src/provider/provider-command-execution.ts","../../src/provider/provider-setup-flow.ts","../../src/reset/reset-command-module.ts","../../src/reset/reset-command.ts","../../src/rewind/rewind-command-module.ts","../../src/rewind/rewind-command.ts","../../src/session/session-command.ts","../../src/session/session-command-module.ts","../../src/settings/settings-command-module.ts","../../src/skills/skills-command-module.ts","../../src/skills/skills-command.ts","../../src/statusline/statusline-command-module.ts","../../src/statusline/statusline-command.ts","../../src/user-local/user-local-command-module.ts","../../src/user-local/user-local-command-constants.ts","../../src/user-local/user-local-command.ts"],"mappings":";;;;iBA8BgB,uBAAA,CAAA,GAA2B,QAAQ;AAAA,iBAoBnC,wBAAA,CAAA,GAA4B,cAAc;AAAA,cAa7C,kBAAA,YAA8B,cAAc;EAAA,SAC9C,IAAA;EAET,WAAA,CAAA,GAAe,QAAA;AAAA;AAAA,iBAKD,wBAAA,CAAA,GAA4B,cAAc;;;iBC2IpC,mBAAA,CACpB,OAAA,EAAS,oBAAA,EACT,IAAA,WACC,OAAA,CAAQ,cAAA;;;iBCzMK,4BAAA,CAAA,GAAgC,QAAQ;AAAA,cAuB3C,uBAAA,YAAmC,cAAc;EAAA,SACnD,IAAA;EAET,WAAA,CAAA,GAAe,QAAA;AAAA;AAAA,iBAKD,6BAAA,CAAA,GAAiC,cAAc;;;iBC5BzC,wBAAA,CACpB,OAAA,EAAS,mBAAA,EACT,IAAA,WACC,OAAA,CAAQ,cAAA;;;iBCVK,yBAAA,CAAA,GAA6B,QAAQ;AAAA,cAyBxC,oBAAA,YAAgC,cAAc;EAAA,SAChD,IAAA;EAET,WAAA,CAAA,GAAe,QAAA;AAAA;AAAA,iBAKD,0BAAA,CAAA,GAA8B,cAAc;;;iBCjCtC,qBAAA,CACpB,OAAA,EAAS,mBAAA,EACT,IAAA,WACC,OAAA,CAAQ,cAAA;;;iBCHK,yBAAA,CAAA,GAA6B,QAAQ;AAAA,cA4BxC,oBAAA,YAAgC,cAAc;EAAA,SAChD,IAAA;EAET,WAAA,CAAA,GAAe,QAAA;AAAA;AAAA,iBAKD,0BAAA,CAAA,GAA8B,cAAc;;;iB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