@@ -27,24 +27,26 @@ const OUR = 'socket-wheelhouse'
2727
2828test ( 'extractInstalledSha returns 12-char prefix for SHA-pinned cache path' , ( ) => {
2929 const got = extractInstalledSha (
30- '/Users/x /.claude/plugins/cache/socket-wheelhouse/codex/9cb4fe409919-deadbeef' ,
30+ '/Users/<user> /.claude/plugins/cache/socket-wheelhouse/codex/9cb4fe409919-deadbeef' ,
3131 )
3232 expect ( got ) . toBe ( '9cb4fe409919' )
3333} )
3434
3535test ( 'extractInstalledSha handles content-hash of various lengths' , ( ) => {
36- const got = extractInstalledSha ( '/x/cache/m/p/abcdef012345-fedcba98' )
36+ const got = extractInstalledSha (
37+ '/cache/marketplace/plugins/abcdef012345-fedcba98' ,
38+ )
3739 expect ( got ) . toBe ( 'abcdef012345' )
3840} )
3941
4042test ( 'extractInstalledSha returns undefined for directory-source install (version-tagged)' , ( ) => {
41- const got = extractInstalledSha ( '/Users/x /projects/codex-plugin-cc' )
43+ const got = extractInstalledSha ( '/Users/<user> /projects/codex-plugin-cc' )
4244 expect ( got ) . toBe ( undefined )
4345} )
4446
4547test ( 'extractInstalledSha returns undefined for version-tagged install' , ( ) => {
4648 const got = extractInstalledSha (
47- '/Users/x /.claude/plugins/cache/openai-codex/codex/1.0.1' ,
49+ '/Users/<user> /.claude/plugins/cache/openai-codex/codex/1.0.1' ,
4850 )
4951 expect ( got ) . toBe ( undefined )
5052} )
@@ -59,15 +61,17 @@ test('extractInstalledSha returns undefined for empty string', () => {
5961
6062test ( 'extractInstalledSha rejects shapes that almost-match but are not 12 + 8+' , ( ) => {
6163 // 11 chars instead of 12.
62- expect ( extractInstalledSha ( '/x/cache/m/p/9cb4fe40991-deadbeef' ) ) . toBe (
63- undefined ,
64- )
64+ expect (
65+ extractInstalledSha ( '/cache/marketplace/plugins/9cb4fe40991-deadbeef' ) ,
66+ ) . toBe ( undefined )
6567 // No content-hash suffix.
66- expect ( extractInstalledSha ( '/x/cache/m/p/9cb4fe409919' ) ) . toBe ( undefined )
67- // Non-hex chars.
68- expect ( extractInstalledSha ( '/x/cache/m/p/zzzzzzzzzzzz-deadbeef' ) ) . toBe (
68+ expect ( extractInstalledSha ( '/cache/marketplace/plugins/9cb4fe409919' ) ) . toBe (
6969 undefined ,
7070 )
71+ // Non-hex chars.
72+ expect (
73+ extractInstalledSha ( '/cache/marketplace/plugins/zzzzzzzzzzzz-deadbeef' ) ,
74+ ) . toBe ( undefined )
7175} )
7276
7377const fakePlugin = (
@@ -82,7 +86,7 @@ const fakePlugin = (
8286
8387test ( 'findForeignInstall finds plugin under non-canonical marketplace' , ( ) => {
8488 const plugins = [
85- fakePlugin ( 'codex@openai-codex' , '/Users/x /projects/codex-plugin-cc' ) ,
89+ fakePlugin ( 'codex@openai-codex' , '/Users/<user> /projects/codex-plugin-cc' ) ,
8690 fakePlugin ( 'clangd-lsp@claude-plugins-official' ) ,
8791 ]
8892 const got = findForeignInstall ( 'codex' , plugins , OUR )
@@ -93,7 +97,7 @@ test('findForeignInstall returns undefined when plugin is under our marketplace'
9397 const plugins = [
9498 fakePlugin (
9599 'codex@socket-wheelhouse' ,
96- '/x/ cache/socket-wheelhouse/codex/9cb4fe409919-aa' ,
100+ '/cache/example /socket-wheelhouse/codex/9cb4fe409919-aa' ,
97101 ) ,
98102 ]
99103 const got = findForeignInstall ( 'codex' , plugins , OUR )
@@ -189,7 +193,7 @@ test('lookupInstalledSha extracts gitCommitSha from installed_plugins.json shape
189193 'codex@socket-wheelhouse' : [
190194 {
191195 scope : 'user' ,
192- installPath : '/x/y/z ' ,
196+ installPath : '/home/<user>/install ' ,
193197 version : '1.0.1' ,
194198 gitCommitSha : FULL_SHA ,
195199 } ,
@@ -209,7 +213,11 @@ test('lookupInstalledSha returns undefined when entry has no gitCommitSha', () =
209213 version : 2 ,
210214 plugins : {
211215 'codex@socket-wheelhouse' : [
212- { scope : 'user' , installPath : '/x/y/z' , version : '1.0.1' } ,
216+ {
217+ scope : 'user' ,
218+ installPath : '/home/<user>/install' ,
219+ version : '1.0.1' ,
220+ } ,
213221 ] ,
214222 } ,
215223 }
@@ -322,14 +330,14 @@ test('stripPatchHeader only matches --- at line start (not mid-line)', () => {
322330} )
323331
324332test ( 'patchSidecarDir maps <x>.patch → <x>.files' , ( ) => {
325- expect ( patchSidecarDir ( '/a/b/codex-1.0.1-stdin-eagain.patch' ) ) . toBe (
326- '/a/b/ codex-1.0.1-stdin-eagain.files' ,
327- )
333+ expect (
334+ patchSidecarDir ( '/home/<user>/build/ codex-1.0.1-stdin-eagain.patch' ) ,
335+ ) . toBe ( '/home/<user>/build/codex-1.0.1-stdin-eagain.files' )
328336} )
329337
330338test ( 'patchSidecarDir only rewrites a trailing .patch extension' , ( ) => {
331339 // A `.patch` mid-path must not be rewritten — only the final extension.
332- expect ( patchSidecarDir ( '/a /.patch-stuff/codex-1.0.1-x.patch' ) ) . toBe (
333- '/a /.patch-stuff/codex-1.0.1-x.files' ,
340+ expect ( patchSidecarDir ( '/home/<user> /.patch-stuff/codex-1.0.1-x.patch' ) ) . toBe (
341+ '/home/<user> /.patch-stuff/codex-1.0.1-x.files' ,
334342 )
335343} )
0 commit comments