@capxul/sandbox 4.20.0-beta.10 → 4.20.0-beta.11

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.
Files changed (2) hide show
  1. package/dist/main.mjs +128 -49
  2. package/package.json +2 -2
package/dist/main.mjs CHANGED
@@ -24,8 +24,8 @@ const EVENT_TAGS = [
24
24
  "RetryAccount",
25
25
  "CreateOrganization",
26
26
  "AttachOrganization",
27
- "RetryOrganization",
28
- "LeaveOrganization"
27
+ "LeaveOrganization",
28
+ "ObserveOrganization"
29
29
  ];
30
30
  const PRIVATE_EVENT_TAGS = [
31
31
  "OtpSent",
@@ -41,9 +41,8 @@ const PRIVATE_EVENT_TAGS = [
41
41
  "AccountClaiming",
42
42
  "AccountClaimed",
43
43
  "AccountFailed",
44
- "OrgAt",
45
- "OrgReady",
46
- "OrgFailed"
44
+ "OrgSelected",
45
+ "OrgSelectionFailed"
47
46
  ];
48
47
  const IDENTITY_EVENT_TAGS = [...EVENT_TAGS, ...PRIVATE_EVENT_TAGS];
49
48
  /** Valid in every `authenticated:*` position — the pre-S1 auth machine's row. */
@@ -52,7 +51,7 @@ const SESSION_EVENTS = [
52
51
  "SignOut",
53
52
  "Reset"
54
53
  ];
55
- [...SESSION_EVENTS], [...SESSION_EVENTS], [...SESSION_EVENTS], [...SESSION_EVENTS], [...SESSION_EVENTS], [...SESSION_EVENTS], [...SESSION_EVENTS], [...SESSION_EVENTS], [...SESSION_EVENTS], [...SESSION_EVENTS], [...SESSION_EVENTS];
54
+ [...SESSION_EVENTS], [...SESSION_EVENTS], [...SESSION_EVENTS], [...SESSION_EVENTS], [...SESSION_EVENTS], [...SESSION_EVENTS], [...SESSION_EVENTS];
56
55
  new Set(PRIVATE_EVENT_TAGS);
57
56
  //#endregion
58
57
  //#region ../../packages/errors/src/secret-material.ts
@@ -1067,6 +1066,38 @@ const gen$2 = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blo
1067
1066
  /** keccak-256 hash function. Different from SHA3-256. */
1068
1067
  const keccak_256 = /* @__PURE__ */ (() => gen$2(1, 136, 32))();
1069
1068
  //#endregion
1069
+ //#region ../../packages/types/src/organization-setup.ts
1070
+ /** Backend-owned Organization setup states shared by wire and telemetry. */
1071
+ const ORGANIZATION_SETUP_STATUSES = [
1072
+ "awaitingAuthorization",
1073
+ "processing",
1074
+ "needsAttention",
1075
+ "ready",
1076
+ "rechecking",
1077
+ "failed"
1078
+ ];
1079
+ /** Closed reasons for a stored Organization setup issue. */
1080
+ const ORGANIZATION_SETUP_REASONS = [
1081
+ "submission_unknown",
1082
+ "receipt_unresolved",
1083
+ "provider_unavailable",
1084
+ "receipt_reverted",
1085
+ "deterministic_address_mismatch",
1086
+ "receipt_mismatch",
1087
+ "block_identity_changed",
1088
+ "authority_event_mismatch",
1089
+ "allowance_timestamp_mismatch",
1090
+ "receipt_identity_unavailable",
1091
+ "receipt_identity_mismatch",
1092
+ "contract_code_unavailable",
1093
+ "contract_state_mismatch",
1094
+ "permission_projection_mismatch",
1095
+ "bootstrap_reorg",
1096
+ "dependent_authority_unresolved",
1097
+ "historical_evidence_missing",
1098
+ "worker_failed"
1099
+ ];
1100
+ //#endregion
1070
1101
  //#region ../../packages/types/src/index.ts
1071
1102
  const ASSET_ID_RE = /^eip155:([1-9][0-9]*)\/erc20:(0x[0-9a-f]{40})$/;
1072
1103
  const EVM_ADDRESS_RE$1 = /^0x[0-9a-f]{40}$/i;
@@ -15602,8 +15633,8 @@ const TelemetryEnvelopeProps = {
15602
15633
  * failure came from the chain path. Spread into every failure event and posted
15603
15634
  * on `$exception`, so one PostHog filter finds a cause wherever it was seen.
15604
15635
  */
15605
- const FailureModeSchema = Literals(FAILURE_MODES$1);
15606
- const ChainUpstreamSchema = Literals(CHAIN_UPSTREAMS);
15636
+ const FailureModeSchema$1 = Literals(FAILURE_MODES$1);
15637
+ const ChainUpstreamSchema$1 = Literals(CHAIN_UPSTREAMS);
15607
15638
  /**
15608
15639
  * The refusing upstream's response headers (#1818): exactly the names in
15609
15640
  * `RESPONSE_HEADER_ALLOWLIST`, each optional, so the catalog itself refuses a
@@ -15621,15 +15652,15 @@ const ResponseHeadersSchema = Struct({
15621
15652
  });
15622
15653
  /** One upstream tried, flat (#1818): the `chain_attempts` entry on every producer's row. */
15623
15654
  const ChainAttemptSchema = Struct({
15624
- upstream: ChainUpstreamSchema,
15625
- failure_mode: FailureModeSchema,
15655
+ upstream: ChainUpstreamSchema$1,
15656
+ failure_mode: FailureModeSchema$1,
15626
15657
  http_status: optional(Number$1),
15627
15658
  rpc_code: optional(Number$1),
15628
15659
  duration_ms: Number$1
15629
15660
  });
15630
15661
  const ChainCauseTelemetryProps = {
15631
- failure_mode: optional(FailureModeSchema),
15632
- chain_upstream: optional(ChainUpstreamSchema),
15662
+ failure_mode: optional(FailureModeSchema$1),
15663
+ chain_upstream: optional(ChainUpstreamSchema$1),
15633
15664
  chain_method: OptionalString,
15634
15665
  chain_retryable: optional(Boolean),
15635
15666
  chain_http_status: optional(Number$1),
@@ -15813,9 +15844,9 @@ const ChainUpstreamFallbackProps = Struct({
15813
15844
  ...TelemetryEnvelopeProps,
15814
15845
  service: ChainServiceSchema,
15815
15846
  method: String$1,
15816
- from_upstream: ChainUpstreamSchema,
15817
- to_upstream: optional(ChainUpstreamSchema),
15818
- failure_mode: FailureModeSchema,
15847
+ from_upstream: ChainUpstreamSchema$1,
15848
+ to_upstream: optional(ChainUpstreamSchema$1),
15849
+ failure_mode: FailureModeSchema$1,
15819
15850
  exhausted: Boolean,
15820
15851
  http_status: optional(Number$1),
15821
15852
  rpc_code: optional(Number$1),
@@ -15824,8 +15855,8 @@ const ChainUpstreamFallbackProps = Struct({
15824
15855
  const BundlerErrorProps = Struct({
15825
15856
  ...TelemetryEnvelopeProps,
15826
15857
  method: String$1,
15827
- failure_mode: FailureModeSchema,
15828
- chain_upstream: ChainUpstreamSchema,
15858
+ failure_mode: FailureModeSchema$1,
15859
+ chain_upstream: ChainUpstreamSchema$1,
15829
15860
  chain_retryable: Boolean,
15830
15861
  http_status: optional(Number$1),
15831
15862
  rpc_code: optional(Number$1),
@@ -15836,13 +15867,13 @@ const ReceiptPendingProps = Struct({
15836
15867
  ...TelemetryEnvelopeProps,
15837
15868
  service: ChainServiceSchema,
15838
15869
  method: String$1,
15839
- chain_upstream: ChainUpstreamSchema,
15870
+ chain_upstream: ChainUpstreamSchema$1,
15840
15871
  reason: Literals(["zero_block_hash", "no_receipt"])
15841
15872
  });
15842
15873
  const OperationRetriedProps = Struct({
15843
15874
  ...TelemetryEnvelopeProps,
15844
15875
  operation: String$1,
15845
- failure_mode: FailureModeSchema,
15876
+ failure_mode: FailureModeSchema$1,
15846
15877
  reason: optional(Literal("connection-lost-in-flight")),
15847
15878
  connection_id: OptionalString,
15848
15879
  connection_count: optional(Number$1),
@@ -15883,14 +15914,16 @@ const OrganizationCreationStartedProps = Struct({
15883
15914
  ...TelemetryEnvelopeProps,
15884
15915
  $insert_id: String$1,
15885
15916
  organization_id: OrgIdTelemetrySchema,
15886
- attempt_number: AttemptNumberSchema
15917
+ attempt_number: AttemptNumberSchema,
15918
+ release: optional(String$1.check(isPattern(/^[0-9a-f]{40}$/u)))
15887
15919
  });
15888
15920
  const OrganizationCreationReadyProps = Struct({
15889
15921
  ...TelemetryEnvelopeProps,
15890
15922
  $insert_id: String$1,
15891
15923
  organization_id: OrgIdTelemetrySchema,
15892
15924
  attempt_number: AttemptNumberSchema,
15893
- duration_ms: DurationMsSchema$1
15925
+ duration_ms: DurationMsSchema$1,
15926
+ release: optional(String$1.check(isPattern(/^[0-9a-f]{40}$/u)))
15894
15927
  });
15895
15928
  const OrganizationCreationFailedProps = Struct({
15896
15929
  ...TelemetryEnvelopeProps,
@@ -15901,20 +15934,13 @@ const OrganizationCreationFailedProps = Struct({
15901
15934
  stage: OnboardingStageSchema,
15902
15935
  error_code: String$1,
15903
15936
  retryable: Boolean,
15937
+ release: optional(String$1.check(isPattern(/^[0-9a-f]{40}$/u))),
15904
15938
  /** #1655: the SDK's backoff before this attempt. Absent on the first attempt. */
15905
15939
  backoff_ms: optional(DurationMsSchema$1),
15906
15940
  failure_reason: optional(Literals([
15907
- "deterministic_address_mismatch",
15908
15941
  "receipt_provider_unavailable",
15909
- "receipt_mismatch",
15910
15942
  "block_provider_unavailable",
15911
- "authority_event_mismatch",
15912
- "allowance_timestamp_mismatch",
15913
- "receipt_identity_unavailable",
15914
- "receipt_identity_mismatch",
15915
- "contract_code_unavailable",
15916
- "contract_state_mismatch",
15917
- "permission_projection_mismatch"
15943
+ ...ORGANIZATION_SETUP_REASONS
15918
15944
  ]))
15919
15945
  });
15920
15946
  const OnboardingIntentSchema = Literals(["personal", "organization"]);
@@ -16671,12 +16697,17 @@ Struct({
16671
16697
  "cancelled"
16672
16698
  ]),
16673
16699
  duration_ms: Number$1,
16700
+ organization_id: optional(OrgIdTelemetrySchema),
16701
+ setup_status: optional(Literals(ORGANIZATION_SETUP_STATUSES)),
16702
+ setup_reason: optional(Literals(ORGANIZATION_SETUP_REASONS)),
16703
+ $groups: optional(Struct({ organization: OrgIdTelemetrySchema })),
16674
16704
  error_code: optional(Literals([
16675
16705
  ...CAPXUL_ERROR_CODES,
16676
16706
  "CLI_USAGE",
16677
16707
  "CLI_CONFIG",
16678
16708
  "CLI_STORAGE",
16679
- "CLI_DEFECT"
16709
+ "CLI_DEFECT",
16710
+ "CLI_DEADLINE"
16680
16711
  ]))
16681
16712
  })
16682
16713
  });
@@ -17170,14 +17201,7 @@ const CAPXUL_FUNCTIONS = {
17170
17201
  setOrgLogo: "media:setOrgLogo",
17171
17202
  setProfileImage: "media:setProfileImage"
17172
17203
  },
17173
- "org/actions": {
17174
- confirmBootstrap: "org/actions:confirmBootstrap",
17175
- prepareBootstrap: "org/actions:prepareBootstrap",
17176
- prepareFounderAccount: "org/actions:prepareFounderAccount",
17177
- readTreasury: "org/actions:readTreasury",
17178
- resumeBootstrapSubmission: "org/actions:resumeBootstrapSubmission",
17179
- submitBootstrap: "org/actions:submitBootstrap"
17180
- },
17204
+ "org/actions": { readTreasury: "org/actions:readTreasury" },
17181
17205
  "payroll/actions": { authorizeRun: "payroll/actions:authorizeRun" },
17182
17206
  "payroll/mutations": {
17183
17207
  removeGroup: "payroll/mutations:removeGroup",
@@ -17194,17 +17218,18 @@ const CAPXUL_FUNCTIONS = {
17194
17218
  authorize: "permission/queries:authorize",
17195
17219
  read: "permission/queries:read"
17196
17220
  },
17197
- "org/lifecycle": {
17198
- getProofReceipt: "org/lifecycle:getProofReceipt",
17199
- load: "org/lifecycle:load",
17200
- recordFailure: "org/lifecycle:recordFailure",
17201
- retry: "org/lifecycle:retry",
17202
- startOrResume: "org/lifecycle:startOrResume"
17221
+ "org/setup": {
17222
+ begin: "org/setup:begin",
17223
+ get: "org/setup:get",
17224
+ getProofReceipt: "org/setup:getProofReceipt",
17225
+ listMine: "org/setup:listMine",
17226
+ prepareAuthorization: "org/setup:prepareAuthorization",
17227
+ resume: "org/setup:resume",
17228
+ submitAuthorization: "org/setup:submitAuthorization"
17203
17229
  },
17204
17230
  "org/mutations": {
17205
17231
  accept: "org/mutations:accept",
17206
17232
  cancel: "org/mutations:cancel",
17207
- createOrg: "org/mutations:createOrg",
17208
17233
  decline: "org/mutations:decline",
17209
17234
  invite: "org/mutations:invite",
17210
17235
  resend: "org/mutations:resend",
@@ -17325,6 +17350,60 @@ const CLIENT_AUTHORIZATION_REFUSALS = [
17325
17350
  "revoke_unconfirmed"
17326
17351
  ];
17327
17352
  //#endregion
17353
+ //#region ../../packages/wire/src/organization-setup.ts
17354
+ const FailureModeSchema = Literals(FAILURE_MODES$1);
17355
+ const ChainUpstreamSchema = Literals(CHAIN_UPSTREAMS);
17356
+ const ChainCauseSchema = Struct({
17357
+ mode: FailureModeSchema,
17358
+ upstream: ChainUpstreamSchema,
17359
+ method: String$1,
17360
+ retryable: Boolean,
17361
+ httpStatus: optional(Number$1),
17362
+ rpcCode: optional(Number$1),
17363
+ revert: optional(Struct({
17364
+ name: NullOr(String$1),
17365
+ selector: String$1,
17366
+ args: Record(String$1, String$1)
17367
+ })),
17368
+ providerMessage: optional(String$1),
17369
+ attempts: optional(ArraySchema(Struct({
17370
+ upstream: ChainUpstreamSchema,
17371
+ mode: FailureModeSchema,
17372
+ httpStatus: optional(Number$1),
17373
+ rpcCode: optional(Number$1),
17374
+ durationMs: Number$1
17375
+ }))),
17376
+ responseHeaders: optional(Record(String$1, String$1))
17377
+ });
17378
+ const ErrorSchema = Struct({
17379
+ code: Literals(CAPXUL_ERROR_CODES),
17380
+ message: String$1,
17381
+ details: optional(Record(String$1, Unknown)),
17382
+ correlationId: optional(String$1),
17383
+ layer: optional(String$1),
17384
+ mode: optional(FailureModeSchema),
17385
+ chain: optional(ChainCauseSchema)
17386
+ });
17387
+ const OrganizationSetupIssueSchema = Struct({
17388
+ reason: Literals(ORGANIZATION_SETUP_REASONS),
17389
+ error: optional(ErrorSchema)
17390
+ });
17391
+ Struct({
17392
+ orgId: String$1,
17393
+ status: Literals(ORGANIZATION_SETUP_STATUSES),
17394
+ completedAt: NullOr(Number$1),
17395
+ lastCheckedAt: NullOr(Number$1),
17396
+ nextCheckAt: NullOr(Number$1),
17397
+ issue: NullOr(OrganizationSetupIssueSchema),
17398
+ lastSendIssue: NullOr(OrganizationSetupIssueSchema),
17399
+ recovery: Literals([
17400
+ "authorize",
17401
+ "checkAgain",
17402
+ "none"
17403
+ ]),
17404
+ phase: optional(Literals(["resolvingSubmission", "confirmingBootstrap"]))
17405
+ });
17406
+ //#endregion
17328
17407
  //#region ../../packages/wire/src/payment-document.ts
17329
17408
  const UINT256_MAX = 2n ** 256n - 1n;
17330
17409
  const INT256_MIN = -(2n ** 255n);
@@ -20301,7 +20380,7 @@ makeFunctionReference(CAPXUL_FUNCTIONS["smartAccount/queries"].loadByAuthUserId)
20301
20380
  TaggedError("OrgError");
20302
20381
  Service()("@capxul/sdk/ports/OrgPort");
20303
20382
  makeFunctionReference(CAPXUL_FUNCTIONS["org/queries"].listAll), makeFunctionReference(CAPXUL_FUNCTIONS["org/queries"].listRolesByOrgId), makeFunctionReference(CAPXUL_FUNCTIONS["org/queries"].listMembersByOrgId), makeFunctionReference(CAPXUL_FUNCTIONS["org/actions"].readTreasury);
20304
- makeFunctionReference(CAPXUL_FUNCTIONS["org/lifecycle"].startOrResume), makeFunctionReference(CAPXUL_FUNCTIONS["org/actions"].prepareFounderAccount), makeFunctionReference(CAPXUL_FUNCTIONS["org/actions"].prepareBootstrap), makeFunctionReference(CAPXUL_FUNCTIONS["org/actions"].submitBootstrap), makeFunctionReference(CAPXUL_FUNCTIONS["org/actions"].resumeBootstrapSubmission), makeFunctionReference(CAPXUL_FUNCTIONS["org/actions"].confirmBootstrap), makeFunctionReference(CAPXUL_FUNCTIONS["org/lifecycle"].recordFailure), makeFunctionReference(CAPXUL_FUNCTIONS["org/lifecycle"].load), makeFunctionReference(CAPXUL_FUNCTIONS["org/lifecycle"].retry);
20383
+ makeFunctionReference(CAPXUL_FUNCTIONS["org/setup"].begin), makeFunctionReference(CAPXUL_FUNCTIONS["org/setup"].get), makeFunctionReference(CAPXUL_FUNCTIONS["org/setup"].listMine), makeFunctionReference(CAPXUL_FUNCTIONS["org/setup"].resume), makeFunctionReference(CAPXUL_FUNCTIONS["org/setup"].prepareAuthorization), makeFunctionReference(CAPXUL_FUNCTIONS["org/setup"].submitAuthorization);
20305
20384
  //#endregion
20306
20385
  //#region ../../packages/sdk/src/flows/identity.ts
20307
20386
  const IDENTITY_SLOT = {
@@ -20310,8 +20389,8 @@ const IDENTITY_SLOT = {
20310
20389
  account: "identity:account",
20311
20390
  org: "identity:org"
20312
20391
  };
20313
- IDENTITY_SLOT.session, IDENTITY_SLOT.session, IDENTITY_SLOT.session, IDENTITY_SLOT.session, IDENTITY_SLOT.session, IDENTITY_SLOT.session, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.account, IDENTITY_SLOT.account, IDENTITY_SLOT.account, IDENTITY_SLOT.account, IDENTITY_SLOT.account, IDENTITY_SLOT.account, IDENTITY_SLOT.account, IDENTITY_SLOT.account, IDENTITY_SLOT.org, IDENTITY_SLOT.org, IDENTITY_SLOT.org, IDENTITY_SLOT.org, IDENTITY_SLOT.org, IDENTITY_SLOT.org, IDENTITY_SLOT.org;
20314
- makeFunctionReference(CAPXUL_FUNCTIONS["org/lifecycle"].getProofReceipt);
20392
+ IDENTITY_SLOT.session, IDENTITY_SLOT.session, IDENTITY_SLOT.session, IDENTITY_SLOT.session, IDENTITY_SLOT.session, IDENTITY_SLOT.session, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.auth, IDENTITY_SLOT.account, IDENTITY_SLOT.account, IDENTITY_SLOT.account, IDENTITY_SLOT.account, IDENTITY_SLOT.account, IDENTITY_SLOT.account, IDENTITY_SLOT.account, IDENTITY_SLOT.account, IDENTITY_SLOT.org, IDENTITY_SLOT.org, IDENTITY_SLOT.org, IDENTITY_SLOT.org, IDENTITY_SLOT.org, IDENTITY_SLOT.org;
20393
+ makeFunctionReference(CAPXUL_FUNCTIONS["org/setup"].getProofReceipt);
20315
20394
  //#endregion
20316
20395
  //#region ../../packages/sdk/src/surface/capxul-deps.ts
20317
20396
  /** The single Context tag the atoms + public methods both resolve. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capxul/sandbox",
3
- "version": "4.20.0-beta.10",
3
+ "version": "4.20.0-beta.11",
4
4
  "private": false,
5
5
  "description": "Capxul sandbox CLI for canonical quickstart keys and testnet faucet funds.",
6
6
  "keywords": [
@@ -42,7 +42,7 @@
42
42
  "typescript": "npm:@typescript/typescript6@6.0.2",
43
43
  "vite": "npm:@voidzero-dev/vite-plus-core@0.3.0",
44
44
  "vite-plus": "0.3.0",
45
- "@capxul/sdk": "4.20.0-beta.10",
45
+ "@capxul/sdk": "4.20.0-beta.11",
46
46
  "@capxul/typescript-config": "0.0.0"
47
47
  },
48
48
  "scripts": {