@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,260 +0,0 @@
|
|
|
1
|
-
import { mkdtempSync } from "node:fs";
|
|
2
|
-
import { tmpdir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
-
import type { Logger } from "../../logger.js";
|
|
6
|
-
import type { HealthState } from "../state/health-state.js";
|
|
7
|
-
import { readPidFile } from "../state/pidfile.js";
|
|
8
|
-
import { MAX_RESTARTS, ProcessSupervisor } from "./supervisor.js";
|
|
9
|
-
import type { ChildHandle, Clock, ComponentSpec, ExitInfo, ProcessHost, ReadinessGate, SpawnRequest } from "./types.js";
|
|
10
|
-
|
|
11
|
-
const silent: Logger = { debug: vi.fn(), info: vi.fn(), warn: vi.fn(), error: vi.fn() };
|
|
12
|
-
|
|
13
|
-
// A controllable fake child: the test triggers its exit/readiness and inspects
|
|
14
|
-
// the signals it received.
|
|
15
|
-
interface FakeChild {
|
|
16
|
-
request: SpawnRequest;
|
|
17
|
-
handle: ChildHandle;
|
|
18
|
-
signals: NodeJS.Signals[];
|
|
19
|
-
termExits: boolean;
|
|
20
|
-
triggerExit(info?: ExitInfo): void;
|
|
21
|
-
triggerReady(): void;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
class FakeHost implements ProcessHost {
|
|
25
|
-
readonly children: FakeChild[] = [];
|
|
26
|
-
readonly killOrder: string[] = [];
|
|
27
|
-
private nextPid = 1000;
|
|
28
|
-
|
|
29
|
-
spawn(request: SpawnRequest): ChildHandle {
|
|
30
|
-
let exited = false;
|
|
31
|
-
let exitCb: ((info: ExitInfo) => void) | null = null;
|
|
32
|
-
let readyCb: (() => void) | null = null;
|
|
33
|
-
const signals: NodeJS.Signals[] = [];
|
|
34
|
-
const pid = this.nextPid++;
|
|
35
|
-
const order = this.killOrder;
|
|
36
|
-
|
|
37
|
-
const child: FakeChild = {
|
|
38
|
-
request,
|
|
39
|
-
signals,
|
|
40
|
-
termExits: true,
|
|
41
|
-
triggerExit: (info = { code: 1, signal: null }) => {
|
|
42
|
-
if (!exited) {
|
|
43
|
-
exited = true;
|
|
44
|
-
exitCb?.(info);
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
triggerReady: () => readyCb?.(),
|
|
48
|
-
handle: {
|
|
49
|
-
pid,
|
|
50
|
-
hasExited: () => exited,
|
|
51
|
-
onExit: (cb) => {
|
|
52
|
-
exitCb = cb;
|
|
53
|
-
},
|
|
54
|
-
onReady: (cb) => {
|
|
55
|
-
readyCb = cb;
|
|
56
|
-
},
|
|
57
|
-
kill: (signal) => {
|
|
58
|
-
signals.push(signal);
|
|
59
|
-
order.push(request.command);
|
|
60
|
-
if (signal === "SIGKILL" || (signal === "SIGTERM" && child.termExits)) {
|
|
61
|
-
if (!exited) {
|
|
62
|
-
exited = true;
|
|
63
|
-
exitCb?.({ code: null, signal });
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
this.children.push(child);
|
|
70
|
-
return child.handle;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/** The most-recently-spawned child for a component command. */
|
|
74
|
-
latest(command: string): FakeChild {
|
|
75
|
-
const matches = this.children.filter((c) => c.request.command === command);
|
|
76
|
-
return matches[matches.length - 1];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
countOf(command: string): number {
|
|
80
|
-
return this.children.filter((c) => c.request.command === command).length;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
class FakeClock implements Clock {
|
|
85
|
-
t = 1_000_000;
|
|
86
|
-
now(): number {
|
|
87
|
-
return this.t;
|
|
88
|
-
}
|
|
89
|
-
sleep(): Promise<void> {
|
|
90
|
-
return Promise.resolve();
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const okGate: ReadinessGate = { description: "ok", wait: async () => {} };
|
|
95
|
-
const failGate: ReadinessGate = {
|
|
96
|
-
description: "fail",
|
|
97
|
-
wait: async () => {
|
|
98
|
-
throw new Error("did not become ready");
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
let dir: string;
|
|
103
|
-
beforeEach(() => {
|
|
104
|
-
dir = mkdtempSync(join(tmpdir(), "stigmer-sup-"));
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
function spec(name: string, opts: { critical?: boolean; marker?: string; gate?: ReadinessGate } = {}): ComponentSpec {
|
|
108
|
-
return {
|
|
109
|
-
name,
|
|
110
|
-
pidFile: join(dir, `${name}.pid`),
|
|
111
|
-
critical: opts.critical ?? false,
|
|
112
|
-
resolve: () => ({ name, command: name, args: [], env: {}, logFile: join(dir, `${name}.log`), readinessMarker: opts.marker }),
|
|
113
|
-
gate: opts.gate,
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function emptyHealth(): HealthState {
|
|
118
|
-
return { daemon_pid: 1, started_at: "", components: {} };
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function makeSupervisor(
|
|
122
|
-
specs: ComponentSpec[],
|
|
123
|
-
extras: { probe?: (port: number) => Promise<boolean> } = {},
|
|
124
|
-
): { sup: ProcessSupervisor; host: FakeHost; clock: FakeClock; hs: HealthState } {
|
|
125
|
-
const host = new FakeHost();
|
|
126
|
-
const clock = new FakeClock();
|
|
127
|
-
const hs = emptyHealth();
|
|
128
|
-
const sup = new ProcessSupervisor(specs, { host, clock, healthState: hs, persist: () => {}, log: silent, probe: extras.probe });
|
|
129
|
-
return { sup, host, clock, hs };
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
describe("startAll", () => {
|
|
133
|
-
it("starts components in order, writes PID files, and gates the server", async () => {
|
|
134
|
-
const { sup, host, hs } = makeSupervisor([spec("stigmer-server", { critical: true, gate: okGate }), spec("runner", { marker: "ready" })]);
|
|
135
|
-
const result = await sup.startAll();
|
|
136
|
-
|
|
137
|
-
expect(result.ok).toBe(true);
|
|
138
|
-
expect(hs.components["stigmer-server"].state).toBe("running");
|
|
139
|
-
expect(hs.components.runner.state).toBe("running");
|
|
140
|
-
expect(readPidFile(join(dir, "stigmer-server.pid"))).toBe(host.latest("stigmer-server").handle.pid);
|
|
141
|
-
expect(readPidFile(join(dir, "runner.pid"))).toBe(host.latest("runner").handle.pid);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
it("aborts when a critical component fails its gate", async () => {
|
|
145
|
-
const { sup, hs } = makeSupervisor([spec("stigmer-server", { critical: true, gate: failGate }), spec("runner")]);
|
|
146
|
-
const result = await sup.startAll();
|
|
147
|
-
|
|
148
|
-
expect(result.ok).toBe(false);
|
|
149
|
-
expect(result.failedCritical).toBe("stigmer-server");
|
|
150
|
-
expect(hs.components["stigmer-server"].state).toBe("failed");
|
|
151
|
-
// The runner is registered up front but never started after the abort.
|
|
152
|
-
expect(hs.components.runner.state).toBe("stopped");
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
describe("readiness marker", () => {
|
|
157
|
-
it("flips ready false -> true when the child announces it", async () => {
|
|
158
|
-
const { sup, host, hs } = makeSupervisor([spec("runner", { marker: "ready" })]);
|
|
159
|
-
await sup.startAll();
|
|
160
|
-
expect(hs.components.runner.ready).toBe(false);
|
|
161
|
-
host.latest("runner").triggerReady();
|
|
162
|
-
expect(hs.components.runner.ready).toBe(true);
|
|
163
|
-
});
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
describe("settleCheck", () => {
|
|
167
|
-
it("marks a component that crashed during startup as failed", async () => {
|
|
168
|
-
const { sup, host, hs } = makeSupervisor([spec("runner")]);
|
|
169
|
-
await sup.startAll();
|
|
170
|
-
host.latest("runner").triggerExit();
|
|
171
|
-
sup.settleCheck();
|
|
172
|
-
expect(hs.components.runner.state).toBe("failed");
|
|
173
|
-
expect(hs.components.runner.last_error).toMatch(/crashed during startup/);
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
describe("restart policy", () => {
|
|
178
|
-
it("restarts a crashed component that ran longer than the rapid-crash window", async () => {
|
|
179
|
-
const { sup, host, clock, hs } = makeSupervisor([spec("runner")]);
|
|
180
|
-
await sup.startAll();
|
|
181
|
-
clock.t += 10_000; // 10s uptime
|
|
182
|
-
host.latest("runner").triggerExit();
|
|
183
|
-
await sup.tick();
|
|
184
|
-
|
|
185
|
-
expect(hs.components.runner.restart_count).toBe(1);
|
|
186
|
-
expect(hs.components.runner.state).toBe("running");
|
|
187
|
-
expect(host.countOf("runner")).toBe(2);
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
it("marks a rapid-crashing component failed without retry", async () => {
|
|
191
|
-
const { sup, host, clock, hs } = makeSupervisor([spec("runner")]);
|
|
192
|
-
await sup.startAll();
|
|
193
|
-
clock.t += 1_000; // 1s uptime — inside the rapid-crash window
|
|
194
|
-
host.latest("runner").triggerExit();
|
|
195
|
-
await sup.tick();
|
|
196
|
-
|
|
197
|
-
expect(hs.components.runner.state).toBe("failed");
|
|
198
|
-
expect(host.countOf("runner")).toBe(1); // not respawned
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
it("stops retrying after the max-restart ceiling", async () => {
|
|
202
|
-
const { sup, host, clock, hs } = makeSupervisor([spec("runner")]);
|
|
203
|
-
await sup.startAll();
|
|
204
|
-
hs.components.runner.restart_count = MAX_RESTARTS;
|
|
205
|
-
clock.t += 10_000;
|
|
206
|
-
host.latest("runner").triggerExit();
|
|
207
|
-
await sup.tick();
|
|
208
|
-
|
|
209
|
-
expect(hs.components.runner.state).toBe("failed");
|
|
210
|
-
expect(hs.components.runner.last_error).toMatch(/max restarts/);
|
|
211
|
-
expect(host.countOf("runner")).toBe(1);
|
|
212
|
-
});
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
describe("server health probe", () => {
|
|
216
|
-
it("escalates to kill+restart after the unhealthy threshold, then recovers", async () => {
|
|
217
|
-
let healthy = false;
|
|
218
|
-
const { sup, host, clock, hs } = makeSupervisor([spec("stigmer-server", { critical: true, gate: okGate })], {
|
|
219
|
-
probe: async () => healthy,
|
|
220
|
-
});
|
|
221
|
-
await sup.startAll();
|
|
222
|
-
clock.t += 10_000;
|
|
223
|
-
|
|
224
|
-
await sup.tick(); // 1 unhealthy
|
|
225
|
-
await sup.tick(); // 2 unhealthy
|
|
226
|
-
expect(hs.components["stigmer-server"].state).toBe("unhealthy");
|
|
227
|
-
await sup.tick(); // 3 -> kill + restart
|
|
228
|
-
|
|
229
|
-
expect(hs.components["stigmer-server"].restart_count).toBe(1);
|
|
230
|
-
expect(host.countOf("stigmer-server")).toBe(2);
|
|
231
|
-
|
|
232
|
-
healthy = true;
|
|
233
|
-
await sup.tick();
|
|
234
|
-
expect(hs.components["stigmer-server"].state).toBe("running");
|
|
235
|
-
});
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
describe("shutdown", () => {
|
|
239
|
-
it("stops components in reverse order, removing PID files", async () => {
|
|
240
|
-
const { sup, host, hs } = makeSupervisor([spec("stigmer-server", { critical: true, gate: okGate }), spec("runner")]);
|
|
241
|
-
await sup.startAll();
|
|
242
|
-
await sup.shutdown();
|
|
243
|
-
|
|
244
|
-
expect(host.killOrder).toEqual(["runner", "stigmer-server"]);
|
|
245
|
-
expect(hs.components.runner.state).toBe("stopped");
|
|
246
|
-
expect(hs.components["stigmer-server"].state).toBe("stopped");
|
|
247
|
-
expect(readPidFile(join(dir, "runner.pid"))).toBeNull();
|
|
248
|
-
expect(readPidFile(join(dir, "stigmer-server.pid"))).toBeNull();
|
|
249
|
-
});
|
|
250
|
-
|
|
251
|
-
it("escalates to SIGKILL when a child ignores SIGTERM", async () => {
|
|
252
|
-
const { sup, host } = makeSupervisor([spec("runner")]);
|
|
253
|
-
await sup.startAll();
|
|
254
|
-
host.latest("runner").termExits = false; // ignores SIGTERM
|
|
255
|
-
await sup.shutdown();
|
|
256
|
-
|
|
257
|
-
expect(host.latest("runner").signals).toContain("SIGTERM");
|
|
258
|
-
expect(host.latest("runner").signals).toContain("SIGKILL");
|
|
259
|
-
});
|
|
260
|
-
});
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import type { Config } from "../config/config.js";
|
|
3
|
-
import {
|
|
4
|
-
detectProviderFromEnv,
|
|
5
|
-
readLlm,
|
|
6
|
-
resolveApiKey,
|
|
7
|
-
resolveProvider,
|
|
8
|
-
setLlm,
|
|
9
|
-
} from "./llm-config.js";
|
|
10
|
-
|
|
11
|
-
function config(local?: unknown): Config {
|
|
12
|
-
return { backend: { type: "local", local } };
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
describe("detectProviderFromEnv", () => {
|
|
16
|
-
it("detects Anthropic only — the sole provider local execution supports", () => {
|
|
17
|
-
expect(detectProviderFromEnv({ ANTHROPIC_API_KEY: "a" })).toBe("anthropic");
|
|
18
|
-
// Other provider keys in the shell must not flip the local story.
|
|
19
|
-
expect(detectProviderFromEnv({ OPENAI_API_KEY: "b" })).toBe("");
|
|
20
|
-
expect(detectProviderFromEnv({})).toBe("");
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
describe("resolveProvider", () => {
|
|
25
|
-
it("honors env override > config > autodetect", () => {
|
|
26
|
-
const cfg = config({ llm: { provider: "anthropic" } });
|
|
27
|
-
expect(resolveProvider(cfg, { STIGMER_LLM_PROVIDER: "other" })).toBe("other");
|
|
28
|
-
expect(resolveProvider(cfg, {})).toBe("anthropic");
|
|
29
|
-
expect(resolveProvider(config(), { ANTHROPIC_API_KEY: "x" })).toBe("anthropic");
|
|
30
|
-
expect(resolveProvider(config(), {})).toBe("");
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
describe("resolveApiKey", () => {
|
|
35
|
-
it("uses ANTHROPIC_API_KEY, then config", () => {
|
|
36
|
-
const cfg = config({ llm: { provider: "anthropic", api_key: "cfgkey" } });
|
|
37
|
-
expect(resolveApiKey(cfg, { ANTHROPIC_API_KEY: "envkey" })).toBe("envkey");
|
|
38
|
-
expect(resolveApiKey(cfg, {})).toBe("cfgkey");
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it("returns empty for non-anthropic providers (e.g. hand-edited config)", () => {
|
|
42
|
-
expect(resolveApiKey(config({ llm: { provider: "other", api_key: "k" } }), {})).toBe("");
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
describe("setLlm", () => {
|
|
47
|
-
it("preserves sibling local keys and can clear the section", () => {
|
|
48
|
-
const cfg = config({ temporal: { managed: true }, llm: { provider: "anthropic" } });
|
|
49
|
-
const updated = setLlm(cfg, { provider: "anthropic", api_key: "k" });
|
|
50
|
-
expect(readLlm(updated)).toEqual({ provider: "anthropic", api_key: "k" });
|
|
51
|
-
expect((updated.backend.local as { temporal: unknown }).temporal).toEqual({ managed: true });
|
|
52
|
-
|
|
53
|
-
const cleared = setLlm(cfg, undefined);
|
|
54
|
-
expect(readLlm(cleared)).toBeUndefined();
|
|
55
|
-
expect((cleared.backend.local as { temporal: unknown }).temporal).toEqual({ managed: true });
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it("replaces the section wholesale — a stale model key from a pre-oss#314 config does not survive a rewrite", () => {
|
|
59
|
-
// The graceful-migration contract: old configs may carry llm.model (the
|
|
60
|
-
// removed dead pin). Reads ignore it (LlmSettings no longer models it);
|
|
61
|
-
// the next setup write clears it because setLlm never merges.
|
|
62
|
-
const cfg = config({ llm: { provider: "anthropic", model: "stale-pin", api_key: "k" } });
|
|
63
|
-
const rewritten = setLlm(cfg, { provider: "anthropic", api_key: "k" });
|
|
64
|
-
expect(readLlm(rewritten)).toEqual({ provider: "anthropic", api_key: "k" });
|
|
65
|
-
});
|
|
66
|
-
});
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { appendFileSync, mkdtempSync, renameSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { tmpdir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
-
import { followFile, tailLines } from "./tail.js";
|
|
6
|
-
|
|
7
|
-
let dir: string;
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
dir = mkdtempSync(join(tmpdir(), "stigmer-tail-"));
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
describe("tailLines", () => {
|
|
13
|
-
it("returns the last n lines, ignoring a trailing newline", () => {
|
|
14
|
-
const file = join(dir, "a.log");
|
|
15
|
-
writeFileSync(file, "l1\nl2\nl3\nl4\n");
|
|
16
|
-
expect(tailLines(file, 2)).toEqual(["l3", "l4"]);
|
|
17
|
-
expect(tailLines(file, 0)).toEqual(["l1", "l2", "l3", "l4"]);
|
|
18
|
-
expect(tailLines(file, 10)).toEqual(["l1", "l2", "l3", "l4"]);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it("returns empty for a missing file", () => {
|
|
22
|
-
expect(tailLines(join(dir, "nope.log"), 5)).toEqual([]);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
describe("followFile", () => {
|
|
27
|
-
const tick = () => vi.advanceTimersByTimeAsync(250);
|
|
28
|
-
|
|
29
|
-
beforeEach(() => {
|
|
30
|
-
vi.useFakeTimers();
|
|
31
|
-
return () => vi.useRealTimers();
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("emits only newly appended lines", async () => {
|
|
35
|
-
const file = join(dir, "f.log");
|
|
36
|
-
writeFileSync(file, "old\n");
|
|
37
|
-
const seen: string[] = [];
|
|
38
|
-
const handle = followFile(file, (line) => seen.push(line), { pollMs: 200 });
|
|
39
|
-
|
|
40
|
-
appendFileSync(file, "new1\nnew2\n");
|
|
41
|
-
await tick();
|
|
42
|
-
expect(seen).toEqual(["new1", "new2"]);
|
|
43
|
-
handle.stop();
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it("reopens after rotation (inode change)", async () => {
|
|
47
|
-
const file = join(dir, "r.log");
|
|
48
|
-
writeFileSync(file, "before\n");
|
|
49
|
-
const seen: string[] = [];
|
|
50
|
-
const handle = followFile(file, (line) => seen.push(line), { pollMs: 200 });
|
|
51
|
-
|
|
52
|
-
// Rotate: move the file aside and create a fresh one in its place.
|
|
53
|
-
renameSync(file, join(dir, "r.log.1"));
|
|
54
|
-
writeFileSync(file, "after-rotate\n");
|
|
55
|
-
await tick();
|
|
56
|
-
|
|
57
|
-
expect(seen).toContain("after-rotate");
|
|
58
|
-
handle.stop();
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it("with fromStart, emits existing content too", async () => {
|
|
62
|
-
const file = join(dir, "s.log");
|
|
63
|
-
writeFileSync(file, "existing\n");
|
|
64
|
-
const seen: string[] = [];
|
|
65
|
-
const handle = followFile(file, (line) => seen.push(line), { pollMs: 200, fromStart: true });
|
|
66
|
-
await tick();
|
|
67
|
-
expect(seen).toContain("existing");
|
|
68
|
-
handle.stop();
|
|
69
|
-
});
|
|
70
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { mkdtempSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { tmpdir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import { beforeEach, describe, expect, it } from "vitest";
|
|
5
|
-
import { allComponents, componentByName, printTail } from "./view.js";
|
|
6
|
-
|
|
7
|
-
let dir: string;
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
dir = mkdtempSync(join(tmpdir(), "stigmer-logsview-"));
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
class CaptureSink {
|
|
13
|
-
chunks: string[] = [];
|
|
14
|
-
write(chunk: string): void {
|
|
15
|
-
this.chunks.push(chunk);
|
|
16
|
-
}
|
|
17
|
-
get text(): string {
|
|
18
|
-
return this.chunks.join("");
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
describe("componentByName / allComponents", () => {
|
|
23
|
-
it("knows the three daemon components", () => {
|
|
24
|
-
expect(allComponents(dir).map((c) => c.name)).toEqual(["stigmer-server", "runner", "temporal"]);
|
|
25
|
-
expect(componentByName(dir, "runner")?.file).toBe(join(dir, "runner.log"));
|
|
26
|
-
expect(componentByName(dir, "bogus")).toBeUndefined();
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
describe("printTail", () => {
|
|
31
|
-
it("does not prefix a single component", () => {
|
|
32
|
-
writeFileSync(join(dir, "runner.log"), "r1\nr2\n");
|
|
33
|
-
const sink = new CaptureSink();
|
|
34
|
-
printTail([componentByName(dir, "runner")!], 5, sink);
|
|
35
|
-
expect(sink.text).toBe("r1\nr2\n");
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it("prefixes lines with the component name when showing several", () => {
|
|
39
|
-
writeFileSync(join(dir, "stigmer-server.log"), "s1\n");
|
|
40
|
-
writeFileSync(join(dir, "runner.log"), "r1\n");
|
|
41
|
-
writeFileSync(join(dir, "temporal.log"), "t1\n");
|
|
42
|
-
const sink = new CaptureSink();
|
|
43
|
-
printTail(allComponents(dir), 5, sink);
|
|
44
|
-
expect(sink.text).toBe("[stigmer-server] s1\n[runner] r1\n[temporal] t1\n");
|
|
45
|
-
});
|
|
46
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import type { Config } from "../config/config.js";
|
|
3
|
-
import {
|
|
4
|
-
readOperator,
|
|
5
|
-
resolveOperatorIdentity,
|
|
6
|
-
setOperator,
|
|
7
|
-
validateOperatorIdentity,
|
|
8
|
-
} from "./operator-config.js";
|
|
9
|
-
|
|
10
|
-
function config(local?: unknown): Config {
|
|
11
|
-
return { backend: { type: "local", local } };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
describe("resolveOperatorIdentity", () => {
|
|
15
|
-
it("honors env > config, never mixing sources", () => {
|
|
16
|
-
const cfg = config({ operator: { email: "cfg@example.com", name: "Config Name" } });
|
|
17
|
-
|
|
18
|
-
// Env email brings the env name (or none) — the config name must not
|
|
19
|
-
// ride along under an env identity, that would be attribution lying.
|
|
20
|
-
expect(resolveOperatorIdentity(cfg, { STIGMER_OPERATOR_EMAIL: "env@example.com" })).toEqual({
|
|
21
|
-
email: "env@example.com",
|
|
22
|
-
});
|
|
23
|
-
expect(
|
|
24
|
-
resolveOperatorIdentity(cfg, {
|
|
25
|
-
STIGMER_OPERATOR_EMAIL: "env@example.com",
|
|
26
|
-
STIGMER_OPERATOR_NAME: "Env Name",
|
|
27
|
-
}),
|
|
28
|
-
).toEqual({ email: "env@example.com", name: "Env Name" });
|
|
29
|
-
|
|
30
|
-
expect(resolveOperatorIdentity(cfg, {})).toEqual({
|
|
31
|
-
email: "cfg@example.com",
|
|
32
|
-
name: "Config Name",
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it("returns undefined when neither source has an email — the anonymous default", () => {
|
|
37
|
-
expect(resolveOperatorIdentity(config(), {})).toBeUndefined();
|
|
38
|
-
expect(resolveOperatorIdentity(config({ operator: {} }), {})).toBeUndefined();
|
|
39
|
-
// Whitespace-only values are unset, matching the server's TrimSpace.
|
|
40
|
-
expect(resolveOperatorIdentity(config(), { STIGMER_OPERATOR_EMAIL: " " })).toBeUndefined();
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it("trims values, matching the server's boot check", () => {
|
|
44
|
-
const cfg = config({ operator: { email: " ada@example.com ", name: " Ada " } });
|
|
45
|
-
expect(resolveOperatorIdentity(cfg, {})).toEqual({ email: "ada@example.com", name: "Ada" });
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
describe("validateOperatorIdentity", () => {
|
|
50
|
-
it("mirrors the server's boot rules: minimal @ check, name requires email", () => {
|
|
51
|
-
expect(validateOperatorIdentity("ada@example.com", "Ada")).toBeUndefined();
|
|
52
|
-
expect(validateOperatorIdentity("ada@example.com", "")).toBeUndefined();
|
|
53
|
-
expect(validateOperatorIdentity("", "")).toBeUndefined(); // "no identity" is valid
|
|
54
|
-
|
|
55
|
-
expect(validateOperatorIdentity("not-an-email", "")).toContain("missing '@'");
|
|
56
|
-
expect(validateOperatorIdentity("", "Ada")).toContain("set both or neither");
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
describe("setOperator", () => {
|
|
61
|
-
it("preserves sibling local keys and can clear the section", () => {
|
|
62
|
-
const cfg = config({ temporal: { managed: true }, llm: { provider: "anthropic" } });
|
|
63
|
-
const updated = setOperator(cfg, { email: "ada@example.com", name: "Ada" });
|
|
64
|
-
expect(readOperator(updated)).toEqual({ email: "ada@example.com", name: "Ada" });
|
|
65
|
-
expect((updated.backend.local as { temporal: unknown }).temporal).toEqual({ managed: true });
|
|
66
|
-
expect((updated.backend.local as { llm: unknown }).llm).toEqual({ provider: "anthropic" });
|
|
67
|
-
|
|
68
|
-
const cleared = setOperator(updated, undefined);
|
|
69
|
-
expect(readOperator(cleared)).toBeUndefined();
|
|
70
|
-
expect((cleared.backend.local as { temporal: unknown }).temporal).toEqual({ managed: true });
|
|
71
|
-
});
|
|
72
|
-
});
|
package/src/local/reset.test.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { tmpdir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
-
import { configPath } from "../config/paths.js";
|
|
6
|
-
import { binDir, configDir, databasePath, dataDir, temporalDataDir } from "./paths.js";
|
|
7
|
-
import { reset } from "./reset.js";
|
|
8
|
-
|
|
9
|
-
let home: string;
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
home = mkdtempSync(join(tmpdir(), "stigmer-reset-"));
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
function seedState(): void {
|
|
15
|
-
mkdirSync(dataDir(home), { recursive: true });
|
|
16
|
-
mkdirSync(temporalDataDir(home), { recursive: true });
|
|
17
|
-
mkdirSync(binDir(home), { recursive: true });
|
|
18
|
-
writeFileSync(databasePath(home), "db");
|
|
19
|
-
writeFileSync(`${databasePath(home)}-wal`, "wal");
|
|
20
|
-
writeFileSync(join(dataDir(home), "runner.pid"), "1");
|
|
21
|
-
writeFileSync(configPath(home), "backend:\n type: local\n");
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const noopStop = vi.fn(async () => true);
|
|
25
|
-
|
|
26
|
-
describe("reset", () => {
|
|
27
|
-
it("wipes state but preserves config by default", async () => {
|
|
28
|
-
seedState();
|
|
29
|
-
const result = await reset({}, home, noopStop);
|
|
30
|
-
|
|
31
|
-
expect(result.servicesStopped).toBe(true);
|
|
32
|
-
expect(existsSync(dataDir(home))).toBe(false);
|
|
33
|
-
expect(existsSync(databasePath(home))).toBe(false);
|
|
34
|
-
expect(existsSync(`${databasePath(home)}-wal`)).toBe(false);
|
|
35
|
-
expect(existsSync(temporalDataDir(home))).toBe(false);
|
|
36
|
-
expect(existsSync(binDir(home))).toBe(false);
|
|
37
|
-
// Config is preserved.
|
|
38
|
-
expect(existsSync(configPath(home))).toBe(true);
|
|
39
|
-
expect(result.removedPaths).toContain(dataDir(home));
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it("removes config when includeConfig is set", async () => {
|
|
43
|
-
seedState();
|
|
44
|
-
await reset({ includeConfig: true }, home, noopStop);
|
|
45
|
-
expect(existsSync(configPath(home))).toBe(false);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it("reports services not stopped when nothing was running", async () => {
|
|
49
|
-
mkdirSync(configDir(home), { recursive: true });
|
|
50
|
-
const result = await reset({}, home, vi.fn(async () => false));
|
|
51
|
-
expect(result.servicesStopped).toBe(false);
|
|
52
|
-
});
|
|
53
|
-
});
|