@plumbus/core 0.6.19 → 0.7.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.
Files changed (158) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/ai/__typecheck-fixtures__/legacy-cost-api.d.ts +5 -0
  4. package/dist/ai/__typecheck-fixtures__/legacy-cost-api.d.ts.map +1 -0
  5. package/dist/ai/__typecheck-fixtures__/legacy-cost-api.js +15 -0
  6. package/dist/ai/__typecheck-fixtures__/legacy-cost-api.js.map +1 -0
  7. package/dist/ai/ai/cost-tracker.d.ts +4 -3
  8. package/dist/ai/ai/model-pricing.d.ts +14 -5
  9. package/dist/ai/ai/usage-client.d.ts +2 -0
  10. package/dist/ai/ai/usage-validation.d.ts +3 -0
  11. package/dist/ai/ai-service.d.ts.map +1 -1
  12. package/dist/ai/ai-service.js +101 -33
  13. package/dist/ai/ai-service.js.map +1 -1
  14. package/dist/ai/cost-tracker.d.ts +4 -3
  15. package/dist/ai/cost-tracker.d.ts.map +1 -1
  16. package/dist/ai/cost-tracker.js +33 -14
  17. package/dist/ai/cost-tracker.js.map +1 -1
  18. package/dist/ai/errors/data-errors.d.ts +22 -0
  19. package/dist/ai/errors/index.d.ts +21 -0
  20. package/dist/ai/errors/plumbus-error.d.ts +12 -0
  21. package/dist/ai/index.d.ts +1 -1
  22. package/dist/ai/index.d.ts.map +1 -1
  23. package/dist/ai/index.js +1 -1
  24. package/dist/ai/index.js.map +1 -1
  25. package/dist/ai/model-pricing.d.ts +14 -5
  26. package/dist/ai/model-pricing.d.ts.map +1 -1
  27. package/dist/ai/model-pricing.js +88 -45
  28. package/dist/ai/model-pricing.js.map +1 -1
  29. package/dist/ai/provider.d.ts.map +1 -1
  30. package/dist/ai/provider.js +22 -9
  31. package/dist/ai/provider.js.map +1 -1
  32. package/dist/ai/rag/pipeline.d.ts +2 -0
  33. package/dist/ai/rag/pipeline.d.ts.map +1 -1
  34. package/dist/ai/rag/pipeline.js +6 -1
  35. package/dist/ai/rag/pipeline.js.map +1 -1
  36. package/dist/ai/security.d.ts.map +1 -1
  37. package/dist/ai/security.js +1 -0
  38. package/dist/ai/security.js.map +1 -1
  39. package/dist/ai/tool-loop.d.ts +1 -0
  40. package/dist/ai/tool-loop.d.ts.map +1 -1
  41. package/dist/ai/tool-loop.js +23 -4
  42. package/dist/ai/tool-loop.js.map +1 -1
  43. package/dist/ai/types/errors.d.ts +14 -0
  44. package/dist/ai/usage-client.d.ts +2 -0
  45. package/dist/ai/usage-client.d.ts.map +1 -1
  46. package/dist/ai/usage-client.js +2 -0
  47. package/dist/ai/usage-client.js.map +1 -1
  48. package/dist/ai/usage-validation.d.ts +4 -0
  49. package/dist/ai/usage-validation.d.ts.map +1 -0
  50. package/dist/ai/usage-validation.js +23 -0
  51. package/dist/ai/usage-validation.js.map +1 -0
  52. package/dist/ai/validation.d.ts +1 -5
  53. package/dist/ai/validation.d.ts.map +1 -1
  54. package/dist/api/cookies.d.ts.map +1 -1
  55. package/dist/api/cookies.js +7 -2
  56. package/dist/api/cookies.js.map +1 -1
  57. package/dist/audit/service.d.ts.map +1 -1
  58. package/dist/audit/service.js +21 -3
  59. package/dist/audit/service.js.map +1 -1
  60. package/dist/audit/writer.d.ts.map +1 -1
  61. package/dist/audit/writer.js +7 -2
  62. package/dist/audit/writer.js.map +1 -1
  63. package/dist/auth/adapter.d.ts +5 -1
  64. package/dist/auth/adapter.d.ts.map +1 -1
  65. package/dist/auth/adapter.js +36 -6
  66. package/dist/auth/adapter.js.map +1 -1
  67. package/dist/auth/index.d.ts +1 -0
  68. package/dist/auth/index.d.ts.map +1 -1
  69. package/dist/auth/index.js +1 -0
  70. package/dist/auth/index.js.map +1 -1
  71. package/dist/auth/jwt-policy.d.ts +3 -0
  72. package/dist/auth/jwt-policy.d.ts.map +1 -0
  73. package/dist/auth/jwt-policy.js +11 -0
  74. package/dist/auth/jwt-policy.js.map +1 -0
  75. package/dist/auth/oidc-adapter.d.ts.map +1 -1
  76. package/dist/auth/oidc-adapter.js +30 -13
  77. package/dist/auth/oidc-adapter.js.map +1 -1
  78. package/dist/auth/saml-adapter.d.ts +7 -1
  79. package/dist/auth/saml-adapter.d.ts.map +1 -1
  80. package/dist/auth/saml-adapter.js +42 -5
  81. package/dist/auth/saml-adapter.js.map +1 -1
  82. package/dist/cli/commands/create.d.ts.map +1 -1
  83. package/dist/cli/commands/create.js +21 -0
  84. package/dist/cli/commands/create.js.map +1 -1
  85. package/dist/cli/commands/generate.d.ts.map +1 -1
  86. package/dist/cli/commands/generate.js +4 -3
  87. package/dist/cli/commands/generate.js.map +1 -1
  88. package/dist/cli/commands/init.d.ts +1 -1
  89. package/dist/cli/commands/init.d.ts.map +1 -1
  90. package/dist/cli/commands/init.js +7 -1
  91. package/dist/cli/commands/init.js.map +1 -1
  92. package/dist/cli/commands/mcp.d.ts.map +1 -1
  93. package/dist/cli/commands/mcp.js +4 -3
  94. package/dist/cli/commands/mcp.js.map +1 -1
  95. package/dist/cli/commands/translation.d.ts.map +1 -1
  96. package/dist/cli/commands/translation.js +8 -4
  97. package/dist/cli/commands/translation.js.map +1 -1
  98. package/dist/cli/mcp-serve-context.d.ts.map +1 -1
  99. package/dist/cli/mcp-serve-context.js +25 -6
  100. package/dist/cli/mcp-serve-context.js.map +1 -1
  101. package/dist/cli/scaffold-validation.d.ts +6 -0
  102. package/dist/cli/scaffold-validation.d.ts.map +1 -0
  103. package/dist/cli/scaffold-validation.js +57 -0
  104. package/dist/cli/scaffold-validation.js.map +1 -0
  105. package/dist/cli/scaffold-write.d.ts.map +1 -1
  106. package/dist/cli/scaffold-write.js +13 -3
  107. package/dist/cli/scaffold-write.js.map +1 -1
  108. package/dist/cli/templates/resources.d.ts.map +1 -1
  109. package/dist/cli/templates/resources.js +10 -0
  110. package/dist/cli/templates/resources.js.map +1 -1
  111. package/dist/cli/utils.d.ts +1 -1
  112. package/dist/cli/utils.d.ts.map +1 -1
  113. package/dist/cli/utils.js +13 -2
  114. package/dist/cli/utils.js.map +1 -1
  115. package/dist/config/loader.d.ts.map +1 -1
  116. package/dist/config/loader.js +7 -4
  117. package/dist/config/loader.js.map +1 -1
  118. package/dist/errors/http.d.ts.map +1 -1
  119. package/dist/errors/http.js +8 -3
  120. package/dist/errors/http.js.map +1 -1
  121. package/dist/events/queue.d.ts.map +1 -1
  122. package/dist/events/queue.js +27 -4
  123. package/dist/events/queue.js.map +1 -1
  124. package/dist/execution/capability-executor.js +2 -1
  125. package/dist/execution/capability-executor.js.map +1 -1
  126. package/dist/execution/context-factory.d.ts.map +1 -1
  127. package/dist/execution/context-factory.js +6 -2
  128. package/dist/execution/context-factory.js.map +1 -1
  129. package/dist/flows/engine.d.ts.map +1 -1
  130. package/dist/flows/engine.js +28 -18
  131. package/dist/flows/engine.js.map +1 -1
  132. package/dist/index.d.ts +1 -1
  133. package/dist/index.d.ts.map +1 -1
  134. package/dist/index.js +1 -1
  135. package/dist/index.js.map +1 -1
  136. package/dist/runtime/start-worker-pool.d.ts.map +1 -1
  137. package/dist/runtime/start-worker-pool.js +21 -9
  138. package/dist/runtime/start-worker-pool.js.map +1 -1
  139. package/dist/server/bootstrap.d.ts.map +1 -1
  140. package/dist/server/bootstrap.js +13 -9
  141. package/dist/server/bootstrap.js.map +1 -1
  142. package/dist/testing/e2e.js +1 -1
  143. package/dist/testing/e2e.js.map +1 -1
  144. package/dist/types/audit.d.ts +2 -0
  145. package/dist/types/audit.d.ts.map +1 -1
  146. package/dist/types/context.d.ts +11 -1
  147. package/dist/types/context.d.ts.map +1 -1
  148. package/instructions/README.md +1 -0
  149. package/instructions/ai.md +10 -2
  150. package/instructions/deployment.md +5 -2
  151. package/instructions/flows.md +3 -0
  152. package/instructions/framework.md +7 -0
  153. package/instructions/mcp.md +5 -2
  154. package/instructions/peer-dependencies.md +28 -64
  155. package/instructions/security.md +8 -1
  156. package/instructions/upgrading-0.5-capabilities.md +4 -1
  157. package/instructions/upgrading-security-release.md +65 -0
  158. package/package.json +9 -9
package/CHANGELOG.md CHANGED
@@ -1,5 +1,77 @@
1
1
  # @plumbus/core changelog
2
2
 
3
+ ## 0.7.1 — 2026-09-10
4
+
5
+ ### Fixed
6
+
7
+ - Publish the corrected package README without the added “Release family” banner, using normal `latest` publication. Runtime behavior and peer dependencies are unchanged from 0.7.0.
8
+
9
+ ## 0.7.0 — 2026-09-10 — security hardening and fixed pricing
10
+
11
+ ### Upgrade boundary
12
+
13
+ - This release is an explicit minor-line upgrade. Previous caret ranges exclude it; install the coordinated core 0.7.x family and follow the [migration checklist](../../docs/upgrading-security-release.md). Packages publish to npm’s default `latest` dist-tag.
14
+
15
+ ### Agent instructions
16
+
17
+ - Bump `AGENT_WIRING_VERSION` from 14 to **16**. Every generated agent format now points to the packaged security release checklist, including inline mode. `plumbus init --patch` upgrades existing managed blocks while retaining app-owned instructions.
18
+ - Update packaged auth, audit, RAG, cost, MCP, flow, and deployment guidance to match this release. Sol uses a bundled date-based price window; no runtime price fetching is introduced.
19
+
20
+ ### Fixed
21
+
22
+ - Bind AI retrieval and accounting to each execution identity; enforce exact RAG tenant namespaces and fail closed on invalid flow auth snapshots.
23
+ - Record successful/retried AI spend, reject malformed numeric accounting, and enforce configured budgets when prior prices are unknown. Preserve provider-supplied zero costs and local providers without dollar caps.
24
+ - Apply configured redaction to extraction/classification and explainability; substitute prompt values once.
25
+ - Reject shared development signing keys, non-expiring JWTs, SAML replay/correlation failures, ambiguous cookies, unsafe scaffold paths, and malformed queue envelopes. Bound JWKS refreshes and billing fetches.
26
+ - Make safe HTTP errors unconditional and audit writes idempotent across retries. Keep MCP worker completion compatible with the dependency-object API during rolling upgrades.
27
+
28
+ ### AI pricing and accounting
29
+
30
+ The fixed OpenAI/Anthropic catalog was refreshed on September 10. The following are changes to the framework's standard-tier estimates; all rates below are **USD per 1 million tokens**, with input/output listed in that order.
31
+
32
+ | Model | Previous catalog | 0.7.0 catalog |
33
+ | --- | --- | --- |
34
+ | `gpt-5.6-sol` | $5 / $30 | $4 / $20 before November 22 UTC; $5 / $30 from the cutoff |
35
+ | `gpt-6-astra` | Not cataloged | $10 / $50 |
36
+ | `gpt-5.6-cyber` | Not cataloged | $12.50 / $75 |
37
+ | `claude-fable-5-1` | Not cataloged | $10 / $50; cache reads $0.25 |
38
+ | `claude-mythos-5-1` | Not cataloged | $10 / $50; cache reads $0.25 |
39
+
40
+ - **Static Sol price window:** use $4 input, $0.40 cached input, and $20 output per MTok before `2026-11-22T00:00:00.000Z`; at and after the cutoff use the retained regular $5 / $0.50 / $30 rates. All values and the cutoff are bundled in code; lookups switch using the clock without fetching prices, scheduling jobs, or restarting. The `gpt-5.6` alias and supported dated names share the same window. Existing ledger rows are not repriced.
41
+ - **Cutoff interpretation:** [OpenAI documents](https://developers.openai.com/api/docs/models/gpt-5.6-sol) availability at least through November 21, 2026, not a guaranteed expiry. November 22 UTC is this framework's fallback policy. If OpenAI extends the promotion, estimates after that point can be higher until the bundled window is explicitly updated.
42
+ - **GPT-5.6 alias and long context:** `gpt-5.6` now resolves to Sol, including supported date-suffixed names. Above 272,000 input tokens, Sol uses 2× input/cache-read rates and 1.5× output rates ($8 / $0.80 / $30 during the special window; $10 / $1 / $45 afterward, for input/cache/output per MTok). The base rates apply at exactly 272,000 tokens. Cyber remains a separate catalog entry.
43
+ - **Sonnet 5 stays unchanged at $2 / $10.** Sonnet pricing has no date switch. No runtime pricing fetch is performed. Batch, Flex, and Fast mode pricing are not modeled.
44
+ - **Model-specific cache-read rates:** replace the blanket 10%-of-input assumption for the models below. Their base input/output rates are unchanged.
45
+
46
+ | Model | Previous cache-read estimate / MTok | 0.7.0 cache-read estimate / MTok |
47
+ | --- | --- | --- |
48
+ | `gpt-4.1` | $0.20 | $0.50 |
49
+ | `gpt-4.1-mini` | $0.04 | $0.10 |
50
+ | `gpt-4.1-nano` | $0.01 | $0.025 |
51
+ | `gpt-4o` | $0.25 | $1.25 |
52
+ | `gpt-4o-mini` | $0.015 | $0.075 |
53
+ | `o1` | $1.50 | $7.50 |
54
+ | `o3` | $0.20 | $0.50 |
55
+ | `o3-mini` | $0.11 | $0.55 |
56
+ | `o4-mini` | $0.11 | $0.275 |
57
+
58
+ - **Anthropic usage accounting:** normalized input includes cache-read and cache-write tokens, and streamed final usage retains them. Long-context threshold checks count cached tokens once rather than adding them twice. Preserve positive sub-microdollar estimates instead of rounding them to zero.
59
+ - **Manual update tooling:** parse standard/base-context tables, cache rates and footnotes, and effective-dated Anthropic rows; ignore missing prices and non-token units. It reads the effective bundled catalog directly, including Sol's active window, instead of maintaining a duplicate rate snapshot. Legacy entries absent from pricing pages are retained.
60
+ - **Free versus unknown:** provider-supplied zero costs remain supported, including with dollar budgets. Unpriced local providers still work without dollar caps; internal ledgers keep unknown costs as `null`, and configured dollar budgets reject unknown prior spend. Released numeric cost APIs remain compatible through the availability flags described below.
61
+
62
+ See [AI cost tracking and pricing](../../docs/ai/ai-integration.md) for provider overrides, usage normalization, and budget behavior. Bedrock pricing-file validation is documented separately in the [`@plumbus/ai-bedrock` 0.1.1 changelog](../ai-bedrock/CHANGELOG.md).
63
+
64
+ ### Compatibility
65
+
66
+ - Preserve the released numeric contracts of `calculateModelCost`, generation results, tool-loop totals, and RAG embedding callbacks. Added `estimateModelCost`, `costAvailable`, and `aggregatedCostAvailable` distinguish unknown prices. Framework ledgers still record unknown prices as `null`; configured dollar budgets reject them. Custom ledgers must honor availability flags.
67
+ - Finite JWT lifetimes remain issuer-controlled unless `maxTokenLifetimeSeconds` is explicitly configured. `signJwt` still defaults to 24 hours.
68
+
69
+ ### Security migration notes
70
+
71
+ - This is not a universal drop-in upgrade: configure real authentication credentials; regenerate JWTs without expiry; supply SAML request correlation or explicitly opt into unsolicited assertions; restart/review snapshot-less flows; and ensure audit persistence works. Generic 403/5xx responses no longer disclose private diagnostics.
72
+ - No new database schema is introduced. Existing audit/flow/task tables must already be migrated for the current framework line.
73
+ - Deploy the updated versions of any installed MCP/chat/voice/API add-ons with core. See [the release migration guide](../../docs/upgrading-security-release.md).
74
+
3
75
  ## 0.6.19 — 2026-09-01 — OpenAI reasoning tool-call transport
4
76
 
5
77
  ### Fixed