aws-runtime-bridge 1.9.135 → 1.9.139
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/dist/adapter/AcodeSdkAdapter.d.ts +10 -0
- package/dist/adapter/AcodeSdkAdapter.js +5 -5
- package/dist/adapter/ClaudeSdkAdapter.js +3 -3
- package/dist/adapter/CodexSdkAdapter.js +3 -3
- package/dist/adapter/OpencodeSdkAdapter.js +3 -3
- package/dist/browser/browser-pool.js +1 -1
- package/dist/browser/built-in-browser-tools.d.ts +1 -2
- package/dist/browser/built-in-browser-tools.js +1 -1
- package/dist/browser/ws-server.js +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.js +2 -2
- package/dist/index.js +1 -1
- package/dist/middleware/auth.js +1 -1
- package/dist/remote-desktop/computer-control.d.ts +1 -1
- package/dist/remote-desktop/index.d.ts +1 -1
- package/dist/remote-desktop/index.js +2 -2
- package/dist/remote-desktop/session-manager.d.ts +2 -2
- package/dist/remote-desktop/session-manager.js +1 -1
- package/dist/remote-desktop/system-backend.js +3 -3
- package/dist/routes/ai-sources.js +1 -1
- package/dist/routes/background-tasks.js +1 -1
- package/dist/routes/browser-listeners.js +1 -1
- package/dist/routes/capabilities.d.ts +2 -0
- package/dist/routes/capabilities.js +2 -0
- package/dist/routes/dashboard.js +1 -1
- package/dist/routes/file-change-diff.js +3 -3
- package/dist/routes/file-diff-rollback.js +1 -1
- package/dist/routes/file-snapshot.js +1 -1
- package/dist/routes/git.js +1 -1
- package/dist/routes/instance.d.ts +0 -1
- package/dist/routes/instance.js +1 -1
- package/dist/routes/launch.js +1 -1
- package/dist/routes/mcp-extra.d.ts +2 -0
- package/dist/routes/mcp-extra.js +3 -0
- package/dist/routes/mcp.d.ts +1 -0
- package/dist/routes/mcp.js +1 -1
- package/dist/routes/plugins.d.ts +2 -0
- package/dist/routes/plugins.js +2 -0
- package/dist/routes/properties.js +1 -1
- package/dist/routes/pty.d.ts +1 -1
- package/dist/routes/pty.js +1 -1
- package/dist/routes/runtime-binding.js +1 -1
- package/dist/routes/skills.d.ts +1 -0
- package/dist/routes/skills.js +1 -1
- package/dist/routes/sub-agents.js +1 -1
- package/dist/routes/task-context.js +1 -1
- package/dist/routes/terminal.js +25 -25
- package/dist/routes/yml.js +1 -1
- package/dist/services/access-control.js +1 -1
- package/dist/services/acode-bg-manager.js +1 -1
- package/dist/services/agent-capability-sync.d.ts +7 -0
- package/dist/services/agent-capability-sync.js +2 -0
- package/dist/services/agent-process-manager.d.ts +1 -1
- package/dist/services/agent-process-manager.js +1 -1
- package/{package/cc-switch-sdk/dist → dist}/services/ai-config-service.d.ts +3 -0
- package/dist/services/ai-config-service.js +4 -0
- package/dist/services/ai-source-apply.d.ts +1 -1
- package/dist/services/ai-source-apply.js +1 -1
- package/dist/services/auto-register.js +1 -1
- package/dist/services/bridge-package-publish-hooks.js +1 -1
- package/dist/services/browser-session-manager.d.ts +3 -3
- package/dist/services/browser-session-manager.js +1 -1
- package/dist/services/capability-config.d.ts +21 -0
- package/dist/services/capability-config.js +3 -0
- package/dist/services/cli-commands.js +2 -2
- package/dist/services/desktop-mcp-manager.js +1 -1
- package/dist/services/fileSnapshotStore.js +1 -1
- package/dist/services/instance-ai-config-service.d.ts +1 -0
- package/dist/services/instance-ai-config-service.js +1 -1
- package/dist/services/instance-features.d.ts +21 -0
- package/dist/services/instance-features.js +1 -1
- package/dist/services/instance-init-service.d.ts +7 -4
- package/dist/services/instance-init-service.js +1 -1
- package/dist/services/instance-state.js +1 -1
- package/dist/services/jdk-scanner.js +1 -1
- package/dist/services/launch-manager.js +1 -1
- package/dist/services/legacy-path-migration.d.ts +2 -0
- package/dist/services/legacy-path-migration.js +1 -1
- package/dist/services/lifecycle-state.js +2 -2
- package/dist/services/mcp-deploy.d.ts +49 -0
- package/dist/services/mcp-deploy.js +4 -0
- package/dist/services/orphan-monitor.js +1 -1
- package/dist/services/plugin-event-buffer.d.ts +49 -0
- package/dist/services/plugin-event-buffer.js +2 -0
- package/dist/services/plugin-manager.d.ts +262 -0
- package/dist/services/plugin-manager.js +16 -0
- package/dist/services/plugin-package.d.ts +8 -0
- package/dist/services/plugin-package.js +2 -0
- package/dist/services/process-detail.js +2 -2
- package/dist/services/process-detector.js +10 -10
- package/dist/services/process-registry.js +1 -1
- package/dist/services/process-top.js +2 -2
- package/dist/services/runtime-binding.js +4 -4
- package/dist/services/sdk-tool-file-change-recorder.js +1 -1
- package/dist/services/skill-manager.d.ts +41 -0
- package/dist/services/skill-manager.js +3 -0
- package/dist/services/startup-config-wizard.js +6 -6
- package/dist/services/system-metrics.js +1 -1
- package/dist/services/tunnel-client.js +1 -1
- package/dist/services/update-notifier.js +2 -2
- package/dist/services/windows-service-manager.js +1 -1
- package/dist/services/workspace-files.js +1 -1
- package/dist/services/workspaceTaskChangeWatcher.js +3 -3
- package/dist/types.d.ts +11 -61
- package/dist/utils/file-utils.d.ts +9 -6
- package/dist/utils/file-utils.js +2 -2
- package/dist/utils/instance-ai-config-debug-logger.js +1 -1
- package/dist/utils/mcp-utils.d.ts +1 -37
- package/dist/utils/mcp-utils.js +1 -1
- package/dist/utils/yaml-utils.js +1 -1
- package/package/acode/dist/built-in-file-tools.js +2 -2
- package/package/acode/dist/commands/commandRegistry.d.ts +2 -0
- package/package/acode/dist/commands/commandRegistry.js +1 -1
- package/package/acode/dist/index.d.ts +2 -0
- package/package/acode/dist/index.js +1 -1
- package/package/acode/dist/plugin-tools.d.ts +14 -0
- package/package/acode/dist/plugin-tools.js +9 -0
- package/package/acode/dist/plugin-types.d.ts +119 -0
- package/package/acode/dist/runtime.d.ts +4 -0
- package/package/acode/dist/runtime.js +19 -19
- package/package/acode/dist/sub-agent-manager.js +1 -1
- package/package/acode/dist/types.d.ts +5 -0
- package/package/aws-client-agent-mcp/dist/agent-client.d.ts +9 -1
- package/package/aws-client-agent-mcp/dist/agent-client.js +1 -1
- package/package/aws-client-agent-mcp/dist/http-client.js +1 -1
- package/package/aws-client-agent-mcp/dist/mcp-server.d.ts +10 -0
- package/package/aws-client-agent-mcp/dist/mcp-server.js +21 -21
- package/package/aws-client-agent-mcp/dist/mcp-tools.js +2 -4
- package/package/aws-client-agent-mcp/dist/memory-tools.js +12 -14
- package/package/aws-client-agent-mcp/dist/server-memory-store.d.ts +1 -1
- package/package/aws-client-agent-mcp/dist/server-memory-store.js +1 -1
- package/package/aws-client-agent-mcp/dist/status-reporter.d.ts +2 -0
- package/package/aws-client-agent-mcp/dist/status-reporter.js +3 -2
- package/package/aws-client-agent-mcp/dist/types.d.ts +22 -0
- package/package.json +4 -10
- package/dist/adapters/cc-switch/common.d.ts +0 -41
- package/dist/adapters/cc-switch/common.js +0 -2
- package/dist/adapters/cc-switch/index.d.ts +0 -19
- package/dist/adapters/cc-switch/index.js +0 -2
- package/dist/adapters/cc-switch/mcp-acode.d.ts +0 -10
- package/dist/adapters/cc-switch/mcp-acode.js +0 -2
- package/dist/adapters/cc-switch/mcp-claude.d.ts +0 -10
- package/dist/adapters/cc-switch/mcp-claude.js +0 -2
- package/dist/adapters/cc-switch/mcp-claudecode.d.ts +0 -10
- package/dist/adapters/cc-switch/mcp-claudecode.js +0 -2
- package/dist/adapters/cc-switch/mcp-codex.d.ts +0 -10
- package/dist/adapters/cc-switch/mcp-codex.js +0 -11
- package/dist/adapters/cc-switch/mcp-opencode.d.ts +0 -14
- package/dist/adapters/cc-switch/mcp-opencode.js +0 -2
- package/dist/adapters/cc-switch/mcp-placeholder.d.ts +0 -9
- package/dist/adapters/cc-switch/mcp-placeholder.js +0 -2
- package/dist/adapters/cc-switch/skill-acode.d.ts +0 -5
- package/dist/adapters/cc-switch/skill-acode.js +0 -2
- package/dist/adapters/cc-switch/skill-claude.d.ts +0 -5
- package/dist/adapters/cc-switch/skill-claude.js +0 -2
- package/dist/adapters/cc-switch/skill-claudecode.d.ts +0 -5
- package/dist/adapters/cc-switch/skill-claudecode.js +0 -2
- package/dist/adapters/cc-switch/skill-codex.d.ts +0 -4
- package/dist/adapters/cc-switch/skill-codex.js +0 -2
- package/dist/adapters/cc-switch/skill-directory.d.ts +0 -9
- package/dist/adapters/cc-switch/skill-directory.js +0 -3
- package/dist/adapters/cc-switch/skill-opencode.d.ts +0 -5
- package/dist/adapters/cc-switch/skill-opencode.js +0 -2
- package/dist/adapters/cc-switch/skill-placeholder.d.ts +0 -9
- package/dist/adapters/cc-switch/skill-placeholder.js +0 -2
- package/dist/services/cc-switch-sdk.d.ts +0 -17
- package/dist/services/cc-switch-sdk.js +0 -2
- package/dist/services/instance-service.d.ts +0 -78
- package/dist/services/instance-service.js +0 -2
- package/node_modules/@cc-switch/sdk/README.md +0 -541
- package/node_modules/@cc-switch/sdk/dist/constants.d.ts +0 -8
- package/node_modules/@cc-switch/sdk/dist/constants.js +0 -2
- package/node_modules/@cc-switch/sdk/dist/errors.d.ts +0 -5
- package/node_modules/@cc-switch/sdk/dist/errors.js +0 -2
- package/node_modules/@cc-switch/sdk/dist/index.d.ts +0 -5
- package/node_modules/@cc-switch/sdk/dist/index.js +0 -2
- package/node_modules/@cc-switch/sdk/dist/schemas.d.ts +0 -7
- package/node_modules/@cc-switch/sdk/dist/schemas.js +0 -2
- package/node_modules/@cc-switch/sdk/dist/sdk.d.ts +0 -59
- package/node_modules/@cc-switch/sdk/dist/sdk.js +0 -2
- package/node_modules/@cc-switch/sdk/dist/services/ai-config-service.d.ts +0 -81
- package/node_modules/@cc-switch/sdk/dist/services/ai-config-service.js +0 -4
- package/node_modules/@cc-switch/sdk/dist/services/mcp-model.d.ts +0 -16
- package/node_modules/@cc-switch/sdk/dist/services/mcp-model.js +0 -2
- package/node_modules/@cc-switch/sdk/dist/services/mcp-service.d.ts +0 -17
- package/node_modules/@cc-switch/sdk/dist/services/mcp-service.js +0 -2
- package/node_modules/@cc-switch/sdk/dist/services/skill-model.d.ts +0 -16
- package/node_modules/@cc-switch/sdk/dist/services/skill-model.js +0 -2
- package/node_modules/@cc-switch/sdk/dist/services/skill-service.d.ts +0 -16
- package/node_modules/@cc-switch/sdk/dist/services/skill-service.js +0 -2
- package/node_modules/@cc-switch/sdk/dist/state.d.ts +0 -3
- package/node_modules/@cc-switch/sdk/dist/state.js +0 -2
- package/node_modules/@cc-switch/sdk/dist/types.d.ts +0 -78
- package/node_modules/@cc-switch/sdk/dist/utils/fs.d.ts +0 -10
- package/node_modules/@cc-switch/sdk/dist/utils/fs.js +0 -3
- package/node_modules/@cc-switch/sdk/dist/utils/id.d.ts +0 -3
- package/node_modules/@cc-switch/sdk/dist/utils/id.js +0 -2
- package/node_modules/@cc-switch/sdk/package.json +0 -31
- package/node_modules/zod/LICENSE +0 -21
- package/node_modules/zod/README.md +0 -208
- package/node_modules/zod/index.cjs +0 -33
- package/node_modules/zod/index.d.cts +0 -4
- package/node_modules/zod/index.d.ts +0 -4
- package/node_modules/zod/index.js +0 -4
- package/node_modules/zod/locales/index.cjs +0 -17
- package/node_modules/zod/locales/index.d.cts +0 -1
- package/node_modules/zod/locales/index.d.ts +0 -1
- package/node_modules/zod/locales/index.js +0 -1
- package/node_modules/zod/locales/package.json +0 -6
- package/node_modules/zod/mini/index.cjs +0 -17
- package/node_modules/zod/mini/index.d.cts +0 -1
- package/node_modules/zod/mini/index.d.ts +0 -1
- package/node_modules/zod/mini/index.js +0 -1
- package/node_modules/zod/mini/package.json +0 -6
- package/node_modules/zod/package.json +0 -135
- package/node_modules/zod/src/index.ts +0 -4
- package/node_modules/zod/src/locales/index.ts +0 -1
- package/node_modules/zod/src/mini/index.ts +0 -1
- package/node_modules/zod/src/v3/ZodError.ts +0 -330
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
- package/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
- package/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
- package/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
- package/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
- package/node_modules/zod/src/v3/errors.ts +0 -13
- package/node_modules/zod/src/v3/external.ts +0 -6
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
- package/node_modules/zod/src/v3/helpers/util.ts +0 -224
- package/node_modules/zod/src/v3/index.ts +0 -4
- package/node_modules/zod/src/v3/locales/en.ts +0 -124
- package/node_modules/zod/src/v3/standard-schema.ts +0 -113
- package/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
- package/node_modules/zod/src/v3/tests/array.test.ts +0 -71
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
- package/node_modules/zod/src/v3/tests/base.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
- package/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
- package/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
- package/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
- package/node_modules/zod/src/v3/tests/complex.test.ts +0 -56
- package/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
- package/node_modules/zod/src/v3/tests/date.test.ts +0 -32
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
- package/node_modules/zod/src/v3/tests/default.test.ts +0 -112
- package/node_modules/zod/src/v3/tests/description.test.ts +0 -33
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
- package/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
- package/node_modules/zod/src/v3/tests/error.test.ts +0 -551
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
- package/node_modules/zod/src/v3/tests/function.test.ts +0 -257
- package/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
- package/node_modules/zod/src/v3/tests/intersection.test.ts +0 -110
- package/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
- package/node_modules/zod/src/v3/tests/language-server.test.ts +0 -207
- package/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
- package/node_modules/zod/src/v3/tests/map.test.ts +0 -110
- package/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
- package/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
- package/node_modules/zod/src/v3/tests/nan.test.ts +0 -21
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
- package/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
- package/node_modules/zod/src/v3/tests/number.test.ts +0 -176
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/object.test.ts +0 -434
- package/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
- package/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
- package/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
- package/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
- package/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
- package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -194
- package/node_modules/zod/src/v3/tests/record.test.ts +0 -171
- package/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
- package/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
- package/node_modules/zod/src/v3/tests/set.test.ts +0 -142
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
- package/node_modules/zod/src/v3/tests/string.test.ts +0 -916
- package/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
- package/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
- package/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
- package/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
- package/node_modules/zod/src/v3/tests/void.test.ts +0 -15
- package/node_modules/zod/src/v3/types.ts +0 -5138
- package/node_modules/zod/src/v4/classic/checks.ts +0 -31
- package/node_modules/zod/src/v4/classic/coerce.ts +0 -27
- package/node_modules/zod/src/v4/classic/compat.ts +0 -70
- package/node_modules/zod/src/v4/classic/errors.ts +0 -82
- package/node_modules/zod/src/v4/classic/external.ts +0 -50
- package/node_modules/zod/src/v4/classic/index.ts +0 -5
- package/node_modules/zod/src/v4/classic/iso.ts +0 -90
- package/node_modules/zod/src/v4/classic/parse.ts +0 -82
- package/node_modules/zod/src/v4/classic/schemas.ts +0 -2197
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -210
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -54
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -63
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -276
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +0 -573
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +0 -562
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -352
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -31
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -302
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -365
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -661
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -285
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -595
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -711
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -96
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -179
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -308
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -844
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -34
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -171
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -108
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -227
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -117
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -196
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -101
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -270
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -609
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -136
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -340
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -127
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -101
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -74
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -282
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -252
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -356
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -582
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -605
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -204
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -181
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -57
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -125
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -1080
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -106
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -763
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -2622
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -361
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -163
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -181
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
- package/node_modules/zod/src/v4/core/api.ts +0 -1621
- package/node_modules/zod/src/v4/core/checks.ts +0 -1287
- package/node_modules/zod/src/v4/core/config.ts +0 -15
- package/node_modules/zod/src/v4/core/core.ts +0 -115
- package/node_modules/zod/src/v4/core/doc.ts +0 -44
- package/node_modules/zod/src/v4/core/errors.ts +0 -413
- package/node_modules/zod/src/v4/core/index.ts +0 -14
- package/node_modules/zod/src/v4/core/json-schema.ts +0 -147
- package/node_modules/zod/src/v4/core/parse.ts +0 -195
- package/node_modules/zod/src/v4/core/regexes.ts +0 -177
- package/node_modules/zod/src/v4/core/registries.ts +0 -97
- package/node_modules/zod/src/v4/core/schemas.ts +0 -4317
- package/node_modules/zod/src/v4/core/standard-schema.ts +0 -64
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +0 -18
- package/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +0 -181
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
- package/node_modules/zod/src/v4/core/to-json-schema.ts +0 -1044
- package/node_modules/zod/src/v4/core/util.ts +0 -910
- package/node_modules/zod/src/v4/core/versions.ts +0 -5
- package/node_modules/zod/src/v4/core/zsf.ts +0 -323
- package/node_modules/zod/src/v4/index.ts +0 -4
- package/node_modules/zod/src/v4/locales/ar.ts +0 -125
- package/node_modules/zod/src/v4/locales/az.ts +0 -121
- package/node_modules/zod/src/v4/locales/be.ts +0 -184
- package/node_modules/zod/src/v4/locales/bg.ts +0 -136
- package/node_modules/zod/src/v4/locales/ca.ts +0 -127
- package/node_modules/zod/src/v4/locales/cs.ts +0 -142
- package/node_modules/zod/src/v4/locales/da.ts +0 -141
- package/node_modules/zod/src/v4/locales/de.ts +0 -124
- package/node_modules/zod/src/v4/locales/en.ts +0 -127
- package/node_modules/zod/src/v4/locales/eo.ts +0 -125
- package/node_modules/zod/src/v4/locales/es.ts +0 -159
- package/node_modules/zod/src/v4/locales/fa.ts +0 -134
- package/node_modules/zod/src/v4/locales/fi.ts +0 -131
- package/node_modules/zod/src/v4/locales/fr-CA.ts +0 -126
- package/node_modules/zod/src/v4/locales/fr.ts +0 -124
- package/node_modules/zod/src/v4/locales/he.ts +0 -125
- package/node_modules/zod/src/v4/locales/hu.ts +0 -126
- package/node_modules/zod/src/v4/locales/id.ts +0 -125
- package/node_modules/zod/src/v4/locales/index.ts +0 -47
- package/node_modules/zod/src/v4/locales/is.ts +0 -127
- package/node_modules/zod/src/v4/locales/it.ts +0 -125
- package/node_modules/zod/src/v4/locales/ja.ts +0 -122
- package/node_modules/zod/src/v4/locales/ka.ts +0 -138
- package/node_modules/zod/src/v4/locales/kh.ts +0 -7
- package/node_modules/zod/src/v4/locales/km.ts +0 -126
- package/node_modules/zod/src/v4/locales/ko.ts +0 -131
- package/node_modules/zod/src/v4/locales/lt.ts +0 -265
- package/node_modules/zod/src/v4/locales/mk.ts +0 -127
- package/node_modules/zod/src/v4/locales/ms.ts +0 -124
- package/node_modules/zod/src/v4/locales/nl.ts +0 -126
- package/node_modules/zod/src/v4/locales/no.ts +0 -124
- package/node_modules/zod/src/v4/locales/ota.ts +0 -125
- package/node_modules/zod/src/v4/locales/pl.ts +0 -126
- package/node_modules/zod/src/v4/locales/ps.ts +0 -133
- package/node_modules/zod/src/v4/locales/pt.ts +0 -123
- package/node_modules/zod/src/v4/locales/ru.ts +0 -184
- package/node_modules/zod/src/v4/locales/sl.ts +0 -126
- package/node_modules/zod/src/v4/locales/sv.ts +0 -127
- package/node_modules/zod/src/v4/locales/ta.ts +0 -125
- package/node_modules/zod/src/v4/locales/th.ts +0 -126
- package/node_modules/zod/src/v4/locales/tr.ts +0 -121
- package/node_modules/zod/src/v4/locales/ua.ts +0 -7
- package/node_modules/zod/src/v4/locales/uk.ts +0 -126
- package/node_modules/zod/src/v4/locales/ur.ts +0 -126
- package/node_modules/zod/src/v4/locales/vi.ts +0 -125
- package/node_modules/zod/src/v4/locales/yo.ts +0 -131
- package/node_modules/zod/src/v4/locales/zh-CN.ts +0 -123
- package/node_modules/zod/src/v4/locales/zh-TW.ts +0 -125
- package/node_modules/zod/src/v4/mini/checks.ts +0 -32
- package/node_modules/zod/src/v4/mini/coerce.ts +0 -22
- package/node_modules/zod/src/v4/mini/external.ts +0 -40
- package/node_modules/zod/src/v4/mini/index.ts +0 -3
- package/node_modules/zod/src/v4/mini/iso.ts +0 -62
- package/node_modules/zod/src/v4/mini/parse.ts +0 -14
- package/node_modules/zod/src/v4/mini/schemas.ts +0 -1725
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -129
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -51
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -144
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +0 -529
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -22
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -43
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -899
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -95
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -200
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -275
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -315
- package/node_modules/zod/src/v4-mini/index.ts +0 -1
- package/node_modules/zod/v3/ZodError.cjs +0 -138
- package/node_modules/zod/v3/ZodError.d.cts +0 -164
- package/node_modules/zod/v3/ZodError.d.ts +0 -164
- package/node_modules/zod/v3/ZodError.js +0 -133
- package/node_modules/zod/v3/errors.cjs +0 -17
- package/node_modules/zod/v3/errors.d.cts +0 -5
- package/node_modules/zod/v3/errors.d.ts +0 -5
- package/node_modules/zod/v3/errors.js +0 -9
- package/node_modules/zod/v3/external.cjs +0 -22
- package/node_modules/zod/v3/external.d.cts +0 -6
- package/node_modules/zod/v3/external.d.ts +0 -6
- package/node_modules/zod/v3/external.js +0 -6
- package/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
- package/node_modules/zod/v3/helpers/enumUtil.js +0 -1
- package/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.js +0 -6
- package/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
- package/node_modules/zod/v3/helpers/parseUtil.js +0 -109
- package/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
- package/node_modules/zod/v3/helpers/partialUtil.js +0 -1
- package/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.js +0 -1
- package/node_modules/zod/v3/helpers/util.cjs +0 -137
- package/node_modules/zod/v3/helpers/util.d.cts +0 -85
- package/node_modules/zod/v3/helpers/util.d.ts +0 -85
- package/node_modules/zod/v3/helpers/util.js +0 -133
- package/node_modules/zod/v3/index.cjs +0 -33
- package/node_modules/zod/v3/index.d.cts +0 -4
- package/node_modules/zod/v3/index.d.ts +0 -4
- package/node_modules/zod/v3/index.js +0 -4
- package/node_modules/zod/v3/locales/en.cjs +0 -112
- package/node_modules/zod/v3/locales/en.d.cts +0 -3
- package/node_modules/zod/v3/locales/en.d.ts +0 -3
- package/node_modules/zod/v3/locales/en.js +0 -109
- package/node_modules/zod/v3/package.json +0 -6
- package/node_modules/zod/v3/standard-schema.cjs +0 -2
- package/node_modules/zod/v3/standard-schema.d.cts +0 -102
- package/node_modules/zod/v3/standard-schema.d.ts +0 -102
- package/node_modules/zod/v3/standard-schema.js +0 -1
- package/node_modules/zod/v3/types.cjs +0 -3777
- package/node_modules/zod/v3/types.d.cts +0 -1034
- package/node_modules/zod/v3/types.d.ts +0 -1034
- package/node_modules/zod/v3/types.js +0 -3695
- package/node_modules/zod/v4/classic/checks.cjs +0 -32
- package/node_modules/zod/v4/classic/checks.d.cts +0 -1
- package/node_modules/zod/v4/classic/checks.d.ts +0 -1
- package/node_modules/zod/v4/classic/checks.js +0 -1
- package/node_modules/zod/v4/classic/coerce.cjs +0 -47
- package/node_modules/zod/v4/classic/coerce.d.cts +0 -17
- package/node_modules/zod/v4/classic/coerce.d.ts +0 -17
- package/node_modules/zod/v4/classic/coerce.js +0 -17
- package/node_modules/zod/v4/classic/compat.cjs +0 -61
- package/node_modules/zod/v4/classic/compat.d.cts +0 -50
- package/node_modules/zod/v4/classic/compat.d.ts +0 -50
- package/node_modules/zod/v4/classic/compat.js +0 -31
- package/node_modules/zod/v4/classic/errors.cjs +0 -74
- package/node_modules/zod/v4/classic/errors.d.cts +0 -30
- package/node_modules/zod/v4/classic/errors.d.ts +0 -30
- package/node_modules/zod/v4/classic/errors.js +0 -48
- package/node_modules/zod/v4/classic/external.cjs +0 -70
- package/node_modules/zod/v4/classic/external.d.cts +0 -13
- package/node_modules/zod/v4/classic/external.d.ts +0 -13
- package/node_modules/zod/v4/classic/external.js +0 -18
- package/node_modules/zod/v4/classic/index.cjs +0 -33
- package/node_modules/zod/v4/classic/index.d.cts +0 -4
- package/node_modules/zod/v4/classic/index.d.ts +0 -4
- package/node_modules/zod/v4/classic/index.js +0 -4
- package/node_modules/zod/v4/classic/iso.cjs +0 -60
- package/node_modules/zod/v4/classic/iso.d.cts +0 -22
- package/node_modules/zod/v4/classic/iso.d.ts +0 -22
- package/node_modules/zod/v4/classic/iso.js +0 -30
- package/node_modules/zod/v4/classic/package.json +0 -6
- package/node_modules/zod/v4/classic/parse.cjs +0 -41
- package/node_modules/zod/v4/classic/parse.d.cts +0 -31
- package/node_modules/zod/v4/classic/parse.d.ts +0 -31
- package/node_modules/zod/v4/classic/parse.js +0 -15
- package/node_modules/zod/v4/classic/schemas.cjs +0 -1151
- package/node_modules/zod/v4/classic/schemas.d.cts +0 -673
- package/node_modules/zod/v4/classic/schemas.d.ts +0 -673
- package/node_modules/zod/v4/classic/schemas.js +0 -1040
- package/node_modules/zod/v4/core/api.cjs +0 -1060
- package/node_modules/zod/v4/core/api.d.cts +0 -295
- package/node_modules/zod/v4/core/api.d.ts +0 -295
- package/node_modules/zod/v4/core/api.js +0 -925
- package/node_modules/zod/v4/core/checks.cjs +0 -595
- package/node_modules/zod/v4/core/checks.d.cts +0 -278
- package/node_modules/zod/v4/core/checks.d.ts +0 -278
- package/node_modules/zod/v4/core/checks.js +0 -569
- package/node_modules/zod/v4/core/core.cjs +0 -74
- package/node_modules/zod/v4/core/core.d.cts +0 -52
- package/node_modules/zod/v4/core/core.d.ts +0 -52
- package/node_modules/zod/v4/core/core.js +0 -67
- package/node_modules/zod/v4/core/doc.cjs +0 -39
- package/node_modules/zod/v4/core/doc.d.cts +0 -14
- package/node_modules/zod/v4/core/doc.d.ts +0 -14
- package/node_modules/zod/v4/core/doc.js +0 -35
- package/node_modules/zod/v4/core/errors.cjs +0 -213
- package/node_modules/zod/v4/core/errors.d.cts +0 -210
- package/node_modules/zod/v4/core/errors.d.ts +0 -210
- package/node_modules/zod/v4/core/errors.js +0 -182
- package/node_modules/zod/v4/core/index.cjs +0 -43
- package/node_modules/zod/v4/core/index.d.cts +0 -14
- package/node_modules/zod/v4/core/index.d.ts +0 -14
- package/node_modules/zod/v4/core/index.js +0 -14
- package/node_modules/zod/v4/core/json-schema.cjs +0 -2
- package/node_modules/zod/v4/core/json-schema.d.cts +0 -88
- package/node_modules/zod/v4/core/json-schema.d.ts +0 -88
- package/node_modules/zod/v4/core/json-schema.js +0 -1
- package/node_modules/zod/v4/core/package.json +0 -6
- package/node_modules/zod/v4/core/parse.cjs +0 -131
- package/node_modules/zod/v4/core/parse.d.cts +0 -49
- package/node_modules/zod/v4/core/parse.d.ts +0 -49
- package/node_modules/zod/v4/core/parse.js +0 -93
- package/node_modules/zod/v4/core/regexes.cjs +0 -136
- package/node_modules/zod/v4/core/regexes.d.cts +0 -78
- package/node_modules/zod/v4/core/regexes.d.ts +0 -78
- package/node_modules/zod/v4/core/regexes.js +0 -127
- package/node_modules/zod/v4/core/registries.cjs +0 -57
- package/node_modules/zod/v4/core/registries.d.cts +0 -35
- package/node_modules/zod/v4/core/registries.d.ts +0 -35
- package/node_modules/zod/v4/core/registries.js +0 -52
- package/node_modules/zod/v4/core/schemas.cjs +0 -1986
- package/node_modules/zod/v4/core/schemas.d.cts +0 -1113
- package/node_modules/zod/v4/core/schemas.d.ts +0 -1113
- package/node_modules/zod/v4/core/schemas.js +0 -1955
- package/node_modules/zod/v4/core/standard-schema.cjs +0 -2
- package/node_modules/zod/v4/core/standard-schema.d.cts +0 -55
- package/node_modules/zod/v4/core/standard-schema.d.ts +0 -55
- package/node_modules/zod/v4/core/standard-schema.js +0 -1
- package/node_modules/zod/v4/core/to-json-schema.cjs +0 -920
- package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -90
- package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -90
- package/node_modules/zod/v4/core/to-json-schema.js +0 -915
- package/node_modules/zod/v4/core/util.cjs +0 -658
- package/node_modules/zod/v4/core/util.d.cts +0 -197
- package/node_modules/zod/v4/core/util.d.ts +0 -197
- package/node_modules/zod/v4/core/util.js +0 -601
- package/node_modules/zod/v4/core/versions.cjs +0 -8
- package/node_modules/zod/v4/core/versions.d.cts +0 -5
- package/node_modules/zod/v4/core/versions.d.ts +0 -5
- package/node_modules/zod/v4/core/versions.js +0 -5
- package/node_modules/zod/v4/index.cjs +0 -22
- package/node_modules/zod/v4/index.d.cts +0 -3
- package/node_modules/zod/v4/index.d.ts +0 -3
- package/node_modules/zod/v4/index.js +0 -3
- package/node_modules/zod/v4/locales/ar.cjs +0 -143
- package/node_modules/zod/v4/locales/ar.d.cts +0 -5
- package/node_modules/zod/v4/locales/ar.d.ts +0 -4
- package/node_modules/zod/v4/locales/ar.js +0 -116
- package/node_modules/zod/v4/locales/az.cjs +0 -142
- package/node_modules/zod/v4/locales/az.d.cts +0 -5
- package/node_modules/zod/v4/locales/az.d.ts +0 -4
- package/node_modules/zod/v4/locales/az.js +0 -115
- package/node_modules/zod/v4/locales/be.cjs +0 -191
- package/node_modules/zod/v4/locales/be.d.cts +0 -5
- package/node_modules/zod/v4/locales/be.d.ts +0 -4
- package/node_modules/zod/v4/locales/be.js +0 -164
- package/node_modules/zod/v4/locales/bg.cjs +0 -156
- package/node_modules/zod/v4/locales/bg.d.cts +0 -5
- package/node_modules/zod/v4/locales/bg.d.ts +0 -5
- package/node_modules/zod/v4/locales/bg.js +0 -128
- package/node_modules/zod/v4/locales/ca.cjs +0 -145
- package/node_modules/zod/v4/locales/ca.d.cts +0 -5
- package/node_modules/zod/v4/locales/ca.d.ts +0 -4
- package/node_modules/zod/v4/locales/ca.js +0 -118
- package/node_modules/zod/v4/locales/cs.cjs +0 -162
- package/node_modules/zod/v4/locales/cs.d.cts +0 -5
- package/node_modules/zod/v4/locales/cs.d.ts +0 -4
- package/node_modules/zod/v4/locales/cs.js +0 -135
- package/node_modules/zod/v4/locales/da.cjs +0 -158
- package/node_modules/zod/v4/locales/da.d.cts +0 -5
- package/node_modules/zod/v4/locales/da.d.ts +0 -4
- package/node_modules/zod/v4/locales/da.js +0 -131
- package/node_modules/zod/v4/locales/de.cjs +0 -143
- package/node_modules/zod/v4/locales/de.d.cts +0 -5
- package/node_modules/zod/v4/locales/de.d.ts +0 -4
- package/node_modules/zod/v4/locales/de.js +0 -116
- package/node_modules/zod/v4/locales/en.cjs +0 -145
- package/node_modules/zod/v4/locales/en.d.cts +0 -5
- package/node_modules/zod/v4/locales/en.d.ts +0 -5
- package/node_modules/zod/v4/locales/en.js +0 -117
- package/node_modules/zod/v4/locales/eo.cjs +0 -144
- package/node_modules/zod/v4/locales/eo.d.cts +0 -5
- package/node_modules/zod/v4/locales/eo.d.ts +0 -5
- package/node_modules/zod/v4/locales/eo.js +0 -116
- package/node_modules/zod/v4/locales/es.cjs +0 -176
- package/node_modules/zod/v4/locales/es.d.cts +0 -5
- package/node_modules/zod/v4/locales/es.d.ts +0 -4
- package/node_modules/zod/v4/locales/es.js +0 -149
- package/node_modules/zod/v4/locales/fa.cjs +0 -149
- package/node_modules/zod/v4/locales/fa.d.cts +0 -5
- package/node_modules/zod/v4/locales/fa.d.ts +0 -4
- package/node_modules/zod/v4/locales/fa.js +0 -122
- package/node_modules/zod/v4/locales/fi.cjs +0 -149
- package/node_modules/zod/v4/locales/fi.d.cts +0 -5
- package/node_modules/zod/v4/locales/fi.d.ts +0 -4
- package/node_modules/zod/v4/locales/fi.js +0 -122
- package/node_modules/zod/v4/locales/fr-CA.cjs +0 -144
- package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -5
- package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr-CA.js +0 -117
- package/node_modules/zod/v4/locales/fr.cjs +0 -143
- package/node_modules/zod/v4/locales/fr.d.cts +0 -5
- package/node_modules/zod/v4/locales/fr.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr.js +0 -116
- package/node_modules/zod/v4/locales/he.cjs +0 -144
- package/node_modules/zod/v4/locales/he.d.cts +0 -5
- package/node_modules/zod/v4/locales/he.d.ts +0 -4
- package/node_modules/zod/v4/locales/he.js +0 -117
- package/node_modules/zod/v4/locales/hu.cjs +0 -144
- package/node_modules/zod/v4/locales/hu.d.cts +0 -5
- package/node_modules/zod/v4/locales/hu.d.ts +0 -4
- package/node_modules/zod/v4/locales/hu.js +0 -117
- package/node_modules/zod/v4/locales/id.cjs +0 -143
- package/node_modules/zod/v4/locales/id.d.cts +0 -5
- package/node_modules/zod/v4/locales/id.d.ts +0 -4
- package/node_modules/zod/v4/locales/id.js +0 -116
- package/node_modules/zod/v4/locales/index.cjs +0 -100
- package/node_modules/zod/v4/locales/index.d.cts +0 -47
- package/node_modules/zod/v4/locales/index.d.ts +0 -47
- package/node_modules/zod/v4/locales/index.js +0 -47
- package/node_modules/zod/v4/locales/is.cjs +0 -145
- package/node_modules/zod/v4/locales/is.d.cts +0 -5
- package/node_modules/zod/v4/locales/is.d.ts +0 -5
- package/node_modules/zod/v4/locales/is.js +0 -117
- package/node_modules/zod/v4/locales/it.cjs +0 -144
- package/node_modules/zod/v4/locales/it.d.cts +0 -5
- package/node_modules/zod/v4/locales/it.d.ts +0 -4
- package/node_modules/zod/v4/locales/it.js +0 -117
- package/node_modules/zod/v4/locales/ja.cjs +0 -142
- package/node_modules/zod/v4/locales/ja.d.cts +0 -5
- package/node_modules/zod/v4/locales/ja.d.ts +0 -4
- package/node_modules/zod/v4/locales/ja.js +0 -115
- package/node_modules/zod/v4/locales/ka.cjs +0 -153
- package/node_modules/zod/v4/locales/ka.d.cts +0 -5
- package/node_modules/zod/v4/locales/ka.d.ts +0 -5
- package/node_modules/zod/v4/locales/ka.js +0 -125
- package/node_modules/zod/v4/locales/kh.cjs +0 -12
- package/node_modules/zod/v4/locales/kh.d.cts +0 -5
- package/node_modules/zod/v4/locales/kh.d.ts +0 -5
- package/node_modules/zod/v4/locales/kh.js +0 -5
- package/node_modules/zod/v4/locales/km.cjs +0 -144
- package/node_modules/zod/v4/locales/km.d.cts +0 -5
- package/node_modules/zod/v4/locales/km.d.ts +0 -4
- package/node_modules/zod/v4/locales/km.js +0 -117
- package/node_modules/zod/v4/locales/ko.cjs +0 -148
- package/node_modules/zod/v4/locales/ko.d.cts +0 -5
- package/node_modules/zod/v4/locales/ko.d.ts +0 -4
- package/node_modules/zod/v4/locales/ko.js +0 -121
- package/node_modules/zod/v4/locales/lt.cjs +0 -258
- package/node_modules/zod/v4/locales/lt.d.cts +0 -5
- package/node_modules/zod/v4/locales/lt.d.ts +0 -5
- package/node_modules/zod/v4/locales/lt.js +0 -230
- package/node_modules/zod/v4/locales/mk.cjs +0 -145
- package/node_modules/zod/v4/locales/mk.d.cts +0 -5
- package/node_modules/zod/v4/locales/mk.d.ts +0 -4
- package/node_modules/zod/v4/locales/mk.js +0 -118
- package/node_modules/zod/v4/locales/ms.cjs +0 -143
- package/node_modules/zod/v4/locales/ms.d.cts +0 -5
- package/node_modules/zod/v4/locales/ms.d.ts +0 -4
- package/node_modules/zod/v4/locales/ms.js +0 -116
- package/node_modules/zod/v4/locales/nl.cjs +0 -144
- package/node_modules/zod/v4/locales/nl.d.cts +0 -5
- package/node_modules/zod/v4/locales/nl.d.ts +0 -4
- package/node_modules/zod/v4/locales/nl.js +0 -117
- package/node_modules/zod/v4/locales/no.cjs +0 -143
- package/node_modules/zod/v4/locales/no.d.cts +0 -5
- package/node_modules/zod/v4/locales/no.d.ts +0 -4
- package/node_modules/zod/v4/locales/no.js +0 -116
- package/node_modules/zod/v4/locales/ota.cjs +0 -144
- package/node_modules/zod/v4/locales/ota.d.cts +0 -5
- package/node_modules/zod/v4/locales/ota.d.ts +0 -4
- package/node_modules/zod/v4/locales/ota.js +0 -117
- package/node_modules/zod/v4/locales/package.json +0 -6
- package/node_modules/zod/v4/locales/pl.cjs +0 -144
- package/node_modules/zod/v4/locales/pl.d.cts +0 -5
- package/node_modules/zod/v4/locales/pl.d.ts +0 -4
- package/node_modules/zod/v4/locales/pl.js +0 -117
- package/node_modules/zod/v4/locales/ps.cjs +0 -149
- package/node_modules/zod/v4/locales/ps.d.cts +0 -5
- package/node_modules/zod/v4/locales/ps.d.ts +0 -4
- package/node_modules/zod/v4/locales/ps.js +0 -122
- package/node_modules/zod/v4/locales/pt.cjs +0 -143
- package/node_modules/zod/v4/locales/pt.d.cts +0 -5
- package/node_modules/zod/v4/locales/pt.d.ts +0 -4
- package/node_modules/zod/v4/locales/pt.js +0 -116
- package/node_modules/zod/v4/locales/ru.cjs +0 -191
- package/node_modules/zod/v4/locales/ru.d.cts +0 -5
- package/node_modules/zod/v4/locales/ru.d.ts +0 -4
- package/node_modules/zod/v4/locales/ru.js +0 -164
- package/node_modules/zod/v4/locales/sl.cjs +0 -144
- package/node_modules/zod/v4/locales/sl.d.cts +0 -5
- package/node_modules/zod/v4/locales/sl.d.ts +0 -4
- package/node_modules/zod/v4/locales/sl.js +0 -117
- package/node_modules/zod/v4/locales/sv.cjs +0 -145
- package/node_modules/zod/v4/locales/sv.d.cts +0 -5
- package/node_modules/zod/v4/locales/sv.d.ts +0 -4
- package/node_modules/zod/v4/locales/sv.js +0 -118
- package/node_modules/zod/v4/locales/ta.cjs +0 -144
- package/node_modules/zod/v4/locales/ta.d.cts +0 -5
- package/node_modules/zod/v4/locales/ta.d.ts +0 -4
- package/node_modules/zod/v4/locales/ta.js +0 -117
- package/node_modules/zod/v4/locales/th.cjs +0 -144
- package/node_modules/zod/v4/locales/th.d.cts +0 -5
- package/node_modules/zod/v4/locales/th.d.ts +0 -4
- package/node_modules/zod/v4/locales/th.js +0 -117
- package/node_modules/zod/v4/locales/tr.cjs +0 -143
- package/node_modules/zod/v4/locales/tr.d.cts +0 -5
- package/node_modules/zod/v4/locales/tr.d.ts +0 -5
- package/node_modules/zod/v4/locales/tr.js +0 -115
- package/node_modules/zod/v4/locales/ua.cjs +0 -12
- package/node_modules/zod/v4/locales/ua.d.cts +0 -5
- package/node_modules/zod/v4/locales/ua.d.ts +0 -5
- package/node_modules/zod/v4/locales/ua.js +0 -5
- package/node_modules/zod/v4/locales/uk.cjs +0 -144
- package/node_modules/zod/v4/locales/uk.d.cts +0 -5
- package/node_modules/zod/v4/locales/uk.d.ts +0 -4
- package/node_modules/zod/v4/locales/uk.js +0 -117
- package/node_modules/zod/v4/locales/ur.cjs +0 -144
- package/node_modules/zod/v4/locales/ur.d.cts +0 -5
- package/node_modules/zod/v4/locales/ur.d.ts +0 -4
- package/node_modules/zod/v4/locales/ur.js +0 -117
- package/node_modules/zod/v4/locales/vi.cjs +0 -143
- package/node_modules/zod/v4/locales/vi.d.cts +0 -5
- package/node_modules/zod/v4/locales/vi.d.ts +0 -4
- package/node_modules/zod/v4/locales/vi.js +0 -116
- package/node_modules/zod/v4/locales/yo.cjs +0 -142
- package/node_modules/zod/v4/locales/yo.d.cts +0 -5
- package/node_modules/zod/v4/locales/yo.d.ts +0 -4
- package/node_modules/zod/v4/locales/yo.js +0 -115
- package/node_modules/zod/v4/locales/zh-CN.cjs +0 -143
- package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -5
- package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-CN.js +0 -116
- package/node_modules/zod/v4/locales/zh-TW.cjs +0 -144
- package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -5
- package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-TW.js +0 -117
- package/node_modules/zod/v4/mini/checks.cjs +0 -34
- package/node_modules/zod/v4/mini/checks.d.cts +0 -1
- package/node_modules/zod/v4/mini/checks.d.ts +0 -1
- package/node_modules/zod/v4/mini/checks.js +0 -1
- package/node_modules/zod/v4/mini/coerce.cjs +0 -47
- package/node_modules/zod/v4/mini/coerce.d.cts +0 -7
- package/node_modules/zod/v4/mini/coerce.d.ts +0 -7
- package/node_modules/zod/v4/mini/coerce.js +0 -17
- package/node_modules/zod/v4/mini/external.cjs +0 -62
- package/node_modules/zod/v4/mini/external.d.cts +0 -11
- package/node_modules/zod/v4/mini/external.d.ts +0 -11
- package/node_modules/zod/v4/mini/external.js +0 -13
- package/node_modules/zod/v4/mini/index.cjs +0 -32
- package/node_modules/zod/v4/mini/index.d.cts +0 -3
- package/node_modules/zod/v4/mini/index.d.ts +0 -3
- package/node_modules/zod/v4/mini/index.js +0 -3
- package/node_modules/zod/v4/mini/iso.cjs +0 -60
- package/node_modules/zod/v4/mini/iso.d.cts +0 -22
- package/node_modules/zod/v4/mini/iso.d.ts +0 -22
- package/node_modules/zod/v4/mini/iso.js +0 -30
- package/node_modules/zod/v4/mini/package.json +0 -6
- package/node_modules/zod/v4/mini/parse.cjs +0 -16
- package/node_modules/zod/v4/mini/parse.d.cts +0 -1
- package/node_modules/zod/v4/mini/parse.d.ts +0 -1
- package/node_modules/zod/v4/mini/parse.js +0 -1
- package/node_modules/zod/v4/mini/schemas.cjs +0 -892
- package/node_modules/zod/v4/mini/schemas.d.cts +0 -407
- package/node_modules/zod/v4/mini/schemas.d.ts +0 -407
- package/node_modules/zod/v4/mini/schemas.js +0 -775
- package/node_modules/zod/v4/package.json +0 -6
- package/node_modules/zod/v4-mini/index.cjs +0 -17
- package/node_modules/zod/v4-mini/index.d.cts +0 -1
- package/node_modules/zod/v4-mini/index.d.ts +0 -1
- package/node_modules/zod/v4-mini/index.js +0 -1
- package/node_modules/zod/v4-mini/package.json +0 -6
- package/package/cc-switch-sdk/README.md +0 -541
- package/package/cc-switch-sdk/dist/constants.d.ts +0 -8
- package/package/cc-switch-sdk/dist/constants.js +0 -2
- package/package/cc-switch-sdk/dist/errors.d.ts +0 -5
- package/package/cc-switch-sdk/dist/errors.js +0 -2
- package/package/cc-switch-sdk/dist/index.d.ts +0 -5
- package/package/cc-switch-sdk/dist/index.js +0 -2
- package/package/cc-switch-sdk/dist/schemas.d.ts +0 -7
- package/package/cc-switch-sdk/dist/schemas.js +0 -2
- package/package/cc-switch-sdk/dist/sdk.d.ts +0 -59
- package/package/cc-switch-sdk/dist/sdk.js +0 -2
- package/package/cc-switch-sdk/dist/services/ai-config-service.js +0 -4
- package/package/cc-switch-sdk/dist/services/mcp-model.d.ts +0 -16
- package/package/cc-switch-sdk/dist/services/mcp-model.js +0 -2
- package/package/cc-switch-sdk/dist/services/mcp-service.d.ts +0 -17
- package/package/cc-switch-sdk/dist/services/mcp-service.js +0 -2
- package/package/cc-switch-sdk/dist/services/skill-model.d.ts +0 -16
- package/package/cc-switch-sdk/dist/services/skill-model.js +0 -2
- package/package/cc-switch-sdk/dist/services/skill-service.d.ts +0 -16
- package/package/cc-switch-sdk/dist/services/skill-service.js +0 -2
- package/package/cc-switch-sdk/dist/state.d.ts +0 -3
- package/package/cc-switch-sdk/dist/state.js +0 -2
- package/package/cc-switch-sdk/dist/types.d.ts +0 -78
- package/package/cc-switch-sdk/dist/types.js +0 -1
- package/package/cc-switch-sdk/dist/utils/fs.d.ts +0 -10
- package/package/cc-switch-sdk/dist/utils/fs.js +0 -3
- package/package/cc-switch-sdk/dist/utils/id.d.ts +0 -3
- package/package/cc-switch-sdk/dist/utils/id.js +0 -2
- package/package/cc-switch-sdk/package.json +0 -31
- /package/{node_modules/@cc-switch/sdk/dist/types.js → package/acode/dist/plugin-types.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{getEffective as _,hasAnyDefault as x}from"./capability-config.js";const E={},C="desktop",F="browser",D="agentSys.launchItem",N="agentSys.hire",h=new Set([F]),O=new Set,y=new Map,c=new Map,R=["fileReadOutside","commandExecution","fileModification"],P=new Set(["allow","ask","deny"]);function M(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;const t=e,n={};let o=!1;for(const r of R){const s=t[r];typeof s=="string"&&P.has(s)?(n[r]=s,o=!0):n[r]="allow"}return o?n:null}function j(e){if(e==null)return{...E};let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch{t=null}if(typeof t!="object"||t===null||Array.isArray(t))return{...E};const n={};for(const[o,r]of Object.entries(t))O.has(o)||typeof r=="boolean"&&(n[o]=r);return n}function z(e,t){if(!e)return;y.set(e,j(t));let n=t;if(typeof t=="string")try{n=JSON.parse(t)}catch{n=null}if(typeof n=="object"&&n!==null&&!Array.isArray(n)){const o=M(n.toolPermissions);o?c.set(e,o):c.delete(e)}else c.delete(e)}function L(e){return y.get(e)??{...E}}function Y(e,t){const n=L(e)[t];return n!==void 0?n:h.has(t)}function K(e){y.delete(e),c.delete(e),u.delete(e),A.delete(e)}function k(e){return c.get(e)??null}function H(e){return c.get(e)??{fileReadOutside:"allow",commandExecution:"allow",fileModification:"allow"}}const U=["skills","mcp","plugins"],u=new Map,A=new Map;function v(e){if(typeof e!="object"||e===null||Array.isArray(e))return;const t={};for(const[n,o]of Object.entries(e))n.trim()&&typeof o=="boolean"&&(t[n.trim()]=o);return t}function J(e,t){if(!e)return;if(t==null){u.delete(e);return}let n=t;if(typeof t=="string")try{n=JSON.parse(t)}catch{n=null}if(typeof n!="object"||n===null||Array.isArray(n)){u.delete(e);return}const o=n,r={};let s=!1;for(const a of U){const i=v(o[a]);i&&(r[a]=i,s=!0)}s?u.set(e,r):u.delete(e);const f=o.plugins,d={};let g=!1;if(typeof f=="object"&&f!==null&&!Array.isArray(f))for(const[a,i]of Object.entries(f)){const p=a.trim();if(p){if(typeof i=="boolean"){const l=r.plugins??{};l[p]=i,r.plugins=l,s=!0;continue}if(i!==null&&typeof i=="object"&&!Array.isArray(i)){const l=i,S=l.enabled!==!1,b=typeof l.url=="string"?l.url:void 0,T=typeof l.sha256=="string"?l.sha256:void 0,m=r.plugins??{};m[p]=S,r.plugins=m,s=!0,b&&(d[p]={url:b,sha256:T},g=!0)}}}g?A.set(e,d):A.delete(e)}function V(e){return u.get(e)??null}function W(e){return A.get(e)??null}function q(e,t,n){if(x(t))return _(e,t,n);const o=u.get(e);if(!o)return!0;const r=o[t];if(!r)return!0;const s=r[n];return s===void 0?!0:s}function w(){return y.size}export{F as BROWSER_FEATURE_KEY,U as CAPABILITY_TYPES,C as DESKTOP_FEATURE_KEY,N as HIRE_FEATURE_KEY,D as LAUNCH_ITEM_FEATURE_KEY,K as clearAgentFeatures,V as getAgentCapabilities,L as getAgentFeatures,W as getAgentPluginSources,k as getAgentToolPermissions,w as instanceFeaturesCacheSize,q as isCapabilityEnabled,Y as isFeatureEnabled,H as resolveAgentToolPermissions,J as setAgentCapabilities,z as setAgentFeatures};
|
|
2
2
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { AdapterResult, InitLogEntry, LegacyMcpStateItem, LegacySkillStateItem, McpPayload, SkillPackage, SyncStateResult } from '../types.js';
|
|
3
|
-
export declare function syncLegacyStateFromSdk(agentId: string, sdk: CcSwitchSdk): Promise<SyncStateResult>;
|
|
1
|
+
import type { InitLogEntry, LegacyMcpStateItem, LegacySkillStateItem, McpPayload, PluginPackage, SkillPackage } from '../types.js';
|
|
4
2
|
export declare function initInstance(agentId: string, workspacePath: string, options: {
|
|
5
3
|
skillEnabled?: boolean;
|
|
6
4
|
mcpEnabled?: boolean;
|
|
7
5
|
ccSwitchEnabledTools?: string[];
|
|
8
6
|
skillPackage?: SkillPackage;
|
|
9
7
|
skillPackages?: SkillPackage[];
|
|
8
|
+
pluginPackages?: PluginPackage[];
|
|
10
9
|
mcpServers?: McpPayload[];
|
|
11
10
|
}): Promise<{
|
|
12
11
|
ok: boolean;
|
|
@@ -26,7 +25,11 @@ export declare function initInstance(agentId: string, workspacePath: string, opt
|
|
|
26
25
|
configPath: string | null;
|
|
27
26
|
installedCount?: number;
|
|
28
27
|
};
|
|
29
|
-
|
|
28
|
+
plugin?: {
|
|
29
|
+
enabled: boolean;
|
|
30
|
+
packagePresent: boolean;
|
|
31
|
+
installedCount?: number;
|
|
32
|
+
};
|
|
30
33
|
installed?: {
|
|
31
34
|
skills: LegacySkillStateItem[];
|
|
32
35
|
mcpServers: LegacyMcpStateItem[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{promises as
|
|
1
|
+
import{promises as P}from"node:fs";import w from"node:path";import{downloadPluginZip as A,downloadSkillZip as D,ensureDir as y}from"../utils/file-utils.js";import{createLogger as O}from"../utils/logger.js";import{normalizeMcpPayload as j}from"../utils/mcp-utils.js";import{ensureEnabledTools as z,parseBoolean as T}from"../utils/validation.js";import{getAgentInitRoot as I,loadInstanceState as F,saveInstanceState as $}from"./instance-state.js";import{mcpDeployManager as B,reconcileMcpDefaultsFromDeployed as R}from"./mcp-deploy.js";import{reconcilePluginsDefaultsFromDeployed as L,pluginManager as Z}from"./plugin-manager.js";import{reconcileSkillsDefaultsFromDeployed as q,skillManager as x}from"./skill-manager.js";import{detectToolStatuses as U}from"./tool-installer.js";const W=O("instance-init");function G(i,m){const s=new Set(Object.values(m).filter(o=>o.installed).map(o=>o.tool));return i.filter(o=>s.has(o))}async function H(i,m){try{const s=await D(i,m);if(!s)return null;const o=await P.readFile(s.outputPath),c=i.defaultEnabled!==!1,f=String(i.skillName||"").trim()||void 0,e=await x.saveSharedSkill(o,s.fileName,c,i.sha256,f);return!e.ok||!e.skillName?null:{id:e.skillName,name:e.skillName,fileName:s.fileName,filePath:"",bytes:s.bytes,installedAt:new Date().toISOString()}}catch(s){return W.warn("\u6280\u80FD\u5305\u90E8\u7F72\u5230 bridge \u5931\u8D25\uFF08\u6309\u8DF3\u8FC7\u5904\u7406\uFF09: %s. %s",i.skillName||i.fileName||"(\u672A\u547D\u540D)",s instanceof Error?s.message:String(s)),null}}async function ne(i,m,s){const o=w.resolve(m),c=I(i),f=[];function e(t,l,n,a){f.push({step:t,status:l,message:n,timestamp:new Date().toISOString(),details:a})}e("prepare","running","\u5F00\u59CB\u521D\u59CB\u5316\u5B9E\u4F8B",{agentId:String(i),workspacePath:o}),await y(c),e("prepare","success","\u521D\u59CB\u5316\u76EE\u5F55\u5DF2\u5C31\u7EEA",{initRoot:c});const d=z(s.ccSwitchEnabledTools);e("detect-tools","running","\u5F00\u59CB\u68C0\u6D4B\u5DE5\u5177\u5B89\u88C5\u72B6\u6001",{tools:d});const u=await U(d);e("detect-tools","success","\u5DE5\u5177\u5B89\u88C5\u72B6\u6001\u68C0\u6D4B\u5B8C\u6210",{installedTools:Object.values(u).filter(t=>t.installed).map(t=>t.tool),missingTools:Object.values(u).filter(t=>!t.installed).map(t=>t.tool)});const C=G(d,u),b=Object.values(u).filter(t=>!t.installed),r={ok:!0,agentId:String(i),workspacePath:o,initRoot:c,enabledTools:d,toolStatus:u,logs:f,skill:{enabled:T(s.skillEnabled,!0),packagePresent:!1},mcp:{enabled:T(s.mcpEnabled,!0),configPath:null}},p=await F(i);if(b.length>0&&e("skip-uninstalled-tools","skipped","\u5DF2\u8DF3\u8FC7\u672A\u5B89\u88C5\u5DE5\u5177",{skippedTools:b.map(t=>({tool:t.tool,error:t.error}))}),e("select-installed-tools","success","\u5DF2\u9009\u62E9\u53EF\u521D\u59CB\u5316\u5DE5\u5177",{enabledTools:d,installedTools:C}),e("load-sdk","running","\u5F00\u59CB\u90E8\u7F72\u6280\u80FD/MCP \u6A21\u677F\u5230\u672C bridge"),e("load-sdk","success","\u6280\u80FD/MCP \u6A21\u677F\u90E8\u7F72\u51C6\u5907\u5B8C\u6210",{tools:d}),r.skill.enabled){e("install-skills","running","\u5F00\u59CB\u90E8\u7F72\u6280\u80FD\u5305",{count:Array.isArray(s.skillPackages)?s.skillPackages.length:s.skillPackage?1:0});const t=await y(w.join(c,"skills")),l=Array.isArray(s.skillPackages)&&s.skillPackages.length>0?s.skillPackages:s.skillPackage?[s.skillPackage]:[],n=[];for(const a of l){const S=await H(a,t);S&&n.push(S)}n.length>0?(r.skill.packagePresent=!0,r.skill.installedCount=n.length,r.skill.installed=n,e("install-skills","success","\u6280\u80FD\u5305\u90E8\u7F72\u5B8C\u6210",{installedCount:n.length,skills:n.map(a=>a.name)})):e("install-skills","skipped","\u6CA1\u6709\u53EF\u90E8\u7F72\u7684\u6280\u80FD\u5305")}else e("install-skills","skipped","\u5DF2\u8DF3\u8FC7\u6280\u80FD\u5305\u90E8\u7F72\uFF08skillEnabled=false\uFF09");const k=Array.isArray(s.pluginPackages)?s.pluginPackages:[];if(k.length>0){e("install-plugins","running","\u5F00\u59CB\u90E8\u7F72\u63D2\u4EF6\u6A21\u677F\u5305",{count:k.length});const t=await y(w.join(c,"plugins-tmp"));let l=0;for(const n of k)if(!(!n||!String(n.downloadUrl||"").trim()))try{const a=await A(n,t);if(!a)continue;const S=await P.readFile(a.outputPath),E=n.defaultEnabled!==!1,h=await Z.saveSharedPlugin(S,a.fileName,E,n.sha256);h.ok?(l++,e("install-plugins","success",`\u63D2\u4EF6 ${h.pluginName||a.fileName} \u5DF2\u90E8\u7F72\u5230\u672C bridge`)):e("install-plugins","error",`\u63D2\u4EF6 ${a.fileName} \u90E8\u7F72\u5931\u8D25: ${h.error||"\u672A\u77E5\u9519\u8BEF"}`)}catch(a){e("install-plugins","error",`\u63D2\u4EF6 ${n.fileName||"(\u672A\u547D\u540D)"} \u90E8\u7F72\u5931\u8D25: ${a instanceof Error?a.message:String(a)}`)}r.plugin={enabled:!0,packagePresent:k.length>0,installedCount:l},l>0?e("install-plugins","success","\u63D2\u4EF6\u6A21\u677F\u5305\u90E8\u7F72\u5B8C\u6210",{installedCount:l}):e("install-plugins","skipped","\u6CA1\u6709\u53EF\u90E8\u7F72\u7684\u63D2\u4EF6\u5305"),await P.rm(t,{recursive:!0,force:!0}).catch(()=>{})}const g=[];if(r.mcp.enabled){e("install-mcp","running","\u5F00\u59CB\u90E8\u7F72 MCP \u6A21\u677F",{count:Array.isArray(s.mcpServers)?s.mcpServers.length:0});const t=(Array.isArray(s.mcpServers)?s.mcpServers:[]).map(l=>j(l)).filter(l=>l!==null);for(const l of t){const n={type:l.transport||"stdio",command:l.command||void 0,url:l.url||void 0,args:l.args||void 0,env:l.env||void 0};B.saveMcp(l.name,n,l.enabled!==!1).ok&&g.push({id:l.id||"",name:l.name,transport:l.transport||"stdio",command:l.command||"",url:l.url||"",args:l.args||[],env:l.env||{},enabled:l.enabled!==!1,installedAt:new Date().toISOString()})}r.mcp.installedCount=g.length,e("install-mcp","success","MCP \u6A21\u677F\u90E8\u7F72\u5B8C\u6210",{installedCount:g.length,mcpServers:g.map(l=>l.name)})}else e("install-mcp","skipped","\u5DF2\u8DF3\u8FC7 MCP \u6A21\u677F\uFF08mcpEnabled=false\uFF09");e("persist-state","running","\u5F00\u59CB\u4FDD\u5B58\u5B9E\u4F8B\u72B6\u6001"),p.initialized=!0,p.enabledTools=d,p.toolStatus=u,p.skillEnabled=r.skill.enabled,p.mcpEnabled=r.mcp.enabled,await $(i,p),e("persist-state","success","\u5B9E\u4F8B\u72B6\u6001\u4FDD\u5B58\u5B8C\u6210");const v=q(),M=R(),N=L();return(v||M||N)&&e("sync-state","success","\u80FD\u529B\u9ED8\u8BA4\u5F00\u5173\u5DF2\u5BF9\u8D26\uFF08\u65B0\u589E\u9879\u9ED8\u8BA4\u5173\u95ED\uFF09",{reconciledSkills:v,reconciledMcp:M,reconciledPlugins:N}),e("sync-state","success","\u6280\u80FD/MCP \u6A21\u677F\u90E8\u7F72\u72B6\u6001\u5DF2\u5C31\u7EEA"),e("complete","success",b.length>0?"\u5B9E\u4F8B\u521D\u59CB\u5316\u5B8C\u6210\uFF0C\u672A\u5B89\u88C5\u5DE5\u5177\u5DF2\u8DF3\u8FC7":"\u5B9E\u4F8B\u521D\u59CB\u5316\u5B8C\u6210"),{...r,installed:{skills:r.skill.installed||[],mcpServers:g}}}export{ne as initInstance};
|
|
2
2
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{promises as
|
|
1
|
+
import{promises as s}from"node:fs";import p from"node:os";import a from"node:path";import{getRuntimeHomeDir as l}from"../config.js";import{atomicWriteJsonFile as c,ensureDir as m,sanitizeAgentId as o}from"../utils/file-utils.js";import{ensureEnabledTools as S,parseBoolean as u}from"../utils/validation.js";function f(e){return a.join(p.tmpdir(),"agentswork-runtime-init",o(String(e)),"state.json")}function g(){return{initialized:!1,skills:[],mcpServers:[],enabledTools:["acode","claude","opencode","codex"],toolStatus:{},skillEnabled:!0,mcpEnabled:!0,updatedAt:null}}function d(e){return a.join(l(),".aws-bridge","instances",o(String(e)),"state.json")}async function I(e){const t=d(e),r=f(e);try{const n=await s.readFile(t,"utf-8");return JSON.parse(n)}catch{try{const n=await s.readFile(r,"utf-8"),i=JSON.parse(n);return await c(t,i),i}catch{return g()}}}async function h(e,t){const r=d(e);await m(a.dirname(r));const n={initialized:!!t?.initialized,skills:Array.isArray(t?.skills)?t.skills:[],mcpServers:Array.isArray(t?.mcpServers)?t.mcpServers:[],enabledTools:S(t?.enabledTools),toolStatus:t?.toolStatus&&typeof t.toolStatus=="object"&&!Array.isArray(t.toolStatus)?t.toolStatus:{},skillEnabled:u(t?.skillEnabled,!0),mcpEnabled:u(t?.mcpEnabled,!0),updatedAt:new Date().toISOString()};return await c(r,n),n}function j(e){return a.join(l(),".aws-bridge","instances",o(String(e)))}export{j as getAgentInitRoot,d as getInstanceStateFile,I as loadInstanceState,h as saveInstanceState};
|
|
2
2
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import d from"node:crypto";import{promises as i}from"node:fs";import c from"node:os";import n from"node:path";import{atomicWriteJsonFile as g,withFileLock as y}from"../utils/file-utils.js";import{createLogger as j}from"../utils/logger.js";const f=j("jdk-scanner");function h(){return n.join(c.tmpdir(),"agentswork-runtime-bridge","jdk-registry.json")}function k(){const a=[];return process.env.JAVA_HOME&&a.push(process.env.JAVA_HOME),c.platform()==="win32"?a.push(n.join(process.env.ProgramFiles||"C:\\Program Files","Java"),n.join(process.env.ProgramFiles||"C:\\Program Files","Eclipse Adoptium"),n.join(process.env.ProgramFiles||"C:\\Program Files","Microsoft"),n.join(process.env.ProgramFiles||"C:\\Program Files","Amazon Corretto"),n.join(process.env.ProgramFiles||"C:\\Program Files","Zulu")):c.platform()==="darwin"?a.push("/Library/Java/JavaVirtualMachines"):a.push("/usr/lib/jvm","/opt/java","/opt/jdk","/usr/local/opt"),a.filter(Boolean)}function w(){return c.platform()==="win32"?"java.exe":"java"}async function u(a){try{return await i.access(n.join(a,"bin",w())),!0}catch{return!1}}async function m(a){try{return(await i.readFile(n.join(a,"release"),"utf-8")).match(/^JAVA_VERSION="?([^"\n]+)"?/m)?.[1]?.trim()||""}catch{return""}}async function C(a){try{return(await i.readdir(a,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>n.join(a,r.name))}catch{return[]}}function v(a){return`scan-${d.createHash("sha1").update(a.toLowerCase()).digest("hex").slice(0,12)}`}async function A(){const a=[],e=new Set,r=k();for(const t of r){const o=await C(t);for(const s of o){const p=s.toLowerCase();e.has(p)||(e.add(p),await u(s)&&a.push({id:v(s),name:n.basename(s),path:s,version:await m(s),source:"scan"}))}}if(process.env.JAVA_HOME&&!e.has(process.env.JAVA_HOME.toLowerCase())){const t=process.env.JAVA_HOME;e.add(t.toLowerCase()),await u(t)&&a.push({id:v(t),name:n.basename(t),path:t,version:await m(t),source:"scan"})}return a.sort((t,o)=>(o.version||"").localeCompare(t.version||"")||t.name.localeCompare(o.name)),a}async function l(){try{const a=await i.readFile(h(),"utf-8"),e=JSON.parse(a);return Array.isArray(e)?e:[]}catch{return[]}}async function J(a){const e=h();await y(e,async()=>{await g(e,a)})}async function D(){const a=await A(),e=await l();if(e.length===0)return a;const r=new Set(a.map(o=>o.path.toLowerCase())),t=[...a];for(const o of e){const s=o.path.toLowerCase();r.has(s)||await u(o.path)&&t.push({id:o.id,name:n.basename(o.path),path:o.path,version:await m(o.path),source:"manual"})}return t}async function V(a){const e=a.trim();if(!e)throw new Error("JDK \u8DEF\u5F84\u4E0D\u80FD\u4E3A\u7A7A");const r=n.resolve(e);if(!await u(r))throw new Error(`\u4E0D\u662F\u6709\u6548\u7684 JDK \u76EE\u5F55\uFF08\u7F3A\u5C11 bin/${w()}\uFF09: ${r}`);const t=await l();if(t.some(s=>s.path.toLowerCase()===r.toLowerCase()))throw new Error("\u8BE5 JDK \u5DF2\u6DFB\u52A0");const o=`manual-${d.randomUUID().slice(0,8)}`;return t.push({id:o,path:r}),await J(t),f.info(`[jdk] \u624B\u52A8\u6DFB\u52A0 JDK: id=${o}, path=${r}`),{id:o,name:n.basename(r),path:r,version:await m(r),source:"manual"}}async function x(a){if(!a.startsWith("manual-"))throw new Error("\u4EC5\u652F\u6301\u5220\u9664\u624B\u52A8\u6DFB\u52A0\u7684 JDK");const e=await l(),r=e.filter(t=>t.id!==a);return r.length===e.length?!1:(await J(r),f.info(`[jdk] \u5220\u9664\u624B\u52A8 JDK: id=${a}`),!0)}export{V as addManualJdk,D as listJdks,x as removeManualJdk,A as scanInstalledJdks};
|
|
2
2
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{exec as _,spawn as j}from"node:child_process";import{promises as z}from"node:fs";import A from"node:os";import M from"node:path";import{promisify as F}from"node:util";import{atomicWriteJsonFile as J,withFileLock as U}from"../utils/file-utils.js";import{createLogger as G}from"../utils/logger.js";import{
|
|
1
|
+
import{exec as _,spawn as j}from"node:child_process";import{promises as z}from"node:fs";import A from"node:os";import M from"node:path";import{promisify as F}from"node:util";import{atomicWriteJsonFile as J,withFileLock as U}from"../utils/file-utils.js";import{createLogger as G}from"../utils/logger.js";import{LaunchMetricsMonitor as V}from"./launch-metrics.js";import{getLaunchStreamHub as P}from"./launch-streams.js";import{getListeningPortsForProcessTrees as L}from"./port-detector.js";import{isProcessRunning as E,terminateProcessTree as k}from"./process-detector.js";import{RingBuffer as O}from"./ring-buffer.js";const C=F(_),g=G("launch-manager"),D=5e3,B=4096,X=1500,K=20;function H(){return M.join(A.tmpdir(),"agentswork-runtime-bridge","launch-runs.json")}function Y(l,t){return l.replace(/\$\{([^}]+)\}/g,(e,s)=>{const r=s.trim(),i=r.toUpperCase();if(i==="WORKSPACE")return t.workspacePath||"";if(i==="JAVA_HOME")return t.jdkPath||process.env.JAVA_HOME||"";if(i==="HOME")return A.homedir();if(t.env&&t.env[r]!==void 0)return t.env[r];if(t.env){for(const[n,a]of Object.entries(t.env))if(n.toUpperCase()===i)return a}return e})}function Z(l){const t={...process.env};l.env&&Object.assign(t,l.env);for(const e of Object.keys(t))if(e.toUpperCase()==="PATH"&&e!=="PATH"){const s=t[e];delete t[e],t.PATH===void 0&&typeof s=="string"&&(t.PATH=s)}if(l.jdkPath){t.JAVA_HOME=l.jdkPath;const e=M.join(l.jdkPath,"bin"),s=M.delimiter;t.PATH=t.PATH?`${e}${s}${t.PATH}`:e}return t}const Q=256,q=120;class N{constructor(t=()=>{}){this.utf8Probe=new TextDecoder("utf-8",{fatal:!0}),this.utf8=new TextDecoder("utf-8"),this.gbk=new TextDecoder("gbk"),this.mode=null,this.buffered=[],this.bufferedSize=0,this.flushTimer=null,this.onFlush=t}decode(t){return this.mode!==null?(this.mode==="gbk"?this.gbk:this.utf8).decode(t,{stream:!0}):(this.buffered.push(t),this.bufferedSize+=t.length,this.bufferedSize>=Q?this.commit():(this.flushTimer===null&&(this.flushTimer=setTimeout(()=>{this.flushTimer=null,this.onFlush(this.commit())},q)),""))}finalize(){return this.flushTimer!==null&&(clearTimeout(this.flushTimer),this.flushTimer=null),this.mode===null?this.commit():(this.mode==="gbk"?this.gbk:this.utf8).decode()}commit(){if(this.flushTimer!==null&&(clearTimeout(this.flushTimer),this.flushTimer=null),this.mode!==null)return"";const t=Buffer.concat(this.buffered,this.bufferedSize);this.buffered=[],this.bufferedSize=0;try{return this.utf8Probe.decode(t),this.mode="utf8",this.utf8.decode(t)}catch{return this.mode="gbk",this.gbk.decode(t)}}}function tt(l){const t=l.length>0&&!l.endsWith(`
|
|
2
2
|
`)?l+`
|
|
3
3
|
`:l;return t.length>B?t.slice(-B):t}async function et(l){const t=A.platform();for(let e=0;e<6;e+=1){try{if(t==="win32"){const s=`Get-CimInstance Win32_Process -Filter "ParentProcessId = ${l} AND Name <> 'conhost.exe'" | Select-Object -First 1 ProcessId | ConvertTo-Json -Compress`,r=Buffer.from(s,"utf16le").toString("base64"),{stdout:i}=await C(`powershell -NoProfile -NonInteractive -EncodedCommand ${r}`,{encoding:"utf8",timeout:5e3,windowsHide:!0}),n=i.replace(/#\s*<\s*CLIXML[\s\S]*?(?=\{|\[|$)/g,"").trim(),a=JSON.parse(n||"null"),h=Number(a?.ProcessId);if(Number.isFinite(h)&&h>0)return h}else{const{stdout:s}=await C(`pgrep -P ${l} | head -n 1`,{encoding:"utf8",timeout:3e3}),r=Number(s.trim());if(Number.isFinite(r)&&r>0)return r}}catch{}await new Promise(s=>setTimeout(s,300))}return null}class S{constructor(){this.runs=new Map,this.logs=new Map,this.startupWaiters=new Map,this.readinessMatchers=new Map,this.logListeners=new Map,this.metricsMonitor=new V(()=>this.runningRefs()),this.restored=!1}static getInstance(){return S.instance===null&&(S.instance=new S),S.instance}runningRefs(){const t=[];for(const e of this.runs.values())e.state==="running"&&e.pid>0&&t.push({configId:e.configId,pid:e.pid});return t}async start(t){const e=t.configId;if(!e||!e.trim())throw new Error("configId is required");if(!t.command||!t.command.trim())throw new Error("command is required");let s=null;if(t.readinessPattern&&t.readinessPattern.trim())try{s=new RegExp(t.readinessPattern.trim())}catch(o){throw new Error(`readinessPattern \u6B63\u5219\u8BED\u6CD5\u65E0\u6548: ${o.message}`)}const r=t.startedBy?.trim()||void 0;await this.ensureRestored();const i=this.runs.get(e);if(i&&i.state==="running"&&E(i.pid))throw new Error(`\u542F\u52A8\u9879\u5DF2\u5728\u8FD0\u884C: pid=${i.pid}`);const n=Y(t.command,{workspacePath:t.workspacePath,jdkPath:t.jdkPath,env:t.env}),a=t.cwd||t.workspacePath||process.cwd(),h=Z(t);g.info(`[start] \u542F\u52A8\u547D\u4EE4: configId=${e}, cwd=${a}, command=${n}`);let m;try{m=j(n,{cwd:a,env:h,shell:!0,windowsHide:!0})}catch(o){const c=`\u8FDB\u7A0B\u542F\u52A8\u5931\u8D25: ${o.message}`;throw g.error(`[start] spawn \u5931\u8D25: configId=${e}, error=${c}`),new Error(c)}const w=m.pid??0,T={configId:e,pid:w,state:"running",startedAt:new Date().toISOString(),command:n,cwd:a,...r?{startedBy:r}:{}};this.runs.set(e,T),this.publishRunStatus(e,!0),this.metricsMonitor.clear(e),this.metricsMonitor.ensureRunning();let p=this.logs.get(e);p||(p=new O(D),this.logs.set(e,p));const $=p.getSinceIndex(-1).nextIndex;s?this.readinessMatchers.set(e,{pattern:s,fromIndex:$+1}):this.readinessMatchers.delete(e);const b=p.append({stream:"stdout",text:`> ${n}
|
|
4
4
|
`});P().publish(e,"logs",b.index,b.data);let R=null;(async()=>{const o=await et(w),c=this.runs.get(e);o&&c?.pid===w&&(R=o,this.runs.set(e,{...c,pid:o}),await this.persist(),this.publishRunStatus(e))})();const x=o=>o!==void 0&&(o.pid===w||o.pid===R),u=new N(o=>{f("stdout",o)}),d=new N(o=>{f("stderr",o)}),f=(o,c)=>{const y=tt(c);if(y){const v=p.append({stream:o,text:y});P().publish(e,"logs",v.index,v.data);const I=this.logListeners.get(e);if(I&&I.size>0)for(const W of I)try{W(v)}catch{}}};return m.stdout.on("data",o=>{f("stdout",u.decode(o))}),m.stderr.on("data",o=>{f("stderr",d.decode(o))}),m.on("error",o=>{f("stderr",`[\u542F\u52A8\u5931\u8D25] ${o.message}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{existsSync as
|
|
1
|
+
import{existsSync as o,mkdirSync as g,copyFileSync as m,readdirSync as d,cpSync as p}from"node:fs";import e from"node:path";import{getAcodeDataHome as h,getAcodeSkillDataHome as y,getRuntimeHomeDir as a}from"../config.js";import{createLogger as S}from"../utils/logger.js";import{migrateOldBindingDir as k}from"./runtime-binding.js";const r=S("legacy-path-migration");function j(){return e.join(a(),".agentswork","runtime-bridge")}function u(){return e.join(a(),".aws-bridge")}function w(){const n=e.join(j(),"lifecycle-state.json"),t=e.join(u(),"lifecycle-state.json");o(n)&&!o(t)&&(g(u(),{recursive:!0}),m(n,t),r.info(`[runtime-bridge] \u5DF2\u8FC1\u79FB lifecycle-state.json \u2192 ${t}`))}function b(){const n=e.join(a(),".agentswork","snapshots"),t=e.join(u(),"snapshots");if(o(n)&&!o(t)){g(t,{recursive:!0});try{const s=d(n);for(const i of s){const l=e.join(n,i),c=e.join(t,i);m(l,c)}r.info(`[runtime-bridge] \u5DF2\u8FC1\u79FB snapshots/ \u5230 ${t}`)}catch{r.warn("[runtime-bridge] snapshots/ \u8FC1\u79FB\u5931\u8D25\uFF08\u90E8\u5206\u6587\u4EF6\u53EF\u80FD\u88AB\u8DF3\u8FC7\uFF09")}}}function O(){D();const n=j();if(!o(n)){const t=e.join(a(),".agentswork","snapshots");if(!o(t))return}r.info("[runtime-bridge] \u68C0\u6D4B\u5230\u65E7\u8DEF\u5F84 ~/.agentswork/\uFF0C\u6B63\u5728\u8FC1\u79FB\u5230 ~/.aws-bridge/ ..."),k(),w(),b()}function D(){const n=e.join(y(),"skills","deployed"),t=e.join(y(),"skills-runtime");R(n),v(t)}function $(n,t,s){if(!(!o(n)||o(t)))try{p(n,t,{recursive:!0}),r.info(`[runtime-bridge] \u5DF2\u8FC1\u79FB ${s} \u2192 ${t}`)}catch(i){r.warn(`[runtime-bridge] ${s} \u8FC1\u79FB\u5931\u8D25: ${i instanceof Error?i.message:String(i)}`)}}function R(n){const t=e.join(h(),"skills-deployed");$(t,n,"\u6280\u80FD\u90E8\u7F72\u533A")}function v(n){const t=e.join(a(),".aws-bridge","instances");if(!o(t))return;let s=[];try{s=d(t).filter(i=>!i.startsWith("."))}catch{return}for(const i of s){const l=e.join(t,i,"skills");if(!o(l))continue;const c=e.join(n,i);if(!o(c))try{p(l,c,{recursive:!0}),r.info(`[runtime-bridge] \u5DF2\u8FC1\u79FB\u5B9E\u4F8B\u6280\u80FD\u519C\u573A ${i} \u2192 ${c}`)}catch(f){r.warn(`[runtime-bridge] \u5B9E\u4F8B\u6280\u80FD\u519C\u573A ${i} \u8FC1\u79FB\u5931\u8D25: ${f instanceof Error?f.message:String(f)}`)}}}export{O as migrateOldPathsOnStartup,D as migrateSkillPaths};
|
|
2
2
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
`,{encoding:"utf8",mode:384})}function D(e){const t=new Date().toISOString(),r=n(e.schedulerBaseUrl)||c(void 0).url;return{operationId:p(),operationType:e.operationType,status:e.status||"accepted",requestedByUserId:e.requestedByUserId,requestedAt:t,updatedAt:t,schedulerBaseUrl:r,runtimeBridgeBaseUrl:u(e.runtimeBridgeBaseUrl),message:e.message,latestVersion:u(e.latestVersion)}}async function V(e){const r=(await a()).operations.filter(i=>i.operationId!==e.operationId);r.push({...e,updatedAt:new Date().toISOString()}),await f({operations:r})}async function I(e){const t=await a();await f({operations:t.operations.filter(r=>r.operationId!==e)})}function h(e){return["succeeded","failed","startup-confirmed"].includes(e.status)}async function S(e){const t=n(e.schedulerBaseUrl)||n(
|
|
1
|
+
import{randomUUID as p}from"node:crypto";import s from"node:fs/promises";import o from"node:path";import g from"axios";import{getRuntimeHomeDir as y,resolveSchedulerBaseUrlFrom as c}from"../config.js";import{createLogger as B}from"../utils/logger.js";import{getRuntimeAccessToken as w,loadRuntimeBinding as U,normalizeSchedulerBaseUrl as n}from"./runtime-binding.js";const d=B("bridge-lifecycle");function l(){return o.join(y(),".aws-bridge","lifecycle-state.json")}function u(e){return String(e||"").trim()||void 0}async function a(){try{const e=await s.readFile(l(),"utf8"),t=JSON.parse(e);return{operations:Array.isArray(t.operations)?t.operations:[]}}catch{return{operations:[]}}}async function f(e){const t=l();await s.mkdir(o.dirname(t),{recursive:!0}),await s.writeFile(t,`${JSON.stringify(e,null,2)}
|
|
2
|
+
`,{encoding:"utf8",mode:384})}function D(e){const t=new Date().toISOString(),r=n(e.schedulerBaseUrl)||c(void 0).url;return{operationId:p(),operationType:e.operationType,status:e.status||"accepted",requestedByUserId:e.requestedByUserId,requestedAt:t,updatedAt:t,schedulerBaseUrl:r,runtimeBridgeBaseUrl:u(e.runtimeBridgeBaseUrl),message:e.message,latestVersion:u(e.latestVersion)}}async function V(e){const r=(await a()).operations.filter(i=>i.operationId!==e.operationId);r.push({...e,updatedAt:new Date().toISOString()}),await f({operations:r})}async function I(e){const t=await a();await f({operations:t.operations.filter(r=>r.operationId!==e)})}function h(e){return["succeeded","failed","startup-confirmed"].includes(e.status)}async function S(e){const t=n(e.schedulerBaseUrl)||n(U().schedulerBaseUrl)||c(void 0).url,r=w(t);if(!r)throw new Error("runtime access token is missing");await g.post(`${t}/api/runtime/callback/bridge-lifecycle`,{operationId:e.operationId,operationType:e.operationType,status:e.status,requestedByUserId:e.requestedByUserId,message:e.message,error:e.error,runtimeBridgeBaseUrl:e.runtimeBridgeBaseUrl,latestVersion:e.latestVersion},{headers:{"X-Runtime-Token":r}})}function v(e){return e.operationType==="update"&&(e.status==="accepted"||e.status==="running")?{...e,status:"failed",message:"Bridge \u66F4\u65B0\u4E2D\u65AD\uFF0C\u8FDB\u7A0B\u5DF2\u91CD\u542F\uFF0C\u8BF7\u91CD\u65B0\u53D1\u8D77\u66F4\u65B0\u3002",error:e.error||"update interrupted by process restart"}:{...e,status:"startup-confirmed",message:e.operationType==="update"?e.latestVersion?`\u66F4\u65B0\u5E76\u91CD\u542F\u5B8C\u6210\uFF0C\u5F53\u524D\u7248\u672C v${e.latestVersion}\u3002`:"\u66F4\u65B0\u5E76\u91CD\u542F\u5B8C\u6210\u3002":"Bridge \u91CD\u542F\u5B8C\u6210\uFF0C\u5B9E\u4F8B\u5DF2\u6062\u590D\u8FD0\u884C\u3002"}}async function $(){const e=await a();for(const t of e.operations){const r=v(t);if(h(r))try{await S(r),await I(t.operationId),d.info(`[bridge-lifecycle] notification delivered: ${t.operationId}`)}catch(i){const m=i;d.warn(`[bridge-lifecycle] notification delivery failed: ${t.operationId}, ${m.message}`)}}}export{D as createBridgeLifecycleOperation,$ as deliverPendingBridgeLifecycleNotifications,a as loadLifecycleState,I as removeBridgeLifecycleOperation,V as upsertBridgeLifecycleOperation};
|
|
3
3
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
|
|
2
|
+
export interface DeployedMcpEntry {
|
|
3
|
+
name: string;
|
|
4
|
+
fileName: string;
|
|
5
|
+
defaultEnabled: boolean;
|
|
6
|
+
sha256?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface McpDeployResult {
|
|
9
|
+
ok: boolean;
|
|
10
|
+
error?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface McpDeploySpec {
|
|
15
|
+
type: string;
|
|
16
|
+
command?: string;
|
|
17
|
+
url?: string;
|
|
18
|
+
args?: string[];
|
|
19
|
+
env?: Record<string, string>;
|
|
20
|
+
headers?: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
export declare class McpDeployManager {
|
|
23
|
+
private readonly rootDir;
|
|
24
|
+
private static _instance;
|
|
25
|
+
static getInstance(): McpDeployManager;
|
|
26
|
+
private constructor();
|
|
27
|
+
private manifestFile;
|
|
28
|
+
private specFile;
|
|
29
|
+
private isHealthy;
|
|
30
|
+
private readManifest;
|
|
31
|
+
private writeManifest;
|
|
32
|
+
|
|
33
|
+
saveMcp(name: string, spec: McpDeploySpec, defaultEnabled?: boolean, sha256?: string): McpDeployResult;
|
|
34
|
+
|
|
35
|
+
removeMcp(name: string): {
|
|
36
|
+
ok: boolean;
|
|
37
|
+
error?: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
listDeployed(): DeployedMcpEntry[];
|
|
41
|
+
|
|
42
|
+
getSpec(name: string): McpDeploySpec | null;
|
|
43
|
+
|
|
44
|
+
resolveEnabledMcp(agentId: string, globalMcpServers: Record<string, unknown>): Record<string, unknown>;
|
|
45
|
+
|
|
46
|
+
deployedDefaultEnabled(): Record<string, boolean>;
|
|
47
|
+
}
|
|
48
|
+
export declare const mcpDeployManager: McpDeployManager;
|
|
49
|
+
export declare const reconcileMcpDefaultsFromDeployed: () => number;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{existsSync as h,mkdirSync as a,readFileSync as l,rmSync as m,writeFileSync as f}from"node:fs";import n from"node:path";import{getAcodeDataHome as y}from"../config.js";import{createLogger as d}from"../utils/logger.js";import{setDeployedDefaultsProvider as M,reconcileDefaultsFromDeployed as g}from"./capability-config.js";import{isCapabilityEnabled as p}from"./instance-features.js";const u=d("mcp-deploy"),D=1;class c{static getInstance(){return this._instance||(this._instance=new c(n.join(y(),"mcp-deployed"))),this._instance}constructor(e){this.rootDir=e}manifestFile(){return n.join(this.rootDir,"manifest.json")}specFile(e){const t=n.join(this.rootDir,`${e}.json`),r=n.resolve(this.rootDir);if(n.resolve(t)!==n.join(r,`${e}.json`))throw new Error(`MCP \u6A21\u677F\u6587\u4EF6\u8D8A\u51FA\u90E8\u7F72\u533A: ${e}`);return t}isHealthy(e){return h(this.specFile(e))}readManifest(){try{const e=JSON.parse(l(this.manifestFile(),"utf8"));return Array.isArray(e.servers)?e.servers.filter(t=>t&&t.name):[]}catch{return[]}}writeManifest(e){a(this.rootDir,{recursive:!0}),f(this.manifestFile(),`${JSON.stringify({version:D,servers:e},null,2)}
|
|
2
|
+
`,"utf8")}saveMcp(e,t,r=!0,i){if(!e||!/^[a-zA-Z0-9_.-]+$/.test(e))return{ok:!1,error:`MCP \u540D\u975E\u6CD5: ${JSON.stringify(e)}`};a(this.rootDir,{recursive:!0});try{f(this.specFile(e),`${JSON.stringify(t,null,2)}
|
|
3
|
+
`,"utf8")}catch(o){return{ok:!1,error:`MCP \u6A21\u677F\u5199\u5165\u5931\u8D25: ${o instanceof Error?o.message:String(o)}`}}const s=this.readManifest().filter(o=>o.name!==e);return s.push({name:e,fileName:`${e}.json`,defaultEnabled:r,sha256:i}),this.writeManifest(s),u.info("[mcp] MCP \u6A21\u677F\u5DF2\u90E8\u7F72\u5230 bridge: %s",e),{ok:!0,name:e}}removeMcp(e){if(!e||!/^[a-zA-Z0-9_.-]+$/.test(e))return{ok:!1,error:"name \u975E\u6CD5"};const t=this.readManifest().filter(r=>r.name!==e);this.writeManifest(t);try{m(this.specFile(e),{force:!0})}catch(r){return{ok:!1,error:`\u6A21\u677F\u6587\u4EF6\u6E05\u7406\u5931\u8D25: ${r instanceof Error?r.message:String(r)}`}}return u.info("[mcp] MCP \u6A21\u677F\u5DF2\u4ECE bridge \u79FB\u9664\u90E8\u7F72: %s",e),{ok:!0}}listDeployed(){return this.readManifest().map(e=>({...e,deployed:this.isHealthy(e.name)}))}getSpec(e){if(!this.isHealthy(e))return null;try{return JSON.parse(l(this.specFile(e),"utf8"))}catch{return null}}resolveEnabledMcp(e,t){const r={};for(const i of this.readManifest()){if(!p(e,"mcp",i.name)||!this.isHealthy(i.name))continue;const s=this.getSpec(i.name);s&&(r[i.name]={...s,type:s.type||"stdio"})}for(const[i,s]of Object.entries(t))p(e,"mcp",i)&&(r[i]||(r[i]=s));return r}deployedDefaultEnabled(){const e={};for(const t of this.readManifest())e[t.name]=t.defaultEnabled;return e}}c._instance=null;const S=c.getInstance();M("mcp",()=>S.deployedDefaultEnabled());const w=()=>g("mcp");export{c as McpDeployManager,S as mcpDeployManager,w as reconcileMcpDefaultsFromDeployed};
|
|
4
|
+
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ORPHAN_SCAN_INTERVAL as d,ORPHAN_AUTO_CLEAN_MODE as r,ORPHAN_SCAN_ENABLED as m,schedulerBaseUrl as o}from"../config.js";import{createLogger as f}from"../utils/logger.js";import{detectOrphanProcesses as g,checkAllSessionsHealth as w,terminateProcessTree as S,waitForProcessExit as $}from"./process-detector.js";import{getRuntimeAccessToken as c}from"./runtime-binding.js";import{shouldAutoCleanOrphanProcesses as l}from"./runtime-lifecycle-policy.js";import{loadPersistedSessions as y,savePersistedSessions as v}from"./terminal-persistence.js";const n=f("orphan-monitor");class O{constructor(){this.intervalId=null,this.lastScanTime=null,this.eventListeners=[],this.stopped=!1}async start(){if(!m){n.info("\u5B64\u513F\u8FDB\u7A0B\u76D1\u63A7\u5DF2\u7981\u7528 (AWS_ORPHAN_SCAN_ENABLED=false)");return}this.stopped=!1,n.info(`\u542F\u52A8\u5B64\u513F\u8FDB\u7A0B\u76D1\u63A7\uFF0C\u626B\u63CF\u95F4\u9694: ${d}ms, \u81EA\u52A8\u6E05\u7406\u6A21\u5F0F: ${r}`),await this.scan(),this.intervalId=setInterval(async()=>{await this.scan()},d),n.info("\u5B64\u513F\u8FDB\u7A0B\u76D1\u63A7\u5DF2\u542F\u52A8")}stop(){this.stopped=!0,this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null,n.info("\u5B64\u513F\u8FDB\u7A0B\u76D1\u63A7\u5DF2\u505C\u6B62"))}async scan(){if(this.stopped){n.debug("\u76D1\u63A7\u5668\u5DF2\u505C\u6B62\uFF0C\u8DF3\u8FC7\u626B\u63CF");return}this.lastScanTime=new Date,n.debug("\u5F00\u59CB\u626B\u63CF\u5B64\u513F\u8FDB\u7A0B...");try{const e=await y();if(this.stopped){n.debug("\u76D1\u63A7\u5668\u5DF2\u505C\u6B62\uFF0C\u4E2D\u65AD\u626B\u63CF");return}if(e.length===0){n.debug("\u65E0\u6301\u4E45\u5316\u4F1A\u8BDD\uFF0C\u8DF3\u8FC7\u626B\u63CF");return}const t=await g(e.map(s=>({agentId:s.agentId,pid:s.pid,workspacePath:s.workspacePath,command:s.command})));if(this.stopped){n.debug("\u76D1\u63A7\u5668\u5DF2\u505C\u6B62\uFF0C\u4E2D\u65AD\u626B\u63CF");return}const a=await w(e.filter(s=>s.pid).map(s=>({agentId:s.agentId,pid:s.pid})));if(this.stopped){n.debug("\u76D1\u63A7\u5668\u5DF2\u505C\u6B62\uFF0C\u4E2D\u65AD\u626B\u63CF");return}for(const s of t){if(this.stopped)break;await this.handleOrphanDetected(s.agentId,s.process.pid)}for(const[s,i]of a){if(this.stopped)break;i.status!=="healthy"&&i.alive&&await this.handleHealthIssue(s,i)}this.stopped||await this.cleanupDeadSessions(e,a)}catch(e){n.warn("\u626B\u63CF\u5B64\u513F\u8FDB\u7A0B\u5931\u8D25:",e)}}async handleOrphanDetected(e,t){const a={type:"orphan_detected",agentId:e,pid:t,message:`\u68C0\u6D4B\u5230\u5B64\u513F\u8FDB\u7A0B: agentId=${e}, pid=${t}`,timestamp:new Date};if(this.emit(a),n.warn(`\u68C0\u6D4B\u5230\u5B64\u513F\u8FDB\u7A0B: agentId=${e}, pid=${t}`),await this.checkAgentExistsOnServer(e)===!1){n.info(`agent ${e} \u5DF2\u4ECE\u670D\u52A1\u7AEF\u5220\u9664\uFF0C\u81EA\u52A8\u7EC8\u6B62\u6B8B\u7559\u8FDB\u7A0B pid=${t}`),await this.autoCleanOrphan(e,t);return}switch(r){case"auto":l()?await this.autoCleanOrphan(e,t):(n.warn("auto \u6A21\u5F0F\u672A\u542F\u7528\u7834\u574F\u6027\u6E05\u7406\u5F00\u5173\uFF0C\u6539\u4E3A\u544A\u8B66\u5E76\u4FDD\u7559\u5B64\u513F\u8FDB\u7A0B"),await this.reportToScheduler(e,"orphan_detected",{pid:t}));break;case"alert":await this.reportToScheduler(e,"orphan_detected",{pid:t});break;case"manual":n.info("manual \u6A21\u5F0F\uFF0C\u4EC5\u8BB0\u5F55\u65E5\u5FD7\uFF0C\u4E0D\u81EA\u52A8\u5904\u7406");break}}async handleHealthIssue(e,t){const a=t.status==="unresponsive"?"process_unresponsive":t.status==="high_cpu"?"process_high_cpu":"process_high_memory",s={type:a,agentId:e,pid:t.pid,message:`\u8FDB\u7A0B\u5065\u5EB7\u5F02\u5E38: ${t.status}, CPU=${t.cpu}%, Memory=${t.memoryMB}MB`,timestamp:new Date,details:{cpu:t.cpu,memoryMB:t.memoryMB}};this.emit(s),await this.reportToScheduler(e,a,{pid:t.pid,cpu:t.cpu,memoryMB:t.memoryMB}),r==="auto"&&t.status!=="healthy"&&l()?(n.warn(`auto \u6A21\u5F0F: \u7EC8\u6B62\u5F02\u5E38\u8FDB\u7A0B ${t.pid} (${t.status})`),await this.autoCleanOrphan(e,t.pid)):r==="auto"&&t.status!=="healthy"&&n.warn(`auto \u6A21\u5F0F\u672A\u542F\u7528\u7834\u574F\u6027\u6E05\u7406\u5F00\u5173\uFF0C\u4FDD\u7559\u5F02\u5E38\u8FDB\u7A0B ${t.pid} (${t.status})`)}async autoCleanOrphan(e,t){n.info(`\u81EA\u52A8\u6E05\u7406\u5B64\u513F\u8FDB\u7A0B\uFF1AagentId=${e}, pid=${t}`);const a=await S(t),s=await $(t,5e3);if(a.terminated>0&&s){const i={type:"orphan_cleaned",agentId:e,pid:t,message:`\u81EA\u52A8\u6E05\u7406\u6210\u529F\uFF1AagentId=${e}, pid=${t}, \u7EC8\u6B62\u4E86 ${a.terminated} \u4E2A\u8FDB\u7A0B`,timestamp:new Date,details:{terminated:a.terminated,failed:a.failed}};this.emit(i),await this.reportToScheduler(e,"orphan_cleaned",{pid:t,terminated:a.terminated,failed:a.failed})}else n.warn(`\u81EA\u52A8\u6E05\u7406\u5931\u8D25\uFF1AagentId=${e}, pid=${t}, terminated=${a.terminated}, exited=${s}`),await this.reportToScheduler(e,"orphan_clean_failed",{pid:t,terminated:a.terminated,failed:a.failed})}async cleanupDeadSessions(e,t){const a=e.filter(s=>s.pid?!t.get(s.agentId)?.alive:!1);if(a.length>0){n.info(`\u6E05\u7406 ${a.length} \u4E2A\u5DF2\u6B7B\u4EA1\u4F1A\u8BDD\u8BB0\u5F55`);const s=e.filter(i=>t.get(i.agentId)?.alive!==!1);await v(s)}}async checkAgentExistsOnServer(e){if(this.stopped)return null;try{const t=c(o)||c();if(!t)return n.debug("\u7F3A\u5C11 runtimeAccessToken\uFF0C\u65E0\u6CD5\u67E5\u8BE2 agent \u5B58\u5728\u6027"),null;const a=await fetch(`${o}/api/runtime/callback/agent-exists`,{method:"POST",headers:{"Content-Type":"application/json","X-Runtime-Token":t},body:JSON.stringify({agentId:e}),signal:AbortSignal.timeout(5e3)});return a.ok?(await a.json()).exists===!0:(n.debug(`\u67E5\u8BE2 agent \u5B58\u5728\u6027\u5931\u8D25: ${a.status}`),null)}catch(t){return n.debug("\u67E5\u8BE2 agent \u5B58\u5728\u6027\u5F02\u5E38:",t),null}}async reportToScheduler(e,t,a){if(this.stopped){n.debug(`\u76D1\u63A7\u5668\u5DF2\u505C\u6B62\uFF0C\u8DF3\u8FC7\u4E0A\u62A5: ${t}`);return}try{const s=c(o)||c();if(!s){n.debug(`\u7F3A\u5C11 runtimeAccessToken\uFF0C\u8DF3\u8FC7\u4E0A\u62A5: ${t}`);return}const i=await fetch(`${o}/api/runtime/callback/orphan-event`,{method:"POST",headers:{"Content-Type":"application/json","X-Runtime-Token":s},body:JSON.stringify({agentId:e,eventType:t,details:a,timestamp:new Date().toISOString()})});i.ok||(i.status===404?n.debug(`\u4E0A\u62A5\u5931\u8D25: \u8C03\u5EA6\u4E2D\u5FC3\u4E0D\u53EF\u8FBE (404)\uFF0C\u4E8B\u4EF6: ${t}`):n.warn(`\u4E0A\u62A5\u5931\u8D25: ${i.status}`))}catch(s){n.debug("\u4E0A\u62A5\u5230\u8C03\u5EA6\u4E2D\u5FC3\u5931\u8D25:",s)}}onEvent(e){this.eventListeners.push(e)}offEvent(e){const t=this.eventListeners.indexOf(e);t>-1&&this.eventListeners.splice(t,1)}emit(e){for(const t of this.eventListeners)try{t(e)}catch(a){n.warn("\u4E8B\u4EF6\u76D1\u542C\u5668\u6267\u884C\u5931\u8D25:",a)}}getStatus(){return{running:this.intervalId!==null,lastScanTime:this.lastScanTime,mode:r}}}let p=null;function h(){return p||(p=new O),p}async function E(){await h().start()}function M(){h().stop()}export{O as OrphanMonitor,h as getOrphanMonitor,E as startOrphanMonitor,M as stopOrphanMonitor};
|
|
2
2
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
|
|
2
|
+
export type PluginEventPriority = "urgent" | "normal" | "low";
|
|
3
|
+
|
|
4
|
+
export interface PluginEventMessage {
|
|
5
|
+
msgId: string;
|
|
6
|
+
|
|
7
|
+
channel?: string;
|
|
8
|
+
senderId: string;
|
|
9
|
+
senderName: string;
|
|
10
|
+
receiverId?: string;
|
|
11
|
+
content: string;
|
|
12
|
+
requireReply: boolean;
|
|
13
|
+
role?: "system" | "user" | "assistant";
|
|
14
|
+
timestamp: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PluginEventRecord {
|
|
17
|
+
plugin: string;
|
|
18
|
+
event: string;
|
|
19
|
+
priority: PluginEventPriority;
|
|
20
|
+
dedupKey?: string;
|
|
21
|
+
receivedAt: number;
|
|
22
|
+
message: PluginEventMessage;
|
|
23
|
+
}
|
|
24
|
+
export interface PluginEventDrainOptions {
|
|
25
|
+
|
|
26
|
+
maxPerKey?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface PluginEventDrainResult {
|
|
29
|
+
|
|
30
|
+
revision: number;
|
|
31
|
+
events: PluginEventMessage[];
|
|
32
|
+
}
|
|
33
|
+
export declare class PluginEventBuffer {
|
|
34
|
+
private readonly agentId;
|
|
35
|
+
private revision;
|
|
36
|
+
private records;
|
|
37
|
+
private dedup;
|
|
38
|
+
private nextSeq;
|
|
39
|
+
constructor(agentId: string);
|
|
40
|
+
get currentRevision(): number;
|
|
41
|
+
|
|
42
|
+
push(record: PluginEventRecord): boolean;
|
|
43
|
+
|
|
44
|
+
drain(opts?: PluginEventDrainOptions): PluginEventDrainResult;
|
|
45
|
+
|
|
46
|
+
private dropOldestLowestPriority;
|
|
47
|
+
|
|
48
|
+
private pruneDedup;
|
|
49
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const D=6e4,_=2e3,m=500,u={urgent:0,normal:1,low:2};class v{constructor(i){this.agentId=i,this.revision=0,this.records=[],this.dedup=new Map,this.nextSeq=1}get currentRevision(){return this.revision}push(i){const n=i.dedupKey||i.message.msgId,t=Date.now();if(n){const e=this.dedup.get(n);if(e!==void 0&&t-e<6e4)return!1;this.dedup.set(n,t)}for(this.pruneDedup(t),this.records.push({seq:this.nextSeq++,record:i});this.records.length>500;)this.dropOldestLowestPriority();return this.revision++,!0}drain(i={}){const n=Math.max(1,i.maxPerKey??10),t=this.revision;if(this.records.length===0)return{revision:t,events:[]};const e=[...this.records].sort((s,o)=>{const r=u[s.record.priority]-u[o.record.priority];return r!==0?r:s.seq-o.seq}),d=[],p=new Map,c=new Map;for(const s of e){const o=s.record,r=`${o.plugin}:${o.event}`,l=p.get(r)??0;if(l<n)p.set(r,l+1),d.push(s);else{const a=c.get(r);a?a.count++:c.set(r,{count:1,sample:o})}}const f=new Set(d.map(s=>s.seq));this.records=this.records.filter(s=>!f.has(s.seq));const h=d.map(s=>s.record.message);for(const[s,{count:o,sample:r}]of c)h.push({msgId:`plugin-collapse-${s}-${t}`,channel:"plugin-event",senderId:`plugin:${r.plugin}`,senderName:`\u63D2\u4EF6[${r.plugin}]`,receiverId:this.agentId||void 0,content:`\u3010\u63D2\u4EF6\u4E8B\u4EF6\u6298\u53E0\u3011\u63D2\u4EF6 ${r.plugin} \u7684 ${r.event} \u4E8B\u4EF6\u8FD8\u6709 ${o} \u6761\u5F85\u5904\u7406\uFF08\u672C\u6279\u6B21\u6BCF\u4E2A\u4E8B\u4EF6\u952E\u6700\u591A\u4EA4\u4ED8 ${n} \u6761\uFF0C\u5176\u4F59\u5DF2\u6298\u53E0\uFF1B\u7EE7\u7EED\u8C03\u7528\u63D2\u4EF6\u5DE5\u5177\u6216\u7B49\u5F85\u4E0B\u6279 poll \u4EA4\u4ED8\uFF09\u3002`,requireReply:!1,role:"system",timestamp:new Date(r.receivedAt).toISOString()});return{revision:t,events:h}}dropOldestLowestPriority(){if(this.records.length===0)return;let i=0,n=-1;for(let t=0;t<this.records.length;t++){const e=u[this.records[t].record.priority];if(e>n&&(n=e,i=t,e===2))break}this.records.splice(i,1)}pruneDedup(i){if(this.dedup.size<=2e3)return;for(const[e,d]of this.dedup)i-d>=6e4&&this.dedup.delete(e);if(this.dedup.size<=2e3)return;const n=[...this.dedup.entries()].sort((e,d)=>e[1]-d[1]),t=this.dedup.size-2e3;for(let e=0;e<t;e++)this.dedup.delete(n[e][0])}}export{v as PluginEventBuffer};
|
|
2
|
+
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
|
|
2
|
+
import { type ACodeCommandSpec, type ACodePluginBridge, type PluginCatalogSnapshot, type PluginInvokeContext, type PluginManageRequest, type PluginManageResult, type PluginSummary, type PluginToolInvocationResult, type PluginToolSchema, type JsonObject } from "@agentswork/acode";
|
|
3
|
+
import { type PluginEventMessage, type PluginEventPriority } from "./plugin-event-buffer.js";
|
|
4
|
+
|
|
5
|
+
export declare const BUILTIN_PLUGIN_NAME = "plugin-manager";
|
|
6
|
+
export declare const BUILTIN_PLUGIN_DESCRIPTION = "\u7CFB\u7EDF\u5185\u7F6E\uFF1A\u7BA1\u7406\u63D2\u4EF6\u7684\u751F\u547D\u5468\u671F\uFF08\u5B89\u88C5/\u5378\u8F7D/\u542F\u505C/\u91CD\u8F7D\uFF09\uFF1B\u5F00\u53D1\u63D2\u4EF6\u7528\u5185\u7F6E /create-plugin \u547D\u4EE4";
|
|
7
|
+
|
|
8
|
+
export declare const BUILTIN_PLUGIN_MANAGE_DESC = "\u300C\u63D2\u4EF6\u7BA1\u7406\u63D2\u4EF6\u300D\u7684\u751F\u547D\u5468\u671F\u5DE5\u5177\uFF1A\u7BA1\u7406\u63D2\u4EF6\uFF08\u5B89\u88C5/\u5378\u8F7D/\u91CD\u8F7D/\u542F\u505C/\u5217\u8868\uFF09\u3002\u4EC5\u5F53\u7528\u6237\u660E\u786E\u8981\u6C42\u5B89\u88C5\u3001\u79FB\u9664\u6216\u4FEE\u590D\u63D2\u4EF6\u65F6\u4F7F\u7528\u3002\n- action=list\uFF1A\u5217\u51FA\u5DF2\u5B89\u88C5\u63D2\u4EF6\uFF08\u72B6\u6001\u3001\u76D1\u542C\u5668\u5065\u5EB7\u3001\u5DE5\u5177\u6570\uFF09\u3002\n- action=install\uFF1Asource \u4E3A\u63D2\u4EF6\u6765\u6E90\uFF0C\u5F53\u524D\u652F\u6301 \"local:<\u4EFB\u610F\u63D2\u4EF6\u76EE\u5F55\u7EDD\u5BF9\u8DEF\u5F84>\"\uFF08\u4E0D\u505A\u76EE\u5F55\u4F4D\u7F6E\u9650\u5236\uFF09\uFF1Bconfig \u4F20\u63D2\u4EF6 manifest \u91CC userConfig \u58F0\u660E\u7684\u914D\u7F6E\u503C\u3002\u5B89\u88C5\u65F6\u4F1A\u5148\u628A\u8BE5\u76EE\u5F55\u79FB\u52A8\u5230\u672C agent \u52A0\u8F7D\u63D2\u4EF6\u7684\u4F4D\u7F6E\uFF0C\u518D\u52A0\u8F7D\u79FB\u52A8\u540E\u7684\u526F\u672C\uFF08\u79FB\u52A8\u540E\u6E90\u76EE\u5F55\u4E0D\u518D\u4FDD\u7559\uFF09\uFF0C\u5B89\u88C5\u540E\u7ACB\u5373\u751F\u6548\uFF1A\u4E0B\u4E00\u6B21 poll_message \u7684 pluginCatalog \u5373\u53EF\u89C1\u3002\n- action=reload\uFF1A\u91CD\u8F7D\u6307\u5B9A\u63D2\u4EF6\uFF08\u6539\u8FC7\u63D2\u4EF6\u6587\u4EF6\u540E\u4F7F\u7528\uFF09\uFF0C\u539F\u5B50\u6362\u88C5\uFF0C\u76D1\u542C\u5668\u91CD\u542F\u3002\n- action=enable / disable\uFF1A\u505C\u7528/\u542F\u7528\uFF08disable \u4FDD\u7559\u5B89\u88C5\u4E0E\u914D\u7F6E\uFF0C\u4EC5\u505C\u6B62\u76D1\u542C\u4E0E\u5DE5\u5177\u8C03\u7528\uFF09\u3002\n- action=uninstall\uFF1A\u5378\u8F7D\u5E76\u5220\u9664\u63D2\u4EF6\u76EE\u5F55\uFF08\u4E0D\u53EF\u9006\uFF0C\u9700\u7528\u6237\u660E\u786E\u8981\u6C42\uFF09\u3002";
|
|
9
|
+
|
|
10
|
+
export declare function getBuiltinCommandDir(): string;
|
|
11
|
+
export interface PluginUserConfigField {
|
|
12
|
+
key: string;
|
|
13
|
+
type?: "string" | "number" | "boolean";
|
|
14
|
+
required?: boolean;
|
|
15
|
+
sensitive?: boolean;
|
|
16
|
+
description?: string;
|
|
17
|
+
default?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface PluginHandlerDef {
|
|
20
|
+
type: "process" | "module" | "mcp";
|
|
21
|
+
|
|
22
|
+
command?: string;
|
|
23
|
+
|
|
24
|
+
shell?: boolean;
|
|
25
|
+
|
|
26
|
+
stdin?: "none" | "params";
|
|
27
|
+
|
|
28
|
+
timeoutMs?: number;
|
|
29
|
+
|
|
30
|
+
module?: string;
|
|
31
|
+
|
|
32
|
+
export?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface PluginToolDef {
|
|
35
|
+
name: string;
|
|
36
|
+
title?: string;
|
|
37
|
+
description: string;
|
|
38
|
+
inputSchema?: Record<string, unknown>;
|
|
39
|
+
handler: PluginHandlerDef;
|
|
40
|
+
}
|
|
41
|
+
export interface PluginTransportDef {
|
|
42
|
+
type: "command-stream" | "poll-command" | "http-callback";
|
|
43
|
+
|
|
44
|
+
command?: string;
|
|
45
|
+
|
|
46
|
+
intervalMs?: number;
|
|
47
|
+
|
|
48
|
+
restartBackoffMs?: number;
|
|
49
|
+
}
|
|
50
|
+
export interface PluginListenerDef {
|
|
51
|
+
event: string;
|
|
52
|
+
description?: string;
|
|
53
|
+
transport: PluginTransportDef;
|
|
54
|
+
|
|
55
|
+
delivery?: "poll" | "force" | "wake";
|
|
56
|
+
priority?: PluginEventPriority;
|
|
57
|
+
|
|
58
|
+
matcher?: Record<string, string | number | boolean | Array<string | number | boolean>>;
|
|
59
|
+
|
|
60
|
+
dedupKey?: string;
|
|
61
|
+
|
|
62
|
+
toolHints?: string[];
|
|
63
|
+
|
|
64
|
+
promptTemplate?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface PluginManifest {
|
|
67
|
+
name: string;
|
|
68
|
+
version?: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
author?: Record<string, unknown>;
|
|
71
|
+
tools?: string;
|
|
72
|
+
listeners?: string;
|
|
73
|
+
commands?: string;
|
|
74
|
+
userConfig?: PluginUserConfigField[];
|
|
75
|
+
[key: string]: unknown;
|
|
76
|
+
}
|
|
77
|
+
export declare function validateAgainstSchema(schema: unknown, value: unknown, path?: string): string[];
|
|
78
|
+
export interface PluginManagerOptions {
|
|
79
|
+
|
|
80
|
+
rootDir?: string;
|
|
81
|
+
|
|
82
|
+
runtimeRootDir?: string;
|
|
83
|
+
}
|
|
84
|
+
export declare class PluginManager {
|
|
85
|
+
private agents;
|
|
86
|
+
private readonly rootDir;
|
|
87
|
+
private readonly runtimeRootDir;
|
|
88
|
+
|
|
89
|
+
private moduleNonce;
|
|
90
|
+
constructor(options?: PluginManagerOptions);
|
|
91
|
+
forAgent(agentId: string): ACodePluginBridge;
|
|
92
|
+
|
|
93
|
+
setOnPluginsChanged(cb: (agentId: string) => void): void;
|
|
94
|
+
private onPluginsChanged?;
|
|
95
|
+
private notifyPluginsChanged;
|
|
96
|
+
|
|
97
|
+
getCommandDirs(agentId: string): Promise<string[]>;
|
|
98
|
+
|
|
99
|
+
getPluginCommands(agentId: string): Promise<ACodeCommandSpec[]>;
|
|
100
|
+
private parsePluginCommandDir;
|
|
101
|
+
private parseCommandDir;
|
|
102
|
+
list(agentId: string): Promise<PluginSummary[]>;
|
|
103
|
+
|
|
104
|
+
private deployedPluginVersion;
|
|
105
|
+
getCatalog(agentId: string): Promise<PluginCatalogSnapshot>;
|
|
106
|
+
getToolSchema(agentId: string, qualifiedName: string): Promise<PluginToolSchema | null>;
|
|
107
|
+
invokeTool(agentId: string, pluginName: string, toolName: string, params: JsonObject, ctx?: PluginInvokeContext): Promise<PluginToolInvocationResult>;
|
|
108
|
+
|
|
109
|
+
private buildManageRequest;
|
|
110
|
+
private executeHandler;
|
|
111
|
+
private invokeProcessHandler;
|
|
112
|
+
private invokeModuleHandler;
|
|
113
|
+
|
|
114
|
+
private buildPluginEnv;
|
|
115
|
+
manage(agentId: string, request: PluginManageRequest): Promise<PluginManageResult>;
|
|
116
|
+
private doManage;
|
|
117
|
+
private installPlugin;
|
|
118
|
+
|
|
119
|
+
installFromZip(agentId: string, zipBuffer: Buffer, originalName: string, config?: Record<string, string>): Promise<PluginManageResult>;
|
|
120
|
+
|
|
121
|
+
private installFromDirectory;
|
|
122
|
+
private uninstallPlugin;
|
|
123
|
+
private reloadPlugin;
|
|
124
|
+
private setEnabled;
|
|
125
|
+
private deployedDir;
|
|
126
|
+
private deployedManifestFile;
|
|
127
|
+
|
|
128
|
+
private deployedPluginDir;
|
|
129
|
+
|
|
130
|
+
private legacySharedDir;
|
|
131
|
+
private readSharedManifest;
|
|
132
|
+
private writeSharedManifest;
|
|
133
|
+
|
|
134
|
+
private migrateLegacySharedIfNeeded;
|
|
135
|
+
|
|
136
|
+
private deployedPluginHealthy;
|
|
137
|
+
|
|
138
|
+
private runtimeDirFor;
|
|
139
|
+
private runtimeLinkPath;
|
|
140
|
+
|
|
141
|
+
private ensureRuntimeLink;
|
|
142
|
+
|
|
143
|
+
private removeRuntimeLink;
|
|
144
|
+
|
|
145
|
+
saveSharedPlugin(zipBuffer: Buffer, originalName: string, defaultEnabled?: boolean, sha256?: string): Promise<{
|
|
146
|
+
ok: boolean;
|
|
147
|
+
error?: string;
|
|
148
|
+
pluginName?: string;
|
|
149
|
+
}>;
|
|
150
|
+
|
|
151
|
+
private deployPluginZipToPersistentDir;
|
|
152
|
+
|
|
153
|
+
private suspendDeployedPluginAcrossAgents;
|
|
154
|
+
|
|
155
|
+
applySharedToKnownAgents(): Promise<Array<{
|
|
156
|
+
agentId: string;
|
|
157
|
+
installed: string[];
|
|
158
|
+
}>>;
|
|
159
|
+
|
|
160
|
+
private syncSharedIntoStateQueued;
|
|
161
|
+
|
|
162
|
+
private effectiveSharedEnabled;
|
|
163
|
+
|
|
164
|
+
private templatePullInFlight;
|
|
165
|
+
|
|
166
|
+
private backgroundTemplatePulls;
|
|
167
|
+
|
|
168
|
+
private pullTemplatePluginsFromCapabilities;
|
|
169
|
+
|
|
170
|
+
private queueTemplatePull;
|
|
171
|
+
|
|
172
|
+
private syncSharedIntoState;
|
|
173
|
+
|
|
174
|
+
private cleanupRuntimeDir;
|
|
175
|
+
|
|
176
|
+
applyCapabilities(agentId: string): Promise<void>;
|
|
177
|
+
drainEvents(agentId: string, opts?: {
|
|
178
|
+
maxPerKey?: number;
|
|
179
|
+
}): Promise<{
|
|
180
|
+
revision: number;
|
|
181
|
+
events: PluginEventMessage[];
|
|
182
|
+
catalog: PluginCatalogSnapshot;
|
|
183
|
+
|
|
184
|
+
compactionSeq: number;
|
|
185
|
+
}>;
|
|
186
|
+
|
|
187
|
+
markAgentCompacted(agentId: string): void;
|
|
188
|
+
|
|
189
|
+
enqueueExternalEvent(agentId: string, pluginName: string, payload: Record<string, unknown>): Promise<{
|
|
190
|
+
ok: boolean;
|
|
191
|
+
error?: string;
|
|
192
|
+
}>;
|
|
193
|
+
|
|
194
|
+
private bumpCatalogRevision;
|
|
195
|
+
private agentState;
|
|
196
|
+
|
|
197
|
+
private hydrate;
|
|
198
|
+
private doHydrate;
|
|
199
|
+
private installedFile;
|
|
200
|
+
private persistInstalled;
|
|
201
|
+
|
|
202
|
+
private sensitiveKeysOf;
|
|
203
|
+
|
|
204
|
+
private stripSensitiveValues;
|
|
205
|
+
private secretsFile;
|
|
206
|
+
|
|
207
|
+
private readSecrets;
|
|
208
|
+
|
|
209
|
+
private persistSecrets;
|
|
210
|
+
private readJsonFile;
|
|
211
|
+
private loadManifestOnly;
|
|
212
|
+
|
|
213
|
+
private validateUserConfigValues;
|
|
214
|
+
private loadPluginFromDir;
|
|
215
|
+
|
|
216
|
+
private ensureListenersRunning;
|
|
217
|
+
private startAllListeners;
|
|
218
|
+
private stopAllListeners;
|
|
219
|
+
private startListener;
|
|
220
|
+
private spawnListenerChild;
|
|
221
|
+
private scheduleListenerRestart;
|
|
222
|
+
|
|
223
|
+
private pollListenerOnce;
|
|
224
|
+
private stopListener;
|
|
225
|
+
private handleListenerLine;
|
|
226
|
+
private enqueueEvent;
|
|
227
|
+
private requiredParamsOf;
|
|
228
|
+
private toSummary;
|
|
229
|
+
getLogs(agentId: string, pluginName: string): Promise<{
|
|
230
|
+
ok: boolean;
|
|
231
|
+
error?: string;
|
|
232
|
+
logs: string[];
|
|
233
|
+
}>;
|
|
234
|
+
|
|
235
|
+
stopAgent(agentId: string): Promise<void>;
|
|
236
|
+
|
|
237
|
+
stopAll(): Promise<void>;
|
|
238
|
+
|
|
239
|
+
listDeployed(): Promise<Array<{
|
|
240
|
+
pluginName: string;
|
|
241
|
+
version?: string;
|
|
242
|
+
fileName: string;
|
|
243
|
+
defaultEnabled: boolean;
|
|
244
|
+
sha256?: string;
|
|
245
|
+
deployed: boolean;
|
|
246
|
+
}>>;
|
|
247
|
+
|
|
248
|
+
deployedDefaultEnabled(): Record<string, boolean>;
|
|
249
|
+
|
|
250
|
+
removeDeployedPlugin(pluginName: string): Promise<{
|
|
251
|
+
ok: boolean;
|
|
252
|
+
error?: string;
|
|
253
|
+
}>;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export declare function isValidPluginName(name: unknown): name is string;
|
|
257
|
+
export declare function validateManifest(manifest: Record<string, unknown>): string | null;
|
|
258
|
+
|
|
259
|
+
export declare function renderCommandArgv(command: string, lookup: Record<string, unknown>): string[];
|
|
260
|
+
|
|
261
|
+
export declare const pluginManager: PluginManager;
|
|
262
|
+
export declare const reconcilePluginsDefaultsFromDeployed: () => number;
|