@bastani/atomic 0.9.60 → 0.9.61-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +80 -0
- package/dist/builtin/intercom/index.bundle.mjs +3 -3
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +12 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +14 -0
- package/dist/builtin/workflows/README.md +9 -7
- package/dist/builtin/workflows/builtin/{chunk-h6bt0r0g.js → chunk-a2j0x1a6.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-g3b2zf8r.js → chunk-vzbec50q.js} +1 -1
- package/dist/builtin/workflows/builtin/goal.js +1 -1
- package/dist/builtin/workflows/builtin/index.js +2 -2
- package/dist/builtin/workflows/builtin/ralph.js +1 -1
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +922 -473
- package/dist/builtin/workflows/src/extension/local-worker-entry.mjs +1006 -484
- package/dist/builtin/workflows/src/index.js +892 -448
- package/dist/builtin/workflows/src/local-worker-entry.mjs +1006 -484
- package/dist/builtin/workflows/src/shared/workflow-infrastructure-error.d.ts +6 -0
- package/dist/core/agent-session-retry.d.ts.map +1 -1
- package/dist/core/agent-session-retry.js +12 -3
- package/dist/core/agent-session-retry.js.map +1 -1
- package/dist/core/model-fallback-failures.d.ts +14 -4
- package/dist/core/model-fallback-failures.d.ts.map +1 -1
- package/dist/core/model-fallback-failures.js +43 -15
- package/dist/core/model-fallback-failures.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +1 -0
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +1 -0
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/settings-manager-basic-accessors.d.ts +1 -0
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js +2 -0
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-schema.d.ts +2 -0
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +4 -0
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/slash-commands.js +2 -2
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/interactive-startup-chat-container.d.ts +2 -0
- package/dist/modes/interactive/interactive-startup-chat-container.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup-chat-container.js +6 -0
- package/dist/modes/interactive/interactive-startup-chat-container.js.map +1 -1
- package/dist/modes/interactive-engine/remote-renderer.d.ts +27 -5
- package/dist/modes/interactive-engine/remote-renderer.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-renderer.js +76 -16
- package/dist/modes/interactive-engine/remote-renderer.js.map +1 -1
- package/docs/intercom/reference.md +1 -1
- package/docs/models/evals.md +30 -2
- package/docs/settings.md +3 -0
- package/docs/subagents/reference.md +3 -1
- package/docs/workflows/api-reference.md +9 -6
- package/docs/workflows/builtins.md +1 -1
- package/docs/workflows/operations.md +6 -4
- package/npm-shrinkwrap.json +32 -32
- package/package.json +3 -3
- package/schemas/settings.schema.json +5 -0
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACN,WAAW,GAIX,MAAM,wBAAwB,CAAC;AAWhC,OAAO,EAEN,6BAA6B,EAC7B,wCAAwC,GACxC,MAAM,qCAAqC,CAAC;AAU7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAEjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAA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6B,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACvF,sBAAsB;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EACN,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,qCAAqC,EACrC,uCAAuC,EAGvC,qBAAqB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAqB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC3G,OAAO,EAAE,oCAAoC,EAAE,MAAM,iBAAiB,CAAC;AACvE,kBAAkB;AAClB,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export type { ExtensionBindings } from \"./core/agent-session-types.js\";\nexport {\n\tCacheWarmer,\n\ttype CacheWarmingDecisionEvent,\n\ttype CacheWarmingDecisionEventResult,\n\ttype CacheWarmingStatus,\n} from \"./core/cache-warmer.ts\";\nexport type { ExecuteToolOptions, ExtensionToolContext } from \"./core/extensions/context-types.ts\";\nexport type {\n\tHostDiagnostic,\n\tHostInput,\n\tHostInputOptions,\n\tQuestionAnswer,\n\tQuestionnaireError,\n\tQuestionnaireResult,\n\tQuestionParams,\n} from \"./core/extensions/host-input.js\";\nexport {\n\ttype ExtensionContextEffectPhase,\n\tpublishExtensionContextEffect,\n\tregisterExtensionContextRetirementEffect,\n} from \"./core/extensions/runner-context.ts\";\nexport type {\n\tToolAnnotations,\n\tToolExposure,\n\tToolLoadout,\n\tToolLoadoutChanges,\n\tToolNamespace,\n\tToolRendererResolver,\n\tToolRenderers,\n} from \"./core/extensions/tool-types.ts\";\nexport { resolveRestoredModelReference } from \"./core/model-resolver-initial.ts\";\nexport type { UsageEntry } from \"./core/session-manager.ts\";\nexport { resolveSessionStore } from \"./core/session-storage.js\";\nexport { CACHE_WARMING_MODES, type CacheWarmingMode } from \"./core/settings-manager.ts\";\nexport * from \"./core/storage/index.js\";\n// Outside the storage barrel: workflow durability setup imports that barrel in every test worker.\nexport {\n\ttype ProcessStorageChoice,\n\tprocessSharedStorageSelection,\n\ttype StorageDomain,\n\tselectProcessStorage,\n} from \"./core/storage/process-selection.js\";\nexport { JsonlSessionStore } from \"./core/storage/session/jsonl-session-store.js\";\n// Internal trusted-host task integration (not model authority).\nexport { AgentTaskHost, type AgentTaskHostBinding, type AgentTaskRunnerFactory } from \"./core/tasks/agent-adapter.js\";\nexport type { AgentIntent, OperationId, TaskId, TaskRecord, TaskResult, WaitPolicy } from \"./core/tasks/contracts.js\";\nexport { type AdmittedAgentTask, collectAgentTasks } from \"./core/tasks/execution-scope.js\";\nexport {\n\tDEFAULT_TASK_HEARTBEAT_MS,\n\tMIN_TASK_HEARTBEAT_MS,\n\tTASK_HEARTBEAT_MESSAGE_TYPE,\n\ttype TaskHeartbeatDetails,\n\tvalidateTaskHeartbeatMs,\n} from \"./core/tasks/heartbeat-notice.js\";\nexport {\n\tbindOwnerTaskStore,\n\tgetOwnerTaskStore,\n\tOwnerTaskStore,\n\ttype TaskActivity,\n\twatchOwnerTaskStoreBinding,\n} from \"./core/tasks/owner-store.js\";\nexport {\n\townerTaskViewSource,\n\ttype TaskDetailText,\n\ttype TaskOutputView,\n\ttype TaskTranscriptFollow,\n\ttype TaskTranscriptView,\n\ttype TaskViewResult,\n\ttype TaskViewSource,\n} from \"./core/tasks/task-view-source.js\";\nexport { formatReadLineRange, formatToolCallWithArgs } from \"./core/tools/render-utils.ts\";\nexport {\n\tcreateTranscript,\n\ttype Transcript,\n\ttype TranscriptOptions,\n\ttype TranscriptPart,\n\ttype TranscriptTextPart,\n\ttype TranscriptThinkingPart,\n\ttype TranscriptToolCallPart,\n\ttype TranscriptToolResult,\n\ttype TranscriptToolResultFormat,\n} from \"./core/transcript.js\";\nexport { type CodemodeExtensionOptions, createCodemodeExtension } from \"./extensions/codemode/index.js\";\nexport {\n\ttype CodemodeToolDetails,\n\ttype CodemodeToolOptions,\n\tcreateCodemodeDescription,\n\tcreateCodemodeTool,\n\tcreateCodemodeToolDefinition,\n} from \"./extensions/codemode/tool.js\";\nexport { createToolSearchExtension } from \"./extensions/tool-search/index.js\";\nexport { createToolSearchToolDefinition, type ToolSearchToolOptions } from \"./extensions/tool-search/tool.js\";\nexport { renderTaskFooter, TaskList, taskListSections } from \"./modes/interactive/components/task-list.js\";\nexport { TaskRow } from \"./modes/interactive/components/task-row.js\";\nexport {\n\tapplyAssistantMessageDelta,\n\tbeginStreamingAssistantMessage,\n} from \"./modes/interactive/streaming-assistant-message.ts\";\n// Core session management\n\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n// Config paths\nexport {\n\tAPP_NAME,\n\tAPP_TITLE,\n\tCONFIG_DIR_NAME,\n\tCONFIG_DIR_NAMES,\n\tgetAgentConfigPaths,\n\tgetAgentDir,\n\tgetAgentDirs,\n\tgetBundledInteractiveAssetPath,\n\tgetChangelogPath,\n\tgetDocsPath,\n\tgetEnvNames,\n\tgetEnvValue,\n\tgetExamplesPath,\n\tgetExportTemplateDir,\n\tgetInteractiveAssetsDir,\n\tgetLegacyAgentDir,\n\tgetPackageDir,\n\tgetPackageJsonPath,\n\tgetProjectConfigDirs,\n\tgetProjectConfigPaths,\n\tgetReadmePath,\n\tgetThemesDir,\n\tgetUserConfigDirs,\n\tgetUserConfigPaths,\n\thasEnvValue,\n\tisBunBinary,\n\tLEGACY_CONFIG_DIR_NAME,\n\tLEGACY_ENV_PREFIX,\n\tPACKAGE_NAME,\n\tsetEnvValue,\n\tVERSION,\n\tWORKFLOW_STAGE_SUBAGENT_GUARD_ENV,\n} from \"./config.js\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype CompactionReason,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionCompactOptions,\n\ttype SessionRecoveryReport,\n\ttype SessionStats,\n} from \"./core/agent-session.js\";\n// Auth and model runtime\nexport { AuthStorage, readStoredCredential } from \"./core/auth-storage.ts\";\nexport {\n\ttype AuthStorageBackend,\n\tFileAuthStorageBackend,\n\tInMemoryAuthStorageBackend,\n} from \"./core/auth-storage-backends.ts\";\nexport { type BashResult, executeBashWithOperations } from \"./core/bash-executor.ts\";\nexport { getBuiltinPackagePaths } from \"./core/builtin-packages.ts\";\nexport {\n\ttype CallbackActivityDescriptor,\n\ttype CallbackActivityKind,\n\trunCallback,\n\trunSynchronousCallback,\n} from \"./core/callback-activity.ts\";\n// Cloudflare AI Gateway over the Workers AI binding (no API token; see docs/providers.md)\nexport {\n\ttype AiGatewayBinding,\n\ttype AiGatewayBindingGateway,\n\ttype AiGatewayUniversalRequestLike,\n\tCLOUDFLARE_GATEWAY_BINDING_AUTH_SENTINEL,\n\tcreateGatewayBindingFetch,\n\ttype GatewayBindingFetchOptions,\n} from \"./core/cloudflare-gateway-binding.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactedTranscript,\n\ttype CompactionPlannerModel,\n\ttype CompactionPlanOptions,\n\ttype CompactionRung,\n\ttype CompactionRungResult,\n\ttype CompactionRunRequest,\n\ttype CompactionUrgency,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileOperations,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgetLastAssistantUsage,\n\ttype LineRange,\n\ttype PlannerAuth,\n\ttype PlannerBudget,\n\ttype PlannerLimitClass,\n\ttype PlannerOutcome,\n\tprepareBranchEntries,\n\tprepareCompactionBoundary,\n\trunVerbatimCompaction,\n\tserializeConversation,\n\tserializeConversationForCompaction,\n\tshouldCompact,\n\tstartNewContextWindow,\n\ttype VerbatimCompactionDetails,\n\ttype VerbatimCompactionParameters,\n\ttype VerbatimCompactionPreparation,\n\ttype VerbatimCompactionResult,\n} from \"./core/compaction/index.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.js\";\nexport {\n\tAutoRoutingInferenceError,\n\ttype ModelRoute,\n\ttype ModelRoutingContext,\n\ttype RoutingInferenceBounds,\n\trouteExecutionModel,\n} from \"./core/execution-model-router.js\";\nexport { areExperimentalFeaturesEnabled } from \"./core/experimental.ts\";\nexport { sessionScopedExtensionState } from \"./core/extension-session-state.ts\";\nexport {\n\tExtensionStartupError,\n\ttype ExtensionStartupFailure,\n\tisExtensionStartupFailure,\n\tisTransientExtensionStartupFailure,\n} from \"./core/extension-startup-failure.ts\";\n// Run modes for programmatic SDK usage\nexport { noOpUIContext } from \"./core/extensions/runner-ui.ts\";\nexport {\n\tgetModelFastRoute,\n\tresolveUpstreamModelId,\n\tusesChatGptCodexTransport,\n\tusesFirstPartyCodexRouting,\n\twithCodexFastRouteHeaders,\n\twithFastRouteStreamOptions,\n} from \"./core/fast-model-routing.ts\";\nexport {\n\tCODEX_FAST_ROUTE_HEADER,\n\tCODEX_FAST_ROUTE_ORIGINATOR,\n} from \"./core/fast-model-routing-transport.ts\";\nexport {\n\tANTHROPIC_FAST_MODE_MODEL_IDS,\n\tcopilotAdvertisedFastModelIds,\n\tderiveFastModelVariants,\n\tFAST_MODEL_ID_SUFFIX,\n\tFAST_MODEL_SERVICE_TIER,\n\tFAST_MODEL_SPEED,\n\ttype FastModelVariantDerivation,\n\ttype FastModelVariantDiagnostic,\n\ttype FastModelVariantsOptions,\n\tfastModelId,\n\tisNativeFastRouteApi,\n\tusesAnthropicFastMode,\n\tusesOpenAIFastServiceTier,\n\tusesXaiFastServiceTier,\n\twithFastModelVariants,\n} from \"./core/fast-model-variants.ts\";\nexport {\n\tparseFlattenedKeyPath,\n\treconstructFlattenedKeys,\n\tunflattenArgumentsWithSchema,\n} from \"./core/flattened-tool-arguments.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport {\n\tRUNTIME_INTERCOM_GROUP_ENV,\n\treadRuntimeIntercomGroup,\n\truntimeIntercomGroupEnvKey,\n} from \"./core/intercom-runtime-group.ts\";\nexport { keybindingIdentity } from \"./core/keybinding-identity.js\";\nexport { matchesMcpDirectToolSelection } from \"./core/mcp-child-policy.ts\";\nexport {\n\ttype McpExposure,\n\ttype McpOAuthConfig,\n\ttype McpServerConfig,\n\ttype McpServerContribution,\n\tmcpNamespace,\n\tvalidateMcpServerConfig,\n} from \"./core/mcp-servers.ts\";\nexport { convertToLlm } from \"./core/messages.ts\";\nexport type {\n\tModelFallbackFailureKind,\n\tModelFallbackFailureSignal,\n\tModelFallbackFailureSource,\n} from \"./core/model-fallback-failures.ts\";\nexport {\n\terrorMessage,\n\tisRetryableModelFailure,\n\tisRetryableSameModelFailure,\n\tmodelFailureMessage,\n\tnormalizeModelFailureSignal,\n} from \"./core/model-fallback-failures.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport {\n\teligiblePair,\n\ttype ModelConstraints,\n\tModelConstraintsSchema,\n\ttype ModelRouterOutput,\n\tparseModelConstraints,\n\tsetsProviders,\n} from \"./core/model-routing-constraints.js\";\nexport {\n\tisModelRoutingDebugEnabled,\n\tMODEL_ROUTING_DEBUG_ENV,\n\treportModelRoutingDebug,\n} from \"./core/model-routing-debug.js\";\nexport {\n\tDIFFICULTY_LEVELS,\n\ttype Difficulty,\n\tMISTAKE_COST_LEVELS,\n\ttype MistakeCost,\n\tmergeTaskNeeds,\n\tparseTaskNeeds,\n\ttype TaskNeeds,\n\tTaskNeedsSchema,\n\tWORK_KINDS,\n\ttype WorkKind,\n} from \"./core/model-routing-needs.js\";\nexport {\n\ttype CreateModelRuntimeOptions,\n\tCredentialSynchronizationError,\n\ttype CredentialSynchronizationOperation,\n\tModelRuntime,\n\ttype ModelRuntimeAuthOverrides,\n} from \"./core/model-runtime.js\";\nexport type {\n\tPackageInstallFailure,\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedMcpServer,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport {\n\tapplyProviderRateLimitObservation,\n\tconfigureProviderRequestBudget,\n\tisProviderRateLimit,\n\tmodelIdForModel,\n\tobserveProviderRateLimits,\n\ttype ProviderRateLimitObservation,\n\ttype ProviderRateLimitSnapshot,\n\ttype ProviderRequestBudget,\n\tproviderCooldownMs,\n\tproviderIdForModel,\n\tproviderRateLimitObservations,\n\tproviderRateLimitSnapshot,\n\tproviderRetryHint,\n\tproviderUnavailableMs,\n\trecordProviderRateLimit,\n} from \"./core/provider-rate-limits.js\";\nexport type {\n\tDefaultResourceLoaderInheritanceSnapshot,\n\tResourceCollision,\n\tResourceDiagnostic,\n\tResourceLoader,\n\tSkillCandidate,\n\tSkillCatalog,\n\tSkillCatalogCommand,\n\tSkillResolution,\n} from \"./core/resource-loader.ts\";\nexport {\n\tbuildSkillCatalog,\n\tDefaultResourceLoader,\n\tgetSkillCatalog,\n\tloadProjectContextFiles,\n} from \"./core/resource-loader.ts\";\nexport { nextRetryDecision, type RetryDecision, type RetryPolicySettings } from \"./core/retry-policy.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype AtomicBuiltin,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateLsTool,\n\tcreatePowerShellTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateSearchTool,\n\tcreateStructuredOutputCapture,\n\tcreateStructuredOutputTool,\n\tcreateWriteTool,\n\ttype JsonObject,\n\ttype JsonPrimitive,\n\ttype JsonValue,\n\ttype MessageEndEvent,\n\ttype MessageStartEvent,\n\ttype MessageUpdateEvent,\n\ttype PromptTemplate,\n\ttype ResourceAdmission,\n\ttype ResourceAdmissionRequest,\n\ttype ResourcePermit,\n\ttype ResourceProcessIdentity,\n\tSTRUCTURED_OUTPUT_TOOL_NAME,\n\ttype StructuredOutputCapture,\n\ttype StructuredOutputFileCapture,\n\ttype StructuredOutputToolOptions,\n\ttype ToolExecutionEndEvent,\n\ttype ToolExecutionStartEvent,\n\ttype ToolExecutionUpdateEvent,\n\twithResourceAdmission,\n} from \"./core/sdk.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildContextEntries,\n\tbuildSessionContext,\n\tbuildSessionProjection,\n\ttype CompactionEntry,\n\ttype ContextEditableContent,\n\ttype ContextEditEntry,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetDefaultSessionDirPath,\n\tgetLatestCompactionBoundaryEntry,\n\ttype ModelChangeEntry,\n\ttype NewSessionOptions,\n\ttype ProjectedSessionEntry,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\tSessionEntryError,\n\ttype SessionHeader,\n\tSessionIdError,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype SessionNameState,\n\ttype SessionProjection,\n\ttype SessionSummaryEntry,\n\ttype SessionTreeNode,\n\ttype SessionWorkflowMetadata,\n\tsessionEntryToContextMessages,\n\ttype ThinkingLevelChangeEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\tWORKFLOW_SESSION_METADATA_ENV,\n\tworkflowSessionMetadataFromEnv,\n} from \"./core/session-manager-classification.ts\";\nexport type { DefaultProjectTrust, QuietStartup } from \"./core/settings-manager.ts\";\nexport {\n\ttype CompactionModelOverride,\n\ttype CompactionSettings,\n\ttype ImageSettings,\n\ttype ModelRoutingSettings,\n\ttype PackageSource,\n\ttype RetrySettings,\n\ttype Settings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n} from \"./core/settings-manager.ts\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\nexport {\n\tgenerateStructuredOutput,\n\ttype StructuredOutputRequest,\n\ttype StructuredOutputResult,\n} from \"./core/structured-output/index.js\";\nexport type { NormalizedBuildSystemPromptOptions } from \"./core/system-prompt.ts\";\nexport {\n\tformatToolStatus,\n\ttype ToolSelectionSource,\n\ttype ToolSelectionStatus,\n\ttype ToolStatus,\n\ttype ToolStatusFormatStyle,\n\ttype ToolStatusReport,\n\ttype UnavailableToolStatus,\n} from \"./core/tool-status.js\";\nexport { type EditDiffResult, generateDiffString, generateUnifiedPatch } from \"./core/tools/edit-diff.ts\";\n// Builtin tool definitions reusable by first-party extensions (e.g. workflows\n// invoking the structured ask_user_question UI deterministically).\n// Tools\nexport {\n\tBASH_SHELL_PRESENTATION,\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tbashToolSystemPromptContribution,\n\tcreateAskUserQuestionToolDefinition,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateKillTool,\n\tcreateKillToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLocalPowerShellOperations,\n\tcreateLsToolDefinition,\n\tcreatePowerShellToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateSearchToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\teditToolSystemPromptContribution,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tfindToolSystemPromptContribution,\n\tformatSize,\n\ttype KillToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\tlsToolSystemPromptContribution,\n\ttype PowerShellOperations,\n\ttype PowerShellSpawnContext,\n\ttype PowerShellSpawnHook,\n\ttype PowerShellToolDetails,\n\ttype PowerShellToolInput,\n\ttype PowerShellToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\treadToolSystemPromptContribution,\n\ttype SearchToolDetails,\n\ttype SearchToolInput,\n\ttype SearchToolOptions,\n\ttype ShellToolPresentation,\n\tsearchToolSystemPromptContribution,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteFileOptions,\n\ttype WriteOperations,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n\twriteToolSystemPromptContribution,\n} from \"./core/tools/index.js\";\nexport {\n\thasProjectTrustInputs,\n\thasTrustRequiringProjectResources,\n\ttype ProjectTrustDecision,\n\tProjectTrustStore,\n\ttype ProjectTrustStoreEntry,\n\ttype ProjectTrustUpdate,\n\tTRUST_REQUIRING_PROJECT_CONFIG_RESOURCES,\n} from \"./core/trust-manager.ts\";\nexport { StringEnum, type StringEnumOptions } from \"./core/typebox-compat.ts\";\nexport {\n\ttype LoadedMcpConfig,\n\ttype McpServerConfigPatch,\n\ttype McpServerEntry,\n\tupdateMcpServerConfig,\n} from \"./extensions/mcp/config.ts\";\nexport { createMcpExtension, type McpExtensionOptions } from \"./extensions/mcp/index.js\";\nexport { McpOAuthCredentialStore } from \"./extensions/mcp/oauth.ts\";\nexport * from \"./index-extensions.js\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEvent,\n\ttype RpcEventListener,\n\ttype RpcExtensionUIRequest,\n\ttype RpcExtensionUIResponse,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\ttype ChatMessageEntry,\n\ttype ChatMessageRenderOptions,\n\t// Internal host seam for bundled workflow stage chat; not yet a stable extension API.\n\tChatSessionHost,\n\ttype ChatSessionHostBashRequest,\n\ttype ChatSessionHostCommands,\n\ttype ChatSessionHostEntry,\n\ttype ChatSessionHostOpts,\n\ttype ChatSessionHostStyle,\n\ttype ChatSessionSubmitMode,\n\tChatTranscriptComponent,\n\ttype ChatTranscriptEntryLike,\n\ttype ChatTranscriptRenderer,\n\ttype ChatTranscriptRole,\n\tCustomEditor,\n\ttype CustomEditorOptions,\n\tCustomEntryComponent,\n\tCustomMessageComponent,\n\tchatEntriesFromAgentMessages,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyHintIfBound,\n\tkeyText,\n\tLiveChatEntriesController,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderChatMessageEntry,\n\trenderDiff,\n\tScrollableChatTranscriptComponent,\n\tScrollableComponentViewport,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tTRANSCRIPT_JUMP_TO_END_URL,\n\tTranscriptFollowIndicator,\n\tTreeSelectorComponent,\n\ttruncateToVisualLines,\n\tUsageMeterComponent,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n\tWorkingStatusComponent,\n\ttype WorkingStatusComponentOptions,\n} from \"./modes/interactive/components/index.ts\";\nexport {\n\tclassifyChatCommand,\n\tcreateSessionSkillAutocompleteProvider,\n\tgetSessionCommandCatalog,\n\tgetSessionSkillCommands,\n\ttype PendingSessionCommandCatalog,\n\ttype SessionCommandCatalog,\n} from \"./modes/interactive/skill-command-autocomplete.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.js\";\nexport { pickWhimsicalWorkingMessage } from \"./modes/interactive/whimsical-messages.ts\";\nexport { createChildProcessEnvironment, spawnProcess } from \"./utils/child-process.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.js\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport {\n\tisSafeFsWatchPathError,\n\tisUnsafeWindowsShortPath,\n\tresolveNativeWatchPath,\n\tSAFE_FS_WATCH_CANONICALIZATION_FAILED,\n\tSAFE_FS_WATCH_UNSAFE_WINDOWS_SHORT_PATH,\n\ttype SafeFsWatchErrorCode,\n\ttype SafeFsWatchPathError,\n\twatchWithErrorHandler,\n} from \"./utils/fs-watch.ts\";\nexport { createGitEnvironment, GIT_LOCAL_ENV_VARS } from \"./utils/git-env.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\nexport { INTERACTIVE_ENGINE_ENV_VARS, scrubInteractiveEngineEnv } from \"./utils/interactive-engine-env.ts\";\nexport { detectSupportedImageMimeTypeFromFile } from \"./utils/mime.ts\";\n// Shell utilities\nexport { getPowerShellConfig, getShellConfig } from \"./utils/shell.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACN,WAAW,GAIX,MAAM,wBAAwB,CAAC;AAWhC,OAAO,EAEN,6BAA6B,EAC7B,wCAAwC,GACxC,MAAM,qCAAqC,CAAC;AAU7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAEjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAyB,MAAM,4BAA4B,CAAC;AACxF,cAAc,yBAAyB,CAAC;AACxC,kGAAkG;AAClG,OAAO,EAEN,6BAA6B,EAE7B,oBAAoB,GACpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,gEAAgE;AAChE,OAAO,EAAE,aAAa,EAA0D,MAAM,+BAA+B,CAAC;AAEtH,OAAO,EAA0B,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,EACN,yBAAyB,EACzB,qBAAqB,EACr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;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAqB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC3G,OAAO,EAAE,oCAAoC,EAAE,MAAM,iBAAiB,CAAC;AACvE,kBAAkB;AAClB,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export type { ExtensionBindings } from \"./core/agent-session-types.js\";\nexport {\n\tCacheWarmer,\n\ttype CacheWarmingDecisionEvent,\n\ttype CacheWarmingDecisionEventResult,\n\ttype CacheWarmingStatus,\n} from \"./core/cache-warmer.ts\";\nexport type { ExecuteToolOptions, ExtensionToolContext } from \"./core/extensions/context-types.ts\";\nexport type {\n\tHostDiagnostic,\n\tHostInput,\n\tHostInputOptions,\n\tQuestionAnswer,\n\tQuestionnaireError,\n\tQuestionnaireResult,\n\tQuestionParams,\n} from \"./core/extensions/host-input.js\";\nexport {\n\ttype ExtensionContextEffectPhase,\n\tpublishExtensionContextEffect,\n\tregisterExtensionContextRetirementEffect,\n} from \"./core/extensions/runner-context.ts\";\nexport type {\n\tToolAnnotations,\n\tToolExposure,\n\tToolLoadout,\n\tToolLoadoutChanges,\n\tToolNamespace,\n\tToolRendererResolver,\n\tToolRenderers,\n} from \"./core/extensions/tool-types.ts\";\nexport { resolveRestoredModelReference } from \"./core/model-resolver-initial.ts\";\nexport type { UsageEntry } from \"./core/session-manager.ts\";\nexport { resolveSessionStore } from \"./core/session-storage.js\";\nexport { CACHE_WARMING_MODES, type CacheWarmingMode } from \"./core/settings-manager.ts\";\nexport * from \"./core/storage/index.js\";\n// Outside the storage barrel: workflow durability setup imports that barrel in every test worker.\nexport {\n\ttype ProcessStorageChoice,\n\tprocessSharedStorageSelection,\n\ttype StorageDomain,\n\tselectProcessStorage,\n} from \"./core/storage/process-selection.js\";\nexport { JsonlSessionStore } from \"./core/storage/session/jsonl-session-store.js\";\n// Internal trusted-host task integration (not model authority).\nexport { AgentTaskHost, type AgentTaskHostBinding, type AgentTaskRunnerFactory } from \"./core/tasks/agent-adapter.js\";\nexport type { AgentIntent, OperationId, TaskId, TaskRecord, TaskResult, WaitPolicy } from \"./core/tasks/contracts.js\";\nexport { type AdmittedAgentTask, collectAgentTasks } from \"./core/tasks/execution-scope.js\";\nexport {\n\tDEFAULT_TASK_HEARTBEAT_MS,\n\tMIN_TASK_HEARTBEAT_MS,\n\tTASK_HEARTBEAT_MESSAGE_TYPE,\n\ttype TaskHeartbeatDetails,\n\tvalidateTaskHeartbeatMs,\n} from \"./core/tasks/heartbeat-notice.js\";\nexport {\n\tbindOwnerTaskStore,\n\tgetOwnerTaskStore,\n\tOwnerTaskStore,\n\ttype TaskActivity,\n\twatchOwnerTaskStoreBinding,\n} from \"./core/tasks/owner-store.js\";\nexport {\n\townerTaskViewSource,\n\ttype TaskDetailText,\n\ttype TaskOutputView,\n\ttype TaskTranscriptFollow,\n\ttype TaskTranscriptView,\n\ttype TaskViewResult,\n\ttype TaskViewSource,\n} from \"./core/tasks/task-view-source.js\";\nexport { formatReadLineRange, formatToolCallWithArgs } from \"./core/tools/render-utils.ts\";\nexport {\n\tcreateTranscript,\n\ttype Transcript,\n\ttype TranscriptOptions,\n\ttype TranscriptPart,\n\ttype TranscriptTextPart,\n\ttype TranscriptThinkingPart,\n\ttype TranscriptToolCallPart,\n\ttype TranscriptToolResult,\n\ttype TranscriptToolResultFormat,\n} from \"./core/transcript.js\";\nexport { type CodemodeExtensionOptions, createCodemodeExtension } from \"./extensions/codemode/index.js\";\nexport {\n\ttype CodemodeToolDetails,\n\ttype CodemodeToolOptions,\n\tcreateCodemodeDescription,\n\tcreateCodemodeTool,\n\tcreateCodemodeToolDefinition,\n} from \"./extensions/codemode/tool.js\";\nexport { createToolSearchExtension } from \"./extensions/tool-search/index.js\";\nexport { createToolSearchToolDefinition, type ToolSearchToolOptions } from \"./extensions/tool-search/tool.js\";\nexport { renderTaskFooter, TaskList, taskListSections } from \"./modes/interactive/components/task-list.js\";\nexport { TaskRow } from \"./modes/interactive/components/task-row.js\";\nexport {\n\tapplyAssistantMessageDelta,\n\tbeginStreamingAssistantMessage,\n} from \"./modes/interactive/streaming-assistant-message.ts\";\n// Core session management\n\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n// Config paths\nexport {\n\tAPP_NAME,\n\tAPP_TITLE,\n\tCONFIG_DIR_NAME,\n\tCONFIG_DIR_NAMES,\n\tgetAgentConfigPaths,\n\tgetAgentDir,\n\tgetAgentDirs,\n\tgetBundledInteractiveAssetPath,\n\tgetChangelogPath,\n\tgetDocsPath,\n\tgetEnvNames,\n\tgetEnvValue,\n\tgetExamplesPath,\n\tgetExportTemplateDir,\n\tgetInteractiveAssetsDir,\n\tgetLegacyAgentDir,\n\tgetPackageDir,\n\tgetPackageJsonPath,\n\tgetProjectConfigDirs,\n\tgetProjectConfigPaths,\n\tgetReadmePath,\n\tgetThemesDir,\n\tgetUserConfigDirs,\n\tgetUserConfigPaths,\n\thasEnvValue,\n\tisBunBinary,\n\tLEGACY_CONFIG_DIR_NAME,\n\tLEGACY_ENV_PREFIX,\n\tPACKAGE_NAME,\n\tsetEnvValue,\n\tVERSION,\n\tWORKFLOW_STAGE_SUBAGENT_GUARD_ENV,\n} from \"./config.js\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype CompactionReason,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionCompactOptions,\n\ttype SessionRecoveryReport,\n\ttype SessionStats,\n} from \"./core/agent-session.js\";\n// Auth and model runtime\nexport { AuthStorage, readStoredCredential } from \"./core/auth-storage.ts\";\nexport {\n\ttype AuthStorageBackend,\n\tFileAuthStorageBackend,\n\tInMemoryAuthStorageBackend,\n} from \"./core/auth-storage-backends.ts\";\nexport { type BashResult, executeBashWithOperations } from \"./core/bash-executor.ts\";\nexport { getBuiltinPackagePaths } from \"./core/builtin-packages.ts\";\nexport {\n\ttype CallbackActivityDescriptor,\n\ttype CallbackActivityKind,\n\trunCallback,\n\trunSynchronousCallback,\n} from \"./core/callback-activity.ts\";\n// Cloudflare AI Gateway over the Workers AI binding (no API token; see docs/providers.md)\nexport {\n\ttype AiGatewayBinding,\n\ttype AiGatewayBindingGateway,\n\ttype AiGatewayUniversalRequestLike,\n\tCLOUDFLARE_GATEWAY_BINDING_AUTH_SENTINEL,\n\tcreateGatewayBindingFetch,\n\ttype GatewayBindingFetchOptions,\n} from \"./core/cloudflare-gateway-binding.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactedTranscript,\n\ttype CompactionPlannerModel,\n\ttype CompactionPlanOptions,\n\ttype CompactionRung,\n\ttype CompactionRungResult,\n\ttype CompactionRunRequest,\n\ttype CompactionUrgency,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileOperations,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgetLastAssistantUsage,\n\ttype LineRange,\n\ttype PlannerAuth,\n\ttype PlannerBudget,\n\ttype PlannerLimitClass,\n\ttype PlannerOutcome,\n\tprepareBranchEntries,\n\tprepareCompactionBoundary,\n\trunVerbatimCompaction,\n\tserializeConversation,\n\tserializeConversationForCompaction,\n\tshouldCompact,\n\tstartNewContextWindow,\n\ttype VerbatimCompactionDetails,\n\ttype VerbatimCompactionParameters,\n\ttype VerbatimCompactionPreparation,\n\ttype VerbatimCompactionResult,\n} from \"./core/compaction/index.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.js\";\nexport {\n\tAutoRoutingInferenceError,\n\ttype ModelRoute,\n\ttype ModelRoutingContext,\n\ttype RoutingInferenceBounds,\n\trouteExecutionModel,\n} from \"./core/execution-model-router.js\";\nexport { areExperimentalFeaturesEnabled } from \"./core/experimental.ts\";\nexport { sessionScopedExtensionState } from \"./core/extension-session-state.ts\";\nexport {\n\tExtensionStartupError,\n\ttype ExtensionStartupFailure,\n\tisExtensionStartupFailure,\n\tisTransientExtensionStartupFailure,\n} from \"./core/extension-startup-failure.ts\";\n// Run modes for programmatic SDK usage\nexport { noOpUIContext } from \"./core/extensions/runner-ui.ts\";\nexport {\n\tgetModelFastRoute,\n\tresolveUpstreamModelId,\n\tusesChatGptCodexTransport,\n\tusesFirstPartyCodexRouting,\n\twithCodexFastRouteHeaders,\n\twithFastRouteStreamOptions,\n} from \"./core/fast-model-routing.ts\";\nexport {\n\tCODEX_FAST_ROUTE_HEADER,\n\tCODEX_FAST_ROUTE_ORIGINATOR,\n} from \"./core/fast-model-routing-transport.ts\";\nexport {\n\tANTHROPIC_FAST_MODE_MODEL_IDS,\n\tcopilotAdvertisedFastModelIds,\n\tderiveFastModelVariants,\n\tFAST_MODEL_ID_SUFFIX,\n\tFAST_MODEL_SERVICE_TIER,\n\tFAST_MODEL_SPEED,\n\ttype FastModelVariantDerivation,\n\ttype FastModelVariantDiagnostic,\n\ttype FastModelVariantsOptions,\n\tfastModelId,\n\tisNativeFastRouteApi,\n\tusesAnthropicFastMode,\n\tusesOpenAIFastServiceTier,\n\tusesXaiFastServiceTier,\n\twithFastModelVariants,\n} from \"./core/fast-model-variants.ts\";\nexport {\n\tparseFlattenedKeyPath,\n\treconstructFlattenedKeys,\n\tunflattenArgumentsWithSchema,\n} from \"./core/flattened-tool-arguments.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport {\n\tRUNTIME_INTERCOM_GROUP_ENV,\n\treadRuntimeIntercomGroup,\n\truntimeIntercomGroupEnvKey,\n} from \"./core/intercom-runtime-group.ts\";\nexport { keybindingIdentity } from \"./core/keybinding-identity.js\";\nexport { matchesMcpDirectToolSelection } from \"./core/mcp-child-policy.ts\";\nexport {\n\ttype McpExposure,\n\ttype McpOAuthConfig,\n\ttype McpServerConfig,\n\ttype McpServerContribution,\n\tmcpNamespace,\n\tvalidateMcpServerConfig,\n} from \"./core/mcp-servers.ts\";\nexport { convertToLlm } from \"./core/messages.ts\";\nexport type {\n\tModelFallbackFailureKind,\n\tModelFallbackFailureOptions,\n\tModelFallbackFailureSignal,\n\tModelFallbackFailureSource,\n} from \"./core/model-fallback-failures.ts\";\nexport {\n\terrorMessage,\n\tisRetryableModelFailure,\n\tisRetryableSameModelFailure,\n\tmodelFailureMessage,\n\tnormalizeModelFailureSignal,\n} from \"./core/model-fallback-failures.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport {\n\teligiblePair,\n\ttype ModelConstraints,\n\tModelConstraintsSchema,\n\ttype ModelRouterOutput,\n\tparseModelConstraints,\n\tsetsProviders,\n} from \"./core/model-routing-constraints.js\";\nexport {\n\tisModelRoutingDebugEnabled,\n\tMODEL_ROUTING_DEBUG_ENV,\n\treportModelRoutingDebug,\n} from \"./core/model-routing-debug.js\";\nexport {\n\tDIFFICULTY_LEVELS,\n\ttype Difficulty,\n\tMISTAKE_COST_LEVELS,\n\ttype MistakeCost,\n\tmergeTaskNeeds,\n\tparseTaskNeeds,\n\ttype TaskNeeds,\n\tTaskNeedsSchema,\n\tWORK_KINDS,\n\ttype WorkKind,\n} from \"./core/model-routing-needs.js\";\nexport {\n\ttype CreateModelRuntimeOptions,\n\tCredentialSynchronizationError,\n\ttype CredentialSynchronizationOperation,\n\tModelRuntime,\n\ttype ModelRuntimeAuthOverrides,\n} from \"./core/model-runtime.js\";\nexport type {\n\tPackageInstallFailure,\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedMcpServer,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport {\n\tapplyProviderRateLimitObservation,\n\tconfigureProviderRequestBudget,\n\tisProviderRateLimit,\n\tmodelIdForModel,\n\tobserveProviderRateLimits,\n\ttype ProviderRateLimitObservation,\n\ttype ProviderRateLimitSnapshot,\n\ttype ProviderRequestBudget,\n\tproviderCooldownMs,\n\tproviderIdForModel,\n\tproviderRateLimitObservations,\n\tproviderRateLimitSnapshot,\n\tproviderRetryHint,\n\tproviderUnavailableMs,\n\trecordProviderRateLimit,\n} from \"./core/provider-rate-limits.js\";\nexport type {\n\tDefaultResourceLoaderInheritanceSnapshot,\n\tResourceCollision,\n\tResourceDiagnostic,\n\tResourceLoader,\n\tSkillCandidate,\n\tSkillCatalog,\n\tSkillCatalogCommand,\n\tSkillResolution,\n} from \"./core/resource-loader.ts\";\nexport {\n\tbuildSkillCatalog,\n\tDefaultResourceLoader,\n\tgetSkillCatalog,\n\tloadProjectContextFiles,\n} from \"./core/resource-loader.ts\";\nexport { nextRetryDecision, type RetryDecision, type RetryPolicySettings } from \"./core/retry-policy.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype AtomicBuiltin,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateLsTool,\n\tcreatePowerShellTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateSearchTool,\n\tcreateStructuredOutputCapture,\n\tcreateStructuredOutputTool,\n\tcreateWriteTool,\n\ttype JsonObject,\n\ttype JsonPrimitive,\n\ttype JsonValue,\n\ttype MessageEndEvent,\n\ttype MessageStartEvent,\n\ttype MessageUpdateEvent,\n\ttype PromptTemplate,\n\ttype ResourceAdmission,\n\ttype ResourceAdmissionRequest,\n\ttype ResourcePermit,\n\ttype ResourceProcessIdentity,\n\tSTRUCTURED_OUTPUT_TOOL_NAME,\n\ttype StructuredOutputCapture,\n\ttype StructuredOutputFileCapture,\n\ttype StructuredOutputToolOptions,\n\ttype ToolExecutionEndEvent,\n\ttype ToolExecutionStartEvent,\n\ttype ToolExecutionUpdateEvent,\n\twithResourceAdmission,\n} from \"./core/sdk.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildContextEntries,\n\tbuildSessionContext,\n\tbuildSessionProjection,\n\ttype CompactionEntry,\n\ttype ContextEditableContent,\n\ttype ContextEditEntry,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetDefaultSessionDirPath,\n\tgetLatestCompactionBoundaryEntry,\n\ttype ModelChangeEntry,\n\ttype NewSessionOptions,\n\ttype ProjectedSessionEntry,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\tSessionEntryError,\n\ttype SessionHeader,\n\tSessionIdError,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype SessionNameState,\n\ttype SessionProjection,\n\ttype SessionSummaryEntry,\n\ttype SessionTreeNode,\n\ttype SessionWorkflowMetadata,\n\tsessionEntryToContextMessages,\n\ttype ThinkingLevelChangeEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\tWORKFLOW_SESSION_METADATA_ENV,\n\tworkflowSessionMetadataFromEnv,\n} from \"./core/session-manager-classification.ts\";\nexport type { DefaultProjectTrust, QuietStartup } from \"./core/settings-manager.ts\";\nexport {\n\ttype CompactionModelOverride,\n\ttype CompactionSettings,\n\ttype ImageSettings,\n\ttype ModelRoutingSettings,\n\ttype PackageSource,\n\ttype RetrySettings,\n\ttype Settings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n} from \"./core/settings-manager.ts\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\nexport {\n\tgenerateStructuredOutput,\n\ttype StructuredOutputRequest,\n\ttype StructuredOutputResult,\n} from \"./core/structured-output/index.js\";\nexport type { NormalizedBuildSystemPromptOptions } from \"./core/system-prompt.ts\";\nexport {\n\tformatToolStatus,\n\ttype ToolSelectionSource,\n\ttype ToolSelectionStatus,\n\ttype ToolStatus,\n\ttype ToolStatusFormatStyle,\n\ttype ToolStatusReport,\n\ttype UnavailableToolStatus,\n} from \"./core/tool-status.js\";\nexport { type EditDiffResult, generateDiffString, generateUnifiedPatch } from \"./core/tools/edit-diff.ts\";\n// Builtin tool definitions reusable by first-party extensions (e.g. workflows\n// invoking the structured ask_user_question UI deterministically).\n// Tools\nexport {\n\tBASH_SHELL_PRESENTATION,\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tbashToolSystemPromptContribution,\n\tcreateAskUserQuestionToolDefinition,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateKillTool,\n\tcreateKillToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLocalPowerShellOperations,\n\tcreateLsToolDefinition,\n\tcreatePowerShellToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateSearchToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\teditToolSystemPromptContribution,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tfindToolSystemPromptContribution,\n\tformatSize,\n\ttype KillToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\tlsToolSystemPromptContribution,\n\ttype PowerShellOperations,\n\ttype PowerShellSpawnContext,\n\ttype PowerShellSpawnHook,\n\ttype PowerShellToolDetails,\n\ttype PowerShellToolInput,\n\ttype PowerShellToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\treadToolSystemPromptContribution,\n\ttype SearchToolDetails,\n\ttype SearchToolInput,\n\ttype SearchToolOptions,\n\ttype ShellToolPresentation,\n\tsearchToolSystemPromptContribution,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteFileOptions,\n\ttype WriteOperations,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n\twriteToolSystemPromptContribution,\n} from \"./core/tools/index.js\";\nexport {\n\thasProjectTrustInputs,\n\thasTrustRequiringProjectResources,\n\ttype ProjectTrustDecision,\n\tProjectTrustStore,\n\ttype ProjectTrustStoreEntry,\n\ttype ProjectTrustUpdate,\n\tTRUST_REQUIRING_PROJECT_CONFIG_RESOURCES,\n} from \"./core/trust-manager.ts\";\nexport { StringEnum, type StringEnumOptions } from \"./core/typebox-compat.ts\";\nexport {\n\ttype LoadedMcpConfig,\n\ttype McpServerConfigPatch,\n\ttype McpServerEntry,\n\tupdateMcpServerConfig,\n} from \"./extensions/mcp/config.ts\";\nexport { createMcpExtension, type McpExtensionOptions } from \"./extensions/mcp/index.js\";\nexport { McpOAuthCredentialStore } from \"./extensions/mcp/oauth.ts\";\nexport * from \"./index-extensions.js\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEvent,\n\ttype RpcEventListener,\n\ttype RpcExtensionUIRequest,\n\ttype RpcExtensionUIResponse,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\ttype ChatMessageEntry,\n\ttype ChatMessageRenderOptions,\n\t// Internal host seam for bundled workflow stage chat; not yet a stable extension API.\n\tChatSessionHost,\n\ttype ChatSessionHostBashRequest,\n\ttype ChatSessionHostCommands,\n\ttype ChatSessionHostEntry,\n\ttype ChatSessionHostOpts,\n\ttype ChatSessionHostStyle,\n\ttype ChatSessionSubmitMode,\n\tChatTranscriptComponent,\n\ttype ChatTranscriptEntryLike,\n\ttype ChatTranscriptRenderer,\n\ttype ChatTranscriptRole,\n\tCustomEditor,\n\ttype CustomEditorOptions,\n\tCustomEntryComponent,\n\tCustomMessageComponent,\n\tchatEntriesFromAgentMessages,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyHintIfBound,\n\tkeyText,\n\tLiveChatEntriesController,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderChatMessageEntry,\n\trenderDiff,\n\tScrollableChatTranscriptComponent,\n\tScrollableComponentViewport,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tTRANSCRIPT_JUMP_TO_END_URL,\n\tTranscriptFollowIndicator,\n\tTreeSelectorComponent,\n\ttruncateToVisualLines,\n\tUsageMeterComponent,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n\tWorkingStatusComponent,\n\ttype WorkingStatusComponentOptions,\n} from \"./modes/interactive/components/index.ts\";\nexport {\n\tclassifyChatCommand,\n\tcreateSessionSkillAutocompleteProvider,\n\tgetSessionCommandCatalog,\n\tgetSessionSkillCommands,\n\ttype PendingSessionCommandCatalog,\n\ttype SessionCommandCatalog,\n} from \"./modes/interactive/skill-command-autocomplete.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.js\";\nexport { pickWhimsicalWorkingMessage } from \"./modes/interactive/whimsical-messages.ts\";\nexport { createChildProcessEnvironment, spawnProcess } from \"./utils/child-process.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.js\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport {\n\tisSafeFsWatchPathError,\n\tisUnsafeWindowsShortPath,\n\tresolveNativeWatchPath,\n\tSAFE_FS_WATCH_CANONICALIZATION_FAILED,\n\tSAFE_FS_WATCH_UNSAFE_WINDOWS_SHORT_PATH,\n\ttype SafeFsWatchErrorCode,\n\ttype SafeFsWatchPathError,\n\twatchWithErrorHandler,\n} from \"./utils/fs-watch.ts\";\nexport { createGitEnvironment, GIT_LOCAL_ENV_VARS } from \"./utils/git-env.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\nexport { INTERACTIVE_ENGINE_ENV_VARS, scrubInteractiveEngineEnv } from \"./utils/interactive-engine-env.ts\";\nexport { detectSupportedImageMimeTypeFromFile } from \"./utils/mime.ts\";\n// Shell utilities\nexport { getPowerShellConfig, getShellConfig } from \"./utils/shell.ts\";\n"]}
|
|
@@ -8,6 +8,8 @@ export declare class StartupChatContainer extends Container {
|
|
|
8
8
|
private startupOutputReleased;
|
|
9
9
|
releaseStartupOutput(): void;
|
|
10
10
|
render(width: number): string[];
|
|
11
|
+
/** A cleared transcript is rebuilt from new rows; the engine-rendered rows it drops are disposed. */
|
|
12
|
+
clear(): void;
|
|
11
13
|
}
|
|
12
14
|
interface StartupChatOutputHost {
|
|
13
15
|
chatContainer: Container;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-startup-chat-container.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-startup-chat-container.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interactive-startup-chat-container.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-startup-chat-container.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,SAAS;IAClD,OAAO,CAAC,qBAAqB,CAAS;IAEtC,oBAAoB,IAAI,IAAI,CAG3B;IAEQ,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAEvC;IAED,qGAAqG;IAC5F,KAAK,IAAI,IAAI,CAGrB;CACD;AAED,UAAU,qBAAqB;IAC9B,aAAa,EAAE,SAAS,CAAC;IACzB,EAAE,EAAE;QAAE,aAAa,IAAI,IAAI,CAAA;KAAE,CAAC;CAC9B;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,CAM1E"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { markLifecycleTiming } from "../../core/lifecycle-timings.js";
|
|
2
|
+
import { disposeRemoteRenderers } from "../interactive-engine/remote-renderer.js";
|
|
2
3
|
import { Container } from "./interactive-mode-deps.js";
|
|
3
4
|
/**
|
|
4
5
|
* Holds startup chat output off-screen until the resource disclosure slot has
|
|
@@ -14,6 +15,11 @@ export class StartupChatContainer extends Container {
|
|
|
14
15
|
render(width) {
|
|
15
16
|
return this.startupOutputReleased ? super.render(width) : [];
|
|
16
17
|
}
|
|
18
|
+
/** A cleared transcript is rebuilt from new rows; the engine-rendered rows it drops are disposed. */
|
|
19
|
+
clear() {
|
|
20
|
+
disposeRemoteRenderers(this.children);
|
|
21
|
+
super.clear();
|
|
22
|
+
}
|
|
17
23
|
}
|
|
18
24
|
export function releaseStartupChatOutput(host) {
|
|
19
25
|
if (host.chatContainer instanceof StartupChatContainer) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-startup-chat-container.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-startup-chat-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD;;;;GAIG;AACH,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAC1C,qBAAqB,GAAG,KAAK,CAAC;IAEtC,oBAAoB;QACnB,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;QAClC,IAAI,CAAC,UAAU,EAAE,CAAC;IACnB,CAAC;IAEQ,MAAM,CAAC,KAAa;QAC5B,OAAO,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9D,CAAC;CACD;AAOD,MAAM,UAAU,wBAAwB,CAAC,IAA2B;IACnE,IAAI,IAAI,CAAC,aAAa,YAAY,oBAAoB,EAAE,CAAC;QACxD,IAAI,CAAC,aAAa,CAAC,oBAAoB,EAAE,CAAC;QAC1C,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QAC3C,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;AACF,CAAC","sourcesContent":["import { markLifecycleTiming } from \"../../core/lifecycle-timings.ts\";\nimport { Container } from \"./interactive-mode-deps.ts\";\n\n/**\n * Holds startup chat output off-screen until the resource disclosure slot has\n * been filled. Terminal scrollback cannot reorder lines that were painted\n * before an earlier container received content.\n */\nexport class StartupChatContainer extends Container {\n\tprivate startupOutputReleased = false;\n\n\treleaseStartupOutput(): void {\n\t\tthis.startupOutputReleased = true;\n\t\tthis.invalidate();\n\t}\n\n\toverride render(width: number): string[] {\n\t\treturn this.startupOutputReleased ? super.render(width) : [];\n\t}\n}\n\ninterface StartupChatOutputHost {\n\tchatContainer: Container;\n\tui: { requestRender(): void };\n}\n\nexport function releaseStartupChatOutput(host: StartupChatOutputHost): void {\n\tif (host.chatContainer instanceof StartupChatContainer) {\n\t\thost.chatContainer.releaseStartupOutput();\n\t\tmarkLifecycleTiming(\"chat-output-release\");\n\t\thost.ui.requestRender();\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-startup-chat-container.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-startup-chat-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD;;;;GAIG;AACH,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAC1C,qBAAqB,GAAG,KAAK,CAAC;IAEtC,oBAAoB;QACnB,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;QAClC,IAAI,CAAC,UAAU,EAAE,CAAC;IACnB,CAAC;IAEQ,MAAM,CAAC,KAAa;QAC5B,OAAO,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9D,CAAC;IAED,qGAAqG;IAC5F,KAAK;QACb,sBAAsB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACtC,KAAK,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;CACD;AAOD,MAAM,UAAU,wBAAwB,CAAC,IAA2B;IACnE,IAAI,IAAI,CAAC,aAAa,YAAY,oBAAoB,EAAE,CAAC;QACxD,IAAI,CAAC,aAAa,CAAC,oBAAoB,EAAE,CAAC;QAC1C,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QAC3C,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;AACF,CAAC","sourcesContent":["import { markLifecycleTiming } from \"../../core/lifecycle-timings.ts\";\nimport { disposeRemoteRenderers } from \"../interactive-engine/remote-renderer.ts\";\nimport { Container } from \"./interactive-mode-deps.ts\";\n\n/**\n * Holds startup chat output off-screen until the resource disclosure slot has\n * been filled. Terminal scrollback cannot reorder lines that were painted\n * before an earlier container received content.\n */\nexport class StartupChatContainer extends Container {\n\tprivate startupOutputReleased = false;\n\n\treleaseStartupOutput(): void {\n\t\tthis.startupOutputReleased = true;\n\t\tthis.invalidate();\n\t}\n\n\toverride render(width: number): string[] {\n\t\treturn this.startupOutputReleased ? super.render(width) : [];\n\t}\n\n\t/** A cleared transcript is rebuilt from new rows; the engine-rendered rows it drops are disposed. */\n\toverride clear(): void {\n\t\tdisposeRemoteRenderers(this.children);\n\t\tsuper.clear();\n\t}\n}\n\ninterface StartupChatOutputHost {\n\tchatContainer: Container;\n\tui: { requestRender(): void };\n}\n\nexport function releaseStartupChatOutput(host: StartupChatOutputHost): void {\n\tif (host.chatContainer instanceof StartupChatContainer) {\n\t\thost.chatContainer.releaseStartupOutput();\n\t\tmarkLifecycleTiming(\"chat-output-release\");\n\t\thost.ui.requestRender();\n\t}\n}\n"]}
|
|
@@ -2,8 +2,18 @@ import type { Component } from "@earendil-works/pi-tui";
|
|
|
2
2
|
import type { CustomMessage } from "../../core/messages.ts";
|
|
3
3
|
import type { ToolExecutionComponent } from "../interactive/components/tool-execution.ts";
|
|
4
4
|
import type { IsolatedInteractiveRuntime } from "./isolated-runtime.js";
|
|
5
|
-
import type { InteractiveEngineCommand } from "./protocol.ts";
|
|
5
|
+
import type { InteractiveEngineCommand, InteractiveEngineMessage } from "./protocol.ts";
|
|
6
6
|
type RenderableToolResult = Parameters<ToolExecutionComponent["updateResult"]>[0];
|
|
7
|
+
type RemoteRenderCommand = Extract<InteractiveEngineCommand, {
|
|
8
|
+
type: "engine_tool_render" | "engine_message_render";
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* How many rows' last frames are kept, by row identity (a tool call, a custom message), to repaint rebuilt rows. A chat
|
|
12
|
+
* rebuild (compaction, `/reload`, a switched session) recreates every row, and each new row waits for the engine to
|
|
13
|
+
* render it. Showing the row's last frame meanwhile keeps the rebuilt chat painted, instead of a screen of placeholders
|
|
14
|
+
* that lasts as long as the engine is busy.
|
|
15
|
+
*/
|
|
16
|
+
export declare const REMOTE_FRAME_CACHE_LIMIT = 2000;
|
|
7
17
|
declare abstract class RemoteRenderer implements Component {
|
|
8
18
|
protected readonly componentId: string;
|
|
9
19
|
private lines;
|
|
@@ -13,17 +23,26 @@ declare abstract class RemoteRenderer implements Component {
|
|
|
13
23
|
private dirty;
|
|
14
24
|
private disposed;
|
|
15
25
|
private readonly frameClamp;
|
|
16
|
-
private readonly
|
|
26
|
+
private readonly routes;
|
|
17
27
|
protected readonly runtime: IsolatedInteractiveRuntime;
|
|
18
28
|
private readonly requestRender;
|
|
19
29
|
constructor(runtime: IsolatedInteractiveRuntime, requestRender: () => void);
|
|
30
|
+
/** An engine message addressed to this row. */
|
|
31
|
+
receive(message: InteractiveEngineMessage): void;
|
|
20
32
|
render(width: number): string[];
|
|
21
33
|
invalidate(): void;
|
|
22
34
|
dispose(): void;
|
|
23
35
|
protected changed(): void;
|
|
24
|
-
protected abstract command(requestId: number, width: number):
|
|
36
|
+
protected abstract command(requestId: number, width: number): RemoteRenderCommand;
|
|
37
|
+
/** Names what this row shows, the same for every row recreated for it. */
|
|
38
|
+
protected abstract frameIdentity(): string;
|
|
25
39
|
private markDirty;
|
|
26
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Disposes the rows rendered by the engine among `components`, which a cleared chat no longer shows: each one
|
|
43
|
+
* otherwise keeps its renderer alive in the engine for the rest of the session.
|
|
44
|
+
*/
|
|
45
|
+
export declare function disposeRemoteRenderers(components: readonly Component[]): void;
|
|
27
46
|
export declare class RemoteToolExecutionComponent extends RemoteRenderer {
|
|
28
47
|
private readonly toolName;
|
|
29
48
|
private readonly toolCallId;
|
|
@@ -49,16 +68,19 @@ export declare class RemoteToolExecutionComponent extends RemoteRenderer {
|
|
|
49
68
|
setExpanded(expanded: boolean): void;
|
|
50
69
|
setShowImages(show: boolean): void;
|
|
51
70
|
setImageWidthCells(width: number): void;
|
|
52
|
-
protected command(requestId: number, width: number):
|
|
71
|
+
protected command(requestId: number, width: number): RemoteRenderCommand;
|
|
72
|
+
protected frameIdentity(): string;
|
|
53
73
|
}
|
|
54
74
|
export declare class RemoteCustomMessageComponent extends RemoteRenderer {
|
|
55
75
|
private readonly message;
|
|
76
|
+
private contentDigest;
|
|
56
77
|
private expanded;
|
|
57
78
|
private outputPad;
|
|
58
79
|
constructor(message: CustomMessage<unknown>, runtime: IsolatedInteractiveRuntime, requestRender: () => void, outputPad?: number);
|
|
59
80
|
setExpanded(expanded: boolean): void;
|
|
60
81
|
setOutputPad(outputPad: number): void;
|
|
61
|
-
protected command(requestId: number, width: number):
|
|
82
|
+
protected command(requestId: number, width: number): RemoteRenderCommand;
|
|
83
|
+
protected frameIdentity(): string;
|
|
62
84
|
}
|
|
63
85
|
export {};
|
|
64
86
|
//# sourceMappingURL=remote-renderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-renderer.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive-engine/remote-renderer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote-renderer.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive-engine/remote-renderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,KAAK,EAAE,wBAAwB,EAAE,wBAAwB,EAAyB,MAAM,eAAe,CAAC;AAG/G,KAAK,oBAAoB,GAAG,UAAU,CAAC,sBAAsB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,KAAK,mBAAmB,GAAG,OAAO,CAAC,wBAAwB,EAAE;IAAE,IAAI,EAAE,oBAAoB,GAAG,uBAAuB,CAAA;CAAE,CAAC,CAAC;AAMvH;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,OAAQ,CAAC;AAkC9C,uBAAe,cAAe,YAAW,SAAS;IACjD,SAAS,CAAC,QAAQ,CAAC,WAAW,SAA+C;IAC7E,OAAO,CAAC,KAAK,CAAiB;IAC9B,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA+B;IAC1D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8B;IAErD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,0BAA0B,CAAC;IACvD,OAAO,CAAC,QAAQ,CAAC,aAAa,C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emoteFrameWidthClamp } from "./remote-frame-clamp.js";
|
|
2
3
|
let nextRemoteRendererId = 0;
|
|
4
|
+
const LOADING_LINES = ["Loading isolated renderer…"];
|
|
5
|
+
/**
|
|
6
|
+
* How many rows' last frames are kept, by row identity (a tool call, a custom message), to repaint rebuilt rows. A chat
|
|
7
|
+
* rebuild (compaction, `/reload`, a switched session) recreates every row, and each new row waits for the engine to
|
|
8
|
+
* render it. Showing the row's last frame meanwhile keeps the rebuilt chat painted, instead of a screen of placeholders
|
|
9
|
+
* that lasts as long as the engine is busy.
|
|
10
|
+
*/
|
|
11
|
+
export const REMOTE_FRAME_CACHE_LIMIT = 2_000;
|
|
12
|
+
const recentFrames = new Map();
|
|
13
|
+
function rememberFrame(key, lines) {
|
|
14
|
+
recentFrames.delete(key);
|
|
15
|
+
recentFrames.set(key, lines);
|
|
16
|
+
if (recentFrames.size > REMOTE_FRAME_CACHE_LIMIT) {
|
|
17
|
+
const oldest = recentFrames.keys().next().value;
|
|
18
|
+
if (oldest !== undefined)
|
|
19
|
+
recentFrames.delete(oldest);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** One engine-message subscription per runtime, routed by component id, however many rows the chat holds. */
|
|
23
|
+
const routesByRuntime = new WeakMap();
|
|
24
|
+
function rendererRoutes(runtime) {
|
|
25
|
+
let routes = routesByRuntime.get(runtime);
|
|
26
|
+
if (routes === undefined) {
|
|
27
|
+
const created = new Map();
|
|
28
|
+
runtime.onEngineMessage((message) => {
|
|
29
|
+
if ("componentId" in message)
|
|
30
|
+
created.get(message.componentId)?.receive(message);
|
|
31
|
+
});
|
|
32
|
+
routesByRuntime.set(runtime, created);
|
|
33
|
+
routes = created;
|
|
34
|
+
}
|
|
35
|
+
return routes;
|
|
36
|
+
}
|
|
3
37
|
function jsonValue(value) {
|
|
4
38
|
if (value === undefined)
|
|
5
39
|
return null;
|
|
@@ -8,38 +42,43 @@ function jsonValue(value) {
|
|
|
8
42
|
}
|
|
9
43
|
class RemoteRenderer {
|
|
10
44
|
componentId = `remote_renderer_${++nextRemoteRendererId}`;
|
|
11
|
-
lines =
|
|
45
|
+
lines = LOADING_LINES;
|
|
12
46
|
width = 0;
|
|
13
47
|
requestId = 0;
|
|
14
48
|
appliedRequestId = 0;
|
|
15
49
|
dirty = true;
|
|
16
50
|
disposed = false;
|
|
17
51
|
frameClamp = new RemoteFrameWidthClamp();
|
|
18
|
-
|
|
52
|
+
routes;
|
|
19
53
|
runtime;
|
|
20
54
|
requestRender;
|
|
21
55
|
constructor(runtime, requestRender) {
|
|
22
56
|
this.runtime = runtime;
|
|
23
57
|
this.requestRender = requestRender;
|
|
24
|
-
this.
|
|
25
|
-
|
|
58
|
+
this.routes = rendererRoutes(runtime);
|
|
59
|
+
this.routes.set(this.componentId, this);
|
|
60
|
+
}
|
|
61
|
+
/** An engine message addressed to this row. */
|
|
62
|
+
receive(message) {
|
|
63
|
+
if (message.type === "engine_custom_frame") {
|
|
64
|
+
if (message.requestId < this.appliedRequestId)
|
|
26
65
|
return;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
this.changed();
|
|
36
|
-
}
|
|
37
|
-
});
|
|
66
|
+
this.appliedRequestId = message.requestId;
|
|
67
|
+
this.lines = message.lines;
|
|
68
|
+
rememberFrame(this.frameIdentity(), message.lines);
|
|
69
|
+
this.requestRender();
|
|
70
|
+
}
|
|
71
|
+
else if (message.type === "engine_custom_invalidate") {
|
|
72
|
+
this.changed();
|
|
73
|
+
}
|
|
38
74
|
}
|
|
39
75
|
render(width) {
|
|
40
76
|
if (!this.disposed && (this.dirty || width !== this.width)) {
|
|
41
77
|
this.width = width;
|
|
42
78
|
this.dirty = false;
|
|
79
|
+
// A row rebuilt for a row the engine already rendered paints its last frame until the fresh one arrives.
|
|
80
|
+
if (this.lines === LOADING_LINES)
|
|
81
|
+
this.lines = recentFrames.get(this.frameIdentity()) ?? LOADING_LINES;
|
|
43
82
|
this.runtime.sendEngineCommand(this.command(++this.requestId, width));
|
|
44
83
|
}
|
|
45
84
|
// The engine child re-renders asynchronously; until the fresh frame
|
|
@@ -55,7 +94,8 @@ class RemoteRenderer {
|
|
|
55
94
|
if (this.disposed)
|
|
56
95
|
return;
|
|
57
96
|
this.disposed = true;
|
|
58
|
-
this.
|
|
97
|
+
if (this.routes.get(this.componentId) === this)
|
|
98
|
+
this.routes.delete(this.componentId);
|
|
59
99
|
this.runtime.sendEngineCommand({ type: "engine_render_dispose", componentId: this.componentId });
|
|
60
100
|
}
|
|
61
101
|
changed() {
|
|
@@ -66,6 +106,15 @@ class RemoteRenderer {
|
|
|
66
106
|
this.dirty = true;
|
|
67
107
|
}
|
|
68
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Disposes the rows rendered by the engine among `components`, which a cleared chat no longer shows: each one
|
|
111
|
+
* otherwise keeps its renderer alive in the engine for the rest of the session.
|
|
112
|
+
*/
|
|
113
|
+
export function disposeRemoteRenderers(components) {
|
|
114
|
+
for (const component of components)
|
|
115
|
+
if (component instanceof RemoteRenderer)
|
|
116
|
+
component.dispose();
|
|
117
|
+
}
|
|
69
118
|
export class RemoteToolExecutionComponent extends RemoteRenderer {
|
|
70
119
|
toolName;
|
|
71
120
|
toolCallId;
|
|
@@ -139,9 +188,13 @@ export class RemoteToolExecutionComponent extends RemoteRenderer {
|
|
|
139
188
|
outputPad: this.outputPad,
|
|
140
189
|
};
|
|
141
190
|
}
|
|
191
|
+
frameIdentity() {
|
|
192
|
+
return JSON.stringify(["tool", this.toolName, this.toolCallId, this.expanded]);
|
|
193
|
+
}
|
|
142
194
|
}
|
|
143
195
|
export class RemoteCustomMessageComponent extends RemoteRenderer {
|
|
144
196
|
message;
|
|
197
|
+
contentDigest;
|
|
145
198
|
expanded = false;
|
|
146
199
|
outputPad;
|
|
147
200
|
constructor(message, runtime, requestRender, outputPad = 1) {
|
|
@@ -168,5 +221,12 @@ export class RemoteCustomMessageComponent extends RemoteRenderer {
|
|
|
168
221
|
outputPad: this.outputPad,
|
|
169
222
|
};
|
|
170
223
|
}
|
|
224
|
+
frameIdentity() {
|
|
225
|
+
// Not the timestamp: a message shown live and the same message restored from the session can differ in it.
|
|
226
|
+
this.contentDigest ??= createHash("sha1")
|
|
227
|
+
.update(JSON.stringify([this.message.content, this.message.details]) ?? "")
|
|
228
|
+
.digest("base64");
|
|
229
|
+
return JSON.stringify(["message", this.message.customType, this.contentDigest, this.expanded]);
|
|
230
|
+
}
|
|
171
231
|
}
|
|
172
232
|
//# sourceMappingURL=remote-renderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-renderer.js","sourceRoot":"","sources":["../../../src/modes/interactive-engine/remote-renderer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAIhE,IAAI,oBAAoB,GAAG,CAAC,CAAC;AAE7B,SAAS,SAAS,CAAC,KAAc;IAChC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACrC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACtC,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAe,CAAC;AAC1E,CAAC;AAED,MAAe,cAAc;IACT,WAAW,GAAG,mBAAmB,EAAE,oBAAoB,EAAE,CAAC;IACrE,KAAK,GAAG,CAAC,4BAA4B,CAAC,CAAC;IACvC,KAAK,GAAG,CAAC,CAAC;IACV,SAAS,GAAG,CAAC,CAAC;IACd,gBAAgB,GAAG,CAAC,CAAC;IACrB,KAAK,GAAG,IAAI,CAAC;IACb,QAAQ,GAAG,KAAK,CAAC;IACR,UAAU,GAAG,IAAI,qBAAqB,EAAE,CAAC;IACzC,WAAW,CAAa;IAEtB,OAAO,CAA6B;IACtC,aAAa,CAAa;I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AAK;YACL,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAe;YAC9C,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,SAAS,EAAE,IAAI,CAAC,SAAS;SACzB,CAAC;IACH,CAAC;CACD","sourcesContent":["import type { Component } from \"@earendil-works/pi-tui\";\nimport type { CustomMessage } from \"../../core/messages.ts\";\nimport type { ToolExecutionComponent } from \"../interactive/components/tool-execution.ts\";\nimport type { IsolatedInteractiveRuntime } from \"./isolated-runtime.js\";\nimport type { InteractiveEngineCommand, JsonObject, JsonValue } from \"./protocol.ts\";\nimport { RemoteFrameWidthClamp } from \"./remote-frame-clamp.ts\";\n\ntype RenderableToolResult = Parameters<ToolExecutionComponent[\"updateResult\"]>[0];\n\nlet nextRemoteRendererId = 0;\n\nfunction jsonValue(value: unknown): JsonValue {\n\tif (value === undefined) return null;\n\tconst encoded = JSON.stringify(value);\n\treturn encoded === undefined ? null : (JSON.parse(encoded) as JsonValue);\n}\n\nabstract class RemoteRenderer implements Component {\n\tprotected readonly componentId = `remote_renderer_${++nextRemoteRendererId}`;\n\tprivate lines = [\"Loading isolated renderer…\"];\n\tprivate width = 0;\n\tprivate requestId = 0;\n\tprivate appliedRequestId = 0;\n\tprivate dirty = true;\n\tprivate disposed = false;\n\tprivate readonly frameClamp = new RemoteFrameWidthClamp();\n\tprivate readonly unsubscribe: () => void;\n\n\tprotected readonly runtime: IsolatedInteractiveRuntime;\n\tprivate readonly requestRender: () => void;\n\n\tconstructor(runtime: IsolatedInteractiveRuntime, requestRender: () => void) {\n\t\tthis.runtime = runtime;\n\t\tthis.requestRender = requestRender;\n\t\tthis.unsubscribe = runtime.onEngineMessage((message) => {\n\t\t\tif (!(\"componentId\" in message) || message.componentId !== this.componentId) return;\n\t\t\tif (message.type === \"engine_custom_frame\") {\n\t\t\t\tif (message.requestId < this.appliedRequestId) return;\n\t\t\t\tthis.appliedRequestId = message.requestId;\n\t\t\t\tthis.lines = message.lines;\n\t\t\t\tthis.requestRender();\n\t\t\t} else if (message.type === \"engine_custom_invalidate\") {\n\t\t\t\tthis.changed();\n\t\t\t}\n\t\t});\n\t}\n\n\trender(width: number): string[] {\n\t\tif (!this.disposed && (this.dirty || width !== this.width)) {\n\t\t\tthis.width = width;\n\t\t\tthis.dirty = false;\n\t\t\tthis.runtime.sendEngineCommand(this.command(++this.requestId, width));\n\t\t}\n\t\t// The engine child re-renders asynchronously; until the fresh frame\n\t\t// arrives, the previous frame may be wrapped for an older terminal\n\t\t// width. Clamp so a resize never replays overflowing lines (pi-tui\n\t\t// crashes on any rendered line wider than the terminal).\n\t\treturn this.frameClamp.clamp(this.lines, width);\n\t}\n\n\tinvalidate(): void {\n\t\tthis.markDirty();\n\t}\n\n\tdispose(): void {\n\t\tif (this.disposed) return;\n\t\tthis.disposed = true;\n\t\tthis.unsubscribe();\n\t\tthis.runtime.sendEngineCommand({ type: \"engine_render_dispose\", componentId: this.componentId });\n\t}\n\n\tprotected changed(): void {\n\t\tthis.markDirty();\n\t\tthis.requestRender();\n\t}\n\n\tprotected abstract command(requestId: number, width: number): InteractiveEngineCommand;\n\n\tprivate markDirty(): void {\n\t\tthis.dirty = true;\n\t}\n}\n\nexport class RemoteToolExecutionComponent extends RemoteRenderer {\n\tprivate readonly toolName: string;\n\tprivate readonly toolCallId: string;\n\tprivate args: unknown;\n\tprivate result: RenderableToolResult | undefined;\n\tprivate executionStarted = false;\n\tprivate argsComplete = false;\n\tprivate isPartial = true;\n\tprivate expanded = false;\n\tprivate showImages: boolean;\n\tprivate imageWidthCells: number;\n\tprivate outputPad: number;\n\n\tconstructor(\n\t\ttoolName: string,\n\t\ttoolCallId: string,\n\t\targs: unknown,\n\t\toptions: { showImages?: boolean; imageWidthCells?: number; outputPad?: number },\n\t\truntime: IsolatedInteractiveRuntime,\n\t\trequestRender: () => void,\n\t) {\n\t\tsuper(runtime, requestRender);\n\t\tthis.toolName = toolName;\n\t\tthis.toolCallId = toolCallId;\n\t\tthis.args = args;\n\t\tthis.showImages = options.showImages ?? true;\n\t\tthis.imageWidthCells = options.imageWidthCells ?? 60;\n\t\tthis.outputPad = options.outputPad ?? 1;\n\t}\n\n\tsetOutputPad(outputPad: number): void {\n\t\tthis.outputPad = outputPad;\n\t\tthis.changed();\n\t}\n\tupdateArgs(args: unknown): void {\n\t\tthis.args = args;\n\t\tthis.changed();\n\t}\n\tmarkExecutionStarted(): void {\n\t\tthis.executionStarted = true;\n\t\tthis.changed();\n\t}\n\tsetArgsComplete(): void {\n\t\tthis.argsComplete = true;\n\t\tthis.changed();\n\t}\n\tupdateResult(result: RenderableToolResult, isPartial = false): void {\n\t\tthis.result = result;\n\t\tthis.isPartial = isPartial;\n\t\tthis.changed();\n\t}\n\tsetExpanded(expanded: boolean): void {\n\t\tthis.expanded = expanded;\n\t\tthis.changed();\n\t}\n\tsetShowImages(show: boolean): void {\n\t\tthis.showImages = show;\n\t\tthis.changed();\n\t}\n\tsetImageWidthCells(width: number): void {\n\t\tthis.imageWidthCells = Math.max(1, Math.floor(width));\n\t\tthis.changed();\n\t}\n\n\tprotected command(requestId: number, width: number): InteractiveEngineCommand {\n\t\treturn {\n\t\t\ttype: \"engine_tool_render\",\n\t\t\tcomponentId: this.componentId,\n\t\t\trequestId,\n\t\t\twidth,\n\t\t\ttoolName: this.toolName,\n\t\t\ttoolCallId: this.toolCallId,\n\t\t\targs: jsonValue(this.args),\n\t\t\tresult: this.result ? (jsonValue(this.result) as JsonObject) : undefined,\n\t\t\texecutionStarted: this.executionStarted,\n\t\t\targsComplete: this.argsComplete,\n\t\t\tisPartial: this.isPartial,\n\t\t\texpanded: this.expanded,\n\t\t\tshowImages: this.showImages,\n\t\t\timageWidthCells: this.imageWidthCells,\n\t\t\toutputPad: this.outputPad,\n\t\t};\n\t}\n}\n\nexport class RemoteCustomMessageComponent extends RemoteRenderer {\n\tprivate readonly message: CustomMessage<unknown>;\n\tprivate expanded = false;\n\tprivate outputPad: number;\n\tconstructor(\n\t\tmessage: CustomMessage<unknown>,\n\t\truntime: IsolatedInteractiveRuntime,\n\t\trequestRender: () => void,\n\t\toutputPad = 1,\n\t) {\n\t\tsuper(runtime, requestRender);\n\t\tthis.message = message;\n\t\tthis.outputPad = outputPad;\n\t}\n\n\tsetExpanded(expanded: boolean): void {\n\t\tthis.expanded = expanded;\n\t\tthis.changed();\n\t}\n\tsetOutputPad(outputPad: number): void {\n\t\tthis.outputPad = outputPad;\n\t\tthis.changed();\n\t}\n\n\tprotected command(requestId: number, width: number): InteractiveEngineCommand {\n\t\treturn {\n\t\t\ttype: \"engine_message_render\",\n\t\t\tcomponentId: this.componentId,\n\t\t\trequestId,\n\t\t\twidth,\n\t\t\tmessage: jsonValue(this.message) as JsonObject,\n\t\t\texpanded: this.expanded,\n\t\t\toutputPad: this.outputPad,\n\t\t};\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"remote-renderer.js","sourceRoot":"","sources":["../../../src/modes/interactive-engine/remote-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAKhE,IAAI,oBAAoB,GAAG,CAAC,CAAC;AAE7B,MAAM,aAAa,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAErD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC;AAC9C,MAAM,YAAY,GAAG,IAAI,GAAG,EAAoB,CAAC;AAEjD,SAAS,aAAa,CAAC,GAAW,EAAE,KAAe;IAClD,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACzB,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC7B,IAAI,YAAY,CAAC,IAAI,GAAG,wBAAwB,EAAE,CAAC;QAClD,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;QAChD,IAAI,MAAM,K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,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAChG,CAAC;CACD","sourcesContent":["import { createHash } from \"node:crypto\";\nimport type { Component } from \"@earendil-works/pi-tui\";\nimport type { CustomMessage } from \"../../core/messages.ts\";\nimport type { ToolExecutionComponent } from \"../interactive/components/tool-execution.ts\";\nimport type { IsolatedInteractiveRuntime } from \"./isolated-runtime.js\";\nimport type { InteractiveEngineCommand, InteractiveEngineMessage, JsonObject, JsonValue } from \"./protocol.ts\";\nimport { RemoteFrameWidthClamp } from \"./remote-frame-clamp.ts\";\n\ntype RenderableToolResult = Parameters<ToolExecutionComponent[\"updateResult\"]>[0];\ntype RemoteRenderCommand = Extract<InteractiveEngineCommand, { type: \"engine_tool_render\" | \"engine_message_render\" }>;\n\nlet nextRemoteRendererId = 0;\n\nconst LOADING_LINES = [\"Loading isolated renderer…\"];\n\n/**\n * How many rows' last frames are kept, by row identity (a tool call, a custom message), to repaint rebuilt rows. A chat\n * rebuild (compaction, `/reload`, a switched session) recreates every row, and each new row waits for the engine to\n * render it. Showing the row's last frame meanwhile keeps the rebuilt chat painted, instead of a screen of placeholders\n * that lasts as long as the engine is busy.\n */\nexport const REMOTE_FRAME_CACHE_LIMIT = 2_000;\nconst recentFrames = new Map<string, string[]>();\n\nfunction rememberFrame(key: string, lines: string[]): void {\n\trecentFrames.delete(key);\n\trecentFrames.set(key, lines);\n\tif (recentFrames.size > REMOTE_FRAME_CACHE_LIMIT) {\n\t\tconst oldest = recentFrames.keys().next().value;\n\t\tif (oldest !== undefined) recentFrames.delete(oldest);\n\t}\n}\n\n/** One engine-message subscription per runtime, routed by component id, however many rows the chat holds. */\nconst routesByRuntime = new WeakMap<IsolatedInteractiveRuntime, Map<string, RemoteRenderer>>();\n\nfunction rendererRoutes(runtime: IsolatedInteractiveRuntime): Map<string, RemoteRenderer> {\n\tlet routes = routesByRuntime.get(runtime);\n\tif (routes === undefined) {\n\t\tconst created = new Map<string, RemoteRenderer>();\n\t\truntime.onEngineMessage((message) => {\n\t\t\tif (\"componentId\" in message) created.get(message.componentId)?.receive(message);\n\t\t});\n\t\troutesByRuntime.set(runtime, created);\n\t\troutes = created;\n\t}\n\treturn routes;\n}\n\nfunction jsonValue(value: unknown): JsonValue {\n\tif (value === undefined) return null;\n\tconst encoded = JSON.stringify(value);\n\treturn encoded === undefined ? null : (JSON.parse(encoded) as JsonValue);\n}\n\nabstract class RemoteRenderer implements Component {\n\tprotected readonly componentId = `remote_renderer_${++nextRemoteRendererId}`;\n\tprivate lines = LOADING_LINES;\n\tprivate width = 0;\n\tprivate requestId = 0;\n\tprivate appliedRequestId = 0;\n\tprivate dirty = true;\n\tprivate disposed = false;\n\tprivate readonly frameClamp = new RemoteFrameWidthClamp();\n\tprivate readonly routes: Map<string, RemoteRenderer>;\n\n\tprotected readonly runtime: IsolatedInteractiveRuntime;\n\tprivate readonly requestRender: () => void;\n\n\tconstructor(runtime: IsolatedInteractiveRuntime, requestRender: () => void) {\n\t\tthis.runtime = runtime;\n\t\tthis.requestRender = requestRender;\n\t\tthis.routes = rendererRoutes(runtime);\n\t\tthis.routes.set(this.componentId, this);\n\t}\n\n\t/** An engine message addressed to this row. */\n\treceive(message: InteractiveEngineMessage): void {\n\t\tif (message.type === \"engine_custom_frame\") {\n\t\t\tif (message.requestId < this.appliedRequestId) return;\n\t\t\tthis.appliedRequestId = message.requestId;\n\t\t\tthis.lines = message.lines;\n\t\t\trememberFrame(this.frameIdentity(), message.lines);\n\t\t\tthis.requestRender();\n\t\t} else if (message.type === \"engine_custom_invalidate\") {\n\t\t\tthis.changed();\n\t\t}\n\t}\n\n\trender(width: number): string[] {\n\t\tif (!this.disposed && (this.dirty || width !== this.width)) {\n\t\t\tthis.width = width;\n\t\t\tthis.dirty = false;\n\t\t\t// A row rebuilt for a row the engine already rendered paints its last frame until the fresh one arrives.\n\t\t\tif (this.lines === LOADING_LINES) this.lines = recentFrames.get(this.frameIdentity()) ?? LOADING_LINES;\n\t\t\tthis.runtime.sendEngineCommand(this.command(++this.requestId, width));\n\t\t}\n\t\t// The engine child re-renders asynchronously; until the fresh frame\n\t\t// arrives, the previous frame may be wrapped for an older terminal\n\t\t// width. Clamp so a resize never replays overflowing lines (pi-tui\n\t\t// crashes on any rendered line wider than the terminal).\n\t\treturn this.frameClamp.clamp(this.lines, width);\n\t}\n\n\tinvalidate(): void {\n\t\tthis.markDirty();\n\t}\n\n\tdispose(): void {\n\t\tif (this.disposed) return;\n\t\tthis.disposed = true;\n\t\tif (this.routes.get(this.componentId) === this) this.routes.delete(this.componentId);\n\t\tthis.runtime.sendEngineCommand({ type: \"engine_render_dispose\", componentId: this.componentId });\n\t}\n\n\tprotected changed(): void {\n\t\tthis.markDirty();\n\t\tthis.requestRender();\n\t}\n\n\tprotected abstract command(requestId: number, width: number): RemoteRenderCommand;\n\n\t/** Names what this row shows, the same for every row recreated for it. */\n\tprotected abstract frameIdentity(): string;\n\n\tprivate markDirty(): void {\n\t\tthis.dirty = true;\n\t}\n}\n\n/**\n * Disposes the rows rendered by the engine among `components`, which a cleared chat no longer shows: each one\n * otherwise keeps its renderer alive in the engine for the rest of the session.\n */\nexport function disposeRemoteRenderers(components: readonly Component[]): void {\n\tfor (const component of components) if (component instanceof RemoteRenderer) component.dispose();\n}\n\nexport class RemoteToolExecutionComponent extends RemoteRenderer {\n\tprivate readonly toolName: string;\n\tprivate readonly toolCallId: string;\n\tprivate args: unknown;\n\tprivate result: RenderableToolResult | undefined;\n\tprivate executionStarted = false;\n\tprivate argsComplete = false;\n\tprivate isPartial = true;\n\tprivate expanded = false;\n\tprivate showImages: boolean;\n\tprivate imageWidthCells: number;\n\tprivate outputPad: number;\n\n\tconstructor(\n\t\ttoolName: string,\n\t\ttoolCallId: string,\n\t\targs: unknown,\n\t\toptions: { showImages?: boolean; imageWidthCells?: number; outputPad?: number },\n\t\truntime: IsolatedInteractiveRuntime,\n\t\trequestRender: () => void,\n\t) {\n\t\tsuper(runtime, requestRender);\n\t\tthis.toolName = toolName;\n\t\tthis.toolCallId = toolCallId;\n\t\tthis.args = args;\n\t\tthis.showImages = options.showImages ?? true;\n\t\tthis.imageWidthCells = options.imageWidthCells ?? 60;\n\t\tthis.outputPad = options.outputPad ?? 1;\n\t}\n\n\tsetOutputPad(outputPad: number): void {\n\t\tthis.outputPad = outputPad;\n\t\tthis.changed();\n\t}\n\tupdateArgs(args: unknown): void {\n\t\tthis.args = args;\n\t\tthis.changed();\n\t}\n\tmarkExecutionStarted(): void {\n\t\tthis.executionStarted = true;\n\t\tthis.changed();\n\t}\n\tsetArgsComplete(): void {\n\t\tthis.argsComplete = true;\n\t\tthis.changed();\n\t}\n\tupdateResult(result: RenderableToolResult, isPartial = false): void {\n\t\tthis.result = result;\n\t\tthis.isPartial = isPartial;\n\t\tthis.changed();\n\t}\n\tsetExpanded(expanded: boolean): void {\n\t\tthis.expanded = expanded;\n\t\tthis.changed();\n\t}\n\tsetShowImages(show: boolean): void {\n\t\tthis.showImages = show;\n\t\tthis.changed();\n\t}\n\tsetImageWidthCells(width: number): void {\n\t\tthis.imageWidthCells = Math.max(1, Math.floor(width));\n\t\tthis.changed();\n\t}\n\n\tprotected command(requestId: number, width: number): RemoteRenderCommand {\n\t\treturn {\n\t\t\ttype: \"engine_tool_render\",\n\t\t\tcomponentId: this.componentId,\n\t\t\trequestId,\n\t\t\twidth,\n\t\t\ttoolName: this.toolName,\n\t\t\ttoolCallId: this.toolCallId,\n\t\t\targs: jsonValue(this.args),\n\t\t\tresult: this.result ? (jsonValue(this.result) as JsonObject) : undefined,\n\t\t\texecutionStarted: this.executionStarted,\n\t\t\targsComplete: this.argsComplete,\n\t\t\tisPartial: this.isPartial,\n\t\t\texpanded: this.expanded,\n\t\t\tshowImages: this.showImages,\n\t\t\timageWidthCells: this.imageWidthCells,\n\t\t\toutputPad: this.outputPad,\n\t\t};\n\t}\n\n\tprotected frameIdentity(): string {\n\t\treturn JSON.stringify([\"tool\", this.toolName, this.toolCallId, this.expanded]);\n\t}\n}\n\nexport class RemoteCustomMessageComponent extends RemoteRenderer {\n\tprivate readonly message: CustomMessage<unknown>;\n\tprivate contentDigest: string | undefined;\n\tprivate expanded = false;\n\tprivate outputPad: number;\n\tconstructor(\n\t\tmessage: CustomMessage<unknown>,\n\t\truntime: IsolatedInteractiveRuntime,\n\t\trequestRender: () => void,\n\t\toutputPad = 1,\n\t) {\n\t\tsuper(runtime, requestRender);\n\t\tthis.message = message;\n\t\tthis.outputPad = outputPad;\n\t}\n\n\tsetExpanded(expanded: boolean): void {\n\t\tthis.expanded = expanded;\n\t\tthis.changed();\n\t}\n\tsetOutputPad(outputPad: number): void {\n\t\tthis.outputPad = outputPad;\n\t\tthis.changed();\n\t}\n\n\tprotected command(requestId: number, width: number): RemoteRenderCommand {\n\t\treturn {\n\t\t\ttype: \"engine_message_render\",\n\t\t\tcomponentId: this.componentId,\n\t\t\trequestId,\n\t\t\twidth,\n\t\t\tmessage: jsonValue(this.message) as JsonObject,\n\t\t\texpanded: this.expanded,\n\t\t\toutputPad: this.outputPad,\n\t\t};\n\t}\n\n\tprotected frameIdentity(): string {\n\t\t// Not the timestamp: a message shown live and the same message restored from the session can differ in it.\n\t\tthis.contentDigest ??= createHash(\"sha1\")\n\t\t\t.update(JSON.stringify([this.message.content, this.message.details]) ?? \"\")\n\t\t\t.digest(\"base64\");\n\t\treturn JSON.stringify([\"message\", this.message.customType, this.contentDigest, this.expanded]);\n\t}\n}\n"]}
|
|
@@ -176,6 +176,6 @@ Config validation is strict: every field is checked, and if the file is not vali
|
|
|
176
176
|
|
|
177
177
|
Intercom publishes live session status automatically: sessions register as `idle`, switch to `thinking` while the agent is running, show `tool:<name>` during tool execution, and return to `idle` on completion. A configured `status` is appended as context instead of replacing the lifecycle status.
|
|
178
178
|
|
|
179
|
-
Activity is not reply capability. Session rows include `replyCapability: live` or `terminal` when the host supplies it; terminal noninteractive children cannot answer asks even if activity says `idle`. Closed workflow generations show `closed · reply: post-mortem only` when a late-message router is present, or `closed · reply: unavailable` without one. Post-mortem routing still validates the retained conversation and can return a bounded error if it is unavailable; it never resumes workflow execution. Missing capability metadata is not a guarantee that an ask can succeed. A workflow stage released from memory
|
|
179
|
+
Activity is not reply capability. Session rows include `replyCapability: live` or `terminal` when the host supplies it; terminal noninteractive children cannot answer asks even if activity says `idle`. Closed workflow generations show `closed · reply: post-mortem only` when a late-message router is present, or `closed · reply: unavailable` without one. Post-mortem routing still validates the retained conversation and can return a bounded error if it is unavailable; it never resumes workflow execution. Missing capability metadata is not a guarantee that an ask can succeed. A completed workflow stage released from memory keeps a listing with the same status for as long as the session that ran the workflow is open; an ask to it reopens the saved conversation for one turn and returns that turn's final answer, and a plain send reaches the session that ran the workflow. Invocation/subgroup visibility and stale-ID rejection are unchanged.
|
|
180
180
|
|
|
181
181
|
For a retained post-mortem conversation, use its exact Intercom session ID or the previously listed canonical stage path, including its final-stage-name variant. Alternate materialized run-ID paths resolve active stages through the workflow owner; they are not retained aliases after the stage completes. A stage marked `reply: unavailable` rejects an ask with guidance to contact a live stage or start new work with explicit context.
|