@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
|
@@ -6743,7 +6743,7 @@ var AgentSessionCapabilitiesSchema = z3.object({
|
|
|
6743
6743
|
}).strict();
|
|
6744
6744
|
var AGENT_SESSION_RUNTIME_CAPABILITIES = Object.freeze({
|
|
6745
6745
|
chatbot: AgentSessionCapabilitiesSchema.parse({ text: true, tools: true, mcp: true, skills: true, approval: true, usage: true, editAndRerun: true, summary: true }),
|
|
6746
|
-
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 })
|
|
6746
|
+
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 })
|
|
6747
6747
|
});
|
|
6748
6748
|
function getAgentSessionRuntimeCapabilities(mode) {
|
|
6749
6749
|
return AGENT_SESSION_RUNTIME_CAPABILITIES[mode];
|
|
@@ -6768,8 +6768,8 @@ var AGENT_SESSION_CAPABILITY_EVIDENCE = Object.freeze({
|
|
|
6768
6768
|
testResults: { eventTypes: ["test-result"], commandTypes: [] },
|
|
6769
6769
|
threadForking: { eventTypes: [], commandTypes: ["fork"] },
|
|
6770
6770
|
editAndRerun: { eventTypes: [], commandTypes: ["edit-and-rerun"] },
|
|
6771
|
-
steering: { eventTypes: [], commandTypes: ["steer"] },
|
|
6772
|
-
summary: { eventTypes: ["summary"], commandTypes: [] }
|
|
6771
|
+
steering: { eventTypes: ["steer"], commandTypes: ["steer"] },
|
|
6772
|
+
summary: { eventTypes: ["summary"], commandTypes: ["retry-summary"] }
|
|
6773
6773
|
});
|
|
6774
6774
|
function findUnsupportedAgentSessionCapabilities(capabilities, evidence) {
|
|
6775
6775
|
const eventTypes = new Set(evidence.eventTypes || []);
|
|
@@ -6912,6 +6912,7 @@ var AgentSessionCommandTypeSchema = z3.enum([
|
|
|
6912
6912
|
"stop",
|
|
6913
6913
|
"resume",
|
|
6914
6914
|
"retry",
|
|
6915
|
+
"retry-summary",
|
|
6915
6916
|
"approval",
|
|
6916
6917
|
"fork",
|
|
6917
6918
|
"edit-and-rerun",
|
|
@@ -6940,6 +6941,10 @@ var AgentSessionCommandSchema = z3.discriminatedUnion("commandType", [
|
|
|
6940
6941
|
sessionCommand("retry", {
|
|
6941
6942
|
sourceEventId: ContractIdentifierSchema
|
|
6942
6943
|
}),
|
|
6944
|
+
sessionCommand("retry-summary", {
|
|
6945
|
+
sourceEventId: ContractIdentifierSchema,
|
|
6946
|
+
sourceRunId: ContractIdentifierSchema
|
|
6947
|
+
}),
|
|
6943
6948
|
sessionCommand("approval", {
|
|
6944
6949
|
approvalId: ContractIdentifierSchema,
|
|
6945
6950
|
decision: z3.enum(["approved", "rejected"]),
|
|
@@ -6960,7 +6965,7 @@ var AgentSessionCommandSchema = z3.discriminatedUnion("commandType", [
|
|
|
6960
6965
|
}),
|
|
6961
6966
|
sessionCommand("steer", {
|
|
6962
6967
|
targetRunId: ContractIdentifierSchema,
|
|
6963
|
-
|
|
6968
|
+
text: z3.string().trim().min(1)
|
|
6964
6969
|
})
|
|
6965
6970
|
]).superRefine((value, context) => {
|
|
6966
6971
|
if (value.commandType === "steer" && value.runId !== value.payload.targetRunId) {
|
|
@@ -6970,6 +6975,13 @@ var AgentSessionCommandSchema = z3.discriminatedUnion("commandType", [
|
|
|
6970
6975
|
message: "Steering targetRunId must match the command runId."
|
|
6971
6976
|
});
|
|
6972
6977
|
}
|
|
6978
|
+
if (value.commandType === "retry-summary" && value.runId !== value.payload.sourceRunId) {
|
|
6979
|
+
context.addIssue({
|
|
6980
|
+
code: "custom",
|
|
6981
|
+
path: ["payload", "sourceRunId"],
|
|
6982
|
+
message: "Summary retry sourceRunId must match the command runId."
|
|
6983
|
+
});
|
|
6984
|
+
}
|
|
6973
6985
|
});
|
|
6974
6986
|
var AgentSessionTargetedCommandSchema = AgentSessionCommandSchema.and(
|
|
6975
6987
|
z3.object({ runId: ContractIdentifierSchema })
|
|
@@ -6977,6 +6989,7 @@ var AgentSessionTargetedCommandSchema = AgentSessionCommandSchema.and(
|
|
|
6977
6989
|
var AgentSessionCommandErrorCodeSchema = z3.enum([
|
|
6978
6990
|
"SESSION_NOT_FOUND",
|
|
6979
6991
|
"RUN_NOT_FOUND",
|
|
6992
|
+
"ACTIVE_RUN_NOT_FOUND",
|
|
6980
6993
|
"RUN_ALREADY_FINISHED",
|
|
6981
6994
|
"STOP_TIMEOUT",
|
|
6982
6995
|
"COMMAND_NOT_SUPPORTED",
|
|
@@ -7069,6 +7082,7 @@ var AGENT_SESSION_COMMAND_TRANSITIONS = {
|
|
|
7069
7082
|
stop: { queued: "stopping", running: "stopping", waiting_approval: "stopping" },
|
|
7070
7083
|
resume: { stopped: "queued", completed: "queued", failed: "queued" },
|
|
7071
7084
|
retry: { failed: "queued" },
|
|
7085
|
+
"retry-summary": {},
|
|
7072
7086
|
approval: { waiting_approval: "running" },
|
|
7073
7087
|
fork: {},
|
|
7074
7088
|
"edit-and-rerun": {},
|
|
@@ -7106,6 +7120,14 @@ var AGENT_SESSION_COMMAND_POLICIES = Object.freeze({
|
|
|
7106
7120
|
idempotencyScope: "session-command",
|
|
7107
7121
|
sequenceRule: "match-current"
|
|
7108
7122
|
}),
|
|
7123
|
+
"retry-summary": sessionCommandPolicy({
|
|
7124
|
+
capability: "summary",
|
|
7125
|
+
allowedStatuses: ["stopped", "completed", "failed"],
|
|
7126
|
+
requiresRunId: true,
|
|
7127
|
+
sourceSessionEffect: "preserve",
|
|
7128
|
+
idempotencyScope: "session-command",
|
|
7129
|
+
sequenceRule: "match-current"
|
|
7130
|
+
}),
|
|
7109
7131
|
approval: sessionCommandPolicy({
|
|
7110
7132
|
capability: "approval",
|
|
7111
7133
|
allowedStatuses: ["waiting_approval"],
|
|
@@ -7290,6 +7312,17 @@ var AgentSessionEventSchema = z3.discriminatedUnion("eventType", [
|
|
|
7290
7312
|
durationMs: z3.number().nonnegative().optional(),
|
|
7291
7313
|
output: z3.string().optional()
|
|
7292
7314
|
}),
|
|
7315
|
+
sessionEvent("steer", {
|
|
7316
|
+
commandId: ContractIdentifierSchema,
|
|
7317
|
+
targetRunId: ContractIdentifierSchema,
|
|
7318
|
+
text: z3.string().trim().min(1),
|
|
7319
|
+
status: z3.enum(["accepted", "applied", "failed"]),
|
|
7320
|
+
error: z3.object({
|
|
7321
|
+
code: AgentSessionCommandErrorCodeSchema,
|
|
7322
|
+
message: z3.string(),
|
|
7323
|
+
retryable: z3.boolean()
|
|
7324
|
+
}).strict().optional()
|
|
7325
|
+
}),
|
|
7293
7326
|
sessionEvent("summary", {
|
|
7294
7327
|
summaryId: ContractIdentifierSchema,
|
|
7295
7328
|
runId: ContractIdentifierSchema,
|
|
@@ -7299,6 +7332,23 @@ var AgentSessionEventSchema = z3.discriminatedUnion("eventType", [
|
|
|
7299
7332
|
status: z3.enum(["generating", "completed", "failed"])
|
|
7300
7333
|
})
|
|
7301
7334
|
]).superRefine((value, context) => {
|
|
7335
|
+
if (value.eventType === "steer") {
|
|
7336
|
+
if (value.runId !== value.payload.targetRunId) {
|
|
7337
|
+
context.addIssue({
|
|
7338
|
+
code: "custom",
|
|
7339
|
+
path: ["payload", "targetRunId"],
|
|
7340
|
+
message: "Steering payload targetRunId must match the event runId."
|
|
7341
|
+
});
|
|
7342
|
+
}
|
|
7343
|
+
const requiresError = value.payload.status === "failed";
|
|
7344
|
+
if (requiresError !== Boolean(value.payload.error)) {
|
|
7345
|
+
context.addIssue({
|
|
7346
|
+
code: "custom",
|
|
7347
|
+
path: ["payload", "error"],
|
|
7348
|
+
message: requiresError ? "Failed steering events require an error." : "Accepted and applied steering events must not contain an error."
|
|
7349
|
+
});
|
|
7350
|
+
}
|
|
7351
|
+
}
|
|
7302
7352
|
if (value.eventType === "summary" && value.runId !== value.payload.runId) {
|
|
7303
7353
|
context.addIssue({
|
|
7304
7354
|
code: "custom",
|