Add prepared request preview

This commit is contained in:
2026-11-07 04:19:58 +00:00
parent c3d5f551c3
commit 8e5e64c6e9
9 changed files with 297 additions and 54 deletions

View File

@@ -555,6 +555,26 @@ performs a network probe. See the [PromptKit resource inspection contracts](http
A missing ID is a usage error; native lookup errors and cancellation retain
supported cause identity.
## PromptKit prepared-request preview
When `Suite.PrepareRequest` is present, `ckprompt.Command(suite)` installs
`promptkit show prepared PROMPT_ID` independently of validation and other
inspection commands. It accepts the same configuration, selector, profile,
session, variable, input, and execution flags as
[request validation](#concrete-request-validation):
```text
example promptkit show prepared briefing --llm-input-text topic=roadmap --format json
```
The command returns PromptKit's native prepared-run report using the shared
formats; automatic and explicit text use YAML. Preparation can read resources
and report rendered application content. It makes no model call and does not
guarantee a subsequent execution will succeed. Application callbacks and
loaders retain their own effects. Native preparation errors retain supported
cause identity. The [PromptKit Prepare API](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/8ff9aa3efdc9f16b9d2729e0a29ea083eb3c3eaf/engine.go)
owns the prepared value and upstream preparation behavior.
## PromptKit requirements
When `Suite.InspectRequirements` is present, `ckprompt.Command(suite)` installs
@@ -676,7 +696,8 @@ contain `=`. CommandKit splits at the first separator and preserves the exact
key/name and remaining value. Empty names and values are passed to native
validation. Text becomes a `promptkit.Inline` reference; file paths become
`promptkit.File` references without being read, normalized, expanded, or
rebased during argument binding. Every occurrence is parsed.
rebased during argument binding. Every occurrence is parsed; for each input
name the last text or file occurrence wins, regardless of form.
On success, the confirmation contains only the requested prompt ID and
`valid: true`: