@humain/humain-code 0.8.1 → 0.8.2
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/CHANGELOG.md +25 -0
- package/dist/bundle/chunks/{chunk-3CGMVKHA.js → chunk-3E37CJCE.js} +1 -1
- package/dist/bundle/chunks/{chunk-7X6DNT45.js → chunk-3PJ7NPWN.js} +8 -6
- package/dist/bundle/chunks/{chunk-P2Y2H7SD.js → chunk-6JTCRCNF.js} +2 -2
- package/dist/bundle/chunks/{chunk-APNPBT7Y.js → chunk-BRSLXHED.js} +1 -1
- package/dist/bundle/chunks/{chunk-KONLZKPL.js → chunk-E4VUW4RI.js} +1 -1
- package/dist/bundle/chunks/{chunk-E7OBH44W.js → chunk-EFY2QPVP.js} +6 -6
- package/dist/bundle/chunks/{chunk-6YVORXTX.js → chunk-G2QMON4O.js} +253 -232
- package/dist/bundle/chunks/{chunk-QRRVZYTG.js → chunk-H2B3WLIM.js} +2 -2
- package/dist/bundle/chunks/{chunk-XZ7FTBXS.js → chunk-H7UPU2SH.js} +1187 -1196
- package/dist/bundle/chunks/{chunk-NICPFMOP.js → chunk-JKX5EGOT.js} +1 -1
- package/dist/bundle/chunks/{chunk-P42E6YY6.js → chunk-JQBZUFH7.js} +33 -32
- package/dist/bundle/chunks/{chunk-D3KYOSQY.js → chunk-JSHKS7VH.js} +1 -1
- package/dist/bundle/chunks/{chunk-SXOIQWNX.js → chunk-JX6YIPNK.js} +1 -1
- package/dist/bundle/chunks/{chunk-WBSGWISD.js → chunk-M5TVWJ5T.js} +5 -4
- package/dist/bundle/chunks/{chunk-6TTMNQXI.js → chunk-PJXBU6CR.js} +43 -40
- package/dist/bundle/chunks/{chunk-CQ2CE3RB.js → chunk-QFDZEUFU.js} +2 -2
- package/dist/bundle/chunks/{chunk-DD5UT56Y.js → chunk-R2KD2HFT.js} +67 -66
- package/dist/bundle/chunks/{chunk-IMUFBWEK.js → chunk-T2ZGMEMV.js} +42 -41
- package/dist/bundle/chunks/{chunk-ROFZVEFN.js → chunk-U4EAJPMO.js} +45 -44
- package/dist/bundle/chunks/{chunk-FQ4KS5S4.js → chunk-UZOIHLNU.js} +1 -1
- package/dist/bundle/chunks/{chunk-DJG2WUNM.js → chunk-ZSWU5KKA.js} +1 -1
- package/dist/bundle/chunks/{compat-SRCNS6OQ.js → compat-ELBUCH6U.js} +1 -1
- package/dist/bundle/chunks/{dist-4OMLHRJE.js → dist-NERIS6SW.js} +1 -1
- package/dist/bundle/chunks/{dist-TRAK7EXI.js → dist-QSYDYE3Y.js} +6 -6
- package/dist/bundle/chunks/{easter-egg-3d-VVUF3C3X.js → easter-egg-3d-VZC5WOYV.js} +1 -1
- package/dist/bundle/chunks/{execute-I3WGGPWL.js → execute-6MEJJF2T.js} +2 -2
- package/dist/bundle/chunks/{flow-implementer-4KO3Q4B5.js → flow-implementer-3P3BHQ7E.js} +4 -4
- package/dist/bundle/chunks/{inprocess-TOBRVK4C.js → inprocess-3PDJKE5F.js} +4 -4
- package/dist/bundle/chunks/{interactive-mode-BJJKPBXD.js → interactive-mode-SDUO5OLD.js} +2 -2
- package/dist/bundle/chunks/{session-picker-4JQEGLDD.js → session-picker-EYKCMFQR.js} +1 -1
- package/dist/bundle/chunks/{startup-ui-AKTA4NDP.js → startup-ui-7ODOR34R.js} +2 -2
- package/dist/bundle/chunks/{trace-command-7ORDQ3JS.js → trace-command-VM7FBWPE.js} +4 -4
- package/dist/bundle/chunks/{virtual-modules-3CT5BMBA.js → virtual-modules-IU5KWB2C.js} +8 -8
- package/dist/bundle/cli-runtime.js +3 -3
- package/dist/bundle/index.js +8 -8
- package/dist/bundle/rpc-entry.js +3 -3
- package/dist/core/model-resolver.js +2 -2
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/settings-manager.d.ts +4 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +17 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +2 -0
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +10 -0
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/extensions/usage/index.js +5 -5
- package/dist/extensions/usage/index.js.map +1 -1
- package/dist/humain/gateway/client.d.ts.map +1 -1
- package/dist/humain/gateway/client.js +36 -9
- package/dist/humain/gateway/client.js.map +1 -1
- package/dist/humain/gateway/http.d.ts.map +1 -1
- package/dist/humain/gateway/http.js +26 -6
- package/dist/humain/gateway/http.js.map +1 -1
- package/dist/humain/gateway/provider.d.ts.map +1 -1
- package/dist/humain/gateway/provider.js +9 -2
- package/dist/humain/gateway/provider.js.map +1 -1
- package/dist/humain/hcode/facade.d.ts +12 -1
- package/dist/humain/hcode/facade.d.ts.map +1 -1
- package/dist/humain/hcode/facade.js +35 -8
- package/dist/humain/hcode/facade.js.map +1 -1
- package/dist/humain/hcode/login-copy.d.ts.map +1 -1
- package/dist/humain/hcode/login-copy.js +10 -0
- package/dist/humain/hcode/login-copy.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +6 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +26 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +35 -1
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +179 -3
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/working-indicator-engine.d.ts +32 -0
- package/dist/modes/interactive/components/working-indicator-engine.d.ts.map +1 -0
- package/dist/modes/interactive/components/working-indicator-engine.js +112 -0
- package/dist/modes/interactive/components/working-indicator-engine.js.map +1 -0
- package/dist/modes/interactive/fullscreen.d.ts +13 -0
- package/dist/modes/interactive/fullscreen.d.ts.map +1 -0
- package/dist/modes/interactive/fullscreen.js +25 -0
- package/dist/modes/interactive/fullscreen.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +4 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +117 -19
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/humain-dark.json +5 -4
- package/dist/modes/interactive/theme/humain-light.json +6 -5
- package/docs/development.md +7 -0
- package/docs/providers.md +14 -4
- package/docs/settings.md +20 -0
- package/docs/usage.md +2 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/schemas/settings.schema.json +29 -0
- package/dist/bundle/chunks/chunk-YPZPCHNV.js +0 -3
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
2
|
import{COORDINATION_MESSAGE_TYPE,CoordinationClient,CoordinationRequestError,CoordinationSessionHeldError,HUMAIN_FORGE_CWD_ENV,InboundDelivery,MAX_ID_CHARS,MAX_NAME_CHARS,MAX_WORKTREE_CHARS,WakeBudget,cleanMeta,codemode_default,createClientBackend,createCoordinationToolDefinition,createIntegrationBackend,getFlowRpcControl,getHumainBundledExtensionFactories,getHumainDefaultPackageSources,inspectAttempt,loadFlowRpcControl,peerLabel,preflightModel,renderPeerMessage,revokeGatewayOrphans,runGit,setFlowRpcFollowUp,
|
|
3
|
-
setFlowRpcOutput,shouldReconcileGatewayOnStartup}from"./chunk-
|
|
4
|
-
paidUsageLines,parseAuthCommand,printAuthCommandHelp,readClaudeUsage,refreshStartupModelCatalogs,renderUsageBar,trackUserWait,usageAge,usageDisplayText,usagePaneRow,validateAuthCommandArgs,weeklyResetLines}from"./chunk-
|
|
5
|
-
RunFailure,SubagentProgressRegistry,TASK_ID_ENV,captureModelSelectionIntent,closeSessionFlowControl,completionEvidence,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createHcodeProvider,currentSubagentDepth,currentTaskId,detectSupportedImageMimeTypeFromFile,emitProjectTrustEvent,exportFromFile,failureOutcome,formatHcodeMessageNotice,formatMissingSessionCwdPrompt,formatNoModelsAvailableMessage,formatPackageInstallWarning,
|
|
6
|
-
getPiUserAgent,initializeFlowChildBootstrap,isBuiltinExtension,isHcodeSelectionMessage,isRetiredHumainProvider,missingExtensionPaths,parseArgs,printHelp,printTimings,processImage,readGitBranch,readSubagentProgress,registerAutoSessionNamer,resetTimings,resolveCliModel,resolveGitRepositoryIdentity,resolveModelReference,resolveModelScopeFromModels,resolveModelScopeWithDiagnostics,resolveReadPath,resolveToCwd,sameReference,settledOutcome,stripJsonComments,
|
|
7
|
-
import{loadMcpConfig,updateMcpServerConfig}from"./chunk-JBSWWCT5.js";import{ProjectTrustStore,getProjectTrustOptions,hasTrustRequiringProjectResources}from"./chunk-JSZBTGI6.js";import{SessionManager,assertValidSessionId}from"./chunk-GPLWWO5Q.js";import{TOOL_SEARCH_TOOL_NAME,createToolSearchToolDefinition}from"./chunk-
|
|
8
|
-
getTextOutput,replaceTabs,writeOutputFile}from"./chunk-
|
|
9
|
-
import{DynamicBorder,KeybindingsManager,flushStdout,migrateKeybindingsConfig}from"./chunk-
|
|
10
|
-
import{THEME_TOKENS,formatKeyText,getSelectListTheme,initTheme,keyHint,rawKeyHint,setThemeJsonValidator,stopThemeWatcher,theme}from"./chunk-
|
|
11
|
-
import{getTraceEnvSecrets,lazyValidator as lazyValidator2,takeTraceIngestCredentials}from"./chunk-
|
|
12
|
-
modelsAreEqual}from"./chunk-KI7CHPWC.js";import{AGENT_MONITOR_COMMAND,AGENT_MONITOR_PROTOCOL,AGENT_MONITOR_ROLE,MAX_CHILDREN,MAX_ID,MAX_SNAPSHOT_FRAME_BYTES,parseSnapshot,resolveAgentMonitorPaths}from"./chunk-4TDNOR36.js";import{parseHumainAgentExecutionRequest,parseHumainAgentExecutionResponse,parseSubagentProgressSnapshot}from"./chunk-2NVGOSBN.js";import{FlowIdSchema,FlowModelRefSchema,FlowReasonClassSchema,
|
|
13
|
-
import{lazyValidator}from"./chunk-7OZNMWAJ.js";import{typebox_exports}from"./chunk-VEGJT52D.js";import{COORDINATION_BROKER_COMMAND,detectLaunchRuntime,getInternalCommandLaunchSpec}from"./chunk-6HTHDVJC.js";import{COORDINATION_FILE_MODE,assertPrivateSocket,createMessageReader,resolveCoordinationRuntimePaths,writeMessage}from"./chunk-B47PNNLL.js";import{APP_COMMAND,APP_NAME,APP_TITLE,
|
|
14
|
-
ENV_STARTUP_BENCHMARK,HUMAIN_TERMINAL_WEB_URL,PACKAGE_NAME,VERSION,canonicalizePath,detectInstallChange,detectInstallMethod,expandTildePath,getAgentDir,getBinDir,getConfiguredSelfUpdateArgv,getCwdRelativePath,getPackageDir,getSelfUpdateCommand,getSelfUpdateUnavailableInstruction,isLocalPath,makeConfiguredSelfUpdateCommand,normalizePath,resolvePath,shortenHomePath,spawnProcess,spawnProcessSync,stripBom,
|
|
3
|
+
setFlowRpcOutput,shouldReconcileGatewayOnStartup}from"./chunk-PJXBU6CR.js";import{AuthCommandError,AuthUrlComponent,FULLSCREEN_OVERLAY,buildUsageOverview,claudeUsageBars,codexUsageBars,currentUserWait,exitAfterSignalShutdown,formatCwdForFooter,formatUsageOverview,formatVersionCheckError,fullscreenSurface,getAuthCommandName,getAuthCommandUsage,getAuthCredential,getClaudeUsageReconnect,getLatestPiRelease,hcodeEmptyCatalogMessage,hcodeLoginAvailability,isAuthCommandHelp,isNewerPackageVersion,
|
|
4
|
+
nextQuotaResetLines,onUserWaitChange,paidUsageLines,parseAuthCommand,printAuthCommandHelp,readClaudeUsage,refreshStartupModelCatalogs,renderUsageBar,trackUserWait,usageAge,usageDisplayText,usagePaneRow,validateAuthCommandArgs,weeklyResetLines}from"./chunk-3PJ7NPWN.js";import{AgentSessionRuntime,BUILD_SESSION_ENDED,DISABLED_SUBAGENT_RUN_OBSERVER,DefaultResourceLoader,HCODE_PROVIDER,HUMAIN_GATEWAY_PROVIDER,HUMAIN_NODE_PROVIDER,HcodeLocalRefusal,InMemoryCodingAgentModelsStore,MissingSessionCwdError,
|
|
5
|
+
ModelRuntime,PARENT_TASK_ID_ENV,RunFailure,SubagentProgressRegistry,TASK_ID_ENV,captureModelSelectionIntent,closeSessionFlowControl,completionEvidence,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createHcodeProvider,currentSubagentDepth,currentTaskId,detectSupportedImageMimeTypeFromFile,emitProjectTrustEvent,exportFromFile,failureOutcome,formatHcodeMessageNotice,formatMissingSessionCwdPrompt,formatNoModelsAvailableMessage,formatPackageInstallWarning,
|
|
6
|
+
getBranchSelection,getMissingSessionCwdIssue,getPiUserAgent,initializeFlowChildBootstrap,isBuiltinExtension,isHcodeSelectionMessage,isRetiredHumainProvider,missingExtensionPaths,parseArgs,printHelp,printTimings,processImage,readGitBranch,readSubagentProgress,registerAutoSessionNamer,resetTimings,resolveCliModel,resolveGitRepositoryIdentity,resolveModelReference,resolveModelScopeFromModels,resolveModelScopeWithDiagnostics,resolveReadPath,resolveToCwd,sameReference,settledOutcome,stripJsonComments,
|
|
7
|
+
stripStartupEnvArgs,time}from"./chunk-JQBZUFH7.js";import{loadMcpConfig,updateMcpServerConfig}from"./chunk-JBSWWCT5.js";import{ProjectTrustStore,getProjectTrustOptions,hasTrustRequiringProjectResources}from"./chunk-JSZBTGI6.js";import{SessionManager,assertValidSessionId}from"./chunk-GPLWWO5Q.js";import{TOOL_SEARCH_TOOL_NAME,createToolSearchToolDefinition}from"./chunk-JSHKS7VH.js";import{CODEMODE_TOOL_NAME}from"./chunk-6JTCRCNF.js";import{VisualLinePreview,addUsageToTotals,
|
|
8
|
+
createUsageTotals,formatToolCallWithArgs,getSessionUsage,getTextOutput,replaceTabs,writeOutputFile}from"./chunk-3E37CJCE.js";import{toLlmContent}from"./chunk-Q5RKNQ2T.js";import{AuthStorage,LIST_MCP_RESOURCES_TOOL,LIST_MCP_RESOURCE_TEMPLATES_TOOL,READ_MCP_RESOURCE_TOOL,ReadOnlyAuthStorage,getMcpToolExposure,mcpNamespace,raceWithAbortSignal}from"./chunk-JWOPWHVH.js";import{formatSize,truncateMiddle}from"./chunk-3HVHETMU.js";import{stream,streamSimple,typesafeSystemOneApi}from"./chunk-H7UPU2SH.js";
|
|
9
|
+
import{showNonInteractiveMetadataDisclosure}from"./chunk-6P6GJPYB.js";import{DynamicBorder,KeybindingsManager,flushStdout,migrateKeybindingsConfig}from"./chunk-UZOIHLNU.js";import{BUILTIN_PATH_PREFIX,DefaultPackageManager,SettingsManager,applyHttpProxySettings,configureHttpDispatcher,flushRawStdout,getResourcePathKey,hcodeDisplayName,resolveHcodeEnvironment,restoreStdout,takeOverStdout,waitForRawStdoutBackpressure,writeRawStdout}from"./chunk-T2ZGMEMV.js";import{SETTINGS_DEFAULTS}from"./chunk-GV5OVRKK.js";
|
|
10
|
+
import{require_proper_lockfile}from"./chunk-F6ZAYLU2.js";import{THEME_TOKENS,formatKeyText,getSelectListTheme,initTheme,keyHint,rawKeyHint,setThemeJsonValidator,stopThemeWatcher,theme}from"./chunk-E4VUW4RI.js";import{source_default}from"./chunk-XQRYOCHA.js";import{Container,Input,Markdown,ProcessTerminal,SelectList,Spacer,Text,TuiMainScreen,fuzzyFilter,getKeybindings,getSelectPageIndex,matchesKey,sanitizeTerminalText,setCapabilityOverrides,setKeybindings,stripTerminalSequences,
|
|
11
|
+
truncateToWidth,visibleWidth,wrapTextWithAnsi}from"./chunk-M5TVWJ5T.js";import{getTraceEnvSecrets,lazyValidator as lazyValidator2,takeTraceIngestCredentials}from"./chunk-R2KD2HFT.js";import{openBrowser}from"./chunk-IWZQ25I3.js";import{ensureBroker}from"./chunk-HHWVVNGG.js";import{ID_IN_USE_DETAIL,MAX_ARTIFACT_BYTES,MAX_EVIDENCE_CHARS,MAX_SESSION_FIELD_CHARS,isOwnershipMode,isRecordKey,isSha256Hex,truncateChars}from"./chunk-UEW6TUSP.js";import{killTrackedDetachedChildren,
|
|
12
|
+
killTrackedDetachedChildrenAsync}from"./chunk-SKCJ25SX.js";import{isModelType,modelsAreEqual}from"./chunk-KI7CHPWC.js";import{AGENT_MONITOR_COMMAND,AGENT_MONITOR_PROTOCOL,AGENT_MONITOR_ROLE,MAX_CHILDREN,MAX_ID,MAX_SNAPSHOT_FRAME_BYTES,parseSnapshot,resolveAgentMonitorPaths}from"./chunk-4TDNOR36.js";import{parseHumainAgentExecutionRequest,parseHumainAgentExecutionResponse,parseSubagentProgressSnapshot}from"./chunk-2NVGOSBN.js";import{FlowIdSchema,FlowModelRefSchema,FlowReasonClassSchema,
|
|
13
|
+
FlowRoleSchema,FlowSizeSchema,StrictObject,lit,parseFlowData}from"./chunk-PVNXN2TC.js";import{lazyValidator}from"./chunk-7OZNMWAJ.js";import{typebox_exports}from"./chunk-VEGJT52D.js";import{COORDINATION_BROKER_COMMAND,detectLaunchRuntime,getInternalCommandLaunchSpec}from"./chunk-6HTHDVJC.js";import{COORDINATION_FILE_MODE,assertPrivateSocket,createMessageReader,resolveCoordinationRuntimePaths,writeMessage}from"./chunk-B47PNNLL.js";import{APP_COMMAND,APP_NAME,APP_TITLE,
|
|
14
|
+
CONFIG_DIR_NAME,ENV_OFFLINE,ENV_PREFIX,ENV_SELF_UPDATE_COMMAND,ENV_SESSION_DIR,ENV_SKIP_VERSION_CHECK,ENV_STARTUP_BENCHMARK,HUMAIN_TERMINAL_WEB_URL,PACKAGE_NAME,VERSION,canonicalizePath,detectInstallChange,detectInstallMethod,expandTildePath,getAgentDir,getBinDir,getConfiguredSelfUpdateArgv,getCwdRelativePath,getPackageDir,getSelfUpdateCommand,getSelfUpdateUnavailableInstruction,isLocalPath,makeConfiguredSelfUpdateCommand,normalizePath,resolvePath,shortenHomePath,spawnProcess,spawnProcessSync,stripBom,
|
|
15
|
+
waitForChildProcess}from"./chunk-VFLVWPLZ.js";import{__toESM}from"./chunk-JXWJOIH4.js";import{randomUUID}from"node:crypto";var ORIGIN_ENV="HUMAIN_CODE_FORGE_ORIGIN",TOKEN_ENV="HUMAIN_CODE_RUN_TOKEN",UNAVAILABLE="Forge run inference is unavailable.";function takeHcodeRunBootstrap(env){let origin=env[ORIGIN_ENV],token=env[TOKEN_ENV],present=!1,ambiguous=!1;for(let key of Object.keys(env)){let name=key.toUpperCase();name!==TOKEN_ENV&&name!==ORIGIN_ENV||(present=!0,ambiguous||=key!==name,delete env[key])}if(!present)return{kind:"desktop"};let environment=["dev","staging","production"].map(name=>resolveHcodeEnvironment(name)).
|
|
15
16
|
find(candidate=>candidate.origin===origin);if(ambiguous||!environment||!token||!/^frt_v1_[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$/.test(token))return{kind:"invalid"};let bearer=token;return{kind:"run",environment,open(){if(bearer===void 0)throw new Error(UNAVAILABLE);let credential=bearer;return bearer=void 0,createRunFacade(environment,credential)}}}function createRunFacade(environment,token){let lifetime=new AbortController,signal=lifetime.signal,reference={environmentId:environment.id,accountId:"\
|
|
16
17
|
forge-run",generation:randomUUID()},tokenRejected=!1,refuse=async()=>{throw new Error(UNAVAILABLE)},account={status:id=>!signal.aborted&&id===environment.id?reference:null,login:refuse,logout:refuse,authorizedFetch:refuse,subscribe:()=>()=>{}},provider=createHcodeProvider({...account,async authorizedFetch(expected,url,init){let method=init.method??"GET";if(!sameReference(expected,reference)||process.env.PI_OFFLINE||!(method==="GET"&&url===`${environment.inferenceBaseUrl}/models`||method==="POST"&&
|
|
17
18
|
url===`${environment.inferenceBaseUrl}/messages`))return refuse();if(tokenRejected)throw new HcodeLocalRefusal("buildSessionEnded");let requestSignal=init.signal?AbortSignal.any([signal,init.signal]):signal;requestSignal.throwIfAborted();let headers=new Headers(init.headers);headers.set("authorization",`Bearer ${token}`);let response;try{response=await globalThis.fetch(url,{method,body:init.body,headers,signal:requestSignal,redirect:"error",credentials:"omit",cache:"no-store"})}catch{return refuse()}
|
|
@@ -247,9 +248,9 @@ ${loadError}`));let refresh=await modelRuntime.refresh({providers:[HCODE_PROVIDE
|
|
|
247
248
|
`HUMAIN Code account: ${hcodeEmptyCatalogMessage(managedEmptyReason)}`)),models.length===0){console.log(formatNoModelsAvailableMessage());return}let filteredModels=models;if(searchPattern&&(filteredModels=fuzzyFilter(models,searchPattern,m=>`${m.provider} ${m.id}`)),filteredModels.length===0){console.log(`No models matching "${searchPattern}"`);return}filteredModels.sort((a,b)=>{let providerCmp=a.provider.localeCompare(b.provider);return providerCmp!==0?providerCmp:a.id.localeCompare(b.id)});let rows=filteredModels.
|
|
248
249
|
map(m=>({provider:m.provider,model:m.id,context:formatTokenCount(m.contextWindow),maxOut:m.maxTokens===0?"unknown":formatTokenCount(m.maxTokens),thinking:m.reasoning?"yes":"no",images:m.input.includes("image")?"yes":"no"})),headers={provider:"provider",model:"model",context:"context",maxOut:"max-out",thinking:"thinking",images:"images"},widths={provider:Math.max(headers.provider.length,...rows.map(r=>r.provider.length)),model:Math.max(headers.model.length,...rows.map(r=>r.model.length)),context:Math.
|
|
249
250
|
max(headers.context.length,...rows.map(r=>r.context.length)),maxOut:Math.max(headers.maxOut.length,...rows.map(r=>r.maxOut.length)),thinking:Math.max(headers.thinking.length,...rows.map(r=>r.thinking.length)),images:Math.max(headers.images.length,...rows.map(r=>r.images.length))},headerLine=[headers.provider.padEnd(widths.provider),headers.model.padEnd(widths.model),headers.context.padEnd(widths.context),headers.maxOut.padEnd(widths.maxOut),headers.thinking.padEnd(widths.thinking),headers.images.
|
|
250
|
-
padEnd(widths.images)].join(" ");console.log(headerLine);for(let row of rows){let line=[row.provider.padEnd(widths.provider),row.model.padEnd(widths.model),row.context.padEnd(widths.context),row.maxOut.padEnd(widths.maxOut),row.thinking.padEnd(widths.thinking),row.images.padEnd(widths.images)].join(" ");console.log(line)}}var loadStartupUi=()=>import("./startup-ui-
|
|
251
|
+
padEnd(widths.images)].join(" ");console.log(headerLine);for(let row of rows){let line=[row.provider.padEnd(widths.provider),row.model.padEnd(widths.model),row.context.padEnd(widths.context),row.maxOut.padEnd(widths.maxOut),row.thinking.padEnd(widths.thinking),row.images.padEnd(widths.images)].join(" ");console.log(line)}}var loadStartupUi=()=>import("./startup-ui-7ODOR34R.js");function createProjectTrustContext(options){return{cwd:options.cwd,mode:options.mode==="interactive"?"tui":options.mode,hasUI:options.hasUI,ui:{select:async(title,selectOptions)=>{if(!options.hasUI||options.mode!=="interactive")return;let{showStartupSelector}=await loadStartupUi();return showStartupSelector(options.settingsManager,title,selectOptions.map(option=>({label:option,value:option})))},confirm:async(title,message)=>{if(!options.hasUI||options.mode!=="interactive")return!1;let{showStartupSelector}=await loadStartupUi();
|
|
251
252
|
return await showStartupSelector(options.settingsManager,`${title}
|
|
252
|
-
${message}`,[{label:"Yes",value:!0},{label:"No",value:!1}])??!1},input:async(title,placeholder)=>{if(!options.hasUI||options.mode!=="interactive")return;let{showStartupInput}=await loadStartupUi();return showStartupInput(options.settingsManager,title,placeholder)},notify:(message,type="info")=>{if(options.mode!=="interactive"){let color=type==="error"?source_default.red:type==="warning"?source_default.yellow:source_default.cyan;console.error(color(message))}}}}}var loadSessionPicker=()=>import("./session-picker-
|
|
253
|
+
${message}`,[{label:"Yes",value:!0},{label:"No",value:!1}])??!1},input:async(title,placeholder)=>{if(!options.hasUI||options.mode!=="interactive")return;let{showStartupInput}=await loadStartupUi();return showStartupInput(options.settingsManager,title,placeholder)},notify:(message,type="info")=>{if(options.mode!=="interactive"){let color=type==="error"?source_default.red:type==="warning"?source_default.yellow:source_default.cyan;console.error(color(message))}}}}}var loadSessionPicker=()=>import("./session-picker-EYKCMFQR.js");var loadTraceCommand=()=>import("./trace-command-VM7FBWPE.js");var loadCoordinationBrokerCommand=()=>import("./entry-SRYLSS5P.js");function formatProjectTrustPrompt(cwd){return`Trust project folder?
|
|
253
254
|
${cwd}
|
|
254
255
|
|
|
255
256
|
This allows ${APP_TITLE} to load ${CONFIG_DIR_NAME} settings and resources, install missing project packages, and execute project extensions.`}async function selectProjectTrustOption(cwd,ctx){let options=getProjectTrustOptions(cwd,{includeSessionOnly:!0}),selected=await ctx.ui.select(formatProjectTrustPrompt(cwd),options.map(option=>option.label));return options.find(option=>option.label===selected)}function saveProjectTrustPromptResult(trustStore,result){result.updates.length>0&&trustStore.setMany(
|
|
@@ -518,40 +519,40 @@ resetDisabled],["billing","billing settings",!0],["refresh","Refresh",selected.u
|
|
|
518
519
|
${this.expanded?"hide details":"details"}`)}let footer=[...wrapTextWithAnsi(footerParts.filter(Boolean).join(" \xB7 "),width),...wrapTextWithAnsi([cancel?`${cancel} ${this.view==="accounts"&&this.detailFocus?"accounts":"close"}`:"",...actionHints].filter(Boolean).join(" \xB7 "),width)],height=Math.max(1,Math.floor(this.getHeight())),visibleFooter=footer.slice(0,Math.max(0,height-4));this.viewportHeight=Math.max(1,height-3-visibleFooter.length),this.maxScrollTop=Math.max(0,details.length-this.viewportHeight),
|
|
519
520
|
this.jumpToRecent&&(this.scrollTop=Math.max(0,details.findIndex(row=>row.recent)),this.jumpToRecent=!1),this.scrollTop=Math.min(this.scrollTop,this.maxScrollTop);let accountHeading=`Accounts ${selected?accounts.findIndex(item=>item.id===selected.id)+1:0}/${accounts.length}`,detailHeading=`${this.view==="session"?"Session":"Details"}${this.detailFocus?" (focused)":""} ${this.scrollTop+1}/${this.maxScrollTop+1}`,heading=split?usagePaneRow(theme2,theme2.bold(accountHeading),theme2.bold(detailHeading),
|
|
520
521
|
this.listWidth):theme2.bold(showingList?accountHeading:detailHeading),list=this.view==="accounts"&&(split||showingList)?this.accountRows(split?this.listWidth:width,this.viewportHeight):[],body=[];for(let index=0;index<this.viewportHeight;index++){let row=details[this.scrollTop+index];if(row?.action&&!row.disabled&&(!showingList||split)){let action=row.action;this.regions.push({x:split?this.listWidth+3:0,y:3+index,width:visibleWidth(row.text),activate:()=>this.invokeAction(action)})}let detailText=row?.
|
|
521
|
-
text??"";body.push(split?usagePaneRow(theme2,list[index]??"",detailText,this.listWidth):showingList?list[index]??"":detailText)}return[...header,heading,...body,...visibleFooter.map(line=>theme2.fg("muted",line))].slice(0,height).map(line=>truncateToWidth(process.env.NO_COLOR?stripTerminalSequences(line):line,width,"\u2026"))}};var FETCH_TIMEOUT_MS=1e4
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
522
|
+
text??"";body.push(split?usagePaneRow(theme2,list[index]??"",detailText,this.listWidth):showingList?list[index]??"":detailText)}return[...header,heading,...body,...visibleFooter.map(line=>theme2.fg("muted",line))].slice(0,height).map(line=>truncateToWidth(process.env.NO_COLOR?stripTerminalSequences(line):line,width,"\u2026"))}};var FETCH_TIMEOUT_MS=1e4;async function accountLimits(ctx,providerId,account,options,signal,bypassCache){if(providerId==="anthropic"){let{result,fallback}=await readClaudeUsage(ctx.modelRegistry,account.key,{signal,...bypassCache?{bypassCache}:{}},options.home),live=result?.status==="ok"?result:void 0,resets2=live?.resets,paid=paidUsageLines(live?.credits);if(!fallback&&live){let now=Date.now();return{bars:claudeUsageBars(live.windows,now),lines:[...nextQuotaResetLines(live.windows,now),{label:"\
|
|
523
|
+
source",value:`Anthropic, fetched ${usageAge(now-live.fetchedAt)}`},...paid],resets:resets2}}if(fallback)return{bars:fallback.bars,lines:[{label:"source",value:fallback.status},...fallback.bars.length===0||fallback.reconnect==="required"?[{label:"limits",value:fallback.failure,tone:"error"}]:[],...fallback.reconnect==="required"?[{label:"sign-in",value:"Reconnect required",tone:"warning"}]:[],...fallback.cacheError?[{label:"cached",value:fallback.cacheError,tone:"warning"}]:[],...paid],resets:resets2,
|
|
524
|
+
reconnect:fallback.reconnect}}let codex,resets;try{let result=await ctx.modelRegistry.getCodexUsage({accountKey:account.key,signal});codex=codexUsageBars(result),resets=result?.status==="ok"?result.resets:void 0}catch{codex={error:"Codex usage is unavailable."}}return"error"in codex?{lines:[{label:"limits",value:codex.error,tone:"error"},...paidUsageLines(void 0)],resets}:{bars:codex.bars,lines:codex.lines,resets}}function createUsageExtension(options={}){return pi=>{let closeViews=new Set;pi.on(
|
|
525
|
+
"session_shutdown",()=>{for(let close of closeViews)close()}),pi.registerCommand("usage",{description:"Show session and subscription account usage",handler:async(_args,ctx)=>{if(ctx.mode!=="tui"&&ctx.mode!=="print"&&ctx.mode!=="json"){ctx.ui.notify("/usage is available in interactive, print or JSON mode","warning");return}let started=performance.now(),model=ctx.model,hcode=options.hcode??ctx.hcode,reference=hcode?.environmentId?hcode.account.status(hcode.environmentId):null;if(!model&&!reference){
|
|
526
|
+
ctx.ui.notify("No model selected.","warning");return}let totals=createUsageTotals();for(let{usage}of getSessionUsage(ctx.sessionManager.getEntries()))addUsageToTotals(totals,usage);let providerId=model?.provider??"session",subscriptionBacked=model!==void 0&&ctx.modelRegistry.isUsingOAuth(model)&&ctx.modelRegistry.getProvider(providerId)?.auth.oauth?.isSubscription===!0,header=ctx.sessionManager.getHeader(),overview=buildUsageOverview({providerId,modelId:model?.id??"No model selected",stats:{tokens:{
|
|
527
|
+
input:totals.input,output:totals.output},cost:totals.cost,contextUsage:ctx.getContextUsage()},durationMs:header?.timestamp?Date.now()-new Date(header.timestamp).getTime():null,usageIncomplete:totals.usageIncomplete===!0,subscriptionBacked:subscriptionBacked&&providerId!=="anthropic"&&providerId!=="openai-codex"}),tabs=[{id:"session",label:"Session",overview}],pending=[];for(let[id,name]of[["openai-codex","Codex"],["anthropic","Claude"]])try{let accounts=await ctx.modelRegistry.getUsageAccounts(id,
|
|
528
|
+
{signal:AbortSignal.timeout(FETCH_TIMEOUT_MS)});for(let saved of accounts){let account={...saved,label:usageDisplayText(saved.label)},tab={id:`${id}:${account.key}`,label:account.label,active:account.active,resetAction:id==="anthropic"?"Open Claude usage settings":"Check reset availability",resetDisabled:id==="openai-codex",overview:{providerId:id,modelId:account.label,bars:[],lines:[{label:"limits",value:"Loading\u2026"}],notes:[]}};tabs.push(tab),pending.push({providerId:id,account,tab})}}catch{
|
|
529
|
+
overview.notes.push(`Could not read saved ${name} accounts.`)}subscriptionBacked&&(providerId==="anthropic"||providerId==="openai-codex")&&!pending.some(item=>item.providerId===providerId)&&overview.notes.push("No saved subscription accounts. Run /login.");let controller=new AbortController,hcodeController=new AbortController,unsubscribeHcode,hcodeValid=!0,currentHcode=()=>{if(!hcode||!reference)return!1;let current=hcode.account.status(reference.environmentId);return current!==null&¤t.accountId===
|
|
530
|
+
reference.accountId&¤t.environmentId===reference.environmentId&¤t.generation===reference.generation},hcodeTab=hcode&&reference?{id:"hcode-account",label:hcodeDisplayName(hcode.environment.id),active:providerId==="humain-code-account",overview:{kind:"hcode",providerId:"humain-code-account",modelId:"Monthly usage",bars:[],lines:[{label:"",value:"Loading\u2026"}],notes:[],details:[]}}:void 0;hcodeTab&&tabs.push(hcodeTab);let requestRender=()=>{},invalidateHcode=()=>{!hcodeTab||controller.
|
|
531
|
+
signal.aborted||(hcodeValid=!1,hcodeController.abort(),hcodeTab.overview={kind:"hcode",providerId:"humain-code-account",modelId:"Monthly usage",bars:[],lines:[{label:"",value:"Account changed. Reopen /usage.",tone:"warning"}],notes:[],details:[]},requestRender())};hcode&&hcodeTab&&(unsubscribeHcode=hcode.account.subscribe(()=>{currentHcode()||invalidateHcode()}),currentHcode()||invalidateHcode());let loadHcode=async()=>{if(!hcode||!reference||!hcodeTab||!hcodeValid||controller.signal.aborted)return;
|
|
532
|
+
if(!currentHcode()){invalidateHcode();return}let requestSignal=AbortSignal.any([controller.signal,AbortSignal.timeout(FETCH_TIMEOUT_MS),hcodeController.signal]),previous=hcodeTab.overview;try{let usage=await raceWithAbortSignal(hcode.usage.read(reference,{},requestSignal),requestSignal);if(requestSignal.aborted||!hcodeValid||!currentHcode())return;if(usage.accountId!==reference.accountId||usage.environmentId!==reference.environmentId)throw new Error("Statement identity mismatch.");hcodeTab.overview=
|
|
533
|
+
buildHcodeOverview(usage,hcode.environment.origin)}catch{if(controller.signal.aborted||!hcodeValid||!currentHcode())return;hcodeTab.overview={...previous,lines:[{label:"",value:"Statement unavailable. Try /usage again.",tone:"error"}]}}requestRender()},closeView,outcome="failure";try{if(ctx.mode!=="tui"){await loadHcode();for(let item of pending){let limits=await accountLimits(ctx,item.providerId,item.account,options,AbortSignal.timeout(FETCH_TIMEOUT_MS));item.tab.overview={...item.tab.overview,
|
|
534
|
+
bars:limits.bars??[],lines:[...limits.lines,...weeklyResetLines(limits.resets)]}}let accounts=tabs.slice(1).map(({id,label,active,overview:overview2})=>({id,label,active,overview:overview2})),snapshot=ctx.mode==="json"?JSON.stringify({type:"usage",session:overview,accounts}):sanitizeTerminalText([`Session
|
|
534
535
|
${formatUsageOverview(overview)}`,...accounts.map(account=>`${account.label}${account.active?" (in use)":""}
|
|
535
536
|
${formatUsageOverview(account.overview)}`)].join(`
|
|
536
537
|
|
|
537
538
|
`));writeRawStdout(`${snapshot}
|
|
538
539
|
`),outcome="success";return}await ctx.ui.custom((tui,theme2,keybindings,done)=>{requestRender=()=>tui.requestRender();let prepared=new Map,acting=!1,writesBlocked=!1,confirmAction=async details=>{if(controller.signal.aborted)return!1;let close;try{return await ctx.ui.custom((terminal,colors,bindings,finish)=>{let confirmation=new UsageConfirmationComponent(colors,bindings,details,finish,()=>terminal.requestRender(),()=>terminal.terminal.rows);return close=()=>confirmation.dispose(),controller.signal.
|
|
539
|
-
aborted?confirmation.dispose():controller.signal.addEventListener("abort",close,{once:!0}),confirmation},
|
|
540
|
-
aborted)return;item.tab.usageActions=item.providerId==="anthropic"?{reconnect:!!(limits.reconnect&&getClaudeUsageReconnect(ctx.modelRegistry))}:void 0,item.tab.overview={providerId:item.providerId,modelId:item.account.label,bars:limits.bars??[],lines:[...limits.lines,...weeklyResetLines(limits.resets)],notes:[]}}catch{if(controller.signal.aborted)return;item.tab.usageActions&&(item.tab.usageActions.refreshing=!1),item.tab.overview={...item.tab.overview,
|
|
541
|
-
unavailable. Try again later.",tone:"error"},...weeklyResetLines(void 0),...paidUsageLines(void 0)]}}controller.signal.aborted||(initial&&item.providerId==="openai-codex"&&(item.tab.resetDisabled=writesBlocked),tui.requestRender())},updateResets=(tab,count,expiry)=>{tab.overview.lines=[...tab.overview.lines.filter(line=>line.section!=="resets"),...weeklyResetLines({availableCount:count,expiresAt:expiry})]},handleAction=async(tab,action)=>{let item=pending.
|
|
542
|
-
controller.signal.aborted)return;if(action==="refresh"){if(!tab.usageActions||tab.usageActions.refreshing)return;tab.usageActions.refreshing=!0,queue.push(()=>load(item,!0)),drain();return}if(action==="reconnect"){let reconnect=getClaudeUsageReconnect(ctx.modelRegistry);if(!reconnect||!tab.usageActions?.reconnect||tab.usageActions.refreshing||acting)return;component.dispose();try{await reconnect(item.account.key)}catch{ctx.ui.notify("Could not reconnect
|
|
543
|
-
"billing"||item.providerId==="anthropic"){let url=item.providerId==="anthropic"?"https://claude.ai/settings/usage":"https://chatgpt.com/codex/settings/usage";if(acting)return;acting=!0;try{if(!await confirmAction({title:"Open provider usage settings",body:[`Sign in as: ${item.account.label}`,"The browser may already be signed into a different account. Check the account before buying credits or using a reset.",url],confirmLabel:"Open usage settings"})||
|
|
544
|
-
`Sign in as ${item.account.label} on the provider's usage page: ${url}`,"info"),(options.openUrl??openBrowser)(url)}finally{acting=!1}return}if(acting||writesBlocked||tab.resetDisabled)return;acting=!0;let previous=prepared.get(tab.id),submitted=!1,uncertain=!1,confirmedMessage;tab.resetDisabled=!0,tab.resetAction=previous?"Confirming reset\u2026":"Checking resets\u2026",tui.requestRender();try{if(previous&&(!await confirmAction({title:"Use 1 saved
|
|
545
|
-
"This spends one saved reset, restores eligible Codex limits, and cannot be undone.","It does not switch accounts or buy credits."],confirmLabel:"Use 1 saved reset"})||controller.signal.aborted))return;let fresh=await ctx.modelRegistry.getCodexResetDetails({accountKey:item.account.key,signal:signal()});if(controller.signal.aborted)return;if(fresh?.details.status!=="ok"){prepared.delete(tab.id),tab.overview.notes=["Reset availability could not
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
credit.expiresAt!==void 0&&credit.expiresAt<=Date.now()){prepared.delete(tab.id),tab.overview.notes=["That saved reset expired. No reset was submitted. Check again."];return}submitted=!0;let result=await ctx.modelRegistry.redeemCodexReset({accountKey:item.account.key,expectedAccountId:fresh.accountId,creditId:credit.id,requestId,signal:signal()});if(controller.signal.aborted)return;if(prepared.delete(tab.id),result.status==="
|
|
549
|
-
["Reset outcome is unconfirmed. No automatic retry was sent. Check the official usage page before spending another reset."]:tab.overview.notes=["Reset was not applied. Check the official usage page or try again later."];return}confirmedMessage={reset:"Reset applied.",already_redeemed:"This saved reset was already applied.",nothing_to_reset:"No eligible usage window needs a reset. No reset was used.",no_credit:"The selected
|
|
550
|
-
modelRegistry.getCodexResetDetails({accountKey:item.account.key,signal:signal()});if(controller.signal.aborted)return;refreshed?.details.status==="ok"&&refreshed.accountId===fresh.accountId&&updateResets(tab,refreshed.details.availableCount,refreshed.details.credits[0]?.expiresAt),tab.overview.notes=[confirmedMessage]}catch{uncertain=submitted&&confirmedMessage===void 0,controller.signal.aborted||(tab.overview.
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
. Use the provider's usage settings.","warning")})});closeView=()=>component.dispose(),closeViews.add(closeView);let queue=pending.map(item=>()=>load(item));hcodeTab&&queue.push(loadHcode);let next=0,workers=0;function drain(){for(;workers<3&&next<queue.length&&!controller.signal.aborted;){let job=queue[next++];workers++,job().finally(()=>{workers--,drain()})}}return drain(),component
|
|
554
|
-
ctx.modelRegistry.metadata?.feature("usage",Math.round(performance.now()-started),outcome),outcome!=="success"&&ctx.modelRegistry.metadata?.failure("usage","other",0,outcome)}}})}}var usage_default=createUsageExtension();var builtInExtensions=[{name:"llama.cpp",factory:llamaExtension,builtin:!0},{name:"codemode",factory:codemode_default,replaceable:!0,builtin:!0},{name:"tool-search",factory:tool_search_default,replaceable:!0,builtin:!0},{name:"mcp",factory:mcp_default,replaceable:!0,builtin:!0},{name:"usage",factory:usage_default,replaceable:!0,builtin:!0}];function createAutoSessionNamerFactory(settingsManager){return{name:"auto-session-namer",factory:pi=>{registerAutoSessionNamer(pi,()=>settingsManager)},hidden:!0}}
|
|
540
|
+
aborted?confirmation.dispose():controller.signal.addEventListener("abort",close,{once:!0}),fullscreenSurface(confirmation,()=>terminal.terminal.rows)},FULLSCREEN_OVERLAY)}finally{close&&controller.signal.removeEventListener("abort",close)}},signal=()=>AbortSignal.any([controller.signal,AbortSignal.timeout(FETCH_TIMEOUT_MS)]),load=async(item,bypassCache)=>{let initial=item.tab.overview.lines.some(line=>line.value==="Loading\u2026");try{let limits=await accountLimits(ctx,item.providerId,item.account,
|
|
541
|
+
options,signal(),bypassCache);if(controller.signal.aborted)return;item.tab.usageActions=item.providerId==="anthropic"?{reconnect:!!(limits.reconnect&&getClaudeUsageReconnect(ctx.modelRegistry))}:void 0,item.tab.overview={providerId:item.providerId,modelId:item.account.label,bars:limits.bars??[],lines:[...limits.lines,...weeklyResetLines(limits.resets)],notes:[]}}catch{if(controller.signal.aborted)return;item.tab.usageActions&&(item.tab.usageActions.refreshing=!1),item.tab.overview={...item.tab.overview,
|
|
542
|
+
bars:[],lines:[{label:"limits",value:"Usage unavailable. Try again later.",tone:"error"},...weeklyResetLines(void 0),...paidUsageLines(void 0)]}}controller.signal.aborted||(initial&&item.providerId==="openai-codex"&&(item.tab.resetDisabled=writesBlocked),tui.requestRender())},updateResets=(tab,count,expiry)=>{tab.overview.lines=[...tab.overview.lines.filter(line=>line.section!=="resets"),...weeklyResetLines({availableCount:count,expiresAt:expiry})]},handleAction=async(tab,action)=>{let item=pending.
|
|
543
|
+
find(item2=>item2.tab===tab);if(!item||controller.signal.aborted)return;if(action==="refresh"){if(!tab.usageActions||tab.usageActions.refreshing)return;tab.usageActions.refreshing=!0,queue.push(()=>load(item,!0)),drain();return}if(action==="reconnect"){let reconnect=getClaudeUsageReconnect(ctx.modelRegistry);if(!reconnect||!tab.usageActions?.reconnect||tab.usageActions.refreshing||acting)return;component.dispose();try{await reconnect(item.account.key)}catch{ctx.ui.notify("Could not reconnect thi\
|
|
544
|
+
s Claude account.","warning")}return}if(action==="billing"||item.providerId==="anthropic"){let url=item.providerId==="anthropic"?"https://claude.ai/settings/usage":"https://chatgpt.com/codex/settings/usage";if(acting)return;acting=!0;try{if(!await confirmAction({title:"Open provider usage settings",body:[`Sign in as: ${item.account.label}`,"The browser may already be signed into a different account. Check the account before buying credits or using a reset.",url],confirmLabel:"Open usage settings"})||
|
|
545
|
+
controller.signal.aborted)return;ctx.ui.notify(`Sign in as ${item.account.label} on the provider's usage page: ${url}`,"info"),(options.openUrl??openBrowser)(url)}finally{acting=!1}return}if(acting||writesBlocked||tab.resetDisabled)return;acting=!0;let previous=prepared.get(tab.id),submitted=!1,uncertain=!1,confirmedMessage;tab.resetDisabled=!0,tab.resetAction=previous?"Confirming reset\u2026":"Checking resets\u2026",tui.requestRender();try{if(previous&&(!await confirmAction({title:"Use 1 saved \
|
|
546
|
+
Codex reset?",body:[`Account: ${item.account.label}`,"This spends one saved reset, restores eligible Codex limits, and cannot be undone.","It does not switch accounts or buy credits."],confirmLabel:"Use 1 saved reset"})||controller.signal.aborted))return;let fresh=await ctx.modelRegistry.getCodexResetDetails({accountKey:item.account.key,signal:signal()});if(controller.signal.aborted)return;if(fresh?.details.status!=="ok"){prepared.delete(tab.id),tab.overview.notes=["Reset availability could not \
|
|
547
|
+
be verified. Open billing settings to check the official usage page."];return}let details=fresh.details,credit=previous?details.credits.find(credit2=>credit2.id===previous.credit.id):details.credits[0];if(updateResets(tab,details.availableCount,credit?.expiresAt),!credit||details.availableCount===0||previous&&previous.accountId!==fresh.accountId){prepared.delete(tab.id),tab.overview.notes=[previous?"Reset availability changed. No reset was submitted. Check again.":"No available saved reset was r\
|
|
548
|
+
eported. Check the official usage page for other options."];return}if(prepared.set(tab.id,{accountId:fresh.accountId,credit}),!previous){tab.overview.notes=["A saved reset is available to request. Codex determines which usage windows can be reset."];return}let digest=createHash3("sha256").update(JSON.stringify(["humain-codex-reset",fresh.accountId,credit.id])).digest("hex"),requestId=`${digest.slice(0,8)}-${digest.slice(8,12)}-5${digest.slice(13,16)}-8${digest.slice(17,20)}-${digest.slice(20,32)}`;
|
|
549
|
+
if(tab.resetAction="Reset in progress\u2026",tui.requestRender(),credit.expiresAt!==void 0&&credit.expiresAt<=Date.now()){prepared.delete(tab.id),tab.overview.notes=["That saved reset expired. No reset was submitted. Check again."];return}submitted=!0;let result=await ctx.modelRegistry.redeemCodexReset({accountKey:item.account.key,expectedAccountId:fresh.accountId,creditId:credit.id,requestId,signal:signal()});if(controller.signal.aborted)return;if(prepared.delete(tab.id),result.status==="unavai\
|
|
550
|
+
lable"){uncertain=result.uncertain===!0,uncertain?tab.overview.notes=["Reset outcome is unconfirmed. No automatic retry was sent. Check the official usage page before spending another reset."]:tab.overview.notes=["Reset was not applied. Check the official usage page or try again later."];return}confirmedMessage={reset:"Reset applied.",already_redeemed:"This saved reset was already applied.",nothing_to_reset:"No eligible usage window needs a reset. No reset was used.",no_credit:"The selected save\
|
|
551
|
+
d reset is no longer available."}[result.outcome],await load(item);let refreshed=await ctx.modelRegistry.getCodexResetDetails({accountKey:item.account.key,signal:signal()});if(controller.signal.aborted)return;refreshed?.details.status==="ok"&&refreshed.accountId===fresh.accountId&&updateResets(tab,refreshed.details.availableCount,refreshed.details.credits[0]?.expiresAt),tab.overview.notes=[confirmedMessage]}catch{uncertain=submitted&&confirmedMessage===void 0,controller.signal.aborted||(tab.overview.
|
|
552
|
+
notes=confirmedMessage?[confirmedMessage,"Usage refresh is unavailable. Check the official usage page."]:[uncertain?"Reset outcome is unconfirmed. No automatic retry was sent. Check the official usage page before spending another reset.":"Reset availability could not be checked. Try again later or open the official usage page."])}finally{if(acting=!1,!controller.signal.aborted){if(tab.resetAction=prepared.has(tab.id)?"Use 1 saved reset":"Check reset availability",uncertain){writesBlocked=!0,prepared.
|
|
553
|
+
clear();for(let entry of pending)entry.providerId==="openai-codex"&&(entry.tab.resetDisabled=!0,entry.tab!==tab&&(entry.tab.overview.notes=["Reset actions are paused because another reset outcome is unconfirmed. Check the official usage page before reopening /usage."]))}else tab.resetDisabled=writesBlocked;tui.requestRender()}}},component=new UsagePopupComponent(theme2,keybindings,tabs,()=>{controller.abort(),done()},()=>tui.requestRender(),()=>tui.terminal.rows,(tab,action)=>{handleAction(tab,action).
|
|
554
|
+
catch(()=>{controller.signal.aborted||ctx.ui.notify("Provider page could not be opened. Use the provider's usage settings.","warning")})});closeView=()=>component.dispose(),closeViews.add(closeView);let queue=pending.map(item=>()=>load(item));hcodeTab&&queue.push(loadHcode);let next=0,workers=0;function drain(){for(;workers<3&&next<queue.length&&!controller.signal.aborted;){let job=queue[next++];workers++,job().finally(()=>{workers--,drain()})}}return drain(),fullscreenSurface(component,()=>tui.
|
|
555
|
+
terminal.rows)},FULLSCREEN_OVERLAY),outcome="success"}finally{controller.abort(),unsubscribeHcode?.(),closeView&&closeViews.delete(closeView),ctx.modelRegistry.metadata?.feature("usage",Math.round(performance.now()-started),outcome),outcome!=="success"&&ctx.modelRegistry.metadata?.failure("usage","other",0,outcome)}}})}}var usage_default=createUsageExtension();var builtInExtensions=[{name:"llama.cpp",factory:llamaExtension,builtin:!0},{name:"codemode",factory:codemode_default,replaceable:!0,builtin:!0},{name:"tool-search",factory:tool_search_default,replaceable:!0,builtin:!0},{name:"mcp",factory:mcp_default,replaceable:!0,builtin:!0},{name:"usage",factory:usage_default,replaceable:!0,builtin:!0}];function createAutoSessionNamerFactory(settingsManager){return{name:"auto-session-namer",factory:pi=>{registerAutoSessionNamer(pi,()=>settingsManager)},hidden:!0}}
|
|
555
556
|
function createCoordinationFactory(settingsManager,flags){return{name:"coordination",factory:createCoordinationExtension({...flags,settingsManager}),builtin:!0}}function createAgentMonitorFactory(settingsManager,flags){return{name:"agent-monitor",factory:createAgentMonitorExtension({...flags,settingsManager}),builtin:!0}}var loadMcpCommand=()=>import("./cli-6DJO467D.js");var SINGLE_SHOT_OPTIONS=new Set(["messages","fileArgs","unknownFlags","diagnostics","mode","print","model","provider","environment","cwd","noSession","noExtensions","noMcp","noCoordinate","noSkills","noPromptTemplates","noThemes","noContextFiles","noTools","tools","excludeTools","literalPrompt","thinking","timeLimitSeconds"]);async function runHcodeSandbox(args,bootstrap,resolveCwd){let parsed=parseArgs(args);if(process.versions.bun||process.env.PI_OFFLINE||process.env.HUMAIN_TERMINAL_TRACE_BOOTSTRAP_FD!==
|
|
556
557
|
void 0||!(parsed.mode==="json"||(parsed.mode===void 0||parsed.mode==="text")&&parsed.print)||!parsed.model||parsed.provider!==void 0&&parsed.provider!==HCODE_PROVIDER||parsed.environment!==void 0&&parsed.environment!==bootstrap.environment.id||parsed.unknownFlags.size||parsed.diagnostics.length||parsed.fileArgs.length||parsed.tools?.some(tool=>tool==="subagent"||tool==="+subagent")||parsed.messages.length!==1||parsed.messages.some(message=>/^\s*\/flow(?:\s|$)/i.test(message))||Object.keys(parsed).
|
|
557
558
|
some(key=>!SINGLE_SHOT_OPTIONS.has(key)))return console.error("Forge run inference requires a supported Node single-shot invocation and an explicit model. Flow and RPC are not supported."),1;let refuse=()=>{throw new Error("Forge run inference cannot replace its session.")},facade=bootstrap.open(),modelRuntime,runtime;takeOverStdout();try{let cwd=resolveCwd(parsed,process.env,process.cwd()),agentDir=getAgentDir();modelRuntime=await ModelRuntime.createForHcodeRun(facade);let discovery=await modelRuntime.
|
|
@@ -581,7 +582,7 @@ console.log(source_default.green("Migrated managed binaries tools/ \u2192 bin/")
|
|
|
581
582
|
length>0&&warnings.push(`${label} tools/ directory contains custom tools. Custom tools have been merged into extensions.`)}catch{}return warnings}function migrateExtensionSystem(cwd){let agentDir=getAgentDir(),projectDir=join6(cwd,CONFIG_DIR_NAME);return migrateCommandsToPrompts(agentDir,"Global"),migrateCommandsToPrompts(projectDir,"Project"),[...checkDeprecatedExtensionDirs(agentDir,"Global"),...checkDeprecatedExtensionDirs(projectDir,"Project")]}async function showDeprecationWarnings(warnings){
|
|
582
583
|
if(warnings.length!==0){for(let warning of warnings)console.log(source_default.yellow(`Warning: ${warning}`));console.log(source_default.yellow(`
|
|
583
584
|
Move your extensions to the extensions/ directory.`)),console.log(source_default.yellow(`Migration guide: ${MIGRATION_GUIDE_URL}`)),console.log(source_default.yellow(`Documentation: ${EXTENSIONS_DOC_URL}`)),console.log(source_default.dim(`
|
|
584
|
-
Press any key to continue...`)),await new Promise(resolve6=>{process.stdin.setRawMode?.(!0),process.stdin.resume(),process.stdin.once("data",()=>{process.stdin.setRawMode?.(!1),process.stdin.pause(),resolve6()})}),console.log()}}function runMigrations(cwd){let migratedAuthProviders=migrateAuthToAuthJson();migrateSessionsFromAgentRoot(),migrateToolsToBin(),migrateKeybindingsConfigFile();let deprecationWarnings=migrateExtensionSystem(cwd);return{migratedAuthProviders,deprecationWarnings}}var loadInteractiveMode=()=>import("./interactive-mode-
|
|
585
|
+
Press any key to continue...`)),await new Promise(resolve6=>{process.stdin.setRawMode?.(!0),process.stdin.resume(),process.stdin.once("data",()=>{process.stdin.setRawMode?.(!1),process.stdin.pause(),resolve6()})}),console.log()}}function runMigrations(cwd){let migratedAuthProviders=migrateAuthToAuthJson();migrateSessionsFromAgentRoot(),migrateToolsToBin(),migrateKeybindingsConfigFile();let deprecationWarnings=migrateExtensionSystem(cwd);return{migratedAuthProviders,deprecationWarnings}}var loadInteractiveMode=()=>import("./interactive-mode-SDUO5OLD.js");function colorValue(description){return typebox_exports.Union([typebox_exports.String({description:"Hex color (#RGB or #RRGGBB), OKLCH or OKHSL color, variable reference, or empty string for terminal default"}),typebox_exports.Integer({minimum:0,maximum:255,description:"256-color palette index (0-255)"})],description?{description}:{})}var ColorValueSchema=colorValue();function themeTokenProperties(tokens2){let properties={};for(let[name,descriptor]of Object.entries(tokens2)){let schema=colorValue(
|
|
585
586
|
descriptor.description);properties[name]=descriptor.fallback===void 0?schema:typebox_exports.Optional(schema)}return properties}var ThemeColorsSchema=typebox_exports.Unsafe(typebox_exports.Object(themeTokenProperties(THEME_TOKENS),{description:"Theme color definitions (scrollbar, thinkingMax, and search highlight colors are optional and use compatible fallbacks)",additionalProperties:!1})),ThemeJsonSchema=typebox_exports.Object({$schema:typebox_exports.Optional(typebox_exports.String({description:"\
|
|
586
587
|
JSON schema reference"})),name:typebox_exports.String({pattern:"^[^/]+$",description:"Theme name. Must not contain '/' because it is reserved for automatic light/dark theme settings."}),appearance:typebox_exports.Optional(typebox_exports.Union([typebox_exports.Literal("dark"),typebox_exports.Literal("light")],{description:"Background the theme is designed for. Detected from the theme colors when omitted."})),vars:typebox_exports.Optional(typebox_exports.Record(typebox_exports.String(),ColorValueSchema,
|
|
587
588
|
{description:"Reusable color variables"})),colors:ThemeColorsSchema,export:typebox_exports.Optional(typebox_exports.Object({pageBg:typebox_exports.Optional(colorValue("Page background color")),cardBg:typebox_exports.Optional(colorValue("Card/container background color")),infoBg:typebox_exports.Optional(colorValue("Info sections background (system prompt, notices)"))},{description:"Optional colors for HTML export (defaults derived from userMessageBg if not specified)",additionalProperties:!1}))},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{theme}from"./chunk-
|
|
2
|
+
import{theme}from"./chunk-E4VUW4RI.js";import{Key,KeybindingsManager,TUI_KEYBINDINGS}from"./chunk-M5TVWJ5T.js";import{Compile}from"./chunk-VCMXBP5S.js";import{typebox_exports}from"./chunk-VEGJT52D.js";import{getAgentDir,stripBom}from"./chunk-VFLVWPLZ.js";function areExperimentalFeaturesEnabled(){return process.env.PI_EXPERIMENTAL==="1"}import{existsSync,readFileSync}from"fs";import{join}from"path";var modifiers=["ctrl","shift","alt","super"],baseKeyPattern=`(?:[a-z0-9]|${Object.values(Key).flatMap(value=>typeof value=="string"?[value.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")]:[]).join("|")})`,duplicateModifierPattern=modifiers.map(modifier=>`${modifier}\\+.*${modifier}\\+`).join("|"),KeyIdSchema=typebox_exports.Unsafe(typebox_exports.String({pattern:`^(?!.*(?:${duplicateModifierPattern}))(?:(?:${modifiers.join("|")})\\+){0,4}${baseKeyPattern}$`,description:"Key identifier with optional ctrl, \
|
|
3
3
|
shift, alt, or super modifiers."}));function keybindingValueSchema(options){return typebox_exports.Union([KeyIdSchema,typebox_exports.Array(KeyIdSchema)],options)}var KeybindingValueSchema=keybindingValueSchema();function useWindowsKeybindings(platform=process.platform,env=process.env){return platform==="win32"||platform==="linux"&&!!(env.WSL_DISTRO_NAME||env.WSL_INTEROP)}var windowsKeybindings=useWindowsKeybindings(),APP_KEYBINDINGS={"app.interrupt":{defaultKeys:"escape",description:"Cancel or abort"},"app.clear":{defaultKeys:"ctrl+c",description:"Clear editor"},"app.exit":{defaultKeys:"ctrl+d",description:"Exit when editor is empty"},"app.suspend":{defaultKeys:process.platform==="win32"?[]:"ctrl+z",description:"\
|
|
4
4
|
Suspend to background"},"app.thinking.cycle":{defaultKeys:"shift+tab",description:"Cycle thinking level"},"app.thinking.save":{defaultKeys:"ctrl+s",description:"Save thinking level"},"app.model.cycleForward":{defaultKeys:"ctrl+p",description:"Cycle to next model"},"app.model.cycleBackward":{defaultKeys:windowsKeybindings?"alt+p":"shift+ctrl+p",description:"Cycle to previous model"},"app.model.select":{defaultKeys:"ctrl+l",description:"Open model selector"},"app.tools.expand":{defaultKeys:"ctrl+o",
|
|
5
5
|
description:"Toggle tool output"},"app.select.upAlternate":{defaultKeys:"k",description:"Alternate up key in Trust and Extension selectors"},"app.select.downAlternate":{defaultKeys:"j",description:"Alternate down key in Trust and Extension selectors"},"app.usage.nextTab":{defaultKeys:["tab","right"],description:"Next usage account"},"app.usage.previousTab":{defaultKeys:["shift+tab","left"],description:"Previous usage account"},"app.usage.showAccounts":{defaultKeys:"a",description:"Show subscript\
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{DynamicBorder}from"./chunk-
|
|
2
|
+
import{DynamicBorder}from"./chunk-UZOIHLNU.js";import{DEFAULT_THEME_NAME,SYSTEM_THEME_NAME,getTerminalTheme,initTheme,keyHint,markTerminalColorsPending,parseAutoThemeSetting,resolveThemeSetting,selectNavigationHint,setTerminalColorScheme,setTerminalColors,setTheme,setThemeInstance,theme}from"./chunk-E4VUW4RI.js";import{Container,Input,Spacer,Text,getKeybindings}from"./chunk-M5TVWJ5T.js";var CountdownTimer=class{intervalId;remainingSeconds;tui;onTick;onExpire;constructor(timeoutMs,tui,onTick,onExpire){this.tui=tui,this.onTick=onTick,this.onExpire=onExpire,this.remainingSeconds=Math.ceil(timeoutMs/1e3),this.onTick(this.remainingSeconds),this.intervalId=setInterval(()=>{this.remainingSeconds--,this.onTick(this.remainingSeconds),this.tui?.requestRender(),this.remainingSeconds<=0&&(this.dispose(),this.onExpire())},1e3)}dispose(){this.intervalId&&(clearInterval(this.intervalId),this.
|
|
3
3
|
intervalId=void 0)}};var ExtensionInputComponent=class extends Container{input;onSubmitCallback;onCancelCallback;titleText;baseTitle;countdown;_focused=!1;get focused(){return this._focused}set focused(value){this._focused=value,this.input.focused=value}constructor(title,_placeholder,onSubmit,onCancel,opts){super(),this.onSubmitCallback=onSubmit,this.onCancelCallback=onCancel,this.baseTitle=title,this.addChild(new DynamicBorder),this.addChild(new Spacer(1)),this.titleText=new Text(theme.fg("accent",title),1,0),this.
|
|
4
4
|
addChild(this.titleText),opts?.description&&(this.addChild(new Spacer(1)),this.addChild(new Text(theme.fg("text",opts.description),1,0))),this.addChild(new Spacer(1)),opts?.timeout&&opts.timeout>0&&opts.tui&&(this.countdown=new CountdownTimer(opts.timeout,opts.tui,s=>this.titleText.setText(theme.fg("accent",`${this.baseTitle} (${s}s)`)),()=>this.onCancelCallback())),this.input=new Input,opts?.initialValue&&this.input.setValue(opts.initialValue),this.addChild(this.input),this.addChild(new Spacer(
|
|
5
5
|
1)),this.addChild(new Text(`${keyHint("tui.select.confirm","submit")} ${keyHint("tui.select.cancel","cancel")}`,1,0)),this.addChild(new Spacer(1)),this.addChild(new DynamicBorder)}handleInput(keyData){let kb=getKeybindings();kb.matches(keyData,"tui.select.confirm")||keyData===`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
2
|
import{anthropicMessagesApi,azureOpenAIResponsesApi,bedrockConverseStreamApi,complete,completeSimple,generateImages,generateImagesOpenRouter,getApiProvider,getApiProviders,getImageModel,getImageModels,getImageProviders,getImagesApiProvider,getModel,getModels,getProviders,googleGenerativeAIApi,googleVertexApi,mistralConversationsApi,openAICodexResponsesApi,openAICompletionsApi,openAIResponsesApi,piMessagesApi,registerApiProvider,registerBuiltInApiProviders,registerBuiltInImagesApiProviders,registerFauxProvider,
|
|
3
|
-
registerImagesApiProvider,resetApiProviders,setBedrockProviderLoader,setBedrockProviderModule,stream,streamAnthropic,streamAzureOpenAIResponses,streamGoogle,streamGoogleVertex,streamMistral,streamOpenAICodexResponses,streamOpenAICompletions,streamOpenAIResponses,streamSimple,streamSimpleAnthropic,streamSimpleAzureOpenAIResponses,streamSimpleGoogle,streamSimpleGoogleVertex,streamSimpleMistral,streamSimpleOpenAICodexResponses,streamSimpleOpenAICompletions,streamSimpleOpenAIResponses,unregisterApiProviders}from"./chunk-
|
|
3
|
+
registerImagesApiProvider,resetApiProviders,setBedrockProviderLoader,setBedrockProviderModule,stream,streamAnthropic,streamAzureOpenAIResponses,streamGoogle,streamGoogleVertex,streamMistral,streamOpenAICodexResponses,streamOpenAICompletions,streamOpenAIResponses,streamSimple,streamSimpleAnthropic,streamSimpleAzureOpenAIResponses,streamSimpleGoogle,streamSimpleGoogleVertex,streamSimpleMistral,streamSimpleOpenAICodexResponses,streamSimpleOpenAICompletions,streamSimpleOpenAIResponses,unregisterApiProviders}from"./chunk-H7UPU2SH.js";
|
|
4
4
|
import{ANTHROPIC_API_KEY_ENV,ANTHROPIC_AUTH_TOKEN_ENV,ANTHROPIC_FEDERATION_RULE_ID_ENV,ANTHROPIC_IDENTITY_TOKEN_FILE_ENV,ANTHROPIC_OAUTH_TOKEN_ENV,ANTHROPIC_ORGANIZATION_ID_ENV,ANTHROPIC_SERVICE_ACCOUNT_ID_ENV,ANTHROPIC_WORKSPACE_ID_ENV,findEnvKeys,getEnvApiKey}from"./chunk-7H2WNBX7.js";import"./chunk-CIA6V3BP.js";import{AssistantMessageFrameEncoder,CACHE_WARMING_IDLE_CONTINUATION_PROBABILITY,CACHE_WARMING_MAX_AGE_MS,CACHE_WARMING_MAX_IDLE_AGE_MS,CACHE_WARMING_MINIMUM_EXPECTED_SAVINGS,
|
|
5
5
|
OAuthRefreshRejectedError,StringEnum,attestProviderRequest,createFauxCore,envApiKeyAuth,evaluateCacheWarming,fauxAssistantMessage,fauxProvider,fauxText,fauxThinking,fauxToolCall,getCacheWarmingDelayMs,getCacheWarmingRequestOptions,getOverflowPatterns,getPromptCacheTtlMs,isCacheWarmingReplayable,isContextOverflow,isRecoverableLength,lazyOAuth,normalizeAdmissionUsage,reduceAssistantMessageFrames,validateToolArguments,validateToolCall}from"./chunk-MIAXMK5F.js";import{DEFAULT_MAX_AGENT_RETRY_DELAY_MS,
|
|
6
6
|
getAssistantRetryDelayMs,isRetryableAssistantError,retryAssistantCall,retryDelayMs}from"./chunk-YSWDFV2L.js";import{getOpenAICodexTokenIdentity}from"./chunk-ZTG5OKI7.js";import{cleanupSessionResources,registerSessionResourceCleanup}from"./chunk-ZG74NES2.js";import{AI_TELEMETRY_SCHEMA,DEFAULT_NO_PROGRESS_TIMEOUT_MS,InMemoryCredentialStore,InMemoryModelsStore,ModelsError,NoProgressTimeoutError,calculateCost,clampThinkingLevel,collapseSystemMessages,commitLoginCredential,createInitialSystemMessage,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
2
|
import{ChildUsageProjection,DOCUMENTED_VERIFICATION,NO_RECON_WORKERS,REVIEW_VERDICT_MISSING,SCOPE_GROWTH_UNAVAILABLE,buildRepairEvidence,buildRepairTask,buildReportContent,candidateTreeIdentityResult,canonicalOrigin,changedFilesSinceRunStart,classifyRunOutcome,collectLeadAttempts,complexityNeedsArchitect,continuedTask,createRepairRoundBounds,createVerificationRound,decideRepair,discoverChecks,dispatchCosts,dispatchRepairTask,environmentBlocked,externalChangeFiles,fmtElapsed,formatLeadAttemptLines,
|
|
3
3
|
fsReader,gitHead,goalForbidsInstalls,isLeadCapability,isProviderStall,isTransientLeadFailure,isTransientProviderError,isWaitStall,leadTaskIdFor,logicalTaskIdFor,looksLikeFilePath,manifestChanges,normalizeDiagnostics,parseLeadFilesChanged,parseLeadStatus,persistedRepairEvidence,pickModel,prepareExecutionCandidate,qaScopeEvidenceFor,quoteReferenceText,recoveryTaskContext,recoveryTopology,recoveryTrace,redactPaths,redactSecrets,repoRootGuardrail,resolveVerificationPlan,reviewVerdict,runExecutionLiveQa,
|
|
4
|
-
runFlatVerification,runVerification,settleExecution,substantiveResult,telemetryTaskId,unavailableCheckTolerated,waitForPendingChecks,writeCheckFailureDiagnostic}from"./chunk-
|
|
4
|
+
runFlatVerification,runVerification,settleExecution,substantiveResult,telemetryTaskId,unavailableCheckTolerated,waitForPendingChecks,writeCheckFailureDiagnostic}from"./chunk-H2B3WLIM.js";import{CI_ID_RE,METHOD,extractCiRefs,getFlowAgentsDir,isQuotaError,redactCheckArgv,redactCredentials,rereviewFloor,sanitizeControlChars,sanitizeRepairFeedback,shortName,summarizeStderr}from"./chunk-HQMUDHC3.js";import"./chunk-M5TVWJ5T.js";import"./chunk-L4J7SMJB.js";import"./chunk-PVNXN2TC.js";
|
|
5
5
|
import"./chunk-7OZNMWAJ.js";import"./chunk-VCMXBP5S.js";import"./chunk-VEGJT52D.js";import"./chunk-JXWJOIH4.js";var MAX_PENDING_CHECKS=20,MAX_LINE_CHARS=500,PENDING_CHECKS_HEADING_LINE_RE=/^##\s+pending external checks\s*$/i,PENDING_CHECKS_SECTION_END_RE=/^##\s|^[\s>*_`-]*STATUS[*_`]*\s*:/i,MAX_SECTION_SCAN_CHARS=256*1024;function extractPendingChecksSection(reportText){let lines=(reportText.length>MAX_SECTION_SCAN_CHARS?reportText.slice(0,MAX_SECTION_SCAN_CHARS):reportText).split(/\r?\n/),startIdx=-1;for(let i=0;i<lines.length;i++)if(PENDING_CHECKS_HEADING_LINE_RE.test(lines[i])){startIdx=i;break}if(startIdx===
|
|
6
6
|
-1)return;let sectionLines=[];for(let i=startIdx+1;i<lines.length&&!PENDING_CHECKS_SECTION_END_RE.test(lines[i]);i++)sectionLines.push(lines[i]);return sectionLines.join(`
|
|
7
7
|
`)}var NONE_SECTION_RE=/^(?:none|n\/a|nothing)\.?$/i,NONE_WITH_EXPLANATION_RE=/^(?:none|n\/a|nothing)(?:\s*[.,:;\u2014\u2013-](?:\s*\S.*)?)?$/i,STRONG_REF_RE=/https?:\/\/|[!#]\d|\d{5,}|(?<![a-z0-9])(?:mr|pr)[\s!#]*\d|(?<![a-z0-9-])-p[\s=]*\d|(?<![a-z0-9])--pipeline-id[\s=]*\d/i,PROVIDER_WORD_RE=/(?<![a-z0-9])(?:gitlab|github|glab|gh|pipelines?|runs?|workflows?)(?![a-z0-9])/i,UNRESOLVED_CHECK_RE=/\b(?:pending|fail(?:ed|ing|ure)?|unknown|unverified|running|queued|awaiting|waiting|blocked|cancelled|canceled|skipped|timed[ _-]out|action_required|startup_failure|neutral|unsuccessful|error(?:ed)?|aborted|stale|expired|incomplete|stopped)\b/i,
|
|
@@ -7,13 +7,13 @@ fitBoardLine,flowActivityFor,flowEventModelRef,flowSha256Hasher,fmtElapsed,forma
|
|
|
7
7
|
loadApprovedInputs,loadFrozenAdmission,logicalTaskIdFor,matchesAny,nodeModulesAbsent,nonVerifiedQaOutcome,observationGuard,observeTree,openFlowProfileEditor,openJsonlLedgerSink,openRunTelemetry,outcomeFromCauses,parseAdmissionGoal,parseArgs,parseFilesChanged,parseFlowEventV1,parseHumainTerminalSession,parseLeadStatus,parseModelFacts,parseSentinelChildEnv,parseTriageResponse,pickFlowModels,pickModel,plainTheme,planRecovery,policyIdFor,preflightLiveQaAcceptance,preflightRole,prepareExecutionCandidate,
|
|
8
8
|
prepareRecovery,priceFor,probeRecoveryOwner,providerText,pruneModelSelection,qaScopeEvidenceFor,readCheckoutBaseline,readCompletedRecoveryResult,readExecutionSnapshot,readRegularBounded,recoveryBindingDescription,recoveryChildEvidence,recoveryDispatcher,recoveryExclusions,recoveryFileKeyOk,recoveryHeadBlocker,recoveryLineageQuery,recoveryTaskContext,recoveryTopology,recoveryTrace,redactPaths,redactSecrets,refToString,renderFlowProfileError,requestIdFor,residencyRefusals,resolveAdapter,resolveAdmissionSource,
|
|
9
9
|
resolveCandidates,resolveModelSpec,resolveProfile,reviewVerdict,roleForAgentName,runChecks,runChecksParallel,runDir,runExecutionLiveQa,runFlatVerification,runFlowProfileCommand,runSingleRepair,safeCheckNames,safeUi,sanitizeForDisplay,sanitizedGitEnv,selectionProblem,selectionSourceLines,sessionToolSupport,setBackups,setDeadlineTimer,setEffort,setImplementerCodemodeSetting,setPrimary,settleExecution,sizeLead,sourceCustody,spawnedProcessIdentity,spinnerFrame,styleSegments,substantiveResult,telemetryFailureClass,
|
|
10
|
-
telemetryTaskId,toRequestUsage,topLevelOf,totalDispatchCost,traceFailure,traceOutcome,truncateMarked,tryLaunch,unappliedGoalFlagError,unavailableCheckTolerated,usableModels,usageRowsOrUnknown,usageText,verificationForSettlement,verifyConcurrency,withProfileDigest,writeAdmissionAtomic,writeApprovedInputsFile}from"./chunk-
|
|
10
|
+
telemetryTaskId,toRequestUsage,topLevelOf,totalDispatchCost,traceFailure,traceOutcome,truncateMarked,tryLaunch,unappliedGoalFlagError,unavailableCheckTolerated,usableModels,usageRowsOrUnknown,usageText,verificationForSettlement,verifyConcurrency,withProfileDigest,writeAdmissionAtomic,writeApprovedInputsFile}from"./chunk-H2B3WLIM.js";import{BoundedCapture,ChildEventAccumulator,DEFAULT_PROVIDER_PREFERENCE,FLOW_APPROVED_INPUTS_FILE,LINEAGE_ENV,MAX_CHILD_STDERR_DISK_BYTES,METHOD,RESERVED_PROFILE_NAMES,
|
|
11
11
|
THINKING_LEVELS,awaitReaped,billingRouteFor,buildAliasTable,buildChildArgs,buildChildEnv,capChildStderrFile,classifyDispatchOutcome,classifyModelName,classifyTimeout,dispatchAdmissionBlocked,dispatchChildKillGraceMs,dispatchCustody,dispatchCustodyDiagnostic,emptyProfilesFile,formatAdapterTable,getFlowAgentsDir,getFlowAssetPath,getFlowPackageDir,installDispatchReaper,isQuotaError,isThinkingLevel,killProcessTree,lineageMarker,listShortcuts,liveDispatchPids,parseProfilesFile,personaCanMutateFor,readStderrFileBounded,
|
|
12
|
-
redactCheckArgv,redactCredentials,redactUserText,registerDispatchPid,registeredDispatchIdentities,resolveAlias,resolveExactAlias,rpcPromptLine,rpcSteerLine,sanitizeControlChars,sanitizeRepairFeedback,scanEvents,scanLineage,shortName,snapshotDescendants,startOwnerSentinel,summarizeStderr,tierIndex,tierOf,trimEventForLog,userLayerWarnings}from"./chunk-HQMUDHC3.js";import"./chunk-
|
|
13
|
-
import"./chunk-
|
|
14
|
-
discoverAgents,getFlowChildLaunchHost,getFlowControlHost,getFlowTraceProducer,renderTaskWithContext}from"./chunk-
|
|
15
|
-
import"./chunk-
|
|
16
|
-
|
|
12
|
+
redactCheckArgv,redactCredentials,redactUserText,registerDispatchPid,registeredDispatchIdentities,resolveAlias,resolveExactAlias,rpcPromptLine,rpcSteerLine,sanitizeControlChars,sanitizeRepairFeedback,scanEvents,scanLineage,shortName,snapshotDescendants,startOwnerSentinel,summarizeStderr,tierIndex,tierOf,trimEventForLog,userLayerWarnings}from"./chunk-HQMUDHC3.js";import"./chunk-EFY2QPVP.js";import{FLOW_ACCOUNT_PERSISTENCE_NOTICE,getFlowAccountsHost}from"./chunk-G2QMON4O.js";import"./chunk-BRSLXHED.js";
|
|
13
|
+
import"./chunk-JKX5EGOT.js";import"./chunk-JX6YIPNK.js";import"./chunk-ZSWU5KKA.js";import{FLOW_MESSAGE_MAX_LENGTH,parseFlowControlCommandV1,parseFlowControlReceiptV1,parseFlowMessageReceiptV1,parseFlowStatusV1}from"./chunk-U4EAJPMO.js";import{FLOW_SETUP_TERMINAL_ONLY,flowBuildUnavailable,parseFlowCommand,renderFlowHelp}from"./chunk-PJXBU6CR.js";import"./chunk-KLSRGGOH.js";import"./chunk-MPRAQ6ZI.js";import"./chunk-3PJ7NPWN.js";import{assessNodeFallback,
|
|
14
|
+
discoverAgents,getFlowChildLaunchHost,getFlowControlHost,getFlowTraceProducer,renderTaskWithContext}from"./chunk-JQBZUFH7.js";import"./chunk-JBSWWCT5.js";import"./chunk-JSZBTGI6.js";import"./chunk-RQU722SY.js";import"./chunk-GPLWWO5Q.js";import"./chunk-JSHKS7VH.js";import"./chunk-6JTCRCNF.js";import"./chunk-3E37CJCE.js";import"./chunk-Q5RKNQ2T.js";import"./chunk-7NKUVTBL.js";import"./chunk-JWOPWHVH.js";import"./chunk-3HVHETMU.js";
|
|
15
|
+
import"./chunk-H7UPU2SH.js";import"./chunk-6P6GJPYB.js";import"./chunk-UZOIHLNU.js";import"./chunk-T2ZGMEMV.js";import"./chunk-GV5OVRKK.js";import"./chunk-F6ZAYLU2.js";import"./chunk-E4VUW4RI.js";import"./chunk-XQRYOCHA.js";import{mixColors,styleText,truncateToWidth,visibleWidth}from"./chunk-M5TVWJ5T.js";import"./chunk-DNGJMRJW.js";import"./chunk-R2KD2HFT.js";import"./chunk-IWZQ25I3.js";import{checkDhControlFence,dhCanonicalText,
|
|
16
|
+
parseDhControlDelivery}from"./chunk-L4J7SMJB.js";import"./chunk-HHWVVNGG.js";import"./chunk-UEW6TUSP.js";import"./chunk-SKCJ25SX.js";import"./chunk-7H2WNBX7.js";import"./chunk-CIA6V3BP.js";import"./chunk-FJIISX5W.js";import"./chunk-MIAXMK5F.js";import"./chunk-YSWDFV2L.js";import"./chunk-ZTG5OKI7.js";import"./chunk-ZG74NES2.js";import"./chunk-KI7CHPWC.js";import"./chunk-4MKATHT2.js";import"./chunk-IYGHKVUG.js";import"./chunk-FACBDLFU.js";
|
|
17
17
|
import"./chunk-LYZ37DJP.js";import"./chunk-AQ4EXORZ.js";import"./chunk-GY663MNP.js";import"./chunk-65FLSKDA.js";import"./chunk-4TDNOR36.js";import"./chunk-2NVGOSBN.js";import{FLOW_DIGEST_PATTERN,FLOW_ID_PATTERN,FLOW_ROLES,canonicalFlowJson}from"./chunk-PVNXN2TC.js";import"./chunk-7OZNMWAJ.js";import"./chunk-VCMXBP5S.js";import{typebox_exports}from"./chunk-VEGJT52D.js";import"./chunk-6HTHDVJC.js";import"./chunk-B47PNNLL.js";import{
|
|
18
18
|
getAgentDir}from"./chunk-VFLVWPLZ.js";import"./chunk-JXWJOIH4.js";var REPRESENTED=new Set(["description","tiers","capabilities","effort","backups","policy"]);function previewLegacyConversion(input){let{legacy,base,newId,models,preference,declaredPreference}=input,problems=[];if(base.kind!=="flow")return{problems:[`Base profile ${base.id} is a direct profile and cannot hold per-tier model choices.`]};for(let field of Object.keys(legacy.policy??{}))problems.push(`policy.${field} cannot be represented in a versioned profile. Remove it from the legacy profile or k\
|
|
19
19
|
eep using the legacy profile for that policy; no policy bindings are invented.`);for(let key of Object.keys(legacy))REPRESENTED.has(key)||problems.push(`${key} cannot be represented in a versioned profile.`);legacy.description!==void 0&&legacy.description.length>500&&problems.push("description is longer than the 500 characters a versioned profile allows.");let table=buildAliasTable(models),resolve9=(where,spec)=>{try{return resolveModelSpec(spec,table,preference).ref}catch(error){if(!(error instanceof
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{ARMIN_HEIGHT,ARMIN_WIDTH,isArminPixel}from"./chunk-
|
|
2
|
+
import{ARMIN_HEIGHT,ARMIN_WIDTH,isArminPixel}from"./chunk-BRSLXHED.js";import{formatKeyText,theme}from"./chunk-E4VUW4RI.js";import"./chunk-XQRYOCHA.js";import{backgroundAnsi,colorToRgb,foregroundAnsi,getKeybindings,indexedColor,rgbColor,visibleWidth}from"./chunk-M5TVWJ5T.js";import"./chunk-DNGJMRJW.js";import"./chunk-VFLVWPLZ.js";import"./chunk-JXWJOIH4.js";var DEPTH=.7,FLY_START=.1,FLY_DURATION=1.3,START_SCALE=.1;function createModel(columns,rows,pixel,options){let blocks=[];for(let row=0;row<rows;row++)for(let column=0;column<columns;column++){let color=pixel(column,row);color&&blocks.push({home:[column,row,0],color})}return{columns,rows,blocks,cameraDistance:options.cameraDistance,radius:Math.hypot(columns/2,rows/2,1+DEPTH/2),widthShare:options.widthShare,puzzleMoves:random=>options.puzzleMoves(random,blocks.length),origin:options.origin}}var CORAL=[
|
|
3
3
|
228,138,122],BLUE=[79,142,179],YELLOW=[234,182,93],PI_LOGO_PIXELS=["ccc.","b.c.","bb.y","b..y"],PI_LOGO_COLORS={c:CORAL,b:BLUE,y:YELLOW};function piLogoModel(origin){return createModel(4,4,(column,row)=>PI_LOGO_COLORS[PI_LOGO_PIXELS[row][column]],{cameraDistance:10,widthShare:.35,puzzleMoves:random=>random<.4?2:1,origin})}function arminModel(color){return createModel(ARMIN_WIDTH,ARMIN_HEIGHT,(column,row)=>isArminPixel(column,row)?color:void 0,{cameraDistance:80,widthShare:.45,puzzleMoves:(random,blockCount)=>Math.
|
|
4
4
|
round(blockCount*(.03+random*.04)),origin:void 0})}var PUZZLE_START=FLY_START+FLY_DURATION+3,PUZZLE_STEP=.3,PUZZLE_STEPS=12,PUZZLE_RETURN=1,PUZZLE_HOLD=.6,PUZZLE_CYCLE=PUZZLE_STEP*PUZZLE_STEPS+PUZZLE_RETURN+PUZZLE_HOLD,PUZZLE_MOVES=[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]];function shuffleSteps(model,cycle){let{columns,rows}=model,positions=model.blocks.map(block=>block.home),steps=[positions],lastMoved=new Set,random=cycle*7919+1,next=()=>hash(random++),
|
|
5
5
|
key=([x,y,z])=>((z+1)*rows+y)*columns+x;for(let step=0;step<PUZZLE_STEPS;step++){let occupied=new Set(positions.map(key)),nextPositions=[...positions],moved=new Set,moveCount=model.puzzleMoves(next());for(let move=0;move<moveCount;move++){let candidates=[];for(let block=0;block<positions.length;block++){if(moved.has(block))continue;let[x,y,z]=positions[block];for(let[dx,dy,dz]of PUZZLE_MOVES){let target=[x+dx,y+dy,z+dz];target[0]<0||target[0]>=columns||target[1]<0||target[1]>=rows||target[2]<-1||
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{Bm25Ranker,DEFAULT_TOOL_SEARCH_LIMIT,createToolSearchDocument}from"./chunk-
|
|
3
|
-
import"./chunk-
|
|
2
|
+
import{Bm25Ranker,DEFAULT_TOOL_SEARCH_LIMIT,createToolSearchDocument}from"./chunk-JSHKS7VH.js";import{CODEMODE_DOCS_PATH,CODEMODE_STORE_ENTRY_TYPE,getCodemodeCallableTools,parseCodemodeSource,renderToolSample,toCodemodeDeclaration,toCodemodeIdentifier}from"./chunk-6JTCRCNF.js";import{combineUsage,writeOutputFile}from"./chunk-3E37CJCE.js";import{formatSize,sliceHead,sliceTail}from"./chunk-3HVHETMU.js";import"./chunk-GV5OVRKK.js";import"./chunk-E4VUW4RI.js";import"./chunk-XQRYOCHA.js";
|
|
3
|
+
import"./chunk-M5TVWJ5T.js";import"./chunk-DNGJMRJW.js";import"./chunk-SKCJ25SX.js";import"./chunk-YSWDFV2L.js";import"./chunk-VEGJT52D.js";import{getCodemodeWorkerSpecifier,getQuickJSWasmPath}from"./chunk-VFLVWPLZ.js";import"./chunk-JXWJOIH4.js";function isWorkerToHostMessage(value){if(typeof value!="object"||value===null)return!1;let type=value.type;return type==="call"||type==="output"||type==="done"||type==="crash"||type==="started"||type==="idle"}var DEFAULT_TIMEOUT_MS=3e5,IDENTIFIER=/^[A-Za-z_$][A-Za-z0-9_$]*$/,RESERVED_GLOBALS=new Set(["tools","ALL_TOOLS","console","text","image","exit","globalThis","store","load"]);function errorMessage(error){return error instanceof Error?error.message:String(error)}function serializeStore(store){let serialized=Object.create(null);for(let[key,value]of Object.entries(store??{})){let json=JSON.stringify(value);json!==void 0&&(serialized[key]=json)}return serialized}var BridgeError=class extends Error{};
|
|
4
4
|
function parseBridgeJson(json,what){try{return JSON.parse(json)}catch{throw new BridgeError(`${what} is not valid JSON`)}}function parseStoreWrites(json){let entries=parseBridgeJson(json,"store writes");if(!Array.isArray(entries))throw new BridgeError("store writes are not an array");let writes={set:Object.create(null),delete:[]};for(let entry of entries){if(!Array.isArray(entry)||typeof entry[0]!="string"||(entry.length===2?typeof entry[1]!="string":entry.length!==1))throw new BridgeError("stor\
|
|
5
5
|
e writes contain a malformed entry");let[key,value]=entry;value===void 0?writes.delete.push(key):writes.set[key]=parseBridgeJson(value,`store value for ${JSON.stringify(key)}`)}return writes}function parseScriptError(json){let parsed=parseBridgeJson(json,"script error");if(typeof parsed!="object"||parsed===null)throw new BridgeError("script error is not an object");let{name,message,stack}=parsed;if(typeof message!="string"||name!==void 0&&typeof name!="string"||stack!==void 0&&typeof stack!="str\
|
|
6
6
|
ing")throw new BridgeError("script error is malformed");return{kind:"script",name,message,stack}}function checkGlobals(globals){let names=new Set,namespaces=new Set;for(let global of globals){let parts=global.name.split(".");if(parts.length>2||!parts.every(part=>IDENTIFIER.test(part))||RESERVED_GLOBALS.has(parts[0]))throw new Error(`Invalid global name "${global.name}"`);if(names.has(global.name))throw new Error(`Global "${global.name}" is already registered`);parts.length===2&&namespaces.add(parts[0]),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{createCodemodeExtension,getHumainBundledExtensionFactories,preflightModel}from"./chunk-
|
|
3
|
-
resolveAdhdDefault,resolveCavemanDefault,settledOutcome}from"./chunk-
|
|
4
|
-
import{SettingsManager}from"./chunk-
|
|
5
|
-
import"./chunk-
|
|
2
|
+
import{createCodemodeExtension,getHumainBundledExtensionFactories,preflightModel}from"./chunk-PJXBU6CR.js";import"./chunk-KLSRGGOH.js";import"./chunk-MPRAQ6ZI.js";import{BashJobManager,ModelRuntime,RunFailure,completionEvidence,createAgentSession,createAgentSessionServices,createBashToolDefinition,createFindToolDefinition,createGrepToolDefinition,createJobsToolDefinition,createReadToolDefinition,detectSupportedImageMimeTypeFromFile,failureOutcome,readDefaultMode,readLocalFileChunks,
|
|
3
|
+
resolveAdhdDefault,resolveCavemanDefault,settledOutcome}from"./chunk-JQBZUFH7.js";import{ProjectTrustStore,hasTrustRequiringProjectResources}from"./chunk-JSZBTGI6.js";import"./chunk-RQU722SY.js";import{SessionManager}from"./chunk-GPLWWO5Q.js";import"./chunk-6JTCRCNF.js";import"./chunk-3E37CJCE.js";import"./chunk-7NKUVTBL.js";import{getConfigValueEnvVarNames}from"./chunk-JWOPWHVH.js";import"./chunk-3HVHETMU.js";import"./chunk-H7UPU2SH.js";
|
|
4
|
+
import{SettingsManager}from"./chunk-T2ZGMEMV.js";import"./chunk-GV5OVRKK.js";import"./chunk-F6ZAYLU2.js";import"./chunk-E4VUW4RI.js";import"./chunk-XQRYOCHA.js";import"./chunk-M5TVWJ5T.js";import"./chunk-DNGJMRJW.js";import"./chunk-R2KD2HFT.js";import"./chunk-L4J7SMJB.js";import"./chunk-UEW6TUSP.js";import"./chunk-SKCJ25SX.js";import"./chunk-7H2WNBX7.js";import"./chunk-CIA6V3BP.js";import"./chunk-FJIISX5W.js";import"./chunk-MIAXMK5F.js";
|
|
5
|
+
import"./chunk-YSWDFV2L.js";import"./chunk-ZTG5OKI7.js";import"./chunk-ZG74NES2.js";import"./chunk-KI7CHPWC.js";import"./chunk-4MKATHT2.js";import"./chunk-IYGHKVUG.js";import"./chunk-FACBDLFU.js";import"./chunk-LYZ37DJP.js";import"./chunk-AQ4EXORZ.js";import"./chunk-GY663MNP.js";import"./chunk-65FLSKDA.js";import"./chunk-2NVGOSBN.js";import"./chunk-PVNXN2TC.js";import"./chunk-7OZNMWAJ.js";import"./chunk-VCMXBP5S.js";
|
|
6
6
|
import"./chunk-VEGJT52D.js";import"./chunk-B47PNNLL.js";import{getAgentDir,getBinDir}from"./chunk-VFLVWPLZ.js";import"./chunk-JXWJOIH4.js";import{accessSync,constants,existsSync,readFileSync,statSync}from"node:fs";import{access as fsAccess,readFile as fsReadFile}from"node:fs/promises";import{delimiter,join,resolve}from"node:path";var FILE_TOOLS=new Set(["read","write","edit","ls"]);async function startFlowImplementerSession(input){input.signal.throwIfAborted();let env={...input.env},session,refused,assertConfiguration=configuration=>{let pending=[configuration];for(;pending.length;){let value=pending.pop(),reason;if(typeof value=="string"&&(value.startsWith("!")?reason="inprocess_credential_commands_unavailable: use the default child backend":getConfigValueEnvVarNames(value).some(name=>env[name]!==process.env[name])&&(reason=
|
|
7
7
|
"inprocess_environment_config_unavailable: configuration references a filtered or changed environment variable; use the default child backend")),value&&typeof value=="object"&&(Object.hasOwn(value,"humain-gateway")&&Reflect.get(value,"humain-gateway")!==void 0&&(reason="inprocess_credential_commands_unavailable: OS keychain helpers are not in session custody; use the default child backend"),pending.push(...Object.values(value))),reason)throw refused=reason,session?.abort(),new Error(reason)}};if(Object.
|
|
8
8
|
keys(process.env).some(key=>key.startsWith("HUMAIN_TERMINAL_TRACE_")&&process.env[key]))throw new Error("inprocess_trace_control_unavailable: use the default child backend for traced runs");let agentDir=env.HUMAIN_TERMINAL_CODING_AGENT_DIR??getAgentDir();if(agentDir!==getAgentDir())throw new Error("inprocess_agent_directory_unavailable: host and child configuration roots differ");for(let path of[join(agentDir,"auth.json"),join(agentDir,"models.json")])existsSync(path)&&assertConfiguration(JSON.parse(
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{DispatchProgressTracker,preparePackagedAgents,resolveDispatchTimeoutPolicy,resolvePersona}from"./chunk-7WETECIB.js";import{BoundedCapture,ChildEventAccumulator,buildChildEnv,classifyDispatchOutcome,dispatchCustody,getFlowAgentsDir,isQuotaError,killProcessTree,personaCanMutateFor,redactUserText,registerDispatchPid,trimEventForLog}from"./chunk-HQMUDHC3.js";import"./chunk-
|
|
3
|
-
import"./chunk-
|
|
4
|
-
import"./chunk-
|
|
5
|
-
import"./chunk-
|
|
2
|
+
import{DispatchProgressTracker,preparePackagedAgents,resolveDispatchTimeoutPolicy,resolvePersona}from"./chunk-7WETECIB.js";import{BoundedCapture,ChildEventAccumulator,buildChildEnv,classifyDispatchOutcome,dispatchCustody,getFlowAgentsDir,isQuotaError,killProcessTree,personaCanMutateFor,redactUserText,registerDispatchPid,trimEventForLog}from"./chunk-HQMUDHC3.js";import"./chunk-EFY2QPVP.js";import"./chunk-G2QMON4O.js";import"./chunk-BRSLXHED.js";import"./chunk-JKX5EGOT.js";
|
|
3
|
+
import"./chunk-JX6YIPNK.js";import"./chunk-ZSWU5KKA.js";import"./chunk-U4EAJPMO.js";import"./chunk-PJXBU6CR.js";import"./chunk-KLSRGGOH.js";import"./chunk-MPRAQ6ZI.js";import"./chunk-3PJ7NPWN.js";import{discoverAgents,renderTaskWithContext}from"./chunk-JQBZUFH7.js";import"./chunk-JBSWWCT5.js";import"./chunk-JSZBTGI6.js";import"./chunk-RQU722SY.js";import"./chunk-GPLWWO5Q.js";import"./chunk-JSHKS7VH.js";import"./chunk-6JTCRCNF.js";
|
|
4
|
+
import"./chunk-3E37CJCE.js";import"./chunk-Q5RKNQ2T.js";import"./chunk-7NKUVTBL.js";import"./chunk-JWOPWHVH.js";import"./chunk-3HVHETMU.js";import"./chunk-H7UPU2SH.js";import"./chunk-6P6GJPYB.js";import"./chunk-UZOIHLNU.js";import"./chunk-T2ZGMEMV.js";import"./chunk-GV5OVRKK.js";import"./chunk-F6ZAYLU2.js";import"./chunk-E4VUW4RI.js";import"./chunk-XQRYOCHA.js";import"./chunk-M5TVWJ5T.js";import"./chunk-DNGJMRJW.js";
|
|
5
|
+
import"./chunk-R2KD2HFT.js";import"./chunk-IWZQ25I3.js";import"./chunk-L4J7SMJB.js";import"./chunk-HHWVVNGG.js";import"./chunk-UEW6TUSP.js";import"./chunk-SKCJ25SX.js";import"./chunk-7H2WNBX7.js";import"./chunk-CIA6V3BP.js";import"./chunk-FJIISX5W.js";import"./chunk-MIAXMK5F.js";import"./chunk-YSWDFV2L.js";import"./chunk-ZTG5OKI7.js";import"./chunk-ZG74NES2.js";import"./chunk-KI7CHPWC.js";import"./chunk-4MKATHT2.js";
|
|
6
6
|
import"./chunk-IYGHKVUG.js";import"./chunk-FACBDLFU.js";import"./chunk-LYZ37DJP.js";import"./chunk-AQ4EXORZ.js";import"./chunk-GY663MNP.js";import"./chunk-65FLSKDA.js";import"./chunk-4TDNOR36.js";import"./chunk-2NVGOSBN.js";import"./chunk-PVNXN2TC.js";import"./chunk-7OZNMWAJ.js";import"./chunk-VCMXBP5S.js";import"./chunk-VEGJT52D.js";import"./chunk-6HTHDVJC.js";import"./chunk-B47PNNLL.js";import"./chunk-VFLVWPLZ.js";
|
|
7
7
|
import"./chunk-JXWJOIH4.js";import{readFileSync}from"node:fs";var InProcessCustody=class{processes=new Set;workers=new Map;calls=new Set;closing=!1;closed;get size(){for(let child of this.processes)dispatchCustody(child).ownedTreeState==="absent"&&this.processes.delete(child);return this.processes.size+this.workers.size+this.calls.size}onProcessStarted=child=>{child.pid&&(this.processes.add(child),registerDispatchPid(child.pid,child),this.closing&&killProcessTree(child))};onWorkerStarted=(exited,terminate)=>{this.workers.set(exited,terminate),exited.then(()=>this.
|
|
8
8
|
workers.delete(exited)),this.closing&&terminate().catch(()=>{})};runHostCall=async run=>{if(this.closing)throw new Error("inprocess_session_closed_unavailable: tool admission is closed");let call=Promise.resolve().then(run);this.calls.add(call);try{return await call}finally{this.calls.delete(call)}};close(){return this.closing=!0,this.closed??=this.drain(),this.closed}async drain(){for(;this.size&&(await Promise.allSettled([...[...this.processes].map(child=>killProcessTree(child)),...[...this.workers.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{InteractiveMode,createInteractiveTui,createInteractiveTuiReference,formatCrashExtensionHint,formatResumeCommand}from"./chunk-
|
|
3
|
-
import"./chunk-
|
|
2
|
+
import{InteractiveMode,createInteractiveTui,createInteractiveTuiReference,formatCrashExtensionHint,formatResumeCommand}from"./chunk-G2QMON4O.js";import"./chunk-BRSLXHED.js";import"./chunk-JKX5EGOT.js";import"./chunk-ZSWU5KKA.js";import"./chunk-3PJ7NPWN.js";import"./chunk-JQBZUFH7.js";import"./chunk-JBSWWCT5.js";import"./chunk-JSZBTGI6.js";import"./chunk-GPLWWO5Q.js";import"./chunk-3E37CJCE.js";import"./chunk-JWOPWHVH.js";import"./chunk-3HVHETMU.js";
|
|
3
|
+
import"./chunk-H7UPU2SH.js";import"./chunk-UZOIHLNU.js";import"./chunk-T2ZGMEMV.js";import"./chunk-GV5OVRKK.js";import"./chunk-F6ZAYLU2.js";import"./chunk-E4VUW4RI.js";import"./chunk-XQRYOCHA.js";import"./chunk-M5TVWJ5T.js";import"./chunk-DNGJMRJW.js";import"./chunk-R2KD2HFT.js";import"./chunk-IWZQ25I3.js";import"./chunk-L4J7SMJB.js";import"./chunk-SKCJ25SX.js";import"./chunk-7H2WNBX7.js";import"./chunk-CIA6V3BP.js";
|
|
4
4
|
import"./chunk-FJIISX5W.js";import"./chunk-MIAXMK5F.js";import"./chunk-YSWDFV2L.js";import"./chunk-ZTG5OKI7.js";import"./chunk-ZG74NES2.js";import"./chunk-KI7CHPWC.js";import"./chunk-IYGHKVUG.js";import"./chunk-FACBDLFU.js";import"./chunk-LYZ37DJP.js";import"./chunk-AQ4EXORZ.js";import"./chunk-GY663MNP.js";import"./chunk-65FLSKDA.js";import"./chunk-2NVGOSBN.js";import"./chunk-PVNXN2TC.js";import"./chunk-7OZNMWAJ.js";
|
|
5
5
|
import"./chunk-VCMXBP5S.js";import"./chunk-VEGJT52D.js";import"./chunk-VFLVWPLZ.js";import"./chunk-JXWJOIH4.js";export{InteractiveMode,createInteractiveTui,createInteractiveTuiReference,formatCrashExtensionHint,formatResumeCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{createStartupTui,startStartupTui}from"./chunk-
|
|
2
|
+
import{createStartupTui,startStartupTui}from"./chunk-QFDZEUFU.js";import{SessionSelectorComponent}from"./chunk-JKX5EGOT.js";import"./chunk-JX6YIPNK.js";import"./chunk-ZSWU5KKA.js";import"./chunk-6P6GJPYB.js";import{KeybindingsManager,flushStdout}from"./chunk-UZOIHLNU.js";import"./chunk-T2ZGMEMV.js";import"./chunk-GV5OVRKK.js";import"./chunk-F6ZAYLU2.js";import"./chunk-E4VUW4RI.js";import"./chunk-XQRYOCHA.js";import{setKeybindings}from"./chunk-M5TVWJ5T.js";
|
|
3
3
|
import"./chunk-DNGJMRJW.js";import"./chunk-FJIISX5W.js";import"./chunk-YSWDFV2L.js";import"./chunk-VCMXBP5S.js";import"./chunk-VEGJT52D.js";import"./chunk-VFLVWPLZ.js";import"./chunk-JXWJOIH4.js";async function selectSession(currentSessionsLoader,allSessionsLoader,settingsManager){let ui=await createStartupTui(settingsManager);return new Promise(resolve=>{let keybindings=KeybindingsManager.create();setKeybindings(keybindings);let resolved=!1,stopUi=()=>(ui.stop(),flushStdout()),selector=new SessionSelectorComponent(currentSessionsLoader,allSessionsLoader,path=>{resolved||(resolved=!0,stopUi().then(()=>resolve(path)))},()=>{resolved||(resolved=!0,stopUi().then(()=>resolve(null)))},()=>{stopUi().
|
|
4
4
|
then(()=>process.exit(0))},()=>ui.requestRender(),{showRenameHint:!1,keybindings});ui.addChild(selector),ui.setFocus(selector.getSessionList()),startStartupTui(ui,settingsManager)})}export{selectSession};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{createStartupTui,shouldRunFirstTimeSetup,shouldRunFirstTimeSetupForDistribution,showFirstTimeSetup,showStartupInput,showStartupSelector,startStartupTui}from"./chunk-
|
|
3
|
-
import"./chunk-XQRYOCHA.js";import"./chunk-
|
|
2
|
+
import{createStartupTui,shouldRunFirstTimeSetup,shouldRunFirstTimeSetupForDistribution,showFirstTimeSetup,showStartupInput,showStartupSelector,startStartupTui}from"./chunk-QFDZEUFU.js";import"./chunk-JX6YIPNK.js";import"./chunk-ZSWU5KKA.js";import{showNonInteractiveMetadataDisclosure}from"./chunk-6P6GJPYB.js";import"./chunk-UZOIHLNU.js";import"./chunk-T2ZGMEMV.js";import"./chunk-GV5OVRKK.js";import"./chunk-F6ZAYLU2.js";import"./chunk-E4VUW4RI.js";
|
|
3
|
+
import"./chunk-XQRYOCHA.js";import"./chunk-M5TVWJ5T.js";import"./chunk-DNGJMRJW.js";import"./chunk-FJIISX5W.js";import"./chunk-YSWDFV2L.js";import"./chunk-VCMXBP5S.js";import"./chunk-VEGJT52D.js";import"./chunk-VFLVWPLZ.js";import"./chunk-JXWJOIH4.js";export{createStartupTui,shouldRunFirstTimeSetup,shouldRunFirstTimeSetupForDistribution,showFirstTimeSetup,showNonInteractiveMetadataDisclosure,showStartupInput,showStartupSelector,startStartupTui};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import{DEFAULT_MAX_JSON_BYTES,DEFAULT_REQUEST_TIMEOUT_MS,PROFILE_LOCK_DEFAULT_WAIT_MS,PROFILE_LOCK_DIR_NAME,TRACE_PERMISSIONS,TraceAccessDenied,TraceClientProtocolError,TraceClientReauthRequired,TraceCredentialStoreError,TraceInvalidGrant,TraceLoginError,TraceScopeError,TraceSpoolSecurityError,TraceTokenOutcomeUnknown,TraceUploader,assertScopeAllowsAll,assertTraceSpoolSecure,beginQuarantineRelease,checkTraceArtifact,commitQuarantineRelease,consumeTraceIngestToken,createDefaultTraceCredentialStore,
|
|
3
|
+
createTraceRedactor,getTraceEnvSecrets,inspectTraceSpoolQuarantine,isRecord,isScopeWithin,isUploadReportClean,listTraceStreams,lockFileName,normalizeBaseUrl,parseTraceSpoolBinding,readBoundedJson,readTraceStateFile,requestRevoke,requestToken,sanitizeForTerminal,scopesEqual,summarizeTraceStream,takeTraceIngestCredentials,toAllowlistedErrno,traceCursorPath,traceOAuthErrorCode,traceRejectionsPath,traceStreamsDir,validateTraceGrantScope,withProfileLock,withTimeout}from"./chunk-R2KD2HFT.js";import{
|
|
4
|
+
openBrowser}from"./chunk-IWZQ25I3.js";import{DH_ARTIFACT_MAX_BYTES,DH_BUNDLE_MAGIC,DH_HTTP_MAX_CURSOR_LENGTH,DH_HTTP_MAX_PAGE_ITEMS,DH_OUTCOMES,acceptDhBundlePayloadChunk,acceptDhExportManifestPage,assertDhCursorBinding,assertDhExportDownloadBinding,beginDhBundleFrame,beginDhBundleVerification,beginDhExportManifest,dhCanonicalText,dhDigestInput,finishDhBundleFrame,finishDhBundleVerification,finishDhExportManifest,parseDhAgentPage,parseDhArtifactMetadataView,parseDhBundleFrameHeader,parseDhBundleHeaderLength,
|
|
5
|
+
parseDhCursorBinding,parseDhEventPage,parseDhExportDownload,parseDhExportJob,parseDhExportJobStatus,parseDhExportManifestPage,parseDhExportManifestResponse,parseDhGenerationPage,parseDhRawJson,requiredDhPermissions,validateDhTraceBundle}from"./chunk-L4J7SMJB.js";import"./chunk-7OZNMWAJ.js";import"./chunk-VCMXBP5S.js";import"./chunk-VEGJT52D.js";import{APP_COMMAND,getAgentDir}from"./chunk-VFLVWPLZ.js";import"./chunk-JXWJOIH4.js";import{createHash as createHash6}from"node:crypto";import{existsSync,lstatSync,statSync}from"node:fs";import{resolve as resolve2}from"node:path";import{createInterface}from"node:readline/promises";import{parseArgs}from"node:util";import{createHash as createHash3}from"node:crypto";import{createHash}from"node:crypto";import{readSync}from"node:fs";function verifyTraceBundleFile(fd,header,descriptor){try{let read=(position,length)=>{let bytes=Buffer.alloc(length),offset2=0;for(;offset2<length;){let count=readSync(fd,bytes,offset2,length-offset2,position+offset2);if(count===0)throw new Error("torn frame");offset2+=count}return bytes},magicLength=Buffer.byteLength(DH_BUNDLE_MAGIC),frameAt=offset2=>{let length=parseDhBundleHeaderLength(read(offset2,4)),bytes=read(offset2+4,length);return{bytes,frame:parseDhBundleFrameHeader(parseDhRawJson(bytes,
|
|
6
6
|
{maxBytes:4096})),payloadOffset:offset2+4+length}};function*pages(){let offset2=magicLength,first=frameAt(offset2);offset2=first.payloadOffset+first.frame.sizeBytes;for(let index=0;index<header.shardCount;index++){let item=frameAt(offset2);if(item.frame.kind!=="manifest-page")throw new Error("missing manifest page");yield parseDhRawJson(read(item.payloadOffset,item.frame.sizeBytes),{maxBytes:1048576}),offset2=item.payloadOffset+item.frame.sizeBytes}}let state=beginDhBundleVerification(read(0,magicLength),
|
|
7
7
|
header,descriptor,{[Symbol.iterator]:pages},{sha256Hex:bytes=>createHash("sha256").update(bytes).digest("hex"),createHasher:()=>createHash("sha256")}),offset=magicLength;for(;offset<descriptor.sizeBytes;){let item=frameAt(offset),frame=beginDhBundleFrame(state,item.bytes);if(item.payloadOffset+frame.sizeBytes>descriptor.sizeBytes)throw new Error("torn payload");let record;if(frame.kind==="artifact-bytes")for(let consumed=0;consumed<frame.sizeBytes;consumed+=65536)acceptDhBundlePayloadChunk(state,
|
|
8
8
|
read(item.payloadOffset+consumed,Math.min(65536,frame.sizeBytes-consumed)));else{let bytes=read(item.payloadOffset,frame.sizeBytes);acceptDhBundlePayloadChunk(state,bytes),record=parseDhRawJson(bytes,{maxBytes:1048576})}finishDhBundleFrame(state,record),offset=item.payloadOffset+frame.sizeBytes}finishDhBundleVerification(state)}catch{throw new TraceClientProtocolError("Export bundle failed framing, membership or seal verification")}}import{createHash as createHash2,randomBytes}from"node:crypto";import{constants}from"node:fs";import{link,lstat,open,realpath,unlink}from"node:fs/promises";import{basename,dirname,join,resolve}from"node:path";function protocolError(message){return new TraceClientProtocolError(message)}async function assertDestinationFree(destination){if(await exists(resolve(destination)))throw protocolError("Destination file already exists; refusing to overwrite it")}async function exists(path){try{return await lstat(path),!0}catch(error){if(error.code==="ENOENT")return!1;throw error}}async function syncDirectory(directory){let handle;try{handle=await open(directory,constants.O_RDONLY),await handle.sync()}catch{}finally{
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{dist_exports as dist_exports3}from"./chunk-
|
|
3
|
-
import"./chunk-JSZBTGI6.js";import"./chunk-RQU722SY.js";import"./chunk-GPLWWO5Q.js";import"./chunk-
|
|
2
|
+
import{dist_exports as dist_exports3}from"./chunk-EFY2QPVP.js";import"./chunk-G2QMON4O.js";import"./chunk-BRSLXHED.js";import"./chunk-JKX5EGOT.js";import"./chunk-JX6YIPNK.js";import"./chunk-ZSWU5KKA.js";import"./chunk-U4EAJPMO.js";import"./chunk-PJXBU6CR.js";import"./chunk-KLSRGGOH.js";import"./chunk-MPRAQ6ZI.js";import"./chunk-3PJ7NPWN.js";import{dist_exports as dist_exports2,oauth_exports}from"./chunk-JQBZUFH7.js";import"./chunk-JBSWWCT5.js";
|
|
3
|
+
import"./chunk-JSZBTGI6.js";import"./chunk-RQU722SY.js";import"./chunk-GPLWWO5Q.js";import"./chunk-JSHKS7VH.js";import"./chunk-6JTCRCNF.js";import"./chunk-3E37CJCE.js";import"./chunk-Q5RKNQ2T.js";import"./chunk-7NKUVTBL.js";import"./chunk-JWOPWHVH.js";import"./chunk-3HVHETMU.js";import{all_exports,anthropicMessagesApi,azureOpenAIResponsesApi,bedrockConverseStreamApi,complete,completeSimple,generateImages,generateImagesOpenRouter,getApiProvider,
|
|
4
4
|
getApiProviders,getImageModel,getImageModels,getImageProviders,getImagesApiProvider,getModel,getModels,getProviders,googleGenerativeAIApi,googleVertexApi,mistralConversationsApi,openAICodexResponsesApi,openAICompletionsApi,openAIResponsesApi,piMessagesApi,registerApiProvider,registerBuiltInApiProviders,registerBuiltInImagesApiProviders,registerFauxProvider,registerImagesApiProvider,resetApiProviders,setBedrockProviderLoader,setBedrockProviderModule,stream,streamAnthropic,streamAzureOpenAIResponses,
|
|
5
|
-
streamGoogle,streamGoogleVertex,streamMistral,streamOpenAICodexResponses,streamOpenAICompletions,streamOpenAIResponses,streamSimple,streamSimpleAnthropic,streamSimpleAzureOpenAIResponses,streamSimpleGoogle,streamSimpleGoogleVertex,streamSimpleMistral,streamSimpleOpenAICodexResponses,streamSimpleOpenAICompletions,streamSimpleOpenAIResponses,unregisterApiProviders}from"./chunk-
|
|
6
|
-
import"./chunk-F6ZAYLU2.js";import"./chunk-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
streamGoogle,streamGoogleVertex,streamMistral,streamOpenAICodexResponses,streamOpenAICompletions,streamOpenAIResponses,streamSimple,streamSimpleAnthropic,streamSimpleAzureOpenAIResponses,streamSimpleGoogle,streamSimpleGoogleVertex,streamSimpleMistral,streamSimpleOpenAICodexResponses,streamSimpleOpenAICompletions,streamSimpleOpenAIResponses,unregisterApiProviders}from"./chunk-H7UPU2SH.js";import"./chunk-6P6GJPYB.js";import"./chunk-UZOIHLNU.js";import"./chunk-T2ZGMEMV.js";import"./chunk-GV5OVRKK.js";
|
|
6
|
+
import"./chunk-F6ZAYLU2.js";import"./chunk-E4VUW4RI.js";import"./chunk-XQRYOCHA.js";import{dist_exports}from"./chunk-M5TVWJ5T.js";import"./chunk-DNGJMRJW.js";import"./chunk-R2KD2HFT.js";import"./chunk-IWZQ25I3.js";import"./chunk-L4J7SMJB.js";import"./chunk-HHWVVNGG.js";import"./chunk-UEW6TUSP.js";import"./chunk-SKCJ25SX.js";import{ANTHROPIC_API_KEY_ENV,ANTHROPIC_AUTH_TOKEN_ENV,ANTHROPIC_FEDERATION_RULE_ID_ENV,ANTHROPIC_IDENTITY_TOKEN_FILE_ENV,
|
|
7
|
+
ANTHROPIC_OAUTH_TOKEN_ENV,ANTHROPIC_ORGANIZATION_ID_ENV,ANTHROPIC_SERVICE_ACCOUNT_ID_ENV,ANTHROPIC_WORKSPACE_ID_ENV,findEnvKeys,getEnvApiKey}from"./chunk-7H2WNBX7.js";import"./chunk-CIA6V3BP.js";import"./chunk-FJIISX5W.js";import{AssistantMessageFrameEncoder,CACHE_WARMING_IDLE_CONTINUATION_PROBABILITY,CACHE_WARMING_MAX_AGE_MS,CACHE_WARMING_MAX_IDLE_AGE_MS,CACHE_WARMING_MINIMUM_EXPECTED_SAVINGS,OAuthRefreshRejectedError,attestProviderRequest,createFauxCore,envApiKeyAuth,evaluateCacheWarming,
|
|
8
|
+
fauxAssistantMessage,fauxProvider,fauxText,fauxThinking,fauxToolCall,getCacheWarmingDelayMs,getCacheWarmingRequestOptions,getOverflowPatterns,getPromptCacheTtlMs,isCacheWarmingReplayable,isContextOverflow,isRecoverableLength,lazyOAuth,normalizeAdmissionUsage,reduceAssistantMessageFrames,validateToolArguments,validateToolCall}from"./chunk-MIAXMK5F.js";import{DEFAULT_MAX_AGENT_RETRY_DELAY_MS,getAssistantRetryDelayMs,isRetryableAssistantError,retryAssistantCall,retryDelayMs}from"./chunk-YSWDFV2L.js";
|
|
9
|
+
import{getOpenAICodexTokenIdentity}from"./chunk-ZTG5OKI7.js";import{cleanupSessionResources,registerSessionResourceCleanup}from"./chunk-ZG74NES2.js";import{AI_TELEMETRY_SCHEMA,DEFAULT_NO_PROGRESS_TIMEOUT_MS,InMemoryCredentialStore,InMemoryModelsStore,ModelsError,NoProgressTimeoutError,calculateCost,clampThinkingLevel,collapseSystemMessages,commitLoginCredential,createInitialSystemMessage,createModels,createProvider,declarationsEqual,defaultProviderAuthContext,getCurrentSystemMessage,
|
|
10
|
+
getCurrentSystemPrompt,getCurrentTools,getDeclaredTools,getInitialSystemMessage,getModelType,getSupportedThinkingLevels,getToolStateChanges,hasApi,hasNonAdditiveToolChanges,hasToolRedefinitions,isModelType,lazyApi,lazyStream,modelsAreEqual,models_exports,normalizeContext,resolveTranscript,resolveTranscriptTools,streamWithProgressTimeout,toToolDeclaration,withoutInitialSystemMessage}from"./chunk-KI7CHPWC.js";import"./chunk-4MKATHT2.js";import{createDelegatedFetch}from"./chunk-IYGHKVUG.js";
|
|
11
11
|
import"./chunk-FACBDLFU.js";import{StreamingJsonParser,ToolCallArgumentsStream,parseJsonWithRepair,parseStreamingJson,parseStreamingJsonWhileStreaming,parseToolCallArguments,repairJson}from"./chunk-LYZ37DJP.js";import"./chunk-AQ4EXORZ.js";import{AssistantMessageEventStream,EventStream,ManagedAssistantMessageQueue,createAssistantMessageEventStream,drainStream}from"./chunk-GY663MNP.js";import{PI_AI_VERSION,PI_ATTRIBUTION,SubmissionAdmissionError,appendAssistantMessageDiagnostic,
|
|
12
12
|
contentText,createAssistantMessageDiagnostic,extractDiagnosticError,formatThrownValue,formatUserAgent,getAttributionHeaders,getClientProduct,getClientVersion,getIdentityHeaders,getOpenCodeSessionHeaders,getSystemMessageText,mergeClientIdentity,renderSystemMessageUpdate,uuidv7,withClientIdentity}from"./chunk-65FLSKDA.js";import"./chunk-4TDNOR36.js";import"./chunk-2NVGOSBN.js";import"./chunk-PVNXN2TC.js";import"./chunk-7OZNMWAJ.js";import{compile_exports,value_exports}from"./chunk-VCMXBP5S.js";
|
|
13
13
|
import{build_exports,typebox_exports}from"./chunk-VEGJT52D.js";import"./chunk-6HTHDVJC.js";import"./chunk-B47PNNLL.js";import"./chunk-VFLVWPLZ.js";import{__export}from"./chunk-JXWJOIH4.js";var pi_ai_extension_view_exports={};__export(pi_ai_extension_view_exports,{AI_TELEMETRY_SCHEMA:()=>AI_TELEMETRY_SCHEMA,ANTHROPIC_API_KEY_ENV:()=>ANTHROPIC_API_KEY_ENV,ANTHROPIC_AUTH_TOKEN_ENV:()=>ANTHROPIC_AUTH_TOKEN_ENV,ANTHROPIC_FEDERATION_RULE_ID_ENV:()=>ANTHROPIC_FEDERATION_RULE_ID_ENV,ANTHROPIC_IDENTITY_TOKEN_FILE_ENV:()=>ANTHROPIC_IDENTITY_TOKEN_FILE_ENV,ANTHROPIC_OAUTH_TOKEN_ENV:()=>ANTHROPIC_OAUTH_TOKEN_ENV,ANTHROPIC_ORGANIZATION_ID_ENV:()=>ANTHROPIC_ORGANIZATION_ID_ENV,ANTHROPIC_SERVICE_ACCOUNT_ID_ENV:()=>ANTHROPIC_SERVICE_ACCOUNT_ID_ENV,
|