@lucid-agents/taskmarket 1.33.0 → 1.35.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.
- package/dist/agent-compatibility.json +1 -1
- package/dist/{api-J7LB2GAY.js → api-R76D244Y.js} +2 -2
- package/dist/{channels-XY4SSEBG.js → channels-SVCU2MU5.js} +4 -4
- package/dist/{chunk-ACKPSLIR.js → chunk-54OR2JDT.js} +10 -6
- package/dist/{chunk-BESAWMVS.js → chunk-B7W4G3EY.js} +1 -1
- package/dist/{chunk-ALTIKIGD.js → chunk-BDKM5JMT.js} +1 -1
- package/dist/{chunk-YUYW5N4U.js → chunk-CHX7O7EU.js} +1 -1
- package/dist/{chunk-QUIWYQZL.js → chunk-G3U2BQNC.js} +27 -5
- package/dist/{chunk-WVHSHZBK.js → chunk-JRWRBSS2.js} +3 -3
- package/dist/{chunk-VW7I7J5Q.js → chunk-KHDQRFHG.js} +5 -5
- package/dist/{chunk-KGU3CSYK.js → chunk-L6D2CDVQ.js} +14 -9
- package/dist/{chunk-TZH4XU62.js → chunk-QAGDCIMU.js} +1690 -1518
- package/dist/{chunk-E7HZKIUP.js → chunk-WP7GXSKE.js} +3 -3
- package/dist/{chunk-JZ3SUHWV.js → chunk-YGSVDU2D.js} +3 -3
- package/dist/{chunk-QQ4PHAPV.js → chunk-YHVP2UNE.js} +1 -1
- package/dist/{doctor-LHFMQ737.js → doctor-IIVQFDIB.js} +8 -8
- package/dist/index.js +851 -199
- package/dist/{launch-B2KFGY2L.js → launch-OC4LIPSS.js} +11 -11
- package/dist/pi-extensions/xgate.cjs +2944 -2801
- package/dist/{read-auth-P2WTHPWW.js → read-auth-AGP3CUMT.js} +3 -3
- package/dist/{reconcile-7AIMC4P3.js → reconcile-H3JIKN2X.js} +4 -4
- package/dist/{status-6EYEBSQ6.js → status-SARVECVT.js} +8 -8
- package/dist/{sync-pull-XSIEQDGD.js → sync-pull-IUPV57MU.js} +4 -4
- package/dist/{task-access-grants-Z32WK3FJ.js → task-access-grants-HALV3NEO.js} +2 -2
- package/package.json +3 -3
|
@@ -423,6 +423,13 @@ var API_ERROR_REASONS = [
|
|
|
423
423
|
* approves, the backend sends it again under that approval.
|
|
424
424
|
*/
|
|
425
425
|
"owner_approval_required",
|
|
426
|
+
/**
|
|
427
|
+
* The project's automations are off (RFC-0077): creating or resuming a schedule or workflow, or
|
|
428
|
+
* a run of one, needs the platform runner's grant, and the owner has none that is on. Refused
|
|
429
|
+
* before any payment challenge when it is a request, so nothing was charged. `fix.command` is the
|
|
430
|
+
* exact CLI command that turns them on.
|
|
431
|
+
*/
|
|
432
|
+
"automations_off",
|
|
426
433
|
/**
|
|
427
434
|
* No API route matches the request's method and path, or the resource it names does not
|
|
428
435
|
* exist. Nothing was written or charged.
|
|
@@ -458,6 +465,8 @@ var ENVELOPE_FIELDS = {
|
|
|
458
465
|
txHash: z3.string().optional(),
|
|
459
466
|
/** On `task_requirement_not_met`: each unmet task requirement and why it was not met. */
|
|
460
467
|
requirements: z3.array(TaskRequirementFailureSchema).optional(),
|
|
468
|
+
/** On `automations_off`: the command that fixes it, ready to run. */
|
|
469
|
+
fix: z3.object({ command: z3.string() }).optional(),
|
|
461
470
|
/** On `skill_authoring_limit`: the limit that was hit. */
|
|
462
471
|
limit: z3.number().int().nonnegative().optional(),
|
|
463
472
|
/** On `skill_authoring_limit`: when the next write is allowed (ISO 8601), or null if never by waiting. */
|
|
@@ -1692,7 +1701,7 @@ var HookRegistryResponseSchema = z9.object({
|
|
|
1692
1701
|
});
|
|
1693
1702
|
|
|
1694
1703
|
// ../../packages/shared/dist/schemas/hook-v2.schemas.js
|
|
1695
|
-
import { encodeAbiParameters } from "viem";
|
|
1704
|
+
import { encodeAbiParameters, numberToHex } from "viem";
|
|
1696
1705
|
import { z as z10 } from "zod";
|
|
1697
1706
|
var HOOK_V2_CONFIG_MAX_BYTES = 2048;
|
|
1698
1707
|
var HOOK_V2_CAPABILITY_CALLS = 1 << 30;
|
|
@@ -1732,7 +1741,13 @@ var TaskPayoutGateSchema = z10.object({
|
|
|
1732
1741
|
gatingTaskId: z10.string().nullable(),
|
|
1733
1742
|
deadline: z10.number().int().nonnegative(),
|
|
1734
1743
|
gatingPaid: z10.boolean().nullable(),
|
|
1735
|
-
open: z10.boolean().nullable()
|
|
1744
|
+
open: z10.boolean().nullable(),
|
|
1745
|
+
/** The latest deadline an extension may reach (creation + 180 days); null when unread. */
|
|
1746
|
+
maxDeadline: z10.number().int().nonnegative().nullable().optional(),
|
|
1747
|
+
/** The gating task ended Cancelled or Expired, so it can be replaced once; null when unread. */
|
|
1748
|
+
gatingFailed: z10.boolean().nullable().optional(),
|
|
1749
|
+
/** The one replacement of a failed gating task is used; null when unread. */
|
|
1750
|
+
relinked: z10.boolean().nullable().optional()
|
|
1736
1751
|
});
|
|
1737
1752
|
var TaskHookCallInputSchema = z10.object({
|
|
1738
1753
|
taskId: Bytes32Schema,
|
|
@@ -1749,6 +1764,14 @@ var LinkGateInputSchema = z10.object({
|
|
|
1749
1764
|
// Paid writes carry the chain in the body on Tempo (MPP) so the API resolves it from there.
|
|
1750
1765
|
chainId: z10.number().int().positive().optional()
|
|
1751
1766
|
}).strict();
|
|
1767
|
+
var PAYOUT_GATE_MAX_WINDOW_SECS = 180 * 24 * 60 * 60;
|
|
1768
|
+
var ExtendGateInputSchema = z10.object({
|
|
1769
|
+
taskId: Bytes32Schema,
|
|
1770
|
+
/** The new deadline as a Unix timestamp in seconds. */
|
|
1771
|
+
deadline: z10.number().int().positive(),
|
|
1772
|
+
// Paid writes carry the chain in the body on Tempo (MPP) so the API resolves it from there.
|
|
1773
|
+
chainId: z10.number().int().positive().optional()
|
|
1774
|
+
}).strict();
|
|
1752
1775
|
|
|
1753
1776
|
// ../../packages/shared/dist/capabilities/validate.js
|
|
1754
1777
|
import { z as z11 } from "zod";
|
|
@@ -8141,6 +8164,17 @@ var RELAY_GAS_OPS = [
|
|
|
8141
8164
|
"grantOperator",
|
|
8142
8165
|
"acceptGrant",
|
|
8143
8166
|
"revokeOperator",
|
|
8167
|
+
// Rev029: the owner raises an accepted grant's cap (upward only).
|
|
8168
|
+
"raiseGrantCap",
|
|
8169
|
+
// Rev029: the owner lowers a grant's lifetime cap, never below what its tasks hold.
|
|
8170
|
+
"lowerGrantCap",
|
|
8171
|
+
// Rev029: the owner sets a grant's expiry, modes, reward ceiling and period budget.
|
|
8172
|
+
"setGrantLimits",
|
|
8173
|
+
// Rev029: the owner transfer (propose, accept, cancel) and the end-date extension.
|
|
8174
|
+
"proposeProjectOwner",
|
|
8175
|
+
"acceptProjectOwner",
|
|
8176
|
+
"cancelProjectOwner",
|
|
8177
|
+
"extendProject",
|
|
8144
8178
|
// Creates a task from a project's budget; calls each attached hook's onCreate like createTask.
|
|
8145
8179
|
"createProjectTask"
|
|
8146
8180
|
];
|
|
@@ -8842,6 +8876,55 @@ var ProjectGrantSchema = ProjectGrantTermsSchema.extend({
|
|
|
8842
8876
|
projectId: ProjectIdSchema,
|
|
8843
8877
|
operator: EthAddressSchema.describe("The wallet granted the right to spend the budget")
|
|
8844
8878
|
});
|
|
8879
|
+
var PROJECT_AUTOMATIONS_PERIODS = {
|
|
8880
|
+
weekly: 7 * 24 * 60 * 60,
|
|
8881
|
+
monthly: 30 * 24 * 60 * 60
|
|
8882
|
+
};
|
|
8883
|
+
var PROJECT_AUTOMATIONS_PERIOD_NAMES = ["weekly", "monthly"];
|
|
8884
|
+
var ProjectAutomationsOnSchema = z51.object({
|
|
8885
|
+
chainId: ChainIdSchema2.optional(),
|
|
8886
|
+
projectId: ProjectIdSchema,
|
|
8887
|
+
cap: PositiveUsdcBaseUnitsSchema.describe("The most the automations may draw from the project's budget in total, net of refunds (payouts keep counting, a refund frees its share), in base units. Required; zero is not allowed. On a project whose automations are already on it raises the cap, and a lower cap is refused"),
|
|
8888
|
+
expiresAt: z51.number().int().positive().optional().describe("Optional limit (contract revision 29 or later): unix seconds after which the automations cannot draw. It must be in the future"),
|
|
8889
|
+
periodCap: PositiveUsdcBaseUnitsSchema.optional().describe("Optional limit (contract revision 29 or later): the most the automations may draw in one period, net of refunds, in base units. Needs period"),
|
|
8890
|
+
period: z51.enum(PROJECT_AUTOMATIONS_PERIOD_NAMES).optional().describe("The period of periodCap: weekly (7 days) or monthly (30 days). Needs periodCap")
|
|
8891
|
+
}).refine((v) => v.periodCap === void 0 === (v.period === void 0), {
|
|
8892
|
+
message: "periodCap and period go together: state both or neither",
|
|
8893
|
+
path: ["period"]
|
|
8894
|
+
});
|
|
8895
|
+
var ProjectAutomationsOffSchema = z51.object({
|
|
8896
|
+
chainId: ChainIdSchema2.optional(),
|
|
8897
|
+
projectId: ProjectIdSchema
|
|
8898
|
+
});
|
|
8899
|
+
var ProjectAutomationsStatusInputSchema = z51.object({
|
|
8900
|
+
chainId: ChainIdSchema2.optional(),
|
|
8901
|
+
projectId: ProjectIdSchema
|
|
8902
|
+
});
|
|
8903
|
+
var ProjectGrantLimitsViewSchema = z51.object({
|
|
8904
|
+
expiresAt: z51.number().nullable().describe("Unix seconds after which the operator cannot draw"),
|
|
8905
|
+
maxRewardPerTask: z51.string().nullable().describe("The most one task may hold from the budget, base units"),
|
|
8906
|
+
allowedModes: z51.array(z51.string()).nullable().describe("Task modes allowed; null is every mode"),
|
|
8907
|
+
periodSecs: z51.number().nullable(),
|
|
8908
|
+
periodCap: z51.string().nullable().describe("The most drawn per period, base units"),
|
|
8909
|
+
periodSpent: z51.string().nullable().describe("Drawn in the current period; null where only the indexed view is available"),
|
|
8910
|
+
periodResetsAt: z51.number().nullable().describe("Unix seconds when the period ends")
|
|
8911
|
+
});
|
|
8912
|
+
var PROJECT_AUTOMATIONS_STATES = ["on", "off", "pending", "unavailable"];
|
|
8913
|
+
var ProjectAutomationsViewSchema = z51.object({
|
|
8914
|
+
state: z51.enum(PROJECT_AUTOMATIONS_STATES).describe("on: the runner holds an accepted, unrevoked grant; pending: granted, the runner has not accepted yet (counts as on); off: no grant, a revoked grant, or one with other terms; unavailable: this deployment has no runner for the chain"),
|
|
8915
|
+
cap: z51.string().nullable().describe("The grant cap in base units; null when there is no grant or no cap beyond the budget"),
|
|
8916
|
+
spent: z51.string().describe("The grant's committed draw in base units, net of refunds (payouts keep counting)"),
|
|
8917
|
+
remaining: z51.string().nullable().describe("cap less spent, floored at zero; null with no cap or no grant"),
|
|
8918
|
+
chainId: z51.number(),
|
|
8919
|
+
limits: ProjectGrantLimitsViewSchema.nullable().describe("The limits the owner set on the runner grant on top of the cap (rev029); null when none are set"),
|
|
8920
|
+
canReenable: z51.boolean().describe("Off, and turning on again would succeed: there is no grant, or it was revoked and the chain is on rev029 or later"),
|
|
8921
|
+
canRaiseCap: z51.boolean().describe("On, and turning on with a higher cap would raise it: the chain is on rev029 or later")
|
|
8922
|
+
});
|
|
8923
|
+
var ProjectAutomationsStatusSchema = z51.object({
|
|
8924
|
+
chainId: z51.number(),
|
|
8925
|
+
projectId: z51.number(),
|
|
8926
|
+
automations: ProjectAutomationsViewSchema
|
|
8927
|
+
});
|
|
8845
8928
|
var ProjectAcceptGrantSchema = z51.object({
|
|
8846
8929
|
chainId: ChainIdSchema2.optional(),
|
|
8847
8930
|
projectId: ProjectIdSchema,
|
|
@@ -8852,6 +8935,52 @@ var ProjectRevokeSchema = z51.object({
|
|
|
8852
8935
|
projectId: ProjectIdSchema,
|
|
8853
8936
|
operator: EthAddressSchema
|
|
8854
8937
|
});
|
|
8938
|
+
var ProjectRaiseCapSchema = z51.object({
|
|
8939
|
+
chainId: ChainIdSchema2.optional(),
|
|
8940
|
+
projectId: ProjectIdSchema,
|
|
8941
|
+
operator: EthAddressSchema,
|
|
8942
|
+
cap: UsdcBaseUnitsSchema.describe("The new cap in token base units: above the grant's current cap, which must be nonzero")
|
|
8943
|
+
});
|
|
8944
|
+
var ProjectLowerCapSchema = z51.object({
|
|
8945
|
+
chainId: ChainIdSchema2.optional(),
|
|
8946
|
+
projectId: ProjectIdSchema,
|
|
8947
|
+
operator: EthAddressSchema,
|
|
8948
|
+
cap: PositiveUsdcBaseUnitsSchema.describe("The new lifetime cap in token base units: below the grant's current cap and at least what its tasks hold (committed)")
|
|
8949
|
+
});
|
|
8950
|
+
var GRANT_MODE_NAMES = ["bounty", "claim", "pitch", "benchmark", "auction"];
|
|
8951
|
+
var ProjectGrantLimitsSetSchema = z51.object({
|
|
8952
|
+
chainId: ChainIdSchema2.optional(),
|
|
8953
|
+
projectId: ProjectIdSchema,
|
|
8954
|
+
operator: EthAddressSchema,
|
|
8955
|
+
expiresAt: z51.number().int().positive().optional().describe("Unix seconds after which the operator cannot draw; in the future. Absent: none"),
|
|
8956
|
+
allowedModes: z51.array(z51.enum(GRANT_MODE_NAMES)).min(1).optional().describe("The task modes the operator may create. Absent: every mode"),
|
|
8957
|
+
maxRewardPerTask: PositiveUsdcBaseUnitsSchema.optional().describe("The most one task may hold from the budget (reward plus evaluator stake, counting top-ups), in base units. Absent: none"),
|
|
8958
|
+
periodCap: PositiveUsdcBaseUnitsSchema.optional().describe("The most the operator may draw in one period, net of refunds, in base units. Needs period"),
|
|
8959
|
+
period: z51.enum(PROJECT_AUTOMATIONS_PERIOD_NAMES).optional().describe("The period of periodCap: weekly (7 days) or monthly (30 days). Needs periodCap")
|
|
8960
|
+
}).refine((v) => v.periodCap === void 0 === (v.period === void 0), {
|
|
8961
|
+
message: "periodCap and period go together: state both or neither",
|
|
8962
|
+
path: ["period"]
|
|
8963
|
+
});
|
|
8964
|
+
var ProjectProposeOwnerSchema = z51.object({
|
|
8965
|
+
chainId: ChainIdSchema2.optional(),
|
|
8966
|
+
projectId: ProjectIdSchema,
|
|
8967
|
+
newOwner: EthAddressSchema.refine((address2) => !/^0x0{40}$/i.test(address2), {
|
|
8968
|
+
message: "The new owner cannot be the zero address"
|
|
8969
|
+
}).describe("The wallet that will own the project once it accepts")
|
|
8970
|
+
});
|
|
8971
|
+
var ProjectAcceptOwnerSchema = z51.object({
|
|
8972
|
+
chainId: ChainIdSchema2.optional(),
|
|
8973
|
+
projectId: ProjectIdSchema
|
|
8974
|
+
});
|
|
8975
|
+
var ProjectCancelOwnerSchema = z51.object({
|
|
8976
|
+
chainId: ChainIdSchema2.optional(),
|
|
8977
|
+
projectId: ProjectIdSchema
|
|
8978
|
+
});
|
|
8979
|
+
var ProjectExtendSchema = z51.object({
|
|
8980
|
+
chainId: ChainIdSchema2.optional(),
|
|
8981
|
+
projectId: ProjectIdSchema,
|
|
8982
|
+
endsAt: z51.string().datetime({ offset: true }).describe("The new end date (ISO 8601): later than the current one and at most 365 days from now")
|
|
8983
|
+
});
|
|
8855
8984
|
var ProjectReviewSetSchema = z51.object({
|
|
8856
8985
|
chainId: ChainIdSchema2.optional(),
|
|
8857
8986
|
projectId: ProjectIdSchema,
|
|
@@ -8897,6 +9026,7 @@ var ProjectSummarySchema = z51.object({
|
|
|
8897
9026
|
name: z51.string().nullable().optional().describe("The name its owner gave it; null for a project opened without one"),
|
|
8898
9027
|
goal: z51.string().nullable().optional().describe("What the project is for, in its owner's words; null when none was given"),
|
|
8899
9028
|
endsAt: z51.string(),
|
|
9029
|
+
pendingOwner: z51.string().nullable().optional().describe("The wallet the owner proposed as the next owner, which takes the project over when it accepts; null when none is pending"),
|
|
8900
9030
|
taskGraceSecs: z51.number().describe("How long after endsAt the project's tasks may run, in seconds; fixed at creation. Every project task ends by endsAt plus this"),
|
|
8901
9031
|
closed: z51.boolean(),
|
|
8902
9032
|
createdAt: z51.string(),
|
|
@@ -8943,7 +9073,8 @@ var ProjectGrantViewSchema = z51.object({
|
|
|
8943
9073
|
grantedAt: z51.string(),
|
|
8944
9074
|
acceptedAt: z51.string().nullable(),
|
|
8945
9075
|
revokedAt: z51.string().nullable(),
|
|
8946
|
-
committed: Amount.describe("The operator's tasks' total draw on the budget, net of refunds (payouts keep counting), measured against its cap; not the project-level committed")
|
|
9076
|
+
committed: Amount.describe("The operator's tasks' total draw on the budget, net of refunds (payouts keep counting), measured against its cap; not the project-level committed"),
|
|
9077
|
+
limits: ProjectGrantLimitsViewSchema.nullable().optional().describe("The limits the owner set on this grant (rev029); null when none are set")
|
|
8947
9078
|
});
|
|
8948
9079
|
var ProjectTaskViewSchema = z51.object({
|
|
8949
9080
|
taskId: z51.string(),
|
|
@@ -9262,7 +9393,7 @@ var ProjectScheduleViewSchema = z52.object({
|
|
|
9262
9393
|
projectId: z52.number(),
|
|
9263
9394
|
owner: z52.string(),
|
|
9264
9395
|
status: ProjectScheduleStatusSchema,
|
|
9265
|
-
pausedReason: z52.enum(["owner", "failures"]).nullable().describe("owner: paused by its owner; failures: paused after too many failures in a row"),
|
|
9396
|
+
pausedReason: z52.enum(["owner", "failures", "automations_off"]).nullable().describe("owner: paused by its owner; failures: paused after too many failures in a row; automations_off: paused when the owner turned the project automations off, and not resumed by turning them on again"),
|
|
9266
9397
|
endedReason: z52.string().nullable().describe("Why a completed or cancelled schedule stopped: runs_done, project_closed, owner"),
|
|
9267
9398
|
cadence: z52.object({
|
|
9268
9399
|
kind: z52.enum(["interval", "cron"]),
|
|
@@ -10345,6 +10476,41 @@ function getAgentName(agentId) {
|
|
|
10345
10476
|
var PG_UUID_BODY = "(?:[0-9a-f]{4}-?){7}[0-9a-f]{4}";
|
|
10346
10477
|
var PG_UUID = new RegExp(`^(?:\\{${PG_UUID_BODY}\\}|${PG_UUID_BODY})$`, "i");
|
|
10347
10478
|
|
|
10479
|
+
// ../../packages/shared/dist/lib/reference-codes.js
|
|
10480
|
+
var ALPHABET = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
10481
|
+
var CODE_LENGTH = 8;
|
|
10482
|
+
var PREFIXES = {
|
|
10483
|
+
submission: "SUB",
|
|
10484
|
+
task: "TSK"
|
|
10485
|
+
};
|
|
10486
|
+
var ENTITY_BY_PREFIX = new Map(Object.entries(PREFIXES).map(([entity, prefix]) => [prefix, entity]));
|
|
10487
|
+
function normalizeReferenceCode(input2) {
|
|
10488
|
+
const trimmed = input2.trim().toUpperCase();
|
|
10489
|
+
if (!trimmed)
|
|
10490
|
+
return null;
|
|
10491
|
+
let entity = null;
|
|
10492
|
+
let body = trimmed;
|
|
10493
|
+
const separator = trimmed.indexOf("-");
|
|
10494
|
+
if (separator !== -1) {
|
|
10495
|
+
const candidate = ENTITY_BY_PREFIX.get(trimmed.slice(0, separator));
|
|
10496
|
+
if (!candidate)
|
|
10497
|
+
return null;
|
|
10498
|
+
entity = candidate;
|
|
10499
|
+
body = trimmed.slice(separator + 1);
|
|
10500
|
+
}
|
|
10501
|
+
const decoded = body.replace(/I/g, "1").replace(/L/g, "1").replace(/O/g, "0");
|
|
10502
|
+
if (decoded.length !== CODE_LENGTH)
|
|
10503
|
+
return null;
|
|
10504
|
+
for (const character of decoded) {
|
|
10505
|
+
if (!ALPHABET.includes(character))
|
|
10506
|
+
return null;
|
|
10507
|
+
}
|
|
10508
|
+
return {
|
|
10509
|
+
code: entity ? `${PREFIXES[entity]}-${decoded}` : decoded,
|
|
10510
|
+
entity
|
|
10511
|
+
};
|
|
10512
|
+
}
|
|
10513
|
+
|
|
10348
10514
|
// ../../packages/shared/dist/lib/workflow-document.js
|
|
10349
10515
|
var FIELDS = {
|
|
10350
10516
|
task: [
|
|
@@ -12114,10 +12280,10 @@ function formatPaymentAmount(value, chainId, options = { trimTrailingZeros: true
|
|
|
12114
12280
|
}
|
|
12115
12281
|
|
|
12116
12282
|
// ../../packages/shared/dist/schemas/launcher.schemas.js
|
|
12117
|
-
import { z as
|
|
12283
|
+
import { z as z63 } from "zod";
|
|
12118
12284
|
|
|
12119
12285
|
// ../../packages/shared/dist/schemas/agent-platform.schemas.js
|
|
12120
|
-
import { z as
|
|
12286
|
+
import { z as z61 } from "zod";
|
|
12121
12287
|
|
|
12122
12288
|
// ../../packages/shared/dist/schemas/swarm-budget.schemas.js
|
|
12123
12289
|
import { z as z58 } from "zod";
|
|
@@ -12214,218 +12380,505 @@ var SwarmTempoKeyConfirmSchema = z59.object({
|
|
|
12214
12380
|
signature: z59.string().regex(/^0x[0-9a-fA-F]{130}$/)
|
|
12215
12381
|
}).strict();
|
|
12216
12382
|
|
|
12217
|
-
// ../../packages/shared/dist/schemas/
|
|
12218
|
-
|
|
12219
|
-
|
|
12220
|
-
|
|
12221
|
-
"
|
|
12222
|
-
"
|
|
12223
|
-
"
|
|
12224
|
-
"
|
|
12225
|
-
"
|
|
12226
|
-
|
|
12383
|
+
// ../../packages/shared/dist/schemas/hosted-market.schemas.js
|
|
12384
|
+
import { z as z60 } from "zod";
|
|
12385
|
+
var HOSTED_SKILL_READ_ACTIONS = ["skill-list", "skill-show"];
|
|
12386
|
+
var HOSTED_SKILL_WRITE_ACTIONS = [
|
|
12387
|
+
"skill-create",
|
|
12388
|
+
"skill-version",
|
|
12389
|
+
"skill-archive",
|
|
12390
|
+
"skill-import",
|
|
12391
|
+
"skill-update",
|
|
12392
|
+
// Issue #4683: share a skill with itself or another agent of the same owner.
|
|
12393
|
+
"skill-share"
|
|
12227
12394
|
];
|
|
12228
|
-
var
|
|
12229
|
-
|
|
12230
|
-
|
|
12231
|
-
|
|
12232
|
-
|
|
12233
|
-
var
|
|
12234
|
-
|
|
12235
|
-
|
|
12236
|
-
|
|
12237
|
-
|
|
12238
|
-
|
|
12239
|
-
|
|
12240
|
-
|
|
12241
|
-
|
|
12242
|
-
|
|
12243
|
-
|
|
12244
|
-
|
|
12245
|
-
|
|
12246
|
-
|
|
12247
|
-
|
|
12248
|
-
|
|
12249
|
-
|
|
12250
|
-
|
|
12251
|
-
|
|
12252
|
-
|
|
12253
|
-
|
|
12254
|
-
|
|
12255
|
-
|
|
12256
|
-
|
|
12257
|
-
|
|
12258
|
-
|
|
12259
|
-
|
|
12260
|
-
|
|
12261
|
-
|
|
12262
|
-
|
|
12263
|
-
|
|
12264
|
-
|
|
12265
|
-
|
|
12266
|
-
}).nullable(),
|
|
12267
|
-
connectors: z60.array(z60.object({ provider: z60.string(), state: z60.string(), actions: z60.array(z60.string()) })),
|
|
12268
|
-
channels: z60.object({ connected: z60.boolean(), coordinatorAgentId: z60.string().uuid().nullable() }),
|
|
12269
|
-
toolGroups: z60.array(z60.string()),
|
|
12270
|
-
swarm: z60.object({
|
|
12271
|
-
canCreate: z60.boolean(),
|
|
12272
|
-
canDispatch: z60.boolean(),
|
|
12273
|
-
coordinator: z60.string().uuid().nullable(),
|
|
12274
|
-
siblings: z60.array(z60.object({ agentId: z60.string().uuid() })),
|
|
12275
|
-
limits: z60.object({
|
|
12276
|
-
createsPerJob: z60.number(),
|
|
12277
|
-
sendsPerJob: z60.number(),
|
|
12278
|
-
depth: z60.number(),
|
|
12279
|
-
agentsPerAccount: z60.number()
|
|
12280
|
-
})
|
|
12281
|
-
}),
|
|
12282
|
-
market: z60.object({
|
|
12283
|
-
scopes: z60.array(z60.string()),
|
|
12284
|
-
/** The task reward cap in USDC base units; null when the owner set none. */
|
|
12285
|
-
escrowLimit: z60.string().nullable(),
|
|
12286
|
-
freeActions: z60.array(z60.string()),
|
|
12287
|
-
freeActionsConditions: z60.string()
|
|
12288
|
-
}),
|
|
12289
|
-
spending: z60.object({
|
|
12290
|
-
mode: z60.enum(["off", "exact", "yolo", "standing"]),
|
|
12291
|
-
maxPurchase: z60.string().nullable(),
|
|
12292
|
-
rollingDay: z60.string().nullable(),
|
|
12293
|
-
period: z60.string().nullable(),
|
|
12294
|
-
/**
|
|
12295
|
-
* ADR-0477 item 7. The Tempo access key that signs this owner's payments, read-only: the owner
|
|
12296
|
-
* authorizes and renews it in the web app, so an agent that finds it anything but `active` or
|
|
12297
|
-
* `expiring` (a payment answers `SWARM_TEMPO_KEY_REQUIRED`) hands the step to the owner.
|
|
12298
|
-
* Null on a Base wallet.
|
|
12299
|
-
*/
|
|
12300
|
-
tempoKey: SwarmTempoKeyStateSchema.nullable().optional()
|
|
12301
|
-
}),
|
|
12302
|
-
memoryScopes: z60.array(z60.string())
|
|
12303
|
-
});
|
|
12304
|
-
var AgentDelegationSchema = z60.object({
|
|
12305
|
-
agentId: z60.string().uuid(),
|
|
12306
|
-
name: z60.string(),
|
|
12307
|
-
jobId: z60.string().uuid(),
|
|
12308
|
-
status: z60.enum(["queued", "running", "completed", "failed", "interrupted"]),
|
|
12309
|
-
waiting: z60.boolean()
|
|
12310
|
-
});
|
|
12311
|
-
|
|
12312
|
-
// ../../packages/shared/dist/schemas/memory.schemas.js
|
|
12313
|
-
import { z as z61 } from "zod";
|
|
12314
|
-
var MEMORY_DOCUMENT_MAX_BYTES = 65536;
|
|
12315
|
-
var MEMORY_ARCHIVE_RETENTION_DAYS = 30;
|
|
12316
|
-
var MEMORY_PATH_MAX_LENGTH = 200;
|
|
12317
|
-
var MEMORY_PATH_MAX_DEPTH = 6;
|
|
12318
|
-
var MEMORY_PATH_SEGMENT_MAX_BYTES = 100;
|
|
12319
|
-
var MEMORY_SEARCH_QUERY_MAX_LENGTH = 200;
|
|
12320
|
-
var MEMORY_SEARCH_MAX_RESULTS = 20;
|
|
12321
|
-
var MEMORY_HISTORY_MAX_RESULTS = 50;
|
|
12322
|
-
var MEMORY_REASON_MAX_LENGTH = 500;
|
|
12323
|
-
var MemoryScopeSchema = z61.enum(["agent", "swarm"]);
|
|
12324
|
-
var MemoryTrustSchema = z61.enum(["owner", "agent", "tainted"]);
|
|
12325
|
-
var MemoryRevisionStatusSchema = z61.enum(["applied", "proposed", "approved", "rejected"]);
|
|
12326
|
-
var MemoryActorSchema = z61.enum(["owner", "agent"]);
|
|
12327
|
-
var MemoryOperationSchema = z61.enum([
|
|
12328
|
-
"create",
|
|
12329
|
-
"replace",
|
|
12330
|
-
"append",
|
|
12331
|
-
"edit",
|
|
12332
|
-
"archive",
|
|
12333
|
-
"rollback",
|
|
12334
|
-
"restore",
|
|
12335
|
-
"promote"
|
|
12336
|
-
]);
|
|
12337
|
-
var MemoryWriteModeSchema = z61.enum(["replace", "append"]);
|
|
12338
|
-
var MemoryWriteOutcomeSchema = z61.enum(["applied", "proposed"]);
|
|
12339
|
-
var LauncherJobSourceSchema = z61.enum([
|
|
12340
|
-
"dashboard",
|
|
12341
|
-
"imessage",
|
|
12342
|
-
"peer",
|
|
12343
|
-
"schedule",
|
|
12344
|
-
"wait",
|
|
12395
|
+
var HOSTED_SKILL_ACTIONS = [
|
|
12396
|
+
...HOSTED_SKILL_READ_ACTIONS,
|
|
12397
|
+
...HOSTED_SKILL_WRITE_ACTIONS
|
|
12398
|
+
];
|
|
12399
|
+
var HostedSkillWritesEnabledSchema = z60.enum(["true", "false"]).default("false").transform((value) => value === "true");
|
|
12400
|
+
var HOSTED_WORKFLOW_READ_ACTIONS = [
|
|
12401
|
+
"project-workflows",
|
|
12402
|
+
"project-workflow",
|
|
12403
|
+
"project-workflow-runs",
|
|
12404
|
+
"project-workflow-run-status",
|
|
12405
|
+
"project-schedules",
|
|
12406
|
+
"project-schedule"
|
|
12407
|
+
];
|
|
12408
|
+
var HOSTED_WORKFLOW_WRITE_ACTIONS = [
|
|
12409
|
+
"project-workflow-create",
|
|
12410
|
+
"project-workflow-run",
|
|
12411
|
+
"project-workflow-cancel",
|
|
12412
|
+
"project-workflow-delete",
|
|
12413
|
+
"project-schedule-create",
|
|
12414
|
+
"project-schedule-pause",
|
|
12415
|
+
"project-schedule-resume",
|
|
12416
|
+
"project-schedule-cancel"
|
|
12417
|
+
];
|
|
12418
|
+
var HOSTED_WORKFLOW_ACTIONS = [
|
|
12419
|
+
...HOSTED_WORKFLOW_READ_ACTIONS,
|
|
12420
|
+
...HOSTED_WORKFLOW_WRITE_ACTIONS
|
|
12421
|
+
];
|
|
12422
|
+
var HOSTED_MARKET_READ_ACTIONS = [
|
|
12423
|
+
"capabilities",
|
|
12424
|
+
"list",
|
|
12425
|
+
"get",
|
|
12426
|
+
"pitches",
|
|
12427
|
+
"proofs",
|
|
12428
|
+
"submissions",
|
|
12429
|
+
"my-submissions",
|
|
12430
|
+
"download",
|
|
12431
|
+
"viewers",
|
|
12432
|
+
"actions",
|
|
12345
12433
|
"inbox",
|
|
12346
|
-
|
|
12347
|
-
|
|
12348
|
-
"
|
|
12349
|
-
|
|
12350
|
-
"
|
|
12351
|
-
|
|
12352
|
-
|
|
12353
|
-
|
|
12354
|
-
"
|
|
12355
|
-
|
|
12356
|
-
"
|
|
12434
|
+
"agents",
|
|
12435
|
+
"stats",
|
|
12436
|
+
"bids",
|
|
12437
|
+
"address",
|
|
12438
|
+
"balance",
|
|
12439
|
+
"identity",
|
|
12440
|
+
"project",
|
|
12441
|
+
// Issue #4864: a task's payout gate, as `taskmarket task payout-gate` reads it.
|
|
12442
|
+
"payout-gate",
|
|
12443
|
+
// ADR-0418: the swarm wallet's own listing, as `taskmarket agent listing` reads it.
|
|
12444
|
+
"listing",
|
|
12445
|
+
// ADR-0445: bug reports, as `taskmarket bug browse`, `bug list` and `bug show` read them, signed
|
|
12446
|
+
// only with the read message every hosted policy already allows.
|
|
12447
|
+
"bug-browse",
|
|
12448
|
+
"bug-list",
|
|
12449
|
+
"bug-show",
|
|
12450
|
+
...HOSTED_SKILL_READ_ACTIONS,
|
|
12451
|
+
// ADR-0499: workflow, run and schedule reads, as `taskmarket workflow` and `project schedule` read them.
|
|
12452
|
+
...HOSTED_WORKFLOW_READ_ACTIONS
|
|
12357
12453
|
];
|
|
12358
|
-
var
|
|
12359
|
-
|
|
12360
|
-
|
|
12361
|
-
|
|
12362
|
-
|
|
12363
|
-
|
|
12364
|
-
|
|
12365
|
-
|
|
12366
|
-
|
|
12367
|
-
|
|
12368
|
-
|
|
12369
|
-
|
|
12370
|
-
|
|
12371
|
-
|
|
12372
|
-
|
|
12373
|
-
|
|
12374
|
-
|
|
12375
|
-
|
|
12376
|
-
|
|
12377
|
-
|
|
12378
|
-
|
|
12379
|
-
|
|
12380
|
-
|
|
12381
|
-
|
|
12382
|
-
|
|
12383
|
-
|
|
12384
|
-
|
|
12385
|
-
|
|
12386
|
-
|
|
12387
|
-
|
|
12388
|
-
|
|
12389
|
-
|
|
12390
|
-
|
|
12391
|
-
|
|
12392
|
-
|
|
12393
|
-
|
|
12394
|
-
|
|
12395
|
-
|
|
12396
|
-
|
|
12397
|
-
|
|
12398
|
-
|
|
12399
|
-
|
|
12400
|
-
|
|
12401
|
-
|
|
12402
|
-
|
|
12403
|
-
|
|
12404
|
-
|
|
12405
|
-
|
|
12406
|
-
|
|
12407
|
-
|
|
12408
|
-
|
|
12409
|
-
|
|
12410
|
-
|
|
12411
|
-
|
|
12412
|
-
|
|
12413
|
-
|
|
12414
|
-
|
|
12415
|
-
|
|
12416
|
-
|
|
12417
|
-
|
|
12418
|
-
|
|
12419
|
-
|
|
12420
|
-
|
|
12421
|
-
|
|
12422
|
-
|
|
12454
|
+
var HOSTED_MARKET_WRITE_ACTIONS = [
|
|
12455
|
+
"create",
|
|
12456
|
+
"submit",
|
|
12457
|
+
"accept",
|
|
12458
|
+
"accept-submissions",
|
|
12459
|
+
"rate",
|
|
12460
|
+
"claim",
|
|
12461
|
+
"decline-hire",
|
|
12462
|
+
"pitch",
|
|
12463
|
+
"select-worker",
|
|
12464
|
+
"proof",
|
|
12465
|
+
"bid",
|
|
12466
|
+
"auction-accept",
|
|
12467
|
+
"select-winner",
|
|
12468
|
+
"cancel",
|
|
12469
|
+
"refund-expired",
|
|
12470
|
+
"requester-timeout",
|
|
12471
|
+
"reject-submission",
|
|
12472
|
+
"reject-all-submissions",
|
|
12473
|
+
"update",
|
|
12474
|
+
// ADR-0502: link a gating task to the payout gate of the agent's own task, through the relay.
|
|
12475
|
+
"payout-gate-link",
|
|
12476
|
+
"forfeit",
|
|
12477
|
+
"release",
|
|
12478
|
+
"request-revision",
|
|
12479
|
+
"reject",
|
|
12480
|
+
"settle",
|
|
12481
|
+
"start-review",
|
|
12482
|
+
"assign-evaluator",
|
|
12483
|
+
"evaluate",
|
|
12484
|
+
"appeal",
|
|
12485
|
+
"evaluator-timeout",
|
|
12486
|
+
"finalize-verdict",
|
|
12487
|
+
"resolve-dispute",
|
|
12488
|
+
"unlock",
|
|
12489
|
+
"invite",
|
|
12490
|
+
"uninvite",
|
|
12491
|
+
"identity-register",
|
|
12492
|
+
"project-accept",
|
|
12493
|
+
// ADR-0418: one listing change, as `taskmarket agent profile` and `agent service` send it.
|
|
12494
|
+
// A listing action, not a market action: it signs a listing write message, never one under
|
|
12495
|
+
// `taskmarket:market:`.
|
|
12496
|
+
"listing-change",
|
|
12497
|
+
// ADR-0445: the four bug report writes, as `taskmarket bug submit`, `bug visibility`,
|
|
12498
|
+
// `bug me-too` and `bug comment` send them. Bug report actions, not market actions: each signs
|
|
12499
|
+
// a `bug-report` wallet write message, never one under `taskmarket:market:`.
|
|
12500
|
+
"bug-submit",
|
|
12501
|
+
"bug-visibility",
|
|
12502
|
+
"bug-me-too",
|
|
12503
|
+
"bug-comment",
|
|
12504
|
+
// ADR-0476 section 6: skill writes in the owner's library, made as the session's own agent.
|
|
12505
|
+
...HOSTED_SKILL_WRITE_ACTIONS,
|
|
12506
|
+
// ADR-0499: workflow and workflow-schedule writes under the owner's project grant.
|
|
12507
|
+
...HOSTED_WORKFLOW_WRITE_ACTIONS
|
|
12508
|
+
];
|
|
12509
|
+
var HOSTED_LISTING_WRITE_ACTIONS = ["listing-change"];
|
|
12510
|
+
var HOSTED_BUG_REPORT_WRITE_ACTIONS = [
|
|
12511
|
+
"bug-submit",
|
|
12512
|
+
"bug-visibility",
|
|
12513
|
+
"bug-me-too",
|
|
12514
|
+
"bug-comment"
|
|
12515
|
+
];
|
|
12516
|
+
var HOSTED_BUG_REPORT_ACTIONS = [
|
|
12517
|
+
"bug-browse",
|
|
12518
|
+
"bug-list",
|
|
12519
|
+
"bug-show",
|
|
12520
|
+
...HOSTED_BUG_REPORT_WRITE_ACTIONS
|
|
12521
|
+
];
|
|
12522
|
+
var HostedMarketActionSchema = z60.enum([
|
|
12523
|
+
...HOSTED_MARKET_READ_ACTIONS,
|
|
12524
|
+
...HOSTED_MARKET_WRITE_ACTIONS
|
|
12525
|
+
]);
|
|
12526
|
+
var HostedMarketActionsSchema = z60.array(HostedMarketActionSchema).max(128).refine((actions) => new Set(actions).size === actions.length, "Duplicate Taskmarket actions");
|
|
12527
|
+
var HostedMarketConsentActionsSchema = HostedMarketActionsSchema.superRefine((actions, context) => {
|
|
12528
|
+
actions.forEach((action, index) => {
|
|
12529
|
+
if (HOSTED_LISTING_WRITE_ACTIONS.includes(action))
|
|
12530
|
+
context.addIssue({
|
|
12531
|
+
code: z60.ZodIssueCode.custom,
|
|
12532
|
+
path: [index],
|
|
12533
|
+
message: `${action} is not a market action; grant it with listingEdits`
|
|
12534
|
+
});
|
|
12535
|
+
if (HOSTED_BUG_REPORT_ACTIONS.includes(action))
|
|
12536
|
+
context.addIssue({
|
|
12537
|
+
code: z60.ZodIssueCode.custom,
|
|
12538
|
+
path: [index],
|
|
12539
|
+
message: `${action} is not a market action; grant bug report writes with bugReports`
|
|
12540
|
+
});
|
|
12541
|
+
if (HOSTED_SKILL_ACTIONS.includes(action))
|
|
12542
|
+
context.addIssue({
|
|
12543
|
+
code: z60.ZodIssueCode.custom,
|
|
12544
|
+
path: [index],
|
|
12545
|
+
message: `${action} is not a market action; a hosted agent writes skills as itself`
|
|
12546
|
+
});
|
|
12547
|
+
});
|
|
12548
|
+
});
|
|
12549
|
+
var input = z60.record(z60.unknown()).default({}).refine((value) => {
|
|
12550
|
+
try {
|
|
12551
|
+
return new TextEncoder().encode(JSON.stringify(value)).byteLength <= 65536;
|
|
12552
|
+
} catch {
|
|
12553
|
+
return false;
|
|
12554
|
+
}
|
|
12555
|
+
}, "Taskmarket input is too large");
|
|
12556
|
+
var HostedMarketToolInputSchemas = {
|
|
12557
|
+
taskmarket_read: z60.object({ action: z60.enum(HOSTED_MARKET_READ_ACTIONS), input }).strict(),
|
|
12558
|
+
taskmarket_execute: z60.object({ action: z60.enum(HOSTED_MARKET_WRITE_ACTIONS), requestKey: z60.string().uuid(), input }).strict(),
|
|
12559
|
+
taskmarket_status: z60.object({ requestKey: z60.string().uuid() }).strict()
|
|
12560
|
+
};
|
|
12561
|
+
var HostedMarketRolesSchema = z60.object({
|
|
12562
|
+
scopes: z60.array(z60.string()),
|
|
12563
|
+
notGranted: z60.array(z60.string()),
|
|
12564
|
+
escrowLimit: z60.string().nullable(),
|
|
12565
|
+
escrowUsed: z60.string(),
|
|
12566
|
+
escrowLeft: z60.string().nullable(),
|
|
12567
|
+
note: z60.string().optional()
|
|
12568
|
+
});
|
|
12569
|
+
var HostedMarketReadySchema = z60.object({
|
|
12570
|
+
enabled: z60.boolean(),
|
|
12571
|
+
walletAddress: z60.string().nullable(),
|
|
12572
|
+
chainId: z60.number().int().positive(),
|
|
12573
|
+
apiOrigin: z60.string().url(),
|
|
12574
|
+
actions: HostedMarketActionsSchema,
|
|
12575
|
+
/** False once the owner's consent window closed: free actions and reads still work. */
|
|
12576
|
+
signingWindowOpen: z60.boolean().optional(),
|
|
12577
|
+
/**
|
|
12578
|
+
* ADR-0397 decision 5. How paid market writes (accept, bid, create and the like) are approved:
|
|
12579
|
+
* `live` while a live consent already names one, `at_action` otherwise, when each paid write
|
|
12580
|
+
* raises the owner's approval card as the agent takes it. No consent generation carries paid
|
|
12581
|
+
* authority into the next, so a missing paid action is never a reason to ask for a renewal.
|
|
12582
|
+
*/
|
|
12583
|
+
paidActions: z60.object({ approval: z60.enum(["live", "at_action"]), note: z60.string() }).optional(),
|
|
12584
|
+
/**
|
|
12585
|
+
* ADR-0277. Present when standing free market access, or an exact consent's approved market
|
|
12586
|
+
* actions, predate the market namespace rules: the listed actions are refused until the owner
|
|
12587
|
+
* renews, as the note says.
|
|
12588
|
+
*/
|
|
12589
|
+
marketAccess: z60.object({
|
|
12590
|
+
needsRenewal: z60.literal(true),
|
|
12591
|
+
renewalRequiredFor: HostedMarketActionsSchema,
|
|
12592
|
+
note: z60.string()
|
|
12593
|
+
}).optional(),
|
|
12594
|
+
marketRoles: HostedMarketRolesSchema.optional(),
|
|
12595
|
+
/**
|
|
12596
|
+
* ADR-0418. How this agent may change the swarm wallet's listing: the owner's setting (`off`,
|
|
12597
|
+
* `drafts` or `free`) and whether the owner let hosted agents sign listing changes. With
|
|
12598
|
+
* `agentSigning` false, or `mode` off, `listing-change` is refused and `note` says what the
|
|
12599
|
+
* owner can do.
|
|
12600
|
+
*/
|
|
12601
|
+
listing: z60.object({
|
|
12602
|
+
mode: z60.enum(["off", "drafts", "free"]),
|
|
12603
|
+
agentSigning: z60.boolean(),
|
|
12604
|
+
note: z60.string().optional()
|
|
12605
|
+
}).optional(),
|
|
12606
|
+
/**
|
|
12607
|
+
* ADR-0445. Whether the owner let hosted agents sign bug report writes for the swarm wallet.
|
|
12608
|
+
* With `agentSigning` false, `bug-submit`, `bug-visibility`, `bug-me-too` and `bug-comment` are
|
|
12609
|
+
* refused and `note` says what to ask the owner; the bug report reads work either way.
|
|
12610
|
+
*/
|
|
12611
|
+
bugReports: z60.object({
|
|
12612
|
+
agentSigning: z60.boolean(),
|
|
12613
|
+
note: z60.string().optional()
|
|
12614
|
+
}).optional(),
|
|
12615
|
+
/** The owner's account acceptance of the current terms, or the wallet's own (ADR-0300). */
|
|
12616
|
+
legalAccepted: z60.boolean(),
|
|
12617
|
+
legalRequired: z60.boolean().optional(),
|
|
12618
|
+
/** Present with HOSTED_MARKET_LEGAL_ACCEPTANCE_REQUIRED: what the owner must do. */
|
|
12619
|
+
legalNote: z60.string().optional(),
|
|
12620
|
+
/** Every current gap; `blockersFor` says which writes each one stops. */
|
|
12621
|
+
blockers: z60.array(z60.string()),
|
|
12622
|
+
/**
|
|
12623
|
+
* The same codes by what they stop. `work`: free market writes (claim, free submit, forfeit and
|
|
12624
|
+
* the rest). `purchases`: paid writes and x402 purchases charged to the agent's spending budget.
|
|
12625
|
+
* `publish`: `create`, refused before the owner's approval card. Consent and the spending budget
|
|
12626
|
+
* never block `create`: the card brings its own consent and an approved reward needs no purchase
|
|
12627
|
+
* budget. An `update` raising a reward (or an evaluator stake's assignment) also pays the action
|
|
12628
|
+
* fee from the spending budget, so `purchases` blockers apply to it as well as its card.
|
|
12629
|
+
*/
|
|
12630
|
+
blockersFor: z60.object({
|
|
12631
|
+
work: z60.array(z60.string()),
|
|
12632
|
+
purchases: z60.array(z60.string()),
|
|
12633
|
+
publish: z60.array(z60.string())
|
|
12634
|
+
}).optional(),
|
|
12635
|
+
budget: SwarmBudgetViewSchema.nullable()
|
|
12636
|
+
});
|
|
12637
|
+
var HostedMarketApiOriginSchema = z60.string().url().refine((value) => {
|
|
12638
|
+
const url = new URL(value);
|
|
12639
|
+
return url.protocol === "https:" && !url.username && !url.password && !url.search && !url.hash && url.pathname === "/";
|
|
12640
|
+
}, "Taskmarket requires an explicit HTTPS API origin");
|
|
12641
|
+
var HostedMarketEnvironmentSchema = z60.object({
|
|
12642
|
+
LAUNCHER_AGENT_UI_ENABLED: z60.enum(["true", "false"]).default("false").transform((value) => value === "true"),
|
|
12643
|
+
LAUNCHER_TASKMARKET_ENABLED: z60.enum(["true", "false"]).default("false").transform((value) => value === "true"),
|
|
12644
|
+
TASKMARKET_API_URL: z60.string().url().optional(),
|
|
12645
|
+
/**
|
|
12646
|
+
* ADR-0189. Market events relevant to a swarm wallet start `market` jobs for the
|
|
12647
|
+
* responsible agent. Off by default; effective only with LAUNCHER_TASKMARKET_ENABLED.
|
|
12648
|
+
*/
|
|
12649
|
+
AGENT_MARKET_WAKEUPS_ENABLED: z60.enum(["true", "false"]).default("false").transform((value) => value === "true"),
|
|
12650
|
+
/** ADR-0284. Enable only after all consumer replicas understand pending wakeups. */
|
|
12651
|
+
AGENT_MARKET_WAKEUP_RETRIES_ENABLED: z60.enum(["true", "false"]).default("false").transform((value) => value === "true")
|
|
12652
|
+
});
|
|
12653
|
+
var HostedMarketDownloadSchema = z60.object({
|
|
12654
|
+
kind: z60.literal("hosted_market_download"),
|
|
12655
|
+
artifactId: z60.string().uuid(),
|
|
12656
|
+
fileName: z60.string().min(1).max(255),
|
|
12657
|
+
sha256: z60.string().regex(/^[0-9a-f]{64}$/),
|
|
12658
|
+
bytes: z60.number().int().positive().max(5 * 1024 * 1024)
|
|
12659
|
+
});
|
|
12660
|
+
|
|
12661
|
+
// ../../packages/shared/dist/schemas/agent-platform.schemas.js
|
|
12662
|
+
var AGENT_PLATFORM_COMPONENTS = [
|
|
12663
|
+
"tier",
|
|
12664
|
+
"budget",
|
|
12665
|
+
"schedule",
|
|
12666
|
+
"market",
|
|
12667
|
+
"spending",
|
|
12668
|
+
"connectors",
|
|
12669
|
+
"session-reset",
|
|
12670
|
+
"memory"
|
|
12671
|
+
];
|
|
12672
|
+
var AgentPlatformComponentSchema = z61.enum(AGENT_PLATFORM_COMPONENTS);
|
|
12673
|
+
var AgentPlatformToolInputSchemas = {
|
|
12674
|
+
platform_status: z61.object({}).strict(),
|
|
12675
|
+
ui_show: z61.object({ component: AgentPlatformComponentSchema, reason: z61.string().trim().min(1).max(500) }).strict()
|
|
12676
|
+
};
|
|
12677
|
+
var AgentUiCardSchema = z61.object({
|
|
12678
|
+
component: AgentPlatformComponentSchema,
|
|
12679
|
+
reason: z61.string().max(500),
|
|
12680
|
+
tainted: z61.boolean()
|
|
12681
|
+
});
|
|
12682
|
+
var AgentPlatformStatusSchema = z61.object({
|
|
12683
|
+
version: z61.literal(1),
|
|
12684
|
+
identity: z61.object({
|
|
12685
|
+
agentId: z61.string().uuid(),
|
|
12686
|
+
name: z61.string(),
|
|
12687
|
+
tier: AgentTierSchema,
|
|
12688
|
+
model: z61.string().nullable(),
|
|
12689
|
+
nextTier: AgentTierSchema
|
|
12690
|
+
}),
|
|
12691
|
+
capabilities: z61.array(z61.object({
|
|
12692
|
+
key: z61.string(),
|
|
12693
|
+
enabled: z61.boolean(),
|
|
12694
|
+
blocked: z61.string().nullable(),
|
|
12695
|
+
ownerAction: z61.string().nullable(),
|
|
12696
|
+
link: z61.string(),
|
|
12697
|
+
component: AgentPlatformComponentSchema.nullable()
|
|
12698
|
+
})),
|
|
12699
|
+
budget: SwarmBudgetViewSchema,
|
|
12700
|
+
readiness: z61.object({
|
|
12701
|
+
actions: z61.array(z61.string()),
|
|
12702
|
+
blockers: z61.array(z61.string()),
|
|
12703
|
+
/** As in market capabilities: which writes each blocker stops (work, purchases, publish). */
|
|
12704
|
+
blockersFor: z61.object({
|
|
12705
|
+
work: z61.array(z61.string()),
|
|
12706
|
+
purchases: z61.array(z61.string()),
|
|
12707
|
+
publish: z61.array(z61.string())
|
|
12708
|
+
}).optional(),
|
|
12709
|
+
legalAccepted: z61.boolean(),
|
|
12710
|
+
/** As in market capabilities: roles, the task reward cap, and the owner setting's note. */
|
|
12711
|
+
marketRoles: HostedMarketRolesSchema.optional()
|
|
12712
|
+
}).nullable(),
|
|
12713
|
+
connectors: z61.array(z61.object({ provider: z61.string(), state: z61.string(), actions: z61.array(z61.string()) })),
|
|
12714
|
+
channels: z61.object({ connected: z61.boolean(), coordinatorAgentId: z61.string().uuid().nullable() }),
|
|
12715
|
+
toolGroups: z61.array(z61.string()),
|
|
12716
|
+
swarm: z61.object({
|
|
12717
|
+
canCreate: z61.boolean(),
|
|
12718
|
+
canDispatch: z61.boolean(),
|
|
12719
|
+
coordinator: z61.string().uuid().nullable(),
|
|
12720
|
+
siblings: z61.array(z61.object({ agentId: z61.string().uuid() })),
|
|
12721
|
+
limits: z61.object({
|
|
12722
|
+
createsPerJob: z61.number(),
|
|
12723
|
+
sendsPerJob: z61.number(),
|
|
12724
|
+
depth: z61.number(),
|
|
12725
|
+
agentsPerAccount: z61.number()
|
|
12726
|
+
})
|
|
12727
|
+
}),
|
|
12728
|
+
market: z61.object({
|
|
12729
|
+
scopes: z61.array(z61.string()),
|
|
12730
|
+
/** The task reward cap in base units of the wallet's token; null when the owner set none. */
|
|
12731
|
+
escrowLimit: z61.string().nullable(),
|
|
12732
|
+
/**
|
|
12733
|
+
* What this agent's tasks hold of the cap in its rolling window, and what is left (null when
|
|
12734
|
+
* there is no cap), in the same units. A new reward plus any evaluator stake (for an update,
|
|
12735
|
+
* the increase) above `escrowLeft` is refused. Both are absent when the cap could not be read.
|
|
12736
|
+
*/
|
|
12737
|
+
escrowUsed: z61.string().optional(),
|
|
12738
|
+
escrowLeft: z61.string().nullable().optional(),
|
|
12739
|
+
freeActions: z61.array(z61.string()),
|
|
12740
|
+
freeActionsConditions: z61.string()
|
|
12741
|
+
}),
|
|
12742
|
+
spending: z61.object({
|
|
12743
|
+
mode: z61.enum(["off", "exact", "yolo", "standing"]),
|
|
12744
|
+
maxPurchase: z61.string().nullable(),
|
|
12745
|
+
rollingDay: z61.string().nullable(),
|
|
12746
|
+
period: z61.string().nullable(),
|
|
12747
|
+
/**
|
|
12748
|
+
* ADR-0477 item 7. The Tempo access key that signs this owner's payments, read-only: the owner
|
|
12749
|
+
* authorizes and renews it in the web app, so an agent that finds it anything but `active` or
|
|
12750
|
+
* `expiring` (a payment answers `SWARM_TEMPO_KEY_REQUIRED`) hands the step to the owner.
|
|
12751
|
+
* Null on a Base wallet.
|
|
12752
|
+
*/
|
|
12753
|
+
tempoKey: SwarmTempoKeyStateSchema.nullable().optional()
|
|
12754
|
+
}),
|
|
12755
|
+
memoryScopes: z61.array(z61.string())
|
|
12756
|
+
});
|
|
12757
|
+
var AgentDelegationSchema = z61.object({
|
|
12758
|
+
agentId: z61.string().uuid(),
|
|
12759
|
+
name: z61.string(),
|
|
12760
|
+
jobId: z61.string().uuid(),
|
|
12761
|
+
status: z61.enum(["queued", "running", "completed", "failed", "interrupted"]),
|
|
12762
|
+
waiting: z61.boolean()
|
|
12763
|
+
});
|
|
12764
|
+
|
|
12765
|
+
// ../../packages/shared/dist/schemas/memory.schemas.js
|
|
12766
|
+
import { z as z62 } from "zod";
|
|
12767
|
+
var MEMORY_DOCUMENT_MAX_BYTES = 65536;
|
|
12768
|
+
var MEMORY_ARCHIVE_RETENTION_DAYS = 30;
|
|
12769
|
+
var MEMORY_PATH_MAX_LENGTH = 200;
|
|
12770
|
+
var MEMORY_PATH_MAX_DEPTH = 6;
|
|
12771
|
+
var MEMORY_PATH_SEGMENT_MAX_BYTES = 100;
|
|
12772
|
+
var MEMORY_SEARCH_QUERY_MAX_LENGTH = 200;
|
|
12773
|
+
var MEMORY_SEARCH_MAX_RESULTS = 20;
|
|
12774
|
+
var MEMORY_HISTORY_MAX_RESULTS = 50;
|
|
12775
|
+
var MEMORY_REASON_MAX_LENGTH = 500;
|
|
12776
|
+
var MemoryScopeSchema = z62.enum(["agent", "swarm"]);
|
|
12777
|
+
var MemoryTrustSchema = z62.enum(["owner", "agent", "tainted"]);
|
|
12778
|
+
var MemoryRevisionStatusSchema = z62.enum(["applied", "proposed", "approved", "rejected"]);
|
|
12779
|
+
var MemoryActorSchema = z62.enum(["owner", "agent"]);
|
|
12780
|
+
var MemoryOperationSchema = z62.enum([
|
|
12781
|
+
"create",
|
|
12782
|
+
"replace",
|
|
12783
|
+
"append",
|
|
12784
|
+
"edit",
|
|
12785
|
+
"archive",
|
|
12786
|
+
"rollback",
|
|
12787
|
+
"restore",
|
|
12788
|
+
"promote"
|
|
12789
|
+
]);
|
|
12790
|
+
var MemoryWriteModeSchema = z62.enum(["replace", "append"]);
|
|
12791
|
+
var MemoryWriteOutcomeSchema = z62.enum(["applied", "proposed"]);
|
|
12792
|
+
var LauncherJobSourceSchema = z62.enum([
|
|
12793
|
+
"dashboard",
|
|
12794
|
+
"imessage",
|
|
12795
|
+
"peer",
|
|
12796
|
+
"schedule",
|
|
12797
|
+
"wait",
|
|
12798
|
+
"inbox",
|
|
12799
|
+
// Implements: ADR-0182. A backend-owned job that executes an owner-approved purchase; it runs
|
|
12800
|
+
// no model turn.
|
|
12801
|
+
"purchase",
|
|
12802
|
+
// ADR-0189. A market event relevant to the swarm wallet woke the responsible agent.
|
|
12803
|
+
"market"
|
|
12804
|
+
]);
|
|
12805
|
+
var MEMORY_CORE_TEMPLATE_SECTIONS = [
|
|
12806
|
+
"Owner",
|
|
12807
|
+
"Preferences",
|
|
12808
|
+
"Commitments",
|
|
12809
|
+
"Open threads"
|
|
12810
|
+
];
|
|
12811
|
+
var MEMORY_CORE_TEMPLATE = MEMORY_CORE_TEMPLATE_SECTIONS.map((section2) => `## ${section2}
|
|
12812
|
+
`).join("\n");
|
|
12813
|
+
var MemoryCoreTemplateEnabledSchema = z62.enum(["true", "false"]).default("false").transform((value) => value === "true");
|
|
12814
|
+
function utf8ByteLength(value) {
|
|
12815
|
+
let bytes2 = 0;
|
|
12816
|
+
for (let i = 0; i < value.length; i++) {
|
|
12817
|
+
const code2 = value.charCodeAt(i);
|
|
12818
|
+
if (code2 < 128)
|
|
12819
|
+
bytes2 += 1;
|
|
12820
|
+
else if (code2 < 2048)
|
|
12821
|
+
bytes2 += 2;
|
|
12822
|
+
else if (code2 >= 55296 && code2 <= 56319 && i + 1 < value.length && (value.charCodeAt(i + 1) & 64512) === 56320) {
|
|
12823
|
+
bytes2 += 4;
|
|
12824
|
+
i++;
|
|
12825
|
+
} else
|
|
12826
|
+
bytes2 += 3;
|
|
12827
|
+
}
|
|
12828
|
+
return bytes2;
|
|
12829
|
+
}
|
|
12830
|
+
var SEGMENT = /^[\p{L}\p{N}][\p{L}\p{N} ._-]*$/u;
|
|
12831
|
+
var forbiddenPathCharacter = (value) => [...value].some((c) => {
|
|
12832
|
+
const code2 = c.charCodeAt(0);
|
|
12833
|
+
return code2 < 32 || code2 >= 127 && code2 <= 159 || c === "\\";
|
|
12834
|
+
});
|
|
12835
|
+
var memoryContentIsText = (value) => ![...value].some((c) => {
|
|
12836
|
+
const code2 = c.charCodeAt(0);
|
|
12837
|
+
return code2 < 32 && code2 !== 9 && code2 !== 10 && code2 !== 13 || code2 === 127;
|
|
12838
|
+
});
|
|
12839
|
+
function normalizeMemoryPath(raw) {
|
|
12840
|
+
const value = raw.normalize("NFC").trim();
|
|
12841
|
+
if (!value)
|
|
12842
|
+
return { ok: false, reason: "Path is empty" };
|
|
12843
|
+
if (forbiddenPathCharacter(value))
|
|
12844
|
+
return { ok: false, reason: "Path contains control characters or backslashes" };
|
|
12845
|
+
if (value.startsWith("/") || value.startsWith("~"))
|
|
12846
|
+
return { ok: false, reason: "Path must be relative to its scope" };
|
|
12847
|
+
const segments = value.split("/").filter((part) => part !== "" && part !== ".");
|
|
12848
|
+
if (segments.some((part) => part === ".."))
|
|
12849
|
+
return { ok: false, reason: 'Path must not contain ".."' };
|
|
12850
|
+
if (!segments.length)
|
|
12851
|
+
return { ok: false, reason: "Path is empty" };
|
|
12852
|
+
if (segments.length > MEMORY_PATH_MAX_DEPTH)
|
|
12853
|
+
return { ok: false, reason: `Path is deeper than ${MEMORY_PATH_MAX_DEPTH} segments` };
|
|
12854
|
+
for (const part of segments) {
|
|
12855
|
+
if (!SEGMENT.test(part) || part.endsWith(" ") || part.endsWith("."))
|
|
12856
|
+
return {
|
|
12857
|
+
ok: false,
|
|
12858
|
+
reason: 'Path segments use letters, digits, spaces, ".", "-" and "_" and start with a letter or digit'
|
|
12859
|
+
};
|
|
12860
|
+
if (utf8ByteLength(part) > MEMORY_PATH_SEGMENT_MAX_BYTES)
|
|
12861
|
+
return { ok: false, reason: "Path segment is too long" };
|
|
12862
|
+
}
|
|
12863
|
+
const path3 = segments.join("/");
|
|
12864
|
+
if (path3.length > MEMORY_PATH_MAX_LENGTH)
|
|
12865
|
+
return { ok: false, reason: "Path is too long" };
|
|
12866
|
+
if (!path3.endsWith(".md"))
|
|
12867
|
+
return { ok: false, reason: "Memory documents are markdown (.md)" };
|
|
12868
|
+
return { ok: true, path: path3 };
|
|
12869
|
+
}
|
|
12870
|
+
var MemoryPathSchema = z62.string().max(MEMORY_PATH_MAX_LENGTH * 2).transform((raw, ctx) => {
|
|
12871
|
+
const result = normalizeMemoryPath(raw);
|
|
12872
|
+
if (!result.ok) {
|
|
12873
|
+
ctx.addIssue({ code: "custom", message: result.reason });
|
|
12874
|
+
return z62.NEVER;
|
|
12875
|
+
}
|
|
12423
12876
|
return result.path;
|
|
12424
12877
|
});
|
|
12425
|
-
var MemoryContentSchema =
|
|
12426
|
-
var ReasonSchema =
|
|
12427
|
-
var VersionSchema =
|
|
12428
|
-
var AgentIdSchema =
|
|
12878
|
+
var MemoryContentSchema = z62.string().max(MEMORY_DOCUMENT_MAX_BYTES).refine(memoryContentIsText, "Memory content must be text").refine((value) => utf8ByteLength(value) <= MEMORY_DOCUMENT_MAX_BYTES, `Memory documents are limited to ${MEMORY_DOCUMENT_MAX_BYTES} bytes`);
|
|
12879
|
+
var ReasonSchema = z62.string().trim().max(MEMORY_REASON_MAX_LENGTH).optional();
|
|
12880
|
+
var VersionSchema = z62.number().int().min(0).max(2147483647);
|
|
12881
|
+
var AgentIdSchema = z62.string().uuid();
|
|
12429
12882
|
var target = {
|
|
12430
12883
|
agentId: AgentIdSchema.optional(),
|
|
12431
12884
|
scope: MemoryScopeSchema,
|
|
@@ -12433,9 +12886,9 @@ var target = {
|
|
|
12433
12886
|
};
|
|
12434
12887
|
var agentScopeNeedsAgent = (value) => value.scope !== "agent" || Boolean(value.agentId);
|
|
12435
12888
|
var agentScopeMessage = { message: "agentId is required for the agent scope", path: ["agentId"] };
|
|
12436
|
-
var MemoryTargetInputSchema =
|
|
12437
|
-
var MemoryTreeInputSchema =
|
|
12438
|
-
var MemoryWriteInputSchema =
|
|
12889
|
+
var MemoryTargetInputSchema = z62.object(target).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
12890
|
+
var MemoryTreeInputSchema = z62.object({ agentId: AgentIdSchema.optional(), scope: MemoryScopeSchema.optional() }).strict().refine((value) => value.scope !== "agent" || Boolean(value.agentId), agentScopeMessage);
|
|
12891
|
+
var MemoryWriteInputSchema = z62.object({
|
|
12439
12892
|
...target,
|
|
12440
12893
|
content: MemoryContentSchema,
|
|
12441
12894
|
mode: MemoryWriteModeSchema.default("replace"),
|
|
@@ -12445,30 +12898,30 @@ var MemoryWriteInputSchema = z61.object({
|
|
|
12445
12898
|
* The owner was warned that the content looks like a secret (#713) and saves it anyway.
|
|
12446
12899
|
* Without it, a write that adds a seed phrase, private key or credential is refused.
|
|
12447
12900
|
*/
|
|
12448
|
-
confirmSecrets:
|
|
12901
|
+
confirmSecrets: z62.boolean().optional()
|
|
12449
12902
|
}).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
12450
|
-
var MemoryArchiveInputSchema =
|
|
12451
|
-
var MemoryHistoryInputSchema =
|
|
12903
|
+
var MemoryArchiveInputSchema = z62.object({ ...target, expectedVersion: VersionSchema.optional(), reason: ReasonSchema }).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
12904
|
+
var MemoryHistoryInputSchema = z62.object({
|
|
12452
12905
|
...target,
|
|
12453
|
-
limit:
|
|
12906
|
+
limit: z62.number().int().min(1).max(MEMORY_HISTORY_MAX_RESULTS).default(20),
|
|
12454
12907
|
beforeVersion: VersionSchema.optional()
|
|
12455
12908
|
}).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
12456
|
-
var MemoryRollbackInputSchema =
|
|
12909
|
+
var MemoryRollbackInputSchema = z62.object({
|
|
12457
12910
|
...target,
|
|
12458
12911
|
version: VersionSchema.min(1),
|
|
12459
12912
|
expectedVersion: VersionSchema.optional(),
|
|
12460
12913
|
reason: ReasonSchema
|
|
12461
12914
|
}).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
12462
|
-
var MemorySearchInputSchema =
|
|
12915
|
+
var MemorySearchInputSchema = z62.object({
|
|
12463
12916
|
agentId: AgentIdSchema.optional(),
|
|
12464
12917
|
scope: MemoryScopeSchema.optional(),
|
|
12465
|
-
query:
|
|
12466
|
-
limit:
|
|
12918
|
+
query: z62.string().trim().min(1).max(MEMORY_SEARCH_QUERY_MAX_LENGTH),
|
|
12919
|
+
limit: z62.number().int().min(1).max(MEMORY_SEARCH_MAX_RESULTS).default(10),
|
|
12467
12920
|
/** Also search the agent's own past jobs (SM-61); needs `agentId`. */
|
|
12468
|
-
includeHistory:
|
|
12921
|
+
includeHistory: z62.boolean().optional()
|
|
12469
12922
|
}).strict().refine((value) => value.scope !== "agent" || Boolean(value.agentId), agentScopeMessage);
|
|
12470
|
-
var MemoryForgetInputSchema =
|
|
12471
|
-
var MemoryPromoteInputSchema =
|
|
12923
|
+
var MemoryForgetInputSchema = z62.object({ agentId: AgentIdSchema.optional(), scope: MemoryScopeSchema, reason: ReasonSchema }).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
12924
|
+
var MemoryPromoteInputSchema = z62.object({
|
|
12472
12925
|
agentId: AgentIdSchema,
|
|
12473
12926
|
scope: MemoryScopeSchema.default("agent"),
|
|
12474
12927
|
path: MemoryPathSchema,
|
|
@@ -12476,151 +12929,151 @@ var MemoryPromoteInputSchema = z61.object({
|
|
|
12476
12929
|
expectedVersion: VersionSchema.optional(),
|
|
12477
12930
|
reason: ReasonSchema
|
|
12478
12931
|
}).strict();
|
|
12479
|
-
var MemoryDocumentSummarySchema =
|
|
12480
|
-
documentId:
|
|
12932
|
+
var MemoryDocumentSummarySchema = z62.object({
|
|
12933
|
+
documentId: z62.string().uuid(),
|
|
12481
12934
|
scope: MemoryScopeSchema,
|
|
12482
|
-
path:
|
|
12483
|
-
version:
|
|
12484
|
-
bytes:
|
|
12485
|
-
pinned:
|
|
12486
|
-
readOnly:
|
|
12487
|
-
updatedAt:
|
|
12488
|
-
});
|
|
12489
|
-
var MemoryTreeSchema =
|
|
12490
|
-
documents:
|
|
12491
|
-
limits:
|
|
12492
|
-
documentBytes:
|
|
12493
|
-
scopeDocuments:
|
|
12494
|
-
pinnedRenderBytes:
|
|
12935
|
+
path: z62.string(),
|
|
12936
|
+
version: z62.number().int(),
|
|
12937
|
+
bytes: z62.number().int(),
|
|
12938
|
+
pinned: z62.boolean(),
|
|
12939
|
+
readOnly: z62.boolean(),
|
|
12940
|
+
updatedAt: z62.string()
|
|
12941
|
+
});
|
|
12942
|
+
var MemoryTreeSchema = z62.object({
|
|
12943
|
+
documents: z62.array(MemoryDocumentSummarySchema),
|
|
12944
|
+
limits: z62.object({
|
|
12945
|
+
documentBytes: z62.number().int(),
|
|
12946
|
+
scopeDocuments: z62.number().int(),
|
|
12947
|
+
pinnedRenderBytes: z62.number().int()
|
|
12495
12948
|
})
|
|
12496
12949
|
});
|
|
12497
12950
|
var MemoryDocumentSchema = MemoryDocumentSummarySchema.extend({
|
|
12498
|
-
content:
|
|
12499
|
-
createdAt:
|
|
12500
|
-
archivedAt:
|
|
12951
|
+
content: z62.string(),
|
|
12952
|
+
createdAt: z62.string(),
|
|
12953
|
+
archivedAt: z62.string().nullable(),
|
|
12501
12954
|
/** Actor and trust of the revision that produced the current content. */
|
|
12502
12955
|
lastActor: MemoryActorSchema.nullable(),
|
|
12503
12956
|
lastTrust: MemoryTrustSchema.nullable()
|
|
12504
12957
|
});
|
|
12505
|
-
var MemoryRevisionSchema =
|
|
12506
|
-
id:
|
|
12958
|
+
var MemoryRevisionSchema = z62.object({
|
|
12959
|
+
id: z62.string().uuid(),
|
|
12507
12960
|
/** Null only for a proposal to create a document that does not exist (yet). */
|
|
12508
|
-
documentId:
|
|
12509
|
-
version:
|
|
12510
|
-
content:
|
|
12961
|
+
documentId: z62.string().uuid().nullable(),
|
|
12962
|
+
version: z62.number().int(),
|
|
12963
|
+
content: z62.string(),
|
|
12511
12964
|
operation: MemoryOperationSchema,
|
|
12512
12965
|
status: MemoryRevisionStatusSchema,
|
|
12513
12966
|
actor: MemoryActorSchema,
|
|
12514
|
-
actorAgentId:
|
|
12515
|
-
jobId:
|
|
12516
|
-
sessionId:
|
|
12967
|
+
actorAgentId: z62.string().nullable(),
|
|
12968
|
+
jobId: z62.string().nullable(),
|
|
12969
|
+
sessionId: z62.string().nullable(),
|
|
12517
12970
|
trust: MemoryTrustSchema,
|
|
12518
12971
|
/** Why an agent turn had this trust, e.g. the tool that tainted it (SM-51). */
|
|
12519
|
-
trustReason:
|
|
12520
|
-
reason:
|
|
12521
|
-
sourceDocumentId:
|
|
12522
|
-
sourceVersion:
|
|
12523
|
-
createdAt:
|
|
12524
|
-
decidedAt:
|
|
12525
|
-
});
|
|
12526
|
-
var MemoryHistorySchema =
|
|
12527
|
-
document: MemoryDocumentSummarySchema.extend({ archivedAt:
|
|
12528
|
-
revisions:
|
|
12529
|
-
});
|
|
12530
|
-
var MemoryMutationResultSchema =
|
|
12531
|
-
outcome:
|
|
12972
|
+
trustReason: z62.string().nullable(),
|
|
12973
|
+
reason: z62.string().nullable(),
|
|
12974
|
+
sourceDocumentId: z62.string().uuid().nullable(),
|
|
12975
|
+
sourceVersion: z62.number().int().nullable(),
|
|
12976
|
+
createdAt: z62.string(),
|
|
12977
|
+
decidedAt: z62.string().nullable()
|
|
12978
|
+
});
|
|
12979
|
+
var MemoryHistorySchema = z62.object({
|
|
12980
|
+
document: MemoryDocumentSummarySchema.extend({ archivedAt: z62.string().nullable() }),
|
|
12981
|
+
revisions: z62.array(MemoryRevisionSchema)
|
|
12982
|
+
});
|
|
12983
|
+
var MemoryMutationResultSchema = z62.object({
|
|
12984
|
+
outcome: z62.literal("applied"),
|
|
12532
12985
|
document: MemoryDocumentSchema,
|
|
12533
12986
|
revision: MemoryRevisionSchema
|
|
12534
12987
|
});
|
|
12535
|
-
var MemoryProposedResultSchema =
|
|
12536
|
-
outcome:
|
|
12988
|
+
var MemoryProposedResultSchema = z62.object({
|
|
12989
|
+
outcome: z62.literal("proposed"),
|
|
12537
12990
|
scope: MemoryScopeSchema,
|
|
12538
|
-
path:
|
|
12991
|
+
path: z62.string(),
|
|
12539
12992
|
/** The version the proposal was made against; 0 = the document does not exist. */
|
|
12540
|
-
baseVersion:
|
|
12993
|
+
baseVersion: z62.number().int(),
|
|
12541
12994
|
document: MemoryDocumentSchema.nullable(),
|
|
12542
12995
|
revision: MemoryRevisionSchema
|
|
12543
12996
|
});
|
|
12544
|
-
var MemoryHistoryHitSchema =
|
|
12545
|
-
jobId:
|
|
12997
|
+
var MemoryHistoryHitSchema = z62.object({
|
|
12998
|
+
jobId: z62.string(),
|
|
12546
12999
|
source: LauncherJobSourceSchema.nullable(),
|
|
12547
|
-
status:
|
|
13000
|
+
status: z62.string(),
|
|
12548
13001
|
/** Trust of the job the text came from (its source, the tools its run called, tainted reads). */
|
|
12549
13002
|
trust: MemoryTrustSchema,
|
|
12550
|
-
snippet:
|
|
12551
|
-
score:
|
|
12552
|
-
createdAt:
|
|
12553
|
-
finishedAt:
|
|
12554
|
-
});
|
|
12555
|
-
var MemorySearchResultSchema =
|
|
12556
|
-
results:
|
|
12557
|
-
documentId:
|
|
13003
|
+
snippet: z62.string(),
|
|
13004
|
+
score: z62.number(),
|
|
13005
|
+
createdAt: z62.string(),
|
|
13006
|
+
finishedAt: z62.string().nullable()
|
|
13007
|
+
});
|
|
13008
|
+
var MemorySearchResultSchema = z62.object({
|
|
13009
|
+
results: z62.array(z62.object({
|
|
13010
|
+
documentId: z62.string().uuid(),
|
|
12558
13011
|
scope: MemoryScopeSchema,
|
|
12559
|
-
path:
|
|
12560
|
-
version:
|
|
13012
|
+
path: z62.string(),
|
|
13013
|
+
version: z62.number().int(),
|
|
12561
13014
|
/** When the document last changed. */
|
|
12562
|
-
updatedAt:
|
|
12563
|
-
snippet:
|
|
12564
|
-
score:
|
|
13015
|
+
updatedAt: z62.string(),
|
|
13016
|
+
snippet: z62.string(),
|
|
13017
|
+
score: z62.number(),
|
|
12565
13018
|
/** Trust of the revision that produced the current content. */
|
|
12566
13019
|
trust: MemoryTrustSchema.nullable()
|
|
12567
13020
|
})),
|
|
12568
13021
|
/** Present only when history was requested. */
|
|
12569
|
-
history:
|
|
13022
|
+
history: z62.array(MemoryHistoryHitSchema).optional()
|
|
12570
13023
|
});
|
|
12571
|
-
var MemoryForgetResultSchema =
|
|
12572
|
-
var MemoryProposalsInputSchema =
|
|
12573
|
-
var MemoryProposalDecisionInputSchema =
|
|
12574
|
-
var MemoryProposalSchema =
|
|
12575
|
-
id:
|
|
13024
|
+
var MemoryForgetResultSchema = z62.object({ archived: z62.number().int() });
|
|
13025
|
+
var MemoryProposalsInputSchema = z62.object({ agentId: AgentIdSchema.optional(), scope: MemoryScopeSchema.optional() }).strict().refine((value) => value.scope !== "agent" || Boolean(value.agentId), agentScopeMessage);
|
|
13026
|
+
var MemoryProposalDecisionInputSchema = z62.object({ proposalId: z62.string().uuid() }).strict();
|
|
13027
|
+
var MemoryProposalSchema = z62.object({
|
|
13028
|
+
id: z62.string().uuid(),
|
|
12576
13029
|
scope: MemoryScopeSchema,
|
|
12577
13030
|
/** The private scope's agent; null for the swarm scope. */
|
|
12578
|
-
agentId:
|
|
12579
|
-
path:
|
|
12580
|
-
documentId:
|
|
13031
|
+
agentId: z62.string().nullable(),
|
|
13032
|
+
path: z62.string(),
|
|
13033
|
+
documentId: z62.string().uuid().nullable(),
|
|
12581
13034
|
operation: MemoryOperationSchema,
|
|
12582
13035
|
/** The full proposed content (for `archive`, the content that would be archived). */
|
|
12583
|
-
content:
|
|
13036
|
+
content: z62.string(),
|
|
12584
13037
|
/** The document version the proposal was made against; 0 = the document did not exist. */
|
|
12585
|
-
baseVersion:
|
|
13038
|
+
baseVersion: z62.number().int(),
|
|
12586
13039
|
/** The live document now, to diff against; null when there is none. */
|
|
12587
|
-
current:
|
|
12588
|
-
version:
|
|
12589
|
-
content:
|
|
13040
|
+
current: z62.object({
|
|
13041
|
+
version: z62.number().int(),
|
|
13042
|
+
content: z62.string(),
|
|
12590
13043
|
lastTrust: MemoryTrustSchema.nullable()
|
|
12591
13044
|
}).nullable(),
|
|
12592
13045
|
/** The document changed since the proposal: approving it would conflict. */
|
|
12593
|
-
stale:
|
|
13046
|
+
stale: z62.boolean(),
|
|
12594
13047
|
actor: MemoryActorSchema,
|
|
12595
|
-
actorAgentId:
|
|
13048
|
+
actorAgentId: z62.string().nullable(),
|
|
12596
13049
|
trust: MemoryTrustSchema,
|
|
12597
|
-
trustReason:
|
|
12598
|
-
reason:
|
|
12599
|
-
sessionId:
|
|
12600
|
-
job:
|
|
12601
|
-
id:
|
|
13050
|
+
trustReason: z62.string().nullable(),
|
|
13051
|
+
reason: z62.string().nullable(),
|
|
13052
|
+
sessionId: z62.string().nullable(),
|
|
13053
|
+
job: z62.object({
|
|
13054
|
+
id: z62.string(),
|
|
12602
13055
|
/** The agent that ran the job: the proposer, or its creator for a seeded instructions.md. */
|
|
12603
|
-
agentId:
|
|
13056
|
+
agentId: z62.string(),
|
|
12604
13057
|
source: LauncherJobSourceSchema.nullable(),
|
|
12605
|
-
prompt:
|
|
12606
|
-
createdAt:
|
|
13058
|
+
prompt: z62.string(),
|
|
13059
|
+
createdAt: z62.string()
|
|
12607
13060
|
}).nullable(),
|
|
12608
|
-
createdAt:
|
|
13061
|
+
createdAt: z62.string(),
|
|
12609
13062
|
/**
|
|
12610
13063
|
* When the retention purge removes the proposal undecided, or null when it never does. Only
|
|
12611
13064
|
* proposals with no live document to wait on expire: one to create a document (the archive
|
|
12612
13065
|
* window after it was made) and one on a forgotten document (purged with that document).
|
|
12613
13066
|
*/
|
|
12614
|
-
expiresAt:
|
|
13067
|
+
expiresAt: z62.string().nullable(),
|
|
12615
13068
|
/** `expiresAt` is within MEMORY_PROPOSAL_EXPIRY_WARNING_DAYS. */
|
|
12616
|
-
expiresSoon:
|
|
13069
|
+
expiresSoon: z62.boolean()
|
|
12617
13070
|
});
|
|
12618
|
-
var MemoryProposalListSchema =
|
|
12619
|
-
var MemoryProposalSummaryInputSchema =
|
|
12620
|
-
var MemoryProposalCountSchema =
|
|
12621
|
-
pending:
|
|
13071
|
+
var MemoryProposalListSchema = z62.object({ proposals: z62.array(MemoryProposalSchema) });
|
|
13072
|
+
var MemoryProposalSummaryInputSchema = z62.object({}).strict();
|
|
13073
|
+
var MemoryProposalCountSchema = z62.object({
|
|
13074
|
+
pending: z62.number().int(),
|
|
12622
13075
|
/** Pending proposals flagged `expiresSoon`. */
|
|
12623
|
-
expiringSoon:
|
|
13076
|
+
expiringSoon: z62.number().int()
|
|
12624
13077
|
});
|
|
12625
13078
|
var MemoryProposalSummarySchema = MemoryProposalCountSchema.extend({
|
|
12626
13079
|
/** Proposals to shared memory: every agent's Memory tab lists them. */
|
|
@@ -12629,134 +13082,134 @@ var MemoryProposalSummarySchema = MemoryProposalCountSchema.extend({
|
|
|
12629
13082
|
* Proposals to each agent's private memory, for agents that have any. An agent's Memory tab
|
|
12630
13083
|
* lists its own and the shared ones.
|
|
12631
13084
|
*/
|
|
12632
|
-
agents:
|
|
13085
|
+
agents: z62.array(MemoryProposalCountSchema.extend({ agentId: z62.string() }))
|
|
12633
13086
|
});
|
|
12634
|
-
var MemoryProposalRejectionSchema =
|
|
12635
|
-
var MemoryArchivedInputSchema =
|
|
12636
|
-
var MemoryArchivedDocumentSchema =
|
|
12637
|
-
documentId:
|
|
13087
|
+
var MemoryProposalRejectionSchema = z62.object({ revision: MemoryRevisionSchema });
|
|
13088
|
+
var MemoryArchivedInputSchema = z62.object({ agentId: AgentIdSchema.optional(), scope: MemoryScopeSchema }).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
13089
|
+
var MemoryArchivedDocumentSchema = z62.object({
|
|
13090
|
+
documentId: z62.string().uuid(),
|
|
12638
13091
|
scope: MemoryScopeSchema,
|
|
12639
|
-
path:
|
|
13092
|
+
path: z62.string(),
|
|
12640
13093
|
/** The archive revision's version; restoring rolls back to it (its content is the last text). */
|
|
12641
|
-
version:
|
|
12642
|
-
bytes:
|
|
12643
|
-
pinned:
|
|
12644
|
-
archivedAt:
|
|
13094
|
+
version: z62.number().int(),
|
|
13095
|
+
bytes: z62.number().int(),
|
|
13096
|
+
pinned: z62.boolean(),
|
|
13097
|
+
archivedAt: z62.string(),
|
|
12645
13098
|
/** When the hard purge removes it for good. */
|
|
12646
|
-
purgeAt:
|
|
13099
|
+
purgeAt: z62.string()
|
|
12647
13100
|
});
|
|
12648
|
-
var MemoryArchivedListSchema =
|
|
12649
|
-
documents:
|
|
13101
|
+
var MemoryArchivedListSchema = z62.object({
|
|
13102
|
+
documents: z62.array(MemoryArchivedDocumentSchema)
|
|
12650
13103
|
});
|
|
12651
|
-
var MemoryExportInputSchema =
|
|
12652
|
-
var MemoryExportDocumentSchema =
|
|
12653
|
-
documentId:
|
|
13104
|
+
var MemoryExportInputSchema = z62.object({ cursor: z62.string().min(1).max(512).optional() }).strict();
|
|
13105
|
+
var MemoryExportDocumentSchema = z62.object({
|
|
13106
|
+
documentId: z62.string().uuid(),
|
|
12654
13107
|
scope: MemoryScopeSchema,
|
|
12655
13108
|
/** The private scope's agent; null for shared memory. */
|
|
12656
|
-
agentId:
|
|
12657
|
-
path:
|
|
13109
|
+
agentId: z62.string().nullable(),
|
|
13110
|
+
path: z62.string(),
|
|
12658
13111
|
/** `live` is what agents read now; `forgotten` is archived and purged at `purgeAt`. */
|
|
12659
|
-
status:
|
|
12660
|
-
pinned:
|
|
12661
|
-
version:
|
|
12662
|
-
bytes:
|
|
13112
|
+
status: z62.enum(["live", "forgotten"]),
|
|
13113
|
+
pinned: z62.boolean(),
|
|
13114
|
+
version: z62.number().int(),
|
|
13115
|
+
bytes: z62.number().int(),
|
|
12663
13116
|
/** The current text, or the last text of a forgotten document. */
|
|
12664
|
-
content:
|
|
12665
|
-
createdAt:
|
|
12666
|
-
updatedAt:
|
|
12667
|
-
archivedAt:
|
|
12668
|
-
purgeAt:
|
|
13117
|
+
content: z62.string(),
|
|
13118
|
+
createdAt: z62.string(),
|
|
13119
|
+
updatedAt: z62.string(),
|
|
13120
|
+
archivedAt: z62.string().nullable(),
|
|
13121
|
+
purgeAt: z62.string().nullable()
|
|
12669
13122
|
});
|
|
12670
13123
|
var MemoryExportRevisionSchema = MemoryRevisionSchema.extend({
|
|
12671
13124
|
scope: MemoryScopeSchema,
|
|
12672
|
-
agentId:
|
|
12673
|
-
path:
|
|
13125
|
+
agentId: z62.string().nullable(),
|
|
13126
|
+
path: z62.string()
|
|
12674
13127
|
});
|
|
12675
|
-
var MemoryExportPageSchema =
|
|
13128
|
+
var MemoryExportPageSchema = z62.object({
|
|
12676
13129
|
/** The owner's agents, to name each private scope. */
|
|
12677
|
-
agents:
|
|
13130
|
+
agents: z62.array(z62.object({ agentId: z62.string(), name: z62.string() })),
|
|
12678
13131
|
/** Documents first seen on this page; their revisions may continue on later pages. */
|
|
12679
|
-
documents:
|
|
12680
|
-
revisions:
|
|
12681
|
-
nextCursor:
|
|
13132
|
+
documents: z62.array(MemoryExportDocumentSchema),
|
|
13133
|
+
revisions: z62.array(MemoryExportRevisionSchema),
|
|
13134
|
+
nextCursor: z62.string().nullable()
|
|
12682
13135
|
});
|
|
12683
|
-
var ToolPathSchema =
|
|
12684
|
-
var ToolReasonSchema =
|
|
13136
|
+
var ToolPathSchema = z62.string().min(1).max(MEMORY_PATH_MAX_LENGTH * 2);
|
|
13137
|
+
var ToolReasonSchema = z62.string().trim().min(1).max(MEMORY_REASON_MAX_LENGTH);
|
|
12685
13138
|
var MemoryToolInputSchemas = {
|
|
12686
|
-
memory_view:
|
|
13139
|
+
memory_view: z62.object({
|
|
12687
13140
|
scope: MemoryScopeSchema.optional(),
|
|
12688
13141
|
path: ToolPathSchema.optional(),
|
|
12689
|
-
offset:
|
|
13142
|
+
offset: z62.number().int().min(0).max(MEMORY_DOCUMENT_MAX_BYTES).optional()
|
|
12690
13143
|
}).strict(),
|
|
12691
|
-
memory_search:
|
|
12692
|
-
query:
|
|
13144
|
+
memory_search: z62.object({
|
|
13145
|
+
query: z62.string().trim().min(1).max(MEMORY_SEARCH_QUERY_MAX_LENGTH),
|
|
12693
13146
|
scope: MemoryScopeSchema.optional(),
|
|
12694
|
-
limit:
|
|
13147
|
+
limit: z62.number().int().min(1).max(MEMORY_SEARCH_MAX_RESULTS).optional(),
|
|
12695
13148
|
/** Also search this agent's own past jobs (SM-61). */
|
|
12696
|
-
include_history:
|
|
13149
|
+
include_history: z62.boolean().optional()
|
|
12697
13150
|
}).strict(),
|
|
12698
|
-
memory_write:
|
|
13151
|
+
memory_write: z62.object({
|
|
12699
13152
|
scope: MemoryScopeSchema.optional(),
|
|
12700
13153
|
path: ToolPathSchema,
|
|
12701
|
-
content:
|
|
13154
|
+
content: z62.string().max(MEMORY_DOCUMENT_MAX_BYTES),
|
|
12702
13155
|
mode: MemoryWriteModeSchema.optional(),
|
|
12703
13156
|
expected_version: VersionSchema.optional()
|
|
12704
13157
|
}).strict(),
|
|
12705
|
-
memory_edit:
|
|
13158
|
+
memory_edit: z62.object({
|
|
12706
13159
|
scope: MemoryScopeSchema.optional(),
|
|
12707
13160
|
path: ToolPathSchema,
|
|
12708
|
-
old_text:
|
|
12709
|
-
new_text:
|
|
13161
|
+
old_text: z62.string().min(1).max(MEMORY_DOCUMENT_MAX_BYTES),
|
|
13162
|
+
new_text: z62.string().max(MEMORY_DOCUMENT_MAX_BYTES),
|
|
12710
13163
|
expected_version: VersionSchema
|
|
12711
13164
|
}).strict(),
|
|
12712
|
-
memory_delete:
|
|
13165
|
+
memory_delete: z62.object({ scope: MemoryScopeSchema.optional(), path: ToolPathSchema, reason: ToolReasonSchema }).strict()
|
|
12713
13166
|
};
|
|
12714
13167
|
var MEMORY_TOOL_NAMES = Object.keys(MemoryToolInputSchemas);
|
|
12715
13168
|
|
|
12716
13169
|
// ../../packages/shared/dist/schemas/launcher.schemas.js
|
|
12717
|
-
var LauncherAgentIdSchema =
|
|
13170
|
+
var LauncherAgentIdSchema = z63.object({ agentId: z63.string().uuid() });
|
|
12718
13171
|
var SANDBOX_TOOL_SETS = ["minimal", "full"];
|
|
12719
|
-
var SandboxToolSetSchema =
|
|
13172
|
+
var SandboxToolSetSchema = z63.enum(SANDBOX_TOOL_SETS);
|
|
12720
13173
|
var DEFAULT_SANDBOX_TOOL_SET = "minimal";
|
|
12721
13174
|
var LauncherSetSandboxToolsSchema = LauncherAgentIdSchema.extend({
|
|
12722
13175
|
sandboxTools: SandboxToolSetSchema
|
|
12723
13176
|
}).strict();
|
|
12724
|
-
var LauncherAvatarSchema =
|
|
12725
|
-
version:
|
|
12726
|
-
color:
|
|
12727
|
-
face:
|
|
13177
|
+
var LauncherAvatarSchema = z63.object({
|
|
13178
|
+
version: z63.literal(1),
|
|
13179
|
+
color: z63.enum(["rose", "mint", "blue", "amber", "mauve", "cocoa"]),
|
|
13180
|
+
face: z63.number().int().min(0).max(5),
|
|
12728
13181
|
/** Shape 0-6. Values 0-2 predate the wider range and keep their shapes. */
|
|
12729
|
-
head:
|
|
12730
|
-
antenna:
|
|
12731
|
-
ears:
|
|
12732
|
-
markings:
|
|
13182
|
+
head: z63.number().int().min(0).max(6),
|
|
13183
|
+
antenna: z63.number().int().min(0).max(3),
|
|
13184
|
+
ears: z63.number().int().min(0).max(2),
|
|
13185
|
+
markings: z63.number().int().min(0).max(255),
|
|
12733
13186
|
/**
|
|
12734
13187
|
* @deprecated Plush is the only companion style. Still accepted so avatars saved with a
|
|
12735
13188
|
* style parse, but ignored by every renderer; new saves omit it.
|
|
12736
13189
|
*/
|
|
12737
|
-
style:
|
|
13190
|
+
style: z63.enum(["vinyl", "gummy", "visor", "plush"]).optional()
|
|
12738
13191
|
}).strict();
|
|
12739
13192
|
var LauncherUpdateAvatarSchema = LauncherAgentIdSchema.extend({
|
|
12740
13193
|
avatar: LauncherAvatarSchema
|
|
12741
13194
|
});
|
|
12742
|
-
var LauncherLaunchSchema =
|
|
12743
|
-
requestKey:
|
|
12744
|
-
name:
|
|
12745
|
-
prompt:
|
|
13195
|
+
var LauncherLaunchSchema = z63.object({
|
|
13196
|
+
requestKey: z63.string().uuid(),
|
|
13197
|
+
name: z63.string().trim().min(1).max(100),
|
|
13198
|
+
prompt: z63.string().trim().min(1).max(32768),
|
|
12746
13199
|
avatar: LauncherAvatarSchema.optional(),
|
|
12747
13200
|
/** Capability tier for the new agent. Absent is light. */
|
|
12748
13201
|
tier: AgentTierSchema.optional()
|
|
12749
13202
|
}).strict();
|
|
12750
|
-
var LauncherSessionResetSchema =
|
|
12751
|
-
var LauncherArchiveResultSchema =
|
|
12752
|
-
agentId:
|
|
12753
|
-
archivedAt:
|
|
12754
|
-
cancelledJobs:
|
|
12755
|
-
disabledSchedule:
|
|
12756
|
-
updatedChannels:
|
|
12757
|
-
disconnectedChannels:
|
|
12758
|
-
deniedApprovals:
|
|
12759
|
-
revokedMcpTokens:
|
|
13203
|
+
var LauncherSessionResetSchema = z63.object({ version: z63.number().int().positive(), requestedAt: z63.string().datetime() }).strict();
|
|
13204
|
+
var LauncherArchiveResultSchema = z63.object({
|
|
13205
|
+
agentId: z63.string().uuid(),
|
|
13206
|
+
archivedAt: z63.string().datetime(),
|
|
13207
|
+
cancelledJobs: z63.number().int().nonnegative(),
|
|
13208
|
+
disabledSchedule: z63.boolean(),
|
|
13209
|
+
updatedChannels: z63.number().int().nonnegative(),
|
|
13210
|
+
disconnectedChannels: z63.number().int().nonnegative(),
|
|
13211
|
+
deniedApprovals: z63.number().int().nonnegative(),
|
|
13212
|
+
revokedMcpTokens: z63.number().int().nonnegative()
|
|
12760
13213
|
}).strict();
|
|
12761
13214
|
var LAUNCHER_ATTACHMENT_MIME_TYPES = [
|
|
12762
13215
|
"image/png",
|
|
@@ -12766,54 +13219,54 @@ var LAUNCHER_ATTACHMENT_MIME_TYPES = [
|
|
|
12766
13219
|
"application/pdf",
|
|
12767
13220
|
"text/plain"
|
|
12768
13221
|
];
|
|
12769
|
-
var LauncherAttachmentMimeTypeSchema =
|
|
13222
|
+
var LauncherAttachmentMimeTypeSchema = z63.enum(LAUNCHER_ATTACHMENT_MIME_TYPES);
|
|
12770
13223
|
var MAX_LAUNCHER_ATTACHMENT_BYTES = 10 * 1024 * 1024;
|
|
12771
13224
|
var MAX_LAUNCHER_ATTACHMENTS = 10;
|
|
12772
|
-
var LauncherAttachmentNameSchema =
|
|
12773
|
-
var LauncherAttachmentSchema =
|
|
12774
|
-
id:
|
|
13225
|
+
var LauncherAttachmentNameSchema = z63.string().trim().min(1).max(180).refine((name) => !/[\\/]/.test(name) && [...name].every((c) => c.charCodeAt(0) >= 32 && c.charCodeAt(0) !== 127), "Invalid file name");
|
|
13226
|
+
var LauncherAttachmentSchema = z63.object({
|
|
13227
|
+
id: z63.string().uuid(),
|
|
12775
13228
|
name: LauncherAttachmentNameSchema,
|
|
12776
13229
|
mimeType: LauncherAttachmentMimeTypeSchema,
|
|
12777
|
-
bytes:
|
|
12778
|
-
sha256:
|
|
13230
|
+
bytes: z63.number().int().positive().max(MAX_LAUNCHER_ATTACHMENT_BYTES),
|
|
13231
|
+
sha256: z63.string().regex(/^[0-9a-f]{64}$/)
|
|
12779
13232
|
}).strict();
|
|
12780
13233
|
var LauncherAttachmentInputSchema = LauncherAgentIdSchema.extend({
|
|
12781
|
-
attachmentId:
|
|
13234
|
+
attachmentId: z63.string().uuid()
|
|
12782
13235
|
}).strict();
|
|
12783
13236
|
var LauncherMessageSchema = LauncherAgentIdSchema.extend({
|
|
12784
|
-
requestKey:
|
|
12785
|
-
prompt:
|
|
13237
|
+
requestKey: z63.string().uuid(),
|
|
13238
|
+
prompt: z63.string().trim().max(32768),
|
|
12786
13239
|
/** Uploaded with the attachment route and not yet sent with another message. */
|
|
12787
|
-
attachmentIds:
|
|
13240
|
+
attachmentIds: z63.array(z63.string().uuid()).max(MAX_LAUNCHER_ATTACHMENTS).optional()
|
|
12788
13241
|
}).strict();
|
|
12789
|
-
var LauncherJobStatusSchema =
|
|
13242
|
+
var LauncherJobStatusSchema = z63.enum([
|
|
12790
13243
|
"queued",
|
|
12791
13244
|
"running",
|
|
12792
13245
|
"completed",
|
|
12793
13246
|
"failed",
|
|
12794
13247
|
"interrupted"
|
|
12795
13248
|
]);
|
|
12796
|
-
var LauncherJobSchema =
|
|
12797
|
-
id:
|
|
13249
|
+
var LauncherJobSchema = z63.object({
|
|
13250
|
+
id: z63.string().uuid(),
|
|
12798
13251
|
status: LauncherJobStatusSchema,
|
|
12799
|
-
runId:
|
|
12800
|
-
output:
|
|
12801
|
-
errorCode:
|
|
12802
|
-
createdAt:
|
|
12803
|
-
finishedAt:
|
|
13252
|
+
runId: z63.string().uuid().nullable(),
|
|
13253
|
+
output: z63.string().nullable(),
|
|
13254
|
+
errorCode: z63.string().nullable(),
|
|
13255
|
+
createdAt: z63.string(),
|
|
13256
|
+
finishedAt: z63.string().nullable()
|
|
12804
13257
|
});
|
|
12805
|
-
var LauncherAcceptedSchema =
|
|
12806
|
-
agentId:
|
|
12807
|
-
jobId:
|
|
13258
|
+
var LauncherAcceptedSchema = z63.object({
|
|
13259
|
+
agentId: z63.string().uuid(),
|
|
13260
|
+
jobId: z63.string().uuid(),
|
|
12808
13261
|
status: LauncherJobStatusSchema
|
|
12809
13262
|
});
|
|
12810
|
-
var LauncherAgentSchema =
|
|
12811
|
-
id:
|
|
12812
|
-
name:
|
|
13263
|
+
var LauncherAgentSchema = z63.object({
|
|
13264
|
+
id: z63.string().uuid(),
|
|
13265
|
+
name: z63.string(),
|
|
12813
13266
|
avatar: LauncherAvatarSchema.nullish(),
|
|
12814
|
-
paused:
|
|
13267
|
+
paused: z63.boolean(),
|
|
12815
13268
|
/** True once the owner deleted the agent; only a direct read by id returns such an agent. */
|
|
12816
|
-
archived:
|
|
13269
|
+
archived: z63.boolean().optional(),
|
|
12817
13270
|
/**
|
|
12818
13271
|
* The agent's capability tier. A change applies from its next job; a running job keeps the tier
|
|
12819
13272
|
* it was admitted under. Absent only from a backend that predates tiers, which ran every agent
|
|
@@ -12826,68 +13279,68 @@ var LauncherAgentSchema = z62.object({
|
|
|
12826
13279
|
* the setting.
|
|
12827
13280
|
*/
|
|
12828
13281
|
sandboxTools: SandboxToolSetSchema.default(DEFAULT_SANDBOX_TOOL_SET),
|
|
12829
|
-
controlVersion:
|
|
12830
|
-
workspaceReady:
|
|
12831
|
-
usage:
|
|
12832
|
-
available:
|
|
12833
|
-
reserved:
|
|
12834
|
-
spent:
|
|
12835
|
-
unit:
|
|
13282
|
+
controlVersion: z63.number().int(),
|
|
13283
|
+
workspaceReady: z63.boolean(),
|
|
13284
|
+
usage: z63.object({
|
|
13285
|
+
available: z63.number(),
|
|
13286
|
+
reserved: z63.number(),
|
|
13287
|
+
spent: z63.number(),
|
|
13288
|
+
unit: z63.literal("tokens")
|
|
12836
13289
|
})
|
|
12837
13290
|
});
|
|
12838
|
-
var LauncherStatusSchema =
|
|
13291
|
+
var LauncherStatusSchema = z63.object({
|
|
12839
13292
|
agent: LauncherAgentSchema,
|
|
12840
|
-
jobs:
|
|
13293
|
+
jobs: z63.array(LauncherJobSchema)
|
|
12841
13294
|
});
|
|
12842
13295
|
var LauncherEventsInputSchema = LauncherAgentIdSchema.extend({
|
|
12843
|
-
after:
|
|
12844
|
-
limit:
|
|
12845
|
-
});
|
|
12846
|
-
var LauncherEventsSchema =
|
|
12847
|
-
events:
|
|
12848
|
-
id:
|
|
12849
|
-
runId:
|
|
12850
|
-
type:
|
|
12851
|
-
createdAt:
|
|
13296
|
+
after: z63.number().int().nonnegative().default(0),
|
|
13297
|
+
limit: z63.number().int().min(1).max(100).default(50)
|
|
13298
|
+
});
|
|
13299
|
+
var LauncherEventsSchema = z63.object({
|
|
13300
|
+
events: z63.array(z63.object({
|
|
13301
|
+
id: z63.number().int(),
|
|
13302
|
+
runId: z63.string().uuid(),
|
|
13303
|
+
type: z63.string(),
|
|
13304
|
+
createdAt: z63.string()
|
|
12852
13305
|
})),
|
|
12853
|
-
nextCursor:
|
|
13306
|
+
nextCursor: z63.number().int()
|
|
12854
13307
|
});
|
|
12855
13308
|
var LauncherArtifactInputSchema = LauncherAgentIdSchema.extend({
|
|
12856
|
-
artifactId:
|
|
13309
|
+
artifactId: z63.string().uuid()
|
|
12857
13310
|
});
|
|
12858
|
-
var LauncherArtifactsInputSchema =
|
|
12859
|
-
agentId:
|
|
13311
|
+
var LauncherArtifactsInputSchema = z63.object({
|
|
13312
|
+
agentId: z63.string().uuid(),
|
|
12860
13313
|
/** Only the files one turn (run) produced. */
|
|
12861
|
-
runId:
|
|
13314
|
+
runId: z63.string().uuid().optional(),
|
|
12862
13315
|
/** Only the versions of this exact file path. */
|
|
12863
|
-
path:
|
|
12864
|
-
limit:
|
|
13316
|
+
path: z63.string().min(1).max(1024).optional(),
|
|
13317
|
+
limit: z63.number().int().min(1).max(100).default(100).optional(),
|
|
12865
13318
|
/** The previous page's nextBefore. */
|
|
12866
|
-
before:
|
|
13319
|
+
before: z63.string().max(80).regex(/^\d{1,20}:[0-9a-f-]{36}$/).optional()
|
|
12867
13320
|
});
|
|
12868
|
-
var LauncherArtifactsSchema =
|
|
13321
|
+
var LauncherArtifactsSchema = z63.object({
|
|
12869
13322
|
/** Pass as `before` for older files; null or absent at the end. */
|
|
12870
|
-
nextBefore:
|
|
12871
|
-
artifacts:
|
|
12872
|
-
id:
|
|
12873
|
-
runId:
|
|
12874
|
-
path:
|
|
12875
|
-
displayName:
|
|
12876
|
-
sha256:
|
|
12877
|
-
bytes:
|
|
12878
|
-
createdAt:
|
|
13323
|
+
nextBefore: z63.string().nullable().optional(),
|
|
13324
|
+
artifacts: z63.array(z63.object({
|
|
13325
|
+
id: z63.string().uuid(),
|
|
13326
|
+
runId: z63.string().uuid(),
|
|
13327
|
+
path: z63.string(),
|
|
13328
|
+
displayName: z63.string().optional(),
|
|
13329
|
+
sha256: z63.string(),
|
|
13330
|
+
bytes: z63.number(),
|
|
13331
|
+
createdAt: z63.string()
|
|
12879
13332
|
}))
|
|
12880
13333
|
});
|
|
12881
|
-
var LauncherArtifactUrlSchema =
|
|
12882
|
-
url:
|
|
12883
|
-
expiresIn:
|
|
13334
|
+
var LauncherArtifactUrlSchema = z63.object({
|
|
13335
|
+
url: z63.string().url(),
|
|
13336
|
+
expiresIn: z63.number().int()
|
|
12884
13337
|
});
|
|
12885
|
-
var LauncherAccountSchema =
|
|
12886
|
-
enabled:
|
|
12887
|
-
agentId:
|
|
12888
|
-
initialTokens:
|
|
12889
|
-
agentCount:
|
|
12890
|
-
maxAgents:
|
|
13338
|
+
var LauncherAccountSchema = z63.object({
|
|
13339
|
+
enabled: z63.boolean(),
|
|
13340
|
+
agentId: z63.string().uuid().nullable(),
|
|
13341
|
+
initialTokens: z63.number().int().nonnegative(),
|
|
13342
|
+
agentCount: z63.number().int().nonnegative(),
|
|
13343
|
+
maxAgents: z63.number().int().positive(),
|
|
12891
13344
|
/**
|
|
12892
13345
|
* @deprecated Kept for one release so a web bundle built before its removal, which reads
|
|
12893
13346
|
* `account.usage.available` without a guard, does not crash during a deploy or in a stale tab.
|
|
@@ -12895,158 +13348,158 @@ var LauncherAccountSchema = z62.object({
|
|
|
12895
13348
|
* allowance, and the shared token balance lives on each agent's `usage`. Remove next release.
|
|
12896
13349
|
*/
|
|
12897
13350
|
usage: LauncherAgentSchema.shape.usage.optional(),
|
|
12898
|
-
providerUsage:
|
|
12899
|
-
basis:
|
|
12900
|
-
provisional:
|
|
12901
|
-
inputTokens:
|
|
12902
|
-
outputTokens:
|
|
12903
|
-
totalTokens:
|
|
12904
|
-
cachedInputTokens:
|
|
12905
|
-
reasoningTokens:
|
|
12906
|
-
reportedTurns:
|
|
12907
|
-
unknownTurns:
|
|
12908
|
-
invalidObservations:
|
|
12909
|
-
missingCachedDetails:
|
|
12910
|
-
missingReasoningDetails:
|
|
12911
|
-
truncated:
|
|
13351
|
+
providerUsage: z63.object({
|
|
13352
|
+
basis: z63.literal("recorded_provider_turns"),
|
|
13353
|
+
provisional: z63.literal(true),
|
|
13354
|
+
inputTokens: z63.string().regex(/^\d+$/),
|
|
13355
|
+
outputTokens: z63.string().regex(/^\d+$/),
|
|
13356
|
+
totalTokens: z63.string().regex(/^\d+$/),
|
|
13357
|
+
cachedInputTokens: z63.string().regex(/^\d+$/),
|
|
13358
|
+
reasoningTokens: z63.string().regex(/^\d+$/),
|
|
13359
|
+
reportedTurns: z63.number().int().nonnegative(),
|
|
13360
|
+
unknownTurns: z63.number().int().nonnegative(),
|
|
13361
|
+
invalidObservations: z63.number().int().nonnegative(),
|
|
13362
|
+
missingCachedDetails: z63.number().int().nonnegative(),
|
|
13363
|
+
missingReasoningDetails: z63.number().int().nonnegative(),
|
|
13364
|
+
truncated: z63.boolean()
|
|
12912
13365
|
}).optional()
|
|
12913
13366
|
});
|
|
12914
13367
|
var LauncherTurnSchema = LauncherJobSchema.extend({
|
|
12915
|
-
uiCards:
|
|
12916
|
-
delegations:
|
|
12917
|
-
sequence:
|
|
12918
|
-
requestKey:
|
|
12919
|
-
prompt:
|
|
12920
|
-
senderAgentId:
|
|
12921
|
-
automaticContinuation:
|
|
13368
|
+
uiCards: z63.array(AgentUiCardSchema).max(3).optional(),
|
|
13369
|
+
delegations: z63.array(AgentDelegationSchema).optional(),
|
|
13370
|
+
sequence: z63.number().int(),
|
|
13371
|
+
requestKey: z63.string().uuid(),
|
|
13372
|
+
prompt: z63.string(),
|
|
13373
|
+
senderAgentId: z63.string().uuid().nullable().default(null),
|
|
13374
|
+
automaticContinuation: z63.boolean().optional(),
|
|
12922
13375
|
/**
|
|
12923
13376
|
* #3627. The prompt was written by the host (a `market` job: a market event or the outcome of
|
|
12924
13377
|
* a paid write or purchase), not by the owner, so it is shown as a notice, not their message.
|
|
12925
13378
|
*/
|
|
12926
|
-
hostNotice:
|
|
12927
|
-
channelRequest:
|
|
13379
|
+
hostNotice: z63.boolean().optional(),
|
|
13380
|
+
channelRequest: z63.object({ id: z63.string().uuid(), reference: z63.string() }).nullable().optional(),
|
|
12928
13381
|
/** Files the owner sent with this message, in the order they were attached. */
|
|
12929
|
-
attachments:
|
|
13382
|
+
attachments: z63.array(LauncherAttachmentSchema).max(MAX_LAUNCHER_ATTACHMENTS).optional()
|
|
12930
13383
|
});
|
|
12931
13384
|
var LauncherHistoryInputSchema = LauncherAgentIdSchema.extend({
|
|
12932
|
-
before:
|
|
12933
|
-
limit:
|
|
12934
|
-
});
|
|
12935
|
-
var LauncherHistorySchema =
|
|
12936
|
-
turns:
|
|
12937
|
-
nextBefore:
|
|
12938
|
-
});
|
|
12939
|
-
var LauncherJobInputSchema = LauncherAgentIdSchema.extend({ jobId:
|
|
12940
|
-
var LauncherActivitySchema =
|
|
12941
|
-
id:
|
|
12942
|
-
version:
|
|
12943
|
-
runId:
|
|
12944
|
-
type:
|
|
12945
|
-
label:
|
|
12946
|
-
outcome:
|
|
12947
|
-
createdAt:
|
|
12948
|
-
});
|
|
12949
|
-
var LauncherActivityPageSchema =
|
|
12950
|
-
events:
|
|
12951
|
-
nextBefore:
|
|
12952
|
-
});
|
|
12953
|
-
var LauncherViewSchema =
|
|
12954
|
-
agentUiEnabled:
|
|
12955
|
-
trial:
|
|
13385
|
+
before: z63.number().int().positive().optional(),
|
|
13386
|
+
limit: z63.number().int().min(1).max(50).default(20)
|
|
13387
|
+
});
|
|
13388
|
+
var LauncherHistorySchema = z63.object({
|
|
13389
|
+
turns: z63.array(LauncherTurnSchema),
|
|
13390
|
+
nextBefore: z63.number().int().nullable()
|
|
13391
|
+
});
|
|
13392
|
+
var LauncherJobInputSchema = LauncherAgentIdSchema.extend({ jobId: z63.string().uuid() });
|
|
13393
|
+
var LauncherActivitySchema = z63.object({
|
|
13394
|
+
id: z63.number().int(),
|
|
13395
|
+
version: z63.literal(1),
|
|
13396
|
+
runId: z63.string().uuid(),
|
|
13397
|
+
type: z63.string(),
|
|
13398
|
+
label: z63.string(),
|
|
13399
|
+
outcome: z63.enum(["started", "completed", "failed", "info"]),
|
|
13400
|
+
createdAt: z63.string()
|
|
13401
|
+
});
|
|
13402
|
+
var LauncherActivityPageSchema = z63.object({
|
|
13403
|
+
events: z63.array(LauncherActivitySchema),
|
|
13404
|
+
nextBefore: z63.number().int().nullable()
|
|
13405
|
+
});
|
|
13406
|
+
var LauncherViewSchema = z63.object({
|
|
13407
|
+
agentUiEnabled: z63.boolean().optional(),
|
|
13408
|
+
trial: z63.boolean().optional(),
|
|
12956
13409
|
agent: LauncherAgentSchema,
|
|
12957
|
-
accessEnabled:
|
|
12958
|
-
state:
|
|
12959
|
-
compute:
|
|
12960
|
-
queuedCount:
|
|
13410
|
+
accessEnabled: z63.boolean(),
|
|
13411
|
+
state: z63.enum(["ready", "queued", "working", "paused", "recovering", "interrupted", "exhausted"]),
|
|
13412
|
+
compute: z63.enum(["not_created", "starting", "running", "stopped", "unknown"]),
|
|
13413
|
+
queuedCount: z63.number().int(),
|
|
12961
13414
|
/**
|
|
12962
13415
|
* The agent's running or parked job, which every queued job waits behind until it finishes
|
|
12963
13416
|
* (#2030). Its source tells the owner what a message is waiting for. Optional so a web bundle
|
|
12964
13417
|
* newer than the backend still reads an older view.
|
|
12965
13418
|
*/
|
|
12966
|
-
blockedBy:
|
|
13419
|
+
blockedBy: z63.object({ jobId: z63.string().uuid(), source: LauncherJobSourceSchema.nullable() }).nullable().optional(),
|
|
12967
13420
|
history: LauncherHistorySchema,
|
|
12968
13421
|
activity: LauncherActivityPageSchema
|
|
12969
13422
|
});
|
|
12970
|
-
var LauncherPreviewSchema =
|
|
12971
|
-
|
|
12972
|
-
kind:
|
|
12973
|
-
content:
|
|
12974
|
-
fileName:
|
|
13423
|
+
var LauncherPreviewSchema = z63.discriminatedUnion("kind", [
|
|
13424
|
+
z63.object({
|
|
13425
|
+
kind: z63.literal("text"),
|
|
13426
|
+
content: z63.string().max(65536),
|
|
13427
|
+
fileName: z63.string().optional()
|
|
12975
13428
|
}),
|
|
12976
|
-
|
|
12977
|
-
kind:
|
|
12978
|
-
content:
|
|
12979
|
-
fileName:
|
|
13429
|
+
z63.object({
|
|
13430
|
+
kind: z63.literal("html"),
|
|
13431
|
+
content: z63.string().max(5 * 1024 * 1024),
|
|
13432
|
+
fileName: z63.string()
|
|
12980
13433
|
}),
|
|
12981
|
-
|
|
12982
|
-
kind:
|
|
12983
|
-
content:
|
|
12984
|
-
mimeType:
|
|
12985
|
-
fileName:
|
|
13434
|
+
z63.object({
|
|
13435
|
+
kind: z63.literal("image"),
|
|
13436
|
+
content: z63.string().max(7e5),
|
|
13437
|
+
mimeType: z63.enum(["image/png", "image/jpeg", "image/gif", "image/webp"]),
|
|
13438
|
+
fileName: z63.string().optional()
|
|
12986
13439
|
}),
|
|
12987
|
-
|
|
13440
|
+
z63.object({ kind: z63.literal("download"), reason: z63.string() })
|
|
12988
13441
|
]);
|
|
12989
13442
|
var MAX_LAUNCHER_DOWNLOAD_BYTES = 16 * 1024 * 1024;
|
|
12990
13443
|
var LauncherSessionSendSchema = LauncherAgentIdSchema.extend({
|
|
12991
|
-
recipientAgentId:
|
|
12992
|
-
requestKey:
|
|
12993
|
-
message:
|
|
13444
|
+
recipientAgentId: z63.string().uuid(),
|
|
13445
|
+
requestKey: z63.string().uuid(),
|
|
13446
|
+
message: z63.string().trim().min(1).max(16e3)
|
|
12994
13447
|
}).strict();
|
|
12995
13448
|
var LauncherSessionHistoryInputSchema = LauncherAgentIdSchema.extend({
|
|
12996
|
-
peerAgentId:
|
|
12997
|
-
before:
|
|
12998
|
-
limit:
|
|
13449
|
+
peerAgentId: z63.string().uuid().optional(),
|
|
13450
|
+
before: z63.number().int().positive().optional(),
|
|
13451
|
+
limit: z63.number().int().min(1).max(50).default(20)
|
|
12999
13452
|
});
|
|
13000
13453
|
var LauncherSessionMessageSchema = LauncherTurnSchema.extend({
|
|
13001
|
-
agentId:
|
|
13002
|
-
senderAgentId:
|
|
13003
|
-
});
|
|
13004
|
-
var LauncherSessionHistorySchema =
|
|
13005
|
-
messages:
|
|
13006
|
-
nextBefore:
|
|
13007
|
-
});
|
|
13008
|
-
var LauncherMarketOperationSchema =
|
|
13009
|
-
id:
|
|
13010
|
-
action:
|
|
13011
|
-
state:
|
|
13012
|
-
taskId:
|
|
13013
|
-
taskTitle:
|
|
13454
|
+
agentId: z63.string().uuid(),
|
|
13455
|
+
senderAgentId: z63.string().uuid()
|
|
13456
|
+
});
|
|
13457
|
+
var LauncherSessionHistorySchema = z63.object({
|
|
13458
|
+
messages: z63.array(LauncherSessionMessageSchema),
|
|
13459
|
+
nextBefore: z63.number().int().nullable()
|
|
13460
|
+
});
|
|
13461
|
+
var LauncherMarketOperationSchema = z63.object({
|
|
13462
|
+
id: z63.string().uuid(),
|
|
13463
|
+
action: z63.string(),
|
|
13464
|
+
state: z63.enum(["pending", "completed", "failed"]),
|
|
13465
|
+
taskId: z63.string().nullable(),
|
|
13466
|
+
taskTitle: z63.string().nullable(),
|
|
13014
13467
|
/** USDC base units: the payment when one was quoted, else the reward or price the action named. */
|
|
13015
|
-
amount:
|
|
13468
|
+
amount: z63.string().regex(/^\d+$/).nullable(),
|
|
13016
13469
|
/** True once the payment for this action settled on chain. */
|
|
13017
|
-
paid:
|
|
13018
|
-
transactionHash:
|
|
13019
|
-
submissionId:
|
|
13470
|
+
paid: z63.boolean(),
|
|
13471
|
+
transactionHash: z63.string().nullable(),
|
|
13472
|
+
submissionId: z63.string().nullable(),
|
|
13020
13473
|
/** A bounded upper-case error code when the action failed. */
|
|
13021
|
-
errorCode:
|
|
13022
|
-
createdAt:
|
|
13023
|
-
updatedAt:
|
|
13024
|
-
});
|
|
13025
|
-
var LauncherMarketSummarySchema =
|
|
13026
|
-
activeTasks:
|
|
13027
|
-
submissions:
|
|
13028
|
-
tasksPublished:
|
|
13029
|
-
wins:
|
|
13030
|
-
pending:
|
|
13031
|
-
failed:
|
|
13474
|
+
errorCode: z63.string().nullable(),
|
|
13475
|
+
createdAt: z63.string(),
|
|
13476
|
+
updatedAt: z63.string()
|
|
13477
|
+
});
|
|
13478
|
+
var LauncherMarketSummarySchema = z63.object({
|
|
13479
|
+
activeTasks: z63.number().int().nonnegative(),
|
|
13480
|
+
submissions: z63.number().int().nonnegative(),
|
|
13481
|
+
tasksPublished: z63.number().int().nonnegative(),
|
|
13482
|
+
wins: z63.number().int().nonnegative(),
|
|
13483
|
+
pending: z63.number().int().nonnegative(),
|
|
13484
|
+
failed: z63.number().int().nonnegative(),
|
|
13032
13485
|
/** Settled market payments in USDC base units (fees, and escrow for published tasks). */
|
|
13033
|
-
spent:
|
|
13486
|
+
spent: z63.string().regex(/^\d+$/),
|
|
13034
13487
|
/** Worker payouts for tasks this agent worked, in USDC base units. */
|
|
13035
|
-
earnings:
|
|
13488
|
+
earnings: z63.string().regex(/^\d+$/)
|
|
13036
13489
|
});
|
|
13037
13490
|
var LauncherAgentMarketInputSchema = LauncherAgentIdSchema.extend({
|
|
13038
|
-
limit:
|
|
13491
|
+
limit: z63.number().int().min(1).max(100).default(50)
|
|
13039
13492
|
});
|
|
13040
|
-
var LauncherAgentMarketSchema =
|
|
13041
|
-
operations:
|
|
13493
|
+
var LauncherAgentMarketSchema = z63.object({
|
|
13494
|
+
operations: z63.array(LauncherMarketOperationSchema),
|
|
13042
13495
|
summary: LauncherMarketSummarySchema
|
|
13043
13496
|
});
|
|
13044
|
-
var LauncherAgentMarketTasksInputSchema =
|
|
13045
|
-
agentId:
|
|
13046
|
-
view:
|
|
13047
|
-
limit:
|
|
13497
|
+
var LauncherAgentMarketTasksInputSchema = z63.object({
|
|
13498
|
+
agentId: z63.string().uuid(),
|
|
13499
|
+
view: z63.enum(["both", "posted", "attempted"]).default("both"),
|
|
13500
|
+
limit: z63.number().int().min(1).max(50).default(5),
|
|
13048
13501
|
/** Opaque, per list. Only accepted with view 'posted' or 'attempted'. */
|
|
13049
|
-
cursor:
|
|
13502
|
+
cursor: z63.string().max(200).optional()
|
|
13050
13503
|
}).strict();
|
|
13051
13504
|
var LAUNCHER_POSTED_TASK_STATUSES = [
|
|
13052
13505
|
// A create approval is pending or approving; the row carries `approvalId` for Review.
|
|
@@ -13071,9 +13524,9 @@ var LAUNCHER_POSTED_TASK_STATUSES = [
|
|
|
13071
13524
|
"expired",
|
|
13072
13525
|
"cancelled"
|
|
13073
13526
|
];
|
|
13074
|
-
var LauncherPostedTaskStatusSchema =
|
|
13527
|
+
var LauncherPostedTaskStatusSchema = z63.enum(LAUNCHER_POSTED_TASK_STATUSES);
|
|
13075
13528
|
var LAUNCHER_ATTEMPT_KINDS = ["claim", "pitch", "bid", "proof", "submit"];
|
|
13076
|
-
var LauncherAttemptKindSchema =
|
|
13529
|
+
var LauncherAttemptKindSchema = z63.enum(LAUNCHER_ATTEMPT_KINDS);
|
|
13077
13530
|
var LAUNCHER_ATTEMPT_OUTCOMES = [
|
|
13078
13531
|
// A paid worker write (pitch, bid, paid submission) awaits the owner; `approvalId` set.
|
|
13079
13532
|
"awaiting_approval",
|
|
@@ -13100,43 +13553,43 @@ var LAUNCHER_ATTEMPT_OUTCOMES = [
|
|
|
13100
13553
|
// A sibling made a later worker write on the task, or holds its worker role now.
|
|
13101
13554
|
"continued_by_sibling"
|
|
13102
13555
|
];
|
|
13103
|
-
var LauncherAttemptOutcomeSchema =
|
|
13104
|
-
var UsdcUnitsSchema =
|
|
13105
|
-
var LauncherPostedTaskSchema =
|
|
13556
|
+
var LauncherAttemptOutcomeSchema = z63.enum(LAUNCHER_ATTEMPT_OUTCOMES);
|
|
13557
|
+
var UsdcUnitsSchema = z63.string().regex(/^\d+$/);
|
|
13558
|
+
var LauncherPostedTaskSchema = z63.object({
|
|
13106
13559
|
/** Stable per row: `task:<taskId>`, `approval:<id>`, `operation:<id>` or `refusal:<id>`. */
|
|
13107
|
-
key:
|
|
13560
|
+
key: z63.string(),
|
|
13108
13561
|
/** Null for drafts, refusals and publishes not resolved to a task yet. */
|
|
13109
|
-
taskId:
|
|
13110
|
-
title:
|
|
13562
|
+
taskId: z63.string().nullable(),
|
|
13563
|
+
title: z63.string().nullable(),
|
|
13111
13564
|
/** The task mode as stored on tasks.mode, or as drafted. */
|
|
13112
|
-
mode:
|
|
13565
|
+
mode: z63.string().nullable(),
|
|
13113
13566
|
/** USDC base units. */
|
|
13114
13567
|
rewardUnits: UsdcUnitsSchema.nullable(),
|
|
13115
13568
|
status: LauncherPostedTaskStatusSchema,
|
|
13116
13569
|
/** Set while status is awaiting_approval. */
|
|
13117
|
-
approvalId:
|
|
13118
|
-
approvalExpiresAt:
|
|
13570
|
+
approvalId: z63.string().uuid().nullable(),
|
|
13571
|
+
approvalExpiresAt: z63.string().nullable(),
|
|
13119
13572
|
/** Submissions; pitches for pitch mode; bids for auction mode. Null with no task. */
|
|
13120
|
-
submissions:
|
|
13573
|
+
submissions: z63.number().int().nonnegative().nullable(),
|
|
13121
13574
|
/** The deadline that matters for the current status. */
|
|
13122
|
-
deadlineAt:
|
|
13575
|
+
deadlineAt: z63.string().nullable(),
|
|
13123
13576
|
/** The rank-1 award recipient once completed; `memberName` when it is a hosted swarm member. */
|
|
13124
|
-
winner:
|
|
13577
|
+
winner: z63.object({ hosted: z63.boolean(), memberName: z63.string().nullable() }).nullable(),
|
|
13125
13578
|
/** What publishing cost the swarm once the payment settled, in USDC base units. */
|
|
13126
13579
|
paidUnits: UsdcUnitsSchema.nullable(),
|
|
13127
13580
|
/** A machine code (HOSTED_MARKET_* or a marketplace error code) for the unpublished states. */
|
|
13128
|
-
reasonCode:
|
|
13581
|
+
reasonCode: z63.string().nullable(),
|
|
13129
13582
|
/** The publishing transaction (the task's escrow transaction) when known. */
|
|
13130
|
-
transactionHash:
|
|
13131
|
-
createdAt:
|
|
13132
|
-
updatedAt:
|
|
13583
|
+
transactionHash: z63.string().nullable(),
|
|
13584
|
+
createdAt: z63.string(),
|
|
13585
|
+
updatedAt: z63.string()
|
|
13133
13586
|
});
|
|
13134
|
-
var LauncherAttemptedTaskSchema =
|
|
13587
|
+
var LauncherAttemptedTaskSchema = z63.object({
|
|
13135
13588
|
/** Stable per row: `task:<taskId>`, `approval:<id>` or `refusal:<id>`. */
|
|
13136
|
-
key:
|
|
13137
|
-
taskId:
|
|
13138
|
-
title:
|
|
13139
|
-
mode:
|
|
13589
|
+
key: z63.string(),
|
|
13590
|
+
taskId: z63.string().nullable(),
|
|
13591
|
+
title: z63.string().nullable(),
|
|
13592
|
+
mode: z63.string().nullable(),
|
|
13140
13593
|
rewardUnits: UsdcUnitsSchema.nullable(),
|
|
13141
13594
|
/** The kind of the agent's latest attempt on the task. */
|
|
13142
13595
|
attempt: LauncherAttemptKindSchema,
|
|
@@ -13144,70 +13597,70 @@ var LauncherAttemptedTaskSchema = z62.object({
|
|
|
13144
13597
|
/** The bid amount, or what was earned when won, in USDC base units. */
|
|
13145
13598
|
amountUnits: UsdcUnitsSchema.nullable(),
|
|
13146
13599
|
/** The sibling that continued the task or holds its worker role now. */
|
|
13147
|
-
continuedBy:
|
|
13148
|
-
approvalId:
|
|
13600
|
+
continuedBy: z63.object({ agentId: z63.string(), name: z63.string() }).nullable(),
|
|
13601
|
+
approvalId: z63.string().uuid().nullable(),
|
|
13149
13602
|
/** A machine code for not_approved, blocked and did_not_go_through. */
|
|
13150
|
-
reasonCode:
|
|
13151
|
-
transactionHash:
|
|
13152
|
-
createdAt:
|
|
13153
|
-
updatedAt:
|
|
13603
|
+
reasonCode: z63.string().nullable(),
|
|
13604
|
+
transactionHash: z63.string().nullable(),
|
|
13605
|
+
createdAt: z63.string(),
|
|
13606
|
+
updatedAt: z63.string()
|
|
13154
13607
|
});
|
|
13155
|
-
var LauncherAgentMarketTasksSchema =
|
|
13156
|
-
counts:
|
|
13608
|
+
var LauncherAgentMarketTasksSchema = z63.object({
|
|
13609
|
+
counts: z63.object({
|
|
13157
13610
|
/** Every Posted row, drafts and refused creates included. */
|
|
13158
|
-
posted:
|
|
13611
|
+
posted: z63.number().int().nonnegative(),
|
|
13159
13612
|
/** awaiting_approval, publishing, open, in_progress, in_review, appealing and disputed. */
|
|
13160
|
-
postedOpen:
|
|
13613
|
+
postedOpen: z63.number().int().nonnegative(),
|
|
13161
13614
|
/** Every Attempted row. */
|
|
13162
|
-
attempted:
|
|
13615
|
+
attempted: z63.number().int().nonnegative(),
|
|
13163
13616
|
/** awaiting_approval, working and awaiting_result. */
|
|
13164
|
-
attemptedActive:
|
|
13165
|
-
won:
|
|
13617
|
+
attemptedActive: z63.number().int().nonnegative(),
|
|
13618
|
+
won: z63.number().int().nonnegative(),
|
|
13166
13619
|
/** The sum of amountUnits over won rows. */
|
|
13167
13620
|
earnedUnits: UsdcUnitsSchema
|
|
13168
13621
|
}),
|
|
13169
13622
|
/** Empty when view is 'attempted'. */
|
|
13170
|
-
posted:
|
|
13171
|
-
items:
|
|
13172
|
-
nextCursor:
|
|
13623
|
+
posted: z63.object({
|
|
13624
|
+
items: z63.array(LauncherPostedTaskSchema),
|
|
13625
|
+
nextCursor: z63.string().nullable()
|
|
13173
13626
|
}),
|
|
13174
13627
|
/** Empty when view is 'posted'. */
|
|
13175
|
-
attempted:
|
|
13176
|
-
items:
|
|
13177
|
-
nextCursor:
|
|
13628
|
+
attempted: z63.object({
|
|
13629
|
+
items: z63.array(LauncherAttemptedTaskSchema),
|
|
13630
|
+
nextCursor: z63.string().nullable()
|
|
13178
13631
|
})
|
|
13179
13632
|
});
|
|
13180
|
-
var LauncherMarketOverviewSchema =
|
|
13181
|
-
agents:
|
|
13633
|
+
var LauncherMarketOverviewSchema = z63.object({
|
|
13634
|
+
agents: z63.array(z63.object({ agentId: z63.string(), activeTasks: z63.number().int().nonnegative() }))
|
|
13182
13635
|
});
|
|
13183
13636
|
|
|
13184
13637
|
// ../../packages/shared/dist/schemas/launcher-schedule.schemas.js
|
|
13185
|
-
import { z as
|
|
13638
|
+
import { z as z64 } from "zod";
|
|
13186
13639
|
var SCHEDULE_SCAN_SECONDS = 300;
|
|
13187
|
-
var LauncherScheduleControlSchema =
|
|
13188
|
-
agentId:
|
|
13189
|
-
requestKey:
|
|
13190
|
-
enabled:
|
|
13640
|
+
var LauncherScheduleControlSchema = z64.object({
|
|
13641
|
+
agentId: z64.string().uuid(),
|
|
13642
|
+
requestKey: z64.string().uuid(),
|
|
13643
|
+
enabled: z64.boolean()
|
|
13191
13644
|
}).strict();
|
|
13192
|
-
var LauncherNextStepSchema =
|
|
13193
|
-
|
|
13194
|
-
state:
|
|
13195
|
-
delaySeconds:
|
|
13196
|
-
prompt:
|
|
13645
|
+
var LauncherNextStepSchema = z64.discriminatedUnion("state", [
|
|
13646
|
+
z64.object({
|
|
13647
|
+
state: z64.literal("scheduled"),
|
|
13648
|
+
delaySeconds: z64.number().int().min(SCHEDULE_SCAN_SECONDS).max(30 * 86400),
|
|
13649
|
+
prompt: z64.string().trim().min(1).max(32768)
|
|
13197
13650
|
}).strict(),
|
|
13198
|
-
|
|
13199
|
-
state:
|
|
13200
|
-
reason:
|
|
13201
|
-
prompt:
|
|
13651
|
+
z64.object({
|
|
13652
|
+
state: z64.literal("waiting"),
|
|
13653
|
+
reason: z64.enum(["external", "owner", "funds"]),
|
|
13654
|
+
prompt: z64.string().trim().min(1).max(32768)
|
|
13202
13655
|
}).strict(),
|
|
13203
|
-
|
|
13656
|
+
z64.object({ state: z64.literal("idle") }).strict()
|
|
13204
13657
|
]);
|
|
13205
|
-
var LauncherScheduleNextSchema =
|
|
13206
|
-
agentId:
|
|
13207
|
-
requestKey:
|
|
13658
|
+
var LauncherScheduleNextSchema = z64.object({
|
|
13659
|
+
agentId: z64.string().uuid(),
|
|
13660
|
+
requestKey: z64.string().uuid(),
|
|
13208
13661
|
step: LauncherNextStepSchema
|
|
13209
13662
|
}).strict();
|
|
13210
|
-
var LauncherScheduleStatusSchema =
|
|
13663
|
+
var LauncherScheduleStatusSchema = z64.enum([
|
|
13211
13664
|
"disabled",
|
|
13212
13665
|
"idle",
|
|
13213
13666
|
"scheduled",
|
|
@@ -13222,74 +13675,74 @@ var LauncherScheduleStatusSchema = z63.enum([
|
|
|
13222
13675
|
"waiting_funds",
|
|
13223
13676
|
"source_failed"
|
|
13224
13677
|
]);
|
|
13225
|
-
var LauncherScheduleServiceStatusSchema =
|
|
13226
|
-
var LauncherScheduleViewSchema =
|
|
13227
|
-
agentId:
|
|
13228
|
-
enabled:
|
|
13229
|
-
revision:
|
|
13230
|
-
generation:
|
|
13231
|
-
nextRunAt:
|
|
13232
|
-
prompt:
|
|
13233
|
-
waitingFor:
|
|
13678
|
+
var LauncherScheduleServiceStatusSchema = z64.enum(["running", "stalled", "off"]);
|
|
13679
|
+
var LauncherScheduleViewSchema = z64.object({
|
|
13680
|
+
agentId: z64.string().uuid(),
|
|
13681
|
+
enabled: z64.boolean(),
|
|
13682
|
+
revision: z64.number().int(),
|
|
13683
|
+
generation: z64.number().int(),
|
|
13684
|
+
nextRunAt: z64.string().nullable(),
|
|
13685
|
+
prompt: z64.string().nullable(),
|
|
13686
|
+
waitingFor: z64.enum(["external", "owner", "funds"]).nullable(),
|
|
13234
13687
|
status: LauncherScheduleStatusSchema,
|
|
13235
|
-
label:
|
|
13236
|
-
lastJobId:
|
|
13237
|
-
asOf:
|
|
13238
|
-
scanEverySeconds:
|
|
13688
|
+
label: z64.string(),
|
|
13689
|
+
lastJobId: z64.string().nullable(),
|
|
13690
|
+
asOf: z64.string(),
|
|
13691
|
+
scanEverySeconds: z64.literal(SCHEDULE_SCAN_SECONDS),
|
|
13239
13692
|
serviceStatus: LauncherScheduleServiceStatusSchema,
|
|
13240
13693
|
/** Last successful scheduling tick, or null when none was ever recorded. */
|
|
13241
|
-
lastTickAt:
|
|
13694
|
+
lastTickAt: z64.string().nullable(),
|
|
13242
13695
|
/** True when nextRunAt is overdue by more than the stall window. */
|
|
13243
|
-
nextRunOverdue:
|
|
13696
|
+
nextRunOverdue: z64.boolean()
|
|
13244
13697
|
});
|
|
13245
13698
|
|
|
13246
13699
|
// ../../packages/shared/dist/schemas/swarm-coordination.schemas.js
|
|
13247
|
-
import { z as
|
|
13700
|
+
import { z as z65 } from "zod";
|
|
13248
13701
|
var SWARM_CREATES_PER_JOB = 2;
|
|
13249
13702
|
var SWARM_ARTIFACT_INLINE_MAX_BYTES = 65536;
|
|
13250
|
-
var SwarmArtifactSavePathSchema =
|
|
13251
|
-
var SwarmCoordinationPermissionsSchema =
|
|
13252
|
-
create:
|
|
13253
|
-
dispatch:
|
|
13254
|
-
resume:
|
|
13703
|
+
var SwarmArtifactSavePathSchema = z65.string().trim().min(1).max(1024).refine((path3) => !path3.startsWith("/") && !path3.startsWith("~") && !path3.includes("\0") && !path3.includes("\\") && !path3.endsWith("/") && path3.split("/").every((part) => part !== ".." && part !== "." && part !== ""), { message: "saveTo must be a relative file path inside your workspace" });
|
|
13704
|
+
var SwarmCoordinationPermissionsSchema = z65.object({
|
|
13705
|
+
create: z65.boolean().default(false),
|
|
13706
|
+
dispatch: z65.boolean().default(false),
|
|
13707
|
+
resume: z65.boolean().default(false)
|
|
13255
13708
|
}).strict();
|
|
13256
|
-
var SwarmProfileInputSchema =
|
|
13257
|
-
agentId:
|
|
13258
|
-
requestKey:
|
|
13259
|
-
name:
|
|
13260
|
-
responsibility:
|
|
13709
|
+
var SwarmProfileInputSchema = z65.object({
|
|
13710
|
+
agentId: z65.string().uuid(),
|
|
13711
|
+
requestKey: z65.string().uuid(),
|
|
13712
|
+
name: z65.string().trim().min(1).max(100),
|
|
13713
|
+
responsibility: z65.string().trim().max(500),
|
|
13261
13714
|
/**
|
|
13262
13715
|
* The agent's instructions.md memory document (SM-24). Omit to leave it unchanged, e.g. when
|
|
13263
13716
|
* it was written in the Memory tab beyond this editor's limit.
|
|
13264
13717
|
*/
|
|
13265
|
-
instructions:
|
|
13718
|
+
instructions: z65.string().trim().max(16e3).optional(),
|
|
13266
13719
|
/**
|
|
13267
13720
|
* The instructions.md version the editor loaded (`SwarmProfile.instructionsVersion`); a save
|
|
13268
13721
|
* whose text differs is refused with MEMORY_VERSION_CONFLICT if the document moved on since.
|
|
13269
13722
|
*/
|
|
13270
|
-
instructionsVersion:
|
|
13723
|
+
instructionsVersion: z65.number().int().min(0).optional(),
|
|
13271
13724
|
permissions: SwarmCoordinationPermissionsSchema
|
|
13272
13725
|
}).strict();
|
|
13273
|
-
var SwarmProfileSchema =
|
|
13274
|
-
available:
|
|
13275
|
-
agentId:
|
|
13276
|
-
name:
|
|
13277
|
-
responsibility:
|
|
13278
|
-
instructions:
|
|
13726
|
+
var SwarmProfileSchema = z65.object({
|
|
13727
|
+
available: z65.boolean().default(false),
|
|
13728
|
+
agentId: z65.string().uuid(),
|
|
13729
|
+
name: z65.string(),
|
|
13730
|
+
responsibility: z65.string(),
|
|
13731
|
+
instructions: z65.string(),
|
|
13279
13732
|
/** Version of the live instructions.md memory document; 0 when there is none. */
|
|
13280
|
-
instructionsVersion:
|
|
13281
|
-
version:
|
|
13282
|
-
generation:
|
|
13283
|
-
creatorAgentId:
|
|
13284
|
-
creatorJobId:
|
|
13733
|
+
instructionsVersion: z65.number().int().default(0),
|
|
13734
|
+
version: z65.number().int(),
|
|
13735
|
+
generation: z65.number().int(),
|
|
13736
|
+
creatorAgentId: z65.string().uuid().nullable(),
|
|
13737
|
+
creatorJobId: z65.string().uuid().nullable(),
|
|
13285
13738
|
permissions: SwarmCoordinationPermissionsSchema
|
|
13286
13739
|
});
|
|
13287
|
-
var SwarmMemberSchema =
|
|
13288
|
-
agentId:
|
|
13289
|
-
name:
|
|
13290
|
-
responsibility:
|
|
13291
|
-
creatorAgentId:
|
|
13292
|
-
state:
|
|
13740
|
+
var SwarmMemberSchema = z65.object({
|
|
13741
|
+
agentId: z65.string().uuid(),
|
|
13742
|
+
name: z65.string(),
|
|
13743
|
+
responsibility: z65.string(),
|
|
13744
|
+
creatorAgentId: z65.string().uuid().nullable(),
|
|
13745
|
+
state: z65.enum([
|
|
13293
13746
|
"idle",
|
|
13294
13747
|
"queued",
|
|
13295
13748
|
"working",
|
|
@@ -13300,99 +13753,99 @@ var SwarmMemberSchema = z64.object({
|
|
|
13300
13753
|
"waiting",
|
|
13301
13754
|
"failed"
|
|
13302
13755
|
]),
|
|
13303
|
-
queuedCount:
|
|
13304
|
-
jobId:
|
|
13305
|
-
runId:
|
|
13306
|
-
headline:
|
|
13307
|
-
progress:
|
|
13308
|
-
updatedAt:
|
|
13309
|
-
freshness:
|
|
13310
|
-
waitingFor:
|
|
13311
|
-
nextRunAt:
|
|
13312
|
-
lastResult:
|
|
13313
|
-
jobId:
|
|
13314
|
-
summary:
|
|
13315
|
-
artifacts:
|
|
13316
|
-
finishedAt:
|
|
13756
|
+
queuedCount: z65.number().int(),
|
|
13757
|
+
jobId: z65.string().uuid().nullable(),
|
|
13758
|
+
runId: z65.string().uuid().nullable(),
|
|
13759
|
+
headline: z65.string().nullable(),
|
|
13760
|
+
progress: z65.string().nullable(),
|
|
13761
|
+
updatedAt: z65.string().nullable(),
|
|
13762
|
+
freshness: z65.enum(["current", "stale", "unpublished"]),
|
|
13763
|
+
waitingFor: z65.array(z65.string().uuid()),
|
|
13764
|
+
nextRunAt: z65.string().nullable(),
|
|
13765
|
+
lastResult: z65.object({
|
|
13766
|
+
jobId: z65.string().uuid(),
|
|
13767
|
+
summary: z65.string(),
|
|
13768
|
+
artifacts: z65.array(z65.object({ artifactId: z65.string().uuid(), sha256: z65.string(), path: z65.string() })).optional(),
|
|
13769
|
+
finishedAt: z65.string().nullable()
|
|
13317
13770
|
}).nullable(),
|
|
13318
13771
|
/**
|
|
13319
13772
|
* The agent's most recently finished job, whatever its outcome. `lastResult` covers only a
|
|
13320
13773
|
* completed job that published a summary; this is what an owner's "finished, come look" signal
|
|
13321
13774
|
* reads. Optional so an overview from an older backend still parses.
|
|
13322
13775
|
*/
|
|
13323
|
-
lastFinished:
|
|
13324
|
-
jobId:
|
|
13776
|
+
lastFinished: z65.object({
|
|
13777
|
+
jobId: z65.string().uuid(),
|
|
13325
13778
|
status: LauncherJobStatusSchema.extract(["completed", "failed", "interrupted"]),
|
|
13326
|
-
finishedAt:
|
|
13779
|
+
finishedAt: z65.string().nullable()
|
|
13327
13780
|
}).nullable().optional(),
|
|
13328
|
-
asOf:
|
|
13781
|
+
asOf: z65.string()
|
|
13329
13782
|
});
|
|
13330
|
-
var SwarmOverviewSchema =
|
|
13331
|
-
members:
|
|
13332
|
-
asOf:
|
|
13783
|
+
var SwarmOverviewSchema = z65.object({
|
|
13784
|
+
members: z65.array(SwarmMemberSchema).max(10),
|
|
13785
|
+
asOf: z65.string()
|
|
13333
13786
|
});
|
|
13334
|
-
var artifactIds =
|
|
13787
|
+
var artifactIds = z65.array(z65.string().uuid()).max(8).default([]);
|
|
13335
13788
|
var SwarmToolInputSchemas = {
|
|
13336
|
-
sessions_list:
|
|
13337
|
-
sessions_inspect:
|
|
13338
|
-
sessions_create:
|
|
13339
|
-
intentKey:
|
|
13340
|
-
name:
|
|
13341
|
-
responsibility:
|
|
13342
|
-
instructions:
|
|
13343
|
-
prompt:
|
|
13789
|
+
sessions_list: z65.object({}).strict(),
|
|
13790
|
+
sessions_inspect: z65.object({ agentId: z65.string().uuid() }).strict(),
|
|
13791
|
+
sessions_create: z65.object({
|
|
13792
|
+
intentKey: z65.string().trim().min(1).max(100),
|
|
13793
|
+
name: z65.string().trim().min(1).max(100),
|
|
13794
|
+
responsibility: z65.string().trim().min(1).max(500),
|
|
13795
|
+
instructions: z65.string().trim().min(1).max(16e3),
|
|
13796
|
+
prompt: z65.string().trim().min(1).max(16e3)
|
|
13344
13797
|
}).strict(),
|
|
13345
|
-
sessions_send:
|
|
13346
|
-
agentId:
|
|
13347
|
-
requestKey:
|
|
13348
|
-
message:
|
|
13798
|
+
sessions_send: z65.object({
|
|
13799
|
+
agentId: z65.string().uuid(),
|
|
13800
|
+
requestKey: z65.string().uuid(),
|
|
13801
|
+
message: z65.string().trim().min(1).max(16e3),
|
|
13349
13802
|
artifactIds
|
|
13350
13803
|
}).strict(),
|
|
13351
|
-
sessions_history:
|
|
13352
|
-
agentId:
|
|
13353
|
-
before:
|
|
13804
|
+
sessions_history: z65.object({
|
|
13805
|
+
agentId: z65.string().uuid().optional(),
|
|
13806
|
+
before: z65.number().int().positive().optional()
|
|
13354
13807
|
}).strict(),
|
|
13355
|
-
sessions_result:
|
|
13356
|
-
sessions_wait:
|
|
13357
|
-
jobIds:
|
|
13358
|
-
mode:
|
|
13359
|
-
prompt:
|
|
13360
|
-
timeoutSeconds:
|
|
13808
|
+
sessions_result: z65.object({ jobId: z65.string().uuid() }).strict(),
|
|
13809
|
+
sessions_wait: z65.object({
|
|
13810
|
+
jobIds: z65.array(z65.string().uuid()).min(1).max(8),
|
|
13811
|
+
mode: z65.enum(["any", "all"]),
|
|
13812
|
+
prompt: z65.string().trim().min(1).max(16e3),
|
|
13813
|
+
timeoutSeconds: z65.number().int().min(60).max(604800)
|
|
13361
13814
|
}).strict(),
|
|
13362
|
-
sessions_update_status:
|
|
13363
|
-
headline:
|
|
13364
|
-
progress:
|
|
13365
|
-
resultSummary:
|
|
13815
|
+
sessions_update_status: z65.object({
|
|
13816
|
+
headline: z65.string().trim().min(1).max(200),
|
|
13817
|
+
progress: z65.string().trim().max(1e3),
|
|
13818
|
+
resultSummary: z65.string().trim().max(1e3).optional(),
|
|
13366
13819
|
artifactIds
|
|
13367
13820
|
}).strict(),
|
|
13368
|
-
sessions_read_artifact:
|
|
13369
|
-
artifactId:
|
|
13821
|
+
sessions_read_artifact: z65.object({
|
|
13822
|
+
artifactId: z65.string().uuid(),
|
|
13370
13823
|
saveTo: SwarmArtifactSavePathSchema.optional(),
|
|
13371
|
-
overwrite:
|
|
13824
|
+
overwrite: z65.boolean().optional()
|
|
13372
13825
|
}).strict()
|
|
13373
13826
|
};
|
|
13374
|
-
var SwarmWaitSchema =
|
|
13375
|
-
id:
|
|
13376
|
-
sourceJobId:
|
|
13377
|
-
jobIds:
|
|
13378
|
-
state:
|
|
13379
|
-
reason:
|
|
13380
|
-
deadline:
|
|
13381
|
-
continuationJobId:
|
|
13827
|
+
var SwarmWaitSchema = z65.object({
|
|
13828
|
+
id: z65.string().uuid(),
|
|
13829
|
+
sourceJobId: z65.string().uuid(),
|
|
13830
|
+
jobIds: z65.array(z65.string().uuid()),
|
|
13831
|
+
state: z65.enum(["pending", "delivered", "cancelled"]),
|
|
13832
|
+
reason: z65.string().nullable(),
|
|
13833
|
+
deadline: z65.string(),
|
|
13834
|
+
continuationJobId: z65.string().uuid().nullable()
|
|
13382
13835
|
});
|
|
13383
13836
|
|
|
13384
13837
|
// ../../packages/shared/dist/schemas/direct-agent-checkpoint.schemas.js
|
|
13385
|
-
import { z as
|
|
13838
|
+
import { z as z69 } from "zod";
|
|
13386
13839
|
|
|
13387
13840
|
// ../../packages/shared/dist/schemas/turn-attribution.schemas.js
|
|
13388
|
-
import { z as
|
|
13841
|
+
import { z as z66 } from "zod";
|
|
13389
13842
|
var TURN_ATTRIBUTION_RECORD_VERSION = 1;
|
|
13390
|
-
var TurnAttributionIdentitySchema =
|
|
13391
|
-
sessionId:
|
|
13392
|
-
turnId:
|
|
13843
|
+
var TurnAttributionIdentitySchema = z66.object({
|
|
13844
|
+
sessionId: z66.string().min(1).max(256),
|
|
13845
|
+
turnId: z66.string().min(1).max(256),
|
|
13393
13846
|
/** Non-null exactly for native helpers; a root or maintenance turn has no subagent. */
|
|
13394
|
-
subagentId:
|
|
13395
|
-
role:
|
|
13847
|
+
subagentId: z66.string().min(1).max(256).nullable(),
|
|
13848
|
+
role: z66.enum(ROUTING_EXECUTION_ROLES)
|
|
13396
13849
|
}).strict().superRefine((identity, ctx) => {
|
|
13397
13850
|
if (identity.role === "native_helper" && identity.subagentId === null)
|
|
13398
13851
|
ctx.addIssue({ code: "custom", message: "A native helper identity needs its subagent id" });
|
|
@@ -13400,18 +13853,18 @@ var TurnAttributionIdentitySchema = z65.object({
|
|
|
13400
13853
|
ctx.addIssue({ code: "custom", message: "Only a native helper identity carries a subagent" });
|
|
13401
13854
|
});
|
|
13402
13855
|
var PinnedTurnAttributionSchema = RoutingAttributionSchema.extend({
|
|
13403
|
-
operationId:
|
|
13404
|
-
inheritedFrom:
|
|
13856
|
+
operationId: z66.string().uuid().nullable(),
|
|
13857
|
+
inheritedFrom: z66.string().min(1).max(1024).nullable()
|
|
13405
13858
|
}).strict();
|
|
13406
13859
|
var MAX_ATTRIBUTION_EPOCHS = 32;
|
|
13407
13860
|
var TurnAttributionEpochSchema = PinnedTurnAttributionSchema.extend({
|
|
13408
|
-
epoch:
|
|
13861
|
+
epoch: z66.number().int().positive().max(MAX_ATTRIBUTION_EPOCHS)
|
|
13409
13862
|
}).strict();
|
|
13410
|
-
var TurnAttributionLedgerSchema =
|
|
13411
|
-
version:
|
|
13412
|
-
epochs:
|
|
13863
|
+
var TurnAttributionLedgerSchema = z66.object({
|
|
13864
|
+
version: z66.literal(TURN_ATTRIBUTION_RECORD_VERSION),
|
|
13865
|
+
epochs: z66.array(TurnAttributionEpochSchema).max(MAX_ATTRIBUTION_EPOCHS),
|
|
13413
13866
|
/** `turnAttributionKey()` to epoch number. Bounded by the provider's own history limit. */
|
|
13414
|
-
turns:
|
|
13867
|
+
turns: z66.record(z66.number().int().positive().max(MAX_ATTRIBUTION_EPOCHS))
|
|
13415
13868
|
}).strict().superRefine((ledger, ctx) => {
|
|
13416
13869
|
const ids2 = ledger.epochs.map((entry) => entry.epoch);
|
|
13417
13870
|
if (new Set(ids2).size !== ids2.length)
|
|
@@ -13420,13 +13873,13 @@ var TurnAttributionLedgerSchema = z65.object({
|
|
|
13420
13873
|
if (!ids2.includes(epoch))
|
|
13421
13874
|
ctx.addIssue({ code: "custom", message: `Turn references unknown epoch ${epoch}` });
|
|
13422
13875
|
});
|
|
13423
|
-
var ManagedTurnUsageSchema =
|
|
13424
|
-
inputTokens:
|
|
13425
|
-
outputTokens:
|
|
13426
|
-
totalTokens:
|
|
13427
|
-
cacheReadTokens:
|
|
13428
|
-
cacheWriteTokens:
|
|
13429
|
-
reasoningTokens:
|
|
13876
|
+
var ManagedTurnUsageSchema = z66.object({
|
|
13877
|
+
inputTokens: z66.number().int().nonnegative(),
|
|
13878
|
+
outputTokens: z66.number().int().nonnegative(),
|
|
13879
|
+
totalTokens: z66.number().int().nonnegative(),
|
|
13880
|
+
cacheReadTokens: z66.number().int().nonnegative().nullable(),
|
|
13881
|
+
cacheWriteTokens: z66.number().int().nonnegative().nullable(),
|
|
13882
|
+
reasoningTokens: z66.number().int().nonnegative().nullable()
|
|
13430
13883
|
}).strict().superRefine((usage, ctx) => {
|
|
13431
13884
|
if (usage.totalTokens !== usage.inputTokens + usage.outputTokens)
|
|
13432
13885
|
ctx.addIssue({ code: "custom", message: "Total tokens must equal input plus output" });
|
|
@@ -13435,14 +13888,14 @@ var ManagedTurnUsageSchema = z65.object({
|
|
|
13435
13888
|
if ((usage.reasoningTokens ?? 0) > usage.outputTokens)
|
|
13436
13889
|
ctx.addIssue({ code: "custom", message: "Reasoning cannot exceed output" });
|
|
13437
13890
|
});
|
|
13438
|
-
var TurnAttributionStampSchema =
|
|
13439
|
-
recordVersion:
|
|
13891
|
+
var TurnAttributionStampSchema = z66.object({
|
|
13892
|
+
recordVersion: z66.literal(TURN_ATTRIBUTION_RECORD_VERSION),
|
|
13440
13893
|
identity: TurnAttributionIdentitySchema,
|
|
13441
13894
|
attribution: PinnedTurnAttributionSchema
|
|
13442
13895
|
}).strict();
|
|
13443
13896
|
|
|
13444
13897
|
// ../../packages/shared/dist/schemas/user-skills.schemas.js
|
|
13445
|
-
import { z as
|
|
13898
|
+
import { z as z67 } from "zod";
|
|
13446
13899
|
import { parseDocument } from "yaml";
|
|
13447
13900
|
var USER_SKILL_LIMITS = {
|
|
13448
13901
|
files: 20,
|
|
@@ -13465,11 +13918,11 @@ var readablePathOk = (path3, strict) => {
|
|
|
13465
13918
|
return (!strict || !isUserSkillPathAmbiguous(path3)) && 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(path3) && (path3 === "SKILL.md" || !parts.some((p) => p.toLowerCase() === "skill.md"));
|
|
13466
13919
|
};
|
|
13467
13920
|
var readablePathMessage = "Use a relative text-file path; only the main SKILL.md entrypoint is allowed";
|
|
13468
|
-
var readablePathSchema = (strict) =>
|
|
13921
|
+
var readablePathSchema = (strict) => z67.string().min(1).max(240).refine((path3) => readablePathOk(path3, strict), readablePathMessage);
|
|
13469
13922
|
var UserSkillPathSchema = readablePathSchema(true);
|
|
13470
|
-
var readableFileSchema = (strict) =>
|
|
13923
|
+
var readableFileSchema = (strict) => z67.object({
|
|
13471
13924
|
path: readablePathSchema(strict),
|
|
13472
|
-
content:
|
|
13925
|
+
content: z67.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")
|
|
13473
13926
|
}).strict();
|
|
13474
13927
|
var UserSkillFileSchema = readableFileSchema(true);
|
|
13475
13928
|
var USER_SKILL_SANDBOX_LIMITS = {
|
|
@@ -13676,23 +14129,23 @@ function isUserSkillNativeBinaryMagic(head) {
|
|
|
13676
14129
|
return NATIVE_MAGIC.some((magic) => magic.every((byte, i) => head[i] === byte));
|
|
13677
14130
|
}
|
|
13678
14131
|
var sandboxFileBase = {
|
|
13679
|
-
path:
|
|
14132
|
+
path: z67.string().max(USER_SKILL_SANDBOX_LIMITS.pathLength),
|
|
13680
14133
|
/** Kept from git mode 100755 and applied when the file is copied into the VM. */
|
|
13681
|
-
executable:
|
|
14134
|
+
executable: z67.boolean().default(false)
|
|
13682
14135
|
};
|
|
13683
|
-
var UserSkillSandboxTextFileSchema =
|
|
14136
|
+
var UserSkillSandboxTextFileSchema = z67.object({
|
|
13684
14137
|
...sandboxFileBase,
|
|
13685
|
-
encoding:
|
|
13686
|
-
content:
|
|
14138
|
+
encoding: z67.literal("utf8"),
|
|
14139
|
+
content: z67.string().max(USER_SKILL_SANDBOX_LIMITS.fileBytes)
|
|
13687
14140
|
}).strict();
|
|
13688
|
-
var UserSkillSandboxBinaryFileSchema =
|
|
14141
|
+
var UserSkillSandboxBinaryFileSchema = z67.object({
|
|
13689
14142
|
...sandboxFileBase,
|
|
13690
|
-
encoding:
|
|
13691
|
-
content:
|
|
14143
|
+
encoding: z67.literal("base64"),
|
|
14144
|
+
content: z67.string().max(Math.ceil(USER_SKILL_SANDBOX_LIMITS.fileBytes / 3) * 4),
|
|
13692
14145
|
/** Declared decoded size in bytes; must match the content. */
|
|
13693
|
-
size:
|
|
14146
|
+
size: z67.number().int().nonnegative().max(USER_SKILL_SANDBOX_LIMITS.fileBytes)
|
|
13694
14147
|
}).strict();
|
|
13695
|
-
var sandboxFileSchema = (strict) =>
|
|
14148
|
+
var sandboxFileSchema = (strict) => z67.discriminatedUnion("encoding", [
|
|
13696
14149
|
UserSkillSandboxTextFileSchema,
|
|
13697
14150
|
UserSkillSandboxBinaryFileSchema
|
|
13698
14151
|
]).superRefine((file, ctx) => {
|
|
@@ -13745,12 +14198,12 @@ function classifyUserSkillEntry(entry) {
|
|
|
13745
14198
|
executable: mode === USER_SKILL_GIT_MODES.executable
|
|
13746
14199
|
};
|
|
13747
14200
|
}
|
|
13748
|
-
var bundleSchema = (strict) =>
|
|
13749
|
-
name:
|
|
13750
|
-
description:
|
|
13751
|
-
files:
|
|
14201
|
+
var bundleSchema = (strict) => z67.object({
|
|
14202
|
+
name: z67.string().trim().max(100),
|
|
14203
|
+
description: z67.string().trim().max(300),
|
|
14204
|
+
files: z67.array(readableFileSchema(strict)).min(1).max(USER_SKILL_LIMITS.files),
|
|
13752
14205
|
/** Scripts and assets copied into the agent's sandbox only (ADR-0476 section 4). */
|
|
13753
|
-
sandboxFiles:
|
|
14206
|
+
sandboxFiles: z67.array(sandboxFileSchema(strict)).max(USER_SKILL_SANDBOX_LIMITS.files, "A skill can contain at most 200 sandbox-only files").optional()
|
|
13754
14207
|
}).strict().superRefine((bundle, ctx) => {
|
|
13755
14208
|
const sandbox = bundle.sandboxFiles ?? [];
|
|
13756
14209
|
const paths = [...bundle.files, ...sandbox].map((f) => strict ? userSkillPathKey(f.path) : f.path.toLowerCase());
|
|
@@ -13789,76 +14242,76 @@ function splitUserSkill(content2) {
|
|
|
13789
14242
|
metadata: match?.[1] ?? ""
|
|
13790
14243
|
};
|
|
13791
14244
|
}
|
|
13792
|
-
var UserSkillPinSchema =
|
|
13793
|
-
skillId:
|
|
13794
|
-
version:
|
|
13795
|
-
digest:
|
|
14245
|
+
var UserSkillPinSchema = z67.object({
|
|
14246
|
+
skillId: z67.string().uuid(),
|
|
14247
|
+
version: z67.number().int().positive(),
|
|
14248
|
+
digest: z67.string().regex(/^[a-f0-9]{64}$/)
|
|
13796
14249
|
}).strict();
|
|
13797
|
-
var UserSkillPinsSchema =
|
|
13798
|
-
var UserSkillIdSchema =
|
|
14250
|
+
var UserSkillPinsSchema = z67.array(UserSkillPinSchema).max(USER_SKILL_LIMITS.assigned);
|
|
14251
|
+
var UserSkillIdSchema = z67.object({ skillId: z67.string().uuid() });
|
|
13799
14252
|
var UserSkillDraftInputSchema = UserSkillIdSchema.extend({
|
|
13800
|
-
requestKey:
|
|
13801
|
-
expectedRevision:
|
|
14253
|
+
requestKey: z67.string().uuid(),
|
|
14254
|
+
expectedRevision: z67.number().int().nonnegative(),
|
|
13802
14255
|
bundle: UserSkillDraftBundleSchema
|
|
13803
14256
|
});
|
|
13804
14257
|
var UserSkillSaveVersionSchema = UserSkillIdSchema.extend({
|
|
13805
|
-
requestKey:
|
|
13806
|
-
expectedRevision:
|
|
13807
|
-
note:
|
|
13808
|
-
restoreVersion:
|
|
14258
|
+
requestKey: z67.string().uuid(),
|
|
14259
|
+
expectedRevision: z67.number().int().nonnegative(),
|
|
14260
|
+
note: z67.string().trim().max(500).default(""),
|
|
14261
|
+
restoreVersion: z67.number().int().positive().optional()
|
|
13809
14262
|
});
|
|
13810
14263
|
var UserSkillAssignSchema = UserSkillIdSchema.extend({
|
|
13811
|
-
requestKey:
|
|
13812
|
-
version:
|
|
13813
|
-
agents:
|
|
14264
|
+
requestKey: z67.string().uuid(),
|
|
14265
|
+
version: z67.number().int().positive().nullable(),
|
|
14266
|
+
agents: z67.array(z67.object({ agentId: z67.string().uuid(), expectedRevision: z67.number().int().nonnegative() })).min(1).max(100)
|
|
13814
14267
|
});
|
|
13815
14268
|
var UserSkillArchiveSchema = UserSkillIdSchema.extend({
|
|
13816
|
-
requestKey:
|
|
13817
|
-
expectedRevision:
|
|
13818
|
-
archived:
|
|
13819
|
-
removeAssignments:
|
|
13820
|
-
});
|
|
13821
|
-
var UserSkillSummarySchema =
|
|
13822
|
-
id:
|
|
13823
|
-
name:
|
|
13824
|
-
description:
|
|
13825
|
-
archived:
|
|
13826
|
-
latestVersion:
|
|
13827
|
-
revision:
|
|
13828
|
-
hasDraft:
|
|
13829
|
-
assignedCount:
|
|
13830
|
-
outdatedCount:
|
|
13831
|
-
updatedAt:
|
|
14269
|
+
requestKey: z67.string().uuid(),
|
|
14270
|
+
expectedRevision: z67.number().int().nonnegative(),
|
|
14271
|
+
archived: z67.boolean(),
|
|
14272
|
+
removeAssignments: z67.boolean().default(false)
|
|
14273
|
+
});
|
|
14274
|
+
var UserSkillSummarySchema = z67.object({
|
|
14275
|
+
id: z67.string().uuid(),
|
|
14276
|
+
name: z67.string(),
|
|
14277
|
+
description: z67.string(),
|
|
14278
|
+
archived: z67.boolean(),
|
|
14279
|
+
latestVersion: z67.number().int(),
|
|
14280
|
+
revision: z67.number().int(),
|
|
14281
|
+
hasDraft: z67.boolean(),
|
|
14282
|
+
assignedCount: z67.number().int(),
|
|
14283
|
+
outdatedCount: z67.number().int(),
|
|
14284
|
+
updatedAt: z67.string(),
|
|
13832
14285
|
/**
|
|
13833
14286
|
* The hosted agent that authored the latest version, or null when the owner did (ADR-0476
|
|
13834
14287
|
* section 6). Optional for older backends.
|
|
13835
14288
|
*/
|
|
13836
|
-
latestAuthorAgentId:
|
|
13837
|
-
});
|
|
13838
|
-
var UserSkillAgentSchema =
|
|
13839
|
-
agentId:
|
|
13840
|
-
name:
|
|
13841
|
-
managed:
|
|
13842
|
-
paused:
|
|
13843
|
-
working:
|
|
13844
|
-
revision:
|
|
14289
|
+
latestAuthorAgentId: z67.string().uuid().nullable().optional()
|
|
14290
|
+
});
|
|
14291
|
+
var UserSkillAgentSchema = z67.object({
|
|
14292
|
+
agentId: z67.string().uuid(),
|
|
14293
|
+
name: z67.string(),
|
|
14294
|
+
managed: z67.boolean().optional(),
|
|
14295
|
+
paused: z67.boolean(),
|
|
14296
|
+
working: z67.boolean(),
|
|
14297
|
+
revision: z67.number().int(),
|
|
13845
14298
|
desired: UserSkillPinsSchema,
|
|
13846
14299
|
observed: UserSkillPinsSchema,
|
|
13847
|
-
state:
|
|
13848
|
-
errorCode:
|
|
13849
|
-
sessionId:
|
|
14300
|
+
state: z67.enum(["pending", "applying", "ready", "error"]),
|
|
14301
|
+
errorCode: z67.string().nullable(),
|
|
14302
|
+
sessionId: z67.string().nullable()
|
|
13850
14303
|
});
|
|
13851
|
-
var UserSkillLibrarySchema =
|
|
13852
|
-
skills:
|
|
13853
|
-
agents:
|
|
14304
|
+
var UserSkillLibrarySchema = z67.object({
|
|
14305
|
+
skills: z67.array(UserSkillSummarySchema),
|
|
14306
|
+
agents: z67.array(UserSkillAgentSchema)
|
|
13854
14307
|
});
|
|
13855
14308
|
var USER_SKILL_GITHUB_REPO_PATTERN = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\/[A-Za-z0-9._-]{1,100}$/;
|
|
13856
|
-
var UserSkillGithubRepoSchema =
|
|
13857
|
-
var UserSkillGithubPathSchema =
|
|
13858
|
-
var UserSkillCommitShaSchema =
|
|
13859
|
-
var UserSkillUploadSourceSchema =
|
|
13860
|
-
var UserSkillGithubSourceSchema =
|
|
13861
|
-
kind:
|
|
14309
|
+
var UserSkillGithubRepoSchema = z67.string().regex(USER_SKILL_GITHUB_REPO_PATTERN, "Use a GitHub repository as owner/repo").refine((repo) => ![".", ".."].includes(repo.split("/")[1]), "Use a GitHub repository as owner/repo");
|
|
14310
|
+
var UserSkillGithubPathSchema = z67.string().max(1024).refine((path3) => path3 === "" || !path3.startsWith("/") && path3.split("/").every((part) => part && part !== "." && part !== ".." && ![...part].some((c) => c === "\\" || c.charCodeAt(0) < 32 || c.charCodeAt(0) === 127)), "Use a directory path inside the repository");
|
|
14311
|
+
var UserSkillCommitShaSchema = z67.string().regex(/^[a-f0-9]{40}$/, "Use a full 40-character lowercase commit SHA");
|
|
14312
|
+
var UserSkillUploadSourceSchema = z67.object({ kind: z67.literal("upload") }).strict();
|
|
14313
|
+
var UserSkillGithubSourceSchema = z67.object({
|
|
14314
|
+
kind: z67.literal("github"),
|
|
13862
14315
|
repo: UserSkillGithubRepoSchema,
|
|
13863
14316
|
path: UserSkillGithubPathSchema,
|
|
13864
14317
|
commitSha: UserSkillCommitShaSchema,
|
|
@@ -13867,49 +14320,49 @@ var UserSkillGithubSourceSchema = z66.object({
|
|
|
13867
14320
|
* another ID was deleted and recreated under the same name, not renamed. Versions saved
|
|
13868
14321
|
* before it was recorded have none.
|
|
13869
14322
|
*/
|
|
13870
|
-
repoId:
|
|
14323
|
+
repoId: z67.number().int().positive().optional(),
|
|
13871
14324
|
/** The ref the owner or agent asked for (branch, tag or SHA) before it was resolved. */
|
|
13872
|
-
ref:
|
|
13873
|
-
fetchedAt:
|
|
14325
|
+
ref: z67.string().min(1).max(255).refine((ref) => ![...ref].some((c) => c.charCodeAt(0) <= 32 || c.charCodeAt(0) === 127), "Use a git branch, tag or commit"),
|
|
14326
|
+
fetchedAt: z67.string().datetime({ offset: true }),
|
|
13874
14327
|
/** Frontmatter `license` or the repository licence; null when none was found. */
|
|
13875
|
-
license:
|
|
14328
|
+
license: z67.string().trim().max(200).nullable().optional(),
|
|
13876
14329
|
/** Paths in the skill directory that were not imported (the preview lists the reasons). */
|
|
13877
|
-
excludedPaths:
|
|
14330
|
+
excludedPaths: z67.array(z67.string().min(1).max(1024)).max(1e3)
|
|
13878
14331
|
}).strict();
|
|
13879
|
-
var UserSkillAgentSourceSchema =
|
|
13880
|
-
var UserSkillSourceSchema =
|
|
14332
|
+
var UserSkillAgentSourceSchema = z67.object({ kind: z67.literal("agent"), agentId: z67.string().uuid() }).strict();
|
|
14333
|
+
var UserSkillSourceSchema = z67.discriminatedUnion("kind", [
|
|
13881
14334
|
UserSkillUploadSourceSchema,
|
|
13882
14335
|
UserSkillGithubSourceSchema,
|
|
13883
14336
|
UserSkillAgentSourceSchema
|
|
13884
14337
|
]);
|
|
13885
|
-
var UserSkillVersionAuthorSchema =
|
|
13886
|
-
|
|
13887
|
-
|
|
14338
|
+
var UserSkillVersionAuthorSchema = z67.discriminatedUnion("kind", [
|
|
14339
|
+
z67.object({ kind: z67.literal("owner"), memberId: z67.string().min(1).max(256) }).strict(),
|
|
14340
|
+
z67.object({ kind: z67.literal("agent"), agentId: z67.string().uuid() }).strict()
|
|
13888
14341
|
]);
|
|
13889
|
-
var UserSkillVersionSchema =
|
|
13890
|
-
version:
|
|
13891
|
-
digest:
|
|
13892
|
-
name:
|
|
13893
|
-
description:
|
|
13894
|
-
bytes:
|
|
13895
|
-
fileCount:
|
|
13896
|
-
note:
|
|
13897
|
-
createdAt:
|
|
14342
|
+
var UserSkillVersionSchema = z67.object({
|
|
14343
|
+
version: z67.number().int(),
|
|
14344
|
+
digest: z67.string(),
|
|
14345
|
+
name: z67.string(),
|
|
14346
|
+
description: z67.string(),
|
|
14347
|
+
bytes: z67.number().int(),
|
|
14348
|
+
fileCount: z67.number().int(),
|
|
14349
|
+
note: z67.string(),
|
|
14350
|
+
createdAt: z67.string(),
|
|
13898
14351
|
/** Where the version came from (ADR-0476). The backend always sends it. */
|
|
13899
14352
|
source: UserSkillSourceSchema.optional(),
|
|
13900
14353
|
/** Who saved the version (ADR-0476). The backend always sends it. */
|
|
13901
14354
|
author: UserSkillVersionAuthorSchema.optional()
|
|
13902
14355
|
});
|
|
13903
|
-
var UserSkillDetailSchema =
|
|
14356
|
+
var UserSkillDetailSchema = z67.object({
|
|
13904
14357
|
skill: UserSkillSummarySchema,
|
|
13905
14358
|
draft: UserSkillStoredBundleSchema.nullable(),
|
|
13906
|
-
versions:
|
|
13907
|
-
agents:
|
|
14359
|
+
versions: z67.array(UserSkillVersionSchema),
|
|
14360
|
+
agents: z67.array(UserSkillAgentSchema)
|
|
13908
14361
|
});
|
|
13909
14362
|
var USER_SKILL_AUTHORING_MODES = ["off", "drafts", "free"];
|
|
13910
|
-
var UserSkillAuthoringModeSchema =
|
|
13911
|
-
var UserSkillAuthoringModeViewSchema =
|
|
13912
|
-
agentId:
|
|
14363
|
+
var UserSkillAuthoringModeSchema = z67.enum(USER_SKILL_AUTHORING_MODES);
|
|
14364
|
+
var UserSkillAuthoringModeViewSchema = z67.object({
|
|
14365
|
+
agentId: z67.string().uuid(),
|
|
13913
14366
|
mode: UserSkillAuthoringModeSchema
|
|
13914
14367
|
});
|
|
13915
14368
|
var UserSkillAuthoringModeInputSchema = UserSkillAuthoringModeViewSchema.strict();
|
|
@@ -13920,199 +14373,199 @@ var USER_SKILL_SHARE_REQUEST_STATUSES = [
|
|
|
13920
14373
|
"superseded",
|
|
13921
14374
|
"cancelled"
|
|
13922
14375
|
];
|
|
13923
|
-
var UserSkillShareRequestStatusSchema =
|
|
13924
|
-
var UserSkillShareRequestSchema =
|
|
13925
|
-
id:
|
|
13926
|
-
skillId:
|
|
14376
|
+
var UserSkillShareRequestStatusSchema = z67.enum(USER_SKILL_SHARE_REQUEST_STATUSES);
|
|
14377
|
+
var UserSkillShareRequestSchema = z67.object({
|
|
14378
|
+
id: z67.string().uuid(),
|
|
14379
|
+
skillId: z67.string().uuid(),
|
|
13927
14380
|
/** The skill's current name in the library. */
|
|
13928
|
-
skillName:
|
|
13929
|
-
version:
|
|
14381
|
+
skillName: z67.string(),
|
|
14382
|
+
version: z67.number().int().positive(),
|
|
13930
14383
|
/**
|
|
13931
14384
|
* The requested version's own name and description, which the owner reviews: a later version
|
|
13932
14385
|
* may have renamed the skill (ADR-0476 section 6).
|
|
13933
14386
|
*/
|
|
13934
|
-
versionName:
|
|
13935
|
-
versionDescription:
|
|
13936
|
-
digest:
|
|
13937
|
-
fromAgentId:
|
|
13938
|
-
fromAgentName:
|
|
13939
|
-
toAgentId:
|
|
13940
|
-
toAgentName:
|
|
14387
|
+
versionName: z67.string(),
|
|
14388
|
+
versionDescription: z67.string(),
|
|
14389
|
+
digest: z67.string(),
|
|
14390
|
+
fromAgentId: z67.string().uuid(),
|
|
14391
|
+
fromAgentName: z67.string(),
|
|
14392
|
+
toAgentId: z67.string().uuid(),
|
|
14393
|
+
toAgentName: z67.string(),
|
|
13941
14394
|
status: UserSkillShareRequestStatusSchema,
|
|
13942
|
-
createdAt:
|
|
13943
|
-
decidedAt:
|
|
14395
|
+
createdAt: z67.string(),
|
|
14396
|
+
decidedAt: z67.string().nullable()
|
|
13944
14397
|
});
|
|
13945
|
-
var UserSkillShareRequestListInputSchema =
|
|
13946
|
-
var UserSkillShareDecisionInputSchema =
|
|
13947
|
-
var UserSkillShareRevokeInputSchema =
|
|
13948
|
-
var UserSkillShareRevokeResultSchema =
|
|
14398
|
+
var UserSkillShareRequestListInputSchema = z67.object({ status: z67.enum(["pending", "all"]).default("pending") }).strict();
|
|
14399
|
+
var UserSkillShareDecisionInputSchema = z67.object({ requestId: z67.string().uuid(), decision: z67.enum(["approve", "reject"]) }).strict();
|
|
14400
|
+
var UserSkillShareRevokeInputSchema = z67.object({ agentId: z67.string().uuid() }).strict();
|
|
14401
|
+
var UserSkillShareRevokeResultSchema = z67.object({
|
|
13949
14402
|
/** The agent whose shares were taken back. */
|
|
13950
|
-
agentId:
|
|
14403
|
+
agentId: z67.string().uuid(),
|
|
13951
14404
|
/** The agent's skill authoring mode, now `off`, so it cannot share again until the owner says. */
|
|
13952
|
-
authoringMode:
|
|
14405
|
+
authoringMode: z67.literal("off"),
|
|
13953
14406
|
/** Each pin removed from another agent; an agent whose pin was since changed keeps it. */
|
|
13954
|
-
removed:
|
|
13955
|
-
agentId:
|
|
13956
|
-
agentName:
|
|
13957
|
-
skillId:
|
|
13958
|
-
skillName:
|
|
13959
|
-
version:
|
|
14407
|
+
removed: z67.array(z67.object({
|
|
14408
|
+
agentId: z67.string().uuid(),
|
|
14409
|
+
agentName: z67.string(),
|
|
14410
|
+
skillId: z67.string().uuid(),
|
|
14411
|
+
skillName: z67.string(),
|
|
14412
|
+
version: z67.number().int().positive()
|
|
13960
14413
|
})),
|
|
13961
14414
|
/** The agent's pending share requests, now cancelled. */
|
|
13962
|
-
cancelledRequestIds:
|
|
14415
|
+
cancelledRequestIds: z67.array(z67.string().uuid())
|
|
13963
14416
|
});
|
|
13964
|
-
var UserSkillImportPreviewInputSchema =
|
|
14417
|
+
var UserSkillImportPreviewInputSchema = z67.object({
|
|
13965
14418
|
/**
|
|
13966
14419
|
* A skills.sh link (`https://skills.sh/<owner>/<repo>/<skill>`), `owner/repo` (with `skill`),
|
|
13967
14420
|
* or a GitHub directory URL (`https://github.com/<owner>/<repo>/tree/<ref>/<path>`).
|
|
13968
14421
|
*/
|
|
13969
|
-
source:
|
|
14422
|
+
source: z67.string().trim().min(1).max(2048),
|
|
13970
14423
|
/** The skill to find in the repository, by SKILL.md `name` or directory name. */
|
|
13971
|
-
skill:
|
|
14424
|
+
skill: z67.string().trim().min(1).max(200).optional(),
|
|
13972
14425
|
/** Branch, tag or commit; defaults to the repository's default branch. */
|
|
13973
14426
|
ref: UserSkillGithubSourceSchema.shape.ref.optional()
|
|
13974
14427
|
}).strict();
|
|
13975
|
-
var UserSkillImportFileSchema =
|
|
13976
|
-
path:
|
|
14428
|
+
var UserSkillImportFileSchema = z67.object({
|
|
14429
|
+
path: z67.string(),
|
|
13977
14430
|
/** Decoded bytes. */
|
|
13978
|
-
size:
|
|
14431
|
+
size: z67.number().int().nonnegative(),
|
|
13979
14432
|
/** `readable`: served through skill_read. `sandbox`: copied into the agent's VM only. */
|
|
13980
|
-
kind:
|
|
13981
|
-
executable:
|
|
14433
|
+
kind: z67.enum(["readable", "sandbox"]),
|
|
14434
|
+
executable: z67.boolean(),
|
|
13982
14435
|
/**
|
|
13983
14436
|
* The file's text for the owner to read before saving; null for a binary asset, whose bytes
|
|
13984
14437
|
* are not sent. Optional for older backends.
|
|
13985
14438
|
*/
|
|
13986
|
-
text:
|
|
14439
|
+
text: z67.string().nullable().optional()
|
|
13987
14440
|
});
|
|
13988
|
-
var UserSkillImportExcludedSchema =
|
|
13989
|
-
var UserSkillImportPreviewSchema =
|
|
14441
|
+
var UserSkillImportExcludedSchema = z67.object({ path: z67.string(), reason: z67.string() });
|
|
14442
|
+
var UserSkillImportPreviewSchema = z67.object({
|
|
13990
14443
|
repo: UserSkillGithubRepoSchema,
|
|
13991
14444
|
path: UserSkillGithubPathSchema,
|
|
13992
|
-
ref:
|
|
14445
|
+
ref: z67.string(),
|
|
13993
14446
|
commitSha: UserSkillCommitShaSchema,
|
|
13994
|
-
name:
|
|
13995
|
-
description:
|
|
13996
|
-
files:
|
|
14447
|
+
name: z67.string(),
|
|
14448
|
+
description: z67.string(),
|
|
14449
|
+
files: z67.array(UserSkillImportFileSchema),
|
|
13997
14450
|
/** Every file that will not be imported, with its reason; the import must confirm them. */
|
|
13998
|
-
excluded:
|
|
13999
|
-
warnings:
|
|
14000
|
-
license:
|
|
14451
|
+
excluded: z67.array(UserSkillImportExcludedSchema),
|
|
14452
|
+
warnings: z67.array(z67.string()),
|
|
14453
|
+
license: z67.string().nullable(),
|
|
14001
14454
|
/** An existing skill whose latest version already has exactly this content. */
|
|
14002
|
-
upToDate:
|
|
14455
|
+
upToDate: z67.object({ skillId: z67.string().uuid(), version: z67.number().int() }).nullable(),
|
|
14003
14456
|
/** Opaque; pass it to the import unchanged before `expiresAt`. */
|
|
14004
|
-
previewToken:
|
|
14005
|
-
expiresAt:
|
|
14457
|
+
previewToken: z67.string().min(1).max(8192),
|
|
14458
|
+
expiresAt: z67.string().datetime({ offset: true })
|
|
14006
14459
|
});
|
|
14007
14460
|
var UserSkillImportInputSchema = UserSkillIdSchema.extend({
|
|
14008
|
-
previewToken:
|
|
14009
|
-
requestKey:
|
|
14461
|
+
previewToken: z67.string().min(1).max(8192),
|
|
14462
|
+
requestKey: z67.string().uuid(),
|
|
14010
14463
|
/** 0 for a new skill; the skill's revision when importing a new version of an existing one. */
|
|
14011
|
-
expectedRevision:
|
|
14464
|
+
expectedRevision: z67.number().int().nonnegative(),
|
|
14012
14465
|
/** Must be true when the preview listed excluded files. */
|
|
14013
|
-
confirmExclusions:
|
|
14466
|
+
confirmExclusions: z67.boolean().default(false),
|
|
14014
14467
|
/**
|
|
14015
14468
|
* Must be true to save an update whose check listed `sourceChanges`: the repository was
|
|
14016
14469
|
* replaced, or the new commit does not descend from the current one.
|
|
14017
14470
|
*/
|
|
14018
|
-
confirmSourceChange:
|
|
14019
|
-
note:
|
|
14471
|
+
confirmSourceChange: z67.boolean().default(false),
|
|
14472
|
+
note: z67.string().trim().max(500).default("")
|
|
14020
14473
|
}).strict();
|
|
14021
|
-
var UserSkillImportResultSchema =
|
|
14474
|
+
var UserSkillImportResultSchema = z67.object({
|
|
14022
14475
|
/** `up_to_date`: an existing version already has this content, and nothing was saved. */
|
|
14023
|
-
status:
|
|
14024
|
-
skillId:
|
|
14025
|
-
version:
|
|
14026
|
-
revision:
|
|
14476
|
+
status: z67.enum(["imported", "up_to_date"]),
|
|
14477
|
+
skillId: z67.string().uuid(),
|
|
14478
|
+
version: z67.number().int().positive(),
|
|
14479
|
+
revision: z67.number().int().nonnegative()
|
|
14027
14480
|
});
|
|
14028
14481
|
var UserSkillUpdateCheckInputSchema = UserSkillIdSchema.strict();
|
|
14029
|
-
var UserSkillUpdateFileChangeSchema =
|
|
14030
|
-
path:
|
|
14031
|
-
change:
|
|
14032
|
-
kind:
|
|
14482
|
+
var UserSkillUpdateFileChangeSchema = z67.object({
|
|
14483
|
+
path: z67.string(),
|
|
14484
|
+
change: z67.enum(["added", "removed", "changed"]),
|
|
14485
|
+
kind: z67.enum(["readable", "sandbox"]),
|
|
14033
14486
|
/** Decoded bytes at the new commit; null when removed. */
|
|
14034
|
-
size:
|
|
14487
|
+
size: z67.number().int().nonnegative().nullable(),
|
|
14035
14488
|
/** Decoded bytes in the current version; null when added. */
|
|
14036
|
-
previousSize:
|
|
14489
|
+
previousSize: z67.number().int().nonnegative().nullable(),
|
|
14037
14490
|
/**
|
|
14038
14491
|
* For a changed text file: lines only the new commit has (`added`) and lines only the current
|
|
14039
14492
|
* version has (`removed`), counted as multisets, so a moved line counts as neither. Null for
|
|
14040
14493
|
* binary, added and removed files.
|
|
14041
14494
|
*/
|
|
14042
|
-
lines:
|
|
14495
|
+
lines: z67.object({ added: z67.number().int().nonnegative(), removed: z67.number().int().nonnegative() }).nullable()
|
|
14043
14496
|
});
|
|
14044
|
-
var UserSkillUpdateBaseSchema =
|
|
14045
|
-
skillId:
|
|
14497
|
+
var UserSkillUpdateBaseSchema = z67.object({
|
|
14498
|
+
skillId: z67.string().uuid(),
|
|
14046
14499
|
/** The skill's latest version, which the check compares against. */
|
|
14047
|
-
version:
|
|
14500
|
+
version: z67.number().int().positive(),
|
|
14048
14501
|
repo: UserSkillGithubRepoSchema,
|
|
14049
14502
|
path: UserSkillGithubPathSchema,
|
|
14050
14503
|
/** The ref that was resolved: the stored one, or the default branch when a commit was pinned. */
|
|
14051
|
-
ref:
|
|
14504
|
+
ref: z67.string(),
|
|
14052
14505
|
/** The commit the latest version was imported from. */
|
|
14053
14506
|
currentCommitSha: UserSkillCommitShaSchema,
|
|
14054
14507
|
/** The commit the ref resolves to now. */
|
|
14055
14508
|
latestCommitSha: UserSkillCommitShaSchema
|
|
14056
14509
|
});
|
|
14057
14510
|
var USER_SKILL_SOURCE_CHANGES = ["repository_replaced", "history_rewritten"];
|
|
14058
|
-
var UserSkillSourceChangeSchema =
|
|
14511
|
+
var UserSkillSourceChangeSchema = z67.object({
|
|
14059
14512
|
/**
|
|
14060
14513
|
* `repository_replaced`: the repository now has another GitHub ID, so it was deleted and
|
|
14061
14514
|
* another created under the same name, possibly by someone else. `history_rewritten`: the new
|
|
14062
14515
|
* commit does not descend from the current one (a force-push, or unrelated history).
|
|
14063
14516
|
*/
|
|
14064
|
-
kind:
|
|
14065
|
-
message:
|
|
14517
|
+
kind: z67.enum(USER_SKILL_SOURCE_CHANGES),
|
|
14518
|
+
message: z67.string()
|
|
14066
14519
|
});
|
|
14067
|
-
var UserSkillResolvedRepositorySchema =
|
|
14520
|
+
var UserSkillResolvedRepositorySchema = z67.object({
|
|
14068
14521
|
/** `owner/repo` as GitHub spells it now. */
|
|
14069
14522
|
repo: UserSkillGithubRepoSchema,
|
|
14070
14523
|
/** GitHub's numeric repository ID, which confirming records on the version's source. */
|
|
14071
|
-
id:
|
|
14524
|
+
id: z67.number().int().positive(),
|
|
14072
14525
|
/** When GitHub created the repository, if it said. A transfer keeps it. */
|
|
14073
|
-
createdAt:
|
|
14074
|
-
defaultBranch:
|
|
14526
|
+
createdAt: z67.string().datetime({ offset: true }).nullable(),
|
|
14527
|
+
defaultBranch: z67.string()
|
|
14075
14528
|
});
|
|
14076
|
-
var UserSkillSourceVerificationSchema =
|
|
14529
|
+
var UserSkillSourceVerificationSchema = z67.object({
|
|
14077
14530
|
repository: UserSkillResolvedRepositorySchema,
|
|
14078
14531
|
/** When the version was imported (its source's `fetchedAt`), to compare with `createdAt`. */
|
|
14079
|
-
importedAt:
|
|
14532
|
+
importedAt: z67.string().datetime({ offset: true }),
|
|
14080
14533
|
/** Why the repository is unconfirmed; also listed in the check's `warnings`. */
|
|
14081
|
-
warning:
|
|
14534
|
+
warning: z67.string(),
|
|
14082
14535
|
/** Opaque; pass it to `skillSourceVerify` unchanged before `expiresAt`. */
|
|
14083
|
-
checkToken:
|
|
14084
|
-
expiresAt:
|
|
14536
|
+
checkToken: z67.string().min(1).max(8192),
|
|
14537
|
+
expiresAt: z67.string().datetime({ offset: true })
|
|
14085
14538
|
});
|
|
14086
14539
|
var UserSkillSourceVerifyInputSchema = UserSkillIdSchema.extend({
|
|
14087
|
-
checkToken:
|
|
14088
|
-
requestKey:
|
|
14540
|
+
checkToken: z67.string().min(1).max(8192),
|
|
14541
|
+
requestKey: z67.string().uuid(),
|
|
14089
14542
|
/** The skill's revision when it was checked. */
|
|
14090
|
-
expectedRevision:
|
|
14543
|
+
expectedRevision: z67.number().int().nonnegative(),
|
|
14091
14544
|
/**
|
|
14092
14545
|
* Must be true: the owner checked that this is the repository the skill was imported from.
|
|
14093
14546
|
* Refused with SKILL_IMPORT_REPOSITORY_UNCONFIRMED otherwise.
|
|
14094
14547
|
*/
|
|
14095
|
-
confirmRepository:
|
|
14548
|
+
confirmRepository: z67.boolean().default(false)
|
|
14096
14549
|
}).strict();
|
|
14097
|
-
var UserSkillSourceVerifyResultSchema =
|
|
14098
|
-
status:
|
|
14099
|
-
skillId:
|
|
14550
|
+
var UserSkillSourceVerifyResultSchema = z67.object({
|
|
14551
|
+
status: z67.literal("verified"),
|
|
14552
|
+
skillId: z67.string().uuid(),
|
|
14100
14553
|
/** The version whose source now records `repoId`; no new version is created. */
|
|
14101
|
-
version:
|
|
14554
|
+
version: z67.number().int().positive(),
|
|
14102
14555
|
/** Unchanged: recording the ID changes no content. */
|
|
14103
|
-
revision:
|
|
14104
|
-
repoId:
|
|
14556
|
+
revision: z67.number().int().nonnegative(),
|
|
14557
|
+
repoId: z67.number().int().positive()
|
|
14105
14558
|
});
|
|
14106
|
-
var UserSkillUpdateCheckSchema =
|
|
14559
|
+
var UserSkillUpdateCheckSchema = z67.discriminatedUnion("status", [
|
|
14107
14560
|
/** The ref still names the same commit, or a commit with the same skill content. */
|
|
14108
14561
|
UserSkillUpdateBaseSchema.extend({
|
|
14109
|
-
status:
|
|
14562
|
+
status: z67.literal("up_to_date"),
|
|
14110
14563
|
/**
|
|
14111
14564
|
* What changed upstream without changing the skill's files, such as its license. Saving would
|
|
14112
14565
|
* store nothing (`skillImport` answers `up_to_date` for the same content), so these are shown
|
|
14113
14566
|
* for the owner to review rather than offered as an update.
|
|
14114
14567
|
*/
|
|
14115
|
-
warnings:
|
|
14568
|
+
warnings: z67.array(z67.string()),
|
|
14116
14569
|
/**
|
|
14117
14570
|
* Present when the latest version was saved before repository IDs were recorded, so agents
|
|
14118
14571
|
* cannot update it, its source is unchanged, and GitHub says the repository was created no
|
|
@@ -14124,23 +14577,23 @@ var UserSkillUpdateCheckSchema = z66.discriminatedUnion("status", [
|
|
|
14124
14577
|
verification: UserSkillSourceVerificationSchema.optional()
|
|
14125
14578
|
}),
|
|
14126
14579
|
UserSkillUpdateBaseSchema.extend({
|
|
14127
|
-
status:
|
|
14580
|
+
status: z67.literal("update_available"),
|
|
14128
14581
|
/** Save with `skillImport({ skillId, expectedRevision, previewToken })`. */
|
|
14129
14582
|
preview: UserSkillImportPreviewSchema,
|
|
14130
14583
|
/**
|
|
14131
14584
|
* Why this is not a routine update; saving it needs `confirmSourceChange: true`. The backend
|
|
14132
14585
|
* always sends it (empty for a routine update).
|
|
14133
14586
|
*/
|
|
14134
|
-
sourceChanges:
|
|
14135
|
-
changes:
|
|
14136
|
-
unchangedCount:
|
|
14587
|
+
sourceChanges: z67.array(UserSkillSourceChangeSchema).optional(),
|
|
14588
|
+
changes: z67.array(UserSkillUpdateFileChangeSchema),
|
|
14589
|
+
unchangedCount: z67.number().int().nonnegative()
|
|
14137
14590
|
})
|
|
14138
14591
|
]);
|
|
14139
14592
|
|
|
14140
14593
|
// ../../packages/shared/dist/schemas/managed-billing.schemas.js
|
|
14141
|
-
import { z as
|
|
14142
|
-
var id =
|
|
14143
|
-
var usd =
|
|
14594
|
+
import { z as z68 } from "zod";
|
|
14595
|
+
var id = z68.string().min(1).max(256);
|
|
14596
|
+
var usd = z68.string().regex(/^(0|[1-9]\d{0,9})(\.\d{1,6})?$/);
|
|
14144
14597
|
var SANDBOX_CONTAINER_SIZES = ["small", "medium", "large"];
|
|
14145
14598
|
function submissionReviewDecisionModelIssue(model) {
|
|
14146
14599
|
const name = (model ?? "").slice(0, 64);
|
|
@@ -14155,25 +14608,25 @@ function submissionReviewDecisionModelIssue(model) {
|
|
|
14155
14608
|
return null;
|
|
14156
14609
|
}
|
|
14157
14610
|
var isPinnedDecisionModel = (model) => submissionReviewDecisionModelIssue(model) === null;
|
|
14158
|
-
var ManagedCostPolicySchema =
|
|
14611
|
+
var ManagedCostPolicySchema = z68.object({
|
|
14159
14612
|
version: id,
|
|
14160
|
-
region:
|
|
14613
|
+
region: z68.enum(["global", "regional"]),
|
|
14161
14614
|
ownerDailyUsd: usd,
|
|
14162
14615
|
platformDailyUsd: usd,
|
|
14163
14616
|
computeReserveUsd: usd,
|
|
14164
14617
|
retainedResourceDailyUsd: usd,
|
|
14165
|
-
maxConcurrentOperations:
|
|
14166
|
-
maxUnresolvedOperations:
|
|
14167
|
-
maxUnresolvedAgeMs:
|
|
14618
|
+
maxConcurrentOperations: z68.number().int().min(1).max(64),
|
|
14619
|
+
maxUnresolvedOperations: z68.number().int().min(1).max(1e4),
|
|
14620
|
+
maxUnresolvedAgeMs: z68.number().int().min(6e4).max(6048e5),
|
|
14168
14621
|
/** Supplier invoice age advisory threshold; does not stop otherwise authorized work. */
|
|
14169
|
-
reconciliationMaxAgeMs:
|
|
14622
|
+
reconciliationMaxAgeMs: z68.number().int().min(6e4).max(6048e5),
|
|
14170
14623
|
/**
|
|
14171
14624
|
* The models this policy qualifies. Each must have a published supplier rate, which supplier
|
|
14172
14625
|
* exposure is reserved and settled from; a policy stored before a model was added still
|
|
14173
14626
|
* parses to exactly its stored JSON.
|
|
14174
14627
|
*/
|
|
14175
|
-
models:
|
|
14176
|
-
|
|
14628
|
+
models: z68.array(z68.union([
|
|
14629
|
+
z68.enum([
|
|
14177
14630
|
"gpt-5.6-luna",
|
|
14178
14631
|
"gpt-5.6-sol",
|
|
14179
14632
|
"gpt-6-astra",
|
|
@@ -14184,49 +14637,49 @@ var ManagedCostPolicySchema = z67.object({
|
|
|
14184
14637
|
// ADR-0324: an OpenRouter model slug. It must have a card entry (checked below).
|
|
14185
14638
|
OpenRouterModelIdSchema
|
|
14186
14639
|
])).min(1),
|
|
14187
|
-
nativeHelpersQualified:
|
|
14640
|
+
nativeHelpersQualified: z68.boolean(),
|
|
14188
14641
|
/** Explicit estimate for bounded native review processing/storage, including recovery. */
|
|
14189
|
-
nativeReviewProcessing:
|
|
14642
|
+
nativeReviewProcessing: z68.object({
|
|
14190
14643
|
usdPerRun: usd,
|
|
14191
|
-
qualificationEvidence:
|
|
14644
|
+
qualificationEvidence: z68.string().trim().min(1).max(256)
|
|
14192
14645
|
}).strict().optional(),
|
|
14193
14646
|
/** ADR-0283: direct evaluator calls require separately qualified, pinned rates and bounds. */
|
|
14194
|
-
nativeModels:
|
|
14647
|
+
nativeModels: z68.array(z68.object({
|
|
14195
14648
|
// `openai-responses` and `typesafe` still parse so stored policies keep their digest,
|
|
14196
14649
|
// but no evaluator call qualifies under them: every model runs on OpenRouter (#4205,
|
|
14197
14650
|
// ADR-0465).
|
|
14198
|
-
provider:
|
|
14651
|
+
provider: z68.enum(["openrouter", "openai-responses", "typesafe"]),
|
|
14199
14652
|
rate: RoutingPublishedRateSchema,
|
|
14200
|
-
maxInputTokens:
|
|
14201
|
-
maxOutputTokens:
|
|
14653
|
+
maxInputTokens: z68.number().int().positive().max(262144),
|
|
14654
|
+
maxOutputTokens: z68.number().int().nonnegative().max(16e3),
|
|
14202
14655
|
/**
|
|
14203
14656
|
* Qualified upper bound for one review image: the 2048px derivative for a vision call,
|
|
14204
14657
|
* the decision-image/v1 derivative for a decision model (ADR-0470). Required for vision.
|
|
14205
14658
|
*/
|
|
14206
|
-
maxImageTokens:
|
|
14207
|
-
qualificationEvidence:
|
|
14659
|
+
maxImageTokens: z68.number().int().positive().max(262144).optional(),
|
|
14660
|
+
qualificationEvidence: z68.string().trim().min(1).max(256)
|
|
14208
14661
|
}).strict()).max(8).optional(),
|
|
14209
|
-
corrections:
|
|
14210
|
-
approvalEvidence:
|
|
14662
|
+
corrections: z68.enum(["manual", "refund_downward"]),
|
|
14663
|
+
approvalEvidence: z68.string().trim().min(1).max(256),
|
|
14211
14664
|
/**
|
|
14212
14665
|
* Hosted sandbox pricing terms. Optional, and deliberately without schema defaults: a policy
|
|
14213
14666
|
* stored before these terms existed must parse to exactly its stored JSON, or its immutable
|
|
14214
14667
|
* digest would no longer match. Nothing prices these terms any more (#4199); they are
|
|
14215
14668
|
* kept only so a stored policy parses and digests unchanged.
|
|
14216
14669
|
*/
|
|
14217
|
-
sandbox:
|
|
14218
|
-
memory:
|
|
14219
|
-
granularity:
|
|
14670
|
+
sandbox: z68.object({
|
|
14671
|
+
memory: z68.enum(SANDBOX_MEMORY_TIERS).optional(),
|
|
14672
|
+
granularity: z68.enum(SANDBOX_BILLING_GRANULARITIES).optional(),
|
|
14220
14673
|
/** Assumed provider deletion after activity and keep-alives stop; not configurable there. */
|
|
14221
|
-
idleExpiryMs:
|
|
14674
|
+
idleExpiryMs: z68.number().int().min(6e4).max(864e5).optional(),
|
|
14222
14675
|
/**
|
|
14223
14676
|
* The memory tier each container size is billed at (ADR-0192). Optional per size and
|
|
14224
14677
|
* without defaults, for the same digest reason.
|
|
14225
14678
|
*/
|
|
14226
|
-
sizes:
|
|
14227
|
-
small:
|
|
14228
|
-
medium:
|
|
14229
|
-
large:
|
|
14679
|
+
sizes: z68.object({
|
|
14680
|
+
small: z68.enum(SANDBOX_MEMORY_TIERS).optional(),
|
|
14681
|
+
medium: z68.enum(SANDBOX_MEMORY_TIERS).optional(),
|
|
14682
|
+
large: z68.enum(SANDBOX_MEMORY_TIERS).optional()
|
|
14230
14683
|
}).strict().optional()
|
|
14231
14684
|
}).strict().optional(),
|
|
14232
14685
|
/**
|
|
@@ -14234,16 +14687,16 @@ var ManagedCostPolicySchema = z67.object({
|
|
|
14234
14687
|
* without defaults, for the digest reason above. Hosted agent VMs are refused unless the
|
|
14235
14688
|
* policy carries these terms: their time is never unpriced.
|
|
14236
14689
|
*/
|
|
14237
|
-
boat:
|
|
14690
|
+
boat: z68.object({
|
|
14238
14691
|
/** Customer price over Boat's rate: published rate = Boat's rate times this (>= 1). */
|
|
14239
|
-
markup:
|
|
14692
|
+
markup: z68.string().regex(/^[1-9]\d{0,2}(\.\d{1,6})?$/),
|
|
14240
14693
|
/**
|
|
14241
14694
|
* What Boat charges per running hour of each machine type, for planning: the exposure
|
|
14242
14695
|
* reserved before a reading exists. Settlement uses the dollars Boat reports.
|
|
14243
14696
|
*/
|
|
14244
|
-
providerUsdPerHour:
|
|
14697
|
+
providerUsdPerHour: z68.object({ small: usd, default: usd }).strict(),
|
|
14245
14698
|
/** Running time of a live VM reserved as exposure until metering settles it. */
|
|
14246
|
-
reserveWindowSeconds:
|
|
14699
|
+
reserveWindowSeconds: z68.number().int().min(60).max(7200),
|
|
14247
14700
|
/** Unreconciled Boat cost above this opens the owner and platform breakers. */
|
|
14248
14701
|
reconcileToleranceUsd: usd
|
|
14249
14702
|
}).strict().optional()
|
|
@@ -14254,11 +14707,11 @@ function usdToMicro(value) {
|
|
|
14254
14707
|
const [whole, fractional = ""] = usd.parse(value).split(".");
|
|
14255
14708
|
return BigInt(whole + fractional.padEnd(6, "0"));
|
|
14256
14709
|
}
|
|
14257
|
-
var ManagedTurnEvidenceSchema =
|
|
14710
|
+
var ManagedTurnEvidenceSchema = z68.object({
|
|
14258
14711
|
sessionId: id,
|
|
14259
14712
|
turnId: id,
|
|
14260
14713
|
subagentId: id.nullable(),
|
|
14261
|
-
status:
|
|
14714
|
+
status: z68.enum([
|
|
14262
14715
|
"completed",
|
|
14263
14716
|
"failed",
|
|
14264
14717
|
"cancelled",
|
|
@@ -14268,11 +14721,11 @@ var ManagedTurnEvidenceSchema = z67.object({
|
|
|
14268
14721
|
]),
|
|
14269
14722
|
usage: AllowanceReportedUsageSchema.nullable()
|
|
14270
14723
|
}).strict();
|
|
14271
|
-
var ManagedWorkEvidenceSchema =
|
|
14724
|
+
var ManagedWorkEvidenceSchema = z68.object({
|
|
14272
14725
|
sessionId: id,
|
|
14273
14726
|
rootTurnId: id,
|
|
14274
|
-
complete:
|
|
14275
|
-
turns:
|
|
14727
|
+
complete: z68.boolean(),
|
|
14728
|
+
turns: z68.array(ManagedTurnEvidenceSchema).min(1).max(2e3)
|
|
14276
14729
|
}).strict();
|
|
14277
14730
|
|
|
14278
14731
|
// ../../packages/shared/dist/schemas/taskmarket-mcp.schemas.js
|
|
@@ -14291,124 +14744,124 @@ var DIRECT_TOOL_GROUPS = [
|
|
|
14291
14744
|
"memory"
|
|
14292
14745
|
];
|
|
14293
14746
|
var DIRECT_TURN_RETRY_LIMIT = 1;
|
|
14294
|
-
var DirectRuntimeConfigurationSchema =
|
|
14295
|
-
platformToolsVersion:
|
|
14296
|
-
swarm:
|
|
14297
|
-
userSkills:
|
|
14298
|
-
integrations:
|
|
14299
|
-
taskmarketToolsVersion:
|
|
14300
|
-
integrationToolsVersion:
|
|
14747
|
+
var DirectRuntimeConfigurationSchema = z69.object({
|
|
14748
|
+
platformToolsVersion: z69.literal(1).optional(),
|
|
14749
|
+
swarm: z69.boolean(),
|
|
14750
|
+
userSkills: z69.object({ revision: z69.number().int().nonnegative(), pins: UserSkillPinsSchema }).optional(),
|
|
14751
|
+
integrations: z69.literal(true).optional(),
|
|
14752
|
+
taskmarketToolsVersion: z69.literal(1).optional(),
|
|
14753
|
+
integrationToolsVersion: z69.literal(2).optional(),
|
|
14301
14754
|
/**
|
|
14302
14755
|
* Memory tools and the memory contract (SM-20, SM-25); a new version replaces the session.
|
|
14303
14756
|
* 2: swarm writes (proposals under taint, SM-51) and `memory_search` history (SM-61).
|
|
14304
14757
|
*/
|
|
14305
|
-
memoryToolsVersion:
|
|
14758
|
+
memoryToolsVersion: z69.union([z69.literal(1), z69.literal(2)]).optional(),
|
|
14306
14759
|
/**
|
|
14307
14760
|
* The memory contract describes the core.md template (#726, MEMORY_CORE_TEMPLATE_ENABLED).
|
|
14308
14761
|
* Absent when off, so turning it on or off replaces the session like any contract change.
|
|
14309
14762
|
*/
|
|
14310
|
-
memoryCoreTemplate:
|
|
14311
|
-
nativeSubagents:
|
|
14312
|
-
inbox:
|
|
14763
|
+
memoryCoreTemplate: z69.literal(true).optional(),
|
|
14764
|
+
nativeSubagents: z69.literal(2).optional(),
|
|
14765
|
+
inbox: z69.literal(1).optional(),
|
|
14313
14766
|
/**
|
|
14314
14767
|
* The hosted container size the session is created with (ADR-0192). Absent on configurations
|
|
14315
14768
|
* written before sizes, whose sessions request none and run at the provider's medium default;
|
|
14316
14769
|
* a change of size replaces the session like any configuration change.
|
|
14317
14770
|
*/
|
|
14318
|
-
containerSize:
|
|
14771
|
+
containerSize: z69.enum(SANDBOX_CONTAINER_SIZES).optional(),
|
|
14319
14772
|
/**
|
|
14320
14773
|
* The session runs with no sandbox (ADR-0194): no shell, no files, and its first input sent
|
|
14321
14774
|
* with the create. Absent is a hosted sandbox, as every session had before; a change replaces
|
|
14322
14775
|
* the session like any configuration change.
|
|
14323
14776
|
*/
|
|
14324
|
-
workspace:
|
|
14325
|
-
profile:
|
|
14326
|
-
version:
|
|
14327
|
-
responsibility:
|
|
14777
|
+
workspace: z69.literal("none").optional(),
|
|
14778
|
+
profile: z69.object({
|
|
14779
|
+
version: z69.number().int().nonnegative(),
|
|
14780
|
+
responsibility: z69.string().max(500),
|
|
14328
14781
|
/**
|
|
14329
14782
|
* Standing instructions frozen into the session. Absent when memory tools are on (SM-24):
|
|
14330
14783
|
* they then reach the model through the pinned memory core, so editing them does not
|
|
14331
14784
|
* replace the session. Bounded by the memory document cap, their source of truth.
|
|
14332
14785
|
*/
|
|
14333
|
-
instructions:
|
|
14786
|
+
instructions: z69.string().max(65536).optional()
|
|
14334
14787
|
}).optional(),
|
|
14335
14788
|
/**
|
|
14336
14789
|
* Tool groups the session defers behind tool search, in `DIRECT_TOOL_GROUPS` order. Only groups
|
|
14337
14790
|
* the session actually has are listed, so deferring a group an agent does not use changes
|
|
14338
14791
|
* nothing for it; a change to the list replaces the session like any tool change.
|
|
14339
14792
|
*/
|
|
14340
|
-
deferredTools:
|
|
14793
|
+
deferredTools: z69.array(z69.enum(DIRECT_TOOL_GROUPS)).min(1).max(DIRECT_TOOL_GROUPS.length).optional(),
|
|
14341
14794
|
/**
|
|
14342
14795
|
* The session reaches the read-only Taskmarket MCP server (ADR-0207): the server URL
|
|
14343
14796
|
* and the vault its credential is in, both fixed when the session is created, and the tools it
|
|
14344
14797
|
* may call. Absent when not attached; a change replaces the session like any configuration
|
|
14345
14798
|
* change.
|
|
14346
14799
|
*/
|
|
14347
|
-
mcp:
|
|
14348
|
-
serverUrl:
|
|
14349
|
-
vaultId:
|
|
14350
|
-
tools:
|
|
14800
|
+
mcp: z69.object({
|
|
14801
|
+
serverUrl: z69.string().url().max(2048),
|
|
14802
|
+
vaultId: z69.string().min(1).max(256),
|
|
14803
|
+
tools: z69.array(z69.string().regex(/^[a-z][a-z0-9_]{0,63}$/)).min(1).max(16)
|
|
14351
14804
|
}).strict().optional()
|
|
14352
14805
|
});
|
|
14353
|
-
var DirectMcpCredentialSchema =
|
|
14354
|
-
vaultId:
|
|
14806
|
+
var DirectMcpCredentialSchema = z69.object({
|
|
14807
|
+
vaultId: z69.string().min(1).max(256),
|
|
14355
14808
|
/** The server URL the credential is bound to; the provider cannot change it in place. */
|
|
14356
|
-
serverUrl:
|
|
14357
|
-
credentialId:
|
|
14358
|
-
tokenId:
|
|
14359
|
-
tokenExpiresAt:
|
|
14809
|
+
serverUrl: z69.string().url().max(2048),
|
|
14810
|
+
credentialId: z69.string().min(1).max(256),
|
|
14811
|
+
tokenId: z69.string().uuid(),
|
|
14812
|
+
tokenExpiresAt: z69.string().datetime(),
|
|
14360
14813
|
/** What the current token may read: never more than the deployment allows the agent now. */
|
|
14361
|
-
scopes:
|
|
14814
|
+
scopes: z69.array(z69.enum(TASKMARKET_MCP_TOKEN_SCOPES)).min(1).max(TASKMARKET_MCP_TOKEN_SCOPES.length),
|
|
14362
14815
|
/** Tokens the credential held before, kept until their revocation is recorded. */
|
|
14363
|
-
retiring:
|
|
14816
|
+
retiring: z69.array(z69.string().uuid()).min(1).max(16).optional(),
|
|
14364
14817
|
/**
|
|
14365
14818
|
* MCP was turned off while a session that names the credential was kept: every token of the
|
|
14366
14819
|
* agent is revoked, and the credential holds none that works until a fresh one is rotated in.
|
|
14367
14820
|
*/
|
|
14368
|
-
suspended:
|
|
14821
|
+
suspended: z69.literal(true).optional()
|
|
14369
14822
|
}).strict();
|
|
14370
|
-
var DirectFunctionCallSchema =
|
|
14371
|
-
name:
|
|
14372
|
-
argumentHash:
|
|
14373
|
-
state:
|
|
14374
|
-
reply:
|
|
14375
|
-
success:
|
|
14376
|
-
output:
|
|
14377
|
-
error:
|
|
14823
|
+
var DirectFunctionCallSchema = z69.object({
|
|
14824
|
+
name: z69.string().min(1).max(100),
|
|
14825
|
+
argumentHash: z69.string().regex(/^[a-f0-9]{64}$/),
|
|
14826
|
+
state: z69.enum(["prepared", "executing", "answered"]),
|
|
14827
|
+
reply: z69.object({
|
|
14828
|
+
success: z69.boolean(),
|
|
14829
|
+
output: z69.string().max(131072).optional(),
|
|
14830
|
+
error: z69.string().max(512).optional()
|
|
14378
14831
|
}).optional()
|
|
14379
14832
|
});
|
|
14380
|
-
var DirectRouteSelectionSchema =
|
|
14381
|
-
operationId:
|
|
14833
|
+
var DirectRouteSelectionSchema = z69.object({
|
|
14834
|
+
operationId: z69.string().uuid(),
|
|
14382
14835
|
mechanism: RoutingMechanismSchema,
|
|
14383
14836
|
selected: ExecutorSettingsSchema,
|
|
14384
|
-
policyVersion:
|
|
14385
|
-
rateVersion:
|
|
14837
|
+
policyVersion: z69.string().min(1).max(200),
|
|
14838
|
+
rateVersion: z69.string().min(1).max(200)
|
|
14386
14839
|
}).strict();
|
|
14387
|
-
var DirectRouteConfirmationSchema =
|
|
14840
|
+
var DirectRouteConfirmationSchema = z69.object({
|
|
14388
14841
|
/** The routing operation whose selection this confirms, never another operation's. */
|
|
14389
|
-
operationId:
|
|
14842
|
+
operationId: z69.string().uuid(),
|
|
14390
14843
|
/** The job whose dispatch fence produced it. */
|
|
14391
|
-
jobId:
|
|
14844
|
+
jobId: z69.string(),
|
|
14392
14845
|
settings: ExecutorSettingsSchema,
|
|
14393
|
-
observedAt:
|
|
14846
|
+
observedAt: z69.string().datetime(),
|
|
14394
14847
|
/**
|
|
14395
14848
|
* Whether the same settings were still observed after the provider accepted the input.
|
|
14396
14849
|
*
|
|
14397
14850
|
* False is not a failure: it is the state between the confirming read and the verification,
|
|
14398
14851
|
* and the state a worker that crashed in that window resumes into.
|
|
14399
14852
|
*/
|
|
14400
|
-
verifiedAfterDispatch:
|
|
14853
|
+
verifiedAfterDispatch: z69.boolean()
|
|
14401
14854
|
}).strict();
|
|
14402
14855
|
var DIRECT_ROUTE_DISPATCH_BINDINGS = ["not_dispatched", "bound", "contested"];
|
|
14403
14856
|
var DirectPendingRouteSchema = DirectRouteSelectionSchema.extend({
|
|
14404
14857
|
/** The job this route was selected for. A route never travels to another job. */
|
|
14405
|
-
jobId:
|
|
14406
|
-
settingsPhase:
|
|
14407
|
-
requestedAt:
|
|
14408
|
-
confirmedAt:
|
|
14858
|
+
jobId: z69.string(),
|
|
14859
|
+
settingsPhase: z69.enum(ROUTING_SETTINGS_TRANSITION_STATES),
|
|
14860
|
+
requestedAt: z69.string().datetime().nullable(),
|
|
14861
|
+
confirmedAt: z69.string().datetime().nullable(),
|
|
14409
14862
|
/** Readback is evidence about the session, never a source of attribution. */
|
|
14410
|
-
readbackModelId:
|
|
14411
|
-
lostResponse:
|
|
14863
|
+
readbackModelId: z69.string().min(1).max(256).nullable(),
|
|
14864
|
+
lostResponse: z69.boolean(),
|
|
14412
14865
|
/**
|
|
14413
14866
|
* SPEC-0018 R3.4. How far this job's input binding got.
|
|
14414
14867
|
*
|
|
@@ -14416,27 +14869,27 @@ var DirectPendingRouteSchema = DirectRouteSelectionSchema.extend({
|
|
|
14416
14869
|
* `not_dispatched` -- the honest reading of a record that predates the check -- instead of
|
|
14417
14870
|
* decoding as a binding nobody verified.
|
|
14418
14871
|
*/
|
|
14419
|
-
dispatchBinding:
|
|
14872
|
+
dispatchBinding: z69.enum(DIRECT_ROUTE_DISPATCH_BINDINGS).default("not_dispatched")
|
|
14420
14873
|
}).strict();
|
|
14421
|
-
var DirectUsageOperationSchema =
|
|
14422
|
-
operationId:
|
|
14423
|
-
purpose:
|
|
14424
|
-
tokenCeiling:
|
|
14425
|
-
turnId:
|
|
14426
|
-
phase:
|
|
14427
|
-
billingBaseline:
|
|
14874
|
+
var DirectUsageOperationSchema = z69.object({
|
|
14875
|
+
operationId: z69.string().min(1).max(200),
|
|
14876
|
+
purpose: z69.enum(["work", "maintenance", "retry"]),
|
|
14877
|
+
tokenCeiling: z69.number().int().positive(),
|
|
14878
|
+
turnId: z69.string().min(1).max(256).nullable(),
|
|
14879
|
+
phase: z69.enum(["reserving", "reserved", "dispatched", "settled", "unresolved"]),
|
|
14880
|
+
billingBaseline: z69.array(z69.string().min(1).max(256)).max(2e3).optional()
|
|
14428
14881
|
}).strict();
|
|
14429
|
-
var DirectProjectSnapshotSchema =
|
|
14430
|
-
id:
|
|
14431
|
-
key:
|
|
14432
|
-
sha256:
|
|
14433
|
-
sessionId:
|
|
14434
|
-
turnId:
|
|
14435
|
-
setupHash:
|
|
14882
|
+
var DirectProjectSnapshotSchema = z69.object({
|
|
14883
|
+
id: z69.string().regex(/^[a-f0-9]{64}$/),
|
|
14884
|
+
key: z69.string().max(512),
|
|
14885
|
+
sha256: z69.string().regex(/^[a-f0-9]{64}$/),
|
|
14886
|
+
sessionId: z69.string().min(1).max(256),
|
|
14887
|
+
turnId: z69.string().min(1).max(256),
|
|
14888
|
+
setupHash: z69.string().regex(/^[a-f0-9]{64}$/)
|
|
14436
14889
|
}).strict();
|
|
14437
|
-
var DirectPendingSchema =
|
|
14438
|
-
jobId:
|
|
14439
|
-
baseline:
|
|
14890
|
+
var DirectPendingSchema = z69.object({
|
|
14891
|
+
jobId: z69.string(),
|
|
14892
|
+
baseline: z69.array(z69.string()),
|
|
14440
14893
|
/**
|
|
14441
14894
|
* The run's dispatch-group identity, carried on every usage event this job writes.
|
|
14442
14895
|
*
|
|
@@ -14444,7 +14897,7 @@ var DirectPendingSchema = z68.object({
|
|
|
14444
14897
|
* holds live in `operations` below, one per turn. This stays because the out-of-band
|
|
14445
14898
|
* reconciler's stored observations are keyed on it, and renaming it would orphan them.
|
|
14446
14899
|
*/
|
|
14447
|
-
reservationId:
|
|
14900
|
+
reservationId: z69.string(),
|
|
14448
14901
|
/**
|
|
14449
14902
|
* SPEC-0015 M4.2. The metered model operations this job has taken, in dispatch order.
|
|
14450
14903
|
*
|
|
@@ -14456,27 +14909,27 @@ var DirectPendingSchema = z68.object({
|
|
|
14456
14909
|
* Bounded at four: a job dispatches at most one work turn and one checkpoint-maintenance
|
|
14457
14910
|
* turn, and the bound is what stops a recovery loop from growing the checkpoint.
|
|
14458
14911
|
*/
|
|
14459
|
-
operations:
|
|
14460
|
-
runId:
|
|
14461
|
-
phase:
|
|
14462
|
-
deadline:
|
|
14912
|
+
operations: z69.array(DirectUsageOperationSchema).max(4).optional(),
|
|
14913
|
+
runId: z69.string().uuid().optional(),
|
|
14914
|
+
phase: z69.enum(["creating", "preparing", "dispatching", "following"]).optional(),
|
|
14915
|
+
deadline: z69.number().optional(),
|
|
14463
14916
|
// Exact ordinary input, saved before dispatch. Legacy checkpoints cannot be replayed.
|
|
14464
|
-
dispatch:
|
|
14465
|
-
text:
|
|
14466
|
-
key:
|
|
14467
|
-
attempts:
|
|
14468
|
-
acknowledged:
|
|
14469
|
-
cancelled:
|
|
14917
|
+
dispatch: z69.object({
|
|
14918
|
+
text: z69.string(),
|
|
14919
|
+
key: z69.string(),
|
|
14920
|
+
attempts: z69.number().int().min(0).max(2),
|
|
14921
|
+
acknowledged: z69.boolean(),
|
|
14922
|
+
cancelled: z69.boolean()
|
|
14470
14923
|
}).optional(),
|
|
14471
|
-
turnId:
|
|
14472
|
-
creationInput:
|
|
14924
|
+
turnId: z69.string().optional(),
|
|
14925
|
+
creationInput: z69.boolean().optional(),
|
|
14473
14926
|
/**
|
|
14474
14927
|
* The skill files the session this job creates is sent (ADR-0203), saved before the
|
|
14475
14928
|
* create, so a create whose response is lost is recovered with them as its `skillBundle`.
|
|
14476
14929
|
*/
|
|
14477
|
-
skillBundle:
|
|
14478
|
-
docsHash:
|
|
14479
|
-
inventoryHash:
|
|
14930
|
+
skillBundle: z69.object({
|
|
14931
|
+
docsHash: z69.string().regex(/^[a-f0-9]{64}$/),
|
|
14932
|
+
inventoryHash: z69.string().regex(/^[a-f0-9]{64}$/)
|
|
14480
14933
|
}).strict().optional(),
|
|
14481
14934
|
// `contextRetry` (a context-overflow retry) and `memoryTainted` were removed; checkpoints
|
|
14482
14935
|
// that still carry them parse, and the unknown keys are dropped on the next save.
|
|
@@ -14485,39 +14938,39 @@ var DirectPendingSchema = z68.object({
|
|
|
14485
14938
|
* from that turn are added to it as they are seen, so `sessionUsage` stays current on every
|
|
14486
14939
|
* save and a resumed job never counts the same turn twice.
|
|
14487
14940
|
*/
|
|
14488
|
-
sessionItems:
|
|
14941
|
+
sessionItems: z69.number().int().nonnegative().optional(),
|
|
14489
14942
|
/**
|
|
14490
14943
|
* ADR-0314. The value `project.unproven` had before this job's work turn set it, kept so a
|
|
14491
14944
|
* turn that could not have changed the sandbox puts it back. Absent until the work turn is
|
|
14492
14945
|
* dispatched into a session with a sandbox.
|
|
14493
14946
|
*/
|
|
14494
|
-
unprovenBefore:
|
|
14947
|
+
unprovenBefore: z69.boolean().optional(),
|
|
14495
14948
|
/**
|
|
14496
14949
|
* ADR-0314. `keepSetup` held back a setup change this job would otherwise have made, so the
|
|
14497
14950
|
* job's work turn is proved, best effort, while the agent has no verified backup. Decided
|
|
14498
14951
|
* when the job is prepared; a successor reads it rather than deciding again.
|
|
14499
14952
|
*/
|
|
14500
|
-
setupHeld:
|
|
14501
|
-
checkpointRepair:
|
|
14502
|
-
workTurnId:
|
|
14503
|
-
finalText:
|
|
14504
|
-
nativeTurnIds:
|
|
14953
|
+
setupHeld: z69.literal(true).optional(),
|
|
14954
|
+
checkpointRepair: z69.object({
|
|
14955
|
+
workTurnId: z69.string().min(1),
|
|
14956
|
+
finalText: z69.string().min(1).max(65536),
|
|
14957
|
+
nativeTurnIds: z69.array(z69.string()).max(2e3).optional(),
|
|
14505
14958
|
/**
|
|
14506
14959
|
* ADR-0314. Why the maintenance turn runs: the work turn could have changed the sandbox
|
|
14507
14960
|
* (`changed`, and every block written before the field), or it is a best-effort proof
|
|
14508
14961
|
* after an unproven turn (`unproven`) or for a held setup change (`held`). A best-effort
|
|
14509
14962
|
* proof that is refused or fails leaves the job's answer standing.
|
|
14510
14963
|
*/
|
|
14511
|
-
rule:
|
|
14964
|
+
rule: z69.enum(["changed", "unproven", "held"]).optional(),
|
|
14512
14965
|
/** ADR-0314. The refusal that stopped a best-effort maintenance turn being dispatched. */
|
|
14513
|
-
refused:
|
|
14966
|
+
refused: z69.string().min(1).max(100).optional()
|
|
14514
14967
|
}).optional(),
|
|
14515
|
-
replies:
|
|
14516
|
-
success:
|
|
14517
|
-
output:
|
|
14518
|
-
error:
|
|
14968
|
+
replies: z69.record(z69.object({
|
|
14969
|
+
success: z69.boolean(),
|
|
14970
|
+
output: z69.string().optional(),
|
|
14971
|
+
error: z69.string().optional()
|
|
14519
14972
|
})).optional(),
|
|
14520
|
-
calls:
|
|
14973
|
+
calls: z69.record(DirectFunctionCallSchema).optional(),
|
|
14521
14974
|
/**
|
|
14522
14975
|
* SPEC-0018 R3.1. The route this job was dispatched under, and its transition phase.
|
|
14523
14976
|
* Absent on every unrouted job, which is every job until routing is enabled.
|
|
@@ -14528,36 +14981,36 @@ var DirectPendingSchema = z68.object({
|
|
|
14528
14981
|
* dispatching again. The retry's input is the original text under its own idempotency key
|
|
14529
14982
|
* and its own `retry` operation; `attempt` never exceeds DIRECT_TURN_RETRY_LIMIT.
|
|
14530
14983
|
*/
|
|
14531
|
-
retry:
|
|
14532
|
-
attempt:
|
|
14533
|
-
code:
|
|
14534
|
-
turnId:
|
|
14984
|
+
retry: z69.object({
|
|
14985
|
+
attempt: z69.number().int().min(1).max(DIRECT_TURN_RETRY_LIMIT),
|
|
14986
|
+
code: z69.string().min(1).max(100),
|
|
14987
|
+
turnId: z69.string().min(1).max(256)
|
|
14535
14988
|
}).strict().optional(),
|
|
14536
14989
|
/**
|
|
14537
14990
|
* Why the host itself cancelled this job's turn: its run bound expired, or its recovery
|
|
14538
14991
|
* deadline passed. A turn found cancelled with this set ended on the host's own limit, not on
|
|
14539
14992
|
* an owner or operator pause.
|
|
14540
14993
|
*/
|
|
14541
|
-
cancelledBy:
|
|
14994
|
+
cancelledBy: z69.enum(["run_bound", "deadline"]).optional(),
|
|
14542
14995
|
/**
|
|
14543
14996
|
* ADR-0204. The native helper call in this job's turn that asked for a model other
|
|
14544
14997
|
* than the one the turn was pinned to. The helper model guard cancelled the turn on seeing it,
|
|
14545
14998
|
* so the turn ends the job with `DIRECT_HELPER_MODEL_REFUSED`, and the helper turns observed
|
|
14546
14999
|
* under it are attributed to the requested model rather than inherited from the root turn.
|
|
14547
15000
|
*/
|
|
14548
|
-
helperModel:
|
|
14549
|
-
turnId:
|
|
14550
|
-
itemId:
|
|
14551
|
-
model:
|
|
14552
|
-
reasoningEffort:
|
|
14553
|
-
sessionModel:
|
|
15001
|
+
helperModel: z69.object({
|
|
15002
|
+
turnId: z69.string().min(1).max(256),
|
|
15003
|
+
itemId: z69.string().min(1).max(256),
|
|
15004
|
+
model: z69.string().min(1).max(256),
|
|
15005
|
+
reasoningEffort: z69.string().min(1).max(64).nullable(),
|
|
15006
|
+
sessionModel: z69.string().min(1).max(256)
|
|
14554
15007
|
}).strict().optional(),
|
|
14555
15008
|
/**
|
|
14556
15009
|
* ADR-0196 (Accepted). This job's turns run on the flex service tier. Chosen once per run and
|
|
14557
15010
|
* kept here, so a resumed attempt dispatches on the same tier under the same idempotency key.
|
|
14558
15011
|
* Absent is the default tier.
|
|
14559
15012
|
*/
|
|
14560
|
-
serviceTier:
|
|
15013
|
+
serviceTier: z69.literal("flex").optional(),
|
|
14561
15014
|
/**
|
|
14562
15015
|
* ADR-0200. The wall-clock bound of the turn being followed when the worker may
|
|
14563
15016
|
* release its slot while the model works: set at each dispatch, in epoch milliseconds. A bound
|
|
@@ -14566,18 +15019,18 @@ var DirectPendingSchema = z68.object({
|
|
|
14566
15019
|
* `deadline` keeps its meaning (the latest the dispatch was made), which the unbought proof's
|
|
14567
15020
|
* bracket depends on.
|
|
14568
15021
|
*/
|
|
14569
|
-
turnDeadline:
|
|
15022
|
+
turnDeadline: z69.number().int().positive().optional(),
|
|
14570
15023
|
/**
|
|
14571
15024
|
* ADR-0200. This job's run released its worker slot while its turn ran: how many
|
|
14572
15025
|
* times, and when last. A later claim resumes it through the ordinary recovery path, which
|
|
14573
15026
|
* does not announce again the items of the turn listed in `announced`, nor record its usage
|
|
14574
15027
|
* again while it still reads as `usageHash`.
|
|
14575
15028
|
*/
|
|
14576
|
-
parked:
|
|
14577
|
-
count:
|
|
14578
|
-
at:
|
|
14579
|
-
announced:
|
|
14580
|
-
usageHash:
|
|
15029
|
+
parked: z69.object({
|
|
15030
|
+
count: z69.number().int().min(1),
|
|
15031
|
+
at: z69.string().datetime(),
|
|
15032
|
+
announced: z69.array(z69.string().min(1).max(512)).max(DIRECT_PARKED_ANNOUNCED_MAX).optional(),
|
|
15033
|
+
usageHash: z69.string().regex(/^[a-f0-9]{64}$/).optional()
|
|
14581
15034
|
}).strict().optional()
|
|
14582
15035
|
}).superRefine((pending, ctx) => {
|
|
14583
15036
|
if (pending.route && pending.route.jobId !== pending.jobId)
|
|
@@ -14588,48 +15041,48 @@ var DirectPendingSchema = z68.object({
|
|
|
14588
15041
|
});
|
|
14589
15042
|
});
|
|
14590
15043
|
var DIRECT_DETACHED_MAX = 8;
|
|
14591
|
-
var DirectDetachedSessionSchema =
|
|
15044
|
+
var DirectDetachedSessionSchema = z69.object({
|
|
14592
15045
|
/** The provider session, or null when the job was still creating it. */
|
|
14593
|
-
sessionId:
|
|
15046
|
+
sessionId: z69.string().min(1).max(256).nullable(),
|
|
14594
15047
|
/** The reset request this entry was detached under. */
|
|
14595
|
-
resetVersion:
|
|
14596
|
-
detachedAt:
|
|
15048
|
+
resetVersion: z69.number().int().positive(),
|
|
15049
|
+
detachedAt: z69.string().datetime(),
|
|
14597
15050
|
/** The session's model and tier when it was detached, for the settlement record. */
|
|
14598
|
-
model:
|
|
14599
|
-
tier:
|
|
15051
|
+
model: z69.string(),
|
|
15052
|
+
tier: z69.object({
|
|
14600
15053
|
tier: AgentTierSchema,
|
|
14601
|
-
mappingVersion:
|
|
14602
|
-
reasoningEffort:
|
|
15054
|
+
mappingVersion: z69.string().min(1).max(200),
|
|
15055
|
+
reasoningEffort: z69.enum(EXECUTOR_REASONING_EFFORTS).optional()
|
|
14603
15056
|
}).optional(),
|
|
14604
15057
|
/** The pending block exactly as the job left it: its run, operations, baseline and deadline. */
|
|
14605
15058
|
pending: DirectPendingSchema.nullable(),
|
|
14606
15059
|
/** A cancellation was sent to the session for the job's turn. Never sent twice. */
|
|
14607
|
-
cancelRequested:
|
|
15060
|
+
cancelRequested: z69.boolean().optional(),
|
|
14608
15061
|
/**
|
|
14609
15062
|
* Sessions the checkpoint had retired when this entry was detached. A job still `creating`
|
|
14610
15063
|
* may have replaced one of them earlier in the same job, so it carries the job's metadata
|
|
14611
15064
|
* too; settlement never adopts one as the session its lost create made. Optional: entries
|
|
14612
15065
|
* detached before it was recorded exclude nothing more than they did.
|
|
14613
15066
|
*/
|
|
14614
|
-
excludedSessions:
|
|
15067
|
+
excludedSessions: z69.array(z69.string().min(1).max(256)).max(100).optional(),
|
|
14615
15068
|
/** Why the last settlement attempt left the entry in place, for the operator. */
|
|
14616
|
-
unresolved:
|
|
15069
|
+
unresolved: z69.object({ reason: z69.string().min(1).max(100), at: z69.string().datetime() }).optional(),
|
|
14617
15070
|
/** Settlement attempts that left the entry in place, which sets the backoff below. */
|
|
14618
|
-
attempts:
|
|
15071
|
+
attempts: z69.number().int().nonnegative().optional(),
|
|
14619
15072
|
/** No settlement attempt is made before this: a stuck entry is not re-read every tick. */
|
|
14620
|
-
retryAt:
|
|
15073
|
+
retryAt: z69.string().datetime().optional(),
|
|
14621
15074
|
/**
|
|
14622
15075
|
* Every operation of the entry is closed, and only the provider deletion of its session is
|
|
14623
15076
|
* still owed. Set only on a checkpoint with no `project` block, which has no
|
|
14624
15077
|
* `sessionsToDelete` to put the session on; the session sweeper deletes the session under its
|
|
14625
15078
|
* usual evidence gates and then drops the entry.
|
|
14626
15079
|
*/
|
|
14627
|
-
settledAt:
|
|
15080
|
+
settledAt: z69.string().datetime().optional()
|
|
14628
15081
|
}).strict();
|
|
14629
|
-
var DirectAgentCheckpointSchema =
|
|
14630
|
-
kind:
|
|
14631
|
-
sessionId:
|
|
14632
|
-
model:
|
|
15082
|
+
var DirectAgentCheckpointSchema = z69.object({
|
|
15083
|
+
kind: z69.literal("openai-preview-v1"),
|
|
15084
|
+
sessionId: z69.string().nullable(),
|
|
15085
|
+
model: z69.string(),
|
|
14633
15086
|
/**
|
|
14634
15087
|
* The capability tier and tier-mapping version the current `model` was resolved from, and the
|
|
14635
15088
|
* reasoning effort that mapping set, if any. Session-scoped like `model`. A later job whose
|
|
@@ -14638,25 +15091,25 @@ var DirectAgentCheckpointSchema = z68.object({
|
|
|
14638
15091
|
* updates the live one. Absent on checkpoints written before tiers, which ran as light on the
|
|
14639
15092
|
* managed default settings.
|
|
14640
15093
|
*/
|
|
14641
|
-
tier:
|
|
15094
|
+
tier: z69.object({
|
|
14642
15095
|
tier: AgentTierSchema,
|
|
14643
|
-
mappingVersion:
|
|
14644
|
-
reasoningEffort:
|
|
15096
|
+
mappingVersion: z69.string().min(1).max(200),
|
|
15097
|
+
reasoningEffort: z69.enum(EXECUTOR_REASONING_EFFORTS).optional()
|
|
14645
15098
|
}).optional(),
|
|
14646
15099
|
/**
|
|
14647
15100
|
* ADR-0196 (Accepted). The live session runs on the flex service tier. Session-scoped like
|
|
14648
15101
|
* `model`; absent is the managed default tier.
|
|
14649
15102
|
*/
|
|
14650
|
-
serviceTier:
|
|
15103
|
+
serviceTier: z69.literal("flex").optional(),
|
|
14651
15104
|
/**
|
|
14652
15105
|
* ADR-0196 (Accepted). A flex turn the provider could not serve paused flex for this agent: no
|
|
14653
15106
|
* job selects flex before `until`, and the job that fell back never does.
|
|
14654
15107
|
*/
|
|
14655
|
-
flexUnavailable:
|
|
14656
|
-
networkAccess:
|
|
14657
|
-
toolProfile:
|
|
15108
|
+
flexUnavailable: z69.object({ until: z69.string().datetime(), jobId: z69.string().min(1) }).strict().optional(),
|
|
15109
|
+
networkAccess: z69.enum(["disabled", "enabled"]).optional(),
|
|
15110
|
+
toolProfile: z69.enum(["base", "purchases-v1"]).optional(),
|
|
14658
15111
|
configuration: DirectRuntimeConfigurationSchema.optional(),
|
|
14659
|
-
helperUsageHashes:
|
|
15112
|
+
helperUsageHashes: z69.record(z69.string().regex(/^[a-f0-9]{64}$/)).optional(),
|
|
14660
15113
|
/**
|
|
14661
15114
|
* SPEC-0018 R2.5. Attribution pinned at dispatch, per turn. Optional so existing checkpoints
|
|
14662
15115
|
* still decode; an absent ledger means the turn is unattributed, never that the session's
|
|
@@ -14686,10 +15139,10 @@ var DirectAgentCheckpointSchema = z68.object({
|
|
|
14686
15139
|
* because a confirmation is only worth anything for the dispatch it immediately preceded.
|
|
14687
15140
|
*/
|
|
14688
15141
|
routeConfirmation: DirectRouteConfirmationSchema.optional(),
|
|
14689
|
-
purchaseOperations:
|
|
14690
|
-
operationId:
|
|
14691
|
-
jobId:
|
|
14692
|
-
financialPhase:
|
|
15142
|
+
purchaseOperations: z69.array(z69.object({
|
|
15143
|
+
operationId: z69.string().uuid(),
|
|
15144
|
+
jobId: z69.string(),
|
|
15145
|
+
financialPhase: z69.enum([
|
|
14693
15146
|
"not_started",
|
|
14694
15147
|
"pending",
|
|
14695
15148
|
"unknown",
|
|
@@ -14697,21 +15150,21 @@ var DirectAgentCheckpointSchema = z68.object({
|
|
|
14697
15150
|
"released",
|
|
14698
15151
|
"failed"
|
|
14699
15152
|
]),
|
|
14700
|
-
resultStatus:
|
|
15153
|
+
resultStatus: z69.enum(["pending", "received", "failed"])
|
|
14701
15154
|
})).max(64).optional(),
|
|
14702
15155
|
/**
|
|
14703
15156
|
* The pinned memory core last sent into this session (SM-21): the combined pinned version and
|
|
14704
15157
|
* the session it was sent to. The core is sent again when its version moves or the session
|
|
14705
15158
|
* changes, and never on a turn where both are unchanged.
|
|
14706
15159
|
*/
|
|
14707
|
-
memoryInjectedVersion:
|
|
15160
|
+
memoryInjectedVersion: z69.object({ sessionId: z69.string().min(1).max(256), version: z69.string().min(1).max(64) }).optional(),
|
|
14708
15161
|
/**
|
|
14709
15162
|
* The owner's forget count (#714, `hosted_agents.memory_forget_version`) the session was created
|
|
14710
15163
|
* under. A higher count at the start of a later job means memory this session may hold was
|
|
14711
15164
|
* forgotten since, and the job moves the agent to a new session (`memory_forgotten`). Absent for
|
|
14712
15165
|
* a session created before it was recorded, which then counts as created under 0.
|
|
14713
15166
|
*/
|
|
14714
|
-
memoryForgetVersion:
|
|
15167
|
+
memoryForgetVersion: z69.object({ sessionId: z69.string().min(1).max(256), version: z69.number().int().nonnegative() }).optional(),
|
|
14715
15168
|
// `memoryTaintedSessionId` (session-wide pinned taint) was removed; checkpoints that still carry
|
|
14716
15169
|
// it parse, and the unknown key is dropped on the next save.
|
|
14717
15170
|
/**
|
|
@@ -14720,10 +15173,10 @@ var DirectAgentCheckpointSchema = z68.object({
|
|
|
14720
15173
|
* no reset code. The next job rolls over once it passes the threshold (never above the per-turn
|
|
14721
15174
|
* scan cap), or when the session ran out of context.
|
|
14722
15175
|
*/
|
|
14723
|
-
sessionUsage:
|
|
14724
|
-
sessionId:
|
|
14725
|
-
items:
|
|
14726
|
-
contextExceeded:
|
|
15176
|
+
sessionUsage: z69.object({
|
|
15177
|
+
sessionId: z69.string().min(1).max(256),
|
|
15178
|
+
items: z69.number().int().nonnegative(),
|
|
15179
|
+
contextExceeded: z69.boolean().optional(),
|
|
14727
15180
|
/**
|
|
14728
15181
|
* The provider refused this session further work: a safety system blocked its conversation
|
|
14729
15182
|
* (`policy_blocked`) or it reached its usage budget (`session_budget`). Or the host refused a
|
|
@@ -14731,7 +15184,7 @@ var DirectAgentCheckpointSchema = z68.object({
|
|
|
14731
15184
|
* stays open in it. The next job starts a new session with this as the rollover reason, the
|
|
14732
15185
|
* way `contextExceeded` does.
|
|
14733
15186
|
*/
|
|
14734
|
-
retire:
|
|
15187
|
+
retire: z69.enum(["policy_blocked", "session_budget", "helper_model"]).optional()
|
|
14735
15188
|
}).optional(),
|
|
14736
15189
|
/**
|
|
14737
15190
|
* The live session the idle sweeper deleted at the provider (parked) after the agent's last job
|
|
@@ -14740,16 +15193,16 @@ var DirectAgentCheckpointSchema = z68.object({
|
|
|
14740
15193
|
* memory and recent episodes. That job records the rollover (reason `idle_parked`) and clears
|
|
14741
15194
|
* this. Optional, so a worker that predates parking drops it and still takes the same path.
|
|
14742
15195
|
*/
|
|
14743
|
-
parkedSession:
|
|
14744
|
-
sessionId:
|
|
14745
|
-
parkedAt:
|
|
14746
|
-
items:
|
|
15196
|
+
parkedSession: z69.object({
|
|
15197
|
+
sessionId: z69.string().min(1).max(256),
|
|
15198
|
+
parkedAt: z69.string().datetime(),
|
|
15199
|
+
items: z69.number().int().nonnegative()
|
|
14747
15200
|
}).optional(),
|
|
14748
15201
|
/**
|
|
14749
15202
|
* The agent asked for a workspace from a session with no sandbox (`request_workspace`,
|
|
14750
15203
|
* ADR-0194), so its sessions keep a sandbox from its next job on. Never cleared by the runtime.
|
|
14751
15204
|
*/
|
|
14752
|
-
workspaceRequested:
|
|
15205
|
+
workspaceRequested: z69.literal(true).optional(),
|
|
14753
15206
|
/**
|
|
14754
15207
|
* The agent's Taskmarket MCP credential (ADR-0207), kept across sessions. Cleared once
|
|
14755
15208
|
* a session without the server is created and the credential is retired.
|
|
@@ -14760,16 +15213,16 @@ var DirectAgentCheckpointSchema = z68.object({
|
|
|
14760
15213
|
* session starts with none, and a session created before it was recorded keeps the behaviour it
|
|
14761
15214
|
* had until it is replaced.
|
|
14762
15215
|
*/
|
|
14763
|
-
sandbox:
|
|
14764
|
-
sessionId:
|
|
15216
|
+
sandbox: z69.object({
|
|
15217
|
+
sessionId: z69.string().min(1).max(256),
|
|
14765
15218
|
/** The container size the session was created with; absent when it requested none. */
|
|
14766
|
-
requestedSize:
|
|
15219
|
+
requestedSize: z69.enum(SANDBOX_CONTAINER_SIZES).optional(),
|
|
14767
15220
|
/** The effective size the provider reports for it, or null while it reports none. */
|
|
14768
|
-
reportedSize:
|
|
15221
|
+
reportedSize: z69.enum(SANDBOX_CONTAINER_SIZES).nullable().optional(),
|
|
14769
15222
|
/** The session was created with the identity sentinel's setup command. */
|
|
14770
|
-
sentinel:
|
|
15223
|
+
sentinel: z69.literal(true).optional(),
|
|
14771
15224
|
/** The sentinel's file name in the sandbox the session's work is known to be on. */
|
|
14772
|
-
identity:
|
|
15225
|
+
identity: z69.string().uuid().optional()
|
|
14773
15226
|
}).optional(),
|
|
14774
15227
|
/**
|
|
14775
15228
|
* The platform skill files the current session was created with (ADR-0203): what they
|
|
@@ -14778,51 +15231,51 @@ var DirectAgentCheckpointSchema = z68.object({
|
|
|
14778
15231
|
* by session, so a session created before it was recorded is checked against the deployed bundle,
|
|
14779
15232
|
* as before. A session with no sandbox has none.
|
|
14780
15233
|
*/
|
|
14781
|
-
skillBundle:
|
|
14782
|
-
sessionId:
|
|
14783
|
-
docsHash:
|
|
14784
|
-
inventoryHash:
|
|
15234
|
+
skillBundle: z69.object({
|
|
15235
|
+
sessionId: z69.string().min(1).max(256),
|
|
15236
|
+
docsHash: z69.string().regex(/^[a-f0-9]{64}$/),
|
|
15237
|
+
inventoryHash: z69.string().regex(/^[a-f0-9]{64}$/),
|
|
14785
15238
|
/**
|
|
14786
15239
|
* The sandbox identity (the sentinel name, ADR-0193) the market skill inventory was last
|
|
14787
15240
|
* verified in for this session (ADR-0312). Absent until a check passes with an identity
|
|
14788
15241
|
* read, and in checkpoints written before it was recorded: those list on their next job.
|
|
14789
15242
|
*/
|
|
14790
|
-
verifiedSandbox:
|
|
15243
|
+
verifiedSandbox: z69.string().uuid().optional()
|
|
14791
15244
|
}).optional(),
|
|
14792
15245
|
/**
|
|
14793
15246
|
* The owner's session reset (`hosted_agents.session_reset_version`) this checkpoint has handled.
|
|
14794
15247
|
* A higher version on the agent means the next job, or the session sweeper, detaches the
|
|
14795
15248
|
* current session and any pending job into `detached` and the agent starts a new session.
|
|
14796
15249
|
*/
|
|
14797
|
-
sessionReset:
|
|
15250
|
+
sessionReset: z69.object({ version: z69.number().int().nonnegative(), at: z69.string().datetime() }).optional(),
|
|
14798
15251
|
/** Sessions a reset detached that are not settled yet (see `DirectDetachedSessionSchema`). */
|
|
14799
|
-
detached:
|
|
14800
|
-
turns:
|
|
14801
|
-
expiresAt:
|
|
14802
|
-
persistent:
|
|
14803
|
-
project:
|
|
14804
|
-
version:
|
|
14805
|
-
setupHash:
|
|
15252
|
+
detached: z69.array(DirectDetachedSessionSchema).max(DIRECT_DETACHED_MAX).optional(),
|
|
15253
|
+
turns: z69.number().int().nonnegative(),
|
|
15254
|
+
expiresAt: z69.number(),
|
|
15255
|
+
persistent: z69.boolean().optional(),
|
|
15256
|
+
project: z69.object({
|
|
15257
|
+
version: z69.literal(1),
|
|
15258
|
+
setupHash: z69.string().regex(/^[a-f0-9]{64}$/),
|
|
14806
15259
|
snapshot: DirectProjectSnapshotSchema.nullable(),
|
|
14807
|
-
restoring:
|
|
15260
|
+
restoring: z69.boolean().default(false),
|
|
14808
15261
|
/**
|
|
14809
15262
|
* ADR-0314. The sandbox may hold something the last verified backup does not. Set before a
|
|
14810
15263
|
* work turn goes into a session with a sandbox, put back when the turn could not have
|
|
14811
15264
|
* changed it, and cleared by a verified backup or a completed restore, so a crash anywhere
|
|
14812
15265
|
* leaves it set. Absent in checkpoints written before it existed, which reads as clear.
|
|
14813
15266
|
*/
|
|
14814
|
-
unproven:
|
|
14815
|
-
restoreSetupHash:
|
|
15267
|
+
unproven: z69.boolean().optional(),
|
|
15268
|
+
restoreSetupHash: z69.string().regex(/^[a-f0-9]{64}$/).optional(),
|
|
14816
15269
|
restoreConfiguration: DirectRuntimeConfigurationSchema.optional(),
|
|
14817
15270
|
// `contextPending` and `context` (conversation excerpts) were removed by SM-35; checkpoints
|
|
14818
15271
|
// that still carry them parse, and the unknown keys are dropped on the next save.
|
|
14819
15272
|
/** Recent retired session ids, newest last (at most DIRECT_RETIRED_SESSIONS_KEPT kept). */
|
|
14820
|
-
retiredSessions:
|
|
15273
|
+
retiredSessions: z69.array(z69.string().min(1).max(256)).max(100).default([]),
|
|
14821
15274
|
/**
|
|
14822
15275
|
* Retired sessions still to delete at the provider (SM-34). Absent in checkpoints written
|
|
14823
15276
|
* before deletion existed; those start from their `retiredSessions`.
|
|
14824
15277
|
*/
|
|
14825
|
-
sessionsToDelete:
|
|
15278
|
+
sessionsToDelete: z69.array(z69.string().min(1).max(256)).max(DIRECT_SESSIONS_TO_DELETE_MAX).optional()
|
|
14826
15279
|
}).optional(),
|
|
14827
15280
|
/**
|
|
14828
15281
|
* The job in flight, or null. A checkpoint missing the key decodes as null instead of failing:
|
|
@@ -14831,399 +15284,116 @@ var DirectAgentCheckpointSchema = z68.object({
|
|
|
14831
15284
|
* failing every later job of the agent with no way out (not even an owner reset).
|
|
14832
15285
|
*/
|
|
14833
15286
|
pending: DirectPendingSchema.nullable().default(null),
|
|
14834
|
-
result:
|
|
14835
|
-
jobId:
|
|
14836
|
-
runId:
|
|
14837
|
-
text:
|
|
14838
|
-
errorCode:
|
|
15287
|
+
result: z69.object({
|
|
15288
|
+
jobId: z69.string(),
|
|
15289
|
+
runId: z69.string().uuid(),
|
|
15290
|
+
text: z69.string().max(65536),
|
|
15291
|
+
errorCode: z69.string().optional()
|
|
14839
15292
|
}).optional()
|
|
14840
15293
|
});
|
|
14841
15294
|
|
|
14842
15295
|
// ../../packages/shared/dist/schemas/swarm-wallet.schemas.js
|
|
14843
|
-
import { z as
|
|
14844
|
-
var SwarmWalletSetupSchema =
|
|
15296
|
+
import { z as z70 } from "zod";
|
|
15297
|
+
var SwarmWalletSetupSchema = z70.object({ requestKey: z70.string().uuid() }).strict();
|
|
14845
15298
|
var SwarmWalletCreateSchema = SwarmWalletSetupSchema.extend({
|
|
14846
15299
|
chainId: SwarmChainIdSchema.optional()
|
|
14847
15300
|
}).strict();
|
|
14848
15301
|
var SwarmWalletBindSchema = SwarmWalletSetupSchema.extend({
|
|
14849
|
-
walletId:
|
|
14850
|
-
address:
|
|
14851
|
-
walletIndex:
|
|
15302
|
+
walletId: z70.string().regex(/^[A-Za-z0-9_-]{1,128}$/),
|
|
15303
|
+
address: z70.string().regex(/^0x[0-9a-fA-F]{40}$/),
|
|
15304
|
+
walletIndex: z70.number().int().min(1).max(1e6)
|
|
14852
15305
|
}).strict();
|
|
14853
|
-
var SwarmWalletStatusSchema =
|
|
14854
|
-
status:
|
|
15306
|
+
var SwarmWalletStatusSchema = z70.object({
|
|
15307
|
+
status: z70.enum([
|
|
14855
15308
|
"not_started",
|
|
14856
15309
|
"pending_binding",
|
|
14857
15310
|
"binding_unknown",
|
|
14858
15311
|
"binding_rejected",
|
|
14859
15312
|
"ready"
|
|
14860
15313
|
]),
|
|
14861
|
-
requestKey:
|
|
14862
|
-
verifiedAt:
|
|
14863
|
-
wallet:
|
|
14864
|
-
walletId:
|
|
14865
|
-
address:
|
|
14866
|
-
walletIndex:
|
|
15314
|
+
requestKey: z70.string().uuid().nullable(),
|
|
15315
|
+
verifiedAt: z70.string().datetime().nullable(),
|
|
15316
|
+
wallet: z70.object({
|
|
15317
|
+
walletId: z70.string(),
|
|
15318
|
+
address: z70.string().regex(/^0x[0-9a-f]{40}$/),
|
|
15319
|
+
walletIndex: z70.number().int().min(1),
|
|
14867
15320
|
chainId: SwarmChainIdSchema
|
|
14868
15321
|
}).nullable(),
|
|
14869
|
-
spendingEnabled:
|
|
14870
|
-
creationEnabled:
|
|
15322
|
+
spendingEnabled: z70.boolean(),
|
|
15323
|
+
creationEnabled: z70.literal(false)
|
|
14871
15324
|
});
|
|
14872
|
-
var SwarmWalletCandidateSchema =
|
|
14873
|
-
walletId:
|
|
14874
|
-
address:
|
|
14875
|
-
walletIndex:
|
|
15325
|
+
var SwarmWalletCandidateSchema = z70.object({
|
|
15326
|
+
walletId: z70.string().regex(/^[A-Za-z0-9_-]{1,128}$/),
|
|
15327
|
+
address: z70.string().regex(/^0x[0-9a-fA-F]{40}$/),
|
|
15328
|
+
walletIndex: z70.number().int().min(0).max(1e6)
|
|
14876
15329
|
}).strict();
|
|
14877
15330
|
var SwarmWalletCreationConfirmSchema = SwarmWalletSetupSchema.extend({
|
|
14878
|
-
attemptId:
|
|
15331
|
+
attemptId: z70.string().uuid(),
|
|
14879
15332
|
walletId: SwarmWalletCandidateSchema.shape.walletId,
|
|
14880
|
-
ownerConfirmed:
|
|
15333
|
+
ownerConfirmed: z70.literal(true)
|
|
14881
15334
|
}).strict();
|
|
14882
15335
|
var SwarmWalletCreationCompleteSchema = SwarmWalletSetupSchema.extend({
|
|
14883
|
-
attemptId:
|
|
14884
|
-
signature:
|
|
15336
|
+
attemptId: z70.string().uuid(),
|
|
15337
|
+
signature: z70.string().regex(/^0x[0-9a-fA-F]{130}$/)
|
|
14885
15338
|
}).strict();
|
|
14886
|
-
var SwarmWalletInventorySchema =
|
|
15339
|
+
var SwarmWalletInventorySchema = z70.object({
|
|
14887
15340
|
wallet: SwarmWalletStatusSchema,
|
|
14888
|
-
setup:
|
|
14889
|
-
requestKey:
|
|
14890
|
-
attemptId:
|
|
14891
|
-
stage:
|
|
14892
|
-
status:
|
|
15341
|
+
setup: z70.object({
|
|
15342
|
+
requestKey: z70.string().uuid(),
|
|
15343
|
+
attemptId: z70.string().uuid(),
|
|
15344
|
+
stage: z70.enum(["prerequisite", "dedicated"]),
|
|
15345
|
+
status: z70.enum(["creation_unknown", "candidate_selected", "completed"]),
|
|
14893
15346
|
candidate: SwarmWalletCandidateSchema.nullable(),
|
|
14894
|
-
challenge:
|
|
15347
|
+
challenge: z70.string().nullable()
|
|
14895
15348
|
}).nullable(),
|
|
14896
|
-
candidates:
|
|
15349
|
+
candidates: z70.array(SwarmWalletCandidateSchema)
|
|
14897
15350
|
});
|
|
14898
15351
|
var SwarmWalletCreationPreparedSchema = SwarmWalletInventorySchema.extend({
|
|
14899
|
-
creationGrant:
|
|
15352
|
+
creationGrant: z70.object({ attemptId: z70.string().uuid(), operation: z70.enum(["first", "additional"]) }).nullable()
|
|
14900
15353
|
});
|
|
14901
15354
|
var SwarmWalletSelectExistingSchema = SwarmWalletSetupSchema.extend({
|
|
14902
15355
|
walletId: SwarmWalletCandidateSchema.shape.walletId,
|
|
14903
|
-
ownerConfirmed:
|
|
15356
|
+
ownerConfirmed: z70.literal(true)
|
|
14904
15357
|
}).strict();
|
|
14905
|
-
var WithdrawAddress =
|
|
14906
|
-
var WithdrawAmount =
|
|
14907
|
-
var WithdrawFee =
|
|
14908
|
-
var SwarmWalletWithdrawPrepareSchema =
|
|
15358
|
+
var WithdrawAddress = z70.string().regex(/^0x[0-9a-fA-F]{40}$/);
|
|
15359
|
+
var WithdrawAmount = z70.string().regex(/^[1-9][0-9]{0,29}$/, "Must be a positive integer amount in base units");
|
|
15360
|
+
var WithdrawFee = z70.string().regex(/^[1-9][0-9]{0,29}$/);
|
|
15361
|
+
var SwarmWalletWithdrawPrepareSchema = z70.object({
|
|
14909
15362
|
recipient: WithdrawAddress,
|
|
14910
15363
|
/** OUSD base units (6 decimals). */
|
|
14911
15364
|
amountBaseUnits: WithdrawAmount
|
|
14912
15365
|
}).strict();
|
|
14913
|
-
var SwarmWalletWithdrawTransactionSchema =
|
|
15366
|
+
var SwarmWalletWithdrawTransactionSchema = z70.object({
|
|
14914
15367
|
gas: WithdrawFee,
|
|
14915
15368
|
maxFeePerGas: WithdrawFee,
|
|
14916
15369
|
maxPriorityFeePerGas: WithdrawFee,
|
|
14917
15370
|
/** Unix seconds on the chain's clock; the transaction is dead after it. */
|
|
14918
|
-
validBefore:
|
|
15371
|
+
validBefore: z70.number().int().positive()
|
|
14919
15372
|
}).strict();
|
|
14920
|
-
var SwarmWalletWithdrawPreparedSchema =
|
|
15373
|
+
var SwarmWalletWithdrawPreparedSchema = z70.object({
|
|
14921
15374
|
chainId: SwarmChainIdSchema,
|
|
14922
15375
|
from: WithdrawAddress,
|
|
14923
15376
|
to: WithdrawAddress,
|
|
14924
15377
|
amountBaseUnits: WithdrawAmount,
|
|
14925
15378
|
transaction: SwarmWalletWithdrawTransactionSchema,
|
|
14926
15379
|
/** The 32-byte hash the owner's wallet signs as it is. */
|
|
14927
|
-
digest:
|
|
15380
|
+
digest: z70.string().regex(/^0x[0-9a-f]{64}$/)
|
|
14928
15381
|
});
|
|
14929
15382
|
var SwarmWalletWithdrawConfirmSchema = SwarmWalletWithdrawPrepareSchema.extend({
|
|
14930
15383
|
transaction: SwarmWalletWithdrawTransactionSchema,
|
|
14931
15384
|
/** The owner wallet's 65-byte signature of `digest`. */
|
|
14932
|
-
signature:
|
|
15385
|
+
signature: z70.string().regex(/^0x[0-9a-fA-F]{130}$/)
|
|
14933
15386
|
}).strict();
|
|
14934
|
-
var SwarmWalletWithdrawResultSchema =
|
|
14935
|
-
txHash:
|
|
15387
|
+
var SwarmWalletWithdrawResultSchema = z70.object({
|
|
15388
|
+
txHash: z70.string().regex(/^0x[0-9a-fA-F]{64}$/),
|
|
14936
15389
|
chainId: SwarmChainIdSchema,
|
|
14937
15390
|
from: WithdrawAddress,
|
|
14938
15391
|
to: WithdrawAddress,
|
|
14939
|
-
amountBaseUnits:
|
|
15392
|
+
amountBaseUnits: z70.string()
|
|
14940
15393
|
});
|
|
14941
15394
|
|
|
14942
15395
|
// ../../packages/shared/dist/schemas/swarm-consent.schemas.js
|
|
14943
15396
|
import { z as z71 } from "zod";
|
|
14944
|
-
|
|
14945
|
-
// ../../packages/shared/dist/schemas/hosted-market.schemas.js
|
|
14946
|
-
import { z as z70 } from "zod";
|
|
14947
|
-
var HOSTED_SKILL_READ_ACTIONS = ["skill-list", "skill-show"];
|
|
14948
|
-
var HOSTED_SKILL_WRITE_ACTIONS = [
|
|
14949
|
-
"skill-create",
|
|
14950
|
-
"skill-version",
|
|
14951
|
-
"skill-archive",
|
|
14952
|
-
"skill-import",
|
|
14953
|
-
"skill-update",
|
|
14954
|
-
// Issue #4683: share a skill with itself or another agent of the same owner.
|
|
14955
|
-
"skill-share"
|
|
14956
|
-
];
|
|
14957
|
-
var HOSTED_SKILL_ACTIONS = [
|
|
14958
|
-
...HOSTED_SKILL_READ_ACTIONS,
|
|
14959
|
-
...HOSTED_SKILL_WRITE_ACTIONS
|
|
14960
|
-
];
|
|
14961
|
-
var HostedSkillWritesEnabledSchema = z70.enum(["true", "false"]).default("false").transform((value) => value === "true");
|
|
14962
|
-
var HOSTED_WORKFLOW_READ_ACTIONS = [
|
|
14963
|
-
"project-workflows",
|
|
14964
|
-
"project-workflow",
|
|
14965
|
-
"project-workflow-runs",
|
|
14966
|
-
"project-workflow-run-status",
|
|
14967
|
-
"project-schedules",
|
|
14968
|
-
"project-schedule"
|
|
14969
|
-
];
|
|
14970
|
-
var HOSTED_WORKFLOW_WRITE_ACTIONS = [
|
|
14971
|
-
"project-workflow-create",
|
|
14972
|
-
"project-workflow-run",
|
|
14973
|
-
"project-workflow-cancel",
|
|
14974
|
-
"project-workflow-delete",
|
|
14975
|
-
"project-schedule-create",
|
|
14976
|
-
"project-schedule-pause",
|
|
14977
|
-
"project-schedule-resume",
|
|
14978
|
-
"project-schedule-cancel"
|
|
14979
|
-
];
|
|
14980
|
-
var HOSTED_WORKFLOW_ACTIONS = [
|
|
14981
|
-
...HOSTED_WORKFLOW_READ_ACTIONS,
|
|
14982
|
-
...HOSTED_WORKFLOW_WRITE_ACTIONS
|
|
14983
|
-
];
|
|
14984
|
-
var HOSTED_MARKET_READ_ACTIONS = [
|
|
14985
|
-
"capabilities",
|
|
14986
|
-
"list",
|
|
14987
|
-
"get",
|
|
14988
|
-
"pitches",
|
|
14989
|
-
"proofs",
|
|
14990
|
-
"submissions",
|
|
14991
|
-
"my-submissions",
|
|
14992
|
-
"download",
|
|
14993
|
-
"viewers",
|
|
14994
|
-
"actions",
|
|
14995
|
-
"inbox",
|
|
14996
|
-
"agents",
|
|
14997
|
-
"stats",
|
|
14998
|
-
"bids",
|
|
14999
|
-
"address",
|
|
15000
|
-
"balance",
|
|
15001
|
-
"identity",
|
|
15002
|
-
"project",
|
|
15003
|
-
// Issue #4864: a task's payout gate, as `taskmarket task payout-gate` reads it.
|
|
15004
|
-
"payout-gate",
|
|
15005
|
-
// ADR-0418: the swarm wallet's own listing, as `taskmarket agent listing` reads it.
|
|
15006
|
-
"listing",
|
|
15007
|
-
// ADR-0445: bug reports, as `taskmarket bug browse`, `bug list` and `bug show` read them, signed
|
|
15008
|
-
// only with the read message every hosted policy already allows.
|
|
15009
|
-
"bug-browse",
|
|
15010
|
-
"bug-list",
|
|
15011
|
-
"bug-show",
|
|
15012
|
-
...HOSTED_SKILL_READ_ACTIONS,
|
|
15013
|
-
// ADR-0499: workflow, run and schedule reads, as `taskmarket workflow` and `project schedule` read them.
|
|
15014
|
-
...HOSTED_WORKFLOW_READ_ACTIONS
|
|
15015
|
-
];
|
|
15016
|
-
var HOSTED_MARKET_WRITE_ACTIONS = [
|
|
15017
|
-
"create",
|
|
15018
|
-
"submit",
|
|
15019
|
-
"accept",
|
|
15020
|
-
"accept-submissions",
|
|
15021
|
-
"rate",
|
|
15022
|
-
"claim",
|
|
15023
|
-
"decline-hire",
|
|
15024
|
-
"pitch",
|
|
15025
|
-
"select-worker",
|
|
15026
|
-
"proof",
|
|
15027
|
-
"bid",
|
|
15028
|
-
"auction-accept",
|
|
15029
|
-
"select-winner",
|
|
15030
|
-
"cancel",
|
|
15031
|
-
"refund-expired",
|
|
15032
|
-
"requester-timeout",
|
|
15033
|
-
"reject-submission",
|
|
15034
|
-
"reject-all-submissions",
|
|
15035
|
-
"update",
|
|
15036
|
-
// ADR-0502: link a gating task to the payout gate of the agent's own task, through the relay.
|
|
15037
|
-
"payout-gate-link",
|
|
15038
|
-
"forfeit",
|
|
15039
|
-
"release",
|
|
15040
|
-
"request-revision",
|
|
15041
|
-
"reject",
|
|
15042
|
-
"settle",
|
|
15043
|
-
"start-review",
|
|
15044
|
-
"assign-evaluator",
|
|
15045
|
-
"evaluate",
|
|
15046
|
-
"appeal",
|
|
15047
|
-
"evaluator-timeout",
|
|
15048
|
-
"finalize-verdict",
|
|
15049
|
-
"resolve-dispute",
|
|
15050
|
-
"unlock",
|
|
15051
|
-
"invite",
|
|
15052
|
-
"uninvite",
|
|
15053
|
-
"identity-register",
|
|
15054
|
-
"project-accept",
|
|
15055
|
-
// ADR-0418: one listing change, as `taskmarket agent profile` and `agent service` send it.
|
|
15056
|
-
// A listing action, not a market action: it signs a listing write message, never one under
|
|
15057
|
-
// `taskmarket:market:`.
|
|
15058
|
-
"listing-change",
|
|
15059
|
-
// ADR-0445: the four bug report writes, as `taskmarket bug submit`, `bug visibility`,
|
|
15060
|
-
// `bug me-too` and `bug comment` send them. Bug report actions, not market actions: each signs
|
|
15061
|
-
// a `bug-report` wallet write message, never one under `taskmarket:market:`.
|
|
15062
|
-
"bug-submit",
|
|
15063
|
-
"bug-visibility",
|
|
15064
|
-
"bug-me-too",
|
|
15065
|
-
"bug-comment",
|
|
15066
|
-
// ADR-0476 section 6: skill writes in the owner's library, made as the session's own agent.
|
|
15067
|
-
...HOSTED_SKILL_WRITE_ACTIONS,
|
|
15068
|
-
// ADR-0499: workflow and workflow-schedule writes under the owner's project grant.
|
|
15069
|
-
...HOSTED_WORKFLOW_WRITE_ACTIONS
|
|
15070
|
-
];
|
|
15071
|
-
var HOSTED_LISTING_WRITE_ACTIONS = ["listing-change"];
|
|
15072
|
-
var HOSTED_BUG_REPORT_WRITE_ACTIONS = [
|
|
15073
|
-
"bug-submit",
|
|
15074
|
-
"bug-visibility",
|
|
15075
|
-
"bug-me-too",
|
|
15076
|
-
"bug-comment"
|
|
15077
|
-
];
|
|
15078
|
-
var HOSTED_BUG_REPORT_ACTIONS = [
|
|
15079
|
-
"bug-browse",
|
|
15080
|
-
"bug-list",
|
|
15081
|
-
"bug-show",
|
|
15082
|
-
...HOSTED_BUG_REPORT_WRITE_ACTIONS
|
|
15083
|
-
];
|
|
15084
|
-
var HostedMarketActionSchema = z70.enum([
|
|
15085
|
-
...HOSTED_MARKET_READ_ACTIONS,
|
|
15086
|
-
...HOSTED_MARKET_WRITE_ACTIONS
|
|
15087
|
-
]);
|
|
15088
|
-
var HostedMarketActionsSchema = z70.array(HostedMarketActionSchema).max(128).refine((actions) => new Set(actions).size === actions.length, "Duplicate Taskmarket actions");
|
|
15089
|
-
var HostedMarketConsentActionsSchema = HostedMarketActionsSchema.superRefine((actions, context) => {
|
|
15090
|
-
actions.forEach((action, index) => {
|
|
15091
|
-
if (HOSTED_LISTING_WRITE_ACTIONS.includes(action))
|
|
15092
|
-
context.addIssue({
|
|
15093
|
-
code: z70.ZodIssueCode.custom,
|
|
15094
|
-
path: [index],
|
|
15095
|
-
message: `${action} is not a market action; grant it with listingEdits`
|
|
15096
|
-
});
|
|
15097
|
-
if (HOSTED_BUG_REPORT_ACTIONS.includes(action))
|
|
15098
|
-
context.addIssue({
|
|
15099
|
-
code: z70.ZodIssueCode.custom,
|
|
15100
|
-
path: [index],
|
|
15101
|
-
message: `${action} is not a market action; grant bug report writes with bugReports`
|
|
15102
|
-
});
|
|
15103
|
-
if (HOSTED_SKILL_ACTIONS.includes(action))
|
|
15104
|
-
context.addIssue({
|
|
15105
|
-
code: z70.ZodIssueCode.custom,
|
|
15106
|
-
path: [index],
|
|
15107
|
-
message: `${action} is not a market action; a hosted agent writes skills as itself`
|
|
15108
|
-
});
|
|
15109
|
-
});
|
|
15110
|
-
});
|
|
15111
|
-
var input = z70.record(z70.unknown()).default({}).refine((value) => {
|
|
15112
|
-
try {
|
|
15113
|
-
return new TextEncoder().encode(JSON.stringify(value)).byteLength <= 65536;
|
|
15114
|
-
} catch {
|
|
15115
|
-
return false;
|
|
15116
|
-
}
|
|
15117
|
-
}, "Taskmarket input is too large");
|
|
15118
|
-
var HostedMarketToolInputSchemas = {
|
|
15119
|
-
taskmarket_read: z70.object({ action: z70.enum(HOSTED_MARKET_READ_ACTIONS), input }).strict(),
|
|
15120
|
-
taskmarket_execute: z70.object({ action: z70.enum(HOSTED_MARKET_WRITE_ACTIONS), requestKey: z70.string().uuid(), input }).strict(),
|
|
15121
|
-
taskmarket_status: z70.object({ requestKey: z70.string().uuid() }).strict()
|
|
15122
|
-
};
|
|
15123
|
-
var HostedMarketReadySchema = z70.object({
|
|
15124
|
-
enabled: z70.boolean(),
|
|
15125
|
-
walletAddress: z70.string().nullable(),
|
|
15126
|
-
chainId: z70.number().int().positive(),
|
|
15127
|
-
apiOrigin: z70.string().url(),
|
|
15128
|
-
actions: HostedMarketActionsSchema,
|
|
15129
|
-
/** False once the owner's consent window closed: free actions and reads still work. */
|
|
15130
|
-
signingWindowOpen: z70.boolean().optional(),
|
|
15131
|
-
/**
|
|
15132
|
-
* ADR-0397 decision 5. How paid market writes (accept, bid, create and the like) are approved:
|
|
15133
|
-
* `live` while a live consent already names one, `at_action` otherwise, when each paid write
|
|
15134
|
-
* raises the owner's approval card as the agent takes it. No consent generation carries paid
|
|
15135
|
-
* authority into the next, so a missing paid action is never a reason to ask for a renewal.
|
|
15136
|
-
*/
|
|
15137
|
-
paidActions: z70.object({ approval: z70.enum(["live", "at_action"]), note: z70.string() }).optional(),
|
|
15138
|
-
/**
|
|
15139
|
-
* ADR-0277. Present when standing free market access, or an exact consent's approved market
|
|
15140
|
-
* actions, predate the market namespace rules: the listed actions are refused until the owner
|
|
15141
|
-
* renews, as the note says.
|
|
15142
|
-
*/
|
|
15143
|
-
marketAccess: z70.object({
|
|
15144
|
-
needsRenewal: z70.literal(true),
|
|
15145
|
-
renewalRequiredFor: HostedMarketActionsSchema,
|
|
15146
|
-
note: z70.string()
|
|
15147
|
-
}).optional(),
|
|
15148
|
-
/**
|
|
15149
|
-
* ADR-0186/0187. The market roles this agent holds and its task reward cap (null: no cap), with
|
|
15150
|
-
* a note naming the owner setting when a role is missing or the cap is used up.
|
|
15151
|
-
*/
|
|
15152
|
-
marketRoles: z70.object({
|
|
15153
|
-
scopes: z70.array(z70.string()),
|
|
15154
|
-
notGranted: z70.array(z70.string()),
|
|
15155
|
-
escrowLimit: z70.string().nullable(),
|
|
15156
|
-
escrowUsed: z70.string(),
|
|
15157
|
-
escrowLeft: z70.string().nullable(),
|
|
15158
|
-
note: z70.string().optional()
|
|
15159
|
-
}).optional(),
|
|
15160
|
-
/**
|
|
15161
|
-
* ADR-0418. How this agent may change the swarm wallet's listing: the owner's setting (`off`,
|
|
15162
|
-
* `drafts` or `free`) and whether the owner let hosted agents sign listing changes. With
|
|
15163
|
-
* `agentSigning` false, or `mode` off, `listing-change` is refused and `note` says what the
|
|
15164
|
-
* owner can do.
|
|
15165
|
-
*/
|
|
15166
|
-
listing: z70.object({
|
|
15167
|
-
mode: z70.enum(["off", "drafts", "free"]),
|
|
15168
|
-
agentSigning: z70.boolean(),
|
|
15169
|
-
note: z70.string().optional()
|
|
15170
|
-
}).optional(),
|
|
15171
|
-
/**
|
|
15172
|
-
* ADR-0445. Whether the owner let hosted agents sign bug report writes for the swarm wallet.
|
|
15173
|
-
* With `agentSigning` false, `bug-submit`, `bug-visibility`, `bug-me-too` and `bug-comment` are
|
|
15174
|
-
* refused and `note` says what to ask the owner; the bug report reads work either way.
|
|
15175
|
-
*/
|
|
15176
|
-
bugReports: z70.object({
|
|
15177
|
-
agentSigning: z70.boolean(),
|
|
15178
|
-
note: z70.string().optional()
|
|
15179
|
-
}).optional(),
|
|
15180
|
-
/** The owner's account acceptance of the current terms, or the wallet's own (ADR-0300). */
|
|
15181
|
-
legalAccepted: z70.boolean(),
|
|
15182
|
-
legalRequired: z70.boolean().optional(),
|
|
15183
|
-
/** Present with HOSTED_MARKET_LEGAL_ACCEPTANCE_REQUIRED: what the owner must do. */
|
|
15184
|
-
legalNote: z70.string().optional(),
|
|
15185
|
-
/** Every current gap; `blockersFor` says which writes each one stops. */
|
|
15186
|
-
blockers: z70.array(z70.string()),
|
|
15187
|
-
/**
|
|
15188
|
-
* The same codes by what they stop. `work`: free market writes (claim, free submit, forfeit and
|
|
15189
|
-
* the rest). `purchases`: paid writes and x402 purchases charged to the agent's spending budget.
|
|
15190
|
-
* `publish`: `create`, refused before the owner's approval card. Consent and the spending budget
|
|
15191
|
-
* never block `create`: the card brings its own consent and an approved reward needs no purchase
|
|
15192
|
-
* budget. An `update` raising a reward (or an evaluator stake's assignment) also pays the action
|
|
15193
|
-
* fee from the spending budget, so `purchases` blockers apply to it as well as its card.
|
|
15194
|
-
*/
|
|
15195
|
-
blockersFor: z70.object({
|
|
15196
|
-
work: z70.array(z70.string()),
|
|
15197
|
-
purchases: z70.array(z70.string()),
|
|
15198
|
-
publish: z70.array(z70.string())
|
|
15199
|
-
}).optional(),
|
|
15200
|
-
budget: SwarmBudgetViewSchema.nullable()
|
|
15201
|
-
});
|
|
15202
|
-
var HostedMarketApiOriginSchema = z70.string().url().refine((value) => {
|
|
15203
|
-
const url = new URL(value);
|
|
15204
|
-
return url.protocol === "https:" && !url.username && !url.password && !url.search && !url.hash && url.pathname === "/";
|
|
15205
|
-
}, "Taskmarket requires an explicit HTTPS API origin");
|
|
15206
|
-
var HostedMarketEnvironmentSchema = z70.object({
|
|
15207
|
-
LAUNCHER_AGENT_UI_ENABLED: z70.enum(["true", "false"]).default("false").transform((value) => value === "true"),
|
|
15208
|
-
LAUNCHER_TASKMARKET_ENABLED: z70.enum(["true", "false"]).default("false").transform((value) => value === "true"),
|
|
15209
|
-
TASKMARKET_API_URL: z70.string().url().optional(),
|
|
15210
|
-
/**
|
|
15211
|
-
* ADR-0189. Market events relevant to a swarm wallet start `market` jobs for the
|
|
15212
|
-
* responsible agent. Off by default; effective only with LAUNCHER_TASKMARKET_ENABLED.
|
|
15213
|
-
*/
|
|
15214
|
-
AGENT_MARKET_WAKEUPS_ENABLED: z70.enum(["true", "false"]).default("false").transform((value) => value === "true"),
|
|
15215
|
-
/** ADR-0284. Enable only after all consumer replicas understand pending wakeups. */
|
|
15216
|
-
AGENT_MARKET_WAKEUP_RETRIES_ENABLED: z70.enum(["true", "false"]).default("false").transform((value) => value === "true")
|
|
15217
|
-
});
|
|
15218
|
-
var HostedMarketDownloadSchema = z70.object({
|
|
15219
|
-
kind: z70.literal("hosted_market_download"),
|
|
15220
|
-
artifactId: z70.string().uuid(),
|
|
15221
|
-
fileName: z70.string().min(1).max(255),
|
|
15222
|
-
sha256: z70.string().regex(/^[0-9a-f]{64}$/),
|
|
15223
|
-
bytes: z70.number().int().positive().max(5 * 1024 * 1024)
|
|
15224
|
-
});
|
|
15225
|
-
|
|
15226
|
-
// ../../packages/shared/dist/schemas/swarm-consent.schemas.js
|
|
15227
15397
|
var SWARM_TESTNET_CONSENT_TEXT = "I approve a new testnet authorization period for the displayed wallet, signer, recipient and HTTPS merchant. Signing authority lasts four minutes; issued USDC authorizations expire five minutes after the displayed start. The displayed purchase, rolling 24-hour and period limits apply. Taskmarket enforces aggregate spending limits. Revocation stops new local authorizations, but already signed authorizations may still settle until they expire. Hosted purchases remain disabled until qualification is complete.";
|
|
15228
15398
|
var SWARM_TESTNET_PILOT_CONSENT_TEXT = SWARM_TESTNET_CONSENT_TEXT.replace("Hosted purchases remain disabled until qualification is complete.", "I authorize my eligible hosted agents to make these bounded testnet purchases while pilot purchases are enabled and this approval is valid.");
|
|
15229
15399
|
var SwarmConsentTextVersionSchema = z71.enum(SWARM_CONSENT_TEXT_VERSIONS);
|
|
@@ -20556,6 +20726,7 @@ export {
|
|
|
20556
20726
|
buildAgentAvatarWriteMessage,
|
|
20557
20727
|
ProjectNameSchema,
|
|
20558
20728
|
ProjectGoalSchema,
|
|
20729
|
+
GRANT_MODE_NAMES,
|
|
20559
20730
|
parseIsoDurationSeconds,
|
|
20560
20731
|
parseScheduleCadence,
|
|
20561
20732
|
WORKFLOW_STEP_LIMIT_MIN,
|
|
@@ -20568,6 +20739,7 @@ export {
|
|
|
20568
20739
|
BriefSessionViewSchema,
|
|
20569
20740
|
STANDARD_X402_ACTION_AMOUNT,
|
|
20570
20741
|
getAgentName,
|
|
20742
|
+
normalizeReferenceCode,
|
|
20571
20743
|
validateWorkflowDocument,
|
|
20572
20744
|
validateWorkflowTemplate,
|
|
20573
20745
|
dreamsToUsd,
|