@crewx/cli 0.9.0-rc.187 → 0.9.0-rc.189
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.
|
@@ -10,6 +10,7 @@ export declare const STOP_USAGE = "Usage:\n crewx stop <task-id> [--grace=<ms>]
|
|
|
10
10
|
export declare const RESTART_USAGE = "Usage: crewx restart <task-id>\n\nRestart a failed task as a new task, reusing its thread, agent, and provider.";
|
|
11
11
|
export declare const HOOK_USAGE = "Usage: crewx hook install|uninstall|status [options]\n\n install [--yes] [--provider claude|codex] Install the PreToolUse hook in .claude/settings.json\n uninstall [--provider claude|codex] Remove the crewx hook\n status Show hook installation status and plugins";
|
|
12
12
|
export declare const HOOK_DISPATCH_USAGE = "Usage: crewx hook-dispatch --provider <claude|codex>\n\nInternal IPC router: reads one hook payload from stdin and writes the decision to stdout.\nAgent CLI hooks call it; people do not need to run it.";
|
|
13
|
+
export declare const HISTORY_USAGE = "Usage:\n crewx history toc <ref> [--from N] [--limit N]\n crewx history search <ref> (--query <text> | --query-stdin | --query64 <base64url>) [--limit N] [--cursor C]\n crewx history read <ref> --entry N [--offset B] [--bytes B]\n\nRead bounded pages from original messages, activity, and highlights for the current task.\nSearch is literal and accepts up to 256 UTF-8 bytes; --limit accepts 1-20 results.\n--query-stdin reads through EOF, validates UTF-8, and removes at most one trailing LF or CRLF.\nGenerated search continuations use portable --query64 arguments.\n\nExit codes: 2 invalid arguments/query/ref/cursor; 3 missing, expired, out-of-scope, or unavailable data; 4 tampered or unsafe history data.\nSize and I/O failures use exit code 3.";
|
|
13
14
|
export declare const SLACK_USAGE = "Usage: crewx slack:files --thread <thread_ts> [--list | --clean]\n crewx slack --mode <query|execute> --agent <agent-id>\n\nExample:\n crewx slack:files --thread 1234567890.123456";
|
|
14
15
|
export declare const AGENT_USAGE = "Usage: crewx agent [subcommand] [options]\n\n crewx agent # List configured agents (default)\n crewx agent ls # List configured agents\n crewx agent list # Alias for ls\n crewx agent prompt <id> # Inspect rendered agent prompt\n crewx agent interceptor test <id> --phase request|response --text \"<text>\" [--json]\n # Dry-run an agent's interceptor chain on a text (no agent start)\n\nFilter Options (for agent ls):\n --role <value> Filter by agent role (comma-separated for multiple: PM,Dev)\n --team <value> Filter by agent team (comma-separated for multiple)\n --provider <value> Filter by provider (comma-separated, partial match: claude)\n\nExamples:\n crewx agent\n crewx agent ls\n crewx agent ls --role=PM\n crewx agent ls --team=\"CrewX Core Team\"\n crewx agent ls --provider=claude\n crewx agent ls --role=PM --provider=claude\n crewx agent ls --role=PM,general\n CREWX_CONFIG=./crewx.yaml crewx agent list";
|
|
15
16
|
export declare const AGENT_LS_USAGE = "Usage: crewx agent ls [--role <value>] [--team <value>] [--provider <value>]\n\nList configured agents. Filters take comma-separated values; --provider also matches part of a name (claude).";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.AGENT_INTERCEPTOR_USAGE=exports.AGENT_PROMPT_USAGE=exports.AGENT_LS_USAGE=exports.AGENT_USAGE=exports.SLACK_USAGE=exports.HOOK_DISPATCH_USAGE=exports.HOOK_USAGE=exports.RESTART_USAGE=exports.STOP_USAGE=exports.INIT_USAGE=void 0;exports.isHelpRequest=a;exports.agentHelpUsage=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.AGENT_INTERCEPTOR_USAGE=exports.AGENT_PROMPT_USAGE=exports.AGENT_LS_USAGE=exports.AGENT_USAGE=exports.SLACK_USAGE=exports.HISTORY_USAGE=exports.HOOK_DISPATCH_USAGE=exports.HOOK_USAGE=exports.RESTART_USAGE=exports.STOP_USAGE=exports.INIT_USAGE=void 0;exports.isHelpRequest=a;exports.agentHelpUsage=s;exports.helpUsageFor=i;exports.INIT_USAGE=`Usage: crewx init [--force] [--provider cli/claude|cli/codex]
|
|
2
2
|
|
|
3
3
|
Create crewx.yaml, support folders, and a git repository in the current folder.
|
|
4
4
|
|
|
@@ -16,7 +16,18 @@ Restart a failed task as a new task, reusing its thread, agent, and provider.`;e
|
|
|
16
16
|
status Show hook installation status and plugins`;exports.HOOK_DISPATCH_USAGE=`Usage: crewx hook-dispatch --provider <claude|codex>
|
|
17
17
|
|
|
18
18
|
Internal IPC router: reads one hook payload from stdin and writes the decision to stdout.
|
|
19
|
-
Agent CLI hooks call it; people do not need to run it.`;exports.
|
|
19
|
+
Agent CLI hooks call it; people do not need to run it.`;exports.HISTORY_USAGE=`Usage:
|
|
20
|
+
crewx history toc <ref> [--from N] [--limit N]
|
|
21
|
+
crewx history search <ref> (--query <text> | --query-stdin | --query64 <base64url>) [--limit N] [--cursor C]
|
|
22
|
+
crewx history read <ref> --entry N [--offset B] [--bytes B]
|
|
23
|
+
|
|
24
|
+
Read bounded pages from original messages, activity, and highlights for the current task.
|
|
25
|
+
Search is literal and accepts up to 256 UTF-8 bytes; --limit accepts 1-20 results.
|
|
26
|
+
--query-stdin reads through EOF, validates UTF-8, and removes at most one trailing LF or CRLF.
|
|
27
|
+
Generated search continuations use portable --query64 arguments.
|
|
28
|
+
|
|
29
|
+
Exit codes: 2 invalid arguments/query/ref/cursor; 3 missing, expired, out-of-scope, or unavailable data; 4 tampered or unsafe history data.
|
|
30
|
+
Size and I/O failures use exit code 3.`;exports.SLACK_USAGE=`Usage: crewx slack:files --thread <thread_ts> [--list | --clean]
|
|
20
31
|
crewx slack --mode <query|execute> --agent <agent-id>
|
|
21
32
|
|
|
22
33
|
Example:
|
|
@@ -49,4 +60,4 @@ List configured agents. Filters take comma-separated values; --provider also mat
|
|
|
49
60
|
Print the fully rendered system prompt of one agent.`;exports.AGENT_INTERCEPTOR_USAGE=`Usage: crewx agent interceptor test <id> --phase request|response --text "<text>" [--json]
|
|
50
61
|
|
|
51
62
|
Run an agent's interceptor chain once on a text without starting the agent.
|
|
52
|
-
Exit 0 when the lane passes; exit 1 when it is blocked or the chain configuration is invalid.`;function a(e){return e.includes("--help")||e.includes("-h")}function
|
|
63
|
+
Exit 0 when the lane passes; exit 1 when it is blocked or the chain configuration is invalid.`;function a(e){return e.includes("--help")||e.includes("-h")}function s(e){const t=e.filter((r,n)=>e[n-1]!=="--text");if(!a(t))return void 0;switch((e[0]??"").toLowerCase()){case"ls":case"list":return exports.AGENT_LS_USAGE;case"prompt":case"p":return exports.AGENT_PROMPT_USAGE;case"interceptor":return exports.AGENT_INTERCEPTOR_USAGE;default:return exports.AGENT_USAGE}}function i(e,t){if(e==="history"){const r=t[0];if(r==="--help"||r==="-h")return exports.HISTORY_USAGE;if(t.length===2&&(r==="toc"||r==="search"||r==="read")&&(t[1]==="--help"||t[1]==="-h"))return exports.HISTORY_USAGE;return void 0}if(!a(t))return void 0;switch(e){case"agent":return s(t);case"init":return exports.INIT_USAGE;case"stop":case"kill":return exports.STOP_USAGE;case"restart":return exports.RESTART_USAGE;case"hook":return exports.HOOK_USAGE;case"hook-dispatch":return exports.HOOK_DISPATCH_USAGE;case"slack":case"slack:files":return exports.SLACK_USAGE;default:return void 0}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Readable, Writable } from 'node:stream';
|
|
2
|
+
export interface HistoryCommandDependencies {
|
|
3
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
4
|
+
readonly stdin?: Readable;
|
|
5
|
+
readonly stdout?: Writable;
|
|
6
|
+
readonly stderr?: Writable;
|
|
7
|
+
readonly platform?: NodeJS.Platform;
|
|
8
|
+
readonly resolveRealPath?: (path: string) => Promise<string>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Extracts the workspace root only from CrewX's pinned task-log path shape.
|
|
12
|
+
* The caller canonicalizes the returned root with realpath before opening the store.
|
|
13
|
+
*/
|
|
14
|
+
export declare function workspaceRootFromTaskLogPath(taskLogPath: string | undefined, platform?: NodeJS.Platform): string | undefined;
|
|
15
|
+
/** Maps typed SDK and command failures to the stable history CLI exit contract. */
|
|
16
|
+
export declare function historyErrorExitCode(error: unknown): number;
|
|
17
|
+
/** Runs one read-only history request and records an emission only after stdout flushes. */
|
|
18
|
+
export declare function handleHistory(args: readonly string[], dependencies?: HistoryCommandDependencies): Promise<void>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.workspaceRootFromTaskLogPath=T;exports.historyErrorExitCode=b;exports.handleHistory=H;const M=require("node:fs/promises");const p=require("node:path");const l=require("@crewx/sdk/history-snapshot");const D=/^hs1-[0-9a-f]{64}$/;const m=256;const S=m+2;const U=S+1;const C=20;const V=20;class i extends Error{code;constructor(n){super(n);this.code=n;this.name="HistoryInputError"}}class _ extends Error{code;exitCode;constructor(n,t){super(n);this.code=n;this.exitCode=t;this.name="HistoryCommandError"}}class R extends _{constructor(){super("IO_ERROR",3);this.name="HistoryOutputError"}}function T(e,n=process.platform){if(typeof e!=="string"||e.length===0)return void 0;const t=n==="win32"?p.win32:p.posix;if(!t.isAbsolute(e))return void 0;if(n==="win32"){const c=p.win32.parse(e).root;const s=/^[A-Za-z]:[\\/]?$/.test(c);const u=/^\\\\[^\\]+\\[^\\]+[\\/]?$/.test(c);const h=/^\\\\\?\\/.test(c);if(!s&&!u&&!h)return void 0}const r=t.resolve(e);const o=t.basename(r);if(o.length<=".log".length||!o.endsWith(".log"))return void 0;const f=t.dirname(r);if(t.basename(f)!=="logs")return void 0;const d=t.dirname(f);if(t.basename(d)!==".crewx")return void 0;const a=t.dirname(d);if(!t.isAbsolute(a))return void 0;return a}function b(e){if(e instanceof i)return 2;if(e instanceof _)return e.exitCode;if(!(e instanceof l.HistorySnapshotError))return 3;switch(e.code){case"INVALID_REF":return 2;case"TAMPERED":case"UNSAFE_FILE":return 4;case"NOT_FOUND":case"EXPIRED":case"SCOPE_MISMATCH":case"IDENTITY_MISSING":case"TOO_LARGE":case"IO_ERROR":return 3;default:return 3}}async function H(e,n={}){const t=n.env??process.env;const r=n.stdin??process.stdin;const o=n.stdout??process.stdout;const f=n.stderr??process.stderr;const d=n.platform??process.platform;const a=n.resolveRealPath??M.realpath;let c="request";try{const s=O(e);const u=s.operation==="search"?s.query.kind==="stdin"?await F(r):s.query.value:void 0;const h=T(t.CREWX_TASK_LOG_PATH,d);if(!h)throw new _("WORKSPACE_CONTEXT_MISSING",3);let I;try{I=await a(h)}catch{throw new _("WORKSPACE_CONTEXT_MISSING",3)}const y=(0,l.scopeFromEnv)(t,I);const w=await Q(I,y,s,u);const E=X(w);try{await k(o,E)}catch{throw new R}c="audit";await(0,l.recordHistoryEmission)(I,s.ref,y,w)}catch(s){$(f,s,c);process.exitCode=b(s)}}function O(e){const n=e[0];if(n!=="toc"&&n!=="search"&&n!=="read"){throw new i("INVALID_ARGUMENTS")}const t=e[1];if(typeof t!=="string"||!D.test(t)){throw new l.HistorySnapshotError("INVALID_REF")}const r=e.slice(2);if(n==="toc")return x(t,r);if(n==="search")return v(t,r);return B(t,r)}function x(e,n){const t=g(n,new Set(["--from","--limit"]));const r=t.has("--from")?A(t.get("--from"),1):void 0;const o=t.has("--limit")?A(t.get("--limit"),1,C):void 0;return{operation:"toc",ref:e,...r===void 0?{}:{from:r},...o===void 0?{}:{limit:o}}}function v(e,n){const t=new Map;const r=new Map;const o=new Set(["--query","--query64","--limit","--cursor"]);for(let s=0;s<n.length;s+=1){const u=n[s];if(u==="--query-stdin"){if(t.has(u))throw new i("INVALID_ARGUMENTS");t.set(u,void 0);continue}if(!o.has(u))throw new i("INVALID_ARGUMENTS");if(r.has(u))throw new i("INVALID_ARGUMENTS");const h=n[s+1];if(h===void 0)throw new i("INVALID_ARGUMENTS");r.set(u,h);s+=1}const f=Number(r.has("--query"))+Number(r.has("--query64"))+Number(t.has("--query-stdin"));if(f!==1)throw new i("INVALID_ARGUMENTS");const d=r.has("--query")?G(r.get("--query")):r.has("--query64")?P(r.get("--query64")):void 0;const a=r.has("--limit")?A(r.get("--limit"),1,V):void 0;const c=r.get("--cursor");if(c!==void 0&&c.length===0)throw new i("INVALID_ARGUMENTS");return{operation:"search",ref:e,query:d===void 0?{kind:"stdin"}:{kind:"text",value:d},...a===void 0?{}:{limit:a},...c===void 0?{}:{cursor:c}}}function B(e,n){const t=g(n,new Set(["--entry","--offset","--bytes"]));if(!t.has("--entry"))throw new i("INVALID_ARGUMENTS");const r=A(t.get("--entry"),1);const o=t.has("--offset")?A(t.get("--offset"),0):void 0;const f=t.has("--bytes")?A(t.get("--bytes"),1,l.MAX_PAGE_BYTES):void 0;return{operation:"read",ref:e,entry:r,...o===void 0?{}:{offset:o},...f===void 0?{}:{bytes:f}}}function g(e,n){const t=new Map;for(let r=0;r<e.length;r+=1){const o=e[r];if(!n.has(o)||t.has(o))throw new i("INVALID_ARGUMENTS");const f=e[r+1];if(f===void 0)throw new i("INVALID_ARGUMENTS");t.set(o,f);r+=1}return t}function A(e,n,t=Number.MAX_SAFE_INTEGER){if(!/^\d+$/.test(e))throw new i("INVALID_ARGUMENTS");const r=Number(e);if(!Number.isSafeInteger(r)||r<n||r>t){throw new i("INVALID_ARGUMENTS")}return r}function G(e){const n=Buffer.from(e,"utf8");if(e.length===0||n.byteLength>m||n.toString("utf8")!==e){throw new i("INVALID_QUERY")}return e}function P(e){if(!/^[A-Za-z0-9_-]+$/.test(e)||e.length%4===1){throw new i("INVALID_QUERY")}const n=Buffer.from(e,"base64url");if(n.toString("base64url")!==e)throw new i("INVALID_QUERY");return L(n,false)}function L(e,n=true){let t=e;if(n&&e.at(-1)===10){t=e.subarray(0,e.at(-2)===13?-2:-1)}if(t.byteLength===0||t.byteLength>m){throw new i("INVALID_QUERY")}const r=t.toString("utf8");if(!Y(Buffer.from(r,"utf8"),t))throw new i("INVALID_QUERY");return r}function Y(e,n){const t=new Uint8Array(e);const r=new Uint8Array(n);if(t.byteLength!==r.byteLength)return false;for(let o=0;o<t.byteLength;o+=1){if(t[o]!==r[o])return false}return true}async function F(e){if(e.isTTY||e.destroyed)throw new i("INVALID_QUERY");return await new Promise((n,t)=>{let r=false;const o=[];let f=0;const d=()=>{e.off("readable",s);e.off("end",u);e.off("error",h);e.off("close",I);e.pause()};const a=()=>{if(r)return;r=true;d();e.destroy();t(new i("INVALID_QUERY"))};const c=()=>{if(r)return;r=true;d();try{const y=new Uint8Array(f);let w=0;for(const E of o){const N=new Uint8Array(E);y.set(N,w);w+=N.byteLength}n(L(Buffer.from(y),true))}catch(y){t(y)}};const s=()=>{if(r)return;for(;;){const y=U-f;if(y<=0)return a();const w=Math.min(y,e.readableLength);const E=e.read(w>0?w:1);if(E===null)return;if(!Buffer.isBuffer(E))return a();f+=E.byteLength;if(f>S)return a();o.push(E)}};const u=()=>{s();c()};const h=()=>a();const I=()=>{if(!e.readableEnded)a()};e.on("readable",s);e.once("end",u);e.once("error",h);e.once("close",I);s()})}async function Q(e,n,t,r){switch(t.operation){case"toc":return await(0,l.tocHistory)(e,t.ref,n,{...t.from===void 0?{}:{from:t.from},...t.limit===void 0?{}:{limit:t.limit}});case"search":if(r===void 0)throw new i("INVALID_QUERY");try{return await(0,l.searchHistory)(e,t.ref,n,{query:r,...t.limit===void 0?{}:{limit:t.limit},...t.cursor===void 0?{}:{cursor:t.cursor}})}catch(o){if(t.cursor!==void 0&&o instanceof l.HistorySnapshotError&&o.code==="SCOPE_MISMATCH"){await(0,l.tocHistory)(e,t.ref,n,{limit:1});throw new i("INVALID_CURSOR")}throw o}case"read":return await(0,l.readHistory)(e,t.ref,n,{entry:t.entry,...t.offset===void 0?{}:{offset:t.offset},...t.bytes===void 0?{}:{bytes:t.bytes}})}}function X(e){const n=Buffer.from(e.text,"utf8");let t=1;for(const r of n){if(r===10)t+=1}if(n.byteLength!==e.byteCount||n.byteLength>l.MAX_PAGE_BYTES||t>l.MAX_PAGE_LINES){throw new l.HistorySnapshotError("TAMPERED")}return n}function k(e,n){if(e.destroyed||e.writableEnded)return Promise.reject(new R);return new Promise((t,r)=>{let o=false;let f=false;const d=()=>{e.off("error",c);e.off("close",s)};const a=(u=true)=>{if(o)return;o=true;if(u)d();r(new R)};const c=()=>{a();d()};const s=()=>{if(!f)a(false);d()};e.once("error",c);e.once("close",s);try{e.write(n,u=>{if(u){a(false);return}f=true;if(o)return;o=true;d();t()})}catch{a(false)}})}function q(e){if(e instanceof l.HistorySnapshotError)return e.code;if(e instanceof i||e instanceof _)return e.code;return"IO_ERROR"}function $(e,n,t){const r=q(n);const o=t==="audit"?"audit failed":n instanceof R?"output failed":n instanceof i||r==="INVALID_REF"?"invalid input":r==="TAMPERED"||r==="UNSAFE_FILE"?"unsafe history data":"unavailable";try{e.write(`history: ${o} (${r})
|
|
2
|
+
`)}catch{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NOT_YET_MIGRATED=exports.BUILTIN_COMMAND_NAMES=exports.KNOWN_COMMANDS=void 0;exports.KNOWN_COMMANDS=new Set(["q","query","x","execute","agent","ps","stop","kill","result","log","restart","doctor","init","db","help","shortcut","ai-account","publish","slack","slack:files","hook","hook-dispatch"]);exports.BUILTIN_COMMAND_NAMES=new Set(["memory","search","doc","wbs","cron","workflow","skill","dreaming","wi","chromex","notify","app"]);exports.NOT_YET_MIGRATED=new Set(["template","templates","chat","mcp"]);
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NOT_YET_MIGRATED=exports.BUILTIN_COMMAND_NAMES=exports.KNOWN_COMMANDS=void 0;exports.KNOWN_COMMANDS=new Set(["q","query","x","execute","agent","history","ps","stop","kill","result","log","restart","doctor","init","db","help","shortcut","ai-account","publish","slack","slack:files","hook","hook-dispatch"]);exports.BUILTIN_COMMAND_NAMES=new Set(["memory","search","doc","wbs","cron","workflow","skill","dreaming","wi","chromex","notify","app"]);exports.NOT_YET_MIGRATED=new Set(["template","templates","chat","mcp"]);
|
package/dist/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var w=exports&&exports.__createBinding||(Object.create?(function(
|
|
2
|
+
"use strict";var w=exports&&exports.__createBinding||(Object.create?(function(o,e,t,s){if(s===void 0)s=t;var r=Object.getOwnPropertyDescriptor(e,t);if(!r||("get"in r?!e.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return e[t]}}}Object.defineProperty(o,s,r)}):(function(o,e,t,s){if(s===void 0)s=t;o[s]=e[t]}));var v=exports&&exports.__setModuleDefault||(Object.create?(function(o,e){Object.defineProperty(o,"default",{enumerable:true,value:e})}):function(o,e){o["default"]=e});var k=exports&&exports.__importStar||(function(){var o=function(e){o=Object.getOwnPropertyNames||function(t){var s=[];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))s[s.length]=r;return s};return o(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var s=o(e),r=0;r<s.length;r++)if(s[r]!=="default")w(t,e,s[r])}v(t,e);return t}})();Object.defineProperty(exports,"__esModule",{value:true});const u=require("./utils/sdk-compat");const _=require("@crewx/sdk/account");const y=require("@crewx/sdk");const b=require("./utils/inherited-trace");process.env.CREWX_CLI??=u.sdkCompat.resolveCrewxCli();process.env.CREWX_WORKSPACE??=u.sdkCompat.resolveCrewxWorkspace();(0,_.loadCrewxEnvFiles)();(0,b.consumeInheritedRunnerIdentity)();u.sdkCompat.initPricingRemote();const x=require("./commands/query");const q=require("./commands/execute");const S=require("./commands/agent");const C=require("./commands/ps");const d=require("./commands/stop");const O=require("./commands/result");const P=require("./commands/restart");const I=require("./commands/log");const D=require("./commands/doctor");const h=require("./commands/init");const E=require("./commands/shortcut");const R=require("./commands/ai-account");const M=require("./commands/publish");const p=require("./builtin");const j=require("./commands/slack");const N=require("./commands/hook/install");const A=require("./commands/hook/uninstall");const U=require("./commands/hook/status");const L=require("./commands/hook-dispatch");const T=require("./commands/db");const B=require("./commands/history");const W=require("./commands/command-help");const $=require("./commands/parse-common-flags");const l=require("./commands/registry");const F=require("./utils/version");const H=require("./utils/product-package-root");const g=require("./commands/emit-trailer");async function G(){const{join:o}=await Promise.resolve().then(()=>k(require("path")));const{createRequire:e}=require("module");const t=e(__filename);const s=o(__dirname,"../../../bin/cli-commands.js");const{CLI_SUBCOMMANDS:r}=t(s);const n=new Set([...l.KNOWN_COMMANDS,...l.BUILTIN_COMMAND_NAMES,...l.NOT_YET_MIGRATED]);const i=[...n].filter(c=>!r.has(c));const a=[...r].filter(c=>!n.has(c));if(i.length>0||a.length>0){throw new Error(`[crewx dev] SSOT drift detected!
|
|
3
3
|
`+(i.length?` registry has, CLI_SUBCOMMANDS missing: ${i.join(", ")}
|
|
4
|
-
`:"")+(a.length?` CLI_SUBCOMMANDS has, registry missing: ${a.join(", ")}`:""))}}async function
|
|
5
|
-
CrewX CLI v${
|
|
4
|
+
`:"")+(a.length?` CLI_SUBCOMMANDS has, registry missing: ${a.join(", ")}`:""))}}async function K(o){if(process.env["NODE_ENV"]==="development"){await G()}const e=process.argv.slice(2);const t=e[0];if(!t){f();process.exit(0)}if(p.BUILTIN_COMMANDS.has(t)){const r=t==="skill"?(0,H.resolveProductRootFromCliEntry)(process.argv[1]):void 0;await(0,p.handleBuiltin)(t,e.slice(1),r);return}const s=(0,W.helpUsageFor)(t,e.slice(1));if(s!==void 0){console.log(s);return}switch(t){case"history":await(0,B.handleHistory)(e.slice(1));return;case"q":case"query":await(0,x.handleQuery)(e.slice(1),t,o);return;case"x":case"execute":await(0,q.handleExecute)(e.slice(1),t,o);return;case"agent":await(0,S.handleAgent)(e.slice(1));return;case"ps":await(0,C.handlePs)(e.slice(1));return;case"stop":await(0,d.handleStop)(e.slice(1),"stop");return;case"kill":await(0,d.handleStop)(e.slice(1),"kill");return;case"result":await(0,O.handleResult)(e.slice(1));return;case"restart":await(0,P.handleRestart)(e.slice(1));return;case"log":await(0,I.handleLog)(e.slice(1));return;case"doctor":await(0,D.handleDoctor)(e.slice(1));return;case"init":{const r=e.slice(1);const n=r.includes("--force")||r.includes("-f");try{const i=(0,h.parseInitProvider)(r);const a=await(0,h.handleInit)({path:process.cwd(),force:n,provider:i});if(a.skippedReason==="yaml-exists"){console.log("\u2713 crewx.yaml already exists (use --force to overwrite)")}else{console.log(a.yamlCreated?"\u2713 crewx.yaml created":"\u2713 yaml skipped");console.log(a.hookInstalled?"\u2713 hook installed":"\u26A0 hook skipped");if(a.errors.length>0)console.warn("Warnings:",a.errors.join("; "))}const c=(0,y.getDefaultAgentProfile)(a.provider);if(c){console.log(`\u2713 default agents: ${a.provider} (${c.planner.model} / ${c.worker.model})`)}if(a.workspaceId)console.log(`\u2713 workspace registered (id=${a.workspaceId}, slug=${a.slug})`);console.log("\u2713 done")}catch(i){console.error("\u2717 init failed:",i.message);process.exit(1)}return}case"db":await(0,T.handleDb)(e.slice(1));return;case"shortcut":await(0,E.handleShortcut)(e.slice(1));return;case"ai-account":await(0,R.handleAiAccount)(e.slice(1));return;case"publish":await(0,M.handlePublish)(e.slice(1));return;case"slack":case"slack:files":await(0,j.handleSlack)(e.slice(1));return;case"hook-dispatch":await(0,L.handleHookDispatch)(e.slice(1));return;case"help":case"--help":case"-h":f();return;case"--version":case"-v":{const r=require("../package.json");console.log(r.version);return}}if(l.NOT_YET_MIGRATED.has(t)){console.error(`Command '${t}' is not yet migrated in SDK refactor round. See packages/cli-bak for reference.`);process.exit(1)}if(t==="hook"){const r=e[1];const n=e.slice(2);switch(r){case"install":await(0,N.handleHookInstall)(n);return;case"uninstall":await(0,A.handleHookUninstall)(n);return;case"status":await(0,U.handleHookStatus)(n);return;default:console.error(`Unknown hook subcommand: ${r??"(none)"}`);console.error("Usage: crewx hook install|uninstall|status");process.exit(1)}}console.error(`Unknown command: ${t}`);console.error("Run `crewx --help` for usage.");process.exit(1)}function f(){console.log(`
|
|
5
|
+
CrewX CLI v${F.CLI_VERSION}
|
|
6
6
|
|
|
7
7
|
Usage:
|
|
8
8
|
crewx Launch web dashboard + open browser (default)
|
|
@@ -112,4 +112,4 @@ Hook Platform:
|
|
|
112
112
|
Global Options:
|
|
113
113
|
--help, -h Show this help
|
|
114
114
|
--version, -v Show version
|
|
115
|
-
`.trim())}function
|
|
115
|
+
`.trim())}function V(o){if(o instanceof $.UnknownOptionError)return 2;if(typeof o==="object"&&o!==null&&"exitCode"in o){const e=o.exitCode;if(typeof e==="number")return e}return 1}const m=(0,g.createDelegationEmitState)();K(m).catch(o=>{console.error(o instanceof Error?o.message:String(o));(0,g.emitDelegationResult)({command:process.argv[2],isError:true,state:m});process.exit(V(o))});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crewx/cli",
|
|
3
|
-
"version": "0.9.0-rc.
|
|
3
|
+
"version": "0.9.0-rc.189",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.19.0"
|
|
@@ -25,20 +25,20 @@
|
|
|
25
25
|
"better-sqlite3": "*",
|
|
26
26
|
"dotenv": "17.2.3",
|
|
27
27
|
"isomorphic-git": "1.37.1",
|
|
28
|
-
"@crewx/sdk": "0.9.0-rc.
|
|
29
|
-
"@crewx/
|
|
30
|
-
"@crewx/search": "0.1.10-rc.
|
|
31
|
-
"@crewx/
|
|
32
|
-
"@crewx/
|
|
33
|
-
"@crewx/wbs": "0.1.10-rc.
|
|
34
|
-
"@crewx/
|
|
35
|
-
"@crewx/skill": "0.1.20-rc.
|
|
36
|
-
"@crewx/
|
|
37
|
-
"@crewx/
|
|
38
|
-
"@crewx/
|
|
39
|
-
"@crewx/
|
|
40
|
-
"@crewx/
|
|
41
|
-
"@crewx/notify": "0.1.0-rc.
|
|
28
|
+
"@crewx/sdk": "0.9.0-rc.189",
|
|
29
|
+
"@crewx/knowledge-core": "0.1.17-rc.199",
|
|
30
|
+
"@crewx/search": "0.1.10-rc.185",
|
|
31
|
+
"@crewx/doc": "0.1.9-rc.182",
|
|
32
|
+
"@crewx/cron": "0.1.10-rc.224",
|
|
33
|
+
"@crewx/wbs": "0.1.10-rc.215",
|
|
34
|
+
"@crewx/workflow": "0.3.22-rc.235",
|
|
35
|
+
"@crewx/skill": "0.1.20-rc.83",
|
|
36
|
+
"@crewx/chromex": "0.1.0-rc.222",
|
|
37
|
+
"@crewx/memory": "0.1.23-rc.206",
|
|
38
|
+
"@crewx/shared": "0.0.6-rc.104",
|
|
39
|
+
"@crewx/app": "0.1.0-rc.70",
|
|
40
|
+
"@crewx/wi": "0.1.10-rc.209",
|
|
41
|
+
"@crewx/notify": "0.1.0-rc.160"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/better-sqlite3": "*",
|