@warmhub/sdk-ts 0.59.0 → 0.60.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
@@ -1,4 +1,4 @@
1
- declare const COMMIT_OPERATIONS: readonly ["add", "revise", "retract"];
1
+ 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];
@@ -286,7 +286,7 @@ type CommitApplyResult = {
286
286
  operations: Array<{
287
287
  opIndex?: number;
288
288
  name: string;
289
- operation: 'add' | 'revise' | 'retract' | 'noop';
289
+ operation: 'add' | 'revise' | 'retract' | 'rename' | 'noop';
290
290
  version: number;
291
291
  dataHash: string;
292
292
  status?: 'applied' | 'noop';
@@ -324,11 +324,11 @@ type ComponentDetail = {
324
324
  synthesized?: boolean;
325
325
  aboutWref?: string;
326
326
  committerWref?: string;
327
- createdByWref?: string;
327
+ revisedBy?: string;
328
328
  metadata?: {
329
329
  durableId: string;
330
- thingCreatedAt: number;
331
- versionCreatedAt: number;
330
+ createdOn: number;
331
+ revisedOn: number;
332
332
  };
333
333
  };
334
334
  ownedShapes: Array<{
@@ -356,8 +356,8 @@ type ComponentDetail = {
356
356
  aboutWref?: string;
357
357
  metadata?: {
358
358
  durableId: string;
359
- thingCreatedAt: number;
360
- versionCreatedAt: number;
359
+ createdOn: number;
360
+ revisedOn: number;
361
361
  };
362
362
  }>;
363
363
  };
@@ -504,6 +504,11 @@ type StreamAppendInput$1 = {
504
504
  kind?: 'shape' | 'thing' | 'assertion' | 'collection';
505
505
  reason?: string;
506
506
  leaseId?: string;
507
+ } | {
508
+ operation: 'rename';
509
+ name: string;
510
+ newName: string;
511
+ kind?: 'shape' | 'thing' | 'assertion' | 'collection';
507
512
  }>;
508
513
  };
509
514
  type StreamAppendResult$1 = {
@@ -514,7 +519,7 @@ type StreamAppendResult$1 = {
514
519
  results: Array<{
515
520
  opIndex?: number;
516
521
  name: string;
517
- operation?: 'add' | 'revise' | 'retract' | 'noop';
522
+ operation?: 'add' | 'revise' | 'retract' | 'rename' | 'noop';
518
523
  version?: number;
519
524
  dataHash?: string;
520
525
  status?: 'success' | 'noop' | 'failed';
@@ -648,11 +653,11 @@ type ThingGetManyResult$1 = {
648
653
  synthesized?: boolean;
649
654
  aboutWref?: string;
650
655
  committerWref?: string;
651
- createdByWref?: string;
656
+ revisedBy?: string;
652
657
  metadata?: {
653
658
  durableId: string;
654
- thingCreatedAt: number;
655
- versionCreatedAt: number;
659
+ createdOn: number;
660
+ revisedOn: number;
656
661
  };
657
662
  }>;
658
663
  missing: Array<string>;
@@ -664,7 +669,7 @@ type ThingHeadVersionsResult$1 = {
664
669
  durableId: string;
665
670
  version: number;
666
671
  active: boolean;
667
- versionCreatedAt: number;
672
+ revisedOn: number;
668
673
  }>;
669
674
  missing: Array<string>;
670
675
  };
@@ -795,6 +800,13 @@ type ShapeChangeResult = {
795
800
  version: number;
796
801
  dataHash: string;
797
802
  };
803
+ type ShapeRemoveResult = {
804
+ name: string;
805
+ operation: 'add' | 'revise' | 'retract' | 'noop';
806
+ version: number;
807
+ dataHash: string;
808
+ removed: true;
809
+ };
798
810
  type SubscriptionBindCredentialsResult$1 = {
799
811
  bound: true;
800
812
  subscriptionName: string;
@@ -972,10 +984,37 @@ interface RetractOperation {
972
984
  */
973
985
  leaseId?: string;
974
986
  }
987
+ /**
988
+ * Rename operation accepted by `client.commit.apply` (#4848). Rewrites a thing's
989
+ * or shape's name in place — a version-less metadata op that records a from→to
990
+ * event but mints no new body version.
991
+ *
992
+ * @see https://docs.warmhub.ai/writes/operations/#rename-operations
993
+ */
994
+ interface RenameOperation {
995
+ /**
996
+ * Operation discriminator. Required.
997
+ */
998
+ operation: 'rename';
999
+ /**
1000
+ * Current target: `Shape/oldName` for a thing/assertion, or the plain shape
1001
+ * name for a shape.
1002
+ */
1003
+ name: string;
1004
+ /**
1005
+ * New bare name — within the same shape for a thing/assertion, or the new
1006
+ * shape name for a shape rename.
1007
+ */
1008
+ newName: string;
1009
+ /**
1010
+ * Optional kind safety hint: `thing`, `assertion`, `shape`, or `collection`.
1011
+ */
1012
+ kind?: CommitOperationKind;
1013
+ }
975
1014
  /**
976
1015
  * Commit operation accepted by `client.commit.apply`. Discriminated union over
977
- * {@link AddOperation}, {@link ReviseOperation}, and {@link RetractOperation},
978
- * keyed on `operation`.
1016
+ * {@link AddOperation}, {@link ReviseOperation}, {@link RetractOperation}, and
1017
+ * {@link RenameOperation}, keyed on `operation`.
979
1018
  *
980
1019
  * Inline array literals passed directly to `client.commit.apply` are
981
1020
  * contextually typed by the parameter, so `operation: "add"` stays narrowed
@@ -1003,7 +1042,7 @@ interface RetractOperation {
1003
1042
  *
1004
1043
  * @see https://docs.warmhub.ai/sdk/write-methods/#typing-operation-arrays
1005
1044
  */
1006
- type Operation = AddOperation | ReviseOperation | RetractOperation;
1045
+ type Operation = AddOperation | ReviseOperation | RetractOperation | RenameOperation;
1007
1046
 
1008
1047
  /**
1009
1048
  * Default number of operations the SDK sends per stream append chunk.
@@ -1017,7 +1056,7 @@ declare const DEFAULT_STREAM_CHUNK_SIZE = 1000;
1017
1056
  * @internal
1018
1057
  */
1019
1058
  declare const MAX_STREAM_APPEND_OPERATION_COUNT = 10000;
1020
- type CommitResultOperation$1 = CommitOperation | 'noop';
1059
+ type CommitResultOperation = CommitOperation | 'noop';
1021
1060
  interface OperationStreamClient {
1022
1061
  stream: {
1023
1062
  append(input: StreamAppendInput$1): Promise<StreamAppendResult$1>;
@@ -1037,7 +1076,7 @@ type SubmittedStreamResult = {
1037
1076
  operations: Array<{
1038
1077
  opIndex?: number;
1039
1078
  name: string;
1040
- operation: CommitResultOperation$1;
1079
+ operation: CommitResultOperation;
1041
1080
  dataHash: string;
1042
1081
  version: number;
1043
1082
  status?: 'applied' | 'noop' | 'error';
@@ -1793,14 +1832,13 @@ type ShapeChange = ShapeChangeResult;
1793
1832
  type Shape = ShapeGetResult;
1794
1833
  /** @internal */
1795
1834
  type ShapeList = ShapeListResult;
1796
- type CommitResultOperation = CommitOperation | 'noop';
1797
1835
  /**
1798
1836
  * Result of `client.shape.remove` — confirms the retraction with the new version metadata.
1799
1837
  * @internal
1800
1838
  */
1801
1839
  type ShapeRemove = {
1802
1840
  name: string;
1803
- operation: CommitResultOperation;
1841
+ operation: ShapeRemoveResult['operation'];
1804
1842
  version: number;
1805
1843
  dataHash: string;
1806
1844
  removed: true;
@@ -2309,10 +2347,10 @@ type RepoLocator = {
2309
2347
  * Stable identity and creation timestamps embedded on every thing-like read
2310
2348
  * result. `durableId` is a self-routing, self-verifying token (Crockford base32
2311
2349
  * over `repo_id + things.id + CRC-32C`) that remains identical before and after
2312
- * rename and across revise/retract. `thingCreatedAt` records the thing's birth
2313
- * date (stable across all mutations); `versionCreatedAt` is the timestamp of
2350
+ * rename and across revise/retract. `createdOn` records the thing's birth
2351
+ * date (stable across all mutations); `revisedOn` is the timestamp of
2314
2352
  * the current version (advances on each revise). History rows carry only
2315
- * `durableId` and `thingCreatedAt` — omit `versionCreatedAt`.
2353
+ * `durableId` and `createdOn` — omit `revisedOn`.
2316
2354
  *
2317
2355
  * Pass a bare `durableId` (optionally with `@vN`) wherever a wref is accepted
2318
2356
  * on read surfaces; `orgName`/`repoName` may be omitted for self-routing reads.
@@ -2321,8 +2359,8 @@ type RepoLocator = {
2321
2359
  */
2322
2360
  type ThingMetadata = {
2323
2361
  durableId: string;
2324
- thingCreatedAt: number;
2325
- versionCreatedAt: number;
2362
+ createdOn: number;
2363
+ revisedOn: number;
2326
2364
  };
2327
2365
  /** @internal */
2328
2366
  type ThingItem = {
@@ -2394,7 +2432,8 @@ type ThingDetail = {
2394
2432
  synthesized?: boolean;
2395
2433
  aboutWref?: string;
2396
2434
  committerWref?: string;
2397
- createdByWref?: string;
2435
+ /** #4848 Phase C: current-version author (renamed from createdByWref). */
2436
+ revisedBy?: string;
2398
2437
  metadata?: ThingMetadata;
2399
2438
  [key: string]: unknown;
2400
2439
  };
@@ -2439,8 +2478,9 @@ type HistoryResult = {
2439
2478
  shapeName?: string;
2440
2479
  data?: unknown;
2441
2480
  committerWref?: string;
2442
- createdByWref?: string;
2443
- metadata?: Pick<ThingMetadata, 'durableId' | 'thingCreatedAt'>;
2481
+ /** #4848 Phase C: per-version author (renamed from createdByWref). */
2482
+ revisedBy?: string;
2483
+ metadata?: Pick<ThingMetadata, 'durableId' | 'createdOn'>;
2444
2484
  [key: string]: unknown;
2445
2485
  }>;
2446
2486
  nextCursor?: string;
@@ -3795,7 +3835,7 @@ declare class WarmHubClient {
3795
3835
  }) => Promise<ThingGetManyResult>;
3796
3836
  /**
3797
3837
  * Batched lightweight per-thing change probe — returns
3798
- * `{ wref, durableId, version, active, versionCreatedAt }` per wref with NO
3838
+ * `{ wref, durableId, version, active, revisedOn }` per wref with NO
3799
3839
  * payload. Use it to check whether locally-cached copies are still fresh
3800
3840
  * without pulling `data`: a value is stale if `durableId` differs (the wref
3801
3841
  * now points to a different thing), `version`/`active` differ (the same
@@ -4270,4 +4310,4 @@ declare class WarmHubClient {
4270
4310
  private watchRepoQuery;
4271
4311
  }
4272
4312
 
4273
- 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 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 };
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 };
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-ZXAWTFKV.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-E4ZCBSQZ.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-ZXAWTFKV.js';
2
- export { DEFAULT_API_URL, SDK_VERSION, WarmHubClient, WarmHubError, toWarmHubError } from './chunk-ZXAWTFKV.js';
1
+ import { WarmHubClient } from './chunk-E4ZCBSQZ.js';
2
+ export { DEFAULT_API_URL, SDK_VERSION, WarmHubClient, WarmHubError, toWarmHubError } from './chunk-E4ZCBSQZ.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.59.0",
3
+ "version": "0.60.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.",