@ignitionai/cogitator 0.4.1 → 0.5.0

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.
@@ -26,6 +26,12 @@ export const providerUpsertSchema = z.object({
26
26
  apiKey: z.string().optional(),
27
27
  models: z.array(z.object({ id: z.string().min(1) })).optional(),
28
28
  });
29
+ export const providerLoginSchema = z.object({
30
+ type: z.enum(["api_key", "oauth"]),
31
+ });
32
+ export const providerLoginReplySchema = z.object({
33
+ value: z.string().min(1),
34
+ });
29
35
  // ---------- Agents ----------
30
36
  export const subagentInputSchema = z.object({
31
37
  id: z.string().optional(),
@@ -61,6 +67,13 @@ export const workspaceUpdateSchema = z.object({
61
67
  name: z.string().optional(),
62
68
  default_agent_id: z.string().nullable().optional(),
63
69
  });
70
+ // ---------- Groupes (ADR-011) ----------
71
+ export const groupCreateSchema = z.object({
72
+ name: z.string().min(1, "name requis").max(80),
73
+ member_agent_ids: z.array(z.string().min(1)).min(2, "2 bots minimum").max(6, "6 bots maximum"),
74
+ host_agent_id: z.string().optional(),
75
+ default_workspace_id: z.string().nullable().optional(),
76
+ });
64
77
  // ---------- Conversations ----------
65
78
  export const conversationCreateSchema = z.object({
66
79
  workspace_id: z.string().optional(),
@@ -73,21 +86,53 @@ export const conversationCreateSchema = z.object({
73
86
  skills: z.array(z.string()).optional(),
74
87
  tools: z.array(z.string()).optional(),
75
88
  mcp_servers: z.array(mcpServerEntrySchema).optional(),
89
+ /** Runtime figé à la création (Plan 0002 §6) ; durable = harnais Durable du contrôleur. */
90
+ runtime: z.enum(["classic", "durable"]).optional(),
76
91
  });
77
92
  export const imageContentSchema = z.object({
78
93
  type: z.literal("image"),
79
94
  data: z.string().max(15_000_000, "image > ~10 Mo (base64)"),
80
95
  mimeType: z.string().regex(/^image\//, "mimeType image/* requis"),
81
96
  });
97
+ export const REQUEST_ID_MAX = 128;
98
+ export const requestIdSchema = z
99
+ .string()
100
+ .min(1)
101
+ .max(REQUEST_ID_MAX, `requestId > ${REQUEST_ID_MAX} caractères`)
102
+ .regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/, "requestId : lettres, chiffres, . _ - ; commence par une lettre ou un chiffre");
82
103
  export const messageSchema = z.object({
83
104
  text: z.string().optional(),
84
105
  images: z.array(imageContentSchema).max(8, "8 images max par message").optional(),
106
+ /** Mode durable (obligatoire là-bas) : identité stable et bornée de soumission. */
107
+ requestId: requestIdSchema.optional(),
85
108
  }).refine((b) => (b.text?.trim() ?? "") !== "" || (b.images?.length ?? 0) > 0, {
86
109
  message: "text ou images requis",
87
110
  });
88
111
  export const modelSwitchSchema = z.object({
89
112
  provider: z.string().min(1),
90
113
  id: z.string().min(1),
114
+ thinking: thinkingSchema.optional(),
115
+ scope: z.string().optional(),
116
+ });
117
+ // ---------- Approbations et budget des missions durables (#16) ----------
118
+ /**
119
+ * Décision owner sur une action en attente créée côté SERVEUR : le client ne
120
+ * choisit jamais l'action à approuver, seulement la décision ( approve/deny ).
121
+ */
122
+ export const approvalDecisionSchema = z.object({
123
+ pendingActionId: z.string().uuid("pendingActionId invalide"),
124
+ decision: z.enum(["approved", "denied"]),
125
+ denialReason: z.string().max(500).optional(),
126
+ });
127
+ /**
128
+ * Changement EXPLICITE de politique de budget par l'owner : c'est le seul
129
+ * moyen de délier une limite de mission (aucun reset implicite, UA3).
130
+ */
131
+ export const budgetUpdateSchema = z.object({
132
+ missionCalls: z.number().int().min(0).max(1_000_000).optional(),
133
+ missionTokens: z.number().int().min(0).max(10_000_000_000).optional(),
134
+ dailyCalls: z.number().int().min(0).max(1_000_000).optional(),
135
+ dailyTokens: z.number().int().min(0).max(10_000_000_000).optional(),
91
136
  });
92
137
  // ---------- Schedules ----------
93
138
  export const scheduleCreateSchema = z.object({