@inf-monkeys-tech/monkeys 1.0.11 → 1.0.13

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.
@@ -7092,6 +7092,39 @@ var CapabilityRegistryDocumentSchema = z4.object({
7092
7092
  // src/contracts/agent.ts
7093
7093
  import { z as z5 } from "zod";
7094
7094
  var AgentModeSchema = z5.enum(["chatbot", "agent"]);
7095
+ var AgentConfigurationCapabilitySchema = z5.enum([
7096
+ "models",
7097
+ "skills",
7098
+ "tools",
7099
+ "mcp",
7100
+ "reasoning"
7101
+ ]);
7102
+ var AgentModeCapabilitiesSchema = z5.object({
7103
+ models: z5.boolean(),
7104
+ skills: z5.boolean(),
7105
+ tools: z5.boolean(),
7106
+ mcp: z5.boolean(),
7107
+ reasoning: z5.boolean()
7108
+ }).strict();
7109
+ var AgentResourceModeSupportSchema = z5.object({
7110
+ modes: z5.array(AgentModeSchema).min(1)
7111
+ }).strict();
7112
+ var AGENT_MODE_CAPABILITIES = Object.freeze({
7113
+ chatbot: AgentModeCapabilitiesSchema.parse({
7114
+ models: true,
7115
+ skills: true,
7116
+ tools: true,
7117
+ mcp: true,
7118
+ reasoning: false
7119
+ }),
7120
+ agent: AgentModeCapabilitiesSchema.parse({
7121
+ models: true,
7122
+ skills: true,
7123
+ tools: true,
7124
+ mcp: true,
7125
+ reasoning: true
7126
+ })
7127
+ });
7095
7128
  var AgentSessionCapabilitySchema = z5.enum([
7096
7129
  "text",
7097
7130
  "reasoning",
@@ -7135,6 +7168,81 @@ var AgentSessionSnapshotSchema = z5.object({
7135
7168
  modelId: z5.string().trim().min(1),
7136
7169
  capabilities: AgentSessionCapabilitiesSchema
7137
7170
  }).strict();
7171
+ var AgentSessionStatusSchema = z5.enum([
7172
+ "queued",
7173
+ "running",
7174
+ "waiting_approval",
7175
+ "stopping",
7176
+ "stopped",
7177
+ "completed",
7178
+ "failed"
7179
+ ]);
7180
+ var AgentSessionCommandTypeSchema = z5.enum(["stop", "resume", "retry", "approval"]);
7181
+ var AgentSessionCommandHeaderSchema = z5.object({
7182
+ contract: z5.literal("AgentSessionCommand"),
7183
+ commandId: ContractIdentifierSchema,
7184
+ sessionId: ContractIdentifierSchema,
7185
+ idempotencyKey: ContractIdentifierSchema,
7186
+ expectedSequence: z5.number().int().min(-1),
7187
+ issuedAt: IsoDateTimeSchema
7188
+ }).strict();
7189
+ var sessionCommand = (commandType, payload) => AgentSessionCommandHeaderSchema.extend({
7190
+ commandType: z5.literal(commandType),
7191
+ payload: z5.object(payload).strict()
7192
+ }).strict();
7193
+ var AgentSessionCommandSchema = z5.discriminatedUnion("commandType", [
7194
+ sessionCommand("stop", {
7195
+ reason: z5.string().trim().min(1).optional()
7196
+ }),
7197
+ sessionCommand("resume", {
7198
+ resumeEventId: ContractIdentifierSchema.optional()
7199
+ }),
7200
+ sessionCommand("retry", {
7201
+ sourceEventId: ContractIdentifierSchema
7202
+ }),
7203
+ sessionCommand("approval", {
7204
+ approvalId: ContractIdentifierSchema,
7205
+ decision: z5.enum(["approved", "rejected"]),
7206
+ reason: z5.string().trim().min(1).optional()
7207
+ })
7208
+ ]);
7209
+ var AgentSessionCommandErrorCodeSchema = z5.enum([
7210
+ "SESSION_NOT_FOUND",
7211
+ "COMMAND_NOT_SUPPORTED",
7212
+ "CAPABILITY_UNAVAILABLE",
7213
+ "SEQUENCE_CONFLICT",
7214
+ "INVALID_SESSION_STATE",
7215
+ "TARGET_EVENT_NOT_FOUND",
7216
+ "TARGET_EVENT_NOT_RETRYABLE",
7217
+ "APPROVAL_NOT_FOUND",
7218
+ "APPROVAL_ALREADY_RESOLVED",
7219
+ "COMMAND_EXECUTION_FAILED"
7220
+ ]);
7221
+ var AgentSessionCommandResultSchema = z5.object({
7222
+ contract: z5.literal("AgentSessionCommandResult"),
7223
+ commandId: ContractIdentifierSchema,
7224
+ sessionId: ContractIdentifierSchema,
7225
+ idempotencyKey: ContractIdentifierSchema,
7226
+ outcome: z5.enum(["accepted", "duplicate", "rejected", "failed"]),
7227
+ sessionStatus: AgentSessionStatusSchema,
7228
+ acceptedSequence: z5.number().int().nonnegative().optional(),
7229
+ resultEventIds: z5.array(ContractIdentifierSchema).default([]),
7230
+ error: z5.object({
7231
+ code: AgentSessionCommandErrorCodeSchema,
7232
+ message: z5.string(),
7233
+ retryable: z5.boolean()
7234
+ }).strict().optional(),
7235
+ occurredAt: IsoDateTimeSchema
7236
+ }).strict().superRefine((value, context) => {
7237
+ const requiresError = value.outcome === "rejected" || value.outcome === "failed";
7238
+ if (requiresError !== Boolean(value.error)) {
7239
+ context.addIssue({
7240
+ code: "custom",
7241
+ path: ["error"],
7242
+ message: requiresError ? "Rejected and failed command results require an error." : "Accepted and duplicate command results must not contain an error."
7243
+ });
7244
+ }
7245
+ });
7138
7246
  var AgentSessionEventHeaderSchema = z5.object({
7139
7247
  contract: z5.literal("AgentSessionEvent"),
7140
7248
  eventId: ContractIdentifierSchema,
@@ -7197,7 +7305,7 @@ var AgentSessionEventSchema = z5.discriminatedUnion("eventType", [
7197
7305
  requestedAction: JsonValueSchema.optional()
7198
7306
  }),
7199
7307
  sessionEvent("status", {
7200
- status: z5.enum(["queued", "running", "waiting_approval", "stopping", "stopped", "completed", "failed"]),
7308
+ status: AgentSessionStatusSchema,
7201
7309
  detail: z5.string().optional()
7202
7310
  }),
7203
7311
  sessionEvent("artifact", {
@@ -7258,7 +7366,7 @@ var AgentSessionViewModelSchema = z5.object({
7258
7366
  contract: z5.literal("AgentSessionViewModel"),
7259
7367
  sessionId: ContractIdentifierSchema,
7260
7368
  snapshot: AgentSessionSnapshotSchema,
7261
- status: z5.enum(["queued", "running", "waiting_approval", "stopping", "stopped", "completed", "failed"]),
7369
+ status: AgentSessionStatusSchema,
7262
7370
  events: z5.array(AgentSessionEventSchema),
7263
7371
  lastSequence: z5.number().int().min(-1),
7264
7372
  resumable: z5.boolean().default(false)
@@ -11278,6 +11386,8 @@ var WorkflowDefinitionSchema = z14.object({
11278
11386
 
11279
11387
  // src/schemas/index.ts
11280
11388
  var canonicalContractSchemas = {
11389
+ "agent-session-command": AgentSessionCommandSchema,
11390
+ "agent-session-command-result": AgentSessionCommandResultSchema,
11281
11391
  "agent-session-event": AgentSessionEventSchema,
11282
11392
  "agent-session-view-model": AgentSessionViewModelSchema,
11283
11393
  "agent-runtime-event": AgentRuntimeEventSchema,
@@ -11335,13 +11445,21 @@ var canonicalContractSchemas = {
11335
11445
  "workflow-definition": WorkflowDefinitionSchema
11336
11446
  };
11337
11447
  export {
11448
+ AgentConfigurationCapabilitySchema,
11338
11449
  AgentExecutionModeSchema,
11450
+ AgentModeCapabilitiesSchema,
11339
11451
  AgentModeSchema,
11452
+ AgentResourceModeSupportSchema,
11340
11453
  AgentRuntimeEventSchema,
11341
11454
  AgentSessionCapabilitiesSchema,
11342
11455
  AgentSessionCapabilitySchema,
11456
+ AgentSessionCommandErrorCodeSchema,
11457
+ AgentSessionCommandResultSchema,
11458
+ AgentSessionCommandSchema,
11459
+ AgentSessionCommandTypeSchema,
11343
11460
  AgentSessionEventSchema,
11344
11461
  AgentSessionSnapshotSchema,
11462
+ AgentSessionStatusSchema,
11345
11463
  AgentSessionViewModelSchema,
11346
11464
  ApplicationHandoffEndpointSchema,
11347
11465
  ApplicationHandoffSchema,