@humain/humain-code 0.3.7 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/bundle/agent-monitor.js +1 -1
  3. package/dist/bundle/chunks/bedrock-converse-stream.js +18 -17
  4. package/dist/bundle/chunks/{chunk-I2VOYPDI.js → chunk-2KKLZK2N.js} +1 -1
  5. package/dist/bundle/chunks/{chunk-UDTXD6EF.js → chunk-2Q2O3GZ4.js} +721 -717
  6. package/dist/bundle/chunks/{chunk-IYCS4ZUX.js → chunk-3ZI2TEVB.js} +1 -1
  7. package/dist/bundle/chunks/{chunk-ANSL5PYD.js → chunk-DUZY4PDA.js} +18 -18
  8. package/dist/bundle/chunks/{chunk-ZWHFLRTK.js → chunk-E22S6D55.js} +1 -1
  9. package/dist/bundle/chunks/{chunk-6PGWVVGK.js → chunk-E7WGCXWK.js} +1 -1
  10. package/dist/bundle/chunks/{chunk-MNB52OYZ.js → chunk-ERT2BD7V.js} +36 -36
  11. package/dist/bundle/chunks/{chunk-B44UVTZL.js → chunk-H5CZL7M5.js} +1 -1
  12. package/dist/bundle/chunks/{chunk-IPWO7ULX.js → chunk-HA5AW36V.js} +397 -356
  13. package/dist/bundle/chunks/{chunk-7VMWPYCR.js → chunk-IAI7MTU4.js} +3 -3
  14. package/dist/bundle/chunks/{chunk-6FTYU7I7.js → chunk-ICLZNV4V.js} +2 -2
  15. package/dist/bundle/chunks/{chunk-DMAZLWJY.js → chunk-JQZ7BIAI.js} +2 -13
  16. package/dist/bundle/chunks/{chunk-E6ZGTXQP.js → chunk-N23FFKJU.js} +40 -25
  17. package/dist/bundle/chunks/{chunk-RCJ2GKUP.js → chunk-OXJXKCLB.js} +1 -1
  18. package/dist/bundle/chunks/{chunk-7CYWKPFS.js → chunk-UBQSONVR.js} +9 -8
  19. package/dist/bundle/chunks/{chunk-LTQ2YA2G.js → chunk-VZV7GLZT.js} +2 -2
  20. package/dist/bundle/chunks/{chunk-FF26YENK.js → chunk-W2QRCQBX.js} +4 -3
  21. package/dist/bundle/chunks/{cli-JPMYGPAI.js → cli-5YRA5PFB.js} +2 -2
  22. package/dist/bundle/chunks/{compat-VHCHB5WQ.js → compat-TCOK5LFD.js} +1 -1
  23. package/dist/bundle/chunks/dist-33CBPO23.js +1928 -0
  24. package/dist/bundle/chunks/{easter-egg-3d-XXETTDXE.js → easter-egg-3d-ARXMB2RN.js} +1 -1
  25. package/dist/bundle/chunks/{esm-763X2IA7.js → esm-NCUV2DF7.js} +1 -1
  26. package/dist/bundle/chunks/{event-streams-4Q22QRY2.js → event-streams-CGCQQL5M.js} +1 -1
  27. package/dist/bundle/chunks/{execute-G3YZLU7S.js → execute-KEUC5IWA.js} +1 -1
  28. package/dist/bundle/chunks/{extract-SJF4DY5M.js → extract-WUAT5T4V.js} +4 -4
  29. package/dist/bundle/chunks/{google-generative-ai-ICWD4YIE.js → google-generative-ai-MDUVUFFQ.js} +1 -1
  30. package/dist/bundle/chunks/{google-vertex-XIACVW6H.js → google-vertex-UQGG6LEW.js} +1 -1
  31. package/dist/bundle/chunks/{host-M54XD7HV.js → host-SPBJ4YAA.js} +1 -1
  32. package/dist/bundle/chunks/{node-W47VUEGE.js → node-XGNY74WT.js} +1 -1
  33. package/dist/bundle/chunks/{runtime-POHTHFKR.js → runtime-HBWXEJT3.js} +1 -1
  34. package/dist/bundle/chunks/{virtual-modules-ORGE66B4.js → virtual-modules-I5YD7JGC.js} +2 -2
  35. package/dist/bundle/cli-runtime.js +2 -2
  36. package/dist/bundle/flow/agents/.gitkeep +0 -0
  37. package/dist/bundle/flow/agents/orch-architect.md +33 -0
  38. package/dist/bundle/flow/agents/orch-implementation-fast.md +13 -0
  39. package/dist/bundle/flow/agents/orch-implementation-strong.md +28 -0
  40. package/dist/bundle/flow/agents/orch-qa-agent.md +29 -0
  41. package/dist/bundle/flow/agents/orch-scout.md +35 -0
  42. package/dist/bundle/flow/agents/orch-security-review.md +28 -0
  43. package/dist/bundle/flow/agents/orch-technical-lead.md +37 -0
  44. package/dist/bundle/flow/agents/orch-technical-review.md +28 -0
  45. package/dist/bundle/flow/agents/orch-worker.md +13 -0
  46. package/dist/bundle/flow/agents/orchestrator-lead.md +55 -0
  47. package/dist/bundle/flow/assets/.gitkeep +0 -0
  48. package/dist/bundle/flow/assets/contract.json +84 -0
  49. package/dist/bundle/flow/assets/forge-protocol-schema.sha256 +1 -0
  50. package/dist/bundle/flow/assets/method.json +193 -0
  51. package/dist/bundle/flow/assets/orchestrator-profiles.json +131 -0
  52. package/dist/bundle/flow/assets/profiles/anthropic.json +189 -0
  53. package/dist/bundle/flow/assets/profiles/openai.json +177 -0
  54. package/dist/bundle/flow/assets/profiles/oss-first.json +236 -0
  55. package/dist/bundle/flow/assets/profiles/premium.json +203 -0
  56. package/dist/bundle/flow/package.json +48 -0
  57. package/dist/bundle/index.js +5 -5
  58. package/dist/bundle/rpc-entry.js +2 -2
  59. package/dist/config.d.ts +17 -5
  60. package/dist/config.d.ts.map +1 -1
  61. package/dist/config.js +25 -2
  62. package/dist/config.js.map +1 -1
  63. package/dist/core/tools/subagent.d.ts +20 -0
  64. package/dist/core/tools/subagent.d.ts.map +1 -1
  65. package/dist/core/tools/subagent.js +124 -12
  66. package/dist/core/tools/subagent.js.map +1 -1
  67. package/dist/humain/flow-loader.d.ts +62 -0
  68. package/dist/humain/flow-loader.d.ts.map +1 -0
  69. package/dist/humain/flow-loader.js +291 -0
  70. package/dist/humain/flow-loader.js.map +1 -0
  71. package/dist/humain/index.d.ts.map +1 -1
  72. package/dist/humain/index.js +2 -0
  73. package/dist/humain/index.js.map +1 -1
  74. package/dist/humain/trace-capture/child-launch.d.ts +1 -0
  75. package/dist/humain/trace-capture/child-launch.d.ts.map +1 -1
  76. package/dist/humain/trace-capture/child-launch.js +2 -1
  77. package/dist/humain/trace-capture/child-launch.js.map +1 -1
  78. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  79. package/dist/modes/rpc/rpc-mode.js +136 -1
  80. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  81. package/dist/utils/version-check.d.ts.map +1 -1
  82. package/dist/utils/version-check.js +3 -1
  83. package/dist/utils/version-check.js.map +1 -1
  84. package/docs/docs.json +8 -0
  85. package/docs/environment-variables.md +1 -0
  86. package/docs/flow-profiles.md +173 -0
  87. package/docs/flow.md +112 -0
  88. package/docs/humain-code.md +1 -1
  89. package/docs/index.md +2 -0
  90. package/npm-shrinkwrap.json +6 -6
  91. package/package.json +6 -5
@@ -4,9 +4,9 @@ InteractiveMode,LoginDialogComponent,ModelRegistry,ModelRuntime,ModelSelectorCom
4
4
  createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodemodeExtension,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,createLocalBashOperations,createLocalPowerShellOperations,createLsTool,createLsToolDefinition,createMcpExtension,createPiAgentExecutionHost,createPowerShellTool,createPowerShellToolDefinition,createReadOnlyTools,
5
5
  createReadTool,createReadToolDefinition,createSubagentTool,createSyntheticSourceInfo,createToolSearchExtension,createWriteTool,createWriteToolDefinition,defineTool,detectSupportedImageMimeTypeFromFile,discoverAgents,discoverAndLoadExtensions,estimateTokens,executeHumainAgentRequest,findCutPoint,findTurnStartIndex,formatSkillsForPrompt,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getFlowChildLaunchHost,getFlowControlHost,getFlowTraceProducer,
6
6
  getLastAssistantUsage,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isWriteToolResult,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,parseArgs,parseFrontmatter,parseSkillBlock,prepareBranchEntries,prepareChildLaunch,renderDiff,renderTaskWithContext,resolveCliModel,resolveModelScopeWithDiagnostics,runAgentExecMode,runPrintMode,runRpcMode,serializeConversation,shouldCompact,stripFrontmatter,
7
- withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunk-IPWO7ULX.js";import{ProjectTrustStore,hasTrustRequiringProjectResources}from"./chunk-B44UVTZL.js";import{CURRENT_SESSION_VERSION,SessionManager,buildContextEntries,buildSessionContext,buildSessionProjection,convertToLlm,formatDimensionNote,getLatestCompactionEntry,migrateSessionEntries,parseSessionEntries,resizeImage,sessionEntryToContextMessages}from"./chunk-I2VOYPDI.js";import{readStoredCredential}from"./chunk-DMAZLWJY.js";
8
- import{DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,formatSize,getPowerShellConfig,getShellConfig,truncateHead,truncateLine,truncateTail,truncateToVisualLines}from"./chunk-RCJ2GKUP.js";import{ArminComponent}from"./chunk-6PGWVVGK.js";import{Container,SelectList,Theme,getAvailableThemes,getLanguageFromPath,getMarkdownTheme,getSelectListTheme,getSettingsListTheme,highlightCode,initTheme,keyHint,keyText,rawKeyHint}from"./chunk-6FTYU7I7.js";import{HUMAIN_AGENT_EXECUTION_FAILURE_CODES,HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION,
9
- HumainAgentArtifactSchema,HumainAgentExecutionClaimSchema,HumainAgentExecutionControlsSchema,HumainAgentExecutionOutcomeSchema,HumainAgentExecutionRequestSchema,HumainAgentExecutionResponseSchema,HumainAgentRouteRefSchema,HumainAgentUsageSchema,parseHumainAgentExecutionRequest,parseHumainAgentExecutionResponse}from"./chunk-E6ZGTXQP.js";import{CONFIG_DIR_NAME,UPSTREAM_PI_VERSION,VERSION,getAgentDir,getDocsPath,getExamplesPath,getPackageDir,getReadmePath}from"./chunk-ANSL5PYD.js";import{
7
+ withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunk-HA5AW36V.js";import{ProjectTrustStore,hasTrustRequiringProjectResources}from"./chunk-H5CZL7M5.js";import{CURRENT_SESSION_VERSION,SessionManager,buildContextEntries,buildSessionContext,buildSessionProjection,convertToLlm,formatDimensionNote,getLatestCompactionEntry,migrateSessionEntries,parseSessionEntries,resizeImage,sessionEntryToContextMessages}from"./chunk-2KKLZK2N.js";import{readStoredCredential}from"./chunk-JQZ7BIAI.js";
8
+ import{DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,formatSize,getPowerShellConfig,getShellConfig,truncateHead,truncateLine,truncateTail,truncateToVisualLines}from"./chunk-OXJXKCLB.js";import{ArminComponent}from"./chunk-E7WGCXWK.js";import{Container,SelectList,Theme,getAvailableThemes,getLanguageFromPath,getMarkdownTheme,getSelectListTheme,getSettingsListTheme,highlightCode,initTheme,keyHint,keyText,rawKeyHint}from"./chunk-ICLZNV4V.js";import{HUMAIN_AGENT_EXECUTION_FAILURE_CODES,HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION,
9
+ HumainAgentArtifactSchema,HumainAgentExecutionClaimSchema,HumainAgentExecutionControlsSchema,HumainAgentExecutionOutcomeSchema,HumainAgentExecutionRequestSchema,HumainAgentExecutionResponseSchema,HumainAgentRouteRefSchema,HumainAgentUsageSchema,parseHumainAgentExecutionRequest,parseHumainAgentExecutionResponse}from"./chunk-N23FFKJU.js";import{CONFIG_DIR_NAME,UPSTREAM_PI_VERSION,VERSION,getAgentDir,getDocsPath,getExamplesPath,getPackageDir,getReadmePath}from"./chunk-DUZY4PDA.js";import{
10
10
  __export}from"./chunk-JXWJOIH4.js";var dist_exports={};__export(dist_exports,{ACCOUNT_RETURN_COOLDOWN_MS:()=>ACCOUNT_RETURN_COOLDOWN_MS,ACCOUNT_RETURN_MAX_COOLDOWN_MS:()=>ACCOUNT_RETURN_MAX_COOLDOWN_MS,AgentExecInputError:()=>AgentExecInputError,AgentSession:()=>AgentSession,AgentSessionRuntime:()=>AgentSessionRuntime,ArminComponent:()=>ArminComponent,AssistantMessageComponent:()=>AssistantMessageComponent,BashExecutionComponent:()=>BashExecutionComponent,BorderedLoader:()=>BorderedLoader,BranchSummaryMessageComponent:()=>BranchSummaryMessageComponent,
11
11
  CONFIG_DIR_NAME:()=>CONFIG_DIR_NAME,CURRENT_SESSION_VERSION:()=>CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent:()=>CompactionSummaryMessageComponent,CredentialSynchronizationError:()=>CredentialSynchronizationError,CustomEditor:()=>CustomEditor,CustomMessageComponent:()=>CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS:()=>DEFAULT_COMPACTION_SETTINGS,DEFAULT_MAX_BYTES:()=>DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES:()=>DEFAULT_MAX_LINES,DefaultPackageManager:()=>DefaultPackageManager,DefaultResourceLoader:()=>DefaultResourceLoader,
12
12
  DynamicBorder:()=>DynamicBorder,ExtensionEditorComponent:()=>ExtensionEditorComponent,ExtensionInputComponent:()=>ExtensionInputComponent,ExtensionRunner:()=>ExtensionRunner,ExtensionSelectorComponent:()=>ExtensionSelectorComponent,FooterComponent:()=>FooterComponent,HUMAIN_AGENT_EXECUTION_FAILURE_CODES:()=>HUMAIN_AGENT_EXECUTION_FAILURE_CODES,HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION:()=>HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION,HumainAgentArtifactSchema:()=>HumainAgentArtifactSchema,HumainAgentExecutionClaimSchema:()=>HumainAgentExecutionClaimSchema,
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{require_core}from"./chunk-SCIGZFN5.js";import{getCustomThemesDir,getThemesDir,stripBom}from"./chunk-ANSL5PYD.js";import{__export,__toESM}from"./chunk-JXWJOIH4.js";var ambiguousRanges=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,
2
+ import{require_core}from"./chunk-SCIGZFN5.js";import{getCustomThemesDir,getThemesDir,stripBom}from"./chunk-DUZY4PDA.js";import{__export,__toESM}from"./chunk-JXWJOIH4.js";var ambiguousRanges=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,
3
3
  1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,
4
4
  8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,
5
5
  9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],fullwidthMinimalCodePoint=12288,fullwidthMaximumCodePoint=65510,fullwidthRanges=[12288,12288,65281,65376,65504,65510];var wideMinimalCodePoint=4352,wideMaximumCodePoint=262141,wideRanges=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,
@@ -1146,6 +1146,6 @@ void 0;if(!validLang)return code.split(`
1146
1146
  `)}catch{return code.split(`
1147
1147
  `).map(line=>theme.fg("mdCodeBlock",line))}}}}function getSelectListTheme(){return{selectedPrefix:text=>theme.fg("accent",text),selectedText:text=>theme.fg("accent",text),description:text=>theme.fg("muted",text),scrollInfo:text=>theme.fg("muted",text),noMatch:text=>theme.fg("muted",text)}}function getEditorTheme(){return{borderColor:text=>theme.fg("borderMuted",text),selectList:getSelectListTheme()}}function getSettingsListTheme(){return{label:(text,selected)=>selected?theme.fg("accent",text):text,
1148
1148
  value:(text,selected)=>selected?theme.fg("accent",text):theme.fg("muted",text),description:text=>theme.fg("dim",text),cursor:theme.fg("accent","\u2192 "),hint:text=>theme.fg("dim",text)}}function formatKeyPart(part,options){let displayPart=process.platform==="darwin"&&part.toLowerCase()==="alt"?"option":part;return options.capitalize?displayPart.charAt(0).toUpperCase()+displayPart.slice(1):displayPart}function formatKeyText(key,options={}){return key.split("/").map(k2=>k2.split("+").map(part=>formatKeyPart(part,options)).join("+")).join("/")}function formatKeys(keys,options={}){return keys.length===0?"":formatKeyText(keys.join("/"),options)}function keyText(keybinding){return formatKeys(
1149
- getKeybindings().getKeys(keybinding))}function keyDisplayText(keybinding){return formatKeys(getKeybindings().getKeys(keybinding),{capitalize:!0})}function keyHint(keybinding,description){return theme.fg("dim",keyText(keybinding))+theme.fg("muted",` ${description}`)}function rawKeyHint(key,description){return theme.fg("dim",formatKeyText(key))+theme.fg("muted",` ${description}`)}export{F,fuzzyMatch,fuzzyFilter,visibleWidth,wrapTextWithAnsi,truncateToWidth,sliceByColumn,CombinedAutocompleteProvider,indexedColor,rgbColor,parseColor,colorToRgb,mixColors,foregroundAnsi,backgroundAnsi,Key,matchesKey,detectCapabilities,getCapabilities,getTerminalColorMode,setCapabilityOverrides,getImageDimensions,hyperlink,imageFallback,Container,isViewportTUI,Box,TUI_KEYBINDINGS,KeybindingsManager,setKeybindings,getKeybindings,Text,Loader,CancellableLoader,SelectList,Editor,setImageTranscoder,
1149
+ getKeybindings().getKeys(keybinding))}function keyDisplayText(keybinding){return formatKeys(getKeybindings().getKeys(keybinding),{capitalize:!0})}function keyHint(keybinding,description){return theme.fg("dim",keyText(keybinding))+theme.fg("muted",` ${description}`)}function rawKeyHint(key,description){return theme.fg("dim",formatKeyText(key))+theme.fg("muted",` ${description}`)}export{F,fuzzyMatch,fuzzyFilter,visibleWidth,wrapTextWithAnsi,truncateToWidth,sliceByColumn,CombinedAutocompleteProvider,indexedColor,rgbColor,parseColor,colorToRgb,mixColors,foregroundAnsi,backgroundAnsi,styleText,Key,matchesKey,detectCapabilities,getCapabilities,getTerminalColorMode,setCapabilityOverrides,getImageDimensions,hyperlink,imageFallback,Container,isViewportTUI,Box,TUI_KEYBINDINGS,KeybindingsManager,setKeybindings,getKeybindings,Text,Loader,CancellableLoader,SelectList,Editor,setImageTranscoder,
1150
1150
  Image,Input,Markdown,MouseRegion,ScrollView,SettingsList,Spacer,TruncatedText,VStack,getNativeClipboard,ProcessTerminal,TuiAltScreen,TuiMainScreen,dist_exports,source_default,FS_WATCH_RETRY_DELAY_MS,closeWatcher,watchWithErrorHandler,loadAllHighlightLanguages,SYSTEM_THEME_NAME,DEFAULT_THEME_NAME,setThemeJsonValidator,setTerminalColors,setTerminalColorScheme,markTerminalColorsPending,Theme,getAvailableThemes,getAvailableThemesWithPaths,loadThemeFromPath,getThemeByName,parseAutoThemeSetting,resolveThemeSetting,
1151
1151
  getTerminalTheme,theme,setRegisteredThemes,initTheme,setTheme,setThemeInstance,onThemeChange,stopThemeWatcher,getResolvedThemeColors,getThemeExportColors,highlightCode,getLanguageFromPath,getMarkdownTheme,getSelectListTheme,getEditorTheme,getSettingsListTheme,formatKeyText,keyText,keyDisplayText,keyHint,rawKeyHint};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{VisualLinePreview,formatSize,formatToolCallWithArgs,getShellConfig,getTextOutput,replaceTabs,truncateMiddle,writeOutputFile}from"./chunk-RCJ2GKUP.js";import{Container,Spacer,Text,keyHint}from"./chunk-6FTYU7I7.js";import{getAgentDir,getFileRevision,normalizePath,require_isexe,stripBom}from"./chunk-ANSL5PYD.js";import{__commonJS,__require,__toESM}from"./chunk-JXWJOIH4.js";var require_polyfills=__commonJS({"node_modules/graceful-fs/polyfills.js"(exports,module){var constants=__require("constants"),origCwd=process.cwd,cwd=null,platform=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cwd||(cwd=origCwd.call(process)),cwd};try{process.cwd()}catch{}typeof process.chdir=="function"&&(chdir=process.chdir,process.chdir=function(d){cwd=null,chdir.call(process,d)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,chdir));var chdir;module.
2
+ import{VisualLinePreview,formatSize,formatToolCallWithArgs,getShellConfig,getTextOutput,replaceTabs,truncateMiddle,writeOutputFile}from"./chunk-OXJXKCLB.js";import{Container,Spacer,Text,keyHint}from"./chunk-ICLZNV4V.js";import{getAgentDir,getFileRevision,normalizePath,require_cross_spawn,stripBom}from"./chunk-DUZY4PDA.js";import{__commonJS,__require,__toESM}from"./chunk-JXWJOIH4.js";var require_polyfills=__commonJS({"node_modules/graceful-fs/polyfills.js"(exports,module){var constants=__require("constants"),origCwd=process.cwd,cwd=null,platform=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cwd||(cwd=origCwd.call(process)),cwd};try{process.cwd()}catch{}typeof process.chdir=="function"&&(chdir=process.chdir,process.chdir=function(d){cwd=null,chdir.call(process,d)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,chdir));var chdir;module.
3
3
  exports=patch;function patch(fs){constants.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&patchLchmod(fs),fs.lutimes||patchLutimes(fs),fs.chown=chownFix(fs.chown),fs.fchown=chownFix(fs.fchown),fs.lchown=chownFix(fs.lchown),fs.chmod=chmodFix(fs.chmod),fs.fchmod=chmodFix(fs.fchmod),fs.lchmod=chmodFix(fs.lchmod),fs.chownSync=chownFixSync(fs.chownSync),fs.fchownSync=chownFixSync(fs.fchownSync),fs.lchownSync=chownFixSync(fs.lchownSync),fs.chmodSync=chmodFixSync(fs.chmodSync),
4
4
  fs.fchmodSync=chmodFixSync(fs.fchmodSync),fs.lchmodSync=chmodFixSync(fs.lchmodSync),fs.stat=statFix(fs.stat),fs.fstat=statFix(fs.fstat),fs.lstat=statFix(fs.lstat),fs.statSync=statFixSync(fs.statSync),fs.fstatSync=statFixSync(fs.fstatSync),fs.lstatSync=statFixSync(fs.lstatSync),fs.chmod&&!fs.lchmod&&(fs.lchmod=function(path,mode,cb){cb&&process.nextTick(cb)},fs.lchmodSync=function(){}),fs.chown&&!fs.lchown&&(fs.lchown=function(path,uid,gid,cb){cb&&process.nextTick(cb)},fs.lchownSync=function(){}),
5
5
  platform==="win32"&&(fs.rename=typeof fs.rename!="function"?fs.rename:(function(fs$rename){function rename(from,to,cb){var start=Date.now(),backoff=0;fs$rename(from,to,function CB(er){if(er&&(er.code==="EACCES"||er.code==="EPERM"||er.code==="EBUSY")&&Date.now()-start<6e4){setTimeout(function(){fs.stat(to,function(stater,st){stater&&stater.code==="ENOENT"?fs$rename(from,to,CB):cb(er)})},backoff),backoff<100&&(backoff+=10);return}cb&&cb(er)})}return Object.setPrototypeOf&&Object.setPrototypeOf(rename,
@@ -56,18 +56,7 @@ options={stale:1e4,realpath:!0,fs,...options},options.stale=Math.max(options.sta
56
56
  lock=lock;module.exports.unlock=unlock;module.exports.check=check;module.exports.getLocks=getLocks}});var require_adapter=__commonJS({"node_modules/proper-lockfile/lib/adapter.js"(exports,module){"use strict";var fs=require_graceful_fs();function createSyncFs(fs2){let methods=["mkdir","realpath","stat","rmdir","utimes"],newFs={...fs2};return methods.forEach(method=>{newFs[method]=(...args)=>{let callback=args.pop(),ret;try{ret=fs2[`${method}Sync`](...args)}catch(err){return callback(err)}callback(null,ret)}}),newFs}function toPromise(method){return(...args)=>new Promise((resolve,reject)=>{args.push(
57
57
  (err,result)=>{err?reject(err):resolve(result)}),method(...args)})}function toSync(method){return(...args)=>{let err,result;if(args.push((_err,_result)=>{err=_err,result=_result}),method(...args),err)throw err;return result}}function toSyncOptions(options){if(options={...options},options.fs=createSyncFs(options.fs||fs),typeof options.retries=="number"&&options.retries>0||options.retries&&typeof options.retries.retries=="number"&&options.retries.retries>0)throw Object.assign(new Error("Cannot use\
58
58
  retries with the sync api"),{code:"ESYNC"});return options}module.exports={toPromise,toSync,toSyncOptions}}});var require_proper_lockfile=__commonJS({"node_modules/proper-lockfile/index.js"(exports,module){"use strict";var lockfile2=require_lockfile(),{toPromise,toSync,toSyncOptions}=require_adapter();async function lock(file,options){let release=await toPromise(lockfile2.lock)(file,options);return toPromise(release)}function lockSync(file,options){let release=toSync(lockfile2.lock)(file,toSyncOptions(options));return toSync(release)}function unlock(file,options){return toPromise(lockfile2.unlock)(file,
59
- options)}function unlockSync(file,options){return toSync(lockfile2.unlock)(file,toSyncOptions(options))}function check(file,options){return toPromise(lockfile2.check)(file,options)}function checkSync(file,options){return toSync(lockfile2.check)(file,toSyncOptions(options))}module.exports=lock;module.exports.lock=lock;module.exports.unlock=unlock;module.exports.lockSync=lockSync;module.exports.unlockSync=unlockSync;module.exports.check=check;module.exports.checkSync=checkSync}});var require_which=__commonJS({"packages/mcp/node_modules/which/which.js"(exports,module){var isWindows=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",path=__require("path"),COLON=isWindows?";":":",isexe=require_isexe(),getNotFoundError=cmd=>Object.assign(new Error(`not found: ${cmd}`),{code:"ENOENT"}),getPathInfo=(cmd,opt)=>{let colon=opt.colon||COLON,pathEnv=cmd.match(/\//)||isWindows&&cmd.match(/\\/)?[""]:[...isWindows?[process.cwd()]:[],...(opt.path||process.
60
- env.PATH||"").split(colon)],pathExtExe=isWindows?opt.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",pathExt=isWindows?pathExtExe.split(colon):[""];return isWindows&&cmd.indexOf(".")!==-1&&pathExt[0]!==""&&pathExt.unshift(""),{pathEnv,pathExt,pathExtExe}},which=(cmd,opt,cb)=>{typeof opt=="function"&&(cb=opt,opt={}),opt||(opt={});let{pathEnv,pathExt,pathExtExe}=getPathInfo(cmd,opt),found=[],step=i=>new Promise((resolve,reject)=>{if(i===pathEnv.length)return opt.all&&found.length?resolve(found):
61
- reject(getNotFoundError(cmd));let ppRaw=pathEnv[i],pathPart=/^".*"$/.test(ppRaw)?ppRaw.slice(1,-1):ppRaw,pCmd=path.join(pathPart,cmd),p=!pathPart&&/^\.[\\\/]/.test(cmd)?cmd.slice(0,2)+pCmd:pCmd;resolve(subStep(p,i,0))}),subStep=(p,i,ii)=>new Promise((resolve,reject)=>{if(ii===pathExt.length)return resolve(step(i+1));let ext=pathExt[ii];isexe(p+ext,{pathExt:pathExtExe},(er,is)=>{if(!er&&is)if(opt.all)found.push(p+ext);else return resolve(p+ext);return resolve(subStep(p,i,ii+1))})});return cb?step(
62
- 0).then(res=>cb(null,res),cb):step(0)},whichSync=(cmd,opt)=>{opt=opt||{};let{pathEnv,pathExt,pathExtExe}=getPathInfo(cmd,opt),found=[];for(let i=0;i<pathEnv.length;i++){let ppRaw=pathEnv[i],pathPart=/^".*"$/.test(ppRaw)?ppRaw.slice(1,-1):ppRaw,pCmd=path.join(pathPart,cmd),p=!pathPart&&/^\.[\\\/]/.test(cmd)?cmd.slice(0,2)+pCmd:pCmd;for(let j=0;j<pathExt.length;j++){let cur=p+pathExt[j];try{if(isexe.sync(cur,{pathExt:pathExtExe}))if(opt.all)found.push(cur);else return cur}catch{}}}if(opt.all&&found.
63
- length)return found;if(opt.nothrow)return null;throw getNotFoundError(cmd)};module.exports=which;which.sync=whichSync}});var require_path_key=__commonJS({"packages/mcp/node_modules/path-key/index.js"(exports,module){"use strict";var pathKey=(options={})=>{let environment=options.env||process.env;return(options.platform||process.platform)!=="win32"?"PATH":Object.keys(environment).reverse().find(key=>key.toUpperCase()==="PATH")||"Path"};module.exports=pathKey;module.exports.default=pathKey}});var require_resolveCommand=__commonJS({"packages/mcp/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports,module){"use strict";var path=__require("path"),which=require_which(),getPathKey=require_path_key();function resolveCommandAttempt(parsed,withoutPathExt){let env=parsed.options.env||process.env,cwd=process.cwd(),hasCustomCwd=parsed.options.cwd!=null,shouldSwitchCwd=hasCustomCwd&&process.chdir!==void 0&&!process.chdir.disabled;if(shouldSwitchCwd)try{process.chdir(parsed.options.cwd)}catch{}
64
- let resolved;try{resolved=which.sync(parsed.command,{path:env[getPathKey({env})],pathExt:withoutPathExt?path.delimiter:void 0})}catch{}finally{shouldSwitchCwd&&process.chdir(cwd)}return resolved&&(resolved=path.resolve(hasCustomCwd?parsed.options.cwd:"",resolved)),resolved}function resolveCommand(parsed){return resolveCommandAttempt(parsed)||resolveCommandAttempt(parsed,!0)}module.exports=resolveCommand}});var require_escape=__commonJS({"packages/mcp/node_modules/cross-spawn/lib/util/escape.js"(exports,module){"use strict";var metaCharsRegExp=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(arg){return arg=arg.replace(metaCharsRegExp,"^$1"),arg}function escapeArgument(arg,doubleEscapeMetaChars){return arg=`${arg}`,arg=arg.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),arg=arg.replace(/(?=(\\+?)?)\1$/,"$1$1"),arg=`"${arg}"`,arg=arg.replace(metaCharsRegExp,"^$1"),doubleEscapeMetaChars&&(arg=arg.replace(metaCharsRegExp,
65
- "^$1")),arg}module.exports.command=escapeCommand;module.exports.argument=escapeArgument}});var require_shebang_regex=__commonJS({"packages/mcp/node_modules/shebang-regex/index.js"(exports,module){"use strict";module.exports=/^#!(.*)/}});var require_shebang_command=__commonJS({"packages/mcp/node_modules/shebang-command/index.js"(exports,module){"use strict";var shebangRegex=require_shebang_regex();module.exports=(string="")=>{let match=string.match(shebangRegex);if(!match)return null;let[path,argument]=match[0].replace(/#! ?/,"").split(" "),binary=path.split("/").pop();return binary==="env"?argument:argument?`${binary} ${argument}`:binary}}});var require_readShebang=__commonJS({"packages/mcp/node_modules/cross-spawn/lib/util/readShebang.js"(exports,module){"use strict";var fs=__require("fs"),shebangCommand=require_shebang_command();function readShebang(command){let buffer=Buffer.alloc(150),fd;try{fd=fs.openSync(command,"r"),fs.readSync(fd,buffer,0,150,0),fs.closeSync(fd)}catch{}return shebangCommand(buffer.toString())}module.exports=readShebang}});var require_parse=__commonJS({"packages/mcp/node_modules/cross-spawn/lib/parse.js"(exports,module){"use strict";var path=__require("path"),resolveCommand=require_resolveCommand(),escape=require_escape(),readShebang=require_readShebang(),isWin=process.platform==="win32",isExecutableRegExp=/\.(?:com|exe)$/i,isCmdShimRegExp=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(parsed){parsed.file=resolveCommand(parsed);let shebang=parsed.file&&readShebang(parsed.file);return shebang?(parsed.
66
- args.unshift(parsed.file),parsed.command=shebang,resolveCommand(parsed)):parsed.file}function parseNonShell(parsed){if(!isWin)return parsed;let commandFile=detectShebang(parsed),needsShell=!isExecutableRegExp.test(commandFile);if(parsed.options.forceShell||needsShell){let needsDoubleEscapeMetaChars=isCmdShimRegExp.test(commandFile);parsed.command=path.normalize(parsed.command),parsed.command=escape.command(parsed.command),parsed.args=parsed.args.map(arg=>escape.argument(arg,needsDoubleEscapeMetaChars));
67
- let shellCommand=[parsed.command].concat(parsed.args).join(" ");parsed.args=["/d","/s","/c",`"${shellCommand}"`],parsed.command=process.env.comspec||"cmd.exe",parsed.options.windowsVerbatimArguments=!0}return parsed}function parse(command,args,options){args&&!Array.isArray(args)&&(options=args,args=null),args=args?args.slice(0):[],options=Object.assign({},options);let parsed={command,args,options,file:void 0,original:{command,args}};return options.shell?parsed:parseNonShell(parsed)}module.exports=
68
- parse}});var require_enoent=__commonJS({"packages/mcp/node_modules/cross-spawn/lib/enoent.js"(exports,module){"use strict";var isWin=process.platform==="win32";function notFoundError(original,syscall){return Object.assign(new Error(`${syscall} ${original.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${syscall} ${original.command}`,path:original.command,spawnargs:original.args})}function hookChildProcess(cp,parsed){if(!isWin)return;let originalEmit=cp.emit;cp.emit=function(name,arg1){if(name===
69
- "exit"){let err=verifyENOENT(arg1,parsed);if(err)return originalEmit.call(cp,"error",err)}return originalEmit.apply(cp,arguments)}}function verifyENOENT(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawn"):null}function verifyENOENTSync(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawnSync"):null}module.exports={hookChildProcess,verifyENOENT,verifyENOENTSync,notFoundError}}});var require_cross_spawn=__commonJS({"packages/mcp/node_modules/cross-spawn/index.js"(exports,module){"use strict";var cp=__require("child_process"),parse=require_parse(),enoent=require_enoent();function spawn2(command,args,options){let parsed=parse(command,args,options),spawned=cp.spawn(parsed.command,parsed.args,parsed.options);return enoent.hookChildProcess(spawned,parsed),spawned}function spawnSync2(command,args,options){let parsed=parse(command,args,options),result=cp.spawnSync(parsed.command,
70
- parsed.args,parsed.options);return result.error=result.error||enoent.verifyENOENTSync(result.status,parsed),result}module.exports=spawn2;module.exports.spawn=spawn2;module.exports.sync=spawnSync2;module.exports._parse=parse;module.exports._enoent=enoent}});import{execSync,spawnSync}from"child_process";var commandResultCache=new Map,ENV_VAR_NAME_RE=/^[A-Za-z_][A-Za-z0-9_]*$/,ENV_VAR_NAME_PREFIX_RE=/^[A-Za-z_][A-Za-z0-9_]*/;function appendLiteral(parts,value){if(!value)return;let previousPart=parts[parts.length-1];if(previousPart?.type==="literal"){previousPart.value+=value;return}parts.push({type:"literal",value})}function parseConfigValueTemplate(config){let parts=[],index=0;for(;index<config.length;){let dollarIndex=config.indexOf("$",index);if(dollarIndex<0){appendLiteral(parts,config.slice(
59
+ options)}function unlockSync(file,options){return toSync(lockfile2.unlock)(file,toSyncOptions(options))}function check(file,options){return toPromise(lockfile2.check)(file,options)}function checkSync(file,options){return toSync(lockfile2.check)(file,toSyncOptions(options))}module.exports=lock;module.exports.lock=lock;module.exports.unlock=unlock;module.exports.lockSync=lockSync;module.exports.unlockSync=unlockSync;module.exports.check=check;module.exports.checkSync=checkSync}});import{execSync,spawnSync}from"child_process";var commandResultCache=new Map,ENV_VAR_NAME_RE=/^[A-Za-z_][A-Za-z0-9_]*$/,ENV_VAR_NAME_PREFIX_RE=/^[A-Za-z_][A-Za-z0-9_]*/;function appendLiteral(parts,value){if(!value)return;let previousPart=parts[parts.length-1];if(previousPart?.type==="literal"){previousPart.value+=value;return}parts.push({type:"literal",value})}function parseConfigValueTemplate(config){let parts=[],index=0;for(;index<config.length;){let dollarIndex=config.indexOf("$",index);if(dollarIndex<0){appendLiteral(parts,config.slice(
71
60
  index));break}appendLiteral(parts,config.slice(index,dollarIndex));let nextChar=config[dollarIndex+1];if(nextChar==="$"||nextChar==="!"){appendLiteral(parts,nextChar),index=dollarIndex+2;continue}if(nextChar==="{"){let endIndex=config.indexOf("}",dollarIndex+2);if(endIndex<0){appendLiteral(parts,"$"),index=dollarIndex+1;continue}let name=config.slice(dollarIndex+2,endIndex);ENV_VAR_NAME_RE.test(name)?parts.push({type:"env",name}):appendLiteral(parts,config.slice(dollarIndex,endIndex+1)),index=endIndex+
72
61
  1;continue}let match=config.slice(dollarIndex+1).match(ENV_VAR_NAME_PREFIX_RE);if(match){parts.push({type:"env",name:match[0]}),index=dollarIndex+1+match[0].length;continue}appendLiteral(parts,"$"),index=dollarIndex+1}return parts}function parseConfigValueReference(config){return config.startsWith("!")?{type:"command",config}:{type:"template",parts:parseConfigValueTemplate(config)}}function resolveEnvConfigValue(name,env){return env?.[name]||process.env[name]||void 0}function getTemplateEnvVarNames(parts){
73
62
  let names=[];for(let part of parts)part.type!=="env"||names.includes(part.name)||names.push(part.name);return names}function resolveTemplate(parts,env){let resolved="";for(let part of parts){if(part.type==="literal"){resolved+=part.value;continue}let envValue=resolveEnvConfigValue(part.name,env);if(envValue===void 0)return;resolved+=envValue}return resolved}function getConfigValueEnvVarNames(config){let reference=parseConfigValueReference(config);return reference.type==="template"?getTemplateEnvVarNames(reference.parts):[]}function getMissingConfigValueEnvVarNames(config,env){return getConfigValueEnvVarNames(config).filter(name=>resolveEnvConfigValue(name,env)===void 0)}function isCommandConfigValue(config){return parseConfigValueReference(config).type==="command"}function isConfigValueConfigured(config,env){return getMissingConfigValueEnvVarNames(
@@ -1,5 +1,19 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{ENV_PREFIX,getAgentDir,getPackageDir,isBunBinary,isBunRuntime,isBundledNode}from"./chunk-ANSL5PYD.js";import{Compile}from"./chunk-QMUIATLD.js";import{typebox_exports}from"./chunk-BHM75BJJ.js";var SUBAGENT_WORKER_STATUSES=["queued","waiting","running","completed","failed","cancelled","skipped","unresolved"],SUBAGENT_CANCELLATION_OUTCOMES=["none","not_started","direct_worker_terminated","unconfirmed"],SUBAGENT_FAILURE_KINDS=["spawn_failed","process_error","model_error","merge_failed"],SUBAGENT_RUN_MODES=["single","parallel","chain"];var SUBAGENT_PROGRESS_UUID_PATTERN="^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",SUBAGENT_PROGRESS_IDENTIFIER_PATTERN="^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$",SUBAGENT_PROGRESS_MODEL_PATTERN="^[A-Za-z0-9][A-Za-z0-9._:/@+-]{0,127}$",SUBAGENT_PROGRESS_TOOL_CALL_ID_PATTERN="^[\\x21-\\x7E]{1,256}$",SUBAGENT_PROGRESS_TEXT_PATTERN="^[^\\u0000-\\u001F\\u007F-\\u009F\\u00AD\\u034F\\u061C\\u180E\\u200B-\\u200F\\u2028-\\u202E\\u2060-\\u2069\\uFEFF]+$",UUID_REGEX=new RegExp(SUBAGENT_PROGRESS_UUID_PATTERN),
2
+ import{ENV_PREFIX,getAgentDir,getPackageDir,isBunBinary,isBunRuntime,isBundledNode}from"./chunk-DUZY4PDA.js";import{Compile}from"./chunk-QMUIATLD.js";import{typebox_exports}from"./chunk-BHM75BJJ.js";var FLOW_ID_PATTERN="^[a-z0-9][a-z0-9_.:-]{0,127}$",FLOW_MODEL_ID_PATTERN="^(?=.{1,128}$)[a-z0-9][a-z0-9_.:-]*(?:/[a-z0-9][a-z0-9_.:-]*)?$",FLOW_DIGEST_PATTERN="^[a-f0-9]{64}$",FLOW_TS_PATTERN="^\\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\\d|3[01])T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d{1,9})?(?:Z|[+-](?:[01]\\d|2[0-3]):[0-5]\\d)$",FLOW_CONTRACT_ERROR_CODES={profile_invalid:"Invalid flow profile",admission_invalid:"Invalid flow run admission",event_invalid:"Invalid flow event",command_invalid:"\
3
+ Invalid flow control command",receipt_invalid:"Invalid flow control receipt",status_invalid:"Invalid flow status",digest_mismatch:"Flow digest mismatch",digest_unverifiable:"Flow digest cannot be verified",canonical_invalid:"Flow data cannot be canonicalized",receipt_conflict:"Flow receipt conflicts with the first receipt"},FlowContractError=class extends Error{code;constructor(code){super(FLOW_CONTRACT_ERROR_CODES[code]),this.name="FlowContractError",this.code=code}},lit=(...values)=>typebox_exports.
4
+ Union(values.map(value=>typebox_exports.Literal(value))),StrictObject=properties=>typebox_exports.Object(properties,{additionalProperties:!1}),FlowIdSchema=typebox_exports.String({pattern:FLOW_ID_PATTERN}),FlowDigestSchema=typebox_exports.String({pattern:FLOW_DIGEST_PATTERN}),DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31];function isRealCalendarDate(timestamp){let year=Number(timestamp.slice(0,4)),month=Number(timestamp.slice(5,7)),day=Number(timestamp.slice(8,10)),leap=year%4===0&&year%100!==
5
+ 0||year%400===0;return day<=(month===2&&leap?29:DAYS_IN_MONTH[month-1]??0)}var FlowTimestampSchema=typebox_exports.Refine(typebox_exports.String({pattern:FLOW_TS_PATTERN}),isRealCalendarDate),FlowMicrousdSchema=typebox_exports.Integer({minimum:0,maximum:Number.MAX_SAFE_INTEGER}),FlowCountSchema=typebox_exports.Integer({minimum:0,maximum:Number.MAX_SAFE_INTEGER}),FlowPositiveIntSchema=typebox_exports.Integer({minimum:1,maximum:Number.MAX_SAFE_INTEGER}),FlowModelRefSchema=StrictObject({provider:FlowIdSchema,
6
+ model:typebox_exports.String({pattern:FLOW_MODEL_ID_PATTERN})}),FLOW_ROLES=["scout","worker","implementer","lead","lead_large","architect","reviewer","security_reviewer","qa","triage"],FlowRoleSchema=typebox_exports.Union([typebox_exports.Literal("scout"),typebox_exports.Literal("worker"),typebox_exports.Literal("implementer"),typebox_exports.Literal("lead"),typebox_exports.Literal("lead_large"),typebox_exports.Literal("architect"),typebox_exports.Literal("reviewer"),typebox_exports.Literal("sec\
7
+ urity_reviewer"),typebox_exports.Literal("qa"),typebox_exports.Literal("triage")]),partialByRole=schema=>StrictObject({scout:typebox_exports.Optional(schema),worker:typebox_exports.Optional(schema),implementer:typebox_exports.Optional(schema),lead:typebox_exports.Optional(schema),lead_large:typebox_exports.Optional(schema),architect:typebox_exports.Optional(schema),reviewer:typebox_exports.Optional(schema),security_reviewer:typebox_exports.Optional(schema),qa:typebox_exports.Optional(schema),triage:typebox_exports.
8
+ Optional(schema)});var FlowSizeSchema=typebox_exports.Union([typebox_exports.Literal("small"),typebox_exports.Literal("medium"),typebox_exports.Literal("large")]);var FlowFailureClassSchema=typebox_exports.Union([typebox_exports.Literal("provider_error"),typebox_exports.Literal("rate_limit"),typebox_exports.Literal("timeout"),typebox_exports.Literal("check_failed"),typebox_exports.Literal("review_rejected"),typebox_exports.Literal("qa_failed"),typebox_exports.Literal("budget_stop"),typebox_exports.Literal("cancelled"),typebox_exports.Literal("crash"),typebox_exports.Literal("unsafe_scope"),typebox_exports.Literal("stalled"),typebox_exports.Literal("config\
9
+ _invalid"),typebox_exports.Literal("internal")]),FlowReasonClassSchema=typebox_exports.Union([FlowFailureClassSchema,typebox_exports.Literal("size_underestimated")]),FlowProfileRefSchema=StrictObject({id:FlowIdSchema,version:FlowPositiveIntSchema,digest:FlowDigestSchema});function verifyFlowDigest(hasher,text,expected){let actual;try{actual=hasher.sha256Hex(text)}catch{throw new FlowContractError("digest_unverifiable")}if(typeof actual!="string")throw new FlowContractError("digest_unverifiable");
10
+ return actual===expected}var MAX_SNAPSHOT_DEPTH=16,MAX_SNAPSHOT_NODES=1e4,MAX_SNAPSHOT_STRING=65536;function isIndexKey(key,length){let index=Number(key);return Number.isInteger(index)&&index>=0&&index<length&&String(index)===key}function snapshotValue(value,depth,budget){if(budget.nodes+=1,depth>MAX_SNAPSHOT_DEPTH||budget.nodes>MAX_SNAPSHOT_NODES)throw new Error("bounds");if(value===null||typeof value=="boolean")return value;if(typeof value=="string"){if(value.length>MAX_SNAPSHOT_STRING||!value.
11
+ isWellFormed())throw new Error("string");return value}if(typeof value=="number"){if(!Number.isFinite(value))throw new Error("number");return value}if(typeof value!="object")throw new Error("type");if(Array.isArray(value)){let length=value.length;if(length>MAX_SNAPSHOT_NODES)throw new Error("bounds");for(let key of Reflect.ownKeys(value))if(typeof key!="string"||key!=="length"&&!isIndexKey(key,length))throw new Error("array");let out2=[];for(let index=0;index<length;index+=1){let descriptor=Object.
12
+ getOwnPropertyDescriptor(value,String(index));if(descriptor===void 0||!("value"in descriptor))throw new Error("array");out2.push(snapshotValue(descriptor.value,depth+1,budget))}return out2}let proto=Object.getPrototypeOf(value);if(proto!==null&&Object.getPrototypeOf(proto)!==null)throw new Error("prototype");let out={};for(let key of Reflect.ownKeys(value)){if(typeof key!="string"||!key.isWellFormed())throw new Error("key");let descriptor=Object.getOwnPropertyDescriptor(value,key);if(descriptor===
13
+ void 0||!("value"in descriptor)||descriptor.enumerable!==!0)throw new Error("property");descriptor.value!==void 0&&Object.defineProperty(out,key,{value:snapshotValue(descriptor.value,depth+1,budget),enumerable:!0,writable:!0,configurable:!0})}return out}function snapshotFlowData(input){return snapshotValue(input,0,{nodes:0})}function parseFlowData(code,input,validate){let snapshot=trySnapshotFlowData(code,input);if(!validate(snapshot))throw new FlowContractError(code);return snapshot}function trySnapshotFlowData(code,input){
14
+ try{return snapshotFlowData(input)}catch{throw new FlowContractError(code)}}function compileFlow(schema){return Compile(schema)}function modelKey(ref){return`${ref.provider}\0${ref.model}`}function hasDuplicateModels(refs){return new Set(refs.map(modelKey)).size!==refs.length}function canonicalFlowJson(value){if(value===null||typeof value=="boolean")return JSON.stringify(value);if(typeof value=="string"){if(!value.isWellFormed())throw new FlowContractError("canonical_invalid");return JSON.stringify(
15
+ value)}if(typeof value=="number"){if(!Number.isFinite(value))throw new FlowContractError("canonical_invalid");return JSON.stringify(value)}if(Array.isArray(value))return`[${value.map(canonicalFlowJson).join(",")}]`;if(typeof value!="object")throw new FlowContractError("canonical_invalid");let record=value,parts=[];for(let key of Object.keys(record).sort()){if(!key.isWellFormed())throw new FlowContractError("canonical_invalid");record[key]!==void 0&&parts.push(`${JSON.stringify(key)}:${canonicalFlowJson(
16
+ record[key])}`)}return`{${parts.join(",")}}`}function canonicalWithout(doc,omit){let copy={...doc};return delete copy[omit],canonicalFlowJson(copy)}var SUBAGENT_WORKER_STATUSES=["queued","waiting","running","completed","failed","cancelled","skipped","unresolved"],SUBAGENT_CANCELLATION_OUTCOMES=["none","not_started","direct_worker_terminated","unconfirmed"],SUBAGENT_FAILURE_KINDS=["spawn_failed","process_error","model_error","merge_failed"],SUBAGENT_RUN_MODES=["single","parallel","chain"];var SUBAGENT_PROGRESS_UUID_PATTERN="^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",SUBAGENT_PROGRESS_IDENTIFIER_PATTERN="^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$",SUBAGENT_PROGRESS_MODEL_PATTERN="^[A-Za-z0-9][A-Za-z0-9._:/@+-]{0,127}$",SUBAGENT_PROGRESS_TOOL_CALL_ID_PATTERN="^[\\x21-\\x7E]{1,256}$",SUBAGENT_PROGRESS_TEXT_PATTERN="^[^\\u0000-\\u001F\\u007F-\\u009F\\u00AD\\u034F\\u061C\\u180E\\u200B-\\u200F\\u2028-\\u202E\\u2060-\\u2069\\uFEFF]+$",UUID_REGEX=new RegExp(SUBAGENT_PROGRESS_UUID_PATTERN),
3
17
  IDENTIFIER_REGEX=new RegExp(SUBAGENT_PROGRESS_IDENTIFIER_PATTERN),MODEL_REGEX=new RegExp(SUBAGENT_PROGRESS_MODEL_PATTERN),TOOL_CALL_ID_REGEX=new RegExp(SUBAGENT_PROGRESS_TOOL_CALL_ID_PATTERN);function isCanonicalSubagentProgressUuid(value){return typeof value=="string"&&value.length===36&&UUID_REGEX.test(value)}var progressTextEncoder=new TextEncoder;function measureSubagentProgressJson(value){let text;try{text=JSON.stringify(value)}catch{throw invalidSnapshot()}if(typeof text!="string")throw invalidSnapshot();
4
18
  return{utf8Bytes:progressTextEncoder.encode(text).length,codeUnits:text.length}}function isForbiddenTextCodeUnit(unit){return unit<=31||unit>=127&&unit<=159||unit===173||unit===847||unit===1564||unit===6158||unit>=8203&&unit<=8207||unit>=8232&&unit<=8238||unit>=8288&&unit<=8297||unit===65279}function isHighSurrogate(unit){return unit>=55296&&unit<=56319}function isLowSurrogate(unit){return unit>=56320&&unit<=57343}function isSubagentPresentationText(value,max){if(typeof value!="string"||value.length===
5
19
  0||value.length>max||value!==value.trim())return!1;for(let i=0;i<value.length;i++){let unit=value.charCodeAt(i);if(isHighSurrogate(unit)){if(!isLowSurrogate(value.charCodeAt(i+1)))return!1;i+=1}else if(isLowSurrogate(unit)||isForbiddenTextCodeUnit(unit))return!1}return!0}var SUBAGENT_PRESENTATION_SCAN_WINDOW_CODE_UNITS=4096,WHITESPACE_UNIT_REGEX=/\s/;function isSeparatorAt(input,index){let unit=input.charCodeAt(index);return isHighSurrogate(unit)?!isLowSurrogate(input.charCodeAt(index+1)):isLowSurrogate(
@@ -17,34 +31,34 @@ if(typeof value!="string"||!pattern.test(value))throw invalidSnapshot();return v
17
31
  cancellationOutcome,SUBAGENT_CANCELLATION_OUTCOMES),agent:readNullablePattern(f.agent,IDENTIFIER_REGEX),label:readNullablePattern(f.label,IDENTIFIER_REGEX),task:readNullableText(f.task,120),model:readNullablePattern(f.model,MODEL_REGEX),startedAt:readNullableInteger(f.startedAt),endedAt:readNullableInteger(f.endedAt),turns:readInteger(f.turns,0),toolCalls:readInteger(f.toolCalls,0),failureKind:readNullableMember(f.failureKind,SUBAGENT_FAILURE_KINDS),resultPreview:readNullableText(f.resultPreview,
18
32
  160)}}function readRun(value){let f=readPlainFields(value,RUN_KEYS);return{runId:readUuid(f.runId),seq:readInteger(f.seq,1),final:readBoolean(f.final),workers:readPlainArray(f.workers,32).map(readWorker),toolCallId:readNullablePattern(f.toolCallId,TOOL_CALL_ID_REGEX),mode:readMember(f.mode,SUBAGENT_RUN_MODES),startedAt:readInteger(f.startedAt,0),endedAt:readNullableInteger(f.endedAt)}}function readEnvelope(value){let f=readPlainFields(value,ENVELOPE_KEYS);if(f.schemaVersion!==1)throw invalidSnapshot();
19
33
  return{schemaVersion:1,runtimeId:readUuid(f.runtimeId),sessionEpoch:readUuid(f.sessionEpoch),complete:readBoolean(f.complete),runs:readPlainArray(f.runs,64).map(readRun)}}function parseSubagentRunSnapshot(value){try{let run=readRun(value);return assertRunInvariants(run),deepFreeze(run)}catch{throw invalidSnapshot()}}function parseSubagentProgressSnapshot(value){try{let snapshot=readEnvelope(value),runIds=new Set,finalized=0;for(let run of snapshot.runs){if(runIds.has(run.runId))throw invalidSnapshot();
20
- runIds.add(run.runId),run.final&&(finalized+=1),assertRunInvariants(run)}if(finalized>16)throw invalidSnapshot();let size=measureSubagentProgressJson(snapshot);if(size.utf8Bytes>4259840||size.codeUnits>4259840)throw invalidSnapshot();return deepFreeze(snapshot)}catch{throw invalidSnapshot()}}function deepFreeze(value){if(value===null||typeof value!="object"||Object.isFrozen(value))return value;Object.freeze(value);for(let child of Object.values(value))deepFreeze(child);return value}var StrictObject=properties=>typebox_exports.Object(properties,{additionalProperties:!1}),PositiveInteger=typebox_exports.Integer({minimum:1,maximum:Number.MAX_SAFE_INTEGER}),NonnegativeInteger=typebox_exports.Integer({minimum:0,maximum:Number.MAX_SAFE_INTEGER}),Digest=typebox_exports.String({pattern:"^[a-f0-9]{64}$"}),ORCHESTRATION_CONTRACT_VERSION=1,ORCHESTRATION_CAPABILITIES=["architect","technical_lead","implementation_fast","implementation_strong","technical_review","security_review"],ORCHESTRATION_EFFORTS=[
34
+ runIds.add(run.runId),run.final&&(finalized+=1),assertRunInvariants(run)}if(finalized>16)throw invalidSnapshot();let size=measureSubagentProgressJson(snapshot);if(size.utf8Bytes>4259840||size.codeUnits>4259840)throw invalidSnapshot();return deepFreeze(snapshot)}catch{throw invalidSnapshot()}}function deepFreeze(value){if(value===null||typeof value!="object"||Object.isFrozen(value))return value;Object.freeze(value);for(let child of Object.values(value))deepFreeze(child);return value}var StrictObject2=properties=>typebox_exports.Object(properties,{additionalProperties:!1}),PositiveInteger=typebox_exports.Integer({minimum:1,maximum:Number.MAX_SAFE_INTEGER}),NonnegativeInteger=typebox_exports.Integer({minimum:0,maximum:Number.MAX_SAFE_INTEGER}),Digest=typebox_exports.String({pattern:"^[a-f0-9]{64}$"}),ORCHESTRATION_CONTRACT_VERSION=1,ORCHESTRATION_CAPABILITIES=["architect","technical_lead","implementation_fast","implementation_strong","technical_review","security_review"],ORCHESTRATION_EFFORTS=[
21
35
  "low","medium","high"],ORCHESTRATION_RISKS=["low","medium","high","critical"],OrchestrationCapabilitySchema=typebox_exports.Union([typebox_exports.Literal(ORCHESTRATION_CAPABILITIES[0]),typebox_exports.Literal(ORCHESTRATION_CAPABILITIES[1]),typebox_exports.Literal(ORCHESTRATION_CAPABILITIES[2]),typebox_exports.Literal(ORCHESTRATION_CAPABILITIES[3]),typebox_exports.Literal(ORCHESTRATION_CAPABILITIES[4]),typebox_exports.Literal(ORCHESTRATION_CAPABILITIES[5])]),OrchestrationEffortSchema=typebox_exports.
22
- Union([typebox_exports.Literal(ORCHESTRATION_EFFORTS[0]),typebox_exports.Literal(ORCHESTRATION_EFFORTS[1]),typebox_exports.Literal(ORCHESTRATION_EFFORTS[2])]),OrchestrationRiskSchema=typebox_exports.Union([typebox_exports.Literal(ORCHESTRATION_RISKS[0]),typebox_exports.Literal(ORCHESTRATION_RISKS[1]),typebox_exports.Literal(ORCHESTRATION_RISKS[2]),typebox_exports.Literal(ORCHESTRATION_RISKS[3])]),OrchestrationPackageSchema=StrictObject({route:typebox_exports.String({minLength:1}),effort:OrchestrationEffortSchema,
23
- contextBudget:PositiveInteger,model:typebox_exports.String({minLength:1}),independentFrom:typebox_exports.Optional(typebox_exports.Array(OrchestrationCapabilitySchema))}),OrchestrationTopologySchema=StrictObject({maxDepth:typebox_exports.Integer({minimum:1,maximum:3}),maxWorkers:typebox_exports.Integer({minimum:1,maximum:16}),maxConcurrent:typebox_exports.Integer({minimum:1,maximum:8}),maxWorktrees:typebox_exports.Integer({minimum:0,maximum:8})}),OrchestrationRunClassSchema=StrictObject({taskClass:typebox_exports.
24
- String({minLength:1}),complexity:typebox_exports.Integer({minimum:1,maximum:10}),risk:OrchestrationRiskSchema,classificationSource:typebox_exports.Union([typebox_exports.Literal("deterministic"),typebox_exports.Literal("classifier"),typebox_exports.Literal("fallback"),typebox_exports.Literal("architect")])}),OrchestrationFeaturesSchema=StrictObject({adaptiveRouting:typebox_exports.Union([typebox_exports.Literal("off"),typebox_exports.Literal("observe"),typebox_exports.Literal("recommend"),typebox_exports.
36
+ Union([typebox_exports.Literal(ORCHESTRATION_EFFORTS[0]),typebox_exports.Literal(ORCHESTRATION_EFFORTS[1]),typebox_exports.Literal(ORCHESTRATION_EFFORTS[2])]),OrchestrationRiskSchema=typebox_exports.Union([typebox_exports.Literal(ORCHESTRATION_RISKS[0]),typebox_exports.Literal(ORCHESTRATION_RISKS[1]),typebox_exports.Literal(ORCHESTRATION_RISKS[2]),typebox_exports.Literal(ORCHESTRATION_RISKS[3])]),OrchestrationPackageSchema=StrictObject2({route:typebox_exports.String({minLength:1}),effort:OrchestrationEffortSchema,
37
+ contextBudget:PositiveInteger,model:typebox_exports.String({minLength:1}),independentFrom:typebox_exports.Optional(typebox_exports.Array(OrchestrationCapabilitySchema))}),OrchestrationTopologySchema=StrictObject2({maxDepth:typebox_exports.Integer({minimum:1,maximum:3}),maxWorkers:typebox_exports.Integer({minimum:1,maximum:16}),maxConcurrent:typebox_exports.Integer({minimum:1,maximum:8}),maxWorktrees:typebox_exports.Integer({minimum:0,maximum:8})}),OrchestrationRunClassSchema=StrictObject2({taskClass:typebox_exports.
38
+ String({minLength:1}),complexity:typebox_exports.Integer({minimum:1,maximum:10}),risk:OrchestrationRiskSchema,classificationSource:typebox_exports.Union([typebox_exports.Literal("deterministic"),typebox_exports.Literal("classifier"),typebox_exports.Literal("fallback"),typebox_exports.Literal("architect")])}),OrchestrationFeaturesSchema=StrictObject2({adaptiveRouting:typebox_exports.Union([typebox_exports.Literal("off"),typebox_exports.Literal("observe"),typebox_exports.Literal("recommend"),typebox_exports.
25
39
  Literal("enforce")]),exploration:typebox_exports.Boolean(),shadowRouting:typebox_exports.Union([typebox_exports.Literal("off"),typebox_exports.Literal("estimate")]),budget:typebox_exports.Union([typebox_exports.Literal("monitor"),typebox_exports.Literal("warn"),typebox_exports.Literal("enforce")]),budgetMicrocents:NonnegativeInteger,timeBudgetMs:NonnegativeInteger,autoMerge:typebox_exports.Literal(!1),destructiveOps:typebox_exports.Literal("deny"),dependencyChanges:typebox_exports.Union([typebox_exports.
26
- Literal("deny"),typebox_exports.Literal("ask")])}),OrchestrationDecisionV1Schema=StrictObject({defaultPackage:typebox_exports.Optional(typebox_exports.Record(typebox_exports.String(),OrchestrationPackageSchema)),recommendedPackage:typebox_exports.Optional(typebox_exports.Record(typebox_exports.String(),OrchestrationPackageSchema)),selected:typebox_exports.Union([typebox_exports.Literal("default"),typebox_exports.Literal("recommended"),typebox_exports.Literal("explored"),typebox_exports.Literal("\
27
- canary")]),sampleCount:NonnegativeInteger,minSamples:PositiveInteger,explored:typebox_exports.Boolean(),canary:typebox_exports.Boolean(),shadowEstimate:typebox_exports.Optional(StrictObject({costMicrocents:NonnegativeInteger,durationMs:NonnegativeInteger}))}),OrchestrationPolicyV1Schema=StrictObject({contractVersion:typebox_exports.Literal(ORCHESTRATION_CONTRACT_VERSION),policyId:Digest,runClass:OrchestrationRunClassSchema,topology:OrchestrationTopologySchema,packages:typebox_exports.Record(typebox_exports.
28
- String(),OrchestrationPackageSchema),agentCapabilities:typebox_exports.Record(typebox_exports.String(),OrchestrationCapabilitySchema),escalation:typebox_exports.Array(OrchestrationCapabilitySchema),verification:StrictObject({depth:typebox_exports.Union([typebox_exports.Literal("none"),typebox_exports.Literal("targeted"),typebox_exports.Literal("broad"),typebox_exports.Literal("full")]),review:typebox_exports.Union([typebox_exports.Literal("off"),typebox_exports.Literal("sampled"),typebox_exports.
29
- Literal("risk_based"),typebox_exports.Literal("always")]),gate:typebox_exports.Union([typebox_exports.Literal("off"),typebox_exports.Literal("on")])}),features:OrchestrationFeaturesSchema,decision:OrchestrationDecisionV1Schema,approvedDependencyChanges:typebox_exports.Optional(typebox_exports.Array(typebox_exports.String({minLength:1})))}),OrchestrationPolicyValidator=Compile(OrchestrationPolicyV1Schema),ORCHESTRATION_CAPABILITY_SET=new Set(ORCHESTRATION_CAPABILITIES);var RunOrchestrationDecisionV1Schema=StrictObject({schemaVersion:typebox_exports.Literal(1),policyId:typebox_exports.Union([Digest,typebox_exports.Null()]),contractVersion:typebox_exports.Literal(ORCHESTRATION_CONTRACT_VERSION),runClass:typebox_exports.Union([OrchestrationRunClassSchema,typebox_exports.Null()]),topology:typebox_exports.Union([OrchestrationTopologySchema,typebox_exports.Null()]),decision:typebox_exports.Union([OrchestrationDecisionV1Schema,typebox_exports.Null()]),degradationReason:typebox_exports.
30
- Union([typebox_exports.Literal("orchestration-unsupported"),typebox_exports.Literal("orchestration-disabled"),typebox_exports.Null()])}),SubagentTaskEventSchema=typebox_exports.Union([StrictObject({type:typebox_exports.Literal("schedule"),taskId:typebox_exports.String(),dependsOn:typebox_exports.Array(typebox_exports.String()),ownerPaths:typebox_exports.Array(typebox_exports.String()),baseRevision:typebox_exports.Optional(typebox_exports.String()),at:NonnegativeInteger}),StrictObject({type:typebox_exports.
31
- Literal("wait"),taskId:typebox_exports.String(),reason:typebox_exports.Literal("concurrency"),at:NonnegativeInteger}),StrictObject({type:typebox_exports.Literal("serialize"),taskId:typebox_exports.String(),after:typebox_exports.Array(typebox_exports.String()),at:NonnegativeInteger}),StrictObject({type:typebox_exports.Literal("start"),taskId:typebox_exports.String(),attempt:PositiveInteger,at:NonnegativeInteger}),StrictObject({type:typebox_exports.Literal("complete"),taskId:typebox_exports.String(),
32
- attempt:PositiveInteger,at:NonnegativeInteger}),StrictObject({type:typebox_exports.Literal("fail"),taskId:typebox_exports.String(),attempt:PositiveInteger,reason:typebox_exports.String(),at:NonnegativeInteger}),StrictObject({type:typebox_exports.Literal("escalate"),taskId:typebox_exports.String(),fromAttempt:PositiveInteger,toAttempt:PositiveInteger,model:typebox_exports.Optional(typebox_exports.String()),thinking:typebox_exports.Optional(typebox_exports.String()),at:NonnegativeInteger}),StrictObject(
33
- {type:typebox_exports.Literal("skip"),taskId:typebox_exports.String(),failedDependency:typebox_exports.String(),at:NonnegativeInteger})]),SubagentTaskEventValidator=Compile(SubagentTaskEventSchema);var SubagentIdentityEnvelopeSchema=StrictObject({taskId:typebox_exports.Optional(typebox_exports.String({minLength:1})),parentTaskId:typebox_exports.Optional(typebox_exports.String({minLength:1})),depth:typebox_exports.Optional(typebox_exports.Integer({minimum:1,maximum:3}))}),ProgressUuid=typebox_exports.String({pattern:SUBAGENT_PROGRESS_UUID_PATTERN,minLength:36,maxLength:36}),Nullable=schema=>typebox_exports.Union([schema,typebox_exports.Null()]),ProgressIdentifier=Nullable(typebox_exports.String(
40
+ Literal("deny"),typebox_exports.Literal("ask")])}),OrchestrationDecisionV1Schema=StrictObject2({defaultPackage:typebox_exports.Optional(typebox_exports.Record(typebox_exports.String(),OrchestrationPackageSchema)),recommendedPackage:typebox_exports.Optional(typebox_exports.Record(typebox_exports.String(),OrchestrationPackageSchema)),selected:typebox_exports.Union([typebox_exports.Literal("default"),typebox_exports.Literal("recommended"),typebox_exports.Literal("explored"),typebox_exports.Literal(
41
+ "canary")]),sampleCount:NonnegativeInteger,minSamples:PositiveInteger,explored:typebox_exports.Boolean(),canary:typebox_exports.Boolean(),shadowEstimate:typebox_exports.Optional(StrictObject2({costMicrocents:NonnegativeInteger,durationMs:NonnegativeInteger}))}),OrchestrationPolicyV1Schema=StrictObject2({contractVersion:typebox_exports.Literal(ORCHESTRATION_CONTRACT_VERSION),policyId:Digest,runClass:OrchestrationRunClassSchema,topology:OrchestrationTopologySchema,packages:typebox_exports.Record(typebox_exports.
42
+ String(),OrchestrationPackageSchema),agentCapabilities:typebox_exports.Record(typebox_exports.String(),OrchestrationCapabilitySchema),escalation:typebox_exports.Array(OrchestrationCapabilitySchema),verification:StrictObject2({depth:typebox_exports.Union([typebox_exports.Literal("none"),typebox_exports.Literal("targeted"),typebox_exports.Literal("broad"),typebox_exports.Literal("full")]),review:typebox_exports.Union([typebox_exports.Literal("off"),typebox_exports.Literal("sampled"),typebox_exports.
43
+ Literal("risk_based"),typebox_exports.Literal("always")]),gate:typebox_exports.Union([typebox_exports.Literal("off"),typebox_exports.Literal("on")])}),features:OrchestrationFeaturesSchema,decision:OrchestrationDecisionV1Schema,approvedDependencyChanges:typebox_exports.Optional(typebox_exports.Array(typebox_exports.String({minLength:1})))}),OrchestrationPolicyValidator=Compile(OrchestrationPolicyV1Schema),ORCHESTRATION_CAPABILITY_SET=new Set(ORCHESTRATION_CAPABILITIES);var RunOrchestrationDecisionV1Schema=StrictObject2({schemaVersion:typebox_exports.Literal(1),policyId:typebox_exports.Union([Digest,typebox_exports.Null()]),contractVersion:typebox_exports.Literal(ORCHESTRATION_CONTRACT_VERSION),runClass:typebox_exports.Union([OrchestrationRunClassSchema,typebox_exports.Null()]),topology:typebox_exports.Union([OrchestrationTopologySchema,typebox_exports.Null()]),decision:typebox_exports.Union([OrchestrationDecisionV1Schema,typebox_exports.Null()]),degradationReason:typebox_exports.
44
+ Union([typebox_exports.Literal("orchestration-unsupported"),typebox_exports.Literal("orchestration-disabled"),typebox_exports.Null()])}),SubagentTaskEventSchema=typebox_exports.Union([StrictObject2({type:typebox_exports.Literal("schedule"),taskId:typebox_exports.String(),dependsOn:typebox_exports.Array(typebox_exports.String()),ownerPaths:typebox_exports.Array(typebox_exports.String()),baseRevision:typebox_exports.Optional(typebox_exports.String()),at:NonnegativeInteger}),StrictObject2({type:typebox_exports.
45
+ Literal("wait"),taskId:typebox_exports.String(),reason:typebox_exports.Literal("concurrency"),at:NonnegativeInteger}),StrictObject2({type:typebox_exports.Literal("serialize"),taskId:typebox_exports.String(),after:typebox_exports.Array(typebox_exports.String()),at:NonnegativeInteger}),StrictObject2({type:typebox_exports.Literal("start"),taskId:typebox_exports.String(),attempt:PositiveInteger,at:NonnegativeInteger}),StrictObject2({type:typebox_exports.Literal("complete"),taskId:typebox_exports.String(),
46
+ attempt:PositiveInteger,at:NonnegativeInteger}),StrictObject2({type:typebox_exports.Literal("fail"),taskId:typebox_exports.String(),attempt:PositiveInteger,reason:typebox_exports.String(),at:NonnegativeInteger}),StrictObject2({type:typebox_exports.Literal("escalate"),taskId:typebox_exports.String(),fromAttempt:PositiveInteger,toAttempt:PositiveInteger,model:typebox_exports.Optional(typebox_exports.String()),thinking:typebox_exports.Optional(typebox_exports.String()),at:NonnegativeInteger}),StrictObject2(
47
+ {type:typebox_exports.Literal("skip"),taskId:typebox_exports.String(),failedDependency:typebox_exports.String(),at:NonnegativeInteger})]),SubagentTaskEventValidator=Compile(SubagentTaskEventSchema);var SubagentIdentityEnvelopeSchema=StrictObject2({taskId:typebox_exports.Optional(typebox_exports.String({minLength:1})),parentTaskId:typebox_exports.Optional(typebox_exports.String({minLength:1})),depth:typebox_exports.Optional(typebox_exports.Integer({minimum:1,maximum:3}))}),ProgressUuid=typebox_exports.String({pattern:SUBAGENT_PROGRESS_UUID_PATTERN,minLength:36,maxLength:36}),Nullable=schema=>typebox_exports.Union([schema,typebox_exports.Null()]),ProgressIdentifier=Nullable(typebox_exports.String(
34
48
  {pattern:SUBAGENT_PROGRESS_IDENTIFIER_PATTERN,minLength:1,maxLength:64})),ProgressModel=Nullable(typebox_exports.String({pattern:SUBAGENT_PROGRESS_MODEL_PATTERN,minLength:1,maxLength:128})),ProgressToolCallId=Nullable(typebox_exports.String({pattern:SUBAGENT_PROGRESS_TOOL_CALL_ID_PATTERN,minLength:1,maxLength:256})),ProgressText=maxLength=>Nullable(typebox_exports.String({pattern:SUBAGENT_PROGRESS_TEXT_PATTERN,minLength:1,maxLength})),SubagentWorkerStatusSchema=typebox_exports.Union([typebox_exports.
35
49
  Literal(SUBAGENT_WORKER_STATUSES[0]),typebox_exports.Literal(SUBAGENT_WORKER_STATUSES[1]),typebox_exports.Literal(SUBAGENT_WORKER_STATUSES[2]),typebox_exports.Literal(SUBAGENT_WORKER_STATUSES[3]),typebox_exports.Literal(SUBAGENT_WORKER_STATUSES[4]),typebox_exports.Literal(SUBAGENT_WORKER_STATUSES[5]),typebox_exports.Literal(SUBAGENT_WORKER_STATUSES[6]),typebox_exports.Literal(SUBAGENT_WORKER_STATUSES[7])]),SubagentCancellationOutcomeSchema=typebox_exports.Union([typebox_exports.Literal(SUBAGENT_CANCELLATION_OUTCOMES[0]),
36
50
  typebox_exports.Literal(SUBAGENT_CANCELLATION_OUTCOMES[1]),typebox_exports.Literal(SUBAGENT_CANCELLATION_OUTCOMES[2]),typebox_exports.Literal(SUBAGENT_CANCELLATION_OUTCOMES[3])]),SubagentFailureKindSchema=typebox_exports.Union([typebox_exports.Literal(SUBAGENT_FAILURE_KINDS[0]),typebox_exports.Literal(SUBAGENT_FAILURE_KINDS[1]),typebox_exports.Literal(SUBAGENT_FAILURE_KINDS[2]),typebox_exports.Literal(SUBAGENT_FAILURE_KINDS[3]),typebox_exports.Null()]),SubagentRunModeSchema=typebox_exports.Union(
37
- [typebox_exports.Literal(SUBAGENT_RUN_MODES[0]),typebox_exports.Literal(SUBAGENT_RUN_MODES[1]),typebox_exports.Literal(SUBAGENT_RUN_MODES[2])]),SubagentWorkerSnapshotSchema=StrictObject({workerId:ProgressUuid,attempt:NonnegativeInteger,status:SubagentWorkerStatusSchema,cancelRequested:typebox_exports.Boolean(),cancellationOutcome:SubagentCancellationOutcomeSchema,agent:ProgressIdentifier,label:ProgressIdentifier,task:ProgressText(120),model:ProgressModel,startedAt:Nullable(NonnegativeInteger),endedAt:Nullable(
38
- NonnegativeInteger),turns:NonnegativeInteger,toolCalls:NonnegativeInteger,failureKind:SubagentFailureKindSchema,resultPreview:ProgressText(160)}),SubagentRunSnapshotSchema=StrictObject({runId:ProgressUuid,seq:PositiveInteger,final:typebox_exports.Boolean(),workers:typebox_exports.Array(SubagentWorkerSnapshotSchema,{maxItems:32}),toolCallId:ProgressToolCallId,mode:SubagentRunModeSchema,startedAt:NonnegativeInteger,endedAt:Nullable(NonnegativeInteger)}),SubagentProgressSnapshotSchema=StrictObject(
39
- {schemaVersion:typebox_exports.Literal(1),runtimeId:ProgressUuid,sessionEpoch:ProgressUuid,complete:typebox_exports.Boolean(),runs:typebox_exports.Array(SubagentRunSnapshotSchema,{maxItems:64})});var HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION=1,HUMAIN_AGENT_ARTIFACT_KINDS=["candidate-patch","dependency-output","source-observation","validation-report"],StrictObject2=properties=>typebox_exports.Object(properties,{additionalProperties:!1}),StableIdentifier=typebox_exports.String({minLength:1,maxLength:256}),PositiveInteger2=typebox_exports.Integer({minimum:1,maximum:Number.MAX_SAFE_INTEGER}),NonnegativeInteger2=typebox_exports.Integer({minimum:0,maximum:Number.MAX_SAFE_INTEGER}),Digest2=typebox_exports.
40
- String({pattern:"^[a-f0-9]{64}$"}),SafeArtifactReference=typebox_exports.String({minLength:1,maxLength:512,pattern:"^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))[A-Za-z0-9._-]+(?:/[A-Za-z0-9._-]+)*$"}),HumainAgentRouteRefSchema=typebox_exports.Union([typebox_exports.Literal("route:fast"),typebox_exports.Literal("route:balanced"),typebox_exports.Literal("route:thorough")]),HumainAgentArtifactSchema=StrictObject2({id:StableIdentifier,kind:typebox_exports.Union([typebox_exports.Literal(HUMAIN_AGENT_ARTIFACT_KINDS[0]),
41
- typebox_exports.Literal(HUMAIN_AGENT_ARTIFACT_KINDS[1]),typebox_exports.Literal(HUMAIN_AGENT_ARTIFACT_KINDS[2]),typebox_exports.Literal(HUMAIN_AGENT_ARTIFACT_KINDS[3])]),reference:SafeArtifactReference,digest:Digest2}),HumainAgentExecutionControlsSchema=StrictObject2({maxConcurrency:typebox_exports.Integer({minimum:1,maximum:16}),maxDepth:typebox_exports.Integer({minimum:1,maximum:16}),depth:typebox_exports.Integer({minimum:0,maximum:16}),timeoutMs:typebox_exports.Integer({minimum:1,maximum:864e5})}),
42
- HumainAgentExecutionClaimSchema=StrictObject2({workUnitId:StableIdentifier,nodeId:StableIdentifier,attemptNumber:PositiveInteger2,attemptFence:PositiveInteger2,segmentFence:PositiveInteger2,routeRef:HumainAgentRouteRefSchema,task:typebox_exports.String({minLength:1,maxLength:1e5}),controls:HumainAgentExecutionControlsSchema,input:StrictObject2({artifacts:typebox_exports.Array(HumainAgentArtifactSchema,{maxItems:16})})}),HumainAgentExecutionRequestSchema=StrictObject2({schemaVersion:typebox_exports.
43
- Literal(HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION),kind:typebox_exports.Literal("execute"),mode:typebox_exports.Union([typebox_exports.Literal("node"),typebox_exports.Literal("workflow")]),invocationId:StableIdentifier,batchId:typebox_exports.Optional(StableIdentifier),claims:typebox_exports.Array(HumainAgentExecutionClaimSchema,{minItems:1,maxItems:8})}),HumainAgentUsageSchema=typebox_exports.Union([StrictObject2({status:typebox_exports.Literal("unknown")}),StrictObject2({status:typebox_exports.Literal(
51
+ [typebox_exports.Literal(SUBAGENT_RUN_MODES[0]),typebox_exports.Literal(SUBAGENT_RUN_MODES[1]),typebox_exports.Literal(SUBAGENT_RUN_MODES[2])]),SubagentWorkerSnapshotSchema=StrictObject2({workerId:ProgressUuid,attempt:NonnegativeInteger,status:SubagentWorkerStatusSchema,cancelRequested:typebox_exports.Boolean(),cancellationOutcome:SubagentCancellationOutcomeSchema,agent:ProgressIdentifier,label:ProgressIdentifier,task:ProgressText(120),model:ProgressModel,startedAt:Nullable(NonnegativeInteger),endedAt:Nullable(
52
+ NonnegativeInteger),turns:NonnegativeInteger,toolCalls:NonnegativeInteger,failureKind:SubagentFailureKindSchema,resultPreview:ProgressText(160)}),SubagentRunSnapshotSchema=StrictObject2({runId:ProgressUuid,seq:PositiveInteger,final:typebox_exports.Boolean(),workers:typebox_exports.Array(SubagentWorkerSnapshotSchema,{maxItems:32}),toolCallId:ProgressToolCallId,mode:SubagentRunModeSchema,startedAt:NonnegativeInteger,endedAt:Nullable(NonnegativeInteger)}),SubagentProgressSnapshotSchema=StrictObject2(
53
+ {schemaVersion:typebox_exports.Literal(1),runtimeId:ProgressUuid,sessionEpoch:ProgressUuid,complete:typebox_exports.Boolean(),runs:typebox_exports.Array(SubagentRunSnapshotSchema,{maxItems:64})});var HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION=1,HUMAIN_AGENT_ARTIFACT_KINDS=["candidate-patch","dependency-output","source-observation","validation-report"],StrictObject3=properties=>typebox_exports.Object(properties,{additionalProperties:!1}),StableIdentifier=typebox_exports.String({minLength:1,maxLength:256}),PositiveInteger2=typebox_exports.Integer({minimum:1,maximum:Number.MAX_SAFE_INTEGER}),NonnegativeInteger2=typebox_exports.Integer({minimum:0,maximum:Number.MAX_SAFE_INTEGER}),Digest2=typebox_exports.
54
+ String({pattern:"^[a-f0-9]{64}$"}),SafeArtifactReference=typebox_exports.String({minLength:1,maxLength:512,pattern:"^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))[A-Za-z0-9._-]+(?:/[A-Za-z0-9._-]+)*$"}),HumainAgentRouteRefSchema=typebox_exports.Union([typebox_exports.Literal("route:fast"),typebox_exports.Literal("route:balanced"),typebox_exports.Literal("route:thorough")]),HumainAgentArtifactSchema=StrictObject3({id:StableIdentifier,kind:typebox_exports.Union([typebox_exports.Literal(HUMAIN_AGENT_ARTIFACT_KINDS[0]),
55
+ typebox_exports.Literal(HUMAIN_AGENT_ARTIFACT_KINDS[1]),typebox_exports.Literal(HUMAIN_AGENT_ARTIFACT_KINDS[2]),typebox_exports.Literal(HUMAIN_AGENT_ARTIFACT_KINDS[3])]),reference:SafeArtifactReference,digest:Digest2}),HumainAgentExecutionControlsSchema=StrictObject3({maxConcurrency:typebox_exports.Integer({minimum:1,maximum:16}),maxDepth:typebox_exports.Integer({minimum:1,maximum:16}),depth:typebox_exports.Integer({minimum:0,maximum:16}),timeoutMs:typebox_exports.Integer({minimum:1,maximum:864e5})}),
56
+ HumainAgentExecutionClaimSchema=StrictObject3({workUnitId:StableIdentifier,nodeId:StableIdentifier,attemptNumber:PositiveInteger2,attemptFence:PositiveInteger2,segmentFence:PositiveInteger2,routeRef:HumainAgentRouteRefSchema,task:typebox_exports.String({minLength:1,maxLength:1e5}),controls:HumainAgentExecutionControlsSchema,input:StrictObject3({artifacts:typebox_exports.Array(HumainAgentArtifactSchema,{maxItems:16})})}),HumainAgentExecutionRequestSchema=StrictObject3({schemaVersion:typebox_exports.
57
+ Literal(HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION),kind:typebox_exports.Literal("execute"),mode:typebox_exports.Union([typebox_exports.Literal("node"),typebox_exports.Literal("workflow")]),invocationId:StableIdentifier,batchId:typebox_exports.Optional(StableIdentifier),claims:typebox_exports.Array(HumainAgentExecutionClaimSchema,{minItems:1,maxItems:8})}),HumainAgentUsageSchema=typebox_exports.Union([StrictObject3({status:typebox_exports.Literal("unknown")}),StrictObject3({status:typebox_exports.Literal(
44
58
  "measured"),totalCalls:typebox_exports.Optional(NonnegativeInteger2),totalTurns:typebox_exports.Optional(NonnegativeInteger2),totalTokens:NonnegativeInteger2,costMicrocents:NonnegativeInteger2})]),HUMAIN_AGENT_EXECUTION_FAILURE_CODES=["adapter_execution_failed","incompatible_adapter_capability","invalid_adapter_result","invalid_execution_request","provider_timeout","provider_unavailable","reused_execution_context","transport_interrupted"],HumainAgentExecutionFailureCodeSchema=typebox_exports.Union(
45
59
  [typebox_exports.Literal(HUMAIN_AGENT_EXECUTION_FAILURE_CODES[0]),typebox_exports.Literal(HUMAIN_AGENT_EXECUTION_FAILURE_CODES[1]),typebox_exports.Literal(HUMAIN_AGENT_EXECUTION_FAILURE_CODES[2]),typebox_exports.Literal(HUMAIN_AGENT_EXECUTION_FAILURE_CODES[3]),typebox_exports.Literal(HUMAIN_AGENT_EXECUTION_FAILURE_CODES[4]),typebox_exports.Literal(HUMAIN_AGENT_EXECUTION_FAILURE_CODES[5]),typebox_exports.Literal(HUMAIN_AGENT_EXECUTION_FAILURE_CODES[6]),typebox_exports.Literal(HUMAIN_AGENT_EXECUTION_FAILURE_CODES[7])]),
46
- OutcomeIdentity={workUnitId:StableIdentifier,nodeId:StableIdentifier,attemptNumber:PositiveInteger2,attemptFence:PositiveInteger2,segmentFence:PositiveInteger2},HumainAgentExecutionOutcomeSchema=typebox_exports.Union([StrictObject2({...OutcomeIdentity,kind:typebox_exports.Literal("succeeded"),output:StrictObject2({summary:typebox_exports.String({minLength:1,maxLength:512}),artifacts:typebox_exports.Array(HumainAgentArtifactSchema,{maxItems:16})}),usage:HumainAgentUsageSchema}),StrictObject2({...OutcomeIdentity,
47
- kind:typebox_exports.Literal("failed"),failureCode:HumainAgentExecutionFailureCodeSchema,usage:HumainAgentUsageSchema}),StrictObject2({...OutcomeIdentity,kind:typebox_exports.Literal("cancelled"),terminationConfirmed:typebox_exports.Boolean(),usage:HumainAgentUsageSchema})]),HumainAgentExecutionResponseSchema=StrictObject2({schemaVersion:typebox_exports.Literal(HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION),kind:typebox_exports.Literal("result"),mode:typebox_exports.Union([typebox_exports.Literal("node"),
60
+ OutcomeIdentity={workUnitId:StableIdentifier,nodeId:StableIdentifier,attemptNumber:PositiveInteger2,attemptFence:PositiveInteger2,segmentFence:PositiveInteger2},HumainAgentExecutionOutcomeSchema=typebox_exports.Union([StrictObject3({...OutcomeIdentity,kind:typebox_exports.Literal("succeeded"),output:StrictObject3({summary:typebox_exports.String({minLength:1,maxLength:512}),artifacts:typebox_exports.Array(HumainAgentArtifactSchema,{maxItems:16})}),usage:HumainAgentUsageSchema}),StrictObject3({...OutcomeIdentity,
61
+ kind:typebox_exports.Literal("failed"),failureCode:HumainAgentExecutionFailureCodeSchema,usage:HumainAgentUsageSchema}),StrictObject3({...OutcomeIdentity,kind:typebox_exports.Literal("cancelled"),terminationConfirmed:typebox_exports.Boolean(),usage:HumainAgentUsageSchema})]),HumainAgentExecutionResponseSchema=StrictObject3({schemaVersion:typebox_exports.Literal(HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION),kind:typebox_exports.Literal("result"),mode:typebox_exports.Union([typebox_exports.Literal("node"),
48
62
  typebox_exports.Literal("workflow")]),invocationId:StableIdentifier,batchId:typebox_exports.Optional(StableIdentifier),termination:typebox_exports.Union([typebox_exports.Literal("not-requested"),typebox_exports.Literal("confirmed"),typebox_exports.Literal("unconfirmed")]),outcomes:typebox_exports.Array(HumainAgentExecutionOutcomeSchema,{minItems:1,maxItems:8})}),RequestValidator=Compile(HumainAgentExecutionRequestSchema),ResponseValidator=Compile(HumainAgentExecutionResponseSchema),ArtifactReferenceValidator=Compile(
49
63
  SafeArtifactReference);function isSafeHumainAgentExecutionSummary(value){return typeof value=="string"&&value.length>=1&&value.length<=512&&value===value.trim()&&/^[\p{L}\p{N}][\p{L}\p{N} .,;:!?()&'-]*$/u.test(value)&&!/\b(?:[A-Za-z0-9-]+\.)+[A-Za-z]{2,}(?::\d{1,5})?\b/u.test(value)&&!/\b(?:\d{1,3}\.){3}\d{1,3}(?::\d{1,5})?\b/u.test(value)&&!/^(?:rm|curl|wget|sh|bash|zsh|fish|pwsh|powershell|cmd|node|bun|deno|npx|npm|pnpm|yarn|python(?:3)?|perl|ruby|git|docker|kubectl|ssh|scp|sudo|cat|ls|cd|mkdir|touch|chmod|chown|env|export|set|eval|exec)\b/iu.
50
64
  test(value)&&!/\b(?:api[- ]?key|secret|token|credential|password)\s*:/iu.test(value)&&!/\b(?:claude|gpt|gemini|llama|mistral|zai|glm|qwen|deepseek|grok|nova|o\d+)[-_.:][A-Za-z0-9._:-]+\b/iu.test(value)}function parseHumainAgentExecutionRequest(input){if(!RequestValidator.Check(input))throw new Error("Invalid HUMAIN agent execution request");if(input.mode==="node"&&(input.claims.length!==1||input.batchId!==void 0))throw new Error("Invalid HUMAIN agent execution request: node mode requires one cla\
@@ -105,6 +119,7 @@ name,...session.cwd?{cwd:session.cwd}:{},pid:consumer.pid,status:session.status,
105
119
  all),note=[truncated?TRUNCATED_NOTE:void 0,childrenTruncated?TRUNCATED_CHILDREN_NOTE:void 0,this.external.note].filter(note2=>note2!==void 0).join(" ");return{type:"snapshot",agents,coverage:truncated||childrenTruncated||this.external.coverage==="partial"?"partial":"complete",...note?{note}:{}}}schedulePush(){this.pushTimer||this.stopped||(this.pushTimer=setTimeout(()=>{this.pushTimer=void 0,this.push()},this.pushDelayMs))}push(){let snapshot=this.snapshot(),payload=JSON.stringify(snapshot);for(let[
106
120
  socket,consumer]of this.consumers)consumer.lastSent!==payload&&(consumer.lastSent=payload,writeMessage(socket,snapshot))}armIdle(){this.idleTimer||this.stopped||(this.idleTimer=setTimeout(()=>{this.idleTimer=void 0,this.hasViewer()||this.shutdown()},this.idleShutdownMs))}cancelIdle(){this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=void 0}shutdown(){if(!this.stopped){this.stopped=!0,this.cancelIdle(),this.stopScanning(),this.pushTimer&&clearTimeout(this.pushTimer);for(let consumer of this.
107
121
  consumers.values())clearTimeout(consumer.revealTimer);for(let socket of this.connections)socket.destroy();this.serving&&(unlinkQuietly(this.paths.socketPath),unlinkQuietly(this.paths.pidPath)),this.server.close(),this.onExit(0)}}};async function runAgentMonitorCommand(env){let role=env[COORDINATION_ROLE_ENV];if(delete env[COORDINATION_ROLE_ENV],role!==AGENT_MONITOR_ROLE)return console.error("This command is internal to HUMAIN Code CLI."),2;process.stderr.on("error",()=>{}),process.stdout.on("error",()=>{});let server;try{server=new AgentMonitorServer({paths:resolveAgentMonitorPaths(getAgentDir())}),await server.start()}catch(error){return console.error(error instanceof MonitorAlreadyRunningError?error.message:`Agent monit\
108
- or failed to start: ${error instanceof Error?error.message:String(error)}`),1}let stop=()=>server.shutdown();return process.on("SIGTERM",stop),process.on("SIGINT",stop),process.on("SIGHUP",stop),await new Promise(()=>{})}export{COORDINATION_BROKER_COMMAND,COORDINATION_ROLE_ENV,COORDINATION_ROLE,detectLaunchRuntime,getInternalCommandLaunchSpec,getBrokerLaunchSpec,SUBAGENT_FAILURE_KINDS,SUBAGENT_RUN_MODES,SUBAGENT_PROGRESS_IDENTIFIER_PATTERN,SUBAGENT_PROGRESS_MODEL_PATTERN,SUBAGENT_PROGRESS_TOOL_CALL_ID_PATTERN,isCanonicalSubagentProgressUuid,toSubagentPresentationText,parseSubagentRunSnapshot,parseSubagentProgressSnapshot,HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION,HumainAgentRouteRefSchema,HumainAgentArtifactSchema,HumainAgentExecutionControlsSchema,
109
- HumainAgentExecutionClaimSchema,HumainAgentExecutionRequestSchema,HumainAgentUsageSchema,HUMAIN_AGENT_EXECUTION_FAILURE_CODES,HumainAgentExecutionOutcomeSchema,HumainAgentExecutionResponseSchema,parseHumainAgentExecutionRequest,parseHumainAgentExecutionResponse,COORDINATION_FILE_MODE,COORDINATION_PROTOCOL_NAME,COORDINATION_PROTOCOL_VERSION,MAX_MESSAGE_TEXT_BYTES,getCoordinationRuntimePaths,resolveCoordinationRuntimePaths,assertSafeAncestors,assertCanonicalRuntimeDir,ensureRuntimeDir,ensureCoordinationRuntimeDir,
110
- assertPrivateSocket,restrictRuntimeFile,AGENT_MONITOR_PROTOCOL,AGENT_MONITOR_COMMAND,AGENT_MONITOR_ROLE,MAX_SNAPSHOT_FRAME_BYTES,MAX_CHILDREN,MAX_ID,resolveAgentMonitorPaths,parseSnapshot,MAX_RUNTIME_TEXT_FILE_BYTES,fsyncDirectory,writeJsonAtomic,writeTextAtomic,createFileExclusive,readBoundedTextFile,readTextFile,readJsonFile,framePayloadBytes,writeMessage,createMessageReader,runAgentMonitorCommand};
122
+ or failed to start: ${error instanceof Error?error.message:String(error)}`),1}let stop=()=>server.shutdown();return process.on("SIGTERM",stop),process.on("SIGINT",stop),process.on("SIGHUP",stop),await new Promise(()=>{})}export{COORDINATION_BROKER_COMMAND,COORDINATION_ROLE_ENV,COORDINATION_ROLE,detectLaunchRuntime,getInternalCommandLaunchSpec,getBrokerLaunchSpec,FLOW_ID_PATTERN,FLOW_MODEL_ID_PATTERN,FlowContractError,lit,StrictObject,FlowIdSchema,FlowDigestSchema,FlowTimestampSchema,FlowMicrousdSchema,FlowCountSchema,FlowPositiveIntSchema,FlowModelRefSchema,FLOW_ROLES,FlowRoleSchema,partialByRole,FlowSizeSchema,FlowFailureClassSchema,FlowReasonClassSchema,FlowProfileRefSchema,verifyFlowDigest,parseFlowData,compileFlow,
123
+ hasDuplicateModels,canonicalFlowJson,canonicalWithout,SUBAGENT_FAILURE_KINDS,SUBAGENT_RUN_MODES,SUBAGENT_PROGRESS_IDENTIFIER_PATTERN,SUBAGENT_PROGRESS_MODEL_PATTERN,SUBAGENT_PROGRESS_TOOL_CALL_ID_PATTERN,isCanonicalSubagentProgressUuid,toSubagentPresentationText,parseSubagentRunSnapshot,parseSubagentProgressSnapshot,HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION,HumainAgentRouteRefSchema,HumainAgentArtifactSchema,HumainAgentExecutionControlsSchema,HumainAgentExecutionClaimSchema,HumainAgentExecutionRequestSchema,
124
+ HumainAgentUsageSchema,HUMAIN_AGENT_EXECUTION_FAILURE_CODES,HumainAgentExecutionOutcomeSchema,HumainAgentExecutionResponseSchema,parseHumainAgentExecutionRequest,parseHumainAgentExecutionResponse,COORDINATION_FILE_MODE,COORDINATION_PROTOCOL_NAME,COORDINATION_PROTOCOL_VERSION,MAX_MESSAGE_TEXT_BYTES,getCoordinationRuntimePaths,resolveCoordinationRuntimePaths,assertSafeAncestors,assertCanonicalRuntimeDir,ensureRuntimeDir,ensureCoordinationRuntimeDir,assertPrivateSocket,restrictRuntimeFile,AGENT_MONITOR_PROTOCOL,
125
+ AGENT_MONITOR_COMMAND,AGENT_MONITOR_ROLE,MAX_SNAPSHOT_FRAME_BYTES,MAX_CHILDREN,MAX_ID,resolveAgentMonitorPaths,parseSnapshot,MAX_RUNTIME_TEXT_FILE_BYTES,fsyncDirectory,writeJsonAtomic,writeTextAtomic,createFileExclusive,readBoundedTextFile,readTextFile,readJsonFile,framePayloadBytes,writeMessage,createMessageReader,runAgentMonitorCommand};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{Text,getCapabilities,getImageDimensions,hyperlink,imageFallback,truncateToWidth}from"./chunk-6FTYU7I7.js";import{getBinDir,resolvePath}from"./chunk-ANSL5PYD.js";import{existsSync}from"node:fs";import{delimiter,join}from"node:path";import{spawn,spawnSync}from"child_process";function isLegacyWslBashPath(path){let normalized=path.replace(/\//g,"\\").toLowerCase();return/^[a-z]:\\windows\\(?:system32|sysnative)\\bash\.exe$/.test(normalized)}function getBashShellConfig(shell){return isLegacyWslBashPath(shell)?{shell,args:["-s"],commandTransport:"stdin"}:{shell,args:["-c"]}}function findExecutableOnPath(executable){if(process.platform==="win32"){try{let result=spawnSync("where",[executable],{encoding:"utf-8",timeout:5e3,windowsHide:!0});if(result.status===0&&result.stdout){
2
+ import{Text,getCapabilities,getImageDimensions,hyperlink,imageFallback,truncateToWidth}from"./chunk-ICLZNV4V.js";import{getBinDir,resolvePath}from"./chunk-DUZY4PDA.js";import{existsSync}from"node:fs";import{delimiter,join}from"node:path";import{spawn,spawnSync}from"child_process";function isLegacyWslBashPath(path){let normalized=path.replace(/\//g,"\\").toLowerCase();return/^[a-z]:\\windows\\(?:system32|sysnative)\\bash\.exe$/.test(normalized)}function getBashShellConfig(shell){return isLegacyWslBashPath(shell)?{shell,args:["-s"],commandTransport:"stdin"}:{shell,args:["-c"]}}function findExecutableOnPath(executable){if(process.platform==="win32"){try{let result=spawnSync("where",[executable],{encoding:"utf-8",timeout:5e3,windowsHide:!0});if(result.status===0&&result.stdout){
3
3
  let firstMatch=result.stdout.trim().split(/\r?\n/)[0];if(firstMatch&&existsSync(firstMatch))return firstMatch}}catch{}return null}try{let result=spawnSync("which",[executable],{encoding:"utf-8",timeout:5e3});if(result.status===0&&result.stdout){let firstMatch=result.stdout.trim().split(/\r?\n/)[0];if(firstMatch)return firstMatch}}catch{}return null}function getShellConfig(customShellPath){if(customShellPath){if(existsSync(customShellPath))return getBashShellConfig(customShellPath);throw new Error(
4
4
  `Custom shell path not found: ${customShellPath}`)}if(process.platform==="win32"){let paths=[],programFiles=process.env.ProgramFiles;programFiles&&paths.push(`${programFiles}\\Git\\bin\\bash.exe`);let programFilesX86=process.env["ProgramFiles(x86)"];programFilesX86&&paths.push(`${programFilesX86}\\Git\\bin\\bash.exe`);for(let path of paths)if(existsSync(path))return getBashShellConfig(path);let bashOnPath2=findExecutableOnPath("bash.exe");if(bashOnPath2)return getBashShellConfig(bashOnPath2);throw new Error(
5
5
  `No bash shell found. Options:
@@ -107,9 +107,9 @@ let struct2=this.getSchema();if(this.isStructSchema()&&struct2[4].includes(membe
107
107
  if(this.isStructSchema()){for(let[memberName,memberSchema]of this.structIterator())if(memberSchema.isStreaming()&&memberSchema.isStructSchema())return memberName}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");let struct2=this.getSchema(),z=struct2[4].length,it=struct2[anno.it];if(it&&z===it.length){yield*it;return}it=Array(z);for(let i=0;i<z;++i){let k=struct2[4][i],v=member([struct2[5][i],
108
108
  0],k);yield it[i]=[k,v]}struct2[anno.it]=it}};isMemberSchema=sc=>Array.isArray(sc)&&sc.length===2,isStaticSchema=sc=>Array.isArray(sc)&&sc.length>=5}});var SimpleSchema,sim,simAdapter,init_SimpleSchema=__esm({"node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js"(){init_Schema();SimpleSchema=class _SimpleSchema extends Schema{static symbol=Symbol.for("@smithy/sim");schemaRef;symbol=_SimpleSchema.symbol},sim=(namespace,name,schemaRef,traits)=>Schema.assign(new SimpleSchema,{name,namespace,traits,schemaRef}),simAdapter=(namespace,name,traits,schemaRef)=>Schema.assign(new SimpleSchema,{name,namespace,traits,schemaRef})}});var SCHEMA,init_sentinels=__esm({"node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js"(){SCHEMA={BLOB:21,STREAMING_BLOB:42,BOOLEAN:2,STRING:0,NUMERIC:1,BIG_INTEGER:17,BIG_DECIMAL:19,DOCUMENT:15,TIMESTAMP_DEFAULT:4,TIMESTAMP_DATE_TIME:5,TIMESTAMP_HTTP_DATE:6,TIMESTAMP_EPOCH_SECONDS:7,LIST_MODIFIER:64,MAP_MODIFIER:128}}});var TypeRegistry,init_TypeRegistry=__esm({"node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js"(){TypeRegistry=class _TypeRegistry{namespace;schemas;exceptions;static registries=new Map;constructor(namespace,schemas=new Map,exceptions=new Map){this.namespace=namespace,this.schemas=schemas,this.exceptions=exceptions,_TypeRegistry.registries.has(namespace)||_TypeRegistry.registries.set(namespace,this)}static for(namespace){return _TypeRegistry.registries.get(namespace)??new _TypeRegistry(
109
109
  namespace)}copyFrom(other){let{schemas,exceptions}=this;for(let[k,v]of other.schemas)schemas.has(k)||schemas.set(k,v);for(let[k,v]of other.exceptions)exceptions.has(k)||exceptions.set(k,v)}register(shapeId,schema){let qualifiedName=this.normalizeShapeId(shapeId);for(let r of[this,_TypeRegistry.for(qualifiedName.split("#")[0])])r.schemas.has(qualifiedName)||r.schemas.set(qualifiedName,schema)}getSchema(shapeId){let id=this.normalizeShapeId(shapeId);if(!this.schemas.has(id)){if(!shapeId.includes("\
110
- #")){let suffix="#"+shapeId,candidates=[];for(let[shapeId2,schema]of this.schemas.entries())shapeId2.endsWith(suffix)&&candidates.push(schema);if(candidates.length===1)return candidates[0]}throw new Error(`@smithy/core/schema - schema not found for ${id}`)}return this.schemas.get(id)}registerError(es,ctor){let $error=es,ns=$error[1],qualifiedName=ns+"#"+$error[2];for(let r of[this,_TypeRegistry.for(ns)])!r.schemas.has(qualifiedName)&&!r.exceptions.has($error)&&(r.schemas.set(qualifiedName,$error),
111
- r.exceptions.set($error,ctor))}getErrorCtor(es){let $error=es;return this.exceptions.has($error)?this.exceptions.get($error):_TypeRegistry.for($error[1]).exceptions.get($error)}getBaseException(){for(let exceptionKey of this.exceptions.keys())if(Array.isArray(exceptionKey)){let[,ns,name]=exceptionKey,id=ns+"#"+name;if(id.startsWith("smithy.ts.sdk.synthetic.")&&id.endsWith("ServiceException"))return exceptionKey}}find(predicate){for(let schema of this.schemas.values())if(predicate(schema))return schema}clear(){
112
- this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(shapeId){return shapeId.includes("#")?shapeId:this.namespace+"#"+shapeId}}}});var schema_exports={};__export(schema_exports,{ErrorSchema:()=>ErrorSchema,ListSchema:()=>ListSchema,MapSchema:()=>MapSchema,NormalizedSchema:()=>NormalizedSchema,OperationSchema:()=>OperationSchema,SCHEMA:()=>SCHEMA,Schema:()=>Schema,SimpleSchema:()=>SimpleSchema,StructureSchema:()=>StructureSchema,TypeRegistry:()=>TypeRegistry,deref:()=>deref,deserializerMiddlewareOption:()=>deserializerMiddlewareOption,error:()=>error,getSchemaSerdePlugin:()=>getSchemaSerdePlugin,isStaticSchema:()=>isStaticSchema,
110
+ #")){let suffix="#"+shapeId,candidates=[];for(let[shapeId2,schema]of this.schemas.entries())shapeId2.endsWith(suffix)&&candidates.push(schema);if(candidates.length===1)return candidates[0]}throw new Error(`@smithy/core/schema - schema not found for ${id}`)}return this.schemas.get(id)}registerError(es,ctor){let $error=es,ns=$error[1],qualifiedName=ns+"#"+$error[2];ctor.hasOwnProperty?.("shapeId")||(ctor.shapeId=qualifiedName);for(let r of[this,_TypeRegistry.for(ns)])!r.schemas.has(qualifiedName)&&
111
+ !r.exceptions.has($error)&&(r.schemas.set(qualifiedName,$error),r.exceptions.set($error,ctor))}getErrorCtor(es){let $error=es;return this.exceptions.has($error)?this.exceptions.get($error):_TypeRegistry.for($error[1]).exceptions.get($error)}getBaseException(){for(let exceptionKey of this.exceptions.keys())if(Array.isArray(exceptionKey)){let[,ns,name]=exceptionKey,id=ns+"#"+name;if(id.startsWith("smithy.ts.sdk.synthetic.")&&id.endsWith("ServiceException"))return exceptionKey}}find(predicate){for(let schema of this.
112
+ schemas.values())if(predicate(schema))return schema}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(shapeId){return shapeId.includes("#")?shapeId:this.namespace+"#"+shapeId}}}});var schema_exports={};__export(schema_exports,{ErrorSchema:()=>ErrorSchema,ListSchema:()=>ListSchema,MapSchema:()=>MapSchema,NormalizedSchema:()=>NormalizedSchema,OperationSchema:()=>OperationSchema,SCHEMA:()=>SCHEMA,Schema:()=>Schema,SimpleSchema:()=>SimpleSchema,StructureSchema:()=>StructureSchema,TypeRegistry:()=>TypeRegistry,deref:()=>deref,deserializerMiddlewareOption:()=>deserializerMiddlewareOption,error:()=>error,getSchemaSerdePlugin:()=>getSchemaSerdePlugin,isStaticSchema:()=>isStaticSchema,
113
113
  list:()=>list,map:()=>map,op:()=>op,operation:()=>operation,serializerMiddlewareOption:()=>serializerMiddlewareOption,sim:()=>sim,simAdapter:()=>simAdapter,simpleSchemaCacheN:()=>simpleSchemaCacheN,simpleSchemaCacheS:()=>simpleSchemaCacheS,struct:()=>struct,traitsCache:()=>traitsCache,translateTraits:()=>translateTraits});var init_schema=__esm({"node_modules/@smithy/core/dist-es/submodules/schema/index.js"(){init_deref();init_getSchemaSerdePlugin();init_ListSchema();init_MapSchema();init_OperationSchema();
114
114
  init_operation();init_ErrorSchema();init_NormalizedSchema();init_Schema();init_SimpleSchema();init_StructureSchema();init_sentinels();init_translateTraits();init_TypeRegistry()}});function schemaLogFilter(schema,data){if(data==null)return data;let ns=NormalizedSchema.of(schema);if(ns.getMergedTraits().sensitive)return SENSITIVE_STRING;if(ns.isListSchema()){if(!!ns.getValueSchema().getMergedTraits().sensitive)return SENSITIVE_STRING}else if(ns.isMapSchema()){if(!!ns.getKeySchema().getMergedTraits().sensitive||!!ns.getValueSchema().getMergedTraits().sensitive)return SENSITIVE_STRING}else if(ns.isStructSchema()&&typeof data=="object"){let object=data,newObject={};for(let[member2,
115
115
  memberNs]of ns.structIterator())object[member2]!=null&&(newObject[member2]=schemaLogFilter(memberNs,object[member2]));return newObject}return data}var SENSITIVE_STRING,init_schemaLogFilter=__esm({"node_modules/@smithy/core/dist-es/submodules/client/smithy-client/schemaLogFilter.js"(){init_schema();SENSITIVE_STRING="***SensitiveInformation***"}});var import_types7,Command,ClassBuilder,init_command=__esm({"node_modules/@smithy/core/dist-es/submodules/client/smithy-client/command.js"(){import_types7=__toESM(require_dist_cjs());init_MiddlewareStack();init_schemaLogFilter();Command=class{middlewareStack=constructStack();schema;static classBuilder(){return new ClassBuilder}resolveMiddlewareWithContext(clientStack,configuration,options,{middlewareFn,clientName,commandName,inputFilterSensitiveLog,outputFilterSensitiveLog,smithyContext,additionalContext,
@@ -120,10 +120,11 @@ return this._inputFilterSensitiveLog=inputFilter,this._outputFilterSensitiveLog=
120
120
  input=input??{},closure._init(this),this.schema=closure._operationSchema}resolveMiddleware(stack,configuration,options){let op2=closure._operationSchema,input=op2?.[4]??op2?.input,output=op2?.[5]??op2?.output;return this.resolveMiddlewareWithContext(stack,configuration,options,{CommandCtor:CommandRef,middlewareFn:closure._middlewareFn,clientName:closure._clientName,commandName:closure._commandName,inputFilterSensitiveLog:closure._inputFilterSensitiveLog??(op2?schemaLogFilter.bind(null,input):_=>_),
121
121
  outputFilterSensitiveLog:closure._outputFilterSensitiveLog??(op2?schemaLogFilter.bind(null,output):_=>_),smithyContext:closure._smithyContext,additionalContext:closure._additionalContext})}serialize=closure._serializer;deserialize=closure._deserializer}}}}});var SENSITIVE_STRING2,init_constants2=__esm({"node_modules/@smithy/core/dist-es/submodules/client/smithy-client/constants.js"(){SENSITIVE_STRING2="***SensitiveInformation***"}});var createAggregatedClient,init_create_aggregated_client=__esm({"node_modules/@smithy/core/dist-es/submodules/client/smithy-client/create-aggregated-client.js"(){createAggregatedClient=(commands,Client2,options)=>{for(let[command,CommandCtor]of Object.entries(commands)){let methodImpl=async function(args,optionsOrCb,cb){let command2=new CommandCtor(args);if(typeof optionsOrCb=="function")this.send(command2,optionsOrCb);else if(typeof cb=="function"){if(typeof optionsOrCb!="object")throw new Error(
122
122
  `Expected http options but got ${typeof optionsOrCb}`);this.send(command2,optionsOrCb||{},cb)}else return this.send(command2,optionsOrCb)},methodName=(command[0].toLowerCase()+command.slice(1)).replace(/Command$/,"");Client2.prototype[methodName]=methodImpl}let{paginators={},waiters={}}=options??{};for(let[paginatorName,paginatorFn]of Object.entries(paginators))Client2.prototype[paginatorName]===void 0&&(Client2.prototype[paginatorName]=function(commandInput={},paginationConfiguration,...rest){return paginatorFn(
123
- {...paginationConfiguration,client:this},commandInput,...rest)});for(let[waiterName,waiterFn]of Object.entries(waiters))Client2.prototype[waiterName]===void 0&&(Client2.prototype[waiterName]=async function(commandInput={},waiterConfiguration,...rest){let config=waiterConfiguration;return typeof waiterConfiguration=="number"&&(config={maxWaitTime:waiterConfiguration}),waiterFn({...config,client:this},commandInput,...rest)})}}});var ServiceException,decorateServiceException,init_exceptions=__esm({"node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js"(){ServiceException=class _ServiceException extends Error{$fault;$response;$retryable;$metadata;constructor(options){super(options.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=options.name,this.$fault=options.$fault,this.$metadata=options.$metadata}static isInstance(value){if(!value)return!1;let candidate=value;
124
- return _ServiceException.prototype.isPrototypeOf(candidate)||!!candidate.$fault&&!!candidate.$metadata&&(candidate.$fault==="client"||candidate.$fault==="server")}static[Symbol.hasInstance](instance){if(!instance)return!1;let candidate=instance;if(this===_ServiceException)return _ServiceException.isInstance(instance);if(_ServiceException.isInstance(instance)){if(this.prototype.isPrototypeOf(instance))return!0;let targetName=this.name;if(!targetName||!candidate.name)return!1;if(candidate.name===targetName)
125
- return!0;let proto=Object.getPrototypeOf(candidate);for(;proto&&proto!==Object.prototype;){let ctorName=proto.constructor?.name;if(ctorName&&ctorName!=="Error"&&ctorName===targetName)return!0;proto=Object.getPrototypeOf(proto)}return!1}return!1}},decorateServiceException=(exception,additions={})=>{Object.entries(additions).filter(([,v])=>v!==void 0).forEach(([k,v])=>{(exception[k]==null||exception[k]==="")&&(exception[k]=v)});let message=exception.message||exception.Message||"UnknownError";return exception.
126
- message=message,delete exception.Message,exception}}});var throwDefaultError,withBaseException,deserializeMetadata,init_default_error_handler=__esm({"node_modules/@smithy/core/dist-es/submodules/client/smithy-client/default-error-handler.js"(){init_exceptions();throwDefaultError=({output,parsedBody,exceptionCtor,errorCode})=>{let $metadata=deserializeMetadata(output),statusCode=$metadata.httpStatusCode?$metadata.httpStatusCode+"":void 0,response=new exceptionCtor({name:parsedBody?.code||parsedBody?.Code||errorCode||statusCode||"UnknownError",$fault:"\
123
+ {...paginationConfiguration,client:this},commandInput,...rest)});for(let[waiterName,waiterFn]of Object.entries(waiters))Client2.prototype[waiterName]===void 0&&(Client2.prototype[waiterName]=async function(commandInput={},waiterConfiguration,...rest){let config=waiterConfiguration;return typeof waiterConfiguration=="number"&&(config={maxWaitTime:waiterConfiguration}),waiterFn({...config,client:this},commandInput,...rest)})}}});var ServiceException,decorateServiceException,init_exceptions=__esm({"node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js"(){ServiceException=class _ServiceException extends Error{static shapeId="smithy.ts.sdk.synthetic.nonamespace.client#ServiceException";$fault;$response;$retryable;$metadata;constructor(options){super(options.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=options.name,this.$fault=options.$fault,this.
124
+ $metadata=options.$metadata}static isInstance(value){if(!value)return!1;let candidate=value;return _ServiceException.prototype.isPrototypeOf(candidate)||!!candidate.$fault&&!!candidate.$metadata&&(candidate.$fault==="client"||candidate.$fault==="server")}static[Symbol.hasInstance](instance){if(!instance)return!1;let candidate=instance;if(this===_ServiceException)return _ServiceException.isInstance(instance);if(_ServiceException.isInstance(instance)){if(this.prototype.isPrototypeOf(instance))return!0;
125
+ let targetId=Object.prototype.hasOwnProperty.call(this,"shapeId")?this.shapeId:void 0,candidateHasShapeId=!1;if(targetId){let proto=Object.getPrototypeOf(candidate);for(;proto&&proto!==Object.prototype;){let ctor=proto.constructor,candidateId=ctor!==_ServiceException&&Object.prototype.hasOwnProperty.call(ctor,"shapeId")?ctor?.shapeId:void 0;if(candidateId&&(candidateHasShapeId=!0,candidateId===targetId))return!0;proto=Object.getPrototypeOf(proto)}}if(targetId&&candidateHasShapeId)return!1;let targetName=this.
126
+ name;if(targetName&&targetName.length>=6){if(candidate.name===targetName)return!0;let proto=Object.getPrototypeOf(candidate);for(;proto&&proto!==Object.prototype;){let ctorName=proto.constructor?.name;if(ctorName&&ctorName!=="Error"&&ctorName===targetName)return!0;proto=Object.getPrototypeOf(proto)}}}return!1}},decorateServiceException=(exception,additions={})=>{Object.entries(additions).filter(([,v])=>v!==void 0).forEach(([k,v])=>{(exception[k]==null||exception[k]==="")&&(exception[k]=v)});let message=exception.
127
+ message||exception.Message||"UnknownError";return exception.message=message,delete exception.Message,exception}}});var throwDefaultError,withBaseException,deserializeMetadata,init_default_error_handler=__esm({"node_modules/@smithy/core/dist-es/submodules/client/smithy-client/default-error-handler.js"(){init_exceptions();throwDefaultError=({output,parsedBody,exceptionCtor,errorCode})=>{let $metadata=deserializeMetadata(output),statusCode=$metadata.httpStatusCode?$metadata.httpStatusCode+"":void 0,response=new exceptionCtor({name:parsedBody?.code||parsedBody?.Code||errorCode||statusCode||"UnknownError",$fault:"\
127
128
  client",$metadata});throw decorateServiceException(response,parsedBody)},withBaseException=ExceptionCtor=>({output,parsedBody,errorCode})=>{throwDefaultError({output,parsedBody,exceptionCtor:ExceptionCtor,errorCode})},deserializeMetadata=output=>({httpStatusCode:output.statusCode,requestId:output.headers["x-amzn-requestid"]??output.headers["x-amzn-request-id"]??output.headers["x-amz-request-id"],extendedRequestId:output.headers["x-amz-id-2"],cfId:output.headers["x-amz-cf-id"]})}});var loadConfigsForDefaultMode,init_defaults_mode=__esm({"node_modules/@smithy/core/dist-es/submodules/client/smithy-client/defaults-mode.js"(){loadConfigsForDefaultMode=mode=>{switch(mode){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}}}});var warningEmitted,emitWarningIfUnsupportedVersion,init_emitWarningIfUnsupportedVersion=__esm({"node_modules/@smithy/core/dist-es/submodules/client/smithy-client/emitWarningIfUnsupportedVersion.js"(){warningEmitted=!1,emitWarningIfUnsupportedVersion=version=>{version&&!warningEmitted&&parseInt(version.substring(1,version.indexOf(".")))<16&&(warningEmitted=!0)}}});var import_types8,knownAlgorithms,getChecksumConfiguration,resolveChecksumRuntimeConfig,init_checksum=__esm({"node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/checksum.js"(){init_transport();import_types8=__toESM(require_dist_cjs()),knownAlgorithms=Object.values(import_types8.AlgorithmId),getChecksumConfiguration=runtimeConfig=>{let checksumAlgorithms=[];for(let id in import_types8.AlgorithmId){if(!hasOwn(import_types8.AlgorithmId,id))continue;let algorithmId=import_types8.AlgorithmId[id];
128
129
  runtimeConfig[algorithmId]!==void 0&&checksumAlgorithms.push({algorithmId:()=>algorithmId,checksumConstructor:()=>runtimeConfig[algorithmId]})}for(let[id,ChecksumCtor]of Object.entries(runtimeConfig.checksumAlgorithms??{}))checksumAlgorithms.push({algorithmId:()=>id,checksumConstructor:()=>ChecksumCtor});return{addChecksumAlgorithm(algo){runtimeConfig.checksumAlgorithms=runtimeConfig.checksumAlgorithms??{};let id=algo.algorithmId(),ctor=algo.checksumConstructor();knownAlgorithms.includes(id)?runtimeConfig.
129
130
  checksumAlgorithms[id.toUpperCase()]=ctor:runtimeConfig.checksumAlgorithms[id]=ctor,checksumAlgorithms.push(algo)},checksumAlgorithms(){return checksumAlgorithms}}},resolveChecksumRuntimeConfig=clientConfig=>{let runtimeConfig={};return clientConfig.checksumAlgorithms().forEach(checksumAlgorithm=>{let id=checksumAlgorithm.algorithmId();knownAlgorithms.includes(id)&&(runtimeConfig[id]=checksumAlgorithm.checksumConstructor())}),runtimeConfig}}});var getRetryConfiguration,resolveRetryRuntimeConfig,init_retry=__esm({"node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/retry.js"(){getRetryConfiguration=runtimeConfig=>({setRetryStrategy(retryStrategy){runtimeConfig.retryStrategy=retryStrategy},retryStrategy(){return runtimeConfig.retryStrategy}}),resolveRetryRuntimeConfig=retryStrategyConfiguration=>{let runtimeConfig={};return runtimeConfig.retryStrategy=retryStrategyConfiguration.retryStrategy(),runtimeConfig}}});var getDefaultExtensionConfiguration,getDefaultClientConfiguration,resolveDefaultRuntimeConfig,init_defaultExtensionConfiguration=__esm({"node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/defaultExtensionConfiguration.js"(){init_checksum();init_retry();getDefaultExtensionConfiguration=runtimeConfig=>Object.assign(getChecksumConfiguration(runtimeConfig),getRetryConfiguration(runtimeConfig)),getDefaultClientConfiguration=getDefaultExtensionConfiguration,resolveDefaultRuntimeConfig=
@@ -173,7 +174,7 @@ N");let endpoint=await getEndpointFromInstructions2(args.input,{getEndpointParam
173
174
  Object.assign(httpAuthOption.signingProperties||{},{signing_region:authScheme.signingRegion,signingRegion:authScheme.signingRegion,signing_service:authScheme.signingName,signingName:authScheme.signingName,signingRegionSet:authScheme.signingRegionSet},authScheme.properties))}return next({...args})}}var init_endpointMiddleware=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/endpointMiddleware.js"(){init_transport();init_getEndpointFromInstructions()}});function bindGetEndpointPlugin(getEndpointFromConfig2){let endpointMiddleware2=bindEndpointMiddleware(getEndpointFromConfig2);return(config,instructions)=>({applyToStack:clientStack=>{clientStack.addRelativeTo(endpointMiddleware2({config,instructions}),endpointMiddlewareOptions)}})}var serializerMiddlewareOption2,endpointMiddlewareOptions,init_getEndpointPlugin=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/getEndpointPlugin.js"(){init_endpointMiddleware();serializerMiddlewareOption2=
174
175
  {name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0},endpointMiddlewareOptions={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:serializerMiddlewareOption2.name}}});function bindResolveEndpointConfig(getEndpointFromConfig2){return input=>{let tls=input.tls??!0,{endpoint,useDualstackEndpoint,useFipsEndpoint}=input,customEndpointProvider=endpoint!=null?async()=>toEndpointV1(await normalizeProvider(endpoint)()):void 0,resolvedConfig=Object.assign(input,{endpoint:customEndpointProvider,tls,isCustomEndpoint:!!endpoint,useDualstackEndpoint:normalizeProvider(useDualstackEndpoint??!1),useFipsEndpoint:normalizeProvider(useFipsEndpoint??!1),ignoreConfiguredEndpointUrls:!!input.
175
176
  ignoreConfiguredEndpointUrls}),configuredEndpointPromise;return resolvedConfig.serviceConfiguredEndpoint=async()=>(input.serviceId&&!configuredEndpointPromise&&(configuredEndpointPromise=getEndpointFromConfig2(input.serviceId)),configuredEndpointPromise),resolvedConfig}}var init_resolveEndpointConfig=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/resolveEndpointConfig.js"(){init_transport();init_toEndpointV12()}});var BinaryDecisionDiagram,init_BinaryDecisionDiagram=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/bdd/BinaryDecisionDiagram.js"(){BinaryDecisionDiagram=class _BinaryDecisionDiagram{nodes;root;conditions;results;constructor(bdd,root,conditions,results){this.nodes=bdd,this.root=root,this.conditions=conditions,this.results=results}static from(bdd,root,conditions,results){return new _BinaryDecisionDiagram(bdd,root,conditions,results)}}}});var EndpointCache,init_EndpointCache=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/cache/EndpointCache.js"(){EndpointCache=class{capacity;data=new Map;parameters=[];constructor({size,params}){this.capacity=size??50,params&&(this.parameters=params)}get(endpointParams,resolver){let key=this.hash(endpointParams);if(key===!1)return resolver();if(!this.data.has(key)){if(this.data.size>this.capacity+10){let keys=this.data.keys(),i=0;for(;;){let{value,done}=keys.next();if(this.
176
- data.delete(value),done||++i>10)break}}this.data.set(key,resolver())}return this.data.get(key)}size(){return this.data.size}hash(endpointParams){let buffer="",{parameters}=this;if(parameters.length===0)return!1;for(let param of parameters){let val=String(endpointParams[param]??"");if(val.includes("|;"))return!1;buffer+=val+"|;"}return buffer}}}});var EndpointError,init_EndpointError=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointError.js"(){EndpointError=class extends Error{constructor(message){super(message),this.name="EndpointError"}}}});var init_types2=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/index.js"(){init_EndpointError()}});var debugId,init_debugId=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/debugId.js"(){debugId="endpoints"}});function toDebugString(input){return typeof input!="object"||input==null?input:"ref"in input?`$${toDebugString(input.ref)}`:"fn"in input?`${input.fn}(${(input.argv||[]).map(toDebugString).join(", ")})`:JSON.stringify(input,null,2)}var init_toDebugString=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/toDebugString.js"(){}});var init_debug=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/index.js"(){init_debugId();init_toDebugString()}});var customEndpointFunctions,init_customEndpointFunctions=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/customEndpointFunctions.js"(){customEndpointFunctions={}}});var booleanEquals,init_booleanEquals=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/booleanEquals.js"(){booleanEquals=(value1,value2)=>value1===value2}});function coalesce(...args){for(let arg of args)if(arg!=null)return arg}var init_coalesce=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/coalesce.js"(){}});var getAttrPathList,init_getAttrPathList=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttrPathList.js"(){init_types2();getAttrPathList=path=>{let parts=path.split("."),pathList=[];for(let part of parts){let squareBracketIndex=part.indexOf("[");if(squareBracketIndex!==-1){if(part.indexOf("]")!==part.length-1)throw new EndpointError(`Path: '${path}' does not end with ']'`);let arrayIndex=part.slice(squareBracketIndex+1,-1);if(Number.isNaN(parseInt(arrayIndex)))
177
+ data.delete(value),done||++i>10)break}}this.data.set(key,resolver())}return this.data.get(key)}size(){return this.data.size}hash(endpointParams){let buffer="",{parameters}=this;if(parameters.length===0)return!1;for(let param of parameters){let raw=endpointParams[param],val=raw==null?"\0":String(raw);if(val.includes("|;"))return!1;buffer+=val+"|;"}return buffer}}}});var EndpointError,init_EndpointError=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointError.js"(){EndpointError=class extends Error{constructor(message){super(message),this.name="EndpointError"}}}});var init_types2=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/index.js"(){init_EndpointError()}});var debugId,init_debugId=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/debugId.js"(){debugId="endpoints"}});function toDebugString(input){return typeof input!="object"||input==null?input:"ref"in input?`$${toDebugString(input.ref)}`:"fn"in input?`${input.fn}(${(input.argv||[]).map(toDebugString).join(", ")})`:JSON.stringify(input,null,2)}var init_toDebugString=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/toDebugString.js"(){}});var init_debug=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/index.js"(){init_debugId();init_toDebugString()}});var customEndpointFunctions,init_customEndpointFunctions=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/customEndpointFunctions.js"(){customEndpointFunctions={}}});var booleanEquals,init_booleanEquals=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/booleanEquals.js"(){booleanEquals=(value1,value2)=>value1===value2}});function coalesce(...args){for(let arg of args)if(arg!=null)return arg}var init_coalesce=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/coalesce.js"(){}});var getAttrPathList,init_getAttrPathList=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttrPathList.js"(){init_types2();getAttrPathList=path=>{let parts=path.split("."),pathList=[];for(let part of parts){let squareBracketIndex=part.indexOf("[");if(squareBracketIndex!==-1){if(part.indexOf("]")!==part.length-1)throw new EndpointError(`Path: '${path}' does not end with ']'`);let arrayIndex=part.slice(squareBracketIndex+1,-1);if(Number.isNaN(parseInt(arrayIndex)))
177
178
  throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`);squareBracketIndex!==0&&pathList.push(part.slice(0,squareBracketIndex)),pathList.push(arrayIndex)}else pathList.push(part)}return pathList}}});var getAttr,init_getAttr=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttr.js"(){init_types2();init_getAttrPathList();getAttr=(value,path)=>getAttrPathList(path).reduce((acc,index)=>{if(typeof acc!="object")throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);if(Array.isArray(acc)){let i=parseInt(index);return acc[i<0?acc.length+i:i]}return acc[index]},value)}});var isSet,init_isSet=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/isSet.js"(){isSet=value=>value!=null}});function ite(condition,trueValue,falseValue){return condition?trueValue:falseValue}var init_ite=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/ite.js"(){}});var not,init_not=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/not.js"(){not=value=>!value}});var IP_V4_REGEX,isIpAddress,init_isIpAddress=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/isIpAddress.js"(){IP_V4_REGEX=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),isIpAddress=value=>IP_V4_REGEX.test(value)||value.startsWith("[")&&value.endsWith("]")}});var import_types12,DEFAULT_PORTS,parseURL,init_parseURL=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/parseURL.js"(){import_types12=__toESM(require_dist_cjs());init_isIpAddress();DEFAULT_PORTS={[import_types12.EndpointURLScheme.HTTP]:80,[import_types12.EndpointURLScheme.HTTPS]:443},parseURL=value=>{let whatwgURL=(()=>{try{if(value instanceof URL)return value;if(typeof value=="object"&&"hostname"in value){let{hostname:hostname2,port,protocol:protocol2="",path="",
178
179
  query={}}=value,url=new URL(`${protocol2}//${hostname2}${port?`:${port}`:""}${path}`);return url.search=Object.entries(query).map(([k,v])=>`${k}=${v}`).join("&"),url}return new URL(value)}catch{return null}})();if(!whatwgURL)return console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`),null;let urlString=whatwgURL.href,{host,hostname,pathname,protocol,search}=whatwgURL;if(search)return null;let scheme=protocol.slice(0,-1);if(!Object.values(import_types12.EndpointURLScheme).includes(
179
180
  scheme))return null;let isIp=isIpAddress(hostname),inputContainsDefaultPort=urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`)||typeof value=="string"&&value.includes(`${host}:${DEFAULT_PORTS[scheme]}`),authority=`${host}${inputContainsDefaultPort?`:${DEFAULT_PORTS[scheme]}`:""}`;return{scheme,authority,path:pathname,normalizedPath:pathname.endsWith("/")?pathname:`${pathname}/`,isIp}}}});function split(value,delimiter,limit){if(limit===1)return[value];if(value==="")return[""];let parts=value.split(delimiter);return limit===0?parts:parts.slice(0,limit-1).concat(parts.slice(1).join(delimiter))}var init_split=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/split.js"(){}});var stringEquals,init_stringEquals=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/stringEquals.js"(){stringEquals=(value1,value2)=>value1===value2}});var substring,init_substring=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/substring.js"(){substring=(input,start,stop,reverse)=>input==null||start>=stop||input.length<stop||/[^\u0000-\u007f]/.test(input)?null:reverse?input.substring(input.length-stop,input.length-start):input.substring(start,stop)}});var uriEncode,init_uriEncode=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/uriEncode.js"(){uriEncode=value=>encodeURIComponent(value).replace(/[!*'()]/g,c=>`%${c.charCodeAt(0).toString(16).toUpperCase()}`)}});var init_lib=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/index.js"(){init_booleanEquals();init_coalesce();init_getAttr();init_isSet();init_transport();init_ite();init_not();init_parseURL();init_split();init_stringEquals();init_substring();init_uriEncode()}});var endpointFunctions,init_endpointFunctions=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/endpointFunctions.js"(){init_lib();endpointFunctions={booleanEquals,coalesce,getAttr,isSet,isValidHostLabel,ite,not,parseURL,split,stringEquals,substring,uriEncode}}});var evaluateTemplate,init_evaluateTemplate=__esm({"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/evaluateTemplate.js"(){init_lib();evaluateTemplate=(template,options)=>{let evaluatedTemplateArr=[],{referenceRecord,endpointParams}=options,currentIndex=0;for(;currentIndex<template.length;){let openingBraceIndex=template.indexOf("{",currentIndex);if(openingBraceIndex===-1){evaluatedTemplateArr.push(template.slice(currentIndex));break}evaluatedTemplateArr.push(template.
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{VisualLinePreview,getTextOutput,replaceTabs,str}from"./chunk-RCJ2GKUP.js";import{Container,Spacer,Text,highlightCode,keyHint}from"./chunk-6FTYU7I7.js";import{getDocsPath}from"./chunk-ANSL5PYD.js";import{typebox_exports}from"./chunk-BHM75BJJ.js";function createUsageTotals(){return{input:0,output:0,cacheRead:0,cacheWrite:0,cost:0}}function addUsageToTotals(totals,usage){totals.input+=usage.input,totals.output+=usage.output,totals.cacheRead+=usage.cacheRead,totals.cacheWrite+=usage.cacheWrite,totals.cost+=usage.cost.total}function combineUsage(first,second){return{input:first.input+second.input,output:first.output+second.output,cacheRead:first.cacheRead+second.cacheRead,cacheWrite:first.cacheWrite+second.cacheWrite,...first.cacheWrite1h!==
2
+ import{VisualLinePreview,getTextOutput,replaceTabs,str}from"./chunk-OXJXKCLB.js";import{Container,Spacer,Text,highlightCode,keyHint}from"./chunk-ICLZNV4V.js";import{getDocsPath}from"./chunk-DUZY4PDA.js";import{typebox_exports}from"./chunk-BHM75BJJ.js";function createUsageTotals(){return{input:0,output:0,cacheRead:0,cacheWrite:0,cost:0}}function addUsageToTotals(totals,usage){totals.input+=usage.input,totals.output+=usage.output,totals.cacheRead+=usage.cacheRead,totals.cacheWrite+=usage.cacheWrite,totals.cost+=usage.cost.total}function combineUsage(first,second){return{input:first.input+second.input,output:first.output+second.output,cacheRead:first.cacheRead+second.cacheRead,cacheWrite:first.cacheWrite+second.cacheWrite,...first.cacheWrite1h!==
3
3
  void 0||second.cacheWrite1h!==void 0?{cacheWrite1h:(first.cacheWrite1h??0)+(second.cacheWrite1h??0)}:{},...first.reasoning!==void 0||second.reasoning!==void 0?{reasoning:(first.reasoning??0)+(second.reasoning??0)}:{},totalTokens:first.totalTokens+second.totalTokens,cost:{input:first.cost.input+second.cost.input,output:first.cost.output+second.cost.output,cacheRead:first.cost.cacheRead+second.cost.cacheRead,cacheWrite:first.cost.cacheWrite+second.cost.cacheWrite,total:first.cost.total+second.cost.
4
4
  total}}}function getUsageCostBreakdown(entries){let totalsByKey=new Map;for(let entry of entries){let key,usage;if(entry.type==="message"&&entry.message.role==="assistant"?(key=`${entry.message.provider}/${entry.message.responseModel??entry.message.model}`,usage=entry.message.usage):entry.type==="usage"?(key=`${entry.provider}/${entry.model}`,usage=entry.usage):entry.type==="message"&&entry.message.role==="toolResult"&&entry.message.usage?(key="Tools/summaries",usage=entry.message.usage):(entry.
5
5
  type==="branch_summary"||entry.type==="compaction")&&entry.usage&&(key="Tools/summaries",usage=entry.usage),!key||!usage)continue;let totals=totalsByKey.get(key);totals||(totals=createUsageTotals(),totalsByKey.set(key,totals)),addUsageToTotals(totals,usage)}return Array.from(totalsByKey,([key,totals])=>({key,cost:totals.cost,tokens:totals.input+totals.output+totals.cacheRead+totals.cacheWrite})).filter(entry=>entry.cost>0||entry.tokens>0).sort((a,b)=>b.cost-a.cost)}function toCodemodeIdentifier(name){let identifier="";for(let char of name){let valid=identifier===""?/^[A-Za-z_$]$/.test(char):/^[A-Za-z0-9_$]$/.test(char);identifier+=valid?char:"_"}return identifier===""?"_":identifier}var IDENTIFIER=/^[A-Za-z_$][A-Za-z0-9_$]*$/,INDENT=" ",DEFAULT_INPUT_SCHEMA_MAX_CHARS=16e3,MAX_REF_EXPANSIONS=32,MCP_TYPESCRIPT_PREAMBLE=`type Role = "user" | "assistant";
@@ -119,7 +119,7 @@ Searches over deferred tool metadata with BM25 and exposes matching tools for th
119
119
  Some of the tools, such as tools of MCP servers, may not have been provided to you upfront, and you should use this tool (\`${TOOL_SEARCH_TOOL_NAME}\`) to search for the required tools. For MCP tool discovery, always use \`${TOOL_SEARCH_TOOL_NAME}\`.`;function createToolSearchToolDefinition(options={}){return{name:TOOL_SEARCH_TOOL_NAME,label:TOOL_SEARCH_TOOL_NAME,description:TOOL_SEARCH_DESCRIPTION,promptSnippet:"Search for tools that are not loaded yet and load the matches",parameters:toolSearchSchema,
120
120
  exposure:"model-only",async execute(_toolCallId,{query,limit}){if(query.trim()==="")throw new Error("query must not be empty");let max=limit??DEFAULT_TOOL_SEARCH_LIMIT;if(!Number.isInteger(max)||max<=0)throw new Error("limit must be a positive integer");let tools=options.tools?searchAndLoad(options.tools,query,max):[];return{content:[{type:"text",text:tools.length===0?"No matching tools found.":`Loaded ${tools.length} tool${tools.length===1?"":"s"}. They are available from your next call:
121
121
  ${tools.map(tool=>`- ${tool.name}: ${tool.description.trim().split(/\r?\n/)[0]}`).join(`
122
- `)}`}],details:{loaded:tools.map(tool=>tool.name)}}}}}import{join}from"node:path";function wrapToolDefinition(definition,ctxFactory){return{name:definition.name,label:definition.label,description:definition.description,parameters:definition.parameters,outputSchema:definition.outputSchema,constrainedSampling:definition.constrainedSampling,prepareArguments:definition.prepareArguments,executionMode:definition.executionMode,execute:(toolCallId,params,signal,onUpdate,ctx)=>definition.execute(toolCallId,params,signal,onUpdate,ctx??ctxFactory?.(toolCallId,signal))}}function createToolDefinitionFromAgentTool(tool){return{name:tool.name,label:tool.label,description:tool.description,parameters:tool.parameters,outputSchema:tool.outputSchema,constrainedSampling:tool.constrainedSampling,prepareArguments:tool.prepareArguments,executionMode:tool.executionMode,execute:async(toolCallId,params,signal,onUpdate)=>tool.execute(toolCallId,params,signal,onUpdate)}}var loadCodemodeExecutor=()=>import("./execute-G3YZLU7S.js");var CODE_PREVIEW_LINES=10,CALL_PREVIEW_COUNT=8,OUTPUT_PREVIEW_LINES=5,COLLAPSED_ARGS_CHARS=80,SCRIPT_HEADER=/^Script (completed|failed)\nWall time [\d.]+ seconds\nOutput:\n$/;function expandHint(theme,hidden,noun){return`${theme.fg("muted",`... (${hidden} more ${noun},`)} ${keyHint("app.tools.expand","to expand")}${theme.fg("muted",")")}`}function formatDuration(ms){return ms===void 0?"":ms<1e3?`${Math.round(ms)}ms`:`${(ms/1e3).toFixed(1)}s`}function formatCost(cost){return`$${cost>=.01?cost.toFixed(
122
+ `)}`}],details:{loaded:tools.map(tool=>tool.name)}}}}}import{join}from"node:path";function wrapToolDefinition(definition,ctxFactory){return{name:definition.name,label:definition.label,description:definition.description,parameters:definition.parameters,outputSchema:definition.outputSchema,constrainedSampling:definition.constrainedSampling,prepareArguments:definition.prepareArguments,executionMode:definition.executionMode,execute:(toolCallId,params,signal,onUpdate,ctx)=>definition.execute(toolCallId,params,signal,onUpdate,ctx??ctxFactory?.(toolCallId,signal))}}function createToolDefinitionFromAgentTool(tool){return{name:tool.name,label:tool.label,description:tool.description,parameters:tool.parameters,outputSchema:tool.outputSchema,constrainedSampling:tool.constrainedSampling,prepareArguments:tool.prepareArguments,executionMode:tool.executionMode,execute:async(toolCallId,params,signal,onUpdate)=>tool.execute(toolCallId,params,signal,onUpdate)}}var loadCodemodeExecutor=()=>import("./execute-KEUC5IWA.js");var CODE_PREVIEW_LINES=10,CALL_PREVIEW_COUNT=8,OUTPUT_PREVIEW_LINES=5,COLLAPSED_ARGS_CHARS=80,SCRIPT_HEADER=/^Script (completed|failed)\nWall time [\d.]+ seconds\nOutput:\n$/;function expandHint(theme,hidden,noun){return`${theme.fg("muted",`... (${hidden} more ${noun},`)} ${keyHint("app.tools.expand","to expand")}${theme.fg("muted",")")}`}function formatDuration(ms){return ms===void 0?"":ms<1e3?`${Math.round(ms)}ms`:`${(ms/1e3).toFixed(1)}s`}function formatCost(cost){return`$${cost>=.01?cost.toFixed(
123
123
  2):cost.toPrecision(2)}`}function statusIcon(call,theme){switch(call.status){case"running":return theme.fg("warning","\u2026");case"ok":return theme.fg("success","\u2713");case"error":return theme.fg("error","\u2717");case"cancelled":return theme.fg("muted","\u2298")}}function formatCall(call,theme,expanded){let args=!expanded&&call.args.length>COLLAPSED_ARGS_CHARS?`${call.args.slice(0,COLLAPSED_ARGS_CHARS-3)}...`:call.args,duration=formatDuration(call.durationMs),line=`${statusIcon(call,theme)}\
124
124
  ${theme.fg("toolTitle",call.name)}`;return args&&(line+=` ${theme.fg("muted",args)}`),duration&&(line+=` ${theme.fg("dim",duration)}`),call.cost&&(line+=` ${theme.fg("dim",formatCost(call.cost))}`),expanded&&call.error&&(line+=`
125
125
  ${theme.fg("error",call.error.split(`
@@ -83,9 +83,10 @@ hasChildren(node)&&existsOne(test,node.children))}function findAll(test,nodes){l
83
83
  {"node_modules/domutils/dist/querying.js"(){init_dist4()}});function getAttribCheck(attrib,value){return typeof value=="function"?element=>isTag2(element)&&value(element.attribs[attrib]):element=>isTag2(element)&&element.attribs[attrib]===value}function combineFuncs(a,b){return element=>a(element)||b(element)}function compileTest(options){let funcs=Object.keys(options).map(key=>{let value=options[key];return Object.hasOwn(Checks,key)?Checks[key](value):getAttribCheck(key,value)});return funcs.length===0?null:funcs.reduce(combineFuncs)}function testElement(options,node){
84
84
  let test=compileTest(options);return test?test(node):!0}function getElements(options,nodes,recurse,limit=Number.POSITIVE_INFINITY){let test=compileTest(options);return test?filter(test,nodes,recurse,limit):[]}function getElementById(id,nodes,recurse=!0){return Array.isArray(nodes)||(nodes=[nodes]),findOne(getAttribCheck("id",id),nodes,recurse)}function getElementsByTagName(tagName,nodes,recurse=!0,limit=Number.POSITIVE_INFINITY){return filter(Checks.tag_name(tagName),nodes,recurse,limit)}function getElementsByClassName(className,nodes,recurse=!0,limit=Number.
85
85
  POSITIVE_INFINITY){return filter(getAttribCheck("class",className),nodes,recurse,limit)}function getElementsByTagType(type,nodes,recurse=!0,limit=Number.POSITIVE_INFINITY){return filter(Checks.tag_type(type),nodes,recurse,limit)}var Checks,init_legacy=__esm({"node_modules/domutils/dist/legacy.js"(){init_dist4();init_querying();Checks={tag_name(name){return typeof name=="function"?element=>isTag2(element)&&name(element.name):name==="*"?isTag2:element=>isTag2(element)&&element.name===name},tag_type(type){
86
- return typeof type=="function"?element=>type(element.type):element=>element.type===type},tag_contains(data){return typeof data=="function"?element=>isText(element)&&data(element.data):element=>isText(element)&&element.data===data}}}});function encodeXML(input){let out,last=0,{length}=input;for(let index=0;index<length;index++){let char=input.charCodeAt(index);if(char<128&&((XML_BITSET_VALUE>>>char&1)===0||char>=64||char<32))continue;if(out===void 0?out=input.substring(0,index):last!==index&&(out+=input.substring(last,index)),char<64){out+=xmlCodeMap.get(char),last=index+1;continue}let cp=getCodePoint(input,index);out+=`&#x${cp.toString(16)};`,cp!==char&&index++,last=index+1}return out===void 0?input:(last<length&&(out+=input.
87
- substr(last)),out)}function getEscaper(regex,map){return function(data){let match,lastIndex=0,result="";for(;match=regex.exec(data);)lastIndex!==match.index&&(result+=data.substring(lastIndex,match.index)),result+=map.get(match[0].charCodeAt(0)),lastIndex=match.index+1;return result+data.substring(lastIndex)}}var xmlCodeMap,getCodePoint,XML_BITSET_VALUE,escapeAttribute,escapeText,init_escape=__esm({"node_modules/entities/dist/escape.js"(){xmlCodeMap=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos\
88
- ;"],[60,"&lt;"],[62,"&gt;"]]),getCodePoint=typeof String.prototype.codePointAt=="function"?(input,index)=>input.codePointAt(index):(c,index)=>(c.charCodeAt(index)&64512)===55296?(c.charCodeAt(index)-55296)*1024+c.charCodeAt(index+1)-56320+65536:c.charCodeAt(index),XML_BITSET_VALUE=1342177476;escapeAttribute=getEscaper(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),escapeText=getEscaper(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]]))}});var EntityLevel,EncodingMode,init_dist5=__esm({"node_modules/entities/dist/index.js"(){init_escape();(function(EntityLevel2){EntityLevel2[EntityLevel2.XML=0]="XML",EntityLevel2[EntityLevel2.HTML=1]="HTML"})(EntityLevel||(EntityLevel={}));(function(EncodingMode2){EncodingMode2[EncodingMode2.UTF8=0]="UTF8",EncodingMode2[EncodingMode2.ASCII=1]="ASCII",EncodingMode2[EncodingMode2.Extensive=2]="Extensive",EncodingMode2[EncodingMode2.Attribute=3]="Attribute",EncodingMode2[EncodingMode2.Text=4]="Text"})(
86
+ return typeof type=="function"?element=>type(element.type):element=>element.type===type},tag_contains(data){return typeof data=="function"?element=>isText(element)&&data(element.data):element=>isText(element)&&element.data===data}}}});function getEscape(char){return char===34?"&quot;":char===38?"&amp;":char===39?"&apos;":char===60?"&lt;":char===62?"&gt;":"&nbsp;"}function isXmlEscapable(code){return code>=128||code>=32&&code<64&&(XML_BITSET_VALUE>>>code&1)===1}function encodeXML(input){let{length}=input,out,last=0,index=0;for(;index<length;){let char=input.charCodeAt(index);if(!isXmlEscapable(char)){let bound=Math.min(index+32,length),next=index+1;for(;next<bound&&!isXmlEscapable(input.charCodeAt(next));)next++;if(next<bound){
87
+ index=next;continue}if(next>=length||(xmlEncodeRegex.lastIndex=next,!xmlEncodeRegex.test(input)))break;index=xmlEncodeRegex.lastIndex-1;continue}if(out===void 0?out=input.substring(0,index):last!==index&&(out+=input.substring(last,index)),char<64){out+=getEscape(char),last=index+=1;continue}let cp=input.codePointAt(index);out+=`&#x${cp.toString(16)};`,cp!==char&&index++,last=index+=1}return out===void 0?input:(last<length&&(out+=input.substr(last)),out)}function escapeWithRegex(re,data){if(re.lastIndex=
88
+ 0,!re.test(data))return data;let out="",last=0;do{let index=re.lastIndex-1;last!==index&&(out+=data.substring(last,index));let char=data.charCodeAt(index);out+=getEscape(char),last=index+1}while(re.test(data));return out+data.substring(last)}function escapeAttribute(data){return escapeWithRegex(attributeEscapeRegex,data)}function escapeText(data){return escapeWithRegex(textEscapeRegex,data)}var XML_BITSET_VALUE,xmlEncodeRegex,attributeEscapeRegex,textEscapeRegex,init_escape=__esm({"node_modules/\
89
+ entities/dist/escape.js"(){XML_BITSET_VALUE=1342177476,xmlEncodeRegex=/["&'<>\u0080-\uFFFF]/g;attributeEscapeRegex=/["&\u{A0}]/gu;textEscapeRegex=/[&<>\u{A0}]/gu}});var EntityLevel,EncodingMode,init_dist5=__esm({"node_modules/entities/dist/index.js"(){init_escape();(function(EntityLevel2){EntityLevel2[EntityLevel2.XML=0]="XML",EntityLevel2[EntityLevel2.HTML=1]="HTML"})(EntityLevel||(EntityLevel={}));(function(EncodingMode2){EncodingMode2[EncodingMode2.UTF8=0]="UTF8",EncodingMode2[EncodingMode2.ASCII=1]="ASCII",EncodingMode2[EncodingMode2.Extensive=2]="Extensive",EncodingMode2[EncodingMode2.Attribute=3]="Attribute",EncodingMode2[EncodingMode2.Text=4]="Text"})(
89
90
  EncodingMode||(EncodingMode={}))}});var elementNames,attributeNames,init_foreign_names=__esm({"node_modules/dom-serializer/dist/foreign-names.js"(){elementNames=new Map("altGlyph altGlyphDef altGlyphItem animateColor animateMotion animateTransform clipPath feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feDropShadow feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotL\
90
91
  ight feTile feTurbulence foreignObject glyphRef linearGradient radialGradient textPath".split(" ").map(name=>[name.toLowerCase(),name])),attributeNames=new Map("definitionURL attributeName attributeType baseFrequency baseProfile calcMode clipPathUnits diffuseConstant edgeMode filterUnits glyphRef gradientTransform gradientUnits kernelMatrix kernelUnitLength keyPoints keySplines keyTimes lengthAdjust limitingConeAngle markerHeight markerUnits markerWidth maskContentUnits maskUnits numOctaves path\
91
92
  Length patternContentUnits patternTransform patternUnits pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits refX refY repeatCount repeatDur requiredExtensions requiredFeatures specularConstant specularExponent spreadMethod startOffset stdDeviation stitchTiles surfaceScale systemLanguage tableValues targetX targetY textLength viewBox viewTarget xChannelSelector yChannelSelector zoomAndPan".split(" ").map(name=>[name.toLowerCase(),name]))}});function render(node,options={}){let nodes="length"in node?node:[node],xmlMode=options.xmlMode??!1,output="";for(let index=0;index<nodes.length;index++)output+=renderNode(nodes[index],options,xmlMode);return output}function renderChildren(children,options,xmlMode){let output="";for(let index=0;index<children.length;index++)output+=renderNode(children[index],options,xmlMode);return output}function renderNode(node,options,xmlMode){switch(node.type){case Root:return renderChildren(node.children,options,
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{McpOAuthCredentialStore,McpServerConnection,McpServerLog,McpSignInCancelledError,createDefaultTransport,signInMcpServer}from"./chunk-ZWHFLRTK.js";import{ProjectTrustStore,addMcpServerConfig,loadMcpConfig,openBrowser,removeMcpServerConfig}from"./chunk-B44UVTZL.js";import{getMcpToolExposure,validateMcpServerConfig}from"./chunk-DMAZLWJY.js";import"./chunk-RCJ2GKUP.js";import{source_default}from"./chunk-6FTYU7I7.js";import"./chunk-SCIGZFN5.js";import{APP_COMMAND,
3
- CONFIG_DIR_NAME}from"./chunk-ANSL5PYD.js";import"./chunk-JXWJOIH4.js";import{existsSync}from"node:fs";import{join}from"node:path";import{createInterface}from"node:readline/promises";var HELP=`${source_default.bold("Usage:")}
2
+ import{McpOAuthCredentialStore,McpServerConnection,McpServerLog,McpSignInCancelledError,createDefaultTransport,signInMcpServer}from"./chunk-E22S6D55.js";import{ProjectTrustStore,addMcpServerConfig,loadMcpConfig,openBrowser,removeMcpServerConfig}from"./chunk-H5CZL7M5.js";import{getMcpToolExposure,validateMcpServerConfig}from"./chunk-JQZ7BIAI.js";import"./chunk-OXJXKCLB.js";import{source_default}from"./chunk-ICLZNV4V.js";import"./chunk-SCIGZFN5.js";import{APP_COMMAND,
3
+ CONFIG_DIR_NAME}from"./chunk-DUZY4PDA.js";import"./chunk-JXWJOIH4.js";import{existsSync}from"node:fs";import{join}from"node:path";import{createInterface}from"node:readline/promises";var HELP=`${source_default.bold("Usage:")}
4
4
  ${APP_COMMAND} mcp add <server> [options] -- <command> [args...]
5
5
  ${APP_COMMAND} mcp add <server> [options] --url <url>
6
6
  ${APP_COMMAND} mcp remove <server> [-l]
@@ -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,setBedrockProviderModule,stream,streamAnthropic,streamAzureOpenAIResponses,streamGoogle,streamGoogleVertex,streamMistral,streamOpenAICodexResponses,streamOpenAICompletions,streamOpenAIResponses,streamSimple,streamSimpleAnthropic,streamSimpleAzureOpenAIResponses,streamSimpleGoogle,streamSimpleGoogleVertex,streamSimpleMistral,streamSimpleOpenAICodexResponses,streamSimpleOpenAICompletions,streamSimpleOpenAIResponses,unregisterApiProviders}from"./chunk-UDTXD6EF.js";
3
+ registerImagesApiProvider,resetApiProviders,setBedrockProviderModule,stream,streamAnthropic,streamAzureOpenAIResponses,streamGoogle,streamGoogleVertex,streamMistral,streamOpenAICodexResponses,streamOpenAICompletions,streamOpenAIResponses,streamSimple,streamSimpleAnthropic,streamSimpleAzureOpenAIResponses,streamSimpleGoogle,streamSimpleGoogleVertex,streamSimpleMistral,streamSimpleOpenAICodexResponses,streamSimpleOpenAICompletions,streamSimpleOpenAIResponses,unregisterApiProviders}from"./chunk-2Q2O3GZ4.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-KQM7ZGL6.js";import"./chunk-CIA6V3BP.js";import"./chunk-FACBDLFU.js";import{AssistantMessageFrameEncoder,DEFAULT_MAX_AGENT_RETRY_DELAY_MS,StringEnum,createFauxCore,envApiKeyAuth,fauxAssistantMessage,fauxProvider,
5
5
  fauxText,fauxThinking,fauxToolCall,getAssistantRetryDelayMs,getOverflowPatterns,isContextOverflow,isRecoverableLength,isRetryableAssistantError,lazyOAuth,reduceAssistantMessageFrames,retryAssistantCall,retryDelayMs,validateToolArguments,validateToolCall}from"./chunk-PEZZKT73.js";import{cleanupSessionResources,getOpenAICodexTokenIdentity,registerSessionResourceCleanup}from"./chunk-DBL35X7L.js";import{parseJsonWithRepair,parseStreamingJson,repairJson}from"./chunk-4X774RBJ.js";import{
6
6
  InMemoryCredentialStore,InMemoryModelsStore,ModelsError,calculateCost,clampThinkingLevel,collapseSystemMessages,commitLoginCredential,contentText,createInitialSystemMessage,createModels,createProvider,declarationsEqual,defaultProviderAuthContext,getCurrentSystemMessage,getCurrentSystemPrompt,getCurrentTools,getDeclaredTools,getInitialSystemMessage,getModelType,getSupportedThinkingLevels,getSystemMessageText,getToolStateChanges,hasApi,hasNonAdditiveToolChanges,hasToolRedefinitions,isModelType,lazyApi,