@code-yeongyu/senpi 2026.7.11 → 2026.7.14-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 +48 -0
- package/dist/core/agent-session.d.ts +9 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +56 -15
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +86 -26
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/runtime-session.d.ts +1 -1
- package/dist/core/extensions/builtin/terminal/runtime-session.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/runtime-session.js +3 -2
- package/dist/core/extensions/builtin/terminal/runtime-session.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/native.d.ts +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/native.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/native.js +83 -33
- package/dist/core/extensions/builtin/websearch/websearch/native.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/provider-endpoints.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/provider-endpoints.js +2 -1
- package/dist/core/extensions/builtin/websearch/websearch/provider-endpoints.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/tool.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/tool.js +3 -3
- package/dist/core/extensions/builtin/websearch/websearch/tool.js.map +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +1 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/resource-loader.d.ts +1 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +20 -2
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/modes/interactive/compaction-queue-transfer.d.ts +22 -0
- package/dist/modes/interactive/compaction-queue-transfer.d.ts.map +1 -0
- package/dist/modes/interactive/compaction-queue-transfer.js +82 -0
- package/dist/modes/interactive/compaction-queue-transfer.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +4 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +83 -69
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/node_modules/@babel/helper-string-parser/LICENSE +22 -0
- package/node_modules/@babel/helper-string-parser/README.md +19 -0
- package/node_modules/@babel/helper-string-parser/lib/index.js +295 -0
- package/node_modules/@babel/helper-string-parser/lib/index.js.map +1 -0
- package/node_modules/@babel/helper-string-parser/package.json +31 -0
- package/node_modules/@babel/helper-validator-identifier/LICENSE +22 -0
- package/node_modules/@babel/helper-validator-identifier/README.md +19 -0
- package/node_modules/@babel/helper-validator-identifier/lib/identifier.js +70 -0
- package/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +1 -0
- package/node_modules/@babel/helper-validator-identifier/lib/index.js +57 -0
- package/node_modules/@babel/helper-validator-identifier/lib/index.js.map +1 -0
- package/node_modules/@babel/helper-validator-identifier/lib/keyword.js +35 -0
- package/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map +1 -0
- package/node_modules/@babel/helper-validator-identifier/package.json +31 -0
- package/node_modules/@babel/parser/LICENSE +19 -0
- package/node_modules/@babel/parser/README.md +19 -0
- package/node_modules/@babel/parser/bin/babel-parser.js +15 -0
- package/node_modules/@babel/parser/lib/index.js +14599 -0
- package/node_modules/@babel/parser/lib/index.js.map +1 -0
- package/node_modules/@babel/parser/package.json +50 -0
- package/node_modules/@babel/parser/typings/babel-parser.d.ts +262 -0
- package/node_modules/@babel/types/LICENSE +22 -0
- package/node_modules/@babel/types/README.md +19 -0
- package/node_modules/@babel/types/lib/asserts/assertNode.js +16 -0
- package/node_modules/@babel/types/lib/asserts/assertNode.js.map +1 -0
- package/node_modules/@babel/types/lib/asserts/generated/index.js +1251 -0
- package/node_modules/@babel/types/lib/asserts/generated/index.js.map +1 -0
- package/node_modules/@babel/types/lib/ast-types/generated/index.js +3 -0
- package/node_modules/@babel/types/lib/ast-types/generated/index.js.map +1 -0
- package/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js +18 -0
- package/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map +1 -0
- package/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js +31 -0
- package/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js.map +1 -0
- package/node_modules/@babel/types/lib/builders/generated/index.js +29 -0
- package/node_modules/@babel/types/lib/builders/generated/index.js.map +1 -0
- package/node_modules/@babel/types/lib/builders/generated/lowercase.js +2902 -0
- package/node_modules/@babel/types/lib/builders/generated/lowercase.js.map +1 -0
- package/node_modules/@babel/types/lib/builders/generated/uppercase.js +272 -0
- package/node_modules/@babel/types/lib/builders/generated/uppercase.js.map +1 -0
- package/node_modules/@babel/types/lib/builders/productions.js +12 -0
- package/node_modules/@babel/types/lib/builders/productions.js.map +1 -0
- package/node_modules/@babel/types/lib/builders/react/buildChildren.js +24 -0
- package/node_modules/@babel/types/lib/builders/react/buildChildren.js.map +1 -0
- package/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js +22 -0
- package/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js.map +1 -0
- package/node_modules/@babel/types/lib/builders/validateNode.js +21 -0
- package/node_modules/@babel/types/lib/builders/validateNode.js.map +1 -0
- package/node_modules/@babel/types/lib/clone/clone.js +12 -0
- package/node_modules/@babel/types/lib/clone/clone.js.map +1 -0
- package/node_modules/@babel/types/lib/clone/cloneDeep.js +12 -0
- package/node_modules/@babel/types/lib/clone/cloneDeep.js.map +1 -0
- package/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js +12 -0
- package/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js.map +1 -0
- package/node_modules/@babel/types/lib/clone/cloneNode.js +107 -0
- package/node_modules/@babel/types/lib/clone/cloneNode.js.map +1 -0
- package/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js +12 -0
- package/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js.map +1 -0
- package/node_modules/@babel/types/lib/comments/addComment.js +15 -0
- package/node_modules/@babel/types/lib/comments/addComment.js.map +1 -0
- package/node_modules/@babel/types/lib/comments/addComments.js +22 -0
- package/node_modules/@babel/types/lib/comments/addComments.js.map +1 -0
- package/node_modules/@babel/types/lib/comments/inheritInnerComments.js +12 -0
- package/node_modules/@babel/types/lib/comments/inheritInnerComments.js.map +1 -0
- package/node_modules/@babel/types/lib/comments/inheritLeadingComments.js +12 -0
- package/node_modules/@babel/types/lib/comments/inheritLeadingComments.js.map +1 -0
- package/node_modules/@babel/types/lib/comments/inheritTrailingComments.js +12 -0
- package/node_modules/@babel/types/lib/comments/inheritTrailingComments.js.map +1 -0
- package/node_modules/@babel/types/lib/comments/inheritsComments.js +17 -0
- package/node_modules/@babel/types/lib/comments/inheritsComments.js.map +1 -0
- package/node_modules/@babel/types/lib/comments/removeComments.js +15 -0
- package/node_modules/@babel/types/lib/comments/removeComments.js.map +1 -0
- package/node_modules/@babel/types/lib/constants/generated/index.js +60 -0
- package/node_modules/@babel/types/lib/constants/generated/index.js.map +1 -0
- package/node_modules/@babel/types/lib/constants/index.js +31 -0
- package/node_modules/@babel/types/lib/constants/index.js.map +1 -0
- package/node_modules/@babel/types/lib/converters/ensureBlock.js +14 -0
- package/node_modules/@babel/types/lib/converters/ensureBlock.js.map +1 -0
- package/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js +65 -0
- package/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js.map +1 -0
- package/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js +14 -0
- package/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js.map +1 -0
- package/node_modules/@babel/types/lib/converters/toBlock.js +29 -0
- package/node_modules/@babel/types/lib/converters/toBlock.js.map +1 -0
- package/node_modules/@babel/types/lib/converters/toComputedKey.js +14 -0
- package/node_modules/@babel/types/lib/converters/toComputedKey.js.map +1 -0
- package/node_modules/@babel/types/lib/converters/toExpression.js +28 -0
- package/node_modules/@babel/types/lib/converters/toExpression.js.map +1 -0
- package/node_modules/@babel/types/lib/converters/toIdentifier.js +25 -0
- package/node_modules/@babel/types/lib/converters/toIdentifier.js.map +1 -0
- package/node_modules/@babel/types/lib/converters/toKeyAlias.js +38 -0
- package/node_modules/@babel/types/lib/converters/toKeyAlias.js.map +1 -0
- package/node_modules/@babel/types/lib/converters/toSequenceExpression.js +19 -0
- package/node_modules/@babel/types/lib/converters/toSequenceExpression.js.map +1 -0
- package/node_modules/@babel/types/lib/converters/toStatement.js +39 -0
- package/node_modules/@babel/types/lib/converters/toStatement.js.map +1 -0
- package/node_modules/@babel/types/lib/converters/valueToNode.js +89 -0
- package/node_modules/@babel/types/lib/converters/valueToNode.js.map +1 -0
- package/node_modules/@babel/types/lib/definitions/core.js +1725 -0
- package/node_modules/@babel/types/lib/definitions/core.js.map +1 -0
- package/node_modules/@babel/types/lib/definitions/deprecated-aliases.js +11 -0
- package/node_modules/@babel/types/lib/definitions/deprecated-aliases.js.map +1 -0
- package/node_modules/@babel/types/lib/definitions/experimental.js +124 -0
- package/node_modules/@babel/types/lib/definitions/experimental.js.map +1 -0
- package/node_modules/@babel/types/lib/definitions/flow.js +495 -0
- package/node_modules/@babel/types/lib/definitions/flow.js.map +1 -0
- package/node_modules/@babel/types/lib/definitions/index.js +106 -0
- package/node_modules/@babel/types/lib/definitions/index.js.map +1 -0
- package/node_modules/@babel/types/lib/definitions/jsx.js +157 -0
- package/node_modules/@babel/types/lib/definitions/jsx.js.map +1 -0
- package/node_modules/@babel/types/lib/definitions/misc.js +31 -0
- package/node_modules/@babel/types/lib/definitions/misc.js.map +1 -0
- package/node_modules/@babel/types/lib/definitions/placeholders.js +27 -0
- package/node_modules/@babel/types/lib/definitions/placeholders.js.map +1 -0
- package/node_modules/@babel/types/lib/definitions/typescript.js +528 -0
- package/node_modules/@babel/types/lib/definitions/typescript.js.map +1 -0
- package/node_modules/@babel/types/lib/definitions/utils.js +296 -0
- package/node_modules/@babel/types/lib/definitions/utils.js.map +1 -0
- package/node_modules/@babel/types/lib/index-legacy.d.ts +2797 -0
- package/node_modules/@babel/types/lib/index.d.ts +3617 -0
- package/node_modules/@babel/types/lib/index.js +582 -0
- package/node_modules/@babel/types/lib/index.js.flow +2650 -0
- package/node_modules/@babel/types/lib/index.js.map +1 -0
- package/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js +15 -0
- package/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js.map +1 -0
- package/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js +65 -0
- package/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js.map +1 -0
- package/node_modules/@babel/types/lib/modifications/inherits.js +28 -0
- package/node_modules/@babel/types/lib/modifications/inherits.js.map +1 -0
- package/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js +17 -0
- package/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js.map +1 -0
- package/node_modules/@babel/types/lib/modifications/removeProperties.js +24 -0
- package/node_modules/@babel/types/lib/modifications/removeProperties.js.map +1 -0
- package/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js +14 -0
- package/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js.map +1 -0
- package/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js +66 -0
- package/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js.map +1 -0
- package/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js +48 -0
- package/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js.map +1 -0
- package/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js +102 -0
- package/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js.map +1 -0
- package/node_modules/@babel/types/lib/retrievers/getFunctionName.js +63 -0
- package/node_modules/@babel/types/lib/retrievers/getFunctionName.js.map +1 -0
- package/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js +13 -0
- package/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js.map +1 -0
- package/node_modules/@babel/types/lib/traverse/traverse.js +50 -0
- package/node_modules/@babel/types/lib/traverse/traverse.js.map +1 -0
- package/node_modules/@babel/types/lib/traverse/traverseFast.js +40 -0
- package/node_modules/@babel/types/lib/traverse/traverseFast.js.map +1 -0
- package/node_modules/@babel/types/lib/utils/deprecationWarning.js +44 -0
- package/node_modules/@babel/types/lib/utils/deprecationWarning.js.map +1 -0
- package/node_modules/@babel/types/lib/utils/inherit.js +13 -0
- package/node_modules/@babel/types/lib/utils/inherit.js.map +1 -0
- package/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js +40 -0
- package/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js.map +1 -0
- package/node_modules/@babel/types/lib/utils/shallowEqual.js +17 -0
- package/node_modules/@babel/types/lib/utils/shallowEqual.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js +13 -0
- package/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/generated/index.js +2797 -0
- package/node_modules/@babel/types/lib/validators/generated/index.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/is.js +27 -0
- package/node_modules/@babel/types/lib/validators/is.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/isBinding.js +27 -0
- package/node_modules/@babel/types/lib/validators/isBinding.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/isBlockScoped.js +13 -0
- package/node_modules/@babel/types/lib/validators/isBlockScoped.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/isImmutable.js +21 -0
- package/node_modules/@babel/types/lib/validators/isImmutable.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/isLet.js +13 -0
- package/node_modules/@babel/types/lib/validators/isLet.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/isNode.js +12 -0
- package/node_modules/@babel/types/lib/validators/isNode.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/isNodesEquivalent.js +57 -0
- package/node_modules/@babel/types/lib/validators/isNodesEquivalent.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/isPlaceholderType.js +15 -0
- package/node_modules/@babel/types/lib/validators/isPlaceholderType.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/isReferenced.js +96 -0
- package/node_modules/@babel/types/lib/validators/isReferenced.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/isScope.js +18 -0
- package/node_modules/@babel/types/lib/validators/isScope.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/isSpecifierDefault.js +14 -0
- package/node_modules/@babel/types/lib/validators/isSpecifierDefault.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/isType.js +17 -0
- package/node_modules/@babel/types/lib/validators/isType.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/isValidES3Identifier.js +13 -0
- package/node_modules/@babel/types/lib/validators/isValidES3Identifier.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/isValidIdentifier.js +18 -0
- package/node_modules/@babel/types/lib/validators/isValidIdentifier.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/isVar.js +15 -0
- package/node_modules/@babel/types/lib/validators/isVar.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/matchesPattern.js +44 -0
- package/node_modules/@babel/types/lib/validators/matchesPattern.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/react/isCompatTag.js +11 -0
- package/node_modules/@babel/types/lib/validators/react/isCompatTag.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/react/isReactComponent.js +11 -0
- package/node_modules/@babel/types/lib/validators/react/isReactComponent.js.map +1 -0
- package/node_modules/@babel/types/lib/validators/validate.js +42 -0
- package/node_modules/@babel/types/lib/validators/validate.js.map +1 -0
- package/node_modules/@babel/types/package.json +39 -0
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +28 -2
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +128 -78
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -3
- package/node_modules/@code-yeongyu/senpi-codemode/src/bridge/protocol.ts +15 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/bridge/reserved.ts +9 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/bridges/agent-bridge.ts +197 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/bridges/output-bridge.ts +96 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/bridges/schema-injection.ts +3 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/completion/handler.ts +95 -26
- package/node_modules/@code-yeongyu/senpi-codemode/src/completion/tool-bridge.ts +11 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/config/settings.ts +96 -8
- package/node_modules/@code-yeongyu/senpi-codemode/src/extension/session-manager.ts +24 -3
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +155 -21
- package/node_modules/@code-yeongyu/senpi-codemode/src/interpreters/detect.ts +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/jl/prelude.jl +252 -48
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/jl/runner.jl +263 -83
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/context-manager.ts +11 -5
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/local-module-loader.ts +108 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/prelude.ts +8 -6
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/rewrite-imports.ts +164 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/worker-core.js +6 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/worker-runtime.js +307 -41
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/kernel.ts +3 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/prelude.py +792 -79
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/rb/prelude.rb +234 -21
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/rb/runner.rb +154 -51
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/shared/subprocess-queue.ts +1 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/output/output-meta.ts +89 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/output/streaming-output.ts +296 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +101 -31
- package/node_modules/@code-yeongyu/senpi-codemode/src/timeouts/bridge-timeout.ts +2 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/timeouts/idle-timeout.ts +8 -19
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-handler.ts +175 -113
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +130 -120
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/image.ts +274 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/json-tree.ts +247 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/render.ts +641 -38
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/status-events.ts +12 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +29 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +2 -23
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +175 -158
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.d.ts +60 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.js +54 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.d.ts +92 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.js +72 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts +23 -22
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js +63 -63
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.d.ts +0 -136
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js +6 -142
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.js +9 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.js +6 -2
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/coerce-parameters.d.ts +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/coerce-parameters.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/coerce-parameters.js +92 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/coerce-parameters.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/format.d.ts +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/format.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/format.js +54 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/format.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/index.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/index.js +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-match.d.ts +7 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-match.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-match.js +16 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-match.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-tag-scanner.d.ts +19 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-tag-scanner.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-tag-scanner.js +217 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-tag-scanner.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/parse.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/parse.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/parse.js +46 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/parse.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/stream-boundary.d.ts +13 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/stream-boundary.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/stream-boundary.js +144 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/stream-boundary.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/stream.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/stream.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/stream.js +208 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/stream.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/tool-resolver.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/tool-resolver.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/tool-resolver.js +17 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/tool-resolver.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/xml-entities.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/xml-entities.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/xml-entities.js +34 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/xml-entities.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.d.ts +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-pty/native/prebuilds/darwin-arm64/senpi_pty.darwin-arm64.node +0 -0
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export async function transferCompactionQueue(dependencies, options = {}) {
|
|
2
|
+
const batch = dependencies.takeBatch();
|
|
3
|
+
if (batch.length === 0)
|
|
4
|
+
return;
|
|
5
|
+
let acceptedCount = 0;
|
|
6
|
+
try {
|
|
7
|
+
if (options.willRetry) {
|
|
8
|
+
for (const message of batch) {
|
|
9
|
+
if (dependencies.isCommand(message)) {
|
|
10
|
+
await dependencies.deliverCommand(message);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
await dependencies.deliverQueued(message);
|
|
14
|
+
}
|
|
15
|
+
if (!dependencies.commitAccepted(message))
|
|
16
|
+
return;
|
|
17
|
+
acceptedCount += 1;
|
|
18
|
+
}
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
let promptWorkOwned = false;
|
|
22
|
+
for (const message of batch) {
|
|
23
|
+
if (dependencies.isCommand(message)) {
|
|
24
|
+
await dependencies.deliverCommand(message);
|
|
25
|
+
}
|
|
26
|
+
else if (!promptWorkOwned) {
|
|
27
|
+
const disposition = await dependencies.deliverFirstPrompt(message);
|
|
28
|
+
promptWorkOwned = disposition !== "handled";
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
await dependencies.deliverQueued(message);
|
|
32
|
+
}
|
|
33
|
+
if (!dependencies.commitAccepted(message))
|
|
34
|
+
return;
|
|
35
|
+
acceptedCount += 1;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
const failure = error instanceof Error ? error : new Error(String(error));
|
|
40
|
+
const undelivered = batch.slice(acceptedCount);
|
|
41
|
+
const restoredCount = dependencies.restoreUndelivered(undelivered);
|
|
42
|
+
if (restoredCount > 0) {
|
|
43
|
+
dependencies.reportFailure(failure, restoredCount);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export function waitForPromptDisposition(startPrompt, reportPostAcceptanceFailure) {
|
|
48
|
+
return new Promise((resolve, reject) => {
|
|
49
|
+
let accepted = false;
|
|
50
|
+
let rejectedAtPreflight = false;
|
|
51
|
+
let disposition;
|
|
52
|
+
const resolveAcceptedDisposition = () => {
|
|
53
|
+
if (accepted && disposition)
|
|
54
|
+
resolve(disposition);
|
|
55
|
+
};
|
|
56
|
+
const prompt = startPrompt((success) => {
|
|
57
|
+
if (success) {
|
|
58
|
+
accepted = true;
|
|
59
|
+
resolveAcceptedDisposition();
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
rejectedAtPreflight = true;
|
|
63
|
+
}
|
|
64
|
+
}, (nextDisposition) => {
|
|
65
|
+
disposition = nextDisposition;
|
|
66
|
+
resolveAcceptedDisposition();
|
|
67
|
+
});
|
|
68
|
+
void prompt.then(() => {
|
|
69
|
+
if (rejectedAtPreflight && !accepted) {
|
|
70
|
+
reject(new Error("Queued prompt was rejected before acceptance"));
|
|
71
|
+
}
|
|
72
|
+
}, (error) => {
|
|
73
|
+
if (accepted) {
|
|
74
|
+
reportPostAcceptanceFailure(error);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
reject(error);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=compaction-queue-transfer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compaction-queue-transfer.js","sourceRoot":"","sources":["../../../src/modes/interactive/compaction-queue-transfer.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC5C,YAAkC,EAClC,OAAO,GAAoB,EAAE;IAE7B,MAAM,KAAK,GAAG,YAAY,CAAC,SAAS,EAAE,CAAC;IACvC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAE/B,IAAI,aAAa,GAAG,CAAC,CAAC;IACtB,IAAI,CAAC;QACJ,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;YACvB,KAAK,MAAM,OAAO,IAAI,KAAK,EAAE,CAAC;gBAC7B,IAAI,YAAY,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;oBACrC,MAAM,YAAY,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;gBAC5C,CAAC;qBAAM,CAAC;oBACP,MAAM,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;gBAC3C,CAAC;gBACD,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,OAAO,CAAC;oBAAE,OAAO;gBAClD,aAAa,IAAI,CAAC,CAAC;YACpB,CAAC;YACD,OAAO;QACR,CAAC;QAED,IAAI,eAAe,GAAG,KAA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M,0BAA0B,GAAG,GAAS,EAAE;YAC7C,IAAI,QAAQ,IAAI,WAAW;gBAAE,OAAO,CAAC,WAAW,CAAC,CAAC;QACnD,CAAC,CAAC;QACF,MAAM,MAAM,GAAG,WAAW,CACzB,CAAC,OAAO,EAAE,EAAE;YACX,IAAI,OAAO,EAAE,CAAC;gBACb,QAAQ,GAAG,IAAI,CAAC;gBAChB,0BAA0B,EAAE,CAAC;YAC9B,CAAC;iBAAM,CAAC;gBACP,mBAAmB,GAAG,IAAI,CAAC;YAC5B,CAAC;QACF,CAAC,EACD,CAAC,eAAe,EAAE,EAAE;YACnB,WAAW,GAAG,eAAe,CAAC;YAC9B,0BAA0B,EAAE,CAAC;QAC9B,CAAC,CACD,CAAC;QAEF,KAAK,MAAM,CAAC,IAAI,CACf,GAAG,EAAE;YACJ,IAAI,mBAAmB,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACtC,MAAM,CAAC,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC,CAAC;YACnE,CAAC;QACF,CAAC,EACD,CAAC,KAAc,EAAE,EAAE;YAClB,IAAI,QAAQ,EAAE,CAAC;gBACd,2BAA2B,CAAC,KAAK,CAAC,CAAC;YACpC,CAAC;iBAAM,CAAC;gBACP,MAAM,CAAC,KAAK,CAAC,CAAC;YACf,CAAC;QACF,CAAC,CACD,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["export type CompactionQueuedMessage = {\n\treadonly text: string;\n\treadonly mode: \"steer\" | \"followUp\";\n};\n\nexport type PromptDisposition = \"handled\" | \"queued\" | \"started\";\n\ntype TransferOptions = {\n\treadonly willRetry?: boolean;\n};\n\ntype TransferDependencies = {\n\treadonly takeBatch: () => CompactionQueuedMessage[];\n\treadonly commitAccepted: (message: CompactionQueuedMessage) => boolean;\n\treadonly restoreUndelivered: (messages: readonly CompactionQueuedMessage[]) => number;\n\treadonly isCommand: (message: CompactionQueuedMessage) => boolean;\n\treadonly deliverCommand: (message: CompactionQueuedMessage) => Promise<void>;\n\treadonly deliverFirstPrompt: (message: CompactionQueuedMessage) => Promise<PromptDisposition>;\n\treadonly deliverQueued: (message: CompactionQueuedMessage) => Promise<void>;\n\treadonly reportFailure: (error: unknown, undeliveredCount: number) => void;\n};\n\nexport async function transferCompactionQueue(\n\tdependencies: TransferDependencies,\n\toptions: TransferOptions = {},\n): Promise<void> {\n\tconst batch = dependencies.takeBatch();\n\tif (batch.length === 0) return;\n\n\tlet acceptedCount = 0;\n\ttry {\n\t\tif (options.willRetry) {\n\t\t\tfor (const message of batch) {\n\t\t\t\tif (dependencies.isCommand(message)) {\n\t\t\t\t\tawait dependencies.deliverCommand(message);\n\t\t\t\t} else {\n\t\t\t\t\tawait dependencies.deliverQueued(message);\n\t\t\t\t}\n\t\t\t\tif (!dependencies.commitAccepted(message)) return;\n\t\t\t\tacceptedCount += 1;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet promptWorkOwned = false;\n\t\tfor (const message of batch) {\n\t\t\tif (dependencies.isCommand(message)) {\n\t\t\t\tawait dependencies.deliverCommand(message);\n\t\t\t} else if (!promptWorkOwned) {\n\t\t\t\tconst disposition = await dependencies.deliverFirstPrompt(message);\n\t\t\t\tpromptWorkOwned = disposition !== \"handled\";\n\t\t\t} else {\n\t\t\t\tawait dependencies.deliverQueued(message);\n\t\t\t}\n\t\t\tif (!dependencies.commitAccepted(message)) return;\n\t\t\tacceptedCount += 1;\n\t\t}\n\t} catch (error) {\n\t\tconst failure = error instanceof Error ? error : new Error(String(error));\n\t\tconst undelivered = batch.slice(acceptedCount);\n\t\tconst restoredCount = dependencies.restoreUndelivered(undelivered);\n\t\tif (restoredCount > 0) {\n\t\t\tdependencies.reportFailure(failure, restoredCount);\n\t\t}\n\t}\n}\n\nexport function waitForPromptDisposition(\n\tstartPrompt: (\n\t\tpreflightResult: (success: boolean) => void,\n\t\tpromptDisposition: (disposition: PromptDisposition) => void,\n\t) => Promise<void>,\n\treportPostAcceptanceFailure: (error: unknown) => void,\n): Promise<PromptDisposition> {\n\treturn new Promise<PromptDisposition>((resolve, reject) => {\n\t\tlet accepted = false;\n\t\tlet rejectedAtPreflight = false;\n\t\tlet disposition: PromptDisposition | undefined;\n\t\tconst resolveAcceptedDisposition = (): void => {\n\t\t\tif (accepted && disposition) resolve(disposition);\n\t\t};\n\t\tconst prompt = startPrompt(\n\t\t\t(success) => {\n\t\t\t\tif (success) {\n\t\t\t\t\taccepted = true;\n\t\t\t\t\tresolveAcceptedDisposition();\n\t\t\t\t} else {\n\t\t\t\t\trejectedAtPreflight = true;\n\t\t\t\t}\n\t\t\t},\n\t\t\t(nextDisposition) => {\n\t\t\t\tdisposition = nextDisposition;\n\t\t\t\tresolveAcceptedDisposition();\n\t\t\t},\n\t\t);\n\n\t\tvoid prompt.then(\n\t\t\t() => {\n\t\t\t\tif (rejectedAtPreflight && !accepted) {\n\t\t\t\t\treject(new Error(\"Queued prompt was rejected before acceptance\"));\n\t\t\t\t}\n\t\t\t},\n\t\t\t(error: unknown) => {\n\t\t\t\tif (accepted) {\n\t\t\t\t\treportPostAcceptanceFailure(error);\n\t\t\t\t} else {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\t});\n}\n"]}
|
|
@@ -91,6 +91,10 @@ export declare class InteractiveMode {
|
|
|
91
91
|
private autoCompactionProgressText;
|
|
92
92
|
private retryEscapeHandler?;
|
|
93
93
|
private compactionQueuedMessages;
|
|
94
|
+
private compactionInFlightMessages;
|
|
95
|
+
private compactionTransferAbortControllers;
|
|
96
|
+
private compactionQueueFlushTail;
|
|
97
|
+
private compactionQueueGeneration;
|
|
94
98
|
private shutdownRequested;
|
|
95
99
|
private extensionSelector;
|
|
96
100
|
private extensionInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-mode.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EA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B;IAuIxB,OAAO,CAAC,mBAAmB;YAsCb,mBAAmB;IAqCjC,OAAO,CAAC,uBAAuB;IA0B/B,OAAO,CAAC,wBAAwB;IAmBhC,OAAO,CAAC,wBAAwB;YAalB,kBAAkB;YAuBlB,kBAAkB;IAQhC,OAAO,CAAC,yBAAyB;IAuDjC,OAAO,CAAC,yBAAyB;YA6CnB,iBAAiB;YAiDjB,8BAA8B;YAyD9B,qBAAqB;IAmDnC,OAAO,CAAC,oBAAoB;YA4Bd,eAAe;YAsGf,mBAAmB;YAwGnB,mBAAmB;IAgBjC,OAAO,CAAC,sBAAsB;YA6BhB,mBAAmB;YA4CnB,kBAAkB;YA8FlB,iBAAiB;IAe/B,OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,oBAAoB;IA4E5B,OAAO,CAAC,sBAAsB;IAqB9B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,oBAAoB;YAuHd,kBAAkB;IAehC,OAAO,CAAC,kBAAkB;IAiC1B,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,qBAAqB;YAMf,iBAAiB;YAuFjB,oBAAoB;IAkBlC,IAAI,IAAI,IAAI,CA0BX;CACD"}
|
|
@@ -6,7 +6,7 @@ import * as crypto from "node:crypto";
|
|
|
6
6
|
import * as fs from "node:fs";
|
|
7
7
|
import * as os from "node:os";
|
|
8
8
|
import * as path from "node:path";
|
|
9
|
-
import { CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities, hyperlink, Markdown, matchesKey, ProcessTerminal, Spacer, setKeybindings, Text, TruncatedText, TUI, visibleWidth, } from "@earendil-works/pi-tui";
|
|
9
|
+
import { CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities, hyperlink, Markdown, matchesKey, ProcessTerminal, Spacer, sanitizeTerminalLabel, setKeybindings, Text, TruncatedText, TUI, visibleWidth, } from "@earendil-works/pi-tui";
|
|
10
10
|
import chalk from "chalk";
|
|
11
11
|
import { spawn, spawnSync } from "child_process";
|
|
12
12
|
import { APP_NAME, APP_TITLE, CONFIG_DIR_NAME, expandTildePath, getAuthPath, getDebugLogPath, getDocsPath, getShareViewerUrl, VERSION, } from "../../config.js";
|
|
@@ -34,6 +34,7 @@ import { getPiUserAgent } from "../../utils/pi-user-agent.js";
|
|
|
34
34
|
import { killTrackedDetachedChildren } from "../../utils/shell.js";
|
|
35
35
|
import { checkForNewPiVersion, getReleaseChangelogUrl } from "../../utils/version-check.js";
|
|
36
36
|
import { abortedErrorLabel } from "./aborted-error-label.js";
|
|
37
|
+
import { transferCompactionQueue, waitForPromptDisposition, } from "./compaction-queue-transfer.js";
|
|
37
38
|
import { ArminComponent } from "./components/armin.js";
|
|
38
39
|
import { AssistantMessageComponent } from "./components/assistant-message.js";
|
|
39
40
|
import { BashExecutionComponent } from "./components/bash-execution.js";
|
|
@@ -278,6 +279,9 @@ export class InteractiveMode {
|
|
|
278
279
|
this.autoCompactionProgressText = "";
|
|
279
280
|
// Messages queued while compaction is running
|
|
280
281
|
this.compactionQueuedMessages = [];
|
|
282
|
+
this.compactionInFlightMessages = [];
|
|
283
|
+
this.compactionTransferAbortControllers = new Map();
|
|
284
|
+
this.compactionQueueGeneration = 0;
|
|
281
285
|
// Shutdown state
|
|
282
286
|
this.shutdownRequested = false;
|
|
283
287
|
// Extension UI state
|
|
@@ -1364,7 +1368,13 @@ export class InteractiveMode {
|
|
|
1364
1368
|
this.loadedResourcesContainer.clear();
|
|
1365
1369
|
this.chatContainer.clear();
|
|
1366
1370
|
this.pendingMessagesContainer.clear();
|
|
1371
|
+
for (const controller of this.compactionTransferAbortControllers.values())
|
|
1372
|
+
controller.abort();
|
|
1373
|
+
this.compactionQueueGeneration += 1;
|
|
1374
|
+
this.compactionQueueFlushTail = undefined;
|
|
1367
1375
|
this.compactionQueuedMessages = [];
|
|
1376
|
+
this.compactionInFlightMessages = [];
|
|
1377
|
+
this.compactionTransferAbortControllers.clear();
|
|
1368
1378
|
this.streamingComponent = undefined;
|
|
1369
1379
|
this.streamingMessage = undefined;
|
|
1370
1380
|
this.clearPendingTools();
|
|
@@ -2694,6 +2704,9 @@ export class InteractiveMode {
|
|
|
2694
2704
|
case "agent_settled":
|
|
2695
2705
|
await this.checkShutdownRequested();
|
|
2696
2706
|
break;
|
|
2707
|
+
case "continuation_error":
|
|
2708
|
+
this.showError(sanitizeTerminalLabel(event.errorMessage));
|
|
2709
|
+
break;
|
|
2697
2710
|
case "compaction_start": {
|
|
2698
2711
|
if (this.settingsManager.getShowTerminalProgress()) {
|
|
2699
2712
|
this.ui.terminal.setProgress(true);
|
|
@@ -3465,10 +3478,12 @@ export class InteractiveMode {
|
|
|
3465
3478
|
return {
|
|
3466
3479
|
steering: [
|
|
3467
3480
|
...this.session.getSteeringMessages(),
|
|
3481
|
+
...this.compactionInFlightMessages.filter((msg) => msg.mode === "steer").map((msg) => msg.text),
|
|
3468
3482
|
...this.compactionQueuedMessages.filter((msg) => msg.mode === "steer").map((msg) => msg.text),
|
|
3469
3483
|
],
|
|
3470
3484
|
followUp: [
|
|
3471
3485
|
...this.session.getFollowUpMessages(),
|
|
3486
|
+
...this.compactionInFlightMessages.filter((msg) => msg.mode === "followUp").map((msg) => msg.text),
|
|
3472
3487
|
...this.compactionQueuedMessages.filter((msg) => msg.mode === "followUp").map((msg) => msg.text),
|
|
3473
3488
|
],
|
|
3474
3489
|
};
|
|
@@ -3479,12 +3494,13 @@ export class InteractiveMode {
|
|
|
3479
3494
|
*/
|
|
3480
3495
|
clearAllQueues() {
|
|
3481
3496
|
const { steering, followUp } = this.session.clearQueue();
|
|
3482
|
-
const
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
const
|
|
3486
|
-
.
|
|
3487
|
-
|
|
3497
|
+
const compactionMessages = [...this.compactionInFlightMessages, ...this.compactionQueuedMessages];
|
|
3498
|
+
const compactionSteering = compactionMessages.filter((msg) => msg.mode === "steer").map((msg) => msg.text);
|
|
3499
|
+
const compactionFollowUp = compactionMessages.filter((msg) => msg.mode === "followUp").map((msg) => msg.text);
|
|
3500
|
+
for (const controller of this.compactionTransferAbortControllers.values())
|
|
3501
|
+
controller.abort();
|
|
3502
|
+
this.compactionInFlightMessages = [];
|
|
3503
|
+
this.compactionTransferAbortControllers.clear();
|
|
3488
3504
|
this.compactionQueuedMessages = [];
|
|
3489
3505
|
return {
|
|
3490
3506
|
steering: [...steering, ...compactionSteering],
|
|
@@ -3568,72 +3584,70 @@ export class InteractiveMode {
|
|
|
3568
3584
|
return !!extensionRunner.getCommand(commandName);
|
|
3569
3585
|
}
|
|
3570
3586
|
async flushCompactionQueue(options) {
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
const
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3587
|
+
const session = this.session;
|
|
3588
|
+
const generation = this.compactionQueueGeneration ?? 0;
|
|
3589
|
+
const previousFlush = this.compactionQueueFlushTail;
|
|
3590
|
+
const runTransfer = async () => {
|
|
3591
|
+
if ((this.compactionQueueGeneration ?? 0) !== generation || this.session !== session)
|
|
3592
|
+
return;
|
|
3593
|
+
await transferCompactionQueue({
|
|
3594
|
+
takeBatch: () => {
|
|
3595
|
+
const batch = this.compactionQueuedMessages;
|
|
3596
|
+
this.compactionQueuedMessages = [];
|
|
3597
|
+
this.compactionInFlightMessages.push(...batch);
|
|
3598
|
+
for (const message of batch) {
|
|
3599
|
+
this.compactionTransferAbortControllers.set(message, new AbortController());
|
|
3600
|
+
}
|
|
3601
|
+
this.updatePendingMessagesDisplay();
|
|
3602
|
+
return batch;
|
|
3603
|
+
},
|
|
3604
|
+
commitAccepted: (message) => {
|
|
3605
|
+
const index = this.compactionInFlightMessages.indexOf(message);
|
|
3606
|
+
if (index === -1)
|
|
3607
|
+
return false;
|
|
3608
|
+
this.compactionInFlightMessages.splice(index, 1);
|
|
3609
|
+
this.compactionTransferAbortControllers.delete(message);
|
|
3610
|
+
this.updatePendingMessagesDisplay();
|
|
3611
|
+
return true;
|
|
3612
|
+
},
|
|
3613
|
+
restoreUndelivered: (messages) => {
|
|
3614
|
+
const restorable = messages.filter((message) => this.compactionInFlightMessages.includes(message));
|
|
3615
|
+
const restorableSet = new Set(restorable);
|
|
3616
|
+
this.compactionInFlightMessages = this.compactionInFlightMessages.filter((message) => !restorableSet.has(message));
|
|
3617
|
+
for (const message of restorable)
|
|
3618
|
+
this.compactionTransferAbortControllers.delete(message);
|
|
3619
|
+
this.compactionQueuedMessages = [...restorable, ...this.compactionQueuedMessages];
|
|
3620
|
+
this.updatePendingMessagesDisplay();
|
|
3621
|
+
return restorable.length;
|
|
3622
|
+
},
|
|
3623
|
+
isCommand: (message) => this.isExtensionCommand(message.text),
|
|
3624
|
+
deliverCommand: (message) => session.prompt(message.text),
|
|
3625
|
+
deliverFirstPrompt: (message) => waitForPromptDisposition((preflightResult, promptDisposition) => session.prompt(message.text, {
|
|
3626
|
+
streamingBehavior: message.mode,
|
|
3627
|
+
preflightResult,
|
|
3628
|
+
promptDisposition,
|
|
3629
|
+
signal: this.compactionTransferAbortControllers.get(message)?.signal,
|
|
3630
|
+
}), (error) => {
|
|
3631
|
+
if ((this.compactionQueueGeneration ?? 0) !== generation || this.session !== session)
|
|
3632
|
+
return;
|
|
3633
|
+
this.showError(`Queued prompt failed after acceptance: ${error instanceof Error ? error.message : String(error)}`);
|
|
3634
|
+
}),
|
|
3635
|
+
deliverQueued: (message) => message.mode === "followUp" ? session.followUp(message.text) : session.steer(message.text),
|
|
3636
|
+
reportFailure: (error, undeliveredCount) => {
|
|
3637
|
+
this.showError(`Failed to send queued message${undeliveredCount === 1 ? "" : "s"}: ${error instanceof Error ? error.message : String(error)}`);
|
|
3638
|
+
},
|
|
3639
|
+
}, options);
|
|
3580
3640
|
this.updatePendingMessagesDisplay();
|
|
3581
|
-
this.showError(`Failed to send queued message${queuedMessages.length > 1 ? "s" : ""}: ${error instanceof Error ? error.message : String(error)}`);
|
|
3582
3641
|
};
|
|
3642
|
+
const currentFlush = previousFlush ? previousFlush.then(runTransfer, runTransfer) : runTransfer();
|
|
3643
|
+
const settledFlush = currentFlush.catch(() => undefined);
|
|
3644
|
+
this.compactionQueueFlushTail = settledFlush;
|
|
3583
3645
|
try {
|
|
3584
|
-
|
|
3585
|
-
// When retry is pending, queue messages for the retry turn
|
|
3586
|
-
for (const message of queuedMessages) {
|
|
3587
|
-
if (this.isExtensionCommand(message.text)) {
|
|
3588
|
-
await this.session.prompt(message.text);
|
|
3589
|
-
}
|
|
3590
|
-
else if (message.mode === "followUp") {
|
|
3591
|
-
await this.session.followUp(message.text);
|
|
3592
|
-
}
|
|
3593
|
-
else {
|
|
3594
|
-
await this.session.steer(message.text);
|
|
3595
|
-
}
|
|
3596
|
-
}
|
|
3597
|
-
this.updatePendingMessagesDisplay();
|
|
3598
|
-
return;
|
|
3599
|
-
}
|
|
3600
|
-
// Find first non-extension-command message to use as prompt
|
|
3601
|
-
const firstPromptIndex = queuedMessages.findIndex((message) => !this.isExtensionCommand(message.text));
|
|
3602
|
-
if (firstPromptIndex === -1) {
|
|
3603
|
-
// All extension commands - execute them all
|
|
3604
|
-
for (const message of queuedMessages) {
|
|
3605
|
-
await this.session.prompt(message.text);
|
|
3606
|
-
}
|
|
3607
|
-
return;
|
|
3608
|
-
}
|
|
3609
|
-
// Execute any extension commands before the first prompt
|
|
3610
|
-
const preCommands = queuedMessages.slice(0, firstPromptIndex);
|
|
3611
|
-
const firstPrompt = queuedMessages[firstPromptIndex];
|
|
3612
|
-
const rest = queuedMessages.slice(firstPromptIndex + 1);
|
|
3613
|
-
for (const message of preCommands) {
|
|
3614
|
-
await this.session.prompt(message.text);
|
|
3615
|
-
}
|
|
3616
|
-
// Send first prompt (starts streaming)
|
|
3617
|
-
const promptPromise = this.session.prompt(firstPrompt.text).catch((error) => {
|
|
3618
|
-
restoreQueue(error);
|
|
3619
|
-
});
|
|
3620
|
-
// Queue remaining messages
|
|
3621
|
-
for (const message of rest) {
|
|
3622
|
-
if (this.isExtensionCommand(message.text)) {
|
|
3623
|
-
await this.session.prompt(message.text);
|
|
3624
|
-
}
|
|
3625
|
-
else if (message.mode === "followUp") {
|
|
3626
|
-
await this.session.followUp(message.text);
|
|
3627
|
-
}
|
|
3628
|
-
else {
|
|
3629
|
-
await this.session.steer(message.text);
|
|
3630
|
-
}
|
|
3631
|
-
}
|
|
3632
|
-
this.updatePendingMessagesDisplay();
|
|
3633
|
-
void promptPromise;
|
|
3646
|
+
await currentFlush;
|
|
3634
3647
|
}
|
|
3635
|
-
|
|
3636
|
-
|
|
3648
|
+
finally {
|
|
3649
|
+
if (this.compactionQueueFlushTail === settledFlush)
|
|
3650
|
+
this.compactionQueueFlushTail = undefined;
|
|
3637
3651
|
}
|
|
3638
3652
|
}
|
|
3639
3653
|
/** Move pending bash components from pending area to chat */
|