@humain/humain-code 0.8.2 → 0.8.3

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 (78) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/bundle/chunks/{chunk-EFY2QPVP.js → chunk-2XD7TLKB.js} +4 -4
  3. package/dist/bundle/chunks/{chunk-U4EAJPMO.js → chunk-4GB7A76U.js} +39 -35
  4. package/dist/bundle/chunks/{chunk-PJXBU6CR.js → chunk-7LSTTCSC.js} +111 -89
  5. package/dist/bundle/chunks/{chunk-H2B3WLIM.js → chunk-AW24RHGJ.js} +1 -1
  6. package/dist/bundle/chunks/{chunk-3PJ7NPWN.js → chunk-B3ZLWVDA.js} +1 -1
  7. package/dist/bundle/chunks/{chunk-H7UPU2SH.js → chunk-MUN4ZZZP.js} +706 -703
  8. package/dist/bundle/chunks/chunk-S2US54IU.js +37 -0
  9. package/dist/bundle/chunks/{chunk-G2QMON4O.js → chunk-VSXVZVBE.js} +3 -3
  10. package/dist/bundle/chunks/{chunk-JQBZUFH7.js → chunk-ZAHVC5V2.js} +175 -164
  11. package/dist/bundle/chunks/{compat-ELBUCH6U.js → compat-4ILE5BEC.js} +1 -1
  12. package/dist/bundle/chunks/{dist-QSYDYE3Y.js → dist-I6CI3CG5.js} +6 -6
  13. package/dist/bundle/chunks/{dist-NERIS6SW.js → dist-NXHRL2KY.js} +1 -1
  14. package/dist/bundle/chunks/{entry-SRYLSS5P.js → entry-6XDR2IDE.js} +1 -1
  15. package/dist/bundle/chunks/{flow-implementer-3P3BHQ7E.js → flow-implementer-XOP4MG5X.js} +3 -3
  16. package/dist/bundle/chunks/{inprocess-3PDJKE5F.js → inprocess-MBKFGDM2.js} +4 -4
  17. package/dist/bundle/chunks/{interactive-mode-SDUO5OLD.js → interactive-mode-3322RQEH.js} +2 -2
  18. package/dist/bundle/chunks/{virtual-modules-IU5KWB2C.js → virtual-modules-47MGUPYN.js} +3 -3
  19. package/dist/bundle/cli-runtime.js +3 -3
  20. package/dist/bundle/index.js +6 -6
  21. package/dist/bundle/rpc-entry.js +3 -3
  22. package/dist/coordination/adapter/delivery.d.ts +27 -0
  23. package/dist/coordination/adapter/delivery.d.ts.map +1 -1
  24. package/dist/coordination/adapter/delivery.js +164 -4
  25. package/dist/coordination/adapter/delivery.js.map +1 -1
  26. package/dist/coordination/adapter/index.d.ts.map +1 -1
  27. package/dist/coordination/adapter/index.js +31 -5
  28. package/dist/coordination/adapter/index.js.map +1 -1
  29. package/dist/coordination/adapter/presence.d.ts +5 -0
  30. package/dist/coordination/adapter/presence.d.ts.map +1 -1
  31. package/dist/coordination/adapter/presence.js +25 -3
  32. package/dist/coordination/adapter/presence.js.map +1 -1
  33. package/dist/coordination/adapter/question-routing.d.ts +7 -0
  34. package/dist/coordination/adapter/question-routing.d.ts.map +1 -0
  35. package/dist/coordination/adapter/question-routing.js +40 -0
  36. package/dist/coordination/adapter/question-routing.js.map +1 -0
  37. package/dist/coordination/adapter/receipts.d.ts +7 -0
  38. package/dist/coordination/adapter/receipts.d.ts.map +1 -1
  39. package/dist/coordination/adapter/receipts.js +25 -2
  40. package/dist/coordination/adapter/receipts.js.map +1 -1
  41. package/dist/coordination/adapter/tool.d.ts +19 -3
  42. package/dist/coordination/adapter/tool.d.ts.map +1 -1
  43. package/dist/coordination/adapter/tool.js +93 -19
  44. package/dist/coordination/adapter/tool.js.map +1 -1
  45. package/dist/coordination/client/client.d.ts +2 -2
  46. package/dist/coordination/client/client.d.ts.map +1 -1
  47. package/dist/coordination/client/client.js +4 -0
  48. package/dist/coordination/client/client.js.map +1 -1
  49. package/dist/coordination/transport/protocol.d.ts.map +1 -1
  50. package/dist/coordination/transport/protocol.js +23 -0
  51. package/dist/coordination/transport/protocol.js.map +1 -1
  52. package/dist/coordination/transport/types.d.ts +11 -1
  53. package/dist/coordination/transport/types.d.ts.map +1 -1
  54. package/dist/coordination/transport/types.js.map +1 -1
  55. package/dist/core/model-runtime.d.ts.map +1 -1
  56. package/dist/core/model-runtime.js +14 -8
  57. package/dist/core/model-runtime.js.map +1 -1
  58. package/dist/core/oauth-account-pool.d.ts +14 -0
  59. package/dist/core/oauth-account-pool.d.ts.map +1 -1
  60. package/dist/core/oauth-account-pool.js +166 -14
  61. package/dist/core/oauth-account-pool.js.map +1 -1
  62. package/dist/core/run-outcome.d.ts +1 -1
  63. package/dist/core/run-outcome.d.ts.map +1 -1
  64. package/dist/core/run-outcome.js +2 -2
  65. package/dist/core/run-outcome.js.map +1 -1
  66. package/dist/core/run-preflight.d.ts.map +1 -1
  67. package/dist/core/run-preflight.js +15 -8
  68. package/dist/core/run-preflight.js.map +1 -1
  69. package/dist/main.d.ts.map +1 -1
  70. package/dist/main.js +2 -0
  71. package/dist/main.js.map +1 -1
  72. package/docs/cli.md +6 -0
  73. package/docs/coordination.md +16 -4
  74. package/docs/environment-variables.md +2 -1
  75. package/docs/providers.md +5 -1
  76. package/npm-shrinkwrap.json +2 -2
  77. package/package.json +1 -1
  78. package/dist/bundle/chunks/chunk-UEW6TUSP.js +0 -36
@@ -1728,7 +1728,7 @@ file,{size:stat.size,mtimeMs:stat.mtimeMs,evidence}),evidence}catch{return unava
1728
1728
  ]`,i=close}else re+=ch.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}return new RegExp(`^${re}$`)},matches=["/"];for(let component of word.split("/").filter(Boolean)){let next=[];for(let dir of matches){if(!/[*?[]/.test(component)){let path=`${dir==="/"?"":dir}/${component}`;(component==="."||component===".."||existsSync6(path))&&next.push(path);continue}let entries;try{entries=readdirSync4(dir)}catch{continue}let re=pattern(component);for(let entry of entries)(component.startsWith(".")||!entry.startsWith(
1729
1729
  "."))&&re.test(entry)&&next.push(`${dir==="/"?"":dir}/${entry}`)}if(matches=next,!matches.length)return word;if(matches.length>64)return null}return matches.length===1?matches[0]:null}function resolveCdTarget(raw){if(!raw.startsWith("/"))return{uncertain:raw};let components=raw.split("/").filter(c=>c!==""),current="/";for(let i=0;i<components.length;i++){let component=components[i];if(component===".")continue;if(component===".."){current=dirname11(current);continue}let next=join15(current,component);
1730
1730
  try{current=realpathSync7(next)}catch(err){if(err.code!=="ENOENT")return{uncertain:raw};try{return lstatSync9(next),{uncertain:raw}}catch{}let rest=components.slice(i);return rest.includes("..")?{uncertain:raw}:{path:join15(current,...rest.filter(c=>c!=="."))}}}return{path:current}}function hasGitEntryAbove(abs){for(let dir=abs;;dir=dirname11(dir)){try{return lstatSync9(join15(dir,".git")),!0}catch(error){let code2=error.code;if(code2!=="ENOENT"&&code2!=="ENOTDIR")return!0}if(dirname11(dir)===dir)
1731
- return!1}}function dispatchRepairChildren(tasks,deps){return deps.dispatchParallel(deps.cwd,deps.runId,tasks,deps.adapter,deps.ctx,deps.run)}function createChildDispatch(deps){let inProcess=process.env.HUMAIN_TERMINAL_FLOW_INPROCESS==="1";return async(tasks,input)=>{for(let task of tasks)task.trace?.logicalTaskId&&deps.repairBudget.inherit(task.trace.logicalTaskId,task.taskId);if(inProcess&&input&&tasks.length===1&&tasks[0].stage==="implementation"){let{inProcessContext}=await import("./inprocess-3PDJKE5F.js");
1731
+ return!1}}function dispatchRepairChildren(tasks,deps){return deps.dispatchParallel(deps.cwd,deps.runId,tasks,deps.adapter,deps.ctx,deps.run)}function createChildDispatch(deps){let inProcess=process.env.HUMAIN_TERMINAL_FLOW_INPROCESS==="1";return async(tasks,input)=>{for(let task of tasks)task.trace?.logicalTaskId&&deps.repairBudget.inherit(task.trace.logicalTaskId,task.taskId);if(inProcess&&input&&tasks.length===1&&tasks[0].stage==="implementation"){let{inProcessContext}=await import("./inprocess-MBKFGDM2.js");
1732
1732
  return deps.dispatchParallel(deps.cwd,deps.runId,tasks,deps.adapter,inProcessContext(deps.ctx,input),deps.run)}return deps.dispatchParallel(deps.cwd,deps.runId,tasks,deps.adapter,deps.ctx,deps.run)}}var RETRY_SUFFIX=/-retry-(\d+)$/;function leadTaskIdFor(taskId){return taskId.replace(RETRY_SUFFIX,"")}function retryNumberFor(taskId){let m=RETRY_SUFFIX.exec(taskId);return m?Number(m[1]):null}var ESCALATION_RETRY_LABEL=/^retry-\d+$/;function finalAttemptFor(attempts){let last=attempts[attempts.length-1];if(last.result.exitCode===0)return{final:last.result,succeeded:!0};for(let i=attempts.length-2;i>=0&&attempts.slice(i+1).every(a=>ESCALATION_RETRY_LABEL.test(a.label));i--)if(attempts[i].result.
1733
1733
  exitCode===0)return{final:attempts[i].result,succeeded:!0};return{final:last.result,succeeded:!1}}function collectLeadAttempts(leadResults,resumedAttemptResults,escalationResults,retriedLeadTaskIds=[],resumedLeadTaskIds=[]){let resumedByTaskId=new Map;for(let r of resumedAttemptResults){let list2=resumedByTaskId.get(r.taskId)??[];list2.push(r),resumedByTaskId.set(r.taskId,list2)}let retriedSet=new Set(retriedLeadTaskIds),resumedSet=new Set(resumedLeadTaskIds),retriesByLead=new Map;for(let r of escalationResults){
1734
1734
  if(retryNumberFor(r.taskId)===null)continue;let leadTaskId=leadTaskIdFor(r.taskId),list2=retriesByLead.get(leadTaskId)??[];list2.push(r),retriesByLead.set(leadTaskId,list2)}for(let list2 of retriesByLead.values())list2.sort((a,b)=>(retryNumberFor(a.taskId)??0)-(retryNumberFor(b.taskId)??0));return leadResults.map(r=>{let leadTaskId=r.taskId,attempts=[...resumedByTaskId.get(leadTaskId)??[],r].map((result,i)=>({label:i===0?"original":resumedSet.has(leadTaskId)&&i===1?"resume":retriedSet.has(leadTaskId)?
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{ANTHROPIC_USAGE_PROVIDER_ID,HCODE_PROVIDER,fetchWithRetry,getCodexAvailability,getPiUserAgent,isWSL,parseAnthropicSubscriptionUsage,parseSubscriptionCreditAmount}from"./chunk-JQBZUFH7.js";import{addUsageToTotals,createUsageTotals,getSessionUsage,stripAnsi}from"./chunk-3E37CJCE.js";import{raceWithAbortSignal}from"./chunk-JWOPWHVH.js";import{areExperimentalFeaturesEnabled}from"./chunk-UZOIHLNU.js";import{hcodeDisplayName,require_semver}from"./chunk-T2ZGMEMV.js";
2
+ import{ANTHROPIC_USAGE_PROVIDER_ID,HCODE_PROVIDER,fetchWithRetry,getCodexAvailability,getPiUserAgent,isWSL,parseAnthropicSubscriptionUsage,parseSubscriptionCreditAmount}from"./chunk-ZAHVC5V2.js";import{addUsageToTotals,createUsageTotals,getSessionUsage,stripAnsi}from"./chunk-3E37CJCE.js";import{raceWithAbortSignal}from"./chunk-JWOPWHVH.js";import{areExperimentalFeaturesEnabled}from"./chunk-UZOIHLNU.js";import{hcodeDisplayName,require_semver}from"./chunk-T2ZGMEMV.js";
3
3
  import{getThemeInstance,keyHint,theme}from"./chunk-E4VUW4RI.js";import{Container,Text,getNativeClipboard,hyperlink,sanitizeTerminalText,truncateToWidth,visibleWidth,wrapTextWithAnsi}from"./chunk-M5TVWJ5T.js";import{killTrackedDetachedChildrenAsync}from"./chunk-SKCJ25SX.js";import{APP_COMMAND,ENV_OFFLINE,ENV_SKIP_VERSION_CHECK,getVersionCheckUrl}from"./chunk-VFLVWPLZ.js";import{__toESM}from"./chunk-JXWJOIH4.js";var HCODE_LOGIN_MISMATCH_DETAILS="HUMAIN Code's sign-in settings (/api/cli/config or issuer discovery) don't match what this CLI version accepts. Update the CLI with `humain-code update`, or ask the HUMAIN Code platform team to check the server's CLI sign-in configuration.",EMPTY_REASONS={no_cli_models_approved:{reason:"no model is approved for CLI",fix:"Ask an admin to set a model to Web + CLI or CLI only in Settings > Model Access."},provider_key_not_cli_enabled:{reason:"the provider key isn't\
4
4
  enabled for CLI",fix:"Ask an admin to enable CLI on the key in Settings > Provider Keys."},cli_capacity_unconfigured:{reason:"CLI capacity hasn't been configured",fix:"Ask the HUMAIN Code platform team to check the deployment's CLI capacity limits."},provider_key_not_dedicated:{reason:"the provider key is shared or isn't approved for CLI use",fix:"Ask an admin to configure a dedicated key for HUMAIN Code CLI."},models_not_qualified:{reason:"this server hasn't finished CLI setup for the approved\
5
5
  models",fix:"Ask an admin to report it to the HUMAIN Code platform team."}};function hcodeEmptyCatalogMessage(reason){if(!reason)return"Your admin hasn't enabled CLI models yet.";let{reason:why,fix}=EMPTY_REASONS[reason];return`No models are available in the CLI: ${why}. ${fix}`}function hcodeEmptyCatalogReason(cause){return cause.kind==="failed"?{reason:"the model list couldn't be loaded",fix:"Check your network, VPN or Zscaler."}:cause.reason?EMPTY_REASONS[cause.reason]:{reason:"your admin ha\