@plumbus/ai-decision-typesafe 0.2.3 → 0.3.0-beta.1

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.
@@ -7,9 +7,9 @@
7
7
 
8
8
  **Classification, categorization, provider/model selection, TypeSafe/Jev or Laya:**
9
9
  read `node_modules/@plumbus/core/instructions/ai-classification.md` first (core
10
- **0.7.4+**), then [framework.md](framework.md) for this package.
10
+ **0.8.0-beta.6+**), then [framework.md](framework.md) for this package.
11
11
 
12
- Core 0.7.3+ provides `ctx.ai.decide()`; core 0.7.4+ also routes `ctx.ai.classify()`
12
+ Core 0.8.0-beta.6+ provides `ctx.ai.decide()` and also routes `ctx.ai.classify()`
13
13
  to explicitly registered decision adapters. Keep app business logic in Plumbus
14
14
  primitives and `ctx.*`. Never route predictions around capability access checks
15
15
  or confirmation policy. Provider registration is explicit in `app/server.ts`.
@@ -4,7 +4,7 @@ TypeSafe/Jev provider for typed choices, scores, and probabilities.
4
4
 
5
5
  ## Install and ownership
6
6
 
7
- Install `@plumbus/ai-decision-typesafe` explicitly. Its core peer is exactly `"0.7.x"`.
7
+ Install `@plumbus/ai-decision-typesafe` explicitly. Its core peer is exactly `">=0.8.0-beta.0 <0.9.0"` (core 0.8 beta family).
8
8
  Consumers reuse Zod/testing utilities from core; do not install them separately.
9
9
  Use this package for bounded typed decisions. Use core generation and embeddings
10
10
  for text responses and vector inference.
@@ -14,7 +14,7 @@ Public exports: `createTypeSafeDecisionAdapter` — construct an explicitly conf
14
14
  File map: `src/index.ts` is the public barrel, `src/__tests__/` exercises the public
15
15
  API, `instructions/` contains these recipes. Laya alone also ships `service/`.
16
16
 
17
- ## Classification and model selection (core 0.7.4+)
17
+ ## Classification and model selection (core 0.8.0-beta.6+)
18
18
 
19
19
  Read `node_modules/@plumbus/core/instructions/ai-classification.md` for the complete
20
20
  registration and usage recipe. Call `ctx.ai.classify({ text, labels, provider, model,
@@ -45,7 +45,7 @@ console.log(result.answers.refund.probability);
45
45
  1. Keep capabilities, flows, access policy and `ctx.*` as the application implementation path.
46
46
  2. Construct adapters at a server-owned infrastructure boundary and inject them. Keep keys on the server.
47
47
  3. Treat direct adapter usage as protocol integration, not a replacement for core's security/budget/audit lifecycle.
48
- 4. With core 0.7.3+, use `ctx.ai.decide()` in capabilities/flows. Export `decisions = { providers, defaultProvider }` from `app/server.ts`; API and workers share it. Do not register decision adapters as completion providers.
48
+ 4. With core 0.8.0-beta.6+, use `ctx.ai.decide()` in capabilities/flows. Export `decisions = { providers, defaultProvider }` from `app/server.ts`; API and workers share it. Do not register decision adapters as completion providers.
49
49
  5. Preserve distributions and provider confidence separately. A high confidence value is not authorization or proof of correctness.
50
50
  6. Validate thresholds on the actual task/model/language. Unknown cost is `null`, not free.
51
51
  7. Pass `signal: ctx.signal` and `timeoutMs` where needed. Flow steps supply their signal by default.
@@ -18,12 +18,12 @@ Validate choices, scores, probabilities, actual model/routing, usage and unknown
18
18
  cost handling. Measure live accuracy and calibration separately from connection
19
19
  success. Do not assert a universal confidence cutoff or guaranteed live label.
20
20
 
21
- For core 0.7.4+ classification, use `mockAI({ classify: ['billing'] })` and test
21
+ For core 0.8.0-beta.6+ classification, use `mockAI({ classify: ['billing'] })` and test
22
22
  through `runCapability()` / `simulateFlow()`. Integration tests should assert
23
23
  provider/model forwarding, zero/multiple matches, inclusive thresholds, and one
24
24
  `classify` cost row. Use injected fetch; routine tests do not require live Laya.
25
25
 
26
- For core 0.7.3+ integration tests, configure `mockAI({ decide: result })` or a real
26
+ For core 0.8.0-beta.6+ integration tests, configure `mockAI({ decide: result })` or a real
27
27
  `createAIService({ decisions, costTracker, onAICostRecorded })` with injected
28
28
  provider fetch. Assert exactly one cost row, identity, actual model/usage, unknown
29
29
  cost handling, billed validation failures, and budget rejection before dispatch.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumbus/ai-decision-typesafe",
3
- "version": "0.2.3",
3
+ "version": "0.3.0-beta.1",
4
4
  "description": "TypeSafe/Jev typed decision provider adapter for Plumbus.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -35,17 +35,17 @@
35
35
  "node": ">=20.6.0"
36
36
  },
37
37
  "peerDependencies": {
38
- "@plumbus/core": "0.7.x"
38
+ "@plumbus/core": ">=0.8.0-beta.0 <0.9.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@biomejs/biome": "^2.4.6",
42
42
  "@types/node": "^25.4.0",
43
43
  "typescript": "^5.7.0",
44
44
  "vitest": "^3.2.4",
45
- "@plumbus/core": "0.7.9"
45
+ "@plumbus/core": "0.8.0-beta.10"
46
46
  },
47
47
  "dependencies": {
48
- "@plumbus/ai-decision": "~0.2.3"
48
+ "@plumbus/ai-decision": "~0.3.0-beta.1"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "tsc -b",