@humain/humain-code 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/bundle/agent-monitor.js +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +27 -22
- package/dist/bundle/chunks/{chunk-HA5AW36V.js → chunk-6AANPPHY.js} +185 -172
- package/dist/bundle/chunks/{chunk-2Q2O3GZ4.js → chunk-AYG2Z4S7.js} +428 -434
- package/dist/bundle/chunks/{chunk-IAI7MTU4.js → chunk-LA6XSQ4X.js} +2 -2
- package/dist/bundle/chunks/{chunk-N23FFKJU.js → chunk-T45HXZW7.js} +4 -4
- package/dist/bundle/chunks/{compat-TCOK5LFD.js → compat-5GFZUIMF.js} +1 -1
- package/dist/bundle/chunks/{dist-33CBPO23.js → dist-APWFFGCD.js} +493 -432
- package/dist/bundle/chunks/{virtual-modules-I5YD7JGC.js → virtual-modules-CKAUGQGB.js} +2 -2
- package/dist/bundle/cli-runtime.js +2 -2
- package/dist/bundle/flow/assets/orchestrator-profiles.json +32 -32
- package/dist/bundle/flow/assets/profiles/oss-first.json +37 -72
- package/dist/bundle/flow/assets/profiles/premium.json +5 -5
- package/dist/bundle/flow/package.json +1 -1
- package/dist/bundle/index.js +4 -4
- package/dist/bundle/rpc-entry.js +2 -2
- package/dist/core/tools/subagent.d.ts +2 -0
- package/dist/core/tools/subagent.d.ts.map +1 -1
- package/dist/core/tools/subagent.js +72 -3
- package/dist/core/tools/subagent.js.map +1 -1
- package/dist/humain/flow-loader.d.ts.map +1 -1
- package/dist/humain/flow-loader.js +89 -4
- package/dist/humain/flow-loader.js.map +1 -1
- package/docs/flow-profiles.md +4 -2
- package/docs/flow.md +5 -3
- package/npm-shrinkwrap.json +6 -6
- package/package.json +2 -2
|
@@ -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-
|
|
7
|
+
withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunk-6AANPPHY.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
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-
|
|
9
|
+
HumainAgentArtifactSchema,HumainAgentExecutionClaimSchema,HumainAgentExecutionControlsSchema,HumainAgentExecutionOutcomeSchema,HumainAgentExecutionRequestSchema,HumainAgentExecutionResponseSchema,HumainAgentRouteRefSchema,HumainAgentUsageSchema,parseHumainAgentExecutionRequest,parseHumainAgentExecutionResponse}from"./chunk-T45HXZW7.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,
|
|
@@ -119,7 +119,7 @@ name,...session.cwd?{cwd:session.cwd}:{},pid:consumer.pid,status:session.status,
|
|
|
119
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[
|
|
120
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.
|
|
121
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\
|
|
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,
|
|
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,
|
|
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,
|
|
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};
|
|
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,FLOW_DIGEST_PATTERN,FlowContractError,lit,StrictObject,FlowIdSchema,FlowDigestSchema,FlowTimestampSchema,FlowMicrousdSchema,FlowCountSchema,FlowPositiveIntSchema,FlowModelRefSchema,FLOW_ROLES,FlowRoleSchema,partialByRole,FlowSizeSchema,FlowFailureClassSchema,FlowReasonClassSchema,FlowProfileRefSchema,verifyFlowDigest,
|
|
123
|
+
parseFlowData,compileFlow,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,
|
|
124
|
+
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,assertPrivateSocket,
|
|
125
|
+
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};
|
|
@@ -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-
|
|
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-AYG2Z4S7.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,
|