@stigmer/cli 0.1.0-dev.20261017064309.g94d062a29f89 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/auth/auth0.js +1 -1
- package/auth/auth0.js.map +1 -1
- package/auth/token.d.ts +26 -4
- package/auth/token.d.ts.map +1 -1
- package/auth/token.js +120 -24
- package/auth/token.js.map +1 -1
- package/client/client.d.ts.map +1 -1
- package/client/client.js +21 -8
- package/client/client.js.map +1 -1
- package/command-tree.d.ts +63 -0
- package/command-tree.d.ts.map +1 -0
- package/command-tree.js +128 -0
- package/command-tree.js.map +1 -0
- package/commands/access-history/index.d.ts.map +1 -1
- package/commands/access-history/index.js +13 -1
- package/commands/access-history/index.js.map +1 -1
- package/commands/agent-exec-flags.d.ts +2 -0
- package/commands/agent-exec-flags.d.ts.map +1 -1
- package/commands/agent-exec-flags.js +9 -5
- package/commands/agent-exec-flags.js.map +1 -1
- package/commands/apikey/duration.d.ts.map +1 -1
- package/commands/apikey/duration.js +1 -2
- package/commands/apikey/duration.js.map +1 -1
- package/commands/apikey/index.d.ts.map +1 -1
- package/commands/apikey/index.js +3 -4
- package/commands/apikey/index.js.map +1 -1
- package/commands/apply.d.ts.map +1 -1
- package/commands/apply.js +2 -32
- package/commands/apply.js.map +1 -1
- package/commands/auth/index.d.ts.map +1 -1
- package/commands/auth/index.js +7 -5
- package/commands/auth/index.js.map +1 -1
- package/commands/auth/whoami.js +1 -1
- package/commands/config/index.js +3 -3
- package/commands/config/kv.d.ts.map +1 -1
- package/commands/config/kv.js +18 -14
- package/commands/config/kv.js.map +1 -1
- package/commands/connect.d.ts.map +1 -1
- package/commands/connect.js +18 -2
- package/commands/connect.js.map +1 -1
- package/commands/download.d.ts.map +1 -1
- package/commands/download.js +81 -54
- package/commands/download.js.map +1 -1
- package/commands/eval.d.ts.map +1 -1
- package/commands/eval.js +17 -19
- package/commands/eval.js.map +1 -1
- package/commands/file.d.ts +3 -0
- package/commands/file.d.ts.map +1 -0
- package/commands/file.js +64 -0
- package/commands/file.js.map +1 -0
- package/commands/get.d.ts.map +1 -1
- package/commands/get.js +20 -13
- package/commands/get.js.map +1 -1
- package/commands/help.d.ts +15 -0
- package/commands/help.d.ts.map +1 -0
- package/commands/help.js +175 -0
- package/commands/help.js.map +1 -0
- package/commands/internal-daemon.d.ts.map +1 -1
- package/commands/internal-daemon.js +9 -2
- package/commands/internal-daemon.js.map +1 -1
- package/commands/list.d.ts.map +1 -1
- package/commands/list.js +22 -1
- package/commands/list.js.map +1 -1
- package/commands/logs.js +1 -1
- package/commands/logs.js.map +1 -1
- package/commands/mcp-server.d.ts +16 -6
- package/commands/mcp-server.d.ts.map +1 -1
- package/commands/mcp-server.js +51 -26
- package/commands/mcp-server.js.map +1 -1
- package/commands/provider-key/index.d.ts +3 -0
- package/commands/provider-key/index.d.ts.map +1 -0
- package/commands/provider-key/index.js +156 -0
- package/commands/provider-key/index.js.map +1 -0
- package/commands/push.js +8 -8
- package/commands/push.js.map +1 -1
- package/commands/resume.d.ts.map +1 -1
- package/commands/resume.js +17 -11
- package/commands/resume.js.map +1 -1
- package/commands/routine.d.ts.map +1 -1
- package/commands/routine.js +42 -3
- package/commands/routine.js.map +1 -1
- package/commands/run.d.ts.map +1 -1
- package/commands/run.js +34 -15
- package/commands/run.js.map +1 -1
- package/commands/runs/approve.d.ts.map +1 -1
- package/commands/runs/approve.js +10 -2
- package/commands/runs/approve.js.map +1 -1
- package/commands/runs/control.d.ts.map +1 -1
- package/commands/runs/control.js +24 -16
- package/commands/runs/control.js.map +1 -1
- package/commands/runs/index.d.ts.map +1 -1
- package/commands/runs/index.js +1 -2
- package/commands/runs/index.js.map +1 -1
- package/commands/runs/logs.d.ts.map +1 -1
- package/commands/runs/logs.js +7 -4
- package/commands/runs/logs.js.map +1 -1
- package/commands/runs/to-eval-case.d.ts.map +1 -1
- package/commands/runs/to-eval-case.js +13 -4
- package/commands/runs/to-eval-case.js.map +1 -1
- package/commands/runs/trace.js +1 -1
- package/commands/runs/trace.js.map +1 -1
- package/commands/search.js +2 -3
- package/commands/search.js.map +1 -1
- package/commands/service-account/index.d.ts.map +1 -1
- package/commands/service-account/index.js +4 -2
- package/commands/service-account/index.js.map +1 -1
- package/commands/session-help.d.ts +5 -0
- package/commands/session-help.d.ts.map +1 -0
- package/commands/session-help.js +38 -0
- package/commands/session-help.js.map +1 -0
- package/commands/setup.js +5 -5
- package/commands/setup.js.map +1 -1
- package/commands/shared.d.ts +10 -2
- package/commands/shared.d.ts.map +1 -1
- package/commands/shared.js +30 -3
- package/commands/shared.js.map +1 -1
- package/commands/tag.d.ts.map +1 -1
- package/commands/tag.js +11 -6
- package/commands/tag.js.map +1 -1
- package/commands/up.d.ts.map +1 -1
- package/commands/up.js +51 -21
- package/commands/up.js.map +1 -1
- package/commands/validate.js +2 -2
- package/commands/validate.js.map +1 -1
- package/commands/version.d.ts.map +1 -1
- package/commands/version.js +8 -4
- package/commands/version.js.map +1 -1
- package/config/config.d.ts +5 -22
- package/config/config.d.ts.map +1 -1
- package/config/config.js +56 -47
- package/config/config.js.map +1 -1
- package/config/index.d.ts +2 -2
- package/config/index.d.ts.map +1 -1
- package/config/index.js +1 -1
- package/config/index.js.map +1 -1
- package/config/keys.js +4 -4
- package/config/keys.js.map +1 -1
- package/config/paths.js +2 -2
- package/config/paths.js.map +1 -1
- package/config/resolve.d.ts +12 -2
- package/config/resolve.d.ts.map +1 -1
- package/config/resolve.js +18 -8
- package/config/resolve.js.map +1 -1
- package/errors/classify.d.ts +20 -0
- package/errors/classify.d.ts.map +1 -1
- package/errors/classify.js +97 -21
- package/errors/classify.js.map +1 -1
- package/errors/command-line.d.ts +14 -0
- package/errors/command-line.d.ts.map +1 -0
- package/errors/command-line.js +90 -0
- package/errors/command-line.js.map +1 -0
- package/errors/handle.js +2 -2
- package/errors/handle.js.map +1 -1
- package/errors/index.d.ts +2 -2
- package/errors/index.d.ts.map +1 -1
- package/errors/index.js +12 -2
- package/errors/index.js.map +1 -1
- package/errors/usage-error.js +1 -1
- package/errors/usage-error.js.map +1 -1
- package/global-options.d.ts +35 -0
- package/global-options.d.ts.map +1 -0
- package/global-options.js +81 -0
- package/global-options.js.map +1 -0
- package/local/artifact.d.ts +1 -20
- package/local/artifact.d.ts.map +1 -1
- package/local/artifact.js +35 -117
- package/local/artifact.js.map +1 -1
- package/local/constants.d.ts +3 -9
- package/local/constants.d.ts.map +1 -1
- package/local/constants.js +3 -9
- package/local/constants.js.map +1 -1
- package/local/daemon/components.d.ts +18 -5
- package/local/daemon/components.d.ts.map +1 -1
- package/local/daemon/components.js +61 -23
- package/local/daemon/components.js.map +1 -1
- package/local/daemon/env.d.ts +1 -5
- package/local/daemon/env.d.ts.map +1 -1
- package/local/daemon/env.js +0 -2
- package/local/daemon/env.js.map +1 -1
- package/local/daemon/host.d.ts +5 -0
- package/local/daemon/host.d.ts.map +1 -1
- package/local/daemon/host.js +68 -21
- package/local/daemon/host.js.map +1 -1
- package/local/daemon/index.d.ts +2 -1
- package/local/daemon/index.d.ts.map +1 -1
- package/local/daemon/index.js +2 -1
- package/local/daemon/index.js.map +1 -1
- package/local/daemon/launch.d.ts +58 -9
- package/local/daemon/launch.d.ts.map +1 -1
- package/local/daemon/launch.js +210 -64
- package/local/daemon/launch.js.map +1 -1
- package/local/daemon/process.d.ts +11 -7
- package/local/daemon/process.d.ts.map +1 -1
- package/local/daemon/process.js +74 -38
- package/local/daemon/process.js.map +1 -1
- package/local/daemon/signals.d.ts +3 -0
- package/local/daemon/signals.d.ts.map +1 -0
- package/local/daemon/signals.js +19 -0
- package/local/daemon/signals.js.map +1 -0
- package/local/daemon/supervisor.d.ts +9 -2
- package/local/daemon/supervisor.d.ts.map +1 -1
- package/local/daemon/supervisor.js +81 -22
- package/local/daemon/supervisor.js.map +1 -1
- package/local/daemon/types.d.ts +6 -1
- package/local/daemon/types.d.ts.map +1 -1
- package/local/daemon/types.js +2 -3
- package/local/daemon/types.js.map +1 -1
- package/local/llm-config.d.ts +4 -2
- package/local/llm-config.d.ts.map +1 -1
- package/local/llm-config.js +15 -9
- package/local/llm-config.js.map +1 -1
- package/local/logs/view.d.ts.map +1 -1
- package/local/logs/view.js +5 -6
- package/local/logs/view.js.map +1 -1
- package/local/net/tcp.d.ts +8 -6
- package/local/net/tcp.d.ts.map +1 -1
- package/local/net/tcp.js +13 -8
- package/local/net/tcp.js.map +1 -1
- package/local/paths.d.ts +1 -1
- package/local/paths.d.ts.map +1 -1
- package/local/paths.js +2 -3
- package/local/paths.js.map +1 -1
- package/local/provider-reach.d.ts +18 -0
- package/local/provider-reach.d.ts.map +1 -0
- package/local/provider-reach.js +109 -0
- package/local/provider-reach.js.map +1 -0
- package/local/reset.d.ts.map +1 -1
- package/local/reset.js +1 -2
- package/local/reset.js.map +1 -1
- package/local/runtime/index.d.ts.map +1 -1
- package/local/runtime/index.js +1 -2
- package/local/runtime/index.js.map +1 -1
- package/local/runtime/node.js +1 -1
- package/local/runtime/runner.js +2 -2
- package/local/runtime/runner.js.map +1 -1
- package/local/runtime/runtimes-install.js +1 -1
- package/local/runtime/server.d.ts.map +1 -1
- package/local/runtime/server.js +2 -4
- package/local/runtime/server.js.map +1 -1
- package/local/runtime/which.js +1 -1
- package/local/runtime/which.js.map +1 -1
- package/local/setup/wizard.d.ts +1 -1
- package/local/setup/wizard.d.ts.map +1 -1
- package/local/setup/wizard.js +7 -5
- package/local/setup/wizard.js.map +1 -1
- package/local/state/health-state.d.ts +6 -0
- package/local/state/health-state.d.ts.map +1 -1
- package/local/state/health-state.js +6 -2
- package/local/state/health-state.js.map +1 -1
- package/local/state/lock.d.ts +3 -2
- package/local/state/lock.d.ts.map +1 -1
- package/local/state/lock.js +26 -28
- package/local/state/lock.js.map +1 -1
- package/local/state/log-rotation.d.ts.map +1 -1
- package/local/state/log-rotation.js +2 -3
- package/local/state/log-rotation.js.map +1 -1
- package/local/state/pidfile.d.ts +24 -1
- package/local/state/pidfile.d.ts.map +1 -1
- package/local/state/pidfile.js +54 -6
- package/local/state/pidfile.js.map +1 -1
- package/local/state/proc.d.ts +31 -0
- package/local/state/proc.d.ts.map +1 -1
- package/local/state/proc.js +98 -1
- package/local/state/proc.js.map +1 -1
- package/local/state/startup-config.d.ts +2 -2
- package/local/status.d.ts +2 -4
- package/local/status.d.ts.map +1 -1
- package/local/status.js +26 -41
- package/local/status.js.map +1 -1
- package/local/temporal/download.d.ts +9 -5
- package/local/temporal/download.d.ts.map +1 -1
- package/local/temporal/download.js +29 -8
- package/local/temporal/download.js.map +1 -1
- package/local/temporal/index.d.ts +1 -1
- package/local/temporal/index.d.ts.map +1 -1
- package/local/temporal/index.js +1 -1
- package/local/temporal/index.js.map +1 -1
- package/local/temporal/manager.d.ts +31 -5
- package/local/temporal/manager.d.ts.map +1 -1
- package/local/temporal/manager.js +74 -35
- package/local/temporal/manager.js.map +1 -1
- package/local/temporal/supervisor.js +1 -1
- package/local/temporal/supervisor.js.map +1 -1
- package/local/webconsole/index.d.ts +5 -2
- package/local/webconsole/index.d.ts.map +1 -1
- package/local/webconsole/index.js +8 -6
- package/local/webconsole/index.js.map +1 -1
- package/marketplace/github.js +1 -1
- package/marketplace/github.js.map +1 -1
- package/marketplace/official.js +1 -1
- package/marketplace/official.js.map +1 -1
- package/output/command-result.d.ts +6 -0
- package/output/command-result.d.ts.map +1 -1
- package/output/command-result.js +13 -2
- package/output/command-result.js.map +1 -1
- package/output/confirm.d.ts.map +1 -1
- package/output/confirm.js +2 -3
- package/output/confirm.js.map +1 -1
- package/output/format.d.ts.map +1 -1
- package/output/format.js +5 -6
- package/output/format.js.map +1 -1
- package/output/index.d.ts +2 -2
- package/output/index.d.ts.map +1 -1
- package/output/index.js +2 -2
- package/output/index.js.map +1 -1
- package/output/printable.d.ts +8 -0
- package/output/printable.d.ts.map +1 -0
- package/output/printable.js +24 -0
- package/output/printable.js.map +1 -0
- package/output/proto.d.ts.map +1 -1
- package/output/proto.js +3 -4
- package/output/proto.js.map +1 -1
- package/output/style.js +2 -2
- package/output/style.js.map +1 -1
- package/output/table.d.ts +20 -1
- package/output/table.d.ts.map +1 -1
- package/output/table.js +75 -17
- package/output/table.js.map +1 -1
- package/package.json +13 -10
- package/program.d.ts +0 -14
- package/program.d.ts.map +1 -1
- package/program.js +57 -119
- package/program.js.map +1 -1
- package/registry/aliases.d.ts.map +1 -1
- package/registry/aliases.js +0 -3
- package/registry/aliases.js.map +1 -1
- package/registry/index.d.ts +1 -1
- package/registry/index.d.ts.map +1 -1
- package/registry/index.js +1 -1
- package/registry/index.js.map +1 -1
- package/registry/metadata.d.ts +0 -15
- package/registry/metadata.d.ts.map +1 -1
- package/registry/metadata.js +16 -57
- package/registry/metadata.js.map +1 -1
- package/registry/registry.d.ts +1 -5
- package/registry/registry.d.ts.map +1 -1
- package/registry/registry.js +3 -11
- package/registry/registry.js.map +1 -1
- package/registry/verb-support.d.ts.map +1 -1
- package/registry/verb-support.js +28 -5
- package/registry/verb-support.js.map +1 -1
- package/resources/agent/quality.d.ts +10 -5
- package/resources/agent/quality.d.ts.map +1 -1
- package/resources/agent/quality.js +19 -9
- package/resources/agent/quality.js.map +1 -1
- package/resources/agent/resolve.js +3 -3
- package/resources/agent/resolve.js.map +1 -1
- package/resources/apply/apply.d.ts +4 -3
- package/resources/apply/apply.d.ts.map +1 -1
- package/resources/apply/apply.js +54 -41
- package/resources/apply/apply.js.map +1 -1
- package/resources/apply/handlers.d.ts.map +1 -1
- package/resources/apply/handlers.js +3 -4
- package/resources/apply/handlers.js.map +1 -1
- package/resources/channel.d.ts.map +1 -1
- package/resources/channel.js +3 -4
- package/resources/channel.js.map +1 -1
- package/resources/connect/connect.js +2 -2
- package/resources/connect/connect.js.map +1 -1
- package/resources/delete.d.ts.map +1 -1
- package/resources/delete.js +38 -4
- package/resources/delete.js.map +1 -1
- package/resources/documents.js +1 -1
- package/resources/documents.js.map +1 -1
- package/resources/download.d.ts +43 -3
- package/resources/download.d.ts.map +1 -1
- package/resources/download.js +169 -34
- package/resources/download.js.map +1 -1
- package/resources/eval-run/options.d.ts +3 -1
- package/resources/eval-run/options.d.ts.map +1 -1
- package/resources/eval-run/options.js +36 -18
- package/resources/eval-run/options.js.map +1 -1
- package/resources/eval-run/report.d.ts +4 -2
- package/resources/eval-run/report.d.ts.map +1 -1
- package/resources/eval-run/report.js +9 -7
- package/resources/eval-run/report.js.map +1 -1
- package/resources/eval-run/run.d.ts +2 -1
- package/resources/eval-run/run.d.ts.map +1 -1
- package/resources/eval-run/run.js +13 -7
- package/resources/eval-run/run.js.map +1 -1
- package/resources/file.d.ts +27 -0
- package/resources/file.d.ts.map +1 -0
- package/resources/file.js +82 -0
- package/resources/file.js.map +1 -0
- package/resources/get-bindings.d.ts.map +1 -1
- package/resources/get-bindings.js +18 -0
- package/resources/get-bindings.js.map +1 -1
- package/resources/git.d.ts +1 -1
- package/resources/git.js +1 -1
- package/resources/list.d.ts +21 -2
- package/resources/list.d.ts.map +1 -1
- package/resources/list.js +148 -31
- package/resources/list.js.map +1 -1
- package/resources/plugin.d.ts.map +1 -1
- package/resources/plugin.js +4 -0
- package/resources/plugin.js.map +1 -1
- package/resources/provider-key.d.ts +81 -0
- package/resources/provider-key.d.ts.map +1 -0
- package/resources/provider-key.js +261 -0
- package/resources/provider-key.js.map +1 -0
- package/resources/reference.d.ts +15 -21
- package/resources/reference.d.ts.map +1 -1
- package/resources/reference.js +42 -88
- package/resources/reference.js.map +1 -1
- package/resources/render.d.ts +31 -7
- package/resources/render.d.ts.map +1 -1
- package/resources/render.js +66 -38
- package/resources/render.js.map +1 -1
- package/resources/routine.d.ts +21 -5
- package/resources/routine.d.ts.map +1 -1
- package/resources/routine.js +104 -15
- package/resources/routine.js.map +1 -1
- package/resources/run/agent-exec.d.ts +12 -2
- package/resources/run/agent-exec.d.ts.map +1 -1
- package/resources/run/agent-exec.js +85 -38
- package/resources/run/agent-exec.js.map +1 -1
- package/resources/run/create.d.ts +16 -12
- package/resources/run/create.d.ts.map +1 -1
- package/resources/run/create.js +14 -15
- package/resources/run/create.js.map +1 -1
- package/resources/run/engines.d.ts +32 -0
- package/resources/run/engines.d.ts.map +1 -0
- package/resources/run/engines.js +39 -0
- package/resources/run/engines.js.map +1 -0
- package/resources/run/environment.d.ts +11 -0
- package/resources/run/environment.d.ts.map +1 -0
- package/resources/run/environment.js +30 -0
- package/resources/run/environment.js.map +1 -0
- package/resources/run/epilogue.d.ts +1 -1
- package/resources/run/epilogue.d.ts.map +1 -1
- package/resources/run/epilogue.js +18 -19
- package/resources/run/epilogue.js.map +1 -1
- package/resources/run/files.d.ts +104 -0
- package/resources/run/files.d.ts.map +1 -0
- package/resources/run/files.js +316 -0
- package/resources/run/files.js.map +1 -0
- package/resources/run/header.d.ts +11 -9
- package/resources/run/header.d.ts.map +1 -1
- package/resources/run/header.js +14 -14
- package/resources/run/header.js.map +1 -1
- package/resources/run/prepare.d.ts +31 -25
- package/resources/run/prepare.d.ts.map +1 -1
- package/resources/run/prepare.js +42 -51
- package/resources/run/prepare.js.map +1 -1
- package/resources/run/references.d.ts.map +1 -1
- package/resources/run/references.js +6 -5
- package/resources/run/references.js.map +1 -1
- package/resources/run/resolve.js +1 -1
- package/resources/run/resolve.js.map +1 -1
- package/resources/run/resume.d.ts +3 -1
- package/resources/run/resume.d.ts.map +1 -1
- package/resources/run/resume.js +25 -10
- package/resources/run/resume.js.map +1 -1
- package/resources/run/stream.d.ts +34 -2
- package/resources/run/stream.d.ts.map +1 -1
- package/resources/run/stream.js +92 -8
- package/resources/run/stream.js.map +1 -1
- package/resources/run/workspace.d.ts +9 -12
- package/resources/run/workspace.d.ts.map +1 -1
- package/resources/run/workspace.js +29 -36
- package/resources/run/workspace.js.map +1 -1
- package/resources/run-approve.d.ts.map +1 -1
- package/resources/run-approve.js +2 -11
- package/resources/run-approve.js.map +1 -1
- package/resources/run-control.d.ts +3 -3
- package/resources/run-control.d.ts.map +1 -1
- package/resources/run-control.js +4 -5
- package/resources/run-control.js.map +1 -1
- package/resources/run-format.d.ts +2 -2
- package/resources/run-format.d.ts.map +1 -1
- package/resources/run-format.js +3 -4
- package/resources/run-format.js.map +1 -1
- package/resources/run-logs.d.ts +2 -0
- package/resources/run-logs.d.ts.map +1 -1
- package/resources/run-logs.js +16 -6
- package/resources/run-logs.js.map +1 -1
- package/resources/run-scores.d.ts +6 -2
- package/resources/run-scores.d.ts.map +1 -1
- package/resources/run-scores.js +7 -4
- package/resources/run-scores.js.map +1 -1
- package/resources/run-to-eval-case.js +2 -2
- package/resources/run-to-eval-case.js.map +1 -1
- package/resources/runs.d.ts +3 -3
- package/resources/runs.d.ts.map +1 -1
- package/resources/runs.js +5 -5
- package/resources/runs.js.map +1 -1
- package/resources/search.d.ts.map +1 -1
- package/resources/search.js +1 -2
- package/resources/search.js.map +1 -1
- package/resources/service-account.d.ts +2 -0
- package/resources/service-account.d.ts.map +1 -1
- package/resources/service-account.js +3 -1
- package/resources/service-account.js.map +1 -1
- package/resources/session.d.ts +4 -3
- package/resources/session.d.ts.map +1 -1
- package/resources/session.js +10 -7
- package/resources/session.js.map +1 -1
- package/resources/skill.d.ts +1 -1
- package/resources/skill.d.ts.map +1 -1
- package/resources/skill.js +7 -8
- package/resources/skill.js.map +1 -1
- package/resources/stream/answer.d.ts +1 -2
- package/resources/stream/answer.d.ts.map +1 -1
- package/resources/stream/answer.js +3 -16
- package/resources/stream/answer.js.map +1 -1
- package/resources/stream/composer.d.ts +16 -0
- package/resources/stream/composer.d.ts.map +1 -0
- package/resources/stream/composer.js +171 -0
- package/resources/stream/composer.js.map +1 -0
- package/resources/stream/ink.d.ts +20 -4
- package/resources/stream/ink.d.ts.map +1 -1
- package/resources/stream/ink.js +34 -3
- package/resources/stream/ink.js.map +1 -1
- package/resources/stream/render-plaintext.d.ts +1 -0
- package/resources/stream/render-plaintext.d.ts.map +1 -1
- package/resources/stream/render-plaintext.js +21 -4
- package/resources/stream/render-plaintext.js.map +1 -1
- package/resources/stream/tty.js +1 -1
- package/resources/stream/tty.js.map +1 -1
- package/resources/tag.d.ts.map +1 -1
- package/resources/tag.js +7 -8
- package/resources/tag.js.map +1 -1
- package/resources/usage.d.ts +3 -2
- package/resources/usage.d.ts.map +1 -1
- package/resources/usage.js +19 -16
- package/resources/usage.js.map +1 -1
- package/resources/validate.d.ts.map +1 -1
- package/resources/validate.js +1 -12
- package/resources/validate.js.map +1 -1
- package/resources/version.d.ts +17 -3
- package/resources/version.d.ts.map +1 -1
- package/resources/version.js +105 -14
- package/resources/version.js.map +1 -1
- package/resources/views/agent.d.ts +3 -0
- package/resources/views/agent.d.ts.map +1 -0
- package/resources/views/agent.js +54 -0
- package/resources/views/agent.js.map +1 -0
- package/resources/views/environment.d.ts +3 -0
- package/resources/views/environment.d.ts.map +1 -0
- package/resources/views/environment.js +37 -0
- package/resources/views/environment.js.map +1 -0
- package/resources/views/index.d.ts +22 -0
- package/resources/views/index.d.ts.map +1 -0
- package/resources/views/index.js +70 -0
- package/resources/views/index.js.map +1 -0
- package/resources/views/organization.d.ts +3 -0
- package/resources/views/organization.d.ts.map +1 -0
- package/resources/views/organization.js +27 -0
- package/resources/views/organization.js.map +1 -0
- package/resources/views/routine.d.ts +3 -0
- package/resources/views/routine.d.ts.map +1 -0
- package/resources/views/routine.js +37 -0
- package/resources/views/routine.js.map +1 -0
- package/resources/views/run.d.ts +3 -0
- package/resources/views/run.d.ts.map +1 -0
- package/resources/views/run.js +45 -0
- package/resources/views/run.js.map +1 -0
- package/resources/views/session.d.ts +5 -0
- package/resources/views/session.d.ts.map +1 -0
- package/resources/views/session.js +85 -0
- package/resources/views/session.js.map +1 -0
- package/resources/views/skill.d.ts +5 -0
- package/resources/views/skill.d.ts.map +1 -0
- package/resources/views/skill.js +48 -0
- package/resources/views/skill.js.map +1 -0
- package/resources/views/view.d.ts +66 -0
- package/resources/views/view.d.ts.map +1 -0
- package/resources/views/view.js +130 -0
- package/resources/views/view.js.map +1 -0
- package/resources/views/words.d.ts +52 -0
- package/resources/views/words.d.ts.map +1 -0
- package/resources/views/words.js +190 -0
- package/resources/views/words.js.map +1 -0
- package/runtime.d.ts +22 -0
- package/runtime.d.ts.map +1 -1
- package/runtime.js +33 -2
- package/runtime.js.map +1 -1
- package/src/auth/auth0.ts +1 -1
- package/src/auth/token.ts +136 -26
- package/src/client/client.ts +23 -16
- package/src/command-tree.ts +152 -0
- package/src/commands/access-history/index.ts +15 -2
- package/src/commands/agent-exec-flags.ts +11 -5
- package/src/commands/apikey/duration.ts +1 -2
- package/src/commands/apikey/index.ts +3 -4
- package/src/commands/apply.ts +3 -22
- package/src/commands/auth/index.ts +7 -5
- package/src/commands/auth/whoami.ts +1 -1
- package/src/commands/config/index.ts +3 -3
- package/src/commands/config/kv.ts +18 -14
- package/src/commands/connect.ts +21 -3
- package/src/commands/download.ts +106 -62
- package/src/commands/eval.ts +22 -21
- package/src/commands/file.ts +80 -0
- package/src/commands/get.ts +19 -13
- package/src/commands/help.ts +182 -0
- package/src/commands/internal-daemon.ts +9 -2
- package/src/commands/list.ts +22 -1
- package/src/commands/logs.ts +1 -1
- package/src/commands/mcp-server.ts +57 -28
- package/src/commands/provider-key/index.ts +192 -0
- package/src/commands/push.ts +8 -8
- package/src/commands/resume.ts +20 -12
- package/src/commands/routine.ts +58 -5
- package/src/commands/run.ts +37 -17
- package/src/commands/runs/approve.ts +13 -4
- package/src/commands/runs/control.ts +50 -27
- package/src/commands/runs/index.ts +1 -2
- package/src/commands/runs/logs.ts +9 -5
- package/src/commands/runs/to-eval-case.ts +18 -6
- package/src/commands/runs/trace.ts +1 -1
- package/src/commands/search.ts +2 -3
- package/src/commands/service-account/index.ts +7 -2
- package/src/commands/session-help.ts +39 -0
- package/src/commands/setup.ts +5 -5
- package/src/commands/shared.ts +32 -3
- package/src/commands/tag.ts +13 -7
- package/src/commands/up.ts +55 -21
- package/src/commands/validate.ts +2 -2
- package/src/commands/version.ts +9 -4
- package/src/config/config.ts +66 -69
- package/src/config/index.ts +1 -2
- package/src/config/keys.ts +4 -4
- package/src/config/paths.ts +2 -2
- package/src/config/resolve.ts +20 -8
- package/src/errors/classify.ts +110 -21
- package/src/errors/command-line.ts +95 -0
- package/src/errors/handle.ts +2 -2
- package/src/errors/index.ts +12 -2
- package/src/errors/usage-error.ts +1 -1
- package/src/global-options.ts +100 -0
- package/src/local/artifact.ts +46 -140
- package/src/local/constants.ts +3 -9
- package/src/local/daemon/components.ts +78 -22
- package/src/local/daemon/env.ts +3 -8
- package/src/local/daemon/host.ts +64 -19
- package/src/local/daemon/index.ts +2 -1
- package/src/local/daemon/launch.ts +251 -72
- package/src/local/daemon/process.ts +78 -46
- package/src/local/daemon/signals.ts +19 -0
- package/src/local/daemon/supervisor.ts +84 -21
- package/src/local/daemon/types.ts +8 -4
- package/src/local/llm-config.ts +15 -9
- package/src/local/logs/view.ts +5 -6
- package/src/local/net/tcp.ts +18 -11
- package/src/local/paths.ts +2 -3
- package/src/local/provider-reach.ts +124 -0
- package/src/local/reset.ts +1 -2
- package/src/local/runtime/index.ts +1 -2
- package/src/local/runtime/node.ts +1 -1
- package/src/local/runtime/runner.ts +2 -2
- package/src/local/runtime/runtimes-install.ts +1 -1
- package/src/local/runtime/server.ts +2 -4
- package/src/local/runtime/which.ts +1 -1
- package/src/local/setup/wizard.ts +7 -5
- package/src/local/state/health-state.ts +10 -2
- package/src/local/state/lock.ts +26 -28
- package/src/local/state/log-rotation.ts +2 -3
- package/src/local/state/pidfile.ts +61 -6
- package/src/local/state/proc.ts +104 -1
- package/src/local/state/startup-config.ts +2 -2
- package/src/local/status.ts +30 -41
- package/src/local/temporal/download.ts +31 -9
- package/src/local/temporal/index.ts +1 -1
- package/src/local/temporal/manager.ts +94 -34
- package/src/local/temporal/supervisor.ts +1 -1
- package/src/local/webconsole/index.ts +8 -5
- package/src/marketplace/github.ts +1 -1
- package/src/marketplace/official.ts +1 -1
- package/src/output/command-result.ts +14 -2
- package/src/output/confirm.ts +2 -3
- package/src/output/format.ts +5 -6
- package/src/output/index.ts +8 -1
- package/src/output/printable.ts +26 -0
- package/src/output/proto.ts +3 -4
- package/src/output/style.ts +2 -2
- package/src/output/table.ts +118 -15
- package/src/program.ts +58 -128
- package/src/registry/aliases.ts +0 -3
- package/src/registry/index.ts +0 -1
- package/src/registry/metadata.ts +16 -64
- package/src/registry/registry.ts +3 -13
- package/src/registry/verb-support.ts +28 -5
- package/src/resources/agent/quality.ts +29 -8
- package/src/resources/agent/resolve.ts +3 -3
- package/src/resources/apply/apply.ts +58 -49
- package/src/resources/apply/handlers.ts +3 -4
- package/src/resources/channel.ts +3 -4
- package/src/resources/connect/connect.ts +2 -2
- package/src/resources/delete.ts +44 -4
- package/src/resources/documents.ts +1 -1
- package/src/resources/download.ts +239 -43
- package/src/resources/eval-run/options.ts +38 -17
- package/src/resources/eval-run/report.ts +11 -5
- package/src/resources/eval-run/run.ts +13 -9
- package/src/resources/file.ts +114 -0
- package/src/resources/get-bindings.ts +18 -0
- package/src/resources/git.ts +1 -1
- package/src/resources/list.ts +178 -34
- package/src/resources/plugin.ts +3 -0
- package/src/resources/provider-key.ts +327 -0
- package/src/resources/reference.ts +41 -85
- package/src/resources/render.ts +72 -38
- package/src/resources/routine.ts +152 -15
- package/src/resources/run/agent-exec.ts +95 -44
- package/src/resources/run/create.ts +27 -24
- package/src/resources/run/engines.ts +57 -0
- package/src/resources/run/environment.ts +43 -0
- package/src/resources/run/epilogue.ts +18 -17
- package/src/resources/run/files.ts +433 -0
- package/src/resources/run/header.ts +18 -18
- package/src/resources/run/prepare.ts +67 -74
- package/src/resources/run/references.ts +6 -5
- package/src/resources/run/resolve.ts +1 -1
- package/src/resources/run/resume.ts +28 -9
- package/src/resources/run/stream.ts +110 -9
- package/src/resources/run/workspace.ts +37 -47
- package/src/resources/run-approve.ts +2 -14
- package/src/resources/run-control.ts +4 -5
- package/src/resources/run-format.ts +3 -4
- package/src/resources/run-logs.ts +17 -6
- package/src/resources/run-scores.ts +14 -4
- package/src/resources/run-to-eval-case.ts +2 -2
- package/src/resources/runs.ts +5 -5
- package/src/resources/search.ts +1 -2
- package/src/resources/service-account.ts +4 -1
- package/src/resources/session.ts +10 -7
- package/src/resources/skill.ts +7 -8
- package/src/resources/stream/answer.ts +3 -19
- package/src/resources/stream/composer.ts +170 -0
- package/src/resources/stream/ink.tsx +74 -10
- package/src/resources/stream/render-plaintext.ts +22 -4
- package/src/resources/stream/tty.ts +1 -1
- package/src/resources/tag.ts +7 -9
- package/src/resources/usage.ts +19 -15
- package/src/resources/validate.ts +1 -10
- package/src/resources/version.ts +117 -15
- package/src/resources/views/agent.ts +60 -0
- package/src/resources/views/environment.ts +41 -0
- package/src/resources/views/index.ts +82 -0
- package/src/resources/views/organization.ts +29 -0
- package/src/resources/views/routine.ts +39 -0
- package/src/resources/views/run.ts +46 -0
- package/src/resources/views/session.ts +91 -0
- package/src/resources/views/skill.ts +49 -0
- package/src/resources/views/view.ts +188 -0
- package/src/resources/views/words.ts +191 -0
- package/src/runtime.ts +51 -2
- package/errors/exit-codes.d.ts +0 -10
- package/errors/exit-codes.d.ts.map +0 -1
- package/errors/exit-codes.js +0 -15
- package/errors/exit-codes.js.map +0 -1
- package/resources/run/attachments.d.ts +0 -24
- package/resources/run/attachments.d.ts.map +0 -1
- package/resources/run/attachments.js +0 -237
- package/resources/run/attachments.js.map +0 -1
- package/src/errors/exit-codes.ts +0 -17
- package/src/resources/run/attachments.ts +0 -300
- package/src/types/marked-terminal.d.ts +0 -31
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// The one renderer every designed `get` view draws through, and the shapes a
|
|
2
|
+
// view hands it.
|
|
3
|
+
//
|
|
4
|
+
// A view is a function of the resource's protojson: it names a title (the
|
|
5
|
+
// resource's name, then where it lives, dimmed) and returns sections, the
|
|
6
|
+
// first usually untitled (the summary block of aligned fields), the rest
|
|
7
|
+
// titled. The renderer, not the view, decides what shows: a field with no
|
|
8
|
+
// value, and a section with nothing in it, are left out, so a view lists
|
|
9
|
+
// what a kind can carry and the person sees what this resource does carry.
|
|
10
|
+
// On a terminal, text wraps at its width with each continuation under the
|
|
11
|
+
// text it continues; piped (no width), nothing is wrapped or cut. Monochrome
|
|
12
|
+
// by the CLI's law: the title and section headings bold, the location and
|
|
13
|
+
// closing notes dim, through the caller's styler. Everything a resource
|
|
14
|
+
// carries is text someone else wrote (instructions, SKILL.md, a run's error),
|
|
15
|
+
// so it is printed with its control characters removed (output/printable.ts).
|
|
16
|
+
//
|
|
17
|
+
// Precedent: `gh pr view` (a title line, fields, then titled sections).
|
|
18
|
+
import stringWidth from "string-width";
|
|
19
|
+
import { printable, printableCell } from "../../output/printable.js";
|
|
20
|
+
import { obj, str } from "../render.js";
|
|
21
|
+
// Below this many columns a wrapped line would read worse than the terminal's
|
|
22
|
+
// own wrap, so text keeps at least this much room.
|
|
23
|
+
const MIN_ROOM = 20;
|
|
24
|
+
// The indent of everything under the title and the headings.
|
|
25
|
+
const INDENT = " ";
|
|
26
|
+
/** Draw `view` over `json`: blank line, title, then each section with content. */
|
|
27
|
+
export function renderView(view, json, ctx) {
|
|
28
|
+
const title = (view.title ?? defaultTitle)(json, ctx);
|
|
29
|
+
const out = ["", titleLine(title, ctx.style)];
|
|
30
|
+
for (const section of view.sections(json, ctx)) {
|
|
31
|
+
const body = sectionBody(section, ctx);
|
|
32
|
+
if (body.length === 0)
|
|
33
|
+
continue;
|
|
34
|
+
out.push("");
|
|
35
|
+
if (section.title !== undefined)
|
|
36
|
+
out.push(ctx.style.bold(section.title));
|
|
37
|
+
out.push(...body);
|
|
38
|
+
}
|
|
39
|
+
return `${out.join("\n")}\n`;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A resource's name (else its slug, else its id), then where it lives:
|
|
43
|
+
* `org/slug`, the organization by its label, or the slug alone on a server
|
|
44
|
+
* that holds one organization.
|
|
45
|
+
*/
|
|
46
|
+
export function defaultTitle(json, ctx) {
|
|
47
|
+
const metadata = obj(json, "metadata");
|
|
48
|
+
const slug = str(metadata, "slug");
|
|
49
|
+
const name = str(metadata, "name") || slug || str(metadata, "id");
|
|
50
|
+
return { name, ref: located(metadata, slug, ctx) };
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* `org/<tail>` for a resource of `metadata`'s organization; `tail` alone
|
|
54
|
+
* where the organization is not named (hidden, or none on the resource).
|
|
55
|
+
*/
|
|
56
|
+
export function located(metadata, tail, ctx) {
|
|
57
|
+
const own = str(metadata, "org");
|
|
58
|
+
const org = ctx.hideOrg || own === "" ? "" : (ctx.orgLabel ?? own);
|
|
59
|
+
return [org, tail].filter((part) => part !== "").join("/");
|
|
60
|
+
}
|
|
61
|
+
function titleLine(title, style) {
|
|
62
|
+
const name = style.bold(printable(title.name));
|
|
63
|
+
return title.ref === "" ? name : `${name} ${style.dim(printable(title.ref))}`;
|
|
64
|
+
}
|
|
65
|
+
function sectionBody(section, ctx) {
|
|
66
|
+
const body = [...fieldLines(section.fields ?? [], ctx.width), ...rowLines(section.rows ?? [], ctx.width)];
|
|
67
|
+
for (const line of section.lines ?? [])
|
|
68
|
+
body.push(...textLine(line, ctx.width));
|
|
69
|
+
if (section.more !== undefined && body.length > 0)
|
|
70
|
+
body.push(`${INDENT}${ctx.style.dim(section.more)}`);
|
|
71
|
+
return body;
|
|
72
|
+
}
|
|
73
|
+
function fieldLines(fields, width) {
|
|
74
|
+
const shown = fields.filter((field) => (field[1] ?? "") !== "");
|
|
75
|
+
const labelWidth = Math.max(0, ...shown.map(([label]) => stringWidth(label)));
|
|
76
|
+
return shown.flatMap(([label, value]) => {
|
|
77
|
+
const prefix = `${INDENT}${label}:${" ".repeat(labelWidth - stringWidth(label) + 2)}`;
|
|
78
|
+
return hang(prefix, printable(value).split("\n"), width);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function rowLines(written, width) {
|
|
82
|
+
const rows = written.map((row) => row.map(printableCell));
|
|
83
|
+
const columns = Math.max(0, ...rows.map((row) => row.length));
|
|
84
|
+
const widths = Array.from({ length: columns }, (_, column) => Math.max(0, ...rows.map((row) => stringWidth(row[column] ?? ""))));
|
|
85
|
+
return rows.flatMap((row) => {
|
|
86
|
+
const last = row.length - 1;
|
|
87
|
+
const prefix = INDENT + row.slice(0, last).map((cell, column) => `${cell}${" ".repeat(widths[column] - stringWidth(cell) + 2)}`).join("");
|
|
88
|
+
return hang(prefix, [row[last] ?? ""], width);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
// A text line keeps its own leading whitespace (an indented block) and list
|
|
92
|
+
// marker ("- ", "* " or "1. ", after any indent), and its continuations line
|
|
93
|
+
// up under its text.
|
|
94
|
+
function textLine(written, width) {
|
|
95
|
+
const line = printable(written);
|
|
96
|
+
const lead = /^\s*(?:[-*]|\d+\.)\s+/.exec(line)?.[0] ?? line.slice(0, line.length - line.trimStart().length);
|
|
97
|
+
return hang(`${INDENT}${lead}`, [line.slice(lead.length)], width);
|
|
98
|
+
}
|
|
99
|
+
// The first piece after `prefix`, every other under it.
|
|
100
|
+
function hang(prefix, texts, width) {
|
|
101
|
+
const indent = stringWidth(prefix);
|
|
102
|
+
const pieces = texts.flatMap((text) => wrapText(text, width === undefined ? undefined : Math.max(MIN_ROOM, width - indent)));
|
|
103
|
+
const under = " ".repeat(indent);
|
|
104
|
+
return pieces.map((piece, index) => `${index === 0 ? prefix : under}${piece}`.trimEnd());
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* `text` broken at spaces into pieces no wider than `room` columns; one
|
|
108
|
+
* word wider than the room keeps a piece of its own, whole, since cutting
|
|
109
|
+
* an address or an id would break what a person copies. With no room
|
|
110
|
+
* (piped), the text as it is.
|
|
111
|
+
*/
|
|
112
|
+
export function wrapText(text, room) {
|
|
113
|
+
if (room === undefined)
|
|
114
|
+
return [text];
|
|
115
|
+
const pieces = [];
|
|
116
|
+
let current = "";
|
|
117
|
+
for (const word of text.split(" ")) {
|
|
118
|
+
const candidate = current === "" ? word : `${current} ${word}`;
|
|
119
|
+
if (current === "" || stringWidth(candidate) <= room) {
|
|
120
|
+
current = candidate;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
pieces.push(current);
|
|
124
|
+
current = word;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
pieces.push(current);
|
|
128
|
+
return pieces;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../src/resources/views/view.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,iBAAiB;AACjB,EAAE;AACF,0EAA0E;AAC1E,0EAA0E;AAC1E,yEAAyE;AACzE,0EAA0E;AAC1E,yEAAyE;AACzE,2EAA2E;AAC3E,0EAA0E;AAC1E,6EAA6E;AAC7E,0EAA0E;AAC1E,wEAAwE;AACxE,8EAA8E;AAC9E,8EAA8E;AAC9E,EAAE;AACF,wEAAwE;AAGxE,OAAO,WAAW,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAmB,GAAG,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAkDzD,8EAA8E;AAC9E,mDAAmD;AACnD,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB,6DAA6D;AAC7D,MAAM,MAAM,GAAG,IAAI,CAAC;AAEpB,kFAAkF;AAClF,MAAM,UAAU,UAAU,CAAC,IAAc,EAAE,IAAgB,EAAE,GAAgB;IAC3E,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,YAAY,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACtD,MAAM,GAAG,GAAa,CAAC,EAAE,EAAE,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IACxD,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,GAAG,WA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1,52 @@
|
|
|
1
|
+
import type { JsonValue } from "@bufbuild/protobuf";
|
|
2
|
+
import { type JsonObject } from "../render.js";
|
|
3
|
+
import type { ViewContext } from "./view.js";
|
|
4
|
+
/** How many lines of a long text (instructions, SKILL.md, a message) a view shows. */
|
|
5
|
+
export declare const TEXT_LINES = 12;
|
|
6
|
+
/**
|
|
7
|
+
* A reference as a person names it: `org/slug`, the organization by the
|
|
8
|
+
* view's label where it is the resource's own and left out on a server that
|
|
9
|
+
* holds one; the id where the reference carries no slug; a pinned version
|
|
10
|
+
* after `@`, a hash by the short form `--version-history` prints.
|
|
11
|
+
*/
|
|
12
|
+
export declare function refLabel(ref: JsonObject, metadata: JsonObject, ctx: ViewContext): string;
|
|
13
|
+
/** Each reference of a protojson list field, labelled. */
|
|
14
|
+
export declare function refLabels(list: JsonValue | undefined, metadata: JsonObject, ctx: ViewContext): string[];
|
|
15
|
+
/** The objects of a protojson list field (none when absent). */
|
|
16
|
+
export declare function objects(list: JsonValue | undefined): JsonObject[];
|
|
17
|
+
/** The strings of a protojson list field (none when absent). */
|
|
18
|
+
export declare function strings(list: JsonValue | undefined): string[];
|
|
19
|
+
/** A run's status word ("completed", "running", "awaiting-approval"), from its protojson phase. */
|
|
20
|
+
export declare function phaseWord(run: JsonObject): string;
|
|
21
|
+
/** Whether a run has ended (completed, failed, cancelled or terminated). */
|
|
22
|
+
export declare function hasEnded(run: JsonObject): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* How long a run took ("1m 4s"), or has taken so far while it works ("3m 2s
|
|
25
|
+
* so far"); undefined before it starts, and for an ended run that recorded
|
|
26
|
+
* no end.
|
|
27
|
+
*/
|
|
28
|
+
export declare function runSpan(run: JsonObject, now: number): string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* A run's tokens as the epilogue counts them ("18.4k (12.0k in, 6.4k out)"),
|
|
31
|
+
* never a price; undefined when it counted none.
|
|
32
|
+
*/
|
|
33
|
+
export declare function tokenUsage(run: JsonObject): string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* The first `max` lines of a long text, and a note of how many more there
|
|
36
|
+
* are and how to read them; no lines for a text that is blank.
|
|
37
|
+
*/
|
|
38
|
+
export declare function firstLines(text: string, max?: number): {
|
|
39
|
+
lines: string[];
|
|
40
|
+
more?: string;
|
|
41
|
+
};
|
|
42
|
+
/** "yes" or "no" for a protojson bool (absent is false). */
|
|
43
|
+
export declare function yesNo(json: JsonObject, key: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* A routine's schedule in words, with the time zone it keeps ("every day at
|
|
46
|
+
* 09:00, Asia/Kolkata"): the shapes the console's schedule builder writes
|
|
47
|
+
* and the cron shorthands in words, any other cron as itself. No cron: it
|
|
48
|
+
* runs only when fired. The words of the console's `describeCadence`
|
|
49
|
+
* (sdk/react's routine/cadence.ts), which the CLI cannot import.
|
|
50
|
+
*/
|
|
51
|
+
export declare function scheduleWords(cron: string | undefined, timeZone: string): string;
|
|
52
|
+
//# sourceMappingURL=words.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"words.d.ts","sourceRoot":"","sources":["../../src/resources/views/words.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAKpD,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,sFAAsF;AACtF,eAAO,MAAM,UAAU,KAAK,CAAC;AAE7B;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,GAAG,MAAM,CAUxF;AAED,0DAA0D;AAC1D,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,GAAG,MAAM,EAAE,CAEvG;AAED,gEAAgE;AAChE,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,EAAE,CAEjE;AAED,gEAAgE;AAChE,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,EAAE,CAE7D;AAED,mGAAmG;AACnG,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,CAEjD;AAED,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAEjD;AASD;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOxE;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAK9D;AAaD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAa,GAAG;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAO7F;AAED,4DAA4D;AAC5D,wBAAgB,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3D;AAKD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIhF"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
// The words the designed `get` views share: a reference as `org/slug`, an
|
|
2
|
+
// instant, a span of time, a run's status, a long text's first lines, a
|
|
3
|
+
// schedule. Each reads protojson (snake_case names, enums by name, int64 as
|
|
4
|
+
// strings, timestamps as RFC 3339) and answers "" or undefined for what the
|
|
5
|
+
// resource does not carry, so the renderer leaves that line out.
|
|
6
|
+
import { formatElapsed } from "@stigmer/client";
|
|
7
|
+
import { RunPhase, RunPhaseSchema } from "@stigmer/apis/ai/stigmer/agentic/run/v1/enum_pb";
|
|
8
|
+
import { formatTokenCount } from "../run-format.js";
|
|
9
|
+
import { formatAgentPhase, isTerminalAgentPhase } from "../runs.js";
|
|
10
|
+
import { obj, str } from "../render.js";
|
|
11
|
+
import { shortVersionHash } from "../version.js";
|
|
12
|
+
/** How many lines of a long text (instructions, SKILL.md, a message) a view shows. */
|
|
13
|
+
export const TEXT_LINES = 12;
|
|
14
|
+
/**
|
|
15
|
+
* A reference as a person names it: `org/slug`, the organization by the
|
|
16
|
+
* view's label where it is the resource's own and left out on a server that
|
|
17
|
+
* holds one; the id where the reference carries no slug; a pinned version
|
|
18
|
+
* after `@`, a hash by the short form `--version-history` prints.
|
|
19
|
+
*/
|
|
20
|
+
export function refLabel(ref, metadata, ctx) {
|
|
21
|
+
const slug = str(ref, "slug") || str(ref, "id");
|
|
22
|
+
if (slug === "")
|
|
23
|
+
return "";
|
|
24
|
+
const org = str(ref, "org");
|
|
25
|
+
const own = org === str(metadata, "org") ? (ctx.orgLabel ?? org) : org;
|
|
26
|
+
const named = ctx.hideOrg || org === "" ? slug : `${own}/${slug}`;
|
|
27
|
+
const version = str(ref, "version");
|
|
28
|
+
if (version === "" || version === "latest")
|
|
29
|
+
return named;
|
|
30
|
+
// Only a full version hash (64 lowercase hex characters) has a short form.
|
|
31
|
+
return `${named}@${/^[a-f0-9]{64}$/.test(version) ? shortVersionHash(version) : version}`;
|
|
32
|
+
}
|
|
33
|
+
/** Each reference of a protojson list field, labelled. */
|
|
34
|
+
export function refLabels(list, metadata, ctx) {
|
|
35
|
+
return objects(list).map((ref) => refLabel(ref, metadata, ctx)).filter((label) => label !== "");
|
|
36
|
+
}
|
|
37
|
+
/** The objects of a protojson list field (none when absent). */
|
|
38
|
+
export function objects(list) {
|
|
39
|
+
return Array.isArray(list) ? list.filter((item) => typeof item === "object" && item !== null && !Array.isArray(item)) : [];
|
|
40
|
+
}
|
|
41
|
+
/** The strings of a protojson list field (none when absent). */
|
|
42
|
+
export function strings(list) {
|
|
43
|
+
return Array.isArray(list) ? list.filter((item) => typeof item === "string") : [];
|
|
44
|
+
}
|
|
45
|
+
/** A run's status word ("completed", "running", "awaiting-approval"), from its protojson phase. */
|
|
46
|
+
export function phaseWord(run) {
|
|
47
|
+
return formatAgentPhase(phaseOf(run));
|
|
48
|
+
}
|
|
49
|
+
/** Whether a run has ended (completed, failed, cancelled or terminated). */
|
|
50
|
+
export function hasEnded(run) {
|
|
51
|
+
return isTerminalAgentPhase(phaseOf(run));
|
|
52
|
+
}
|
|
53
|
+
// The phase protojson names ("RUN_FAILED"), found by its proto name in the
|
|
54
|
+
// enum's descriptor, since generated TypeScript names may drop a prefix.
|
|
55
|
+
function phaseOf(run) {
|
|
56
|
+
const name = str(obj(run, "status"), "phase");
|
|
57
|
+
return RunPhaseSchema.values.find((value) => value.name === name)?.number ?? RunPhase.RUN_PHASE_UNSPECIFIED;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* How long a run took ("1m 4s"), or has taken so far while it works ("3m 2s
|
|
61
|
+
* so far"); undefined before it starts, and for an ended run that recorded
|
|
62
|
+
* no end.
|
|
63
|
+
*/
|
|
64
|
+
export function runSpan(run, now) {
|
|
65
|
+
const status = obj(run, "status");
|
|
66
|
+
const start = Date.parse(str(status, "started_at"));
|
|
67
|
+
if (Number.isNaN(start))
|
|
68
|
+
return undefined;
|
|
69
|
+
const end = Date.parse(str(status, "completed_at"));
|
|
70
|
+
if (!Number.isNaN(end))
|
|
71
|
+
return formatElapsed(end - start);
|
|
72
|
+
return hasEnded(run) ? undefined : `${formatElapsed(now - start)} so far`;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A run's tokens as the epilogue counts them ("18.4k (12.0k in, 6.4k out)"),
|
|
76
|
+
* never a price; undefined when it counted none.
|
|
77
|
+
*/
|
|
78
|
+
export function tokenUsage(run) {
|
|
79
|
+
const usage = obj(obj(run, "status"), "streaming_usage");
|
|
80
|
+
const total = int64(usage, "total_tokens");
|
|
81
|
+
if (total <= 0n)
|
|
82
|
+
return undefined;
|
|
83
|
+
return `${formatTokenCount(total)} (${formatTokenCount(int64(usage, "input_tokens"))} in, ${formatTokenCount(int64(usage, "output_tokens"))} out)`;
|
|
84
|
+
}
|
|
85
|
+
// An int64 protojson field (a string on the wire), 0 when absent or unreadable.
|
|
86
|
+
function int64(json, key) {
|
|
87
|
+
const value = json[key];
|
|
88
|
+
if (typeof value !== "string" && typeof value !== "number")
|
|
89
|
+
return 0n;
|
|
90
|
+
try {
|
|
91
|
+
return BigInt(value);
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return 0n;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The first `max` lines of a long text, and a note of how many more there
|
|
99
|
+
* are and how to read them; no lines for a text that is blank.
|
|
100
|
+
*/
|
|
101
|
+
export function firstLines(text, max = TEXT_LINES) {
|
|
102
|
+
const trimmed = text.replace(/\r\n/g, "\n").trimEnd();
|
|
103
|
+
if (trimmed === "")
|
|
104
|
+
return { lines: [] };
|
|
105
|
+
const all = trimmed.split("\n");
|
|
106
|
+
if (all.length <= max)
|
|
107
|
+
return { lines: all };
|
|
108
|
+
const rest = all.length - max;
|
|
109
|
+
return { lines: all.slice(0, max), more: `… ${rest} more ${rest === 1 ? "line" : "lines"}; -o yaml for all` };
|
|
110
|
+
}
|
|
111
|
+
/** "yes" or "no" for a protojson bool (absent is false). */
|
|
112
|
+
export function yesNo(json, key) {
|
|
113
|
+
return json[key] === true ? "yes" : "no";
|
|
114
|
+
}
|
|
115
|
+
const WEEKDAYS = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
116
|
+
/**
|
|
117
|
+
* A routine's schedule in words, with the time zone it keeps ("every day at
|
|
118
|
+
* 09:00, Asia/Kolkata"): the shapes the console's schedule builder writes
|
|
119
|
+
* and the cron shorthands in words, any other cron as itself. No cron: it
|
|
120
|
+
* runs only when fired. The words of the console's `describeCadence`
|
|
121
|
+
* (sdk/react's routine/cadence.ts), which the CLI cannot import.
|
|
122
|
+
*/
|
|
123
|
+
export function scheduleWords(cron, timeZone) {
|
|
124
|
+
if (cron === undefined)
|
|
125
|
+
return "only when fired";
|
|
126
|
+
const zone = timeZone === "" ? "UTC" : timeZone;
|
|
127
|
+
return `${cadence(cron.trim().replace(/\s+/g, " "))}, ${zone}`;
|
|
128
|
+
}
|
|
129
|
+
// A cron shorthand in words; undefined for any other cron. The words are
|
|
130
|
+
// chosen as the schedule is read, not held in a table built at import.
|
|
131
|
+
function shorthandWords(cron) {
|
|
132
|
+
switch (cron) {
|
|
133
|
+
case "@hourly":
|
|
134
|
+
return "every hour, on the hour";
|
|
135
|
+
case "@daily":
|
|
136
|
+
return "every day at 00:00";
|
|
137
|
+
case "@weekly":
|
|
138
|
+
return "every Sunday at 00:00";
|
|
139
|
+
case "@monthly":
|
|
140
|
+
return "on day 1 of every month at 00:00";
|
|
141
|
+
case "@yearly":
|
|
142
|
+
return "every year on January 1 at 00:00";
|
|
143
|
+
}
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
function cadence(cron) {
|
|
147
|
+
const shorthand = shorthandWords(cron);
|
|
148
|
+
if (shorthand !== undefined)
|
|
149
|
+
return shorthand;
|
|
150
|
+
const custom = `cron "${cron}"`;
|
|
151
|
+
const fields = cron.split(" ");
|
|
152
|
+
if (fields.length !== 5)
|
|
153
|
+
return custom;
|
|
154
|
+
const [m, h, d, month, w] = fields;
|
|
155
|
+
const minute = upTo(m, 59);
|
|
156
|
+
if (month !== "*" || minute === undefined)
|
|
157
|
+
return custom;
|
|
158
|
+
if (h === "*" && d === "*" && w === "*")
|
|
159
|
+
return `every hour at minute ${minute}`;
|
|
160
|
+
const hour = upTo(h, 23);
|
|
161
|
+
if (hour === undefined)
|
|
162
|
+
return custom;
|
|
163
|
+
const at = `at ${String(hour).padStart(2, "0")}:${String(minute).padStart(2, "0")}`;
|
|
164
|
+
if (d === "*" && w === "*")
|
|
165
|
+
return `every day ${at}`;
|
|
166
|
+
const day = upTo(d, 31);
|
|
167
|
+
if (day !== undefined && day >= 1 && w === "*")
|
|
168
|
+
return `on day ${day} of every month ${at}`;
|
|
169
|
+
const days = d === "*" ? weekdays(w) : undefined;
|
|
170
|
+
return days === undefined ? custom : `every ${days} ${at}`;
|
|
171
|
+
}
|
|
172
|
+
// A one- or two-digit field no greater than `max`; undefined for any other.
|
|
173
|
+
function upTo(field, max) {
|
|
174
|
+
if (!/^\d{1,2}$/.test(field))
|
|
175
|
+
return undefined;
|
|
176
|
+
const value = Number(field);
|
|
177
|
+
return value <= max ? value : undefined;
|
|
178
|
+
}
|
|
179
|
+
// "1,3,5" as "Monday, Wednesday and Friday"; undefined for anything else.
|
|
180
|
+
function weekdays(field) {
|
|
181
|
+
if (!/^[0-6](,[0-6])*$/.test(field))
|
|
182
|
+
return undefined;
|
|
183
|
+
const names = [...new Set(field.split(",").map(Number))].sort((a, b) => a - b).map((day) => WEEKDAYS[day]);
|
|
184
|
+
if (names.length === 7)
|
|
185
|
+
return "day";
|
|
186
|
+
if (names.join() === WEEKDAYS.slice(1, 6).join())
|
|
187
|
+
return "weekday";
|
|
188
|
+
return names.length === 1 ? names[0] : `${names.slice(0, -1).join(", ")} and ${names[names.length - 1]}`;
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=words.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"words.js","sourceRoot":"","sources":["../../src/resources/views/words.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,wEAAwE;AACxE,4EAA4E;AAC5E,4EAA4E;AAC5E,iEAAiE;AAGjE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAA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ERVER_ADDRESS override.
|
|
4
|
+
*/
|
|
5
|
+
export type ServerAddressSource = "local" | "cloud" | "selfhost" | "environment";
|
|
6
|
+
/** The server address a backend client dials, as resolved, with its source. */
|
|
7
|
+
export interface ServerAddress {
|
|
8
|
+
readonly address: string;
|
|
9
|
+
readonly source: ServerAddressSource;
|
|
10
|
+
}
|
|
1
11
|
export declare function setDebug(value: boolean): void;
|
|
2
12
|
export declare function isDebug(): boolean;
|
|
3
13
|
export declare function setStandalone(value: boolean): void;
|
|
4
14
|
export declare function isStandalone(): boolean;
|
|
15
|
+
/** Record the path of the command that runs (`stigmer get`), for errors that name it. */
|
|
16
|
+
export declare function setActionCommand(path: string): void;
|
|
17
|
+
/** The path of the command that runs; "" before an action starts. */
|
|
18
|
+
export declare function actionCommandPath(): string;
|
|
19
|
+
/** Record the address the backend client dials; undefined forgets it (tests). */
|
|
20
|
+
export declare function setServerAddress(value: ServerAddress | undefined): void;
|
|
21
|
+
/** The address the backend client dials; undefined when no client was made. */
|
|
22
|
+
export declare function dialedServerAddress(): ServerAddress | undefined;
|
|
23
|
+
/** Record the resource type the running command resolved, as `stigmer list` spells it ("" forgets it). */
|
|
24
|
+
export declare function setActionResourceType(type: string): void;
|
|
25
|
+
/** The resource type the running command resolved; "" when none was. */
|
|
26
|
+
export declare function actionResourceType(): string;
|
|
5
27
|
//# sourceMappingURL=runtime.d.ts.map
|
package/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["src/runtime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["src/runtime.ts"],"names":[],"mappings":"AAeA;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC;AAEjF,+EAA+E;AAC/E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;CACtC;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAE7C;AAED,wBAAgB,OAAO,IAAI,OAAO,CAEjC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAElD;AAED,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED,yFAAyF;AACzF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEnD;AAED,qEAAqE;AACrE,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CAEvE;AAED,+EAA+E;AAC/E,wBAAgB,mBAAmB,IAAI,aAAa,GAAG,SAAS,CAE/D;AAED,0GAA0G;AAC1G,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAExD;AAED,wEAAwE;AACxE,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C"}
|
package/runtime.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
// Process-global CLI flags that cross-cutting modules (config, errors, logger)
|
|
2
2
|
// read without threading them through every call. Set once by the root
|
|
3
|
-
// preAction hook from the parsed global options
|
|
4
|
-
//
|
|
3
|
+
// preAction hook from the parsed global options and the command that runs.
|
|
4
|
+
//
|
|
5
|
+
// Two records are written later, by the command itself, so an error can
|
|
6
|
+
// name what was actually tried: the server address the backend client
|
|
7
|
+
// dials (and where that address came from), recorded when the client is
|
|
8
|
+
// made, and the resource type a get, delete or download resolved.
|
|
5
9
|
let debug = false;
|
|
6
10
|
let standalone = false;
|
|
11
|
+
let actionCommand = "";
|
|
12
|
+
let serverAddress;
|
|
13
|
+
let resourceType = "";
|
|
7
14
|
export function setDebug(value) {
|
|
8
15
|
debug = value;
|
|
9
16
|
}
|
|
@@ -16,4 +23,28 @@ export function setStandalone(value) {
|
|
|
16
23
|
export function isStandalone() {
|
|
17
24
|
return standalone;
|
|
18
25
|
}
|
|
26
|
+
/** Record the path of the command that runs (`stigmer get`), for errors that name it. */
|
|
27
|
+
export function setActionCommand(path) {
|
|
28
|
+
actionCommand = path;
|
|
29
|
+
}
|
|
30
|
+
/** The path of the command that runs; "" before an action starts. */
|
|
31
|
+
export function actionCommandPath() {
|
|
32
|
+
return actionCommand;
|
|
33
|
+
}
|
|
34
|
+
/** Record the address the backend client dials; undefined forgets it (tests). */
|
|
35
|
+
export function setServerAddress(value) {
|
|
36
|
+
serverAddress = value;
|
|
37
|
+
}
|
|
38
|
+
/** The address the backend client dials; undefined when no client was made. */
|
|
39
|
+
export function dialedServerAddress() {
|
|
40
|
+
return serverAddress;
|
|
41
|
+
}
|
|
42
|
+
/** Record the resource type the running command resolved, as `stigmer list` spells it ("" forgets it). */
|
|
43
|
+
export function setActionResourceType(type) {
|
|
44
|
+
resourceType = type;
|
|
45
|
+
}
|
|
46
|
+
/** The resource type the running command resolved; "" when none was. */
|
|
47
|
+
export function actionResourceType() {
|
|
48
|
+
return resourceType;
|
|
49
|
+
}
|
|
19
50
|
//# sourceMappingURL=runtime.js.map
|
package/runtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["src/runtime.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,uEAAuE;AACvE,
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["src/runtime.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,uEAAuE;AACvE,2EAA2E;AAC3E,EAAE;AACF,wEAAwE;AACxE,sEAAsE;AACtE,wEAAwE;AACxE,kEAAkE;AAElE,IAAI,KAAK,GAAG,KAAK,CAAC;AAClB,IAAI,UAAU,GAAG,KAAK,CAAC;AACvB,IAAI,aAAa,GAAG,EAAE,CAAC;AACvB,IAAI,aAAwC,CAAC;AAC7C,IAAI,YAAY,GAAG,EAAE,CAAC;AActB,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,KAAK,GAAG,KAAK,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,OAAO;IACrB,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,UAAU,GAAG,KAAK,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,aAAa,GAAG,IAAI,CAAC;AACvB,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,iBAAiB;IAC/B,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,gBAAgB,CAAC,KAAgC;IAC/D,aAAa,GAAG,KAAK,CAAC;AACxB,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,mBAAmB;IACjC,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,0GAA0G;AAC1G,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,YAAY,GAAG,IAAI,CAAC;AACtB,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,kBAAkB;IAChC,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
package/src/auth/auth0.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// password), and PKCE removes the need for a client secret entirely. The
|
|
6
6
|
// authorize/token endpoints are hardcoded because Auth0's URL structure is
|
|
7
7
|
// stable ({domain}/authorize, {domain}/oauth/token), saving an OIDC-discovery
|
|
8
|
-
// round-trip at login time.
|
|
8
|
+
// round-trip at login time.
|
|
9
9
|
|
|
10
10
|
export const AUTH0_DOMAIN = "https://stigmer-prod.us.auth0.com";
|
|
11
11
|
export const CLIENT_ID = "kIT6URf4HKn6YzrQVVFTFN63BrSJdTPM";
|