@warmhub/sdk-ts 0.66.0 → 0.68.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/dist/index.d.ts CHANGED
@@ -2,15 +2,6 @@ declare const COMMIT_OPERATIONS: readonly ["add", "revise", "retract", "rename"]
2
2
  type CommitOperation = (typeof COMMIT_OPERATIONS)[number];
3
3
  declare const COMMIT_OPERATION_KINDS: readonly ["shape", "thing", "assertion", "collection"];
4
4
  type CommitOperationKind = (typeof COMMIT_OPERATION_KINDS)[number];
5
- type CollectionAbout$2 = {
6
- pair: [string, string];
7
- } | {
8
- triple: [string, string, string];
9
- } | {
10
- set: string[];
11
- } | {
12
- list: string[];
13
- };
14
5
 
15
6
  /**
16
7
  * Canonical request signing for component CLI dispatch.
@@ -72,7 +63,7 @@ type CliHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
72
63
  *
73
64
  * Shape field types:
74
65
  * - "number", "string", "boolean": primitive types
75
- * - "wref": string (reference to another thing)
66
+ * - "wref": string (reference to a shape or shaped thing)
76
67
  * - Typed field objects: { type: primitive, description?: string }
77
68
  * - Nested objects: { fieldName: type, ... }
78
69
  * - Arrays: [elementType]
@@ -276,16 +267,7 @@ type AccessResolveResult$1 = {
276
267
  type AuthSyncResult = {
277
268
  success: boolean;
278
269
  };
279
- type CollectionAbout$1 = {
280
- pair: [string, string];
281
- } | {
282
- triple: [string, string, string];
283
- } | {
284
- set: Array<string>;
285
- } | {
286
- list: Array<string>;
287
- };
288
- type CollectionTag$1 = 'pair' | 'triple' | 'set' | 'list';
270
+ type CollectionTag$1 = 'pair' | 'set' | 'list';
289
271
  type CommitApplyResult = {
290
272
  committer?: string;
291
273
  createdByEmail?: string;
@@ -312,6 +294,85 @@ type CommitApplyResult = {
312
294
  };
313
295
  }>;
314
296
  };
297
+ type CollectionContainsResult$1 = {
298
+ type: 'pair' | 'set' | 'list' | 'triple';
299
+ wref: string;
300
+ version: number;
301
+ results: Array<{
302
+ member: string;
303
+ contains: boolean;
304
+ positions?: Array<number>;
305
+ }>;
306
+ };
307
+ type CollectionDiffResult$1 = {
308
+ type: 'pair' | 'set' | 'list' | 'triple';
309
+ leftWref: string;
310
+ rightWref: string;
311
+ leftVersion: number;
312
+ rightVersion: number;
313
+ mode: 'membership' | 'ordered';
314
+ added: Array<{
315
+ wref: string;
316
+ position?: number;
317
+ fieldPath: 'first' | 'second' | 'third' | 'members' | 'items';
318
+ }>;
319
+ removed: Array<{
320
+ wref: string;
321
+ position?: number;
322
+ fieldPath: 'first' | 'second' | 'third' | 'members' | 'items';
323
+ }>;
324
+ unchanged: Array<{
325
+ wref: string;
326
+ position?: number;
327
+ fieldPath: 'first' | 'second' | 'third' | 'members' | 'items';
328
+ }>;
329
+ changed: Array<{
330
+ position: number;
331
+ left?: {
332
+ wref: string;
333
+ position?: number;
334
+ fieldPath: 'first' | 'second' | 'third' | 'members' | 'items';
335
+ };
336
+ right?: {
337
+ wref: string;
338
+ position?: number;
339
+ fieldPath: 'first' | 'second' | 'third' | 'members' | 'items';
340
+ };
341
+ }>;
342
+ };
343
+ type CollectionMember$1 = {
344
+ wref: string;
345
+ position?: number;
346
+ fieldPath: 'first' | 'second' | 'third' | 'members' | 'items';
347
+ };
348
+ type CollectionMembersPage$1 = {
349
+ type: 'pair' | 'set' | 'list' | 'triple';
350
+ wref: string;
351
+ version: number;
352
+ items: Array<{
353
+ wref: string;
354
+ position?: number;
355
+ fieldPath: 'first' | 'second' | 'third' | 'members' | 'items';
356
+ }>;
357
+ nextCursor?: string;
358
+ };
359
+ type CollectionMutationResult$1 = {
360
+ type: 'pair' | 'set' | 'list';
361
+ wref: string;
362
+ version: number;
363
+ memberCount: number;
364
+ dataHash?: string;
365
+ operationCount: number;
366
+ status: 'created' | 'updated' | 'noop';
367
+ };
368
+ type CollectionStatsResult$1 = {
369
+ type: 'pair' | 'set' | 'list' | 'triple';
370
+ wref: string;
371
+ version: number;
372
+ memberCount: number;
373
+ uniqueMemberCount: number;
374
+ };
375
+ type CollectionType$1 = 'pair' | 'set' | 'list';
315
376
  type ComponentDetail = {
316
377
  ref?: string;
317
378
  componentName: string;
@@ -482,10 +543,7 @@ type StreamAppendInput$1 = {
482
543
  committer?: string;
483
544
  message?: string;
484
545
  allocatedTokens?: never;
485
- allocatedTokenRanges: Array<{
486
- start: number;
487
- end: number;
488
- }>;
546
+ allocatedTokenRanges: [];
489
547
  operations: Array<{
490
548
  operation: 'add';
491
549
  kind: 'shape';
@@ -502,22 +560,14 @@ type StreamAppendInput$1 = {
502
560
  operation: 'add';
503
561
  kind: 'assertion';
504
562
  name: string;
505
- about: string | {
506
- pair: [string, string];
507
- } | {
508
- triple: [string, string, string];
509
- } | {
510
- set: Array<string>;
511
- } | {
512
- list: Array<string>;
513
- };
563
+ about: string;
514
564
  data: unknown;
515
565
  skipExisting?: boolean;
516
566
  } | {
517
567
  operation: 'add';
518
568
  kind: 'collection';
519
- name?: string;
520
- type: 'pair' | 'triple' | 'set' | 'list';
569
+ name: string;
570
+ type: 'pair' | 'set' | 'list';
521
571
  members: Array<string>;
522
572
  skipExisting?: boolean;
523
573
  } | {
@@ -544,6 +594,14 @@ type StreamAppendInput$1 = {
544
594
  expectedVersion?: number;
545
595
  active?: never;
546
596
  leaseId?: string;
597
+ } | {
598
+ operation: 'revise';
599
+ kind: 'collection';
600
+ name: string;
601
+ type: 'pair' | 'set' | 'list';
602
+ members: Array<string>;
603
+ expectedVersion?: number;
604
+ leaseId?: string;
547
605
  } | {
548
606
  operation: 'retract';
549
607
  name: string;
@@ -558,10 +616,7 @@ type StreamAppendInput$1 = {
558
616
  }>;
559
617
  };
560
618
  type StreamAppendResult$1 = {
561
- allocatedTokenRanges: Array<{
562
- start: number;
563
- end: number;
564
- }>;
619
+ allocatedTokenRanges: [];
565
620
  results: Array<{
566
621
  opIndex?: number;
567
622
  name: string;
@@ -712,6 +767,17 @@ type ThingGetManyResult$1 = {
712
767
  validatedShape?: string;
713
768
  version: number;
714
769
  data?: unknown;
770
+ collection?: {
771
+ type: 'pair' | 'set' | 'list' | 'triple';
772
+ memberField: 'first/second' | 'first/second/third' | 'members' | 'items';
773
+ memberCount: number;
774
+ dataMode: 'full' | 'summary';
775
+ fullData: boolean;
776
+ truncated: boolean;
777
+ inlineLimit?: number;
778
+ preview?: Array<string>;
779
+ previewCount?: number;
780
+ };
715
781
  active: boolean;
716
782
  synthesized?: boolean;
717
783
  aboutWref?: string;
@@ -983,10 +1049,10 @@ interface AddOperation {
983
1049
  */
984
1050
  name?: string;
985
1051
  /**
986
- * Assertion target wref or inline collection descriptor. Presence of
1052
+ * Assertion target wref. Presence of
987
1053
  * `about` makes the add an assertion unless `kind` overrides it.
988
1054
  */
989
- about?: string | CollectionAbout$1;
1055
+ about?: string;
990
1056
  /**
991
1057
  * Shape-validated data payload for shape, thing, or assertion adds.
992
1058
  */
@@ -1039,6 +1105,14 @@ interface ReviseOperation {
1039
1105
  * New shape-validated data payload.
1040
1106
  */
1041
1107
  data?: unknown;
1108
+ /**
1109
+ * Collection type. Required when `kind` is `collection`.
1110
+ */
1111
+ type?: CollectionTag$1;
1112
+ /**
1113
+ * Collection member wrefs. Required when `kind` is `collection`.
1114
+ */
1115
+ members?: string[];
1042
1116
  /**
1043
1117
  * Optional optimistic-concurrency precondition. When supplied, the revise is
1044
1118
  * applied only if the target is still at this version number. A stale value
@@ -1283,7 +1357,7 @@ declare class AllStreamOperationsFailedError extends Error {
1283
1357
  * transport-ambiguous failure (timeout / 5xx / network reset / no-code
1284
1358
  * error) on the first chunk triggers a bounded retry — but only when
1285
1359
  * the first chunk contains exactly one operation. The SDK mints a
1286
- * fresh `streamId`, resets token continuation, sleeps with jittered
1360
+ * fresh `streamId`, sleeps with jittered
1287
1361
  * exponential backoff, and re-issues the same operation. The retried
1288
1362
  * call is observationally indistinguishable from a single clean
1289
1363
  * apply — the SDK does not rewrite the request or the response.
@@ -1291,17 +1365,13 @@ declare class AllStreamOperationsFailedError extends Error {
1291
1365
  * Multi-op chunks bypass retry entirely because the backend applies
1292
1366
  * operations one-at-a-time in their own transactions, so a mid-chunk
1293
1367
  * transport failure on attempt 1 may have committed an arbitrary
1294
- * prefix. Chunks that allocate or reference `$N`/`#N` tokens also
1295
- * bypass retry — the backend resolves those tokens against `streamId`,
1296
- * so re-issuing under a fresh `streamId` would commit a different
1297
- * identity than the first attempt may have landed. Multi-chunk
1298
- * mid-flight failures (`chunkResults.length > 0`) also bypass retry.
1299
- * All three surface `PartialStreamSubmissionError` exactly as before;
1368
+ * prefix. Multi-chunk mid-flight failures (`chunkResults.length > 0`)
1369
+ * also bypass retry. Both surface `PartialStreamSubmissionError` exactly as before;
1300
1370
  * the existing full-input rerun contract remains the recovery path.
1301
1371
  *
1302
1372
  * Definite client rejections (`UNAUTHENTICATED`, `VALIDATION_ERROR`,
1303
- * `CONFLICT`, `RATE_LIMITED`, `UNRESOLVED_TOKEN`, `ALREADY_RETRACTED`,
1304
- * …) on the first chunk still rethrow the raw cause unchanged — they
1373
+ * `CONFLICT`, `RATE_LIMITED`, `ALREADY_RETRACTED`, …) on the first chunk
1374
+ * still rethrow the raw cause unchanged — they
1305
1375
  * are not transient, and structured detail (e.g. `retryAfter` on
1306
1376
  * `RATE_LIMITED`) survives. If the caller's original attempt landed but
1307
1377
  * the response was lost, the retry surfaces the resulting `CONFLICT`
@@ -1339,10 +1409,8 @@ declare class AllStreamOperationsFailedError extends Error {
1339
1409
  * any subset of the defaults (`{ 3, 250, 8_000 }`).
1340
1410
  *
1341
1411
  * Retry is automatically suppressed when the caller supplies
1342
- * `args.streamId`. Re-minting a fresh `streamId` on retry would
1343
- * invalidate deterministic `$N`/`#N` token bindings, so caller-managed
1344
- * streams instead surface `PartialStreamSubmissionError` on append
1345
- * failure.
1412
+ * `args.streamId`, because caller-managed streams may coordinate retries
1413
+ * outside the SDK.
1346
1414
  *
1347
1415
  * The server remains stateless across `stream.append` calls — there is
1348
1416
  * no `streamId`-keyed dedup table. See docs/dev/commit-flow.md for the
@@ -1500,7 +1568,7 @@ interface BaseAddOp {
1500
1568
  /**
1501
1569
  * Assertion target wref. Presence of `about` makes the add an assertion unless `kind` overrides it.
1502
1570
  */
1503
- readonly about?: string | CollectionAbout$2;
1571
+ readonly about?: string;
1504
1572
  /**
1505
1573
  * Optional shape wref used by local validation.
1506
1574
  */
@@ -1529,8 +1597,7 @@ interface AddOp extends BaseAddOp {
1529
1597
  readonly name: string;
1530
1598
  }
1531
1599
  /**
1532
- * Builder collection add operation. Omitting `name` creates the backend's
1533
- * canonical auto-named collection from the supplied members.
1600
+ * Builder collection add operation. ADR 0004 requires an explicit name.
1534
1601
  * @see https://docs.warmhub.ai/sdk-reference/interfaces/collectionaddop/
1535
1602
  */
1536
1603
  interface CollectionAddOp {
@@ -1544,10 +1611,10 @@ interface CollectionAddOp {
1544
1611
  */
1545
1612
  readonly kind?: 'collection';
1546
1613
  /**
1547
- * Optional collection name. Omit to let the backend assign the canonical
1548
- * collection name from the supplied members.
1614
+ * Explicit collection name. ADR 0004 treats collections as ordinary named
1615
+ * things, so collection adds cannot be nameless.
1549
1616
  */
1550
- readonly name?: string;
1617
+ readonly name: string;
1551
1618
  /**
1552
1619
  * Collection type.
1553
1620
  */
@@ -1591,6 +1658,14 @@ interface ReviseOp {
1591
1658
  * New shape-validated data payload.
1592
1659
  */
1593
1660
  readonly data?: unknown;
1661
+ /**
1662
+ * Collection type. Required when `kind` is `collection`.
1663
+ */
1664
+ readonly type?: CollectionAddType;
1665
+ /**
1666
+ * Collection member wrefs. Required when `kind` is `collection`.
1667
+ */
1668
+ readonly members?: string[];
1594
1669
  /**
1595
1670
  * Optional optimistic-concurrency precondition. When supplied, the revise is
1596
1671
  * applied only if the target is still at this version number. A stale value
@@ -1826,8 +1901,6 @@ declare class OperationBuilder {
1826
1901
  private assertCanModify;
1827
1902
  }
1828
1903
 
1829
- /** @internal */
1830
- type CollectionAbout = CollectionAbout$1;
1831
1904
  /** @internal */
1832
1905
  type CollectionTag = CollectionTag$1;
1833
1906
  /** @internal */
@@ -1970,7 +2043,7 @@ type CoreErrorKind = 'BACKEND' | 'NOT_FOUND' | 'FORBIDDEN' | 'UNAUTHENTICATED' |
1970
2043
  * - `NETWORK` — cause: connection failed before the server produced a response (DNS, refused, timeout, fetch error); retryable: true; action: check connectivity to the configured `apiUrl` and retry with backoff; origin: SDK `fetchWithAuth` connection-error mapping
1971
2044
  *
1972
2045
  * Backend domain codes (e.g. `SHAPE_MISMATCH`, `WREF_UNRESOLVABLE`,
1973
- * `UNRESOLVED_TOKEN`, `ARCHIVED`, `INTERNAL_ERROR`) pass through unchanged on
2046
+ * `ARCHIVED`, `INTERNAL_ERROR`) pass through unchanged on
1974
2047
  * `code` / `kind`. Surface the `message` and `hint` verbatim and use the
1975
2048
  * message to decide whether to retry — most pass-through codes are terminal,
1976
2049
  * but the backend reuses some codes for transient failures (notably
@@ -1978,8 +2051,8 @@ type CoreErrorKind = 'BACKEND' | 'NOT_FOUND' | 'FORBIDDEN' | 'UNAUTHENTICATED' |
1978
2051
  * `please retry` message when DNS or HEAD probes flake). See the
1979
2052
  * [HTTP error catalog](/http-api/overview/#response-format)
1980
2053
  * for HTTP-status mapping and the most common backend codes (the catalog is
1981
- * not exhaustive — rarer codes such as `UNRESOLVED_TOKEN` and
1982
- * `WREF_UNRESOLVABLE` are emitted by the backend but not yet tabulated).
2054
+ * not exhaustive — rarer codes such as `WREF_UNRESOLVABLE` are emitted by the
2055
+ * backend but not yet tabulated).
1983
2056
  * @see https://docs.warmhub.ai/sdk-reference/type-aliases/errorkind/
1984
2057
  */
1985
2058
  type ErrorKind = CoreErrorKind | (string & {});
@@ -2065,11 +2138,12 @@ type SubscriptionCompatCreateCommon = {
2065
2138
  };
2066
2139
  /**
2067
2140
  * Input shape for `client.subscription.create`, discriminated on `eventType`
2068
- * (GH-4679):
2141
+ * (GH-4679, GH-6553):
2069
2142
  *
2070
2143
  * - default / `commit` — operation-based, repo-scoped (`repoName`); requires a
2071
2144
  * `filterJson` object and a shape binding (`shapeName` or `filterJson.shape`).
2072
- * - `repo.renamed` — repo-scoped metadata event; no shape/filter/source.
2145
+ * - `repo.renamed` / `thing.renamed` / `shape.renamed` — repo-scoped metadata
2146
+ * events; no shape/filter/source.
2073
2147
  * - `org.renamed` — org-scoped metadata event; no `repoName`/shape/filter/source.
2074
2148
  *
2075
2149
  * The metadata variants forbid the commit-only fields at the type level so
@@ -2084,7 +2158,7 @@ type SubscriptionCompatCreateInput = (SubscriptionCompatCreateCommon & {
2084
2158
  shapeName?: string;
2085
2159
  sourceRepoRef?: string;
2086
2160
  }) | (SubscriptionCompatCreateCommon & {
2087
- eventType: 'repo.renamed';
2161
+ eventType: 'repo.renamed' | 'thing.renamed' | 'shape.renamed';
2088
2162
  repoName: string;
2089
2163
  filterJson?: never;
2090
2164
  shapeName?: never;
@@ -2100,7 +2174,7 @@ type SubscriptionCompatCreateInput = (SubscriptionCompatCreateCommon & {
2100
2174
  * Input shape for `client.subscription.update`. `orgName` and `name` identify
2101
2175
  * the subscription; omit `repoName` to update an org-scoped (`org.renamed`)
2102
2176
  * subscription. All other fields are optional and only the ones you provide get
2103
- * patched. Rename subscriptions (`repo.renamed`/`org.renamed`) reject
2177
+ * patched. Metadata subscriptions (any `*.renamed`) reject
2104
2178
  * `shapeName`/`filterJson` — they have only delivery fields to edit.
2105
2179
  *
2106
2180
  * @see https://docs.warmhub.ai/subscriptions/managing/#update-subscription
@@ -2580,6 +2654,20 @@ type ThingMetadata = {
2580
2654
  revisedOn: number;
2581
2655
  };
2582
2656
  /** @internal */
2657
+ type CollectionReadDataMode = 'auto' | 'full';
2658
+ /** @internal */
2659
+ type CollectionReadSummary = {
2660
+ type: 'pair' | 'set' | 'list' | 'triple';
2661
+ memberField: 'first/second' | 'first/second/third' | 'members' | 'items';
2662
+ memberCount: number;
2663
+ dataMode: 'full' | 'summary';
2664
+ fullData: boolean;
2665
+ truncated: boolean;
2666
+ inlineLimit?: number;
2667
+ preview?: string[];
2668
+ previewCount?: number;
2669
+ };
2670
+ /** @internal */
2583
2671
  type ThingItem = {
2584
2672
  wref: string;
2585
2673
  name: string;
@@ -2645,6 +2733,7 @@ type ThingDetail = {
2645
2733
  version: number;
2646
2734
  active: boolean;
2647
2735
  data?: unknown;
2736
+ collection?: CollectionReadSummary;
2648
2737
  /** True on synthesized empty stubs from getReadme/getAgents when no row exists yet. */
2649
2738
  synthesized?: boolean;
2650
2739
  aboutWref?: string;
@@ -2792,6 +2881,7 @@ type ThingHistoryOptions = {
2792
2881
  /** @internal */
2793
2882
  type ThingGetOptions = {
2794
2883
  includeRetracted?: boolean;
2884
+ dataMode?: CollectionReadDataMode;
2795
2885
  };
2796
2886
  /** @internal */
2797
2887
  type ThingGraphOptions = {
@@ -2889,6 +2979,20 @@ type SearchResult = HeadResult;
2889
2979
  /** @internal */
2890
2980
  type RefsResult = RefsResult$1;
2891
2981
  /** @internal */
2982
+ type CollectionType = CollectionType$1;
2983
+ /** @internal */
2984
+ type CollectionMember = CollectionMember$1;
2985
+ /** @internal */
2986
+ type CollectionMembersPage = CollectionMembersPage$1;
2987
+ /** @internal */
2988
+ type CollectionContainsResult = CollectionContainsResult$1;
2989
+ /** @internal */
2990
+ type CollectionDiffResult = CollectionDiffResult$1;
2991
+ /** @internal */
2992
+ type CollectionMutationResult = CollectionMutationResult$1;
2993
+ /** @internal */
2994
+ type CollectionStatsResult = CollectionStatsResult$1;
2995
+ /** @internal */
2892
2996
  type ResolveWrefResult = ThingDetail;
2893
2997
  /** @internal */
2894
2998
  type ThingGetManyResult = ThingGetManyResult$1;
@@ -3026,6 +3130,61 @@ type RefsOptions = {
3026
3130
  cursor?: string;
3027
3131
  };
3028
3132
  /** @internal */
3133
+ type CollectionQuerySourceOptions = Pick<FilterOptions, 'shape' | 'kind' | 'about' | 'match' | 'componentRef' | 'excludeComponents' | 'where'>;
3134
+ type CollectionMemberSourceOptions = {
3135
+ members: string[];
3136
+ query?: CollectionQuerySourceOptions;
3137
+ sourceRepo?: never;
3138
+ } | {
3139
+ members?: never;
3140
+ query: CollectionQuerySourceOptions;
3141
+ sourceRepo: RepoLocator;
3142
+ } | {
3143
+ members?: string[];
3144
+ query: CollectionQuerySourceOptions;
3145
+ sourceRepo?: never;
3146
+ };
3147
+ /** @internal */
3148
+ type CollectionCreateOptions = {
3149
+ type: CollectionType;
3150
+ name: string;
3151
+ from?: string;
3152
+ add?: string[];
3153
+ remove?: string[];
3154
+ replaceMembers?: string[];
3155
+ skipExisting?: boolean;
3156
+ message?: string;
3157
+ committer?: string;
3158
+ } & CollectionMemberSourceOptions;
3159
+ /** @internal */
3160
+ type CollectionMembersOptions = {
3161
+ version?: number;
3162
+ limit?: number;
3163
+ cursor?: string;
3164
+ };
3165
+ /** @internal */
3166
+ type CollectionContainsOptions = {
3167
+ version?: number;
3168
+ position?: number;
3169
+ };
3170
+ /** @internal */
3171
+ type CollectionDiffOptions = {
3172
+ leftVersion?: number;
3173
+ rightVersion?: number;
3174
+ mode?: 'auto' | 'membership' | 'ordered';
3175
+ };
3176
+ /** @internal */
3177
+ type CollectionReviseOptions = {
3178
+ add?: string[];
3179
+ remove?: string[];
3180
+ message?: string;
3181
+ committer?: string;
3182
+ } & CollectionMemberSourceOptions;
3183
+ /** @internal */
3184
+ type CollectionStatsOptions = {
3185
+ version?: number;
3186
+ };
3187
+ /** @internal */
3029
3188
  type PingResult = {
3030
3189
  ok: boolean;
3031
3190
  error?: string;
@@ -3435,7 +3594,7 @@ declare class WarmHubClient {
3435
3594
  *
3436
3595
  * @param message Optional commit message stored with the submitted operations.
3437
3596
  * @param operations Add, revise, or retract operations to submit in order.
3438
- * @param opts.committer Optional wref identifying the actor on whose behalf the write is made. Must be a full wref string like `"Agent/bot-1"` (a thing that already exists), or a cross-repo wref like `"wh:other-org/other-repo/Agent/bot-1"`. Bare names such as `"eval-runner"` are rejected by the backend with a "Thing wref required" error — there is no implicit shape.
3597
+ * @param opts.committer Optional untyped wref identifying the actor on whose behalf the write is made. It may target an existing shape (`"Agent"`) or shaped thing (`"Agent/bot-1"`), locally or canonically (`"wh:other-org/other-repo/Agent"` or `"wh:other-org/other-repo/Agent/bot-1"`). A one-segment value is a shape wref, not a free-form label, and succeeds only when that shape exists. On success, `OperationSubmitResult.committer` echoes the supplied wref string; version reads expose the resolved target as `committerWref`.
3439
3598
  * @param opts.componentRef Attribute writes to an installed component, identified by its `Org/Name` ref, when the caller is allowed to claim it.
3440
3599
  * @param opts.chunkSize Maximum operations per stream append. Values are clamped by the SDK.
3441
3600
  * @param opts.skipExisting Return `noop` for add operations whose target already exists.
@@ -3985,6 +4144,18 @@ declare class WarmHubClient {
3985
4144
  */
3986
4145
  listNotifications: (orgName: string, repoName: string, opts?: ActionListNotificationsOptions) => Promise<ActionNotificationInfo[]>;
3987
4146
  };
4147
+ readonly collection: {
4148
+ create: (orgName: string, repoName: string, opts: CollectionCreateOptions) => Promise<CollectionMutationResult>;
4149
+ members: (orgName: string | undefined, repoName: string | undefined, wref: string, opts?: CollectionMembersOptions) => Promise<CollectionMembersPage>;
4150
+ membersIter: (orgName: string | undefined, repoName: string | undefined, wref: string, opts?: CollectionMembersOptions) => AsyncIterableIterator<CollectionMember>;
4151
+ membersAll: (orgName: string | undefined, repoName: string | undefined, wref: string, opts?: CollectionMembersOptions & {
4152
+ max?: number;
4153
+ }) => Promise<CollectionMember[]>;
4154
+ contains: (orgName: string | undefined, repoName: string | undefined, wref: string, members: string[], opts?: CollectionContainsOptions) => Promise<CollectionContainsResult>;
4155
+ diff: (orgName: string | undefined, repoName: string | undefined, leftWref: string, rightWref: string, opts?: CollectionDiffOptions) => Promise<CollectionDiffResult>;
4156
+ revise: (orgName: string, repoName: string, wref: string, opts: CollectionReviseOptions) => Promise<CollectionMutationResult>;
4157
+ stats: (orgName: string | undefined, repoName: string | undefined, wref: string, opts?: CollectionStatsOptions) => Promise<CollectionStatsResult>;
4158
+ };
3988
4159
  /**
3989
4160
  * Read surface for things, assertions, histories, references, search, and in-place thing renames.
3990
4161
  * @see https://docs.warmhub.ai/sdk-reference/classes/warmhubclient/#thing
@@ -4035,6 +4206,7 @@ declare class WarmHubClient {
4035
4206
  *
4036
4207
  * @param version Optional exact version to pin when the wref is not already version-qualified.
4037
4208
  * @param opts.includeRetracted Include retracted records instead of treating them as missing.
4209
+ * @param opts.dataMode Defaults to `auto`; pass `full` to force full collection bodies.
4038
4210
  */
4039
4211
  get: (orgName: string | undefined, repoName: string | undefined, wref: string, version?: number, opts?: ThingGetOptions) => Promise<ThingGet>;
4040
4212
  /**
@@ -4085,6 +4257,7 @@ declare class WarmHubClient {
4085
4257
  */
4086
4258
  getMany: (orgName: string | undefined, repoName: string | undefined, wrefs: string[], version?: number, opts?: {
4087
4259
  includeRetracted?: boolean;
4260
+ dataMode?: CollectionReadDataMode;
4088
4261
  chunkSize?: number;
4089
4262
  chunkConcurrency?: number;
4090
4263
  }) => Promise<ThingGetManyResult>;
@@ -4130,7 +4303,7 @@ declare class WarmHubClient {
4130
4303
  */
4131
4304
  resolve: (orgName: string | undefined, repoName: string | undefined, wref: string) => Promise<ResolveWrefResult>;
4132
4305
  /**
4133
- * Return assertions about a thing or collection target.
4306
+ * Return assertions about a shape, shaped thing, or collection target.
4134
4307
  *
4135
4308
  * Filter by assertion shape or glob `match` pattern, optionally resolve collection targets, and page through large assertion sets with `limit` and `cursor`.
4136
4309
  *
@@ -4154,7 +4327,7 @@ declare class WarmHubClient {
4154
4327
  */
4155
4328
  about: (orgName: string | undefined, repoName: string | undefined, wref: string, opts?: AboutOptions) => Promise<AboutResult>;
4156
4329
  /**
4157
- * Iterate every assertion about a thing or collection target.
4330
+ * Iterate every assertion about a shape, shaped thing, or collection target.
4158
4331
  *
4159
4332
  * Prefer this over hand-written cursor loops when scanning all matching assertions. The iterator reads the `assertions` envelope field and advances the cursor automatically; pass `opts.cursor` to resume from a saved cursor and `limit` to control page size.
4160
4333
  *
@@ -4166,7 +4339,7 @@ declare class WarmHubClient {
4166
4339
  */
4167
4340
  aboutIter: (orgName: string | undefined, repoName: string | undefined, wref: string, opts?: AboutOptions) => AsyncIterableIterator<Assertion>;
4168
4341
  /**
4169
- * Materialize every assertion about a thing or collection target.
4342
+ * Materialize every assertion about a shape, shaped thing, or collection target.
4170
4343
  *
4171
4344
  * Use `max` to guard memory usage; throws a `WarmHubError` with kind `VALIDATION_ERROR` once more than `max` assertions have actually been observed across pages.
4172
4345
  *
@@ -4368,7 +4541,7 @@ declare class WarmHubClient {
4368
4541
  /**
4369
4542
  * Append one non-empty chunk of stream operations to a repository.
4370
4543
  *
4371
- * Most callers should prefer `commit.apply` or `OperationBuilder`. Use this low-level surface only when you already have stream operations, a stream ID, and any allocated `$N` / `#N` token state you need to continue.
4544
+ * Most callers should prefer `commit.apply` or `OperationBuilder`. Use this low-level surface only when you already have backend-shaped stream operations and a caller-managed stream ID.
4372
4545
  */
4373
4546
  append: (input: StreamAppendInput$1) => Promise<StreamAppendResult$1>;
4374
4547
  };
@@ -4570,4 +4743,4 @@ declare class WarmHubClient {
4570
4743
  private watchRepoQuery;
4571
4744
  }
4572
4745
 
4573
- export { type AboutOptions, type AboutResult, type AccessResolveInput, type AccessResolveResult, type AccessTokenProvider, type ActionAttemptInfo, type ActionDeliveryTarget, type ActionLeaseAcquire, type ActionLeaseOp, type ActionListNotificationsOptions, type ActionListRunsOptions, type ActionLiveFeed, type ActionLiveFeedOptions, type ActionNotificationInfo, type ActionRunInfo, type ActionRunStatsInfo, type ActionRunStatsOptions, type AddOp, type AddOperation, AllStreamOperationsFailedError, type Assertion, CLI_INSTALL_REPO_HEADER, CLI_SIGNATURE_HEADER, CLI_TIMESTAMP_HEADER, CONTENT_FIELD_LIMIT_ERROR, type CliCallSecrets, CliCallVerificationError, type CliCallVerificationFailureReason, type CollectionAbout, type CollectionAddOp, type CollectionAddType, type CollectionTag, type ComponentHistory, type ComponentHistoryOptions, type ComponentInfo, type ComponentInstallResult, type ComponentList, type ComponentListOptions, type ComponentUninstallResult, type ComponentView, type CoreErrorKind, type CountOptions, type CountResult, type CredentialAuditEntry, type CredentialDeleteResult, type CredentialGrantResult, type CredentialInfo, type CredentialKeyMutationResult, type CredentialRevokeResult, type CredentialUngrantResult, type CurrentUserInfo, DEFAULT_API_URL, DEFAULT_STREAM_CHUNK_SIZE, type ErrorKind, type FilterOptions, type FilterResult, type FunctionLogMode, type GlobalSearchOptions, type GlobalSearchResult, type GlobalSearchResultItem, type HeadResult, type HistoryResult, type HomepageFeaturedListsResult, type IndexedFieldEntry, type IndexedFieldsReport, type LiveHandle, type LiveRepoEvent, type LiveSubscriptionLogOptions, type LiveThingHeadOptions, type LiveThingHistoryOptions, type LiveWatchResult, MAX_CONTENT_FIELD_BYTES, MAX_STREAM_APPEND_OPERATION_COUNT, type Operation, OperationBuilder, type OperationBuilderAddInput, type OperationBuilderClient, type OperationBuilderOp, type OperationBuilderOptions, type OperationSubmitResult, type OrgAccessResult, type OrgInfo, type OrgList, type OrgListMembersOptions, type OrgListOptions, type OrgMemberInfo, type OrgMemberList, type OrgRef, type OrgRole, type Page, type PageRequest, PartialStreamSubmissionError, type PingResult, type RefLink, type RefsOptions, type RefsResult, type RenameOperation, type RenameResult, type RepoAccessResult, type RepoConfigureStatsView, type RepoDescribeResult, type RepoExploreItem, type RepoExploreOptions, type RepoExploreResult, type RepoInfo, type RepoList, type RepoListForCallerOptions, type RepoListOptions, type RepoListPageOptions, type RepoListPageResult, type RepoLocator, type RepoRecentInfo, type RepoRef, type RepoShapeInstanceCountsView, type RepoSort, type RepoStatsBatchResult, type RepoStatsView, type RepoWithStatsInfo, type RequestEvent, type ResolveWrefResult, type RetractOp, type RetractOperation, type RetryPolicyOptions, type ReviseOp, type ReviseOperation, SDK_VERSION, type SearchOptions, type SearchResult, type Shape, type ShapeChange, type ShapeCreateOptions, type ShapeFields, type ShapeGetOptions, type ShapeHistory, type ShapeHistoryOptions, type ShapeList, type ShapeListOptions, type ShapeRef, type ShapeRemove, type ShapeReviseOptions, type ShapeValidatorResult, type StreamAppendInput, type StreamAppendResult, type StreamContinuationState, type SubscriptionBindCredentialsResult, type SubscriptionCompatCreateInput, type SubscriptionCompatUpdateInput, type SubscriptionInfo, type SubscriptionList, type SubscriptionUnbindCredentialsResult, type SynthesizedRepoContent, type ThingDetail, type ThingGet, type ThingGetManyResult, type ThingGetOptions, type ThingGetWithLease, type ThingGraphOptions, type ThingGraphResult, type ThingGraphValue, type ThingHead, type ThingHeadOptions, type ThingHeadRequest, type ThingHeadVersionsResult, type ThingHistory, type ThingHistoryOptions, type ThingItem, type ThingMetadata, type TokenInfo, type TokenResult, type UndeclaredFieldsWarning, type ValidationDiagnostic, type ValidationResult, type VerifiedCliCall, WarmHubClient, type WarmHubClientOptions, WarmHubError, type WarmHubErrorDetails, type WherePredicate, type WhoamiInfo, type WhoamiScopeEntry, type WireScopeEntry, connectionErrorMessage, contentFieldLimitError, countStreamAppendResultStatuses, isConnectionError, isRetryable, isWarmHubError, normalizeWref, resolveFunctionLogMode, sanitizeErrorMessage, sdkVersionIsBelowMinimum, streamAppendResultStatus, submitOperationsViaStream, toWarmHubError, validateAgainstShape, verifyCliCall };
4746
+ export { type AboutOptions, type AboutResult, type AccessResolveInput, type AccessResolveResult, type AccessTokenProvider, type ActionAttemptInfo, type ActionDeliveryTarget, type ActionLeaseAcquire, type ActionLeaseOp, type ActionListNotificationsOptions, type ActionListRunsOptions, type ActionLiveFeed, type ActionLiveFeedOptions, type ActionNotificationInfo, type ActionRunInfo, type ActionRunStatsInfo, type ActionRunStatsOptions, type AddOp, type AddOperation, AllStreamOperationsFailedError, type Assertion, CLI_INSTALL_REPO_HEADER, CLI_SIGNATURE_HEADER, CLI_TIMESTAMP_HEADER, CONTENT_FIELD_LIMIT_ERROR, type CliCallSecrets, CliCallVerificationError, type CliCallVerificationFailureReason, type CollectionAddOp, type CollectionAddType, type CollectionContainsOptions, type CollectionContainsResult, type CollectionCreateOptions, type CollectionDiffOptions, type CollectionDiffResult, type CollectionMember, type CollectionMembersOptions, type CollectionMembersPage, type CollectionMutationResult, type CollectionQuerySourceOptions, type CollectionReadDataMode, type CollectionReadSummary, type CollectionReviseOptions, type CollectionStatsOptions, type CollectionStatsResult, type CollectionTag, type CollectionType, type ComponentHistory, type ComponentHistoryOptions, type ComponentInfo, type ComponentInstallResult, type ComponentList, type ComponentListOptions, type ComponentUninstallResult, type ComponentView, type CoreErrorKind, type CountOptions, type CountResult, type CredentialAuditEntry, type CredentialDeleteResult, type CredentialGrantResult, type CredentialInfo, type CredentialKeyMutationResult, type CredentialRevokeResult, type CredentialUngrantResult, type CurrentUserInfo, DEFAULT_API_URL, DEFAULT_STREAM_CHUNK_SIZE, type ErrorKind, type FilterOptions, type FilterResult, type FunctionLogMode, type GlobalSearchOptions, type GlobalSearchResult, type GlobalSearchResultItem, type HeadResult, type HistoryResult, type HomepageFeaturedListsResult, type IndexedFieldEntry, type IndexedFieldsReport, type LiveHandle, type LiveRepoEvent, type LiveSubscriptionLogOptions, type LiveThingHeadOptions, type LiveThingHistoryOptions, type LiveWatchResult, MAX_CONTENT_FIELD_BYTES, MAX_STREAM_APPEND_OPERATION_COUNT, type Operation, OperationBuilder, type OperationBuilderAddInput, type OperationBuilderClient, type OperationBuilderOp, type OperationBuilderOptions, type OperationSubmitResult, type OrgAccessResult, type OrgInfo, type OrgList, type OrgListMembersOptions, type OrgListOptions, type OrgMemberInfo, type OrgMemberList, type OrgRef, type OrgRole, type Page, type PageRequest, PartialStreamSubmissionError, type PingResult, type RefLink, type RefsOptions, type RefsResult, type RenameOperation, type RenameResult, type RepoAccessResult, type RepoConfigureStatsView, type RepoDescribeResult, type RepoExploreItem, type RepoExploreOptions, type RepoExploreResult, type RepoInfo, type RepoList, type RepoListForCallerOptions, type RepoListOptions, type RepoListPageOptions, type RepoListPageResult, type RepoLocator, type RepoRecentInfo, type RepoRef, type RepoShapeInstanceCountsView, type RepoSort, type RepoStatsBatchResult, type RepoStatsView, type RepoWithStatsInfo, type RequestEvent, type ResolveWrefResult, type RetractOp, type RetractOperation, type RetryPolicyOptions, type ReviseOp, type ReviseOperation, SDK_VERSION, type SearchOptions, type SearchResult, type Shape, type ShapeChange, type ShapeCreateOptions, type ShapeFields, type ShapeGetOptions, type ShapeHistory, type ShapeHistoryOptions, type ShapeList, type ShapeListOptions, type ShapeRef, type ShapeRemove, type ShapeReviseOptions, type ShapeValidatorResult, type StreamAppendInput, type StreamAppendResult, type StreamContinuationState, type SubscriptionBindCredentialsResult, type SubscriptionCompatCreateInput, type SubscriptionCompatUpdateInput, type SubscriptionInfo, type SubscriptionList, type SubscriptionUnbindCredentialsResult, type SynthesizedRepoContent, type ThingDetail, type ThingGet, type ThingGetManyResult, type ThingGetOptions, type ThingGetWithLease, type ThingGraphOptions, type ThingGraphResult, type ThingGraphValue, type ThingHead, type ThingHeadOptions, type ThingHeadRequest, type ThingHeadVersionsResult, type ThingHistory, type ThingHistoryOptions, type ThingItem, type ThingMetadata, type TokenInfo, type TokenResult, type UndeclaredFieldsWarning, type ValidationDiagnostic, type ValidationResult, type VerifiedCliCall, WarmHubClient, type WarmHubClientOptions, WarmHubError, type WarmHubErrorDetails, type WherePredicate, type WhoamiInfo, type WhoamiScopeEntry, type WireScopeEntry, connectionErrorMessage, contentFieldLimitError, countStreamAppendResultStatuses, isConnectionError, isRetryable, isWarmHubError, normalizeWref, resolveFunctionLogMode, sanitizeErrorMessage, sdkVersionIsBelowMinimum, streamAppendResultStatus, submitOperationsViaStream, toWarmHubError, validateAgainstShape, verifyCliCall };
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { AllStreamOperationsFailedError, CLI_INSTALL_REPO_HEADER, CLI_SIGNATURE_HEADER, CLI_TIMESTAMP_HEADER, CONTENT_FIELD_LIMIT_ERROR, CliCallVerificationError, DEFAULT_API_URL, DEFAULT_STREAM_CHUNK_SIZE, MAX_CONTENT_FIELD_BYTES, MAX_STREAM_APPEND_OPERATION_COUNT, OperationBuilder, PartialStreamSubmissionError, SDK_VERSION, WarmHubClient, WarmHubError, connectionErrorMessage, contentFieldLimitError, countStreamAppendResultStatuses, isConnectionError, isRetryable, isWarmHubError, normalizeWref, resolveFunctionLogMode, sanitizeErrorMessage, sdkVersionIsBelowMinimum, streamAppendResultStatus, submitOperationsViaStream, toWarmHubError, validateAgainstShape, verifyCliCall } from './chunk-U5Z6ZS6A.js';
1
+ export { AllStreamOperationsFailedError, CLI_INSTALL_REPO_HEADER, CLI_SIGNATURE_HEADER, CLI_TIMESTAMP_HEADER, CONTENT_FIELD_LIMIT_ERROR, CliCallVerificationError, DEFAULT_API_URL, DEFAULT_STREAM_CHUNK_SIZE, MAX_CONTENT_FIELD_BYTES, MAX_STREAM_APPEND_OPERATION_COUNT, OperationBuilder, PartialStreamSubmissionError, SDK_VERSION, WarmHubClient, WarmHubError, connectionErrorMessage, contentFieldLimitError, countStreamAppendResultStatuses, isConnectionError, isRetryable, isWarmHubError, normalizeWref, resolveFunctionLogMode, sanitizeErrorMessage, sdkVersionIsBelowMinimum, streamAppendResultStatus, submitOperationsViaStream, toWarmHubError, validateAgainstShape, verifyCliCall } from './chunk-GNNCLRNC.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
package/dist/react.js CHANGED
@@ -1,5 +1,5 @@
1
- import { WarmHubClient } from './chunk-U5Z6ZS6A.js';
2
- export { DEFAULT_API_URL, SDK_VERSION, WarmHubClient, WarmHubError, toWarmHubError } from './chunk-U5Z6ZS6A.js';
1
+ import { WarmHubClient } from './chunk-GNNCLRNC.js';
2
+ export { DEFAULT_API_URL, SDK_VERSION, WarmHubClient, WarmHubError, toWarmHubError } from './chunk-GNNCLRNC.js';
3
3
  import { createContext, useMemo, useState, useEffect, useContext } from 'react';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warmhub/sdk-ts",
3
- "version": "0.66.0",
3
+ "version": "0.68.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "The TypeScript SDK for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",