@inf-monkeys-tech/monkeys 1.0.10 → 1.0.12
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/lib/contracts/agent.d.ts +148 -25
- package/lib/contracts/agent.d.ts.map +1 -1
- package/lib/contracts/agent.js +98 -3
- package/lib/contracts/agent.js.map +1 -1
- package/lib/contracts/context.d.ts +1 -0
- package/lib/contracts/context.d.ts.map +1 -1
- package/lib/contracts/context.js +1 -1
- package/lib/contracts/context.js.map +1 -1
- package/lib/contracts/trend.d.ts +1 -1
- package/lib/esm/contracts/index.mjs +94 -4
- package/lib/esm/contracts/index.mjs.map +1 -1
- package/lib/esm/index.mjs +95 -3
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/schemas/index.mjs +85 -3
- package/lib/esm/schemas/index.mjs.map +1 -1
- package/lib/json-schema/agent-runtime-event.schema.json +2 -1
- package/lib/json-schema/agent-session-command-result.schema.json +110 -0
- package/lib/json-schema/agent-session-command.schema.json +264 -0
- package/lib/json-schema/index.json +2 -0
- package/lib/schemas/index.d.ts +118 -27
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +10 -3
- package/lib/schemas/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -7135,6 +7135,81 @@ var AgentSessionSnapshotSchema = z5.object({
|
|
|
7135
7135
|
modelId: z5.string().trim().min(1),
|
|
7136
7136
|
capabilities: AgentSessionCapabilitiesSchema
|
|
7137
7137
|
}).strict();
|
|
7138
|
+
var AgentSessionStatusSchema = z5.enum([
|
|
7139
|
+
"queued",
|
|
7140
|
+
"running",
|
|
7141
|
+
"waiting_approval",
|
|
7142
|
+
"stopping",
|
|
7143
|
+
"stopped",
|
|
7144
|
+
"completed",
|
|
7145
|
+
"failed"
|
|
7146
|
+
]);
|
|
7147
|
+
var AgentSessionCommandTypeSchema = z5.enum(["stop", "resume", "retry", "approval"]);
|
|
7148
|
+
var AgentSessionCommandHeaderSchema = z5.object({
|
|
7149
|
+
contract: z5.literal("AgentSessionCommand"),
|
|
7150
|
+
commandId: ContractIdentifierSchema,
|
|
7151
|
+
sessionId: ContractIdentifierSchema,
|
|
7152
|
+
idempotencyKey: ContractIdentifierSchema,
|
|
7153
|
+
expectedSequence: z5.number().int().min(-1),
|
|
7154
|
+
issuedAt: IsoDateTimeSchema
|
|
7155
|
+
}).strict();
|
|
7156
|
+
var sessionCommand = (commandType, payload) => AgentSessionCommandHeaderSchema.extend({
|
|
7157
|
+
commandType: z5.literal(commandType),
|
|
7158
|
+
payload: z5.object(payload).strict()
|
|
7159
|
+
}).strict();
|
|
7160
|
+
var AgentSessionCommandSchema = z5.discriminatedUnion("commandType", [
|
|
7161
|
+
sessionCommand("stop", {
|
|
7162
|
+
reason: z5.string().trim().min(1).optional()
|
|
7163
|
+
}),
|
|
7164
|
+
sessionCommand("resume", {
|
|
7165
|
+
resumeEventId: ContractIdentifierSchema.optional()
|
|
7166
|
+
}),
|
|
7167
|
+
sessionCommand("retry", {
|
|
7168
|
+
sourceEventId: ContractIdentifierSchema
|
|
7169
|
+
}),
|
|
7170
|
+
sessionCommand("approval", {
|
|
7171
|
+
approvalId: ContractIdentifierSchema,
|
|
7172
|
+
decision: z5.enum(["approved", "rejected"]),
|
|
7173
|
+
reason: z5.string().trim().min(1).optional()
|
|
7174
|
+
})
|
|
7175
|
+
]);
|
|
7176
|
+
var AgentSessionCommandErrorCodeSchema = z5.enum([
|
|
7177
|
+
"SESSION_NOT_FOUND",
|
|
7178
|
+
"COMMAND_NOT_SUPPORTED",
|
|
7179
|
+
"CAPABILITY_UNAVAILABLE",
|
|
7180
|
+
"SEQUENCE_CONFLICT",
|
|
7181
|
+
"INVALID_SESSION_STATE",
|
|
7182
|
+
"TARGET_EVENT_NOT_FOUND",
|
|
7183
|
+
"TARGET_EVENT_NOT_RETRYABLE",
|
|
7184
|
+
"APPROVAL_NOT_FOUND",
|
|
7185
|
+
"APPROVAL_ALREADY_RESOLVED",
|
|
7186
|
+
"COMMAND_EXECUTION_FAILED"
|
|
7187
|
+
]);
|
|
7188
|
+
var AgentSessionCommandResultSchema = z5.object({
|
|
7189
|
+
contract: z5.literal("AgentSessionCommandResult"),
|
|
7190
|
+
commandId: ContractIdentifierSchema,
|
|
7191
|
+
sessionId: ContractIdentifierSchema,
|
|
7192
|
+
idempotencyKey: ContractIdentifierSchema,
|
|
7193
|
+
outcome: z5.enum(["accepted", "duplicate", "rejected", "failed"]),
|
|
7194
|
+
sessionStatus: AgentSessionStatusSchema,
|
|
7195
|
+
acceptedSequence: z5.number().int().nonnegative().optional(),
|
|
7196
|
+
resultEventIds: z5.array(ContractIdentifierSchema).default([]),
|
|
7197
|
+
error: z5.object({
|
|
7198
|
+
code: AgentSessionCommandErrorCodeSchema,
|
|
7199
|
+
message: z5.string(),
|
|
7200
|
+
retryable: z5.boolean()
|
|
7201
|
+
}).strict().optional(),
|
|
7202
|
+
occurredAt: IsoDateTimeSchema
|
|
7203
|
+
}).strict().superRefine((value, context) => {
|
|
7204
|
+
const requiresError = value.outcome === "rejected" || value.outcome === "failed";
|
|
7205
|
+
if (requiresError !== Boolean(value.error)) {
|
|
7206
|
+
context.addIssue({
|
|
7207
|
+
code: "custom",
|
|
7208
|
+
path: ["error"],
|
|
7209
|
+
message: requiresError ? "Rejected and failed command results require an error." : "Accepted and duplicate command results must not contain an error."
|
|
7210
|
+
});
|
|
7211
|
+
}
|
|
7212
|
+
});
|
|
7138
7213
|
var AgentSessionEventHeaderSchema = z5.object({
|
|
7139
7214
|
contract: z5.literal("AgentSessionEvent"),
|
|
7140
7215
|
eventId: ContractIdentifierSchema,
|
|
@@ -7197,7 +7272,7 @@ var AgentSessionEventSchema = z5.discriminatedUnion("eventType", [
|
|
|
7197
7272
|
requestedAction: JsonValueSchema.optional()
|
|
7198
7273
|
}),
|
|
7199
7274
|
sessionEvent("status", {
|
|
7200
|
-
status:
|
|
7275
|
+
status: AgentSessionStatusSchema,
|
|
7201
7276
|
detail: z5.string().optional()
|
|
7202
7277
|
}),
|
|
7203
7278
|
sessionEvent("artifact", {
|
|
@@ -7258,7 +7333,7 @@ var AgentSessionViewModelSchema = z5.object({
|
|
|
7258
7333
|
contract: z5.literal("AgentSessionViewModel"),
|
|
7259
7334
|
sessionId: ContractIdentifierSchema,
|
|
7260
7335
|
snapshot: AgentSessionSnapshotSchema,
|
|
7261
|
-
status:
|
|
7336
|
+
status: AgentSessionStatusSchema,
|
|
7262
7337
|
events: z5.array(AgentSessionEventSchema),
|
|
7263
7338
|
lastSequence: z5.number().int().min(-1),
|
|
7264
7339
|
resumable: z5.boolean().default(false)
|
|
@@ -7380,7 +7455,7 @@ var AgentRuntimeEventSchema = z6.object({
|
|
|
7380
7455
|
requestId: ContractIdentifierSchema,
|
|
7381
7456
|
teamId: ContractIdentifierSchema,
|
|
7382
7457
|
threadId: ContractIdentifierSchema.optional(),
|
|
7383
|
-
eventType: z6.enum(["messages:append", "messages:update", "thread:update", "tool-call:upsert"]),
|
|
7458
|
+
eventType: z6.enum(["messages:append", "messages:update", "thread:update", "tool-call:upsert", "session:event"]),
|
|
7384
7459
|
payload: JsonValueSchema,
|
|
7385
7460
|
occurredAt: IsoDateTimeSchema
|
|
7386
7461
|
}).strict();
|
|
@@ -11278,6 +11353,8 @@ var WorkflowDefinitionSchema = z14.object({
|
|
|
11278
11353
|
|
|
11279
11354
|
// src/schemas/index.ts
|
|
11280
11355
|
var canonicalContractSchemas = {
|
|
11356
|
+
"agent-session-command": AgentSessionCommandSchema,
|
|
11357
|
+
"agent-session-command-result": AgentSessionCommandResultSchema,
|
|
11281
11358
|
"agent-session-event": AgentSessionEventSchema,
|
|
11282
11359
|
"agent-session-view-model": AgentSessionViewModelSchema,
|
|
11283
11360
|
"agent-runtime-event": AgentRuntimeEventSchema,
|
|
@@ -11340,8 +11417,13 @@ export {
|
|
|
11340
11417
|
AgentRuntimeEventSchema,
|
|
11341
11418
|
AgentSessionCapabilitiesSchema,
|
|
11342
11419
|
AgentSessionCapabilitySchema,
|
|
11420
|
+
AgentSessionCommandErrorCodeSchema,
|
|
11421
|
+
AgentSessionCommandResultSchema,
|
|
11422
|
+
AgentSessionCommandSchema,
|
|
11423
|
+
AgentSessionCommandTypeSchema,
|
|
11343
11424
|
AgentSessionEventSchema,
|
|
11344
11425
|
AgentSessionSnapshotSchema,
|
|
11426
|
+
AgentSessionStatusSchema,
|
|
11345
11427
|
AgentSessionViewModelSchema,
|
|
11346
11428
|
ApplicationHandoffEndpointSchema,
|
|
11347
11429
|
ApplicationHandoffSchema,
|