@humain/humain-code 0.4.17 → 0.4.18

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 (38) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/dist/bundle/chunks/{chunk-W2QRCQBX.js → chunk-26EAEXO5.js} +18 -16
  3. package/dist/bundle/chunks/{chunk-65U7MPF4.js → chunk-2ZFUMXOZ.js} +11 -11
  4. package/dist/bundle/chunks/{chunk-AOL6QG6L.js → chunk-3UXBFT4Q.js} +64 -64
  5. package/dist/bundle/chunks/{chunk-PTP2ZHFQ.js → chunk-3XDL5ZE4.js} +1 -1
  6. package/dist/bundle/chunks/{chunk-DUSJT2W4.js → chunk-7VY5IL74.js} +1 -1
  7. package/dist/bundle/chunks/{chunk-X6OTEVGA.js → chunk-G6ABHCPB.js} +45 -30
  8. package/dist/bundle/chunks/{chunk-FHVNUUBF.js → chunk-HPSQKIWK.js} +1 -1
  9. package/dist/bundle/chunks/{chunk-36Q5UVQL.js → chunk-L5OUCJ7N.js} +9 -9
  10. package/dist/bundle/chunks/{chunk-LG2PJ6JN.js → chunk-NSMMDV3N.js} +2 -2
  11. package/dist/bundle/chunks/{chunk-ZRGFX6T6.js → chunk-OWLBGSXY.js} +2 -2
  12. package/dist/bundle/chunks/{chunk-4NFYTS4C.js → chunk-P4UKLIQB.js} +3 -3
  13. package/dist/bundle/chunks/{chunk-DNGJMRJW.js → chunk-SCIGZFN5.js} +11 -11
  14. package/dist/bundle/chunks/chunk-YLYOJQQX.js +1951 -0
  15. package/dist/bundle/chunks/{chunk-TJG52LZB.js → chunk-YMBXWW36.js} +1 -1
  16. package/dist/bundle/chunks/{cli-SRI4UOSL.js → cli-2NKM2RNJ.js} +1 -1
  17. package/dist/bundle/chunks/{compat-ARQPWKBQ.js → compat-VDGEZSVM.js} +1 -1
  18. package/dist/bundle/chunks/{dist-D7M52E3X.js → dist-ZJIYY3GA.js} +3 -3
  19. package/dist/bundle/chunks/{easter-egg-3d-4SUPLBUF.js → easter-egg-3d-VGJ77XZQ.js} +1 -1
  20. package/dist/bundle/chunks/es-N6YFJOD7.js +1901 -0
  21. package/dist/bundle/chunks/{esm-NCUV2DF7.js → esm-GIR7QH65.js} +1 -1
  22. package/dist/bundle/chunks/{execute-NTO3U76E.js → execute-ZBEZNJ4E.js} +1 -1
  23. package/dist/bundle/chunks/{extract-BKBHK4AK.js → extract-RFWEHH6W.js} +3 -3
  24. package/dist/bundle/chunks/{google-generative-ai-SJ4JO2MY.js → google-generative-ai-4OVYRP24.js} +1 -1
  25. package/dist/bundle/chunks/{google-vertex-KNLNNDET.js → google-vertex-3WQAZJQD.js} +1 -1
  26. package/dist/bundle/chunks/{node-ELWNZC34.js → node-A6SZ3T7E.js} +185 -185
  27. package/dist/bundle/chunks/{runtime-VGSK3QCM.js → runtime-HJEUOD4R.js} +1 -1
  28. package/dist/bundle/chunks/{undici-N4LWJ3S3.js → undici-4BK3MVJV.js} +1 -1
  29. package/dist/bundle/chunks/{virtual-modules-LP2ULVLW.js → virtual-modules-CFJTDIXL.js} +2 -2
  30. package/dist/bundle/cli-runtime.js +2 -2
  31. package/dist/bundle/flow/package.json +1 -1
  32. package/dist/bundle/index.js +5 -5
  33. package/dist/bundle/rpc-entry.js +2 -2
  34. package/npm-shrinkwrap.json +6 -6
  35. package/package.json +2 -2
  36. package/dist/bundle/chunks/chunk-4XU7TDAL.js +0 -1954
  37. package/dist/bundle/chunks/es-YEFEOGR3.js +0 -1905
  38. /package/dist/bundle/chunks/{chunk-XQRYOCHA.js → chunk-WZMA7HAJ.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{mcpNamespace,require_proper_lockfile,validateMcpServerConfig}from"./chunk-36Q5UVQL.js";import{CONFIG_DIR_NAME,canonicalizePath,resolvePath,stripBom}from"./chunk-YRCLNWFV.js";import{__toESM}from"./chunk-JXWJOIH4.js";import{spawn}from"node:child_process";function openBrowser(target){let[cmd,args]=process.platform==="darwin"?["open",[target]]:process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",target]]:["xdg-open",[target]];spawn(cmd,args,{stdio:"ignore",detached:!0}).on("error",()=>{}).unref()}var import_proper_lockfile=__toESM(require_proper_lockfile(),1);import{existsSync,mkdirSync,readFileSync,writeFileSync}from"node:fs";import{homedir}from"node:os";import{dirname,join}from"node:path";var TRUST_REQUIRING_PROJECT_CONFIG_RESOURCES=["settings.json","mcp.json","extensions","skills","prompts","themes","SYSTEM.md","APPEND_SYSTEM.md"];function normalizeCwd(cwd){return canonicalizePath(resolvePath(cwd))}function findNearestTrustEntry(data,cwd){let currentDir=normalizeCwd(cwd);for(;;){let value=data[currentDir];if(value===!0||value===!1)return{path:currentDir,decision:value};let parentDir=dirname(currentDir);if(parentDir===currentDir)return null;currentDir=parentDir}}function getProjectTrustParentPath(cwd){
2
+ import{mcpNamespace,require_proper_lockfile,validateMcpServerConfig}from"./chunk-L5OUCJ7N.js";import{CONFIG_DIR_NAME,canonicalizePath,resolvePath,stripBom}from"./chunk-YRCLNWFV.js";import{__toESM}from"./chunk-JXWJOIH4.js";import{spawn}from"node:child_process";function openBrowser(target){let[cmd,args]=process.platform==="darwin"?["open",[target]]:process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",target]]:["xdg-open",[target]];spawn(cmd,args,{stdio:"ignore",detached:!0}).on("error",()=>{}).unref()}var import_proper_lockfile=__toESM(require_proper_lockfile(),1);import{existsSync,mkdirSync,readFileSync,writeFileSync}from"node:fs";import{homedir}from"node:os";import{dirname,join}from"node:path";var TRUST_REQUIRING_PROJECT_CONFIG_RESOURCES=["settings.json","mcp.json","extensions","skills","prompts","themes","SYSTEM.md","APPEND_SYSTEM.md"];function normalizeCwd(cwd){return canonicalizePath(resolvePath(cwd))}function findNearestTrustEntry(data,cwd){let currentDir=normalizeCwd(cwd);for(;;){let value=data[currentDir];if(value===!0||value===!1)return{path:currentDir,decision:value};let parentDir=dirname(currentDir);if(parentDir===currentDir)return null;currentDir=parentDir}}function getProjectTrustParentPath(cwd){
3
3
  let trustPath=normalizeCwd(cwd),parentDir=dirname(trustPath);return parentDir===trustPath?void 0:parentDir}function getProjectTrustOptions(cwd,options){let trustPath=normalizeCwd(cwd),trustOptions=[{label:"Trust",trusted:!0,updates:[{path:trustPath,decision:!0}],savedPath:trustPath}],parentPath=getProjectTrustParentPath(cwd);return parentPath!==void 0&&trustOptions.push({label:`Trust parent folder (${parentPath})`,trusted:!0,updates:[{path:parentPath,decision:!0},{path:trustPath,decision:null}],
4
4
  savedPath:parentPath}),options?.includeSessionOnly&&trustOptions.push({label:"Trust (this session only)",trusted:!0,updates:[]}),trustOptions.push({label:"Do not trust",trusted:!1,updates:[{path:trustPath,decision:!1}],savedPath:trustPath}),options?.includeSessionOnly&&trustOptions.push({label:"Do not trust (this session only)",trusted:!1,updates:[]}),trustOptions}function readTrustFile(path){if(!existsSync(path))return{};let parsed;try{parsed=JSON.parse(stripBom(readFileSync(path,"utf-8")))}catch(error){
5
5
  let message=error instanceof Error?error.message:String(error);throw new Error(`Failed to read trust store ${path}: ${message}`)}if(typeof parsed!="object"||parsed===null||Array.isArray(parsed))throw new Error(`Invalid trust store ${path}: expected an object`);let data={};for(let[key,value]of Object.entries(parsed)){if(value!==!0&&value!==!1&&value!==null)throw new Error(`Invalid trust store ${path}: value for ${JSON.stringify(key)} must be true, false, or null`);data[key]=value}return data}function writeTrustFile(path,data){
@@ -1,5 +1,5 @@
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-DUSJT2W4.js";import{ProjectTrustStore,addMcpServerConfig,loadMcpConfig,openBrowser,removeMcpServerConfig}from"./chunk-TJG52LZB.js";import{source_default}from"./chunk-XQRYOCHA.js";import{getMcpToolExposure,validateMcpServerConfig}from"./chunk-36Q5UVQL.js";import"./chunk-UGXYG7HN.js";import{APP_COMMAND,CONFIG_DIR_NAME}from"./chunk-YRCLNWFV.js";
2
+ import{McpOAuthCredentialStore,McpServerConnection,McpServerLog,McpSignInCancelledError,createDefaultTransport,signInMcpServer}from"./chunk-7VY5IL74.js";import{ProjectTrustStore,addMcpServerConfig,loadMcpConfig,openBrowser,removeMcpServerConfig}from"./chunk-YMBXWW36.js";import{source_default}from"./chunk-WZMA7HAJ.js";import{getMcpToolExposure,validateMcpServerConfig}from"./chunk-L5OUCJ7N.js";import"./chunk-UGXYG7HN.js";import{APP_COMMAND,CONFIG_DIR_NAME}from"./chunk-YRCLNWFV.js";
3
3
  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>
@@ -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-65U7MPF4.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-2ZFUMXOZ.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,StringEnum,createFauxCore,envApiKeyAuth,fauxAssistantMessage,fauxProvider,fauxText,fauxThinking,fauxToolCall,
5
5
  getOverflowPatterns,isContextOverflow,isRecoverableLength,lazyOAuth,reduceAssistantMessageFrames,validateToolArguments,validateToolCall}from"./chunk-Y26OS23T.js";import{DEFAULT_MAX_AGENT_RETRY_DELAY_MS,getAssistantRetryDelayMs,isRetryableAssistantError,retryAssistantCall,retryDelayMs}from"./chunk-PY7SOXCA.js";import{cleanupSessionResources,getOpenAICodexTokenIdentity,registerSessionResourceCleanup}from"./chunk-DBL35X7L.js";import{parseJsonWithRepair,parseStreamingJson,parseStreamingJsonWhileStreaming,
6
6
  parseToolCallArguments,repairJson}from"./chunk-YDBNMIA3.js";import{InMemoryCredentialStore,InMemoryModelsStore,ModelsError,calculateCost,clampThinkingLevel,collapseSystemMessages,commitLoginCredential,contentText,createInitialSystemMessage,createModels,createProvider,declarationsEqual,defaultProviderAuthContext,getCurrentSystemMessage,getCurrentSystemPrompt,getCurrentTools,getDeclaredTools,getInitialSystemMessage,getModelType,getSupportedThinkingLevels,getSystemMessageText,getToolStateChanges,
@@ -1,8 +1,8 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import"./chunk-4NFYTS4C.js";import{FLOW_ACCOUNT_PERSISTENCE_NOTICE,FLOW_MESSAGE_MAX_LENGTH,FLOW_SETUP_TERMINAL_ONLY,assertDhRetryAdmission,assessNodeFallback,checkDhControlFence,dhCanonicalText,discoverAgents,flowBuildUnavailable,getFlowAccountsHost,getFlowChildLaunchHost,getFlowControlHost,getFlowTraceProducer,parseDhControlDelivery,parseFlowCommand,parseFlowControlCommandV1,parseFlowControlReceiptV1,parseFlowMessageReceiptV1,parseFlowStatusV1,renderFlowHelp,renderTaskWithContext,resolveDhEffectiveTerminals}from"./chunk-AOL6QG6L.js";
3
- import"./chunk-PTP2ZHFQ.js";import"./chunk-QEF72EIZ.js";import"./chunk-FHVNUUBF.js";import"./chunk-TJG52LZB.js";import"./chunk-SCBU5WOP.js";import"./chunk-65U7MPF4.js";import"./chunk-LG2PJ6JN.js";import{ScrollView,matchesKey,mixColors,styleText,truncateToWidth,visibleWidth,wrapTextWithAnsi}from"./chunk-ZRGFX6T6.js";import"./chunk-XQRYOCHA.js";import"./chunk-DNGJMRJW.js";import"./chunk-36Q5UVQL.js";import"./chunk-UGXYG7HN.js";
2
+ import"./chunk-P4UKLIQB.js";import{FLOW_ACCOUNT_PERSISTENCE_NOTICE,FLOW_MESSAGE_MAX_LENGTH,FLOW_SETUP_TERMINAL_ONLY,assertDhRetryAdmission,assessNodeFallback,checkDhControlFence,dhCanonicalText,discoverAgents,flowBuildUnavailable,getFlowAccountsHost,getFlowChildLaunchHost,getFlowControlHost,getFlowTraceProducer,parseDhControlDelivery,parseFlowCommand,parseFlowControlCommandV1,parseFlowControlReceiptV1,parseFlowMessageReceiptV1,parseFlowStatusV1,renderFlowHelp,renderTaskWithContext,resolveDhEffectiveTerminals}from"./chunk-3UXBFT4Q.js";
3
+ import"./chunk-3XDL5ZE4.js";import"./chunk-QEF72EIZ.js";import"./chunk-HPSQKIWK.js";import"./chunk-YMBXWW36.js";import"./chunk-SCBU5WOP.js";import"./chunk-2ZFUMXOZ.js";import"./chunk-NSMMDV3N.js";import{ScrollView,matchesKey,mixColors,styleText,truncateToWidth,visibleWidth,wrapTextWithAnsi}from"./chunk-OWLBGSXY.js";import"./chunk-WZMA7HAJ.js";import"./chunk-SCIGZFN5.js";import"./chunk-L5OUCJ7N.js";import"./chunk-UGXYG7HN.js";
4
4
  import"./chunk-QYCOHSI7.js";import"./chunk-H2FY3PEV.js";import"./chunk-KQM7ZGL6.js";import"./chunk-CIA6V3BP.js";import"./chunk-XQZG5HPT.js";import"./chunk-FACBDLFU.js";import{FLOW_DIGEST_PATTERN,FLOW_ID_PATTERN,FLOW_MODEL_ID_PATTERN,FLOW_ROLES,FlowContractError,FlowCountSchema,FlowDigestSchema,FlowFailureClassSchema,FlowIdSchema,FlowMicrousdSchema,FlowModelRefSchema,FlowPositiveIntSchema,FlowProfileRefSchema,FlowReasonClassSchema,FlowRoleSchema,FlowSizeSchema,
5
- FlowTimestampSchema,StrictObject,canonicalFlowJson,canonicalWithout,compileFlow,hasDuplicateModels,lit,parseFlowData,partialByRole,verifyFlowDigest}from"./chunk-NCQ6WAQK.js";import{getAgentDir}from"./chunk-YRCLNWFV.js";import"./chunk-4XU7TDAL.js";import"./chunk-Y26OS23T.js";import"./chunk-PY7SOXCA.js";import"./chunk-DBL35X7L.js";import"./chunk-YDBNMIA3.js";import"./chunk-5K5RFXXO.js";import"./chunk-IJYVMOB4.js";import"./chunk-VEYTRNQC.js";
5
+ FlowTimestampSchema,StrictObject,canonicalFlowJson,canonicalWithout,compileFlow,hasDuplicateModels,lit,parseFlowData,partialByRole,verifyFlowDigest}from"./chunk-NCQ6WAQK.js";import{getAgentDir}from"./chunk-YRCLNWFV.js";import"./chunk-YLYOJQQX.js";import"./chunk-Y26OS23T.js";import"./chunk-PY7SOXCA.js";import"./chunk-DBL35X7L.js";import"./chunk-YDBNMIA3.js";import"./chunk-5K5RFXXO.js";import"./chunk-IJYVMOB4.js";import"./chunk-VEYTRNQC.js";
6
6
  import"./chunk-AWCJWXGD.js";import{typebox_exports}from"./chunk-OKALNPTJ.js";import"./chunk-JXWJOIH4.js";import{resolve}from"node:path";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","\
7
7
  lead_large","implementation_strong","technical_review","integration_review","migration_review","performance_review","api_contract_review","qa_agent","analysis_strong","architect","security_review","triage"],FlowSelectionEffortSchema=lit("off","minimal","low","medium","high","xhigh","max"),FlowTierSelectionSchema=StrictObject({primary:typebox_exports.Optional(FlowModelRefSchema),backups:typebox_exports.Optional(typebox_exports.Array(FlowModelRefSchema,{maxItems:8}))}),FlowCapabilitySelectionSchema=StrictObject(
8
8
  {primary:typebox_exports.Optional(FlowModelRefSchema),backups:typebox_exports.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(
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{ARMIN_HEIGHT,ARMIN_WIDTH,isArminPixel}from"./chunk-FHVNUUBF.js";import{backgroundAnsi,colorToRgb,foregroundAnsi,formatKeyText,getKeybindings,indexedColor,rgbColor,theme,visibleWidth}from"./chunk-ZRGFX6T6.js";import"./chunk-XQRYOCHA.js";import"./chunk-DNGJMRJW.js";import"./chunk-YRCLNWFV.js";import"./chunk-JXWJOIH4.js";var DEPTH=.7,FLY_START=.1,FLY_DURATION=1.3,START_SCALE=.1;function createModel(columns,rows,pixel,options){let blocks=[];for(let row=0;row<rows;row++)for(let column=0;column<columns;column++){let color=pixel(column,row);color&&blocks.push({home:[column,row,0],color})}return{columns,rows,blocks,cameraDistance:options.cameraDistance,radius:Math.hypot(columns/2,rows/2,1+DEPTH/2),widthShare:options.widthShare,puzzleMoves:random=>options.puzzleMoves(random,blocks.length),origin:options.origin}}var CORAL=[
2
+ import{ARMIN_HEIGHT,ARMIN_WIDTH,isArminPixel}from"./chunk-HPSQKIWK.js";import{backgroundAnsi,colorToRgb,foregroundAnsi,formatKeyText,getKeybindings,indexedColor,rgbColor,theme,visibleWidth}from"./chunk-OWLBGSXY.js";import"./chunk-WZMA7HAJ.js";import"./chunk-SCIGZFN5.js";import"./chunk-YRCLNWFV.js";import"./chunk-JXWJOIH4.js";var DEPTH=.7,FLY_START=.1,FLY_DURATION=1.3,START_SCALE=.1;function createModel(columns,rows,pixel,options){let blocks=[];for(let row=0;row<rows;row++)for(let column=0;column<columns;column++){let color=pixel(column,row);color&&blocks.push({home:[column,row,0],color})}return{columns,rows,blocks,cameraDistance:options.cameraDistance,radius:Math.hypot(columns/2,rows/2,1+DEPTH/2),widthShare:options.widthShare,puzzleMoves:random=>options.puzzleMoves(random,blocks.length),origin:options.origin}}var CORAL=[
3
3
  228,138,122],BLUE=[79,142,179],YELLOW=[234,182,93],PI_LOGO_PIXELS=["ccc.","b.c.","bb.y","b..y"],PI_LOGO_COLORS={c:CORAL,b:BLUE,y:YELLOW};function piLogoModel(origin){return createModel(4,4,(column,row)=>PI_LOGO_COLORS[PI_LOGO_PIXELS[row][column]],{cameraDistance:10,widthShare:.35,puzzleMoves:random=>random<.4?2:1,origin})}function arminModel(color){return createModel(ARMIN_WIDTH,ARMIN_HEIGHT,(column,row)=>isArminPixel(column,row)?color:void 0,{cameraDistance:80,widthShare:.45,puzzleMoves:(random,blockCount)=>Math.
4
4
  round(blockCount*(.03+random*.04)),origin:void 0})}var PUZZLE_START=FLY_START+FLY_DURATION+3,PUZZLE_STEP=.3,PUZZLE_STEPS=12,PUZZLE_RETURN=1,PUZZLE_HOLD=.6,PUZZLE_CYCLE=PUZZLE_STEP*PUZZLE_STEPS+PUZZLE_RETURN+PUZZLE_HOLD,PUZZLE_MOVES=[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]];function shuffleSteps(model,cycle){let{columns,rows}=model,positions=model.blocks.map(block=>block.home),steps=[positions],lastMoved=new Set,random=cycle*7919+1,next=()=>hash(random++),
5
5
  key=([x,y,z])=>((z+1)*rows+y)*columns+x;for(let step=0;step<PUZZLE_STEPS;step++){let occupied=new Set(positions.map(key)),nextPositions=[...positions],moved=new Set,moveCount=model.puzzleMoves(next());for(let move=0;move<moveCount;move++){let candidates=[];for(let block=0;block<positions.length;block++){if(moved.has(block))continue;let[x,y,z]=positions[block];for(let[dx,dy,dz]of PUZZLE_MOVES){let target=[x+dx,y+dy,z+dz];target[0]<0||target[0]>=columns||target[1]<0||target[1]>=rows||target[2]<-1||