@capxul/mcp 4.2.0-rc.3 → 4.2.0-rc.4
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 +319 -16
- package/package.json +2 -2
package/dist/capxul-source.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"source": {
|
|
3
|
-
"commit": "
|
|
4
|
-
"tree": "
|
|
3
|
+
"commit": "400e4b861e8c10091ad2d9e71fc0502fe222a801",
|
|
4
|
+
"tree": "c3afb8bb5f3ce69ee8aa1e8fbe811fe213627887",
|
|
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.4"
|
|
11
11
|
}
|
package/dist/main.mjs
CHANGED
|
@@ -7658,10 +7658,24 @@ const DepositSettledProps = Schema.Struct({
|
|
|
7658
7658
|
});
|
|
7659
7659
|
const PermissionMirrorVerificationProps = Schema.Struct({
|
|
7660
7660
|
...TelemetryEnvelopeProps,
|
|
7661
|
+
/** The RECEIPT verification outcome. What the mirror then did is separate. */
|
|
7661
7662
|
outcome: Schema.String,
|
|
7662
7663
|
reason: Schema.String,
|
|
7663
7664
|
chain_id: Schema.Number,
|
|
7664
|
-
retry_count: Schema.Number
|
|
7665
|
+
retry_count: Schema.Number,
|
|
7666
|
+
/**
|
|
7667
|
+
* #1960 R02, consumed by R03. A verified receipt is not an applied Permission:
|
|
7668
|
+
* these two optional fields let the producer say what the applying mutation
|
|
7669
|
+
* actually returned, and which command it was, without either fact rewriting
|
|
7670
|
+
* the receipt outcome above. Absent when application has not happened yet.
|
|
7671
|
+
*/
|
|
7672
|
+
application_result: Schema.optional(Schema.Literals([
|
|
7673
|
+
"applied",
|
|
7674
|
+
"replayed",
|
|
7675
|
+
"conflicting_replay",
|
|
7676
|
+
"revision_mismatch"
|
|
7677
|
+
])),
|
|
7678
|
+
command_id: OptionalString
|
|
7665
7679
|
});
|
|
7666
7680
|
const MovementScanWindowProps = Schema.Struct({
|
|
7667
7681
|
...TelemetryEnvelopeProps,
|
|
@@ -7887,6 +7901,10 @@ Schema.Struct({
|
|
|
7887
7901
|
name: Schema.Literal("movement_scan_incident"),
|
|
7888
7902
|
props: MovementScanIncidentProps
|
|
7889
7903
|
});
|
|
7904
|
+
/** The one spelling of "whose scope did this happen in" across every surface. */
|
|
7905
|
+
const ScopeKindSchema = Schema.Literals(["account", "organization"]);
|
|
7906
|
+
const AccountKindSchema = Schema.Literals(["personalSafe", "orgTreasury"]);
|
|
7907
|
+
const OptionalReasonCode = Schema.optional(Schema.Literals(CAPXUL_ERROR_CODES));
|
|
7890
7908
|
const ActivityReferenceProps = {
|
|
7891
7909
|
reference_kind: Schema.Literals(["payment", "movement"]),
|
|
7892
7910
|
reference_id: Schema.String
|
|
@@ -7917,8 +7935,8 @@ const ActivityFilterProps = {
|
|
|
7917
7935
|
};
|
|
7918
7936
|
const ActivityActionProps = {
|
|
7919
7937
|
...TelemetryEnvelopeProps,
|
|
7920
|
-
scope_kind:
|
|
7921
|
-
reason_code:
|
|
7938
|
+
scope_kind: ScopeKindSchema,
|
|
7939
|
+
reason_code: OptionalReasonCode
|
|
7922
7940
|
};
|
|
7923
7941
|
Schema.Struct({
|
|
7924
7942
|
name: Schema.Literal("contact_relationship_changed"),
|
|
@@ -7930,7 +7948,7 @@ Schema.Struct({
|
|
|
7930
7948
|
"hidden",
|
|
7931
7949
|
"restored"
|
|
7932
7950
|
]),
|
|
7933
|
-
scope_kind:
|
|
7951
|
+
scope_kind: ScopeKindSchema,
|
|
7934
7952
|
scope_id: Schema.String,
|
|
7935
7953
|
owner_party_id: Schema.String,
|
|
7936
7954
|
party_id: Schema.String,
|
|
@@ -7946,9 +7964,9 @@ Schema.Struct({
|
|
|
7946
7964
|
});
|
|
7947
7965
|
const ContactActionProps = {
|
|
7948
7966
|
...TelemetryEnvelopeProps,
|
|
7949
|
-
scope_kind:
|
|
7967
|
+
scope_kind: ScopeKindSchema,
|
|
7950
7968
|
party_id: OptionalString,
|
|
7951
|
-
reason_code:
|
|
7969
|
+
reason_code: OptionalReasonCode
|
|
7952
7970
|
};
|
|
7953
7971
|
Schema.Struct({
|
|
7954
7972
|
name: Schema.Literal("ui_contact_action_completed"),
|
|
@@ -7975,7 +7993,7 @@ Schema.Struct({
|
|
|
7975
7993
|
props: Schema.Struct({
|
|
7976
7994
|
...TelemetryEnvelopeProps,
|
|
7977
7995
|
...ActivityReferenceProps,
|
|
7978
|
-
scope_kind:
|
|
7996
|
+
scope_kind: ScopeKindSchema,
|
|
7979
7997
|
scope_id: Schema.String,
|
|
7980
7998
|
occurred_at: Schema.Number
|
|
7981
7999
|
})
|
|
@@ -8030,6 +8048,193 @@ Schema.Struct({
|
|
|
8030
8048
|
})
|
|
8031
8049
|
])
|
|
8032
8050
|
});
|
|
8051
|
+
/**
|
|
8052
|
+
* Reliability closeout (#1960 R02) — the shape every explicit UI observation
|
|
8053
|
+
* below shares. `scope_kind` says whose surface the person was looking at,
|
|
8054
|
+
* `organization_id` is the verified Organization the producer resolved (absent
|
|
8055
|
+
* on a personal action), and `reason_code` is a catalog error code, never copy.
|
|
8056
|
+
*/
|
|
8057
|
+
const UiStepProps = {
|
|
8058
|
+
...TelemetryEnvelopeProps,
|
|
8059
|
+
scope_kind: ScopeKindSchema,
|
|
8060
|
+
organization_id: OptionalOrgId,
|
|
8061
|
+
reason_code: OptionalReasonCode
|
|
8062
|
+
};
|
|
8063
|
+
const AccessRecoveryCompletedProps = Schema.Union([Schema.Struct({
|
|
8064
|
+
...TelemetryEnvelopeProps,
|
|
8065
|
+
recovery: Schema.Literal("session_restoration"),
|
|
8066
|
+
outcome: Schema.Literals([
|
|
8067
|
+
"restored",
|
|
8068
|
+
"absent",
|
|
8069
|
+
"failed"
|
|
8070
|
+
]),
|
|
8071
|
+
reason_code: OptionalReasonCode,
|
|
8072
|
+
organization_id: OptionalOrgId
|
|
8073
|
+
}), Schema.Struct({
|
|
8074
|
+
...TelemetryEnvelopeProps,
|
|
8075
|
+
recovery: Schema.Literal("signer_readiness"),
|
|
8076
|
+
outcome: Schema.Literals(["ready", "unavailable"]),
|
|
8077
|
+
reason_code: OptionalReasonCode,
|
|
8078
|
+
organization_id: OptionalOrgId
|
|
8079
|
+
})]);
|
|
8080
|
+
Schema.Struct({
|
|
8081
|
+
name: Schema.Literal("access_recovery_completed"),
|
|
8082
|
+
props: AccessRecoveryCompletedProps
|
|
8083
|
+
});
|
|
8084
|
+
Schema.Struct({
|
|
8085
|
+
name: Schema.Literal("ui_access_step_completed"),
|
|
8086
|
+
props: Schema.Struct({
|
|
8087
|
+
...UiStepProps,
|
|
8088
|
+
step: Schema.Literals([
|
|
8089
|
+
"dashboard_granted",
|
|
8090
|
+
"redirect_completed",
|
|
8091
|
+
"gate_error_displayed",
|
|
8092
|
+
"retry_selected",
|
|
8093
|
+
"capability_refusal_displayed",
|
|
8094
|
+
"signer_refusal_displayed"
|
|
8095
|
+
]),
|
|
8096
|
+
capability: Schema.optional(Schema.Literals(["spend", "managePeople"])),
|
|
8097
|
+
probe: Schema.optional(Schema.Literals([
|
|
8098
|
+
"session",
|
|
8099
|
+
"membership",
|
|
8100
|
+
"lifecycle"
|
|
8101
|
+
])),
|
|
8102
|
+
reason: Schema.optional(Schema.Literals([
|
|
8103
|
+
"loading",
|
|
8104
|
+
"no-permission",
|
|
8105
|
+
"org-unavailable"
|
|
8106
|
+
]))
|
|
8107
|
+
})
|
|
8108
|
+
});
|
|
8109
|
+
Schema.Struct({
|
|
8110
|
+
name: Schema.Literal("org_invite_progressed"),
|
|
8111
|
+
props: Schema.Struct({
|
|
8112
|
+
...TelemetryEnvelopeProps,
|
|
8113
|
+
organization_id: OrgIdTelemetrySchema,
|
|
8114
|
+
progress: Schema.Literals([
|
|
8115
|
+
"account_ready",
|
|
8116
|
+
"permission_applied",
|
|
8117
|
+
"membership_activated",
|
|
8118
|
+
"revoked"
|
|
8119
|
+
]),
|
|
8120
|
+
/** The invited Party. The initiating actor stays on the envelope's identity. */
|
|
8121
|
+
member_party_id: Schema.String,
|
|
8122
|
+
occurred_at: Schema.Number
|
|
8123
|
+
})
|
|
8124
|
+
});
|
|
8125
|
+
Schema.Struct({
|
|
8126
|
+
name: Schema.Literal("invoice_issued"),
|
|
8127
|
+
props: Schema.Struct({
|
|
8128
|
+
...TelemetryEnvelopeProps,
|
|
8129
|
+
request_id: Schema.String,
|
|
8130
|
+
issuer_scope_kind: ScopeKindSchema,
|
|
8131
|
+
issuer_scope_id: Schema.String,
|
|
8132
|
+
payer_party_id: OptionalString,
|
|
8133
|
+
occurred_at: Schema.Number
|
|
8134
|
+
})
|
|
8135
|
+
});
|
|
8136
|
+
Schema.Struct({
|
|
8137
|
+
name: Schema.Literal("invoice_request_transitioned"),
|
|
8138
|
+
props: Schema.Struct({
|
|
8139
|
+
...TelemetryEnvelopeProps,
|
|
8140
|
+
request_id: Schema.String,
|
|
8141
|
+
transition: Schema.Literals([
|
|
8142
|
+
"approval_prepared",
|
|
8143
|
+
"declined",
|
|
8144
|
+
"cancelled"
|
|
8145
|
+
]),
|
|
8146
|
+
actor_scope_kind: ScopeKindSchema,
|
|
8147
|
+
actor_scope_id: Schema.String,
|
|
8148
|
+
occurred_at: Schema.Number
|
|
8149
|
+
})
|
|
8150
|
+
});
|
|
8151
|
+
Schema.Struct({
|
|
8152
|
+
name: Schema.Literal("ui_invoice_step_completed"),
|
|
8153
|
+
props: Schema.Struct({
|
|
8154
|
+
...UiStepProps,
|
|
8155
|
+
step: Schema.Literals([
|
|
8156
|
+
"opened",
|
|
8157
|
+
"previewed",
|
|
8158
|
+
"dismissed",
|
|
8159
|
+
"submitted",
|
|
8160
|
+
"result_displayed",
|
|
8161
|
+
"refusal_displayed",
|
|
8162
|
+
"retry_selected"
|
|
8163
|
+
]),
|
|
8164
|
+
request_id: OptionalString
|
|
8165
|
+
})
|
|
8166
|
+
});
|
|
8167
|
+
Schema.Struct({
|
|
8168
|
+
name: Schema.Literal("ui_treasury_step_completed"),
|
|
8169
|
+
props: Schema.Struct({
|
|
8170
|
+
...UiStepProps,
|
|
8171
|
+
step: Schema.Literals([
|
|
8172
|
+
"balance_displayed",
|
|
8173
|
+
"read_refusal_displayed",
|
|
8174
|
+
"retry_selected",
|
|
8175
|
+
"recovery_completed"
|
|
8176
|
+
]),
|
|
8177
|
+
account_kind: Schema.optional(AccountKindSchema)
|
|
8178
|
+
})
|
|
8179
|
+
});
|
|
8180
|
+
Schema.Struct({
|
|
8181
|
+
name: Schema.Literal("ui_receive_step_completed"),
|
|
8182
|
+
props: Schema.Struct({
|
|
8183
|
+
...UiStepProps,
|
|
8184
|
+
step: Schema.Literals([
|
|
8185
|
+
"instructions_displayed",
|
|
8186
|
+
"address_copied",
|
|
8187
|
+
"copy_failed",
|
|
8188
|
+
"refusal_displayed",
|
|
8189
|
+
"retry_selected"
|
|
8190
|
+
]),
|
|
8191
|
+
account_kind: Schema.optional(AccountKindSchema)
|
|
8192
|
+
})
|
|
8193
|
+
});
|
|
8194
|
+
Schema.Struct({
|
|
8195
|
+
name: Schema.Literal("payroll_group_changed"),
|
|
8196
|
+
props: Schema.Struct({
|
|
8197
|
+
...TelemetryEnvelopeProps,
|
|
8198
|
+
organization_id: OrgIdTelemetrySchema,
|
|
8199
|
+
change: Schema.Literals([
|
|
8200
|
+
"created",
|
|
8201
|
+
"updated",
|
|
8202
|
+
"deleted"
|
|
8203
|
+
]),
|
|
8204
|
+
group_id: Schema.String,
|
|
8205
|
+
member_count: Schema.Number,
|
|
8206
|
+
occurred_at: Schema.Number
|
|
8207
|
+
})
|
|
8208
|
+
});
|
|
8209
|
+
Schema.Struct({
|
|
8210
|
+
name: Schema.Literal("payroll_run_transitioned"),
|
|
8211
|
+
props: Schema.Struct({
|
|
8212
|
+
...TelemetryEnvelopeProps,
|
|
8213
|
+
organization_id: OrgIdTelemetrySchema,
|
|
8214
|
+
transition: Schema.Literals([
|
|
8215
|
+
"prepared",
|
|
8216
|
+
"authorized",
|
|
8217
|
+
"settled"
|
|
8218
|
+
]),
|
|
8219
|
+
run_id: Schema.String,
|
|
8220
|
+
payment_count: Schema.optional(Schema.Number),
|
|
8221
|
+
occurred_at: Schema.Number
|
|
8222
|
+
})
|
|
8223
|
+
});
|
|
8224
|
+
Schema.Struct({
|
|
8225
|
+
name: Schema.Literal("ui_payroll_action_completed"),
|
|
8226
|
+
props: Schema.Struct({
|
|
8227
|
+
...UiStepProps,
|
|
8228
|
+
action: Schema.Literals([
|
|
8229
|
+
"opened",
|
|
8230
|
+
"refusal_displayed",
|
|
8231
|
+
"recovery_completed",
|
|
8232
|
+
"cancelled",
|
|
8233
|
+
"submitted_displayed"
|
|
8234
|
+
]),
|
|
8235
|
+
run_id: OptionalString
|
|
8236
|
+
})
|
|
8237
|
+
});
|
|
8033
8238
|
function redactTelemetryProps(name, props, options = {}) {
|
|
8034
8239
|
if (props === void 0) return void 0;
|
|
8035
8240
|
const clone = cloneProps$1(props);
|
|
@@ -12046,7 +12251,7 @@ const moneyExecutionContract = {
|
|
|
12046
12251
|
};
|
|
12047
12252
|
//#endregion
|
|
12048
12253
|
//#region ../../packages/sdk/package.json
|
|
12049
|
-
var version$1 = "4.2.0-rc.
|
|
12254
|
+
var version$1 = "4.2.0-rc.4";
|
|
12050
12255
|
//#endregion
|
|
12051
12256
|
//#region ../../packages/sdk/src/telemetry/exception-projection.ts
|
|
12052
12257
|
/** Fixed fallback for failures that have no safe message. */
|
|
@@ -12219,6 +12424,34 @@ function ignoreDeliveryFailure(delivery) {
|
|
|
12219
12424
|
Promise.resolve(delivery).catch(() => void 0);
|
|
12220
12425
|
} catch {}
|
|
12221
12426
|
}
|
|
12427
|
+
/**
|
|
12428
|
+
* Fold a caller-captured attempt identity into the host's resolved context.
|
|
12429
|
+
*
|
|
12430
|
+
* The host's `resolveContext` runs at the moment an SDK method is entered, so a
|
|
12431
|
+
* host that mints a correlation per resolve gives every operation of one user
|
|
12432
|
+
* attempt a different identity — and a user or Organization switch between the
|
|
12433
|
+
* click and the reply relabels an action that already started. When the caller
|
|
12434
|
+
* captured `correlation_id`/`journey_id` BEFORE the action started, that is the
|
|
12435
|
+
* attempt, and it replaces what the resolver returned for this one call. The
|
|
12436
|
+
* result is what the SDK span/Log, the failure envelope and the backend carrier
|
|
12437
|
+
* all read, so the three agree by construction rather than by convention.
|
|
12438
|
+
*
|
|
12439
|
+
* A caller that captured nothing gets the resolver's context unchanged, so
|
|
12440
|
+
* automatic reads keep their own invocation context.
|
|
12441
|
+
*/
|
|
12442
|
+
function withCapturedAttemptContext(context, controls) {
|
|
12443
|
+
const correlationId = controls?.correlation_id;
|
|
12444
|
+
const journeyId = controls?.journey_id;
|
|
12445
|
+
if (correlationId === void 0 && journeyId === void 0) return context;
|
|
12446
|
+
const captured = sanitizeObservationContext({
|
|
12447
|
+
...correlationId === void 0 ? {} : { correlationId },
|
|
12448
|
+
...journeyId === void 0 ? {} : { journeyId }
|
|
12449
|
+
});
|
|
12450
|
+
return captured === void 0 ? context : {
|
|
12451
|
+
...context,
|
|
12452
|
+
...captured
|
|
12453
|
+
};
|
|
12454
|
+
}
|
|
12222
12455
|
const MAX_EVIDENCE_TEXT = 4e3;
|
|
12223
12456
|
const MAX_CAUSE_DEPTH = 8;
|
|
12224
12457
|
function evidenceText(value) {
|
|
@@ -19418,6 +19651,32 @@ var ConsoleDiagnosticAdapter = class {
|
|
|
19418
19651
|
}
|
|
19419
19652
|
};
|
|
19420
19653
|
//#endregion
|
|
19654
|
+
//#region ../../packages/sdk/src/adapters/diagnostic/EffectLogDiagnosticAdapter.ts
|
|
19655
|
+
/**
|
|
19656
|
+
* Diagnostic breadcrumbs as SDK log records. The signer's readiness cycle
|
|
19657
|
+
* traces (`openfort.*`) used to reach only the browser console; through this
|
|
19658
|
+
* adapter they run in the client's own Effect context, so the engineering
|
|
19659
|
+
* telemetry layer ships them to PostHog Logs beside `identity.transition`.
|
|
19660
|
+
* Logging never throws back into the cycle that emitted it.
|
|
19661
|
+
*/
|
|
19662
|
+
var EffectLogDiagnosticAdapter = class {
|
|
19663
|
+
#runPromise;
|
|
19664
|
+
#console;
|
|
19665
|
+
constructor(context, consoleFallback) {
|
|
19666
|
+
this.#runPromise = Effect.runPromiseWith(context);
|
|
19667
|
+
this.#console = consoleFallback;
|
|
19668
|
+
}
|
|
19669
|
+
trace(scope, detail) {
|
|
19670
|
+
this.#console?.trace(scope, detail);
|
|
19671
|
+
try {
|
|
19672
|
+
this.#runPromise(Effect.logInfo(scope).pipe(Effect.annotateLogs({
|
|
19673
|
+
...detail,
|
|
19674
|
+
diagnostic_scope: scope
|
|
19675
|
+
}), Effect.catchCause(() => Effect.void))).catch(() => void 0);
|
|
19676
|
+
} catch {}
|
|
19677
|
+
}
|
|
19678
|
+
};
|
|
19679
|
+
//#endregion
|
|
19421
19680
|
//#region ../../node_modules/.pnpm/axios@1.17.0/node_modules/axios/lib/helpers/bind.js
|
|
19422
19681
|
/**
|
|
19423
19682
|
* Create a bound version of a function with a specified `this` context
|
|
@@ -42502,7 +42761,23 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
42502
42761
|
function encryptionSessionUrl() {
|
|
42503
42762
|
return `${authBaseUrl}/encryption-session`;
|
|
42504
42763
|
}
|
|
42764
|
+
let cycleStartedAt = null;
|
|
42765
|
+
let stepStartedAt = 0;
|
|
42766
|
+
let tokenCalls = 0;
|
|
42767
|
+
const sinceCycleStart = () => cycleStartedAt === null ? void 0 : Date.now() - cycleStartedAt;
|
|
42768
|
+
const step = (name, extra = {}) => {
|
|
42769
|
+
const now = Date.now();
|
|
42770
|
+
diagnostic?.trace("openfort.step", {
|
|
42771
|
+
step: name,
|
|
42772
|
+
duration_ms: now - stepStartedAt,
|
|
42773
|
+
elapsed_ms: sinceCycleStart(),
|
|
42774
|
+
...extra
|
|
42775
|
+
});
|
|
42776
|
+
stepStartedAt = now;
|
|
42777
|
+
};
|
|
42505
42778
|
async function fetchBetterAuthAccessToken() {
|
|
42779
|
+
tokenCalls += 1;
|
|
42780
|
+
const tokenStartedAt = Date.now();
|
|
42506
42781
|
try {
|
|
42507
42782
|
const response = await fetch(betterAuthSessionUrl(), { credentials: "include" });
|
|
42508
42783
|
if (!response.ok) {
|
|
@@ -42525,7 +42800,10 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
42525
42800
|
}
|
|
42526
42801
|
diagnostic?.trace("openfort.token", {
|
|
42527
42802
|
ok: true,
|
|
42528
|
-
tokenPresent: true
|
|
42803
|
+
tokenPresent: true,
|
|
42804
|
+
call: tokenCalls,
|
|
42805
|
+
duration_ms: Date.now() - tokenStartedAt,
|
|
42806
|
+
elapsed_ms: sinceCycleStart()
|
|
42529
42807
|
});
|
|
42530
42808
|
return token;
|
|
42531
42809
|
} catch (cause) {
|
|
@@ -42581,10 +42859,16 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
42581
42859
|
let walletReadyPromise = null;
|
|
42582
42860
|
function startWalletReady() {
|
|
42583
42861
|
return (async () => {
|
|
42862
|
+
const startedAt = Date.now();
|
|
42863
|
+
cycleStartedAt = startedAt;
|
|
42864
|
+
stepStartedAt = startedAt;
|
|
42865
|
+
tokenCalls = 0;
|
|
42584
42866
|
if (isInsecureBrowserContext()) failNoSecureContext();
|
|
42585
42867
|
await openfort.waitForInitialization();
|
|
42868
|
+
step("initialize");
|
|
42586
42869
|
const accessToken = await fetchBetterAuthAccessToken();
|
|
42587
42870
|
if (accessToken === null) throw openfortProviderError("token", /* @__PURE__ */ new Error("Better Auth access token unavailable for Openfort"));
|
|
42871
|
+
step("token");
|
|
42588
42872
|
let encryptionResponse;
|
|
42589
42873
|
try {
|
|
42590
42874
|
encryptionResponse = await fetch(encryptionSessionUrl(), {
|
|
@@ -42627,10 +42911,12 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
42627
42911
|
ok: true,
|
|
42628
42912
|
httpStatus: encryptionResponse.status
|
|
42629
42913
|
});
|
|
42914
|
+
step("encryptionSession", { httpStatus: encryptionResponse.status });
|
|
42630
42915
|
let embeddedState;
|
|
42631
42916
|
try {
|
|
42632
42917
|
embeddedState = await openfort.embeddedWallet.getEmbeddedState();
|
|
42633
42918
|
diagnostic?.trace("openfort.embeddedState", { state: embeddedState });
|
|
42919
|
+
step("embeddedState", { state: embeddedState });
|
|
42634
42920
|
} catch (cause) {
|
|
42635
42921
|
diagnostic?.trace("openfort.embeddedState", {
|
|
42636
42922
|
ok: false,
|
|
@@ -42644,6 +42930,7 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
42644
42930
|
try {
|
|
42645
42931
|
await configureEmbeddedWallet(encryptionBody.sessionId);
|
|
42646
42932
|
diagnostic?.trace("openfort.configure", { ok: true });
|
|
42933
|
+
step("configure");
|
|
42647
42934
|
} catch (cause) {
|
|
42648
42935
|
const error = openfortProviderError("configure", cause);
|
|
42649
42936
|
diagnostic?.trace("openfort.configure", {
|
|
@@ -42656,6 +42943,7 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
42656
42943
|
try {
|
|
42657
42944
|
await openfort.embeddedWallet.get();
|
|
42658
42945
|
diagnostic?.trace("openfort.get", { ok: true });
|
|
42946
|
+
step("get");
|
|
42659
42947
|
} catch (cause) {
|
|
42660
42948
|
if (!isStaleUserSignal(cause)) {
|
|
42661
42949
|
diagnostic?.trace("openfort.get", {
|
|
@@ -42669,7 +42957,13 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
42669
42957
|
failure_mode: "stale-openfort-cache"
|
|
42670
42958
|
});
|
|
42671
42959
|
await healStaleOpenfortCache(encryptionBody.sessionId);
|
|
42960
|
+
step("healStaleCache");
|
|
42672
42961
|
}
|
|
42962
|
+
step("walletReady", {
|
|
42963
|
+
ok: true,
|
|
42964
|
+
total_ms: Date.now() - startedAt,
|
|
42965
|
+
token_calls: tokenCalls
|
|
42966
|
+
});
|
|
42673
42967
|
})();
|
|
42674
42968
|
}
|
|
42675
42969
|
async function ensureOpenfortWalletReady() {
|
|
@@ -42752,9 +43046,13 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
42752
43046
|
statusStore,
|
|
42753
43047
|
ensureWalletReady: ensureOpenfortWalletReady,
|
|
42754
43048
|
getAddress: async () => {
|
|
43049
|
+
const addressStartedAt = Date.now();
|
|
42755
43050
|
try {
|
|
42756
43051
|
const address = await signer.getAddress();
|
|
42757
|
-
diagnostic?.trace("openfort.address", {
|
|
43052
|
+
diagnostic?.trace("openfort.address", {
|
|
43053
|
+
ok: true,
|
|
43054
|
+
duration_ms: Date.now() - addressStartedAt
|
|
43055
|
+
});
|
|
42758
43056
|
return address;
|
|
42759
43057
|
} catch (cause) {
|
|
42760
43058
|
diagnostic?.trace("openfort.address", {
|
|
@@ -45793,10 +46091,13 @@ function assembleCapxulClient(input) {
|
|
|
45793
46091
|
...input.invokeTimeoutMs === void 0 ? {} : { invokeTimeoutMs: input.invokeTimeoutMs },
|
|
45794
46092
|
afterVerifyOtp: async () => {
|
|
45795
46093
|
const browserSigner = input.signer;
|
|
45796
|
-
if (browserSigner !== void 0 && "resetSession" in browserSigner && typeof browserSigner.resetSession === "function")
|
|
45797
|
-
|
|
45798
|
-
|
|
45799
|
-
|
|
46094
|
+
if (browserSigner !== void 0 && "resetSession" in browserSigner && typeof browserSigner.resetSession === "function") {
|
|
46095
|
+
try {
|
|
46096
|
+
browserSigner.resetSession();
|
|
46097
|
+
} catch (cause) {
|
|
46098
|
+
throw signerFailure(browserSigner.source, "resetSession", cause);
|
|
46099
|
+
}
|
|
46100
|
+
if (browserSigner.statusStore?.status() === "unknown" && typeof browserSigner.ensureWalletReady === "function") browserSigner.ensureWalletReady().catch(() => {});
|
|
45800
46101
|
}
|
|
45801
46102
|
await detectPendingOrgInvitations?.();
|
|
45802
46103
|
kickProvisioning?.();
|
|
@@ -46015,8 +46316,10 @@ function withHostObservationControls(snapshot, input, actorId) {
|
|
|
46015
46316
|
const previous = readInvocationObservation(input);
|
|
46016
46317
|
if (previous !== void 0) return attachInvocationObservation({ ...input }, previous);
|
|
46017
46318
|
const captured = snapshot?.() ?? { active: true };
|
|
46319
|
+
const context = captured.active ? withCapturedAttemptContext(captured.context, input) : captured.context;
|
|
46018
46320
|
return attachInvocationObservation({ ...input }, {
|
|
46019
46321
|
...captured,
|
|
46322
|
+
...context === void 0 ? {} : { context },
|
|
46020
46323
|
...actorId === void 0 ? {} : { actorId }
|
|
46021
46324
|
});
|
|
46022
46325
|
}
|
|
@@ -46619,7 +46922,7 @@ async function createCapxulClientWithSignerControls(input, controls) {
|
|
|
46619
46922
|
...adapters.value.bootstrap,
|
|
46620
46923
|
authBaseUrl: resolvedAuthBaseUrl
|
|
46621
46924
|
}, {
|
|
46622
|
-
diagnostic: new ConsoleDiagnosticAdapter(),
|
|
46925
|
+
diagnostic: new EffectLogDiagnosticAdapter(adapters.value.context, new ConsoleDiagnosticAdapter()),
|
|
46623
46926
|
signUserOpHash: controls.signEmbeddedUserOpHash
|
|
46624
46927
|
});
|
|
46625
46928
|
signer = withSignerControl(signer, controls.signUserOpHash);
|
|
@@ -47435,7 +47738,7 @@ function stdioIdentity(env = process.env, options = {}) {
|
|
|
47435
47738
|
}
|
|
47436
47739
|
//#endregion
|
|
47437
47740
|
//#region package.json
|
|
47438
|
-
var version = "4.2.0-rc.
|
|
47741
|
+
var version = "4.2.0-rc.4";
|
|
47439
47742
|
//#endregion
|
|
47440
47743
|
//#region src/deps.ts
|
|
47441
47744
|
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.4",
|
|
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": [
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
51
51
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.3.0",
|
|
52
52
|
"vite-plus": "0.3.0",
|
|
53
|
+
"@capxul/sdk": "4.2.0-rc.4",
|
|
53
54
|
"@capxul/config": "0.3.0",
|
|
54
|
-
"@capxul/sdk": "4.2.0-rc.3",
|
|
55
55
|
"@capxul/typescript-config": "0.0.0"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|