@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,216 +0,0 @@
|
|
|
1
|
-
import { mkdtempSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { createServer, type Server } from "node:net";
|
|
3
|
-
import { tmpdir } from "node:os";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
6
|
-
import type { Logger } from "../../logger.js";
|
|
7
|
-
import { RUNNER_READY_MARKER, SERVER_PORT } from "../constants.js";
|
|
8
|
-
import { isProcessAlive } from "../state/proc.js";
|
|
9
|
-
import { loadHealthState, type HealthState } from "../state/health-state.js";
|
|
10
|
-
import { readPidFile } from "../state/pidfile.js";
|
|
11
|
-
import type { DaemonConfig } from "./env.js";
|
|
12
|
-
import { NodeProcessHost } from "./host.js";
|
|
13
|
-
import { runInternalDaemon, type TemporalControl } from "./process.js";
|
|
14
|
-
import type { ChildHandle, Clock, ExitInfo, ProcessHost, SpawnRequest } from "./types.js";
|
|
15
|
-
|
|
16
|
-
const silent: Logger = { debug: vi.fn(), info: vi.fn(), warn: vi.fn(), error: vi.fn() };
|
|
17
|
-
|
|
18
|
-
function tempDir(): string {
|
|
19
|
-
return mkdtempSync(join(tmpdir(), "stigmer-int-"));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// ---- Integration 1: the real ProcessHost spawns, tees logs, detects the
|
|
23
|
-
// readiness marker, and stops a real child. ----
|
|
24
|
-
describe("NodeProcessHost (real spawn)", () => {
|
|
25
|
-
it("pipes logs, detects the readiness marker, and stops the child", async () => {
|
|
26
|
-
const dir = tempDir();
|
|
27
|
-
const script = join(dir, "fake-child.cjs");
|
|
28
|
-
writeFileSync(
|
|
29
|
-
script,
|
|
30
|
-
`process.stdout.write(${JSON.stringify(`${RUNNER_READY_MARKER}\n`)});\n` +
|
|
31
|
-
`process.on("SIGTERM", () => process.exit(0));\n` +
|
|
32
|
-
`setInterval(() => {}, 1000);\n`,
|
|
33
|
-
);
|
|
34
|
-
const logFile = join(dir, "child.log");
|
|
35
|
-
|
|
36
|
-
const host = new NodeProcessHost();
|
|
37
|
-
const request: SpawnRequest = {
|
|
38
|
-
name: "runner",
|
|
39
|
-
command: process.execPath,
|
|
40
|
-
args: [script],
|
|
41
|
-
env: process.env,
|
|
42
|
-
logFile,
|
|
43
|
-
readinessMarker: RUNNER_READY_MARKER,
|
|
44
|
-
};
|
|
45
|
-
const handle = host.spawn(request);
|
|
46
|
-
|
|
47
|
-
const ready = new Promise<void>((resolve) => handle.onReady(resolve));
|
|
48
|
-
const exited = new Promise<void>((resolve) => handle.onExit(() => resolve()));
|
|
49
|
-
|
|
50
|
-
await ready;
|
|
51
|
-
expect(isProcessAlive(handle.pid)).toBe(true);
|
|
52
|
-
// The readiness marker is detected on the stdout stream, but the tee to the
|
|
53
|
-
// log file is a buffered write that may not have flushed to disk yet — poll
|
|
54
|
-
// the file rather than reading it once to avoid a race.
|
|
55
|
-
await expect.poll(() => readFileSync(logFile, "utf8")).toContain(RUNNER_READY_MARKER);
|
|
56
|
-
|
|
57
|
-
handle.kill("SIGTERM");
|
|
58
|
-
await exited;
|
|
59
|
-
expect(handle.hasExited()).toBe(true);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
// The foreground launcher's window into the children: every complete line,
|
|
63
|
-
// tagged with the component, in order within a stream; a partial trailing
|
|
64
|
-
// line is delivered at exit; the log file still receives the same bytes.
|
|
65
|
-
it("mirrors complete lines tagged with the component, flushing the tail at exit", async () => {
|
|
66
|
-
const dir = tempDir();
|
|
67
|
-
const script = join(dir, "chatty-child.cjs");
|
|
68
|
-
writeFileSync(
|
|
69
|
-
script,
|
|
70
|
-
// Two writes that split a line across chunks, one stderr line, and a
|
|
71
|
-
// final line with no newline.
|
|
72
|
-
`process.stdout.write("first li");\n` +
|
|
73
|
-
`process.stdout.write("ne\\nsecond line\\n");\n` +
|
|
74
|
-
`process.stderr.write("a warning\\n");\n` +
|
|
75
|
-
`process.stdout.write("tail without newline");\n` +
|
|
76
|
-
`setTimeout(() => process.exit(0), 50);\n`,
|
|
77
|
-
);
|
|
78
|
-
const logFile = join(dir, "child.log");
|
|
79
|
-
const mirrored: string[] = [];
|
|
80
|
-
const host = new NodeProcessHost({ mirror: (component, line) => mirrored.push(`${component}|${line}`) });
|
|
81
|
-
|
|
82
|
-
const handle = host.spawn({ name: "stigmer-server", command: process.execPath, args: [script], env: process.env, logFile });
|
|
83
|
-
await new Promise<void>((resolve) => handle.onExit(() => resolve()));
|
|
84
|
-
|
|
85
|
-
expect(mirrored.filter((l) => l !== "stigmer-server|a warning")).toEqual([
|
|
86
|
-
"stigmer-server|first line",
|
|
87
|
-
"stigmer-server|second line",
|
|
88
|
-
"stigmer-server|tail without newline",
|
|
89
|
-
]);
|
|
90
|
-
expect(mirrored).toContain("stigmer-server|a warning");
|
|
91
|
-
await expect.poll(() => readFileSync(logFile, "utf8")).toContain("first line\nsecond line\n");
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
// ---- Integration 2: the full daemon body, with a fake process host + fake
|
|
96
|
-
// Temporal, but a real TCP listener satisfying the server's gRPC gate. ----
|
|
97
|
-
|
|
98
|
-
// Minimal fake host whose children exit on SIGTERM.
|
|
99
|
-
class FakeHost implements ProcessHost {
|
|
100
|
-
private nextPid = 2000;
|
|
101
|
-
readonly killed: NodeJS.Signals[] = [];
|
|
102
|
-
spawn(_request: SpawnRequest): ChildHandle {
|
|
103
|
-
let exited = false;
|
|
104
|
-
let exitCb: ((info: ExitInfo) => void) | null = null;
|
|
105
|
-
const pid = this.nextPid++;
|
|
106
|
-
return {
|
|
107
|
-
pid,
|
|
108
|
-
hasExited: () => exited,
|
|
109
|
-
onExit: (cb) => {
|
|
110
|
-
exitCb = cb;
|
|
111
|
-
},
|
|
112
|
-
onReady: () => {},
|
|
113
|
-
kill: (signal) => {
|
|
114
|
-
this.killed.push(signal);
|
|
115
|
-
if (!exited) {
|
|
116
|
-
exited = true;
|
|
117
|
-
exitCb?.({ code: null, signal });
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const fastClock: Clock = { now: () => Date.now(), sleep: () => Promise.resolve() };
|
|
125
|
-
|
|
126
|
-
function fakeTemporal(): TemporalControl {
|
|
127
|
-
return {
|
|
128
|
-
address: "127.0.0.1:7233",
|
|
129
|
-
start: vi.fn(async () => {}),
|
|
130
|
-
stop: vi.fn(async () => {}),
|
|
131
|
-
isRunning: vi.fn(async () => true),
|
|
132
|
-
getPid: () => 4242,
|
|
133
|
-
startSupervisor: vi.fn(),
|
|
134
|
-
stopSupervisor: vi.fn(),
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function listenOn(port: number): Promise<Server> {
|
|
139
|
-
return new Promise((resolve, reject) => {
|
|
140
|
-
const server = createServer();
|
|
141
|
-
server.once("error", reject);
|
|
142
|
-
server.listen(port, "127.0.0.1", () => resolve(server));
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
let gateServer: Server | null = null;
|
|
147
|
-
afterEach(async () => {
|
|
148
|
-
if (gateServer !== null) {
|
|
149
|
-
await new Promise<void>((resolve) => gateServer?.close(() => resolve()));
|
|
150
|
-
gateServer = null;
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
describe("runInternalDaemon (full body with fakes)", () => {
|
|
155
|
-
it("brings the stack up, writes a health snapshot, and tears down on shutdown", async () => {
|
|
156
|
-
const data = join(tempDir(), ".stigmer", "data");
|
|
157
|
-
const config: DaemonConfig = {
|
|
158
|
-
dataDir: data,
|
|
159
|
-
logDir: join(data, "logs"),
|
|
160
|
-
temporalManaged: true,
|
|
161
|
-
temporalAddress: "127.0.0.1:7233",
|
|
162
|
-
serverOnly: false,
|
|
163
|
-
noWeb: true,
|
|
164
|
-
server: { nodeBin: "node-cmd", entryPath: join(data, "server-entry.js"), appDir: data },
|
|
165
|
-
runner: { nodeBin: "node-cmd", entryPath: join(data, "entry.js"), appDir: data },
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
// Satisfy the server's gRPC readiness gate with a real listener.
|
|
169
|
-
try {
|
|
170
|
-
gateServer = await listenOn(SERVER_PORT);
|
|
171
|
-
} catch {
|
|
172
|
-
// Port busy (a real daemon?) — the gate will still connect to whatever is
|
|
173
|
-
// listening, which is all this test needs.
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
const host = new FakeHost();
|
|
177
|
-
const temporal = fakeTemporal();
|
|
178
|
-
const healthPath = join(data, "health-state.json");
|
|
179
|
-
|
|
180
|
-
let snapshot: HealthState | null = null;
|
|
181
|
-
let resolveShutdown!: () => void;
|
|
182
|
-
const shutdown = new Promise<void>((resolve) => {
|
|
183
|
-
resolveShutdown = resolve;
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
const code = await runInternalDaemon({
|
|
187
|
-
config,
|
|
188
|
-
host,
|
|
189
|
-
clock: fastClock,
|
|
190
|
-
temporal,
|
|
191
|
-
log: silent,
|
|
192
|
-
waitForShutdown: () => shutdown,
|
|
193
|
-
onStarted: () => {
|
|
194
|
-
snapshot = loadHealthState(healthPath);
|
|
195
|
-
resolveShutdown();
|
|
196
|
-
},
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
expect(code).toBe(0);
|
|
200
|
-
expect(temporal.start).toHaveBeenCalledOnce();
|
|
201
|
-
expect(temporal.stop).toHaveBeenCalledOnce();
|
|
202
|
-
|
|
203
|
-
// The snapshot captured while up shows the whole stack.
|
|
204
|
-
expect(snapshot).not.toBeNull();
|
|
205
|
-
const components = snapshot as unknown as HealthState;
|
|
206
|
-
expect(components.daemon_pid).toBe(process.pid);
|
|
207
|
-
expect(Object.keys(components.components).sort()).toEqual(["runner", "stigmer-server", "temporal", "web-console"]);
|
|
208
|
-
expect(components.components["stigmer-server"].state).toBe("running");
|
|
209
|
-
expect(components.components.runner.state).toBe("running");
|
|
210
|
-
|
|
211
|
-
// Children were signaled, and the daemon cleaned up after shutdown.
|
|
212
|
-
expect(host.killed).toContain("SIGTERM");
|
|
213
|
-
expect(readPidFile(join(data, "daemon.pid"))).toBeNull();
|
|
214
|
-
expect(loadHealthState(healthPath)).toBeNull();
|
|
215
|
-
});
|
|
216
|
-
});
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { buildDaemonEnv, type DaemonEnvInputs, readDaemonConfig } from "./env.js";
|
|
3
|
-
|
|
4
|
-
const baseInputs: DaemonEnvInputs = {
|
|
5
|
-
dataDir: "/home/u/.stigmer/data",
|
|
6
|
-
logDir: "/home/u/.stigmer/data/logs",
|
|
7
|
-
temporalManaged: true,
|
|
8
|
-
temporalAddress: "127.0.0.1:7233",
|
|
9
|
-
serverOnly: false,
|
|
10
|
-
noWeb: false,
|
|
11
|
-
server: {
|
|
12
|
-
nodeBin: "/usr/bin/node",
|
|
13
|
-
entryPath: "/repo/server/dist/main.js",
|
|
14
|
-
appDir: "/repo/server",
|
|
15
|
-
},
|
|
16
|
-
runner: { nodeBin: "/usr/bin/node", entryPath: "/repo/runner/dist/main.js", appDir: "/repo/runner" },
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
describe("buildDaemonEnv + readDaemonConfig", () => {
|
|
20
|
-
it("round-trips the full launcher -> daemon contract", () => {
|
|
21
|
-
const env = buildDaemonEnv(baseInputs, {});
|
|
22
|
-
const config = readDaemonConfig(env);
|
|
23
|
-
expect(config).toEqual({
|
|
24
|
-
dataDir: "/home/u/.stigmer/data",
|
|
25
|
-
logDir: "/home/u/.stigmer/data/logs",
|
|
26
|
-
temporalManaged: true,
|
|
27
|
-
temporalAddress: "127.0.0.1:7233",
|
|
28
|
-
serverOnly: false,
|
|
29
|
-
noWeb: false,
|
|
30
|
-
server: {
|
|
31
|
-
nodeBin: "/usr/bin/node",
|
|
32
|
-
entryPath: "/repo/server/dist/main.js",
|
|
33
|
-
appDir: "/repo/server",
|
|
34
|
-
},
|
|
35
|
-
runner: { nodeBin: "/usr/bin/node", entryPath: "/repo/runner/dist/main.js", appDir: "/repo/runner" },
|
|
36
|
-
cursorApiKey: undefined,
|
|
37
|
-
anthropicApiKey: undefined,
|
|
38
|
-
activityRouting: undefined,
|
|
39
|
-
operatorEmail: undefined,
|
|
40
|
-
operatorName: undefined,
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it("omits runner coordinates in server-only mode", () => {
|
|
45
|
-
const env = buildDaemonEnv({ ...baseInputs, serverOnly: true }, {});
|
|
46
|
-
const config = readDaemonConfig(env);
|
|
47
|
-
expect(config.serverOnly).toBe(true);
|
|
48
|
-
expect(config.runner).toBeUndefined();
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it("passes CURSOR_API_KEY and activity routing through from the base env", () => {
|
|
52
|
-
const env = buildDaemonEnv(baseInputs, { CURSOR_API_KEY: "ck", STIGMER_ACTIVITY_ROUTING: "session" });
|
|
53
|
-
const config = readDaemonConfig(env);
|
|
54
|
-
expect(config.cursorApiKey).toBe("ck");
|
|
55
|
-
expect(config.activityRouting).toBe("session");
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
// The config-file-only delivery path: a key from `stigmer setup` is not in the
|
|
59
|
-
// shell env, so the launcher must write it into the contract explicitly.
|
|
60
|
-
// Anthropic is the only provider with this path — the local stack executes
|
|
61
|
-
// on Anthropic only.
|
|
62
|
-
it("delivers a launcher-resolved Anthropic key with no help from the base env", () => {
|
|
63
|
-
const env = buildDaemonEnv({ ...baseInputs, anthropicApiKey: "sk-ant-cfg" }, {});
|
|
64
|
-
const config = readDaemonConfig(env);
|
|
65
|
-
expect(config.anthropicApiKey).toBe("sk-ant-cfg");
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it("passes a shell-exported Anthropic key through from the base env", () => {
|
|
69
|
-
const env = buildDaemonEnv(baseInputs, { ANTHROPIC_API_KEY: "sk-ant-env" });
|
|
70
|
-
const config = readDaemonConfig(env);
|
|
71
|
-
expect(config.anthropicApiKey).toBe("sk-ant-env");
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
// The operator identity rides the same config-file-only delivery path as the
|
|
75
|
-
// Anthropic key (oss#796): persisted by `stigmer setup`, absent from the
|
|
76
|
-
// shell, written into the contract explicitly by the launcher.
|
|
77
|
-
it("delivers a launcher-resolved operator identity with no help from the base env", () => {
|
|
78
|
-
const env = buildDaemonEnv(
|
|
79
|
-
{ ...baseInputs, operatorEmail: "ada@example.com", operatorName: "Ada Lovelace" },
|
|
80
|
-
{},
|
|
81
|
-
);
|
|
82
|
-
const config = readDaemonConfig(env);
|
|
83
|
-
expect(config.operatorEmail).toBe("ada@example.com");
|
|
84
|
-
expect(config.operatorName).toBe("Ada Lovelace");
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it("passes a shell-exported operator identity through from the base env", () => {
|
|
88
|
-
const env = buildDaemonEnv(baseInputs, { STIGMER_OPERATOR_EMAIL: "env@example.com" });
|
|
89
|
-
expect(readDaemonConfig(env).operatorEmail).toBe("env@example.com");
|
|
90
|
-
expect(readDaemonConfig(env).operatorName).toBeUndefined();
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
// Other provider keys have no contract slot; they reach the runner solely via
|
|
94
|
-
// shell-env inheritance (the child env spreads the base env).
|
|
95
|
-
it("leaves shell-exported non-Anthropic keys in the env without parsing them", () => {
|
|
96
|
-
const env = buildDaemonEnv(baseInputs, { OPENAI_API_KEY: "sk-oai-env" });
|
|
97
|
-
expect(env.OPENAI_API_KEY).toBe("sk-oai-env");
|
|
98
|
-
expect(readDaemonConfig(env)).not.toHaveProperty("openaiApiKey");
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
it("requires the data dir and the full server launch triple", () => {
|
|
102
|
-
expect(() => readDaemonConfig({})).toThrow(/STIGMER_DATA_DIR/);
|
|
103
|
-
expect(() => readDaemonConfig({ STIGMER_DATA_DIR: "/x" })).toThrow(/STIGMER_SERVER_NODE_BIN/);
|
|
104
|
-
expect(() => readDaemonConfig({ STIGMER_DATA_DIR: "/x", STIGMER_SERVER_NODE_BIN: "/usr/bin/node" })).toThrow(
|
|
105
|
-
/STIGMER_SERVER_ENTRY/,
|
|
106
|
-
);
|
|
107
|
-
});
|
|
108
|
-
});
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
// Pins the foreground launcher's contract with the daemon body: the config it
|
|
2
|
-
// hands over is the detached shape's, encoded through the same env contract;
|
|
3
|
-
// the children inherit that built environment; the post-readiness work (the
|
|
4
|
-
// bootstrap, the startup record, the caller's onReady) runs from onStarted;
|
|
5
|
-
// the daemon's exit code is the launcher's. Resolution is driven through the
|
|
6
|
-
// same overrides a container sets (STIGMER_SERVER_DIR, STIGMER_RUNNER_DIR,
|
|
7
|
-
// STIGMER_TEMPORAL_BIN), so nothing is downloaded or installed.
|
|
8
|
-
|
|
9
|
-
import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
|
|
10
|
-
import { tmpdir } from "node:os";
|
|
11
|
-
import { join } from "node:path";
|
|
12
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
13
|
-
import { SERVER_PORT } from "../constants.js";
|
|
14
|
-
import { tcpConnects } from "../net/tcp.js";
|
|
15
|
-
import { loadStartupConfig } from "../state/startup-config.js";
|
|
16
|
-
import { DaemonEnvVar } from "./env.js";
|
|
17
|
-
import { upForeground } from "./launch.js";
|
|
18
|
-
import type { InternalDaemonDeps } from "./process.js";
|
|
19
|
-
|
|
20
|
-
// The launcher refuses to start beside a stack already serving on the server
|
|
21
|
-
// port — including a developer's own `stigmer up`. Report SKIPPED rather than
|
|
22
|
-
// a false failure in that case.
|
|
23
|
-
const serverPortBusy = await tcpConnects(SERVER_PORT, "127.0.0.1", 300);
|
|
24
|
-
|
|
25
|
-
function tempDir(prefix: string): string {
|
|
26
|
-
return mkdtempSync(join(tmpdir(), prefix));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// A built package in the shape the resolvers accept: package.json + dist/main.js.
|
|
30
|
-
function builtPackage(prefix: string): string {
|
|
31
|
-
const dir = tempDir(prefix);
|
|
32
|
-
writeFileSync(join(dir, "package.json"), "{}");
|
|
33
|
-
mkdirSync(join(dir, "dist"));
|
|
34
|
-
writeFileSync(join(dir, "dist", "main.js"), "//");
|
|
35
|
-
return dir;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const TOUCHED = ["STIGMER_SERVER_DIR", "STIGMER_RUNNER_DIR", "STIGMER_TEMPORAL_BIN", "STIGMER_NODE_BIN", "ANTHROPIC_API_KEY"] as const;
|
|
39
|
-
let saved: Record<string, string | undefined>;
|
|
40
|
-
|
|
41
|
-
beforeEach(() => {
|
|
42
|
-
saved = {};
|
|
43
|
-
for (const key of TOUCHED) {
|
|
44
|
-
saved[key] = process.env[key];
|
|
45
|
-
delete process.env[key];
|
|
46
|
-
}
|
|
47
|
-
process.env.STIGMER_SERVER_DIR = builtPackage("stigmer-fg-server-");
|
|
48
|
-
process.env.STIGMER_RUNNER_DIR = builtPackage("stigmer-fg-runner-");
|
|
49
|
-
const temporalBin = join(tempDir("stigmer-fg-temporal-"), "temporal");
|
|
50
|
-
writeFileSync(temporalBin, "#!/bin/sh\n");
|
|
51
|
-
process.env.STIGMER_TEMPORAL_BIN = temporalBin;
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
afterEach(() => {
|
|
55
|
-
for (const key of TOUCHED) {
|
|
56
|
-
if (saved[key] === undefined) delete process.env[key];
|
|
57
|
-
else process.env[key] = saved[key];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
describe.skipIf(serverPortBusy)("upForeground", () => {
|
|
62
|
-
it("runs the daemon body in-process with the detached shape's config and env, bootstrapping from onStarted", async () => {
|
|
63
|
-
const home = tempDir("stigmer-fg-home-");
|
|
64
|
-
process.env.ANTHROPIC_API_KEY = "sk-test";
|
|
65
|
-
const order: string[] = [];
|
|
66
|
-
let captured: InternalDaemonDeps | null = null;
|
|
67
|
-
|
|
68
|
-
const code = await upForeground({ noWeb: true }, home, {
|
|
69
|
-
runDaemon: async (deps) => {
|
|
70
|
-
captured = deps;
|
|
71
|
-
order.push("daemon:started");
|
|
72
|
-
await deps.onStarted?.();
|
|
73
|
-
order.push("daemon:waiting");
|
|
74
|
-
return 0;
|
|
75
|
-
},
|
|
76
|
-
bootstrap: async () => {
|
|
77
|
-
order.push("bootstrap");
|
|
78
|
-
},
|
|
79
|
-
onReady: () => {
|
|
80
|
-
order.push("onReady");
|
|
81
|
-
},
|
|
82
|
-
waitForShutdown: () => Promise.resolve(),
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
expect(code).toBe(0);
|
|
86
|
-
expect(order).toEqual(["daemon:started", "bootstrap", "onReady", "daemon:waiting"]);
|
|
87
|
-
|
|
88
|
-
const deps = captured as unknown as InternalDaemonDeps;
|
|
89
|
-
// The config is the env contract read back — the detached daemon's view.
|
|
90
|
-
expect(deps.config?.dataDir).toBe(join(home, ".stigmer", "data"));
|
|
91
|
-
expect(deps.config?.temporalManaged).toBe(true);
|
|
92
|
-
expect(deps.config?.noWeb).toBe(true);
|
|
93
|
-
expect(deps.config?.server.entryPath).toBe(join(process.env.STIGMER_SERVER_DIR!, "dist", "main.js"));
|
|
94
|
-
expect(deps.config?.runner?.entryPath).toBe(join(process.env.STIGMER_RUNNER_DIR!, "dist", "main.js"));
|
|
95
|
-
expect(deps.config?.anthropicApiKey).toBe("sk-test");
|
|
96
|
-
// The children inherit the built environment, contract variables included.
|
|
97
|
-
expect(deps.env?.[DaemonEnvVar.DataDir]).toBe(join(home, ".stigmer", "data"));
|
|
98
|
-
expect(deps.env?.[DaemonEnvVar.ServerEntry]).toBe(deps.config?.server.entryPath);
|
|
99
|
-
// The startup record names this process as the daemon.
|
|
100
|
-
expect(loadStartupConfig(join(home, ".stigmer", "data"))?.stigmer_server_pid).toBe(process.pid);
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
it("propagates the daemon's failure exit code without bootstrapping", async () => {
|
|
104
|
-
const home = tempDir("stigmer-fg-home-");
|
|
105
|
-
const bootstrap = vi.fn(async () => {});
|
|
106
|
-
|
|
107
|
-
const code = await upForeground({}, home, {
|
|
108
|
-
// A critical component failed to start: the body returns 1 before onStarted.
|
|
109
|
-
runDaemon: async () => 1,
|
|
110
|
-
bootstrap,
|
|
111
|
-
waitForShutdown: () => Promise.resolve(),
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
expect(code).toBe(1);
|
|
115
|
-
expect(bootstrap).not.toHaveBeenCalled();
|
|
116
|
-
expect(loadStartupConfig(join(home, ".stigmer", "data"))).toBeNull();
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
it("omits the runner from the contract in server-only mode", async () => {
|
|
120
|
-
const home = tempDir("stigmer-fg-home-");
|
|
121
|
-
let captured: InternalDaemonDeps | null = null;
|
|
122
|
-
|
|
123
|
-
await upForeground({ serverOnly: true }, home, {
|
|
124
|
-
runDaemon: async (deps) => {
|
|
125
|
-
captured = deps;
|
|
126
|
-
return 0;
|
|
127
|
-
},
|
|
128
|
-
bootstrap: async () => {},
|
|
129
|
-
waitForShutdown: () => Promise.resolve(),
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
const deps = captured as unknown as InternalDaemonDeps;
|
|
133
|
-
expect(deps.config?.serverOnly).toBe(true);
|
|
134
|
-
expect(deps.config?.runner).toBeUndefined();
|
|
135
|
-
});
|
|
136
|
-
});
|