octwin-cli 0.5.1 → 0.6.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/CHANGELOG.md CHANGED
@@ -5,6 +5,48 @@ Format: [Keep a Changelog](https://keepachangelog.com/) — newest first, bucket
5
5
  **Added · Changed · Deprecated · Removed · Fixed · Security**. The platform-wide view lives in the
6
6
  repo root [`CHANGELOG.md`](../../CHANGELOG.md); this file is the CLI-only cut that ships with the package.
7
7
 
8
+ ## [0.6.1] - 2026-08-18
9
+
10
+ ### Fixed
11
+ - **`octwin status` worked for no pack at all, and had not since 2026-08-01.** It sent the manifest's
12
+ **bare** id (`clinic`) to a route that requires the qualified `<owner>.<name>` — and a manifest
13
+ cannot legally declare the qualified form, because the owner segment is attached at publish time
14
+ from the authenticated publisher (both the platform and this CLI reject a `.` in it). So the route
15
+ answered 404 for every pack, every time. It now resolves the owner from `whoami`'s `tenant_slug`,
16
+ and takes an explicit `octwin status <packId>` when you already know it (from `octwin agents` or
17
+ `octwin projects`, both of which print qualified ids). Reported by two pack authors, who lost time
18
+ to a command that said their pack was missing seconds after a deploy the platform had accepted.
19
+ - **A 404 from `octwin status` no longer always reads "not installed".** That one branch covered four
20
+ different failures — a malformed pack id, an unknown tenant, an unknown/pinned-elsewhere project,
21
+ and the genuine no-active-install — so the message named the *least* likely cause and sent an author
22
+ chasing a deploy that had already succeeded. The route says which; the CLI now relays it, and adds
23
+ the "run `octwin deploy` first" hint only to the case it fits.
24
+ - **`octwin logs` always reported "No conversations"**, including immediately after an `octwin chat`
25
+ that had plainly worked. It read `conversations` off the response; the platform moved that endpoint
26
+ to the shared page envelope on 2026-08-09 and answers `rows`, which every other list command here
27
+ already reads. Both authors filed this as replica lag or a cache gap — nothing lagged, the payload
28
+ was simply never read. `octwin logs <conversationId>` was unaffected.
29
+
30
+ ## [0.6.0] - 2026-08-09
31
+
32
+ ### Changed
33
+ - **`octwin cases` is now `octwin work`, and it works again.** The platform's work-inbox
34
+ consolidation (2026-08-08) replaced the case-only surface with `/work` over every entity a pack
35
+ declares worked, and renamed the scopes to `work:read`/`work:write` — which left every `octwin
36
+ cases` call a silent 404 in a published CLI. The command family is renamed to match the platform:
37
+ `octwin work [recordId] [--queues]`, with writes `assign` / `note` / `decide` (the declared
38
+ operator actions, `--dry-run` previews) and `stage <id> --to <s>` riding the one platform-wide
39
+ stage verb (`POST …/xrm/records/:id/stage`, needs `records:write`). `transition` is gone with the
40
+ route it called.
41
+ - **`octwin orders transition` rides the same stage verb.** `POST …/orders/:ref/transition` was
42
+ retired server-side in the same consolidation; the CLI now resolves the order's record id from the
43
+ detail read and moves the stage through `…/xrm/records/:id/stage` (scope: `records:write`).
44
+
45
+ ### Added
46
+ - **A route guard so this cannot rot silently again**: `src/lib/cli-routes.test.ts` extracts every
47
+ `/api/self/**` URL the CLI builds and asserts it (method included) against the platform's dumped
48
+ route table — the gap that let both breakages above ship.
49
+
8
50
  ## [0.5.1] - 2026-08-01
9
51
 
10
52
  ### Fixed
@@ -237,7 +279,7 @@ repo root [`CHANGELOG.md`](../../CHANGELOG.md); this file is the CLI-only cut th
237
279
  **flags → env (`PACK_PLATFORM_URL`/`PACK_TENANT`/`PACK_PROJECT`/`PACK_TOKEN`) → saved login**.
238
280
  An existing credentials file simply has no `default_url` until the next `octwin login` — which is
239
281
  exactly what the "no platform url" error now tells you to run. CI is unaffected (it passes
240
- `PACK_PLATFORM_URL` + `PACK_TOKEN` as env and never had a `pack.json`).
282
+ `PACK_PLATFORM_URL` + `PACK_TOKEN` as env and never had a `pack.json` — that file is retired).
241
283
 
242
284
  ## [0.1.17] - 2026-07-27
243
285
 
package/README.md CHANGED
@@ -36,6 +36,9 @@ octwin <command>
36
36
 
37
37
  ```bash
38
38
  # 1. Scaffold a standalone pure-YAML pack (this is your repo)
39
+ # `--id` is a BARE name — the platform prefixes your workspace at deploy, so
40
+ # `my-pack` published by `acme` becomes `acme.my-pack` in the catalog. Take the
41
+ # obvious name; ids only collide within a workspace.
39
42
  octwin init ./my-pack --id my-pack --description "My business bot"
40
43
  cd ./my-pack
41
44
  git init && git add -A && git commit -m "init pack"
@@ -61,7 +64,7 @@ octwin status # "✓ live and current" once it's warm
61
64
  | Command | What it does |
62
65
  | --- | --- |
63
66
  | `octwin init <dir>` | Scaffold a new pure-YAML pack into `<dir>` (writes a starter `manifest.yaml`, flow, prompt, `.gitignore` and `README.md` — pack content only). Options: `--id`, `--description`, `--display-name`. |
64
- | `octwin validate` | Check the pack locally (structure + pure-YAML rules). `--remote` additionally runs the platform's **flow lint** — conventions the schema can't express, like an `assign:` whose value is a quoted literal, or a `$t()` key with no namespace. The lint needs a template-expanded `FlowDef`, which only the server builds, so it is a `--remote`-only check; a local does not cover it. |
67
+ | `octwin validate` | Check the pack locally (structure + pure-YAML rules). `--remote` runs **the same validation the platform runs to load your pack** — every declaration file (`xrm.yaml`, `scheduling.yaml`, `worklist.yaml`, `roles.yaml`, `automation.yaml`, `integrations.yaml`, `surveys.yaml`, `taps.yaml`, `commands.yaml`, `journeys/`, `messages.<lang>.yaml`), the cross-file checks between them, and the **flow lint** — conventions the schema can't express, like an `assign:` whose value is a quoted literal or a `$t()` key with no namespace. These need template expansion and the platform's own schemas, which only the server has, so a local does not cover them. A `--remote` and a successful deploy are now the same answer by construction, not by convention. |
65
68
  | `octwin login` | Save a deploy token for a platform URL **and make that URL the default target** (both stored in `~/.octwin/credentials.json`). `--url`, `--token`. |
66
69
  | `octwin whoami` | Verify the saved/passed token is valid for a tenant. `--url`, `--tenant`. |
67
70
  | `octwin deploy` | Upload + install the pack onto your tenant's project. `--seed` also runs the pack's demo seed. Reports the **marketplace-listing verdict** when the manifest carries `listing.public: true`. |
@@ -77,8 +80,8 @@ octwin status # "✓ live and current" once it's warm
77
80
  | `octwin analytics` | Stage-by-stage conversion for **any** entity declared with a `pipeline:` (`--overview` / `--milestones` / `--trends` / `--cost`; `--stage <id>` lists the records currently at a stage). Needs `records:read`. |
78
81
  | `octwin catalog` | Commerce products with price / availability / stock, plus the WhatsApp catalog binding. `--readiness` runs the Meta Graph checklist. Needs `catalog:read` + the `catalog` plan feature. |
79
82
  | `octwin scheduling` | The scheduling engine's state, or `--slots <resourceRecordId>` for the slots one bookable resource actually computes — how you verify the availability rules `deploy --seed` created. Needs `scheduling:read`. |
80
- | `octwin media generate "<prompt>"` | AI-generate an image, store it as a public asset, and print its `MEDIA-` handle + serve URL. `--out` downloads the bytes (WhatsApp renders only `.png`/`.jpg`); `--size`; `--json`. Pairs with `octwin chat --media` to drive media-collect flows. Needs `media:generate`. |
81
- | `octwin platform-kb pull` | Pull the platform's capability reference into `.octwin/platform-kb/` for the **`octwin-pack`** Claude Code authoring plugin: guides as markdown, plus **one JSON file per capability** (`primitives/record_list.json`, `render-intents/carousel.json`, `declarations/xrm.json`, …) and an **`INDEX.md`** mapping every entry to its file — so a lookup is a small targeted read, not a whole catalog. |
83
+ | `octwin media generate "<prompt>"` | AI-generate an image, store it as a public asset, and print its `MEDIA-` handle + serve URL. `--out` downloads the bytes (WhatsApp renders only `.png`/`.jpg`); `--json`. Pairs with `octwin chat --media` to drive media-collect flows. Needs `media:generate`. |
84
+ | `octwin platform-kb pull` | Pull the platform's capability reference into `.octwin/platform-kb/` for the **`octwin-pack`** Claude Code authoring plugin: guides as markdown, plus **one JSON file per capability** (`primitives/record_list.json`, `render-intents/carousel.json`, `declarations/xrm.json`, …) and **three maps** — `INDEX.md` (the corpus, by family and size), `SYMBOLS.md` (every name its exact file; grep this), `OUTLINE.md` (every heading with its line number). **No token needed** the reference is served anonymously. `--if-stale` skips the download when your copy is current (cheap enough for every session); `--check` writes nothing and exits 0 current / 2 stale / 1 could-not-tell. |
82
85
  | `octwin test` | Alias for `octwin validate --remote` — the platform's full manifest + flow-DSL check. |
83
86
  | `octwin feedback` | Submit this pack's `FEEDBACK.md` to the platform team, with the pack version, your CLI version and the `content_hash` of the capability reference you pulled — the two facts that separate a real platform gap from something already fixed or a stale KB. |
84
87
  | `octwin help` | Show usage. Every subcommand also answers `--help`. |