@quantiya/codevibe-codex-plugin 2.0.52 → 2.0.53

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.
@@ -68870,6 +68870,30 @@ async function runOrchestrationShell(args) {
68870
68870
  logger.warn("[orchestration-shell] session-start context refresh threw (non-fatal)", {
68871
68871
  error: err.message
68872
68872
  });
68873
+ }), args.plannerAdapter && typeof args.plannerAdapter.setBeforeHostedFallback == "function" && args.plannerAdapter.setBeforeHostedFallback(async (input) => {
68874
+ if (!input.sessionContext.structuralSummaryDigest)
68875
+ try {
68876
+ let refresh = await refreshStructuralSummaryIntoStore({
68877
+ store,
68878
+ args,
68879
+ emitShellEventBound,
68880
+ generator,
68881
+ emitOnReuse: !1
68882
+ });
68883
+ if (refresh.digest)
68884
+ return {
68885
+ ...input,
68886
+ sessionContext: {
68887
+ ...input.sessionContext,
68888
+ structuralSummaryDigest: refresh.digest
68889
+ }
68890
+ };
68891
+ } catch (err) {
68892
+ logger.warn("[orchestration-shell] fallback context refresh threw (non-fatal)", {
68893
+ error: err.message
68894
+ });
68895
+ }
68896
+ return input;
68873
68897
  });
68874
68898
  let composeDispatchContext = (dispatch) => composeDispatchContextBlock({
68875
68899
  sessionId: args.session.sessionId,
@@ -75527,7 +75551,11 @@ var CompositePlannerAdapter = class {
75527
75551
  this.activeSessionId = null;
75528
75552
  this.recoveryTimer = null;
75529
75553
  this.sourceChangeListeners = /* @__PURE__ */ new Set();
75530
- this.currentSource = opts.localAdapter ? "local" : "hosted", this.recoveryIntervalMs = opts.recoveryProbeIntervalMs ?? 3e4;
75554
+ this.beforeHostedFallbackHook = null;
75555
+ this.currentSource = opts.localAdapter ? "local" : "hosted", this.recoveryIntervalMs = opts.recoveryProbeIntervalMs ?? 3e4, this.beforeHostedFallbackHook = opts.onBeforeHostedFallback ?? null;
75556
+ }
75557
+ setBeforeHostedFallback(hook) {
75558
+ this.beforeHostedFallbackHook = hook;
75531
75559
  }
75532
75560
  get activeSource() {
75533
75561
  return this.currentSource;
@@ -75622,7 +75650,16 @@ Local planner error. Falling back to hosted Gemma planner on AWS.
75622
75650
  ...input.budgetHint,
75623
75651
  wallClockMsRemaining: remainingMs
75624
75652
  }
75625
- }, startMs = Date.now();
75653
+ };
75654
+ if (this.beforeHostedFallbackHook)
75655
+ try {
75656
+ hostedInput = await this.beforeHostedFallbackHook(hostedInput);
75657
+ } catch (hookErr) {
75658
+ logger.warn("[composite-planner] onBeforeHostedFallback hook threw (non-fatal)", {
75659
+ error: hookErr?.message
75660
+ });
75661
+ }
75662
+ let startMs = Date.now();
75626
75663
  try {
75627
75664
  let decision = await this.opts.hostedAdapter.classify(hostedInput);
75628
75665
  return this.opts.hostedHealth && this.opts.hostedHealth.recordCall(Date.now() - startMs, !0), decision;
@@ -10,6 +10,7 @@ export interface CompositePlannerAdapterOptions {
10
10
  hostedHealth?: PlannerHealthMachine | null;
11
11
  recoveryProbeIntervalMs?: number;
12
12
  onNotice?: (message: string) => void;
13
+ onBeforeHostedFallback?: (input: PlannerInput) => Promise<PlannerInput>;
13
14
  }
14
15
  export declare class CompositePlannerAdapter implements PlannerAdapter {
15
16
  private readonly opts;
@@ -18,7 +19,9 @@ export declare class CompositePlannerAdapter implements PlannerAdapter {
18
19
  private recoveryTimer;
19
20
  private readonly sourceChangeListeners;
20
21
  private readonly recoveryIntervalMs;
22
+ private beforeHostedFallbackHook;
21
23
  constructor(opts: CompositePlannerAdapterOptions);
24
+ setBeforeHostedFallback(hook: (input: PlannerInput) => Promise<PlannerInput>): void;
22
25
  get activeSource(): 'local' | 'hosted';
23
26
  get runtimeKind(): 'local_gemma_qat' | 'local_unavailable' | 'hosted';
24
27
  get runtimeLabel(): string;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantiya/codevibe-core",
3
- "version": "2.0.45",
3
+ "version": "2.0.46",
4
4
  "description": "Core library for CodeVibe plugins - shared keychain, crypto, AppSync, and auth functionality",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantiya/codevibe-codex-plugin",
3
- "version": "2.0.52",
3
+ "version": "2.0.53",
4
4
  "description": "Control OpenAI Codex CLI from your iPhone and Android — real-time sync, approve file edits, send prompts by voice. Part of CodeVibe.",
5
5
  "main": "dist/server.js",
6
6
  "codevibe": {
@@ -47,7 +47,7 @@
47
47
  "node": ">=22.0.0"
48
48
  },
49
49
  "dependencies": {
50
- "@quantiya/codevibe-core": "^2.0.45",
50
+ "@quantiya/codevibe-core": "^2.0.46",
51
51
  "@quantiya/quorum-core": "^1.0.1",
52
52
  "chokidar": "^4.0.0",
53
53
  "dotenv": "^16.6.1",