@danypops/pi-jittor 0.9.0 → 0.10.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.
@@ -1,4 +1,13 @@
1
- import { connectJittorClient, type JittorClient, type OperationInputs, type OperationName, type OperationOutputs } from "@danypops/jittor";
1
+ import {
2
+ connectJittorClient,
3
+ isResetOperation,
4
+ type JittorClient,
5
+ type OperationInputs,
6
+ type OperationName,
7
+ type OperationOutputs,
8
+ type ResetOperationName,
9
+ resetRetryMode,
10
+ } from "@danypops/jittor";
2
11
  import { createRetryingClient, type RetryingClient } from "@danypops/vehicle-client/daemon-client";
3
12
 
4
13
  type JittorConnector = () => Promise<JittorClient>;
@@ -15,8 +24,6 @@ let retrying: RetryingClient<JittorClient> = createRetryingClient(() => connecto
15
24
  * is classified: only reads may be transparently invoked twice after a connection-shaped error.
16
25
  */
17
26
  const OPERATION_RETRY_MODE = {
18
- "subscription.resets.list": "retry",
19
- "subscription.resets.redeem": "once",
20
27
  "metrics.record": "once",
21
28
  "metrics.record_batch": "once",
22
29
  "metrics.query": "retry",
@@ -53,10 +60,10 @@ const OPERATION_RETRY_MODE = {
53
60
  "router.current_route": "once",
54
61
  "router.available_routes": "once",
55
62
  "cache.economics": "retry",
56
- } as const satisfies Record<OperationName, "retry" | "once">;
63
+ } as const satisfies Record<Exclude<OperationName, ResetOperationName>, "retry" | "once">;
57
64
 
58
65
  export function operationRetryMode(operation: OperationName): "retry" | "once" {
59
- return OPERATION_RETRY_MODE[operation];
66
+ return isResetOperation(operation) ? resetRetryMode(operation) : OPERATION_RETRY_MODE[operation];
60
67
  }
61
68
 
62
69
  export async function callJittor<Name extends OperationName>(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danypops/pi-jittor",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Pi extension for Jittor token and context observability with optimization controls backed by the @danypops/jittor daemon",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -16,7 +16,7 @@
16
16
  "@danypops/vehicle-client": "^0.10.1",
17
17
  "@danypops/vehicle-core": "^0.17.1",
18
18
  "@danypops/vehicle-server": "^0.25.1",
19
- "@danypops/jittor": "^0.22.0",
19
+ "@danypops/jittor": "^0.23.0",
20
20
  "malevich-tui-components": "^0.28.0"
21
21
  },
22
22
  "peerDependencies": {