@ignitionai/cogitator 0.1.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.
- package/README.md +44 -0
- package/dist/extensions/index.js +63 -0
- package/dist/src/agents.js +238 -0
- package/dist/src/board.js +277 -0
- package/dist/src/cli.js +71 -0
- package/dist/src/config.js +7 -0
- package/dist/src/conversations.js +41 -0
- package/dist/src/cron.js +227 -0
- package/dist/src/db.js +128 -0
- package/dist/src/default-agent.js +154 -0
- package/dist/src/file-changes.js +113 -0
- package/dist/src/history.js +88 -0
- package/dist/src/json-files.js +18 -0
- package/dist/src/mcp-env.js +29 -0
- package/dist/src/mcp-server.js +167 -0
- package/dist/src/paths.js +22 -0
- package/dist/src/pi.js +23 -0
- package/dist/src/pool.js +183 -0
- package/dist/src/registry.js +171 -0
- package/dist/src/schemas.js +134 -0
- package/dist/src/server.js +829 -0
- package/dist/src/session-lines.js +27 -0
- package/dist/src/skills-import.js +167 -0
- package/dist/src/spawn.js +39 -0
- package/dist/src/spawner.js +28 -0
- package/dist/src/workspace-files.js +93 -0
- package/dist/src/workspaces.js +81 -0
- package/package.json +60 -0
- package/web/dist/assets/index-BoKe95MT.js +12 -0
- package/web/dist/assets/index-SltX54ZZ.css +1 -0
- package/web/dist/assets/inter-cyrillic-400-normal-HOLc17fK.woff +0 -0
- package/web/dist/assets/inter-cyrillic-400-normal-obahsSVq.woff2 +0 -0
- package/web/dist/assets/inter-cyrillic-500-normal-BasfLYem.woff2 +0 -0
- package/web/dist/assets/inter-cyrillic-500-normal-CxZf_p3X.woff +0 -0
- package/web/dist/assets/inter-cyrillic-600-normal-4D_pXhcN.woff +0 -0
- package/web/dist/assets/inter-cyrillic-600-normal-CWCymEST.woff2 +0 -0
- package/web/dist/assets/inter-cyrillic-ext-400-normal-BQZuk6qB.woff2 +0 -0
- package/web/dist/assets/inter-cyrillic-ext-400-normal-DQukG94-.woff +0 -0
- package/web/dist/assets/inter-cyrillic-ext-500-normal-B0yAr1jD.woff2 +0 -0
- package/web/dist/assets/inter-cyrillic-ext-500-normal-BmqWE9Dz.woff +0 -0
- package/web/dist/assets/inter-cyrillic-ext-600-normal-Bcila6Z-.woff +0 -0
- package/web/dist/assets/inter-cyrillic-ext-600-normal-Dfes3d0z.woff2 +0 -0
- package/web/dist/assets/inter-greek-400-normal-B4URO6DV.woff2 +0 -0
- package/web/dist/assets/inter-greek-400-normal-q2sYcFCs.woff +0 -0
- package/web/dist/assets/inter-greek-500-normal-BIZE56-Y.woff2 +0 -0
- package/web/dist/assets/inter-greek-500-normal-Xzm54t5V.woff +0 -0
- package/web/dist/assets/inter-greek-600-normal-BZpKdvQh.woff +0 -0
- package/web/dist/assets/inter-greek-600-normal-plRanbMR.woff2 +0 -0
- package/web/dist/assets/inter-greek-ext-400-normal-DGGRlc-M.woff2 +0 -0
- package/web/dist/assets/inter-greek-ext-400-normal-KugGGMne.woff +0 -0
- package/web/dist/assets/inter-greek-ext-500-normal-2j5mBUwD.woff +0 -0
- package/web/dist/assets/inter-greek-ext-500-normal-C4iEst2y.woff2 +0 -0
- package/web/dist/assets/inter-greek-ext-600-normal-B8X0CLgF.woff +0 -0
- package/web/dist/assets/inter-greek-ext-600-normal-DRtmH8MT.woff2 +0 -0
- package/web/dist/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
- package/web/dist/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
- package/web/dist/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
- package/web/dist/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
- package/web/dist/assets/inter-latin-600-normal-CiBQ2DWP.woff +0 -0
- package/web/dist/assets/inter-latin-600-normal-LgqL8muc.woff2 +0 -0
- package/web/dist/assets/inter-latin-ext-400-normal-77YHD8bZ.woff +0 -0
- package/web/dist/assets/inter-latin-ext-400-normal-C1nco2VV.woff2 +0 -0
- package/web/dist/assets/inter-latin-ext-500-normal-BxGbmqWO.woff +0 -0
- package/web/dist/assets/inter-latin-ext-500-normal-CV4jyFjo.woff2 +0 -0
- package/web/dist/assets/inter-latin-ext-600-normal-CIVaiw4L.woff +0 -0
- package/web/dist/assets/inter-latin-ext-600-normal-D2bJ5OIk.woff2 +0 -0
- package/web/dist/assets/inter-vietnamese-400-normal-Bbgyi5SW.woff +0 -0
- package/web/dist/assets/inter-vietnamese-400-normal-DMkecbls.woff2 +0 -0
- package/web/dist/assets/inter-vietnamese-500-normal-DOriooB6.woff2 +0 -0
- package/web/dist/assets/inter-vietnamese-500-normal-mJboJaSs.woff +0 -0
- package/web/dist/assets/inter-vietnamese-600-normal-BuLX-rYi.woff +0 -0
- package/web/dist/assets/inter-vietnamese-600-normal-Cc8MFFhd.woff2 +0 -0
- package/web/dist/favicon.png +0 -0
- package/web/dist/icon.png +0 -0
- package/web/dist/index.html +16 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { readJson, atomicWriteJson } from "./json-files.js";
|
|
5
|
+
import { MCP_NAME, PROVIDER_ID } from "./schemas.js";
|
|
6
|
+
export const API_PROTOCOLS = [
|
|
7
|
+
"openai-completions",
|
|
8
|
+
"openai-responses",
|
|
9
|
+
"openai-codex-responses",
|
|
10
|
+
"anthropic-messages",
|
|
11
|
+
"google-generative-ai",
|
|
12
|
+
"google-vertex",
|
|
13
|
+
"azure-openai-responses",
|
|
14
|
+
"amazon-bedrock",
|
|
15
|
+
"radius",
|
|
16
|
+
];
|
|
17
|
+
/** Limite imposée par pi sur la description d'un skill (frontmatter SKILL.md). */
|
|
18
|
+
export const SKILL_DESCRIPTION_MAX = 1024;
|
|
19
|
+
const AUTH_CHECK_TIMEOUT_MS = 15_000;
|
|
20
|
+
export function readCatalog(paths) {
|
|
21
|
+
const catalog = readJson(join(paths.piAgentDir, "models-store.json"), {});
|
|
22
|
+
const customs = readJson(paths.piModelsJson, {}).providers ?? {};
|
|
23
|
+
const out = new Map();
|
|
24
|
+
for (const [id, entry] of Object.entries(catalog)) {
|
|
25
|
+
out.set(id, (entry.models ?? []).map((m) => ({ id: String(m.id), name: m.name, reasoning: m.reasoning })));
|
|
26
|
+
}
|
|
27
|
+
for (const [id, entry] of Object.entries(customs)) {
|
|
28
|
+
const models = Array.isArray(entry.models) ? entry.models : [];
|
|
29
|
+
out.set(id, models.map((m) => ({ id: String(m.id) }))); // un custom écrase le built-in éponyme
|
|
30
|
+
}
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
function readAuth(paths) {
|
|
34
|
+
return readJson(paths.piAuthJson, {});
|
|
35
|
+
}
|
|
36
|
+
const authCache = new Map();
|
|
37
|
+
const AUTH_TTL_MS = 60_000;
|
|
38
|
+
function checkAuthReady(provider) {
|
|
39
|
+
const cached = authCache.get(provider);
|
|
40
|
+
if (cached && Date.now() - cached.at < AUTH_TTL_MS)
|
|
41
|
+
return Promise.resolve(cached.ready);
|
|
42
|
+
return new Promise((resolve) => {
|
|
43
|
+
execFile("pi", ["auth", "check", "--provider", provider, "--json"], { timeout: AUTH_CHECK_TIMEOUT_MS }, (err, stdout) => {
|
|
44
|
+
let ready = null;
|
|
45
|
+
try {
|
|
46
|
+
ready = JSON.parse(stdout).status === "ready";
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
ready = null;
|
|
50
|
+
}
|
|
51
|
+
if (err && ready === null)
|
|
52
|
+
ready = false;
|
|
53
|
+
authCache.set(provider, { at: Date.now(), ready });
|
|
54
|
+
resolve(ready);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/** providers enrichis : catalogue + source + statut auth. Prêt pour GET /api/providers. */
|
|
59
|
+
export async function listProviders(paths) {
|
|
60
|
+
const catalog = readCatalog(paths);
|
|
61
|
+
const auth = readAuth(paths);
|
|
62
|
+
const customs = readJson(paths.piModelsJson, {}).providers ?? {};
|
|
63
|
+
const view = async (id, source) => ({
|
|
64
|
+
id,
|
|
65
|
+
source,
|
|
66
|
+
models: catalog.get(id) ?? [],
|
|
67
|
+
auth: { configured: Boolean(auth[id]), type: auth[id]?.type ?? null, ready: await checkAuthReady(id) },
|
|
68
|
+
});
|
|
69
|
+
const views = await Promise.all([
|
|
70
|
+
...[...catalog.keys()].map((id) => view(id, customs[id] ? "custom" : "builtin")),
|
|
71
|
+
...Object.keys(customs).filter((id) => !catalog.has(id)).map((id) => view(id, "custom")),
|
|
72
|
+
]);
|
|
73
|
+
return views.sort((a, b) => a.id.localeCompare(b.id));
|
|
74
|
+
}
|
|
75
|
+
/** Un protocole API inconnu de pi est refusé (API_PROTOCOLS vient du catalogue pi). */
|
|
76
|
+
function validateProtocol(api) {
|
|
77
|
+
if (!api)
|
|
78
|
+
return null;
|
|
79
|
+
return API_PROTOCOLS.includes(api)
|
|
80
|
+
? null
|
|
81
|
+
: `api inconnue: ${api} (protocoles: ${API_PROTOCOLS.join(", ")})`;
|
|
82
|
+
}
|
|
83
|
+
export function upsertProvider(paths, id, input) {
|
|
84
|
+
if (!PROVIDER_ID.test(id))
|
|
85
|
+
return { error: `id provider invalide: ${id}` };
|
|
86
|
+
const protocolError = validateProtocol(input.api);
|
|
87
|
+
if (protocolError)
|
|
88
|
+
return { error: protocolError };
|
|
89
|
+
const file = readJson(paths.piModelsJson, {});
|
|
90
|
+
file.providers ??= {};
|
|
91
|
+
const existing = file.providers[id] ?? {};
|
|
92
|
+
const next = { ...existing };
|
|
93
|
+
if (input.baseUrl !== undefined)
|
|
94
|
+
next.baseUrl = input.baseUrl;
|
|
95
|
+
if (input.api !== undefined)
|
|
96
|
+
next.api = input.api;
|
|
97
|
+
if (input.models !== undefined)
|
|
98
|
+
next.models = input.models;
|
|
99
|
+
file.providers[id] = next;
|
|
100
|
+
atomicWriteJson(paths.piModelsJson, file);
|
|
101
|
+
if (input.apiKey !== undefined) {
|
|
102
|
+
const auth = readAuth(paths);
|
|
103
|
+
auth[id] = { type: "api_key", key: input.apiKey };
|
|
104
|
+
atomicWriteJson(paths.piAuthJson, auth);
|
|
105
|
+
}
|
|
106
|
+
return {};
|
|
107
|
+
}
|
|
108
|
+
export function deleteProvider(paths, id) {
|
|
109
|
+
const file = readJson(paths.piModelsJson, {});
|
|
110
|
+
if (file.providers) {
|
|
111
|
+
delete file.providers[id];
|
|
112
|
+
atomicWriteJson(paths.piModelsJson, file);
|
|
113
|
+
}
|
|
114
|
+
const auth = readAuth(paths);
|
|
115
|
+
if (auth[id]) {
|
|
116
|
+
delete auth[id];
|
|
117
|
+
atomicWriteJson(paths.piAuthJson, auth);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// ---------- Skills (scan) ----------
|
|
121
|
+
export function listSkills(paths) {
|
|
122
|
+
const out = [];
|
|
123
|
+
for (const dir of paths.skillsDirs) {
|
|
124
|
+
if (!existsSync(dir))
|
|
125
|
+
continue;
|
|
126
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
127
|
+
if (!entry.isDirectory())
|
|
128
|
+
continue;
|
|
129
|
+
const file = join(dir, entry.name, "SKILL.md");
|
|
130
|
+
if (!existsSync(file))
|
|
131
|
+
continue;
|
|
132
|
+
const text = readFileSync(file, "utf8");
|
|
133
|
+
const name = /^name:\s*(.+)$/m.exec(text)?.[1]?.trim() ?? entry.name;
|
|
134
|
+
// description sur une ligne ; les descriptions multilignes ne sont pas supportées
|
|
135
|
+
const description = /^description:\s*([^\n]+)/m.exec(text)?.[1]?.trim() ?? "";
|
|
136
|
+
out.push({
|
|
137
|
+
name,
|
|
138
|
+
description,
|
|
139
|
+
path: join(dir, entry.name),
|
|
140
|
+
descriptionTooLong: description.length > SKILL_DESCRIPTION_MAX,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return out.sort((a, b) => a.name.localeCompare(b.name));
|
|
145
|
+
}
|
|
146
|
+
// ---------- MCP user-level ----------
|
|
147
|
+
export function readMcp(paths) {
|
|
148
|
+
return readJson(paths.piMcpJson, { mcpServers: {} });
|
|
149
|
+
}
|
|
150
|
+
export function validateMcpConfig(value) {
|
|
151
|
+
const v = value;
|
|
152
|
+
if (!v || typeof v !== "object" || !v.mcpServers || typeof v.mcpServers !== "object" || Array.isArray(v.mcpServers)) {
|
|
153
|
+
return "shape attendu: { mcpServers: { <name>: { command?, args?, env?, url?, headers? } } }";
|
|
154
|
+
}
|
|
155
|
+
for (const [name, server] of Object.entries(v.mcpServers)) {
|
|
156
|
+
if (!MCP_NAME.test(name))
|
|
157
|
+
return `nom de serveur invalide: ${name}`;
|
|
158
|
+
const s = server;
|
|
159
|
+
if (!s.command && !s.url)
|
|
160
|
+
return `serveur ${name}: command ou url requis`;
|
|
161
|
+
}
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
export function writeMcp(paths, config) {
|
|
165
|
+
atomicWriteJson(paths.piMcpJson, config);
|
|
166
|
+
}
|
|
167
|
+
// ---------- Détection pi-mcp-adapter (conséquence ADR-002) ----------
|
|
168
|
+
export function mcpAdapterDetected(paths) {
|
|
169
|
+
const settings = readJson(join(paths.piAgentDir, "settings.json"), {});
|
|
170
|
+
return Array.isArray(settings.packages) && settings.packages.some((p) => String(p).includes("pi-mcp-adapter"));
|
|
171
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Schémas zod des entrées API — source unique de vérité (clean-code : dériver les
|
|
4
|
+
* types des valeurs, valider à la frontière, jamais de `as` sur un body brut).
|
|
5
|
+
*/
|
|
6
|
+
export const PROVIDER_ID = /^[a-z][a-z0-9-]*$/;
|
|
7
|
+
export const MCP_NAME = /^[A-Za-z0-9_-]+$/;
|
|
8
|
+
export const SUBAGENT_NAME = /^[a-z][a-z0-9_-]*$/;
|
|
9
|
+
export const THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
10
|
+
export const thinkingSchema = z.enum(THINKING_LEVELS);
|
|
11
|
+
// ---------- MCP ----------
|
|
12
|
+
export const mcpServerEntrySchema = z.object({
|
|
13
|
+
name: z.string().regex(MCP_NAME, "lettres, chiffres, _ et - uniquement"),
|
|
14
|
+
command: z.string().optional(),
|
|
15
|
+
args: z.array(z.string()).optional(),
|
|
16
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
17
|
+
cwd: z.string().optional(),
|
|
18
|
+
url: z.string().optional(),
|
|
19
|
+
headers: z.record(z.string(), z.string()).optional(),
|
|
20
|
+
}).refine((e) => e.command || e.url, { message: "command ou url requis" });
|
|
21
|
+
// ---------- Providers ----------
|
|
22
|
+
export const providerUpsertSchema = z.object({
|
|
23
|
+
id: z.string().regex(PROVIDER_ID, "minuscules, chiffres et - ; commence par une lettre").optional(),
|
|
24
|
+
baseUrl: z.string().url().or(z.string().startsWith("http")).optional(),
|
|
25
|
+
api: z.string().optional(),
|
|
26
|
+
apiKey: z.string().optional(),
|
|
27
|
+
models: z.array(z.object({ id: z.string().min(1) })).optional(),
|
|
28
|
+
});
|
|
29
|
+
// ---------- Agents ----------
|
|
30
|
+
export const subagentInputSchema = z.object({
|
|
31
|
+
id: z.string().optional(),
|
|
32
|
+
name: z.string().regex(SUBAGENT_NAME, "minuscules, chiffres, - et _ ; commence par une lettre"),
|
|
33
|
+
description: z.string().optional(),
|
|
34
|
+
provider: z.string().min(1),
|
|
35
|
+
model: z.string().min(1),
|
|
36
|
+
thinking: thinkingSchema.nullish(),
|
|
37
|
+
system_prompt: z.string().optional(),
|
|
38
|
+
skills: z.array(z.string()).optional(),
|
|
39
|
+
mcp_servers: z.array(mcpServerEntrySchema).optional(),
|
|
40
|
+
});
|
|
41
|
+
export const agentInputSchema = z.object({
|
|
42
|
+
name: z.string().min(1, "name requis"),
|
|
43
|
+
description: z.string().optional(),
|
|
44
|
+
provider: z.string().min(1),
|
|
45
|
+
model: z.string().min(1),
|
|
46
|
+
thinking: thinkingSchema.nullish(),
|
|
47
|
+
system_prompt: z.string().optional(),
|
|
48
|
+
skills: z.array(z.string()).optional(),
|
|
49
|
+
tools_allowlist: z.array(z.string()).nullable().optional(),
|
|
50
|
+
mcp_servers: z.array(mcpServerEntrySchema).optional(),
|
|
51
|
+
subagents: z.array(subagentInputSchema).optional(),
|
|
52
|
+
});
|
|
53
|
+
// ---------- Workspaces ----------
|
|
54
|
+
export const workspaceCreateSchema = z.object({
|
|
55
|
+
dir: z.string().min(1, "dir requis"),
|
|
56
|
+
name: z.string().optional(),
|
|
57
|
+
default_agent_id: z.string().nullable().optional(),
|
|
58
|
+
});
|
|
59
|
+
export const workspaceUpdateSchema = z.object({
|
|
60
|
+
name: z.string().optional(),
|
|
61
|
+
default_agent_id: z.string().nullable().optional(),
|
|
62
|
+
});
|
|
63
|
+
// ---------- Conversations ----------
|
|
64
|
+
export const conversationCreateSchema = z.object({
|
|
65
|
+
workspace_id: z.string().optional(),
|
|
66
|
+
prompt: z.string().optional(),
|
|
67
|
+
agent_id: z.string().optional(),
|
|
68
|
+
provider: z.string().optional(),
|
|
69
|
+
model: z.string().optional(),
|
|
70
|
+
thinking: thinkingSchema.nullish(),
|
|
71
|
+
system_prompt: z.string().optional(),
|
|
72
|
+
skills: z.array(z.string()).optional(),
|
|
73
|
+
tools: z.array(z.string()).optional(),
|
|
74
|
+
mcp_servers: z.array(mcpServerEntrySchema).optional(),
|
|
75
|
+
});
|
|
76
|
+
export const imageContentSchema = z.object({
|
|
77
|
+
type: z.literal("image"),
|
|
78
|
+
data: z.string().max(15_000_000, "image > ~10 Mo (base64)"),
|
|
79
|
+
mimeType: z.string().regex(/^image\//, "mimeType image/* requis"),
|
|
80
|
+
});
|
|
81
|
+
export const messageSchema = z.object({
|
|
82
|
+
text: z.string().optional(),
|
|
83
|
+
images: z.array(imageContentSchema).max(8, "8 images max par message").optional(),
|
|
84
|
+
}).refine((b) => (b.text?.trim() ?? "") !== "" || (b.images?.length ?? 0) > 0, {
|
|
85
|
+
message: "text ou images requis",
|
|
86
|
+
});
|
|
87
|
+
export const modelSwitchSchema = z.object({
|
|
88
|
+
provider: z.string().min(1),
|
|
89
|
+
id: z.string().min(1),
|
|
90
|
+
});
|
|
91
|
+
// ---------- Schedules ----------
|
|
92
|
+
export const scheduleCreateSchema = z.object({
|
|
93
|
+
name: z.string().min(1, "name requis"),
|
|
94
|
+
cron_expr: z.string().min(1),
|
|
95
|
+
prompt: z.string().min(1, "prompt requis"),
|
|
96
|
+
agent_id: z.string().min(1),
|
|
97
|
+
workspace_id: z.string().min(1),
|
|
98
|
+
output_policy: z.enum(["append_session", "new_session"]).optional(),
|
|
99
|
+
busy_policy: z.enum(["skip", "queue", "kill"]).optional(),
|
|
100
|
+
catchup: z.boolean().optional(),
|
|
101
|
+
});
|
|
102
|
+
export const scheduleUpdateSchema = z.object({
|
|
103
|
+
name: z.string().optional(),
|
|
104
|
+
cron_expr: z.string().optional(),
|
|
105
|
+
prompt: z.string().optional(),
|
|
106
|
+
output_policy: z.enum(["append_session", "new_session"]).optional(),
|
|
107
|
+
busy_policy: z.enum(["skip", "queue", "kill"]).optional(),
|
|
108
|
+
catchup: z.boolean().optional(),
|
|
109
|
+
enabled: z.boolean().optional(),
|
|
110
|
+
});
|
|
111
|
+
// ---------- Board (kanban workspace) ----------
|
|
112
|
+
export const CARD_STATUSES = ["backlog", "todo", "in_progress", "done", "canceled"];
|
|
113
|
+
export const CARD_PRIORITIES = ["urgent", "high", "medium", "low"];
|
|
114
|
+
export const boardCardSchema = z.object({
|
|
115
|
+
title: z.string().min(1, "title requis").max(200),
|
|
116
|
+
description: z.string().max(20_000).optional(),
|
|
117
|
+
status: z.enum(CARD_STATUSES).optional(),
|
|
118
|
+
priority: z.enum(CARD_PRIORITIES).optional(),
|
|
119
|
+
labels: z.array(z.string().min(1).max(30)).max(8).optional(),
|
|
120
|
+
assignee_agent_id: z.string().nullable().optional(),
|
|
121
|
+
conversation_ids: z.array(z.string()).max(10).optional(),
|
|
122
|
+
blocks: z.array(z.string()).max(20).optional(),
|
|
123
|
+
blocked_by: z.array(z.string()).max(20).optional(),
|
|
124
|
+
github_issue: z.number().int().nullable().optional(),
|
|
125
|
+
});
|
|
126
|
+
export const boardCommentSchema = z.object({
|
|
127
|
+
text: z.string().min(1).max(5000),
|
|
128
|
+
author: z.string().min(1).max(60).optional(), // défaut "user" ; le Majordome passe son nom
|
|
129
|
+
});
|
|
130
|
+
// ---------- Skills ----------
|
|
131
|
+
export const skillImportSchema = z.object({
|
|
132
|
+
source: z.string().min(1, "source requise (URL GitHub ou chemin local)"),
|
|
133
|
+
overwrite: z.boolean().optional(),
|
|
134
|
+
});
|