@stigmer/cli 3.0.8
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/LICENSE +190 -0
- package/README.md +42 -0
- package/auth/auth0.d.ts +19 -0
- package/auth/auth0.d.ts.map +1 -0
- package/auth/auth0.js +39 -0
- package/auth/auth0.js.map +1 -0
- package/auth/callback-server.d.ts +18 -0
- package/auth/callback-server.d.ts.map +1 -0
- package/auth/callback-server.js +77 -0
- package/auth/callback-server.js.map +1 -0
- package/auth/index.d.ts +5 -0
- package/auth/index.d.ts.map +1 -0
- package/auth/index.js +6 -0
- package/auth/index.js.map +1 -0
- package/auth/login.d.ts +2 -0
- package/auth/login.d.ts.map +1 -0
- package/auth/login.js +56 -0
- package/auth/login.js.map +1 -0
- package/auth/pages.d.ts +7 -0
- package/auth/pages.d.ts.map +1 -0
- package/auth/pages.js +21 -0
- package/auth/pages.js.map +1 -0
- package/auth/pkce.d.ts +7 -0
- package/auth/pkce.d.ts.map +1 -0
- package/auth/pkce.js +22 -0
- package/auth/pkce.js.map +1 -0
- package/auth/token.d.ts +33 -0
- package/auth/token.d.ts.map +1 -0
- package/auth/token.js +111 -0
- package/auth/token.js.map +1 -0
- package/backend.d.ts +5 -0
- package/backend.d.ts.map +1 -0
- package/backend.js +14 -0
- package/backend.js.map +1 -0
- package/cli/stigmer.d.ts +3 -0
- package/cli/stigmer.d.ts.map +1 -0
- package/cli/stigmer.js +14 -0
- package/cli/stigmer.js.map +1 -0
- package/client/client.d.ts +25 -0
- package/client/client.d.ts.map +1 -0
- package/client/client.js +55 -0
- package/client/client.js.map +1 -0
- package/client/index.d.ts +2 -0
- package/client/index.d.ts.map +1 -0
- package/client/index.js +3 -0
- package/client/index.js.map +1 -0
- package/commands/agent-exec-flags.d.ts +30 -0
- package/commands/agent-exec-flags.d.ts.map +1 -0
- package/commands/agent-exec-flags.js +52 -0
- package/commands/agent-exec-flags.js.map +1 -0
- package/commands/apikey/duration.d.ts +2 -0
- package/commands/apikey/duration.d.ts.map +1 -0
- package/commands/apikey/duration.js +30 -0
- package/commands/apikey/duration.js.map +1 -0
- package/commands/apikey/index.d.ts +3 -0
- package/commands/apikey/index.d.ts.map +1 -0
- package/commands/apikey/index.js +118 -0
- package/commands/apikey/index.js.map +1 -0
- package/commands/apply.d.ts +3 -0
- package/commands/apply.d.ts.map +1 -0
- package/commands/apply.js +155 -0
- package/commands/apply.js.map +1 -0
- package/commands/auth/index.d.ts +3 -0
- package/commands/auth/index.d.ts.map +1 -0
- package/commands/auth/index.js +76 -0
- package/commands/auth/index.js.map +1 -0
- package/commands/completion.d.ts +3 -0
- package/commands/completion.d.ts.map +1 -0
- package/commands/completion.js +82 -0
- package/commands/completion.js.map +1 -0
- package/commands/config/backend.d.ts +3 -0
- package/commands/config/backend.d.ts.map +1 -0
- package/commands/config/backend.js +49 -0
- package/commands/config/backend.js.map +1 -0
- package/commands/config/context.d.ts +3 -0
- package/commands/config/context.d.ts.map +1 -0
- package/commands/config/context.js +23 -0
- package/commands/config/context.js.map +1 -0
- package/commands/config/index.d.ts +3 -0
- package/commands/config/index.d.ts.map +1 -0
- package/commands/config/index.js +13 -0
- package/commands/config/index.js.map +1 -0
- package/commands/config/kv.d.ts +3 -0
- package/commands/config/kv.d.ts.map +1 -0
- package/commands/config/kv.js +39 -0
- package/commands/config/kv.js.map +1 -0
- package/commands/connect.d.ts +3 -0
- package/commands/connect.d.ts.map +1 -0
- package/commands/connect.js +56 -0
- package/commands/connect.js.map +1 -0
- package/commands/delete.d.ts +3 -0
- package/commands/delete.d.ts.map +1 -0
- package/commands/delete.js +41 -0
- package/commands/delete.js.map +1 -0
- package/commands/diff.d.ts +3 -0
- package/commands/diff.d.ts.map +1 -0
- package/commands/diff.js +87 -0
- package/commands/diff.js.map +1 -0
- package/commands/down.d.ts +3 -0
- package/commands/down.d.ts.map +1 -0
- package/commands/down.js +23 -0
- package/commands/down.js.map +1 -0
- package/commands/download.d.ts +3 -0
- package/commands/download.d.ts.map +1 -0
- package/commands/download.js +46 -0
- package/commands/download.js.map +1 -0
- package/commands/draft.d.ts +3 -0
- package/commands/draft.d.ts.map +1 -0
- package/commands/draft.js +97 -0
- package/commands/draft.js.map +1 -0
- package/commands/execution/approve.d.ts +3 -0
- package/commands/execution/approve.d.ts.map +1 -0
- package/commands/execution/approve.js +60 -0
- package/commands/execution/approve.js.map +1 -0
- package/commands/execution/control.d.ts +3 -0
- package/commands/execution/control.d.ts.map +1 -0
- package/commands/execution/control.js +57 -0
- package/commands/execution/control.js.map +1 -0
- package/commands/execution/index.d.ts +3 -0
- package/commands/execution/index.d.ts.map +1 -0
- package/commands/execution/index.js +21 -0
- package/commands/execution/index.js.map +1 -0
- package/commands/execution/logs.d.ts +3 -0
- package/commands/execution/logs.d.ts.map +1 -0
- package/commands/execution/logs.js +34 -0
- package/commands/execution/logs.js.map +1 -0
- package/commands/execution/trace.d.ts +3 -0
- package/commands/execution/trace.d.ts.map +1 -0
- package/commands/execution/trace.js +24 -0
- package/commands/execution/trace.js.map +1 -0
- package/commands/get.d.ts +3 -0
- package/commands/get.d.ts.map +1 -0
- package/commands/get.js +81 -0
- package/commands/get.js.map +1 -0
- package/commands/internal-daemon.d.ts +3 -0
- package/commands/internal-daemon.d.ts.map +1 -0
- package/commands/internal-daemon.js +22 -0
- package/commands/internal-daemon.js.map +1 -0
- package/commands/list.d.ts +3 -0
- package/commands/list.d.ts.map +1 -0
- package/commands/list.js +117 -0
- package/commands/list.js.map +1 -0
- package/commands/logs.d.ts +3 -0
- package/commands/logs.d.ts.map +1 -0
- package/commands/logs.js +59 -0
- package/commands/logs.js.map +1 -0
- package/commands/mcp-server.d.ts +22 -0
- package/commands/mcp-server.d.ts.map +1 -0
- package/commands/mcp-server.js +104 -0
- package/commands/mcp-server.js.map +1 -0
- package/commands/push.d.ts +3 -0
- package/commands/push.d.ts.map +1 -0
- package/commands/push.js +150 -0
- package/commands/push.js.map +1 -0
- package/commands/reset.d.ts +3 -0
- package/commands/reset.d.ts.map +1 -0
- package/commands/reset.js +45 -0
- package/commands/reset.js.map +1 -0
- package/commands/resume.d.ts +3 -0
- package/commands/resume.d.ts.map +1 -0
- package/commands/resume.js +87 -0
- package/commands/resume.js.map +1 -0
- package/commands/run.d.ts +3 -0
- package/commands/run.d.ts.map +1 -0
- package/commands/run.js +193 -0
- package/commands/run.js.map +1 -0
- package/commands/search.d.ts +3 -0
- package/commands/search.d.ts.map +1 -0
- package/commands/search.js +73 -0
- package/commands/search.js.map +1 -0
- package/commands/seedpack.d.ts +3 -0
- package/commands/seedpack.d.ts.map +1 -0
- package/commands/seedpack.js +76 -0
- package/commands/seedpack.js.map +1 -0
- package/commands/setup.d.ts +3 -0
- package/commands/setup.d.ts.map +1 -0
- package/commands/setup.js +57 -0
- package/commands/setup.js.map +1 -0
- package/commands/shared.d.ts +15 -0
- package/commands/shared.d.ts.map +1 -0
- package/commands/shared.js +34 -0
- package/commands/shared.js.map +1 -0
- package/commands/status.d.ts +3 -0
- package/commands/status.d.ts.map +1 -0
- package/commands/status.js +18 -0
- package/commands/status.js.map +1 -0
- package/commands/tag.d.ts +3 -0
- package/commands/tag.d.ts.map +1 -0
- package/commands/tag.js +24 -0
- package/commands/tag.js.map +1 -0
- package/commands/up.d.ts +3 -0
- package/commands/up.d.ts.map +1 -0
- package/commands/up.js +39 -0
- package/commands/up.js.map +1 -0
- package/commands/usage.d.ts +3 -0
- package/commands/usage.d.ts.map +1 -0
- package/commands/usage.js +56 -0
- package/commands/usage.js.map +1 -0
- package/commands/validate.d.ts +3 -0
- package/commands/validate.d.ts.map +1 -0
- package/commands/validate.js +64 -0
- package/commands/validate.js.map +1 -0
- package/commands/version.d.ts +3 -0
- package/commands/version.d.ts.map +1 -0
- package/commands/version.js +11 -0
- package/commands/version.js.map +1 -0
- package/config/config.d.ts +39 -0
- package/config/config.d.ts.map +1 -0
- package/config/config.js +85 -0
- package/config/config.js.map +1 -0
- package/config/index.d.ts +5 -0
- package/config/index.d.ts.map +1 -0
- package/config/index.js +6 -0
- package/config/index.js.map +1 -0
- package/config/keys.d.ts +6 -0
- package/config/keys.d.ts.map +1 -0
- package/config/keys.js +53 -0
- package/config/keys.js.map +1 -0
- package/config/paths.d.ts +10 -0
- package/config/paths.d.ts.map +1 -0
- package/config/paths.js +21 -0
- package/config/paths.js.map +1 -0
- package/config/resolve.d.ts +33 -0
- package/config/resolve.d.ts.map +1 -0
- package/config/resolve.js +77 -0
- package/config/resolve.js.map +1 -0
- package/errors/classify.d.ts +17 -0
- package/errors/classify.d.ts.map +1 -0
- package/errors/classify.js +158 -0
- package/errors/classify.js.map +1 -0
- package/errors/cli-exit-error.d.ts +6 -0
- package/errors/cli-exit-error.d.ts.map +1 -0
- package/errors/cli-exit-error.js +15 -0
- package/errors/cli-exit-error.js.map +1 -0
- package/errors/exit-codes.d.ts +10 -0
- package/errors/exit-codes.d.ts.map +1 -0
- package/errors/exit-codes.js +12 -0
- package/errors/exit-codes.js.map +1 -0
- package/errors/handle.d.ts +14 -0
- package/errors/handle.d.ts.map +1 -0
- package/errors/handle.js +46 -0
- package/errors/handle.js.map +1 -0
- package/errors/index.d.ts +6 -0
- package/errors/index.d.ts.map +1 -0
- package/errors/index.js +7 -0
- package/errors/index.js.map +1 -0
- package/errors/usage-error.d.ts +5 -0
- package/errors/usage-error.d.ts.map +1 -0
- package/errors/usage-error.js +13 -0
- package/errors/usage-error.js.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +8 -0
- package/index.js.map +1 -0
- package/local/artifact.d.ts +38 -0
- package/local/artifact.d.ts.map +1 -0
- package/local/artifact.js +133 -0
- package/local/artifact.js.map +1 -0
- package/local/constants.d.ts +36 -0
- package/local/constants.d.ts.map +1 -0
- package/local/constants.js +44 -0
- package/local/constants.js.map +1 -0
- package/local/daemon/components.d.ts +20 -0
- package/local/daemon/components.d.ts.map +1 -0
- package/local/daemon/components.js +105 -0
- package/local/daemon/components.js.map +1 -0
- package/local/daemon/env.d.ts +55 -0
- package/local/daemon/env.d.ts.map +1 -0
- package/local/daemon/env.js +82 -0
- package/local/daemon/env.js.map +1 -0
- package/local/daemon/host.d.ts +7 -0
- package/local/daemon/host.d.ts.map +1 -0
- package/local/daemon/host.js +74 -0
- package/local/daemon/host.js.map +1 -0
- package/local/daemon/index.d.ts +8 -0
- package/local/daemon/index.d.ts.map +1 -0
- package/local/daemon/index.js +8 -0
- package/local/daemon/index.js.map +1 -0
- package/local/daemon/launch.d.ts +11 -0
- package/local/daemon/launch.d.ts.map +1 -0
- package/local/daemon/launch.js +219 -0
- package/local/daemon/launch.js.map +1 -0
- package/local/daemon/process.d.ts +28 -0
- package/local/daemon/process.d.ts.map +1 -0
- package/local/daemon/process.js +149 -0
- package/local/daemon/process.js.map +1 -0
- package/local/daemon/supervisor.d.ts +56 -0
- package/local/daemon/supervisor.d.ts.map +1 -0
- package/local/daemon/supervisor.js +211 -0
- package/local/daemon/supervisor.js.map +1 -0
- package/local/daemon/types.d.ts +63 -0
- package/local/daemon/types.d.ts.map +1 -0
- package/local/daemon/types.js +9 -0
- package/local/daemon/types.js.map +1 -0
- package/local/llm-config.d.ts +30 -0
- package/local/llm-config.d.ts.map +1 -0
- package/local/llm-config.js +93 -0
- package/local/llm-config.js.map +1 -0
- package/local/logs/tail.d.ts +19 -0
- package/local/logs/tail.d.ts.map +1 -0
- package/local/logs/tail.js +86 -0
- package/local/logs/tail.js.map +1 -0
- package/local/logs/view.d.ts +20 -0
- package/local/logs/view.d.ts.map +1 -0
- package/local/logs/view.js +50 -0
- package/local/logs/view.js.map +1 -0
- package/local/net/tcp.d.ts +23 -0
- package/local/net/tcp.d.ts.map +1 -0
- package/local/net/tcp.js +47 -0
- package/local/net/tcp.js.map +1 -0
- package/local/paths.d.ts +26 -0
- package/local/paths.d.ts.map +1 -0
- package/local/paths.js +57 -0
- package/local/paths.js.map +1 -0
- package/local/reset.d.ts +14 -0
- package/local/reset.d.ts.map +1 -0
- package/local/reset.js +57 -0
- package/local/reset.js.map +1 -0
- package/local/runtime/index.d.ts +5 -0
- package/local/runtime/index.d.ts.map +1 -0
- package/local/runtime/index.js +6 -0
- package/local/runtime/index.js.map +1 -0
- package/local/runtime/node.d.ts +8 -0
- package/local/runtime/node.d.ts.map +1 -0
- package/local/runtime/node.js +59 -0
- package/local/runtime/node.js.map +1 -0
- package/local/runtime/runner.d.ts +40 -0
- package/local/runtime/runner.d.ts.map +1 -0
- package/local/runtime/runner.js +154 -0
- package/local/runtime/runner.js.map +1 -0
- package/local/runtime/server.d.ts +39 -0
- package/local/runtime/server.d.ts.map +1 -0
- package/local/runtime/server.js +141 -0
- package/local/runtime/server.js.map +1 -0
- package/local/runtime/which.d.ts +3 -0
- package/local/runtime/which.d.ts.map +1 -0
- package/local/runtime/which.js +30 -0
- package/local/runtime/which.js.map +1 -0
- package/local/seedpack/apply.d.ts +43 -0
- package/local/seedpack/apply.d.ts.map +1 -0
- package/local/seedpack/apply.js +94 -0
- package/local/seedpack/apply.js.map +1 -0
- package/local/seedpack/content.d.ts +56 -0
- package/local/seedpack/content.d.ts.map +1 -0
- package/local/seedpack/content.js +201 -0
- package/local/seedpack/content.js.map +1 -0
- package/local/setup/prompt.d.ts +8 -0
- package/local/setup/prompt.d.ts.map +1 -0
- package/local/setup/prompt.js +63 -0
- package/local/setup/prompt.js.map +1 -0
- package/local/setup/wizard.d.ts +22 -0
- package/local/setup/wizard.d.ts.map +1 -0
- package/local/setup/wizard.js +65 -0
- package/local/setup/wizard.js.map +1 -0
- package/local/state/health-state.d.ts +26 -0
- package/local/state/health-state.d.ts.map +1 -0
- package/local/state/health-state.js +34 -0
- package/local/state/health-state.js.map +1 -0
- package/local/state/index.d.ts +7 -0
- package/local/state/index.d.ts.map +1 -0
- package/local/state/index.js +8 -0
- package/local/state/index.js.map +1 -0
- package/local/state/lock.d.ts +12 -0
- package/local/state/lock.d.ts.map +1 -0
- package/local/state/lock.js +70 -0
- package/local/state/lock.js.map +1 -0
- package/local/state/log-rotation.d.ts +17 -0
- package/local/state/log-rotation.d.ts.map +1 -0
- package/local/state/log-rotation.js +101 -0
- package/local/state/log-rotation.js.map +1 -0
- package/local/state/pidfile.d.ts +11 -0
- package/local/state/pidfile.d.ts.map +1 -0
- package/local/state/pidfile.js +35 -0
- package/local/state/pidfile.js.map +1 -0
- package/local/state/proc.d.ts +16 -0
- package/local/state/proc.d.ts.map +1 -0
- package/local/state/proc.js +69 -0
- package/local/state/proc.js.map +1 -0
- package/local/state/startup-config.d.ts +23 -0
- package/local/state/startup-config.d.ts.map +1 -0
- package/local/state/startup-config.js +33 -0
- package/local/state/startup-config.js.map +1 -0
- package/local/status.d.ts +9 -0
- package/local/status.d.ts.map +1 -0
- package/local/status.js +168 -0
- package/local/status.js.map +1 -0
- package/local/temporal/download.d.ts +20 -0
- package/local/temporal/download.d.ts.map +1 -0
- package/local/temporal/download.js +36 -0
- package/local/temporal/download.js.map +1 -0
- package/local/temporal/index.d.ts +5 -0
- package/local/temporal/index.d.ts.map +1 -0
- package/local/temporal/index.js +6 -0
- package/local/temporal/index.js.map +1 -0
- package/local/temporal/inspect.d.ts +8 -0
- package/local/temporal/inspect.d.ts.map +1 -0
- package/local/temporal/inspect.js +33 -0
- package/local/temporal/inspect.js.map +1 -0
- package/local/temporal/manager.d.ts +50 -0
- package/local/temporal/manager.d.ts.map +1 -0
- package/local/temporal/manager.js +208 -0
- package/local/temporal/manager.js.map +1 -0
- package/local/temporal/supervisor.d.ts +34 -0
- package/local/temporal/supervisor.d.ts.map +1 -0
- package/local/temporal/supervisor.js +83 -0
- package/local/temporal/supervisor.js.map +1 -0
- package/local/webconsole/index.d.ts +4 -0
- package/local/webconsole/index.d.ts.map +1 -0
- package/local/webconsole/index.js +13 -0
- package/local/webconsole/index.js.map +1 -0
- package/logger.d.ts +13 -0
- package/logger.d.ts.map +1 -0
- package/logger.js +35 -0
- package/logger.js.map +1 -0
- package/output/command-result.d.ts +47 -0
- package/output/command-result.d.ts.map +1 -0
- package/output/command-result.js +134 -0
- package/output/command-result.js.map +1 -0
- package/output/confirm.d.ts +22 -0
- package/output/confirm.d.ts.map +1 -0
- package/output/confirm.js +42 -0
- package/output/confirm.js.map +1 -0
- package/output/format.d.ts +22 -0
- package/output/format.d.ts.map +1 -0
- package/output/format.js +72 -0
- package/output/format.js.map +1 -0
- package/output/index.d.ts +7 -0
- package/output/index.d.ts.map +1 -0
- package/output/index.js +8 -0
- package/output/index.js.map +1 -0
- package/output/ndjson.d.ts +24 -0
- package/output/ndjson.d.ts.map +1 -0
- package/output/ndjson.js +38 -0
- package/output/ndjson.js.map +1 -0
- package/output/proto.d.ts +12 -0
- package/output/proto.d.ts.map +1 -0
- package/output/proto.js +34 -0
- package/output/proto.js.map +1 -0
- package/output/style.d.ts +19 -0
- package/output/style.d.ts.map +1 -0
- package/output/style.js +44 -0
- package/output/style.js.map +1 -0
- package/output/table.d.ts +5 -0
- package/output/table.d.ts.map +1 -0
- package/output/table.js +43 -0
- package/output/table.js.map +1 -0
- package/package.json +49 -0
- package/program.d.ts +3 -0
- package/program.d.ts.map +1 -0
- package/program.js +95 -0
- package/program.js.map +1 -0
- package/registry/aliases.d.ts +18 -0
- package/registry/aliases.d.ts.map +1 -0
- package/registry/aliases.js +85 -0
- package/registry/aliases.js.map +1 -0
- package/registry/index.d.ts +6 -0
- package/registry/index.d.ts.map +1 -0
- package/registry/index.js +7 -0
- package/registry/index.js.map +1 -0
- package/registry/metadata.d.ts +12 -0
- package/registry/metadata.d.ts.map +1 -0
- package/registry/metadata.js +49 -0
- package/registry/metadata.js.map +1 -0
- package/registry/registry.d.ts +39 -0
- package/registry/registry.d.ts.map +1 -0
- package/registry/registry.js +59 -0
- package/registry/registry.js.map +1 -0
- package/registry/verb-support.d.ts +5 -0
- package/registry/verb-support.d.ts.map +1 -0
- package/registry/verb-support.js +48 -0
- package/registry/verb-support.js.map +1 -0
- package/registry/verbs.d.ts +16 -0
- package/registry/verbs.d.ts.map +1 -0
- package/registry/verbs.js +36 -0
- package/registry/verbs.js.map +1 -0
- package/resources/apply/apply.d.ts +55 -0
- package/resources/apply/apply.d.ts.map +1 -0
- package/resources/apply/apply.js +163 -0
- package/resources/apply/apply.js.map +1 -0
- package/resources/apply/declarative.d.ts +106 -0
- package/resources/apply/declarative.d.ts.map +1 -0
- package/resources/apply/declarative.js +378 -0
- package/resources/apply/declarative.js.map +1 -0
- package/resources/apply/discovery.d.ts +7 -0
- package/resources/apply/discovery.d.ts.map +1 -0
- package/resources/apply/discovery.js +47 -0
- package/resources/apply/discovery.js.map +1 -0
- package/resources/apply/handlers.d.ts +15 -0
- package/resources/apply/handlers.d.ts.map +1 -0
- package/resources/apply/handlers.js +126 -0
- package/resources/apply/handlers.js.map +1 -0
- package/resources/apply/synth/project-track.d.ts +21 -0
- package/resources/apply/synth/project-track.d.ts.map +1 -0
- package/resources/apply/synth/project-track.js +102 -0
- package/resources/apply/synth/project-track.js.map +1 -0
- package/resources/apply/synth/reader.d.ts +18 -0
- package/resources/apply/synth/reader.d.ts.map +1 -0
- package/resources/apply/synth/reader.js +55 -0
- package/resources/apply/synth/reader.js.map +1 -0
- package/resources/apply/synth/runtime.d.ts +8 -0
- package/resources/apply/synth/runtime.d.ts.map +1 -0
- package/resources/apply/synth/runtime.js +32 -0
- package/resources/apply/synth/runtime.js.map +1 -0
- package/resources/apply/synth/synthesize.d.ts +43 -0
- package/resources/apply/synth/synthesize.d.ts.map +1 -0
- package/resources/apply/synth/synthesize.js +115 -0
- package/resources/apply/synth/synthesize.js.map +1 -0
- package/resources/connect/connect.d.ts +24 -0
- package/resources/connect/connect.d.ts.map +1 -0
- package/resources/connect/connect.js +71 -0
- package/resources/connect/connect.js.map +1 -0
- package/resources/connect/discover.d.ts +5 -0
- package/resources/connect/discover.d.ts.map +1 -0
- package/resources/connect/discover.js +100 -0
- package/resources/connect/discover.js.map +1 -0
- package/resources/connect/display.d.ts +5 -0
- package/resources/connect/display.d.ts.map +1 -0
- package/resources/connect/display.js +58 -0
- package/resources/connect/display.js.map +1 -0
- package/resources/connect/oauth.d.ts +45 -0
- package/resources/connect/oauth.d.ts.map +1 -0
- package/resources/connect/oauth.js +152 -0
- package/resources/connect/oauth.js.map +1 -0
- package/resources/delete.d.ts +18 -0
- package/resources/delete.d.ts.map +1 -0
- package/resources/delete.js +180 -0
- package/resources/delete.js.map +1 -0
- package/resources/diff.d.ts +16 -0
- package/resources/diff.d.ts.map +1 -0
- package/resources/diff.js +158 -0
- package/resources/diff.js.map +1 -0
- package/resources/documents.d.ts +16 -0
- package/resources/documents.d.ts.map +1 -0
- package/resources/documents.js +89 -0
- package/resources/documents.js.map +1 -0
- package/resources/download.d.ts +16 -0
- package/resources/download.d.ts.map +1 -0
- package/resources/download.js +107 -0
- package/resources/download.js.map +1 -0
- package/resources/execution-approve.d.ts +26 -0
- package/resources/execution-approve.d.ts.map +1 -0
- package/resources/execution-approve.js +69 -0
- package/resources/execution-approve.js.map +1 -0
- package/resources/execution-control.d.ts +16 -0
- package/resources/execution-control.d.ts.map +1 -0
- package/resources/execution-control.js +57 -0
- package/resources/execution-control.js.map +1 -0
- package/resources/execution-format.d.ts +12 -0
- package/resources/execution-format.d.ts.map +1 -0
- package/resources/execution-format.js +56 -0
- package/resources/execution-format.js.map +1 -0
- package/resources/execution-logs.d.ts +16 -0
- package/resources/execution-logs.d.ts.map +1 -0
- package/resources/execution-logs.js +132 -0
- package/resources/execution-logs.js.map +1 -0
- package/resources/execution-trace.d.ts +10 -0
- package/resources/execution-trace.d.ts.map +1 -0
- package/resources/execution-trace.js +125 -0
- package/resources/execution-trace.js.map +1 -0
- package/resources/execution.d.ts +59 -0
- package/resources/execution.d.ts.map +1 -0
- package/resources/execution.js +192 -0
- package/resources/execution.js.map +1 -0
- package/resources/get-bindings.d.ts +12 -0
- package/resources/get-bindings.d.ts.map +1 -0
- package/resources/get-bindings.js +40 -0
- package/resources/get-bindings.js.map +1 -0
- package/resources/get.d.ts +6 -0
- package/resources/get.d.ts.map +1 -0
- package/resources/get.js +31 -0
- package/resources/get.js.map +1 -0
- package/resources/git.d.ts +15 -0
- package/resources/git.d.ts.map +1 -0
- package/resources/git.js +69 -0
- package/resources/git.js.map +1 -0
- package/resources/ignore/defaults.d.ts +2 -0
- package/resources/ignore/defaults.d.ts.map +1 -0
- package/resources/ignore/defaults.js +140 -0
- package/resources/ignore/defaults.js.map +1 -0
- package/resources/ignore/index.d.ts +5 -0
- package/resources/ignore/index.d.ts.map +1 -0
- package/resources/ignore/index.js +6 -0
- package/resources/ignore/index.js.map +1 -0
- package/resources/ignore/match.d.ts +3 -0
- package/resources/ignore/match.d.ts.map +1 -0
- package/resources/ignore/match.js +166 -0
- package/resources/ignore/match.js.map +1 -0
- package/resources/ignore/matcher.d.ts +44 -0
- package/resources/ignore/matcher.d.ts.map +1 -0
- package/resources/ignore/matcher.js +125 -0
- package/resources/ignore/matcher.js.map +1 -0
- package/resources/ignore/pattern.d.ts +13 -0
- package/resources/ignore/pattern.d.ts.map +1 -0
- package/resources/ignore/pattern.js +118 -0
- package/resources/ignore/pattern.js.map +1 -0
- package/resources/list.d.ts +7 -0
- package/resources/list.d.ts.map +1 -0
- package/resources/list.js +82 -0
- package/resources/list.js.map +1 -0
- package/resources/mcp/runtime-env.d.ts +23 -0
- package/resources/mcp/runtime-env.d.ts.map +1 -0
- package/resources/mcp/runtime-env.js +68 -0
- package/resources/mcp/runtime-env.js.map +1 -0
- package/resources/picker/ink.d.ts +35 -0
- package/resources/picker/ink.d.ts.map +1 -0
- package/resources/picker/ink.js +45 -0
- package/resources/picker/ink.js.map +1 -0
- package/resources/picker/tty.d.ts +19 -0
- package/resources/picker/tty.d.ts.map +1 -0
- package/resources/picker/tty.js +21 -0
- package/resources/picker/tty.js.map +1 -0
- package/resources/reference.d.ts +32 -0
- package/resources/reference.d.ts.map +1 -0
- package/resources/reference.js +128 -0
- package/resources/reference.js.map +1 -0
- package/resources/render.d.ts +28 -0
- package/resources/render.d.ts.map +1 -0
- package/resources/render.js +87 -0
- package/resources/render.js.map +1 -0
- package/resources/run/agent-exec.d.ts +15 -0
- package/resources/run/agent-exec.d.ts.map +1 -0
- package/resources/run/agent-exec.js +81 -0
- package/resources/run/agent-exec.js.map +1 -0
- package/resources/run/attachments.d.ts +24 -0
- package/resources/run/attachments.d.ts.map +1 -0
- package/resources/run/attachments.js +209 -0
- package/resources/run/attachments.js.map +1 -0
- package/resources/run/create.d.ts +56 -0
- package/resources/run/create.d.ts.map +1 -0
- package/resources/run/create.js +105 -0
- package/resources/run/create.js.map +1 -0
- package/resources/run/env.d.ts +18 -0
- package/resources/run/env.d.ts.map +1 -0
- package/resources/run/env.js +147 -0
- package/resources/run/env.js.map +1 -0
- package/resources/run/epilogue.d.ts +9 -0
- package/resources/run/epilogue.d.ts.map +1 -0
- package/resources/run/epilogue.js +144 -0
- package/resources/run/epilogue.js.map +1 -0
- package/resources/run/header.d.ts +23 -0
- package/resources/run/header.d.ts.map +1 -0
- package/resources/run/header.js +51 -0
- package/resources/run/header.js.map +1 -0
- package/resources/run/prepare.d.ts +60 -0
- package/resources/run/prepare.d.ts.map +1 -0
- package/resources/run/prepare.js +78 -0
- package/resources/run/prepare.js.map +1 -0
- package/resources/run/resolve.d.ts +8 -0
- package/resources/run/resolve.d.ts.map +1 -0
- package/resources/run/resolve.js +28 -0
- package/resources/run/resolve.js.map +1 -0
- package/resources/run/resume.d.ts +13 -0
- package/resources/run/resume.d.ts.map +1 -0
- package/resources/run/resume.js +94 -0
- package/resources/run/resume.js.map +1 -0
- package/resources/run/stream.d.ts +24 -0
- package/resources/run/stream.d.ts.map +1 -0
- package/resources/run/stream.js +80 -0
- package/resources/run/stream.js.map +1 -0
- package/resources/run/workflow-stream.d.ts +25 -0
- package/resources/run/workflow-stream.d.ts.map +1 -0
- package/resources/run/workflow-stream.js +152 -0
- package/resources/run/workflow-stream.js.map +1 -0
- package/resources/run/workspace.d.ts +17 -0
- package/resources/run/workspace.d.ts.map +1 -0
- package/resources/run/workspace.js +147 -0
- package/resources/run/workspace.js.map +1 -0
- package/resources/search.d.ts +22 -0
- package/resources/search.d.ts.map +1 -0
- package/resources/search.js +23 -0
- package/resources/search.js.map +1 -0
- package/resources/session.d.ts +19 -0
- package/resources/session.d.ts.map +1 -0
- package/resources/session.js +51 -0
- package/resources/session.js.map +1 -0
- package/resources/skill.d.ts +84 -0
- package/resources/skill.d.ts.map +1 -0
- package/resources/skill.js +342 -0
- package/resources/skill.js.map +1 -0
- package/resources/stream/approval-detect.d.ts +38 -0
- package/resources/stream/approval-detect.d.ts.map +1 -0
- package/resources/stream/approval-detect.js +93 -0
- package/resources/stream/approval-detect.js.map +1 -0
- package/resources/stream/convert.d.ts +38 -0
- package/resources/stream/convert.d.ts.map +1 -0
- package/resources/stream/convert.js +178 -0
- package/resources/stream/convert.js.map +1 -0
- package/resources/stream/diff.d.ts +29 -0
- package/resources/stream/diff.d.ts.map +1 -0
- package/resources/stream/diff.js +214 -0
- package/resources/stream/diff.js.map +1 -0
- package/resources/stream/events.d.ts +137 -0
- package/resources/stream/events.d.ts.map +1 -0
- package/resources/stream/events.js +15 -0
- package/resources/stream/events.js.map +1 -0
- package/resources/stream/headless.d.ts +38 -0
- package/resources/stream/headless.d.ts.map +1 -0
- package/resources/stream/headless.js +75 -0
- package/resources/stream/headless.js.map +1 -0
- package/resources/stream/ink.d.ts +22 -0
- package/resources/stream/ink.d.ts.map +1 -0
- package/resources/stream/ink.js +24 -0
- package/resources/stream/ink.js.map +1 -0
- package/resources/stream/render-ndjson.d.ts +25 -0
- package/resources/stream/render-ndjson.d.ts.map +1 -0
- package/resources/stream/render-ndjson.js +156 -0
- package/resources/stream/render-ndjson.js.map +1 -0
- package/resources/stream/render-plaintext.d.ts +18 -0
- package/resources/stream/render-plaintext.d.ts.map +1 -0
- package/resources/stream/render-plaintext.js +71 -0
- package/resources/stream/render-plaintext.js.map +1 -0
- package/resources/stream/snapshot.d.ts +8 -0
- package/resources/stream/snapshot.d.ts.map +1 -0
- package/resources/stream/snapshot.js +163 -0
- package/resources/stream/snapshot.js.map +1 -0
- package/resources/stream/subagent.d.ts +12 -0
- package/resources/stream/subagent.d.ts.map +1 -0
- package/resources/stream/subagent.js +76 -0
- package/resources/stream/subagent.js.map +1 -0
- package/resources/stream/submit.d.ts +20 -0
- package/resources/stream/submit.d.ts.map +1 -0
- package/resources/stream/submit.js +125 -0
- package/resources/stream/submit.js.map +1 -0
- package/resources/stream/todo.d.ts +11 -0
- package/resources/stream/todo.d.ts.map +1 -0
- package/resources/stream/todo.js +44 -0
- package/resources/stream/todo.js.map +1 -0
- package/resources/stream/tool-state.d.ts +31 -0
- package/resources/stream/tool-state.d.ts.map +1 -0
- package/resources/stream/tool-state.js +126 -0
- package/resources/stream/tool-state.js.map +1 -0
- package/resources/stream/tty.d.ts +8 -0
- package/resources/stream/tty.d.ts.map +1 -0
- package/resources/stream/tty.js +15 -0
- package/resources/stream/tty.js.map +1 -0
- package/resources/stream/workflow-event-view.d.ts +21 -0
- package/resources/stream/workflow-event-view.d.ts.map +1 -0
- package/resources/stream/workflow-event-view.js +88 -0
- package/resources/stream/workflow-event-view.js.map +1 -0
- package/resources/stream/workflow-render-ndjson.d.ts +5 -0
- package/resources/stream/workflow-render-ndjson.d.ts.map +1 -0
- package/resources/stream/workflow-render-ndjson.js +54 -0
- package/resources/stream/workflow-render-ndjson.js.map +1 -0
- package/resources/stream/workflow-render-plaintext.d.ts +8 -0
- package/resources/stream/workflow-render-plaintext.d.ts.map +1 -0
- package/resources/stream/workflow-render-plaintext.js +34 -0
- package/resources/stream/workflow-render-plaintext.js.map +1 -0
- package/resources/tag.d.ts +4 -0
- package/resources/tag.d.ts.map +1 -0
- package/resources/tag.js +36 -0
- package/resources/tag.js.map +1 -0
- package/resources/usage.d.ts +14 -0
- package/resources/usage.d.ts.map +1 -0
- package/resources/usage.js +251 -0
- package/resources/usage.js.map +1 -0
- package/resources/validate.d.ts +6 -0
- package/resources/validate.d.ts.map +1 -0
- package/resources/validate.js +28 -0
- package/resources/validate.js.map +1 -0
- package/resources/version.d.ts +6 -0
- package/resources/version.d.ts.map +1 -0
- package/resources/version.js +75 -0
- package/resources/version.js.map +1 -0
- package/runtime.d.ts +5 -0
- package/runtime.d.ts.map +1 -0
- package/runtime.js +19 -0
- package/runtime.js.map +1 -0
- package/src/auth/auth0.ts +43 -0
- package/src/auth/callback-server.ts +104 -0
- package/src/auth/index.ts +6 -0
- package/src/auth/login.ts +61 -0
- package/src/auth/pages.ts +31 -0
- package/src/auth/pkce.test.ts +37 -0
- package/src/auth/pkce.ts +26 -0
- package/src/auth/token.test.ts +95 -0
- package/src/auth/token.ts +135 -0
- package/src/backend.ts +15 -0
- package/src/cli/stigmer.ts +16 -0
- package/src/client/client.test.ts +46 -0
- package/src/client/client.ts +84 -0
- package/src/client/index.ts +3 -0
- package/src/commands/agent-exec-flags.ts +75 -0
- package/src/commands/apikey/duration.test.ts +23 -0
- package/src/commands/apikey/duration.ts +35 -0
- package/src/commands/apikey/index.ts +133 -0
- package/src/commands/apply.ts +213 -0
- package/src/commands/auth/index.ts +87 -0
- package/src/commands/completion.ts +96 -0
- package/src/commands/config/backend.ts +58 -0
- package/src/commands/config/context.ts +26 -0
- package/src/commands/config/index.ts +18 -0
- package/src/commands/config/kv.ts +44 -0
- package/src/commands/connect.ts +75 -0
- package/src/commands/delete.ts +56 -0
- package/src/commands/diff.ts +97 -0
- package/src/commands/down.ts +27 -0
- package/src/commands/download.ts +68 -0
- package/src/commands/draft.ts +128 -0
- package/src/commands/execution/approve.ts +76 -0
- package/src/commands/execution/control.ts +79 -0
- package/src/commands/execution/index.ts +24 -0
- package/src/commands/execution/logs.ts +47 -0
- package/src/commands/execution/trace.ts +32 -0
- package/src/commands/get.ts +99 -0
- package/src/commands/internal-daemon.ts +25 -0
- package/src/commands/list.ts +138 -0
- package/src/commands/logs.ts +73 -0
- package/src/commands/mcp-server.test.ts +65 -0
- package/src/commands/mcp-server.ts +124 -0
- package/src/commands/push.ts +205 -0
- package/src/commands/reset.ts +57 -0
- package/src/commands/resume.ts +121 -0
- package/src/commands/run.ts +276 -0
- package/src/commands/search.ts +90 -0
- package/src/commands/seedpack.ts +94 -0
- package/src/commands/setup.ts +71 -0
- package/src/commands/shared.ts +41 -0
- package/src/commands/status.ts +20 -0
- package/src/commands/tag.ts +31 -0
- package/src/commands/up.ts +51 -0
- package/src/commands/usage.ts +74 -0
- package/src/commands/validate.test.ts +79 -0
- package/src/commands/validate.ts +73 -0
- package/src/commands/version.ts +13 -0
- package/src/config/config.test.ts +76 -0
- package/src/config/config.ts +127 -0
- package/src/config/index.ts +22 -0
- package/src/config/keys.test.ts +38 -0
- package/src/config/keys.ts +64 -0
- package/src/config/paths.ts +25 -0
- package/src/config/resolve.test.ts +103 -0
- package/src/config/resolve.ts +80 -0
- package/src/errors/classify.ts +199 -0
- package/src/errors/cli-exit-error.ts +16 -0
- package/src/errors/clierr.test.ts +172 -0
- package/src/errors/exit-codes.ts +14 -0
- package/src/errors/handle.ts +53 -0
- package/src/errors/index.ts +7 -0
- package/src/errors/usage-error.ts +14 -0
- package/src/index.ts +8 -0
- package/src/local/artifact.test.ts +28 -0
- package/src/local/artifact.ts +166 -0
- package/src/local/constants.ts +52 -0
- package/src/local/daemon/components.test.ts +80 -0
- package/src/local/daemon/components.ts +113 -0
- package/src/local/daemon/daemon.integration.test.ts +183 -0
- package/src/local/daemon/env.test.ts +51 -0
- package/src/local/daemon/env.ts +118 -0
- package/src/local/daemon/host.ts +79 -0
- package/src/local/daemon/index.ts +18 -0
- package/src/local/daemon/launch.ts +260 -0
- package/src/local/daemon/process.ts +183 -0
- package/src/local/daemon/supervisor.test.ts +260 -0
- package/src/local/daemon/supervisor.ts +249 -0
- package/src/local/daemon/types.ts +76 -0
- package/src/local/llm-config.test.ts +80 -0
- package/src/local/llm-config.ts +107 -0
- package/src/local/logs/tail.test.ts +70 -0
- package/src/local/logs/tail.ts +100 -0
- package/src/local/logs/view.test.ts +46 -0
- package/src/local/logs/view.ts +65 -0
- package/src/local/net/tcp.ts +65 -0
- package/src/local/paths.ts +67 -0
- package/src/local/reset.test.ts +53 -0
- package/src/local/reset.ts +90 -0
- package/src/local/runtime/index.ts +18 -0
- package/src/local/runtime/node.ts +67 -0
- package/src/local/runtime/runner.ts +186 -0
- package/src/local/runtime/runtime.test.ts +155 -0
- package/src/local/runtime/server.test.ts +152 -0
- package/src/local/runtime/server.ts +172 -0
- package/src/local/runtime/which.ts +30 -0
- package/src/local/seedpack/apply.test.ts +166 -0
- package/src/local/seedpack/apply.ts +139 -0
- package/src/local/seedpack/content.test.ts +148 -0
- package/src/local/seedpack/content.ts +223 -0
- package/src/local/setup/prompt.ts +70 -0
- package/src/local/setup/wizard.test.ts +42 -0
- package/src/local/setup/wizard.ts +78 -0
- package/src/local/state/health-state.ts +55 -0
- package/src/local/state/index.ts +8 -0
- package/src/local/state/lock.ts +77 -0
- package/src/local/state/log-rotation.ts +112 -0
- package/src/local/state/pidfile.ts +37 -0
- package/src/local/state/proc.ts +66 -0
- package/src/local/state/startup-config.ts +51 -0
- package/src/local/state/state.test.ts +166 -0
- package/src/local/status.test.ts +88 -0
- package/src/local/status.ts +186 -0
- package/src/local/temporal/download.test.ts +64 -0
- package/src/local/temporal/download.ts +54 -0
- package/src/local/temporal/index.ts +6 -0
- package/src/local/temporal/inspect.ts +32 -0
- package/src/local/temporal/manager.test.ts +31 -0
- package/src/local/temporal/manager.ts +247 -0
- package/src/local/temporal/supervisor.test.ts +77 -0
- package/src/local/temporal/supervisor.ts +97 -0
- package/src/local/webconsole/index.ts +13 -0
- package/src/logger.ts +39 -0
- package/src/output/command-result.test.ts +64 -0
- package/src/output/command-result.ts +185 -0
- package/src/output/confirm.test.ts +43 -0
- package/src/output/confirm.ts +53 -0
- package/src/output/format.test.ts +65 -0
- package/src/output/format.ts +101 -0
- package/src/output/index.ts +30 -0
- package/src/output/ndjson.ts +55 -0
- package/src/output/proto.test.ts +72 -0
- package/src/output/proto.ts +55 -0
- package/src/output/style.ts +57 -0
- package/src/output/table.test.ts +37 -0
- package/src/output/table.ts +52 -0
- package/src/program.test.ts +64 -0
- package/src/program.ts +100 -0
- package/src/registry/aliases.test.ts +99 -0
- package/src/registry/aliases.ts +93 -0
- package/src/registry/index.ts +7 -0
- package/src/registry/metadata.ts +60 -0
- package/src/registry/registry.test.ts +80 -0
- package/src/registry/registry.ts +101 -0
- package/src/registry/verb-support.ts +50 -0
- package/src/registry/verbs.ts +43 -0
- package/src/resources/apply/apply.integration.test.ts +207 -0
- package/src/resources/apply/apply.ts +202 -0
- package/src/resources/apply/declarative.integration.test.ts +126 -0
- package/src/resources/apply/declarative.test.ts +132 -0
- package/src/resources/apply/declarative.ts +474 -0
- package/src/resources/apply/discovery.ts +60 -0
- package/src/resources/apply/handlers.ts +145 -0
- package/src/resources/apply/synth/capstone.integration.test.ts +134 -0
- package/src/resources/apply/synth/project-track.integration.test.ts +194 -0
- package/src/resources/apply/synth/project-track.ts +126 -0
- package/src/resources/apply/synth/reader.test.ts +90 -0
- package/src/resources/apply/synth/reader.ts +68 -0
- package/src/resources/apply/synth/runtime.test.ts +29 -0
- package/src/resources/apply/synth/runtime.ts +39 -0
- package/src/resources/apply/synth/synthesize.test.ts +109 -0
- package/src/resources/apply/synth/synthesize.ts +161 -0
- package/src/resources/connect/__fixtures__/stdio-crash.mjs +6 -0
- package/src/resources/connect/__fixtures__/stdio-server.mjs +43 -0
- package/src/resources/connect/connect.integration.test.ts +185 -0
- package/src/resources/connect/connect.ts +107 -0
- package/src/resources/connect/discover.test.ts +45 -0
- package/src/resources/connect/discover.ts +125 -0
- package/src/resources/connect/display.ts +68 -0
- package/src/resources/connect/oauth.test.ts +155 -0
- package/src/resources/connect/oauth.ts +191 -0
- package/src/resources/delete.ts +239 -0
- package/src/resources/diff.integration.test.ts +103 -0
- package/src/resources/diff.test.ts +34 -0
- package/src/resources/diff.ts +187 -0
- package/src/resources/documents.test.ts +67 -0
- package/src/resources/documents.ts +102 -0
- package/src/resources/download.ts +151 -0
- package/src/resources/execution-approve.test.ts +50 -0
- package/src/resources/execution-approve.ts +94 -0
- package/src/resources/execution-control.ts +78 -0
- package/src/resources/execution-format.test.ts +48 -0
- package/src/resources/execution-format.ts +54 -0
- package/src/resources/execution-logs.ts +176 -0
- package/src/resources/execution-trace.ts +159 -0
- package/src/resources/execution.integration.test.ts +285 -0
- package/src/resources/execution.test.ts +138 -0
- package/src/resources/execution.ts +229 -0
- package/src/resources/get-bindings.ts +61 -0
- package/src/resources/get.ts +41 -0
- package/src/resources/git.ts +71 -0
- package/src/resources/ignore/defaults.ts +155 -0
- package/src/resources/ignore/ignore.test.ts +139 -0
- package/src/resources/ignore/index.ts +17 -0
- package/src/resources/ignore/match.ts +158 -0
- package/src/resources/ignore/matcher.ts +158 -0
- package/src/resources/ignore/pattern.ts +131 -0
- package/src/resources/list.ts +97 -0
- package/src/resources/mcp/runtime-env.test.ts +68 -0
- package/src/resources/mcp/runtime-env.ts +79 -0
- package/src/resources/mutate-verbs.integration.test.ts +233 -0
- package/src/resources/picker/ink.tsx +114 -0
- package/src/resources/picker/tty.test.ts +37 -0
- package/src/resources/picker/tty.ts +30 -0
- package/src/resources/push-download.integration.test.ts +175 -0
- package/src/resources/read-completion.integration.test.ts +156 -0
- package/src/resources/read-verbs.integration.test.ts +164 -0
- package/src/resources/reference.test.ts +107 -0
- package/src/resources/reference.ts +140 -0
- package/src/resources/render.ts +118 -0
- package/src/resources/run/agent-exec.ts +107 -0
- package/src/resources/run/attachments.test.ts +113 -0
- package/src/resources/run/attachments.ts +261 -0
- package/src/resources/run/create.test.ts +119 -0
- package/src/resources/run/create.ts +165 -0
- package/src/resources/run/env.test.ts +131 -0
- package/src/resources/run/env.ts +167 -0
- package/src/resources/run/epilogue.ts +166 -0
- package/src/resources/run/header.test.ts +61 -0
- package/src/resources/run/header.ts +62 -0
- package/src/resources/run/prepare.test.ts +92 -0
- package/src/resources/run/prepare.ts +139 -0
- package/src/resources/run/resolve.ts +32 -0
- package/src/resources/run/resume.ts +119 -0
- package/src/resources/run/stream.ts +108 -0
- package/src/resources/run/workflow-stream.integration.test.ts +157 -0
- package/src/resources/run/workflow-stream.ts +203 -0
- package/src/resources/run/workspace.test.ts +93 -0
- package/src/resources/run/workspace.ts +171 -0
- package/src/resources/search.ts +53 -0
- package/src/resources/session.test.ts +48 -0
- package/src/resources/session.ts +66 -0
- package/src/resources/skill.test.ts +227 -0
- package/src/resources/skill.ts +451 -0
- package/src/resources/stream/approval-detect.ts +118 -0
- package/src/resources/stream/convert.ts +210 -0
- package/src/resources/stream/diff.test.ts +316 -0
- package/src/resources/stream/diff.ts +254 -0
- package/src/resources/stream/events.ts +193 -0
- package/src/resources/stream/headless.test.ts +119 -0
- package/src/resources/stream/headless.ts +112 -0
- package/src/resources/stream/ink.tsx +56 -0
- package/src/resources/stream/lazy-import.test.ts +63 -0
- package/src/resources/stream/render-ndjson.test.ts +116 -0
- package/src/resources/stream/render-ndjson.ts +176 -0
- package/src/resources/stream/render-plaintext.test.ts +68 -0
- package/src/resources/stream/render-plaintext.ts +86 -0
- package/src/resources/stream/snapshot.test.ts +97 -0
- package/src/resources/stream/snapshot.ts +191 -0
- package/src/resources/stream/subagent.ts +104 -0
- package/src/resources/stream/submit.test.ts +77 -0
- package/src/resources/stream/submit.ts +137 -0
- package/src/resources/stream/todo.ts +53 -0
- package/src/resources/stream/tool-state.ts +142 -0
- package/src/resources/stream/tty.ts +14 -0
- package/src/resources/stream/workflow-event-view.test.ts +116 -0
- package/src/resources/stream/workflow-event-view.ts +111 -0
- package/src/resources/stream/workflow-render-ndjson.ts +61 -0
- package/src/resources/stream/workflow-render-plaintext.ts +43 -0
- package/src/resources/stream/workflow-render.test.ts +81 -0
- package/src/resources/tag.ts +50 -0
- package/src/resources/usage.test.ts +94 -0
- package/src/resources/usage.ts +301 -0
- package/src/resources/validate.test.ts +54 -0
- package/src/resources/validate.ts +31 -0
- package/src/resources/version.ts +105 -0
- package/src/runtime.ts +23 -0
- package/src/types/marked-terminal.d.ts +31 -0
- package/src/version.ts +46 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +45 -0
- package/version.js.map +1 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
// Structured command output. Instead of ad-hoc console writes, mutating
|
|
2
|
+
// commands build a CommandResult (status + message + sections + hints), then a
|
|
3
|
+
// renderer formats it for human, JSON, or quiet output. Mirrors the Go CLI's
|
|
4
|
+
// pkg/clioutput.
|
|
5
|
+
//
|
|
6
|
+
// Stream discipline: JSON data goes to stdout (so pipes capture only the
|
|
7
|
+
// payload); human and quiet status lines go to stderr.
|
|
8
|
+
|
|
9
|
+
import type { OutputFormat } from "./format.js";
|
|
10
|
+
import { shouldColorize, styler } from "./style.js";
|
|
11
|
+
|
|
12
|
+
export type ResultStatus = "success" | "warning" | "error";
|
|
13
|
+
|
|
14
|
+
export interface KeyValue {
|
|
15
|
+
readonly key: string;
|
|
16
|
+
readonly value: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** A group of related fields/items under an optional title. */
|
|
20
|
+
export class Section {
|
|
21
|
+
readonly title: string;
|
|
22
|
+
readonly fields: KeyValue[] = [];
|
|
23
|
+
readonly items: string[] = [];
|
|
24
|
+
|
|
25
|
+
constructor(title: string) {
|
|
26
|
+
this.title = title;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
field(key: string, value: string): this {
|
|
30
|
+
this.fields.push({ key, value });
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
item(text: string): this {
|
|
35
|
+
this.items.push(text);
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** The structured outcome of a command. Build via the static factories. */
|
|
41
|
+
export class CommandResult {
|
|
42
|
+
readonly status: ResultStatus;
|
|
43
|
+
readonly message: string;
|
|
44
|
+
readonly sections: Section[] = [];
|
|
45
|
+
readonly hints: string[] = [];
|
|
46
|
+
|
|
47
|
+
private constructor(status: ResultStatus, message: string) {
|
|
48
|
+
this.status = status;
|
|
49
|
+
this.message = message;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static success(message: string): CommandResult {
|
|
53
|
+
return new CommandResult("success", message);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
static warning(message: string): CommandResult {
|
|
57
|
+
return new CommandResult("warning", message);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
static error(message: string): CommandResult {
|
|
61
|
+
return new CommandResult("error", message);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
addSection(title = ""): Section {
|
|
65
|
+
const section = new Section(title);
|
|
66
|
+
this.sections.push(section);
|
|
67
|
+
return section;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
hint(text: string): this {
|
|
71
|
+
this.hints.push(text);
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const ICONS: Record<ResultStatus, string> = {
|
|
77
|
+
success: "✓",
|
|
78
|
+
warning: "⚠",
|
|
79
|
+
error: "✗",
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
interface JsonResult {
|
|
83
|
+
status: string;
|
|
84
|
+
message: string;
|
|
85
|
+
sections?: JsonSection[];
|
|
86
|
+
hints?: string[];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
interface JsonSection {
|
|
90
|
+
title?: string;
|
|
91
|
+
fields?: KeyValue[];
|
|
92
|
+
items?: string[];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** JSON form of a CommandResult (omits empty sections/hints), newline-terminated. */
|
|
96
|
+
export function resultToJson(result: CommandResult): string {
|
|
97
|
+
const out: JsonResult = { status: result.status, message: result.message };
|
|
98
|
+
|
|
99
|
+
if (result.sections.length > 0) {
|
|
100
|
+
out.sections = result.sections.map((section) => {
|
|
101
|
+
const jsonSection: JsonSection = {};
|
|
102
|
+
if (section.title !== "") jsonSection.title = section.title;
|
|
103
|
+
if (section.fields.length > 0) {
|
|
104
|
+
jsonSection.fields = section.fields.map((field) => ({ key: field.key, value: field.value }));
|
|
105
|
+
}
|
|
106
|
+
if (section.items.length > 0) jsonSection.items = [...section.items];
|
|
107
|
+
return jsonSection;
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (result.hints.length > 0) out.hints = [...result.hints];
|
|
112
|
+
|
|
113
|
+
return JSON.stringify(out, null, 2) + "\n";
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** Colored, structured human form, newline-terminated. */
|
|
117
|
+
export function resultToHuman(result: CommandResult, colorize: boolean): string {
|
|
118
|
+
const style = styler(colorize);
|
|
119
|
+
const lines: string[] = [statusLine(result, colorize)];
|
|
120
|
+
|
|
121
|
+
for (const section of result.sections) {
|
|
122
|
+
lines.push("");
|
|
123
|
+
if (section.title !== "") lines.push(style.bold(`${section.title}:`));
|
|
124
|
+
|
|
125
|
+
if (section.fields.length > 0) {
|
|
126
|
+
const widestKey = Math.max(...section.fields.map((field) => field.key.length));
|
|
127
|
+
for (const field of section.fields) {
|
|
128
|
+
const padding = " ".repeat(widestKey - field.key.length + 4);
|
|
129
|
+
lines.push(` ${style.dim(field.key)}${padding}${field.value}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
for (const item of section.items) lines.push(` - ${item}`);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (result.hints.length > 0) {
|
|
137
|
+
lines.push("");
|
|
138
|
+
for (const hint of result.hints) lines.push(` ${style.dim(hint)}`);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return lines.join("\n") + "\n";
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** Status line only — for scripting where pass/fail is all that matters. */
|
|
145
|
+
export function resultToQuiet(result: CommandResult, colorize: boolean): string {
|
|
146
|
+
return statusLine(result, colorize) + "\n";
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function statusLine(result: CommandResult, colorize: boolean): string {
|
|
150
|
+
const style = styler(colorize);
|
|
151
|
+
const text = `${ICONS[result.status]} ${result.message}`;
|
|
152
|
+
switch (result.status) {
|
|
153
|
+
case "success":
|
|
154
|
+
return style.green(text);
|
|
155
|
+
case "warning":
|
|
156
|
+
return style.yellow(text);
|
|
157
|
+
case "error":
|
|
158
|
+
return style.red(text);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** A pair of writable streams; defaults to the process std streams. */
|
|
163
|
+
export interface ResultStreams {
|
|
164
|
+
readonly stdout: { write(chunk: string): unknown };
|
|
165
|
+
readonly stderr: { write(chunk: string): unknown; isTTY?: boolean };
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const DEFAULT_STREAMS: ResultStreams = { stdout: process.stdout, stderr: process.stderr };
|
|
169
|
+
|
|
170
|
+
/** Render a CommandResult to the appropriate stream for the resolved format. */
|
|
171
|
+
export function renderResult(
|
|
172
|
+
result: CommandResult,
|
|
173
|
+
format: OutputFormat,
|
|
174
|
+
streams: ResultStreams = DEFAULT_STREAMS,
|
|
175
|
+
): void {
|
|
176
|
+
if (format === "json") {
|
|
177
|
+
streams.stdout.write(resultToJson(result));
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
if (format === "quiet") {
|
|
181
|
+
streams.stderr.write(resultToQuiet(result, shouldColorize(streams.stderr)));
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
streams.stderr.write(resultToHuman(result, shouldColorize(streams.stderr)));
|
|
185
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { PassThrough } from "node:stream";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { confirm } from "./confirm.js";
|
|
4
|
+
|
|
5
|
+
// A PassThrough masquerading as an interactive TTY input, with a writable sink
|
|
6
|
+
// for the prompt text we don't need to inspect.
|
|
7
|
+
function ttyPair(isTTY: boolean): { input: NodeJS.ReadStream; output: NodeJS.WritableStream } {
|
|
8
|
+
const input = new PassThrough();
|
|
9
|
+
(input as unknown as { isTTY: boolean }).isTTY = isTTY;
|
|
10
|
+
return { input: input as unknown as NodeJS.ReadStream, output: new PassThrough() };
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async function answer(reply: string): Promise<boolean> {
|
|
14
|
+
const { input, output } = ttyPair(true);
|
|
15
|
+
const pending = confirm("Proceed? [y/N]", { input, output });
|
|
16
|
+
(input as unknown as PassThrough).write(`${reply}\n`);
|
|
17
|
+
return pending;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
describe("confirm", () => {
|
|
21
|
+
it("auto-confirms when forced, without reading input", async () => {
|
|
22
|
+
expect(await confirm("Proceed? [y/N]", { force: true })).toBe(true);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("refuses (no prompt) when input is not a TTY", async () => {
|
|
26
|
+
const { input, output } = ttyPair(false);
|
|
27
|
+
expect(await confirm("Proceed? [y/N]", { input, output })).toBe(false);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it.each([
|
|
31
|
+
["y", true],
|
|
32
|
+
["Y", true],
|
|
33
|
+
["yes", true],
|
|
34
|
+
["YES", true],
|
|
35
|
+
[" y ", true],
|
|
36
|
+
["n", false],
|
|
37
|
+
["no", false],
|
|
38
|
+
["", false],
|
|
39
|
+
["nope", false],
|
|
40
|
+
])("interprets %j as %s", async (reply, expected) => {
|
|
41
|
+
expect(await answer(reply)).toBe(expected);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Interactive yes/no confirmation for destructive commands. Mirrors the Go
|
|
2
|
+
// CLI's clioutput.Confirmer: a `--force` flag (or a non-interactive stderr)
|
|
3
|
+
// auto-confirms, so scripts, pipes, and CI never hang waiting on a TTY prompt.
|
|
4
|
+
//
|
|
5
|
+
// Lives in `output/` to match Go's pkg/clioutput placement — the prompt is part
|
|
6
|
+
// of the human output contract (it writes to stderr, alongside warning panels),
|
|
7
|
+
// not part of any resource's transport logic.
|
|
8
|
+
|
|
9
|
+
import { createInterface } from "node:readline";
|
|
10
|
+
|
|
11
|
+
export interface ConfirmOptions {
|
|
12
|
+
/** When true, skip the prompt and return true immediately (`--force`). */
|
|
13
|
+
readonly force?: boolean;
|
|
14
|
+
/** Input stream to read the answer from. Defaults to process.stdin. */
|
|
15
|
+
readonly input?: NodeJS.ReadStream;
|
|
16
|
+
/** Output stream the prompt is written to. Defaults to process.stderr. */
|
|
17
|
+
readonly output?: NodeJS.WritableStream;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Ask the user to confirm a destructive action. Returns true to proceed.
|
|
22
|
+
*
|
|
23
|
+
* Resolution order:
|
|
24
|
+
* - `--force` → true (no prompt)
|
|
25
|
+
* - non-interactive TTY → false (refuse rather than block a pipe/CI run)
|
|
26
|
+
* - interactive → true only for an explicit yes ("y"/"yes")
|
|
27
|
+
*
|
|
28
|
+
* The default-no posture matches the "[y/N]" prompt: anything that is not an
|
|
29
|
+
* affirmative answer aborts, which is the safe outcome for an irreversible
|
|
30
|
+
* operation.
|
|
31
|
+
*/
|
|
32
|
+
export async function confirm(prompt: string, options: ConfirmOptions = {}): Promise<boolean> {
|
|
33
|
+
if (options.force === true) return true;
|
|
34
|
+
|
|
35
|
+
const input = options.input ?? process.stdin;
|
|
36
|
+
const output = options.output ?? process.stderr;
|
|
37
|
+
|
|
38
|
+
// Without a TTY there is no one to answer; refuse rather than hang. Callers
|
|
39
|
+
// that need unattended deletes pass `--force`.
|
|
40
|
+
if (input.isTTY !== true) return false;
|
|
41
|
+
|
|
42
|
+
const rl = createInterface({ input, output });
|
|
43
|
+
try {
|
|
44
|
+
const answer = await new Promise<string>((resolve) => rl.question(`${prompt} `, resolve));
|
|
45
|
+
return isAffirmative(answer);
|
|
46
|
+
} finally {
|
|
47
|
+
rl.close();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function isAffirmative(answer: string): boolean {
|
|
52
|
+
return /^y(es)?$/i.test(answer.trim());
|
|
53
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { UsageError } from "../errors/usage-error.js";
|
|
3
|
+
import { resolveFormat, supportedFormats } from "./format.js";
|
|
4
|
+
|
|
5
|
+
describe("resolveFormat — defaults per command class", () => {
|
|
6
|
+
it("defaults reads to table", () => {
|
|
7
|
+
expect(resolveFormat({}, "read")).toBe("table");
|
|
8
|
+
});
|
|
9
|
+
it("defaults mutations to human", () => {
|
|
10
|
+
expect(resolveFormat({}, "mutating")).toBe("human");
|
|
11
|
+
});
|
|
12
|
+
it("defaults streaming to inline", () => {
|
|
13
|
+
expect(resolveFormat({}, "streaming")).toBe("inline");
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
describe("resolveFormat — --json alias resolves per class", () => {
|
|
18
|
+
it("maps --json to json for reads", () => {
|
|
19
|
+
expect(resolveFormat({ json: true }, "read")).toBe("json");
|
|
20
|
+
});
|
|
21
|
+
it("maps --json to json for mutations", () => {
|
|
22
|
+
expect(resolveFormat({ json: true }, "mutating")).toBe("json");
|
|
23
|
+
});
|
|
24
|
+
it("maps --json to ndjson for streaming", () => {
|
|
25
|
+
expect(resolveFormat({ json: true }, "streaming")).toBe("ndjson");
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe("resolveFormat — --quiet alias", () => {
|
|
30
|
+
it("maps --quiet to quiet for mutations", () => {
|
|
31
|
+
expect(resolveFormat({ quiet: true }, "mutating")).toBe("quiet");
|
|
32
|
+
});
|
|
33
|
+
it("rejects --json together with --quiet", () => {
|
|
34
|
+
expect(() => resolveFormat({ json: true, quiet: true }, "mutating")).toThrow(UsageError);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe("resolveFormat — explicit -o/--output", () => {
|
|
39
|
+
it("maps universal table -> human for mutations", () => {
|
|
40
|
+
expect(resolveFormat({ output: "table" }, "mutating")).toBe("human");
|
|
41
|
+
});
|
|
42
|
+
it("maps universal table -> inline for streaming", () => {
|
|
43
|
+
expect(resolveFormat({ output: "table" }, "streaming")).toBe("inline");
|
|
44
|
+
});
|
|
45
|
+
it("accepts yaml for reads", () => {
|
|
46
|
+
expect(resolveFormat({ output: "yaml" }, "read")).toBe("yaml");
|
|
47
|
+
});
|
|
48
|
+
it("is case-insensitive", () => {
|
|
49
|
+
expect(resolveFormat({ output: "JSON" }, "read")).toBe("json");
|
|
50
|
+
});
|
|
51
|
+
it("rejects an unknown universal value", () => {
|
|
52
|
+
expect(() => resolveFormat({ output: "xml" }, "read")).toThrow(/invalid --output value/);
|
|
53
|
+
});
|
|
54
|
+
it("rejects yaml for mutations (unsupported by the class)", () => {
|
|
55
|
+
expect(() => resolveFormat({ output: "yaml" }, "mutating")).toThrow(/not supported/);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
describe("supportedFormats", () => {
|
|
60
|
+
it("lists the universal values each class supports", () => {
|
|
61
|
+
expect(supportedFormats("read")).toEqual(["table", "json", "yaml"]);
|
|
62
|
+
expect(supportedFormats("mutating")).toEqual(["table", "json"]);
|
|
63
|
+
expect(supportedFormats("streaming")).toEqual(["table", "json", "ndjson"]);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// Unified output-format resolution.
|
|
2
|
+
//
|
|
3
|
+
// The Go CLI grew three inconsistent output conventions (D-CLI-2): reads used
|
|
4
|
+
// `-o table|json|yaml`, mutations used `--json`/`--quiet`, and streaming used
|
|
5
|
+
// `--json` for NDJSON. The TS CLI unifies the *surface* on a single
|
|
6
|
+
// `-o/--output` flag with one universal vocabulary — table | json | yaml |
|
|
7
|
+
// ndjson — and keeps `--json`/`--quiet` as back-compat aliases.
|
|
8
|
+
//
|
|
9
|
+
// The *meaning* of each universal value adapts to the command's class so a
|
|
10
|
+
// single mental model ("json = machine-readable") works everywhere:
|
|
11
|
+
//
|
|
12
|
+
// universal | read | mutating | streaming
|
|
13
|
+
// ----------|--------|----------|----------
|
|
14
|
+
// table | table | human | inline
|
|
15
|
+
// json | json | json | ndjson
|
|
16
|
+
// yaml | yaml | — | —
|
|
17
|
+
// ndjson | — | — | ndjson
|
|
18
|
+
// --json | json | json | ndjson
|
|
19
|
+
// --quiet | — | quiet | —
|
|
20
|
+
|
|
21
|
+
import { UsageError } from "../errors/usage-error.js";
|
|
22
|
+
|
|
23
|
+
/** Internal format the renderers consume, after class-aware resolution. */
|
|
24
|
+
export type OutputFormat = "table" | "json" | "yaml" | "human" | "quiet" | "ndjson" | "inline";
|
|
25
|
+
|
|
26
|
+
/** Output behavior class a command belongs to. */
|
|
27
|
+
export type CommandClass = "read" | "mutating" | "streaming";
|
|
28
|
+
|
|
29
|
+
/** Raw output-selection flags as parsed from the command line. */
|
|
30
|
+
export interface OutputFlags {
|
|
31
|
+
readonly output?: string;
|
|
32
|
+
readonly json?: boolean;
|
|
33
|
+
readonly quiet?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const UNIVERSAL_FORMATS = ["table", "json", "yaml", "ndjson"] as const;
|
|
37
|
+
type UniversalFormat = (typeof UNIVERSAL_FORMATS)[number];
|
|
38
|
+
|
|
39
|
+
// Maps the universal vocabulary onto each class's internal renderer format.
|
|
40
|
+
// A missing entry means that universal value is not supported by the class.
|
|
41
|
+
const CLASS_FORMAT_MAP: Record<CommandClass, Partial<Record<UniversalFormat, OutputFormat>>> = {
|
|
42
|
+
read: { table: "table", json: "json", yaml: "yaml" },
|
|
43
|
+
mutating: { table: "human", json: "json" },
|
|
44
|
+
streaming: { table: "inline", json: "ndjson", ndjson: "ndjson" },
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const DEFAULT_FORMAT: Record<CommandClass, OutputFormat> = {
|
|
48
|
+
read: "table",
|
|
49
|
+
mutating: "human",
|
|
50
|
+
streaming: "inline",
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Resolve the explicit/alias output flags into a single renderer format,
|
|
55
|
+
* honoring the command class's defaults and supported values. Throws a
|
|
56
|
+
* UsageError (exit code 2) on conflicting or unsupported selections.
|
|
57
|
+
*/
|
|
58
|
+
export function resolveFormat(flags: OutputFlags, commandClass: CommandClass): OutputFormat {
|
|
59
|
+
if (flags.json === true && flags.quiet === true) {
|
|
60
|
+
throw new UsageError("--json and --quiet cannot be used together");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (flags.output !== undefined && flags.output !== "") {
|
|
64
|
+
return resolveExplicit(flags.output, commandClass);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (flags.quiet === true) {
|
|
68
|
+
return "quiet";
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (flags.json === true) {
|
|
72
|
+
return CLASS_FORMAT_MAP[commandClass].json ?? "json";
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return DEFAULT_FORMAT[commandClass];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function resolveExplicit(raw: string, commandClass: CommandClass): OutputFormat {
|
|
79
|
+
const value = raw.toLowerCase();
|
|
80
|
+
if (!isUniversalFormat(value)) {
|
|
81
|
+
throw new UsageError(
|
|
82
|
+
`invalid --output value "${raw}" (expected one of: ${UNIVERSAL_FORMATS.join(", ")})`,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
const mapped = CLASS_FORMAT_MAP[commandClass][value];
|
|
86
|
+
if (mapped === undefined) {
|
|
87
|
+
throw new UsageError(
|
|
88
|
+
`--output ${value} is not supported by this command (supported: ${supportedFormats(commandClass).join(", ")})`,
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
return mapped;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** The universal output values a given command class supports, for help/errors. */
|
|
95
|
+
export function supportedFormats(commandClass: CommandClass): UniversalFormat[] {
|
|
96
|
+
return UNIVERSAL_FORMATS.filter((value) => CLASS_FORMAT_MAP[commandClass][value] !== undefined);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function isUniversalFormat(value: string): value is UniversalFormat {
|
|
100
|
+
return (UNIVERSAL_FORMATS as readonly string[]).includes(value);
|
|
101
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Public surface of the CLI output module.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
type CommandClass,
|
|
5
|
+
type OutputFlags,
|
|
6
|
+
type OutputFormat,
|
|
7
|
+
resolveFormat,
|
|
8
|
+
supportedFormats,
|
|
9
|
+
} from "./format.js";
|
|
10
|
+
export {
|
|
11
|
+
protoToJsonValue,
|
|
12
|
+
renderProtoJson,
|
|
13
|
+
renderProtoListJson,
|
|
14
|
+
renderProtoListYaml,
|
|
15
|
+
renderProtoYaml,
|
|
16
|
+
} from "./proto.js";
|
|
17
|
+
export { renderEmpty, renderTable } from "./table.js";
|
|
18
|
+
export {
|
|
19
|
+
CommandResult,
|
|
20
|
+
type KeyValue,
|
|
21
|
+
renderResult,
|
|
22
|
+
type ResultStatus,
|
|
23
|
+
type ResultStreams,
|
|
24
|
+
resultToHuman,
|
|
25
|
+
resultToJson,
|
|
26
|
+
resultToQuiet,
|
|
27
|
+
Section,
|
|
28
|
+
} from "./command-result.js";
|
|
29
|
+
export { type NdjsonEvent, ndjsonLine, writeNdjson } from "./ndjson.js";
|
|
30
|
+
export { shouldColorize, type Styler, styler } from "./style.js";
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// NDJSON envelope + writer for streaming commands (run/resume/draft).
|
|
2
|
+
//
|
|
3
|
+
// The wire shape mirrors the Go CLI's run --json output (run_stream_json.go):
|
|
4
|
+
// every line is a `{type, ts, payload}` object, and the payload is cleaned of
|
|
5
|
+
// nil/empty-string fields before encoding. This module owns the *formatting*;
|
|
6
|
+
// the Event→{type, payload} mapping lives in resources/stream/render-ndjson.ts.
|
|
7
|
+
|
|
8
|
+
export interface NdjsonEvent {
|
|
9
|
+
readonly type: string;
|
|
10
|
+
readonly [key: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** The Go-parity envelope: a typed event with a timestamp and cleaned payload. */
|
|
14
|
+
export interface NdjsonEnvelope extends NdjsonEvent {
|
|
15
|
+
readonly ts: string;
|
|
16
|
+
readonly payload: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Serialize a single NDJSON event (one compact JSON object + newline). */
|
|
20
|
+
export function ndjsonLine(event: NdjsonEvent): string {
|
|
21
|
+
return JSON.stringify(event) + "\n";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Write a single NDJSON event to the given stream. */
|
|
25
|
+
export function writeNdjson(out: { write(chunk: string): unknown }, event: NdjsonEvent): void {
|
|
26
|
+
out.write(ndjsonLine(event));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Build a `{type, ts, payload}` envelope, cleaning the payload exactly like Go's
|
|
31
|
+
* writeJSONEvent: drop `undefined`/`null` and empty-string fields, but keep
|
|
32
|
+
* `false` and `0`. `now` is injectable for deterministic tests.
|
|
33
|
+
*/
|
|
34
|
+
export function ndjsonEnvelope(
|
|
35
|
+
type: string,
|
|
36
|
+
payload: Record<string, unknown>,
|
|
37
|
+
now: () => string = defaultTimestamp,
|
|
38
|
+
): NdjsonEnvelope {
|
|
39
|
+
return { type, ts: now(), payload: cleanNdjsonPayload(payload) };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Drop nil and empty-string entries from a payload (booleans/numbers survive). */
|
|
43
|
+
export function cleanNdjsonPayload(payload: Record<string, unknown>): Record<string, unknown> {
|
|
44
|
+
const out: Record<string, unknown> = {};
|
|
45
|
+
for (const [key, value] of Object.entries(payload)) {
|
|
46
|
+
if (value === undefined || value === null) continue;
|
|
47
|
+
if (typeof value === "string" && value === "") continue;
|
|
48
|
+
out[key] = value;
|
|
49
|
+
}
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function defaultTimestamp(): string {
|
|
54
|
+
return new Date().toISOString();
|
|
55
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { create } from "@bufbuild/protobuf";
|
|
2
|
+
import { ApiResourceKindMetaSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
3
|
+
import { parse as parseYaml } from "yaml";
|
|
4
|
+
import { describe, expect, it } from "vitest";
|
|
5
|
+
import {
|
|
6
|
+
protoToJsonValue,
|
|
7
|
+
renderProtoJson,
|
|
8
|
+
renderProtoListJson,
|
|
9
|
+
renderProtoListYaml,
|
|
10
|
+
renderProtoYaml,
|
|
11
|
+
} from "./proto.js";
|
|
12
|
+
|
|
13
|
+
// A small, stable generated message exercising snake_case fields (display_name,
|
|
14
|
+
// id_prefix, is_versioned) and default-omission (group/version/tier enums = 0).
|
|
15
|
+
function sampleMeta() {
|
|
16
|
+
return create(ApiResourceKindMetaSchema, {
|
|
17
|
+
name: "Agent",
|
|
18
|
+
displayName: "Agent",
|
|
19
|
+
idPrefix: "agt",
|
|
20
|
+
isVersioned: true,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
describe("renderProtoJson — protojson parity", () => {
|
|
25
|
+
it("uses proto (snake_case) field names", () => {
|
|
26
|
+
const parsed = JSON.parse(renderProtoJson(ApiResourceKindMetaSchema, sampleMeta()));
|
|
27
|
+
expect(parsed).toEqual({
|
|
28
|
+
name: "Agent",
|
|
29
|
+
display_name: "Agent",
|
|
30
|
+
id_prefix: "agt",
|
|
31
|
+
is_versioned: true,
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("omits unpopulated (default-valued) fields", () => {
|
|
36
|
+
const parsed = JSON.parse(renderProtoJson(ApiResourceKindMetaSchema, sampleMeta()));
|
|
37
|
+
expect(parsed).not.toHaveProperty("group");
|
|
38
|
+
expect(parsed).not.toHaveProperty("tier");
|
|
39
|
+
expect(parsed).not.toHaveProperty("authorization");
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("pretty-prints with a trailing newline", () => {
|
|
43
|
+
const rendered = renderProtoJson(ApiResourceKindMetaSchema, sampleMeta());
|
|
44
|
+
expect(rendered.endsWith("\n")).toBe(true);
|
|
45
|
+
expect(rendered).toContain(' "name": "Agent"');
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
describe("renderProtoYaml — round-trips through the same JSON value", () => {
|
|
50
|
+
it("yields the same field names and values as the JSON renderer", () => {
|
|
51
|
+
const meta = sampleMeta();
|
|
52
|
+
const fromYaml = parseYaml(renderProtoYaml(ApiResourceKindMetaSchema, meta));
|
|
53
|
+
expect(fromYaml).toEqual(protoToJsonValue(ApiResourceKindMetaSchema, meta));
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe("list renderers", () => {
|
|
58
|
+
it("renders a JSON array of messages", () => {
|
|
59
|
+
const parsed = JSON.parse(
|
|
60
|
+
renderProtoListJson(ApiResourceKindMetaSchema, [sampleMeta(), sampleMeta()]),
|
|
61
|
+
);
|
|
62
|
+
expect(Array.isArray(parsed)).toBe(true);
|
|
63
|
+
expect(parsed).toHaveLength(2);
|
|
64
|
+
expect(parsed[0].id_prefix).toBe("agt");
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("renders a YAML array equal to the JSON-value array", () => {
|
|
68
|
+
const items = [sampleMeta()];
|
|
69
|
+
const fromYaml = parseYaml(renderProtoListYaml(ApiResourceKindMetaSchema, items));
|
|
70
|
+
expect(fromYaml).toEqual(items.map((m) => protoToJsonValue(ApiResourceKindMetaSchema, m)));
|
|
71
|
+
});
|
|
72
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Canonical protobuf -> JSON/YAML rendering for read verbs.
|
|
2
|
+
//
|
|
3
|
+
// Parity contract (mirrors Go pkg/display/proto.go and mcp-server marshal.ts):
|
|
4
|
+
// the Go CLI emits protojson with UseProtoNames=true and EmitUnpopulated=false,
|
|
5
|
+
// 2-space indented. protobuf-es `toJson` with { useProtoFieldName: true }
|
|
6
|
+
// reproduces that exactly — snake_case fields, omitted defaults, base64 bytes,
|
|
7
|
+
// string enums, RFC-3339 timestamps — and the YAML path round-trips through the
|
|
8
|
+
// same JSON value so field naming stays identical.
|
|
9
|
+
|
|
10
|
+
import { type DescMessage, type JsonValue, type MessageShape, toJson } from "@bufbuild/protobuf";
|
|
11
|
+
import { stringify as toYaml } from "yaml";
|
|
12
|
+
|
|
13
|
+
const JSON_WRITE_OPTIONS = { useProtoFieldName: true } as const;
|
|
14
|
+
|
|
15
|
+
/** Proto -> protojson JsonValue (snake_case fields, omitted defaults). */
|
|
16
|
+
export function protoToJsonValue<Desc extends DescMessage>(
|
|
17
|
+
schema: Desc,
|
|
18
|
+
message: MessageShape<Desc>,
|
|
19
|
+
): JsonValue {
|
|
20
|
+
return toJson(schema, message, JSON_WRITE_OPTIONS);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Render a single proto message as pretty JSON, newline-terminated. */
|
|
24
|
+
export function renderProtoJson<Desc extends DescMessage>(
|
|
25
|
+
schema: Desc,
|
|
26
|
+
message: MessageShape<Desc>,
|
|
27
|
+
): string {
|
|
28
|
+
return JSON.stringify(protoToJsonValue(schema, message), null, 2) + "\n";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Render a single proto message as YAML. */
|
|
32
|
+
export function renderProtoYaml<Desc extends DescMessage>(
|
|
33
|
+
schema: Desc,
|
|
34
|
+
message: MessageShape<Desc>,
|
|
35
|
+
): string {
|
|
36
|
+
return toYaml(protoToJsonValue(schema, message));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Render a list of proto messages as a pretty JSON array, newline-terminated. */
|
|
40
|
+
export function renderProtoListJson<Desc extends DescMessage>(
|
|
41
|
+
schema: Desc,
|
|
42
|
+
messages: readonly MessageShape<Desc>[],
|
|
43
|
+
): string {
|
|
44
|
+
const array = messages.map((message) => protoToJsonValue(schema, message));
|
|
45
|
+
return JSON.stringify(array, null, 2) + "\n";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Render a list of proto messages as a YAML array. */
|
|
49
|
+
export function renderProtoListYaml<Desc extends DescMessage>(
|
|
50
|
+
schema: Desc,
|
|
51
|
+
messages: readonly MessageShape<Desc>[],
|
|
52
|
+
): string {
|
|
53
|
+
const array = messages.map((message) => protoToJsonValue(schema, message));
|
|
54
|
+
return toYaml(array);
|
|
55
|
+
}
|