@plumbus/ai-decision-laya 0.2.0
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 +11 -0
- package/README.md +48 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/laya-adapter.d.ts +11 -0
- package/dist/laya-adapter.d.ts.map +1 -0
- package/dist/laya-adapter.js +41 -0
- package/dist/laya-adapter.js.map +1 -0
- package/instructions/README.md +12 -0
- package/instructions/framework.md +46 -0
- package/instructions/testing.md +19 -0
- package/package.json +61 -0
- package/service/Dockerfile +14 -0
- package/service/fixtures/fake_server.py +28 -0
- package/service/requirements.txt +2 -0
- package/service/server.py +287 -0
- package/service/test_audit.py +170 -0
- package/service/test_audit_round_two.py +165 -0
- package/service/test_server.py +145 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.0 — 2026-09-23
|
|
4
|
+
|
|
5
|
+
- Initial optional self-hosted Laya HTTP adapter for typed choices, scores, and probabilities, using `@plumbus/ai-decision` contracts and validation.
|
|
6
|
+
- Ship a persistent Python reference service pinned to Laya `0.3.5` and a CPU Dockerfile. Support preloaded English, multilingual, and typed-decision checkpoints with explicit routing identity and token-budget preflight checks.
|
|
7
|
+
- Bound request/response sizes, JSON depth, HTTP handler capacity, and concurrent inference. Validate bearer authentication, content metadata, and message framing, and handle client disconnects.
|
|
8
|
+
- Add a repository smoke example that manages a local server/password, retains the model cache with correct ownership, and tests both decision adapters with real inference.
|
|
9
|
+
- Ship offline adapter tests, Node-to-Python HTTP tests, Python service tests, and consumer agent instructions. Python/model dependencies are installed separately from pnpm.
|
|
10
|
+
- Give the combined Python contract suite an explicit Vitest timeout longer than its subprocess deadline, avoiding false failures under parallel workspace load.
|
|
11
|
+
- Requires core `0.7.x`. Core `ctx.ai.decide()`, provider registration, automatic budgets/auditing, and agent discovery remain deferred.
|
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# @plumbus/ai-decision-laya
|
|
2
|
+
|
|
3
|
+
Release notes: [changelog](./CHANGELOG.md) and [version/upgrade guide](../../docs/upgrading-voice-and-decision-release.md).
|
|
4
|
+
|
|
5
|
+
Laya provider for self-hosted typed decision inference, with a persistent Python reference service.
|
|
6
|
+
|
|
7
|
+
Version `0.2.0`; required peer `@plumbus/core` exactly `0.7.x`; Node.js 20.6+.
|
|
8
|
+
Install explicitly with `pnpm add @plumbus/ai-decision-laya`. Provider packages install
|
|
9
|
+
`@plumbus/ai-decision` transitively. There is no dependency on the other provider.
|
|
10
|
+
|
|
11
|
+
## Scope
|
|
12
|
+
|
|
13
|
+
This is the package-only foundation. Core `ctx.ai.decide()`, named definitions,
|
|
14
|
+
provider registration, automatic budgets/auditing, and agent discovery are deferred.
|
|
15
|
+
Do not put this adapter into core's text-generation `providers` registry.
|
|
16
|
+
|
|
17
|
+
## Quick start (infrastructure / smoke testing)
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { createLayaDecisionAdapter } from '@plumbus/ai-decision-laya';
|
|
21
|
+
|
|
22
|
+
const adapter = createLayaDecisionAdapter({ baseUrl: 'http://127.0.0.1:8080/v1', apiKey: process.env.LAYA_API_KEY });
|
|
23
|
+
const result = await adapter.decide({
|
|
24
|
+
state: 'Please refund the duplicate charge.',
|
|
25
|
+
questions: { refund: { type: 'probability', instructions: 'Is a refund requested?' } },
|
|
26
|
+
});
|
|
27
|
+
console.log(result.answers.refund.probability);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
Business logic belongs in Plumbus capabilities/flows and `ctx.*`. These examples
|
|
32
|
+
exercise the provider protocol only; they do not provide the core execution lifecycle.
|
|
33
|
+
|
|
34
|
+
## Documentation
|
|
35
|
+
|
|
36
|
+
Read the [decision providers guide](https://github.com/plumbus-framework/plumbus/blob/main/docs/ai/decision-providers.md)
|
|
37
|
+
for the complete contract, failure behavior, pricing, deployment, and live test environment.
|
|
38
|
+
Local monorepo copy: [docs/ai/decision-providers.md](../../docs/ai/decision-providers.md).
|
|
39
|
+
|
|
40
|
+
## Agent recipes
|
|
41
|
+
|
|
42
|
+
- [Instructions index](instructions/README.md)
|
|
43
|
+
- [Framework boundary and usage](instructions/framework.md)
|
|
44
|
+
- [Testing](instructions/testing.md)
|
|
45
|
+
|
|
46
|
+
## The Plumbus ecosystem
|
|
47
|
+
|
|
48
|
+
`@plumbus/ai-decision-laya` is one package in the Plumbus framework. For the full list of packages and when to use each, see the [Plumbus monorepo README](https://github.com/plumbus-framework/plumbus#packages).
|