@kindgi/cli 0.1.8 → 0.1.9-rc.1
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 +59 -2
- package/dist/api-address.d.ts +104 -12
- package/dist/api-address.d.ts.map +1 -1
- package/dist/api-address.js +169 -30
- package/dist/api-address.js.map +1 -1
- package/dist/build/host-install.d.ts.map +1 -1
- package/dist/build/host-install.js +5 -2
- package/dist/build/host-install.js.map +1 -1
- package/dist/cli.js +12 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/approvals.d.ts.map +1 -1
- package/dist/commands/approvals.js +15 -3
- package/dist/commands/approvals.js.map +1 -1
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +27 -0
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/build.d.ts +18 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +118 -13
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/conversations.d.ts.map +1 -1
- package/dist/commands/conversations.js +13 -3
- package/dist/commands/conversations.js.map +1 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +235 -53
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/deployments.d.ts +3 -0
- package/dist/commands/deployments.d.ts.map +1 -0
- package/dist/commands/deployments.js +196 -0
- package/dist/commands/deployments.js.map +1 -0
- package/dist/commands/doctor.d.ts +1 -5
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +42 -22
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/egress.d.ts +9 -0
- package/dist/commands/egress.d.ts.map +1 -0
- package/dist/commands/egress.js +40 -0
- package/dist/commands/egress.js.map +1 -0
- package/dist/commands/env-scoped.d.ts +5 -0
- package/dist/commands/env-scoped.d.ts.map +1 -1
- package/dist/commands/env-scoped.js +64 -19
- package/dist/commands/env-scoped.js.map +1 -1
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/env.js +91 -30
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/environments.d.ts +6 -0
- package/dist/commands/environments.d.ts.map +1 -0
- package/dist/commands/environments.js +166 -0
- package/dist/commands/environments.js.map +1 -0
- package/dist/commands/exports.d.ts.map +1 -1
- package/dist/commands/exports.js +118 -3
- package/dist/commands/exports.js.map +1 -1
- package/dist/commands/feedback.d.ts +1 -2
- package/dist/commands/feedback.d.ts.map +1 -1
- package/dist/commands/feedback.js +55 -24
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/helpers.d.ts +6 -0
- package/dist/commands/helpers.d.ts.map +1 -1
- package/dist/commands/helpers.js +8 -0
- package/dist/commands/helpers.js.map +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +12 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/license.d.ts +3 -0
- package/dist/commands/license.d.ts.map +1 -1
- package/dist/commands/license.js +1 -1
- package/dist/commands/license.js.map +1 -1
- package/dist/commands/people.d.ts.map +1 -1
- package/dist/commands/people.js +105 -10
- package/dist/commands/people.js.map +1 -1
- package/dist/commands/projects.d.ts.map +1 -1
- package/dist/commands/projects.js +133 -11
- package/dist/commands/projects.js.map +1 -1
- package/dist/commands/promote.d.ts +38 -0
- package/dist/commands/promote.d.ts.map +1 -0
- package/dist/commands/promote.js +371 -0
- package/dist/commands/promote.js.map +1 -0
- package/dist/commands/proposals.d.ts.map +1 -1
- package/dist/commands/proposals.js +2 -1
- package/dist/commands/proposals.js.map +1 -1
- package/dist/commands/providers.d.ts.map +1 -1
- package/dist/commands/providers.js +29 -5
- package/dist/commands/providers.js.map +1 -1
- package/dist/commands/schedules.d.ts.map +1 -1
- package/dist/commands/schedules.js +30 -2
- package/dist/commands/schedules.js.map +1 -1
- package/dist/commands/secrets.d.ts.map +1 -1
- package/dist/commands/secrets.js +65 -40
- package/dist/commands/secrets.js.map +1 -1
- package/dist/commands/sign-in.d.ts +3 -0
- package/dist/commands/sign-in.d.ts.map +1 -0
- package/dist/commands/sign-in.js +61 -0
- package/dist/commands/sign-in.js.map +1 -0
- package/dist/commands/sites.d.ts +3 -0
- package/dist/commands/sites.d.ts.map +1 -0
- package/dist/commands/sites.js +244 -0
- package/dist/commands/sites.js.map +1 -0
- package/dist/commands/tools.d.ts.map +1 -1
- package/dist/commands/tools.js +2 -2
- package/dist/commands/tools.js.map +1 -1
- package/dist/commands/types.d.ts +11 -0
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/commands/webhooks.d.ts.map +1 -1
- package/dist/commands/webhooks.js +38 -2
- package/dist/commands/webhooks.js.map +1 -1
- package/dist/config.d.ts +13 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +20 -7
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts +38 -2
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +12 -1
- package/dist/context.js.map +1 -1
- package/dist/deploy/defaults.d.ts.map +1 -1
- package/dist/deploy/defaults.js +7 -1
- package/dist/deploy/defaults.js.map +1 -1
- package/dist/deploy/pack-service-text.d.ts +29 -0
- package/dist/deploy/pack-service-text.d.ts.map +1 -0
- package/dist/deploy/pack-service-text.js +72 -0
- package/dist/deploy/pack-service-text.js.map +1 -0
- package/dist/deploy/post.d.ts +17 -4
- package/dist/deploy/post.d.ts.map +1 -1
- package/dist/deploy/post.js +177 -60
- package/dist/deploy/post.js.map +1 -1
- package/dist/deploy/promotion-path.d.ts +44 -0
- package/dist/deploy/promotion-path.d.ts.map +1 -0
- package/dist/deploy/promotion-path.js +86 -0
- package/dist/deploy/promotion-path.js.map +1 -0
- package/dist/deploy/response.d.ts +3 -0
- package/dist/deploy/response.d.ts.map +1 -1
- package/dist/deploy/response.js +66 -12
- package/dist/deploy/response.js.map +1 -1
- package/dist/deploy/runners.d.ts +99 -5
- package/dist/deploy/runners.d.ts.map +1 -1
- package/dist/dev/java-builder.d.ts.map +1 -1
- package/dist/dev/java-builder.js +19 -3
- package/dist/dev/java-builder.js.map +1 -1
- package/dist/dev/python-builder.d.ts.map +1 -1
- package/dist/dev/python-builder.js +18 -3
- package/dist/dev/python-builder.js.map +1 -1
- package/dist/dev/runtime-container.d.ts +28 -3
- package/dist/dev/runtime-container.d.ts.map +1 -1
- package/dist/dev/runtime-container.js +103 -36
- package/dist/dev/runtime-container.js.map +1 -1
- package/dist/dev/runtime-image.d.ts +1 -1
- package/dist/dev/runtime-image.d.ts.map +1 -1
- package/dist/dev/runtime-image.js +1 -1
- package/dist/dev/runtime-image.js.map +1 -1
- package/dist/dev/scala-builder.d.ts.map +1 -1
- package/dist/dev/scala-builder.js +55 -21
- package/dist/dev/scala-builder.js.map +1 -1
- package/dist/dev/shared-watch.d.ts +30 -0
- package/dist/dev/shared-watch.d.ts.map +1 -1
- package/dist/dev/shared-watch.js +46 -1
- package/dist/dev/shared-watch.js.map +1 -1
- package/dist/env/pack-env-hint.d.ts +52 -0
- package/dist/env/pack-env-hint.d.ts.map +1 -0
- package/dist/env/pack-env-hint.js +57 -0
- package/dist/env/pack-env-hint.js.map +1 -0
- package/dist/env/pack-env-plan.d.ts +2 -0
- package/dist/env/pack-env-plan.d.ts.map +1 -1
- package/dist/env/pack-env-plan.js +2 -1
- package/dist/env/pack-env-plan.js.map +1 -1
- package/dist/env-projects.d.ts +23 -0
- package/dist/env-projects.d.ts.map +1 -0
- package/dist/env-projects.js +28 -0
- package/dist/env-projects.js.map +1 -0
- package/dist/exports/create.d.ts +71 -0
- package/dist/exports/create.d.ts.map +1 -0
- package/dist/exports/create.js +576 -0
- package/dist/exports/create.js.map +1 -0
- package/dist/exports/plan.d.ts +69 -0
- package/dist/exports/plan.d.ts.map +1 -0
- package/dist/exports/plan.js +496 -0
- package/dist/exports/plan.js.map +1 -0
- package/dist/exports/reader.d.ts +48 -0
- package/dist/exports/reader.d.ts.map +1 -0
- package/dist/exports/reader.js +181 -0
- package/dist/exports/reader.js.map +1 -0
- package/dist/feedback/entries.d.ts +53 -0
- package/dist/feedback/entries.d.ts.map +1 -0
- package/dist/feedback/entries.js +173 -0
- package/dist/feedback/entries.js.map +1 -0
- package/dist/feedback/intake.d.ts +37 -0
- package/dist/feedback/intake.d.ts.map +1 -0
- package/dist/feedback/intake.js +101 -0
- package/dist/feedback/intake.js.map +1 -0
- package/dist/feedback/protocol.d.ts +111 -0
- package/dist/feedback/protocol.d.ts.map +1 -0
- package/dist/feedback/protocol.js +143 -0
- package/dist/feedback/protocol.js.map +1 -0
- package/dist/feedback/redact.d.ts +34 -0
- package/dist/feedback/redact.d.ts.map +1 -0
- package/dist/feedback/redact.js +258 -0
- package/dist/feedback/redact.js.map +1 -0
- package/dist/feedback/report.d.ts +51 -0
- package/dist/feedback/report.d.ts.map +1 -0
- package/dist/feedback/report.js +122 -0
- package/dist/feedback/report.js.map +1 -0
- package/dist/feedback/run.d.ts +21 -0
- package/dist/feedback/run.d.ts.map +1 -0
- package/dist/feedback/run.js +578 -0
- package/dist/feedback/run.js.map +1 -0
- package/dist/feedback/store.d.ts +24 -0
- package/dist/feedback/store.d.ts.map +1 -0
- package/dist/feedback/store.js +117 -0
- package/dist/feedback/store.js.map +1 -0
- package/dist/main.d.ts +6 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +86 -5
- package/dist/main.js.map +1 -1
- package/dist/node-version.d.ts +13 -0
- package/dist/node-version.d.ts.map +1 -0
- package/dist/node-version.js +37 -0
- package/dist/node-version.js.map +1 -0
- package/dist/parse.d.ts +8 -2
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js +7 -2
- package/dist/parse.js.map +1 -1
- package/dist/project-ref.d.ts +44 -0
- package/dist/project-ref.d.ts.map +1 -0
- package/dist/project-ref.js +69 -0
- package/dist/project-ref.js.map +1 -0
- package/dist/sdk-skills/kindgi-authoring-agents/SKILL.md +15 -2
- package/dist/sdk-skills/kindgi-authoring-flows/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-authoring-guardrails/SKILL.md +44 -7
- package/dist/sdk-skills/kindgi-authoring-mcp-servers/SKILL.md +11 -2
- package/dist/sdk-skills/kindgi-authoring-providers/SKILL.md +60 -13
- package/dist/sdk-skills/kindgi-authoring-tools/SKILL.md +19 -2
- package/dist/sdk-skills/kindgi-framework-feedback/SKILL.md +82 -3
- package/dist/sdk-skills/kindgi-getting-started/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-java-authoring-agents/SKILL.md +17 -3
- package/dist/sdk-skills/kindgi-java-authoring-flows/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-java-authoring-guardrails/SKILL.md +43 -6
- package/dist/sdk-skills/kindgi-java-authoring-tools/SKILL.md +19 -2
- package/dist/sdk-skills/kindgi-java-getting-started/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-python-authoring-agents/SKILL.md +17 -3
- package/dist/sdk-skills/kindgi-python-authoring-flows/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-python-authoring-guardrails/SKILL.md +49 -13
- package/dist/sdk-skills/kindgi-python-authoring-tools/SKILL.md +27 -3
- package/dist/sdk-skills/kindgi-python-getting-started/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-scala-authoring-agents/SKILL.md +17 -3
- package/dist/sdk-skills/kindgi-scala-authoring-flows/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-scala-authoring-guardrails/SKILL.md +43 -6
- package/dist/sdk-skills/kindgi-scala-authoring-tools/SKILL.md +19 -2
- package/dist/sdk-skills/kindgi-scala-getting-started/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-using/SKILL.md +1 -1
- package/dist/slug.d.ts +18 -0
- package/dist/slug.d.ts.map +1 -0
- package/dist/slug.js +29 -0
- package/dist/slug.js.map +1 -0
- package/dist/templates/drupal/AGENTS.md +2 -0
- package/dist/templates/java/AGENTS.md +2 -0
- package/dist/templates/minimal/AGENTS.md +2 -0
- package/dist/templates/python/AGENTS.md +2 -0
- package/dist/templates/sample/AGENTS.md +2 -0
- package/dist/templates/scala/AGENTS.md +2 -0
- package/dist/templates/woocommerce/AGENTS.md +11 -4
- package/dist/templates/woocommerce/README.md.tmpl +47 -4
- package/dist/templates/woocommerce/agents/store-agent/index.test.ts.tmpl +13 -0
- package/dist/templates/woocommerce/agents/store-agent/index.ts.tmpl +11 -1
- package/dist/templates/woocommerce/tools/publish-product/index.ts.tmpl +7 -1
- package/dist/templates/woocommerce/tools/refund/index.ts.tmpl +7 -2
- package/dist/templates/woocommerce/tools/refund-large/index.ts.tmpl +8 -2
- package/dist/templates/woocommerce/tools/set-price/index.ts.tmpl +6 -0
- package/dist/value-target.d.ts +139 -0
- package/dist/value-target.d.ts.map +1 -0
- package/dist/value-target.js +231 -0
- package/dist/value-target.js.map +1 -0
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ Desktop, or a Docker engine on Linux). A Python pack needs Python and the
|
|
|
38
38
|
| [`kindgi key`](#kindgi-key) | Ed25519 signing keys: local pairs under `~/.kindgi/keys/`, and the runtime's trust list. |
|
|
39
39
|
| [`kindgi skills`](#kindgi-skills) | Refresh the Claude Code skills in `.claude/skills/`. |
|
|
40
40
|
| [`kindgi mcp`](#kindgi-mcp) | MCP servers for your coding agent, in `.mcp.json`. |
|
|
41
|
-
| [`kindgi feedback`](#kindgi-feedback) | Note framework friction in the pack's `FEEDBACK.md
|
|
41
|
+
| [`kindgi feedback`](#kindgi-feedback) | Note framework friction in the pack's `FEEDBACK.md`, and send it to Kindgi once the person says yes to the preview. |
|
|
42
42
|
|
|
43
43
|
The rest of the commands talk to a running Kindgi API: see
|
|
44
44
|
[API commands](#api-commands).
|
|
@@ -590,6 +590,7 @@ and `--published-at`: the same inputs then give the same image.
|
|
|
590
590
|
| `--push[=<repository>]` | With `--local`: push the image, sign it, and write the envelope. Default repository: the env block's `registry` + `/<packId>`. |
|
|
591
591
|
| `--platform=<os/arch>` | The image's platform. Default: `linux/amd64` when pushing, else this machine's. |
|
|
592
592
|
| `--endpoint=<url>` | The build server. Default: the env block's `build`. |
|
|
593
|
+
| `--out=<dir>` | Where the build writes `dist/`, the `Containerfile`, `context/` and `deploy-envelope.json`. Default: `.kindgi/build`, under the pack. It cannot be the pack root or a directory that contains it; for a TypeScript pack it must stay under the pack root, where the pack's `node_modules` resolves the bundled indexer's imports. |
|
|
593
594
|
| `--tenant=<id>` | The tenant the signature names. Default: the env block's `tenantId`, else `KINDGI_TENANT_ID`. |
|
|
594
595
|
| `--signing-key=<path>` | The Ed25519 private key (PEM). Default: the env block's `signingKey`. |
|
|
595
596
|
| `--skip-integrity-gate` | Sign without re-checking the image's index. Prints a warning. |
|
|
@@ -626,7 +627,10 @@ deployment. The envelope is `--from-envelope`, else
|
|
|
626
627
|
deployment's secrets after it lands. Off by default; without it, a deploy
|
|
627
628
|
with such a file says what it didn't send. With it, secret-shaped names
|
|
628
629
|
(`*_KEY`, `*_TOKEN`, `*_SECRET`, …) get a warning: those belong in
|
|
629
|
-
`kindgi secrets set`.
|
|
630
|
+
`kindgi secrets set`. A hosted deploy (`--hosted`, or an env block's
|
|
631
|
+
`build: 'hosted'`) needs `--env` with it, since a hosted runtime reads
|
|
632
|
+
a deployment's secrets in the env it serves. Without it the deploy is
|
|
633
|
+
refused before anything is built or sent.
|
|
630
634
|
- **Errors** carry a hint for the common ones: `signature-invalid`,
|
|
631
635
|
`signer-not-trusted`, `image-unverifiable`,
|
|
632
636
|
`deployment-validation-failed`.
|
|
@@ -760,6 +764,18 @@ pack's env files in its environment, so the secret is never written into
|
|
|
760
764
|
friction to `FEEDBACK.md` at the pack root, where a coding agent can leave
|
|
761
765
|
what it diagnosed for the maintainers.
|
|
762
766
|
|
|
767
|
+
- `kindgi feedback submit --preview` prints exactly what would be sent to
|
|
768
|
+
Kindgi's intake (access.kindgi.com), after redaction, with its digest.
|
|
769
|
+
`--yes=<digest>` then sends exactly that; at a terminal it asks instead.
|
|
770
|
+
Home directories, paths outside the pack, the pack's env values, keys,
|
|
771
|
+
tokens, URL query values and email addresses are taken out first.
|
|
772
|
+
`KINDGI_FEEDBACK_SUBMIT=off` turns sending off.
|
|
773
|
+
- `kindgi feedback status` says what became of the reports sent: received,
|
|
774
|
+
known, fixed (and in which version), won't fix, or withdrawn.
|
|
775
|
+
- `kindgi feedback withdraw <id>` takes a report back: the intake clears its
|
|
776
|
+
text at once. The key it needs stays in `~/.kindgi/feedback/keys.json` on
|
|
777
|
+
the machine that sent it; `FEEDBACK.md` holds only the report id.
|
|
778
|
+
|
|
763
779
|
## API commands
|
|
764
780
|
|
|
765
781
|
These call a running Kindgi API through [`@kindgi/client`](../../sdks/typescript).
|
|
@@ -822,6 +838,46 @@ The API URL and token come from, in order:
|
|
|
822
838
|
pair once with `kindgi auth login --url=<url> --token=<token>`, and check it
|
|
823
839
|
with `kindgi auth whoami`.
|
|
824
840
|
|
|
841
|
+
**In a folder where `kindgi dev` ran, `--hosted` reaches the other API.**
|
|
842
|
+
There, `.kindgirc.json` points every command at the dev runtime, ahead of
|
|
843
|
+
your `kindgi auth login`. With `--hosted`, a command goes to the CLI's own
|
|
844
|
+
address (`--url`, `KINDGI_API_URL` or the one `kindgi auth login` stored),
|
|
845
|
+
with that address's key, and doesn't read the dev runtime's
|
|
846
|
+
`.kindgirc.json`: `kindgi auth whoami --hosted` checks your sign-in. An env
|
|
847
|
+
with `build: 'hosted'` in `kindgi.config.ts` does the same for a command
|
|
848
|
+
that acts in it (`--env <name>`, or `staging` for `kindgi build` and
|
|
849
|
+
`kindgi deploy`). With no address of its own, a hosted command is refused
|
|
850
|
+
before it sends anything, and the refusal says the file isn't read.
|
|
851
|
+
`kindgi dev --hosted` is refused (exit 2): a dev runtime is never hosted.
|
|
852
|
+
|
|
853
|
+
A command that goes to the dev runtime while another address is in reach
|
|
854
|
+
says so first, on stderr:
|
|
855
|
+
|
|
856
|
+
```text
|
|
857
|
+
kindgi auth whoami goes to the kindgi dev runtime at http://127.0.0.1:4000 (…/.kindgirc.json says so). For https://platform.kindgi.com, pass --hosted.
|
|
858
|
+
```
|
|
859
|
+
|
|
860
|
+
When the key was given with `--token` or `KINDGI_API_TOKEN` and nothing
|
|
861
|
+
else is signed in, the line ends `To send it to the address your key is
|
|
862
|
+
for, pass --url <that address> or export KINDGI_API_URL.` in place of the
|
|
863
|
+
`--hosted` sentence. There's no line when `--url` or `KINDGI_API_URL` named
|
|
864
|
+
the address, or when the dev runtime is the only one in reach.
|
|
865
|
+
|
|
866
|
+
**A stored key goes only to the address stored with it.** A key in
|
|
867
|
+
`.kindgirc.json` or `~/.kindgi/config.json` is for the `apiUrl` beside it.
|
|
868
|
+
When the two files hold keys for different addresses, the key used is the
|
|
869
|
+
one stored with the API URL the command goes to, so in a `kindgi dev`
|
|
870
|
+
folder `--url <the address you signed in to>` uses your sign-in's key.
|
|
871
|
+
When no key is stored for that address (a `--url`, `KINDGI_API_URL` or
|
|
872
|
+
folder `apiUrl` that names another one, or a key with no `apiUrl` beside
|
|
873
|
+
it), a command that needs the key is refused before it sends anything,
|
|
874
|
+
naming both addresses and the file. A command that sends no key isn't.
|
|
875
|
+
`kindgi auth login --url=<url>` saves a stored key only for its own address:
|
|
876
|
+
for another one, give that server's key with `--token` or `KINDGI_API_TOKEN`.
|
|
877
|
+
A key given with `--token` or `KINDGI_API_TOKEN` goes to whatever address
|
|
878
|
+
the command goes to. `kindgi doctor` says which key the CLI would use, and
|
|
879
|
+
whether it's for the API URL.
|
|
880
|
+
|
|
825
881
|
### The runtime image's registry
|
|
826
882
|
|
|
827
883
|
The Kindgi runtime image `kindgi dev` runs needs a pull credential (a robot
|
|
@@ -852,6 +908,7 @@ to a mirror instead and checks for the same image there.
|
|
|
852
908
|
| `--table` | A table for list responses (`runs list`, `tools list`, `providers list`; JSON where a list has no columns). |
|
|
853
909
|
| `--quiet` | Nothing on stdout; the exit code only. |
|
|
854
910
|
| `--url=<url>`, `--token=<token>` | The API and its token (see above). |
|
|
911
|
+
| `--hosted` | Go to the CLI's own address, never a `kindgi dev` runtime's `.kindgirc.json` (see above). `kindgi build` and `kindgi deploy` then use the hosted build service. `kindgi dev` refuses it. |
|
|
855
912
|
| `--verbose`, `-v` | Full errors: stack traces and the API's error bodies. |
|
|
856
913
|
| `--version` | The CLI's version. |
|
|
857
914
|
| `--help`, `-h` | Help for the CLI or a command. |
|
package/dist/api-address.d.ts
CHANGED
|
@@ -1,24 +1,47 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Where
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
2
|
+
* Where the CLI may send its API key. A stored key (`kindgi auth login`'s
|
|
3
|
+
* ~/.kindgi/config.json, or `kindgi dev`'s .kindgirc.json) is for the
|
|
4
|
+
* address stored beside it, and goes only there. The key for an address
|
|
5
|
+
* is the one stored with it (`storedKeyFor`); when none is,
|
|
6
|
+
* the command is refused before it sends anything, naming both addresses
|
|
7
|
+
* and the file, wherever the address is named (`--url`, KINDGI_API_URL, a
|
|
8
|
+
* folder's .kindgirc.json, an env block's `endpoint`, `--endpoint`). A
|
|
9
|
+
* key given for the command (`--token`, KINDGI_API_TOKEN) goes where the
|
|
10
|
+
* command says.
|
|
11
|
+
*
|
|
12
|
+
* - **Every command** that sends the key to the CLI's own address
|
|
13
|
+
* (`ctx.client()`, `ctx.token()`): `ownAddressKeyRefusal`.
|
|
8
14
|
*
|
|
9
|
-
* - **Hosted** (`--hosted`, or the env block's `build: 'hosted'`
|
|
15
|
+
* - **Hosted** (`--hosted`, or the env block's `build: 'hosted'` for the
|
|
16
|
+
* env the command acts in: `hostedScope`), on every command: the API
|
|
10
17
|
* is the CLI's own address (`--url`, KINDGI_API_URL or the stored one),
|
|
11
18
|
* whatever key it goes with. An address named elsewhere may only repeat
|
|
12
|
-
* it, and with no own address there's nothing to
|
|
19
|
+
* it, and with no own address there's nothing to go to. A folder's
|
|
13
20
|
* .kindgirc.json for a `kindgi dev` runtime (`kindgi dev` wrote it, or
|
|
14
21
|
* it's at a loopback address) isn't read, address or key: a dev
|
|
15
|
-
* runtime is never a hosted target.
|
|
22
|
+
* runtime is never a hosted target. A command that isn't hosted and
|
|
23
|
+
* goes to that runtime says so first when another address is in reach
|
|
24
|
+
* (`devRuntimeHint`).
|
|
16
25
|
* - **A deploy to a runtime of your own:** `--endpoint`, else the env
|
|
17
26
|
* block's `endpoint`, else the CLI's own address. A key given for the
|
|
18
27
|
* command (`--token`, or an exported KINDGI_API_TOKEN) may go to any of
|
|
19
28
|
* them; a stored key only to its own address.
|
|
20
29
|
*/
|
|
21
|
-
import type { ResolvedConfig } from './config.js';
|
|
30
|
+
import type { ResolvedConfig, StoredKey } from './config.js';
|
|
31
|
+
/**
|
|
32
|
+
* The stored key for `url`: the one the files' order picks (this folder's
|
|
33
|
+
* over the home one) when it's for `url`, else the one stored for `url`
|
|
34
|
+
* in another file, else the picked one, which then can't go to `url`. A
|
|
35
|
+
* key with no address beside it is never passed over: nothing says which
|
|
36
|
+
* address it's for, so it's refused wherever it would go, never swapped.
|
|
37
|
+
*/
|
|
38
|
+
export declare function storedKeyFor(keys: readonly StoredKey[], url: string | undefined): StoredKey | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* `config` with the stored key for `url` (`storedKeyFor`) as its key: for
|
|
41
|
+
* a command that goes to another address than the CLI's own (`kindgi
|
|
42
|
+
* deploy --endpoint`). A key given for the command stays as it is.
|
|
43
|
+
*/
|
|
44
|
+
export declare function keyedFor(config: ResolvedConfig, url: string): ResolvedConfig;
|
|
22
45
|
/** An address a command was given, and where (`--endpoint`, `environments.prod.endpoint`). */
|
|
23
46
|
export interface NamedAddress {
|
|
24
47
|
readonly url: string | undefined;
|
|
@@ -39,13 +62,82 @@ export type ApiAddress = {
|
|
|
39
62
|
* repeat it. `command` names the command in the refusal.
|
|
40
63
|
*/
|
|
41
64
|
export declare function hostedApiAddress(command: string, config: ResolvedConfig, named: readonly NamedAddress[]): ApiAddress;
|
|
65
|
+
/**
|
|
66
|
+
* Why a hosted command has nowhere to go: no own address is set, and a
|
|
67
|
+
* folder's .kindgirc.json for a `kindgi dev` runtime, if there's one,
|
|
68
|
+
* isn't read.
|
|
69
|
+
*/
|
|
70
|
+
export declare function hostedNoAddress(command: string, config: ResolvedConfig): string;
|
|
71
|
+
/** Whether a command is hosted, and the config it goes on with. */
|
|
72
|
+
export interface HostedScope {
|
|
73
|
+
/** `--hosted`, or the env the command acts in has `build: 'hosted'`. */
|
|
74
|
+
readonly hosted: boolean;
|
|
75
|
+
/** The config, without a `kindgi dev` runtime's .kindgirc.json when hosted (`hostedConfig`). */
|
|
76
|
+
readonly config: ResolvedConfig;
|
|
77
|
+
}
|
|
78
|
+
export interface HostedScopeInputs {
|
|
79
|
+
readonly config: ResolvedConfig;
|
|
80
|
+
/** `--hosted`. */
|
|
81
|
+
readonly flag: boolean;
|
|
82
|
+
/** The env the command acts in (`--env`, else its default); `undefined` when none applies. */
|
|
83
|
+
readonly envName: string | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Read the env block whether or not a `kindgi dev` runtime's
|
|
86
|
+
* .kindgirc.json is here: for a command whose run hosted changes, not
|
|
87
|
+
* only its address (`kindgi build`, `kindgi deploy`).
|
|
88
|
+
*/
|
|
89
|
+
readonly always: boolean;
|
|
90
|
+
/** Whether the pack's env block says `build: 'hosted'`; `false` with no pack config, or a broken one. */
|
|
91
|
+
readonly envIsHosted: (envName: string) => Promise<boolean>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The one hosted rule, for every command: `--hosted`, or the env the
|
|
95
|
+
* command acts in has `build: 'hosted'`. Hosted, the command goes on the
|
|
96
|
+
* config without a `kindgi dev` runtime's .kindgirc.json. Elsewhere the
|
|
97
|
+
* env block can only change the address when such a file is here, so it's
|
|
98
|
+
* read only then, unless `always`.
|
|
99
|
+
*/
|
|
100
|
+
export declare function hostedScope(inputs: HostedScopeInputs): Promise<HostedScope>;
|
|
101
|
+
/**
|
|
102
|
+
* The config a hosted command goes on with: the one resolved without a
|
|
103
|
+
* `kindgi dev` runtime's .kindgirc.json (`devRuntime.without`), the file
|
|
104
|
+
* still known, so `ctx.config`, `ctx.client()` and `ctx.token()` agree.
|
|
105
|
+
*/
|
|
106
|
+
export declare function hostedConfig(config: ResolvedConfig): ResolvedConfig;
|
|
107
|
+
/**
|
|
108
|
+
* The line a command that isn't hosted prints first when it sends a key
|
|
109
|
+
* to the `kindgi dev` runtime this folder's .kindgirc.json names, and
|
|
110
|
+
* another address is in reach: a stored sign-in for another address
|
|
111
|
+
* (`--hosted` goes there), or a key given for the command (its own
|
|
112
|
+
* address needs naming). `undefined` when the address was named for the
|
|
113
|
+
* command (`--url`, KINDGI_API_URL), or nothing else is in reach.
|
|
114
|
+
*/
|
|
115
|
+
export declare function devRuntimeHint(command: string, config: ResolvedConfig): string | undefined;
|
|
42
116
|
/**
|
|
43
117
|
* A deploy's API: the first of `named` that's given, else the CLI's own
|
|
44
118
|
* address; `undefined` when there's none. A stored key goes only to the
|
|
45
119
|
* address stored with it; a key given for the command goes where the
|
|
46
|
-
* command says.
|
|
120
|
+
* command says. `command` names the command in the refusal (`kindgi
|
|
121
|
+
* promote` goes where a deploy does).
|
|
47
122
|
*/
|
|
48
|
-
export declare function deployApiAddress(config: ResolvedConfig, named: readonly NamedAddress[]): ApiAddress | undefined;
|
|
123
|
+
export declare function deployApiAddress(config: ResolvedConfig, named: readonly NamedAddress[], command?: string): ApiAddress | undefined;
|
|
124
|
+
/**
|
|
125
|
+
* Why a command that sends the API key to the CLI's own address can't:
|
|
126
|
+
* the stored key isn't for it. `undefined` when it can, or when there's
|
|
127
|
+
* no address or no key (which the command says itself).
|
|
128
|
+
*/
|
|
129
|
+
export declare function ownAddressKeyRefusal(command: string, config: ResolvedConfig): string | undefined;
|
|
130
|
+
/** What `ownAddressKeyRefusal` finds, in parts: for `kindgi doctor`'s check. */
|
|
131
|
+
export interface KeyElsewhere {
|
|
132
|
+
/** "the API key stored in …, which is for …, to …, which … names". */
|
|
133
|
+
readonly sends: string;
|
|
134
|
+
/** What else is stored, and that none is for the address: "" or a sentence and a space. */
|
|
135
|
+
readonly stored: string;
|
|
136
|
+
/** "The key goes only to its own address: …, or …." */
|
|
137
|
+
readonly fix: string;
|
|
138
|
+
}
|
|
139
|
+
/** The stored key can't go to the CLI's own address: why, in parts (`KeyElsewhere`). */
|
|
140
|
+
export declare function ownAddressKeyElsewhere(config: ResolvedConfig): KeyElsewhere | undefined;
|
|
49
141
|
/**
|
|
50
142
|
* One address, however it's written: the scheme, the host (any case; the
|
|
51
143
|
* loopback names localhost, 127.0.0.1 and ::1 are one), the port (a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-address.d.ts","sourceRoot":"","sources":["../src/api-address.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"api-address.d.ts","sourceRoot":"","sources":["../src/api-address.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7D;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,SAAS,SAAS,EAAE,EAC1B,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB,SAAS,GAAG,SAAS,CAMvB;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,GAAG,cAAc,CAW5E;AAED,8FAA8F;AAC9F,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,gGAAgG;AAChG,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;CAAE,GAC9E;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,O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U,GAAG,SAAS,CAaxB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,CAIhG;AAED,gFAAgF;AAChF,MAAM,WAAW,YAAY;IAC3B,sEAAsE;IACtE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2FAA2F;IAC3F,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,wFAAwF;AACxF,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,cAAc,GAAG,YAAY,GAAG,SAAS,CAIvF;AAgFD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,+EAA+E;AAC/E,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAMnD"}
|
package/dist/api-address.js
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
/**
|
|
4
|
+
* The stored key for `url`: the one the files' order picks (this folder's
|
|
5
|
+
* over the home one) when it's for `url`, else the one stored for `url`
|
|
6
|
+
* in another file, else the picked one, which then can't go to `url`. A
|
|
7
|
+
* key with no address beside it is never passed over: nothing says which
|
|
8
|
+
* address it's for, so it's refused wherever it would go, never swapped.
|
|
9
|
+
*/
|
|
10
|
+
export function storedKeyFor(keys, url) {
|
|
11
|
+
const picked = keys.at(-1);
|
|
12
|
+
if (picked?.apiUrl === undefined || url === undefined || sameAddress(picked.apiUrl, url)) {
|
|
13
|
+
return picked;
|
|
14
|
+
}
|
|
15
|
+
return keys.findLast((k) => k.apiUrl !== undefined && sameAddress(k.apiUrl, url)) ?? picked;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* `config` with the stored key for `url` (`storedKeyFor`) as its key: for
|
|
19
|
+
* a command that goes to another address than the CLI's own (`kindgi
|
|
20
|
+
* deploy --endpoint`). A key given for the command stays as it is.
|
|
21
|
+
*/
|
|
22
|
+
export function keyedFor(config, url) {
|
|
23
|
+
if (config.source.token !== 'file' || config.storedKeys === undefined)
|
|
24
|
+
return config;
|
|
25
|
+
const key = storedKeyFor(config.storedKeys, url);
|
|
26
|
+
if (key === undefined)
|
|
27
|
+
return config;
|
|
28
|
+
const { keyAddress: _old, ...rest } = config;
|
|
29
|
+
return {
|
|
30
|
+
...rest,
|
|
31
|
+
token: key.token,
|
|
32
|
+
files: { ...config.files, token: key.file },
|
|
33
|
+
...(key.apiUrl !== undefined && { keyAddress: key.apiUrl }),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
3
36
|
/**
|
|
4
37
|
* A hosted build's or deploy's API: the CLI's own address, without a
|
|
5
38
|
* folder's .kindgirc.json for a `kindgi dev` runtime. `named` may only
|
|
@@ -8,14 +41,8 @@
|
|
|
8
41
|
export function hostedApiAddress(command, config, named) {
|
|
9
42
|
const hosted = config.devRuntime?.without ?? config;
|
|
10
43
|
const own = hosted.apiUrl;
|
|
11
|
-
if (own === undefined || own === '')
|
|
12
|
-
|
|
13
|
-
const at = dev?.apiUrl === undefined ? '' : ` (${dev.apiUrl})`;
|
|
14
|
-
const unread = dev === undefined
|
|
15
|
-
? ''
|
|
16
|
-
: ` ${dev.file} points this folder at a \`kindgi dev\` runtime${at}, which isn't a hosted target, so ${command} doesn't read it.`;
|
|
17
|
-
return refused(`${command} goes to the API your key is for, and no API address is set.${unread} Run \`kindgi auth login --url <url>\`, export KINDGI_API_URL, or pass --url <url>.`);
|
|
18
|
-
}
|
|
44
|
+
if (own === undefined || own === '')
|
|
45
|
+
return refused(hostedNoAddress(command, config));
|
|
19
46
|
const keyElsewhere = storedKeyRefusal(command, hosted, own, ownWhere(hosted), false);
|
|
20
47
|
if (keyElsewhere !== undefined)
|
|
21
48
|
return refused(keyElsewhere);
|
|
@@ -23,24 +50,104 @@ export function hostedApiAddress(command, config, named) {
|
|
|
23
50
|
if (other !== undefined) {
|
|
24
51
|
return refused(`${command} sends your API key to ${own}, the address it's for (${ownSource(hosted)}), ` +
|
|
25
52
|
`and ${other.where} names another: ${other.url}. The key goes only to its own address: ` +
|
|
26
|
-
`remove ${other.where} (Kindgi Cloud needs none), or
|
|
27
|
-
`\`kindgi auth login --url ${other.url}\`.`);
|
|
53
|
+
`remove ${other.where} (Kindgi Cloud needs none), or ${signIn(other.url)}.`);
|
|
28
54
|
}
|
|
29
55
|
return { kind: 'ok', url: own, config: hosted };
|
|
30
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Why a hosted command has nowhere to go: no own address is set, and a
|
|
59
|
+
* folder's .kindgirc.json for a `kindgi dev` runtime, if there's one,
|
|
60
|
+
* isn't read.
|
|
61
|
+
*/
|
|
62
|
+
export function hostedNoAddress(command, config) {
|
|
63
|
+
const dev = config.devRuntime;
|
|
64
|
+
const at = dev?.apiUrl === undefined ? '' : ` (${dev.apiUrl})`;
|
|
65
|
+
const unread = dev === undefined
|
|
66
|
+
? ''
|
|
67
|
+
: ` ${dev.file} points this folder at a \`kindgi dev\` runtime${at}, which isn't a hosted target, so ${command} doesn't read it.`;
|
|
68
|
+
return `${command} goes to the API your key is for, and no API address is set.${unread} Run \`kindgi auth login --url <url> --token <its key>\`, export KINDGI_API_URL, or pass --url <url>.`;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The one hosted rule, for every command: `--hosted`, or the env the
|
|
72
|
+
* command acts in has `build: 'hosted'`. Hosted, the command goes on the
|
|
73
|
+
* config without a `kindgi dev` runtime's .kindgirc.json. Elsewhere the
|
|
74
|
+
* env block can only change the address when such a file is here, so it's
|
|
75
|
+
* read only then, unless `always`.
|
|
76
|
+
*/
|
|
77
|
+
export async function hostedScope(inputs) {
|
|
78
|
+
const { config, envName } = inputs;
|
|
79
|
+
const hosted = inputs.flag ||
|
|
80
|
+
(envName !== undefined &&
|
|
81
|
+
(inputs.always || config.devRuntime !== undefined) &&
|
|
82
|
+
(await inputs.envIsHosted(envName)));
|
|
83
|
+
return { hosted, config: hosted ? hostedConfig(config) : config };
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The config a hosted command goes on with: the one resolved without a
|
|
87
|
+
* `kindgi dev` runtime's .kindgirc.json (`devRuntime.without`), the file
|
|
88
|
+
* still known, so `ctx.config`, `ctx.client()` and `ctx.token()` agree.
|
|
89
|
+
*/
|
|
90
|
+
export function hostedConfig(config) {
|
|
91
|
+
const dev = config.devRuntime;
|
|
92
|
+
return dev === undefined ? config : { ...dev.without, devRuntime: dev };
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The line a command that isn't hosted prints first when it sends a key
|
|
96
|
+
* to the `kindgi dev` runtime this folder's .kindgirc.json names, and
|
|
97
|
+
* another address is in reach: a stored sign-in for another address
|
|
98
|
+
* (`--hosted` goes there), or a key given for the command (its own
|
|
99
|
+
* address needs naming). `undefined` when the address was named for the
|
|
100
|
+
* command (`--url`, KINDGI_API_URL), or nothing else is in reach.
|
|
101
|
+
*/
|
|
102
|
+
export function devRuntimeHint(command, config) {
|
|
103
|
+
const dev = config.devRuntime;
|
|
104
|
+
const url = config.apiUrl;
|
|
105
|
+
if (dev === undefined || url === undefined || config.files?.apiUrl?.path !== dev.file) {
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
const goes = `${command} goes to the kindgi dev runtime at ${url} (${dev.file} says so).`;
|
|
109
|
+
const other = dev.without.apiUrl;
|
|
110
|
+
if (given(other) && !sameAddress(other, url)) {
|
|
111
|
+
return `${goes} For ${other}, pass --hosted.\n`;
|
|
112
|
+
}
|
|
113
|
+
if (config.source.token === 'flag' || config.source.token === 'env') {
|
|
114
|
+
return `${goes} To send it to the address your key is for, pass --url <that address> or export KINDGI_API_URL.\n`;
|
|
115
|
+
}
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
31
118
|
/**
|
|
32
119
|
* A deploy's API: the first of `named` that's given, else the CLI's own
|
|
33
120
|
* address; `undefined` when there's none. A stored key goes only to the
|
|
34
121
|
* address stored with it; a key given for the command goes where the
|
|
35
|
-
* command says.
|
|
122
|
+
* command says. `command` names the command in the refusal (`kindgi
|
|
123
|
+
* promote` goes where a deploy does).
|
|
36
124
|
*/
|
|
37
|
-
export function deployApiAddress(config, named) {
|
|
125
|
+
export function deployApiAddress(config, named, command = 'kindgi deploy') {
|
|
38
126
|
const chosen = named.find((n) => given(n.url));
|
|
39
127
|
const url = chosen?.url ?? config.apiUrl;
|
|
40
128
|
if (url === undefined || url === '')
|
|
41
129
|
return undefined;
|
|
42
|
-
const
|
|
43
|
-
|
|
130
|
+
const keyed = keyedFor(config, url);
|
|
131
|
+
const keyElsewhere = storedKeyRefusal(command, keyed, url, chosen?.where ?? ownWhere(config), true);
|
|
132
|
+
return keyElsewhere !== undefined ? refused(keyElsewhere) : { kind: 'ok', url, config: keyed };
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Why a command that sends the API key to the CLI's own address can't:
|
|
136
|
+
* the stored key isn't for it. `undefined` when it can, or when there's
|
|
137
|
+
* no address or no key (which the command says itself).
|
|
138
|
+
*/
|
|
139
|
+
export function ownAddressKeyRefusal(command, config) {
|
|
140
|
+
const url = config.apiUrl;
|
|
141
|
+
if (url === undefined || url === '')
|
|
142
|
+
return undefined;
|
|
143
|
+
return storedKeyRefusal(command, config, url, ownWhere(config), true);
|
|
144
|
+
}
|
|
145
|
+
/** The stored key can't go to the CLI's own address: why, in parts (`KeyElsewhere`). */
|
|
146
|
+
export function ownAddressKeyElsewhere(config) {
|
|
147
|
+
const url = config.apiUrl;
|
|
148
|
+
if (url === undefined || url === '')
|
|
149
|
+
return undefined;
|
|
150
|
+
return keyElsewhere(config, url, ownWhere(config), true);
|
|
44
151
|
}
|
|
45
152
|
/**
|
|
46
153
|
* Why a stored key can't go to `url` (named by `where`): it's for another
|
|
@@ -50,28 +157,60 @@ export function deployApiAddress(config, named) {
|
|
|
50
157
|
* deploy's; a hosted command's address is the CLI's own whatever the key).
|
|
51
158
|
*/
|
|
52
159
|
function storedKeyRefusal(command, config, url, where, keyForCommand) {
|
|
160
|
+
const found = keyElsewhere(config, url, where, keyForCommand);
|
|
161
|
+
if (found === undefined)
|
|
162
|
+
return undefined;
|
|
163
|
+
return `${command} would send ${found.sends}. ${found.stored}${found.fix}`;
|
|
164
|
+
}
|
|
165
|
+
function keyElsewhere(config, url, where, keyForCommand) {
|
|
53
166
|
if (config.source.token !== 'file')
|
|
54
167
|
return undefined;
|
|
168
|
+
const keyAddress = config.keyAddress;
|
|
169
|
+
if (keyAddress !== undefined && sameAddress(url, keyAddress))
|
|
170
|
+
return undefined;
|
|
55
171
|
const keyFile = config.files?.token;
|
|
56
|
-
const stored = keyFile === undefined ? 'stored' : `stored in ${keyFile.path}`;
|
|
57
|
-
// `kindgi auth login` writes the home file; a folder's file stays over it.
|
|
58
|
-
const signIn = keyFile?.kind !== 'folder';
|
|
172
|
+
const stored = keyFile === undefined ? 'the API key stored' : `the API key stored in ${keyFile.path}`;
|
|
59
173
|
const giveKey = keyForCommand ? ["give that server's key with --token or KINDGI_API_TOKEN"] : [];
|
|
60
|
-
const keyAddress = config.keyAddress;
|
|
61
174
|
if (keyAddress === undefined) {
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
:
|
|
65
|
-
|
|
175
|
+
const addAddress = `add "apiUrl": "${url}" beside it in ${keyFile?.path ?? 'its file'}, if it's that server's key`;
|
|
176
|
+
return {
|
|
177
|
+
sends: `${stored} to ${url}, and no address is stored with that key, so nothing shows it's for ${url}`,
|
|
178
|
+
stored: '',
|
|
179
|
+
fix: ownAddressOnly([addAddress, signIn(url), ...giveKey]),
|
|
180
|
+
};
|
|
66
181
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
`point ${where} at ${keyAddress}`,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
182
|
+
return {
|
|
183
|
+
sends: `${stored}, which is for ${keyAddress}, to ${url}, which ${where} names`,
|
|
184
|
+
stored: otherKeys(config, url),
|
|
185
|
+
fix: ownAddressOnly([`point ${where} at ${keyAddress}`, signIn(url), ...giveKey]),
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* How to sign in to `url`. `kindgi auth login` keeps the key with its
|
|
190
|
+
* address in the home file, where it's found by that address from any
|
|
191
|
+
* folder; it saves only a key it's given (auth.ts), never a stored one for
|
|
192
|
+
* another address, so the hint always gives one.
|
|
193
|
+
*/
|
|
194
|
+
function signIn(url) {
|
|
195
|
+
return `sign in to ${url} with \`kindgi auth login --url ${url} --token <its key>\``;
|
|
196
|
+
}
|
|
197
|
+
function ownAddressOnly(fixes) {
|
|
198
|
+
return `The key goes only to its own address: ${oneOf(fixes)}.`;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* The other stored keys, and that none is for `url`: "" when the key is
|
|
202
|
+
* the only one. In a folder where `kindgi dev` ran, its .kindgirc.json is
|
|
203
|
+
* read over the home sign-in, so this says where each key is for.
|
|
204
|
+
*/
|
|
205
|
+
function otherKeys(config, url) {
|
|
206
|
+
const keyFile = config.files?.token;
|
|
207
|
+
const others = (config.storedKeys ?? []).filter((k) => k.file.path !== keyFile?.path);
|
|
208
|
+
if (others.length === 0)
|
|
209
|
+
return '';
|
|
210
|
+
const each = others.map((k) => k.apiUrl === undefined
|
|
211
|
+
? `${k.file.path} has one with no address`
|
|
212
|
+
: `${k.file.path} has one for ${k.apiUrl}`);
|
|
213
|
+
return `${each.join(', and ')}, and none is stored for ${url}. `;
|
|
75
214
|
}
|
|
76
215
|
/**
|
|
77
216
|
* One address, however it's written: the scheme, the host (any case; the
|
package/dist/api-address.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-address.js","sourceRoot":"","sources":["../src/api-address.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;
|
|
1
|
+
{"version":3,"file":"api-address.js","sourceRoot":"","sources":["../src/api-address.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAkCjC;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAC1B,IAA0B,EAC1B,GAAuB;IAEvB,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,IAAI,MAAM,EAAE,MAAM,KAAK,SAAS,IAAI,GAAG,KAAK,SAAS,IAAI,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;QACzF,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,IAAI,WAAW,CAAC,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC;AAC9F,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAsB,EAAE,GAAW;IAC1D,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,KAAK,MAAM,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACrF,MAAM,GAAG,GAAG,YAAY,CAAC,MAAM,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IACjD,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACrC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;IAC7C,OAAO;QACL,GAAG,IAAI;QACP,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,KAAK,EAAE,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE;QAC3C,GA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I,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;CAAE,GACtD;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAoBvD,6DAA6D;AAC7D,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAwKrF;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAErF;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAE7F;AAWD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EAStD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAS1D;AAED,uFAAuF;AACvF,MAAM,WAAW,eAAe;IAC9B,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,uCAAuC;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,eAAe,CAsCrE"}
|
|
@@ -259,11 +259,14 @@ export function installCommands(install) {
|
|
|
259
259
|
// A workspace: the pack's project and what it depends on, not the
|
|
260
260
|
// rest of the workspace. The prune is the same filtered install with
|
|
261
261
|
// --prod (`pnpm prune` ignores a filter and installs the whole
|
|
262
|
-
// workspace).
|
|
262
|
+
// workspace). It changes what's installed, so pnpm purges the modules
|
|
263
|
+
// directories first, and asks: a build has no terminal to answer, and
|
|
264
|
+
// pnpm 10 and 11 stop there, pnpm 9 skips the prune. The build
|
|
265
|
+
// scripts' output survives it (pnpm 9 to 12).
|
|
263
266
|
const only = `--filter '{${install.packRel === '' ? '.' : `./${install.packRel}`}}...'`;
|
|
264
267
|
return {
|
|
265
268
|
install: `pnpm install --frozen-lockfile --ignore-scripts ${only} && pnpm ${only} rebuild`,
|
|
266
|
-
prune: `pnpm install --frozen-lockfile --ignore-scripts --prod ${only}`,
|
|
269
|
+
prune: `pnpm install --frozen-lockfile --ignore-scripts --prod --config.confirm-modules-purge=false ${only}`,
|
|
267
270
|
};
|
|
268
271
|
}
|
|
269
272
|
case 'npm':
|