dsh-llm-fallbacks 0.4.0 → 0.4.2

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.
@@ -51,6 +51,13 @@ export { FallbacksSettingsController, FALLBACKS_SETTINGS_NS } from './fallbacks-
51
51
  * it reflectively and degrades to the switches empty state when absent
52
52
  * (`setCurrentSession` never called, `loadSwitches` ready with an empty
53
53
  * array, which the store already supports).
54
+ *
55
+ * rc.1 dotted-namespace contract: each client Remote namespace is a
56
+ * child-fiber service named `remote.<ns>` (upstream `remoteServiceKey`), and
57
+ * the traceable proxy forwards `ctx.remote.llm` / `.settings` / `.session`
58
+ * to those context properties — consumers MUST declare the dotted names
59
+ * here or the fiber walk throws `cannot get property "remote.llm" without
60
+ * inject`. `remote` stays for the `$on` invalidation face.
54
61
  */
55
62
  export declare const inject: string[];
56
63
  /**
@@ -4489,13 +4489,23 @@ window.__ModuleLoader__.load({
4489
4489
  * it reflectively and degrades to the switches empty state when absent
4490
4490
  * (`setCurrentSession` never called, `loadSwitches` ready with an empty
4491
4491
  * array, which the store already supports).
4492
+ *
4493
+ * rc.1 dotted-namespace contract: each client Remote namespace is a
4494
+ * child-fiber service named `remote.<ns>` (upstream `remoteServiceKey`), and
4495
+ * the traceable proxy forwards `ctx.remote.llm` / `.settings` / `.session`
4496
+ * to those context properties — consumers MUST declare the dotted names
4497
+ * here or the fiber walk throws `cannot get property "remote.llm" without
4498
+ * inject`. `remote` stays for the `$on` invalidation face.
4492
4499
  */
4493
4500
  const inject = [
4494
4501
  "slots",
4495
4502
  "locale",
4496
4503
  "connection",
4497
4504
  "remote",
4498
- "uiConversation"
4505
+ "uiConversation",
4506
+ "remote.llm",
4507
+ "remote.settings",
4508
+ "remote.session"
4499
4509
  ];
4500
4510
  /**
4501
4511
  * Register the `fallbacks` dictionaries and the plugin-config card once the
package/dist/index.js CHANGED
@@ -925,7 +925,8 @@ var FallbackStateStore = class {
925
925
  if (mode !== "half-open") return;
926
926
  for (const key of state.cooldown.keys()) this.isSuppressed(state, key, now, mode);
927
927
  }
928
- observeSuccess(state, key) {
928
+ observeSuccess(state, key, now = Date.now()) {
929
+ if (state.cooldown.peek(key) !== void 0) this.isSuppressed(state, key, now, "half-open");
929
930
  state.recovery.close(key);
930
931
  }
931
932
  };
package/dist/state.d.ts CHANGED
@@ -169,9 +169,17 @@ export declare class FallbackStateStore {
169
169
  */
170
170
  syncRecovery(state: AgentFallbackState, now: number, mode: RecoveryPolicy): void;
171
171
  /**
172
- * Observed completion ⇒ close the circuit (plan P2 rule 6): acts only when
173
- * the entry exists and is half-open; otherwise a no-op (a stale in-flight
174
- * success must not cancel a fresher escalated re-suppression).
172
+ * Observed completion ⇒ close the circuit (plan P2 rule 6). The lazy
173
+ * expiry runs FIRST — the same read the decision path performs — so a
174
+ * cooldown that lapsed BEFORE this completion is treated as what it is:
175
+ * an expired suppression, not an active one. The completion is
176
+ * post-expiry evidence and closes the circuit even when no decision-path
177
+ * read has transitioned the entry to half-open yet (a manual
178
+ * re-selection of the route, or a route no walk ever consulted because the
179
+ * current route kept succeeding). An ACTIVE suppression (`until > now`,
180
+ * including the `Infinity` of `revertPolicy: 'never'`) is untouched:
181
+ * a stale in-flight success must not cancel a fresher escalated
182
+ * re-suppression.
175
183
  */
176
- observeSuccess(state: AgentFallbackState, key: string): void;
184
+ observeSuccess(state: AgentFallbackState, key: string, now?: number): void;
177
185
  }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "dsh",
6
6
  "dsh-plugin"
7
7
  ],
8
- "version": "0.4.0",
8
+ "version": "0.4.2",
9
9
  "type": "module",
10
10
  "main": "./dist/index.js",
11
11
  "types": "./dist/index.d.ts",