@warmhub/sdk-ts 0.60.0 → 0.61.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
@@ -67,48 +67,6 @@ declare const CLI_TIMESTAMP_HEADER = "X-WarmHub-Timestamp";
67
67
  */
68
68
  type CliHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
69
69
 
70
- /**
71
- * Hardcoded meta-schema for validating shape definitions.
72
- * Shapes are NOT validated against a DB-stored shape — they validate against this constant.
73
- * This avoids the bootstrap chicken-and-egg problem.
74
- *
75
- * A valid shape definition is:
76
- * { fields: Record<string, TypeSpec>, description?: string }
77
- * where TypeSpec is one of:
78
- * - primitive string: "number", "string", "boolean", "wref", "array"
79
- * - optional primitive: "number?", "string?", "boolean?", "wref?", "array?"
80
- * - typed field object: { type: primitive, description?: string }
81
- * - array: [TypeSpec] (shorthand) or { type: "array", items: TypeSpec }
82
- * - nested object: { fieldName: TypeSpec, ... } (key may end with "?" for optional)
83
- *
84
- * The primitive vocabulary above is closed: any other type name (e.g. "text",
85
- * "integer", "json", "date") is rejected. See VALID_PRIMITIVE_TYPES in
86
- * ./shape-types.ts for the authoritative set.
87
- */
88
- /**
89
- * Maximum size, in bytes (UTF-8 encoded), allowed for a single content field value.
90
- * WarmHub is not a document store: values larger than this are rejected at validation.
91
- * Store large documents in S3, Box, Drive, or another document system and reference
92
- * them from WarmHub instead.
93
- * @see https://docs.warmhub.ai/sdk-reference/variables/max_content_field_bytes/
94
- */
95
- declare const MAX_CONTENT_FIELD_BYTES: number;
96
- /**
97
- * Human-readable explanation of the {@link MAX_CONTENT_FIELD_BYTES} limit, suitable for
98
- * appending to a field-specific validation error. States the byte cap and points callers
99
- * to an external document store for large payloads.
100
- * @see https://docs.warmhub.ai/sdk-reference/variables/content_field_limit_error/
101
- */
102
- declare const CONTENT_FIELD_LIMIT_ERROR: string;
103
- /**
104
- * Returns a validation error message if the given string exceeds
105
- * {@link MAX_CONTENT_FIELD_BYTES} when UTF-8 encoded, or `null` if it is within the limit.
106
- *
107
- * @param path - The field path, used to identify the offending field in the message.
108
- * @param value - The candidate field value to measure.
109
- * @see https://docs.warmhub.ai/sdk-reference/functions/contentfieldlimiterror/
110
- */
111
- declare function contentFieldLimitError(path: string, value: string): string | null;
112
70
  /**
113
71
  * Validate a data payload against shape field definitions.
114
72
  *
@@ -166,6 +124,54 @@ type ShapeValidatorResult = {
166
124
  warnings?: UndeclaredFieldsWarning;
167
125
  };
168
126
 
127
+ /**
128
+ * Hardcoded meta-schema for validating shape definitions.
129
+ * Shapes are NOT validated against a DB-stored shape — they validate against this constant.
130
+ * This avoids the bootstrap chicken-and-egg problem.
131
+ *
132
+ * A valid shape definition is:
133
+ * { fields: Record<string, TypeSpec>, description?: string }
134
+ * where TypeSpec is one of:
135
+ * - primitive string: "number", "string", "boolean", "wref", "array"
136
+ * - optional primitive: "number?", "string?", "boolean?", "wref?", "array?"
137
+ * - typed field object: { type: primitive, description?: string }
138
+ * - array: [TypeSpec] (shorthand) or { type: "array", items: TypeSpec }
139
+ * - nested object: { fieldName: TypeSpec, ... } (key may end with "?" for optional)
140
+ *
141
+ * The primitive vocabulary above is closed: any other type name (e.g. "text",
142
+ * "integer", "json", "date") is rejected. See VALID_PRIMITIVE_TYPES in
143
+ * ./shape-types.ts for the authoritative set.
144
+ * String `pattern` constraints use RE2 syntax and are evaluated with re2js so
145
+ * user-authored patterns run in linear time across backend, SDK, web, CLI, and
146
+ * worker-adjacent consumers. JavaScript-only constructs such as backreferences
147
+ * and lookarounds are rejected at shape-definition time.
148
+ */
149
+
150
+ /**
151
+ * Maximum size, in bytes (UTF-8 encoded), allowed for a single content field value.
152
+ * WarmHub is not a document store: values larger than this are rejected at validation.
153
+ * Store large documents in S3, Box, Drive, or another document system and reference
154
+ * them from WarmHub instead.
155
+ * @see https://docs.warmhub.ai/sdk-reference/variables/max_content_field_bytes/
156
+ */
157
+ declare const MAX_CONTENT_FIELD_BYTES: number;
158
+ /**
159
+ * Human-readable explanation of the {@link MAX_CONTENT_FIELD_BYTES} limit, suitable for
160
+ * appending to a field-specific validation error. States the byte cap and points callers
161
+ * to an external document store for large payloads.
162
+ * @see https://docs.warmhub.ai/sdk-reference/variables/content_field_limit_error/
163
+ */
164
+ declare const CONTENT_FIELD_LIMIT_ERROR: string;
165
+ /**
166
+ * Returns a validation error message if the given string exceeds
167
+ * {@link MAX_CONTENT_FIELD_BYTES} when UTF-8 encoded, or `null` if it is within the limit.
168
+ *
169
+ * @param path - The field path, used to identify the offending field in the message.
170
+ * @param value - The candidate field value to measure.
171
+ * @see https://docs.warmhub.ai/sdk-reference/functions/contentfieldlimiterror/
172
+ */
173
+ declare function contentFieldLimitError(path: string, value: string): string | null;
174
+
169
175
  type ActionAttempt = {
170
176
  attempt: number;
171
177
  status: string;
@@ -1096,10 +1102,6 @@ type SubmittedStreamResult = {
1096
1102
  warnings?: NonNullable<StreamAppendResult$1['results'][number]['warnings']>;
1097
1103
  }>;
1098
1104
  };
1099
- /** @internal */
1100
- declare function streamAppendResultStatus(result: StreamAppendResult$1['results'][number]): NonNullable<SubmittedStreamResult['operations'][number]['status']>;
1101
- /** @internal */
1102
- declare function countStreamAppendResultStatuses(results: StreamAppendResult$1['results']): NonNullable<SubmittedStreamResult['statusCounts']>;
1103
1105
  /**
1104
1106
  * Continuation state for caller-managed streamed commit submissions.
1105
1107
  * @see https://docs.warmhub.ai/sdk-reference/type-aliases/streamcontinuationstate/
@@ -1173,6 +1175,7 @@ declare class AllStreamOperationsFailedError extends Error {
1173
1175
  readonly cause?: StreamFailureCause;
1174
1176
  constructor(result: SubmittedStreamResult);
1175
1177
  }
1178
+
1176
1179
  /**
1177
1180
  * Submit `operations` to the WarmHub stream-append surface, chunked to
1178
1181
  * stay under MAX_STREAM_APPEND_OPERATION_COUNT.
@@ -1268,6 +1271,15 @@ declare function submitOperationsViaStream(client: OperationStreamClient, args:
1268
1271
  retry?: RetryPolicyOptions | false;
1269
1272
  }): Promise<SubmittedStreamResult>;
1270
1273
 
1274
+ /**
1275
+ * Exposed for unit tests and internal callers to avoid re-deriving status values.
1276
+ *
1277
+ * @internal
1278
+ */
1279
+ declare function streamAppendResultStatus(result: StreamAppendResult$1['results'][number]): NonNullable<SubmittedStreamResult['operations'][number]['status']>;
1280
+ /** @internal */
1281
+ declare function countStreamAppendResultStatuses(results: StreamAppendResult$1['results']): NonNullable<SubmittedStreamResult['statusCounts']>;
1282
+
1271
1283
  /**
1272
1284
  * Server-side verifier for component CLI dispatch calls.
1273
1285
  *
@@ -1286,7 +1298,8 @@ declare function submitOperationsViaStream(client: OperationStreamClient, args:
1286
1298
  *
1287
1299
  * Multiple schemes can be configured at once; in that case the verifier
1288
1300
  * requires ALL of them to validate (downgrade-attack defense — an attacker
1289
- * who learns only one credential can't drop the other from the request).
1301
+ * who learns only one credential can't drop the other from the request). Bearer
1302
+ * and Basic both use `Authorization`, so they cannot be configured together.
1290
1303
  * If none are configured, the call is rejected as misconfigured.
1291
1304
  *
1292
1305
  * import { verifyCliCall } from '@warmhub/sdk-ts'
@@ -1372,34 +1385,23 @@ declare function verifyCliCall(request: Request, secrets: CliCallSecrets, opts?:
1372
1385
  type ShapeFields = Record<string, unknown>;
1373
1386
 
1374
1387
  /**
1375
- * Builder add operation for shapes, things, assertions, and collections.
1376
- * @see https://docs.warmhub.ai/sdk-reference/interfaces/addop/
1388
+ * @see https://docs.warmhub.ai/sdk-reference/type-aliases/collectionaddtype/
1377
1389
  */
1378
- interface AddOp {
1390
+ type CollectionAddType = CollectionTag$1;
1391
+ type NonCollectionAddKind = Exclude<CommitOperationKind, 'collection'>;
1392
+ interface BaseAddOp {
1379
1393
  /**
1380
1394
  * Operation discriminator. Always `add`.
1381
1395
  */
1382
1396
  readonly operation: 'add';
1383
1397
  /**
1384
- * Target name. Use `Shape/localName` for things and assertions; use the plain shape name for shapes.
1385
- */
1386
- readonly name: string;
1387
- /**
1388
- * Optional kind override: `shape`, `thing`, `assertion`, or `collection`.
1398
+ * Optional kind override: `shape`, `thing`, or `assertion`.
1389
1399
  */
1390
- readonly kind?: string;
1400
+ readonly kind?: NonCollectionAddKind;
1391
1401
  /**
1392
- * Assertion target wref or inline collection descriptor. Presence of `about` makes the add an assertion unless `kind` overrides it.
1402
+ * Assertion target wref. Presence of `about` makes the add an assertion unless `kind` overrides it.
1393
1403
  */
1394
1404
  readonly about?: string | CollectionAbout$2;
1395
- /**
1396
- * Collection type. Used only for collection adds.
1397
- */
1398
- readonly type?: string;
1399
- /**
1400
- * Collection member wrefs. Used only for collection adds.
1401
- */
1402
- readonly members?: string[];
1403
1405
  /**
1404
1406
  * Optional shape wref used by local validation.
1405
1407
  */
@@ -1417,6 +1419,54 @@ interface AddOp {
1417
1419
  */
1418
1420
  readonly skipExisting?: boolean;
1419
1421
  }
1422
+ /**
1423
+ * Builder add operation for shapes, things, and assertions.
1424
+ * @see https://docs.warmhub.ai/sdk-reference/interfaces/addop/
1425
+ */
1426
+ interface AddOp extends BaseAddOp {
1427
+ /**
1428
+ * Target name. Use `Shape/localName` for things and assertions; use the plain shape name for shapes.
1429
+ */
1430
+ readonly name: string;
1431
+ }
1432
+ /**
1433
+ * Builder collection add operation. Omitting `name` creates the backend's
1434
+ * canonical auto-named collection from the supplied members.
1435
+ * @see https://docs.warmhub.ai/sdk-reference/interfaces/collectionaddop/
1436
+ */
1437
+ interface CollectionAddOp {
1438
+ /**
1439
+ * Operation discriminator. Always `add`.
1440
+ */
1441
+ readonly operation: 'add';
1442
+ /**
1443
+ * Optional kind override. Collection add inputs may omit this when `type` and
1444
+ * `members` are present.
1445
+ */
1446
+ readonly kind?: 'collection';
1447
+ /**
1448
+ * Optional collection name. Omit to let the backend assign the canonical
1449
+ * collection name from the supplied members.
1450
+ */
1451
+ readonly name?: string;
1452
+ /**
1453
+ * Collection type.
1454
+ */
1455
+ readonly type: CollectionAddType;
1456
+ /**
1457
+ * Collection member wrefs.
1458
+ */
1459
+ readonly members: string[];
1460
+ /**
1461
+ * When true, an existing target returns `noop` instead of failing.
1462
+ */
1463
+ readonly skipExisting?: boolean;
1464
+ }
1465
+ /**
1466
+ * Input accepted by `OperationBuilder.add`.
1467
+ * @see https://docs.warmhub.ai/sdk-reference/type-aliases/operationbuilderaddinput/
1468
+ */
1469
+ type OperationBuilderAddInput = Omit<AddOp, 'operation'> | AddOp | Omit<CollectionAddOp, 'operation'> | CollectionAddOp;
1420
1470
  /**
1421
1471
  * Builder revise operation.
1422
1472
  * @see https://docs.warmhub.ai/sdk-reference/interfaces/reviseop/
@@ -1490,7 +1540,7 @@ interface RetractOp {
1490
1540
  * Operation queued by `OperationBuilder`.
1491
1541
  * @see https://docs.warmhub.ai/sdk-reference/type-aliases/operationbuilderop/
1492
1542
  */
1493
- type OperationBuilderOp = AddOp | ReviseOp | RetractOp;
1543
+ type OperationBuilderOp = AddOp | CollectionAddOp | ReviseOp | RetractOp;
1494
1544
  type OperationSubmitResult$1 = SubmittedStreamResult;
1495
1545
  /**
1496
1546
  * Client-side validation diagnostic returned by `OperationBuilder.validate`.
@@ -1540,7 +1590,7 @@ interface OperationBuilderOptions {
1540
1590
  }
1541
1591
  /** @internal */
1542
1592
  type OperationBuilderClient = OperationStreamClient;
1543
- type AddInput = Omit<AddOp, 'operation'> | AddOp;
1593
+
1544
1594
  type ReviseInput = Omit<ReviseOp, 'operation'> | ReviseOp;
1545
1595
  /**
1546
1596
  * Fluent builder for composing, validating, and submitting WarmHub commit
@@ -1587,7 +1637,7 @@ declare class OperationBuilder {
1587
1637
  * Set `kind: 'thing'` explicitly for hierarchical thing names that would otherwise look like assertion paths.
1588
1638
  * @see https://docs.warmhub.ai/sdk-reference/classes/operationbuilder/#add
1589
1639
  */
1590
- add(op: AddInput): this;
1640
+ add(op: OperationBuilderAddInput): this;
1591
1641
  /**
1592
1642
  * Add a revise operation.
1593
1643
  *
@@ -1725,6 +1775,18 @@ interface WarmHubClientOptions {
1725
1775
  * Control replay of backend function log lines. Defaults to `off`.
1726
1776
  */
1727
1777
  functionLogs?: FunctionLogMode;
1778
+ /**
1779
+ * Self-identification sent on the `X-WarmHub-Client` header (`name/version`)
1780
+ * for backend observability + read-analytics surface attribution. Defaults to
1781
+ * `@warmhub/sdk-ts/<SDK_VERSION>`. A wrapper such as the WarmHub CLI overrides
1782
+ * `name` (and usually `version`) to identify itself instead. An untrusted
1783
+ * hint — never an authz signal. A per-request `X-WarmHub-Client` header on a
1784
+ * raw request still wins over this default.
1785
+ */
1786
+ client?: {
1787
+ name?: string;
1788
+ version?: string;
1789
+ };
1728
1790
  }
1729
1791
  /**
1730
1792
  * Version string for the installed SDK package.
@@ -1801,7 +1863,7 @@ type CoreErrorKind = 'BACKEND' | 'NOT_FOUND' | 'FORBIDDEN' | 'UNAUTHENTICATED' |
1801
1863
  * - `NOT_FOUND` — cause: a referenced entity (repo, org, thing, shape, subscription, credential set, etc.) is missing or the caller cannot see it; retryable: false; action: verify the identifier the call site used (wref, slug, name) and escalate to a caller with read access if the entity should exist; origin: SDK reads across all surfaces, commit pipeline, REST query endpoints
1802
1864
  * - `FORBIDDEN` — cause: caller is authenticated but lacks the required permission; retryable: false; action: request the missing permission or use a token with broader scope; origin: SDK + REST authorization middleware
1803
1865
  * - `UNAUTHENTICATED` — cause: missing, expired, or invalid bearer token on a tRPC or REST call; retryable: false; action: mint a fresh PAT and update whichever client option the application wires it into (`auth.getToken` callback or `accessToken` — the SDK does not read `WH_TOKEN` or any env var directly); `wh auth login` only refreshes the CLI's on-disk credentials and does not propagate to a constructed SDK client; for export tickets, remint via the appropriate backend endpoint; origin: SDK + REST auth middleware. Live-ticket SSE auth failures surface as `BACKEND`, not `UNAUTHENTICATED`, because `openSse` maps every non-OK SSE response to `BACKEND`.
1804
- * - `VALIDATION_ERROR` — cause: input failed schema, shape, or content-length validation; retryable: false; action: fix the offending field per the error message; origin: commit pipeline, SDK writes, client-side content limits
1866
+ * - `VALIDATION_ERROR` — cause: input failed schema, shape, content-length, or read-pagination cursor validation; retryable: false; action: fix the offending field per the error message, or restart the read without a stale/non-advancing cursor; origin: commit pipeline, SDK writes, SDK read pagination helpers, client-side content limits
1805
1867
  * - `CONFLICT` — cause: write collides with current state (concurrent edit, name already in use); retryable: false; action: refetch the current state and reconcile before retrying the write; origin: commit pipeline, repo/org creation. Archived org / repo writes surface as the pass-through code `ARCHIVED`, not `CONFLICT`.
1806
1868
  * - `RATE_LIMITED` — cause: caller exceeded the per-token or per-org request budget; retryable: true; action: wait {@link WarmHubError.retryAfter} seconds before retrying; origin: REST + tRPC throttling
1807
1869
  * - `CANCELLED` — cause: caller aborted the request via `AbortSignal`; retryable: true; action: retry only if the caller still wants the result; origin: SDK `AbortError` mapping
@@ -3004,6 +3066,8 @@ declare class WarmHubClient {
3004
3066
  readonly apiUrl: string;
3005
3067
  private readonly fetchImpl;
3006
3068
  private readonly accessToken;
3069
+ /** Resolved `X-WarmHub-Client` identity; defaults to this SDK's name/version. */
3070
+ private readonly clientIdentity;
3007
3071
  protected readonly functionLogMode: FunctionLogMode;
3008
3072
  protected readonly getToken?: () => Promise<string | undefined>;
3009
3073
  private readonly trpc;
@@ -3433,12 +3497,6 @@ declare class WarmHubClient {
3433
3497
  delete: (orgName: string, repoName: string) => Promise<{
3434
3498
  graceExpiresAt: Date;
3435
3499
  }>;
3436
- /**
3437
- * Immediately and irreversibly purge a repository.
3438
- *
3439
- * This owner-only operation has no grace window and uses the same inbound-reference guard as `delete`.
3440
- */
3441
- hardDelete: (orgName: string, repoName: string) => Promise<void>;
3442
3500
  /**
3443
3501
  * List repositories with dashboard-oriented per-repository metadata.
3444
3502
  *
@@ -4304,10 +4362,15 @@ declare class WarmHubClient {
4304
4362
  listNotifications: (orgName: string, repoName: string, opts?: ActionListNotificationsOptions) => Promise<ActionNotificationInfo[]>;
4305
4363
  };
4306
4364
  private openSse;
4365
+ /**
4366
+ * Stamp the `X-WarmHub-Client` self-identification header, unless the caller
4367
+ * already set it on the request (a per-request header wins over the default).
4368
+ */
4369
+ private applyClientHeader;
4307
4370
  private fetchWithAuth;
4308
4371
  private requestResponse;
4309
4372
  private requestJson;
4310
4373
  private watchRepoQuery;
4311
4374
  }
4312
4375
 
4313
- export { type AboutOptions, type AboutResult, type AccessResolveInput, type AccessResolveResult, type AccessTokenProvider, type ActionAttemptInfo, 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 CollectionTag, 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 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 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 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 };
4376
+ export { type AboutOptions, type AboutResult, type AccessResolveInput, type AccessResolveResult, type AccessTokenProvider, type ActionAttemptInfo, 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 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 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 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-E4ZCBSQZ.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-QS6ABKPJ.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
package/dist/react.d.ts CHANGED
@@ -12,13 +12,23 @@ interface WarmHubProviderProps {
12
12
  isLoading: boolean;
13
13
  getAccessToken: () => Promise<string | null>;
14
14
  };
15
+ /**
16
+ * Self-identification forwarded to the `X-WarmHub-Client` header. First-party
17
+ * apps set `name` (e.g. `warmhub-web`) so backend observability can tell them
18
+ * apart from raw SDK consumers; an omitted `version` falls through to the SDK
19
+ * version. See `WarmHubClientOptions.client`.
20
+ */
21
+ client?: {
22
+ name?: string;
23
+ version?: string;
24
+ };
15
25
  }
16
26
  interface WarmHubAuthState {
17
27
  isAuthenticated: boolean;
18
28
  isLoading: boolean;
19
29
  }
20
30
  /** @internal */
21
- declare function WarmHubProvider({ apiUrl, children, auth, }: WarmHubProviderProps): react_jsx_runtime.JSX.Element;
31
+ declare function WarmHubProvider({ apiUrl, children, auth, client: clientIdentity, }: WarmHubProviderProps): react_jsx_runtime.JSX.Element;
22
32
  /** @internal */
23
33
  declare function useWarmHubClient(): WarmHubClient;
24
34
  /** @internal */
package/dist/react.js CHANGED
@@ -1,5 +1,5 @@
1
- import { WarmHubClient } from './chunk-E4ZCBSQZ.js';
2
- export { DEFAULT_API_URL, SDK_VERSION, WarmHubClient, WarmHubError, toWarmHubError } from './chunk-E4ZCBSQZ.js';
1
+ import { WarmHubClient } from './chunk-QS6ABKPJ.js';
2
+ export { DEFAULT_API_URL, SDK_VERSION, WarmHubClient, WarmHubError, toWarmHubError } from './chunk-QS6ABKPJ.js';
3
3
  import { createContext, useMemo, useState, useEffect, useContext } from 'react';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
@@ -11,17 +11,21 @@ var AuthContext = createContext({
11
11
  function WarmHubProvider({
12
12
  apiUrl,
13
13
  children,
14
- auth
14
+ auth,
15
+ client: clientIdentity
15
16
  }) {
17
+ const clientName = clientIdentity?.name;
18
+ const clientVersion = clientIdentity?.version;
16
19
  const client = useMemo(
17
20
  () => new WarmHubClient({
18
21
  apiUrl,
19
22
  accessToken: async () => {
20
23
  const token = await auth.getAccessToken();
21
24
  return token ?? void 0;
22
- }
25
+ },
26
+ client: { name: clientName, version: clientVersion }
23
27
  }),
24
- [apiUrl, auth.getAccessToken]
28
+ [apiUrl, auth.getAccessToken, clientName, clientVersion]
25
29
  );
26
30
  return /* @__PURE__ */ jsx(ClientContext.Provider, { value: client, children: /* @__PURE__ */ jsx(AuthSyncGate, { auth, client, children }) });
27
31
  }
package/d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package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warmhub/sdk-ts",
3
- "version": "0.60.0",
3
+ "version": "0.61.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.",
@@ -86,13 +86,13 @@
86
86
  "@trpc/client": "11.17.0"
87
87
  },
88
88
  "devDependencies": {
89
- "@vitest/coverage-v8": "4.1.5",
90
- "@types/react": "19.2.14",
89
+ "@vitest/coverage-v8": "catalog:",
90
+ "@types/react": "catalog:",
91
91
  "react": "19.2.6",
92
92
  "tsup": "8.5.1",
93
93
  "typedoc": "0.28.19",
94
94
  "typedoc-plugin-markdown": "4.11.0",
95
- "typescript": "5.9.3",
96
- "vitest": "4.1.5"
95
+ "typescript": "catalog:",
96
+ "vitest": "catalog:"
97
97
  }
98
98
  }