@crewx/sdk 0.8.9-rc.20 → 0.8.9-rc.22
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/dist/esm/index.js +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/templates/agents/default.yaml +1 -125
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import*as W from'path';import W__default,{join,resolve,dirname,isAbsolute,basename}from'path';import {fileURLToPath}from'url';import*as Yn from'fs';import {existsSync,readFileSync,readdirSync,mkdirSync,appendFileSync,writeFileSync,statSync}from'fs';import {spawn,execFileSync}from'child_process';import {ndJsonStream,ClientSideConnection}from'@agentclientprotocol/sdk';import {load}from'js-yaml';import {z}from'zod';import {createRequire}from'module';import*as ue from'handlebars';import ue__default from'handlebars';import {readFile,access,readdir}from'fs/promises';import {createHash,randomBytes}from'crypto';import {EventEmitter}from'events';import {AsyncLocalStorage}from'async_hooks';import {sql,eq,desc,and,or as or$1,isNull,like,asc,inArray,gte,lt as lt$1}from'drizzle-orm';import gi,{homedir}from'os';import {sqliteTable,text,integer,real,index,unique}from'drizzle-orm/sqlite-core';import {McpServer}from'@modelcontextprotocol/sdk/server/mcp.js';import {WebStandardStreamableHTTPServerTransport}from'@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js';import {performance}from'perf_hooks';var nr=Object.defineProperty;var Bo=Object.getOwnPropertyDescriptor;var Wo=Object.getOwnPropertyNames;var zo=Object.prototype.hasOwnProperty;var V=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var L=(n,e)=>()=>(n&&(e=n(n=0)),e);var Rt=(n,e)=>{for(var t in e)nr(n,t,{get:e[t],enumerable:true});},Ko=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Wo(e))!zo.call(n,o)&&o!==t&&nr(n,o,{get:()=>e[o],enumerable:!(r=Bo(e,o))||r.enumerable});return n};var mn=n=>Ko(nr({},"__esModule",{value:true}),n);var fn,Jo,f,y,c=L(()=>{fn=()=>fileURLToPath(import.meta.url),Jo=()=>W__default.dirname(fn()),f=Jo(),y=fn();});function Pt(n){return typeof n!="string"?void 0:n.trim()||void 0}function St(n){return Pt(n)?.toLowerCase()??""}function ze(n){try{return statSync(n).isFile()}catch{return false}}function xn(n,e){if(n.includes("/")||n.includes("\\")||W__default.isAbsolute(n))return n;let r=(e.PATH??e.Path??process.env.PATH??process.env.Path??"").split(";").map(a=>a.trim()).filter(Boolean),o=W__default.extname(n).length>0,s=e.PATHEXT??e.Pathext??process.env.PATHEXT??process.env.Pathext??".EXE;.CMD;.BAT;.COM",i=o?[""]:s.split(";").map(a=>a.trim()).filter(Boolean).map(a=>a.startsWith(".")?a:`.${a}`);for(let a of r)for(let d of i){let l=St(d),u=d.toUpperCase();for(let p of [d,l,u]){let h=W__default.join(a,`${n}${p}`);if(ze(h))return h}}return n}function as(n){if(!ze(n))return null;try{let e=readFileSync(n,"utf8"),t=W__default.dirname(n),r=[];for(let a of e.matchAll(/"([^"\r\n]*)"/g)){let u=(a[1]??"").match(/%~?dp0%?\s*[\\/]*(.*)$/i)?.[1]?.trim();if(!u)continue;let p=u.replace(/[\\/]+/g,W__default.sep).replace(/^[\\/]+/,""),h=W__default.resolve(t,p);ze(h)&&r.push(h);}let o=[],s=new Map;for(let a of e.matchAll(/SET\s+"(\w+)=%~?dp0%?[\\/]?([^"]+)"/gi)){let d=a[1].toUpperCase(),l=a[2].trim().replace(/[\\/]+/g,W__default.sep).replace(/^[\\/]+/,"");s.set(d,W__default.resolve(t,l));}for(let a of e.split(/\r?\n/))if(a.includes("%*"))for(let d of a.matchAll(/"%(\w+)%"/g)){let l=s.get(d[1].toUpperCase());l&&ze(l)&&o.push(l);}let i=a=>a.find(d=>{let l=St(W__default.basename(d));return l!=="node.exe"&&l!=="node"})??null;return i(o)??i(r)}catch{return null}}function ds(n,e){if(typeof e=="string")return Pt(e)||null;if(!e||typeof e!="object")return null;if(n){let t=e[n],r=typeof t=="string"?Pt(t):void 0;if(r)return r}for(let t of Object.values(e)){let r=typeof t=="string"?Pt(t):void 0;if(r)return r}return null}function ls(n,e){if(!e)return null;let t=W__default.dirname(n),r=[W__default.resolve(t,"..",e),W__default.resolve(t,"node_modules",e)];for(let o of r){let s=W__default.join(o,"package.json");if(ze(s))try{let i=JSON.parse(readFileSync(s,"utf8")),a=ds(e,i.bin);if(!a)continue;let d=W__default.resolve(o,a);if(ze(d))return d}catch{}}return null}function cs(n){let e=n.platform??process.platform,t=n.env??process.env,r=n.execPath??process.execPath;if(e!=="win32")return {command:n.command,leadingArgv:[],resolution:"direct"};let o=xn(n.command,t),s=St(W__default.extname(o));if(s===".js"||s===".cjs"||s===".mjs")return {command:r,leadingArgv:[o],resolution:"node-entrypoint",windowsHide:true};if(s===".cmd"||s===".bat"){let i=as(o)??ls(o,n.packageName);return i?St(W__default.extname(i))===".exe"?{command:i,leadingArgv:[],resolution:"exe-entrypoint",windowsHide:true}:{command:r,leadingArgv:[i],resolution:"node-entrypoint",windowsHide:true}:{command:o,leadingArgv:[],resolution:"unresolved-wrapper"}}return {command:o,leadingArgv:[],resolution:"direct"}}function us(n){if(n.candidate.resolution!=="unresolved-wrapper")return {command:n.candidate.command,leadingArgv:n.candidate.leadingArgv,resolution:n.candidate.resolution,windowsHide:n.candidate.windowsHide};if(n.allowShellFallback===true)return {command:n.candidate.command,leadingArgv:[],resolution:"shell-fallback",shell:true};throw new Error(`${W__default.basename(n.candidate.command)} wrapper resolved, but no executable/Node entrypoint could be resolved without shell execution.`)}function et(n){let e=cs(n);return us({candidate:e,allowShellFallback:n.allowShellFallback})}function tt(n,e){return {command:n.command,argv:[...n.leadingArgv,...e],resolution:n.resolution,shell:n.shell,windowsHide:n.windowsHide}}var It=L(()=>{c();});function ps(n){if(n.type!=="usage"||!("input_tokens"in n))return null;let e=Number(n.input_tokens??0),t=Number(n.output_tokens??0),o="cache_read_input_tokens"in n?Number(n.cache_read_input_tokens):void 0,s="cached_input_tokens"in n?Number(n.cached_input_tokens):void 0,i=o!==void 0?o:s??0;return {inputTokens:o!==void 0?e+o:e,outputTokens:t,cachedInputTokens:i}}function gs(n){let e=n.usage;if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e;if(!("input_tokens"in t))return null;let r=Number(t.input_tokens??0),o=Number(t.output_tokens??0),i="cache_read_input_tokens"in t?Number(t.cache_read_input_tokens):void 0,a="cached_input_tokens"in t?Number(t.cached_input_tokens):void 0,d=i!==void 0?i:a??0;return {inputTokens:i!==void 0?r+i:r,outputTokens:o,cachedInputTokens:d}}function ms(n){if(n.type!=="step_finish")return null;let t=n.part?.tokens;if(!t)return null;let r=Number(t.input??0),o=Number(t.output??0),s=t.cache,i=s?Number(s.read??0):0;return {inputTokens:r+i,outputTokens:o,cachedInputTokens:i}}function oe(n){if(!n||!n.trim())return;let e=null;for(let t of n.split(`
|
|
2
2
|
`))if(t.trim())try{let r=JSON.parse(t),o=ps(r)??gs(r)??ms(r);o&&(e=o);}catch{}return e??void 0}var be=L(()=>{c();});var rt,sr=L(()=>{c();rt=class extends Error{name="RateLimitError";constructor(e){super(e);}};});function se(n){return /crewx\s+(x|execute)\s/.test(n)}function ie(n,e){let t=e.match(/@(\S+)/);return {timestamp:n,type:"agent_call",targetAgent:t?.[1]?.replace(/["']/g,""),toolInput:e}}var Ke=L(()=>{c();});function ae(n){if(typeof n=="string")return n;if(!n||typeof n!="object")return JSON.stringify(n??{});let e=n;return typeof e.command=="string"?e.command:typeof e.file_path=="string"?e.file_path:typeof e.filePath=="string"?e.filePath:typeof e.path=="string"?e.path:typeof e.query=="string"?e.query:typeof e.pattern=="string"?e.pattern:typeof e.url=="string"?e.url:typeof e.prompt=="string"?e.prompt.length>200?e.prompt.slice(0,200)+"\u2026":e.prompt:typeof e.description=="string"?e.description:JSON.stringify(e)}var Ve=L(()=>{c();});function Ot(n){if(!n)return {};let e=n.match(/^(.+?)\[([^\]]+)\]$/);if(e){let t=e[2].toLowerCase();return fs.has(t)?{model:e[1],effort:e[2]}:{model:n}}return {model:n}}function kn(n){switch(n){case "agent-full-access":case "yolo":return ["--dangerously-bypass-approvals-and-sandbox"];case "read-only":case "plan":return ["--sandbox","read-only"];case "agent":return ["--sandbox","workspace-write"];default:return []}}function vn(n){return n?["-c",`model_reasoning_effort=${n}`]:[]}function _n(n){if(!n)return [];let e=new Set(["acceptEdits","bypassPermissions","default","delegate","dontAsk","plan"]),t=n==="auto"?"default":n;return e.has(t)?["--permission-mode",t]:[]}var fs,ir=L(()=>{c();fs=new Set(["minimal","low","medium","high","xhigh"]);});function ys(n,e){let t=e.type;if(t==="text"){let r=String(e.text||"");return r?{timestamp:n,type:"text",content:r}:null}if(t==="thinking"){let r=String(e.thinking||"");return {timestamp:n,type:"thinking",content:r||"(thinking)"}}if(t==="tool_use"){let r=String(e.name||""),o=e.id,s=e.input,i=ae(s);return r==="Bash"&&se(i)?ie(n,i):{timestamp:n,type:"tool_use",toolUseId:o,toolName:r,toolInput:i}}if(t==="tool_result"){let r=!!e.is_error,o=e.tool_use_id,s=e.output??e.content??"",i;return typeof s=="string"?i=s:Array.isArray(s)?i=s.filter(a=>a.type==="text"&&typeof a.text=="string").map(a=>a.text).join(`
|
|
3
|
-
`):i=JSON.stringify(s),{timestamp:n,type:"tool_result",toolUseId:o,resultPreview:i,isError:r}}return null}var An,Mt,ar=L(()=>{c();sr();Ke();Ve();ir();An=false,Mt={command:"claude",buildArgs(n,e,t){let{model:r,effort:o}=Ot(e.model);(e.effort??o)&&!An&&(An=true,console.warn("[crewx] claude-cli: effort option has no equivalent CLI flag and will be ignored"));let i=_n(e.mode),a=r?["--model",r]:[];if(e.additionalArgs!==void 0){let l=[...e.additionalArgs]
|
|
3
|
+
`):i=JSON.stringify(s),{timestamp:n,type:"tool_result",toolUseId:o,resultPreview:i,isError:r}}return null}var An,Mt,ar=L(()=>{c();sr();Ke();Ve();ir();An=false,Mt={command:"claude",buildArgs(n,e,t){let{model:r,effort:o}=Ot(e.model);(e.effort??o)&&!An&&(An=true,console.warn("[crewx] claude-cli: effort option has no equivalent CLI flag and will be ignored"));let i=_n(e.mode),a=r?["--model",r]:[];if(e.additionalArgs!==void 0){let l=[...e.additionalArgs];return l.indexOf("-p")!==-1?{args:["--output-format","stream-json","--verbose",...i,...a,...l],stdinMessage:n}:{args:["--output-format","stream-json","--verbose",...i,...a,...l],stdinMessage:n}}return {args:["-p","--output-format","stream-json","--verbose",...i,...a],stdinMessage:n}},extractText(n){let e=n.split(`
|
|
4
4
|
`).filter(o=>o.trim()),t=[],r=null;for(let o of e)try{let s=JSON.parse(o);if(s.type==="assistant"&&Array.isArray(s.message?.content))for(let i of s.message.content)i.type==="text"&&typeof i.text=="string"&&i.text.trim()&&t.push(i.text.trim());s.type==="result"&&typeof s.result=="string"&&(r=s.result);}catch{}return t.length>0?t.join(`
|
|
5
5
|
|
|
6
6
|
`):r||n.trim()},extractFailure(n){if(n.includes('"rate_limit_event"'))try{let e=JSON.parse(n);if(e.type==="rate_limit_event"){let t=e.rate_limit_info??{};if(t.status==="rejected")return new rt(`Claude rate limit: ${t.rateLimitType??"unknown"} (status: ${t.status})`)}}catch{}return null},parseResultMeta(n){let e=n.split(`
|
|
@@ -11,7 +11,7 @@ import*as W from'path';import W__default,{join,resolve,dirname,isAbsolute,basena
|
|
|
11
11
|
`):r||n.trim()},parseResultMeta(n){let e=oe(n);return e?{usage:{inputTokens:e.inputTokens,outputTokens:e.outputTokens,cachedInputTokens:e.cachedInputTokens,costUsd:0},model:null}:{usage:null,model:null}},parseEvent(n,e){let t;try{t=JSON.parse(n);}catch{return []}let r=t.type;if(!r)return [];if(!r.startsWith("tool.execution")&&!r.startsWith("assistant.")&&r!=="user.message")return [];let o=t.data;if(!o)return [];let s=e??new Date().toISOString(),i=o.toolCallId;if(r==="tool.execution_start"){let a=String(o.toolName||""),d=o.arguments,l=ae(d);return (a==="bash"||a==="Bash")&&se(l)?[ie(s,l)]:[{timestamp:s,type:"tool_use",toolName:a,toolInput:l,...i&&{toolUseId:i}}]}if(r==="tool.execution_complete"){let a=o.error;if(a)return [{timestamp:s,type:"tool_result",isError:true,resultPreview:String(a.message||""),...i&&{toolUseId:i}}];let d=o.result,l=String(d?.content||"");return [{timestamp:s,type:"tool_result",resultPreview:l,isError:false,...i&&{toolUseId:i}}]}if(r==="assistant.message"){let a=String(o.content||"");return a?[{timestamp:s,type:"text",content:a}]:[]}return []}};});function hs(n,e){if(e.type==="command_execution"){let r=String(e.command||"");return se(r)?[ie(n,r)]:[{timestamp:n,type:"tool_use",toolName:"Bash",toolInput:r}]}return []}function ws(n,e){let t=e.type;if(t==="message"||t==="text"){let r=e.content;if(Array.isArray(r))for(let o of r){let s=xs(n,o);if(s)return s}if(typeof e.text=="string")return {timestamp:n,type:"text",content:e.text}}if(t==="reasoning")return {timestamp:n,type:"text",content:String(e.text||"")};if(t==="command_execution"){let r=String(e.aggregated_output||e.output||""),o=!!e.is_error;return {timestamp:n,type:"tool_result",resultPreview:r,isError:o}}if(t==="tool_use"){let r=String(e.name||e.tool_name||""),o=e.input,s=ae(o);return r==="Bash"&&se(s)?ie(n,s):{timestamp:n,type:"tool_use",toolName:r,toolInput:s}}if(t==="tool_result"){let r=!!e.is_error,o=String(e.output||e.content||"");return {timestamp:n,type:"tool_result",resultPreview:o,isError:r}}return null}function xs(n,e){let t=e.type;if(t==="text")return {timestamp:n,type:"text",content:String(e.text||"")};if(t==="tool_use"){let r=String(e.name||""),o=e.input,s=ae(o);return r==="Bash"&&se(s)?ie(n,s):{timestamp:n,type:"tool_use",toolName:r,toolInput:s}}return null}var Lt,cr=L(()=>{c();be();Ke();Ve();ir();Lt={command:"codex",buildArgs(n,e,t){let{model:r,effort:o}=Ot(e.model),s=e.effort??o,i=kn(e.mode),a=vn(s),d=r?["-m",r]:[],l=e.additionalArgs??[];return {args:["exec",...l.includes("--experimental-json")?[]:["--json"],...i,...a,...d,...l],stdinMessage:n}},extractText(n){let e=n.split(`
|
|
12
12
|
`).filter(o=>o.trim()),t=[],r=null;for(let o of e)try{let s=JSON.parse(o);if(s.type==="item.completed"&&(s.item?.type==="message"||s.item?.type==="agent_message")&&typeof s.item?.text=="string"){let i=s.item.text;i.trim()&&t.push(i.trim());}s.type==="result"&&typeof s.result=="string"&&(r=s.result);}catch{}return t.length>0?t.join(`
|
|
13
13
|
|
|
14
|
-
`):r||n.trim()},parseResultMeta(n){let e=oe(n);return e?{usage:{inputTokens:e.inputTokens,outputTokens:e.outputTokens,cachedInputTokens:e.cachedInputTokens,costUsd:0},model:null}:{usage:null,model:null}},parseEvent(n,e){let t;try{t=JSON.parse(n);}catch{return []}let r=t.type;if(!r)return [];if(!r.startsWith("item.")&&!r.startsWith("turn.")&&!r.startsWith("thread."))return [];let o=t.item;if(!o)return [];let s=e??new Date().toISOString();if(r==="item.started")return hs(s,o);if(r==="item.completed"){let i=ws(s,o);return i?[i]:[]}return []}};});var $t,ur=L(()=>{c();be();Ve();$t={command:"opencode",buildArgs(n,e,t){let r=e.additionalArgs,o=r!==void 0?[...r]:["run"];return o.includes("--format")||o.push("--format","json"),e.model&&o.push("--model",e.model),
|
|
14
|
+
`):r||n.trim()},parseResultMeta(n){let e=oe(n);return e?{usage:{inputTokens:e.inputTokens,outputTokens:e.outputTokens,cachedInputTokens:e.cachedInputTokens,costUsd:0},model:null}:{usage:null,model:null}},parseEvent(n,e){let t;try{t=JSON.parse(n);}catch{return []}let r=t.type;if(!r)return [];if(!r.startsWith("item.")&&!r.startsWith("turn.")&&!r.startsWith("thread."))return [];let o=t.item;if(!o)return [];let s=e??new Date().toISOString();if(r==="item.started")return hs(s,o);if(r==="item.completed"){let i=ws(s,o);return i?[i]:[]}return []}};});var $t,ur=L(()=>{c();be();Ve();$t={command:"opencode",buildArgs(n,e,t){let r=e.additionalArgs,o=r!==void 0?[...r]:["run"];return o.includes("--format")||o.push("--format","json"),e.model&&o.push("--model",e.model),{args:o,stdinMessage:n}},extractText(n){let e=n.split(`
|
|
15
15
|
`).filter(o=>o.trim()),t=[],r=null;for(let o of e)try{let s=JSON.parse(o);if(s.type==="text"&&typeof s.part?.text=="string"){let i=s.part.text;i.trim()&&t.push(i.trim());}s.type==="result"&&typeof s.result=="string"&&(r=s.result);}catch{}return t.length>0?t.join(""):r||n.trim()},parseResultMeta(n){let e=oe(n);return e?{usage:{inputTokens:e.inputTokens,outputTokens:e.outputTokens,cachedInputTokens:e.cachedInputTokens,costUsd:0},model:null}:{usage:null,model:null}},parseEvent(n,e){let t;try{t=JSON.parse(n);}catch{return []}let r=t.type;if(!r)return [];let o=e??new Date().toISOString();if(r==="text"){let i=t.part?.text;return i?[{timestamp:o,type:"text",content:i}]:[]}if(r==="tool_use"){let s=t.part;if(!s)return [];let i=String(s.tool||""),a=String(s.callID||""),d=s.state,l=String(d?.status||""),u=d?.input,p=ae(u),h=[{timestamp:o,type:"tool_use",toolName:i,toolUseId:a,toolInput:p}];if(l==="completed"&&d?.output!==void 0){let g=d.output,w=typeof g=="string"?g:JSON.stringify(g);h.push({timestamp:o,type:"tool_result",toolUseId:a,resultPreview:w,isError:false});}else l==="error"&&h.push({timestamp:o,type:"tool_result",toolUseId:a,resultPreview:String(d?.error||"tool error"),isError:true});return h}return []}};});var pr,gr=L(()=>{c();pr={command:"agy",buildArgs(n,e,t){if(e.additionalArgs!==void 0){let o=[...e.additionalArgs];return o.includes("--print")||o.unshift("--print",n),e.model&&o.push("--model",e.model),o.push("--dangerously-skip-permissions"),{args:o}}let r=["--print",n,"--dangerously-skip-permissions"];return e.model&&r.push("--model",e.model),{args:r}},extractText(n){return n.trim()},parseResultMeta(n){return {usage:null,model:null}},parseEvent(n,e){return []}};});function nt(n,e,t){if(t){let r=Ae[t];if(r?.parseEvent)return r.parseEvent(e,n)}for(let r of Object.values(Ae)){let o=r.parseEvent?.(e,n)??[];if(o.length>0)return o}return []}var Ae,Pe=L(()=>{c();ar();dr();lr();cr();ur();gr();ar();dr();lr();cr();ur();gr();Ke();Ae={claude:Mt,gemini:Nt,copilot:Dt,codex:Lt,opencode:$t,antigravity:pr};});function vs(n){let e=n.split(`
|
|
16
16
|
`).filter(d=>d.trim()),t=[],r=[],o=[],s=[],i=[],a=null;for(let d of e)try{let l=JSON.parse(d);if(l.type==="assistant"&&Array.isArray(l.message?.content))for(let u of l.message.content)u.type==="text"&&typeof u.text=="string"&&u.text.trim()&&t.push(u.text.trim());if(l.type==="message"&&l.role==="assistant"&&l.delta===!0&&typeof l.content=="string"&&r.push(l.content),l.type==="assistant.message"&&typeof l.data?.content=="string"){let u=l.data.content;u.trim()&&o.push(u.trim());}if(l.type==="item.completed"&&(l.item?.type==="message"||l.item?.type==="agent_message")&&typeof l.item?.text=="string"){let u=l.item.text;u.trim()&&s.push(u.trim());}if(l.type==="text"&&typeof l.part?.text=="string"){let u=l.part.text;u.trim()&&i.push(u.trim());}l.type==="result"&&typeof l.result=="string"&&(a=l.result);}catch{}return t.length>0?t.join(`
|
|
17
17
|
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';var Jn=require('fs'),B=require('path'),child_process=require('child_process'),sdk=require('@agentclientprotocol/sdk'),jsYaml=require('js-yaml'),zod=require('zod'),module$1=require('module'),ce=require('handlebars'),promises=require('fs/promises'),crypto$1=require('crypto'),events=require('events'),async_hooks=require('async_hooks'),drizzleOrm=require('drizzle-orm'),di=require('os'),sqliteCore=require('drizzle-orm/sqlite-core'),mcp_js=require('@modelcontextprotocol/sdk/server/mcp.js'),webStandardStreamableHttp_js=require('@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js'),perf_hooks=require('perf_hooks');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Jn__namespace=/*#__PURE__*/_interopNamespace(Jn);var B__namespace=/*#__PURE__*/_interopNamespace(B);var ce__namespace=/*#__PURE__*/_interopNamespace(ce);var di__default=/*#__PURE__*/_interopDefault(di);var rr=Object.defineProperty;var Fo=Object.getOwnPropertyDescriptor;var qo=Object.getOwnPropertyNames;var Bo=Object.prototype.hasOwnProperty;var K=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var D=(n,e)=>()=>(n&&(e=n(n=0)),e);var At=(n,e)=>{for(var t in e)rr(n,t,{get:e[t],enumerable:true});},Wo=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of qo(e))!Bo.call(n,o)&&o!==t&&rr(n,o,{get:()=>e[o],enumerable:!(r=Fo(e,o))||r.enumerable});return n};var gn=n=>Wo(rr({},"__esModule",{value:true}),n);var c=D(()=>{});function bt(n){return typeof n!="string"?void 0:n.trim()||void 0}function Pt(n){return bt(n)?.toLowerCase()??""}function We(n){try{return Jn.statSync(n).isFile()}catch{return false}}function hn(n,e){if(n.includes("/")||n.includes("\\")||B__namespace.default.isAbsolute(n))return n;let r=(e.PATH??e.Path??process.env.PATH??process.env.Path??"").split(";").map(a=>a.trim()).filter(Boolean),o=B__namespace.default.extname(n).length>0,s=e.PATHEXT??e.Pathext??process.env.PATHEXT??process.env.Pathext??".EXE;.CMD;.BAT;.COM",i=o?[""]:s.split(";").map(a=>a.trim()).filter(Boolean).map(a=>a.startsWith(".")?a:`.${a}`);for(let a of r)for(let d of i){let l=Pt(d),u=d.toUpperCase();for(let p of [d,l,u]){let y=B__namespace.default.join(a,`${n}${p}`);if(We(y))return y}}return n}function rs(n){if(!We(n))return null;try{let e=Jn.readFileSync(n,"utf8"),t=B__namespace.default.dirname(n),r=[];for(let a of e.matchAll(/"([^"\r\n]*)"/g)){let u=(a[1]??"").match(/%~?dp0%?\s*[\\/]*(.*)$/i)?.[1]?.trim();if(!u)continue;let p=u.replace(/[\\/]+/g,B__namespace.default.sep).replace(/^[\\/]+/,""),y=B__namespace.default.resolve(t,p);We(y)&&r.push(y);}let o=[],s=new Map;for(let a of e.matchAll(/SET\s+"(\w+)=%~?dp0%?[\\/]?([^"]+)"/gi)){let d=a[1].toUpperCase(),l=a[2].trim().replace(/[\\/]+/g,B__namespace.default.sep).replace(/^[\\/]+/,"");s.set(d,B__namespace.default.resolve(t,l));}for(let a of e.split(/\r?\n/))if(a.includes("%*"))for(let d of a.matchAll(/"%(\w+)%"/g)){let l=s.get(d[1].toUpperCase());l&&We(l)&&o.push(l);}let i=a=>a.find(d=>{let l=Pt(B__namespace.default.basename(d));return l!=="node.exe"&&l!=="node"})??null;return i(o)??i(r)}catch{return null}}function ns(n,e){if(typeof e=="string")return bt(e)||null;if(!e||typeof e!="object")return null;if(n){let t=e[n],r=typeof t=="string"?bt(t):void 0;if(r)return r}for(let t of Object.values(e)){let r=typeof t=="string"?bt(t):void 0;if(r)return r}return null}function os(n,e){if(!e)return null;let t=B__namespace.default.dirname(n),r=[B__namespace.default.resolve(t,"..",e),B__namespace.default.resolve(t,"node_modules",e)];for(let o of r){let s=B__namespace.default.join(o,"package.json");if(We(s))try{let i=JSON.parse(Jn.readFileSync(s,"utf8")),a=ns(e,i.bin);if(!a)continue;let d=B__namespace.default.resolve(o,a);if(We(d))return d}catch{}}return null}function ss(n){let e=n.platform??process.platform,t=n.env??process.env,r=n.execPath??process.execPath;if(e!=="win32")return {command:n.command,leadingArgv:[],resolution:"direct"};let o=hn(n.command,t),s=Pt(B__namespace.default.extname(o));if(s===".js"||s===".cjs"||s===".mjs")return {command:r,leadingArgv:[o],resolution:"node-entrypoint",windowsHide:true};if(s===".cmd"||s===".bat"){let i=rs(o)??os(o,n.packageName);return i?Pt(B__namespace.default.extname(i))===".exe"?{command:i,leadingArgv:[],resolution:"exe-entrypoint",windowsHide:true}:{command:r,leadingArgv:[i],resolution:"node-entrypoint",windowsHide:true}:{command:o,leadingArgv:[],resolution:"unresolved-wrapper"}}return {command:o,leadingArgv:[],resolution:"direct"}}function is(n){if(n.candidate.resolution!=="unresolved-wrapper")return {command:n.candidate.command,leadingArgv:n.candidate.leadingArgv,resolution:n.candidate.resolution,windowsHide:n.candidate.windowsHide};if(n.allowShellFallback===true)return {command:n.candidate.command,leadingArgv:[],resolution:"shell-fallback",shell:true};throw new Error(`${B__namespace.default.basename(n.candidate.command)} wrapper resolved, but no executable/Node entrypoint could be resolved without shell execution.`)}function Ze(n){let e=ss(n);return is({candidate:e,allowShellFallback:n.allowShellFallback})}function et(n,e){return {command:n.command,argv:[...n.leadingArgv,...e],resolution:n.resolution,shell:n.shell,windowsHide:n.windowsHide}}var St=D(()=>{c();});function as(n){if(n.type!=="usage"||!("input_tokens"in n))return null;let e=Number(n.input_tokens??0),t=Number(n.output_tokens??0),o="cache_read_input_tokens"in n?Number(n.cache_read_input_tokens):void 0,s="cached_input_tokens"in n?Number(n.cached_input_tokens):void 0,i=o!==void 0?o:s??0;return {inputTokens:o!==void 0?e+o:e,outputTokens:t,cachedInputTokens:i}}function ds(n){let e=n.usage;if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e;if(!("input_tokens"in t))return null;let r=Number(t.input_tokens??0),o=Number(t.output_tokens??0),i="cache_read_input_tokens"in t?Number(t.cache_read_input_tokens):void 0,a="cached_input_tokens"in t?Number(t.cached_input_tokens):void 0,d=i!==void 0?i:a??0;return {inputTokens:i!==void 0?r+i:r,outputTokens:o,cachedInputTokens:d}}function ls(n){if(n.type!=="step_finish")return null;let t=n.part?.tokens;if(!t)return null;let r=Number(t.input??0),o=Number(t.output??0),s=t.cache,i=s?Number(s.read??0):0;return {inputTokens:r+i,outputTokens:o,cachedInputTokens:i}}function ne(n){if(!n||!n.trim())return;let e=null;for(let t of n.split(`
|
|
2
2
|
`))if(t.trim())try{let r=JSON.parse(t),o=as(r)??ds(r)??ls(r);o&&(e=o);}catch{}return e??void 0}var Te=D(()=>{c();});exports.RateLimitError=void 0;var or=D(()=>{c();exports.RateLimitError=class extends Error{name="RateLimitError";constructor(e){super(e);}};});function oe(n){return /crewx\s+(x|execute)\s/.test(n)}function se(n,e){let t=e.match(/@(\S+)/);return {timestamp:n,type:"agent_call",targetAgent:t?.[1]?.replace(/["']/g,""),toolInput:e}}var ze=D(()=>{c();});function ie(n){if(typeof n=="string")return n;if(!n||typeof n!="object")return JSON.stringify(n??{});let e=n;return typeof e.command=="string"?e.command:typeof e.file_path=="string"?e.file_path:typeof e.filePath=="string"?e.filePath:typeof e.path=="string"?e.path:typeof e.query=="string"?e.query:typeof e.pattern=="string"?e.pattern:typeof e.url=="string"?e.url:typeof e.prompt=="string"?e.prompt.length>200?e.prompt.slice(0,200)+"\u2026":e.prompt:typeof e.description=="string"?e.description:JSON.stringify(e)}var Ke=D(()=>{c();});function It(n){if(!n)return {};let e=n.match(/^(.+?)\[([^\]]+)\]$/);if(e){let t=e[2].toLowerCase();return cs.has(t)?{model:e[1],effort:e[2]}:{model:n}}return {model:n}}function wn(n){switch(n){case "agent-full-access":case "yolo":return ["--dangerously-bypass-approvals-and-sandbox"];case "read-only":case "plan":return ["--sandbox","read-only"];case "agent":return ["--sandbox","workspace-write"];default:return []}}function xn(n){return n?["-c",`model_reasoning_effort=${n}`]:[]}function kn(n){if(!n)return [];let e=new Set(["acceptEdits","bypassPermissions","default","delegate","dontAsk","plan"]),t=n==="auto"?"default":n;return e.has(t)?["--permission-mode",t]:[]}var cs,sr=D(()=>{c();cs=new Set(["minimal","low","medium","high","xhigh"]);});function us(n,e){let t=e.type;if(t==="text"){let r=String(e.text||"");return r?{timestamp:n,type:"text",content:r}:null}if(t==="thinking"){let r=String(e.thinking||"");return {timestamp:n,type:"thinking",content:r||"(thinking)"}}if(t==="tool_use"){let r=String(e.name||""),o=e.id,s=e.input,i=ie(s);return r==="Bash"&&oe(i)?se(n,i):{timestamp:n,type:"tool_use",toolUseId:o,toolName:r,toolInput:i}}if(t==="tool_result"){let r=!!e.is_error,o=e.tool_use_id,s=e.output??e.content??"",i;return typeof s=="string"?i=s:Array.isArray(s)?i=s.filter(a=>a.type==="text"&&typeof a.text=="string").map(a=>a.text).join(`
|
|
3
|
-
`):i=JSON.stringify(s),{timestamp:n,type:"tool_result",toolUseId:o,resultPreview:i,isError:r}}return null}var _n;exports.claudeAdapter=void 0;var ir=D(()=>{c();or();ze();Ke();sr();_n=false,exports.claudeAdapter={command:"claude",buildArgs(n,e,t){let{model:r,effort:o}=It(e.model);(e.effort??o)&&!_n&&(_n=true,console.warn("[crewx] claude-cli: effort option has no equivalent CLI flag and will be ignored"));let i=kn(e.mode),a=r?["--model",r]:[];if(e.additionalArgs!==void 0){let l=[...e.additionalArgs]
|
|
3
|
+
`):i=JSON.stringify(s),{timestamp:n,type:"tool_result",toolUseId:o,resultPreview:i,isError:r}}return null}var _n;exports.claudeAdapter=void 0;var ir=D(()=>{c();or();ze();Ke();sr();_n=false,exports.claudeAdapter={command:"claude",buildArgs(n,e,t){let{model:r,effort:o}=It(e.model);(e.effort??o)&&!_n&&(_n=true,console.warn("[crewx] claude-cli: effort option has no equivalent CLI flag and will be ignored"));let i=kn(e.mode),a=r?["--model",r]:[];if(e.additionalArgs!==void 0){let l=[...e.additionalArgs];return l.indexOf("-p")!==-1?{args:["--output-format","stream-json","--verbose",...i,...a,...l],stdinMessage:n}:{args:["--output-format","stream-json","--verbose",...i,...a,...l],stdinMessage:n}}return {args:["-p","--output-format","stream-json","--verbose",...i,...a],stdinMessage:n}},extractText(n){let e=n.split(`
|
|
4
4
|
`).filter(o=>o.trim()),t=[],r=null;for(let o of e)try{let s=JSON.parse(o);if(s.type==="assistant"&&Array.isArray(s.message?.content))for(let i of s.message.content)i.type==="text"&&typeof i.text=="string"&&i.text.trim()&&t.push(i.text.trim());s.type==="result"&&typeof s.result=="string"&&(r=s.result);}catch{}return t.length>0?t.join(`
|
|
5
5
|
|
|
6
6
|
`):r||n.trim()},extractFailure(n){if(n.includes('"rate_limit_event"'))try{let e=JSON.parse(n);if(e.type==="rate_limit_event"){let t=e.rate_limit_info??{};if(t.status==="rejected")return new exports.RateLimitError(`Claude rate limit: ${t.rateLimitType??"unknown"} (status: ${t.status})`)}}catch{}return null},parseResultMeta(n){let e=n.split(`
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
`):r||n.trim()},parseResultMeta(n){let e=ne(n);return e?{usage:{inputTokens:e.inputTokens,outputTokens:e.outputTokens,cachedInputTokens:e.cachedInputTokens,costUsd:0},model:null}:{usage:null,model:null}},parseEvent(n,e){let t;try{t=JSON.parse(n);}catch{return []}let r=t.type;if(!r)return [];if(!r.startsWith("tool.execution")&&!r.startsWith("assistant.")&&r!=="user.message")return [];let o=t.data;if(!o)return [];let s=e??new Date().toISOString(),i=o.toolCallId;if(r==="tool.execution_start"){let a=String(o.toolName||""),d=o.arguments,l=ie(d);return (a==="bash"||a==="Bash")&&oe(l)?[se(s,l)]:[{timestamp:s,type:"tool_use",toolName:a,toolInput:l,...i&&{toolUseId:i}}]}if(r==="tool.execution_complete"){let a=o.error;if(a)return [{timestamp:s,type:"tool_result",isError:true,resultPreview:String(a.message||""),...i&&{toolUseId:i}}];let d=o.result,l=String(d?.content||"");return [{timestamp:s,type:"tool_result",resultPreview:l,isError:false,...i&&{toolUseId:i}}]}if(r==="assistant.message"){let a=String(o.content||"");return a?[{timestamp:s,type:"text",content:a}]:[]}return []}};});function ps(n,e){if(e.type==="command_execution"){let r=String(e.command||"");return oe(r)?[se(n,r)]:[{timestamp:n,type:"tool_use",toolName:"Bash",toolInput:r}]}return []}function gs(n,e){let t=e.type;if(t==="message"||t==="text"){let r=e.content;if(Array.isArray(r))for(let o of r){let s=ms(n,o);if(s)return s}if(typeof e.text=="string")return {timestamp:n,type:"text",content:e.text}}if(t==="reasoning")return {timestamp:n,type:"text",content:String(e.text||"")};if(t==="command_execution"){let r=String(e.aggregated_output||e.output||""),o=!!e.is_error;return {timestamp:n,type:"tool_result",resultPreview:r,isError:o}}if(t==="tool_use"){let r=String(e.name||e.tool_name||""),o=e.input,s=ie(o);return r==="Bash"&&oe(s)?se(n,s):{timestamp:n,type:"tool_use",toolName:r,toolInput:s}}if(t==="tool_result"){let r=!!e.is_error,o=String(e.output||e.content||"");return {timestamp:n,type:"tool_result",resultPreview:o,isError:r}}return null}function ms(n,e){let t=e.type;if(t==="text")return {timestamp:n,type:"text",content:String(e.text||"")};if(t==="tool_use"){let r=String(e.name||""),o=e.input,s=ie(o);return r==="Bash"&&oe(s)?se(n,s):{timestamp:n,type:"tool_use",toolName:r,toolInput:s}}return null}exports.codexAdapter=void 0;var lr=D(()=>{c();Te();ze();Ke();sr();exports.codexAdapter={command:"codex",buildArgs(n,e,t){let{model:r,effort:o}=It(e.model),s=e.effort??o,i=wn(e.mode),a=xn(s),d=r?["-m",r]:[],l=e.additionalArgs??[];return {args:["exec",...l.includes("--experimental-json")?[]:["--json"],...i,...a,...d,...l],stdinMessage:n}},extractText(n){let e=n.split(`
|
|
12
12
|
`).filter(o=>o.trim()),t=[],r=null;for(let o of e)try{let s=JSON.parse(o);if(s.type==="item.completed"&&(s.item?.type==="message"||s.item?.type==="agent_message")&&typeof s.item?.text=="string"){let i=s.item.text;i.trim()&&t.push(i.trim());}s.type==="result"&&typeof s.result=="string"&&(r=s.result);}catch{}return t.length>0?t.join(`
|
|
13
13
|
|
|
14
|
-
`):r||n.trim()},parseResultMeta(n){let e=ne(n);return e?{usage:{inputTokens:e.inputTokens,outputTokens:e.outputTokens,cachedInputTokens:e.cachedInputTokens,costUsd:0},model:null}:{usage:null,model:null}},parseEvent(n,e){let t;try{t=JSON.parse(n);}catch{return []}let r=t.type;if(!r)return [];if(!r.startsWith("item.")&&!r.startsWith("turn.")&&!r.startsWith("thread."))return [];let o=t.item;if(!o)return [];let s=e??new Date().toISOString();if(r==="item.started")return ps(s,o);if(r==="item.completed"){let i=gs(s,o);return i?[i]:[]}return []}};});exports.opencodeAdapter=void 0;var cr=D(()=>{c();Te();Ke();exports.opencodeAdapter={command:"opencode",buildArgs(n,e,t){let r=e.additionalArgs,o=r!==void 0?[...r]:["run"];return o.includes("--format")||o.push("--format","json"),e.model&&o.push("--model",e.model),
|
|
14
|
+
`):r||n.trim()},parseResultMeta(n){let e=ne(n);return e?{usage:{inputTokens:e.inputTokens,outputTokens:e.outputTokens,cachedInputTokens:e.cachedInputTokens,costUsd:0},model:null}:{usage:null,model:null}},parseEvent(n,e){let t;try{t=JSON.parse(n);}catch{return []}let r=t.type;if(!r)return [];if(!r.startsWith("item.")&&!r.startsWith("turn.")&&!r.startsWith("thread."))return [];let o=t.item;if(!o)return [];let s=e??new Date().toISOString();if(r==="item.started")return ps(s,o);if(r==="item.completed"){let i=gs(s,o);return i?[i]:[]}return []}};});exports.opencodeAdapter=void 0;var cr=D(()=>{c();Te();Ke();exports.opencodeAdapter={command:"opencode",buildArgs(n,e,t){let r=e.additionalArgs,o=r!==void 0?[...r]:["run"];return o.includes("--format")||o.push("--format","json"),e.model&&o.push("--model",e.model),{args:o,stdinMessage:n}},extractText(n){let e=n.split(`
|
|
15
15
|
`).filter(o=>o.trim()),t=[],r=null;for(let o of e)try{let s=JSON.parse(o);if(s.type==="text"&&typeof s.part?.text=="string"){let i=s.part.text;i.trim()&&t.push(i.trim());}s.type==="result"&&typeof s.result=="string"&&(r=s.result);}catch{}return t.length>0?t.join(""):r||n.trim()},parseResultMeta(n){let e=ne(n);return e?{usage:{inputTokens:e.inputTokens,outputTokens:e.outputTokens,cachedInputTokens:e.cachedInputTokens,costUsd:0},model:null}:{usage:null,model:null}},parseEvent(n,e){let t;try{t=JSON.parse(n);}catch{return []}let r=t.type;if(!r)return [];let o=e??new Date().toISOString();if(r==="text"){let i=t.part?.text;return i?[{timestamp:o,type:"text",content:i}]:[]}if(r==="tool_use"){let s=t.part;if(!s)return [];let i=String(s.tool||""),a=String(s.callID||""),d=s.state,l=String(d?.status||""),u=d?.input,p=ie(u),y=[{timestamp:o,type:"tool_use",toolName:i,toolUseId:a,toolInput:p}];if(l==="completed"&&d?.output!==void 0){let g=d.output,h=typeof g=="string"?g:JSON.stringify(g);y.push({timestamp:o,type:"tool_result",toolUseId:a,resultPreview:h,isError:false});}else l==="error"&&y.push({timestamp:o,type:"tool_result",toolUseId:a,resultPreview:String(d?.error||"tool error"),isError:true});return y}return []}};});var ur,pr=D(()=>{c();ur={command:"agy",buildArgs(n,e,t){if(e.additionalArgs!==void 0){let o=[...e.additionalArgs];return o.includes("--print")||o.unshift("--print",n),e.model&&o.push("--model",e.model),o.push("--dangerously-skip-permissions"),{args:o}}let r=["--print",n,"--dangerously-skip-permissions"];return e.model&&r.push("--model",e.model),{args:r}},extractText(n){return n.trim()},parseResultMeta(n){return {usage:null,model:null}},parseEvent(n,e){return []}};});function rt(n,e,t){if(t){let r=exports.BUILTIN_ADAPTERS[t];if(r?.parseEvent)return r.parseEvent(e,n)}for(let r of Object.values(exports.BUILTIN_ADAPTERS)){let o=r.parseEvent?.(e,n)??[];if(o.length>0)return o}return []}exports.BUILTIN_ADAPTERS=void 0;var be=D(()=>{c();ir();ar();dr();lr();cr();pr();ir();ar();dr();lr();cr();pr();ze();exports.BUILTIN_ADAPTERS={claude:exports.claudeAdapter,gemini:exports.geminiAdapter,copilot:exports.copilotAdapter,codex:exports.codexAdapter,opencode:exports.opencodeAdapter,antigravity:ur};});function ys(n){let e=n.split(`
|
|
16
16
|
`).filter(d=>d.trim()),t=[],r=[],o=[],s=[],i=[],a=null;for(let d of e)try{let l=JSON.parse(d);if(l.type==="assistant"&&Array.isArray(l.message?.content))for(let u of l.message.content)u.type==="text"&&typeof u.text=="string"&&u.text.trim()&&t.push(u.text.trim());if(l.type==="message"&&l.role==="assistant"&&l.delta===!0&&typeof l.content=="string"&&r.push(l.content),l.type==="assistant.message"&&typeof l.data?.content=="string"){let u=l.data.content;u.trim()&&o.push(u.trim());}if(l.type==="item.completed"&&(l.item?.type==="message"||l.item?.type==="agent_message")&&typeof l.item?.text=="string"){let u=l.item.text;u.trim()&&s.push(u.trim());}if(l.type==="text"&&typeof l.part?.text=="string"){let u=l.part.text;u.trim()&&i.push(u.trim());}l.type==="result"&&typeof l.result=="string"&&(a=l.result);}catch{}return t.length>0?t.join(`
|
|
17
17
|
|
package/package.json
CHANGED
|
@@ -389,17 +389,12 @@ documents:
|
|
|
389
389
|
path: "../documents/crewx-manual.md"
|
|
390
390
|
summary: "CrewX User Manual"
|
|
391
391
|
|
|
392
|
-
# 빌트인 에이전트(@claude, @gemini 등)용 가벼운 안내서. 자세한 건 @crewx에게.
|
|
393
|
-
crewx_quick_guide:
|
|
394
|
-
path: "../documents/crewx-quick-guide.md"
|
|
395
|
-
render: true
|
|
396
|
-
|
|
397
392
|
agents:
|
|
398
393
|
- id: "crewx"
|
|
399
394
|
name: "CrewX Assistant"
|
|
400
395
|
role: "assistant"
|
|
401
396
|
team: "CrewX"
|
|
402
|
-
provider: ["cli/claude", "cli/
|
|
397
|
+
provider: ["cli/claude", "cli/copilot"] # Fallback order: claude → copilot
|
|
403
398
|
working_directory: "."
|
|
404
399
|
# Note: Uses provider array for automatic fallback when no model is specified
|
|
405
400
|
inline:
|
|
@@ -430,123 +425,4 @@ agents:
|
|
|
430
425
|
options:
|
|
431
426
|
execute:
|
|
432
427
|
cli/claude: ["--add-dir=.", "--permission-mode=acceptEdits"]
|
|
433
|
-
cli/gemini: ["--include-directories=."]
|
|
434
428
|
cli/copilot: ["--add-dir=."]
|
|
435
|
-
|
|
436
|
-
- id: "claude"
|
|
437
|
-
name: "Claude AI"
|
|
438
|
-
role: "general"
|
|
439
|
-
team: "Anthropic"
|
|
440
|
-
provider: "cli/claude"
|
|
441
|
-
working_directory: "."
|
|
442
|
-
inline:
|
|
443
|
-
prompt: |
|
|
444
|
-
You are Claude, an AI assistant by Anthropic, integrated as a built-in agent in the CrewX system.
|
|
445
|
-
|
|
446
|
-
## Your Strengths
|
|
447
|
-
- Complex reasoning and analysis
|
|
448
|
-
- Code review and architecture design
|
|
449
|
-
- Detailed explanations
|
|
450
|
-
- Web search capabilities
|
|
451
|
-
|
|
452
|
-
{{#if documents.crewx_quick_guide}}
|
|
453
|
-
<document title="Built-in Agent Guidelines" drilldown="true">
|
|
454
|
-
**Table of Contents:**
|
|
455
|
-
{{{documents.crewx_quick_guide.toc}}}
|
|
456
|
-
|
|
457
|
-
> Need details? Read the file at: `{{documents.crewx_quick_guide.path}}`
|
|
458
|
-
</document>
|
|
459
|
-
{{/if}}
|
|
460
|
-
options:
|
|
461
|
-
query: ["--add-dir=.", "--allowed-tools=WebSearch", "--output-format", "stream-json", "--verbose"]
|
|
462
|
-
execute: ["--add-dir=.", "--allowed-tools=WebSearch", "--output-format", "stream-json", "--permission-mode=acceptEdits", "--verbose"]
|
|
463
|
-
|
|
464
|
-
- id: "gemini"
|
|
465
|
-
name: "Google Gemini"
|
|
466
|
-
role: "general"
|
|
467
|
-
team: "Google"
|
|
468
|
-
provider: "cli/gemini"
|
|
469
|
-
working_directory: "."
|
|
470
|
-
inline:
|
|
471
|
-
prompt: |
|
|
472
|
-
You are Gemini, Google's AI model, integrated as a built-in agent in the CrewX system.
|
|
473
|
-
|
|
474
|
-
## Your Strengths
|
|
475
|
-
- Performance optimization
|
|
476
|
-
- Data analysis and mathematical problems
|
|
477
|
-
- Research and information gathering
|
|
478
|
-
- Web search capabilities
|
|
479
|
-
|
|
480
|
-
{{#if documents.crewx_quick_guide}}
|
|
481
|
-
<document title="Built-in Agent Guidelines" drilldown="true">
|
|
482
|
-
**Table of Contents:**
|
|
483
|
-
{{{documents.crewx_quick_guide.toc}}}
|
|
484
|
-
|
|
485
|
-
> Need details? Read the file at: `{{documents.crewx_quick_guide.path}}`
|
|
486
|
-
</document>
|
|
487
|
-
{{/if}}
|
|
488
|
-
options:
|
|
489
|
-
query: ["--include-directories=.", "--allowed-tools=web_search"]
|
|
490
|
-
execute: ["--include-directories=.", "--allowed-tools=web_search"]
|
|
491
|
-
|
|
492
|
-
- id: "copilot"
|
|
493
|
-
name: "GitHub Copilot"
|
|
494
|
-
role: "general"
|
|
495
|
-
team: "GitHub"
|
|
496
|
-
provider: "cli/copilot"
|
|
497
|
-
working_directory: "."
|
|
498
|
-
inline:
|
|
499
|
-
prompt: |
|
|
500
|
-
You are GitHub Copilot, an AI coding assistant by GitHub, integrated as a built-in agent in the CrewX system.
|
|
501
|
-
|
|
502
|
-
## Your Strengths
|
|
503
|
-
- Code implementation and generation
|
|
504
|
-
- Best practices and coding standards
|
|
505
|
-
- Testing and debugging
|
|
506
|
-
- Quick code suggestions
|
|
507
|
-
|
|
508
|
-
**IMPORTANT COPILOT-SPECIFIC RULES:**
|
|
509
|
-
- Do NOT use bullet points (●) or other formatting before the tags
|
|
510
|
-
|
|
511
|
-
## Note
|
|
512
|
-
You do not have web search capabilities. For web research, users should use @claude or @gemini.
|
|
513
|
-
|
|
514
|
-
{{#if documents.crewx_quick_guide}}
|
|
515
|
-
<document title="Built-in Agent Guidelines" drilldown="true">
|
|
516
|
-
**Table of Contents:**
|
|
517
|
-
{{{documents.crewx_quick_guide.toc}}}
|
|
518
|
-
|
|
519
|
-
> Need details? Read the file at: `{{documents.crewx_quick_guide.path}}`
|
|
520
|
-
</document>
|
|
521
|
-
{{/if}}
|
|
522
|
-
options:
|
|
523
|
-
query: ["--add-dir=."]
|
|
524
|
-
execute: ["--add-dir=."]
|
|
525
|
-
|
|
526
|
-
- id: "codex"
|
|
527
|
-
name: "Codex AI"
|
|
528
|
-
role: "general"
|
|
529
|
-
team: "Codex"
|
|
530
|
-
provider: "cli/codex"
|
|
531
|
-
working_directory: "."
|
|
532
|
-
inline:
|
|
533
|
-
prompt: |
|
|
534
|
-
You are Codex, an AI assistant integrated as a built-in agent in the CrewX system.
|
|
535
|
-
|
|
536
|
-
## Your Strengths
|
|
537
|
-
- Code generation and analysis
|
|
538
|
-
- Development assistance
|
|
539
|
-
- Problem solving
|
|
540
|
-
- Technical documentation
|
|
541
|
-
|
|
542
|
-
{{#if documents.crewx_quick_guide}}
|
|
543
|
-
<document title="Built-in Agent Guidelines" drilldown="true">
|
|
544
|
-
**Table of Contents:**
|
|
545
|
-
{{{documents.crewx_quick_guide.toc}}}
|
|
546
|
-
|
|
547
|
-
> Need details? Read the file at: `{{documents.crewx_quick_guide.path}}`
|
|
548
|
-
</document>
|
|
549
|
-
{{/if}}
|
|
550
|
-
options:
|
|
551
|
-
query: ["exec", "--experimental-json"]
|
|
552
|
-
execute: ["exec", "-s", "workspace-write", "--experimental-json"]
|