@principal-ai/principal-studio-cli 0.37.0 → 0.37.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/README.md +1 -1
- package/dist/commands/subsystem-model.d.ts.map +1 -1
- package/dist/commands/subsystem-model.js +108 -1
- package/dist/index.cjs +168 -11
- package/dist/index.cjs.map +4 -4
- package/dist/lib/subsystem-model-store.d.ts +13 -1
- package/dist/lib/subsystem-model-store.d.ts.map +1 -1
- package/dist/lib/subsystem-model-store.js +19 -0
- package/package.json +3 -3
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* for now and may be empty on CLI-created records until opened/updated there.
|
|
9
9
|
*/
|
|
10
10
|
export declare const SUBSYSTEM_EDGE_MECHANISMS: readonly ["imports", "imports_from", "re_exports", "defines", "calls", "extends", "inherits", "implements", "mixes_in", "uses", "method", "references", "contains", "feeds", "produces", "writes", "reads", "watches", "registers-into"];
|
|
11
|
-
export declare const SUBSYSTEM_COMPONENT_CONSTRUCTS: readonly ["class", "function", "method", "interface", "type_alias", "enum", "store", "external"];
|
|
11
|
+
export declare const SUBSYSTEM_COMPONENT_CONSTRUCTS: readonly ["class", "function", "method", "interface", "type_alias", "enum", "store", "external", "custom_entity"];
|
|
12
12
|
export declare const SUBSYSTEM_DETAIL_PROVENANCES: readonly ["verified", "authored"];
|
|
13
13
|
export interface SubsystemModelIndexEntry {
|
|
14
14
|
id: string;
|
|
@@ -25,6 +25,11 @@ export interface SubsystemModelIndexEntry {
|
|
|
25
25
|
owner: string;
|
|
26
26
|
name: string;
|
|
27
27
|
};
|
|
28
|
+
/** Host-only gist link mirrored from the record. */
|
|
29
|
+
gist?: {
|
|
30
|
+
id: string;
|
|
31
|
+
fileName?: string;
|
|
32
|
+
};
|
|
28
33
|
}
|
|
29
34
|
export interface StoredSubsystemModel {
|
|
30
35
|
id: string;
|
|
@@ -43,6 +48,11 @@ export interface StoredSubsystemModel {
|
|
|
43
48
|
};
|
|
44
49
|
repoRoot?: string;
|
|
45
50
|
repoRoots?: Record<string, string>;
|
|
51
|
+
/** Host-only GitHub gist link (not portable). */
|
|
52
|
+
gist?: {
|
|
53
|
+
id: string;
|
|
54
|
+
fileName?: string;
|
|
55
|
+
};
|
|
46
56
|
verification?: unknown;
|
|
47
57
|
}
|
|
48
58
|
export interface CreateSubsystemModelInput {
|
|
@@ -71,4 +81,6 @@ export declare function findCreateProblems(body: Record<string, unknown>): strin
|
|
|
71
81
|
export declare function listSubsystemModels(): Promise<SubsystemModelIndexEntry[]>;
|
|
72
82
|
export declare function getSubsystemModel(id: string): Promise<StoredSubsystemModel | null>;
|
|
73
83
|
export declare function createSubsystemModel(doc: CreateSubsystemModelInput): Promise<StoredSubsystemModel>;
|
|
84
|
+
/** Patch an existing record (e.g. stamp a host gist ref after share). */
|
|
85
|
+
export declare function updateSubsystemModel(id: string, patch: Partial<Pick<StoredSubsystemModel, 'title' | 'description' | 'components' | 'edges' | 'throughlines' | 'source' | 'repo' | 'repoRoot' | 'repoRoots' | 'gist'>>): Promise<StoredSubsystemModel | null>;
|
|
74
86
|
//# sourceMappingURL=subsystem-model-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subsystem-model-store.d.ts","sourceRoot":"","sources":["../../src/lib/subsystem-model-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AASH,eAAO,MAAM,yBAAyB,0OAoB5B,CAAC;AAEX,eAAO,MAAM,8BAA8B,
|
|
1
|
+
{"version":3,"file":"subsystem-model-store.d.ts","sourceRoot":"","sources":["../../src/lib/subsystem-model-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AASH,eAAO,MAAM,yBAAyB,0OAoB5B,CAAC;AAEX,eAAO,MAAM,8BAA8B,mHAUjC,CAAC;AAEX,eAAO,MAAM,4BAA4B,mCAAoC,CAAC;AAE9E,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,M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oBAAoB,GAAG,IAAI,CAAC,CAOxF;AAED,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,yBAAyB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CAa/B;AAED,yEAAyE;AACzE,wBAAsB,oBAAoB,CACxC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,OAAO,CACZ,IAAI,CACF,oBAAoB,EAClB,OAAO,GACP,aAAa,GACb,YAAY,GACZ,OAAO,GACP,cAAc,GACd,QAAQ,GACR,MAAM,GACN,UAAU,GACV,WAAW,GACX,MAAM,CACT,CACF,GACA,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAYtC"}
|
|
@@ -42,6 +42,7 @@ export const SUBSYSTEM_COMPONENT_CONSTRUCTS = [
|
|
|
42
42
|
'enum',
|
|
43
43
|
'store',
|
|
44
44
|
'external',
|
|
45
|
+
'custom_entity',
|
|
45
46
|
];
|
|
46
47
|
export const SUBSYSTEM_DETAIL_PROVENANCES = ['verified', 'authored'];
|
|
47
48
|
function graphId() {
|
|
@@ -164,6 +165,7 @@ export function normalizeDetailProvenance(components) {
|
|
|
164
165
|
class: ['methods', 'properties', 'extends', 'implements', 'instantiations', 'references'],
|
|
165
166
|
type: ['properties', 'usedBy', 'implementors'],
|
|
166
167
|
module: ['imports', 'exports', 'symbols'],
|
|
168
|
+
custom_entity: ['attributes'],
|
|
167
169
|
};
|
|
168
170
|
for (const key of arrays[String(kind)] ?? []) {
|
|
169
171
|
if (!Array.isArray(detail[key]))
|
|
@@ -210,6 +212,7 @@ function indexEntryFor(record) {
|
|
|
210
212
|
fileName: `${record.id}.json`,
|
|
211
213
|
source: record.source,
|
|
212
214
|
repo: record.repo,
|
|
215
|
+
gist: record.gist,
|
|
213
216
|
};
|
|
214
217
|
}
|
|
215
218
|
async function readIndex() {
|
|
@@ -290,3 +293,19 @@ export async function createSubsystemModel(doc) {
|
|
|
290
293
|
await upsertIndexEntry(indexEntryFor(record));
|
|
291
294
|
return record;
|
|
292
295
|
}
|
|
296
|
+
/** Patch an existing record (e.g. stamp a host gist ref after share). */
|
|
297
|
+
export async function updateSubsystemModel(id, patch) {
|
|
298
|
+
const existing = await getSubsystemModel(id);
|
|
299
|
+
if (!existing)
|
|
300
|
+
return null;
|
|
301
|
+
if (patch.components !== undefined)
|
|
302
|
+
normalizeDetailProvenance(patch.components);
|
|
303
|
+
const updated = {
|
|
304
|
+
...existing,
|
|
305
|
+
...patch,
|
|
306
|
+
updatedAt: new Date().toISOString(),
|
|
307
|
+
};
|
|
308
|
+
await fs.writeFile(graphPath(id), JSON.stringify(updated, null, 2), 'utf8');
|
|
309
|
+
await upsertIndexEntry(indexEntryFor(updated));
|
|
310
|
+
return updated;
|
|
311
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@principal-ai/principal-studio-cli",
|
|
3
|
-
"version": "0.37.
|
|
3
|
+
"version": "0.37.1",
|
|
4
4
|
"description": "Principal AI CLI — subsystem models, Subsystems Studio, trails, and agent sessions",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@principal-ai/alexandria-core-library": "^0.4.0",
|
|
36
36
|
"@principal-ai/codebase-composition": "^0.2.57",
|
|
37
37
|
"@principal-ai/file-city-builder": "^0.5.0",
|
|
38
|
-
"@principal-ai/subsystems-core": "^0.30.0",
|
|
39
38
|
"@principal-ai/repository-abstraction": "^0.5.7",
|
|
39
|
+
"@principal-ai/subsystems-core": "0.31.4",
|
|
40
40
|
"better-sqlite3": "^13.0.0",
|
|
41
41
|
"chalk": "5.6.2",
|
|
42
42
|
"commander": "14.0.2",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"js-yaml": "4.1.1"
|
|
46
46
|
},
|
|
47
47
|
"optionalDependencies": {
|
|
48
|
-
"@principal-ai/subsystems-studio": "^0.6.
|
|
48
|
+
"@principal-ai/subsystems-studio": "^0.6.7"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/better-sqlite3": "^7.6.13",
|