promptopskit 0.4.2 → 0.6.2

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.
Files changed (82) hide show
  1. package/README.md +105 -62
  2. package/SKILL.md +376 -16
  3. package/dist/{chunk-7MRMN3SW.js → chunk-55B7QQBK.js} +6 -4
  4. package/dist/chunk-55B7QQBK.js.map +1 -0
  5. package/dist/{chunk-HWEVRBKZ.js → chunk-AGTGIZMR.js} +6 -2
  6. package/dist/chunk-AGTGIZMR.js.map +1 -0
  7. package/dist/chunk-FNCIBZJF.js +130 -0
  8. package/dist/chunk-FNCIBZJF.js.map +1 -0
  9. package/dist/{chunk-XL76NHZR.js → chunk-GLT3YYWK.js} +6 -4
  10. package/dist/chunk-GLT3YYWK.js.map +1 -0
  11. package/dist/{chunk-5AAYDOPU.js → chunk-IPFD5Y3O.js} +4 -3
  12. package/dist/chunk-IPFD5Y3O.js.map +1 -0
  13. package/dist/{chunk-YI4LILPY.js → chunk-JR7252DG.js} +584 -520
  14. package/dist/chunk-JR7252DG.js.map +1 -0
  15. package/dist/{chunk-JKBWC5WJ.js → chunk-UY5OKMVP.js} +302 -21
  16. package/dist/chunk-UY5OKMVP.js.map +1 -0
  17. package/dist/{chunk-MI3M6KDD.js → chunk-VMLGUI4F.js} +6 -4
  18. package/dist/chunk-VMLGUI4F.js.map +1 -0
  19. package/dist/{chunk-Z4IPWEUU.js → chunk-XEZJZ3IG.js} +6 -4
  20. package/dist/chunk-XEZJZ3IG.js.map +1 -0
  21. package/dist/cli/index.js +435 -106
  22. package/dist/cli/index.js.map +1 -1
  23. package/dist/index.cjs +1159 -636
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +10 -9
  26. package/dist/index.d.ts +10 -9
  27. package/dist/index.js +79 -17
  28. package/dist/index.js.map +1 -1
  29. package/dist/providers/anthropic.cjs +875 -533
  30. package/dist/providers/anthropic.cjs.map +1 -1
  31. package/dist/providers/anthropic.d.cts +2 -2
  32. package/dist/providers/anthropic.d.ts +2 -2
  33. package/dist/providers/anthropic.js +3 -3
  34. package/dist/providers/gemini.cjs +875 -533
  35. package/dist/providers/gemini.cjs.map +1 -1
  36. package/dist/providers/gemini.d.cts +2 -2
  37. package/dist/providers/gemini.d.ts +2 -2
  38. package/dist/providers/gemini.js +3 -3
  39. package/dist/providers/llmasaservice.cjs +1735 -0
  40. package/dist/providers/llmasaservice.cjs.map +1 -0
  41. package/dist/providers/llmasaservice.d.cts +28 -0
  42. package/dist/providers/llmasaservice.d.ts +28 -0
  43. package/dist/providers/llmasaservice.js +20 -0
  44. package/dist/providers/llmasaservice.js.map +1 -0
  45. package/dist/providers/openai-responses.cjs +875 -533
  46. package/dist/providers/openai-responses.cjs.map +1 -1
  47. package/dist/providers/openai-responses.d.cts +2 -2
  48. package/dist/providers/openai-responses.d.ts +2 -2
  49. package/dist/providers/openai-responses.js +3 -3
  50. package/dist/providers/openai.cjs +875 -533
  51. package/dist/providers/openai.cjs.map +1 -1
  52. package/dist/providers/openai.d.cts +2 -2
  53. package/dist/providers/openai.d.ts +2 -2
  54. package/dist/providers/openai.js +3 -3
  55. package/dist/providers/openrouter.cjs +876 -533
  56. package/dist/providers/openrouter.cjs.map +1 -1
  57. package/dist/providers/openrouter.d.cts +2 -2
  58. package/dist/providers/openrouter.d.ts +2 -2
  59. package/dist/providers/openrouter.js +4 -4
  60. package/dist/{schema-B9A1zLRk.d.cts → schema-CuYsv8JA.d.cts} +853 -7
  61. package/dist/{schema-B9A1zLRk.d.ts → schema-CuYsv8JA.d.ts} +853 -7
  62. package/dist/testing.cjs +64 -9
  63. package/dist/testing.cjs.map +1 -1
  64. package/dist/testing.d.cts +1 -1
  65. package/dist/testing.d.ts +1 -1
  66. package/dist/testing.js +1 -1
  67. package/dist/{types-DjGAwJxC.d.ts → types-DpK0mTHL.d.ts} +18 -6
  68. package/dist/{types-DpbzzZO2.d.cts → types-UA_p9uJy.d.cts} +18 -6
  69. package/dist/usagetap/index.cjs +6 -1
  70. package/dist/usagetap/index.cjs.map +1 -1
  71. package/dist/usagetap/index.d.cts +4 -3
  72. package/dist/usagetap/index.d.ts +4 -3
  73. package/dist/usagetap/index.js +3 -1
  74. package/package.json +19 -2
  75. package/dist/chunk-5AAYDOPU.js.map +0 -1
  76. package/dist/chunk-7MRMN3SW.js.map +0 -1
  77. package/dist/chunk-HWEVRBKZ.js.map +0 -1
  78. package/dist/chunk-JKBWC5WJ.js.map +0 -1
  79. package/dist/chunk-MI3M6KDD.js.map +0 -1
  80. package/dist/chunk-XL76NHZR.js.map +0 -1
  81. package/dist/chunk-YI4LILPY.js.map +0 -1
  82. package/dist/chunk-Z4IPWEUU.js.map +0 -1
package/README.md CHANGED
@@ -5,48 +5,40 @@
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
6
  [![Node.js](https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg)](https://nodejs.org)
7
7
 
8
- **Centralize prompts, system instructions, tools, and model settings — without leaving your codebase.**
8
+ **Turn hardcoded AI prompts into versioned, tested application assets.**
9
9
 
10
- Your prompts are already in Git. PromptOpsKit makes them manageable. It replaces hardcoded strings and scattered provider-specific glue with structured Markdown files where prompt text, model settings, sampling parameters, tool bindings, environment overrides, and composable shared instructions all live together — diffable, reviewable, and release-aware.
10
+ Your prompts are already in Git. PromptOpsKit makes them manageable.
11
11
 
12
- Provider adapters for OpenAI, Anthropic, Gemini, and OpenRouter produce a ready-to-send **request body only** no HTTP client, no auth, no headers. Your application owns transport, so PromptOpsKit slots into any stack without opinions about how you call the API.
12
+ Keep prompts, model settings, tools, input validation, shared instructions, environment overrides, and tests together in Markdown files that live in Git and ship with your app. Render provider-ready request bodies without giving up your SDK, gateway, auth, retries, routing, observability, or billing.
13
13
 
14
- ## How is this different from GitHub Models?
14
+ PromptOpsKit is not a prompt dashboard, LLM gateway, or hosted runtime service. It is the repo-native layer between scattered prompt strings and production AI calls.
15
15
 
16
- GitHub Models is a great place to prototype prompts, compare models, and run evaluations inside GitHub.
16
+ ## Why PromptOpsKit?
17
17
 
18
- PromptOpsKit is focused on the application runtime layer.
18
+ From scattered prompt glue:
19
19
 
20
- It helps you turn prompt behavior into repo-native assets that your application can load, validate, compose, compile, and render into provider-specific request bodies.
20
+ - Prompt strings live inline in code
21
+ - Model config and tools drift in separate files
22
+ - Validation checks happen outside the prompt
23
+ - Environment logic hides in if/else branches
24
+ - Testing is ad hoc and hard to review
21
25
 
22
- Use GitHub Models when you want:
26
+ To one reviewable asset:
23
27
 
24
- - a GitHub-hosted prompt editor and playground
25
- - side-by-side model comparisons
26
- - structured evaluations inside GitHub
27
- - `.prompt.yml` files for prompt experiments and evals
28
+ - Prompt, model, tools, and input rules live together
29
+ - `includes` and `defaults.md` avoid copy-paste drift
30
+ - `environments` and `tiers` handle overrides cleanly
31
+ - `.test.yaml` sidecars keep deterministic test behavior
32
+ - Runtime rendering and compiled artifacts support production deployment
28
33
 
29
- Use PromptOpsKit when you want:
34
+ Core capabilities:
30
35
 
31
- - Markdown prompt assets with YAML metadata
32
- - production input hardening and validation
33
- - environment-specific model and parameter overrides
34
- - reusable prompt composition
35
- - compiled artifacts for deployment
36
- - provider-specific request bodies for your own runtime code
37
- - control over SDKs, auth, retries, routing, observability, and billing
38
-
39
- ### Why PromptOpsKit?
40
-
41
- - **Centralized, not scattered** — each prompt is a single Markdown file that captures prompt text, model config, tool bindings, and context rules together.
42
- - **Operational, not just templated** — model name, temperature, reasoning effort, tools, and response format are declared alongside the prompt they govern.
43
- - **Reusable, not duplicated** — `includes` lets you define shared tone, policy, or safety instructions once and compose them into any prompt.
44
- - **Layered defaults, not repetition** — `defaults.md` in any folder sets shared `provider`, `model`, `metadata`, and `# System instructions` for that subtree, with nearest-folder override behavior.
45
- - **Release-aware, not ad hoc** — environment and tier overrides swap models and parameters without forking prompt files.
46
- - **Provider-portable** — write once, render for OpenAI, Anthropic, Gemini, or OpenRouter with correct body shapes.
47
- - **Validate early** — Zod schema validation, Levenshtein-based "did you mean?" suggestions for typos, and variable usage checks catch mistakes before runtime.
48
- - **Compile for production** — pre-compile `.md` to JSON or ESM so deployments skip parsing entirely.
49
- - **Repo-native, not dashboard-native** — no hosted service, no external admin tool. Everything lives in source control.
36
+ - **Markdown prompt assets** capture prompt text, model config, tool bindings, context rules, and metadata together.
37
+ - **Provider-ready output** render request bodies for OpenAI Chat, OpenAI Responses, Anthropic, Gemini, OpenRouter, and LLMAsAService while your app owns transport.
38
+ - **Input hardening** — define required values, size limits, allow/deny patterns, and secret rejection close to the prompt template.
39
+ - **Reusable composition** — share tone, policy, and safety instructions with `includes`, and apply folder-level standards with `defaults.md`.
40
+ - **Environment and tier overrides** — keep dev/prod and plan-specific behavior in one prompt source with explicit, reviewable overrides.
41
+ - **Sidecar tests** run deterministic prompt checks in local development and CI without calling a model.
50
42
 
51
43
  ## Install
52
44
 
@@ -67,7 +59,7 @@ This creates:
67
59
 
68
60
  ```
69
61
  prompts/
70
- ├── defaults.md # Folder-level defaults (provider, model, metadata, system instructions)
62
+ ├── defaults.md # Folder-level defaults (provider, model, options, metadata, system instructions)
71
63
  ├── hello.md # Sample prompt with variables
72
64
  ├── hello.test.yaml # Test sidecar with sample inputs and hardcoded responses
73
65
  └── shared/
@@ -85,26 +77,21 @@ id: support/reply
85
77
  schema_version: 1
86
78
  provider: openai
87
79
  model: gpt-5.4
88
- reasoning:
89
- effort: medium
90
- sampling:
91
- temperature: 0.7
80
+ includes:
81
+ - ./shared/tone.md
92
82
  context:
93
83
  inputs:
94
84
  - name: user_message
95
- non_empty:
96
- return_message: "Please enter a message before continuing."
85
+ non_empty: true
97
86
  reject_secrets: true
98
- - name: app_context
99
- max_size: 2000
100
- allow_regex: /^[A-Za-z0-9 _-]+$/i
101
- includes:
102
- - ./shared/tone.md
87
+ environments:
88
+ dev:
89
+ model: gpt-5.4-mini
103
90
  ---
104
91
 
105
92
  # System instructions
106
93
 
107
- You are a helpful support assistant working in {{ app_context }}.
94
+ You are a helpful support assistant.
108
95
 
109
96
  # Prompt template
110
97
 
@@ -116,14 +103,14 @@ You are a helpful support assistant working in {{ app_context }}.
116
103
  ```typescript
117
104
  import { createPromptOpsKit } from 'promptopskit';
118
105
 
119
- const kit = createPromptOpsKit();
106
+ const kit = createPromptOpsKit({ sourceDir: './prompts' });
120
107
 
121
108
  const result = await kit.renderPrompt({
122
109
  path: 'support/reply',
123
110
  provider: 'openai',
111
+ environment: 'prod',
124
112
  variables: {
125
113
  user_message: 'How do I reset my password?',
126
- app_context: 'Account settings page',
127
114
  },
128
115
  });
129
116
 
@@ -159,15 +146,16 @@ Supported values for `warnings.contextSize` are `auto`, `off`, `result-only`, `c
159
146
  - **Prompts as Markdown** — YAML front matter for settings, H1 headings for sections (`# System instructions`, `# Prompt template`, `# Notes`)
160
147
  - **Variable interpolation** — `{{ variable }}` syntax with strict and permissive modes
161
148
  - **Composition** — `includes` to share system instructions across prompts, with circular detection
162
- - **Folder defaults** — `defaults.md` inheritance for shared provider, model, metadata, and system instructions
149
+ - **Folder defaults** — `defaults.md` inheritance for shared provider, model, options, metadata, and system instructions
163
150
  - **Overrides** — Environment and tier-based overrides (base → env → tier → runtime)
164
- - **5 provider adapters** — OpenAI (Chat), OpenAI (Responses), Anthropic, Gemini, OpenRouter — body-only output
151
+ - **6 provider adapters** — OpenAI (Chat), OpenAI (Responses), Anthropic, Gemini, OpenRouter, LLMAsAService
165
152
  - **Provider-aware input caching controls** — optional `cache` front matter maps to OpenAI prompt cache hints, Anthropic `cache_control`, and Gemini `cachedContent`
166
153
  - **Vendor escape hatch** — optional `raw.<provider>` blocks shallow-merge unmodeled request-body fields into the final provider payload
167
154
  - **Validation** — Zod schema validation, Levenshtein-based "did you mean?" for typos, variable usage checks
168
155
  - **Context hardening** — copyable `/pattern/i` regex literals, structured regexes with `return_message`, and built-in `non_empty` / `reject_secrets` validators
169
156
  - **Optional short-circuit messages** — validators can return a structured `returnMessage` instead of throwing when configured
170
157
  - **Context size guardrails** — optional per-input `max_size` metadata with non-blocking render-time warnings
158
+ - **History preservation** — optional `context.history.max_items` compacts older conversation turns into one preserved history item, with a runtime `onHistoryCompaction` hook for custom summaries
171
159
  - **Warning controls** — top-level config can suppress or emit context size warnings differently in dev and prod
172
160
  - **Caching** — LRU cache with mtime-based invalidation
173
161
  - **CLI** — init, validate, compile, render, inspect, skill
@@ -215,6 +203,24 @@ result = await kit.renderPrompt({
215
203
  variables: { name: 'World', app_context: 'Welcome screen' },
216
204
  });
217
205
  if (!result.request) throw new Error(result.returnMessage ?? 'Prompt rendering failed.');
206
+
207
+ // LLMAsAService — OpenAI-compatible gateway with project and customer metadata
208
+ result = await kit.renderPrompt({
209
+ path: 'hello',
210
+ provider: 'llmasaservice',
211
+ runtime: {
212
+ provider_options: {
213
+ llmasaservice: {
214
+ project_id: process.env.LLM_GATEWAY_PROJECT_ID,
215
+ customer: { customer_id: 'cust_123', customer_name: 'Acme' },
216
+ },
217
+ },
218
+ },
219
+ variables: { name: 'World', app_context: 'Welcome screen' },
220
+ });
221
+ if (!result.request) throw new Error(result.returnMessage ?? 'Prompt rendering failed.');
222
+ // result.request.body → { model, messages, customer, ... }
223
+ // result.request.headers → { 'x-project-id': '...' }
218
224
  ```
219
225
 
220
226
  Provider adapters are also available as direct imports:
@@ -225,6 +231,7 @@ import { openaiResponsesAdapter } from 'promptopskit/openai-responses';
225
231
  import { anthropicAdapter } from 'promptopskit/anthropic';
226
232
  import { geminiAdapter } from 'promptopskit/gemini';
227
233
  import { openrouterAdapter } from 'promptopskit/openrouter';
234
+ import { llmasaserviceAdapter } from 'promptopskit/llmasaservice';
228
235
  ```
229
236
 
230
237
  Direct adapter rendering also accepts `environment` and `tier` selectors. This is useful for compiled JSON/ESM assets in browser, edge, or worker code:
@@ -254,9 +261,9 @@ In browser or client-side code, keep provider credentials on the server. Use the
254
261
 
255
262
  ### Provider-specific fields and raw passthrough
256
263
 
257
- Use normalized fields first (`sampling`, `response`, `cache`, `tools`) so prompts stay portable. `response.schema` is the neutral JSON Schema path; adapters emit it as OpenAI/OpenRouter `response_format`, OpenAI Responses `text.format`, Anthropic `output_config.format`, and Gemini `generationConfig.responseJsonSchema`.
264
+ Use normalized fields first (`sampling`, `response`, `cache`, `tools`) so prompts stay portable. `response.schema` is the neutral JSON Schema path; adapters emit it as OpenAI/OpenRouter/LLMAsAService `response_format`, OpenAI Responses `text.format`, Anthropic `output_config.format`, and Gemini `generationConfig.responseJsonSchema`. You can also provide `response.schema_ref` to load schema from a prompt-relative `.json` file or `.js/.mjs/.cjs` zod module (mutually exclusive with `response.schema`).
258
265
 
259
- Use `provider_options` when PromptOpsKit has a known provider-specific mapping, such as Anthropic `top_k`, Gemini's native `response_schema`, or OpenRouter routing fields.
266
+ Use `provider_options` when PromptOpsKit has a known provider-specific mapping, such as Anthropic `top_k`, Gemini's native `response_schema`, OpenRouter routing fields, or LLMAsAService gateway routing/customer metadata.
260
267
 
261
268
  ```yaml
262
269
  response:
@@ -273,8 +280,16 @@ provider_options:
273
280
  provider:
274
281
  order: ["anthropic", "openai"]
275
282
  transforms: ["middle-out"]
283
+ llmasaservice:
284
+ project_id: "llm-project-id"
285
+ # Optional default; usually pass the real customer at render time.
286
+ customer:
287
+ customer_id: "cust_123"
288
+ customer_name: "Acme"
276
289
  ```
277
290
 
291
+ For LLMAsAService, `provider_options.llmasaservice.customer` is intended to be render-time attribution for the current account/user. A prompt can keep a default, but production calls should normally override it through `runtime.provider_options.llmasaservice.customer`.
292
+
278
293
  When a provider adds a body field PromptOpsKit does not model yet, use `raw`:
279
294
 
280
295
  ```yaml
@@ -290,6 +305,8 @@ raw:
290
305
  openrouter:
291
306
  usage:
292
307
  include: true
308
+ llmasaservice:
309
+ conversationId: "conv_123"
293
310
  ```
294
311
 
295
312
  Each adapter reads only its matching raw block and shallow-merges it into the generated request body after normalized mappings. This is intentionally an escape hatch; prefer first-class fields when they exist.
@@ -323,9 +340,32 @@ If you need a different layout, keep passing `sourceDir` and `compiledDir` expli
323
340
 
324
341
  `renderPrompt()` and `validatePrompt()` use the same source-versus-compiled resolution rules as `kit.renderPrompt()`. The existing synchronous `render()` and `validate()` methods still work for already-resolved compiled or inline assets.
325
342
 
343
+ ## How It Compares to GitHub Models
344
+
345
+ GitHub Models is a good place to prototype prompts, compare models, and run evaluations inside GitHub.
346
+
347
+ PromptOpsKit is focused on the application runtime layer. Use it when prompt behavior needs to live in your repo with validated inputs, reusable composition, environment and tier overrides, sidecar tests, compiled artifacts, and provider-ready request bodies.
348
+
349
+ Use GitHub Models when you want:
350
+
351
+ - A GitHub-hosted prompt playground
352
+ - Side-by-side model comparison
353
+ - Evaluation workflows inside GitHub
354
+ - `.prompt.yml` files for prompt experiments and evals
355
+
356
+ Use PromptOpsKit when you want:
357
+
358
+ - Runtime-focused Markdown prompt assets
359
+ - Production input hardening and validation
360
+ - Reusable `includes` and folder-level `defaults.md`
361
+ - Environment-specific model and parameter overrides
362
+ - Deterministic local and CI testing without model calls
363
+ - Provider-specific request bodies for your own runtime code
364
+ - Control over SDKs, auth, retries, routing, observability, and billing
365
+
326
366
  ## Optional UsageTap Tracking
327
367
 
328
- PromptOpsKit can also help you track provider calls with UsageTap.com while keeping the core render API body-only.
368
+ PromptOpsKit can also help you track provider calls with UsageTap.com while keeping the core render API transport-light.
329
369
 
330
370
  ```typescript
331
371
  import { createPromptOpsKit } from 'promptopskit';
@@ -389,7 +429,7 @@ const tracked = await runOpenAIWithUsageTap(usageTap, {
389
429
 
390
430
  Notes:
391
431
  - `entitlementMode` defaults to `'off'`. Set it to `'apply'` only when you want UsageTap allowances to mutate a cloned provider request.
392
- - `runOpenRouterWithUsageTap`, `runAnthropicWithUsageTap`, and `runGeminiWithUsageTap` follow the same pattern.
432
+ - `runOpenRouterWithUsageTap`, `runLLMAsAServiceWithUsageTap`, `runAnthropicWithUsageTap`, and `runGeminiWithUsageTap` follow the same pattern.
393
433
  - `extractOpenAIUsage`, `extractAnthropicUsage`, and `extractGeminiUsage` are public if you want to manage UsageTap lifecycle yourself.
394
434
 
395
435
  For explicit lifecycle control, use `beginUsageTapCall`, `endUsageTapCall`, or `withUsageTapCall` from `promptopskit/usagetap`. Full documentation: [docs/usagetap.md](./docs/usagetap.md).
@@ -456,13 +496,15 @@ Handle support requests carefully.
456
496
 
457
497
  Define a `defaults.md` file in `prompts/` (and optional subfolders) to provide inherited defaults for prompts:
458
498
 
459
- - Shared `provider` and `model` in front matter
499
+ - Shared `provider`, `model`, `fallback_models`, `reasoning`, `sampling`, `response`, `cache`, `provider_options`, `raw`, `tools`, `mcp`, `context`, `includes`, `environments`, and `tiers` in front matter
460
500
  - Shared `metadata` defaults in front matter
461
501
  - Shared `# System instructions` in body
462
502
  - Nearest subfolder `defaults.md` overrides parent defaults
463
503
  - Prompt-local values always win over defaults
464
504
  - Included files (`includes`) are not affected by folder defaults
465
505
 
506
+ Scalars and arrays are replaced by nearer values. Object blocks are shallow-merged, including provider sub-blocks such as `provider_options.llmasaservice` and `cache.openai`.
507
+
466
508
  > `promptopskit init` scaffolds a starter `defaults.md` in the prompts root.
467
509
 
468
510
  ```text
@@ -582,14 +624,15 @@ Renders a prompt for a specific provider. Returns `{ resolved, request?, returnM
582
624
  |--------|------|-------------|
583
625
  | `path` | `string` | Prompt path (no extension), e.g. `'support/reply'` |
584
626
  | `source` | `string` | Inline prompt source (alternative to path) |
585
- | `provider` | `string` | `'openai'`, `'openai-responses'`, `'anthropic'`, `'gemini'`, `'openrouter'` |
627
+ | `provider` | `string` | `'openai'`, `'openai-responses'`, `'anthropic'`, `'gemini'`, `'openrouter'`, `'llmasaservice'` |
586
628
  | `variables` | `Record<string, string>` | Template variables |
587
629
  | `onContextOverflow` | `(info) => string` | Optional callback to transform oversized context values before rendering |
630
+ | `onHistoryCompaction` | `(info) => string \| { role, content }` | Optional callback to compact overflow history when `context.history.max_items` is exceeded |
588
631
  | `environment` | `string` | Environment override name |
589
632
  | `tier` | `string` | Tier override name |
590
- | `history` | `Array<{ role, content }>` | Conversation history |
633
+ | `history` | `Array<{ role, content }>` | Conversation history. If the prompt declares `context.history.max_items`, older turns are compacted into one preserved history item before provider rendering. |
591
634
  | `toolRegistry` | `Record<string, unknown>` | Tool definitions for resolving string tool references |
592
- | `strict` | `boolean` | Fail on missing variables |
635
+ | `strict` | `boolean` | Fail on missing variables except object-form inputs marked `optional: true` |
593
636
  | `openaiResponses` | `object` | Optional Responses API extras (`previous_response_id`, `conversation`, `instructions`, `parallel_tool_calls`, `max_tool_calls`, `store`, `metadata`, `include`, `background`) |
594
637
 
595
638
  ### `kit.loadPrompt(path)` / `kit.resolvePrompt(path, options)` / `kit.validatePrompt(path)`
@@ -610,18 +653,18 @@ Prompt files use YAML front matter with these fields:
610
653
  |-------|------|-------------|
611
654
  | `id` | `string` | Unique prompt identifier (required) |
612
655
  | `schema_version` | `number` | Schema version, currently `1` |
613
- | `provider` | `string` | `openai`, `openai-responses`, `anthropic`, `gemini` (or `google`), `openrouter`, `any` |
656
+ | `provider` | `string` | `openai`, `openai-responses`, `anthropic`, `gemini` (or `google`), `openrouter`, `llmasaservice`, `any` |
614
657
  | `model` | `string` | Model name |
615
658
  | `fallback_models` | `string[]` | Fallback model list |
616
659
  | `reasoning` | `object` | `{ effort, budget_tokens }` |
617
660
  | `sampling` | `object` | `{ temperature, top_p, frequency_penalty, presence_penalty, stop, max_output_tokens }` |
618
- | `response` | `object` | `{ format, stream, schema, schema_name, schema_description, schema_strict }` |
661
+ | `response` | `object` | `{ format, stream, schema, schema_ref, schema_name, schema_description, schema_strict }` |
619
662
  | `cache` | `object` | Provider-specific cache controls (`openai`, `anthropic`, `gemini`/`google`) |
620
663
  | `tools` | `array` | Tool references (string names or inline definitions) |
621
- | `provider_options` | `object` | Provider-specific non-portable options (`anthropic`, `gemini`, `openrouter`) |
622
- | `raw` | `object` | Provider-scoped request-body passthrough (`openai`, `openai-responses`, `anthropic`, `gemini`/`google`, `openrouter`) |
664
+ | `provider_options` | `object` | Provider-specific non-portable options (`anthropic`, `gemini`, `openrouter`, `llmasaservice`) |
665
+ | `raw` | `object` | Provider-scoped request-body passthrough (`openai`, `openai-responses`, `anthropic`, `gemini`/`google`, `openrouter`, `llmasaservice`) |
623
666
  | `mcp` | `object` | MCP server references |
624
- | `context` | `object` | `{ inputs, history }` — declare expected variables, with optional per-input `max_size`, `trim`, structured or literal `allow_regex`/`deny_regex`, and built-in `non_empty` / `reject_secrets` validators |
667
+ | `context` | `object` | `{ inputs, history }` — declare expected variables, with optional per-input `optional`, `warnings`, `max_size`, `trim`, structured or literal `allow_regex`/`deny_regex`, built-in `non_empty` / `reject_secrets` validators, and `history.max_items` compaction |
625
668
  | `includes` | `string[]` | Paths to included prompt files |
626
669
  | `environments` | `object` | Named environment overrides |
627
670
  | `tiers` | `object` | Named tier overrides |