@weftlabs/cli 0.29.0 → 0.31.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 (2) hide show
  1. package/README.md +88 -0
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -13,6 +13,78 @@ history or process listings.
13
13
  `weft --help` and `weft <command> --help` return machine-readable JSON without
14
14
  requiring authentication.
15
15
 
16
+ ## Develop from source
17
+
18
+ This path is for contributors in a cloned checkout, not live buyer use.
19
+ Install [Mise](https://mise.jdx.dev/getting-started.html) and Git first.
20
+ [Activate Mise in your interactive shell](https://mise.jdx.dev/getting-started.html#activate-mise)
21
+ once. Run the blocks below separately from the repository root; after tool
22
+ installation, wait for the next shell prompt before installing dependencies. [`.mise.toml`](.mise.toml) owns the
23
+ Node, pnpm, and lefthook versions; [`package.json`](package.json) and
24
+ [`pnpm-lock.yaml`](pnpm-lock.yaml) own dependencies. The CLI uses the published
25
+ `@weftlabs/sdk`, not a local SDK checkout.
26
+
27
+ Review the Mise configuration before you trust it, then install tools and
28
+ locked dependencies. Dependency installation needs registry access, but no
29
+ Weft credential or account. Install the normal Git hooks defined in
30
+ [`lefthook.yml`](lefthook.yml); do not bypass them.
31
+
32
+ ```sh
33
+ mise trust
34
+ mise install
35
+ ```
36
+
37
+ Then install dependencies and hooks:
38
+
39
+ ```sh
40
+ pnpm install --frozen-lockfile
41
+ lefthook install
42
+ ```
43
+
44
+ Build the source and check local help without authentication:
45
+
46
+ ```sh
47
+ pnpm run build
48
+ WEFT_SKIP_SKILL_INSTALL=1 node bin/weft.mjs --help
49
+ ```
50
+
51
+ Expect one JSON object with `ok: true` and `command: "help"`. This help path
52
+ returns before credential loading, API requests, account or wallet actions,
53
+ and Skill installation. Keep `WEFT_SKIP_SKILL_INSTALL=1` for local CLI checks
54
+ to opt out of automatic Skill installation on ordinary commands. No `.env`,
55
+ buyer API key, bootstrap, global CLI install, or agent host is needed here.
56
+ Help verifies local command loading, not live API or payment behavior.
57
+
58
+ The local quality commands are owned by `package.json`:
59
+
60
+ ```sh
61
+ pnpm run lint:check
62
+ pnpm run format:check
63
+ pnpm run typecheck
64
+ pnpm run test:unit
65
+ ```
66
+
67
+ Unit tests use mocked API responses and temporary local state. Some test
68
+ fixtures copy the vendored Skill into `dist/` and install it into temporary
69
+ host directories; they do not install an agent runtime or a Skill in your
70
+ normal home. The format check covers source, tests, and scripts, not Markdown.
71
+
72
+ The optional package-distribution check is separate from the first-run smoke:
73
+
74
+ ```sh
75
+ WEFT_SKIP_SKILL_INSTALL=1 pnpm run test:packed
76
+ ```
77
+
78
+ Run it after the build. It packs the CLI, runs `prepack` to copy the vendored
79
+ Skill into `dist/`, installs the archive in a temporary consumer project,
80
+ and checks the SDK against the public npm registry. It needs network access;
81
+ it does not prove buyer API access. Do not change the vendored `skills/weft/`
82
+ files here.
83
+
84
+ These are one-shot commands. No persistent server starts, so no stop command
85
+ is needed. The buyer and bootstrap examples below are optional live workflows,
86
+ not source-development verification.
87
+
16
88
  ## With a buyer API key
17
89
 
18
90
  ```sh
@@ -220,3 +292,19 @@ See [`examples/agent-bootstrap.sh`](examples/agent-bootstrap.sh) for the same
220
292
  sequence as a script, and
221
293
  [`docs/contract.md`](docs/contract.md) for commands,
222
294
  output envelopes, and stable exit codes.
295
+
296
+ ## SDK follow and release
297
+
298
+ `.github/workflows/sdk-follow.yml` checks npm every hour. When a newer
299
+ `@weftlabs/sdk` is older than `minimumReleaseAge`, it opens or updates
300
+ `bot/cli-follow-sdk-<version>`. It does not push to `main` and it does not
301
+ merge. A breaking SDK line (a major change, or a minor change while the SDK
302
+ is `0.x`) is titled and labeled `breaking SDK line`.
303
+
304
+ After that pull request is merged, push a `v*` tag on `main`. That tag runs
305
+ the release. If the tag exists and npm does not have the version, the same
306
+ workflow dispatches the release again.
307
+
308
+ GitHub disables a scheduled workflow in a public repository after 60 days
309
+ with no activity. Re-enable `Follow SDK releases` in the Actions tab if the
310
+ schedule stops.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weftlabs/cli",
3
- "version": "0.29.0",
3
+ "version": "0.31.0",
4
4
  "description": "Command-line client for the Weft buyer runtime",
5
5
  "type": "module",
6
6
  "bin": {
@@ -32,17 +32,17 @@
32
32
  "url": "https://github.com/weftlabs/weft-cli/issues"
33
33
  },
34
34
  "dependencies": {
35
- "@weftlabs/sdk": "^0.29.0"
35
+ "@weftlabs/sdk": "^0.31.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "^26.6.2",
39
39
  "@typescript-eslint/eslint-plugin": "^8.70.1",
40
40
  "@typescript-eslint/parser": "^8.70.1",
41
41
  "eslint": "^10.11.0",
42
- "prettier": "3.9.6",
42
+ "prettier": "3.9.9",
43
43
  "tsup": "^8.5.1",
44
44
  "typescript": "^6.0.3",
45
- "vitest": "^4.1.11"
45
+ "vitest": "^5.0.3"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=18.0.0"
@@ -50,8 +50,8 @@
50
50
  "scripts": {
51
51
  "build": "tsup",
52
52
  "typecheck": "tsc --noEmit",
53
- "test": "vitest run tests && node --test scripts/publish-npm-archive.test.mjs",
54
- "test:unit": "vitest run tests && node --test scripts/publish-npm-archive.test.mjs",
53
+ "test": "vitest run tests && node --test scripts/publish-npm-archive.test.mjs scripts/sdk-follow.test.mjs scripts/skill-drift.test.mjs",
54
+ "test:unit": "vitest run tests && node --test scripts/publish-npm-archive.test.mjs scripts/sdk-follow.test.mjs scripts/skill-drift.test.mjs",
55
55
  "test:packed": "node scripts/test-packed-artifact.mjs",
56
56
  "lint:check": "eslint",
57
57
  "format:check": "prettier --check \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/**/*.mjs\""