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