@journal.one/gateway-protocol 0.1.0 → 0.3.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/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # @journal.one/gateway-protocol
2
+
3
+ Shared TypeScript types and [Zod](https://zod.dev) schemas for the Journal Gateway protocol (v2). Used by both the gateway and client libraries — you typically don't install this directly.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @journal.one/gateway-protocol
9
+ ```
10
+
11
+ ## What's inside
12
+
13
+ - **Message schemas** — every WebSocket message type (`authenticate`, `tool_call`, `version_changed`, pull requests/responses, etc.)
14
+ - **Integration types** — `Integration`, `ToolDefinition`, `ToolResult`, and content blocks
15
+ - **Skill types** — `Skill` schema
16
+ - **Error types** — `GatewayError` with typed error codes
17
+ - **Provider interface** — `IntegrationProvider`, `GatewayConfig`, `GatewayVersions`
18
+
19
+ All exports are pure types and Zod schemas with no runtime dependencies beyond Zod.
20
+
21
+ ## Usage
22
+
23
+ ```ts
24
+ import {
25
+ GatewayMessageSchema,
26
+ ServiceMessageSchema,
27
+ type Integration,
28
+ type ToolResult,
29
+ } from "@journal.one/gateway-protocol";
30
+
31
+ // Validate an incoming message
32
+ const msg = GatewayMessageSchema.parse(JSON.parse(raw));
33
+ ```
34
+
35
+ ## Full documentation
36
+
37
+ See the [root README](https://github.com/EnduranceLabs/journal-edge#readme) for protocol details, architecture, and configuration reference.
38
+
39
+ ## License
40
+
41
+ MIT
@@ -30,6 +30,7 @@ export declare const IntegrationSchema: z.ZodObject<{
30
30
  description: string;
31
31
  inputSchema: Record<string, unknown>;
32
32
  }>, "many">;
33
+ /** Present only on the synthesized "skills" integration built by the client library. */
33
34
  skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
34
35
  id: z.ZodString;
35
36
  content: z.ZodString;
@@ -81,6 +82,7 @@ export declare const TextContentSchema: z.ZodObject<{
81
82
  export type TextContent = z.infer<typeof TextContentSchema>;
82
83
  export declare const ImageContentSchema: z.ZodObject<{
83
84
  type: z.ZodLiteral<"image">;
85
+ /** Base64-encoded image data. */
84
86
  data: z.ZodString;
85
87
  mimeType: z.ZodString;
86
88
  }, "strip", z.ZodTypeAny, {
@@ -104,6 +106,7 @@ export declare const ContentBlockSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
104
106
  text: string;
105
107
  }>, z.ZodObject<{
106
108
  type: z.ZodLiteral<"image">;
109
+ /** Base64-encoded image data. */
107
110
  data: z.ZodString;
108
111
  mimeType: z.ZodString;
109
112
  }, "strip", z.ZodTypeAny, {
@@ -128,6 +131,7 @@ export declare const ToolResultSchema: z.ZodObject<{
128
131
  text: string;
129
132
  }>, z.ZodObject<{
130
133
  type: z.ZodLiteral<"image">;
134
+ /** Base64-encoded image data. */
131
135
  data: z.ZodString;
132
136
  mimeType: z.ZodString;
133
137
  }, "strip", z.ZodTypeAny, {
@@ -1 +1 @@
1
- {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../src/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAI/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,iBAAiB;;;;;;;;;EAG5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAI7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG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,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;QAd3B,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBjC,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -10,6 +10,7 @@ export const IntegrationSchema = z.object({
10
10
  name: z.string(),
11
11
  description: z.string(),
12
12
  tools: z.array(ToolDefinitionSchema),
13
+ /** Present only on the synthesized "skills" integration built by the client library. */
13
14
  skills: z.array(SkillSchema).optional(),
14
15
  });
15
16
  export const TextContentSchema = z.object({
@@ -18,6 +19,7 @@ export const TextContentSchema = z.object({
18
19
  });
19
20
  export const ImageContentSchema = z.object({
20
21
  type: z.literal("image"),
22
+ /** Base64-encoded image data. */
21
23
  data: z.string(),
22
24
  mimeType: z.string(),
23
25
  });
@@ -1 +1 @@
1
- {"version":3,"file":"integrations.js","sourceRoot":"","sources":["../src/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;CACnC,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,C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,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC;IACpC,wFAAwF;IACxF,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IACxB,iCAAiC;IACjC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC7D,iBAAiB;IACjB,kBAAkB;CACnB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC;IACpC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@journal.one/gateway-protocol",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
+ "license": "MIT",
4
5
  "type": "module",
5
6
  "main": "./dist/index.js",
6
7
  "types": "./dist/index.d.ts",