@plumbus/core 0.8.0-beta.4 → 0.8.0-beta.6
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 +46 -0
- package/README.md +6 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/ai/ai/cost-tracker.d.ts +5 -1
- package/dist/ai/ai/model-pricing.d.ts +3 -2
- package/dist/ai/ai-service.d.ts +3 -0
- package/dist/ai/ai-service.d.ts.map +1 -1
- package/dist/ai/ai-service.js +146 -24
- package/dist/ai/ai-service.js.map +1 -1
- package/dist/ai/cost-tracker.d.ts +5 -1
- package/dist/ai/cost-tracker.d.ts.map +1 -1
- package/dist/ai/cost-tracker.js +7 -2
- package/dist/ai/cost-tracker.js.map +1 -1
- package/dist/ai/explainability.d.ts +2 -1
- package/dist/ai/explainability.d.ts.map +1 -1
- package/dist/ai/explainability.js +1 -0
- package/dist/ai/explainability.js.map +1 -1
- package/dist/ai/model-pricing.d.ts +3 -2
- package/dist/ai/model-pricing.d.ts.map +1 -1
- package/dist/ai/model-pricing.js +23 -2
- package/dist/ai/model-pricing.js.map +1 -1
- package/dist/ai/provider.d.ts.map +1 -1
- package/dist/ai/provider.js +10 -0
- package/dist/ai/provider.js.map +1 -1
- package/dist/api/route-generator.js +6 -6
- package/dist/api/route-generator.js.map +1 -1
- package/dist/audit/service.js +1 -1
- package/dist/audit/service.js.map +1 -1
- package/dist/cli/commands/browser-extension.d.ts +16 -0
- package/dist/cli/commands/browser-extension.d.ts.map +1 -1
- package/dist/cli/commands/browser-extension.js +16 -5
- package/dist/cli/commands/browser-extension.js.map +1 -1
- package/dist/cli/commands/dev.d.ts.map +1 -1
- package/dist/cli/commands/dev.js +2 -1
- package/dist/cli/commands/dev.js.map +1 -1
- package/dist/cli/commands/generate-openapi-from-zod.d.ts.map +1 -1
- package/dist/cli/commands/generate-openapi-from-zod.js +9 -1
- package/dist/cli/commands/generate-openapi-from-zod.js.map +1 -1
- package/dist/cli/commands/init.d.ts +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +3 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/migrate.d.ts.map +1 -1
- package/dist/cli/commands/migrate.js +5 -0
- package/dist/cli/commands/migrate.js.map +1 -1
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +2 -1
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/worker.js +1 -1
- package/dist/cli/commands/worker.js.map +1 -1
- package/dist/cli/discover.d.ts +2 -0
- package/dist/cli/discover.d.ts.map +1 -1
- package/dist/cli/discover.js +19 -2
- package/dist/cli/discover.js.map +1 -1
- package/dist/events/dispatcher.d.ts +1 -1
- package/dist/execution/capability-executor.d.ts +2 -2
- package/dist/execution/capability-executor.d.ts.map +1 -1
- package/dist/execution/capability-executor.js +23 -9
- package/dist/execution/capability-executor.js.map +1 -1
- package/dist/execution/context-factory.d.ts.map +1 -1
- package/dist/execution/context-factory.js +3 -0
- package/dist/execution/context-factory.js.map +1 -1
- package/dist/flows/engine.d.ts.map +1 -1
- package/dist/flows/engine.js +2 -0
- package/dist/flows/engine.js.map +1 -1
- package/dist/runtime/bootstrap.d.ts +3 -1
- package/dist/runtime/bootstrap.d.ts.map +1 -1
- package/dist/runtime/bootstrap.js +19 -4
- package/dist/runtime/bootstrap.js.map +1 -1
- package/dist/runtime/load-extensions.d.ts +2 -1
- package/dist/runtime/load-extensions.d.ts.map +1 -1
- package/dist/runtime/load-extensions.js +8 -1
- package/dist/runtime/load-extensions.js.map +1 -1
- package/dist/runtime/start-worker-pool.d.ts.map +1 -1
- package/dist/runtime/start-worker-pool.js +1 -0
- package/dist/runtime/start-worker-pool.js.map +1 -1
- package/dist/server/bootstrap.d.ts +3 -0
- package/dist/server/bootstrap.d.ts.map +1 -1
- package/dist/server/bootstrap.js +22 -3
- package/dist/server/bootstrap.js.map +1 -1
- package/dist/testing/context.d.ts +2 -0
- package/dist/testing/context.d.ts.map +1 -1
- package/dist/testing/context.js +7 -3
- package/dist/testing/context.js.map +1 -1
- package/dist/types/context.d.ts +15 -1
- package/dist/types/context.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/worker/bootstrap.d.ts.map +1 -1
- package/dist/worker/bootstrap.js +98 -84
- package/dist/worker/bootstrap.js.map +1 -1
- package/instructions/README.md +2 -1
- package/instructions/ai-classification.md +114 -0
- package/instructions/ai.md +27 -0
- package/instructions/peer-dependencies.md +1 -1
- package/package.json +4 -3
- package/dist/ai/__typecheck-fixtures__/legacy-cost-api.d.ts +0 -5
- package/dist/ai/__typecheck-fixtures__/legacy-cost-api.d.ts.map +0 -1
- package/dist/ai/__typecheck-fixtures__/legacy-cost-api.js +0 -15
- package/dist/ai/__typecheck-fixtures__/legacy-cost-api.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @plumbus/core changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.0-beta.6 — 2026-09-23
|
|
4
|
+
|
|
5
|
+
Carries core 0.7.2 and 0.7.4 from `main` into the beta family (0.7.4 absorbed the unpublished 0.7.3).
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **Typed decisions through `ctx.ai.decide()`.** Capabilities and flows call decision adapters over the shared `@plumbus/ai-decision` contract, with security checks over state and questions, request bounds, budgets, cancellation forwarding and per-call cost/usage records attributed to tenant and actor. Register providers with `export const decisions = { providers, defaultProvider }` in `app/server.ts` (API and worker processes share it); named definitions are discovered under `app/decisions/`. Successful and failed decision calls reach `onAICostRecorded`, keeping known billed metadata after an invalid provider answer and recording unknown cost as `null`. `mockAI({ decide })` returns decision results in tests. Core now depends on `@plumbus/ai-decision` `~0.3.0-beta.0`; the TypeSafe and Laya adapters stay optional installs. Docs: [Decision providers](../../docs/ai/decision-providers.md).
|
|
10
|
+
- **`ctx.ai.classify()` selects a provider per call.** Optional `provider` and `model` pick a registered text provider or a TypeSafe/Laya decision adapter. Decision classification batches one probability question per label and returns the labels at or above `threshold` (default 0.5), with the same validation, security, budgets, cancellation and a single `classify` cost record; a name registered in both registries is refused. Calls without `provider` keep the default text provider and the `string[]` result. Text classification keeps provider admission and cost context. Recipe: `instructions/ai-classification.md`.
|
|
11
|
+
- **Agent wiring v17.** `plumbus init` links the classification recipe and the decision provider instruction indexes from every agent format; refresh existing apps with `plumbus init --patch --agent all`.
|
|
12
|
+
- **Structured final answers with native tools.** `generateWithUsage({ tools, outputValidation: 'prompt' })` validates a final answer against the prompt output schema once and records the usage of a failed validation; a malformed answer is not retried because a retry could repeat tool effects, and `tool_calls` results bypass validation. The OpenAI adapter forwards the schema beside native tools (Chat Completions `response_format`, Responses `text.format`). Pair with `@plumbus/chat` 0.3.0-beta.1 for structured custom-agent output. Docs: [AI integration](../../docs/ai/ai-integration.md#structured-answers-with-native-tools).
|
|
13
|
+
- **Pricing.** `claude-opus-5-5`: $4 input, $0.20 cached input, $5 five-minute cache writes, $20 output per million tokens, no long-context surcharge. `gpt-6-sol` ($2 / $0.20 / $10) and `gpt-6-luna` ($0.10 / $0.01 / $0.50), including cache writes and the full-request long-context premium above 272K input tokens.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- **Generated OpenAPI documents a capability's declared `api.method`.** `plumbus generate` used the kind default (`get` for queries, `post` otherwise), so a capability the server routes as `PATCH` was documented as `post` and generated clients got a 404. The declared method now wins; the kind default applies only when none is declared.
|
|
18
|
+
|
|
19
|
+
## 0.8.0-beta.5 — 2026-09-20
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- Polling flow workers acquire one lease at a time, bound each cycle by the configured batch limit, and prevent overlapping polls from reclaiming waiting work.
|
|
24
|
+
- Static capability and HTTP queued-job access checks precede input parsing, preventing unauthorized schema disclosures. Input-aware hooks still receive parsed input.
|
|
25
|
+
- `migrate apply` exits unsuccessfully on migration, preflight, database-selection, creation, and connection errors while preserving connection cleanup and JSON diagnostics.
|
|
26
|
+
|
|
3
27
|
## 0.8.0-beta.4 — 2026-09-17
|
|
4
28
|
|
|
5
29
|
Repository tag `v0.8.0-beta.3` already pointed at the format-only commit and no `0.8.0-beta.3` package was published, so this increment is `beta.4`.
|
|
@@ -76,6 +100,28 @@ Repository tag `v0.8.0-beta.3` already pointed at the format-only commit and no
|
|
|
76
100
|
- `WorkerPoolConfig.schedulePlanes` and `app/server.ts` `export const schedulePlanes`: tenant planes for the scheduler alone, for hosts that route tenant data themselves; flows, events and the outbox keep the pool plane.
|
|
77
101
|
- The scheduler syncs and polls the pool only when a registered flow is scheduled on the spine, tolerates a plane it cannot resolve or read, and reports the driver's cause.
|
|
78
102
|
|
|
103
|
+
## 0.7.4 — Unreleased
|
|
104
|
+
|
|
105
|
+
- Bump agent wiring to v17 and add a packaged classification recipe covering explicit provider/model selection, defaults, thresholds, and cost recording. All agent formats link the recipe and decision provider instruction indexes; refresh existing apps with `plumbus init --patch --agent all`.
|
|
106
|
+
|
|
107
|
+
- Let `ctx.ai.classify()` select a registered text or decision provider with optional `provider`/`model`. TypeSafe/Laya classification batches probability questions and returns labels meeting `threshold` (default 0.5), sharing decision validation, security, budgets, cancellation, and one `classify` cost record. Existing calls keep their generative default.
|
|
108
|
+
|
|
109
|
+
- Audit 20 decision integration failure scenarios with 30 unit/integration/real-HTTP regression cases. Snapshot billing context and isolate ledger observers from caller results. Share one cost-record ID/timestamp between the tracker and persistence hook.
|
|
110
|
+
|
|
111
|
+
- Add `ctx.ai.decide()` over the shared decision contract, with per-call cost/usage records, tenant/actor attribution, named definitions, security checks over state and questions, budgets, and cancellation forwarding.
|
|
112
|
+
- Wire explicit `app/server.ts` decision registration and `app/decisions/` discovery into API and workers. Preserve decision feature flags through service wrappers and add decision responses to `mockAI`.
|
|
113
|
+
- Reuse `onAICostRecorded` for successful and failed decision calls, preserving unknown cost as null and retaining known billed metadata after invalid provider answers.
|
|
114
|
+
- Depend on `@plumbus/ai-decision@~0.2.2`; vendor adapters remain optional. Keep typecheck fixtures out of production compilation.
|
|
115
|
+
|
|
116
|
+
## 0.7.2 — 2026-09-23
|
|
117
|
+
|
|
118
|
+
- Add `claude-opus-5-5` standard pricing: $4 input, $0.20 cached input, $5 five-minute cache writes, and $20 output per million tokens, with no long-context surcharge. Rechecked earlier Opus rates against Anthropic's pricing on 2026-09-23.
|
|
119
|
+
|
|
120
|
+
- Add standard pricing for `gpt-6-sol` ($2 input / $0.20 cached input / $10 output per MTok) and `gpt-6-luna` ($0.10 / $0.01 / $0.50), including cache writes and the full-request long-context premium above 272K input tokens. Verified against OpenAI documentation on 2026-09-23.
|
|
121
|
+
|
|
122
|
+
- Support explicit same-call final-answer schema validation with native tools and forward the schema on OpenAI Chat Completions/Responses; malformed output is not retried.
|
|
123
|
+
- Install alongside `@plumbus/chat@0.2.2` to use prompt-schema validation for structured custom-agent output. Existing core `0.7.x` peer ranges are unchanged.
|
|
124
|
+
|
|
79
125
|
## 0.7.1 — 2026-09-10
|
|
80
126
|
|
|
81
127
|
### Fixed
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @plumbus/core
|
|
2
2
|
|
|
3
|
+
Release notes: [changelog](./CHANGELOG.md) and [0.8 upgrade notes](../../docs/upgrading-core-0.8.md).
|
|
4
|
+
|
|
3
5
|
**AI-native, contract-driven TypeScript application framework.**
|
|
4
6
|
|
|
5
7
|
Define your application through six composable primitives — Capabilities, Entities, Events, Flows, Prompts, and Translations — and get deny-by-default security, advisory governance, audit trails, and managed AI integration out of the box. Optional companion packages extend the surface for partner APIs, MCP agents, chat, knowledge, UI generation, and browser extensions — install only what you need.
|
|
@@ -151,6 +153,7 @@ node_modules/@plumbus/core/instructions/
|
|
|
151
153
|
├── flows.md # Workflow steps and retry logic
|
|
152
154
|
├── prompts.md # Prompt content, system/description, model config
|
|
153
155
|
├── ai.md # ctx.ai operations, RAG, cost tracking
|
|
156
|
+
├── ai-classification.md # Provider/model selection, TypeSafe/Jev, Laya
|
|
154
157
|
├── translations.md # i18n catalogs and ctx.translations
|
|
155
158
|
├── security.md # Access policies and tenant isolation
|
|
156
159
|
├── governance.md # Advisory rules and compliance
|
|
@@ -164,7 +167,9 @@ node_modules/@plumbus/core/instructions/
|
|
|
164
167
|
└── upgrading-0.5-capabilities.md # 0.5.x capability invocation migration
|
|
165
168
|
```
|
|
166
169
|
|
|
167
|
-
Wire them up with `plumbus init --agent all`.
|
|
170
|
+
Wire them up with `plumbus init --agent all`. After upgrading to core 0.7.4+ (0.8.0-beta.6+ in the 0.8 family), run
|
|
171
|
+
`plumbus init --patch --agent all` for wiring v17. For classification, provider/model
|
|
172
|
+
selection, or TypeSafe/Jev and Laya, start with [the classification recipe](instructions/ai-classification.md).
|
|
168
173
|
|
|
169
174
|
## Documentation
|
|
170
175
|
|