@xtrape/capsule-contracts-node 0.5.0 → 0.5.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.
- package/README.md +44 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -8,6 +8,50 @@ identifier. `Capsule` is not a current Xtrape concept. New code should use the
|
|
|
8
8
|
canonical `Worker*` exports; the existing `Capsule*` exports and `services` wire
|
|
9
9
|
field remain available until a versioned protocol migration removes them.
|
|
10
10
|
|
|
11
|
+
## Contract Authority Boundary
|
|
12
|
+
|
|
13
|
+
| Name | Role |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `xtrape-contracts` | The **future language-neutral schema authority** for Xtrape contracts (not yet a separate repository). |
|
|
16
|
+
| `xtrape-contracts-nodejs` (this repo) | The **TypeScript / Zod runtime validation and type implementation**. |
|
|
17
|
+
|
|
18
|
+
Until a standalone `xtrape-contracts` exists, this package hosts the executable
|
|
19
|
+
TypeScript schemas, but it is **not** a separate conceptual authority: the
|
|
20
|
+
canonical model lives in [`xtrape-docs`](https://forgejo.xtrape.com/xtrape/xtrape-docs)
|
|
21
|
+
(`runtime-platform/02..04`, `architecture/11`). When the two disagree, the
|
|
22
|
+
canonical architecture docs win and this package is corrected to match.
|
|
23
|
+
|
|
24
|
+
## Xtrape CE 0.1 Phase 0 Contracts
|
|
25
|
+
|
|
26
|
+
The CE 0.1 runtime loop (`Telegram → server-ce → demo xtrape-service → reply`)
|
|
27
|
+
depends on a **frozen** set of schemas, exported from this package and validated
|
|
28
|
+
by `tests/ce-contracts.spec.ts` (including a field/enum surface guard):
|
|
29
|
+
|
|
30
|
+
| Export | Used by |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `CE_CONTRACT_VERSION` (`1`) | version negotiation across agent ↔ server-ce |
|
|
33
|
+
| `ServiceManifestSchema` / `ServiceManifest` | service registration descriptor |
|
|
34
|
+
| `ServiceInstanceSchema` / `ServiceInstance` | registered instance with resolvable address |
|
|
35
|
+
| `AgentHeartbeatSchema` / `AgentHeartbeat` | heartbeat / health reporting |
|
|
36
|
+
| `ConversationMessageSchema` / `ConversationMessage` | message routing + reply envelope |
|
|
37
|
+
| `ErrorModelSchema` / `ErrorModel` (+ `CeErrorCode`) | structured error responses |
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { ServiceManifestSchema, CE_CONTRACT_VERSION } from "@xtrape/capsule-contracts-node";
|
|
41
|
+
|
|
42
|
+
const manifest = ServiceManifestSchema.parse({
|
|
43
|
+
contractVersion: CE_CONTRACT_VERSION,
|
|
44
|
+
service: { id: "demo-echo-service", name: "Demo Echo Service", version: "0.1.0" },
|
|
45
|
+
runtime: { language: "node", agent: "xtrape-agent-node" },
|
|
46
|
+
capabilities: ["status.query"],
|
|
47
|
+
message: { supportedTypes: ["QUERY"] },
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
These schemas are frozen for CE 0.1: changing a field or enum is a contract
|
|
52
|
+
change that must bump `CE_CONTRACT_VERSION` and update the surface guard. See the
|
|
53
|
+
matching examples in `xtrape-docs/docs/runtime-platform/01-phase-0-runtime-mvp.md`.
|
|
54
|
+
|
|
11
55
|
[](./LICENSE)
|
|
12
56
|
[](https://xtrape-com.github.io/xtrape-capsule-site/)
|
|
13
57
|
[](https://xtrape-com.github.io/xtrape-capsule-site/contracts/overview)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xtrape/capsule-contracts-node",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "TypeScript contracts and Zod schemas for Xtrape Agent, Worker, and Panel wire protocols.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xtrape",
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
],
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": "git+https://
|
|
16
|
+
"url": "git+https://forgejo.xtrape.com/xtrape/xtrape-contracts-nodejs.git"
|
|
17
17
|
},
|
|
18
|
-
"homepage": "https://
|
|
18
|
+
"homepage": "https://forgejo.xtrape.com/xtrape/xtrape-contracts-nodejs#readme",
|
|
19
19
|
"bugs": {
|
|
20
|
-
"url": "https://
|
|
20
|
+
"url": "https://forgejo.xtrape.com/xtrape/xtrape-contracts-nodejs/issues"
|
|
21
21
|
},
|
|
22
22
|
"type": "module",
|
|
23
23
|
"main": "./dist/index.cjs",
|