@humain/humain-code 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/bundle/chunks/{chunk-3CGMVKHA.js → chunk-3E37CJCE.js} +1 -1
  3. package/dist/bundle/chunks/{chunk-7X6DNT45.js → chunk-3PJ7NPWN.js} +8 -6
  4. package/dist/bundle/chunks/{chunk-P2Y2H7SD.js → chunk-6JTCRCNF.js} +2 -2
  5. package/dist/bundle/chunks/{chunk-APNPBT7Y.js → chunk-BRSLXHED.js} +1 -1
  6. package/dist/bundle/chunks/{chunk-KONLZKPL.js → chunk-E4VUW4RI.js} +1 -1
  7. package/dist/bundle/chunks/{chunk-E7OBH44W.js → chunk-EFY2QPVP.js} +6 -6
  8. package/dist/bundle/chunks/{chunk-6YVORXTX.js → chunk-G2QMON4O.js} +253 -232
  9. package/dist/bundle/chunks/{chunk-QRRVZYTG.js → chunk-H2B3WLIM.js} +2 -2
  10. package/dist/bundle/chunks/{chunk-XZ7FTBXS.js → chunk-H7UPU2SH.js} +1187 -1196
  11. package/dist/bundle/chunks/{chunk-NICPFMOP.js → chunk-JKX5EGOT.js} +1 -1
  12. package/dist/bundle/chunks/{chunk-P42E6YY6.js → chunk-JQBZUFH7.js} +33 -32
  13. package/dist/bundle/chunks/{chunk-D3KYOSQY.js → chunk-JSHKS7VH.js} +1 -1
  14. package/dist/bundle/chunks/{chunk-SXOIQWNX.js → chunk-JX6YIPNK.js} +1 -1
  15. package/dist/bundle/chunks/{chunk-WBSGWISD.js → chunk-M5TVWJ5T.js} +5 -4
  16. package/dist/bundle/chunks/{chunk-6TTMNQXI.js → chunk-PJXBU6CR.js} +43 -40
  17. package/dist/bundle/chunks/{chunk-CQ2CE3RB.js → chunk-QFDZEUFU.js} +2 -2
  18. package/dist/bundle/chunks/{chunk-DD5UT56Y.js → chunk-R2KD2HFT.js} +67 -66
  19. package/dist/bundle/chunks/{chunk-IMUFBWEK.js → chunk-T2ZGMEMV.js} +42 -41
  20. package/dist/bundle/chunks/{chunk-ROFZVEFN.js → chunk-U4EAJPMO.js} +45 -44
  21. package/dist/bundle/chunks/{chunk-FQ4KS5S4.js → chunk-UZOIHLNU.js} +1 -1
  22. package/dist/bundle/chunks/{chunk-DJG2WUNM.js → chunk-ZSWU5KKA.js} +1 -1
  23. package/dist/bundle/chunks/{compat-SRCNS6OQ.js → compat-ELBUCH6U.js} +1 -1
  24. package/dist/bundle/chunks/{dist-4OMLHRJE.js → dist-NERIS6SW.js} +1 -1
  25. package/dist/bundle/chunks/{dist-TRAK7EXI.js → dist-QSYDYE3Y.js} +6 -6
  26. package/dist/bundle/chunks/{easter-egg-3d-VVUF3C3X.js → easter-egg-3d-VZC5WOYV.js} +1 -1
  27. package/dist/bundle/chunks/{execute-I3WGGPWL.js → execute-6MEJJF2T.js} +2 -2
  28. package/dist/bundle/chunks/{flow-implementer-4KO3Q4B5.js → flow-implementer-3P3BHQ7E.js} +4 -4
  29. package/dist/bundle/chunks/{inprocess-TOBRVK4C.js → inprocess-3PDJKE5F.js} +4 -4
  30. package/dist/bundle/chunks/{interactive-mode-BJJKPBXD.js → interactive-mode-SDUO5OLD.js} +2 -2
  31. package/dist/bundle/chunks/{session-picker-4JQEGLDD.js → session-picker-EYKCMFQR.js} +1 -1
  32. package/dist/bundle/chunks/{startup-ui-AKTA4NDP.js → startup-ui-7ODOR34R.js} +2 -2
  33. package/dist/bundle/chunks/{trace-command-7ORDQ3JS.js → trace-command-VM7FBWPE.js} +4 -4
  34. package/dist/bundle/chunks/{virtual-modules-3CT5BMBA.js → virtual-modules-IU5KWB2C.js} +8 -8
  35. package/dist/bundle/cli-runtime.js +3 -3
  36. package/dist/bundle/index.js +8 -8
  37. package/dist/bundle/rpc-entry.js +3 -3
  38. package/dist/core/model-resolver.js +2 -2
  39. package/dist/core/model-resolver.js.map +1 -1
  40. package/dist/core/settings-manager.d.ts +4 -0
  41. package/dist/core/settings-manager.d.ts.map +1 -1
  42. package/dist/core/settings-manager.js +17 -0
  43. package/dist/core/settings-manager.js.map +1 -1
  44. package/dist/core/settings-schema.d.ts +2 -0
  45. package/dist/core/settings-schema.d.ts.map +1 -1
  46. package/dist/core/settings-schema.js +10 -0
  47. package/dist/core/settings-schema.js.map +1 -1
  48. package/dist/extensions/usage/index.js +5 -5
  49. package/dist/extensions/usage/index.js.map +1 -1
  50. package/dist/humain/gateway/client.d.ts.map +1 -1
  51. package/dist/humain/gateway/client.js +36 -9
  52. package/dist/humain/gateway/client.js.map +1 -1
  53. package/dist/humain/gateway/http.d.ts.map +1 -1
  54. package/dist/humain/gateway/http.js +26 -6
  55. package/dist/humain/gateway/http.js.map +1 -1
  56. package/dist/humain/gateway/provider.d.ts.map +1 -1
  57. package/dist/humain/gateway/provider.js +9 -2
  58. package/dist/humain/gateway/provider.js.map +1 -1
  59. package/dist/humain/hcode/facade.d.ts +12 -1
  60. package/dist/humain/hcode/facade.d.ts.map +1 -1
  61. package/dist/humain/hcode/facade.js +35 -8
  62. package/dist/humain/hcode/facade.js.map +1 -1
  63. package/dist/humain/hcode/login-copy.d.ts.map +1 -1
  64. package/dist/humain/hcode/login-copy.js +10 -0
  65. package/dist/humain/hcode/login-copy.js.map +1 -1
  66. package/dist/modes/interactive/components/settings-selector.d.ts +6 -0
  67. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  68. package/dist/modes/interactive/components/settings-selector.js +26 -0
  69. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  70. package/dist/modes/interactive/components/status-indicator.d.ts +35 -1
  71. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  72. package/dist/modes/interactive/components/status-indicator.js +179 -3
  73. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  74. package/dist/modes/interactive/components/working-indicator-engine.d.ts +32 -0
  75. package/dist/modes/interactive/components/working-indicator-engine.d.ts.map +1 -0
  76. package/dist/modes/interactive/components/working-indicator-engine.js +112 -0
  77. package/dist/modes/interactive/components/working-indicator-engine.js.map +1 -0
  78. package/dist/modes/interactive/fullscreen.d.ts +13 -0
  79. package/dist/modes/interactive/fullscreen.d.ts.map +1 -0
  80. package/dist/modes/interactive/fullscreen.js +25 -0
  81. package/dist/modes/interactive/fullscreen.js.map +1 -0
  82. package/dist/modes/interactive/interactive-mode.d.ts +4 -1
  83. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  84. package/dist/modes/interactive/interactive-mode.js +117 -19
  85. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  86. package/dist/modes/interactive/theme/humain-dark.json +5 -4
  87. package/dist/modes/interactive/theme/humain-light.json +6 -5
  88. package/docs/development.md +7 -0
  89. package/docs/providers.md +14 -4
  90. package/docs/settings.md +20 -0
  91. package/docs/usage.md +2 -0
  92. package/npm-shrinkwrap.json +2 -2
  93. package/package.json +1 -1
  94. package/schemas/settings.schema.json +29 -0
  95. package/dist/bundle/chunks/chunk-YPZPCHNV.js +0 -3
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
2
  import{ALL_CAPABILITIES,CI_ID_RE,DEFAULT_PROVIDER_PREFERENCE,FLOW_APPROVED_INPUTS_FILE,LINEAGE_ENV,MAX_RECOVERY_RAW_BYTES,METHOD,THINKING_LEVELS,TIER_CAPABILITIES,TIER_LITERALS,billingRouteFor,buildAliasTable,classifyModelName,classifyTimeout,dispatchAdmissionBlocked,dispatchCustody,dispatchCustodyDiagnostic,exactModelBindingsFor,formatDuration,isCredentialName,isQuotaError,isThinkingLevel,killProcessTree,lineageMarker,listDispatchProcesses,liveDispatchPids,mergeLayers,ownedDispatchIdentities,providerFallbacksFor,
3
- readFlowAssetJson,redactCheckArgv,redactCredentials,registerDispatchPid,rereviewFloor,resolveAlias,resolveExactAlias,sanitizeControlChars,sanitizeRepairFeedback,scanEvents,scanLineage,shortName,summarizeStderr,tierIndex,tierOf,tierOfModel,tiersToBindings}from"./chunk-HQMUDHC3.js";import{ScrollView,getKeybindings,truncateToWidth,visibleWidth,wrapTextWithAnsi}from"./chunk-WBSGWISD.js";import{assertDhRetryAdmission,resolveDhEffectiveTerminals}from"./chunk-L4J7SMJB.js";import{FLOW_ID_PATTERN,
3
+ readFlowAssetJson,redactCheckArgv,redactCredentials,registerDispatchPid,rereviewFloor,resolveAlias,resolveExactAlias,sanitizeControlChars,sanitizeRepairFeedback,scanEvents,scanLineage,shortName,summarizeStderr,tierIndex,tierOf,tierOfModel,tiersToBindings}from"./chunk-HQMUDHC3.js";import{ScrollView,getKeybindings,truncateToWidth,visibleWidth,wrapTextWithAnsi}from"./chunk-M5TVWJ5T.js";import{assertDhRetryAdmission,resolveDhEffectiveTerminals}from"./chunk-L4J7SMJB.js";import{FLOW_ID_PATTERN,
4
4
  FLOW_MODEL_ID_PATTERN,FlowContractError,FlowCountSchema,FlowDigestSchema,FlowFailureClassSchema,FlowIdSchema,FlowMicrousdSchema,FlowModelRefSchema,FlowPositiveIntSchema,FlowProfileRefSchema,FlowReasonClassSchema,FlowRoleSchema,FlowSelectionEffortSchema,FlowSizeSchema,FlowTimestampSchema,StrictObject,canonicalWithout,compileFlow,hasDuplicateModels,lit,parseFlowData,partialByRole,verifyFlowDigest}from"./chunk-PVNXN2TC.js";import{typebox_exports}from"./chunk-VEGJT52D.js";var FlowProfileError=class extends Error{code;path;constructor(code2,message,path){super(message),this.name="FlowProfileError",this.code=code2,path!==void 0&&(this.path=path)}};import{stripVTControlCharacters}from"node:util";var FlowEffortSchema=typebox_exports.Union([typebox_exports.Literal("low"),typebox_exports.Literal("medium"),typebox_exports.Literal("high")]),FlowRoleBindingSchema=StrictObject({primary:FlowModelRefSchema,backups:typebox_exports.Array(FlowModelRefSchema,{maxItems:8}),effort:FlowEffortSchema}),FLOW_MODEL_SELECTION_TIERS=["cheap","mid","premium","frontier"],FLOW_MODEL_SELECTION_CAPABILITIES=["scout","scope_scout","worker","implementation_fast","analysis_mid","technical_lead","lead_small","lead","\
5
5
  lead_large","implementation_strong","technical_review","integration_review","migration_review","performance_review","api_contract_review","qa_agent","analysis_strong","architect","security_review","triage"],FlowTierSelectionSchema=StrictObject({primary:typebox_exports.Optional(FlowModelRefSchema),backups:typebox_exports.Optional(typebox_exports.Array(FlowModelRefSchema,{maxItems:8}))}),FlowCapabilitySelectionSchema=StrictObject({primary:typebox_exports.Optional(FlowModelRefSchema),backups:typebox_exports.
6
6
  Optional(typebox_exports.Array(FlowModelRefSchema,{maxItems:8})),effort:typebox_exports.Optional(FlowSelectionEffortSchema)}),optionalEach=(keys,schema)=>StrictObject(Object.fromEntries(keys.map(key=>[key,typebox_exports.Optional(schema)]))),FlowModelSelectionSchema=StrictObject({tiers:typebox_exports.Optional(optionalEach(FLOW_MODEL_SELECTION_TIERS,FlowTierSelectionSchema)),capabilities:typebox_exports.Optional(optionalEach(FLOW_MODEL_SELECTION_CAPABILITIES,FlowCapabilitySelectionSchema))}),FlowProfileV1Schema=StrictObject(
@@ -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-TOBRVK4C.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-3PDJKE5F.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)?