@smithers-orchestrator/protocol 0.24.2 → 0.25.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/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "@smithers-orchestrator/protocol",
3
- "version": "0.24.2",
3
+ "version": "0.25.1",
4
4
  "description": "Shared Smithers contracts, errors, and small value types",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "exports": {
8
8
  ".": {
9
- "types": "./src/index.d.ts"
9
+ "types": "./src/index.d.ts",
10
+ "import": "./src/index.js",
11
+ "default": "./src/index.js"
10
12
  },
11
13
  "./errors": {
12
14
  "types": "./src/index.d.ts",
@@ -3,7 +3,6 @@
3
3
  /** @typedef {import("./JumpToFrameErrorCode.ts").JumpToFrameErrorCode} JumpToFrameErrorCode */
4
4
  /** @typedef {import("./NodeDiffErrorCode.ts").NodeDiffErrorCode} NodeDiffErrorCode */
5
5
  /** @typedef {import("./NodeOutputErrorCode.ts").NodeOutputErrorCode} NodeOutputErrorCode */
6
- /** @typedef {import("./ProtocolError.ts").ProtocolError} ProtocolError */
7
6
  // @smithers-type-exports-end
8
7
 
9
8
  export const DEVTOOLS_ERROR_CODES = /** @type {const} */ ([
package/src/index.d.ts CHANGED
@@ -71,24 +71,6 @@ type DevToolsEvent = {
71
71
  /** @typedef {import("./devtools/DevToolsSnapshot.ts").DevToolsSnapshot} DevToolsSnapshot */
72
72
  declare const DEVTOOLS_PROTOCOL_VERSION: 1;
73
73
 
74
- type OutputSchemaFieldType = "string" | "number" | "boolean" | "object" | "array" | "null" | "unknown";
75
- type OutputSchemaDescriptor = {
76
- fields: Array<{
77
- name: string;
78
- type: OutputSchemaFieldType;
79
- optional: boolean;
80
- nullable: boolean;
81
- description?: string;
82
- enum?: readonly unknown[];
83
- }>;
84
- };
85
- type NodeOutputResponse = {
86
- status: "produced" | "pending" | "failed";
87
- row: Record<string, unknown> | null;
88
- schema: OutputSchemaDescriptor | null;
89
- partial?: Record<string, unknown> | null;
90
- };
91
-
92
74
  declare const DEVTOOLS_ERROR_CODES: readonly ["RunNotFound", "InvalidRunId", "FrameOutOfRange", "SeqOutOfRange", "BackpressureDisconnect", "Unauthorized", "InvalidDelta"];
93
75
  type DevToolsErrorCode = (typeof DEVTOOLS_ERROR_CODES)[number];
94
76
  declare const NODE_OUTPUT_ERROR_CODES: readonly ["InvalidRunId", "InvalidNodeId", "InvalidIteration", "RunNotFound", "NodeNotFound", "IterationNotFound", "NodeHasNoOutput", "SchemaConversionError", "MalformedOutputRow", "PayloadTooLarge"];
@@ -97,10 +79,5 @@ declare const NODE_DIFF_ERROR_CODES: readonly ["InvalidRunId", "InvalidNodeId",
97
79
  type NodeDiffErrorCode = (typeof NODE_DIFF_ERROR_CODES)[number];
98
80
  declare const JUMP_TO_FRAME_ERROR_CODES: readonly ["InvalidRunId", "InvalidFrameNo", "RunNotFound", "FrameOutOfRange", "ConfirmationRequired", "Busy", "UnsupportedSandbox", "VcsError", "RewindFailed", "RateLimited", "Unauthorized"];
99
81
  type JumpToFrameErrorCode = (typeof JUMP_TO_FRAME_ERROR_CODES)[number];
100
- type ProtocolError = {
101
- code: DevToolsErrorCode | NodeOutputErrorCode | NodeDiffErrorCode | JumpToFrameErrorCode | string;
102
- message: string;
103
- hint?: string;
104
- };
105
82
 
106
- export { DEVTOOLS_ERROR_CODES, DEVTOOLS_PROTOCOL_VERSION, type DevToolsDelta, type DevToolsDeltaOp, type DevToolsErrorCode, type DevToolsEvent, type DevToolsNode, type DevToolsNodeType, type DevToolsSnapshot, JUMP_TO_FRAME_ERROR_CODES, type JumpToFrameErrorCode, NODE_DIFF_ERROR_CODES, NODE_OUTPUT_ERROR_CODES, type NodeDiffErrorCode, type NodeOutputErrorCode, type NodeOutputResponse, type OutputSchemaDescriptor, type OutputSchemaFieldType, type ProtocolError };
83
+ export { DEVTOOLS_ERROR_CODES, DEVTOOLS_PROTOCOL_VERSION, type DevToolsDelta, type DevToolsDeltaOp, type DevToolsErrorCode, type DevToolsEvent, type DevToolsNode, type DevToolsNodeType, type DevToolsSnapshot, JUMP_TO_FRAME_ERROR_CODES, type JumpToFrameErrorCode, NODE_DIFF_ERROR_CODES, NODE_OUTPUT_ERROR_CODES, type NodeDiffErrorCode, type NodeOutputErrorCode };
package/src/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export { DEVTOOLS_PROTOCOL_VERSION } from "./devtools.js";
2
+ export {
3
+ DEVTOOLS_ERROR_CODES,
4
+ JUMP_TO_FRAME_ERROR_CODES,
5
+ NODE_DIFF_ERROR_CODES,
6
+ NODE_OUTPUT_ERROR_CODES,
7
+ } from "./errors/index.js";
package/src/index.ts CHANGED
@@ -5,19 +5,13 @@ export type { DevToolsSnapshot } from "./devtools/DevToolsSnapshot.ts";
5
5
  export type { DevToolsDeltaOp } from "./devtools/DevToolsDeltaOp.ts";
6
6
  export type { DevToolsDelta } from "./devtools/DevToolsDelta.ts";
7
7
  export type { DevToolsEvent } from "./devtools/DevToolsEvent.ts";
8
- export {
9
- type OutputSchemaFieldType,
10
- type OutputSchemaDescriptor,
11
- type NodeOutputResponse,
12
- } from "./outputs.ts";
13
8
  export {
14
9
  DEVTOOLS_ERROR_CODES,
15
- type DevToolsErrorCode,
16
10
  NODE_OUTPUT_ERROR_CODES,
17
- type NodeOutputErrorCode,
18
11
  NODE_DIFF_ERROR_CODES,
19
- type NodeDiffErrorCode,
20
12
  JUMP_TO_FRAME_ERROR_CODES,
21
- type JumpToFrameErrorCode,
22
- type ProtocolError,
23
- } from "./errors.ts";
13
+ } from "./errors/index.js";
14
+ export type { DevToolsErrorCode } from "./errors/DevToolsErrorCode.ts";
15
+ export type { NodeOutputErrorCode } from "./errors/NodeOutputErrorCode.ts";
16
+ export type { NodeDiffErrorCode } from "./errors/NodeDiffErrorCode.ts";
17
+ export type { JumpToFrameErrorCode } from "./errors/JumpToFrameErrorCode.ts";
@@ -1,10 +0,0 @@
1
- import type { DevToolsErrorCode } from "./DevToolsErrorCode.ts";
2
- import type { NodeOutputErrorCode } from "./NodeOutputErrorCode.ts";
3
- import type { NodeDiffErrorCode } from "./NodeDiffErrorCode.ts";
4
- import type { JumpToFrameErrorCode } from "./JumpToFrameErrorCode.ts";
5
-
6
- export type ProtocolError = {
7
- code: DevToolsErrorCode | NodeOutputErrorCode | NodeDiffErrorCode | JumpToFrameErrorCode | string;
8
- message: string;
9
- hint?: string;
10
- };
package/src/errors.ts DELETED
@@ -1,55 +0,0 @@
1
- export const DEVTOOLS_ERROR_CODES = [
2
- "RunNotFound",
3
- "InvalidRunId",
4
- "FrameOutOfRange",
5
- "SeqOutOfRange",
6
- "BackpressureDisconnect",
7
- "Unauthorized",
8
- "InvalidDelta",
9
- ] as const;
10
- export type DevToolsErrorCode = (typeof DEVTOOLS_ERROR_CODES)[number];
11
- export const NODE_OUTPUT_ERROR_CODES = [
12
- "InvalidRunId",
13
- "InvalidNodeId",
14
- "InvalidIteration",
15
- "RunNotFound",
16
- "NodeNotFound",
17
- "IterationNotFound",
18
- "NodeHasNoOutput",
19
- "SchemaConversionError",
20
- "MalformedOutputRow",
21
- "PayloadTooLarge",
22
- ] as const;
23
- export type NodeOutputErrorCode = (typeof NODE_OUTPUT_ERROR_CODES)[number];
24
- export const NODE_DIFF_ERROR_CODES = [
25
- "InvalidRunId",
26
- "InvalidNodeId",
27
- "InvalidIteration",
28
- "RunNotFound",
29
- "NodeNotFound",
30
- "AttemptNotFound",
31
- "AttemptNotFinished",
32
- "VcsError",
33
- "WorkingTreeDirty",
34
- "DiffTooLarge",
35
- ] as const;
36
- export type NodeDiffErrorCode = (typeof NODE_DIFF_ERROR_CODES)[number];
37
- export const JUMP_TO_FRAME_ERROR_CODES = [
38
- "InvalidRunId",
39
- "InvalidFrameNo",
40
- "RunNotFound",
41
- "FrameOutOfRange",
42
- "ConfirmationRequired",
43
- "Busy",
44
- "UnsupportedSandbox",
45
- "VcsError",
46
- "RewindFailed",
47
- "RateLimited",
48
- "Unauthorized",
49
- ] as const;
50
- export type JumpToFrameErrorCode = (typeof JUMP_TO_FRAME_ERROR_CODES)[number];
51
- export type ProtocolError = {
52
- code: DevToolsErrorCode | NodeOutputErrorCode | NodeDiffErrorCode | JumpToFrameErrorCode | string;
53
- message: string;
54
- hint?: string;
55
- };
package/src/outputs.ts DELETED
@@ -1,19 +0,0 @@
1
- export type OutputSchemaFieldType = "string" | "number" | "boolean" | "object" | "array" | "null" | "unknown";
2
-
3
- export type OutputSchemaDescriptor = {
4
- fields: Array<{
5
- name: string;
6
- type: OutputSchemaFieldType;
7
- optional: boolean;
8
- nullable: boolean;
9
- description?: string;
10
- enum?: readonly unknown[];
11
- }>;
12
- };
13
-
14
- export type NodeOutputResponse = {
15
- status: "produced" | "pending" | "failed";
16
- row: Record<string, unknown> | null;
17
- schema: OutputSchemaDescriptor | null;
18
- partial?: Record<string, unknown> | null;
19
- };