octwin-cli 0.1.11 → 0.1.12

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,22 @@ 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.1.12] - 2026-07-22
9
+
10
+ ### Fixed
11
+ - **The KB-drift nudge now fires after `chat` too.** `chat` — the command a debugging session runs most —
12
+ was missing from the networked-command list, so a chat-heavy session never noticed the platform's
13
+ capability reference had moved. The nudge also now shows the concrete drift
14
+ (`old-hash → new-hash`) so you can see it's real, not a heuristic.
15
+
16
+ ### Changed
17
+ - **Every networked command announces what it's doing before it does it.** `chat` prints
18
+ `→ Connecting to <tenant>/<project> as '<handle>' …` before opening the stream and
19
+ `… delivered — waiting for the reply (up to Ns)` after the send; `status` / `whoami` /
20
+ `platform-kb` / `records` / `logs` / `cases` each print a one-line `→ …` header naming the
21
+ action and target before the first network call — no more silent seconds followed by a result
22
+ (or a hang with no clue what was being attempted). JSON modes (`--json`) stay clean for piping.
23
+
8
24
  ## [0.1.11] - 2026-07-21
9
25
 
10
26
  ### Fixed
package/dist/index.js CHANGED
@@ -282,20 +282,22 @@ async function notifyIfKbStale(flags) {
282
282
  return;
283
283
  const meta = await res.json();
284
284
  if (meta.content_hash && meta.content_hash !== localHash) {
285
- console.error('\n⬆ the platform capability reference changed since you last pulled it.');
286
- console.error(' Refresh it: octwin platform-kb pull');
285
+ console.error(`\n⬆ the platform capability reference changed since you last pulled it (${localHash} → ${meta.content_hash}).`);
286
+ console.error(' Refresh it: octwin platform-kb');
287
287
  }
288
288
  }
289
289
  catch { /* a KB check must never break the CLI */ }
290
290
  }
291
- /** Which commands already made an authed platform call, so the trailing KB-drift
292
- * poll rides on existing network work (never on offline `validate` / `init`). */
291
+ /** Which commands already made a platform call, so the trailing KB-drift poll
292
+ * rides on existing network work (never on offline `validate` / `init`;
293
+ * `platform-kb` refreshes the reference itself, so it needs no nudge). */
293
294
  function commandTouchesPlatform(command, flags) {
294
295
  switch (command) {
295
296
  case 'validate': return flags.remote === true; // offline validate stays offline
296
297
  case 'deploy':
297
298
  case 'status':
298
299
  case 'test':
300
+ case 'chat':
299
301
  case 'records':
300
302
  case 'cases':
301
303
  case 'logs':
@@ -448,6 +450,7 @@ function resolveTargetOrNull(flags, packDir) {
448
450
  async function cmdWhoami(flags) {
449
451
  const packDir = resolve(flags.dir ?? '.');
450
452
  const { url, tenant, token } = resolveTarget(flags, packDir);
453
+ console.log(`→ Checking the saved token against '${tenant}' @ ${url} …`);
451
454
  const res = await fetchOrDie(`${url}/api/admin/tenants/${tenant}/packs`, { headers: { authorization: `Bearer ${token}` } }, 'token check');
452
455
  if (res.ok) {
453
456
  console.log(`✓ Token valid for tenant '${tenant}' at ${url} (${token.startsWith('oct_') ? 'deploy token' : 'session token'})`);
@@ -570,6 +573,7 @@ async function cmdStatus(flags) {
570
573
  die('manifest.yaml must declare a string `id`');
571
574
  const id = doc.id;
572
575
  const localVersion = typeof doc?.version === 'string' ? doc.version : '?';
576
+ console.log(`→ Checking ${id}@${localVersion} on ${tenant}/${project} @ ${url} …`);
573
577
  const res = await fetchOrDie(`${url}/api/admin/tenants/${tenant}/projects/${project}/packs/${id}/runtime`, {
574
578
  headers: { authorization: `Bearer ${token}` },
575
579
  }, 'status check');
@@ -609,6 +613,7 @@ async function cmdStatus(flags) {
609
613
  async function cmdPlatformKb(flags) {
610
614
  const packDir = resolve(flags.dir ?? '.');
611
615
  const { url, tenant, token } = resolveTarget(flags, packDir);
616
+ console.log(`→ Pulling the platform capability reference from '${tenant}' @ ${url} …`);
612
617
  const res = await fetchOrDie(`${url}/api/admin/tenants/${tenant}/octwin-platform-kb`, {
613
618
  headers: { authorization: `Bearer ${token}` },
614
619
  }, 'platform-kb pull');
@@ -674,6 +679,7 @@ async function cmdRecords(flags) {
674
679
  const base = `${url}/api/admin/tenants/${tenant}/projects/${project}`;
675
680
  const entity = flags._[0];
676
681
  const recordId = flags._[1];
682
+ console.log(`→ Reading ${recordId ? `${entity} record ${recordId}` : entity ? `${entity} records` : 'the entity catalog'} from ${tenant}/${project} …`);
677
683
  if (!entity) {
678
684
  const { status, json } = await apiGet(`${base}/xrm/entities`, token);
679
685
  if (status !== 200)
@@ -734,6 +740,8 @@ async function cmdLogs(flags) {
734
740
  const convId = flags._[0];
735
741
  const asJson = flags.json === true;
736
742
  const asHandle = typeof flags.as === 'string' ? flags.as : undefined;
743
+ if (!asJson)
744
+ console.log(`→ Reading ${convId ? `conversation ${convId}` : 'recent conversations'} from ${tenant}/${project} …`);
737
745
  if (!convId) {
738
746
  const { status, json } = await apiGet(`${base}/conversations?limit=50`, token);
739
747
  if (status !== 200)
@@ -928,6 +936,8 @@ async function cmdChat(flags) {
928
936
  die('usage: octwin chat "your message" [--as <handle>] [--tap <tap-id>] [--json]');
929
937
  // Fresh idempotency key per call (see the command doc above).
930
938
  const localId = `cli-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
939
+ if (!asJson)
940
+ console.log(`→ Connecting to ${tenant}/${project} as '${from}' …`);
931
941
  const evRes = await fetchOrDie(`${url}/api/web/events/${tenant}/${project}/${encodeURIComponent(from)}`, { headers: { accept: 'text/event-stream' } }, 'open chat stream');
932
942
  if (!evRes.ok || !evRes.body)
933
943
  die(`could not open chat stream (HTTP ${evRes.status})`);
@@ -961,6 +971,8 @@ async function cmdChat(flags) {
961
971
  await cancel();
962
972
  die(`send rejected (HTTP ${postRes.status}): ${await postRes.text()}`);
963
973
  }
974
+ if (!asJson)
975
+ console.log(` … delivered — waiting for the reply (up to ${Math.round(REPLY_TIMEOUT_MS / 1000)}s)`);
964
976
  // Phase 3 — collect THIS turn's renders (id > boundary). A turn can send
965
977
  // several messages, so keep reading until a quiet gap after the last render.
966
978
  const deadline = Date.now() + REPLY_TIMEOUT_MS;
@@ -1007,6 +1019,8 @@ async function cmdCases(flags) {
1007
1019
  const base = `${url}/api/admin/tenants/${tenant}/projects/${project}`;
1008
1020
  const caseId = flags._[0];
1009
1021
  const asJson = flags.json === true;
1022
+ if (!asJson)
1023
+ console.log(`→ Reading ${flags.queues === true ? 'case queues' : caseId ? `case ${caseId}` : 'the case inbox'} from ${tenant}/${project} …`);
1010
1024
  const caseFail = (what, status, json) => {
1011
1025
  if (status === 403)
1012
1026
  die(`forbidden — casework needs the 'cases' plan feature on this tenant, and a role whose grants reach the queue`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "octwin-cli",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
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": {