@mgsoftwarebv/mg-dashboard-mcp 7.3.0 → 7.3.1
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/dist/index.js +290 -149
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ import { sql } from 'drizzle-orm';
|
|
|
20
20
|
import { once } from 'events';
|
|
21
21
|
import { lookup } from 'dns/promises';
|
|
22
22
|
import { connect } from 'tls';
|
|
23
|
-
import { pgTable, timestamp, jsonb, uuid, boolean, text, pgEnum, integer, uniqueIndex, index, bigint } from 'drizzle-orm/pg-core';
|
|
23
|
+
import { pgTable, timestamp, jsonb, uuid, boolean, text, pgEnum, integer, uniqueIndex, index, check, bigint } from 'drizzle-orm/pg-core';
|
|
24
24
|
import { HeadObjectCommand, ListObjectsV2Command, DeleteObjectsCommand, S3Client, DeleteObjectCommand, CreateMultipartUploadCommand, UploadPartCommand, CompleteMultipartUploadCommand, AbortMultipartUploadCommand, PutObjectCommand, GetObjectCommand, CopyObjectCommand } from '@aws-sdk/client-s3';
|
|
25
25
|
|
|
26
26
|
var __defProp = Object.defineProperty;
|
|
@@ -683,10 +683,10 @@ var TRIGGER_TOOL_MODULE_MAP = {
|
|
|
683
683
|
"trigger-run": "ci_cd"
|
|
684
684
|
};
|
|
685
685
|
async function discoverInstance(projectSlug, conn, proxy, sshExec2) {
|
|
686
|
-
const
|
|
686
|
+
const sql26 = `SELECT re.\\"apiKey\\" FROM \\"RuntimeEnvironment\\" re JOIN \\"Project\\" p ON re.\\"projectId\\" = p.id WHERE p.slug='${projectSlug}' AND re.slug='prod' LIMIT 1`;
|
|
687
687
|
const cmd = [
|
|
688
688
|
`PORT=$(docker port "${WA_CONTAINER}" 3000/tcp 2>/dev/null | head -1 | sed 's/.*://')`,
|
|
689
|
-
`KEY=$(docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${
|
|
689
|
+
`KEY=$(docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${sql26}" 2>/dev/null | tr -d '[:space:]')`,
|
|
690
690
|
'echo "$PORT|$KEY"'
|
|
691
691
|
].join(" && ");
|
|
692
692
|
const result = await sshExec2(conn, cmd, proxy);
|
|
@@ -707,8 +707,8 @@ async function discoverInstance(projectSlug, conn, proxy, sshExec2) {
|
|
|
707
707
|
return { port, apiKey: apiKey2 };
|
|
708
708
|
}
|
|
709
709
|
async function fetchRunLogs(runId, conn, proxy, sshExec2) {
|
|
710
|
-
const
|
|
711
|
-
const cmd = `docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${
|
|
710
|
+
const sql26 = `SELECT level, message, \\"isError\\", \\"createdAt\\" FROM \\"TaskEvent\\" WHERE \\"runId\\" = '${runId}' AND level IN ('INFO','WARN','ERROR','DEBUG','LOG','TRACE') ORDER BY \\"startTime\\" ASC LIMIT 200`;
|
|
711
|
+
const cmd = `docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${sql26}" 2>/dev/null`;
|
|
712
712
|
const result = await sshExec2(conn, cmd, proxy);
|
|
713
713
|
const output = result.stdout.trim();
|
|
714
714
|
if (!output) return "";
|
|
@@ -790,8 +790,8 @@ async function handleTriggerTool(name, args2, deps) {
|
|
|
790
790
|
switch (name) {
|
|
791
791
|
// -----------------------------------------------------------------
|
|
792
792
|
case "trigger-list": {
|
|
793
|
-
const
|
|
794
|
-
const cmd = `docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${
|
|
793
|
+
const sql26 = 'SELECT slug, name FROM \\"Project\\" ORDER BY name';
|
|
794
|
+
const cmd = `docker exec "${PG_CONTAINER}" psql -U postgres -d main -t -A -c "${sql26}" 2>/dev/null`;
|
|
795
795
|
const result = await sshExec2(conn, cmd, proxy);
|
|
796
796
|
const output = result.stdout.trim();
|
|
797
797
|
if (!output) {
|
|
@@ -1845,7 +1845,7 @@ var ZodType = class {
|
|
|
1845
1845
|
const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
|
|
1846
1846
|
return handleResult(ctx, result);
|
|
1847
1847
|
}
|
|
1848
|
-
refine(
|
|
1848
|
+
refine(check2, message) {
|
|
1849
1849
|
const getIssueProperties = (val) => {
|
|
1850
1850
|
if (typeof message === "string" || typeof message === "undefined") {
|
|
1851
1851
|
return { message };
|
|
@@ -1856,7 +1856,7 @@ var ZodType = class {
|
|
|
1856
1856
|
}
|
|
1857
1857
|
};
|
|
1858
1858
|
return this._refinement((val, ctx) => {
|
|
1859
|
-
const result =
|
|
1859
|
+
const result = check2(val);
|
|
1860
1860
|
const setError = () => ctx.addIssue({
|
|
1861
1861
|
code: ZodIssueCode.custom,
|
|
1862
1862
|
...getIssueProperties(val)
|
|
@@ -1879,9 +1879,9 @@ var ZodType = class {
|
|
|
1879
1879
|
}
|
|
1880
1880
|
});
|
|
1881
1881
|
}
|
|
1882
|
-
refinement(
|
|
1882
|
+
refinement(check2, refinementData) {
|
|
1883
1883
|
return this._refinement((val, ctx) => {
|
|
1884
|
-
if (!
|
|
1884
|
+
if (!check2(val)) {
|
|
1885
1885
|
ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData);
|
|
1886
1886
|
return false;
|
|
1887
1887
|
} else {
|
|
@@ -2101,70 +2101,70 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2101
2101
|
}
|
|
2102
2102
|
const status = new ParseStatus();
|
|
2103
2103
|
let ctx = void 0;
|
|
2104
|
-
for (const
|
|
2105
|
-
if (
|
|
2106
|
-
if (input.data.length <
|
|
2104
|
+
for (const check2 of this._def.checks) {
|
|
2105
|
+
if (check2.kind === "min") {
|
|
2106
|
+
if (input.data.length < check2.value) {
|
|
2107
2107
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2108
2108
|
addIssueToContext(ctx, {
|
|
2109
2109
|
code: ZodIssueCode.too_small,
|
|
2110
|
-
minimum:
|
|
2110
|
+
minimum: check2.value,
|
|
2111
2111
|
type: "string",
|
|
2112
2112
|
inclusive: true,
|
|
2113
2113
|
exact: false,
|
|
2114
|
-
message:
|
|
2114
|
+
message: check2.message
|
|
2115
2115
|
});
|
|
2116
2116
|
status.dirty();
|
|
2117
2117
|
}
|
|
2118
|
-
} else if (
|
|
2119
|
-
if (input.data.length >
|
|
2118
|
+
} else if (check2.kind === "max") {
|
|
2119
|
+
if (input.data.length > check2.value) {
|
|
2120
2120
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2121
2121
|
addIssueToContext(ctx, {
|
|
2122
2122
|
code: ZodIssueCode.too_big,
|
|
2123
|
-
maximum:
|
|
2123
|
+
maximum: check2.value,
|
|
2124
2124
|
type: "string",
|
|
2125
2125
|
inclusive: true,
|
|
2126
2126
|
exact: false,
|
|
2127
|
-
message:
|
|
2127
|
+
message: check2.message
|
|
2128
2128
|
});
|
|
2129
2129
|
status.dirty();
|
|
2130
2130
|
}
|
|
2131
|
-
} else if (
|
|
2132
|
-
const tooBig = input.data.length >
|
|
2133
|
-
const tooSmall = input.data.length <
|
|
2131
|
+
} else if (check2.kind === "length") {
|
|
2132
|
+
const tooBig = input.data.length > check2.value;
|
|
2133
|
+
const tooSmall = input.data.length < check2.value;
|
|
2134
2134
|
if (tooBig || tooSmall) {
|
|
2135
2135
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2136
2136
|
if (tooBig) {
|
|
2137
2137
|
addIssueToContext(ctx, {
|
|
2138
2138
|
code: ZodIssueCode.too_big,
|
|
2139
|
-
maximum:
|
|
2139
|
+
maximum: check2.value,
|
|
2140
2140
|
type: "string",
|
|
2141
2141
|
inclusive: true,
|
|
2142
2142
|
exact: true,
|
|
2143
|
-
message:
|
|
2143
|
+
message: check2.message
|
|
2144
2144
|
});
|
|
2145
2145
|
} else if (tooSmall) {
|
|
2146
2146
|
addIssueToContext(ctx, {
|
|
2147
2147
|
code: ZodIssueCode.too_small,
|
|
2148
|
-
minimum:
|
|
2148
|
+
minimum: check2.value,
|
|
2149
2149
|
type: "string",
|
|
2150
2150
|
inclusive: true,
|
|
2151
2151
|
exact: true,
|
|
2152
|
-
message:
|
|
2152
|
+
message: check2.message
|
|
2153
2153
|
});
|
|
2154
2154
|
}
|
|
2155
2155
|
status.dirty();
|
|
2156
2156
|
}
|
|
2157
|
-
} else if (
|
|
2157
|
+
} else if (check2.kind === "email") {
|
|
2158
2158
|
if (!emailRegex.test(input.data)) {
|
|
2159
2159
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2160
2160
|
addIssueToContext(ctx, {
|
|
2161
2161
|
validation: "email",
|
|
2162
2162
|
code: ZodIssueCode.invalid_string,
|
|
2163
|
-
message:
|
|
2163
|
+
message: check2.message
|
|
2164
2164
|
});
|
|
2165
2165
|
status.dirty();
|
|
2166
2166
|
}
|
|
2167
|
-
} else if (
|
|
2167
|
+
} else if (check2.kind === "emoji") {
|
|
2168
2168
|
if (!emojiRegex) {
|
|
2169
2169
|
emojiRegex = new RegExp(_emojiRegex, "u");
|
|
2170
2170
|
}
|
|
@@ -2173,61 +2173,61 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2173
2173
|
addIssueToContext(ctx, {
|
|
2174
2174
|
validation: "emoji",
|
|
2175
2175
|
code: ZodIssueCode.invalid_string,
|
|
2176
|
-
message:
|
|
2176
|
+
message: check2.message
|
|
2177
2177
|
});
|
|
2178
2178
|
status.dirty();
|
|
2179
2179
|
}
|
|
2180
|
-
} else if (
|
|
2180
|
+
} else if (check2.kind === "uuid") {
|
|
2181
2181
|
if (!uuidRegex.test(input.data)) {
|
|
2182
2182
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2183
2183
|
addIssueToContext(ctx, {
|
|
2184
2184
|
validation: "uuid",
|
|
2185
2185
|
code: ZodIssueCode.invalid_string,
|
|
2186
|
-
message:
|
|
2186
|
+
message: check2.message
|
|
2187
2187
|
});
|
|
2188
2188
|
status.dirty();
|
|
2189
2189
|
}
|
|
2190
|
-
} else if (
|
|
2190
|
+
} else if (check2.kind === "nanoid") {
|
|
2191
2191
|
if (!nanoidRegex.test(input.data)) {
|
|
2192
2192
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2193
2193
|
addIssueToContext(ctx, {
|
|
2194
2194
|
validation: "nanoid",
|
|
2195
2195
|
code: ZodIssueCode.invalid_string,
|
|
2196
|
-
message:
|
|
2196
|
+
message: check2.message
|
|
2197
2197
|
});
|
|
2198
2198
|
status.dirty();
|
|
2199
2199
|
}
|
|
2200
|
-
} else if (
|
|
2200
|
+
} else if (check2.kind === "cuid") {
|
|
2201
2201
|
if (!cuidRegex.test(input.data)) {
|
|
2202
2202
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2203
2203
|
addIssueToContext(ctx, {
|
|
2204
2204
|
validation: "cuid",
|
|
2205
2205
|
code: ZodIssueCode.invalid_string,
|
|
2206
|
-
message:
|
|
2206
|
+
message: check2.message
|
|
2207
2207
|
});
|
|
2208
2208
|
status.dirty();
|
|
2209
2209
|
}
|
|
2210
|
-
} else if (
|
|
2210
|
+
} else if (check2.kind === "cuid2") {
|
|
2211
2211
|
if (!cuid2Regex.test(input.data)) {
|
|
2212
2212
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2213
2213
|
addIssueToContext(ctx, {
|
|
2214
2214
|
validation: "cuid2",
|
|
2215
2215
|
code: ZodIssueCode.invalid_string,
|
|
2216
|
-
message:
|
|
2216
|
+
message: check2.message
|
|
2217
2217
|
});
|
|
2218
2218
|
status.dirty();
|
|
2219
2219
|
}
|
|
2220
|
-
} else if (
|
|
2220
|
+
} else if (check2.kind === "ulid") {
|
|
2221
2221
|
if (!ulidRegex.test(input.data)) {
|
|
2222
2222
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2223
2223
|
addIssueToContext(ctx, {
|
|
2224
2224
|
validation: "ulid",
|
|
2225
2225
|
code: ZodIssueCode.invalid_string,
|
|
2226
|
-
message:
|
|
2226
|
+
message: check2.message
|
|
2227
2227
|
});
|
|
2228
2228
|
status.dirty();
|
|
2229
2229
|
}
|
|
2230
|
-
} else if (
|
|
2230
|
+
} else if (check2.kind === "url") {
|
|
2231
2231
|
try {
|
|
2232
2232
|
new URL(input.data);
|
|
2233
2233
|
} catch {
|
|
@@ -2235,153 +2235,153 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2235
2235
|
addIssueToContext(ctx, {
|
|
2236
2236
|
validation: "url",
|
|
2237
2237
|
code: ZodIssueCode.invalid_string,
|
|
2238
|
-
message:
|
|
2238
|
+
message: check2.message
|
|
2239
2239
|
});
|
|
2240
2240
|
status.dirty();
|
|
2241
2241
|
}
|
|
2242
|
-
} else if (
|
|
2243
|
-
|
|
2244
|
-
const testResult =
|
|
2242
|
+
} else if (check2.kind === "regex") {
|
|
2243
|
+
check2.regex.lastIndex = 0;
|
|
2244
|
+
const testResult = check2.regex.test(input.data);
|
|
2245
2245
|
if (!testResult) {
|
|
2246
2246
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2247
2247
|
addIssueToContext(ctx, {
|
|
2248
2248
|
validation: "regex",
|
|
2249
2249
|
code: ZodIssueCode.invalid_string,
|
|
2250
|
-
message:
|
|
2250
|
+
message: check2.message
|
|
2251
2251
|
});
|
|
2252
2252
|
status.dirty();
|
|
2253
2253
|
}
|
|
2254
|
-
} else if (
|
|
2254
|
+
} else if (check2.kind === "trim") {
|
|
2255
2255
|
input.data = input.data.trim();
|
|
2256
|
-
} else if (
|
|
2257
|
-
if (!input.data.includes(
|
|
2256
|
+
} else if (check2.kind === "includes") {
|
|
2257
|
+
if (!input.data.includes(check2.value, check2.position)) {
|
|
2258
2258
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2259
2259
|
addIssueToContext(ctx, {
|
|
2260
2260
|
code: ZodIssueCode.invalid_string,
|
|
2261
|
-
validation: { includes:
|
|
2262
|
-
message:
|
|
2261
|
+
validation: { includes: check2.value, position: check2.position },
|
|
2262
|
+
message: check2.message
|
|
2263
2263
|
});
|
|
2264
2264
|
status.dirty();
|
|
2265
2265
|
}
|
|
2266
|
-
} else if (
|
|
2266
|
+
} else if (check2.kind === "toLowerCase") {
|
|
2267
2267
|
input.data = input.data.toLowerCase();
|
|
2268
|
-
} else if (
|
|
2268
|
+
} else if (check2.kind === "toUpperCase") {
|
|
2269
2269
|
input.data = input.data.toUpperCase();
|
|
2270
|
-
} else if (
|
|
2271
|
-
if (!input.data.startsWith(
|
|
2270
|
+
} else if (check2.kind === "startsWith") {
|
|
2271
|
+
if (!input.data.startsWith(check2.value)) {
|
|
2272
2272
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2273
2273
|
addIssueToContext(ctx, {
|
|
2274
2274
|
code: ZodIssueCode.invalid_string,
|
|
2275
|
-
validation: { startsWith:
|
|
2276
|
-
message:
|
|
2275
|
+
validation: { startsWith: check2.value },
|
|
2276
|
+
message: check2.message
|
|
2277
2277
|
});
|
|
2278
2278
|
status.dirty();
|
|
2279
2279
|
}
|
|
2280
|
-
} else if (
|
|
2281
|
-
if (!input.data.endsWith(
|
|
2280
|
+
} else if (check2.kind === "endsWith") {
|
|
2281
|
+
if (!input.data.endsWith(check2.value)) {
|
|
2282
2282
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2283
2283
|
addIssueToContext(ctx, {
|
|
2284
2284
|
code: ZodIssueCode.invalid_string,
|
|
2285
|
-
validation: { endsWith:
|
|
2286
|
-
message:
|
|
2285
|
+
validation: { endsWith: check2.value },
|
|
2286
|
+
message: check2.message
|
|
2287
2287
|
});
|
|
2288
2288
|
status.dirty();
|
|
2289
2289
|
}
|
|
2290
|
-
} else if (
|
|
2291
|
-
const regex = datetimeRegex(
|
|
2290
|
+
} else if (check2.kind === "datetime") {
|
|
2291
|
+
const regex = datetimeRegex(check2);
|
|
2292
2292
|
if (!regex.test(input.data)) {
|
|
2293
2293
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2294
2294
|
addIssueToContext(ctx, {
|
|
2295
2295
|
code: ZodIssueCode.invalid_string,
|
|
2296
2296
|
validation: "datetime",
|
|
2297
|
-
message:
|
|
2297
|
+
message: check2.message
|
|
2298
2298
|
});
|
|
2299
2299
|
status.dirty();
|
|
2300
2300
|
}
|
|
2301
|
-
} else if (
|
|
2301
|
+
} else if (check2.kind === "date") {
|
|
2302
2302
|
const regex = dateRegex;
|
|
2303
2303
|
if (!regex.test(input.data)) {
|
|
2304
2304
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2305
2305
|
addIssueToContext(ctx, {
|
|
2306
2306
|
code: ZodIssueCode.invalid_string,
|
|
2307
2307
|
validation: "date",
|
|
2308
|
-
message:
|
|
2308
|
+
message: check2.message
|
|
2309
2309
|
});
|
|
2310
2310
|
status.dirty();
|
|
2311
2311
|
}
|
|
2312
|
-
} else if (
|
|
2313
|
-
const regex = timeRegex(
|
|
2312
|
+
} else if (check2.kind === "time") {
|
|
2313
|
+
const regex = timeRegex(check2);
|
|
2314
2314
|
if (!regex.test(input.data)) {
|
|
2315
2315
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2316
2316
|
addIssueToContext(ctx, {
|
|
2317
2317
|
code: ZodIssueCode.invalid_string,
|
|
2318
2318
|
validation: "time",
|
|
2319
|
-
message:
|
|
2319
|
+
message: check2.message
|
|
2320
2320
|
});
|
|
2321
2321
|
status.dirty();
|
|
2322
2322
|
}
|
|
2323
|
-
} else if (
|
|
2323
|
+
} else if (check2.kind === "duration") {
|
|
2324
2324
|
if (!durationRegex.test(input.data)) {
|
|
2325
2325
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2326
2326
|
addIssueToContext(ctx, {
|
|
2327
2327
|
validation: "duration",
|
|
2328
2328
|
code: ZodIssueCode.invalid_string,
|
|
2329
|
-
message:
|
|
2329
|
+
message: check2.message
|
|
2330
2330
|
});
|
|
2331
2331
|
status.dirty();
|
|
2332
2332
|
}
|
|
2333
|
-
} else if (
|
|
2334
|
-
if (!isValidIP(input.data,
|
|
2333
|
+
} else if (check2.kind === "ip") {
|
|
2334
|
+
if (!isValidIP(input.data, check2.version)) {
|
|
2335
2335
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2336
2336
|
addIssueToContext(ctx, {
|
|
2337
2337
|
validation: "ip",
|
|
2338
2338
|
code: ZodIssueCode.invalid_string,
|
|
2339
|
-
message:
|
|
2339
|
+
message: check2.message
|
|
2340
2340
|
});
|
|
2341
2341
|
status.dirty();
|
|
2342
2342
|
}
|
|
2343
|
-
} else if (
|
|
2344
|
-
if (!isValidJWT(input.data,
|
|
2343
|
+
} else if (check2.kind === "jwt") {
|
|
2344
|
+
if (!isValidJWT(input.data, check2.alg)) {
|
|
2345
2345
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2346
2346
|
addIssueToContext(ctx, {
|
|
2347
2347
|
validation: "jwt",
|
|
2348
2348
|
code: ZodIssueCode.invalid_string,
|
|
2349
|
-
message:
|
|
2349
|
+
message: check2.message
|
|
2350
2350
|
});
|
|
2351
2351
|
status.dirty();
|
|
2352
2352
|
}
|
|
2353
|
-
} else if (
|
|
2354
|
-
if (!isValidCidr(input.data,
|
|
2353
|
+
} else if (check2.kind === "cidr") {
|
|
2354
|
+
if (!isValidCidr(input.data, check2.version)) {
|
|
2355
2355
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2356
2356
|
addIssueToContext(ctx, {
|
|
2357
2357
|
validation: "cidr",
|
|
2358
2358
|
code: ZodIssueCode.invalid_string,
|
|
2359
|
-
message:
|
|
2359
|
+
message: check2.message
|
|
2360
2360
|
});
|
|
2361
2361
|
status.dirty();
|
|
2362
2362
|
}
|
|
2363
|
-
} else if (
|
|
2363
|
+
} else if (check2.kind === "base64") {
|
|
2364
2364
|
if (!base64Regex.test(input.data)) {
|
|
2365
2365
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2366
2366
|
addIssueToContext(ctx, {
|
|
2367
2367
|
validation: "base64",
|
|
2368
2368
|
code: ZodIssueCode.invalid_string,
|
|
2369
|
-
message:
|
|
2369
|
+
message: check2.message
|
|
2370
2370
|
});
|
|
2371
2371
|
status.dirty();
|
|
2372
2372
|
}
|
|
2373
|
-
} else if (
|
|
2373
|
+
} else if (check2.kind === "base64url") {
|
|
2374
2374
|
if (!base64urlRegex.test(input.data)) {
|
|
2375
2375
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2376
2376
|
addIssueToContext(ctx, {
|
|
2377
2377
|
validation: "base64url",
|
|
2378
2378
|
code: ZodIssueCode.invalid_string,
|
|
2379
|
-
message:
|
|
2379
|
+
message: check2.message
|
|
2380
2380
|
});
|
|
2381
2381
|
status.dirty();
|
|
2382
2382
|
}
|
|
2383
2383
|
} else {
|
|
2384
|
-
util.assertNever(
|
|
2384
|
+
util.assertNever(check2);
|
|
2385
2385
|
}
|
|
2386
2386
|
}
|
|
2387
2387
|
return { status: status.value, value: input.data };
|
|
@@ -2393,10 +2393,10 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2393
2393
|
...errorUtil.errToObj(message)
|
|
2394
2394
|
});
|
|
2395
2395
|
}
|
|
2396
|
-
_addCheck(
|
|
2396
|
+
_addCheck(check2) {
|
|
2397
2397
|
return new _ZodString({
|
|
2398
2398
|
...this._def,
|
|
2399
|
-
checks: [...this._def.checks,
|
|
2399
|
+
checks: [...this._def.checks, check2]
|
|
2400
2400
|
});
|
|
2401
2401
|
}
|
|
2402
2402
|
email(message) {
|
|
@@ -2661,67 +2661,67 @@ var ZodNumber = class _ZodNumber extends ZodType {
|
|
|
2661
2661
|
}
|
|
2662
2662
|
let ctx = void 0;
|
|
2663
2663
|
const status = new ParseStatus();
|
|
2664
|
-
for (const
|
|
2665
|
-
if (
|
|
2664
|
+
for (const check2 of this._def.checks) {
|
|
2665
|
+
if (check2.kind === "int") {
|
|
2666
2666
|
if (!util.isInteger(input.data)) {
|
|
2667
2667
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2668
2668
|
addIssueToContext(ctx, {
|
|
2669
2669
|
code: ZodIssueCode.invalid_type,
|
|
2670
2670
|
expected: "integer",
|
|
2671
2671
|
received: "float",
|
|
2672
|
-
message:
|
|
2672
|
+
message: check2.message
|
|
2673
2673
|
});
|
|
2674
2674
|
status.dirty();
|
|
2675
2675
|
}
|
|
2676
|
-
} else if (
|
|
2677
|
-
const tooSmall =
|
|
2676
|
+
} else if (check2.kind === "min") {
|
|
2677
|
+
const tooSmall = check2.inclusive ? input.data < check2.value : input.data <= check2.value;
|
|
2678
2678
|
if (tooSmall) {
|
|
2679
2679
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2680
2680
|
addIssueToContext(ctx, {
|
|
2681
2681
|
code: ZodIssueCode.too_small,
|
|
2682
|
-
minimum:
|
|
2682
|
+
minimum: check2.value,
|
|
2683
2683
|
type: "number",
|
|
2684
|
-
inclusive:
|
|
2684
|
+
inclusive: check2.inclusive,
|
|
2685
2685
|
exact: false,
|
|
2686
|
-
message:
|
|
2686
|
+
message: check2.message
|
|
2687
2687
|
});
|
|
2688
2688
|
status.dirty();
|
|
2689
2689
|
}
|
|
2690
|
-
} else if (
|
|
2691
|
-
const tooBig =
|
|
2690
|
+
} else if (check2.kind === "max") {
|
|
2691
|
+
const tooBig = check2.inclusive ? input.data > check2.value : input.data >= check2.value;
|
|
2692
2692
|
if (tooBig) {
|
|
2693
2693
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2694
2694
|
addIssueToContext(ctx, {
|
|
2695
2695
|
code: ZodIssueCode.too_big,
|
|
2696
|
-
maximum:
|
|
2696
|
+
maximum: check2.value,
|
|
2697
2697
|
type: "number",
|
|
2698
|
-
inclusive:
|
|
2698
|
+
inclusive: check2.inclusive,
|
|
2699
2699
|
exact: false,
|
|
2700
|
-
message:
|
|
2700
|
+
message: check2.message
|
|
2701
2701
|
});
|
|
2702
2702
|
status.dirty();
|
|
2703
2703
|
}
|
|
2704
|
-
} else if (
|
|
2705
|
-
if (floatSafeRemainder(input.data,
|
|
2704
|
+
} else if (check2.kind === "multipleOf") {
|
|
2705
|
+
if (floatSafeRemainder(input.data, check2.value) !== 0) {
|
|
2706
2706
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2707
2707
|
addIssueToContext(ctx, {
|
|
2708
2708
|
code: ZodIssueCode.not_multiple_of,
|
|
2709
|
-
multipleOf:
|
|
2710
|
-
message:
|
|
2709
|
+
multipleOf: check2.value,
|
|
2710
|
+
message: check2.message
|
|
2711
2711
|
});
|
|
2712
2712
|
status.dirty();
|
|
2713
2713
|
}
|
|
2714
|
-
} else if (
|
|
2714
|
+
} else if (check2.kind === "finite") {
|
|
2715
2715
|
if (!Number.isFinite(input.data)) {
|
|
2716
2716
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2717
2717
|
addIssueToContext(ctx, {
|
|
2718
2718
|
code: ZodIssueCode.not_finite,
|
|
2719
|
-
message:
|
|
2719
|
+
message: check2.message
|
|
2720
2720
|
});
|
|
2721
2721
|
status.dirty();
|
|
2722
2722
|
}
|
|
2723
2723
|
} else {
|
|
2724
|
-
util.assertNever(
|
|
2724
|
+
util.assertNever(check2);
|
|
2725
2725
|
}
|
|
2726
2726
|
}
|
|
2727
2727
|
return { status: status.value, value: input.data };
|
|
@@ -2752,10 +2752,10 @@ var ZodNumber = class _ZodNumber extends ZodType {
|
|
|
2752
2752
|
]
|
|
2753
2753
|
});
|
|
2754
2754
|
}
|
|
2755
|
-
_addCheck(
|
|
2755
|
+
_addCheck(check2) {
|
|
2756
2756
|
return new _ZodNumber({
|
|
2757
2757
|
...this._def,
|
|
2758
|
-
checks: [...this._def.checks,
|
|
2758
|
+
checks: [...this._def.checks, check2]
|
|
2759
2759
|
});
|
|
2760
2760
|
}
|
|
2761
2761
|
int(message) {
|
|
@@ -2890,45 +2890,45 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
2890
2890
|
}
|
|
2891
2891
|
let ctx = void 0;
|
|
2892
2892
|
const status = new ParseStatus();
|
|
2893
|
-
for (const
|
|
2894
|
-
if (
|
|
2895
|
-
const tooSmall =
|
|
2893
|
+
for (const check2 of this._def.checks) {
|
|
2894
|
+
if (check2.kind === "min") {
|
|
2895
|
+
const tooSmall = check2.inclusive ? input.data < check2.value : input.data <= check2.value;
|
|
2896
2896
|
if (tooSmall) {
|
|
2897
2897
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2898
2898
|
addIssueToContext(ctx, {
|
|
2899
2899
|
code: ZodIssueCode.too_small,
|
|
2900
2900
|
type: "bigint",
|
|
2901
|
-
minimum:
|
|
2902
|
-
inclusive:
|
|
2903
|
-
message:
|
|
2901
|
+
minimum: check2.value,
|
|
2902
|
+
inclusive: check2.inclusive,
|
|
2903
|
+
message: check2.message
|
|
2904
2904
|
});
|
|
2905
2905
|
status.dirty();
|
|
2906
2906
|
}
|
|
2907
|
-
} else if (
|
|
2908
|
-
const tooBig =
|
|
2907
|
+
} else if (check2.kind === "max") {
|
|
2908
|
+
const tooBig = check2.inclusive ? input.data > check2.value : input.data >= check2.value;
|
|
2909
2909
|
if (tooBig) {
|
|
2910
2910
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2911
2911
|
addIssueToContext(ctx, {
|
|
2912
2912
|
code: ZodIssueCode.too_big,
|
|
2913
2913
|
type: "bigint",
|
|
2914
|
-
maximum:
|
|
2915
|
-
inclusive:
|
|
2916
|
-
message:
|
|
2914
|
+
maximum: check2.value,
|
|
2915
|
+
inclusive: check2.inclusive,
|
|
2916
|
+
message: check2.message
|
|
2917
2917
|
});
|
|
2918
2918
|
status.dirty();
|
|
2919
2919
|
}
|
|
2920
|
-
} else if (
|
|
2921
|
-
if (input.data %
|
|
2920
|
+
} else if (check2.kind === "multipleOf") {
|
|
2921
|
+
if (input.data % check2.value !== BigInt(0)) {
|
|
2922
2922
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2923
2923
|
addIssueToContext(ctx, {
|
|
2924
2924
|
code: ZodIssueCode.not_multiple_of,
|
|
2925
|
-
multipleOf:
|
|
2926
|
-
message:
|
|
2925
|
+
multipleOf: check2.value,
|
|
2926
|
+
message: check2.message
|
|
2927
2927
|
});
|
|
2928
2928
|
status.dirty();
|
|
2929
2929
|
}
|
|
2930
2930
|
} else {
|
|
2931
|
-
util.assertNever(
|
|
2931
|
+
util.assertNever(check2);
|
|
2932
2932
|
}
|
|
2933
2933
|
}
|
|
2934
2934
|
return { status: status.value, value: input.data };
|
|
@@ -2968,10 +2968,10 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
2968
2968
|
]
|
|
2969
2969
|
});
|
|
2970
2970
|
}
|
|
2971
|
-
_addCheck(
|
|
2971
|
+
_addCheck(check2) {
|
|
2972
2972
|
return new _ZodBigInt({
|
|
2973
2973
|
...this._def,
|
|
2974
|
-
checks: [...this._def.checks,
|
|
2974
|
+
checks: [...this._def.checks, check2]
|
|
2975
2975
|
});
|
|
2976
2976
|
}
|
|
2977
2977
|
positive(message) {
|
|
@@ -3091,35 +3091,35 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
3091
3091
|
}
|
|
3092
3092
|
const status = new ParseStatus();
|
|
3093
3093
|
let ctx = void 0;
|
|
3094
|
-
for (const
|
|
3095
|
-
if (
|
|
3096
|
-
if (input.data.getTime() <
|
|
3094
|
+
for (const check2 of this._def.checks) {
|
|
3095
|
+
if (check2.kind === "min") {
|
|
3096
|
+
if (input.data.getTime() < check2.value) {
|
|
3097
3097
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
3098
3098
|
addIssueToContext(ctx, {
|
|
3099
3099
|
code: ZodIssueCode.too_small,
|
|
3100
|
-
message:
|
|
3100
|
+
message: check2.message,
|
|
3101
3101
|
inclusive: true,
|
|
3102
3102
|
exact: false,
|
|
3103
|
-
minimum:
|
|
3103
|
+
minimum: check2.value,
|
|
3104
3104
|
type: "date"
|
|
3105
3105
|
});
|
|
3106
3106
|
status.dirty();
|
|
3107
3107
|
}
|
|
3108
|
-
} else if (
|
|
3109
|
-
if (input.data.getTime() >
|
|
3108
|
+
} else if (check2.kind === "max") {
|
|
3109
|
+
if (input.data.getTime() > check2.value) {
|
|
3110
3110
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
3111
3111
|
addIssueToContext(ctx, {
|
|
3112
3112
|
code: ZodIssueCode.too_big,
|
|
3113
|
-
message:
|
|
3113
|
+
message: check2.message,
|
|
3114
3114
|
inclusive: true,
|
|
3115
3115
|
exact: false,
|
|
3116
|
-
maximum:
|
|
3116
|
+
maximum: check2.value,
|
|
3117
3117
|
type: "date"
|
|
3118
3118
|
});
|
|
3119
3119
|
status.dirty();
|
|
3120
3120
|
}
|
|
3121
3121
|
} else {
|
|
3122
|
-
util.assertNever(
|
|
3122
|
+
util.assertNever(check2);
|
|
3123
3123
|
}
|
|
3124
3124
|
}
|
|
3125
3125
|
return {
|
|
@@ -3127,10 +3127,10 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
3127
3127
|
value: new Date(input.data.getTime())
|
|
3128
3128
|
};
|
|
3129
3129
|
}
|
|
3130
|
-
_addCheck(
|
|
3130
|
+
_addCheck(check2) {
|
|
3131
3131
|
return new _ZodDate({
|
|
3132
3132
|
...this._def,
|
|
3133
|
-
checks: [...this._def.checks,
|
|
3133
|
+
checks: [...this._def.checks, check2]
|
|
3134
3134
|
});
|
|
3135
3135
|
}
|
|
3136
3136
|
min(minDate, message) {
|
|
@@ -4990,10 +4990,10 @@ function cleanParams(params, data) {
|
|
|
4990
4990
|
const p2 = typeof p === "string" ? { message: p } : p;
|
|
4991
4991
|
return p2;
|
|
4992
4992
|
}
|
|
4993
|
-
function custom(
|
|
4994
|
-
if (
|
|
4993
|
+
function custom(check2, _params = {}, fatal) {
|
|
4994
|
+
if (check2)
|
|
4995
4995
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
4996
|
-
const r =
|
|
4996
|
+
const r = check2(data);
|
|
4997
4997
|
if (r instanceof Promise) {
|
|
4998
4998
|
return r.then((r2) => {
|
|
4999
4999
|
if (!r2) {
|
|
@@ -5184,6 +5184,11 @@ var contentSnapshotKind = pgEnum("content_snapshot_kind", [
|
|
|
5184
5184
|
"corpus",
|
|
5185
5185
|
"source"
|
|
5186
5186
|
]);
|
|
5187
|
+
var contentCandidateStatus = pgEnum("content_candidate_status", [
|
|
5188
|
+
"candidate",
|
|
5189
|
+
"used",
|
|
5190
|
+
"rejected"
|
|
5191
|
+
]);
|
|
5187
5192
|
var contentSources = pgTable(
|
|
5188
5193
|
"content_sources",
|
|
5189
5194
|
{
|
|
@@ -5239,6 +5244,12 @@ var contentEvidencePacks = pgTable(
|
|
|
5239
5244
|
openQuestions: jsonb("open_questions").$type().notNull().default([]),
|
|
5240
5245
|
verbatimWarnings: jsonb("verbatim_warnings").$type().notNull().default([]),
|
|
5241
5246
|
limitations: jsonb("limitations").$type().notNull().default([]),
|
|
5247
|
+
/**
|
|
5248
|
+
* Order-independent signature of topic + canonical URL set (packSignature).
|
|
5249
|
+
* Lets the reuse-first save path return a fresh stored pack without
|
|
5250
|
+
* re-researching when the same urls/topic are shared again.
|
|
5251
|
+
*/
|
|
5252
|
+
sourceSignature: text("source_signature"),
|
|
5242
5253
|
metadata: jsonb("metadata").$type().notNull().default({}),
|
|
5243
5254
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
5244
5255
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
@@ -5246,7 +5257,8 @@ var contentEvidencePacks = pgTable(
|
|
|
5246
5257
|
(table) => [
|
|
5247
5258
|
index("content_evidence_packs_project_idx").on(table.projectKey),
|
|
5248
5259
|
index("content_evidence_packs_ticket_idx").on(table.ticketNumber),
|
|
5249
|
-
index("content_evidence_packs_generated_idx").on(table.generatedAt.desc())
|
|
5260
|
+
index("content_evidence_packs_generated_idx").on(table.generatedAt.desc()),
|
|
5261
|
+
index("content_evidence_packs_signature_idx").on(table.sourceSignature)
|
|
5250
5262
|
]
|
|
5251
5263
|
);
|
|
5252
5264
|
pgTable(
|
|
@@ -5395,6 +5407,57 @@ pgTable(
|
|
|
5395
5407
|
)
|
|
5396
5408
|
]
|
|
5397
5409
|
);
|
|
5410
|
+
pgTable(
|
|
5411
|
+
"content_site_candidates",
|
|
5412
|
+
{
|
|
5413
|
+
id: uuid("id").primaryKey().defaultRandom(),
|
|
5414
|
+
contentSourceId: uuid("content_source_id").references(
|
|
5415
|
+
() => contentSources.id,
|
|
5416
|
+
{ onDelete: "cascade" }
|
|
5417
|
+
),
|
|
5418
|
+
packId: uuid("pack_id").references(() => contentEvidencePacks.id, {
|
|
5419
|
+
onDelete: "cascade"
|
|
5420
|
+
}),
|
|
5421
|
+
/** Managed site (2026-DASMG-042) when known; soft pointer, no FK to avoid a schema cycle. */
|
|
5422
|
+
managedSiteId: uuid("managed_site_id"),
|
|
5423
|
+
projectKey: text("project_key"),
|
|
5424
|
+
siteKey: text("site_key"),
|
|
5425
|
+
domain: text("domain"),
|
|
5426
|
+
status: contentCandidateStatus("status").notNull().default("candidate"),
|
|
5427
|
+
reason: text("reason"),
|
|
5428
|
+
score: integer("score"),
|
|
5429
|
+
/** The corpus page produced from this content, set when status becomes used. */
|
|
5430
|
+
usedCorpusItemId: uuid("used_corpus_item_id").references(
|
|
5431
|
+
() => contentCorpusItems.id,
|
|
5432
|
+
{ onDelete: "set null" }
|
|
5433
|
+
),
|
|
5434
|
+
usedUrl: text("used_url"),
|
|
5435
|
+
usedAt: timestamp("used_at", { withTimezone: true }),
|
|
5436
|
+
ticketNumber: text("ticket_number"),
|
|
5437
|
+
metadata: jsonb("metadata").$type().notNull().default({}),
|
|
5438
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
5439
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
5440
|
+
},
|
|
5441
|
+
(table) => [
|
|
5442
|
+
index("content_site_candidates_source_idx").on(table.contentSourceId),
|
|
5443
|
+
index("content_site_candidates_pack_idx").on(table.packId),
|
|
5444
|
+
index("content_site_candidates_managed_site_idx").on(table.managedSiteId),
|
|
5445
|
+
index("content_site_candidates_project_idx").on(table.projectKey),
|
|
5446
|
+
index("content_site_candidates_status_idx").on(table.status),
|
|
5447
|
+
uniqueIndex("content_site_candidates_source_site_uidx").on(table.contentSourceId, table.managedSiteId).where(
|
|
5448
|
+
sql`content_source_id IS NOT NULL AND managed_site_id IS NOT NULL`
|
|
5449
|
+
),
|
|
5450
|
+
uniqueIndex("content_site_candidates_pack_site_uidx").on(table.packId, table.managedSiteId).where(sql`pack_id IS NOT NULL AND managed_site_id IS NOT NULL`),
|
|
5451
|
+
check(
|
|
5452
|
+
"content_site_candidates_subject_chk",
|
|
5453
|
+
sql`content_source_id IS NOT NULL OR pack_id IS NOT NULL`
|
|
5454
|
+
),
|
|
5455
|
+
check(
|
|
5456
|
+
"content_site_candidates_target_chk",
|
|
5457
|
+
sql`managed_site_id IS NOT NULL OR project_key IS NOT NULL OR domain IS NOT NULL`
|
|
5458
|
+
)
|
|
5459
|
+
]
|
|
5460
|
+
);
|
|
5398
5461
|
var managedServerOs = pgEnum("managed_server_os", [
|
|
5399
5462
|
"linux",
|
|
5400
5463
|
"windows",
|
|
@@ -8548,6 +8611,9 @@ var RAW_JSON_TOOLS = /* @__PURE__ */ new Set([
|
|
|
8548
8611
|
"list_content_snapshots",
|
|
8549
8612
|
"link_content_pack_to_ticket",
|
|
8550
8613
|
"prune_content_snapshots",
|
|
8614
|
+
"add_site_candidates",
|
|
8615
|
+
"list_site_candidates",
|
|
8616
|
+
"set_candidate_status",
|
|
8551
8617
|
// Managed site content sync (2026-DASMG-042) — compact JSON consumed verbatim.
|
|
8552
8618
|
"register_managed_site",
|
|
8553
8619
|
"update_managed_site",
|
|
@@ -9496,11 +9562,11 @@ CREATE TABLE IF NOT EXISTS _mcp_migrations (
|
|
|
9496
9562
|
applied_by TEXT
|
|
9497
9563
|
);
|
|
9498
9564
|
`.trim();
|
|
9499
|
-
function normaliseMigrationSql(
|
|
9500
|
-
return
|
|
9565
|
+
function normaliseMigrationSql(sql26) {
|
|
9566
|
+
return sql26.replace(/\r\n/g, "\n").trim() + "\n";
|
|
9501
9567
|
}
|
|
9502
|
-
function migrationSha256(
|
|
9503
|
-
return createHash("sha256").update(
|
|
9568
|
+
function migrationSha256(sql26) {
|
|
9569
|
+
return createHash("sha256").update(sql26.replace(/\r\n/g, "\n"), "utf8").digest("hex");
|
|
9504
9570
|
}
|
|
9505
9571
|
function dollarQuoteTag(value) {
|
|
9506
9572
|
let tag = "_mcp";
|
|
@@ -11073,6 +11139,78 @@ var TOOLS = [
|
|
|
11073
11139
|
}
|
|
11074
11140
|
}
|
|
11075
11141
|
},
|
|
11142
|
+
{
|
|
11143
|
+
name: "add_site_candidates",
|
|
11144
|
+
description: "Record which site(s) a stored source or research pack could be interesting for, for reuse later (2026-DASMG-041). Attach one or more candidates to a contentSourceId and/or packId; each candidate targets a managedSiteId (preferred) or a projectKey/domain. Re-adding the same (subject, target) updates instead of duplicating.",
|
|
11145
|
+
inputSchema: {
|
|
11146
|
+
type: "object",
|
|
11147
|
+
properties: {
|
|
11148
|
+
contentSourceId: { type: "string", description: "content_sources.id (the source to suggest)." },
|
|
11149
|
+
packId: { type: "string", description: "content_evidence_packs.id (the pack to suggest)." },
|
|
11150
|
+
candidates: {
|
|
11151
|
+
type: "array",
|
|
11152
|
+
description: "Target sites. Each needs a managedSiteId, projectKey or domain.",
|
|
11153
|
+
items: {
|
|
11154
|
+
type: "object",
|
|
11155
|
+
properties: {
|
|
11156
|
+
managedSiteId: { type: "string", description: "managed_sites.id (preferred when managed)." },
|
|
11157
|
+
projectKey: { type: "string", description: "Project identifier (fallback)." },
|
|
11158
|
+
siteKey: { type: "string", description: "Site identifier within the project." },
|
|
11159
|
+
domain: { type: "string", description: "Site domain, e.g. klant.nl (fallback)." },
|
|
11160
|
+
reason: { type: "string", description: "Why this content fits the site." },
|
|
11161
|
+
score: { type: "integer", description: "Optional relevance score 0-100." }
|
|
11162
|
+
}
|
|
11163
|
+
}
|
|
11164
|
+
},
|
|
11165
|
+
ticketNumber: { type: "string", description: "Related ticket number." },
|
|
11166
|
+
metadata: { type: "object" }
|
|
11167
|
+
},
|
|
11168
|
+
required: ["candidates"]
|
|
11169
|
+
}
|
|
11170
|
+
},
|
|
11171
|
+
{
|
|
11172
|
+
name: "list_site_candidates",
|
|
11173
|
+
description: "List content/site candidates (2026-DASMG-041): filter by managedSiteId / projectKey / domain, contentSourceId, packId, status. Use status=candidate to find unused content suggested for a site. Compact; paginated; includes the source title / pack topic for context.",
|
|
11174
|
+
inputSchema: {
|
|
11175
|
+
type: "object",
|
|
11176
|
+
properties: {
|
|
11177
|
+
managedSiteId: { type: "string", description: "managed_sites.id filter." },
|
|
11178
|
+
projectKey: { type: "string", description: "Project filter." },
|
|
11179
|
+
domain: { type: "string", description: "Domain filter." },
|
|
11180
|
+
contentSourceId: { type: "string", description: "content_sources.id filter." },
|
|
11181
|
+
packId: { type: "string", description: "content_evidence_packs.id filter." },
|
|
11182
|
+
status: {
|
|
11183
|
+
type: "string",
|
|
11184
|
+
enum: ["candidate", "used", "rejected"],
|
|
11185
|
+
description: "candidate = suggested, used = published there, rejected = not a fit."
|
|
11186
|
+
},
|
|
11187
|
+
limit: { type: "integer", description: "Max rows (default 20, max 100)." },
|
|
11188
|
+
offset: { type: "integer", description: "Pagination offset." }
|
|
11189
|
+
}
|
|
11190
|
+
}
|
|
11191
|
+
},
|
|
11192
|
+
{
|
|
11193
|
+
name: "set_candidate_status",
|
|
11194
|
+
description: "Update a candidate's status (2026-DASMG-041). Set status=used to mark the content as used on the site (stamps usedAt and records usedCorpusItemId / usedUrl), or rejected when it is not a fit.",
|
|
11195
|
+
inputSchema: {
|
|
11196
|
+
type: "object",
|
|
11197
|
+
properties: {
|
|
11198
|
+
id: { type: "string", description: "content_site_candidates.id (uuid)." },
|
|
11199
|
+
status: {
|
|
11200
|
+
type: "string",
|
|
11201
|
+
enum: ["candidate", "used", "rejected"],
|
|
11202
|
+
description: "New status for the candidate."
|
|
11203
|
+
},
|
|
11204
|
+
usedCorpusItemId: {
|
|
11205
|
+
type: "string",
|
|
11206
|
+
description: "content_corpus_items.id of the page produced (when used)."
|
|
11207
|
+
},
|
|
11208
|
+
usedUrl: { type: "string", description: "URL of the page produced (when used)." },
|
|
11209
|
+
reason: { type: "string", description: "Optional note for the status change." }
|
|
11210
|
+
},
|
|
11211
|
+
required: ["id", "status"]
|
|
11212
|
+
}
|
|
11213
|
+
},
|
|
11076
11214
|
{
|
|
11077
11215
|
name: "register_managed_site",
|
|
11078
11216
|
description: "Register (or upsert by projectKey+domain) a site for content sync (2026-DASMG-042): domain, optional repo/branch + sitemapUrl, syncMode and a git pathUrlMap. Optional + additive \u2014 external/unmanaged sites still work via extract_article without this. Enables git-push/cron/manual ingestion that re-indexes only CHANGED pages into the corpus (hash-skips unchanged ones).",
|
|
@@ -11537,7 +11675,10 @@ async function executeToolCall(name, a, _serverId) {
|
|
|
11537
11675
|
case "save_content_quality_run":
|
|
11538
11676
|
case "list_content_snapshots":
|
|
11539
11677
|
case "link_content_pack_to_ticket":
|
|
11540
|
-
case "prune_content_snapshots":
|
|
11678
|
+
case "prune_content_snapshots":
|
|
11679
|
+
case "add_site_candidates":
|
|
11680
|
+
case "list_site_candidates":
|
|
11681
|
+
case "set_candidate_status": {
|
|
11541
11682
|
const res = await fetch(`${dashboardBaseUrl}/api/tools/content-registry`, {
|
|
11542
11683
|
method: "POST",
|
|
11543
11684
|
headers: {
|