@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,107 +0,0 @@
|
|
|
1
|
-
// Pins the official marketplace's resolution: the repo tree wins when this
|
|
2
|
-
// module runs from a checkout; otherwise the package is acquired once at the
|
|
3
|
-
// CLI's version into the runtimes root, reused on the next call, and refused
|
|
4
|
-
// for a non-release build that has nothing installed.
|
|
5
|
-
|
|
6
|
-
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
7
|
-
import { tmpdir } from "node:os";
|
|
8
|
-
import { join } from "node:path";
|
|
9
|
-
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
10
|
-
import {
|
|
11
|
-
acquireOfficialMarketplace,
|
|
12
|
-
resolveOfficialMarketplace,
|
|
13
|
-
} from "./official.js";
|
|
14
|
-
|
|
15
|
-
let home: string;
|
|
16
|
-
|
|
17
|
-
beforeEach(() => {
|
|
18
|
-
home = mkdtempSync(join(tmpdir(), "stigmer-official-marketplace-"));
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
afterEach(() => {
|
|
22
|
-
rmSync(home, { recursive: true, force: true });
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
function fakeInstall(installDir: string): void {
|
|
26
|
-
const pkg = join(installDir, "node_modules", "@stigmer", "plugins");
|
|
27
|
-
mkdirSync(pkg, { recursive: true });
|
|
28
|
-
writeFileSync(
|
|
29
|
-
join(pkg, "marketplace.json"),
|
|
30
|
-
JSON.stringify({ name: "stigmer", plugins: [] }),
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
describe("resolveOfficialMarketplace", () => {
|
|
35
|
-
it("uses the repo tree when running from a checkout", () => {
|
|
36
|
-
const resolved = resolveOfficialMarketplace({ home });
|
|
37
|
-
expect(resolved.source).toBe("repo");
|
|
38
|
-
expect(resolved.dir.endsWith(join("", "plugins"))).toBe(true);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it("acquires the package when there is no checkout, once, and reuses it", () => {
|
|
42
|
-
let installs = 0;
|
|
43
|
-
const install = (installDir: string): void => {
|
|
44
|
-
installs += 1;
|
|
45
|
-
fakeInstall(installDir);
|
|
46
|
-
};
|
|
47
|
-
const first = resolveOfficialMarketplace({
|
|
48
|
-
home,
|
|
49
|
-
version: "1.2.3",
|
|
50
|
-
install,
|
|
51
|
-
repoDir: () => null,
|
|
52
|
-
});
|
|
53
|
-
const second = resolveOfficialMarketplace({
|
|
54
|
-
home,
|
|
55
|
-
version: "1.2.3",
|
|
56
|
-
install,
|
|
57
|
-
repoDir: () => null,
|
|
58
|
-
});
|
|
59
|
-
expect(first.source).toBe("package");
|
|
60
|
-
expect(first.dir).toBe(
|
|
61
|
-
join(
|
|
62
|
-
home,
|
|
63
|
-
".stigmer",
|
|
64
|
-
"runtimes",
|
|
65
|
-
"1.2.3",
|
|
66
|
-
"node_modules",
|
|
67
|
-
"@stigmer",
|
|
68
|
-
"plugins",
|
|
69
|
-
),
|
|
70
|
-
);
|
|
71
|
-
expect(second.dir).toBe(first.dir);
|
|
72
|
-
expect(installs).toBe(1);
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
describe("acquireOfficialMarketplace", () => {
|
|
77
|
-
it("refuses to acquire for a non-release build with nothing installed", () => {
|
|
78
|
-
expect(() =>
|
|
79
|
-
acquireOfficialMarketplace({
|
|
80
|
-
home,
|
|
81
|
-
version: "0.0.0-dev",
|
|
82
|
-
install: () => {},
|
|
83
|
-
}),
|
|
84
|
-
).toThrow(/cannot acquire @stigmer\/plugins for a non-release build/);
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it("uses already-installed content even for a non-release build", () => {
|
|
88
|
-
const installDir = join(home, ".stigmer", "runtimes", "0.0.0-dev");
|
|
89
|
-
fakeInstall(installDir);
|
|
90
|
-
let installs = 0;
|
|
91
|
-
const dir = acquireOfficialMarketplace({
|
|
92
|
-
home,
|
|
93
|
-
version: "0.0.0-dev",
|
|
94
|
-
install: () => {
|
|
95
|
-
installs += 1;
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
expect(dir).toBe(join(installDir, "node_modules", "@stigmer", "plugins"));
|
|
99
|
-
expect(installs).toBe(0);
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
it("refuses when the install did not produce the marketplace file", () => {
|
|
103
|
-
expect(() =>
|
|
104
|
-
acquireOfficialMarketplace({ home, version: "1.2.3", install: () => {} }),
|
|
105
|
-
).toThrow(/install did not produce/);
|
|
106
|
-
});
|
|
107
|
-
});
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
// Pins the CLI's edge for the marketplace reader: a tree read through the one
|
|
2
|
-
// walker, the refusal shape, entry lookup and directory resolution, and the
|
|
3
|
-
// official tree in this repository reading clean.
|
|
4
|
-
|
|
5
|
-
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
6
|
-
import { tmpdir } from "node:os";
|
|
7
|
-
import { join } from "node:path";
|
|
8
|
-
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
9
|
-
import { writeCursorMarketplace } from "./__fixtures__/cursor-marketplace.js";
|
|
10
|
-
import { resolveOfficialMarketplace } from "./official.js";
|
|
11
|
-
import { entryDirectory, findEntry, readMarketplaceTree } from "./read.js";
|
|
12
|
-
|
|
13
|
-
let root: string;
|
|
14
|
-
|
|
15
|
-
beforeAll(() => {
|
|
16
|
-
root = mkdtempSync(join(tmpdir(), "stigmer-marketplace-read-"));
|
|
17
|
-
writeCursorMarketplace(root);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
afterAll(() => {
|
|
21
|
-
rmSync(root, { recursive: true, force: true });
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
describe("readMarketplaceTree", () => {
|
|
25
|
-
it("reads a Cursor-dialect tree into the one shape, dropping the missing entry with its sentence", () => {
|
|
26
|
-
const tree = readMarketplaceTree(root);
|
|
27
|
-
expect(tree.marketplace.name).toBe("acme-plugins");
|
|
28
|
-
expect(tree.marketplace.dialect).toBe("cursor");
|
|
29
|
-
expect(tree.marketplace.plugins.map((entry) => entry.name)).toEqual([
|
|
30
|
-
"warmer",
|
|
31
|
-
"codeforge",
|
|
32
|
-
]);
|
|
33
|
-
expect(tree.warnings).toHaveLength(1);
|
|
34
|
-
expect(tree.warnings[0]?.kind).toBe("entry-directory-missing");
|
|
35
|
-
expect(tree.warnings[0]?.subject).toBe("ghost");
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it("refuses a directory with no marketplace file, naming the four locations", () => {
|
|
39
|
-
const empty = mkdtempSync(join(tmpdir(), "stigmer-marketplace-empty-"));
|
|
40
|
-
try {
|
|
41
|
-
writeFileSync(join(empty, "README.md"), "nothing here");
|
|
42
|
-
expect(() => readMarketplaceTree(empty, "github.com/a/b")).toThrow(
|
|
43
|
-
/github\.com\/a\/b: not a marketplace this CLI can read, 1 problem found:\n - .*marketplace\.json/,
|
|
44
|
-
);
|
|
45
|
-
} finally {
|
|
46
|
-
rmSync(empty, { recursive: true, force: true });
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it("refuses a broken file with every problem and every warning", () => {
|
|
51
|
-
const broken = mkdtempSync(join(tmpdir(), "stigmer-marketplace-broken-"));
|
|
52
|
-
try {
|
|
53
|
-
writeFileSync(
|
|
54
|
-
join(broken, "marketplace.json"),
|
|
55
|
-
JSON.stringify({
|
|
56
|
-
plugins: [
|
|
57
|
-
{ name: "a", source: "../out" },
|
|
58
|
-
{ name: "b", source: "https://x" },
|
|
59
|
-
],
|
|
60
|
-
}),
|
|
61
|
-
);
|
|
62
|
-
expect(() => readMarketplaceTree(broken)).toThrow(
|
|
63
|
-
/2 problems found:[\s\S]*and 1 warning:/,
|
|
64
|
-
);
|
|
65
|
-
} finally {
|
|
66
|
-
rmSync(broken, { recursive: true, force: true });
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
describe("findEntry and entryDirectory", () => {
|
|
72
|
-
it("resolves an offered entry to its absolute directory and an unknown name to undefined", () => {
|
|
73
|
-
const tree = readMarketplaceTree(root);
|
|
74
|
-
const codeforge = findEntry(tree.marketplace, "codeforge");
|
|
75
|
-
expect(codeforge?.dir).toBe("third_party/codeforge");
|
|
76
|
-
expect(entryDirectory(tree, codeforge!)).toBe(
|
|
77
|
-
join(root, "third_party", "codeforge"),
|
|
78
|
-
);
|
|
79
|
-
expect(findEntry(tree.marketplace, "ghost")).toBeUndefined();
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
describe("the official tree in this repository", () => {
|
|
84
|
-
it("reads clean through the CLI walker", () => {
|
|
85
|
-
const official = resolveOfficialMarketplace();
|
|
86
|
-
expect(official.source).toBe("repo");
|
|
87
|
-
const tree = readMarketplaceTree(official.dir);
|
|
88
|
-
expect(tree.marketplace.name).toBe("stigmer");
|
|
89
|
-
expect(tree.marketplace.dialect).toBe("stigmer");
|
|
90
|
-
expect(tree.warnings).toEqual([]);
|
|
91
|
-
expect(findEntry(tree.marketplace, "linear")?.dir).toBe("linear");
|
|
92
|
-
});
|
|
93
|
-
});
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
// Pins the two grammars: every accepted form of `[marketplace/]name[@version]`
|
|
2
|
-
// and every refusal with its sentence; every accepted form of an `add`
|
|
3
|
-
// source (a directory wins, then owner/repo[@ref], then the GitHub URL) and
|
|
4
|
-
// the refusals.
|
|
5
|
-
|
|
6
|
-
import { mkdirSync, mkdtempSync, rmSync } from "node:fs";
|
|
7
|
-
import { tmpdir } from "node:os";
|
|
8
|
-
import { join } from "node:path";
|
|
9
|
-
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
10
|
-
import { formatInstallRef, parseAddSource, parseInstallRef } from "./ref.js";
|
|
11
|
-
|
|
12
|
-
describe("parseInstallRef", () => {
|
|
13
|
-
it("reads a bare name, a marketplace prefix, a version, and all three", () => {
|
|
14
|
-
expect(parseInstallRef("thermos")).toEqual({ name: "thermos" });
|
|
15
|
-
expect(parseInstallRef("cursor-plugins/thermos")).toEqual({
|
|
16
|
-
marketplace: "cursor-plugins",
|
|
17
|
-
name: "thermos",
|
|
18
|
-
});
|
|
19
|
-
expect(parseInstallRef("thermos@1.0.0")).toEqual({
|
|
20
|
-
name: "thermos",
|
|
21
|
-
version: "1.0.0",
|
|
22
|
-
});
|
|
23
|
-
expect(parseInstallRef("stigmer/assistant@1.0.0")).toEqual({
|
|
24
|
-
marketplace: "stigmer",
|
|
25
|
-
name: "assistant",
|
|
26
|
-
version: "1.0.0",
|
|
27
|
-
});
|
|
28
|
-
expect(parseInstallRef("third.party-x@v2-rc.1")).toEqual({
|
|
29
|
-
name: "third.party-x",
|
|
30
|
-
version: "v2-rc.1",
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("round-trips through formatInstallRef", () => {
|
|
35
|
-
for (const text of [
|
|
36
|
-
"thermos",
|
|
37
|
-
"cursor-plugins/thermos",
|
|
38
|
-
"thermos@1.0.0",
|
|
39
|
-
"a/b@c",
|
|
40
|
-
]) {
|
|
41
|
-
expect(formatInstallRef(parseInstallRef(text))).toBe(text);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it("refuses a path toward push plugin", () => {
|
|
46
|
-
for (const path of [
|
|
47
|
-
"./thermos",
|
|
48
|
-
"../x",
|
|
49
|
-
"/tmp/plugin",
|
|
50
|
-
".",
|
|
51
|
-
"..",
|
|
52
|
-
"~/plugins",
|
|
53
|
-
"C:\\plugins",
|
|
54
|
-
]) {
|
|
55
|
-
expect(() => parseInstallRef(path)).toThrow(
|
|
56
|
-
/is a path.*stigmer push plugin/s,
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it("refuses names and versions outside the grammar, naming the part", () => {
|
|
62
|
-
expect(() => parseInstallRef("Thermos")).toThrow(
|
|
63
|
-
/'Thermos' is not a plugin name/,
|
|
64
|
-
);
|
|
65
|
-
expect(() => parseInstallRef("a/b/c")).toThrow(
|
|
66
|
-
/'b\/c' is not a plugin name/,
|
|
67
|
-
);
|
|
68
|
-
expect(() => parseInstallRef("Bad/thermos")).toThrow(
|
|
69
|
-
/'Bad' is not a marketplace name/,
|
|
70
|
-
);
|
|
71
|
-
expect(() => parseInstallRef("thermos@")).toThrow(/'' is not a version/);
|
|
72
|
-
expect(() => parseInstallRef("thermos@1.0+build")).toThrow(
|
|
73
|
-
/'1.0\+build' is not a version/,
|
|
74
|
-
);
|
|
75
|
-
expect(() => parseInstallRef("")).toThrow(/'' is not a plugin name/);
|
|
76
|
-
expect(() => parseInstallRef("a@b@c")).toThrow(/'b@c' is not a version/);
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
describe("parseAddSource", () => {
|
|
81
|
-
let cwd: string;
|
|
82
|
-
|
|
83
|
-
beforeAll(() => {
|
|
84
|
-
cwd = mkdtempSync(join(tmpdir(), "stigmer-add-source-"));
|
|
85
|
-
mkdirSync(join(cwd, "plugins"));
|
|
86
|
-
mkdirSync(join(cwd, "cursor", "plugins"), { recursive: true });
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
afterAll(() => {
|
|
90
|
-
rmSync(cwd, { recursive: true, force: true });
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it("reads an existing directory as local, stored absolute, before any other reading", () => {
|
|
94
|
-
expect(parseAddSource("plugins", cwd)).toEqual({
|
|
95
|
-
type: "local",
|
|
96
|
-
path: join(cwd, "plugins"),
|
|
97
|
-
});
|
|
98
|
-
expect(parseAddSource("./plugins/", cwd)).toEqual({
|
|
99
|
-
type: "local",
|
|
100
|
-
path: join(cwd, "plugins"),
|
|
101
|
-
});
|
|
102
|
-
expect(parseAddSource(join(cwd, "plugins"), cwd)).toEqual({
|
|
103
|
-
type: "local",
|
|
104
|
-
path: join(cwd, "plugins"),
|
|
105
|
-
});
|
|
106
|
-
// A directory named like an owner/repo is the directory.
|
|
107
|
-
expect(parseAddSource("cursor/plugins", cwd)).toEqual({
|
|
108
|
-
type: "local",
|
|
109
|
-
path: join(cwd, "cursor", "plugins"),
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
it("reads owner/repo and owner/repo@ref as github when no such directory exists", () => {
|
|
114
|
-
expect(parseAddSource("anthropics/claude-code", cwd)).toEqual({
|
|
115
|
-
type: "github",
|
|
116
|
-
repo: "anthropics/claude-code",
|
|
117
|
-
});
|
|
118
|
-
expect(parseAddSource("anthropics/claude-code@v1.0", cwd)).toEqual({
|
|
119
|
-
type: "github",
|
|
120
|
-
repo: "anthropics/claude-code",
|
|
121
|
-
ref: "v1.0",
|
|
122
|
-
});
|
|
123
|
-
expect(parseAddSource("openai/codex@refs/heads/main", cwd)).toEqual({
|
|
124
|
-
type: "github",
|
|
125
|
-
repo: "openai/codex",
|
|
126
|
-
ref: "refs/heads/main",
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
it("unwraps the GitHub URL a browser shows, with or without a tree ref", () => {
|
|
131
|
-
expect(parseAddSource("https://github.com/cursor/plugins", cwd)).toEqual({
|
|
132
|
-
type: "github",
|
|
133
|
-
repo: "cursor/plugins",
|
|
134
|
-
});
|
|
135
|
-
expect(parseAddSource("https://github.com/cursor/plugins/", cwd)).toEqual({
|
|
136
|
-
type: "github",
|
|
137
|
-
repo: "cursor/plugins",
|
|
138
|
-
});
|
|
139
|
-
expect(
|
|
140
|
-
parseAddSource("https://github.com/cursor/plugins.git", cwd),
|
|
141
|
-
).toEqual({ type: "github", repo: "cursor/plugins" });
|
|
142
|
-
expect(
|
|
143
|
-
parseAddSource("https://www.github.com/cursor/plugins/tree/main", cwd),
|
|
144
|
-
).toEqual({
|
|
145
|
-
type: "github",
|
|
146
|
-
repo: "cursor/plugins",
|
|
147
|
-
ref: "main",
|
|
148
|
-
});
|
|
149
|
-
expect(
|
|
150
|
-
parseAddSource("http://github.com/openai/codex/tree/release/1.2", cwd),
|
|
151
|
-
).toEqual({
|
|
152
|
-
type: "github",
|
|
153
|
-
repo: "openai/codex",
|
|
154
|
-
ref: "release/1.2",
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
it("refuses what is neither, naming the three forms", () => {
|
|
159
|
-
expect(() => parseAddSource("", cwd)).toThrow(/source is required/);
|
|
160
|
-
expect(() => parseAddSource("missing-dir", cwd)).toThrow(
|
|
161
|
-
/not a marketplace source/,
|
|
162
|
-
);
|
|
163
|
-
expect(() => parseAddSource("./missing-dir", cwd)).toThrow(
|
|
164
|
-
/not a directory on this machine and not a GitHub/,
|
|
165
|
-
);
|
|
166
|
-
expect(() => parseAddSource("a/b/c", cwd)).toThrow(
|
|
167
|
-
/not a directory on this machine and not a GitHub/,
|
|
168
|
-
);
|
|
169
|
-
expect(() => parseAddSource("cursor/plugins@", cwd)).toThrow(
|
|
170
|
-
/not a marketplace source|not a directory/,
|
|
171
|
-
);
|
|
172
|
-
expect(() => parseAddSource("https://gitlab.com/a/b", cwd)).toThrow(
|
|
173
|
-
/not a directory on this machine and not a GitHub/,
|
|
174
|
-
);
|
|
175
|
-
expect(() => parseAddSource("https://github.com/cursor", cwd)).toThrow(
|
|
176
|
-
/not a directory on this machine and not a GitHub/,
|
|
177
|
-
);
|
|
178
|
-
});
|
|
179
|
-
});
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { CommandResult, resultToHuman, resultToJson, resultToQuiet } from "./command-result.js";
|
|
3
|
-
|
|
4
|
-
describe("resultToJson", () => {
|
|
5
|
-
it("emits status as a lowercase string", () => {
|
|
6
|
-
expect(JSON.parse(resultToJson(CommandResult.success("ok"))).status).toBe("success");
|
|
7
|
-
expect(JSON.parse(resultToJson(CommandResult.warning("w"))).status).toBe("warning");
|
|
8
|
-
expect(JSON.parse(resultToJson(CommandResult.error("e"))).status).toBe("error");
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
it("omits empty sections and hints", () => {
|
|
12
|
-
const parsed = JSON.parse(resultToJson(CommandResult.success("done")));
|
|
13
|
-
expect(parsed).not.toHaveProperty("sections");
|
|
14
|
-
expect(parsed).not.toHaveProperty("hints");
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it("serializes sections (fields + items) and hints", () => {
|
|
18
|
-
const result = CommandResult.success("Created");
|
|
19
|
-
result.addSection("Details").field("ID", "abc").field("Name", "agent");
|
|
20
|
-
result.addSection("Items").item("first").item("second");
|
|
21
|
-
result.hint("try this").hint("and that");
|
|
22
|
-
|
|
23
|
-
const parsed = JSON.parse(resultToJson(result));
|
|
24
|
-
expect(parsed.sections).toHaveLength(2);
|
|
25
|
-
expect(parsed.sections[0]).toEqual({
|
|
26
|
-
title: "Details",
|
|
27
|
-
fields: [
|
|
28
|
-
{ key: "ID", value: "abc" },
|
|
29
|
-
{ key: "Name", value: "agent" },
|
|
30
|
-
],
|
|
31
|
-
});
|
|
32
|
-
expect(parsed.sections[1]).toEqual({ title: "Items", items: ["first", "second"] });
|
|
33
|
-
expect(parsed.hints).toEqual(["try this", "and that"]);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it("emits the data payload in JSON only, and omits it when unset", () => {
|
|
37
|
-
const result = CommandResult.warning("Plugin is valid").withData({ plugin: { name: "x" }, warnings: [] });
|
|
38
|
-
const parsed = JSON.parse(resultToJson(result));
|
|
39
|
-
expect(parsed.data).toEqual({ plugin: { name: "x" }, warnings: [] });
|
|
40
|
-
expect(JSON.parse(resultToJson(CommandResult.success("ok")))).not.toHaveProperty("data");
|
|
41
|
-
expect(resultToHuman(result, false)).not.toContain("plugin");
|
|
42
|
-
expect(resultToQuiet(result, false)).toBe("⚠ Plugin is valid\n");
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
describe("resultToHuman (plain, no color)", () => {
|
|
47
|
-
it("renders the status icon, message, fields, and hints", () => {
|
|
48
|
-
const result = CommandResult.success("Created agent");
|
|
49
|
-
result.addSection("Details").field("ID", "agt-123");
|
|
50
|
-
result.hint("Run: stigmer get agent agt-123");
|
|
51
|
-
|
|
52
|
-
const out = resultToHuman(result, false);
|
|
53
|
-
expect(out).toContain("✓ Created agent");
|
|
54
|
-
expect(out).toContain("Details:");
|
|
55
|
-
expect(out).toContain("ID");
|
|
56
|
-
expect(out).toContain("agt-123");
|
|
57
|
-
expect(out).toContain("Run: stigmer get agent agt-123");
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it("uses an error icon for error results", () => {
|
|
61
|
-
expect(resultToHuman(CommandResult.error("boom"), false)).toContain("✗ boom");
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
describe("resultToQuiet (plain, no color)", () => {
|
|
66
|
-
it("renders only the status line", () => {
|
|
67
|
-
const result = CommandResult.success("Done");
|
|
68
|
-
result.addSection("Details").field("ID", "abc");
|
|
69
|
-
const out = resultToQuiet(result, false);
|
|
70
|
-
expect(out).toBe("✓ Done\n");
|
|
71
|
-
expect(out).not.toContain("Details");
|
|
72
|
-
});
|
|
73
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { PassThrough } from "node:stream";
|
|
2
|
-
import { describe, expect, it } from "vitest";
|
|
3
|
-
import { confirm } from "./confirm.js";
|
|
4
|
-
|
|
5
|
-
// A PassThrough masquerading as an interactive TTY input, with a writable sink
|
|
6
|
-
// for the prompt text we don't need to inspect.
|
|
7
|
-
function ttyPair(isTTY: boolean): { input: NodeJS.ReadStream; output: NodeJS.WritableStream } {
|
|
8
|
-
const input = new PassThrough();
|
|
9
|
-
(input as unknown as { isTTY: boolean }).isTTY = isTTY;
|
|
10
|
-
return { input: input as unknown as NodeJS.ReadStream, output: new PassThrough() };
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
async function answer(reply: string): Promise<boolean> {
|
|
14
|
-
const { input, output } = ttyPair(true);
|
|
15
|
-
const pending = confirm("Proceed? [y/N]", { input, output });
|
|
16
|
-
(input as unknown as PassThrough).write(`${reply}\n`);
|
|
17
|
-
return pending;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
describe("confirm", () => {
|
|
21
|
-
it("auto-confirms when forced, without reading input", async () => {
|
|
22
|
-
expect(await confirm("Proceed? [y/N]", { force: true })).toBe(true);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it("refuses (no prompt) when input is not a TTY", async () => {
|
|
26
|
-
const { input, output } = ttyPair(false);
|
|
27
|
-
expect(await confirm("Proceed? [y/N]", { input, output })).toBe(false);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it.each([
|
|
31
|
-
["y", true],
|
|
32
|
-
["Y", true],
|
|
33
|
-
["yes", true],
|
|
34
|
-
["YES", true],
|
|
35
|
-
[" y ", true],
|
|
36
|
-
["n", false],
|
|
37
|
-
["no", false],
|
|
38
|
-
["", false],
|
|
39
|
-
["nope", false],
|
|
40
|
-
])("interprets %j as %s", async (reply, expected) => {
|
|
41
|
-
expect(await answer(reply)).toBe(expected);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { UsageError } from "../errors/usage-error.js";
|
|
3
|
-
import { resolveFormat, supportedFormats } from "./format.js";
|
|
4
|
-
|
|
5
|
-
describe("resolveFormat — defaults per command class", () => {
|
|
6
|
-
it("defaults reads to table", () => {
|
|
7
|
-
expect(resolveFormat({}, "read")).toBe("table");
|
|
8
|
-
});
|
|
9
|
-
it("defaults mutations to human", () => {
|
|
10
|
-
expect(resolveFormat({}, "mutating")).toBe("human");
|
|
11
|
-
});
|
|
12
|
-
it("defaults streaming to inline", () => {
|
|
13
|
-
expect(resolveFormat({}, "streaming")).toBe("inline");
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
describe("resolveFormat — --json alias resolves per class", () => {
|
|
18
|
-
it("maps --json to json for reads", () => {
|
|
19
|
-
expect(resolveFormat({ json: true }, "read")).toBe("json");
|
|
20
|
-
});
|
|
21
|
-
it("maps --json to json for mutations", () => {
|
|
22
|
-
expect(resolveFormat({ json: true }, "mutating")).toBe("json");
|
|
23
|
-
});
|
|
24
|
-
it("maps --json to ndjson for streaming", () => {
|
|
25
|
-
expect(resolveFormat({ json: true }, "streaming")).toBe("ndjson");
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
describe("resolveFormat — --quiet alias", () => {
|
|
30
|
-
it("maps --quiet to quiet for mutations", () => {
|
|
31
|
-
expect(resolveFormat({ quiet: true }, "mutating")).toBe("quiet");
|
|
32
|
-
});
|
|
33
|
-
it("rejects --json together with --quiet", () => {
|
|
34
|
-
expect(() => resolveFormat({ json: true, quiet: true }, "mutating")).toThrow(UsageError);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
describe("resolveFormat — explicit -o/--output", () => {
|
|
39
|
-
it("maps universal table -> human for mutations", () => {
|
|
40
|
-
expect(resolveFormat({ output: "table" }, "mutating")).toBe("human");
|
|
41
|
-
});
|
|
42
|
-
it("maps universal table -> inline for streaming", () => {
|
|
43
|
-
expect(resolveFormat({ output: "table" }, "streaming")).toBe("inline");
|
|
44
|
-
});
|
|
45
|
-
it("accepts yaml for reads", () => {
|
|
46
|
-
expect(resolveFormat({ output: "yaml" }, "read")).toBe("yaml");
|
|
47
|
-
});
|
|
48
|
-
it("is case-insensitive", () => {
|
|
49
|
-
expect(resolveFormat({ output: "JSON" }, "read")).toBe("json");
|
|
50
|
-
});
|
|
51
|
-
it("rejects an unknown universal value", () => {
|
|
52
|
-
expect(() => resolveFormat({ output: "xml" }, "read")).toThrow(/invalid --output value/);
|
|
53
|
-
});
|
|
54
|
-
it("rejects yaml for mutations (unsupported by the class)", () => {
|
|
55
|
-
expect(() => resolveFormat({ output: "yaml" }, "mutating")).toThrow(/not supported/);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
describe("supportedFormats", () => {
|
|
60
|
-
it("lists the universal values each class supports", () => {
|
|
61
|
-
expect(supportedFormats("read")).toEqual(["table", "json", "yaml"]);
|
|
62
|
-
expect(supportedFormats("mutating")).toEqual(["table", "json"]);
|
|
63
|
-
expect(supportedFormats("streaming")).toEqual(["table", "json", "ndjson"]);
|
|
64
|
-
});
|
|
65
|
-
});
|
package/src/output/proto.test.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { create } from "@bufbuild/protobuf";
|
|
2
|
-
import { ApiResourceKindMetaSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
3
|
-
import { parse as parseYaml } from "yaml";
|
|
4
|
-
import { describe, expect, it } from "vitest";
|
|
5
|
-
import {
|
|
6
|
-
protoToJsonValue,
|
|
7
|
-
renderProtoJson,
|
|
8
|
-
renderProtoListJson,
|
|
9
|
-
renderProtoListYaml,
|
|
10
|
-
renderProtoYaml,
|
|
11
|
-
} from "./proto.js";
|
|
12
|
-
|
|
13
|
-
// A small, stable generated message exercising snake_case fields (display_name,
|
|
14
|
-
// id_prefix, is_versioned) and default-omission (group/version/tier enums = 0).
|
|
15
|
-
function sampleMeta() {
|
|
16
|
-
return create(ApiResourceKindMetaSchema, {
|
|
17
|
-
name: "Agent",
|
|
18
|
-
displayName: "Agent",
|
|
19
|
-
idPrefix: "agt",
|
|
20
|
-
isVersioned: true,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
describe("renderProtoJson — protojson parity", () => {
|
|
25
|
-
it("uses proto (snake_case) field names", () => {
|
|
26
|
-
const parsed = JSON.parse(renderProtoJson(ApiResourceKindMetaSchema, sampleMeta()));
|
|
27
|
-
expect(parsed).toEqual({
|
|
28
|
-
name: "Agent",
|
|
29
|
-
display_name: "Agent",
|
|
30
|
-
id_prefix: "agt",
|
|
31
|
-
is_versioned: true,
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it("omits unpopulated (default-valued) fields", () => {
|
|
36
|
-
const parsed = JSON.parse(renderProtoJson(ApiResourceKindMetaSchema, sampleMeta()));
|
|
37
|
-
expect(parsed).not.toHaveProperty("group");
|
|
38
|
-
expect(parsed).not.toHaveProperty("tier");
|
|
39
|
-
expect(parsed).not.toHaveProperty("authorization");
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it("pretty-prints with a trailing newline", () => {
|
|
43
|
-
const rendered = renderProtoJson(ApiResourceKindMetaSchema, sampleMeta());
|
|
44
|
-
expect(rendered.endsWith("\n")).toBe(true);
|
|
45
|
-
expect(rendered).toContain(' "name": "Agent"');
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
describe("renderProtoYaml — round-trips through the same JSON value", () => {
|
|
50
|
-
it("yields the same field names and values as the JSON renderer", () => {
|
|
51
|
-
const meta = sampleMeta();
|
|
52
|
-
const fromYaml = parseYaml(renderProtoYaml(ApiResourceKindMetaSchema, meta));
|
|
53
|
-
expect(fromYaml).toEqual(protoToJsonValue(ApiResourceKindMetaSchema, meta));
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
describe("list renderers", () => {
|
|
58
|
-
it("renders a JSON array of messages", () => {
|
|
59
|
-
const parsed = JSON.parse(
|
|
60
|
-
renderProtoListJson(ApiResourceKindMetaSchema, [sampleMeta(), sampleMeta()]),
|
|
61
|
-
);
|
|
62
|
-
expect(Array.isArray(parsed)).toBe(true);
|
|
63
|
-
expect(parsed).toHaveLength(2);
|
|
64
|
-
expect(parsed[0].id_prefix).toBe("agt");
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it("renders a YAML array equal to the JSON-value array", () => {
|
|
68
|
-
const items = [sampleMeta()];
|
|
69
|
-
const fromYaml = parseYaml(renderProtoListYaml(ApiResourceKindMetaSchema, items));
|
|
70
|
-
expect(fromYaml).toEqual(items.map((m) => protoToJsonValue(ApiResourceKindMetaSchema, m)));
|
|
71
|
-
});
|
|
72
|
-
});
|
package/src/output/table.test.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { renderEmpty, renderTable } from "./table.js";
|
|
3
|
-
|
|
4
|
-
describe("renderTable", () => {
|
|
5
|
-
it("returns empty string for no rows", () => {
|
|
6
|
-
expect(renderTable(["NAME", "KIND"], [])).toBe("");
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
it("renders aligned columns with a dash separator", () => {
|
|
10
|
-
const out = renderTable(
|
|
11
|
-
["NAME", "KIND"],
|
|
12
|
-
[
|
|
13
|
-
["my-agent", "agent"],
|
|
14
|
-
["wf", "workflow"],
|
|
15
|
-
],
|
|
16
|
-
);
|
|
17
|
-
const lines = out.trimEnd().split("\n");
|
|
18
|
-
expect(lines[0]).toBe("NAME KIND");
|
|
19
|
-
expect(lines[1]).toBe("-------- --------");
|
|
20
|
-
expect(lines[2]).toBe("my-agent agent");
|
|
21
|
-
expect(lines[3]).toBe("wf workflow");
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it("tolerates short rows by padding missing cells", () => {
|
|
25
|
-
const out = renderTable(["A", "B"], [["only"]]);
|
|
26
|
-
expect(out.trimEnd().split("\n")[2]).toBe("only");
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
describe("renderEmpty", () => {
|
|
31
|
-
it("reports an unfiltered empty state", () => {
|
|
32
|
-
expect(renderEmpty("agents")).toBe("\nNo agents found\n\n");
|
|
33
|
-
});
|
|
34
|
-
it("reports a query-filtered empty state", () => {
|
|
35
|
-
expect(renderEmpty("agents", "foo")).toBe("\nNo agents found matching 'foo'\n\n");
|
|
36
|
-
});
|
|
37
|
-
});
|