@plumbus/core 0.6.17 → 0.6.19
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/CHANGELOG.md +24 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/ai/ai/provider.d.ts +19 -6
- package/dist/ai/ai-service.d.ts +4 -1
- package/dist/ai/ai-service.d.ts.map +1 -1
- package/dist/ai/ai-service.js +31 -9
- package/dist/ai/ai-service.js.map +1 -1
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/provider.d.ts +19 -6
- package/dist/ai/provider.d.ts.map +1 -1
- package/dist/ai/provider.js +306 -12
- package/dist/ai/provider.js.map +1 -1
- package/dist/ai/tool-loop.d.ts.map +1 -1
- package/dist/ai/tool-loop.js +6 -1
- package/dist/ai/tool-loop.js.map +1 -1
- package/dist/ai/types/config.d.ts +4 -0
- package/dist/ai/types/prompt.d.ts +108 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/server/bootstrap.d.ts +3 -1
- package/dist/server/bootstrap.d.ts.map +1 -1
- package/dist/server/bootstrap.js.map +1 -1
- package/dist/testing/context.d.ts.map +1 -1
- package/dist/testing/context.js +1 -0
- package/dist/testing/context.js.map +1 -1
- package/dist/types/config.d.ts +4 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/context.d.ts +40 -2
- package/dist/types/context.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/prompt.d.ts +24 -6
- package/dist/types/prompt.d.ts.map +1 -1
- package/dist/types/prompt.js +5 -1
- package/dist/types/prompt.js.map +1 -1
- package/instructions/ai.md +17 -3
- package/instructions/peer-dependencies.md +1 -1
- package/instructions/prompts.md +3 -2
- package/package.json +2 -2
package/dist/types/index.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ export type { EventDefinition, EventEnvelope } from './event.js';
|
|
|
9
9
|
export type { BaseFieldOptions, BooleanFieldDescriptor, EnumFieldDescriptor, FieldDescriptor, IdFieldDescriptor, JsonFieldDescriptor, NumberFieldDescriptor, RelationFieldDescriptor, StringFieldDescriptor, TimestampFieldDescriptor, } from './fields.js';
|
|
10
10
|
export type { CapabilityStep, ConditionalStep, DelayStep, EventEmitStep, FlowDefinition, FlowRetryPolicy, FlowSchedule, FlowStep, FlowTrigger, ParallelStep, WaitStep, } from './flow.js';
|
|
11
11
|
export type { GovernanceOverride, GovernanceSignal, PolicyReport, RuleEvaluation, } from './governance.js';
|
|
12
|
-
export
|
|
12
|
+
export { ReasoningEffortValues, ReasoningLevelValues } from './prompt.js';
|
|
13
|
+
export type { AIReasoningConfig, ModelConfig, PromptDefinition, ReasoningEffort, ReasoningLevel, } from './prompt.js';
|
|
13
14
|
export type { PlumbusRegistry, RegisteredAppConfig, RegisteredCapabilityName, RegisteredEntities, RegisteredEventName, RegisteredEventPayloadMap, RegisteredFlowName, } from './registry.js';
|
|
14
15
|
export type { AccessPolicy, AuthContext } from './security.js';
|
|
15
16
|
export type { MessageCatalog, TranslationDefinition, TranslationResolver, TranslationService, } from './translation.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAMA,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE5D,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,2BAA2B,EAC3B,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,gBAAgB,EAChB,iBAAiB,E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,EACZ,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAMA,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE5D,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,2BAA2B,EAC3B,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,cAAc,EACd,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,UAAU,EACV,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,yBAAyB,EACzB,SAAS,EACT,aAAa,EACb,YAAY,EACZ,yBAAyB,EACzB,2BAA2B,EAC3B,aAAa,EACb,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,UAAU,EACV,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE5F,OAAO,EACL,eAAe,EACf,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,UAAU,GACX,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAElE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEjE,YAAY,EACV,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,cAAc,EACd,eAAe,EACf,SAAS,EACT,aAAa,EACb,cAAc,EACd,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,QAAQ,GACT,MAAM,WAAW,CAAC;AAEnB,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC1E,YAAY,EACV,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE/D,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC"}
|
package/dist/types/index.js
CHANGED
|
@@ -4,4 +4,6 @@
|
|
|
4
4
|
// context (ExecutionContext + service interfaces), security, governance, etc.
|
|
5
5
|
// ── Enums & Constants ──
|
|
6
6
|
export { BackoffStrategy, CapabilityKind, ErrorCode, FieldClassification, FlowStepType, GovernanceSeverity, PolicyProfile, RelationType, RuleStatus, } from './enums.js';
|
|
7
|
+
// ── Prompt ──
|
|
8
|
+
export { ReasoningEffortValues, ReasoningLevelValues } from './prompt.js';
|
|
7
9
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,iEAAiE;AACjE,uEAAuE;AACvE,8EAA8E;AAmE9E,0BAA0B;AAC1B,OAAO,EACL,eAAe,EACf,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,UAAU,GACX,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,iEAAiE;AACjE,uEAAuE;AACvE,8EAA8E;AAmE9E,0BAA0B;AAC1B,OAAO,EACL,eAAe,EACf,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,UAAU,GACX,MAAM,YAAY,CAAC;AAuCpB,eAAe;AACf,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/types/prompt.d.ts
CHANGED
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
+
/** Provider-neutral effort levels. Adapters translate these onto their own wire format. */
|
|
3
|
+
export declare const ReasoningLevelValues: readonly ["minimal", "low", "medium", "high", "xhigh", "max"];
|
|
4
|
+
export type ReasoningLevel = (typeof ReasoningLevelValues)[number];
|
|
5
|
+
/** Legacy OpenAI-only values. Kept unchanged for source compatibility. */
|
|
6
|
+
export declare const ReasoningEffortValues: readonly ["low", "medium", "high"];
|
|
2
7
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* configured — a model that rejects the parameter fails loudly rather than
|
|
6
|
-
* silently degrading. Adapters for providers without an equivalent
|
|
7
|
-
* parameter ignore it.
|
|
8
|
+
* Legacy OpenAI reasoning effort. Prefer {@link AIReasoningConfig} for new
|
|
9
|
+
* provider-aware configuration.
|
|
8
10
|
*/
|
|
9
|
-
export type ReasoningEffort =
|
|
11
|
+
export type ReasoningEffort = (typeof ReasoningEffortValues)[number];
|
|
12
|
+
/**
|
|
13
|
+
* Provider-neutral reasoning intent. The selected provider adapter owns wire
|
|
14
|
+
* translation and rejects modes it cannot represent before making network I/O.
|
|
15
|
+
* Omitting the field means "use the provider/model default".
|
|
16
|
+
*/
|
|
17
|
+
export type AIReasoningConfig = {
|
|
18
|
+
mode: 'disabled';
|
|
19
|
+
} | {
|
|
20
|
+
mode: 'effort';
|
|
21
|
+
effort: ReasoningLevel;
|
|
22
|
+
} | {
|
|
23
|
+
mode: 'budget';
|
|
24
|
+
maxTokens: number;
|
|
25
|
+
};
|
|
10
26
|
export interface ModelConfig {
|
|
11
27
|
provider?: string;
|
|
12
28
|
name?: string;
|
|
13
29
|
temperature?: number;
|
|
14
30
|
maxTokens?: number;
|
|
31
|
+
reasoning?: AIReasoningConfig;
|
|
32
|
+
/** @deprecated Use `reasoning`. Retained as a source-compatible shorthand. */
|
|
15
33
|
reasoningEffort?: ReasoningEffort;
|
|
16
34
|
}
|
|
17
35
|
export interface PromptDefinition<TInput extends z.ZodTypeAny = z.ZodTypeAny, TOutput extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/types/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/types/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,2FAA2F;AAC3F,eAAO,MAAM,oBAAoB,+DAAgE,CAAC;AAElG,MAAM,M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QG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;IAEvC;;;;;;;;;;;;;;;;OAgBG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAErC;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;;;;OAKG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IAEzC;;;;;OAKG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IAEzC;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC;CACxD"}
|
package/dist/types/prompt.js
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// ── Model Config ──
|
|
2
|
+
/** Provider-neutral effort levels. Adapters translate these onto their own wire format. */
|
|
3
|
+
export const ReasoningLevelValues = ['minimal', 'low', 'medium', 'high', 'xhigh', 'max'];
|
|
4
|
+
/** Legacy OpenAI-only values. Kept unchanged for source compatibility. */
|
|
5
|
+
export const ReasoningEffortValues = ['low', 'medium', 'high'];
|
|
2
6
|
//# sourceMappingURL=prompt.js.map
|
package/dist/types/prompt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/types/prompt.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/types/prompt.ts"],"names":[],"mappings":"AAEA,qBAAqB;AACrB,2FAA2F;AAC3F,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAU,CAAC;AAIlG,0EAA0E;AAC1E,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC"}
|
package/instructions/ai.md
CHANGED
|
@@ -27,7 +27,7 @@ export const summarizeTicket = definePrompt({
|
|
|
27
27
|
});
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
Prompts should NOT hardcode `provider` or model `name` unless you have a deliberate per-prompt override. Prefer env-based resolution (`AI_DEFAULT_*`, `PROMPT_{NAME}_*`) or `resolveAiOverrides` in `app/server.ts`. Only set `temperature`, `maxTokens`, and
|
|
30
|
+
Prompts should NOT hardcode `provider` or model `name` unless you have a deliberate per-prompt override. Prefer env-based resolution (`AI_DEFAULT_*`, `PROMPT_{NAME}_*`) or `resolveAiOverrides` in `app/server.ts`. Only set `temperature`, `maxTokens`, and provider-neutral `reasoning` when tuning is part of the contract. Bare `z.string()` outputs run in plain text mode. See `prompts.md` for `system`/`description` content and the full `ModelConfig` table.
|
|
31
31
|
|
|
32
32
|
## `ctx.ai` Operations
|
|
33
33
|
|
|
@@ -89,6 +89,20 @@ const { data, usage, model, provider, cost } = await ctx.ai.generateWithUsage({
|
|
|
89
89
|
|
|
90
90
|
`generateWithUsage` is **overloaded**: called without `tools` (as above) it returns the flat `AIFinalGenerateResult` — `.data` is always present, plus a `finishReason`. Called **with** `tools` it returns the discriminated `AIToolEnabledGenerateResult` (see [Tool calling](#tool-calling-provider-native)).
|
|
91
91
|
|
|
92
|
+
`generateWithUsage` also accepts per-call `provider`, `model`, and provider-neutral `reasoning` overrides:
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
await ctx.ai.generateWithUsage({
|
|
96
|
+
prompt: 'assistant.turn',
|
|
97
|
+
input: {},
|
|
98
|
+
provider: 'anthropic',
|
|
99
|
+
model: 'claude-sonnet-5',
|
|
100
|
+
reasoning: { mode: 'effort', effort: 'medium' },
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Omit `reasoning` to inherit prompt/config; use `null` to restore the provider/model default for one call, clearing both inherited `reasoning` and inherited legacy `reasoningEffort`. Explicit modes are `{ mode:'disabled' }`, `{ mode:'effort', effort:'minimal'|'low'|'medium'|'high'|'xhigh'|'max' }`, and `{ mode:'budget', maxTokens }`. Built-in core adapters translate the intent: OpenAI uses Chat Completions normally and switches caller-tool requests that need active/default GPT-5.6 reasoning to the Responses API; Anthropic uses `thinking` + `output_config.effort`. Responses tool continuations are stateless (`store:false`) and preserve encrypted reasoning items through server-owned `providerState`. Custom providers translate the contract in their own `AIProviderAdapter`. Unsupported modes fail with `AIInvalidRequestError` before provider I/O when the adapter can identify the incompatibility. Deprecated `reasoningEffort` remains the unchanged OpenAI-only `'low' | 'medium' | 'high'` shorthand.
|
|
105
|
+
|
|
92
106
|
### Tool calling (provider-native)
|
|
93
107
|
|
|
94
108
|
Pass `tools` to `generate` / `generateWithUsage` to let the model call functions natively. Both built-in adapters implement caller tools on the wire (OpenAI `tools`/`tool_calls`; Anthropic `tool_use`/`tool_result` + `input_schema`). Build each `AITool.parameters` from `zodToProviderJsonSchema(schema).schema`:
|
|
@@ -221,9 +235,9 @@ AI_MODEL=gpt-4o-mini
|
|
|
221
235
|
|
|
222
236
|
### Multi-Provider
|
|
223
237
|
|
|
224
|
-
Set `AI_DEFAULT_PROVIDER` to enable multi-provider mode. Env-based discovery supports **`AI_OPENAI_*`**, **`AI_ANTHROPIC_*`**, and **`AI_BEDROCK_*`** (region-based; no API key). Other `AI_{NAME}_API_KEY` values are ignored with a warning. Wire additional providers programmatically
|
|
238
|
+
Set `AI_DEFAULT_PROVIDER` to enable multi-provider mode. Env-based discovery supports **`AI_OPENAI_*`**, **`AI_ANTHROPIC_*`**, and **`AI_BEDROCK_*`** (region-based; no API key). Other `AI_{NAME}_API_KEY` values are ignored with a warning. Wire additional providers programmatically through `createAIService` and a custom `AIProviderAdapter`.
|
|
225
239
|
|
|
226
|
-
A present-but-empty
|
|
240
|
+
A present-but-empty API-key slot is treated as unset — the slot is skipped so a leftover blank dotenv line does not crash worker boot. If that provider is the default, set a real key. Do not invent a placeholder key to “satisfy” validation.
|
|
227
241
|
|
|
228
242
|
```bash
|
|
229
243
|
AI_DEFAULT_PROVIDER=openai
|
|
@@ -24,7 +24,7 @@ When adding a **new** publishable add-on under `packages/`, use `"0.5.x || 0.6.x
|
|
|
24
24
|
|
|
25
25
|
| Package | Declared peer | Runtime floor |
|
|
26
26
|
|---|---|---|
|
|
27
|
-
| `@plumbus/chat` **0.1.11+** | `0.5.x \|\| 0.6.x` | `@plumbus/core` **≥ 0.6.11
|
|
27
|
+
| `@plumbus/chat` **0.1.11+** | `0.5.x \|\| 0.6.x` | `@plumbus/core` **≥ 0.6.11**; optional `toolCalling.ai` overrides in chat 0.1.12 require **≥ 0.6.18** |
|
|
28
28
|
| `@plumbus/chat-ui` **0.1.7+** | `0.5.x \|\| 0.6.x` (+ `@plumbus/chat` `0.1.x`) | `@plumbus/chat` **≥ 0.1.11** (and thus core **≥ 0.6.11**) |
|
|
29
29
|
| `@plumbus/auth` | `0.6.x` | `@plumbus/core` **≥ 0.6.8** (`HttpAuthenticationRuntime`) |
|
|
30
30
|
| `@plumbus/api` **0.1.4+** | `0.5.x \|\| 0.6.x` | `@plumbus/core` **≥ 0.6.9** (`buildAuthenticationRequest` for partner session auth) |
|
package/instructions/prompts.md
CHANGED
|
@@ -53,9 +53,10 @@ By default, any input keys not referenced as `{{key}}` in `system`/`description`
|
|
|
53
53
|
| `name` | string? | Model id (e.g. `gpt-4o-mini`) |
|
|
54
54
|
| `temperature` | number? | Sampling temperature |
|
|
55
55
|
| `maxTokens` | number? | Max output tokens |
|
|
56
|
-
| `
|
|
56
|
+
| `reasoning` | `{ mode:'disabled' } \| { mode:'effort', effort } \| { mode:'budget', maxTokens }?` | Provider-neutral reasoning intent; the selected adapter translates or explicitly rejects it |
|
|
57
|
+
| `reasoningEffort` | `'low' \| 'medium' \| 'high'?` | Deprecated OpenAI-only shorthand; unchanged for source/runtime compatibility |
|
|
57
58
|
|
|
58
|
-
**Recommended convention:** omit `provider` and `name` in the prompt definition and resolve them via env (`AI_DEFAULT_PROVIDER`, `AI_DEFAULT_MODEL`, `PROMPT_{NAME}_*`) or the `resolveAiOverrides` hook in `app/server.ts`. Set only `temperature`, `maxTokens`, and (when needed) `
|
|
59
|
+
**Recommended convention:** omit `provider` and `name` in the prompt definition and resolve them via env (`AI_DEFAULT_PROVIDER`, `AI_DEFAULT_MODEL`, `PROMPT_{NAME}_*`) or the `resolveAiOverrides` hook in `app/server.ts`. Set only `temperature`, `maxTokens`, and (when needed) `reasoning` in the prompt when you want per-prompt tuning baked into the contract.
|
|
59
60
|
|
|
60
61
|
Bare `z.string()` prompt `output` schemas run in plain text mode (same as a single-string-field object). Prefer that for free-text prompts; use an object schema when you need structured fields.
|
|
61
62
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumbus/core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.19",
|
|
4
4
|
"description": "Plumbus framework core — types, SDK, runtime, CLI, test utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"@plumbus/api": "0.1.4",
|
|
107
107
|
"@plumbus/mcp": "0.5.1",
|
|
108
108
|
"@plumbus/ai-bedrock": "0.1.0",
|
|
109
|
-
"@plumbus/voice": "0.4.
|
|
109
|
+
"@plumbus/voice": "0.4.5"
|
|
110
110
|
},
|
|
111
111
|
"scripts": {
|
|
112
112
|
"build": "tsc -b",
|