@lucid-agents/taskmarket 1.17.1 → 1.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -586,6 +586,9 @@ var TaskAwardSchema = z6.object({
586
586
  rating: z6.number().min(0).max(100).nullable()
587
587
  });
588
588
  var TaskCreateSchema = z6.object({
589
+ // Kept through validateBody, which replaces the body with the parsed result before the
590
+ // payment middleware reads the chain from it. Omitted, the task goes on the default chain.
591
+ chainId: z6.number().int().positive().optional(),
589
592
  description: z6.string().min(1, "Description is required").max(TASK_DESCRIPTION_MAX_LENGTH, "Description is too long"),
590
593
  reward: PositiveUsdcBaseUnitsSchema,
591
594
  duration: z6.number().positive("Duration must be positive"),
@@ -1279,7 +1282,20 @@ var HealthResponseSchema = z10.object({
1279
1282
  runwayUsd: z10.number().nonnegative().optional(),
1280
1283
  /** True below SERVER_WALLET_MIN_RUNWAY_USD; absent when no minimum applies. */
1281
1284
  belowMinimum: z10.boolean().optional(),
1282
- measuredAt: z10.string()
1285
+ /** The hard floor in base units, and whether the balance is below it (sponsorship refused). */
1286
+ sponsorFloor: z10.string().optional(),
1287
+ belowSponsorFloor: z10.boolean().optional(),
1288
+ /** When fees fell back to another token, the primary token and its balance (issue #1418). */
1289
+ primaryFeeToken: z10.string().optional(),
1290
+ primaryFeeTokenBalance: z10.string().optional(),
1291
+ /** When the last good measurement was taken. */
1292
+ measuredAt: z10.string(),
1293
+ /**
1294
+ * True when recent reads failed repeatedly or the last good measurement is old (issue
1295
+ * #1418); the other fields are then the last known values.
1296
+ */
1297
+ stale: z10.boolean().optional(),
1298
+ consecutiveFailures: z10.number().int().nonnegative().optional()
1283
1299
  })).optional(),
1284
1300
  /**
1285
1301
  * Each served chain's external dependencies (issue #981): RPC, contracts, payment and fee
@@ -1307,6 +1323,20 @@ var HealthResponseSchema = z10.object({
1307
1323
  ok: z10.boolean(),
1308
1324
  problem: z10.string().optional()
1309
1325
  }))
1326
+ })).optional(),
1327
+ /**
1328
+ * Whether each served chain's platform fee recipient (the Diamond's `feeRecipient()`) can
1329
+ * receive the payment token under its blacklist, TIP-403 transfer policy and receive policy
1330
+ * (#926 I-3), checked at startup and every 15 minutes. `canReceive` is absent when the check
1331
+ * could not reach a verdict; `problem` then says why. Absent before the first check.
1332
+ */
1333
+ feeRecipients: z10.array(z10.object({
1334
+ chainId: z10.number().int(),
1335
+ address: z10.string().optional(),
1336
+ token: z10.string(),
1337
+ canReceive: z10.boolean().optional(),
1338
+ problem: z10.string().optional(),
1339
+ checkedAt: z10.string()
1310
1340
  })).optional()
1311
1341
  });
1312
1342
 
@@ -3571,6 +3601,25 @@ var API_ERROR_REASONS = [
3571
3601
  * another network. Refused before any payment was verified, so nothing was charged.
3572
3602
  */
3573
3603
  "chain_conflict",
3604
+ /**
3605
+ * The server would pay the fee for this transaction and the caller's budget is spent, or the
3606
+ * sender already has a sponsored transaction in flight on this chain. Refused before anything
3607
+ * was co-signed or broadcast, so nothing was charged; retry later.
3608
+ */
3609
+ "sponsorship_rate_limited",
3610
+ /**
3611
+ * Tempo only. The server wallet's fee balance on this chain is below its sponsorship floor, so
3612
+ * the server refuses to co-sign MPP payments and signed-transfer withdrawals until it is
3613
+ * refunded. Refused before anything was co-signed or broadcast, so nothing was charged.
3614
+ */
3615
+ "sponsorship_unavailable",
3616
+ /**
3617
+ * Tempo only. The signed transaction breaks a rule the chain's node enforces, such as a
3618
+ * `validBefore` further past the latest block than the chain allows. Either it was refused
3619
+ * before the server co-signed it, or the node refused it at broadcast; either way nothing was
3620
+ * sent and nothing moved. Sign a new transaction that meets the rule in the message.
3621
+ */
3622
+ "sponsored_transaction_refused",
3574
3623
  /**
3575
3624
  * The error carries no more specific classification. Present so that every error has a
3576
3625
  * reason field and a client's switch is total; not a licence to leave one here.
@@ -4657,13 +4706,13 @@ function usdcToBaseUnits(value, options = {}) {
4657
4706
  const normalized = value.trim();
4658
4707
  const match = USDC_PATTERN.exec(normalized);
4659
4708
  if (!match) {
4660
- throw new Error(`USDC amount must be a positive decimal with at most ${USDC_DECIMALS} fractional digits`);
4709
+ throw new Error(`Amount must be a positive decimal with at most ${USDC_DECIMALS} fractional digits`);
4661
4710
  }
4662
4711
  const whole = BigInt(match[1]);
4663
4712
  const fraction = BigInt((match[2] ?? "").padEnd(USDC_DECIMALS, "0") || "0");
4664
4713
  const baseUnits = whole * USDC_BASE_UNITS + fraction;
4665
4714
  if (baseUnits < 0n || baseUnits === 0n && !options.allowZero) {
4666
- throw new Error("USDC amount must be greater than zero");
4715
+ throw new Error("Amount must be greater than zero");
4667
4716
  }
4668
4717
  return baseUnits.toString();
4669
4718
  }
@@ -4682,37 +4731,319 @@ function formatUsdcBaseUnits(value, options = {}) {
4682
4731
  return fraction ? `${sign}${whole}.${fraction}` : `${sign}${whole}`;
4683
4732
  }
4684
4733
 
4734
+ // ../../packages/shared/dist/chains/registry.js
4735
+ import { base, baseSepolia, foundry, tempo, tempoModerato } from "viem/chains";
4736
+
4737
+ // ../../packages/shared/dist/schemas/swarm-chain.schemas.js
4738
+ import { z as z38 } from "zod";
4739
+ var SwarmChainIdSchema = z38.union([z38.literal(8453), z38.literal(84532)]);
4740
+ var SWARM_CONSENT_TEXT_VERSIONS = [
4741
+ "swarm-testnet-v1",
4742
+ "swarm-testnet-pilot-v1",
4743
+ "swarm-mainnet-v1",
4744
+ "swarm-mainnet-pilot-v1",
4745
+ // Implements: ADR-0183. Swarm YOLO mode: any recipient within the caps for a standing period.
4746
+ "swarm-testnet-yolo-v1",
4747
+ "swarm-testnet-yolo-pilot-v1",
4748
+ "swarm-mainnet-yolo-v1",
4749
+ "swarm-mainnet-yolo-pilot-v1",
4750
+ // Implements: ADR-0185. Standing free market actions only: no payment rule of any kind.
4751
+ "swarm-testnet-market-v1",
4752
+ "swarm-mainnet-market-v1",
4753
+ // Per ADR-0212. Standing YOLO: any recipient within the caps, with no end date, until revoked.
4754
+ "swarm-testnet-standing-v1",
4755
+ "swarm-testnet-standing-pilot-v1",
4756
+ "swarm-mainnet-standing-v1",
4757
+ "swarm-mainnet-standing-pilot-v1"
4758
+ ];
4759
+ var SWARM_CHAINS = Object.freeze({
4760
+ 8453: Object.freeze({
4761
+ chainId: 8453,
4762
+ caip2: "eip155:8453",
4763
+ name: "Base",
4764
+ testnet: false,
4765
+ usdc: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
4766
+ usdcDomainName: "USD Coin",
4767
+ usdcDomainVersion: "2",
4768
+ publicRpcUrl: "https://mainnet.base.org",
4769
+ qualifiedRpcOrigins: Object.freeze([
4770
+ "https://mainnet.base.org",
4771
+ "https://base-mainnet.rpc.privy.systems"
4772
+ ]),
4773
+ explorerUrl: "https://basescan.org",
4774
+ identityRegistry: "0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",
4775
+ consentVersion: "swarm-mainnet-v1",
4776
+ pilotConsentVersion: "swarm-mainnet-pilot-v1",
4777
+ yoloConsentVersion: "swarm-mainnet-yolo-v1",
4778
+ yoloPilotConsentVersion: "swarm-mainnet-yolo-pilot-v1",
4779
+ marketConsentVersion: "swarm-mainnet-market-v1",
4780
+ standingConsentVersion: "swarm-mainnet-standing-v1",
4781
+ standingPilotConsentVersion: "swarm-mainnet-standing-pilot-v1"
4782
+ }),
4783
+ 84532: Object.freeze({
4784
+ chainId: 84532,
4785
+ caip2: "eip155:84532",
4786
+ name: "Base Sepolia",
4787
+ testnet: true,
4788
+ usdc: "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
4789
+ usdcDomainName: "USDC",
4790
+ usdcDomainVersion: "2",
4791
+ publicRpcUrl: "https://sepolia.base.org",
4792
+ qualifiedRpcOrigins: Object.freeze([
4793
+ "https://sepolia.base.org",
4794
+ "https://base-sepolia.rpc.privy.systems"
4795
+ ]),
4796
+ explorerUrl: "https://sepolia.basescan.org",
4797
+ identityRegistry: "0x8004A818BFB912233c491871b3d84c89A494BD9e",
4798
+ consentVersion: "swarm-testnet-v1",
4799
+ pilotConsentVersion: "swarm-testnet-pilot-v1",
4800
+ yoloConsentVersion: "swarm-testnet-yolo-v1",
4801
+ yoloPilotConsentVersion: "swarm-testnet-yolo-pilot-v1",
4802
+ marketConsentVersion: "swarm-testnet-market-v1",
4803
+ standingConsentVersion: "swarm-testnet-standing-v1",
4804
+ standingPilotConsentVersion: "swarm-testnet-standing-pilot-v1"
4805
+ })
4806
+ });
4807
+ function isSwarmChainId(value) {
4808
+ return value === 8453 || value === 84532;
4809
+ }
4810
+
4811
+ // ../../packages/shared/dist/chains/validity-window.js
4812
+ var TEMPO_MAX_VALIDITY_WINDOW_SECONDS = 300;
4813
+ var VALIDITY_WINDOW_CLIENT_MARGIN_SECONDS = 60;
4814
+ function clampValidityWindowSeconds(preferred, maxValidityWindowSeconds) {
4815
+ if (maxValidityWindowSeconds === void 0)
4816
+ return preferred;
4817
+ return Math.min(preferred, maxValidityWindowSeconds - VALIDITY_WINDOW_CLIENT_MARGIN_SECONDS);
4818
+ }
4819
+
4820
+ // ../../packages/shared/dist/chains/registry.js
4821
+ var TASKMARKET_CHAIN_IDS = [8453, 84532, 4217, 42431, 31337];
4822
+ function paymentProtocolFor(method) {
4823
+ return method === "mpp-tempo" ? "mpp" : "x402";
4824
+ }
4825
+ var ERC8004_MAINNET = {
4826
+ identityRegistry: "0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",
4827
+ reputationRegistry: "0x8004BAa17C55a88189AE136b182e5fdA19dE9b63"
4828
+ };
4829
+ var ERC8004_TESTNET = {
4830
+ identityRegistry: "0x8004A818BFB912233c491871b3d84c89A494BD9e",
4831
+ reputationRegistry: "0x8004B663056A597Dffe9eCcC1965A193B7388713"
4832
+ };
4833
+ var OUSD = "0x20c0000000000000000000006a37da5c996874be";
4834
+ var PATH_USD = "0x20c0000000000000000000000000000000000000";
4835
+ var TEMPO_PROTOCOL = {
4836
+ feeManager: "0xfeEC000000000000000000000000000000000000",
4837
+ tip403Registry: "0x403c000000000000000000000000000000000000",
4838
+ receivePolicyGuard: "0xB10C000000000000000000000000000000000000",
4839
+ stablecoinDex: "0xDEc0000000000000000000000000000000000000"
4840
+ };
4841
+ var baseFeatures = (chainId) => ({
4842
+ swarmWallets: isSwarmChainId(chainId),
4843
+ catalog: true,
4844
+ cctpFunding: true,
4845
+ relayFunding: chainId === 8453,
4846
+ dreamsRewards: true,
4847
+ receivePolicies: false
4848
+ });
4849
+ var TEMPO_FEATURES = {
4850
+ swarmWallets: false,
4851
+ catalog: false,
4852
+ cctpFunding: false,
4853
+ relayFunding: false,
4854
+ dreamsRewards: false,
4855
+ receivePolicies: true
4856
+ };
4857
+ var tempoPayment = {
4858
+ token: OUSD,
4859
+ symbol: "OUSD",
4860
+ decimals: 6,
4861
+ domain: { name: "OpenUSD", version: "1" },
4862
+ method: "mpp-tempo"
4863
+ };
4864
+ var TEMPO_RATE_TASK_GAS_LIMIT = 4000000n;
4865
+ var tempoFees = { kind: "tip20", token: OUSD, fallbackToken: PATH_USD };
4866
+ function deepFreeze(value) {
4867
+ for (const [key, nested] of Object.entries(value)) {
4868
+ if (key === "viemChain")
4869
+ continue;
4870
+ if (nested && typeof nested === "object" && !Object.isFrozen(nested))
4871
+ deepFreeze(nested);
4872
+ }
4873
+ return Object.freeze(value);
4874
+ }
4875
+ function freeze(chain) {
4876
+ return deepFreeze(chain);
4877
+ }
4878
+ var TASKMARKET_CHAINS = Object.freeze({
4879
+ 8453: freeze({
4880
+ chainId: 8453,
4881
+ caip2: "eip155:8453",
4882
+ name: "Base",
4883
+ testnet: false,
4884
+ viemChain: base,
4885
+ publicRpcUrl: SWARM_CHAINS[8453].publicRpcUrl,
4886
+ explorerUrl: SWARM_CHAINS[8453].explorerUrl,
4887
+ payment: {
4888
+ token: SWARM_CHAINS[8453].usdc,
4889
+ symbol: "USDC",
4890
+ decimals: 6,
4891
+ domain: { name: SWARM_CHAINS[8453].usdcDomainName, version: "2" },
4892
+ method: "eip3009"
4893
+ },
4894
+ fees: { kind: "native" },
4895
+ blockTimeMs: 2e3,
4896
+ rateTaskGasLimit: 1500000n,
4897
+ indexer: { head: "latest", logRangeBlocks: 1e4 },
4898
+ erc8004: { ...ERC8004_MAINNET },
4899
+ features: baseFeatures(8453)
4900
+ }),
4901
+ 84532: freeze({
4902
+ chainId: 84532,
4903
+ caip2: "eip155:84532",
4904
+ name: "Base Sepolia",
4905
+ testnet: true,
4906
+ viemChain: baseSepolia,
4907
+ publicRpcUrl: SWARM_CHAINS[84532].publicRpcUrl,
4908
+ explorerUrl: SWARM_CHAINS[84532].explorerUrl,
4909
+ payment: {
4910
+ token: SWARM_CHAINS[84532].usdc,
4911
+ symbol: "USDC",
4912
+ decimals: 6,
4913
+ domain: { name: SWARM_CHAINS[84532].usdcDomainName, version: "2" },
4914
+ method: "eip3009"
4915
+ },
4916
+ fees: { kind: "native" },
4917
+ blockTimeMs: 2e3,
4918
+ rateTaskGasLimit: 1500000n,
4919
+ indexer: { head: "latest", logRangeBlocks: 1e4 },
4920
+ erc8004: { ...ERC8004_TESTNET },
4921
+ features: baseFeatures(84532)
4922
+ }),
4923
+ 4217: freeze({
4924
+ chainId: 4217,
4925
+ caip2: "eip155:4217",
4926
+ name: "Tempo",
4927
+ testnet: false,
4928
+ viemChain: tempo,
4929
+ publicRpcUrl: tempo.rpcUrls.default.http[0],
4930
+ explorerUrl: "https://explore.tempo.xyz",
4931
+ payment: { ...tempoPayment, domain: { ...tempoPayment.domain } },
4932
+ fees: { ...tempoFees },
4933
+ blockTimeMs: 1e3,
4934
+ rateTaskGasLimit: TEMPO_RATE_TASK_GAS_LIMIT,
4935
+ maxValidityWindowSeconds: TEMPO_MAX_VALIDITY_WINDOW_SECONDS,
4936
+ // Tempo finality is deterministic and fast; until the provider's eth_getLogs limit is
4937
+ // measured (#907), keep the same range as Base.
4938
+ indexer: { head: "finalized", logRangeBlocks: 1e4 },
4939
+ erc8004: { ...ERC8004_MAINNET },
4940
+ features: { ...TEMPO_FEATURES },
4941
+ tempo: { ...TEMPO_PROTOCOL, paymentTokenPolicyId: 2 }
4942
+ }),
4943
+ 42431: freeze({
4944
+ chainId: 42431,
4945
+ caip2: "eip155:42431",
4946
+ name: "Tempo Moderato",
4947
+ testnet: true,
4948
+ viemChain: tempoModerato,
4949
+ publicRpcUrl: tempoModerato.rpcUrls.default.http[0],
4950
+ explorerUrl: "https://explore.testnet.tempo.xyz",
4951
+ payment: { ...tempoPayment, domain: { ...tempoPayment.domain } },
4952
+ fees: { ...tempoFees },
4953
+ blockTimeMs: 1e3,
4954
+ rateTaskGasLimit: TEMPO_RATE_TASK_GAS_LIMIT,
4955
+ maxValidityWindowSeconds: TEMPO_MAX_VALIDITY_WINDOW_SECONDS,
4956
+ indexer: { head: "finalized", logRangeBlocks: 1e4 },
4957
+ erc8004: { ...ERC8004_TESTNET },
4958
+ features: { ...TEMPO_FEATURES },
4959
+ tempo: { ...TEMPO_PROTOCOL, paymentTokenPolicyId: 1 }
4960
+ }),
4961
+ 31337: freeze({
4962
+ chainId: 31337,
4963
+ caip2: "eip155:31337",
4964
+ name: "Local",
4965
+ testnet: true,
4966
+ viemChain: foundry,
4967
+ publicRpcUrl: "http://127.0.0.1:8545",
4968
+ explorerUrl: "",
4969
+ // The local mock token is deployed per run; its address comes from the environment.
4970
+ payment: {
4971
+ token: void 0,
4972
+ symbol: "USDC",
4973
+ decimals: 6,
4974
+ domain: { name: "USD Coin", version: "2" },
4975
+ method: "eip3009"
4976
+ },
4977
+ fees: { kind: "native" },
4978
+ blockTimeMs: 1e3,
4979
+ rateTaskGasLimit: 1500000n,
4980
+ indexer: { head: "latest", logRangeBlocks: 1e4 },
4981
+ erc8004: void 0,
4982
+ features: {
4983
+ swarmWallets: false,
4984
+ catalog: false,
4985
+ cctpFunding: false,
4986
+ relayFunding: false,
4987
+ dreamsRewards: true,
4988
+ receivePolicies: false
4989
+ }
4990
+ })
4991
+ });
4992
+ var UnknownChainError = class extends Error {
4993
+ constructor(chainId) {
4994
+ super(`Taskmarket does not support chain ${String(chainId)}`);
4995
+ this.name = "UnknownChainError";
4996
+ this.chainId = chainId;
4997
+ }
4998
+ };
4999
+ function isTaskmarketChainId(value) {
5000
+ return TASKMARKET_CHAIN_IDS.includes(value);
5001
+ }
5002
+ function taskmarketChain(chainId) {
5003
+ if (!isTaskmarketChainId(chainId))
5004
+ throw new UnknownChainError(chainId);
5005
+ return TASKMARKET_CHAINS[chainId];
5006
+ }
5007
+ function clientValidityWindowSeconds(chainId, preferred) {
5008
+ return clampValidityWindowSeconds(preferred, isTaskmarketChainId(chainId) ? TASKMARKET_CHAINS[chainId].maxValidityWindowSeconds : void 0);
5009
+ }
5010
+
5011
+ // ../../packages/shared/dist/lib/payment-amount.js
5012
+ function paymentTokenSymbol(chainId) {
5013
+ return taskmarketChain(chainId).payment.symbol;
5014
+ }
5015
+
4685
5016
  // ../../packages/shared/dist/schemas/launcher.schemas.js
4686
- import { z as z40 } from "zod";
5017
+ import { z as z41 } from "zod";
4687
5018
 
4688
5019
  // ../../packages/shared/dist/schemas/agent-platform.schemas.js
4689
- import { z as z39 } from "zod";
5020
+ import { z as z40 } from "zod";
4690
5021
 
4691
5022
  // ../../packages/shared/dist/schemas/swarm-budget.schemas.js
4692
- import { z as z38 } from "zod";
5023
+ import { z as z39 } from "zod";
4693
5024
  var SWARM_USDC_ATOMIC_PATTERN = /^(?:0|[1-9][0-9]{0,17})$/;
4694
- var SwarmUsdcAtomicAmountSchema = z38.string().regex(SWARM_USDC_ATOMIC_PATTERN);
4695
- var SwarmBudgetIdSchema = z38.object({ agentId: z38.string().uuid() }).strict();
5025
+ var SwarmUsdcAtomicAmountSchema = z39.string().regex(SWARM_USDC_ATOMIC_PATTERN);
5026
+ var SwarmBudgetIdSchema = z39.object({ agentId: z39.string().uuid() }).strict();
4696
5027
  var SwarmBudgetInputSchema = SwarmBudgetIdSchema.extend({
4697
- requestKey: z38.string().uuid(),
4698
- enabled: z38.boolean(),
5028
+ requestKey: z39.string().uuid(),
5029
+ enabled: z39.boolean(),
4699
5030
  maxPurchase: SwarmUsdcAtomicAmountSchema,
4700
5031
  rollingDay: SwarmUsdcAtomicAmountSchema,
4701
5032
  period: SwarmUsdcAtomicAmountSchema
4702
5033
  }).strict();
4703
- var SwarmBudgetViewSchema = z38.object({
4704
- agentId: z38.string().uuid(),
4705
- configured: z38.boolean(),
4706
- enabled: z38.boolean(),
4707
- paused: z38.boolean(),
5034
+ var SwarmBudgetViewSchema = z39.object({
5035
+ agentId: z39.string().uuid(),
5036
+ configured: z39.boolean(),
5037
+ enabled: z39.boolean(),
5038
+ paused: z39.boolean(),
4708
5039
  maxPurchase: SwarmUsdcAtomicAmountSchema,
4709
5040
  rollingDay: SwarmUsdcAtomicAmountSchema,
4710
5041
  period: SwarmUsdcAtomicAmountSchema,
4711
- spendingEnabled: z38.boolean()
5042
+ spendingEnabled: z39.boolean()
4712
5043
  });
4713
- var SwarmBudgetUpdateResultSchema = z38.object({
4714
- requestKey: z38.string().uuid(),
4715
- replayed: z38.boolean(),
5044
+ var SwarmBudgetUpdateResultSchema = z39.object({
5045
+ requestKey: z39.string().uuid(),
5046
+ replayed: z39.boolean(),
4716
5047
  budget: SwarmBudgetViewSchema
4717
5048
  });
4718
5049
 
@@ -4727,191 +5058,191 @@ var AGENT_PLATFORM_COMPONENTS = [
4727
5058
  "session-reset",
4728
5059
  "memory"
4729
5060
  ];
4730
- var AgentPlatformComponentSchema = z39.enum(AGENT_PLATFORM_COMPONENTS);
5061
+ var AgentPlatformComponentSchema = z40.enum(AGENT_PLATFORM_COMPONENTS);
4731
5062
  var AgentPlatformToolInputSchemas = {
4732
- platform_status: z39.object({}).strict(),
4733
- ui_show: z39.object({ component: AgentPlatformComponentSchema, reason: z39.string().trim().min(1).max(500) }).strict()
5063
+ platform_status: z40.object({}).strict(),
5064
+ ui_show: z40.object({ component: AgentPlatformComponentSchema, reason: z40.string().trim().min(1).max(500) }).strict()
4734
5065
  };
4735
- var AgentUiCardSchema = z39.object({
5066
+ var AgentUiCardSchema = z40.object({
4736
5067
  component: AgentPlatformComponentSchema,
4737
- reason: z39.string().max(500),
4738
- tainted: z39.boolean()
4739
- });
4740
- var AgentPlatformStatusSchema = z39.object({
4741
- version: z39.literal(1),
4742
- identity: z39.object({
4743
- agentId: z39.string().uuid(),
4744
- name: z39.string(),
5068
+ reason: z40.string().max(500),
5069
+ tainted: z40.boolean()
5070
+ });
5071
+ var AgentPlatformStatusSchema = z40.object({
5072
+ version: z40.literal(1),
5073
+ identity: z40.object({
5074
+ agentId: z40.string().uuid(),
5075
+ name: z40.string(),
4745
5076
  tier: AgentTierSchema,
4746
- model: z39.string().nullable(),
5077
+ model: z40.string().nullable(),
4747
5078
  nextTier: AgentTierSchema
4748
5079
  }),
4749
- capabilities: z39.array(z39.object({
4750
- key: z39.string(),
4751
- enabled: z39.boolean(),
4752
- blocked: z39.string().nullable(),
4753
- ownerAction: z39.string().nullable(),
4754
- link: z39.string(),
5080
+ capabilities: z40.array(z40.object({
5081
+ key: z40.string(),
5082
+ enabled: z40.boolean(),
5083
+ blocked: z40.string().nullable(),
5084
+ ownerAction: z40.string().nullable(),
5085
+ link: z40.string(),
4755
5086
  component: AgentPlatformComponentSchema.nullable()
4756
5087
  })),
4757
5088
  budget: SwarmBudgetViewSchema,
4758
- readiness: z39.object({
4759
- actions: z39.array(z39.string()),
4760
- blockers: z39.array(z39.string()),
4761
- legalAccepted: z39.boolean()
5089
+ readiness: z40.object({
5090
+ actions: z40.array(z40.string()),
5091
+ blockers: z40.array(z40.string()),
5092
+ legalAccepted: z40.boolean()
4762
5093
  }).nullable(),
4763
- connectors: z39.array(z39.object({ provider: z39.string(), state: z39.string(), actions: z39.array(z39.string()) })),
4764
- channels: z39.object({ connected: z39.boolean(), coordinatorAgentId: z39.string().uuid().nullable() }),
4765
- toolGroups: z39.array(z39.string()),
4766
- swarm: z39.object({
4767
- canCreate: z39.boolean(),
4768
- canDispatch: z39.boolean(),
4769
- coordinator: z39.string().uuid().nullable(),
4770
- siblings: z39.array(z39.object({ agentId: z39.string().uuid() })),
4771
- limits: z39.object({
4772
- createsPerJob: z39.number(),
4773
- sendsPerJob: z39.number(),
4774
- depth: z39.number(),
4775
- agentsPerAccount: z39.number()
5094
+ connectors: z40.array(z40.object({ provider: z40.string(), state: z40.string(), actions: z40.array(z40.string()) })),
5095
+ channels: z40.object({ connected: z40.boolean(), coordinatorAgentId: z40.string().uuid().nullable() }),
5096
+ toolGroups: z40.array(z40.string()),
5097
+ swarm: z40.object({
5098
+ canCreate: z40.boolean(),
5099
+ canDispatch: z40.boolean(),
5100
+ coordinator: z40.string().uuid().nullable(),
5101
+ siblings: z40.array(z40.object({ agentId: z40.string().uuid() })),
5102
+ limits: z40.object({
5103
+ createsPerJob: z40.number(),
5104
+ sendsPerJob: z40.number(),
5105
+ depth: z40.number(),
5106
+ agentsPerAccount: z40.number()
4776
5107
  })
4777
5108
  }),
4778
- market: z39.object({
4779
- scopes: z39.array(z39.string()),
4780
- escrowLimit: z39.string(),
4781
- freeActions: z39.array(z39.string()),
4782
- freeActionsConditions: z39.string()
5109
+ market: z40.object({
5110
+ scopes: z40.array(z40.string()),
5111
+ escrowLimit: z40.string(),
5112
+ freeActions: z40.array(z40.string()),
5113
+ freeActionsConditions: z40.string()
4783
5114
  }),
4784
- spending: z39.object({
4785
- mode: z39.enum(["off", "exact", "yolo", "standing"]),
4786
- maxPurchase: z39.string().nullable(),
4787
- rollingDay: z39.string().nullable(),
4788
- period: z39.string().nullable()
5115
+ spending: z40.object({
5116
+ mode: z40.enum(["off", "exact", "yolo", "standing"]),
5117
+ maxPurchase: z40.string().nullable(),
5118
+ rollingDay: z40.string().nullable(),
5119
+ period: z40.string().nullable()
4789
5120
  }),
4790
- memoryScopes: z39.array(z39.string())
5121
+ memoryScopes: z40.array(z40.string())
4791
5122
  });
4792
- var AgentDelegationSchema = z39.object({
4793
- agentId: z39.string().uuid(),
4794
- name: z39.string(),
4795
- jobId: z39.string().uuid(),
4796
- status: z39.enum(["queued", "running", "completed", "failed", "interrupted"]),
4797
- waiting: z39.boolean()
5123
+ var AgentDelegationSchema = z40.object({
5124
+ agentId: z40.string().uuid(),
5125
+ name: z40.string(),
5126
+ jobId: z40.string().uuid(),
5127
+ status: z40.enum(["queued", "running", "completed", "failed", "interrupted"]),
5128
+ waiting: z40.boolean()
4798
5129
  });
4799
5130
 
4800
5131
  // ../../packages/shared/dist/schemas/launcher.schemas.js
4801
- var LauncherAgentIdSchema = z40.object({ agentId: z40.string().uuid() });
4802
- var LauncherAvatarSchema = z40.object({
4803
- version: z40.literal(1),
4804
- color: z40.enum(["rose", "mint", "blue", "amber", "mauve", "cocoa"]),
4805
- face: z40.number().int().min(0).max(5),
5132
+ var LauncherAgentIdSchema = z41.object({ agentId: z41.string().uuid() });
5133
+ var LauncherAvatarSchema = z41.object({
5134
+ version: z41.literal(1),
5135
+ color: z41.enum(["rose", "mint", "blue", "amber", "mauve", "cocoa"]),
5136
+ face: z41.number().int().min(0).max(5),
4806
5137
  /** Shape 0-6. Values 0-2 predate the wider range and keep their shapes. */
4807
- head: z40.number().int().min(0).max(6),
4808
- antenna: z40.number().int().min(0).max(3),
4809
- ears: z40.number().int().min(0).max(2),
4810
- markings: z40.number().int().min(0).max(255),
5138
+ head: z41.number().int().min(0).max(6),
5139
+ antenna: z41.number().int().min(0).max(3),
5140
+ ears: z41.number().int().min(0).max(2),
5141
+ markings: z41.number().int().min(0).max(255),
4811
5142
  /**
4812
5143
  * @deprecated Plush is the only companion style. Still accepted so avatars saved with a
4813
5144
  * style parse, but ignored by every renderer; new saves omit it.
4814
5145
  */
4815
- style: z40.enum(["vinyl", "gummy", "visor", "plush"]).optional()
5146
+ style: z41.enum(["vinyl", "gummy", "visor", "plush"]).optional()
4816
5147
  }).strict();
4817
5148
  var LauncherUpdateAvatarSchema = LauncherAgentIdSchema.extend({
4818
5149
  avatar: LauncherAvatarSchema
4819
5150
  });
4820
- var LauncherLaunchSchema = z40.object({
4821
- requestKey: z40.string().uuid(),
4822
- name: z40.string().trim().min(1).max(100),
4823
- prompt: z40.string().trim().min(1).max(32768),
5151
+ var LauncherLaunchSchema = z41.object({
5152
+ requestKey: z41.string().uuid(),
5153
+ name: z41.string().trim().min(1).max(100),
5154
+ prompt: z41.string().trim().min(1).max(32768),
4824
5155
  avatar: LauncherAvatarSchema.optional(),
4825
5156
  /** Capability tier for the new agent. Absent is light. */
4826
5157
  tier: AgentTierSchema.optional()
4827
5158
  }).strict();
4828
- var LauncherSessionResetSchema = z40.object({ version: z40.number().int().positive(), requestedAt: z40.string().datetime() }).strict();
5159
+ var LauncherSessionResetSchema = z41.object({ version: z41.number().int().positive(), requestedAt: z41.string().datetime() }).strict();
4829
5160
  var LauncherMessageSchema = LauncherAgentIdSchema.extend({
4830
- requestKey: z40.string().uuid(),
4831
- prompt: z40.string().trim().min(1).max(32768)
5161
+ requestKey: z41.string().uuid(),
5162
+ prompt: z41.string().trim().min(1).max(32768)
4832
5163
  }).strict();
4833
- var LauncherJobStatusSchema = z40.enum([
5164
+ var LauncherJobStatusSchema = z41.enum([
4834
5165
  "queued",
4835
5166
  "running",
4836
5167
  "completed",
4837
5168
  "failed",
4838
5169
  "interrupted"
4839
5170
  ]);
4840
- var LauncherJobSchema = z40.object({
4841
- id: z40.string().uuid(),
5171
+ var LauncherJobSchema = z41.object({
5172
+ id: z41.string().uuid(),
4842
5173
  status: LauncherJobStatusSchema,
4843
- runId: z40.string().uuid().nullable(),
4844
- output: z40.string().nullable(),
4845
- errorCode: z40.string().nullable(),
4846
- createdAt: z40.string(),
4847
- finishedAt: z40.string().nullable()
5174
+ runId: z41.string().uuid().nullable(),
5175
+ output: z41.string().nullable(),
5176
+ errorCode: z41.string().nullable(),
5177
+ createdAt: z41.string(),
5178
+ finishedAt: z41.string().nullable()
4848
5179
  });
4849
- var LauncherAcceptedSchema = z40.object({
4850
- agentId: z40.string().uuid(),
4851
- jobId: z40.string().uuid(),
5180
+ var LauncherAcceptedSchema = z41.object({
5181
+ agentId: z41.string().uuid(),
5182
+ jobId: z41.string().uuid(),
4852
5183
  status: LauncherJobStatusSchema
4853
5184
  });
4854
- var LauncherAgentSchema = z40.object({
4855
- id: z40.string().uuid(),
4856
- name: z40.string(),
5185
+ var LauncherAgentSchema = z41.object({
5186
+ id: z41.string().uuid(),
5187
+ name: z41.string(),
4857
5188
  avatar: LauncherAvatarSchema.nullish(),
4858
- paused: z40.boolean(),
5189
+ paused: z41.boolean(),
4859
5190
  /**
4860
5191
  * The agent's capability tier. A change applies from its next job; a running job keeps the tier
4861
5192
  * it was admitted under. Absent only from a backend that predates tiers, which ran every agent
4862
5193
  * as light.
4863
5194
  */
4864
5195
  tier: AgentTierSchema.default("light"),
4865
- controlVersion: z40.number().int(),
4866
- workspaceReady: z40.boolean(),
4867
- usage: z40.object({
4868
- available: z40.number(),
4869
- reserved: z40.number(),
4870
- spent: z40.number(),
4871
- unit: z40.literal("tokens")
5196
+ controlVersion: z41.number().int(),
5197
+ workspaceReady: z41.boolean(),
5198
+ usage: z41.object({
5199
+ available: z41.number(),
5200
+ reserved: z41.number(),
5201
+ spent: z41.number(),
5202
+ unit: z41.literal("tokens")
4872
5203
  })
4873
5204
  });
4874
- var LauncherStatusSchema = z40.object({
5205
+ var LauncherStatusSchema = z41.object({
4875
5206
  agent: LauncherAgentSchema,
4876
- jobs: z40.array(LauncherJobSchema)
5207
+ jobs: z41.array(LauncherJobSchema)
4877
5208
  });
4878
5209
  var LauncherEventsInputSchema = LauncherAgentIdSchema.extend({
4879
- after: z40.number().int().nonnegative().default(0),
4880
- limit: z40.number().int().min(1).max(100).default(50)
4881
- });
4882
- var LauncherEventsSchema = z40.object({
4883
- events: z40.array(z40.object({
4884
- id: z40.number().int(),
4885
- runId: z40.string().uuid(),
4886
- type: z40.string(),
4887
- createdAt: z40.string()
5210
+ after: z41.number().int().nonnegative().default(0),
5211
+ limit: z41.number().int().min(1).max(100).default(50)
5212
+ });
5213
+ var LauncherEventsSchema = z41.object({
5214
+ events: z41.array(z41.object({
5215
+ id: z41.number().int(),
5216
+ runId: z41.string().uuid(),
5217
+ type: z41.string(),
5218
+ createdAt: z41.string()
4888
5219
  })),
4889
- nextCursor: z40.number().int()
5220
+ nextCursor: z41.number().int()
4890
5221
  });
4891
5222
  var LauncherArtifactInputSchema = LauncherAgentIdSchema.extend({
4892
- artifactId: z40.string().uuid()
4893
- });
4894
- var LauncherArtifactsSchema = z40.object({
4895
- artifacts: z40.array(z40.object({
4896
- id: z40.string().uuid(),
4897
- runId: z40.string().uuid(),
4898
- path: z40.string(),
4899
- displayName: z40.string().optional(),
4900
- sha256: z40.string(),
4901
- bytes: z40.number(),
4902
- createdAt: z40.string()
5223
+ artifactId: z41.string().uuid()
5224
+ });
5225
+ var LauncherArtifactsSchema = z41.object({
5226
+ artifacts: z41.array(z41.object({
5227
+ id: z41.string().uuid(),
5228
+ runId: z41.string().uuid(),
5229
+ path: z41.string(),
5230
+ displayName: z41.string().optional(),
5231
+ sha256: z41.string(),
5232
+ bytes: z41.number(),
5233
+ createdAt: z41.string()
4903
5234
  }))
4904
5235
  });
4905
- var LauncherArtifactUrlSchema = z40.object({
4906
- url: z40.string().url(),
4907
- expiresIn: z40.number().int()
5236
+ var LauncherArtifactUrlSchema = z41.object({
5237
+ url: z41.string().url(),
5238
+ expiresIn: z41.number().int()
4908
5239
  });
4909
- var LauncherAccountSchema = z40.object({
4910
- enabled: z40.boolean(),
4911
- agentId: z40.string().uuid().nullable(),
4912
- initialTokens: z40.number().int().nonnegative(),
4913
- agentCount: z40.number().int().nonnegative(),
4914
- maxAgents: z40.number().int().positive(),
5240
+ var LauncherAccountSchema = z41.object({
5241
+ enabled: z41.boolean(),
5242
+ agentId: z41.string().uuid().nullable(),
5243
+ initialTokens: z41.number().int().nonnegative(),
5244
+ agentCount: z41.number().int().nonnegative(),
5245
+ maxAgents: z41.number().int().positive(),
4915
5246
  /**
4916
5247
  * @deprecated Kept for one release so a web bundle built before its removal, which reads
4917
5248
  * `account.usage.available` without a guard, does not crash during a deploy or in a stale tab.
@@ -4919,145 +5250,145 @@ var LauncherAccountSchema = z40.object({
4919
5250
  * allowance, and the shared token balance lives on each agent's `usage`. Remove next release.
4920
5251
  */
4921
5252
  usage: LauncherAgentSchema.shape.usage.optional(),
4922
- providerUsage: z40.object({
4923
- basis: z40.literal("recorded_provider_turns"),
4924
- provisional: z40.literal(true),
4925
- inputTokens: z40.string().regex(/^\d+$/),
4926
- outputTokens: z40.string().regex(/^\d+$/),
4927
- totalTokens: z40.string().regex(/^\d+$/),
4928
- cachedInputTokens: z40.string().regex(/^\d+$/),
4929
- reasoningTokens: z40.string().regex(/^\d+$/),
4930
- reportedTurns: z40.number().int().nonnegative(),
4931
- unknownTurns: z40.number().int().nonnegative(),
4932
- invalidObservations: z40.number().int().nonnegative(),
4933
- missingCachedDetails: z40.number().int().nonnegative(),
4934
- missingReasoningDetails: z40.number().int().nonnegative(),
4935
- truncated: z40.boolean()
5253
+ providerUsage: z41.object({
5254
+ basis: z41.literal("recorded_provider_turns"),
5255
+ provisional: z41.literal(true),
5256
+ inputTokens: z41.string().regex(/^\d+$/),
5257
+ outputTokens: z41.string().regex(/^\d+$/),
5258
+ totalTokens: z41.string().regex(/^\d+$/),
5259
+ cachedInputTokens: z41.string().regex(/^\d+$/),
5260
+ reasoningTokens: z41.string().regex(/^\d+$/),
5261
+ reportedTurns: z41.number().int().nonnegative(),
5262
+ unknownTurns: z41.number().int().nonnegative(),
5263
+ invalidObservations: z41.number().int().nonnegative(),
5264
+ missingCachedDetails: z41.number().int().nonnegative(),
5265
+ missingReasoningDetails: z41.number().int().nonnegative(),
5266
+ truncated: z41.boolean()
4936
5267
  }).optional()
4937
5268
  });
4938
5269
  var LauncherTurnSchema = LauncherJobSchema.extend({
4939
- uiCards: z40.array(AgentUiCardSchema).max(3).optional(),
4940
- delegations: z40.array(AgentDelegationSchema).optional(),
4941
- sequence: z40.number().int(),
4942
- requestKey: z40.string().uuid(),
4943
- prompt: z40.string(),
4944
- senderAgentId: z40.string().uuid().nullable().default(null),
4945
- automaticContinuation: z40.boolean().optional(),
4946
- channelRequest: z40.object({ id: z40.string().uuid(), reference: z40.string() }).nullable().optional()
5270
+ uiCards: z41.array(AgentUiCardSchema).max(3).optional(),
5271
+ delegations: z41.array(AgentDelegationSchema).optional(),
5272
+ sequence: z41.number().int(),
5273
+ requestKey: z41.string().uuid(),
5274
+ prompt: z41.string(),
5275
+ senderAgentId: z41.string().uuid().nullable().default(null),
5276
+ automaticContinuation: z41.boolean().optional(),
5277
+ channelRequest: z41.object({ id: z41.string().uuid(), reference: z41.string() }).nullable().optional()
4947
5278
  });
4948
5279
  var LauncherHistoryInputSchema = LauncherAgentIdSchema.extend({
4949
- before: z40.number().int().positive().optional(),
4950
- limit: z40.number().int().min(1).max(50).default(20)
5280
+ before: z41.number().int().positive().optional(),
5281
+ limit: z41.number().int().min(1).max(50).default(20)
5282
+ });
5283
+ var LauncherHistorySchema = z41.object({
5284
+ turns: z41.array(LauncherTurnSchema),
5285
+ nextBefore: z41.number().int().nullable()
5286
+ });
5287
+ var LauncherJobInputSchema = LauncherAgentIdSchema.extend({ jobId: z41.string().uuid() });
5288
+ var LauncherActivitySchema = z41.object({
5289
+ id: z41.number().int(),
5290
+ version: z41.literal(1),
5291
+ runId: z41.string().uuid(),
5292
+ type: z41.string(),
5293
+ label: z41.string(),
5294
+ outcome: z41.enum(["started", "completed", "failed", "info"]),
5295
+ createdAt: z41.string()
4951
5296
  });
4952
- var LauncherHistorySchema = z40.object({
4953
- turns: z40.array(LauncherTurnSchema),
4954
- nextBefore: z40.number().int().nullable()
5297
+ var LauncherActivityPageSchema = z41.object({
5298
+ events: z41.array(LauncherActivitySchema),
5299
+ nextBefore: z41.number().int().nullable()
4955
5300
  });
4956
- var LauncherJobInputSchema = LauncherAgentIdSchema.extend({ jobId: z40.string().uuid() });
4957
- var LauncherActivitySchema = z40.object({
4958
- id: z40.number().int(),
4959
- version: z40.literal(1),
4960
- runId: z40.string().uuid(),
4961
- type: z40.string(),
4962
- label: z40.string(),
4963
- outcome: z40.enum(["started", "completed", "failed", "info"]),
4964
- createdAt: z40.string()
4965
- });
4966
- var LauncherActivityPageSchema = z40.object({
4967
- events: z40.array(LauncherActivitySchema),
4968
- nextBefore: z40.number().int().nullable()
4969
- });
4970
- var LauncherViewSchema = z40.object({
4971
- agentUiEnabled: z40.boolean().optional(),
4972
- trial: z40.boolean().optional(),
5301
+ var LauncherViewSchema = z41.object({
5302
+ agentUiEnabled: z41.boolean().optional(),
5303
+ trial: z41.boolean().optional(),
4973
5304
  agent: LauncherAgentSchema,
4974
- accessEnabled: z40.boolean(),
4975
- state: z40.enum(["ready", "queued", "working", "paused", "recovering", "interrupted", "exhausted"]),
4976
- compute: z40.enum(["not_created", "starting", "running", "stopped", "unknown"]),
4977
- queuedCount: z40.number().int(),
5305
+ accessEnabled: z41.boolean(),
5306
+ state: z41.enum(["ready", "queued", "working", "paused", "recovering", "interrupted", "exhausted"]),
5307
+ compute: z41.enum(["not_created", "starting", "running", "stopped", "unknown"]),
5308
+ queuedCount: z41.number().int(),
4978
5309
  history: LauncherHistorySchema,
4979
5310
  activity: LauncherActivityPageSchema
4980
5311
  });
4981
- var LauncherPreviewSchema = z40.discriminatedUnion("kind", [
4982
- z40.object({
4983
- kind: z40.literal("text"),
4984
- content: z40.string().max(65536),
4985
- fileName: z40.string().optional()
5312
+ var LauncherPreviewSchema = z41.discriminatedUnion("kind", [
5313
+ z41.object({
5314
+ kind: z41.literal("text"),
5315
+ content: z41.string().max(65536),
5316
+ fileName: z41.string().optional()
4986
5317
  }),
4987
- z40.object({
4988
- kind: z40.literal("html"),
4989
- content: z40.string().max(5 * 1024 * 1024),
4990
- fileName: z40.string()
5318
+ z41.object({
5319
+ kind: z41.literal("html"),
5320
+ content: z41.string().max(5 * 1024 * 1024),
5321
+ fileName: z41.string()
4991
5322
  }),
4992
- z40.object({
4993
- kind: z40.literal("image"),
4994
- content: z40.string().max(7e5),
4995
- mimeType: z40.enum(["image/png", "image/jpeg", "image/gif", "image/webp"]),
4996
- fileName: z40.string().optional()
5323
+ z41.object({
5324
+ kind: z41.literal("image"),
5325
+ content: z41.string().max(7e5),
5326
+ mimeType: z41.enum(["image/png", "image/jpeg", "image/gif", "image/webp"]),
5327
+ fileName: z41.string().optional()
4997
5328
  }),
4998
- z40.object({ kind: z40.literal("download"), reason: z40.string() })
5329
+ z41.object({ kind: z41.literal("download"), reason: z41.string() })
4999
5330
  ]);
5000
5331
  var MAX_LAUNCHER_DOWNLOAD_BYTES = 16 * 1024 * 1024;
5001
5332
  var LauncherSessionSendSchema = LauncherAgentIdSchema.extend({
5002
- recipientAgentId: z40.string().uuid(),
5003
- requestKey: z40.string().uuid(),
5004
- message: z40.string().trim().min(1).max(16e3)
5333
+ recipientAgentId: z41.string().uuid(),
5334
+ requestKey: z41.string().uuid(),
5335
+ message: z41.string().trim().min(1).max(16e3)
5005
5336
  }).strict();
5006
5337
  var LauncherSessionHistoryInputSchema = LauncherAgentIdSchema.extend({
5007
- peerAgentId: z40.string().uuid().optional(),
5008
- before: z40.number().int().positive().optional(),
5009
- limit: z40.number().int().min(1).max(50).default(20)
5338
+ peerAgentId: z41.string().uuid().optional(),
5339
+ before: z41.number().int().positive().optional(),
5340
+ limit: z41.number().int().min(1).max(50).default(20)
5010
5341
  });
5011
5342
  var LauncherSessionMessageSchema = LauncherTurnSchema.extend({
5012
- agentId: z40.string().uuid(),
5013
- senderAgentId: z40.string().uuid()
5014
- });
5015
- var LauncherSessionHistorySchema = z40.object({
5016
- messages: z40.array(LauncherSessionMessageSchema),
5017
- nextBefore: z40.number().int().nullable()
5018
- });
5019
- var LauncherMarketOperationSchema = z40.object({
5020
- id: z40.string().uuid(),
5021
- action: z40.string(),
5022
- state: z40.enum(["pending", "completed", "failed"]),
5023
- taskId: z40.string().nullable(),
5024
- taskTitle: z40.string().nullable(),
5343
+ agentId: z41.string().uuid(),
5344
+ senderAgentId: z41.string().uuid()
5345
+ });
5346
+ var LauncherSessionHistorySchema = z41.object({
5347
+ messages: z41.array(LauncherSessionMessageSchema),
5348
+ nextBefore: z41.number().int().nullable()
5349
+ });
5350
+ var LauncherMarketOperationSchema = z41.object({
5351
+ id: z41.string().uuid(),
5352
+ action: z41.string(),
5353
+ state: z41.enum(["pending", "completed", "failed"]),
5354
+ taskId: z41.string().nullable(),
5355
+ taskTitle: z41.string().nullable(),
5025
5356
  /** USDC base units: the payment when one was quoted, else the reward or price the action named. */
5026
- amount: z40.string().regex(/^\d+$/).nullable(),
5357
+ amount: z41.string().regex(/^\d+$/).nullable(),
5027
5358
  /** True once the payment for this action settled on chain. */
5028
- paid: z40.boolean(),
5029
- transactionHash: z40.string().nullable(),
5030
- submissionId: z40.string().nullable(),
5359
+ paid: z41.boolean(),
5360
+ transactionHash: z41.string().nullable(),
5361
+ submissionId: z41.string().nullable(),
5031
5362
  /** A bounded upper-case error code when the action failed. */
5032
- errorCode: z40.string().nullable(),
5033
- createdAt: z40.string(),
5034
- updatedAt: z40.string()
5035
- });
5036
- var LauncherMarketSummarySchema = z40.object({
5037
- activeTasks: z40.number().int().nonnegative(),
5038
- submissions: z40.number().int().nonnegative(),
5039
- tasksPublished: z40.number().int().nonnegative(),
5040
- wins: z40.number().int().nonnegative(),
5041
- pending: z40.number().int().nonnegative(),
5042
- failed: z40.number().int().nonnegative(),
5363
+ errorCode: z41.string().nullable(),
5364
+ createdAt: z41.string(),
5365
+ updatedAt: z41.string()
5366
+ });
5367
+ var LauncherMarketSummarySchema = z41.object({
5368
+ activeTasks: z41.number().int().nonnegative(),
5369
+ submissions: z41.number().int().nonnegative(),
5370
+ tasksPublished: z41.number().int().nonnegative(),
5371
+ wins: z41.number().int().nonnegative(),
5372
+ pending: z41.number().int().nonnegative(),
5373
+ failed: z41.number().int().nonnegative(),
5043
5374
  /** Settled market payments in USDC base units (fees, and escrow for published tasks). */
5044
- spent: z40.string().regex(/^\d+$/),
5375
+ spent: z41.string().regex(/^\d+$/),
5045
5376
  /** Worker payouts for tasks this agent worked, in USDC base units. */
5046
- earnings: z40.string().regex(/^\d+$/)
5377
+ earnings: z41.string().regex(/^\d+$/)
5047
5378
  });
5048
5379
  var LauncherAgentMarketInputSchema = LauncherAgentIdSchema.extend({
5049
- limit: z40.number().int().min(1).max(100).default(50)
5380
+ limit: z41.number().int().min(1).max(100).default(50)
5050
5381
  });
5051
- var LauncherAgentMarketSchema = z40.object({
5052
- operations: z40.array(LauncherMarketOperationSchema),
5382
+ var LauncherAgentMarketSchema = z41.object({
5383
+ operations: z41.array(LauncherMarketOperationSchema),
5053
5384
  summary: LauncherMarketSummarySchema
5054
5385
  });
5055
- var LauncherAgentMarketTasksInputSchema = z40.object({
5056
- agentId: z40.string().uuid(),
5057
- view: z40.enum(["both", "posted", "attempted"]).default("both"),
5058
- limit: z40.number().int().min(1).max(50).default(5),
5386
+ var LauncherAgentMarketTasksInputSchema = z41.object({
5387
+ agentId: z41.string().uuid(),
5388
+ view: z41.enum(["both", "posted", "attempted"]).default("both"),
5389
+ limit: z41.number().int().min(1).max(50).default(5),
5059
5390
  /** Opaque, per list. Only accepted with view 'posted' or 'attempted'. */
5060
- cursor: z40.string().max(200).optional()
5391
+ cursor: z41.string().max(200).optional()
5061
5392
  }).strict();
5062
5393
  var LAUNCHER_POSTED_TASK_STATUSES = [
5063
5394
  // A create approval is pending or approving; the row carries `approvalId` for Review.
@@ -5082,9 +5413,9 @@ var LAUNCHER_POSTED_TASK_STATUSES = [
5082
5413
  "expired",
5083
5414
  "cancelled"
5084
5415
  ];
5085
- var LauncherPostedTaskStatusSchema = z40.enum(LAUNCHER_POSTED_TASK_STATUSES);
5416
+ var LauncherPostedTaskStatusSchema = z41.enum(LAUNCHER_POSTED_TASK_STATUSES);
5086
5417
  var LAUNCHER_ATTEMPT_KINDS = ["claim", "pitch", "bid", "proof", "submit"];
5087
- var LauncherAttemptKindSchema = z40.enum(LAUNCHER_ATTEMPT_KINDS);
5418
+ var LauncherAttemptKindSchema = z41.enum(LAUNCHER_ATTEMPT_KINDS);
5088
5419
  var LAUNCHER_ATTEMPT_OUTCOMES = [
5089
5420
  // A paid worker write (pitch, bid, paid submission) awaits the owner; `approvalId` set.
5090
5421
  "awaiting_approval",
@@ -5111,43 +5442,43 @@ var LAUNCHER_ATTEMPT_OUTCOMES = [
5111
5442
  // A sibling made a later worker write on the task, or holds its worker role now.
5112
5443
  "continued_by_sibling"
5113
5444
  ];
5114
- var LauncherAttemptOutcomeSchema = z40.enum(LAUNCHER_ATTEMPT_OUTCOMES);
5115
- var UsdcUnitsSchema = z40.string().regex(/^\d+$/);
5116
- var LauncherPostedTaskSchema = z40.object({
5445
+ var LauncherAttemptOutcomeSchema = z41.enum(LAUNCHER_ATTEMPT_OUTCOMES);
5446
+ var UsdcUnitsSchema = z41.string().regex(/^\d+$/);
5447
+ var LauncherPostedTaskSchema = z41.object({
5117
5448
  /** Stable per row: `task:<taskId>`, `approval:<id>`, `operation:<id>` or `refusal:<id>`. */
5118
- key: z40.string(),
5449
+ key: z41.string(),
5119
5450
  /** Null for drafts, refusals and publishes not resolved to a task yet. */
5120
- taskId: z40.string().nullable(),
5121
- title: z40.string().nullable(),
5451
+ taskId: z41.string().nullable(),
5452
+ title: z41.string().nullable(),
5122
5453
  /** The task mode as stored on tasks.mode, or as drafted. */
5123
- mode: z40.string().nullable(),
5454
+ mode: z41.string().nullable(),
5124
5455
  /** USDC base units. */
5125
5456
  rewardUnits: UsdcUnitsSchema.nullable(),
5126
5457
  status: LauncherPostedTaskStatusSchema,
5127
5458
  /** Set while status is awaiting_approval. */
5128
- approvalId: z40.string().uuid().nullable(),
5129
- approvalExpiresAt: z40.string().nullable(),
5459
+ approvalId: z41.string().uuid().nullable(),
5460
+ approvalExpiresAt: z41.string().nullable(),
5130
5461
  /** Submissions; pitches for pitch mode; bids for auction mode. Null with no task. */
5131
- submissions: z40.number().int().nonnegative().nullable(),
5462
+ submissions: z41.number().int().nonnegative().nullable(),
5132
5463
  /** The deadline that matters for the current status. */
5133
- deadlineAt: z40.string().nullable(),
5464
+ deadlineAt: z41.string().nullable(),
5134
5465
  /** The rank-1 award recipient once completed; `memberName` when it is a hosted swarm member. */
5135
- winner: z40.object({ hosted: z40.boolean(), memberName: z40.string().nullable() }).nullable(),
5466
+ winner: z41.object({ hosted: z41.boolean(), memberName: z41.string().nullable() }).nullable(),
5136
5467
  /** What publishing cost the swarm once the payment settled, in USDC base units. */
5137
5468
  paidUnits: UsdcUnitsSchema.nullable(),
5138
5469
  /** A machine code (HOSTED_MARKET_* or a marketplace error code) for the unpublished states. */
5139
- reasonCode: z40.string().nullable(),
5470
+ reasonCode: z41.string().nullable(),
5140
5471
  /** The publishing transaction (the task's escrow transaction) when known. */
5141
- transactionHash: z40.string().nullable(),
5142
- createdAt: z40.string(),
5143
- updatedAt: z40.string()
5472
+ transactionHash: z41.string().nullable(),
5473
+ createdAt: z41.string(),
5474
+ updatedAt: z41.string()
5144
5475
  });
5145
- var LauncherAttemptedTaskSchema = z40.object({
5476
+ var LauncherAttemptedTaskSchema = z41.object({
5146
5477
  /** Stable per row: `task:<taskId>`, `approval:<id>` or `refusal:<id>`. */
5147
- key: z40.string(),
5148
- taskId: z40.string().nullable(),
5149
- title: z40.string().nullable(),
5150
- mode: z40.string().nullable(),
5478
+ key: z41.string(),
5479
+ taskId: z41.string().nullable(),
5480
+ title: z41.string().nullable(),
5481
+ mode: z41.string().nullable(),
5151
5482
  rewardUnits: UsdcUnitsSchema.nullable(),
5152
5483
  /** The kind of the agent's latest attempt on the task. */
5153
5484
  attempt: LauncherAttemptKindSchema,
@@ -5155,70 +5486,70 @@ var LauncherAttemptedTaskSchema = z40.object({
5155
5486
  /** The bid amount, or what was earned when won, in USDC base units. */
5156
5487
  amountUnits: UsdcUnitsSchema.nullable(),
5157
5488
  /** The sibling that continued the task or holds its worker role now. */
5158
- continuedBy: z40.object({ agentId: z40.string(), name: z40.string() }).nullable(),
5159
- approvalId: z40.string().uuid().nullable(),
5489
+ continuedBy: z41.object({ agentId: z41.string(), name: z41.string() }).nullable(),
5490
+ approvalId: z41.string().uuid().nullable(),
5160
5491
  /** A machine code for not_approved, blocked and did_not_go_through. */
5161
- reasonCode: z40.string().nullable(),
5162
- transactionHash: z40.string().nullable(),
5163
- createdAt: z40.string(),
5164
- updatedAt: z40.string()
5492
+ reasonCode: z41.string().nullable(),
5493
+ transactionHash: z41.string().nullable(),
5494
+ createdAt: z41.string(),
5495
+ updatedAt: z41.string()
5165
5496
  });
5166
- var LauncherAgentMarketTasksSchema = z40.object({
5167
- counts: z40.object({
5497
+ var LauncherAgentMarketTasksSchema = z41.object({
5498
+ counts: z41.object({
5168
5499
  /** Every Posted row, drafts and refused creates included. */
5169
- posted: z40.number().int().nonnegative(),
5500
+ posted: z41.number().int().nonnegative(),
5170
5501
  /** awaiting_approval, publishing, open, in_progress, in_review, appealing and disputed. */
5171
- postedOpen: z40.number().int().nonnegative(),
5502
+ postedOpen: z41.number().int().nonnegative(),
5172
5503
  /** Every Attempted row. */
5173
- attempted: z40.number().int().nonnegative(),
5504
+ attempted: z41.number().int().nonnegative(),
5174
5505
  /** awaiting_approval, working and awaiting_result. */
5175
- attemptedActive: z40.number().int().nonnegative(),
5176
- won: z40.number().int().nonnegative(),
5506
+ attemptedActive: z41.number().int().nonnegative(),
5507
+ won: z41.number().int().nonnegative(),
5177
5508
  /** The sum of amountUnits over won rows. */
5178
5509
  earnedUnits: UsdcUnitsSchema
5179
5510
  }),
5180
5511
  /** Empty when view is 'attempted'. */
5181
- posted: z40.object({
5182
- items: z40.array(LauncherPostedTaskSchema),
5183
- nextCursor: z40.string().nullable()
5512
+ posted: z41.object({
5513
+ items: z41.array(LauncherPostedTaskSchema),
5514
+ nextCursor: z41.string().nullable()
5184
5515
  }),
5185
5516
  /** Empty when view is 'posted'. */
5186
- attempted: z40.object({
5187
- items: z40.array(LauncherAttemptedTaskSchema),
5188
- nextCursor: z40.string().nullable()
5517
+ attempted: z41.object({
5518
+ items: z41.array(LauncherAttemptedTaskSchema),
5519
+ nextCursor: z41.string().nullable()
5189
5520
  })
5190
5521
  });
5191
- var LauncherMarketOverviewSchema = z40.object({
5192
- agents: z40.array(z40.object({ agentId: z40.string(), activeTasks: z40.number().int().nonnegative() }))
5522
+ var LauncherMarketOverviewSchema = z41.object({
5523
+ agents: z41.array(z41.object({ agentId: z41.string(), activeTasks: z41.number().int().nonnegative() }))
5193
5524
  });
5194
5525
 
5195
5526
  // ../../packages/shared/dist/schemas/launcher-schedule.schemas.js
5196
- import { z as z41 } from "zod";
5527
+ import { z as z42 } from "zod";
5197
5528
  var SCHEDULE_SCAN_SECONDS = 300;
5198
- var LauncherScheduleControlSchema = z41.object({
5199
- agentId: z41.string().uuid(),
5200
- requestKey: z41.string().uuid(),
5201
- enabled: z41.boolean()
5529
+ var LauncherScheduleControlSchema = z42.object({
5530
+ agentId: z42.string().uuid(),
5531
+ requestKey: z42.string().uuid(),
5532
+ enabled: z42.boolean()
5202
5533
  }).strict();
5203
- var LauncherNextStepSchema = z41.discriminatedUnion("state", [
5204
- z41.object({
5205
- state: z41.literal("scheduled"),
5206
- delaySeconds: z41.number().int().min(SCHEDULE_SCAN_SECONDS).max(30 * 86400),
5207
- prompt: z41.string().trim().min(1).max(32768)
5534
+ var LauncherNextStepSchema = z42.discriminatedUnion("state", [
5535
+ z42.object({
5536
+ state: z42.literal("scheduled"),
5537
+ delaySeconds: z42.number().int().min(SCHEDULE_SCAN_SECONDS).max(30 * 86400),
5538
+ prompt: z42.string().trim().min(1).max(32768)
5208
5539
  }).strict(),
5209
- z41.object({
5210
- state: z41.literal("waiting"),
5211
- reason: z41.enum(["external", "owner", "funds"]),
5212
- prompt: z41.string().trim().min(1).max(32768)
5540
+ z42.object({
5541
+ state: z42.literal("waiting"),
5542
+ reason: z42.enum(["external", "owner", "funds"]),
5543
+ prompt: z42.string().trim().min(1).max(32768)
5213
5544
  }).strict(),
5214
- z41.object({ state: z41.literal("idle") }).strict()
5545
+ z42.object({ state: z42.literal("idle") }).strict()
5215
5546
  ]);
5216
- var LauncherScheduleNextSchema = z41.object({
5217
- agentId: z41.string().uuid(),
5218
- requestKey: z41.string().uuid(),
5547
+ var LauncherScheduleNextSchema = z42.object({
5548
+ agentId: z42.string().uuid(),
5549
+ requestKey: z42.string().uuid(),
5219
5550
  step: LauncherNextStepSchema
5220
5551
  }).strict();
5221
- var LauncherScheduleStatusSchema = z41.enum([
5552
+ var LauncherScheduleStatusSchema = z42.enum([
5222
5553
  "disabled",
5223
5554
  "idle",
5224
5555
  "scheduled",
@@ -5233,65 +5564,65 @@ var LauncherScheduleStatusSchema = z41.enum([
5233
5564
  "waiting_funds",
5234
5565
  "source_failed"
5235
5566
  ]);
5236
- var LauncherScheduleViewSchema = z41.object({
5237
- agentId: z41.string().uuid(),
5238
- enabled: z41.boolean(),
5239
- revision: z41.number().int(),
5240
- generation: z41.number().int(),
5241
- nextRunAt: z41.string().nullable(),
5242
- prompt: z41.string().nullable(),
5243
- waitingFor: z41.enum(["external", "owner", "funds"]).nullable(),
5567
+ var LauncherScheduleViewSchema = z42.object({
5568
+ agentId: z42.string().uuid(),
5569
+ enabled: z42.boolean(),
5570
+ revision: z42.number().int(),
5571
+ generation: z42.number().int(),
5572
+ nextRunAt: z42.string().nullable(),
5573
+ prompt: z42.string().nullable(),
5574
+ waitingFor: z42.enum(["external", "owner", "funds"]).nullable(),
5244
5575
  status: LauncherScheduleStatusSchema,
5245
- label: z41.string(),
5246
- lastJobId: z41.string().nullable(),
5247
- asOf: z41.string(),
5248
- scanEverySeconds: z41.literal(SCHEDULE_SCAN_SECONDS)
5576
+ label: z42.string(),
5577
+ lastJobId: z42.string().nullable(),
5578
+ asOf: z42.string(),
5579
+ scanEverySeconds: z42.literal(SCHEDULE_SCAN_SECONDS)
5249
5580
  });
5250
5581
 
5251
5582
  // ../../packages/shared/dist/schemas/swarm-coordination.schemas.js
5252
- import { z as z42 } from "zod";
5253
- var SwarmCoordinationPermissionsSchema = z42.object({
5254
- create: z42.boolean().default(false),
5255
- dispatch: z42.boolean().default(false),
5256
- resume: z42.boolean().default(false)
5583
+ import { z as z43 } from "zod";
5584
+ var SwarmCoordinationPermissionsSchema = z43.object({
5585
+ create: z43.boolean().default(false),
5586
+ dispatch: z43.boolean().default(false),
5587
+ resume: z43.boolean().default(false)
5257
5588
  }).strict();
5258
- var SwarmProfileInputSchema = z42.object({
5259
- agentId: z42.string().uuid(),
5260
- requestKey: z42.string().uuid(),
5261
- name: z42.string().trim().min(1).max(100),
5262
- responsibility: z42.string().trim().max(500),
5589
+ var SwarmProfileInputSchema = z43.object({
5590
+ agentId: z43.string().uuid(),
5591
+ requestKey: z43.string().uuid(),
5592
+ name: z43.string().trim().min(1).max(100),
5593
+ responsibility: z43.string().trim().max(500),
5263
5594
  /**
5264
5595
  * The agent's instructions.md memory document (SM-24). Omit to leave it unchanged, e.g. when
5265
5596
  * it was written in the Memory tab beyond this editor's limit.
5266
5597
  */
5267
- instructions: z42.string().trim().max(16e3).optional(),
5598
+ instructions: z43.string().trim().max(16e3).optional(),
5268
5599
  /**
5269
5600
  * The instructions.md version the editor loaded (`SwarmProfile.instructionsVersion`); a save
5270
5601
  * whose text differs is refused with MEMORY_VERSION_CONFLICT if the document moved on since.
5271
5602
  */
5272
- instructionsVersion: z42.number().int().min(0).optional(),
5603
+ instructionsVersion: z43.number().int().min(0).optional(),
5273
5604
  permissions: SwarmCoordinationPermissionsSchema
5274
5605
  }).strict();
5275
- var SwarmProfileSchema = z42.object({
5276
- available: z42.boolean().default(false),
5277
- agentId: z42.string().uuid(),
5278
- name: z42.string(),
5279
- responsibility: z42.string(),
5280
- instructions: z42.string(),
5606
+ var SwarmProfileSchema = z43.object({
5607
+ available: z43.boolean().default(false),
5608
+ agentId: z43.string().uuid(),
5609
+ name: z43.string(),
5610
+ responsibility: z43.string(),
5611
+ instructions: z43.string(),
5281
5612
  /** Version of the live instructions.md memory document; 0 when there is none. */
5282
- instructionsVersion: z42.number().int().default(0),
5283
- version: z42.number().int(),
5284
- generation: z42.number().int(),
5285
- creatorAgentId: z42.string().uuid().nullable(),
5286
- creatorJobId: z42.string().uuid().nullable(),
5613
+ instructionsVersion: z43.number().int().default(0),
5614
+ version: z43.number().int(),
5615
+ generation: z43.number().int(),
5616
+ creatorAgentId: z43.string().uuid().nullable(),
5617
+ creatorJobId: z43.string().uuid().nullable(),
5287
5618
  permissions: SwarmCoordinationPermissionsSchema
5288
5619
  });
5289
- var SwarmMemberSchema = z42.object({
5290
- agentId: z42.string().uuid(),
5291
- name: z42.string(),
5292
- responsibility: z42.string(),
5293
- creatorAgentId: z42.string().uuid().nullable(),
5294
- state: z42.enum([
5620
+ var SwarmMemberSchema = z43.object({
5621
+ agentId: z43.string().uuid(),
5622
+ name: z43.string(),
5623
+ responsibility: z43.string(),
5624
+ creatorAgentId: z43.string().uuid().nullable(),
5625
+ state: z43.enum([
5295
5626
  "idle",
5296
5627
  "queued",
5297
5628
  "working",
@@ -5302,95 +5633,95 @@ var SwarmMemberSchema = z42.object({
5302
5633
  "waiting",
5303
5634
  "failed"
5304
5635
  ]),
5305
- queuedCount: z42.number().int(),
5306
- jobId: z42.string().uuid().nullable(),
5307
- runId: z42.string().uuid().nullable(),
5308
- headline: z42.string().nullable(),
5309
- progress: z42.string().nullable(),
5310
- updatedAt: z42.string().nullable(),
5311
- freshness: z42.enum(["current", "stale", "unpublished"]),
5312
- waitingFor: z42.array(z42.string().uuid()),
5313
- nextRunAt: z42.string().nullable(),
5314
- lastResult: z42.object({
5315
- jobId: z42.string().uuid(),
5316
- summary: z42.string(),
5317
- artifacts: z42.array(z42.object({ artifactId: z42.string().uuid(), sha256: z42.string(), path: z42.string() })).optional(),
5318
- finishedAt: z42.string().nullable()
5636
+ queuedCount: z43.number().int(),
5637
+ jobId: z43.string().uuid().nullable(),
5638
+ runId: z43.string().uuid().nullable(),
5639
+ headline: z43.string().nullable(),
5640
+ progress: z43.string().nullable(),
5641
+ updatedAt: z43.string().nullable(),
5642
+ freshness: z43.enum(["current", "stale", "unpublished"]),
5643
+ waitingFor: z43.array(z43.string().uuid()),
5644
+ nextRunAt: z43.string().nullable(),
5645
+ lastResult: z43.object({
5646
+ jobId: z43.string().uuid(),
5647
+ summary: z43.string(),
5648
+ artifacts: z43.array(z43.object({ artifactId: z43.string().uuid(), sha256: z43.string(), path: z43.string() })).optional(),
5649
+ finishedAt: z43.string().nullable()
5319
5650
  }).nullable(),
5320
5651
  /**
5321
5652
  * The agent's most recently finished job, whatever its outcome. `lastResult` covers only a
5322
5653
  * completed job that published a summary; this is what an owner's "finished, come look" signal
5323
5654
  * reads. Optional so an overview from an older backend still parses.
5324
5655
  */
5325
- lastFinished: z42.object({
5326
- jobId: z42.string().uuid(),
5656
+ lastFinished: z43.object({
5657
+ jobId: z43.string().uuid(),
5327
5658
  status: LauncherJobStatusSchema.extract(["completed", "failed", "interrupted"]),
5328
- finishedAt: z42.string().nullable()
5659
+ finishedAt: z43.string().nullable()
5329
5660
  }).nullable().optional(),
5330
- asOf: z42.string()
5661
+ asOf: z43.string()
5331
5662
  });
5332
- var SwarmOverviewSchema = z42.object({
5333
- members: z42.array(SwarmMemberSchema).max(10),
5334
- asOf: z42.string()
5663
+ var SwarmOverviewSchema = z43.object({
5664
+ members: z43.array(SwarmMemberSchema).max(10),
5665
+ asOf: z43.string()
5335
5666
  });
5336
- var artifactIds = z42.array(z42.string().uuid()).max(8).default([]);
5667
+ var artifactIds = z43.array(z43.string().uuid()).max(8).default([]);
5337
5668
  var SwarmToolInputSchemas = {
5338
- sessions_list: z42.object({}).strict(),
5339
- sessions_inspect: z42.object({ agentId: z42.string().uuid() }).strict(),
5340
- sessions_create: z42.object({
5341
- intentKey: z42.string().trim().min(1).max(100),
5342
- name: z42.string().trim().min(1).max(100),
5343
- responsibility: z42.string().trim().min(1).max(500),
5344
- instructions: z42.string().trim().min(1).max(16e3),
5345
- prompt: z42.string().trim().min(1).max(16e3)
5669
+ sessions_list: z43.object({}).strict(),
5670
+ sessions_inspect: z43.object({ agentId: z43.string().uuid() }).strict(),
5671
+ sessions_create: z43.object({
5672
+ intentKey: z43.string().trim().min(1).max(100),
5673
+ name: z43.string().trim().min(1).max(100),
5674
+ responsibility: z43.string().trim().min(1).max(500),
5675
+ instructions: z43.string().trim().min(1).max(16e3),
5676
+ prompt: z43.string().trim().min(1).max(16e3)
5346
5677
  }).strict(),
5347
- sessions_send: z42.object({
5348
- agentId: z42.string().uuid(),
5349
- requestKey: z42.string().uuid(),
5350
- message: z42.string().trim().min(1).max(16e3),
5678
+ sessions_send: z43.object({
5679
+ agentId: z43.string().uuid(),
5680
+ requestKey: z43.string().uuid(),
5681
+ message: z43.string().trim().min(1).max(16e3),
5351
5682
  artifactIds
5352
5683
  }).strict(),
5353
- sessions_history: z42.object({
5354
- agentId: z42.string().uuid().optional(),
5355
- before: z42.number().int().positive().optional()
5684
+ sessions_history: z43.object({
5685
+ agentId: z43.string().uuid().optional(),
5686
+ before: z43.number().int().positive().optional()
5356
5687
  }).strict(),
5357
- sessions_result: z42.object({ jobId: z42.string().uuid() }).strict(),
5358
- sessions_wait: z42.object({
5359
- jobIds: z42.array(z42.string().uuid()).min(1).max(8),
5360
- mode: z42.enum(["any", "all"]),
5361
- prompt: z42.string().trim().min(1).max(16e3),
5362
- timeoutSeconds: z42.number().int().min(60).max(604800)
5688
+ sessions_result: z43.object({ jobId: z43.string().uuid() }).strict(),
5689
+ sessions_wait: z43.object({
5690
+ jobIds: z43.array(z43.string().uuid()).min(1).max(8),
5691
+ mode: z43.enum(["any", "all"]),
5692
+ prompt: z43.string().trim().min(1).max(16e3),
5693
+ timeoutSeconds: z43.number().int().min(60).max(604800)
5363
5694
  }).strict(),
5364
- sessions_update_status: z42.object({
5365
- headline: z42.string().trim().min(1).max(200),
5366
- progress: z42.string().trim().max(1e3),
5367
- resultSummary: z42.string().trim().max(1e3).optional(),
5695
+ sessions_update_status: z43.object({
5696
+ headline: z43.string().trim().min(1).max(200),
5697
+ progress: z43.string().trim().max(1e3),
5698
+ resultSummary: z43.string().trim().max(1e3).optional(),
5368
5699
  artifactIds
5369
5700
  }).strict(),
5370
- sessions_read_artifact: z42.object({ artifactId: z42.string().uuid() }).strict()
5701
+ sessions_read_artifact: z43.object({ artifactId: z43.string().uuid() }).strict()
5371
5702
  };
5372
- var SwarmWaitSchema = z42.object({
5373
- id: z42.string().uuid(),
5374
- sourceJobId: z42.string().uuid(),
5375
- jobIds: z42.array(z42.string().uuid()),
5376
- state: z42.enum(["pending", "delivered", "cancelled"]),
5377
- reason: z42.string().nullable(),
5378
- deadline: z42.string(),
5379
- continuationJobId: z42.string().uuid().nullable()
5703
+ var SwarmWaitSchema = z43.object({
5704
+ id: z43.string().uuid(),
5705
+ sourceJobId: z43.string().uuid(),
5706
+ jobIds: z43.array(z43.string().uuid()),
5707
+ state: z43.enum(["pending", "delivered", "cancelled"]),
5708
+ reason: z43.string().nullable(),
5709
+ deadline: z43.string(),
5710
+ continuationJobId: z43.string().uuid().nullable()
5380
5711
  });
5381
5712
 
5382
5713
  // ../../packages/shared/dist/schemas/direct-agent-checkpoint.schemas.js
5383
- import { z as z46 } from "zod";
5714
+ import { z as z47 } from "zod";
5384
5715
 
5385
5716
  // ../../packages/shared/dist/schemas/turn-attribution.schemas.js
5386
- import { z as z43 } from "zod";
5717
+ import { z as z44 } from "zod";
5387
5718
  var TURN_ATTRIBUTION_RECORD_VERSION = 1;
5388
- var TurnAttributionIdentitySchema = z43.object({
5389
- sessionId: z43.string().min(1).max(256),
5390
- turnId: z43.string().min(1).max(256),
5719
+ var TurnAttributionIdentitySchema = z44.object({
5720
+ sessionId: z44.string().min(1).max(256),
5721
+ turnId: z44.string().min(1).max(256),
5391
5722
  /** Non-null exactly for native helpers; a root or maintenance turn has no subagent. */
5392
- subagentId: z43.string().min(1).max(256).nullable(),
5393
- role: z43.enum(ROUTING_EXECUTION_ROLES)
5723
+ subagentId: z44.string().min(1).max(256).nullable(),
5724
+ role: z44.enum(ROUTING_EXECUTION_ROLES)
5394
5725
  }).strict().superRefine((identity, ctx) => {
5395
5726
  if (identity.role === "native_helper" && identity.subagentId === null)
5396
5727
  ctx.addIssue({ code: "custom", message: "A native helper identity needs its subagent id" });
@@ -5398,18 +5729,18 @@ var TurnAttributionIdentitySchema = z43.object({
5398
5729
  ctx.addIssue({ code: "custom", message: "Only a native helper identity carries a subagent" });
5399
5730
  });
5400
5731
  var PinnedTurnAttributionSchema = RoutingAttributionSchema.extend({
5401
- operationId: z43.string().uuid().nullable(),
5402
- inheritedFrom: z43.string().min(1).max(1024).nullable()
5732
+ operationId: z44.string().uuid().nullable(),
5733
+ inheritedFrom: z44.string().min(1).max(1024).nullable()
5403
5734
  }).strict();
5404
5735
  var MAX_ATTRIBUTION_EPOCHS = 32;
5405
5736
  var TurnAttributionEpochSchema = PinnedTurnAttributionSchema.extend({
5406
- epoch: z43.number().int().positive().max(MAX_ATTRIBUTION_EPOCHS)
5737
+ epoch: z44.number().int().positive().max(MAX_ATTRIBUTION_EPOCHS)
5407
5738
  }).strict();
5408
- var TurnAttributionLedgerSchema = z43.object({
5409
- version: z43.literal(TURN_ATTRIBUTION_RECORD_VERSION),
5410
- epochs: z43.array(TurnAttributionEpochSchema).max(MAX_ATTRIBUTION_EPOCHS),
5739
+ var TurnAttributionLedgerSchema = z44.object({
5740
+ version: z44.literal(TURN_ATTRIBUTION_RECORD_VERSION),
5741
+ epochs: z44.array(TurnAttributionEpochSchema).max(MAX_ATTRIBUTION_EPOCHS),
5411
5742
  /** `turnAttributionKey()` to epoch number. Bounded by the provider's own history limit. */
5412
- turns: z43.record(z43.number().int().positive().max(MAX_ATTRIBUTION_EPOCHS))
5743
+ turns: z44.record(z44.number().int().positive().max(MAX_ATTRIBUTION_EPOCHS))
5413
5744
  }).strict().superRefine((ledger, ctx) => {
5414
5745
  const ids = ledger.epochs.map((entry) => entry.epoch);
5415
5746
  if (new Set(ids).size !== ids.length)
@@ -5418,13 +5749,13 @@ var TurnAttributionLedgerSchema = z43.object({
5418
5749
  if (!ids.includes(epoch))
5419
5750
  ctx.addIssue({ code: "custom", message: `Turn references unknown epoch ${epoch}` });
5420
5751
  });
5421
- var ManagedTurnUsageSchema = z43.object({
5422
- inputTokens: z43.number().int().nonnegative(),
5423
- outputTokens: z43.number().int().nonnegative(),
5424
- totalTokens: z43.number().int().nonnegative(),
5425
- cacheReadTokens: z43.number().int().nonnegative().nullable(),
5426
- cacheWriteTokens: z43.number().int().nonnegative().nullable(),
5427
- reasoningTokens: z43.number().int().nonnegative().nullable()
5752
+ var ManagedTurnUsageSchema = z44.object({
5753
+ inputTokens: z44.number().int().nonnegative(),
5754
+ outputTokens: z44.number().int().nonnegative(),
5755
+ totalTokens: z44.number().int().nonnegative(),
5756
+ cacheReadTokens: z44.number().int().nonnegative().nullable(),
5757
+ cacheWriteTokens: z44.number().int().nonnegative().nullable(),
5758
+ reasoningTokens: z44.number().int().nonnegative().nullable()
5428
5759
  }).strict().superRefine((usage, ctx) => {
5429
5760
  if (usage.totalTokens !== usage.inputTokens + usage.outputTokens)
5430
5761
  ctx.addIssue({ code: "custom", message: "Total tokens must equal input plus output" });
@@ -5433,14 +5764,14 @@ var ManagedTurnUsageSchema = z43.object({
5433
5764
  if ((usage.reasoningTokens ?? 0) > usage.outputTokens)
5434
5765
  ctx.addIssue({ code: "custom", message: "Reasoning cannot exceed output" });
5435
5766
  });
5436
- var TurnAttributionStampSchema = z43.object({
5437
- recordVersion: z43.literal(TURN_ATTRIBUTION_RECORD_VERSION),
5767
+ var TurnAttributionStampSchema = z44.object({
5768
+ recordVersion: z44.literal(TURN_ATTRIBUTION_RECORD_VERSION),
5438
5769
  identity: TurnAttributionIdentitySchema,
5439
5770
  attribution: PinnedTurnAttributionSchema
5440
5771
  }).strict();
5441
5772
 
5442
5773
  // ../../packages/shared/dist/schemas/user-skills.schemas.js
5443
- import { z as z44 } from "zod";
5774
+ import { z as z45 } from "zod";
5444
5775
  import { parseDocument } from "yaml";
5445
5776
  var USER_SKILL_LIMITS = {
5446
5777
  files: 20,
@@ -5451,18 +5782,18 @@ var USER_SKILL_LIMITS = {
5451
5782
  assignedFiles: 100
5452
5783
  };
5453
5784
  var bytes = (value) => new TextEncoder().encode(value).length;
5454
- var UserSkillPathSchema = z44.string().min(1).max(240).refine((path8) => {
5785
+ var UserSkillPathSchema = z45.string().min(1).max(240).refine((path8) => {
5455
5786
  const parts = path8.split("/");
5456
5787
  return parts.length <= 8 && parts.every((part) => part && part !== "." && part !== ".." && bytes(part) <= 255 && !part.startsWith(".") && ![...part].some((c) => c === "\\" || c.charCodeAt(0) < 32 || c.charCodeAt(0) === 127)) && /\.(md|txt|json|yaml|yml)$/i.test(path8) && (path8 === "SKILL.md" || !parts.some((p) => p.toLowerCase() === "skill.md"));
5457
5788
  }, "Use a relative text-file path; only the main SKILL.md entrypoint is allowed");
5458
- var UserSkillFileSchema = z44.object({
5789
+ var UserSkillFileSchema = z45.object({
5459
5790
  path: UserSkillPathSchema,
5460
- content: z44.string().max(USER_SKILL_LIMITS.bytes).refine((s) => ![...s].some((c) => c.charCodeAt(0) < 32 && ![9, 10, 13].includes(c.charCodeAt(0))) && bytes(s) <= USER_SKILL_LIMITS.bytes, "File exceeds 1 MiB or contains binary data")
5791
+ content: z45.string().max(USER_SKILL_LIMITS.bytes).refine((s) => ![...s].some((c) => c.charCodeAt(0) < 32 && ![9, 10, 13].includes(c.charCodeAt(0))) && bytes(s) <= USER_SKILL_LIMITS.bytes, "File exceeds 1 MiB or contains binary data")
5461
5792
  }).strict();
5462
- var UserSkillDraftBundleSchema = z44.object({
5463
- name: z44.string().trim().max(100),
5464
- description: z44.string().trim().max(300),
5465
- files: z44.array(UserSkillFileSchema).min(1).max(USER_SKILL_LIMITS.files)
5793
+ var UserSkillDraftBundleSchema = z45.object({
5794
+ name: z45.string().trim().max(100),
5795
+ description: z45.string().trim().max(300),
5796
+ files: z45.array(UserSkillFileSchema).min(1).max(USER_SKILL_LIMITS.files)
5466
5797
  }).strict().superRefine((bundle, ctx) => {
5467
5798
  const paths = bundle.files.map((f) => f.path.toLowerCase());
5468
5799
  if (new Set(paths).size !== paths.length || paths.some((p) => paths.some((other) => other.startsWith(p + "/"))))
@@ -5473,103 +5804,103 @@ var UserSkillDraftBundleSchema = z44.object({
5473
5804
  if (bundle.files.reduce((total, f) => total + bytes(f.content), 0) > USER_SKILL_LIMITS.bytes)
5474
5805
  ctx.addIssue({ code: "custom", message: "A skill can contain at most 1 MiB of text" });
5475
5806
  });
5476
- var UserSkillPinSchema = z44.object({
5477
- skillId: z44.string().uuid(),
5478
- version: z44.number().int().positive(),
5479
- digest: z44.string().regex(/^[a-f0-9]{64}$/)
5807
+ var UserSkillPinSchema = z45.object({
5808
+ skillId: z45.string().uuid(),
5809
+ version: z45.number().int().positive(),
5810
+ digest: z45.string().regex(/^[a-f0-9]{64}$/)
5480
5811
  }).strict();
5481
- var UserSkillPinsSchema = z44.array(UserSkillPinSchema).max(USER_SKILL_LIMITS.assigned);
5482
- var UserSkillIdSchema = z44.object({ skillId: z44.string().uuid() });
5812
+ var UserSkillPinsSchema = z45.array(UserSkillPinSchema).max(USER_SKILL_LIMITS.assigned);
5813
+ var UserSkillIdSchema = z45.object({ skillId: z45.string().uuid() });
5483
5814
  var UserSkillDraftInputSchema = UserSkillIdSchema.extend({
5484
- requestKey: z44.string().uuid(),
5485
- expectedRevision: z44.number().int().nonnegative(),
5815
+ requestKey: z45.string().uuid(),
5816
+ expectedRevision: z45.number().int().nonnegative(),
5486
5817
  bundle: UserSkillDraftBundleSchema
5487
5818
  });
5488
5819
  var UserSkillSaveVersionSchema = UserSkillIdSchema.extend({
5489
- requestKey: z44.string().uuid(),
5490
- expectedRevision: z44.number().int().nonnegative(),
5491
- note: z44.string().trim().max(500).default(""),
5492
- restoreVersion: z44.number().int().positive().optional()
5820
+ requestKey: z45.string().uuid(),
5821
+ expectedRevision: z45.number().int().nonnegative(),
5822
+ note: z45.string().trim().max(500).default(""),
5823
+ restoreVersion: z45.number().int().positive().optional()
5493
5824
  });
5494
5825
  var UserSkillAssignSchema = UserSkillIdSchema.extend({
5495
- requestKey: z44.string().uuid(),
5496
- version: z44.number().int().positive().nullable(),
5497
- agents: z44.array(z44.object({ agentId: z44.string().uuid(), expectedRevision: z44.number().int().nonnegative() })).min(1).max(100)
5826
+ requestKey: z45.string().uuid(),
5827
+ version: z45.number().int().positive().nullable(),
5828
+ agents: z45.array(z45.object({ agentId: z45.string().uuid(), expectedRevision: z45.number().int().nonnegative() })).min(1).max(100)
5498
5829
  });
5499
5830
  var UserSkillArchiveSchema = UserSkillIdSchema.extend({
5500
- requestKey: z44.string().uuid(),
5501
- expectedRevision: z44.number().int().nonnegative(),
5502
- archived: z44.boolean(),
5503
- removeAssignments: z44.boolean().default(false)
5504
- });
5505
- var UserSkillSummarySchema = z44.object({
5506
- id: z44.string().uuid(),
5507
- name: z44.string(),
5508
- description: z44.string(),
5509
- archived: z44.boolean(),
5510
- latestVersion: z44.number().int(),
5511
- revision: z44.number().int(),
5512
- hasDraft: z44.boolean(),
5513
- assignedCount: z44.number().int(),
5514
- outdatedCount: z44.number().int(),
5515
- updatedAt: z44.string()
5516
- });
5517
- var UserSkillAgentSchema = z44.object({
5518
- agentId: z44.string().uuid(),
5519
- name: z44.string(),
5520
- managed: z44.boolean().optional(),
5521
- paused: z44.boolean(),
5522
- working: z44.boolean(),
5523
- revision: z44.number().int(),
5831
+ requestKey: z45.string().uuid(),
5832
+ expectedRevision: z45.number().int().nonnegative(),
5833
+ archived: z45.boolean(),
5834
+ removeAssignments: z45.boolean().default(false)
5835
+ });
5836
+ var UserSkillSummarySchema = z45.object({
5837
+ id: z45.string().uuid(),
5838
+ name: z45.string(),
5839
+ description: z45.string(),
5840
+ archived: z45.boolean(),
5841
+ latestVersion: z45.number().int(),
5842
+ revision: z45.number().int(),
5843
+ hasDraft: z45.boolean(),
5844
+ assignedCount: z45.number().int(),
5845
+ outdatedCount: z45.number().int(),
5846
+ updatedAt: z45.string()
5847
+ });
5848
+ var UserSkillAgentSchema = z45.object({
5849
+ agentId: z45.string().uuid(),
5850
+ name: z45.string(),
5851
+ managed: z45.boolean().optional(),
5852
+ paused: z45.boolean(),
5853
+ working: z45.boolean(),
5854
+ revision: z45.number().int(),
5524
5855
  desired: UserSkillPinsSchema,
5525
5856
  observed: UserSkillPinsSchema,
5526
- state: z44.enum(["pending", "applying", "ready", "error"]),
5527
- errorCode: z44.string().nullable(),
5528
- sessionId: z44.string().nullable()
5529
- });
5530
- var UserSkillLibrarySchema = z44.object({
5531
- skills: z44.array(UserSkillSummarySchema),
5532
- agents: z44.array(UserSkillAgentSchema)
5533
- });
5534
- var UserSkillVersionSchema = z44.object({
5535
- version: z44.number().int(),
5536
- digest: z44.string(),
5537
- name: z44.string(),
5538
- description: z44.string(),
5539
- bytes: z44.number().int(),
5540
- fileCount: z44.number().int(),
5541
- note: z44.string(),
5542
- createdAt: z44.string()
5543
- });
5544
- var UserSkillDetailSchema = z44.object({
5857
+ state: z45.enum(["pending", "applying", "ready", "error"]),
5858
+ errorCode: z45.string().nullable(),
5859
+ sessionId: z45.string().nullable()
5860
+ });
5861
+ var UserSkillLibrarySchema = z45.object({
5862
+ skills: z45.array(UserSkillSummarySchema),
5863
+ agents: z45.array(UserSkillAgentSchema)
5864
+ });
5865
+ var UserSkillVersionSchema = z45.object({
5866
+ version: z45.number().int(),
5867
+ digest: z45.string(),
5868
+ name: z45.string(),
5869
+ description: z45.string(),
5870
+ bytes: z45.number().int(),
5871
+ fileCount: z45.number().int(),
5872
+ note: z45.string(),
5873
+ createdAt: z45.string()
5874
+ });
5875
+ var UserSkillDetailSchema = z45.object({
5545
5876
  skill: UserSkillSummarySchema,
5546
5877
  draft: UserSkillDraftBundleSchema.nullable(),
5547
- versions: z44.array(UserSkillVersionSchema),
5548
- agents: z44.array(UserSkillAgentSchema)
5878
+ versions: z45.array(UserSkillVersionSchema),
5879
+ agents: z45.array(UserSkillAgentSchema)
5549
5880
  });
5550
5881
 
5551
5882
  // ../../packages/shared/dist/schemas/managed-billing.schemas.js
5552
- import { z as z45 } from "zod";
5553
- var id = z45.string().min(1).max(256);
5554
- var usd = z45.string().regex(/^(0|[1-9]\d{0,9})(\.\d{1,6})?$/);
5883
+ import { z as z46 } from "zod";
5884
+ var id = z46.string().min(1).max(256);
5885
+ var usd = z46.string().regex(/^(0|[1-9]\d{0,9})(\.\d{1,6})?$/);
5555
5886
  var SANDBOX_CONTAINER_SIZES = ["small", "medium", "large"];
5556
- var ManagedCostPolicySchema = z45.object({
5887
+ var ManagedCostPolicySchema = z46.object({
5557
5888
  version: id,
5558
- region: z45.enum(["global", "regional"]),
5889
+ region: z46.enum(["global", "regional"]),
5559
5890
  ownerDailyUsd: usd,
5560
5891
  platformDailyUsd: usd,
5561
5892
  computeReserveUsd: usd,
5562
5893
  retainedResourceDailyUsd: usd,
5563
- maxConcurrentOperations: z45.number().int().min(1).max(64),
5564
- maxUnresolvedOperations: z45.number().int().min(1).max(1e4),
5565
- maxUnresolvedAgeMs: z45.number().int().min(6e4).max(6048e5),
5566
- reconciliationMaxAgeMs: z45.number().int().min(6e4).max(6048e5),
5894
+ maxConcurrentOperations: z46.number().int().min(1).max(64),
5895
+ maxUnresolvedOperations: z46.number().int().min(1).max(1e4),
5896
+ maxUnresolvedAgeMs: z46.number().int().min(6e4).max(6048e5),
5897
+ reconciliationMaxAgeMs: z46.number().int().min(6e4).max(6048e5),
5567
5898
  /**
5568
5899
  * The models this policy qualifies. Each must have a published supplier rate, which supplier
5569
5900
  * exposure is reserved and settled from; a policy stored before a model was added still
5570
5901
  * parses to exactly its stored JSON.
5571
5902
  */
5572
- models: z45.array(z45.enum([
5903
+ models: z46.array(z46.enum([
5573
5904
  "gpt-5.6-luna",
5574
5905
  "gpt-5.6-sol",
5575
5906
  "gpt-6-astra",
@@ -5577,27 +5908,27 @@ var ManagedCostPolicySchema = z45.object({
5577
5908
  "gpt-6-sol",
5578
5909
  "gpt-6.1-sol"
5579
5910
  ])).min(1),
5580
- nativeHelpersQualified: z45.boolean(),
5581
- corrections: z45.enum(["manual", "refund_downward"]),
5582
- approvalEvidence: z45.string().trim().min(1).max(256),
5911
+ nativeHelpersQualified: z46.boolean(),
5912
+ corrections: z46.enum(["manual", "refund_downward"]),
5913
+ approvalEvidence: z46.string().trim().min(1).max(256),
5583
5914
  /**
5584
5915
  * Hosted sandbox pricing terms. Optional, and deliberately without schema defaults: a policy
5585
5916
  * stored before these terms existed must parse to exactly its stored JSON, or its immutable
5586
5917
  * digest would no longer match. `managedSandboxTerms` supplies the defaults at use.
5587
5918
  */
5588
- sandbox: z45.object({
5589
- memory: z45.enum(SANDBOX_MEMORY_TIERS).optional(),
5590
- granularity: z45.enum(SANDBOX_BILLING_GRANULARITIES).optional(),
5919
+ sandbox: z46.object({
5920
+ memory: z46.enum(SANDBOX_MEMORY_TIERS).optional(),
5921
+ granularity: z46.enum(SANDBOX_BILLING_GRANULARITIES).optional(),
5591
5922
  /** Assumed provider deletion after activity and keep-alives stop; not configurable there. */
5592
- idleExpiryMs: z45.number().int().min(6e4).max(864e5).optional(),
5923
+ idleExpiryMs: z46.number().int().min(6e4).max(864e5).optional(),
5593
5924
  /**
5594
5925
  * The memory tier each container size is billed at (ADR-0192). Optional per size and
5595
5926
  * without defaults, for the same digest reason; `managedSandboxTerms` supplies them.
5596
5927
  */
5597
- sizes: z45.object({
5598
- small: z45.enum(SANDBOX_MEMORY_TIERS).optional(),
5599
- medium: z45.enum(SANDBOX_MEMORY_TIERS).optional(),
5600
- large: z45.enum(SANDBOX_MEMORY_TIERS).optional()
5928
+ sizes: z46.object({
5929
+ small: z46.enum(SANDBOX_MEMORY_TIERS).optional(),
5930
+ medium: z46.enum(SANDBOX_MEMORY_TIERS).optional(),
5931
+ large: z46.enum(SANDBOX_MEMORY_TIERS).optional()
5601
5932
  }).strict().optional()
5602
5933
  }).strict().optional()
5603
5934
  }).strict().refine((p) => usdToMicro(p.ownerDailyUsd) > 0n && usdToMicro(p.platformDailyUsd) > 0n && usdToMicro(p.computeReserveUsd) > 0n && usdToMicro(p.retainedResourceDailyUsd) > 0n, {
@@ -5607,11 +5938,11 @@ function usdToMicro(value) {
5607
5938
  const [whole, fractional = ""] = usd.parse(value).split(".");
5608
5939
  return BigInt(whole + fractional.padEnd(6, "0"));
5609
5940
  }
5610
- var ManagedTurnEvidenceSchema = z45.object({
5941
+ var ManagedTurnEvidenceSchema = z46.object({
5611
5942
  sessionId: id,
5612
5943
  turnId: id,
5613
5944
  subagentId: id.nullable(),
5614
- status: z45.enum([
5945
+ status: z46.enum([
5615
5946
  "completed",
5616
5947
  "failed",
5617
5948
  "cancelled",
@@ -5621,11 +5952,11 @@ var ManagedTurnEvidenceSchema = z45.object({
5621
5952
  ]),
5622
5953
  usage: AllowanceReportedUsageSchema.nullable()
5623
5954
  }).strict();
5624
- var ManagedWorkEvidenceSchema = z45.object({
5955
+ var ManagedWorkEvidenceSchema = z46.object({
5625
5956
  sessionId: id,
5626
5957
  rootTurnId: id,
5627
- complete: z45.boolean(),
5628
- turns: z45.array(ManagedTurnEvidenceSchema).min(1).max(2e3)
5958
+ complete: z46.boolean(),
5959
+ turns: z46.array(ManagedTurnEvidenceSchema).min(1).max(2e3)
5629
5960
  }).strict();
5630
5961
 
5631
5962
  // ../../packages/shared/dist/schemas/taskmarket-mcp.schemas.js
@@ -5644,124 +5975,124 @@ var DIRECT_TOOL_GROUPS = [
5644
5975
  "memory"
5645
5976
  ];
5646
5977
  var DIRECT_TURN_RETRY_LIMIT = 1;
5647
- var DirectRuntimeConfigurationSchema = z46.object({
5648
- platformToolsVersion: z46.literal(1).optional(),
5649
- swarm: z46.boolean(),
5650
- userSkills: z46.object({ revision: z46.number().int().nonnegative(), pins: UserSkillPinsSchema }).optional(),
5651
- integrations: z46.literal(true).optional(),
5652
- taskmarketToolsVersion: z46.literal(1).optional(),
5653
- integrationToolsVersion: z46.literal(2).optional(),
5978
+ var DirectRuntimeConfigurationSchema = z47.object({
5979
+ platformToolsVersion: z47.literal(1).optional(),
5980
+ swarm: z47.boolean(),
5981
+ userSkills: z47.object({ revision: z47.number().int().nonnegative(), pins: UserSkillPinsSchema }).optional(),
5982
+ integrations: z47.literal(true).optional(),
5983
+ taskmarketToolsVersion: z47.literal(1).optional(),
5984
+ integrationToolsVersion: z47.literal(2).optional(),
5654
5985
  /**
5655
5986
  * Memory tools and the memory contract (SM-20, SM-25); a new version replaces the session.
5656
5987
  * 2: swarm writes (proposals under taint, SM-51) and `memory_search` history (SM-61).
5657
5988
  */
5658
- memoryToolsVersion: z46.union([z46.literal(1), z46.literal(2)]).optional(),
5989
+ memoryToolsVersion: z47.union([z47.literal(1), z47.literal(2)]).optional(),
5659
5990
  /**
5660
5991
  * The memory contract describes the core.md template (#726, MEMORY_CORE_TEMPLATE_ENABLED).
5661
5992
  * Absent when off, so turning it on or off replaces the session like any contract change.
5662
5993
  */
5663
- memoryCoreTemplate: z46.literal(true).optional(),
5664
- nativeSubagents: z46.literal(2).optional(),
5665
- inbox: z46.literal(1).optional(),
5994
+ memoryCoreTemplate: z47.literal(true).optional(),
5995
+ nativeSubagents: z47.literal(2).optional(),
5996
+ inbox: z47.literal(1).optional(),
5666
5997
  /**
5667
5998
  * The hosted container size the session is created with (ADR-0192). Absent on configurations
5668
5999
  * written before sizes, whose sessions request none and run at the provider's medium default;
5669
6000
  * a change of size replaces the session like any configuration change.
5670
6001
  */
5671
- containerSize: z46.enum(SANDBOX_CONTAINER_SIZES).optional(),
6002
+ containerSize: z47.enum(SANDBOX_CONTAINER_SIZES).optional(),
5672
6003
  /**
5673
6004
  * The session runs with no sandbox (ADR-0194): no shell, no files, and its first input sent
5674
6005
  * with the create. Absent is a hosted sandbox, as every session had before; a change replaces
5675
6006
  * the session like any configuration change.
5676
6007
  */
5677
- workspace: z46.literal("none").optional(),
5678
- profile: z46.object({
5679
- version: z46.number().int().nonnegative(),
5680
- responsibility: z46.string().max(500),
6008
+ workspace: z47.literal("none").optional(),
6009
+ profile: z47.object({
6010
+ version: z47.number().int().nonnegative(),
6011
+ responsibility: z47.string().max(500),
5681
6012
  /**
5682
6013
  * Standing instructions frozen into the session. Absent when memory tools are on (SM-24):
5683
6014
  * they then reach the model through the pinned memory core, so editing them does not
5684
6015
  * replace the session. Bounded by the memory document cap, their source of truth.
5685
6016
  */
5686
- instructions: z46.string().max(65536).optional()
6017
+ instructions: z47.string().max(65536).optional()
5687
6018
  }).optional(),
5688
6019
  /**
5689
6020
  * Tool groups the session defers behind tool search, in `DIRECT_TOOL_GROUPS` order. Only groups
5690
6021
  * the session actually has are listed, so deferring a group an agent does not use changes
5691
6022
  * nothing for it; a change to the list replaces the session like any tool change.
5692
6023
  */
5693
- deferredTools: z46.array(z46.enum(DIRECT_TOOL_GROUPS)).min(1).max(DIRECT_TOOL_GROUPS.length).optional(),
6024
+ deferredTools: z47.array(z47.enum(DIRECT_TOOL_GROUPS)).min(1).max(DIRECT_TOOL_GROUPS.length).optional(),
5694
6025
  /**
5695
6026
  * The session reaches the read-only Taskmarket MCP server (ADR-0207): the server URL
5696
6027
  * and the vault its credential is in, both fixed when the session is created, and the tools it
5697
6028
  * may call. Absent when not attached; a change replaces the session like any configuration
5698
6029
  * change.
5699
6030
  */
5700
- mcp: z46.object({
5701
- serverUrl: z46.string().url().max(2048),
5702
- vaultId: z46.string().min(1).max(256),
5703
- tools: z46.array(z46.string().regex(/^[a-z][a-z0-9_]{0,63}$/)).min(1).max(16)
6031
+ mcp: z47.object({
6032
+ serverUrl: z47.string().url().max(2048),
6033
+ vaultId: z47.string().min(1).max(256),
6034
+ tools: z47.array(z47.string().regex(/^[a-z][a-z0-9_]{0,63}$/)).min(1).max(16)
5704
6035
  }).strict().optional()
5705
6036
  });
5706
- var DirectMcpCredentialSchema = z46.object({
5707
- vaultId: z46.string().min(1).max(256),
6037
+ var DirectMcpCredentialSchema = z47.object({
6038
+ vaultId: z47.string().min(1).max(256),
5708
6039
  /** The server URL the credential is bound to; the provider cannot change it in place. */
5709
- serverUrl: z46.string().url().max(2048),
5710
- credentialId: z46.string().min(1).max(256),
5711
- tokenId: z46.string().uuid(),
5712
- tokenExpiresAt: z46.string().datetime(),
6040
+ serverUrl: z47.string().url().max(2048),
6041
+ credentialId: z47.string().min(1).max(256),
6042
+ tokenId: z47.string().uuid(),
6043
+ tokenExpiresAt: z47.string().datetime(),
5713
6044
  /** What the current token may read: never more than the deployment allows the agent now. */
5714
- scopes: z46.array(z46.enum(TASKMARKET_MCP_TOKEN_SCOPES)).min(1).max(TASKMARKET_MCP_TOKEN_SCOPES.length),
6045
+ scopes: z47.array(z47.enum(TASKMARKET_MCP_TOKEN_SCOPES)).min(1).max(TASKMARKET_MCP_TOKEN_SCOPES.length),
5715
6046
  /** Tokens the credential held before, kept until their revocation is recorded. */
5716
- retiring: z46.array(z46.string().uuid()).min(1).max(16).optional(),
6047
+ retiring: z47.array(z47.string().uuid()).min(1).max(16).optional(),
5717
6048
  /**
5718
6049
  * MCP was turned off while a session that names the credential was kept: every token of the
5719
6050
  * agent is revoked, and the credential holds none that works until a fresh one is rotated in.
5720
6051
  */
5721
- suspended: z46.literal(true).optional()
6052
+ suspended: z47.literal(true).optional()
5722
6053
  }).strict();
5723
- var DirectFunctionCallSchema = z46.object({
5724
- name: z46.string().min(1).max(100),
5725
- argumentHash: z46.string().regex(/^[a-f0-9]{64}$/),
5726
- state: z46.enum(["prepared", "executing", "answered"]),
5727
- reply: z46.object({
5728
- success: z46.boolean(),
5729
- output: z46.string().max(131072).optional(),
5730
- error: z46.string().max(512).optional()
6054
+ var DirectFunctionCallSchema = z47.object({
6055
+ name: z47.string().min(1).max(100),
6056
+ argumentHash: z47.string().regex(/^[a-f0-9]{64}$/),
6057
+ state: z47.enum(["prepared", "executing", "answered"]),
6058
+ reply: z47.object({
6059
+ success: z47.boolean(),
6060
+ output: z47.string().max(131072).optional(),
6061
+ error: z47.string().max(512).optional()
5731
6062
  }).optional()
5732
6063
  });
5733
- var DirectRouteSelectionSchema = z46.object({
5734
- operationId: z46.string().uuid(),
6064
+ var DirectRouteSelectionSchema = z47.object({
6065
+ operationId: z47.string().uuid(),
5735
6066
  mechanism: RoutingMechanismSchema,
5736
6067
  selected: ExecutorSettingsSchema,
5737
- policyVersion: z46.string().min(1).max(200),
5738
- rateVersion: z46.string().min(1).max(200)
6068
+ policyVersion: z47.string().min(1).max(200),
6069
+ rateVersion: z47.string().min(1).max(200)
5739
6070
  }).strict();
5740
- var DirectRouteConfirmationSchema = z46.object({
6071
+ var DirectRouteConfirmationSchema = z47.object({
5741
6072
  /** The routing operation whose selection this confirms, never another operation's. */
5742
- operationId: z46.string().uuid(),
6073
+ operationId: z47.string().uuid(),
5743
6074
  /** The job whose dispatch fence produced it. */
5744
- jobId: z46.string(),
6075
+ jobId: z47.string(),
5745
6076
  settings: ExecutorSettingsSchema,
5746
- observedAt: z46.string().datetime(),
6077
+ observedAt: z47.string().datetime(),
5747
6078
  /**
5748
6079
  * Whether the same settings were still observed after the provider accepted the input.
5749
6080
  *
5750
6081
  * False is not a failure: it is the state between the confirming read and the verification,
5751
6082
  * and the state a worker that crashed in that window resumes into.
5752
6083
  */
5753
- verifiedAfterDispatch: z46.boolean()
6084
+ verifiedAfterDispatch: z47.boolean()
5754
6085
  }).strict();
5755
6086
  var DIRECT_ROUTE_DISPATCH_BINDINGS = ["not_dispatched", "bound", "contested"];
5756
6087
  var DirectPendingRouteSchema = DirectRouteSelectionSchema.extend({
5757
6088
  /** The job this route was selected for. A route never travels to another job. */
5758
- jobId: z46.string(),
5759
- settingsPhase: z46.enum(ROUTING_SETTINGS_TRANSITION_STATES),
5760
- requestedAt: z46.string().datetime().nullable(),
5761
- confirmedAt: z46.string().datetime().nullable(),
6089
+ jobId: z47.string(),
6090
+ settingsPhase: z47.enum(ROUTING_SETTINGS_TRANSITION_STATES),
6091
+ requestedAt: z47.string().datetime().nullable(),
6092
+ confirmedAt: z47.string().datetime().nullable(),
5762
6093
  /** Readback is evidence about the session, never a source of attribution. */
5763
- readbackModelId: z46.string().min(1).max(256).nullable(),
5764
- lostResponse: z46.boolean(),
6094
+ readbackModelId: z47.string().min(1).max(256).nullable(),
6095
+ lostResponse: z47.boolean(),
5765
6096
  /**
5766
6097
  * SPEC-0018 R3.4. How far this job's input binding got.
5767
6098
  *
@@ -5769,27 +6100,27 @@ var DirectPendingRouteSchema = DirectRouteSelectionSchema.extend({
5769
6100
  * `not_dispatched` -- the honest reading of a record that predates the check -- instead of
5770
6101
  * decoding as a binding nobody verified.
5771
6102
  */
5772
- dispatchBinding: z46.enum(DIRECT_ROUTE_DISPATCH_BINDINGS).default("not_dispatched")
6103
+ dispatchBinding: z47.enum(DIRECT_ROUTE_DISPATCH_BINDINGS).default("not_dispatched")
5773
6104
  }).strict();
5774
- var DirectUsageOperationSchema = z46.object({
5775
- operationId: z46.string().min(1).max(200),
5776
- purpose: z46.enum(["work", "maintenance", "retry"]),
5777
- tokenCeiling: z46.number().int().positive(),
5778
- turnId: z46.string().min(1).max(256).nullable(),
5779
- phase: z46.enum(["reserving", "reserved", "dispatched", "settled", "unresolved"]),
5780
- billingBaseline: z46.array(z46.string().min(1).max(256)).max(2e3).optional()
6105
+ var DirectUsageOperationSchema = z47.object({
6106
+ operationId: z47.string().min(1).max(200),
6107
+ purpose: z47.enum(["work", "maintenance", "retry"]),
6108
+ tokenCeiling: z47.number().int().positive(),
6109
+ turnId: z47.string().min(1).max(256).nullable(),
6110
+ phase: z47.enum(["reserving", "reserved", "dispatched", "settled", "unresolved"]),
6111
+ billingBaseline: z47.array(z47.string().min(1).max(256)).max(2e3).optional()
5781
6112
  }).strict();
5782
- var DirectProjectSnapshotSchema = z46.object({
5783
- id: z46.string().regex(/^[a-f0-9]{64}$/),
5784
- key: z46.string().max(512),
5785
- sha256: z46.string().regex(/^[a-f0-9]{64}$/),
5786
- sessionId: z46.string().min(1).max(256),
5787
- turnId: z46.string().min(1).max(256),
5788
- setupHash: z46.string().regex(/^[a-f0-9]{64}$/)
6113
+ var DirectProjectSnapshotSchema = z47.object({
6114
+ id: z47.string().regex(/^[a-f0-9]{64}$/),
6115
+ key: z47.string().max(512),
6116
+ sha256: z47.string().regex(/^[a-f0-9]{64}$/),
6117
+ sessionId: z47.string().min(1).max(256),
6118
+ turnId: z47.string().min(1).max(256),
6119
+ setupHash: z47.string().regex(/^[a-f0-9]{64}$/)
5789
6120
  }).strict();
5790
- var DirectPendingSchema = z46.object({
5791
- jobId: z46.string(),
5792
- baseline: z46.array(z46.string()),
6121
+ var DirectPendingSchema = z47.object({
6122
+ jobId: z47.string(),
6123
+ baseline: z47.array(z47.string()),
5793
6124
  /**
5794
6125
  * The run's dispatch-group identity, carried on every usage event this job writes.
5795
6126
  *
@@ -5797,7 +6128,7 @@ var DirectPendingSchema = z46.object({
5797
6128
  * holds live in `operations` below, one per turn. This stays because the out-of-band
5798
6129
  * reconciler's stored observations are keyed on it, and renaming it would orphan them.
5799
6130
  */
5800
- reservationId: z46.string(),
6131
+ reservationId: z47.string(),
5801
6132
  /**
5802
6133
  * SPEC-0015 M4.2. The metered model operations this job has taken, in dispatch order.
5803
6134
  *
@@ -5809,27 +6140,27 @@ var DirectPendingSchema = z46.object({
5809
6140
  * Bounded at four: a job dispatches at most one work turn and one checkpoint-maintenance
5810
6141
  * turn, and the bound is what stops a recovery loop from growing the checkpoint.
5811
6142
  */
5812
- operations: z46.array(DirectUsageOperationSchema).max(4).optional(),
5813
- runId: z46.string().uuid().optional(),
5814
- phase: z46.enum(["creating", "preparing", "dispatching", "following"]).optional(),
5815
- deadline: z46.number().optional(),
6143
+ operations: z47.array(DirectUsageOperationSchema).max(4).optional(),
6144
+ runId: z47.string().uuid().optional(),
6145
+ phase: z47.enum(["creating", "preparing", "dispatching", "following"]).optional(),
6146
+ deadline: z47.number().optional(),
5816
6147
  // Exact ordinary input, saved before dispatch. Legacy checkpoints cannot be replayed.
5817
- dispatch: z46.object({
5818
- text: z46.string(),
5819
- key: z46.string(),
5820
- attempts: z46.number().int().min(0).max(2),
5821
- acknowledged: z46.boolean(),
5822
- cancelled: z46.boolean()
6148
+ dispatch: z47.object({
6149
+ text: z47.string(),
6150
+ key: z47.string(),
6151
+ attempts: z47.number().int().min(0).max(2),
6152
+ acknowledged: z47.boolean(),
6153
+ cancelled: z47.boolean()
5823
6154
  }).optional(),
5824
- turnId: z46.string().optional(),
5825
- creationInput: z46.boolean().optional(),
6155
+ turnId: z47.string().optional(),
6156
+ creationInput: z47.boolean().optional(),
5826
6157
  /**
5827
6158
  * The skill files the session this job creates is sent (ADR-0203), saved before the
5828
6159
  * create, so a create whose response is lost is recovered with them as its `skillBundle`.
5829
6160
  */
5830
- skillBundle: z46.object({
5831
- docsHash: z46.string().regex(/^[a-f0-9]{64}$/),
5832
- inventoryHash: z46.string().regex(/^[a-f0-9]{64}$/)
6161
+ skillBundle: z47.object({
6162
+ docsHash: z47.string().regex(/^[a-f0-9]{64}$/),
6163
+ inventoryHash: z47.string().regex(/^[a-f0-9]{64}$/)
5833
6164
  }).strict().optional(),
5834
6165
  // `contextRetry` (a context-overflow retry) and `memoryTainted` were removed; checkpoints
5835
6166
  // that still carry them parse, and the unknown keys are dropped on the next save.
@@ -5838,18 +6169,18 @@ var DirectPendingSchema = z46.object({
5838
6169
  * from that turn are added to it as they are seen, so `sessionUsage` stays current on every
5839
6170
  * save and a resumed job never counts the same turn twice.
5840
6171
  */
5841
- sessionItems: z46.number().int().nonnegative().optional(),
5842
- checkpointRepair: z46.object({
5843
- workTurnId: z46.string().min(1),
5844
- finalText: z46.string().min(1).max(65536),
5845
- nativeTurnIds: z46.array(z46.string()).max(2e3).optional()
6172
+ sessionItems: z47.number().int().nonnegative().optional(),
6173
+ checkpointRepair: z47.object({
6174
+ workTurnId: z47.string().min(1),
6175
+ finalText: z47.string().min(1).max(65536),
6176
+ nativeTurnIds: z47.array(z47.string()).max(2e3).optional()
5846
6177
  }).optional(),
5847
- replies: z46.record(z46.object({
5848
- success: z46.boolean(),
5849
- output: z46.string().optional(),
5850
- error: z46.string().optional()
6178
+ replies: z47.record(z47.object({
6179
+ success: z47.boolean(),
6180
+ output: z47.string().optional(),
6181
+ error: z47.string().optional()
5851
6182
  })).optional(),
5852
- calls: z46.record(DirectFunctionCallSchema).optional(),
6183
+ calls: z47.record(DirectFunctionCallSchema).optional(),
5853
6184
  /**
5854
6185
  * SPEC-0018 R3.1. The route this job was dispatched under, and its transition phase.
5855
6186
  * Absent on every unrouted job, which is every job until routing is enabled.
@@ -5860,36 +6191,36 @@ var DirectPendingSchema = z46.object({
5860
6191
  * dispatching again. The retry's input is the original text under its own idempotency key
5861
6192
  * and its own `retry` operation; `attempt` never exceeds DIRECT_TURN_RETRY_LIMIT.
5862
6193
  */
5863
- retry: z46.object({
5864
- attempt: z46.number().int().min(1).max(DIRECT_TURN_RETRY_LIMIT),
5865
- code: z46.string().min(1).max(100),
5866
- turnId: z46.string().min(1).max(256)
6194
+ retry: z47.object({
6195
+ attempt: z47.number().int().min(1).max(DIRECT_TURN_RETRY_LIMIT),
6196
+ code: z47.string().min(1).max(100),
6197
+ turnId: z47.string().min(1).max(256)
5867
6198
  }).strict().optional(),
5868
6199
  /**
5869
6200
  * Why the host itself cancelled this job's turn: its run bound expired, or its recovery
5870
6201
  * deadline passed. A turn found cancelled with this set ended on the host's own limit, not on
5871
6202
  * an owner or operator pause.
5872
6203
  */
5873
- cancelledBy: z46.enum(["run_bound", "deadline"]).optional(),
6204
+ cancelledBy: z47.enum(["run_bound", "deadline"]).optional(),
5874
6205
  /**
5875
6206
  * ADR-0204. The native helper call in this job's turn that asked for a model other
5876
6207
  * than the one the turn was pinned to. The helper model guard cancelled the turn on seeing it,
5877
6208
  * so the turn ends the job with `DIRECT_HELPER_MODEL_REFUSED`, and the helper turns observed
5878
6209
  * under it are attributed to the requested model rather than inherited from the root turn.
5879
6210
  */
5880
- helperModel: z46.object({
5881
- turnId: z46.string().min(1).max(256),
5882
- itemId: z46.string().min(1).max(256),
5883
- model: z46.string().min(1).max(256),
5884
- reasoningEffort: z46.string().min(1).max(64).nullable(),
5885
- sessionModel: z46.string().min(1).max(256)
6211
+ helperModel: z47.object({
6212
+ turnId: z47.string().min(1).max(256),
6213
+ itemId: z47.string().min(1).max(256),
6214
+ model: z47.string().min(1).max(256),
6215
+ reasoningEffort: z47.string().min(1).max(64).nullable(),
6216
+ sessionModel: z47.string().min(1).max(256)
5886
6217
  }).strict().optional(),
5887
6218
  /**
5888
6219
  * ADR-0196 (proposed). This job's turns run on the flex service tier. Chosen once per run and
5889
6220
  * kept here, so a resumed attempt dispatches on the same tier under the same idempotency key.
5890
6221
  * Absent is the default tier.
5891
6222
  */
5892
- serviceTier: z46.literal("flex").optional(),
6223
+ serviceTier: z47.literal("flex").optional(),
5893
6224
  /**
5894
6225
  * ADR-0200. The wall-clock bound of the turn being followed when the worker may
5895
6226
  * release its slot while the model works: set at each dispatch, in epoch milliseconds. A bound
@@ -5898,18 +6229,18 @@ var DirectPendingSchema = z46.object({
5898
6229
  * `deadline` keeps its meaning (the latest the dispatch was made), which the unbought proof's
5899
6230
  * bracket depends on.
5900
6231
  */
5901
- turnDeadline: z46.number().int().positive().optional(),
6232
+ turnDeadline: z47.number().int().positive().optional(),
5902
6233
  /**
5903
6234
  * ADR-0200. This job's run released its worker slot while its turn ran: how many
5904
6235
  * times, and when last. A later claim resumes it through the ordinary recovery path, which
5905
6236
  * does not announce again the items of the turn listed in `announced`, nor record its usage
5906
6237
  * again while it still reads as `usageHash`.
5907
6238
  */
5908
- parked: z46.object({
5909
- count: z46.number().int().min(1),
5910
- at: z46.string().datetime(),
5911
- announced: z46.array(z46.string().min(1).max(512)).max(DIRECT_PARKED_ANNOUNCED_MAX).optional(),
5912
- usageHash: z46.string().regex(/^[a-f0-9]{64}$/).optional()
6239
+ parked: z47.object({
6240
+ count: z47.number().int().min(1),
6241
+ at: z47.string().datetime(),
6242
+ announced: z47.array(z47.string().min(1).max(512)).max(DIRECT_PARKED_ANNOUNCED_MAX).optional(),
6243
+ usageHash: z47.string().regex(/^[a-f0-9]{64}$/).optional()
5913
6244
  }).strict().optional()
5914
6245
  }).superRefine((pending, ctx) => {
5915
6246
  if (pending.route && pending.route.jobId !== pending.jobId)
@@ -5920,48 +6251,48 @@ var DirectPendingSchema = z46.object({
5920
6251
  });
5921
6252
  });
5922
6253
  var DIRECT_DETACHED_MAX = 8;
5923
- var DirectDetachedSessionSchema = z46.object({
6254
+ var DirectDetachedSessionSchema = z47.object({
5924
6255
  /** The provider session, or null when the job was still creating it. */
5925
- sessionId: z46.string().min(1).max(256).nullable(),
6256
+ sessionId: z47.string().min(1).max(256).nullable(),
5926
6257
  /** The reset request this entry was detached under. */
5927
- resetVersion: z46.number().int().positive(),
5928
- detachedAt: z46.string().datetime(),
6258
+ resetVersion: z47.number().int().positive(),
6259
+ detachedAt: z47.string().datetime(),
5929
6260
  /** The session's model and tier when it was detached, for the settlement record. */
5930
- model: z46.string(),
5931
- tier: z46.object({
6261
+ model: z47.string(),
6262
+ tier: z47.object({
5932
6263
  tier: AgentTierSchema,
5933
- mappingVersion: z46.string().min(1).max(200),
5934
- reasoningEffort: z46.enum(EXECUTOR_REASONING_EFFORTS).optional()
6264
+ mappingVersion: z47.string().min(1).max(200),
6265
+ reasoningEffort: z47.enum(EXECUTOR_REASONING_EFFORTS).optional()
5935
6266
  }).optional(),
5936
6267
  /** The pending block exactly as the job left it: its run, operations, baseline and deadline. */
5937
6268
  pending: DirectPendingSchema.nullable(),
5938
6269
  /** A cancellation was sent to the session for the job's turn. Never sent twice. */
5939
- cancelRequested: z46.boolean().optional(),
6270
+ cancelRequested: z47.boolean().optional(),
5940
6271
  /**
5941
6272
  * Sessions the checkpoint had retired when this entry was detached. A job still `creating`
5942
6273
  * may have replaced one of them earlier in the same job, so it carries the job's metadata
5943
6274
  * too; settlement never adopts one as the session its lost create made. Optional: entries
5944
6275
  * detached before it was recorded exclude nothing more than they did.
5945
6276
  */
5946
- excludedSessions: z46.array(z46.string().min(1).max(256)).max(100).optional(),
6277
+ excludedSessions: z47.array(z47.string().min(1).max(256)).max(100).optional(),
5947
6278
  /** Why the last settlement attempt left the entry in place, for the operator. */
5948
- unresolved: z46.object({ reason: z46.string().min(1).max(100), at: z46.string().datetime() }).optional(),
6279
+ unresolved: z47.object({ reason: z47.string().min(1).max(100), at: z47.string().datetime() }).optional(),
5949
6280
  /** Settlement attempts that left the entry in place, which sets the backoff below. */
5950
- attempts: z46.number().int().nonnegative().optional(),
6281
+ attempts: z47.number().int().nonnegative().optional(),
5951
6282
  /** No settlement attempt is made before this: a stuck entry is not re-read every tick. */
5952
- retryAt: z46.string().datetime().optional(),
6283
+ retryAt: z47.string().datetime().optional(),
5953
6284
  /**
5954
6285
  * Every operation of the entry is closed, and only the provider deletion of its session is
5955
6286
  * still owed. Set only on a checkpoint with no `project` block, which has no
5956
6287
  * `sessionsToDelete` to put the session on; the session sweeper deletes the session under its
5957
6288
  * usual evidence gates and then drops the entry.
5958
6289
  */
5959
- settledAt: z46.string().datetime().optional()
6290
+ settledAt: z47.string().datetime().optional()
5960
6291
  }).strict();
5961
- var DirectAgentCheckpointSchema = z46.object({
5962
- kind: z46.literal("openai-preview-v1"),
5963
- sessionId: z46.string().nullable(),
5964
- model: z46.string(),
6292
+ var DirectAgentCheckpointSchema = z47.object({
6293
+ kind: z47.literal("openai-preview-v1"),
6294
+ sessionId: z47.string().nullable(),
6295
+ model: z47.string(),
5965
6296
  /**
5966
6297
  * The capability tier and tier-mapping version the current `model` was resolved from, and the
5967
6298
  * reasoning effort that mapping set, if any. Session-scoped like `model`. A later job whose
@@ -5970,25 +6301,25 @@ var DirectAgentCheckpointSchema = z46.object({
5970
6301
  * updates the live one. Absent on checkpoints written before tiers, which ran as light on the
5971
6302
  * managed default settings.
5972
6303
  */
5973
- tier: z46.object({
6304
+ tier: z47.object({
5974
6305
  tier: AgentTierSchema,
5975
- mappingVersion: z46.string().min(1).max(200),
5976
- reasoningEffort: z46.enum(EXECUTOR_REASONING_EFFORTS).optional()
6306
+ mappingVersion: z47.string().min(1).max(200),
6307
+ reasoningEffort: z47.enum(EXECUTOR_REASONING_EFFORTS).optional()
5977
6308
  }).optional(),
5978
6309
  /**
5979
6310
  * ADR-0196 (proposed). The live session runs on the flex service tier. Session-scoped like
5980
6311
  * `model`; absent is the managed default tier.
5981
6312
  */
5982
- serviceTier: z46.literal("flex").optional(),
6313
+ serviceTier: z47.literal("flex").optional(),
5983
6314
  /**
5984
6315
  * ADR-0196 (proposed). A flex turn the provider could not serve paused flex for this agent: no
5985
6316
  * job selects flex before `until`, and the job that fell back never does.
5986
6317
  */
5987
- flexUnavailable: z46.object({ until: z46.string().datetime(), jobId: z46.string().min(1) }).strict().optional(),
5988
- networkAccess: z46.enum(["disabled", "enabled"]).optional(),
5989
- toolProfile: z46.enum(["base", "purchases-v1"]).optional(),
6318
+ flexUnavailable: z47.object({ until: z47.string().datetime(), jobId: z47.string().min(1) }).strict().optional(),
6319
+ networkAccess: z47.enum(["disabled", "enabled"]).optional(),
6320
+ toolProfile: z47.enum(["base", "purchases-v1"]).optional(),
5990
6321
  configuration: DirectRuntimeConfigurationSchema.optional(),
5991
- helperUsageHashes: z46.record(z46.string().regex(/^[a-f0-9]{64}$/)).optional(),
6322
+ helperUsageHashes: z47.record(z47.string().regex(/^[a-f0-9]{64}$/)).optional(),
5992
6323
  /**
5993
6324
  * SPEC-0018 R2.5. Attribution pinned at dispatch, per turn. Optional so existing checkpoints
5994
6325
  * still decode; an absent ledger means the turn is unattributed, never that the session's
@@ -6018,10 +6349,10 @@ var DirectAgentCheckpointSchema = z46.object({
6018
6349
  * because a confirmation is only worth anything for the dispatch it immediately preceded.
6019
6350
  */
6020
6351
  routeConfirmation: DirectRouteConfirmationSchema.optional(),
6021
- purchaseOperations: z46.array(z46.object({
6022
- operationId: z46.string().uuid(),
6023
- jobId: z46.string(),
6024
- financialPhase: z46.enum([
6352
+ purchaseOperations: z47.array(z47.object({
6353
+ operationId: z47.string().uuid(),
6354
+ jobId: z47.string(),
6355
+ financialPhase: z47.enum([
6025
6356
  "not_started",
6026
6357
  "pending",
6027
6358
  "unknown",
@@ -6029,202 +6360,128 @@ var DirectAgentCheckpointSchema = z46.object({
6029
6360
  "released",
6030
6361
  "failed"
6031
6362
  ]),
6032
- resultStatus: z46.enum(["pending", "received", "failed"])
6363
+ resultStatus: z47.enum(["pending", "received", "failed"])
6033
6364
  })).max(64).optional(),
6034
6365
  /**
6035
6366
  * The pinned memory core last sent into this session (SM-21): the combined pinned version and
6036
6367
  * the session it was sent to. The core is sent again when its version moves or the session
6037
6368
  * changes, and never on a turn where both are unchanged.
6038
6369
  */
6039
- memoryInjectedVersion: z46.object({ sessionId: z46.string().min(1).max(256), version: z46.string().min(1).max(64) }).optional(),
6370
+ memoryInjectedVersion: z47.object({ sessionId: z47.string().min(1).max(256), version: z47.string().min(1).max(64) }).optional(),
6040
6371
  /**
6041
6372
  * The owner's forget count (#714, `hosted_agents.memory_forget_version`) the session was created
6042
6373
  * under. A higher count at the start of a later job means memory this session may hold was
6043
6374
  * forgotten since, and the job moves the agent to a new session (`memory_forgotten`). Absent for
6044
6375
  * a session created before it was recorded, which then counts as created under 0.
6045
6376
  */
6046
- memoryForgetVersion: z46.object({ sessionId: z46.string().min(1).max(256), version: z46.number().int().nonnegative() }).optional(),
6377
+ memoryForgetVersion: z47.object({ sessionId: z47.string().min(1).max(256), version: z47.number().int().nonnegative() }).optional(),
6047
6378
  // `memoryTaintedSessionId` (session-wide pinned taint) was removed; checkpoints that still carry
6048
6379
  // it parse, and the unknown key is dropped on the next save.
6049
6380
  /**
6050
6381
  * Items the host has seen in the current session (SM-32), counted as each turn's items are read,
6051
- * including turns of jobs that failed. Keyed by session, so a new session starts from zero with
6052
- * no reset code. The next job rolls over once it passes the threshold (never above the per-turn
6053
- * scan cap), or when the session ran out of context.
6054
- */
6055
- sessionUsage: z46.object({
6056
- sessionId: z46.string().min(1).max(256),
6057
- items: z46.number().int().nonnegative(),
6058
- contextExceeded: z46.boolean().optional(),
6059
- /**
6060
- * The provider refused this session further work: a safety system blocked its conversation
6061
- * (`policy_blocked`) or it reached its usage budget (`session_budget`). Or the host refused a
6062
- * native helper that asked for another model (`helper_model`, ADR-0204), which
6063
- * stays open in it. The next job starts a new session with this as the rollover reason, the
6064
- * way `contextExceeded` does.
6065
- */
6066
- retire: z46.enum(["policy_blocked", "session_budget", "helper_model"]).optional()
6067
- }).optional(),
6068
- /**
6069
- * The live session the idle sweeper deleted at the provider (parked) after the agent's last job
6070
- * went idle. `sessionId` above is null while this is set, so the agent's next job takes the
6071
- * new-session path: its project is restored from the verified backup and its first turn carries
6072
- * memory and recent episodes. That job records the rollover (reason `idle_parked`) and clears
6073
- * this. Optional, so a worker that predates parking drops it and still takes the same path.
6074
- */
6075
- parkedSession: z46.object({
6076
- sessionId: z46.string().min(1).max(256),
6077
- parkedAt: z46.string().datetime(),
6078
- items: z46.number().int().nonnegative()
6079
- }).optional(),
6080
- /**
6081
- * The agent asked for a workspace from a session with no sandbox (`request_workspace`,
6082
- * ADR-0194), so its sessions keep a sandbox from its next job on. Never cleared by the runtime.
6083
- */
6084
- workspaceRequested: z46.literal(true).optional(),
6085
- /**
6086
- * The agent's Taskmarket MCP credential (ADR-0207), kept across sessions. Cleared once
6087
- * a session without the server is created and the credential is retired.
6088
- */
6089
- mcpCredential: DirectMcpCredentialSchema.optional(),
6090
- /**
6091
- * The hosted sandbox under the current session (ADR-0192, ADR-0193). Keyed by session, so a new
6092
- * session starts with none, and a session created before it was recorded keeps the behaviour it
6093
- * had until it is replaced.
6094
- */
6095
- sandbox: z46.object({
6096
- sessionId: z46.string().min(1).max(256),
6097
- /** The container size the session was created with; absent when it requested none. */
6098
- requestedSize: z46.enum(SANDBOX_CONTAINER_SIZES).optional(),
6099
- /** The effective size the provider reports for it, or null while it reports none. */
6100
- reportedSize: z46.enum(SANDBOX_CONTAINER_SIZES).nullable().optional(),
6101
- /** The session was created with the identity sentinel's setup command. */
6102
- sentinel: z46.literal(true).optional(),
6103
- /** The sentinel's file name in the sandbox the session's work is known to be on. */
6104
- identity: z46.string().uuid().optional()
6105
- }).optional(),
6106
- /**
6107
- * The platform skill files the current session was created with (ADR-0203): what they
6108
- * hold (`docsHash`) and the sizes its sandbox lists them at (`inventoryHash`). A deploy that
6109
- * changes only those files keeps the session on them; the next session records its own. Keyed
6110
- * by session, so a session created before it was recorded is checked against the deployed bundle,
6111
- * as before. A session with no sandbox has none.
6112
- */
6113
- skillBundle: z46.object({
6114
- sessionId: z46.string().min(1).max(256),
6115
- docsHash: z46.string().regex(/^[a-f0-9]{64}$/),
6116
- inventoryHash: z46.string().regex(/^[a-f0-9]{64}$/)
6117
- }).optional(),
6118
- /**
6119
- * The owner's session reset (`hosted_agents.session_reset_version`) this checkpoint has handled.
6120
- * A higher version on the agent means the next job, or the session sweeper, detaches the
6121
- * current session and any pending job into `detached` and the agent starts a new session.
6122
- */
6123
- sessionReset: z46.object({ version: z46.number().int().nonnegative(), at: z46.string().datetime() }).optional(),
6124
- /** Sessions a reset detached that are not settled yet (see `DirectDetachedSessionSchema`). */
6125
- detached: z46.array(DirectDetachedSessionSchema).max(DIRECT_DETACHED_MAX).optional(),
6126
- turns: z46.number().int().nonnegative(),
6127
- expiresAt: z46.number(),
6128
- persistent: z46.boolean().optional(),
6129
- project: z46.object({
6130
- version: z46.literal(1),
6131
- setupHash: z46.string().regex(/^[a-f0-9]{64}$/),
6132
- snapshot: DirectProjectSnapshotSchema.nullable(),
6133
- restoring: z46.boolean().default(false),
6134
- restoreSetupHash: z46.string().regex(/^[a-f0-9]{64}$/).optional(),
6135
- restoreConfiguration: DirectRuntimeConfigurationSchema.optional(),
6136
- // `contextPending` and `context` (conversation excerpts) were removed by SM-35; checkpoints
6137
- // that still carry them parse, and the unknown keys are dropped on the next save.
6138
- /** Recent retired session ids, newest last (at most DIRECT_RETIRED_SESSIONS_KEPT kept). */
6139
- retiredSessions: z46.array(z46.string().min(1).max(256)).max(100).default([]),
6140
- /**
6141
- * Retired sessions still to delete at the provider (SM-34). Absent in checkpoints written
6142
- * before deletion existed; those start from their `retiredSessions`.
6143
- */
6144
- sessionsToDelete: z46.array(z46.string().min(1).max(256)).max(DIRECT_SESSIONS_TO_DELETE_MAX).optional()
6145
- }).optional(),
6146
- pending: DirectPendingSchema.nullable(),
6147
- result: z46.object({
6148
- jobId: z46.string(),
6149
- runId: z46.string().uuid(),
6150
- text: z46.string().max(65536),
6151
- errorCode: z46.string().optional()
6152
- }).optional()
6153
- });
6154
-
6155
- // ../../packages/shared/dist/schemas/swarm-chain.schemas.js
6156
- import { z as z47 } from "zod";
6157
- var SwarmChainIdSchema = z47.union([z47.literal(8453), z47.literal(84532)]);
6158
- var SWARM_CONSENT_TEXT_VERSIONS = [
6159
- "swarm-testnet-v1",
6160
- "swarm-testnet-pilot-v1",
6161
- "swarm-mainnet-v1",
6162
- "swarm-mainnet-pilot-v1",
6163
- // Implements: ADR-0183. Swarm YOLO mode: any recipient within the caps for a standing period.
6164
- "swarm-testnet-yolo-v1",
6165
- "swarm-testnet-yolo-pilot-v1",
6166
- "swarm-mainnet-yolo-v1",
6167
- "swarm-mainnet-yolo-pilot-v1",
6168
- // Implements: ADR-0185. Standing free market actions only: no payment rule of any kind.
6169
- "swarm-testnet-market-v1",
6170
- "swarm-mainnet-market-v1",
6171
- // Per ADR-0212. Standing YOLO: any recipient within the caps, with no end date, until revoked.
6172
- "swarm-testnet-standing-v1",
6173
- "swarm-testnet-standing-pilot-v1",
6174
- "swarm-mainnet-standing-v1",
6175
- "swarm-mainnet-standing-pilot-v1"
6176
- ];
6177
- var SWARM_CHAINS = Object.freeze({
6178
- 8453: Object.freeze({
6179
- chainId: 8453,
6180
- caip2: "eip155:8453",
6181
- name: "Base",
6182
- testnet: false,
6183
- usdc: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
6184
- usdcDomainName: "USD Coin",
6185
- usdcDomainVersion: "2",
6186
- publicRpcUrl: "https://mainnet.base.org",
6187
- qualifiedRpcOrigins: Object.freeze([
6188
- "https://mainnet.base.org",
6189
- "https://base-mainnet.rpc.privy.systems"
6190
- ]),
6191
- explorerUrl: "https://basescan.org",
6192
- identityRegistry: "0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",
6193
- consentVersion: "swarm-mainnet-v1",
6194
- pilotConsentVersion: "swarm-mainnet-pilot-v1",
6195
- yoloConsentVersion: "swarm-mainnet-yolo-v1",
6196
- yoloPilotConsentVersion: "swarm-mainnet-yolo-pilot-v1",
6197
- marketConsentVersion: "swarm-mainnet-market-v1",
6198
- standingConsentVersion: "swarm-mainnet-standing-v1",
6199
- standingPilotConsentVersion: "swarm-mainnet-standing-pilot-v1"
6200
- }),
6201
- 84532: Object.freeze({
6202
- chainId: 84532,
6203
- caip2: "eip155:84532",
6204
- name: "Base Sepolia",
6205
- testnet: true,
6206
- usdc: "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
6207
- usdcDomainName: "USDC",
6208
- usdcDomainVersion: "2",
6209
- publicRpcUrl: "https://sepolia.base.org",
6210
- qualifiedRpcOrigins: Object.freeze([
6211
- "https://sepolia.base.org",
6212
- "https://base-sepolia.rpc.privy.systems"
6213
- ]),
6214
- explorerUrl: "https://sepolia.basescan.org",
6215
- identityRegistry: "0x8004A818BFB912233c491871b3d84c89A494BD9e",
6216
- consentVersion: "swarm-testnet-v1",
6217
- pilotConsentVersion: "swarm-testnet-pilot-v1",
6218
- yoloConsentVersion: "swarm-testnet-yolo-v1",
6219
- yoloPilotConsentVersion: "swarm-testnet-yolo-pilot-v1",
6220
- marketConsentVersion: "swarm-testnet-market-v1",
6221
- standingConsentVersion: "swarm-testnet-standing-v1",
6222
- standingPilotConsentVersion: "swarm-testnet-standing-pilot-v1"
6223
- })
6382
+ * including turns of jobs that failed. Keyed by session, so a new session starts from zero with
6383
+ * no reset code. The next job rolls over once it passes the threshold (never above the per-turn
6384
+ * scan cap), or when the session ran out of context.
6385
+ */
6386
+ sessionUsage: z47.object({
6387
+ sessionId: z47.string().min(1).max(256),
6388
+ items: z47.number().int().nonnegative(),
6389
+ contextExceeded: z47.boolean().optional(),
6390
+ /**
6391
+ * The provider refused this session further work: a safety system blocked its conversation
6392
+ * (`policy_blocked`) or it reached its usage budget (`session_budget`). Or the host refused a
6393
+ * native helper that asked for another model (`helper_model`, ADR-0204), which
6394
+ * stays open in it. The next job starts a new session with this as the rollover reason, the
6395
+ * way `contextExceeded` does.
6396
+ */
6397
+ retire: z47.enum(["policy_blocked", "session_budget", "helper_model"]).optional()
6398
+ }).optional(),
6399
+ /**
6400
+ * The live session the idle sweeper deleted at the provider (parked) after the agent's last job
6401
+ * went idle. `sessionId` above is null while this is set, so the agent's next job takes the
6402
+ * new-session path: its project is restored from the verified backup and its first turn carries
6403
+ * memory and recent episodes. That job records the rollover (reason `idle_parked`) and clears
6404
+ * this. Optional, so a worker that predates parking drops it and still takes the same path.
6405
+ */
6406
+ parkedSession: z47.object({
6407
+ sessionId: z47.string().min(1).max(256),
6408
+ parkedAt: z47.string().datetime(),
6409
+ items: z47.number().int().nonnegative()
6410
+ }).optional(),
6411
+ /**
6412
+ * The agent asked for a workspace from a session with no sandbox (`request_workspace`,
6413
+ * ADR-0194), so its sessions keep a sandbox from its next job on. Never cleared by the runtime.
6414
+ */
6415
+ workspaceRequested: z47.literal(true).optional(),
6416
+ /**
6417
+ * The agent's Taskmarket MCP credential (ADR-0207), kept across sessions. Cleared once
6418
+ * a session without the server is created and the credential is retired.
6419
+ */
6420
+ mcpCredential: DirectMcpCredentialSchema.optional(),
6421
+ /**
6422
+ * The hosted sandbox under the current session (ADR-0192, ADR-0193). Keyed by session, so a new
6423
+ * session starts with none, and a session created before it was recorded keeps the behaviour it
6424
+ * had until it is replaced.
6425
+ */
6426
+ sandbox: z47.object({
6427
+ sessionId: z47.string().min(1).max(256),
6428
+ /** The container size the session was created with; absent when it requested none. */
6429
+ requestedSize: z47.enum(SANDBOX_CONTAINER_SIZES).optional(),
6430
+ /** The effective size the provider reports for it, or null while it reports none. */
6431
+ reportedSize: z47.enum(SANDBOX_CONTAINER_SIZES).nullable().optional(),
6432
+ /** The session was created with the identity sentinel's setup command. */
6433
+ sentinel: z47.literal(true).optional(),
6434
+ /** The sentinel's file name in the sandbox the session's work is known to be on. */
6435
+ identity: z47.string().uuid().optional()
6436
+ }).optional(),
6437
+ /**
6438
+ * The platform skill files the current session was created with (ADR-0203): what they
6439
+ * hold (`docsHash`) and the sizes its sandbox lists them at (`inventoryHash`). A deploy that
6440
+ * changes only those files keeps the session on them; the next session records its own. Keyed
6441
+ * by session, so a session created before it was recorded is checked against the deployed bundle,
6442
+ * as before. A session with no sandbox has none.
6443
+ */
6444
+ skillBundle: z47.object({
6445
+ sessionId: z47.string().min(1).max(256),
6446
+ docsHash: z47.string().regex(/^[a-f0-9]{64}$/),
6447
+ inventoryHash: z47.string().regex(/^[a-f0-9]{64}$/)
6448
+ }).optional(),
6449
+ /**
6450
+ * The owner's session reset (`hosted_agents.session_reset_version`) this checkpoint has handled.
6451
+ * A higher version on the agent means the next job, or the session sweeper, detaches the
6452
+ * current session and any pending job into `detached` and the agent starts a new session.
6453
+ */
6454
+ sessionReset: z47.object({ version: z47.number().int().nonnegative(), at: z47.string().datetime() }).optional(),
6455
+ /** Sessions a reset detached that are not settled yet (see `DirectDetachedSessionSchema`). */
6456
+ detached: z47.array(DirectDetachedSessionSchema).max(DIRECT_DETACHED_MAX).optional(),
6457
+ turns: z47.number().int().nonnegative(),
6458
+ expiresAt: z47.number(),
6459
+ persistent: z47.boolean().optional(),
6460
+ project: z47.object({
6461
+ version: z47.literal(1),
6462
+ setupHash: z47.string().regex(/^[a-f0-9]{64}$/),
6463
+ snapshot: DirectProjectSnapshotSchema.nullable(),
6464
+ restoring: z47.boolean().default(false),
6465
+ restoreSetupHash: z47.string().regex(/^[a-f0-9]{64}$/).optional(),
6466
+ restoreConfiguration: DirectRuntimeConfigurationSchema.optional(),
6467
+ // `contextPending` and `context` (conversation excerpts) were removed by SM-35; checkpoints
6468
+ // that still carry them parse, and the unknown keys are dropped on the next save.
6469
+ /** Recent retired session ids, newest last (at most DIRECT_RETIRED_SESSIONS_KEPT kept). */
6470
+ retiredSessions: z47.array(z47.string().min(1).max(256)).max(100).default([]),
6471
+ /**
6472
+ * Retired sessions still to delete at the provider (SM-34). Absent in checkpoints written
6473
+ * before deletion existed; those start from their `retiredSessions`.
6474
+ */
6475
+ sessionsToDelete: z47.array(z47.string().min(1).max(256)).max(DIRECT_SESSIONS_TO_DELETE_MAX).optional()
6476
+ }).optional(),
6477
+ pending: DirectPendingSchema.nullable(),
6478
+ result: z47.object({
6479
+ jobId: z47.string(),
6480
+ runId: z47.string().uuid(),
6481
+ text: z47.string().max(65536),
6482
+ errorCode: z47.string().optional()
6483
+ }).optional()
6224
6484
  });
6225
- function isSwarmChainId(value) {
6226
- return value === 8453 || value === 84532;
6227
- }
6228
6485
 
6229
6486
  // ../../packages/shared/dist/schemas/swarm-wallet.schemas.js
6230
6487
  import { z as z48 } from "zod";
@@ -8246,193 +8503,6 @@ var MemoryMaintenanceEnvironmentSchema = z69.object({
8246
8503
  PROJECT_BACKUP_KEEP_SNAPSHOTS: z69.coerce.number().int().min(1).max(1e3).default(PROJECT_BACKUP_KEEP_SNAPSHOTS)
8247
8504
  });
8248
8505
 
8249
- // ../../packages/shared/dist/chains/registry.js
8250
- import { base, baseSepolia, foundry, tempo, tempoModerato } from "viem/chains";
8251
- var TASKMARKET_CHAIN_IDS = [8453, 84532, 4217, 42431, 31337];
8252
- function paymentProtocolFor(method) {
8253
- return method === "mpp-tempo" ? "mpp" : "x402";
8254
- }
8255
- var ERC8004_MAINNET = {
8256
- identityRegistry: "0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",
8257
- reputationRegistry: "0x8004BAa17C55a88189AE136b182e5fdA19dE9b63"
8258
- };
8259
- var ERC8004_TESTNET = {
8260
- identityRegistry: "0x8004A818BFB912233c491871b3d84c89A494BD9e",
8261
- reputationRegistry: "0x8004B663056A597Dffe9eCcC1965A193B7388713"
8262
- };
8263
- var OUSD = "0x20c0000000000000000000006a37da5c996874be";
8264
- var PATH_USD = "0x20c0000000000000000000000000000000000000";
8265
- var TEMPO_PROTOCOL = {
8266
- feeManager: "0xfeEC000000000000000000000000000000000000",
8267
- tip403Registry: "0x403c000000000000000000000000000000000000",
8268
- receivePolicyGuard: "0xB10C000000000000000000000000000000000000",
8269
- stablecoinDex: "0xDEc0000000000000000000000000000000000000"
8270
- };
8271
- var baseFeatures = (chainId) => ({
8272
- swarmWallets: isSwarmChainId(chainId),
8273
- catalog: true,
8274
- cctpFunding: true,
8275
- relayFunding: chainId === 8453,
8276
- dreamsRewards: true,
8277
- receivePolicies: false
8278
- });
8279
- var TEMPO_FEATURES = {
8280
- swarmWallets: false,
8281
- catalog: false,
8282
- cctpFunding: false,
8283
- relayFunding: false,
8284
- dreamsRewards: false,
8285
- receivePolicies: true
8286
- };
8287
- var tempoPayment = {
8288
- token: OUSD,
8289
- symbol: "OUSD",
8290
- decimals: 6,
8291
- domain: { name: "OpenUSD", version: "1" },
8292
- method: "mpp-tempo"
8293
- };
8294
- var TEMPO_RATE_TASK_GAS_LIMIT = 1500000n;
8295
- var tempoFees = { kind: "tip20", token: OUSD, fallbackToken: PATH_USD };
8296
- function deepFreeze(value) {
8297
- for (const [key, nested] of Object.entries(value)) {
8298
- if (key === "viemChain")
8299
- continue;
8300
- if (nested && typeof nested === "object" && !Object.isFrozen(nested))
8301
- deepFreeze(nested);
8302
- }
8303
- return Object.freeze(value);
8304
- }
8305
- function freeze(chain) {
8306
- return deepFreeze(chain);
8307
- }
8308
- var TASKMARKET_CHAINS = Object.freeze({
8309
- 8453: freeze({
8310
- chainId: 8453,
8311
- caip2: "eip155:8453",
8312
- name: "Base",
8313
- testnet: false,
8314
- viemChain: base,
8315
- publicRpcUrl: SWARM_CHAINS[8453].publicRpcUrl,
8316
- explorerUrl: SWARM_CHAINS[8453].explorerUrl,
8317
- payment: {
8318
- token: SWARM_CHAINS[8453].usdc,
8319
- symbol: "USDC",
8320
- decimals: 6,
8321
- domain: { name: SWARM_CHAINS[8453].usdcDomainName, version: "2" },
8322
- method: "eip3009"
8323
- },
8324
- fees: { kind: "native" },
8325
- blockTimeMs: 2e3,
8326
- rateTaskGasLimit: 1500000n,
8327
- indexer: { head: "latest", logRangeBlocks: 1e4 },
8328
- erc8004: { ...ERC8004_MAINNET },
8329
- features: baseFeatures(8453)
8330
- }),
8331
- 84532: freeze({
8332
- chainId: 84532,
8333
- caip2: "eip155:84532",
8334
- name: "Base Sepolia",
8335
- testnet: true,
8336
- viemChain: baseSepolia,
8337
- publicRpcUrl: SWARM_CHAINS[84532].publicRpcUrl,
8338
- explorerUrl: SWARM_CHAINS[84532].explorerUrl,
8339
- payment: {
8340
- token: SWARM_CHAINS[84532].usdc,
8341
- symbol: "USDC",
8342
- decimals: 6,
8343
- domain: { name: SWARM_CHAINS[84532].usdcDomainName, version: "2" },
8344
- method: "eip3009"
8345
- },
8346
- fees: { kind: "native" },
8347
- blockTimeMs: 2e3,
8348
- rateTaskGasLimit: 1500000n,
8349
- indexer: { head: "latest", logRangeBlocks: 1e4 },
8350
- erc8004: { ...ERC8004_TESTNET },
8351
- features: baseFeatures(84532)
8352
- }),
8353
- 4217: freeze({
8354
- chainId: 4217,
8355
- caip2: "eip155:4217",
8356
- name: "Tempo",
8357
- testnet: false,
8358
- viemChain: tempo,
8359
- publicRpcUrl: tempo.rpcUrls.default.http[0],
8360
- explorerUrl: "https://explore.tempo.xyz",
8361
- payment: { ...tempoPayment, domain: { ...tempoPayment.domain } },
8362
- fees: { ...tempoFees },
8363
- blockTimeMs: 1e3,
8364
- rateTaskGasLimit: TEMPO_RATE_TASK_GAS_LIMIT,
8365
- // Tempo finality is deterministic and fast; until the provider's eth_getLogs limit is
8366
- // measured (#907), keep the same range as Base.
8367
- indexer: { head: "finalized", logRangeBlocks: 1e4 },
8368
- erc8004: { ...ERC8004_MAINNET },
8369
- features: { ...TEMPO_FEATURES },
8370
- tempo: { ...TEMPO_PROTOCOL, paymentTokenPolicyId: 2 }
8371
- }),
8372
- 42431: freeze({
8373
- chainId: 42431,
8374
- caip2: "eip155:42431",
8375
- name: "Tempo Moderato",
8376
- testnet: true,
8377
- viemChain: tempoModerato,
8378
- publicRpcUrl: tempoModerato.rpcUrls.default.http[0],
8379
- explorerUrl: "https://explore.testnet.tempo.xyz",
8380
- payment: { ...tempoPayment, domain: { ...tempoPayment.domain } },
8381
- fees: { ...tempoFees },
8382
- blockTimeMs: 1e3,
8383
- rateTaskGasLimit: TEMPO_RATE_TASK_GAS_LIMIT,
8384
- indexer: { head: "finalized", logRangeBlocks: 1e4 },
8385
- erc8004: { ...ERC8004_TESTNET },
8386
- features: { ...TEMPO_FEATURES },
8387
- tempo: { ...TEMPO_PROTOCOL, paymentTokenPolicyId: 1 }
8388
- }),
8389
- 31337: freeze({
8390
- chainId: 31337,
8391
- caip2: "eip155:31337",
8392
- name: "Local",
8393
- testnet: true,
8394
- viemChain: foundry,
8395
- publicRpcUrl: "http://127.0.0.1:8545",
8396
- explorerUrl: "",
8397
- // The local mock token is deployed per run; its address comes from the environment.
8398
- payment: {
8399
- token: void 0,
8400
- symbol: "USDC",
8401
- decimals: 6,
8402
- domain: { name: "USD Coin", version: "2" },
8403
- method: "eip3009"
8404
- },
8405
- fees: { kind: "native" },
8406
- blockTimeMs: 1e3,
8407
- rateTaskGasLimit: 1500000n,
8408
- indexer: { head: "latest", logRangeBlocks: 1e4 },
8409
- erc8004: void 0,
8410
- features: {
8411
- swarmWallets: false,
8412
- catalog: false,
8413
- cctpFunding: false,
8414
- relayFunding: false,
8415
- dreamsRewards: true,
8416
- receivePolicies: false
8417
- }
8418
- })
8419
- });
8420
- var UnknownChainError = class extends Error {
8421
- constructor(chainId) {
8422
- super(`Taskmarket does not support chain ${String(chainId)}`);
8423
- this.name = "UnknownChainError";
8424
- this.chainId = chainId;
8425
- }
8426
- };
8427
- function isTaskmarketChainId(value) {
8428
- return TASKMARKET_CHAIN_IDS.includes(value);
8429
- }
8430
- function taskmarketChain(chainId) {
8431
- if (!isTaskmarketChainId(chainId))
8432
- throw new UnknownChainError(chainId);
8433
- return TASKMARKET_CHAINS[chainId];
8434
- }
8435
-
8436
8506
  // src/lib/home.ts
8437
8507
  import os from "os";
8438
8508
  import path from "path";
@@ -15892,7 +15962,8 @@ async function createMppTempoCredential(input2) {
15892
15962
  const expiresSeconds = Math.floor(Date.parse(challenge.expires) / 1e3);
15893
15963
  if (!Number.isFinite(expiresSeconds) || expiresSeconds <= nowSeconds)
15894
15964
  throw challengeRefused("The Payment challenge has expired");
15895
- const validBefore = Math.min(nowSeconds + (input2.validitySeconds ?? MPP_TEMPO_DEFAULT_VALIDITY_SECONDS), expiresSeconds + 30);
15965
+ const validitySeconds = clampValidityWindowSeconds(input2.validitySeconds ?? MPP_TEMPO_DEFAULT_VALIDITY_SECONDS, TEMPO_MAX_VALIDITY_WINDOW_SECONDS);
15966
+ const validBefore = Math.min(nowSeconds + validitySeconds, expiresSeconds + 30);
15896
15967
  const memo = mppAttributionMemo({
15897
15968
  realm: challenge.realm,
15898
15969
  challengeId: challenge.id,
@@ -15992,9 +16063,11 @@ export {
15992
16063
  buildSponsoredTaskVaultReviewRequestMessage,
15993
16064
  usdcToBaseUnits,
15994
16065
  formatUsdcBaseUnits,
16066
+ taskmarketChain,
16067
+ clientValidityWindowSeconds,
16068
+ paymentTokenSymbol,
15995
16069
  buildLegalReceiptHeaders,
15996
16070
  buildWalletLegalAcceptanceMessage,
15997
- taskmarketChain,
15998
16071
  getTaskmarketHome,
15999
16072
  generateKeypair,
16000
16073
  encryptPrivateKey,