@cntryl/fitz 0.0.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.
Files changed (103) hide show
  1. package/LICENSE +160 -0
  2. package/README.md +195 -0
  3. package/dist/index.cjs +5285 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.mjs +5222 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/dist/types/client/client.d.ts +35 -0
  8. package/dist/types/client/client.d.ts.map +1 -0
  9. package/dist/types/client/connection.d.ts +57 -0
  10. package/dist/types/client/connection.d.ts.map +1 -0
  11. package/dist/types/client/multiplexer.d.ts +65 -0
  12. package/dist/types/client/multiplexer.d.ts.map +1 -0
  13. package/dist/types/core/buffer.d.ts +63 -0
  14. package/dist/types/core/buffer.d.ts.map +1 -0
  15. package/dist/types/core/errors.d.ts +94 -0
  16. package/dist/types/core/errors.d.ts.map +1 -0
  17. package/dist/types/core/iterator.d.ts +66 -0
  18. package/dist/types/core/iterator.d.ts.map +1 -0
  19. package/dist/types/core/lifecycle.d.ts +41 -0
  20. package/dist/types/core/lifecycle.d.ts.map +1 -0
  21. package/dist/types/core/task-group.d.ts +23 -0
  22. package/dist/types/core/task-group.d.ts.map +1 -0
  23. package/dist/types/core/types.d.ts +92 -0
  24. package/dist/types/core/types.d.ts.map +1 -0
  25. package/dist/types/domains/_routes.d.ts +10 -0
  26. package/dist/types/domains/_routes.d.ts.map +1 -0
  27. package/dist/types/domains/base.d.ts +26 -0
  28. package/dist/types/domains/base.d.ts.map +1 -0
  29. package/dist/types/domains/kv/client.d.ts +18 -0
  30. package/dist/types/domains/kv/client.d.ts.map +1 -0
  31. package/dist/types/domains/kv/codec.d.ts +22 -0
  32. package/dist/types/domains/kv/codec.d.ts.map +1 -0
  33. package/dist/types/domains/kv/transaction.d.ts +19 -0
  34. package/dist/types/domains/kv/transaction.d.ts.map +1 -0
  35. package/dist/types/domains/kv/types.d.ts +47 -0
  36. package/dist/types/domains/kv/types.d.ts.map +1 -0
  37. package/dist/types/domains/lease/client.d.ts +18 -0
  38. package/dist/types/domains/lease/client.d.ts.map +1 -0
  39. package/dist/types/domains/lease/codec.d.ts +69 -0
  40. package/dist/types/domains/lease/codec.d.ts.map +1 -0
  41. package/dist/types/domains/lease/index.d.ts +9 -0
  42. package/dist/types/domains/lease/index.d.ts.map +1 -0
  43. package/dist/types/domains/lease/types.d.ts +88 -0
  44. package/dist/types/domains/lease/types.d.ts.map +1 -0
  45. package/dist/types/domains/notice/client.d.ts +17 -0
  46. package/dist/types/domains/notice/client.d.ts.map +1 -0
  47. package/dist/types/domains/notice/codec.d.ts +42 -0
  48. package/dist/types/domains/notice/codec.d.ts.map +1 -0
  49. package/dist/types/domains/notice/index.d.ts +9 -0
  50. package/dist/types/domains/notice/index.d.ts.map +1 -0
  51. package/dist/types/domains/notice/types.d.ts +44 -0
  52. package/dist/types/domains/notice/types.d.ts.map +1 -0
  53. package/dist/types/domains/queue/client.d.ts +18 -0
  54. package/dist/types/domains/queue/client.d.ts.map +1 -0
  55. package/dist/types/domains/queue/codec.d.ts +82 -0
  56. package/dist/types/domains/queue/codec.d.ts.map +1 -0
  57. package/dist/types/domains/queue/index.d.ts +9 -0
  58. package/dist/types/domains/queue/index.d.ts.map +1 -0
  59. package/dist/types/domains/queue/types.d.ts +97 -0
  60. package/dist/types/domains/queue/types.d.ts.map +1 -0
  61. package/dist/types/domains/rpc/client.d.ts +17 -0
  62. package/dist/types/domains/rpc/client.d.ts.map +1 -0
  63. package/dist/types/domains/rpc/codec.d.ts +82 -0
  64. package/dist/types/domains/rpc/codec.d.ts.map +1 -0
  65. package/dist/types/domains/rpc/index.d.ts +8 -0
  66. package/dist/types/domains/rpc/index.d.ts.map +1 -0
  67. package/dist/types/domains/rpc/types.d.ts +67 -0
  68. package/dist/types/domains/rpc/types.d.ts.map +1 -0
  69. package/dist/types/domains/schedule/client.d.ts +19 -0
  70. package/dist/types/domains/schedule/client.d.ts.map +1 -0
  71. package/dist/types/domains/schedule/codec.d.ts +63 -0
  72. package/dist/types/domains/schedule/codec.d.ts.map +1 -0
  73. package/dist/types/domains/schedule/index.d.ts +8 -0
  74. package/dist/types/domains/schedule/index.d.ts.map +1 -0
  75. package/dist/types/domains/schedule/types.d.ts +69 -0
  76. package/dist/types/domains/schedule/types.d.ts.map +1 -0
  77. package/dist/types/domains/stream/client.d.ts +27 -0
  78. package/dist/types/domains/stream/client.d.ts.map +1 -0
  79. package/dist/types/domains/stream/codec.d.ts +124 -0
  80. package/dist/types/domains/stream/codec.d.ts.map +1 -0
  81. package/dist/types/domains/stream/index.d.ts +8 -0
  82. package/dist/types/domains/stream/index.d.ts.map +1 -0
  83. package/dist/types/domains/stream/session.d.ts +8 -0
  84. package/dist/types/domains/stream/session.d.ts.map +1 -0
  85. package/dist/types/domains/stream/types.d.ts +150 -0
  86. package/dist/types/domains/stream/types.d.ts.map +1 -0
  87. package/dist/types/frame/codec.d.ts +29 -0
  88. package/dist/types/frame/codec.d.ts.map +1 -0
  89. package/dist/types/frame/types.d.ts +71 -0
  90. package/dist/types/frame/types.d.ts.map +1 -0
  91. package/dist/types/index.d.ts +25 -0
  92. package/dist/types/index.d.ts.map +1 -0
  93. package/dist/types/protocol/response.d.ts +27 -0
  94. package/dist/types/protocol/response.d.ts.map +1 -0
  95. package/dist/types/transport/factory.d.ts +6 -0
  96. package/dist/types/transport/factory.d.ts.map +1 -0
  97. package/dist/types/transport/tcp.d.ts +6 -0
  98. package/dist/types/transport/tcp.d.ts.map +1 -0
  99. package/dist/types/transport/types.d.ts +17 -0
  100. package/dist/types/transport/types.d.ts.map +1 -0
  101. package/dist/types/transport/websocket.d.ts +6 -0
  102. package/dist/types/transport/websocket.d.ts.map +1 -0
  103. package/package.json +72 -0
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Stream session implementation
3
+ * Per fitz-go/internal/domains/stream/stream.go
4
+ */
5
+ import { Connection } from "../../client/connection";
6
+ import { StreamSession } from "./types";
7
+ export declare function createStreamSession(connection: Connection, _route: string, sessionId: bigint): StreamSession;
8
+ //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../src/domains/stream/session.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAyC,aAAa,EAAgB,MAAM,SAAS,CAAC;AAI7F,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,aAAa,CA6Ff"}
@@ -0,0 +1,150 @@
1
+ /**
2
+ * Stream domain type definitions
3
+ * Stream uses session-based transactional semantics:
4
+ * 1. Begin() returns a session with server-assigned sessionID
5
+ * 2. Append(expectedOffset, ...) on session validates optimistic concurrency
6
+ * 3. Commit() or Rollback() to finalize
7
+ */
8
+ /**
9
+ * Stream record with offset, timestamp, and payload
10
+ */
11
+ export interface StreamRecord {
12
+ offset: bigint;
13
+ timestamp: bigint;
14
+ body: Uint8Array;
15
+ areaOffset?: bigint;
16
+ realmOffset?: bigint;
17
+ metadata?: Uint8Array;
18
+ }
19
+ /**
20
+ * Stream metadata.
21
+ */
22
+ export interface StreamMetadata {
23
+ firstOffset: bigint;
24
+ lastOffset: bigint;
25
+ recordCount: bigint;
26
+ maxBatchEvents?: bigint;
27
+ maxBatchBytes?: bigint;
28
+ ttlSeconds?: bigint;
29
+ areaWatermark?: bigint;
30
+ realmWatermark?: bigint;
31
+ }
32
+ export type StreamDiscriminator = string;
33
+ export type StreamFilteredReason = "server_filter" | "permission" | "projection";
34
+ export type StreamFilterClause = {
35
+ kind: "Equals";
36
+ value: string;
37
+ } | {
38
+ kind: "NotEquals";
39
+ value: string;
40
+ } | {
41
+ kind: "StartsWith";
42
+ value: string;
43
+ } | {
44
+ kind: "AnyOf";
45
+ values: string[];
46
+ };
47
+ export interface StreamFilterSet {
48
+ clauses: StreamFilterClause[];
49
+ }
50
+ export interface StreamAppendOptions {
51
+ discriminator?: StreamDiscriminator;
52
+ }
53
+ export interface StreamReadOptions {
54
+ maxBytes?: bigint;
55
+ filter?: StreamFilterSet;
56
+ signal?: AbortSignal;
57
+ }
58
+ export interface StreamReadCursor {
59
+ lastResourceOffset: bigint;
60
+ lastAreaOffset?: bigint;
61
+ lastRealmOffset?: bigint;
62
+ hasMore: boolean;
63
+ }
64
+ export interface StreamReadEvent {
65
+ kind: "event";
66
+ record: StreamRecord;
67
+ }
68
+ export interface StreamReadFiltered {
69
+ kind: "filtered";
70
+ offset: bigint;
71
+ reason?: StreamFilteredReason;
72
+ }
73
+ export interface StreamReadFilteredRange {
74
+ kind: "filtered_range";
75
+ fromOffset: bigint;
76
+ toOffset: bigint;
77
+ reason?: StreamFilteredReason;
78
+ }
79
+ export type StreamReadItem = StreamReadEvent | StreamReadFiltered | StreamReadFilteredRange;
80
+ export interface StreamReadPage {
81
+ items: StreamReadItem[];
82
+ cursor: StreamReadCursor;
83
+ }
84
+ export type StreamCommitMode = "Buffered" | "Sync";
85
+ export interface StreamCommitPayload {
86
+ event?: string;
87
+ first_resource_offset?: number;
88
+ last_resource_offset?: number;
89
+ first_area_offset?: number;
90
+ last_area_offset?: number;
91
+ first_realm_offset?: number;
92
+ last_realm_offset?: number;
93
+ batch_size?: number;
94
+ }
95
+ export interface StreamCommitNotification {
96
+ route: string;
97
+ event?: string;
98
+ firstResourceOffset?: bigint;
99
+ lastResourceOffset?: bigint;
100
+ firstAreaOffset?: bigint;
101
+ lastAreaOffset?: bigint;
102
+ firstRealmOffset?: bigint;
103
+ lastRealmOffset?: bigint;
104
+ batchSize?: number;
105
+ payload: StreamCommitPayload;
106
+ }
107
+ export type StreamCommitHandler = (notification: StreamCommitNotification) => void | Promise<void>;
108
+ export type StreamSubscription = ReturnType<typeof createStreamSubscription>;
109
+ export declare function createStreamSubscription(subId: bigint, pattern: string, unsubscribeFn: (pattern: string) => Promise<void>): {
110
+ subId: bigint;
111
+ unsubscribe: () => Promise<void>;
112
+ };
113
+ /**
114
+ * Stream session for write operations.
115
+ * Obtained from `StreamClient.begin()`.
116
+ */
117
+ export interface StreamSession {
118
+ /**
119
+ * Append a record to the stream.
120
+ * Returns the assigned offset
121
+ */
122
+ append(expectedOffset: bigint, body: Uint8Array, signal?: AbortSignal): Promise<bigint>;
123
+ append(expectedOffset: bigint, body: Uint8Array, options?: StreamAppendOptions, signal?: AbortSignal): Promise<bigint>;
124
+ /**
125
+ * Commit the write session and make appended records durable.
126
+ */
127
+ commit(mode: StreamCommitMode, signal?: AbortSignal): Promise<void>;
128
+ /**
129
+ * Roll back and discard uncommitted appends.
130
+ */
131
+ rollback(signal?: AbortSignal): Promise<void>;
132
+ /**
133
+ * Check if session is still open
134
+ */
135
+ isOpen(): boolean;
136
+ }
137
+ /**
138
+ * Stream operation status codes
139
+ */
140
+ export declare enum StreamStatus {
141
+ Ok = 0,
142
+ StreamNotFound = 1,
143
+ OffsetOutOfRange = 2,
144
+ InvalidOffset = 3,
145
+ StreamFull = 4,
146
+ SessionNotFound = 5,
147
+ SessionClosed = 6,
148
+ ExpectedOffsetMismatch = 7
149
+ }
150
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/domains/stream/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,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te, 255+ = escape 0xFF + u16 BE
5
+ */
6
+ export interface Frame {
7
+ messageType: number;
8
+ payload: Uint8Array;
9
+ }
10
+ export declare const FrameCodec: {
11
+ encodeFrame: (messageType: number, payload: Uint8Array) => Uint8Array;
12
+ decodeFrame: (buffer: Uint8Array) => Frame;
13
+ getMessageTypeSize: (messageType: number) => number;
14
+ calculateFrameSize: (messageType: number, payloadLength: number) => number;
15
+ };
16
+ /**
17
+ * Helper for streaming frame parsing
18
+ */
19
+ export type FrameParser = ReturnType<typeof createFrameParser>;
20
+ export declare function createFrameParser(): {
21
+ parseFrames: (data: Uint8Array) => Frame[];
22
+ hasCompleteFrame: () => boolean;
23
+ };
24
+ type FrameParserConstructor = {
25
+ new (): FrameParser;
26
+ };
27
+ export declare const FrameParser: FrameParserConstructor;
28
+ export {};
29
+ //# sourceMappingURL=codec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/frame/codec.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,KAAK;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,UAAU,CAAC;CACrB;AAsED,eAAO,MAAM,UAAU;+BApEW,MAAM,WAAW,UAAU,KAAG,UAAU;0BAyB7C,UAAU,KAAG,KAAK;sCAgCN,MAAM,KAAG,MAAM;sCAOf,MAAM,iBAAiB,MAAM,KAAG,MAAM;CAS9E,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE/D,wBAAgB,iBAAiB;wBAgDJ,UAAU,KAAG,KAAK,EAAE;4BAkDlB,OAAO;EAQrC;AAED,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,WAAW,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,sBAEY,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Fitz message type constants
3
+ * Per CLIENT_SPEC.md and fitz-go/internal/protocol/message_types.go
4
+ *
5
+ * Format: [MessageType (variable 1-3 bytes)][Length (u16 BE)][Payload]
6
+ * MessageType 0-254: single byte
7
+ * MessageType 255+: escape byte 0xFF + u16 BE
8
+ *
9
+ * Key Pattern: Single MessageType per operation (request AND response use same type)
10
+ * Responses matched via FIFO ordering in multiplexer, NOT separate message types
11
+ */
12
+ export declare const MSG_CONNECT = 1;
13
+ export declare const MSG_KV_BEGIN = 100;
14
+ export declare const MSG_KV_COMMIT = 101;
15
+ export declare const MSG_KV_ROLLBACK = 102;
16
+ export declare const MSG_KV_GET = 103;
17
+ export declare const MSG_KV_PUT = 104;
18
+ export declare const MSG_KV_INSERT = 105;
19
+ export declare const MSG_KV_DELETE = 106;
20
+ export declare const MSG_KV_DELETE_RANGE = 107;
21
+ export declare const MSG_KV_SCAN = 108;
22
+ export declare const MSG_QUEUE_ENQUEUE = 200;
23
+ export declare const MSG_QUEUE_RESERVE = 202;
24
+ export declare const MSG_QUEUE_EXTEND = 203;
25
+ export declare const MSG_QUEUE_COMPLETE = 204;
26
+ export declare const MSG_QUEUE_SUBSCRIBE = 207;
27
+ export declare const MSG_QUEUE_UNSUBSCRIBE = 208;
28
+ export declare const MSG_QUEUE_NOTIFY = 209;
29
+ export declare const MSG_RPC_SUBSCRIBE_WORKER = 300;
30
+ export declare const MSG_RPC_UNSUBSCRIBE_WORKER = 301;
31
+ export declare const MSG_RPC_REQUEST = 302;
32
+ export declare const MSG_RPC_RESPONSE = 303;
33
+ export declare const MSG_RPC_ACK = 304;
34
+ export declare const MSG_LEASE_ACQUIRE = 400;
35
+ export declare const MSG_LEASE_RENEW = 401;
36
+ export declare const MSG_LEASE_RELEASE = 402;
37
+ export declare const MSG_LEASE_QUERY = 403;
38
+ export declare const MSG_LEASE_SUBSCRIBE = 407;
39
+ export declare const MSG_LEASE_UNSUBSCRIBE = 408;
40
+ export declare const MSG_LEASE_NOTIFY = 409;
41
+ export declare const MSG_NOTICE_PUBLISH = 500;
42
+ export declare const MSG_NOTICE_SUBSCRIBE = 501;
43
+ export declare const MSG_NOTICE_UNSUBSCRIBE = 502;
44
+ export declare const MSG_NOTICE_UNSUBSCRIBE_ALL = 503;
45
+ export declare const MSG_NOTICE_NOTIFY = 504;
46
+ export declare const MSG_STREAM_BEGIN = 600;
47
+ export declare const MSG_STREAM_APPEND = 601;
48
+ export declare const MSG_STREAM_COMMIT = 602;
49
+ export declare const MSG_STREAM_ROLLBACK = 603;
50
+ export declare const MSG_STREAM_READ = 604;
51
+ export declare const MSG_STREAM_LAST = 605;
52
+ export declare const MSG_STREAM_GET_METADATA = 606;
53
+ export declare const MSG_STREAM_SUBSCRIBE = 607;
54
+ export declare const MSG_STREAM_UNSUBSCRIBE = 608;
55
+ export declare const MSG_STREAM_NOTIFY = 609;
56
+ export declare const MSG_SCHEDULE_CREATE = 700;
57
+ export declare const MSG_SCHEDULE_CANCEL = 701;
58
+ export declare const MSG_SCHEDULE_LIST = 702;
59
+ export declare const MSG_SCHEDULE_SUBSCRIBE = 703;
60
+ export declare const MSG_SCHEDULE_UNSUBSCRIBE = 704;
61
+ export declare const MSG_SCHEDULE_NOTIFY = 705;
62
+ /**
63
+ * Returns the domain name for a given MessageType
64
+ * Used for routing frames to domain handlers
65
+ */
66
+ export declare function routeDomain(msgType: number): string;
67
+ /**
68
+ * Notification message types (server -> client push)
69
+ */
70
+ export declare const NOTIFICATION_TYPES: Set<number>;
71
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/frame/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,eAAO,MAAM,WAAW,IAAI,CAAC;AAG7B,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC,eAAO,MAAM,UAAU,MAAM,CAAC;AAC9B,eAAO,MAAM,UA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AAM,CAAC;AACvC,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAGrC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,iBAAiB,MAAM,CAAC;AACrC,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAC5C,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CASnD;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,aAM7B,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Fitz TypeScript Client - Main Entry Point
3
+ */
4
+ export { Client, createClient } from "./client/client";
5
+ export type { AsyncHandlerOptions, ClientConfig, ClientConnectOptions, FitzLifecycleEvent, FitzLogger, FitzLogLevel, FitzMeter, FitzObservability, FitzSpan, FitzTracer, TransportType, TokenProvider, ReconnectOptions, } from "./core/types";
6
+ export { ConnectionState } from "./core/types";
7
+ export { ErrKvTransactionAborted, ErrKvLeaseExpired, ErrKvConflictingWrite, ErrKvKeyNotFound, ErrKvOperationNotAllowed, ErrCodeKvIsolationConflict, ErrCodeKvBackendError, ErrQueueNotFound, ErrQueueMessageNotFound, ErrQueueInvalidToken, ErrQueueFull, ErrQueueInvalidDelay, ErrCodeQueueFull, ErrRpcTimeout, ErrRpcHandlerNotFound, ErrRpcHandlerError, ErrRpcInvalidRequest, ErrCodeRpcTimeout, ErrCodeRpcWorkerNotFound, ErrCodeRpcBackpressure, ErrCodeRpcRouteNotRegistered, ErrCodeRpcCorrelationNotFound, ErrCodeRpcUnauthorized, ErrLeaseHeld, ErrLeaseNotFound, ErrLeaseInvalidToken, ErrCodeLeaseHeld, ErrNoticeGeneral, ErrStreamNotFound, ErrStreamOffsetOutOfRange, ErrStreamInvalidOffset, ErrStreamFull, ErrStreamSessionNotFound, ErrStreamSessionClosed, ErrStreamExpectedOffsetMismatch, ErrScheduleNotFound, ErrScheduleTaskNotFound, ErrScheduleInvalidCron, ErrScheduleInvalidDelay, ErrScheduleInvalidTimestamp, FitzError, TransportError, ConnectionError, RequestQueueFullError, AuthenticationError, TimeoutError, ProtocolError, CodecError, KvError, QueueError, NoticeError, RpcError, LeaseError, StreamError, ScheduleError, isRetryable, } from "./core/errors";
8
+ export { createTaskGroup } from "./core/task-group";
9
+ export type { TaskGroup, TaskGroupStatus, TaskGroupErrorPolicy, TaskContext, TaskGroupOptions, } from "./core/task-group";
10
+ export { KvClient } from "./domains/kv/client";
11
+ export type { KvTransaction } from "./domains/kv/client";
12
+ export type { TxMode, DurabilityMode, KvBeginOptions, KvGetResult, KvScanOptions, } from "./domains/kv/types";
13
+ export { QueueClient } from "./domains/queue/client";
14
+ export type { EnqueueOptions, AvailabilityHandler, AvailabilityNotification, QueueItem, QueueSubscription, QueueStatus, } from "./domains/queue/types";
15
+ export { RpcClient } from "./domains/rpc/client";
16
+ export type { RequestOptions as RpcRequestOptions, ResponseFrame, InboundRequest, ResponseWriter, RpcHandler, RpcSubscription, RpcStatus, } from "./domains/rpc/types";
17
+ export { LeaseClient } from "./domains/lease/client";
18
+ export type { LeaseInfo, Lease, ChangeHandler, ChangeNotification, LeaseSubscription, LeaseStatus, } from "./domains/lease/types";
19
+ export { NoticeClient } from "./domains/notice/client";
20
+ export type { NoticeMsg, NoticeHandler, NoticeSubscription, NoticeStatus, } from "./domains/notice/types";
21
+ export { StreamClient } from "./domains/stream/client";
22
+ export type { StreamRecord, StreamMetadata, StreamDiscriminator, StreamFilteredReason, StreamFilterClause, StreamFilterSet, StreamAppendOptions, StreamReadOptions, StreamReadCursor, StreamReadEvent, StreamReadFiltered, StreamReadFilteredRange, StreamReadItem, StreamReadPage, StreamSession, StreamCommitNotification, StreamCommitHandler, StreamSubscription, StreamCommitMode, StreamStatus, } from "./domains/stream/types";
23
+ export { ScheduleClient } from "./domains/schedule/client";
24
+ export type { ScheduleEntry, ScheduleNotification, ScheduleHandler, ScheduleSubscription, ScheduleStatus, } from "./domains/schedule/types";
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGvD,YAAY,EACV,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,UAAU,EACV,aAAa,EACb,aAAa,EACb,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,4BAA4B,EAC5B,6BAA6B,EAC7B,sBAAsB,EACtB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EACb,wBAAwB,EACxB,sBAAsB,EACtB,+BAA+B,EAC/B,mBAAmB,EACnB,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AAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,YAAY,EACV,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,aAAa,EACb,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,GACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,cAAc,GACf,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Standard response parsing utilities
3
+ * Per CLIENT_SPEC.md and fitz-go/internal/core/connection/connection.go
4
+ *
5
+ * Standard Response Format:
6
+ * [u8 status][payload...]
7
+ *
8
+ * status=0: success, remaining payload follows
9
+ * status=1: error, followed by [u32 len][error message]
10
+ */
11
+ export interface ParsedResponse {
12
+ success: boolean;
13
+ data: Uint8Array;
14
+ error?: string;
15
+ }
16
+ /**
17
+ * Parse standard response format
18
+ * Returns {success: true, data: remaining} on status=0
19
+ * Returns {success: false, error: message} on status=1
20
+ */
21
+ export declare function parseStandardResponse(payload: Uint8Array): ParsedResponse;
22
+ /**
23
+ * Check if response is success, throw error if not
24
+ * Returns remaining data on success
25
+ */
26
+ export declare function assertSuccess(payload: Uint8Array, operation: string): Uint8Array;
27
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/protocol/response.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,UAAU,GAAG,cAAc,CAiCzE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,CAShF"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Transport factory to create appropriate transport based on URL
3
+ */
4
+ import { Transport, TransportOptions } from "./types";
5
+ export declare function createTransport(url: string, transportType?: "ws" | "tcp" | "auto", options?: TransportOptions): Transport;
6
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/transport/factory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAyBtD,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,aAAa,GAAE,IAAI,GAAG,KAAK,GAAG,MAAe,EAC7C,OAAO,GAAE,gBAAqB,GAC7B,SAAS,CAsCX"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * TCP transport implementation (Node.js only)
3
+ */
4
+ import { Transport, TransportOptions } from "./types";
5
+ export declare function createTcpTransport(url: string, options?: TransportOptions): Transport;
6
+ //# sourceMappingURL=tcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tcp.d.ts","sourceRoot":"","sources":["../../../src/transport/tcp.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA8CtD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,SAAS,CA2OzF"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Transport abstraction for WebSocket and TCP
3
+ */
4
+ export interface Transport {
5
+ connect(): Promise<void>;
6
+ send(data: Uint8Array): Promise<void>;
7
+ receive(): Promise<Uint8Array>;
8
+ close(): Promise<void>;
9
+ getUrl(): string;
10
+ isConnected(): boolean;
11
+ }
12
+ export type TransportConstructor = new (url: string, options?: TransportOptions) => Transport;
13
+ export interface TransportOptions {
14
+ timeout?: number;
15
+ maxFrameSize?: number;
16
+ }
17
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/transport/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,SAAS;IACxB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,MAAM,IAAI,MAAM,CAAC;IACjB,WAAW,IAAI,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,KAAK,SAAS,CAAC;AAE9F,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * WebSocket transport implementation for Node.js and browser
3
+ */
4
+ import { Transport, TransportOptions } from "./types";
5
+ export declare function createWebSocketTransport(url: string, options?: TransportOptions): Transport;
6
+ //# sourceMappingURL=websocket.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../../../src/transport/websocket.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgEtD,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,SAAS,CAuL/F"}
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@cntryl/fitz",
3
+ "version": "0.0.1",
4
+ "description": "TypeScript client library for Fitz distributed system",
5
+ "keywords": [
6
+ "distributed-systems",
7
+ "fitz",
8
+ "queue",
9
+ "rpc",
10
+ "stream",
11
+ "tcp",
12
+ "websocket"
13
+ ],
14
+ "homepage": "https://github.com/cntryl/fitz-ts#readme",
15
+ "bugs": {
16
+ "url": "https://github.com/cntryl/fitz-ts/issues"
17
+ },
18
+ "license": "Apache-2.0",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/cntryl/fitz-ts.git"
22
+ },
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "type": "module",
27
+ "sideEffects": false,
28
+ "main": "./dist/index.cjs",
29
+ "module": "./dist/index.mjs",
30
+ "types": "./dist/types/index.d.ts",
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/types/index.d.ts",
34
+ "import": "./dist/index.mjs",
35
+ "require": "./dist/index.cjs"
36
+ }
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "scripts": {
42
+ "build": "vp pack && tsc -p tsconfig.build.json",
43
+ "pack:smoke": "npm pack --pack-destination artifacts && mkdir -p artifacts/smoke && cd artifacts/smoke && npm init -y >/dev/null 2>&1 && npm install \"../$(ls ../*.tgz | head -n 1)\" >/dev/null 2>&1",
44
+ "test": "npm run test:unit && npm run test:integration && npm run test:conformance",
45
+ "test:unit": "vp test run --project unit",
46
+ "test:integration": "vp test run --project integration",
47
+ "test:conformance": "vp test run --project conformance --reporter=verbose",
48
+ "verify:fast": "npm run fmt:check && npm run lint && npm run build && npm run test:unit",
49
+ "verify": "npm run verify:fast && npm run test:integration && npm run test:conformance",
50
+ "bench": "npm run bench:tier1 && npm run bench:tier2 && npm run bench:tier3 && npm run bench:tier4",
51
+ "bench:tier1": "cross-env NODE_ENV=production vp exec vitest bench --run --reporter=default benches/tier1/*.bench.ts",
52
+ "bench:tier2": "cross-env NODE_ENV=production vp exec vitest bench --run --reporter=default benches/tier2/*.bench.ts",
53
+ "bench:tier3": "cross-env NODE_ENV=production vp exec vitest bench --run --reporter=default benches/tier3/*.bench.ts",
54
+ "bench:tier4": "cross-env NODE_ENV=production vp exec vitest bench --run --reporter=default benches/tier4/*.bench.ts",
55
+ "lint": "vp lint . --deny-warnings",
56
+ "fmt": "vp fmt .",
57
+ "fmt:check": "vp fmt --check",
58
+ "prepare": "vp config"
59
+ },
60
+ "devDependencies": {
61
+ "@types/node": "^25.9.1",
62
+ "cross-env": "^10.1.0",
63
+ "typescript": "^6.0.3",
64
+ "vite-plus": "latest",
65
+ "vitest": "^4.1.8",
66
+ "ws": "^8.21.0"
67
+ },
68
+ "engines": {
69
+ "node": ">=20.19.0"
70
+ },
71
+ "packageManager": "npm@11.16.0"
72
+ }