@samva/cli 0.2.1 → 0.3.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.
Files changed (4) hide show
  1. package/AGENTS.md +6 -14
  2. package/README.md +8 -8
  3. package/dist/bin.mjs +16568 -11206
  4. package/package.json +13 -12
package/AGENTS.md CHANGED
@@ -17,8 +17,8 @@ each requires `--template-id`, because a reference is a statement about one temp
17
17
 
18
18
  `samva templates workspace <open|diff|patch|check|fixture|save|history|publish>` is the
19
19
  hosted project workspace over the CLI, for a caller with no clone: an agent in a sandbox, a CI job,
20
- a script. It reaches the same domain-authorized operations the hosted MCP tools reach, so both
21
- external transports complete one journey against one substrate. Every subcommand prints its complete
20
+ a script. It reaches the same operations the hosted MCP tools reach, so an agent can start a journey in one
21
+ and finish it in the other. Every subcommand prints its complete
22
22
  result as JSON because these outputs — revisions, digests, diagnostics — are inputs to the next
23
23
  call. `open` returns the revision every other subcommand is fenced to; a workspace that moved refuses
24
24
  them, and reopening is the recovery. A source that does not build is a successful call carrying a
@@ -35,26 +35,18 @@ with the template and the JSON pointer rather than generated as `unknown`.
35
35
 
36
36
  `samva templates init --name <name>` creates a starter-backed Artifact project and clones its Git
37
37
  repository. `samva templates clone <template-id>` clones an existing project. Both configure a
38
- repository-local credential helper that exchanges Samva authorization for a one-hour,
38
+ repository-local credential helper that exchanges Samva authorization for a short-lived,
39
39
  repository-scoped credential; the token is never stored in the remote URL or Git config. Normal
40
40
  `git fetch`, `git pull`, `git add`, `git commit`, and `git push` remain the synchronization commands.
41
- Run `bun install --frozen-lockfile` before `samva templates check` or `samva templates build`, then
41
+ Install from the project's lockfile (`bun install --frozen-lockfile` or `npm ci`) before `samva templates check` or `samva templates build`, then
42
42
  publish a clean, pushed commit with `samva templates publish`. Publish checks that the selected
43
43
  commit is an ancestor of the fetched `origin/<default-branch>` and creates an immutable receipt; it
44
44
  does not push or rewrite history. The CLI loads the project's installed authoring toolchain so its
45
45
  compiler and editor versions stay pinned by the project lockfile.
46
- Template authoring commands require Node.js 22 or newer; other CLI commands remain self-contained.
46
+ Template authoring commands run that toolchain under Node.js and name the Node.js version they need
47
+ when it is missing; other CLI commands are self-contained.
47
48
 
48
49
  `@samva/cli` ships the JavaScript implementation and its runtime dependencies. Its launcher prefers
49
50
  the matching platform-specific `@samva/cli-*` executable and falls back to the packaged JavaScript
50
51
  CLI through Bun when npm omits optional dependencies. Depend on `@samva/cli`, never a native
51
52
  artifact directly.
52
-
53
- ## Command handler tracing
54
-
55
- Every `Command.withHandler` body uses `Effect.fnUntraced`, and that is the convention for the whole
56
- command surface rather than an omission at each site. A handler is the process: it runs once, prints,
57
- and exits, so a span would name the run instead of a step inside it, and the CLI installs no tracer
58
- to receive one. Reusable work that outlives a single call still carries a name, as
59
- `src/config/store.ts` does with `Effect.fn("CliConfig.writeConfig")` and
60
- `Effect.fn("CliConfig.writeCredentials")`.
package/README.md CHANGED
@@ -63,17 +63,17 @@ the device flow with `samva login --no-browser`; `--no-input`, `--json`, and `--
63
63
  If a stored OAuth record is malformed, run `samva logout` and then `samva login`; API-key calls do
64
64
  not read or decode stored OAuth credentials.
65
65
 
66
- Profiles hold non-secret target and organization settings. Credentials stay in the OS keyring.
66
+ Profiles hold non-secret organization settings. Credentials stay in the OS keyring.
67
67
 
68
68
  ```sh
69
- samva profile create local --target local
70
- samva profile use local
71
- samva --profile local email doctor
69
+ samva profile create acme --org acme
70
+ samva profile use acme
71
+ samva --profile acme email doctor
72
72
  ```
73
73
 
74
74
  The profile resolves as `--profile`, then `SAMVA_PROFILE`, then the active profile, then `default`.
75
- The API URL resolves as `--api-url`, then `SAMVA_API_URL`, then the profile target. `local` targets
76
- the Portless API origin `https://api.samva.localhost`. `production` targets `https://api.samva.dev`.
75
+ The API URL resolves as `--api-url`, then `SAMVA_API_URL`, then `https://api.samva.dev`. Profiles
76
+ do not select an API; a config whose profile sets `target` fails to load and names these overrides.
77
77
 
78
78
  ## Common operations
79
79
 
@@ -256,7 +256,7 @@ samva email send --to ada@example.com --subject "Hello" --text "Hi!" --dry-run -
256
256
  samva messages list --all --jsonl
257
257
 
258
258
  # Suppress successful human output.
259
- samva --quiet profile use local
259
+ samva --quiet profile use acme
260
260
  ```
261
261
 
262
262
  `--json` writes one bounded, versioned result envelope to stdout:
@@ -315,7 +315,7 @@ samva webhooks test wep_abc123 --data '{"event":"webhook.test"}' --json
315
315
  samva webhooks test wep_abc123 --data @payload.json --json
316
316
  ```
317
317
 
318
- `samva email doctor` reports resolved profile, target, API URL, auth source, organization access,
318
+ `samva email doctor` reports resolved profile, API URL, auth source, organization access,
319
319
  sending domains, senders, and domain-verification readback. It is read-only and does not inspect
320
320
  receiving configuration, verify DNS, send an email, replay fixtures, or check provider readiness.
321
321
  Use `samva email receiving status <domain-id>` to read a domain's receiving prerequisite status.