@lucid-agents/taskmarket 1.18.0 → 1.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-compatibility.json +1 -1
- package/dist/{channels-544VRSKF.js → channels-KCDZ5REF.js} +3 -3
- package/dist/{chunk-L6ZVRENW.js → chunk-3FF6JAMK.js} +3 -3
- package/dist/{chunk-W7CXEYST.js → chunk-3LNZ766H.js} +2 -2
- package/dist/{chunk-S4A6V3J3.js → chunk-5VMWXDNO.js} +1 -1
- package/dist/{chunk-JJUF3KZY.js → chunk-HEGWADBV.js} +3 -3
- package/dist/{chunk-MO5KMUTL.js → chunk-LEVAZYR5.js} +2 -2
- package/dist/{chunk-64HQ7ZF2.js → chunk-ONYTKAHC.js} +1 -1
- package/dist/{chunk-2QJMUHDT.js → chunk-RHUDL5WA.js} +4 -4
- package/dist/{chunk-ESPAXW2P.js → chunk-RQTJZYFV.js} +1 -1
- package/dist/{chunk-75LS6XS6.js → chunk-YB2B5DPR.js} +1687 -1669
- package/dist/{doctor-5FUGI42V.js → doctor-TB3KKAZB.js} +7 -7
- package/dist/index.js +13 -12
- package/dist/{launch-C5HUFUU2.js → launch-ZV6OLBFM.js} +8 -8
- package/dist/{reconcile-Q7XFHDQQ.js → reconcile-UXL65RRT.js} +3 -3
- package/dist/{status-SDLSTJIA.js → status-FHZ3UGEB.js} +7 -7
- package/dist/{sync-pull-TKM4EDGH.js → sync-pull-YECZ4PJA.js} +3 -3
- package/package.json +1 -1
|
@@ -5730,7 +5730,7 @@ function formatPaymentAmount(value, chainId, options = { trimTrailingZeros: true
|
|
|
5730
5730
|
}
|
|
5731
5731
|
|
|
5732
5732
|
// ../../packages/shared/dist/schemas/launcher.schemas.js
|
|
5733
|
-
import { z as
|
|
5733
|
+
import { z as z44 } from "zod";
|
|
5734
5734
|
|
|
5735
5735
|
// ../../packages/shared/dist/schemas/agent-platform.schemas.js
|
|
5736
5736
|
import { z as z42 } from "zod";
|
|
@@ -5844,133 +5844,549 @@ var AgentDelegationSchema = z42.object({
|
|
|
5844
5844
|
waiting: z42.boolean()
|
|
5845
5845
|
});
|
|
5846
5846
|
|
|
5847
|
+
// ../../packages/shared/dist/schemas/memory.schemas.js
|
|
5848
|
+
import { z as z43 } from "zod";
|
|
5849
|
+
var MEMORY_DOCUMENT_MAX_BYTES = 65536;
|
|
5850
|
+
var MEMORY_ARCHIVE_RETENTION_DAYS = 30;
|
|
5851
|
+
var MEMORY_PATH_MAX_LENGTH = 200;
|
|
5852
|
+
var MEMORY_PATH_MAX_DEPTH = 6;
|
|
5853
|
+
var MEMORY_PATH_SEGMENT_MAX_BYTES = 100;
|
|
5854
|
+
var MEMORY_SEARCH_QUERY_MAX_LENGTH = 200;
|
|
5855
|
+
var MEMORY_SEARCH_MAX_RESULTS = 20;
|
|
5856
|
+
var MEMORY_HISTORY_MAX_RESULTS = 50;
|
|
5857
|
+
var MEMORY_REASON_MAX_LENGTH = 500;
|
|
5858
|
+
var MemoryScopeSchema = z43.enum(["agent", "swarm"]);
|
|
5859
|
+
var MemoryTrustSchema = z43.enum(["owner", "agent", "tainted"]);
|
|
5860
|
+
var MemoryRevisionStatusSchema = z43.enum(["applied", "proposed", "approved", "rejected"]);
|
|
5861
|
+
var MemoryActorSchema = z43.enum(["owner", "agent"]);
|
|
5862
|
+
var MemoryOperationSchema = z43.enum([
|
|
5863
|
+
"create",
|
|
5864
|
+
"replace",
|
|
5865
|
+
"append",
|
|
5866
|
+
"edit",
|
|
5867
|
+
"archive",
|
|
5868
|
+
"rollback",
|
|
5869
|
+
"restore",
|
|
5870
|
+
"promote"
|
|
5871
|
+
]);
|
|
5872
|
+
var MemoryWriteModeSchema = z43.enum(["replace", "append"]);
|
|
5873
|
+
var MemoryWriteOutcomeSchema = z43.enum(["applied", "proposed"]);
|
|
5874
|
+
var LauncherJobSourceSchema = z43.enum([
|
|
5875
|
+
"dashboard",
|
|
5876
|
+
"imessage",
|
|
5877
|
+
"peer",
|
|
5878
|
+
"schedule",
|
|
5879
|
+
"wait",
|
|
5880
|
+
"inbox",
|
|
5881
|
+
// Implements: ADR-0182. A backend-owned job that executes an owner-approved purchase; it runs
|
|
5882
|
+
// no model turn.
|
|
5883
|
+
"purchase",
|
|
5884
|
+
// ADR-0189. A market event relevant to the swarm wallet woke the responsible agent.
|
|
5885
|
+
"market"
|
|
5886
|
+
]);
|
|
5887
|
+
var MEMORY_CORE_TEMPLATE_SECTIONS = [
|
|
5888
|
+
"Owner",
|
|
5889
|
+
"Preferences",
|
|
5890
|
+
"Commitments",
|
|
5891
|
+
"Open threads"
|
|
5892
|
+
];
|
|
5893
|
+
var MEMORY_CORE_TEMPLATE = MEMORY_CORE_TEMPLATE_SECTIONS.map((section2) => `## ${section2}
|
|
5894
|
+
`).join("\n");
|
|
5895
|
+
var MemoryCoreTemplateEnabledSchema = z43.enum(["true", "false"]).default("false").transform((value) => value === "true");
|
|
5896
|
+
function utf8ByteLength(value) {
|
|
5897
|
+
let bytes2 = 0;
|
|
5898
|
+
for (let i = 0; i < value.length; i++) {
|
|
5899
|
+
const code = value.charCodeAt(i);
|
|
5900
|
+
if (code < 128)
|
|
5901
|
+
bytes2 += 1;
|
|
5902
|
+
else if (code < 2048)
|
|
5903
|
+
bytes2 += 2;
|
|
5904
|
+
else if (code >= 55296 && code <= 56319 && i + 1 < value.length && (value.charCodeAt(i + 1) & 64512) === 56320) {
|
|
5905
|
+
bytes2 += 4;
|
|
5906
|
+
i++;
|
|
5907
|
+
} else
|
|
5908
|
+
bytes2 += 3;
|
|
5909
|
+
}
|
|
5910
|
+
return bytes2;
|
|
5911
|
+
}
|
|
5912
|
+
var SEGMENT = /^[\p{L}\p{N}][\p{L}\p{N} ._-]*$/u;
|
|
5913
|
+
var forbiddenPathCharacter = (value) => [...value].some((c) => {
|
|
5914
|
+
const code = c.charCodeAt(0);
|
|
5915
|
+
return code < 32 || code >= 127 && code <= 159 || c === "\\";
|
|
5916
|
+
});
|
|
5917
|
+
var memoryContentIsText = (value) => ![...value].some((c) => {
|
|
5918
|
+
const code = c.charCodeAt(0);
|
|
5919
|
+
return code < 32 && code !== 9 && code !== 10 && code !== 13 || code === 127;
|
|
5920
|
+
});
|
|
5921
|
+
function normalizeMemoryPath(raw) {
|
|
5922
|
+
const value = raw.normalize("NFC").trim();
|
|
5923
|
+
if (!value)
|
|
5924
|
+
return { ok: false, reason: "Path is empty" };
|
|
5925
|
+
if (forbiddenPathCharacter(value))
|
|
5926
|
+
return { ok: false, reason: "Path contains control characters or backslashes" };
|
|
5927
|
+
if (value.startsWith("/") || value.startsWith("~"))
|
|
5928
|
+
return { ok: false, reason: "Path must be relative to its scope" };
|
|
5929
|
+
const segments = value.split("/").filter((part) => part !== "" && part !== ".");
|
|
5930
|
+
if (segments.some((part) => part === ".."))
|
|
5931
|
+
return { ok: false, reason: 'Path must not contain ".."' };
|
|
5932
|
+
if (!segments.length)
|
|
5933
|
+
return { ok: false, reason: "Path is empty" };
|
|
5934
|
+
if (segments.length > MEMORY_PATH_MAX_DEPTH)
|
|
5935
|
+
return { ok: false, reason: `Path is deeper than ${MEMORY_PATH_MAX_DEPTH} segments` };
|
|
5936
|
+
for (const part of segments) {
|
|
5937
|
+
if (!SEGMENT.test(part) || part.endsWith(" ") || part.endsWith("."))
|
|
5938
|
+
return {
|
|
5939
|
+
ok: false,
|
|
5940
|
+
reason: 'Path segments use letters, digits, spaces, ".", "-" and "_" and start with a letter or digit'
|
|
5941
|
+
};
|
|
5942
|
+
if (utf8ByteLength(part) > MEMORY_PATH_SEGMENT_MAX_BYTES)
|
|
5943
|
+
return { ok: false, reason: "Path segment is too long" };
|
|
5944
|
+
}
|
|
5945
|
+
const path3 = segments.join("/");
|
|
5946
|
+
if (path3.length > MEMORY_PATH_MAX_LENGTH)
|
|
5947
|
+
return { ok: false, reason: "Path is too long" };
|
|
5948
|
+
if (!path3.endsWith(".md"))
|
|
5949
|
+
return { ok: false, reason: "Memory documents are markdown (.md)" };
|
|
5950
|
+
return { ok: true, path: path3 };
|
|
5951
|
+
}
|
|
5952
|
+
var MemoryPathSchema = z43.string().max(MEMORY_PATH_MAX_LENGTH * 2).transform((raw, ctx) => {
|
|
5953
|
+
const result = normalizeMemoryPath(raw);
|
|
5954
|
+
if (!result.ok) {
|
|
5955
|
+
ctx.addIssue({ code: "custom", message: result.reason });
|
|
5956
|
+
return z43.NEVER;
|
|
5957
|
+
}
|
|
5958
|
+
return result.path;
|
|
5959
|
+
});
|
|
5960
|
+
var MemoryContentSchema = z43.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`);
|
|
5961
|
+
var ReasonSchema = z43.string().trim().max(MEMORY_REASON_MAX_LENGTH).optional();
|
|
5962
|
+
var VersionSchema = z43.number().int().min(0).max(2147483647);
|
|
5963
|
+
var AgentIdSchema = z43.string().uuid();
|
|
5964
|
+
var target = {
|
|
5965
|
+
agentId: AgentIdSchema.optional(),
|
|
5966
|
+
scope: MemoryScopeSchema,
|
|
5967
|
+
path: MemoryPathSchema
|
|
5968
|
+
};
|
|
5969
|
+
var agentScopeNeedsAgent = (value) => value.scope !== "agent" || Boolean(value.agentId);
|
|
5970
|
+
var agentScopeMessage = { message: "agentId is required for the agent scope", path: ["agentId"] };
|
|
5971
|
+
var MemoryTargetInputSchema = z43.object(target).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
5972
|
+
var MemoryTreeInputSchema = z43.object({ agentId: AgentIdSchema.optional(), scope: MemoryScopeSchema.optional() }).strict().refine((value) => value.scope !== "agent" || Boolean(value.agentId), agentScopeMessage);
|
|
5973
|
+
var MemoryWriteInputSchema = z43.object({
|
|
5974
|
+
...target,
|
|
5975
|
+
content: MemoryContentSchema,
|
|
5976
|
+
mode: MemoryWriteModeSchema.default("replace"),
|
|
5977
|
+
expectedVersion: VersionSchema.optional(),
|
|
5978
|
+
reason: ReasonSchema,
|
|
5979
|
+
/**
|
|
5980
|
+
* The owner was warned that the content looks like a secret (#713) and saves it anyway.
|
|
5981
|
+
* Without it, a write that adds a seed phrase, private key or credential is refused.
|
|
5982
|
+
*/
|
|
5983
|
+
confirmSecrets: z43.boolean().optional()
|
|
5984
|
+
}).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
5985
|
+
var MemoryArchiveInputSchema = z43.object({ ...target, expectedVersion: VersionSchema.optional(), reason: ReasonSchema }).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
5986
|
+
var MemoryHistoryInputSchema = z43.object({
|
|
5987
|
+
...target,
|
|
5988
|
+
limit: z43.number().int().min(1).max(MEMORY_HISTORY_MAX_RESULTS).default(20),
|
|
5989
|
+
beforeVersion: VersionSchema.optional()
|
|
5990
|
+
}).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
5991
|
+
var MemoryRollbackInputSchema = z43.object({
|
|
5992
|
+
...target,
|
|
5993
|
+
version: VersionSchema.min(1),
|
|
5994
|
+
expectedVersion: VersionSchema.optional(),
|
|
5995
|
+
reason: ReasonSchema
|
|
5996
|
+
}).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
5997
|
+
var MemorySearchInputSchema = z43.object({
|
|
5998
|
+
agentId: AgentIdSchema.optional(),
|
|
5999
|
+
scope: MemoryScopeSchema.optional(),
|
|
6000
|
+
query: z43.string().trim().min(1).max(MEMORY_SEARCH_QUERY_MAX_LENGTH),
|
|
6001
|
+
limit: z43.number().int().min(1).max(MEMORY_SEARCH_MAX_RESULTS).default(10),
|
|
6002
|
+
/** Also search the agent's own past jobs (SM-61); needs `agentId`. */
|
|
6003
|
+
includeHistory: z43.boolean().optional()
|
|
6004
|
+
}).strict().refine((value) => value.scope !== "agent" || Boolean(value.agentId), agentScopeMessage);
|
|
6005
|
+
var MemoryForgetInputSchema = z43.object({ agentId: AgentIdSchema.optional(), scope: MemoryScopeSchema, reason: ReasonSchema }).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
6006
|
+
var MemoryPromoteInputSchema = z43.object({
|
|
6007
|
+
agentId: AgentIdSchema,
|
|
6008
|
+
scope: MemoryScopeSchema.default("agent"),
|
|
6009
|
+
path: MemoryPathSchema,
|
|
6010
|
+
targetPath: MemoryPathSchema.optional(),
|
|
6011
|
+
expectedVersion: VersionSchema.optional(),
|
|
6012
|
+
reason: ReasonSchema
|
|
6013
|
+
}).strict();
|
|
6014
|
+
var MemoryDocumentSummarySchema = z43.object({
|
|
6015
|
+
documentId: z43.string().uuid(),
|
|
6016
|
+
scope: MemoryScopeSchema,
|
|
6017
|
+
path: z43.string(),
|
|
6018
|
+
version: z43.number().int(),
|
|
6019
|
+
bytes: z43.number().int(),
|
|
6020
|
+
pinned: z43.boolean(),
|
|
6021
|
+
readOnly: z43.boolean(),
|
|
6022
|
+
updatedAt: z43.string()
|
|
6023
|
+
});
|
|
6024
|
+
var MemoryTreeSchema = z43.object({
|
|
6025
|
+
documents: z43.array(MemoryDocumentSummarySchema),
|
|
6026
|
+
limits: z43.object({
|
|
6027
|
+
documentBytes: z43.number().int(),
|
|
6028
|
+
scopeDocuments: z43.number().int(),
|
|
6029
|
+
pinnedRenderBytes: z43.number().int()
|
|
6030
|
+
})
|
|
6031
|
+
});
|
|
6032
|
+
var MemoryDocumentSchema = MemoryDocumentSummarySchema.extend({
|
|
6033
|
+
content: z43.string(),
|
|
6034
|
+
createdAt: z43.string(),
|
|
6035
|
+
archivedAt: z43.string().nullable(),
|
|
6036
|
+
/** Actor and trust of the revision that produced the current content. */
|
|
6037
|
+
lastActor: MemoryActorSchema.nullable(),
|
|
6038
|
+
lastTrust: MemoryTrustSchema.nullable()
|
|
6039
|
+
});
|
|
6040
|
+
var MemoryRevisionSchema = z43.object({
|
|
6041
|
+
id: z43.string().uuid(),
|
|
6042
|
+
/** Null only for a proposal to create a document that does not exist (yet). */
|
|
6043
|
+
documentId: z43.string().uuid().nullable(),
|
|
6044
|
+
version: z43.number().int(),
|
|
6045
|
+
content: z43.string(),
|
|
6046
|
+
operation: MemoryOperationSchema,
|
|
6047
|
+
status: MemoryRevisionStatusSchema,
|
|
6048
|
+
actor: MemoryActorSchema,
|
|
6049
|
+
actorAgentId: z43.string().nullable(),
|
|
6050
|
+
jobId: z43.string().nullable(),
|
|
6051
|
+
sessionId: z43.string().nullable(),
|
|
6052
|
+
trust: MemoryTrustSchema,
|
|
6053
|
+
/** Why an agent turn had this trust, e.g. the tool that tainted it (SM-51). */
|
|
6054
|
+
trustReason: z43.string().nullable(),
|
|
6055
|
+
reason: z43.string().nullable(),
|
|
6056
|
+
sourceDocumentId: z43.string().uuid().nullable(),
|
|
6057
|
+
sourceVersion: z43.number().int().nullable(),
|
|
6058
|
+
createdAt: z43.string(),
|
|
6059
|
+
decidedAt: z43.string().nullable()
|
|
6060
|
+
});
|
|
6061
|
+
var MemoryHistorySchema = z43.object({
|
|
6062
|
+
document: MemoryDocumentSummarySchema.extend({ archivedAt: z43.string().nullable() }),
|
|
6063
|
+
revisions: z43.array(MemoryRevisionSchema)
|
|
6064
|
+
});
|
|
6065
|
+
var MemoryMutationResultSchema = z43.object({
|
|
6066
|
+
outcome: z43.literal("applied"),
|
|
6067
|
+
document: MemoryDocumentSchema,
|
|
6068
|
+
revision: MemoryRevisionSchema
|
|
6069
|
+
});
|
|
6070
|
+
var MemoryProposedResultSchema = z43.object({
|
|
6071
|
+
outcome: z43.literal("proposed"),
|
|
6072
|
+
scope: MemoryScopeSchema,
|
|
6073
|
+
path: z43.string(),
|
|
6074
|
+
/** The version the proposal was made against; 0 = the document does not exist. */
|
|
6075
|
+
baseVersion: z43.number().int(),
|
|
6076
|
+
document: MemoryDocumentSchema.nullable(),
|
|
6077
|
+
revision: MemoryRevisionSchema
|
|
6078
|
+
});
|
|
6079
|
+
var MemoryHistoryHitSchema = z43.object({
|
|
6080
|
+
jobId: z43.string(),
|
|
6081
|
+
source: LauncherJobSourceSchema.nullable(),
|
|
6082
|
+
status: z43.string(),
|
|
6083
|
+
/** Trust of the job the text came from (its source, the tools its run called, tainted reads). */
|
|
6084
|
+
trust: MemoryTrustSchema,
|
|
6085
|
+
snippet: z43.string(),
|
|
6086
|
+
score: z43.number(),
|
|
6087
|
+
createdAt: z43.string(),
|
|
6088
|
+
finishedAt: z43.string().nullable()
|
|
6089
|
+
});
|
|
6090
|
+
var MemorySearchResultSchema = z43.object({
|
|
6091
|
+
results: z43.array(z43.object({
|
|
6092
|
+
documentId: z43.string().uuid(),
|
|
6093
|
+
scope: MemoryScopeSchema,
|
|
6094
|
+
path: z43.string(),
|
|
6095
|
+
version: z43.number().int(),
|
|
6096
|
+
/** When the document last changed. */
|
|
6097
|
+
updatedAt: z43.string(),
|
|
6098
|
+
snippet: z43.string(),
|
|
6099
|
+
score: z43.number(),
|
|
6100
|
+
/** Trust of the revision that produced the current content. */
|
|
6101
|
+
trust: MemoryTrustSchema.nullable()
|
|
6102
|
+
})),
|
|
6103
|
+
/** Present only when history was requested. */
|
|
6104
|
+
history: z43.array(MemoryHistoryHitSchema).optional()
|
|
6105
|
+
});
|
|
6106
|
+
var MemoryForgetResultSchema = z43.object({ archived: z43.number().int() });
|
|
6107
|
+
var MemoryProposalsInputSchema = z43.object({ agentId: AgentIdSchema.optional(), scope: MemoryScopeSchema.optional() }).strict().refine((value) => value.scope !== "agent" || Boolean(value.agentId), agentScopeMessage);
|
|
6108
|
+
var MemoryProposalDecisionInputSchema = z43.object({ proposalId: z43.string().uuid() }).strict();
|
|
6109
|
+
var MemoryProposalSchema = z43.object({
|
|
6110
|
+
id: z43.string().uuid(),
|
|
6111
|
+
scope: MemoryScopeSchema,
|
|
6112
|
+
/** The private scope's agent; null for the swarm scope. */
|
|
6113
|
+
agentId: z43.string().nullable(),
|
|
6114
|
+
path: z43.string(),
|
|
6115
|
+
documentId: z43.string().uuid().nullable(),
|
|
6116
|
+
operation: MemoryOperationSchema,
|
|
6117
|
+
/** The full proposed content (for `archive`, the content that would be archived). */
|
|
6118
|
+
content: z43.string(),
|
|
6119
|
+
/** The document version the proposal was made against; 0 = the document did not exist. */
|
|
6120
|
+
baseVersion: z43.number().int(),
|
|
6121
|
+
/** The live document now, to diff against; null when there is none. */
|
|
6122
|
+
current: z43.object({
|
|
6123
|
+
version: z43.number().int(),
|
|
6124
|
+
content: z43.string(),
|
|
6125
|
+
lastTrust: MemoryTrustSchema.nullable()
|
|
6126
|
+
}).nullable(),
|
|
6127
|
+
/** The document changed since the proposal: approving it would conflict. */
|
|
6128
|
+
stale: z43.boolean(),
|
|
6129
|
+
actor: MemoryActorSchema,
|
|
6130
|
+
actorAgentId: z43.string().nullable(),
|
|
6131
|
+
trust: MemoryTrustSchema,
|
|
6132
|
+
trustReason: z43.string().nullable(),
|
|
6133
|
+
reason: z43.string().nullable(),
|
|
6134
|
+
sessionId: z43.string().nullable(),
|
|
6135
|
+
job: z43.object({
|
|
6136
|
+
id: z43.string(),
|
|
6137
|
+
/** The agent that ran the job: the proposer, or its creator for a seeded instructions.md. */
|
|
6138
|
+
agentId: z43.string(),
|
|
6139
|
+
source: LauncherJobSourceSchema.nullable(),
|
|
6140
|
+
prompt: z43.string(),
|
|
6141
|
+
createdAt: z43.string()
|
|
6142
|
+
}).nullable(),
|
|
6143
|
+
createdAt: z43.string(),
|
|
6144
|
+
/**
|
|
6145
|
+
* When the retention purge removes the proposal undecided, or null when it never does. Only
|
|
6146
|
+
* proposals with no live document to wait on expire: one to create a document (the archive
|
|
6147
|
+
* window after it was made) and one on a forgotten document (purged with that document).
|
|
6148
|
+
*/
|
|
6149
|
+
expiresAt: z43.string().nullable(),
|
|
6150
|
+
/** `expiresAt` is within MEMORY_PROPOSAL_EXPIRY_WARNING_DAYS. */
|
|
6151
|
+
expiresSoon: z43.boolean()
|
|
6152
|
+
});
|
|
6153
|
+
var MemoryProposalListSchema = z43.object({ proposals: z43.array(MemoryProposalSchema) });
|
|
6154
|
+
var MemoryProposalSummaryInputSchema = z43.object({}).strict();
|
|
6155
|
+
var MemoryProposalCountSchema = z43.object({
|
|
6156
|
+
pending: z43.number().int(),
|
|
6157
|
+
/** Pending proposals flagged `expiresSoon`. */
|
|
6158
|
+
expiringSoon: z43.number().int()
|
|
6159
|
+
});
|
|
6160
|
+
var MemoryProposalSummarySchema = MemoryProposalCountSchema.extend({
|
|
6161
|
+
/** Proposals to shared memory: every agent's Memory tab lists them. */
|
|
6162
|
+
swarm: MemoryProposalCountSchema,
|
|
6163
|
+
/**
|
|
6164
|
+
* Proposals to each agent's private memory, for agents that have any. An agent's Memory tab
|
|
6165
|
+
* lists its own and the shared ones.
|
|
6166
|
+
*/
|
|
6167
|
+
agents: z43.array(MemoryProposalCountSchema.extend({ agentId: z43.string() }))
|
|
6168
|
+
});
|
|
6169
|
+
var MemoryProposalRejectionSchema = z43.object({ revision: MemoryRevisionSchema });
|
|
6170
|
+
var MemoryArchivedInputSchema = z43.object({ agentId: AgentIdSchema.optional(), scope: MemoryScopeSchema }).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
6171
|
+
var MemoryArchivedDocumentSchema = z43.object({
|
|
6172
|
+
documentId: z43.string().uuid(),
|
|
6173
|
+
scope: MemoryScopeSchema,
|
|
6174
|
+
path: z43.string(),
|
|
6175
|
+
/** The archive revision's version; restoring rolls back to it (its content is the last text). */
|
|
6176
|
+
version: z43.number().int(),
|
|
6177
|
+
bytes: z43.number().int(),
|
|
6178
|
+
pinned: z43.boolean(),
|
|
6179
|
+
archivedAt: z43.string(),
|
|
6180
|
+
/** When the hard purge removes it for good. */
|
|
6181
|
+
purgeAt: z43.string()
|
|
6182
|
+
});
|
|
6183
|
+
var MemoryArchivedListSchema = z43.object({
|
|
6184
|
+
documents: z43.array(MemoryArchivedDocumentSchema)
|
|
6185
|
+
});
|
|
6186
|
+
var MemoryExportInputSchema = z43.object({ cursor: z43.string().min(1).max(512).optional() }).strict();
|
|
6187
|
+
var MemoryExportDocumentSchema = z43.object({
|
|
6188
|
+
documentId: z43.string().uuid(),
|
|
6189
|
+
scope: MemoryScopeSchema,
|
|
6190
|
+
/** The private scope's agent; null for shared memory. */
|
|
6191
|
+
agentId: z43.string().nullable(),
|
|
6192
|
+
path: z43.string(),
|
|
6193
|
+
/** `live` is what agents read now; `forgotten` is archived and purged at `purgeAt`. */
|
|
6194
|
+
status: z43.enum(["live", "forgotten"]),
|
|
6195
|
+
pinned: z43.boolean(),
|
|
6196
|
+
version: z43.number().int(),
|
|
6197
|
+
bytes: z43.number().int(),
|
|
6198
|
+
/** The current text, or the last text of a forgotten document. */
|
|
6199
|
+
content: z43.string(),
|
|
6200
|
+
createdAt: z43.string(),
|
|
6201
|
+
updatedAt: z43.string(),
|
|
6202
|
+
archivedAt: z43.string().nullable(),
|
|
6203
|
+
purgeAt: z43.string().nullable()
|
|
6204
|
+
});
|
|
6205
|
+
var MemoryExportRevisionSchema = MemoryRevisionSchema.extend({
|
|
6206
|
+
scope: MemoryScopeSchema,
|
|
6207
|
+
agentId: z43.string().nullable(),
|
|
6208
|
+
path: z43.string()
|
|
6209
|
+
});
|
|
6210
|
+
var MemoryExportPageSchema = z43.object({
|
|
6211
|
+
/** The owner's agents, to name each private scope. */
|
|
6212
|
+
agents: z43.array(z43.object({ agentId: z43.string(), name: z43.string() })),
|
|
6213
|
+
/** Documents first seen on this page; their revisions may continue on later pages. */
|
|
6214
|
+
documents: z43.array(MemoryExportDocumentSchema),
|
|
6215
|
+
revisions: z43.array(MemoryExportRevisionSchema),
|
|
6216
|
+
nextCursor: z43.string().nullable()
|
|
6217
|
+
});
|
|
6218
|
+
var ToolPathSchema = z43.string().min(1).max(MEMORY_PATH_MAX_LENGTH * 2);
|
|
6219
|
+
var ToolReasonSchema = z43.string().trim().min(1).max(MEMORY_REASON_MAX_LENGTH);
|
|
6220
|
+
var MemoryToolInputSchemas = {
|
|
6221
|
+
memory_view: z43.object({
|
|
6222
|
+
scope: MemoryScopeSchema.optional(),
|
|
6223
|
+
path: ToolPathSchema.optional(),
|
|
6224
|
+
offset: z43.number().int().min(0).max(MEMORY_DOCUMENT_MAX_BYTES).optional()
|
|
6225
|
+
}).strict(),
|
|
6226
|
+
memory_search: z43.object({
|
|
6227
|
+
query: z43.string().trim().min(1).max(MEMORY_SEARCH_QUERY_MAX_LENGTH),
|
|
6228
|
+
scope: MemoryScopeSchema.optional(),
|
|
6229
|
+
limit: z43.number().int().min(1).max(MEMORY_SEARCH_MAX_RESULTS).optional(),
|
|
6230
|
+
/** Also search this agent's own past jobs (SM-61). */
|
|
6231
|
+
include_history: z43.boolean().optional()
|
|
6232
|
+
}).strict(),
|
|
6233
|
+
memory_write: z43.object({
|
|
6234
|
+
scope: MemoryScopeSchema.optional(),
|
|
6235
|
+
path: ToolPathSchema,
|
|
6236
|
+
content: z43.string().max(MEMORY_DOCUMENT_MAX_BYTES),
|
|
6237
|
+
mode: MemoryWriteModeSchema.optional(),
|
|
6238
|
+
expected_version: VersionSchema.optional()
|
|
6239
|
+
}).strict(),
|
|
6240
|
+
memory_edit: z43.object({
|
|
6241
|
+
scope: MemoryScopeSchema.optional(),
|
|
6242
|
+
path: ToolPathSchema,
|
|
6243
|
+
old_text: z43.string().min(1).max(MEMORY_DOCUMENT_MAX_BYTES),
|
|
6244
|
+
new_text: z43.string().max(MEMORY_DOCUMENT_MAX_BYTES),
|
|
6245
|
+
expected_version: VersionSchema
|
|
6246
|
+
}).strict(),
|
|
6247
|
+
memory_delete: z43.object({ scope: MemoryScopeSchema.optional(), path: ToolPathSchema, reason: ToolReasonSchema }).strict()
|
|
6248
|
+
};
|
|
6249
|
+
var MEMORY_TOOL_NAMES = Object.keys(MemoryToolInputSchemas);
|
|
6250
|
+
|
|
5847
6251
|
// ../../packages/shared/dist/schemas/launcher.schemas.js
|
|
5848
|
-
var LauncherAgentIdSchema =
|
|
5849
|
-
var
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
6252
|
+
var LauncherAgentIdSchema = z44.object({ agentId: z44.string().uuid() });
|
|
6253
|
+
var SANDBOX_TOOL_SETS = ["minimal", "full"];
|
|
6254
|
+
var SandboxToolSetSchema = z44.enum(SANDBOX_TOOL_SETS);
|
|
6255
|
+
var DEFAULT_SANDBOX_TOOL_SET = "minimal";
|
|
6256
|
+
var LauncherSetSandboxToolsSchema = LauncherAgentIdSchema.extend({
|
|
6257
|
+
sandboxTools: SandboxToolSetSchema
|
|
6258
|
+
}).strict();
|
|
6259
|
+
var LauncherAvatarSchema = z44.object({
|
|
6260
|
+
version: z44.literal(1),
|
|
6261
|
+
color: z44.enum(["rose", "mint", "blue", "amber", "mauve", "cocoa"]),
|
|
6262
|
+
face: z44.number().int().min(0).max(5),
|
|
5853
6263
|
/** Shape 0-6. Values 0-2 predate the wider range and keep their shapes. */
|
|
5854
|
-
head:
|
|
5855
|
-
antenna:
|
|
5856
|
-
ears:
|
|
5857
|
-
markings:
|
|
6264
|
+
head: z44.number().int().min(0).max(6),
|
|
6265
|
+
antenna: z44.number().int().min(0).max(3),
|
|
6266
|
+
ears: z44.number().int().min(0).max(2),
|
|
6267
|
+
markings: z44.number().int().min(0).max(255),
|
|
5858
6268
|
/**
|
|
5859
6269
|
* @deprecated Plush is the only companion style. Still accepted so avatars saved with a
|
|
5860
6270
|
* style parse, but ignored by every renderer; new saves omit it.
|
|
5861
6271
|
*/
|
|
5862
|
-
style:
|
|
6272
|
+
style: z44.enum(["vinyl", "gummy", "visor", "plush"]).optional()
|
|
5863
6273
|
}).strict();
|
|
5864
6274
|
var LauncherUpdateAvatarSchema = LauncherAgentIdSchema.extend({
|
|
5865
6275
|
avatar: LauncherAvatarSchema
|
|
5866
6276
|
});
|
|
5867
|
-
var LauncherLaunchSchema =
|
|
5868
|
-
requestKey:
|
|
5869
|
-
name:
|
|
5870
|
-
prompt:
|
|
6277
|
+
var LauncherLaunchSchema = z44.object({
|
|
6278
|
+
requestKey: z44.string().uuid(),
|
|
6279
|
+
name: z44.string().trim().min(1).max(100),
|
|
6280
|
+
prompt: z44.string().trim().min(1).max(32768),
|
|
5871
6281
|
avatar: LauncherAvatarSchema.optional(),
|
|
5872
6282
|
/** Capability tier for the new agent. Absent is light. */
|
|
5873
6283
|
tier: AgentTierSchema.optional()
|
|
5874
6284
|
}).strict();
|
|
5875
|
-
var LauncherSessionResetSchema =
|
|
5876
|
-
var LauncherArchiveResultSchema =
|
|
5877
|
-
agentId:
|
|
5878
|
-
archivedAt:
|
|
5879
|
-
cancelledJobs:
|
|
5880
|
-
disabledSchedule:
|
|
5881
|
-
updatedChannels:
|
|
5882
|
-
disconnectedChannels:
|
|
5883
|
-
deniedApprovals:
|
|
5884
|
-
revokedMcpTokens:
|
|
6285
|
+
var LauncherSessionResetSchema = z44.object({ version: z44.number().int().positive(), requestedAt: z44.string().datetime() }).strict();
|
|
6286
|
+
var LauncherArchiveResultSchema = z44.object({
|
|
6287
|
+
agentId: z44.string().uuid(),
|
|
6288
|
+
archivedAt: z44.string().datetime(),
|
|
6289
|
+
cancelledJobs: z44.number().int().nonnegative(),
|
|
6290
|
+
disabledSchedule: z44.boolean(),
|
|
6291
|
+
updatedChannels: z44.number().int().nonnegative(),
|
|
6292
|
+
disconnectedChannels: z44.number().int().nonnegative(),
|
|
6293
|
+
deniedApprovals: z44.number().int().nonnegative(),
|
|
6294
|
+
revokedMcpTokens: z44.number().int().nonnegative()
|
|
5885
6295
|
}).strict();
|
|
5886
6296
|
var LauncherMessageSchema = LauncherAgentIdSchema.extend({
|
|
5887
|
-
requestKey:
|
|
5888
|
-
prompt:
|
|
6297
|
+
requestKey: z44.string().uuid(),
|
|
6298
|
+
prompt: z44.string().trim().min(1).max(32768)
|
|
5889
6299
|
}).strict();
|
|
5890
|
-
var LauncherJobStatusSchema =
|
|
6300
|
+
var LauncherJobStatusSchema = z44.enum([
|
|
5891
6301
|
"queued",
|
|
5892
6302
|
"running",
|
|
5893
6303
|
"completed",
|
|
5894
6304
|
"failed",
|
|
5895
6305
|
"interrupted"
|
|
5896
6306
|
]);
|
|
5897
|
-
var LauncherJobSchema =
|
|
5898
|
-
id:
|
|
6307
|
+
var LauncherJobSchema = z44.object({
|
|
6308
|
+
id: z44.string().uuid(),
|
|
5899
6309
|
status: LauncherJobStatusSchema,
|
|
5900
|
-
runId:
|
|
5901
|
-
output:
|
|
5902
|
-
errorCode:
|
|
5903
|
-
createdAt:
|
|
5904
|
-
finishedAt:
|
|
6310
|
+
runId: z44.string().uuid().nullable(),
|
|
6311
|
+
output: z44.string().nullable(),
|
|
6312
|
+
errorCode: z44.string().nullable(),
|
|
6313
|
+
createdAt: z44.string(),
|
|
6314
|
+
finishedAt: z44.string().nullable()
|
|
5905
6315
|
});
|
|
5906
|
-
var LauncherAcceptedSchema =
|
|
5907
|
-
agentId:
|
|
5908
|
-
jobId:
|
|
6316
|
+
var LauncherAcceptedSchema = z44.object({
|
|
6317
|
+
agentId: z44.string().uuid(),
|
|
6318
|
+
jobId: z44.string().uuid(),
|
|
5909
6319
|
status: LauncherJobStatusSchema
|
|
5910
6320
|
});
|
|
5911
|
-
var LauncherAgentSchema =
|
|
5912
|
-
id:
|
|
5913
|
-
name:
|
|
6321
|
+
var LauncherAgentSchema = z44.object({
|
|
6322
|
+
id: z44.string().uuid(),
|
|
6323
|
+
name: z44.string(),
|
|
5914
6324
|
avatar: LauncherAvatarSchema.nullish(),
|
|
5915
|
-
paused:
|
|
6325
|
+
paused: z44.boolean(),
|
|
5916
6326
|
/** True once the owner deleted the agent; only a direct read by id returns such an agent. */
|
|
5917
|
-
archived:
|
|
6327
|
+
archived: z44.boolean().optional(),
|
|
5918
6328
|
/**
|
|
5919
6329
|
* The agent's capability tier. A change applies from its next job; a running job keeps the tier
|
|
5920
6330
|
* it was admitted under. Absent only from a backend that predates tiers, which ran every agent
|
|
5921
6331
|
* as light.
|
|
5922
6332
|
*/
|
|
5923
6333
|
tier: AgentTierSchema.default("light"),
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
6334
|
+
/**
|
|
6335
|
+
* The tools the agent's sandbox is created with. A change moves the agent to a new session at
|
|
6336
|
+
* its next task, once its project files are backed up; absent only from a backend that predates
|
|
6337
|
+
* the setting.
|
|
6338
|
+
*/
|
|
6339
|
+
sandboxTools: SandboxToolSetSchema.default(DEFAULT_SANDBOX_TOOL_SET),
|
|
6340
|
+
controlVersion: z44.number().int(),
|
|
6341
|
+
workspaceReady: z44.boolean(),
|
|
6342
|
+
usage: z44.object({
|
|
6343
|
+
available: z44.number(),
|
|
6344
|
+
reserved: z44.number(),
|
|
6345
|
+
spent: z44.number(),
|
|
6346
|
+
unit: z44.literal("tokens")
|
|
5931
6347
|
})
|
|
5932
6348
|
});
|
|
5933
|
-
var LauncherStatusSchema =
|
|
6349
|
+
var LauncherStatusSchema = z44.object({
|
|
5934
6350
|
agent: LauncherAgentSchema,
|
|
5935
|
-
jobs:
|
|
6351
|
+
jobs: z44.array(LauncherJobSchema)
|
|
5936
6352
|
});
|
|
5937
6353
|
var LauncherEventsInputSchema = LauncherAgentIdSchema.extend({
|
|
5938
|
-
after:
|
|
5939
|
-
limit:
|
|
5940
|
-
});
|
|
5941
|
-
var LauncherEventsSchema =
|
|
5942
|
-
events:
|
|
5943
|
-
id:
|
|
5944
|
-
runId:
|
|
5945
|
-
type:
|
|
5946
|
-
createdAt:
|
|
6354
|
+
after: z44.number().int().nonnegative().default(0),
|
|
6355
|
+
limit: z44.number().int().min(1).max(100).default(50)
|
|
6356
|
+
});
|
|
6357
|
+
var LauncherEventsSchema = z44.object({
|
|
6358
|
+
events: z44.array(z44.object({
|
|
6359
|
+
id: z44.number().int(),
|
|
6360
|
+
runId: z44.string().uuid(),
|
|
6361
|
+
type: z44.string(),
|
|
6362
|
+
createdAt: z44.string()
|
|
5947
6363
|
})),
|
|
5948
|
-
nextCursor:
|
|
6364
|
+
nextCursor: z44.number().int()
|
|
5949
6365
|
});
|
|
5950
6366
|
var LauncherArtifactInputSchema = LauncherAgentIdSchema.extend({
|
|
5951
|
-
artifactId:
|
|
5952
|
-
});
|
|
5953
|
-
var LauncherArtifactsSchema =
|
|
5954
|
-
artifacts:
|
|
5955
|
-
id:
|
|
5956
|
-
runId:
|
|
5957
|
-
path:
|
|
5958
|
-
displayName:
|
|
5959
|
-
sha256:
|
|
5960
|
-
bytes:
|
|
5961
|
-
createdAt:
|
|
6367
|
+
artifactId: z44.string().uuid()
|
|
6368
|
+
});
|
|
6369
|
+
var LauncherArtifactsSchema = z44.object({
|
|
6370
|
+
artifacts: z44.array(z44.object({
|
|
6371
|
+
id: z44.string().uuid(),
|
|
6372
|
+
runId: z44.string().uuid(),
|
|
6373
|
+
path: z44.string(),
|
|
6374
|
+
displayName: z44.string().optional(),
|
|
6375
|
+
sha256: z44.string(),
|
|
6376
|
+
bytes: z44.number(),
|
|
6377
|
+
createdAt: z44.string()
|
|
5962
6378
|
}))
|
|
5963
6379
|
});
|
|
5964
|
-
var LauncherArtifactUrlSchema =
|
|
5965
|
-
url:
|
|
5966
|
-
expiresIn:
|
|
6380
|
+
var LauncherArtifactUrlSchema = z44.object({
|
|
6381
|
+
url: z44.string().url(),
|
|
6382
|
+
expiresIn: z44.number().int()
|
|
5967
6383
|
});
|
|
5968
|
-
var LauncherAccountSchema =
|
|
5969
|
-
enabled:
|
|
5970
|
-
agentId:
|
|
5971
|
-
initialTokens:
|
|
5972
|
-
agentCount:
|
|
5973
|
-
maxAgents:
|
|
6384
|
+
var LauncherAccountSchema = z44.object({
|
|
6385
|
+
enabled: z44.boolean(),
|
|
6386
|
+
agentId: z44.string().uuid().nullable(),
|
|
6387
|
+
initialTokens: z44.number().int().nonnegative(),
|
|
6388
|
+
agentCount: z44.number().int().nonnegative(),
|
|
6389
|
+
maxAgents: z44.number().int().positive(),
|
|
5974
6390
|
/**
|
|
5975
6391
|
* @deprecated Kept for one release so a web bundle built before its removal, which reads
|
|
5976
6392
|
* `account.usage.available` without a guard, does not crash during a deploy or in a stale tab.
|
|
@@ -5978,145 +6394,151 @@ var LauncherAccountSchema = z43.object({
|
|
|
5978
6394
|
* allowance, and the shared token balance lives on each agent's `usage`. Remove next release.
|
|
5979
6395
|
*/
|
|
5980
6396
|
usage: LauncherAgentSchema.shape.usage.optional(),
|
|
5981
|
-
providerUsage:
|
|
5982
|
-
basis:
|
|
5983
|
-
provisional:
|
|
5984
|
-
inputTokens:
|
|
5985
|
-
outputTokens:
|
|
5986
|
-
totalTokens:
|
|
5987
|
-
cachedInputTokens:
|
|
5988
|
-
reasoningTokens:
|
|
5989
|
-
reportedTurns:
|
|
5990
|
-
unknownTurns:
|
|
5991
|
-
invalidObservations:
|
|
5992
|
-
missingCachedDetails:
|
|
5993
|
-
missingReasoningDetails:
|
|
5994
|
-
truncated:
|
|
6397
|
+
providerUsage: z44.object({
|
|
6398
|
+
basis: z44.literal("recorded_provider_turns"),
|
|
6399
|
+
provisional: z44.literal(true),
|
|
6400
|
+
inputTokens: z44.string().regex(/^\d+$/),
|
|
6401
|
+
outputTokens: z44.string().regex(/^\d+$/),
|
|
6402
|
+
totalTokens: z44.string().regex(/^\d+$/),
|
|
6403
|
+
cachedInputTokens: z44.string().regex(/^\d+$/),
|
|
6404
|
+
reasoningTokens: z44.string().regex(/^\d+$/),
|
|
6405
|
+
reportedTurns: z44.number().int().nonnegative(),
|
|
6406
|
+
unknownTurns: z44.number().int().nonnegative(),
|
|
6407
|
+
invalidObservations: z44.number().int().nonnegative(),
|
|
6408
|
+
missingCachedDetails: z44.number().int().nonnegative(),
|
|
6409
|
+
missingReasoningDetails: z44.number().int().nonnegative(),
|
|
6410
|
+
truncated: z44.boolean()
|
|
5995
6411
|
}).optional()
|
|
5996
6412
|
});
|
|
5997
6413
|
var LauncherTurnSchema = LauncherJobSchema.extend({
|
|
5998
|
-
uiCards:
|
|
5999
|
-
delegations:
|
|
6000
|
-
sequence:
|
|
6001
|
-
requestKey:
|
|
6002
|
-
prompt:
|
|
6003
|
-
senderAgentId:
|
|
6004
|
-
automaticContinuation:
|
|
6005
|
-
channelRequest:
|
|
6414
|
+
uiCards: z44.array(AgentUiCardSchema).max(3).optional(),
|
|
6415
|
+
delegations: z44.array(AgentDelegationSchema).optional(),
|
|
6416
|
+
sequence: z44.number().int(),
|
|
6417
|
+
requestKey: z44.string().uuid(),
|
|
6418
|
+
prompt: z44.string(),
|
|
6419
|
+
senderAgentId: z44.string().uuid().nullable().default(null),
|
|
6420
|
+
automaticContinuation: z44.boolean().optional(),
|
|
6421
|
+
channelRequest: z44.object({ id: z44.string().uuid(), reference: z44.string() }).nullable().optional()
|
|
6006
6422
|
});
|
|
6007
6423
|
var LauncherHistoryInputSchema = LauncherAgentIdSchema.extend({
|
|
6008
|
-
before:
|
|
6009
|
-
limit:
|
|
6010
|
-
});
|
|
6011
|
-
var LauncherHistorySchema =
|
|
6012
|
-
turns:
|
|
6013
|
-
nextBefore:
|
|
6014
|
-
});
|
|
6015
|
-
var LauncherJobInputSchema = LauncherAgentIdSchema.extend({ jobId:
|
|
6016
|
-
var LauncherActivitySchema =
|
|
6017
|
-
id:
|
|
6018
|
-
version:
|
|
6019
|
-
runId:
|
|
6020
|
-
type:
|
|
6021
|
-
label:
|
|
6022
|
-
outcome:
|
|
6023
|
-
createdAt:
|
|
6024
|
-
});
|
|
6025
|
-
var LauncherActivityPageSchema =
|
|
6026
|
-
events:
|
|
6027
|
-
nextBefore:
|
|
6028
|
-
});
|
|
6029
|
-
var LauncherViewSchema =
|
|
6030
|
-
agentUiEnabled:
|
|
6031
|
-
trial:
|
|
6424
|
+
before: z44.number().int().positive().optional(),
|
|
6425
|
+
limit: z44.number().int().min(1).max(50).default(20)
|
|
6426
|
+
});
|
|
6427
|
+
var LauncherHistorySchema = z44.object({
|
|
6428
|
+
turns: z44.array(LauncherTurnSchema),
|
|
6429
|
+
nextBefore: z44.number().int().nullable()
|
|
6430
|
+
});
|
|
6431
|
+
var LauncherJobInputSchema = LauncherAgentIdSchema.extend({ jobId: z44.string().uuid() });
|
|
6432
|
+
var LauncherActivitySchema = z44.object({
|
|
6433
|
+
id: z44.number().int(),
|
|
6434
|
+
version: z44.literal(1),
|
|
6435
|
+
runId: z44.string().uuid(),
|
|
6436
|
+
type: z44.string(),
|
|
6437
|
+
label: z44.string(),
|
|
6438
|
+
outcome: z44.enum(["started", "completed", "failed", "info"]),
|
|
6439
|
+
createdAt: z44.string()
|
|
6440
|
+
});
|
|
6441
|
+
var LauncherActivityPageSchema = z44.object({
|
|
6442
|
+
events: z44.array(LauncherActivitySchema),
|
|
6443
|
+
nextBefore: z44.number().int().nullable()
|
|
6444
|
+
});
|
|
6445
|
+
var LauncherViewSchema = z44.object({
|
|
6446
|
+
agentUiEnabled: z44.boolean().optional(),
|
|
6447
|
+
trial: z44.boolean().optional(),
|
|
6032
6448
|
agent: LauncherAgentSchema,
|
|
6033
|
-
accessEnabled:
|
|
6034
|
-
state:
|
|
6035
|
-
compute:
|
|
6036
|
-
queuedCount:
|
|
6449
|
+
accessEnabled: z44.boolean(),
|
|
6450
|
+
state: z44.enum(["ready", "queued", "working", "paused", "recovering", "interrupted", "exhausted"]),
|
|
6451
|
+
compute: z44.enum(["not_created", "starting", "running", "stopped", "unknown"]),
|
|
6452
|
+
queuedCount: z44.number().int(),
|
|
6453
|
+
/**
|
|
6454
|
+
* The agent's running or parked job, which every queued job waits behind until it finishes
|
|
6455
|
+
* (#2030). Its source tells the owner what a message is waiting for. Optional so a web bundle
|
|
6456
|
+
* newer than the backend still reads an older view.
|
|
6457
|
+
*/
|
|
6458
|
+
blockedBy: z44.object({ jobId: z44.string().uuid(), source: LauncherJobSourceSchema.nullable() }).nullable().optional(),
|
|
6037
6459
|
history: LauncherHistorySchema,
|
|
6038
6460
|
activity: LauncherActivityPageSchema
|
|
6039
6461
|
});
|
|
6040
|
-
var LauncherPreviewSchema =
|
|
6041
|
-
|
|
6042
|
-
kind:
|
|
6043
|
-
content:
|
|
6044
|
-
fileName:
|
|
6462
|
+
var LauncherPreviewSchema = z44.discriminatedUnion("kind", [
|
|
6463
|
+
z44.object({
|
|
6464
|
+
kind: z44.literal("text"),
|
|
6465
|
+
content: z44.string().max(65536),
|
|
6466
|
+
fileName: z44.string().optional()
|
|
6045
6467
|
}),
|
|
6046
|
-
|
|
6047
|
-
kind:
|
|
6048
|
-
content:
|
|
6049
|
-
fileName:
|
|
6468
|
+
z44.object({
|
|
6469
|
+
kind: z44.literal("html"),
|
|
6470
|
+
content: z44.string().max(5 * 1024 * 1024),
|
|
6471
|
+
fileName: z44.string()
|
|
6050
6472
|
}),
|
|
6051
|
-
|
|
6052
|
-
kind:
|
|
6053
|
-
content:
|
|
6054
|
-
mimeType:
|
|
6055
|
-
fileName:
|
|
6473
|
+
z44.object({
|
|
6474
|
+
kind: z44.literal("image"),
|
|
6475
|
+
content: z44.string().max(7e5),
|
|
6476
|
+
mimeType: z44.enum(["image/png", "image/jpeg", "image/gif", "image/webp"]),
|
|
6477
|
+
fileName: z44.string().optional()
|
|
6056
6478
|
}),
|
|
6057
|
-
|
|
6479
|
+
z44.object({ kind: z44.literal("download"), reason: z44.string() })
|
|
6058
6480
|
]);
|
|
6059
6481
|
var MAX_LAUNCHER_DOWNLOAD_BYTES = 16 * 1024 * 1024;
|
|
6060
6482
|
var LauncherSessionSendSchema = LauncherAgentIdSchema.extend({
|
|
6061
|
-
recipientAgentId:
|
|
6062
|
-
requestKey:
|
|
6063
|
-
message:
|
|
6483
|
+
recipientAgentId: z44.string().uuid(),
|
|
6484
|
+
requestKey: z44.string().uuid(),
|
|
6485
|
+
message: z44.string().trim().min(1).max(16e3)
|
|
6064
6486
|
}).strict();
|
|
6065
6487
|
var LauncherSessionHistoryInputSchema = LauncherAgentIdSchema.extend({
|
|
6066
|
-
peerAgentId:
|
|
6067
|
-
before:
|
|
6068
|
-
limit:
|
|
6488
|
+
peerAgentId: z44.string().uuid().optional(),
|
|
6489
|
+
before: z44.number().int().positive().optional(),
|
|
6490
|
+
limit: z44.number().int().min(1).max(50).default(20)
|
|
6069
6491
|
});
|
|
6070
6492
|
var LauncherSessionMessageSchema = LauncherTurnSchema.extend({
|
|
6071
|
-
agentId:
|
|
6072
|
-
senderAgentId:
|
|
6073
|
-
});
|
|
6074
|
-
var LauncherSessionHistorySchema =
|
|
6075
|
-
messages:
|
|
6076
|
-
nextBefore:
|
|
6077
|
-
});
|
|
6078
|
-
var LauncherMarketOperationSchema =
|
|
6079
|
-
id:
|
|
6080
|
-
action:
|
|
6081
|
-
state:
|
|
6082
|
-
taskId:
|
|
6083
|
-
taskTitle:
|
|
6493
|
+
agentId: z44.string().uuid(),
|
|
6494
|
+
senderAgentId: z44.string().uuid()
|
|
6495
|
+
});
|
|
6496
|
+
var LauncherSessionHistorySchema = z44.object({
|
|
6497
|
+
messages: z44.array(LauncherSessionMessageSchema),
|
|
6498
|
+
nextBefore: z44.number().int().nullable()
|
|
6499
|
+
});
|
|
6500
|
+
var LauncherMarketOperationSchema = z44.object({
|
|
6501
|
+
id: z44.string().uuid(),
|
|
6502
|
+
action: z44.string(),
|
|
6503
|
+
state: z44.enum(["pending", "completed", "failed"]),
|
|
6504
|
+
taskId: z44.string().nullable(),
|
|
6505
|
+
taskTitle: z44.string().nullable(),
|
|
6084
6506
|
/** USDC base units: the payment when one was quoted, else the reward or price the action named. */
|
|
6085
|
-
amount:
|
|
6507
|
+
amount: z44.string().regex(/^\d+$/).nullable(),
|
|
6086
6508
|
/** True once the payment for this action settled on chain. */
|
|
6087
|
-
paid:
|
|
6088
|
-
transactionHash:
|
|
6089
|
-
submissionId:
|
|
6509
|
+
paid: z44.boolean(),
|
|
6510
|
+
transactionHash: z44.string().nullable(),
|
|
6511
|
+
submissionId: z44.string().nullable(),
|
|
6090
6512
|
/** A bounded upper-case error code when the action failed. */
|
|
6091
|
-
errorCode:
|
|
6092
|
-
createdAt:
|
|
6093
|
-
updatedAt:
|
|
6094
|
-
});
|
|
6095
|
-
var LauncherMarketSummarySchema =
|
|
6096
|
-
activeTasks:
|
|
6097
|
-
submissions:
|
|
6098
|
-
tasksPublished:
|
|
6099
|
-
wins:
|
|
6100
|
-
pending:
|
|
6101
|
-
failed:
|
|
6513
|
+
errorCode: z44.string().nullable(),
|
|
6514
|
+
createdAt: z44.string(),
|
|
6515
|
+
updatedAt: z44.string()
|
|
6516
|
+
});
|
|
6517
|
+
var LauncherMarketSummarySchema = z44.object({
|
|
6518
|
+
activeTasks: z44.number().int().nonnegative(),
|
|
6519
|
+
submissions: z44.number().int().nonnegative(),
|
|
6520
|
+
tasksPublished: z44.number().int().nonnegative(),
|
|
6521
|
+
wins: z44.number().int().nonnegative(),
|
|
6522
|
+
pending: z44.number().int().nonnegative(),
|
|
6523
|
+
failed: z44.number().int().nonnegative(),
|
|
6102
6524
|
/** Settled market payments in USDC base units (fees, and escrow for published tasks). */
|
|
6103
|
-
spent:
|
|
6525
|
+
spent: z44.string().regex(/^\d+$/),
|
|
6104
6526
|
/** Worker payouts for tasks this agent worked, in USDC base units. */
|
|
6105
|
-
earnings:
|
|
6527
|
+
earnings: z44.string().regex(/^\d+$/)
|
|
6106
6528
|
});
|
|
6107
6529
|
var LauncherAgentMarketInputSchema = LauncherAgentIdSchema.extend({
|
|
6108
|
-
limit:
|
|
6530
|
+
limit: z44.number().int().min(1).max(100).default(50)
|
|
6109
6531
|
});
|
|
6110
|
-
var LauncherAgentMarketSchema =
|
|
6111
|
-
operations:
|
|
6532
|
+
var LauncherAgentMarketSchema = z44.object({
|
|
6533
|
+
operations: z44.array(LauncherMarketOperationSchema),
|
|
6112
6534
|
summary: LauncherMarketSummarySchema
|
|
6113
6535
|
});
|
|
6114
|
-
var LauncherAgentMarketTasksInputSchema =
|
|
6115
|
-
agentId:
|
|
6116
|
-
view:
|
|
6117
|
-
limit:
|
|
6536
|
+
var LauncherAgentMarketTasksInputSchema = z44.object({
|
|
6537
|
+
agentId: z44.string().uuid(),
|
|
6538
|
+
view: z44.enum(["both", "posted", "attempted"]).default("both"),
|
|
6539
|
+
limit: z44.number().int().min(1).max(50).default(5),
|
|
6118
6540
|
/** Opaque, per list. Only accepted with view 'posted' or 'attempted'. */
|
|
6119
|
-
cursor:
|
|
6541
|
+
cursor: z44.string().max(200).optional()
|
|
6120
6542
|
}).strict();
|
|
6121
6543
|
var LAUNCHER_POSTED_TASK_STATUSES = [
|
|
6122
6544
|
// A create approval is pending or approving; the row carries `approvalId` for Review.
|
|
@@ -6141,9 +6563,9 @@ var LAUNCHER_POSTED_TASK_STATUSES = [
|
|
|
6141
6563
|
"expired",
|
|
6142
6564
|
"cancelled"
|
|
6143
6565
|
];
|
|
6144
|
-
var LauncherPostedTaskStatusSchema =
|
|
6566
|
+
var LauncherPostedTaskStatusSchema = z44.enum(LAUNCHER_POSTED_TASK_STATUSES);
|
|
6145
6567
|
var LAUNCHER_ATTEMPT_KINDS = ["claim", "pitch", "bid", "proof", "submit"];
|
|
6146
|
-
var LauncherAttemptKindSchema =
|
|
6568
|
+
var LauncherAttemptKindSchema = z44.enum(LAUNCHER_ATTEMPT_KINDS);
|
|
6147
6569
|
var LAUNCHER_ATTEMPT_OUTCOMES = [
|
|
6148
6570
|
// A paid worker write (pitch, bid, paid submission) awaits the owner; `approvalId` set.
|
|
6149
6571
|
"awaiting_approval",
|
|
@@ -6170,43 +6592,43 @@ var LAUNCHER_ATTEMPT_OUTCOMES = [
|
|
|
6170
6592
|
// A sibling made a later worker write on the task, or holds its worker role now.
|
|
6171
6593
|
"continued_by_sibling"
|
|
6172
6594
|
];
|
|
6173
|
-
var LauncherAttemptOutcomeSchema =
|
|
6174
|
-
var UsdcUnitsSchema =
|
|
6175
|
-
var LauncherPostedTaskSchema =
|
|
6595
|
+
var LauncherAttemptOutcomeSchema = z44.enum(LAUNCHER_ATTEMPT_OUTCOMES);
|
|
6596
|
+
var UsdcUnitsSchema = z44.string().regex(/^\d+$/);
|
|
6597
|
+
var LauncherPostedTaskSchema = z44.object({
|
|
6176
6598
|
/** Stable per row: `task:<taskId>`, `approval:<id>`, `operation:<id>` or `refusal:<id>`. */
|
|
6177
|
-
key:
|
|
6599
|
+
key: z44.string(),
|
|
6178
6600
|
/** Null for drafts, refusals and publishes not resolved to a task yet. */
|
|
6179
|
-
taskId:
|
|
6180
|
-
title:
|
|
6601
|
+
taskId: z44.string().nullable(),
|
|
6602
|
+
title: z44.string().nullable(),
|
|
6181
6603
|
/** The task mode as stored on tasks.mode, or as drafted. */
|
|
6182
|
-
mode:
|
|
6604
|
+
mode: z44.string().nullable(),
|
|
6183
6605
|
/** USDC base units. */
|
|
6184
6606
|
rewardUnits: UsdcUnitsSchema.nullable(),
|
|
6185
6607
|
status: LauncherPostedTaskStatusSchema,
|
|
6186
6608
|
/** Set while status is awaiting_approval. */
|
|
6187
|
-
approvalId:
|
|
6188
|
-
approvalExpiresAt:
|
|
6609
|
+
approvalId: z44.string().uuid().nullable(),
|
|
6610
|
+
approvalExpiresAt: z44.string().nullable(),
|
|
6189
6611
|
/** Submissions; pitches for pitch mode; bids for auction mode. Null with no task. */
|
|
6190
|
-
submissions:
|
|
6612
|
+
submissions: z44.number().int().nonnegative().nullable(),
|
|
6191
6613
|
/** The deadline that matters for the current status. */
|
|
6192
|
-
deadlineAt:
|
|
6614
|
+
deadlineAt: z44.string().nullable(),
|
|
6193
6615
|
/** The rank-1 award recipient once completed; `memberName` when it is a hosted swarm member. */
|
|
6194
|
-
winner:
|
|
6616
|
+
winner: z44.object({ hosted: z44.boolean(), memberName: z44.string().nullable() }).nullable(),
|
|
6195
6617
|
/** What publishing cost the swarm once the payment settled, in USDC base units. */
|
|
6196
6618
|
paidUnits: UsdcUnitsSchema.nullable(),
|
|
6197
6619
|
/** A machine code (HOSTED_MARKET_* or a marketplace error code) for the unpublished states. */
|
|
6198
|
-
reasonCode:
|
|
6620
|
+
reasonCode: z44.string().nullable(),
|
|
6199
6621
|
/** The publishing transaction (the task's escrow transaction) when known. */
|
|
6200
|
-
transactionHash:
|
|
6201
|
-
createdAt:
|
|
6202
|
-
updatedAt:
|
|
6622
|
+
transactionHash: z44.string().nullable(),
|
|
6623
|
+
createdAt: z44.string(),
|
|
6624
|
+
updatedAt: z44.string()
|
|
6203
6625
|
});
|
|
6204
|
-
var LauncherAttemptedTaskSchema =
|
|
6626
|
+
var LauncherAttemptedTaskSchema = z44.object({
|
|
6205
6627
|
/** Stable per row: `task:<taskId>`, `approval:<id>` or `refusal:<id>`. */
|
|
6206
|
-
key:
|
|
6207
|
-
taskId:
|
|
6208
|
-
title:
|
|
6209
|
-
mode:
|
|
6628
|
+
key: z44.string(),
|
|
6629
|
+
taskId: z44.string().nullable(),
|
|
6630
|
+
title: z44.string().nullable(),
|
|
6631
|
+
mode: z44.string().nullable(),
|
|
6210
6632
|
rewardUnits: UsdcUnitsSchema.nullable(),
|
|
6211
6633
|
/** The kind of the agent's latest attempt on the task. */
|
|
6212
6634
|
attempt: LauncherAttemptKindSchema,
|
|
@@ -6214,70 +6636,70 @@ var LauncherAttemptedTaskSchema = z43.object({
|
|
|
6214
6636
|
/** The bid amount, or what was earned when won, in USDC base units. */
|
|
6215
6637
|
amountUnits: UsdcUnitsSchema.nullable(),
|
|
6216
6638
|
/** The sibling that continued the task or holds its worker role now. */
|
|
6217
|
-
continuedBy:
|
|
6218
|
-
approvalId:
|
|
6639
|
+
continuedBy: z44.object({ agentId: z44.string(), name: z44.string() }).nullable(),
|
|
6640
|
+
approvalId: z44.string().uuid().nullable(),
|
|
6219
6641
|
/** A machine code for not_approved, blocked and did_not_go_through. */
|
|
6220
|
-
reasonCode:
|
|
6221
|
-
transactionHash:
|
|
6222
|
-
createdAt:
|
|
6223
|
-
updatedAt:
|
|
6642
|
+
reasonCode: z44.string().nullable(),
|
|
6643
|
+
transactionHash: z44.string().nullable(),
|
|
6644
|
+
createdAt: z44.string(),
|
|
6645
|
+
updatedAt: z44.string()
|
|
6224
6646
|
});
|
|
6225
|
-
var LauncherAgentMarketTasksSchema =
|
|
6226
|
-
counts:
|
|
6647
|
+
var LauncherAgentMarketTasksSchema = z44.object({
|
|
6648
|
+
counts: z44.object({
|
|
6227
6649
|
/** Every Posted row, drafts and refused creates included. */
|
|
6228
|
-
posted:
|
|
6650
|
+
posted: z44.number().int().nonnegative(),
|
|
6229
6651
|
/** awaiting_approval, publishing, open, in_progress, in_review, appealing and disputed. */
|
|
6230
|
-
postedOpen:
|
|
6652
|
+
postedOpen: z44.number().int().nonnegative(),
|
|
6231
6653
|
/** Every Attempted row. */
|
|
6232
|
-
attempted:
|
|
6654
|
+
attempted: z44.number().int().nonnegative(),
|
|
6233
6655
|
/** awaiting_approval, working and awaiting_result. */
|
|
6234
|
-
attemptedActive:
|
|
6235
|
-
won:
|
|
6656
|
+
attemptedActive: z44.number().int().nonnegative(),
|
|
6657
|
+
won: z44.number().int().nonnegative(),
|
|
6236
6658
|
/** The sum of amountUnits over won rows. */
|
|
6237
6659
|
earnedUnits: UsdcUnitsSchema
|
|
6238
6660
|
}),
|
|
6239
6661
|
/** Empty when view is 'attempted'. */
|
|
6240
|
-
posted:
|
|
6241
|
-
items:
|
|
6242
|
-
nextCursor:
|
|
6662
|
+
posted: z44.object({
|
|
6663
|
+
items: z44.array(LauncherPostedTaskSchema),
|
|
6664
|
+
nextCursor: z44.string().nullable()
|
|
6243
6665
|
}),
|
|
6244
6666
|
/** Empty when view is 'posted'. */
|
|
6245
|
-
attempted:
|
|
6246
|
-
items:
|
|
6247
|
-
nextCursor:
|
|
6667
|
+
attempted: z44.object({
|
|
6668
|
+
items: z44.array(LauncherAttemptedTaskSchema),
|
|
6669
|
+
nextCursor: z44.string().nullable()
|
|
6248
6670
|
})
|
|
6249
6671
|
});
|
|
6250
|
-
var LauncherMarketOverviewSchema =
|
|
6251
|
-
agents:
|
|
6672
|
+
var LauncherMarketOverviewSchema = z44.object({
|
|
6673
|
+
agents: z44.array(z44.object({ agentId: z44.string(), activeTasks: z44.number().int().nonnegative() }))
|
|
6252
6674
|
});
|
|
6253
6675
|
|
|
6254
6676
|
// ../../packages/shared/dist/schemas/launcher-schedule.schemas.js
|
|
6255
|
-
import { z as
|
|
6677
|
+
import { z as z45 } from "zod";
|
|
6256
6678
|
var SCHEDULE_SCAN_SECONDS = 300;
|
|
6257
|
-
var LauncherScheduleControlSchema =
|
|
6258
|
-
agentId:
|
|
6259
|
-
requestKey:
|
|
6260
|
-
enabled:
|
|
6679
|
+
var LauncherScheduleControlSchema = z45.object({
|
|
6680
|
+
agentId: z45.string().uuid(),
|
|
6681
|
+
requestKey: z45.string().uuid(),
|
|
6682
|
+
enabled: z45.boolean()
|
|
6261
6683
|
}).strict();
|
|
6262
|
-
var LauncherNextStepSchema =
|
|
6263
|
-
|
|
6264
|
-
state:
|
|
6265
|
-
delaySeconds:
|
|
6266
|
-
prompt:
|
|
6684
|
+
var LauncherNextStepSchema = z45.discriminatedUnion("state", [
|
|
6685
|
+
z45.object({
|
|
6686
|
+
state: z45.literal("scheduled"),
|
|
6687
|
+
delaySeconds: z45.number().int().min(SCHEDULE_SCAN_SECONDS).max(30 * 86400),
|
|
6688
|
+
prompt: z45.string().trim().min(1).max(32768)
|
|
6267
6689
|
}).strict(),
|
|
6268
|
-
|
|
6269
|
-
state:
|
|
6270
|
-
reason:
|
|
6271
|
-
prompt:
|
|
6690
|
+
z45.object({
|
|
6691
|
+
state: z45.literal("waiting"),
|
|
6692
|
+
reason: z45.enum(["external", "owner", "funds"]),
|
|
6693
|
+
prompt: z45.string().trim().min(1).max(32768)
|
|
6272
6694
|
}).strict(),
|
|
6273
|
-
|
|
6695
|
+
z45.object({ state: z45.literal("idle") }).strict()
|
|
6274
6696
|
]);
|
|
6275
|
-
var LauncherScheduleNextSchema =
|
|
6276
|
-
agentId:
|
|
6277
|
-
requestKey:
|
|
6697
|
+
var LauncherScheduleNextSchema = z45.object({
|
|
6698
|
+
agentId: z45.string().uuid(),
|
|
6699
|
+
requestKey: z45.string().uuid(),
|
|
6278
6700
|
step: LauncherNextStepSchema
|
|
6279
6701
|
}).strict();
|
|
6280
|
-
var LauncherScheduleStatusSchema =
|
|
6702
|
+
var LauncherScheduleStatusSchema = z45.enum([
|
|
6281
6703
|
"disabled",
|
|
6282
6704
|
"idle",
|
|
6283
6705
|
"scheduled",
|
|
@@ -6292,65 +6714,65 @@ var LauncherScheduleStatusSchema = z44.enum([
|
|
|
6292
6714
|
"waiting_funds",
|
|
6293
6715
|
"source_failed"
|
|
6294
6716
|
]);
|
|
6295
|
-
var LauncherScheduleViewSchema =
|
|
6296
|
-
agentId:
|
|
6297
|
-
enabled:
|
|
6298
|
-
revision:
|
|
6299
|
-
generation:
|
|
6300
|
-
nextRunAt:
|
|
6301
|
-
prompt:
|
|
6302
|
-
waitingFor:
|
|
6717
|
+
var LauncherScheduleViewSchema = z45.object({
|
|
6718
|
+
agentId: z45.string().uuid(),
|
|
6719
|
+
enabled: z45.boolean(),
|
|
6720
|
+
revision: z45.number().int(),
|
|
6721
|
+
generation: z45.number().int(),
|
|
6722
|
+
nextRunAt: z45.string().nullable(),
|
|
6723
|
+
prompt: z45.string().nullable(),
|
|
6724
|
+
waitingFor: z45.enum(["external", "owner", "funds"]).nullable(),
|
|
6303
6725
|
status: LauncherScheduleStatusSchema,
|
|
6304
|
-
label:
|
|
6305
|
-
lastJobId:
|
|
6306
|
-
asOf:
|
|
6307
|
-
scanEverySeconds:
|
|
6726
|
+
label: z45.string(),
|
|
6727
|
+
lastJobId: z45.string().nullable(),
|
|
6728
|
+
asOf: z45.string(),
|
|
6729
|
+
scanEverySeconds: z45.literal(SCHEDULE_SCAN_SECONDS)
|
|
6308
6730
|
});
|
|
6309
6731
|
|
|
6310
6732
|
// ../../packages/shared/dist/schemas/swarm-coordination.schemas.js
|
|
6311
|
-
import { z as
|
|
6312
|
-
var SwarmCoordinationPermissionsSchema =
|
|
6313
|
-
create:
|
|
6314
|
-
dispatch:
|
|
6315
|
-
resume:
|
|
6733
|
+
import { z as z46 } from "zod";
|
|
6734
|
+
var SwarmCoordinationPermissionsSchema = z46.object({
|
|
6735
|
+
create: z46.boolean().default(false),
|
|
6736
|
+
dispatch: z46.boolean().default(false),
|
|
6737
|
+
resume: z46.boolean().default(false)
|
|
6316
6738
|
}).strict();
|
|
6317
|
-
var SwarmProfileInputSchema =
|
|
6318
|
-
agentId:
|
|
6319
|
-
requestKey:
|
|
6320
|
-
name:
|
|
6321
|
-
responsibility:
|
|
6739
|
+
var SwarmProfileInputSchema = z46.object({
|
|
6740
|
+
agentId: z46.string().uuid(),
|
|
6741
|
+
requestKey: z46.string().uuid(),
|
|
6742
|
+
name: z46.string().trim().min(1).max(100),
|
|
6743
|
+
responsibility: z46.string().trim().max(500),
|
|
6322
6744
|
/**
|
|
6323
6745
|
* The agent's instructions.md memory document (SM-24). Omit to leave it unchanged, e.g. when
|
|
6324
6746
|
* it was written in the Memory tab beyond this editor's limit.
|
|
6325
6747
|
*/
|
|
6326
|
-
instructions:
|
|
6748
|
+
instructions: z46.string().trim().max(16e3).optional(),
|
|
6327
6749
|
/**
|
|
6328
6750
|
* The instructions.md version the editor loaded (`SwarmProfile.instructionsVersion`); a save
|
|
6329
6751
|
* whose text differs is refused with MEMORY_VERSION_CONFLICT if the document moved on since.
|
|
6330
6752
|
*/
|
|
6331
|
-
instructionsVersion:
|
|
6753
|
+
instructionsVersion: z46.number().int().min(0).optional(),
|
|
6332
6754
|
permissions: SwarmCoordinationPermissionsSchema
|
|
6333
6755
|
}).strict();
|
|
6334
|
-
var SwarmProfileSchema =
|
|
6335
|
-
available:
|
|
6336
|
-
agentId:
|
|
6337
|
-
name:
|
|
6338
|
-
responsibility:
|
|
6339
|
-
instructions:
|
|
6756
|
+
var SwarmProfileSchema = z46.object({
|
|
6757
|
+
available: z46.boolean().default(false),
|
|
6758
|
+
agentId: z46.string().uuid(),
|
|
6759
|
+
name: z46.string(),
|
|
6760
|
+
responsibility: z46.string(),
|
|
6761
|
+
instructions: z46.string(),
|
|
6340
6762
|
/** Version of the live instructions.md memory document; 0 when there is none. */
|
|
6341
|
-
instructionsVersion:
|
|
6342
|
-
version:
|
|
6343
|
-
generation:
|
|
6344
|
-
creatorAgentId:
|
|
6345
|
-
creatorJobId:
|
|
6763
|
+
instructionsVersion: z46.number().int().default(0),
|
|
6764
|
+
version: z46.number().int(),
|
|
6765
|
+
generation: z46.number().int(),
|
|
6766
|
+
creatorAgentId: z46.string().uuid().nullable(),
|
|
6767
|
+
creatorJobId: z46.string().uuid().nullable(),
|
|
6346
6768
|
permissions: SwarmCoordinationPermissionsSchema
|
|
6347
6769
|
});
|
|
6348
|
-
var SwarmMemberSchema =
|
|
6349
|
-
agentId:
|
|
6350
|
-
name:
|
|
6351
|
-
responsibility:
|
|
6352
|
-
creatorAgentId:
|
|
6353
|
-
state:
|
|
6770
|
+
var SwarmMemberSchema = z46.object({
|
|
6771
|
+
agentId: z46.string().uuid(),
|
|
6772
|
+
name: z46.string(),
|
|
6773
|
+
responsibility: z46.string(),
|
|
6774
|
+
creatorAgentId: z46.string().uuid().nullable(),
|
|
6775
|
+
state: z46.enum([
|
|
6354
6776
|
"idle",
|
|
6355
6777
|
"queued",
|
|
6356
6778
|
"working",
|
|
@@ -6361,95 +6783,95 @@ var SwarmMemberSchema = z45.object({
|
|
|
6361
6783
|
"waiting",
|
|
6362
6784
|
"failed"
|
|
6363
6785
|
]),
|
|
6364
|
-
queuedCount:
|
|
6365
|
-
jobId:
|
|
6366
|
-
runId:
|
|
6367
|
-
headline:
|
|
6368
|
-
progress:
|
|
6369
|
-
updatedAt:
|
|
6370
|
-
freshness:
|
|
6371
|
-
waitingFor:
|
|
6372
|
-
nextRunAt:
|
|
6373
|
-
lastResult:
|
|
6374
|
-
jobId:
|
|
6375
|
-
summary:
|
|
6376
|
-
artifacts:
|
|
6377
|
-
finishedAt:
|
|
6786
|
+
queuedCount: z46.number().int(),
|
|
6787
|
+
jobId: z46.string().uuid().nullable(),
|
|
6788
|
+
runId: z46.string().uuid().nullable(),
|
|
6789
|
+
headline: z46.string().nullable(),
|
|
6790
|
+
progress: z46.string().nullable(),
|
|
6791
|
+
updatedAt: z46.string().nullable(),
|
|
6792
|
+
freshness: z46.enum(["current", "stale", "unpublished"]),
|
|
6793
|
+
waitingFor: z46.array(z46.string().uuid()),
|
|
6794
|
+
nextRunAt: z46.string().nullable(),
|
|
6795
|
+
lastResult: z46.object({
|
|
6796
|
+
jobId: z46.string().uuid(),
|
|
6797
|
+
summary: z46.string(),
|
|
6798
|
+
artifacts: z46.array(z46.object({ artifactId: z46.string().uuid(), sha256: z46.string(), path: z46.string() })).optional(),
|
|
6799
|
+
finishedAt: z46.string().nullable()
|
|
6378
6800
|
}).nullable(),
|
|
6379
6801
|
/**
|
|
6380
6802
|
* The agent's most recently finished job, whatever its outcome. `lastResult` covers only a
|
|
6381
6803
|
* completed job that published a summary; this is what an owner's "finished, come look" signal
|
|
6382
6804
|
* reads. Optional so an overview from an older backend still parses.
|
|
6383
6805
|
*/
|
|
6384
|
-
lastFinished:
|
|
6385
|
-
jobId:
|
|
6806
|
+
lastFinished: z46.object({
|
|
6807
|
+
jobId: z46.string().uuid(),
|
|
6386
6808
|
status: LauncherJobStatusSchema.extract(["completed", "failed", "interrupted"]),
|
|
6387
|
-
finishedAt:
|
|
6809
|
+
finishedAt: z46.string().nullable()
|
|
6388
6810
|
}).nullable().optional(),
|
|
6389
|
-
asOf:
|
|
6811
|
+
asOf: z46.string()
|
|
6390
6812
|
});
|
|
6391
|
-
var SwarmOverviewSchema =
|
|
6392
|
-
members:
|
|
6393
|
-
asOf:
|
|
6813
|
+
var SwarmOverviewSchema = z46.object({
|
|
6814
|
+
members: z46.array(SwarmMemberSchema).max(10),
|
|
6815
|
+
asOf: z46.string()
|
|
6394
6816
|
});
|
|
6395
|
-
var artifactIds =
|
|
6817
|
+
var artifactIds = z46.array(z46.string().uuid()).max(8).default([]);
|
|
6396
6818
|
var SwarmToolInputSchemas = {
|
|
6397
|
-
sessions_list:
|
|
6398
|
-
sessions_inspect:
|
|
6399
|
-
sessions_create:
|
|
6400
|
-
intentKey:
|
|
6401
|
-
name:
|
|
6402
|
-
responsibility:
|
|
6403
|
-
instructions:
|
|
6404
|
-
prompt:
|
|
6819
|
+
sessions_list: z46.object({}).strict(),
|
|
6820
|
+
sessions_inspect: z46.object({ agentId: z46.string().uuid() }).strict(),
|
|
6821
|
+
sessions_create: z46.object({
|
|
6822
|
+
intentKey: z46.string().trim().min(1).max(100),
|
|
6823
|
+
name: z46.string().trim().min(1).max(100),
|
|
6824
|
+
responsibility: z46.string().trim().min(1).max(500),
|
|
6825
|
+
instructions: z46.string().trim().min(1).max(16e3),
|
|
6826
|
+
prompt: z46.string().trim().min(1).max(16e3)
|
|
6405
6827
|
}).strict(),
|
|
6406
|
-
sessions_send:
|
|
6407
|
-
agentId:
|
|
6408
|
-
requestKey:
|
|
6409
|
-
message:
|
|
6828
|
+
sessions_send: z46.object({
|
|
6829
|
+
agentId: z46.string().uuid(),
|
|
6830
|
+
requestKey: z46.string().uuid(),
|
|
6831
|
+
message: z46.string().trim().min(1).max(16e3),
|
|
6410
6832
|
artifactIds
|
|
6411
6833
|
}).strict(),
|
|
6412
|
-
sessions_history:
|
|
6413
|
-
agentId:
|
|
6414
|
-
before:
|
|
6834
|
+
sessions_history: z46.object({
|
|
6835
|
+
agentId: z46.string().uuid().optional(),
|
|
6836
|
+
before: z46.number().int().positive().optional()
|
|
6415
6837
|
}).strict(),
|
|
6416
|
-
sessions_result:
|
|
6417
|
-
sessions_wait:
|
|
6418
|
-
jobIds:
|
|
6419
|
-
mode:
|
|
6420
|
-
prompt:
|
|
6421
|
-
timeoutSeconds:
|
|
6838
|
+
sessions_result: z46.object({ jobId: z46.string().uuid() }).strict(),
|
|
6839
|
+
sessions_wait: z46.object({
|
|
6840
|
+
jobIds: z46.array(z46.string().uuid()).min(1).max(8),
|
|
6841
|
+
mode: z46.enum(["any", "all"]),
|
|
6842
|
+
prompt: z46.string().trim().min(1).max(16e3),
|
|
6843
|
+
timeoutSeconds: z46.number().int().min(60).max(604800)
|
|
6422
6844
|
}).strict(),
|
|
6423
|
-
sessions_update_status:
|
|
6424
|
-
headline:
|
|
6425
|
-
progress:
|
|
6426
|
-
resultSummary:
|
|
6845
|
+
sessions_update_status: z46.object({
|
|
6846
|
+
headline: z46.string().trim().min(1).max(200),
|
|
6847
|
+
progress: z46.string().trim().max(1e3),
|
|
6848
|
+
resultSummary: z46.string().trim().max(1e3).optional(),
|
|
6427
6849
|
artifactIds
|
|
6428
6850
|
}).strict(),
|
|
6429
|
-
sessions_read_artifact:
|
|
6851
|
+
sessions_read_artifact: z46.object({ artifactId: z46.string().uuid() }).strict()
|
|
6430
6852
|
};
|
|
6431
|
-
var SwarmWaitSchema =
|
|
6432
|
-
id:
|
|
6433
|
-
sourceJobId:
|
|
6434
|
-
jobIds:
|
|
6435
|
-
state:
|
|
6436
|
-
reason:
|
|
6437
|
-
deadline:
|
|
6438
|
-
continuationJobId:
|
|
6853
|
+
var SwarmWaitSchema = z46.object({
|
|
6854
|
+
id: z46.string().uuid(),
|
|
6855
|
+
sourceJobId: z46.string().uuid(),
|
|
6856
|
+
jobIds: z46.array(z46.string().uuid()),
|
|
6857
|
+
state: z46.enum(["pending", "delivered", "cancelled"]),
|
|
6858
|
+
reason: z46.string().nullable(),
|
|
6859
|
+
deadline: z46.string(),
|
|
6860
|
+
continuationJobId: z46.string().uuid().nullable()
|
|
6439
6861
|
});
|
|
6440
6862
|
|
|
6441
6863
|
// ../../packages/shared/dist/schemas/direct-agent-checkpoint.schemas.js
|
|
6442
|
-
import { z as
|
|
6864
|
+
import { z as z50 } from "zod";
|
|
6443
6865
|
|
|
6444
6866
|
// ../../packages/shared/dist/schemas/turn-attribution.schemas.js
|
|
6445
|
-
import { z as
|
|
6867
|
+
import { z as z47 } from "zod";
|
|
6446
6868
|
var TURN_ATTRIBUTION_RECORD_VERSION = 1;
|
|
6447
|
-
var TurnAttributionIdentitySchema =
|
|
6448
|
-
sessionId:
|
|
6449
|
-
turnId:
|
|
6869
|
+
var TurnAttributionIdentitySchema = z47.object({
|
|
6870
|
+
sessionId: z47.string().min(1).max(256),
|
|
6871
|
+
turnId: z47.string().min(1).max(256),
|
|
6450
6872
|
/** Non-null exactly for native helpers; a root or maintenance turn has no subagent. */
|
|
6451
|
-
subagentId:
|
|
6452
|
-
role:
|
|
6873
|
+
subagentId: z47.string().min(1).max(256).nullable(),
|
|
6874
|
+
role: z47.enum(ROUTING_EXECUTION_ROLES)
|
|
6453
6875
|
}).strict().superRefine((identity, ctx) => {
|
|
6454
6876
|
if (identity.role === "native_helper" && identity.subagentId === null)
|
|
6455
6877
|
ctx.addIssue({ code: "custom", message: "A native helper identity needs its subagent id" });
|
|
@@ -6457,18 +6879,18 @@ var TurnAttributionIdentitySchema = z46.object({
|
|
|
6457
6879
|
ctx.addIssue({ code: "custom", message: "Only a native helper identity carries a subagent" });
|
|
6458
6880
|
});
|
|
6459
6881
|
var PinnedTurnAttributionSchema = RoutingAttributionSchema.extend({
|
|
6460
|
-
operationId:
|
|
6461
|
-
inheritedFrom:
|
|
6882
|
+
operationId: z47.string().uuid().nullable(),
|
|
6883
|
+
inheritedFrom: z47.string().min(1).max(1024).nullable()
|
|
6462
6884
|
}).strict();
|
|
6463
6885
|
var MAX_ATTRIBUTION_EPOCHS = 32;
|
|
6464
6886
|
var TurnAttributionEpochSchema = PinnedTurnAttributionSchema.extend({
|
|
6465
|
-
epoch:
|
|
6887
|
+
epoch: z47.number().int().positive().max(MAX_ATTRIBUTION_EPOCHS)
|
|
6466
6888
|
}).strict();
|
|
6467
|
-
var TurnAttributionLedgerSchema =
|
|
6468
|
-
version:
|
|
6469
|
-
epochs:
|
|
6889
|
+
var TurnAttributionLedgerSchema = z47.object({
|
|
6890
|
+
version: z47.literal(TURN_ATTRIBUTION_RECORD_VERSION),
|
|
6891
|
+
epochs: z47.array(TurnAttributionEpochSchema).max(MAX_ATTRIBUTION_EPOCHS),
|
|
6470
6892
|
/** `turnAttributionKey()` to epoch number. Bounded by the provider's own history limit. */
|
|
6471
|
-
turns:
|
|
6893
|
+
turns: z47.record(z47.number().int().positive().max(MAX_ATTRIBUTION_EPOCHS))
|
|
6472
6894
|
}).strict().superRefine((ledger, ctx) => {
|
|
6473
6895
|
const ids = ledger.epochs.map((entry) => entry.epoch);
|
|
6474
6896
|
if (new Set(ids).size !== ids.length)
|
|
@@ -6477,13 +6899,13 @@ var TurnAttributionLedgerSchema = z46.object({
|
|
|
6477
6899
|
if (!ids.includes(epoch))
|
|
6478
6900
|
ctx.addIssue({ code: "custom", message: `Turn references unknown epoch ${epoch}` });
|
|
6479
6901
|
});
|
|
6480
|
-
var ManagedTurnUsageSchema =
|
|
6481
|
-
inputTokens:
|
|
6482
|
-
outputTokens:
|
|
6483
|
-
totalTokens:
|
|
6484
|
-
cacheReadTokens:
|
|
6485
|
-
cacheWriteTokens:
|
|
6486
|
-
reasoningTokens:
|
|
6902
|
+
var ManagedTurnUsageSchema = z47.object({
|
|
6903
|
+
inputTokens: z47.number().int().nonnegative(),
|
|
6904
|
+
outputTokens: z47.number().int().nonnegative(),
|
|
6905
|
+
totalTokens: z47.number().int().nonnegative(),
|
|
6906
|
+
cacheReadTokens: z47.number().int().nonnegative().nullable(),
|
|
6907
|
+
cacheWriteTokens: z47.number().int().nonnegative().nullable(),
|
|
6908
|
+
reasoningTokens: z47.number().int().nonnegative().nullable()
|
|
6487
6909
|
}).strict().superRefine((usage, ctx) => {
|
|
6488
6910
|
if (usage.totalTokens !== usage.inputTokens + usage.outputTokens)
|
|
6489
6911
|
ctx.addIssue({ code: "custom", message: "Total tokens must equal input plus output" });
|
|
@@ -6492,14 +6914,14 @@ var ManagedTurnUsageSchema = z46.object({
|
|
|
6492
6914
|
if ((usage.reasoningTokens ?? 0) > usage.outputTokens)
|
|
6493
6915
|
ctx.addIssue({ code: "custom", message: "Reasoning cannot exceed output" });
|
|
6494
6916
|
});
|
|
6495
|
-
var TurnAttributionStampSchema =
|
|
6496
|
-
recordVersion:
|
|
6917
|
+
var TurnAttributionStampSchema = z47.object({
|
|
6918
|
+
recordVersion: z47.literal(TURN_ATTRIBUTION_RECORD_VERSION),
|
|
6497
6919
|
identity: TurnAttributionIdentitySchema,
|
|
6498
6920
|
attribution: PinnedTurnAttributionSchema
|
|
6499
6921
|
}).strict();
|
|
6500
6922
|
|
|
6501
6923
|
// ../../packages/shared/dist/schemas/user-skills.schemas.js
|
|
6502
|
-
import { z as
|
|
6924
|
+
import { z as z48 } from "zod";
|
|
6503
6925
|
import { parseDocument } from "yaml";
|
|
6504
6926
|
var USER_SKILL_LIMITS = {
|
|
6505
6927
|
files: 20,
|
|
@@ -6510,18 +6932,18 @@ var USER_SKILL_LIMITS = {
|
|
|
6510
6932
|
assignedFiles: 100
|
|
6511
6933
|
};
|
|
6512
6934
|
var bytes = (value) => new TextEncoder().encode(value).length;
|
|
6513
|
-
var UserSkillPathSchema =
|
|
6935
|
+
var UserSkillPathSchema = z48.string().min(1).max(240).refine((path3) => {
|
|
6514
6936
|
const parts = path3.split("/");
|
|
6515
6937
|
return parts.length <= 8 && parts.every((part) => part && part !== "." && part !== ".." && bytes(part) <= 255 && !part.startsWith(".") && ![...part].some((c) => c === "\\" || c.charCodeAt(0) < 32 || c.charCodeAt(0) === 127)) && /\.(md|txt|json|yaml|yml)$/i.test(path3) && (path3 === "SKILL.md" || !parts.some((p) => p.toLowerCase() === "skill.md"));
|
|
6516
6938
|
}, "Use a relative text-file path; only the main SKILL.md entrypoint is allowed");
|
|
6517
|
-
var UserSkillFileSchema =
|
|
6939
|
+
var UserSkillFileSchema = z48.object({
|
|
6518
6940
|
path: UserSkillPathSchema,
|
|
6519
|
-
content:
|
|
6941
|
+
content: z48.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")
|
|
6520
6942
|
}).strict();
|
|
6521
|
-
var UserSkillDraftBundleSchema =
|
|
6522
|
-
name:
|
|
6523
|
-
description:
|
|
6524
|
-
files:
|
|
6943
|
+
var UserSkillDraftBundleSchema = z48.object({
|
|
6944
|
+
name: z48.string().trim().max(100),
|
|
6945
|
+
description: z48.string().trim().max(300),
|
|
6946
|
+
files: z48.array(UserSkillFileSchema).min(1).max(USER_SKILL_LIMITS.files)
|
|
6525
6947
|
}).strict().superRefine((bundle, ctx) => {
|
|
6526
6948
|
const paths = bundle.files.map((f) => f.path.toLowerCase());
|
|
6527
6949
|
if (new Set(paths).size !== paths.length || paths.some((p) => paths.some((other) => other.startsWith(p + "/"))))
|
|
@@ -6532,104 +6954,104 @@ var UserSkillDraftBundleSchema = z47.object({
|
|
|
6532
6954
|
if (bundle.files.reduce((total, f) => total + bytes(f.content), 0) > USER_SKILL_LIMITS.bytes)
|
|
6533
6955
|
ctx.addIssue({ code: "custom", message: "A skill can contain at most 1 MiB of text" });
|
|
6534
6956
|
});
|
|
6535
|
-
var UserSkillPinSchema =
|
|
6536
|
-
skillId:
|
|
6537
|
-
version:
|
|
6538
|
-
digest:
|
|
6957
|
+
var UserSkillPinSchema = z48.object({
|
|
6958
|
+
skillId: z48.string().uuid(),
|
|
6959
|
+
version: z48.number().int().positive(),
|
|
6960
|
+
digest: z48.string().regex(/^[a-f0-9]{64}$/)
|
|
6539
6961
|
}).strict();
|
|
6540
|
-
var UserSkillPinsSchema =
|
|
6541
|
-
var UserSkillIdSchema =
|
|
6962
|
+
var UserSkillPinsSchema = z48.array(UserSkillPinSchema).max(USER_SKILL_LIMITS.assigned);
|
|
6963
|
+
var UserSkillIdSchema = z48.object({ skillId: z48.string().uuid() });
|
|
6542
6964
|
var UserSkillDraftInputSchema = UserSkillIdSchema.extend({
|
|
6543
|
-
requestKey:
|
|
6544
|
-
expectedRevision:
|
|
6965
|
+
requestKey: z48.string().uuid(),
|
|
6966
|
+
expectedRevision: z48.number().int().nonnegative(),
|
|
6545
6967
|
bundle: UserSkillDraftBundleSchema
|
|
6546
6968
|
});
|
|
6547
6969
|
var UserSkillSaveVersionSchema = UserSkillIdSchema.extend({
|
|
6548
|
-
requestKey:
|
|
6549
|
-
expectedRevision:
|
|
6550
|
-
note:
|
|
6551
|
-
restoreVersion:
|
|
6970
|
+
requestKey: z48.string().uuid(),
|
|
6971
|
+
expectedRevision: z48.number().int().nonnegative(),
|
|
6972
|
+
note: z48.string().trim().max(500).default(""),
|
|
6973
|
+
restoreVersion: z48.number().int().positive().optional()
|
|
6552
6974
|
});
|
|
6553
6975
|
var UserSkillAssignSchema = UserSkillIdSchema.extend({
|
|
6554
|
-
requestKey:
|
|
6555
|
-
version:
|
|
6556
|
-
agents:
|
|
6976
|
+
requestKey: z48.string().uuid(),
|
|
6977
|
+
version: z48.number().int().positive().nullable(),
|
|
6978
|
+
agents: z48.array(z48.object({ agentId: z48.string().uuid(), expectedRevision: z48.number().int().nonnegative() })).min(1).max(100)
|
|
6557
6979
|
});
|
|
6558
6980
|
var UserSkillArchiveSchema = UserSkillIdSchema.extend({
|
|
6559
|
-
requestKey:
|
|
6560
|
-
expectedRevision:
|
|
6561
|
-
archived:
|
|
6562
|
-
removeAssignments:
|
|
6563
|
-
});
|
|
6564
|
-
var UserSkillSummarySchema =
|
|
6565
|
-
id:
|
|
6566
|
-
name:
|
|
6567
|
-
description:
|
|
6568
|
-
archived:
|
|
6569
|
-
latestVersion:
|
|
6570
|
-
revision:
|
|
6571
|
-
hasDraft:
|
|
6572
|
-
assignedCount:
|
|
6573
|
-
outdatedCount:
|
|
6574
|
-
updatedAt:
|
|
6575
|
-
});
|
|
6576
|
-
var UserSkillAgentSchema =
|
|
6577
|
-
agentId:
|
|
6578
|
-
name:
|
|
6579
|
-
managed:
|
|
6580
|
-
paused:
|
|
6581
|
-
working:
|
|
6582
|
-
revision:
|
|
6981
|
+
requestKey: z48.string().uuid(),
|
|
6982
|
+
expectedRevision: z48.number().int().nonnegative(),
|
|
6983
|
+
archived: z48.boolean(),
|
|
6984
|
+
removeAssignments: z48.boolean().default(false)
|
|
6985
|
+
});
|
|
6986
|
+
var UserSkillSummarySchema = z48.object({
|
|
6987
|
+
id: z48.string().uuid(),
|
|
6988
|
+
name: z48.string(),
|
|
6989
|
+
description: z48.string(),
|
|
6990
|
+
archived: z48.boolean(),
|
|
6991
|
+
latestVersion: z48.number().int(),
|
|
6992
|
+
revision: z48.number().int(),
|
|
6993
|
+
hasDraft: z48.boolean(),
|
|
6994
|
+
assignedCount: z48.number().int(),
|
|
6995
|
+
outdatedCount: z48.number().int(),
|
|
6996
|
+
updatedAt: z48.string()
|
|
6997
|
+
});
|
|
6998
|
+
var UserSkillAgentSchema = z48.object({
|
|
6999
|
+
agentId: z48.string().uuid(),
|
|
7000
|
+
name: z48.string(),
|
|
7001
|
+
managed: z48.boolean().optional(),
|
|
7002
|
+
paused: z48.boolean(),
|
|
7003
|
+
working: z48.boolean(),
|
|
7004
|
+
revision: z48.number().int(),
|
|
6583
7005
|
desired: UserSkillPinsSchema,
|
|
6584
7006
|
observed: UserSkillPinsSchema,
|
|
6585
|
-
state:
|
|
6586
|
-
errorCode:
|
|
6587
|
-
sessionId:
|
|
6588
|
-
});
|
|
6589
|
-
var UserSkillLibrarySchema =
|
|
6590
|
-
skills:
|
|
6591
|
-
agents:
|
|
6592
|
-
});
|
|
6593
|
-
var UserSkillVersionSchema =
|
|
6594
|
-
version:
|
|
6595
|
-
digest:
|
|
6596
|
-
name:
|
|
6597
|
-
description:
|
|
6598
|
-
bytes:
|
|
6599
|
-
fileCount:
|
|
6600
|
-
note:
|
|
6601
|
-
createdAt:
|
|
6602
|
-
});
|
|
6603
|
-
var UserSkillDetailSchema =
|
|
7007
|
+
state: z48.enum(["pending", "applying", "ready", "error"]),
|
|
7008
|
+
errorCode: z48.string().nullable(),
|
|
7009
|
+
sessionId: z48.string().nullable()
|
|
7010
|
+
});
|
|
7011
|
+
var UserSkillLibrarySchema = z48.object({
|
|
7012
|
+
skills: z48.array(UserSkillSummarySchema),
|
|
7013
|
+
agents: z48.array(UserSkillAgentSchema)
|
|
7014
|
+
});
|
|
7015
|
+
var UserSkillVersionSchema = z48.object({
|
|
7016
|
+
version: z48.number().int(),
|
|
7017
|
+
digest: z48.string(),
|
|
7018
|
+
name: z48.string(),
|
|
7019
|
+
description: z48.string(),
|
|
7020
|
+
bytes: z48.number().int(),
|
|
7021
|
+
fileCount: z48.number().int(),
|
|
7022
|
+
note: z48.string(),
|
|
7023
|
+
createdAt: z48.string()
|
|
7024
|
+
});
|
|
7025
|
+
var UserSkillDetailSchema = z48.object({
|
|
6604
7026
|
skill: UserSkillSummarySchema,
|
|
6605
7027
|
draft: UserSkillDraftBundleSchema.nullable(),
|
|
6606
|
-
versions:
|
|
6607
|
-
agents:
|
|
7028
|
+
versions: z48.array(UserSkillVersionSchema),
|
|
7029
|
+
agents: z48.array(UserSkillAgentSchema)
|
|
6608
7030
|
});
|
|
6609
7031
|
|
|
6610
7032
|
// ../../packages/shared/dist/schemas/managed-billing.schemas.js
|
|
6611
|
-
import { z as
|
|
6612
|
-
var id =
|
|
6613
|
-
var usd =
|
|
7033
|
+
import { z as z49 } from "zod";
|
|
7034
|
+
var id = z49.string().min(1).max(256);
|
|
7035
|
+
var usd = z49.string().regex(/^(0|[1-9]\d{0,9})(\.\d{1,6})?$/);
|
|
6614
7036
|
var SANDBOX_CONTAINER_SIZES = ["small", "medium", "large"];
|
|
6615
|
-
var ManagedCostPolicySchema =
|
|
7037
|
+
var ManagedCostPolicySchema = z49.object({
|
|
6616
7038
|
version: id,
|
|
6617
|
-
region:
|
|
7039
|
+
region: z49.enum(["global", "regional"]),
|
|
6618
7040
|
ownerDailyUsd: usd,
|
|
6619
7041
|
platformDailyUsd: usd,
|
|
6620
7042
|
computeReserveUsd: usd,
|
|
6621
7043
|
retainedResourceDailyUsd: usd,
|
|
6622
|
-
maxConcurrentOperations:
|
|
6623
|
-
maxUnresolvedOperations:
|
|
6624
|
-
maxUnresolvedAgeMs:
|
|
7044
|
+
maxConcurrentOperations: z49.number().int().min(1).max(64),
|
|
7045
|
+
maxUnresolvedOperations: z49.number().int().min(1).max(1e4),
|
|
7046
|
+
maxUnresolvedAgeMs: z49.number().int().min(6e4).max(6048e5),
|
|
6625
7047
|
/** Supplier invoice age advisory threshold; does not stop otherwise authorized work. */
|
|
6626
|
-
reconciliationMaxAgeMs:
|
|
7048
|
+
reconciliationMaxAgeMs: z49.number().int().min(6e4).max(6048e5),
|
|
6627
7049
|
/**
|
|
6628
7050
|
* The models this policy qualifies. Each must have a published supplier rate, which supplier
|
|
6629
7051
|
* exposure is reserved and settled from; a policy stored before a model was added still
|
|
6630
7052
|
* parses to exactly its stored JSON.
|
|
6631
7053
|
*/
|
|
6632
|
-
models:
|
|
7054
|
+
models: z49.array(z49.enum([
|
|
6633
7055
|
"gpt-5.6-luna",
|
|
6634
7056
|
"gpt-5.6-sol",
|
|
6635
7057
|
"gpt-6-astra",
|
|
@@ -6637,42 +7059,42 @@ var ManagedCostPolicySchema = z48.object({
|
|
|
6637
7059
|
"gpt-6-sol",
|
|
6638
7060
|
"gpt-6.1-sol"
|
|
6639
7061
|
])).min(1),
|
|
6640
|
-
nativeHelpersQualified:
|
|
7062
|
+
nativeHelpersQualified: z49.boolean(),
|
|
6641
7063
|
/** Explicit estimate for bounded native review processing/storage, including recovery. */
|
|
6642
|
-
nativeReviewProcessing:
|
|
7064
|
+
nativeReviewProcessing: z49.object({
|
|
6643
7065
|
usdPerRun: usd,
|
|
6644
|
-
qualificationEvidence:
|
|
7066
|
+
qualificationEvidence: z49.string().trim().min(1).max(256)
|
|
6645
7067
|
}).strict().optional(),
|
|
6646
7068
|
/** ADR-0283: direct evaluator calls require separately qualified, pinned rates and bounds. */
|
|
6647
|
-
nativeModels:
|
|
6648
|
-
provider:
|
|
7069
|
+
nativeModels: z49.array(z49.object({
|
|
7070
|
+
provider: z49.enum(["openai-responses", "typesafe"]),
|
|
6649
7071
|
rate: RoutingPublishedRateSchema,
|
|
6650
|
-
maxInputTokens:
|
|
6651
|
-
maxOutputTokens:
|
|
7072
|
+
maxInputTokens: z49.number().int().positive().max(262144),
|
|
7073
|
+
maxOutputTokens: z49.number().int().nonnegative().max(16e3),
|
|
6652
7074
|
/** Qualified upper bound for one 2048px review derivative, required for vision calls. */
|
|
6653
|
-
maxImageTokens:
|
|
6654
|
-
qualificationEvidence:
|
|
7075
|
+
maxImageTokens: z49.number().int().positive().max(262144).optional(),
|
|
7076
|
+
qualificationEvidence: z49.string().trim().min(1).max(256)
|
|
6655
7077
|
}).strict()).max(8).optional(),
|
|
6656
|
-
corrections:
|
|
6657
|
-
approvalEvidence:
|
|
7078
|
+
corrections: z49.enum(["manual", "refund_downward"]),
|
|
7079
|
+
approvalEvidence: z49.string().trim().min(1).max(256),
|
|
6658
7080
|
/**
|
|
6659
7081
|
* Hosted sandbox pricing terms. Optional, and deliberately without schema defaults: a policy
|
|
6660
7082
|
* stored before these terms existed must parse to exactly its stored JSON, or its immutable
|
|
6661
7083
|
* digest would no longer match. `managedSandboxTerms` supplies the defaults at use.
|
|
6662
7084
|
*/
|
|
6663
|
-
sandbox:
|
|
6664
|
-
memory:
|
|
6665
|
-
granularity:
|
|
7085
|
+
sandbox: z49.object({
|
|
7086
|
+
memory: z49.enum(SANDBOX_MEMORY_TIERS).optional(),
|
|
7087
|
+
granularity: z49.enum(SANDBOX_BILLING_GRANULARITIES).optional(),
|
|
6666
7088
|
/** Assumed provider deletion after activity and keep-alives stop; not configurable there. */
|
|
6667
|
-
idleExpiryMs:
|
|
7089
|
+
idleExpiryMs: z49.number().int().min(6e4).max(864e5).optional(),
|
|
6668
7090
|
/**
|
|
6669
7091
|
* The memory tier each container size is billed at (ADR-0192). Optional per size and
|
|
6670
7092
|
* without defaults, for the same digest reason; `managedSandboxTerms` supplies them.
|
|
6671
7093
|
*/
|
|
6672
|
-
sizes:
|
|
6673
|
-
small:
|
|
6674
|
-
medium:
|
|
6675
|
-
large:
|
|
7094
|
+
sizes: z49.object({
|
|
7095
|
+
small: z49.enum(SANDBOX_MEMORY_TIERS).optional(),
|
|
7096
|
+
medium: z49.enum(SANDBOX_MEMORY_TIERS).optional(),
|
|
7097
|
+
large: z49.enum(SANDBOX_MEMORY_TIERS).optional()
|
|
6676
7098
|
}).strict().optional()
|
|
6677
7099
|
}).strict().optional()
|
|
6678
7100
|
}).strict().refine((p) => usdToMicro(p.ownerDailyUsd) > 0n && usdToMicro(p.platformDailyUsd) > 0n && usdToMicro(p.computeReserveUsd) > 0n && usdToMicro(p.retainedResourceDailyUsd) > 0n, {
|
|
@@ -6682,11 +7104,11 @@ function usdToMicro(value) {
|
|
|
6682
7104
|
const [whole, fractional = ""] = usd.parse(value).split(".");
|
|
6683
7105
|
return BigInt(whole + fractional.padEnd(6, "0"));
|
|
6684
7106
|
}
|
|
6685
|
-
var ManagedTurnEvidenceSchema =
|
|
7107
|
+
var ManagedTurnEvidenceSchema = z49.object({
|
|
6686
7108
|
sessionId: id,
|
|
6687
7109
|
turnId: id,
|
|
6688
7110
|
subagentId: id.nullable(),
|
|
6689
|
-
status:
|
|
7111
|
+
status: z49.enum([
|
|
6690
7112
|
"completed",
|
|
6691
7113
|
"failed",
|
|
6692
7114
|
"cancelled",
|
|
@@ -6696,11 +7118,11 @@ var ManagedTurnEvidenceSchema = z48.object({
|
|
|
6696
7118
|
]),
|
|
6697
7119
|
usage: AllowanceReportedUsageSchema.nullable()
|
|
6698
7120
|
}).strict();
|
|
6699
|
-
var ManagedWorkEvidenceSchema =
|
|
7121
|
+
var ManagedWorkEvidenceSchema = z49.object({
|
|
6700
7122
|
sessionId: id,
|
|
6701
7123
|
rootTurnId: id,
|
|
6702
|
-
complete:
|
|
6703
|
-
turns:
|
|
7124
|
+
complete: z49.boolean(),
|
|
7125
|
+
turns: z49.array(ManagedTurnEvidenceSchema).min(1).max(2e3)
|
|
6704
7126
|
}).strict();
|
|
6705
7127
|
|
|
6706
7128
|
// ../../packages/shared/dist/schemas/taskmarket-mcp.schemas.js
|
|
@@ -6719,124 +7141,124 @@ var DIRECT_TOOL_GROUPS = [
|
|
|
6719
7141
|
"memory"
|
|
6720
7142
|
];
|
|
6721
7143
|
var DIRECT_TURN_RETRY_LIMIT = 1;
|
|
6722
|
-
var DirectRuntimeConfigurationSchema =
|
|
6723
|
-
platformToolsVersion:
|
|
6724
|
-
swarm:
|
|
6725
|
-
userSkills:
|
|
6726
|
-
integrations:
|
|
6727
|
-
taskmarketToolsVersion:
|
|
6728
|
-
integrationToolsVersion:
|
|
7144
|
+
var DirectRuntimeConfigurationSchema = z50.object({
|
|
7145
|
+
platformToolsVersion: z50.literal(1).optional(),
|
|
7146
|
+
swarm: z50.boolean(),
|
|
7147
|
+
userSkills: z50.object({ revision: z50.number().int().nonnegative(), pins: UserSkillPinsSchema }).optional(),
|
|
7148
|
+
integrations: z50.literal(true).optional(),
|
|
7149
|
+
taskmarketToolsVersion: z50.literal(1).optional(),
|
|
7150
|
+
integrationToolsVersion: z50.literal(2).optional(),
|
|
6729
7151
|
/**
|
|
6730
7152
|
* Memory tools and the memory contract (SM-20, SM-25); a new version replaces the session.
|
|
6731
7153
|
* 2: swarm writes (proposals under taint, SM-51) and `memory_search` history (SM-61).
|
|
6732
7154
|
*/
|
|
6733
|
-
memoryToolsVersion:
|
|
7155
|
+
memoryToolsVersion: z50.union([z50.literal(1), z50.literal(2)]).optional(),
|
|
6734
7156
|
/**
|
|
6735
7157
|
* The memory contract describes the core.md template (#726, MEMORY_CORE_TEMPLATE_ENABLED).
|
|
6736
7158
|
* Absent when off, so turning it on or off replaces the session like any contract change.
|
|
6737
7159
|
*/
|
|
6738
|
-
memoryCoreTemplate:
|
|
6739
|
-
nativeSubagents:
|
|
6740
|
-
inbox:
|
|
7160
|
+
memoryCoreTemplate: z50.literal(true).optional(),
|
|
7161
|
+
nativeSubagents: z50.literal(2).optional(),
|
|
7162
|
+
inbox: z50.literal(1).optional(),
|
|
6741
7163
|
/**
|
|
6742
7164
|
* The hosted container size the session is created with (ADR-0192). Absent on configurations
|
|
6743
7165
|
* written before sizes, whose sessions request none and run at the provider's medium default;
|
|
6744
7166
|
* a change of size replaces the session like any configuration change.
|
|
6745
7167
|
*/
|
|
6746
|
-
containerSize:
|
|
7168
|
+
containerSize: z50.enum(SANDBOX_CONTAINER_SIZES).optional(),
|
|
6747
7169
|
/**
|
|
6748
7170
|
* The session runs with no sandbox (ADR-0194): no shell, no files, and its first input sent
|
|
6749
7171
|
* with the create. Absent is a hosted sandbox, as every session had before; a change replaces
|
|
6750
7172
|
* the session like any configuration change.
|
|
6751
7173
|
*/
|
|
6752
|
-
workspace:
|
|
6753
|
-
profile:
|
|
6754
|
-
version:
|
|
6755
|
-
responsibility:
|
|
7174
|
+
workspace: z50.literal("none").optional(),
|
|
7175
|
+
profile: z50.object({
|
|
7176
|
+
version: z50.number().int().nonnegative(),
|
|
7177
|
+
responsibility: z50.string().max(500),
|
|
6756
7178
|
/**
|
|
6757
7179
|
* Standing instructions frozen into the session. Absent when memory tools are on (SM-24):
|
|
6758
7180
|
* they then reach the model through the pinned memory core, so editing them does not
|
|
6759
7181
|
* replace the session. Bounded by the memory document cap, their source of truth.
|
|
6760
7182
|
*/
|
|
6761
|
-
instructions:
|
|
7183
|
+
instructions: z50.string().max(65536).optional()
|
|
6762
7184
|
}).optional(),
|
|
6763
7185
|
/**
|
|
6764
7186
|
* Tool groups the session defers behind tool search, in `DIRECT_TOOL_GROUPS` order. Only groups
|
|
6765
7187
|
* the session actually has are listed, so deferring a group an agent does not use changes
|
|
6766
7188
|
* nothing for it; a change to the list replaces the session like any tool change.
|
|
6767
7189
|
*/
|
|
6768
|
-
deferredTools:
|
|
7190
|
+
deferredTools: z50.array(z50.enum(DIRECT_TOOL_GROUPS)).min(1).max(DIRECT_TOOL_GROUPS.length).optional(),
|
|
6769
7191
|
/**
|
|
6770
7192
|
* The session reaches the read-only Taskmarket MCP server (ADR-0207): the server URL
|
|
6771
7193
|
* and the vault its credential is in, both fixed when the session is created, and the tools it
|
|
6772
7194
|
* may call. Absent when not attached; a change replaces the session like any configuration
|
|
6773
7195
|
* change.
|
|
6774
7196
|
*/
|
|
6775
|
-
mcp:
|
|
6776
|
-
serverUrl:
|
|
6777
|
-
vaultId:
|
|
6778
|
-
tools:
|
|
7197
|
+
mcp: z50.object({
|
|
7198
|
+
serverUrl: z50.string().url().max(2048),
|
|
7199
|
+
vaultId: z50.string().min(1).max(256),
|
|
7200
|
+
tools: z50.array(z50.string().regex(/^[a-z][a-z0-9_]{0,63}$/)).min(1).max(16)
|
|
6779
7201
|
}).strict().optional()
|
|
6780
7202
|
});
|
|
6781
|
-
var DirectMcpCredentialSchema =
|
|
6782
|
-
vaultId:
|
|
7203
|
+
var DirectMcpCredentialSchema = z50.object({
|
|
7204
|
+
vaultId: z50.string().min(1).max(256),
|
|
6783
7205
|
/** The server URL the credential is bound to; the provider cannot change it in place. */
|
|
6784
|
-
serverUrl:
|
|
6785
|
-
credentialId:
|
|
6786
|
-
tokenId:
|
|
6787
|
-
tokenExpiresAt:
|
|
7206
|
+
serverUrl: z50.string().url().max(2048),
|
|
7207
|
+
credentialId: z50.string().min(1).max(256),
|
|
7208
|
+
tokenId: z50.string().uuid(),
|
|
7209
|
+
tokenExpiresAt: z50.string().datetime(),
|
|
6788
7210
|
/** What the current token may read: never more than the deployment allows the agent now. */
|
|
6789
|
-
scopes:
|
|
7211
|
+
scopes: z50.array(z50.enum(TASKMARKET_MCP_TOKEN_SCOPES)).min(1).max(TASKMARKET_MCP_TOKEN_SCOPES.length),
|
|
6790
7212
|
/** Tokens the credential held before, kept until their revocation is recorded. */
|
|
6791
|
-
retiring:
|
|
7213
|
+
retiring: z50.array(z50.string().uuid()).min(1).max(16).optional(),
|
|
6792
7214
|
/**
|
|
6793
7215
|
* MCP was turned off while a session that names the credential was kept: every token of the
|
|
6794
7216
|
* agent is revoked, and the credential holds none that works until a fresh one is rotated in.
|
|
6795
7217
|
*/
|
|
6796
|
-
suspended:
|
|
7218
|
+
suspended: z50.literal(true).optional()
|
|
6797
7219
|
}).strict();
|
|
6798
|
-
var DirectFunctionCallSchema =
|
|
6799
|
-
name:
|
|
6800
|
-
argumentHash:
|
|
6801
|
-
state:
|
|
6802
|
-
reply:
|
|
6803
|
-
success:
|
|
6804
|
-
output:
|
|
6805
|
-
error:
|
|
7220
|
+
var DirectFunctionCallSchema = z50.object({
|
|
7221
|
+
name: z50.string().min(1).max(100),
|
|
7222
|
+
argumentHash: z50.string().regex(/^[a-f0-9]{64}$/),
|
|
7223
|
+
state: z50.enum(["prepared", "executing", "answered"]),
|
|
7224
|
+
reply: z50.object({
|
|
7225
|
+
success: z50.boolean(),
|
|
7226
|
+
output: z50.string().max(131072).optional(),
|
|
7227
|
+
error: z50.string().max(512).optional()
|
|
6806
7228
|
}).optional()
|
|
6807
7229
|
});
|
|
6808
|
-
var DirectRouteSelectionSchema =
|
|
6809
|
-
operationId:
|
|
7230
|
+
var DirectRouteSelectionSchema = z50.object({
|
|
7231
|
+
operationId: z50.string().uuid(),
|
|
6810
7232
|
mechanism: RoutingMechanismSchema,
|
|
6811
7233
|
selected: ExecutorSettingsSchema,
|
|
6812
|
-
policyVersion:
|
|
6813
|
-
rateVersion:
|
|
7234
|
+
policyVersion: z50.string().min(1).max(200),
|
|
7235
|
+
rateVersion: z50.string().min(1).max(200)
|
|
6814
7236
|
}).strict();
|
|
6815
|
-
var DirectRouteConfirmationSchema =
|
|
7237
|
+
var DirectRouteConfirmationSchema = z50.object({
|
|
6816
7238
|
/** The routing operation whose selection this confirms, never another operation's. */
|
|
6817
|
-
operationId:
|
|
7239
|
+
operationId: z50.string().uuid(),
|
|
6818
7240
|
/** The job whose dispatch fence produced it. */
|
|
6819
|
-
jobId:
|
|
7241
|
+
jobId: z50.string(),
|
|
6820
7242
|
settings: ExecutorSettingsSchema,
|
|
6821
|
-
observedAt:
|
|
7243
|
+
observedAt: z50.string().datetime(),
|
|
6822
7244
|
/**
|
|
6823
7245
|
* Whether the same settings were still observed after the provider accepted the input.
|
|
6824
7246
|
*
|
|
6825
7247
|
* False is not a failure: it is the state between the confirming read and the verification,
|
|
6826
7248
|
* and the state a worker that crashed in that window resumes into.
|
|
6827
7249
|
*/
|
|
6828
|
-
verifiedAfterDispatch:
|
|
7250
|
+
verifiedAfterDispatch: z50.boolean()
|
|
6829
7251
|
}).strict();
|
|
6830
7252
|
var DIRECT_ROUTE_DISPATCH_BINDINGS = ["not_dispatched", "bound", "contested"];
|
|
6831
7253
|
var DirectPendingRouteSchema = DirectRouteSelectionSchema.extend({
|
|
6832
7254
|
/** The job this route was selected for. A route never travels to another job. */
|
|
6833
|
-
jobId:
|
|
6834
|
-
settingsPhase:
|
|
6835
|
-
requestedAt:
|
|
6836
|
-
confirmedAt:
|
|
7255
|
+
jobId: z50.string(),
|
|
7256
|
+
settingsPhase: z50.enum(ROUTING_SETTINGS_TRANSITION_STATES),
|
|
7257
|
+
requestedAt: z50.string().datetime().nullable(),
|
|
7258
|
+
confirmedAt: z50.string().datetime().nullable(),
|
|
6837
7259
|
/** Readback is evidence about the session, never a source of attribution. */
|
|
6838
|
-
readbackModelId:
|
|
6839
|
-
lostResponse:
|
|
7260
|
+
readbackModelId: z50.string().min(1).max(256).nullable(),
|
|
7261
|
+
lostResponse: z50.boolean(),
|
|
6840
7262
|
/**
|
|
6841
7263
|
* SPEC-0018 R3.4. How far this job's input binding got.
|
|
6842
7264
|
*
|
|
@@ -6844,27 +7266,27 @@ var DirectPendingRouteSchema = DirectRouteSelectionSchema.extend({
|
|
|
6844
7266
|
* `not_dispatched` -- the honest reading of a record that predates the check -- instead of
|
|
6845
7267
|
* decoding as a binding nobody verified.
|
|
6846
7268
|
*/
|
|
6847
|
-
dispatchBinding:
|
|
7269
|
+
dispatchBinding: z50.enum(DIRECT_ROUTE_DISPATCH_BINDINGS).default("not_dispatched")
|
|
6848
7270
|
}).strict();
|
|
6849
|
-
var DirectUsageOperationSchema =
|
|
6850
|
-
operationId:
|
|
6851
|
-
purpose:
|
|
6852
|
-
tokenCeiling:
|
|
6853
|
-
turnId:
|
|
6854
|
-
phase:
|
|
6855
|
-
billingBaseline:
|
|
7271
|
+
var DirectUsageOperationSchema = z50.object({
|
|
7272
|
+
operationId: z50.string().min(1).max(200),
|
|
7273
|
+
purpose: z50.enum(["work", "maintenance", "retry"]),
|
|
7274
|
+
tokenCeiling: z50.number().int().positive(),
|
|
7275
|
+
turnId: z50.string().min(1).max(256).nullable(),
|
|
7276
|
+
phase: z50.enum(["reserving", "reserved", "dispatched", "settled", "unresolved"]),
|
|
7277
|
+
billingBaseline: z50.array(z50.string().min(1).max(256)).max(2e3).optional()
|
|
6856
7278
|
}).strict();
|
|
6857
|
-
var DirectProjectSnapshotSchema =
|
|
6858
|
-
id:
|
|
6859
|
-
key:
|
|
6860
|
-
sha256:
|
|
6861
|
-
sessionId:
|
|
6862
|
-
turnId:
|
|
6863
|
-
setupHash:
|
|
7279
|
+
var DirectProjectSnapshotSchema = z50.object({
|
|
7280
|
+
id: z50.string().regex(/^[a-f0-9]{64}$/),
|
|
7281
|
+
key: z50.string().max(512),
|
|
7282
|
+
sha256: z50.string().regex(/^[a-f0-9]{64}$/),
|
|
7283
|
+
sessionId: z50.string().min(1).max(256),
|
|
7284
|
+
turnId: z50.string().min(1).max(256),
|
|
7285
|
+
setupHash: z50.string().regex(/^[a-f0-9]{64}$/)
|
|
6864
7286
|
}).strict();
|
|
6865
|
-
var DirectPendingSchema =
|
|
6866
|
-
jobId:
|
|
6867
|
-
baseline:
|
|
7287
|
+
var DirectPendingSchema = z50.object({
|
|
7288
|
+
jobId: z50.string(),
|
|
7289
|
+
baseline: z50.array(z50.string()),
|
|
6868
7290
|
/**
|
|
6869
7291
|
* The run's dispatch-group identity, carried on every usage event this job writes.
|
|
6870
7292
|
*
|
|
@@ -6872,7 +7294,7 @@ var DirectPendingSchema = z49.object({
|
|
|
6872
7294
|
* holds live in `operations` below, one per turn. This stays because the out-of-band
|
|
6873
7295
|
* reconciler's stored observations are keyed on it, and renaming it would orphan them.
|
|
6874
7296
|
*/
|
|
6875
|
-
reservationId:
|
|
7297
|
+
reservationId: z50.string(),
|
|
6876
7298
|
/**
|
|
6877
7299
|
* SPEC-0015 M4.2. The metered model operations this job has taken, in dispatch order.
|
|
6878
7300
|
*
|
|
@@ -6884,27 +7306,27 @@ var DirectPendingSchema = z49.object({
|
|
|
6884
7306
|
* Bounded at four: a job dispatches at most one work turn and one checkpoint-maintenance
|
|
6885
7307
|
* turn, and the bound is what stops a recovery loop from growing the checkpoint.
|
|
6886
7308
|
*/
|
|
6887
|
-
operations:
|
|
6888
|
-
runId:
|
|
6889
|
-
phase:
|
|
6890
|
-
deadline:
|
|
7309
|
+
operations: z50.array(DirectUsageOperationSchema).max(4).optional(),
|
|
7310
|
+
runId: z50.string().uuid().optional(),
|
|
7311
|
+
phase: z50.enum(["creating", "preparing", "dispatching", "following"]).optional(),
|
|
7312
|
+
deadline: z50.number().optional(),
|
|
6891
7313
|
// Exact ordinary input, saved before dispatch. Legacy checkpoints cannot be replayed.
|
|
6892
|
-
dispatch:
|
|
6893
|
-
text:
|
|
6894
|
-
key:
|
|
6895
|
-
attempts:
|
|
6896
|
-
acknowledged:
|
|
6897
|
-
cancelled:
|
|
7314
|
+
dispatch: z50.object({
|
|
7315
|
+
text: z50.string(),
|
|
7316
|
+
key: z50.string(),
|
|
7317
|
+
attempts: z50.number().int().min(0).max(2),
|
|
7318
|
+
acknowledged: z50.boolean(),
|
|
7319
|
+
cancelled: z50.boolean()
|
|
6898
7320
|
}).optional(),
|
|
6899
|
-
turnId:
|
|
6900
|
-
creationInput:
|
|
7321
|
+
turnId: z50.string().optional(),
|
|
7322
|
+
creationInput: z50.boolean().optional(),
|
|
6901
7323
|
/**
|
|
6902
7324
|
* The skill files the session this job creates is sent (ADR-0203), saved before the
|
|
6903
7325
|
* create, so a create whose response is lost is recovered with them as its `skillBundle`.
|
|
6904
7326
|
*/
|
|
6905
|
-
skillBundle:
|
|
6906
|
-
docsHash:
|
|
6907
|
-
inventoryHash:
|
|
7327
|
+
skillBundle: z50.object({
|
|
7328
|
+
docsHash: z50.string().regex(/^[a-f0-9]{64}$/),
|
|
7329
|
+
inventoryHash: z50.string().regex(/^[a-f0-9]{64}$/)
|
|
6908
7330
|
}).strict().optional(),
|
|
6909
7331
|
// `contextRetry` (a context-overflow retry) and `memoryTainted` were removed; checkpoints
|
|
6910
7332
|
// that still carry them parse, and the unknown keys are dropped on the next save.
|
|
@@ -6913,18 +7335,18 @@ var DirectPendingSchema = z49.object({
|
|
|
6913
7335
|
* from that turn are added to it as they are seen, so `sessionUsage` stays current on every
|
|
6914
7336
|
* save and a resumed job never counts the same turn twice.
|
|
6915
7337
|
*/
|
|
6916
|
-
sessionItems:
|
|
6917
|
-
checkpointRepair:
|
|
6918
|
-
workTurnId:
|
|
6919
|
-
finalText:
|
|
6920
|
-
nativeTurnIds:
|
|
7338
|
+
sessionItems: z50.number().int().nonnegative().optional(),
|
|
7339
|
+
checkpointRepair: z50.object({
|
|
7340
|
+
workTurnId: z50.string().min(1),
|
|
7341
|
+
finalText: z50.string().min(1).max(65536),
|
|
7342
|
+
nativeTurnIds: z50.array(z50.string()).max(2e3).optional()
|
|
6921
7343
|
}).optional(),
|
|
6922
|
-
replies:
|
|
6923
|
-
success:
|
|
6924
|
-
output:
|
|
6925
|
-
error:
|
|
7344
|
+
replies: z50.record(z50.object({
|
|
7345
|
+
success: z50.boolean(),
|
|
7346
|
+
output: z50.string().optional(),
|
|
7347
|
+
error: z50.string().optional()
|
|
6926
7348
|
})).optional(),
|
|
6927
|
-
calls:
|
|
7349
|
+
calls: z50.record(DirectFunctionCallSchema).optional(),
|
|
6928
7350
|
/**
|
|
6929
7351
|
* SPEC-0018 R3.1. The route this job was dispatched under, and its transition phase.
|
|
6930
7352
|
* Absent on every unrouted job, which is every job until routing is enabled.
|
|
@@ -6935,36 +7357,36 @@ var DirectPendingSchema = z49.object({
|
|
|
6935
7357
|
* dispatching again. The retry's input is the original text under its own idempotency key
|
|
6936
7358
|
* and its own `retry` operation; `attempt` never exceeds DIRECT_TURN_RETRY_LIMIT.
|
|
6937
7359
|
*/
|
|
6938
|
-
retry:
|
|
6939
|
-
attempt:
|
|
6940
|
-
code:
|
|
6941
|
-
turnId:
|
|
7360
|
+
retry: z50.object({
|
|
7361
|
+
attempt: z50.number().int().min(1).max(DIRECT_TURN_RETRY_LIMIT),
|
|
7362
|
+
code: z50.string().min(1).max(100),
|
|
7363
|
+
turnId: z50.string().min(1).max(256)
|
|
6942
7364
|
}).strict().optional(),
|
|
6943
7365
|
/**
|
|
6944
7366
|
* Why the host itself cancelled this job's turn: its run bound expired, or its recovery
|
|
6945
7367
|
* deadline passed. A turn found cancelled with this set ended on the host's own limit, not on
|
|
6946
7368
|
* an owner or operator pause.
|
|
6947
7369
|
*/
|
|
6948
|
-
cancelledBy:
|
|
7370
|
+
cancelledBy: z50.enum(["run_bound", "deadline"]).optional(),
|
|
6949
7371
|
/**
|
|
6950
7372
|
* ADR-0204. The native helper call in this job's turn that asked for a model other
|
|
6951
7373
|
* than the one the turn was pinned to. The helper model guard cancelled the turn on seeing it,
|
|
6952
7374
|
* so the turn ends the job with `DIRECT_HELPER_MODEL_REFUSED`, and the helper turns observed
|
|
6953
7375
|
* under it are attributed to the requested model rather than inherited from the root turn.
|
|
6954
7376
|
*/
|
|
6955
|
-
helperModel:
|
|
6956
|
-
turnId:
|
|
6957
|
-
itemId:
|
|
6958
|
-
model:
|
|
6959
|
-
reasoningEffort:
|
|
6960
|
-
sessionModel:
|
|
7377
|
+
helperModel: z50.object({
|
|
7378
|
+
turnId: z50.string().min(1).max(256),
|
|
7379
|
+
itemId: z50.string().min(1).max(256),
|
|
7380
|
+
model: z50.string().min(1).max(256),
|
|
7381
|
+
reasoningEffort: z50.string().min(1).max(64).nullable(),
|
|
7382
|
+
sessionModel: z50.string().min(1).max(256)
|
|
6961
7383
|
}).strict().optional(),
|
|
6962
7384
|
/**
|
|
6963
7385
|
* ADR-0196 (Accepted). This job's turns run on the flex service tier. Chosen once per run and
|
|
6964
7386
|
* kept here, so a resumed attempt dispatches on the same tier under the same idempotency key.
|
|
6965
7387
|
* Absent is the default tier.
|
|
6966
7388
|
*/
|
|
6967
|
-
serviceTier:
|
|
7389
|
+
serviceTier: z50.literal("flex").optional(),
|
|
6968
7390
|
/**
|
|
6969
7391
|
* ADR-0200. The wall-clock bound of the turn being followed when the worker may
|
|
6970
7392
|
* release its slot while the model works: set at each dispatch, in epoch milliseconds. A bound
|
|
@@ -6973,18 +7395,18 @@ var DirectPendingSchema = z49.object({
|
|
|
6973
7395
|
* `deadline` keeps its meaning (the latest the dispatch was made), which the unbought proof's
|
|
6974
7396
|
* bracket depends on.
|
|
6975
7397
|
*/
|
|
6976
|
-
turnDeadline:
|
|
7398
|
+
turnDeadline: z50.number().int().positive().optional(),
|
|
6977
7399
|
/**
|
|
6978
7400
|
* ADR-0200. This job's run released its worker slot while its turn ran: how many
|
|
6979
7401
|
* times, and when last. A later claim resumes it through the ordinary recovery path, which
|
|
6980
7402
|
* does not announce again the items of the turn listed in `announced`, nor record its usage
|
|
6981
7403
|
* again while it still reads as `usageHash`.
|
|
6982
7404
|
*/
|
|
6983
|
-
parked:
|
|
6984
|
-
count:
|
|
6985
|
-
at:
|
|
6986
|
-
announced:
|
|
6987
|
-
usageHash:
|
|
7405
|
+
parked: z50.object({
|
|
7406
|
+
count: z50.number().int().min(1),
|
|
7407
|
+
at: z50.string().datetime(),
|
|
7408
|
+
announced: z50.array(z50.string().min(1).max(512)).max(DIRECT_PARKED_ANNOUNCED_MAX).optional(),
|
|
7409
|
+
usageHash: z50.string().regex(/^[a-f0-9]{64}$/).optional()
|
|
6988
7410
|
}).strict().optional()
|
|
6989
7411
|
}).superRefine((pending, ctx) => {
|
|
6990
7412
|
if (pending.route && pending.route.jobId !== pending.jobId)
|
|
@@ -6995,48 +7417,48 @@ var DirectPendingSchema = z49.object({
|
|
|
6995
7417
|
});
|
|
6996
7418
|
});
|
|
6997
7419
|
var DIRECT_DETACHED_MAX = 8;
|
|
6998
|
-
var DirectDetachedSessionSchema =
|
|
7420
|
+
var DirectDetachedSessionSchema = z50.object({
|
|
6999
7421
|
/** The provider session, or null when the job was still creating it. */
|
|
7000
|
-
sessionId:
|
|
7422
|
+
sessionId: z50.string().min(1).max(256).nullable(),
|
|
7001
7423
|
/** The reset request this entry was detached under. */
|
|
7002
|
-
resetVersion:
|
|
7003
|
-
detachedAt:
|
|
7424
|
+
resetVersion: z50.number().int().positive(),
|
|
7425
|
+
detachedAt: z50.string().datetime(),
|
|
7004
7426
|
/** The session's model and tier when it was detached, for the settlement record. */
|
|
7005
|
-
model:
|
|
7006
|
-
tier:
|
|
7427
|
+
model: z50.string(),
|
|
7428
|
+
tier: z50.object({
|
|
7007
7429
|
tier: AgentTierSchema,
|
|
7008
|
-
mappingVersion:
|
|
7009
|
-
reasoningEffort:
|
|
7430
|
+
mappingVersion: z50.string().min(1).max(200),
|
|
7431
|
+
reasoningEffort: z50.enum(EXECUTOR_REASONING_EFFORTS).optional()
|
|
7010
7432
|
}).optional(),
|
|
7011
7433
|
/** The pending block exactly as the job left it: its run, operations, baseline and deadline. */
|
|
7012
7434
|
pending: DirectPendingSchema.nullable(),
|
|
7013
7435
|
/** A cancellation was sent to the session for the job's turn. Never sent twice. */
|
|
7014
|
-
cancelRequested:
|
|
7436
|
+
cancelRequested: z50.boolean().optional(),
|
|
7015
7437
|
/**
|
|
7016
7438
|
* Sessions the checkpoint had retired when this entry was detached. A job still `creating`
|
|
7017
7439
|
* may have replaced one of them earlier in the same job, so it carries the job's metadata
|
|
7018
7440
|
* too; settlement never adopts one as the session its lost create made. Optional: entries
|
|
7019
7441
|
* detached before it was recorded exclude nothing more than they did.
|
|
7020
7442
|
*/
|
|
7021
|
-
excludedSessions:
|
|
7443
|
+
excludedSessions: z50.array(z50.string().min(1).max(256)).max(100).optional(),
|
|
7022
7444
|
/** Why the last settlement attempt left the entry in place, for the operator. */
|
|
7023
|
-
unresolved:
|
|
7445
|
+
unresolved: z50.object({ reason: z50.string().min(1).max(100), at: z50.string().datetime() }).optional(),
|
|
7024
7446
|
/** Settlement attempts that left the entry in place, which sets the backoff below. */
|
|
7025
|
-
attempts:
|
|
7447
|
+
attempts: z50.number().int().nonnegative().optional(),
|
|
7026
7448
|
/** No settlement attempt is made before this: a stuck entry is not re-read every tick. */
|
|
7027
|
-
retryAt:
|
|
7449
|
+
retryAt: z50.string().datetime().optional(),
|
|
7028
7450
|
/**
|
|
7029
7451
|
* Every operation of the entry is closed, and only the provider deletion of its session is
|
|
7030
7452
|
* still owed. Set only on a checkpoint with no `project` block, which has no
|
|
7031
7453
|
* `sessionsToDelete` to put the session on; the session sweeper deletes the session under its
|
|
7032
7454
|
* usual evidence gates and then drops the entry.
|
|
7033
7455
|
*/
|
|
7034
|
-
settledAt:
|
|
7456
|
+
settledAt: z50.string().datetime().optional()
|
|
7035
7457
|
}).strict();
|
|
7036
|
-
var DirectAgentCheckpointSchema =
|
|
7037
|
-
kind:
|
|
7038
|
-
sessionId:
|
|
7039
|
-
model:
|
|
7458
|
+
var DirectAgentCheckpointSchema = z50.object({
|
|
7459
|
+
kind: z50.literal("openai-preview-v1"),
|
|
7460
|
+
sessionId: z50.string().nullable(),
|
|
7461
|
+
model: z50.string(),
|
|
7040
7462
|
/**
|
|
7041
7463
|
* The capability tier and tier-mapping version the current `model` was resolved from, and the
|
|
7042
7464
|
* reasoning effort that mapping set, if any. Session-scoped like `model`. A later job whose
|
|
@@ -7045,25 +7467,25 @@ var DirectAgentCheckpointSchema = z49.object({
|
|
|
7045
7467
|
* updates the live one. Absent on checkpoints written before tiers, which ran as light on the
|
|
7046
7468
|
* managed default settings.
|
|
7047
7469
|
*/
|
|
7048
|
-
tier:
|
|
7470
|
+
tier: z50.object({
|
|
7049
7471
|
tier: AgentTierSchema,
|
|
7050
|
-
mappingVersion:
|
|
7051
|
-
reasoningEffort:
|
|
7472
|
+
mappingVersion: z50.string().min(1).max(200),
|
|
7473
|
+
reasoningEffort: z50.enum(EXECUTOR_REASONING_EFFORTS).optional()
|
|
7052
7474
|
}).optional(),
|
|
7053
7475
|
/**
|
|
7054
7476
|
* ADR-0196 (Accepted). The live session runs on the flex service tier. Session-scoped like
|
|
7055
7477
|
* `model`; absent is the managed default tier.
|
|
7056
7478
|
*/
|
|
7057
|
-
serviceTier:
|
|
7479
|
+
serviceTier: z50.literal("flex").optional(),
|
|
7058
7480
|
/**
|
|
7059
7481
|
* ADR-0196 (Accepted). A flex turn the provider could not serve paused flex for this agent: no
|
|
7060
7482
|
* job selects flex before `until`, and the job that fell back never does.
|
|
7061
7483
|
*/
|
|
7062
|
-
flexUnavailable:
|
|
7063
|
-
networkAccess:
|
|
7064
|
-
toolProfile:
|
|
7484
|
+
flexUnavailable: z50.object({ until: z50.string().datetime(), jobId: z50.string().min(1) }).strict().optional(),
|
|
7485
|
+
networkAccess: z50.enum(["disabled", "enabled"]).optional(),
|
|
7486
|
+
toolProfile: z50.enum(["base", "purchases-v1"]).optional(),
|
|
7065
7487
|
configuration: DirectRuntimeConfigurationSchema.optional(),
|
|
7066
|
-
helperUsageHashes:
|
|
7488
|
+
helperUsageHashes: z50.record(z50.string().regex(/^[a-f0-9]{64}$/)).optional(),
|
|
7067
7489
|
/**
|
|
7068
7490
|
* SPEC-0018 R2.5. Attribution pinned at dispatch, per turn. Optional so existing checkpoints
|
|
7069
7491
|
* still decode; an absent ledger means the turn is unattributed, never that the session's
|
|
@@ -7093,10 +7515,10 @@ var DirectAgentCheckpointSchema = z49.object({
|
|
|
7093
7515
|
* because a confirmation is only worth anything for the dispatch it immediately preceded.
|
|
7094
7516
|
*/
|
|
7095
7517
|
routeConfirmation: DirectRouteConfirmationSchema.optional(),
|
|
7096
|
-
purchaseOperations:
|
|
7097
|
-
operationId:
|
|
7098
|
-
jobId:
|
|
7099
|
-
financialPhase:
|
|
7518
|
+
purchaseOperations: z50.array(z50.object({
|
|
7519
|
+
operationId: z50.string().uuid(),
|
|
7520
|
+
jobId: z50.string(),
|
|
7521
|
+
financialPhase: z50.enum([
|
|
7100
7522
|
"not_started",
|
|
7101
7523
|
"pending",
|
|
7102
7524
|
"unknown",
|
|
@@ -7104,21 +7526,21 @@ var DirectAgentCheckpointSchema = z49.object({
|
|
|
7104
7526
|
"released",
|
|
7105
7527
|
"failed"
|
|
7106
7528
|
]),
|
|
7107
|
-
resultStatus:
|
|
7529
|
+
resultStatus: z50.enum(["pending", "received", "failed"])
|
|
7108
7530
|
})).max(64).optional(),
|
|
7109
7531
|
/**
|
|
7110
7532
|
* The pinned memory core last sent into this session (SM-21): the combined pinned version and
|
|
7111
7533
|
* the session it was sent to. The core is sent again when its version moves or the session
|
|
7112
7534
|
* changes, and never on a turn where both are unchanged.
|
|
7113
7535
|
*/
|
|
7114
|
-
memoryInjectedVersion:
|
|
7536
|
+
memoryInjectedVersion: z50.object({ sessionId: z50.string().min(1).max(256), version: z50.string().min(1).max(64) }).optional(),
|
|
7115
7537
|
/**
|
|
7116
7538
|
* The owner's forget count (#714, `hosted_agents.memory_forget_version`) the session was created
|
|
7117
7539
|
* under. A higher count at the start of a later job means memory this session may hold was
|
|
7118
7540
|
* forgotten since, and the job moves the agent to a new session (`memory_forgotten`). Absent for
|
|
7119
7541
|
* a session created before it was recorded, which then counts as created under 0.
|
|
7120
7542
|
*/
|
|
7121
|
-
memoryForgetVersion:
|
|
7543
|
+
memoryForgetVersion: z50.object({ sessionId: z50.string().min(1).max(256), version: z50.number().int().nonnegative() }).optional(),
|
|
7122
7544
|
// `memoryTaintedSessionId` (session-wide pinned taint) was removed; checkpoints that still carry
|
|
7123
7545
|
// it parse, and the unknown key is dropped on the next save.
|
|
7124
7546
|
/**
|
|
@@ -7127,10 +7549,10 @@ var DirectAgentCheckpointSchema = z49.object({
|
|
|
7127
7549
|
* no reset code. The next job rolls over once it passes the threshold (never above the per-turn
|
|
7128
7550
|
* scan cap), or when the session ran out of context.
|
|
7129
7551
|
*/
|
|
7130
|
-
sessionUsage:
|
|
7131
|
-
sessionId:
|
|
7132
|
-
items:
|
|
7133
|
-
contextExceeded:
|
|
7552
|
+
sessionUsage: z50.object({
|
|
7553
|
+
sessionId: z50.string().min(1).max(256),
|
|
7554
|
+
items: z50.number().int().nonnegative(),
|
|
7555
|
+
contextExceeded: z50.boolean().optional(),
|
|
7134
7556
|
/**
|
|
7135
7557
|
* The provider refused this session further work: a safety system blocked its conversation
|
|
7136
7558
|
* (`policy_blocked`) or it reached its usage budget (`session_budget`). Or the host refused a
|
|
@@ -7138,7 +7560,7 @@ var DirectAgentCheckpointSchema = z49.object({
|
|
|
7138
7560
|
* stays open in it. The next job starts a new session with this as the rollover reason, the
|
|
7139
7561
|
* way `contextExceeded` does.
|
|
7140
7562
|
*/
|
|
7141
|
-
retire:
|
|
7563
|
+
retire: z50.enum(["policy_blocked", "session_budget", "helper_model"]).optional()
|
|
7142
7564
|
}).optional(),
|
|
7143
7565
|
/**
|
|
7144
7566
|
* The live session the idle sweeper deleted at the provider (parked) after the agent's last job
|
|
@@ -7147,16 +7569,16 @@ var DirectAgentCheckpointSchema = z49.object({
|
|
|
7147
7569
|
* memory and recent episodes. That job records the rollover (reason `idle_parked`) and clears
|
|
7148
7570
|
* this. Optional, so a worker that predates parking drops it and still takes the same path.
|
|
7149
7571
|
*/
|
|
7150
|
-
parkedSession:
|
|
7151
|
-
sessionId:
|
|
7152
|
-
parkedAt:
|
|
7153
|
-
items:
|
|
7572
|
+
parkedSession: z50.object({
|
|
7573
|
+
sessionId: z50.string().min(1).max(256),
|
|
7574
|
+
parkedAt: z50.string().datetime(),
|
|
7575
|
+
items: z50.number().int().nonnegative()
|
|
7154
7576
|
}).optional(),
|
|
7155
7577
|
/**
|
|
7156
7578
|
* The agent asked for a workspace from a session with no sandbox (`request_workspace`,
|
|
7157
7579
|
* ADR-0194), so its sessions keep a sandbox from its next job on. Never cleared by the runtime.
|
|
7158
7580
|
*/
|
|
7159
|
-
workspaceRequested:
|
|
7581
|
+
workspaceRequested: z50.literal(true).optional(),
|
|
7160
7582
|
/**
|
|
7161
7583
|
* The agent's Taskmarket MCP credential (ADR-0207), kept across sessions. Cleared once
|
|
7162
7584
|
* a session without the server is created and the credential is retired.
|
|
@@ -7167,16 +7589,16 @@ var DirectAgentCheckpointSchema = z49.object({
|
|
|
7167
7589
|
* session starts with none, and a session created before it was recorded keeps the behaviour it
|
|
7168
7590
|
* had until it is replaced.
|
|
7169
7591
|
*/
|
|
7170
|
-
sandbox:
|
|
7171
|
-
sessionId:
|
|
7592
|
+
sandbox: z50.object({
|
|
7593
|
+
sessionId: z50.string().min(1).max(256),
|
|
7172
7594
|
/** The container size the session was created with; absent when it requested none. */
|
|
7173
|
-
requestedSize:
|
|
7595
|
+
requestedSize: z50.enum(SANDBOX_CONTAINER_SIZES).optional(),
|
|
7174
7596
|
/** The effective size the provider reports for it, or null while it reports none. */
|
|
7175
|
-
reportedSize:
|
|
7597
|
+
reportedSize: z50.enum(SANDBOX_CONTAINER_SIZES).nullable().optional(),
|
|
7176
7598
|
/** The session was created with the identity sentinel's setup command. */
|
|
7177
|
-
sentinel:
|
|
7599
|
+
sentinel: z50.literal(true).optional(),
|
|
7178
7600
|
/** The sentinel's file name in the sandbox the session's work is known to be on. */
|
|
7179
|
-
identity:
|
|
7601
|
+
identity: z50.string().uuid().optional()
|
|
7180
7602
|
}).optional(),
|
|
7181
7603
|
/**
|
|
7182
7604
|
* The platform skill files the current session was created with (ADR-0203): what they
|
|
@@ -7185,114 +7607,114 @@ var DirectAgentCheckpointSchema = z49.object({
|
|
|
7185
7607
|
* by session, so a session created before it was recorded is checked against the deployed bundle,
|
|
7186
7608
|
* as before. A session with no sandbox has none.
|
|
7187
7609
|
*/
|
|
7188
|
-
skillBundle:
|
|
7189
|
-
sessionId:
|
|
7190
|
-
docsHash:
|
|
7191
|
-
inventoryHash:
|
|
7610
|
+
skillBundle: z50.object({
|
|
7611
|
+
sessionId: z50.string().min(1).max(256),
|
|
7612
|
+
docsHash: z50.string().regex(/^[a-f0-9]{64}$/),
|
|
7613
|
+
inventoryHash: z50.string().regex(/^[a-f0-9]{64}$/)
|
|
7192
7614
|
}).optional(),
|
|
7193
7615
|
/**
|
|
7194
7616
|
* The owner's session reset (`hosted_agents.session_reset_version`) this checkpoint has handled.
|
|
7195
7617
|
* A higher version on the agent means the next job, or the session sweeper, detaches the
|
|
7196
7618
|
* current session and any pending job into `detached` and the agent starts a new session.
|
|
7197
7619
|
*/
|
|
7198
|
-
sessionReset:
|
|
7620
|
+
sessionReset: z50.object({ version: z50.number().int().nonnegative(), at: z50.string().datetime() }).optional(),
|
|
7199
7621
|
/** Sessions a reset detached that are not settled yet (see `DirectDetachedSessionSchema`). */
|
|
7200
|
-
detached:
|
|
7201
|
-
turns:
|
|
7202
|
-
expiresAt:
|
|
7203
|
-
persistent:
|
|
7204
|
-
project:
|
|
7205
|
-
version:
|
|
7206
|
-
setupHash:
|
|
7622
|
+
detached: z50.array(DirectDetachedSessionSchema).max(DIRECT_DETACHED_MAX).optional(),
|
|
7623
|
+
turns: z50.number().int().nonnegative(),
|
|
7624
|
+
expiresAt: z50.number(),
|
|
7625
|
+
persistent: z50.boolean().optional(),
|
|
7626
|
+
project: z50.object({
|
|
7627
|
+
version: z50.literal(1),
|
|
7628
|
+
setupHash: z50.string().regex(/^[a-f0-9]{64}$/),
|
|
7207
7629
|
snapshot: DirectProjectSnapshotSchema.nullable(),
|
|
7208
|
-
restoring:
|
|
7209
|
-
restoreSetupHash:
|
|
7630
|
+
restoring: z50.boolean().default(false),
|
|
7631
|
+
restoreSetupHash: z50.string().regex(/^[a-f0-9]{64}$/).optional(),
|
|
7210
7632
|
restoreConfiguration: DirectRuntimeConfigurationSchema.optional(),
|
|
7211
7633
|
// `contextPending` and `context` (conversation excerpts) were removed by SM-35; checkpoints
|
|
7212
7634
|
// that still carry them parse, and the unknown keys are dropped on the next save.
|
|
7213
7635
|
/** Recent retired session ids, newest last (at most DIRECT_RETIRED_SESSIONS_KEPT kept). */
|
|
7214
|
-
retiredSessions:
|
|
7636
|
+
retiredSessions: z50.array(z50.string().min(1).max(256)).max(100).default([]),
|
|
7215
7637
|
/**
|
|
7216
7638
|
* Retired sessions still to delete at the provider (SM-34). Absent in checkpoints written
|
|
7217
7639
|
* before deletion existed; those start from their `retiredSessions`.
|
|
7218
7640
|
*/
|
|
7219
|
-
sessionsToDelete:
|
|
7641
|
+
sessionsToDelete: z50.array(z50.string().min(1).max(256)).max(DIRECT_SESSIONS_TO_DELETE_MAX).optional()
|
|
7220
7642
|
}).optional(),
|
|
7221
7643
|
pending: DirectPendingSchema.nullable(),
|
|
7222
|
-
result:
|
|
7223
|
-
jobId:
|
|
7224
|
-
runId:
|
|
7225
|
-
text:
|
|
7226
|
-
errorCode:
|
|
7644
|
+
result: z50.object({
|
|
7645
|
+
jobId: z50.string(),
|
|
7646
|
+
runId: z50.string().uuid(),
|
|
7647
|
+
text: z50.string().max(65536),
|
|
7648
|
+
errorCode: z50.string().optional()
|
|
7227
7649
|
}).optional()
|
|
7228
7650
|
});
|
|
7229
7651
|
|
|
7230
7652
|
// ../../packages/shared/dist/schemas/swarm-wallet.schemas.js
|
|
7231
|
-
import { z as
|
|
7232
|
-
var SwarmWalletSetupSchema =
|
|
7653
|
+
import { z as z51 } from "zod";
|
|
7654
|
+
var SwarmWalletSetupSchema = z51.object({ requestKey: z51.string().uuid() }).strict();
|
|
7233
7655
|
var SwarmWalletBindSchema = SwarmWalletSetupSchema.extend({
|
|
7234
|
-
walletId:
|
|
7235
|
-
address:
|
|
7236
|
-
walletIndex:
|
|
7656
|
+
walletId: z51.string().regex(/^[A-Za-z0-9_-]{1,128}$/),
|
|
7657
|
+
address: z51.string().regex(/^0x[0-9a-fA-F]{40}$/),
|
|
7658
|
+
walletIndex: z51.number().int().min(1).max(1e6)
|
|
7237
7659
|
}).strict();
|
|
7238
|
-
var SwarmWalletStatusSchema =
|
|
7239
|
-
status:
|
|
7660
|
+
var SwarmWalletStatusSchema = z51.object({
|
|
7661
|
+
status: z51.enum([
|
|
7240
7662
|
"not_started",
|
|
7241
7663
|
"pending_binding",
|
|
7242
7664
|
"binding_unknown",
|
|
7243
7665
|
"binding_rejected",
|
|
7244
7666
|
"ready"
|
|
7245
7667
|
]),
|
|
7246
|
-
requestKey:
|
|
7247
|
-
verifiedAt:
|
|
7248
|
-
wallet:
|
|
7249
|
-
walletId:
|
|
7250
|
-
address:
|
|
7251
|
-
walletIndex:
|
|
7668
|
+
requestKey: z51.string().uuid().nullable(),
|
|
7669
|
+
verifiedAt: z51.string().datetime().nullable(),
|
|
7670
|
+
wallet: z51.object({
|
|
7671
|
+
walletId: z51.string(),
|
|
7672
|
+
address: z51.string().regex(/^0x[0-9a-f]{40}$/),
|
|
7673
|
+
walletIndex: z51.number().int().min(1),
|
|
7252
7674
|
chainId: SwarmChainIdSchema
|
|
7253
7675
|
}).nullable(),
|
|
7254
|
-
spendingEnabled:
|
|
7255
|
-
creationEnabled:
|
|
7676
|
+
spendingEnabled: z51.boolean(),
|
|
7677
|
+
creationEnabled: z51.literal(false)
|
|
7256
7678
|
});
|
|
7257
|
-
var SwarmWalletCandidateSchema =
|
|
7258
|
-
walletId:
|
|
7259
|
-
address:
|
|
7260
|
-
walletIndex:
|
|
7679
|
+
var SwarmWalletCandidateSchema = z51.object({
|
|
7680
|
+
walletId: z51.string().regex(/^[A-Za-z0-9_-]{1,128}$/),
|
|
7681
|
+
address: z51.string().regex(/^0x[0-9a-fA-F]{40}$/),
|
|
7682
|
+
walletIndex: z51.number().int().min(0).max(1e6)
|
|
7261
7683
|
}).strict();
|
|
7262
7684
|
var SwarmWalletCreationConfirmSchema = SwarmWalletSetupSchema.extend({
|
|
7263
|
-
attemptId:
|
|
7685
|
+
attemptId: z51.string().uuid(),
|
|
7264
7686
|
walletId: SwarmWalletCandidateSchema.shape.walletId,
|
|
7265
|
-
ownerConfirmed:
|
|
7687
|
+
ownerConfirmed: z51.literal(true)
|
|
7266
7688
|
}).strict();
|
|
7267
7689
|
var SwarmWalletCreationCompleteSchema = SwarmWalletSetupSchema.extend({
|
|
7268
|
-
attemptId:
|
|
7269
|
-
signature:
|
|
7690
|
+
attemptId: z51.string().uuid(),
|
|
7691
|
+
signature: z51.string().regex(/^0x[0-9a-fA-F]{130}$/)
|
|
7270
7692
|
}).strict();
|
|
7271
|
-
var SwarmWalletInventorySchema =
|
|
7693
|
+
var SwarmWalletInventorySchema = z51.object({
|
|
7272
7694
|
wallet: SwarmWalletStatusSchema,
|
|
7273
|
-
setup:
|
|
7274
|
-
requestKey:
|
|
7275
|
-
attemptId:
|
|
7276
|
-
stage:
|
|
7277
|
-
status:
|
|
7695
|
+
setup: z51.object({
|
|
7696
|
+
requestKey: z51.string().uuid(),
|
|
7697
|
+
attemptId: z51.string().uuid(),
|
|
7698
|
+
stage: z51.enum(["prerequisite", "dedicated"]),
|
|
7699
|
+
status: z51.enum(["creation_unknown", "candidate_selected", "completed"]),
|
|
7278
7700
|
candidate: SwarmWalletCandidateSchema.nullable(),
|
|
7279
|
-
challenge:
|
|
7701
|
+
challenge: z51.string().nullable()
|
|
7280
7702
|
}).nullable(),
|
|
7281
|
-
candidates:
|
|
7703
|
+
candidates: z51.array(SwarmWalletCandidateSchema)
|
|
7282
7704
|
});
|
|
7283
7705
|
var SwarmWalletCreationPreparedSchema = SwarmWalletInventorySchema.extend({
|
|
7284
|
-
creationGrant:
|
|
7706
|
+
creationGrant: z51.object({ attemptId: z51.string().uuid(), operation: z51.enum(["first", "additional"]) }).nullable()
|
|
7285
7707
|
});
|
|
7286
7708
|
var SwarmWalletSelectExistingSchema = SwarmWalletSetupSchema.extend({
|
|
7287
7709
|
walletId: SwarmWalletCandidateSchema.shape.walletId,
|
|
7288
|
-
ownerConfirmed:
|
|
7710
|
+
ownerConfirmed: z51.literal(true)
|
|
7289
7711
|
}).strict();
|
|
7290
7712
|
|
|
7291
7713
|
// ../../packages/shared/dist/schemas/swarm-consent.schemas.js
|
|
7292
|
-
import { z as
|
|
7714
|
+
import { z as z53 } from "zod";
|
|
7293
7715
|
|
|
7294
7716
|
// ../../packages/shared/dist/schemas/hosted-market.schemas.js
|
|
7295
|
-
import { z as
|
|
7717
|
+
import { z as z52 } from "zod";
|
|
7296
7718
|
var HOSTED_MARKET_READ_ACTIONS = [
|
|
7297
7719
|
"capabilities",
|
|
7298
7720
|
"list",
|
|
@@ -7347,12 +7769,12 @@ var HOSTED_MARKET_WRITE_ACTIONS = [
|
|
|
7347
7769
|
"uninvite",
|
|
7348
7770
|
"identity-register"
|
|
7349
7771
|
];
|
|
7350
|
-
var HostedMarketActionSchema =
|
|
7772
|
+
var HostedMarketActionSchema = z52.enum([
|
|
7351
7773
|
...HOSTED_MARKET_READ_ACTIONS,
|
|
7352
7774
|
...HOSTED_MARKET_WRITE_ACTIONS
|
|
7353
7775
|
]);
|
|
7354
|
-
var HostedMarketActionsSchema =
|
|
7355
|
-
var input =
|
|
7776
|
+
var HostedMarketActionsSchema = z52.array(HostedMarketActionSchema).max(64).refine((actions) => new Set(actions).size === actions.length, "Duplicate Taskmarket actions");
|
|
7777
|
+
var input = z52.record(z52.unknown()).default({}).refine((value) => {
|
|
7356
7778
|
try {
|
|
7357
7779
|
return new TextEncoder().encode(JSON.stringify(value)).byteLength <= 65536;
|
|
7358
7780
|
} catch {
|
|
@@ -7360,61 +7782,61 @@ var input = z51.record(z51.unknown()).default({}).refine((value) => {
|
|
|
7360
7782
|
}
|
|
7361
7783
|
}, "Taskmarket input is too large");
|
|
7362
7784
|
var HostedMarketToolInputSchemas = {
|
|
7363
|
-
taskmarket_read:
|
|
7364
|
-
taskmarket_execute:
|
|
7365
|
-
taskmarket_status:
|
|
7785
|
+
taskmarket_read: z52.object({ action: z52.enum(HOSTED_MARKET_READ_ACTIONS), input }).strict(),
|
|
7786
|
+
taskmarket_execute: z52.object({ action: z52.enum(HOSTED_MARKET_WRITE_ACTIONS), requestKey: z52.string().uuid(), input }).strict(),
|
|
7787
|
+
taskmarket_status: z52.object({ requestKey: z52.string().uuid() }).strict()
|
|
7366
7788
|
};
|
|
7367
|
-
var HostedMarketReadySchema =
|
|
7368
|
-
enabled:
|
|
7369
|
-
walletAddress:
|
|
7370
|
-
chainId:
|
|
7371
|
-
apiOrigin:
|
|
7789
|
+
var HostedMarketReadySchema = z52.object({
|
|
7790
|
+
enabled: z52.boolean(),
|
|
7791
|
+
walletAddress: z52.string().nullable(),
|
|
7792
|
+
chainId: z52.number().int().positive(),
|
|
7793
|
+
apiOrigin: z52.string().url(),
|
|
7372
7794
|
actions: HostedMarketActionsSchema,
|
|
7373
7795
|
/** False once the owner's consent window closed: free actions and reads still work. */
|
|
7374
|
-
signingWindowOpen:
|
|
7796
|
+
signingWindowOpen: z52.boolean().optional(),
|
|
7375
7797
|
/**
|
|
7376
7798
|
* ADR-0277. Present when standing free market access, or an exact consent's approved market
|
|
7377
7799
|
* actions, predate the market namespace rules: the listed actions are refused until the owner
|
|
7378
7800
|
* renews, as the note says.
|
|
7379
7801
|
*/
|
|
7380
|
-
marketAccess:
|
|
7381
|
-
needsRenewal:
|
|
7802
|
+
marketAccess: z52.object({
|
|
7803
|
+
needsRenewal: z52.literal(true),
|
|
7382
7804
|
renewalRequiredFor: HostedMarketActionsSchema,
|
|
7383
|
-
note:
|
|
7805
|
+
note: z52.string()
|
|
7384
7806
|
}).optional(),
|
|
7385
|
-
legalAccepted:
|
|
7386
|
-
legalRequired:
|
|
7387
|
-
blockers:
|
|
7807
|
+
legalAccepted: z52.boolean(),
|
|
7808
|
+
legalRequired: z52.boolean().optional(),
|
|
7809
|
+
blockers: z52.array(z52.string()),
|
|
7388
7810
|
budget: SwarmBudgetViewSchema.nullable()
|
|
7389
7811
|
});
|
|
7390
|
-
var HostedMarketApiOriginSchema =
|
|
7812
|
+
var HostedMarketApiOriginSchema = z52.string().url().refine((value) => {
|
|
7391
7813
|
const url = new URL(value);
|
|
7392
7814
|
return url.protocol === "https:" && !url.username && !url.password && !url.search && !url.hash && url.pathname === "/";
|
|
7393
7815
|
}, "Taskmarket requires an explicit HTTPS API origin");
|
|
7394
|
-
var HostedMarketEnvironmentSchema =
|
|
7395
|
-
LAUNCHER_AGENT_UI_ENABLED:
|
|
7396
|
-
LAUNCHER_TASKMARKET_ENABLED:
|
|
7397
|
-
TASKMARKET_API_URL:
|
|
7816
|
+
var HostedMarketEnvironmentSchema = z52.object({
|
|
7817
|
+
LAUNCHER_AGENT_UI_ENABLED: z52.enum(["true", "false"]).default("false").transform((value) => value === "true"),
|
|
7818
|
+
LAUNCHER_TASKMARKET_ENABLED: z52.enum(["true", "false"]).default("false").transform((value) => value === "true"),
|
|
7819
|
+
TASKMARKET_API_URL: z52.string().url().optional(),
|
|
7398
7820
|
/**
|
|
7399
7821
|
* ADR-0189. Market events relevant to a swarm wallet start `market` jobs for the
|
|
7400
7822
|
* responsible agent. Off by default; effective only with LAUNCHER_TASKMARKET_ENABLED.
|
|
7401
7823
|
*/
|
|
7402
|
-
AGENT_MARKET_WAKEUPS_ENABLED:
|
|
7824
|
+
AGENT_MARKET_WAKEUPS_ENABLED: z52.enum(["true", "false"]).default("false").transform((value) => value === "true"),
|
|
7403
7825
|
/** ADR-0284. Enable only after all consumer replicas understand pending wakeups. */
|
|
7404
|
-
AGENT_MARKET_WAKEUP_RETRIES_ENABLED:
|
|
7826
|
+
AGENT_MARKET_WAKEUP_RETRIES_ENABLED: z52.enum(["true", "false"]).default("false").transform((value) => value === "true")
|
|
7405
7827
|
});
|
|
7406
|
-
var HostedMarketDownloadSchema =
|
|
7407
|
-
kind:
|
|
7408
|
-
artifactId:
|
|
7409
|
-
fileName:
|
|
7410
|
-
sha256:
|
|
7411
|
-
bytes:
|
|
7828
|
+
var HostedMarketDownloadSchema = z52.object({
|
|
7829
|
+
kind: z52.literal("hosted_market_download"),
|
|
7830
|
+
artifactId: z52.string().uuid(),
|
|
7831
|
+
fileName: z52.string().min(1).max(255),
|
|
7832
|
+
sha256: z52.string().regex(/^[0-9a-f]{64}$/),
|
|
7833
|
+
bytes: z52.number().int().positive().max(5 * 1024 * 1024)
|
|
7412
7834
|
});
|
|
7413
7835
|
|
|
7414
7836
|
// ../../packages/shared/dist/schemas/swarm-consent.schemas.js
|
|
7415
7837
|
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.";
|
|
7416
7838
|
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.");
|
|
7417
|
-
var SwarmConsentTextVersionSchema =
|
|
7839
|
+
var SwarmConsentTextVersionSchema = z53.enum(SWARM_CONSENT_TEXT_VERSIONS);
|
|
7418
7840
|
var SWARM_MAINNET_CONSENT_TEXT = "I approve a new Base mainnet authorization period for the displayed wallet, signer, recipient and HTTPS merchant. Payments use real USDC. 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; they are the limits I set, and Taskmarket applies no other spending ceiling. 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.";
|
|
7419
7841
|
var SWARM_MAINNET_PILOT_CONSENT_TEXT = SWARM_MAINNET_CONSENT_TEXT.replace("Hosted purchases remain disabled until qualification is complete.", "I authorize my eligible hosted agents to make these purchases with real USDC, up to the limits I set, while pilot purchases are enabled and this approval is valid.");
|
|
7420
7842
|
var SWARM_MAINNET_YOLO_CONSENT_TEXT = "I turn on YOLO mode for the displayed Base mainnet shared wallet and signer until the displayed period end. My hosted agents may pay any x402 merchant and any recipient, with no further prompt, using real USDC. Each payment is at most the displayed per-purchase limit, and Privy enforces only that limit, the chain, the USDC contract, this wallet and the period. Taskmarket, not Privy, enforces the displayed rolling 24-hour and period limits and each agent budget. A prompt-injected agent can pay an attacker up to those limits; a compromise of the signer or Taskmarket can pay up to the per-purchase limit repeatedly until I revoke or the period ends, so the wallet balance is what is at risk. Taskmarket market actions are not included. Revocation stops new payments, but already signed authorizations may still settle for up to five minutes. Hosted purchases remain disabled until qualification is complete.";
|
|
@@ -7430,48 +7852,48 @@ var SWARM_TESTNET_FREE_MARKET_CONSENT_TEXT_V1 = SWARM_MAINNET_FREE_MARKET_CONSEN
|
|
|
7430
7852
|
var SWARM_MAINNET_FREE_MARKET_CONSENT_TEXT = `I let my hosted agents work the Taskmarket market with the displayed Base mainnet shared wallet and signer until I revoke or replace this approval: authenticated reads, and signing Taskmarket market action messages (those beginning taskmarket:market:), including claim, submit, forfeit, release, request revisions, reject a delivery and settle, and any market action Taskmarket adds later under the same terms. These signatures move USDC only as a task's own terms already committed, such as returning or forfeiting a stake or paying a reject fee from escrow. This approves no new payment of any kind: the wallet's policy allows only those message signatures, never a USDC authorization or a transaction. Submissions beyond a task's free allowance, task creation and any other paid action still need my separate approval. Revoking removes the signer from the wallet.`;
|
|
7431
7853
|
var SWARM_TESTNET_FREE_MARKET_CONSENT_TEXT = SWARM_MAINNET_FREE_MARKET_CONSENT_TEXT.replace("Base mainnet", "Base Sepolia testnet");
|
|
7432
7854
|
var SWARM_CONSENT_CATALOG_TIERS = ["curated", "verified"];
|
|
7433
|
-
var merchantCatalogTiers =
|
|
7434
|
-
var address =
|
|
7855
|
+
var merchantCatalogTiers = z53.array(z53.enum(SWARM_CONSENT_CATALOG_TIERS)).min(1).max(2).optional();
|
|
7856
|
+
var address = z53.string().regex(/^0x[0-9a-fA-F]{40}$/);
|
|
7435
7857
|
var purchaseAmount = SwarmUsdcAtomicAmountSchema.refine((value) => value !== "0");
|
|
7436
7858
|
var aggregateAmount = SwarmUsdcAtomicAmountSchema.refine((value) => value !== "0");
|
|
7437
|
-
var merchantOrigin =
|
|
7859
|
+
var merchantOrigin = z53.string().url().max(2048).refine((value) => {
|
|
7438
7860
|
const url = new URL(value);
|
|
7439
7861
|
return url.protocol === "https:" && url.origin === value;
|
|
7440
7862
|
}, "An HTTPS origin without a path or credentials is required");
|
|
7441
|
-
var SwarmConsentPrepareSchema =
|
|
7442
|
-
requestKey:
|
|
7443
|
-
previousConsentId:
|
|
7863
|
+
var SwarmConsentPrepareSchema = z53.object({
|
|
7864
|
+
requestKey: z53.string().uuid(),
|
|
7865
|
+
previousConsentId: z53.string().uuid().nullable(),
|
|
7444
7866
|
payee: address,
|
|
7445
7867
|
merchantOrigin,
|
|
7446
7868
|
// When present, consent approves merchantOrigin plus every active catalog origin in these tiers.
|
|
7447
7869
|
merchantCatalogTiers,
|
|
7448
7870
|
marketActions: HostedMarketActionsSchema.optional(),
|
|
7449
7871
|
/** ADR-0185: keep (or grant) standing free market actions on this consent's policy. */
|
|
7450
|
-
freeMarket:
|
|
7872
|
+
freeMarket: z53.literal(true).optional(),
|
|
7451
7873
|
maxPurchase: purchaseAmount,
|
|
7452
7874
|
rollingDay: aggregateAmount,
|
|
7453
7875
|
period: aggregateAmount
|
|
7454
7876
|
}).strict();
|
|
7455
|
-
var SwarmFreeMarketPrepareSchema =
|
|
7456
|
-
requestKey:
|
|
7457
|
-
previousConsentId:
|
|
7877
|
+
var SwarmFreeMarketPrepareSchema = z53.object({
|
|
7878
|
+
requestKey: z53.string().uuid(),
|
|
7879
|
+
previousConsentId: z53.string().uuid().nullable()
|
|
7458
7880
|
}).strict();
|
|
7459
7881
|
var SWARM_STANDING_PERIOD = "until_revoked";
|
|
7460
|
-
var SwarmYoloPrepareSchema =
|
|
7461
|
-
requestKey:
|
|
7462
|
-
previousConsentId:
|
|
7463
|
-
periodDays:
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7882
|
+
var SwarmYoloPrepareSchema = z53.object({
|
|
7883
|
+
requestKey: z53.string().uuid(),
|
|
7884
|
+
previousConsentId: z53.string().uuid().nullable(),
|
|
7885
|
+
periodDays: z53.union([
|
|
7886
|
+
z53.literal(1),
|
|
7887
|
+
z53.literal(7),
|
|
7888
|
+
z53.literal(30),
|
|
7889
|
+
z53.literal(SWARM_STANDING_PERIOD)
|
|
7468
7890
|
]),
|
|
7469
|
-
freeMarket:
|
|
7891
|
+
freeMarket: z53.literal(true).optional(),
|
|
7470
7892
|
maxPurchase: purchaseAmount,
|
|
7471
7893
|
rollingDay: aggregateAmount,
|
|
7472
7894
|
period: aggregateAmount
|
|
7473
7895
|
}).strict();
|
|
7474
|
-
var SwarmConsentIdSchema =
|
|
7896
|
+
var SwarmConsentIdSchema = z53.object({ consentId: z53.string().uuid() }).strict();
|
|
7475
7897
|
var SwarmLimitsLowerSchema = SwarmConsentIdSchema.extend({
|
|
7476
7898
|
maxPurchase: purchaseAmount,
|
|
7477
7899
|
rollingDay: aggregateAmount,
|
|
@@ -7480,9 +7902,9 @@ var SwarmLimitsLowerSchema = SwarmConsentIdSchema.extend({
|
|
|
7480
7902
|
var SwarmConsentConfirmSchema = SwarmConsentIdSchema.extend({
|
|
7481
7903
|
consentTextVersion: SwarmConsentTextVersionSchema
|
|
7482
7904
|
}).strict();
|
|
7483
|
-
var SwarmConsentSchema =
|
|
7484
|
-
id:
|
|
7485
|
-
status:
|
|
7905
|
+
var SwarmConsentSchema = z53.object({
|
|
7906
|
+
id: z53.string().uuid(),
|
|
7907
|
+
status: z53.enum([
|
|
7486
7908
|
"prepared",
|
|
7487
7909
|
"policy_unknown",
|
|
7488
7910
|
"policy_ready",
|
|
@@ -7491,121 +7913,121 @@ var SwarmConsentSchema = z52.object({
|
|
|
7491
7913
|
"revoked",
|
|
7492
7914
|
"expired"
|
|
7493
7915
|
]),
|
|
7494
|
-
requestKey:
|
|
7495
|
-
previousConsentId:
|
|
7496
|
-
wallet:
|
|
7497
|
-
terms:
|
|
7916
|
+
requestKey: z53.string().uuid(),
|
|
7917
|
+
previousConsentId: z53.string().uuid().nullable(),
|
|
7918
|
+
wallet: z53.object({ walletId: z53.string(), address, chainId: SwarmChainIdSchema }),
|
|
7919
|
+
terms: z53.object({
|
|
7498
7920
|
// Implements: ADR-0183. A YOLO consent has no pinned recipient or origin; it carries its
|
|
7499
7921
|
// `mode` and `periodEnd` (unix seconds) instead.
|
|
7500
7922
|
// ADR-0185: `market` is a free-market-only consent with no payment terms at all.
|
|
7501
|
-
mode:
|
|
7502
|
-
periodEnd:
|
|
7923
|
+
mode: z53.enum(["yolo", "market"]).optional(),
|
|
7924
|
+
periodEnd: z53.number().int().positive().optional(),
|
|
7503
7925
|
/** ADR-0212: a YOLO consent with no `periodEnd` that stands until revoked. */
|
|
7504
|
-
untilRevoked:
|
|
7926
|
+
untilRevoked: z53.literal(true).optional(),
|
|
7505
7927
|
payee: address.optional(),
|
|
7506
7928
|
merchantOrigin: merchantOrigin.optional(),
|
|
7507
7929
|
merchantCatalogTiers,
|
|
7508
7930
|
marketActions: HostedMarketActionsSchema.optional(),
|
|
7509
|
-
freeMarket:
|
|
7931
|
+
freeMarket: z53.literal(true).optional(),
|
|
7510
7932
|
maxPurchase: purchaseAmount.optional(),
|
|
7511
7933
|
rollingDay: aggregateAmount.optional(),
|
|
7512
7934
|
period: aggregateAmount.optional()
|
|
7513
7935
|
}),
|
|
7514
|
-
signerId:
|
|
7515
|
-
policyId:
|
|
7516
|
-
policyHash:
|
|
7936
|
+
signerId: z53.string(),
|
|
7937
|
+
policyId: z53.string().nullable(),
|
|
7938
|
+
policyHash: z53.string().nullable(),
|
|
7517
7939
|
consentTextVersion: SwarmConsentTextVersionSchema,
|
|
7518
|
-
issuedAt:
|
|
7519
|
-
consentText:
|
|
7520
|
-
issuanceExpiresAt:
|
|
7521
|
-
authorizationExpiresAt:
|
|
7522
|
-
providerRevocation:
|
|
7940
|
+
issuedAt: z53.string().datetime(),
|
|
7941
|
+
consentText: z53.string().min(1),
|
|
7942
|
+
issuanceExpiresAt: z53.string().datetime(),
|
|
7943
|
+
authorizationExpiresAt: z53.string().datetime(),
|
|
7944
|
+
providerRevocation: z53.enum(["not_requested", "pending", "confirmed"]),
|
|
7523
7945
|
/**
|
|
7524
7946
|
* ADR-0277. A market consent whose wallet policy predates the market namespace rules: standing
|
|
7525
7947
|
* free market actions, or an exact consent's approved actions, are refused until the owner renews it.
|
|
7526
7948
|
*/
|
|
7527
|
-
needsRenewal:
|
|
7528
|
-
spendingEnabled:
|
|
7529
|
-
});
|
|
7530
|
-
var SwarmYoloPurchaseSchema =
|
|
7531
|
-
operationId:
|
|
7532
|
-
agentId:
|
|
7533
|
-
agentName:
|
|
7534
|
-
origin:
|
|
7535
|
-
payTo:
|
|
7536
|
-
amount:
|
|
7537
|
-
phase:
|
|
7538
|
-
resultStatus:
|
|
7539
|
-
transactionHash:
|
|
7540
|
-
createdAt:
|
|
7541
|
-
});
|
|
7542
|
-
var SwarmSpendInputSchema =
|
|
7543
|
-
agentId:
|
|
7949
|
+
needsRenewal: z53.boolean().optional(),
|
|
7950
|
+
spendingEnabled: z53.boolean()
|
|
7951
|
+
});
|
|
7952
|
+
var SwarmYoloPurchaseSchema = z53.object({
|
|
7953
|
+
operationId: z53.string().uuid(),
|
|
7954
|
+
agentId: z53.string(),
|
|
7955
|
+
agentName: z53.string().nullable(),
|
|
7956
|
+
origin: z53.string(),
|
|
7957
|
+
payTo: z53.string().nullable(),
|
|
7958
|
+
amount: z53.string().nullable(),
|
|
7959
|
+
phase: z53.string(),
|
|
7960
|
+
resultStatus: z53.string().nullable(),
|
|
7961
|
+
transactionHash: z53.string().nullable(),
|
|
7962
|
+
createdAt: z53.string()
|
|
7963
|
+
});
|
|
7964
|
+
var SwarmSpendInputSchema = z53.object({
|
|
7965
|
+
agentId: z53.string().uuid().optional(),
|
|
7544
7966
|
/** How many recent purchases to return, newest first. */
|
|
7545
|
-
limit:
|
|
7967
|
+
limit: z53.number().int().min(1).max(20).optional()
|
|
7546
7968
|
}).strict();
|
|
7547
|
-
var spentAmount =
|
|
7548
|
-
var SwarmSpendLimitsSchema =
|
|
7969
|
+
var spentAmount = z53.string().regex(/^(0|[1-9][0-9]{0,77})$/);
|
|
7970
|
+
var SwarmSpendLimitsSchema = z53.object({
|
|
7549
7971
|
maxPurchase: spentAmount,
|
|
7550
7972
|
rollingDay: spentAmount,
|
|
7551
7973
|
period: spentAmount
|
|
7552
7974
|
});
|
|
7553
|
-
var SwarmSpendPurchaseSchema =
|
|
7554
|
-
operationId:
|
|
7555
|
-
agentId:
|
|
7556
|
-
jobId:
|
|
7557
|
-
merchant:
|
|
7975
|
+
var SwarmSpendPurchaseSchema = z53.object({
|
|
7976
|
+
operationId: z53.string().uuid(),
|
|
7977
|
+
agentId: z53.string(),
|
|
7978
|
+
jobId: z53.string(),
|
|
7979
|
+
merchant: z53.string(),
|
|
7558
7980
|
amount: spentAmount,
|
|
7559
|
-
status:
|
|
7560
|
-
createdAt:
|
|
7561
|
-
settledAt:
|
|
7562
|
-
});
|
|
7563
|
-
var SwarmSpendSummarySchema =
|
|
7564
|
-
approval:
|
|
7565
|
-
periodKind:
|
|
7566
|
-
periodStartsAt:
|
|
7567
|
-
swarm:
|
|
7981
|
+
status: z53.enum(["pending", "settled", "released"]),
|
|
7982
|
+
createdAt: z53.string().datetime(),
|
|
7983
|
+
settledAt: z53.string().datetime().nullable()
|
|
7984
|
+
});
|
|
7985
|
+
var SwarmSpendSummarySchema = z53.object({
|
|
7986
|
+
approval: z53.enum(["active", "inactive", "none"]),
|
|
7987
|
+
periodKind: z53.enum(["calendar_month", "consent"]),
|
|
7988
|
+
periodStartsAt: z53.string().datetime(),
|
|
7989
|
+
swarm: z53.object({
|
|
7568
7990
|
spentDay: spentAmount,
|
|
7569
7991
|
spentPeriod: spentAmount,
|
|
7570
7992
|
limits: SwarmSpendLimitsSchema.nullable()
|
|
7571
7993
|
}),
|
|
7572
|
-
agent:
|
|
7573
|
-
agentId:
|
|
7994
|
+
agent: z53.object({
|
|
7995
|
+
agentId: z53.string(),
|
|
7574
7996
|
spentDay: spentAmount,
|
|
7575
7997
|
spentPeriod: spentAmount,
|
|
7576
|
-
enabled:
|
|
7577
|
-
paused:
|
|
7998
|
+
enabled: z53.boolean(),
|
|
7999
|
+
paused: z53.boolean(),
|
|
7578
8000
|
budget: SwarmSpendLimitsSchema.nullable()
|
|
7579
8001
|
}).nullable(),
|
|
7580
|
-
purchases:
|
|
8002
|
+
purchases: z53.array(SwarmSpendPurchaseSchema)
|
|
7581
8003
|
});
|
|
7582
8004
|
|
|
7583
8005
|
// ../../packages/shared/dist/schemas/swarm-balance.schemas.js
|
|
7584
|
-
import { z as
|
|
7585
|
-
var SwarmBalanceViewSchema =
|
|
7586
|
-
status:
|
|
7587
|
-
balance:
|
|
7588
|
-
amountAtomic:
|
|
7589
|
-
blockNumber:
|
|
7590
|
-
blockHash:
|
|
7591
|
-
observedAt:
|
|
7592
|
-
blockTimestamp:
|
|
8006
|
+
import { z as z54 } from "zod";
|
|
8007
|
+
var SwarmBalanceViewSchema = z54.object({
|
|
8008
|
+
status: z54.enum(["unavailable", "fresh", "stale"]),
|
|
8009
|
+
balance: z54.object({
|
|
8010
|
+
amountAtomic: z54.string().regex(/^(0|[1-9][0-9]{0,77})$/),
|
|
8011
|
+
blockNumber: z54.string().regex(/^(0|[1-9][0-9]*)$/),
|
|
8012
|
+
blockHash: z54.string().regex(/^0x[0-9a-fA-F]{64}$/),
|
|
8013
|
+
observedAt: z54.string().datetime(),
|
|
8014
|
+
blockTimestamp: z54.string().datetime(),
|
|
7593
8015
|
chainId: SwarmChainIdSchema,
|
|
7594
|
-
token:
|
|
8016
|
+
token: z54.string().regex(/^0x[0-9a-fA-F]{40}$/)
|
|
7595
8017
|
}).nullable(),
|
|
7596
|
-
dispatchAllowed:
|
|
8018
|
+
dispatchAllowed: z54.literal(false)
|
|
7597
8019
|
});
|
|
7598
8020
|
|
|
7599
8021
|
// ../../packages/shared/dist/schemas/swarm-purchase.schemas.js
|
|
7600
|
-
import { z as
|
|
7601
|
-
var SwarmPurchaseIdSchema =
|
|
7602
|
-
var SwarmPurchaseViewSchema =
|
|
7603
|
-
id:
|
|
7604
|
-
phase:
|
|
7605
|
-
resultReference:
|
|
7606
|
-
purchase:
|
|
7607
|
-
id:
|
|
7608
|
-
phase:
|
|
8022
|
+
import { z as z55 } from "zod";
|
|
8023
|
+
var SwarmPurchaseIdSchema = z55.object({ purchaseId: z55.string().uuid() }).strict();
|
|
8024
|
+
var SwarmPurchaseViewSchema = z55.object({
|
|
8025
|
+
id: z55.string().uuid(),
|
|
8026
|
+
phase: z55.enum(["quoting", "quoted", "payment", "unknown", "free_result", "failed"]),
|
|
8027
|
+
resultReference: z55.string().nullable(),
|
|
8028
|
+
purchase: z55.object({
|
|
8029
|
+
id: z55.string().uuid(),
|
|
8030
|
+
phase: z55.enum([
|
|
7609
8031
|
"prepared",
|
|
7610
8032
|
"signing",
|
|
7611
8033
|
"signed",
|
|
@@ -7614,16 +8036,16 @@ var SwarmPurchaseViewSchema = z54.object({
|
|
|
7614
8036
|
"settled",
|
|
7615
8037
|
"released"
|
|
7616
8038
|
]),
|
|
7617
|
-
resultStatus:
|
|
7618
|
-
transactionHash:
|
|
7619
|
-
resultReference:
|
|
7620
|
-
dispatchAllowed:
|
|
8039
|
+
resultStatus: z55.enum(["pending", "received", "failed"]),
|
|
8040
|
+
transactionHash: z55.string().nullable(),
|
|
8041
|
+
resultReference: z55.string().nullable(),
|
|
8042
|
+
dispatchAllowed: z55.literal(false)
|
|
7621
8043
|
}).nullable(),
|
|
7622
|
-
dispatchAllowed:
|
|
8044
|
+
dispatchAllowed: z55.literal(false)
|
|
7623
8045
|
});
|
|
7624
8046
|
|
|
7625
8047
|
// ../../packages/shared/dist/schemas/swarm-purchase-approval.schemas.js
|
|
7626
|
-
import { z as
|
|
8048
|
+
import { z as z56 } from "zod";
|
|
7627
8049
|
var SWARM_PURCHASE_APPROVAL_TTL_MS = 30 * 6e4;
|
|
7628
8050
|
var SWARM_PURCHASE_APPROVAL_STATUSES = [
|
|
7629
8051
|
"pending",
|
|
@@ -7635,47 +8057,47 @@ var SWARM_PURCHASE_APPROVAL_STATUSES = [
|
|
|
7635
8057
|
"denied",
|
|
7636
8058
|
"expired"
|
|
7637
8059
|
];
|
|
7638
|
-
var SwarmPurchaseApprovalWarningSchema =
|
|
7639
|
-
var SwarmPurchaseApprovalSchema =
|
|
7640
|
-
id:
|
|
7641
|
-
agentId:
|
|
7642
|
-
agentName:
|
|
7643
|
-
jobId:
|
|
7644
|
-
status:
|
|
8060
|
+
var SwarmPurchaseApprovalWarningSchema = z56.enum(["non_catalog", "unexpected_recipient"]);
|
|
8061
|
+
var SwarmPurchaseApprovalSchema = z56.object({
|
|
8062
|
+
id: z56.string().uuid(),
|
|
8063
|
+
agentId: z56.string(),
|
|
8064
|
+
agentName: z56.string().nullable(),
|
|
8065
|
+
jobId: z56.string().uuid().optional(),
|
|
8066
|
+
status: z56.enum(SWARM_PURCHASE_APPROVAL_STATUSES),
|
|
7645
8067
|
/** The final code the agent reads, e.g. SWARM_PURCHASE_APPROVAL_DENIED or SWARM_QUOTE_CHANGED. */
|
|
7646
|
-
code:
|
|
7647
|
-
origin:
|
|
7648
|
-
url:
|
|
7649
|
-
method:
|
|
7650
|
-
payTo:
|
|
8068
|
+
code: z56.string().nullable(),
|
|
8069
|
+
origin: z56.string().url(),
|
|
8070
|
+
url: z56.string().url(),
|
|
8071
|
+
method: z56.enum(["GET", "POST"]),
|
|
8072
|
+
payTo: z56.string().regex(/^0x[0-9a-fA-F]{40}$/),
|
|
7651
8073
|
/** USDC base units. */
|
|
7652
|
-
amount:
|
|
7653
|
-
asset:
|
|
7654
|
-
network:
|
|
7655
|
-
resource:
|
|
7656
|
-
url:
|
|
7657
|
-
description:
|
|
7658
|
-
mimeType:
|
|
8074
|
+
amount: z56.string().regex(/^[1-9][0-9]{0,17}$/),
|
|
8075
|
+
asset: z56.string().regex(/^0x[0-9a-fA-F]{40}$/),
|
|
8076
|
+
network: z56.string(),
|
|
8077
|
+
resource: z56.object({
|
|
8078
|
+
url: z56.string().nullable(),
|
|
8079
|
+
description: z56.string().nullable(),
|
|
8080
|
+
mimeType: z56.string().nullable()
|
|
7659
8081
|
}),
|
|
7660
|
-
catalog:
|
|
8082
|
+
catalog: z56.object({ entryId: z56.string(), name: z56.string(), verified: z56.boolean() }).nullable(),
|
|
7661
8083
|
warning: SwarmPurchaseApprovalWarningSchema.nullable(),
|
|
7662
8084
|
/** Financial phase of the executed purchase, once there is one. */
|
|
7663
|
-
purchasePhase:
|
|
7664
|
-
resultStatus:
|
|
7665
|
-
createdAt:
|
|
7666
|
-
expiresAt:
|
|
7667
|
-
decidedAt:
|
|
7668
|
-
});
|
|
7669
|
-
var SwarmPurchaseApprovalListInputSchema =
|
|
7670
|
-
var SwarmPurchaseApprovalListSchema =
|
|
7671
|
-
enabled:
|
|
7672
|
-
approvals:
|
|
7673
|
-
});
|
|
7674
|
-
var SwarmPurchaseApprovalIdSchema =
|
|
8085
|
+
purchasePhase: z56.string().nullable(),
|
|
8086
|
+
resultStatus: z56.enum(["pending", "received", "failed"]).nullable(),
|
|
8087
|
+
createdAt: z56.string(),
|
|
8088
|
+
expiresAt: z56.string(),
|
|
8089
|
+
decidedAt: z56.string().nullable()
|
|
8090
|
+
});
|
|
8091
|
+
var SwarmPurchaseApprovalListInputSchema = z56.object({ agentId: z56.string().uuid().optional() }).strict();
|
|
8092
|
+
var SwarmPurchaseApprovalListSchema = z56.object({
|
|
8093
|
+
enabled: z56.boolean(),
|
|
8094
|
+
approvals: z56.array(SwarmPurchaseApprovalSchema)
|
|
8095
|
+
});
|
|
8096
|
+
var SwarmPurchaseApprovalIdSchema = z56.object({ approvalId: z56.string().uuid() }).strict();
|
|
7675
8097
|
var SwarmPurchaseApprovalConfirmSchema = SwarmPurchaseApprovalIdSchema.extend({
|
|
7676
8098
|
consentTextVersion: SwarmConsentTextVersionSchema
|
|
7677
8099
|
}).strict();
|
|
7678
|
-
var SwarmPurchaseApprovalPreparedSchema =
|
|
8100
|
+
var SwarmPurchaseApprovalPreparedSchema = z56.object({
|
|
7679
8101
|
approval: SwarmPurchaseApprovalSchema,
|
|
7680
8102
|
consent: SwarmConsentSchema
|
|
7681
8103
|
});
|
|
@@ -8110,37 +8532,37 @@ ${LEGAL_ACCEPTANCE_STATEMENT}`;
|
|
|
8110
8532
|
}
|
|
8111
8533
|
|
|
8112
8534
|
// ../../packages/shared/dist/schemas/swarm-identity.schemas.js
|
|
8113
|
-
import { z as
|
|
8114
|
-
var SwarmIdentityPerformanceSchema =
|
|
8115
|
-
completedTasks:
|
|
8116
|
-
ratedTasks:
|
|
8117
|
-
totalStars:
|
|
8535
|
+
import { z as z57 } from "zod";
|
|
8536
|
+
var SwarmIdentityPerformanceSchema = z57.object({
|
|
8537
|
+
completedTasks: z57.number().int().nonnegative().safe(),
|
|
8538
|
+
ratedTasks: z57.number().int().nonnegative().safe(),
|
|
8539
|
+
totalStars: z57.number().int().nonnegative().safe(),
|
|
8118
8540
|
// Exact USDC base units from the canonical projection; never a floating-point amount.
|
|
8119
|
-
totalEarnings:
|
|
8541
|
+
totalEarnings: z57.string().regex(/^(0|[1-9][0-9]{0,77})$/)
|
|
8120
8542
|
});
|
|
8121
|
-
var SwarmIdentityViewSchema =
|
|
8122
|
-
status:
|
|
8543
|
+
var SwarmIdentityViewSchema = z57.object({
|
|
8544
|
+
status: z57.enum([
|
|
8123
8545
|
"wallet_not_ready",
|
|
8124
8546
|
"unregistered",
|
|
8125
8547
|
"deployment_mismatch",
|
|
8126
8548
|
"profile_conflict",
|
|
8127
8549
|
"registered"
|
|
8128
8550
|
]),
|
|
8129
|
-
walletAddress:
|
|
8130
|
-
identity:
|
|
8131
|
-
agentId:
|
|
8132
|
-
chainId:
|
|
8133
|
-
registryAddress:
|
|
8134
|
-
actorType:
|
|
8551
|
+
walletAddress: z57.string().regex(/^0x[0-9a-f]{40}$/).nullable(),
|
|
8552
|
+
identity: z57.object({
|
|
8553
|
+
agentId: z57.string().regex(/^(0|[1-9][0-9]*)$/),
|
|
8554
|
+
chainId: z57.number().int().positive(),
|
|
8555
|
+
registryAddress: z57.string().regex(/^0x[0-9a-f]{40}$/),
|
|
8556
|
+
actorType: z57.literal("agent")
|
|
8135
8557
|
}).nullable(),
|
|
8136
8558
|
performance: SwarmIdentityPerformanceSchema.nullable().optional(),
|
|
8137
8559
|
// This is the existing indexer's projection, not a fresh registry ownership check.
|
|
8138
|
-
source:
|
|
8139
|
-
registrationEnabled:
|
|
8560
|
+
source: z57.literal("database_projection"),
|
|
8561
|
+
registrationEnabled: z57.literal(false)
|
|
8140
8562
|
});
|
|
8141
8563
|
|
|
8142
8564
|
// ../../packages/shared/dist/schemas/catalog.schemas.js
|
|
8143
|
-
import { z as
|
|
8565
|
+
import { z as z58 } from "zod";
|
|
8144
8566
|
var CATALOG_FORMAT_VERSION = 1;
|
|
8145
8567
|
var CATALOG_KINDS = ["x402-endpoint"];
|
|
8146
8568
|
var CATALOG_TRUST_TIERS = ["curated", "verified", "community"];
|
|
@@ -8163,372 +8585,372 @@ var CATALOG_CAPABILITIES = [
|
|
|
8163
8585
|
"evaluation",
|
|
8164
8586
|
"agent-hosting"
|
|
8165
8587
|
];
|
|
8166
|
-
var catalogId =
|
|
8167
|
-
var CatalogOriginSchema =
|
|
8588
|
+
var catalogId = z58.string().min(3).max(80).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*\.[a-z0-9]+(?:[.-][a-z0-9]+)*$/, "Catalog ids are lowercase, dot-namespaced by capability, e.g. domains.namecheap-x402");
|
|
8589
|
+
var CatalogOriginSchema = z58.string().url().max(2048).refine((value) => {
|
|
8168
8590
|
const url = new URL(value);
|
|
8169
8591
|
return url.protocol === "https:" && url.origin === value;
|
|
8170
8592
|
}, "An HTTPS origin without a path or credentials is required");
|
|
8171
|
-
var isoDate =
|
|
8172
|
-
var atomicAmount =
|
|
8173
|
-
var CatalogEndpointSchema =
|
|
8174
|
-
method:
|
|
8175
|
-
path:
|
|
8176
|
-
summary:
|
|
8593
|
+
var isoDate = z58.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Expected an ISO date (YYYY-MM-DD)");
|
|
8594
|
+
var atomicAmount = z58.string().regex(/^(?:0|[1-9][0-9]*)$/, "Expected an integer atomic amount");
|
|
8595
|
+
var CatalogEndpointSchema = z58.object({
|
|
8596
|
+
method: z58.enum(["GET", "POST"]),
|
|
8597
|
+
path: z58.string().min(1).max(512).regex(/^\//, "Endpoint paths start with /"),
|
|
8598
|
+
summary: z58.string().min(1).max(200)
|
|
8177
8599
|
}).strict();
|
|
8178
|
-
var CatalogProviderSchema =
|
|
8179
|
-
name:
|
|
8180
|
-
url:
|
|
8600
|
+
var CatalogProviderSchema = z58.object({
|
|
8601
|
+
name: z58.string().min(1).max(120),
|
|
8602
|
+
url: z58.string().url().max(2048)
|
|
8181
8603
|
}).strict();
|
|
8182
|
-
var CatalogPricingSchema =
|
|
8183
|
-
chainId:
|
|
8184
|
-
token:
|
|
8604
|
+
var CatalogPricingSchema = z58.object({
|
|
8605
|
+
chainId: z58.union([z58.literal(8453), z58.literal(84532)]),
|
|
8606
|
+
token: z58.literal("USDC"),
|
|
8185
8607
|
// Highest per-call price we expect this provider to quote, in atomic units.
|
|
8186
8608
|
// `make catalog probe` compares the live 402 quote against it.
|
|
8187
8609
|
typicalMax: atomicAmount,
|
|
8188
8610
|
// Reviewed x402 recipients for this origin (ADR-0182). An in-chat purchase approval shows the
|
|
8189
8611
|
// catalog verification badge only when both the origin and the quoted recipient match.
|
|
8190
|
-
payTo:
|
|
8612
|
+
payTo: z58.array(z58.string().regex(/^0x[0-9a-fA-F]{40}$/)).min(1).max(8).optional()
|
|
8191
8613
|
}).strict();
|
|
8192
|
-
var CatalogTrustSchema =
|
|
8193
|
-
tier:
|
|
8194
|
-
reviewedBy:
|
|
8614
|
+
var CatalogTrustSchema = z58.object({
|
|
8615
|
+
tier: z58.enum(CATALOG_TRUST_TIERS),
|
|
8616
|
+
reviewedBy: z58.string().min(1).max(120),
|
|
8195
8617
|
reviewedAt: isoDate,
|
|
8196
|
-
notes:
|
|
8618
|
+
notes: z58.string().max(2e3).optional()
|
|
8197
8619
|
}).strict();
|
|
8198
|
-
var catalogEntryBase =
|
|
8620
|
+
var catalogEntryBase = z58.object({
|
|
8199
8621
|
id: catalogId,
|
|
8200
|
-
name:
|
|
8622
|
+
name: z58.string().min(1).max(120),
|
|
8201
8623
|
provider: CatalogProviderSchema,
|
|
8202
|
-
capabilities:
|
|
8624
|
+
capabilities: z58.array(z58.enum(CATALOG_CAPABILITIES)).min(1).max(8),
|
|
8203
8625
|
// Prose that gets embedded for semantic search. Write it for retrieval.
|
|
8204
|
-
description:
|
|
8626
|
+
description: z58.string().min(20).max(2e3),
|
|
8205
8627
|
// Short, exact how-to shown to the agent verbatim.
|
|
8206
|
-
usage:
|
|
8207
|
-
docsUrl:
|
|
8628
|
+
usage: z58.string().min(10).max(4e3),
|
|
8629
|
+
docsUrl: z58.string().url().max(2048),
|
|
8208
8630
|
trust: CatalogTrustSchema,
|
|
8209
|
-
status:
|
|
8631
|
+
status: z58.enum(CATALOG_STATUSES),
|
|
8210
8632
|
addedAt: isoDate
|
|
8211
8633
|
});
|
|
8212
8634
|
var CatalogX402EndpointEntrySchema = catalogEntryBase.extend({
|
|
8213
|
-
kind:
|
|
8635
|
+
kind: z58.literal("x402-endpoint"),
|
|
8214
8636
|
origin: CatalogOriginSchema,
|
|
8215
|
-
endpoints:
|
|
8637
|
+
endpoints: z58.array(CatalogEndpointSchema).min(1).max(32),
|
|
8216
8638
|
pricing: CatalogPricingSchema
|
|
8217
8639
|
}).strict();
|
|
8218
|
-
var CatalogEntrySchema =
|
|
8219
|
-
var CatalogFileSchema =
|
|
8220
|
-
formatVersion:
|
|
8221
|
-
generatedAt:
|
|
8222
|
-
entries:
|
|
8640
|
+
var CatalogEntrySchema = z58.discriminatedUnion("kind", [CatalogX402EndpointEntrySchema]);
|
|
8641
|
+
var CatalogFileSchema = z58.object({
|
|
8642
|
+
formatVersion: z58.literal(CATALOG_FORMAT_VERSION),
|
|
8643
|
+
generatedAt: z58.string().datetime(),
|
|
8644
|
+
entries: z58.array(CatalogEntrySchema)
|
|
8223
8645
|
}).strict();
|
|
8224
|
-
var CatalogSearchInputSchema =
|
|
8225
|
-
query:
|
|
8226
|
-
kind:
|
|
8227
|
-
capabilities:
|
|
8228
|
-
tiers:
|
|
8229
|
-
limit:
|
|
8646
|
+
var CatalogSearchInputSchema = z58.object({
|
|
8647
|
+
query: z58.string().trim().min(1).max(500),
|
|
8648
|
+
kind: z58.enum(CATALOG_KINDS).optional(),
|
|
8649
|
+
capabilities: z58.array(z58.enum(CATALOG_CAPABILITIES)).max(8).optional(),
|
|
8650
|
+
tiers: z58.array(z58.enum(CATALOG_TRUST_TIERS)).max(3).optional(),
|
|
8651
|
+
limit: z58.number().int().min(1).max(20).default(5)
|
|
8230
8652
|
}).strict();
|
|
8231
|
-
var CatalogSearchHitSchema =
|
|
8653
|
+
var CatalogSearchHitSchema = z58.object({
|
|
8232
8654
|
entry: CatalogEntrySchema,
|
|
8233
|
-
score:
|
|
8234
|
-
matchedCapabilities:
|
|
8655
|
+
score: z58.number(),
|
|
8656
|
+
matchedCapabilities: z58.array(z58.enum(CATALOG_CAPABILITIES))
|
|
8235
8657
|
}).strict();
|
|
8236
|
-
var CatalogSearchOutputSchema =
|
|
8237
|
-
hits:
|
|
8238
|
-
total:
|
|
8658
|
+
var CatalogSearchOutputSchema = z58.object({
|
|
8659
|
+
hits: z58.array(CatalogSearchHitSchema),
|
|
8660
|
+
total: z58.number().int().nonnegative()
|
|
8239
8661
|
}).strict();
|
|
8240
|
-
var CatalogGetInputSchema =
|
|
8662
|
+
var CatalogGetInputSchema = z58.object({ id: catalogId }).strict();
|
|
8241
8663
|
|
|
8242
8664
|
// ../../packages/shared/dist/schemas/launcher-pilot.schemas.js
|
|
8243
|
-
import { z as
|
|
8244
|
-
var LauncherPilotConfigSchema =
|
|
8245
|
-
LAUNCHER_PILOT_WALLET_ENABLED:
|
|
8246
|
-
LAUNCHER_PILOT_PURCHASES_ENABLED:
|
|
8665
|
+
import { z as z59 } from "zod";
|
|
8666
|
+
var LauncherPilotConfigSchema = z59.object({
|
|
8667
|
+
LAUNCHER_PILOT_WALLET_ENABLED: z59.enum(["true", "false"]).default("false").transform((v) => v === "true"),
|
|
8668
|
+
LAUNCHER_PILOT_PURCHASES_ENABLED: z59.enum(["true", "false"]).default("false").transform((v) => v === "true"),
|
|
8247
8669
|
// Implements: ADR-0182. Owners approve an agent's x402 purchase in chat; off by default.
|
|
8248
|
-
LAUNCHER_PURCHASE_APPROVALS_ENABLED:
|
|
8670
|
+
LAUNCHER_PURCHASE_APPROVALS_ENABLED: z59.enum(["true", "false"]).default("false").transform((v) => v === "true"),
|
|
8249
8671
|
// Implements: ADR-0183. Swarm YOLO mode (any recipient within caps for a standing period);
|
|
8250
8672
|
// off by default, and refused unless pilot purchases are on.
|
|
8251
|
-
LAUNCHER_SWARM_YOLO_ENABLED:
|
|
8673
|
+
LAUNCHER_SWARM_YOLO_ENABLED: z59.enum(["true", "false"]).default("false").transform((v) => v === "true"),
|
|
8252
8674
|
/**
|
|
8253
8675
|
* Per ADR-0212. Standing swarm spending: a YOLO consent with no end date, until the owner turns
|
|
8254
8676
|
* it off. Off by default; it takes effect only with pilot purchases, YOLO and in-chat purchase
|
|
8255
8677
|
* approvals all on (see `swarmStandingSpendEnabled`), so missing authority always becomes an
|
|
8256
8678
|
* approval card in chat rather than a failure.
|
|
8257
8679
|
*/
|
|
8258
|
-
LAUNCHER_SWARM_STANDING_SPEND_ENABLED:
|
|
8680
|
+
LAUNCHER_SWARM_STANDING_SPEND_ENABLED: z59.enum(["true", "false"]).default("false").transform((v) => v === "true"),
|
|
8259
8681
|
/**
|
|
8260
8682
|
* ADR-0183. Recipients (0x addresses) and merchant origins (https://host) a YOLO purchase never
|
|
8261
8683
|
* pays, checked before signing. A JSON array; empty by default.
|
|
8262
8684
|
*/
|
|
8263
|
-
LAUNCHER_SWARM_YOLO_BLOCKLIST:
|
|
8685
|
+
LAUNCHER_SWARM_YOLO_BLOCKLIST: z59.string().default("[]").transform((value, ctx) => {
|
|
8264
8686
|
try {
|
|
8265
8687
|
return JSON.parse(value);
|
|
8266
8688
|
} catch {
|
|
8267
8689
|
ctx.addIssue({
|
|
8268
|
-
code:
|
|
8690
|
+
code: z59.ZodIssueCode.custom,
|
|
8269
8691
|
message: "Use a JSON array of addresses and https origins"
|
|
8270
8692
|
});
|
|
8271
|
-
return
|
|
8693
|
+
return z59.NEVER;
|
|
8272
8694
|
}
|
|
8273
|
-
}).pipe(
|
|
8274
|
-
|
|
8275
|
-
|
|
8695
|
+
}).pipe(z59.array(z59.union([
|
|
8696
|
+
z59.string().regex(/^0x[0-9a-fA-F]{40}$/),
|
|
8697
|
+
z59.string().url().refine((v) => new URL(v).protocol === "https:" && new URL(v).origin === v)
|
|
8276
8698
|
])).max(1e3)).transform((values) => values.map((value) => value.toLowerCase())),
|
|
8277
|
-
LAUNCHER_PILOT_ENABLED:
|
|
8278
|
-
LAUNCHER_PILOT_OWNER_IDS:
|
|
8699
|
+
LAUNCHER_PILOT_ENABLED: z59.enum(["true", "false"]).default("false").transform((v) => v === "true"),
|
|
8700
|
+
LAUNCHER_PILOT_OWNER_IDS: z59.string().default("[]").transform((value, ctx) => {
|
|
8279
8701
|
try {
|
|
8280
8702
|
return JSON.parse(value);
|
|
8281
8703
|
} catch {
|
|
8282
8704
|
ctx.addIssue({
|
|
8283
|
-
code:
|
|
8705
|
+
code: z59.ZodIssueCode.custom,
|
|
8284
8706
|
message: "Use a JSON array of Privy user IDs"
|
|
8285
8707
|
});
|
|
8286
|
-
return
|
|
8708
|
+
return z59.NEVER;
|
|
8287
8709
|
}
|
|
8288
|
-
}).pipe(
|
|
8710
|
+
}).pipe(z59.array(z59.string().regex(/^did:privy:[A-Za-z0-9_-]{1,200}$/)).max(20)).transform((ids) => [...new Set(ids)])
|
|
8289
8711
|
});
|
|
8290
|
-
var LauncherPrivyConfigSchema =
|
|
8291
|
-
PRIVY_APP_ID:
|
|
8292
|
-
PRIVY_APP_SECRET:
|
|
8293
|
-
PRIVY_AUTHORIZATION_KEY_ID:
|
|
8294
|
-
PRIVY_AUTHORIZATION_PRIVATE_KEY:
|
|
8712
|
+
var LauncherPrivyConfigSchema = z59.object({
|
|
8713
|
+
PRIVY_APP_ID: z59.string().min(1).optional(),
|
|
8714
|
+
PRIVY_APP_SECRET: z59.string().min(1).optional(),
|
|
8715
|
+
PRIVY_AUTHORIZATION_KEY_ID: z59.string().regex(/^[A-Za-z0-9_-]{1,128}$/).optional(),
|
|
8716
|
+
PRIVY_AUTHORIZATION_PRIVATE_KEY: z59.string().min(1).optional()
|
|
8295
8717
|
});
|
|
8296
8718
|
|
|
8297
8719
|
// ../../packages/shared/dist/schemas/integration.schemas.js
|
|
8298
|
-
import { z as
|
|
8299
|
-
var IntegrationProviderSchema =
|
|
8300
|
-
var IntegrationActionSchema =
|
|
8720
|
+
import { z as z60 } from "zod";
|
|
8721
|
+
var IntegrationProviderSchema = z60.literal("github");
|
|
8722
|
+
var IntegrationActionSchema = z60.enum([
|
|
8301
8723
|
"github.repository.read",
|
|
8302
8724
|
"github.repository.create",
|
|
8303
8725
|
"github.change.propose"
|
|
8304
8726
|
]);
|
|
8305
|
-
var IntegrationConnectionSchema =
|
|
8306
|
-
id:
|
|
8727
|
+
var IntegrationConnectionSchema = z60.object({
|
|
8728
|
+
id: z60.string().uuid(),
|
|
8307
8729
|
provider: IntegrationProviderSchema,
|
|
8308
|
-
label:
|
|
8309
|
-
state:
|
|
8310
|
-
generation:
|
|
8311
|
-
externalAccount:
|
|
8312
|
-
createdAt:
|
|
8313
|
-
});
|
|
8314
|
-
var IntegrationResourceSchema =
|
|
8315
|
-
id:
|
|
8316
|
-
connectionId:
|
|
8317
|
-
externalId:
|
|
8318
|
-
name:
|
|
8319
|
-
description:
|
|
8320
|
-
approved:
|
|
8321
|
-
allowSwarmSharing:
|
|
8322
|
-
});
|
|
8323
|
-
var IntegrationGrantSchema =
|
|
8324
|
-
agentId:
|
|
8325
|
-
connectionId:
|
|
8326
|
-
allApproved:
|
|
8327
|
-
resourceIds:
|
|
8328
|
-
actions:
|
|
8329
|
-
revision:
|
|
8330
|
-
});
|
|
8331
|
-
var IntegrationConnectionInputSchema =
|
|
8730
|
+
label: z60.string(),
|
|
8731
|
+
state: z60.enum(["active", "disconnected", "needs_reconnect"]),
|
|
8732
|
+
generation: z60.number().int(),
|
|
8733
|
+
externalAccount: z60.string(),
|
|
8734
|
+
createdAt: z60.string()
|
|
8735
|
+
});
|
|
8736
|
+
var IntegrationResourceSchema = z60.object({
|
|
8737
|
+
id: z60.string().uuid(),
|
|
8738
|
+
connectionId: z60.string().uuid(),
|
|
8739
|
+
externalId: z60.string(),
|
|
8740
|
+
name: z60.string(),
|
|
8741
|
+
description: z60.string(),
|
|
8742
|
+
approved: z60.boolean(),
|
|
8743
|
+
allowSwarmSharing: z60.boolean()
|
|
8744
|
+
});
|
|
8745
|
+
var IntegrationGrantSchema = z60.object({
|
|
8746
|
+
agentId: z60.string().uuid(),
|
|
8747
|
+
connectionId: z60.string().uuid(),
|
|
8748
|
+
allApproved: z60.boolean(),
|
|
8749
|
+
resourceIds: z60.array(z60.string().uuid()).max(100),
|
|
8750
|
+
actions: z60.array(IntegrationActionSchema).max(3),
|
|
8751
|
+
revision: z60.number().int().nonnegative()
|
|
8752
|
+
});
|
|
8753
|
+
var IntegrationConnectionInputSchema = z60.object({ connectionId: z60.string().uuid() });
|
|
8332
8754
|
var IntegrationGrantInputSchema = IntegrationGrantSchema.omit({ revision: true }).extend({
|
|
8333
|
-
requestKey:
|
|
8334
|
-
expectedRevision:
|
|
8755
|
+
requestKey: z60.string().uuid(),
|
|
8756
|
+
expectedRevision: z60.number().int().nonnegative()
|
|
8335
8757
|
});
|
|
8336
8758
|
var IntegrationApprovalInputSchema = IntegrationConnectionInputSchema.extend({
|
|
8337
|
-
resourceId:
|
|
8338
|
-
approved:
|
|
8339
|
-
allowSwarmSharing:
|
|
8759
|
+
resourceId: z60.string().uuid(),
|
|
8760
|
+
approved: z60.boolean(),
|
|
8761
|
+
allowSwarmSharing: z60.boolean().default(false)
|
|
8340
8762
|
});
|
|
8341
|
-
var IntegrationReadInputSchema =
|
|
8342
|
-
resourceId:
|
|
8343
|
-
path:
|
|
8344
|
-
ref:
|
|
8763
|
+
var IntegrationReadInputSchema = z60.object({
|
|
8764
|
+
resourceId: z60.string().uuid(),
|
|
8765
|
+
path: z60.string().max(1024).default(""),
|
|
8766
|
+
ref: z60.string().min(1).max(256).optional()
|
|
8345
8767
|
});
|
|
8346
8768
|
var IntegrationResourcePageInputSchema = IntegrationConnectionInputSchema.extend({
|
|
8347
|
-
page:
|
|
8769
|
+
page: z60.number().int().min(1).max(100).default(1)
|
|
8348
8770
|
});
|
|
8349
|
-
var IntegrationCreateInputSchema =
|
|
8350
|
-
connectionId:
|
|
8351
|
-
requestKey:
|
|
8352
|
-
name:
|
|
8353
|
-
description:
|
|
8771
|
+
var IntegrationCreateInputSchema = z60.object({
|
|
8772
|
+
connectionId: z60.string().uuid(),
|
|
8773
|
+
requestKey: z60.string().uuid(),
|
|
8774
|
+
name: z60.string().min(1).max(100).regex(/^[A-Za-z0-9][A-Za-z0-9_.-]*$/),
|
|
8775
|
+
description: z60.string().max(350).default("")
|
|
8354
8776
|
}).strict();
|
|
8355
|
-
var repositoryPath =
|
|
8356
|
-
var IntegrationPublishInputSchema =
|
|
8357
|
-
resourceId:
|
|
8358
|
-
requestKey:
|
|
8359
|
-
branch:
|
|
8360
|
-
expectedHeadOid:
|
|
8361
|
-
title:
|
|
8362
|
-
body:
|
|
8363
|
-
files:
|
|
8777
|
+
var repositoryPath = z60.string().min(1).max(512).refine((path3) => path3.split("/").every((part) => part && part !== "." && part !== ".." && part.toLowerCase() !== ".git" && part.toLowerCase() !== ".gitmodules" && ![...part].some((char) => char === "\\" || char.charCodeAt(0) < 32 || char.charCodeAt(0) === 127)) && !path3.toLowerCase().startsWith(".github/workflows/"), "Unsupported repository path");
|
|
8778
|
+
var IntegrationPublishInputSchema = z60.object({
|
|
8779
|
+
resourceId: z60.string().uuid(),
|
|
8780
|
+
requestKey: z60.string().uuid(),
|
|
8781
|
+
branch: z60.string().min(1).max(80).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
8782
|
+
expectedHeadOid: z60.string().regex(/^[a-f0-9]{40}$/),
|
|
8783
|
+
title: z60.string().min(1).max(200),
|
|
8784
|
+
body: z60.string().max(1e4).default(""),
|
|
8785
|
+
files: z60.array(z60.object({
|
|
8364
8786
|
path: repositoryPath,
|
|
8365
|
-
content:
|
|
8787
|
+
content: z60.string().max(65536).refine((value) => !value.includes("\0"), "Binary content is unsupported").nullable()
|
|
8366
8788
|
}).strict()).min(1).max(50)
|
|
8367
8789
|
}).strict().superRefine((input2, ctx) => {
|
|
8368
8790
|
const paths = input2.files.map((file) => file.path);
|
|
8369
8791
|
if (new Set(paths).size !== paths.length || paths.some((path3) => paths.some((other) => other.startsWith(path3 + "/"))))
|
|
8370
|
-
ctx.addIssue({ code:
|
|
8792
|
+
ctx.addIssue({ code: z60.ZodIssueCode.custom, message: "Duplicate or overlapping paths" });
|
|
8371
8793
|
if (new TextEncoder().encode(JSON.stringify(input2)).length > 262144)
|
|
8372
|
-
ctx.addIssue({ code:
|
|
8794
|
+
ctx.addIssue({ code: z60.ZodIssueCode.custom, message: "Publish exceeds 256 KiB" });
|
|
8373
8795
|
});
|
|
8374
8796
|
var IntegrationToolInputSchemas = {
|
|
8375
|
-
integrations_list:
|
|
8376
|
-
integrations_resources:
|
|
8377
|
-
connectionId:
|
|
8378
|
-
after:
|
|
8797
|
+
integrations_list: z60.object({}),
|
|
8798
|
+
integrations_resources: z60.object({
|
|
8799
|
+
connectionId: z60.string().uuid().optional(),
|
|
8800
|
+
after: z60.string().uuid().optional()
|
|
8379
8801
|
}),
|
|
8380
8802
|
github_read: IntegrationReadInputSchema,
|
|
8381
|
-
github_repository:
|
|
8382
|
-
resourceId:
|
|
8383
|
-
branch:
|
|
8803
|
+
github_repository: z60.object({
|
|
8804
|
+
resourceId: z60.string().uuid(),
|
|
8805
|
+
branch: z60.string().max(80).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional()
|
|
8384
8806
|
}).strict(),
|
|
8385
8807
|
github_create_repository: IntegrationCreateInputSchema,
|
|
8386
8808
|
github_publish: IntegrationPublishInputSchema,
|
|
8387
|
-
github_operation:
|
|
8809
|
+
github_operation: z60.object({ operationId: z60.string().regex(/^[a-f0-9]{64}$/) }).strict()
|
|
8388
8810
|
};
|
|
8389
|
-
var IntegrationEnvironmentSchema =
|
|
8390
|
-
INTEGRATIONS_ENABLED:
|
|
8391
|
-
INTEGRATION_KEY_ID:
|
|
8392
|
-
INTEGRATION_CREDENTIAL_KEYS:
|
|
8393
|
-
GITHUB_APP_CLIENT_ID:
|
|
8394
|
-
GITHUB_APP_CLIENT_SECRET:
|
|
8395
|
-
GITHUB_APP_SLUG:
|
|
8396
|
-
GITHUB_APP_CALLBACK_URL:
|
|
8811
|
+
var IntegrationEnvironmentSchema = z60.object({
|
|
8812
|
+
INTEGRATIONS_ENABLED: z60.enum(["true", "false"]).default("false").transform((v) => v === "true"),
|
|
8813
|
+
INTEGRATION_KEY_ID: z60.string().regex(/^[A-Za-z0-9_-]{1,64}$/).optional(),
|
|
8814
|
+
INTEGRATION_CREDENTIAL_KEYS: z60.string().max(4096).optional(),
|
|
8815
|
+
GITHUB_APP_CLIENT_ID: z60.string().min(1).max(200).optional(),
|
|
8816
|
+
GITHUB_APP_CLIENT_SECRET: z60.string().min(1).max(4096).optional(),
|
|
8817
|
+
GITHUB_APP_SLUG: z60.string().regex(/^[a-z0-9][a-z0-9-]{0,99}$/).optional(),
|
|
8818
|
+
GITHUB_APP_CALLBACK_URL: z60.string().url().refine((v) => {
|
|
8397
8819
|
const u = new URL(v);
|
|
8398
8820
|
return !u.username && !u.password && !u.search && !u.hash && (u.protocol === "https:" || u.protocol === "http:" && ["localhost", "127.0.0.1"].includes(u.hostname));
|
|
8399
8821
|
}).optional()
|
|
8400
8822
|
});
|
|
8401
|
-
var IntegrationViewSchema =
|
|
8402
|
-
configured:
|
|
8403
|
-
installationUrl:
|
|
8404
|
-
connections:
|
|
8405
|
-
resources:
|
|
8406
|
-
grants:
|
|
8407
|
-
truncated:
|
|
8823
|
+
var IntegrationViewSchema = z60.object({
|
|
8824
|
+
configured: z60.boolean(),
|
|
8825
|
+
installationUrl: z60.string().url().nullable(),
|
|
8826
|
+
connections: z60.array(IntegrationConnectionSchema),
|
|
8827
|
+
resources: z60.array(IntegrationResourceSchema),
|
|
8828
|
+
grants: z60.array(IntegrationGrantSchema),
|
|
8829
|
+
truncated: z60.boolean()
|
|
8408
8830
|
});
|
|
8409
8831
|
|
|
8410
8832
|
// ../../packages/shared/dist/schemas/launcher-stream.schemas.js
|
|
8411
|
-
import { z as
|
|
8412
|
-
var LauncherLiveTextSchema =
|
|
8413
|
-
order:
|
|
8414
|
-
itemId:
|
|
8415
|
-
phase:
|
|
8416
|
-
text:
|
|
8417
|
-
complete:
|
|
8418
|
-
});
|
|
8419
|
-
var LauncherStreamSnapshotSchema =
|
|
8420
|
-
revision:
|
|
8421
|
-
jobId:
|
|
8422
|
-
runId:
|
|
8423
|
-
messages:
|
|
8424
|
-
activity:
|
|
8833
|
+
import { z as z61 } from "zod";
|
|
8834
|
+
var LauncherLiveTextSchema = z61.object({
|
|
8835
|
+
order: z61.number().int().min(0).max(63),
|
|
8836
|
+
itemId: z61.string().min(1).max(200),
|
|
8837
|
+
phase: z61.enum(["commentary", "final_answer"]),
|
|
8838
|
+
text: z61.string().max(65536),
|
|
8839
|
+
complete: z61.boolean()
|
|
8840
|
+
});
|
|
8841
|
+
var LauncherStreamSnapshotSchema = z61.object({
|
|
8842
|
+
revision: z61.number().int().nonnegative(),
|
|
8843
|
+
jobId: z61.string().uuid().nullable(),
|
|
8844
|
+
runId: z61.string().uuid().nullable(),
|
|
8845
|
+
messages: z61.array(LauncherLiveTextSchema).max(16),
|
|
8846
|
+
activity: z61.array(LauncherActivitySchema).max(20)
|
|
8425
8847
|
});
|
|
8426
8848
|
|
|
8427
8849
|
// ../../packages/shared/dist/schemas/channel.schemas.js
|
|
8428
|
-
import { z as
|
|
8429
|
-
var ChannelTransportSchema =
|
|
8430
|
-
var ChannelSettingsSchema =
|
|
8431
|
-
memberIds:
|
|
8432
|
-
defaultAgentId:
|
|
8433
|
-
coordinatorAgentId:
|
|
8434
|
-
replyMode:
|
|
8435
|
-
transport:
|
|
8850
|
+
import { z as z62 } from "zod";
|
|
8851
|
+
var ChannelTransportSchema = z62.enum(["iMessage", "RCS", "SMS"]);
|
|
8852
|
+
var ChannelSettingsSchema = z62.object({
|
|
8853
|
+
memberIds: z62.array(z62.string().uuid()).min(1).max(10),
|
|
8854
|
+
defaultAgentId: z62.string().uuid(),
|
|
8855
|
+
coordinatorAgentId: z62.string().uuid().nullable(),
|
|
8856
|
+
replyMode: z62.enum(["full", "notification"]),
|
|
8857
|
+
transport: z62.enum(["auto", "imessage"])
|
|
8436
8858
|
});
|
|
8437
8859
|
var ChannelPairBeginSchema = ChannelSettingsSchema.extend({
|
|
8438
|
-
phone:
|
|
8439
|
-
requestKey:
|
|
8440
|
-
authorityConsent:
|
|
8860
|
+
phone: z62.string().regex(/^\+[1-9]\d{7,14}$/, "Enter a phone number with its country code"),
|
|
8861
|
+
requestKey: z62.string().uuid(),
|
|
8862
|
+
authorityConsent: z62.literal(true)
|
|
8441
8863
|
});
|
|
8442
|
-
var ChannelAttemptInputSchema =
|
|
8443
|
-
var ChannelPairStatusSchema =
|
|
8444
|
-
attemptId:
|
|
8445
|
-
state:
|
|
8446
|
-
maskedPhone:
|
|
8447
|
-
expiresAt:
|
|
8864
|
+
var ChannelAttemptInputSchema = z62.object({ attemptId: z62.string().uuid() });
|
|
8865
|
+
var ChannelPairStatusSchema = z62.object({
|
|
8866
|
+
attemptId: z62.string().uuid(),
|
|
8867
|
+
state: z62.enum(["pending", "proven", "expired", "completed"]),
|
|
8868
|
+
maskedPhone: z62.string(),
|
|
8869
|
+
expiresAt: z62.string()
|
|
8448
8870
|
});
|
|
8449
8871
|
var ChannelPairBeginResultSchema = ChannelPairStatusSchema.extend({
|
|
8450
|
-
contactPhone:
|
|
8451
|
-
phrase:
|
|
8452
|
-
composeUrl:
|
|
8872
|
+
contactPhone: z62.string(),
|
|
8873
|
+
phrase: z62.string(),
|
|
8874
|
+
composeUrl: z62.string()
|
|
8453
8875
|
});
|
|
8454
8876
|
var ChannelBindingSchema = ChannelSettingsSchema.extend({
|
|
8455
|
-
id:
|
|
8456
|
-
state:
|
|
8457
|
-
revision:
|
|
8458
|
-
generation:
|
|
8459
|
-
maskedPhone:
|
|
8460
|
-
contactPhone:
|
|
8461
|
-
lastActivityAt:
|
|
8462
|
-
recoveryGap:
|
|
8463
|
-
deliveryIssue:
|
|
8464
|
-
routes:
|
|
8465
|
-
});
|
|
8466
|
-
var ChannelViewSchema =
|
|
8467
|
-
configured:
|
|
8468
|
-
admissionEnabled:
|
|
8469
|
-
deliveryEnabled:
|
|
8877
|
+
id: z62.string().uuid(),
|
|
8878
|
+
state: z62.enum(["active", "paused", "opted_out", "disconnected", "needs_reverification"]),
|
|
8879
|
+
revision: z62.number().int().nonnegative(),
|
|
8880
|
+
generation: z62.number().int().nonnegative(),
|
|
8881
|
+
maskedPhone: z62.string(),
|
|
8882
|
+
contactPhone: z62.string(),
|
|
8883
|
+
lastActivityAt: z62.string().nullable(),
|
|
8884
|
+
recoveryGap: z62.string().nullable().optional(),
|
|
8885
|
+
deliveryIssue: z62.string().nullable().optional(),
|
|
8886
|
+
routes: z62.array(z62.object({ agentId: z62.string().uuid(), name: z62.string(), alias: z62.string() }))
|
|
8887
|
+
});
|
|
8888
|
+
var ChannelViewSchema = z62.object({
|
|
8889
|
+
configured: z62.boolean(),
|
|
8890
|
+
admissionEnabled: z62.boolean(),
|
|
8891
|
+
deliveryEnabled: z62.boolean(),
|
|
8470
8892
|
binding: ChannelBindingSchema.nullable()
|
|
8471
8893
|
});
|
|
8472
8894
|
var ChannelUpdateSchema = ChannelSettingsSchema.extend({
|
|
8473
|
-
bindingId:
|
|
8474
|
-
expectedRevision:
|
|
8475
|
-
});
|
|
8476
|
-
var ChannelDisconnectSchema =
|
|
8477
|
-
bindingId:
|
|
8478
|
-
expectedRevision:
|
|
8479
|
-
});
|
|
8480
|
-
var ChannelRequestsInputSchema =
|
|
8481
|
-
before:
|
|
8482
|
-
limit:
|
|
8483
|
-
});
|
|
8484
|
-
var ChannelRequestSchema =
|
|
8485
|
-
id:
|
|
8486
|
-
reference:
|
|
8487
|
-
agentId:
|
|
8488
|
-
jobId:
|
|
8489
|
-
state:
|
|
8490
|
-
reason:
|
|
8491
|
-
deliveryState:
|
|
8492
|
-
deliveryReason:
|
|
8895
|
+
bindingId: z62.string().uuid(),
|
|
8896
|
+
expectedRevision: z62.number().int().nonnegative()
|
|
8897
|
+
});
|
|
8898
|
+
var ChannelDisconnectSchema = z62.object({
|
|
8899
|
+
bindingId: z62.string().uuid(),
|
|
8900
|
+
expectedRevision: z62.number().int().nonnegative()
|
|
8901
|
+
});
|
|
8902
|
+
var ChannelRequestsInputSchema = z62.object({
|
|
8903
|
+
before: z62.string().uuid().optional(),
|
|
8904
|
+
limit: z62.number().int().min(1).max(50).default(20)
|
|
8905
|
+
});
|
|
8906
|
+
var ChannelRequestSchema = z62.object({
|
|
8907
|
+
id: z62.string().uuid(),
|
|
8908
|
+
reference: z62.string(),
|
|
8909
|
+
agentId: z62.string().uuid().nullable(),
|
|
8910
|
+
jobId: z62.string().uuid().nullable(),
|
|
8911
|
+
state: z62.string(),
|
|
8912
|
+
reason: z62.string().nullable(),
|
|
8913
|
+
deliveryState: z62.string().nullable(),
|
|
8914
|
+
deliveryReason: z62.string().nullable().optional(),
|
|
8493
8915
|
incomingTransport: ChannelTransportSchema.nullable().optional(),
|
|
8494
8916
|
deliveryTransport: ChannelTransportSchema.nullable().optional(),
|
|
8495
|
-
outboxId:
|
|
8496
|
-
createdAt:
|
|
8497
|
-
});
|
|
8498
|
-
var ChannelRequestsSchema =
|
|
8499
|
-
requests:
|
|
8500
|
-
nextCursor:
|
|
8501
|
-
});
|
|
8502
|
-
var ChannelResendSchema =
|
|
8503
|
-
outboxId:
|
|
8504
|
-
requestKey:
|
|
8505
|
-
acknowledgeDuplicate:
|
|
8506
|
-
});
|
|
8507
|
-
var ChannelEnvironmentSchema =
|
|
8508
|
-
CHANNEL_INGRESS_ENABLED:
|
|
8509
|
-
CHANNEL_ADMISSION_ENABLED:
|
|
8510
|
-
CHANNEL_DELIVERY_ENABLED:
|
|
8511
|
-
CHANNEL_ENVIRONMENT:
|
|
8917
|
+
outboxId: z62.string().uuid().nullable(),
|
|
8918
|
+
createdAt: z62.string()
|
|
8919
|
+
});
|
|
8920
|
+
var ChannelRequestsSchema = z62.object({
|
|
8921
|
+
requests: z62.array(ChannelRequestSchema),
|
|
8922
|
+
nextCursor: z62.string().uuid().nullable()
|
|
8923
|
+
});
|
|
8924
|
+
var ChannelResendSchema = z62.object({
|
|
8925
|
+
outboxId: z62.string().uuid(),
|
|
8926
|
+
requestKey: z62.string().uuid(),
|
|
8927
|
+
acknowledgeDuplicate: z62.literal(true)
|
|
8928
|
+
});
|
|
8929
|
+
var ChannelEnvironmentSchema = z62.object({
|
|
8930
|
+
CHANNEL_INGRESS_ENABLED: z62.enum(["true", "false"]).default("false").transform((v) => v === "true"),
|
|
8931
|
+
CHANNEL_ADMISSION_ENABLED: z62.enum(["true", "false"]).default("false").transform((v) => v === "true"),
|
|
8932
|
+
CHANNEL_DELIVERY_ENABLED: z62.enum(["true", "false"]).default("false").transform((v) => v === "true"),
|
|
8933
|
+
CHANNEL_ENVIRONMENT: z62.string().min(1).max(100).default("development"),
|
|
8512
8934
|
/** Key ID recorded in new ciphertext; must name an entry in CHANNEL_KEYS. */
|
|
8513
|
-
CHANNEL_KEY_ID:
|
|
8935
|
+
CHANNEL_KEY_ID: z62.string().regex(/^[A-Za-z0-9_-]{1,64}$/).optional(),
|
|
8514
8936
|
/** JSON map of key ID to 64-hex key. Retired keys stay while ciphertext still uses them. */
|
|
8515
|
-
CHANNEL_KEYS:
|
|
8516
|
-
CHANNEL_LOOKUP_KEY:
|
|
8517
|
-
CHANNEL_DASHBOARD_URL:
|
|
8937
|
+
CHANNEL_KEYS: z62.string().max(4096).optional(),
|
|
8938
|
+
CHANNEL_LOOKUP_KEY: z62.string().regex(/^[a-f0-9]{64}$/i).optional(),
|
|
8939
|
+
CHANNEL_DASHBOARD_URL: z62.string().max(2048).url().refine((value) => {
|
|
8518
8940
|
const url = new URL(value);
|
|
8519
8941
|
return !url.username && !url.password && !url.search && !url.hash && url.pathname === "/" && (url.protocol === "https:" || url.protocol === "http:" && ["localhost", "127.0.0.1"].includes(url.hostname));
|
|
8520
8942
|
}).optional(),
|
|
8521
|
-
LINQ_API_TOKEN:
|
|
8522
|
-
LINQ_WEBHOOK_SECRET:
|
|
8523
|
-
LINQ_ACCOUNT_ID:
|
|
8524
|
-
LINQ_LINE_ID:
|
|
8525
|
-
LINQ_LINE_PHONE:
|
|
8943
|
+
LINQ_API_TOKEN: z62.string().min(1).optional(),
|
|
8944
|
+
LINQ_WEBHOOK_SECRET: z62.string().min(1).optional(),
|
|
8945
|
+
LINQ_ACCOUNT_ID: z62.string().min(1).max(200).optional(),
|
|
8946
|
+
LINQ_LINE_ID: z62.string().min(1).max(200).optional(),
|
|
8947
|
+
LINQ_LINE_PHONE: z62.string().regex(/^\+[1-9]\d{7,14}$/).optional()
|
|
8526
8948
|
});
|
|
8527
8949
|
|
|
8528
8950
|
// ../../packages/shared/dist/schemas/launcher-access.schemas.js
|
|
8529
|
-
import { z as
|
|
8530
|
-
var LauncherAccessStatusSchema =
|
|
8531
|
-
var LauncherAccessStateSchema =
|
|
8951
|
+
import { z as z63 } from "zod";
|
|
8952
|
+
var LauncherAccessStatusSchema = z63.enum(["requested", "approved", "declined", "revoked"]);
|
|
8953
|
+
var LauncherAccessStateSchema = z63.enum([
|
|
8532
8954
|
"member",
|
|
8533
8955
|
"requested",
|
|
8534
8956
|
"declined",
|
|
@@ -8536,32 +8958,32 @@ var LauncherAccessStateSchema = z62.enum([
|
|
|
8536
8958
|
"none"
|
|
8537
8959
|
]);
|
|
8538
8960
|
var LAUNCHER_ACCESS_USE_CASE_MAX = 1e3;
|
|
8539
|
-
var LauncherAccessStatusResultSchema =
|
|
8540
|
-
var LauncherAccessRequestInputSchema =
|
|
8541
|
-
useCase:
|
|
8542
|
-
source:
|
|
8961
|
+
var LauncherAccessStatusResultSchema = z63.object({ state: LauncherAccessStateSchema, xLinked: z63.boolean() }).strict();
|
|
8962
|
+
var LauncherAccessRequestInputSchema = z63.object({
|
|
8963
|
+
useCase: z63.string().trim().min(1).max(LAUNCHER_ACCESS_USE_CASE_MAX),
|
|
8964
|
+
source: z63.string().trim().min(1).max(100).optional()
|
|
8543
8965
|
}).strict();
|
|
8544
8966
|
|
|
8545
8967
|
// ../../packages/shared/dist/schemas/managed-unmetered.schemas.js
|
|
8546
|
-
import { z as
|
|
8547
|
-
var id2 =
|
|
8548
|
-
var TurnTraceUsageSchema =
|
|
8968
|
+
import { z as z64 } from "zod";
|
|
8969
|
+
var id2 = z64.string().min(1).max(256);
|
|
8970
|
+
var TurnTraceUsageSchema = z64.object({
|
|
8549
8971
|
sessionId: id2,
|
|
8550
8972
|
turnId: id2,
|
|
8551
|
-
spans:
|
|
8973
|
+
spans: z64.number().int().nonnegative(),
|
|
8552
8974
|
/** `chat` spans: the model calls the trace shows, finished or not. */
|
|
8553
|
-
modelCalls:
|
|
8975
|
+
modelCalls: z64.number().int().nonnegative(),
|
|
8554
8976
|
rootOnly: AllowanceReportedUsageSchema.nullable(),
|
|
8555
8977
|
total: AllowanceReportedUsageSchema.nullable(),
|
|
8556
|
-
helpers:
|
|
8557
|
-
invalid:
|
|
8978
|
+
helpers: z64.array(z64.object({ subagentId: id2, usage: AllowanceReportedUsageSchema.nullable() }).strict()).max(256),
|
|
8979
|
+
invalid: z64.boolean()
|
|
8558
8980
|
}).strict();
|
|
8559
8981
|
|
|
8560
8982
|
// ../../packages/shared/dist/schemas/hosted-credit-plans.schemas.js
|
|
8561
|
-
import { z as
|
|
8983
|
+
import { z as z66 } from "zod";
|
|
8562
8984
|
|
|
8563
8985
|
// ../../packages/shared/dist/schemas/hosted-subscription.schemas.js
|
|
8564
|
-
import { z as
|
|
8986
|
+
import { z as z65 } from "zod";
|
|
8565
8987
|
var STRIPE_ENVIRONMENTS = ["test", "live"];
|
|
8566
8988
|
var STRIPE_CHECKOUT_STATUSES = ["open", "completed", "expired", "abandoned"];
|
|
8567
8989
|
var STRIPE_SUBSCRIPTION_STATUSES = [
|
|
@@ -8574,42 +8996,42 @@ var STRIPE_SUBSCRIPTION_STATUSES = [
|
|
|
8574
8996
|
"unpaid",
|
|
8575
8997
|
"paused"
|
|
8576
8998
|
];
|
|
8577
|
-
var StripeCheckoutSessionSchema =
|
|
8578
|
-
operationId:
|
|
8579
|
-
status:
|
|
8580
|
-
url:
|
|
8581
|
-
expiresAt:
|
|
8582
|
-
reused:
|
|
8583
|
-
});
|
|
8584
|
-
var StripePortalSessionSchema =
|
|
8585
|
-
url:
|
|
8586
|
-
returnUrl:
|
|
8587
|
-
configurationId:
|
|
8588
|
-
});
|
|
8589
|
-
var StripeSubscriptionSummarySchema =
|
|
8590
|
-
asOf:
|
|
8591
|
-
environment:
|
|
8592
|
-
planVersion:
|
|
8593
|
-
hasCustomer:
|
|
8594
|
-
subscription:
|
|
8595
|
-
status:
|
|
8596
|
-
cancelAtPeriodEnd:
|
|
8597
|
-
currentPeriodStart:
|
|
8598
|
-
currentPeriodEnd:
|
|
8599
|
-
duplicateFlagged:
|
|
8999
|
+
var StripeCheckoutSessionSchema = z65.object({
|
|
9000
|
+
operationId: z65.string(),
|
|
9001
|
+
status: z65.enum(STRIPE_CHECKOUT_STATUSES),
|
|
9002
|
+
url: z65.string().url().nullable(),
|
|
9003
|
+
expiresAt: z65.string().datetime().nullable(),
|
|
9004
|
+
reused: z65.boolean()
|
|
9005
|
+
});
|
|
9006
|
+
var StripePortalSessionSchema = z65.object({
|
|
9007
|
+
url: z65.string().url(),
|
|
9008
|
+
returnUrl: z65.string().url(),
|
|
9009
|
+
configurationId: z65.string()
|
|
9010
|
+
});
|
|
9011
|
+
var StripeSubscriptionSummarySchema = z65.object({
|
|
9012
|
+
asOf: z65.string().datetime(),
|
|
9013
|
+
environment: z65.enum(STRIPE_ENVIRONMENTS),
|
|
9014
|
+
planVersion: z65.string(),
|
|
9015
|
+
hasCustomer: z65.boolean(),
|
|
9016
|
+
subscription: z65.object({
|
|
9017
|
+
status: z65.enum(STRIPE_SUBSCRIPTION_STATUSES),
|
|
9018
|
+
cancelAtPeriodEnd: z65.boolean(),
|
|
9019
|
+
currentPeriodStart: z65.string().datetime().nullable(),
|
|
9020
|
+
currentPeriodEnd: z65.string().datetime().nullable(),
|
|
9021
|
+
duplicateFlagged: z65.boolean()
|
|
8600
9022
|
}).nullable(),
|
|
8601
9023
|
/** The furthest paid-until across unrevoked access periods; distinct from lifecycle state. */
|
|
8602
|
-
paidUntil:
|
|
8603
|
-
accessActive:
|
|
8604
|
-
blockingReasons:
|
|
8605
|
-
reason:
|
|
8606
|
-
detail:
|
|
9024
|
+
paidUntil: z65.string().datetime().nullable(),
|
|
9025
|
+
accessActive: z65.boolean(),
|
|
9026
|
+
blockingReasons: z65.array(z65.object({
|
|
9027
|
+
reason: z65.string(),
|
|
9028
|
+
detail: z65.string()
|
|
8607
9029
|
}))
|
|
8608
9030
|
});
|
|
8609
9031
|
|
|
8610
9032
|
// ../../packages/shared/dist/schemas/hosted-credit-plans.schemas.js
|
|
8611
|
-
var HostedCreditPlanIdSchema =
|
|
8612
|
-
var HostedCreditPackIdSchema =
|
|
9033
|
+
var HostedCreditPlanIdSchema = z66.enum(["starter", "pro", "scale"]);
|
|
9034
|
+
var HostedCreditPackIdSchema = z66.enum(["credits_500", "credits_1000", "credits_2000"]);
|
|
8613
9035
|
var HOSTED_CREDIT_PLANS = Object.freeze({
|
|
8614
9036
|
starter: {
|
|
8615
9037
|
id: "starter",
|
|
@@ -8635,63 +9057,63 @@ var HOSTED_CREDIT_OPERATION_STATUSES = [
|
|
|
8635
9057
|
"expired",
|
|
8636
9058
|
"cancelled"
|
|
8637
9059
|
];
|
|
8638
|
-
var HostedCreditOperationStatusSchema =
|
|
8639
|
-
var HostedCreditPlanRefreshDeferralSchema =
|
|
9060
|
+
var HostedCreditOperationStatusSchema = z66.enum(HOSTED_CREDIT_OPERATION_STATUSES);
|
|
9061
|
+
var HostedCreditPlanRefreshDeferralSchema = z66.enum([
|
|
8640
9062
|
"trial_reservation_held",
|
|
8641
9063
|
"legacy_migration_required",
|
|
8642
9064
|
"environment_ambiguous"
|
|
8643
9065
|
]);
|
|
8644
|
-
var HostedCreditChangeSchema =
|
|
8645
|
-
operationId:
|
|
9066
|
+
var HostedCreditChangeSchema = z66.object({
|
|
9067
|
+
operationId: z66.string(),
|
|
8646
9068
|
target: HostedCreditPlanIdSchema,
|
|
8647
9069
|
status: HostedCreditOperationStatusSchema,
|
|
8648
|
-
effectiveAt:
|
|
8649
|
-
credits:
|
|
8650
|
-
estimatedPriceMinorUnits:
|
|
8651
|
-
paymentUrl:
|
|
9070
|
+
effectiveAt: z66.string().datetime(),
|
|
9071
|
+
credits: z66.string(),
|
|
9072
|
+
estimatedPriceMinorUnits: z66.number().int(),
|
|
9073
|
+
paymentUrl: z66.string().url().nullable()
|
|
8652
9074
|
});
|
|
8653
|
-
var HostedCreditCatalogSchema =
|
|
9075
|
+
var HostedCreditCatalogSchema = z66.object({
|
|
8654
9076
|
pendingTopup: StripeCheckoutSessionSchema.nullable(),
|
|
8655
|
-
version:
|
|
8656
|
-
enabled:
|
|
8657
|
-
salesAvailable:
|
|
8658
|
-
blockingReason:
|
|
8659
|
-
plans:
|
|
9077
|
+
version: z66.string(),
|
|
9078
|
+
enabled: z66.boolean(),
|
|
9079
|
+
salesAvailable: z66.boolean(),
|
|
9080
|
+
blockingReason: z66.string().nullable(),
|
|
9081
|
+
plans: z66.array(z66.object({
|
|
8660
9082
|
id: HostedCreditPlanIdSchema,
|
|
8661
|
-
name:
|
|
8662
|
-
priceMinorUnits:
|
|
8663
|
-
credits:
|
|
8664
|
-
concurrency:
|
|
8665
|
-
usdcMinorUnits:
|
|
9083
|
+
name: z66.string(),
|
|
9084
|
+
priceMinorUnits: z66.number().int(),
|
|
9085
|
+
credits: z66.string(),
|
|
9086
|
+
concurrency: z66.number().int(),
|
|
9087
|
+
usdcMinorUnits: z66.string()
|
|
8666
9088
|
})),
|
|
8667
|
-
packs:
|
|
9089
|
+
packs: z66.array(z66.object({
|
|
8668
9090
|
id: HostedCreditPackIdSchema,
|
|
8669
|
-
priceMinorUnits:
|
|
8670
|
-
credits:
|
|
9091
|
+
priceMinorUnits: z66.number().int(),
|
|
9092
|
+
credits: z66.string()
|
|
8671
9093
|
})),
|
|
8672
9094
|
activePlan: HostedCreditPlanIdSchema.nullable(),
|
|
8673
9095
|
/** Set when the paid plan could not be applied during this read; see the deferral schema. */
|
|
8674
9096
|
planRefreshDeferred: HostedCreditPlanRefreshDeferralSchema.nullable().optional(),
|
|
8675
9097
|
pendingChange: HostedCreditChangeSchema.nullable()
|
|
8676
9098
|
});
|
|
8677
|
-
var HostedCreditUsageSchema =
|
|
8678
|
-
id:
|
|
8679
|
-
agentName:
|
|
8680
|
-
createdAt:
|
|
8681
|
-
status:
|
|
8682
|
-
rateCardVersion:
|
|
8683
|
-
reserved:
|
|
8684
|
-
charged:
|
|
8685
|
-
restored:
|
|
9099
|
+
var HostedCreditUsageSchema = z66.object({
|
|
9100
|
+
id: z66.string(),
|
|
9101
|
+
agentName: z66.string().nullable(),
|
|
9102
|
+
createdAt: z66.string().datetime(),
|
|
9103
|
+
status: z66.enum(["held", "settled", "released"]),
|
|
9104
|
+
rateCardVersion: z66.string(),
|
|
9105
|
+
reserved: z66.string(),
|
|
9106
|
+
charged: z66.string().nullable(),
|
|
9107
|
+
restored: z66.string(),
|
|
8686
9108
|
usage: AllowanceReportedUsageSchema.nullable(),
|
|
8687
|
-
helperTurns:
|
|
9109
|
+
helperTurns: z66.number().int().nonnegative()
|
|
8688
9110
|
});
|
|
8689
9111
|
|
|
8690
9112
|
// ../../packages/shared/dist/schemas/routing-kill-switch.schemas.js
|
|
8691
|
-
import { z as
|
|
8692
|
-
var
|
|
8693
|
-
var ActorSchema =
|
|
8694
|
-
var TimestampSchema =
|
|
9113
|
+
import { z as z67 } from "zod";
|
|
9114
|
+
var ReasonSchema2 = z67.string().trim().min(1).max(500);
|
|
9115
|
+
var ActorSchema = z67.string().trim().min(1).max(200);
|
|
9116
|
+
var TimestampSchema = z67.string().datetime();
|
|
8695
9117
|
var ROUTING_KILL_SWITCH_SOURCES = [
|
|
8696
9118
|
/** Process configuration. Survives nothing being reachable, and cannot be released at runtime. */
|
|
8697
9119
|
"environment",
|
|
@@ -8701,18 +9123,18 @@ var ROUTING_KILL_SWITCH_SOURCES = [
|
|
|
8701
9123
|
"alert_action"
|
|
8702
9124
|
];
|
|
8703
9125
|
var ROUTING_KILL_SWITCH_ACTION = "engage_routing_kill_switch";
|
|
8704
|
-
var RoutingKillSwitchDirectiveSchema =
|
|
8705
|
-
action:
|
|
9126
|
+
var RoutingKillSwitchDirectiveSchema = z67.object({
|
|
9127
|
+
action: z67.literal(ROUTING_KILL_SWITCH_ACTION),
|
|
8706
9128
|
/** The alert id, so the record names the measurement that asked for the stop. */
|
|
8707
|
-
alert:
|
|
8708
|
-
reason:
|
|
9129
|
+
alert: z67.string().trim().min(1).max(128),
|
|
9130
|
+
reason: ReasonSchema2,
|
|
8709
9131
|
raisedBy: ActorSchema,
|
|
8710
9132
|
raisedAt: TimestampSchema
|
|
8711
9133
|
}).strict();
|
|
8712
|
-
var RoutingKillSwitchStateSchema =
|
|
8713
|
-
engaged:
|
|
8714
|
-
source:
|
|
8715
|
-
reason:
|
|
9134
|
+
var RoutingKillSwitchStateSchema = z67.object({
|
|
9135
|
+
engaged: z67.boolean(),
|
|
9136
|
+
source: z67.enum(ROUTING_KILL_SWITCH_SOURCES).nullable(),
|
|
9137
|
+
reason: ReasonSchema2.nullable(),
|
|
8716
9138
|
engagedBy: ActorSchema.nullable(),
|
|
8717
9139
|
engagedAt: TimestampSchema.nullable()
|
|
8718
9140
|
}).strict().superRefine((state, ctx) => {
|
|
@@ -8737,12 +9159,12 @@ var ROUTING_KILL_SWITCH_RELEASED = Object.freeze({
|
|
|
8737
9159
|
});
|
|
8738
9160
|
|
|
8739
9161
|
// ../../packages/shared/dist/schemas/hosted-market-approval.schemas.js
|
|
8740
|
-
import { z as
|
|
9162
|
+
import { z as z68 } from "zod";
|
|
8741
9163
|
var HOSTED_MARKET_SCOPES = ["work", "publish", "judge"];
|
|
8742
|
-
var HostedMarketScopeSchema =
|
|
8743
|
-
var HostedMarketScopesSchema =
|
|
8744
|
-
var HostedMarketAgentSettingsSchema =
|
|
8745
|
-
agentId:
|
|
9164
|
+
var HostedMarketScopeSchema = z68.enum(HOSTED_MARKET_SCOPES);
|
|
9165
|
+
var HostedMarketScopesSchema = z68.array(HostedMarketScopeSchema).max(HOSTED_MARKET_SCOPES.length).refine((scopes) => new Set(scopes).size === scopes.length, "Duplicate market scopes");
|
|
9166
|
+
var HostedMarketAgentSettingsSchema = z68.object({
|
|
9167
|
+
agentId: z68.string(),
|
|
8746
9168
|
scopes: HostedMarketScopesSchema,
|
|
8747
9169
|
/** USDC base units an agent may lock in task rewards per window; '0' publishes nothing. */
|
|
8748
9170
|
escrowLimit: SwarmUsdcAtomicAmountSchema,
|
|
@@ -8754,60 +9176,60 @@ var HostedMarketAgentSettingsSchema = z67.object({
|
|
|
8754
9176
|
/** Of the rewards funded this window, how much refunds and earned rewards gave back. */
|
|
8755
9177
|
escrowRestored: SwarmUsdcAtomicAmountSchema.optional()
|
|
8756
9178
|
});
|
|
8757
|
-
var HostedMarketAgentSettingsInputSchema =
|
|
8758
|
-
agentId:
|
|
9179
|
+
var HostedMarketAgentSettingsInputSchema = z68.object({
|
|
9180
|
+
agentId: z68.string().uuid(),
|
|
8759
9181
|
scopes: HostedMarketScopesSchema,
|
|
8760
9182
|
escrowLimit: SwarmUsdcAtomicAmountSchema
|
|
8761
9183
|
}).strict();
|
|
8762
9184
|
var HOSTED_MARKET_APPROVAL_TTL_MS = 30 * 6e4;
|
|
8763
|
-
var HostedMarketApprovalPreviewSchema =
|
|
8764
|
-
taskId:
|
|
8765
|
-
title:
|
|
8766
|
-
description:
|
|
8767
|
-
mode:
|
|
9185
|
+
var HostedMarketApprovalPreviewSchema = z68.object({
|
|
9186
|
+
taskId: z68.string().nullable(),
|
|
9187
|
+
title: z68.string().nullable(),
|
|
9188
|
+
description: z68.string().nullable(),
|
|
9189
|
+
mode: z68.string().nullable(),
|
|
8768
9190
|
/** USDC base units: the reward a create escrows, or the bid amount. */
|
|
8769
|
-
reward:
|
|
8770
|
-
deadline:
|
|
8771
|
-
});
|
|
8772
|
-
var HostedMarketApprovalSchema =
|
|
8773
|
-
id:
|
|
8774
|
-
agentId:
|
|
8775
|
-
agentName:
|
|
8776
|
-
jobId:
|
|
8777
|
-
action:
|
|
8778
|
-
status:
|
|
8779
|
-
code:
|
|
9191
|
+
reward: z68.string().nullable(),
|
|
9192
|
+
deadline: z68.string().nullable()
|
|
9193
|
+
});
|
|
9194
|
+
var HostedMarketApprovalSchema = z68.object({
|
|
9195
|
+
id: z68.string().uuid(),
|
|
9196
|
+
agentId: z68.string(),
|
|
9197
|
+
agentName: z68.string().nullable(),
|
|
9198
|
+
jobId: z68.string().uuid().optional(),
|
|
9199
|
+
action: z68.enum(HOSTED_MARKET_WRITE_ACTIONS),
|
|
9200
|
+
status: z68.enum(SWARM_PURCHASE_APPROVAL_STATUSES),
|
|
9201
|
+
code: z68.string().nullable(),
|
|
8780
9202
|
/** The agent's request key; the approved write runs under it, so it is idempotent. */
|
|
8781
|
-
requestKey:
|
|
8782
|
-
apiOrigin:
|
|
9203
|
+
requestKey: z68.string().uuid(),
|
|
9204
|
+
apiOrigin: z68.string().url(),
|
|
8783
9205
|
/** The market x402 recipient, fixed when the owner approves. */
|
|
8784
|
-
payTo:
|
|
9206
|
+
payTo: z68.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),
|
|
8785
9207
|
/** The x402 price of the write, USDC base units. */
|
|
8786
|
-
amount:
|
|
9208
|
+
amount: z68.string().regex(/^[1-9][0-9]{0,17}$/),
|
|
8787
9209
|
/** The part of `amount` that funds a task reward (ADR-0187); '0' for a plain fee. */
|
|
8788
|
-
escrowAmount:
|
|
9210
|
+
escrowAmount: z68.string().regex(/^[0-9]{1,18}$/),
|
|
8789
9211
|
preview: HostedMarketApprovalPreviewSchema,
|
|
8790
9212
|
/** The write's recorded outcome once it ran: completed, pending or failed. */
|
|
8791
|
-
outcome:
|
|
8792
|
-
createdAt:
|
|
8793
|
-
expiresAt:
|
|
8794
|
-
decidedAt:
|
|
9213
|
+
outcome: z68.enum(["completed", "pending", "failed"]).nullable(),
|
|
9214
|
+
createdAt: z68.string(),
|
|
9215
|
+
expiresAt: z68.string(),
|
|
9216
|
+
decidedAt: z68.string().nullable()
|
|
8795
9217
|
});
|
|
8796
|
-
var HostedMarketApprovalListSchema =
|
|
8797
|
-
enabled:
|
|
8798
|
-
approvals:
|
|
9218
|
+
var HostedMarketApprovalListSchema = z68.object({
|
|
9219
|
+
enabled: z68.boolean(),
|
|
9220
|
+
approvals: z68.array(HostedMarketApprovalSchema)
|
|
8799
9221
|
});
|
|
8800
|
-
var HostedMarketApprovalIdSchema =
|
|
9222
|
+
var HostedMarketApprovalIdSchema = z68.object({ approvalId: z68.string().uuid() }).strict();
|
|
8801
9223
|
var HostedMarketApprovalConfirmSchema = HostedMarketApprovalIdSchema.extend({
|
|
8802
9224
|
consentTextVersion: SwarmConsentTextVersionSchema
|
|
8803
9225
|
}).strict();
|
|
8804
|
-
var HostedMarketApprovalPreparedSchema =
|
|
9226
|
+
var HostedMarketApprovalPreparedSchema = z68.object({
|
|
8805
9227
|
approval: HostedMarketApprovalSchema,
|
|
8806
9228
|
consent: SwarmConsentSchema
|
|
8807
9229
|
});
|
|
8808
9230
|
|
|
8809
9231
|
// ../../packages/shared/dist/schemas/market-wakeup.schemas.js
|
|
8810
|
-
import { z as
|
|
9232
|
+
import { z as z69 } from "zod";
|
|
8811
9233
|
var MARKET_WAKEUP_KINDS = [
|
|
8812
9234
|
"pitch_selected",
|
|
8813
9235
|
"bid_won",
|
|
@@ -8825,430 +9247,26 @@ var MARKET_WAKEUP_KINDS = [
|
|
|
8825
9247
|
"claim_release_cost_rising",
|
|
8826
9248
|
"new_task"
|
|
8827
9249
|
];
|
|
8828
|
-
var MarketWakeupKindSchema =
|
|
9250
|
+
var MarketWakeupKindSchema = z69.enum(MARKET_WAKEUP_KINDS);
|
|
8829
9251
|
var MARKET_WATCH_MODES = ["bounty", "claim", "pitch", "benchmark", "auction"];
|
|
8830
|
-
var MarketWatchModeSchema =
|
|
9252
|
+
var MarketWatchModeSchema = z69.enum(MARKET_WATCH_MODES);
|
|
8831
9253
|
var MARKET_WATCH_MAX_WAKEUPS_PER_DAY = 48;
|
|
8832
|
-
var MarketWatchSchema =
|
|
8833
|
-
enabled:
|
|
8834
|
-
modes:
|
|
9254
|
+
var MarketWatchSchema = z69.object({
|
|
9255
|
+
enabled: z69.boolean(),
|
|
9256
|
+
modes: z69.array(MarketWatchModeSchema).max(MARKET_WATCH_MODES.length),
|
|
8835
9257
|
/** Minimum reward in USDC, as a decimal string with at most six decimal places. */
|
|
8836
|
-
minRewardUsdc:
|
|
9258
|
+
minRewardUsdc: z69.string().regex(/^\d{1,12}(\.\d{1,6})?$/).default("0"),
|
|
8837
9259
|
/** Case-insensitive; a task matches when its description or tags contain any keyword. */
|
|
8838
|
-
keywords:
|
|
8839
|
-
maxWakeupsPerDay:
|
|
9260
|
+
keywords: z69.array(z69.string().trim().min(2).max(40)).max(10),
|
|
9261
|
+
maxWakeupsPerDay: z69.number().int().min(1).max(MARKET_WATCH_MAX_WAKEUPS_PER_DAY)
|
|
8840
9262
|
}).strict();
|
|
8841
9263
|
var MarketWatchInputSchema = MarketWatchSchema.extend({
|
|
8842
|
-
agentId:
|
|
9264
|
+
agentId: z69.string().uuid()
|
|
8843
9265
|
}).strict();
|
|
8844
9266
|
var MarketWatchViewSchema = MarketWatchSchema.extend({
|
|
8845
|
-
agentId:
|
|
8846
|
-
updatedAt:
|
|
8847
|
-
});
|
|
8848
|
-
|
|
8849
|
-
// ../../packages/shared/dist/schemas/memory.schemas.js
|
|
8850
|
-
import { z as z69 } from "zod";
|
|
8851
|
-
var MEMORY_DOCUMENT_MAX_BYTES = 65536;
|
|
8852
|
-
var MEMORY_ARCHIVE_RETENTION_DAYS = 30;
|
|
8853
|
-
var MEMORY_PATH_MAX_LENGTH = 200;
|
|
8854
|
-
var MEMORY_PATH_MAX_DEPTH = 6;
|
|
8855
|
-
var MEMORY_PATH_SEGMENT_MAX_BYTES = 100;
|
|
8856
|
-
var MEMORY_SEARCH_QUERY_MAX_LENGTH = 200;
|
|
8857
|
-
var MEMORY_SEARCH_MAX_RESULTS = 20;
|
|
8858
|
-
var MEMORY_HISTORY_MAX_RESULTS = 50;
|
|
8859
|
-
var MEMORY_REASON_MAX_LENGTH = 500;
|
|
8860
|
-
var MemoryScopeSchema = z69.enum(["agent", "swarm"]);
|
|
8861
|
-
var MemoryTrustSchema = z69.enum(["owner", "agent", "tainted"]);
|
|
8862
|
-
var MemoryRevisionStatusSchema = z69.enum(["applied", "proposed", "approved", "rejected"]);
|
|
8863
|
-
var MemoryActorSchema = z69.enum(["owner", "agent"]);
|
|
8864
|
-
var MemoryOperationSchema = z69.enum([
|
|
8865
|
-
"create",
|
|
8866
|
-
"replace",
|
|
8867
|
-
"append",
|
|
8868
|
-
"edit",
|
|
8869
|
-
"archive",
|
|
8870
|
-
"rollback",
|
|
8871
|
-
"restore",
|
|
8872
|
-
"promote"
|
|
8873
|
-
]);
|
|
8874
|
-
var MemoryWriteModeSchema = z69.enum(["replace", "append"]);
|
|
8875
|
-
var MemoryWriteOutcomeSchema = z69.enum(["applied", "proposed"]);
|
|
8876
|
-
var LauncherJobSourceSchema = z69.enum([
|
|
8877
|
-
"dashboard",
|
|
8878
|
-
"imessage",
|
|
8879
|
-
"peer",
|
|
8880
|
-
"schedule",
|
|
8881
|
-
"wait",
|
|
8882
|
-
"inbox",
|
|
8883
|
-
// Implements: ADR-0182. A backend-owned job that executes an owner-approved purchase; it runs
|
|
8884
|
-
// no model turn.
|
|
8885
|
-
"purchase",
|
|
8886
|
-
// ADR-0189. A market event relevant to the swarm wallet woke the responsible agent.
|
|
8887
|
-
"market"
|
|
8888
|
-
]);
|
|
8889
|
-
var MEMORY_CORE_TEMPLATE_SECTIONS = [
|
|
8890
|
-
"Owner",
|
|
8891
|
-
"Preferences",
|
|
8892
|
-
"Commitments",
|
|
8893
|
-
"Open threads"
|
|
8894
|
-
];
|
|
8895
|
-
var MEMORY_CORE_TEMPLATE = MEMORY_CORE_TEMPLATE_SECTIONS.map((section2) => `## ${section2}
|
|
8896
|
-
`).join("\n");
|
|
8897
|
-
var MemoryCoreTemplateEnabledSchema = z69.enum(["true", "false"]).default("false").transform((value) => value === "true");
|
|
8898
|
-
function utf8ByteLength(value) {
|
|
8899
|
-
let bytes2 = 0;
|
|
8900
|
-
for (let i = 0; i < value.length; i++) {
|
|
8901
|
-
const code = value.charCodeAt(i);
|
|
8902
|
-
if (code < 128)
|
|
8903
|
-
bytes2 += 1;
|
|
8904
|
-
else if (code < 2048)
|
|
8905
|
-
bytes2 += 2;
|
|
8906
|
-
else if (code >= 55296 && code <= 56319 && i + 1 < value.length && (value.charCodeAt(i + 1) & 64512) === 56320) {
|
|
8907
|
-
bytes2 += 4;
|
|
8908
|
-
i++;
|
|
8909
|
-
} else
|
|
8910
|
-
bytes2 += 3;
|
|
8911
|
-
}
|
|
8912
|
-
return bytes2;
|
|
8913
|
-
}
|
|
8914
|
-
var SEGMENT = /^[\p{L}\p{N}][\p{L}\p{N} ._-]*$/u;
|
|
8915
|
-
var forbiddenPathCharacter = (value) => [...value].some((c) => {
|
|
8916
|
-
const code = c.charCodeAt(0);
|
|
8917
|
-
return code < 32 || code >= 127 && code <= 159 || c === "\\";
|
|
8918
|
-
});
|
|
8919
|
-
var memoryContentIsText = (value) => ![...value].some((c) => {
|
|
8920
|
-
const code = c.charCodeAt(0);
|
|
8921
|
-
return code < 32 && code !== 9 && code !== 10 && code !== 13 || code === 127;
|
|
8922
|
-
});
|
|
8923
|
-
function normalizeMemoryPath(raw) {
|
|
8924
|
-
const value = raw.normalize("NFC").trim();
|
|
8925
|
-
if (!value)
|
|
8926
|
-
return { ok: false, reason: "Path is empty" };
|
|
8927
|
-
if (forbiddenPathCharacter(value))
|
|
8928
|
-
return { ok: false, reason: "Path contains control characters or backslashes" };
|
|
8929
|
-
if (value.startsWith("/") || value.startsWith("~"))
|
|
8930
|
-
return { ok: false, reason: "Path must be relative to its scope" };
|
|
8931
|
-
const segments = value.split("/").filter((part) => part !== "" && part !== ".");
|
|
8932
|
-
if (segments.some((part) => part === ".."))
|
|
8933
|
-
return { ok: false, reason: 'Path must not contain ".."' };
|
|
8934
|
-
if (!segments.length)
|
|
8935
|
-
return { ok: false, reason: "Path is empty" };
|
|
8936
|
-
if (segments.length > MEMORY_PATH_MAX_DEPTH)
|
|
8937
|
-
return { ok: false, reason: `Path is deeper than ${MEMORY_PATH_MAX_DEPTH} segments` };
|
|
8938
|
-
for (const part of segments) {
|
|
8939
|
-
if (!SEGMENT.test(part) || part.endsWith(" ") || part.endsWith("."))
|
|
8940
|
-
return {
|
|
8941
|
-
ok: false,
|
|
8942
|
-
reason: 'Path segments use letters, digits, spaces, ".", "-" and "_" and start with a letter or digit'
|
|
8943
|
-
};
|
|
8944
|
-
if (utf8ByteLength(part) > MEMORY_PATH_SEGMENT_MAX_BYTES)
|
|
8945
|
-
return { ok: false, reason: "Path segment is too long" };
|
|
8946
|
-
}
|
|
8947
|
-
const path3 = segments.join("/");
|
|
8948
|
-
if (path3.length > MEMORY_PATH_MAX_LENGTH)
|
|
8949
|
-
return { ok: false, reason: "Path is too long" };
|
|
8950
|
-
if (!path3.endsWith(".md"))
|
|
8951
|
-
return { ok: false, reason: "Memory documents are markdown (.md)" };
|
|
8952
|
-
return { ok: true, path: path3 };
|
|
8953
|
-
}
|
|
8954
|
-
var MemoryPathSchema = z69.string().max(MEMORY_PATH_MAX_LENGTH * 2).transform((raw, ctx) => {
|
|
8955
|
-
const result = normalizeMemoryPath(raw);
|
|
8956
|
-
if (!result.ok) {
|
|
8957
|
-
ctx.addIssue({ code: "custom", message: result.reason });
|
|
8958
|
-
return z69.NEVER;
|
|
8959
|
-
}
|
|
8960
|
-
return result.path;
|
|
8961
|
-
});
|
|
8962
|
-
var MemoryContentSchema = z69.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`);
|
|
8963
|
-
var ReasonSchema2 = z69.string().trim().max(MEMORY_REASON_MAX_LENGTH).optional();
|
|
8964
|
-
var VersionSchema = z69.number().int().min(0).max(2147483647);
|
|
8965
|
-
var AgentIdSchema = z69.string().uuid();
|
|
8966
|
-
var target = {
|
|
8967
|
-
agentId: AgentIdSchema.optional(),
|
|
8968
|
-
scope: MemoryScopeSchema,
|
|
8969
|
-
path: MemoryPathSchema
|
|
8970
|
-
};
|
|
8971
|
-
var agentScopeNeedsAgent = (value) => value.scope !== "agent" || Boolean(value.agentId);
|
|
8972
|
-
var agentScopeMessage = { message: "agentId is required for the agent scope", path: ["agentId"] };
|
|
8973
|
-
var MemoryTargetInputSchema = z69.object(target).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
8974
|
-
var MemoryTreeInputSchema = z69.object({ agentId: AgentIdSchema.optional(), scope: MemoryScopeSchema.optional() }).strict().refine((value) => value.scope !== "agent" || Boolean(value.agentId), agentScopeMessage);
|
|
8975
|
-
var MemoryWriteInputSchema = z69.object({
|
|
8976
|
-
...target,
|
|
8977
|
-
content: MemoryContentSchema,
|
|
8978
|
-
mode: MemoryWriteModeSchema.default("replace"),
|
|
8979
|
-
expectedVersion: VersionSchema.optional(),
|
|
8980
|
-
reason: ReasonSchema2,
|
|
8981
|
-
/**
|
|
8982
|
-
* The owner was warned that the content looks like a secret (#713) and saves it anyway.
|
|
8983
|
-
* Without it, a write that adds a seed phrase, private key or credential is refused.
|
|
8984
|
-
*/
|
|
8985
|
-
confirmSecrets: z69.boolean().optional()
|
|
8986
|
-
}).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
8987
|
-
var MemoryArchiveInputSchema = z69.object({ ...target, expectedVersion: VersionSchema.optional(), reason: ReasonSchema2 }).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
8988
|
-
var MemoryHistoryInputSchema = z69.object({
|
|
8989
|
-
...target,
|
|
8990
|
-
limit: z69.number().int().min(1).max(MEMORY_HISTORY_MAX_RESULTS).default(20),
|
|
8991
|
-
beforeVersion: VersionSchema.optional()
|
|
8992
|
-
}).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
8993
|
-
var MemoryRollbackInputSchema = z69.object({
|
|
8994
|
-
...target,
|
|
8995
|
-
version: VersionSchema.min(1),
|
|
8996
|
-
expectedVersion: VersionSchema.optional(),
|
|
8997
|
-
reason: ReasonSchema2
|
|
8998
|
-
}).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
8999
|
-
var MemorySearchInputSchema = z69.object({
|
|
9000
|
-
agentId: AgentIdSchema.optional(),
|
|
9001
|
-
scope: MemoryScopeSchema.optional(),
|
|
9002
|
-
query: z69.string().trim().min(1).max(MEMORY_SEARCH_QUERY_MAX_LENGTH),
|
|
9003
|
-
limit: z69.number().int().min(1).max(MEMORY_SEARCH_MAX_RESULTS).default(10),
|
|
9004
|
-
/** Also search the agent's own past jobs (SM-61); needs `agentId`. */
|
|
9005
|
-
includeHistory: z69.boolean().optional()
|
|
9006
|
-
}).strict().refine((value) => value.scope !== "agent" || Boolean(value.agentId), agentScopeMessage);
|
|
9007
|
-
var MemoryForgetInputSchema = z69.object({ agentId: AgentIdSchema.optional(), scope: MemoryScopeSchema, reason: ReasonSchema2 }).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
9008
|
-
var MemoryPromoteInputSchema = z69.object({
|
|
9009
|
-
agentId: AgentIdSchema,
|
|
9010
|
-
scope: MemoryScopeSchema.default("agent"),
|
|
9011
|
-
path: MemoryPathSchema,
|
|
9012
|
-
targetPath: MemoryPathSchema.optional(),
|
|
9013
|
-
expectedVersion: VersionSchema.optional(),
|
|
9014
|
-
reason: ReasonSchema2
|
|
9015
|
-
}).strict();
|
|
9016
|
-
var MemoryDocumentSummarySchema = z69.object({
|
|
9017
|
-
documentId: z69.string().uuid(),
|
|
9018
|
-
scope: MemoryScopeSchema,
|
|
9019
|
-
path: z69.string(),
|
|
9020
|
-
version: z69.number().int(),
|
|
9021
|
-
bytes: z69.number().int(),
|
|
9022
|
-
pinned: z69.boolean(),
|
|
9023
|
-
readOnly: z69.boolean(),
|
|
9024
|
-
updatedAt: z69.string()
|
|
9025
|
-
});
|
|
9026
|
-
var MemoryTreeSchema = z69.object({
|
|
9027
|
-
documents: z69.array(MemoryDocumentSummarySchema),
|
|
9028
|
-
limits: z69.object({
|
|
9029
|
-
documentBytes: z69.number().int(),
|
|
9030
|
-
scopeDocuments: z69.number().int(),
|
|
9031
|
-
pinnedRenderBytes: z69.number().int()
|
|
9032
|
-
})
|
|
9033
|
-
});
|
|
9034
|
-
var MemoryDocumentSchema = MemoryDocumentSummarySchema.extend({
|
|
9035
|
-
content: z69.string(),
|
|
9036
|
-
createdAt: z69.string(),
|
|
9037
|
-
archivedAt: z69.string().nullable(),
|
|
9038
|
-
/** Actor and trust of the revision that produced the current content. */
|
|
9039
|
-
lastActor: MemoryActorSchema.nullable(),
|
|
9040
|
-
lastTrust: MemoryTrustSchema.nullable()
|
|
9041
|
-
});
|
|
9042
|
-
var MemoryRevisionSchema = z69.object({
|
|
9043
|
-
id: z69.string().uuid(),
|
|
9044
|
-
/** Null only for a proposal to create a document that does not exist (yet). */
|
|
9045
|
-
documentId: z69.string().uuid().nullable(),
|
|
9046
|
-
version: z69.number().int(),
|
|
9047
|
-
content: z69.string(),
|
|
9048
|
-
operation: MemoryOperationSchema,
|
|
9049
|
-
status: MemoryRevisionStatusSchema,
|
|
9050
|
-
actor: MemoryActorSchema,
|
|
9051
|
-
actorAgentId: z69.string().nullable(),
|
|
9052
|
-
jobId: z69.string().nullable(),
|
|
9053
|
-
sessionId: z69.string().nullable(),
|
|
9054
|
-
trust: MemoryTrustSchema,
|
|
9055
|
-
/** Why an agent turn had this trust, e.g. the tool that tainted it (SM-51). */
|
|
9056
|
-
trustReason: z69.string().nullable(),
|
|
9057
|
-
reason: z69.string().nullable(),
|
|
9058
|
-
sourceDocumentId: z69.string().uuid().nullable(),
|
|
9059
|
-
sourceVersion: z69.number().int().nullable(),
|
|
9060
|
-
createdAt: z69.string(),
|
|
9061
|
-
decidedAt: z69.string().nullable()
|
|
9062
|
-
});
|
|
9063
|
-
var MemoryHistorySchema = z69.object({
|
|
9064
|
-
document: MemoryDocumentSummarySchema.extend({ archivedAt: z69.string().nullable() }),
|
|
9065
|
-
revisions: z69.array(MemoryRevisionSchema)
|
|
9066
|
-
});
|
|
9067
|
-
var MemoryMutationResultSchema = z69.object({
|
|
9068
|
-
outcome: z69.literal("applied"),
|
|
9069
|
-
document: MemoryDocumentSchema,
|
|
9070
|
-
revision: MemoryRevisionSchema
|
|
9071
|
-
});
|
|
9072
|
-
var MemoryProposedResultSchema = z69.object({
|
|
9073
|
-
outcome: z69.literal("proposed"),
|
|
9074
|
-
scope: MemoryScopeSchema,
|
|
9075
|
-
path: z69.string(),
|
|
9076
|
-
/** The version the proposal was made against; 0 = the document does not exist. */
|
|
9077
|
-
baseVersion: z69.number().int(),
|
|
9078
|
-
document: MemoryDocumentSchema.nullable(),
|
|
9079
|
-
revision: MemoryRevisionSchema
|
|
9080
|
-
});
|
|
9081
|
-
var MemoryHistoryHitSchema = z69.object({
|
|
9082
|
-
jobId: z69.string(),
|
|
9083
|
-
source: LauncherJobSourceSchema.nullable(),
|
|
9084
|
-
status: z69.string(),
|
|
9085
|
-
/** Trust of the job the text came from (its source, the tools its run called, tainted reads). */
|
|
9086
|
-
trust: MemoryTrustSchema,
|
|
9087
|
-
snippet: z69.string(),
|
|
9088
|
-
score: z69.number(),
|
|
9089
|
-
createdAt: z69.string(),
|
|
9090
|
-
finishedAt: z69.string().nullable()
|
|
9091
|
-
});
|
|
9092
|
-
var MemorySearchResultSchema = z69.object({
|
|
9093
|
-
results: z69.array(z69.object({
|
|
9094
|
-
documentId: z69.string().uuid(),
|
|
9095
|
-
scope: MemoryScopeSchema,
|
|
9096
|
-
path: z69.string(),
|
|
9097
|
-
version: z69.number().int(),
|
|
9098
|
-
/** When the document last changed. */
|
|
9099
|
-
updatedAt: z69.string(),
|
|
9100
|
-
snippet: z69.string(),
|
|
9101
|
-
score: z69.number(),
|
|
9102
|
-
/** Trust of the revision that produced the current content. */
|
|
9103
|
-
trust: MemoryTrustSchema.nullable()
|
|
9104
|
-
})),
|
|
9105
|
-
/** Present only when history was requested. */
|
|
9106
|
-
history: z69.array(MemoryHistoryHitSchema).optional()
|
|
9107
|
-
});
|
|
9108
|
-
var MemoryForgetResultSchema = z69.object({ archived: z69.number().int() });
|
|
9109
|
-
var MemoryProposalsInputSchema = z69.object({ agentId: AgentIdSchema.optional(), scope: MemoryScopeSchema.optional() }).strict().refine((value) => value.scope !== "agent" || Boolean(value.agentId), agentScopeMessage);
|
|
9110
|
-
var MemoryProposalDecisionInputSchema = z69.object({ proposalId: z69.string().uuid() }).strict();
|
|
9111
|
-
var MemoryProposalSchema = z69.object({
|
|
9112
|
-
id: z69.string().uuid(),
|
|
9113
|
-
scope: MemoryScopeSchema,
|
|
9114
|
-
/** The private scope's agent; null for the swarm scope. */
|
|
9115
|
-
agentId: z69.string().nullable(),
|
|
9116
|
-
path: z69.string(),
|
|
9117
|
-
documentId: z69.string().uuid().nullable(),
|
|
9118
|
-
operation: MemoryOperationSchema,
|
|
9119
|
-
/** The full proposed content (for `archive`, the content that would be archived). */
|
|
9120
|
-
content: z69.string(),
|
|
9121
|
-
/** The document version the proposal was made against; 0 = the document did not exist. */
|
|
9122
|
-
baseVersion: z69.number().int(),
|
|
9123
|
-
/** The live document now, to diff against; null when there is none. */
|
|
9124
|
-
current: z69.object({
|
|
9125
|
-
version: z69.number().int(),
|
|
9126
|
-
content: z69.string(),
|
|
9127
|
-
lastTrust: MemoryTrustSchema.nullable()
|
|
9128
|
-
}).nullable(),
|
|
9129
|
-
/** The document changed since the proposal: approving it would conflict. */
|
|
9130
|
-
stale: z69.boolean(),
|
|
9131
|
-
actor: MemoryActorSchema,
|
|
9132
|
-
actorAgentId: z69.string().nullable(),
|
|
9133
|
-
trust: MemoryTrustSchema,
|
|
9134
|
-
trustReason: z69.string().nullable(),
|
|
9135
|
-
reason: z69.string().nullable(),
|
|
9136
|
-
sessionId: z69.string().nullable(),
|
|
9137
|
-
job: z69.object({
|
|
9138
|
-
id: z69.string(),
|
|
9139
|
-
/** The agent that ran the job: the proposer, or its creator for a seeded instructions.md. */
|
|
9140
|
-
agentId: z69.string(),
|
|
9141
|
-
source: LauncherJobSourceSchema.nullable(),
|
|
9142
|
-
prompt: z69.string(),
|
|
9143
|
-
createdAt: z69.string()
|
|
9144
|
-
}).nullable(),
|
|
9145
|
-
createdAt: z69.string(),
|
|
9146
|
-
/**
|
|
9147
|
-
* When the retention purge removes the proposal undecided, or null when it never does. Only
|
|
9148
|
-
* proposals with no live document to wait on expire: one to create a document (the archive
|
|
9149
|
-
* window after it was made) and one on a forgotten document (purged with that document).
|
|
9150
|
-
*/
|
|
9151
|
-
expiresAt: z69.string().nullable(),
|
|
9152
|
-
/** `expiresAt` is within MEMORY_PROPOSAL_EXPIRY_WARNING_DAYS. */
|
|
9153
|
-
expiresSoon: z69.boolean()
|
|
9154
|
-
});
|
|
9155
|
-
var MemoryProposalListSchema = z69.object({ proposals: z69.array(MemoryProposalSchema) });
|
|
9156
|
-
var MemoryProposalSummaryInputSchema = z69.object({}).strict();
|
|
9157
|
-
var MemoryProposalCountSchema = z69.object({
|
|
9158
|
-
pending: z69.number().int(),
|
|
9159
|
-
/** Pending proposals flagged `expiresSoon`. */
|
|
9160
|
-
expiringSoon: z69.number().int()
|
|
9161
|
-
});
|
|
9162
|
-
var MemoryProposalSummarySchema = MemoryProposalCountSchema.extend({
|
|
9163
|
-
/** Proposals to shared memory: every agent's Memory tab lists them. */
|
|
9164
|
-
swarm: MemoryProposalCountSchema,
|
|
9165
|
-
/**
|
|
9166
|
-
* Proposals to each agent's private memory, for agents that have any. An agent's Memory tab
|
|
9167
|
-
* lists its own and the shared ones.
|
|
9168
|
-
*/
|
|
9169
|
-
agents: z69.array(MemoryProposalCountSchema.extend({ agentId: z69.string() }))
|
|
9170
|
-
});
|
|
9171
|
-
var MemoryProposalRejectionSchema = z69.object({ revision: MemoryRevisionSchema });
|
|
9172
|
-
var MemoryArchivedInputSchema = z69.object({ agentId: AgentIdSchema.optional(), scope: MemoryScopeSchema }).strict().refine(agentScopeNeedsAgent, agentScopeMessage);
|
|
9173
|
-
var MemoryArchivedDocumentSchema = z69.object({
|
|
9174
|
-
documentId: z69.string().uuid(),
|
|
9175
|
-
scope: MemoryScopeSchema,
|
|
9176
|
-
path: z69.string(),
|
|
9177
|
-
/** The archive revision's version; restoring rolls back to it (its content is the last text). */
|
|
9178
|
-
version: z69.number().int(),
|
|
9179
|
-
bytes: z69.number().int(),
|
|
9180
|
-
pinned: z69.boolean(),
|
|
9181
|
-
archivedAt: z69.string(),
|
|
9182
|
-
/** When the hard purge removes it for good. */
|
|
9183
|
-
purgeAt: z69.string()
|
|
9184
|
-
});
|
|
9185
|
-
var MemoryArchivedListSchema = z69.object({
|
|
9186
|
-
documents: z69.array(MemoryArchivedDocumentSchema)
|
|
9187
|
-
});
|
|
9188
|
-
var MemoryExportInputSchema = z69.object({ cursor: z69.string().min(1).max(512).optional() }).strict();
|
|
9189
|
-
var MemoryExportDocumentSchema = z69.object({
|
|
9190
|
-
documentId: z69.string().uuid(),
|
|
9191
|
-
scope: MemoryScopeSchema,
|
|
9192
|
-
/** The private scope's agent; null for shared memory. */
|
|
9193
|
-
agentId: z69.string().nullable(),
|
|
9194
|
-
path: z69.string(),
|
|
9195
|
-
/** `live` is what agents read now; `forgotten` is archived and purged at `purgeAt`. */
|
|
9196
|
-
status: z69.enum(["live", "forgotten"]),
|
|
9197
|
-
pinned: z69.boolean(),
|
|
9198
|
-
version: z69.number().int(),
|
|
9199
|
-
bytes: z69.number().int(),
|
|
9200
|
-
/** The current text, or the last text of a forgotten document. */
|
|
9201
|
-
content: z69.string(),
|
|
9202
|
-
createdAt: z69.string(),
|
|
9203
|
-
updatedAt: z69.string(),
|
|
9204
|
-
archivedAt: z69.string().nullable(),
|
|
9205
|
-
purgeAt: z69.string().nullable()
|
|
9267
|
+
agentId: z69.string().uuid(),
|
|
9268
|
+
updatedAt: z69.string().nullable()
|
|
9206
9269
|
});
|
|
9207
|
-
var MemoryExportRevisionSchema = MemoryRevisionSchema.extend({
|
|
9208
|
-
scope: MemoryScopeSchema,
|
|
9209
|
-
agentId: z69.string().nullable(),
|
|
9210
|
-
path: z69.string()
|
|
9211
|
-
});
|
|
9212
|
-
var MemoryExportPageSchema = z69.object({
|
|
9213
|
-
/** The owner's agents, to name each private scope. */
|
|
9214
|
-
agents: z69.array(z69.object({ agentId: z69.string(), name: z69.string() })),
|
|
9215
|
-
/** Documents first seen on this page; their revisions may continue on later pages. */
|
|
9216
|
-
documents: z69.array(MemoryExportDocumentSchema),
|
|
9217
|
-
revisions: z69.array(MemoryExportRevisionSchema),
|
|
9218
|
-
nextCursor: z69.string().nullable()
|
|
9219
|
-
});
|
|
9220
|
-
var ToolPathSchema = z69.string().min(1).max(MEMORY_PATH_MAX_LENGTH * 2);
|
|
9221
|
-
var ToolReasonSchema = z69.string().trim().min(1).max(MEMORY_REASON_MAX_LENGTH);
|
|
9222
|
-
var MemoryToolInputSchemas = {
|
|
9223
|
-
memory_view: z69.object({
|
|
9224
|
-
scope: MemoryScopeSchema.optional(),
|
|
9225
|
-
path: ToolPathSchema.optional(),
|
|
9226
|
-
offset: z69.number().int().min(0).max(MEMORY_DOCUMENT_MAX_BYTES).optional()
|
|
9227
|
-
}).strict(),
|
|
9228
|
-
memory_search: z69.object({
|
|
9229
|
-
query: z69.string().trim().min(1).max(MEMORY_SEARCH_QUERY_MAX_LENGTH),
|
|
9230
|
-
scope: MemoryScopeSchema.optional(),
|
|
9231
|
-
limit: z69.number().int().min(1).max(MEMORY_SEARCH_MAX_RESULTS).optional(),
|
|
9232
|
-
/** Also search this agent's own past jobs (SM-61). */
|
|
9233
|
-
include_history: z69.boolean().optional()
|
|
9234
|
-
}).strict(),
|
|
9235
|
-
memory_write: z69.object({
|
|
9236
|
-
scope: MemoryScopeSchema.optional(),
|
|
9237
|
-
path: ToolPathSchema,
|
|
9238
|
-
content: z69.string().max(MEMORY_DOCUMENT_MAX_BYTES),
|
|
9239
|
-
mode: MemoryWriteModeSchema.optional(),
|
|
9240
|
-
expected_version: VersionSchema.optional()
|
|
9241
|
-
}).strict(),
|
|
9242
|
-
memory_edit: z69.object({
|
|
9243
|
-
scope: MemoryScopeSchema.optional(),
|
|
9244
|
-
path: ToolPathSchema,
|
|
9245
|
-
old_text: z69.string().min(1).max(MEMORY_DOCUMENT_MAX_BYTES),
|
|
9246
|
-
new_text: z69.string().max(MEMORY_DOCUMENT_MAX_BYTES),
|
|
9247
|
-
expected_version: VersionSchema
|
|
9248
|
-
}).strict(),
|
|
9249
|
-
memory_delete: z69.object({ scope: MemoryScopeSchema.optional(), path: ToolPathSchema, reason: ToolReasonSchema }).strict()
|
|
9250
|
-
};
|
|
9251
|
-
var MEMORY_TOOL_NAMES = Object.keys(MemoryToolInputSchemas);
|
|
9252
9270
|
|
|
9253
9271
|
// ../../packages/shared/dist/schemas/memory-secrets.schemas.js
|
|
9254
9272
|
import { sha256 } from "viem";
|