promptopskit 0.3.0 → 0.3.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 +23 -0
- package/SKILL.md +49 -0
- package/dist/{chunk-PU3UPUND.js → chunk-DDXFDVA6.js} +4 -4
- package/dist/{chunk-PU3UPUND.js.map → chunk-DDXFDVA6.js.map} +1 -1
- package/dist/chunk-DGFBS7YW.js +101 -0
- package/dist/chunk-DGFBS7YW.js.map +1 -0
- package/dist/{chunk-5BI5FP5L.js → chunk-LNZS3TIJ.js} +21 -18
- package/dist/chunk-LNZS3TIJ.js.map +1 -0
- package/dist/{chunk-VYVEVJC3.js → chunk-LRRSI4ON.js} +25 -22
- package/dist/chunk-LRRSI4ON.js.map +1 -0
- package/dist/chunk-Y2YYEGOY.js +86 -0
- package/dist/chunk-Y2YYEGOY.js.map +1 -0
- package/dist/cli/index.js +44 -20
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +80 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +12 -39
- package/dist/index.js.map +1 -1
- package/dist/providers/anthropic.cjs +64 -19
- package/dist/providers/anthropic.cjs.map +1 -1
- package/dist/providers/anthropic.d.cts +2 -2
- package/dist/providers/anthropic.d.ts +2 -2
- package/dist/providers/anthropic.js +2 -2
- package/dist/providers/gemini.cjs +60 -15
- package/dist/providers/gemini.cjs.map +1 -1
- package/dist/providers/gemini.d.cts +2 -2
- package/dist/providers/gemini.d.ts +2 -2
- package/dist/providers/gemini.js +2 -2
- package/dist/providers/openai.cjs +64 -19
- package/dist/providers/openai.cjs.map +1 -1
- package/dist/providers/openai.d.cts +2 -2
- package/dist/providers/openai.d.ts +2 -2
- package/dist/providers/openai.js +2 -2
- package/dist/providers/openrouter.cjs +66 -21
- package/dist/providers/openrouter.cjs.map +1 -1
- package/dist/providers/openrouter.d.cts +2 -2
- package/dist/providers/openrouter.d.ts +2 -2
- package/dist/providers/openrouter.js +3 -3
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{types-1zDDD-Ij.d.cts → types-BsYdPHTU.d.ts} +5 -2
- package/dist/{types-CQhlfAnR.d.ts → types-DC-jI6iV.d.cts} +5 -2
- package/dist/usagetap/index.d.cts +2 -2
- package/dist/usagetap/index.d.ts +2 -2
- package/package.json +1 -1
- package/dist/chunk-5BI5FP5L.js.map +0 -1
- package/dist/chunk-6KGBPHSY.js +0 -56
- package/dist/chunk-6KGBPHSY.js.map +0 -1
- package/dist/chunk-UYTUGV7Z.js +0 -83
- package/dist/chunk-UYTUGV7Z.js.map +0 -1
- package/dist/chunk-VYVEVJC3.js.map +0 -1
- package/dist/{schema-DIOA4OiO.d.cts → schema-Dq0jKest.d.cts} +42 -42
- package/dist/{schema-DIOA4OiO.d.ts → schema-Dq0jKest.d.ts} +42 -42
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/providers/gemini.ts"],"sourcesContent":["import type { ResolvedPromptAsset } from '../schema/index.js';\nimport type {\n ProviderAdapter,\n ProviderRequest,\n ValidationResult,\n RuntimeRenderOptions,\n} from './types.js';\nimport { renderSections } from '../renderer/index.js';\n\n/**\n * Google Gemini provider adapter.\n * Produces request bodies compatible with the Gemini generateContent API.\n */\nexport const geminiAdapter: ProviderAdapter = {\n name: 'gemini',\n\n validate(asset: ResolvedPromptAsset): ValidationResult {\n const errors: string[] = [];\n const warnings: string[] = [];\n\n if (!asset.model) {\n errors.push('Gemini adapter requires a model to be specified.');\n }\n\n if (asset.sampling?.frequency_penalty !== undefined) {\n warnings.push('Gemini does not support frequency_penalty. It will be ignored.');\n }\n if (asset.sampling?.presence_penalty !== undefined) {\n warnings.push('Gemini does not support presence_penalty. It will be ignored.');\n }\n\n return { valid: errors.length === 0, errors, warnings };\n },\n\n render(asset: ResolvedPromptAsset, runtime: RuntimeRenderOptions): ProviderRequest {\n const sections = renderSections(asset, {\n variables: runtime.variables,\n strict: runtime.strict,\n });\n\n const contents: Array<Record<string, unknown>> = [];\n\n // History\n if (runtime.history) {\n for (const msg of runtime.history) {\n contents.push({\n role: msg.role === 'assistant' ? 'model' : 'user',\n parts: [{ text: msg.content }],\n });\n }\n }\n\n // User message (prompt template)\n if (sections.prompt_template) {\n contents.push({\n role: 'user',\n parts: [{ text: sections.prompt_template }],\n });\n }\n\n const body: Record<string, unknown> = {\n contents,\n };\n\n // System instruction\n if (sections.system_instructions) {\n body.systemInstruction = {\n parts: [{ text: sections.system_instructions }],\n };\n }\n\n // Generation config\n const generationConfig: Record<string, unknown> = {};\n\n if (asset.sampling?.temperature !== undefined) generationConfig.temperature = asset.sampling.temperature;\n if (asset.sampling?.top_p !== undefined) generationConfig.topP = asset.sampling.top_p;\n if (asset.sampling?.max_output_tokens !== undefined) generationConfig.maxOutputTokens = asset.sampling.max_output_tokens;\n if (asset.sampling?.stop !== undefined) generationConfig.stopSequences = asset.sampling.stop;\n\n if (asset.response?.format === 'json') {\n generationConfig.responseMimeType = 'application/json';\n }\n\n // Thinking config\n if (asset.reasoning?.effort) {\n body.thinkingConfig = {\n thinkingBudget: asset.reasoning.effort === 'high' ? 8192 : asset.reasoning.effort === 'medium' ? 4096 : 1024,\n };\n }\n\n if (Object.keys(generationConfig).length > 0) {\n body.generationConfig = generationConfig;\n }\n\n // Tools\n if (asset.tools && asset.tools.length > 0) {\n const functionDeclarations = asset.tools.map((tool) => {\n if (typeof tool === 'string') {\n const def = runtime.toolRegistry?.[tool];\n if (def) return def;\n return { name: tool };\n }\n return {\n name: tool.name,\n description: tool.description,\n parameters: tool.input_schema,\n };\n });\n body.tools = [{ functionDeclarations }];\n }\n\n return {\n body,\n provider: 'gemini',\n model: asset.model ?? 'unknown',\n };\n },\n};\n"],"mappings":";;;;;AAaO,IAAM,gBAAiC;AAAA,EAC5C,MAAM;AAAA,EAEN,SAAS,OAA8C;AACrD,UAAM,SAAmB,CAAC;AAC1B,UAAM,WAA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M,UAAU,SAAS,OAAW,kBAAiB,gBAAgB,MAAM,SAAS;AAExF,QAAI,MAAM,UAAU,WAAW,QAAQ;AACrC,uBAAiB,mBAAmB;AAAA,IACtC;AAGA,QAAI,MAAM,WAAW,QAAQ;AAC3B,WAAK,iBAAiB;AAAA,QACpB,gBAAgB,MAAM,UAAU,WAAW,SAAS,OAAO,MAAM,UAAU,WAAW,WAAW,OAAO;AAAA,MAC1G;AAAA,IACF;AAEA,QAAI,OAAO,KAAK,gBAAgB,EAAE,SAAS,GAAG;AAC5C,WAAK,mBAAmB;AAAA,IAC1B;AAGA,QAAI,MAAM,SAAS,MAAM,MAAM,SAAS,GAAG;AACzC,YAAM,uBAAuB,MAAM,MAAM,IAAI,CAAC,SAAS;AACrD,YAAI,OAAO,SAAS,UAAU;AAC5B,gBAAM,MAAM,QAAQ,eAAe,IAAI;AACvC,cAAI,IAAK,QAAO;AAChB,iBAAO,EAAE,MAAM,KAAK;AAAA,QACtB;AACA,eAAO;AAAA,UACL,MAAM,KAAK;AAAA,UACX,aAAa,KAAK;AAAA,UAClB,YAAY,KAAK;AAAA,QACnB;AAAA,MACF,CAAC;AACD,WAAK,QAAQ,CAAC,EAAE,qBAAqB,CAAC;AAAA,IACxC;AAEA,WAAO;AAAA,MACL;AAAA,MACA,UAAU;AAAA,MACV,OAAO,MAAM,SAAS;AAAA,IACxB;AAAA,EACF;AACF;","names":[]}
|
package/dist/chunk-6KGBPHSY.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// src/renderer/interpolate.ts
|
|
2
|
-
var VARIABLE_RE = /\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}/g;
|
|
3
|
-
var ESCAPED_OPEN = /\\\{\\\{/g;
|
|
4
|
-
var ESCAPE_PLACEHOLDER = "\0ESCAPED_OPEN\0";
|
|
5
|
-
function interpolate(template, variables, options = {}) {
|
|
6
|
-
const { strict = false } = options;
|
|
7
|
-
let result = template.replace(ESCAPED_OPEN, ESCAPE_PLACEHOLDER);
|
|
8
|
-
result = result.replace(VARIABLE_RE, (match, name) => {
|
|
9
|
-
if (name in variables) {
|
|
10
|
-
return variables[name];
|
|
11
|
-
}
|
|
12
|
-
if (strict) {
|
|
13
|
-
throw new Error(`Missing required variable: "${name}"`);
|
|
14
|
-
}
|
|
15
|
-
return match;
|
|
16
|
-
});
|
|
17
|
-
result = result.replaceAll(ESCAPE_PLACEHOLDER, "{{");
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
function extractVariables(template) {
|
|
21
|
-
const vars = /* @__PURE__ */ new Set();
|
|
22
|
-
let match;
|
|
23
|
-
const re = new RegExp(VARIABLE_RE.source, "g");
|
|
24
|
-
while ((match = re.exec(template)) !== null) {
|
|
25
|
-
vars.add(match[1]);
|
|
26
|
-
}
|
|
27
|
-
return [...vars];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// src/renderer/renderer.ts
|
|
31
|
-
function renderSections(asset, options = {}) {
|
|
32
|
-
const { variables = {}, strict = false } = options;
|
|
33
|
-
const result = {};
|
|
34
|
-
if (asset.sections.system_instructions) {
|
|
35
|
-
result.system_instructions = interpolate(
|
|
36
|
-
asset.sections.system_instructions,
|
|
37
|
-
variables,
|
|
38
|
-
{ strict }
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
if (asset.sections.prompt_template) {
|
|
42
|
-
result.prompt_template = interpolate(
|
|
43
|
-
asset.sections.prompt_template,
|
|
44
|
-
variables,
|
|
45
|
-
{ strict }
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
return result;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export {
|
|
52
|
-
interpolate,
|
|
53
|
-
extractVariables,
|
|
54
|
-
renderSections
|
|
55
|
-
};
|
|
56
|
-
//# sourceMappingURL=chunk-6KGBPHSY.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/renderer/interpolate.ts","../src/renderer/renderer.ts"],"sourcesContent":["export interface InterpolateOptions {\n strict?: boolean;\n}\n\nconst VARIABLE_RE = /\\{\\{\\s*([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\}\\}/g;\nconst ESCAPED_OPEN = /\\\\\\{\\\\\\{/g;\nconst ESCAPE_PLACEHOLDER = '\\x00ESCAPED_OPEN\\x00';\n\n/**\n * Interpolate variables into a template string.\n *\n * Syntax: {{ variable_name }}\n * Escape: \\{\\{ produces literal {{\n *\n * In strict mode, throws on missing variables.\n * In permissive mode, leaves {{ placeholder }} intact.\n */\nexport function interpolate(\n template: string,\n variables: Record<string, string>,\n options: InterpolateOptions = {},\n): string {\n const { strict = false } = options;\n\n // Replace escaped sequences with placeholder\n let result = template.replace(ESCAPED_OPEN, ESCAPE_PLACEHOLDER);\n\n result = result.replace(VARIABLE_RE, (match, name: string) => {\n if (name in variables) {\n return variables[name];\n }\n if (strict) {\n throw new Error(`Missing required variable: \"${name}\"`);\n }\n return match; // leave placeholder intact in permissive mode\n });\n\n // Restore escaped sequences\n result = result.replaceAll(ESCAPE_PLACEHOLDER, '{{');\n\n return result;\n}\n\n/**\n * Extract all variable names referenced in a template.\n */\nexport function extractVariables(template: string): string[] {\n const vars = new Set<string>();\n let match: RegExpExecArray | null;\n const re = new RegExp(VARIABLE_RE.source, 'g');\n while ((match = re.exec(template)) !== null) {\n vars.add(match[1]);\n }\n return [...vars];\n}\n","import type { ResolvedPromptAsset } from '../schema/index.js';\nimport { interpolate, extractVariables } from './interpolate.js';\n\nexport interface RenderOptions {\n variables?: Record<string, string>;\n strict?: boolean;\n}\n\nexport interface RenderedSections {\n system_instructions?: string;\n prompt_template?: string;\n}\n\n/**\n * Render the sections of a resolved prompt asset with variable interpolation.\n */\nexport function renderSections(\n asset: ResolvedPromptAsset,\n options: RenderOptions = {},\n): RenderedSections {\n const { variables = {}, strict = false } = options;\n\n const result: RenderedSections = {};\n\n if (asset.sections.system_instructions) {\n result.system_instructions = interpolate(\n asset.sections.system_instructions,\n variables,\n { strict },\n );\n }\n\n if (asset.sections.prompt_template) {\n result.prompt_template = interpolate(\n asset.sections.prompt_template,\n variables,\n { strict },\n );\n }\n\n return result;\n}\n\n/**\n * Get all variable names used across all sections.\n */\nexport function getRequiredVariables(asset: ResolvedPromptAsset): string[] {\n const vars = new Set<string>();\n\n if (asset.sections.system_instructions) {\n for (const v of extractVariables(asset.sections.system_instructions)) {\n vars.add(v);\n }\n }\n\n if (asset.sections.prompt_template) {\n for (const v of extractVariables(asset.sections.prompt_template)) {\n vars.add(v);\n }\n }\n\n return [...vars];\n}\n"],"mappings":";AAIA,IAAM,cAAc;AACpB,IAAM,eAAe;AACrB,IAAM,qBAAqB;AAWpB,SAAS,YACd,UACA,WACA,UAA8B,CAAC,GACvB;AACR,QAAM,EAAE,SAAS,MAAM,IAAI;AAG3B,MAAI,SAAS,SAAS,QAAQ,cAAc,kBAAkB;AAE9D,WAAS,OAAO,QAAQ,aAAa,CAAC,OAAO,SAAiB;AAC5D,QAAI,QAAQ,WAAW;AACrB,aAAO,UAAU,IAAI;AAAA,IACvB;AACA,QAAI,QAAQ;AACV,YAAM,IAAI,MAAM,+BAA+B,IAAI,GAAG;AAAA,IACxD;AACA,WAAO;AAAA,EACT,CAAC;AAGD,WAAS,OAAO,WAAW,oBAAoB,IAAI;AAEnD,SAAO;AACT;AAKO,SAAS,iBAAiB,UAA4B;AAC3D,QAAM,OAAO,oBAAI,IAAY;AAC7B,MAAI;AACJ,QAAM,KAAK,IAAI,OAAO,YAAY,QAAQ,GAAG;AAC7C,UAAQ,QAAQ,GAAG,KAAK,QAAQ,OAAO,MAAM;AAC3C,SAAK,IAAI,MAAM,CAAC,CAAC;AAAA,EACnB;AACA,SAAO,CAAC,GAAG,IAAI;AACjB;;;ACtCO,SAAS,eACd,OACA,UAAyB,CAAC,GACR;AAClB,QAAM,EAAE,YAAY,CAAC,GAAG,SAAS,MAAM,IAAI;AAE3C,QAAM,SAA2B,CAAC;AAElC,MAAI,MAAM,SAAS,qBAAqB;AACtC,WAAO,sBAAsB;AAAA,MAC3B,MAAM,SAAS;AAAA,MACf;AAAA,MACA,EAAE,OAAO;AAAA,IACX;AAAA,EACF;AAEA,MAAI,MAAM,SAAS,iBAAiB;AAClC,WAAO,kBAAkB;AAAA,MACvB,MAAM,SAAS;AAAA,MACf;AAAA,MACA,EAAE,OAAO;AAAA,IACX;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-UYTUGV7Z.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
renderSections
|
|
3
|
-
} from "./chunk-6KGBPHSY.js";
|
|
4
|
-
|
|
5
|
-
// src/providers/openai.ts
|
|
6
|
-
var openaiAdapter = {
|
|
7
|
-
name: "openai",
|
|
8
|
-
validate(asset) {
|
|
9
|
-
const errors = [];
|
|
10
|
-
const warnings = [];
|
|
11
|
-
if (!asset.model) {
|
|
12
|
-
errors.push("OpenAI adapter requires a model to be specified.");
|
|
13
|
-
}
|
|
14
|
-
if (asset.reasoning?.budget_tokens !== void 0) {
|
|
15
|
-
warnings.push("OpenAI uses reasoning_effort, not budget_tokens. budget_tokens will be ignored.");
|
|
16
|
-
}
|
|
17
|
-
return { valid: errors.length === 0, errors, warnings };
|
|
18
|
-
},
|
|
19
|
-
render(asset, runtime) {
|
|
20
|
-
const sections = renderSections(asset, {
|
|
21
|
-
variables: runtime.variables,
|
|
22
|
-
strict: runtime.strict
|
|
23
|
-
});
|
|
24
|
-
const messages = [];
|
|
25
|
-
if (sections.system_instructions) {
|
|
26
|
-
messages.push({ role: "system", content: sections.system_instructions });
|
|
27
|
-
}
|
|
28
|
-
if (runtime.history) {
|
|
29
|
-
for (const msg of runtime.history) {
|
|
30
|
-
messages.push({ role: msg.role, content: msg.content });
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (sections.prompt_template) {
|
|
34
|
-
messages.push({ role: "user", content: sections.prompt_template });
|
|
35
|
-
}
|
|
36
|
-
const body = {
|
|
37
|
-
model: asset.model,
|
|
38
|
-
messages
|
|
39
|
-
};
|
|
40
|
-
if (asset.sampling?.temperature !== void 0) body.temperature = asset.sampling.temperature;
|
|
41
|
-
if (asset.sampling?.top_p !== void 0) body.top_p = asset.sampling.top_p;
|
|
42
|
-
if (asset.sampling?.frequency_penalty !== void 0) body.frequency_penalty = asset.sampling.frequency_penalty;
|
|
43
|
-
if (asset.sampling?.presence_penalty !== void 0) body.presence_penalty = asset.sampling.presence_penalty;
|
|
44
|
-
if (asset.sampling?.stop !== void 0) body.stop = asset.sampling.stop;
|
|
45
|
-
if (asset.sampling?.max_output_tokens !== void 0) body.max_tokens = asset.sampling.max_output_tokens;
|
|
46
|
-
if (asset.reasoning?.effort) {
|
|
47
|
-
body.reasoning_effort = asset.reasoning.effort;
|
|
48
|
-
}
|
|
49
|
-
if (asset.response?.format === "json") {
|
|
50
|
-
body.response_format = { type: "json_object" };
|
|
51
|
-
}
|
|
52
|
-
if (asset.response?.stream !== void 0) {
|
|
53
|
-
body.stream = asset.response.stream;
|
|
54
|
-
}
|
|
55
|
-
if (asset.tools && asset.tools.length > 0) {
|
|
56
|
-
body.tools = asset.tools.map((tool) => {
|
|
57
|
-
if (typeof tool === "string") {
|
|
58
|
-
const def = runtime.toolRegistry?.[tool];
|
|
59
|
-
if (def) return def;
|
|
60
|
-
return { type: "function", function: { name: tool } };
|
|
61
|
-
}
|
|
62
|
-
return {
|
|
63
|
-
type: "function",
|
|
64
|
-
function: {
|
|
65
|
-
name: tool.name,
|
|
66
|
-
description: tool.description,
|
|
67
|
-
parameters: tool.input_schema
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
return {
|
|
73
|
-
body,
|
|
74
|
-
provider: "openai",
|
|
75
|
-
model: asset.model ?? "unknown"
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export {
|
|
81
|
-
openaiAdapter
|
|
82
|
-
};
|
|
83
|
-
//# sourceMappingURL=chunk-UYTUGV7Z.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/providers/openai.ts"],"sourcesContent":["import type { ResolvedPromptAsset } from '../schema/index.js';\nimport type {\n ProviderAdapter,\n ProviderRequest,\n ValidationResult,\n RuntimeRenderOptions,\n} from './types.js';\nimport { renderSections } from '../renderer/index.js';\n\n/**\n * OpenAI provider adapter.\n * Produces request bodies compatible with the OpenAI Chat Completions API.\n */\nexport const openaiAdapter: ProviderAdapter = {\n name: 'openai',\n\n validate(asset: ResolvedPromptAsset): ValidationResult {\n const errors: string[] = [];\n const warnings: string[] = [];\n\n if (!asset.model) {\n errors.push('OpenAI adapter requires a model to be specified.');\n }\n\n if (asset.reasoning?.budget_tokens !== undefined) {\n warnings.push('OpenAI uses reasoning_effort, not budget_tokens. budget_tokens will be ignored.');\n }\n\n return { valid: errors.length === 0, errors, warnings };\n },\n\n render(asset: ResolvedPromptAsset, runtime: RuntimeRenderOptions): ProviderRequest {\n const sections = renderSections(asset, {\n variables: runtime.variables,\n strict: runtime.strict,\n });\n\n const messages: Array<Record<string, unknown>> = [];\n\n // System message\n if (sections.system_instructions) {\n messages.push({ role: 'system', content: sections.system_instructions });\n }\n\n // History\n if (runtime.history) {\n for (const msg of runtime.history) {\n messages.push({ role: msg.role, content: msg.content });\n }\n }\n\n // User message (prompt template)\n if (sections.prompt_template) {\n messages.push({ role: 'user', content: sections.prompt_template });\n }\n\n const body: Record<string, unknown> = {\n model: asset.model,\n messages,\n };\n\n // Sampling params\n if (asset.sampling?.temperature !== undefined) body.temperature = asset.sampling.temperature;\n if (asset.sampling?.top_p !== undefined) body.top_p = asset.sampling.top_p;\n if (asset.sampling?.frequency_penalty !== undefined) body.frequency_penalty = asset.sampling.frequency_penalty;\n if (asset.sampling?.presence_penalty !== undefined) body.presence_penalty = asset.sampling.presence_penalty;\n if (asset.sampling?.stop !== undefined) body.stop = asset.sampling.stop;\n if (asset.sampling?.max_output_tokens !== undefined) body.max_tokens = asset.sampling.max_output_tokens;\n\n // Reasoning\n if (asset.reasoning?.effort) {\n body.reasoning_effort = asset.reasoning.effort;\n }\n\n // Response format\n if (asset.response?.format === 'json') {\n body.response_format = { type: 'json_object' };\n }\n\n // Streaming\n if (asset.response?.stream !== undefined) {\n body.stream = asset.response.stream;\n }\n\n // Tools\n if (asset.tools && asset.tools.length > 0) {\n body.tools = asset.tools.map((tool) => {\n if (typeof tool === 'string') {\n // Look up from registry\n const def = runtime.toolRegistry?.[tool];\n if (def) return def;\n return { type: 'function', function: { name: tool } };\n }\n return {\n type: 'function',\n function: {\n name: tool.name,\n description: tool.description,\n parameters: tool.input_schema,\n },\n };\n });\n }\n\n return {\n body,\n provider: 'openai',\n model: asset.model ?? 'unknown',\n };\n },\n};\n"],"mappings":";;;;;AAaO,IAAM,gBAAiC;AAAA,EAC5C,MAAM;AAAA,EAEN,SAAS,OAA8C;AACrD,UAAM,SAAmB,CAAC;AAC1B,UAAM,WAAqB,CAAC;AAE5B,QAAI,CAAC,MAAM,OAAO;AAChB,aAAO,KAAK,kDAAkD;AAAA,IAChE;AAEA,QAAI,MAAM,WAAW,kBAAkB,QAAW;AAChD,eAAS,KAAK,iFAAiF;AAAA,IACjG;AAEA,WAAO,EAAE,OAAO,OAAO,WAAW,GAAG,QAAQ,SAAS;AAAA,EACxD;AAAA,EAEA,OAAO,OAA4B,SAAgD;AACjF,UAAM,WAAW,eAAe,OAAO;AAAA,MACrC,WAAW,QAAQ;AAAA,MACnB,QAAQ,QAAQ;AAAA,IAClB,CAAC;AAED,UAAM,WAA2C,CAAC;AAGlD,QAAI,SAAS,qBAAqB;AAChC,eAAS,KAAK,EAAE,MAAM,UAAU,SAAS,SAAS,oBAAoB,CAAC;AAAA,IACzE;AAGA,QAAI,QAAQ,SAAS;AACnB,iBAAW,OAAO,QAAQ,SAAS;AACjC,iBAAS,KAAK,EAAE,MAAM,IAAI,MAAM,SAAS,IAAI,QAAQ,CAAC;AAA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;AAAA,IACH;AAEA,WAAO;AAAA,MACL;AAAA,MACA,UAAU;AAAA,MACV,OAAO,MAAM,SAAS;AAAA,IACxB;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/providers/anthropic.ts"],"sourcesContent":["import type { ResolvedPromptAsset } from '../schema/index.js';\nimport type {\n ProviderAdapter,\n ProviderRequest,\n ValidationResult,\n RuntimeRenderOptions,\n} from './types.js';\nimport { renderSections } from '../renderer/index.js';\n\n/**\n * Anthropic provider adapter.\n * Produces request bodies compatible with the Anthropic Messages API.\n */\nexport const anthropicAdapter: ProviderAdapter = {\n name: 'anthropic',\n\n validate(asset: ResolvedPromptAsset): ValidationResult {\n const errors: string[] = [];\n const warnings: string[] = [];\n\n if (!asset.model) {\n errors.push('Anthropic adapter requires a model to be specified.');\n }\n\n if (asset.sampling?.frequency_penalty !== undefined) {\n warnings.push('Anthropic does not support frequency_penalty. It will be ignored.');\n }\n if (asset.sampling?.presence_penalty !== undefined) {\n warnings.push('Anthropic does not support presence_penalty. It will be ignored.');\n }\n if (asset.reasoning?.effort !== undefined) {\n warnings.push('Anthropic uses budget_tokens for thinking, not effort. effort will be mapped approximately.');\n }\n\n return { valid: errors.length === 0, errors, warnings };\n },\n\n render(asset: ResolvedPromptAsset, runtime: RuntimeRenderOptions): ProviderRequest {\n const sections = renderSections(asset, {\n variables: runtime.variables,\n strict: runtime.strict,\n });\n\n const messages: Array<Record<string, unknown>> = [];\n\n // History\n if (runtime.history) {\n for (const msg of runtime.history) {\n messages.push({ role: msg.role, content: msg.content });\n }\n }\n\n // User message (prompt template)\n if (sections.prompt_template) {\n messages.push({ role: 'user', content: sections.prompt_template });\n }\n\n const body: Record<string, unknown> = {\n model: asset.model,\n messages,\n };\n\n // System goes as top-level field in Anthropic\n if (sections.system_instructions) {\n body.system = sections.system_instructions;\n }\n\n // Sampling params\n if (asset.sampling?.temperature !== undefined) body.temperature = asset.sampling.temperature;\n if (asset.sampling?.top_p !== undefined) body.top_p = asset.sampling.top_p;\n if (asset.sampling?.stop !== undefined) body.stop_sequences = asset.sampling.stop;\n if (asset.sampling?.max_output_tokens !== undefined) {\n body.max_tokens = asset.sampling.max_output_tokens;\n } else {\n // Anthropic requires max_tokens\n body.max_tokens = 4096;\n }\n\n // Thinking/reasoning\n if (asset.reasoning?.budget_tokens) {\n body.thinking = {\n type: 'enabled',\n budget_tokens: asset.reasoning.budget_tokens,\n };\n }\n\n // Streaming\n if (asset.response?.stream !== undefined) {\n body.stream = asset.response.stream;\n }\n\n // Tools\n if (asset.tools && asset.tools.length > 0) {\n body.tools = asset.tools.map((tool) => {\n if (typeof tool === 'string') {\n const def = runtime.toolRegistry?.[tool];\n if (def) return def;\n return { name: tool };\n }\n return {\n name: tool.name,\n description: tool.description,\n input_schema: tool.input_schema ?? { type: 'object', properties: {} },\n };\n });\n }\n\n return {\n body,\n provider: 'anthropic',\n model: asset.model ?? 'unknown',\n };\n },\n};\n"],"mappings":";;;;;AAaO,IAAM,mBAAoC;AAAA,EAC/C,MAAM;AAAA,EAEN,SAAS,OAA8C;AACrD,UAAM,SAAmB,CAAC;AAC1B,UAAM,WAAqB,CAAC;AAE5B,QAAI,CAAC,MAAM,OAAO;AAChB,aAAO,KAAK,qDAAqD;AAAA,IACnE;AAEA,QAAI,MAAM,UAAU,sBAAsB,QAAW;AACnD,eAAS,KAAK,mEAAmE;AAAA,IACnF;AACA,QAAI,MAAM,UAAU,qBAAqB,QAAW;AAClD,eAAS,KAAK,kEAAkE;AAAA,IAClF;AACA,QAAI,MAAM,WAAW,WAAW,QAAW;AACzC,eAAS,KAAK,6FAA6F;AAAA,IAC7G;AAEA,WAAO,EAAE,OAAO,OAAO,WAAW,GAAG,QAAQ,SAAS;AAAA,EACxD;AAAA,EAEA,OAAO,OAA4B,SAAgD;AACjF,UAAM,WAAW,eAAe,OAAO;AAAA,MACrC,WAAW,QAAQ;AAAA,MACnB,QAAQ,QAAQ;AAAA,IA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BAAgB,EAAE,MAAM,UAAU,YAAY,CAAC,EAAE;AAAA,QACtE;AAAA,MACF,CAAC;AAAA,IACH;AAEA,WAAO;AAAA,MACL;AAAA,MACA,UAAU;AAAA,MACV,OAAO,MAAM,SAAS;AAAA,IACxB;AAAA,EACF;AACF;","names":[]}
|
|
@@ -211,21 +211,21 @@ declare const PromptAssetSchema: z.ZodObject<{
|
|
|
211
211
|
max_items?: number | undefined;
|
|
212
212
|
}>>;
|
|
213
213
|
}, "strip", z.ZodTypeAny, {
|
|
214
|
+
history?: {
|
|
215
|
+
max_items?: number | undefined;
|
|
216
|
+
} | undefined;
|
|
214
217
|
inputs?: (string | {
|
|
215
218
|
name: string;
|
|
216
219
|
max_size?: number | undefined;
|
|
217
220
|
})[] | undefined;
|
|
221
|
+
}, {
|
|
218
222
|
history?: {
|
|
219
223
|
max_items?: number | undefined;
|
|
220
224
|
} | undefined;
|
|
221
|
-
}, {
|
|
222
225
|
inputs?: (string | {
|
|
223
226
|
name: string;
|
|
224
227
|
max_size?: number | undefined;
|
|
225
228
|
})[] | undefined;
|
|
226
|
-
history?: {
|
|
227
|
-
max_items?: number | undefined;
|
|
228
|
-
} | undefined;
|
|
229
229
|
}>>;
|
|
230
230
|
includes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
231
231
|
environments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -484,9 +484,8 @@ declare const PromptAssetSchema: z.ZodObject<{
|
|
|
484
484
|
}, "strip", z.ZodTypeAny, {
|
|
485
485
|
id: string;
|
|
486
486
|
schema_version: number;
|
|
487
|
-
description?: string | undefined;
|
|
488
|
-
includes?: string[] | undefined;
|
|
489
487
|
model?: string | undefined;
|
|
488
|
+
includes?: string[] | undefined;
|
|
490
489
|
fallback_models?: string[] | undefined;
|
|
491
490
|
reasoning?: {
|
|
492
491
|
effort?: "low" | "medium" | "high" | undefined;
|
|
@@ -504,23 +503,17 @@ declare const PromptAssetSchema: z.ZodObject<{
|
|
|
504
503
|
format?: "text" | "json" | "markdown" | undefined;
|
|
505
504
|
stream?: boolean | undefined;
|
|
506
505
|
} | undefined;
|
|
506
|
+
description?: string | undefined;
|
|
507
507
|
tools?: (string | {
|
|
508
508
|
name: string;
|
|
509
509
|
description?: string | undefined;
|
|
510
510
|
input_schema?: Record<string, unknown> | undefined;
|
|
511
511
|
})[] | undefined;
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
tags?: string[] | undefined;
|
|
516
|
-
review_required?: boolean | undefined;
|
|
517
|
-
stable?: boolean | undefined;
|
|
518
|
-
} | undefined;
|
|
519
|
-
sections?: {
|
|
520
|
-
system_instructions?: string | undefined;
|
|
521
|
-
prompt_template?: string | undefined;
|
|
522
|
-
notes?: string | undefined;
|
|
512
|
+
source?: {
|
|
513
|
+
file_path?: string | undefined;
|
|
514
|
+
checksum?: string | undefined;
|
|
523
515
|
} | undefined;
|
|
516
|
+
provider?: "openai" | "anthropic" | "google" | "gemini" | "openrouter" | "any" | undefined;
|
|
524
517
|
mcp?: {
|
|
525
518
|
servers?: (string | {
|
|
526
519
|
name: string;
|
|
@@ -528,13 +521,13 @@ declare const PromptAssetSchema: z.ZodObject<{
|
|
|
528
521
|
})[] | undefined;
|
|
529
522
|
} | undefined;
|
|
530
523
|
context?: {
|
|
524
|
+
history?: {
|
|
525
|
+
max_items?: number | undefined;
|
|
526
|
+
} | undefined;
|
|
531
527
|
inputs?: (string | {
|
|
532
528
|
name: string;
|
|
533
529
|
max_size?: number | undefined;
|
|
534
530
|
})[] | undefined;
|
|
535
|
-
history?: {
|
|
536
|
-
max_items?: number | undefined;
|
|
537
|
-
} | undefined;
|
|
538
531
|
} | undefined;
|
|
539
532
|
environments?: Record<string, {
|
|
540
533
|
model?: string | undefined;
|
|
@@ -586,15 +579,21 @@ declare const PromptAssetSchema: z.ZodObject<{
|
|
|
586
579
|
input_schema?: Record<string, unknown> | undefined;
|
|
587
580
|
})[] | undefined;
|
|
588
581
|
}> | undefined;
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
582
|
+
metadata?: {
|
|
583
|
+
owner?: string | undefined;
|
|
584
|
+
tags?: string[] | undefined;
|
|
585
|
+
review_required?: boolean | undefined;
|
|
586
|
+
stable?: boolean | undefined;
|
|
587
|
+
} | undefined;
|
|
588
|
+
sections?: {
|
|
589
|
+
system_instructions?: string | undefined;
|
|
590
|
+
prompt_template?: string | undefined;
|
|
591
|
+
notes?: string | undefined;
|
|
592
592
|
} | undefined;
|
|
593
593
|
}, {
|
|
594
594
|
id: string;
|
|
595
|
-
description?: string | undefined;
|
|
596
|
-
includes?: string[] | undefined;
|
|
597
595
|
model?: string | undefined;
|
|
596
|
+
includes?: string[] | undefined;
|
|
598
597
|
fallback_models?: string[] | undefined;
|
|
599
598
|
reasoning?: {
|
|
600
599
|
effort?: "low" | "medium" | "high" | undefined;
|
|
@@ -612,23 +611,17 @@ declare const PromptAssetSchema: z.ZodObject<{
|
|
|
612
611
|
format?: "text" | "json" | "markdown" | undefined;
|
|
613
612
|
stream?: boolean | undefined;
|
|
614
613
|
} | undefined;
|
|
614
|
+
description?: string | undefined;
|
|
615
615
|
tools?: (string | {
|
|
616
616
|
name: string;
|
|
617
617
|
description?: string | undefined;
|
|
618
618
|
input_schema?: Record<string, unknown> | undefined;
|
|
619
619
|
})[] | undefined;
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
tags?: string[] | undefined;
|
|
624
|
-
review_required?: boolean | undefined;
|
|
625
|
-
stable?: boolean | undefined;
|
|
626
|
-
} | undefined;
|
|
627
|
-
sections?: {
|
|
628
|
-
system_instructions?: string | undefined;
|
|
629
|
-
prompt_template?: string | undefined;
|
|
630
|
-
notes?: string | undefined;
|
|
620
|
+
source?: {
|
|
621
|
+
file_path?: string | undefined;
|
|
622
|
+
checksum?: string | undefined;
|
|
631
623
|
} | undefined;
|
|
624
|
+
provider?: "openai" | "anthropic" | "google" | "gemini" | "openrouter" | "any" | undefined;
|
|
632
625
|
schema_version?: number | undefined;
|
|
633
626
|
mcp?: {
|
|
634
627
|
servers?: (string | {
|
|
@@ -637,13 +630,13 @@ declare const PromptAssetSchema: z.ZodObject<{
|
|
|
637
630
|
})[] | undefined;
|
|
638
631
|
} | undefined;
|
|
639
632
|
context?: {
|
|
633
|
+
history?: {
|
|
634
|
+
max_items?: number | undefined;
|
|
635
|
+
} | undefined;
|
|
640
636
|
inputs?: (string | {
|
|
641
637
|
name: string;
|
|
642
638
|
max_size?: number | undefined;
|
|
643
639
|
})[] | undefined;
|
|
644
|
-
history?: {
|
|
645
|
-
max_items?: number | undefined;
|
|
646
|
-
} | undefined;
|
|
647
640
|
} | undefined;
|
|
648
641
|
environments?: Record<string, {
|
|
649
642
|
model?: string | undefined;
|
|
@@ -695,9 +688,16 @@ declare const PromptAssetSchema: z.ZodObject<{
|
|
|
695
688
|
input_schema?: Record<string, unknown> | undefined;
|
|
696
689
|
})[] | undefined;
|
|
697
690
|
}> | undefined;
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
691
|
+
metadata?: {
|
|
692
|
+
owner?: string | undefined;
|
|
693
|
+
tags?: string[] | undefined;
|
|
694
|
+
review_required?: boolean | undefined;
|
|
695
|
+
stable?: boolean | undefined;
|
|
696
|
+
} | undefined;
|
|
697
|
+
sections?: {
|
|
698
|
+
system_instructions?: string | undefined;
|
|
699
|
+
prompt_template?: string | undefined;
|
|
700
|
+
notes?: string | undefined;
|
|
701
701
|
} | undefined;
|
|
702
702
|
}>;
|
|
703
703
|
type PromptAsset = z.infer<typeof PromptAssetSchema>;
|
|
@@ -211,21 +211,21 @@ declare const PromptAssetSchema: z.ZodObject<{
|
|
|
211
211
|
max_items?: number | undefined;
|
|
212
212
|
}>>;
|
|
213
213
|
}, "strip", z.ZodTypeAny, {
|
|
214
|
+
history?: {
|
|
215
|
+
max_items?: number | undefined;
|
|
216
|
+
} | undefined;
|
|
214
217
|
inputs?: (string | {
|
|
215
218
|
name: string;
|
|
216
219
|
max_size?: number | undefined;
|
|
217
220
|
})[] | undefined;
|
|
221
|
+
}, {
|
|
218
222
|
history?: {
|
|
219
223
|
max_items?: number | undefined;
|
|
220
224
|
} | undefined;
|
|
221
|
-
}, {
|
|
222
225
|
inputs?: (string | {
|
|
223
226
|
name: string;
|
|
224
227
|
max_size?: number | undefined;
|
|
225
228
|
})[] | undefined;
|
|
226
|
-
history?: {
|
|
227
|
-
max_items?: number | undefined;
|
|
228
|
-
} | undefined;
|
|
229
229
|
}>>;
|
|
230
230
|
includes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
231
231
|
environments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -484,9 +484,8 @@ declare const PromptAssetSchema: z.ZodObject<{
|
|
|
484
484
|
}, "strip", z.ZodTypeAny, {
|
|
485
485
|
id: string;
|
|
486
486
|
schema_version: number;
|
|
487
|
-
description?: string | undefined;
|
|
488
|
-
includes?: string[] | undefined;
|
|
489
487
|
model?: string | undefined;
|
|
488
|
+
includes?: string[] | undefined;
|
|
490
489
|
fallback_models?: string[] | undefined;
|
|
491
490
|
reasoning?: {
|
|
492
491
|
effort?: "low" | "medium" | "high" | undefined;
|
|
@@ -504,23 +503,17 @@ declare const PromptAssetSchema: z.ZodObject<{
|
|
|
504
503
|
format?: "text" | "json" | "markdown" | undefined;
|
|
505
504
|
stream?: boolean | undefined;
|
|
506
505
|
} | undefined;
|
|
506
|
+
description?: string | undefined;
|
|
507
507
|
tools?: (string | {
|
|
508
508
|
name: string;
|
|
509
509
|
description?: string | undefined;
|
|
510
510
|
input_schema?: Record<string, unknown> | undefined;
|
|
511
511
|
})[] | undefined;
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
tags?: string[] | undefined;
|
|
516
|
-
review_required?: boolean | undefined;
|
|
517
|
-
stable?: boolean | undefined;
|
|
518
|
-
} | undefined;
|
|
519
|
-
sections?: {
|
|
520
|
-
system_instructions?: string | undefined;
|
|
521
|
-
prompt_template?: string | undefined;
|
|
522
|
-
notes?: string | undefined;
|
|
512
|
+
source?: {
|
|
513
|
+
file_path?: string | undefined;
|
|
514
|
+
checksum?: string | undefined;
|
|
523
515
|
} | undefined;
|
|
516
|
+
provider?: "openai" | "anthropic" | "google" | "gemini" | "openrouter" | "any" | undefined;
|
|
524
517
|
mcp?: {
|
|
525
518
|
servers?: (string | {
|
|
526
519
|
name: string;
|
|
@@ -528,13 +521,13 @@ declare const PromptAssetSchema: z.ZodObject<{
|
|
|
528
521
|
})[] | undefined;
|
|
529
522
|
} | undefined;
|
|
530
523
|
context?: {
|
|
524
|
+
history?: {
|
|
525
|
+
max_items?: number | undefined;
|
|
526
|
+
} | undefined;
|
|
531
527
|
inputs?: (string | {
|
|
532
528
|
name: string;
|
|
533
529
|
max_size?: number | undefined;
|
|
534
530
|
})[] | undefined;
|
|
535
|
-
history?: {
|
|
536
|
-
max_items?: number | undefined;
|
|
537
|
-
} | undefined;
|
|
538
531
|
} | undefined;
|
|
539
532
|
environments?: Record<string, {
|
|
540
533
|
model?: string | undefined;
|
|
@@ -586,15 +579,21 @@ declare const PromptAssetSchema: z.ZodObject<{
|
|
|
586
579
|
input_schema?: Record<string, unknown> | undefined;
|
|
587
580
|
})[] | undefined;
|
|
588
581
|
}> | undefined;
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
582
|
+
metadata?: {
|
|
583
|
+
owner?: string | undefined;
|
|
584
|
+
tags?: string[] | undefined;
|
|
585
|
+
review_required?: boolean | undefined;
|
|
586
|
+
stable?: boolean | undefined;
|
|
587
|
+
} | undefined;
|
|
588
|
+
sections?: {
|
|
589
|
+
system_instructions?: string | undefined;
|
|
590
|
+
prompt_template?: string | undefined;
|
|
591
|
+
notes?: string | undefined;
|
|
592
592
|
} | undefined;
|
|
593
593
|
}, {
|
|
594
594
|
id: string;
|
|
595
|
-
description?: string | undefined;
|
|
596
|
-
includes?: string[] | undefined;
|
|
597
595
|
model?: string | undefined;
|
|
596
|
+
includes?: string[] | undefined;
|
|
598
597
|
fallback_models?: string[] | undefined;
|
|
599
598
|
reasoning?: {
|
|
600
599
|
effort?: "low" | "medium" | "high" | undefined;
|
|
@@ -612,23 +611,17 @@ declare const PromptAssetSchema: z.ZodObject<{
|
|
|
612
611
|
format?: "text" | "json" | "markdown" | undefined;
|
|
613
612
|
stream?: boolean | undefined;
|
|
614
613
|
} | undefined;
|
|
614
|
+
description?: string | undefined;
|
|
615
615
|
tools?: (string | {
|
|
616
616
|
name: string;
|
|
617
617
|
description?: string | undefined;
|
|
618
618
|
input_schema?: Record<string, unknown> | undefined;
|
|
619
619
|
})[] | undefined;
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
tags?: string[] | undefined;
|
|
624
|
-
review_required?: boolean | undefined;
|
|
625
|
-
stable?: boolean | undefined;
|
|
626
|
-
} | undefined;
|
|
627
|
-
sections?: {
|
|
628
|
-
system_instructions?: string | undefined;
|
|
629
|
-
prompt_template?: string | undefined;
|
|
630
|
-
notes?: string | undefined;
|
|
620
|
+
source?: {
|
|
621
|
+
file_path?: string | undefined;
|
|
622
|
+
checksum?: string | undefined;
|
|
631
623
|
} | undefined;
|
|
624
|
+
provider?: "openai" | "anthropic" | "google" | "gemini" | "openrouter" | "any" | undefined;
|
|
632
625
|
schema_version?: number | undefined;
|
|
633
626
|
mcp?: {
|
|
634
627
|
servers?: (string | {
|
|
@@ -637,13 +630,13 @@ declare const PromptAssetSchema: z.ZodObject<{
|
|
|
637
630
|
})[] | undefined;
|
|
638
631
|
} | undefined;
|
|
639
632
|
context?: {
|
|
633
|
+
history?: {
|
|
634
|
+
max_items?: number | undefined;
|
|
635
|
+
} | undefined;
|
|
640
636
|
inputs?: (string | {
|
|
641
637
|
name: string;
|
|
642
638
|
max_size?: number | undefined;
|
|
643
639
|
})[] | undefined;
|
|
644
|
-
history?: {
|
|
645
|
-
max_items?: number | undefined;
|
|
646
|
-
} | undefined;
|
|
647
640
|
} | undefined;
|
|
648
641
|
environments?: Record<string, {
|
|
649
642
|
model?: string | undefined;
|
|
@@ -695,9 +688,16 @@ declare const PromptAssetSchema: z.ZodObject<{
|
|
|
695
688
|
input_schema?: Record<string, unknown> | undefined;
|
|
696
689
|
})[] | undefined;
|
|
697
690
|
}> | undefined;
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
691
|
+
metadata?: {
|
|
692
|
+
owner?: string | undefined;
|
|
693
|
+
tags?: string[] | undefined;
|
|
694
|
+
review_required?: boolean | undefined;
|
|
695
|
+
stable?: boolean | undefined;
|
|
696
|
+
} | undefined;
|
|
697
|
+
sections?: {
|
|
698
|
+
system_instructions?: string | undefined;
|
|
699
|
+
prompt_template?: string | undefined;
|
|
700
|
+
notes?: string | undefined;
|
|
701
701
|
} | undefined;
|
|
702
702
|
}>;
|
|
703
703
|
type PromptAsset = z.infer<typeof PromptAssetSchema>;
|