@intentic/sandbox-contract 1.224.0 → 1.226.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/README.md +14 -14
  2. package/dist/agent-catalog.d.ts +2 -0
  3. package/dist/agent-catalog.d.ts.map +1 -1
  4. package/dist/agent-catalog.js +19 -3
  5. package/dist/agent-catalog.js.map +1 -1
  6. package/dist/chores/chores.js +42 -42
  7. package/dist/chores/chores.js.map +1 -1
  8. package/dist/chores/extension-update.js +2 -2
  9. package/dist/chores/extension-update.js.map +1 -1
  10. package/dist/chores/fix-deps.js +1 -1
  11. package/dist/chores/fix-deps.js.map +1 -1
  12. package/dist/chores/probes.js +1 -1
  13. package/dist/chores/probes.js.map +1 -1
  14. package/dist/chores/verdict.js +2 -2
  15. package/dist/chores/verdict.js.map +1 -1
  16. package/dist/contracts/capabilities.contract.d.ts +41 -0
  17. package/dist/contracts/capabilities.contract.d.ts.map +1 -1
  18. package/dist/contracts/exit.contract.d.ts +80 -0
  19. package/dist/contracts/exit.contract.d.ts.map +1 -0
  20. package/dist/contracts/exit.contract.js +13 -0
  21. package/dist/contracts/exit.contract.js.map +1 -0
  22. package/dist/contracts/settings.contract.d.ts +12 -0
  23. package/dist/contracts/settings.contract.d.ts.map +1 -1
  24. package/dist/events.d.ts +4 -4
  25. package/dist/events.d.ts.map +1 -1
  26. package/dist/events.js +5 -5
  27. package/dist/events.js.map +1 -1
  28. package/dist/fast-tier.d.ts +9 -0
  29. package/dist/fast-tier.d.ts.map +1 -0
  30. package/dist/fast-tier.js +19 -0
  31. package/dist/fast-tier.js.map +1 -0
  32. package/dist/history-state.js +3 -3
  33. package/dist/history-state.js.map +1 -1
  34. package/dist/index.d.ts +203 -68
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +5 -0
  37. package/dist/index.js.map +1 -1
  38. package/dist/model-order.d.ts +1 -0
  39. package/dist/model-order.d.ts.map +1 -1
  40. package/dist/model-order.js +5 -0
  41. package/dist/model-order.js.map +1 -1
  42. package/dist/output-fields.d.ts.map +1 -1
  43. package/dist/output-fields.js +2 -2
  44. package/dist/output-fields.js.map +1 -1
  45. package/dist/prompt-complexity.d.ts +19 -0
  46. package/dist/prompt-complexity.d.ts.map +1 -0
  47. package/dist/prompt-complexity.js +83 -0
  48. package/dist/prompt-complexity.js.map +1 -0
  49. package/dist/publish-drafts.js +2 -2
  50. package/dist/publish-drafts.js.map +1 -1
  51. package/dist/schemas.d.ts +214 -0
  52. package/dist/schemas.d.ts.map +1 -1
  53. package/dist/schemas.js +113 -2
  54. package/dist/schemas.js.map +1 -1
  55. package/dist/workflow-faults.js +3 -3
  56. package/dist/workflow-faults.js.map +1 -1
  57. package/dist/workspace-state.d.ts +20 -20
  58. package/dist/workspace-state.d.ts.map +1 -1
  59. package/dist/workspace-state.js +20 -20
  60. package/dist/workspace-state.js.map +1 -1
  61. package/package.json +5 -5
  62. package/src/agent-catalog.test.ts +72 -27
  63. package/src/agent-catalog.ts +91 -3
  64. package/src/agent-run-model.test.ts +3 -3
  65. package/src/capability-ledger.test.ts +34 -15
  66. package/src/chores/chores.test.ts +1 -1
  67. package/src/chores/chores.ts +42 -42
  68. package/src/chores/digest.test.ts +1 -1
  69. package/src/chores/extension-update.ts +2 -2
  70. package/src/chores/fix-deps.ts +1 -1
  71. package/src/chores/probes.test.ts +6 -6
  72. package/src/chores/probes.ts +1 -1
  73. package/src/chores/stack.test.ts +3 -3
  74. package/src/chores/verdict.test.ts +20 -20
  75. package/src/chores/verdict.ts +2 -2
  76. package/src/contract-lock.test.ts +1 -1
  77. package/src/contracts/exit.contract.ts +42 -0
  78. package/src/contracts/providers.contract.ts +1 -1
  79. package/src/conversation-ids.ts +1 -1
  80. package/src/events.test.ts +3 -3
  81. package/src/events.ts +6 -6
  82. package/src/fast-tier.test.ts +88 -0
  83. package/src/fast-tier.ts +72 -0
  84. package/src/history-state.ts +3 -3
  85. package/src/hostnames.test.ts +1 -1
  86. package/src/index.ts +5 -0
  87. package/src/model-order.test.ts +11 -11
  88. package/src/model-order.ts +22 -0
  89. package/src/output-fields.ts +2 -2
  90. package/src/path-refs.test.ts +4 -4
  91. package/src/prompt-complexity.test.ts +160 -0
  92. package/src/prompt-complexity.ts +271 -0
  93. package/src/publish-drafts.ts +2 -2
  94. package/src/quick-model.test.ts +11 -11
  95. package/src/routes.test.ts +11 -5
  96. package/src/runtime-state.test.ts +1 -1
  97. package/src/schemas.test.ts +8 -8
  98. package/src/schemas.ts +311 -6
  99. package/src/search-globs.test.ts +2 -2
  100. package/src/share-paths.test.ts +1 -1
  101. package/src/title.test.ts +9 -9
  102. package/src/title.ts +1 -1
  103. package/src/tunnel-ids.test.ts +3 -3
  104. package/src/versions.test.ts +3 -3
  105. package/src/versions.ts +1 -1
  106. package/src/workflow-faults.test.ts +6 -6
  107. package/src/workflow-faults.ts +3 -3
  108. package/src/workspace-state.test.ts +32 -32
  109. package/src/workspace-state.ts +20 -20
package/dist/schemas.js CHANGED
@@ -573,6 +573,8 @@ export const SandboxSettingsSchema = z.object({
573
573
  changelogRepos: z.array(z.string()).max(50).default([]),
574
574
  agentRunModels: z.array(z.string()).max(10).default([]),
575
575
  agentRunEffort: z.string().default(""),
576
+ autoTier: z.enum(["off", "shadow", "on"]).default("shadow"),
577
+ autoFastModels: z.array(z.string()).max(10).default([]),
576
578
  agentRetentionDays: z.number().min(0).max(365).default(3),
577
579
  resumeAfterOutage: z.boolean().default(false),
578
580
  autoResumeOnRestart: z.boolean().default(false),
@@ -1071,12 +1073,14 @@ export const CapabilityKindSchema = z.enum([
1071
1073
  "extension",
1072
1074
  "ssh",
1073
1075
  "vpn",
1076
+ "exit",
1074
1077
  "docker",
1075
1078
  "browser",
1076
1079
  "identity",
1077
1080
  "host",
1078
1081
  "agent",
1079
1082
  "endpoint",
1083
+ "localmodel",
1080
1084
  "wallet",
1081
1085
  ]);
1082
1086
  export const CapabilityStateSchema = z.enum(["active", "pending", "error", "inactive"]);
@@ -1131,7 +1135,7 @@ export const VpnProviderSchema = z.enum(["wireguard", "fortinet", "ipsec"]);
1131
1135
  const autoConnect = z.enum(["on", "off"]).default("on");
1132
1136
  export const isForticlientCiphertext = (value) => /^Enc[X]?\s+[0-9A-Fa-f]{8,}$/.test(value.trim());
1133
1137
  const notForticlientCiphertext = (field, label) => field.refine((value) => !isForticlientCiphertext(value), {
1134
- message: `That looks like a value copied straight out of a FortiClient config FortiClient encrypts it with a key tied to the machine that exported it, so it can't be used here. Enter the actual ${label} (ask whoever administers the gateway).`,
1138
+ message: `That looks like a value copied straight out of a FortiClient config, FortiClient encrypts it with a key tied to the machine that exported it, so it can't be used here. Enter the actual ${label} (ask whoever administers the gateway).`,
1135
1139
  });
1136
1140
  export const WireguardVpnConfigSchema = z.object({
1137
1141
  provider: z.literal("wireguard"),
@@ -1172,6 +1176,29 @@ export const IpsecVpnConfigSchema = z.object({
1172
1176
  autoConnect,
1173
1177
  });
1174
1178
  export const VpnConfigSchema = z.discriminatedUnion("provider", [WireguardVpnConfigSchema, FortinetVpnConfigSchema, IpsecVpnConfigSchema]);
1179
+ export const ExitProviderSchema = z.enum(["tor", "vpngate", "wireguard"]);
1180
+ export const CountryCodeSchema = z
1181
+ .string()
1182
+ .regex(/^[A-Za-z]{2}$/, "A country is its two-letter code, like DE, US or JP.")
1183
+ .transform((value) => value.toUpperCase());
1184
+ const autoStart = z.enum(["on", "off"]).default("off");
1185
+ export const TorExitConfigSchema = z.object({
1186
+ provider: z.literal("tor"),
1187
+ country: CountryCodeSchema.optional(),
1188
+ autoStart,
1189
+ });
1190
+ export const VpngateExitConfigSchema = z.object({
1191
+ provider: z.literal("vpngate"),
1192
+ country: CountryCodeSchema.optional(),
1193
+ autoStart,
1194
+ });
1195
+ export const WireguardExitConfigSchema = z.object({
1196
+ provider: z.literal("wireguard"),
1197
+ config: z.string().min(1),
1198
+ country: CountryCodeSchema.optional(),
1199
+ autoStart,
1200
+ });
1201
+ export const ExitConfigSchema = z.discriminatedUnion("provider", [TorExitConfigSchema, VpngateExitConfigSchema, WireguardExitConfigSchema]);
1175
1202
  export const DockerConfigSchema = z.object({
1176
1203
  gpu: z.enum(["on", "off"]).default("off"),
1177
1204
  registryMirror: z.url().optional(),
@@ -1186,6 +1213,7 @@ export const BrowserConfigSchema = z
1186
1213
  identity: z.string().optional(),
1187
1214
  purpose: z.string().optional(),
1188
1215
  openedAt: z.string().optional(),
1216
+ exit: z.string().optional(),
1189
1217
  })
1190
1218
  .catchall(z.string());
1191
1219
  export const IdentityConfigSchema = z.object({
@@ -1194,6 +1222,7 @@ export const IdentityConfigSchema = z.object({
1194
1222
  mailbox: z.string().optional(),
1195
1223
  loginUrl: z.url().optional(),
1196
1224
  openAccounts: z.enum(["on", "off"]).default("off"),
1225
+ exit: z.string().optional(),
1197
1226
  });
1198
1227
  const hostScope = z.enum(["on", "off"]);
1199
1228
  export const HostScopesSchema = z.object({
@@ -1219,7 +1248,12 @@ export const EndpointConfigSchema = z.object({
1219
1248
  apiKey: z.string().optional(),
1220
1249
  headers: z.string().optional(),
1221
1250
  });
1222
- const usdAmount = z.string().regex(/^\d+(\.\d{1,6})?$/, "a USD amount like 0.50 (up to six decimals — USDC's own precision)");
1251
+ export const LocalModelConfigSchema = z.object({
1252
+ model: z.string().min(1),
1253
+ gpu: z.enum(["on", "off"]).default("off"),
1254
+ url: z.url().optional(),
1255
+ });
1256
+ const usdAmount = z.string().regex(/^\d+(\.\d{1,6})?$/, "a USD amount like 0.50 (up to six decimals: USDC's own precision)");
1223
1257
  export const WalletNetworkSchema = z.enum(["eip155:8453", "eip155:84532"]);
1224
1258
  export const WalletConfigSchema = z.object({
1225
1259
  network: WalletNetworkSchema.default("eip155:8453"),
@@ -1241,12 +1275,14 @@ export const CapabilitySchema = z.discriminatedUnion("kind", [
1241
1275
  z.object({ id: entryId, kind: z.literal("extension"), config: ExtensionConfigSchema }),
1242
1276
  z.object({ id: entryId, kind: z.literal("ssh"), config: SshConfigSchema }),
1243
1277
  z.object({ id: entryId, kind: z.literal("vpn"), config: VpnConfigSchema }),
1278
+ z.object({ id: entryId, kind: z.literal("exit"), config: ExitConfigSchema }),
1244
1279
  z.object({ id: entryId, kind: z.literal("docker"), config: DockerConfigSchema }),
1245
1280
  z.object({ id: entryId, kind: z.literal("browser"), config: BrowserConfigSchema }),
1246
1281
  z.object({ id: entryId, kind: z.literal("identity"), config: IdentityConfigSchema }),
1247
1282
  z.object({ id: entryId, kind: z.literal("host"), config: HostConfigSchema }),
1248
1283
  z.object({ id: entryId, kind: z.literal("agent"), config: AcpAgentConfigSchema }),
1249
1284
  z.object({ id: entryId, kind: z.literal("endpoint"), config: EndpointConfigSchema }),
1285
+ z.object({ id: entryId, kind: z.literal("localmodel"), config: LocalModelConfigSchema }),
1250
1286
  z.object({ id: entryId, kind: z.literal("wallet"), config: WalletConfigSchema }),
1251
1287
  ]);
1252
1288
  export const PersonaPowersSchema = z.object({
@@ -1408,6 +1444,78 @@ export const ForticlientConnectionSchema = z.object({
1408
1444
  needs: z.array(z.string()),
1409
1445
  });
1410
1446
  export const ForticlientImportSchema = z.object({ connections: z.array(ForticlientConnectionSchema) });
1447
+ export const ExitStateSchema = z.enum([
1448
+ "up",
1449
+ "starting",
1450
+ "down",
1451
+ "unavailable",
1452
+ "failed",
1453
+ ]);
1454
+ export const ExitObservationSchema = z.object({
1455
+ ip: z.string(),
1456
+ country: z.string().optional(),
1457
+ countryName: z.string().optional(),
1458
+ });
1459
+ export const ExitPointSchema = z.object({
1460
+ country: z.string(),
1461
+ countryName: z.string(),
1462
+ servers: z.number(),
1463
+ share: z.number().optional(),
1464
+ });
1465
+ export const ExitCountriesSchema = z.object({
1466
+ countries: z.array(ExitPointSchema),
1467
+ live: z.boolean(),
1468
+ });
1469
+ export const ExitLinkSchema = z.object({
1470
+ id: z.string(),
1471
+ provider: ExitProviderSchema,
1472
+ state: ExitStateSchema,
1473
+ proxy: z.string(),
1474
+ country: z.string().optional(),
1475
+ observedCountry: z.string().optional(),
1476
+ ip: z.string().optional(),
1477
+ checkedAt: z.number().optional(),
1478
+ interface: z.string().optional(),
1479
+ since: z.number().optional(),
1480
+ autoStart: z.boolean(),
1481
+ detail: z.string().optional(),
1482
+ });
1483
+ export const ExitListSchema = z.object({ links: z.array(ExitLinkSchema) });
1484
+ export const TOR_EXIT_COUNTRIES = [
1485
+ { country: "NL", countryName: "Netherlands", servers: 607, share: 0.304 },
1486
+ { country: "DE", countryName: "Germany", servers: 415, share: 0.242 },
1487
+ { country: "SE", countryName: "Sweden", servers: 344, share: 0.14 },
1488
+ { country: "US", countryName: "United States", servers: 1171, share: 0.097 },
1489
+ { country: "AT", countryName: "Austria", servers: 123, share: 0.054 },
1490
+ { country: "LU", countryName: "Luxembourg", servers: 92, share: 0.033 },
1491
+ { country: "FR", countryName: "France", servers: 63, share: 0.032 },
1492
+ { country: "NO", countryName: "Norway", servers: 54, share: 0.026 },
1493
+ { country: "RO", countryName: "Romania", servers: 71, share: 0.011 },
1494
+ { country: "DK", countryName: "Denmark", servers: 15, share: 0.007 },
1495
+ { country: "HU", countryName: "Hungary", servers: 20, share: 0.006 },
1496
+ { country: "IT", countryName: "Italy", servers: 15, share: 0.006 },
1497
+ { country: "UA", countryName: "Ukraine", servers: 23, share: 0.006 },
1498
+ { country: "CH", countryName: "Switzerland", servers: 23, share: 0.006 },
1499
+ { country: "IS", countryName: "Iceland", servers: 23, share: 0.003 },
1500
+ { country: "PL", countryName: "Poland", servers: 8, share: 0.002 },
1501
+ { country: "BG", countryName: "Bulgaria", servers: 17, share: 0.002 },
1502
+ { country: "GB", countryName: "United Kingdom", servers: 8, share: 0.002 },
1503
+ { country: "FI", countryName: "Finland", servers: 13, share: 0.002 },
1504
+ ];
1505
+ export const VPNGATE_EXIT_COUNTRIES = [
1506
+ { country: "JP", countryName: "Japan", servers: 46, share: 0.48 },
1507
+ { country: "KR", countryName: "Korea, South", servers: 37, share: 0.39 },
1508
+ { country: "VN", countryName: "Vietnam", servers: 3, share: 0.03 },
1509
+ { country: "TH", countryName: "Thailand", servers: 2, share: 0.02 },
1510
+ { country: "RU", countryName: "Russia", servers: 2, share: 0.02 },
1511
+ { country: "RO", countryName: "Romania", servers: 1, share: 0.01 },
1512
+ { country: "MX", countryName: "Mexico", servers: 1, share: 0.01 },
1513
+ { country: "IN", countryName: "India", servers: 1, share: 0.01 },
1514
+ { country: "CN", countryName: "China", servers: 1, share: 0.01 },
1515
+ { country: "BY", countryName: "Belarus", servers: 1, share: 0.01 },
1516
+ ];
1517
+ export const ExitIdParamSchema = z.object({ id: z.string() });
1518
+ export const ExitUseInputSchema = z.object({ id: z.string(), country: CountryCodeSchema.optional() });
1411
1519
  export const MarketplaceRequestSchema = z.object({ url: z.url(), token: z.string().min(1).optional() });
1412
1520
  export const MarketplaceSchema = z.object({ name: z.string(), plugins: z.array(RegistryEntrySchema) });
1413
1521
  const extensionId = z
@@ -2258,6 +2366,9 @@ export const UsageTurnSchema = z.object({
2258
2366
  proseChars: z.number().optional(),
2259
2367
  searchCalls: z.number().optional(),
2260
2368
  openingSearches: z.number().optional(),
2369
+ tierScore: z.number().optional(),
2370
+ tierRules: z.array(z.string()).optional(),
2371
+ tierRouted: z.boolean().optional(),
2261
2372
  });
2262
2373
  export const UsageRollupRowSchema = z.object({
2263
2374
  day: z.string(),