@codex-ultra/cxu 0.2.11 → 0.2.13
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-doctor.d.ts +3 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/postinstall.js +1 -1
- package/dist/vendor/saVmTool.d.ts +92 -1
- package/package.json +1 -1
- package/server-bundle/index.js +430 -321
- package/web-dist/assets/main-f84g7djq.css +1 -0
- package/web-dist/assets/{main-4g10184v.js → main-msz0q4aj.js} +610 -610
- package/web-dist/index.html +3 -3
- package/web-dist/sw.js +1 -1
- package/web-dist/assets/main-svenqv8f.css +0 -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" | "repo_map" | "repo-map" | "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" | "verify_loop" | "verify-loop" | "verify_changed" | "run_bun" | "run_bun_profile" | "run_project_check" | "project_check" | "run_host" | "exec_host" | "host" | "save_note" | "add_note" | "read_notes" | "read_note" | "list_notes" | "delete_note" | "remove_note" | "clear_notes";
|
|
12
12
|
export declare const SA_VM_BUN_PROFILES: readonly SaVmBunProfile[];
|
|
13
13
|
export type { SaVmBunProfile };
|
|
14
14
|
export type SaVmRunInput = {
|
|
@@ -26,6 +26,11 @@ export type SaVmRunInput = {
|
|
|
26
26
|
keep_last_n_turns?: number;
|
|
27
27
|
filter_tools?: string[];
|
|
28
28
|
reason?: string;
|
|
29
|
+
key?: string;
|
|
30
|
+
all?: boolean;
|
|
31
|
+
fact?: string;
|
|
32
|
+
level?: NotePriorityLevel | string;
|
|
33
|
+
priority?: NotePriorityLevel | string;
|
|
29
34
|
symbol?: string;
|
|
30
35
|
old_name?: string;
|
|
31
36
|
new_name?: string;
|
|
@@ -84,6 +89,14 @@ export type SaVmRunInput = {
|
|
|
84
89
|
is_regex?: boolean;
|
|
85
90
|
regex?: boolean;
|
|
86
91
|
case_sensitive?: boolean;
|
|
92
|
+
exclude_dirs?: string[] | string;
|
|
93
|
+
excludeDirs?: string[] | string;
|
|
94
|
+
exclude?: string[] | string;
|
|
95
|
+
max_file_bytes?: number;
|
|
96
|
+
maxFileBytes?: number;
|
|
97
|
+
respect_gitignore?: boolean;
|
|
98
|
+
max_symbols_per_file?: number;
|
|
99
|
+
max_tokens_per_file?: number;
|
|
87
100
|
lines?: number;
|
|
88
101
|
tail?: boolean;
|
|
89
102
|
max_matches?: number;
|
|
@@ -93,6 +106,7 @@ export type SaVmRunInput = {
|
|
|
93
106
|
body?: string;
|
|
94
107
|
timeout_ms?: number;
|
|
95
108
|
timeout?: number;
|
|
109
|
+
format?: string;
|
|
96
110
|
source?: string;
|
|
97
111
|
language?: "js" | "javascript" | "bun" | "ts" | "typescript" | "node" | "py" | "python" | "sa" | "sla";
|
|
98
112
|
exe?: string;
|
|
@@ -182,6 +196,12 @@ export declare function nativeListDir(dirPath: string | undefined, maxEntries: n
|
|
|
182
196
|
max_depth?: number;
|
|
183
197
|
recursive?: boolean;
|
|
184
198
|
type?: "all" | "file" | "directory" | string;
|
|
199
|
+
pattern?: string;
|
|
200
|
+
path_pattern?: string;
|
|
201
|
+
is_regex?: boolean;
|
|
202
|
+
regex?: boolean;
|
|
203
|
+
exclude_dirs?: string[];
|
|
204
|
+
respect_gitignore?: boolean;
|
|
185
205
|
}): Promise<SaVmRunResult>;
|
|
186
206
|
export declare function nativeGrepSearch(query: string, searchDir: string | undefined, pattern: string | undefined, maxMatches: number | undefined, policy: SaVmPolicyConfig | undefined, cwd: string, startedAt: number, timeoutOpts?: {
|
|
187
207
|
timeout_ms?: number;
|
|
@@ -191,6 +211,11 @@ export declare function nativeGrepSearch(query: string, searchDir: string | unde
|
|
|
191
211
|
regex?: boolean;
|
|
192
212
|
case_sensitive?: boolean;
|
|
193
213
|
path_pattern?: string;
|
|
214
|
+
max_file_bytes?: number;
|
|
215
|
+
maxFileBytes?: number;
|
|
216
|
+
max_bytes?: number;
|
|
217
|
+
exclude_dirs?: string[];
|
|
218
|
+
respect_gitignore?: boolean;
|
|
194
219
|
}): Promise<SaVmRunResult>;
|
|
195
220
|
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
221
|
timeout_ms?: number;
|
|
@@ -200,6 +225,11 @@ export declare function nativeGrepSearchAsync(query: string | string[], searchDi
|
|
|
200
225
|
regex?: boolean;
|
|
201
226
|
case_sensitive?: boolean;
|
|
202
227
|
path_pattern?: string;
|
|
228
|
+
max_file_bytes?: number;
|
|
229
|
+
maxFileBytes?: number;
|
|
230
|
+
max_bytes?: number;
|
|
231
|
+
exclude_dirs?: string[];
|
|
232
|
+
respect_gitignore?: boolean;
|
|
203
233
|
}): Promise<SaVmRunResult>;
|
|
204
234
|
export declare function nativeFindReferences(rawSymbol: string | undefined, options: {
|
|
205
235
|
detail?: boolean;
|
|
@@ -233,9 +263,70 @@ export declare function nativeFindImplementations(rawSymbol: string | undefined,
|
|
|
233
263
|
timeout_ms?: number;
|
|
234
264
|
timeout?: number;
|
|
235
265
|
}, policy: SaVmPolicyConfig | undefined, cwd: string, startedAt: number): Promise<SaVmRunResult>;
|
|
266
|
+
export declare function collectWorkspaceSourceFiles(baseDir: string, maxFiles?: number, timeoutMs?: number, startedAt?: number): Promise<string[]>;
|
|
236
267
|
export declare function nativeFileOutline(rawPath: string, options: {
|
|
237
268
|
detail?: boolean;
|
|
238
269
|
max_tokens?: number;
|
|
270
|
+
max_file_bytes?: number;
|
|
271
|
+
}, policy: SaVmPolicyConfig | undefined, cwd: string, startedAt: number): Promise<SaVmRunResult>;
|
|
272
|
+
export declare function nativeWorkspaceOutline(rawDir: string, options: {
|
|
273
|
+
pattern?: string;
|
|
274
|
+
path_pattern?: string;
|
|
275
|
+
is_regex?: boolean;
|
|
276
|
+
regex?: boolean;
|
|
277
|
+
max_files?: number;
|
|
278
|
+
max_symbols_per_file?: number;
|
|
279
|
+
max_tokens?: number;
|
|
280
|
+
max_file_bytes?: number;
|
|
281
|
+
exclude_dirs?: string[];
|
|
282
|
+
detail?: boolean;
|
|
283
|
+
timeout_ms?: number;
|
|
284
|
+
timeout?: number;
|
|
285
|
+
}, policy: SaVmPolicyConfig | undefined, cwd: string, startedAt: number): Promise<SaVmRunResult>;
|
|
286
|
+
export declare function nativeRepoMap(rawDir: string, options: {
|
|
287
|
+
pattern?: string;
|
|
288
|
+
path_pattern?: string;
|
|
289
|
+
is_regex?: boolean;
|
|
290
|
+
regex?: boolean;
|
|
291
|
+
max_files?: number;
|
|
292
|
+
max_symbols_per_file?: number;
|
|
293
|
+
max_tokens?: number;
|
|
294
|
+
max_file_bytes?: number;
|
|
295
|
+
exclude_dirs?: string[];
|
|
296
|
+
include_used_by?: boolean;
|
|
297
|
+
timeout_ms?: number;
|
|
298
|
+
timeout?: number;
|
|
299
|
+
}, policy: SaVmPolicyConfig | undefined, cwd: string, startedAt: number): Promise<SaVmRunResult>;
|
|
300
|
+
export declare function nativeVerifyLoop(rawTarget: string, options: {
|
|
301
|
+
files?: string[];
|
|
302
|
+
pattern?: string;
|
|
303
|
+
max_files?: number;
|
|
304
|
+
max_errors?: number;
|
|
305
|
+
max_tokens?: number;
|
|
306
|
+
timeout_ms?: number;
|
|
307
|
+
timeout?: number;
|
|
308
|
+
}, policy: SaVmPolicyConfig | undefined, cwd: string, startedAt: number): Promise<SaVmRunResult>;
|
|
309
|
+
export type NotePriorityLevel = "low" | "normal" | "important" | "critical";
|
|
310
|
+
export type WorkspaceNoteItem = {
|
|
311
|
+
key: string;
|
|
312
|
+
content: string;
|
|
313
|
+
level: NotePriorityLevel;
|
|
314
|
+
updated_at: number;
|
|
315
|
+
};
|
|
316
|
+
export type WorkspaceNotesDocument = {
|
|
317
|
+
workspace: string;
|
|
318
|
+
updated_at: number;
|
|
319
|
+
notes: WorkspaceNoteItem[];
|
|
320
|
+
};
|
|
321
|
+
export declare function resolveWorkspaceMemoryFilePath(workspaceDir: string): string;
|
|
322
|
+
export declare function nativeSaveNote(keyInput: string | undefined, contentInput: string | undefined, levelInput: string | undefined, policy: SaVmPolicyConfig | undefined, cwd: string, startedAt: number): Promise<SaVmRunResult>;
|
|
323
|
+
export declare function nativeReadNotes(keyInput: string | undefined, maxTokensInput: number | undefined, remainingTokensInput: number | undefined, policy: SaVmPolicyConfig | undefined, cwd: string, startedAt: number): Promise<SaVmRunResult>;
|
|
324
|
+
export declare function nativeDeleteNote(keyInput: string | undefined, all: boolean | undefined, policy: SaVmPolicyConfig | undefined, cwd: string, startedAt: number): Promise<SaVmRunResult>;
|
|
325
|
+
export declare function nativeReadMany(files: string[], options: {
|
|
326
|
+
start_line?: number;
|
|
327
|
+
end_line?: number;
|
|
328
|
+
max_tokens_per_file?: number;
|
|
329
|
+
max_tokens?: number;
|
|
239
330
|
}, policy: SaVmPolicyConfig | undefined, cwd: string, startedAt: number): Promise<SaVmRunResult>;
|
|
240
331
|
export declare function nativeRenameSymbol(rawSymbol: string, rawNewName: string, options: {
|
|
241
332
|
path?: string;
|
package/package.json
CHANGED