octwin-cli 0.7.0 → 0.7.2

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 (3) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/index.js +38 -5
  3. package/package.json +46 -37
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.7.2] - 2026-08-20
9
+
10
+ ### Fixed
11
+ - **`octwin feedback` now tells you what is already waiting, on stdout.** It discarded the submit
12
+ response entirely — destructuring `{ status, json }`, checking the status and never reading the
13
+ body — then printed *"a reply arrives as a memo, this CLI will tell you when one is waiting"*. The
14
+ platform started returning the unread counts on that response (2026-08-20), so the answer was
15
+ there to print and was being thrown away.
16
+ **Why it matters more than it sounds:** `notifyIfMemosWaiting` already covers this command and was
17
+ firing correctly — but it writes to **stderr**, and the authors driving this CLI are agents reading
18
+ stdout. The one signal that mattered was addressed to a channel nobody was listening on. On
19
+ 2026-08-19 an author submitted two reports two hours after three replies were published and
20
+ re-reported five findings those replies had already closed. Now the count prints in the same block
21
+ as the acknowledgement, naming the command, and says outright when a reply may already answer what
22
+ you just sent. Against an older platform the field is absent and the previous line stands.
23
+
24
+ ## [0.7.1] - 2026-08-19
25
+
26
+ ### Fixed
27
+ - **`work decide` now says when an action moves nothing.** `to_stage` is optional — an action may
28
+ record a decision without a transition — but both outputs communicated that by omission: `--dry-run`
29
+ left `to_stage: null` sitting among twenty other keys, and a real apply printed a bare
30
+ `✓ Applied '<action>'`. An author read both, shipped `request_more_info` with no `to_stage`, and
31
+ lost the `awaiting_customer` their whole customer-reply capture branched on — their words: *"Nothing
32
+ about this failed loudly; it just quietly never did the one thing the whole feature depends on."*
33
+ The preview now states `→ does NOT change the status (this action only records a decision)` and the
34
+ apply says `status unchanged (the action declares no to_stage)`. The console's decision panel got the
35
+ same sentence in the same change.
36
+
8
37
  ## [0.7.0] - 2026-08-18
9
38
 
10
39
  ### Added
package/dist/index.js CHANGED
@@ -1959,11 +1959,11 @@ async function cmdRecordsWrite(flags) {
1959
1959
  if (json?.has_xrm === false)
1960
1960
  die('this pack declares no XRM entities');
1961
1961
  const rec = json?.record ?? {};
1962
- // 200 = the dedupe key matched an existing row; 201 = genuinely new. Saying
1963
- // "created" for a match would misreport what the pack's `dedupe_by` did.
1962
+ // 200 = the entity's identity matched an existing row; 201 = genuinely new.
1963
+ // Saying "created" for a match would misreport what the save actually did.
1964
1964
  console.log(status === 201
1965
1965
  ? `✓ Created #${rec.record_number ?? '?'} ${rec.id ?? ''}`
1966
- : `✓ Matched an EXISTING record (the entity's dedupe key hit) — #${rec.record_number ?? '?'} ${rec.id ?? ''}`);
1966
+ : `✓ Matched an EXISTING record (its unique constraint identified it) — #${rec.record_number ?? '?'} ${rec.id ?? ''}`);
1967
1967
  if (rec.id)
1968
1968
  readBack(rec.id);
1969
1969
  return;
@@ -2109,7 +2109,33 @@ async function cmdFeedback(flags) {
2109
2109
  console.log(' ⓘ no local capability reference found, so the report carries no KB version.');
2110
2110
  console.log(' Pull it before your next session: octwin platform-kb');
2111
2111
  }
2112
- console.log(' A reply arrives as a memo this CLI will tell you when one is waiting.');
2112
+ // WHAT IS ALREADY WAITING, said here rather than promised for later.
2113
+ //
2114
+ // The submit response carries the same counts `notifyIfMemosWaiting` polls. That nudge
2115
+ // fires on this command too — but it writes to STDERR, and the authors driving this CLI
2116
+ // are agents reading stdout, so the one signal that mattered was addressed to a channel
2117
+ // nobody was listening on. On 2026-08-19 an author sent two reports two hours after
2118
+ // three replies were published and re-reported five already-fixed findings; the nudge
2119
+ // had run correctly both times.
2120
+ //
2121
+ // So it goes on STDOUT, at the moment they are certainly reading, in the same block as
2122
+ // the acknowledgement. `memos` is absent against an older platform — then the old line
2123
+ // stands, which is the honest thing to say when we cannot know.
2124
+ const memos = json?.memos;
2125
+ const unread = Number(memos?.unread ?? 0);
2126
+ const actionable = Number(memos?.unread_actionable ?? 0);
2127
+ if (Number.isFinite(unread) && unread > 0) {
2128
+ const what = unread === 1 ? '1 reply is' : `${unread} replies are`;
2129
+ const tail = Number.isFinite(actionable) && actionable > 0 ? ` (${actionable} needing action)` : '';
2130
+ console.log(` ✉ ${what} already waiting for you${tail} — read them BEFORE your next change: octwin memos`);
2131
+ if (actionable > 0) {
2132
+ // The severity axis exists so an agent mid-build stops instead of finishing first.
2133
+ console.log(' One or more may already answer what you just reported.');
2134
+ }
2135
+ }
2136
+ else {
2137
+ console.log(' A reply arrives as a memo — this CLI will tell you when one is waiting.');
2138
+ }
2113
2139
  }
2114
2140
  /**
2115
2141
  * `octwin memos [--json] [--all]` — read what the platform has told you.
@@ -2747,10 +2773,17 @@ async function cmdWorkWrite(flags) {
2747
2773
  }
2748
2774
  if (dryRun) {
2749
2775
  console.log('Preview (nothing was committed):');
2776
+ // Stated in words BEFORE the dump. `to_stage: null` is already in the JSON below, but a null
2777
+ // among twenty keys is not an answer anyone reads — a pack author previewed exactly this,
2778
+ // shipped an action with no `to_stage`, and lost the `awaiting_customer` their whole
2779
+ // reply-capture branched on. Same reason the console preview now says it too.
2780
+ console.log(json?.to_stage
2781
+ ? ` → moves the record to '${json.to_stage}'.`
2782
+ : ' → does NOT change the status (this action only records a decision).');
2750
2783
  console.log(JSON.stringify(json, null, 2));
2751
2784
  return;
2752
2785
  }
2753
- console.log(`✓ Applied '${action}'${json?.to_stage ? ` — record is now '${json.to_stage}'` : ''}.`);
2786
+ console.log(`✓ Applied '${action}'${json?.to_stage ? ` — record is now '${json.to_stage}'` : ' — status unchanged (the action declares no to_stage)'}.`);
2754
2787
  // `relayed`/`notified` are the customer-facing half; silence here usually means
2755
2788
  // the action had no message template, which is easy to mistake for a failure.
2756
2789
  const reached = json?.relayed || json?.notified;
package/package.json CHANGED
@@ -1,37 +1,46 @@
1
- {
2
- "name": "octwin-cli",
3
- "version": "0.7.0",
4
- "description": "Octwin external-pack developer CLI (by CEQUENS) — scaffold, validate, deploy, and check pure-YAML packs on your tenant.",
5
- "type": "module",
6
- "bin": {
7
- "octwin": "dist/index.js"
8
- },
9
- "files": [
10
- "dist",
11
- "templates",
12
- "README.md",
13
- "CHANGELOG.md",
14
- "LICENSE"
15
- ],
16
- "engines": {
17
- "node": ">=22"
18
- },
19
- "scripts": {
20
- "build": "tsc -p tsconfig.json",
21
- "prepublishOnly": "npm run build"
22
- },
23
- "dependencies": {
24
- "yaml": "^2.6.0"
25
- },
26
- "devDependencies": {
27
- "@types/node": "^22.0.0",
28
- "typescript": "^5.7.0"
29
- },
30
- "publishConfig": {
31
- "access": "public"
32
- },
33
- "keywords": ["octwin", "cequens", "cli", "whatsapp", "chatbot", "pack", "conversational-ai", "yaml"],
34
- "author": "CEQUENS",
35
- "homepage": "https://www.npmjs.com/package/octwin-cli",
36
- "license": "MIT"
37
- }
1
+ {
2
+ "name": "octwin-cli",
3
+ "version": "0.7.2",
4
+ "description": "Octwin external-pack developer CLI (by CEQUENS) — scaffold, validate, deploy, and check pure-YAML packs on your tenant.",
5
+ "type": "module",
6
+ "bin": {
7
+ "octwin": "dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "templates",
12
+ "README.md",
13
+ "CHANGELOG.md",
14
+ "LICENSE"
15
+ ],
16
+ "engines": {
17
+ "node": ">=22"
18
+ },
19
+ "scripts": {
20
+ "build": "tsc -p tsconfig.json",
21
+ "prepublishOnly": "npm run build"
22
+ },
23
+ "dependencies": {
24
+ "yaml": "^2.6.0"
25
+ },
26
+ "devDependencies": {
27
+ "@types/node": "^22.0.0",
28
+ "typescript": "^5.7.0"
29
+ },
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "keywords": [
34
+ "octwin",
35
+ "cequens",
36
+ "cli",
37
+ "whatsapp",
38
+ "chatbot",
39
+ "pack",
40
+ "conversational-ai",
41
+ "yaml"
42
+ ],
43
+ "author": "CEQUENS",
44
+ "homepage": "https://www.npmjs.com/package/octwin-cli",
45
+ "license": "MIT"
46
+ }