@openship/protocol 0.1.1 → 0.1.2

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "openship": "1.0",
3
3
  "package": "@openship/protocol",
4
- "packageVersion": "0.1.1",
4
+ "packageVersion": "0.1.2",
5
5
  "source": "https://github.com/openshipdev/openship/tree/main/skills/openship",
6
- "sourceCommit": "fad5993fea4e1a21d95ec76d5ec89621364822b8"
6
+ "sourceCommit": "11f343e2e3418c0a2bb473d229099e4f9431f801"
7
7
  }
@@ -38,7 +38,11 @@ Any positive number of layers is supported. Each is an explicit graph, not a gen
38
38
 
39
39
  ## Nodes, containment and sources
40
40
 
41
- Node kinds are `Root`, `Block`, `Store`, `Host`, `Container`, `Process`, and `Library`. Block describes a capability; Store describes persistent data. The other kinds describe a system boundary, execution environment, grouped runtime, executable component, and reusable dependency respectively.
41
+ Node kinds are `Root`, `Block`, `Store`, `Host`, `Container`, `Process`, `Contract`, and `Library`. Block describes a capability; Store describes persistent data. Root, Host, Container, Process, and Library describe a system boundary, execution environment, grouped runtime, executable component, and reusable dependency respectively.
42
+
43
+ A **Contract** is a Process running on consensus: its execution and state transitions are governed by the consensus rules of its network. “Smart” is implied. Use `Contract` for consensus-executed components and `Process` for ordinary runtimes, including RPC servers and transaction relayers. Contract follows the same containment, connection, refinement, configuration, and instance-binding rules as Process; database `state` remains exclusive to Store bindings. The network can be described by a parent Host and configuration or metadata.
44
+
45
+ `Contract` extends the node-kind vocabulary without changing the `openship: "1.0"` or `systemsVersion: "2.0"` envelope. Consumers with the previous closed vocabulary must update before accepting documents containing Contract.
42
46
 
43
47
  ```json
44
48
  {
@@ -124,6 +124,7 @@
124
124
  "Host",
125
125
  "Container",
126
126
  "Process",
127
+ "Contract",
127
128
  "Library",
128
129
  "Block",
129
130
  "Store"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openship/protocol",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Canonical OpenShip 1.0 types, validators, consumer helpers, schemas, and skill assets.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/index.d.ts CHANGED
@@ -10,7 +10,7 @@ export interface SourcesManifest { openship: "1.0"; capability: "sources"; diges
10
10
  export interface SourcesBundle { openship: "1.0"; capability: "sources"; digest: string; files: Record<string, { encoding: OpenShipEncoding; content: string; [key: string]: unknown }>; [key: string]: unknown }
11
11
  export interface DiscoveryAgent { summary: string; instructions: string; skill: string; [key: string]: unknown }
12
12
  export interface DiscoveryDocument { openship: "1.0"; capability: "discovery"; project: { name: string; description: string; [key: string]: unknown }; agent: DiscoveryAgent; page?: string; capabilities: { sources: { description: string; manifest: string; bundle: string; mcp?: string; [key: string]: unknown }; systems?: { description: string; document: string; [key: string]: unknown }; changes?: { description: string; policy: string; submit: string; status: string; [key: string]: unknown }; [key: string]: unknown }; [key: string]: unknown }
13
- export type SystemsNodeKind = "Root" | "Block" | "Store" | "Host" | "Container" | "Process" | "Library";
13
+ export type SystemsNodeKind = "Root" | "Block" | "Store" | "Host" | "Container" | "Process" | "Contract" | "Library";
14
14
  export type SystemsNodeOwnership = "first_party" | "third_party";
15
15
  export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };
16
16
  export interface SystemsConfiguration { name: string; description: string; required: boolean; sensitive?: boolean; value?: JsonValue; secretRef?: { nodeId: string; key: string }; }
package/src/index.js CHANGED
@@ -299,7 +299,7 @@ export function validateSystems(value, options = {}) {
299
299
  const path = `${at}.nodes[${i}]`, node = object(rawNode, path);
300
300
  identifier(node.id, `${path}.id`);
301
301
  if (nodeById.has(node.id)) fail(`${path}.id`, "must be globally unique");
302
- if (!["Root", "Block", "Store", "Host", "Container", "Process", "Library"].includes(node.kind)) fail(`${path}.kind`, "invalid node kind");
302
+ if (!["Root", "Block", "Store", "Host", "Container", "Process", "Contract", "Library"].includes(node.kind)) fail(`${path}.kind`, "invalid node kind");
303
303
  string(node.name, `${path}.name`);
304
304
  const metadata = object(node.metadata, `${path}.metadata`);
305
305
  if (!["first_party", "third_party"].includes(metadata.ownership)) fail(`${path}.metadata.ownership`, "must be first_party or third_party");