@principal-ai/subsystems-core 0.30.0 → 0.31.1
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/node.d.ts +1 -2
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +16 -3
- package/dist/node.js.map +1 -1
- package/dist/types/subsystem-model.d.ts +34 -3
- package/dist/types/subsystem-model.d.ts.map +1 -1
- package/dist/types/subsystem-model.js.map +1 -1
- package/package.json +1 -1
- package/schemas/subsystem-model.schema.json +52 -1
- package/src/types/subsystem-model.ts +58 -3
package/dist/node.d.ts
CHANGED
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
* session pipeline. Prefer `@principal-ai/subsystems-core/pipeline` in Bun
|
|
7
7
|
* (no better-sqlite3 native binding).
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
10
|
-
export { isSubsystemModelDocument } from './types/subsystem-model';
|
|
9
|
+
export * from './types';
|
|
11
10
|
export { TopicStore, PRINCIPAL_DIR, TOPICS_DIR, LEGACY_TOPICS_BLOB, } from './storage/topicStore';
|
|
12
11
|
export type { TopicIndexEntry, TopicCreate, TopicUpdate, MigrationResult, } from './storage/topicStore';
|
|
13
12
|
export { publishedFromDraft } from './storage/topic-types';
|
package/dist/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,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,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,YAAY,EACV,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,YAAY,GACb,MAAM,uBAAuB,CAAC;AAG/B,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,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
|
@@ -7,10 +7,23 @@
|
|
|
7
7
|
* session pipeline. Prefer `@principal-ai/subsystems-core/pipeline` in Bun
|
|
8
8
|
* (no better-sqlite3 native binding).
|
|
9
9
|
*/
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
22
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
23
|
+
};
|
|
10
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
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.publishedFromDraft = exports.LEGACY_TOPICS_BLOB = exports.TOPICS_DIR = exports.PRINCIPAL_DIR = exports.TopicStore =
|
|
12
|
-
|
|
13
|
-
Object.defineProperty(exports, "isSubsystemModelDocument", { enumerable: true, get: function () { return subsystem_model_1.isSubsystemModelDocument; } });
|
|
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.publishedFromDraft = exports.LEGACY_TOPICS_BLOB = exports.TOPICS_DIR = exports.PRINCIPAL_DIR = exports.TopicStore = void 0;
|
|
26
|
+
__exportStar(require("./types"), exports);
|
|
14
27
|
// File-per-topic store (~/.principal/topics) — node:fs only
|
|
15
28
|
var topicStore_1 = require("./storage/topicStore");
|
|
16
29
|
Object.defineProperty(exports, "TopicStore", { enumerable: true, get: function () { return topicStore_1.TopicStore; } });
|
package/dist/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;AAEH,0CAAwB;AAExB,4DAA4D;AAC5D,mDAK8B;AAJ5B,wGAAA,UAAU,OAAA;AACV,2GAAA,aAAa,OAAA;AACb,wGAAA,UAAU,OAAA;AACV,gHAAA,kBAAkB,OAAA;AAQpB,qDAA2D;AAAlD,iHAAA,kBAAkB,OAAA;AAU3B,mDAAmD;AACnD,oEAA0F;AAAjF,wHAAA,kBAAkB,OAAA;AAAE,2HAAA,qBAAqB,OAAA;AAUlD,iEAAiE;AACjE,4DAA2F;AAAlF,mHAAA,iBAAiB,OAAA;AAAE,6GAAA,WAAW,OAAA;AAAE,gHAAA,cAAc,OAAA;AAOvD,mDAAmD;AACnD,oDAAoE;AAA3D,mHAAA,wBAAwB,OAAA;AAWjC,sEAAsE;AACtE,gDAO6B;AAN3B,wHAAA,4BAA4B,OAAA;AAC5B,2GAAA,eAAe,OAAA;AACf,sHAAA,0BAA0B,OAAA;AAC1B,4GAAA,gBAAgB,OAAA;AAChB,+GAAA,mBAAmB,OAAA;AACnB,yHAAA,6BAA6B,OAAA"}
|
|
@@ -16,10 +16,17 @@
|
|
|
16
16
|
* `symbol` is the code identity; `name` is the display label.
|
|
17
17
|
*/
|
|
18
18
|
/** What the node IS as a declaration. `module` is not an authored construct —
|
|
19
|
-
* a module is its own subsystem.
|
|
20
|
-
|
|
19
|
+
* a module is its own subsystem. `custom_entity` is an authored actor
|
|
20
|
+
* (Person / agent / queue), not code. */
|
|
21
|
+
export type SubsystemConstruct = 'class' | 'function' | 'method' | 'interface' | 'type_alias' | 'enum' | 'store' | 'external' | 'custom_entity';
|
|
21
22
|
/** Where the node sits in the topology, orthogonal to construct. */
|
|
22
23
|
export type SubsystemComponentRole = 'entry' | 'service';
|
|
24
|
+
/**
|
|
25
|
+
* Actor kind for `construct: custom_entity` (open string).
|
|
26
|
+
* Examples: `Person`, `agent`, `queue`, `slack-channel`.
|
|
27
|
+
* Only meaningful on custom entities.
|
|
28
|
+
*/
|
|
29
|
+
export type SubsystemEntityKind = string;
|
|
23
30
|
/**
|
|
24
31
|
* Framework that owns a stereotype vocabulary (open string).
|
|
25
32
|
* Examples: `react`, `vue`, `nestjs`, `django`, `spring`.
|
|
@@ -133,8 +140,22 @@ export interface SubsystemStoreDeclaration {
|
|
|
133
140
|
kind: 'store';
|
|
134
141
|
properties: SubsystemPropertyInfo[];
|
|
135
142
|
}
|
|
143
|
+
/** A single authored attribute on a custom entity — free-form key/value. */
|
|
144
|
+
export interface SubsystemCustomEntityAttribute {
|
|
145
|
+
key: string;
|
|
146
|
+
value: string;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Declaration for `construct: custom_entity` (an actor — Person/agent/queue).
|
|
150
|
+
* Authored, never extracted: there is no backing source declaration.
|
|
151
|
+
* `attributes` is authored key/value (e.g. `slack`, `permission`, `level`).
|
|
152
|
+
*/
|
|
153
|
+
export interface SubsystemCustomEntityDeclaration {
|
|
154
|
+
kind: 'custom_entity';
|
|
155
|
+
attributes: SubsystemCustomEntityAttribute[];
|
|
156
|
+
}
|
|
136
157
|
/** Structured declaration shape of a construct. */
|
|
137
|
-
export type SubsystemConstructDeclaration = SubsystemClassDeclaration | SubsystemFunctionDeclaration | SubsystemMethodDeclaration | SubsystemTypeDeclaration | SubsystemModuleDeclaration | SubsystemExternalDeclaration | SubsystemStoreDeclaration;
|
|
158
|
+
export type SubsystemConstructDeclaration = SubsystemClassDeclaration | SubsystemFunctionDeclaration | SubsystemMethodDeclaration | SubsystemTypeDeclaration | SubsystemModuleDeclaration | SubsystemExternalDeclaration | SubsystemStoreDeclaration | SubsystemCustomEntityDeclaration;
|
|
138
159
|
/** A component node — the named unit, construct-tagged. */
|
|
139
160
|
export interface SubsystemComponent {
|
|
140
161
|
id: string;
|
|
@@ -160,6 +181,16 @@ export interface SubsystemComponent {
|
|
|
160
181
|
process?: string;
|
|
161
182
|
/** Code identity — real declaration in `file` when set. */
|
|
162
183
|
symbol?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Actor kind for `construct: custom_entity` (e.g. `Person`, `agent`,
|
|
186
|
+
* `queue`), rendered as the node badge. Ignored on code constructs.
|
|
187
|
+
*/
|
|
188
|
+
entityKind?: SubsystemEntityKind;
|
|
189
|
+
/**
|
|
190
|
+
* Node + declaration accent override (hex). Wins over the construct-derived
|
|
191
|
+
* color. Typically used to theme a custom entity (agent, queue).
|
|
192
|
+
*/
|
|
193
|
+
color?: string;
|
|
163
194
|
layer?: number;
|
|
164
195
|
capture?: SubsystemCapture;
|
|
165
196
|
/** Structured declaration shape of the construct (params, members, …). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subsystem-model.d.ts","sourceRoot":"","sources":["../../src/types/subsystem-model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;
|
|
1
|
+
{"version":3,"file":"subsystem-model.d.ts","sourceRoot":"","sources":["../../src/types/subsystem-model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;0CAE0C;AAC1C,MAAM,MAAM,kBAAkB,GAC1B,OAAO,GACP,UAAU,GACV,QAAQ,GACR,WAAW,GACX,YAAY,GACZ,MAAM,GACN,OAAO,GACP,UAAU,GACV,eAAe,CAAC;AAEpB,oEAAoE;AACpE,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,SAAS,CAAC;AAEzD;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEzC;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAExC;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC;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ystem-model.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;
|
|
1
|
+
{"version":3,"file":"subsystem-model.js","sourceRoot":"","sources":["../../src/types/subsystem-model.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAkWH;;;;GAIG;AACH,SAAgB,wBAAwB,CAAC,KAAc;IACrD,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtD,MAAM,CAAC,GAAG,KAIT,CAAC;IACF,OAAO,CACL,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CACvB,CAAC;AACJ,CAAC;AAZD,4DAYC"}
|
package/package.json
CHANGED
|
@@ -58,7 +58,8 @@
|
|
|
58
58
|
"type_alias",
|
|
59
59
|
"enum",
|
|
60
60
|
"store",
|
|
61
|
-
"external"
|
|
61
|
+
"external",
|
|
62
|
+
"custom_entity"
|
|
62
63
|
]
|
|
63
64
|
},
|
|
64
65
|
"role": {
|
|
@@ -158,6 +159,14 @@
|
|
|
158
159
|
"type": "string",
|
|
159
160
|
"description": "Code identity — a real declaration in `file` (function/class/const/interface/type/enum). Verified on create/update; mentions, imports, and call sites do not count. For standalone methods use `ClassName.methodName`. Source of truth for display when present."
|
|
160
161
|
},
|
|
162
|
+
"entityKind": {
|
|
163
|
+
"type": "string",
|
|
164
|
+
"description": "Actor kind for `construct: custom_entity` (e.g. Person, agent, queue), rendered as the node badge. Ignored on code constructs."
|
|
165
|
+
},
|
|
166
|
+
"color": {
|
|
167
|
+
"type": "string",
|
|
168
|
+
"description": "Node + declaration accent override (hex). Wins over the construct-derived color. Typically themes a custom entity (agent, queue)."
|
|
169
|
+
},
|
|
161
170
|
"purpose": {
|
|
162
171
|
"type": "string",
|
|
163
172
|
"description": "One plain-text sentence shown on the node / as a doc comment under the declaration. Verb-first; no markdown."
|
|
@@ -537,6 +546,9 @@
|
|
|
537
546
|
},
|
|
538
547
|
{
|
|
539
548
|
"$ref": "#/$defs/storeDeclaration"
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
"$ref": "#/$defs/customEntityDeclaration"
|
|
540
552
|
}
|
|
541
553
|
]
|
|
542
554
|
},
|
|
@@ -762,6 +774,45 @@
|
|
|
762
774
|
}
|
|
763
775
|
}
|
|
764
776
|
}
|
|
777
|
+
},
|
|
778
|
+
"customEntityAttribute": {
|
|
779
|
+
"type": "object",
|
|
780
|
+
"required": [
|
|
781
|
+
"key",
|
|
782
|
+
"value"
|
|
783
|
+
],
|
|
784
|
+
"additionalProperties": false,
|
|
785
|
+
"description": "A single authored attribute on a custom entity — free-form key/value.",
|
|
786
|
+
"properties": {
|
|
787
|
+
"key": {
|
|
788
|
+
"type": "string",
|
|
789
|
+
"minLength": 1
|
|
790
|
+
},
|
|
791
|
+
"value": {
|
|
792
|
+
"type": "string"
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
},
|
|
796
|
+
"customEntityDeclaration": {
|
|
797
|
+
"type": "object",
|
|
798
|
+
"required": [
|
|
799
|
+
"kind",
|
|
800
|
+
"attributes"
|
|
801
|
+
],
|
|
802
|
+
"additionalProperties": false,
|
|
803
|
+
"description": "Declaration for `construct: custom_entity` (an actor — Person/agent/queue). Authored, never extracted: there is no backing source declaration. Rendered as `entity 'Name' — kind` plus the key/value attribute lines.",
|
|
804
|
+
"properties": {
|
|
805
|
+
"kind": {
|
|
806
|
+
"const": "custom_entity"
|
|
807
|
+
},
|
|
808
|
+
"attributes": {
|
|
809
|
+
"type": "array",
|
|
810
|
+
"description": "Authored key/value pairs (e.g. slack, permission, level).",
|
|
811
|
+
"items": {
|
|
812
|
+
"$ref": "#/$defs/customEntityAttribute"
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}
|
|
765
816
|
}
|
|
766
817
|
}
|
|
767
818
|
}
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
/** What the node IS as a declaration. `module` is not an authored construct —
|
|
20
|
-
* a module is its own subsystem.
|
|
20
|
+
* a module is its own subsystem. `custom_entity` is an authored actor
|
|
21
|
+
* (Person / agent / queue), not code. */
|
|
21
22
|
export type SubsystemConstruct =
|
|
22
23
|
| 'class'
|
|
23
24
|
| 'function'
|
|
@@ -26,11 +27,19 @@ export type SubsystemConstruct =
|
|
|
26
27
|
| 'type_alias'
|
|
27
28
|
| 'enum'
|
|
28
29
|
| 'store'
|
|
29
|
-
| 'external'
|
|
30
|
+
| 'external'
|
|
31
|
+
| 'custom_entity';
|
|
30
32
|
|
|
31
33
|
/** Where the node sits in the topology, orthogonal to construct. */
|
|
32
34
|
export type SubsystemComponentRole = 'entry' | 'service';
|
|
33
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Actor kind for `construct: custom_entity` (open string).
|
|
38
|
+
* Examples: `Person`, `agent`, `queue`, `slack-channel`.
|
|
39
|
+
* Only meaningful on custom entities.
|
|
40
|
+
*/
|
|
41
|
+
export type SubsystemEntityKind = string;
|
|
42
|
+
|
|
34
43
|
/**
|
|
35
44
|
* Framework that owns a stereotype vocabulary (open string).
|
|
36
45
|
* Examples: `react`, `vue`, `nestjs`, `django`, `spring`.
|
|
@@ -191,6 +200,22 @@ export interface SubsystemStoreDeclaration {
|
|
|
191
200
|
properties: SubsystemPropertyInfo[];
|
|
192
201
|
}
|
|
193
202
|
|
|
203
|
+
/** A single authored attribute on a custom entity — free-form key/value. */
|
|
204
|
+
export interface SubsystemCustomEntityAttribute {
|
|
205
|
+
key: string;
|
|
206
|
+
value: string;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Declaration for `construct: custom_entity` (an actor — Person/agent/queue).
|
|
211
|
+
* Authored, never extracted: there is no backing source declaration.
|
|
212
|
+
* `attributes` is authored key/value (e.g. `slack`, `permission`, `level`).
|
|
213
|
+
*/
|
|
214
|
+
export interface SubsystemCustomEntityDeclaration {
|
|
215
|
+
kind: 'custom_entity';
|
|
216
|
+
attributes: SubsystemCustomEntityAttribute[];
|
|
217
|
+
}
|
|
218
|
+
|
|
194
219
|
/** Structured declaration shape of a construct. */
|
|
195
220
|
export type SubsystemConstructDeclaration =
|
|
196
221
|
| SubsystemClassDeclaration
|
|
@@ -199,7 +224,8 @@ export type SubsystemConstructDeclaration =
|
|
|
199
224
|
| SubsystemTypeDeclaration
|
|
200
225
|
| SubsystemModuleDeclaration
|
|
201
226
|
| SubsystemExternalDeclaration
|
|
202
|
-
| SubsystemStoreDeclaration
|
|
227
|
+
| SubsystemStoreDeclaration
|
|
228
|
+
| SubsystemCustomEntityDeclaration;
|
|
203
229
|
|
|
204
230
|
/** A component node — the named unit, construct-tagged. */
|
|
205
231
|
export interface SubsystemComponent {
|
|
@@ -226,6 +252,16 @@ export interface SubsystemComponent {
|
|
|
226
252
|
process?: string;
|
|
227
253
|
/** Code identity — real declaration in `file` when set. */
|
|
228
254
|
symbol?: string;
|
|
255
|
+
/**
|
|
256
|
+
* Actor kind for `construct: custom_entity` (e.g. `Person`, `agent`,
|
|
257
|
+
* `queue`), rendered as the node badge. Ignored on code constructs.
|
|
258
|
+
*/
|
|
259
|
+
entityKind?: SubsystemEntityKind;
|
|
260
|
+
/**
|
|
261
|
+
* Node + declaration accent override (hex). Wins over the construct-derived
|
|
262
|
+
* color. Typically used to theme a custom entity (agent, queue).
|
|
263
|
+
*/
|
|
264
|
+
color?: string;
|
|
229
265
|
layer?: number;
|
|
230
266
|
capture?: SubsystemCapture;
|
|
231
267
|
/** Structured declaration shape of the construct (params, members, …). */
|
|
@@ -350,3 +386,22 @@ export function isSubsystemModelDocument(value: unknown): value is SubsystemMode
|
|
|
350
386
|
Array.isArray(v.edges)
|
|
351
387
|
);
|
|
352
388
|
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Keep only portable fields — drop host bindings / store metadata if a
|
|
392
|
+
* hydrated record is passed in. Use before writing a gist or any other
|
|
393
|
+
* share surface that must stay schema-clean.
|
|
394
|
+
*/
|
|
395
|
+
export function toPortableDocument(
|
|
396
|
+
doc: SubsystemModelDocument,
|
|
397
|
+
): SubsystemModelDocument {
|
|
398
|
+
const out: SubsystemModelDocument = {
|
|
399
|
+
title: doc.title,
|
|
400
|
+
components: doc.components,
|
|
401
|
+
edges: doc.edges,
|
|
402
|
+
};
|
|
403
|
+
if (doc.$schema) out.$schema = doc.$schema;
|
|
404
|
+
if (doc.description) out.description = doc.description;
|
|
405
|
+
if (doc.throughlines) out.throughlines = doc.throughlines;
|
|
406
|
+
return out;
|
|
407
|
+
}
|