@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
package/auth/token.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// Auth0 token operations: exchange an authorization code for tokens, refresh an
|
|
2
|
+
// expired access token, and expose a token provider that refreshes silently.
|
|
3
|
+
import { save } from "../config/index.js";
|
|
4
|
+
import { CliExitError, ExitCode } from "../errors/index.js";
|
|
5
|
+
import { CLIENT_ID, callbackUrl, TOKEN_URL } from "./auth0.js";
|
|
6
|
+
// Refresh this many ms before the real expiry so an in-flight request never
|
|
7
|
+
// races the token going stale.
|
|
8
|
+
const EXPIRY_SKEW_MS = 60_000;
|
|
9
|
+
/** Exchange a PKCE authorization code for an access (+refresh) token. */
|
|
10
|
+
export async function exchangeCode(params) {
|
|
11
|
+
return postToken({
|
|
12
|
+
grant_type: "authorization_code",
|
|
13
|
+
client_id: CLIENT_ID,
|
|
14
|
+
code: params.code,
|
|
15
|
+
redirect_uri: callbackUrl(),
|
|
16
|
+
code_verifier: params.codeVerifier,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/** Exchange a refresh token for a fresh access token. */
|
|
20
|
+
export async function refreshAccessToken(refreshToken) {
|
|
21
|
+
return postToken({
|
|
22
|
+
grant_type: "refresh_token",
|
|
23
|
+
client_id: CLIENT_ID,
|
|
24
|
+
refresh_token: refreshToken,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A token provider for the backend client that keeps the access token fresh.
|
|
29
|
+
*
|
|
30
|
+
* Precedence and behavior, evaluated per request:
|
|
31
|
+
* 1. STIGMER_API_KEY (env / bridged --api-key) wins and is never refreshed.
|
|
32
|
+
* 2. A non-expired access token is returned as-is.
|
|
33
|
+
* 3. An expired token with a refresh token is refreshed; the new token,
|
|
34
|
+
* rotated refresh token, and expiry are persisted, then returned.
|
|
35
|
+
* 4. Otherwise the (possibly stale) token or null is returned, letting the
|
|
36
|
+
* server reject it so the error maps to a clear "please log in" exit.
|
|
37
|
+
*
|
|
38
|
+
* Closes over `config` so a refresh updates the same object the rest of the
|
|
39
|
+
* command sees, and writes it through to disk.
|
|
40
|
+
*/
|
|
41
|
+
export function createRefreshingTokenProvider(config) {
|
|
42
|
+
return async () => {
|
|
43
|
+
const envKey = process.env.STIGMER_API_KEY;
|
|
44
|
+
if (envKey !== undefined && envKey !== "")
|
|
45
|
+
return envKey;
|
|
46
|
+
const cloud = config.backend.cloud;
|
|
47
|
+
if (cloud?.token === undefined || cloud.token === "") {
|
|
48
|
+
return cloud?.refresh_token ? refreshAndPersist(config, cloud.refresh_token) : null;
|
|
49
|
+
}
|
|
50
|
+
if (!isExpired(cloud.token_expiry))
|
|
51
|
+
return cloud.token;
|
|
52
|
+
if (cloud.refresh_token === undefined || cloud.refresh_token === "")
|
|
53
|
+
return cloud.token;
|
|
54
|
+
return refreshAndPersist(config, cloud.refresh_token);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
async function refreshAndPersist(config, refreshToken) {
|
|
58
|
+
let next;
|
|
59
|
+
try {
|
|
60
|
+
next = await refreshAccessToken(refreshToken);
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
// Refresh failed (revoked/expired refresh token). Fall back to the current
|
|
64
|
+
// token if any; the server will reject it and the user is prompted to log in.
|
|
65
|
+
return config.backend.cloud?.token ?? null;
|
|
66
|
+
}
|
|
67
|
+
const cloud = config.backend.cloud ?? {};
|
|
68
|
+
cloud.token = next.accessToken;
|
|
69
|
+
if (next.refreshToken !== undefined)
|
|
70
|
+
cloud.refresh_token = next.refreshToken;
|
|
71
|
+
cloud.token_expiry = next.expiresAt;
|
|
72
|
+
config.backend.cloud = cloud;
|
|
73
|
+
save(config);
|
|
74
|
+
return next.accessToken;
|
|
75
|
+
}
|
|
76
|
+
function isExpired(expiresAt) {
|
|
77
|
+
// Legacy tokens persisted without an expiry are assumed valid; the server is
|
|
78
|
+
// the ultimate authority and a 401 triggers re-login.
|
|
79
|
+
if (expiresAt === undefined || expiresAt === "")
|
|
80
|
+
return false;
|
|
81
|
+
const expiryMs = Date.parse(expiresAt);
|
|
82
|
+
if (Number.isNaN(expiryMs))
|
|
83
|
+
return false;
|
|
84
|
+
return Date.now() >= expiryMs - EXPIRY_SKEW_MS;
|
|
85
|
+
}
|
|
86
|
+
async function postToken(form) {
|
|
87
|
+
let response;
|
|
88
|
+
try {
|
|
89
|
+
response = await fetch(TOKEN_URL, {
|
|
90
|
+
method: "POST",
|
|
91
|
+
headers: { "content-type": "application/x-www-form-urlencoded" },
|
|
92
|
+
body: new URLSearchParams(form).toString(),
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
throw new CliExitError(`failed to reach the authentication server: ${err.message}`, ExitCode.Connection);
|
|
97
|
+
}
|
|
98
|
+
const body = (await response.json().catch(() => ({})));
|
|
99
|
+
if (!response.ok || body.access_token === undefined) {
|
|
100
|
+
const detail = body.error_description ?? body.error ?? `HTTP ${response.status}`;
|
|
101
|
+
throw new CliExitError(`authentication failed: ${detail}`, ExitCode.Auth);
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
accessToken: body.access_token,
|
|
105
|
+
refreshToken: body.refresh_token,
|
|
106
|
+
expiresAt: body.expires_in !== undefined
|
|
107
|
+
? new Date(Date.now() + body.expires_in * 1000).toISOString()
|
|
108
|
+
: undefined,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../src/auth/token.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,6EAA6E;AAG7E,OAAO,EAAe,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,WAAW,E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
|
+
import { type BackendClient } from "./client/index.js";
|
|
2
|
+
import { type Config } from "./config/index.js";
|
|
3
|
+
/** Build a backend client for the given (or on-disk) config, with auto-refresh. */
|
|
4
|
+
export declare function connectBackend(config?: Config): BackendClient;
|
|
5
|
+
//# sourceMappingURL=backend.d.ts.map
|
package/backend.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEtD,mFAAmF;AACnF,wBAAgB,cAAc,CAAC,MAAM,GAAE,MAAe,GAAG,aAAa,CAErE"}
|
package/backend.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Composition root for the backend client.
|
|
2
|
+
//
|
|
3
|
+
// `createBackendClient` (the client module) is deliberately auth-agnostic; this
|
|
4
|
+
// is the one place that injects the refreshing token provider so every command
|
|
5
|
+
// gets silent token refresh without the client module depending on auth. Keep
|
|
6
|
+
// this as the single entry point commands use to reach the backend.
|
|
7
|
+
import { createRefreshingTokenProvider } from "./auth/token.js";
|
|
8
|
+
import { createBackendClient } from "./client/index.js";
|
|
9
|
+
import { load } from "./config/index.js";
|
|
10
|
+
/** Build a backend client for the given (or on-disk) config, with auto-refresh. */
|
|
11
|
+
export function connectBackend(config = load()) {
|
|
12
|
+
return createBackendClient({ config, getAccessToken: createRefreshingTokenProvider(config) });
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=backend.js.map
|
package/backend.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,8EAA8E;AAC9E,oEAAoE;AAEpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAsB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEtD,mFAAmF;AACnF,MAAM,UAAU,cAAc,CAAC,SAAiB,IAAI,EAAE;IACpD,OAAO,mBAAmB,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,6BAA6B,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAChG,CAAC"}
|
package/cli/stigmer.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stigmer.d.ts","sourceRoot":"","sources":["../../src/cli/stigmer.ts"],"names":[],"mappings":""}
|
package/cli/stigmer.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Entry point for the `stigmer` CLI. Builds the commander program and runs it.
|
|
3
|
+
//
|
|
4
|
+
// Every command-action failure (and any parse-time rejection) funnels through
|
|
5
|
+
// clierr.handle, the single exit point that maps the error to a stable exit
|
|
6
|
+
// code and prints a user-facing message to stderr.
|
|
7
|
+
import { handle } from "../errors/index.js";
|
|
8
|
+
import { buildProgram } from "../program.js";
|
|
9
|
+
async function main() {
|
|
10
|
+
const program = buildProgram();
|
|
11
|
+
await program.parseAsync(process.argv);
|
|
12
|
+
}
|
|
13
|
+
main().catch(handle);
|
|
14
|
+
//# sourceMappingURL=stigmer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stigmer.js","sourceRoot":"","sources":["../../src/cli/stigmer.ts"],"names":[],"mappings":";AACA,+EAA+E;AAC/E,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,mDAAmD;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;IAC/B,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { DescService } from "@bufbuild/protobuf";
|
|
2
|
+
import { type Client, type Transport } from "@connectrpc/connect";
|
|
3
|
+
import { Stigmer, type TokenProvider } from "@stigmer/sdk";
|
|
4
|
+
import { type Config } from "../config/index.js";
|
|
5
|
+
/** The composed backend client returned by {@link createBackendClient}. */
|
|
6
|
+
export interface BackendClient {
|
|
7
|
+
/** High-level typed client for reads (and high-level writes). */
|
|
8
|
+
readonly stigmer: Stigmer;
|
|
9
|
+
/** The shared underlying transport. */
|
|
10
|
+
readonly transport: Transport;
|
|
11
|
+
/** The config this client was built from (for org resolution by callers). */
|
|
12
|
+
readonly config: Config;
|
|
13
|
+
/** Create a raw Connect client for a generated service controller. */
|
|
14
|
+
controller<Desc extends DescService>(service: Desc): Client<Desc>;
|
|
15
|
+
/** Probe the server (unauthenticated) to fail fast on connectivity issues. */
|
|
16
|
+
connect(timeoutMs?: number): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export interface BackendClientOptions {
|
|
19
|
+
/** Config to use; defaults to the on-disk config (or standalone default). */
|
|
20
|
+
readonly config?: Config;
|
|
21
|
+
/** Token-provider override (the auth module supplies a refreshing provider). */
|
|
22
|
+
readonly getAccessToken?: TokenProvider;
|
|
23
|
+
}
|
|
24
|
+
export declare function createBackendClient(options?: BackendClientOptions): BackendClient;
|
|
25
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,KAAK,MAAM,EAAgB,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,KAAK,MAAM,EAAuC,MAAM,oBAAoB,CAAC;AAGtF,2EAA2E;AAC3E,MAAM,WAAW,aAAa;IAC5B,iEAAiE;IACjE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,uCAAuC;IACvC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,UAAU,CAAC,IAAI,SAAS,WAAW,EAAE,OAAO,EAAE,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAClE,8EAA8E;IAC9E,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,gFAAgF;IAChF,QAAQ,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC;CACzC;AAID,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAAyB,GAAG,aAAa,CAuBrF"}
|
package/client/client.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Backend client façade.
|
|
2
|
+
//
|
|
3
|
+
// Builds a single transport (via the SDK's createNodeTransport + the Go-parity
|
|
4
|
+
// normalizeEndpoint) and exposes:
|
|
5
|
+
// - `stigmer`: the high-level typed client, used by read verbs.
|
|
6
|
+
// - `transport` + `controller(service)`: the raw Connect layer, so write
|
|
7
|
+
// flows (a later wave) can drive generated controllers directly for full
|
|
8
|
+
// YAML->proto fidelity rather than the high-level client's lossy inputs.
|
|
9
|
+
//
|
|
10
|
+
// This module holds no business logic: backend selection, token precedence, and
|
|
11
|
+
// endpoint shape are delegated to the config layer; org resolution and verb
|
|
12
|
+
// dispatch live with the commands and the registry.
|
|
13
|
+
import { createClient } from "@connectrpc/connect";
|
|
14
|
+
import { Stigmer } from "@stigmer/sdk";
|
|
15
|
+
import { createNodeTransport, normalizeEndpoint } from "@stigmer/sdk/node";
|
|
16
|
+
import { load, resolveEndpoint, resolveToken } from "../config/index.js";
|
|
17
|
+
import { CliExitError, ExitCode } from "../errors/index.js";
|
|
18
|
+
const DEFAULT_CONNECT_TIMEOUT_MS = 10_000;
|
|
19
|
+
export function createBackendClient(options = {}) {
|
|
20
|
+
const config = options.config ?? load();
|
|
21
|
+
const baseUrl = normalizeEndpoint(resolveEndpoint(config));
|
|
22
|
+
// Dynamic provider: re-reads env/config on every request so a token refreshed
|
|
23
|
+
// mid-session is picked up. STIGMER_API_KEY > config token precedence lives in
|
|
24
|
+
// resolveToken; a caller-supplied provider (refresh-aware) takes over entirely.
|
|
25
|
+
const tokenProvider = options.getAccessToken ?? (() => resolveToken(config) || null);
|
|
26
|
+
const transport = createNodeTransport({ baseUrl, getAccessToken: tokenProvider });
|
|
27
|
+
const stigmer = new Stigmer({ baseUrl, getAccessToken: tokenProvider, customTransport: transport });
|
|
28
|
+
return {
|
|
29
|
+
stigmer,
|
|
30
|
+
transport,
|
|
31
|
+
config,
|
|
32
|
+
controller(service) {
|
|
33
|
+
return createClient(service, transport);
|
|
34
|
+
},
|
|
35
|
+
async connect(timeoutMs = DEFAULT_CONNECT_TIMEOUT_MS) {
|
|
36
|
+
await withTimeout(stigmer.platform.getServerInfo(), timeoutMs);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
// Soft timeout: races the RPC against a timer. It cannot cancel the underlying
|
|
41
|
+
// request, but the CLI exits immediately after, so the dangling call is moot.
|
|
42
|
+
async function withTimeout(promise, timeoutMs) {
|
|
43
|
+
let timer;
|
|
44
|
+
const timeout = new Promise((_, reject) => {
|
|
45
|
+
timer = setTimeout(() => reject(new CliExitError("Timed out connecting to the Stigmer server", ExitCode.Connection)), timeoutMs);
|
|
46
|
+
});
|
|
47
|
+
try {
|
|
48
|
+
return await Promise.race([promise, timeout]);
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
if (timer !== undefined)
|
|
52
|
+
clearTimeout(timer);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,EAAE;AACF,+EAA+E;AAC/E,kCAAkC;AAClC,kEAAkE;AAClE,2EAA2E;AAC3E,6EAA6E;AAC7E,6EAA6E;AAC7E,EAAE;AACF,gFAAgF;AAChF,4EAA4E;AAC5E,oDAAoD;AAGpD,OAAO,EAAe,YAAY,EAAkB,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,OAAO,EAAsB,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAe,IAAI,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAuB5D,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAE1C,MAAM,UAAU,mBAAmB,CAAC,UAAgC,EAAE;IACpE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;IACxC,MAAM,OAAO,GAAG,iBAAiB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAE3D,8EAA8E;IAC9E,+EAA+E;IAC/E,gFAAgF;IAChF,MAAM,aAAa,GAAkB,OAAO,CAAC,cAAc,IAAI,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,IAAI,C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,EAAE,KAAK,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
|
package/client/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,OAAO,EAAiD,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { AgentExecFlags } from "../resources/run/prepare.js";
|
|
3
|
+
/** Commander collector for repeatable string options. */
|
|
4
|
+
export declare const collect: (value: string, previous: string[]) => string[];
|
|
5
|
+
/** The parsed shape of the shared agent-exec options on a commander command. */
|
|
6
|
+
export interface AgentExecOptions {
|
|
7
|
+
message?: string;
|
|
8
|
+
attach: string[];
|
|
9
|
+
approveDefault?: string;
|
|
10
|
+
verbose?: boolean;
|
|
11
|
+
detach?: boolean;
|
|
12
|
+
workspace: string[];
|
|
13
|
+
branch?: string;
|
|
14
|
+
commit?: string;
|
|
15
|
+
env: string[];
|
|
16
|
+
envFile: string[];
|
|
17
|
+
secret: string[];
|
|
18
|
+
secretFile: string[];
|
|
19
|
+
model?: string;
|
|
20
|
+
autoApprove?: boolean;
|
|
21
|
+
mode?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Register the shared agent-exec options on `command`. `requireMessage` marks
|
|
25
|
+
* `-m/--message` as required (draft requires a prompt; run does not).
|
|
26
|
+
*/
|
|
27
|
+
export declare function addAgentExecFlags(command: Command, requireMessage?: boolean): Command;
|
|
28
|
+
/** Map parsed commander options onto the shared {@link AgentExecFlags} shape. */
|
|
29
|
+
export declare function toAgentExecFlags(options: AgentExecOptions): AgentExecFlags;
|
|
30
|
+
//# sourceMappingURL=agent-exec-flags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-exec-flags.d.ts","sourceRoot":"","sources":["../../src/commands/agent-exec-flags.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAW,MAAM,6BAA6B,CAAC;AAE3E,yDAAyD;AACzD,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,EAAE,UAAU,MAAM,EAAE,KAAG,MAAM,EAA0B,CAAC;AAE7F,gFAAgF;AAChF,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,UAAQ,GAAG,OAAO,CAoBnF;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,cAAc,CAkB1E"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// The agent-execution flag set shared by `run` and `draft` (Go's
|
|
2
|
+
// registerAgentExecFlags). Centralized so both commands stay in lockstep — a new
|
|
3
|
+
// execution flag is added here once and both surfaces pick it up.
|
|
4
|
+
/** Commander collector for repeatable string options. */
|
|
5
|
+
export const collect = (value, previous) => [...previous, value];
|
|
6
|
+
/**
|
|
7
|
+
* Register the shared agent-exec options on `command`. `requireMessage` marks
|
|
8
|
+
* `-m/--message` as required (draft requires a prompt; run does not).
|
|
9
|
+
*/
|
|
10
|
+
export function addAgentExecFlags(command, requireMessage = false) {
|
|
11
|
+
const messageDesc = "initial message/prompt for execution";
|
|
12
|
+
if (requireMessage)
|
|
13
|
+
command.requiredOption("-m, --message <text>", messageDesc);
|
|
14
|
+
else
|
|
15
|
+
command.option("-m, --message <text>", messageDesc);
|
|
16
|
+
return command
|
|
17
|
+
.option("--attach <path>", "file or directory to attach as input (repeatable)", collect, [])
|
|
18
|
+
.option("--approve-default <action>", "auto-resolve approvals in headless mode (approve, skip, reject, approve-all)")
|
|
19
|
+
.option("-v, --verbose", "show execution IDs and phase transitions")
|
|
20
|
+
.option("--detach", "start execution and return immediately without streaming")
|
|
21
|
+
.option("-w, --workspace <source>", "workspace: HTTPS git URL or local path (repeatable)", collect, [])
|
|
22
|
+
.option("--branch <name>", "git branch to clone (single git workspace only)")
|
|
23
|
+
.option("--commit <sha>", "git commit SHA to checkout (single git workspace only)")
|
|
24
|
+
.option("--env <kv>", "runtime env var KEY=VALUE (repeatable)", collect, [])
|
|
25
|
+
.option("--env-file <path>", "load env from file (repeatable, later override earlier)", collect, [])
|
|
26
|
+
.option("--secret <kv>", "secret env var KEY=VALUE (repeatable, encrypted)", collect, [])
|
|
27
|
+
.option("--secret-file <path>", "load secrets from file (repeatable, encrypted)", collect, [])
|
|
28
|
+
.option("--model <model>", "LLM model to use (e.g. claude-sonnet-4-6)")
|
|
29
|
+
.option("--auto-approve", "automatically approve all tool executions")
|
|
30
|
+
.option("--mode <mode>", 'interaction mode: "agent" (default) or "plan" (read-only)');
|
|
31
|
+
}
|
|
32
|
+
/** Map parsed commander options onto the shared {@link AgentExecFlags} shape. */
|
|
33
|
+
export function toAgentExecFlags(options) {
|
|
34
|
+
return {
|
|
35
|
+
message: options.message ?? "",
|
|
36
|
+
attach: options.attach,
|
|
37
|
+
approveDefault: options.approveDefault ?? "",
|
|
38
|
+
verbose: options.verbose === true,
|
|
39
|
+
detach: options.detach === true,
|
|
40
|
+
workspace: options.workspace,
|
|
41
|
+
branch: options.branch ?? "",
|
|
42
|
+
commit: options.commit ?? "",
|
|
43
|
+
env: options.env,
|
|
44
|
+
envFile: options.envFile,
|
|
45
|
+
secret: options.secret,
|
|
46
|
+
secretFile: options.secretFile,
|
|
47
|
+
model: options.model ?? "",
|
|
48
|
+
autoApprove: options.autoApprove === true,
|
|
49
|
+
mode: (options.mode ?? ""),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=agent-exec-flags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-exec-flags.js","sourceRoot":"","sources":["../../src/commands/agent-exec-flags.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,iFAAiF;AACjF,kEAAkE;AAKlE,yDAAyD;AACzD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,QAAkB,EAAY,EAAE,CAAC,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC,CAAC;AAqB7F;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAgB,EAAE,cAAc,GAAG,KAAK;IACxE,MAAM,WAAW,GAAG,sCAAsC,CAAC;IAC3D,IAAI,cAAc;QAAE,OAAO,CAAC,cAAc,CAAC,sBAAsB,EAAE,WAAW,CAAC,CAAC;;QAC3E,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,WAAW,CAAC,CAAC;IAEzD,OAAO,OAAO;SACX,MAAM,CAAC,iBAAiB,EAAE,mDAAmD,EAAE,OAAO,EAAE,EAAE,CAAC;SAC3F,MAAM,CAAC,4BAA4B,EAAE,8EAA8E,CAAC;SACpH,MAAM,CAAC,eAAe,EAAE,0CAA0C,CAAC;SACnE,MAAM,CAAC,UAAU,EAAE,0DAA0D,CAAC;SAC9E,MAAM,CAAC,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OAAO,CAAC,WAAW,KAAK,IAAI;QACzC,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAY;KACtC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.d.ts","sourceRoot":"","sources":["../../../src/commands/apikey/duration.ts"],"names":[],"mappings":"AAaA,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAqBrD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Parse human expiration durations like "30d", "6h", "1y" into milliseconds.
|
|
2
|
+
// Ported from the Go CLI's ParseExpirationDuration; invalid input is a usage
|
|
3
|
+
// error (exit 2). Units: m (minutes), h (hours), d (days), y (years).
|
|
4
|
+
import { UsageError } from "../../errors/index.js";
|
|
5
|
+
const UNIT_MS = {
|
|
6
|
+
m: 60 * 1000,
|
|
7
|
+
h: 60 * 60 * 1000,
|
|
8
|
+
d: 24 * 60 * 60 * 1000,
|
|
9
|
+
y: 365 * 24 * 60 * 60 * 1000,
|
|
10
|
+
};
|
|
11
|
+
export function parseExpiration(input) {
|
|
12
|
+
if (input.length < 2) {
|
|
13
|
+
throw new UsageError(`invalid duration format: "${input}" (expected e.g. 30d, 6h, 1y)`);
|
|
14
|
+
}
|
|
15
|
+
const unit = input[input.length - 1];
|
|
16
|
+
const valueText = input.slice(0, -1);
|
|
17
|
+
const multiplier = UNIT_MS[unit];
|
|
18
|
+
if (multiplier === undefined) {
|
|
19
|
+
throw new UsageError(`invalid duration unit '${unit}' (valid: m, h, d, y)`);
|
|
20
|
+
}
|
|
21
|
+
if (!/^\d+$/.test(valueText)) {
|
|
22
|
+
throw new UsageError(`invalid duration value in "${input}"`);
|
|
23
|
+
}
|
|
24
|
+
const value = Number.parseInt(valueText, 10);
|
|
25
|
+
if (value <= 0) {
|
|
26
|
+
throw new UsageError(`duration must be positive, got ${value}`);
|
|
27
|
+
}
|
|
28
|
+
return value * multiplier;
|
|
29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7C,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QACf,MAAM,IAAI,UAAU,CAAC,kCAAkC,KAAK,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,KAAK,GAAG,UAAU,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/apikey/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAczC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqBrD"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// `stigmer apikey create|fingerprint` — manage API keys for programmatic access.
|
|
2
|
+
//
|
|
3
|
+
// API keys are the non-interactive alternative to browser OAuth, for CI/CD and
|
|
4
|
+
// service accounts. The unified get/list/delete verbs cover the rest.
|
|
5
|
+
import { createHash } from "node:crypto";
|
|
6
|
+
import { create } from "@bufbuild/protobuf";
|
|
7
|
+
import { timestampDate } from "@bufbuild/protobuf/wkt";
|
|
8
|
+
import { ApiKeySchema } from "@stigmer/protos/ai/stigmer/iam/apikey/v1/api_pb";
|
|
9
|
+
import { ApiKeyHashSchema } from "@stigmer/protos/ai/stigmer/iam/apikey/v1/io_pb";
|
|
10
|
+
import { ensureAuthenticated, resolveContextOrganization } from "../../config/index.js";
|
|
11
|
+
import { renderProtoJson, renderProtoYaml } from "../../output/index.js";
|
|
12
|
+
import { addReadFlags, readFormat } from "../shared.js";
|
|
13
|
+
import { parseExpiration } from "./duration.js";
|
|
14
|
+
const DEFAULT_EXPIRATION_DAYS = 90;
|
|
15
|
+
export function registerApiKey(program) {
|
|
16
|
+
const apikey = program.command("apikey").description("manage API keys for Stigmer Cloud authentication");
|
|
17
|
+
const create = apikey
|
|
18
|
+
.command("create")
|
|
19
|
+
.description("create a new API key")
|
|
20
|
+
.option("--name <name>", "display name for the API key")
|
|
21
|
+
.option("--never-expires", "create a key that never expires")
|
|
22
|
+
.option("--expires-in <duration>", "custom expiration (e.g. 30d, 6h, 1y)")
|
|
23
|
+
.action(async (options) => {
|
|
24
|
+
await runCreate(options);
|
|
25
|
+
});
|
|
26
|
+
addReadFlags(create);
|
|
27
|
+
const fingerprint = apikey
|
|
28
|
+
.command("fingerprint <raw-key>")
|
|
29
|
+
.description("look up which API key matches a raw token")
|
|
30
|
+
.action(async (rawKey, options) => {
|
|
31
|
+
await runFingerprint(rawKey, options);
|
|
32
|
+
});
|
|
33
|
+
addReadFlags(fingerprint);
|
|
34
|
+
}
|
|
35
|
+
async function runCreate(options) {
|
|
36
|
+
const expiresAt = resolveExpiry(options);
|
|
37
|
+
const { connectBackend } = await import("../../backend.js");
|
|
38
|
+
const client = connectBackend();
|
|
39
|
+
ensureAuthenticated(client.config);
|
|
40
|
+
const created = await client.stigmer.apiKey.create({
|
|
41
|
+
name: options.name ?? "",
|
|
42
|
+
org: resolveContextOrganization(client.config),
|
|
43
|
+
neverExpires: options.neverExpires,
|
|
44
|
+
expiresAt,
|
|
45
|
+
});
|
|
46
|
+
const format = readFormat(options);
|
|
47
|
+
if (format === "json") {
|
|
48
|
+
process.stdout.write(renderProtoJson(ApiKeySchema, created));
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (format === "yaml") {
|
|
52
|
+
process.stdout.write(renderProtoYaml(ApiKeySchema, created));
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
process.stdout.write(renderCreatedBanner(created));
|
|
56
|
+
}
|
|
57
|
+
async function runFingerprint(rawKey, options) {
|
|
58
|
+
const hash = createHash("sha256").update(rawKey).digest("hex");
|
|
59
|
+
const { connectBackend } = await import("../../backend.js");
|
|
60
|
+
const client = connectBackend();
|
|
61
|
+
ensureAuthenticated(client.config);
|
|
62
|
+
const key = await client.stigmer.apiKey.getByKeyHash(create(ApiKeyHashSchema, { value: hash }));
|
|
63
|
+
renderApiKey(key, readFormat(options));
|
|
64
|
+
}
|
|
65
|
+
function resolveExpiry(options) {
|
|
66
|
+
if (options.neverExpires === true)
|
|
67
|
+
return undefined;
|
|
68
|
+
if (options.expiresIn !== undefined && options.expiresIn !== "") {
|
|
69
|
+
return new Date(Date.now() + parseExpiration(options.expiresIn));
|
|
70
|
+
}
|
|
71
|
+
return new Date(Date.now() + DEFAULT_EXPIRATION_DAYS * 24 * 60 * 60 * 1000);
|
|
72
|
+
}
|
|
73
|
+
function renderApiKey(key, format) {
|
|
74
|
+
if (format === "json") {
|
|
75
|
+
process.stdout.write(renderProtoJson(ApiKeySchema, key));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (format === "yaml") {
|
|
79
|
+
process.stdout.write(renderProtoYaml(ApiKeySchema, key));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const lines = [`API Key: ${key.metadata?.id ?? ""}`, ""];
|
|
83
|
+
if (key.metadata?.name)
|
|
84
|
+
lines.push(` Name: ${key.metadata.name}`);
|
|
85
|
+
if (key.spec?.fingerprint)
|
|
86
|
+
lines.push(` Fingerprint: ***${key.spec.fingerprint}`);
|
|
87
|
+
lines.push(` Expires: ${formatExpiry(key)}`);
|
|
88
|
+
process.stdout.write(`${lines.join("\n")}\n`);
|
|
89
|
+
}
|
|
90
|
+
function renderCreatedBanner(key) {
|
|
91
|
+
const divider = "═".repeat(63);
|
|
92
|
+
const lines = [
|
|
93
|
+
"",
|
|
94
|
+
"API key created successfully!",
|
|
95
|
+
"",
|
|
96
|
+
"IMPORTANT: Save this API key now — it will not be shown again!",
|
|
97
|
+
"",
|
|
98
|
+
divider,
|
|
99
|
+
` ${key.spec?.keyHash ?? ""}`,
|
|
100
|
+
divider,
|
|
101
|
+
"",
|
|
102
|
+
` ID: ${key.metadata?.id ?? ""}`,
|
|
103
|
+
];
|
|
104
|
+
if (key.metadata?.name)
|
|
105
|
+
lines.push(` Name: ${key.metadata.name}`);
|
|
106
|
+
if (key.spec?.fingerprint)
|
|
107
|
+
lines.push(` Fingerprint: ***${key.spec.fingerprint}`);
|
|
108
|
+
lines.push(` Expires: ${formatExpiry(key)}`, "", "Usage:", ` export STIGMER_API_KEY='${key.spec?.keyHash ?? ""}'`, "");
|
|
109
|
+
return `${lines.join("\n")}\n`;
|
|
110
|
+
}
|
|
111
|
+
function formatExpiry(key) {
|
|
112
|
+
if (key.spec?.neverExpires)
|
|
113
|
+
return "Never";
|
|
114
|
+
if (key.spec?.expiresAt !== undefined)
|
|
115
|
+
return timestampDate(key.spec.expiresAt).toISOString();
|
|
116
|
+
return "Never";
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/apikey/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,EAAE;AACF,+EAA+E;AAC/E,sEAAsE;AAEtE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAe,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAElF,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAuC,eAAe,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC9G,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAQnC,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,kDAAkD,CAAC,CAAC;IA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