eve 0.61.1 → 0.62.0
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 +16 -0
- package/dist/src/_virtual/_rolldown/runtime.js +1 -1
- package/dist/src/cli/banner.d.ts +1 -2
- package/dist/src/cli/commands/init-install.d.ts +8 -5
- package/dist/src/cli/commands/init-install.js +1 -1
- package/dist/src/cli/commands/init-project.d.ts +1 -2
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/dev/boot-progress.js +1 -1
- package/dist/src/cli/dev/command.js +1 -1
- package/dist/src/cli/dev/tui/agent-header.d.ts +1 -10
- package/dist/src/cli/dev/tui/agent-header.js +1 -1
- package/dist/src/cli/dev/tui/blocks.js +1 -1
- package/dist/src/cli/dev/tui/registry-result-message.js +2 -1
- package/dist/src/cli/dev/tui/runner.d.ts +2 -5
- package/dist/src/cli/dev/tui/runner.js +2 -2
- package/dist/src/cli/dev/tui/setup-panel.js +3 -3
- package/dist/src/cli/dev/tui/subagent-pump.d.ts +1 -1
- package/dist/src/cli/dev/tui/subagent-pump.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +0 -3
- package/dist/src/cli/dev/tui/terminal-renderer.js +3 -3
- package/dist/src/cli/dev/tui/tui.d.ts +0 -1
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/run.js +1 -1
- package/dist/src/cli/ui/live-row.d.ts +4 -1
- package/dist/src/cli/ui/live-row.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +4 -2
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +0 -5
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/project-sources.d.ts +1 -1
- package/dist/src/compiler/project-sources.js +1 -1
- package/dist/src/compiler/source-graph.js +1 -1
- package/dist/src/compiler/validate-artifact.js +1 -1
- package/dist/src/discover/discover-agent.js +1 -1
- package/dist/src/discover/manifest.d.ts +0 -3
- package/dist/src/discover/manifest.js +1 -1
- package/dist/src/evals/abort.d.ts +2 -0
- package/dist/src/evals/abort.js +1 -0
- package/dist/src/evals/context.js +1 -1
- package/dist/src/evals/define-eval-config.d.ts +2 -2
- package/dist/src/evals/define-eval-config.js +1 -1
- package/dist/src/evals/define-eval.d.ts +3 -3
- package/dist/src/evals/define-eval.js +1 -1
- package/dist/src/evals/expect/index.js +1 -1
- package/dist/src/evals/expect/levenshtein.d.ts +2 -0
- package/dist/src/evals/expect/levenshtein.js +1 -0
- package/dist/src/evals/index.d.ts +1 -1
- package/dist/src/evals/judge.d.ts +3 -12
- package/dist/src/evals/judge.js +2 -2
- package/dist/src/evals/runner/discover.js +1 -1
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/types.d.ts +52 -38
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/sleep-workflow.js +1 -1
- package/dist/src/instrumentation/dispatch.js +1 -1
- package/dist/src/instrumentation/lifecycle.d.ts +2 -4
- package/dist/src/instrumentation/provider.d.ts +8 -16
- package/dist/src/instrumentation/provider.js +1 -1
- package/dist/src/instrumentation/providers.js +1 -1
- package/dist/src/instrumentation/runtime-context.d.ts +2 -5
- package/dist/src/instrumentation/runtime-context.js +1 -1
- package/dist/src/instrumentation/runtime.d.ts +1 -4
- package/dist/src/instrumentation/runtime.js +1 -1
- package/dist/src/instrumentation/setup-context.d.ts +0 -5
- package/dist/src/internal/application/compiled-artifacts.d.ts +4 -7
- package/dist/src/internal/application/compiled-artifacts.js +2 -4
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-package-boundary.js +1 -1
- package/dist/src/internal/authored-runtime-modules.d.ts +1 -1
- package/dist/src/internal/authored-runtime-modules.js +1 -1
- package/dist/src/internal/instrumentation-layout.d.ts +6 -20
- package/dist/src/internal/instrumentation-layout.js +1 -1
- package/dist/src/internal/materialized-authored-modules.d.ts +2 -5
- package/dist/src/internal/materialized-authored-modules.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/nitro/routes/channel-request-instrumentation.js +1 -1
- package/dist/src/public/instrumentation/index.d.ts +4 -102
- package/dist/src/public/instrumentation/index.js +1 -1
- package/dist/src/public/instrumentation/otel.d.ts +1 -2
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/sandbox/backends/default.d.ts +2 -11
- package/dist/src/sandbox/backends/default.js +1 -1
- package/dist/src/sandbox/backends/probes.d.ts +7 -0
- package/dist/src/sandbox/backends/probes.js +1 -0
- package/dist/src/self-modification/agent.d.ts +5 -12
- package/dist/src/self-modification/agent.js +1 -1
- package/dist/src/self-modification/extension/classify-registry-item.d.ts +1 -1
- package/dist/src/self-modification/extension/extension.d.ts +5 -0
- package/dist/src/self-modification/extension/extension.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/agent.d.ts +19 -0
- package/dist/src/self-modification/extension/subagents/agent/agent.js +1 -0
- package/dist/src/self-modification/extension/subagents/agent/instructions.js +37 -0
- package/dist/src/self-modification/extension/subagents/agent/sandbox.d.ts +26 -0
- package/dist/src/self-modification/extension/subagents/agent/sandbox.js +1 -0
- package/dist/src/self-modification/extension/{tools → subagents/agent/tools}/publish.d.ts +2 -2
- package/dist/src/self-modification/extension/subagents/agent/tools/publish.js +1 -0
- package/dist/src/self-modification/extension/{tools → subagents/agent/tools}/registry_add.d.ts +2 -2
- package/dist/src/self-modification/extension/subagents/agent/tools/registry_add.js +1 -0
- package/dist/src/self-modification/extension/{tools → subagents/agent/tools}/search_registry.js +1 -1
- package/dist/src/self-modification/git-workspace.d.ts +1 -1
- package/dist/src/self-modification/git-workspace.js +1 -1
- package/dist/src/self-modification/migration.d.ts +10 -0
- package/dist/src/self-modification/migration.js +28 -0
- package/dist/src/self-modification/proposal.d.ts +1 -1
- package/dist/src/self-modification/proposal.js +1 -1
- package/dist/src/self-modification/sandbox.d.ts +6 -20
- package/dist/src/self-modification/sandbox.js +1 -1
- package/dist/src/self-modification/setup.js +7 -6
- package/dist/src/setup/flows/registry.js +1 -2
- package/dist/src/setup/integrations/self-modification/setup.d.ts +6 -3
- package/dist/src/setup/integrations/self-modification/setup.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/index.d.ts +1 -0
- package/dist/src/setup/scaffold/index.js +1 -1
- package/dist/src/setup/scaffold/update/dependencies.d.ts +12 -0
- package/dist/src/setup/scaffold/update/dependencies.js +1 -0
- package/dist/src/setup/scaffold/version-tokens.d.ts +1 -0
- package/dist/src/setup/scaffold/version-tokens.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +0 -9
- package/dist/src/shared/trace-policy.d.ts +0 -3
- package/dist/src/shared/trace-policy.js +1 -1
- package/dist/src/tracing/content-span-processor.js +1 -1
- package/dist/src/tracing/install-instrumentation-runtime.d.ts +2 -4
- package/dist/src/tracing/install-instrumentation-runtime.js +1 -1
- package/dist/src/tracing/otel-declaration.d.ts +5 -4
- package/dist/src/tracing/otel-declaration.js +1 -1
- package/dist/src/tracing/span-export-policy.d.ts +1 -3
- package/docs/agent-config.md +1 -1
- package/docs/concepts/security-model.md +4 -1
- package/docs/evals/assertions.mdx +1 -1
- package/docs/evals/cases.mdx +4 -6
- package/docs/evals/judge.mdx +99 -56
- package/docs/evals/overview.mdx +8 -6
- package/docs/evals/reporters.mdx +1 -1
- package/docs/guides/dev-tui.md +1 -1
- package/docs/guides/evaluate.md +4 -0
- package/docs/guides/hooks.md +1 -1
- package/docs/guides/instrumentation/{providers.mdx → instrumentation.mdx} +39 -43
- package/docs/guides/instrumentation/meta.json +1 -1
- package/docs/guides/instrumentation/migration.md +97 -0
- package/docs/guides/instrumentation/otel.mdx +95 -33
- package/docs/install-integrations.mdx +1 -1
- package/docs/reference/agent-files.md +2 -2
- package/docs/reference/cli.md +1 -1
- package/docs/reference/typescript-api.md +4 -2
- package/package.json +1 -2
- package/dist/src/compiler/instrumentation-layout-config.d.ts +0 -3
- package/dist/src/compiler/instrumentation-layout-config.js +0 -1
- package/dist/src/evals/autoevals-client.d.ts +0 -14
- package/dist/src/evals/autoevals-client.js +0 -2
- package/dist/src/instrumentation/config.d.ts +0 -13
- package/dist/src/instrumentation/config.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/ajv.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js +0 -2
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js +0 -4
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-draft-07.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +0 -4
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft7.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js +0 -1
- package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +0 -1
- package/dist/src/node_modules/.pnpm/autoevals@0.0.132_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0_/node_modules/autoevals/jsdist/index.js +0 -384
- package/dist/src/node_modules/.pnpm/compute-cosine-similarity@1.1.0/node_modules/compute-cosine-similarity/lib/index.js +0 -1
- package/dist/src/node_modules/.pnpm/compute-dot@1.1.0/node_modules/compute-dot/lib/index.js +0 -1
- package/dist/src/node_modules/.pnpm/compute-l2norm@1.1.0/node_modules/compute-l2norm/lib/index.js +0 -1
- package/dist/src/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +0 -1
- package/dist/src/node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/index.js +0 -1
- package/dist/src/node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/lib/schemes.js +0 -1
- package/dist/src/node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/lib/utils.js +0 -1
- package/dist/src/node_modules/.pnpm/js-levenshtein@1.1.6/node_modules/js-levenshtein/index.js +0 -1
- package/dist/src/node_modules/.pnpm/js-yaml@4.3.2/node_modules/js-yaml/dist/js-yaml.js +0 -34
- package/dist/src/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js +0 -1
- package/dist/src/node_modules/.pnpm/mustache@4.2.0/node_modules/mustache/mustache.js +0 -4
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/_vendor/partial-json-parser/parser.js +0 -2
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/auth/workload-identity-auth.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/azure.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/bedrock.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/client.js +0 -11
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/core/api-promise.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/core/error.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/core/pagination.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/core/resource.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/core/streaming.js +0 -3
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/core/uploads.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/error.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/index.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/decoders/line.js +0 -3
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/detect-platform.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/errors.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/headers.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/parse.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/provider.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/qs/formats.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/qs/stringify.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/qs/utils.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/request-options.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/shims.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/to-file.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/tslib.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/uploads.js +0 -2
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/utils/base64.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/utils/bytes.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/utils/env.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/utils/log.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/utils/path.js +0 -2
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/utils/query.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/utils/sleep.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/utils/uuid.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/utils/values.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/utils.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/AbstractChatCompletionRunner.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/AssistantStream.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/ChatCompletionRunner.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/ChatCompletionStream.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/ChatCompletionStreamingRunner.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/EventStream.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/ResponsesParser.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/RunnableFunction.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/Util.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/chatCompletionUtils.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/parser.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/responses/ResponseAccumulator.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/responses/ResponseStream.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/admin.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/admin-api-keys.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/audit-logs.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/certificates.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/data-retention.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/groups/groups.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/groups/roles.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/groups/users.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/invites.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/organization.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/api-keys.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/certificates.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/data-retention.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/groups/groups.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/groups/roles.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/model-permissions.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/projects.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/rate-limits.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/roles.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/spend-alerts.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/spend-limit.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/users/roles.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/users/users.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/roles.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/spend-alerts.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/spend-limit.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/usage.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/users/roles.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/users/users.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/audio/audio.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/audio/speech.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/audio/transcriptions.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/audio/translations.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/batches.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/assistants.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/beta.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/chatkit/chatkit.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/chatkit/sessions.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/chatkit/threads.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/realtime/realtime.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/realtime/sessions.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/realtime/transcription-sessions.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/responses/input-items.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/responses/input-tokens.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/responses/responses.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/threads/messages.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/threads/runs/runs.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/threads/runs/steps.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/threads/threads.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/chat/chat.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/chat/completions/completions.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/chat/completions/index.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/chat/completions/messages.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/chat/index.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/completions.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/containers/containers.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/containers/files/content.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/containers/files/files.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/conversations/conversations.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/conversations/items.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/embeddings.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/evals/evals.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/evals/runs/output-items.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/evals/runs/runs.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/files.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/fine-tuning/alpha/alpha.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/fine-tuning/alpha/graders.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/fine-tuning/checkpoints/permissions.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/fine-tuning/fine-tuning.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/fine-tuning/jobs/checkpoints.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/fine-tuning/jobs/jobs.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/fine-tuning/methods.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/graders/grader-models.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/graders/graders.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/images.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/index.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/models.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/moderations.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/realtime/calls.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/realtime/client-secrets.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/realtime/realtime.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/responses/input-items.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/responses/input-tokens.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/responses/responses.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/shared.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/skills/content.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/skills/skills.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/skills/versions/content.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/skills/versions/versions.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/uploads/parts.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/uploads/uploads.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/vector-stores/file-batches.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/vector-stores/files.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/vector-stores/vector-stores.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/videos.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/webhooks/index.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/webhooks/webhooks.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/webhooks.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/streaming.js +0 -1
- package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/version.js +0 -1
- package/dist/src/node_modules/.pnpm/validate.io-array@1.0.6/node_modules/validate.io-array/lib/index.js +0 -1
- package/dist/src/node_modules/.pnpm/validate.io-function@1.0.2/node_modules/validate.io-function/lib/index.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Refs.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/index.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseTypes.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +0 -3
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js +0 -1
- package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/index.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/typeAliases.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/index.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js +0 -1
- package/dist/src/self-modification/extension/instructions.js +0 -37
- package/dist/src/self-modification/extension/tools/publish.js +0 -1
- package/dist/src/self-modification/extension/tools/registry_add.js +0 -1
- package/docs/guides/instrumentation/overview.md +0 -199
- /package/dist/src/self-modification/extension/{instructions.d.ts → subagents/agent/instructions.d.ts} +0 -0
- /package/dist/src/self-modification/extension/{tools → subagents/agent/tools}/edit_file.d.ts +0 -0
- /package/dist/src/self-modification/extension/{tools → subagents/agent/tools}/edit_file.js +0 -0
- /package/dist/src/self-modification/extension/{tools → subagents/agent/tools}/search_models.d.ts +0 -0
- /package/dist/src/self-modification/extension/{tools → subagents/agent/tools}/search_models.js +0 -0
- /package/dist/src/self-modification/extension/{tools → subagents/agent/tools}/search_registry.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# eve
|
|
2
2
|
|
|
3
|
+
## 0.62.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9d394fa: Package self-modification as an extension-owned subagent and retire the legacy scaffolded self-modification capability. Registry installation uses local-only setup, while deployed-aware setup remains available separately.
|
|
8
|
+
- 8e01190: Replace `t.judge.autoevals.*` with `t.judge(...)`, supporting criteria, typed questions, and batches through evaluation models with a default of `typesafe-ai/jev`. Configure provider evaluation model instances instead of language model instances; autoevals is removed while deterministic similarity and Braintrust reporting remain available.
|
|
9
|
+
- fcb3ba2: Make path-named files under `agent/instrumentation/` the supported instrumentation API. Existing `agent/instrumentation.ts` configurations must be split into lifecycle instrumentation, OpenTelemetry destinations, and shared `otel()` settings; extensions that contribute subagents must be rebuilt for the new contract epoch.
|
|
10
|
+
- 804e670: Remove deprecated instrumentation compatibility shapes. Providers now reject the removed `capture` option in favor of `tracePolicy`, destination export policies return object decisions, and flat `instrumentation.ts` modules are no longer discovered.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 9f1d1cf: Polish `eve init` with inline terminal output, timed installation progress, and a quiet transition into chat without automatic login entries in history. Failed installs show bounded diagnostics and recovery instructions; debug logging retains package-manager output.
|
|
15
|
+
- 38ad163: Keep registry installation error traces visible in the dev TUI after an `/add` failure, alongside the per-item recovery guidance.
|
|
16
|
+
- d0d2b5e: Refine the `eve dev` terminal header with a compact `☰eve` mark, clearer metadata separation, and a persistent command hint. `eve dev` no longer shows the startup `/add` tip.
|
|
17
|
+
- 06e17ae: Wrap long setup questions in the `eve dev` terminal UI instead of clipping them at the terminal edge.
|
|
18
|
+
|
|
3
19
|
## 0.61.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:module";var
|
|
1
|
+
import"node:module";var __defProp=Object.defineProperty,__exportAll=(e,t)=>{let n={};for(var r in e)__defProp(n,r,{get:e[r],enumerable:!0});return t||__defProp(n,Symbol.toStringTag,{value:`Module`}),n};export{__exportAll};
|
package/dist/src/cli/banner.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export declare const EVE_WORDMARK = "eve";
|
|
2
2
|
/**
|
|
3
3
|
* The boot banner shared by every CLI command that announces itself: the eve
|
|
4
|
-
* badge plus the installed version.
|
|
5
|
-
* pre-action hook so commands never compose their own variant.
|
|
4
|
+
* badge plus the installed version. Init prints it before its progress row.
|
|
6
5
|
*/
|
|
7
6
|
export declare function eveCliBanner(): string;
|
|
8
7
|
/**
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { EveCliSetupFailureCode } from "#cli/telemetry/index.js";
|
|
2
|
-
import type { PackageManagerKind } from "#setup/package-manager.js";
|
|
3
2
|
import { type PackageManagerInstallResult } from "#setup/primitives/index.js";
|
|
4
|
-
|
|
5
|
-
export declare function
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
/** Keeps a bounded error tail, falling back to npm detail only when no other output exists. */
|
|
4
|
+
export declare function createInstallDiagnostics(): {
|
|
5
|
+
append(text: string): void;
|
|
6
|
+
result(): {
|
|
7
|
+
lines: readonly string[];
|
|
8
|
+
truncated: boolean;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
8
11
|
export declare function packageManagerInstallFailureCode(result: PackageManagerInstallResult): EveCliSetupFailureCode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"#setup/primitives/index.js";function
|
|
1
|
+
import{sanitizeForTerminal}from"#cli/ui/output.js";import"#setup/primitives/index.js";const NPM_NOISE_LINE=/^\s*npm (?:silly|verbose|http|timing)\b/u,INSTALL_OUTPUT_MAX_BYTES=16384;function createInstallDiagnostics(){let e=[],t=0,n=!1,r=!1;return{append(i){let a=sanitizeForTerminal(i).trimEnd();if(a.trim()===``)return;let o=NPM_NOISE_LINE.test(a);if(o&&n)return;!o&&!n&&(e.length=0,t=0,r=!1,n=!0);let s=Buffer.from(a);if(s.length>=INSTALL_OUTPUT_MAX_BYTES){let e=s.length-INSTALL_OUTPUT_MAX_BYTES+1;for(;(s[e]&192)==128;)e+=1;a=s.subarray(e).toString(`utf8`),r=!0}for(e.push(a),t+=Buffer.byteLength(a)+1;e.length>20||t>INSTALL_OUTPUT_MAX_BYTES;)t-=Buffer.byteLength(e.shift())+1,r=!0},result(){return{lines:e,truncated:r}}}}function packageManagerInstallFailureCode(e){return e.kind===`workspace-probe-failed`?`workspace_probe_failed`:e.kind===`workspace-probe-unrecognized`?`workspace_probe_unrecognized`:e.result.termination.kind===`spawn-error`?e.result.termination.code===`ENOENT`?`package_manager_not_found`:`package_manager_start_failed`:`dependency_installation`}export{createInstallDiagnostics,packageManagerInstallFailureCode};
|
|
@@ -24,9 +24,8 @@ export type PreparedInitProject = {
|
|
|
24
24
|
workspaceRootMutations: WorkspaceRootMutation[];
|
|
25
25
|
};
|
|
26
26
|
export type InitResult = {
|
|
27
|
-
|
|
27
|
+
elapsedMs: number;
|
|
28
28
|
agentLaunched: boolean;
|
|
29
|
-
installElapsedMs: number;
|
|
30
29
|
packageManager: PackageManagerKind;
|
|
31
30
|
projectPath: string;
|
|
32
31
|
selfModificationEnabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{initAgentDevHandoff,initAgentReadySummary}from"./agent-instructions.js";import{hasInteractiveTerminal}from"./preconditions.js";import{tryInitializeGit}from"./init-git.js";import{InitTargetError}from"./init-telemetry.js";import{addAgentsToWorkspace,convertScaffoldToAgentWorkspace,formatWorkspaceRootMutationWarning}from"./init-agent-workspace.js";import{NPM_NOISE_LINE,installProgressDetail,packageManagerInstallFailureCode}from"./init-install.js";import{reportExistingProjectChanges}from"./init-project.js";import{cleanupFreshInitTarget,workspaceFailureNote}from"./init-recovery.js";import{resolveInitTarget}from"./init-target.js";import{mkdtemp,readdir,rename,rm}from"node:fs/promises";import{createLogger,isLogLevelEnabled}from"#internal/logging.js";import{basename,join,resolve}from"node:path";import pc from"#compiled/picocolors/index.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{ensureChannel,scaffoldBaseProject}from"#setup/scaffold/index.js";import{eveDevArguments,packageManagerInstallFailureMessage,packageManagerInstallSucceeded,resultSucceeded,runPackageManagerInstall,spawnPackageManager}from"#setup/primitives/index.js";import{performance}from"node:perf_hooks";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{EVE_WORDMARK}from"#cli/banner.js";import{formatElapsed}from"#cli/format-elapsed.js";import{startCliLiveRow}from"#cli/ui/live-row.js";import{detectInvokingPackageManager,detectPackageManager}from"#setup/package-manager.js";import{pathExists}from"#setup/path-exists.js";import{DEFAULT_EVE_PACKAGE_CONTRACT}from"#setup/scaffold/create/project.js";import{validateModelSlug}from"#setup/flows/model-source-change.js";import{addAgentToProject}from"#setup/scaffold/create/add-to-project.js";import{WizardCancelledError}from"#setup/step.js";import{isPackageManagerWorkspaceMember}from"#setup/scaffold/workspace-root.js";const defaultDependencies={addAgentToProject,detectInvokingPackageManager,detectPackageManager,ensureChannel,isCodingAgentLaunch,now:()=>performance.now(),runPackageManagerInstall,scaffoldBaseProject,hasInteractiveTerminal,spawnPackageManager,tryInitializeGit,validateModelSlug},EVE_INIT_PACKAGE_SPEC_ENV=`EVE_INIT_PACKAGE_SPEC`,initLog=createLogger(`init`);async function moveDirectoryContents(e,t){for(let n of await readdir(e))await rename(join(e,n),join(t,n))}function uniqueWorkspaceRootMutations(e){let t=new Map;for(let n of e){let e=`${n.kind}:${n.path}`,r=t.get(e);t.set(e,{...n,nodeEngineOverride:n.nodeEngineOverride??r?.nodeEngineOverride})}return[...t.values()]}async function addToExistingProject(e,t,n,r){if(t.channelWebNextjs===!0)throw Error("`--channel-web-nextjs` is not supported when adding an agent to an existing project. Run `eve add channel/web` from the project afterwards instead.");if(t.model!==void 0){let r=await n.validateModelSlug(e,t.model);if(r!==null)throw Error(r)}let i=await n.detectPackageManager(e),a=await n.addAgentToProject({projectRoot:e,model:t.model??DEFAULT_AGENT_MODEL_ID,reasoning:t.reasoning,packageManager:i.kind,evePackage:r});return{configurationFilesChanged:a.configurationFilesChanged,dependenciesAdded:a.dependenciesAdded,filesWritten:a.filesWritten,packageManager:i.kind,nodeEngineOverride:a.nodeEngineOverride}}async function resolveScaffoldPackageManager(e,t){let n=await t.detectPackageManager(e);return n.source==="default"?t.detectInvokingPackageManager()??`pnpm`:n.kind}async function scaffoldProject(e,t,n,r,i,a,o,s){let c=resolve(e,`..`),l=!n&&await pathExists(e)&&(await readdir(e)).length===0;if(!n&&await pathExists(e)&&!l)throw Error(`Cannot create project because "${e}" already exists.`);let u=n&&s?void 0:await mkdtemp(join(c,`.eve-init-`)),d=[];try{let c=u??e;if(i.model!==void 0){let e=await a.validateModelSlug(c,i.model);if(e!==null)throw Error(e)}let f={projectName:u===void 0?`.`:n?basename(e):t,model:i.model??DEFAULT_AGENT_MODEL_ID,reasoning:i.reasoning,evePackage:o,targetDirectory:c,overwriteExisting:s,workspaceProbeDirectory:e,packageManager:r,onWorkspaceRootMutation:e=>{d.push(e)}},p=await a.scaffoldBaseProject(f);return i.agents!==void 0&&await convertScaffoldToAgentWorkspace(p,i.agents,i),i.channelWebNextjs===!0&&await a.ensureChannel({projectRoot:p,kind:`web`,packageManager:r,force:s,workspaceProbeDirectory:e,configureVercelServices:!1,onWorkspaceRootMutation:e=>{d.push(e)}}),u!==void 0&&(n||l?await moveDirectoryContents(p,e):await rename(p,e)),{projectPath:e,workspaceRootMutations:uniqueWorkspaceRootMutations(d)}}finally{u!==void 0&&await rm(u,{recursive:!0,force:!0})}}async function runInitSteps(e){let{agentLaunched:t,dependencies:n,logger:r,options:i,parentDirectory:a,target:o,trackStep:s,trackTerminal:c}=e,l=isLogLevelEnabled(`debug`),u=await resolveInitTarget({parentDirectory:a,target:o}),d=resolveInitEvePackageOverride(),f=startCliLiveRow(r),p=`scaffold`,m;f.update(`Preparing project`);try{let e=u.kind===`fresh`?`creating agent`:`adding agent`;s?.(p),f.update(u.kind===`fresh`?`Creating agent`:`Adding agent`),initLog.debug(e);let a=n.now(),o;if(u.kind===`fresh`){let e=await resolveScaffoldPackageManager(u.projectPath,n),t=isPackageManagerWorkspaceMember(e,u.projectPath),r;try{r=await scaffoldProject(u.projectPath,u.projectName,u.createInPlace,e,i,n,d,u.overwriteExisting)}catch(e){if(u.failurePolicy===`clear`){let n=await cleanupFreshInitTarget(u.projectPath,u.failurePolicy,u.preservedEntries),r=e instanceof Error?e.message:String(e),i=n?`eve restored "${u.projectPath}" to its original state.`:`eve could not completely clean "${u.projectPath}".`;throw Error(`${r}\n\n${i}${workspaceFailureNote(t)}`)}if(u.failurePolicy===`remove`&&t){let t=e instanceof Error?e.message:String(e);throw Error(`${t}${workspaceFailureNote(!0)}`)}throw e}o={failurePolicy:u.failurePolicy,kind:`created`,packageManager:e,preservedTargetEntries:u.preservedEntries,projectPath:r.projectPath,retryCommand:`eve init ${u.projectPath}`,workspaceMember:t,workspaceRootMutations:r.workspaceRootMutations}}else{let e=await addToExistingProject(u.projectPath,i,n,d);o=e.nodeEngineOverride===void 0?{configurationFilesChanged:e.configurationFilesChanged,dependenciesAdded:e.dependenciesAdded,failurePolicy:`preserve`,filesWritten:e.filesWritten,kind:`added`,packageManager:e.packageManager,projectPath:u.projectPath}:{configurationFilesChanged:e.configurationFilesChanged,dependenciesAdded:e.dependenciesAdded,failurePolicy:`preserve`,filesWritten:e.filesWritten,kind:`added`,nodeEngineOverride:e.nodeEngineOverride,packageManager:e.packageManager,projectPath:u.projectPath}}let c=n.now()-a;initLog.debug(`${e} done`,{ms:c}),o.kind===`added`&&(f.stop(),reportExistingProjectChanges(r,o),f=startCliLiveRow(r)),p=`install_dependencies`,s?.(p),f.update(`Installing dependencies`,`${o.packageManager} install`),initLog.debug(`installing dependencies with ${o.packageManager}`);let h=n.now(),g=[],_=[],v=await n.runPackageManagerInstall(o.packageManager,o.projectPath,{autoApprove:!0,bypassMinimumReleaseAge:!0,progressDetails:process.stdout.isTTY===!0&&!l,onOutput:e=>{e.text.trim()!==``&&(_.push(e.text),_.length>20&&_.shift(),NPM_NOISE_LINE.test(e.text)||g.push(e.text)),l&&initLog.debug(e.text);let t=installProgressDetail(o.packageManager,e);t!==void 0&&f.update(`Installing dependencies`,t)}}),y=n.now()-h;if(!packageManagerInstallSucceeded(v)){m=packageManagerInstallFailureCode(v),initLog.debug(`dependency installation failed`,{ms:y}),f.stop();let e=g.length>0?g:_;for(let t of e)r.error(t);if(e.length===0){let e=packageManagerInstallFailureMessage(v);e!==void 0&&r.error(e)}if(o.failurePolicy!==`preserve`){if(await cleanupFreshInitTarget(o.projectPath,o.failurePolicy,o.preservedTargetEntries)){let e=o.failurePolicy===`remove`?`eve removed the incomplete project at "${o.projectPath}".`:`eve restored "${o.projectPath}" to its original state.`,t=o.workspaceMember||o.workspaceRootMutations.length>0;throw Error(`Failed to install dependencies.\n\n${e}\n\nResolve the package-manager error above, then retry:\n ${o.retryCommand}${workspaceFailureNote(t)}`)}let e=o.workspaceMember||o.workspaceRootMutations.length>0;throw Error(`Failed to install dependencies, and eve could not completely clean "${o.projectPath}".\n\nResolve the package-manager error above, then install dependencies with ${o.packageManager} in that directory. Or clean the target manually before rerunning eve init.${workspaceFailureNote(e)}`)}throw Error(`The eve agent was added, but dependency installation failed.\n\nResolve the package-manager error above, then install dependencies with ${o.packageManager} in "${o.projectPath}".\n\nDo not rerun eve init; the agent is already configured.`)}return initLog.debug(`dependencies installed`,{ms:y}),o.kind===`created`?(p=`initialize_git`,s?.(p),f.update(`Initializing Git repository`),initLog.debug(`initializing git repository`),{...o,agentElapsedMs:c,agentLaunched:t,gitResult:await n.tryInitializeGit(o.projectPath),installElapsedMs:y,selfModificationEnabled:!1}):{...o,agentElapsedMs:c,agentLaunched:t,installElapsedMs:y,selfModificationEnabled:!1}}catch(e){throw c?.(p,`error`,p===`install_dependencies`?m:void 0),e}finally{f.stop()}}async function runInitCommand(e,t,n,r,i=defaultDependencies,a,o){a?.(`resolve_target`);let s;try{if(await addAgentsToWorkspace(e,t,n,r,i.validateModelSlug)){a?.(`handoff`),o?.(`handoff`,`completed`);return}s=await runInitSteps({agentLaunched:await i.isCodingAgentLaunch(),dependencies:i,logger:e,options:r,parentDirectory:t,target:n,trackStep:a,trackTerminal:o})}catch(e){if(e instanceof WizardCancelledError){o?.(`resolve_target`,`cancelled`);return}throw e instanceof InitTargetError&&o?.(`resolve_target`,`error`,e.failureCode),e}if(a?.(`handoff`),s.kind===`created`){e.log(`${pc.green(`✓`)} Created an ${EVE_WORDMARK} agent in ${pc.bold(s.projectPath)} ${pc.dim(`in ${formatElapsed(s.agentElapsedMs)}`)}`);for(let t of s.workspaceRootMutations)e.log(pc.yellow(`⚠ ${formatWorkspaceRootMutationWarning(t)}`))}else e.log(`${pc.green(`✓`)} Added an ${EVE_WORDMARK} agent to ${pc.bold(s.projectPath)} ${pc.dim(`in ${formatElapsed(s.agentElapsedMs)}`)}`);e.log(`${pc.green(`✓`)} Installed dependencies ${pc.dim(`in ${formatElapsed(s.installElapsedMs)}`)}`),s.selfModificationEnabled&&e.log(`${pc.green(`✓`)} Enabled self-modification`),s.kind===`created`&&s.gitResult.kind===`failed`&&(e.error(pc.yellow(`Git initialization failed during ${s.gitResult.stage}: ${s.gitResult.reason}`)),s.gitResult.stage===`commit`&&e.error(pc.yellow(`The eve agent was created successfully. Git repository metadata and staged files were preserved at "${s.projectPath}"; the initial commit is optional.\n\nTo create it later, configure Git identity and run:\n git -C ${JSON.stringify(s.projectPath)} commit -m "Initial commit from eve"`)));let c=eveDevArguments(s.packageManager),l=[s.packageManager,...c].join(` `),u=initAgentDevHandoff({projectPath:s.projectPath,devCommand:l});if(s.agentLaunched){e.log(initAgentReadySummary(r.model,s.projectPath,{workspace:r.agents!==void 0})),e.log(u);return}if(!i.hasInteractiveTerminal()){e.log(u);return}let d=s.kind===`created`?[...c,`--onboard`]:c;if(e.log(pc.dim(`$ eve dev`)),!resultSucceeded(await i.spawnPackageManager(s.packageManager,s.projectPath,d)))throw Error(`Development server exited unsuccessfully in "${s.projectPath}".`)}function resolveInitEvePackageOverride(){let e=process.env[EVE_INIT_PACKAGE_SPEC_ENV]?.trim();if(e!==void 0&&e.length!==0)return{nodeEngine:DEFAULT_EVE_PACKAGE_CONTRACT.nodeEngine,version:e}}export{EVE_INIT_PACKAGE_SPEC_ENV,runInitCommand};
|
|
1
|
+
import{initAgentDevHandoff,initAgentReadySummary}from"./agent-instructions.js";import{hasInteractiveTerminal}from"./preconditions.js";import{tryInitializeGit}from"./init-git.js";import{InitTargetError}from"./init-telemetry.js";import{addAgentsToWorkspace,convertScaffoldToAgentWorkspace,formatWorkspaceRootMutationWarning}from"./init-agent-workspace.js";import{createInstallDiagnostics,packageManagerInstallFailureCode}from"./init-install.js";import{reportExistingProjectChanges}from"./init-project.js";import{cleanupFreshInitTarget,workspaceFailureNote}from"./init-recovery.js";import{resolveInitTarget}from"./init-target.js";import{mkdtemp,readdir,rename,rm}from"node:fs/promises";import{createLogger,isLogLevelEnabled}from"#internal/logging.js";import{basename,join,resolve}from"node:path";import pc from"#compiled/picocolors/index.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{ensureChannel,scaffoldBaseProject}from"#setup/scaffold/index.js";import{eveDevArguments,packageManagerInstallFailureMessage,packageManagerInstallSucceeded,resultSucceeded,runPackageManagerInstall,spawnPackageManager}from"#setup/primitives/index.js";import{performance}from"node:perf_hooks";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{EVE_WORDMARK,eveCliBanner}from"#cli/banner.js";import{formatElapsed}from"#cli/format-elapsed.js";import{startCliLiveRow}from"#cli/ui/live-row.js";import{detectInvokingPackageManager,detectPackageManager}from"#setup/package-manager.js";import{pathExists}from"#setup/path-exists.js";import{DEFAULT_EVE_PACKAGE_CONTRACT}from"#setup/scaffold/create/project.js";import{validateModelSlug}from"#setup/flows/model-source-change.js";import{addAgentToProject}from"#setup/scaffold/create/add-to-project.js";import{WizardCancelledError}from"#setup/step.js";import{isPackageManagerWorkspaceMember}from"#setup/scaffold/workspace-root.js";const defaultDependencies={addAgentToProject,detectInvokingPackageManager,detectPackageManager,ensureChannel,isCodingAgentLaunch,now:()=>performance.now(),runPackageManagerInstall,scaffoldBaseProject,hasInteractiveTerminal,spawnPackageManager,tryInitializeGit,validateModelSlug},EVE_INIT_PACKAGE_SPEC_ENV=`EVE_INIT_PACKAGE_SPEC`,initLog=createLogger(`init`);async function moveDirectoryContents(e,t){for(let n of await readdir(e))await rename(join(e,n),join(t,n))}function uniqueWorkspaceRootMutations(e){let t=new Map;for(let n of e){let e=`${n.kind}:${n.path}`,r=t.get(e);t.set(e,{...n,nodeEngineOverride:n.nodeEngineOverride??r?.nodeEngineOverride})}return[...t.values()]}async function addToExistingProject(e,t,n,r){if(t.channelWebNextjs===!0)throw Error("`--channel-web-nextjs` is not supported when adding an agent to an existing project. Run `eve add channel/web` from the project afterwards instead.");if(t.model!==void 0){let r=await n.validateModelSlug(e,t.model);if(r!==null)throw Error(r)}let i=await n.detectPackageManager(e),a=await n.addAgentToProject({projectRoot:e,model:t.model??DEFAULT_AGENT_MODEL_ID,reasoning:t.reasoning,packageManager:i.kind,evePackage:r});return{configurationFilesChanged:a.configurationFilesChanged,dependenciesAdded:a.dependenciesAdded,filesWritten:a.filesWritten,packageManager:i.kind,nodeEngineOverride:a.nodeEngineOverride}}async function resolveScaffoldPackageManager(e,t){let n=await t.detectPackageManager(e);return n.source==="default"?t.detectInvokingPackageManager()??`pnpm`:n.kind}async function scaffoldProject(e,t,n,r,i,a,o,s){let c=resolve(e,`..`),l=!n&&await pathExists(e)&&(await readdir(e)).length===0;if(!n&&await pathExists(e)&&!l)throw Error(`Cannot create project because "${e}" already exists.`);let u=n&&s?void 0:await mkdtemp(join(c,`.eve-init-`)),d=[];try{let c=u??e;if(i.model!==void 0){let e=await a.validateModelSlug(c,i.model);if(e!==null)throw Error(e)}let f={projectName:u===void 0?`.`:n?basename(e):t,model:i.model??DEFAULT_AGENT_MODEL_ID,reasoning:i.reasoning,evePackage:o,targetDirectory:c,overwriteExisting:s,workspaceProbeDirectory:e,packageManager:r,onWorkspaceRootMutation:e=>{d.push(e)}},p=await a.scaffoldBaseProject(f);return i.agents!==void 0&&await convertScaffoldToAgentWorkspace(p,i.agents,i),i.channelWebNextjs===!0&&await a.ensureChannel({projectRoot:p,kind:`web`,packageManager:r,force:s,workspaceProbeDirectory:e,configureVercelServices:!1,onWorkspaceRootMutation:e=>{d.push(e)}}),u!==void 0&&(n||l?await moveDirectoryContents(p,e):await rename(p,e)),{projectPath:e,workspaceRootMutations:uniqueWorkspaceRootMutations(d)}}finally{u!==void 0&&await rm(u,{recursive:!0,force:!0})}}async function runInitSteps(e){let{agentLaunched:t,dependencies:n,interactive:r,logger:i,options:a,parentDirectory:o,target:s,trackStep:c,trackTerminal:l}=e,u=isLogLevelEnabled(`debug`),d=await resolveInitTarget({parentDirectory:o,target:s}),f=resolveInitEvePackageOverride(),p=n.now(),m={animate:r&&!t&&!process.env.CI&&process.env.TERM!==`dumb`,elapsed:!0,logPhases:!0},h=startCliLiveRow(i,m),g=`scaffold`,_;try{let e=d.kind===`fresh`?`creating agent`:`adding agent`;c?.(g),h.update(d.kind===`fresh`?`Creating agent`:`Adding agent`),initLog.debug(e);let r=n.now(),o;if(d.kind===`fresh`){let e=await resolveScaffoldPackageManager(d.projectPath,n),t=isPackageManagerWorkspaceMember(e,d.projectPath),r;try{r=await scaffoldProject(d.projectPath,d.projectName,d.createInPlace,e,a,n,f,d.overwriteExisting)}catch(e){if(d.failurePolicy===`clear`){let n=await cleanupFreshInitTarget(d.projectPath,d.failurePolicy,d.preservedEntries),r=e instanceof Error?e.message:String(e),i=n?`eve restored "${d.projectPath}" to its original state.`:`eve could not completely clean "${d.projectPath}".`;throw Error(`${r}\n\n${i}${workspaceFailureNote(t)}`)}if(d.failurePolicy===`remove`&&t){let t=e instanceof Error?e.message:String(e);throw Error(`${t}${workspaceFailureNote(!0)}`)}throw e}o={failurePolicy:d.failurePolicy,kind:`created`,packageManager:e,preservedTargetEntries:d.preservedEntries,projectPath:r.projectPath,retryCommand:`eve init ${d.projectPath}`,workspaceMember:t,workspaceRootMutations:r.workspaceRootMutations}}else{let e=await addToExistingProject(d.projectPath,a,n,f);o=e.nodeEngineOverride===void 0?{configurationFilesChanged:e.configurationFilesChanged,dependenciesAdded:e.dependenciesAdded,failurePolicy:`preserve`,filesWritten:e.filesWritten,kind:`added`,packageManager:e.packageManager,projectPath:d.projectPath}:{configurationFilesChanged:e.configurationFilesChanged,dependenciesAdded:e.dependenciesAdded,failurePolicy:`preserve`,filesWritten:e.filesWritten,kind:`added`,nodeEngineOverride:e.nodeEngineOverride,packageManager:e.packageManager,projectPath:d.projectPath}}let s=n.now()-r;initLog.debug(`${e} done`,{ms:s}),o.kind===`added`&&(h.stop(),reportExistingProjectChanges(i,o),h=startCliLiveRow(i,m)),g=`install_dependencies`,c?.(g),h.update(`Installing dependencies`,o.packageManager),initLog.debug(`installing dependencies with ${o.packageManager}`);let l=n.now(),v=createInstallDiagnostics(),y=await n.runPackageManagerInstall(o.packageManager,o.projectPath,{autoApprove:!0,bypassMinimumReleaseAge:!0,progressDetails:!1,onOutput:e=>{v.append(e.text),u&&initLog.debug(e.text)}}),b=n.now()-l;if(!packageManagerInstallSucceeded(y)){_=packageManagerInstallFailureCode(y),initLog.debug(`dependency installation failed`,{ms:b}),h.stop();let{lines:e,truncated:t}=v.result();t&&i.error(`Earlier install output omitted; showing the final diagnostics.`);for(let t of e)i.error(t);if(e.length===0){let e=packageManagerInstallFailureMessage(y);e!==void 0&&i.error(e)}if(o.failurePolicy!==`preserve`){if(await cleanupFreshInitTarget(o.projectPath,o.failurePolicy,o.preservedTargetEntries)){let e=o.failurePolicy===`remove`?`eve removed the incomplete project at "${o.projectPath}".`:`eve restored "${o.projectPath}" to its original state.`,t=o.workspaceMember||o.workspaceRootMutations.length>0;throw Error(`Failed to install dependencies.\n\n${e}\n\nResolve the package-manager error above, then retry:\n ${o.retryCommand}${workspaceFailureNote(t)}`)}let e=o.workspaceMember||o.workspaceRootMutations.length>0;throw Error(`Failed to install dependencies, and eve could not completely clean "${o.projectPath}".\n\nResolve the package-manager error above, then install dependencies with ${o.packageManager} in that directory. Or clean the target manually before rerunning eve init.${workspaceFailureNote(e)}`)}throw Error(`The eve agent was added, but dependency installation failed.\n\nResolve the package-manager error above, then install dependencies with ${o.packageManager} in "${o.projectPath}".\n\nDo not rerun eve init; the agent is already configured.`)}if(initLog.debug(`dependencies installed`,{ms:b}),o.kind===`created`){g=`initialize_git`,c?.(g),h.update(`Initializing Git`),initLog.debug(`initializing git repository`);let e=await n.tryInitializeGit(o.projectPath);return{...o,elapsedMs:n.now()-p,agentLaunched:t,gitResult:e,selfModificationEnabled:!1}}return{...o,elapsedMs:n.now()-p,agentLaunched:t,selfModificationEnabled:!1}}catch(e){throw l?.(g,`error`,g===`install_dependencies`?_:void 0),e}finally{h.stop()}}async function runInitCommand(e,t,n,r,i=defaultDependencies,a,o){let s=await i.isCodingAgentLaunch(),c=i.hasInteractiveTerminal();c&&!s&&e.log(``),e.log(eveCliBanner()),a?.(`resolve_target`);let l;try{if(await addAgentsToWorkspace(e,t,n,r,i.validateModelSlug)){a?.(`handoff`),o?.(`handoff`,`completed`);return}l=await runInitSteps({agentLaunched:s,interactive:c,dependencies:i,logger:e,options:r,parentDirectory:t,target:n,trackStep:a,trackTerminal:o})}catch(e){if(e instanceof WizardCancelledError){o?.(`resolve_target`,`cancelled`);return}throw e instanceof InitTargetError&&o?.(`resolve_target`,`error`,e.failureCode),e}if(a?.(`handoff`),l.kind===`created`){e.log(`${pc.green(`✓`)} Created an ${EVE_WORDMARK} agent in ${pc.bold(l.projectPath)} ${pc.dim(`in ${formatElapsed(l.elapsedMs)}`)}`);for(let t of l.workspaceRootMutations)e.log(pc.yellow(`⚠ ${formatWorkspaceRootMutationWarning(t)}`))}else e.log(`${pc.green(`✓`)} Added an ${EVE_WORDMARK} agent to ${pc.bold(l.projectPath)} ${pc.dim(`in ${formatElapsed(l.elapsedMs)}`)}`);l.selfModificationEnabled&&e.log(`${pc.green(`✓`)} Enabled self-modification`),l.kind===`created`&&l.gitResult.kind===`failed`&&(e.error(pc.yellow(`Git initialization failed during ${l.gitResult.stage}: ${l.gitResult.reason}`)),l.gitResult.stage===`commit`&&e.error(pc.yellow(`The eve agent was created successfully. Git repository metadata and staged files were preserved at "${l.projectPath}"; the initial commit is optional.\n\nTo create it later, configure Git identity and run:\n git -C ${JSON.stringify(l.projectPath)} commit -m "Initial commit from eve"`)));let u=eveDevArguments(l.packageManager),d=[l.packageManager,...u].join(` `),f=initAgentDevHandoff({projectPath:l.projectPath,devCommand:d});if(l.agentLaunched){e.log(initAgentReadySummary(r.model,l.projectPath,{workspace:r.agents!==void 0})),e.log(f);return}if(!c){e.log(f);return}let p=l.kind===`created`,m=[...l.packageManager===`pnpm`?[`--reporter=silent`]:[],...u,...p?[`--onboard`]:[]];if(e.log(``),!resultSucceeded(await i.spawnPackageManager(l.packageManager,l.projectPath,m)))throw Error(`Development server exited unsuccessfully in "${l.projectPath}".`)}function resolveInitEvePackageOverride(){let e=process.env[EVE_INIT_PACKAGE_SPEC_ENV]?.trim();if(e!==void 0&&e.length!==0)return{nodeEngine:DEFAULT_EVE_PACKAGE_CONTRACT.nodeEngine,version:e}}export{EVE_INIT_PACKAGE_SPEC_ENV,runInitCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createLogger}from"#internal/logging.js";import"#cli/ui/live-row.js";const devBootLog=createLogger(`dev.boot`);function createDevBootProgressReporter(e){return t=>{switch(t.type){case`phase-started`:e?.update(`
|
|
1
|
+
import{createLogger}from"#internal/logging.js";import"#cli/ui/live-row.js";const devBootLog=createLogger(`dev.boot`);function createDevBootProgressReporter(e){return t=>{switch(t.type){case`phase-started`:e?.update(`Starting your agent`),devBootLog.debug(t.phase);return;case`phase-finished`:devBootLog.debug(`${t.phase} finished`,{ms:t.elapsedMs});return;case`before-first-paint`:e?.stop();return;default:return t}}}export{createDevBootProgressReporter};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import{createDevBootProgressReporter}from"./boot-progress.js";import{resolveDevUiMode,resolveTuiDisplayOptions}from"./ui-options.js";import{runInteractiveDevelopmentUi}from"./run-interactive-ui.js";import{parseDevelopmentHeaderOption,resolveDevelopmentUrlTarget}from"./url-target.js";import{parseDevelopmentServerUrl}from"./url.js";import{waitForServerOrStop,waitForUiOrServer}from"./wait-for-ui.js";import{parseContextSizeOption,parseDisplayMode,parseLogsMode,parsePortOption,parseStatsMode}from"../option-parsers.js";import{InvalidArgumentError,Option}from"#compiled/commander/index.js";import{agentCommand}from"#cli/agent-command.js";import{FORCED_EXIT_BACKSTOP_MS,installShutdownSignal}from"#cli/shutdown.js";import{createCliTheme,renderCliTaggedLine}from"#cli/ui/output.js";import{eveCliBanner}from"#cli/banner.js";import{startCliLiveRow}from"#cli/ui/live-row.js";async function loadDevelopmentTuiModule(){return await import(`#cli/dev/tui/tui.js`)}async function loadStartHost(){return(await import(`#cli/dev/local-server-process.js`)).createDevelopmentServer}const loadIsActiveDevelopmentServerForApp=async()=>(await import(`#internal/nitro/host.js`)).isActiveDevelopmentServerForApp;function hasInteractiveTerminal(){return!!(process.stdin.isTTY&&process.stdout.isTTY)}function registerDevelopmentCommand(e){let{applicationContext:t,logger:n,program:r,runtime:i,telemetry:a}=e,o=createCliTheme();agentCommand(r.command(`dev`),t,e=>{let t=e.opts();return resolveDevelopmentUrlTarget(t,e.processedArgs[0])===void 0}).description(`Start the eve development server or connect to an existing URL.`).argument(`[url]`,`Connect to an existing server URL`,parseDevelopmentServerUrl).option(`--host <host>`,`Host interface to bind`).option(`--port <port>`,`Port to listen on (defaults to $PORT, then 2000)`,parsePortOption).option(`-u, --url <url>`,`Connect to an existing server URL`,parseDevelopmentServerUrl).option(`-H, --header <header>`,`Request header for a URL target, in "Name: value" form (repeatable)`,parseDevelopmentHeaderOption).option(`--no-ui`,`Start the server without an interactive UI`).option(`--name <name>`,`Title shown in the terminal UI (defaults to the app folder name)`).option(`--input <text>`,`Pre-fill the prompt input`).addOption(new Option(`--onboard`,`Start fresh-agent onboarding`).hideHelp()).option(`--tools <mode>`,`How tool calls render: full | collapsed | auto-collapsed | hidden`,parseDisplayMode).option(`--reasoning <mode>`,`How reasoning renders: full | collapsed | auto-collapsed | hidden`,parseDisplayMode).option(`--subagents <mode>`,`How subagent sections render: full | collapsed | auto-collapsed | hidden`,parseDisplayMode).option(`--connection-auth <mode>`,`How connection authorization renders: full | collapsed | auto-collapsed | hidden`,parseDisplayMode).option(`--assistant-response-stats <mode>`,`Assistant header statistic: tokens | tokensPerSecond`,parseStatsMode).option(`--context-size <tokens>`,`Model context window size, shown as a usage percentage`,parseContextSizeOption).option(`--logs <mode>`,`Which server/agent logs to show: all | stderr | sandbox | none`,parseLogsMode).addHelpText(`after`,`
|
|
2
2
|
You can also pass a bare URL, for example: eve dev https://example.com
|
|
3
|
-
`).action(async(e,r)=>{let s=resolveDevelopmentUrlTarget(r,e),c=s?.serverUrl,l=hasInteractiveTerminal(),u=resolveDevUiMode({options:r,interactive:l});if(a.trackDevContext({target:s?`remote`:`local`,ui:u}),u===`headless`&&n.log(eveCliBanner()),r.input!==void 0&&u===`headless`)throw new InvalidArgumentError(`--input requires the interactive UI.`);let d=!1;if(c!==void 0&&(d=await(i.isActiveDevelopmentServerForApp??await loadIsActiveDevelopmentServerForApp())({appRoot:t.root,serverUrl:c})),c){let{loadDevelopmentEnvironmentFiles:e}=await import(`#cli/dev/environment.js`);if(await e(t.root),n.log(`↗ ${d?`local`:`remote`} mode targeting ${o.info(new URL(c).host)}`),u===`headless`){n.log(renderCliTaggedLine(o,{message:`Interactive UI disabled because the current terminal is not a TTY.`,tag:`dev`,tone:`warning`}));return}n.log(``);let l=installShutdownSignal({exitAfterMs:FORCED_EXIT_BACKSTOP_MS});try{await runInteractiveDevelopmentUi({applicationRoot:t.root,existingLocalServer:d,lifecycle:l,onOnboardingStep:a.trackSetupStep,onOnboardingTerminal:a.trackSetupTerminal,options:r,remoteTarget:s,runDevelopmentTui:i.runDevelopmentTui,server:{serverUrl:c}})}finally{l.dispose()}return}let f=u===`tui`?startCliLiveRow(n):void 0,p=createDevBootProgressReporter(f);f?.update(`
|
|
3
|
+
`).action(async(e,r)=>{let s=resolveDevelopmentUrlTarget(r,e),c=s?.serverUrl,l=hasInteractiveTerminal(),u=resolveDevUiMode({options:r,interactive:l});if(a.trackDevContext({target:s?`remote`:`local`,ui:u}),u===`headless`&&n.log(eveCliBanner()),r.input!==void 0&&u===`headless`)throw new InvalidArgumentError(`--input requires the interactive UI.`);let d=!1;if(c!==void 0&&(d=await(i.isActiveDevelopmentServerForApp??await loadIsActiveDevelopmentServerForApp())({appRoot:t.root,serverUrl:c})),c){let{loadDevelopmentEnvironmentFiles:e}=await import(`#cli/dev/environment.js`);if(await e(t.root),n.log(`↗ ${d?`local`:`remote`} mode targeting ${o.info(new URL(c).host)}`),u===`headless`){n.log(renderCliTaggedLine(o,{message:`Interactive UI disabled because the current terminal is not a TTY.`,tag:`dev`,tone:`warning`}));return}n.log(``);let l=installShutdownSignal({exitAfterMs:FORCED_EXIT_BACKSTOP_MS});try{await runInteractiveDevelopmentUi({applicationRoot:t.root,existingLocalServer:d,lifecycle:l,onOnboardingStep:a.trackSetupStep,onOnboardingTerminal:a.trackSetupTerminal,options:r,remoteTarget:s,runDevelopmentTui:i.runDevelopmentTui,server:{serverUrl:c}})}finally{l.dispose()}return}let f=u===`tui`?startCliLiveRow(n,{elapsed:!0}):void 0,p=createDevBootProgressReporter(f);f?.update(`Starting your agent`);let m,h,closeServer=()=>m===void 0?Promise.resolve():(h??=m.close(),h.catch(()=>void 0),h),g=installShutdownSignal({exitAfterMs:FORCED_EXIT_BACKSTOP_MS,onStop:()=>{closeServer()}}),_,v=u===`tui`&&i.runDevelopmentTui===void 0?loadDevelopmentTuiModule().then(e=>(p({type:`before-first-paint`}),e.startDevelopmentTuiStartup({appRoot:t.root,initialInput:r.input,onExitRequest:g.requestStop,...resolveTuiDisplayOptions(r)}))):void 0;try{m=(i.startHost??await loadStartHost())(t.root,{existing:u===`tui`?`attach-if-unconfigured`:`reject`,host:r.host,onBootProgress:p,port:r.port});let[e,s]=await Promise.all([Promise.race([m.start().then(e=>({handle:e})),g.stopped.then(()=>({handle:void 0}))]),v]),c=e.handle;if(c===void 0){_=s,await _?.shutdown();return}if(_=s,u!==`tui`&&n.log(renderCliTaggedLine(o,{message:`server listening at ${c.url}`,tag:`dev`,tone:`success`})),u===`headless`){r.ui!==!1&&!l&&n.log(renderCliTaggedLine(o,{message:`Interactive UI disabled because the current terminal is not a TTY.`,tag:`dev`,tone:`warning`})),await waitForServerOrStop(m,g);return}await waitForUiOrServer({handle:c,lifecycle:g,server:m,runUi:async()=>await runInteractiveDevelopmentUi({applicationRoot:t.root,existingLocalServer:!1,lifecycle:g,onOnboardingStep:a.trackSetupStep,onOnboardingTerminal:a.trackSetupTerminal,options:r,report:p,runDevelopmentTui:i.runDevelopmentTui,server:{appRoot:c.appRoot,serverUrl:c.url},startup:_})})}finally{f?.stop(),_===void 0&&(_=await v?.catch(()=>void 0),await _?.shutdown()),await closeServer(),g.dispose()}})}export{registerDevelopmentCommand};
|
|
@@ -9,15 +9,6 @@ export interface AgentHeaderInput {
|
|
|
9
9
|
theme: Theme;
|
|
10
10
|
/** Available terminal width. */
|
|
11
11
|
width: number;
|
|
12
|
-
/** Message-of-the-day line rendered below the startup card, when present. */
|
|
13
|
-
tip?: string;
|
|
14
12
|
}
|
|
15
|
-
/**
|
|
16
|
-
* The header's message-of-the-day pool. All entries reference local-only
|
|
17
|
-
* slash commands, so callers only attach a tip to local `eve dev` sessions.
|
|
18
|
-
*/
|
|
19
|
-
export declare const AGENT_HEADER_TIPS: readonly string[];
|
|
20
|
-
/** Picks one tip; `random` is a test seam over Math.random. */
|
|
21
|
-
export declare function pickAgentHeaderTip(random?: () => number): string;
|
|
22
|
-
/** Returns the styled rows of the startup card and optional tip. */
|
|
13
|
+
/** Returns the styled rows of the startup card. */
|
|
23
14
|
export declare function buildAgentHeader(input: AgentHeaderInput): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{clipVisible}from"#cli/ui/terminal-text.js";function buildAgentHeader(e){let{theme:t,info:n,width:r}=e,i=t.colors,a=resolveInstalledPackageInfo().version,o=Math.max(0,r-1),s=n?.agent.name??e.name,c=[...s===void 0?[]:[i.dim(s)],i.dim(`Run /help for commands`)].join(i.dim(` ${t.glyph.dot} `)),l=t.unicode?`☰eve`:`eve`,u=i.bold(l)+i.dim(` v${a} ${t.glyph.dot} `)+c,d=[clipVisible(u,o)];if(n&&(n.diagnostics.discoveryErrors>0||n.diagnostics.discoveryWarnings>0)){let e=[];n.diagnostics.discoveryErrors>0&&e.push(i.red(`${n.diagnostics.discoveryErrors} error${plural(n.diagnostics.discoveryErrors)}`)),n.diagnostics.discoveryWarnings>0&&e.push(i.yellow(`${n.diagnostics.discoveryWarnings} warning${plural(n.diagnostics.discoveryWarnings)}`)),d.push(``,` ${i.dim(t.glyph.warning)} ${e.join(i.dim(` · `))}`)}return d}function plural(e){return e===1?``:`s`}export{buildAgentHeader};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{renderMarkdown}from"./markdown.js";import{isPromptControlCommand}from"./prompt-commands.js";import{elisionText}from"./rail.js";import{renderTool}from"./tool-rows.js";import{clipVisible,sliceVisible,visibleLength,wrapVisibleLine}from"#cli/ui/terminal-text.js";function renderBlockLines(e,t,n,r){let i=e.depth??0,a=nestingPrefix(i,n),o=renderBody(e,Math.max(8,t-visibleLength(a)),n,r);if(e.closesRail===!0&&i>0){let e=closingPrefix(i,n);return o.map((t,n)=>`${n===o.length-1?e:a}${t}`)}return o.map(e=>`${a}${e}`)}function nestingPrefix(e,t){return e<=0?``:` ${`${t.colors.dim(t.glyph.rule)} `.repeat(e)}`}function closingPrefix(e,t){return` ${`${t.colors.dim(t.glyph.rule)} `.repeat(e-1)}${t.colors.dim(t.glyph.corner)} `}function renderBody(e,t,n,r){if(e.elided!==void 0&&e.kind===`subagent-step`)return[` ${elisionText(e.elided,n)}`];switch(e.kind){case`user`:return renderUser(e,t,n);case`assistant`:case`subagent-step`:return renderProse(e,t,n,r);case`reasoning`:return renderReasoning(e,t,n);case`tool`:case`subagent-tool`:return renderTool(e,t,n,r);case`error`:return renderError(e,t,n);case`notice`:return renderNotice(e,t,n);case`warning`:return renderWarning(e,t,n);case`result`:return renderResult(e,t,n);case`flow`:return renderFlow(e,t,n);case`command`:return renderCommand(e,n);case`question`:case`connection-auth`:return renderPreformatted(e,t,n);case`sandbox`:return renderSandbox(e,t,n,r);case`log`:return renderLog(e,t,n);case`subagent`:return renderSubagentHeader(e,t,n,r);case`subagent-close`:{let r=` ${n.colors.dim(n.glyph.corner)}`;return e.body!==void 0&&e.body.length>0?[clipVisible(`${r} ${n.colors.dim(e.body)}`,Math.max(1,t))]:[r]}case`turn-stats`:return renderTurnStats(e,t,n);case`session-boundary`:case`todo-list`:case`agent-header`:return(e.body??``).split(`
|
|
2
2
|
`)}}function renderUser(e,t,n){let r=e.promptOrigin===`steer`?n.colors.yellow(n.glyph.user):n.colors.cyan(n.glyph.user);return wrap(e.body??``,t-2).map(e=>`${r} ${e}`)}function renderProse(e,t,n,r){let i=[],a=e.kind===`subagent-step`;if(a&&e.collapsed===!0){let r=firstNonEmptyLine(e.body)??(e.reasoning===void 0?void 0:firstNonEmptyLine(e.reasoning));return r===void 0?[]:[n.colors.dim(sliceVisible(r,Math.max(1,t)))]}let o=r.renderMarkdown??!0,s=a?``:`${n.colors.bold(n.glyph.brand)} `,c=a?``:` `;e.reasoning&&e.reasoning.trim().length>0&&i.push(...renderReasoningLines(e.reasoning,t,n));let l=(e.body??``).trim();return l.length===0&&i.length===0?[`${s}${n.colors.dim(`thinking${n.glyph.ellipsis}`)}`]:(l.length>0&&(o?renderMarkdown(l,t-c.length):l).split(`
|
|
3
3
|
`).flatMap(e=>wrapVisibleLine(e,t-c.length)).forEach((e,t)=>{t===0&&!a&&i.length===0?i.push(`${s}${e}`):i.push(`${c}${e}`)}),i.length>0?i:[`${s}`])}function renderReasoning(e,t,n){return e.collapsed?[`${n.colors.gray(n.glyph.reasoning)} ${n.colors.dim(e.title??`thinking`)}`]:renderReasoningLines(e.body??``,t,n,n.glyph.reasoning)}function renderReasoningLines(e,t,n,r){let i=r?2:0,a=wrap(e.trim(),t-i);return a.length===0?[]:a.map((e,t)=>`${r?t===0?`${n.colors.gray(r)} `:` `:``}${n.colors.dim(n.colors.italic(e))}`)}function renderError(e,t,n){let r=n.colors.red(n.colors.bold(n.glyph.error)),i=e.title??`Error`,a=[`${r} ${n.colors.red(n.colors.bold(i))}`];for(let r of wrap(e.body??``,t-2))a.push(` ${colorizeError(r,n)}`);if(e.hint!==void 0&&e.hint.trim().length>0)for(let[r,i]of wrap(e.hint,t-4).entries()){let e=r===0?`${n.glyph.arrow} `:` `;a.push(` ${n.colors.cyan(`${e}${i}`)}`)}return a.push(...renderErrorDetail(e.detail,t,n)),a}function renderErrorDetail(e,t,n){if(e===void 0||e.trim().length===0)return[];let r=e.split(`
|
|
4
4
|
`),i=r.slice(0,12),a=i.map(e=>` ${n.colors.dim(truncatePlain(e,Math.max(1,t-2)))}`),o=r.length-i.length;return o>0&&a.push(` ${n.colors.dim(`${n.glyph.ellipsis} +${o} more line${o===1?``:`s`}`)}`),a}const URL_PATTERN=/(https?:\/\/\S+)/u;function colorizeError(e,t){return URL_PATTERN.test(e)?e.split(URL_PATTERN).map((e,n)=>n%2==1?t.colors.cyan(e):t.colors.red(e)).join(``):t.colors.red(e)}function renderNotice(e,t,n){let r=n.colors.dim(n.glyph.dot),i=wrap(e.body??``,t-2);return i.length===0?[r]:i.map(e=>`${r} ${n.colors.dim(e)}`)}function renderAttentionRows(e,t,n){let r=n.colors.yellow(n.glyph.warning);return wrap(e,t-2).map((e,t)=>`${t===0?r:` `} ${paintCommands(e,n)}`)}function renderWarning(e,t,n){return renderAttentionRows(e.body??``,t,n)}function paintCommands(e,t){return e.replace(/\/[a-z:-]+/g,e=>isPromptControlCommand(e)?t.colors.blue(e):e)}function renderCommand(e,t){let n=t.colors,r=e.status===`error`?`${n.red(t.glyph.error)} `:``;return[`${n.cyan(t.glyph.user)} ${r}${n.blue(e.body??``)}`]}function paintOutcomeMarker(e,t,n=e){let r=n.trimStart().slice(0,1);return r===`✓`?e.replace(r,t.colors.green(t.glyph.success)):r===`⨯`?e.replace(r,t.colors.red(t.glyph.error)):r===`–`?e.replace(r,t.colors.yellow(t.glyph.dash)):e}function renderFlow(e,t,n){let r=n.colors,i=e.title??`info`,a=i===`success`?r.green(n.glyph.success):i===`warning`?r.yellow(n.glyph.warning):i===`error`?r.red(n.glyph.error):r.dim(n.glyph.dot),o=wrap(e.body??``,t-2),paint=e=>i===`info`?r.dim(e):paintOutcomeMarker(e,n);return o.map((e,t)=>`${t===0?a:` `} ${paint(e)}`)}function renderResult(e,t,n){let r=wrap(e.body??``,t-7);if(e.status===`done`){let e=n.colors.dim(n.glyph.elbow),t=n.colors.green(n.glyph.success),i=n.colors.dim(n.glyph.rule),a=n.colors.dim(n.glyph.corner);return r.length===0?[` ${e} ${t}`]:r.map((n,o)=>o===0?` ${e} ${t} ${n}`:` ${o===r.length-1?a:i} ${n}`)}let i=n.colors.dim(n.glyph.elbow);if(r.length===0)return[` ${i}`];let dim=e=>paintOutcomeMarker(n.colors.dim(e.replaceAll(`\x1B[22m`,`\x1B[22m\x1B[2m`)),n,e);return r.map((e,t)=>t===0?` ${i} ${dim(e)}`:` ${dim(e)}`)}function renderPreformatted(e,t,n){let r=e.kind===`connection-auth`?n.colors.yellow(n.glyph.connection):n.colors.yellow(n.colors.bold(n.glyph.question)),i=e.kind===`question`?` `:` `,a=wrap(e.title??``,t-2),o=a.length===0?[`${r} `]:a.map((e,t)=>t===0?`${r} ${n.colors.bold(e)}`:` ${n.colors.bold(e)}`);for(let n of(e.body??``).split(`
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
function registryItemProgress(e){return(t,n,r)=>{e.setNavigation?.(void 0),e.replaceContent?.(),e.setStatus(`Adding ${t.title??t.name} · ${n+1} of ${r}`)}}function registryResultTone(e){if(e.failures.length>0&&e.items.length===0)return`error`;if(!e.outcomes?.some(e=>e.kind===`cancelled`))return e.items.length>0?`success`:void 0}function joinedTitles(e){return e.length===0?``:e.length===1?e[0]:e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(`, `)}, and ${e.at(-1)}`}function
|
|
1
|
+
function registryItemProgress(e){return(t,n,r)=>{e.setNavigation?.(void 0),e.replaceContent?.(),e.setStatus(`Adding ${t.title??t.name} · ${n+1} of ${r}`)}}function registryResultTone(e){if(e.failures.length>0&&e.items.length===0)return`error`;if(!e.outcomes?.some(e=>e.kind===`cancelled`))return e.items.length>0?`success`:void 0}function joinedTitles(e){return e.length===0?``:e.length===1?e[0]:e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(`, `)}, and ${e.at(-1)}`}function formatFailureMessage(e){return e.replace(" Try again with `",`
|
|
2
|
+
Try again with \``)}function resultHeadline(e,t){let n=e.filter(e=>e.kind===`failed`).length,r=e.filter(e=>e.kind===`cancelled`).length;if(n===0&&r===0)return`Added ${joinedTitles(t)}`;let i=e.length-n-r,a=[i>0?`${i} added`:void 0,n>0?`${n} failed`:void 0,r>0?`${r} cancelled`:void 0].filter(e=>e!==void 0);return`${e.length} ${e.length===1?`addition`:`additions`}: ${a.join(`, `)}`}function formatRegistrySessionResult(e){let t=e.outcomes??[...e.items.map(e=>({kind:`installed`,...e})),...e.failures.map(e=>({kind:`failed`,...e}))],n=[resultHeadline(t,e.items.map(e=>e.title))];for(let e of t){let t=e.kind===`installed`?`✓`:e.kind===`failed`?`⨯`:`–`;if(n.push(``,` ${t} ${e.title}`),e.kind===`cancelled`){n.push(` Cancelled.`);continue}if(e.kind===`failed`){n.push(...formatFailureMessage(e.message).split(`
|
|
2
3
|
`).map(e=>` ${e}`));continue}if(e.facts.length===0&&e.output.length===0){n.push(` Installed.`);continue}let r=Math.max(0,...e.facts.map(e=>e.label.length));for(let t of e.facts)n.push(` ${t.label.padEnd(r)} ${t.value}`);for(let t of e.output)n.push(` ${t}`)}return e.cancelled===!0&&n.push(``,`Setup stopped before the remaining selections were added.`),n.join(`
|
|
3
4
|
`)}export{formatRegistrySessionResult,registryItemProgress,registryResultTone};
|
|
@@ -161,8 +161,6 @@ export type AgentTUIAgentHeader = {
|
|
|
161
161
|
name: string;
|
|
162
162
|
serverUrl: string;
|
|
163
163
|
info?: AgentInfoResult;
|
|
164
|
-
/** Message-of-the-day line shown below the startup card (local sessions only). */
|
|
165
|
-
tip?: string;
|
|
166
164
|
};
|
|
167
165
|
export type AgentTUIRenderer = {
|
|
168
166
|
/**
|
|
@@ -324,7 +322,6 @@ export interface PromptCommandHandler {
|
|
|
324
322
|
}>, context: PromptCommandHandlerContext): Promise<PromptCommandOutcome | undefined>;
|
|
325
323
|
}
|
|
326
324
|
type TuiStartup = {
|
|
327
|
-
readonly headerTip: string;
|
|
328
325
|
finish(): {
|
|
329
326
|
draft: string;
|
|
330
327
|
queuedPrompt: string | undefined;
|
|
@@ -405,8 +402,8 @@ export declare class EveTUIRunner {
|
|
|
405
402
|
constructor(options: EveTUIRunnerOptions);
|
|
406
403
|
run(): Promise<void>;
|
|
407
404
|
}
|
|
408
|
-
/** Returns the registry address carried by a self-modification terminal handoff. */
|
|
409
|
-
export declare function registryHandoffAddress(toolName: string | undefined, output: unknown): string | undefined;
|
|
405
|
+
/** Returns the registry address carried by a packaged self-modification terminal handoff. */
|
|
406
|
+
export declare function registryHandoffAddress(subagentName: string | undefined, toolName: string | undefined, output: unknown): string | undefined;
|
|
410
407
|
export type ConnectionAuthChallenge = {
|
|
411
408
|
url?: string;
|
|
412
409
|
userCode?: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{PROMPT_COMMANDS,formatPromptCommandHelp,parsePromptCommand}from"./prompt-commands.js";import{
|
|
1
|
+
import{PROMPT_COMMANDS,formatPromptCommandHelp,parsePromptCommand}from"./prompt-commands.js";import{failureKey,formatFailureDetail,formatFailureHint,formatFailureMessage,isInterruptedError,localFailureHint}from"./errors.js";import{parseLogDisplayMode}from"./log-display-mode.js";import{createMcpConnectionStatusTracker}from"./mcp-connection-status.js";import{describeRemoteAuthCompletedMutations}from"./remote-auth-result.js";import{createRemoteConnectionController}from"./remote-connection.js";import{prepareRemoteTuiAccess}from"./remote-startup.js";import{SubagentPump}from"./subagent-pump.js";import{BOOT_DETECTIONS,CLI_MISSING_SETUP_ISSUE,LOGIN_SETUP_ISSUE,detectSetupIssues,formatSetupIssuesLine,normalizeLocalModelEndpoint,orderedSetupIssues}from"./setup-issues.js";import{TerminalRenderer}from"./terminal-renderer.js";import{createVercelStatusTracker}from"./vercel-status.js";import"#client/index.js";import{loadDevelopmentEnvironmentFiles}from"#cli/dev/environment.js";import{inspectApplication}from"#services/inspect-application.js";import{devBootPhase}from"#internal/dev-boot-progress.js";import{toErrorMessage}from"#shared/errors.js";import{getVercelAuthStatus}from"#setup/vercel-project.js";import{probeAgentInfo}from"#services/dev-client/agent-info-probe.js";import{SteeringStream}from"#cli/dev/tui/steering-stream.js";import{renderApplicationInfo}from"#cli/commands/info.js";import{subscribeDevelopmentSandboxPrewarmLogs}from"#execution/sandbox/development-prewarm.js";import{createEventDeduper}from"#protocol/event-dedupe.js";import{isCurrentTurnBoundaryEvent}from"#protocol/message.js";import{createDevelopmentRuntimeArtifactRefresher}from"#services/dev-client.js";async function delayMs(e){await new Promise(t=>{setTimeout(t,e).unref?.()})}async function abortableDelay(e,t){t.aborted||await new Promise(n=>{let r=setTimeout(done,e);r.unref?.(),t.addEventListener(`abort`,done,{once:!0});function done(){clearTimeout(r),t.removeEventListener(`abort`,done),n()}})}function authIssueForStatus(e){if(e===`logged-out`)return LOGIN_SETUP_ISSUE;if(e===`cli-missing`)return CLI_MISSING_SETUP_ISSUE}var EveTUIRunner=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v=!1;#y;#b;#x=!0;#S;#C;#w;#T;#E;#D;#O;#k;#A;#j=!1;#M=new AbortController;#N=!1;#P=0;#F=0;#I=[];#L;#R;#z;#B;#V=new Map;#H;#U=[];#W;#G=!1;#K;#q=new Map;#J=new Set;#Y;#X;#Z;constructor(e){this.#e=e.session,e.client!==void 0&&(this.#t=e.client),e.lifecycle!==void 0&&(this.#Z=e.lifecycle),this.#n=createRenderer(e);let t={formatActionResultError};if(this.#t!==void 0&&(t.client=this.#t),this.#n.subagents!==void 0&&(t.view=this.#n.subagents),e.appRoot!==void 0&&(t.onToolCompleted=async(e,t,n)=>{let r=registryHandoffAddress(e,t,n);r!==void 0&&this.#pe(r)}),this.#K=new SubagentPump(t),this.#r=e.name??`eve`,this.#w=e.withExclusiveTerminal,this.#i=e.tools??`full`,this.#a=e.reasoning??`full`,this.#o=e.subagents??`full`,this.#s=e.connectionAuth??`full`,this.#c=e.assistantResponseStats??`tokensPerSecond`,this.#l=e.contextSize,this.#u=e.formatTransportError??toErrorMessage,e.initialInput!==void 0&&(this.#m=e.initialInput),e.startup!==void 0&&(this.#h=e.startup),this.#_=e.onboard===!0,this.#y=e.onOnboardingStep,this.#b=e.onOnboardingTerminal,e.appRoot!==void 0){this.#p=e.appRoot;let t={appRoot:e.appRoot,onChange:e=>this.#n.setVercelStatus?.(e)};e.detectProjectIdentity!==void 0&&(t.detectIdentity=e.detectProjectIdentity),this.#R=createVercelStatusTracker(t),e.probeMcpConnection!==void 0&&(this.#z=createMcpConnectionStatusTracker({onChange:()=>{},probe:e.probeMcpConnection}))}if(e.promptCommandHandler!==void 0&&(this.#S=e.promptCommandHandler),this.#C=e.availablePromptCommands??PROMPT_COMMANDS,e.remote!==void 0){if(this.#E=e.remote.runAuthFlow,this.#t===void 0)throw Error(`A remote TUI requires a configured development client.`);this.#T=createRemoteConnectionController({client:this.#t,credentials:e.remote.credentials,target:e.remote.target,onChange:e=>this.#n.setRemoteConnectionStatus?.(e),resolveOidcToken:e.remote.resolveOidcToken,resolveDeployment:e.remote.resolveDeployment})}this.#D=e.bootDetections??BOOT_DETECTIONS,this.#O=e.getVercelAuthStatus??getVercelAuthStatus,this.#k=e.inspectApplication??inspectApplication,e.onBootProgress!==void 0&&(this.#A=e.onBootProgress),e.serverUrl!==void 0&&(this.#f=e.serverUrl),e.serverUrl!==void 0&&e.remote===void 0&&(this.#d=createDevelopmentRuntimeArtifactRefresher({serverUrl:e.serverUrl}))}async#Q(){if(this.#f===void 0){this.#te(),this.#_||await this.#he(void 0);return}let e;if(this.#T!==void 0){let t=await this.#T.check();t.state===`ready`&&(e=t.info)}else{let t=this.#t;if(t!==void 0)try{let n=await devBootPhase(`connecting to agent`,()=>probeAgentInfo({client:t,timeoutMs:2e3}),this.#A);n.kind===`ready`&&(e=n.info)}catch{e=void 0}}this.#te();let t=this.#ee(e);this.#_||await this.#he(t)}#$(){let e=this.#h?.finish();return this.#g=e?.queuedPrompt,e?.draft??this.#m}#ee(e){let t=this.#p===void 0?e:normalizeLocalModelEndpoint(e,process.env);this.#B=t;let n=this.#f;if(n===void 0||this.#x)return t;let r={name:this.#r,serverUrl:n};return t!==void 0&&(r.info=t),this.#n.renderAgentHeader?.(r),t}#te(){let e=this.#A;this.#A=void 0,e?.({type:`before-first-paint`})}async run(){let onStop=()=>this.#n.requestInterrupt?.();this.#Z?.signal.aborted===!0?onStop():this.#Z?.signal.addEventListener(`abort`,onStop,{once:!0});try{await this.#ne()}finally{this.#Z?.signal.removeEventListener(`abort`,onStop),this.#j=!0,this.#M.abort(),this.#K.abortAll(),this.#X?.(),this.#X=void 0,this.#n.shutdown?.(),this.#R?.dispose(),this.#z?.dispose(),this.#T?.dispose()}}async#ne(){let e=this.#r,t,n,r=!1,i=!1,a=!1;this.#n.setStartupPhase?.(`starting`),await this.#Q(),this.#ye(),this.#R?.refreshIdentity(),this.#z?.refresh();let o=(this.#_||this.#B?.agent.model.endpoint?.kind===`gateway`&&!this.#B.agent.model.endpoint.connected)&&this.#p!==void 0&&this.#S!==void 0&&this.#n.setupFlow!==void 0,s;if(this.#T!==void 0&&this.#n.setupFlow!==void 0){let e=await prepareRemoteTuiAccess({connection:this.#T,renderer:this.#n.setupFlow,signal:this.#Z?.signal,runAuthFlow:this.#E});if(e?.kind===`authenticated`){let e=this.#T.current().connection;e.state===`ready`&&this.#ee(e.info)}else e?.kind===`failed`||e?.kind===`unavailable`?s={tone:`error`,message:e.kind===`failed`?e.message:e.failure.message}:e?.kind===`cancelled`&&(s={cancelled:!0},e.completedMutations.length>0&&(s.message=`Completed before cancellation: ${describeRemoteAuthCompletedMutations(e.completedMutations).join(`, `)}.`))}o&&(this.#n.setStartupPhase?.(`connecting`),s=await this.#Te(e));let c=this.#$();for(s?.cancelled||s?.tone===`error`?c=[this.#g,c].filter(Boolean).join(`
|
|
2
2
|
|
|
3
|
-
`)||void 0:t=this.#g,this.#x=!1,this.#te(this.#V),this.#_e(),this.#n.setStartupPhase?.(void 0),o&&this.#Ce({type:`extension`,name:`login`,argument:``},`startup`,s?.tone),this.#xe(s?.message,s?.tone);;){if(this.#Q?.signal.aborted===!0||this.#n.exitRequested?.()===!0)return;let o=this.#W[0];if(o!==void 0&&n===void 0&&this.#U===void 0){this.#W.shift(),this.#G=o;try{await this.#he(o)}finally{this.#G=void 0}i=!1,a=!1,t=void 0;continue}if(!a){if(t==null){if(!this.#n.readPrompt){if(r)return;throw Error(`No prompt was provided and the renderer does not support prompt input.`)}let n={title:e};c!==void 0&&(n.initialDraft=c,c=void 0);try{this.#K=!0,t=await this.#ce(n)}catch(e){if(isInterruptedError(e)){if(this.#U===void 0&&this.#W.length===0)return;a=!0,t=``}else throw e}finally{this.#K=!1}if(this.#W.length>0&&this.#U===void 0){t=void 0;continue}if(t==null&&this.#U===void 0)return}let o=this.#U===void 0?parsePromptCommand(t):null;if(o?.type===`exit`){this.#Q?.requestStop();return}if(o?.type===`cancel`){if(this.#e===void 0){this.#xe(`No active turn to cancel.`),n=void 0,i=!1,a=!1,t=void 0;continue}try{let e=await this.#e.cancel();if(this.#xe(e.status===`accepted`?`Turn cancellation requested.`:`No active turn to cancel.`),e.status===`no_active_turn`){n=void 0,i=!1,a=!1,t=void 0;continue}}catch(e){this.#xe(`Couldn't cancel the turn: ${toErrorMessage(e)}`),n=void 0,i=!1,a=!1,t=void 0;continue}n=void 0,i=!0,a=!1,t=void 0}if(o?.type===`reset`){if(!await this.#oe()){n=void 0,a=!1,t=void 0;continue}n=void 0,a=!1,t=void 0;continue}if(o?.type===`compact`){if(this.#e===void 0){this.#xe(`No active session to compact.`),n=void 0,i=!1,a=!1,t=void 0;continue}try{let e=await this.#e.compact();if(this.#xe(e.status===`accepted`?`Compaction requested.`:`No active session to compact.`),e.status===`no_active_session`){n=void 0,i=!1,a=!1,t=void 0;continue}}catch(e){this.#xe(`Couldn't compact the session: ${toErrorMessage(e)}`),n=void 0,i=!1,a=!1,t=void 0;continue}n=void 0,i=!0,a=!1,t=void 0}if(o?.type===`clear`){if(this.#e===void 0){this.#xe(`No active session to clear.`),n=void 0,i=!1,a=!1,t=void 0;continue}try{let e=await this.#e.clear();if(this.#xe(e.status===`accepted`?`Context clear requested.`:`No active session to clear.`),e.status===`no_active_session`){n=void 0,i=!1,a=!1,t=void 0;continue}}catch(e){this.#xe(`Couldn't clear the session: ${toErrorMessage(e)}`),n=void 0,i=!1,a=!1,t=void 0;continue}n=void 0,i=!0,a=!1,t=void 0}if(o?.type===`help`){this.#xe(formatPromptCommandHelp(this.#C)),n=void 0,a=!1,t=void 0;continue}if(o?.type===`info`){await this.#Ae(),n=void 0,a=!1,t=void 0;continue}if(o?.type===`loglevel`){this.#xe(this.#je(o.argument)),n=void 0,a=!1,t=void 0;continue}if(o?.type===`traces`){await this.#ke(o.argument),n=void 0,a=!1,t=void 0;continue}if(o?.type===`extension`){try{await this.#Ee(o,e,{trigger:`command`})}catch(e){if(isInterruptedError(e))return;throw e}n=void 0,t=void 0,a=!1;continue}r=!0}let s=this.#U;this.#U=void 0;let l=s??(i?this.#fe():await(async()=>(this.#ae(),await this.#ue({prompt:a?void 0:t,inputResponses:n})))()),u=this.#e?.state.sessionId;u!==void 0&&this.#n.setSessionId?.(u);let d=t,f=!1;try{for(;;){await this.#n.renderStream(l,{title:e,submittedPrompt:d,continueSession:!!this.#n.readPrompt,tools:this.#i,reasoning:this.#a,subagents:this.#o,connectionAuth:this.#s,assistantResponseStats:this.#c,contextSize:this.#l});let r=l.turnState?.pendingApprovals??[],i=l.turnState?.pendingQuestions??[];if(r.length>0||i.length>0){let o=[];if(r.length>0){if(!this.#n.readToolApproval)throw Error(`Tool approval was requested, but the renderer does not support tool approval input.`);for(let t of r){let n=await this.#n.readToolApproval(t,{title:e});o.push({requestId:t.approvalId,optionId:n.approved?`approve`:`cancel`}),this.#H.delete(t.approvalId)}}if(i.length>0){if(!this.#n.readInputQuestion)throw Error(`An interactive question was requested, but the renderer does not support input questions.`);for(let t of i){let n=toAgentTUIInputQuestion(t),r=await this.#n.readInputQuestion(n,{title:e});if(r===void 0)continue;let i={requestId:t.requestId};r.optionId!==void 0&&(i.optionId=r.optionId),r.text!==void 0&&(i.text=r.text),o.push(i),this.#H.delete(t.requestId)}}if(o.length===0)break;a=!0,n=o,t=void 0,f=!0;break}if(this.#Le(l)){l=this.#fe(),d=void 0;continue}if(l.turnState&&l.turnState.boundaryEvent===void 0&&!l.turnState.aborted){let e=this.#e?.state.sessionId;this.#n.renderNotice?.(e?`Lost the event stream — the turn may still be running on the server (session ${e}). Your next message resumes this session; use /cancel to stop the turn.`:`Lost the connection to the running turn.`)}break}}catch(e){if(isInterruptedError(e))return;throw e}if(f)continue;i=!1,a=!1,n=void 0,t=void 0;let p=l.turnState?.boundaryEvent;this.#X!==this.#e&&(p===`session.waiting`||p===`session.completed`)&&(t=this.#n.takeQueuedPrompt?.()),this.#ae(l.turnState?.aborted===!0)}}#ie(){this.#q.abortAll(),this.#H.clear(),this.#J.clear(),this.#Y.clear(),this.#n.setConnectionAuthPendingCount?.(0),this.#e=void 0,this.#d?.clear()}#ae(e=!1){let t=this.#X;t!==void 0&&(this.#X=void 0,this.#e===t&&(this.#ie(),e?this.#n.renderNotice?.(`Stopped following the turn and started a new session. Earlier context was cleared; the interrupted turn may still be running on the server.`):this.#n.renderSessionBoundary===void 0?this.#n.renderNotice?.(`Session ended — started a new session. Earlier context was cleared.`):this.#n.renderSessionBoundary()))}async#oe(){if(this.#e===void 0)return this.#ie(),this.#n.reset?.(),!0;try{await this.#e.reset()}catch(e){return this.#n.renderNotice?.(`Couldn't reset the session: ${toErrorMessage(e)}`),!1}return this.#ie(),this.#n.reset?.(),!0}async#se(e){if(!this.#n.readPrompt)return;let t=this.#n.readPrompt(e),n=this.#d;if(n===void 0)return await t;let r=!1,i=!1,a,o=!1,s=0,refresh=async()=>{if(!(r||i)){i=!0;try{await n.refreshIdle({onRuntimeArtifactsChanged:()=>this.#Fe()}),this.#p!==void 0&&this.#V===void 0&&!o&&(o=!0,this.#Ne().finally(()=>{o=!1}));let e=this.#V?.agent.model.endpoint,t=e?.kind===`chatgpt`&&(e.state===`signed-out`||e.state===`reauth-required`),r=Date.now();t&&r-s>=5e3&&(s=r,this.#Ne())}finally{i=!1}}},startRefresh=()=>{if(r||i)return;let e=refresh().finally(()=>{a===e&&(a=void 0)});a=e};startRefresh();let c=setInterval(()=>{startRefresh()},500);c.unref?.();try{return await t}finally{r=!0,clearInterval(c),await a}}async#ce(e){let t=this.#se(e);if(this.#n.renderIdleStream===void 0||this.#e?.state.sessionId===void 0)return await t;let n=new AbortController,r=this.#le(n.signal,e).catch(e=>{n.signal.aborted||this.#n.renderNotice?.(`Stopped following session updates: ${toErrorMessage(e)}`)});try{return await t}finally{n.abort(),await r}}async#le(e,t){let n=this.#e;if(n===void 0)return;let r=100;for(;!e.aborted;){let i=n.stream({signal:e})[Symbol.asyncIterator](),a=!1;try{for(;!e.aborted;){let r=!1,o={async*[Symbol.asyncIterator](){for(;!e.aborted;){let e=await i.next();if(e.done===!0||(r=!0,a=!0,yield e.value,isCurrentTurnBoundaryEvent(e.value)))return}}},s=this.#pe(o,()=>{},n);if(await this.#n.renderIdleStream(s,{...t,continueSession:!0}),this.#Le(s),(s.turnState?.pendingApprovals.length??0)>0||(s.turnState?.pendingQuestions.length??0)>0){this.#U={events:(async function*(){})(),turnState:s.turnState},this.#n.suspendPromptForInput?.();return}if(s.turnState?.boundaryEvent===`session.completed`||s.turnState?.boundaryEvent===`session.failed`)return;if(!r)break}}finally{await i.return?.()}r=a?100:Math.min(r*2,2e3),e.aborted||await abortableDelay(r,e)}}async#ue(e){let t=new AbortController,n={signal:t.signal};e.prompt!==void 0&&(n.message=e.prompt),e.inputResponses!==void 0&&e.inputResponses.length>0&&(n.inputResponses=e.inputResponses);let r,i=this.#e;try{if(this.#d!==void 0&&await this.#d.refresh({inputResponses:n.inputResponses,message:n.message,onRuntimeArtifactsChanged:()=>this.#Fe()}),n.message!==void 0&&(n.inputResponses?.length??0)===0&&this.#n.flushDelayedDevBuildErrors?.(),this.#e===void 0){if(this.#t===void 0)throw Error(`Cannot create a session without an eve client.`);if(n.message===void 0)throw Error(`Cannot answer an input request before the session starts.`);let e=await this.#t.sessions.create({...n,message:n.message});this.#e=e.session,r=e.response}else r=n.inputResponses===void 0?await this.#e.send(n.message,{signal:n.signal,turnPolicy:`queue`}):await this.#e.respond(n.inputResponses,{signal:n.signal})}catch(e){if(isInterruptedError(e))throw e;return this.#T?.reportFailure(e),this.#X=i,{events:errorOnlyTUIStream({errorText:this.#u(e)}),turnState:createTurnState()}}return this.#pe(r,()=>t.abort(),this.#e)}async#de(e,t){if(e.cancelInFlight!==!0){e.cancelInFlight=!0;try{for(let n=0;n<8;n+=1){if(e.boundaryEvent!==void 0||e.aborted===!0)return;let n=e.turnId;try{if((await t?.cancel(n===void 0?void 0:{turnId:n}))?.status===`accepted`)return}catch{}await delayMs(250)}}finally{e.cancelInFlight=!1}}}#fe(){if(this.#e===void 0)throw Error(`Cannot stream a session before its first turn is accepted.`);let e=new AbortController,t=this.#e;return this.#pe(t.stream({signal:e.signal}),()=>e.abort(),t)}#pe(e,t,n){let r=createTurnState(),i=n===void 0?void 0:new SteeringStream(e,n);return{steer:i===void 0?void 0:e=>i.send(e),abort:()=>{r.aborted=!0,this.#X=n,i?.abort(),t()},cancel:()=>{this.#de(r,n)},events:eveEventsToTUIStream({onAssistantResponse:()=>{this.#_&&!this.#v&&(this.#v=!0,this.#y?.({flow:`onboarding`,step:`first_response`}))},events:i??e,pendingInputRequests:this.#H,turnState:r,onSubagentCalled:e=>this.#q.begin(e),onSubagentBackgrounded:e=>this.#q.background(e),onSubagentCompleted:e=>this.#q.settle(e),onTurnCancelled:e=>this.#q.settleCancelledTurn(e),onConnectionAuthRequired:e=>this.#Ie(e),onConnectionAuthCompleted:e=>this.#Re(e),onRegistryHandoff:this.#p===void 0?void 0:async e=>this.#me(e),onTerminalFailure:()=>{this.#X=n},failureHintOverride:this.#p===void 0?void 0:localFailureHint}),turnState:r}}#me(e){this.#G===e||this.#W.includes(e)||(this.#W.push(e),this.#K&&this.#n.suspendPromptForInput?.())}async#he(e){await this.#Ee({type:`extension`,name:`add`,argument:e},`Add to your agent`,{trigger:`command`})}async#ge(e){if(this.#p===void 0)return;let t={appRoot:this.#p,env:process.env};e!==void 0&&(t.info=e),this.#I=await detectSetupIssues(t,this.#D),this.#n.renderSetupWarning!==void 0&&(this.#_e(),this.#ve())}#_e(){if(this.#x)return;let e=orderedSetupIssues(this.#I,this.#L);e.length>0?this.#n.renderSetupWarning?.(formatSetupIssuesLine(e)):this.#n.clearSetupWarning?.()}async#ve(){let e=this.#p;if(e===void 0||process.env.EVE_MODEL_CONNECTION!==`ai-gateway-project`)return;let t;try{t=await this.#O(e,{signal:this.#M.signal})}catch{return}this.#j||this.#N||(this.#L=authIssueForStatus(t),this.#_e())}async#ye(e){let t=this.#p;if(t===void 0||this.#n.renderSetupWarning===void 0)return;let n=++this.#P,r={appRoot:t,env:process.env};e!==void 0&&(r.info=e);try{let[e,i]=await Promise.all([detectSetupIssues(r,this.#D),process.env.EVE_MODEL_CONNECTION===`ai-gateway-project`?this.#O(t,{signal:this.#M.signal}):void 0]);if(this.#j||n!==this.#P)return;this.#I=e,this.#L=i===void 0?void 0:authIssueForStatus(i),this.#_e()}catch{return}}#be(){this.#p!==void 0&&this.#n.renderSandboxLog!==void 0&&this.#Z===void 0&&(this.#Z=subscribeDevelopmentSandboxPrewarmLogs({appRoot:this.#p,log:e=>this.#n.renderSandboxLog?.(e)}))}#xe(e,t){if(e!==void 0){if(this.#n.renderCommandResult!==void 0){this.#n.renderCommandResult(e,t);return}this.#n.renderNotice?.(e)}}async#Se(e,t){let n=this.#S;if(n===void 0)return{message:`/${e.name} is not available in this session.`};let r=this.#V?.agent.model.endpoint,i={...t,renderer:this.#n,settleOutcome:e=>this.#Te(e),chatGptAccountLabel:r?.kind===`chatgpt`&&r.state===`ready`?r.accountLabel:void 0,withExclusiveTerminal:this.#w},a=this.#z?.current(),o=a!==void 0&&Object.keys(a).length>0?{...i,disabledConnectionReasons:a}:i;return await n.handle(e,o)}#Ce(e,t,n){if(t!==`startup`)return;let r=this.#T?.current().connection.state,i=n===`error`||r===`auth-failed`||r===`unavailable`?`failed`:void 0,a=e.argument.length===0?``:` ${e.argument}`;this.#n.renderCommandInvocation?.(`/${e.name}${a}`,i)}async#we(e){if(e?.kind===`model-access-changed`){this.#R?.applyEffect({kind:`refresh-identity`}),this.#N=!0,await this.#Me(e);return}e!==void 0&&(this.#R?.applyEffect(e),this.#N=!0,this.#ye(this.#V))}async#Te(e){if(e.effect===void 0)return e;let t=e.effect.kind===`model-access-changed`&&e.effect.reload?setTimeout(()=>{this.#x&&this.#n.setStartupPhase?.(`updating`),this.#n.setupFlow?.setStatus(`Loading selected model…`)},150):void 0;try{await this.#we(e.effect);let{effect:t,...n}=e;return n}catch{return{tone:`error`,message:`Settings were saved, but the agent could not reload. Retry the command or restart eve dev.`}}finally{clearTimeout(t)}}async#Ee(e,t,n){let r=await this.#Se(e,{...n,title:t}),i=r===void 0?void 0:await this.#Te(r);return!(n.suppressSuccessfulTranscript===!0&&i?.tone!==`error`||n.suppressCancelledTranscript===!0&&i?.cancelled===!0)&&n.trigger!==`startup`&&this.#xe(i?.message,i?.tone),this.#Oe(),i}async#De(e){this.#y?.({flow:`onboarding`,step:`model_provider`});let t=await this.#Ee({type:`extension`,name:`login`,argument:``},e,{trigger:`startup`,initialModelStep:`provider`});return!t?.cancelled&&t?.tone!==`error`&&this.#y?.({flow:`onboarding`,step:`connection_ready`}),this.#b?.({flow:`onboarding`,step:`model_provider`,result:t?.cancelled?`cancelled`:t?.tone===`error`?`error`:`completed`}),t}#Oe(){if(this.#x)return;let e=this.#T?.current().connection;e?.state===`ready`&&e.info!==this.#V&&(this.#V=e.info,this.#f!==void 0&&this.#n.renderAgentHeader?.({info:e.info,name:this.#r,serverUrl:this.#f}))}async#ke(e){if(this.#p===void 0||this.#n.traceViewer===void 0){this.#xe(`/traces is only available in local dev sessions.`);return}try{await this.#n.traceViewer.open({appRoot:this.#p,sessionId:this.#e?.state.sessionId,reference:e===``?void 0:e})}catch(e){if(isInterruptedError(e))return;throw e}}async#Ae(){let e=this.#p;if(e===void 0){this.#xe(`/info is only available in local dev sessions.`);return}try{this.#xe(renderApplicationInfo(await this.#k(e)))}catch(e){this.#xe(`Couldn't inspect the application: ${toErrorMessage(e)}`,`error`)}}#je(e){let t=this.#n;if(t.logDisplayMode===void 0||t.setLogDisplayMode===void 0)return`/loglevel is not available in this session.`;if(e===``)return`Logs: ${t.logDisplayMode()}. Use /loglevel all|stderr|sandbox|none — logs stay buffered, so switching also hides or restores past lines.`;let n=parseLogDisplayMode(e);if(n===void 0)return`Unknown log level "${e}". Use all, stderr, sandbox, or none.`;if(n===t.logDisplayMode())return`Logs already set to ${n}.`;switch(t.setLogDisplayMode(n),n){case`none`:return`Logs hidden. Output stays buffered — /loglevel all restores it.`;case`stderr`:return`Showing stderr logs only.`;case`sandbox`:return`Showing sandbox logs only.`;case`all`:return`Showing all logs.`}}async#Me(e){let t=this.#p;t!==void 0&&(++this.#F,++this.#P,await loadDevelopmentEnvironmentFiles(t),e.reload&&await this.#d?.refreshAfterSourceChange({}),e.model&&this.#V?this.#te({...this.#V,agent:{...this.#V.agent,model:{...this.#V.agent.model,...e.model}}}):this.#te(this.#V),this.#I=[],this.#L=void 0,this.#_e(),this.#Ne())}async#Ne(e=!1){let t=this.#V,n=++this.#F,r=await this.#Pe();this.#j||n!==this.#F||r===void 0||(this.#te(r),e&&!this.#n.renderAgentHeader&&this.#n.renderNotice?.(formatAgentUpdateNotice(t,r)),this.#ye(this.#V))}async#Pe(){let e=this.#t;if(e===void 0)return;let t=await probeAgentInfo({client:e});return t.kind===`ready`?t.info:void 0}#Fe(){this.#Ne(!0)}#Ie(e){let t={name:e.data.name,description:e.data.description,state:`required`};e.data.authorization!==void 0&&(t.challenge=e.data.authorization),e.data.webhookUrl!==void 0&&(t.webhookUrl=e.data.webhookUrl),this.#J.set(e.data.name,t),this.#ze(t)}#Le(e){if(e.turnState?.boundaryEvent!==`session.waiting`)return!1;let t=!1;for(let e of this.#J.values())e.state===`required`&&e.webhookUrl!==void 0&&(e.state=`pending`,this.#Y.add(e.name),this.#ze(e),t=!0);return t&&this.#n.setConnectionAuthPendingCount?.(this.#Y.size),this.#Y.size>0}#Re(e){let t=this.#J.get(e.data.name)??{name:e.data.name,description:``,state:e.data.outcome};t.state=e.data.outcome,e.data.reason!==void 0&&(t.reason=e.data.reason),this.#J.set(e.data.name,t),this.#Y.delete(e.data.name),this.#ze(t),this.#n.setConnectionAuthPendingCount?.(this.#Y.size)}#ze(e){let t={name:e.name,description:e.description,state:e.state};e.challenge!==void 0&&(t.challenge=e.challenge),e.reason!==void 0&&(t.reason=e.reason),this.#n.upsertConnectionAuth?.(t)}};function createRenderer(e){return e.renderer?e.renderer:new TerminalRenderer({tools:e.tools,reasoning:e.reasoning,subagents:e.subagents,connectionAuth:e.connectionAuth,assistantResponseStats:e.assistantResponseStats,contextSize:e.contextSize,logs:e.logs,availablePromptCommands:e.availablePromptCommands,input:e.userInput,output:e.screen,diagnostics:e.diagnostics,onExitRequest:e.lifecycle?.requestStop})}function formatAgentUpdateNotice(e,t){let n=e?.agent.model.id,r=t?.agent.model.id;return n!==void 0&&r!==void 0&&n!==r?`Agent updated: Model ${n} -> ${r}`:`Agent updated.`}function registryHandoffAddress(e,t){if(e!==`selfmod__registry_add`||typeof t!=`object`||!t)return;let n=t;return n.status===`needs-terminal`&&typeof n.address==`string`?n.address:void 0}async function*eveEventsToTUIStream(e){let{events:t,pendingInputRequests:n,turnState:r,onSubagentCalled:i,onSubagentBackgrounded:a,onSubagentCompleted:o,onTurnCancelled:s,onConnectionAuthRequired:c,onConnectionAuthCompleted:l,onRegistryHandoff:u,onTerminalFailure:d,failureHintOverride:f}=e,p=new Map,m=new Map,h=new Map,g=createEventDeduper(),_=0,v=new Set,y=new Set,b=new Set,x=!1,S=!1,C;for await(let w of t)if(g.admit(w)&&!(S&&isPostTurnVisibleEvent(w)))switch(w.type){case`session.started`:case`message.received`:break;case`turn.started`:w.data.turnId!==r.turnId&&(S=!1),r.turnId=w.data.turnId,yield{type:`turn-start`,turnId:w.data.turnId};break;case`step.started`:_+=1,yield{type:`step-start`,modelId:w.data.modelId};break;case`step.completed`:{let e=w;C=e.data.usage,yield*closeOpenParts(p,`assistant-complete`,_),yield*closeOpenParts(m,`reasoning-complete`,_),yield{type:`step-finish`,usage:e.data.usage};break}case`message.appended`:{let t=w,n=textPartId(t.data.turnId,t.data.stepIndex),r=partStateFor(p,n);if(r.completed){if(_<=r.completedEpoch)break;r.generation+=1,r.text=``,r.completed=!1}let i=t.data.messageDelta;if(i.length===0)break;r.text+=i,i&&e.onAssistantResponse?.(),yield{type:`assistant-delta`,id:partGenerationId(n,r.generation),delta:i};break}case`message.completed`:{let t=textPartId(w.data.turnId,w.data.stepIndex),n=partStateFor(p,t),r=w.data.message;if(n.completed){if(r===null||_<=n.completedEpoch)break;n.generation+=1,n.text=r,n.completedEpoch=_,yield{type:`assistant-complete`,id:partGenerationId(t,n.generation),text:r};break}let i=partGenerationId(t,n.generation);if(r!==null){if(n.text.length===0)n.text=r,n.completed=!0,n.completedEpoch=_,yield{type:`assistant-complete`,id:i,text:r};else if(r.startsWith(n.text)){let t=r.slice(n.text.length);t.length>0&&(t&&e.onAssistantResponse?.(),yield{type:`assistant-delta`,id:i,delta:t}),n.text=r,n.completed=!0,n.completedEpoch=_,yield{type:`assistant-complete`,id:i}}else n.text=r,n.completed=!0,n.completedEpoch=_,yield{type:`assistant-complete`,id:i,text:r}}else n.text.length>0&&(n.completed=!0,n.completedEpoch=_,yield{type:`assistant-complete`,id:i});break}case`reasoning.appended`:{let e=w,t=reasoningPartId(e.data.turnId,e.data.stepIndex),n=partStateFor(m,t);if(n.completed){if(_<=n.completedEpoch)break;n.generation+=1,n.text=``,n.completed=!1}let r=e.data.reasoningDelta;if(r.length===0)break;n.text+=r,yield{type:`reasoning-delta`,id:partGenerationId(t,n.generation),delta:r};break}case`reasoning.completed`:{let e=reasoningPartId(w.data.turnId,w.data.stepIndex),t=partStateFor(m,e),n=w.data.reasoning;if(t.completed){if(n.length===0||_<=t.completedEpoch)break;t.generation+=1,t.text=n,t.completedEpoch=_;let r=partGenerationId(e,t.generation);yield{type:`reasoning-delta`,id:r,delta:n},yield{type:`reasoning-complete`,id:r};break}let r=partGenerationId(e,t.generation);if(t.text.length===0&&n.length>0)t.text=n,yield{type:`reasoning-delta`,id:r,delta:n};else if(n.length>0&&!n.startsWith(t.text)){yield{type:`reasoning-complete`,id:r},t.generation+=1,t.text=n,t.completed=!0,t.completedEpoch=_;let i=partGenerationId(e,t.generation);yield{type:`reasoning-delta`,id:i,delta:n},yield{type:`reasoning-complete`,id:i};break}t.completed=!0,t.completedEpoch=_,yield{type:`reasoning-complete`,id:r};break}case`actions.requested`:{let e=w.data.actions.filter(e=>e.kind===`tool-call`);if(e.length===0)break;for(let t of e)h.set(t.callId,t.toolName),!v.has(t.callId)&&(v.add(t.callId),yield{type:`tool-call`,toolCallId:t.callId,toolName:t.toolName,input:t.input});break}case`input.requested`:{let e=w.data.requests.filter(e=>e.action.kind===`tool-call`);if(e.length===0)break;for(let t of e){let e=t.action.callId;if(h.set(e,t.action.toolName),t.kind!==`session-limit`&&!v.has(e)&&(v.add(e),yield{type:`tool-call`,toolCallId:e,toolName:t.action.toolName,input:t.action.input}),!y.has(t.requestId)){if(y.add(t.requestId),n.set(t.requestId,t),t.kind!==`tool-approval`){upsertPendingQuestion(r,t);continue}upsertPendingApproval(r,t),yield{type:`tool-approval-request`,approvalId:t.requestId,toolCallId:e}}}break}case`action.result`:{let e=w;if(e.data.result.kind!==`tool-result`)break;let t=e.data.result.callId;if(!v.has(t))break;switch(e.data.status){case`completed`:{let n=e.data.result.output;yield{type:`tool-result`,toolCallId:t,output:n};let r=registryHandoffAddress(h.get(t),n);r!==void 0&&await u?.(r);break}case`failed`:yield{type:`tool-error`,toolCallId:t,errorText:formatActionResultError(e)};break;case`rejected`:yield{type:`tool-rejected`,toolCallId:t,reason:formatActionResultError(e)}}break}case`step.failed`:case`turn.failed`:{let e=toFailureEvent(w,b,f);e&&(yield e);break}case`session.failed`:{r.sawSessionFailure=!0,d?.(w);let e=toFailureEvent(w,b,f);e&&(yield e),r.boundaryEvent=w.type,yield*closeOpenParts(p,`assistant-complete`,_),yield*closeOpenParts(m,`reasoning-complete`,_),yield{type:`finish`,usage:C},x=!0;return}case`session.waiting`:case`session.completed`:r.boundaryEvent=w.type,yield*closeOpenParts(p,`assistant-complete`,_),yield*closeOpenParts(m,`reasoning-complete`,_),yield{type:`finish`,usage:C},x=!0;return;case`turn.completed`:S=!0,yield*closeOpenParts(p,`assistant-complete`,_),yield*closeOpenParts(m,`reasoning-complete`,_);break;case`turn.cancelled`:s?.(w.data.turnId),yield*closeOpenParts(p,`assistant-complete`,_),yield*closeOpenParts(m,`reasoning-complete`,_),yield{type:`turn-cancelled`};break;case`subagent.called`:i?.(w);break;case`subagent.started`:case`subagent.event`:break;case`subagent.completed`:{let e=w;e.data.backgroundTask===void 0?o?.(e.data.callId):a?.(e.data.callId);break}case`authorization.required`:c?.(w);break;case`authorization.completed`:l?.(w)}x||(yield*closeOpenParts(p,`assistant-complete`,_),yield*closeOpenParts(m,`reasoning-complete`,_),yield{type:`finish`,usage:C})}async function*errorOnlyTUIStream(e){yield{type:`error`,errorText:e.errorText},yield{type:`finish`}}function createTurnState(){return{aborted:!1,pendingApprovals:[],pendingQuestions:[],sawSessionFailure:!1}}function upsertPendingApproval(e,t){let n=toAgentTUIToolApprovalRequest(t),r=e.pendingApprovals.findIndex(e=>e.approvalId===n.approvalId);r===-1?e.pendingApprovals.push(n):e.pendingApprovals[r]=n}function toAgentTUIToolApprovalRequest(e){return{approvalId:e.requestId,toolCallId:e.action.callId,toolName:e.action.toolName,input:e.action.input}}function upsertPendingQuestion(e,t){let n=e.pendingQuestions.findIndex(e=>e.requestId===t.requestId);n===-1?e.pendingQuestions.push(t):e.pendingQuestions[n]=t}function textPartId(e,t){return`text:${e}:${t}`}function reasoningPartId(e,t){return`reasoning:${e}:${t}`}function partStateFor(e,t){let n=e.get(t);return n===void 0&&(n={generation:0,text:``,completed:!1,completedEpoch:0},e.set(t,n)),n}function partGenerationId(e,t){return t===0?e:`${e}#${t}`}function*closeOpenParts(e,t,n){for(let[r,i]of e)i.completed||i.text.length===0||(i.completed=!0,i.completedEpoch=n,yield{type:t,id:partGenerationId(r,i.generation)})}function isPostTurnVisibleEvent(e){switch(e.type){case`actions.requested`:case`authorization.completed`:case`authorization.required`:case`input.requested`:case`message.appended`:case`message.completed`:case`reasoning.appended`:case`reasoning.completed`:case`result.completed`:case`step.completed`:case`step.failed`:case`step.started`:case`subagent.called`:case`subagent.completed`:case`subagent.event`:case`subagent.started`:case`turn.completed`:case`turn.failed`:return!0;default:return!1}}function formatActionResultError(e){if(e.data.error?.message)return e.data.error.message;let t=e.data.result.output;if(typeof t==`string`)return t;try{return JSON.stringify(t)}catch{return`Tool execution failed.`}}function toFailureEvent(e,t,n){let r=failureKey(e);if(t.has(r))return;t.add(r);let i={type:`error`,errorText:formatFailureMessage(e)},a=n?.(e)??formatFailureHint(e);a!==void 0&&(i.hint=a);let o=formatFailureDetail(e);return o!==void 0&&(i.detail=o),i}function toAgentTUIInputQuestion(e){let t=e.display===`text`?`text`:e.display===`select`||e.options!==void 0&&e.options.length>0?`select`:`text`,n={requestId:e.requestId,prompt:e.prompt,display:t};return e.options!==void 0&&(n.options=e.options.map(e=>{let t={id:e.id,label:e.label};return e.description!==void 0&&(t.description=e.description),e.style!==void 0&&(t.style=e.style),t})),e.allowFreeform!==void 0&&(n.allowFreeform=e.allowFreeform),n}export{EveTUIRunner,parsePromptCommand,registryHandoffAddress};
|
|
3
|
+
`)||void 0:t=this.#g,this.#x=!1,this.#ee(this.#B),this.#ge(),this.#n.setStartupPhase?.(void 0),(!o||s?.cancelled||s?.tone===`error`)&&this.#be(s?.message,s?.tone);;){if(this.#Z?.signal.aborted===!0||this.#n.exitRequested?.()===!0)return;let o=this.#U[0];if(o!==void 0&&n===void 0&&this.#H===void 0){this.#U.shift(),this.#W=o;try{await this.#me(o)}finally{this.#W=void 0}i=!1,a=!1,t=void 0;continue}if(!a){if(t==null){if(!this.#n.readPrompt){if(r)return;throw Error(`No prompt was provided and the renderer does not support prompt input.`)}let n={title:e};c!==void 0&&(n.initialDraft=c,c=void 0);try{this.#G=!0,t=await this.#se(n)}catch(e){if(isInterruptedError(e)){if(this.#H===void 0&&this.#U.length===0)return;a=!0,t=``}else throw e}finally{this.#G=!1}if(this.#U.length>0&&this.#H===void 0){t=void 0;continue}if(t==null&&this.#H===void 0)return}let o=this.#H===void 0?parsePromptCommand(t):null;if(o?.type===`exit`){this.#Z?.requestStop();return}if(o?.type===`cancel`){if(this.#e===void 0){this.#be(`No active turn to cancel.`),n=void 0,i=!1,a=!1,t=void 0;continue}try{let e=await this.#e.cancel();if(this.#be(e.status===`accepted`?`Turn cancellation requested.`:`No active turn to cancel.`),e.status===`no_active_turn`){n=void 0,i=!1,a=!1,t=void 0;continue}}catch(e){this.#be(`Couldn't cancel the turn: ${toErrorMessage(e)}`),n=void 0,i=!1,a=!1,t=void 0;continue}n=void 0,i=!0,a=!1,t=void 0}if(o?.type===`reset`){if(!await this.#ae()){n=void 0,a=!1,t=void 0;continue}n=void 0,a=!1,t=void 0;continue}if(o?.type===`compact`){if(this.#e===void 0){this.#be(`No active session to compact.`),n=void 0,i=!1,a=!1,t=void 0;continue}try{let e=await this.#e.compact();if(this.#be(e.status===`accepted`?`Compaction requested.`:`No active session to compact.`),e.status===`no_active_session`){n=void 0,i=!1,a=!1,t=void 0;continue}}catch(e){this.#be(`Couldn't compact the session: ${toErrorMessage(e)}`),n=void 0,i=!1,a=!1,t=void 0;continue}n=void 0,i=!0,a=!1,t=void 0}if(o?.type===`clear`){if(this.#e===void 0){this.#be(`No active session to clear.`),n=void 0,i=!1,a=!1,t=void 0;continue}try{let e=await this.#e.clear();if(this.#be(e.status===`accepted`?`Context clear requested.`:`No active session to clear.`),e.status===`no_active_session`){n=void 0,i=!1,a=!1,t=void 0;continue}}catch(e){this.#be(`Couldn't clear the session: ${toErrorMessage(e)}`),n=void 0,i=!1,a=!1,t=void 0;continue}n=void 0,i=!0,a=!1,t=void 0}if(o?.type===`help`){this.#be(formatPromptCommandHelp(this.#C)),n=void 0,a=!1,t=void 0;continue}if(o?.type===`info`){await this.#Oe(),n=void 0,a=!1,t=void 0;continue}if(o?.type===`loglevel`){this.#be(this.#ke(o.argument)),n=void 0,a=!1,t=void 0;continue}if(o?.type===`traces`){await this.#De(o.argument),n=void 0,a=!1,t=void 0;continue}if(o?.type===`extension`){try{await this.#we(o,e,{trigger:`command`})}catch(e){if(isInterruptedError(e))return;throw e}n=void 0,t=void 0,a=!1;continue}r=!0}let s=this.#H;this.#H=void 0;let l=s??(i?this.#de():await(async()=>(this.#ie(),await this.#le({prompt:a?void 0:t,inputResponses:n})))()),u=this.#e?.state.sessionId;u!==void 0&&this.#n.setSessionId?.(u);let d=t,f=!1;try{for(;;){await this.#n.renderStream(l,{title:e,submittedPrompt:d,continueSession:!!this.#n.readPrompt,tools:this.#i,reasoning:this.#a,subagents:this.#o,connectionAuth:this.#s,assistantResponseStats:this.#c,contextSize:this.#l});let r=l.turnState?.pendingApprovals??[],i=l.turnState?.pendingQuestions??[];if(r.length>0||i.length>0){let o=[];if(r.length>0){if(!this.#n.readToolApproval)throw Error(`Tool approval was requested, but the renderer does not support tool approval input.`);for(let t of r){let n=await this.#n.readToolApproval(t,{title:e});o.push({requestId:t.approvalId,optionId:n.approved?`approve`:`cancel`}),this.#V.delete(t.approvalId)}}if(i.length>0){if(!this.#n.readInputQuestion)throw Error(`An interactive question was requested, but the renderer does not support input questions.`);for(let t of i){let n=toAgentTUIInputQuestion(t),r=await this.#n.readInputQuestion(n,{title:e});if(r===void 0)continue;let i={requestId:t.requestId};r.optionId!==void 0&&(i.optionId=r.optionId),r.text!==void 0&&(i.text=r.text),o.push(i),this.#V.delete(t.requestId)}}if(o.length===0)break;a=!0,n=o,t=void 0,f=!0;break}if(this.#Fe(l)){l=this.#de(),d=void 0;continue}if(l.turnState&&l.turnState.boundaryEvent===void 0&&!l.turnState.aborted){let e=this.#e?.state.sessionId;this.#n.renderNotice?.(e?`Lost the event stream — the turn may still be running on the server (session ${e}). Your next message resumes this session; use /cancel to stop the turn.`:`Lost the connection to the running turn.`)}break}}catch(e){if(isInterruptedError(e))return;throw e}if(f)continue;i=!1,a=!1,n=void 0,t=void 0;let p=l.turnState?.boundaryEvent;this.#Y!==this.#e&&(p===`session.waiting`||p===`session.completed`)&&(t=this.#n.takeQueuedPrompt?.()),this.#ie(l.turnState?.aborted===!0)}}#re(){this.#K.abortAll(),this.#V.clear(),this.#q.clear(),this.#J.clear(),this.#n.setConnectionAuthPendingCount?.(0),this.#e=void 0,this.#d?.clear()}#ie(e=!1){let t=this.#Y;t!==void 0&&(this.#Y=void 0,this.#e===t&&(this.#re(),e?this.#n.renderNotice?.(`Stopped following the turn and started a new session. Earlier context was cleared; the interrupted turn may still be running on the server.`):this.#n.renderSessionBoundary===void 0?this.#n.renderNotice?.(`Session ended — started a new session. Earlier context was cleared.`):this.#n.renderSessionBoundary()))}async#ae(){if(this.#e===void 0)return this.#re(),this.#n.reset?.(),!0;try{await this.#e.reset()}catch(e){return this.#n.renderNotice?.(`Couldn't reset the session: ${toErrorMessage(e)}`),!1}return this.#re(),this.#n.reset?.(),!0}async#oe(e){if(!this.#n.readPrompt)return;let t=this.#n.readPrompt(e),n=this.#d;if(n===void 0)return await t;let r=!1,i=!1,a,o=!1,s=0,refresh=async()=>{if(!(r||i)){i=!0;try{await n.refreshIdle({onRuntimeArtifactsChanged:()=>this.#Ne()}),this.#p!==void 0&&this.#B===void 0&&!o&&(o=!0,this.#je().finally(()=>{o=!1}));let e=this.#B?.agent.model.endpoint,t=e?.kind===`chatgpt`&&(e.state===`signed-out`||e.state===`reauth-required`),r=Date.now();t&&r-s>=5e3&&(s=r,this.#je())}finally{i=!1}}},startRefresh=()=>{if(r||i)return;let e=refresh().finally(()=>{a===e&&(a=void 0)});a=e};startRefresh();let c=setInterval(()=>{startRefresh()},500);c.unref?.();try{return await t}finally{r=!0,clearInterval(c),await a}}async#se(e){let t=this.#oe(e);if(this.#n.renderIdleStream===void 0||this.#e?.state.sessionId===void 0)return await t;let n=new AbortController,r=this.#ce(n.signal,e).catch(e=>{n.signal.aborted||this.#n.renderNotice?.(`Stopped following session updates: ${toErrorMessage(e)}`)});try{return await t}finally{n.abort(),await r}}async#ce(e,t){let n=this.#e;if(n===void 0)return;let r=100;for(;!e.aborted;){let i=n.stream({signal:e})[Symbol.asyncIterator](),a=!1;try{for(;!e.aborted;){let r=!1,o={async*[Symbol.asyncIterator](){for(;!e.aborted;){let e=await i.next();if(e.done===!0||(r=!0,a=!0,yield e.value,isCurrentTurnBoundaryEvent(e.value)))return}}},s=this.#fe(o,()=>{},n);if(await this.#n.renderIdleStream(s,{...t,continueSession:!0}),this.#Fe(s),(s.turnState?.pendingApprovals.length??0)>0||(s.turnState?.pendingQuestions.length??0)>0){this.#H={events:(async function*(){})(),turnState:s.turnState},this.#n.suspendPromptForInput?.();return}if(s.turnState?.boundaryEvent===`session.completed`||s.turnState?.boundaryEvent===`session.failed`)return;if(!r)break}}finally{await i.return?.()}r=a?100:Math.min(r*2,2e3),e.aborted||await abortableDelay(r,e)}}async#le(e){let t=new AbortController,n={signal:t.signal};e.prompt!==void 0&&(n.message=e.prompt),e.inputResponses!==void 0&&e.inputResponses.length>0&&(n.inputResponses=e.inputResponses);let r,i=this.#e;try{if(this.#d!==void 0&&await this.#d.refresh({inputResponses:n.inputResponses,message:n.message,onRuntimeArtifactsChanged:()=>this.#Ne()}),n.message!==void 0&&(n.inputResponses?.length??0)===0&&this.#n.flushDelayedDevBuildErrors?.(),this.#e===void 0){if(this.#t===void 0)throw Error(`Cannot create a session without an eve client.`);if(n.message===void 0)throw Error(`Cannot answer an input request before the session starts.`);let e=await this.#t.sessions.create({...n,message:n.message});this.#e=e.session,r=e.response}else r=n.inputResponses===void 0?await this.#e.send(n.message,{signal:n.signal,turnPolicy:`queue`}):await this.#e.respond(n.inputResponses,{signal:n.signal})}catch(e){if(isInterruptedError(e))throw e;return this.#T?.reportFailure(e),this.#Y=i,{events:errorOnlyTUIStream({errorText:this.#u(e)}),turnState:createTurnState()}}return this.#fe(r,()=>t.abort(),this.#e)}async#ue(e,t){if(e.cancelInFlight!==!0){e.cancelInFlight=!0;try{for(let n=0;n<8;n+=1){if(e.boundaryEvent!==void 0||e.aborted===!0)return;let n=e.turnId;try{if((await t?.cancel(n===void 0?void 0:{turnId:n}))?.status===`accepted`)return}catch{}await delayMs(250)}}finally{e.cancelInFlight=!1}}}#de(){if(this.#e===void 0)throw Error(`Cannot stream a session before its first turn is accepted.`);let e=new AbortController,t=this.#e;return this.#fe(t.stream({signal:e.signal}),()=>e.abort(),t)}#fe(e,t,n){let r=createTurnState(),i=n===void 0?void 0:new SteeringStream(e,n);return{steer:i===void 0?void 0:e=>i.send(e),abort:()=>{r.aborted=!0,this.#Y=n,i?.abort(),t()},cancel:()=>{this.#ue(r,n)},events:eveEventsToTUIStream({onAssistantResponse:()=>{this.#_&&!this.#v&&(this.#v=!0,this.#y?.({flow:`onboarding`,step:`first_response`}))},events:i??e,pendingInputRequests:this.#V,turnState:r,onSubagentCalled:e=>this.#K.begin(e),onSubagentBackgrounded:e=>this.#K.background(e),onSubagentCompleted:e=>this.#K.settle(e),onTurnCancelled:e=>this.#K.settleCancelledTurn(e),onConnectionAuthRequired:e=>this.#Pe(e),onConnectionAuthCompleted:e=>this.#Ie(e),onRegistryHandoff:this.#p===void 0?void 0:async e=>this.#pe(e),onTerminalFailure:()=>{this.#Y=n},failureHintOverride:this.#p===void 0?void 0:localFailureHint}),turnState:r}}#pe(e){this.#W===e||this.#U.includes(e)||(this.#U.push(e),this.#G&&this.#n.suspendPromptForInput?.())}async#me(e){await this.#we({type:`extension`,name:`add`,argument:e},`Add to your agent`,{trigger:`command`})}async#he(e){if(this.#p===void 0)return;let t={appRoot:this.#p,env:process.env};e!==void 0&&(t.info=e),this.#I=await detectSetupIssues(t,this.#D),this.#n.renderSetupWarning!==void 0&&(this.#ge(),this.#_e())}#ge(){if(this.#x)return;let e=orderedSetupIssues(this.#I,this.#L);e.length>0?this.#n.renderSetupWarning?.(formatSetupIssuesLine(e)):this.#n.clearSetupWarning?.()}async#_e(){let e=this.#p;if(e===void 0||process.env.EVE_MODEL_CONNECTION!==`ai-gateway-project`)return;let t;try{t=await this.#O(e,{signal:this.#M.signal})}catch{return}this.#j||this.#N||(this.#L=authIssueForStatus(t),this.#ge())}async#ve(e){let t=this.#p;if(t===void 0||this.#n.renderSetupWarning===void 0)return;let n=++this.#P,r={appRoot:t,env:process.env};e!==void 0&&(r.info=e);try{let[e,i]=await Promise.all([detectSetupIssues(r,this.#D),process.env.EVE_MODEL_CONNECTION===`ai-gateway-project`?this.#O(t,{signal:this.#M.signal}):void 0]);if(this.#j||n!==this.#P)return;this.#I=e,this.#L=i===void 0?void 0:authIssueForStatus(i),this.#ge()}catch{return}}#ye(){this.#p!==void 0&&this.#n.renderSandboxLog!==void 0&&this.#X===void 0&&(this.#X=subscribeDevelopmentSandboxPrewarmLogs({appRoot:this.#p,log:e=>this.#n.renderSandboxLog?.(e)}))}#be(e,t){if(e!==void 0){if(this.#n.renderCommandResult!==void 0){this.#n.renderCommandResult(e,t);return}this.#n.renderNotice?.(e)}}async#xe(e,t){let n=this.#S;if(n===void 0)return{message:`/${e.name} is not available in this session.`};let r=this.#B?.agent.model.endpoint,i={...t,renderer:this.#n,settleOutcome:e=>this.#Ce(e),chatGptAccountLabel:r?.kind===`chatgpt`&&r.state===`ready`?r.accountLabel:void 0,withExclusiveTerminal:this.#w},a=this.#z?.current(),o=a!==void 0&&Object.keys(a).length>0?{...i,disabledConnectionReasons:a}:i;return await n.handle(e,o)}async#Se(e){if(e?.kind===`model-access-changed`){this.#R?.applyEffect({kind:`refresh-identity`}),this.#N=!0,await this.#Ae(e);return}e!==void 0&&(this.#R?.applyEffect(e),this.#N=!0,this.#ve(this.#B))}async#Ce(e){if(e.effect===void 0)return e;let t=e.effect.kind===`model-access-changed`&&e.effect.reload?setTimeout(()=>{this.#x&&this.#n.setStartupPhase?.(`updating`),this.#n.setupFlow?.setStatus(`Loading selected model…`)},150):void 0;try{await this.#Se(e.effect);let{effect:t,...n}=e;return n}catch{return{tone:`error`,message:`Settings were saved, but the agent could not reload. Retry the command or restart eve dev.`}}finally{clearTimeout(t)}}async#we(e,t,n){let r=await this.#xe(e,{...n,title:t}),i=r===void 0?void 0:await this.#Ce(r);return!(n.suppressSuccessfulTranscript===!0&&i?.tone!==`error`||n.suppressCancelledTranscript===!0&&i?.cancelled===!0)&&n.trigger!==`startup`&&this.#be(i?.message,i?.tone),this.#Ee(),i}async#Te(e){this.#y?.({flow:`onboarding`,step:`model_provider`});let t=await this.#we({type:`extension`,name:`login`,argument:``},e,{trigger:`startup`,initialModelStep:`provider`});return!t?.cancelled&&t?.tone!==`error`&&this.#y?.({flow:`onboarding`,step:`connection_ready`}),this.#b?.({flow:`onboarding`,step:`model_provider`,result:t?.cancelled?`cancelled`:t?.tone===`error`?`error`:`completed`}),t}#Ee(){if(this.#x)return;let e=this.#T?.current().connection;e?.state===`ready`&&e.info!==this.#B&&(this.#B=e.info,this.#f!==void 0&&this.#n.renderAgentHeader?.({info:e.info,name:this.#r,serverUrl:this.#f}))}async#De(e){if(this.#p===void 0||this.#n.traceViewer===void 0){this.#be(`/traces is only available in local dev sessions.`);return}try{await this.#n.traceViewer.open({appRoot:this.#p,sessionId:this.#e?.state.sessionId,reference:e===``?void 0:e})}catch(e){if(isInterruptedError(e))return;throw e}}async#Oe(){let e=this.#p;if(e===void 0){this.#be(`/info is only available in local dev sessions.`);return}try{this.#be(renderApplicationInfo(await this.#k(e)))}catch(e){this.#be(`Couldn't inspect the application: ${toErrorMessage(e)}`,`error`)}}#ke(e){let t=this.#n;if(t.logDisplayMode===void 0||t.setLogDisplayMode===void 0)return`/loglevel is not available in this session.`;if(e===``)return`Logs: ${t.logDisplayMode()}. Use /loglevel all|stderr|sandbox|none — logs stay buffered, so switching also hides or restores past lines.`;let n=parseLogDisplayMode(e);if(n===void 0)return`Unknown log level "${e}". Use all, stderr, sandbox, or none.`;if(n===t.logDisplayMode())return`Logs already set to ${n}.`;switch(t.setLogDisplayMode(n),n){case`none`:return`Logs hidden. Output stays buffered — /loglevel all restores it.`;case`stderr`:return`Showing stderr logs only.`;case`sandbox`:return`Showing sandbox logs only.`;case`all`:return`Showing all logs.`}}async#Ae(e){let t=this.#p;t!==void 0&&(++this.#F,++this.#P,await loadDevelopmentEnvironmentFiles(t),e.reload&&await this.#d?.refreshAfterSourceChange({}),e.model&&this.#B?this.#ee({...this.#B,agent:{...this.#B.agent,model:{...this.#B.agent.model,...e.model}}}):this.#ee(this.#B),this.#I=[],this.#L=void 0,this.#ge(),this.#je())}async#je(e=!1){let t=this.#B,n=++this.#F,r=await this.#Me();this.#j||n!==this.#F||r===void 0||(this.#ee(r),e&&!this.#n.renderAgentHeader&&this.#n.renderNotice?.(formatAgentUpdateNotice(t,r)),this.#ve(this.#B))}async#Me(){let e=this.#t;if(e===void 0)return;let t=await probeAgentInfo({client:e});return t.kind===`ready`?t.info:void 0}#Ne(){this.#je(!0)}#Pe(e){let t={name:e.data.name,description:e.data.description,state:`required`};e.data.authorization!==void 0&&(t.challenge=e.data.authorization),e.data.webhookUrl!==void 0&&(t.webhookUrl=e.data.webhookUrl),this.#q.set(e.data.name,t),this.#Le(t)}#Fe(e){if(e.turnState?.boundaryEvent!==`session.waiting`)return!1;let t=!1;for(let e of this.#q.values())e.state===`required`&&e.webhookUrl!==void 0&&(e.state=`pending`,this.#J.add(e.name),this.#Le(e),t=!0);return t&&this.#n.setConnectionAuthPendingCount?.(this.#J.size),this.#J.size>0}#Ie(e){let t=this.#q.get(e.data.name)??{name:e.data.name,description:``,state:e.data.outcome};t.state=e.data.outcome,e.data.reason!==void 0&&(t.reason=e.data.reason),this.#q.set(e.data.name,t),this.#J.delete(e.data.name),this.#Le(t),this.#n.setConnectionAuthPendingCount?.(this.#J.size)}#Le(e){let t={name:e.name,description:e.description,state:e.state};e.challenge!==void 0&&(t.challenge=e.challenge),e.reason!==void 0&&(t.reason=e.reason),this.#n.upsertConnectionAuth?.(t)}};function createRenderer(e){return e.renderer?e.renderer:new TerminalRenderer({tools:e.tools,reasoning:e.reasoning,subagents:e.subagents,connectionAuth:e.connectionAuth,assistantResponseStats:e.assistantResponseStats,contextSize:e.contextSize,logs:e.logs,availablePromptCommands:e.availablePromptCommands,input:e.userInput,output:e.screen,diagnostics:e.diagnostics,onExitRequest:e.lifecycle?.requestStop})}function formatAgentUpdateNotice(e,t){let n=e?.agent.model.id,r=t?.agent.model.id;return n!==void 0&&r!==void 0&&n!==r?`Agent updated: Model ${n} -> ${r}`:`Agent updated.`}function registryHandoffAddress(e,t,n){if((e!==`self-modification__agent`||t!==`registry_add`)&&(e!==void 0||t!==`selfmod__registry_add`)||typeof n!=`object`||!n)return;let r=n;return r.status===`needs-terminal`&&typeof r.address==`string`?r.address:void 0}async function*eveEventsToTUIStream(e){let{events:t,pendingInputRequests:n,turnState:r,onSubagentCalled:i,onSubagentBackgrounded:a,onSubagentCompleted:o,onTurnCancelled:s,onConnectionAuthRequired:c,onConnectionAuthCompleted:l,onRegistryHandoff:u,onTerminalFailure:d,failureHintOverride:f}=e,p=new Map,m=new Map,h=new Map,g=createEventDeduper(),_=0,v=new Set,y=new Set,b=new Set,x=!1,S=!1,C;for await(let w of t)if(g.admit(w)&&!(S&&isPostTurnVisibleEvent(w)))switch(w.type){case`session.started`:case`message.received`:break;case`turn.started`:w.data.turnId!==r.turnId&&(S=!1),r.turnId=w.data.turnId,yield{type:`turn-start`,turnId:w.data.turnId};break;case`step.started`:_+=1,yield{type:`step-start`,modelId:w.data.modelId};break;case`step.completed`:{let e=w;C=e.data.usage,yield*closeOpenParts(p,`assistant-complete`,_),yield*closeOpenParts(m,`reasoning-complete`,_),yield{type:`step-finish`,usage:e.data.usage};break}case`message.appended`:{let t=w,n=textPartId(t.data.turnId,t.data.stepIndex),r=partStateFor(p,n);if(r.completed){if(_<=r.completedEpoch)break;r.generation+=1,r.text=``,r.completed=!1}let i=t.data.messageDelta;if(i.length===0)break;r.text+=i,i&&e.onAssistantResponse?.(),yield{type:`assistant-delta`,id:partGenerationId(n,r.generation),delta:i};break}case`message.completed`:{let t=textPartId(w.data.turnId,w.data.stepIndex),n=partStateFor(p,t),r=w.data.message;if(n.completed){if(r===null||_<=n.completedEpoch)break;n.generation+=1,n.text=r,n.completedEpoch=_,yield{type:`assistant-complete`,id:partGenerationId(t,n.generation),text:r};break}let i=partGenerationId(t,n.generation);if(r!==null){if(n.text.length===0)n.text=r,n.completed=!0,n.completedEpoch=_,yield{type:`assistant-complete`,id:i,text:r};else if(r.startsWith(n.text)){let t=r.slice(n.text.length);t.length>0&&(t&&e.onAssistantResponse?.(),yield{type:`assistant-delta`,id:i,delta:t}),n.text=r,n.completed=!0,n.completedEpoch=_,yield{type:`assistant-complete`,id:i}}else n.text=r,n.completed=!0,n.completedEpoch=_,yield{type:`assistant-complete`,id:i,text:r}}else n.text.length>0&&(n.completed=!0,n.completedEpoch=_,yield{type:`assistant-complete`,id:i});break}case`reasoning.appended`:{let e=w,t=reasoningPartId(e.data.turnId,e.data.stepIndex),n=partStateFor(m,t);if(n.completed){if(_<=n.completedEpoch)break;n.generation+=1,n.text=``,n.completed=!1}let r=e.data.reasoningDelta;if(r.length===0)break;n.text+=r,yield{type:`reasoning-delta`,id:partGenerationId(t,n.generation),delta:r};break}case`reasoning.completed`:{let e=reasoningPartId(w.data.turnId,w.data.stepIndex),t=partStateFor(m,e),n=w.data.reasoning;if(t.completed){if(n.length===0||_<=t.completedEpoch)break;t.generation+=1,t.text=n,t.completedEpoch=_;let r=partGenerationId(e,t.generation);yield{type:`reasoning-delta`,id:r,delta:n},yield{type:`reasoning-complete`,id:r};break}let r=partGenerationId(e,t.generation);if(t.text.length===0&&n.length>0)t.text=n,yield{type:`reasoning-delta`,id:r,delta:n};else if(n.length>0&&!n.startsWith(t.text)){yield{type:`reasoning-complete`,id:r},t.generation+=1,t.text=n,t.completed=!0,t.completedEpoch=_;let i=partGenerationId(e,t.generation);yield{type:`reasoning-delta`,id:i,delta:n},yield{type:`reasoning-complete`,id:i};break}t.completed=!0,t.completedEpoch=_,yield{type:`reasoning-complete`,id:r};break}case`actions.requested`:{let e=w.data.actions.filter(e=>e.kind===`tool-call`);if(e.length===0)break;for(let t of e)h.set(t.callId,t.toolName),!v.has(t.callId)&&(v.add(t.callId),yield{type:`tool-call`,toolCallId:t.callId,toolName:t.toolName,input:t.input});break}case`input.requested`:{let e=w.data.requests.filter(e=>e.action.kind===`tool-call`);if(e.length===0)break;for(let t of e){let e=t.action.callId;if(h.set(e,t.action.toolName),t.kind!==`session-limit`&&!v.has(e)&&(v.add(e),yield{type:`tool-call`,toolCallId:e,toolName:t.action.toolName,input:t.action.input}),!y.has(t.requestId)){if(y.add(t.requestId),n.set(t.requestId,t),t.kind!==`tool-approval`){upsertPendingQuestion(r,t);continue}upsertPendingApproval(r,t),yield{type:`tool-approval-request`,approvalId:t.requestId,toolCallId:e}}}break}case`action.result`:{let e=w;if(e.data.result.kind!==`tool-result`)break;let t=e.data.result.callId;if(!v.has(t))break;switch(e.data.status){case`completed`:{let n=e.data.result.output;yield{type:`tool-result`,toolCallId:t,output:n};let r=registryHandoffAddress(void 0,h.get(t),n);r!==void 0&&await u?.(r);break}case`failed`:yield{type:`tool-error`,toolCallId:t,errorText:formatActionResultError(e)};break;case`rejected`:yield{type:`tool-rejected`,toolCallId:t,reason:formatActionResultError(e)}}break}case`step.failed`:case`turn.failed`:{let e=toFailureEvent(w,b,f);e&&(yield e);break}case`session.failed`:{r.sawSessionFailure=!0,d?.(w);let e=toFailureEvent(w,b,f);e&&(yield e),r.boundaryEvent=w.type,yield*closeOpenParts(p,`assistant-complete`,_),yield*closeOpenParts(m,`reasoning-complete`,_),yield{type:`finish`,usage:C},x=!0;return}case`session.waiting`:case`session.completed`:r.boundaryEvent=w.type,yield*closeOpenParts(p,`assistant-complete`,_),yield*closeOpenParts(m,`reasoning-complete`,_),yield{type:`finish`,usage:C},x=!0;return;case`turn.completed`:S=!0,yield*closeOpenParts(p,`assistant-complete`,_),yield*closeOpenParts(m,`reasoning-complete`,_);break;case`turn.cancelled`:s?.(w.data.turnId),yield*closeOpenParts(p,`assistant-complete`,_),yield*closeOpenParts(m,`reasoning-complete`,_),yield{type:`turn-cancelled`};break;case`subagent.called`:i?.(w);break;case`subagent.started`:case`subagent.event`:break;case`subagent.completed`:{let e=w;e.data.backgroundTask===void 0?o?.(e.data.callId):a?.(e.data.callId);break}case`authorization.required`:c?.(w);break;case`authorization.completed`:l?.(w)}x||(yield*closeOpenParts(p,`assistant-complete`,_),yield*closeOpenParts(m,`reasoning-complete`,_),yield{type:`finish`,usage:C})}async function*errorOnlyTUIStream(e){yield{type:`error`,errorText:e.errorText},yield{type:`finish`}}function createTurnState(){return{aborted:!1,pendingApprovals:[],pendingQuestions:[],sawSessionFailure:!1}}function upsertPendingApproval(e,t){let n=toAgentTUIToolApprovalRequest(t),r=e.pendingApprovals.findIndex(e=>e.approvalId===n.approvalId);r===-1?e.pendingApprovals.push(n):e.pendingApprovals[r]=n}function toAgentTUIToolApprovalRequest(e){return{approvalId:e.requestId,toolCallId:e.action.callId,toolName:e.action.toolName,input:e.action.input}}function upsertPendingQuestion(e,t){let n=e.pendingQuestions.findIndex(e=>e.requestId===t.requestId);n===-1?e.pendingQuestions.push(t):e.pendingQuestions[n]=t}function textPartId(e,t){return`text:${e}:${t}`}function reasoningPartId(e,t){return`reasoning:${e}:${t}`}function partStateFor(e,t){let n=e.get(t);return n===void 0&&(n={generation:0,text:``,completed:!1,completedEpoch:0},e.set(t,n)),n}function partGenerationId(e,t){return t===0?e:`${e}#${t}`}function*closeOpenParts(e,t,n){for(let[r,i]of e)i.completed||i.text.length===0||(i.completed=!0,i.completedEpoch=n,yield{type:t,id:partGenerationId(r,i.generation)})}function isPostTurnVisibleEvent(e){switch(e.type){case`actions.requested`:case`authorization.completed`:case`authorization.required`:case`input.requested`:case`message.appended`:case`message.completed`:case`reasoning.appended`:case`reasoning.completed`:case`result.completed`:case`step.completed`:case`step.failed`:case`step.started`:case`subagent.called`:case`subagent.completed`:case`subagent.event`:case`subagent.started`:case`turn.completed`:case`turn.failed`:return!0;default:return!1}}function formatActionResultError(e){if(e.data.error?.message)return e.data.error.message;let t=e.data.result.output;if(typeof t==`string`)return t;try{return JSON.stringify(t)}catch{return`Tool execution failed.`}}function toFailureEvent(e,t,n){let r=failureKey(e);if(t.has(r))return;t.add(r);let i={type:`error`,errorText:formatFailureMessage(e)},a=n?.(e)??formatFailureHint(e);a!==void 0&&(i.hint=a);let o=formatFailureDetail(e);return o!==void 0&&(i.detail=o),i}function toAgentTUIInputQuestion(e){let t=e.display===`text`?`text`:e.display===`select`||e.options!==void 0&&e.options.length>0?`select`:`text`,n={requestId:e.requestId,prompt:e.prompt,display:t};return e.options!==void 0&&(n.options=e.options.map(e=>{let t={id:e.id,label:e.label};return e.description!==void 0&&(t.description=e.description),e.style!==void 0&&(t.style=e.style),t})),e.allowFreeform!==void 0&&(n.allowFreeform=e.allowFreeform),n}export{EveTUIRunner,parsePromptCommand,registryHandoffAddress};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import{maskLine,visibleLine}from"./line-editor.js";import{modelEditorMenuRows,reasoningPositions}from"./model-editor.js";import{clipVisible,renderInputText,renderInputWithBlockCursor,visibleLength,wrapVisibleLine}from"#cli/ui/terminal-text.js";import{renderCursorRow,renderOptionRow,resolveOptionRowState}from"#setup/cli/option-row.js";import{filterOptions,submitRowIndex}from"#setup/cli/select-state.js";function clip(e,t){return clipVisible(e,t)}function questionFooter(e,t,n){let r=t.colors,i=e.join(` ${t.glyph.dot} `);return[``,...(n===void 0?[i]:wrapVisibleLine(i,Math.max(1,n-3))).map(e=>` ${r.dim(e)}`)]}function solidWithinDim(e,t){return t.color?`[22m${e}[2m`:e}function toneGlyph(e,t){let n=t.colors;switch(e){case`success`:return n.green(t.glyph.success);case`warning`:return n.yellow(t.glyph.warning);case`error`:return n.red(t.glyph.error);case`info`:return n.dim(t.glyph.dot)}}function renderIndicator(e,t){return e.color===`green`?t.colors.green(e.glyph):t.colors.yellow(e.glyph)}function renderStatusText(e,t){if(e.kind===`progress`)return t.colors.dim(e.text);let n=e.text.indexOf(e.emphasis);if(n===-1)return t.colors.dim(e.text);let r=n+e.emphasis.length;return`${t.colors.dim(e.text.slice(0,n))}${t.colors.yellow(e.text.slice(n,r))}${t.colors.dim(e.text.slice(r))}`}function renderFlowPanelStatus(e,t){return`${renderIndicator(e.indicator,t)} ${renderStatusText(e,t)}`}function flowMessageRows(e,t){let n=t.colors,r=[],i=e.slice(-6);for(let e of i){let i=e.text.split(`
|
|
2
2
|
`);for(let[a,o]of i.entries()){let i=e.tone===`info`?n.dim(o):o,s=a===0?`${toneGlyph(e.tone,t)} `:` `;r.push(` ${s}${i}`)}}return i.length>0&&r.push(``),r}function renderFlowPanel(e,t,n){let r=t.colors,i=[],a=e.content.kind===`question`?e.content.title??e.title:e.title;if(a.length>0){for(let e of a.split(`
|
|
3
|
-
`))i.push(e.
|
|
3
|
+
`)){if(e.length===0){i.push(``);continue}for(let t of wrapVisibleLine(e,Math.max(1,n-3)))i.push(` ${r.bold(t)}`)}i.push(``)}switch(e.navigation?.kind===`planner`&&i.push(...plannerStepRows(e.navigation,void 0,t)),i.push(...flowMessageRows(e.lines,t)),e.content.kind){case`question`:e.content.status!==void 0&&i.push(` ${renderFlowPanelStatus(e.content.status,t)}`,``),i.push(...e.content.rows);break;case`status`:if(i.push(` ${renderFlowPanelStatus(e.content.status,t)}`),e.content.preview!==void 0)for(let t of e.content.preview.split(`
|
|
4
4
|
`))i.push(` ${r.dim(t)}`);break;case`preview`:{let[n,...a]=e.content.text.split(`
|
|
5
|
-
`);i.push(` ${renderIndicator(e.content.indicator,t)} ${r.dim(n??``)}`);for(let e of a)i.push(` ${r.dim(e)}`);break}case`idle`:i.push(` ${renderIndicator(e.content.indicator,t)} ${r.dim(`Working…`)}`)}return i.map(e=>e.length===0?clip(e,n):clip(` ${e}`,n))}function optionRow(e){let{option:t,theme:n}=e,r=e.railed===!0;return renderOptionRow({colors:n.colors,glyphs:{pointer:n.glyph.pointer,selectedPointer:n.glyph.selectedPointer,success:n.glyph.success,placeholder:n.glyph.option,dot:r?``:n.glyph.dot,warning:n.glyph.warning},label:t.label,hint:t.hint,focusHint:t.focusHint,accent:t.accent,isCursor:e.isCursor,state:resolveOptionRowState(t,e.isChecked),placeholder:e.placeholder,hintPadding:e.hintPadding})}function selectPresentation(e){switch(e.kind){case`single`:return{selection:`single`,filter:void 0,layout:`plain`,edit:void 0};case`search`:return{selection:`single`,filter:{placeholder:e.placeholder},layout:e.layout??`plain`,edit:void 0};case`multi`:return{selection:`multiple`,filter:void 0,layout:`plain`,edit:void 0};case`searchable-multi`:return{selection:`multiple`,filter:{placeholder:e.placeholder},layout:e.layout??`plain`,edit:void 0};case`stacked`:return{selection:`single`,filter:void 0,layout:`stacked`,edit:void 0};case`task-list`:return{selection:`single`,filter:void 0,layout:`task-list`,edit:void 0};case`inline-edit`:return{selection:`single`,filter:void 0,layout:e.layout,edit:e.edit}}}function canNavigateBack(e){return e.activeStep>(e.firstNavigableStep??0)}function canNavigateForward(e){return e.activeStep>=(e.firstNavigableStep??0)&&e.activeStep<e.steps.length-1}function plannerStepRows(e,t,n){let r=e.steps.map((r,i)=>{let a=i===e.activeStep?t:r.count,o=a===void 0||a===0?``:` (${a})`,s=`${r.complete===!0?`${n.glyph.success} `:``}${r.label}${o}`;return i===e.activeStep?n.colors.bold(` ${s}`):r.complete===!0?n.colors.green(s):n.colors.dim(s)});return[` ${r.flatMap((t,i)=>{if(i===r.length-1)return[t];let a=e.activeStep===i&&canNavigateForward(e)?` → `:e.activeStep===i+1&&canNavigateBack(e)?` ← `:` · `;return[t,n.colors.dim(a)]}).join(``)}`,``]}function selectMessageRows(e,t,n){if(e===``)return[];let
|
|
6
|
-
`).
|
|
5
|
+
`);i.push(` ${renderIndicator(e.content.indicator,t)} ${r.dim(n??``)}`);for(let e of a)i.push(` ${r.dim(e)}`);break}case`idle`:i.push(` ${renderIndicator(e.content.indicator,t)} ${r.dim(`Working…`)}`)}return i.map(e=>e.length===0?clip(e,n):clip(` ${e}`,n))}function optionRow(e){let{option:t,theme:n}=e,r=e.railed===!0;return renderOptionRow({colors:n.colors,glyphs:{pointer:n.glyph.pointer,selectedPointer:n.glyph.selectedPointer,success:n.glyph.success,placeholder:n.glyph.option,dot:r?``:n.glyph.dot,warning:n.glyph.warning},label:t.label,hint:t.hint,focusHint:t.focusHint,accent:t.accent,isCursor:e.isCursor,state:resolveOptionRowState(t,e.isChecked),placeholder:e.placeholder,hintPadding:e.hintPadding})}function selectPresentation(e){switch(e.kind){case`single`:return{selection:`single`,filter:void 0,layout:`plain`,edit:void 0};case`search`:return{selection:`single`,filter:{placeholder:e.placeholder},layout:e.layout??`plain`,edit:void 0};case`multi`:return{selection:`multiple`,filter:void 0,layout:`plain`,edit:void 0};case`searchable-multi`:return{selection:`multiple`,filter:{placeholder:e.placeholder},layout:e.layout??`plain`,edit:void 0};case`stacked`:return{selection:`single`,filter:void 0,layout:`stacked`,edit:void 0};case`task-list`:return{selection:`single`,filter:void 0,layout:`task-list`,edit:void 0};case`inline-edit`:return{selection:`single`,filter:void 0,layout:e.layout,edit:e.edit}}}function canNavigateBack(e){return e.activeStep>(e.firstNavigableStep??0)}function canNavigateForward(e){return e.activeStep>=(e.firstNavigableStep??0)&&e.activeStep<e.steps.length-1}function plannerStepRows(e,t,n){let r=e.steps.map((r,i)=>{let a=i===e.activeStep?t:r.count,o=a===void 0||a===0?``:` (${a})`,s=`${r.complete===!0?`${n.glyph.success} `:``}${r.label}${o}`;return i===e.activeStep?n.colors.bold(` ${s}`):r.complete===!0?n.colors.green(s):n.colors.dim(s)});return[` ${r.flatMap((t,i)=>{if(i===r.length-1)return[t];let a=e.activeStep===i&&canNavigateForward(e)?` → `:e.activeStep===i+1&&canNavigateBack(e)?` ← `:` · `;return[t,n.colors.dim(a)]}).join(``)}`,``]}function selectMessageRows(e,t,n,r){if(e===``)return[];let i=e.split(`
|
|
6
|
+
`).flatMap((e,i)=>{let a=t===`stacked`||i>0;return wrapVisibleLine(e,Math.max(1,r-4)).map(e=>` ${a?n.colors.bold(e):e}`)});return i.push(``),i}function searchFilter(e,t,n,r,i){let a=r.colors.dim(r.glyph.caret),o=a;return i?o=e.length>0?e+a:r.colors.dim(t??`type to filter`):e.length>0?o=e+a:t!==void 0&&(o=r.colors.dim(`> ${t}`)),n===void 0?o:`${o} ${r.colors.yellow(n)}`}function isRailedSearch(e){return e.filter!==void 0&&e.layout===`plain`&&e.selection===`single`&&e.edit===void 0}function selectViewSize(e){return e.search?e.railed?5:e.stacked?Math.min(e.optionCount,8):8:e.optionCount}function noticeBody(e,t,n){return e.tone===`info`?n.colors.dim(e.text):e.tone===`success`&&t===`task-list`?n.colors.bold(e.text):e.text}function renameHint(e,t,n,r){let i={text:n.editor.text||n.defaultValue,cursor:n.editor.cursor},a=renderInputWithBlockCursor({...visibleLine(i,1/0),visible:t,inverse:r.colors.inverse});return n.editor.text.length>0&&(a=solidWithinDim(a,r)),{...e,hint:n.formatHint(a)}}function keyHint(e,t,n,r,i){let a=n.phase;if(a.kind===`inactive`)return e;let o=r.colors,s=maskLine(a.editor),c=a.kind!==`validating`&&a.kind!==`invalid`,l=``;a.kind===`editing`?l=` ${enterBadge(r,`validate`)}`:a.kind===`validating`?l=` ${o.yellow(r.glyph.validating)} ${o.dim(`validating`)}`:a.kind===`invalid`&&(l=` ${o.red(`${r.glyph.error} API key is not valid`)}`);let u=`${r.glyph.elbow} `,d=a.editor.text.length===0?`type your key`:void 0,f=d===void 0?s:{text:d,cursor:0},p=Math.max(1,i-visibleLength(`${u}${l}`)),m=visibleLine(f,p,r.glyph.ellipsis),h=c?renderInputWithBlockCursor({...m,visible:t,inverse:r.colors.inverse}):renderInputText(`${m.before}${m.under}${m.after}`);return{...e,hint:`${u}${h}${l}`}}function inlineEditOption(e,t,n,r,i){if(!t||n===void 0||e.value!==n.optionValue)return e;switch(n.editor.kind){case`rename`:return renameHint(e,n.caretVisible,n.editor,r);case`key`:return keyHint(e,n.caretVisible,n.editor,r,i)}}function optionUsesPlaceholder(e,t){let n=e.filter!==void 0&&e.layout!==`task-list`,r=e.selection===`multiple`,i=e.layout!==`plain`;return!n&&!t&&(r||i)}function appendSelectOptionRows(e){let{rows:t,state:n,presentation:r,visible:i,start:a,end:o,cursor:s,visibleLabelWidth:c,width:l,theme:u}=e,d=!1;for(let e=a;e<o;e+=1){let o=i[e],f=e===s,p=r.layout===`task-list`&&o.trailingAction===!0;p&&(appendSelectNotices(t,n.notices,r.layout,u,l),d=!0),p&&(e>a||(n.notices?.length??0)>0)&&t.push(``);let m=r.layout===`stacked`?Math.max(1,l-6):Math.max(1,l-Math.max(c,o.label.length)-9),h=inlineEditOption(o,f,r.edit,u,m),g=r.edit?.editor.kind===`key`&&f,_={...h,hint:(h.hint??(f||o.disabled?o.description:void 0))?.replace(/\s*\n\s*/gu,` `)};g&&(_.hint=void 0);let v=isRailedSearch(r),y=n.cursorBadge??(v&&!p?enterBadge(u):void 0),b=f&&y!==void 0?` ${y}`:``;t.push(` ${optionRow({option:_,isCursor:f,isChecked:r.selection===`multiple`?n.select.selected.has(o.value):o.checked===!0,placeholder:v||optionUsesPlaceholder(r,p),railed:v,hintPadding:Math.max(0,c-_.label.length),theme:u})}${b}`),g&&h.hint&&t.push(` ${h.hint}`)}return d}function appendSubmitRow(e,t,n,r){if(n<0)return;let i=t===n,a=i?`${r.glyph.selectedPointer} ${r.colors.bold(`Submit`)}`:` Submit`;e.push(``,` ${renderCursorRow(a,i,r.colors)}`)}function appendSelectNotices(e,t,n,r,i){if(t!==void 0&&t.length!==0){e.push(``);for(let a of t){let t=toneGlyph(a.tone,r),o=` `.repeat(visibleLength(t)+1),s=Math.max(1,i-2-visibleLength(t)-1),c=wrapVisibleLine(a.text,s);for(let[i,s]of c.entries()){let c=noticeBody({...a,text:s},n,r);e.push(i===0?` ${t} ${c}`:` ${o}${c}`)}}}}function selectFooterHints(e,t,n,r){let i=[],a=`esc to cancel`,o=e.edit;if(o!==void 0&&t[n]?.value===o.optionValue){if(o.editor.kind===`key`){let e=o.editor.phase;if(e.kind!==`inactive`&&e.editor.text.length>0&&(a=`esc to clear`),e.kind===`validating`)return[a];i.push(`type your key`)}else i.push(`type to rename`)}if(e.filter!==void 0&&i.push(`type to filter`),i.push(`↑/↓ move`),r!==void 0){let t=canNavigateBack(r),n=canNavigateForward(r);return i.push(e.selection===`multiple`?`space/enter toggle`:`enter to select`),t&&n?i.push(`←/→ steps`):t?i.push(`← back`):n&&i.push(`→ next`),i.push(a),i}return i.push(e.selection===`multiple`?`space to toggle`:`enter to select`),e.selection===`multiple`&&i.push(`enter on Submit to confirm`),i.push(a),i}function renderActionQuestion(e,t,n){let r=[` ${t.colors.dim(`${t.glyph.dot} ${e.context}`)}`,``];for(let[n,i]of e.actions.entries())r.push(` ${optionRow({option:i,isCursor:n===e.cursor,isChecked:!1,placeholder:!0,hintPadding:0,theme:t})}`);return r.push(...questionFooter([`↑/↓ move`,`enter to select`,`esc to cancel`],t)),r.map(e=>clip(e,n))}function renderSelectQuestion(e,t,n){if(e.kind===`actions`)return renderActionQuestion(e,t,n);let r=t.colors,i=selectPresentation(e),a=i.filter?filterOptions(e.options,e.select.filter,e.searchAction):e.options,o=e.navigation?.kind===`planner`?e.navigation:void 0,s=i.selection===`multiple`&&o===void 0?submitRowIndex(a):-1,c=e.select.cursor,l=isRailedSearch(i),u=[...e.navigation?.kind===`planner`?plannerStepRows(e.navigation,i.selection===`multiple`?e.select.selected.size:void 0,t):[],...selectMessageRows(e.message,i.layout,t,n)];if(e.description!==void 0||e.metadata!==void 0){if(u.at(-1)===``&&u.pop(),e.description!==void 0)for(let t of wrapVisibleLine(e.description,Math.max(1,n-4)))u.push(` ${r.dim(t)}`);for(let{label:t,value:i}of e.metadata??[]){let e=`${t}: `,a=wrapVisibleLine(i,Math.max(1,n-4-e.length));u.push(` ${r.dim(`${e}${a[0]??``}`)}`);for(let t of a.slice(1))u.push(` ${r.dim(`${` `.repeat(e.length)}${t}`)}`)}u.push(``)}i.filter!==void 0&&u.push(` ${l?` `:``}${searchFilter(e.select.filter,i.filter.placeholder,e.loadingFrame,t,l)}`);let d=selectViewSize({search:i.filter!==void 0,filter:e.select.filter,optionCount:a.length,railed:l,stacked:i.layout===`stacked`}),f=Math.max(0,Math.min(c-Math.floor(d/2),Math.max(0,a.length-d))),p=Math.min(f+d,a.length),m=a.slice(f,p).filter(e=>e.hint!==void 0||e.focusHint!==void 0).reduce((e,t)=>Math.max(e,t.label.length),0);a.length===0&&u.push(` ${r.dim(`(no matches)`)}`);let h=appendSelectOptionRows({rows:u,state:e,presentation:i,visible:a,start:f,end:p,cursor:c,visibleLabelWidth:m,width:n,theme:t});if(appendSubmitRow(u,c,s,t),o!==void 0&&i.selection===`multiple`){let t=e.select.selected.size;u.push(``,` ${r.dim(`${t} selected`)}`)}return!l&&a.length>p-f&&u.push(` ${r.dim(`↑↓ ${a.length} options, showing ${f+1}–${p}`)}`),h||appendSelectNotices(u,e.notices,i.layout,t,n),e.error!==void 0&&u.push(``,` ${r.red(e.error)}`),u.push(...questionFooter(l?[`Enter select`,`Esc back`]:selectFooterHints(i,a,c,o),t,n)),u.map(e=>clip(e,n))}function enterBadge(e,t){return e.colors.dim(t===void 0?e.glyph.enter:`${e.glyph.enter} ${t}`)}function reasoningTrack(e){let{count:t,index:n,theme:r}=e,i=r.glyph,a=i.trackLine.repeat(e.connectorWidth),o=[];for(let e=0;e<t;e+=1)e>0&&o.push(a),o.push(e<n?i.trackFilled:e===n?i.trackCurrent:i.trackEmpty);if(!e.accent||n<0)return o.join(``);let s=o.slice(0,2*n+1).join(``);return`${r.colors.blue(s)}${o.slice(2*n+1).join(``)}`}function renderModelEditorQuestion(e,t,n,r=`Select the model`){let{request:i,state:a}=e;switch(a.screen.kind){case`menu`:return renderModelEditorMenu(e,a.screen.cursor,t,n);case`model`:return renderModelEditorModelScreen(i,a.screen.select,t,n,r)}}function renderModelEditorMenu(e,t,n,r){let{request:i,state:a}=e,{draft:o}=a,s=modelEditorMenuRows(i,o,a.capabilities).map(e=>{if(e.disabled===!0&&e.value===`model`)return o.modelId===null?{...e}:{...e,hint:o.modelId};if(e.disabled===!0||e.value===`done`)return{...e};switch(e.value){case`model`:return{...e,hint:o.modelId??void 0};case`reasoning`:{let r=reasoningPositions(a.capabilities,o.reasoning),i=o.reasoning==="default"?-1:r.indexOf(o.reasoning),s=reasoningTrack({count:r.length,index:i,connectorWidth:1,accent:e.value===t,theme:n}),c=o.reasoning==="default"?`provider default`:o.reasoning;return{...e,hint:`${s} ${c}`}}case`tier`:return{...e,hint:o.tier===`priority`?`fast ${n.glyph.fast}`:`normal`};default:return{...e}}});return renderSelectQuestion({kind:`stacked`,message:``,options:s,select:{filter:``,cursor:Math.max(0,s.findIndex(e=>e.value===t)),selected:new Set}},n,r)}function renderModelEditorModelScreen(e,t,n,r,i){return renderSelectQuestion({kind:`search`,message:i,options:e.model.kind===`pick`?e.model.options:[],placeholder:`type to search`,select:t},n,r)}function renderTextQuestion(e,t,n,r){let i=t.colors,a=[];for(let n of e.notices??[]){let e=n.tone===`info`?i.dim(n.text):n.text;a.push(`${toneGlyph(n.tone,t)} ${e}`)}e.message!==``&&a.push(...e.message.split(`
|
|
7
7
|
`).map(e=>` ${i.bold(e)}`));let o=Math.max(4,n-4),s=e.mask?maskLine(e.editor):e.editor,c=e.editor.text.length===0?e.placeholder:void 0,l=renderInputWithBlockCursor({...visibleLine(c===void 0?s:{text:c,cursor:0},o,t.glyph.ellipsis),visible:r,inverse:i.inverse,render:c===void 0?renderInputText:e=>i.dim(renderInputText(e))});return a.push(` ${l}`),e.error!==void 0&&a.push(``,` ${i.red(e.error)}`),a.push(...questionFooter([`enter to submit`,`esc to cancel`],t)),a.map(e=>clip(e,n))}function renderAcknowledgeQuestion(e,t,n){let r=t.colors,i=e.message===``?[]:[` ${r.bold(e.message)}`];if(e.lines.length>0){i.push(``);for(let t of e.lines)i.push(` ${r.dim(t)}`)}return i.push(...questionFooter([`enter to continue`],t)),i.map(e=>clip(e,n))}export{enterBadge,flowMessageRows,reasoningTrack,renderAcknowledgeQuestion,renderFlowPanel,renderModelEditorQuestion,renderSelectQuestion,renderTextQuestion};
|
|
@@ -113,7 +113,7 @@ export interface SubagentPumpOptions {
|
|
|
113
113
|
view?: SubagentView;
|
|
114
114
|
formatActionResultError: (event: ActionResultStreamEvent) => string;
|
|
115
115
|
/** Runs TUI-owned handling after a child tool result becomes visible. */
|
|
116
|
-
onToolCompleted?: (toolName: string, output: unknown) => Promise<void>;
|
|
116
|
+
onToolCompleted?: (subagentName: string, toolName: string, output: unknown) => Promise<void>;
|
|
117
117
|
}
|
|
118
118
|
export declare class SubagentPump {
|
|
119
119
|
#private;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createEventDeduper}from"#protocol/event-dedupe.js";import{isCurrentTurnBoundaryEvent}from"#protocol/message.js";import{readNdjsonStream}from"#client/ndjson.js";import{readMessageStreamVersion}from"#client/stream-version.js";var SubagentPump=class{#e;#t;#n;#r;#i=new Map;#a=new Map;#o=new Map;#s=new Map;#c=new Map;constructor(e){this.#e=e.client,this.#t=e.view,this.#n=e.formatActionResultError,this.#r=e.onToolCompleted}begin(e){let t=e.data.callId,n=this.#i.get(t);n===void 0?this.#i.set(t,{name:e.data.name,childSessionId:e.data.childSessionId,parentTurnId:e.data.turnId,background:!1,status:`open`,childStreamPath:e.data.childStreamPath,childStreamIndex:this.#o.get(e.data.childSessionId)??0,steps:new Map,currentSectionKey:null,nextSectionKey:0,tools:new Map,seenChildEvents:createEventDeduper()}):n.name=e.data.name,this.#t?.markChildToolCallId(t),(n===void 0||n.status===`open`)&&(this.#t?.begin({callId:t,name:e.data.name}),n===void 0&&this.#l(t))}settle(e){this.#f(e,!1)}background(e){let t=this.#i.get(e);t!==void 0&&(t.background=!0,t.status!==`authoritative`&&this.#t?.background({callId:e}))}abortAll(){for(let e of this.#a.values())e.abort();this.#a.clear(),this.#i.clear(),this.#o.clear(),this.#s.clear(),this.#c.clear()}settleCancelledTurn(e){for(let[t,n]of this.#i)n.parentTurnId!==e||n.background||(this.#f(t,!0),this.#a.get(t)?.abort(),this.#a.delete(t))}#l(e){let t=this.#i.get(e);if(t===void 0||t.status===`authoritative`)return;let n=this.#s.get(t.childSessionId);if(n===void 0){t.childStreamIndex=this.#o.get(t.childSessionId)??0,this.#s.set(t.childSessionId,e),this.#u(e);return}if(n===e)return;let r=this.#c.get(t.childSessionId)??[];r.includes(e)||r.push(e),this.#c.set(t.childSessionId,r)}#u(e){if(this.#a.has(e))return;let t=this.#e;if(!t)return;let n=this.#i.get(e);if(n===void 0||n.status===`authoritative`)return;let r=new AbortController;this.#a.set(e,r),(async()=>{let i=100;try{for(;!r.signal.aborted&&n.status!==`authoritative`;){let a=!1;try{let i=await t.fetch(streamPathAt(n.childStreamPath,n.childStreamIndex),{cache:`no-store`,signal:r.signal});if(!i.ok||i.body===null)throw await i.body?.cancel().catch(()=>{}),Error(`Child stream returned ${i.status}.`);for await(let t of readNdjsonStream(i.body,{streamVersion:readMessageStreamVersion(i.headers)})){if(r.signal.aborted)return;a=!0,n.childStreamIndex+=1,this.#o.set(n.childSessionId,n.childStreamIndex);let i=this.#h(e,t);if(i!==void 0&&await i,isCurrentTurnBoundaryEvent(t)){if(t.type===`session.waiting`&&hasPendingChildApproval(n))continue;this.#f(e,!0);return}}}catch{if(r.signal.aborted)return}i=a?100:Math.min(i*2,2e3),await abortableDelay(i,r.signal)}}finally{r.abort(),this.#a.get(e)===r&&this.#a.delete(e)}})()}#d(e,t,n){let r=t.tools.get(n.childCallId),i=r??{toolName:n.toolName,input:n.input,status:n.status};if(r){let e=r.status===`done`||r.status===`failed`||r.status===`rejected`;if(n.status===`approval-requested`&&!e)r.status=n.status;else{let e={preparing:0,"approval-requested":1,executing:2,done:3,failed:3,rejected:3};e[n.status]>e[r.status]&&(r.status=n.status)}n.input!==void 0&&(r.input=n.input)}else t.tools.set(n.childCallId,i);this.#t?.markChildToolCallId(n.childCallId),this.#t?.upsertTool({callId:e,subagentName:t.name,childCallId:n.childCallId,toolName:i.toolName,input:i.input,status:i.status})}#f(e,t){let n=this.#i.get(e);if(n&&n.status!==`authoritative`&&(t||n.status!==`provisional`)){n.status=t?`authoritative`:`provisional`;for(let[t,r]of n.steps)r.finalized||(r.finalized=!0,this.#t?.upsertStep({callId:e,subagentName:n.name,sectionKey:t,reasoning:r.reasoning,message:r.message,finalized:!0}));n.currentSectionKey=null,this.#m(e,n),this.#t?.complete({authoritative:t,callId:e}),t&&this.#p(e,n.childSessionId)}}#p(e,t){let n=(this.#c.get(t)??[]).filter(t=>t!==e);if(this.#s.get(t)!==e){n.length===0?this.#c.delete(t):this.#c.set(t,n);return}for(this.#s.delete(t);n.length>0;){let e=n.shift(),r=this.#i.get(e);if(r!==void 0&&r.status!==`authoritative`){n.length===0?this.#c.delete(t):this.#c.set(t,n),r.childStreamIndex=this.#o.get(t)??0,this.#s.set(t,e),this.#u(e);return}}this.#c.delete(t)}#m(e,t){for(let[n,r]of t.tools)r.status===`preparing`&&(t.tools.delete(n),this.#t?.removeTool({callId:e,childCallId:n}))}#h(e,t){let n=this.#i.get(e);if(!n||!n.seenChildEvents.admit(t))return;n.status===`provisional`&&(n.status=`open`,this.#t?.begin({callId:e,name:n.name}));let r=this.#t,emit=(t,i)=>{r?.upsertStep({callId:e,subagentName:n.name,sectionKey:t,reasoning:i.reasoning,message:i.message,finalized:i.finalized})},finalizeCurrent=()=>{if(n.currentSectionKey===null)return;let e=n.steps.get(n.currentSectionKey);e&&(e.finalized=!0,emit(n.currentSectionKey,e)),n.currentSectionKey=null};switch(t.type){case`reasoning.appended`:{let{key:e,step:r}=openCurrentSubagentSection(n);r.reasoning+=t.data.reasoningDelta,emit(e,r);break}case`reasoning.completed`:break;case`message.appended`:{let{key:e,step:r}=openCurrentSubagentSection(n);r.message+=t.data.messageDelta,emit(e,r);break}case`message.completed`:{let{key:e,step:r}=openCurrentSubagentSection(n);t.data.message!==null&&r.message.length===0&&(r.message=t.data.message),r.finalized=!0,emit(e,r),n.currentSectionKey=null;break}case`step.completed`:finalizeCurrent(),this.#m(e,n);break;case`actions.requested`:finalizeCurrent();for(let r of t.data.actions)r.kind===`tool-call`&&this.#d(e,n,{childCallId:r.callId,toolName:r.toolName,input:r.input,status:`executing`});break;case`input.requested`:finalizeCurrent();for(let r of t.data.requests)r.action.kind===`tool-call`&&this.#d(e,n,{childCallId:r.action.callId,toolName:r.action.toolName,input:r.action.input,status:`approval-requested`});break;case`action.result`:{let i=t.data.result;if(i.kind!==`tool-result`)break;let a=n.tools.get(i.callId);if(!a)break;switch(t.data.status){case`completed`:a.status=`done`,a.output=i.output;break;case`failed`:a.status=`failed`,a.errorText=this.#n(t);break;case`rejected`:a.status=`rejected`,a.errorText=this.#n(t)}let o={callId:e,subagentName:n.name,childCallId:i.callId,toolName:a.toolName,input:a.input,status:a.status};if(a.output!==void 0&&(o.output=a.output),a.errorText!==void 0&&(o.errorText=a.errorText),r?.upsertTool(o),t.data.status===`completed`)return this.#r?.(a.toolName,i.output);break}}}};function hasPendingChildApproval(e){return[...e.tools.values()].some(e=>e.status===`approval-requested`)}function streamPathAt(e,t){return t===0?e:`${e}${e.includes(`?`)?`&`:`?`}startIndex=${t}`}async function abortableDelay(e,t){t.aborted||await new Promise(n=>{let onAbort=()=>{clearTimeout(r),n()},r=setTimeout(()=>{t.removeEventListener(`abort`,onAbort),n()},e);r.unref?.(),t.addEventListener(`abort`,onAbort,{once:!0})})}function openCurrentSubagentSection(e){e.currentSectionKey===null&&(e.currentSectionKey=e.nextSectionKey++,e.steps.set(e.currentSectionKey,{reasoning:``,message:``,finalized:!1}));let t=e.steps.get(e.currentSectionKey);if(!t)throw Error(`invariant: subagent section state missing for current key`);return{key:e.currentSectionKey,step:t}}export{SubagentPump};
|
|
1
|
+
import{createEventDeduper}from"#protocol/event-dedupe.js";import{isCurrentTurnBoundaryEvent}from"#protocol/message.js";import{readNdjsonStream}from"#client/ndjson.js";import{readMessageStreamVersion}from"#client/stream-version.js";var SubagentPump=class{#e;#t;#n;#r;#i=new Map;#a=new Map;#o=new Map;#s=new Map;#c=new Map;constructor(e){this.#e=e.client,this.#t=e.view,this.#n=e.formatActionResultError,this.#r=e.onToolCompleted}begin(e){let t=e.data.callId,n=this.#i.get(t);n===void 0?this.#i.set(t,{name:e.data.name,childSessionId:e.data.childSessionId,parentTurnId:e.data.turnId,background:!1,status:`open`,childStreamPath:e.data.childStreamPath,childStreamIndex:this.#o.get(e.data.childSessionId)??0,steps:new Map,currentSectionKey:null,nextSectionKey:0,tools:new Map,seenChildEvents:createEventDeduper()}):n.name=e.data.name,this.#t?.markChildToolCallId(t),(n===void 0||n.status===`open`)&&(this.#t?.begin({callId:t,name:e.data.name}),n===void 0&&this.#l(t))}settle(e){this.#f(e,!1)}background(e){let t=this.#i.get(e);t!==void 0&&(t.background=!0,t.status!==`authoritative`&&this.#t?.background({callId:e}))}abortAll(){for(let e of this.#a.values())e.abort();this.#a.clear(),this.#i.clear(),this.#o.clear(),this.#s.clear(),this.#c.clear()}settleCancelledTurn(e){for(let[t,n]of this.#i)n.parentTurnId!==e||n.background||(this.#f(t,!0),this.#a.get(t)?.abort(),this.#a.delete(t))}#l(e){let t=this.#i.get(e);if(t===void 0||t.status===`authoritative`)return;let n=this.#s.get(t.childSessionId);if(n===void 0){t.childStreamIndex=this.#o.get(t.childSessionId)??0,this.#s.set(t.childSessionId,e),this.#u(e);return}if(n===e)return;let r=this.#c.get(t.childSessionId)??[];r.includes(e)||r.push(e),this.#c.set(t.childSessionId,r)}#u(e){if(this.#a.has(e))return;let t=this.#e;if(!t)return;let n=this.#i.get(e);if(n===void 0||n.status===`authoritative`)return;let r=new AbortController;this.#a.set(e,r),(async()=>{let i=100;try{for(;!r.signal.aborted&&n.status!==`authoritative`;){let a=!1;try{let i=await t.fetch(streamPathAt(n.childStreamPath,n.childStreamIndex),{cache:`no-store`,signal:r.signal});if(!i.ok||i.body===null)throw await i.body?.cancel().catch(()=>{}),Error(`Child stream returned ${i.status}.`);for await(let t of readNdjsonStream(i.body,{streamVersion:readMessageStreamVersion(i.headers)})){if(r.signal.aborted)return;a=!0,n.childStreamIndex+=1,this.#o.set(n.childSessionId,n.childStreamIndex);let i=this.#h(e,t);if(i!==void 0&&await i,isCurrentTurnBoundaryEvent(t)){if(t.type===`session.waiting`&&hasPendingChildApproval(n))continue;this.#f(e,!0);return}}}catch{if(r.signal.aborted)return}i=a?100:Math.min(i*2,2e3),await abortableDelay(i,r.signal)}}finally{r.abort(),this.#a.get(e)===r&&this.#a.delete(e)}})()}#d(e,t,n){let r=t.tools.get(n.childCallId),i=r??{toolName:n.toolName,input:n.input,status:n.status};if(r){let e=r.status===`done`||r.status===`failed`||r.status===`rejected`;if(n.status===`approval-requested`&&!e)r.status=n.status;else{let e={preparing:0,"approval-requested":1,executing:2,done:3,failed:3,rejected:3};e[n.status]>e[r.status]&&(r.status=n.status)}n.input!==void 0&&(r.input=n.input)}else t.tools.set(n.childCallId,i);this.#t?.markChildToolCallId(n.childCallId),this.#t?.upsertTool({callId:e,subagentName:t.name,childCallId:n.childCallId,toolName:i.toolName,input:i.input,status:i.status})}#f(e,t){let n=this.#i.get(e);if(n&&n.status!==`authoritative`&&(t||n.status!==`provisional`)){n.status=t?`authoritative`:`provisional`;for(let[t,r]of n.steps)r.finalized||(r.finalized=!0,this.#t?.upsertStep({callId:e,subagentName:n.name,sectionKey:t,reasoning:r.reasoning,message:r.message,finalized:!0}));n.currentSectionKey=null,this.#m(e,n),this.#t?.complete({authoritative:t,callId:e}),t&&this.#p(e,n.childSessionId)}}#p(e,t){let n=(this.#c.get(t)??[]).filter(t=>t!==e);if(this.#s.get(t)!==e){n.length===0?this.#c.delete(t):this.#c.set(t,n);return}for(this.#s.delete(t);n.length>0;){let e=n.shift(),r=this.#i.get(e);if(r!==void 0&&r.status!==`authoritative`){n.length===0?this.#c.delete(t):this.#c.set(t,n),r.childStreamIndex=this.#o.get(t)??0,this.#s.set(t,e),this.#u(e);return}}this.#c.delete(t)}#m(e,t){for(let[n,r]of t.tools)r.status===`preparing`&&(t.tools.delete(n),this.#t?.removeTool({callId:e,childCallId:n}))}#h(e,t){let n=this.#i.get(e);if(!n||!n.seenChildEvents.admit(t))return;n.status===`provisional`&&(n.status=`open`,this.#t?.begin({callId:e,name:n.name}));let r=this.#t,emit=(t,i)=>{r?.upsertStep({callId:e,subagentName:n.name,sectionKey:t,reasoning:i.reasoning,message:i.message,finalized:i.finalized})},finalizeCurrent=()=>{if(n.currentSectionKey===null)return;let e=n.steps.get(n.currentSectionKey);e&&(e.finalized=!0,emit(n.currentSectionKey,e)),n.currentSectionKey=null};switch(t.type){case`reasoning.appended`:{let{key:e,step:r}=openCurrentSubagentSection(n);r.reasoning+=t.data.reasoningDelta,emit(e,r);break}case`reasoning.completed`:break;case`message.appended`:{let{key:e,step:r}=openCurrentSubagentSection(n);r.message+=t.data.messageDelta,emit(e,r);break}case`message.completed`:{let{key:e,step:r}=openCurrentSubagentSection(n);t.data.message!==null&&r.message.length===0&&(r.message=t.data.message),r.finalized=!0,emit(e,r),n.currentSectionKey=null;break}case`step.completed`:finalizeCurrent(),this.#m(e,n);break;case`actions.requested`:finalizeCurrent();for(let r of t.data.actions)r.kind===`tool-call`&&this.#d(e,n,{childCallId:r.callId,toolName:r.toolName,input:r.input,status:`executing`});break;case`input.requested`:finalizeCurrent();for(let r of t.data.requests)r.action.kind===`tool-call`&&this.#d(e,n,{childCallId:r.action.callId,toolName:r.action.toolName,input:r.action.input,status:`approval-requested`});break;case`action.result`:{let i=t.data.result;if(i.kind!==`tool-result`)break;let a=n.tools.get(i.callId);if(!a)break;switch(t.data.status){case`completed`:a.status=`done`,a.output=i.output;break;case`failed`:a.status=`failed`,a.errorText=this.#n(t);break;case`rejected`:a.status=`rejected`,a.errorText=this.#n(t)}let o={callId:e,subagentName:n.name,childCallId:i.callId,toolName:a.toolName,input:a.input,status:a.status};if(a.output!==void 0&&(o.output=a.output),a.errorText!==void 0&&(o.errorText=a.errorText),r?.upsertTool(o),t.data.status===`completed`)return this.#r?.(n.name,a.toolName,i.output);break}}}};function hasPendingChildApproval(e){return[...e.tools.values()].some(e=>e.status===`approval-requested`)}function streamPathAt(e,t){return t===0?e:`${e}${e.includes(`?`)?`&`:`?`}startIndex=${t}`}async function abortableDelay(e,t){t.aborted||await new Promise(n=>{let onAbort=()=>{clearTimeout(r),n()},r=setTimeout(()=>{t.removeEventListener(`abort`,onAbort),n()},e);r.unref?.(),t.addEventListener(`abort`,onAbort,{once:!0})})}function openCurrentSubagentSection(e){e.currentSectionKey===null&&(e.currentSectionKey=e.nextSectionKey++,e.steps.set(e.currentSectionKey,{reasoning:``,message:``,finalized:!1}));let t=e.steps.get(e.currentSectionKey);if(!t)throw Error(`invariant: subagent section state missing for current key`);return{key:e.currentSectionKey,step:t}}export{SubagentPump};
|
|
@@ -47,8 +47,6 @@ export type AgentHeaderOptions = {
|
|
|
47
47
|
name: string;
|
|
48
48
|
serverUrl: string;
|
|
49
49
|
info?: AgentInfoResult;
|
|
50
|
-
/** Message-of-the-day line below the startup card (local sessions only). */
|
|
51
|
-
tip?: string;
|
|
52
50
|
};
|
|
53
51
|
export declare class TerminalRenderer implements AgentTUIRenderer {
|
|
54
52
|
#private;
|
|
@@ -68,7 +66,6 @@ export declare class TerminalRenderer implements AgentTUIRenderer {
|
|
|
68
66
|
renderAgentHeader(options: AgentHeaderOptions): void;
|
|
69
67
|
beginStartupDraft(options: {
|
|
70
68
|
initialDraft?: string;
|
|
71
|
-
tip: string;
|
|
72
69
|
title: string;
|
|
73
70
|
}): void;
|
|
74
71
|
finishStartupDraft(): {
|