@principal-ai/subsystems-core 0.51.4 → 0.51.6

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 (155) hide show
  1. package/README.md +21 -6
  2. package/dist/audit/boundary.d.ts +104 -0
  3. package/dist/audit/boundary.d.ts.map +1 -0
  4. package/dist/audit/boundary.js +363 -0
  5. package/dist/audit/boundary.js.map +1 -0
  6. package/dist/audit/c4.d.ts +41 -0
  7. package/dist/audit/c4.d.ts.map +1 -0
  8. package/dist/audit/c4.js +41 -0
  9. package/dist/audit/c4.js.map +1 -0
  10. package/dist/audit/engine.d.ts +135 -0
  11. package/dist/audit/engine.d.ts.map +1 -0
  12. package/dist/audit/engine.js +828 -0
  13. package/dist/audit/engine.js.map +1 -0
  14. package/dist/audit/fixes.d.ts +80 -0
  15. package/dist/audit/fixes.d.ts.map +1 -0
  16. package/dist/audit/fixes.js +162 -0
  17. package/dist/audit/fixes.js.map +1 -0
  18. package/dist/audit/hash.d.ts +25 -0
  19. package/dist/audit/hash.d.ts.map +1 -0
  20. package/dist/audit/hash.js +53 -0
  21. package/dist/audit/hash.js.map +1 -0
  22. package/dist/audit/index.d.ts +11 -1
  23. package/dist/audit/index.d.ts.map +1 -1
  24. package/dist/audit/index.js +37 -3
  25. package/dist/audit/index.js.map +1 -1
  26. package/dist/audit/local-graphify.d.ts +75 -0
  27. package/dist/audit/local-graphify.d.ts.map +1 -0
  28. package/dist/audit/local-graphify.js +283 -0
  29. package/dist/audit/local-graphify.js.map +1 -0
  30. package/dist/audit/paths.d.ts +16 -0
  31. package/dist/audit/paths.d.ts.map +1 -0
  32. package/dist/audit/paths.js +31 -0
  33. package/dist/audit/paths.js.map +1 -0
  34. package/dist/audit/pure.d.ts +18 -0
  35. package/dist/audit/pure.d.ts.map +1 -0
  36. package/dist/audit/pure.js +50 -0
  37. package/dist/audit/pure.js.map +1 -0
  38. package/dist/audit/report-logic.d.ts +17 -0
  39. package/dist/audit/report-logic.d.ts.map +1 -0
  40. package/dist/audit/report-logic.js +206 -0
  41. package/dist/audit/report-logic.js.map +1 -0
  42. package/dist/audit/report.d.ts +136 -0
  43. package/dist/audit/report.d.ts.map +1 -0
  44. package/dist/audit/report.js +3 -0
  45. package/dist/audit/report.js.map +1 -0
  46. package/dist/audit/trail.d.ts +29 -0
  47. package/dist/audit/trail.d.ts.map +1 -0
  48. package/dist/audit/trail.js +59 -0
  49. package/dist/audit/trail.js.map +1 -0
  50. package/dist/audit/verification.d.ts +98 -0
  51. package/dist/audit/verification.d.ts.map +1 -0
  52. package/dist/audit/verification.js +11 -0
  53. package/dist/audit/verification.js.map +1 -0
  54. package/dist/audit/verify/component.d.ts +68 -0
  55. package/dist/audit/verify/component.d.ts.map +1 -0
  56. package/dist/audit/verify/component.js +500 -0
  57. package/dist/audit/verify/component.js.map +1 -0
  58. package/dist/audit/verify/declarations.d.ts +58 -0
  59. package/dist/audit/verify/declarations.d.ts.map +1 -0
  60. package/dist/audit/verify/declarations.js +227 -0
  61. package/dist/audit/verify/declarations.js.map +1 -0
  62. package/dist/audit/verify/grammar.d.ts +12 -0
  63. package/dist/audit/verify/grammar.d.ts.map +1 -0
  64. package/dist/audit/verify/grammar.js +57 -0
  65. package/dist/audit/verify/grammar.js.map +1 -0
  66. package/dist/audit/verify/index.d.ts +12 -0
  67. package/dist/audit/verify/index.d.ts.map +1 -0
  68. package/dist/audit/verify/index.js +31 -0
  69. package/dist/audit/verify/index.js.map +1 -0
  70. package/dist/audit/verify/parser.d.ts +19 -0
  71. package/dist/audit/verify/parser.d.ts.map +1 -0
  72. package/dist/audit/verify/parser.js +122 -0
  73. package/dist/audit/verify/parser.js.map +1 -0
  74. package/dist/audit/verify/span.d.ts +49 -0
  75. package/dist/audit/verify/span.d.ts.map +1 -0
  76. package/dist/audit/verify/span.js +377 -0
  77. package/dist/audit/verify/span.js.map +1 -0
  78. package/dist/graphify/anchor.d.ts +45 -0
  79. package/dist/graphify/anchor.d.ts.map +1 -0
  80. package/dist/graphify/anchor.js +179 -0
  81. package/dist/graphify/anchor.js.map +1 -0
  82. package/dist/graphify/consolidated.d.ts +259 -0
  83. package/dist/graphify/consolidated.d.ts.map +1 -0
  84. package/dist/graphify/consolidated.js +12 -0
  85. package/dist/graphify/consolidated.js.map +1 -0
  86. package/dist/graphify/construct.d.ts +41 -0
  87. package/dist/graphify/construct.d.ts.map +1 -0
  88. package/dist/graphify/construct.js +106 -0
  89. package/dist/graphify/construct.js.map +1 -0
  90. package/dist/graphify/ids.d.ts +19 -0
  91. package/dist/graphify/ids.d.ts.map +1 -0
  92. package/dist/graphify/ids.js +53 -0
  93. package/dist/graphify/ids.js.map +1 -0
  94. package/dist/graphify/index.d.ts +16 -0
  95. package/dist/graphify/index.d.ts.map +1 -0
  96. package/dist/graphify/index.js +32 -0
  97. package/dist/graphify/index.js.map +1 -0
  98. package/dist/graphify/resolve.d.ts +48 -0
  99. package/dist/graphify/resolve.d.ts.map +1 -0
  100. package/dist/graphify/resolve.js +89 -0
  101. package/dist/graphify/resolve.js.map +1 -0
  102. package/dist/graphify/signature.d.ts +87 -0
  103. package/dist/graphify/signature.d.ts.map +1 -0
  104. package/dist/graphify/signature.js +282 -0
  105. package/dist/graphify/signature.js.map +1 -0
  106. package/dist/graphify/types.d.ts +141 -0
  107. package/dist/graphify/types.d.ts.map +1 -0
  108. package/dist/graphify/types.js +9 -0
  109. package/dist/graphify/types.js.map +1 -0
  110. package/dist/index.d.ts +3 -1
  111. package/dist/index.d.ts.map +1 -1
  112. package/dist/index.js +6 -4
  113. package/dist/index.js.map +1 -1
  114. package/dist/node.d.ts +2 -0
  115. package/dist/node.d.ts.map +1 -1
  116. package/dist/node.js +3 -1
  117. package/dist/node.js.map +1 -1
  118. package/dist/storage/topic-share.d.ts +57 -0
  119. package/dist/storage/topic-share.d.ts.map +1 -0
  120. package/dist/storage/topic-share.js +55 -0
  121. package/dist/storage/topic-share.js.map +1 -0
  122. package/package.json +16 -2
  123. package/src/audit/boundary.ts +447 -0
  124. package/src/audit/c4.ts +70 -0
  125. package/src/audit/engine.ts +1058 -0
  126. package/src/audit/fixes.ts +192 -0
  127. package/src/audit/hash.ts +58 -0
  128. package/src/audit/index.ts +33 -8
  129. package/src/audit/local-graphify.test.ts +163 -0
  130. package/src/audit/local-graphify.ts +354 -0
  131. package/src/audit/paths.ts +25 -0
  132. package/src/audit/pure.ts +91 -0
  133. package/src/audit/report-logic.test.ts +145 -0
  134. package/src/audit/report-logic.ts +245 -0
  135. package/src/audit/report.ts +203 -0
  136. package/src/audit/trail.ts +77 -0
  137. package/src/audit/verification.ts +104 -0
  138. package/src/audit/verify/component.ts +760 -0
  139. package/src/audit/verify/declarations.ts +284 -0
  140. package/src/audit/verify/grammar.ts +57 -0
  141. package/src/audit/verify/index.ts +41 -0
  142. package/src/audit/verify/parser.ts +124 -0
  143. package/src/audit/verify/span.ts +478 -0
  144. package/src/graphify/anchor.ts +206 -0
  145. package/src/graphify/consolidated.ts +298 -0
  146. package/src/graphify/construct.ts +153 -0
  147. package/src/graphify/ids.ts +48 -0
  148. package/src/graphify/index.ts +16 -0
  149. package/src/graphify/resolve.ts +115 -0
  150. package/src/graphify/signature.ts +354 -0
  151. package/src/graphify/types.ts +164 -0
  152. package/src/index.ts +5 -3
  153. package/src/node.ts +2 -0
  154. package/src/storage/topic-share.test.ts +71 -0
  155. package/src/storage/topic-share.ts +91 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,SAAS,CAAC;AAExB,YAAY,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,sBAAsB,EACtB,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAKpG,OAAO,EAAE,gCAAgC,EAAE,MAAM,cAAc,CAAC;AAChE,YAAY,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAI/D,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,SAAS,CAAC;AAExB,YAAY,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,sBAAsB,EACtB,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AACpG,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAKlG,OAAO,EAAE,gCAAgC,EAAE,MAAM,cAAc,CAAC;AAChE,YAAY,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAI/D,cAAc,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -26,17 +26,19 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
26
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.validateSubsystemModelCrossField = exports.parseTopicReferenceLink = exports.formatTopicReferenceLink = void 0;
29
+ exports.validateSubsystemModelCrossField = exports.toSharedTopic = exports.parseTopicReferenceLink = exports.formatTopicReferenceLink = void 0;
30
30
  __exportStar(require("./types"), exports);
31
31
  var topic_reference_links_1 = require("./storage/topic-reference-links");
32
32
  Object.defineProperty(exports, "formatTopicReferenceLink", { enumerable: true, get: function () { return topic_reference_links_1.formatTopicReferenceLink; } });
33
33
  Object.defineProperty(exports, "parseTopicReferenceLink", { enumerable: true, get: function () { return topic_reference_links_1.parseTopicReferenceLink; } });
34
+ var topic_share_1 = require("./storage/topic-share");
35
+ Object.defineProperty(exports, "toSharedTopic", { enumerable: true, get: function () { return topic_share_1.toSharedTopic; } });
34
36
  // Cross-field validation (the rules the JSON Schema can't express). Structural
35
37
  // (schema) validation is enforced per surface against
36
38
  // `schemas/subsystem-model.schema.json`.
37
39
  var validation_1 = require("./validation");
38
40
  Object.defineProperty(exports, "validateSubsystemModelCrossField", { enumerable: true, get: function () { return validation_1.validateSubsystemModelCrossField; } });
39
- // Audit ports and graph-load caching are runtime-neutral; no Node or Graphify
40
- // dependencies are included here.
41
- __exportStar(require("./audit"), exports);
41
+ // Audit policy and report rules are runtime-neutral. The Node-only engine lives
42
+ // behind `./audit` so the main entry never pulls in filesystem/crypto.
43
+ __exportStar(require("./audit/pure"), exports);
42
44
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;;;;;;;;;;;;AAEH,0CAAwB;AASxB,yEAAoG;AAA3F,iIAAA,wBAAwB,OAAA;AAAE,gIAAA,uBAAuB,OAAA;AAE1D,+EAA+E;AAC/E,sDAAsD;AACtD,yCAAyC;AACzC,2CAAgE;AAAvD,8HAAA,gCAAgC,OAAA;AAGzC,8EAA8E;AAC9E,kCAAkC;AAClC,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;;;;;;;;;;;;AAEH,0CAAwB;AASxB,yEAAoG;AAA3F,iIAAA,wBAAwB,OAAA;AAAE,gIAAA,uBAAuB,OAAA;AAC1D,qDAAsD;AAA7C,4GAAA,aAAa,OAAA;AAGtB,+EAA+E;AAC/E,sDAAsD;AACtD,yCAAyC;AACzC,2CAAgE;AAAvD,8HAAA,gCAAgC,OAAA;AAGzC,gFAAgF;AAChF,uEAAuE;AACvE,+CAA6B"}
package/dist/node.d.ts CHANGED
@@ -12,6 +12,8 @@ export { TopicStore, PRINCIPAL_DIR, TOPICS_DIR, LEGACY_TOPICS_BLOB, } from './st
12
12
  export type { TopicIndexEntry, TopicCreate, TopicUpdate, MigrationResult, } from './storage/topicStore';
13
13
  export type { DraftTopic, TopicAsset, TopicCreator, TopicSubsystemModelRef, TopicReference, } from './storage/topic-types';
14
14
  export { formatTopicReferenceLink, parseTopicReferenceLink } from './storage/topic-reference-links';
15
+ export { toSharedTopic } from './storage/topic-share';
16
+ export type { SharedTopic, SharedTopicAsset, SharedTopicProjection } from './storage/topic-share';
15
17
  export { OpenCodeEventStore, defaultOpenCodeDBPath } from './opencode/OpenCodeEventStore';
16
18
  export type { OpenCodeRawEvent, OpenCodeSessionEvents, OpenCodeEventRetriever, OpenCodeStoreOptions, SessionSummary, SessionListResult, } from './opencode/types';
17
19
  export { listAgentSessions, detectAgent, fetchRawEvents } from './opencode/agent-sessions';
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AAGxB,OAAO,EACL,UAAU,EACV,aAAa,EACb,UAAU,EACV,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,eAAe,EACf,WAAW,EACX,WAAW,EACX,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,sBAAsB,EACtB,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAGpG,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC1F,YAAY,EACV,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,EACd,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,WAAW,E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pB,cAAc,EACd,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3F,YAAY,EACV,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,YAAY,EACV,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,4BAA4B,EAC5B,eAAe,EACf,0BAA0B,EAC1B,gBAAgB,EAChB,mBAAmB,EACnB,6BAA6B,GAC9B,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/node.js CHANGED
@@ -22,7 +22,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
22
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.opencodeRowsToUniversalEvents = exports.collectRepositories = exports.accumulateEvents = exports.normalizeEventsWithAdapter = exports.normalizeEvents = exports.NodePathNormalizationAdapter = exports.buildAgentSessionFixture = exports.fetchRawEvents = exports.detectAgent = exports.listAgentSessions = exports.defaultOpenCodeDBPath = exports.OpenCodeEventStore = exports.parseTopicReferenceLink = exports.formatTopicReferenceLink = exports.LEGACY_TOPICS_BLOB = exports.TOPICS_DIR = exports.PRINCIPAL_DIR = exports.TopicStore = void 0;
25
+ exports.opencodeRowsToUniversalEvents = exports.collectRepositories = exports.accumulateEvents = exports.normalizeEventsWithAdapter = exports.normalizeEvents = exports.NodePathNormalizationAdapter = exports.buildAgentSessionFixture = exports.fetchRawEvents = exports.detectAgent = exports.listAgentSessions = exports.defaultOpenCodeDBPath = exports.OpenCodeEventStore = exports.toSharedTopic = exports.parseTopicReferenceLink = exports.formatTopicReferenceLink = exports.LEGACY_TOPICS_BLOB = exports.TOPICS_DIR = exports.PRINCIPAL_DIR = exports.TopicStore = void 0;
26
26
  __exportStar(require("./types"), exports);
27
27
  __exportStar(require("./audit"), exports);
28
28
  // File-per-topic store (~/.principal/topics) — node:fs only
@@ -34,6 +34,8 @@ Object.defineProperty(exports, "LEGACY_TOPICS_BLOB", { enumerable: true, get: fu
34
34
  var topic_reference_links_1 = require("./storage/topic-reference-links");
35
35
  Object.defineProperty(exports, "formatTopicReferenceLink", { enumerable: true, get: function () { return topic_reference_links_1.formatTopicReferenceLink; } });
36
36
  Object.defineProperty(exports, "parseTopicReferenceLink", { enumerable: true, get: function () { return topic_reference_links_1.parseTopicReferenceLink; } });
37
+ var topic_share_1 = require("./storage/topic-share");
38
+ Object.defineProperty(exports, "toSharedTopic", { enumerable: true, get: function () { return topic_share_1.toSharedTopic; } });
37
39
  // OpenCode event retrieval (Node.js only - SQLite)
38
40
  var OpenCodeEventStore_1 = require("./opencode/OpenCodeEventStore");
39
41
  Object.defineProperty(exports, "OpenCodeEventStore", { enumerable: true, get: function () { return OpenCodeEventStore_1.OpenCodeEventStore; } });
package/dist/node.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,0CAAwB;AAExB,4DAA4D;AAC5D,mDAK8B;AAJ5B,wGAAA,UAAU,OAAA;AACV,2GAAA,aAAa,OAAA;AACb,wGAAA,UAAU,OAAA;AACV,gHAAA,kBAAkB,OAAA;AAepB,yEAAoG;AAA3F,iIAAA,wBAAwB,OAAA;AAAE,gIAAA,uBAAuB,OAAA;AAE1D,mDAAmD;AACnD,oEAA0F;AAAjF,wHAAA,kBAAkB,OAAA;AAAE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 @@
1
+ /**
2
+ * Portable projection of a topic for sharing outside the machine that authored
3
+ * it. Browser-safe (no `node:*`).
4
+ *
5
+ * A {@link DraftTopic} carries fields that only mean something locally: store
6
+ * ids of subsystem models, references to sketches/drawings/topics on disk, and
7
+ * inline image bytes. {@link toSharedTopic} drops the local-only fields and
8
+ * splits image bytes out so a host can upload each one separately.
9
+ */
10
+ import type { DraftTopic, TopicCreator } from './topic-types';
11
+ /** An image a shared topic refers to. Bytes travel separately, keyed by `id`. */
12
+ export interface SharedTopicAsset {
13
+ /** Content hash; the `asset://<id>` target in the description. */
14
+ id: string;
15
+ /** MIME type, e.g. "image/png". */
16
+ mime: string;
17
+ /** Resolvable URL, when the bytes already live somewhere public. */
18
+ url?: string;
19
+ /** Markdown alt text. */
20
+ alt?: string;
21
+ }
22
+ /**
23
+ * A topic as it leaves the authoring machine. No local store ids and no inline
24
+ * bytes; `description` is unchanged, so `asset://<id>` links still resolve
25
+ * against `assets`.
26
+ */
27
+ export interface SharedTopic {
28
+ id: string;
29
+ title: string;
30
+ description?: string;
31
+ /** Repositories as PURL strings. */
32
+ repos?: string[];
33
+ /** ISO 8601. */
34
+ createdAt: string;
35
+ /** ISO 8601. */
36
+ updatedAt: string;
37
+ createdBy?: TopicCreator;
38
+ assets?: SharedTopicAsset[];
39
+ }
40
+ export interface SharedTopicProjection {
41
+ topic: SharedTopic;
42
+ /** Assets whose bytes must be uploaded alongside the topic (those with `data`). */
43
+ uploads: Array<{
44
+ id: string;
45
+ mime: string;
46
+ data: string;
47
+ }>;
48
+ }
49
+ /**
50
+ * Project a local topic into its shared form.
51
+ *
52
+ * Dropped: `subsystemModels` and `references` (local store ids), each asset's
53
+ * `source` (local Storybook origin) and inline `data`. Assets with neither
54
+ * `data` nor `url` cannot be resolved by a reader and are omitted.
55
+ */
56
+ export declare function toSharedTopic(topic: DraftTopic): SharedTopicProjection;
57
+ //# sourceMappingURL=topic-share.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topic-share.d.ts","sourceRoot":"","sources":["../../src/storage/topic-share.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAc,YAAY,EAAE,MAAM,eAAe,CAAC;AAE1E,iFAAiF;AACjF,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,EAAE,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,WAAW,CAAC;IACnB,mFAAmF;IACnF,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC5D;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,qBAAqB,CA8BtE"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ /**
3
+ * Portable projection of a topic for sharing outside the machine that authored
4
+ * it. Browser-safe (no `node:*`).
5
+ *
6
+ * A {@link DraftTopic} carries fields that only mean something locally: store
7
+ * ids of subsystem models, references to sketches/drawings/topics on disk, and
8
+ * inline image bytes. {@link toSharedTopic} drops the local-only fields and
9
+ * splits image bytes out so a host can upload each one separately.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.toSharedTopic = void 0;
13
+ /**
14
+ * Project a local topic into its shared form.
15
+ *
16
+ * Dropped: `subsystemModels` and `references` (local store ids), each asset's
17
+ * `source` (local Storybook origin) and inline `data`. Assets with neither
18
+ * `data` nor `url` cannot be resolved by a reader and are omitted.
19
+ */
20
+ function toSharedTopic(topic) {
21
+ const assets = [];
22
+ const uploads = [];
23
+ const seen = new Set();
24
+ for (const asset of topic.assets ?? []) {
25
+ if (seen.has(asset.id) || !isResolvable(asset))
26
+ continue;
27
+ seen.add(asset.id);
28
+ assets.push({
29
+ id: asset.id,
30
+ mime: asset.mime,
31
+ ...(asset.url ? { url: asset.url } : {}),
32
+ ...(asset.alt ? { alt: asset.alt } : {}),
33
+ });
34
+ if (asset.data)
35
+ uploads.push({ id: asset.id, mime: asset.mime, data: asset.data });
36
+ }
37
+ return {
38
+ topic: {
39
+ id: topic.id,
40
+ title: topic.title,
41
+ ...(topic.description !== undefined ? { description: topic.description } : {}),
42
+ ...(topic.repos?.length ? { repos: [...topic.repos] } : {}),
43
+ createdAt: topic.createdAt,
44
+ updatedAt: topic.updatedAt,
45
+ ...(topic.createdBy ? { createdBy: { ...topic.createdBy } } : {}),
46
+ ...(assets.length ? { assets } : {}),
47
+ },
48
+ uploads,
49
+ };
50
+ }
51
+ exports.toSharedTopic = toSharedTopic;
52
+ function isResolvable(asset) {
53
+ return Boolean(asset.data || asset.url);
54
+ }
55
+ //# sourceMappingURL=topic-share.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topic-share.js","sourceRoot":"","sources":["../../src/storage/topic-share.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAyCH;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,KAAiB;IAC7C,MAAM,MAAM,GAAuB,EAAE,CAAC;IACtC,MAAM,OAAO,GAA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,CAAC,CAAC,EAAE,CAAC;YAC3D,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,GAAG,KAAK,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACjE,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACrC;QACD,OAAO;KACR,CAAC;AACJ,CAAC;AA9BD,sCA8BC;AAED,SAAS,YAAY,CAAC,KAAiB;IACrC,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;AAC1C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principal-ai/subsystems-core",
3
- "version": "0.51.4",
3
+ "version": "0.51.6",
4
4
  "description": "Subsystem model types and agent-session tooling for Principal AI",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -29,6 +29,18 @@
29
29
  "require": "./dist/audit/index.js",
30
30
  "default": "./dist/audit/index.js"
31
31
  },
32
+ "./graphify": {
33
+ "types": "./dist/graphify/index.d.ts",
34
+ "import": "./dist/graphify/index.js",
35
+ "require": "./dist/graphify/index.js",
36
+ "default": "./dist/graphify/index.js"
37
+ },
38
+ "./graphify/*": {
39
+ "types": "./dist/graphify/*.d.ts",
40
+ "import": "./dist/graphify/*.js",
41
+ "require": "./dist/graphify/*.js",
42
+ "default": "./dist/graphify/*.js"
43
+ },
32
44
  "./schemas/subsystem-model.schema.json": "./schemas/subsystem-model.schema.json"
33
45
  },
34
46
  "files": [
@@ -50,7 +62,9 @@
50
62
  "lint:fix": "cd ../.. && eslint packages/subsystems-core --ext .ts,.tsx,.js,.jsx --fix"
51
63
  },
52
64
  "dependencies": {
53
- "better-sqlite3": "^13.0.0"
65
+ "better-sqlite3": "^13.0.0",
66
+ "web-tree-sitter": "^0.25.10",
67
+ "tree-sitter-wasms": "^0.1.13"
54
68
  },
55
69
  "peerDependencies": {
56
70
  "@principal-ai/agent-monitoring": "^0.3.43"