@praxisui/ai 8.0.0-beta.30 → 8.0.0-beta.31

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 CHANGED
@@ -95,9 +95,9 @@ Message-level actions can also be rendered as icon-only controls by setting `ico
95
95
 
96
96
  `PraxisAiAssistantDockComponent` is the companion minimized-session surface for the same assistant identity. Hosts use it when a specialized assistant session remains active but the full shell is minimized. The dock owns the shared visual language for assistant presence, state badges and reopen affordance; hosts still provide the semantic session summary and decide what reopening means.
97
97
 
98
- `PraxisAssistantSessionRegistryService` is the canonical in-memory registry for assistant sessions opened by different Praxis components in the same application shell. Component hosts register their active or minimized sessions with stable `ownerId`/`ownerType` metadata so a global assistant host can present one shared experience while preserving each component's semantic context. The registry accepts an optional `PraxisAssistantContextSnapshot`, normalizes it before storage and rejects snapshots whose `identity.sessionId`, `identity.ownerId` or `identity.ownerType` do not match the session descriptor. Components that already have a canonical context snapshot should prefer the context helpers: `upsertContextSession`, `openContextSession`, `minimizeContextSession`, `getContextSession` and `removeContextSession`.
98
+ `PraxisAssistantSessionRegistryService` is the canonical in-memory registry for assistant sessions opened by different Praxis components in the same application shell. Component hosts register their active or minimized sessions with stable `ownerId`/`ownerType` metadata so a global assistant host can present one shared experience while preserving each component's semantic context. Sessions can use the default `presence: 'global-dock'` when the App Shell should render the minimized card, or `presence: 'origin-anchor'` when the owning component keeps the minimized affordance on its original trigger. The registry accepts an optional `PraxisAssistantContextSnapshot`, normalizes it before storage and rejects snapshots whose `identity.sessionId`, `identity.ownerId` or `identity.ownerType` do not match the session descriptor. Components that already have a canonical context snapshot should prefer the context helpers: `upsertContextSession`, `openContextSession`, `minimizeContextSession`, `getContextSession` and `removeContextSession`.
99
99
 
100
- `PraxisAiAssistantSessionHostComponent` is the canonical presence host for minimized assistant sessions in an application or page shell. It reads `PraxisAssistantSessionRegistryService`, renders the shared dock for each minimized session, and emits the opened session snapshot after promoting that session to active in the registry. Specialized components still own the full shell events until their authoring action contracts are promoted to shared platform contracts.
100
+ `PraxisAiAssistantSessionHostComponent` is the canonical presence host for minimized assistant sessions in an application or page shell. It reads `PraxisAssistantSessionRegistryService`, renders the shared dock for each minimized `global-dock` session, and emits the opened session snapshot after promoting that session to active in the registry. Hosts can opt into `includeOriginAnchored=true` for diagnostics or custom shells, but the default respects owner-local minimized affordances. Specialized components still own the full shell events until their authoring action contracts are promoted to shared platform contracts.
101
101
 
102
102
  `PraxisAssistantContextSnapshot` is the canonical, UI-agnostic context contract for intelligent Praxis components. It represents safe assistant context: stable identity, current target, context chips, manifest reference, resource/schema hints, digests, governance hints, attachment summaries and declarative action contracts. It is intentionally not a raw component payload. Hosts should normalize snapshots with `normalizePraxisAssistantContextSnapshot` before storing them in a registry, passing them between components or using them as a handoff boundary.
103
103
 
@@ -110,6 +110,17 @@ The shell intentionally does not own component semantics. Specialized flows stil
110
110
 
111
111
  This keeps a single assistant identity across Praxis components while preserving the canonical owner of each config or authoring document.
112
112
 
113
+ ### Component Authoring Context
114
+
115
+ Configurable components that support AI authoring should expose a safe `authoringContract` through `AiConfigAdapter.getAuthoringContext()`. The contract lives at component level, not per capability, and can declare the response modes the component supports:
116
+
117
+ - `consult/answer` for questions about the current component, such as active resource path, endpoint, schema fields, styling capabilities or how-to guidance.
118
+ - `edit/componentEditPlan` for governed changes that must be compiled and reviewed before they become a patch.
119
+
120
+ When a component exposes factual grounding for consultative answers, include a `consultativeContext` with the minimal safe facts, such as `resourcePath` and `answerableQuestionKinds`. The frontend must not classify intent through local keywords; it sends this context to the backend/LLM orchestrator, which decides whether the turn is `consult/answer` or `edit/componentEditPlan`. Do not duplicate this declaration on every operation. Individual operations should still describe their own target, effects, validators and materialization through the component manifest or edit-plan contract.
121
+
122
+ Use `createComponentAuthoringContext(...)` from `@praxisui/ai` when returning the adapter context. The helper normalizes the contract into a JSON-safe object, drops `undefined` fields and rejects non-JSON values before they leak into `contextHints`.
123
+
113
124
  The shell ships with centralized PT-BR default labels and accepts the `labels` input for a flow-specific override. The override is partial: omitted labels continue to come from the shared defaults.
114
125
 
115
126
  By default, the prompt composer submits with `Enter` and keeps `Shift+Enter` for multiline prompts. Hosts with custom composer behavior can set `submitOnEnter` to `false`.