@inf-monkeys-tech/monkeys 1.0.25 → 1.0.27
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 +176 -4
- package/lib/contracts/agent.d.ts.map +1 -1
- package/lib/contracts/agent.js +59 -4
- package/lib/contracts/agent.js.map +1 -1
- package/lib/esm/contracts/index.mjs +54 -4
- package/lib/esm/contracts/index.mjs.map +1 -1
- package/lib/esm/index.mjs +54 -4
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/runtime/index.mjs +53 -4
- package/lib/esm/runtime/index.mjs.map +1 -1
- package/lib/esm/schemas/index.mjs +53 -4
- package/lib/esm/schemas/index.mjs.map +1 -1
- package/lib/json-schema/agent-session-command-result.schema.json +1 -0
- package/lib/json-schema/agent-session-command.schema.json +78 -7
- package/lib/json-schema/agent-session-event.schema.json +134 -0
- package/lib/json-schema/agent-session-run-event.schema.json +134 -0
- package/lib/json-schema/agent-session-targeted-command.schema.json +78 -7
- package/lib/json-schema/agent-session-view-model.schema.json +134 -0
- package/lib/schemas/index.d.ts +164 -2
- package/lib/schemas/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/test/fixtures/agent-session-agent.json +1 -1
- package/test/fixtures/agent-session-commands.json +14 -0
|
@@ -7173,7 +7173,7 @@ var AgentSessionCapabilitiesSchema = z5.object({
|
|
|
7173
7173
|
}).strict();
|
|
7174
7174
|
var AGENT_SESSION_RUNTIME_CAPABILITIES = Object.freeze({
|
|
7175
7175
|
chatbot: AgentSessionCapabilitiesSchema.parse({ text: true, tools: true, mcp: true, skills: true, approval: true, usage: true, editAndRerun: true, summary: true }),
|
|
7176
|
-
agent: AgentSessionCapabilitiesSchema.parse({ text: true, tools: true, mcp: true, shell: true, fileChange: true, skills: true, approval: true, artifacts: true, usage: true, resume: true, editAndRerun: true, summary: true })
|
|
7176
|
+
agent: AgentSessionCapabilitiesSchema.parse({ text: true, tools: true, mcp: true, shell: true, fileChange: true, skills: true, approval: true, artifacts: true, usage: true, resume: true, editAndRerun: true, steering: true, summary: true })
|
|
7177
7177
|
});
|
|
7178
7178
|
var AGENT_SESSION_CAPABILITY_EVIDENCE = Object.freeze({
|
|
7179
7179
|
text: { eventTypes: ["message"], commandTypes: [] },
|
|
@@ -7195,8 +7195,8 @@ var AGENT_SESSION_CAPABILITY_EVIDENCE = Object.freeze({
|
|
|
7195
7195
|
testResults: { eventTypes: ["test-result"], commandTypes: [] },
|
|
7196
7196
|
threadForking: { eventTypes: [], commandTypes: ["fork"] },
|
|
7197
7197
|
editAndRerun: { eventTypes: [], commandTypes: ["edit-and-rerun"] },
|
|
7198
|
-
steering: { eventTypes: [], commandTypes: ["steer"] },
|
|
7199
|
-
summary: { eventTypes: ["summary"], commandTypes: [] }
|
|
7198
|
+
steering: { eventTypes: ["steer"], commandTypes: ["steer"] },
|
|
7199
|
+
summary: { eventTypes: ["summary"], commandTypes: ["retry-summary"] }
|
|
7200
7200
|
});
|
|
7201
7201
|
var AgentSessionSnapshotSchema = z5.object({
|
|
7202
7202
|
mode: AgentModeSchema,
|
|
@@ -7330,6 +7330,7 @@ var AgentSessionCommandTypeSchema = z5.enum([
|
|
|
7330
7330
|
"stop",
|
|
7331
7331
|
"resume",
|
|
7332
7332
|
"retry",
|
|
7333
|
+
"retry-summary",
|
|
7333
7334
|
"approval",
|
|
7334
7335
|
"fork",
|
|
7335
7336
|
"edit-and-rerun",
|
|
@@ -7358,6 +7359,10 @@ var AgentSessionCommandSchema = z5.discriminatedUnion("commandType", [
|
|
|
7358
7359
|
sessionCommand("retry", {
|
|
7359
7360
|
sourceEventId: ContractIdentifierSchema
|
|
7360
7361
|
}),
|
|
7362
|
+
sessionCommand("retry-summary", {
|
|
7363
|
+
sourceEventId: ContractIdentifierSchema,
|
|
7364
|
+
sourceRunId: ContractIdentifierSchema
|
|
7365
|
+
}),
|
|
7361
7366
|
sessionCommand("approval", {
|
|
7362
7367
|
approvalId: ContractIdentifierSchema,
|
|
7363
7368
|
decision: z5.enum(["approved", "rejected"]),
|
|
@@ -7378,7 +7383,7 @@ var AgentSessionCommandSchema = z5.discriminatedUnion("commandType", [
|
|
|
7378
7383
|
}),
|
|
7379
7384
|
sessionCommand("steer", {
|
|
7380
7385
|
targetRunId: ContractIdentifierSchema,
|
|
7381
|
-
|
|
7386
|
+
text: z5.string().trim().min(1)
|
|
7382
7387
|
})
|
|
7383
7388
|
]).superRefine((value, context) => {
|
|
7384
7389
|
if (value.commandType === "steer" && value.runId !== value.payload.targetRunId) {
|
|
@@ -7388,6 +7393,13 @@ var AgentSessionCommandSchema = z5.discriminatedUnion("commandType", [
|
|
|
7388
7393
|
message: "Steering targetRunId must match the command runId."
|
|
7389
7394
|
});
|
|
7390
7395
|
}
|
|
7396
|
+
if (value.commandType === "retry-summary" && value.runId !== value.payload.sourceRunId) {
|
|
7397
|
+
context.addIssue({
|
|
7398
|
+
code: "custom",
|
|
7399
|
+
path: ["payload", "sourceRunId"],
|
|
7400
|
+
message: "Summary retry sourceRunId must match the command runId."
|
|
7401
|
+
});
|
|
7402
|
+
}
|
|
7391
7403
|
});
|
|
7392
7404
|
var AgentSessionTargetedCommandSchema = AgentSessionCommandSchema.and(
|
|
7393
7405
|
z5.object({ runId: ContractIdentifierSchema })
|
|
@@ -7395,6 +7407,7 @@ var AgentSessionTargetedCommandSchema = AgentSessionCommandSchema.and(
|
|
|
7395
7407
|
var AgentSessionCommandErrorCodeSchema = z5.enum([
|
|
7396
7408
|
"SESSION_NOT_FOUND",
|
|
7397
7409
|
"RUN_NOT_FOUND",
|
|
7410
|
+
"ACTIVE_RUN_NOT_FOUND",
|
|
7398
7411
|
"RUN_ALREADY_FINISHED",
|
|
7399
7412
|
"STOP_TIMEOUT",
|
|
7400
7413
|
"COMMAND_NOT_SUPPORTED",
|
|
@@ -7515,6 +7528,14 @@ var AGENT_SESSION_COMMAND_POLICIES = Object.freeze({
|
|
|
7515
7528
|
idempotencyScope: "session-command",
|
|
7516
7529
|
sequenceRule: "match-current"
|
|
7517
7530
|
}),
|
|
7531
|
+
"retry-summary": sessionCommandPolicy({
|
|
7532
|
+
capability: "summary",
|
|
7533
|
+
allowedStatuses: ["stopped", "completed", "failed"],
|
|
7534
|
+
requiresRunId: true,
|
|
7535
|
+
sourceSessionEffect: "preserve",
|
|
7536
|
+
idempotencyScope: "session-command",
|
|
7537
|
+
sequenceRule: "match-current"
|
|
7538
|
+
}),
|
|
7518
7539
|
approval: sessionCommandPolicy({
|
|
7519
7540
|
capability: "approval",
|
|
7520
7541
|
allowedStatuses: ["waiting_approval"],
|
|
@@ -7677,6 +7698,17 @@ var AgentSessionEventSchema = z5.discriminatedUnion("eventType", [
|
|
|
7677
7698
|
durationMs: z5.number().nonnegative().optional(),
|
|
7678
7699
|
output: z5.string().optional()
|
|
7679
7700
|
}),
|
|
7701
|
+
sessionEvent("steer", {
|
|
7702
|
+
commandId: ContractIdentifierSchema,
|
|
7703
|
+
targetRunId: ContractIdentifierSchema,
|
|
7704
|
+
text: z5.string().trim().min(1),
|
|
7705
|
+
status: z5.enum(["accepted", "applied", "failed"]),
|
|
7706
|
+
error: z5.object({
|
|
7707
|
+
code: AgentSessionCommandErrorCodeSchema,
|
|
7708
|
+
message: z5.string(),
|
|
7709
|
+
retryable: z5.boolean()
|
|
7710
|
+
}).strict().optional()
|
|
7711
|
+
}),
|
|
7680
7712
|
sessionEvent("summary", {
|
|
7681
7713
|
summaryId: ContractIdentifierSchema,
|
|
7682
7714
|
runId: ContractIdentifierSchema,
|
|
@@ -7686,6 +7718,23 @@ var AgentSessionEventSchema = z5.discriminatedUnion("eventType", [
|
|
|
7686
7718
|
status: z5.enum(["generating", "completed", "failed"])
|
|
7687
7719
|
})
|
|
7688
7720
|
]).superRefine((value, context) => {
|
|
7721
|
+
if (value.eventType === "steer") {
|
|
7722
|
+
if (value.runId !== value.payload.targetRunId) {
|
|
7723
|
+
context.addIssue({
|
|
7724
|
+
code: "custom",
|
|
7725
|
+
path: ["payload", "targetRunId"],
|
|
7726
|
+
message: "Steering payload targetRunId must match the event runId."
|
|
7727
|
+
});
|
|
7728
|
+
}
|
|
7729
|
+
const requiresError = value.payload.status === "failed";
|
|
7730
|
+
if (requiresError !== Boolean(value.payload.error)) {
|
|
7731
|
+
context.addIssue({
|
|
7732
|
+
code: "custom",
|
|
7733
|
+
path: ["payload", "error"],
|
|
7734
|
+
message: requiresError ? "Failed steering events require an error." : "Accepted and applied steering events must not contain an error."
|
|
7735
|
+
});
|
|
7736
|
+
}
|
|
7737
|
+
}
|
|
7689
7738
|
if (value.eventType === "summary" && value.runId !== value.payload.runId) {
|
|
7690
7739
|
context.addIssue({
|
|
7691
7740
|
code: "custom",
|