octwin-cli 0.8.14 → 0.8.16

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/dist/cli.js CHANGED
@@ -2529,8 +2529,13 @@ async function cmdRecords(flags) {
2529
2529
  if (status !== 200)
2530
2530
  die(`could not read entities (HTTP ${status})`);
2531
2531
  out.result(json, () => {
2532
+ if (json?.has_data === false) {
2533
+ out.print('No AI Agent is loaded in this project.');
2534
+ return;
2535
+ }
2532
2536
  if (json?.has_xrm === false) {
2533
- out.print('This pack declares no XRM entities.');
2537
+ // No record TYPES of its own — but the platform's own records (an order, a case) still read by name.
2538
+ out.print('This pack declares no record types of its own. Platform records still read by name: octwin records order | product | case | …');
2534
2539
  return;
2535
2540
  }
2536
2541
  const ents = (json?.entities ?? []);
@@ -2614,8 +2619,8 @@ async function cmdRecordsWrite(flags) {
2614
2619
  const { status, json } = await apiSend('POST', `${base}/xrm/records`, body, t);
2615
2620
  if (status !== 200 && status !== 201)
2616
2621
  writeFail(`create the ${entity} record`, status, json, url, true);
2617
- if (json?.has_xrm === false)
2618
- die('this pack declares no XRM entities');
2622
+ if (json?.has_data === false)
2623
+ die('no AI Agent is loaded in this project');
2619
2624
  const rec = json?.record ?? {};
2620
2625
  out.result(json, () => {
2621
2626
  // 200 = the entity's identity matched an existing row; 201 = genuinely new.
@@ -2701,8 +2706,8 @@ async function cmdRecordsWrite(flags) {
2701
2706
  if (status !== 200)
2702
2707
  writeFail('read tasks', status, json, url);
2703
2708
  out.result(json, () => {
2704
- if (json?.has_xrm === false) {
2705
- out.print('This pack declares no XRM entities.');
2709
+ if (json?.has_data === false) {
2710
+ out.print('No AI Agent is loaded in this project.');
2706
2711
  return;
2707
2712
  }
2708
2713
  const page = readPage(json);
@@ -5368,14 +5373,24 @@ async function cmdPerformance(flags) {
5368
5373
  out.print(' (none)');
5369
5374
  for (const i of inds) {
5370
5375
  const unit = i.unit === 'pct' ? '%' : '';
5371
- // `delta_pct` is signed and against the PREVIOUS window — sign it explicitly so
5372
- // a fall is never read as a rise.
5373
- const delta = i.delta_pct == null ? '' : ` ${i.delta_pct >= 0 ? '+' : ''}${i.delta_pct}% vs prev`;
5376
+ // `change` is the band's ONE change rule, already derived by the platform: a relative % for
5377
+ // a count, money or duration, POINTS for a rate, score or NPS (a % of a % misleads), and
5378
+ // signed the way the number moved — sign it explicitly so a fall is never read as a rise.
5379
+ const c = i.change ?? { kind: 'none' };
5380
+ const sign = (n) => `${n > 0 ? '+' : ''}${n}`;
5381
+ const delta = c.kind === 'relative' ? ` ${sign(c.pct)}% vs prev`
5382
+ : c.kind === 'points' ? ` ${sign(c.delta)}${i.unit === 'pct' ? ' pts' : ''} vs prev`
5383
+ : c.kind === 'from_zero' ? ' new vs prev'
5384
+ : c.kind === 'flat' ? ' no change vs prev'
5385
+ : '';
5374
5386
  const frac = i.numerator != null && i.denominator != null
5375
5387
  ? ` (${i.numerator}/${i.denominator}${i.denominator_of ? ` ${i.denominator_of}` : ''})`
5376
5388
  : '';
5389
+ // A band narrowed to one channel says so per figure: one that cannot be narrowed (capacity) is
5390
+ // the all-channel figure, and the line says it rather than letting it pass as the channel's.
5391
+ const scope = i.channel?.kind === 'not_narrowable' ? ' (all channels)' : '';
5377
5392
  out.print(` ${String(pickLabel(i.heading) ?? i.kind).padEnd(16)} ${String(pickLabel(i.label) ?? '').padEnd(20)}`
5378
- + ` ${String(i.value ?? '—').padStart(9)}${unit}${delta}${frac}`);
5393
+ + ` ${String(i.value ?? '—').padStart(9)}${unit}${delta}${frac}${scope}`);
5379
5394
  if (i.why)
5380
5395
  out.print(` why: ${i.why}`);
5381
5396
  if (i.biggest_dropoff)
package/dist/lib/page.js CHANGED
@@ -29,7 +29,7 @@
29
29
  * Read a `Page` envelope defensively.
30
30
  *
31
31
  * Returns an empty view for a non-object or a body with no `rows` ARRAY, so a
32
- * degraded read (`{ has_xrm: false, ...emptyPage() }`) and an error body both
32
+ * degraded read (`{ ...emptyPage(), has_data: false }`) and an error body both
33
33
  * land on "no rows" without throwing. `total` stays **null** when absent rather
34
34
  * than defaulting to 0 — a caller that prints "0 of 0" when the server said
35
35
  * nothing is inventing a fact.
package/package.json CHANGED
@@ -1,46 +1,46 @@
1
- {
2
- "name": "octwin-cli",
3
- "version": "0.8.14",
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://octwin.ai",
45
- "license": "MIT"
46
- }
1
+ {
2
+ "name": "octwin-cli",
3
+ "version": "0.8.16",
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://octwin.ai",
45
+ "license": "MIT"
46
+ }