@cellaflow/sdk 0.7.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.
Files changed (41) hide show
  1. package/dist/cellaflow/v1/common_pb.d.ts +119 -0
  2. package/dist/cellaflow/v1/common_pb.d.ts.map +1 -0
  3. package/dist/cellaflow/v1/common_pb.js +166 -0
  4. package/dist/cellaflow/v1/common_pb.js.map +1 -0
  5. package/dist/cellaflow/v1/idempotency_pb.d.ts +378 -0
  6. package/dist/cellaflow/v1/idempotency_pb.d.ts.map +1 -0
  7. package/dist/cellaflow/v1/idempotency_pb.js +513 -0
  8. package/dist/cellaflow/v1/idempotency_pb.js.map +1 -0
  9. package/dist/cellaflow/v1/internal_pb.d.ts +201 -0
  10. package/dist/cellaflow/v1/internal_pb.d.ts.map +1 -0
  11. package/dist/cellaflow/v1/internal_pb.js +254 -0
  12. package/dist/cellaflow/v1/internal_pb.js.map +1 -0
  13. package/dist/cellaflow/v1/service_connect.d.ts +84 -0
  14. package/dist/cellaflow/v1/service_connect.d.ts.map +1 -0
  15. package/dist/cellaflow/v1/service_connect.js +88 -0
  16. package/dist/cellaflow/v1/service_connect.js.map +1 -0
  17. package/dist/cellaflow/v1/service_pb.d.ts +172 -0
  18. package/dist/cellaflow/v1/service_pb.d.ts.map +1 -0
  19. package/dist/cellaflow/v1/service_pb.js +266 -0
  20. package/dist/cellaflow/v1/service_pb.js.map +1 -0
  21. package/dist/client.d.ts +88 -0
  22. package/dist/client.d.ts.map +1 -0
  23. package/dist/client.js +187 -0
  24. package/dist/client.js.map +1 -0
  25. package/dist/index.d.ts +5 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +8 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/serialization.d.ts +18 -0
  30. package/dist/serialization.d.ts.map +1 -0
  31. package/dist/serialization.js +41 -0
  32. package/dist/serialization.js.map +1 -0
  33. package/package.json +59 -0
  34. package/src/cellaflow/v1/common_pb.ts +195 -0
  35. package/src/cellaflow/v1/idempotency_pb.ts +591 -0
  36. package/src/cellaflow/v1/internal_pb.ts +308 -0
  37. package/src/cellaflow/v1/service_connect.ts +90 -0
  38. package/src/cellaflow/v1/service_pb.ts +323 -0
  39. package/src/client.ts +277 -0
  40. package/src/index.ts +7 -0
  41. package/src/serialization.ts +53 -0
@@ -0,0 +1,201 @@
1
+ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
2
+ import { Message, proto3 } from "@bufbuild/protobuf";
3
+ import { StepResult } from "./common_pb.js";
4
+ /**
5
+ * Internal storage record persisted in RocksDB's idempotency_cache Column Family.
6
+ * Not exposed via gRPC — used only for serialization/deserialization within the engine.
7
+ *
8
+ * @generated from message cellaflow.v1.internal.CacheRecord
9
+ */
10
+ export declare class CacheRecord extends Message<CacheRecord> {
11
+ /**
12
+ * @generated from oneof cellaflow.v1.internal.CacheRecord.record
13
+ */
14
+ record: {
15
+ /**
16
+ * @generated from field: cellaflow.v1.internal.LeaseRecord leased = 1;
17
+ */
18
+ value: LeaseRecord;
19
+ case: "leased";
20
+ } | {
21
+ /**
22
+ * @generated from field: cellaflow.v1.internal.CompletedRecord completed = 2;
23
+ */
24
+ value: CompletedRecord;
25
+ case: "completed";
26
+ } | {
27
+ case: undefined;
28
+ value?: undefined;
29
+ };
30
+ constructor(data?: PartialMessage<CacheRecord>);
31
+ static readonly runtime: typeof proto3;
32
+ static readonly typeName = "cellaflow.v1.internal.CacheRecord";
33
+ static readonly fields: FieldList;
34
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CacheRecord;
35
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CacheRecord;
36
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CacheRecord;
37
+ static equals(a: CacheRecord | PlainMessage<CacheRecord> | undefined, b: CacheRecord | PlainMessage<CacheRecord> | undefined): boolean;
38
+ }
39
+ /**
40
+ * Represents an active lease held by a worker executing a tool.
41
+ *
42
+ * @generated from message cellaflow.v1.internal.LeaseRecord
43
+ */
44
+ export declare class LeaseRecord extends Message<LeaseRecord> {
45
+ /**
46
+ * Global monotonic microsecond epoch timestamp
47
+ *
48
+ * @generated from field: uint64 fencing_token = 1;
49
+ */
50
+ fencingToken: bigint;
51
+ /**
52
+ * Opaque per-attempt identifier for observability
53
+ *
54
+ * @generated from field: string holder_id = 2;
55
+ */
56
+ holderId: string;
57
+ /**
58
+ * When the lease was acquired (epoch ms)
59
+ *
60
+ * @generated from field: uint64 acquired_at_ms = 3;
61
+ */
62
+ acquiredAtMs: bigint;
63
+ /**
64
+ * When the lease expires if not renewed (epoch ms)
65
+ *
66
+ * @generated from field: uint64 expires_at_ms = 4;
67
+ */
68
+ expiresAtMs: bigint;
69
+ /**
70
+ * the graph position this lease claimed, if the caller declared one.
71
+ *
72
+ * Carried on the lease rather than passed to release_lease / commit_result so
73
+ * that clearing the claim is a consequence of releasing the lease rather than
74
+ * a parameter a caller could get wrong or forget. It also makes "claim and
75
+ * lease lifetimes are equal" true by construction: the coordinates cannot
76
+ * outlive the record holding them.
77
+ *
78
+ * Empty on a lease acquired without a declared position — nothing to clear.
79
+ *
80
+ * @generated from field: string claimed_session_id = 5;
81
+ */
82
+ claimedSessionId: string;
83
+ /**
84
+ * @generated from field: uint64 claimed_sequence = 6;
85
+ */
86
+ claimedSequence: bigint;
87
+ /**
88
+ * The wall-clock ceiling on this lease, independent of renewals. Past it the
89
+ * lease is reclaimable however recently it was renewed, which bounds how long a
90
+ * holder can hold a position.
91
+ *
92
+ * Computed once at acquisition. A value of 0 means no ceiling.
93
+ *
94
+ * @generated from field: uint64 hard_expires_at_ms = 7;
95
+ */
96
+ hardExpiresAtMs: bigint;
97
+ constructor(data?: PartialMessage<LeaseRecord>);
98
+ static readonly runtime: typeof proto3;
99
+ static readonly typeName = "cellaflow.v1.internal.LeaseRecord";
100
+ static readonly fields: FieldList;
101
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): LeaseRecord;
102
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): LeaseRecord;
103
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): LeaseRecord;
104
+ static equals(a: LeaseRecord | PlainMessage<LeaseRecord> | undefined, b: LeaseRecord | PlainMessage<LeaseRecord> | undefined): boolean;
105
+ }
106
+ /**
107
+ * Records which idempotency key currently owns a graph position.
108
+ *
109
+ * Stored in its own `sequence_claims` column family, keyed by
110
+ * `<session_id>:<sequence padded to 20>`. Session ids are validated to contain no
111
+ * colons, so the key parses unambiguously.
112
+ *
113
+ * @generated from message cellaflow.v1.internal.SequenceClaimRecord
114
+ */
115
+ export declare class SequenceClaimRecord extends Message<SequenceClaimRecord> {
116
+ /**
117
+ * Who owns the position
118
+ *
119
+ * @generated from field: string idempotency_key = 1;
120
+ */
121
+ idempotencyKey: string;
122
+ /**
123
+ * The lease that created this claim
124
+ *
125
+ * @generated from field: uint64 fencing_token = 2;
126
+ */
127
+ fencingToken: bigint;
128
+ /**
129
+ * Opaque per-attempt id, for diagnostics
130
+ *
131
+ * @generated from field: string holder_id = 3;
132
+ */
133
+ holderId: string;
134
+ /**
135
+ * Advisory: the lease's expiry when this claim was written. Renewal extends the
136
+ * lease without rewriting the claim, so liveness is read from the owning lease
137
+ * record. Kept for diagnostics and for the refusal message.
138
+ *
139
+ * @generated from field: uint64 expires_at_ms = 4;
140
+ */
141
+ expiresAtMs: bigint;
142
+ constructor(data?: PartialMessage<SequenceClaimRecord>);
143
+ static readonly runtime: typeof proto3;
144
+ static readonly typeName = "cellaflow.v1.internal.SequenceClaimRecord";
145
+ static readonly fields: FieldList;
146
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SequenceClaimRecord;
147
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SequenceClaimRecord;
148
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SequenceClaimRecord;
149
+ static equals(a: SequenceClaimRecord | PlainMessage<SequenceClaimRecord> | undefined, b: SequenceClaimRecord | PlainMessage<SequenceClaimRecord> | undefined): boolean;
150
+ }
151
+ /**
152
+ * Represents a completed tool execution result cached for idempotency.
153
+ *
154
+ * @generated from message cellaflow.v1.internal.CompletedRecord
155
+ */
156
+ export declare class CompletedRecord extends Message<CompletedRecord> {
157
+ /**
158
+ * @generated from field: cellaflow.v1.StepResult result = 1;
159
+ */
160
+ result?: StepResult;
161
+ /**
162
+ * When the result was committed (epoch ms)
163
+ *
164
+ * @generated from field: uint64 completed_at_ms = 2;
165
+ */
166
+ completedAtMs: bigint;
167
+ /**
168
+ * The fencing token held by the worker that committed this result.
169
+ *
170
+ * Without it, once a key transitions to Completed the token that completed it
171
+ * was discarded, so a later caller's token had nothing to be validated against
172
+ * and a superseded worker received a success response. Records written before
173
+ * this field existed decode as 0, which is treated as "unknown, skip
174
+ * validation" — tokens are monotonic epoch-microsecond values and are never
175
+ * legitimately 0.
176
+ *
177
+ * @generated from field: uint64 fencing_token = 3;
178
+ */
179
+ fencingToken: bigint;
180
+ /**
181
+ * The graph sequence this result was journaled at.
182
+ *
183
+ * An AlreadyCommitted outcome only implies a durable event exists at *that*
184
+ * sequence. A caller committing the same key at a different position has no
185
+ * event backing it, so letting the actor advance its sequence would leave
186
+ * in-memory state ahead of the durable log. Same reasoning as the field above:
187
+ * 0 means a legacy record with no recorded sequence.
188
+ *
189
+ * @generated from field: uint64 committed_sequence = 4;
190
+ */
191
+ committedSequence: bigint;
192
+ constructor(data?: PartialMessage<CompletedRecord>);
193
+ static readonly runtime: typeof proto3;
194
+ static readonly typeName = "cellaflow.v1.internal.CompletedRecord";
195
+ static readonly fields: FieldList;
196
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CompletedRecord;
197
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CompletedRecord;
198
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CompletedRecord;
199
+ static equals(a: CompletedRecord | PlainMessage<CompletedRecord> | undefined, b: CompletedRecord | PlainMessage<CompletedRecord> | undefined): boolean;
200
+ }
201
+ //# sourceMappingURL=internal_pb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal_pb.d.ts","sourceRoot":"","sources":["../../../src/cellaflow/v1/internal_pb.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjI,OAAO,EAAE,OAAO,EAAE,MAAM,EAAc,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,OAAO,CAAC,WAAW,CAAC;IACnD;;OAEG;IACH,MAAM,EAAE;QACN;;WAEG;QACH,KAAK,EAAE,WAAW,CAAC;QACnB,IAAI,EAAE,QAAQ,CAAC;KAChB,GAAG;QACF;;WAEG;QACH,KAAK,EAAE,eAAe,CAAC;QACvB,IAAI,EAAE,WAAW,CAAC;KACnB,GAAG;QAAE,IAAI,EAAE,SAAS,CAAC;QAAC,KAAK,CAAC,EAAE,SAAS,CAAA;KAAE,CAAuB;IAEjE,YAAY,IAAI,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,EAG7C;IAED,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,MAAM,CAAU;IAChD,MAAM,CAAC,QAAQ,CAAC,QAAQ,uCAAuC;IAC/D,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAG9B;IAEH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,WAAW,CAEtF;IAED,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAA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3D;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB;;;;OAIG;IACH,aAAa,SAAmB;IAEhC;;;;;;;;;;;OAWG;IACH,YAAY,SAAmB;IAE/B;;;;;;;;;;OAUG;IACH,iBAAiB,SAAmB;IAEpC,YAAY,IAAI,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,EAGjD;IAED,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,MAAM,CAAU;IAChD,MAAM,CAAC,QAAQ,CAAC,QAAQ,2CAA2C;IACnE,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAK9B;IAEH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,eAAe,CAE1F;IAED,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAEzF;IAED,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAE7F;IAED,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,eAAe,GAAG,YAAY,CAAC,eAAe,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,eAAe,GAAG,YAAY,CAAC,eAAe,CAAC,GAAG,SAAS,GAAG,OAAO,CAErJ;CACF"}
@@ -0,0 +1,254 @@
1
+ // @generated by protoc-gen-es v1.10.1 with parameter "target=ts,import_extension=.js"
2
+ // @generated from file cellaflow/v1/internal.proto (package cellaflow.v1.internal, syntax proto3)
3
+ /* eslint-disable */
4
+ // @ts-nocheck
5
+ import { Message, proto3, protoInt64 } from "@bufbuild/protobuf";
6
+ import { StepResult } from "./common_pb.js";
7
+ /**
8
+ * Internal storage record persisted in RocksDB's idempotency_cache Column Family.
9
+ * Not exposed via gRPC — used only for serialization/deserialization within the engine.
10
+ *
11
+ * @generated from message cellaflow.v1.internal.CacheRecord
12
+ */
13
+ export class CacheRecord extends Message {
14
+ /**
15
+ * @generated from oneof cellaflow.v1.internal.CacheRecord.record
16
+ */
17
+ record = { case: undefined };
18
+ constructor(data) {
19
+ super();
20
+ proto3.util.initPartial(data, this);
21
+ }
22
+ static runtime = proto3;
23
+ static typeName = "cellaflow.v1.internal.CacheRecord";
24
+ static fields = proto3.util.newFieldList(() => [
25
+ { no: 1, name: "leased", kind: "message", T: LeaseRecord, oneof: "record" },
26
+ { no: 2, name: "completed", kind: "message", T: CompletedRecord, oneof: "record" },
27
+ ]);
28
+ static fromBinary(bytes, options) {
29
+ return new CacheRecord().fromBinary(bytes, options);
30
+ }
31
+ static fromJson(jsonValue, options) {
32
+ return new CacheRecord().fromJson(jsonValue, options);
33
+ }
34
+ static fromJsonString(jsonString, options) {
35
+ return new CacheRecord().fromJsonString(jsonString, options);
36
+ }
37
+ static equals(a, b) {
38
+ return proto3.util.equals(CacheRecord, a, b);
39
+ }
40
+ }
41
+ /**
42
+ * Represents an active lease held by a worker executing a tool.
43
+ *
44
+ * @generated from message cellaflow.v1.internal.LeaseRecord
45
+ */
46
+ export class LeaseRecord extends Message {
47
+ /**
48
+ * Global monotonic microsecond epoch timestamp
49
+ *
50
+ * @generated from field: uint64 fencing_token = 1;
51
+ */
52
+ fencingToken = protoInt64.zero;
53
+ /**
54
+ * Opaque per-attempt identifier for observability
55
+ *
56
+ * @generated from field: string holder_id = 2;
57
+ */
58
+ holderId = "";
59
+ /**
60
+ * When the lease was acquired (epoch ms)
61
+ *
62
+ * @generated from field: uint64 acquired_at_ms = 3;
63
+ */
64
+ acquiredAtMs = protoInt64.zero;
65
+ /**
66
+ * When the lease expires if not renewed (epoch ms)
67
+ *
68
+ * @generated from field: uint64 expires_at_ms = 4;
69
+ */
70
+ expiresAtMs = protoInt64.zero;
71
+ /**
72
+ * the graph position this lease claimed, if the caller declared one.
73
+ *
74
+ * Carried on the lease rather than passed to release_lease / commit_result so
75
+ * that clearing the claim is a consequence of releasing the lease rather than
76
+ * a parameter a caller could get wrong or forget. It also makes "claim and
77
+ * lease lifetimes are equal" true by construction: the coordinates cannot
78
+ * outlive the record holding them.
79
+ *
80
+ * Empty on a lease acquired without a declared position — nothing to clear.
81
+ *
82
+ * @generated from field: string claimed_session_id = 5;
83
+ */
84
+ claimedSessionId = "";
85
+ /**
86
+ * @generated from field: uint64 claimed_sequence = 6;
87
+ */
88
+ claimedSequence = protoInt64.zero;
89
+ /**
90
+ * The wall-clock ceiling on this lease, independent of renewals. Past it the
91
+ * lease is reclaimable however recently it was renewed, which bounds how long a
92
+ * holder can hold a position.
93
+ *
94
+ * Computed once at acquisition. A value of 0 means no ceiling.
95
+ *
96
+ * @generated from field: uint64 hard_expires_at_ms = 7;
97
+ */
98
+ hardExpiresAtMs = protoInt64.zero;
99
+ constructor(data) {
100
+ super();
101
+ proto3.util.initPartial(data, this);
102
+ }
103
+ static runtime = proto3;
104
+ static typeName = "cellaflow.v1.internal.LeaseRecord";
105
+ static fields = proto3.util.newFieldList(() => [
106
+ { no: 1, name: "fencing_token", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
107
+ { no: 2, name: "holder_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
108
+ { no: 3, name: "acquired_at_ms", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
109
+ { no: 4, name: "expires_at_ms", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
110
+ { no: 5, name: "claimed_session_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
111
+ { no: 6, name: "claimed_sequence", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
112
+ { no: 7, name: "hard_expires_at_ms", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
113
+ ]);
114
+ static fromBinary(bytes, options) {
115
+ return new LeaseRecord().fromBinary(bytes, options);
116
+ }
117
+ static fromJson(jsonValue, options) {
118
+ return new LeaseRecord().fromJson(jsonValue, options);
119
+ }
120
+ static fromJsonString(jsonString, options) {
121
+ return new LeaseRecord().fromJsonString(jsonString, options);
122
+ }
123
+ static equals(a, b) {
124
+ return proto3.util.equals(LeaseRecord, a, b);
125
+ }
126
+ }
127
+ /**
128
+ * Records which idempotency key currently owns a graph position.
129
+ *
130
+ * Stored in its own `sequence_claims` column family, keyed by
131
+ * `<session_id>:<sequence padded to 20>`. Session ids are validated to contain no
132
+ * colons, so the key parses unambiguously.
133
+ *
134
+ * @generated from message cellaflow.v1.internal.SequenceClaimRecord
135
+ */
136
+ export class SequenceClaimRecord extends Message {
137
+ /**
138
+ * Who owns the position
139
+ *
140
+ * @generated from field: string idempotency_key = 1;
141
+ */
142
+ idempotencyKey = "";
143
+ /**
144
+ * The lease that created this claim
145
+ *
146
+ * @generated from field: uint64 fencing_token = 2;
147
+ */
148
+ fencingToken = protoInt64.zero;
149
+ /**
150
+ * Opaque per-attempt id, for diagnostics
151
+ *
152
+ * @generated from field: string holder_id = 3;
153
+ */
154
+ holderId = "";
155
+ /**
156
+ * Advisory: the lease's expiry when this claim was written. Renewal extends the
157
+ * lease without rewriting the claim, so liveness is read from the owning lease
158
+ * record. Kept for diagnostics and for the refusal message.
159
+ *
160
+ * @generated from field: uint64 expires_at_ms = 4;
161
+ */
162
+ expiresAtMs = protoInt64.zero;
163
+ constructor(data) {
164
+ super();
165
+ proto3.util.initPartial(data, this);
166
+ }
167
+ static runtime = proto3;
168
+ static typeName = "cellaflow.v1.internal.SequenceClaimRecord";
169
+ static fields = proto3.util.newFieldList(() => [
170
+ { no: 1, name: "idempotency_key", kind: "scalar", T: 9 /* ScalarType.STRING */ },
171
+ { no: 2, name: "fencing_token", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
172
+ { no: 3, name: "holder_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
173
+ { no: 4, name: "expires_at_ms", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
174
+ ]);
175
+ static fromBinary(bytes, options) {
176
+ return new SequenceClaimRecord().fromBinary(bytes, options);
177
+ }
178
+ static fromJson(jsonValue, options) {
179
+ return new SequenceClaimRecord().fromJson(jsonValue, options);
180
+ }
181
+ static fromJsonString(jsonString, options) {
182
+ return new SequenceClaimRecord().fromJsonString(jsonString, options);
183
+ }
184
+ static equals(a, b) {
185
+ return proto3.util.equals(SequenceClaimRecord, a, b);
186
+ }
187
+ }
188
+ /**
189
+ * Represents a completed tool execution result cached for idempotency.
190
+ *
191
+ * @generated from message cellaflow.v1.internal.CompletedRecord
192
+ */
193
+ export class CompletedRecord extends Message {
194
+ /**
195
+ * @generated from field: cellaflow.v1.StepResult result = 1;
196
+ */
197
+ result;
198
+ /**
199
+ * When the result was committed (epoch ms)
200
+ *
201
+ * @generated from field: uint64 completed_at_ms = 2;
202
+ */
203
+ completedAtMs = protoInt64.zero;
204
+ /**
205
+ * The fencing token held by the worker that committed this result.
206
+ *
207
+ * Without it, once a key transitions to Completed the token that completed it
208
+ * was discarded, so a later caller's token had nothing to be validated against
209
+ * and a superseded worker received a success response. Records written before
210
+ * this field existed decode as 0, which is treated as "unknown, skip
211
+ * validation" — tokens are monotonic epoch-microsecond values and are never
212
+ * legitimately 0.
213
+ *
214
+ * @generated from field: uint64 fencing_token = 3;
215
+ */
216
+ fencingToken = protoInt64.zero;
217
+ /**
218
+ * The graph sequence this result was journaled at.
219
+ *
220
+ * An AlreadyCommitted outcome only implies a durable event exists at *that*
221
+ * sequence. A caller committing the same key at a different position has no
222
+ * event backing it, so letting the actor advance its sequence would leave
223
+ * in-memory state ahead of the durable log. Same reasoning as the field above:
224
+ * 0 means a legacy record with no recorded sequence.
225
+ *
226
+ * @generated from field: uint64 committed_sequence = 4;
227
+ */
228
+ committedSequence = protoInt64.zero;
229
+ constructor(data) {
230
+ super();
231
+ proto3.util.initPartial(data, this);
232
+ }
233
+ static runtime = proto3;
234
+ static typeName = "cellaflow.v1.internal.CompletedRecord";
235
+ static fields = proto3.util.newFieldList(() => [
236
+ { no: 1, name: "result", kind: "message", T: StepResult },
237
+ { no: 2, name: "completed_at_ms", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
238
+ { no: 3, name: "fencing_token", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
239
+ { no: 4, name: "committed_sequence", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
240
+ ]);
241
+ static fromBinary(bytes, options) {
242
+ return new CompletedRecord().fromBinary(bytes, options);
243
+ }
244
+ static fromJson(jsonValue, options) {
245
+ return new CompletedRecord().fromJson(jsonValue, options);
246
+ }
247
+ static fromJsonString(jsonString, options) {
248
+ return new CompletedRecord().fromJsonString(jsonString, options);
249
+ }
250
+ static equals(a, b) {
251
+ return proto3.util.equals(CompletedRecord, a, b);
252
+ }
253
+ }
254
+ //# sourceMappingURL=internal_pb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal_pb.js","sourceRoot":"","sources":["../../../src/cellaflow/v1/internal_pb.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,kGAAkG;AAClG,oBAAoB;AACpB,cAAc;AAGd,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,OAAO,WAAY,SAAQ,OAAoB;IACnD;;OAEG;IACH,MAAM,GAYuC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAEjE,YAAY,IAAkC;QAC5C,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,CAAU,OAAO,GAAkB,MAAM,CAAC;IAChD,MAAM,CAAU,QAAQ,GAAG,mCAAmC,CAAC;IAC/D,MAAM,CAAU,MAAM,GAAc,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;QACjE,EAAE,EAAE,EAAE,CAAC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kC;QAC1E,OAAO,IAAI,eAAe,EAAE,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,CAA8D,EAAE,CAA8D;QAC1I,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnD,CAAC;CACF"}
@@ -0,0 +1,84 @@
1
+ import { CommitStepRequest, CommitStepResponse, GetGraphRequest, GetGraphResponse, StartSessionRequest, StartSessionResponse } from "./service_pb.js";
2
+ import { MethodKind } from "@bufbuild/protobuf";
3
+ import { CheckCacheRequest, CheckCacheResponse, ReleaseLeaseRequest, ReleaseLeaseResponse, RenewLeaseRequest, RenewLeaseResponse } from "./idempotency_pb.js";
4
+ /**
5
+ * @generated from service cellaflow.v1.WorkflowEngineService
6
+ */
7
+ export declare const WorkflowEngineService: {
8
+ readonly typeName: "cellaflow.v1.WorkflowEngineService";
9
+ readonly methods: {
10
+ /**
11
+ * Starts a new workflow execution session.
12
+ * Concurrency Guard: If the client proposes a custom `session_id` inside StartSessionRequest,
13
+ * the engine MUST perform transactional check-and-insert to prevent concurrent race conditions
14
+ * that would result in double-initialization or state overwriting.
15
+ *
16
+ * @generated from rpc cellaflow.v1.WorkflowEngineService.StartSession
17
+ */
18
+ readonly startSession: {
19
+ readonly name: "StartSession";
20
+ readonly I: typeof StartSessionRequest;
21
+ readonly O: typeof StartSessionResponse;
22
+ readonly kind: MethodKind.Unary;
23
+ };
24
+ /**
25
+ * Commits the result of an execution step (Cognitive Graph event).
26
+ * Ordering Guard: The engine MUST validate that `step_result.sequence` matches the expected
27
+ * next sequence number (i.e. expected = current_sequence + 1).
28
+ * Concurrency Guard: The write transaction MUST perform an optimistic concurrency check
29
+ * comparing expected vs actual current sequence to fail gracefully in case of race conditions.
30
+ *
31
+ * @generated from rpc cellaflow.v1.WorkflowEngineService.CommitStep
32
+ */
33
+ readonly commitStep: {
34
+ readonly name: "CommitStep";
35
+ readonly I: typeof CommitStepRequest;
36
+ readonly O: typeof CommitStepResponse;
37
+ readonly kind: MethodKind.Unary;
38
+ };
39
+ /**
40
+ * Retrieves the Cognitive Graph history (sequence of steps) for a session.
41
+ * Pagination Guard: GetGraphResponse is paginated. The implementation must enforce a default
42
+ * pagination limit (e.g. 100) and a maximum pagination limit (e.g. 1000) to prevent OOM errors
43
+ * on large graph histories.
44
+ *
45
+ * @generated from rpc cellaflow.v1.WorkflowEngineService.GetGraph
46
+ */
47
+ readonly getGraph: {
48
+ readonly name: "GetGraph";
49
+ readonly I: typeof GetGraphRequest;
50
+ readonly O: typeof GetGraphResponse;
51
+ readonly kind: MethodKind.Unary;
52
+ };
53
+ /**
54
+ * Idempotency cache RPCs
55
+ *
56
+ * @generated from rpc cellaflow.v1.WorkflowEngineService.CheckIdempotencyCache
57
+ */
58
+ readonly checkIdempotencyCache: {
59
+ readonly name: "CheckIdempotencyCache";
60
+ readonly I: typeof CheckCacheRequest;
61
+ readonly O: typeof CheckCacheResponse;
62
+ readonly kind: MethodKind.Unary;
63
+ };
64
+ /**
65
+ * @generated from rpc cellaflow.v1.WorkflowEngineService.RenewLease
66
+ */
67
+ readonly renewLease: {
68
+ readonly name: "RenewLease";
69
+ readonly I: typeof RenewLeaseRequest;
70
+ readonly O: typeof RenewLeaseResponse;
71
+ readonly kind: MethodKind.Unary;
72
+ };
73
+ /**
74
+ * @generated from rpc cellaflow.v1.WorkflowEngineService.ReleaseLease
75
+ */
76
+ readonly releaseLease: {
77
+ readonly name: "ReleaseLease";
78
+ readonly I: typeof ReleaseLeaseRequest;
79
+ readonly O: typeof ReleaseLeaseResponse;
80
+ readonly kind: MethodKind.Unary;
81
+ };
82
+ };
83
+ };
84
+ //# sourceMappingURL=service_connect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service_connect.d.ts","sourceRoot":"","sources":["../../../src/cellaflow/v1/service_connect.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACtJ,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9J;;GAEG;AACH,eAAO,MAAM,qBAAqB;aAChC,QAAQ,EAAE,oCAAoC;aAC9C,OAAO;QACL;;;;;;;WAOG;iBACH,YAAY;qBACV,IAAI,EAAE,cAAc;qBACpB,CAAC;qBACD,CAAC;qBACD,IAAI;;QAEN;;;;;;;;WAQG;iBACH,UAAU;qBACR,IAAI,EAAE,YAAY;qBAClB,CAAC;qBACD,CAAC;qBACD,IAAI;;QAEN;;;;;;;WAOG;iBACH,QAAQ;qBACN,IAAI,EAAE,UAAU;qBAChB,CAAC;qBACD,CAAC;qBACD,IAAI;;QAEN;;;;WAIG;iBACH,qBAAqB;qBACnB,IAAI,EAAE,uBAAuB;qBAC7B,CAAC;qBACD,CAAC;qBACD,IAAI;;QAEN;;WAEG;iBACH,UAAU;qBACR,IAAI,EAAE,YAAY;qBAClB,CAAC;qBACD,CAAC;qBACD,IAAI;;QAEN;;WAEG;iBACH,YAAY;qBACV,IAAI,EAAE,cAAc;qBACpB,CAAC;qBACD,CAAC;qBACD,IAAI;;;CAGA,CAAC"}
@@ -0,0 +1,88 @@
1
+ // @generated by protoc-gen-connect-es v1.7.0 with parameter "target=ts,import_extension=.js"
2
+ // @generated from file cellaflow/v1/service.proto (package cellaflow.v1, syntax proto3)
3
+ /* eslint-disable */
4
+ // @ts-nocheck
5
+ import { CommitStepRequest, CommitStepResponse, GetGraphRequest, GetGraphResponse, StartSessionRequest, StartSessionResponse } from "./service_pb.js";
6
+ import { MethodKind } from "@bufbuild/protobuf";
7
+ import { CheckCacheRequest, CheckCacheResponse, ReleaseLeaseRequest, ReleaseLeaseResponse, RenewLeaseRequest, RenewLeaseResponse } from "./idempotency_pb.js";
8
+ /**
9
+ * @generated from service cellaflow.v1.WorkflowEngineService
10
+ */
11
+ export const WorkflowEngineService = {
12
+ typeName: "cellaflow.v1.WorkflowEngineService",
13
+ methods: {
14
+ /**
15
+ * Starts a new workflow execution session.
16
+ * Concurrency Guard: If the client proposes a custom `session_id` inside StartSessionRequest,
17
+ * the engine MUST perform transactional check-and-insert to prevent concurrent race conditions
18
+ * that would result in double-initialization or state overwriting.
19
+ *
20
+ * @generated from rpc cellaflow.v1.WorkflowEngineService.StartSession
21
+ */
22
+ startSession: {
23
+ name: "StartSession",
24
+ I: StartSessionRequest,
25
+ O: StartSessionResponse,
26
+ kind: MethodKind.Unary,
27
+ },
28
+ /**
29
+ * Commits the result of an execution step (Cognitive Graph event).
30
+ * Ordering Guard: The engine MUST validate that `step_result.sequence` matches the expected
31
+ * next sequence number (i.e. expected = current_sequence + 1).
32
+ * Concurrency Guard: The write transaction MUST perform an optimistic concurrency check
33
+ * comparing expected vs actual current sequence to fail gracefully in case of race conditions.
34
+ *
35
+ * @generated from rpc cellaflow.v1.WorkflowEngineService.CommitStep
36
+ */
37
+ commitStep: {
38
+ name: "CommitStep",
39
+ I: CommitStepRequest,
40
+ O: CommitStepResponse,
41
+ kind: MethodKind.Unary,
42
+ },
43
+ /**
44
+ * Retrieves the Cognitive Graph history (sequence of steps) for a session.
45
+ * Pagination Guard: GetGraphResponse is paginated. The implementation must enforce a default
46
+ * pagination limit (e.g. 100) and a maximum pagination limit (e.g. 1000) to prevent OOM errors
47
+ * on large graph histories.
48
+ *
49
+ * @generated from rpc cellaflow.v1.WorkflowEngineService.GetGraph
50
+ */
51
+ getGraph: {
52
+ name: "GetGraph",
53
+ I: GetGraphRequest,
54
+ O: GetGraphResponse,
55
+ kind: MethodKind.Unary,
56
+ },
57
+ /**
58
+ * Idempotency cache RPCs
59
+ *
60
+ * @generated from rpc cellaflow.v1.WorkflowEngineService.CheckIdempotencyCache
61
+ */
62
+ checkIdempotencyCache: {
63
+ name: "CheckIdempotencyCache",
64
+ I: CheckCacheRequest,
65
+ O: CheckCacheResponse,
66
+ kind: MethodKind.Unary,
67
+ },
68
+ /**
69
+ * @generated from rpc cellaflow.v1.WorkflowEngineService.RenewLease
70
+ */
71
+ renewLease: {
72
+ name: "RenewLease",
73
+ I: RenewLeaseRequest,
74
+ O: RenewLeaseResponse,
75
+ kind: MethodKind.Unary,
76
+ },
77
+ /**
78
+ * @generated from rpc cellaflow.v1.WorkflowEngineService.ReleaseLease
79
+ */
80
+ releaseLease: {
81
+ name: "ReleaseLease",
82
+ I: ReleaseLeaseRequest,
83
+ O: ReleaseLeaseResponse,
84
+ kind: MethodKind.Unary,
85
+ },
86
+ }
87
+ };
88
+ //# sourceMappingURL=service_connect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service_connect.js","sourceRoot":"","sources":["../../../src/cellaflow/v1/service_connect.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,wFAAwF;AACxF,oBAAoB;AACpB,cAAc;AAEd,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACtJ,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9J;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,QAAQ,EAAE,oCAAoC;IAC9C,OAAO,EAAE;QACP;;;;;;;WAOG;QACH,YAAY,EAAE;YACZ,IAAI,EAAE,cAAc;YACpB,CAAC,EAAE,mBAAmB;YACtB,CAAC,EAAE,oBAAoB;YACvB,IAAI,EAAE,UAAU,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