@stigmer/cli 3.35.0 → 3.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth/auth0.d.ts.map +1 -1
- package/auth/auth0.js.map +1 -1
- package/auth/callback-server.d.ts.map +1 -1
- package/auth/callback-server.js.map +1 -1
- package/auth/index.d.ts.map +1 -1
- package/auth/index.js.map +1 -1
- package/auth/login.d.ts.map +1 -1
- package/auth/login.js.map +1 -1
- package/auth/pages.d.ts.map +1 -1
- package/auth/pages.js.map +1 -1
- package/auth/pkce.d.ts.map +1 -1
- package/auth/pkce.js.map +1 -1
- package/auth/token.d.ts.map +1 -1
- package/auth/token.js.map +1 -1
- package/backend.d.ts.map +1 -1
- package/backend.js.map +1 -1
- package/cli/stigmer.d.ts.map +1 -1
- package/cli/stigmer.js.map +1 -1
- package/client/client.d.ts.map +1 -1
- package/client/client.js.map +1 -1
- package/client/index.d.ts.map +1 -1
- package/client/index.js.map +1 -1
- package/commands/agent-exec-flags.d.ts.map +1 -1
- package/commands/agent-exec-flags.js.map +1 -1
- package/commands/apikey/duration.d.ts.map +1 -1
- package/commands/apikey/duration.js.map +1 -1
- package/commands/apikey/index.d.ts.map +1 -1
- package/commands/apikey/index.js.map +1 -1
- package/commands/apply.d.ts.map +1 -1
- package/commands/apply.js.map +1 -1
- package/commands/auth/index.d.ts.map +1 -1
- package/commands/auth/index.js.map +1 -1
- package/commands/auth/login.d.ts.map +1 -1
- package/commands/auth/login.js.map +1 -1
- package/commands/auth/whoami.d.ts.map +1 -1
- package/commands/auth/whoami.js.map +1 -1
- package/commands/bootstrap.d.ts.map +1 -1
- package/commands/bootstrap.js.map +1 -1
- package/commands/completion.d.ts.map +1 -1
- package/commands/completion.js.map +1 -1
- package/commands/config/backend.d.ts.map +1 -1
- package/commands/config/backend.js.map +1 -1
- package/commands/config/context.d.ts.map +1 -1
- package/commands/config/context.js.map +1 -1
- package/commands/config/index.d.ts.map +1 -1
- package/commands/config/index.js.map +1 -1
- package/commands/config/kv.d.ts.map +1 -1
- package/commands/config/kv.js.map +1 -1
- package/commands/connect.d.ts.map +1 -1
- package/commands/connect.js.map +1 -1
- package/commands/delete.d.ts.map +1 -1
- package/commands/delete.js.map +1 -1
- package/commands/diff.d.ts.map +1 -1
- package/commands/diff.js.map +1 -1
- package/commands/down.d.ts.map +1 -1
- package/commands/down.js.map +1 -1
- package/commands/download.d.ts.map +1 -1
- package/commands/download.js.map +1 -1
- package/commands/execution/approve.d.ts.map +1 -1
- package/commands/execution/approve.js.map +1 -1
- package/commands/execution/control.d.ts.map +1 -1
- package/commands/execution/control.js.map +1 -1
- package/commands/execution/index.d.ts.map +1 -1
- package/commands/execution/index.js.map +1 -1
- package/commands/execution/logs.d.ts.map +1 -1
- package/commands/execution/logs.js.map +1 -1
- package/commands/execution/trace.d.ts.map +1 -1
- package/commands/execution/trace.js.map +1 -1
- package/commands/get.d.ts.map +1 -1
- package/commands/get.js.map +1 -1
- package/commands/install.d.ts.map +1 -1
- package/commands/install.js.map +1 -1
- package/commands/internal-daemon.d.ts.map +1 -1
- package/commands/internal-daemon.js.map +1 -1
- package/commands/list.d.ts.map +1 -1
- package/commands/list.js.map +1 -1
- package/commands/logs.d.ts.map +1 -1
- package/commands/logs.js.map +1 -1
- package/commands/marketplace.d.ts.map +1 -1
- package/commands/marketplace.js.map +1 -1
- package/commands/mcp-server.d.ts.map +1 -1
- package/commands/mcp-server.js.map +1 -1
- package/commands/push.d.ts.map +1 -1
- package/commands/push.js.map +1 -1
- package/commands/reset.d.ts.map +1 -1
- package/commands/reset.js.map +1 -1
- package/commands/resume.d.ts.map +1 -1
- package/commands/resume.js.map +1 -1
- package/commands/run.d.ts.map +1 -1
- package/commands/run.js.map +1 -1
- package/commands/schedule.d.ts.map +1 -1
- package/commands/schedule.js.map +1 -1
- package/commands/search.d.ts.map +1 -1
- package/commands/search.js.map +1 -1
- package/commands/setup.d.ts.map +1 -1
- package/commands/setup.js.map +1 -1
- package/commands/share.d.ts.map +1 -1
- package/commands/share.js.map +1 -1
- package/commands/shared.d.ts.map +1 -1
- package/commands/shared.js.map +1 -1
- package/commands/status.d.ts.map +1 -1
- package/commands/status.js.map +1 -1
- package/commands/tag.d.ts.map +1 -1
- package/commands/tag.js.map +1 -1
- package/commands/up.d.ts.map +1 -1
- package/commands/up.js.map +1 -1
- package/commands/usage.d.ts.map +1 -1
- package/commands/usage.js.map +1 -1
- package/commands/validate.d.ts.map +1 -1
- package/commands/validate.js.map +1 -1
- package/commands/version.d.ts.map +1 -1
- package/commands/version.js.map +1 -1
- package/config/config.d.ts.map +1 -1
- package/config/config.js.map +1 -1
- package/config/index.d.ts.map +1 -1
- package/config/index.js.map +1 -1
- package/config/keys.d.ts.map +1 -1
- package/config/keys.js.map +1 -1
- package/config/paths.d.ts.map +1 -1
- package/config/paths.js.map +1 -1
- package/config/resolve.d.ts.map +1 -1
- package/config/resolve.js.map +1 -1
- package/errors/classify.d.ts.map +1 -1
- package/errors/classify.js.map +1 -1
- package/errors/cli-exit-error.d.ts.map +1 -1
- package/errors/cli-exit-error.js.map +1 -1
- package/errors/exit-codes.d.ts.map +1 -1
- package/errors/exit-codes.js.map +1 -1
- package/errors/handle.d.ts.map +1 -1
- package/errors/handle.js.map +1 -1
- package/errors/index.d.ts.map +1 -1
- package/errors/index.js.map +1 -1
- package/errors/usage-error.d.ts.map +1 -1
- package/errors/usage-error.js.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/local/artifact.d.ts.map +1 -1
- package/local/artifact.js.map +1 -1
- package/local/bootstrap.d.ts.map +1 -1
- package/local/bootstrap.js.map +1 -1
- package/local/constants.d.ts.map +1 -1
- package/local/constants.js.map +1 -1
- package/local/daemon/components.d.ts.map +1 -1
- package/local/daemon/components.js.map +1 -1
- package/local/daemon/env.d.ts.map +1 -1
- package/local/daemon/env.js.map +1 -1
- package/local/daemon/host.d.ts.map +1 -1
- package/local/daemon/host.js.map +1 -1
- package/local/daemon/index.d.ts.map +1 -1
- package/local/daemon/index.js.map +1 -1
- package/local/daemon/launch.d.ts.map +1 -1
- package/local/daemon/launch.js.map +1 -1
- package/local/daemon/process.d.ts.map +1 -1
- package/local/daemon/process.js.map +1 -1
- package/local/daemon/supervisor.d.ts.map +1 -1
- package/local/daemon/supervisor.js.map +1 -1
- package/local/daemon/types.d.ts.map +1 -1
- package/local/daemon/types.js.map +1 -1
- package/local/llm-config.d.ts.map +1 -1
- package/local/llm-config.js.map +1 -1
- package/local/logs/tail.d.ts.map +1 -1
- package/local/logs/tail.js.map +1 -1
- package/local/logs/view.d.ts.map +1 -1
- package/local/logs/view.js.map +1 -1
- package/local/net/tcp.d.ts.map +1 -1
- package/local/net/tcp.js.map +1 -1
- package/local/operator-config.d.ts.map +1 -1
- package/local/operator-config.js.map +1 -1
- package/local/paths.d.ts.map +1 -1
- package/local/paths.js.map +1 -1
- package/local/reset.d.ts.map +1 -1
- package/local/reset.js.map +1 -1
- package/local/runtime/index.d.ts.map +1 -1
- package/local/runtime/index.js.map +1 -1
- package/local/runtime/node.d.ts.map +1 -1
- package/local/runtime/node.js.map +1 -1
- package/local/runtime/runner.d.ts.map +1 -1
- package/local/runtime/runner.js.map +1 -1
- package/local/runtime/runtimes-install.d.ts.map +1 -1
- package/local/runtime/runtimes-install.js.map +1 -1
- package/local/runtime/server.d.ts.map +1 -1
- package/local/runtime/server.js.map +1 -1
- package/local/runtime/which.d.ts.map +1 -1
- package/local/runtime/which.js.map +1 -1
- package/local/setup/prompt.d.ts.map +1 -1
- package/local/setup/prompt.js.map +1 -1
- package/local/setup/wizard.d.ts.map +1 -1
- package/local/setup/wizard.js.map +1 -1
- package/local/state/health-state.d.ts.map +1 -1
- package/local/state/health-state.js.map +1 -1
- package/local/state/index.d.ts.map +1 -1
- package/local/state/index.js.map +1 -1
- package/local/state/lock.d.ts.map +1 -1
- package/local/state/lock.js.map +1 -1
- package/local/state/log-rotation.d.ts.map +1 -1
- package/local/state/log-rotation.js.map +1 -1
- package/local/state/pidfile.d.ts.map +1 -1
- package/local/state/pidfile.js.map +1 -1
- package/local/state/proc.d.ts.map +1 -1
- package/local/state/proc.js.map +1 -1
- package/local/state/startup-config.d.ts.map +1 -1
- package/local/state/startup-config.js.map +1 -1
- package/local/status.d.ts.map +1 -1
- package/local/status.js.map +1 -1
- package/local/temporal/download.d.ts.map +1 -1
- package/local/temporal/download.js.map +1 -1
- package/local/temporal/index.d.ts.map +1 -1
- package/local/temporal/index.js.map +1 -1
- package/local/temporal/inspect.d.ts.map +1 -1
- package/local/temporal/inspect.js.map +1 -1
- package/local/temporal/manager.d.ts.map +1 -1
- package/local/temporal/manager.js.map +1 -1
- package/local/temporal/supervisor.d.ts.map +1 -1
- package/local/temporal/supervisor.js.map +1 -1
- package/local/webconsole/index.d.ts.map +1 -1
- package/local/webconsole/index.js.map +1 -1
- package/logger.d.ts.map +1 -1
- package/logger.js.map +1 -1
- package/marketplace/config.d.ts.map +1 -1
- package/marketplace/config.js.map +1 -1
- package/marketplace/github.d.ts.map +1 -1
- package/marketplace/github.js.map +1 -1
- package/marketplace/index.d.ts.map +1 -1
- package/marketplace/index.js.map +1 -1
- package/marketplace/install.d.ts.map +1 -1
- package/marketplace/install.js.map +1 -1
- package/marketplace/materialize.d.ts.map +1 -1
- package/marketplace/materialize.js.map +1 -1
- package/marketplace/official.d.ts.map +1 -1
- package/marketplace/official.js.map +1 -1
- package/marketplace/read.d.ts.map +1 -1
- package/marketplace/read.js.map +1 -1
- package/marketplace/ref.d.ts.map +1 -1
- package/marketplace/ref.js.map +1 -1
- package/marketplace/render.d.ts.map +1 -1
- package/marketplace/render.js.map +1 -1
- package/output/command-result.d.ts.map +1 -1
- package/output/command-result.js.map +1 -1
- package/output/confirm.d.ts.map +1 -1
- package/output/confirm.js.map +1 -1
- package/output/format.d.ts.map +1 -1
- package/output/format.js.map +1 -1
- package/output/index.d.ts.map +1 -1
- package/output/index.js.map +1 -1
- package/output/ndjson.d.ts.map +1 -1
- package/output/ndjson.js.map +1 -1
- package/output/proto.d.ts.map +1 -1
- package/output/proto.js.map +1 -1
- package/output/style.d.ts.map +1 -1
- package/output/style.js.map +1 -1
- package/output/table.d.ts.map +1 -1
- package/output/table.js.map +1 -1
- package/package.json +7 -7
- package/program.d.ts.map +1 -1
- package/program.js.map +1 -1
- package/registry/aliases.d.ts.map +1 -1
- package/registry/aliases.js.map +1 -1
- package/registry/index.d.ts.map +1 -1
- package/registry/index.js.map +1 -1
- package/registry/metadata.d.ts.map +1 -1
- package/registry/metadata.js.map +1 -1
- package/registry/registry.d.ts.map +1 -1
- package/registry/registry.js.map +1 -1
- package/registry/verb-support.d.ts.map +1 -1
- package/registry/verb-support.js.map +1 -1
- package/registry/verbs.d.ts.map +1 -1
- package/registry/verbs.js.map +1 -1
- package/resources/apply/apply.d.ts.map +1 -1
- package/resources/apply/apply.js.map +1 -1
- package/resources/apply/discovery.d.ts.map +1 -1
- package/resources/apply/discovery.js.map +1 -1
- package/resources/apply/handlers.d.ts.map +1 -1
- package/resources/apply/handlers.js.map +1 -1
- package/resources/connect/connect.d.ts.map +1 -1
- package/resources/connect/connect.js.map +1 -1
- package/resources/connect/discover.d.ts.map +1 -1
- package/resources/connect/discover.js.map +1 -1
- package/resources/connect/display.d.ts.map +1 -1
- package/resources/connect/display.js.map +1 -1
- package/resources/connect/oauth.d.ts.map +1 -1
- package/resources/connect/oauth.js.map +1 -1
- package/resources/cursor-pages.d.ts.map +1 -1
- package/resources/cursor-pages.js.map +1 -1
- package/resources/delete.d.ts.map +1 -1
- package/resources/delete.js.map +1 -1
- package/resources/diff.d.ts.map +1 -1
- package/resources/diff.js.map +1 -1
- package/resources/documents.d.ts.map +1 -1
- package/resources/documents.js.map +1 -1
- package/resources/download.d.ts.map +1 -1
- package/resources/download.js.map +1 -1
- package/resources/execution-approve.d.ts.map +1 -1
- package/resources/execution-approve.js.map +1 -1
- package/resources/execution-control.d.ts.map +1 -1
- package/resources/execution-control.js.map +1 -1
- package/resources/execution-format.d.ts.map +1 -1
- package/resources/execution-format.js.map +1 -1
- package/resources/execution-logs.d.ts.map +1 -1
- package/resources/execution-logs.js.map +1 -1
- package/resources/execution-trace.d.ts.map +1 -1
- package/resources/execution-trace.js.map +1 -1
- package/resources/execution.d.ts.map +1 -1
- package/resources/execution.js.map +1 -1
- package/resources/get-bindings.d.ts.map +1 -1
- package/resources/get-bindings.js.map +1 -1
- package/resources/get.d.ts.map +1 -1
- package/resources/get.js.map +1 -1
- package/resources/git.d.ts.map +1 -1
- package/resources/git.js.map +1 -1
- package/resources/ignore/index.d.ts.map +1 -1
- package/resources/ignore/index.js.map +1 -1
- package/resources/ignore/matcher.d.ts.map +1 -1
- package/resources/ignore/matcher.js.map +1 -1
- package/resources/list.d.ts.map +1 -1
- package/resources/list.js.map +1 -1
- package/resources/mcp/placeholder-resolver.d.ts.map +1 -1
- package/resources/mcp/placeholder-resolver.js.map +1 -1
- package/resources/mcp/runtime-env.d.ts.map +1 -1
- package/resources/mcp/runtime-env.js.map +1 -1
- package/resources/picker/ink.d.ts.map +1 -1
- package/resources/picker/ink.js.map +1 -1
- package/resources/picker/tty.d.ts.map +1 -1
- package/resources/picker/tty.js.map +1 -1
- package/resources/plugin.d.ts.map +1 -1
- package/resources/plugin.js.map +1 -1
- package/resources/reference.d.ts.map +1 -1
- package/resources/reference.js.map +1 -1
- package/resources/render.d.ts.map +1 -1
- package/resources/render.js.map +1 -1
- package/resources/run/agent-exec.d.ts.map +1 -1
- package/resources/run/agent-exec.js.map +1 -1
- package/resources/run/attachments.d.ts.map +1 -1
- package/resources/run/attachments.js.map +1 -1
- package/resources/run/create.d.ts.map +1 -1
- package/resources/run/create.js.map +1 -1
- package/resources/run/env.d.ts.map +1 -1
- package/resources/run/env.js.map +1 -1
- package/resources/run/epilogue.d.ts.map +1 -1
- package/resources/run/epilogue.js.map +1 -1
- package/resources/run/header.d.ts.map +1 -1
- package/resources/run/header.js.map +1 -1
- package/resources/run/prepare.d.ts.map +1 -1
- package/resources/run/prepare.js.map +1 -1
- package/resources/run/resolve.d.ts.map +1 -1
- package/resources/run/resolve.js.map +1 -1
- package/resources/run/resume.d.ts.map +1 -1
- package/resources/run/resume.js.map +1 -1
- package/resources/run/stream.d.ts.map +1 -1
- package/resources/run/stream.js.map +1 -1
- package/resources/run/workflow-stream.d.ts.map +1 -1
- package/resources/run/workflow-stream.js.map +1 -1
- package/resources/run/workspace.d.ts.map +1 -1
- package/resources/run/workspace.js.map +1 -1
- package/resources/schedule.d.ts.map +1 -1
- package/resources/schedule.js.map +1 -1
- package/resources/search.d.ts.map +1 -1
- package/resources/search.js.map +1 -1
- package/resources/session.d.ts.map +1 -1
- package/resources/session.js.map +1 -1
- package/resources/share.d.ts.map +1 -1
- package/resources/share.js.map +1 -1
- package/resources/skill.d.ts.map +1 -1
- package/resources/skill.js.map +1 -1
- package/resources/stream/approval-detect.d.ts.map +1 -1
- package/resources/stream/approval-detect.js.map +1 -1
- package/resources/stream/convert.d.ts.map +1 -1
- package/resources/stream/convert.js.map +1 -1
- package/resources/stream/diff.d.ts.map +1 -1
- package/resources/stream/diff.js.map +1 -1
- package/resources/stream/events.d.ts.map +1 -1
- package/resources/stream/events.js.map +1 -1
- package/resources/stream/headless.d.ts.map +1 -1
- package/resources/stream/headless.js.map +1 -1
- package/resources/stream/ink.d.ts.map +1 -1
- package/resources/stream/ink.js.map +1 -1
- package/resources/stream/render-ndjson.d.ts.map +1 -1
- package/resources/stream/render-ndjson.js.map +1 -1
- package/resources/stream/render-plaintext.d.ts.map +1 -1
- package/resources/stream/render-plaintext.js.map +1 -1
- package/resources/stream/snapshot.d.ts.map +1 -1
- package/resources/stream/snapshot.js.map +1 -1
- package/resources/stream/subagent.d.ts.map +1 -1
- package/resources/stream/subagent.js.map +1 -1
- package/resources/stream/submit.d.ts.map +1 -1
- package/resources/stream/submit.js.map +1 -1
- package/resources/stream/todo.d.ts.map +1 -1
- package/resources/stream/todo.js.map +1 -1
- package/resources/stream/tool-state.d.ts.map +1 -1
- package/resources/stream/tool-state.js.map +1 -1
- package/resources/stream/tty.d.ts.map +1 -1
- package/resources/stream/tty.js.map +1 -1
- package/resources/stream/workflow-event-view.d.ts.map +1 -1
- package/resources/stream/workflow-event-view.js.map +1 -1
- package/resources/stream/workflow-render-ndjson.d.ts.map +1 -1
- package/resources/stream/workflow-render-ndjson.js.map +1 -1
- package/resources/stream/workflow-render-plaintext.d.ts.map +1 -1
- package/resources/stream/workflow-render-plaintext.js.map +1 -1
- package/resources/tag.d.ts.map +1 -1
- package/resources/tag.js.map +1 -1
- package/resources/task-configs.d.ts.map +1 -1
- package/resources/task-configs.js.map +1 -1
- package/resources/usage.d.ts.map +1 -1
- package/resources/usage.js.map +1 -1
- package/resources/validate.d.ts.map +1 -1
- package/resources/validate.js.map +1 -1
- package/resources/version.d.ts.map +1 -1
- package/resources/version.js.map +1 -1
- package/runtime.d.ts.map +1 -1
- package/runtime.js.map +1 -1
- package/version.d.ts.map +1 -1
- package/version.js.map +1 -1
- package/src/auth/pkce.test.ts +0 -37
- package/src/auth/token.test.ts +0 -151
- package/src/client/client.test.ts +0 -142
- package/src/commands/apikey/duration.test.ts +0 -23
- package/src/commands/auth/login.test.ts +0 -52
- package/src/commands/auth/whoami.test.ts +0 -96
- package/src/commands/bootstrap.test.ts +0 -178
- package/src/commands/config/backend.test.ts +0 -122
- package/src/commands/config/context.test.ts +0 -171
- package/src/commands/connect.test.ts +0 -113
- package/src/commands/install.test.ts +0 -307
- package/src/commands/marketplace.test.ts +0 -205
- package/src/commands/mcp-server.test.ts +0 -65
- package/src/commands/validate.test.ts +0 -168
- package/src/config/config.test.ts +0 -132
- package/src/config/keys.test.ts +0 -61
- package/src/config/resolve.test.ts +0 -242
- package/src/errors/clierr.test.ts +0 -172
- package/src/local/artifact.test.ts +0 -54
- package/src/local/bootstrap.test.ts +0 -166
- package/src/local/daemon/components.test.ts +0 -148
- package/src/local/daemon/daemon.integration.test.ts +0 -216
- package/src/local/daemon/env.test.ts +0 -108
- package/src/local/daemon/launch.test.ts +0 -136
- package/src/local/daemon/supervisor.test.ts +0 -260
- package/src/local/llm-config.test.ts +0 -66
- package/src/local/logs/tail.test.ts +0 -70
- package/src/local/logs/view.test.ts +0 -46
- package/src/local/operator-config.test.ts +0 -72
- package/src/local/reset.test.ts +0 -53
- package/src/local/runtime/runtime.test.ts +0 -240
- package/src/local/runtime/runtimes-install.test.ts +0 -58
- package/src/local/runtime/server.test.ts +0 -253
- package/src/local/setup/wizard.test.ts +0 -94
- package/src/local/state/state.test.ts +0 -210
- package/src/local/status.test.ts +0 -108
- package/src/local/temporal/download.test.ts +0 -248
- package/src/local/temporal/inspect.test.ts +0 -83
- package/src/local/temporal/manager.test.ts +0 -64
- package/src/local/temporal/supervisor.test.ts +0 -77
- package/src/marketplace/__fixtures__/cursor-marketplace.ts +0 -69
- package/src/marketplace/config.test.ts +0 -254
- package/src/marketplace/github.test.ts +0 -394
- package/src/marketplace/install.test.ts +0 -261
- package/src/marketplace/official.test.ts +0 -107
- package/src/marketplace/read.test.ts +0 -93
- package/src/marketplace/ref.test.ts +0 -179
- package/src/output/command-result.test.ts +0 -73
- package/src/output/confirm.test.ts +0 -43
- package/src/output/format.test.ts +0 -65
- package/src/output/proto.test.ts +0 -72
- package/src/output/table.test.ts +0 -37
- package/src/program.test.ts +0 -62
- package/src/registry/aliases.test.ts +0 -142
- package/src/registry/registry.test.ts +0 -355
- package/src/resources/apply/apply.integration.test.ts +0 -353
- package/src/resources/apply/apply.test.ts +0 -134
- package/src/resources/apply/discovery.integration.test.ts +0 -99
- package/src/resources/connect/__fixtures__/stdio-crash.mjs +0 -6
- package/src/resources/connect/__fixtures__/stdio-server.mjs +0 -48
- package/src/resources/connect/connect.integration.test.ts +0 -383
- package/src/resources/connect/discover.test.ts +0 -84
- package/src/resources/connect/oauth.test.ts +0 -158
- package/src/resources/cursor-pages.test.ts +0 -55
- package/src/resources/diff.integration.test.ts +0 -103
- package/src/resources/diff.test.ts +0 -34
- package/src/resources/documents.test.ts +0 -67
- package/src/resources/execution-approve.test.ts +0 -50
- package/src/resources/execution-format.test.ts +0 -48
- package/src/resources/execution.integration.test.ts +0 -285
- package/src/resources/execution.test.ts +0 -138
- package/src/resources/ignore/ignore.test.ts +0 -62
- package/src/resources/mcp/placeholder-resolver.test.ts +0 -71
- package/src/resources/mcp/runtime-env.test.ts +0 -102
- package/src/resources/mutate-verbs.integration.test.ts +0 -455
- package/src/resources/picker/tty.test.ts +0 -37
- package/src/resources/plugin.test.ts +0 -379
- package/src/resources/push-download.integration.test.ts +0 -175
- package/src/resources/read-completion.integration.test.ts +0 -164
- package/src/resources/read-verbs.integration.test.ts +0 -603
- package/src/resources/reference.test.ts +0 -107
- package/src/resources/run/agent-exec.test.ts +0 -179
- package/src/resources/run/attachments.test.ts +0 -135
- package/src/resources/run/create.test.ts +0 -336
- package/src/resources/run/env.test.ts +0 -131
- package/src/resources/run/header.test.ts +0 -79
- package/src/resources/run/prepare.test.ts +0 -428
- package/src/resources/run/workflow-stream.integration.test.ts +0 -157
- package/src/resources/run/workspace.test.ts +0 -93
- package/src/resources/share.test.ts +0 -523
- package/src/resources/skill.test.ts +0 -364
- package/src/resources/stream/diff.test.ts +0 -338
- package/src/resources/stream/headless.test.ts +0 -119
- package/src/resources/stream/lazy-import.test.ts +0 -63
- package/src/resources/stream/render-ndjson.test.ts +0 -126
- package/src/resources/stream/render-plaintext.test.ts +0 -127
- package/src/resources/stream/snapshot.test.ts +0 -111
- package/src/resources/stream/submit.test.ts +0 -77
- package/src/resources/stream/workflow-event-view.test.ts +0 -116
- package/src/resources/stream/workflow-render.test.ts +0 -81
- package/src/resources/task-configs.test.ts +0 -98
- package/src/resources/usage.test.ts +0 -94
- package/src/resources/validate.test.ts +0 -79
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
// In-process integration test for file-mode apply.
|
|
2
|
-
//
|
|
3
|
-
// The keystone assertion (the reason this wave drives the raw command
|
|
4
|
-
// controllers instead of the high-level SDK `apply(input)`): a resource carrying
|
|
5
|
-
// fields the SDK's lossy `*Input` would drop — notably `metadata.id`, which
|
|
6
|
-
// distinguishes an update from a create — must reach the backend intact. We
|
|
7
|
-
// apply an Agent YAML with an id set plus spec fields and assert the server
|
|
8
|
-
// received every one. Also covers dependency ordering, org injection, dry-run,
|
|
9
|
-
// and the created-vs-updated signal.
|
|
10
|
-
|
|
11
|
-
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
12
|
-
import { createServer as createHttp2Server, type Http2Server, type ServerHttp2Session } from "node:http2";
|
|
13
|
-
import type { AddressInfo } from "node:net";
|
|
14
|
-
import { tmpdir } from "node:os";
|
|
15
|
-
import { join } from "node:path";
|
|
16
|
-
import { type ConnectRouter, createClient } from "@connectrpc/connect";
|
|
17
|
-
import { connectNodeAdapter } from "@connectrpc/connect-node";
|
|
18
|
-
import type { Agent } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
19
|
-
import { AgentCommandController } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/command_pb";
|
|
20
|
-
import type { ChannelApp } from "@stigmer/protos/ai/stigmer/agentic/channelapp/v1/api_pb";
|
|
21
|
-
import { ChannelAppCommandController } from "@stigmer/protos/ai/stigmer/agentic/channelapp/v1/command_pb";
|
|
22
|
-
import type { McpServer } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
|
|
23
|
-
import { McpServerCommandController } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/command_pb";
|
|
24
|
-
import { createNodeTransport, normalizeEndpoint } from "@stigmer/sdk/node";
|
|
25
|
-
import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
26
|
-
import { applyItem, requiresOrgContext, resolveApplyItems } from "./apply.js";
|
|
27
|
-
import type { ControllerFn } from "./handlers.js";
|
|
28
|
-
|
|
29
|
-
let backend: Http2Server;
|
|
30
|
-
let controllerFn: ControllerFn;
|
|
31
|
-
const openSessions = new Set<ServerHttp2Session>();
|
|
32
|
-
|
|
33
|
-
let appliedAgents: Agent[] = [];
|
|
34
|
-
let appliedMcps: McpServer[] = [];
|
|
35
|
-
let appliedChannelApps: ChannelApp[] = [];
|
|
36
|
-
|
|
37
|
-
beforeEach(() => {
|
|
38
|
-
appliedAgents = [];
|
|
39
|
-
appliedMcps = [];
|
|
40
|
-
appliedChannelApps = [];
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
function writeYaml(dir: string, name: string, body: string): string {
|
|
44
|
-
const path = join(dir, name);
|
|
45
|
-
writeFileSync(path, body);
|
|
46
|
-
return path;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
beforeAll(async () => {
|
|
50
|
-
const routes = (router: ConnectRouter) => {
|
|
51
|
-
router.service(AgentCommandController, {
|
|
52
|
-
apply: (req) => {
|
|
53
|
-
appliedAgents.push(req);
|
|
54
|
-
return req; // echo back the full proto the server received
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
router.service(McpServerCommandController, {
|
|
58
|
-
apply: (req) => {
|
|
59
|
-
appliedMcps.push(req);
|
|
60
|
-
return req;
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
router.service(ChannelAppCommandController, {
|
|
64
|
-
apply: (req) => {
|
|
65
|
-
appliedChannelApps.push(req);
|
|
66
|
-
return req;
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
backend = createHttp2Server(connectNodeAdapter({ routes }));
|
|
72
|
-
backend.on("session", (session) => {
|
|
73
|
-
openSessions.add(session);
|
|
74
|
-
session.on("close", () => openSessions.delete(session));
|
|
75
|
-
});
|
|
76
|
-
await new Promise<void>((resolve) => backend.listen(0, "127.0.0.1", resolve));
|
|
77
|
-
const port = (backend.address() as AddressInfo).port;
|
|
78
|
-
const transport = createNodeTransport({ baseUrl: normalizeEndpoint(`127.0.0.1:${port}`) });
|
|
79
|
-
controllerFn = (service) => createClient(service, transport);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
afterAll(async () => {
|
|
83
|
-
for (const session of openSessions) session.destroy();
|
|
84
|
-
await new Promise<void>((resolve) => backend.close(() => resolve()));
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
const AGENT_WITH_ID = [
|
|
88
|
-
"apiVersion: agentic.stigmer.ai/v1",
|
|
89
|
-
"kind: Agent",
|
|
90
|
-
"metadata:",
|
|
91
|
-
" id: agt_existing",
|
|
92
|
-
" name: Reviewer",
|
|
93
|
-
" slug: reviewer",
|
|
94
|
-
" org: acme",
|
|
95
|
-
"spec:",
|
|
96
|
-
" description: A code reviewer",
|
|
97
|
-
" instructions: Review pull requests carefully",
|
|
98
|
-
"",
|
|
99
|
-
].join("\n");
|
|
100
|
-
|
|
101
|
-
describe("file-mode apply — fidelity (raw controller preserves full proto)", () => {
|
|
102
|
-
it("preserves metadata.id and spec fields the SDK input would drop", async () => {
|
|
103
|
-
const dir = mkdtempSync(join(tmpdir(), "apply-it-"));
|
|
104
|
-
try {
|
|
105
|
-
writeYaml(dir, "agent.yaml", AGENT_WITH_ID);
|
|
106
|
-
const items = resolveApplyItems(dir);
|
|
107
|
-
expect(items).toHaveLength(1);
|
|
108
|
-
|
|
109
|
-
const outcome = await applyItem(controllerFn, items[0], "acme", false);
|
|
110
|
-
|
|
111
|
-
// The keystone: id (lossy in AgentInput) and spec round-trip intact.
|
|
112
|
-
expect(appliedAgents).toHaveLength(1);
|
|
113
|
-
expect(appliedAgents[0].metadata?.id).toBe("agt_existing");
|
|
114
|
-
expect(appliedAgents[0].metadata?.slug).toBe("reviewer");
|
|
115
|
-
expect(appliedAgents[0].spec?.description).toBe("A code reviewer");
|
|
116
|
-
expect(appliedAgents[0].spec?.instructions).toBe("Review pull requests carefully");
|
|
117
|
-
|
|
118
|
-
// id present → treated as an update.
|
|
119
|
-
expect(outcome.result.status).toBe("success");
|
|
120
|
-
expect(outcome.result.message).toBe("Agent updated successfully");
|
|
121
|
-
} finally {
|
|
122
|
-
rmSync(dir, { recursive: true, force: true });
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it("treats a resource without metadata.id as a create", async () => {
|
|
127
|
-
const dir = mkdtempSync(join(tmpdir(), "apply-it-"));
|
|
128
|
-
try {
|
|
129
|
-
writeYaml(
|
|
130
|
-
dir,
|
|
131
|
-
"agent.yaml",
|
|
132
|
-
["kind: Agent", "metadata:", " name: New", " slug: new", "spec:", " description: d", ""].join("\n"),
|
|
133
|
-
);
|
|
134
|
-
const items = resolveApplyItems(dir);
|
|
135
|
-
const outcome = await applyItem(controllerFn, items[0], "acme", false);
|
|
136
|
-
expect(outcome.result.message).toBe("Agent created successfully");
|
|
137
|
-
} finally {
|
|
138
|
-
rmSync(dir, { recursive: true, force: true });
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
it("injects the resolved org when the document omits it", async () => {
|
|
143
|
-
const dir = mkdtempSync(join(tmpdir(), "apply-it-"));
|
|
144
|
-
try {
|
|
145
|
-
writeYaml(
|
|
146
|
-
dir,
|
|
147
|
-
"agent.yaml",
|
|
148
|
-
["kind: Agent", "metadata:", " name: NoOrg", " slug: no-org", "spec:", " description: d", ""].join("\n"),
|
|
149
|
-
);
|
|
150
|
-
const items = resolveApplyItems(dir);
|
|
151
|
-
await applyItem(controllerFn, items[0], "acme", false);
|
|
152
|
-
expect(appliedAgents[0].metadata?.org).toBe("acme");
|
|
153
|
-
} finally {
|
|
154
|
-
rmSync(dir, { recursive: true, force: true });
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
// The stigmer/stigmer#353 regression block: ChannelApp apply used to fail
|
|
162
|
-
// with "apply not implemented for Channel App" because the CLI's handler
|
|
163
|
-
// table was a drifted copy of the SDK manifest registry. The handlers now
|
|
164
|
-
// COME FROM that registry, so this suite pins the whole class: the kind
|
|
165
|
-
// applies, secrets round-trip verbatim, and the ordering the registry
|
|
166
|
-
// encodes (app before the channel that references it) is honored.
|
|
167
|
-
const CHANNEL_APP_YAML = [
|
|
168
|
-
"apiVersion: agentic.stigmer.ai/v1",
|
|
169
|
-
"kind: ChannelApp",
|
|
170
|
-
"metadata:",
|
|
171
|
-
" name: demo-whatsapp",
|
|
172
|
-
" slug: demo-whatsapp",
|
|
173
|
-
"spec:",
|
|
174
|
-
" whatsapp:",
|
|
175
|
-
" app_id: '108954'",
|
|
176
|
-
" app_secret: '***REDACTED***'",
|
|
177
|
-
" access_token: '***REDACTED***'",
|
|
178
|
-
" verify_token: '***REDACTED***'",
|
|
179
|
-
"",
|
|
180
|
-
].join("\n");
|
|
181
|
-
|
|
182
|
-
const AGENT_CHANNEL_YAML = [
|
|
183
|
-
"apiVersion: agentic.stigmer.ai/v1",
|
|
184
|
-
"kind: AgentChannel",
|
|
185
|
-
"metadata:",
|
|
186
|
-
" name: isc-whatsapp",
|
|
187
|
-
" slug: isc-whatsapp",
|
|
188
|
-
"spec:",
|
|
189
|
-
" enabled: true",
|
|
190
|
-
" agent_ref: { kind: 40, org: acme, slug: clinic-assistant }",
|
|
191
|
-
" whatsapp: { phone_number_id: '106540352242922' }",
|
|
192
|
-
"",
|
|
193
|
-
].join("\n");
|
|
194
|
-
|
|
195
|
-
const SCHEDULE_YAML = [
|
|
196
|
-
"apiVersion: agentic.stigmer.ai/v1",
|
|
197
|
-
"kind: Schedule",
|
|
198
|
-
"metadata:",
|
|
199
|
-
" name: daily-fee-reminders",
|
|
200
|
-
" slug: daily-fee-reminders",
|
|
201
|
-
"spec:",
|
|
202
|
-
" cron: '0 9 * * *'",
|
|
203
|
-
" time_zone: Asia/Kolkata",
|
|
204
|
-
" enabled: false",
|
|
205
|
-
" agent:",
|
|
206
|
-
" agent_ref: { kind: 40, org: acme, slug: clinic-assistant }",
|
|
207
|
-
" message: run the reminders",
|
|
208
|
-
"",
|
|
209
|
-
].join("\n");
|
|
210
|
-
|
|
211
|
-
describe("file-mode apply — channel app (#353)", () => {
|
|
212
|
-
it("applies a ChannelApp through the raw controller with the redaction markers intact", async () => {
|
|
213
|
-
const dir = mkdtempSync(join(tmpdir(), "apply-it-"));
|
|
214
|
-
try {
|
|
215
|
-
writeYaml(dir, "chapp.yaml", CHANNEL_APP_YAML);
|
|
216
|
-
const items = resolveApplyItems(dir);
|
|
217
|
-
expect(items).toHaveLength(1);
|
|
218
|
-
|
|
219
|
-
const outcome = await applyItem(controllerFn, items[0], "acme", false);
|
|
220
|
-
expect(outcome.result.message).toBe("Channel App created successfully");
|
|
221
|
-
|
|
222
|
-
expect(appliedChannelApps).toHaveLength(1);
|
|
223
|
-
const spec = appliedChannelApps[0].spec;
|
|
224
|
-
expect(spec?.providerConfig.case).toBe("whatsapp");
|
|
225
|
-
if (spec?.providerConfig.case !== "whatsapp") throw new Error("unreachable");
|
|
226
|
-
expect(spec.providerConfig.value.appId).toBe("108954");
|
|
227
|
-
// The redaction markers must reach the server verbatim — that is the
|
|
228
|
-
// convention by which applying a fetched manifest preserves stored
|
|
229
|
-
// secrets (verb-support's OAuthApp marker note).
|
|
230
|
-
expect(spec.providerConfig.value.appSecret).toBe("***REDACTED***");
|
|
231
|
-
expect(spec.providerConfig.value.accessToken).toBe("***REDACTED***");
|
|
232
|
-
} finally {
|
|
233
|
-
rmSync(dir, { recursive: true, force: true });
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
it("treats a ChannelApp carrying metadata.id as an update", async () => {
|
|
238
|
-
const dir = mkdtempSync(join(tmpdir(), "apply-it-"));
|
|
239
|
-
try {
|
|
240
|
-
writeYaml(
|
|
241
|
-
dir,
|
|
242
|
-
"chapp.yaml",
|
|
243
|
-
CHANNEL_APP_YAML.replace("metadata:", "metadata:\n id: chapp_existing"),
|
|
244
|
-
);
|
|
245
|
-
const items = resolveApplyItems(dir);
|
|
246
|
-
const outcome = await applyItem(controllerFn, items[0], "acme", false);
|
|
247
|
-
expect(outcome.result.message).toBe("Channel App updated successfully");
|
|
248
|
-
expect(appliedChannelApps[0].metadata?.id).toBe("chapp_existing");
|
|
249
|
-
} finally {
|
|
250
|
-
rmSync(dir, { recursive: true, force: true });
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
|
|
254
|
-
it("orders one bundle app → channel → schedule regardless of file order", () => {
|
|
255
|
-
const dir = mkdtempSync(join(tmpdir(), "apply-it-"));
|
|
256
|
-
try {
|
|
257
|
-
// File names chosen so lexical file order is exactly WRONG — before
|
|
258
|
-
// the registry unification all three kinds fell to a shared default
|
|
259
|
-
// priority and applied in this (broken) file order.
|
|
260
|
-
writeYaml(dir, "a-schedule.yaml", SCHEDULE_YAML);
|
|
261
|
-
writeYaml(dir, "b-channel.yaml", AGENT_CHANNEL_YAML);
|
|
262
|
-
writeYaml(dir, "c-chapp.yaml", CHANNEL_APP_YAML);
|
|
263
|
-
const items = resolveApplyItems(dir);
|
|
264
|
-
expect(items.map((i) => i.handler.displayName)).toEqual(["Channel App", "Agent Channel", "Schedule"]);
|
|
265
|
-
} finally {
|
|
266
|
-
rmSync(dir, { recursive: true, force: true });
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
});
|
|
270
|
-
|
|
271
|
-
describe("file-mode apply — kinds the registry does not know", () => {
|
|
272
|
-
it("refuses a retired kind with what happened and what to run instead", () => {
|
|
273
|
-
const dir = mkdtempSync(join(tmpdir(), "apply-it-"));
|
|
274
|
-
try {
|
|
275
|
-
writeYaml(dir, "project.yaml", ["kind: Project", "metadata:", " name: Demo", " slug: demo", ""].join("\n"));
|
|
276
|
-
expect(() => resolveApplyItems(dir)).toThrow(
|
|
277
|
-
/kind 'Project' in .*project\.yaml is no longer a Stigmer resource.*stigmer push plugin <dir>/,
|
|
278
|
-
);
|
|
279
|
-
} finally {
|
|
280
|
-
rmSync(dir, { recursive: true, force: true });
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
it("refuses a kind that never existed with the plain unknown-kind sentence", () => {
|
|
285
|
-
const dir = mkdtempSync(join(tmpdir(), "apply-it-"));
|
|
286
|
-
try {
|
|
287
|
-
writeYaml(dir, "thing.yaml", ["kind: Widget", "metadata:", " name: Demo", ""].join("\n"));
|
|
288
|
-
expect(() => resolveApplyItems(dir)).toThrow(/^unknown resource kind 'Widget' in .*thing\.yaml$/);
|
|
289
|
-
} finally {
|
|
290
|
-
rmSync(dir, { recursive: true, force: true });
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
});
|
|
294
|
-
|
|
295
|
-
describe("file-mode apply — orchestration", () => {
|
|
296
|
-
it("sorts items into dependency order (mcp_server before agent)", () => {
|
|
297
|
-
const dir = mkdtempSync(join(tmpdir(), "apply-it-"));
|
|
298
|
-
try {
|
|
299
|
-
writeYaml(dir, "agent.yaml", AGENT_WITH_ID);
|
|
300
|
-
writeYaml(
|
|
301
|
-
dir,
|
|
302
|
-
"mcp.yaml",
|
|
303
|
-
["kind: McpServer", "metadata:", " name: fs", " slug: fs", "spec:", " stdio:", " command: node", ""].join(
|
|
304
|
-
"\n",
|
|
305
|
-
),
|
|
306
|
-
);
|
|
307
|
-
const items = resolveApplyItems(dir);
|
|
308
|
-
expect(items.map((i) => i.handler.displayName)).toEqual(["MCP Server", "Agent"]);
|
|
309
|
-
} finally {
|
|
310
|
-
rmSync(dir, { recursive: true, force: true });
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
|
|
314
|
-
it("requiresOrgContext is false for an Organization-only set", () => {
|
|
315
|
-
const dir = mkdtempSync(join(tmpdir(), "apply-it-"));
|
|
316
|
-
try {
|
|
317
|
-
writeYaml(dir, "org.yaml", ["kind: Organization", "metadata:", " name: Acme", " slug: acme", ""].join("\n"));
|
|
318
|
-
const items = resolveApplyItems(dir);
|
|
319
|
-
expect(requiresOrgContext(items)).toBe(false);
|
|
320
|
-
} finally {
|
|
321
|
-
rmSync(dir, { recursive: true, force: true });
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
|
|
325
|
-
it("dry-run previews without touching the backend", async () => {
|
|
326
|
-
const dir = mkdtempSync(join(tmpdir(), "apply-it-"));
|
|
327
|
-
try {
|
|
328
|
-
writeYaml(dir, "agent.yaml", AGENT_WITH_ID);
|
|
329
|
-
const items = resolveApplyItems(dir);
|
|
330
|
-
const before = appliedAgents.length;
|
|
331
|
-
const outcome = await applyItem(controllerFn, items[0], "acme", true);
|
|
332
|
-
expect(outcome.result.message).toBe("Dry run: Reviewer is valid");
|
|
333
|
-
expect(appliedAgents.length).toBe(before);
|
|
334
|
-
} finally {
|
|
335
|
-
rmSync(dir, { recursive: true, force: true });
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
|
|
339
|
-
it("rejects unknown YAML fields under strict marshalling", async () => {
|
|
340
|
-
const dir = mkdtempSync(join(tmpdir(), "apply-it-"));
|
|
341
|
-
try {
|
|
342
|
-
writeYaml(
|
|
343
|
-
dir,
|
|
344
|
-
"agent.yaml",
|
|
345
|
-
["kind: Agent", "metadata:", " name: Bad", "spec:", " bogus_field: nope", ""].join("\n"),
|
|
346
|
-
);
|
|
347
|
-
const items = resolveApplyItems(dir);
|
|
348
|
-
await expect(applyItem(controllerFn, items[0], "acme", false)).rejects.toThrow(/invalid Agent/);
|
|
349
|
-
} finally {
|
|
350
|
-
rmSync(dir, { recursive: true, force: true });
|
|
351
|
-
}
|
|
352
|
-
});
|
|
353
|
-
});
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
// Unit tests for the shared apply core's declared-visibility follow-up
|
|
2
|
-
// (oss#573). Plain updates preserve stored visibility on both editions, so
|
|
3
|
-
// the apply RPC's response carries the STORED level; when a manifest
|
|
4
|
-
// declares a different one, the core must land it through the guarded
|
|
5
|
-
// updateVisibility RPC — or warn when the kind has no such door.
|
|
6
|
-
|
|
7
|
-
import { create, type Message } from "@bufbuild/protobuf";
|
|
8
|
-
import { AgentSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
9
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
10
|
-
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
11
|
-
import type { UpdateVisibilityInput } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
12
|
-
import { describe, expect, it } from "vitest";
|
|
13
|
-
import { applyMessage } from "./apply.js";
|
|
14
|
-
import type { ApplyHandler, ControllerFn } from "./handlers.js";
|
|
15
|
-
|
|
16
|
-
// The controller accessor is only ever forwarded to handler methods, which
|
|
17
|
-
// these tests stub out — a throwing dummy proves nothing else touches it.
|
|
18
|
-
const controller: ControllerFn = () => {
|
|
19
|
-
throw new Error("unexpected controller access");
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
function agent(visibility: ApiResourceVisibility, id = "agent-1") {
|
|
23
|
-
return create(AgentSchema, {
|
|
24
|
-
metadata: { id, name: "a", org: "acme", visibility },
|
|
25
|
-
spec: { instructions: "i" },
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface HandlerOptions {
|
|
30
|
-
applyReturns: Message;
|
|
31
|
-
updateVisibility?: (input: UpdateVisibilityInput) => Promise<Message>;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function handlerWith(opts: HandlerOptions): { handler: ApplyHandler; calls: UpdateVisibilityInput[] } {
|
|
35
|
-
const calls: UpdateVisibilityInput[] = [];
|
|
36
|
-
const handler: ApplyHandler = {
|
|
37
|
-
kind: ApiResourceKind.agent,
|
|
38
|
-
displayName: "Agent",
|
|
39
|
-
schema: AgentSchema,
|
|
40
|
-
applyOrder: 3,
|
|
41
|
-
apply: () => Promise.resolve(opts.applyReturns),
|
|
42
|
-
...(opts.updateVisibility !== undefined && {
|
|
43
|
-
updateVisibility: (_c: ControllerFn, input: UpdateVisibilityInput) => {
|
|
44
|
-
calls.push(input);
|
|
45
|
-
return opts.updateVisibility!(input);
|
|
46
|
-
},
|
|
47
|
-
}),
|
|
48
|
-
};
|
|
49
|
-
return { handler, calls };
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
describe("applyMessage declared-visibility follow-up", () => {
|
|
53
|
-
it("lands a declared level the update preserved away, and reflects it on the outcome", async () => {
|
|
54
|
-
// Server preserved stored org; manifest declares platform.
|
|
55
|
-
const { handler, calls } = handlerWith({
|
|
56
|
-
applyReturns: agent(ApiResourceVisibility.visibility_org),
|
|
57
|
-
updateVisibility: () => Promise.resolve(agent(ApiResourceVisibility.visibility_platform)),
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
const outcome = await applyMessage(controller, handler, agent(ApiResourceVisibility.visibility_platform), "acme", false);
|
|
61
|
-
|
|
62
|
-
expect(calls).toHaveLength(1);
|
|
63
|
-
expect(calls[0].resourceId).toBe("agent-1");
|
|
64
|
-
expect(calls[0].visibility).toBe(ApiResourceVisibility.visibility_platform);
|
|
65
|
-
expect(outcome.warning).toBeUndefined();
|
|
66
|
-
const appliedMeta = (outcome.applied as { metadata?: { visibility?: ApiResourceVisibility } })?.metadata;
|
|
67
|
-
expect(appliedMeta?.visibility).toBe(ApiResourceVisibility.visibility_platform);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it("skips the follow-up when the manifest omits visibility", async () => {
|
|
71
|
-
const { handler, calls } = handlerWith({
|
|
72
|
-
applyReturns: agent(ApiResourceVisibility.visibility_org),
|
|
73
|
-
updateVisibility: () => Promise.reject(new Error("must not be called")),
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
const outcome = await applyMessage(
|
|
77
|
-
controller,
|
|
78
|
-
handler,
|
|
79
|
-
agent(ApiResourceVisibility.api_resource_visibility_unspecified),
|
|
80
|
-
"acme",
|
|
81
|
-
false,
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
expect(calls).toHaveLength(0);
|
|
85
|
-
expect(outcome.warning).toBeUndefined();
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it("skips the follow-up when the server already matches (idempotent re-apply)", async () => {
|
|
89
|
-
const { handler, calls } = handlerWith({
|
|
90
|
-
applyReturns: agent(ApiResourceVisibility.visibility_platform),
|
|
91
|
-
updateVisibility: () => Promise.reject(new Error("must not be called")),
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
const outcome = await applyMessage(controller, handler, agent(ApiResourceVisibility.visibility_platform), "acme", false);
|
|
95
|
-
|
|
96
|
-
expect(calls).toHaveLength(0);
|
|
97
|
-
expect(outcome.warning).toBeUndefined();
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it("warns instead of silently swallowing a diff on kinds without the RPC", async () => {
|
|
101
|
-
const { handler } = handlerWith({
|
|
102
|
-
applyReturns: agent(ApiResourceVisibility.visibility_private),
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
const outcome = await applyMessage(controller, handler, agent(ApiResourceVisibility.visibility_platform), "acme", false);
|
|
106
|
-
|
|
107
|
-
expect(outcome.warning).toMatch(/visibility cannot be changed declaratively/);
|
|
108
|
-
expect(outcome.warning).toMatch(/stored value is kept/);
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
it("fails loudly when the guarded door rejects, naming the partial state", async () => {
|
|
112
|
-
// e.g. the default-instance FAILED_PRECONDITION or an unsupported level.
|
|
113
|
-
const { handler } = handlerWith({
|
|
114
|
-
applyReturns: agent(ApiResourceVisibility.visibility_org),
|
|
115
|
-
updateVisibility: () => Promise.reject(new Error("default instances do not have their own visibility")),
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
await expect(
|
|
119
|
-
applyMessage(controller, handler, agent(ApiResourceVisibility.visibility_platform), "acme", false),
|
|
120
|
-
).rejects.toThrow(/spec applied, but the manifest's visibility change was rejected/);
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
it("does not follow up in dry-run mode", async () => {
|
|
124
|
-
const { handler, calls } = handlerWith({
|
|
125
|
-
applyReturns: agent(ApiResourceVisibility.visibility_org),
|
|
126
|
-
updateVisibility: () => Promise.reject(new Error("must not be called")),
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
const outcome = await applyMessage(controller, handler, agent(ApiResourceVisibility.visibility_platform), "acme", true);
|
|
130
|
-
|
|
131
|
-
expect(calls).toHaveLength(0);
|
|
132
|
-
expect(outcome.applied).toBeUndefined();
|
|
133
|
-
});
|
|
134
|
-
});
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
// In-process integration test for post-apply MCP discovery.
|
|
2
|
-
//
|
|
3
|
-
// Stands up a Connect backend serving McpServerCommandController.connect, points
|
|
4
|
-
// an SDK node client at it, and drives discoverAppliedMcpServers. The mock
|
|
5
|
-
// mirrors the backend's protovalidate rule (org min_len=1) by rejecting an empty
|
|
6
|
-
// org, so a regression that drops org from ConnectInput is caught here rather
|
|
7
|
-
// than silently passing (issue #140: the CLI used to omit org entirely).
|
|
8
|
-
|
|
9
|
-
import { create } from "@bufbuild/protobuf";
|
|
10
|
-
import { Code, ConnectError, type ConnectRouter } from "@connectrpc/connect";
|
|
11
|
-
import { connectNodeAdapter } from "@connectrpc/connect-node";
|
|
12
|
-
import { McpServerSchema } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
|
|
13
|
-
import { McpServerCommandController } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/command_pb";
|
|
14
|
-
import type { ConnectInput } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/io_pb";
|
|
15
|
-
import type { Stigmer } from "@stigmer/sdk";
|
|
16
|
-
import { createNodeClient, normalizeEndpoint } from "@stigmer/sdk/node";
|
|
17
|
-
import { createServer as createHttp2Server, type Http2Server, type ServerHttp2Session } from "node:http2";
|
|
18
|
-
import type { AddressInfo } from "node:net";
|
|
19
|
-
import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
20
|
-
import { discoverAppliedMcpServers } from "./discovery.js";
|
|
21
|
-
|
|
22
|
-
let backend: Http2Server;
|
|
23
|
-
let client: Stigmer;
|
|
24
|
-
const openSessions = new Set<ServerHttp2Session>();
|
|
25
|
-
|
|
26
|
-
let connectCalls: ConnectInput[] = [];
|
|
27
|
-
|
|
28
|
-
beforeEach(() => {
|
|
29
|
-
connectCalls = [];
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// A stdio MCP server with no env declarations, so discovery does not skip it and
|
|
33
|
-
// buildRuntimeEnv stays empty (no local process needed — connect is mocked).
|
|
34
|
-
function stdioServer(id: string, org: string) {
|
|
35
|
-
return create(McpServerSchema, {
|
|
36
|
-
metadata: { id, name: id, slug: id, org },
|
|
37
|
-
spec: { serverType: { case: "stdio", value: { command: "noop" } } },
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
beforeAll(async () => {
|
|
42
|
-
const routes = (router: ConnectRouter) => {
|
|
43
|
-
router.service(McpServerCommandController, {
|
|
44
|
-
connect: (req) => {
|
|
45
|
-
if (req.org === "") {
|
|
46
|
-
throw new ConnectError("org – value length must be at least 1 characters", Code.InvalidArgument);
|
|
47
|
-
}
|
|
48
|
-
connectCalls.push(req);
|
|
49
|
-
return create(McpServerSchema, { metadata: { id: req.mcpServerId } });
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
backend = createHttp2Server(connectNodeAdapter({ routes }));
|
|
55
|
-
backend.on("session", (session) => {
|
|
56
|
-
openSessions.add(session);
|
|
57
|
-
session.on("close", () => openSessions.delete(session));
|
|
58
|
-
});
|
|
59
|
-
await new Promise<void>((resolve) => backend.listen(0, "127.0.0.1", resolve));
|
|
60
|
-
const port = (backend.address() as AddressInfo).port;
|
|
61
|
-
client = createNodeClient({ baseUrl: normalizeEndpoint(`127.0.0.1:${port}`) });
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
afterAll(async () => {
|
|
65
|
-
for (const session of openSessions) session.destroy();
|
|
66
|
-
await new Promise<void>((resolve) => backend.close(() => resolve()));
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
describe("discoverAppliedMcpServers", () => {
|
|
70
|
-
it("forwards the resolved org on ConnectInput for each applied stdio server", async () => {
|
|
71
|
-
const lines: string[] = [];
|
|
72
|
-
await discoverAppliedMcpServers(client, [stdioServer("mcp_1", "acme")], "acme", (l) => lines.push(l));
|
|
73
|
-
|
|
74
|
-
expect(connectCalls).toHaveLength(1);
|
|
75
|
-
expect(connectCalls[0].mcpServerId).toBe("mcp_1");
|
|
76
|
-
expect(connectCalls[0].org).toBe("acme");
|
|
77
|
-
expect(lines.join("\n")).toContain("Discovered capabilities for mcp_1");
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it("surfaces the backend's org validation as a per-server warning when org is empty (regression guard)", async () => {
|
|
81
|
-
const lines: string[] = [];
|
|
82
|
-
await discoverAppliedMcpServers(client, [stdioServer("mcp_1", "acme")], "", (l) => lines.push(l));
|
|
83
|
-
|
|
84
|
-
// Best-effort: an empty org must never crash the apply — it degrades to a
|
|
85
|
-
// warning. This proves the mock (and thus the backend) rejects empty org, so
|
|
86
|
-
// the happy-path org assertion above is a real guard, not a tautology.
|
|
87
|
-
expect(connectCalls).toHaveLength(0);
|
|
88
|
-
expect(lines.join("\n")).toContain("Discovery failed for mcp_1");
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it("skips non-stdio servers without calling connect", async () => {
|
|
92
|
-
const httpServer = create(McpServerSchema, {
|
|
93
|
-
metadata: { id: "mcp_http", name: "http", slug: "http", org: "acme" },
|
|
94
|
-
spec: { serverType: { case: "http", value: { url: "https://example.com/mcp" } } },
|
|
95
|
-
});
|
|
96
|
-
await discoverAppliedMcpServers(client, [httpServer], "acme");
|
|
97
|
-
expect(connectCalls).toHaveLength(0);
|
|
98
|
-
});
|
|
99
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// A stdio command that fails to start an MCP server: it writes a diagnostic to
|
|
2
|
-
// stderr and exits non-zero. Used to assert connect --dry-run surfaces a clear
|
|
3
|
-
// connection error (and the subprocess stderr) rather than hanging.
|
|
4
|
-
|
|
5
|
-
process.stderr.write("fixture boom: missing CONFIG\n");
|
|
6
|
-
process.exit(1);
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// Minimal stdio MCP server fixture for `connect --dry-run` discovery tests.
|
|
2
|
-
//
|
|
3
|
-
// Spawned as a subprocess by discover.ts via StdioClientTransport. Advertises a
|
|
4
|
-
// single tool and a single resource template using the low-level Server API
|
|
5
|
-
// (the most version-stable surface of @modelcontextprotocol/sdk). It also echoes
|
|
6
|
-
// an --env-provided value AND the CLI args it received (process.argv beyond the
|
|
7
|
-
// script path) through the tool description, so tests can assert env propagation
|
|
8
|
-
// and ${VAR} argument expansion.
|
|
9
|
-
|
|
10
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
11
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
12
|
-
import {
|
|
13
|
-
ListResourceTemplatesRequestSchema,
|
|
14
|
-
ListToolsRequestSchema,
|
|
15
|
-
} from "@modelcontextprotocol/sdk/types.js";
|
|
16
|
-
|
|
17
|
-
const server = new Server(
|
|
18
|
-
{ name: "fixture-mcp", version: "0.0.1" },
|
|
19
|
-
{ capabilities: { tools: {}, resources: {} } },
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
const receivedArgs = process.argv.slice(2);
|
|
23
|
-
|
|
24
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
25
|
-
tools: [
|
|
26
|
-
{
|
|
27
|
-
name: "echo",
|
|
28
|
-
description:
|
|
29
|
-
`echo a message (token=${process.env.FIXTURE_TOKEN ?? "unset"}) ` +
|
|
30
|
-
`(args=${JSON.stringify(receivedArgs)})`,
|
|
31
|
-
inputSchema: { type: "object", properties: { text: { type: "string" } } },
|
|
32
|
-
},
|
|
33
|
-
{ name: "noop", description: "", inputSchema: { type: "object" } },
|
|
34
|
-
],
|
|
35
|
-
}));
|
|
36
|
-
|
|
37
|
-
server.setRequestHandler(ListResourceTemplatesRequestSchema, async () => ({
|
|
38
|
-
resourceTemplates: [
|
|
39
|
-
{
|
|
40
|
-
uriTemplate: "file:///{path}",
|
|
41
|
-
name: "local-file",
|
|
42
|
-
description: "a local file",
|
|
43
|
-
mimeType: "text/plain",
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
}));
|
|
47
|
-
|
|
48
|
-
await server.connect(new StdioServerTransport());
|