mlld
Version:
mlld: llm scripting language
1 lines • 1.56 MB
Source Map (JSON)
{"version":3,"sources":["../security/policy/patterns.ts","../security/command/analyzer/CommandAnalyzer.ts","../core/config/utils.ts","../core/config/loader.ts","../security/import/ImportApproval.ts","../security/cache/ImmutableCache.ts","../security/url/URLValidator.ts","../security/registry/RegistryResolver.ts","../security/registry/AdvisoryChecker.ts","../security/registry/adapters/GistAdapter.ts","../security/registry/adapters/RepositoryAdapter.ts","../security/registry/StorageManager.ts","../security/path/PathValidator.ts","../security/SecurityManager.ts","../core/security/ImportApproval.ts","../core/security/GistTransformer.ts","../core/registry/utils/moduleNames.ts","../core/registry/LockFile.ts","../core/registry/ConfigFile.ts","../core/registry/ProjectConfig.ts","../core/registry/Cache.ts","../core/registry/ModuleCache.ts","../core/registry/utils/ModuleMetadata.ts","../core/registry/RegistryResolver.ts","../core/registry/StatsCollector.ts","../core/registry/RegistryManager.ts","../core/utils/gitStatus.ts","../core/resolvers/ResolverManager.ts","../core/resolvers/DynamicModuleResolver.ts","../services/fs/NodeFileSystem.ts","../services/fs/PathService.ts","../interpreter/builtin/transformers.ts","../interpreter/env/NodeShadowEnvironment.ts","../interpreter/env/CacheManager.ts","../interpreter/env/DebugUtils.ts","../interpreter/env/ErrorUtils.ts","../interpreter/env/executors/BaseCommandExecutor.ts","../interpreter/utils/alias-resolver.ts","../interpreter/env/executors/ShellCommandExecutor.ts","../core/errors/patterns/parse-errors.generated.js","../core/errors/patterns/js-errors.generated.js","../core/errors/patterns/init.ts","../interpreter/env/executors/implicit-return.ts","../interpreter/env/executors/JavaScriptExecutor.ts","../interpreter/env/executors/NodeExecutor.ts","../interpreter/env/python-variable-helpers.ts","../interpreter/env/executors/PythonExecutor.ts","../interpreter/env/bash-variable-adapter.ts","../interpreter/env/executors/BashExecutor.ts","../interpreter/env/executors/CommandExecutorFactory.ts","../interpreter/utils/reserved-variables.ts","../interpreter/env/VariableManager.ts","../interpreter/env/ImportResolver.ts","../interpreter/env/EffectHandler.ts","../interpreter/output/renderer.ts","../interpreter/eval/pipeline/streaming-options.ts","../interpreter/env/ContextManager.ts","../interpreter/hooks/HookManager.ts","../interpreter/hooks/guard-utils.ts","../interpreter/utils/guard-transform.ts","../interpreter/hooks/guard-shared-history.ts","../interpreter/hooks/guard-pre-hook.ts","../interpreter/hooks/guard-post-hook.ts","../interpreter/hooks/taint-post-hook.ts","../interpreter/env/builtins/keep.ts","../interpreter/guards/GuardRegistry.ts","../interpreter/eval/pipeline/stream-bus.ts","../interpreter/eval/pipeline/stream-sinks/terminal.ts","../interpreter/eval/pipeline/stream-sinks/progress.ts","../interpreter/eval/pipeline/stream-sinks/format-adapter.ts","../interpreter/streaming/streaming-manager.ts","../interpreter/env/Environment.ts","../core/services/PathContextService.ts","../sdk/execution-emitter.ts","../sdk/async-event-queue.ts","../sdk/stream-execution.ts","../interpreter/index.ts","../node_modules/acorn-walk/dist/walk.mjs","../core/utils/dependency-detector.ts","../sdk/cache/memory-ast-cache.ts","../sdk/types.ts","../sdk/execute.ts","../sdk/analyze.ts","../sdk/index.ts"],"names":["IMMUTABLE_SECURITY_PATTERNS","Object","freeze","protectedReadPaths","protectedWritePaths","blockedCommands","injectionPatterns","exfiltrationPatterns","llmCommandPatterns","CommandAnalyzer","analyze","command","taint","risks","parsed","parseShell","error","push","type","severity","description","createAnalysis","baseCommand","String","args","slice","map","injectionRisks","checkInjectionPatterns","commandRisks","checkDangerousCommands","exfiltrationRisks","checkExfiltration","taintSet","Set","has","astAnalysis","runASTAnalysis","warnings","length","patterns","regex","desc","test","pattern","source","includes","dangerousCommands","critical","high","medium","commands","entries","target","indexOf","toUpperCase","sensitivePatterns","blocked","some","r","suspicious","requiresApproval","parseDuration","duration","match","Error","value","parseFloat","unit","toLowerCase","multipliers","Math","floor","parseSize","size","isObject","Array","isArray","isMlldConfig","security","undefined","cache","output","parseConfig","content","JSON","parse","ConfigLoader","projectPathOrContext","globalConfigPath","projectConfigPath","cachedConfig","pathContext","join","homedir","projectRoot","process","cwd","load","globalConfig","loadConfigFile","projectConfig","mergeConfigs","filePath","existsSync","readFileSync","console","warn","message","global","project","merged","urls","mergeURLSecurity","mergeURLCache","mergeOutputConfig","enabled","allow","mergeArrays","allowedDomains","blockedDomains","allowedProtocols","maxSize","timeout","warnOnInsecureProtocol","requireReviewOnUpdate","gists","mergeGistSecurity","allowedUsers","allowedGists","pinToVersion","transformUrls","defaultTTL","rules","mergeCacheRules","immutable","autoRefresh","mergeAutoRefresh","storageLocation","requireReview","globalRules","projectRules","projectPatterns","filteredGlobal","filter","showProgress","maxOutputLines","errorBehavior","collectErrors","progressStyle","preserveFullOutput","logOutputToFile","showCommandContext","errorFormatting","mergeErrorFormatting","useColors","useSourceContext","contextLines","showCommandDetails","resolveURLConfig","config","urlConfig","resolveCacheRules","rule","patternToRegex","ttl","escaped","replace","RegExp","resolveOutputConfig","outputConfig","ImportApproval","projectPath","configLoader","imports","requireApproval","pinByDefault","allowed","checkApproval","url","env","CI","NODE_ENV","MLLD_TEST","VITEST","VITEST_WORKER_ID","VITEST_POOL_ID","stdin","isTTY","hash","calculateHash","existingApproval","find","entry","pinnedVersion","promptForUpdate","promptForApproval","createHash","update","digest","log","preview","getContentPreview","detectCommands","forEach","cmd","rl","createInterface","input","stdout","choice","question","saveApproval","close","existing","newHash","Date","allowedAt","toLocaleDateString","updateApproval","lines","contentLines","split","runRegex","exec","trim","detectedCommands","toISOString","existingIndex","findIndex","e","configPath","writeFile","stringify","isInteractive","ImmutableCache","cacheDir","get","expectedHash","urlHash","hashUrl","cachePath","metaPath","metaContent","readFile","meta","contentHash","actualHash","remove","set","mkdir","recursive","cachedAt","unlink","clear","rm","force","getStats","files","readdir","metaFiles","f","endsWith","totalSize","metaFile","DEFAULT_URL_CONFIG","maxResponseSize","maxEntries","URLValidator","validate","urlString","valid","URL","protocol","reason","isBlocked","domain","hostname","isAllowed","isImportURL","isRegistry","obj","version","modules","RegistryResolver","isRegistryURL","startsWith","isGistURL","resolveRegistryURL","registryURL","MlldImportError","moduleName","registry","fetchRegistry","module","keys","gist","getModuleInfo","searchModules","query","lowerQuery","name","tags","tag","cached","REGISTRY_URL","response","fetch","ok","statusText","text","registryData","transformGistURL","parseGistURL","gistURL","parts","username","gistId","CACHE_KEY","CACHE_TTL","AdvisoryChecker","checkForAdvisories","advisories","fetchAdvisories","advisory","affects","g","promptUserAboutAdvisories","importPath","formatSeverity","id","recommendation","hasCritical","a","answer","icons","low","ADVISORIES_URL","data","getAllAdvisories","isGistResponse","history","GistAdapter","gistUrlPattern","httpGistPattern","canHandle","reference","options","parseReference","headers","buildHeaders","token","signal","AbortSignal","status","gistData","json","mldFile","values","filename","availableFiles","revision","immutableUrl","contentResponse","metadata","provider","author","sourceUrl","html_url","timestamp","committed_at","extra","validateResponse","getCacheKey","raw","isGitHubContentItem","isGitHubRepoInfo","default_branch","RepositoryAdapter","repoUrlPattern","httpRepoPattern","rawUrlPattern","owner","repo","path","branch","getDefaultBranch","rawUrl","commitInfo","getLatestCommit","sha","date","repository","committer","apiUrl","Buffer","from","toString","download_url","commits","commit","StorageManager","adapters","registerAdapter","adapter","canResolve","supportedFormats","originalError","getAdapterNames","Minimatch","minimatch","PathValidator","readBlockPatterns","writeBlockPatterns","expandPath","canRead","inputPath","normalized","normalizePath","MlldFileSystemError","canWrite","normalizedPath","resolved","resolve","getBlockReason","operation","sensitivePathMap","key","SecurityManager","commandAnalyzer","urlValidator","registryResolver","advisoryChecker","taintTracker","importApproval","pathValidator","hooks","Map","initialize","getInstance","instance","checkCommand","context","taintSnapshot","analysis","policy","policyManager","getPolicy","decision","evaluateCommand","auditLogger","runHooks","checkPath","trackTaint","taintLabels","mapSourceToTaintLabels","track","sources","registerHook","event","hook","execute","TaintTracker","resolveImport","importURL","resolvedURL","moduleInfo","importType","snapshot","deriveImportTaint","resolvedPath","sourceType","labels","approveImport","approved","_ImportApproval","GistTransformer","isGistUrl","transformToRaw","pathParts","pathname","p","user","fileName","fileMatch","parseGistUrl","file","splitModuleNameVersion","rawName","lastAt","lastIndexOf","slashIndex","hasVersion","normalizeModuleName","LockFile","isDirty","loaded","canonicalPath","currentPath","fallbackPaths","getSearchPaths","seen","candidates","paths","candidate","add","ensureLoaded","usedPath","normalizeData","createEmptyData","lockfileVersion","normalizedName","normalizedEntry","normalizeLockEntry","preferLockEntry","normalizeLegacyImport","createdAt","normalizeModuleNameUtil","integrity","fetchedAt","registryVersion","dependencies","approvedAt","current","incoming","currentVersion","incomingVersion","ensureData","save","targetPath","dir","dirname","promises","calculateIntegrity","crypto","checkOutdated","checkFn","result","getAllModules","getModule","addModule","touchMetadata","updateModule","MlldError","removeModule","getModuleEntries","verifyModuleIntegrity","updatePath","newPath","getImport","addImport","updateImport","removeImport","getAllImports","updatedAt","ConfigFile","validatePolicyConfig","getDependencies","addDependency","removeDependency","getResolverPrefixes","resolvers","prefixes","setResolverPrefixes","getSecurityConfig","setSecurityConfig","getAllowedEnvVars","allowedEnvVars","addAllowedEnvVar","varName","getTrustedDomains","trustedDomains","setTrustedDomains","domains","getAllowAbsolutePaths","allowAbsolutePaths","getScriptDir","scriptDir","setScriptDir","getMode","mode","setMode","isDevMode","dev","getLocalModulesPath","localModulesPath","getPolicyImports","import","getPolicyEnvironment","environment","getFilePath","setDevMode","getData","code","allowedKeys","ProjectConfig","configFile","lockFile","findProjectRoot","removeAllowedEnvVar","currentVars","index","splice","clearAllowedEnvVars","getConfigFilePath","getLockedModule","lockModule","updateLockedModule","updates","getAllLockedModules","init","lockPath","defaultConfig","emptyLock","getProjectRoot","updateProjectRoot","newRoot","Cache","basePath","resolvedUrl","getCachePath","contentPath","store","gistRevision","fullMetadata","byteLength","metadataPath","getMetadata","invalidate","calculateSize","dirPath","withFileTypes","fullPath","isDirectory","stats","stat","urlRevision","finalRevision","fileCount","oldestEntry","newestEntry","scanDir","cachedDate","ModuleCache","cacheRoot","indexPath","moduleContent","HashUtils","createModuleContent","prefix","rest","getCachePathComponents","hashDir","devDependencies","moduleNeeds","moduleNeedsToSerializable","updateIndex","getTime","fullHash","resolveHash","metadataStr","Promise","all","verify","verifyIntegrity","access","prefixDir","rmdir","moduleCount","list","items","item","sort","b","shortHash","availableHashes","expandHash","matches","h","getHashByImportPath","FRONTMATTER_PATTERN","extractFrontmatter","ErrorSeverity","Fatal","cause","parseModuleMetadata","frontmatter","assertNoLegacyNeeds","needsDeclaration","extractNeedsFromContent","wants","extractWantsFromContent","needs","normalizeModuleNeeds","parseDependencyMap","devdependencies","legacyKeys","hasLegacyNeeds","ast","parseSync","needsNode","node","kind","normalizeNeedsDeclaration","wantsNode","normalizeWantsDeclaration","rawVersion","finalVersion","formatDependencyMap","fromEntries","registryUrl","registryCache","advisoryCache","cacheTimeout","fetchUserRegistry","checkUserAdvisories","displayAdvisories","now","fetchUserAdvisories","emptyAdvisories","icon","results","fullName","searchQuery","searchUserModules","searchServers","server","servers","capabilities","cap","_RegistryResolver","StatsCollector","statsFile","mlldVersion","getMlldVersion","anonymous","appendFile","line","aggregateStats","since","events","filtered","cacheHits","installs","lastUsed","timestamps","period","start","min","d","end","max","clearStats","exportForSharing","setMinutes","require","createRequire","packageJson","isEnabled","getStatsSize","RegistryManager","basePathOrContext","resolver","isServerless","LAMBDA_TASK_ROOT","VERCEL","AWS_LAMBDA_FUNCTION_NAME","mlldDir","telemetry","locked","fetchLocked","lockGistImport","originalPath","resolvedGistPath","approvedBy","USER","installFromLock","audit","advisoryCount","gistMatch","search","info","modulePath","created","showStats","padEnd","padStart","getLockFile","getCache","getResolver","execAsync","promisify","getGitStatus","absolutePath","isAbsolute","statusLine","statusCode","substring","ResolverManager","securityPolicy","moduleCache","resolversByPriority","resolverNamesCache","prefixConfigs","offlineMode","localModulePrefixes","localModulesByAuthor","allowCustom","pathOnlyMode","allowOutputs","setOfflineMode","offline","logger","debug","setModuleCache","setLockFile","_devMode","registerResolver","allowedResolvers","aliases","alias","priority","configurePrefixes","usablePrefixes","prefixConfig","validatePrefixConfig","processedPrefixes","configureLocalModules","localModulePath","scanLocalModules","authorModules","groupModulesByAuthor","allowedAuthorSet","allowedAuthors","currentUser","moduleNames","normalizedAuthor","moduleFilter","stripModuleExtension","extractMetadata","frontmatterMatch","getLocalPrefixes","hasLocalModule","normalizeModuleReference","authorWithPrefix","findResolverForRef","ref","contexts","cleaned","rawModule","extensions","ext","findLocalPrefix","moduleRef","startTime","isLocal","refToModuleName","lockEntry","resolutionTime","contentType","mx","resolverName","matchedPrefix","cacheError","MlldResolutionError","findResolver","canResolveInContext","resolverRef","checkAccess","hasAccess","timeoutMs","resolverConfig","withTimeout","storeOptions","buildModuleCacheOptions","cacheEntry","localPath","gitStatus","statusEmoji","localPrefixConfig","localResolver","localContent","localError","write","resolverPrefix","getResolverNames","getResolverNamesSet","getPrefixConfigs","updatePrefixConfig","getResolversForContext","isResolverName","availableResolvers","expectedResolver","directResolver","contextResolvers","validateConfig","errors","promise","timeoutPromise","_","reject","setTimeout","race","MAX_SERIALIZED_SIZE_BYTES","MAX_DEPTH","MAX_KEYS_PER_OBJECT","MAX_ELEMENTS_PER_ARRAY","MAX_TOTAL_NODES","DynamicModuleResolver","io","read","supportedContentTypes","defaultContentType","strategy","literalStrings","normalizeModules","ResolverError","hasModule","isPlainObject","TypeError","serialized","serializeObjectModule","nodes","validateStructuredData","exports","serializeValue","moduleSource","MLLD_DEBUG_DYNAMIC","ensureSizeWithinLimit","depth","pairs","proto","getPrototypeOf","prototype","NodeFileSystem","exists","isFile","PathService","segments","relative","to","basename","extname","normalize","isURL","validateURL","fetchURL","makeJsonTransformer","extracted","extractJsonFromLLMResponse","JSON5","details","trimmed","fencePatterns","looksLikeJson","jsonPatterns","str","startsRight","endsRight","hasStructure","minLength","builtinTransformers","uppercase","isReserved","implementation","analyzeValueType","jsonToXml","llmxmlInstance","toXML","variants","field","trimEnd","convertToCSV","normalizeOutput","sorted","createTransformerVariable","isUppercase","executableDef","codeTemplate","language","paramNames","sourceDirective","template","isSystem","isBuiltinTransformer","transformerImplementation","internal","transformerVariants","rows","escapeCSV","csvRows","inTable","i","v","NodeShadowEnvironment","currentFile","shadowFunctions","isCleaningUp","activeTimers","activeIntervals","customRequire","createCustomRequire","wrappedSetTimeout","callback","delay","delete","wrappedSetInterval","setInterval","wrappedClearTimeout","clearTimeout","wrappedClearInterval","clearInterval","createContext","__dirname","__filename","setImmediate","clearImmediate","URLSearchParams","queueMicrotask","mlld_now","__mlldShadowFunctions","addFunction","func","mergeCapturedFunctions","capturedFunctions","params","consoleOutput","originalLog","apply","arg","wrappedCode","script","Script","lineOffset","columnOffset","runInContext","stack","getContext","hasFunction","getFunctionNames","cleanup","timerId","intervalId","currentDir","modulePaths","buildModulePaths","dummyModule","Module","bind","fromDir","mlldNodeModules","devNodeModules","devPackageJson","devNodeModulesExists","devPackageJsonExists","debugShadow","DEBUG_NODE_SHADOW","thisFile","fileURLToPath","searchDir","candidateNodeModules","candidatePackageJson","pkg","esmRequire","mlldPath","cliPath","argv","projectNodeModules","possiblePaths","HOME","NODE_PATH","globalPaths","delimiter","CacheManager","immutableCache","urlCache","resolverVariableCache","getURLCacheTTL","getImmutableCache","getResolverVariable","setResolverVariable","variable","clearResolverVariableCache","getURLCacheEntry","setURLCacheEntry","isURLCacheEntryValid","setURLConfig","clearAllCaches","getCacheStats","urlCacheSize","resolverVariableCacheSize","urlCacheEntries","resolverVariables","DebugUtils","truncateValue","maxLength","truncated","_truncated","createDebugObject","variables","reservedNames","debugInfo","summary","totalVariables","reservedVariables","categories","reserved","builtin","truncatedValue","varInfo","formatVariableForDisplay","getVariableStats","total","byType","bySource","isSafeToDisplay","variableName","ErrorUtils","collectedErrors","collectError","sourceLocation","getCollectedErrors","clearCollectedErrors","processOutput","maxLines","actualLines","processedOutput","originalLength","maxLinesApplied","getErrorStats","totalErrors","errorsByType","averageDuration","commandsWithErrors","totalDuration","collected","errorType","getRecentErrors","windowMs","cutoff","hasRecentFailures","recentErrors","formatError","location","createErrorReport","toFixed","count","recent","BaseCommandExecutor","errorUtils","workingDirectory","outputOptions","executeWithCommonHandling","executor","finalOptions","effectiveWorkingDirectory","processedResult","processed","MLLD_DEBUG_BASH_SCRIPT","commandError","MlldCommandExecutionError","createCommandExecutionError","extractOutputFromError","errorDetails","stderr","exitCode","create","directiveType","handleTestMocks","MLLD_TEST_MODE","DEBUG_PIPELINE","resolveAlias","originalCommand","commandName","wasAlias","resolvedCommand","shellBuiltins","aliasResult","execSync","encoding","stdio","aliasTarget","whichResult","aliasPath","tryCommonAliasLocations","home","commonPaths","candidatePath","aliasCache","resolveAliasWithCache","fullConfig","cacheKey","ShellCommandExecutor","getBus","executeShellCommand","mockResult","envOverrides","MAX_SIZE","MLLD_MAX_SHELL_ENV_VAR_SIZE","n","Number","isFinite","offenders","envTotalBytes","k","s","bytes","o","ENV_TOTAL_MAX","MLLD_MAX_SHELL_ENV_TOTAL_SIZE","biggest","CMD_MAX","MLLD_MAX_SHELL_COMMAND_SIZE","cmdBytes","MLLD_DEBUG","ARGS_ENV_MAX","MLLD_MAX_SHELL_ARGS_ENV_TOTAL","combined","aliasResolution","MLLD_RESOLVE_ALIASES","commandToExecute","MLLD_DEBUG_ALIASES","safeCommand","CommandUtils","validateAndParseCommand","streamingEnabled","Boolean","executeStreamingCommand","executeBufferedCommand","suppressStderr","MLLD_NO_STREAMING","finalCommand","escapedInput","hasPipeOperator","maxBuffer","MLLD_SHOW_JSON","appendTarget","idx","pad","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","appendStream","createWriteStream","flags","bus","pipelineId","stageIndex","parallelIndex","streamId","randomUUID","child","spawn","shell","stdoutDecoder","StringDecoder","stderrDecoder","stdoutBuffer","stderrBuffer","chunkEffect","emitEffect","emitChunk","chunk","emit","settled","on","err","finalOut","finalErr","interpolateTemplate","lineNumber","enhance","actionMatch","action","funcName","funcMatch","ACTION","FUNCNAME","LINE","commentMarker","MARKER","CONTEXT","startIdx","endIdx","nextFewLines","exeMatch","nextLines","hasWhenBlock","suggestion","FUNC","PARAMS","SUGGESTION","expected","baseVar","fields","fieldParts","methodName","body","isSimpleShow","isSimpleOutput","BODY","loopVar","LOOP_VAR","forMatch","collection","fixedAction","VAR","COLLECTION","FIXED_ACTION","CAP","EXAMPLE","TIP","isTextNotAllowed","afterPipe","filterName","FILTER","afterArrow","directive","DIRECTIVE","nextLineIndex","nextLine","CORRECT_SYNTAX","prevLine","varMatch","VARNAME","fieldName","flatName","functionName","attemptedDefinition","FUNCTION_NAME","ATTEMPTED_LINE","prevLines","hasWhenContext","hasCommaSeparatedConditions","firstCondition","firstAction","secondCondition","secondAction","FIRST_CONDITION","FIRST_ACTION","SECOND_CONDITION","SECOND_ACTION","whenMatch","condition","CONDITION","createErrorContext","enhanceParseError","MlldParseError","patternName","simplifyPeggyError","expectations","hasDirectives","hasVariables","found","names","isUnexpectedToken","usage","USAGE","fieldMatch","contextLine","accessPattern","FIELD","mutationPatterns","op","OPERATION","suggestions","string","number","boolean","object","function","hint","firstLine","TYPE","HINT","received","snippet","EXPECTED","RECEIVED","SNIPPET","method","alt","METHOD","enhanceJSError","initializePatterns","isMlldError","mlldErrorLocation","mlldError","enhanceParseErrorImpl","enhanced","enhanceJSErrorImpl","addImplicitReturn","isWrappedExpression","isSingleLine","looksLikeStatement","inString","isEscaped","char","JavaScriptExecutor","shadowEnvironment","jsOptions","executeJavaScript","targetCwd","previousCwd","shouldRestoreCwd","chdir","capturedEnvs","__capturedShadowEnvs","shadowEnv","resolveShadowEnvironment","shadowParams","prepareParamsForShadow","primitiveMetadata","__mlldPrimitiveMetadata","allParams","allParamNames","allParamValues","functionBody","mergedMetadata","helperMetadata","mlldHelpers","createMlldHelpers","hasAwait","fn","AsyncFunction","Function","errorMessage","codeError","NodeExecutor","nodeShadowProvider","nodeOptions","executeNodeCode","resolvedWorkingDirectory","normalizedCode","executeNodeInProcess","executeNodeSubprocessStreaming","errorStack","stackMatch","finalMessage","enrichedError","nodeShadowEnv","getOrCreateNodeShadowEnv","sanitizedParams","mlld","nodeEnv","nodejs","tmpFile","tmpdir","random","paramJson","fs","catch","generatePythonMlldHelpers","metadataJson","convertToPythonValue","isVariable","generatePythonVariable","generatePythonArrayVariable","generatePythonObjectVariable","generatePythonPrimitiveVariable","subtype","PythonExecutor","shellExecutor","executePythonCode","tmpDir","pythonCode","writeFileSync","unlinkSync","adaptVariablesForBash","bashVars","tempFiles","resolveValue","ResolutionContext","CommandExecution","strValue","convertToString","envVars","isStructuredValue","asText","BashExecutor","variableProvider","bashPath","resolveBashPath","executeBashCode","MLLD_BASH_BINARY","getCandidateBashPaths","unique","runBashSync","enhancedCode","lastError","execResult","spawnSync","getVariable","adapted","getVariables","isTextLike","isMocking","MOCK_BASH","handleBashTestMocks","prelude","useHeredoc","MLLD_BASH_HEREDOC","MLLD_MAX_BASH_ENV_VAR_SIZE","smallEnv","counter","largeVarCount","safeName","marker","conflicts","m","sizes","debugOn","enhanceShellCodeForCommandSubstitution","envKeys","hasTTYCheck","resultText","stdoutText","stderrText","execError","bashError","myvarValue","myvar","userCode","userCodeMarker","userCodeIndex","outputs","localEnvVars","exportMatch","echoContent","typeVar","subtypeVar","isVarVar","CommandExecutorFactory","jsExecutor","nodeExecutor","pythonExecutor","bashExecutor","getStreamingBus","executeCommand","disableSh","MLLD_DISABLE_SH","MAX_ENV_VAR","MAX_ENV_TOTAL","MAX_CMD","MAX_ARGS_ENV","hasLargeEnvVar","shouldFallback","safe","precheckError","executeCode","getCodeExecutor","getShellExecutor","getJavaScriptExecutor","getNodeExecutor","getPythonExecutor","getBashExecutor","getTimeValue","mockTime","MLLD_MOCK_TIME","parseInt","getProjectPathValue","VariableManager","deps","buildLegacyContext","pipelineContext","securitySnapshot","try","tries","stage","isPipeline","lastOutput","attemptHistory","hints","hintHistory","attempt","normalizeInput","looksJson","mxValue","attemptCount","previousOutputs","setVariable","getReservedNames","isLegitimateVariable","isLegitimateVariableType","existingIsLegitimate","existingIsImported","isImported","newIsImported","VariableRedefinitionError","forImportConflict","definedAt","column","getCurrentFilePath","forSameFile","isModuleIsolated","parent","getParent","hasVariable","isLetBinding","isExistingImported","setParameterVariable","updateVariable","testCtxVar","createObjectVariable","isReadOnly","contextManager","getContextManager","getPipelineContext","getSecuritySnapshot","buildAmbientContext","recordSecurityDescriptor","varMxToSecurityDescriptor","isLazy","debugValue","capturedEnv","getCapturedModuleEnv","parentVar","resolveName","cacheManager","resolverVar","createResolverVariable","resolverManager","getResolverManager","matchingPrefix","prefixName","existingVar","placeholderSource","syntax","hasInterpolation","isMultiLine","createSimpleTextVariable","isResolver","needsResolution","getVariableValue","isPipelineInput","getAllVariables","allVars","parentVars","getCurrentVariables","initializeReservedVariables","inputVar","createInputValue","nowSource","nowVar","debugSource","debugVar","baseSource","getBasePath","createPathVariable","getEnvironmentVariables","stdinContent","getStdinContent","stdinData","inputSource","textSource","mxData","internalData","VariableTypeGuards","isSimpleText","isInterpolatedText","isTemplate","isFileContent","isSectionContent","isComputed","isCommandResult","isPath","isExecutable","isPrimitive","ImportResolver","importStack","pathMatcher","PathMatcher","fileSystem","resolveModule","pathOrUrl","resolvePath","getProjectPath","localFileFuzzyMatch","getLocalFileFuzzyMatch","fuzzyEnabled","DEBUG_FUZZY","matchResult","findMatch","fileDirectory","allSuggestions","pathWithExt","extMatchResult","uniqueSuggestions","c","matchType","confidence","areURLsEnabled","getURLConfig","defaultOptions","getDefaultUrlOptions","forImport","cacheDurationMs","effectiveImportType","isImport","cacheEnabled","controller","AbortController","timeoutId","abort","override","globalThis","__mlldFetchOverride","approveAllImports","getApproveAllImports","getImportApproval","fetchURLWithMetadata","isImporting","beginImport","endImport","createChildResolver","newFileDirectory","childDependencies","executionDirectory","DefaultEffectHandler","documentBuffer","recordEffects","effectLog","ansiOptions","hasWrittenContent","streaming","MLLD_STREAMING","ansiEnabled","processContent","keepAnsi","processAnsi","handleEffect","effect","docContent","stdoutOnly","stderrContent","bothStdout","bothDoc","fileContent","getDocument","DEBUG_NORMALIZER","isStreamingEnabled","getEffects","OutputRenderer","emitCallback","pendingBreaks","intent","collapsible","flushBreaks","emitToHandler","breaksToEmit","render","getPendingBreakCount","defaultStreamingOptions","format","visibility","showThinking","showTools","showMetadata","showCustom","showAll","accumulate","keepRawEvents","DEFAULT_GUARD_MAX","ContextManager","opStack","pipelineStack","guardStack","deniedStack","genericContexts","latestErrors","pushOperation","popOperation","pop","peekOperation","withOperation","pushPipelineContext","replacePipelineContext","popPipelineContext","peekPipelineContext","withPipelineContext","pushGuardContext","popGuardContext","peekGuardContext","withGuardContext","pushDeniedContext","popDeniedContext","peekDeniedContext","withDeniedContext","testOverride","pipeline","currentOperation","pipelineFields","buildPipelineFields","guardContext","deniedContext","whileContext","peekGenericContext","forContext","parallelContext","errorsContext","ta","tb","resolvedErrors","root","guard","while","denied","normalizeGuardContext","pipe","pushGenericContext","popGenericContext","withGenericContext","setLatestErrors","trace","reasons","resolvedReason","resolvedName","guardName","resolvedFilter","guardFilter","timing","buildAttemptSummaries","normalizedInput","pipeNamespace","guards","HookManager","preHooks","postHooks","registerPre","registerPost","runPre","inputs","aggregatedMetadata","helpers","buildInputHelpers","runPost","every","createGuardInputHelper","guardSnapshotDescriptor","makeSecurityDescriptor","policyContext","GUARD_TRANSFORM_SOURCE","materializeGuardTransform","originalDescriptor","descriptor","materialized","materializeExpressionValue","createComputedVariable","updateVarMxFromDescriptor","appendGuardHistory","guardResults","recordPipelineGuardHistory","GUARD_INPUT_SOURCE","GUARD_HELPER_SOURCE","guardAttemptStores","WeakMap","GUARD_DEBUG_PREVIEW_LIMIT","isGuardDebugEnabled","MLLD_DEBUG_GUARDS","logGuardDebug","ensureGuardLoggerLevel","interpreterLogger","guardLoggerPrimed","level","formatGuardLabel","label","filterKind","filterValue","formatOperationDescription","base","sanitizePreviewForLog","logGuardEvaluationStart","operationDescription","describeHookTarget","operationType","operationSubtype","scope","inputPreview","logGuardDecisionEvent","isDirectiveHookTarget","isEffectHookTarget","rawIdentifier","getRootEnvironment","getAttemptStore","buildVariableIdentity","buildOperationIdentity","buildGuardAttemptKey","truncatePreview","limit","buildVariablePreview","buildInputPreview","perInput","operationSnapshot","clearGuardAttemptState","extractGuardOverride","withClause","resolveWithClause","isExecHookTarget","invocation","execInvocation","execRef","metaWithClause","normalizeGuardNames","normalizeGuardOverride","rawOnly","only","rawExcept","except","hasOnly","hasExcept","hasOnlyValue","hasExceptValue","applyGuardOverrideFilter","def","guardPreHook","shouldSuppressGuards","withGuardSuppression","guardOverride","parentHasPrefix","getGuardRegistry","variableInputs","materializeGuardInputs","nameHint","perInputCandidates","buildPerInputCandidates","operationGuards","collectOperationGuards","attemptStore","guardTrace","usedAttemptKeys","currentDecision","primaryMetadata","transformedInputs","attemptKey","attemptState","attemptNumber","nextAttempt","currentInput","evaluateGuard","inputHelper","replacement","opSnapshot","buildOperationSnapshot","replacements","normalizeGuardReplacements","aggregateContext","buildAggregateGuardContext","aggregateMetadata","buildAggregateMetadata","contextLabels","provenance","isProvenanceEnabled","getExpressionProvenance","emitSDKEvent","appendFileSync","defs","getDataGuardsForTiming","filteredGuards","buildOperationKeys","getOperationGuardsForTiming","aggregate","buildArrayAggregate","guardEnv","createChild","inheritParentVariables","envHas","childHas","envHasEmit","envHasTag","childHasTag","ensurePrefixHelper","ensureTagHelper","inputVariable","contextSources","outputValue","cloneVariableForGuard","resolveGuardValue","arrayValue","createArrayVariable","attachArrayHelpers","primaryOutput","outputText","guardOutputVariable","attachGuardHelper","injectGuardHelpers","operationLabels","outputPreview","contextSnapshotForMetadata","cloneGuardContextSnapshot","evaluateGuardBlock","block","metadataBase","guardInput","evaluateGuardReplacement","buildDecisionMetadata","contextSnapshot","updatedHistory","retryMetadata","currentEnv","isLetAssignment","firstValue","isRawPrimitive","valueResult","evaluate","importer","VariableImporter","createVariableFromValue","identifier","isAugmentedAssignment","MlldWhenExpressionError","rhsValue","rhsResult","existingValue","extractVariableValue","combineValues","updatedVar","isWildcard","evaluateCondition","guardLabel","extras","guardId","aggregated","addVars","clone","mxCache","cloned","cloneGuardContextInput","opKeys","buildOperationKeySet","opLabels","inputLabels","helperVariables","createGuardHelperExecutable","execVar","createExecutableVariable","isGuardHelper","guardHelperImplementation","sourceEnv","targetEnv","fallback","head","asObj","labelType","valueType","labelKeys","valueKeys","normalizedLabel","runSubtype","assign","baseContext","helper","defineProperty","enumerable","configurable","writable","any","none","totalTokens","maxTokens","afterRetryDebugEnabled","DEBUG_AFTER_RETRY","logAfterRetryDebug","payload","summarizeOperation","getGuardRetryContext","normalizeRawOutput","guardPostHook","parentHasTag","selectionSources","retryContext","baseOutputValue","outputVariables","inputVariables","fallbackValue","fallbackOutput","extractSecurityDescriptor","activeOutputs","currentDescriptor","extractOutputDescriptor","mergedDescriptor","mergeDescriptors","mergeArrayElements","streamingActive","guardNames","flatMap","streamingFlag","streamingMessage","GuardError","outputCount","inputCount","transformsApplied","resultEntry","buildGuardInputHelper","activeInput","labelsOverride","sourcesOverride","inputPreviewOverride","outputRaw","maxAttempts","normalizeReplacementVariables","mergeGuardDescriptor","applyDescriptorToVariables","currentOutputValue","buildGuardError","retryReasons","retryHint","sourceRetryable","buildGuardRetrySignal","finalVariable","finalValue","structured","ensureStructuredValue","applySecurityDescriptorToStructuredValue","nextResult","__guardTransformed","outputVariable","cloneVariable","primaryReason","retry","GuardRetrySignal","valueDescriptor","resultDescriptor","outputDescriptor","guardSource","descriptors","taintPostHook","_directive","collectInputDescriptors","collectValueDescriptors","collectOperationLabels","pushVariableDescriptor","WeakSet","pushStructuredDescriptor","extractDescriptorFromObject","descriptorFromVarMx","descriptorFromContext","hasLabels","hasSources","hasTaint","createKeepExecutable","keep","createKeepStructuredExecutable","GuardRegistry","nextRegistrationOrder","dataIndex","opIndex","definitions","namedDefinitions","isRoot","register","filterNode","registrationOrder","allocateRegistrationOrder","hasDefinition","definition","modifier","registerDefinition","getDataGuards","collectGuards","getOperationGuards","matchesTiming","serializeOwn","serializeDefinition","importSerialized","getByName","copy","listOwn","getAllGuards","serializeByNames","order","StreamBus","listeners","subscribe","listener","TerminalSink","destination","handle","dest","resolveDestination","countTokens","part","ProgressOnlySink","stages","writer","useTTY","tokens","startedAt","lastRendered","flush","stop","done","tokensText","suffix","FormatAdapterSink","onEvent","emitToOutput","accumulatedText","accumulatedThinking","toolCalls","toolCallsById","lastUsage","allEvents","processChunk","parsedEvent","processParsedEvent","remaining","reset","getResult","thinking","inputTokens","outputTokens","sdkEvent","toSDKEvent","displayed","emitEventToOutput","accumulateEvent","formatted","plain","templates","ts","getFormatted","shouldDisplay","role","success","isError","toolUseId","model","defaultTemplateKey","fallbackText","ansi","applyTemplates","defaultTemplate","DEFAULT_TEMPLATES","getFormattedText","eventType","toolCall","StreamingManager","unsubscribes","formatSink","getFormatSink","configure","teardown","streamingOptions","formatOptions","unsub","progressSink","progressUnsub","terminalSink","terminalUnsub","finalizeResults","Environment","pathService","effectHandler","currentFilePath","securityManager","securityRuntime","moduleWants","policyCapabilities","ALLOW_ALL_POLICY","policySummary","registryManager","initialNodeCount","commandExecutorFactory","variableManager","importResolver","hookManager","guardRegistry","pipelineGuardHistory","shadowEnvs","streamingManager","streamingResult","provenanceEnabled","stateWrites","stateWriteIndex","stateSnapshot","stateResolver","stateLabels","isEphemeralMode","dynamicModuleMode","childEnvironments","normalizeBlankLines","configuredLocalModules","sourceCache","interpolationStack","enableFileInterpolation","resolutionStack","currentIterationFile","directiveTrace","traceEnabled","defaultUrlOptions","outputRenderer","sdkEmitter","streamBridgeUnsub","directiveTimings","isImportingContent","capturedModuleEnv","moduleIsolated","exportManifest","importBindings","guardEvaluationDepth","intentToEffect","registerBuiltinHooks","localModulesRelative","lockFilePath","ProjectPathResolver","LocalResolver","GitHubResolver","HTTPResolver","readonly","resolverPrefixes","variableManagerDependencies","getFsService","getPathService","getSecurityManager","getFileDirectory","getExecutionDirectory","initializeBuiltinTransformers","registerKeepBuiltins","reserveModulePrefixes","importResolverDependencies","invocationDirectory","getRegistryManager","executorDependencies","getShadowEnv","getNodeShadowEnv","registerBuiltinResolvers","NowResolver","DebugResolver","InputResolver","inputResolver","functionResolvers","registerDynamicModules","hasOwnProperty","call","stateValue","refreshStateVariable","pathVar","isPrefixPath","transformer","upperVar","lowerVar","lowerInternal","upperInternal","lowerVariantMap","upperVariantMap","variant","lowerVariant","upperVariant","getPathContext","isEphemeral","isFileInProject","setCurrentFilePath","setImporting","getIsImporting","setCapturedModuleEnv","setModuleIsolated","isolated","setExportManifest","manifest","getExportManifest","hasExplicitExports","hasEntries","getImportBinding","setImportBinding","getModuleNeeds","recordModuleNeeds","mergeNeedsDeclarations","getModuleWants","recordModuleWants","getPolicyCapabilities","setPolicyCapabilities","setPolicyContext","runtime","ensureSecurityRuntime","setPolicyEnvironment","getPolicyContext","nextContext","tier","configs","activePolicies","getProjectConfig","recordPolicyConfig","normalizedConfig","normalizePolicyConfig","mergePolicyConfigs","top","snapshotToDescriptor","tracker","pushSecurityContext","previousDescriptor","previousPolicy","popSecurityContext","frame","createCapabilityContext","mergeSecurityDescriptors","recordStateWrite","applyStateWriteToSnapshot","getStateWrites","lastKey","stateVar","getFileSystemService","isFileInterpolationEnabled","setFileInterpolationEnabled","isInInterpolationStack","pushInterpolationStack","popInterpolationStack","isResolving","beginResolving","endResolving","getCurrentIterationFile","setCurrentIterationFile","getVariableProvenance","setPipelineContext","clearPipelineContext","updatePipelineContext","resolverContent","varType","varValue","resolverSource","resolvedVar","getTransform","builtins","setFrontmatter","frontmatterSource","frontmatterVariable","addNode","getNodes","capability","effectType","emitIntent","renderOutput","getEffectHandler","setEffectHandler","handler","getHookManager","getPipelineGuardHistory","resetPipelineGuardHistory","serializeLocalGuards","serializeGuardsByNames","registerSerializedGuards","withOpContext","withPipeContext","pushExecutionContext","popExecutionContext","getExecutionContext","withExecutionContext","keepExec","keepStructuredExec","enableSDKEvents","emitter","unsubscribe","mapStreamEvent","commandEvent","mapCommandEvent","streamingSuppressed","durationMs","setShadowEnv","functions","parentShadowEnv","captureAllShadowEnvs","capture","jsEnv","js","javascriptEnv","javascript","nodeMap","hasShadowEnvs","captureModuleEnvironment","getRawStdinContent","allowedVars","setStdinContent","readStdin","mxWithBus","finalParams","lang","shouldInjectCtx","mergedOptions","newBasePath","childContext","mergeChild","setURLOptions","setAllowAbsolutePaths","setOutputOptions","setStreamingOptions","getStreamingOptions","setStreamingManager","manager","getStreamingManager","setStreamingResult","getStreamingResult","setProvenanceEnabled","setApproveAllImports","approve","setDynamicModuleMode","getDynamicModuleMode","setNormalizeBlankLines","setLocalFileFuzzyMatch","setEphemeralMode","ephemeral","InMemoryModuleCache","NoOpLockFile","inMemory","getNormalizeBlankLines","GitHubAuthService","getGitHubUser","login","originalLineCount","displayCollectedErrors","ErrorFormatSelector","formatter","formatForCLI","useSmartPaths","createChildEnvironment","pushDirective","popDirective","getDirectiveTrace","markLastDirectiveFailed","lastEntry","failed","setTraceEnabled","isTraceEnabled","cacheSource","getSource","PathContextBuilder","fromFile","absoluteFilePath","fromDefaults","forChildFile","parentContext","childFilePath","absoluteChildPath","childDirectory","ExecutionEmitter","bucket","off","once","wrapper","AsyncEventQueue","queue","waiters","ended","waiter","shift","Symbol","asyncIterator","next","StreamExecution","completed","doneResolve","doneReject","resultResolve","resultReject","donePromise","resultPromise","aborted","abortFn","isComplete","eventTypes","forward","then","interpret","languageMode","resolveMlldMode","mlldMode","parseResult","parseError","captureErrors","captureError","captureDir","exit","peggyFormatted","peggyError","DEBUG_PEGGY","position","mlldLocation","enhancedError","sourceContent","enhancedMessage","streamingDisabledEnv","MLLD_NO_STREAM","streamingDisabledOption","streamingDisabled","baseStreamingEnabled","_init","dynamicModules","userDataModules","otherModules","dynamicModuleSource","enableTrace","applyConfigPolicyImports","runExecution","activeEffectHandler","useMarkdownFormatter","DEBUG_WHEN","formatOutput","captureEnvironment","streamExecution","buildStructuredResult","debugTrace","debugEmitter","debugStart","debugResult","resolvedProvenance","effects","collectEffects","collectExports","getNames","derivePolicyAlias","used","strippedRegistry","lastPart","baseName","policyImports","policyEnvironment","previousFilePath","usedAliases","directiveSource","evaluateDirective","DependencyDetector","nodeBuiltins","commonShellCommands","walkAST","children","extractRunLanguage","langNode","extractCode","detectRuntimeNeeds","hasNodeDependencies","usesNodeAPIs","execNode","innerNode","nodeGlobals","ecmaVersion","allowReturnOutsideFunction","allowImportExportEverywhere","usesNode","walkSimple","ImportDeclaration","CallExpression","callee","arguments","detectJavaScriptPackages","packages","containsJavaScriptRun","detected","parseJavaScriptImports","detectNodePackages","hasJs","extractPackageName","detectJavaScriptPackagesByRegex","requireMatches","matchAll","importMatches","detectPythonPackages","containsPythonRun","parsePythonImports","hasPy","pythonBuiltins","fromMatches","detectShellCommands","containsShellRun","parseShellCommands","hasSh","l","MemoryAstCache","cacheHit","parseDurationMs","parseStart","performance","parseSource","ExecuteError","TimeoutError","astCache","overallStart","getCachedAst","state","interpretOptions","stream","metricsContext","evaluateStart","parseMs","runInterpret","attachSignalAndTimeout","attachStreamMetrics","run","withMetrics","runWithGuards","timer","onAbort","addEventListener","finally","rejectOnce","resolveOnce","metrics","buildMetrics","build","patchEvent","originalResult","wrapExecuteError","totalMs","evaluateMs","effectCount","stateWriteCount","nodeError","analyzeModule","filepath","createErrorResult","inferMlldMode","extractErrorLocation","w","extractFrontmatterFromSource","extractNeeds","extractWants","extractExports","executables","extractExecutables","extractGuards","extractImports","extractVariables","computeStats","validateExports","fm","parseFrontmatterYaml","runtimes","tools","why","isDirectiveNode","exportValues","exp","paramName","determineLanguage","securityLabels","namespace","imp","exportSet","inferVariableType","extractLabelsFromDirective","exported","execInfo","inferredType","directives","definedNames","exportName","anyError","offset","processMlld","formatAuto"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOO,IAAMA,2BAAAA,GAA8BC,OAAOC,MAAO,CAAA;;AAEvDC,EAAAA,kBAAAA,EAAoBF,OAAOC,MAAO,CAAA;AAChC,IAAA,WAAA;AACA,IAAA,WAAA;AACA,IAAA,aAAA;AACA,IAAA,uBAAA;AACA,IAAA,gBAAA;AACA,IAAA,UAAA;AACA,IAAA,UAAA;AACA,IAAA,oBAAA;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