@guuey/config 0.16.12 → 0.16.15
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/agent.d.ts +1 -0
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +12 -0
- package/dist/loader.d.ts +13 -0
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +83 -16
- package/dist/schema.d.ts +1 -0
- package/dist/schema.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/agent.d.ts
CHANGED
|
@@ -382,6 +382,7 @@ export declare const AgentSectionV1: z.ZodObject<{
|
|
|
382
382
|
}>>>;
|
|
383
383
|
}, z.core.$strict>>>;
|
|
384
384
|
defaultMode: z.ZodOptional<z.ZodString>;
|
|
385
|
+
surfaceHints: z.ZodOptional<z.ZodBoolean>;
|
|
385
386
|
runtime: z.ZodOptional<z.ZodObject<{
|
|
386
387
|
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
387
388
|
temperature: z.ZodOptional<z.ZodNumber>;
|
package/dist/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,6EAKnB,CAAC;AACX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAS/D;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;EAAiC,CAAC;AAClE,uEAAuE;AACvE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAyIhE;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;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;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAmBjF;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,EAAE,CAK3E;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,EAAE,CAoBzE;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAEzE,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,GACvC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAOrC;AAED,kJAAkJ;AAClJ,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,kBAAkB,GAAG,SAAS,GACtC,KAAK,CAAC,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAItC"}
|
package/dist/agent.js
CHANGED
|
@@ -497,6 +497,18 @@ export const AgentSectionV1 = z.strictObject({
|
|
|
497
497
|
modes: ModesSchema.optional(),
|
|
498
498
|
/** The mode a caller with no audience match resolves to (a declared mode key). */
|
|
499
499
|
defaultMode: z.string().min(1).optional(),
|
|
500
|
+
/**
|
|
501
|
+
* The platform wrapper's SURFACE-FORMATTING section (guuey#531) —
|
|
502
|
+
* default ON, opt-out only: a few invoke-constant lines telling the
|
|
503
|
+
* model that guuey's chat surfaces render markdown (code fences +
|
|
504
|
+
* inline code, autolinked bare URLs, native tables), so every builder
|
|
505
|
+
* doesn't have to discover that independently. Set `false` for BYO
|
|
506
|
+
* surfaces (`@guuey/agent-client` custom clients — SMS/voice/
|
|
507
|
+
* plain-text) where markdown is not the contract. The exact text
|
|
508
|
+
* lives at `@guuey/host` `SURFACE_FORMATTING_SECTION` and is
|
|
509
|
+
* published verbatim in the docs — never tone/brand/behavior.
|
|
510
|
+
*/
|
|
511
|
+
surfaceHints: z.boolean().optional(),
|
|
500
512
|
runtime: RuntimeConfigSchema.optional(),
|
|
501
513
|
/** Claude Agent SDK-specific knobs. Only read when `framework: 'claude-agent-sdk'`. */
|
|
502
514
|
claude: ClaudeFrameworkConfigSchema.optional(),
|
package/dist/loader.d.ts
CHANGED
|
@@ -52,6 +52,19 @@ export interface ResolvedGuueyJson {
|
|
|
52
52
|
* (guuey#400), or `undefined` when no theme was set.
|
|
53
53
|
*/
|
|
54
54
|
resolvedTheme: GuueyAppTheme | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Resolved per-mode prompts (guuey#545): for every `agent.modes[key]`
|
|
57
|
+
* whose `systemPrompt` / `systemPromptAppend` is present, the FINAL
|
|
58
|
+
* string — the inline value as-is, or the file contents when it was a
|
|
59
|
+
* `{ file: '...' }` reference. Before this, a file-shaped mode prompt
|
|
60
|
+
* rode into the snapshot unresolved and reached the pod (which has no
|
|
61
|
+
* repo filesystem) — a silently broken deploy. `undefined` when the
|
|
62
|
+
* document declares no modes.
|
|
63
|
+
*/
|
|
64
|
+
resolvedModePrompts: Record<string, {
|
|
65
|
+
systemPrompt?: string;
|
|
66
|
+
systemPromptAppend?: string;
|
|
67
|
+
}> | undefined;
|
|
55
68
|
/** Absolute path the document was loaded from (for diagnostics). */
|
|
56
69
|
sourcePath: string;
|
|
57
70
|
}
|
package/dist/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AA0BA,OAAO,EAEL,WAAW,EAGZ,MAAM,aAAa,CAAC;AAErB,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAE5D,wEAAwE;AACxE,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,GAAE,MAAsB,EAChC,QAAQ,GAAE,MAA+B,GACxC,MAAM,GAAG,IAAI,CAUf;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAgB3D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CAIvE;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,oCAAoC;IACpC,GAAG,EAAE,WAAW,CAAC;IACjB;;;;;OAKG;IACH,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC;;;;OAIG;IACH,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IACzC;;;;;;;;OAQG;IACH,mBAAmB,EACf,MAAM,CAAC,MAAM,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GACtE,SAAS,CAAC;IACd,oEAAoE;IACpE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAY7D;AA2JD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG,WAAW,CAiC1E"}
|
package/dist/loader.js
CHANGED
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
* Pure-parse helpers (`parseGuueyJson` / `safeParseGuueyJson`) live in
|
|
5
5
|
* `./schema.ts` and are safe to import from non-Node contexts. This
|
|
6
6
|
* module adds the file-resolution layer: reading `guuey.json` from disk,
|
|
7
|
-
* inlining `agent.systemPrompt.file`
|
|
8
|
-
*
|
|
7
|
+
* inlining `agent.systemPrompt.file` AND every
|
|
8
|
+
* `agent.modes[*].{systemPrompt,systemPromptAppend}.file` reference
|
|
9
|
+
* (guuey#545 — a file-shaped mode prompt used to ride into the snapshot
|
|
10
|
+
* unresolved), and producing the snapshot the deploy upload + pod boot
|
|
11
|
+
* both read.
|
|
9
12
|
*
|
|
10
13
|
* Intended callers:
|
|
11
14
|
*
|
|
@@ -103,7 +106,64 @@ export function loadGuueyJson(path) {
|
|
|
103
106
|
const doc = readGuueyJsonFile(path);
|
|
104
107
|
const resolvedSystemPrompt = resolveSystemPrompt(doc, path);
|
|
105
108
|
const resolvedTheme = resolveAppTheme(doc, path);
|
|
106
|
-
|
|
109
|
+
const resolvedModePrompts = resolveModePrompts(doc, path);
|
|
110
|
+
return {
|
|
111
|
+
doc,
|
|
112
|
+
resolvedSystemPrompt,
|
|
113
|
+
resolvedTheme,
|
|
114
|
+
resolvedModePrompts,
|
|
115
|
+
sourcePath: path,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Shared relative-file guard + read for prompt `{ file }` references
|
|
120
|
+
* (guuey#545 extraction — the base prompt, and now every mode prompt,
|
|
121
|
+
* enforce the identical rules): the path must be relative, must not
|
|
122
|
+
* traverse parent directories, and must exist. `label` names the field
|
|
123
|
+
* in every error so the failure reads like the document, not the loader.
|
|
124
|
+
*/
|
|
125
|
+
function readPromptFileRef(label, file, guueyJsonPath) {
|
|
126
|
+
if (isAbsolute(file)) {
|
|
127
|
+
throw new Error(`${label} must be a relative path (got absolute: ${file})`);
|
|
128
|
+
}
|
|
129
|
+
if (file.split('/').includes('..')) {
|
|
130
|
+
throw new Error(`${label} must not traverse parent directories (got: ${file})`);
|
|
131
|
+
}
|
|
132
|
+
const resolved = resolve(dirname(guueyJsonPath), file);
|
|
133
|
+
if (!existsSync(resolved)) {
|
|
134
|
+
throw new Error(`${label} references missing file: ${file} (resolved to ${resolved})`);
|
|
135
|
+
}
|
|
136
|
+
return readFileSync(resolved, 'utf-8');
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Resolve every mode's `systemPrompt` / `systemPromptAppend` to final
|
|
140
|
+
* strings (guuey#545). Inline strings pass through; `{ file }` references
|
|
141
|
+
* resolve under {@link readPromptFileRef}'s guards — the SAME contract as
|
|
142
|
+
* the base prompt, which the ModeSchema doc always promised. Absent
|
|
143
|
+
* modes → undefined.
|
|
144
|
+
*/
|
|
145
|
+
function resolveModePrompts(doc, guueyJsonPath) {
|
|
146
|
+
const modes = doc.agent.modes;
|
|
147
|
+
if (modes === undefined)
|
|
148
|
+
return undefined;
|
|
149
|
+
const out = {};
|
|
150
|
+
for (const [key, mode] of Object.entries(modes)) {
|
|
151
|
+
const entry = {};
|
|
152
|
+
if (mode.systemPrompt !== undefined) {
|
|
153
|
+
entry.systemPrompt =
|
|
154
|
+
typeof mode.systemPrompt === 'string'
|
|
155
|
+
? mode.systemPrompt
|
|
156
|
+
: readPromptFileRef(`agent.modes.${key}.systemPrompt.file`, mode.systemPrompt.file, guueyJsonPath);
|
|
157
|
+
}
|
|
158
|
+
if (mode.systemPromptAppend !== undefined) {
|
|
159
|
+
entry.systemPromptAppend =
|
|
160
|
+
typeof mode.systemPromptAppend === 'string'
|
|
161
|
+
? mode.systemPromptAppend
|
|
162
|
+
: readPromptFileRef(`agent.modes.${key}.systemPromptAppend.file`, mode.systemPromptAppend.file, guueyJsonPath);
|
|
163
|
+
}
|
|
164
|
+
out[key] = entry;
|
|
165
|
+
}
|
|
166
|
+
return out;
|
|
107
167
|
}
|
|
108
168
|
/**
|
|
109
169
|
* Resolve `agent.systemPrompt` to a final string (or undefined).
|
|
@@ -122,19 +182,8 @@ function resolveSystemPrompt(doc, guueyJsonPath) {
|
|
|
122
182
|
return undefined;
|
|
123
183
|
if (typeof sp === 'string')
|
|
124
184
|
return sp;
|
|
125
|
-
// sp = { file: '...' }
|
|
126
|
-
|
|
127
|
-
throw new Error(`agent.systemPrompt.file must be a relative path (got absolute: ${sp.file})`);
|
|
128
|
-
}
|
|
129
|
-
if (sp.file.split('/').includes('..')) {
|
|
130
|
-
throw new Error(`agent.systemPrompt.file must not traverse parent directories (got: ${sp.file})`);
|
|
131
|
-
}
|
|
132
|
-
const baseDir = dirname(guueyJsonPath);
|
|
133
|
-
const resolved = resolve(baseDir, sp.file);
|
|
134
|
-
if (!existsSync(resolved)) {
|
|
135
|
-
throw new Error(`agent.systemPrompt.file references missing file: ${sp.file} (resolved to ${resolved})`);
|
|
136
|
-
}
|
|
137
|
-
return readFileSync(resolved, 'utf-8');
|
|
185
|
+
// sp = { file: '...' } — shared guard+read (guuey#545 extraction).
|
|
186
|
+
return readPromptFileRef('agent.systemPrompt.file', sp.file, guueyJsonPath);
|
|
138
187
|
}
|
|
139
188
|
/**
|
|
140
189
|
* Resolve `app.theme` to the inline document (or undefined).
|
|
@@ -198,6 +247,24 @@ export function buildDeploySnapshot(loaded) {
|
|
|
198
247
|
if (loaded.resolvedSystemPrompt !== undefined) {
|
|
199
248
|
cloned.agent.systemPrompt = loaded.resolvedSystemPrompt;
|
|
200
249
|
}
|
|
250
|
+
// guuey#545 — mode prompts inline the same way the base prompt does:
|
|
251
|
+
// a `{ file }` reference must never ride into the snapshot (the pod
|
|
252
|
+
// has no repo filesystem; an unresolved object was a silently broken
|
|
253
|
+
// deploy). Only prompt fields are touched — tools/audience and every
|
|
254
|
+
// unexposed mode key survive verbatim.
|
|
255
|
+
if (loaded.resolvedModePrompts !== undefined && cloned.agent.modes !== undefined) {
|
|
256
|
+
for (const [key, resolved] of Object.entries(loaded.resolvedModePrompts)) {
|
|
257
|
+
const mode = cloned.agent.modes[key];
|
|
258
|
+
if (mode === undefined)
|
|
259
|
+
continue;
|
|
260
|
+
if (resolved.systemPrompt !== undefined) {
|
|
261
|
+
mode.systemPrompt = resolved.systemPrompt;
|
|
262
|
+
}
|
|
263
|
+
if (resolved.systemPromptAppend !== undefined) {
|
|
264
|
+
mode.systemPromptAppend = resolved.systemPromptAppend;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
201
268
|
const theme = cloned.app?.theme;
|
|
202
269
|
if (cloned.app !== undefined &&
|
|
203
270
|
theme !== undefined &&
|
package/dist/schema.d.ts
CHANGED
|
@@ -207,6 +207,7 @@ export declare const GuueyJsonV1: z.ZodObject<{
|
|
|
207
207
|
}>>>;
|
|
208
208
|
}, z.core.$strict>>>;
|
|
209
209
|
defaultMode: z.ZodOptional<z.ZodString>;
|
|
210
|
+
surfaceHints: z.ZodOptional<z.ZodBoolean>;
|
|
210
211
|
runtime: z.ZodOptional<z.ZodObject<{
|
|
211
212
|
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
212
213
|
temperature: z.ZodOptional<z.ZodNumber>;
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAiB,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,sBAAsB,GAC9B;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,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;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,CAExD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,OAAO,GACX,UAAU,CAAC,OAAO,WAAW,CAAC,SAAS,CAAC,CAE1C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guuey/config",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.15",
|
|
4
4
|
"description": "Open-source schemas + loaders for the three guuey config files: agent.json (declarative agent definition), guuey.json (hosted-deploy overlay), and the helper types around them. Consumed by @guuey/cli, the guuey backend, and devs writing their own agent or MCP server.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@types/node": "^24.0.0",
|
|
36
36
|
"typescript": "^5.0.0",
|
|
37
37
|
"vitest": "^3.2.7",
|
|
38
|
-
"@guuey/chat": "0.16.
|
|
38
|
+
"@guuey/chat": "0.16.15"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|