@caupulican/pi-adaptative 0.80.28 → 0.80.30
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 +25 -0
- package/dist/core/context-gc.d.ts.map +1 -1
- package/dist/core/context-gc.js +92 -59
- package/dist/core/context-gc.js.map +1 -1
- package/dist/core/improvement-loop.d.ts +296 -0
- package/dist/core/improvement-loop.d.ts.map +1 -0
- package/dist/core/improvement-loop.js +906 -0
- package/dist/core/improvement-loop.js.map +1 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +5 -0
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +5 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +59 -21
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts +33 -12
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +250 -104
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.js +49 -9
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
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EACd,yBAAyB,EACzB,sBAAsB,EACtB,cAAc,EACd,6BAA6B,EAC7B,iCAAiC,EACjC,YAAY,EACZ,sBAAsB,EACtB,aAAa,EACb,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,eAAe,EACf,OAAO,EACP,OAAO,EACP,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EAEtB,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,wBAAwB,EAGxB,yBAAyB,EACzB,2BAA2B,EAC3B,+BAA+B,EAC/B,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,EAInB,sBAAsB,EAEtB,kBAAkB,EAIlB,qBAAqB,EACrB,UAAU,EACV,SAAS,EACT,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,GAE5B,MAAM,yCAAyC,CAAC;AACjD,kDAAkD;AAClD,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,KAAK,GAEL,MAAM,oCAAoC,CAAC;AAC5C,sBAAsB;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAqB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F,kBAAkB;AAClB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// Core session management\n\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n\n// Config paths\nexport { getAgentDir, VERSION } from \"./config.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n} from \"./core/agent-session.ts\";\n// Auth and model registry\nexport {\n\ttype ApiKeyCredential,\n\ttype AuthCredential,\n\ttype AuthStatus,\n\tAuthStorage,\n\ttype AuthStorageBackend,\n\tFileAuthStorageBackend,\n\tInMemoryAuthStorageBackend,\n\ttype OAuthCredential,\n} from \"./core/auth-storage.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactionResult,\n\ttype CutPointResult,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileOperations,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgenerateSummary,\n\tgetLastAssistantUsage,\n\tprepareBranchEntries,\n\tserializeConversation,\n\tshouldCompact,\n} from \"./core/compaction/index.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\n// Extension system\nexport type {\n\tAgentEndEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\tBashToolCallEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBuildSystemPromptOptions,\n\tCompactOptions,\n\tContextEvent,\n\tContextUsage,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tExecOptions,\n\tExecResult,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tFindToolCallEvent,\n\tGrepToolCallEvent,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tProviderConfig,\n\tProviderModelConfig,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeForkEvent,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeTreeEvent,\n\tSessionCompactEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolExecutionMode,\n\tToolInfo,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tTurnEndEvent,\n\tTurnStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.ts\";\nexport {\n\tcreateExtensionRuntime,\n\tdefineTool,\n\tdiscoverAndLoadExtensions,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.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 { convertToLlm } from \"./core/messages.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport type {\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport {\n\tACTIVE_TURN_TTL_MS,\n\tAUTO_RELOAD_COORDINATOR_TTL_MS,\n\tdescribeReloadSession,\n\tgetPendingReloadBlockers,\n\tisReloadSessionProcessAlive,\n\ttype PendingReloadBlockers,\n\ttype ReloadBlockerOptions,\n\ttype ReloadSessionRecord,\n} from \"./core/reload-blockers.ts\";\nexport type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\nexport {\n\tmergeResourceProfileMap,\n\tmergeResourceProfileSettings,\n\tparseResourceProfileBlocks,\n\tparseResourceProfileInput,\n\tparseResourceProfileJson,\n\tstripResourceProfileBlocks,\n} from \"./core/resource-profile-blocks.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\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\tcreateGrepTool,\n\tcreateLsTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype PromptTemplate,\n} from \"./core/sdk.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildSessionContext,\n\ttype CompactionEntry,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetLatestCompactionEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype ThinkingLevelChangeEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\ttype CompactionSettings,\n\ttype DirectoryResourceProfileInfo,\n\tgetDirectoryResourceProfileInfo,\n\ttype ImageSettings,\n\tmatchesResourceProfilePattern,\n\ttype PackageSource,\n\ttype ResourceProfileFilterSettings,\n\ttype ResourceProfileKind,\n\ttype ResourceProfileSettings,\n\ttype RetrySettings,\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\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateGrepToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLsToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatSize,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\nexport { hasProjectTrustInputs, type ProjectTrustDecision, ProjectTrustStore } from \"./core/trust-manager.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEventListener,\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\tCompactionSummaryMessageComponent,\n\tCustomEditor,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\trenderTitleBadge,\n\trenderToolTitle,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tTitleBadgeComponent,\n\ttype TitleBadgeOptions,\n\ttype TitleBadgeSegment,\n\ttype TitleBadgeStatus,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tToolTitleComponent,\n\ttype ToolTitleOptions,\n\ttype ToolTitleSegment,\n\ttype ToolTitleStatus,\n\tTreeSelectorComponent,\n\ttitleBadge,\n\ttoolTitle,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.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.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\n// Shell utilities\nexport { getShellConfig } from \"./utils/shell.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAa,SAAS,EAAE,MAAM,eAAe,CAAC;AAErD,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACN,YAAY,EAOZ,eAAe,GAEf,MAAM,yBAAyB,CAAC;AACjC,0BAA0B;AAC1B,OAAO,EAIN,WAAW,EAEX,sBAAsB,EACtB,0BAA0B,GAE1B,MAAM,wBAAwB,CAAC;AAChC,aAAa;AACb,OAAO,EAMN,sBAAsB,EACtB,8BAA8B,EAC9B,OAAO,EACP,2BAA2B,EAC3B,cAAc,EAEd,YAAY,EACZ,kBAAkB,EAElB,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,GACb,MAAM,4BAA4B,CAAC;AACpC,OAAO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B,EAEtB,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,wBAAwB,EAGxB,yBAAyB,EACzB,2BAA2B,EAC3B,+BAA+B,EAC/B,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,EAInB,sBAAsB,EAEtB,kBAAkB,EAIlB,qBAAqB,EACrB,UAAU,EACV,SAAS,EACT,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,GAE5B,MAAM,yCAAyC,CAAC;AACjD,kDAAkD;AAClD,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,KAAK,GAEL,MAAM,oCAAoC,CAAC;AAC5C,sBAAsB;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAqB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F,kBAAkB;AAClB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// Core session management\n\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n\n// Config paths\nexport { getAgentDir, VERSION } from \"./config.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n} from \"./core/agent-session.ts\";\n// Auth and model registry\nexport {\n\ttype ApiKeyCredential,\n\ttype AuthCredential,\n\ttype AuthStatus,\n\tAuthStorage,\n\ttype AuthStorageBackend,\n\tFileAuthStorageBackend,\n\tInMemoryAuthStorageBackend,\n\ttype OAuthCredential,\n} from \"./core/auth-storage.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactionResult,\n\ttype CutPointResult,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileOperations,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgenerateSummary,\n\tgetLastAssistantUsage,\n\tprepareBranchEntries,\n\tserializeConversation,\n\tshouldCompact,\n} from \"./core/compaction/index.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\n// Extension system\nexport type {\n\tAgentEndEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\tBashToolCallEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBuildSystemPromptOptions,\n\tCompactOptions,\n\tContextEvent,\n\tContextUsage,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tExecOptions,\n\tExecResult,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tFindToolCallEvent,\n\tGrepToolCallEvent,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tProviderConfig,\n\tProviderModelConfig,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeForkEvent,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeTreeEvent,\n\tSessionCompactEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolExecutionMode,\n\tToolInfo,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tTurnEndEvent,\n\tTurnStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.ts\";\nexport {\n\tcreateExtensionRuntime,\n\tdefineTool,\n\tdiscoverAndLoadExtensions,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.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\tappendRunRecord,\n\ttype ConfidenceMode,\n\ttype ConfidenceResult,\n\tcleanupImprovementSandbox,\n\tcompareMetric,\n\tcomputeMadConfidence,\n\tcreateImprovementDecisionTool,\n\tcreateImprovementLoopTool,\n\tcreateImprovementSandbox,\n\tdecideImprovement,\n\texportImprovementSandboxPatch,\n\ttype GitStatusEntry,\n\ttype ImprovementDecision,\n\ttype ImprovementDecisionInput,\n\ttype ImprovementDecisionReason,\n\ttype ImprovementDecisionResult,\n\ttype ImprovementLoopConfig,\n\ttype ImprovementLoopExec,\n\ttype ImprovementLoopInitInput,\n\ttype ImprovementLoopPaths,\n\ttype ImprovementLoopRecordInput,\n\ttype ImprovementLoopState,\n\ttype ImprovementLoopStatusInput,\n\ttype ImprovementLoopToolAction,\n\ttype ImprovementLoopToolDetails,\n\ttype ImprovementMeasurementCommandResult,\n\ttype ImprovementMeasurementResult,\n\ttype ImprovementRunRecord,\n\ttype ImprovementSandboxCleanupInput,\n\ttype ImprovementSandboxCreateInput,\n\ttype ImprovementSandboxExportInput,\n\ttype ImprovementSandboxRecord,\n\timprovementLoopPaths,\n\tinitImprovementLoop,\n\ttype LowConfidenceAction,\n\ttype MetricComparison,\n\ttype MetricDirection,\n\tmedian,\n\tmedianAbsoluteDeviation,\n\tmetricMapFromOutput,\n\ttype OwnedDiscardPlan,\n\ttype OwnedDiscardPlanInput,\n\tparseGitPorcelainStatus,\n\tparseMetricLines,\n\tplanOwnedDiscard,\n\treadImprovementLoopState,\n\treadRunRecords,\n\trecordImprovementRun,\n\trunImprovementMeasurement,\n\tselectPrimaryMetric,\n\tserializeRunRecord,\n} from \"./core/improvement-loop.ts\";\nexport { convertToLlm } from \"./core/messages.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport type {\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport {\n\tACTIVE_TURN_TTL_MS,\n\tAUTO_RELOAD_COORDINATOR_TTL_MS,\n\tdescribeReloadSession,\n\tgetPendingReloadBlockers,\n\tisReloadSessionProcessAlive,\n\ttype PendingReloadBlockers,\n\ttype ReloadBlockerOptions,\n\ttype ReloadSessionRecord,\n} from \"./core/reload-blockers.ts\";\nexport type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\nexport {\n\tmergeResourceProfileMap,\n\tmergeResourceProfileSettings,\n\tparseResourceProfileBlocks,\n\tparseResourceProfileInput,\n\tparseResourceProfileJson,\n\tstripResourceProfileBlocks,\n} from \"./core/resource-profile-blocks.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\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\tcreateGrepTool,\n\tcreateLsTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype PromptTemplate,\n} from \"./core/sdk.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildSessionContext,\n\ttype CompactionEntry,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetLatestCompactionEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype ThinkingLevelChangeEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\ttype CompactionSettings,\n\ttype DirectoryResourceProfileInfo,\n\tgetDirectoryResourceProfileInfo,\n\ttype ImageSettings,\n\tmatchesResourceProfilePattern,\n\ttype PackageSource,\n\ttype ResourceProfileFilterSettings,\n\ttype ResourceProfileKind,\n\ttype ResourceProfileSettings,\n\ttype RetrySettings,\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\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateGrepToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLsToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatSize,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\nexport { hasProjectTrustInputs, type ProjectTrustDecision, ProjectTrustStore } from \"./core/trust-manager.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEventListener,\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\tCompactionSummaryMessageComponent,\n\tCustomEditor,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\trenderTitleBadge,\n\trenderToolTitle,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tTitleBadgeComponent,\n\ttype TitleBadgeOptions,\n\ttype TitleBadgeSegment,\n\ttype TitleBadgeStatus,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tToolTitleComponent,\n\ttype ToolTitleOptions,\n\ttype ToolTitleSegment,\n\ttype ToolTitleStatus,\n\tTreeSelectorComponent,\n\ttitleBadge,\n\ttoolTitle,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.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.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\n// Shell utilities\nexport { getShellConfig } from \"./utils/shell.ts\";\n"]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
export interface VisualTruncateResult {
|
|
6
6
|
/** The visual lines to display */
|
|
7
7
|
visualLines: string[];
|
|
8
|
-
/** Number of
|
|
8
|
+
/** Number of earlier logical lines plus hidden wrapped tail lines. */
|
|
9
9
|
skippedCount: number;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visual-truncate.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/visual-truncate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,oBAAoB;IACpC,kCAAkC;IAClC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,
|
|
1
|
+
{"version":3,"file":"visual-truncate.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/visual-truncate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,oBAAoB;IACpC,kCAAkC;IAClC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,sEAAsE;IACtE,YAAY,EAAE,MAAM,CAAC;CACrB;AAkCD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,EACb,QAAQ,GAAE,MAAU,GAClB,oBAAoB,CAwBtB","sourcesContent":["/**\n * Shared utility for truncating text to visual lines (accounting for line wrapping).\n * Used by both tool-execution.ts and bash-execution.ts for consistent behavior.\n */\n\nimport { Text } from \"@caupulican/pi-tui\";\n\nexport interface VisualTruncateResult {\n\t/** The visual lines to display */\n\tvisualLines: string[];\n\t/** Number of earlier logical lines plus hidden wrapped tail lines. */\n\tskippedCount: number;\n}\n\nfunction countLogicalLines(text: string): number {\n\tif (!text) return 0;\n\tlet lines = 1;\n\tfor (let i = 0; i < text.length; i++) {\n\t\tif (text.charCodeAt(i) === 10) lines++;\n\t}\n\treturn lines;\n}\n\nfunction tailLogicalLines(text: string, maxLines: number): { text: string; skippedCount: number } {\n\tif (maxLines <= 0) return { text: \"\", skippedCount: countLogicalLines(text) };\n\n\tlet totalLines = 1;\n\tlet tailLines = 1;\n\tlet tailStart = 0;\n\tlet foundTailStart = false;\n\n\tfor (let i = text.length - 1; i >= 0; i--) {\n\t\tif (text.charCodeAt(i) !== 10) continue;\n\t\ttotalLines++;\n\t\tif (tailLines < maxLines) {\n\t\t\ttailLines++;\n\t\t} else if (!foundTailStart) {\n\t\t\ttailStart = i + 1;\n\t\t\tfoundTailStart = true;\n\t\t}\n\t}\n\n\tif (!foundTailStart) return { text, skippedCount: 0 };\n\treturn { text: text.slice(tailStart), skippedCount: Math.max(0, totalLines - maxLines) };\n}\n\n/**\n * Truncate text to a maximum number of visual lines (from the end).\n * This accounts for line wrapping based on terminal width.\n *\n * @param text - The text content (may contain newlines)\n * @param maxVisualLines - Maximum number of visual lines to show\n * @param width - Terminal/render width\n * @param paddingX - Horizontal padding for Text component (default 0).\n * Use 0 when result will be placed in a Box (Box adds its own padding).\n * Use 1 when result will be placed in a plain Container.\n * @returns The truncated visual lines and count of skipped lines\n */\nexport function truncateToVisualLines(\n\ttext: string,\n\tmaxVisualLines: number,\n\twidth: number,\n\tpaddingX: number = 0,\n): VisualTruncateResult {\n\tif (!text) {\n\t\treturn { visualLines: [], skippedCount: 0 };\n\t}\n\n\t// Rendering wide/ANSI text is expensive. Tool previews only need the tail,\n\t// and the last N logical lines always contain the last N visual lines because\n\t// every logical line renders to at least one visual line. Pre-slice before\n\t// constructing Text so streaming command previews do not re-wrap thousands of\n\t// old lines on every update tick.\n\tconst tail = tailLogicalLines(text, maxVisualLines);\n\tconst tempText = new Text(tail.text, paddingX, 0);\n\tconst skippedLogicalLines = tail.skippedCount;\n\tconst renderedVisualLines = tempText.render(width);\n\n\tif (renderedVisualLines.length <= maxVisualLines) {\n\t\treturn { visualLines: renderedVisualLines, skippedCount: skippedLogicalLines };\n\t}\n\n\tconst extraSkippedVisualLines = renderedVisualLines.length - maxVisualLines;\n\treturn {\n\t\tvisualLines: renderedVisualLines.slice(-maxVisualLines),\n\t\tskippedCount: skippedLogicalLines + extraSkippedVisualLines,\n\t};\n}\n"]}
|
|
@@ -3,6 +3,39 @@
|
|
|
3
3
|
* Used by both tool-execution.ts and bash-execution.ts for consistent behavior.
|
|
4
4
|
*/
|
|
5
5
|
import { Text } from "@caupulican/pi-tui";
|
|
6
|
+
function countLogicalLines(text) {
|
|
7
|
+
if (!text)
|
|
8
|
+
return 0;
|
|
9
|
+
let lines = 1;
|
|
10
|
+
for (let i = 0; i < text.length; i++) {
|
|
11
|
+
if (text.charCodeAt(i) === 10)
|
|
12
|
+
lines++;
|
|
13
|
+
}
|
|
14
|
+
return lines;
|
|
15
|
+
}
|
|
16
|
+
function tailLogicalLines(text, maxLines) {
|
|
17
|
+
if (maxLines <= 0)
|
|
18
|
+
return { text: "", skippedCount: countLogicalLines(text) };
|
|
19
|
+
let totalLines = 1;
|
|
20
|
+
let tailLines = 1;
|
|
21
|
+
let tailStart = 0;
|
|
22
|
+
let foundTailStart = false;
|
|
23
|
+
for (let i = text.length - 1; i >= 0; i--) {
|
|
24
|
+
if (text.charCodeAt(i) !== 10)
|
|
25
|
+
continue;
|
|
26
|
+
totalLines++;
|
|
27
|
+
if (tailLines < maxLines) {
|
|
28
|
+
tailLines++;
|
|
29
|
+
}
|
|
30
|
+
else if (!foundTailStart) {
|
|
31
|
+
tailStart = i + 1;
|
|
32
|
+
foundTailStart = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (!foundTailStart)
|
|
36
|
+
return { text, skippedCount: 0 };
|
|
37
|
+
return { text: text.slice(tailStart), skippedCount: Math.max(0, totalLines - maxLines) };
|
|
38
|
+
}
|
|
6
39
|
/**
|
|
7
40
|
* Truncate text to a maximum number of visual lines (from the end).
|
|
8
41
|
* This accounts for line wrapping based on terminal width.
|
|
@@ -19,15 +52,22 @@ export function truncateToVisualLines(text, maxVisualLines, width, paddingX = 0)
|
|
|
19
52
|
if (!text) {
|
|
20
53
|
return { visualLines: [], skippedCount: 0 };
|
|
21
54
|
}
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
55
|
+
// Rendering wide/ANSI text is expensive. Tool previews only need the tail,
|
|
56
|
+
// and the last N logical lines always contain the last N visual lines because
|
|
57
|
+
// every logical line renders to at least one visual line. Pre-slice before
|
|
58
|
+
// constructing Text so streaming command previews do not re-wrap thousands of
|
|
59
|
+
// old lines on every update tick.
|
|
60
|
+
const tail = tailLogicalLines(text, maxVisualLines);
|
|
61
|
+
const tempText = new Text(tail.text, paddingX, 0);
|
|
62
|
+
const skippedLogicalLines = tail.skippedCount;
|
|
63
|
+
const renderedVisualLines = tempText.render(width);
|
|
64
|
+
if (renderedVisualLines.length <= maxVisualLines) {
|
|
65
|
+
return { visualLines: renderedVisualLines, skippedCount: skippedLogicalLines };
|
|
27
66
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
67
|
+
const extraSkippedVisualLines = renderedVisualLines.length - maxVisualLines;
|
|
68
|
+
return {
|
|
69
|
+
visualLines: renderedVisualLines.slice(-maxVisualLines),
|
|
70
|
+
skippedCount: skippedLogicalLines + extraSkippedVisualLines,
|
|
71
|
+
};
|
|
32
72
|
}
|
|
33
73
|
//# sourceMappingURL=visual-truncate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visual-truncate.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/visual-truncate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAS1C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,qBAAqB,CACpC,IAAY,EACZ,cAAsB,EACtB,KAAa,EACb,QAAQ,GAAW,CAAC,EACG;IACvB,IAAI,CAAC,IAAI,EAAE,CAAC;QACX,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;IAC7C,CAAC;IAED,
|
|
1
|
+
{"version":3,"file":"visual-truncate.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/visual-truncate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAS1C,SAAS,iBAAiB,CAAC,IAAY,EAAU;IAChD,IAAI,CAAC,IAAI;QAAE,OAAO,CAAC,CAAC;IACpB,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,EAAE;YAAE,KAAK,EAAE,CAAC;IACxC,CAAC;IACD,OAAO,KAAK,CAAC;AAAA,CACb;AAED,SAAS,gBAAgB,CAAC,IAAY,EAAE,QAAgB,EAA0C;IACjG,IAAI,QAAQ,IAAI,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;IAE9E,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,cAAc,GAAG,KAAK,CAAC;IAE3B,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,IAAI,I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,mBAAmB,EAAE,YAAY,EAAE,mBAAmB,EAAE,CAAC;IAChF,CAAC;IAED,MAAM,uBAAuB,GAAG,mBAAmB,CAAC,MAAM,GAAG,cAAc,CAAC;IAC5E,OAAO;QACN,WAAW,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC;QACvD,YAAY,EAAE,mBAAmB,GAAG,uBAAuB;KAC3D,CAAC;AAAA,CACF","sourcesContent":["/**\n * Shared utility for truncating text to visual lines (accounting for line wrapping).\n * Used by both tool-execution.ts and bash-execution.ts for consistent behavior.\n */\n\nimport { Text } from \"@caupulican/pi-tui\";\n\nexport interface VisualTruncateResult {\n\t/** The visual lines to display */\n\tvisualLines: string[];\n\t/** Number of earlier logical lines plus hidden wrapped tail lines. */\n\tskippedCount: number;\n}\n\nfunction countLogicalLines(text: string): number {\n\tif (!text) return 0;\n\tlet lines = 1;\n\tfor (let i = 0; i < text.length; i++) {\n\t\tif (text.charCodeAt(i) === 10) lines++;\n\t}\n\treturn lines;\n}\n\nfunction tailLogicalLines(text: string, maxLines: number): { text: string; skippedCount: number } {\n\tif (maxLines <= 0) return { text: \"\", skippedCount: countLogicalLines(text) };\n\n\tlet totalLines = 1;\n\tlet tailLines = 1;\n\tlet tailStart = 0;\n\tlet foundTailStart = false;\n\n\tfor (let i = text.length - 1; i >= 0; i--) {\n\t\tif (text.charCodeAt(i) !== 10) continue;\n\t\ttotalLines++;\n\t\tif (tailLines < maxLines) {\n\t\t\ttailLines++;\n\t\t} else if (!foundTailStart) {\n\t\t\ttailStart = i + 1;\n\t\t\tfoundTailStart = true;\n\t\t}\n\t}\n\n\tif (!foundTailStart) return { text, skippedCount: 0 };\n\treturn { text: text.slice(tailStart), skippedCount: Math.max(0, totalLines - maxLines) };\n}\n\n/**\n * Truncate text to a maximum number of visual lines (from the end).\n * This accounts for line wrapping based on terminal width.\n *\n * @param text - The text content (may contain newlines)\n * @param maxVisualLines - Maximum number of visual lines to show\n * @param width - Terminal/render width\n * @param paddingX - Horizontal padding for Text component (default 0).\n * Use 0 when result will be placed in a Box (Box adds its own padding).\n * Use 1 when result will be placed in a plain Container.\n * @returns The truncated visual lines and count of skipped lines\n */\nexport function truncateToVisualLines(\n\ttext: string,\n\tmaxVisualLines: number,\n\twidth: number,\n\tpaddingX: number = 0,\n): VisualTruncateResult {\n\tif (!text) {\n\t\treturn { visualLines: [], skippedCount: 0 };\n\t}\n\n\t// Rendering wide/ANSI text is expensive. Tool previews only need the tail,\n\t// and the last N logical lines always contain the last N visual lines because\n\t// every logical line renders to at least one visual line. Pre-slice before\n\t// constructing Text so streaming command previews do not re-wrap thousands of\n\t// old lines on every update tick.\n\tconst tail = tailLogicalLines(text, maxVisualLines);\n\tconst tempText = new Text(tail.text, paddingX, 0);\n\tconst skippedLogicalLines = tail.skippedCount;\n\tconst renderedVisualLines = tempText.render(width);\n\n\tif (renderedVisualLines.length <= maxVisualLines) {\n\t\treturn { visualLines: renderedVisualLines, skippedCount: skippedLogicalLines };\n\t}\n\n\tconst extraSkippedVisualLines = renderedVisualLines.length - maxVisualLines;\n\treturn {\n\t\tvisualLines: renderedVisualLines.slice(-maxVisualLines),\n\t\tskippedCount: skippedLogicalLines + extraSkippedVisualLines,\n\t};\n}\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.27",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "0.80.
|
|
9
|
+
"version": "0.80.27",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-sandbox",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.27",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-sandbox",
|
|
9
|
-
"version": "0.80.
|
|
9
|
+
"version": "0.80.27",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sandbox-runtime": "^0.0.26"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.27",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "0.80.
|
|
9
|
+
"version": "0.80.27",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caupulican/pi-adaptative",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.30",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@caupulican/pi-adaptative",
|
|
9
|
-
"version": "0.80.
|
|
9
|
+
"version": "0.80.30",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@caupulican/pi-agent-core": "^0.80.
|
|
13
|
-
"@caupulican/pi-ai": "^0.80.
|
|
14
|
-
"@caupulican/pi-tui": "^0.80.
|
|
12
|
+
"@caupulican/pi-agent-core": "^0.80.30",
|
|
13
|
+
"@caupulican/pi-ai": "^0.80.30",
|
|
14
|
+
"@caupulican/pi-tui": "^0.80.30",
|
|
15
15
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
16
16
|
"chalk": "5.6.2",
|
|
17
17
|
"cross-spawn": "7.0.6",
|
|
@@ -474,11 +474,11 @@
|
|
|
474
474
|
}
|
|
475
475
|
},
|
|
476
476
|
"node_modules/@caupulican/pi-agent-core": {
|
|
477
|
-
"version": "0.80.
|
|
478
|
-
"resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.80.
|
|
477
|
+
"version": "0.80.30",
|
|
478
|
+
"resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.80.30.tgz",
|
|
479
479
|
"license": "MIT",
|
|
480
480
|
"dependencies": {
|
|
481
|
-
"@caupulican/pi-ai": "^0.80.
|
|
481
|
+
"@caupulican/pi-ai": "^0.80.30",
|
|
482
482
|
"ignore": "7.0.5",
|
|
483
483
|
"typebox": "1.1.38",
|
|
484
484
|
"yaml": "2.9.0"
|
|
@@ -488,8 +488,8 @@
|
|
|
488
488
|
}
|
|
489
489
|
},
|
|
490
490
|
"node_modules/@caupulican/pi-ai": {
|
|
491
|
-
"version": "0.80.
|
|
492
|
-
"resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.80.
|
|
491
|
+
"version": "0.80.30",
|
|
492
|
+
"resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.80.30.tgz",
|
|
493
493
|
"license": "MIT",
|
|
494
494
|
"dependencies": {
|
|
495
495
|
"@anthropic-ai/sdk": "0.91.1",
|
|
@@ -511,8 +511,8 @@
|
|
|
511
511
|
}
|
|
512
512
|
},
|
|
513
513
|
"node_modules/@caupulican/pi-tui": {
|
|
514
|
-
"version": "0.80.
|
|
515
|
-
"resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.80.
|
|
514
|
+
"version": "0.80.30",
|
|
515
|
+
"resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.80.30.tgz",
|
|
516
516
|
"license": "MIT",
|
|
517
517
|
"dependencies": {
|
|
518
518
|
"get-east-asian-width": "1.6.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caupulican/pi-adaptative",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.30",
|
|
4
4
|
"description": "Adaptive fork of Pi coding agent for self-evolving agent harness experiments",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"prepublishOnly": "npm run clean && npm run build && npm run shrinkwrap"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@caupulican/pi-agent-core": "^0.80.
|
|
45
|
-
"@caupulican/pi-ai": "^0.80.
|
|
46
|
-
"@caupulican/pi-tui": "^0.80.
|
|
44
|
+
"@caupulican/pi-agent-core": "^0.80.30",
|
|
45
|
+
"@caupulican/pi-ai": "^0.80.30",
|
|
46
|
+
"@caupulican/pi-tui": "^0.80.30",
|
|
47
47
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
48
48
|
"chalk": "5.6.2",
|
|
49
49
|
"cross-spawn": "7.0.6",
|