@north-light/api 0.3.447 → 0.3.449

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 (35) hide show
  1. package/dist/api/contract.d.ts +1 -1
  2. package/dist/api/contract.js +1 -1
  3. package/dist/api/dto/nodes.d.ts +5 -0
  4. package/dist/api/dto/objects.d.ts +33 -2
  5. package/dist/api/error-codes.d.ts +15 -0
  6. package/dist/api/error-codes.js +6 -0
  7. package/dist/core/scoped-state/settings.js +26 -8
  8. package/dist/shared/generated-context.d.ts +8 -0
  9. package/dist/shared/generated-context.js +6 -1
  10. package/dist/shared/inbox-entry-body.js +1 -1
  11. package/package.json +1 -1
  12. package/dist/api/__tests__/serial/client.test.d.ts +0 -1
  13. package/dist/api/__tests__/serial/client.test.js +0 -141
  14. package/dist/api/dto/memory.d.ts +0 -171
  15. package/dist/api/dto/memory.js +0 -7
  16. package/dist/core/canvas/types.d.ts +0 -446
  17. package/dist/core/canvas/types.js +0 -6
  18. package/dist/core/fault-classifier.d.ts +0 -34
  19. package/dist/core/fault-classifier.js +0 -96
  20. package/dist/core/provider-error-recognition.d.ts +0 -27
  21. package/dist/core/provider-error-recognition.js +0 -74
  22. package/dist/core/provider-failure.d.ts +0 -27
  23. package/dist/core/provider-failure.js +0 -109
  24. package/dist/core/runtime/broker-protocol.d.ts +0 -721
  25. package/dist/core/runtime/broker-protocol.js +0 -152
  26. package/dist/core/runtime/managed-provider-cooling.d.ts +0 -24
  27. package/dist/core/runtime/managed-provider-cooling.js +0 -62
  28. package/dist/core/runtime/stamp/protocol.d.ts +0 -90
  29. package/dist/core/runtime/stamp/protocol.js +0 -113
  30. package/dist/core/scopes.d.ts +0 -17
  31. package/dist/core/scopes.js +0 -42
  32. package/dist/core/substrate/subject-fields.d.ts +0 -48
  33. package/dist/core/substrate/subject-fields.js +0 -39
  34. package/dist/shared/tool-groups.d.ts +0 -26
  35. package/dist/shared/tool-groups.js +0 -64
@@ -1,64 +0,0 @@
1
- // Shared transcript-boundary rules for broker-owned tool-group summaries.
2
- // Keep this independent of renderer state: both live event tracking and snapshot
3
- // reconstruction must agree on which prose closes a run of tools.
4
- import { generatedContextText, parseCard } from './generated-context.js';
5
- /** Card kinds that close a run of tools instead of joining one. The broker
6
- * segments and the viewer folds on the same seams, so this one answer is shared;
7
- * everything else about a card is the display's own business. */
8
- const GROUP_BOUNDARY_KINDS = new Set(['restart-continuation', 'review-boundary']);
9
- export function isGroupBoundaryKind(kind) {
10
- return GROUP_BOUNDARY_KINDS.has(kind);
11
- }
12
- const TOOL_GROUP_SUMMARY_KEYS = new Set(['bullets', 'filesDeleted']);
13
- const MAX_TOOL_GROUP_BULLETS = 5;
14
- const MAX_TOOL_GROUP_BULLET_LENGTH = 1_000;
15
- /** Validate the one durable summary shape and cap its display-sized fields.
16
- * Invalid entries are absent rather than adapted, so their calls stay visible. */
17
- export function normalizeToolGroupSummary(value) {
18
- if (typeof value !== 'object' || value === null || Array.isArray(value))
19
- return null;
20
- const record = value;
21
- const keys = Object.keys(record);
22
- if (keys.length !== TOOL_GROUP_SUMMARY_KEYS.size || !keys.every((key) => TOOL_GROUP_SUMMARY_KEYS.has(key))) {
23
- return null;
24
- }
25
- if (!Array.isArray(record.bullets) || record.bullets.length === 0)
26
- return null;
27
- if (!record.bullets.every((bullet) => typeof bullet === 'string' && bullet.trim() !== ''))
28
- return null;
29
- if (typeof record.filesDeleted !== 'number' || !Number.isSafeInteger(record.filesDeleted) || record.filesDeleted < 0)
30
- return null;
31
- return {
32
- bullets: record.bullets
33
- .slice(0, MAX_TOOL_GROUP_BULLETS)
34
- .map((bullet) => bullet.trim().slice(0, MAX_TOOL_GROUP_BULLET_LENGTH).trimEnd()),
35
- filesDeleted: record.filesDeleted,
36
- };
37
- }
38
- /** Validate sidecar/snapshot entries independently so one malformed or legacy
39
- * value never collapses any otherwise valid group. */
40
- export function normalizeToolGroupSummaryRecord(value) {
41
- if (typeof value !== 'object' || value === null || Array.isArray(value))
42
- return {};
43
- const summaries = {};
44
- for (const [key, candidate] of Object.entries(value)) {
45
- if (key.trim() === '')
46
- continue;
47
- const summary = normalizeToolGroupSummary(candidate);
48
- if (summary !== null)
49
- summaries[key] = summary;
50
- }
51
- return summaries;
52
- }
53
- /** Text a renderer presents as an assistant bubble. Thinking and tool-call
54
- * blocks deliberately do not count: only visible prose establishes a boundary. */
55
- export function assistantVisibleText(message) {
56
- if (message.role !== 'assistant')
57
- return '';
58
- return generatedContextText(message);
59
- }
60
- /** A person-authored user message closes the preceding group. Runtime-generated
61
- * user context retains role=user for delivery semantics but is not human prose. */
62
- export function isTrueUserMessage(message) {
63
- return message.role === 'user' && parseCard(message) === null;
64
- }