Skip to content

Vendor upstream v3.12.0 - #12

Merged
kwaich merged 3 commits into
mainfrom
upstream/v3.12.0
Nov 6, 2026
Merged

kwaich merged 3 commits into
mainfrom
upstream/v3.12.0

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Upstream released v3.12.0. This PR re-vendors the web adapter contract (was v3.11.0).

Checks (run in the drift workflow against wealthfolio/wealthfolio:3.12.0)

Check Result
pnpm typecheck pass
pnpm test FAIL
pnpm build pass
pnpm test:integration pass

PRs opened with the workflow token do not trigger CI. Push a commit or re-run CI from the Actions tab before merging.

core.ts diff

--- core.ts v3.11.0
+++ core.ts v3.12.0
@@ -104,6 +104,11 @@
   // Activities
   search_activities: { method: "POST", path: "/activities/search" },
   create_activity: { method: "POST", path: "/activities" },
+  review_internal_transfer_pair_split_effects: {
+    method: "POST",
+    path: "/activities/transfer-pair/split-effects",
+  },
+  review_activity_split_effects: { method: "POST", path: "/activities/split-effects" },
   update_activity: { method: "PUT", path: "/activities" },
   save_activities: { method: "POST", path: "/activities/bulk" },
   delete_activity: { method: "DELETE", path: "/activities" },
@@ -197,6 +202,8 @@
   migrate_legacy_classifications: { method: "POST", path: "/taxonomies/migration/run" },
   // Spending budget
   get_budget: { method: "GET", path: "/spending/budget" },
+  get_budget_readonly: { method: "GET", path: "/spending/budget/snapshot" },
+  get_spending_context: { method: "GET", path: "/spending/context" },
   upsert_budget_target: { method: "POST", path: "/spending/budget/targets" },
   delete_budget_target: { method: "DELETE", path: "/spending/budget/targets" },
   upsert_budget_rollover_setting: { method: "POST", path: "/spending/budget/rollovers" },
@@ -228,6 +235,7 @@
   upsert_categorization_rule: { method: "POST", path: "/spending/rules/upsert" },
   delete_categorization_rule: { method: "DELETE", path: "/spending/rules" },
   rerun_categorization_rules: { method: "POST", path: "/spending/rules/rerun" },
+  rerun_categorization_rules_detailed: { method: "POST", path: "/spending/rules/rerun/detailed" },
   list_rule_presets: { method: "GET", path: "/spending/rule-presets" },
   import_rule_preset: { method: "POST", path: "/spending/rule-presets" },
   remove_rule_preset: { method: "DELETE", path: "/spending/rule-presets" },
@@ -391,7 +399,14 @@
   get_allocation_target_drift: { method: "POST", path: "/allocation-targets" },
   list_target_constraints: { method: "GET", path: "/allocation-targets" },
   save_target_constraints: { method: "POST", path: "/allocation-targets" },
-  calculate_rebalance_plan: { method: "POST", path: "/allocation-targets/rebalance/calculate" },
+  generate_calculated_adjustments: {
+    method: "POST",
+    path: "/allocation-targets/worksheet/generate",
+  },
+  calculate_allocation_worksheet: {
+    method: "POST",
+    path: "/allocation-targets/worksheet/calculate",
+  },
   // Alternative Assets
   create_alternative_asset: { method: "POST", path: "/alternative-assets" },
   update_alternative_asset_valuation: { method: "PUT", path: "/alternative-assets" },
@@ -410,6 +425,7 @@
   get_agent_access_status: { method: "GET", path: "/agent-access/status" },
   list_agent_access_tokens: { method: "GET", path: "/agent-access/tokens" },
   create_agent_access_token: { method: "POST", path: "/agent-access/tokens" },
+  update_agent_access_token_scopes: { method: "PATCH", path: "/agent-access/tokens" },
   delete_agent_access_token: { method: "DELETE", path: "/agent-access/tokens" },
   list_agent_audit_log: { method: "GET", path: "/agent-access/audit" },
   purge_agent_audit_log: { method: "POST", path: "/agent-access/audit/purge" },
@@ -431,14 +447,14 @@
  */
 export function toBase64(data: Uint8Array | number[]): string {
   const bytes = Array.isArray(data) ? new Uint8Array(data) : data;
-  // Fast base64 encoding without TextEncoder for binary
-  let binary = "";
-  const len = bytes.byteLength;
-  for (let i = 0; i < len; i++) {
-    binary += String.fromCharCode(bytes[i]);
+  // Bound each call to avoid argument limits and per-byte string concatenation.
+  const chunkSize = 32 * 1024;
+  const chunks: string[] = [];
+  for (let i = 0; i < bytes.byteLength; i += chunkSize) {
+    chunks.push(String.fromCharCode(...bytes.subarray(i, i + chunkSize)));
   }
   // btoa expects binary string
-  return btoa(binary);
+  return btoa(chunks.join(""));
 }
 
 /**
@@ -861,6 +877,11 @@
       body = JSON.stringify(activity);
       break;
     }
+    case "review_activity_split_effects": {
+      const { activities } = payload as { activities: Record<string, unknown>[] };
+      body = JSON.stringify(activities);
+      break;
+    }
     case "update_activity": {
       const { activity } = payload as { activity: Record<string, unknown> };
       body = JSON.stringify(activity);
@@ -886,6 +907,7 @@
       body = JSON.stringify(request);
       break;
     }
+    case "review_internal_transfer_pair_split_effects":
     case "save_internal_transfer_pair": {
       const { request } = payload as { request: Record<string, unknown> };
       body = JSON.stringify(request);
@@ -1272,7 +1294,8 @@
     case "migrate_legacy_classifications":
       break;
     // Spending budget commands
-    case "get_budget": {
+    case "get_budget":
+    case "get_budget_readonly": {
       const { periodKey } = (payload ?? {}) as { periodKey?: string };
       addPeriodKey(periodKey);
       break;
@@ -1363,6 +1386,7 @@
       break;
     }
     // Spending settings
+    case "get_spending_context":
     case "get_spending_settings":
       break;
     case "update_spending_settings": {
@@ -1487,7 +1511,8 @@
       url += `/${encodeURIComponent(id)}`;
       break;
     }
-    case "rerun_categorization_rules": {
+    case "rerun_categorization_rules":
+    case "rerun_categorization_rules_detailed": {
       const { onlyUncategorized } = payload as { onlyUncategorized: boolean };
       body = JSON.stringify({ onlyUncategorized });
       break;
@@ -1811,7 +1836,7 @@
     case "get_broker_sync_states":
     case "get_broker_ingest_states":
     // Device Sync / Enrollment (falls through)
-    // eslint-disable-next-line no-fallthrough
+    // oxlint-disable-next-line no-fallthrough
     case "get_device_sync_state":
     case "enable_device_sync":
     case "clear_device_sync_data":
@@ -2003,23 +2028,49 @@
       body = JSON.stringify(constraints);
       break;
     }
-    case "calculate_rebalance_plan": {
-      const { targetId, availableCash, filter, scenarioMode, eligibleAssetIds } = payload as {
+    case "generate_calculated_adjustments": {
+      const {
+        targetId,
+        mode,
+        rule,
+        cash,
+        selectedAccountIds,
+        filter,
+        eligibleAssetIds,
+        sellableAssetIds,
+      } = payload as {
         targetId: string;
-        availableCash: number;
+        mode: string;
+        rule: string;
+        cash: unknown;
+        selectedAccountIds: string[];
         filter: unknown;
-        scenarioMode: string;
         eligibleAssetIds?: string[];
+        sellableAssetIds?: string[];
       };
       body = JSON.stringify({
         targetId,
-        availableCash,
+        mode,
+        rule,
+        cash,
+        selectedAccountIds,
         filter,
-        scenarioMode,
         ...(eligibleAssetIds === undefined ? {} : { eligibleAssetIds }),
+        ...(sellableAssetIds === undefined ? {} : { sellableAssetIds }),
       });
       break;
     }
+    case "calculate_allocation_worksheet": {
+      const { targetId, cash, lines, selectedAccountIds, filter } = payload as {
+        targetId: string;
+        cash: unknown;
+        lines: unknown[];
+        selectedAccountIds: string[];
+        filter: unknown;
+      };
+      body = JSON.stringify({ targetId, cash, lines, selectedAccountIds, filter });
+      break;
+    }
     // AI Providers
     case "get_ai_providers":
       break;
@@ -2113,6 +2164,12 @@
       body = JSON.stringify({ name, expiresAt, scopes });
       break;
     }
+    case "update_agent_access_token_scopes": {
+      const { id, scopes } = payload as { id: string; scopes: string[] };
+      url += `/${encodeURIComponent(id)}`;
+      body = JSON.stringify({ scopes });
+      break;
+    }
     case "delete_agent_access_token": {
       const { id } = payload as { id: string };
       url += `/${encodeURIComponent(id)}`;

Review new or changed cases in the invoke switch against the curated commands in src/commands/curated.ts.

github-actions Bot and others added 3 commits November 2, 2026 15:53
Upstream removed calculate_rebalance_plan. wf rebalance --cash now calls
generate_calculated_adjustments, sending --cash as new money for one account.
Adds --account; --mode is now invest_cash or rebalance.
@kwaich
kwaich merged commit 14aab72 into main Nov 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant