@freecodexyz/freecode 0.1.0 → 0.1.1

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 (3) hide show
  1. package/README.md +12 -0
  2. package/dist/index.js +1175 -1142
  3. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -650,45 +650,35 @@ var QuickActionContextSchema = z10.object({
650
650
  })
651
651
  });
652
652
  var SearchKindSchema = z10.enum(["markets", "projects", "repos", "people", "actions"]);
653
+ var SearchResultBaseSchema = z10.object({
654
+ id: z10.string().min(1),
655
+ title: z10.string().min(1),
656
+ description: z10.string().min(1)
657
+ });
653
658
  var QuickActionSearchResultSchema = z10.discriminatedUnion("kind", [
654
- z10.object({
659
+ SearchResultBaseSchema.extend({
655
660
  kind: z10.literal("project"),
656
661
  group: z10.literal("projects"),
657
- id: z10.string().min(1),
658
- title: z10.string().min(1),
659
- description: z10.string().min(1),
660
662
  projectId: z10.string().min(1)
661
663
  }),
662
- z10.object({
664
+ SearchResultBaseSchema.extend({
663
665
  kind: z10.literal("market"),
664
666
  group: z10.literal("markets"),
665
- id: z10.string().min(1),
666
- title: z10.string().min(1),
667
- description: z10.string().min(1),
668
667
  marketId: GithubIdSchema
669
668
  }),
670
- z10.object({
669
+ SearchResultBaseSchema.extend({
671
670
  kind: z10.literal("repository"),
672
671
  group: z10.literal("repos"),
673
- id: z10.string().min(1),
674
- title: z10.string().min(1),
675
- description: z10.string().min(1),
676
672
  url: z10.string().url()
677
673
  }),
678
- z10.object({
674
+ SearchResultBaseSchema.extend({
679
675
  kind: z10.literal("contributor"),
680
676
  group: z10.literal("people"),
681
- id: z10.string().min(1),
682
- title: z10.string().min(1),
683
- description: z10.string().min(1),
684
677
  url: z10.string().url()
685
678
  }),
686
- z10.object({
679
+ SearchResultBaseSchema.extend({
687
680
  kind: z10.literal("transaction"),
688
681
  group: z10.literal("actions"),
689
- id: z10.string().min(1),
690
- title: z10.string().min(1),
691
- description: z10.string().min(1),
692
682
  url: z10.string().url()
693
683
  })
694
684
  ]);
@@ -749,12 +739,12 @@ var MarketPreviewSchema = z11.object({
749
739
  numeraire: AddressSchema,
750
740
  initializer: AddressSchema,
751
741
  startMarketCapUsd: z11.number().positive(),
752
- endMarketCapUsd: z11.number().positive(),
742
+ endMarketCapUsd: z11.union([z11.number().positive(), z11.literal("max")]),
753
743
  editable: z11.object({
754
744
  name: z11.literal(true),
755
745
  symbol: z11.literal(true),
756
746
  metadataCid: z11.literal(true),
757
- devBuy: z11.literal(true)
747
+ devBuy: z11.boolean()
758
748
  })
759
749
  }),
760
750
  profile: z11.object({
@@ -840,7 +830,7 @@ var MarketQuoteSchema = z11.object({
840
830
  poolId: PoolIdSchema,
841
831
  tokenIn: AddressSchema,
842
832
  tokenOut: AddressSchema,
843
- feeBps: z11.number().int().nonnegative()
833
+ feeBps: z11.number().nonnegative()
844
834
  }),
845
835
  execution: z11.object({
846
836
  permit2: AddressSchema,
@@ -875,19 +865,13 @@ var SponsoredMarketSwapSubmissionSchema = SponsoredOperationSubmissionSchema.ext
875
865
  quotedAmountOutBaseUnits: Uint128BaseUnitsSchema
876
866
  });
877
867
  var MarketDetailSchema = z11.object({
868
+ launchFacts: z11.object({
869
+ startMarketCapUsd: MarketPreviewSchema.shape.defaults.shape.startMarketCapUsd,
870
+ endMarketCapUsd: MarketPreviewSchema.shape.defaults.shape.endMarketCapUsd,
871
+ feeSplit: MarketPreviewSchema.shape.feeSplit
872
+ }).nullable(),
878
873
  generatedAt: z11.string().datetime(),
879
874
  profile: ProjectProfileSchema,
880
- trades: z11.array(z11.object({
881
- id: z11.string().min(1),
882
- side: MarketSwapSideSchema,
883
- assetBaseUnits: z11.string().regex(/^\d+$/),
884
- numeraireBaseUnits: z11.string().regex(/^\d+$/),
885
- priceUsdc: z11.string().regex(/^\d+(?:\.\d+)?$/),
886
- wallet: AddressSchema,
887
- walletLogin: z11.string().nullable(),
888
- occurredAt: z11.string().datetime(),
889
- txHash: HexSchema
890
- })),
891
875
  holders: z11.array(z11.object({
892
876
  wallet: AddressSchema,
893
877
  walletLogin: z11.string().nullable(),
@@ -911,59 +895,85 @@ var MarketDetailSchema = z11.object({
911
895
  })
912
896
  });
913
897
 
914
- // ../../packages/contracts/dist/Payout.js
898
+ // ../../packages/contracts/dist/MarketTradesPage.js
915
899
  import { z as z12 } from "zod";
916
- var PayoutSchema = z12.object({
917
- id: z12.string(),
918
- projectId: z12.string(),
900
+ var marketTradesPageSize = 25;
901
+ var MarketTradeCursorSchema = z12.string().regex(/^(older|newer):\d{1,20}:\d{1,10}$/);
902
+ var MarketTradesQuerySchema = z12.object({
903
+ cursor: MarketTradeCursorSchema.optional(),
904
+ side: MarketSwapSideSchema.optional(),
905
+ wallet: AddressSchema.optional()
906
+ });
907
+ var MarketTradeSchema = z12.object({
908
+ id: z12.string().min(1),
909
+ side: MarketSwapSideSchema,
910
+ assetBaseUnits: z12.string().regex(/^\d+$/),
911
+ numeraireBaseUnits: z12.string().regex(/^\d+$/),
912
+ priceNumeraire: z12.string().regex(/^\d+(?:\.\d+)?$/),
913
+ wallet: AddressSchema,
914
+ walletLogin: z12.string().nullable(),
915
+ occurredAt: z12.string().datetime(),
916
+ txHash: HexSchema
917
+ });
918
+ var MarketTradesPageSchema = z12.object({
919
+ trades: z12.array(MarketTradeSchema).max(marketTradesPageSize),
920
+ nextCursor: MarketTradeCursorSchema.nullable(),
921
+ previousCursor: MarketTradeCursorSchema.nullable()
922
+ });
923
+
924
+ // ../../packages/contracts/dist/Payout.js
925
+ import { z as z13 } from "zod";
926
+ var PayoutSchema = z13.object({
927
+ id: z13.string(),
928
+ projectId: z13.string(),
919
929
  cycle: CycleSchema,
920
930
  actorGithubId: GithubIdSchema,
921
- txHash: z12.string().regex(/^0x[0-9a-fA-F]{64}$/).transform((value) => value),
931
+ txHash: z13.string().regex(/^0x[0-9a-fA-F]{64}$/).transform((value) => value),
922
932
  tokenAddress: AddressSchema,
923
- baseUnits: z12.string().regex(/^[1-9]\d*$/),
924
- settledAt: z12.string().datetime(),
933
+ baseUnits: z13.string().regex(/^[1-9]\d*$/),
934
+ settledAt: z13.string().datetime(),
925
935
  recordedByWallet: AddressSchema
926
936
  });
927
937
  var ContributorPayoutSchema = PayoutSchema.extend({
928
- projectName: z12.string(),
938
+ projectName: z13.string(),
929
939
  token: TokenSchema.nullable()
930
940
  });
931
941
  var ReviewedPayoutSchema = PayoutSchema.extend({
932
- proposalReview: z12.discriminatedUnion("matches", [
933
- z12.object({ matches: z12.literal(true) }),
934
- z12.object({
935
- matches: z12.literal(false),
936
- reason: z12.enum(["allocation-not-approved", "token-mismatch", "amount-mismatch"])
942
+ proposalReview: z13.discriminatedUnion("matches", [
943
+ z13.object({ matches: z13.literal(true) }),
944
+ z13.object({
945
+ matches: z13.literal(false),
946
+ reason: z13.enum(["allocation-not-approved", "token-mismatch", "amount-mismatch"])
937
947
  })
938
948
  ])
939
949
  });
940
950
  var CreatePayoutSchema = PayoutSchema.omit({ id: true, settledAt: true }).extend({
941
- signature: z12.string().min(1),
942
- challenge: z12.string().min(1)
951
+ signature: z13.string().min(1),
952
+ challenge: z13.string().min(1)
943
953
  });
944
954
 
945
955
  // ../../packages/contracts/dist/Protocol.js
946
- import { z as z13 } from "zod";
947
- var TradeActivitySchema = z13.object({
948
- kind: z13.literal("trade"),
949
- id: z13.string(),
956
+ import { z as z14 } from "zod";
957
+ var TradeActivitySchema = z14.object({
958
+ kind: z14.literal("trade"),
959
+ id: z14.string(),
950
960
  githubRepoId: GithubIdSchema,
951
961
  repository: RepoSlugSchema,
952
962
  asset: AddressSchema,
953
- assetSymbol: z13.string(),
954
- side: z13.enum(["buy", "sell"]),
963
+ assetSymbol: z14.string(),
964
+ side: z14.enum(["buy", "sell"]),
955
965
  assetBaseUnits: BaseUnitsSchema,
956
966
  numeraireBaseUnits: BaseUnitsSchema,
957
- occurredAt: z13.string().datetime(),
967
+ occurredAt: z14.string().datetime(),
958
968
  txHash: HexSchema
959
969
  });
960
- var ProtocolActivitySchema = z13.discriminatedUnion("kind", [
961
- z13.object({
962
- kind: z13.literal("contribution"),
963
- id: z13.string(),
964
- actor: z13.string(),
970
+ var ProtocolActivitySchema = z14.discriminatedUnion("kind", [
971
+ z14.object({
972
+ kind: z14.literal("contribution"),
973
+ id: z14.string(),
974
+ actor: z14.string(),
965
975
  repository: RepoSlugSchema,
966
- action: z13.enum([
976
+ action: z14.enum([
967
977
  "merged_pr",
968
978
  "resolved_issue",
969
979
  "test_change",
@@ -971,362 +981,360 @@ var ProtocolActivitySchema = z13.discriminatedUnion("kind", [
971
981
  "review",
972
982
  "evaluation"
973
983
  ]),
974
- reference: z13.number().int().positive(),
975
- title: z13.string(),
976
- points: z13.number().int().nonnegative(),
977
- occurredAt: z13.string().datetime(),
978
- url: z13.string().url()
984
+ reference: z14.number().int().positive(),
985
+ title: z14.string(),
986
+ points: z14.number().int().nonnegative(),
987
+ occurredAt: z14.string().datetime(),
988
+ url: z14.string().url()
979
989
  }),
980
- z13.object({
981
- kind: z13.literal("payout"),
982
- id: z13.string(),
990
+ z14.object({
991
+ kind: z14.literal("payout"),
992
+ id: z14.string(),
983
993
  actorGithubId: GithubIdSchema,
984
- project: z13.string(),
994
+ project: z14.string(),
985
995
  amount: TokenAmountSchema,
986
- occurredAt: z13.string().datetime(),
996
+ occurredAt: z14.string().datetime(),
987
997
  txHash: HexSchema
988
998
  }),
989
- z13.object({
990
- kind: z13.literal("rik"),
991
- id: z13.string(),
999
+ z14.object({
1000
+ kind: z14.literal("rik"),
1001
+ id: z14.string(),
992
1002
  githubRepoId: GithubIdSchema,
993
1003
  repository: RepoSlugSchema,
994
- occurredAt: z13.string().datetime(),
1004
+ occurredAt: z14.string().datetime(),
995
1005
  txHash: HexSchema
996
1006
  }),
997
- z13.object({
998
- kind: z13.literal("uik"),
999
- id: z13.string(),
1007
+ z14.object({
1008
+ kind: z14.literal("uik"),
1009
+ id: z14.string(),
1000
1010
  githubUserId: GithubIdSchema,
1001
- login: z13.string().nullable(),
1002
- imageUrl: z13.string().url().nullable(),
1011
+ login: z14.string().nullable(),
1012
+ imageUrl: z14.string().url().nullable(),
1003
1013
  wallet: AddressSchema,
1004
- occurredAt: z13.string().datetime(),
1014
+ occurredAt: z14.string().datetime(),
1005
1015
  txHash: HexSchema
1006
1016
  }),
1007
1017
  TradeActivitySchema
1008
1018
  ]);
1009
- var EditorialPickSchema = z13.object({
1019
+ var EditorialPickSchema = z14.object({
1010
1020
  repository: RepoSlugSchema,
1011
- eyebrow: z13.string().min(1),
1012
- thesis: z13.string().min(1),
1013
- url: z13.string().url()
1014
- });
1015
- var ProtocolStatsSchema = z13.object({
1016
- marketCount: z13.number().int().nonnegative(),
1017
- projectCount: z13.number().int().nonnegative(),
1018
- contributorCount: z13.number().int().nonnegative(),
1019
- paid30d: TokenAmountSchema,
1020
- volume30d: TokenAmountSchema,
1021
- gasPriceGwei: z13.string().regex(/^\d+(?:\.\d+)?$/)
1022
- });
1023
- var ProtocolOverviewSchema = z13.object({
1024
- generatedAt: z13.string().datetime(),
1021
+ eyebrow: z14.string().min(1),
1022
+ thesis: z14.string().min(1),
1023
+ url: z14.string().url()
1024
+ });
1025
+ var ProtocolStatsSchema = z14.object({
1026
+ marketCount: z14.number().int().nonnegative(),
1027
+ projectCount: z14.number().int().nonnegative(),
1028
+ contributorCount: z14.number().int().nonnegative(),
1029
+ paid30d: z14.array(TokenAmountSchema),
1030
+ volume30d: z14.array(TokenAmountSchema),
1031
+ gasPriceGwei: z14.string().regex(/^\d+(?:\.\d+)?$/)
1032
+ });
1033
+ var ProtocolOverviewSchema = z14.object({
1034
+ generatedAt: z14.string().datetime(),
1025
1035
  stats: ProtocolStatsSchema,
1026
- activity: z13.array(ProtocolActivitySchema),
1027
- featured: z13.array(EditorialPickSchema)
1036
+ activity: z14.array(ProtocolActivitySchema),
1037
+ featured: z14.array(EditorialPickSchema)
1028
1038
  });
1029
- var WatchingRepositorySchema = z13.object({
1039
+ var WatchingRepositorySchema = z14.object({
1030
1040
  repository: RepoSlugSchema,
1031
- description: z13.string().nullable(),
1032
- stars: z13.number().int().nonnegative(),
1033
- pushedAt: z13.string().datetime(),
1034
- url: z13.string().url()
1041
+ description: z14.string().nullable(),
1042
+ stars: z14.number().int().nonnegative(),
1043
+ pushedAt: z14.string().datetime(),
1044
+ url: z14.string().url()
1035
1045
  });
1036
- var MarketListItemSchema = z13.object({
1046
+ var MarketListItemSchema = z14.object({
1037
1047
  githubRepoId: GithubIdSchema,
1038
1048
  repository: RepoSlugSchema,
1039
1049
  asset: AddressSchema,
1040
1050
  poolId: PoolIdSchema,
1041
- token: z13.object({
1042
- name: z13.string(),
1043
- symbol: z13.string(),
1044
- decimals: z13.number().int().nonnegative()
1051
+ numeraire: TokenSchema,
1052
+ token: z14.object({
1053
+ name: z14.string(),
1054
+ symbol: z14.string(),
1055
+ decimals: z14.number().int().nonnegative()
1045
1056
  }),
1046
1057
  profile: MarketProfileSchema,
1047
- launchedAt: z13.string().datetime(),
1048
- poolFeeBps: z13.number().int().nonnegative(),
1058
+ launchedAt: z14.string().datetime(),
1059
+ poolFeeBps: z14.number().nonnegative(),
1049
1060
  totalSupplyBaseUnits: BaseUnitsSchema,
1050
1061
  circulatingSupplyBaseUnits: BaseUnitsSchema,
1051
- priceUsdc: z13.string().nullable(),
1052
- priceChange24hPercent: z13.number().nullable(),
1053
- marketCapUsdc: z13.string().nullable(),
1062
+ priceUsd: z14.string().nullable(),
1063
+ priceChange24hNumerairePercent: z14.number().nullable(),
1064
+ marketCapUsd: z14.string().nullable(),
1054
1065
  volume24hBaseUnits: BaseUnitsSchema,
1066
+ /** Value at the current numeraire/USD rate, not historical trade-time USD volume. */
1067
+ volume24hUsd: z14.string().nullable(),
1055
1068
  volume30dBaseUnits: BaseUnitsSchema,
1056
- tradeCount: z13.number().int().nonnegative(),
1057
- holderCount: z13.number().int().nonnegative()
1069
+ tradeCount: z14.number().int().nonnegative(),
1070
+ holderCount: z14.number().int().nonnegative()
1058
1071
  });
1059
- var UpcomingMarketSchema = z13.object({
1072
+ var UpcomingMarketSchema = z14.object({
1060
1073
  githubRepoId: GithubIdSchema,
1061
1074
  repository: RepoSlugSchema,
1062
1075
  holder: AddressSchema,
1063
- registeredAt: z13.string().datetime(),
1064
- url: z13.string().url()
1076
+ registeredAt: z14.string().datetime(),
1077
+ url: z14.string().url()
1065
1078
  });
1066
- var MarketsDirectorySchema = z13.object({
1067
- generatedAt: z13.string().datetime(),
1079
+ var MarketsDirectorySchema = z14.object({
1080
+ generatedAt: z14.string().datetime(),
1068
1081
  rik: AddressSchema.nullable(),
1069
- numeraire: z13.object({
1070
- address: AddressSchema,
1071
- symbol: z13.string(),
1072
- decimals: z13.number().int().nonnegative()
1073
- }),
1074
- markets: z13.array(MarketListItemSchema),
1075
- comingSoon: z13.array(UpcomingMarketSchema),
1076
- watching: z13.array(WatchingRepositorySchema),
1077
- trades: z13.array(TradeActivitySchema),
1078
- editorial: z13.array(EditorialPickSchema)
1082
+ markets: z14.array(MarketListItemSchema),
1083
+ comingSoon: z14.array(UpcomingMarketSchema),
1084
+ watching: z14.array(WatchingRepositorySchema),
1085
+ trades: z14.array(TradeActivitySchema),
1086
+ editorial: z14.array(EditorialPickSchema)
1079
1087
  });
1080
1088
 
1081
1089
  // ../../packages/contracts/dist/Registration.js
1082
1090
  var registrationIssueTitle = (issue) => issue.target === "identity" ? issue.wallet : `${issue.repository} ${issue.wallet}`;
1083
1091
 
1084
1092
  // ../../packages/contracts/dist/Ship.js
1085
- import { z as z14 } from "zod";
1086
- var CanonicalTimestampSchema = z14.string().regex(/^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d\.\d{3}Z$/).refine((value) => new Date(value).toISOString() === value, "Expected a canonical UTC timestamp.");
1087
- var ShipProjectIdSchema = z14.string().max(140).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
1093
+ import { z as z15 } from "zod";
1094
+ var CanonicalTimestampSchema = z15.string().regex(/^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d\.\d{3}Z$/).refine((value) => new Date(value).toISOString() === value, "Expected a canonical UTC timestamp.");
1095
+ var ShipProjectIdSchema = z15.string().max(140).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
1088
1096
  var forbiddenBranchCharacters = /[~^:?*[\]\\]/;
1089
1097
  var isSafeGitBranch = (branch) => !branch.startsWith("-") && !branch.endsWith(".") && branch !== "@" && !branch.includes("..") && !branch.includes("@{") && !forbiddenBranchCharacters.test(branch) && !hasControlCharacter(branch) && !branch.includes(" ") && branch.split("/").every((component) => component.length > 0 && !component.startsWith(".") && !component.endsWith(".lock"));
1090
- var ShipGitBranchSchema = z14.string().min(1).max(255).refine(isSafeGitBranch, "Expected a valid Git branch name.");
1091
- var ActorSchema = z14.object({ id: z14.string(), login: z14.string() });
1092
- var RewardTokenSchema = z14.object({
1098
+ var ShipGitBranchSchema = z15.string().min(1).max(255).refine(isSafeGitBranch, "Expected a valid Git branch name.");
1099
+ var ActorSchema = z15.object({ id: z15.string(), login: z15.string() });
1100
+ var RewardTokenSchema = z15.object({
1093
1101
  address: AddressSchema,
1094
- decimals: z14.number().int().min(0).max(255),
1102
+ decimals: z15.number().int().min(0).max(255),
1095
1103
  symbol: TrimmedTextSchema
1096
1104
  });
1097
- var AwardBaseSchema = z14.object({
1098
- id: z14.string(),
1099
- project: z14.string(),
1100
- repo: z14.string(),
1101
- cycle: z14.string(),
1105
+ var AwardBaseSchema = z15.object({
1106
+ id: z15.string(),
1107
+ project: z15.string(),
1108
+ repo: z15.string(),
1109
+ cycle: z15.string(),
1102
1110
  actor: ActorSchema,
1103
- occurredAt: z14.string().datetime(),
1104
- source: z14.object({
1105
- kind: z14.enum(["pr", "issue", "review"]),
1106
- number: z14.number().int().positive(),
1107
- title: z14.string()
1111
+ occurredAt: z15.string().datetime(),
1112
+ source: z15.object({
1113
+ kind: z15.enum(["pr", "issue", "review"]),
1114
+ number: z15.number().int().positive(),
1115
+ title: z15.string()
1108
1116
  }),
1109
- points: z14.number().nonnegative(),
1110
- runId: z14.string().optional()
1117
+ points: z15.number().nonnegative(),
1118
+ runId: z15.string().optional()
1111
1119
  });
1112
- var AwardSchema = z14.discriminatedUnion("kind", [
1113
- AwardBaseSchema.extend({ kind: z14.literal("merged_pr") }),
1114
- AwardBaseSchema.extend({ kind: z14.literal("resolved_issue") }),
1115
- AwardBaseSchema.extend({ kind: z14.literal("test_change") }),
1120
+ var AwardSchema = z15.discriminatedUnion("kind", [
1121
+ AwardBaseSchema.extend({ kind: z15.literal("merged_pr") }),
1122
+ AwardBaseSchema.extend({ kind: z15.literal("resolved_issue") }),
1123
+ AwardBaseSchema.extend({ kind: z15.literal("test_change") }),
1116
1124
  AwardBaseSchema.extend({
1117
- kind: z14.literal("evidence"),
1118
- evidenceKind: z14.enum(["screenshot", "video", "logs", "trajectory", "artifact"])
1125
+ kind: z15.literal("evidence"),
1126
+ evidenceKind: z15.enum(["screenshot", "video", "logs", "trajectory", "artifact"])
1119
1127
  }),
1120
- AwardBaseSchema.extend({ kind: z14.literal("review") }),
1128
+ AwardBaseSchema.extend({ kind: z15.literal("review") }),
1121
1129
  AwardBaseSchema.extend({
1122
- kind: z14.literal("evaluation"),
1123
- evaluationPoints: z14.number().nonnegative()
1130
+ kind: z15.literal("evaluation"),
1131
+ evaluationPoints: z15.number().nonnegative()
1124
1132
  })
1125
1133
  ]);
1126
- var RewardFundingSchema = z14.discriminatedUnion("status", [
1127
- z14.object({
1128
- status: z14.literal("pledged"),
1129
- settlement: z14.literal("proposal-only"),
1130
- unusedFunds: z14.literal("rollover-without-cap-increase")
1134
+ var RewardFundingSchema = z15.discriminatedUnion("status", [
1135
+ z15.object({
1136
+ status: z15.literal("pledged"),
1137
+ settlement: z15.literal("proposal-only"),
1138
+ unusedFunds: z15.literal("rollover-without-cap-increase")
1131
1139
  }),
1132
- z14.object({
1133
- status: z14.literal("committed"),
1134
- settlement: z14.literal("owner-executed"),
1135
- committedBaseUnits: z14.string().regex(/^[1-9]\d*$/),
1136
- unusedFunds: z14.literal("rollover-without-cap-increase")
1140
+ z15.object({
1141
+ status: z15.literal("committed"),
1142
+ settlement: z15.literal("owner-executed"),
1143
+ committedBaseUnits: z15.string().regex(/^[1-9]\d*$/),
1144
+ unusedFunds: z15.literal("rollover-without-cap-increase")
1137
1145
  })
1138
1146
  ]);
1139
- var RewardSchema = z14.object({
1147
+ var RewardSchema = z15.object({
1140
1148
  startsAt: CanonicalTimestampSchema,
1141
1149
  token: RewardTokenSchema,
1142
1150
  monthlyPoolBaseUnits: BaseUnitsSchema,
1143
1151
  funding: RewardFundingSchema.optional()
1144
1152
  });
1145
- var ProjectRepositorySchema = z14.object({
1153
+ var ProjectRepositorySchema = z15.object({
1146
1154
  id: RepoSlugSchema,
1147
1155
  branch: ShipGitBranchSchema,
1148
- previousIds: z14.array(z14.object({ id: RepoSlugSchema, retiredAt: CanonicalTimestampSchema })).min(1).optional()
1149
- });
1150
- var ShipPolicySchema = z14.object({
1151
- schemaVersion: z14.literal(2),
1152
- modes: z14.array(z14.enum(["implementation", "review", "validation", "testing", "documentation", "research"])),
1153
- issues: z14.object({
1154
- allowUnlabeled: z14.boolean(),
1155
- readyLabels: z14.array(z14.string()),
1156
- blockedLabels: z14.array(z14.string()),
1157
- sensitiveLabels: z14.array(z14.string()),
1158
- epicLabels: z14.array(z14.string())
1156
+ previousIds: z15.array(z15.object({ id: RepoSlugSchema, retiredAt: CanonicalTimestampSchema })).min(1).optional()
1157
+ });
1158
+ var ShipPolicySchema = z15.object({
1159
+ schemaVersion: z15.literal(2),
1160
+ modes: z15.array(z15.enum(["implementation", "review", "validation", "testing", "documentation", "research"])),
1161
+ issues: z15.object({
1162
+ allowUnlabeled: z15.boolean(),
1163
+ readyLabels: z15.array(z15.string()),
1164
+ blockedLabels: z15.array(z15.string()),
1165
+ sensitiveLabels: z15.array(z15.string()),
1166
+ epicLabels: z15.array(z15.string())
1159
1167
  }),
1160
- claims: z14.object({
1161
- assignees: z14.boolean(),
1162
- implementationLabels: z14.array(z14.string()),
1163
- implementationLabelPrefixes: z14.array(z14.string()),
1164
- reviewLabels: z14.array(z14.string()),
1165
- reviewLabelPrefixes: z14.array(z14.string()),
1166
- comments: z14.object({
1167
- enabled: z14.boolean(),
1168
- implementationPrefix: z14.string(),
1169
- reviewPrefix: z14.string(),
1170
- trustedAssociations: z14.array(z14.enum(["OWNER", "MEMBER", "COLLABORATOR"])),
1171
- expiresAfterDays: z14.number().int().min(1).max(30)
1168
+ claims: z15.object({
1169
+ assignees: z15.boolean(),
1170
+ implementationLabels: z15.array(z15.string()),
1171
+ implementationLabelPrefixes: z15.array(z15.string()),
1172
+ reviewLabels: z15.array(z15.string()),
1173
+ reviewLabelPrefixes: z15.array(z15.string()),
1174
+ comments: z15.object({
1175
+ enabled: z15.boolean(),
1176
+ implementationPrefix: z15.string(),
1177
+ reviewPrefix: z15.string(),
1178
+ trustedAssociations: z15.array(z15.enum(["OWNER", "MEMBER", "COLLABORATOR"])),
1179
+ expiresAfterDays: z15.number().int().min(1).max(30)
1172
1180
  })
1173
1181
  }),
1174
- priorityLabels: z14.array(z14.string()),
1175
- verification: z14.object({ setup: z14.array(z14.string()), required: z14.array(z14.string()) }),
1176
- evidence: z14.record(z14.string(), z14.array(z14.string())),
1177
- guide: z14.array(z14.string())
1182
+ priorityLabels: z15.array(z15.string()),
1183
+ verification: z15.object({ setup: z15.array(z15.string()), required: z15.array(z15.string()) }),
1184
+ evidence: z15.record(z15.string(), z15.array(z15.string())),
1185
+ guide: z15.array(z15.string())
1178
1186
  });
1179
- var ShipProjectDiscoverySchema = z14.object({
1180
- onboardedAt: z14.string().datetime().nullable(),
1187
+ var ShipProjectDiscoverySchema = z15.object({
1188
+ onboardedAt: z15.string().datetime().nullable(),
1181
1189
  policy: ShipPolicySchema.nullable(),
1182
- policyUrl: z14.string().url().nullable(),
1183
- repositoryIssueUrls: z14.array(z14.object({ repository: RepoSlugSchema, url: z14.string().url() })),
1184
- readyIssues: z14.array(GithubReadyIssueSchema),
1185
- similarProjects: z14.array(z14.object({ id: z14.string(), name: z14.string(), contributorCount: z14.number().int().positive() }))
1186
- });
1187
- var RewardContributorSchema = z14.object({
1188
- project: z14.string(),
1189
- cycle: z14.string(),
1190
- actorId: z14.string(),
1191
- canonicalScore: z14.number().nonnegative(),
1192
- creditedTokens: z14.number().int().nonnegative(),
1193
- computeBonusBasisPoints: z14.number().int().nonnegative(),
1194
- adjustedWeight: z14.number().nonnegative(),
1190
+ policyUrl: z15.string().url().nullable(),
1191
+ repositoryIssueUrls: z15.array(z15.object({ repository: RepoSlugSchema, url: z15.string().url() })),
1192
+ readyIssues: z15.array(GithubReadyIssueSchema),
1193
+ similarProjects: z15.array(z15.object({ id: z15.string(), name: z15.string(), contributorCount: z15.number().int().positive() }))
1194
+ });
1195
+ var RewardContributorSchema = z15.object({
1196
+ project: z15.string(),
1197
+ cycle: z15.string(),
1198
+ actorId: z15.string(),
1199
+ canonicalScore: z15.number().nonnegative(),
1200
+ creditedTokens: z15.number().int().nonnegative(),
1201
+ computeBonusBasisPoints: z15.number().int().nonnegative(),
1202
+ adjustedWeight: z15.number().nonnegative(),
1195
1203
  projectedBaseUnits: BaseUnitsSchema
1196
1204
  });
1197
- var ShipProjectSchema = z14.object({
1205
+ var ShipProjectSchema = z15.object({
1198
1206
  id: ShipProjectIdSchema,
1199
1207
  name: TrimmedTextSchema,
1200
1208
  mission: TrimmedTextSchema,
1201
- repositories: z14.array(ProjectRepositorySchema),
1209
+ repositories: z15.array(ProjectRepositorySchema),
1202
1210
  reward: RewardSchema.optional(),
1203
- allowedModels: z14.array(z14.object({
1204
- client: z14.enum(["codex", "claude-code"]),
1211
+ allowedModels: z15.array(z15.object({
1212
+ client: z15.enum(["codex", "claude-code"]),
1205
1213
  provider: TrimmedTextSchema,
1206
1214
  model: TrimmedTextSchema
1207
1215
  }))
1208
1216
  });
1209
- var ShipProjectPublicationSchema = z14.discriminatedUnion("state", [
1210
- z14.object({ state: z14.literal("published") }),
1211
- z14.object({
1212
- state: z14.literal("pending"),
1217
+ var ShipProjectPublicationSchema = z15.discriminatedUnion("state", [
1218
+ z15.object({ state: z15.literal("published") }),
1219
+ z15.object({
1220
+ state: z15.literal("pending"),
1213
1221
  commitSha: CommitShaSchema
1214
1222
  })
1215
1223
  ]);
1216
1224
  var ShipProjectListItemSchema = ShipProjectSchema.extend({
1217
- cycle: z14.string().regex(/^\d{4}-(0[1-9]|1[0-2])$/),
1218
- pool: z14.string().regex(/^\d+$/),
1219
- contributorCount: z14.number().int().nonnegative(),
1220
- category: z14.enum(["rewarded", "no-reward"]),
1221
- updatedAt: z14.string().datetime(),
1225
+ cycle: z15.string().regex(/^\d{4}-(0[1-9]|1[0-2])$/),
1226
+ pool: z15.string().regex(/^\d+$/),
1227
+ contributorCount: z15.number().int().nonnegative(),
1228
+ category: z15.enum(["rewarded", "no-reward"]),
1229
+ updatedAt: z15.string().datetime(),
1222
1230
  publication: ShipProjectPublicationSchema
1223
1231
  });
1224
- var ScoreBucketSchema = z14.object({
1225
- project: z14.string(),
1226
- cycle: z14.string().regex(/^\d{4}-(0[1-9]|1[0-2])$/),
1232
+ var ScoreBucketSchema = z15.object({
1233
+ project: z15.string(),
1234
+ cycle: z15.string().regex(/^\d{4}-(0[1-9]|1[0-2])$/),
1227
1235
  actor: ActorSchema,
1228
- score: z14.number().int().nonnegative(),
1229
- breakdown: z14.object({
1230
- merged_pr: z14.number().int().nonnegative(),
1231
- resolved_issue: z14.number().int().nonnegative(),
1232
- test_change: z14.number().int().nonnegative(),
1233
- evidence: z14.number().int().nonnegative(),
1234
- review: z14.number().int().nonnegative(),
1235
- evaluation: z14.number().int().nonnegative()
1236
+ score: z15.number().int().nonnegative(),
1237
+ breakdown: z15.object({
1238
+ merged_pr: z15.number().int().nonnegative(),
1239
+ resolved_issue: z15.number().int().nonnegative(),
1240
+ test_change: z15.number().int().nonnegative(),
1241
+ evidence: z15.number().int().nonnegative(),
1242
+ review: z15.number().int().nonnegative(),
1243
+ evaluation: z15.number().int().nonnegative()
1236
1244
  }),
1237
- counts: z14.object({
1238
- merged_pr: z14.number().int().nonnegative(),
1239
- resolved_issue: z14.number().int().nonnegative(),
1240
- test_change: z14.number().int().nonnegative(),
1241
- review: z14.number().int().nonnegative(),
1242
- evaluation: z14.number().int().nonnegative()
1245
+ counts: z15.object({
1246
+ merged_pr: z15.number().int().nonnegative(),
1247
+ resolved_issue: z15.number().int().nonnegative(),
1248
+ test_change: z15.number().int().nonnegative(),
1249
+ review: z15.number().int().nonnegative(),
1250
+ evaluation: z15.number().int().nonnegative()
1243
1251
  })
1244
1252
  });
1245
- var RunReceiptSchema = z14.object({
1246
- version: z14.literal(1),
1247
- runId: z14.string(),
1248
- project: z14.string(),
1249
- repo: z14.string(),
1250
- startedAt: z14.string().datetime(),
1251
- completedAt: z14.string().datetime(),
1252
- agent: z14.object({
1253
- client: z14.enum(["codex", "claude-code"]),
1254
- provider: z14.string(),
1255
- model: z14.string()
1253
+ var RunReceiptSchema = z15.object({
1254
+ version: z15.literal(1),
1255
+ runId: z15.string(),
1256
+ project: z15.string(),
1257
+ repo: z15.string(),
1258
+ startedAt: z15.string().datetime(),
1259
+ completedAt: z15.string().datetime(),
1260
+ agent: z15.object({
1261
+ client: z15.enum(["codex", "claude-code"]),
1262
+ provider: z15.string(),
1263
+ model: z15.string()
1256
1264
  }),
1257
- skill: z14.object({ revision: z14.string(), sha256: Sha256Schema }),
1258
- usage: z14.discriminatedUnion("confidence", [
1259
- z14.object({
1260
- confidence: z14.enum(["exact", "bounded"]),
1261
- totalTokens: z14.number().int().nonnegative(),
1265
+ skill: z15.object({ revision: z15.string(), sha256: Sha256Schema }),
1266
+ usage: z15.discriminatedUnion("confidence", [
1267
+ z15.object({
1268
+ confidence: z15.enum(["exact", "bounded"]),
1269
+ totalTokens: z15.number().int().nonnegative(),
1262
1270
  costMicroUsd: BaseUnitsSchema
1263
1271
  }),
1264
- z14.object({
1265
- confidence: z14.literal("unavailable"),
1266
- totalTokens: z14.literal(0),
1267
- costMicroUsd: z14.literal("0")
1272
+ z15.object({
1273
+ confidence: z15.literal("unavailable"),
1274
+ totalTokens: z15.literal(0),
1275
+ costMicroUsd: z15.literal("0")
1268
1276
  })
1269
1277
  ]),
1270
- device: z14.object({ keyId: z14.string(), publicKey: z14.string() }),
1278
+ device: z15.object({ keyId: z15.string(), publicKey: z15.string() }),
1271
1279
  trajectorySha256: Sha256Schema.optional(),
1272
- signature: z14.string()
1273
- });
1274
- var SnapshotSchema = z14.object({
1275
- schemaVersion: z14.literal(3),
1276
- generatedAt: z14.string().datetime(),
1277
- window: z14.object({ from: z14.string().datetime(), to: z14.string().datetime() }),
1278
- projects: z14.array(ShipProjectSchema),
1279
- buckets: z14.array(ScoreBucketSchema),
1280
- awards: z14.array(AwardSchema),
1281
- receipts: z14.array(RunReceiptSchema)
1282
- });
1283
- var CycleProposalAllocationSchema = z14.object({
1284
- intentId: z14.string(),
1280
+ signature: z15.string()
1281
+ });
1282
+ var SnapshotSchema = z15.object({
1283
+ schemaVersion: z15.literal(3),
1284
+ generatedAt: z15.string().datetime(),
1285
+ window: z15.object({ from: z15.string().datetime(), to: z15.string().datetime() }),
1286
+ projects: z15.array(ShipProjectSchema),
1287
+ buckets: z15.array(ScoreBucketSchema),
1288
+ awards: z15.array(AwardSchema),
1289
+ receipts: z15.array(RunReceiptSchema)
1290
+ });
1291
+ var CycleProposalAllocationSchema = z15.object({
1292
+ intentId: z15.string(),
1285
1293
  actor: ActorSchema,
1286
- canonicalScore: z14.number().int().nonnegative(),
1287
- receiptComputation: z14.object({
1288
- creditedTokens: z14.number().int().nonnegative(),
1289
- computeBonusBasisPoints: z14.number().int().nonnegative(),
1290
- adjustedWeight: z14.number().int().nonnegative(),
1291
- linkedRunIds: z14.array(z14.string())
1294
+ canonicalScore: z15.number().int().nonnegative(),
1295
+ receiptComputation: z15.object({
1296
+ creditedTokens: z15.number().int().nonnegative(),
1297
+ computeBonusBasisPoints: z15.number().int().nonnegative(),
1298
+ adjustedWeight: z15.number().int().nonnegative(),
1299
+ linkedRunIds: z15.array(z15.string())
1292
1300
  }),
1293
1301
  projectedBaseUnits: BaseUnitsSchema,
1294
1302
  approvedBaseUnits: BaseUnitsSchema,
1295
- state: z14.enum(["approved", "excluded", "held", "proposed", "unclaimed"]),
1296
- adjustmentReason: z14.string().nullable(),
1297
- wallet: z14.object({
1298
- chainId: z14.literal(8453),
1303
+ state: z15.enum(["approved", "excluded", "held", "proposed", "unclaimed"]),
1304
+ adjustmentReason: z15.string().nullable(),
1305
+ wallet: z15.object({
1306
+ chainId: z15.literal(8453),
1299
1307
  address: AddressSchema,
1300
1308
  identityContract: AddressSchema,
1301
- observedAt: z14.string().datetime()
1309
+ observedAt: z15.string().datetime()
1302
1310
  }).nullable(),
1303
- awardIds: z14.array(z14.string())
1311
+ awardIds: z15.array(z15.string())
1304
1312
  });
1305
1313
  var ResolvedProposalAllocationSchema = CycleProposalAllocationSchema.extend({
1306
1314
  githubUserId: GithubIdSchema.nullable()
1307
1315
  });
1308
- var CycleProposalSchema = z14.object({
1309
- schemaVersion: z14.literal(1),
1310
- kind: z14.literal("reward-proposal"),
1311
- status: z14.literal("proposed"),
1312
- project: z14.string(),
1313
- cycle: z14.string(),
1314
- generatedAt: z14.string().datetime(),
1315
- contributionWindow: z14.object({ from: z14.string().datetime(), to: z14.string().datetime() }),
1316
- review: z14.object({
1317
- days: z14.literal(14),
1318
- lastMaterialChangeAt: z14.string().datetime(),
1319
- endsAt: z14.string().datetime()
1316
+ var CycleProposalSchema = z15.object({
1317
+ schemaVersion: z15.literal(1),
1318
+ kind: z15.literal("reward-proposal"),
1319
+ status: z15.literal("proposed"),
1320
+ project: z15.string(),
1321
+ cycle: z15.string(),
1322
+ generatedAt: z15.string().datetime(),
1323
+ contributionWindow: z15.object({ from: z15.string().datetime(), to: z15.string().datetime() }),
1324
+ review: z15.object({
1325
+ days: z15.literal(14),
1326
+ lastMaterialChangeAt: z15.string().datetime(),
1327
+ endsAt: z15.string().datetime()
1320
1328
  }),
1321
- sourceSnapshot: z14.object({
1322
- schemaVersion: z14.literal(3),
1323
- generatedAt: z14.string().datetime(),
1329
+ sourceSnapshot: z15.object({
1330
+ schemaVersion: z15.literal(3),
1331
+ generatedAt: z15.string().datetime(),
1324
1332
  sha256: Sha256Schema
1325
1333
  }),
1326
- reward: z14.object({ token: RewardTokenSchema, monthlyPoolBaseUnits: BaseUnitsSchema }),
1327
- walletBinding: z14.object({ chainId: z14.literal(8453), contract: AddressSchema }),
1328
- allocations: z14.array(CycleProposalAllocationSchema),
1329
- totals: z14.object({
1334
+ reward: z15.object({ token: RewardTokenSchema, monthlyPoolBaseUnits: BaseUnitsSchema }),
1335
+ walletBinding: z15.object({ chainId: z15.literal(8453), contract: AddressSchema }),
1336
+ allocations: z15.array(CycleProposalAllocationSchema),
1337
+ totals: z15.object({
1330
1338
  projectedBaseUnits: BaseUnitsSchema,
1331
1339
  approvedBaseUnits: BaseUnitsSchema,
1332
1340
  proposedBaseUnits: BaseUnitsSchema,
@@ -1335,7 +1343,7 @@ var CycleProposalSchema = z14.object({
1335
1343
  });
1336
1344
 
1337
1345
  // ../../packages/contracts/dist/ShipRegistration.js
1338
- import { z as z15 } from "zod";
1346
+ import { z as z16 } from "zod";
1339
1347
  var placeholderText = /(?:example-project|owner\/repository|<[a-z][a-z0-9]*(?:[ _-][a-z0-9]+)+>|<(?:name|owner|repo|repository|project|value|your[^>]*)>)/i;
1340
1348
  var unfilledText = /^(?:todo|tbd)\b/i;
1341
1349
  var isConcreteText = (value) => value.trim() === value && value.length > 0 && !hasControlCharacter(value) && !unfilledText.test(value) && !placeholderText.test(value);
@@ -1361,7 +1369,7 @@ var textLists = (policy) => [
1361
1369
  ];
1362
1370
  var ShipPolicyProposalSchema = ShipPolicySchema.superRefine((policy, context2) => {
1363
1371
  const issue = (path, message) => {
1364
- context2.addIssue({ code: z15.ZodIssueCode.custom, path: [...path], message });
1372
+ context2.addIssue({ code: z16.ZodIssueCode.custom, path: [...path], message });
1365
1373
  };
1366
1374
  if (policy.modes.length === 0)
1367
1375
  issue(["modes"], "Enable at least one mode of work.");
@@ -1416,51 +1424,51 @@ var ShipPolicyProposalSchema = ShipPolicySchema.superRefine((policy, context2) =
1416
1424
  if (policy.guide.length === 0)
1417
1425
  issue(["guide"], "Name at least one project-specific instruction.");
1418
1426
  });
1419
- var ShipRegistrationIntentSchema = z15.enum(["create", "update"]);
1420
- var ShipProjectProposalSchema = z15.object({
1421
- name: z15.string().min(2).max(80).refine(isConcreteText, "Expected concrete text.").refine(isPlainYamlScalar, "A project name cannot carry YAML punctuation."),
1422
- mission: z15.string().min(20).max(300).refine(isConcreteText, "Expected concrete text."),
1427
+ var ShipRegistrationIntentSchema = z16.enum(["create", "update"]);
1428
+ var ShipProjectProposalSchema = z16.object({
1429
+ name: z16.string().min(2).max(80).refine(isConcreteText, "Expected concrete text.").refine(isPlainYamlScalar, "A project name cannot carry YAML punctuation."),
1430
+ mission: z16.string().min(20).max(300).refine(isConcreteText, "Expected concrete text."),
1423
1431
  /* Former repository identities are receipt lineage, not a live claim, and no
1424
1432
  key exists to authorise one — so this write path does not carry them. */
1425
- repositories: z15.array(ShipProjectSchema.shape.repositories.element.omit({ previousIds: true })).min(1).max(20),
1433
+ repositories: z16.array(ShipProjectSchema.shape.repositories.element.omit({ previousIds: true })).min(1).max(20),
1426
1434
  reward: ShipProjectSchema.shape.reward.unwrap().nullable(),
1427
1435
  allowedModels: ShipProjectSchema.shape.allowedModels
1428
1436
  });
1429
- var ShipRegistrationSubmissionSchema = z15.object({
1437
+ var ShipRegistrationSubmissionSchema = z16.object({
1430
1438
  project: ShipProjectProposalSchema,
1431
1439
  policy: ShipPolicyProposalSchema
1432
1440
  });
1433
- var ShipDraftRequestSchema = z15.object({ repository: RepoSlugSchema });
1441
+ var ShipDraftRequestSchema = z16.object({ repository: RepoSlugSchema });
1434
1442
  var ShipManifestRequestSchema = ShipRegistrationSubmissionSchema.extend({
1435
1443
  intent: ShipRegistrationIntentSchema
1436
1444
  });
1437
1445
  var ShipSignedRegistrationSchema = ShipRegistrationSubmissionSchema.extend({
1438
1446
  wallet: AddressSchema,
1439
- signature: z15.string().regex(/^0x[0-9a-fA-F]+$/).transform((value) => value),
1447
+ signature: z16.string().regex(/^0x[0-9a-fA-F]+$/).transform((value) => value),
1440
1448
  baseSha: CommitShaSchema
1441
1449
  });
1442
- var ShipEligibilityBlockerSchema = z15.discriminatedUnion("code", [
1443
- z15.object({ code: z15.literal("RIK_NOT_CONFIGURED") }),
1444
- z15.object({ code: z15.literal("KEY_NOT_MINTED") }),
1445
- z15.object({ code: z15.literal("WALLET_NOT_HOLDER"), holder: AddressSchema }),
1446
- z15.object({ code: z15.literal("REPOSITORY_NOT_PUBLIC") }),
1447
- z15.object({ code: z15.literal("REPOSITORY_ARCHIVED") }),
1448
- z15.object({ code: z15.literal("REPOSITORY_FORK"), upstream: z15.string().nullable() }),
1449
- z15.object({
1450
- code: z15.literal("PROJECT_ID_TAKEN"),
1450
+ var ShipEligibilityBlockerSchema = z16.discriminatedUnion("code", [
1451
+ z16.object({ code: z16.literal("RIK_NOT_CONFIGURED") }),
1452
+ z16.object({ code: z16.literal("KEY_NOT_MINTED") }),
1453
+ z16.object({ code: z16.literal("WALLET_NOT_HOLDER"), holder: AddressSchema }),
1454
+ z16.object({ code: z16.literal("REPOSITORY_NOT_PUBLIC") }),
1455
+ z16.object({ code: z16.literal("REPOSITORY_ARCHIVED") }),
1456
+ z16.object({ code: z16.literal("REPOSITORY_FORK"), upstream: z16.string().nullable() }),
1457
+ z16.object({
1458
+ code: z16.literal("PROJECT_ID_TAKEN"),
1451
1459
  projectId: ShipProjectIdSchema,
1452
- publication: z15.enum(["published", "pending"])
1460
+ publication: z16.enum(["published", "pending"])
1453
1461
  })
1454
1462
  ]);
1455
- var ShipRegistrationEligibilitySchema = z15.object({
1456
- eligible: z15.boolean(),
1463
+ var ShipRegistrationEligibilitySchema = z16.object({
1464
+ eligible: z16.boolean(),
1457
1465
  projectId: ShipProjectIdSchema,
1458
1466
  githubRepoId: GithubIdSchema,
1459
- repository: z15.object({ slug: RepoSlugSchema, defaultBranch: z15.string() }),
1467
+ repository: z16.object({ slug: RepoSlugSchema, defaultBranch: z16.string() }),
1460
1468
  holder: AddressSchema.nullable(),
1461
- blockers: z15.array(ShipEligibilityBlockerSchema)
1469
+ blockers: z16.array(ShipEligibilityBlockerSchema)
1462
1470
  });
1463
- var ShipPolicyFieldIdSchema = z15.enum([
1471
+ var ShipPolicyFieldIdSchema = z16.enum([
1464
1472
  "mission",
1465
1473
  "modes",
1466
1474
  "readyLabels",
@@ -1474,179 +1482,179 @@ var ShipPolicyFieldIdSchema = z15.enum([
1474
1482
  "guide",
1475
1483
  "allowedModels"
1476
1484
  ]);
1477
- var ShipInferenceSchema = z15.object({
1478
- evidence: z15.array(z15.string()),
1479
- confidence: z15.enum(["high", "medium", "low"])
1480
- });
1481
- var ShipLabelBucketsSchema = z15.object({
1482
- ready: z15.array(z15.string()),
1483
- blocked: z15.array(z15.string()),
1484
- sensitive: z15.array(z15.string()),
1485
- epic: z15.array(z15.string()),
1486
- claim: z15.array(z15.string()),
1487
- review: z15.array(z15.string()),
1488
- priority: z15.array(z15.string())
1489
- });
1490
- var ShipDraftSourceSchema = z15.object({
1491
- id: z15.string(),
1492
- label: z15.string(),
1493
- found: z15.boolean()
1485
+ var ShipInferenceSchema = z16.object({
1486
+ evidence: z16.array(z16.string()),
1487
+ confidence: z16.enum(["high", "medium", "low"])
1488
+ });
1489
+ var ShipLabelBucketsSchema = z16.object({
1490
+ ready: z16.array(z16.string()),
1491
+ blocked: z16.array(z16.string()),
1492
+ sensitive: z16.array(z16.string()),
1493
+ epic: z16.array(z16.string()),
1494
+ claim: z16.array(z16.string()),
1495
+ review: z16.array(z16.string()),
1496
+ priority: z16.array(z16.string())
1497
+ });
1498
+ var ShipDraftSourceSchema = z16.object({
1499
+ id: z16.string(),
1500
+ label: z16.string(),
1501
+ found: z16.boolean()
1494
1502
  });
1495
- var ShipPolicyDraftSchema = z15.object({
1503
+ var ShipPolicyDraftSchema = z16.object({
1496
1504
  projectId: ShipProjectIdSchema,
1497
- repository: z15.object({
1505
+ repository: z16.object({
1498
1506
  slug: RepoSlugSchema,
1499
- defaultBranch: z15.string(),
1507
+ defaultBranch: z16.string(),
1500
1508
  headSha: CommitShaSchema
1501
1509
  }),
1502
- name: z15.string().min(1),
1503
- mission: z15.string().min(1),
1510
+ name: z16.string().min(1),
1511
+ mission: z16.string().min(1),
1504
1512
  policy: ShipPolicySchema,
1505
- labels: z15.array(z15.object({
1506
- name: z15.string(),
1507
- description: z15.string().nullable(),
1508
- openUsage: z15.number().int().nonnegative()
1513
+ labels: z16.array(z16.object({
1514
+ name: z16.string(),
1515
+ description: z16.string().nullable(),
1516
+ openUsage: z16.number().int().nonnegative()
1509
1517
  })),
1510
1518
  buckets: ShipLabelBucketsSchema,
1511
- inference: z15.record(ShipPolicyFieldIdSchema, ShipInferenceSchema),
1512
- sources: z15.array(ShipDraftSourceSchema)
1513
- });
1514
- var ShipPolicyControlSchema = z15.discriminatedUnion("control", [
1515
- z15.object({ control: z15.literal("text"), rows: z15.number().int().positive() }),
1516
- z15.object({
1517
- control: z15.literal("choice"),
1518
- options: z15.array(z15.object({ value: z15.string(), label: z15.string() }))
1519
+ inference: z16.record(ShipPolicyFieldIdSchema, ShipInferenceSchema),
1520
+ sources: z16.array(ShipDraftSourceSchema)
1521
+ });
1522
+ var ShipPolicyControlSchema = z16.discriminatedUnion("control", [
1523
+ z16.object({ control: z16.literal("text"), rows: z16.number().int().positive() }),
1524
+ z16.object({
1525
+ control: z16.literal("choice"),
1526
+ options: z16.array(z16.object({ value: z16.string(), label: z16.string() }))
1519
1527
  }),
1520
- z15.object({ control: z15.literal("labels") }),
1521
- z15.object({ control: z15.literal("claims") }),
1522
- z15.object({ control: z15.literal("commands") }),
1523
- z15.object({ control: z15.literal("evidence") }),
1524
- z15.object({ control: z15.literal("lines") }),
1525
- z15.object({ control: z15.literal("models") })
1528
+ z16.object({ control: z16.literal("labels") }),
1529
+ z16.object({ control: z16.literal("claims") }),
1530
+ z16.object({ control: z16.literal("commands") }),
1531
+ z16.object({ control: z16.literal("evidence") }),
1532
+ z16.object({ control: z16.literal("lines") }),
1533
+ z16.object({ control: z16.literal("models") })
1526
1534
  ]);
1527
- var ShipPolicyFieldDescriptorSchema = z15.object({
1535
+ var ShipPolicyFieldDescriptorSchema = z16.object({
1528
1536
  id: ShipPolicyFieldIdSchema,
1529
- label: z15.string(),
1530
- help: z15.string(),
1531
- section: z15.enum(["primary", "advanced"]),
1537
+ label: z16.string(),
1538
+ help: z16.string(),
1539
+ section: z16.enum(["primary", "advanced"]),
1532
1540
  /** Fields sharing a group are disclosed together under one heading. */
1533
- group: z15.string().nullable(),
1541
+ group: z16.string().nullable(),
1534
1542
  kind: ShipPolicyControlSchema
1535
1543
  });
1536
- var ShipRegistrationSchemaSchema = z15.object({
1537
- shipRevision: z15.string(),
1544
+ var ShipRegistrationSchemaSchema = z16.object({
1545
+ shipRevision: z16.string(),
1538
1546
  policySchemaVersion: ShipPolicySchema.shape.schemaVersion,
1539
- fields: z15.array(ShipPolicyFieldDescriptorSchema)
1547
+ fields: z16.array(ShipPolicyFieldDescriptorSchema)
1540
1548
  });
1541
- var ShipManifestFileSchema = z15.object({
1542
- path: z15.string().min(1),
1543
- contents: z15.string(),
1549
+ var ShipManifestFileSchema = z16.object({
1550
+ path: z16.string().min(1),
1551
+ contents: z16.string(),
1544
1552
  sha256: Sha256Schema,
1545
- bytes: z15.number().int().nonnegative()
1553
+ bytes: z16.number().int().nonnegative()
1546
1554
  });
1547
- var ShipPreflightCheckSchema = z15.object({
1548
- id: z15.enum(["project-loader", "skill-discovery", "bounds", "project-id"]),
1549
- label: z15.string(),
1550
- detail: z15.string()
1555
+ var ShipPreflightCheckSchema = z16.object({
1556
+ id: z16.enum(["project-loader", "skill-discovery", "bounds", "project-id"]),
1557
+ label: z16.string(),
1558
+ detail: z16.string()
1551
1559
  });
1552
- var ShipRegistrationManifestSchema = z15.object({
1560
+ var ShipRegistrationManifestSchema = z16.object({
1553
1561
  intent: ShipRegistrationIntentSchema,
1554
1562
  projectId: ShipProjectIdSchema,
1555
1563
  githubRepoId: GithubIdSchema,
1556
- repository: z15.object({ slug: RepoSlugSchema, branch: z15.string(), baseSha: CommitShaSchema }),
1557
- files: z15.array(ShipManifestFileSchema).min(1),
1564
+ repository: z16.object({ slug: RepoSlugSchema, branch: z16.string(), baseSha: CommitShaSchema }),
1565
+ files: z16.array(ShipManifestFileSchema).min(1),
1558
1566
  digest: Sha256Schema,
1559
- challenge: z15.string().min(1),
1560
- commitMessage: z15.string().min(1),
1561
- checks: z15.array(ShipPreflightCheckSchema),
1562
- shipRevision: z15.string()
1567
+ challenge: z16.string().min(1),
1568
+ commitMessage: z16.string().min(1),
1569
+ checks: z16.array(ShipPreflightCheckSchema),
1570
+ shipRevision: z16.string()
1563
1571
  });
1564
- var ShipCommitSchema = z15.object({
1572
+ var ShipCommitSchema = z16.object({
1565
1573
  sha: CommitShaSchema,
1566
- url: z15.string().url(),
1567
- committedAt: z15.string().datetime()
1574
+ url: z16.string().url(),
1575
+ committedAt: z16.string().datetime()
1568
1576
  });
1569
- var ShipRegistrationReceiptSchema = z15.object({
1577
+ var ShipRegistrationReceiptSchema = z16.object({
1570
1578
  projectId: ShipProjectIdSchema,
1571
1579
  commit: ShipCommitSchema,
1572
- branch: z15.string(),
1573
- attempts: z15.number().int().positive(),
1574
- dispatched: z15.boolean()
1580
+ branch: z16.string(),
1581
+ attempts: z16.number().int().positive(),
1582
+ dispatched: z16.boolean()
1575
1583
  });
1576
- var ShipPublishDispatchSchema = z15.object({
1577
- dispatched: z15.boolean(),
1578
- workflow: z15.string(),
1579
- branch: z15.string()
1584
+ var ShipPublishDispatchSchema = z16.object({
1585
+ dispatched: z16.boolean(),
1586
+ workflow: z16.string(),
1587
+ branch: z16.string()
1580
1588
  });
1581
- var ShipPublicationStateSchema = z15.enum([
1589
+ var ShipPublicationStateSchema = z16.enum([
1582
1590
  "absent",
1583
1591
  "committed",
1584
1592
  "building",
1585
1593
  "live",
1586
1594
  "failed"
1587
1595
  ]);
1588
- var ShipPublishRunSchema = z15.object({
1589
- id: z15.number().int().positive(),
1590
- url: z15.string().url(),
1596
+ var ShipPublishRunSchema = z16.object({
1597
+ id: z16.number().int().positive(),
1598
+ url: z16.string().url(),
1591
1599
  headSha: CommitShaSchema,
1592
- status: z15.string(),
1593
- conclusion: z15.string().nullable(),
1594
- startedAt: z15.string().datetime()
1600
+ status: z16.string(),
1601
+ conclusion: z16.string().nullable(),
1602
+ startedAt: z16.string().datetime()
1595
1603
  });
1596
- var ShipPublicationSchema = z15.object({
1604
+ var ShipPublicationSchema = z16.object({
1597
1605
  state: ShipPublicationStateSchema,
1598
1606
  projectId: ShipProjectIdSchema,
1599
1607
  commit: ShipCommitSchema.nullable(),
1600
1608
  branchHead: CommitShaSchema,
1601
- publishedRevision: z15.string().nullable(),
1609
+ publishedRevision: z16.string().nullable(),
1602
1610
  run: ShipPublishRunSchema.nullable(),
1603
- skillUrl: z15.string().url().nullable()
1611
+ skillUrl: z16.string().url().nullable()
1604
1612
  });
1605
1613
 
1606
1614
  // ../../packages/contracts/dist/ShipStatic.js
1607
- import { z as z16 } from "zod";
1608
- var ShipStaticIndexSchema = z16.object({
1609
- schemaVersion: z16.literal(1),
1610
- generatedAt: z16.string().datetime(),
1611
- source: z16.object({ repository: z16.string(), revision: z16.string() }),
1612
- snapshot: z16.object({
1613
- schemaVersion: z16.literal(3),
1615
+ import { z as z17 } from "zod";
1616
+ var ShipStaticIndexSchema = z17.object({
1617
+ schemaVersion: z17.literal(1),
1618
+ generatedAt: z17.string().datetime(),
1619
+ source: z17.object({ repository: z17.string(), revision: z17.string() }),
1620
+ snapshot: z17.object({
1621
+ schemaVersion: z17.literal(3),
1614
1622
  url: HttpUrlSchema,
1615
1623
  sha256: Sha256Schema,
1616
- bytes: z16.number().int().nonnegative()
1624
+ bytes: z17.number().int().nonnegative()
1617
1625
  })
1618
1626
  });
1619
- var ShipSkillManifestSchema = z16.object({
1620
- schemaVersion: z16.literal(1),
1621
- id: z16.string(),
1622
- name: z16.string(),
1623
- repository: z16.string(),
1624
- revision: z16.string(),
1625
- source: z16.object({
1626
- path: z16.string(),
1627
+ var ShipSkillManifestSchema = z17.object({
1628
+ schemaVersion: z17.literal(1),
1629
+ id: z17.string(),
1630
+ name: z17.string(),
1631
+ repository: z17.string(),
1632
+ revision: z17.string(),
1633
+ source: z17.object({
1634
+ path: z17.string(),
1627
1635
  url: HttpUrlSchema,
1628
1636
  publicUrl: HttpUrlSchema,
1629
1637
  sha256: Sha256Schema
1630
1638
  }),
1631
- archive: z16.object({
1639
+ archive: z17.object({
1632
1640
  url: HttpUrlSchema,
1633
1641
  checksumUrl: HttpUrlSchema,
1634
1642
  sha256: Sha256Schema,
1635
- bytes: z16.number().int().nonnegative()
1643
+ bytes: z17.number().int().nonnegative()
1636
1644
  }),
1637
- authority: z16.object({
1645
+ authority: z17.object({
1638
1646
  apiOrigin: HttpUrlSchema,
1639
1647
  rawOrigin: HttpUrlSchema,
1640
- canonicalPath: z16.string(),
1641
- branch: z16.string()
1648
+ canonicalPath: z17.string(),
1649
+ branch: z17.string()
1642
1650
  })
1643
1651
  });
1644
- var ShipSkillsIndexSchema = z16.object({
1645
- schemaVersion: z16.literal(1),
1646
- generatedAt: z16.string().datetime(),
1647
- repository: z16.string(),
1648
- revision: z16.string(),
1649
- skills: z16.array(ShipSkillManifestSchema)
1652
+ var ShipSkillsIndexSchema = z17.object({
1653
+ schemaVersion: z17.literal(1),
1654
+ generatedAt: z17.string().datetime(),
1655
+ repository: z17.string(),
1656
+ revision: z17.string(),
1657
+ skills: z17.array(ShipSkillManifestSchema)
1650
1658
  });
1651
1659
  var shipStaticOrigin = "https://ship.freecodefund.xyz";
1652
1660
  var shipStaticPaths = {
@@ -1659,190 +1667,189 @@ var shipStaticPaths = {
1659
1667
  };
1660
1668
 
1661
1669
  // ../../packages/contracts/dist/Status.js
1662
- import { z as z17 } from "zod";
1663
- var PlatformIssueSchema = z17.discriminatedUnion("kind", [
1664
- z17.object({
1665
- kind: z17.literal("indexer-lag"),
1666
- id: z17.string().min(1),
1667
- lagSeconds: z17.number().int().nonnegative(),
1668
- blocksBehind: z17.number().int().nonnegative()
1670
+ import { z as z18 } from "zod";
1671
+ var PlatformIssueSchema = z18.discriminatedUnion("kind", [
1672
+ z18.object({
1673
+ kind: z18.literal("indexer-lag"),
1674
+ id: z18.string().min(1),
1675
+ lagSeconds: z18.number().int().nonnegative(),
1676
+ blocksBehind: z18.number().int().nonnegative()
1669
1677
  }),
1670
- z17.object({
1671
- kind: z17.literal("indexer-offline"),
1672
- id: z17.string().min(1)
1678
+ z18.object({
1679
+ kind: z18.literal("indexer-offline"),
1680
+ id: z18.string().min(1)
1673
1681
  }),
1674
- z17.object({
1675
- kind: z17.literal("rpc-failover"),
1676
- id: z17.string().min(1),
1677
- provider: z17.string().min(1)
1682
+ z18.object({
1683
+ kind: z18.literal("rpc-failover"),
1684
+ id: z18.string().min(1),
1685
+ provider: z18.string().min(1)
1678
1686
  }),
1679
- z17.object({
1680
- kind: z17.literal("rpc-outage"),
1681
- id: z17.string().min(1)
1687
+ z18.object({
1688
+ kind: z18.literal("rpc-outage"),
1689
+ id: z18.string().min(1)
1682
1690
  }),
1683
- z17.object({
1684
- kind: z17.literal("contract-paused"),
1685
- id: z17.string().min(1),
1686
- contract: z17.literal("Doppler Airlock")
1691
+ z18.object({
1692
+ kind: z18.literal("contract-paused"),
1693
+ id: z18.string().min(1),
1694
+ contract: z18.literal("Doppler Airlock")
1687
1695
  }),
1688
- z17.object({
1689
- kind: z17.literal("auth-unconfigured"),
1690
- id: z17.string().min(1)
1696
+ z18.object({
1697
+ kind: z18.literal("auth-unconfigured"),
1698
+ id: z18.string().min(1)
1691
1699
  }),
1692
- z17.object({
1693
- kind: z17.literal("sponsorship-unavailable"),
1694
- id: z17.string().min(1),
1695
- reason: z17.literal("privy-unreachable")
1700
+ z18.object({
1701
+ kind: z18.literal("sponsorship-unavailable"),
1702
+ id: z18.string().min(1),
1703
+ reason: z18.literal("privy-unreachable")
1696
1704
  }),
1697
- z17.object({
1698
- kind: z17.literal("maintenance"),
1699
- id: z17.string().min(1),
1700
- message: z17.string().min(1),
1701
- startsAt: z17.string().datetime(),
1702
- endsAt: z17.string().datetime()
1705
+ z18.object({
1706
+ kind: z18.literal("maintenance"),
1707
+ id: z18.string().min(1),
1708
+ message: z18.string().min(1),
1709
+ startsAt: z18.string().datetime(),
1710
+ endsAt: z18.string().datetime()
1703
1711
  })
1704
1712
  ]);
1705
- var PlatformStatusSchema = z17.object({
1706
- generatedAt: z17.string().datetime(),
1707
- chainId: z17.literal(8453),
1708
- statusPageUrl: z17.string().url(),
1709
- issues: z17.array(PlatformIssueSchema)
1713
+ var PlatformStatusSchema = z18.object({
1714
+ generatedAt: z18.string().datetime(),
1715
+ chainId: z18.literal(8453),
1716
+ statusPageUrl: z18.string().url(),
1717
+ issues: z18.array(PlatformIssueSchema)
1710
1718
  });
1711
1719
 
1712
1720
  // ../../packages/contracts/dist/Wallet.js
1713
- import { z as z18 } from "zod";
1714
- var baseChainId = z18.literal(8453);
1715
- var TokenTotalSchema = z18.object({ token: TokenSchema, baseUnits: BaseUnitsSchema });
1716
- var TokenClassificationSchema = z18.enum(["numeraire", "market", "other"]);
1721
+ import { z as z19 } from "zod";
1722
+ var baseChainId = z19.literal(8453);
1723
+ var TokenTotalSchema = z19.object({ token: TokenSchema, baseUnits: BaseUnitsSchema });
1724
+ var TokenClassificationSchema = z19.enum(["numeraire", "market", "other"]);
1717
1725
  var Erc20MetadataSchema = TokenSchema.extend({
1718
- name: z18.string(),
1726
+ name: z19.string(),
1719
1727
  classification: TokenClassificationSchema,
1720
1728
  /** The market this token belongs to, present only for `market` tokens. */
1721
1729
  githubRepoId: GithubIdSchema.nullable()
1722
1730
  });
1723
- var Erc20MetadataEntrySchema = z18.discriminatedUnion("status", [
1724
- z18.object({ status: z18.literal("resolved"), token: Erc20MetadataSchema }),
1725
- z18.object({ status: z18.literal("unresolved"), address: AddressSchema })
1731
+ var Erc20MetadataEntrySchema = z19.discriminatedUnion("status", [
1732
+ z19.object({ status: z19.literal("resolved"), token: Erc20MetadataSchema }),
1733
+ z19.object({ status: z19.literal("unresolved"), address: AddressSchema })
1726
1734
  ]);
1727
- var Erc20MetadataBatchSchema = z18.object({ tokens: z18.array(Erc20MetadataEntrySchema) });
1728
- var Erc20BalanceSchema = z18.object({
1735
+ var Erc20MetadataBatchSchema = z19.object({ tokens: z19.array(Erc20MetadataEntrySchema) });
1736
+ var Erc20BalanceSchema = z19.object({
1729
1737
  raw: BaseUnitsSchema,
1730
- formatted: z18.string(),
1738
+ formatted: z19.string(),
1731
1739
  /** Present only when the caller named a spender. */
1732
1740
  allowance: BaseUnitsSchema.nullable(),
1733
1741
  gasPriceWei: BaseUnitsSchema
1734
1742
  });
1735
- var NativeHoldingSchema = z18.object({
1736
- kind: z18.literal("native"),
1737
- symbol: z18.literal("ETH"),
1738
- decimals: z18.literal(18),
1743
+ var NativeHoldingSchema = z19.object({
1744
+ kind: z19.literal("native"),
1745
+ symbol: z19.literal("ETH"),
1746
+ decimals: z19.literal(18),
1739
1747
  baseUnits: BaseUnitsSchema
1740
1748
  });
1741
- var TokenHoldingSchema = z18.object({
1742
- kind: z18.literal("token"),
1749
+ var TokenHoldingSchema = z19.object({
1750
+ kind: z19.literal("token"),
1743
1751
  token: Erc20MetadataSchema,
1744
1752
  baseUnits: BaseUnitsSchema
1745
1753
  });
1746
- var WalletHoldingSchema = z18.discriminatedUnion("kind", [
1754
+ var WalletHoldingSchema = z19.discriminatedUnion("kind", [
1747
1755
  NativeHoldingSchema,
1748
1756
  TokenHoldingSchema
1749
1757
  ]);
1750
- var WalletBalancesSchema = z18.object({
1751
- generatedAt: z18.string().datetime(),
1758
+ var WalletBalancesSchema = z19.object({
1759
+ generatedAt: z19.string().datetime(),
1752
1760
  wallet: AddressSchema,
1753
1761
  native: NativeHoldingSchema,
1754
1762
  /** Tokens with a nonzero balance, the rows a wallet page shows by default. */
1755
- held: z18.array(TokenHoldingSchema),
1763
+ held: z19.array(TokenHoldingSchema),
1756
1764
  /** Candidate tokens the wallet does not currently hold. */
1757
- empty: z18.array(TokenHoldingSchema)
1765
+ empty: z19.array(TokenHoldingSchema)
1758
1766
  });
1759
- var TokenPriceSchema = z18.discriminatedUnion("priced", [
1760
- z18.object({
1767
+ var TokenPriceSchema = z19.discriminatedUnion("priced", [
1768
+ z19.object({
1761
1769
  address: AddressSchema,
1762
- priced: z18.literal(true),
1763
- priceUsdc: z18.string().regex(/^\d+(?:\.\d+)?$/),
1764
- priceChange24hPercent: z18.number().nullable()
1770
+ priced: z19.literal(true),
1771
+ priceUsd: z19.string().regex(/^\d+(?:\.\d+)?$/),
1772
+ priceChange24hPercent: z19.number().nullable()
1765
1773
  }),
1766
- z18.object({ address: AddressSchema, priced: z18.literal(false) })
1774
+ z19.object({ address: AddressSchema, priced: z19.literal(false) })
1767
1775
  ]);
1768
- var TokenPricesSchema = z18.object({
1769
- generatedAt: z18.string().datetime(),
1770
- numeraire: AddressSchema,
1771
- prices: z18.array(TokenPriceSchema)
1776
+ var TokenPricesSchema = z19.object({
1777
+ generatedAt: z19.string().datetime(),
1778
+ prices: z19.array(TokenPriceSchema)
1772
1779
  });
1773
- var WalletReceiveSchema = z18.object({
1780
+ var WalletReceiveSchema = z19.object({
1774
1781
  address: AddressSchema,
1775
1782
  /** EIP-681 payment request carrying the chain id, so a scanner pre-selects Base. */
1776
- uri: z18.string().min(1),
1777
- chain: z18.object({
1783
+ uri: z19.string().min(1),
1784
+ chain: z19.object({
1778
1785
  id: baseChainId,
1779
- name: z18.literal("Base"),
1780
- explorerUrl: z18.string().url()
1786
+ name: z19.literal("Base"),
1787
+ explorerUrl: z19.string().url()
1781
1788
  }),
1782
- accepts: z18.string().min(1),
1783
- warning: z18.string().min(1)
1784
- });
1785
- var RecipientMethodSchema = z18.enum(["address", "basename", "github"]);
1786
- var RecipientResolutionSchema = z18.discriminatedUnion("status", [
1787
- z18.object({
1788
- status: z18.literal("resolved"),
1789
- query: z18.string(),
1789
+ accepts: z19.string().min(1),
1790
+ warning: z19.string().min(1)
1791
+ });
1792
+ var RecipientMethodSchema = z19.enum(["address", "basename", "github"]);
1793
+ var RecipientResolutionSchema = z19.discriminatedUnion("status", [
1794
+ z19.object({
1795
+ status: z19.literal("resolved"),
1796
+ query: z19.string(),
1790
1797
  address: AddressSchema,
1791
1798
  method: RecipientMethodSchema,
1792
- label: z18.string().min(1),
1799
+ label: z19.string().min(1),
1793
1800
  /** A caution about the input itself, such as an address typed without checksum. */
1794
- note: z18.string().nullable()
1801
+ note: z19.string().nullable()
1795
1802
  }),
1796
- z18.object({ status: z18.literal("unresolved"), query: z18.string(), reason: z18.string().min(1) })
1803
+ z19.object({ status: z19.literal("unresolved"), query: z19.string(), reason: z19.string().min(1) })
1797
1804
  ]);
1798
- var TransferAssetSchema = z18.discriminatedUnion("kind", [
1799
- z18.object({ kind: z18.literal("native") }),
1800
- z18.object({ kind: z18.literal("token"), address: AddressSchema })
1805
+ var TransferAssetSchema = z19.discriminatedUnion("kind", [
1806
+ z19.object({ kind: z19.literal("native") }),
1807
+ z19.object({ kind: z19.literal("token"), address: AddressSchema })
1801
1808
  ]);
1802
- var TransferRequestSchema = z18.object({
1809
+ var TransferRequestSchema = z19.object({
1803
1810
  from: AddressSchema,
1804
1811
  asset: TransferAssetSchema,
1805
- amountBaseUnits: z18.string().regex(/^[1-9]\d*$/),
1812
+ amountBaseUnits: z19.string().regex(/^[1-9]\d*$/),
1806
1813
  /** Exactly what the person typed, so the server resolves it rather than trusting an echo. */
1807
- recipient: z18.string().trim().min(1).max(200)
1814
+ recipient: z19.string().trim().min(1).max(200)
1808
1815
  });
1809
- var TransferBlockerCodeSchema = z18.enum([
1816
+ var TransferBlockerCodeSchema = z19.enum([
1810
1817
  "RECIPIENT_UNRESOLVED",
1811
1818
  "SELF_TRANSFER",
1812
1819
  "INSUFFICIENT_BALANCE",
1813
1820
  "INSUFFICIENT_GAS"
1814
1821
  ]);
1815
- var TransferVerdictSchema = z18.discriminatedUnion("status", [
1816
- z18.object({ status: z18.literal("ready") }),
1817
- z18.object({
1818
- status: z18.literal("blocked"),
1822
+ var TransferVerdictSchema = z19.discriminatedUnion("status", [
1823
+ z19.object({ status: z19.literal("ready") }),
1824
+ z19.object({
1825
+ status: z19.literal("blocked"),
1819
1826
  code: TransferBlockerCodeSchema,
1820
- message: z18.string().min(1)
1827
+ message: z19.string().min(1)
1821
1828
  })
1822
1829
  ]);
1823
- var BalanceDeltaSchema = z18.object({
1830
+ var BalanceDeltaSchema = z19.object({
1824
1831
  token: TokenSchema.omit({ address: true }).extend({ address: AddressSchema.nullable() }),
1825
1832
  before: BaseUnitsSchema,
1826
1833
  after: BaseUnitsSchema
1827
1834
  });
1828
- var TransferPreviewSchema = z18.object({
1835
+ var TransferPreviewSchema = z19.object({
1829
1836
  recipient: RecipientResolutionSchema,
1830
1837
  amount: TokenAmountSchema,
1831
- gas: z18.object({
1838
+ gas: z19.object({
1832
1839
  limit: BaseUnitsSchema,
1833
1840
  priceWei: BaseUnitsSchema,
1834
1841
  costWei: BaseUnitsSchema
1835
1842
  }).nullable(),
1836
1843
  /** The sender's balances before and after, asset first and gas currency second. */
1837
- after: z18.array(BalanceDeltaSchema),
1838
- firstTimeRecipient: z18.boolean(),
1844
+ after: z19.array(BalanceDeltaSchema),
1845
+ firstTimeRecipient: z19.boolean(),
1839
1846
  verdict: TransferVerdictSchema
1840
1847
  });
1841
1848
  var TransferBuildRequestSchema = TransferRequestSchema.extend({
1842
1849
  /** The address the preview resolved, so a name that moved since is refused. */
1843
1850
  expectedRecipient: AddressSchema
1844
1851
  });
1845
- var WalletTransactionSchema = z18.object({
1852
+ var WalletTransactionSchema = z19.object({
1846
1853
  to: AddressSchema,
1847
1854
  data: HexSchema,
1848
1855
  value: BaseUnitsSchema,
@@ -1851,108 +1858,108 @@ var WalletTransactionSchema = z18.object({
1851
1858
  var SponsoredWalletTransferSubmissionSchema = SponsoredOperationSubmissionSchema.extend({
1852
1859
  transaction: WalletTransactionSchema
1853
1860
  });
1854
- var WalletEarningsSchema = z18.object({
1855
- generatedAt: z18.string().datetime(),
1861
+ var WalletEarningsSchema = z19.object({
1862
+ generatedAt: z19.string().datetime(),
1856
1863
  wallet: AddressSchema,
1857
- royalties: z18.array(QuickActionRoyaltySchema),
1864
+ royalties: z19.array(QuickActionRoyaltySchema),
1858
1865
  /** How many wallet calls "collect all" will ask for, stated before the prompt. */
1859
- collectCallCount: z18.number().int().nonnegative(),
1860
- collectable: z18.array(TokenTotalSchema),
1861
- payouts: z18.object({
1866
+ collectCallCount: z19.number().int().nonnegative(),
1867
+ collectable: z19.array(TokenTotalSchema),
1868
+ payouts: z19.object({
1862
1869
  githubUserId: GithubIdSchema,
1863
- settled: z18.array(ContributorPayoutSchema),
1864
- projection: z18.object({ cycle: z18.string(), totals: z18.array(TokenTotalSchema) })
1870
+ settled: z19.array(ContributorPayoutSchema),
1871
+ projection: z19.object({ cycle: z19.string(), totals: z19.array(TokenTotalSchema) })
1865
1872
  }).nullable()
1866
1873
  });
1867
- var WalletEarningsCallsSchema = z18.object({
1868
- calls: z18.array(QuickActionCallSchema),
1869
- count: z18.number().int().nonnegative(),
1870
- sponsorship: z18.object({
1871
- markets: z18.array(MarketSponsorshipSchema),
1872
- sponsorable: z18.number().int().nonnegative()
1874
+ var WalletEarningsCallsSchema = z19.object({
1875
+ calls: z19.array(QuickActionCallSchema),
1876
+ count: z19.number().int().nonnegative(),
1877
+ sponsorship: z19.object({
1878
+ markets: z19.array(MarketSponsorshipSchema),
1879
+ sponsorable: z19.number().int().nonnegative()
1873
1880
  })
1874
1881
  });
1875
- var WalletActivityKindSchema = z18.enum(["sent", "received", "trades", "royalties", "keys"]);
1876
- var ActivityBaseSchema = z18.object({
1877
- id: z18.string().min(1),
1878
- occurredAt: z18.string().datetime(),
1882
+ var WalletActivityKindSchema = z19.enum(["sent", "received", "trades", "royalties", "keys"]);
1883
+ var ActivityBaseSchema = z19.object({
1884
+ id: z19.string().min(1),
1885
+ occurredAt: z19.string().datetime(),
1879
1886
  txHash: HexSchema
1880
1887
  });
1881
- var DirectionSchema = z18.enum(["sent", "received"]);
1882
- var WalletActivityEntrySchema = z18.discriminatedUnion("kind", [
1888
+ var DirectionSchema = z19.enum(["sent", "received"]);
1889
+ var WalletActivityEntrySchema = z19.discriminatedUnion("kind", [
1883
1890
  ActivityBaseSchema.extend({
1884
- kind: z18.literal("transfer"),
1891
+ kind: z19.literal("transfer"),
1885
1892
  direction: DirectionSchema,
1886
1893
  amount: TokenAmountSchema,
1887
1894
  counterparty: AddressSchema,
1888
1895
  marketId: GithubIdSchema
1889
1896
  }),
1890
1897
  ActivityBaseSchema.extend({
1891
- kind: z18.literal("trade"),
1892
- side: z18.enum(["buy", "sell"]),
1898
+ kind: z19.literal("trade"),
1899
+ side: z19.enum(["buy", "sell"]),
1893
1900
  amount: TokenAmountSchema,
1894
1901
  settled: TokenAmountSchema,
1895
1902
  marketId: GithubIdSchema
1896
1903
  }),
1897
1904
  ActivityBaseSchema.extend({
1898
- kind: z18.literal("royalty"),
1905
+ kind: z19.literal("royalty"),
1899
1906
  amount: TokenAmountSchema,
1900
1907
  marketId: GithubIdSchema,
1901
1908
  repository: RepoSlugSchema
1902
1909
  }),
1903
1910
  ActivityBaseSchema.extend({
1904
- kind: z18.literal("payout"),
1911
+ kind: z19.literal("payout"),
1905
1912
  amount: TokenAmountSchema,
1906
- projectId: z18.string().min(1),
1907
- cycle: z18.string().min(1)
1913
+ projectId: z19.string().min(1),
1914
+ cycle: z19.string().min(1)
1908
1915
  }),
1909
1916
  ActivityBaseSchema.extend({
1910
- kind: z18.literal("rik"),
1917
+ kind: z19.literal("rik"),
1911
1918
  direction: DirectionSchema,
1912
1919
  repository: RepoSlugSchema,
1913
1920
  marketId: GithubIdSchema,
1914
1921
  counterparty: AddressSchema
1915
1922
  }),
1916
1923
  ActivityBaseSchema.extend({
1917
- kind: z18.literal("uik"),
1924
+ kind: z19.literal("uik"),
1918
1925
  githubUserId: GithubIdSchema
1919
1926
  })
1920
1927
  ]);
1921
- var WalletActivitySchema = z18.object({
1922
- generatedAt: z18.string().datetime(),
1928
+ var WalletActivitySchema = z19.object({
1929
+ generatedAt: z19.string().datetime(),
1923
1930
  wallet: AddressSchema,
1924
- entries: z18.array(WalletActivityEntrySchema),
1931
+ entries: z19.array(WalletActivityEntrySchema),
1925
1932
  /** Pass back as `before` to load the next older page; null when the ledger is exhausted. */
1926
- nextBefore: z18.string().datetime().nullable()
1933
+ nextBefore: z19.string().datetime().nullable()
1927
1934
  });
1928
- var EmbeddedWalletClientTypeSchema = z18.enum(["privy", "privy-v2"]);
1929
- var PrivySubjectSchema = z18.object({
1930
- did: z18.string().min(1),
1931
- wallets: z18.array(z18.object({
1935
+ var EmbeddedWalletClientTypeSchema = z19.enum(["privy", "privy-v2"]);
1936
+ var PrivySubjectSchema = z19.object({
1937
+ did: z19.string().min(1),
1938
+ wallets: z19.array(z19.object({
1932
1939
  address: AddressSchema,
1933
- clientType: z18.string().nullable(),
1934
- connectorType: z18.string().nullable(),
1935
- embedded: z18.boolean()
1940
+ clientType: z19.string().nullable(),
1941
+ connectorType: z19.string().nullable(),
1942
+ embedded: z19.boolean()
1936
1943
  })),
1937
- loginMethods: z18.array(z18.discriminatedUnion("kind", [
1938
- z18.object({ kind: z18.literal("email"), address: z18.string().min(1) }),
1939
- z18.object({ kind: z18.literal("phone"), number: z18.string().min(1) }),
1940
- z18.object({ kind: z18.literal("wallet"), address: AddressSchema })
1944
+ loginMethods: z19.array(z19.discriminatedUnion("kind", [
1945
+ z19.object({ kind: z19.literal("email"), address: z19.string().min(1) }),
1946
+ z19.object({ kind: z19.literal("phone"), number: z19.string().min(1) }),
1947
+ z19.object({ kind: z19.literal("wallet"), address: AddressSchema })
1941
1948
  ])),
1942
- recoveryMethod: z18.string().nullable()
1949
+ recoveryMethod: z19.string().nullable()
1943
1950
  });
1944
1951
  var WhoamiSchema = PrivySubjectSchema.extend({
1945
1952
  embeddedWalletAddress: AddressSchema.nullable()
1946
1953
  });
1947
- var WalletSecuritySchema = z18.object({
1954
+ var WalletSecuritySchema = z19.object({
1948
1955
  subject: PrivySubjectSchema,
1949
- wallets: z18.array(z18.object({
1956
+ wallets: z19.array(z19.object({
1950
1957
  address: AddressSchema,
1951
- clientType: z18.string().nullable(),
1952
- embedded: z18.boolean(),
1953
- exportable: z18.boolean()
1958
+ clientType: z19.string().nullable(),
1959
+ embedded: z19.boolean(),
1960
+ exportable: z19.boolean()
1954
1961
  })),
1955
- identities: z18.array(z18.object({ githubUserId: GithubIdSchema, login: z18.string().min(1), boundAt: z18.number().int() })),
1962
+ identities: z19.array(z19.object({ githubUserId: GithubIdSchema, login: z19.string().min(1), boundAt: z19.number().int() })),
1956
1963
  delegation: SponsorshipDelegationSchema
1957
1964
  });
1958
1965
 
@@ -2001,126 +2008,126 @@ function exitCodeFor(problem) {
2001
2008
  }
2002
2009
 
2003
2010
  // ../../packages/launch-machine/dist/Funding.js
2004
- import { z as z19 } from "zod";
2005
- var BootstrapFundingSchema = z19.object({
2006
- kind: z19.literal("bootstrap"),
2011
+ import { z as z20 } from "zod";
2012
+ var BootstrapFundingSchema = z20.object({
2013
+ kind: z20.literal("bootstrap"),
2007
2014
  token: TokenMetadataSchema,
2008
2015
  monthlyPoolBaseUnits: PositiveBaseUnitsSchema,
2009
2016
  committedBaseUnits: PositiveBaseUnitsSchema,
2010
- startsAt: z19.string().datetime()
2017
+ startsAt: z20.string().datetime()
2011
2018
  });
2012
- var MarketFundingSchema = z19.object({
2013
- kind: z19.literal("market"),
2019
+ var MarketFundingSchema = z20.object({
2020
+ kind: z20.literal("market"),
2014
2021
  asset: AddressSchema,
2015
2022
  token: TokenMetadataSchema,
2016
2023
  monthlyPoolBaseUnits: PositiveBaseUnitsSchema,
2017
- startsAt: z19.string().datetime()
2024
+ startsAt: z20.string().datetime()
2018
2025
  });
2019
- var FundingSchema = z19.discriminatedUnion("kind", [
2026
+ var FundingSchema = z20.discriminatedUnion("kind", [
2020
2027
  BootstrapFundingSchema,
2021
2028
  MarketFundingSchema
2022
2029
  ]);
2023
2030
 
2024
2031
  // ../../packages/launch-machine/dist/LaunchContext.js
2025
- import { z as z22 } from "zod";
2032
+ import { z as z23 } from "zod";
2026
2033
 
2027
2034
  // ../../packages/launch-machine/dist/LaunchRequest.js
2028
- import { z as z21 } from "zod";
2035
+ import { z as z22 } from "zod";
2029
2036
 
2030
2037
  // ../../packages/launch-machine/dist/OperationId.js
2031
- import { z as z20 } from "zod";
2032
- var OperationIdSchema = z20.string().regex(/^[0-9A-HJKMNP-TV-Z]{26}$/);
2038
+ import { z as z21 } from "zod";
2039
+ var OperationIdSchema = z21.string().regex(/^[0-9A-HJKMNP-TV-Z]{26}$/);
2033
2040
 
2034
2041
  // ../../packages/launch-machine/dist/LaunchRequest.js
2035
- var RewardIntentSchema = z21.discriminatedUnion("kind", [
2036
- z21.object({ kind: z21.literal("unspecified") }),
2037
- z21.object({ kind: z21.literal("disabled") }),
2038
- z21.object({
2039
- kind: z21.literal("monthly"),
2042
+ var RewardIntentSchema = z22.discriminatedUnion("kind", [
2043
+ z22.object({ kind: z22.literal("unspecified") }),
2044
+ z22.object({ kind: z22.literal("disabled") }),
2045
+ z22.object({
2046
+ kind: z22.literal("monthly"),
2040
2047
  /* A decimal string until the reward token's precision is known, then
2041
2048
  converted exactly. Parsing it earlier would round it. */
2042
- amount: z21.string().min(1),
2043
- startDate: z21.string().optional()
2049
+ amount: z22.string().min(1),
2050
+ startDate: z22.string().optional()
2044
2051
  })
2045
2052
  ]);
2046
- var MarketOverridesSchema = z21.object({
2047
- name: z21.string().optional(),
2048
- symbol: z21.string().optional(),
2049
- imagePath: z21.string().optional(),
2050
- devBuy: z21.string().optional()
2053
+ var MarketOverridesSchema = z22.object({
2054
+ name: z22.string().optional(),
2055
+ symbol: z22.string().optional(),
2056
+ imagePath: z22.string().optional(),
2057
+ devBuy: z22.string().optional()
2051
2058
  });
2052
- var LaunchRequestSchema = z21.object({
2059
+ var LaunchRequestSchema = z22.object({
2053
2060
  operationId: OperationIdSchema,
2054
- cwd: z21.string().min(1),
2055
- repository: z21.string().optional(),
2061
+ cwd: z22.string().min(1),
2062
+ repository: z22.string().optional(),
2056
2063
  reward: RewardIntentSchema,
2057
2064
  market: MarketOverridesSchema,
2058
- interactive: z21.boolean(),
2059
- dryRun: z21.boolean()
2065
+ interactive: z22.boolean(),
2066
+ dryRun: z22.boolean()
2060
2067
  });
2061
2068
 
2062
2069
  // ../../packages/launch-machine/dist/LaunchContext.js
2063
- var LocalRepositorySchema = z22.object({
2070
+ var LocalRepositorySchema = z23.object({
2064
2071
  slug: RepoSlugSchema,
2065
- root: z22.string().min(1),
2072
+ root: z23.string().min(1),
2066
2073
  headSha: CommitShaSchema.optional()
2067
2074
  });
2068
- var GithubPrincipalSchema = z22.object({
2069
- id: z22.number().int().positive(),
2070
- login: z22.string().min(1)
2075
+ var GithubPrincipalSchema = z23.object({
2076
+ id: z23.number().int().positive(),
2077
+ login: z23.string().min(1)
2071
2078
  });
2072
- var WalletSigningSchema = z22.enum(["delegated", "external"]);
2073
- var LaunchRepositorySchema = z22.object({
2074
- id: z22.number().int().positive(),
2079
+ var WalletSigningSchema = z23.enum(["delegated", "external"]);
2080
+ var LaunchRepositorySchema = z23.object({
2081
+ id: z23.number().int().positive(),
2075
2082
  slug: RepoSlugSchema,
2076
- root: z22.string().min(1),
2077
- defaultBranch: z22.string().min(1),
2083
+ root: z23.string().min(1),
2084
+ defaultBranch: z23.string().min(1),
2078
2085
  headSha: CommitShaSchema.optional(),
2079
2086
  shipProjectId: ShipProjectIdSchema.nullable()
2080
2087
  });
2081
- var KeyBindingRefSchema = z22.object({
2088
+ var KeyBindingRefSchema = z23.object({
2082
2089
  tokenId: GithubIdSchema,
2083
2090
  holder: AddressSchema
2084
2091
  });
2085
- var MarketBindingSchema = z22.object({
2092
+ var MarketBindingSchema = z23.object({
2086
2093
  asset: AddressSchema,
2087
2094
  numeraire: AddressSchema,
2088
2095
  initializer: AddressSchema,
2089
2096
  pool: AddressSchema,
2090
2097
  integrator: AddressSchema
2091
2098
  });
2092
- var ShipBindingSchema = z22.object({
2099
+ var ShipBindingSchema = z23.object({
2093
2100
  projectId: ShipProjectIdSchema,
2094
2101
  commitSha: CommitShaSchema,
2095
- publishedRevision: z22.string().nullable()
2102
+ publishedRevision: z23.string().nullable()
2096
2103
  });
2097
- var MarketSubmissionSchema = z22.discriminatedUnion("kind", [
2098
- z22.object({ kind: z22.literal("sponsored"), referenceId: z22.string().min(1) }),
2099
- z22.object({ kind: z22.literal("wallet"), transactionHash: HexSchema }),
2100
- z22.object({ kind: z22.literal("browser"), openedAt: z22.string().datetime() })
2104
+ var MarketSubmissionSchema = z23.discriminatedUnion("kind", [
2105
+ z23.object({ kind: z23.literal("sponsored"), referenceId: z23.string().min(1) }),
2106
+ z23.object({ kind: z23.literal("wallet"), transactionHash: HexSchema }),
2107
+ z23.object({ kind: z23.literal("browser"), openedAt: z23.string().datetime() })
2101
2108
  ]);
2102
- var RegistrationIssueRefSchema = z22.discriminatedUnion("status", [
2103
- z22.object({ status: z22.literal("absent") }),
2104
- z22.object({
2105
- status: z22.literal("created"),
2106
- number: z22.number().int().positive(),
2107
- url: z22.string().min(1)
2109
+ var RegistrationIssueRefSchema = z23.discriminatedUnion("status", [
2110
+ z23.object({ status: z23.literal("absent") }),
2111
+ z23.object({
2112
+ status: z23.literal("created"),
2113
+ number: z23.number().int().positive(),
2114
+ url: z23.string().min(1)
2108
2115
  })
2109
2116
  ]);
2110
- var RikControlSchema = z22.discriminatedUnion("kind", [
2111
- z22.object({ kind: z22.literal("owner") }),
2112
- z22.object({ kind: z22.literal("app") }),
2113
- z22.object({
2114
- kind: z22.literal("topic"),
2115
- challenge: z22.string().regex(/^fcf-[0-9a-f]{20}$/),
2116
- topicInstalled: z22.boolean()
2117
+ var RikControlSchema = z23.discriminatedUnion("kind", [
2118
+ z23.object({ kind: z23.literal("owner") }),
2119
+ z23.object({ kind: z23.literal("app") }),
2120
+ z23.object({
2121
+ kind: z23.literal("topic"),
2122
+ challenge: z23.string().regex(/^fcf-[0-9a-f]{20}$/),
2123
+ topicInstalled: z23.boolean()
2117
2124
  })
2118
2125
  ]);
2119
- var LaunchContextSchema = z22.object({
2126
+ var LaunchContextSchema = z23.object({
2120
2127
  request: LaunchRequestSchema,
2121
2128
  repository: LaunchRepositorySchema,
2122
2129
  github: GithubPrincipalSchema,
2123
- platform: z22.object({ subject: z22.string().min(1) }),
2130
+ platform: z23.object({ subject: z23.string().min(1) }),
2124
2131
  wallet: AddressSchema,
2125
2132
  signing: WalletSigningSchema,
2126
2133
  uik: KeyBindingRefSchema.optional(),
@@ -2128,11 +2135,11 @@ var LaunchContextSchema = z22.object({
2128
2135
  market: MarketBindingSchema.optional(),
2129
2136
  ship: ShipBindingSchema.optional()
2130
2137
  });
2131
- var ManifestRefSchema = z22.object({
2138
+ var ManifestRefSchema = z23.object({
2132
2139
  projectId: ShipProjectIdSchema,
2133
2140
  digest: Sha256Schema,
2134
2141
  baseSha: CommitShaSchema,
2135
- challenge: z22.string().min(1)
2142
+ challenge: z23.string().min(1)
2136
2143
  });
2137
2144
 
2138
2145
  // ../../packages/launch-machine/dist/LaunchEffect.js
@@ -2140,209 +2147,209 @@ var isMutatingEffect = (effect) => effect.kind === "identity.create-registration
2140
2147
  var isPollingEffect = (effect) => effect.kind === "identity.fetch-uik" || effect.kind === "market.fetch-rik" || effect.kind === "market.fetch-state" || effect.kind === "ship.fetch-publication";
2141
2148
 
2142
2149
  // ../../packages/launch-machine/dist/LaunchReceipt.js
2143
- import { z as z23 } from "zod";
2144
- var LaunchReceiptSchema = z23.object({
2150
+ import { z as z24 } from "zod";
2151
+ var LaunchReceiptSchema = z24.object({
2145
2152
  operationId: OperationIdSchema,
2146
- repositoryId: z23.number().int().positive(),
2153
+ repositoryId: z24.number().int().positive(),
2147
2154
  repositorySlug: RepoSlugSchema,
2148
- githubActorId: z23.number().int().positive(),
2155
+ githubActorId: z24.number().int().positive(),
2149
2156
  wallet: AddressSchema,
2150
2157
  uik: KeyBindingRefSchema,
2151
2158
  rik: KeyBindingRefSchema,
2152
2159
  market: MarketBindingSchema,
2153
- project: z23.object({ projectId: ShipProjectIdSchema, commitSha: CommitShaSchema }),
2154
- shipRevision: z23.string().nullable()
2160
+ project: z24.object({ projectId: ShipProjectIdSchema, commitSha: CommitShaSchema }),
2161
+ shipRevision: z24.string().nullable()
2155
2162
  });
2156
2163
 
2157
2164
  // ../../packages/launch-machine/dist/LaunchState.js
2158
- import { z as z26 } from "zod";
2165
+ import { z as z27 } from "zod";
2159
2166
 
2160
2167
  // ../../packages/launch-machine/dist/Problem.js
2161
- import { z as z24 } from "zod";
2162
- var ServiceNameSchema = z24.enum(["git", "github", "platform", "ship", "chain"]);
2163
- var InputFieldSchema = z24.union([
2164
- z24.enum(["repository", "reward-pool", "reward-start", "market-name", "market-symbol", "dev-buy"]),
2168
+ import { z as z25 } from "zod";
2169
+ var ServiceNameSchema = z25.enum(["git", "github", "platform", "ship", "chain"]);
2170
+ var InputFieldSchema = z25.union([
2171
+ z25.enum(["repository", "reward-pool", "reward-start", "market-name", "market-symbol", "dev-buy"]),
2165
2172
  ShipPolicyFieldIdSchema
2166
2173
  ]);
2167
- var ProblemSchema = z24.discriminatedUnion("code", [
2168
- z24.object({ code: z24.literal("NOT_A_GIT_REPOSITORY"), cwd: z24.string() }),
2169
- z24.object({ code: z24.literal("REPOSITORY_NOT_RESOLVED"), detail: z24.string() }),
2170
- z24.object({ code: z24.literal("GITHUB_AUTH_REQUIRED") }),
2171
- z24.object({
2172
- code: z24.literal("GITHUB_ACTOR_CHANGED"),
2173
- expectedId: z24.number().int().positive(),
2174
- actualId: z24.number().int().positive()
2174
+ var ProblemSchema = z25.discriminatedUnion("code", [
2175
+ z25.object({ code: z25.literal("NOT_A_GIT_REPOSITORY"), cwd: z25.string() }),
2176
+ z25.object({ code: z25.literal("REPOSITORY_NOT_RESOLVED"), detail: z25.string() }),
2177
+ z25.object({ code: z25.literal("GITHUB_AUTH_REQUIRED") }),
2178
+ z25.object({
2179
+ code: z25.literal("GITHUB_ACTOR_CHANGED"),
2180
+ expectedId: z25.number().int().positive(),
2181
+ actualId: z25.number().int().positive()
2175
2182
  }),
2176
- z24.object({ code: z24.literal("PLATFORM_LOGIN_REQUIRED") }),
2177
- z24.object({ code: z24.literal("WALLET_UNAVAILABLE") }),
2178
- z24.object({ code: z24.literal("UIK_HELD_BY_OTHER_WALLET"), wallet: AddressSchema }),
2179
- z24.object({ code: z24.literal("RIK_HELD_BY_OTHER_WALLET"), wallet: AddressSchema }),
2180
- z24.object({
2181
- code: z24.literal("REPOSITORY_NOT_LAUNCHABLE"),
2182
- reason: z24.enum(["private", "fork", "archived"])
2183
+ z25.object({ code: z25.literal("PLATFORM_LOGIN_REQUIRED") }),
2184
+ z25.object({ code: z25.literal("WALLET_UNAVAILABLE") }),
2185
+ z25.object({ code: z25.literal("UIK_HELD_BY_OTHER_WALLET"), wallet: AddressSchema }),
2186
+ z25.object({ code: z25.literal("RIK_HELD_BY_OTHER_WALLET"), wallet: AddressSchema }),
2187
+ z25.object({
2188
+ code: z25.literal("REPOSITORY_NOT_LAUNCHABLE"),
2189
+ reason: z25.enum(["private", "fork", "archived"])
2183
2190
  }),
2184
- z24.object({ code: z24.literal("TOPIC_PERMISSION_REQUIRED"), challenge: z24.string() }),
2185
- z24.object({ code: z24.literal("USER_INPUT_REQUIRED"), fields: z24.array(InputFieldSchema).min(1) }),
2186
- z24.object({ code: z24.literal("WALLET_ACTION_REQUIRED"), actionId: z24.string(), url: z24.string() }),
2187
- z24.object({ code: z24.literal("MARKET_LAUNCH_FAILED"), detail: z24.string() }),
2188
- z24.object({ code: z24.literal("BASE_MOVED"), attempts: z24.number().int().positive() }),
2189
- z24.object({ code: z24.literal("SHIP_NOT_ELIGIBLE"), detail: z24.string() }),
2190
- z24.object({ code: z24.literal("SHIP_PUBLICATION_FAILED"), detail: z24.string() }),
2191
- z24.object({
2192
- code: z24.literal("NETWORK_UNAVAILABLE"),
2191
+ z25.object({ code: z25.literal("TOPIC_PERMISSION_REQUIRED"), challenge: z25.string() }),
2192
+ z25.object({ code: z25.literal("USER_INPUT_REQUIRED"), fields: z25.array(InputFieldSchema).min(1) }),
2193
+ z25.object({ code: z25.literal("WALLET_ACTION_REQUIRED"), actionId: z25.string(), url: z25.string() }),
2194
+ z25.object({ code: z25.literal("MARKET_LAUNCH_FAILED"), detail: z25.string() }),
2195
+ z25.object({ code: z25.literal("BASE_MOVED"), attempts: z25.number().int().positive() }),
2196
+ z25.object({ code: z25.literal("SHIP_NOT_ELIGIBLE"), detail: z25.string() }),
2197
+ z25.object({ code: z25.literal("SHIP_PUBLICATION_FAILED"), detail: z25.string() }),
2198
+ z25.object({
2199
+ code: z25.literal("NETWORK_UNAVAILABLE"),
2193
2200
  service: ServiceNameSchema,
2194
- detail: z24.string()
2201
+ detail: z25.string()
2195
2202
  }),
2196
- z24.object({ code: z24.literal("REMOTE_WRITE_AMBIGUOUS"), effectId: z24.string() }),
2197
- z24.object({ code: z24.literal("INCOMPATIBLE"), detail: z24.string() }),
2198
- z24.object({ code: z24.literal("INTERNAL"), detail: z24.string() })
2203
+ z25.object({ code: z25.literal("REMOTE_WRITE_AMBIGUOUS"), effectId: z25.string() }),
2204
+ z25.object({ code: z25.literal("INCOMPATIBLE"), detail: z25.string() }),
2205
+ z25.object({ code: z25.literal("INTERNAL"), detail: z25.string() })
2199
2206
  ]);
2200
2207
 
2201
2208
  // ../../packages/launch-machine/dist/MarketIntent.js
2202
- import { z as z25 } from "zod";
2203
- var MarketIntentSchema = z25.object({
2204
- githubRepoId: z25.string().regex(/^[1-9]\d*$/),
2209
+ import { z as z26 } from "zod";
2210
+ var MarketIntentSchema = z26.object({
2211
+ githubRepoId: z26.string().regex(/^[1-9]\d*$/),
2205
2212
  name: MarketNameSchema,
2206
2213
  symbol: MarketSymbolSchema,
2207
- image: z25.discriminatedUnion("source", [
2208
- z25.object({ source: z25.literal("file"), path: z25.string().min(1) }),
2209
- z25.object({ source: z25.literal("preview"), url: z25.string().min(1) })
2214
+ image: z26.discriminatedUnion("source", [
2215
+ z26.object({ source: z26.literal("file"), path: z26.string().min(1) }),
2216
+ z26.object({ source: z26.literal("preview"), url: z26.string().min(1) })
2210
2217
  ]),
2211
2218
  numeraire: AddressSchema,
2212
- devBuy: z25.object({ amountInBaseUnits: PositiveBaseUnitsSchema }).optional()
2219
+ devBuy: z26.object({ amountInBaseUnits: PositiveBaseUnitsSchema }).optional()
2213
2220
  });
2214
2221
 
2215
2222
  // ../../packages/launch-machine/dist/LaunchState.js
2216
2223
  var origin = { request: LaunchRequestSchema, local: LocalRepositorySchema };
2217
2224
  var identified = { ...origin, github: GithubPrincipalSchema };
2218
- var authenticated = { ...identified, platform: z26.object({ subject: z26.string().min(1) }) };
2225
+ var authenticated = { ...identified, platform: z27.object({ subject: z27.string().min(1) }) };
2219
2226
  var funded = { ...authenticated, wallet: AddressSchema, signing: WalletSigningSchema };
2220
2227
  var context = { context: LaunchContextSchema };
2221
- var LaunchStateSchema = z26.discriminatedUnion("tag", [
2222
- z26.object({ tag: z26.literal("discover-repository"), request: LaunchRequestSchema }),
2223
- z26.object({ tag: z26.literal("resolve-github-principal"), ...origin }),
2224
- z26.object({ tag: z26.literal("resolve-platform-session"), ...identified }),
2225
- z26.object({ tag: z26.literal("resolve-wallet"), ...authenticated }),
2226
- z26.object({ tag: z26.literal("validate-repository"), ...funded }),
2227
- z26.object({ tag: z26.literal("resolve-uik"), ...context }),
2228
- z26.object({ tag: z26.literal("register-uik"), ...context, issue: RegistrationIssueRefSchema }),
2229
- z26.object({ tag: z26.literal("resolve-rik"), ...context }),
2230
- z26.object({ tag: z26.literal("prove-repository-control"), ...context }),
2231
- z26.object({
2232
- tag: z26.literal("register-rik"),
2228
+ var LaunchStateSchema = z27.discriminatedUnion("tag", [
2229
+ z27.object({ tag: z27.literal("discover-repository"), request: LaunchRequestSchema }),
2230
+ z27.object({ tag: z27.literal("resolve-github-principal"), ...origin }),
2231
+ z27.object({ tag: z27.literal("resolve-platform-session"), ...identified }),
2232
+ z27.object({ tag: z27.literal("resolve-wallet"), ...authenticated }),
2233
+ z27.object({ tag: z27.literal("validate-repository"), ...funded }),
2234
+ z27.object({ tag: z27.literal("resolve-uik"), ...context }),
2235
+ z27.object({ tag: z27.literal("register-uik"), ...context, issue: RegistrationIssueRefSchema }),
2236
+ z27.object({ tag: z27.literal("resolve-rik"), ...context }),
2237
+ z27.object({ tag: z27.literal("prove-repository-control"), ...context }),
2238
+ z27.object({
2239
+ tag: z27.literal("register-rik"),
2233
2240
  ...context,
2234
2241
  control: RikControlSchema,
2235
2242
  issue: RegistrationIssueRefSchema
2236
2243
  }),
2237
- z26.object({ tag: z26.literal("prepare-market"), ...context, observed: z26.boolean() }),
2238
- z26.object({
2239
- tag: z26.literal("authorize-market"),
2244
+ z27.object({ tag: z27.literal("prepare-market"), ...context, observed: z27.boolean() }),
2245
+ z27.object({
2246
+ tag: z27.literal("authorize-market"),
2240
2247
  ...context,
2241
2248
  preview: MarketPreviewSchema,
2242
2249
  intent: MarketIntentSchema
2243
2250
  }),
2244
- z26.object({
2245
- tag: z26.literal("submit-market"),
2251
+ z27.object({
2252
+ tag: z27.literal("submit-market"),
2246
2253
  ...context,
2247
2254
  intent: MarketIntentSchema,
2248
- metadataCid: z26.string().min(1)
2255
+ metadataCid: z27.string().min(1)
2249
2256
  }),
2250
- z26.object({ tag: z26.literal("await-market"), ...context, submission: MarketSubmissionSchema }),
2251
- z26.object({
2252
- tag: z26.literal("configure-reward"),
2257
+ z27.object({ tag: z27.literal("await-market"), ...context, submission: MarketSubmissionSchema }),
2258
+ z27.object({
2259
+ tag: z27.literal("configure-reward"),
2253
2260
  ...context,
2254
2261
  asset: AddressSchema,
2255
2262
  token: TokenMetadataSchema.nullable()
2256
2263
  }),
2257
- z26.object({
2258
- tag: z26.literal("infer-ship-policy"),
2264
+ z27.object({
2265
+ tag: z27.literal("infer-ship-policy"),
2259
2266
  ...context,
2260
2267
  reward: MarketFundingSchema.nullable()
2261
2268
  }),
2262
- z26.object({
2263
- tag: z26.literal("review-ship-policy"),
2269
+ z27.object({
2270
+ tag: z27.literal("review-ship-policy"),
2264
2271
  ...context,
2265
2272
  reward: MarketFundingSchema.nullable(),
2266
2273
  draft: ShipPolicyDraftSchema,
2267
- pending: z26.array(ShipPolicyFieldIdSchema)
2274
+ pending: z27.array(ShipPolicyFieldIdSchema)
2268
2275
  }),
2269
- z26.object({
2270
- tag: z26.literal("build-ship-manifest"),
2276
+ z27.object({
2277
+ tag: z27.literal("build-ship-manifest"),
2271
2278
  ...context,
2272
2279
  submission: ShipRegistrationSubmissionSchema,
2273
- rebuilds: z26.number().int().nonnegative()
2280
+ rebuilds: z27.number().int().nonnegative()
2274
2281
  }),
2275
- z26.object({
2276
- tag: z26.literal("sign-ship-manifest"),
2282
+ z27.object({
2283
+ tag: z27.literal("sign-ship-manifest"),
2277
2284
  ...context,
2278
2285
  submission: ShipRegistrationSubmissionSchema,
2279
2286
  manifest: ShipRegistrationManifestSchema,
2280
- rebuilds: z26.number().int().nonnegative()
2287
+ rebuilds: z27.number().int().nonnegative()
2281
2288
  }),
2282
- z26.object({
2283
- tag: z26.literal("commit-ship-project"),
2289
+ z27.object({
2290
+ tag: z27.literal("commit-ship-project"),
2284
2291
  ...context,
2285
2292
  submission: ShipRegistrationSubmissionSchema,
2286
2293
  manifest: ManifestRefSchema,
2287
2294
  signature: HexSchema,
2288
- rebuilds: z26.number().int().nonnegative()
2295
+ rebuilds: z27.number().int().nonnegative()
2289
2296
  }),
2290
- z26.object({
2291
- tag: z26.literal("await-ship-publication"),
2297
+ z27.object({
2298
+ tag: z27.literal("await-ship-publication"),
2292
2299
  ...context,
2293
2300
  project: ShipBindingSchema,
2294
- dispatched: z26.boolean()
2301
+ dispatched: z27.boolean()
2295
2302
  }),
2296
- z26.object({
2297
- tag: z26.literal("launch-blocked"),
2303
+ z27.object({
2304
+ tag: z27.literal("launch-blocked"),
2298
2305
  request: LaunchRequestSchema,
2299
2306
  problem: ProblemSchema
2300
2307
  }),
2301
- z26.object({
2302
- tag: z26.literal("launch-failed"),
2308
+ z27.object({
2309
+ tag: z27.literal("launch-failed"),
2303
2310
  request: LaunchRequestSchema,
2304
2311
  problem: ProblemSchema
2305
2312
  }),
2306
- z26.object({
2307
- tag: z26.literal("launch-complete"),
2313
+ z27.object({
2314
+ tag: z27.literal("launch-complete"),
2308
2315
  request: LaunchRequestSchema,
2309
2316
  receipt: LaunchReceiptSchema
2310
2317
  })
2311
2318
  ]);
2312
2319
 
2313
2320
  // ../../packages/launch-machine/dist/Operation.js
2314
- import { z as z27 } from "zod";
2321
+ import { z as z28 } from "zod";
2315
2322
  var machineVersion = 1;
2316
2323
  var operationSchemaVersion = 1;
2317
- var JournalEntrySchema = z27.discriminatedUnion("kind", [
2318
- z27.object({
2319
- kind: z27.literal("transition"),
2320
- at: z27.string().datetime(),
2321
- from: z27.string().min(1),
2322
- event: z27.string().min(1),
2323
- to: z27.string().min(1)
2324
+ var JournalEntrySchema = z28.discriminatedUnion("kind", [
2325
+ z28.object({
2326
+ kind: z28.literal("transition"),
2327
+ at: z28.string().datetime(),
2328
+ from: z28.string().min(1),
2329
+ event: z28.string().min(1),
2330
+ to: z28.string().min(1)
2324
2331
  }),
2325
- z27.object({
2326
- kind: z27.literal("effect"),
2327
- at: z27.string().datetime(),
2328
- effectId: z27.string().min(1),
2329
- effect: z27.string().min(1),
2330
- requestDigest: z27.string().regex(/^[a-f0-9]{64}$/)
2332
+ z28.object({
2333
+ kind: z28.literal("effect"),
2334
+ at: z28.string().datetime(),
2335
+ effectId: z28.string().min(1),
2336
+ effect: z28.string().min(1),
2337
+ requestDigest: z28.string().regex(/^[a-f0-9]{64}$/)
2331
2338
  })
2332
2339
  ]);
2333
- var OperationSchema = z27.object({
2334
- schemaVersion: z27.literal(operationSchemaVersion),
2335
- machineVersion: z27.number().int().positive(),
2340
+ var OperationSchema = z28.object({
2341
+ schemaVersion: z28.literal(operationSchemaVersion),
2342
+ machineVersion: z28.number().int().positive(),
2336
2343
  operationId: OperationIdSchema,
2337
- intent: z27.object({
2338
- command: z27.literal("launch"),
2339
- originalArgs: z27.array(z27.string())
2344
+ intent: z28.object({
2345
+ command: z28.literal("launch"),
2346
+ originalArgs: z28.array(z28.string())
2340
2347
  }),
2341
2348
  state: LaunchStateSchema,
2342
- abandoned: z27.boolean(),
2343
- createdAt: z27.string().datetime(),
2344
- updatedAt: z27.string().datetime(),
2345
- journal: z27.array(JournalEntrySchema)
2349
+ abandoned: z28.boolean(),
2350
+ createdAt: z28.string().datetime(),
2351
+ updatedAt: z28.string().datetime(),
2352
+ journal: z28.array(JournalEntrySchema)
2346
2353
  });
2347
2354
 
2348
2355
  // ../../packages/launch-machine/dist/parseTokenAmount.js
@@ -2645,6 +2652,9 @@ function marketIntentFrom(preview, overrides) {
2645
2652
  }
2646
2653
  };
2647
2654
  }
2655
+ if (!preview.defaults.editable.devBuy) {
2656
+ return { ok: false, problem: { code: "USER_INPUT_REQUIRED", fields: ["dev-buy"] } };
2657
+ }
2648
2658
  const amount = parseTokenAmount(devBuy, preview.devBuyPolicy.decimals);
2649
2659
  if (!amount.ok || BigInt(amount.baseUnits) === 0n) {
2650
2660
  return { ok: false, problem: { code: "USER_INPUT_REQUIRED", fields: ["dev-buy"] } };
@@ -2990,8 +3000,8 @@ var launchMachine = {
2990
3000
  };
2991
3001
 
2992
3002
  // ../../packages/launch-machine/dist/migrateOperation.js
2993
- import { z as z28 } from "zod";
2994
- var VersionSchema = z28.object({ schemaVersion: z28.number().int().positive() });
3003
+ import { z as z29 } from "zod";
3004
+ var VersionSchema = z29.object({ schemaVersion: z29.number().int().positive() });
2995
3005
  function migrateOperation(document) {
2996
3006
  const version = VersionSchema.safeParse(document);
2997
3007
  if (!version.success) {
@@ -3293,6 +3303,11 @@ var slugFrom = (owner, name) => {
3293
3303
  const parsed = RepoSlugSchema.safeParse(`${owner}/${stripSuffix(name)}`);
3294
3304
  return parsed.success ? { ok: true, slug: parsed.data } : { ok: false, error: { reason: "not-a-repository" } };
3295
3305
  };
3306
+ var slugFromPath = (path) => {
3307
+ const segments = path.split("/").filter((segment) => segment !== "");
3308
+ const [owner, name] = segments;
3309
+ return owner === void 0 || name === void 0 || segments.length !== 2 ? { ok: false, error: { reason: "not-a-repository" } } : slugFrom(owner, name);
3310
+ };
3296
3311
  var scpLike = /^(?:[^@/]+@)?([^:/]+):(.+)$/;
3297
3312
  function repositorySlugFromRemote(remote) {
3298
3313
  const trimmed = remote.trim();
@@ -3300,8 +3315,8 @@ function repositorySlugFromRemote(remote) {
3300
3315
  return { ok: false, error: { reason: "not-a-repository" } };
3301
3316
  const bare = /^[^/:@\s]+\/[^/:@\s]+$/.exec(trimmed);
3302
3317
  if (bare !== null) {
3303
- const [owner2, name2] = trimmed.split("/");
3304
- return slugFrom(owner2, name2);
3318
+ const [owner, name] = trimmed.split("/");
3319
+ return slugFrom(owner, name);
3305
3320
  }
3306
3321
  const scp = trimmed.includes("://") ? null : scpLike.exec(trimmed);
3307
3322
  const host = scp === null ? void 0 : scp[1];
@@ -3309,9 +3324,7 @@ function repositorySlugFromRemote(remote) {
3309
3324
  if (host !== void 0 && path !== void 0) {
3310
3325
  if (host !== "github.com")
3311
3326
  return { ok: false, error: { reason: "unsupported-host" } };
3312
- const segments2 = path.split("/").filter((segment) => segment !== "");
3313
- const [owner2, name2] = segments2;
3314
- return owner2 === void 0 || name2 === void 0 || segments2.length !== 2 ? { ok: false, error: { reason: "not-a-repository" } } : slugFrom(owner2, name2);
3327
+ return slugFromPath(path);
3315
3328
  }
3316
3329
  let url;
3317
3330
  try {
@@ -3321,9 +3334,7 @@ function repositorySlugFromRemote(remote) {
3321
3334
  }
3322
3335
  if (url.hostname !== "github.com")
3323
3336
  return { ok: false, error: { reason: "unsupported-host" } };
3324
- const segments = url.pathname.split("/").filter((segment) => segment !== "");
3325
- const [owner, name] = segments;
3326
- return owner === void 0 || name === void 0 || segments.length !== 2 ? { ok: false, error: { reason: "not-a-repository" } } : slugFrom(owner, name);
3337
+ return slugFromPath(url.pathname);
3327
3338
  }
3328
3339
 
3329
3340
  // ../../packages/launch-machine/dist/runMachine.js
@@ -3356,12 +3367,12 @@ function topicPlanForRemoval(current, challenge2) {
3356
3367
  // src/generated/build.ts
3357
3368
  var buildValues = {
3358
3369
  packageName: "@freecodexyz/freecode",
3359
- version: "0.1.0",
3360
- commit: "371fafec1b637b8997f65e64c9954f25afd1db4c",
3361
- builtAt: "2026-09-06T16:32:59.885Z",
3370
+ version: "0.1.1",
3371
+ commit: "a6dee4be7a39995a05f60dfbebbbbc3e63928dfe",
3372
+ builtAt: "2026-09-07T12:04:56.958Z",
3362
3373
  programNames: ["freecode", "fcf"],
3363
3374
  origins: {
3364
- apiOrigin: "https://d3gb1mwa4btm70.cloudfront.net",
3375
+ apiOrigin: "https://d3gb1mwa4btm70.cloudfront.net/api",
3365
3376
  webOrigin: "https://d3gb1mwa4btm70.cloudfront.net",
3366
3377
  shipOrigin: "https://ship.freecodefund.xyz"
3367
3378
  }
@@ -3890,11 +3901,11 @@ function agentTarget(choice, home, skillsDir, exists) {
3890
3901
  import { mkdir, mkdtemp, readFile, rename, rm, writeFile } from "node:fs/promises";
3891
3902
  import { tmpdir } from "node:os";
3892
3903
  import { dirname, join as join2 } from "node:path";
3893
- import { z as z29 } from "zod";
3894
- var MarkerSchema = z29.object({
3895
- projectId: z29.string().min(1),
3896
- revision: z29.string().regex(/^[a-f0-9]{40}$/),
3897
- installedAt: z29.string().datetime()
3904
+ import { z as z30 } from "zod";
3905
+ var MarkerSchema = z30.object({
3906
+ projectId: z30.string().min(1),
3907
+ revision: z30.string().regex(/^[a-f0-9]{40}$/),
3908
+ installedAt: z30.string().datetime()
3898
3909
  });
3899
3910
  var markerName = ".freecode-skill.json";
3900
3911
  async function installedRevision(directory) {
@@ -4106,66 +4117,333 @@ async function runContribute(runtime, command) {
4106
4117
  // src/commands/runDoctor.ts
4107
4118
  import { access, constants, mkdir as mkdir2 } from "node:fs/promises";
4108
4119
 
4109
- // src/adapters/sanitizedGithubEnvironment.ts
4110
- var inheritedTokenVariables = [
4111
- "GH_TOKEN",
4112
- "GITHUB_TOKEN",
4113
- "GH_ENTERPRISE_TOKEN",
4114
- "GITHUB_ENTERPRISE_TOKEN"
4115
- ];
4116
- var shadowingGithubTokens = (environment) => inheritedTokenVariables.filter((name) => (environment[name] ?? "") !== "");
4117
- function sanitizedGithubEnvironment(environment) {
4118
- const shadowing = new Set(inheritedTokenVariables);
4119
- const sanitized = Object.fromEntries(
4120
- Object.entries(environment).filter(([name]) => !shadowing.has(name))
4121
- );
4122
- const explicit = environment.FREECODE_GITHUB_TOKEN;
4123
- return explicit === void 0 || explicit === "" ? sanitized : { ...sanitized, GH_TOKEN: explicit };
4120
+ // ../../packages/platform-client/dist/authHeadersFrom.js
4121
+ var authHeadersFrom = (auth) => ({
4122
+ Authorization: `Bearer ${auth.accessToken}`,
4123
+ ...auth.identityToken === null ? {} : { "privy-id-token": auth.identityToken }
4124
+ });
4125
+
4126
+ // ../../packages/platform-client/dist/postJson.js
4127
+ var postJson = (body, headers = {}) => ({
4128
+ method: "POST",
4129
+ headers: { "Content-Type": "application/json", ...headers },
4130
+ body: JSON.stringify(body)
4131
+ });
4132
+
4133
+ // ../../packages/platform-client/dist/requestJson.js
4134
+ import { z as z31 } from "zod";
4135
+ var ErrorResponseSchema = z31.object({
4136
+ code: z31.string().optional(),
4137
+ message: z31.string().optional()
4138
+ });
4139
+ var invalidResponseMessage = "The server returned an invalid response.";
4140
+ async function requestJson(url, schema, signal, init) {
4141
+ try {
4142
+ const response = await fetch(url, { ...init, ...signal === void 0 ? {} : { signal } });
4143
+ const failureMessage = `Request failed (${response.status}).`;
4144
+ let payload;
4145
+ try {
4146
+ payload = await response.json();
4147
+ } catch (error) {
4148
+ if (!(error instanceof SyntaxError))
4149
+ throw error;
4150
+ return {
4151
+ ok: false,
4152
+ message: response.ok ? invalidResponseMessage : failureMessage
4153
+ };
4154
+ }
4155
+ if (!response.ok) {
4156
+ const error = ErrorResponseSchema.safeParse(payload);
4157
+ return {
4158
+ ok: false,
4159
+ ...error.success && error.data.code !== void 0 ? { code: error.data.code } : {},
4160
+ message: error.success ? error.data.message ?? error.data.code ?? failureMessage : failureMessage
4161
+ };
4162
+ }
4163
+ const parsed = schema.safeParse(payload);
4164
+ return parsed.success ? { ok: true, value: parsed.data } : { ok: false, message: invalidResponseMessage };
4165
+ } catch (error) {
4166
+ return {
4167
+ ok: false,
4168
+ message: error instanceof Error && error.name === "AbortError" ? "Request cancelled." : "The server could not be reached."
4169
+ };
4170
+ }
4124
4171
  }
4125
4172
 
4126
- // src/adapters/statePaths.ts
4127
- import { homedir as homedir2 } from "node:os";
4128
- import { join as join4 } from "node:path";
4129
- function statePaths(platform, environment, home = homedir2()) {
4130
- const explicit = environment.FREECODE_STATE_HOME;
4131
- const root = explicit !== void 0 && explicit !== "" ? explicit : platform === "win32" ? join4(environment.LOCALAPPDATA ?? join4(home, "AppData", "Local"), "freecode") : platform === "darwin" ? join4(home, "Library", "Application Support", "freecode") : join4(
4132
- environment.XDG_STATE_HOME !== void 0 && environment.XDG_STATE_HOME !== "" ? environment.XDG_STATE_HOME : join4(home, ".local", "state"),
4133
- "freecode"
4134
- );
4173
+ // ../../packages/platform-client/dist/createCliBridgeApi.js
4174
+ function createCliBridgeApi(origin2) {
4175
+ const request = (requestId) => `${origin2}/cli/requests/${encodeURIComponent(requestId)}`;
4135
4176
  return {
4136
- root,
4137
- operations: join4(root, "operations"),
4138
- cache: join4(root, "cache"),
4139
- credential: join4(root, "session.json")
4177
+ open: (input, signal) => requestJson(`${origin2}/cli/requests`, CliRequestTicketSchema, signal, postJson(input)),
4178
+ view: (requestId, signal) => requestJson(request(requestId), CliRequestViewSchema, signal, { cache: "no-store" }),
4179
+ approve: (requestId, approval, auth, signal) => requestJson(`${request(requestId)}/approve`, CliRequestViewSchema, signal, postJson(approval, authHeadersFrom(auth))),
4180
+ redeem: (input, signal) => requestJson(`${request(input.requestId)}/claim`, CliExchangeSchema, signal, {
4181
+ ...postJson({ requestId: input.requestId, codeVerifier: input.codeVerifier }),
4182
+ cache: "no-store"
4183
+ })
4140
4184
  };
4141
4185
  }
4142
4186
 
4143
- // src/commands/resumableOperation.ts
4144
- function resumableOperation(stored, request) {
4145
- const candidates = stored.filter((entry) => entry.ok).map((entry) => entry.operation).filter((operation) => !operation.abandoned && operation.state.tag !== "launch-complete").filter((operation) => {
4146
- const intent = launchRequestFrom(operation.state);
4147
- return request.repository === void 0 ? intent.cwd === request.cwd : intent.repository === request.repository;
4148
- });
4149
- return [...candidates].sort((left, right) => right.updatedAt.localeCompare(left.updatedAt))[0];
4187
+ // ../../packages/platform-client/dist/createIdentityApi.js
4188
+ import { z as z32 } from "zod";
4189
+ var IssueUrlSchema = z32.object({ url: z32.string().url() });
4190
+ function createIdentityApi(origin2) {
4191
+ return {
4192
+ byWallet: (wallet, signal) => requestJson(`${origin2}/identity/uik/by-wallet/${wallet}`, WalletUiksSchema, signal),
4193
+ registrationIssue: (wallet, signal) => {
4194
+ const query = new URLSearchParams({ wallet });
4195
+ return requestJson(`${origin2}/identity/register/issue-url?${query}`, IssueUrlSchema, signal);
4196
+ },
4197
+ registrationStatus: (issueUrl, signal) => {
4198
+ const query = new URLSearchParams({ issueUrl });
4199
+ return requestJson(`${origin2}/identity/register/status?${query}`, RegistrationStatusSchema, signal);
4200
+ }
4201
+ };
4150
4202
  }
4151
4203
 
4152
- // src/commands/repositoryStatusFrom.ts
4153
- async function repositoryStatusFrom(runtime, slug, trace = () => void 0) {
4154
- const components = [];
4155
- const record = (component) => {
4156
- trace(`${component.id}: ${component.state}`);
4157
- components.push(component);
4158
- };
4159
- const [repository, principal, session] = await Promise.all([
4160
- runtime.apis.onboarding.repositoryState(slug),
4161
- runtime.github.resolvePrincipal(),
4162
- platformSessionFrom(runtime)
4163
- ]);
4164
- const actor = principal.ok ? { login: principal.value.login, id: principal.value.id } : { login: null, id: null };
4165
- record({
4166
- id: "github",
4167
- state: principal.ok ? "ready" : "absent",
4168
- detail: principal.ok ? `@${principal.value.login} \xB7 #${principal.value.id}` : "not signed in"
4204
+ // ../../packages/platform-client/dist/createOnboardingApi.js
4205
+ import { z as z33 } from "zod";
4206
+
4207
+ // ../../packages/platform-client/dist/requestSponsorshipOperation.js
4208
+ var requestSponsorshipOperation = (origin2, referenceId, signal) => requestJson(`${origin2}/sponsorship/operations/${encodeURIComponent(referenceId)}`, SponsoredOperationStatusSchema, signal, { cache: "no-store" });
4209
+
4210
+ // ../../packages/platform-client/dist/createOnboardingApi.js
4211
+ var RikResponseSchema = z33.object({
4212
+ githubRepoId: z33.number().int().positive(),
4213
+ binding: KeyBindingSchema
4214
+ });
4215
+ var IssueUrlSchema2 = z33.object({
4216
+ url: z33.string().url(),
4217
+ title: z33.string(),
4218
+ repo: z33.literal("freecodexyz/market"),
4219
+ ownershipTier: OwnershipTierSchema.shape.tier,
4220
+ githubRepoId: z33.number().int().positive()
4221
+ });
4222
+ var BalanceSchema = z33.object({ raw: z33.string().regex(/^\d+$/), formatted: z33.string() });
4223
+ var GithubRepositoriesSchema = z33.array(GithubRepositorySummarySchema);
4224
+ async function requestRepositoryEnrichments(origin2, repositories, signal) {
4225
+ const uniqueRepositories = [...new Set(repositories)];
4226
+ const batches = Array.from({ length: Math.ceil(uniqueRepositories.length / 100) }, (_, index) => uniqueRepositories.slice(index * 100, (index + 1) * 100));
4227
+ const results = await Promise.all(batches.map((batch) => requestJson(`${origin2}/github/repositories/enrichment`, z33.array(GithubRepositoryEnrichmentSchema), signal, postJson({ repositories: batch }))));
4228
+ const failure2 = results.find((result) => !result.ok);
4229
+ if (failure2 !== void 0 && !failure2.ok)
4230
+ return failure2;
4231
+ return {
4232
+ ok: true,
4233
+ value: results.flatMap((result) => result.ok ? result.value : [])
4234
+ };
4235
+ }
4236
+ function createOnboardingApi(origin2) {
4237
+ return {
4238
+ githubUser: (login, signal) => requestJson(`${origin2}/github/user/${encodeURIComponent(login)}`, GithubUserSchema, signal),
4239
+ resolveIdentities: (githubUserIds, signal) => requestJson(`${origin2}/identity/uik/resolve`, z33.array(GithubIdentityResolutionSchema), signal, postJson({ githubUserIds })),
4240
+ async teamMember(login, signal) {
4241
+ const user = await requestJson(`${origin2}/github/user/${encodeURIComponent(login)}`, GithubUserSchema, signal);
4242
+ if (!user.ok)
4243
+ return user;
4244
+ const identities = await requestJson(`${origin2}/identity/uik/resolve`, z33.array(GithubIdentityResolutionSchema), signal, postJson({ githubUserIds: [String(user.value.id)] }));
4245
+ if (!identities.ok)
4246
+ return identities;
4247
+ const binding = identities.value[0]?.binding;
4248
+ return {
4249
+ ok: true,
4250
+ value: {
4251
+ githubUserId: String(user.value.id),
4252
+ login: user.value.login,
4253
+ avatarUrl: user.value.avatarUrl,
4254
+ profileUrl: user.value.htmlUrl,
4255
+ contributions: 0,
4256
+ role: "advisor",
4257
+ manuallyAdded: true,
4258
+ identity: binding?.status === "bound" ? {
4259
+ status: "bound",
4260
+ wallet: binding.wallet,
4261
+ boundAt: binding.boundAt
4262
+ } : { status: "unbound" }
4263
+ }
4264
+ };
4265
+ },
4266
+ repositories: (login, signal) => requestJson(`${origin2}/github/user/${encodeURIComponent(login)}/repos`, GithubRepositoriesSchema, signal),
4267
+ repository: (slug, signal) => requestJson(`${origin2}/github/repo/${slug}?enriched=true`, GithubRepoSchema, signal),
4268
+ repositoryState: (slug, signal) => requestJson(`${origin2}/github/repo/${slug}`, GithubRepositoryStateSchema, signal),
4269
+ repositoryEnrichments: (repositories, signal) => requestRepositoryEnrichments(origin2, repositories, signal),
4270
+ async rik(slug, signal) {
4271
+ const result = await requestJson(`${origin2}/market/rik/by-slug/${slug}`, RikResponseSchema, signal);
4272
+ return result.ok ? { ok: true, value: result.value.binding } : result;
4273
+ },
4274
+ rikById: (githubRepoId, signal) => requestJson(`${origin2}/market/rik/by-id/${githubRepoId}`, KeyBindingSchema, signal),
4275
+ ownershipTier: (slug, signal) => {
4276
+ const query = new URLSearchParams({ repo: slug });
4277
+ return requestJson(`${origin2}/market/register/ownership-tier?${query}`, OwnershipTierSchema, signal);
4278
+ },
4279
+ async registrationIssue(slug, wallet, signal) {
4280
+ const query = new URLSearchParams({ wallet, repo: slug });
4281
+ const result = await requestJson(`${origin2}/market/register/issue-url?${query}`, IssueUrlSchema2, signal);
4282
+ return result.ok ? {
4283
+ ok: true,
4284
+ value: {
4285
+ url: result.value.url,
4286
+ ownershipTier: result.value.ownershipTier
4287
+ }
4288
+ } : result;
4289
+ },
4290
+ registrationStatus: (issueUrl, signal) => {
4291
+ const query = new URLSearchParams({ issueUrl });
4292
+ return requestJson(`${origin2}/market/register/status?${query}`, RegistrationStatusSchema, signal);
4293
+ },
4294
+ token: (address, signal) => requestJson(`${origin2}/erc20/${address}`, TokenMetadataSchema, signal),
4295
+ balance: (token, wallet, signal) => requestJson(`${origin2}/erc20/${token}/balance/${wallet}`, BalanceSchema, signal),
4296
+ marketState: (repoId, signal) => requestJson(`${origin2}/market/launch/state/${repoId}`, MarketLaunchStateSchema, signal),
4297
+ marketPreview: (repoId, signal) => requestJson(`${origin2}/market/launch/preview/${repoId}`, MarketPreviewSchema, signal),
4298
+ pinImage: (input, signal) => {
4299
+ const body = new FormData();
4300
+ body.append("githubRepoId", String(input.githubRepoId));
4301
+ body.append("challenge", input.challenge);
4302
+ body.append("signature", input.signature);
4303
+ body.append("wallet", input.wallet);
4304
+ body.append("file", input.file, input.fileName);
4305
+ return requestJson(`${origin2}/media/images`, PinnedImageSchema, signal, {
4306
+ method: "POST",
4307
+ body
4308
+ });
4309
+ },
4310
+ pinMetadata: ({ links, ...input }, signal) => requestJson(`${origin2}/market/metadata/pin`, PinnedMarketMetadataSchema, signal, postJson({ ...input, ...links })),
4311
+ devBuyQuote: (repoId, input, signal) => requestJson(`${origin2}/market/launch/dev-buy/quote/${repoId}`, MarketDevBuyQuoteSchema, signal, postJson(input)),
4312
+ marketTransaction: (repoId, input, signal) => requestJson(`${origin2}/market/launch/tx/${repoId}`, MarketLaunchPlanSchema, signal, postJson(input)),
4313
+ sponsoredMarketLaunch: (repoId, input, auth, signal) => requestJson(`${origin2}/sponsorship/markets/${repoId}/launch`, SponsoredLaunchSubmissionSchema, signal, postJson(input, authHeadersFrom(auth))),
4314
+ sponsorshipOperation: (referenceId, signal) => requestSponsorshipOperation(origin2, referenceId, signal),
4315
+ saveRepositoryProfile: (githubRepoId, input, signal) => requestJson(`${origin2}/owner/repositories/${githubRepoId}/profile`, ProjectProfileSchema, signal, {
4316
+ method: "PUT",
4317
+ headers: { "Content-Type": "application/json" },
4318
+ body: JSON.stringify(input)
4319
+ })
4320
+ };
4321
+ }
4322
+
4323
+ // ../../packages/platform-client/dist/createSessionApi.js
4324
+ function createSessionApi(origin2) {
4325
+ return {
4326
+ whoami: (auth, signal) => requestJson(`${origin2}/auth/whoami`, WhoamiSchema, signal, {
4327
+ headers: authHeadersFrom(auth),
4328
+ cache: "no-store"
4329
+ }),
4330
+ delegation: (wallet, auth, signal) => requestJson(`${origin2}/sponsorship/delegation/${wallet}`, SponsorshipDelegationSchema, signal, { headers: authHeadersFrom(auth), cache: "no-store" })
4331
+ };
4332
+ }
4333
+
4334
+ // ../../packages/platform-client/dist/createShipRegistrationApi.js
4335
+ function createShipRegistrationApi(origin2) {
4336
+ const project = (projectId) => `${origin2}/ship/projects/${encodeURIComponent(projectId)}`;
4337
+ return {
4338
+ schema: (signal) => requestJson(`${origin2}/ship/registration/schema`, ShipRegistrationSchemaSchema, signal),
4339
+ eligibility: (repository, wallet, signal) => {
4340
+ const query = new URLSearchParams({ repository, wallet });
4341
+ return requestJson(`${origin2}/ship/registration/eligibility?${query}`, ShipRegistrationEligibilitySchema, signal);
4342
+ },
4343
+ draft: (repository, signal) => requestJson(`${origin2}/ship/registration/draft`, ShipPolicyDraftSchema, signal, postJson({ repository })),
4344
+ manifest: (request, signal) => requestJson(`${origin2}/ship/registration/manifest`, ShipRegistrationManifestSchema, signal, postJson(request)),
4345
+ register: (submission, signal) => requestJson(`${origin2}/ship/registration`, ShipRegistrationReceiptSchema, signal, postJson(submission)),
4346
+ updatePolicy: (projectId, submission, signal) => requestJson(`${project(projectId)}/policy`, ShipRegistrationReceiptSchema, signal, {
4347
+ ...postJson(submission),
4348
+ method: "PUT"
4349
+ }),
4350
+ publish: (signal) => requestJson(`${origin2}/ship/registration/publish`, ShipPublishDispatchSchema, signal, {
4351
+ method: "POST"
4352
+ }),
4353
+ publication: (projectId, commitSha, signal) => {
4354
+ const query = commitSha === void 0 ? "" : `?${new URLSearchParams({ commitSha })}`;
4355
+ return requestJson(`${project(projectId)}/publication${query}`, ShipPublicationSchema, signal);
4356
+ }
4357
+ };
4358
+ }
4359
+
4360
+ // ../../packages/platform-client/dist/createShipStaticApi.js
4361
+ function createShipStaticApi(origin2 = shipStaticOrigin) {
4362
+ return {
4363
+ index: (signal) => requestJson(`${origin2}${shipStaticPaths.index}`, ShipStaticIndexSchema, signal),
4364
+ async snapshot(signal) {
4365
+ try {
4366
+ const response = await fetch(`${origin2}${shipStaticPaths.snapshot}`, {
4367
+ ...signal === void 0 ? {} : { signal }
4368
+ });
4369
+ if (!response.ok) {
4370
+ return { ok: false, message: `Ship's snapshot returned ${response.status}.` };
4371
+ }
4372
+ const bytes = await response.text();
4373
+ const parsed = SnapshotSchema.safeParse(JSON.parse(bytes));
4374
+ return parsed.success ? { ok: true, value: { bytes, value: parsed.data } } : { ok: false, message: "Ship's snapshot is not a snapshot this client understands." };
4375
+ } catch {
4376
+ return { ok: false, message: "Ship could not be reached." };
4377
+ }
4378
+ },
4379
+ skills: (signal) => requestJson(`${origin2}${shipStaticPaths.skills}`, ShipSkillsIndexSchema, signal),
4380
+ manifest: (projectId, signal) => requestJson(`${origin2}${shipStaticPaths.manifest(projectId)}`, ShipSkillManifestSchema, signal)
4381
+ };
4382
+ }
4383
+
4384
+ // src/commands/runDoctor.ts
4385
+ import { z as z34 } from "zod";
4386
+
4387
+ // src/adapters/sanitizedGithubEnvironment.ts
4388
+ var inheritedTokenVariables = [
4389
+ "GH_TOKEN",
4390
+ "GITHUB_TOKEN",
4391
+ "GH_ENTERPRISE_TOKEN",
4392
+ "GITHUB_ENTERPRISE_TOKEN"
4393
+ ];
4394
+ var shadowingGithubTokens = (environment) => inheritedTokenVariables.filter((name) => (environment[name] ?? "") !== "");
4395
+ function sanitizedGithubEnvironment(environment) {
4396
+ const shadowing = new Set(inheritedTokenVariables);
4397
+ const sanitized = Object.fromEntries(
4398
+ Object.entries(environment).filter(([name]) => !shadowing.has(name))
4399
+ );
4400
+ const explicit = environment.FREECODE_GITHUB_TOKEN;
4401
+ return explicit === void 0 || explicit === "" ? sanitized : { ...sanitized, GH_TOKEN: explicit };
4402
+ }
4403
+
4404
+ // src/adapters/statePaths.ts
4405
+ import { homedir as homedir2 } from "node:os";
4406
+ import { join as join4 } from "node:path";
4407
+ function statePaths(platform, environment, home = homedir2()) {
4408
+ const explicit = environment.FREECODE_STATE_HOME;
4409
+ const root = explicit !== void 0 && explicit !== "" ? explicit : platform === "win32" ? join4(environment.LOCALAPPDATA ?? join4(home, "AppData", "Local"), "freecode") : platform === "darwin" ? join4(home, "Library", "Application Support", "freecode") : join4(
4410
+ environment.XDG_STATE_HOME !== void 0 && environment.XDG_STATE_HOME !== "" ? environment.XDG_STATE_HOME : join4(home, ".local", "state"),
4411
+ "freecode"
4412
+ );
4413
+ return {
4414
+ root,
4415
+ operations: join4(root, "operations"),
4416
+ cache: join4(root, "cache"),
4417
+ credential: join4(root, "session.json")
4418
+ };
4419
+ }
4420
+
4421
+ // src/commands/resumableOperation.ts
4422
+ function resumableOperation(stored, request) {
4423
+ const candidates = stored.filter((entry) => entry.ok).map((entry) => entry.operation).filter((operation) => !operation.abandoned && operation.state.tag !== "launch-complete").filter((operation) => {
4424
+ const intent = launchRequestFrom(operation.state);
4425
+ return request.repository === void 0 ? intent.cwd === request.cwd : intent.repository === request.repository;
4426
+ });
4427
+ return [...candidates].sort((left, right) => right.updatedAt.localeCompare(left.updatedAt))[0];
4428
+ }
4429
+
4430
+ // src/commands/repositoryStatusFrom.ts
4431
+ async function repositoryStatusFrom(runtime, slug, trace = () => void 0) {
4432
+ const components = [];
4433
+ const record = (component) => {
4434
+ trace(`${component.id}: ${component.state}`);
4435
+ components.push(component);
4436
+ };
4437
+ const [repository, principal, session] = await Promise.all([
4438
+ runtime.apis.onboarding.repositoryState(slug),
4439
+ runtime.github.resolvePrincipal(),
4440
+ platformSessionFrom(runtime)
4441
+ ]);
4442
+ const actor = principal.ok ? { login: principal.value.login, id: principal.value.id } : { login: null, id: null };
4443
+ record({
4444
+ id: "github",
4445
+ state: principal.ok ? "ready" : "absent",
4446
+ detail: principal.ok ? `@${principal.value.login} \xB7 #${principal.value.id}` : "not signed in"
4169
4447
  });
4170
4448
  const capability = session.kind === "active" ? await walletCapabilityFrom(runtime, session.auth) : void 0;
4171
4449
  const wallet = capability?.ok === true ? capability.wallet : null;
@@ -4255,6 +4533,11 @@ async function resolveRepository(runtime, named) {
4255
4533
 
4256
4534
  // src/commands/runDoctor.ts
4257
4535
  var supportedNodeMajor = 22;
4536
+ var HealthSchema = z34.object({
4537
+ status: z34.literal("ok"),
4538
+ chainId: z34.literal(8453),
4539
+ persistence: z34.literal("configured")
4540
+ });
4258
4541
  var mark = { ok: "\u2713", warn: "!", fail: "\u2717" };
4259
4542
  var nodeCheck = () => {
4260
4543
  const major = Number(process.versions.node.split(".")[0] ?? "0");
@@ -4327,12 +4610,12 @@ async function runDoctor(runtime, command) {
4327
4610
  detail: "ignored by FreeCode; would shadow the gh session if inherited"
4328
4611
  });
4329
4612
  }
4330
- const health = await fetch(`${runtime.config.apiOrigin}/health`).catch(() => void 0);
4613
+ const health = await requestJson(`${runtime.config.apiOrigin}/health`, HealthSchema);
4331
4614
  checks.push({
4332
4615
  id: "platform",
4333
- state: health?.ok === true ? "ok" : "fail",
4616
+ state: health.ok ? "ok" : "fail",
4334
4617
  label: "Platform",
4335
- detail: health?.ok === true ? runtime.config.apiOrigin : `${runtime.config.apiOrigin} is not answering`
4618
+ detail: health.ok ? runtime.config.apiOrigin : `${runtime.config.apiOrigin}: ${health.message} Check FREECODE_API_ORIGIN (include /api for the shared web/API deployment).`
4336
4619
  });
4337
4620
  const session = await platformSessionFrom(runtime);
4338
4621
  checks.push({
@@ -5806,7 +6089,7 @@ async function runStatus(runtime, command) {
5806
6089
  }
5807
6090
 
5808
6091
  // src/build/BuildValues.ts
5809
- import { z as z30 } from "zod";
6092
+ import { z as z35 } from "zod";
5810
6093
  var originSpecs = [
5811
6094
  {
5812
6095
  key: "apiOrigin",
@@ -5827,20 +6110,20 @@ var originSpecs = [
5827
6110
  label: "ship"
5828
6111
  }
5829
6112
  ];
5830
- var OriginSchema = z30.string().url().transform((value) => value.replace(/\/+$/, ""));
5831
- var OriginsSchema = z30.object({
6113
+ var OriginSchema = z35.string().url().transform((value) => value.replace(/\/+$/, ""));
6114
+ var OriginsSchema = z35.object({
5832
6115
  apiOrigin: OriginSchema,
5833
6116
  webOrigin: OriginSchema,
5834
6117
  shipOrigin: OriginSchema
5835
6118
  });
5836
- var VersionSchema2 = z30.string().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/);
5837
- var CommitSchema = z30.string().regex(/^[a-f0-9]{40}$/);
5838
- var BuildValuesSchema = z30.object({
5839
- packageName: z30.string().min(1),
6119
+ var VersionSchema2 = z35.string().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/);
6120
+ var CommitSchema = z35.string().regex(/^[a-f0-9]{40}$/);
6121
+ var BuildValuesSchema = z35.object({
6122
+ packageName: z35.string().min(1),
5840
6123
  version: VersionSchema2,
5841
6124
  commit: CommitSchema,
5842
- builtAt: z30.string().datetime(),
5843
- programNames: z30.array(z30.string().regex(/^[a-z][a-z0-9-]*$/)).min(1),
6125
+ builtAt: z35.string().datetime(),
6126
+ programNames: z35.array(z35.string().regex(/^[a-z][a-z0-9-]*$/)).min(1),
5844
6127
  origins: OriginsSchema
5845
6128
  });
5846
6129
  function originsFrom(environment, defaults) {
@@ -5928,258 +6211,6 @@ function cliConfigFrom(environment) {
5928
6211
  return origins.ok ? { ok: true, config: origins.origins } : { ok: false, detail: origins.detail };
5929
6212
  }
5930
6213
 
5931
- // ../../packages/platform-client/dist/authHeadersFrom.js
5932
- var authHeadersFrom = (auth) => ({
5933
- Authorization: `Bearer ${auth.accessToken}`,
5934
- ...auth.identityToken === null ? {} : { "privy-id-token": auth.identityToken }
5935
- });
5936
-
5937
- // ../../packages/platform-client/dist/postJson.js
5938
- var postJson = (body, headers = {}) => ({
5939
- method: "POST",
5940
- headers: { "Content-Type": "application/json", ...headers },
5941
- body: JSON.stringify(body)
5942
- });
5943
-
5944
- // ../../packages/platform-client/dist/requestJson.js
5945
- import { z as z31 } from "zod";
5946
- var ErrorResponseSchema = z31.object({
5947
- code: z31.string().optional(),
5948
- message: z31.string().optional()
5949
- });
5950
- async function requestJson(url, schema, signal, init) {
5951
- try {
5952
- const response = await fetch(url, { ...init, ...signal === void 0 ? {} : { signal } });
5953
- const payload = await response.json();
5954
- if (!response.ok) {
5955
- const error = ErrorResponseSchema.safeParse(payload);
5956
- return {
5957
- ok: false,
5958
- ...error.success && error.data.code !== void 0 ? { code: error.data.code } : {},
5959
- message: error.success ? error.data.message ?? error.data.code ?? `Request failed (${response.status}).` : `Request failed (${response.status}).`
5960
- };
5961
- }
5962
- const parsed = schema.safeParse(payload);
5963
- return parsed.success ? { ok: true, value: parsed.data } : { ok: false, message: "The server returned an invalid response." };
5964
- } catch (error) {
5965
- return {
5966
- ok: false,
5967
- message: error instanceof Error && error.name === "AbortError" ? "Request cancelled." : "The server could not be reached."
5968
- };
5969
- }
5970
- }
5971
-
5972
- // ../../packages/platform-client/dist/createCliBridgeApi.js
5973
- function createCliBridgeApi(origin2) {
5974
- const request = (requestId) => `${origin2}/cli/requests/${encodeURIComponent(requestId)}`;
5975
- return {
5976
- open: (input, signal) => requestJson(`${origin2}/cli/requests`, CliRequestTicketSchema, signal, postJson(input)),
5977
- view: (requestId, signal) => requestJson(request(requestId), CliRequestViewSchema, signal, { cache: "no-store" }),
5978
- approve: (requestId, approval, auth, signal) => requestJson(`${request(requestId)}/approve`, CliRequestViewSchema, signal, postJson(approval, authHeadersFrom(auth))),
5979
- redeem: (input, signal) => requestJson(`${request(input.requestId)}/claim`, CliExchangeSchema, signal, {
5980
- ...postJson({ requestId: input.requestId, codeVerifier: input.codeVerifier }),
5981
- cache: "no-store"
5982
- })
5983
- };
5984
- }
5985
-
5986
- // ../../packages/platform-client/dist/createIdentityApi.js
5987
- import { z as z32 } from "zod";
5988
- var IssueUrlSchema = z32.object({ url: z32.string().url() });
5989
- function createIdentityApi(origin2) {
5990
- return {
5991
- byWallet: (wallet, signal) => requestJson(`${origin2}/identity/uik/by-wallet/${wallet}`, WalletUiksSchema, signal),
5992
- registrationIssue: (wallet, signal) => {
5993
- const query = new URLSearchParams({ wallet });
5994
- return requestJson(`${origin2}/identity/register/issue-url?${query}`, IssueUrlSchema, signal);
5995
- },
5996
- registrationStatus: (issueUrl, signal) => {
5997
- const query = new URLSearchParams({ issueUrl });
5998
- return requestJson(`${origin2}/identity/register/status?${query}`, RegistrationStatusSchema, signal);
5999
- }
6000
- };
6001
- }
6002
-
6003
- // ../../packages/platform-client/dist/createOnboardingApi.js
6004
- import { z as z33 } from "zod";
6005
-
6006
- // ../../packages/platform-client/dist/requestSponsorshipOperation.js
6007
- var requestSponsorshipOperation = (origin2, referenceId, signal) => requestJson(`${origin2}/sponsorship/operations/${encodeURIComponent(referenceId)}`, SponsoredOperationStatusSchema, signal, { cache: "no-store" });
6008
-
6009
- // ../../packages/platform-client/dist/createOnboardingApi.js
6010
- var RikResponseSchema = z33.object({
6011
- githubRepoId: z33.number().int().positive(),
6012
- binding: KeyBindingSchema
6013
- });
6014
- var IssueUrlSchema2 = z33.object({
6015
- url: z33.string().url(),
6016
- title: z33.string(),
6017
- repo: z33.literal("freecodexyz/market"),
6018
- ownershipTier: OwnershipTierSchema.shape.tier,
6019
- githubRepoId: z33.number().int().positive()
6020
- });
6021
- var BalanceSchema = z33.object({ raw: z33.string().regex(/^\d+$/), formatted: z33.string() });
6022
- var GithubRepositoriesSchema = z33.array(GithubRepositorySummarySchema);
6023
- async function requestRepositoryEnrichments(origin2, repositories, signal) {
6024
- const uniqueRepositories = [...new Set(repositories)];
6025
- const batches = Array.from({ length: Math.ceil(uniqueRepositories.length / 100) }, (_, index) => uniqueRepositories.slice(index * 100, (index + 1) * 100));
6026
- const results = await Promise.all(batches.map((batch) => requestJson(`${origin2}/github/repositories/enrichment`, z33.array(GithubRepositoryEnrichmentSchema), signal, postJson({ repositories: batch }))));
6027
- const failure2 = results.find((result) => !result.ok);
6028
- if (failure2 !== void 0 && !failure2.ok)
6029
- return failure2;
6030
- return {
6031
- ok: true,
6032
- value: results.flatMap((result) => result.ok ? result.value : [])
6033
- };
6034
- }
6035
- function createOnboardingApi(origin2) {
6036
- return {
6037
- githubUser: (login, signal) => requestJson(`${origin2}/github/user/${encodeURIComponent(login)}`, GithubUserSchema, signal),
6038
- resolveIdentities: (githubUserIds, signal) => requestJson(`${origin2}/identity/uik/resolve`, z33.array(GithubIdentityResolutionSchema), signal, postJson({ githubUserIds })),
6039
- async teamMember(login, signal) {
6040
- const user = await requestJson(`${origin2}/github/user/${encodeURIComponent(login)}`, GithubUserSchema, signal);
6041
- if (!user.ok)
6042
- return user;
6043
- const identities = await requestJson(`${origin2}/identity/uik/resolve`, z33.array(GithubIdentityResolutionSchema), signal, postJson({ githubUserIds: [String(user.value.id)] }));
6044
- if (!identities.ok)
6045
- return identities;
6046
- const binding = identities.value[0]?.binding;
6047
- return {
6048
- ok: true,
6049
- value: {
6050
- githubUserId: String(user.value.id),
6051
- login: user.value.login,
6052
- avatarUrl: user.value.avatarUrl,
6053
- profileUrl: user.value.htmlUrl,
6054
- contributions: 0,
6055
- role: "advisor",
6056
- manuallyAdded: true,
6057
- identity: binding?.status === "bound" ? {
6058
- status: "bound",
6059
- wallet: binding.wallet,
6060
- boundAt: binding.boundAt
6061
- } : { status: "unbound" }
6062
- }
6063
- };
6064
- },
6065
- repositories: (login, signal) => requestJson(`${origin2}/github/user/${encodeURIComponent(login)}/repos`, GithubRepositoriesSchema, signal),
6066
- repository: (slug, signal) => requestJson(`${origin2}/github/repo/${slug}?enriched=true`, GithubRepoSchema, signal),
6067
- repositoryState: (slug, signal) => requestJson(`${origin2}/github/repo/${slug}`, GithubRepositoryStateSchema, signal),
6068
- repositoryEnrichments: (repositories, signal) => requestRepositoryEnrichments(origin2, repositories, signal),
6069
- async rik(slug, signal) {
6070
- const result = await requestJson(`${origin2}/market/rik/by-slug/${slug}`, RikResponseSchema, signal);
6071
- return result.ok ? { ok: true, value: result.value.binding } : result;
6072
- },
6073
- rikById: (githubRepoId, signal) => requestJson(`${origin2}/market/rik/by-id/${githubRepoId}`, KeyBindingSchema, signal),
6074
- ownershipTier: (slug, signal) => {
6075
- const query = new URLSearchParams({ repo: slug });
6076
- return requestJson(`${origin2}/market/register/ownership-tier?${query}`, OwnershipTierSchema, signal);
6077
- },
6078
- async registrationIssue(slug, wallet, signal) {
6079
- const query = new URLSearchParams({ wallet, repo: slug });
6080
- const result = await requestJson(`${origin2}/market/register/issue-url?${query}`, IssueUrlSchema2, signal);
6081
- return result.ok ? {
6082
- ok: true,
6083
- value: {
6084
- url: result.value.url,
6085
- ownershipTier: result.value.ownershipTier
6086
- }
6087
- } : result;
6088
- },
6089
- registrationStatus: (issueUrl, signal) => {
6090
- const query = new URLSearchParams({ issueUrl });
6091
- return requestJson(`${origin2}/market/register/status?${query}`, RegistrationStatusSchema, signal);
6092
- },
6093
- token: (address, signal) => requestJson(`${origin2}/erc20/${address}`, TokenMetadataSchema, signal),
6094
- balance: (token, wallet, signal) => requestJson(`${origin2}/erc20/${token}/balance/${wallet}`, BalanceSchema, signal),
6095
- marketState: (repoId, signal) => requestJson(`${origin2}/market/launch/state/${repoId}`, MarketLaunchStateSchema, signal),
6096
- marketPreview: (repoId, signal) => requestJson(`${origin2}/market/launch/preview/${repoId}`, MarketPreviewSchema, signal),
6097
- pinImage: (input, signal) => {
6098
- const body = new FormData();
6099
- body.append("githubRepoId", String(input.githubRepoId));
6100
- body.append("challenge", input.challenge);
6101
- body.append("signature", input.signature);
6102
- body.append("wallet", input.wallet);
6103
- body.append("file", input.file, input.fileName);
6104
- return requestJson(`${origin2}/media/images`, PinnedImageSchema, signal, {
6105
- method: "POST",
6106
- body
6107
- });
6108
- },
6109
- pinMetadata: ({ links, ...input }, signal) => requestJson(`${origin2}/market/metadata/pin`, PinnedMarketMetadataSchema, signal, postJson({ ...input, ...links })),
6110
- devBuyQuote: (repoId, input, signal) => requestJson(`${origin2}/market/launch/dev-buy/quote/${repoId}`, MarketDevBuyQuoteSchema, signal, postJson(input)),
6111
- marketTransaction: (repoId, input, signal) => requestJson(`${origin2}/market/launch/tx/${repoId}`, MarketLaunchPlanSchema, signal, postJson(input)),
6112
- sponsoredMarketLaunch: (repoId, input, auth, signal) => requestJson(`${origin2}/sponsorship/markets/${repoId}/launch`, SponsoredLaunchSubmissionSchema, signal, postJson(input, authHeadersFrom(auth))),
6113
- sponsorshipOperation: (referenceId, signal) => requestSponsorshipOperation(origin2, referenceId, signal),
6114
- saveRepositoryProfile: (githubRepoId, input, signal) => requestJson(`${origin2}/owner/repositories/${githubRepoId}/profile`, ProjectProfileSchema, signal, {
6115
- method: "PUT",
6116
- headers: { "Content-Type": "application/json" },
6117
- body: JSON.stringify(input)
6118
- })
6119
- };
6120
- }
6121
-
6122
- // ../../packages/platform-client/dist/createSessionApi.js
6123
- function createSessionApi(origin2) {
6124
- return {
6125
- whoami: (auth, signal) => requestJson(`${origin2}/auth/whoami`, WhoamiSchema, signal, {
6126
- headers: authHeadersFrom(auth),
6127
- cache: "no-store"
6128
- }),
6129
- delegation: (wallet, auth, signal) => requestJson(`${origin2}/sponsorship/delegation/${wallet}`, SponsorshipDelegationSchema, signal, { headers: authHeadersFrom(auth), cache: "no-store" })
6130
- };
6131
- }
6132
-
6133
- // ../../packages/platform-client/dist/createShipRegistrationApi.js
6134
- function createShipRegistrationApi(origin2) {
6135
- const project = (projectId) => `${origin2}/ship/projects/${encodeURIComponent(projectId)}`;
6136
- return {
6137
- schema: (signal) => requestJson(`${origin2}/ship/registration/schema`, ShipRegistrationSchemaSchema, signal),
6138
- eligibility: (repository, wallet, signal) => {
6139
- const query = new URLSearchParams({ repository, wallet });
6140
- return requestJson(`${origin2}/ship/registration/eligibility?${query}`, ShipRegistrationEligibilitySchema, signal);
6141
- },
6142
- draft: (repository, signal) => requestJson(`${origin2}/ship/registration/draft`, ShipPolicyDraftSchema, signal, postJson({ repository })),
6143
- manifest: (request, signal) => requestJson(`${origin2}/ship/registration/manifest`, ShipRegistrationManifestSchema, signal, postJson(request)),
6144
- register: (submission, signal) => requestJson(`${origin2}/ship/registration`, ShipRegistrationReceiptSchema, signal, postJson(submission)),
6145
- updatePolicy: (projectId, submission, signal) => requestJson(`${project(projectId)}/policy`, ShipRegistrationReceiptSchema, signal, {
6146
- ...postJson(submission),
6147
- method: "PUT"
6148
- }),
6149
- publish: (signal) => requestJson(`${origin2}/ship/registration/publish`, ShipPublishDispatchSchema, signal, {
6150
- method: "POST"
6151
- }),
6152
- publication: (projectId, commitSha, signal) => {
6153
- const query = commitSha === void 0 ? "" : `?${new URLSearchParams({ commitSha })}`;
6154
- return requestJson(`${project(projectId)}/publication${query}`, ShipPublicationSchema, signal);
6155
- }
6156
- };
6157
- }
6158
-
6159
- // ../../packages/platform-client/dist/createShipStaticApi.js
6160
- function createShipStaticApi(origin2 = shipStaticOrigin) {
6161
- return {
6162
- index: (signal) => requestJson(`${origin2}${shipStaticPaths.index}`, ShipStaticIndexSchema, signal),
6163
- async snapshot(signal) {
6164
- try {
6165
- const response = await fetch(`${origin2}${shipStaticPaths.snapshot}`, {
6166
- ...signal === void 0 ? {} : { signal }
6167
- });
6168
- if (!response.ok) {
6169
- return { ok: false, message: `Ship's snapshot returned ${response.status}.` };
6170
- }
6171
- const bytes = await response.text();
6172
- const parsed = SnapshotSchema.safeParse(JSON.parse(bytes));
6173
- return parsed.success ? { ok: true, value: { bytes, value: parsed.data } } : { ok: false, message: "Ship's snapshot is not a snapshot this client understands." };
6174
- } catch {
6175
- return { ok: false, message: "Ship could not be reached." };
6176
- }
6177
- },
6178
- skills: (signal) => requestJson(`${origin2}${shipStaticPaths.skills}`, ShipSkillsIndexSchema, signal),
6179
- manifest: (projectId, signal) => requestJson(`${origin2}${shipStaticPaths.manifest(projectId)}`, ShipSkillManifestSchema, signal)
6180
- };
6181
- }
6182
-
6183
6214
  // src/adapters/createCredentialStore.ts
6184
6215
  import { chmod, mkdir as mkdir4, readFile as readFile4, rm as rm3, writeFile as writeFile2 } from "node:fs/promises";
6185
6216
  import { dirname as dirname2 } from "node:path";
@@ -6322,29 +6353,29 @@ function createGitAdapter() {
6322
6353
  }
6323
6354
 
6324
6355
  // src/adapters/createGithubAdapter.ts
6325
- import { z as z34 } from "zod";
6326
- var PrincipalSchema = z34.object({ id: z34.number().int().positive(), login: z34.string().min(1) });
6327
- var TopicsSchema = z34.object({ names: z34.array(z34.string()) });
6328
- var IssueSchema = z34.object({ number: z34.number().int().positive(), html_url: z34.string().min(1) });
6329
- var SearchSchema = z34.object({
6330
- items: z34.array(
6331
- z34.object({
6332
- number: z34.number().int().positive(),
6333
- html_url: z34.string().min(1),
6334
- body: z34.string().nullable()
6356
+ import { z as z36 } from "zod";
6357
+ var PrincipalSchema = z36.object({ id: z36.number().int().positive(), login: z36.string().min(1) });
6358
+ var TopicsSchema = z36.object({ names: z36.array(z36.string()) });
6359
+ var IssueSchema = z36.object({ number: z36.number().int().positive(), html_url: z36.string().min(1) });
6360
+ var SearchSchema = z36.object({
6361
+ items: z36.array(
6362
+ z36.object({
6363
+ number: z36.number().int().positive(),
6364
+ html_url: z36.string().min(1),
6365
+ body: z36.string().nullable()
6335
6366
  })
6336
6367
  )
6337
6368
  });
6338
- var PermissionsSchema = z34.object({
6339
- permissions: z34.object({ admin: z34.boolean(), push: z34.boolean() }).optional()
6369
+ var PermissionsSchema = z36.object({
6370
+ permissions: z36.object({ admin: z36.boolean(), push: z36.boolean() }).optional()
6340
6371
  });
6341
- var ContentsFileSchema = z34.object({
6342
- type: z34.literal("file"),
6343
- content: z34.string(),
6344
- encoding: z34.literal("base64")
6372
+ var ContentsFileSchema = z36.object({
6373
+ type: z36.literal("file"),
6374
+ content: z36.string(),
6375
+ encoding: z36.literal("base64")
6345
6376
  });
6346
- var ContentsDirectorySchema = z34.array(
6347
- z34.object({ type: z34.enum(["file", "dir", "symlink", "submodule"]), path: z34.string() })
6377
+ var ContentsDirectorySchema = z36.array(
6378
+ z36.object({ type: z36.enum(["file", "dir", "symlink", "submodule"]), path: z36.string() })
6348
6379
  );
6349
6380
  var failureFrom = (outcome) => {
6350
6381
  if (outcome.reason === "not-found") {
@@ -6765,6 +6796,17 @@ function parseLeaf(spec, argv) {
6765
6796
  }
6766
6797
  }
6767
6798
 
6799
+ // src/runtime/programExitCode.ts
6800
+ async function programExitCode(result, failureCode, stderr) {
6801
+ try {
6802
+ return await result;
6803
+ } catch (error) {
6804
+ stderr.write(`${error instanceof Error ? error.message : String(error)}
6805
+ `);
6806
+ return failureCode;
6807
+ }
6808
+ }
6809
+
6768
6810
  // src/index.ts
6769
6811
  async function main() {
6770
6812
  const invocation = invocationFrom(process.argv[1]);
@@ -6812,13 +6854,4 @@ process.on("SIGINT", () => {
6812
6854
  process.stderr.write("\nStopped. Run the same command again to continue where it left off.\n");
6813
6855
  process.exit(Exit.temporaryFailure);
6814
6856
  });
6815
- main().then(
6816
- (code) => {
6817
- process.exitCode = code;
6818
- },
6819
- (error) => {
6820
- process.stderr.write(`${error instanceof Error ? error.message : String(error)}
6821
- `);
6822
- process.exitCode = Exit.internalError;
6823
- }
6824
- );
6857
+ process.exitCode = await programExitCode(main(), Exit.internalError, process.stderr);