@ggui-ai/cli 0.22.0 → 0.23.0
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/api-client.d.ts +4 -2
- package/dist/api-client.d.ts.map +1 -1
- package/dist/config-push.d.ts +23 -21
- package/dist/config-push.d.ts.map +1 -1
- package/dist/config-push.js +44 -8
- package/package.json +17 -17
package/dist/api-client.d.ts
CHANGED
|
@@ -91,10 +91,12 @@ export interface PatchAppConfigResponse {
|
|
|
91
91
|
export declare function patchAppConfig(appId: string, patch: {
|
|
92
92
|
gadgets?: GadgetDescriptor[];
|
|
93
93
|
publicEnv?: Record<string, string>;
|
|
94
|
+
/** `null` clears the app's stored generation route. */
|
|
94
95
|
generation?: {
|
|
95
96
|
model: string;
|
|
96
97
|
keySource: 'own' | 'managed';
|
|
97
|
-
};
|
|
98
|
-
theme
|
|
98
|
+
} | null;
|
|
99
|
+
/** `null` clears the app's stored theme. */
|
|
100
|
+
theme?: AppTheme | null;
|
|
99
101
|
}): Promise<PatchAppConfigResponse>;
|
|
100
102
|
//# sourceMappingURL=api-client.d.ts.map
|
package/dist/api-client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAMpE,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,yBAAyB,EAAE,MAAM,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAAC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DAAuD;IACvD,UAAU,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,KAAK,GAAG,SAAS,CAAA;KAAE,GAAG,IAAI,CAAC;IACpE,4CAA4C;IAC5C,KAAK,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CACzB,GACA,OAAO,CAAC,sBAAsB,CAAC,CAUjC"}
|
package/dist/config-push.d.ts
CHANGED
|
@@ -14,24 +14,38 @@ export declare function readPublicEnvFromGguiJson(gguiJson: unknown): Record<str
|
|
|
14
14
|
* re-validates via `parseAnyLlmRoute` server-side; the CLI just forwards.
|
|
15
15
|
*
|
|
16
16
|
* Returns `{ model, keySource }` when `generation.model` is present.
|
|
17
|
+
* Returns `null` for an explicit `"generation": null` — the deploy clears
|
|
18
|
+
* the app's stored generation route (`generation: null` on the wire).
|
|
17
19
|
* Returns `undefined` when the generation block is absent or has no model —
|
|
18
|
-
* the deploy then leaves the app's generation untouched
|
|
19
|
-
* `generation: null` on the wire is the only clear; `ggui.json` has no null
|
|
20
|
-
* form for the block, so this reader never emits one).
|
|
20
|
+
* the deploy then leaves the app's generation untouched.
|
|
21
21
|
* Throws when the generation block is structurally invalid.
|
|
22
22
|
*/
|
|
23
23
|
export declare function readGenerationFromGguiJson(gguiJson: unknown): {
|
|
24
24
|
model: string;
|
|
25
25
|
keySource: 'own' | 'managed';
|
|
26
|
-
} | undefined;
|
|
26
|
+
} | null | undefined;
|
|
27
|
+
/** What `ggui.json#theme` resolves to for a deploy. */
|
|
28
|
+
export interface ThemeRead {
|
|
29
|
+
/** The projection the PATCH ships. */
|
|
30
|
+
readonly theme: AppTheme;
|
|
31
|
+
/**
|
|
32
|
+
* The families the document's `typography.faces` declare, deduped in
|
|
33
|
+
* declaration order. The hosted path does not deliver them yet
|
|
34
|
+
* (ggui#990): the deploy names them so the fallback is visible, not
|
|
35
|
+
* silent.
|
|
36
|
+
*/
|
|
37
|
+
readonly declaredFaceFamilies: readonly string[];
|
|
38
|
+
}
|
|
27
39
|
/**
|
|
28
40
|
* Resolve the developer's local `ggui.json#theme` into a concrete,
|
|
29
41
|
* injection-safe {@link AppTheme} ready to PATCH to the cloud.
|
|
30
42
|
*
|
|
31
|
-
* Returns `undefined` when no `theme` field is declared
|
|
32
|
-
* app's theme untouched
|
|
33
|
-
*
|
|
34
|
-
*
|
|
43
|
+
* Returns `undefined` when no `theme` field is declared: the deploy leaves
|
|
44
|
+
* the app's theme untouched.
|
|
45
|
+
*
|
|
46
|
+
* Returns `null` for an explicit `"theme": null`: the deploy clears the
|
|
47
|
+
* app's stored theme (`theme: null` on the wire). A clear needs nothing else
|
|
48
|
+
* from the file, so the manifest is not parsed.
|
|
35
49
|
*
|
|
36
50
|
* When a theme IS declared we parse the FULL manifest (via `parseGguiJson`)
|
|
37
51
|
* — `loadTheme` requires the typed `GguiJsonV1` shape and resolves relative
|
|
@@ -44,19 +58,7 @@ export declare function readGenerationFromGguiJson(gguiJson: unknown): {
|
|
|
44
58
|
* backend enforces, so a deploy fails loud LOCALLY rather than with a
|
|
45
59
|
* confusing 422.
|
|
46
60
|
*/
|
|
47
|
-
|
|
48
|
-
export interface ThemeRead {
|
|
49
|
-
/** The projection the PATCH ships. */
|
|
50
|
-
readonly theme: AppTheme;
|
|
51
|
-
/**
|
|
52
|
-
* The families the document's `typography.faces` declare, deduped in
|
|
53
|
-
* declaration order. The hosted path does not deliver them yet
|
|
54
|
-
* (ggui#990): the deploy names them so the fallback is visible, not
|
|
55
|
-
* silent.
|
|
56
|
-
*/
|
|
57
|
-
readonly declaredFaceFamilies: readonly string[];
|
|
58
|
-
}
|
|
59
|
-
export declare function readThemeFromGguiJson(projectRoot: string, gguiJson: unknown): Promise<ThemeRead | undefined>;
|
|
61
|
+
export declare function readThemeFromGguiJson(projectRoot: string, gguiJson: unknown): Promise<ThemeRead | null | undefined>;
|
|
60
62
|
/**
|
|
61
63
|
* Assert that none of the gadget bundle references point at a loopback host.
|
|
62
64
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-push.d.ts","sourceRoot":"","sources":["../src/config-push.ts"],"names":[],"mappings":"AAUA,OAAO,EAKL,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACd,MAAM,mBAAmB,CAAC;AAmB3B;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAmBnF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,OAAO,GAChB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,KAAK,GAAG,SAAS,CAAA;CAAE,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"config-push.d.ts","sourceRoot":"","sources":["../src/config-push.ts"],"names":[],"mappings":"AAUA,OAAO,EAKL,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACd,MAAM,mBAAmB,CAAC;AAmB3B;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAmBnF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,OAAO,GAChB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,KAAK,GAAG,SAAS,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,CAoBpE;AAGD,uDAAuD;AACvD,MAAM,WAAW,SAAS;IACxB,sCAAsC;IACtC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,oBAAoB,EAAE,SAAS,MAAM,EAAE,CAAC;CAClD;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC,CA2DvC;AAMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAiB9E;AAMD;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,MAAM,EACb,QAAQ,GAAE,MAAsB,GAC/B,OAAO,CAAC,MAAM,CAAC,CAgHjB"}
|
package/dist/config-push.js
CHANGED
|
@@ -52,10 +52,10 @@ export function readPublicEnvFromGguiJson(gguiJson) {
|
|
|
52
52
|
* re-validates via `parseAnyLlmRoute` server-side; the CLI just forwards.
|
|
53
53
|
*
|
|
54
54
|
* Returns `{ model, keySource }` when `generation.model` is present.
|
|
55
|
+
* Returns `null` for an explicit `"generation": null` — the deploy clears
|
|
56
|
+
* the app's stored generation route (`generation: null` on the wire).
|
|
55
57
|
* Returns `undefined` when the generation block is absent or has no model —
|
|
56
|
-
* the deploy then leaves the app's generation untouched
|
|
57
|
-
* `generation: null` on the wire is the only clear; `ggui.json` has no null
|
|
58
|
-
* form for the block, so this reader never emits one).
|
|
58
|
+
* the deploy then leaves the app's generation untouched.
|
|
59
59
|
* Throws when the generation block is structurally invalid.
|
|
60
60
|
*/
|
|
61
61
|
export function readGenerationFromGguiJson(gguiJson) {
|
|
@@ -65,25 +65,52 @@ export function readGenerationFromGguiJson(gguiJson) {
|
|
|
65
65
|
model: z.string().min(1).optional(),
|
|
66
66
|
keySource: z.enum(['own', 'managed']).optional(),
|
|
67
67
|
})
|
|
68
|
+
.nullable()
|
|
68
69
|
.optional(),
|
|
69
70
|
});
|
|
70
71
|
const result = schema.safeParse(gguiJson);
|
|
71
72
|
if (!result.success) {
|
|
72
73
|
throw new Error(`ggui.json: generation is invalid — ${result.error.issues[0]?.message ?? 'malformed generation block'}`);
|
|
73
74
|
}
|
|
75
|
+
if (result.data.generation === null)
|
|
76
|
+
return null;
|
|
74
77
|
const model = result.data.generation?.model;
|
|
75
78
|
if (!model)
|
|
76
79
|
return undefined;
|
|
77
80
|
return { model, keySource: result.data.generation?.keySource ?? 'managed' };
|
|
78
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Resolve the developer's local `ggui.json#theme` into a concrete,
|
|
84
|
+
* injection-safe {@link AppTheme} ready to PATCH to the cloud.
|
|
85
|
+
*
|
|
86
|
+
* Returns `undefined` when no `theme` field is declared: the deploy leaves
|
|
87
|
+
* the app's theme untouched.
|
|
88
|
+
*
|
|
89
|
+
* Returns `null` for an explicit `"theme": null`: the deploy clears the
|
|
90
|
+
* app's stored theme (`theme: null` on the wire). A clear needs nothing else
|
|
91
|
+
* from the file, so the manifest is not parsed.
|
|
92
|
+
*
|
|
93
|
+
* When a theme IS declared we parse the FULL manifest (via `parseGguiJson`)
|
|
94
|
+
* — `loadTheme` requires the typed `GguiJsonV1` shape and resolves relative
|
|
95
|
+
* `theme.file` paths against `projectRoot`, so a partial slice will not do.
|
|
96
|
+
*
|
|
97
|
+
* Throws with a clear, local message when:
|
|
98
|
+
* - the manifest is structurally invalid (so deploy fails before the wire);
|
|
99
|
+
* - the theme cannot be loaded (e.g. an unregistered preset id);
|
|
100
|
+
* - the resolved overlay fails `appThemeSchema` — the SAME validator the
|
|
101
|
+
* backend enforces, so a deploy fails loud LOCALLY rather than with a
|
|
102
|
+
* confusing 422.
|
|
103
|
+
*/
|
|
79
104
|
export async function readThemeFromGguiJson(projectRoot, gguiJson) {
|
|
80
105
|
// Cheap pre-check on the raw value: no `theme` field → nothing to push,
|
|
81
|
-
//
|
|
106
|
+
// `null` → a clear; either way no full-manifest parse.
|
|
82
107
|
const presence = z
|
|
83
108
|
.object({ theme: z.unknown().optional() })
|
|
84
109
|
.safeParse(gguiJson);
|
|
85
110
|
if (!presence.success || presence.data.theme === undefined)
|
|
86
111
|
return undefined;
|
|
112
|
+
if (presence.data.theme === null)
|
|
113
|
+
return null;
|
|
87
114
|
// A theme is declared — `loadTheme` needs the fully-typed manifest.
|
|
88
115
|
let manifest;
|
|
89
116
|
try {
|
|
@@ -184,6 +211,7 @@ export async function runConfigPushStep(appId, startDir = process.cwd()) {
|
|
|
184
211
|
return 1;
|
|
185
212
|
}
|
|
186
213
|
let publicEnv;
|
|
214
|
+
// `null` = the deploy's explicit clear; `undefined` = leave it untouched.
|
|
187
215
|
let generation;
|
|
188
216
|
let theme;
|
|
189
217
|
const gadgetsRead = readGadgetsFromGguiJson(readResult.value);
|
|
@@ -210,8 +238,8 @@ export async function runConfigPushStep(appId, startDir = process.cwd()) {
|
|
|
210
238
|
// `loadTheme` resolves relative `theme.file` paths against the directory
|
|
211
239
|
// containing ggui.json — the same root convention `storage.*.path` uses.
|
|
212
240
|
const read = await readThemeFromGguiJson(dirname(gguiJsonPath), readResult.value);
|
|
213
|
-
theme = read?.theme;
|
|
214
|
-
if (read
|
|
241
|
+
theme = read === null ? null : read?.theme;
|
|
242
|
+
if (read != null && read.declaredFaceFamilies.length > 0) {
|
|
215
243
|
// ggui#990/#1093: the PATCH now CARRIES the faces (`AppTheme.fonts`)
|
|
216
244
|
// and a server on this release inlines them in the shell it serves.
|
|
217
245
|
// A deployment still running an older release cannot — so the deploy
|
|
@@ -248,8 +276,16 @@ export async function runConfigPushStep(appId, startDir = process.cwd()) {
|
|
|
248
276
|
const envLine = Object.keys(publicEnv).length > 0
|
|
249
277
|
? ` + ${Object.keys(publicEnv).length} publicEnv key(s)`
|
|
250
278
|
: '';
|
|
251
|
-
const generationLine = generation
|
|
252
|
-
|
|
279
|
+
const generationLine = generation === null
|
|
280
|
+
? ' + generation cleared'
|
|
281
|
+
: generation !== undefined
|
|
282
|
+
? ` + model ${generation.model}`
|
|
283
|
+
: '';
|
|
284
|
+
const themeLine = theme === null
|
|
285
|
+
? ' + theme cleared'
|
|
286
|
+
: theme !== undefined
|
|
287
|
+
? ` + theme ${theme.name ?? theme.mode}`
|
|
288
|
+
: '';
|
|
253
289
|
process.stdout.write(` ${gadgetLine}${envLine}${generationLine}${themeLine}\n`);
|
|
254
290
|
return 0;
|
|
255
291
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ggui-ai/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "The `ggui` CLI — run the ggui protocol locally: dev server, self-hosted MCP server, and gadget / blueprint authoring. End-to-end OSS and self-hosted workflows; no account required.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ggui",
|
|
@@ -37,22 +37,22 @@
|
|
|
37
37
|
"@noble/hashes": "^1.6.0",
|
|
38
38
|
"esbuild": "^0.28.2",
|
|
39
39
|
"zod": "^4.3.6",
|
|
40
|
-
"@ggui-ai/agent-runtime": "0.
|
|
41
|
-
"@ggui-ai/
|
|
42
|
-
"@ggui-ai/
|
|
43
|
-
"@ggui-ai/
|
|
44
|
-
"@ggui-ai/gadget-signing": "0.
|
|
45
|
-
"@ggui-ai/embedding-local": "0.
|
|
46
|
-
"@ggui-ai/mcp-server
|
|
47
|
-
"@ggui-ai/mcp-server": "0.
|
|
48
|
-
"@ggui-ai/
|
|
49
|
-
"@ggui-ai/
|
|
50
|
-
"@ggui-ai/
|
|
51
|
-
"@ggui-ai/
|
|
52
|
-
"@ggui-ai/
|
|
53
|
-
"@ggui-ai/
|
|
54
|
-
"@ggui-ai/
|
|
55
|
-
"@ggui-ai/ui-registry": "0.
|
|
40
|
+
"@ggui-ai/agent-runtime": "0.23.0",
|
|
41
|
+
"@ggui-ai/artifact-manifest": "0.23.0",
|
|
42
|
+
"@ggui-ai/design": "0.23.0",
|
|
43
|
+
"@ggui-ai/dev-stack": "0.23.0",
|
|
44
|
+
"@ggui-ai/gadget-signing": "0.23.0",
|
|
45
|
+
"@ggui-ai/embedding-local": "0.23.0",
|
|
46
|
+
"@ggui-ai/mcp-server": "0.23.0",
|
|
47
|
+
"@ggui-ai/mcp-server-handlers": "0.23.0",
|
|
48
|
+
"@ggui-ai/preview-a2ui": "0.23.0",
|
|
49
|
+
"@ggui-ai/project-config": "0.23.0",
|
|
50
|
+
"@ggui-ai/protocol": "0.23.0",
|
|
51
|
+
"@ggui-ai/iframe-runtime": "0.23.0",
|
|
52
|
+
"@ggui-ai/ui-gen": "0.23.0",
|
|
53
|
+
"@ggui-ai/mcp-server-core": "0.23.0",
|
|
54
|
+
"@ggui-ai/registry-core": "0.23.0",
|
|
55
|
+
"@ggui-ai/ui-registry": "0.23.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/node": "^24.0.0",
|