@codex-ultra/cxu 0.2.10 → 0.2.12
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/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/postinstall.js +1 -1
- package/dist/vendor/saVmTool.d.ts +46 -1
- package/package.json +1 -1
package/dist/postinstall.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{spawnSync as m}from"node:child_process";import{chmodSync as b,existsSync as h,mkdirSync as v,statSync as w,writeFileSync as k}from"node:fs";import{createRequire as y}from"node:module";import{homedir as S}from"node:os";import{dirname as B,join as t}from"node:path";import{fileURLToPath as V}from"node:url";function s(){let e=process.platform;if(e==="win32")return'powershell -c "irm bun.sh/install.ps1 | iex"';if(e==="darwin"||e==="linux")return"curl -fsSL https://bun.sh/install | bash";return"Please install bun via your system package manager (e.g. pkg install bun), or see https://bun.sh"}var o="1.1.0"
|
|
1
|
+
import{spawnSync as m}from"node:child_process";import{chmodSync as b,existsSync as h,mkdirSync as v,statSync as w,writeFileSync as k}from"node:fs";import{createRequire as y}from"node:module";import{homedir as S}from"node:os";import{dirname as B,join as t}from"node:path";import{fileURLToPath as V}from"node:url";function s(){let e=process.platform;if(e==="win32")return'powershell -c "irm bun.sh/install.ps1 | iex"';if(e==="darwin"||e==="linux")return"curl -fsSL https://bun.sh/install | bash";return"Please install bun via your system package manager (e.g. pkg install bun), or see https://bun.sh"}var o="1.1.0",N=process.env.HOME||process.env.USERPROFILE||S();function I(){try{let n=y(import.meta.url)("../package.json");if(n?.version)return n.version}catch{}return"0.0.0-unknown"}function f(e){let n=/(\d+)\.(\d+)\.(\d+)/.exec(e);if(!n)return null;return[Number(n[1]),Number(n[2]),Number(n[3])]}function T(e,n){for(let r=0;r<3;r+=1)if(e[r]!==n[r])return e[r]<n[r]?-1:1;return 0}function O(){try{let e=m("bun",["--version"],{encoding:"utf8",timeout:5000,windowsHide:!0});if(e.status!==0)return null;return String(e.stdout??"").trim()||null}catch{return null}}function _(){let e=O();if(!e)return{ok:!1,hint:`Bun is required to compile the codex-ultra server on first run but was not found. Install it first: ${s()}`};let n=f(e),r=f(o);if(!n||!r||T(n,r)<0)return{ok:!1,hint:`Bun ${e} detected, but cxu needs Bun >= ${o} to compile the server. Upgrade: ${s()}`};return{ok:!0,version:e}}function E(e){let n=(String(e).match(/\d+/g)??["0"]).map(Number).slice(-4);while(n.length<4)n.unshift(0);return n.join(".")}function H(){let e=B(V(import.meta.url)),n=t(e,"..","server-bundle","index.js");return h(n)?n:null}function g(e){return t(N,".cxu","server",`v${e}`)}function d(e){let n=t(g(e),process.platform==="win32"?"codex-standalone.exe":"codex-standalone");try{if(h(n)&&w(n).size>0)return n}catch{return null}return null}function x(){let e=I(),n=d(e);if(n)return{ok:!0,exePath:n,built:!1};let r=_();if(!r.ok)return r;let u=H();if(!u)return{ok:!1,hint:"Server bundle missing from this cxu install (server-bundle/index.js). Reinstall with: npm install -g @codex-ultra/cxu"};let i=g(e);v(i,{recursive:!0});let l=t(i,process.platform==="win32"?"codex-standalone.exe":"codex-standalone"),c=["build","--compile",u,"--outfile",l,"--minify","--define",`STANDALONE_BUILD_VERSION="${e}"`,"--external","better-sqlite3","--external","@napi-rs/keyring","--external","bcryptjs"];if(process.platform==="win32")c.push("--windows-title","Codex Ultra Standalone","--windows-publisher","codex-ultra maintainers","--windows-version",E(e),"--windows-description","Codex Ultra standalone server (Bun single-file)");console.log(`cxu: compiling the server for this machine with Bun ${r.version} (one-time per version)...`);let a=m("bun",c,{stdio:"inherit",timeout:300000,windowsHide:!0});if(a.status!==0)return{ok:!1,hint:`Local server compile failed (bun exit ${a.status??"signal"}). Check the output above, ensure Bun >= ${o}, then retry: cxu serve`};if(process.platform!=="win32")try{b(l,493)}catch{}try{k(t(i,".build-info.json"),JSON.stringify({cxuVersion:e,bunVersion:r.version,builtAt:new Date().toISOString()},null,2))}catch{}let p=d(e);if(!p)return{ok:!1,hint:"Compile finished but the server binary is missing. Retry: cxu serve"};return console.log("cxu: server ready."),{ok:!0,exePath:p,built:!0}}try{let e=x();if(!e.ok)console.log(`cxu postinstall: skipped local server build. ${e.hint}`)}catch(e){let n=e instanceof Error?e.message:String(e);console.log(`cxu postinstall: skipped local server build (${n}). It will compile on first \`cxu serve\`.`)}
|
|
@@ -8,7 +8,7 @@ export type SaVmNetCapability = {
|
|
|
8
8
|
url: string;
|
|
9
9
|
methods?: string[];
|
|
10
10
|
};
|
|
11
|
-
export type SaVmActionType = "read" | "read_file" | "read_lines" | "read_file_tail" | "tail_file" | "tail" | "find" | "find_files" | "list_files" | "write" | "write_file" | "edit" | "edit_file" | "apply_patch" | "patch" | "delete" | "delete_file" | "remove_file" | "safe_delete" | "move" | "move_file" | "rename" | "rename_file" | "copy" | "copy_file" | "stat" | "file_info" | "test_path" | "file_exists" | "exists" | "ensure_dir" | "mkdir" | "vm-read" | "vm_read" | "count_lines" | "line_count" | "list_dir" | "grep" | "grep_search" | "grep_async" | "grep_search_async" | "async_grep" | "http_fetch" | "fetch" | "run_js" | "exec_js" | "run_py" | "run_python" | "exec_py" | "clear_tool_history" | "prune_tool_history" | "find_references" | "find_all_references" | "find_implementations" | "find_impl" | "implementations" | "file_outline" | "outline" | "rename_symbol" | "symbol_rename" | "move_file_with_imports" | "move_with_imports" | "find_definition" | "goto_definition" | "def" | "extract_to_file" | "extract_file" | "extract_module" | "add_import" | "insert_import" | "get_diagnostics" | "diagnostics" | "check_syntax" | "workspace_diagnostics" | "project_diagnostics" | "all_diagnostics" | "organize_imports" | "clean_unused_imports" | "sort_imports" | "analyze_scope" | "scope_analysis" | "run_bun" | "run_bun_profile" | "run_project_check" | "project_check" | "run_host" | "exec_host" | "host";
|
|
11
|
+
export type SaVmActionType = "read" | "read_file" | "read_lines" | "read_file_tail" | "tail_file" | "tail" | "read_many" | "read_files" | "find" | "find_files" | "list_files" | "write" | "write_file" | "edit" | "edit_file" | "apply_patch" | "patch" | "delete" | "delete_file" | "remove_file" | "safe_delete" | "move" | "move_file" | "rename" | "rename_file" | "copy" | "copy_file" | "stat" | "file_info" | "test_path" | "file_exists" | "exists" | "ensure_dir" | "mkdir" | "vm-read" | "vm_read" | "count_lines" | "line_count" | "list_dir" | "grep" | "grep_search" | "grep_async" | "grep_search_async" | "async_grep" | "http_fetch" | "fetch" | "run_js" | "exec_js" | "run_py" | "run_python" | "exec_py" | "clear_tool_history" | "prune_tool_history" | "find_references" | "find_all_references" | "find_implementations" | "find_impl" | "implementations" | "file_outline" | "outline" | "workspace_outline" | "outline_many" | "project_outline" | "rename_symbol" | "symbol_rename" | "move_file_with_imports" | "move_with_imports" | "find_definition" | "goto_definition" | "def" | "extract_to_file" | "extract_file" | "extract_module" | "add_import" | "insert_import" | "get_diagnostics" | "diagnostics" | "check_syntax" | "workspace_diagnostics" | "project_diagnostics" | "all_diagnostics" | "organize_imports" | "clean_unused_imports" | "sort_imports" | "analyze_scope" | "scope_analysis" | "run_bun" | "run_bun_profile" | "run_project_check" | "project_check" | "run_host" | "exec_host" | "host";
|
|
12
12
|
export declare const SA_VM_BUN_PROFILES: readonly SaVmBunProfile[];
|
|
13
13
|
export type { SaVmBunProfile };
|
|
14
14
|
export type SaVmRunInput = {
|
|
@@ -84,6 +84,14 @@ export type SaVmRunInput = {
|
|
|
84
84
|
is_regex?: boolean;
|
|
85
85
|
regex?: boolean;
|
|
86
86
|
case_sensitive?: boolean;
|
|
87
|
+
exclude_dirs?: string[] | string;
|
|
88
|
+
excludeDirs?: string[] | string;
|
|
89
|
+
exclude?: string[] | string;
|
|
90
|
+
max_file_bytes?: number;
|
|
91
|
+
maxFileBytes?: number;
|
|
92
|
+
respect_gitignore?: boolean;
|
|
93
|
+
max_symbols_per_file?: number;
|
|
94
|
+
max_tokens_per_file?: number;
|
|
87
95
|
lines?: number;
|
|
88
96
|
tail?: boolean;
|
|
89
97
|
max_matches?: number;
|
|
@@ -182,6 +190,12 @@ export declare function nativeListDir(dirPath: string | undefined, maxEntries: n
|
|
|
182
190
|
max_depth?: number;
|
|
183
191
|
recursive?: boolean;
|
|
184
192
|
type?: "all" | "file" | "directory" | string;
|
|
193
|
+
pattern?: string;
|
|
194
|
+
path_pattern?: string;
|
|
195
|
+
is_regex?: boolean;
|
|
196
|
+
regex?: boolean;
|
|
197
|
+
exclude_dirs?: string[];
|
|
198
|
+
respect_gitignore?: boolean;
|
|
185
199
|
}): Promise<SaVmRunResult>;
|
|
186
200
|
export declare function nativeGrepSearch(query: string, searchDir: string | undefined, pattern: string | undefined, maxMatches: number | undefined, policy: SaVmPolicyConfig | undefined, cwd: string, startedAt: number, timeoutOpts?: {
|
|
187
201
|
timeout_ms?: number;
|
|
@@ -191,6 +205,11 @@ export declare function nativeGrepSearch(query: string, searchDir: string | unde
|
|
|
191
205
|
regex?: boolean;
|
|
192
206
|
case_sensitive?: boolean;
|
|
193
207
|
path_pattern?: string;
|
|
208
|
+
max_file_bytes?: number;
|
|
209
|
+
maxFileBytes?: number;
|
|
210
|
+
max_bytes?: number;
|
|
211
|
+
exclude_dirs?: string[];
|
|
212
|
+
respect_gitignore?: boolean;
|
|
194
213
|
}): Promise<SaVmRunResult>;
|
|
195
214
|
export declare function nativeGrepSearchAsync(query: string | string[], searchDir: string | undefined, pattern: string | undefined, maxMatches: number | undefined, concurrency: number | undefined, policy: SaVmPolicyConfig | undefined, cwd: string, startedAt: number, timeoutOpts?: {
|
|
196
215
|
timeout_ms?: number;
|
|
@@ -200,6 +219,11 @@ export declare function nativeGrepSearchAsync(query: string | string[], searchDi
|
|
|
200
219
|
regex?: boolean;
|
|
201
220
|
case_sensitive?: boolean;
|
|
202
221
|
path_pattern?: string;
|
|
222
|
+
max_file_bytes?: number;
|
|
223
|
+
maxFileBytes?: number;
|
|
224
|
+
max_bytes?: number;
|
|
225
|
+
exclude_dirs?: string[];
|
|
226
|
+
respect_gitignore?: boolean;
|
|
203
227
|
}): Promise<SaVmRunResult>;
|
|
204
228
|
export declare function nativeFindReferences(rawSymbol: string | undefined, options: {
|
|
205
229
|
detail?: boolean;
|
|
@@ -236,6 +260,27 @@ export declare function nativeFindImplementations(rawSymbol: string | undefined,
|
|
|
236
260
|
export declare function nativeFileOutline(rawPath: string, options: {
|
|
237
261
|
detail?: boolean;
|
|
238
262
|
max_tokens?: number;
|
|
263
|
+
max_file_bytes?: number;
|
|
264
|
+
}, policy: SaVmPolicyConfig | undefined, cwd: string, startedAt: number): Promise<SaVmRunResult>;
|
|
265
|
+
export declare function nativeWorkspaceOutline(rawDir: string, options: {
|
|
266
|
+
pattern?: string;
|
|
267
|
+
path_pattern?: string;
|
|
268
|
+
is_regex?: boolean;
|
|
269
|
+
regex?: boolean;
|
|
270
|
+
max_files?: number;
|
|
271
|
+
max_symbols_per_file?: number;
|
|
272
|
+
max_tokens?: number;
|
|
273
|
+
max_file_bytes?: number;
|
|
274
|
+
exclude_dirs?: string[];
|
|
275
|
+
detail?: boolean;
|
|
276
|
+
timeout_ms?: number;
|
|
277
|
+
timeout?: number;
|
|
278
|
+
}, policy: SaVmPolicyConfig | undefined, cwd: string, startedAt: number): Promise<SaVmRunResult>;
|
|
279
|
+
export declare function nativeReadMany(files: string[], options: {
|
|
280
|
+
start_line?: number;
|
|
281
|
+
end_line?: number;
|
|
282
|
+
max_tokens_per_file?: number;
|
|
283
|
+
max_tokens?: number;
|
|
239
284
|
}, policy: SaVmPolicyConfig | undefined, cwd: string, startedAt: number): Promise<SaVmRunResult>;
|
|
240
285
|
export declare function nativeRenameSymbol(rawSymbol: string, rawNewName: string, options: {
|
|
241
286
|
path?: string;
|
package/package.json
CHANGED