@@ -10,12 +10,18 @@ const crypto = require('crypto')
1010const fs = require ( 'fs' )
1111const path = require ( 'path' )
1212const { resolveGlobalHostTarget } = require ( './global-host-target.js' )
13- const {
14- describeGlobalAdapterRefreshForPackageRoot
15- } = require ( './global-adapter-refresh-guidance.js' )
1613
1714const PACKAGE_ROOT = path . join ( __dirname , '..' , '..' )
1815
16+ function loadAdapterRefreshGuidanceModule ( ) {
17+ try {
18+ return require ( './global-adapter-refresh-guidance.js' )
19+ } catch {
20+ // Deployed MCP runtime subsets may lag one file; fail soft with R3 defaults.
21+ return null
22+ }
23+ }
24+
1925/**
2026 * Repair command for missing/stale user-global adapters.
2127 * Source checkout → R1a `devcodex global-adapters apply`; published package → npm -g.
@@ -25,10 +31,22 @@ function resolveAdapterRefreshGuidance(options = {}) {
2531 const packageRoot = options . packageRoot
2632 ? path . resolve ( options . packageRoot )
2733 : PACKAGE_ROOT
28- return describeGlobalAdapterRefreshForPackageRoot ( packageRoot , {
29- packageVersion : options . packageVersion || null ,
30- fs : options . fs || fs ,
31- path : options . path || path
34+ const mod = loadAdapterRefreshGuidanceModule ( )
35+ if ( mod && typeof mod . describeGlobalAdapterRefreshForPackageRoot === 'function' ) {
36+ return mod . describeGlobalAdapterRefreshForPackageRoot ( packageRoot , {
37+ packageVersion : options . packageVersion || null ,
38+ fs : options . fs || fs ,
39+ path : options . path || path
40+ } )
41+ }
42+ return Object . freeze ( {
43+ sourceCheckout : false ,
44+ primary : 'npm update -g devcodex' ,
45+ installCommand : 'npm install -g devcodex' ,
46+ updateCommand : 'npm update -g devcodex' ,
47+ nextStepShort : 'npm update -g devcodex' ,
48+ nextStepRefresh : 'Run npm update -g devcodex to refresh the managed receipt.' ,
49+ nextStepInstall : 'Run npm install -g devcodex to create the user-global host receipt.'
3250 } )
3351}
3452
0 commit comments