@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
package/lib/esm/index.mjs
CHANGED
|
@@ -6780,7 +6780,7 @@ var AgentSessionCapabilitiesSchema = z3.object({
|
|
|
6780
6780
|
}).strict();
|
|
6781
6781
|
var AGENT_SESSION_RUNTIME_CAPABILITIES = Object.freeze({
|
|
6782
6782
|
chatbot: AgentSessionCapabilitiesSchema.parse({ text: true, tools: true, mcp: true, skills: true, approval: true, usage: true, editAndRerun: true, summary: true }),
|
|
6783
|
-
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 })
|
|
6783
|
+
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 })
|
|
6784
6784
|
});
|
|
6785
6785
|
function getAgentSessionRuntimeCapabilities(mode) {
|
|
6786
6786
|
return AGENT_SESSION_RUNTIME_CAPABILITIES[mode];
|
|
@@ -6805,8 +6805,8 @@ var AGENT_SESSION_CAPABILITY_EVIDENCE = Object.freeze({
|
|
|
6805
6805
|
testResults: { eventTypes: ["test-result"], commandTypes: [] },
|
|
6806
6806
|
threadForking: { eventTypes: [], commandTypes: ["fork"] },
|
|
6807
6807
|
editAndRerun: { eventTypes: [], commandTypes: ["edit-and-rerun"] },
|
|
6808
|
-
steering: { eventTypes: [], commandTypes: ["steer"] },
|
|
6809
|
-
summary: { eventTypes: ["summary"], commandTypes: [] }
|
|
6808
|
+
steering: { eventTypes: ["steer"], commandTypes: ["steer"] },
|
|
6809
|
+
summary: { eventTypes: ["summary"], commandTypes: ["retry-summary"] }
|
|
6810
6810
|
});
|
|
6811
6811
|
function findUnsupportedAgentSessionCapabilities(capabilities, evidence) {
|
|
6812
6812
|
const eventTypes = new Set(evidence.eventTypes || []);
|
|
@@ -6949,6 +6949,7 @@ var AgentSessionCommandTypeSchema = z3.enum([
|
|
|
6949
6949
|
"stop",
|
|
6950
6950
|
"resume",
|
|
6951
6951
|
"retry",
|
|
6952
|
+
"retry-summary",
|
|
6952
6953
|
"approval",
|
|
6953
6954
|
"fork",
|
|
6954
6955
|
"edit-and-rerun",
|
|
@@ -6977,6 +6978,10 @@ var AgentSessionCommandSchema = z3.discriminatedUnion("commandType", [
|
|
|
6977
6978
|
sessionCommand("retry", {
|
|
6978
6979
|
sourceEventId: ContractIdentifierSchema
|
|
6979
6980
|
}),
|
|
6981
|
+
sessionCommand("retry-summary", {
|
|
6982
|
+
sourceEventId: ContractIdentifierSchema,
|
|
6983
|
+
sourceRunId: ContractIdentifierSchema
|
|
6984
|
+
}),
|
|
6980
6985
|
sessionCommand("approval", {
|
|
6981
6986
|
approvalId: ContractIdentifierSchema,
|
|
6982
6987
|
decision: z3.enum(["approved", "rejected"]),
|
|
@@ -6997,7 +7002,7 @@ var AgentSessionCommandSchema = z3.discriminatedUnion("commandType", [
|
|
|
6997
7002
|
}),
|
|
6998
7003
|
sessionCommand("steer", {
|
|
6999
7004
|
targetRunId: ContractIdentifierSchema,
|
|
7000
|
-
|
|
7005
|
+
text: z3.string().trim().min(1)
|
|
7001
7006
|
})
|
|
7002
7007
|
]).superRefine((value, context) => {
|
|
7003
7008
|
if (value.commandType === "steer" && value.runId !== value.payload.targetRunId) {
|
|
@@ -7007,6 +7012,13 @@ var AgentSessionCommandSchema = z3.discriminatedUnion("commandType", [
|
|
|
7007
7012
|
message: "Steering targetRunId must match the command runId."
|
|
7008
7013
|
});
|
|
7009
7014
|
}
|
|
7015
|
+
if (value.commandType === "retry-summary" && value.runId !== value.payload.sourceRunId) {
|
|
7016
|
+
context.addIssue({
|
|
7017
|
+
code: "custom",
|
|
7018
|
+
path: ["payload", "sourceRunId"],
|
|
7019
|
+
message: "Summary retry sourceRunId must match the command runId."
|
|
7020
|
+
});
|
|
7021
|
+
}
|
|
7010
7022
|
});
|
|
7011
7023
|
var AgentSessionTargetedCommandSchema = AgentSessionCommandSchema.and(
|
|
7012
7024
|
z3.object({ runId: ContractIdentifierSchema })
|
|
@@ -7014,6 +7026,7 @@ var AgentSessionTargetedCommandSchema = AgentSessionCommandSchema.and(
|
|
|
7014
7026
|
var AgentSessionCommandErrorCodeSchema = z3.enum([
|
|
7015
7027
|
"SESSION_NOT_FOUND",
|
|
7016
7028
|
"RUN_NOT_FOUND",
|
|
7029
|
+
"ACTIVE_RUN_NOT_FOUND",
|
|
7017
7030
|
"RUN_ALREADY_FINISHED",
|
|
7018
7031
|
"STOP_TIMEOUT",
|
|
7019
7032
|
"COMMAND_NOT_SUPPORTED",
|
|
@@ -7106,6 +7119,7 @@ var AGENT_SESSION_COMMAND_TRANSITIONS = {
|
|
|
7106
7119
|
stop: { queued: "stopping", running: "stopping", waiting_approval: "stopping" },
|
|
7107
7120
|
resume: { stopped: "queued", completed: "queued", failed: "queued" },
|
|
7108
7121
|
retry: { failed: "queued" },
|
|
7122
|
+
"retry-summary": {},
|
|
7109
7123
|
approval: { waiting_approval: "running" },
|
|
7110
7124
|
fork: {},
|
|
7111
7125
|
"edit-and-rerun": {},
|
|
@@ -7143,6 +7157,14 @@ var AGENT_SESSION_COMMAND_POLICIES = Object.freeze({
|
|
|
7143
7157
|
idempotencyScope: "session-command",
|
|
7144
7158
|
sequenceRule: "match-current"
|
|
7145
7159
|
}),
|
|
7160
|
+
"retry-summary": sessionCommandPolicy({
|
|
7161
|
+
capability: "summary",
|
|
7162
|
+
allowedStatuses: ["stopped", "completed", "failed"],
|
|
7163
|
+
requiresRunId: true,
|
|
7164
|
+
sourceSessionEffect: "preserve",
|
|
7165
|
+
idempotencyScope: "session-command",
|
|
7166
|
+
sequenceRule: "match-current"
|
|
7167
|
+
}),
|
|
7146
7168
|
approval: sessionCommandPolicy({
|
|
7147
7169
|
capability: "approval",
|
|
7148
7170
|
allowedStatuses: ["waiting_approval"],
|
|
@@ -7327,6 +7349,17 @@ var AgentSessionEventSchema = z3.discriminatedUnion("eventType", [
|
|
|
7327
7349
|
durationMs: z3.number().nonnegative().optional(),
|
|
7328
7350
|
output: z3.string().optional()
|
|
7329
7351
|
}),
|
|
7352
|
+
sessionEvent("steer", {
|
|
7353
|
+
commandId: ContractIdentifierSchema,
|
|
7354
|
+
targetRunId: ContractIdentifierSchema,
|
|
7355
|
+
text: z3.string().trim().min(1),
|
|
7356
|
+
status: z3.enum(["accepted", "applied", "failed"]),
|
|
7357
|
+
error: z3.object({
|
|
7358
|
+
code: AgentSessionCommandErrorCodeSchema,
|
|
7359
|
+
message: z3.string(),
|
|
7360
|
+
retryable: z3.boolean()
|
|
7361
|
+
}).strict().optional()
|
|
7362
|
+
}),
|
|
7330
7363
|
sessionEvent("summary", {
|
|
7331
7364
|
summaryId: ContractIdentifierSchema,
|
|
7332
7365
|
runId: ContractIdentifierSchema,
|
|
@@ -7336,6 +7369,23 @@ var AgentSessionEventSchema = z3.discriminatedUnion("eventType", [
|
|
|
7336
7369
|
status: z3.enum(["generating", "completed", "failed"])
|
|
7337
7370
|
})
|
|
7338
7371
|
]).superRefine((value, context) => {
|
|
7372
|
+
if (value.eventType === "steer") {
|
|
7373
|
+
if (value.runId !== value.payload.targetRunId) {
|
|
7374
|
+
context.addIssue({
|
|
7375
|
+
code: "custom",
|
|
7376
|
+
path: ["payload", "targetRunId"],
|
|
7377
|
+
message: "Steering payload targetRunId must match the event runId."
|
|
7378
|
+
});
|
|
7379
|
+
}
|
|
7380
|
+
const requiresError = value.payload.status === "failed";
|
|
7381
|
+
if (requiresError !== Boolean(value.payload.error)) {
|
|
7382
|
+
context.addIssue({
|
|
7383
|
+
code: "custom",
|
|
7384
|
+
path: ["payload", "error"],
|
|
7385
|
+
message: requiresError ? "Failed steering events require an error." : "Accepted and applied steering events must not contain an error."
|
|
7386
|
+
});
|
|
7387
|
+
}
|
|
7388
|
+
}
|
|
7339
7389
|
if (value.eventType === "summary" && value.runId !== value.payload.runId) {
|
|
7340
7390
|
context.addIssue({
|
|
7341
7391
|
code: "custom",
|