@warmhub/sdk-ts 0.53.0 → 0.55.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.
@@ -3652,7 +3652,7 @@ function validateWarmHubClientOptions(options) {
3652
3652
  throw new TypeError(`Unknown WarmHubClient option "${key}"${hint}`);
3653
3653
  }
3654
3654
  }
3655
- var SDK_VERSION = "0.53.0" ;
3655
+ var SDK_VERSION = "0.55.0" ;
3656
3656
  var DEFAULT_API_URL = "https://api.warmhub.ai";
3657
3657
  var UNBATCHED_TRPC_PATHS = /* @__PURE__ */ new Set([
3658
3658
  "repo.shapeInstanceCounts",
@@ -4111,6 +4111,12 @@ var WarmHubClient = class _WarmHubClient {
4111
4111
  * List components installed in a repository.
4112
4112
  *
4113
4113
  * Pass pagination options when a repository may have many installed components.
4114
+ *
4115
+ * Cursor contract: cursors are short-lived resume tokens for the same query
4116
+ * and result scope. If filters, visibility, or backing streams change, the
4117
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
4118
+ * cursor`; restart the query without `cursor` instead of retrying the stale
4119
+ * token.
4114
4120
  */
4115
4121
  list: async (orgName, repoName, opts) => {
4116
4122
  try {
@@ -4124,6 +4130,22 @@ var WarmHubClient = class _WarmHubClient {
4124
4130
  throw toWarmHubError(error);
4125
4131
  }
4126
4132
  },
4133
+ /**
4134
+ * Search public registered components across all orgs (GH-4383).
4135
+ * Public-only at launch. Distinct from listing components installed in a
4136
+ * repo (`component.list`).
4137
+ */
4138
+ search: async (query, opts) => {
4139
+ try {
4140
+ return await this.trpc.component.search.query({
4141
+ query,
4142
+ limit: opts?.limit,
4143
+ cursor: opts?.cursor
4144
+ });
4145
+ } catch (error) {
4146
+ throw toWarmHubError(error);
4147
+ }
4148
+ },
4127
4149
  /**
4128
4150
  * Fetch one installed component by its `Org/Name` ref.
4129
4151
  */
@@ -4138,6 +4160,57 @@ var WarmHubClient = class _WarmHubClient {
4138
4160
  throw toWarmHubError(error);
4139
4161
  }
4140
4162
  },
4163
+ /**
4164
+ * Install a registered component into a repository (GH-4610).
4165
+ *
4166
+ * Backend-driven: the server resolves the registration and its latest
4167
+ * published manifest, reconciles the shapes/subscriptions/credentials/seeds
4168
+ * into the target repo, and runs the component's optional setup callback —
4169
+ * the same pipeline `wh component install <org/name>` drives. `orgName` /
4170
+ * `repoName` identify the INSTALL repo; `componentRef` is the
4171
+ * `<org>/<name>` of the component to install. Requires `things:write` on the
4172
+ * install repo; private registrations require owner-org membership.
4173
+ *
4174
+ * Reinstall is idempotent: the install identity (`installId`) is reused so
4175
+ * runtime tokens keyed on it survive teardown/reinstall.
4176
+ */
4177
+ install: async (orgName, repoName, componentRef) => {
4178
+ try {
4179
+ return await this.trpc.component.install.mutate({
4180
+ orgName,
4181
+ repoName,
4182
+ componentRef
4183
+ });
4184
+ } catch (error) {
4185
+ throw toWarmHubError(error);
4186
+ }
4187
+ },
4188
+ /**
4189
+ * Uninstall a registered component from a repository (GH-4677).
4190
+ *
4191
+ * Backend-driven terminal teardown — the sibling of {@link install}: the
4192
+ * server pauses the install's subscriptions per the manifest teardown
4193
+ * policy, revokes its tokens in place, dispatches the component's optional
4194
+ * uninstall callback, and marks the repo-local `ComponentInstall` record
4195
+ * `uninstalled`. The same pipeline `wh component teardown <org/name>` drives.
4196
+ * `orgName` / `repoName` identify the INSTALL repo; `componentRef` is the
4197
+ * `<org>/<name>` of the component. Requires `things:write` on the install
4198
+ * repo; private registrations require owner-org membership.
4199
+ *
4200
+ * Non-destructive: manifest shapes and seeded data are left intact (only
4201
+ * repo deletion removes those) and reinstall revives the install.
4202
+ */
4203
+ uninstall: async (orgName, repoName, componentRef) => {
4204
+ try {
4205
+ return await this.trpc.component.uninstall.mutate({
4206
+ orgName,
4207
+ repoName,
4208
+ componentRef
4209
+ });
4210
+ } catch (error) {
4211
+ throw toWarmHubError(error);
4212
+ }
4213
+ },
4141
4214
  /**
4142
4215
  * Registered-component identity and install-pipeline operations.
4143
4216
  *
@@ -4622,6 +4695,12 @@ var WarmHubClient = class _WarmHubClient {
4622
4695
  * List repositories in an organization.
4623
4696
  *
4624
4697
  * Archived repositories are hidden by default. Search and sort options are applied before pagination.
4698
+ *
4699
+ * Cursor contract: cursors are short-lived resume tokens for the same query
4700
+ * and result scope. If filters, visibility, or backing streams change, the
4701
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
4702
+ * cursor`; restart the query without `cursor` instead of retrying the stale
4703
+ * token.
4625
4704
  */
4626
4705
  list: async (orgName, opts) => {
4627
4706
  try {
@@ -4637,6 +4716,21 @@ var WarmHubClient = class _WarmHubClient {
4637
4716
  throw toWarmHubError(error);
4638
4717
  }
4639
4718
  },
4719
+ /**
4720
+ * Search public repos across all orgs (GH-4383). Public-only at launch;
4721
+ * BM25 over name/description/shape vocabulary/README.
4722
+ */
4723
+ search: async (query, opts) => {
4724
+ try {
4725
+ return await this.trpc.repo.search.query({
4726
+ query,
4727
+ limit: opts?.limit,
4728
+ cursor: opts?.cursor
4729
+ });
4730
+ } catch (error) {
4731
+ throw toWarmHubError(error);
4732
+ }
4733
+ },
4640
4734
  /**
4641
4735
  * Create a repository inside an organization.
4642
4736
  *
@@ -4795,6 +4889,12 @@ var WarmHubClient = class _WarmHubClient {
4795
4889
  * Each item includes exact active counts, an activity-oriented `lastWriteAt`, and a `hasErrors` flag for terminal action failures.
4796
4890
  *
4797
4891
  * Search and sort are applied before pagination, so cursors remain stable across the filtered and ordered list.
4892
+ *
4893
+ * Cursor contract: cursors are short-lived resume tokens for the same query
4894
+ * and result scope. If filters, visibility, or backing streams change, the
4895
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
4896
+ * cursor`; restart the query without `cursor` instead of retrying the stale
4897
+ * token.
4798
4898
  */
4799
4899
  listPage: async (orgName, opts) => {
4800
4900
  try {
@@ -5077,6 +5177,12 @@ var WarmHubClient = class _WarmHubClient {
5077
5177
  * Return add, revise, retract, and rename history for a shape.
5078
5178
  *
5079
5179
  * Use pagination options for long-lived shapes with many revisions.
5180
+ *
5181
+ * Cursor contract: cursors are short-lived resume tokens for the same query
5182
+ * and result scope. If filters, visibility, or backing streams change, the
5183
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
5184
+ * cursor`; restart the query without `cursor` instead of retrying the stale
5185
+ * token.
5080
5186
  */
5081
5187
  history: async (orgName, repoName, name, opts = {}) => {
5082
5188
  try {
@@ -5343,6 +5449,12 @@ var WarmHubClient = class _WarmHubClient {
5343
5449
  * Query the live delivery feed for a subscription.
5344
5450
  *
5345
5451
  * Use this for polling or live-log views that need recent delivery status entries.
5452
+ *
5453
+ * Cursor contract: cursors are short-lived resume tokens for the same query
5454
+ * and result scope. If filters, visibility, or backing streams change, the
5455
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
5456
+ * cursor`; restart the query without `cursor` instead of retrying the stale
5457
+ * token.
5346
5458
  */
5347
5459
  liveFeed: async (orgName, repoName, subscriptionName, opts) => {
5348
5460
  try {
@@ -5436,6 +5548,12 @@ var WarmHubClient = class _WarmHubClient {
5436
5548
  * Filter by shape, kind, assertion target, or glob `match` pattern, and choose the data mode appropriate for the payload size. Component filters can narrow results to component-owned records or hide component infrastructure records.
5437
5549
  *
5438
5550
  * Tokenless reads of public repositories have stricter page-size and page-count limits than authenticated reads.
5551
+ *
5552
+ * Cursor contract: cursors are short-lived resume tokens for the same query
5553
+ * and result scope. If filters, visibility, or backing streams change, the
5554
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
5555
+ * cursor`; restart the query without `cursor` instead of retrying the stale
5556
+ * token.
5439
5557
  */
5440
5558
  head: async (orgName, repoName, opts) => {
5441
5559
  try {
@@ -5463,6 +5581,12 @@ var WarmHubClient = class _WarmHubClient {
5463
5581
  * Iterate every current HEAD row matching the supplied filters.
5464
5582
  *
5465
5583
  * Prefer this over hand-written cursor loops when scanning all matching records. Pass `opts.cursor` to resume from a saved cursor; the iterator advances the cursor automatically after the first request. Pass `limit` to control page size.
5584
+ *
5585
+ * Cursor contract: cursors are short-lived resume tokens for the same query
5586
+ * and result scope. If filters, visibility, or backing streams change, the
5587
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
5588
+ * cursor`; restart the query without `cursor` instead of retrying the stale
5589
+ * token.
5466
5590
  */
5467
5591
  headIter: (orgName, repoName, opts) => {
5468
5592
  return paginate(
@@ -5475,6 +5599,12 @@ var WarmHubClient = class _WarmHubClient {
5475
5599
  * Materialize every current HEAD row matching the supplied filters.
5476
5600
  *
5477
5601
  * Use `max` to guard memory usage; throws a `WarmHubError` with kind `VALIDATION_ERROR` once more than `max` items have actually been observed across pages.
5602
+ *
5603
+ * Cursor contract: cursors are short-lived resume tokens for the same query
5604
+ * and result scope. If filters, visibility, or backing streams change, the
5605
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
5606
+ * cursor`; restart the query without `cursor` instead of retrying the stale
5607
+ * token.
5478
5608
  */
5479
5609
  headAll: async (orgName, repoName, opts) => {
5480
5610
  const { max, ...pageOpts } = opts ?? {};
@@ -5690,6 +5820,12 @@ var WarmHubClient = class _WarmHubClient {
5690
5820
  * Return version history and timeline metadata for repository records.
5691
5821
  *
5692
5822
  * Provide at least one selector: a concrete wref, a shape filter, or an assertion target. Shape- and target-filtered histories support pagination and optional collection resolution.
5823
+ *
5824
+ * Cursor contract: cursors are short-lived resume tokens for the same query
5825
+ * and result scope. If filters, visibility, or backing streams change, the
5826
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
5827
+ * cursor`; restart the query without `cursor` instead of retrying the stale
5828
+ * token.
5693
5829
  */
5694
5830
  history: async (orgName, repoName, opts) => {
5695
5831
  try {
@@ -5746,6 +5882,12 @@ var WarmHubClient = class _WarmHubClient {
5746
5882
  *
5747
5883
  * Filter by assertion shape or glob `match` pattern, optionally resolve collection targets, and page through large assertion sets with `limit` and `cursor`.
5748
5884
  *
5885
+ * Cursor contract: cursors are short-lived resume tokens for the same query
5886
+ * and result scope. If filters, visibility, or backing streams change, the
5887
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
5888
+ * cursor`; restart the query without `cursor` instead of retrying the stale
5889
+ * token.
5890
+ *
5749
5891
  * Returns `{ target?, assertions, nextCursor? }`.
5750
5892
  * The array is named `assertions`, **not** `items`. This breaks the repo-wide
5751
5893
  * `items` convention used by `HeadResult`, `FilterResult`, `SearchResult`,
@@ -5781,6 +5923,12 @@ var WarmHubClient = class _WarmHubClient {
5781
5923
  * Iterate every assertion about a thing or collection target.
5782
5924
  *
5783
5925
  * 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.
5926
+ *
5927
+ * Cursor contract: cursors are short-lived resume tokens for the same query
5928
+ * and result scope. If filters, visibility, or backing streams change, the
5929
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
5930
+ * cursor`; restart the query without `cursor` instead of retrying the stale
5931
+ * token.
5784
5932
  */
5785
5933
  aboutIter: (orgName, repoName, wref, opts) => {
5786
5934
  return paginate(
@@ -5793,6 +5941,12 @@ var WarmHubClient = class _WarmHubClient {
5793
5941
  * Materialize every assertion about a thing or collection target.
5794
5942
  *
5795
5943
  * Use `max` to guard memory usage; throws a `WarmHubError` with kind `VALIDATION_ERROR` once more than `max` assertions have actually been observed across pages.
5944
+ *
5945
+ * Cursor contract: cursors are short-lived resume tokens for the same query
5946
+ * and result scope. If filters, visibility, or backing streams change, the
5947
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
5948
+ * cursor`; restart the query without `cursor` instead of retrying the stale
5949
+ * token.
5796
5950
  */
5797
5951
  aboutAll: async (orgName, repoName, wref, opts) => {
5798
5952
  const { max, ...pageOpts } = opts ?? {};
@@ -5807,6 +5961,12 @@ var WarmHubClient = class _WarmHubClient {
5807
5961
  * Query repository records by shape, kind, assertion target, text filters, or glob `match` pattern.
5808
5962
  *
5809
5963
  * Use this for structured reads where the caller controls filters. For ranked text or vector search, use `thing.search`. For count-only reads, use `thing.count`.
5964
+ *
5965
+ * Cursor contract: cursors are short-lived resume tokens for the same query
5966
+ * and result scope. If filters, visibility, or backing streams change, the
5967
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
5968
+ * cursor`; restart the query without `cursor` instead of retrying the stale
5969
+ * token.
5810
5970
  */
5811
5971
  query: async (orgName, repoName, opts) => {
5812
5972
  try {
@@ -5835,6 +5995,12 @@ var WarmHubClient = class _WarmHubClient {
5835
5995
  * Iterate every repository record matching the supplied filters.
5836
5996
  *
5837
5997
  * Prefer this over hand-written cursor loops when scanning all matching records. Pass `opts.cursor` to resume from a saved cursor; the iterator advances the cursor automatically after the first request. Pass `limit` to control page size.
5998
+ *
5999
+ * Cursor contract: cursors are short-lived resume tokens for the same query
6000
+ * and result scope. If filters, visibility, or backing streams change, the
6001
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
6002
+ * cursor`; restart the query without `cursor` instead of retrying the stale
6003
+ * token.
5838
6004
  */
5839
6005
  queryIter: (orgName, repoName, opts) => {
5840
6006
  return paginate(
@@ -5847,6 +6013,12 @@ var WarmHubClient = class _WarmHubClient {
5847
6013
  * Materialize every repository record matching the supplied filters.
5848
6014
  *
5849
6015
  * Use `max` to guard memory usage; throws a `WarmHubError` with kind `VALIDATION_ERROR` once more than `max` items have actually been observed across pages.
6016
+ *
6017
+ * Cursor contract: cursors are short-lived resume tokens for the same query
6018
+ * and result scope. If filters, visibility, or backing streams change, the
6019
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
6020
+ * cursor`; restart the query without `cursor` instead of retrying the stale
6021
+ * token.
5850
6022
  */
5851
6023
  queryAll: async (orgName, repoName, opts) => {
5852
6024
  const { max, ...pageOpts } = opts ?? {};
@@ -5861,6 +6033,12 @@ var WarmHubClient = class _WarmHubClient {
5861
6033
  * Search repository records with text, vector, or hybrid mode.
5862
6034
  *
5863
6035
  * When searching with an assertion target or collection resolution, pages may be sparse; keep paginating until `nextCursor` is absent.
6036
+ *
6037
+ * Cursor contract: cursors are short-lived resume tokens for the same query
6038
+ * and result scope. If filters, visibility, or backing streams change, the
6039
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
6040
+ * cursor`; restart the query without `cursor` instead of retrying the stale
6041
+ * token.
5864
6042
  */
5865
6043
  search: async (orgName, repoName, query, opts) => {
5866
6044
  try {
@@ -5914,6 +6092,12 @@ var WarmHubClient = class _WarmHubClient {
5914
6092
  * Query wref-typed field references for a record.
5915
6093
  *
5916
6094
  * Inbound mode finds records whose wref fields point at the supplied wref. Outbound mode finds records that the supplied record points to. Inbound queries can be narrowed to a field path.
6095
+ *
6096
+ * Cursor contract: cursors are short-lived resume tokens for the same query
6097
+ * and result scope. If filters, visibility, or backing streams change, the
6098
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
6099
+ * cursor`; restart the query without `cursor` instead of retrying the stale
6100
+ * token.
5917
6101
  */
5918
6102
  refs: async (orgName, repoName, wref, opts) => {
5919
6103
  try {
@@ -5934,6 +6118,12 @@ var WarmHubClient = class _WarmHubClient {
5934
6118
  * Iterate every wref-typed field reference for a record.
5935
6119
  *
5936
6120
  * Prefer this over hand-written cursor loops when scanning all matching references. Pass `opts.cursor` to resume from a saved cursor; the iterator advances the cursor automatically after the first request. Pass `limit` to control page size.
6121
+ *
6122
+ * Cursor contract: cursors are short-lived resume tokens for the same query
6123
+ * and result scope. If filters, visibility, or backing streams change, the
6124
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
6125
+ * cursor`; restart the query without `cursor` instead of retrying the stale
6126
+ * token.
5937
6127
  */
5938
6128
  refsIter: (orgName, repoName, wref, opts) => {
5939
6129
  return paginate(
@@ -5946,6 +6136,12 @@ var WarmHubClient = class _WarmHubClient {
5946
6136
  * Materialize every wref-typed field reference for a record.
5947
6137
  *
5948
6138
  * Use `max` to guard memory usage; throws a `WarmHubError` with kind `VALIDATION_ERROR` once more than `max` refs have actually been observed across pages.
6139
+ *
6140
+ * Cursor contract: cursors are short-lived resume tokens for the same query
6141
+ * and result scope. If filters, visibility, or backing streams change, the
6142
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
6143
+ * cursor`; restart the query without `cursor` instead of retrying the stale
6144
+ * token.
5949
6145
  */
5950
6146
  refsAll: async (orgName, repoName, wref, opts) => {
5951
6147
  const { max, ...pageOpts } = opts ?? {};
@@ -5965,6 +6161,12 @@ var WarmHubClient = class _WarmHubClient {
5965
6161
  * Stream refreshed `thing.head` results whenever the repository changes.
5966
6162
  *
5967
6163
  * The SDK re-runs the underlying `thing.head` query after each invalidation and passes the latest snapshot to `onUpdate`.
6164
+ *
6165
+ * Cursor contract: cursors are short-lived resume tokens for the same query
6166
+ * and result scope. If filters, visibility, or backing streams change, the
6167
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
6168
+ * cursor`; restart the query without `cursor` instead of retrying the stale
6169
+ * token.
5968
6170
  */
5969
6171
  thingHead: async (orgName, repoName, opts, onUpdate) => {
5970
6172
  return this.watchRepoQuery(
@@ -5986,6 +6188,12 @@ var WarmHubClient = class _WarmHubClient {
5986
6188
  },
5987
6189
  /**
5988
6190
  * Stream refreshed history results for a single wref whenever the repository changes.
6191
+ *
6192
+ * Cursor contract: cursors are short-lived resume tokens for the same query
6193
+ * and result scope. If filters, visibility, or backing streams change, the
6194
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
6195
+ * cursor`; restart the query without `cursor` instead of retrying the stale
6196
+ * token.
5989
6197
  */
5990
6198
  thingHistory: async (orgName, repoName, opts, onUpdate) => {
5991
6199
  return this.watchRepoQuery(
@@ -6003,6 +6211,12 @@ var WarmHubClient = class _WarmHubClient {
6003
6211
  },
6004
6212
  /**
6005
6213
  * Stream refreshed action live-feed entries for a subscription.
6214
+ *
6215
+ * Cursor contract: cursors are short-lived resume tokens for the same query
6216
+ * and result scope. If filters, visibility, or backing streams change, the
6217
+ * backend may reject a saved cursor with `VALIDATION_ERROR` / `Invalid
6218
+ * cursor`; restart the query without `cursor` instead of retrying the stale
6219
+ * token.
6006
6220
  */
6007
6221
  subscriptionLog: async (orgName, repoName, subscriptionName, opts, onUpdate) => {
6008
6222
  return this.watchRepoQuery(
@@ -6592,5 +6806,5 @@ function isAbortError(error) {
6592
6806
  }
6593
6807
 
6594
6808
  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_COUNT2 as 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 };
6595
- //# sourceMappingURL=chunk-L5PODJ66.js.map
6596
- //# sourceMappingURL=chunk-L5PODJ66.js.map
6809
+ //# sourceMappingURL=chunk-EXE36J6Z.js.map
6810
+ //# sourceMappingURL=chunk-EXE36J6Z.js.map