@capxul/mcp 4.2.0-rc.6 → 4.2.0-rc.8
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.
- package/dist/capxul-source.json +3 -3
- package/dist/main.mjs +15 -53
- package/package.json +3 -3
package/dist/capxul-source.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"source": {
|
|
3
|
-
"commit": "
|
|
4
|
-
"tree": "
|
|
3
|
+
"commit": "29f8bbef5a60b623572ba982e895a10b47aaba27",
|
|
4
|
+
"tree": "9d831c3273591ecc4767094f887088781e786531",
|
|
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.
|
|
10
|
+
"version": "4.2.0-rc.8"
|
|
11
11
|
}
|
package/dist/main.mjs
CHANGED
|
@@ -8536,6 +8536,8 @@ const BootstrapEnvelope = Schema.Struct({
|
|
|
8536
8536
|
siteBaseUrl: Schema.String,
|
|
8537
8537
|
openfortPublishableKey: Schema.String,
|
|
8538
8538
|
shieldPublishableKey: Schema.String,
|
|
8539
|
+
/** Which Openfort third-party auth provider the signer presents; absent means better-auth. */
|
|
8540
|
+
openfortAuthProvider: Schema.optional(Schema.Literals(["better-auth", "oidc"])),
|
|
8539
8541
|
engineeringTelemetry: Schema.optional(EngineeringTelemetryBootstrapPolicy)
|
|
8540
8542
|
})
|
|
8541
8543
|
});
|
|
@@ -8658,8 +8660,7 @@ const CAPXUL_FUNCTIONS = {
|
|
|
8658
8660
|
listMine: "org/queries:listMine",
|
|
8659
8661
|
listRolesByOrgId: "org/queries:listRolesByOrgId",
|
|
8660
8662
|
loadByOrgId: "org/queries:loadByOrgId",
|
|
8661
|
-
me: "org/queries:me"
|
|
8662
|
-
pendingSetup: "org/queries:pendingSetup"
|
|
8663
|
+
me: "org/queries:me"
|
|
8663
8664
|
},
|
|
8664
8665
|
"smartAccount/actions": {
|
|
8665
8666
|
claim: "smartAccount/actions:claim",
|
|
@@ -12258,7 +12259,7 @@ const moneyExecutionContract = {
|
|
|
12258
12259
|
};
|
|
12259
12260
|
//#endregion
|
|
12260
12261
|
//#region ../../packages/sdk/package.json
|
|
12261
|
-
var version$1 = "4.2.0-rc.
|
|
12262
|
+
var version$1 = "4.2.0-rc.8";
|
|
12262
12263
|
//#endregion
|
|
12263
12264
|
//#region ../../packages/sdk/src/telemetry/exception-projection.ts
|
|
12264
12265
|
/** Fixed fallback for failures that have no safe message. */
|
|
@@ -15345,6 +15346,7 @@ var HttpBootstrapAdapter = class {
|
|
|
15345
15346
|
siteBaseUrl: normalizeRuntimeUrl("siteBaseUrl", decodedState.siteBaseUrl),
|
|
15346
15347
|
openfortPublishableKey: decodedState.openfortPublishableKey,
|
|
15347
15348
|
shieldPublishableKey: decodedState.shieldPublishableKey,
|
|
15349
|
+
...decodedState.openfortAuthProvider === void 0 ? {} : { openfortAuthProvider: decodedState.openfortAuthProvider },
|
|
15348
15350
|
...decodedEngineeringTelemetry !== void 0 && Result.isSuccess(decodedEngineeringTelemetry) ? { engineeringTelemetry: decodedEngineeringTelemetry.success } : {}
|
|
15349
15351
|
};
|
|
15350
15352
|
},
|
|
@@ -19208,7 +19210,6 @@ function orgIdBody(orgId) {
|
|
|
19208
19210
|
//#region ../../packages/sdk/src/adapters/org/ConvexOrganizationAdapter.ts
|
|
19209
19211
|
const DEFAULT_FUNCTIONS$1 = {
|
|
19210
19212
|
listAll: makeFunctionReference(CAPXUL_FUNCTIONS["org/queries"].listAll),
|
|
19211
|
-
pendingSetup: makeFunctionReference(CAPXUL_FUNCTIONS["org/queries"].pendingSetup),
|
|
19212
19213
|
listRoles: makeFunctionReference(CAPXUL_FUNCTIONS["org/queries"].listRolesByOrgId),
|
|
19213
19214
|
listMembers: makeFunctionReference(CAPXUL_FUNCTIONS["org/queries"].listMembersByOrgId),
|
|
19214
19215
|
readTreasury: makeFunctionReference(CAPXUL_FUNCTIONS["org/actions"].readTreasury),
|
|
@@ -19244,9 +19245,6 @@ var ConvexOrganizationAdapter = class {
|
|
|
19244
19245
|
return brandOrgView(wire, treasury, viewerRole);
|
|
19245
19246
|
})))), Effect.catchDefect((cause) => Effect.fail(toOrgError("listOrgs", cause))));
|
|
19246
19247
|
}
|
|
19247
|
-
pendingSetup(input) {
|
|
19248
|
-
return this.#convex.query(this.#fns.pendingSetup, copyInvocationObservation(input, {})).pipe(Effect.mapError((error) => orgErrorFromCapxul("pendingSetup", error.publicError, error)), Effect.map((wire) => wire === null ? null : { orgId: toOrgId(wire.orgId) }), Effect.catchDefect((cause) => Effect.fail(toOrgError("pendingSetup", cause))));
|
|
19249
|
-
}
|
|
19250
19248
|
readTreasury(input) {
|
|
19251
19249
|
return this.#readTreasuryWire(input).pipe(Effect.catchDefect((cause) => Effect.fail(toOrgError("readTreasury", cause))));
|
|
19252
19250
|
}
|
|
@@ -42768,8 +42766,9 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
42768
42766
|
});
|
|
42769
42767
|
throw failOpenfort("configure", "no-secure-context", /* @__PURE__ */ new Error("Web Crypto unavailable: browser is not a secure context"));
|
|
42770
42768
|
}
|
|
42771
|
-
|
|
42772
|
-
|
|
42769
|
+
const authProvider = bootstrap.openfortAuthProvider ?? "better-auth";
|
|
42770
|
+
function accessTokenUrl() {
|
|
42771
|
+
return authProvider === "oidc" ? `${authBaseUrl}/convex/token` : `${authBaseUrl}/get-session`;
|
|
42773
42772
|
}
|
|
42774
42773
|
function encryptionSessionUrl() {
|
|
42775
42774
|
return `${authBaseUrl}/encryption-session`;
|
|
@@ -42792,7 +42791,7 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
42792
42791
|
tokenCalls += 1;
|
|
42793
42792
|
const tokenStartedAt = Date.now();
|
|
42794
42793
|
try {
|
|
42795
|
-
const response = await fetch(
|
|
42794
|
+
const response = await fetch(accessTokenUrl(), {
|
|
42796
42795
|
credentials: "include",
|
|
42797
42796
|
cache: "no-store"
|
|
42798
42797
|
});
|
|
@@ -42805,7 +42804,8 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
42805
42804
|
});
|
|
42806
42805
|
return null;
|
|
42807
42806
|
}
|
|
42808
|
-
const
|
|
42807
|
+
const body = await response.json();
|
|
42808
|
+
const token = (authProvider === "oidc" ? body.token : body.session?.token)?.trim();
|
|
42809
42809
|
if (token === void 0 || token.length === 0) {
|
|
42810
42810
|
diagnostic?.trace("openfort.token", {
|
|
42811
42811
|
ok: false,
|
|
@@ -42817,6 +42817,7 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
42817
42817
|
diagnostic?.trace("openfort.token", {
|
|
42818
42818
|
ok: true,
|
|
42819
42819
|
tokenPresent: true,
|
|
42820
|
+
provider: authProvider,
|
|
42820
42821
|
call: tokenCalls,
|
|
42821
42822
|
duration_ms: Date.now() - tokenStartedAt,
|
|
42822
42823
|
elapsed_ms: sinceCycleStart()
|
|
@@ -42835,7 +42836,7 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
42835
42836
|
baseConfiguration: { publishableKey: bootstrap.openfortPublishableKey },
|
|
42836
42837
|
shieldConfiguration: { shieldPublishableKey: bootstrap.shieldPublishableKey },
|
|
42837
42838
|
thirdPartyAuth: {
|
|
42838
|
-
provider: o$13.BETTER_AUTH,
|
|
42839
|
+
provider: authProvider === "oidc" ? o$13.OIDC : o$13.BETTER_AUTH,
|
|
42839
42840
|
getAccessToken: fetchBetterAuthAccessToken
|
|
42840
42841
|
}
|
|
42841
42842
|
});
|
|
@@ -46027,43 +46028,6 @@ function startSignerReadinessOnClaim(actor, signer) {
|
|
|
46027
46028
|
browserSigner.ensureWalletReady?.().catch(() => {});
|
|
46028
46029
|
});
|
|
46029
46030
|
}
|
|
46030
|
-
/**
|
|
46031
|
-
* Attach a pending Organization when the identity becomes claimed.
|
|
46032
|
-
*
|
|
46033
|
-
* A reload during Organization setup used to leave the app re-submitting the
|
|
46034
|
-
* stored draft, and that second submission raced the controller's resume on
|
|
46035
|
-
* `ReadSession` — the loser was refused with `SUPERSEDED`. The backend already
|
|
46036
|
-
* knows the truth: `pendingSetup()` reports the owner's Organization whose
|
|
46037
|
-
* setup has not finished. The SDK asks once per authenticated user and sends
|
|
46038
|
-
* `AttachOrganization`, which the identity flow runs as `orgLane(…, attach)`.
|
|
46039
|
-
* The app then re-submits nothing.
|
|
46040
|
-
*
|
|
46041
|
-
* The read is fire-and-forget, as the signer readiness cycle is: a failure is
|
|
46042
|
-
* swallowed and the ask is released, so the next state change retries. The ask
|
|
46043
|
-
* is held to ONE per authUserId, so the claimed transitions that follow (the
|
|
46044
|
-
* org lane's own) start no second read, and a new session asks again.
|
|
46045
|
-
*/
|
|
46046
|
-
function attachPendingOrganizationOnClaim(actor, organizationPort) {
|
|
46047
|
-
const pendingSetup = organizationPort?.pendingSetup?.bind(organizationPort);
|
|
46048
|
-
if (pendingSetup === void 0) return () => {};
|
|
46049
|
-
let askedFor = null;
|
|
46050
|
-
return actor.subscribe((state) => {
|
|
46051
|
-
if (state.phase !== "authenticated" || state.account.at !== "claimed") return;
|
|
46052
|
-
if (state.account.org !== null) return;
|
|
46053
|
-
const authUserId = state.session.authUserId;
|
|
46054
|
-
if (askedFor === authUserId) return;
|
|
46055
|
-
askedFor = authUserId;
|
|
46056
|
-
Effect.runPromise(pendingSetup({})).then((pending) => {
|
|
46057
|
-
if (pending === null) return;
|
|
46058
|
-
return Effect.runPromise(actor.ask({
|
|
46059
|
-
_tag: "AttachOrganization",
|
|
46060
|
-
orgId: String(pending.orgId)
|
|
46061
|
-
}));
|
|
46062
|
-
}).catch(() => {
|
|
46063
|
-
askedFor = null;
|
|
46064
|
-
});
|
|
46065
|
-
});
|
|
46066
|
-
}
|
|
46067
46031
|
function assembleCapxulClient(input) {
|
|
46068
46032
|
const observation = input;
|
|
46069
46033
|
const authCache = input.authCache ?? detectAuthCacheAdapter();
|
|
@@ -46093,20 +46057,18 @@ function assembleCapxulClient(input) {
|
|
|
46093
46057
|
}, failureObservation, normalizeCapxulOperation(`identity.${record.event}`), "machine");
|
|
46094
46058
|
});
|
|
46095
46059
|
const unsubscribeSignerReadiness = startSignerReadinessOnClaim(actor, input.signer);
|
|
46096
|
-
const selectedOrgPort = input.orgPort ?? input.orgDeploymentPort;
|
|
46097
|
-
const unsubscribePendingOrganization = attachPendingOrganizationOnClaim(actor, selectedOrgPort);
|
|
46098
46060
|
let stopPromise = null;
|
|
46099
46061
|
const stopActor = () => {
|
|
46100
46062
|
if (stopPromise === null) {
|
|
46101
46063
|
unsubscribeProductTelemetry();
|
|
46102
46064
|
unsubscribeFailureObservation();
|
|
46103
46065
|
unsubscribeSignerReadiness();
|
|
46104
|
-
unsubscribePendingOrganization();
|
|
46105
46066
|
stopPromise = effectRunner.runPromise(Scope.close(scope, Exit.void));
|
|
46106
46067
|
}
|
|
46107
46068
|
return stopPromise;
|
|
46108
46069
|
};
|
|
46109
46070
|
if (input.signal !== void 0) input.signal.addEventListener("abort", () => void stopActor(), { once: true });
|
|
46071
|
+
const selectedOrgPort = input.orgPort ?? input.orgDeploymentPort;
|
|
46110
46072
|
let detectPendingOrgInvitations;
|
|
46111
46073
|
let kickProvisioning;
|
|
46112
46074
|
const financialOps = makeFinancialOpsMethods({
|
|
@@ -47793,7 +47755,7 @@ function stdioIdentity(env = process.env, options = {}) {
|
|
|
47793
47755
|
}
|
|
47794
47756
|
//#endregion
|
|
47795
47757
|
//#region package.json
|
|
47796
|
-
var version = "4.2.0-rc.
|
|
47758
|
+
var version = "4.2.0-rc.8";
|
|
47797
47759
|
//#endregion
|
|
47798
47760
|
//#region src/deps.ts
|
|
47799
47761
|
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.
|
|
3
|
+
"version": "4.2.0-rc.8",
|
|
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/
|
|
55
|
-
"@capxul/
|
|
54
|
+
"@capxul/typescript-config": "0.0.0",
|
|
55
|
+
"@capxul/sdk": "4.2.0-rc.8"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"dev": "vp exec tsx src/main.ts serve",
|