@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,100 @@
|
|
|
1
|
+
// Local MCP capability discovery for `connect mcp-server --dry-run`.
|
|
2
|
+
//
|
|
3
|
+
// Spawns/connects to the MCP server from the caller's machine (no backend push)
|
|
4
|
+
// using the official @modelcontextprotocol/sdk client, lists its tools and
|
|
5
|
+
// resource templates, and converts them to the same DiscoveredCapabilities proto
|
|
6
|
+
// the backend returns — so dry-run and real connect render identically. Mirrors
|
|
7
|
+
// Go's mcpdiscovery.Discover + CreateTransport (internal/cli/mcpdiscovery).
|
|
8
|
+
//
|
|
9
|
+
// stdio servers inherit process.env merged with --env overrides (override wins),
|
|
10
|
+
// so credentials never leave the local machine. HTTP servers connect to the
|
|
11
|
+
// configured URL with the server's static headers.
|
|
12
|
+
import { create } from "@bufbuild/protobuf";
|
|
13
|
+
import { DiscoveredCapabilitiesSchema, DiscoveredResourceTemplateSchema, DiscoveredToolSchema, } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/status_pb";
|
|
14
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
15
|
+
import { mergeProcessEnv } from "../mcp/runtime-env.js";
|
|
16
|
+
/** Discover an MCP server's capabilities locally without persisting to the backend. */
|
|
17
|
+
export async function localDiscover(spec, envOverrides, timeoutMs) {
|
|
18
|
+
const { transport, readStderr } = await buildTransport(spec, envOverrides);
|
|
19
|
+
const client = new Client({ name: "stigmer-cli", version: "1.0.0" });
|
|
20
|
+
const options = timeoutMs > 0 ? { timeout: timeoutMs } : undefined;
|
|
21
|
+
try {
|
|
22
|
+
await client.connect(transport, options);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
// Append captured subprocess stderr so config/toolchain failures are
|
|
26
|
+
// diagnosable, mirroring Go's withStderr — without dumping raw output.
|
|
27
|
+
const stderr = readStderr();
|
|
28
|
+
const detail = stderr !== "" ? `\nsubprocess stderr:\n${stderr}` : "";
|
|
29
|
+
throw new Error(`failed to connect to MCP server: ${error.message}${detail}`);
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
const { tools } = await client.listTools(undefined, options);
|
|
33
|
+
const resourceTemplates = (await client.getServerCapabilities())?.resources
|
|
34
|
+
? (await client.listResourceTemplates(undefined, options)).resourceTemplates
|
|
35
|
+
: [];
|
|
36
|
+
return create(DiscoveredCapabilitiesSchema, {
|
|
37
|
+
tools: tools.map((tool) => create(DiscoveredToolSchema, {
|
|
38
|
+
name: tool.name,
|
|
39
|
+
description: tool.description ?? "",
|
|
40
|
+
inputSchema: tool.inputSchema ?? undefined,
|
|
41
|
+
})),
|
|
42
|
+
resourceTemplates: resourceTemplates.map((template) => create(DiscoveredResourceTemplateSchema, {
|
|
43
|
+
uriTemplate: template.uriTemplate,
|
|
44
|
+
name: template.name,
|
|
45
|
+
description: template.description ?? "",
|
|
46
|
+
mimeType: template.mimeType ?? "",
|
|
47
|
+
})),
|
|
48
|
+
lastDiscoveredAt: { seconds: BigInt(Math.floor(Date.now() / 1000)), nanos: 0 },
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
await client.close();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async function buildTransport(spec, envOverrides) {
|
|
56
|
+
if (spec.serverType?.case === "stdio") {
|
|
57
|
+
const { command, args, workingDir } = spec.serverType.value;
|
|
58
|
+
if (command === "")
|
|
59
|
+
throw new Error("stdio transport requires a command");
|
|
60
|
+
const { StdioClientTransport } = await import("@modelcontextprotocol/sdk/client/stdio.js");
|
|
61
|
+
const transport = new StdioClientTransport({
|
|
62
|
+
command,
|
|
63
|
+
args: [...args],
|
|
64
|
+
cwd: workingDir !== "" ? workingDir : undefined,
|
|
65
|
+
env: mergeProcessEnv([...envOverrides, ...goRunEnvOverrides(command, args)]),
|
|
66
|
+
// "pipe" exposes the child stderr as a PassThrough immediately, so we can
|
|
67
|
+
// capture diagnostics rather than leaking them to the user's terminal.
|
|
68
|
+
stderr: "pipe",
|
|
69
|
+
});
|
|
70
|
+
let captured = "";
|
|
71
|
+
transport.stderr?.on("data", (chunk) => {
|
|
72
|
+
captured += chunk.toString("utf8");
|
|
73
|
+
});
|
|
74
|
+
return { transport, readStderr: () => captured.trim() };
|
|
75
|
+
}
|
|
76
|
+
if (spec.serverType?.case === "http") {
|
|
77
|
+
const { url, headers } = spec.serverType.value;
|
|
78
|
+
if (url === "")
|
|
79
|
+
throw new Error("HTTP transport requires a URL");
|
|
80
|
+
const { StreamableHTTPClientTransport } = await import("@modelcontextprotocol/sdk/client/streamableHttp.js");
|
|
81
|
+
const requestInit = Object.keys(headers).length > 0 ? { headers: { ...headers } } : undefined;
|
|
82
|
+
const transport = new StreamableHTTPClientTransport(new URL(url), requestInit ? { requestInit } : undefined);
|
|
83
|
+
return { transport, readStderr: () => "" };
|
|
84
|
+
}
|
|
85
|
+
throw new Error("MCP server has no transport configured (expected stdio or http)");
|
|
86
|
+
}
|
|
87
|
+
// Go-toolchain overrides for `go run <module>@<version>` stdio commands so a
|
|
88
|
+
// freshly-tagged version is usable before sum.golang.org indexes it. Mirrors
|
|
89
|
+
// Go's goRunEnvOverrides. Safe: the command comes from operator-authored config.
|
|
90
|
+
function goRunEnvOverrides(command, args) {
|
|
91
|
+
if (command !== "go" || args.length < 2 || args[0] !== "run")
|
|
92
|
+
return [];
|
|
93
|
+
const pkg = args[1].split("@")[0];
|
|
94
|
+
const parts = pkg.split("/");
|
|
95
|
+
if (parts.length < 3)
|
|
96
|
+
return [];
|
|
97
|
+
const prefix = `${parts[0]}/${parts[1]}/${parts[2]}/*`;
|
|
98
|
+
return [`GONOSUMDB=${prefix}`, `GONOSUMCHECK=${prefix}`];
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=discover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../../../src/resources/connect/discover.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CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ConnectResult } from "./connect.js";
|
|
2
|
+
/** A sink for one display line (no trailing newline). */
|
|
3
|
+
export type ConnectSink = (line: string) => void;
|
|
4
|
+
export declare function renderConnectResult(result: ConnectResult, sink: ConnectSink, colorize: boolean): void;
|
|
5
|
+
//# sourceMappingURL=display.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../../src/resources/connect/display.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,yDAAyD;AACzD,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;AAIjD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAgBrG"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Renders a connect result to the terminal. Port of Go's DisplayConnectResult
|
|
2
|
+
// (connect_display.go): server identity + transport, the discovered tools and
|
|
3
|
+
// resource templates, and a saved-vs-dry-run status line.
|
|
4
|
+
import { styler } from "../../output/style.js";
|
|
5
|
+
const NAME_COLUMN = 30;
|
|
6
|
+
export function renderConnectResult(result, sink, colorize) {
|
|
7
|
+
const style = styler(colorize);
|
|
8
|
+
const meta = result.server.metadata;
|
|
9
|
+
sink("");
|
|
10
|
+
sink(style.cyan(`MCP Server: ${meta?.org ?? ""}/${meta?.name ?? ""}`));
|
|
11
|
+
sink(transportLine(result.server));
|
|
12
|
+
sink("");
|
|
13
|
+
renderTools(result, sink);
|
|
14
|
+
renderResourceTemplates(result, sink);
|
|
15
|
+
sink(result.updated !== undefined
|
|
16
|
+
? style.green("✓ Connected — capabilities and tool approvals saved")
|
|
17
|
+
: style.yellow("⚠ Dry run — results not saved to backend"));
|
|
18
|
+
sink("");
|
|
19
|
+
}
|
|
20
|
+
function transportLine(server) {
|
|
21
|
+
const serverType = server.spec?.serverType;
|
|
22
|
+
if (serverType?.case === "stdio")
|
|
23
|
+
return `Transport: stdio (${serverType.value.command})`;
|
|
24
|
+
if (serverType?.case === "http")
|
|
25
|
+
return `Transport: http (${serverType.value.url})`;
|
|
26
|
+
return "Transport: (unknown)";
|
|
27
|
+
}
|
|
28
|
+
function renderTools(result, sink) {
|
|
29
|
+
const tools = result.capabilities?.tools ?? [];
|
|
30
|
+
sink(`Tools (${tools.length}):`);
|
|
31
|
+
if (tools.length === 0) {
|
|
32
|
+
sink(" (none)");
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
for (const tool of tools) {
|
|
36
|
+
sink(tool.description !== "" ? ` ${pad(tool.name)} ${tool.description}` : ` ${tool.name}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
sink("");
|
|
40
|
+
}
|
|
41
|
+
function renderResourceTemplates(result, sink) {
|
|
42
|
+
const templates = result.capabilities?.resourceTemplates ?? [];
|
|
43
|
+
sink(`Resource Templates (${templates.length}):`);
|
|
44
|
+
if (templates.length === 0) {
|
|
45
|
+
sink(" (none)");
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
for (const template of templates) {
|
|
49
|
+
sink(` ${pad(template.name)} ${template.uriTemplate}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
sink("");
|
|
53
|
+
}
|
|
54
|
+
// Left-justify a name to the fixed column width, mirroring Go's "%-30s".
|
|
55
|
+
function pad(name) {
|
|
56
|
+
return name.length >= NAME_COLUMN ? name : name + " ".repeat(NAME_COLUMN - name.length);
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=display.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display.js","sourceRoot":"","sources":["../../../src/resources/connect/display.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,8EAA8E;AAC9E,0D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C,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;AAC1F,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { McpServer } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
|
|
2
|
+
import type { Stigmer } from "@stigmer/sdk";
|
|
3
|
+
import type { BackendType } from "../../config/config.js";
|
|
4
|
+
/** Well-known URL for the Stigmer Cloud web console. */
|
|
5
|
+
export declare const DEFAULT_CLOUD_CONSOLE_URL = "https://app.stigmer.ai";
|
|
6
|
+
/** Injectable side effects + inputs for {@link runOAuthFlow}. */
|
|
7
|
+
export interface OAuthFlowDeps {
|
|
8
|
+
readonly client: Stigmer;
|
|
9
|
+
readonly server: McpServer;
|
|
10
|
+
readonly org: string;
|
|
11
|
+
readonly backendType: BackendType;
|
|
12
|
+
/** Opens the page URL in the user's browser. Defaults to the OS opener. */
|
|
13
|
+
readonly openBrowser?: (url: string) => Promise<void>;
|
|
14
|
+
/** Probes whether the local web console is reachable. Defaults to a 2s GET. */
|
|
15
|
+
readonly probeConsole?: (url: string) => Promise<boolean>;
|
|
16
|
+
/** Current epoch ms. Injectable for deterministic timeout tests. */
|
|
17
|
+
readonly now?: () => number;
|
|
18
|
+
/** Sleep helper. Injectable so tests don't wait real seconds. */
|
|
19
|
+
readonly sleep?: (ms: number) => Promise<void>;
|
|
20
|
+
/** Human-facing log sink (stderr by default, so stdout stays machine-clean). */
|
|
21
|
+
readonly log?: (line: string) => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Run the full interactive OAuth flow: probe (local), open the console, and
|
|
25
|
+
* wait for the grant. Throws a {@link UsageError} if the local console is
|
|
26
|
+
* unreachable or the wait times out.
|
|
27
|
+
*/
|
|
28
|
+
export declare function runOAuthFlow(deps: OAuthFlowDeps): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Poll getOAuthGrantStatus every 3s until the grant is connected or the
|
|
31
|
+
* 5-minute timeout elapses. Throws a {@link UsageError} on timeout.
|
|
32
|
+
*/
|
|
33
|
+
export declare function waitForOAuthGrant(deps: OAuthFlowDeps): Promise<void>;
|
|
34
|
+
/** Query the backend for an existing/just-created OAuth grant. */
|
|
35
|
+
export declare function checkOAuthGrant(client: Stigmer, mcpServerId: string, org: string): Promise<boolean>;
|
|
36
|
+
/**
|
|
37
|
+
* Resolve the web console URL:
|
|
38
|
+
* 1. `STIGMER_CONSOLE_URL` (explicit override)
|
|
39
|
+
* 2. local backend → `http://localhost:{WEB_CONSOLE_PORT}`
|
|
40
|
+
* 3. cloud backend → {@link DEFAULT_CLOUD_CONSOLE_URL}
|
|
41
|
+
*/
|
|
42
|
+
export declare function resolveConsoleURL(backendType: BackendType, env?: NodeJS.ProcessEnv): string;
|
|
43
|
+
/** The OS-specific command + args to open a URL. Exported for tests. */
|
|
44
|
+
export declare function browserCommand(platform: NodeJS.Platform, url: string): [string | undefined, string[]];
|
|
45
|
+
//# sourceMappingURL=oauth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../src/resources/connect/oauth.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AAExF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1D,wDAAwD;AACxD,eAAO,MAAM,yBAAyB,2BAA2B,CAAC;AAMlE,iEAAiE;AACjE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,2EAA2E;IAC3E,Q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local mode)
|
|
3
|
+
// probe that the console is reachable, open the org's MCP-server page so the
|
|
4
|
+
// user can grant access, then poll getOAuthGrantStatus until the grant lands or
|
|
5
|
+
// a 5-minute timeout elapses.
|
|
6
|
+
//
|
|
7
|
+
// Token acquisition and audit identity stay server-side by design; the CLI only
|
|
8
|
+
// shepherds the user to the console and waits for the backend to report success.
|
|
9
|
+
//
|
|
10
|
+
// Every side effect (browser open, console probe, clock, sleep, log sink) is
|
|
11
|
+
// injectable so the poll loop and URL resolution are unit-testable without a
|
|
12
|
+
// real browser, network, or wall-clock delay.
|
|
13
|
+
import { create } from "@bufbuild/protobuf";
|
|
14
|
+
import { GetOAuthGrantStatusInputSchema } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/io_pb";
|
|
15
|
+
import { UsageError } from "../../errors/index.js";
|
|
16
|
+
import { WEB_CONSOLE_PORT } from "../../local/constants.js";
|
|
17
|
+
/** Well-known URL for the Stigmer Cloud web console. */
|
|
18
|
+
export const DEFAULT_CLOUD_CONSOLE_URL = "https://app.stigmer.ai";
|
|
19
|
+
const POLL_INTERVAL_MS = 3000;
|
|
20
|
+
const POLL_TIMEOUT_MS = 5 * 60 * 1000;
|
|
21
|
+
const CONSOLE_PROBE_TIMEOUT_MS = 2000;
|
|
22
|
+
/**
|
|
23
|
+
* Run the full interactive OAuth flow: probe (local), open the console, and
|
|
24
|
+
* wait for the grant. Throws a {@link UsageError} if the local console is
|
|
25
|
+
* unreachable or the wait times out.
|
|
26
|
+
*/
|
|
27
|
+
export async function runOAuthFlow(deps) {
|
|
28
|
+
const log = deps.log ?? stderrLog;
|
|
29
|
+
const consoleURL = resolveConsoleURL(deps.backendType);
|
|
30
|
+
if (deps.backendType === "local") {
|
|
31
|
+
const probe = deps.probeConsole ?? probeWebConsole;
|
|
32
|
+
if (!(await probe(consoleURL)))
|
|
33
|
+
throw consoleUnavailableError(deps.server.metadata?.slug ?? "<slug>");
|
|
34
|
+
}
|
|
35
|
+
const slug = deps.server.metadata?.slug ?? "";
|
|
36
|
+
const name = deps.server.metadata?.name ?? slug;
|
|
37
|
+
const pageURL = `${consoleURL}/${deps.org}/mcp-servers/${slug}`;
|
|
38
|
+
log(`OAuth authentication required for '${name}'.`);
|
|
39
|
+
log("Opening web console to complete authentication...");
|
|
40
|
+
log(`\n If the browser doesn't open automatically, visit:\n ${pageURL}\n`);
|
|
41
|
+
const open = deps.openBrowser ?? openInBrowser;
|
|
42
|
+
try {
|
|
43
|
+
await open(pageURL);
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
log(" Could not open browser automatically. Please open the URL above in your browser.");
|
|
47
|
+
}
|
|
48
|
+
await waitForOAuthGrant(deps);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Poll getOAuthGrantStatus every 3s until the grant is connected or the
|
|
52
|
+
* 5-minute timeout elapses. Throws a {@link UsageError} on timeout.
|
|
53
|
+
*/
|
|
54
|
+
export async function waitForOAuthGrant(deps) {
|
|
55
|
+
const log = deps.log ?? stderrLog;
|
|
56
|
+
const now = deps.now ?? Date.now;
|
|
57
|
+
const sleep = deps.sleep ?? defaultSleep;
|
|
58
|
+
const serverId = deps.server.metadata?.id ?? "";
|
|
59
|
+
const deadline = now() + POLL_TIMEOUT_MS;
|
|
60
|
+
log("Waiting for OAuth connection... (press Ctrl+C to cancel)");
|
|
61
|
+
for (;;) {
|
|
62
|
+
await sleep(POLL_INTERVAL_MS);
|
|
63
|
+
if (now() >= deadline) {
|
|
64
|
+
throw new UsageError("timed out waiting for OAuth connection — please try again");
|
|
65
|
+
}
|
|
66
|
+
if (await checkOAuthGrant(deps.client, serverId, deps.org)) {
|
|
67
|
+
log("OAuth connection established.\n");
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/** Query the backend for an existing/just-created OAuth grant. */
|
|
73
|
+
export async function checkOAuthGrant(client, mcpServerId, org) {
|
|
74
|
+
const status = await client.mcpServer.getOAuthGrantStatus(create(GetOAuthGrantStatusInputSchema, { resourceId: mcpServerId, org }));
|
|
75
|
+
return status.connected;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Resolve the web console URL:
|
|
79
|
+
* 1. `STIGMER_CONSOLE_URL` (explicit override)
|
|
80
|
+
* 2. local backend → `http://localhost:{WEB_CONSOLE_PORT}`
|
|
81
|
+
* 3. cloud backend → {@link DEFAULT_CLOUD_CONSOLE_URL}
|
|
82
|
+
*/
|
|
83
|
+
export function resolveConsoleURL(backendType, env = process.env) {
|
|
84
|
+
const override = env.STIGMER_CONSOLE_URL;
|
|
85
|
+
if (override !== undefined && override !== "")
|
|
86
|
+
return override;
|
|
87
|
+
if (backendType === "local")
|
|
88
|
+
return `http://localhost:${WEB_CONSOLE_PORT}`;
|
|
89
|
+
return DEFAULT_CLOUD_CONSOLE_URL;
|
|
90
|
+
}
|
|
91
|
+
// Probe the local web console with a short-timeout GET. Any HTTP response (even
|
|
92
|
+
// an error status) means it's serving; a network/timeout failure means it isn't.
|
|
93
|
+
async function probeWebConsole(url) {
|
|
94
|
+
try {
|
|
95
|
+
const response = await fetch(url, { signal: AbortSignal.timeout(CONSOLE_PROBE_TIMEOUT_MS) });
|
|
96
|
+
// Drain the body so the socket can close promptly.
|
|
97
|
+
await response.body?.cancel();
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Interactive OAuth needs a web console to host the grant page. The TS CLI does
|
|
105
|
+
// not serve a local console, so for a local backend we steer the user to the two
|
|
106
|
+
// real alternatives — manual credentials, or Stigmer Cloud's hosted console —
|
|
107
|
+
// rather than telling them to enable a console that does not exist locally.
|
|
108
|
+
function consoleUnavailableError(slug) {
|
|
109
|
+
return new UsageError("Interactive OAuth via the web console isn't available for a local backend.\n\n" +
|
|
110
|
+
"To connect this MCP server, either:\n" +
|
|
111
|
+
` - Provide credentials directly: stigmer connect mcp-server ${slug} --env TOKEN=...\n` +
|
|
112
|
+
" - Or use Stigmer Cloud's hosted console: stigmer config backend set cloud");
|
|
113
|
+
}
|
|
114
|
+
// Open a URL in the user's default browser. Mirrors Go's browser.Open: a
|
|
115
|
+
// platform-specific launcher, no new dependency. Callers print the URL first so
|
|
116
|
+
// a launch failure still leaves the user a way forward.
|
|
117
|
+
function openInBrowser(url) {
|
|
118
|
+
return new Promise((resolve, reject) => {
|
|
119
|
+
void (async () => {
|
|
120
|
+
const { spawn } = await import("node:child_process");
|
|
121
|
+
const [command, args] = browserCommand(process.platform, url);
|
|
122
|
+
if (command === undefined) {
|
|
123
|
+
reject(new Error(`unsupported platform: ${process.platform}`));
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const child = spawn(command, args, { stdio: "ignore", detached: true });
|
|
127
|
+
child.once("error", reject);
|
|
128
|
+
child.unref();
|
|
129
|
+
resolve();
|
|
130
|
+
})().catch(reject);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/** The OS-specific command + args to open a URL. Exported for tests. */
|
|
134
|
+
export function browserCommand(platform, url) {
|
|
135
|
+
switch (platform) {
|
|
136
|
+
case "darwin":
|
|
137
|
+
return ["open", [url]];
|
|
138
|
+
case "win32":
|
|
139
|
+
return ["rundll32", ["url.dll,FileProtocolHandler", url]];
|
|
140
|
+
case "linux":
|
|
141
|
+
return ["xdg-open", [url]];
|
|
142
|
+
default:
|
|
143
|
+
return [undefined, []];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function defaultSleep(ms) {
|
|
147
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
148
|
+
}
|
|
149
|
+
function stderrLog(line) {
|
|
150
|
+
process.stderr.write(`${line}\n`);
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=oauth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../src/resources/connect/oauth.ts"],"names":[],"mapp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AC,CAAC;QAC7B;YACE,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,EAAU;IAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Stigmer } from "@stigmer/sdk";
|
|
2
|
+
import { CommandResult } from "../output/index.js";
|
|
3
|
+
/** A staged delete: confirmation content plus the mutation to run on approval. */
|
|
4
|
+
export interface DeletePlan {
|
|
5
|
+
/** Shown to the user (unless `--force`) before the destructive action. */
|
|
6
|
+
readonly warning: CommandResult;
|
|
7
|
+
/** The yes/no question, e.g. "Proceed with deletion? [y/N]". */
|
|
8
|
+
readonly confirmPrompt: string;
|
|
9
|
+
/** Runs the mutation and returns the result to render. */
|
|
10
|
+
perform(): Promise<CommandResult>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Build the delete plan for a `<type> <reference>` pair. Routes the three
|
|
14
|
+
* special cases first, then the registry-driven standard path. Throws on
|
|
15
|
+
* unknown/unsupported types before any network call.
|
|
16
|
+
*/
|
|
17
|
+
export declare function planDelete(client: Stigmer, typeArg: string, reference: string, org: string): Promise<DeletePlan>;
|
|
18
|
+
//# sourceMappingURL=delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../src/resources/delete.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAOnD,kFAAkF;AAClF,MAAM,WAAW,UAAU;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,gEAAgE;IAChE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,0DAA0D;IAC1D,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;CACnC;AAyBD;;;;GAIG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,UAAU,CAAC,CA0BrB"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
// `delete` dispatch: resolve a resource by reference, describe it for a
|
|
2
|
+
// confirmation prompt, then delete it. Mirrors the Go CLI's unified delete,
|
|
3
|
+
// including its three special cases:
|
|
4
|
+
//
|
|
5
|
+
// - execution → maps to a *cancel* (agent executions only, by ID)
|
|
6
|
+
// - organization → not org-scoped; resolved via findMyOrganizations
|
|
7
|
+
// - api_key → addressable by ID only (not slug)
|
|
8
|
+
//
|
|
9
|
+
// The deletion verbs are id-shaped mutations, so they ride the high-level
|
|
10
|
+
// `client.stigmer.*` sub-clients — only `apply` needs raw controllers (see the
|
|
11
|
+
// Wave 2 architecture note). Fetching reuses the `get` bindings rather than
|
|
12
|
+
// re-implementing a second fetch path.
|
|
13
|
+
//
|
|
14
|
+
// Each kind produces a DeletePlan: a warning to show before confirming, the
|
|
15
|
+
// confirmation prompt, and a `perform` thunk that runs the mutation and returns
|
|
16
|
+
// the success/already-terminal result. The command layer owns the interaction
|
|
17
|
+
// (render warning → confirm → perform → render result); this module owns *what*
|
|
18
|
+
// to delete and *how* to describe it.
|
|
19
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
20
|
+
import { ExecutionPhase } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
21
|
+
import { CliExitError, ExitCode, UsageError } from "../errors/index.js";
|
|
22
|
+
import { CommandResult } from "../output/index.js";
|
|
23
|
+
import { defaultRegistry, Verb } from "../registry/index.js";
|
|
24
|
+
import { cancelAgentExecution, formatAgentPhase, isAgentExecutionId, isExecutionAlias } from "./execution.js";
|
|
25
|
+
import { fetchResource } from "./get.js";
|
|
26
|
+
import { getterFor } from "./get-bindings.js";
|
|
27
|
+
import { parseReference } from "./reference.js";
|
|
28
|
+
// Kinds the unified delete handles directly, each bound to its SDK delete call.
|
|
29
|
+
// Mirrors Go's routeDelete switch exactly: kinds that carry a Delete verb but no
|
|
30
|
+
// entry here (identity_provider, oauth_app, environment, instances, session)
|
|
31
|
+
// fall through to a "not implemented" usage error, as in Go's default branch.
|
|
32
|
+
// McpServer is the outlier whose delete takes a DeleteResourceInput, not an ID.
|
|
33
|
+
const DELETE_HANDLERS = new Map([
|
|
34
|
+
[ApiResourceKind.agent, (c, id) => c.agent.delete(id)],
|
|
35
|
+
[ApiResourceKind.workflow, (c, id) => c.workflow.delete(id)],
|
|
36
|
+
[ApiResourceKind.mcp_server, (c, id) => c.mcpServer.delete({ resourceId: id })],
|
|
37
|
+
[ApiResourceKind.project, (c, id) => c.project.delete(id)],
|
|
38
|
+
[ApiResourceKind.skill, (c, id) => c.skill.delete(id)],
|
|
39
|
+
[ApiResourceKind.api_key, (c, id) => c.apiKey.delete(id)],
|
|
40
|
+
]);
|
|
41
|
+
/**
|
|
42
|
+
* Build the delete plan for a `<type> <reference>` pair. Routes the three
|
|
43
|
+
* special cases first, then the registry-driven standard path. Throws on
|
|
44
|
+
* unknown/unsupported types before any network call.
|
|
45
|
+
*/
|
|
46
|
+
export async function planDelete(client, typeArg, reference, org) {
|
|
47
|
+
if (isExecutionAlias(typeArg)) {
|
|
48
|
+
return planExecutionCancel(client, reference);
|
|
49
|
+
}
|
|
50
|
+
const info = defaultRegistry().getByAlias(typeArg);
|
|
51
|
+
if (info === undefined) {
|
|
52
|
+
throw new UsageError(`unknown resource type: ${typeArg}\n\nAvailable types: agent, workflow, mcpserver, project, skill, execution, organization`);
|
|
53
|
+
}
|
|
54
|
+
if (info.kind === ApiResourceKind.organization) {
|
|
55
|
+
return planOrganizationDelete(client, reference);
|
|
56
|
+
}
|
|
57
|
+
if (!info.supportedVerbs.has(Verb.Delete)) {
|
|
58
|
+
throw new UsageError(`${info.displayName} does not support 'delete'`);
|
|
59
|
+
}
|
|
60
|
+
const deleteFn = DELETE_HANDLERS.get(info.kind);
|
|
61
|
+
if (deleteFn === undefined) {
|
|
62
|
+
throw new UsageError(`delete not implemented for ${info.displayName}`);
|
|
63
|
+
}
|
|
64
|
+
return planStandardDelete(client, info, reference, org, deleteFn);
|
|
65
|
+
}
|
|
66
|
+
async function planStandardDelete(client, info, reference, org, deleteFn) {
|
|
67
|
+
// Safe by construction: every DELETE_HANDLERS key also has a get binding.
|
|
68
|
+
const getter = getterFor(info.kind);
|
|
69
|
+
if (getter === undefined) {
|
|
70
|
+
throw new UsageError(`delete not implemented for ${info.displayName}`);
|
|
71
|
+
}
|
|
72
|
+
const parsed = parseReference(reference, org, info.idPrefix);
|
|
73
|
+
// ResourceResult.message is the opaque proto Message; every resource carries
|
|
74
|
+
// the ApiResourceMetadata envelope, so read it through the structural view.
|
|
75
|
+
const resource = (await getter(client, parsed)).message;
|
|
76
|
+
const id = metaOf(resource).id;
|
|
77
|
+
return {
|
|
78
|
+
warning: buildDeleteWarning(info, resource),
|
|
79
|
+
confirmPrompt: "Proceed with deletion? [y/N]",
|
|
80
|
+
perform: async () => buildDeleteSuccess(info, await deleteFn(client, id)),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
async function planOrganizationDelete(client, reference) {
|
|
84
|
+
// Organizations are not org-scoped: a bare token is a slug resolved against
|
|
85
|
+
// the caller's memberships (fetchResource handles the id-vs-slug split).
|
|
86
|
+
const parsed = parseReference(reference, "", "org");
|
|
87
|
+
const resource = (await fetchResource(client, ApiResourceKind.organization, parsed)).message;
|
|
88
|
+
const meta = metaOf(resource);
|
|
89
|
+
const warning = CommandResult.warning("You are about to delete the following organization:");
|
|
90
|
+
warning.addSection("").field("ID", meta.id).field("Name", meta.name).field("Slug", meta.slug);
|
|
91
|
+
warning.hint("This will delete the organization and all its resources.");
|
|
92
|
+
warning.hint("This action cannot be undone.");
|
|
93
|
+
return {
|
|
94
|
+
warning,
|
|
95
|
+
confirmPrompt: "Proceed with deletion? [y/N]",
|
|
96
|
+
perform: async () => {
|
|
97
|
+
const deleted = metaOf(await client.organization.delete(meta.id));
|
|
98
|
+
const out = CommandResult.success("Organization deleted successfully");
|
|
99
|
+
out.addSection("Deleted Organization").field("ID", deleted.id).field("Name", deleted.name).field("Slug", deleted.slug);
|
|
100
|
+
return out;
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function planExecutionCancel(client, reference) {
|
|
105
|
+
if (!isAgentExecutionId(reference)) {
|
|
106
|
+
throw new CliExitError(`invalid execution ID: ${reference}\n\nExecutions must be referenced by ID (e.g., aex_01abc123)`, ExitCode.Usage);
|
|
107
|
+
}
|
|
108
|
+
const warning = CommandResult.warning(`You are about to cancel execution: ${reference}`);
|
|
109
|
+
warning.hint("This will gracefully stop the running agent.");
|
|
110
|
+
return {
|
|
111
|
+
warning,
|
|
112
|
+
confirmPrompt: "Proceed with cancellation? [y/N]",
|
|
113
|
+
perform: async () => {
|
|
114
|
+
const { execution, wasAlreadyTerminal } = await cancelAgentExecution(client, reference);
|
|
115
|
+
const id = execution.metadata?.id ?? "";
|
|
116
|
+
const status = formatAgentPhase(execution.status?.phase ?? ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED);
|
|
117
|
+
const out = wasAlreadyTerminal
|
|
118
|
+
? CommandResult.warning("Execution was already in terminal state")
|
|
119
|
+
: CommandResult.success("Execution cancelled successfully");
|
|
120
|
+
out.addSection("Execution").field("ID", id).field("Status", status);
|
|
121
|
+
return out;
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
// --- Warning + success rendering (mirrors Go's per-type delete handlers) ---
|
|
126
|
+
function buildDeleteWarning(info, message) {
|
|
127
|
+
if (info.kind === ApiResourceKind.api_key) {
|
|
128
|
+
return buildApiKeyWarning(message);
|
|
129
|
+
}
|
|
130
|
+
const meta = metaOf(message);
|
|
131
|
+
const warning = CommandResult.warning(`You are about to delete the following ${info.displayName.toLowerCase()}:`);
|
|
132
|
+
const section = warning
|
|
133
|
+
.addSection("")
|
|
134
|
+
.field("ID", meta.id)
|
|
135
|
+
.field("Name", meta.name)
|
|
136
|
+
.field("Slug", meta.slug)
|
|
137
|
+
.field("Org", meta.org);
|
|
138
|
+
if (info.kind === ApiResourceKind.skill) {
|
|
139
|
+
const tag = message.spec?.tag;
|
|
140
|
+
if (tag)
|
|
141
|
+
section.field("Tag", tag);
|
|
142
|
+
warning.hint("This will delete the skill and all its versions.");
|
|
143
|
+
}
|
|
144
|
+
warning.hint("This action cannot be undone.");
|
|
145
|
+
return warning;
|
|
146
|
+
}
|
|
147
|
+
function buildApiKeyWarning(message) {
|
|
148
|
+
const meta = metaOf(message);
|
|
149
|
+
const warning = CommandResult.warning("You are about to delete the following API key:");
|
|
150
|
+
const section = warning.addSection("").field("ID", meta.id);
|
|
151
|
+
if (meta.name)
|
|
152
|
+
section.field("Name", meta.name);
|
|
153
|
+
const fingerprint = message.spec?.fingerprint;
|
|
154
|
+
if (fingerprint)
|
|
155
|
+
section.field("Fingerprint", `***${fingerprint}`);
|
|
156
|
+
warning.hint("This will permanently revoke the API key.");
|
|
157
|
+
warning.hint("This action cannot be undone.");
|
|
158
|
+
return warning;
|
|
159
|
+
}
|
|
160
|
+
function buildDeleteSuccess(info, deleted) {
|
|
161
|
+
const meta = metaOf(deleted);
|
|
162
|
+
const out = CommandResult.success(`${info.displayName} deleted successfully`);
|
|
163
|
+
const section = out.addSection(`Deleted ${info.displayName}`).field("ID", meta.id);
|
|
164
|
+
if (info.kind === ApiResourceKind.api_key) {
|
|
165
|
+
if (meta.name)
|
|
166
|
+
section.field("Name", meta.name);
|
|
167
|
+
return out;
|
|
168
|
+
}
|
|
169
|
+
section.field("Name", meta.name).field("Slug", meta.slug);
|
|
170
|
+
return out;
|
|
171
|
+
}
|
|
172
|
+
function metaOf(message) {
|
|
173
|
+
return {
|
|
174
|
+
id: message.metadata?.id ?? "",
|
|
175
|
+
name: message.metadata?.name ?? "",
|
|
176
|
+
slug: message.metadata?.slug ?? "",
|
|
177
|
+
org: message.metadata?.org ?? "",
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../src/resources/delete.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,4EAA4E;AAC5E,qCAAqC;AACrC,EAAE;AACF,qEAAqE;AACrE,sEAAsE;AACtE,qDAAqD;AACrD,EAAE;AACF,0EAA0E;AAC1E,+EAA+E;AAC/E,4EAA4E;AAC5E,uCAAuC;AACvC,EAAE;AACF,4EAA4E;AAC5E,gFAAgF;AAChF,8EAA8E;AAC9E,gFAAgF;AAChF,sCAAsC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AACtH,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAE9F,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAiB,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC9G,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C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ED,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1D,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,MAAM,CAAC,OAAoB;IAClC,OAAO;QACL,EAAE,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE;QAC9B,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,IAAI,IAAI,EAAE;QAClC,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,IAAI,IAAI,EAAE;QAClC,GAAG,EAAE,OAAO,CAAC,QAAQ,EAAE,GAAG,IAAI,EAAE;KACjC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { JsonValue } from "@bufbuild/protobuf";
|
|
2
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
3
|
+
import type { Stigmer } from "@stigmer/sdk";
|
|
4
|
+
export type DiffResult = {
|
|
5
|
+
readonly status: "new";
|
|
6
|
+
} | {
|
|
7
|
+
readonly status: "same";
|
|
8
|
+
} | {
|
|
9
|
+
readonly status: "changed";
|
|
10
|
+
readonly text: string;
|
|
11
|
+
};
|
|
12
|
+
/** Diff one document against its remote state, returning what changed. */
|
|
13
|
+
export declare function diffDocument(client: Stigmer, kind: ApiResourceKind, localRaw: string, document: JsonValue, baseName: string, org: string, contextLines: number): Promise<DiffResult>;
|
|
14
|
+
/** Produce a unified diff of `a`→`b` with `context` trailing context lines. */
|
|
15
|
+
export declare function unifiedDiff(a: string, b: string, labelA: string, labelB: string, context: number): string;
|
|
16
|
+
//# sourceMappingURL=diff.d.ts.map
|