@zortexhq/indra-v2.5 0.2.3 → 0.2.4

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.
Files changed (33) hide show
  1. package/dist/measurement-context.js +1 -1
  2. package/dist/product-feedback.js +2 -2
  3. package/dist/profile.js +1 -1
  4. package/node_modules/@zortexhq/plugin-galaxy-ui/dist/galaxy-text.js +1 -1
  5. package/node_modules/@zortexhq/plugin-galaxy-ui/dist/localizer.js +1 -1
  6. package/node_modules/@zortexhq/plugin-galaxy-ui/dist/routes.js +1 -1
  7. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/account.js +1 -1
  8. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/app-i18n-twin.js +1 -0
  9. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/app-i18n.js +1 -1
  10. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/app-model.js +1 -1
  11. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/app-text.js +1 -1
  12. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/app.html +92 -36
  13. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/connection-panel.js +1 -0
  14. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/galaxy-renderer.js +13 -0
  15. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/galaxy.html +141 -0
  16. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/live-model.js +1 -1
  17. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/live-state.js +1 -1
  18. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/panels-live.js +3 -3
  19. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/product.js +1 -1
  20. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/shell.css +16 -46
  21. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/shell.js +1 -1
  22. package/node_modules/@zortexhq/plugin-posthog/dist/activity.js +1 -0
  23. package/node_modules/@zortexhq/plugin-posthog/dist/northstar.js +1 -1
  24. package/node_modules/@zortexhq/plugin-telemetry/dist/api/measurement.js +1 -1
  25. package/node_modules/@zortexhq/plugin-telemetry/dist/api/telemetry.js +1 -1
  26. package/node_modules/@zortexhq/plugin-telemetry/dist/device-identity.js +1 -0
  27. package/node_modules/@zortexhq/plugin-telemetry/dist/index.js +1 -1
  28. package/package.json +6 -6
  29. package/profiles/core.yml +1 -0
  30. package/release-provenance.json +13 -13
  31. package/update-manifest.json +91 -67
  32. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/app-catalog.js +0 -1
  33. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/demo.js +0 -1
@@ -1 +1 @@
1
- import{runningProductVersion}from"./update-telemetry.js";export async function productMeasurementContext(){const productVersion=await runningProductVersion;const platform=process.platform==="darwin"||process.platform==="win32"||process.platform==="linux"?process.platform:"unknown";const mode=process.env.ZORTEX_EXECUTION_MODE;const traffic=process.env.ZORTEX_FEEDBACK_TRAFFIC_CLASS;return{...productVersion&&productVersion.length<=64&&/^\d+\.\d+\.\d+(?:[-+][A-Za-z0-9.-]+)?$/.test(productVersion)?{productVersion}:{},platform,executionLocation:mode==="local"||mode==="cloud"?mode:"unknown",trafficClass:traffic==="internal_test"||traffic==="simulation"?traffic:"usage"}}
1
+ import{runningProductVersion}from"./update-telemetry.js";import{homedir}from"node:os";import{isAbsolute,join}from"node:path";export function productDeviceIdentityFile(){const home=homedir(),local=process.env.LOCALAPPDATA;const base=process.platform==="win32"?local&&isAbsolute(local)?local:join(home,"AppData","Local"):join(home,".zortex");return process.platform==="win32"?join(base,"Zortex","DeviceIdentity","device.json"):join(base,"device-identity","device.json")}export async function productMeasurementContext(){const productVersion=await runningProductVersion;const platform=process.platform==="darwin"||process.platform==="win32"||process.platform==="linux"?process.platform:"unknown";const mode=process.env.ZORTEX_EXECUTION_MODE;const traffic=process.env.ZORTEX_FEEDBACK_TRAFFIC_CLASS;return{...productVersion&&productVersion.length<=64&&/^\d+\.\d+\.\d+(?:[-+][A-Za-z0-9.-]+)?$/.test(productVersion)?{productVersion}:{},platform,executionLocation:mode==="local"||mode==="cloud"?mode:"unknown",trafficClass:traffic==="internal_test"||traffic==="simulation"?traffic:"usage"}}
@@ -1,2 +1,2 @@
1
- import{createInterface}from"node:readline/promises";import{lstat}from"node:fs/promises";import{isAbsolute,join,resolve}from"node:path";import{fileURLToPath}from"node:url";import{createTelemetry}from"@zortexhq/plugin-telemetry";import{FEEDBACK_RATINGS,FEEDBACK_REASONS}from"@zortexhq/plugin-telemetry/api";import{businessError,ok}from"@zortexhq/plugin-connector-framework/api";import{configuredVaultRoot}from"./default-root.js";import{productMeasurementContext}from"./measurement-context.js";import{readFeedbackTelemetryPolicy}from"./feedback-policy.js";const usage="indra --root <Vault> feedback [--list | --json <rating JSON>]";const ratings=["Useful","Partly useful","Not useful","Cannot judge"];const reasons=["Saved time","Answered my question","Incomplete result","Wrong result","No result","Too slow","Connection problem","Unclear"];const invalid=message=>businessError("invalid_argument",message,"storage");export async function runProductFeedback(service,args,interaction){if(args.length===2&&args[0]==="--json"){if(args[1].length>2048)return invalid("Feedback JSON is too large.");let input;try{input=JSON.parse(args[1])}catch{return invalid("Feedback JSON is invalid.")}return service.recordFeedback(input,{submissionChannel:"programmatic_cli"})}if(args.length&&!(args.length===1&&args[0]==="--list"))return invalid("Use "+usage+".");const recent=await service.recent({limit:args[0]==="--list"?20:5});if(!("ok"in recent))return recent;if(!recent.ok.enabled)return ok({...recent.ok,message:"Telemetry is disabled. No feedback was collected."});if(!interaction.interactive||args[0]==="--list")return recent;if(!recent.ok.events.length)return ok({...recent.ok,message:"No eligible operation was recorded in the last seven days. Run a search or connector operation first."});interaction.write("Recent operations\n");recent.ok.events.forEach((event,index)=>interaction.write(`${index+1} ${event.at} ${event.source?event.source+" ":""}${event.operation} ${event.outcome}${event.result?.count!==void 0?" \xB7 "+event.result.count+" records":""}
2
- `));const choice=(await interaction.ask("Choose an operation [1]: ")).trim();const selected=choice===""?0:Number(choice)-1;if(!Number.isInteger(selected)||selected<0||selected>=recent.ok.events.length)return invalid("Choose one of the listed operations.");interaction.write(ratings.map((label,index)=>`${index+1} ${label}`).join("\n")+"\n");const ratingIndex=Number((await interaction.ask("Was it useful? [1\u20134]: ")).trim())-1;if(!Number.isInteger(ratingIndex)||ratingIndex<0||ratingIndex>=FEEDBACK_RATINGS.length)return invalid("Choose a rating from 1 to 4.");interaction.write(reasons.map((label,index)=>`${index+1} ${label}`).join("\n")+"\n");const reasonText=(await interaction.ask("Reason [1\u20138, or Enter to skip]: ")).trim(),reasonIndex=Number(reasonText)-1;if(reasonText&&(!Number.isInteger(reasonIndex)||reasonIndex<0||reasonIndex>=FEEDBACK_REASONS.length))return invalid("Choose a reason from 1 to 8, or skip it.");return service.recordFeedback({receiptId:recent.ok.events[selected].receiptId,rating:FEEDBACK_RATINGS[ratingIndex],...reasonText?{reason:FEEDBACK_REASONS[reasonIndex]}:{}},{submissionChannel:"interactive_cli"})}export async function bootstrapProductFeedback(argv,options={}){const args=[...argv],rootIndex=args.indexOf("--root");let selectedRoot;if(rootIndex>=0){selectedRoot=args[rootIndex+1];args.splice(rootIndex,2)}if(args.shift()!=="feedback")return false;if(args.length===1&&(args[0]==="--help"||args[0]==="help")){process.stdout.write(JSON.stringify({usage,description:"Voluntary feedback about a recent operation. Lists fixed metadata and stores a fixed rating locally. The next normal enabled delivery can upload it. --json submissions are identified as programmatic."})+"\n");return true}if(args.includes("--root")||rootIndex>=0&&(!selectedRoot||selectedRoot.startsWith("--")))throw Error("Choose one absolute --root for feedback.");if(!selectedRoot&&options.defaultRoot)selectedRoot=await configuredVaultRoot({catalogFile:fileURLToPath(new URL("../codex/plugins/zortex/.mcp.json",import.meta.url))});if(!selectedRoot||!isAbsolute(selectedRoot))throw Error("Use "+usage+".");const policy=await readFeedbackTelemetryPolicy(resolve(selectedRoot));if(!("ok"in policy)){process.stdout.write(JSON.stringify(policy)+"\n");process.exitCode=2;return true}if(!policy.ok.enabled){process.stdout.write(JSON.stringify({ok:{recorded:false,delivery:"disabled"}})+"\n");return true}const{root:metricsRoot,enabled}=policy.ok;const existing=await lstat(join(metricsRoot,"telemetry.sqlite")).catch(error=>{if(error.code==="ENOENT")return void 0;throw error});if(!existing){const result=args[0]==="--json"?businessError("not_found","No operation receipts exist on this installation.","storage"):ok({enabled,events:[],message:"No operation receipts exist yet. Run a search or connector operation first."});process.stdout.write(JSON.stringify(result)+"\n");if("err"in result)process.exitCode=2;return true}const service=await createTelemetry({root:metricsRoot,enabled,startup:false,context:await productMeasurementContext()});const interactive=!!process.stdin.isTTY&&!!process.stderr.isTTY&&!process.env.CI;let terminal;try{const result=await runProductFeedback(service,args,{interactive,write:text=>{process.stderr.write(text)},ask:async question=>{terminal??=createInterface({input:process.stdin,output:process.stderr});return terminal.question(question)}});process.stdout.write(JSON.stringify(result)+"\n");if("err"in result)process.exitCode=2}finally{terminal?.close();await service.close()}return true}
1
+ import{createInterface}from"node:readline/promises";import{lstat}from"node:fs/promises";import{isAbsolute,join,resolve}from"node:path";import{fileURLToPath}from"node:url";import{createTelemetry}from"@zortexhq/plugin-telemetry";import{FEEDBACK_RATINGS,FEEDBACK_REASONS}from"@zortexhq/plugin-telemetry/api";import{businessError,ok}from"@zortexhq/plugin-connector-framework/api";import{configuredVaultRoot}from"./default-root.js";import{productDeviceIdentityFile,productMeasurementContext}from"./measurement-context.js";import{readFeedbackTelemetryPolicy}from"./feedback-policy.js";const usage="indra --root <Vault> feedback [--list | --json <rating JSON>]";const ratings=["Useful","Partly useful","Not useful","Cannot judge"];const reasons=["Saved time","Answered my question","Incomplete result","Wrong result","No result","Too slow","Connection problem","Unclear"];const invalid=message=>businessError("invalid_argument",message,"storage");export async function runProductFeedback(service,args,interaction){if(args.length===2&&args[0]==="--json"){if(args[1].length>2048)return invalid("Feedback JSON is too large.");let input;try{input=JSON.parse(args[1])}catch{return invalid("Feedback JSON is invalid.")}return service.recordFeedback(input,{submissionChannel:"programmatic_cli"})}if(args.length&&!(args.length===1&&args[0]==="--list"))return invalid("Use "+usage+".");const recent=await service.recent({limit:args[0]==="--list"?20:5});if(!("ok"in recent))return recent;if(!recent.ok.enabled)return ok({...recent.ok,message:"Telemetry is disabled. No feedback was collected."});if(!interaction.interactive||args[0]==="--list")return recent;if(!recent.ok.events.length)return ok({...recent.ok,message:"No eligible operation was recorded in the last seven days. Run a search or connector operation first."});interaction.write("Recent operations\n");recent.ok.events.forEach((event,index)=>interaction.write(`${index+1} ${event.at} ${event.source?event.source+" ":""}${event.operation} ${event.outcome}${event.result?.count!==void 0?" \xB7 "+event.result.count+" records":""}
2
+ `));const choice=(await interaction.ask("Choose an operation [1]: ")).trim();const selected=choice===""?0:Number(choice)-1;if(!Number.isInteger(selected)||selected<0||selected>=recent.ok.events.length)return invalid("Choose one of the listed operations.");interaction.write(ratings.map((label,index)=>`${index+1} ${label}`).join("\n")+"\n");const ratingIndex=Number((await interaction.ask("Was it useful? [1\u20134]: ")).trim())-1;if(!Number.isInteger(ratingIndex)||ratingIndex<0||ratingIndex>=FEEDBACK_RATINGS.length)return invalid("Choose a rating from 1 to 4.");interaction.write(reasons.map((label,index)=>`${index+1} ${label}`).join("\n")+"\n");const reasonText=(await interaction.ask("Reason [1\u20138, or Enter to skip]: ")).trim(),reasonIndex=Number(reasonText)-1;if(reasonText&&(!Number.isInteger(reasonIndex)||reasonIndex<0||reasonIndex>=FEEDBACK_REASONS.length))return invalid("Choose a reason from 1 to 8, or skip it.");return service.recordFeedback({receiptId:recent.ok.events[selected].receiptId,rating:FEEDBACK_RATINGS[ratingIndex],...reasonText?{reason:FEEDBACK_REASONS[reasonIndex]}:{}},{submissionChannel:"interactive_cli"})}export async function bootstrapProductFeedback(argv,options={}){const args=[...argv],rootIndex=args.indexOf("--root");let selectedRoot;if(rootIndex>=0){selectedRoot=args[rootIndex+1];args.splice(rootIndex,2)}if(args.shift()!=="feedback")return false;if(args.length===1&&(args[0]==="--help"||args[0]==="help")){process.stdout.write(JSON.stringify({usage,description:"Voluntary feedback about a recent operation. Lists fixed metadata and stores a fixed rating locally. The next normal enabled delivery can upload it. --json submissions are identified as programmatic."})+"\n");return true}if(args.includes("--root")||rootIndex>=0&&(!selectedRoot||selectedRoot.startsWith("--")))throw Error("Choose one absolute --root for feedback.");if(!selectedRoot&&options.defaultRoot)selectedRoot=await configuredVaultRoot({catalogFile:fileURLToPath(new URL("../codex/plugins/zortex/.mcp.json",import.meta.url))});if(!selectedRoot||!isAbsolute(selectedRoot))throw Error("Use "+usage+".");const policy=await readFeedbackTelemetryPolicy(resolve(selectedRoot));if(!("ok"in policy)){process.stdout.write(JSON.stringify(policy)+"\n");process.exitCode=2;return true}if(!policy.ok.enabled){process.stdout.write(JSON.stringify({ok:{recorded:false,delivery:"disabled"}})+"\n");return true}const{root:metricsRoot,enabled}=policy.ok;const existing=await lstat(join(metricsRoot,"telemetry.sqlite")).catch(error=>{if(error.code==="ENOENT")return void 0;throw error});if(!existing){const result=args[0]==="--json"?businessError("not_found","No operation receipts exist on this installation.","storage"):ok({enabled,events:[],message:"No operation receipts exist yet. Run a search or connector operation first."});process.stdout.write(JSON.stringify(result)+"\n");if("err"in result)process.exitCode=2;return true}const service=await createTelemetry({root:metricsRoot,enabled,startup:false,context:await productMeasurementContext(),deviceIdentityFile:productDeviceIdentityFile()});const interactive=!!process.stdin.isTTY&&!!process.stderr.isTTY&&!process.env.CI;let terminal;try{const result=await runProductFeedback(service,args,{interactive,write:text=>{process.stderr.write(text)},ask:async question=>{terminal??=createInterface({input:process.stdin,output:process.stderr});return terminal.question(question)}});process.stdout.write(JSON.stringify(result)+"\n");if("err"in result)process.exitCode=2}finally{terminal?.close();await service.close()}return true}
package/dist/profile.js CHANGED
@@ -1 +1 @@
1
- import{Context}from"@deepseek-ai/cordis";import Loader from"@deepseek-ai/cordis-plugin-loader";import{mkdir,readFile,realpath}from"node:fs/promises";import{dirname,join,resolve,sep}from"node:path";import{fileURLToPath,pathToFileURL}from"node:url";import{parseDocument,isSeq,isMap}from"yaml";import{setTimeout as delay}from"node:timers/promises";import{createTraceRecorder,withStartupFeedbackFlow,withTelemetryContext}from"@zortexhq/plugin-telemetry/api";import{productMeasurementContext}from"./measurement-context.js";import{isFreshProductDirectory}from"./installation-origin.js";import{ensureProductProfile}from"./profile-upgrade.js";import{ProductProfileInclude}from"./profile-include.js";import{attachResourceTelemetry}from"./resource-telemetry.js";export async function openProfile(profile,processRole="unknown"){return withTelemetryContext(await productMeasurementContext(),async()=>{const ctx=new Context;const product=await realpath(dirname(fileURLToPath(new URL("../package.json",import.meta.url))));ctx.baseUrl=pathToFileURL(product+sep).href;try{await ctx.registry.plugin(Loader);ctx.loader.builtins["indra-profile-include"]=ProductProfileInclude;await ctx.loader.create({name:"cordis:indra-profile-include",config:{path:pathToFileURL(resolve(profile)).href}});await ctx.loader.await();for(const row of ctx.loader.entries()){if(row.disabled||row.options.group)continue;await row.fiber?.await();if(!row.fiber||row.fiber.state!==2)throw Error("Plugin failed to activate: "+row.options.name)}const stopResources=attachResourceTelemetry(ctx,processRole);ctx.effect(()=>stopResources);return{context:ctx,close:()=>{stopResources();return ctx.fiber.dispose()}}}catch(error){try{if(ctx.get("zortexTelemetry"))await withStartupFeedbackFlow("other",()=>createTraceRecorder(()=>ctx.get("zortexTelemetry"),"other").step("startup_failed","failed"));const sent=await ctx.get("zortexPostHog")?.flush({wait:true});if(sent&&"err"in sent)process.stderr.write("indra feedback: delivery pending; retained for the next run.\n")}catch{process.stderr.write("indra feedback: startup failure observation could not be delivered.\n")}try{await ctx.fiber.dispose()}catch{process.stderr.write("indra: startup cleanup failed.\n")}throw error}})}export async function openProduct(root,installationOptions={}){const fresh=installationOptions.newInstallation??await isFreshProductDirectory(root);process.env.ZORTEX_ENGINE_ROOT=root;process.env.ZORTEX_TELEMETRY_NEW_INSTALL_ROOT=fresh?resolve(root,"metrics"):"";await mkdir(root,{recursive:true});const profile=join(root,"indra-profile.yml");const base=fileURLToPath(new URL("../profiles/",import.meta.url));const options={customTags:[{tag:"tag:yaml.org,2002:js",resolve:value=>value}]};const core=parseDocument(await readFile(join(base,"core.yml"),"utf8"),options);const vault=parseDocument(await readFile(join(base,"vault.yml"),"utf8"),options);if(!isSeq(core.contents)||!isSeq(vault.contents)||core.errors.length||vault.errors.length)throw Error("Invalid installed profile.");const vaultRows=vault.contents.items;core.contents.items=core.contents.items.flatMap(row=>isMap(row)&&row.toJSON().id==="indra-core-vault"?vaultRows:[row]);for(const row of core.contents.items){if(!isMap(row))throw Error("Invalid installed plugin row.");const specifier=String(row.toJSON().name);const mutable=row;mutable.set("publicModule",specifier);mutable.set("name",pathToFileURL(await realpath(fileURLToPath(import.meta.resolve(specifier)))).href)}await ensureProductProfile(profile,String(core));for(let attempt=0;;attempt++){try{return await openProfile(profile,installationOptions.processRole??"cli")}catch(error){const sqlite=error;if(attempt>=2||sqlite?.code!=="ERR_SQLITE_ERROR"||sqlite.errcode!==5)throw error;await delay(100*(attempt+1))}}}
1
+ import{Context}from"@deepseek-ai/cordis";import Loader from"@deepseek-ai/cordis-plugin-loader";import{mkdir,readFile,realpath}from"node:fs/promises";import{dirname,join,resolve,sep}from"node:path";import{fileURLToPath,pathToFileURL}from"node:url";import{parseDocument,isSeq,isMap}from"yaml";import{setTimeout as delay}from"node:timers/promises";import{createTraceRecorder,withStartupFeedbackFlow,withTelemetryContext}from"@zortexhq/plugin-telemetry/api";import{productDeviceIdentityFile,productMeasurementContext}from"./measurement-context.js";import{isFreshProductDirectory}from"./installation-origin.js";import{ensureProductProfile}from"./profile-upgrade.js";import{ProductProfileInclude}from"./profile-include.js";import{attachResourceTelemetry}from"./resource-telemetry.js";export async function openProfile(profile,processRole="unknown"){process.env.ZORTEX_DEVICE_IDENTITY_FILE=productDeviceIdentityFile();return withTelemetryContext(await productMeasurementContext(),async()=>{const ctx=new Context;const product=await realpath(dirname(fileURLToPath(new URL("../package.json",import.meta.url))));ctx.baseUrl=pathToFileURL(product+sep).href;try{await ctx.registry.plugin(Loader);ctx.loader.builtins["indra-profile-include"]=ProductProfileInclude;await ctx.loader.create({name:"cordis:indra-profile-include",config:{path:pathToFileURL(resolve(profile)).href}});await ctx.loader.await();for(const row of ctx.loader.entries()){if(row.disabled||row.options.group)continue;await row.fiber?.await();if(!row.fiber||row.fiber.state!==2)throw Error("Plugin failed to activate: "+row.options.name)}const stopResources=attachResourceTelemetry(ctx,processRole);ctx.effect(()=>stopResources);return{context:ctx,close:()=>{stopResources();return ctx.fiber.dispose()}}}catch(error){try{if(ctx.get("zortexTelemetry"))await withStartupFeedbackFlow("other",()=>createTraceRecorder(()=>ctx.get("zortexTelemetry"),"other").step("startup_failed","failed"));const sent=await ctx.get("zortexPostHog")?.flush({wait:true});if(sent&&"err"in sent)process.stderr.write("indra feedback: delivery pending; retained for the next run.\n")}catch{process.stderr.write("indra feedback: startup failure observation could not be delivered.\n")}try{await ctx.fiber.dispose()}catch{process.stderr.write("indra: startup cleanup failed.\n")}throw error}})}export async function openProduct(root,installationOptions={}){const fresh=installationOptions.newInstallation??await isFreshProductDirectory(root);process.env.ZORTEX_ENGINE_ROOT=root;process.env.ZORTEX_TELEMETRY_NEW_INSTALL_ROOT=fresh?resolve(root,"metrics"):"";await mkdir(root,{recursive:true});const profile=join(root,"indra-profile.yml");const base=fileURLToPath(new URL("../profiles/",import.meta.url));const options={customTags:[{tag:"tag:yaml.org,2002:js",resolve:value=>value}]};const core=parseDocument(await readFile(join(base,"core.yml"),"utf8"),options);const vault=parseDocument(await readFile(join(base,"vault.yml"),"utf8"),options);if(!isSeq(core.contents)||!isSeq(vault.contents)||core.errors.length||vault.errors.length)throw Error("Invalid installed profile.");const vaultRows=vault.contents.items;core.contents.items=core.contents.items.flatMap(row=>isMap(row)&&row.toJSON().id==="indra-core-vault"?vaultRows:[row]);for(const row of core.contents.items){if(!isMap(row))throw Error("Invalid installed plugin row.");const specifier=String(row.toJSON().name);const mutable=row;mutable.set("publicModule",specifier);mutable.set("name",pathToFileURL(await realpath(fileURLToPath(import.meta.resolve(specifier)))).href)}await ensureProductProfile(profile,String(core));for(let attempt=0;;attempt++){try{return await openProfile(profile,installationOptions.processRole??"cli")}catch(error){const sqlite=error;if(attempt>=2||sqlite?.code!=="ERR_SQLITE_ERROR"||sqlite.errcode!==5)throw error;await delay(100*(attempt+1))}}}