@awebai/oats 0.69.19 → 0.69.20

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 (38) hide show
  1. package/bin/oats.mjs +2 -2
  2. package/docs/capabilities.md +26 -13
  3. package/docs/container.md +218 -18
  4. package/docs/desktop-cli-api.md +25 -11
  5. package/docs/desktop.md +16 -0
  6. package/docs/implementation.md +2 -1
  7. package/docs/integrations.md +1 -1
  8. package/docs/knowledge.md +5 -5
  9. package/docs/official-catalog.md +4 -4
  10. package/docs/packages.md +11 -11
  11. package/docs/release-notes/v0.69.20.md +325 -0
  12. package/docs/servers.md +4 -2
  13. package/docs/souls-and-instances.md +4 -2
  14. package/docs/upgrading.md +11 -5
  15. package/docs/workspaces.md +13 -7
  16. package/lib/core.mjs +31 -195
  17. package/lib/hook-outcome.mjs +6 -0
  18. package/lib/instance-lifecycle.mjs +3 -1
  19. package/lib/instance-listing.mjs +3 -2
  20. package/lib/launch-prompt-fixtures/README.md +6 -0
  21. package/lib/retire-admission.mjs +215 -0
  22. package/lib/servers.mjs +3 -0
  23. package/package-catalog.json +2 -2
  24. package/package.json +1 -1
  25. package/packages/client/attributed-human.mjs +13 -0
  26. package/packages/client/deployment-data.mjs +4 -0
  27. package/packages/client/deployment-panel.mjs +2 -0
  28. package/packages/client/instance-lifecycle.mjs +6 -4
  29. package/packages/client/lifecycle-confirmation.mjs +4 -2
  30. package/packages/client/lifecycle-contract.mjs +11 -6
  31. package/packages/client/remote-roster.mjs +4 -0
  32. package/packages/record/README.md +15 -2
  33. package/packages/record/docs/capture-service.md +14 -0
  34. package/packages/record/lib/canonical.mjs +2 -70
  35. package/packages/record/lib/capture-aw-unit.mjs +14 -3
  36. package/packages/record/lib/capture-aw.mjs +11 -5
  37. package/packages/record/lib/capture-health.mjs +16 -5
  38. package/skills/oats-getting-started/SKILL.md +2 -2
@@ -29,6 +29,8 @@ import {
29
29
  import { loadIgnore } from "./ignore.mjs";
30
30
  import { bufferLines, fileChunks } from "./file-lines.mjs";
31
31
 
32
+ export const SEALED_AW_LOG_REASON = "sealed, not readable by this recorder";
33
+
32
34
  export function defaultCommLogDir(home = homedir()) {
33
35
  return join(home, ".config", "aw", "logs");
34
36
  }
@@ -52,7 +54,7 @@ export function listCommLogs(dir = defaultCommLogDir()) {
52
54
  // interior bad line is skipped and counted (`onSkipped`), never fatal.
53
55
  function* logEntries(fd, start, end, onSkipped, onConsumed) {
54
56
  for (const record of awLogLines(fileChunks(fd, { start, end, size: 65536 }), { start })) {
55
- if (!record.final) onConsumed(record.end);
57
+ if (!record.final && !record.sealed) onConsumed(record.end);
56
58
  if (record.skipped) onSkipped();
57
59
  if (record.parsed) yield record;
58
60
  }
@@ -74,7 +76,10 @@ export function* awLogLines(chunks, { start = 0, maxBytes = Infinity, frontier =
74
76
  const text = line.toString("utf8");
75
77
  if (text.trim() === "") { yield record; continue; }
76
78
  const entry = JSON.parse(text);
77
- yield { ...record, entry, parsed: true };
79
+ // Sealed aw client-log envelopes are ciphertext, not projection errors.
80
+ const sealed = entry !== null && typeof entry === "object" &&
81
+ ["v", "key_id", "enc", "ct"].every(key => Object.hasOwn(entry, key));
82
+ yield { ...record, entry, parsed: true, ...(sealed ? { sealed: true } : {}) };
78
83
  } catch {
79
84
  yield { ...record, skipped: !final };
80
85
  }
@@ -117,7 +122,7 @@ function captureLogFile(store, { streamId, path, project, knownIds, incremental
117
122
  if (old.dev === version.dev && old.ino === version.ino && (version.size > old.size || sameVersion(old, version)) &&
118
123
  previous.bytes <= end && boundaryWitness(fd, previous.bytes) === previous.witness) start = previous.bytes;
119
124
  }
120
- let entries = 0, skipped = 0, failed = 0, appended = 0, batch = [], batchBytes = 0, consumed = start, complete = false;
125
+ let entries = 0, skipped = 0, failed = 0, appended = 0, batch = [], batchBytes = 0, consumed = start, complete = false, sealed = 0;
121
126
  const checkpoint = () => {
122
127
  if (!incremental) return;
123
128
  const bytes = consumed;
@@ -141,6 +146,7 @@ function captureLogFile(store, { streamId, path, project, knownIds, incremental
141
146
  flush(); consumed = scanned;
142
147
  }
143
148
  entries++;
149
+ if (record.sealed) { consumed = record.start; sealed++; break; }
144
150
  let turn;
145
151
  // Projection refusal consumes this complete entry just like a skipped
146
152
  // malformed line. Resetting source cursors is the explicit retry path;
@@ -154,9 +160,9 @@ function captureLogFile(store, { streamId, path, project, knownIds, incremental
154
160
  }
155
161
  // Complete refused/malformed/blank lines are consumed; an unfinished final
156
162
  // fragment keeps its starting boundary so later growth can finish it.
157
- complete = true;
163
+ complete = sealed === 0;
158
164
  flush();
159
- return { entries, appended, skipped, failed };
165
+ return { entries, appended, skipped, failed, ...(sealed ? { sealed } : {}) };
160
166
  } finally { try { if (!captureContext(store)) state?.close(); } finally { closeSync(fd); } }
161
167
  }
162
168
 
@@ -1,5 +1,6 @@
1
1
  // Package-owned offline diagnosis. No writable DB/store, lock acquisition,
2
2
  // manager, repair or capture; warnings never publish new run evidence.
3
+ import { SEALED_AW_LOG_REASON } from "./capture-aw.mjs";
3
4
  import { homedir, hostname, platform as hostPlatform } from "node:os";
4
5
  import { join } from "node:path";
5
6
  import { readCaptureStatus } from "./capture-status.mjs";
@@ -14,6 +15,7 @@ export const SET_ASIDE_REMEDY = setAsideRemedy("turn-record", "<root>");
14
15
  // Retry re-reads an unchanged oversized record and sets it aside again: only an
15
16
  // edited source or an ignore of the whole input moves past it.
16
17
  const oversizedRemedy = (command, root) => `Edit the source so no record exceeds 8 MiB, leaving its captured prefix unchanged, then run ${command} capture --retry-set-aside; or add the whole input to ${root}/ignore, which discards the whole input, its records after the oversized one included, and later turns from that session.`;
18
+ const sealedRemedy = (command, root) => `supply a readable source and run ${command} capture --retry-set-aside, or add the source to ${join(root, "ignore")}; retry cannot decrypt ciphertext.`;
17
19
  // The one rule for remedy wording: the kernel's own entry points say `oats`,
18
20
  // the standalone package says `turn-record`. Each entry point states which it is.
19
21
  export const captureRemedyCommand = viaKernel => viaKernel ? "oats" : "turn-record";
@@ -77,11 +79,20 @@ function diagnose(root, { home = homedir(), platform = hostPlatform(), now = Dat
77
79
  // Remedies follow each listed entry's reason. Reasons beyond the bounded
78
80
  // sample are unknown here, so a truncated list says so rather than guess.
79
81
  const oversized = backlog.setAside.filter(entry => entry.reason === "record-too-large").length;
80
- const others = backlog.setAsideCount - oversized, general = setAsideRemedy(command, root);
81
- const message = !oversized ? general + (backlog.truncated ? ` Unlisted entries: see each entry's reason; record-too-large entries need: ${oversizedRemedy(command, root)}` : "") :
82
- `${oversized} listed as record-too-large: ${oversizedRemedy(command, root)}` + (!others ? "" : backlog.truncated ?
83
- ` The other ${others}, including unlisted entries: see each entry's reason; record-too-large entries need the edit-or-ignore remedy above. Otherwise: ${general}` :
84
- ` The other ${others}: ${general}`);
82
+ const sealed = backlog.setAside.filter(entry => entry.reason === SEALED_AW_LOG_REASON).length;
83
+ const others = backlog.setAsideCount - oversized - sealed;
84
+ const general = setAsideRemedy(command, root), parts = [];
85
+ if (oversized) parts.push(`${oversized} listed as record-too-large: ${oversizedRemedy(command, root)}`);
86
+ if (sealed) parts.push(`${sealed} listed as ${SEALED_AW_LOG_REASON}: ${sealedRemedy(command, root)}`);
87
+ if (!parts.length) parts.push(general);
88
+ else if (others) {
89
+ if (backlog.truncated) {
90
+ const oversizedNote = oversized ? "record-too-large entries need the edit-or-ignore remedy above. " : "";
91
+ parts.push(`The other ${others}, including unlisted entries: see each entry's reason; ${oversizedNote}Otherwise: ${general}`);
92
+ } else parts.push(`The other ${others}: ${general}`);
93
+ }
94
+ if (backlog.truncated) parts.push(`Unlisted entries: see each entry's reason; record-too-large entries need: ${oversizedRemedy(command, root)} Sealed entries (${SEALED_AW_LOG_REASON}) need: ${sealedRemedy(command, root)}`);
95
+ const message = parts.join(" ");
85
96
  rows.push({ code: "capture-input-set-aside", message: `${backlog.setAsideCount} capture inputs set aside. ${message}` });
86
97
  }
87
98
 
@@ -533,7 +533,7 @@ installed CLI's catalog:
533
533
  node -e 'const c=require(process.argv[1]);console.log(c.packages["oats.framework"].ref,c.packages["oats.aweb"].ref)' "$(oats root)/package-catalog.json"
534
534
  ```
535
535
 
536
- It prints the two refs, for example `oats-framework/v1.25.2 v1.42.1`. If the
536
+ It prints the two refs, for example `oats-framework/v1.26.0 v1.42.1`. If the
537
537
  framework's version (after the `/`) is below `1.19.0`, or with aweb
538
538
  `oats.aweb`'s is below `v1.33.1`, this OATS release is older than this
539
539
  skill: stop, and tell the person to wait for the next OATS
@@ -770,7 +770,7 @@ name: acme
770
770
  members:
771
771
  - git:github.com/acme/acme-oats # the host; the setup expert adds the others
772
772
  packages:
773
- oats.framework: v1.25.2 # the installed CLI's catalog versions (below)
773
+ oats.framework: v1.26.0 # the installed CLI's catalog versions (below)
774
774
  oats.aweb: v1.42.1 # messaging: agent identities, mail and chat
775
775
  oats.machine: v0.1.1 # on a machine found-list only: the machine's steward
776
776
  defaults: