@petercjl/codex-own 0.1.0 → 0.1.1
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/README.md +2 -0
- package/lib/manager.mjs +11 -3
- package/package.json +1 -1
- package/release.json +26 -4
package/README.md
CHANGED
|
@@ -11,3 +11,5 @@ Check: “Use codex-own to report the installed desktop version, available versi
|
|
|
11
11
|
Existing installs require explicit adoption and a backup. Quit the desktop application before updating. Rollback restores a matching data snapshot and preserves newer data in a separate backup. Windows GUI operation remains unverified until a real Windows launch check is recorded.
|
|
12
12
|
|
|
13
13
|
Developer command reference is available through `codex-own help`. The npm manager version and desktop version are separate; installing a new manager alone does not replace the desktop application. Model credentials are never included in this package.
|
|
14
|
+
|
|
15
|
+
Windows x64: the manager installs into the current user’s LocalAppData/Programs/codex-own/current and creates a codex-own Start menu shortcut. Supply your separate API key file to your Agent: “Configure codex-own using the attached API key file.” Configuration stays in LocalAppData/codex-own-independent. Windows package installation and CLI service checks run in CI; desktop GUI acceptance is performed by the user.
|
package/lib/manager.mjs
CHANGED
|
@@ -40,9 +40,17 @@ export async function download(url,dest,expected) {
|
|
|
40
40
|
export function checkEntries(names) {
|
|
41
41
|
for(const n of names){const p=n.replaceAll('\\','/');if(p.startsWith('/')||/^[a-z]:/i.test(p)||p.split('/').includes('..'))fail('UNSAFE_ARCHIVE','Unsafe archive entry');}
|
|
42
42
|
}
|
|
43
|
+
export function tarExecutable(platform=process.platform,env=process.env,exists=fs.existsSync) {
|
|
44
|
+
if(platform!=='win32')return 'tar';
|
|
45
|
+
const root=env.SystemRoot||env.SYSTEMROOT||env.windir||env.WINDIR;
|
|
46
|
+
if(!root)fail('DEPENDENCY_MISSING','Windows system directory is unavailable');
|
|
47
|
+
const executable=path.win32.join(root,'System32','tar.exe');
|
|
48
|
+
if(!exists(executable))fail('DEPENDENCY_MISSING','Windows system tar.exe is required');
|
|
49
|
+
return executable;
|
|
50
|
+
}
|
|
43
51
|
export function unpack(archive,dest) {
|
|
44
|
-
const names=execFileSync(
|
|
45
|
-
fs.mkdirSync(dest);execFileSync(
|
|
52
|
+
const names=execFileSync(tarExecutable(),['-tf',archive],{encoding:'utf8',maxBuffer:30*1024*1024}).split('\n').filter(Boolean);checkEntries(names);
|
|
53
|
+
fs.mkdirSync(dest);execFileSync(tarExecutable(),['-xf',archive,'-C',dest],{stdio:'pipe'});
|
|
46
54
|
// Bundled framework links may be relative but must stay within the extracted tree.
|
|
47
55
|
function walk(p){for(const x of fs.readdirSync(p,{withFileTypes:true})){const f=path.join(p,x.name);if(x.isSymbolicLink()){const resolved=path.resolve(path.dirname(f),fs.readlinkSync(f));if(!resolved.startsWith(dest+path.sep))fail('UNSAFE_ARCHIVE','Escaping symlink');}else if(x.isDirectory())walk(f);}}
|
|
48
56
|
walk(dest);
|
|
@@ -118,4 +126,4 @@ export async function rollback({restoreData=false}={}){const p=paths();return lo
|
|
|
118
126
|
const preserved=path.join(path.dirname(p.target),'.codex-own-before-rollback-'+crypto.randomUUID());fs.renameSync(p.target,preserved);fs.renameSync(prev.app,p.target);
|
|
119
127
|
for(const n of ['core','desktop']){const snap=path.join(prev.data,n);if(fs.existsSync(p[n]))fs.renameSync(p[n],path.join(p.root,n+'.before-rollback-'+crypto.randomUUID()));if(fs.existsSync(snap))fs.cpSync(snap,p[n],{recursive:true,force:false,errorOnExist:true});}
|
|
120
128
|
writeState(p,{...(prev.state||{schema:1,identity:'local.codex-own',version:'adopted-legacy',target:p.target}),previous:null});return {ok:true,preserved,dataBackup:backup};});}
|
|
121
|
-
export function doctor(){const p=paths(),s=state(p);let tar=true;try{execFileSync(
|
|
129
|
+
export function doctor(){const p=paths(),s=state(p);let tar=true;try{execFileSync(tarExecutable(),['--version'],{stdio:'pipe'});}catch{tar=false;}const pending=fs.existsSync(p.manager)?fs.readdirSync(p.manager).filter(n=>/^transaction-.*\.json$/.test(n)&&!n.endsWith('.complete.json')&&!fs.existsSync(path.join(p.manager,n.replace('.json','.complete.json')))):[];return {ok:tar&&!pending.length,managerVersion:pkg.version,platform:p.platform,supported:['darwin-arm64','win32-x64'].includes(p.platform),installed:s?.version||null,paths:p,tar,pendingTransactions:pending,lock:fs.existsSync(path.join(p.manager,'operation.lock')),configured:fs.existsSync(path.join(p.core,'auth.json')),windowsGuiTested:false};}
|
package/package.json
CHANGED
package/release.json
CHANGED
|
@@ -1,19 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"repository": "petercjl/codex-own",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"platforms": {
|
|
6
6
|
"darwin-arm64": {
|
|
7
7
|
"entry": "codex-own.app",
|
|
8
|
-
"url": "https://github.com/petercjl/codex-own/releases/download/own-v0.1.
|
|
8
|
+
"url": "https://github.com/petercjl/codex-own/releases/download/own-v0.1.1/codex-own-darwin-arm64.tar.gz",
|
|
9
9
|
"sha256": "6512d6d2e8ef46f64339ca1233fe833a067329cf006b17b3a0aa1bd27fd8e457",
|
|
10
10
|
"size": 781692456
|
|
11
|
+
},
|
|
12
|
+
"win32-x64": {
|
|
13
|
+
"entry": "app",
|
|
14
|
+
"url": "https://github.com/petercjl/codex-own/releases/download/own-v0.1.1/codex-own-win32-x64.tar.gz",
|
|
15
|
+
"sha256": "f110a1e7e0f7c1e184ccc8733674d00280ecae02762530b07ca3b7d2547a4259",
|
|
16
|
+
"size": 920368892
|
|
11
17
|
}
|
|
12
18
|
},
|
|
13
19
|
"provenance": {
|
|
14
20
|
"darwin-arm64": {
|
|
15
|
-
"
|
|
16
|
-
|
|
21
|
+
"darwin-arm64": {
|
|
22
|
+
"sourceRelease": "own-v0.1.0"
|
|
23
|
+
},
|
|
24
|
+
"win32-x64": {
|
|
25
|
+
"kind": "prepared-independent-build",
|
|
26
|
+
"desktopVersion": "26.1007.21434",
|
|
27
|
+
"guiAcceptance": "user-pending"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"win32-x64": {
|
|
31
|
+
"darwin-arm64": {
|
|
32
|
+
"sourceRelease": "own-v0.1.0"
|
|
33
|
+
},
|
|
34
|
+
"win32-x64": {
|
|
35
|
+
"kind": "prepared-independent-build",
|
|
36
|
+
"desktopVersion": "26.1007.21434",
|
|
37
|
+
"guiAcceptance": "user-pending"
|
|
38
|
+
}
|
|
17
39
|
}
|
|
18
40
|
}
|
|
19
41
|
}
|