@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,107 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import {
|
|
3
|
-
hasResourceIdPrefix,
|
|
4
|
-
isAgentId,
|
|
5
|
-
isSessionId,
|
|
6
|
-
isWorkflowId,
|
|
7
|
-
parseReference,
|
|
8
|
-
validateResourceId,
|
|
9
|
-
} from "./reference.js";
|
|
10
|
-
|
|
11
|
-
// A syntactically valid 26-char ULID body for building complete IDs in tests.
|
|
12
|
-
const ULID = "01arz3ndektsv4rrffq69g5fav";
|
|
13
|
-
|
|
14
|
-
describe("parseReference", () => {
|
|
15
|
-
it("parses an org/slug pair", () => {
|
|
16
|
-
expect(parseReference("acme/my-agent", "default-org", "agt")).toEqual({
|
|
17
|
-
kind: "ref",
|
|
18
|
-
org: "acme",
|
|
19
|
-
slug: "my-agent",
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it("treats a bare id-prefixed token as an ID", () => {
|
|
24
|
-
expect(parseReference("agt_abc123", "acme", "agt")).toEqual({ kind: "id", id: "agt_abc123" });
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it("treats a bare token without the id prefix as a slug in the default org", () => {
|
|
28
|
-
expect(parseReference("my-agent", "acme", "agt")).toEqual({
|
|
29
|
-
kind: "ref",
|
|
30
|
-
org: "acme",
|
|
31
|
-
slug: "my-agent",
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it("does not mistake a slug that merely contains the prefix for an ID", () => {
|
|
36
|
-
// "agent-foo" starts with "agt"? no — prefix match requires "agt_".
|
|
37
|
-
expect(parseReference("agent-foo", "acme", "agt")).toEqual({
|
|
38
|
-
kind: "ref",
|
|
39
|
-
org: "acme",
|
|
40
|
-
slug: "agent-foo",
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it("trims surrounding whitespace", () => {
|
|
45
|
-
expect(parseReference(" acme/release ", "default", "wkf")).toEqual({
|
|
46
|
-
kind: "ref",
|
|
47
|
-
org: "acme",
|
|
48
|
-
slug: "release",
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it("falls back to a slug when no id prefix is configured", () => {
|
|
53
|
-
expect(parseReference("something", "acme", "")).toEqual({
|
|
54
|
-
kind: "ref",
|
|
55
|
-
org: "acme",
|
|
56
|
-
slug: "something",
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
describe("resource-ID classification", () => {
|
|
62
|
-
it("detects kind prefixes with either separator", () => {
|
|
63
|
-
expect(isAgentId(`agt_${ULID}`)).toBe(true);
|
|
64
|
-
expect(isAgentId(`agt-${ULID}`)).toBe(true);
|
|
65
|
-
expect(isSessionId(`ses_${ULID}`)).toBe(true);
|
|
66
|
-
expect(isWorkflowId(`wfl_${ULID}`)).toBe(true);
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it("does not classify cross-kind prefixes", () => {
|
|
70
|
-
expect(isAgentId(`ses_${ULID}`)).toBe(false);
|
|
71
|
-
expect(isSessionId(`agt_${ULID}`)).toBe(false);
|
|
72
|
-
expect(isWorkflowId(`agt_${ULID}`)).toBe(false);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it("does not mistake a slug that merely starts with a prefix for an ID", () => {
|
|
76
|
-
// "agent-foo" begins with "agt"? No — the separator must immediately follow.
|
|
77
|
-
expect(isAgentId("agent-foo")).toBe(false);
|
|
78
|
-
expect(hasResourceIdPrefix("agent-foo")).toBe(false);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it("is case-sensitive (uppercase prefixes are not IDs)", () => {
|
|
82
|
-
expect(isAgentId(`AGT_${ULID}`)).toBe(false);
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it("recognizes any known prefix via hasResourceIdPrefix (length-agnostic)", () => {
|
|
86
|
-
expect(hasResourceIdPrefix("agt_short")).toBe(true);
|
|
87
|
-
expect(hasResourceIdPrefix("wex_anything")).toBe(true);
|
|
88
|
-
expect(hasResourceIdPrefix("mcp-x")).toBe(true);
|
|
89
|
-
expect(hasResourceIdPrefix("plain-slug")).toBe(false);
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
it("validates a complete ID (prefix + 26-char ULID)", () => {
|
|
93
|
-
expect(validateResourceId(`agt_${ULID}`)).toBeNull();
|
|
94
|
-
expect(validateResourceId(`ses-${ULID}`)).toBeNull();
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it("reports an incomplete ID when the prefix matches but the body is wrong", () => {
|
|
98
|
-
expect(validateResourceId("agt_tooshort")).toMatch(/incomplete/);
|
|
99
|
-
expect(validateResourceId(`agt_${ULID}extra`)).toMatch(/incomplete/);
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
it("accepts a legacy UUID and rejects unrelated tokens", () => {
|
|
103
|
-
expect(validateResourceId("123e4567-e89b-12d3-a456-426614174000")).toBeNull();
|
|
104
|
-
expect(hasResourceIdPrefix("123e4567-e89b-12d3-a456-426614174000")).toBe(true);
|
|
105
|
-
expect(validateResourceId("just-a-slug")).toMatch(/not a recognized/);
|
|
106
|
-
});
|
|
107
|
-
});
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
// Orchestration tests for executeResolvedAgent: the one-call bootstrap
|
|
2
|
-
// contract (stigmer/stigmer#249). A workspace-bearing run must issue exactly
|
|
3
|
-
// one create RPC — the AgentExecution carrying session_spec — instead of the
|
|
4
|
-
// old session.create + agentExecution.create pair, and the flow must read the
|
|
5
|
-
// canonical session id back from the returned execution spec. The built-in
|
|
6
|
-
// assistant rides the same flow with no agent at all. Runs use detach mode
|
|
7
|
-
// so no streaming machinery is exercised.
|
|
8
|
-
|
|
9
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
10
|
-
import { create } from "@bufbuild/protobuf";
|
|
11
|
-
import type { Agent } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
12
|
-
import { AgentSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
13
|
-
import type { AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
14
|
-
import { ApprovalAction } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
15
|
-
import { Harness } from "@stigmer/protos/ai/stigmer/agentic/session/v1/enum_pb";
|
|
16
|
-
import {
|
|
17
|
-
LocalPathSourceSchema,
|
|
18
|
-
WorkspaceEntrySchema,
|
|
19
|
-
WorkspaceSourceSchema,
|
|
20
|
-
} from "@stigmer/protos/ai/stigmer/agentic/session/v1/workspace_pb";
|
|
21
|
-
import type { BackendClient } from "../../client/index.js";
|
|
22
|
-
import { executeResolvedAgent } from "./agent-exec.js";
|
|
23
|
-
import type { PreparedRun } from "./prepare.js";
|
|
24
|
-
|
|
25
|
-
const WORKSPACE_ENTRY = create(WorkspaceEntrySchema, {
|
|
26
|
-
name: "repo",
|
|
27
|
-
source: create(WorkspaceSourceSchema, {
|
|
28
|
-
source: { case: "localPath", value: create(LocalPathSourceSchema, { path: "/home/user/repo" }) },
|
|
29
|
-
}),
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
function makeAgent(): Agent {
|
|
33
|
-
return create(AgentSchema, {
|
|
34
|
-
metadata: { id: "agt_1", name: "helper" },
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function makePrepared(overrides: Partial<PreparedRun> = {}): PreparedRun {
|
|
39
|
-
return {
|
|
40
|
-
defaultAction: ApprovalAction.UNSPECIFIED,
|
|
41
|
-
workspaceEntries: [],
|
|
42
|
-
runtimeEnv: {},
|
|
43
|
-
attachments: [],
|
|
44
|
-
workspaceFileRefs: [],
|
|
45
|
-
message: "hi",
|
|
46
|
-
detach: true,
|
|
47
|
-
verbose: false,
|
|
48
|
-
model: "",
|
|
49
|
-
autoApproveAll: false,
|
|
50
|
-
mode: "",
|
|
51
|
-
serviceTier: "",
|
|
52
|
-
thinking: "",
|
|
53
|
-
harness: "",
|
|
54
|
-
...overrides,
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// A BackendClient double whose controller records every create call and
|
|
59
|
-
// emulates the server stamping the bootstrapped session id onto the returned
|
|
60
|
-
// execution spec.
|
|
61
|
-
function fakeBackend(): { client: BackendClient; creates: () => AgentExecution[] } {
|
|
62
|
-
const captured: AgentExecution[] = [];
|
|
63
|
-
const controller = () => ({
|
|
64
|
-
create: async (msg: AgentExecution) => {
|
|
65
|
-
captured.push(msg);
|
|
66
|
-
// Echo with the server-owned session id filled in, like the real backend.
|
|
67
|
-
return {
|
|
68
|
-
...msg,
|
|
69
|
-
spec: msg.spec === undefined ? undefined : { ...msg.spec, sessionId: "ses_srv" },
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
});
|
|
73
|
-
const client = { controller } as unknown as BackendClient;
|
|
74
|
-
return { client, creates: () => captured };
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Captured stderr lines (the header + re-attach hint in detach mode).
|
|
78
|
-
let stderrLines: string[];
|
|
79
|
-
|
|
80
|
-
beforeEach(() => {
|
|
81
|
-
stderrLines = [];
|
|
82
|
-
vi.spyOn(process.stderr, "write").mockImplementation((chunk) => {
|
|
83
|
-
stderrLines.push(String(chunk));
|
|
84
|
-
return true;
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
afterEach(() => {
|
|
89
|
-
vi.restoreAllMocks();
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
describe("executeResolvedAgent", () => {
|
|
93
|
-
it("issues exactly one create carrying session_spec for a workspace run", async () => {
|
|
94
|
-
const { client, creates } = fakeBackend();
|
|
95
|
-
|
|
96
|
-
await executeResolvedAgent({
|
|
97
|
-
agent: makeAgent(),
|
|
98
|
-
prepared: makePrepared({ workspaceEntries: [WORKSPACE_ENTRY] }),
|
|
99
|
-
org: "acme",
|
|
100
|
-
downloadDir: "",
|
|
101
|
-
outputMode: "inline",
|
|
102
|
-
client,
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
const sent = creates();
|
|
106
|
-
expect(sent, "a workspace run is a single AgentExecution create").toHaveLength(1);
|
|
107
|
-
expect(sent[0]?.spec?.agentId).toBe("agt_1");
|
|
108
|
-
expect(sent[0]?.spec?.sessionId, "no client-created session id").toBe("");
|
|
109
|
-
expect(sent[0]?.spec?.sessionSpec?.workspaceEntries).toEqual([WORKSPACE_ENTRY]);
|
|
110
|
-
|
|
111
|
-
// The canonical session id comes back on the execution spec and drives the
|
|
112
|
-
// re-attach hint.
|
|
113
|
-
expect(stderrLines.join("")).toContain("stigmer resume ses_srv");
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
it("issues one create with no session_spec when there is no workspace", async () => {
|
|
117
|
-
const { client, creates } = fakeBackend();
|
|
118
|
-
|
|
119
|
-
await executeResolvedAgent({
|
|
120
|
-
agent: makeAgent(),
|
|
121
|
-
prepared: makePrepared(),
|
|
122
|
-
org: "acme",
|
|
123
|
-
downloadDir: "",
|
|
124
|
-
outputMode: "inline",
|
|
125
|
-
client,
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
const sent = creates();
|
|
129
|
-
expect(sent).toHaveLength(1);
|
|
130
|
-
expect(sent[0]?.spec?.sessionSpec).toBeUndefined();
|
|
131
|
-
expect(sent[0]?.spec?.agentId).toBe("agt_1");
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
it("runs the built-in assistant with no agent: an all-empty target and the assistant's name in the header", async () => {
|
|
135
|
-
const { client, creates } = fakeBackend();
|
|
136
|
-
|
|
137
|
-
await executeResolvedAgent({
|
|
138
|
-
agent: undefined,
|
|
139
|
-
prepared: makePrepared({ detach: true }),
|
|
140
|
-
org: "acme",
|
|
141
|
-
downloadDir: "",
|
|
142
|
-
outputMode: "inline",
|
|
143
|
-
client,
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
const sent = creates();
|
|
147
|
-
expect(sent).toHaveLength(1);
|
|
148
|
-
// Neither an agent nor a session nor a session_spec instance: the backend
|
|
149
|
-
// creates a session with no agent and the runner answers as the assistant.
|
|
150
|
-
expect(sent[0]?.spec?.agentId).toBe("");
|
|
151
|
-
expect(sent[0]?.spec?.sessionId).toBe("");
|
|
152
|
-
expect(sent[0]?.spec?.sessionSpec?.agentInstanceId ?? "").toBe("");
|
|
153
|
-
expect(stderrLines.join("")).toContain("Assistant");
|
|
154
|
-
expect(stderrLines.join("")).toContain("stigmer resume ses_srv");
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
it("threads the resolved harness onto the wire and surfaces it in the header (oss#293)", async () => {
|
|
158
|
-
// The revert-detection seam: if the prepared→create threading is ever
|
|
159
|
-
// dropped, this wire assertion fails — not just a flag-parsing test.
|
|
160
|
-
const { client, creates } = fakeBackend();
|
|
161
|
-
|
|
162
|
-
await executeResolvedAgent({
|
|
163
|
-
agent: makeAgent(),
|
|
164
|
-
prepared: makePrepared({ harness: "cursor" }),
|
|
165
|
-
org: "acme",
|
|
166
|
-
downloadDir: "",
|
|
167
|
-
outputMode: "inline",
|
|
168
|
-
client,
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
const sent = creates();
|
|
172
|
-
expect(sent).toHaveLength(1);
|
|
173
|
-
expect(sent[0]?.spec?.sessionSpec?.harness).toBe(Harness.CURSOR);
|
|
174
|
-
// D2 visibility: a cursor session must announce itself before streaming —
|
|
175
|
-
// whether the flag or the account preference selected it.
|
|
176
|
-
expect(stderrLines.join("")).toContain("Harness:");
|
|
177
|
-
expect(stderrLines.join("")).toContain("Cursor");
|
|
178
|
-
});
|
|
179
|
-
});
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
// Unit tests for attachment processing: workspace-relative classification vs
|
|
2
|
-
// upload, directory zipping, MIME detection, and the size cap. The uploader is
|
|
3
|
-
// faked so no network is required.
|
|
4
|
-
|
|
5
|
-
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
6
|
-
import { tmpdir } from "node:os";
|
|
7
|
-
import { join } from "node:path";
|
|
8
|
-
import { create } from "@bufbuild/protobuf";
|
|
9
|
-
import { unzipSync } from "fflate";
|
|
10
|
-
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
11
|
-
import {
|
|
12
|
-
type UploadAttachmentRequest,
|
|
13
|
-
UploadAttachmentResponseSchema,
|
|
14
|
-
} from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/io_pb";
|
|
15
|
-
import { type AttachmentUploader, processAttachments } from "./attachments.js";
|
|
16
|
-
|
|
17
|
-
// Records each upload and returns a deterministic storage key.
|
|
18
|
-
class FakeUploader implements AttachmentUploader {
|
|
19
|
-
readonly uploads: UploadAttachmentRequest[] = [];
|
|
20
|
-
async uploadAttachment(req: UploadAttachmentRequest) {
|
|
21
|
-
this.uploads.push(req);
|
|
22
|
-
return create(UploadAttachmentResponseSchema, { storageKey: `attachments/key/${req.filename}` });
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
let dir: string;
|
|
27
|
-
let uploader: FakeUploader;
|
|
28
|
-
beforeEach(() => {
|
|
29
|
-
dir = mkdtempSync(join(tmpdir(), "attach-test-"));
|
|
30
|
-
uploader = new FakeUploader();
|
|
31
|
-
});
|
|
32
|
-
afterEach(() => {
|
|
33
|
-
rmSync(dir, { recursive: true, force: true });
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
describe("workspace-relative classification", () => {
|
|
37
|
-
it("records a file inside a workspace root as a relative ref (no upload)", async () => {
|
|
38
|
-
const root = join(dir, "repo");
|
|
39
|
-
mkdirSync(join(root, "src"), { recursive: true });
|
|
40
|
-
const file = join(root, "src", "main.ts");
|
|
41
|
-
writeFileSync(file, "x");
|
|
42
|
-
|
|
43
|
-
const result = await processAttachments(uploader, [file], [root]);
|
|
44
|
-
expect(result.workspaceFileRefs).toEqual(["src/main.ts"]);
|
|
45
|
-
expect(result.attachments).toHaveLength(0);
|
|
46
|
-
expect(uploader.uploads).toHaveLength(0);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it("uploads a file outside every workspace root", async () => {
|
|
50
|
-
const root = join(dir, "repo");
|
|
51
|
-
mkdirSync(root, { recursive: true });
|
|
52
|
-
const outside = join(dir, "outside.txt");
|
|
53
|
-
writeFileSync(outside, "data");
|
|
54
|
-
|
|
55
|
-
const result = await processAttachments(uploader, [outside], [root]);
|
|
56
|
-
expect(result.workspaceFileRefs).toHaveLength(0);
|
|
57
|
-
expect(result.attachments).toHaveLength(1);
|
|
58
|
-
expect(result.attachments[0].filename).toBe("outside.txt");
|
|
59
|
-
expect(result.attachments[0].contentType).toBe("text/plain");
|
|
60
|
-
expect(result.attachments[0].storageKey).toBe("attachments/key/outside.txt");
|
|
61
|
-
expect(result.attachments[0].localPath).toBe(outside);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
describe("file upload", () => {
|
|
66
|
-
it("uploads with no workspace roots configured", async () => {
|
|
67
|
-
const file = join(dir, "config.yaml");
|
|
68
|
-
writeFileSync(file, "a: 1\n");
|
|
69
|
-
const result = await processAttachments(uploader, [file], []);
|
|
70
|
-
expect(result.attachments).toHaveLength(1);
|
|
71
|
-
expect(result.attachments[0].contentType).toBe("application/x-yaml");
|
|
72
|
-
expect(uploader.uploads[0].filename).toBe("config.yaml");
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it("falls back to octet-stream for unknown extensions", async () => {
|
|
76
|
-
const file = join(dir, "blob.unknownext");
|
|
77
|
-
writeFileSync(file, "x");
|
|
78
|
-
const result = await processAttachments(uploader, [file], []);
|
|
79
|
-
expect(result.attachments[0].contentType).toBe("application/octet-stream");
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
it("errors on a missing file", async () => {
|
|
83
|
-
await expect(processAttachments(uploader, [join(dir, "nope.txt")], [])).rejects.toThrow(/file not found/);
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
describe("directory zipping", () => {
|
|
88
|
-
it("zips a directory, marks extract, and sets the mount path", async () => {
|
|
89
|
-
const subdir = join(dir, "bundle");
|
|
90
|
-
mkdirSync(join(subdir, "nested"), { recursive: true });
|
|
91
|
-
writeFileSync(join(subdir, "a.txt"), "aaa");
|
|
92
|
-
writeFileSync(join(subdir, "nested", "b.txt"), "bbb");
|
|
93
|
-
writeFileSync(join(subdir, ".hidden"), "secret"); // skipped
|
|
94
|
-
|
|
95
|
-
const result = await processAttachments(uploader, [subdir], []);
|
|
96
|
-
expect(result.attachments).toHaveLength(1);
|
|
97
|
-
const att = result.attachments[0];
|
|
98
|
-
expect(att.filename).toBe("bundle.zip");
|
|
99
|
-
expect(att.extract).toBe(true);
|
|
100
|
-
expect(att.mountPath).toBe("inputs/bundle/");
|
|
101
|
-
expect(att.contentType).toBe("application/zip");
|
|
102
|
-
|
|
103
|
-
const entries = Object.keys(unzipSync(uploader.uploads[0].content)).sort();
|
|
104
|
-
expect(entries).toEqual(["a.txt", "nested/b.txt"]);
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it("errors when a directory has no attachable files", async () => {
|
|
108
|
-
const empty = join(dir, "empty");
|
|
109
|
-
mkdirSync(empty);
|
|
110
|
-
writeFileSync(join(empty, ".hidden"), "x"); // only hidden -> nothing attachable
|
|
111
|
-
await expect(processAttachments(uploader, [empty], [])).rejects.toThrow(/no attachable files/);
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
it("uniquifies duplicate directory basenames so mount paths never contradict (issue #364)", async () => {
|
|
115
|
-
// Two dirs named `data` from different parents would otherwise derive the
|
|
116
|
-
// SAME explicit mount path, which the runner rejects as a contradiction.
|
|
117
|
-
const dirA = join(dir, "a", "data");
|
|
118
|
-
const dirB = join(dir, "b", "data");
|
|
119
|
-
mkdirSync(dirA, { recursive: true });
|
|
120
|
-
mkdirSync(dirB, { recursive: true });
|
|
121
|
-
writeFileSync(join(dirA, "one.txt"), "1");
|
|
122
|
-
writeFileSync(join(dirB, "two.txt"), "2");
|
|
123
|
-
|
|
124
|
-
const progress: string[] = [];
|
|
125
|
-
const result = await processAttachments(uploader, [dirA, dirB], [], (l) => progress.push(l));
|
|
126
|
-
|
|
127
|
-
expect(result.attachments).toHaveLength(2);
|
|
128
|
-
expect(result.attachments[0].filename).toBe("data.zip");
|
|
129
|
-
expect(result.attachments[0].mountPath).toBe("inputs/data/");
|
|
130
|
-
expect(result.attachments[1].filename).toBe("data-2.zip");
|
|
131
|
-
expect(result.attachments[1].mountPath).toBe("inputs/data-2/");
|
|
132
|
-
// The rename is disclosed to the user on the progress sink.
|
|
133
|
-
expect(progress.some((l) => l.includes("'data/'") && l.includes("'data-2/'"))).toBe(true);
|
|
134
|
-
});
|
|
135
|
-
});
|