Document PromptKit comparison and catalogs
This commit is contained in:
@@ -11,7 +11,7 @@ through `commandkit.New` or `App.Register`.
|
||||
| --- | --- |
|
||||
| `gitea.maximumdirect.net/eric/CommandKit` | The application needs typed command declarations and common CLI behavior. |
|
||||
| `gitea.maximumdirect.net/eric/CommandKit/integrations/ckconfig` | The application wants ConfigKit-backed configuration scopes and reports. |
|
||||
| `gitea.maximumdirect.net/eric/CommandKit/integrations/ckprompt` | The application wants PromptKit engine configuration or named prompt/profile inspection. |
|
||||
| `gitea.maximumdirect.net/eric/CommandKit/integrations/ckprompt` | The application wants PromptKit engine configuration/comparison, prompt/profile catalogs, or named inspection. |
|
||||
|
||||
The two integrations are independent optional imports. `ckprompt` uses the
|
||||
public scope and error contracts from `ckconfig`; importing it does not add the
|
||||
@@ -123,29 +123,41 @@ owns operator syntax and report details.
|
||||
|
||||
`ckprompt.ConfigScope(loadEngine)` returns a `ckconfig.Scope` for the PromptKit
|
||||
engine's captured configuration. Add that scope to a `ckconfig.Suite` to expose
|
||||
it under `config`; it does not install named definition commands.
|
||||
it under `config` with validate/show/sources/explain and native diff operations;
|
||||
it does not install named definition commands.
|
||||
|
||||
`ckprompt.FromEngine(loadEngine)` supplies PromptKit named prompt and profile
|
||||
inspection callbacks. Set its `NewInput`, `NewState`, selectors, or validation
|
||||
when the application needs them, then pass `ckprompt.Command(suite)` to core.
|
||||
Prompt and profile capabilities can be installed independently by providing
|
||||
only the corresponding callback. Each selected inspection prepares one input
|
||||
and one state value when those steps are reached. See
|
||||
`ckprompt.FromEngine(loadEngine)` supplies the prompt/profile catalog callbacks
|
||||
and named inspection callbacks. Set its `NewInput`, `NewState`, selectors, or
|
||||
validation when the application needs them, then pass `ckprompt.Command(suite)`
|
||||
to core. The four callbacks are independently optional; `Command` creates `list`
|
||||
and `show` groups only when their corresponding callbacks are present. Narrow a
|
||||
bundled suite before command capture when the application wants catalogs without
|
||||
named inspections:
|
||||
|
||||
```go
|
||||
definitions := ckprompt.FromEngine(loadEngine)
|
||||
definitions.InspectPrompt = nil
|
||||
definitions.InspectProfile = nil
|
||||
definitionCommand := ckprompt.Command(definitions)
|
||||
```
|
||||
|
||||
Each selected inspection or catalog operation prepares one input, applies its
|
||||
captured selectors, checks that input, and initializes one state value when
|
||||
those steps are reached. See
|
||||
[ckprompt.Suite's GoDoc](../../integrations/ckprompt/adapters.go) for factory
|
||||
timing, omitted-factory zero values, and caller-owned objects and effects.
|
||||
The loader receives invocation context, explicitly supplied selection, input,
|
||||
and state. The adapter
|
||||
uses PromptKit's public inspection methods and preserves acquisition diagnostics
|
||||
and error identity.
|
||||
and state. The adapter uses PromptKit's public listing and inspection methods
|
||||
and preserves acquisition diagnostics and supported error identity.
|
||||
|
||||
CommandKit-owned inspection code does not execute prompts, contact model
|
||||
CommandKit-owned listing and inspection code does not execute prompts, contact model
|
||||
providers, or resolve credential values; application loaders and direct callbacks
|
||||
retain their own effects. The [CLI reference](../cli.md#promptkit-definition-inspection)
|
||||
owns the inspection boundary and credential-report semantics.
|
||||
owns the command and report contracts.
|
||||
|
||||
The [composed example](../../integrations/ckprompt/examples/composed/README.md)
|
||||
combines app and PromptKit config scopes, independently registers profile
|
||||
inspection, and adds an application-owned `session restore` command.
|
||||
combines app and PromptKit config scopes, comparison and catalogs, named
|
||||
inspection, and an application-owned `session restore` command.
|
||||
|
||||
## Outcomes and ownership
|
||||
|
||||
|
||||
Reference in New Issue
Block a user