@catalyst-cloud/sdk 0.8.49 → 0.9.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 +45 -0
- package/dist/browser.d.ts +2 -2
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +5 -3
- package/dist/browser.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/live-sync-client.d.ts +143 -7
- package/dist/live-sync-client.d.ts.map +1 -1
- package/dist/live-sync-client.js +446 -69
- package/dist/live-sync-client.js.map +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +1 -1
- package/dist/node.js.map +1 -1
- package/dist/otel.d.ts.map +1 -1
- package/dist/otel.js +3 -0
- package/dist/otel.js.map +1 -1
- package/dist/replica/catalyst-replica.d.ts +24 -2
- package/dist/replica/catalyst-replica.d.ts.map +1 -1
- package/dist/replica/catalyst-replica.js +78 -5
- package/dist/replica/catalyst-replica.js.map +1 -1
- package/dist/tenant-client.d.ts +537 -0
- package/dist/tenant-client.d.ts.map +1 -0
- package/dist/tenant-client.js +504 -0
- package/dist/tenant-client.js.map +1 -0
- package/dist/tenant-contract.d.ts +237 -0
- package/dist/tenant-contract.d.ts.map +1 -0
- package/dist/tenant-contract.js +183 -0
- package/dist/tenant-contract.js.map +1 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -202,6 +202,48 @@ Built in, because browsers need them:
|
|
|
202
202
|
|
|
203
203
|
The worker is a **side-effect module** (it registers a message handler and exports nothing), so it is listed in the package's `sideEffects` array — do not configure your bundler to tree-shake it, or it will load and register nothing and every replica call will hang.
|
|
204
204
|
|
|
205
|
+
### Tenant client — typed reads and writes over HTTP
|
|
206
|
+
|
|
207
|
+
`createTenantClient` is one implementation of every tenant read and write, so a CLI, a skill script, an MCP tool and your own code share it instead of each carrying a bearer, a base URL and a response parser. Every call resolves to a discriminated union on `outcome` — nothing throws for a server answer — and every `agent.*` write's path is resolved from the tenant's own contract (`GET /api/v1/agent/contract`, read once and cached under the document's own ETag policy), never a literal.
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
import { createTenantClient, stageIdForSlot, teamForTicket } from "@catalyst-cloud/sdk";
|
|
211
|
+
|
|
212
|
+
const client = createTenantClient({
|
|
213
|
+
key: process.env.CATALYST_CLOUD_TOKEN!, // an organization-tier key for agent.* writes
|
|
214
|
+
baseUrl: "https://staging.catalystcloud.dev",
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
// A keyset-paged read: follow `nextCursor` (typed, read off X-Mirror-Next-Cursor) until it is null.
|
|
218
|
+
let after = undefined;
|
|
219
|
+
do {
|
|
220
|
+
const page = await client.issues.list({ teamKey: "ENG", state: "active", limit: 100, after });
|
|
221
|
+
if (page.outcome !== "ok") throw new Error(`${page.outcome}: ${"reason" in page ? page.reason : ""}`);
|
|
222
|
+
for (const row of page.rows) console.log(row.identifier, row.title);
|
|
223
|
+
after = page.nextCursor ?? undefined;
|
|
224
|
+
} while (after);
|
|
225
|
+
|
|
226
|
+
// A write as the app actor. The state id comes from the contract by SLOT, never by a display name.
|
|
227
|
+
const contract = await client.contract();
|
|
228
|
+
if (contract.outcome !== "ok") throw new Error(`contract: ${contract.outcome}`);
|
|
229
|
+
const team = teamForTicket(contract.doc, "ENG-12");
|
|
230
|
+
const stage = team.outcome === "ok" ? stageIdForSlot(team.team, "research") : team;
|
|
231
|
+
if (stage.outcome !== "ok") throw new Error(stage.outcome); // "slot-unmapped" / "slot-stale" / "team-unknown"
|
|
232
|
+
|
|
233
|
+
const issue = await client.issues.get("ENG-12");
|
|
234
|
+
if (issue.outcome !== "ok") throw new Error(issue.outcome);
|
|
235
|
+
const moved = await client.agent.issueState({ issueId: issue.issue.id, stateId: stage.stateId });
|
|
236
|
+
switch (moved.outcome) {
|
|
237
|
+
case "succeeded": break; // moved.attempts
|
|
238
|
+
case "rate-limited": /* moved.retryAfterSeconds may be null */ break;
|
|
239
|
+
case "forbidden": /* moved.required names a missing scope */ break;
|
|
240
|
+
case "route-unknown": /* this tenant's contract lists no issue-state route */ break;
|
|
241
|
+
default: /* rejected | exhausted | failed | unauthorized | network | shape | http | stale | missing */ break;
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
The contract cache is in memory per client by default; pass `contractCache: { get, set }` to keep it on disk (the bundle does). `fetch`, `now` and `timeoutMs` are injectable so a test never opens a socket.
|
|
246
|
+
|
|
205
247
|
## API
|
|
206
248
|
|
|
207
249
|
| Export | What it is |
|
|
@@ -211,6 +253,9 @@ Built in, because browsers need them:
|
|
|
211
253
|
| `AuthStrategy` | `{ kind: "token"; token }` (backend) or `{ kind: "cookie" }` (browser). |
|
|
212
254
|
| `LiveSyncStatus` | `"connecting"` · `"live"` · `"reconnecting"` · `"resyncing"` · `"error"` · `"stopped"`. |
|
|
213
255
|
| `ChangeFrame` · `EntityName` · `ChangeOp` | The change shape + the entity/op contract. |
|
|
256
|
+
| `createTenantClient` | The typed HTTP client — `contract()`, `me()`, `issues.list/get`, `pulls.list/get`, `projects.list`, `agent.*` (issueState, issueLabel, issueComment, issueCreate, reaction, attachment, attachments, session, ask, askAccept). |
|
|
257
|
+
| `TenantContract` · `routeByName` · `teamByKey` · `teamForTicket` · `stageIdForSlot` · `labelIdFor` | The contract document's shape and the pure accessors over it, each returning a typed miss rather than throwing. |
|
|
258
|
+
| `TenantClientFailure` · `PageCursor` · `pageCursor` · `memoryContractCache` | The shared failure arms, the opaque page token, and the default contract cache store. |
|
|
214
259
|
|
|
215
260
|
`start()` resolves only when `stop()` is called. On a backend, `await` it to keep the process alive; in a browser, never await it — just call `stop()` on teardown.
|
|
216
261
|
|
package/dist/browser.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ export { BrowserReplica, streamSeedIntoWorker, type BrowserReplicaOptions, type
|
|
|
2
2
|
export { isBrowserReplicaSupported } from "./replica/browser/support.js";
|
|
3
3
|
export { acquireReplicaLock, type ReplicaLockHandle, type ReplicaLockOptions, } from "./replica/browser/browser-lock.js";
|
|
4
4
|
export { DeltaQueue, MAX_APPLY_BATCH_ROWS, MAX_INBOX_DEPTH, type SeqChange, type DeltaQueueOptions, } from "./replica/browser/delta-queue.js";
|
|
5
|
-
export { streamSnapshotBatches, SEED_BATCH_ROWS } from "./replica/browser/snapshot-stream.js";
|
|
5
|
+
export { streamSnapshotBatches, SEED_BATCH_ROWS, } from "./replica/browser/snapshot-stream.js";
|
|
6
6
|
export type { WireChange, ReplicaRequest, ReplicaResponse, Envelope, ResultMap, ApplyChangesResult, } from "./replica/browser/protocol.js";
|
|
7
|
-
export { LiveSyncClient, type AuthStrategy, type LiveSyncStatus, type LogLevel, type WebSocketLike, type WebSocketFactory, } from "./live-sync-client.js";
|
|
7
|
+
export { LiveSyncClient, AuthError, CLOSE_REAUTHENTICATE, type AuthStrategy, type LiveSyncStatus, type LogLevel, type WebSocketLike, type WebSocketFactory, } from "./live-sync-client.js";
|
|
8
8
|
export { ENTITY_NAMES, CHANGE_OPS, type AccountId, type EntityName, type ChangeOp, type ChangeFrame, } from "./types.js";
|
|
9
9
|
//# sourceMappingURL=browser.d.ts.map
|
package/dist/browser.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EACL,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,KAAK,SAAS,EACd,KAAK,iBAAiB,GACvB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EACL,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,KAAK,SAAS,EACd,KAAK,iBAAiB,GACvB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,qBAAqB,EACrB,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAE9C,YAAY,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,QAAQ,EACR,SAAS,EACT,kBAAkB,GACnB,MAAM,+BAA+B,CAAC;AAKvC,OAAO,EACL,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,gBAAgB,GACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,YAAY,EACZ,UAAU,EACV,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC"}
|
package/dist/browser.js
CHANGED
|
@@ -17,8 +17,10 @@ export { BrowserReplica, streamSeedIntoWorker, } from "./replica/browser/browser
|
|
|
17
17
|
export { isBrowserReplicaSupported } from "./replica/browser/support.js";
|
|
18
18
|
export { acquireReplicaLock, } from "./replica/browser/browser-lock.js";
|
|
19
19
|
export { DeltaQueue, MAX_APPLY_BATCH_ROWS, MAX_INBOX_DEPTH, } from "./replica/browser/delta-queue.js";
|
|
20
|
-
export { streamSnapshotBatches, SEED_BATCH_ROWS } from "./replica/browser/snapshot-stream.js";
|
|
21
|
-
// Re-export the transport surface so a consumer can stay on one import
|
|
22
|
-
|
|
20
|
+
export { streamSnapshotBatches, SEED_BATCH_ROWS, } from "./replica/browser/snapshot-stream.js";
|
|
21
|
+
// Re-export the transport surface so a consumer can stay on one import — including the bearer-auth
|
|
22
|
+
// symbols (CTC-2111), so a browser consumer can `instanceof AuthError` in onAuthError from the same
|
|
23
|
+
// subpath it built the client from. Mirrors /node and the root.
|
|
24
|
+
export { LiveSyncClient, AuthError, CLOSE_REAUTHENTICATE, } from "./live-sync-client.js";
|
|
23
25
|
export { ENTITY_NAMES, CHANGE_OPS, } from "./types.js";
|
|
24
26
|
//# sourceMappingURL=browser.js.map
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,sCAAsC;AACtC,EAAE;AACF,6FAA6F;AAC7F,sGAAsG;AACtG,8FAA8F;AAC9F,uGAAuG;AACvG,+FAA+F;AAC/F,2EAA2E;AAC3E,EAAE;AACF,oFAAoF;AACpF,sGAAsG;AACtG,sGAAsG;AACtG,sGAAsG;AACtG,6FAA6F;AAE7F,OAAO,EACL,cAAc,EACd,oBAAoB,GAIrB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EACL,kBAAkB,GAGnB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,eAAe,GAGhB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,sCAAsC;AACtC,EAAE;AACF,6FAA6F;AAC7F,sGAAsG;AACtG,8FAA8F;AAC9F,uGAAuG;AACvG,+FAA+F;AAC/F,2EAA2E;AAC3E,EAAE;AACF,oFAAoF;AACpF,sGAAsG;AACtG,sGAAsG;AACtG,sGAAsG;AACtG,6FAA6F;AAE7F,OAAO,EACL,cAAc,EACd,oBAAoB,GAIrB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EACL,kBAAkB,GAGnB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,eAAe,GAGhB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,qBAAqB,EACrB,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAW9C,mGAAmG;AACnG,oGAAoG;AACpG,gEAAgE;AAChE,OAAO,EACL,cAAc,EACd,SAAS,EACT,oBAAoB,GAMrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,YAAY,EACZ,UAAU,GAKX,MAAM,YAAY,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export { LiveSyncClient, buildConnectUrl, parseFrame, toWsOrigin, type AuthStrategy, type LiveSyncClientOptions, type LiveSyncStatus, type LogLevel, type WebSocketLike, type WebSocketFactory, } from "./live-sync-client.js";
|
|
1
|
+
export { LiveSyncClient, AuthError, CLOSE_REAUTHENTICATE, buildConnectUrl, parseFrame, toWsOrigin, type AuthStrategy, type LiveSyncClientOptions, type LiveSyncStatus, type LogLevel, type WebSocketLike, type WebSocketFactory, } from "./live-sync-client.js";
|
|
2
2
|
export { ENTITY_NAMES, CHANGE_OPS, PING_FRAME, PONG_FRAME, type AccountId, type EntityName, type ChangeOp, type ChangeFrame, type ResyncFrame, type SyncFrame, type PongFrame, type HeadFrame, type ServerFrame, } from "./types.js";
|
|
3
3
|
export { DEFAULT_SCOPE_NAME, CATALYST_ATTR, REPLICA_METRIC, REPLICA_LOG, REPLICA_SPAN, REPLICA_STATUS_CODE, type ReplicaApplyResult, type ReplicaGapEvent, type TelemetryConfig, } from "./otel.js";
|
|
4
|
+
export { createTenantClient, memoryContractCache, normalizeBaseUrl, DEFAULT_TIMEOUT_MS, NEXT_CURSOR_HEADER, HEAD_SEQ_HEADER, TOTAL_HEADER, BLOCKED_ON_ASK_TOTAL_HEADER, CONTRACT_VERSION_HEADER, type TenantClient, type TenantClientOptions, type TenantClientFailure, type ContractCacheEntry, type ContractCacheStore, type ContractOptions, type ContractResult, type ContractFailure, pageCursor, type PageCursor, type KeysetPageMeta, type IssueListParams, type IssueListResult, type IssueGetResult, type PullListParams, type PullListResult, type PullGetResult, type ProjectListParams, type ProjectListResult, type MeResult, type AgentRouteName, type AgentCallFailure, type ProxiedWriteOutcome, type ProxiedWriteBody, type IssueStateInput, type IssueStateResult, type IssueLabelInput, type IssueLabelItemResult, type IssueLabelResult, type IssueCommentInput, type IssueCommentResult, type IssueCreateInput, type IssueCreateResult, type ReactionInput, type ReactionResult, type ProxiedAttachment, type AttachmentInput, type AttachmentResult, type AttachmentsResult, type SessionPlanEntry, type SessionActivity, type SessionInput, type EnsureSessionOutcome, type SessionResult, type AskInput, type AskResult, type AskAcceptInput, type AskAcceptRefusal, type AskAcceptResult, } from "./tenant-client.js";
|
|
5
|
+
export { CONTRACT_ROUTE, TENANT_CONTRACT_KEYS, isTenantContract, readTenantContract, routeByName, teamByKey, teamForTicket, stageIdForSlot, labelIdFor, type TenantContract, type WorkflowSlot, type LabelScopeKind, type ContractLabel, type ContractStage, type ContractReadinessCheck, type ContractTeam, type ContractRoute, type ContractMergeRepository, type ContractMergeCleanPassShape, type ContractAdvanceRule, type TeamLookup, type StageLookup, type LabelLookup, } from "./tenant-contract.js";
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,cAAc,EACd,eAAe,EACf,UAAU,EACV,UAAU,EACV,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,gBAAgB,GACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AAKpB,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,UAAU,EACV,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,gBAAgB,GACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AAKpB,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,WAAW,EACX,YAAY,EACZ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B,EAChB,kBAAkB,EAClB,WAAW,EACX,SAAS,EACT,aAAa,EACb,cAAc,EACd,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,10 +5,17 @@
|
|
|
5
5
|
// into your own store.
|
|
6
6
|
//
|
|
7
7
|
// The class is storage-agnostic and auth-injected: see {@link LiveSyncClient}.
|
|
8
|
-
export { LiveSyncClient, buildConnectUrl, parseFrame, toWsOrigin, } from "./live-sync-client.js";
|
|
8
|
+
export { LiveSyncClient, AuthError, CLOSE_REAUTHENTICATE, buildConnectUrl, parseFrame, toWsOrigin, } from "./live-sync-client.js";
|
|
9
9
|
export { ENTITY_NAMES, CHANGE_OPS, PING_FRAME, PONG_FRAME, } from "./types.js";
|
|
10
10
|
// The opt-in OpenTelemetry contract (CTC-138). Just the `telemetry` option type + the instrumentation
|
|
11
11
|
// scope / metric / span / attribute NAMES (plain consts + a structural type, NO `@opentelemetry/api`
|
|
12
12
|
// type leak), so a consumer can type the option and reference the exact stream names for dashboards.
|
|
13
13
|
export { DEFAULT_SCOPE_NAME, CATALYST_ATTR, REPLICA_METRIC, REPLICA_LOG, REPLICA_SPAN, REPLICA_STATUS_CODE, } from "./otel.js";
|
|
14
|
+
// CTC-2004 — the typed tenant client: one implementation of every tenant read and write (the
|
|
15
|
+
// contract with its ETag cache, the keyset-paged lists, every /api/v1/agent/* write), so the CLI, the
|
|
16
|
+
// skill scripts and MCP tools stop carrying their own. Results are discriminated unions on `outcome`;
|
|
17
|
+
// nothing throws for a server answer. The `TenantContract` declaration is the SDK's own copy of the
|
|
18
|
+
// cloud's (the cloud's package is private), pinned against its committed fixture in test/.
|
|
19
|
+
export { createTenantClient, memoryContractCache, normalizeBaseUrl, DEFAULT_TIMEOUT_MS, NEXT_CURSOR_HEADER, HEAD_SEQ_HEADER, TOTAL_HEADER, BLOCKED_ON_ASK_TOTAL_HEADER, CONTRACT_VERSION_HEADER, pageCursor, } from "./tenant-client.js";
|
|
20
|
+
export { CONTRACT_ROUTE, TENANT_CONTRACT_KEYS, isTenantContract, readTenantContract, routeByName, teamByKey, teamForTicket, stageIdForSlot, labelIdFor, } from "./tenant-contract.js";
|
|
14
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,EAAE;AACF,sGAAsG;AACtG,mGAAmG;AACnG,uBAAuB;AACvB,EAAE;AACF,+EAA+E;AAE/E,OAAO,EACL,cAAc,EACd,eAAe,EACf,UAAU,EACV,UAAU,GAOX,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,GAUX,MAAM,YAAY,CAAC;AAEpB,sGAAsG;AACtG,qGAAqG;AACrG,qGAAqG;AACrG,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,WAAW,EACX,YAAY,EACZ,mBAAmB,GAIpB,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,EAAE;AACF,sGAAsG;AACtG,mGAAmG;AACnG,uBAAuB;AACvB,EAAE;AACF,+EAA+E;AAE/E,OAAO,EACL,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,UAAU,GAOX,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,GAUX,MAAM,YAAY,CAAC;AAEpB,sGAAsG;AACtG,qGAAqG;AACrG,qGAAqG;AACrG,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,WAAW,EACX,YAAY,EACZ,mBAAmB,GAIpB,MAAM,WAAW,CAAC;AAEnB,6FAA6F;AAC7F,sGAAsG;AACtG,sGAAsG;AACtG,oGAAoG;AACpG,2FAA2F;AAC3F,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,2BAA2B,EAC3B,uBAAuB,EASvB,UAAU,GAyCX,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,SAAS,EACT,aAAa,EACb,cAAc,EACd,UAAU,GAeX,MAAM,sBAAsB,CAAC"}
|
|
@@ -26,15 +26,39 @@ export type WebSocketFactory = (url: string) => WebSocketLike;
|
|
|
26
26
|
* trusted backend — never the browser.
|
|
27
27
|
* • `cookie` — append NOTHING to the URL. The browser's same-origin session cookie rides the
|
|
28
28
|
* WebSocket upgrade automatically. This makes it impossible to leak a token from the browser path.
|
|
29
|
+
* • `bearer` — a person's OAuth access token, resolved by `getToken()` and awaited FRESH on every
|
|
30
|
+
* (re)connect and every /snapshot fetch (CTC-2111). The token is short-lived (a WorkOS user access
|
|
31
|
+
* token, ~15 min) and rotates underneath a running client, so unlike `token` it is NEVER captured
|
|
32
|
+
* once. Its resolved value rides `?token=` exactly as the `token` strategy's value does. Pair it
|
|
33
|
+
* with `onAuthError` + the `"auth-required"` status: a mirror close code 4401 means re-authenticate
|
|
34
|
+
* (revocation / inactivity), and the client STOPS reconnecting rather than hammering a dead token.
|
|
29
35
|
*/
|
|
30
36
|
export type AuthStrategy = {
|
|
31
37
|
kind: "token";
|
|
32
38
|
token: string;
|
|
33
39
|
} | {
|
|
34
40
|
kind: "cookie";
|
|
41
|
+
} | {
|
|
42
|
+
kind: "bearer";
|
|
43
|
+
getToken: () => Promise<string>;
|
|
35
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* A typed authorization failure surfaced through `onAuthError` (CTC-2111). `code` distinguishes the
|
|
47
|
+
* two wire origins: `4401` is the mirror's WebSocket close code for an accept-time token that aged out
|
|
48
|
+
* ("reauthenticate"); `401`/`403` are the HTTP status of a rejected `/snapshot` fetch. It replaces the
|
|
49
|
+
* opaque `Error("/snapshot 401")` a consumer could not act on — an AuthError says re-authenticate,
|
|
50
|
+
* a plain Error says retry.
|
|
51
|
+
*/
|
|
52
|
+
export declare class AuthError extends Error {
|
|
53
|
+
readonly code: 4401 | 401 | 403;
|
|
54
|
+
readonly reason?: string;
|
|
55
|
+
constructor(code: 4401 | 401 | 403, reason?: string);
|
|
56
|
+
}
|
|
57
|
+
/** The mirror's WebSocket close code for an accept-time authorization that aged out (CTC-2111): the
|
|
58
|
+
* socket must be re-opened with a fresh token, not blindly reconnected. */
|
|
59
|
+
export declare const CLOSE_REAUTHENTICATE = 4401;
|
|
36
60
|
/** Connection lifecycle, surfaced via `onStatus` so a consumer can drive UI. */
|
|
37
|
-
export type LiveSyncStatus = "connecting" | "live" | "reconnecting" | "resyncing" | "error" | "stopped";
|
|
61
|
+
export type LiveSyncStatus = "connecting" | "live" | "reconnecting" | "resyncing" | "error" | "stopped" | "auth-required";
|
|
38
62
|
/** Structured log levels. */
|
|
39
63
|
export type LogLevel = "info" | "warn" | "error";
|
|
40
64
|
/** Configuration for a {@link LiveSyncClient}. */
|
|
@@ -124,6 +148,16 @@ export interface LiveSyncClientOptions {
|
|
|
124
148
|
onFrame?: (frame: ServerFrame) => void;
|
|
125
149
|
/** Optional: connection lifecycle, for UI ("live"/"reconnecting"/…). */
|
|
126
150
|
onStatus?: (status: LiveSyncStatus) => void;
|
|
151
|
+
/**
|
|
152
|
+
* Optional (CTC-2111): a typed authorization failure, BEARER strategy only. Fires when a bearer
|
|
153
|
+
* socket is closed 4401 (`AuthError{code:4401, reason}`) or a bearer /snapshot is rejected 401/403
|
|
154
|
+
* (initial seed or resync) — paired with the `"auth-required"` status, which is when the reconnect
|
|
155
|
+
* loop STOPS. A token/cookie 401/403 keeps reconnect-with-backoff and never reaches here (no refresh
|
|
156
|
+
* path, and nothing calls `resume()` on a daemon). A consumer re-authorizes the
|
|
157
|
+
* person (so its `getToken` will resolve a fresh token) and then calls `resume()` — which re-opens
|
|
158
|
+
* the transport reusing the original run, whereas a second `start()` would strand the first promise.
|
|
159
|
+
*/
|
|
160
|
+
onAuthError?: (err: AuthError) => void;
|
|
127
161
|
/** Base reconnect backoff in ms; doubles each failed attempt up to maxBackoffMs. Default 1000. */
|
|
128
162
|
backoffMs?: number;
|
|
129
163
|
/** Reconnect backoff ceiling in ms. Default 30_000. */
|
|
@@ -202,11 +236,6 @@ export interface LiveSyncClientOptions {
|
|
|
202
236
|
}
|
|
203
237
|
/** http(s)://host → ws(s)://host, leaving the rest of the origin + path intact (https→wss, http→ws). */
|
|
204
238
|
export declare function toWsOrigin(baseUrl: string): string;
|
|
205
|
-
/**
|
|
206
|
-
* Build the `/connect` URL with `?account=` and, for token auth, `?token=`. For cookie auth NO token
|
|
207
|
-
* is ever appended (the type system + this single construction point make a browser token leak
|
|
208
|
-
* impossible). Token is ordered FIRST so a truncated log line still reveals the account.
|
|
209
|
-
*/
|
|
210
239
|
/** Strip trailing "/" without a backtracking regex (ReDoS-safe vs `/\/+$/`, CodeQL js/polynomial-redos). */
|
|
211
240
|
export declare function stripTrailingSlashes(s: string): string;
|
|
212
241
|
export declare function buildConnectUrl(opts: {
|
|
@@ -214,6 +243,14 @@ export declare function buildConnectUrl(opts: {
|
|
|
214
243
|
connectPath: string;
|
|
215
244
|
accountId?: string;
|
|
216
245
|
auth: AuthStrategy;
|
|
246
|
+
/**
|
|
247
|
+
* CTC-2111 — the resolved bearer token for a `{kind:"bearer"}` auth. The URL is built
|
|
248
|
+
* synchronously, so the caller awaits `getToken()` first and injects the value here; it then rides
|
|
249
|
+
* `?token=` exactly as the `token` strategy's own value does. Ignored for `token`/`cookie` (their
|
|
250
|
+
* behaviour is byte-identical to before this parameter existed). Omitted for a bearer diagnostic
|
|
251
|
+
* `connectUrl()` call, which cannot resolve a token synchronously.
|
|
252
|
+
*/
|
|
253
|
+
bearerToken?: string;
|
|
217
254
|
/**
|
|
218
255
|
* CTC-628 — extra params the consumer wants on THIS connect, resolved at CALL time. A plain object
|
|
219
256
|
* would be read once at construction and then be a lie on every reconnect: the values these carry
|
|
@@ -233,6 +270,7 @@ export declare class LiveSyncClient {
|
|
|
233
270
|
private readonly onChange;
|
|
234
271
|
private readonly onFrame?;
|
|
235
272
|
private readonly onStatus?;
|
|
273
|
+
private readonly onAuthError?;
|
|
236
274
|
private readonly backoffMs;
|
|
237
275
|
private readonly maxBackoffMs;
|
|
238
276
|
private readonly pingIntervalMs;
|
|
@@ -278,6 +316,36 @@ export declare class LiveSyncClient {
|
|
|
278
316
|
*/
|
|
279
317
|
private bootFailed;
|
|
280
318
|
private resyncing;
|
|
319
|
+
/** CTC-2111 — parked in `"auth-required"` after a 4401 / a getToken rejection / a 401-403 seed. Only
|
|
320
|
+
* `resume()` (or a fresh `start()`) leaves this state; a normal reconnect never sets it. */
|
|
321
|
+
private authRequired;
|
|
322
|
+
/** CTC-2111 — an auth failure (401/403) interrupted a RESYNC before its /snapshot could rebuild the
|
|
323
|
+
* store. The cursor is then stale, so recovery must RE-SEED (not just re-open, which would return
|
|
324
|
+
* to `live` with the very inconsistency the resync existed to fix). Distinct from the cursorless
|
|
325
|
+
* initial-seed case, which `getCursor()` already detects. */
|
|
326
|
+
private resyncNeededAfterAuth;
|
|
327
|
+
/**
|
|
328
|
+
* CTC-2111 — a `resume()` intent awaiting drain. `resume()` from a parked run only RECORDS this (it
|
|
329
|
+
* does not re-drive or clear `authRequired` synchronously), because a synchronous `resume()` from
|
|
330
|
+
* `onAuthError` fires while the failing op (a boot or a resync) is still in flight. The single
|
|
331
|
+
* `drainRecovery()` point fires it once that owning op SETTLES — so a resume during a boot, during a
|
|
332
|
+
* resync, or between them is always captured and re-driven from the CURRENT store state, with no
|
|
333
|
+
* per-path deferral to get wrong and no path that clears the latch without starting recovery.
|
|
334
|
+
*/
|
|
335
|
+
private pendingRecovery;
|
|
336
|
+
/**
|
|
337
|
+
* CTC-2111 — THE single connect-generation guard. A bearer connect resolves getToken() asynchronously,
|
|
338
|
+
* so a late/stale resolution must be dropped rather than open an orphan socket. One counter, ONE check
|
|
339
|
+
* site (`supersededConnect`, in `resolveBearerAndConnect` — the only getToken-gated connect), bumped at
|
|
340
|
+
* the TWO choke points EVERY lifecycle transition funnels through:
|
|
341
|
+
* • `openSocket()` — every connect: initial, reconnect, and resume-reopen (so start → boot →
|
|
342
|
+
* openSocket, and a resume re-open, each stamp a new attempt);
|
|
343
|
+
* • `closeSocket()` — every deliberate teardown/reseed: stop, requestResync/runResync, forceReconnect,
|
|
344
|
+
* and resume-reseed (so entering a resync invalidates any pending connect — RwF).
|
|
345
|
+
* `stop()` also bumps directly, ahead of its closeSocket(), to close the stop()-then-start() window
|
|
346
|
+
* before the new run's openSocket() re-stamps.
|
|
347
|
+
*/
|
|
348
|
+
private connectAttempt;
|
|
281
349
|
private backoff;
|
|
282
350
|
private reconnectTimer;
|
|
283
351
|
private resolveDone;
|
|
@@ -340,6 +408,10 @@ export declare class LiveSyncClient {
|
|
|
340
408
|
* (It used to rely on "the boot seed runs before any socket exists" — true only while a resync
|
|
341
409
|
* needed a server frame. The public `requestResync()` added in 0.8.0 needs no socket.) */
|
|
342
410
|
private reseedTimer;
|
|
411
|
+
/** CTC-2111 — the in-flight bearer getToken() deadline (awaitTokenBounded). Tracked so stop() clears
|
|
412
|
+
* it (ask 4: teardown leaves NOTHING pending) rather than letting it hold a process alive for up to
|
|
413
|
+
* openTimeoutMs after an otherwise-clean shutdown. */
|
|
414
|
+
private bearerTokenTimer;
|
|
343
415
|
constructor(opts: LiveSyncClientOptions);
|
|
344
416
|
/**
|
|
345
417
|
* Start the client: seed first if the consumer has no cursor, then open the live socket and keep it
|
|
@@ -350,10 +422,44 @@ export declare class LiveSyncClient {
|
|
|
350
422
|
start(): Promise<void>;
|
|
351
423
|
/** Stop the client: close the socket, cancel any pending reconnect, resolve start(). Idempotent. */
|
|
352
424
|
stop(): void;
|
|
425
|
+
/**
|
|
426
|
+
* CTC-2111 — resume a run parked in `"auth-required"` (a 4401 close, a `getToken()` rejection, or a
|
|
427
|
+
* 401/403 initial /snapshot). The supported recovery after `onAuthError`: refresh whatever credential
|
|
428
|
+
* `getToken()` draws on, then call this. A bearer `getToken()` is resolved FRESH on the re-open, so
|
|
429
|
+
* the newly-authorized token is the one used.
|
|
430
|
+
*
|
|
431
|
+
* It REUSES the original run rather than starting a second one — calling `start()` again from a
|
|
432
|
+
* parked-but-still-pending run would overwrite `resolveDone` and strand the promise `start()` first
|
|
433
|
+
* returned (it would never settle). Progress surfaces through `onStatus` (connecting → live), the
|
|
434
|
+
* same way `start()` reports it.
|
|
435
|
+
*
|
|
436
|
+
* • Never started, or already stopped → this is a fresh `start()` (nothing to resume).
|
|
437
|
+
* • Not parked (a live/reconnecting run) → a no-op; there is nothing to resume.
|
|
438
|
+
* • Parked with a durable cursor (the 4401 mid-run case) → re-open the socket, reusing the deferred.
|
|
439
|
+
* • Parked with NO cursor (an initial-connect auth failure, whose `start()` already REJECTED) → a
|
|
440
|
+
* fresh `start()` re-runs the cold seed; its old promise already settled, so nothing is stranded.
|
|
441
|
+
*/
|
|
442
|
+
resume(): void;
|
|
443
|
+
/** CTC-2111 — is a boot or a resync currently the owner of the client's recovery state? While one is,
|
|
444
|
+
* a `resume()` intent waits for it to settle (that owner's settle calls `drainRecovery`). */
|
|
445
|
+
private hasInFlightRun;
|
|
446
|
+
/**
|
|
447
|
+
* CTC-2111 — THE single recovery drain. Called from `resume()` (when idle) and from the settle of
|
|
448
|
+
* every in-flight owner (the boot chain, `handleResync`'s finally). It re-drives a recorded
|
|
449
|
+
* `resume()` intent exactly once, from the CURRENT store state, and clears `authRequired` only when
|
|
450
|
+
* recovery actually starts — so no path clears the latch without starting recovery, and a resume()
|
|
451
|
+
* during a boot, during a resync, or between them is always captured and correctly re-driven.
|
|
452
|
+
*/
|
|
453
|
+
private drainRecovery;
|
|
353
454
|
/** The ws(s):// URL this client opens, for diagnostics/tests. Re-derived from the options — and,
|
|
354
455
|
* since CTC-628, re-RESOLVED: `connectParams` is invoked here, so every reconnect reports the
|
|
355
|
-
* consumer's CURRENT state rather than the state it had when the client was constructed.
|
|
456
|
+
* consumer's CURRENT state rather than the state it had when the client was constructed.
|
|
457
|
+
* For a bearer auth this omits `?token=` — the token is resolved asynchronously at connect time
|
|
458
|
+
* (see `connectUrlWith`), which a synchronous diagnostic accessor cannot do. */
|
|
356
459
|
connectUrl(): string;
|
|
460
|
+
/** The connect URL with a resolved bearer token injected (CTC-2111). Kept private and separate from
|
|
461
|
+
* the public sync `connectUrl()` so the token/cookie path stays byte-identical and same-tick. */
|
|
462
|
+
private connectUrlWith;
|
|
357
463
|
/**
|
|
358
464
|
* Invoke the consumer's `connectParams` callback, treating ANY failure as "nothing to report".
|
|
359
465
|
*
|
|
@@ -377,7 +483,37 @@ export declare class LiveSyncClient {
|
|
|
377
483
|
*/
|
|
378
484
|
private get tenantAttr();
|
|
379
485
|
private setStatus;
|
|
486
|
+
/** CTC-2111 — enter the parked `"auth-required"` state: no socket, no reconnect scheduled (the CALLER
|
|
487
|
+
* never schedules one), and `authRequired` latched so `resume()` knows there is a run to resume. */
|
|
488
|
+
private parkAuthRequired;
|
|
489
|
+
/** CTC-2111 — park in `"auth-required"` AND hand the consumer a typed `AuthError` (a wire code:
|
|
490
|
+
* 4401 close, or a 401/403 /snapshot). The onAuthError handler is guarded like onStatus — a throwing
|
|
491
|
+
* consumer callback never wedges the transport. */
|
|
492
|
+
private raiseAuthError;
|
|
493
|
+
/** CTC-2111 — await a bearer `getToken()` but never longer than the connect/open deadline, so a token
|
|
494
|
+
* endpoint that never settles cannot wedge the client in `"connecting"` with no timer pending (the
|
|
495
|
+
* `openTimeoutMs` deadline is armed LATER, inside `connect()`, only once the token is in hand). A
|
|
496
|
+
* disabled deadline (`openTimeoutMs <= 0`) leaves the acquisition unbounded — the caller's own
|
|
497
|
+
* choice to run without connect deadlines. The timer is local and self-clears on settle. */
|
|
498
|
+
private awaitTokenBounded;
|
|
380
499
|
private openSocket;
|
|
500
|
+
/**
|
|
501
|
+
* CTC-2111 — resolve a fresh bearer token (bounded by the connect deadline), then connect IFF this is
|
|
502
|
+
* still the current attempt. Three failure modes, each returning the state machine to an actionable
|
|
503
|
+
* state — never a busy loop, never a permanent wedge:
|
|
504
|
+
* • superseded (a newer attempt, a stop(), or a stop()+start() cycle) → drop the stale resolution;
|
|
505
|
+
* • `getToken()` timed out (never settled) → a bounded backoff reconnect (transient, retryable);
|
|
506
|
+
* • `getToken()` rejected → park in `"auth-required"` (re-auth needed) until `resume()`.
|
|
507
|
+
*/
|
|
508
|
+
private resolveBearerAndConnect;
|
|
509
|
+
/** CTC-2111 — the ONE connect-generation check: true if `attempt` is no longer the current connect
|
|
510
|
+
* (a stop, a start, a resync, a reconnect, a resume-reopen all bump `connectAttempt`), so a bearer
|
|
511
|
+
* getToken() resolving after any of those must be dropped rather than open an orphan socket. */
|
|
512
|
+
private supersededConnect;
|
|
513
|
+
/** Open a socket with the connect URL, given an already-resolved bearer token (undefined for
|
|
514
|
+
* token/cookie). Everything from the connect span onward — byte-identical to the pre-CTC-2111
|
|
515
|
+
* `openSocket` body, only the URL now carries a resolved bearer token when there is one. */
|
|
516
|
+
private connect;
|
|
381
517
|
/** End the in-flight connect span exactly once (idempotent — nulls the handle). */
|
|
382
518
|
private endConnectSpan;
|
|
383
519
|
/** Detach handlers BEFORE closing so a programmatic close can't re-enter scheduleReconnect. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live-sync-client.d.ts","sourceRoot":"","sources":["../src/live-sync-client.ts"],"names":[],"mappings":"AA+EA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"live-sync-client.d.ts","sourceRoot":"","sources":["../src/live-sync-client.ts"],"names":[],"mappings":"AA+EA,OAAO,KAAK,EACV,WAAW,EAIX,WAAW,EAEZ,MAAM,YAAY,CAAC;AAEpB,OAAO,EAUL,KAAK,SAAS,EACd,KAAK,eAAe,EAErB,MAAM,WAAW,CAAC;AAEnB;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IACvC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IACpD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IACxC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;CACzC;AAED,qGAAqG;AACrG,MAAM,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,aAAa,CAAC;AAE9D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAExD;;;;;;GAMG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