@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,336 +0,0 @@
|
|
|
1
|
-
// Unit tests for run-path resource creation: full-proto field mapping, the
|
|
2
|
-
// message default, ExecutionConfig presence/contents, runtime-env conversion,
|
|
3
|
-
// the one-call session_spec bootstrap, and the workflow shape. The controller
|
|
4
|
-
// is faked to capture the exact proto sent to the RPC.
|
|
5
|
-
|
|
6
|
-
import { describe, expect, it } from "vitest";
|
|
7
|
-
import { InteractionMode, ServiceTier, ThinkingMode } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
8
|
-
import { create } from "@bufbuild/protobuf";
|
|
9
|
-
import { Harness } from "@stigmer/protos/ai/stigmer/agentic/session/v1/enum_pb";
|
|
10
|
-
import {
|
|
11
|
-
LocalPathSourceSchema,
|
|
12
|
-
WorkspaceEntrySchema,
|
|
13
|
-
WorkspaceSourceSchema,
|
|
14
|
-
} from "@stigmer/protos/ai/stigmer/agentic/session/v1/workspace_pb";
|
|
15
|
-
import { type ControllerFn, createAgentExecution, createWorkflowExecution } from "./create.js";
|
|
16
|
-
|
|
17
|
-
// Returns a controller whose every RPC echoes the request back, and records the
|
|
18
|
-
// last message sent. `create` is the only RPC the run path calls.
|
|
19
|
-
function fakeController(): { fn: ControllerFn; last: () => unknown } {
|
|
20
|
-
let captured: unknown;
|
|
21
|
-
const fn = (() =>
|
|
22
|
-
({
|
|
23
|
-
create: async (msg: unknown) => {
|
|
24
|
-
captured = msg;
|
|
25
|
-
return msg;
|
|
26
|
-
},
|
|
27
|
-
})) as unknown as ControllerFn;
|
|
28
|
-
return { fn, last: () => captured };
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
describe("createAgentExecution", () => {
|
|
32
|
-
it("maps the full spec and defaults an empty message to 'execute'", async () => {
|
|
33
|
-
const { fn } = fakeController();
|
|
34
|
-
const exec = await createAgentExecution(fn, {
|
|
35
|
-
agentId: "agt_1",
|
|
36
|
-
orgId: "acme",
|
|
37
|
-
message: "",
|
|
38
|
-
runtimeEnv: { FOO: { value: "bar", isSecret: false }, TOKEN: { value: "s", isSecret: true } },
|
|
39
|
-
attachments: [],
|
|
40
|
-
workspaceFileRefs: ["src/a.ts"],
|
|
41
|
-
workspaceEntries: [],
|
|
42
|
-
model: "claude",
|
|
43
|
-
mode: "plan",
|
|
44
|
-
serviceTier: "",
|
|
45
|
-
thinking: "",
|
|
46
|
-
autoApproveAll: true,
|
|
47
|
-
harness: "",
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
expect(exec.kind).toBe("AgentExecution");
|
|
51
|
-
expect(exec.metadata?.org).toBe("acme");
|
|
52
|
-
expect(exec.spec?.message).toBe("execute");
|
|
53
|
-
expect(exec.spec?.agentId).toBe("agt_1");
|
|
54
|
-
expect(exec.spec?.autoApproveAll).toBe(true);
|
|
55
|
-
expect(exec.spec?.workspaceFileRefs).toEqual(["src/a.ts"]);
|
|
56
|
-
expect(exec.spec?.runtimeEnv.FOO).toMatchObject({ value: "bar", isSecret: false });
|
|
57
|
-
expect(exec.spec?.runtimeEnv.TOKEN).toMatchObject({ value: "s", isSecret: true });
|
|
58
|
-
expect(exec.spec?.executionConfig?.modelName).toBe("claude");
|
|
59
|
-
expect(exec.spec?.executionConfig?.interactionMode).toBe(InteractionMode.PLAN);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it("omits ExecutionConfig when neither model nor mode is set", async () => {
|
|
63
|
-
const { fn } = fakeController();
|
|
64
|
-
const exec = await createAgentExecution(fn, {
|
|
65
|
-
agentId: "agt_1",
|
|
66
|
-
orgId: "acme",
|
|
67
|
-
message: "hi",
|
|
68
|
-
runtimeEnv: {},
|
|
69
|
-
attachments: [],
|
|
70
|
-
workspaceFileRefs: [],
|
|
71
|
-
workspaceEntries: [],
|
|
72
|
-
model: "",
|
|
73
|
-
mode: "",
|
|
74
|
-
serviceTier: "",
|
|
75
|
-
thinking: "",
|
|
76
|
-
autoApproveAll: false,
|
|
77
|
-
harness: "",
|
|
78
|
-
});
|
|
79
|
-
expect(exec.spec?.message).toBe("hi");
|
|
80
|
-
expect(exec.spec?.executionConfig).toBeUndefined();
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it("maps --service-tier fast to the enum (#357)", async () => {
|
|
84
|
-
const { fn } = fakeController();
|
|
85
|
-
const exec = await createAgentExecution(fn, {
|
|
86
|
-
agentId: "agt_1",
|
|
87
|
-
orgId: "acme",
|
|
88
|
-
message: "x",
|
|
89
|
-
runtimeEnv: {},
|
|
90
|
-
attachments: [],
|
|
91
|
-
workspaceFileRefs: [],
|
|
92
|
-
workspaceEntries: [],
|
|
93
|
-
model: "composer-2.5",
|
|
94
|
-
mode: "",
|
|
95
|
-
serviceTier: "fast",
|
|
96
|
-
thinking: "",
|
|
97
|
-
autoApproveAll: false,
|
|
98
|
-
harness: "",
|
|
99
|
-
});
|
|
100
|
-
expect(exec.spec?.executionConfig?.serviceTier).toBe(ServiceTier.FAST);
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
it("maps an explicit --service-tier standard to STANDARD, not UNSPECIFIED", async () => {
|
|
104
|
-
// Unspecified-vs-explicit-standard is a load-bearing ledger
|
|
105
|
-
// distinction (#357): an explicit choice must survive to the proto.
|
|
106
|
-
const { fn } = fakeController();
|
|
107
|
-
const exec = await createAgentExecution(fn, {
|
|
108
|
-
agentId: "agt_1",
|
|
109
|
-
orgId: "acme",
|
|
110
|
-
message: "x",
|
|
111
|
-
runtimeEnv: {},
|
|
112
|
-
attachments: [],
|
|
113
|
-
workspaceFileRefs: [],
|
|
114
|
-
workspaceEntries: [],
|
|
115
|
-
model: "",
|
|
116
|
-
mode: "",
|
|
117
|
-
serviceTier: "standard",
|
|
118
|
-
thinking: "",
|
|
119
|
-
autoApproveAll: false,
|
|
120
|
-
harness: "",
|
|
121
|
-
});
|
|
122
|
-
expect(exec.spec?.executionConfig?.serviceTier).toBe(ServiceTier.STANDARD);
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it("maps --thinking enabled to the enum (#772)", async () => {
|
|
126
|
-
const { fn } = fakeController();
|
|
127
|
-
const exec = await createAgentExecution(fn, {
|
|
128
|
-
agentId: "agt_1",
|
|
129
|
-
orgId: "acme",
|
|
130
|
-
message: "x",
|
|
131
|
-
runtimeEnv: {},
|
|
132
|
-
attachments: [],
|
|
133
|
-
workspaceFileRefs: [],
|
|
134
|
-
workspaceEntries: [],
|
|
135
|
-
model: "claude-haiku-4-5",
|
|
136
|
-
mode: "",
|
|
137
|
-
serviceTier: "",
|
|
138
|
-
thinking: "enabled",
|
|
139
|
-
autoApproveAll: false,
|
|
140
|
-
harness: "",
|
|
141
|
-
});
|
|
142
|
-
expect(exec.spec?.executionConfig?.thinkingMode).toBe(ThinkingMode.ENABLED);
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
it("maps an explicit --thinking disabled to DISABLED, not UNSPECIFIED", async () => {
|
|
146
|
-
// The tier's #772 twin: unspecified-vs-explicit-disabled is the same
|
|
147
|
-
// load-bearing ledger distinction.
|
|
148
|
-
const { fn } = fakeController();
|
|
149
|
-
const exec = await createAgentExecution(fn, {
|
|
150
|
-
agentId: "agt_1",
|
|
151
|
-
orgId: "acme",
|
|
152
|
-
message: "x",
|
|
153
|
-
runtimeEnv: {},
|
|
154
|
-
attachments: [],
|
|
155
|
-
workspaceFileRefs: [],
|
|
156
|
-
workspaceEntries: [],
|
|
157
|
-
model: "",
|
|
158
|
-
mode: "",
|
|
159
|
-
serviceTier: "",
|
|
160
|
-
thinking: "disabled",
|
|
161
|
-
autoApproveAll: false,
|
|
162
|
-
harness: "",
|
|
163
|
-
});
|
|
164
|
-
expect(exec.spec?.executionConfig?.thinkingMode).toBe(ThinkingMode.DISABLED);
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
it("leaves InteractionMode unspecified for agent mode", async () => {
|
|
168
|
-
const { fn } = fakeController();
|
|
169
|
-
const exec = await createAgentExecution(fn, {
|
|
170
|
-
sessionId: "ses_1",
|
|
171
|
-
orgId: "acme",
|
|
172
|
-
message: "x",
|
|
173
|
-
runtimeEnv: {},
|
|
174
|
-
attachments: [],
|
|
175
|
-
workspaceFileRefs: [],
|
|
176
|
-
workspaceEntries: [],
|
|
177
|
-
model: "m",
|
|
178
|
-
mode: "agent",
|
|
179
|
-
serviceTier: "",
|
|
180
|
-
thinking: "",
|
|
181
|
-
autoApproveAll: false,
|
|
182
|
-
harness: "",
|
|
183
|
-
});
|
|
184
|
-
expect(exec.spec?.sessionId).toBe("ses_1");
|
|
185
|
-
expect(exec.spec?.executionConfig?.interactionMode).toBe(InteractionMode.UNSPECIFIED);
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
it("embeds workspace entries as session_spec (one-call bootstrap) with an empty subject", async () => {
|
|
189
|
-
const entry = create(WorkspaceEntrySchema, {
|
|
190
|
-
name: "repo",
|
|
191
|
-
source: create(WorkspaceSourceSchema, {
|
|
192
|
-
source: { case: "localPath", value: create(LocalPathSourceSchema, { path: "/home/user/repo" }) },
|
|
193
|
-
}),
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
const { fn } = fakeController();
|
|
197
|
-
const exec = await createAgentExecution(fn, {
|
|
198
|
-
agentId: "agt_1",
|
|
199
|
-
orgId: "acme",
|
|
200
|
-
message: "hi",
|
|
201
|
-
runtimeEnv: {},
|
|
202
|
-
attachments: [],
|
|
203
|
-
workspaceFileRefs: [],
|
|
204
|
-
workspaceEntries: [entry],
|
|
205
|
-
model: "",
|
|
206
|
-
mode: "",
|
|
207
|
-
serviceTier: "",
|
|
208
|
-
thinking: "",
|
|
209
|
-
autoApproveAll: false,
|
|
210
|
-
harness: "",
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
expect(exec.spec?.sessionId).toBe("");
|
|
214
|
-
expect(exec.spec?.sessionSpec?.workspaceEntries).toEqual([entry]);
|
|
215
|
-
// Subject stays empty so the server defaults its sentinel and the async
|
|
216
|
-
// title activity generates a real one.
|
|
217
|
-
expect(exec.spec?.sessionSpec?.subject).toBe("");
|
|
218
|
-
// No harness opinion: the field stays UNSPECIFIED so the server default
|
|
219
|
-
// (native) applies — a workspace-only run is byte-identical to before
|
|
220
|
-
// the --harness flag existed.
|
|
221
|
-
expect(exec.spec?.sessionSpec?.harness).toBe(Harness.UNSPECIFIED);
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
it("omits session_spec when there are no workspace entries and no harness (wire-shape regression pin)", async () => {
|
|
225
|
-
// The pre---harness wire shape for a plain run: NO embedded session_spec
|
|
226
|
-
// at all. If this pin fails, plain runs have started carrying a spec they
|
|
227
|
-
// never carried before — a silent contract change, not a feature.
|
|
228
|
-
const { fn } = fakeController();
|
|
229
|
-
const exec = await createAgentExecution(fn, {
|
|
230
|
-
agentId: "agt_1",
|
|
231
|
-
orgId: "acme",
|
|
232
|
-
message: "hi",
|
|
233
|
-
runtimeEnv: {},
|
|
234
|
-
attachments: [],
|
|
235
|
-
workspaceFileRefs: [],
|
|
236
|
-
workspaceEntries: [],
|
|
237
|
-
model: "",
|
|
238
|
-
mode: "",
|
|
239
|
-
serviceTier: "",
|
|
240
|
-
thinking: "",
|
|
241
|
-
autoApproveAll: false,
|
|
242
|
-
harness: "",
|
|
243
|
-
});
|
|
244
|
-
expect(exec.spec?.sessionSpec).toBeUndefined();
|
|
245
|
-
});
|
|
246
|
-
|
|
247
|
-
it("stamps cursor harness on a session_spec created just for it (oss#293)", async () => {
|
|
248
|
-
const { fn } = fakeController();
|
|
249
|
-
const exec = await createAgentExecution(fn, {
|
|
250
|
-
agentId: "agt_1",
|
|
251
|
-
orgId: "acme",
|
|
252
|
-
message: "hi",
|
|
253
|
-
runtimeEnv: {},
|
|
254
|
-
attachments: [],
|
|
255
|
-
workspaceFileRefs: [],
|
|
256
|
-
workspaceEntries: [],
|
|
257
|
-
model: "",
|
|
258
|
-
mode: "",
|
|
259
|
-
serviceTier: "",
|
|
260
|
-
thinking: "",
|
|
261
|
-
autoApproveAll: false,
|
|
262
|
-
harness: "cursor",
|
|
263
|
-
});
|
|
264
|
-
// Harness alone justifies the embedded spec: the server clones it onto
|
|
265
|
-
// the auto-created session (the one-call bootstrap contract).
|
|
266
|
-
expect(exec.spec?.sessionSpec?.harness).toBe(Harness.CURSOR);
|
|
267
|
-
expect(exec.spec?.sessionSpec?.workspaceEntries).toEqual([]);
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
it("stamps an explicit native harness rather than leaving it unspecified", async () => {
|
|
271
|
-
// "native" may be a deliberate per-run escape from the account's
|
|
272
|
-
// default_harness preference — it must survive on the wire so it beats
|
|
273
|
-
// any future change to the server-side default (D3).
|
|
274
|
-
const { fn } = fakeController();
|
|
275
|
-
const exec = await createAgentExecution(fn, {
|
|
276
|
-
agentId: "agt_1",
|
|
277
|
-
orgId: "acme",
|
|
278
|
-
message: "hi",
|
|
279
|
-
runtimeEnv: {},
|
|
280
|
-
attachments: [],
|
|
281
|
-
workspaceFileRefs: [],
|
|
282
|
-
workspaceEntries: [],
|
|
283
|
-
model: "",
|
|
284
|
-
mode: "",
|
|
285
|
-
serviceTier: "",
|
|
286
|
-
thinking: "",
|
|
287
|
-
autoApproveAll: false,
|
|
288
|
-
harness: "native",
|
|
289
|
-
});
|
|
290
|
-
expect(exec.spec?.sessionSpec?.harness).toBe(Harness.NATIVE);
|
|
291
|
-
});
|
|
292
|
-
|
|
293
|
-
it("carries harness and workspace entries together on one session_spec", async () => {
|
|
294
|
-
const entry = create(WorkspaceEntrySchema, {
|
|
295
|
-
name: "repo",
|
|
296
|
-
source: create(WorkspaceSourceSchema, {
|
|
297
|
-
source: { case: "localPath", value: create(LocalPathSourceSchema, { path: "/home/user/repo" }) },
|
|
298
|
-
}),
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
const { fn } = fakeController();
|
|
302
|
-
const exec = await createAgentExecution(fn, {
|
|
303
|
-
agentId: "agt_1",
|
|
304
|
-
orgId: "acme",
|
|
305
|
-
message: "hi",
|
|
306
|
-
runtimeEnv: {},
|
|
307
|
-
attachments: [],
|
|
308
|
-
workspaceFileRefs: [],
|
|
309
|
-
workspaceEntries: [entry],
|
|
310
|
-
model: "",
|
|
311
|
-
mode: "",
|
|
312
|
-
serviceTier: "",
|
|
313
|
-
thinking: "",
|
|
314
|
-
autoApproveAll: false,
|
|
315
|
-
harness: "cursor",
|
|
316
|
-
});
|
|
317
|
-
expect(exec.spec?.sessionSpec?.harness).toBe(Harness.CURSOR);
|
|
318
|
-
expect(exec.spec?.sessionSpec?.workspaceEntries).toEqual([entry]);
|
|
319
|
-
});
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
describe("createWorkflowExecution", () => {
|
|
323
|
-
it("builds a workflow execution with the trigger message", async () => {
|
|
324
|
-
const { fn } = fakeController();
|
|
325
|
-
const exec = await createWorkflowExecution(fn, {
|
|
326
|
-
workflowId: "wfl_1",
|
|
327
|
-
orgId: "acme",
|
|
328
|
-
message: "",
|
|
329
|
-
runtimeEnv: { K: { value: "v", isSecret: false } },
|
|
330
|
-
});
|
|
331
|
-
expect(exec.kind).toBe("WorkflowExecution");
|
|
332
|
-
expect(exec.spec?.workflowId).toBe("wfl_1");
|
|
333
|
-
expect(exec.spec?.triggerMessage).toBe("execute");
|
|
334
|
-
expect(exec.spec?.runtimeEnv.K).toMatchObject({ value: "v", isSecret: false });
|
|
335
|
-
});
|
|
336
|
-
});
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
// Unit tests for runtime-env assembly: dotenv parsing, flag parsing, precedence,
|
|
2
|
-
// and quote/escape handling. The precedence ordering is a wire-parity contract
|
|
3
|
-
// with the Go CLI, so it gets dedicated coverage.
|
|
4
|
-
|
|
5
|
-
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
6
|
-
import { tmpdir } from "node:os";
|
|
7
|
-
import { join } from "node:path";
|
|
8
|
-
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
9
|
-
import { loadAndMergeEnv } from "./env.js";
|
|
10
|
-
|
|
11
|
-
let dir: string;
|
|
12
|
-
beforeEach(() => {
|
|
13
|
-
dir = mkdtempSync(join(tmpdir(), "env-test-"));
|
|
14
|
-
});
|
|
15
|
-
afterEach(() => {
|
|
16
|
-
rmSync(dir, { recursive: true, force: true });
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
function writeFile(name: string, contents: string): string {
|
|
20
|
-
const path = join(dir, name);
|
|
21
|
-
writeFileSync(path, contents);
|
|
22
|
-
return path;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const NONE = { envFlags: [], secretFlags: [], envFiles: [], secretFiles: [] };
|
|
26
|
-
|
|
27
|
-
describe("loadAndMergeEnv flags", () => {
|
|
28
|
-
it("parses plain KEY=VALUE env flags as non-secrets", () => {
|
|
29
|
-
expect(loadAndMergeEnv({ ...NONE, envFlags: ["FOO=bar", "BAZ=qux"] })).toEqual({
|
|
30
|
-
FOO: { value: "bar", isSecret: false },
|
|
31
|
-
BAZ: { value: "qux", isSecret: false },
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it("parses secret flags as secrets", () => {
|
|
36
|
-
expect(loadAndMergeEnv({ ...NONE, secretFlags: ["TOKEN=abc"] })).toEqual({
|
|
37
|
-
TOKEN: { value: "abc", isSecret: true },
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it("rejects a flag without '='", () => {
|
|
42
|
-
expect(() => loadAndMergeEnv({ ...NONE, envFlags: ["NOEQUALS"] })).toThrow(/missing '=' separator/);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it("rejects an invalid key", () => {
|
|
46
|
-
expect(() => loadAndMergeEnv({ ...NONE, envFlags: ["1BAD=x"] })).toThrow(/invalid key/);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it("keeps everything after the first '=' as the value", () => {
|
|
50
|
-
expect(loadAndMergeEnv({ ...NONE, envFlags: ["URL=https://a.b/c?d=e"] })).toEqual({
|
|
51
|
-
URL: { value: "https://a.b/c?d=e", isSecret: false },
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
describe("loadAndMergeEnv files", () => {
|
|
57
|
-
it("parses comments, blanks, export prefix, and quoted values", () => {
|
|
58
|
-
const path = writeFile(
|
|
59
|
-
".env",
|
|
60
|
-
["# comment", "", "export FOO=bar", 'QUOTED="hello world"', "SINGLE='single'"].join("\n"),
|
|
61
|
-
);
|
|
62
|
-
expect(loadAndMergeEnv({ ...NONE, envFiles: [path] })).toEqual({
|
|
63
|
-
FOO: { value: "bar", isSecret: false },
|
|
64
|
-
QUOTED: { value: "hello world", isSecret: false },
|
|
65
|
-
SINGLE: { value: "single", isSecret: false },
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it("treats secret files as all-secret", () => {
|
|
70
|
-
const path = writeFile("secrets.env", "API_KEY=xyz\n");
|
|
71
|
-
expect(loadAndMergeEnv({ ...NONE, secretFiles: [path] })).toEqual({
|
|
72
|
-
API_KEY: { value: "xyz", isSecret: true },
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it("reports the file and line on a parse error", () => {
|
|
77
|
-
const path = writeFile(".env", "GOOD=1\nBADLINE\n");
|
|
78
|
-
expect(() => loadAndMergeEnv({ ...NONE, envFiles: [path] })).toThrow(/:2:/);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it("errors clearly when a file is missing", () => {
|
|
82
|
-
expect(() => loadAndMergeEnv({ ...NONE, envFiles: [join(dir, "nope.env")] })).toThrow(
|
|
83
|
-
/failed to open environment file/,
|
|
84
|
-
);
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
describe("loadAndMergeEnv precedence (later wins)", () => {
|
|
89
|
-
it("layers env-files < secret-files < --env < --secret", () => {
|
|
90
|
-
const envFile = writeFile("a.env", "K=from-env-file\n");
|
|
91
|
-
const secretFile = writeFile("b.env", "K=from-secret-file\n");
|
|
92
|
-
// secret-file beats env-file:
|
|
93
|
-
expect(loadAndMergeEnv({ ...NONE, envFiles: [envFile], secretFiles: [secretFile] })).toEqual({
|
|
94
|
-
K: { value: "from-secret-file", isSecret: true },
|
|
95
|
-
});
|
|
96
|
-
// --env beats secret-file:
|
|
97
|
-
expect(
|
|
98
|
-
loadAndMergeEnv({ ...NONE, secretFiles: [secretFile], envFlags: ["K=from-env-flag"] }),
|
|
99
|
-
).toEqual({ K: { value: "from-env-flag", isSecret: false } });
|
|
100
|
-
// --secret beats --env:
|
|
101
|
-
expect(loadAndMergeEnv({ ...NONE, envFlags: ["K=from-env"], secretFlags: ["K=from-secret"] })).toEqual({
|
|
102
|
-
K: { value: "from-secret", isSecret: true },
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it("applies later files within the same tier last", () => {
|
|
107
|
-
const first = writeFile("first.env", "K=first\n");
|
|
108
|
-
const second = writeFile("second.env", "K=second\n");
|
|
109
|
-
expect(loadAndMergeEnv({ ...NONE, envFiles: [first, second] })).toEqual({
|
|
110
|
-
K: { value: "second", isSecret: false },
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
describe("escape handling matches Go's single-pass replacer", () => {
|
|
116
|
-
it("does not double-process a literal backslash-n", () => {
|
|
117
|
-
// "\\n" in the file is backslash + backslash + n; Go yields backslash + n,
|
|
118
|
-
// NOT a newline. A naive chained replace would wrongly produce a newline.
|
|
119
|
-
const path = writeFile(".env", 'K="\\\\n"\n');
|
|
120
|
-
expect(loadAndMergeEnv({ ...NONE, envFiles: [path] })).toEqual({
|
|
121
|
-
K: { value: "\\n", isSecret: false },
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it("unescapes real escape sequences", () => {
|
|
126
|
-
const path = writeFile(".env", 'K="a\\tb\\nc"\n');
|
|
127
|
-
expect(loadAndMergeEnv({ ...NONE, envFiles: [path] })).toEqual({
|
|
128
|
-
K: { value: "a\tb\nc", isSecret: false },
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
});
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { create } from "@bufbuild/protobuf";
|
|
2
|
-
import {
|
|
3
|
-
WorkspaceEntrySchema,
|
|
4
|
-
} from "@stigmer/protos/ai/stigmer/agentic/session/v1/workspace_pb";
|
|
5
|
-
import { describe, expect, it } from "vitest";
|
|
6
|
-
import { renderSessionHeader, workspaceNames } from "./header.js";
|
|
7
|
-
|
|
8
|
-
function capture(): { out: { write(c: string): void; isTTY: boolean }; text: () => string } {
|
|
9
|
-
let buf = "";
|
|
10
|
-
return {
|
|
11
|
-
out: { write: (c: string) => void (buf += c), isTTY: false },
|
|
12
|
-
text: () => buf,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
describe("renderSessionHeader", () => {
|
|
17
|
-
it("omits empty fields and aligns labels", () => {
|
|
18
|
-
const { out, text } = capture();
|
|
19
|
-
renderSessionHeader(out, { agentName: "Reviewer", sessionId: "ses_abc", model: "", mode: "", workspaces: [] });
|
|
20
|
-
expect(text()).toBe("Agent: Reviewer\nSession: ses_abc\n\n");
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it("surfaces plan mode but not agent/default", () => {
|
|
24
|
-
const plan = capture();
|
|
25
|
-
renderSessionHeader(plan.out, { agentName: "", sessionId: "", model: "", mode: "plan", workspaces: [] });
|
|
26
|
-
expect(plan.text()).toContain("Mode:");
|
|
27
|
-
expect(plan.text()).toContain("Plan (read-only)");
|
|
28
|
-
|
|
29
|
-
const agent = capture();
|
|
30
|
-
renderSessionHeader(agent.out, { agentName: "", sessionId: "s", model: "", mode: "agent", workspaces: [] });
|
|
31
|
-
expect(agent.text()).not.toContain("Mode:");
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("surfaces the cursor harness but not native/default (oss#293 D2 visibility)", () => {
|
|
35
|
-
// A cursor session may have been selected by the account preference, not
|
|
36
|
-
// a flag — the header is the CLI's only pre-stream channel to say so.
|
|
37
|
-
const cursor = capture();
|
|
38
|
-
renderSessionHeader(cursor.out, { agentName: "", sessionId: "s", model: "", mode: "", harness: "cursor", workspaces: [] });
|
|
39
|
-
expect(cursor.text()).toContain("Harness:");
|
|
40
|
-
expect(cursor.text()).toContain("Cursor");
|
|
41
|
-
|
|
42
|
-
// Native (explicit or defaulted) stays implicit, like agent mode.
|
|
43
|
-
const native = capture();
|
|
44
|
-
renderSessionHeader(native.out, { agentName: "", sessionId: "s", model: "", mode: "", harness: "native", workspaces: [] });
|
|
45
|
-
expect(native.text()).not.toContain("Harness:");
|
|
46
|
-
|
|
47
|
-
const unset = capture();
|
|
48
|
-
renderSessionHeader(unset.out, { agentName: "", sessionId: "s", model: "", mode: "", workspaces: [] });
|
|
49
|
-
expect(unset.text()).not.toContain("Harness:");
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it("indents extra workspaces under the first", () => {
|
|
53
|
-
const { out, text } = capture();
|
|
54
|
-
renderSessionHeader(out, {
|
|
55
|
-
agentName: "",
|
|
56
|
-
sessionId: "",
|
|
57
|
-
model: "",
|
|
58
|
-
mode: "",
|
|
59
|
-
workspaces: ["app", "infra"],
|
|
60
|
-
});
|
|
61
|
-
expect(text()).toBe("Workspaces: app\n infra\n\n");
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it("prints nothing when every field is empty", () => {
|
|
65
|
-
const { out, text } = capture();
|
|
66
|
-
renderSessionHeader(out, { agentName: "", sessionId: "", model: "", mode: "", workspaces: [] });
|
|
67
|
-
expect(text()).toBe("");
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
describe("workspaceNames", () => {
|
|
72
|
-
it("extracts the derived name from each entry", () => {
|
|
73
|
-
const entries = [
|
|
74
|
-
create(WorkspaceEntrySchema, { name: "app" }),
|
|
75
|
-
create(WorkspaceEntrySchema, { name: "infra" }),
|
|
76
|
-
];
|
|
77
|
-
expect(workspaceNames(entries)).toEqual(["app", "infra"]);
|
|
78
|
-
});
|
|
79
|
-
});
|