octwin-cli 0.8.9 → 0.8.11

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,35 @@ 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.8.11] - 2026-09-07
9
+
10
+ ### Fixed
11
+ - **`octwin login` erased your own tooling report — the CLI was blanking what it had just
12
+ told the platform.** Two calls built their `authorization` header by hand instead of going
13
+ through `authHeaders`: `login`'s post-save "here's what your token reaches" echo, and
14
+ `chat`'s tenant/project derivation. Both authenticate, so both stamp the token's client
15
+ report (added in 0.8.9) — and a hand-built header stamps **NULL**, wiping the CLI version
16
+ and reference hash the platform had recorded.
17
+
18
+ Caught within an hour of 0.8.9 reaching staging: a workspace reported `0.8.9 · reference
19
+ current` at 12:16 and read `not reported` at 12:34. That looked exactly like the documented
20
+ "the column holds what ran LAST" behaviour and was really the CLI erasing its own row.
21
+ `cli-routes.test.ts` now fails on any hand-built bearer header, with a non-vacuity floor —
22
+ this package sits outside the repo's eslint scope, so a text guard is the only rung available.
23
+
24
+ ## [0.8.10] - 2026-09-07
25
+
26
+ ### Fixed
27
+ - **`octwin memos` failed with `400 project required` for a tenant-wide token — the exact
28
+ command the nudge tells you to run.** Every networked command can end with
29
+ *"✉ N memos from the platform — read them: `octwin memos`"*, and running precisely that with
30
+ an unpinned token answered a 400. Measured on staging: the nudge fired during a
31
+ `deploy --project …` (which supplied a project) and then named a command that could not run.
32
+
33
+ A memo has no project dimension to scope by — neither `pack_memos` nor `pack_memo_reads`
34
+ carries a `project_id`, and the read ledger is keyed by tenant — so the three call sites now
35
+ use `/api/self/t/memos`. Passing `--project` still works and is no longer needed.
36
+
8
37
  ## [0.8.9] - 2026-09-07
9
38
 
10
39
  ### Added
package/dist/index.js CHANGED
@@ -776,7 +776,7 @@ async function memosWaitingNotice(flags) {
776
776
  // on a network failure. An observer that can terminate the CLI is not an observer: with an
777
777
  // unreachable platform this nudge would have failed the command it was only meant to annotate,
778
778
  // and now that the polls run BEFORE the command it would have failed it before it even ran.
779
- const res = await fetch(`${t.url}/api/self/p/memos?meta=1`, {
779
+ const res = await fetch(`${t.url}/api/self/t/memos?meta=1`, {
780
780
  headers: authHeaders(t), signal: AbortSignal.timeout(2_000),
781
781
  });
782
782
  const status = res.status;
@@ -1297,7 +1297,11 @@ async function saveLogin(url, token) {
1297
1297
  // so a fresh token self-identifies without a second `octwin whoami`. A network
1298
1298
  // failure never fails the save — the token is stored regardless.
1299
1299
  try {
1300
- const res = await fetch(`${url}/api/self/t/whoami`, { headers: { authorization: `Bearer ${token}` } });
1300
+ // `authHeaders`, not a hand-built `authorization` this call authenticates, so it
1301
+ // STAMPS the token's client report (migration 055), and a hand-built header stamps
1302
+ // NULL. Measured 2026-09-07: that blanked a caller who was on a reporting CLI, so
1303
+ // `octwin login` erased the author's own tooling row. Guarded in `cli-routes.test.ts`.
1304
+ const res = await fetch(`${url}/api/self/t/whoami`, { headers: authHeaders({ url, token }) });
1301
1305
  if (res.ok) {
1302
1306
  const j = await res.json();
1303
1307
  const scopes = Array.isArray(j.scopes) && j.scopes.length ? ` · scopes: ${j.scopes.join(', ')}` : '';
@@ -2681,7 +2685,7 @@ async function cmdFeedback(flags) {
2681
2685
  async function cmdMemos(flags) {
2682
2686
  const t = resolveTarget(flags);
2683
2687
  const all = flags.all === true;
2684
- const { status, json } = await apiGet(`${t.url}/api/self/p/memos${all ? '?all=1' : ''}`, t);
2688
+ const { status, json } = await apiGet(`${t.url}/api/self/t/memos${all ? '?all=1' : ''}`, t);
2685
2689
  if (status !== 200) {
2686
2690
  die(`could not read memos (HTTP ${status})${errDetail(json)}${authFailureDetail(status, t.url)}`);
2687
2691
  }
@@ -2711,7 +2715,7 @@ async function cmdMemos(flags) {
2711
2715
  if (!all) {
2712
2716
  const ids = rows.filter(m => !m.read_at).map(m => m.id);
2713
2717
  if (ids.length > 0) {
2714
- const res = await apiSend('POST', `${t.url}/api/self/p/memos/read`, { ids }, t);
2718
+ const res = await apiSend('POST', `${t.url}/api/self/t/memos/read`, { ids }, t);
2715
2719
  // A failed ack is not a failed command — the author HAS read them. Say so rather
2716
2720
  // than dying after printing everything, and the nudge simply fires again.
2717
2721
  if (res.status !== 200)
@@ -3053,8 +3057,11 @@ async function cmdChat(flags) {
3053
3057
  const token = raw.token;
3054
3058
  if (token) {
3055
3059
  try {
3060
+ // `authHeaders` carries the tenant override itself, and — the reason this is not
3061
+ // hand-built — it carries the client report. An authenticating call that skips it
3062
+ // stamps NULL over the token's reported CLI + reference. See `cli-routes.test.ts`.
3056
3063
  const who = await fetch(`${url}/api/self/t/whoami`, {
3057
- headers: { authorization: `Bearer ${token}`, ...(tenant ? { 'x-octwin-tenant': tenant } : {}) },
3064
+ headers: authHeaders({ url, token, ...(tenant ? { tenant } : {}) }),
3058
3065
  });
3059
3066
  if (who.ok) {
3060
3067
  const j = await who.json();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "octwin-cli",
3
- "version": "0.8.9",
3
+ "version": "0.8.11",
4
4
  "description": "Octwin external-pack developer CLI (by CEQUENS) — scaffold, validate, deploy, and check pure-YAML packs on your tenant.",
5
5
  "type": "module",
6
6
  "bin": {