@warmhub/sdk-ts 0.61.0 → 0.62.1
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
|
@@ -539,6 +539,16 @@ type StreamAppendResult$1 = {
|
|
|
539
539
|
} | {
|
|
540
540
|
reason: 'lease_held';
|
|
541
541
|
leaseExpiresAt: string;
|
|
542
|
+
} | {
|
|
543
|
+
reason: 'validation_failed';
|
|
544
|
+
issues: Array<{
|
|
545
|
+
path: string;
|
|
546
|
+
message: string;
|
|
547
|
+
}>;
|
|
548
|
+
} | {
|
|
549
|
+
reason: 'rate_limit_reset';
|
|
550
|
+
retryAfterSeconds: number;
|
|
551
|
+
resetAt: string;
|
|
542
552
|
};
|
|
543
553
|
};
|
|
544
554
|
resolvedName?: string;
|
|
@@ -1724,6 +1734,7 @@ declare class OperationBuilder {
|
|
|
1724
1734
|
retry?: RetryPolicyOptions | false;
|
|
1725
1735
|
}): Promise<OperationSubmitResult$1>;
|
|
1726
1736
|
private assertNotSubmitted;
|
|
1737
|
+
private assertCanModify;
|
|
1727
1738
|
}
|
|
1728
1739
|
|
|
1729
1740
|
/** @internal */
|
|
@@ -1860,7 +1871,7 @@ type CoreErrorKind = 'BACKEND' | 'NOT_FOUND' | 'FORBIDDEN' | 'UNAUTHENTICATED' |
|
|
|
1860
1871
|
* Stable kinds (members of `CoreErrorKind`):
|
|
1861
1872
|
*
|
|
1862
1873
|
* - `BACKEND` — cause: server-side failure that did not carry a more specific domain code (tRPC error data has no `data.warmhub.code`, REST status mapped to the catch-all default — primarily 5xx that lack a body `error.code` — or an SDK transport throw such as a non-OK SSE response); retryable: true; action: retry with backoff and surface the message if it persists; if the underlying error is a deterministic local-adapter failure (e.g. a misconfigured custom `fetch`), fix the adapter rather than retrying; origin: SDK tRPC fallback, `httpStatusToWarmHubCode` default for unmapped HTTP statuses, SSE transport, unknown thrown values inside tRPC paths (custom-`fetch` adapter throws are normalized to `BACKEND` only on tRPC surfaces — on REST and `ping` surfaces the raw error escapes uncaught). REST responses with a parseable body surface as their pass-through `error.code` (typically `INTERNAL_ERROR`), and REST 4xx responses without a body code fall through to the HTTP-status mapping (`NOT_FOUND`, `UNAUTHENTICATED`, `FORBIDDEN`, `CONFLICT`, `VALIDATION_ERROR`, `RATE_LIMITED`), not `BACKEND`.
|
|
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
|
|
1874
|
+
* - `NOT_FOUND` — cause: a referenced entity (repo, org, thing, shape, subscription, credential set, etc.) is missing or the caller cannot see it, or the client hit a removed/renamed tRPC procedure path or unsupported method because its route contract is out of sync with the backend; 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; when the message or hint names a procedure/method mismatch, upgrade the WarmHub client to match the backend; origin: SDK reads across all surfaces, commit pipeline, REST query endpoints, tRPC transport 404/405 route-missing/version-skew failures
|
|
1864
1875
|
* - `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
|
|
1865
1876
|
* - `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`.
|
|
1866
1877
|
* - `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
|
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-
|
|
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-XMQSHDUV.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-
|
|
2
|
-
export { DEFAULT_API_URL, SDK_VERSION, WarmHubClient, WarmHubError, toWarmHubError } from './chunk-
|
|
1
|
+
import { WarmHubClient } from './chunk-XMQSHDUV.js';
|
|
2
|
+
export { DEFAULT_API_URL, SDK_VERSION, WarmHubClient, WarmHubError, toWarmHubError } from './chunk-XMQSHDUV.js';
|
|
3
3
|
import { createContext, useMemo, useState, useEffect, useContext } from 'react';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -34,18 +34,19 @@ function AuthSyncGate({
|
|
|
34
34
|
client,
|
|
35
35
|
children
|
|
36
36
|
}) {
|
|
37
|
-
const [
|
|
37
|
+
const [syncedClient, setSyncedClient] = useState(null);
|
|
38
|
+
const synced = auth.isAuthenticated && syncedClient === client;
|
|
38
39
|
useEffect(() => {
|
|
39
40
|
if (!auth.isAuthenticated) {
|
|
40
|
-
|
|
41
|
+
setSyncedClient(null);
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
44
|
let cancelled = false;
|
|
44
45
|
client.auth.sync().then(() => {
|
|
45
|
-
if (!cancelled)
|
|
46
|
+
if (!cancelled) setSyncedClient(client);
|
|
46
47
|
}).catch((err) => {
|
|
47
48
|
console.error("auth.sync failed:", err);
|
|
48
|
-
if (!cancelled)
|
|
49
|
+
if (!cancelled) setSyncedClient(client);
|
|
49
50
|
});
|
|
50
51
|
return () => {
|
|
51
52
|
cancelled = true;
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/provider.tsx"],"names":[],"mappings":";;;;;AAiCA,IAAM,aAAA,GAAgB,cAAoC,IAAI,CAAA;AAC9D,IAAM,cAAc,aAAA,CAAgC;AAAA,EAClD,eAAA,EAAiB,KAAA;AAAA,EACjB,SAAA,EAAW;AACb,CAAC,CAAA;AAGM,SAAS,eAAA,CAAgB;AAAA,EAC9B,MAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,MAAA,EAAQ;AACV,CAAA,EAAyB;AAKvB,EAAA,MA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AAM,CAAA;AAAA,IACxC,CAAC,CAAA;AACH,IAAA,OAAO,MAAM;AACX,MAAA,SAAA,GAAY,IAAA;AAAA,IACd,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,IAAA,CAAK,eAAA,EAAiB,MAAM,CAAC,CAAA;AAEjC,EAAA,MAAM,SAAA,GAAY,OAAA;AAAA,IAChB,OAAO;AAAA,MACL,eAAA,EAAiB,KAAK,eAAA,IAAmB,MAAA;AAAA,MACzC,SAAA,EAAW,IAAA,CAAK,SAAA,IAAc,IAAA,CAAK,mBAAmB,CAAC;AAAA,KACzD,CAAA;AAAA,IACA,CAAC,IAAA,CAAK,eAAA,EAAiB,IAAA,CAAK,WAAW,MAAM;AAAA,GAC/C;AAGA,EAAA,IAAI,IAAA,CAAK,SAAA,IAAc,IAAA,CAAK,eAAA,IAAmB,CAAC,MAAA,EAAS;AACvD,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,2BACG,WAAA,CAAY,QAAA,EAAZ,EAAqB,KAAA,EAAO,WAAY,QAAA,EAAS,CAAA;AAEtD;AAGO,SAAS,gBAAA,GAAkC;AAChD,EAAA,MAAM,MAAA,GAAS,WAAW,aAAa,CAAA;AACvC,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,MAAM,IAAI,MAAM,wDAAwD,CAAA;AAAA,EAC1E;AACA,EAAA,OAAO,MAAA;AACT;AAGO,SAAS,cAAA,GAAmC;AACjD,EAAA,OAAO,WAAW,WAAW,CAAA;AAC/B","file":"react.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warmhub/sdk-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.62.1",
|
|
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,6 +86,7 @@
|
|
|
86
86
|
"@trpc/client": "11.17.0"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
+
"@trpc/server": "11.17.0",
|
|
89
90
|
"@vitest/coverage-v8": "catalog:",
|
|
90
91
|
"@types/react": "catalog:",
|
|
91
92
|
"react": "19.2.6",
|