@capxul/mcp 4.2.0-rc.1 → 4.2.0-rc.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.
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "source": {
3
- "commit": "efa1ae30674425e4db92020bfad513fb6cf36011",
4
- "tree": "91f805524a7c7b53e6c28cf484b549b0c1dbd9dd",
3
+ "commit": "fe4f1c05f1de962a7a76825816bdff2beaf5fc88",
4
+ "tree": "45b0c3cfdd39d23a4cfb1c1bcc047521f16bc12d",
5
5
  "branch": "codex/programme-rc",
6
6
  "repository": "https://github.com/Xelmar-tech/infrastructure",
7
7
  "lockfileSha256": "5870f53b72706d103220c1bcf733cb4fb71196aea32a9cfbdc277d73cc959264"
8
8
  },
9
9
  "name": "@capxul/mcp",
10
- "version": "4.2.0-rc.1"
10
+ "version": "4.2.0-rc.2"
11
11
  }
package/dist/main.mjs CHANGED
@@ -12046,7 +12046,7 @@ const moneyExecutionContract = {
12046
12046
  };
12047
12047
  //#endregion
12048
12048
  //#region ../../packages/sdk/package.json
12049
- var version$1 = "4.2.0-rc.1";
12049
+ var version$1 = "4.2.0-rc.2";
12050
12050
  //#endregion
12051
12051
  //#region ../../packages/sdk/src/telemetry/exception-projection.ts
12052
12052
  /** Fixed fallback for failures that have no safe message. */
@@ -43856,14 +43856,66 @@ function organizationWrongState(currentState, validStates) {
43856
43856
  function requestCancelled(options) {
43857
43857
  return options?.signal?.aborted === true;
43858
43858
  }
43859
+ function accountInFlight(state) {
43860
+ return state.phase === "authenticated" && (state.account.at === "deriving" || state.account.at === "claiming");
43861
+ }
43862
+ function settledAccount(deps, options) {
43863
+ return new Promise((resolve) => {
43864
+ let done = false;
43865
+ let unsubscribe = null;
43866
+ const onAbort = () => finish({
43867
+ ok: false,
43868
+ error: Errors.cancelled({ operation: CAPXUL_OPERATIONS.onboarding.completeOrganization })
43869
+ });
43870
+ const finish = (result) => {
43871
+ if (done) return;
43872
+ done = true;
43873
+ unsubscribe?.();
43874
+ options?.signal?.removeEventListener("abort", onAbort);
43875
+ resolve(result);
43876
+ };
43877
+ if (options?.signal?.aborted) {
43878
+ onAbort();
43879
+ return;
43880
+ }
43881
+ options?.signal?.addEventListener("abort", onAbort, { once: true });
43882
+ const stop = deps.subscribeIdentity((state) => {
43883
+ if (!accountInFlight(state)) finish({
43884
+ ok: true,
43885
+ value: state
43886
+ });
43887
+ });
43888
+ if (done) {
43889
+ stop();
43890
+ return;
43891
+ }
43892
+ unsubscribe = stop;
43893
+ const current = deps.snapshotIdentity();
43894
+ if (!accountInFlight(current)) finish({
43895
+ ok: true,
43896
+ value: current
43897
+ });
43898
+ });
43899
+ }
43859
43900
  async function reachClaimedAccount(deps, options) {
43860
43901
  let state = deps.snapshotIdentity();
43902
+ if (accountInFlight(state)) {
43903
+ const settled = await settledAccount(deps, options);
43904
+ if (!settled.ok) return settled;
43905
+ state = settled.value;
43906
+ }
43861
43907
  if (state.phase !== "authenticated" || state.account.at === "unknown") {
43862
43908
  const ensured = await deps.sendIdentity({ _tag: "EnsureAccount" }, options);
43863
43909
  if (!ensured.ok) return ensured;
43864
43910
  state = ensured.value;
43865
43911
  }
43866
43912
  if (state.phase !== "authenticated") return organizationWrongState(state.phase, ["authenticated:claimed"]);
43913
+ if (accountInFlight(state)) {
43914
+ const settled = await settledAccount(deps, options);
43915
+ if (!settled.ok) return settled;
43916
+ state = settled.value;
43917
+ if (state.phase !== "authenticated") return organizationWrongState(state.phase, ["authenticated:claimed"]);
43918
+ }
43867
43919
  if (state.account.at !== "claimed") {
43868
43920
  const event = state.account.at === "failed" ? { _tag: "RetryAccount" } : state.account.at === "counterfactual" ? { _tag: "ClaimAccount" } : { _tag: "EnsureAccount" };
43869
43921
  const claimed = await deps.sendIdentity(event, options);
@@ -45771,6 +45823,7 @@ function assembleCapxulClient(input) {
45771
45823
  ensureAccount: account._internal.ensureReady,
45772
45824
  getLifecycle: account.getLifecycle,
45773
45825
  snapshotIdentity: actor.snapshot,
45826
+ subscribeIdentity: actor.subscribe,
45774
45827
  sendIdentity: (event, options) => runCapxulEffect(askIdentity(actor, event, options), options, CAPXUL_OPERATIONS._internal.identity.send, effectRunner.runPromise)
45775
45828
  });
45776
45829
  const system = makeSystemMethods({ convexCall: input.ports.convexCall });
@@ -47382,7 +47435,7 @@ function stdioIdentity(env = process.env, options = {}) {
47382
47435
  }
47383
47436
  //#endregion
47384
47437
  //#region package.json
47385
- var version = "4.2.0-rc.1";
47438
+ var version = "4.2.0-rc.2";
47386
47439
  //#endregion
47387
47440
  //#region src/deps.ts
47388
47441
  const NO_IDENTITY = async () => void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capxul/mcp",
3
- "version": "4.2.0-rc.1",
3
+ "version": "4.2.0-rc.2",
4
4
  "private": false,
5
5
  "description": "Capxul MCP server for auth, Account readiness, identity, Organizations, relationships, requests, destinations, and testnet funding over Streamable HTTP.",
6
6
  "keywords": [
@@ -51,8 +51,8 @@
51
51
  "vite": "npm:@voidzero-dev/vite-plus-core@0.3.0",
52
52
  "vite-plus": "0.3.0",
53
53
  "@capxul/config": "0.3.0",
54
- "@capxul/sdk": "4.2.0-rc.1",
55
- "@capxul/typescript-config": "0.0.0"
54
+ "@capxul/typescript-config": "0.0.0",
55
+ "@capxul/sdk": "4.2.0-rc.2"
56
56
  },
57
57
  "scripts": {
58
58
  "dev": "vp exec tsx src/main.ts serve",