@principal-ai/subsystems-core 0.31.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/package.json +1 -1
- package/src/types/subsystem-model.ts +19 -0
package/package.json
CHANGED
|
@@ -386,3 +386,22 @@ export function isSubsystemModelDocument(value: unknown): value is SubsystemMode
|
|
|
386
386
|
Array.isArray(v.edges)
|
|
387
387
|
);
|
|
388
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
|
+
}
|