@stigmer/cli 3.35.0 → 3.37.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,172 +0,0 @@
|
|
|
1
|
-
import { Code, ConnectError } from "@connectrpc/connect";
|
|
2
|
-
import { StigmerError } from "@stigmer/sdk";
|
|
3
|
-
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
4
|
-
import { setDebug } from "../runtime.js";
|
|
5
|
-
import { classify } from "./classify.js";
|
|
6
|
-
import { ExitCode } from "./exit-codes.js";
|
|
7
|
-
import { formatError, handle } from "./handle.js";
|
|
8
|
-
import { UsageError } from "./usage-error.js";
|
|
9
|
-
|
|
10
|
-
afterEach(() => {
|
|
11
|
-
setDebug(false);
|
|
12
|
-
vi.restoreAllMocks();
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
describe("classify — gRPC code to exit code", () => {
|
|
16
|
-
// Drives both error sources: a raw ConnectError (direct transport usage) and
|
|
17
|
-
// an SDK StigmerError (typed client usage). Both must classify identically.
|
|
18
|
-
const cases: ReadonlyArray<{ code: number; exit: number; messageContains?: string }> = [
|
|
19
|
-
{ code: Code.Unavailable, exit: ExitCode.Connection },
|
|
20
|
-
{ code: Code.DeadlineExceeded, exit: ExitCode.Connection },
|
|
21
|
-
{ code: Code.ResourceExhausted, exit: ExitCode.Connection },
|
|
22
|
-
{ code: Code.NotFound, exit: ExitCode.NotFound },
|
|
23
|
-
{ code: Code.InvalidArgument, exit: ExitCode.Usage },
|
|
24
|
-
{ code: Code.FailedPrecondition, exit: ExitCode.Usage, messageContains: "Precondition failed" },
|
|
25
|
-
{ code: Code.AlreadyExists, exit: ExitCode.Usage, messageContains: "Already exists" },
|
|
26
|
-
{ code: Code.Unauthenticated, exit: ExitCode.Auth },
|
|
27
|
-
{ code: Code.PermissionDenied, exit: ExitCode.Auth, messageContains: "Permission denied" },
|
|
28
|
-
{ code: Code.Internal, exit: ExitCode.General },
|
|
29
|
-
{ code: Code.Aborted, exit: ExitCode.General, messageContains: "Operation aborted" },
|
|
30
|
-
{ code: Code.Canceled, exit: ExitCode.General },
|
|
31
|
-
{ code: Code.Unimplemented, exit: ExitCode.General, messageContains: "Unimplemented" },
|
|
32
|
-
{ code: Code.OutOfRange, exit: ExitCode.General, messageContains: "OutOfRange" },
|
|
33
|
-
{ code: Code.DataLoss, exit: ExitCode.General, messageContains: "DataLoss" },
|
|
34
|
-
];
|
|
35
|
-
|
|
36
|
-
for (const { code, exit, messageContains } of cases) {
|
|
37
|
-
it(`maps ConnectError ${Code[code]} -> exit ${exit}`, () => {
|
|
38
|
-
const result = classify(new ConnectError("boom", code));
|
|
39
|
-
expect(result?.exitCode).toBe(exit);
|
|
40
|
-
expect(result?.code).toBe(code);
|
|
41
|
-
if (messageContains) expect(result?.message).toContain(messageContains);
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it(`maps StigmerError ${Code[code]} -> exit ${exit}`, () => {
|
|
45
|
-
const result = classify(new StigmerError("unknown", "boom", code));
|
|
46
|
-
expect(result?.exitCode).toBe(exit);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
it("preserves the server message verbatim for NotFound", () => {
|
|
51
|
-
const result = classify(new ConnectError("agent 'foo' not found", Code.NotFound));
|
|
52
|
-
expect(result?.message).toBe("agent 'foo' not found");
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it("attaches remediation hints for auth failures", () => {
|
|
56
|
-
const result = classify(new ConnectError("nope", Code.Unauthenticated));
|
|
57
|
-
expect(result?.hints).toEqual(["Please sign in:", " stigmer auth login"]);
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
describe("classify — non-RPC and edge cases", () => {
|
|
62
|
-
it("returns null for null/undefined", () => {
|
|
63
|
-
expect(classify(null)).toBeNull();
|
|
64
|
-
expect(classify(undefined)).toBeNull();
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it("classifies a plain Error as a general failure", () => {
|
|
68
|
-
const result = classify(new Error("disk full"));
|
|
69
|
-
expect(result?.exitCode).toBe(ExitCode.General);
|
|
70
|
-
expect(result?.message).toBe("disk full");
|
|
71
|
-
expect(result?.code).toBeUndefined();
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it("unwraps a wrapped RPC error via the cause chain", () => {
|
|
75
|
-
const inner = new ConnectError("not found", Code.NotFound);
|
|
76
|
-
const wrapped = new Error("while fetching agent", { cause: inner });
|
|
77
|
-
const result = classify(wrapped);
|
|
78
|
-
expect(result?.exitCode).toBe(ExitCode.NotFound);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it("maps a local UsageError to the usage exit code", () => {
|
|
82
|
-
const result = classify(new UsageError("invalid --output value"));
|
|
83
|
-
expect(result?.exitCode).toBe(ExitCode.Usage);
|
|
84
|
-
expect(result?.message).toBe("invalid --output value");
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
describe("classify — local abort vs remote cancel", () => {
|
|
89
|
-
it("treats a local AbortError as a clean exit 0 with no message", () => {
|
|
90
|
-
const abort = new Error("aborted");
|
|
91
|
-
abort.name = "AbortError";
|
|
92
|
-
const result = classify(abort);
|
|
93
|
-
expect(result?.exitCode).toBe(ExitCode.Success);
|
|
94
|
-
expect(result?.message).toBe("");
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it("treats an aborted RPC (Canceled wrapping AbortError) as exit 0", () => {
|
|
98
|
-
const abort = new Error("aborted");
|
|
99
|
-
abort.name = "AbortError";
|
|
100
|
-
const cancelled = new ConnectError("canceled", Code.Canceled, undefined, undefined, abort);
|
|
101
|
-
const result = classify(cancelled);
|
|
102
|
-
expect(result?.exitCode).toBe(ExitCode.Success);
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it("treats a remote Canceled (no local abort) as exit 1", () => {
|
|
106
|
-
const result = classify(new ConnectError("server canceled", Code.Canceled));
|
|
107
|
-
expect(result?.exitCode).toBe(ExitCode.General);
|
|
108
|
-
expect(result?.message).toBe("Operation cancelled");
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
describe("formatError", () => {
|
|
113
|
-
it("renders message and hints", () => {
|
|
114
|
-
const out = formatError(
|
|
115
|
-
{ exitCode: ExitCode.Auth, message: "Not authenticated", hints: ["Please sign in:", " stigmer auth login"] },
|
|
116
|
-
false,
|
|
117
|
-
);
|
|
118
|
-
expect(out).toBe("Error: Not authenticated\n\nPlease sign in:\n stigmer auth login\n");
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it("returns empty string for a silent (empty message) error", () => {
|
|
122
|
-
expect(formatError({ exitCode: ExitCode.Success, message: "" }, false)).toBe("");
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it("appends the raw chain and numeric code in debug mode", () => {
|
|
126
|
-
const cause = new ConnectError("boom", Code.NotFound);
|
|
127
|
-
const out = formatError(
|
|
128
|
-
{ exitCode: ExitCode.NotFound, message: "missing", cause, code: Code.NotFound },
|
|
129
|
-
true,
|
|
130
|
-
);
|
|
131
|
-
expect(out).toContain("--- debug ---");
|
|
132
|
-
expect(out).toContain(`gRPC code: NotFound (${Code.NotFound})`);
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
it("omits the debug block when debug mode is off", () => {
|
|
136
|
-
const cause = new Error("boom");
|
|
137
|
-
const out = formatError({ exitCode: ExitCode.General, message: "x", cause }, false);
|
|
138
|
-
expect(out).not.toContain("--- debug ---");
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
describe("handle", () => {
|
|
143
|
-
it("exits with the mapped code and writes to stderr", () => {
|
|
144
|
-
const exitSpy = vi.spyOn(process, "exit").mockImplementation(((code?: number) => {
|
|
145
|
-
throw new Error(`__exit__:${code}`);
|
|
146
|
-
}) as never);
|
|
147
|
-
const stderrSpy = vi.spyOn(process.stderr, "write").mockReturnValue(true);
|
|
148
|
-
|
|
149
|
-
expect(() => handle(new ConnectError("agent missing", Code.NotFound))).toThrow("__exit__:5");
|
|
150
|
-
expect(stderrSpy).toHaveBeenCalledWith(expect.stringContaining("Error: agent missing"));
|
|
151
|
-
expect(exitSpy).toHaveBeenCalledWith(ExitCode.NotFound);
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
it("exits 0 silently for a local abort", () => {
|
|
155
|
-
const exitSpy = vi.spyOn(process, "exit").mockImplementation(((code?: number) => {
|
|
156
|
-
throw new Error(`__exit__:${code}`);
|
|
157
|
-
}) as never);
|
|
158
|
-
const stderrSpy = vi.spyOn(process.stderr, "write").mockReturnValue(true);
|
|
159
|
-
|
|
160
|
-
const abort = new Error("aborted");
|
|
161
|
-
abort.name = "AbortError";
|
|
162
|
-
expect(() => handle(abort)).toThrow("__exit__:0");
|
|
163
|
-
expect(stderrSpy).not.toHaveBeenCalled();
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
it("exits 0 when there is no error", () => {
|
|
167
|
-
vi.spyOn(process, "exit").mockImplementation(((code?: number) => {
|
|
168
|
-
throw new Error(`__exit__:${code}`);
|
|
169
|
-
}) as never);
|
|
170
|
-
expect(() => handle(null)).toThrow("__exit__:0");
|
|
171
|
-
});
|
|
172
|
-
});
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
|
-
import { describe, expect, it } from "vitest";
|
|
3
|
-
import { mapReleaseArch, mapReleaseOs, parseShasum, sha256Hex } from "./artifact.js";
|
|
4
|
-
|
|
5
|
-
describe("mapReleaseOs", () => {
|
|
6
|
-
it("maps Node platforms to release OS tokens", () => {
|
|
7
|
-
expect(mapReleaseOs("darwin")).toBe("darwin");
|
|
8
|
-
expect(mapReleaseOs("win32")).toBe("windows");
|
|
9
|
-
expect(mapReleaseOs("linux")).toBe("linux");
|
|
10
|
-
expect(mapReleaseOs("freebsd")).toBe("linux"); // default bucket
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
describe("mapReleaseArch", () => {
|
|
15
|
-
it("maps Node arch names to release arch tokens", () => {
|
|
16
|
-
expect(mapReleaseArch("arm64")).toBe("arm64");
|
|
17
|
-
expect(mapReleaseArch("x64")).toBe("amd64");
|
|
18
|
-
expect(mapReleaseArch("ppc64")).toBe("ppc64"); // passthrough
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
describe("sha256Hex", () => {
|
|
23
|
-
it("computes a lowercase hex digest matching node:crypto", () => {
|
|
24
|
-
const bytes = new Uint8Array([1, 2, 3, 4, 5]);
|
|
25
|
-
const expected = createHash("sha256").update(bytes).digest("hex");
|
|
26
|
-
expect(sha256Hex(bytes)).toBe(expected);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// A release-wide `sha256sum` file is matched by filename, never by position,
|
|
31
|
-
// and the binary-mode "*" prefix is not part of a name.
|
|
32
|
-
describe("parseShasum", () => {
|
|
33
|
-
const A = "a".repeat(64);
|
|
34
|
-
const B = "b".repeat(64);
|
|
35
|
-
|
|
36
|
-
it("returns the digest on the line naming the file, wherever the line is", () => {
|
|
37
|
-
const file = `${A} first.tar.gz\n${B} second.tar.gz\n`;
|
|
38
|
-
expect(parseShasum(file, "second.tar.gz")).toBe(B);
|
|
39
|
-
expect(parseShasum(file, "first.tar.gz")).toBe(A);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it("returns an empty string when no line names the file", () => {
|
|
43
|
-
expect(parseShasum(`${A} first.tar.gz\n`, "missing.tar.gz")).toBe("");
|
|
44
|
-
expect(parseShasum("", "missing.tar.gz")).toBe("");
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it("accepts sha256sum's binary-mode marker and normalises the hex to lowercase", () => {
|
|
48
|
-
expect(parseShasum(`${A.toUpperCase()} *first.tar.gz\n`, "first.tar.gz")).toBe(A);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it("ignores blank and malformed lines", () => {
|
|
52
|
-
expect(parseShasum(`\n\nnot-a-digest\n${B} x.tar.gz\n`, "x.tar.gz")).toBe(B);
|
|
53
|
-
});
|
|
54
|
-
});
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
// Pins the bootstrap's one act over a real Connect backend: an org the
|
|
2
|
-
// identity already sees is `present` with no create; an absent one is created
|
|
3
|
-
// as the Organization as code (slug, name, self-managed) with NO label, since
|
|
4
|
-
// a reserved `stigmer.ai/` label is refused by a self-hosted server with
|
|
5
|
-
// authentication on (stigmer/stigmer#1192); a create that loses the race to
|
|
6
|
-
// another launcher (ALREADY_EXISTS) is `present`, not an error; any other
|
|
7
|
-
// refusal propagates with the server's sentence. And the local shape `up`
|
|
8
|
-
// runs: it announces a created org, stays quiet on a present one, and turns
|
|
9
|
-
// any failure into one warning naming the retry, never a throw.
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
createServer as createHttp2Server,
|
|
13
|
-
type Http2Server,
|
|
14
|
-
type ServerHttp2Session,
|
|
15
|
-
} from "node:http2";
|
|
16
|
-
import type { AddressInfo } from "node:net";
|
|
17
|
-
import { create } from "@bufbuild/protobuf";
|
|
18
|
-
import { Code, ConnectError, type ConnectRouter } from "@connectrpc/connect";
|
|
19
|
-
import { connectNodeAdapter } from "@connectrpc/connect-node";
|
|
20
|
-
import {
|
|
21
|
-
type Organization,
|
|
22
|
-
OrganizationSchema,
|
|
23
|
-
} from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/api_pb";
|
|
24
|
-
import { OrganizationCommandController } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/command_pb";
|
|
25
|
-
import { ManagementMode } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/enum_pb";
|
|
26
|
-
import { OrganizationsSchema } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/io_pb";
|
|
27
|
-
import { OrganizationQueryController } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/query_pb";
|
|
28
|
-
import { createNodeClient, normalizeEndpoint } from "@stigmer/sdk/node";
|
|
29
|
-
import type { Stigmer } from "@stigmer/sdk";
|
|
30
|
-
import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
31
|
-
import type { BackendClient } from "../client/index.js";
|
|
32
|
-
import { DEFAULT_LOCAL_ORG } from "../config/resolve.js";
|
|
33
|
-
import { bootstrapBackend, bootstrapLocalBackend } from "./bootstrap.js";
|
|
34
|
-
|
|
35
|
-
let backend: Http2Server;
|
|
36
|
-
let stigmer: Stigmer;
|
|
37
|
-
const openSessions = new Set<ServerHttp2Session>();
|
|
38
|
-
|
|
39
|
-
/** The orgs the backend holds, by slug. */
|
|
40
|
-
let held: Map<string, Organization>;
|
|
41
|
-
let creates: Organization[];
|
|
42
|
-
/** What `create` answers with instead of creating, when set. */
|
|
43
|
-
let refuseCreate: ConnectError | undefined;
|
|
44
|
-
|
|
45
|
-
beforeAll(async () => {
|
|
46
|
-
const routes = (router: ConnectRouter) => {
|
|
47
|
-
router.service(OrganizationQueryController, {
|
|
48
|
-
findMyOrganizations: () =>
|
|
49
|
-
create(OrganizationsSchema, { entries: [...held.values()] }),
|
|
50
|
-
});
|
|
51
|
-
router.service(OrganizationCommandController, {
|
|
52
|
-
create: (org) => {
|
|
53
|
-
creates.push(org);
|
|
54
|
-
if (refuseCreate !== undefined) throw refuseCreate;
|
|
55
|
-
const slug = org.metadata?.slug ?? "";
|
|
56
|
-
const row = create(OrganizationSchema, org);
|
|
57
|
-
if (row.metadata !== undefined) row.metadata.id = `org_${slug}`;
|
|
58
|
-
held.set(slug, row);
|
|
59
|
-
return row;
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
backend = createHttp2Server(connectNodeAdapter({ routes }));
|
|
64
|
-
backend.on("session", (session) => {
|
|
65
|
-
openSessions.add(session);
|
|
66
|
-
session.on("close", () => openSessions.delete(session));
|
|
67
|
-
});
|
|
68
|
-
await new Promise<void>((resolve) => backend.listen(0, "127.0.0.1", resolve));
|
|
69
|
-
const port = (backend.address() as AddressInfo).port;
|
|
70
|
-
stigmer = createNodeClient({
|
|
71
|
-
baseUrl: normalizeEndpoint(`127.0.0.1:${port}`),
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
afterAll(async () => {
|
|
76
|
-
for (const session of openSessions) session.destroy();
|
|
77
|
-
await new Promise<void>((resolve) => backend.close(() => resolve()));
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
beforeEach(() => {
|
|
81
|
-
held = new Map();
|
|
82
|
-
creates = [];
|
|
83
|
-
refuseCreate = undefined;
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
describe("bootstrapBackend", () => {
|
|
87
|
-
it("is present, with no create, when the identity already sees the org", async () => {
|
|
88
|
-
held.set(
|
|
89
|
-
DEFAULT_LOCAL_ORG,
|
|
90
|
-
create(OrganizationSchema, { metadata: { slug: DEFAULT_LOCAL_ORG } }),
|
|
91
|
-
);
|
|
92
|
-
expect(await bootstrapBackend(stigmer)).toBe("present");
|
|
93
|
-
expect(creates).toHaveLength(0);
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
it("creates the Organization as code, with no label, when absent", async () => {
|
|
97
|
-
held.set("acme", create(OrganizationSchema, { metadata: { slug: "acme" } }));
|
|
98
|
-
expect(await bootstrapBackend(stigmer)).toBe("created");
|
|
99
|
-
expect(creates).toHaveLength(1);
|
|
100
|
-
const sent = creates[0]!;
|
|
101
|
-
expect(sent.metadata?.slug).toBe(DEFAULT_LOCAL_ORG);
|
|
102
|
-
expect(sent.metadata?.org).toBe(DEFAULT_LOCAL_ORG);
|
|
103
|
-
expect(sent.metadata?.name).toBe("Stigmer");
|
|
104
|
-
expect(sent.metadata?.labels).toEqual({});
|
|
105
|
-
expect(sent.spec?.managementMode).toBe(ManagementMode.self_managed);
|
|
106
|
-
expect(sent.spec?.description).not.toBe("");
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
it("treats a create lost to another launcher as present", async () => {
|
|
110
|
-
refuseCreate = new ConnectError(
|
|
111
|
-
`organization '${DEFAULT_LOCAL_ORG}' already exists`,
|
|
112
|
-
Code.AlreadyExists,
|
|
113
|
-
);
|
|
114
|
-
expect(await bootstrapBackend(stigmer)).toBe("present");
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it("propagates any other refusal with the server's sentence", async () => {
|
|
118
|
-
refuseCreate = new ConnectError("organization creation is disabled", Code.PermissionDenied);
|
|
119
|
-
await expect(bootstrapBackend(stigmer)).rejects.toThrow(
|
|
120
|
-
/organization creation is disabled/,
|
|
121
|
-
);
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
describe("bootstrapLocalBackend", () => {
|
|
126
|
-
const client = { stigmer: {} as unknown as Stigmer } as unknown as BackendClient;
|
|
127
|
-
|
|
128
|
-
it("runs the act over the local client and announces a created org", async () => {
|
|
129
|
-
const said: string[] = [];
|
|
130
|
-
let seen: Stigmer | undefined;
|
|
131
|
-
await bootstrapLocalBackend({
|
|
132
|
-
client,
|
|
133
|
-
say: (line) => said.push(line),
|
|
134
|
-
bootstrap: async (s) => {
|
|
135
|
-
seen = s;
|
|
136
|
-
return "created";
|
|
137
|
-
},
|
|
138
|
-
});
|
|
139
|
-
expect(seen).toBe(client.stigmer);
|
|
140
|
-
expect(said).toEqual([`Created the '${DEFAULT_LOCAL_ORG}' organization`]);
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
it("says nothing when the org is already present", async () => {
|
|
144
|
-
const said: string[] = [];
|
|
145
|
-
await bootstrapLocalBackend({
|
|
146
|
-
client,
|
|
147
|
-
say: (line) => said.push(line),
|
|
148
|
-
bootstrap: async () => "present",
|
|
149
|
-
});
|
|
150
|
-
expect(said).toEqual([]);
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
it("contains a failure in one warning naming the retry", async () => {
|
|
154
|
-
const said: string[] = [];
|
|
155
|
-
await bootstrapLocalBackend({
|
|
156
|
-
client,
|
|
157
|
-
say: (line) => said.push(line),
|
|
158
|
-
bootstrap: async () => {
|
|
159
|
-
throw new Error("backend unreachable");
|
|
160
|
-
},
|
|
161
|
-
});
|
|
162
|
-
expect(said).toEqual([
|
|
163
|
-
"Warning: failed to bootstrap the local backend. Run 'stigmer up' again to retry.",
|
|
164
|
-
]);
|
|
165
|
-
});
|
|
166
|
-
});
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import { RUNNER_READY_MARKER, RUNNER_TASK_QUEUE } from "../constants.js";
|
|
4
|
-
import type { DaemonConfig } from "./env.js";
|
|
5
|
-
import { buildComponents, buildRunnerEnv, buildServerEnv } from "./components.js";
|
|
6
|
-
|
|
7
|
-
const config: DaemonConfig = {
|
|
8
|
-
dataDir: "/home/u/.stigmer/data",
|
|
9
|
-
logDir: "/home/u/.stigmer/data/logs",
|
|
10
|
-
temporalManaged: true,
|
|
11
|
-
temporalAddress: "127.0.0.1:7233",
|
|
12
|
-
serverOnly: false,
|
|
13
|
-
noWeb: false,
|
|
14
|
-
server: { nodeBin: "/bin/node", entryPath: "/repo/server/dist/main.js", appDir: "/repo/server" },
|
|
15
|
-
runner: { nodeBin: "/bin/node", entryPath: "/repo/runner/dist/main.js", appDir: "/repo/runner" },
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
describe("buildServerEnv", () => {
|
|
19
|
-
it("pins ports, queues, and db/storage paths under ~/.stigmer", () => {
|
|
20
|
-
const env = buildServerEnv(config, {});
|
|
21
|
-
expect(env.GRPC_PORT).toBe("7234");
|
|
22
|
-
expect(env.TEMPORAL_HOST_PORT).toBe("127.0.0.1:7233");
|
|
23
|
-
expect(env.TEMPORAL_NAMESPACE).toBe("default");
|
|
24
|
-
expect(env.TEMPORAL_AGENT_EXECUTION_RUNNER_TASK_QUEUE).toBe(RUNNER_TASK_QUEUE);
|
|
25
|
-
expect(env.TEMPORAL_WORKFLOW_EXECUTION_RUNNER_TASK_QUEUE).toBe(RUNNER_TASK_QUEUE);
|
|
26
|
-
expect(env.DB_PATH).toBe("/home/u/.stigmer/stigmer.db");
|
|
27
|
-
expect(env.STORAGE_PATH).toBe("/home/u/.stigmer/storage");
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it("forwards the operator identity only when set, resolved value winning over the base env (oss#796)", () => {
|
|
31
|
-
const bare = buildServerEnv(config, {});
|
|
32
|
-
expect(bare.STIGMER_OPERATOR_EMAIL).toBeUndefined();
|
|
33
|
-
expect(bare.STIGMER_OPERATOR_NAME).toBeUndefined();
|
|
34
|
-
|
|
35
|
-
// Contract value authoritative over a stale inherited export — the
|
|
36
|
-
// ANTHROPIC_API_KEY precedent in buildRunnerEnv.
|
|
37
|
-
const env = buildServerEnv(
|
|
38
|
-
{ ...config, operatorEmail: "ada@example.com", operatorName: "Ada" },
|
|
39
|
-
{ STIGMER_OPERATOR_EMAIL: "stale@example.com" },
|
|
40
|
-
);
|
|
41
|
-
expect(env.STIGMER_OPERATOR_EMAIL).toBe("ada@example.com");
|
|
42
|
-
expect(env.STIGMER_OPERATOR_NAME).toBe("Ada");
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it("does not deliver the operator identity to the runner — it resolves identity from session data", () => {
|
|
46
|
-
const env = buildRunnerEnv({ ...config, operatorEmail: "ada@example.com" }, {});
|
|
47
|
-
expect(env.STIGMER_OPERATOR_EMAIL).toBeUndefined();
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
describe("buildRunnerEnv", () => {
|
|
52
|
-
it("configures static mode with the workspace and pinned queue", () => {
|
|
53
|
-
const env = buildRunnerEnv(config, {});
|
|
54
|
-
expect(env.MODE).toBe("local");
|
|
55
|
-
expect(env.STIGMER_RUNNER_MODE).toBeUndefined(); // static mode
|
|
56
|
-
expect(env.STIGMER_BACKEND_ENDPOINT).toBe("http://localhost:7234");
|
|
57
|
-
expect(env.TEMPORAL_SERVICE_ADDRESS).toBe("127.0.0.1:7233");
|
|
58
|
-
expect(env.TEMPORAL_NAMESPACE).toBe("default");
|
|
59
|
-
expect(env.WORKSPACE_ROOT_DIR).toBe("/home/u/.stigmer/data/workspace");
|
|
60
|
-
expect(env.STIGMER_TASK_QUEUE).toBe(RUNNER_TASK_QUEUE);
|
|
61
|
-
expect(env.LOG_LEVEL).toBe("info");
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it("forwards CURSOR_API_KEY and activity routing only when set", () => {
|
|
65
|
-
expect(buildRunnerEnv(config, {}).CURSOR_API_KEY).toBeUndefined();
|
|
66
|
-
const withKey = buildRunnerEnv({ ...config, cursorApiKey: "ck", activityRouting: "session" }, {});
|
|
67
|
-
expect(withKey.CURSOR_API_KEY).toBe("ck");
|
|
68
|
-
expect(withKey.STIGMER_ACTIVITY_ROUTING).toBe("session");
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it("forwards the Anthropic key only when set, resolved value winning over the base env", () => {
|
|
72
|
-
const bare = buildRunnerEnv(config, {});
|
|
73
|
-
expect(bare.ANTHROPIC_API_KEY).toBeUndefined();
|
|
74
|
-
|
|
75
|
-
// The contract value is authoritative: the launcher already applied the
|
|
76
|
-
// env > config precedence, so whatever sits in the child's base env must
|
|
77
|
-
// not override the resolved key.
|
|
78
|
-
const env = buildRunnerEnv(
|
|
79
|
-
{ ...config, anthropicApiKey: "sk-ant-resolved" },
|
|
80
|
-
{ ANTHROPIC_API_KEY: "sk-ant-other" },
|
|
81
|
-
);
|
|
82
|
-
expect(env.ANTHROPIC_API_KEY).toBe("sk-ant-resolved");
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
// Anthropic is the only key with a contract slot; other provider keys (for
|
|
86
|
-
// advanced per-agent overrides) flow through shell-env inheritance untouched.
|
|
87
|
-
it("passes other shell-exported provider keys through via the base env spread", () => {
|
|
88
|
-
const env = buildRunnerEnv(config, { OPENAI_API_KEY: "sk-oai-shell" });
|
|
89
|
-
expect(env.OPENAI_API_KEY).toBe("sk-oai-shell");
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
// The regression guard for the queue bug: the server dispatches to, and the
|
|
93
|
-
// runner polls, the exact same queue.
|
|
94
|
-
it("pins the runner's poll queue to the server's dispatch queue", () => {
|
|
95
|
-
const serverEnv = buildServerEnv(config, {});
|
|
96
|
-
const runnerEnv = buildRunnerEnv(config, {});
|
|
97
|
-
expect(runnerEnv.STIGMER_TASK_QUEUE).toBe(serverEnv.TEMPORAL_AGENT_EXECUTION_RUNNER_TASK_QUEUE);
|
|
98
|
-
expect(runnerEnv.STIGMER_TASK_QUEUE).toBe(serverEnv.TEMPORAL_WORKFLOW_EXECUTION_RUNNER_TASK_QUEUE);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
// #285 regression guard: the server's artifact base and the runner's artifact
|
|
102
|
-
// path must be the SAME directory, or a storage-key attachment the server
|
|
103
|
-
// wrote fails to resolve when the runner reads it back. Both must be defined
|
|
104
|
-
// (a naive `runnerEnv.X === serverEnv.Y` would pass vacuously on
|
|
105
|
-
// undefined === undefined) and equal to the ~/.stigmer/data/artifacts root.
|
|
106
|
-
it("pins the runner's artifact path to the server's artifact base", () => {
|
|
107
|
-
const serverEnv = buildServerEnv(config, {});
|
|
108
|
-
const runnerEnv = buildRunnerEnv(config, {});
|
|
109
|
-
const expected = join(config.dataDir, "artifacts");
|
|
110
|
-
|
|
111
|
-
expect(serverEnv.ARTIFACT_LOCAL_BASE_PATH).toBe(expected);
|
|
112
|
-
expect(runnerEnv.LOCAL_ARTIFACT_PATH).toBe(expected);
|
|
113
|
-
expect(runnerEnv.LOCAL_ARTIFACT_PATH).toBe(serverEnv.ARTIFACT_LOCAL_BASE_PATH);
|
|
114
|
-
expect(runnerEnv.ARTIFACT_STORAGE_TYPE).toBe("local");
|
|
115
|
-
// Serve URL pinned to the server's artifact HTTP port (GRPC_PORT + 1).
|
|
116
|
-
expect(runnerEnv.LOCAL_ARTIFACT_SERVE_URL).toBe("http://localhost:7235");
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
describe("buildComponents", () => {
|
|
121
|
-
it("orders server (critical, gated) before runner (marker, not critical)", () => {
|
|
122
|
-
const components = buildComponents(config, {});
|
|
123
|
-
expect(components.map((c) => c.name)).toEqual(["stigmer-server", "runner"]);
|
|
124
|
-
|
|
125
|
-
const [server, runner] = components;
|
|
126
|
-
expect(server.critical).toBe(true);
|
|
127
|
-
expect(server.gate).toBeDefined();
|
|
128
|
-
expect(server.resolve().readinessMarker).toBeUndefined();
|
|
129
|
-
|
|
130
|
-
expect(runner.critical).toBe(false);
|
|
131
|
-
expect(runner.gate).toBeUndefined();
|
|
132
|
-
expect(runner.resolve().readinessMarker).toBe(RUNNER_READY_MARKER);
|
|
133
|
-
expect(runner.resolve().args).toEqual(["/repo/runner/dist/main.js"]);
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
// The TS server child is `node <entry>` — the runner's launch shape.
|
|
137
|
-
it("spawns the node-shape server as node + entry", () => {
|
|
138
|
-
const [server] = buildComponents(config, {});
|
|
139
|
-
const spawn = server.resolve();
|
|
140
|
-
expect(spawn.command).toBe("/bin/node");
|
|
141
|
-
expect(spawn.args).toEqual(["/repo/server/dist/main.js"]);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
it("omits the runner in server-only mode", () => {
|
|
145
|
-
const components = buildComponents({ ...config, serverOnly: true }, {});
|
|
146
|
-
expect(components.map((c) => c.name)).toEqual(["stigmer-server"]);
|
|
147
|
-
});
|
|
148
|
-
});
|