@vibes.diy/prompts 13.1.15 → 13.1.17

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.
@@ -1 +1,2 @@
1
1
  export declare function buildSchemaSystemMessage(schema: object): Promise<string>;
2
+ export declare function schemaSystemMessageText(schema: object, onDegrade?: (err: Error) => void): Promise<string>;
@@ -6,13 +6,25 @@ async function buildExample(schema) {
6
6
  }
7
7
  return result;
8
8
  }
9
+ function bareSchemaInstruction(schema) {
10
+ return `Return ONLY a JSON object inside a \`\`\`json code fence. Conform to this schema: ${JSON.stringify(schema)}`;
11
+ }
9
12
  export async function buildSchemaSystemMessage(schema) {
10
13
  const example = await buildExample(schema);
11
- return `Return ONLY a JSON object inside a \`\`\`json code fence. Conform to this schema: ${JSON.stringify(schema)}
14
+ return `${bareSchemaInstruction(schema)}
12
15
 
13
16
  Example of expected output:
14
17
  \`\`\`json
15
18
  ${JSON.stringify(example, null, 2)}
16
19
  \`\`\``;
17
20
  }
21
+ export async function schemaSystemMessageText(schema, onDegrade) {
22
+ try {
23
+ return await buildSchemaSystemMessage(schema);
24
+ }
25
+ catch (err) {
26
+ onDegrade?.(err instanceof Error ? err : new Error(String(err)));
27
+ return bareSchemaInstruction(schema);
28
+ }
29
+ }
18
30
  //# sourceMappingURL=build-schema-prompt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-schema-prompt.js","sourceRoot":"","sources":["../jsr/build-schema-prompt.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,QAAQ,EAAmB,MAAM,mBAAmB,CAAC;AAE9D,KAAK,UAAU,YAAY,CAAC,MAAkB;IAC5C,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,EAAE,oBAAoB,EAAE,CAAC,EAAE,CAAC,CAAC;IACnE,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MA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AAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACjE,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;AACH,CAAC"}
package/index.d.ts CHANGED
@@ -9,5 +9,5 @@ export * from "./restyle.js";
9
9
  export * from "./themes/index.js";
10
10
  export { parseContent } from "./segment-parser.js";
11
11
  export { normalizeComponentExports, transformImports, coreImportMap } from "./component-transforms.js";
12
- export { buildSchemaSystemMessage } from "./build-schema-prompt.js";
12
+ export { buildSchemaSystemMessage, schemaSystemMessageText } from "./build-schema-prompt.js";
13
13
  export { allConfigs } from "./llms/index.js";
package/index.js CHANGED
@@ -9,6 +9,6 @@ export * from "./restyle.js";
9
9
  export * from "./themes/index.js";
10
10
  export { parseContent } from "./segment-parser.js";
11
11
  export { normalizeComponentExports, transformImports, coreImportMap } from "./component-transforms.js";
12
- export { buildSchemaSystemMessage } from "./build-schema-prompt.js";
12
+ export { buildSchemaSystemMessage, schemaSystemMessageText } from "./build-schema-prompt.js";
13
13
  export { allConfigs } from "./llms/index.js";
14
14
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../jsr/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAIpE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../jsr/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEvG,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAI7F,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibes.diy/prompts",
3
- "version": "13.1.15",
3
+ "version": "13.1.17",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "description": "",
@@ -24,9 +24,9 @@
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
26
  "@adviser/cement": "~0.5.34",
27
- "@vibes.diy/call-ai-v2": "^13.1.15",
28
- "@vibes.diy/identity": "^13.1.15",
29
- "@vibes.diy/use-vibes-types": "^13.1.15",
27
+ "@vibes.diy/call-ai-v2": "^13.1.17",
28
+ "@vibes.diy/identity": "^13.1.17",
29
+ "@vibes.diy/use-vibes-types": "^13.1.17",
30
30
  "arktype": "~2.2.3",
31
31
  "json-schema-faker": "~0.6.3"
32
32
  },