@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,134 @@
|
|
|
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
|
+
import { shouldColorize, styler } from "./style.js";
|
|
9
|
+
/** A group of related fields/items under an optional title. */
|
|
10
|
+
export class Section {
|
|
11
|
+
title;
|
|
12
|
+
fields = [];
|
|
13
|
+
items = [];
|
|
14
|
+
constructor(title) {
|
|
15
|
+
this.title = title;
|
|
16
|
+
}
|
|
17
|
+
field(key, value) {
|
|
18
|
+
this.fields.push({ key, value });
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
item(text) {
|
|
22
|
+
this.items.push(text);
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/** The structured outcome of a command. Build via the static factories. */
|
|
27
|
+
export class CommandResult {
|
|
28
|
+
status;
|
|
29
|
+
message;
|
|
30
|
+
sections = [];
|
|
31
|
+
hints = [];
|
|
32
|
+
constructor(status, message) {
|
|
33
|
+
this.status = status;
|
|
34
|
+
this.message = message;
|
|
35
|
+
}
|
|
36
|
+
static success(message) {
|
|
37
|
+
return new CommandResult("success", message);
|
|
38
|
+
}
|
|
39
|
+
static warning(message) {
|
|
40
|
+
return new CommandResult("warning", message);
|
|
41
|
+
}
|
|
42
|
+
static error(message) {
|
|
43
|
+
return new CommandResult("error", message);
|
|
44
|
+
}
|
|
45
|
+
addSection(title = "") {
|
|
46
|
+
const section = new Section(title);
|
|
47
|
+
this.sections.push(section);
|
|
48
|
+
return section;
|
|
49
|
+
}
|
|
50
|
+
hint(text) {
|
|
51
|
+
this.hints.push(text);
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const ICONS = {
|
|
56
|
+
success: "✓",
|
|
57
|
+
warning: "⚠",
|
|
58
|
+
error: "✗",
|
|
59
|
+
};
|
|
60
|
+
/** JSON form of a CommandResult (omits empty sections/hints), newline-terminated. */
|
|
61
|
+
export function resultToJson(result) {
|
|
62
|
+
const out = { status: result.status, message: result.message };
|
|
63
|
+
if (result.sections.length > 0) {
|
|
64
|
+
out.sections = result.sections.map((section) => {
|
|
65
|
+
const jsonSection = {};
|
|
66
|
+
if (section.title !== "")
|
|
67
|
+
jsonSection.title = section.title;
|
|
68
|
+
if (section.fields.length > 0) {
|
|
69
|
+
jsonSection.fields = section.fields.map((field) => ({ key: field.key, value: field.value }));
|
|
70
|
+
}
|
|
71
|
+
if (section.items.length > 0)
|
|
72
|
+
jsonSection.items = [...section.items];
|
|
73
|
+
return jsonSection;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
if (result.hints.length > 0)
|
|
77
|
+
out.hints = [...result.hints];
|
|
78
|
+
return JSON.stringify(out, null, 2) + "\n";
|
|
79
|
+
}
|
|
80
|
+
/** Colored, structured human form, newline-terminated. */
|
|
81
|
+
export function resultToHuman(result, colorize) {
|
|
82
|
+
const style = styler(colorize);
|
|
83
|
+
const lines = [statusLine(result, colorize)];
|
|
84
|
+
for (const section of result.sections) {
|
|
85
|
+
lines.push("");
|
|
86
|
+
if (section.title !== "")
|
|
87
|
+
lines.push(style.bold(`${section.title}:`));
|
|
88
|
+
if (section.fields.length > 0) {
|
|
89
|
+
const widestKey = Math.max(...section.fields.map((field) => field.key.length));
|
|
90
|
+
for (const field of section.fields) {
|
|
91
|
+
const padding = " ".repeat(widestKey - field.key.length + 4);
|
|
92
|
+
lines.push(` ${style.dim(field.key)}${padding}${field.value}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
for (const item of section.items)
|
|
96
|
+
lines.push(` - ${item}`);
|
|
97
|
+
}
|
|
98
|
+
if (result.hints.length > 0) {
|
|
99
|
+
lines.push("");
|
|
100
|
+
for (const hint of result.hints)
|
|
101
|
+
lines.push(` ${style.dim(hint)}`);
|
|
102
|
+
}
|
|
103
|
+
return lines.join("\n") + "\n";
|
|
104
|
+
}
|
|
105
|
+
/** Status line only — for scripting where pass/fail is all that matters. */
|
|
106
|
+
export function resultToQuiet(result, colorize) {
|
|
107
|
+
return statusLine(result, colorize) + "\n";
|
|
108
|
+
}
|
|
109
|
+
function statusLine(result, colorize) {
|
|
110
|
+
const style = styler(colorize);
|
|
111
|
+
const text = `${ICONS[result.status]} ${result.message}`;
|
|
112
|
+
switch (result.status) {
|
|
113
|
+
case "success":
|
|
114
|
+
return style.green(text);
|
|
115
|
+
case "warning":
|
|
116
|
+
return style.yellow(text);
|
|
117
|
+
case "error":
|
|
118
|
+
return style.red(text);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const DEFAULT_STREAMS = { stdout: process.stdout, stderr: process.stderr };
|
|
122
|
+
/** Render a CommandResult to the appropriate stream for the resolved format. */
|
|
123
|
+
export function renderResult(result, format, streams = DEFAULT_STREAMS) {
|
|
124
|
+
if (format === "json") {
|
|
125
|
+
streams.stdout.write(resultToJson(result));
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (format === "quiet") {
|
|
129
|
+
streams.stderr.write(resultToQuiet(result, shouldColorize(streams.stderr)));
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
streams.stderr.write(resultToHuman(result, shouldColorize(streams.stderr)));
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=command-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-result.js","sourceRoot":"","sources":["../../src/output/command-result.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,+EAA+E;AAC/E,6EAA6E;AAC7E,iBAAiB;AACjB,EAAE;A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AE,OAAO,CAAC,MAAM,EAAE,CAAC;AAE1F,gFAAgF;AAChF,MAAM,UAAU,YAAY,CAC1B,MAAqB,EACrB,MAAoB,EACpB,UAAyB,eAAe;IAExC,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;QAC3C,OAAO;IACT,CAAC;IACD,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QACvB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC5E,OAAO;IACT,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface ConfirmOptions {
|
|
2
|
+
/** When true, skip the prompt and return true immediately (`--force`). */
|
|
3
|
+
readonly force?: boolean;
|
|
4
|
+
/** Input stream to read the answer from. Defaults to process.stdin. */
|
|
5
|
+
readonly input?: NodeJS.ReadStream;
|
|
6
|
+
/** Output stream the prompt is written to. Defaults to process.stderr. */
|
|
7
|
+
readonly output?: NodeJS.WritableStream;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Ask the user to confirm a destructive action. Returns true to proceed.
|
|
11
|
+
*
|
|
12
|
+
* Resolution order:
|
|
13
|
+
* - `--force` → true (no prompt)
|
|
14
|
+
* - non-interactive TTY → false (refuse rather than block a pipe/CI run)
|
|
15
|
+
* - interactive → true only for an explicit yes ("y"/"yes")
|
|
16
|
+
*
|
|
17
|
+
* The default-no posture matches the "[y/N]" prompt: anything that is not an
|
|
18
|
+
* affirmative answer aborts, which is the safe outcome for an irreversible
|
|
19
|
+
* operation.
|
|
20
|
+
*/
|
|
21
|
+
export declare function confirm(prompt: string, options?: ConfirmOptions): Promise<boolean>;
|
|
22
|
+
//# sourceMappingURL=confirm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm.d.ts","sourceRoot":"","sources":["../../src/output/confirm.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,uEAAuE;IACvE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACnC,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;CACzC;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,CAiB5F"}
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
import { createInterface } from "node:readline";
|
|
9
|
+
/**
|
|
10
|
+
* Ask the user to confirm a destructive action. Returns true to proceed.
|
|
11
|
+
*
|
|
12
|
+
* Resolution order:
|
|
13
|
+
* - `--force` → true (no prompt)
|
|
14
|
+
* - non-interactive TTY → false (refuse rather than block a pipe/CI run)
|
|
15
|
+
* - interactive → true only for an explicit yes ("y"/"yes")
|
|
16
|
+
*
|
|
17
|
+
* The default-no posture matches the "[y/N]" prompt: anything that is not an
|
|
18
|
+
* affirmative answer aborts, which is the safe outcome for an irreversible
|
|
19
|
+
* operation.
|
|
20
|
+
*/
|
|
21
|
+
export async function confirm(prompt, options = {}) {
|
|
22
|
+
if (options.force === true)
|
|
23
|
+
return true;
|
|
24
|
+
const input = options.input ?? process.stdin;
|
|
25
|
+
const output = options.output ?? process.stderr;
|
|
26
|
+
// Without a TTY there is no one to answer; refuse rather than hang. Callers
|
|
27
|
+
// that need unattended deletes pass `--force`.
|
|
28
|
+
if (input.isTTY !== true)
|
|
29
|
+
return false;
|
|
30
|
+
const rl = createInterface({ input, output });
|
|
31
|
+
try {
|
|
32
|
+
const answer = await new Promise((resolve) => rl.question(`${prompt} `, resolve));
|
|
33
|
+
return isAffirmative(answer);
|
|
34
|
+
}
|
|
35
|
+
finally {
|
|
36
|
+
rl.close();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function isAffirmative(answer) {
|
|
40
|
+
return /^y(es)?$/i.test(answer.trim());
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=confirm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm.js","sourceRoot":"","sources":["../../src/output/confirm.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,4EAA4E;AAC5E,+EAA+E;AAC/E,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,8CAA8C;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAWhD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,MAAc,EAAE,UAA0B,EAAE;IACxE,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAExC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC;IAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAEhD,4EAA4E;IAC5E,+CAA+C;IAC/C,IAAI,KAAK,CAAC,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAEvC,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,MAAM,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;QAC1F,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAC;IACb,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,MAAc;IACnC,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Internal format the renderers consume, after class-aware resolution. */
|
|
2
|
+
export type OutputFormat = "table" | "json" | "yaml" | "human" | "quiet" | "ndjson" | "inline";
|
|
3
|
+
/** Output behavior class a command belongs to. */
|
|
4
|
+
export type CommandClass = "read" | "mutating" | "streaming";
|
|
5
|
+
/** Raw output-selection flags as parsed from the command line. */
|
|
6
|
+
export interface OutputFlags {
|
|
7
|
+
readonly output?: string;
|
|
8
|
+
readonly json?: boolean;
|
|
9
|
+
readonly quiet?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const UNIVERSAL_FORMATS: readonly ["table", "json", "yaml", "ndjson"];
|
|
12
|
+
type UniversalFormat = (typeof UNIVERSAL_FORMATS)[number];
|
|
13
|
+
/**
|
|
14
|
+
* Resolve the explicit/alias output flags into a single renderer format,
|
|
15
|
+
* honoring the command class's defaults and supported values. Throws a
|
|
16
|
+
* UsageError (exit code 2) on conflicting or unsupported selections.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveFormat(flags: OutputFlags, commandClass: CommandClass): OutputFormat;
|
|
19
|
+
/** The universal output values a given command class supports, for help/errors. */
|
|
20
|
+
export declare function supportedFormats(commandClass: CommandClass): UniversalFormat[];
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/output/format.ts"],"names":[],"mappings":"AAsBA,2EAA2E;AAC3E,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE/F,kDAAkD;AAClD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC;AAE7D,kEAAkE;AAClE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,iBAAiB,8CAA+C,CAAC;AACvE,KAAK,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAgB1D;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,GAAG,YAAY,CAkB1F;AAkBD,mFAAmF;AACnF,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,YAAY,GAAG,eAAe,EAAE,CAE9E"}
|
package/output/format.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
import { UsageError } from "../errors/usage-error.js";
|
|
21
|
+
const UNIVERSAL_FORMATS = ["table", "json", "yaml", "ndjson"];
|
|
22
|
+
// Maps the universal vocabulary onto each class's internal renderer format.
|
|
23
|
+
// A missing entry means that universal value is not supported by the class.
|
|
24
|
+
const CLASS_FORMAT_MAP = {
|
|
25
|
+
read: { table: "table", json: "json", yaml: "yaml" },
|
|
26
|
+
mutating: { table: "human", json: "json" },
|
|
27
|
+
streaming: { table: "inline", json: "ndjson", ndjson: "ndjson" },
|
|
28
|
+
};
|
|
29
|
+
const DEFAULT_FORMAT = {
|
|
30
|
+
read: "table",
|
|
31
|
+
mutating: "human",
|
|
32
|
+
streaming: "inline",
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Resolve the explicit/alias output flags into a single renderer format,
|
|
36
|
+
* honoring the command class's defaults and supported values. Throws a
|
|
37
|
+
* UsageError (exit code 2) on conflicting or unsupported selections.
|
|
38
|
+
*/
|
|
39
|
+
export function resolveFormat(flags, commandClass) {
|
|
40
|
+
if (flags.json === true && flags.quiet === true) {
|
|
41
|
+
throw new UsageError("--json and --quiet cannot be used together");
|
|
42
|
+
}
|
|
43
|
+
if (flags.output !== undefined && flags.output !== "") {
|
|
44
|
+
return resolveExplicit(flags.output, commandClass);
|
|
45
|
+
}
|
|
46
|
+
if (flags.quiet === true) {
|
|
47
|
+
return "quiet";
|
|
48
|
+
}
|
|
49
|
+
if (flags.json === true) {
|
|
50
|
+
return CLASS_FORMAT_MAP[commandClass].json ?? "json";
|
|
51
|
+
}
|
|
52
|
+
return DEFAULT_FORMAT[commandClass];
|
|
53
|
+
}
|
|
54
|
+
function resolveExplicit(raw, commandClass) {
|
|
55
|
+
const value = raw.toLowerCase();
|
|
56
|
+
if (!isUniversalFormat(value)) {
|
|
57
|
+
throw new UsageError(`invalid --output value "${raw}" (expected one of: ${UNIVERSAL_FORMATS.join(", ")})`);
|
|
58
|
+
}
|
|
59
|
+
const mapped = CLASS_FORMAT_MAP[commandClass][value];
|
|
60
|
+
if (mapped === undefined) {
|
|
61
|
+
throw new UsageError(`--output ${value} is not supported by this command (supported: ${supportedFormats(commandClass).join(", ")})`);
|
|
62
|
+
}
|
|
63
|
+
return mapped;
|
|
64
|
+
}
|
|
65
|
+
/** The universal output values a given command class supports, for help/errors. */
|
|
66
|
+
export function supportedFormats(commandClass) {
|
|
67
|
+
return UNIVERSAL_FORMATS.filter((value) => CLASS_FORMAT_MAP[commandClass][value] !== undefined);
|
|
68
|
+
}
|
|
69
|
+
function isUniversalFormat(value) {
|
|
70
|
+
return UNIVERSAL_FORMATS.includes(value);
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/output/format.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,oEAAoE;AACpE,2EAA2E;AAC3E,gEAAgE;AAChE,EAAE;AACF,2EAA2E;AAC3E,oEAAoE;AACpE,EAAE;AACF,8CAA8C;AAC9C,8CAA8C;AAC9C,2CAA2C;AAC3C,2CAA2C;AAC3C,sCAAsC;AACtC,2CAA2C;AAC3C,2CAA2C;AAC3C,sCAAsC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,0B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,CAAC,GAAW,EAAE,YAA0B;IAC9D,MAAM,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;IAChC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,UAAU,CAClB,2BAA2B,GAAG,uBAAuB,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACrF,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC;IACrD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,UAAU,CAClB,YAAY,KAAK,iDAAiD,gBAAgB,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC/G,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,gBAAgB,CAAC,YAA0B;IACzD,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,CAAC;AAClG,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAa;IACtC,OAAQ,iBAAuC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { type CommandClass, type OutputFlags, type OutputFormat, resolveFormat, supportedFormats, } from "./format.js";
|
|
2
|
+
export { protoToJsonValue, renderProtoJson, renderProtoListJson, renderProtoListYaml, renderProtoYaml, } from "./proto.js";
|
|
3
|
+
export { renderEmpty, renderTable } from "./table.js";
|
|
4
|
+
export { CommandResult, type KeyValue, renderResult, type ResultStatus, type ResultStreams, resultToHuman, resultToJson, resultToQuiet, Section, } from "./command-result.js";
|
|
5
|
+
export { type NdjsonEvent, ndjsonLine, writeNdjson } from "./ndjson.js";
|
|
6
|
+
export { shouldColorize, type Styler, styler } from "./style.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/output/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,aAAa,EACb,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EACL,aAAa,EACb,KAAK,QAAQ,EACb,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,OAAO,GACR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,KAAK,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC"}
|
package/output/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Public surface of the CLI output module.
|
|
2
|
+
export { resolveFormat, supportedFormats, } from "./format.js";
|
|
3
|
+
export { protoToJsonValue, renderProtoJson, renderProtoListJson, renderProtoListYaml, renderProtoYaml, } from "./proto.js";
|
|
4
|
+
export { renderEmpty, renderTable } from "./table.js";
|
|
5
|
+
export { CommandResult, renderResult, resultToHuman, resultToJson, resultToQuiet, Section, } from "./command-result.js";
|
|
6
|
+
export { ndjsonLine, writeNdjson } from "./ndjson.js";
|
|
7
|
+
export { shouldColorize, styler } from "./style.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/output/index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAE3C,OAAO,EAIL,aAAa,EACb,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EACL,aAAa,EAEb,YAAY,EAGZ,aAAa,EACb,YAAY,EACZ,aAAa,EACb,OAAO,GACR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAoB,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,cAAc,EAAe,MAAM,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface NdjsonEvent {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
readonly [key: string]: unknown;
|
|
4
|
+
}
|
|
5
|
+
/** The Go-parity envelope: a typed event with a timestamp and cleaned payload. */
|
|
6
|
+
export interface NdjsonEnvelope extends NdjsonEvent {
|
|
7
|
+
readonly ts: string;
|
|
8
|
+
readonly payload: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
/** Serialize a single NDJSON event (one compact JSON object + newline). */
|
|
11
|
+
export declare function ndjsonLine(event: NdjsonEvent): string;
|
|
12
|
+
/** Write a single NDJSON event to the given stream. */
|
|
13
|
+
export declare function writeNdjson(out: {
|
|
14
|
+
write(chunk: string): unknown;
|
|
15
|
+
}, event: NdjsonEvent): void;
|
|
16
|
+
/**
|
|
17
|
+
* Build a `{type, ts, payload}` envelope, cleaning the payload exactly like Go's
|
|
18
|
+
* writeJSONEvent: drop `undefined`/`null` and empty-string fields, but keep
|
|
19
|
+
* `false` and `0`. `now` is injectable for deterministic tests.
|
|
20
|
+
*/
|
|
21
|
+
export declare function ndjsonEnvelope(type: string, payload: Record<string, unknown>, now?: () => string): NdjsonEnvelope;
|
|
22
|
+
/** Drop nil and empty-string entries from a payload (booleans/numbers survive). */
|
|
23
|
+
export declare function cleanNdjsonPayload(payload: Record<string, unknown>): Record<string, unknown>;
|
|
24
|
+
//# sourceMappingURL=ndjson.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ndjson.d.ts","sourceRoot":"","sources":["../../src/output/ndjson.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAED,kFAAkF;AAClF,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAErD;AAED,uDAAuD;AACvD,wBAAgB,WAAW,CAAC,GAAG,EAAE;IAAE,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAE5F;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,GAAG,GAAE,MAAM,MAAyB,GACnC,cAAc,CAEhB;AAED,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQ5F"}
|
package/output/ndjson.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
/** Serialize a single NDJSON event (one compact JSON object + newline). */
|
|
8
|
+
export function ndjsonLine(event) {
|
|
9
|
+
return JSON.stringify(event) + "\n";
|
|
10
|
+
}
|
|
11
|
+
/** Write a single NDJSON event to the given stream. */
|
|
12
|
+
export function writeNdjson(out, event) {
|
|
13
|
+
out.write(ndjsonLine(event));
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Build a `{type, ts, payload}` envelope, cleaning the payload exactly like Go's
|
|
17
|
+
* writeJSONEvent: drop `undefined`/`null` and empty-string fields, but keep
|
|
18
|
+
* `false` and `0`. `now` is injectable for deterministic tests.
|
|
19
|
+
*/
|
|
20
|
+
export function ndjsonEnvelope(type, payload, now = defaultTimestamp) {
|
|
21
|
+
return { type, ts: now(), payload: cleanNdjsonPayload(payload) };
|
|
22
|
+
}
|
|
23
|
+
/** Drop nil and empty-string entries from a payload (booleans/numbers survive). */
|
|
24
|
+
export function cleanNdjsonPayload(payload) {
|
|
25
|
+
const out = {};
|
|
26
|
+
for (const [key, value] of Object.entries(payload)) {
|
|
27
|
+
if (value === undefined || value === null)
|
|
28
|
+
continue;
|
|
29
|
+
if (typeof value === "string" && value === "")
|
|
30
|
+
continue;
|
|
31
|
+
out[key] = value;
|
|
32
|
+
}
|
|
33
|
+
return out;
|
|
34
|
+
}
|
|
35
|
+
function defaultTimestamp() {
|
|
36
|
+
return new Date().toISOString();
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=ndjson.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ndjson.js","sourceRoot":"","sources":["../../src/output/ndjson.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,gFAAgF;AAahF,2EAA2E;AAC3E,MAAM,UAAU,UAAU,CAAC,KAAkB;IAC3C,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;AACtC,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,WAAW,CAAC,GAAsC,EAAE,KAAkB;IACpF,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC5B,IAAY,EACZ,OAAgC,EAChC,MAAoB,gBAAgB;IAEpC,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC;AACnE,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,kBAAkB,CAAC,OAAgC;IACjE,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACnD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;YAAE,SAAS;QACpD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,EAAE;YAAE,SAAS;QACxD,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,gBAAgB;IACvB,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type DescMessage, type JsonValue, type MessageShape } from "@bufbuild/protobuf";
|
|
2
|
+
/** Proto -> protojson JsonValue (snake_case fields, omitted defaults). */
|
|
3
|
+
export declare function protoToJsonValue<Desc extends DescMessage>(schema: Desc, message: MessageShape<Desc>): JsonValue;
|
|
4
|
+
/** Render a single proto message as pretty JSON, newline-terminated. */
|
|
5
|
+
export declare function renderProtoJson<Desc extends DescMessage>(schema: Desc, message: MessageShape<Desc>): string;
|
|
6
|
+
/** Render a single proto message as YAML. */
|
|
7
|
+
export declare function renderProtoYaml<Desc extends DescMessage>(schema: Desc, message: MessageShape<Desc>): string;
|
|
8
|
+
/** Render a list of proto messages as a pretty JSON array, newline-terminated. */
|
|
9
|
+
export declare function renderProtoListJson<Desc extends DescMessage>(schema: Desc, messages: readonly MessageShape<Desc>[]): string;
|
|
10
|
+
/** Render a list of proto messages as a YAML array. */
|
|
11
|
+
export declare function renderProtoListYaml<Desc extends DescMessage>(schema: Desc, messages: readonly MessageShape<Desc>[]): string;
|
|
12
|
+
//# sourceMappingURL=proto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proto.d.ts","sourceRoot":"","sources":["../../src/output/proto.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAU,MAAM,oBAAoB,CAAC;AAKjG,0EAA0E;AAC1E,wBAAgB,gBAAgB,CAAC,IAAI,SAAS,WAAW,EACvD,MAAM,EAAE,IAAI,EACZ,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,GAC1B,SAAS,CAEX;AAED,wEAAwE;AACxE,wBAAgB,eAAe,CAAC,IAAI,SAAS,WAAW,EACtD,MAAM,EAAE,IAAI,EACZ,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,GAC1B,MAAM,CAER;AAED,6CAA6C;AAC7C,wBAAgB,eAAe,CAAC,IAAI,SAAS,WAAW,EACtD,MAAM,EAAE,IAAI,EACZ,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,GAC1B,MAAM,CAER;AAED,kFAAkF;AAClF,wBAAgB,mBAAmB,CAAC,IAAI,SAAS,WAAW,EAC1D,MAAM,EAAE,IAAI,EACZ,QAAQ,EAAE,SAAS,YAAY,CAAC,IAAI,CAAC,EAAE,GACtC,MAAM,CAGR;AAED,uDAAuD;AACvD,wBAAgB,mBAAmB,CAAC,IAAI,SAAS,WAAW,EAC1D,MAAM,EAAE,IAAI,EACZ,QAAQ,EAAE,SAAS,YAAY,CAAC,IAAI,CAAC,EAAE,GACtC,MAAM,CAGR"}
|
package/output/proto.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
import { toJson } from "@bufbuild/protobuf";
|
|
10
|
+
import { stringify as toYaml } from "yaml";
|
|
11
|
+
const JSON_WRITE_OPTIONS = { useProtoFieldName: true };
|
|
12
|
+
/** Proto -> protojson JsonValue (snake_case fields, omitted defaults). */
|
|
13
|
+
export function protoToJsonValue(schema, message) {
|
|
14
|
+
return toJson(schema, message, JSON_WRITE_OPTIONS);
|
|
15
|
+
}
|
|
16
|
+
/** Render a single proto message as pretty JSON, newline-terminated. */
|
|
17
|
+
export function renderProtoJson(schema, message) {
|
|
18
|
+
return JSON.stringify(protoToJsonValue(schema, message), null, 2) + "\n";
|
|
19
|
+
}
|
|
20
|
+
/** Render a single proto message as YAML. */
|
|
21
|
+
export function renderProtoYaml(schema, message) {
|
|
22
|
+
return toYaml(protoToJsonValue(schema, message));
|
|
23
|
+
}
|
|
24
|
+
/** Render a list of proto messages as a pretty JSON array, newline-terminated. */
|
|
25
|
+
export function renderProtoListJson(schema, messages) {
|
|
26
|
+
const array = messages.map((message) => protoToJsonValue(schema, message));
|
|
27
|
+
return JSON.stringify(array, null, 2) + "\n";
|
|
28
|
+
}
|
|
29
|
+
/** Render a list of proto messages as a YAML array. */
|
|
30
|
+
export function renderProtoListYaml(schema, messages) {
|
|
31
|
+
const array = messages.map((message) => protoToJsonValue(schema, message));
|
|
32
|
+
return toYaml(array);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=proto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proto.js","sourceRoot":"","sources":["../../src/output/proto.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,0EAA0E;AAC1E,+EAA+E;AAC/E,gFAAgF;AAChF,mDAAmD;AAEnD,OAAO,EAAuD,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,EAAE,SAAS,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAE3C,MAAM,kBAAkB,GAAG,EAAE,iBAAiB,EAAE,IAAI,EAAW,CAAC;AAEhE,0EAA0E;AAC1E,MAAM,UAAU,gBAAgB,CAC9B,MAAY,EACZ,OAA2B;IAE3B,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;AACrD,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,eAAe,CAC7B,MAAY,EACZ,OAA2B;IAE3B,OAAO,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;AAC3E,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,eAAe,CAC7B,MAAY,EACZ,OAA2B;IAE3B,OAAO,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACnD,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,mBAAmB,CACjC,MAAY,EACZ,QAAuC;IAEvC,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3E,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;AAC/C,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,mBAAmB,CACjC,MAAY,EACZ,QAAuC;IAEvC,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3E,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** A styler whose methods either wrap text in ANSI codes or pass it through. */
|
|
2
|
+
export interface Styler {
|
|
3
|
+
green(text: string): string;
|
|
4
|
+
yellow(text: string): string;
|
|
5
|
+
red(text: string): string;
|
|
6
|
+
cyan(text: string): string;
|
|
7
|
+
bold(text: string): string;
|
|
8
|
+
dim(text: string): string;
|
|
9
|
+
}
|
|
10
|
+
/** Pick a styler: colored only when explicitly enabled. */
|
|
11
|
+
export declare function styler(colorize: boolean): Styler;
|
|
12
|
+
/**
|
|
13
|
+
* Whether color should be enabled for a stream. Disabled when NO_COLOR is set
|
|
14
|
+
* (any value) or the stream is not an interactive TTY.
|
|
15
|
+
*/
|
|
16
|
+
export declare function shouldColorize(stream: {
|
|
17
|
+
isTTY?: boolean;
|
|
18
|
+
}): boolean;
|
|
19
|
+
//# sourceMappingURL=style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../src/output/style.ts"],"names":[],"mappings":"AAgBA,gFAAgF;AAChF,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAoBD,2DAA2D;AAC3D,wBAAgB,MAAM,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAEhD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAGnE"}
|
package/output/style.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Minimal ANSI styling for human-facing output.
|
|
2
|
+
//
|
|
3
|
+
// Mirrors the Go CLI's reliance on fatih/color, which auto-disables when the
|
|
4
|
+
// target stream is not a TTY and honors NO_COLOR. Keeping this tiny avoids a
|
|
5
|
+
// dependency for what is a handful of escape codes.
|
|
6
|
+
const ANSI = {
|
|
7
|
+
reset: "\x1b[0m",
|
|
8
|
+
bold: "\x1b[1m",
|
|
9
|
+
faint: "\x1b[2m",
|
|
10
|
+
red: "\x1b[31m",
|
|
11
|
+
green: "\x1b[32m",
|
|
12
|
+
yellow: "\x1b[33m",
|
|
13
|
+
cyan: "\x1b[36m",
|
|
14
|
+
};
|
|
15
|
+
const PLAIN = {
|
|
16
|
+
green: (t) => t,
|
|
17
|
+
yellow: (t) => t,
|
|
18
|
+
red: (t) => t,
|
|
19
|
+
cyan: (t) => t,
|
|
20
|
+
bold: (t) => t,
|
|
21
|
+
dim: (t) => t,
|
|
22
|
+
};
|
|
23
|
+
const COLORED = {
|
|
24
|
+
green: (t) => `${ANSI.green}${ANSI.bold}${t}${ANSI.reset}`,
|
|
25
|
+
yellow: (t) => `${ANSI.yellow}${ANSI.bold}${t}${ANSI.reset}`,
|
|
26
|
+
red: (t) => `${ANSI.red}${ANSI.bold}${t}${ANSI.reset}`,
|
|
27
|
+
cyan: (t) => `${ANSI.cyan}${t}${ANSI.reset}`,
|
|
28
|
+
bold: (t) => `${ANSI.bold}${t}${ANSI.reset}`,
|
|
29
|
+
dim: (t) => `${ANSI.faint}${t}${ANSI.reset}`,
|
|
30
|
+
};
|
|
31
|
+
/** Pick a styler: colored only when explicitly enabled. */
|
|
32
|
+
export function styler(colorize) {
|
|
33
|
+
return colorize ? COLORED : PLAIN;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Whether color should be enabled for a stream. Disabled when NO_COLOR is set
|
|
37
|
+
* (any value) or the stream is not an interactive TTY.
|
|
38
|
+
*/
|
|
39
|
+
export function shouldColorize(stream) {
|
|
40
|
+
if (process.env.NO_COLOR !== undefined && process.env.NO_COLOR !== "")
|
|
41
|
+
return false;
|
|
42
|
+
return stream.isTTY === true;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/output/style.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,oDAAoD;AAEpD,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,GAAG,EAAE,UAAU;IACf,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,IAAI,EAAE,UAAU;CACR,CAAC;AAYX,MAAM,KAAK,GAAW;IACpB,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACf,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChB,GAA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CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC;IACpF,OAAO,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Render a table from headers and rows. Returns "" when there are no rows. */
|
|
2
|
+
export declare function renderTable(headers: readonly string[], rows: readonly (readonly string[])[]): string;
|
|
3
|
+
/** Standardized empty-state message for list commands. */
|
|
4
|
+
export declare function renderEmpty(resourceName: string, query?: string): string;
|
|
5
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/output/table.ts"],"names":[],"mappings":"AASA,+EAA+E;AAC/E,wBAAgB,WAAW,CACzB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,IAAI,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,GACnC,MAAM,CAyBR;AAED,0DAA0D;AAC1D,wBAAgB,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAMxE"}
|
package/output/table.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Shared table renderer for list/collection views. Mirrors the column model of
|
|
2
|
+
// the Go CLI's pkg/display table (dynamic widths, dash separator, 3-space gap).
|
|
3
|
+
//
|
|
4
|
+
// Wave 1 implements the non-adaptive path: columns size to their widest cell.
|
|
5
|
+
// Terminal-width adaptation and ANSI-aware measurement can be layered on later
|
|
6
|
+
// without changing the call sites.
|
|
7
|
+
const COLUMN_GAP = " ";
|
|
8
|
+
/** Render a table from headers and rows. Returns "" when there are no rows. */
|
|
9
|
+
export function renderTable(headers, rows) {
|
|
10
|
+
if (rows.length === 0)
|
|
11
|
+
return "";
|
|
12
|
+
const widths = headers.map((header, column) => {
|
|
13
|
+
let width = header.length;
|
|
14
|
+
for (const row of rows) {
|
|
15
|
+
const cell = row[column] ?? "";
|
|
16
|
+
if (cell.length > width)
|
|
17
|
+
width = cell.length;
|
|
18
|
+
}
|
|
19
|
+
return width;
|
|
20
|
+
});
|
|
21
|
+
const renderRow = (cells) => headers
|
|
22
|
+
.map((_, column) => padRight(cells[column] ?? "", widths[column]))
|
|
23
|
+
.join(COLUMN_GAP)
|
|
24
|
+
.replace(/ +$/, "");
|
|
25
|
+
const lines = [];
|
|
26
|
+
lines.push(renderRow(headers));
|
|
27
|
+
lines.push(widths.map((width) => "-".repeat(width)).join(COLUMN_GAP));
|
|
28
|
+
for (const row of rows) {
|
|
29
|
+
lines.push(renderRow(row));
|
|
30
|
+
}
|
|
31
|
+
return lines.join("\n") + "\n";
|
|
32
|
+
}
|
|
33
|
+
/** Standardized empty-state message for list commands. */
|
|
34
|
+
export function renderEmpty(resourceName, query) {
|
|
35
|
+
const middle = query !== undefined && query !== ""
|
|
36
|
+
? `No ${resourceName} found matching '${query}'`
|
|
37
|
+
: `No ${resourceName} found`;
|
|
38
|
+
return `\n${middle}\n\n`;
|
|
39
|
+
}
|
|
40
|
+
function padRight(text, width) {
|
|
41
|
+
return text + " ".repeat(Math.max(0, width - text.length));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/output/table.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,gFAAgF;AAChF,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,mCAAmC;AAEnC,MAAM,UAAU,GAAG,KAAK,CAAC;AAEzB,+EAA+E;AAC/E,MAAM,UAAU,WAAW,CACzB,OAA0B,EAC1B,IAAoC;IAEpC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEjC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MA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