@agentskit/doc-bridge 1.0.2 → 1.2.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/CHANGELOG.md +50 -0
- package/CONTRIBUTING.md +8 -0
- package/README.md +114 -17
- package/SECURITY.md +1 -1
- package/action.yml +23 -26
- package/dist/cli/program.js +1241 -309
- package/dist/cli/program.js.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +338 -13
- package/dist/config/index.js.map +1 -1
- package/dist/{index-CPUJbTbg.d.ts → index-DGI9TBLE.d.ts} +906 -11
- package/dist/index.d.ts +65 -11
- package/dist/index.js +1084 -171
- package/dist/index.js.map +1 -1
- package/docs/DOGFOOD-ROUND2.md +5 -0
- package/docs/DOGFOOD-ROUND3.md +5 -0
- package/docs/DOGFOOD-V1.md +5 -0
- package/docs/DOGFOOD.md +5 -0
- package/docs/MARKETPLACE-ECOSYSTEM-PLAN.md +16 -0
- package/docs/MARKETPLACE.md +39 -0
- package/docs/POSITIONING.md +5 -0
- package/docs/RELEASE.md +26 -19
- package/docs/agent-corpus/INDEX.md +10 -0
- package/docs/agent-corpus/OVERVIEW.md +9 -0
- package/docs/agent-corpus/chat.md +10 -0
- package/docs/agent-corpus/cli.md +10 -0
- package/docs/agent-corpus/conformance.md +10 -0
- package/docs/agent-corpus/doc-bridge.md +10 -0
- package/docs/agent-corpus/doctor.md +10 -0
- package/docs/agent-corpus/gates.md +10 -0
- package/docs/agent-corpus/mcp.md +10 -0
- package/docs/agent-corpus/memory.md +10 -0
- package/docs/agent-corpus/query.md +10 -0
- package/docs/chat-and-rag.md +34 -0
- package/docs/examples.md +5 -0
- package/docs/for-agents.md +31 -0
- package/docs/getting-started.md +32 -2
- package/docs/index.md +23 -0
- package/docs/landing/assets/doc-bridge-hero.webp +0 -0
- package/docs/landing/assets/doc-bridge-surfaces.webp +0 -0
- package/docs/landing/assets/doc-bridge-two-way.webp +0 -0
- package/docs/landing/index.html +70 -10
- package/docs/mcp.md +5 -0
- package/docs/meta.json +20 -0
- package/docs/ollama-demo.md +6 -1
- package/docs/playbook/doc-bridge-pattern.md +4 -2
- package/docs/query.md +34 -0
- package/docs/recipes/index-pipeline.md +7 -2
- package/docs/schemas/agent-handoff-v1.md +5 -0
- package/docs/schemas/doc-bridge-index-v1.md +5 -0
- package/docs/schemas/memory-candidate-v1.md +15 -1
- package/docs/skills/doc-bridge.md +6 -1
- package/docs/spec/cli.md +6 -0
- package/docs/spec/config-v1.md +56 -6
- package/docs/spec/documentation-standard-v1.md +136 -0
- package/docs/spec/playbook-feedback.md +5 -0
- package/docs/spec/registry-agents.md +5 -0
- package/ecosystem-claims.json +187 -0
- package/ecosystem-upstream.json +9 -0
- package/ecosystem.json +235 -0
- package/examples/verify-handoff.mjs +5 -0
- package/package.json +46 -4
- package/scripts/check-ecosystem-upstream.mjs +50 -0
- package/src/cli/program.ts +36 -3
- package/src/config/index.ts +7 -1
- package/src/config/load-config.ts +4 -14
- package/src/config/schema.ts +91 -0
- package/src/conformance/documentation-standard-v1.ts +502 -0
- package/src/conformance/ecosystem-contract.ts +175 -0
- package/src/gates/run-gates.ts +33 -4
- package/src/index-builder/human-adapters/core.ts +12 -5
- package/src/index-builder/human-adapters/docusaurus.ts +29 -44
- package/src/index-builder/human-adapters/index.ts +15 -3
- package/src/index-builder/scan-corpus.ts +6 -6
- package/src/index.ts +17 -0
- package/src/lib/bounded-text.ts +25 -0
- package/src/lib/paths.ts +20 -2
- package/src/lib/static-js-literal.ts +261 -0
- package/src/lib/walk.ts +23 -4
- package/src/version.ts +1 -1
package/dist/config/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as AgentCorpusConfig,
|
|
1
|
+
export { A as AgentCorpusConfig, i as AgentCorpusConfigSchema, C as ConfigNotFoundError, j as ConformanceConfigSchema, D as DocBridgeConfigV1, b as DocBridgeConfigV1Schema, a as DocumentationStandardRuleId, c as DocumentationStandardRuleIdSchema, d as DocumentationStandardV1Config, e as DocumentationStandardV1ConfigSchema, E as EcosystemContractEvidenceSchema, H as HumanCorpusConfigSchema, g as applyConfigDefaults, h as defineConfig, l as loadConfig, p as projectRootFromConfigPath, r as resolveProjectRoot } from '../index-DGI9TBLE.js';
|
|
2
2
|
import 'zod';
|
package/dist/config/index.js
CHANGED
|
@@ -137,7 +137,8 @@ var GatesConfigSchema = z.object({
|
|
|
137
137
|
"okf-type",
|
|
138
138
|
"docs-style",
|
|
139
139
|
"routing-currency",
|
|
140
|
-
"bootstrap-size"
|
|
140
|
+
"bootstrap-size",
|
|
141
|
+
"documentation-standard-v1"
|
|
141
142
|
])
|
|
142
143
|
).max(16).optional(),
|
|
143
144
|
exclude: z.array(
|
|
@@ -148,7 +149,8 @@ var GatesConfigSchema = z.object({
|
|
|
148
149
|
"okf-type",
|
|
149
150
|
"docs-style",
|
|
150
151
|
"routing-currency",
|
|
151
|
-
"bootstrap-size"
|
|
152
|
+
"bootstrap-size",
|
|
153
|
+
"documentation-standard-v1"
|
|
152
154
|
])
|
|
153
155
|
).max(16).optional(),
|
|
154
156
|
options: z.record(z.string(), z.unknown()).optional()
|
|
@@ -227,6 +229,69 @@ var FederationConfigSchema = z.object({
|
|
|
227
229
|
}).strict()
|
|
228
230
|
).max(16).optional()
|
|
229
231
|
}).strict();
|
|
232
|
+
var DocumentationEvidenceFileSchema = z.object({
|
|
233
|
+
path: z.string().min(1).max(512),
|
|
234
|
+
contains: z.array(z.string().min(1).max(512)).min(1).max(32)
|
|
235
|
+
}).strict();
|
|
236
|
+
var DocumentationLinkEvidenceSchema = z.object({
|
|
237
|
+
url: z.string().url().max(512),
|
|
238
|
+
paths: z.array(z.string().min(1).max(512)).min(1).max(32)
|
|
239
|
+
}).strict();
|
|
240
|
+
var DocumentationQuickstartEvidenceSchema = z.object({
|
|
241
|
+
id: z.string().regex(/^[a-z][a-z0-9-]*$/).max(128),
|
|
242
|
+
doc: z.string().min(1).max(512),
|
|
243
|
+
test: z.string().min(1).max(512),
|
|
244
|
+
command: z.string().min(1).max(512),
|
|
245
|
+
testContains: z.array(z.string().min(1).max(256)).min(1).max(16)
|
|
246
|
+
}).strict();
|
|
247
|
+
var EcosystemContractEvidenceSchema = z.object({
|
|
248
|
+
manifest: z.string().min(1).max(512),
|
|
249
|
+
claims: z.string().min(1).max(512),
|
|
250
|
+
productId: z.string().regex(/^[a-z][a-z0-9-]*$/).max(128)
|
|
251
|
+
}).strict();
|
|
252
|
+
var DocumentationStandardRuleIdSchema = z.enum([
|
|
253
|
+
"human-docs",
|
|
254
|
+
"llms-and-raw-source",
|
|
255
|
+
"agent-handoffs",
|
|
256
|
+
"contribution",
|
|
257
|
+
"metadata",
|
|
258
|
+
"cross-links",
|
|
259
|
+
"tested-quickstarts",
|
|
260
|
+
"visual-explanations",
|
|
261
|
+
"structured-diagrams"
|
|
262
|
+
]);
|
|
263
|
+
var DocumentationStandardExceptionSchema = z.object({
|
|
264
|
+
ruleId: DocumentationStandardRuleIdSchema,
|
|
265
|
+
reason: z.string().min(10).max(1024),
|
|
266
|
+
approvedBy: z.string().min(1).max(256),
|
|
267
|
+
trackingUrl: z.string().url().max(512)
|
|
268
|
+
}).strict();
|
|
269
|
+
var DocumentationStandardV1ConfigSchema = z.object({
|
|
270
|
+
rawSources: z.array(z.string().min(1).max(512)).max(64).optional(),
|
|
271
|
+
contributionPaths: z.array(z.string().min(1).max(512)).max(16).optional(),
|
|
272
|
+
metadata: z.array(DocumentationEvidenceFileSchema).max(32).optional(),
|
|
273
|
+
links: z.array(DocumentationLinkEvidenceSchema).max(64).optional(),
|
|
274
|
+
quickstarts: z.array(DocumentationQuickstartEvidenceSchema).max(32).optional(),
|
|
275
|
+
visuals: z.array(z.string().min(1).max(512)).max(64).optional(),
|
|
276
|
+
diagrams: z.array(DocumentationEvidenceFileSchema).max(32).optional(),
|
|
277
|
+
ecosystemContract: EcosystemContractEvidenceSchema.optional(),
|
|
278
|
+
exceptions: z.array(DocumentationStandardExceptionSchema).max(32).optional()
|
|
279
|
+
}).strict().superRefine((value, context) => {
|
|
280
|
+
const seen = /* @__PURE__ */ new Set();
|
|
281
|
+
for (const [index, exception] of (value.exceptions ?? []).entries()) {
|
|
282
|
+
if (seen.has(exception.ruleId)) {
|
|
283
|
+
context.addIssue({
|
|
284
|
+
code: "custom",
|
|
285
|
+
path: ["exceptions", index, "ruleId"],
|
|
286
|
+
message: `Duplicate exception for rule ${exception.ruleId}`
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
seen.add(exception.ruleId);
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
var ConformanceConfigSchema = z.object({
|
|
293
|
+
documentationStandardV1: DocumentationStandardV1ConfigSchema.optional()
|
|
294
|
+
}).strict();
|
|
230
295
|
var DocBridgeConfigV1Schema = z.object({
|
|
231
296
|
schemaVersion: z.literal(CONFIG_SCHEMA_VERSION),
|
|
232
297
|
project: z.object({
|
|
@@ -242,7 +307,8 @@ var DocBridgeConfigV1Schema = z.object({
|
|
|
242
307
|
gates: GatesConfigSchema.optional(),
|
|
243
308
|
surfaces: SurfacesConfigSchema.optional(),
|
|
244
309
|
intelligence: IntelligenceConfigSchema.optional(),
|
|
245
|
-
federation: FederationConfigSchema.optional()
|
|
310
|
+
federation: FederationConfigSchema.optional(),
|
|
311
|
+
conformance: ConformanceConfigSchema.optional()
|
|
246
312
|
}).strict();
|
|
247
313
|
|
|
248
314
|
// src/config/define-config.ts
|
|
@@ -251,7 +317,268 @@ var defineConfig = (config) => applyConfigDefaults(DocBridgeConfigV1Schema.parse
|
|
|
251
317
|
// src/config/load-config.ts
|
|
252
318
|
import { existsSync, readFileSync } from "fs";
|
|
253
319
|
import { basename, dirname, join, resolve } from "path";
|
|
254
|
-
|
|
320
|
+
|
|
321
|
+
// src/lib/static-js-literal.ts
|
|
322
|
+
var stripComments = (source) => {
|
|
323
|
+
let out = "";
|
|
324
|
+
let index = 0;
|
|
325
|
+
let quote;
|
|
326
|
+
while (index < source.length) {
|
|
327
|
+
const char = source[index] ?? "";
|
|
328
|
+
const next = source[index + 1] ?? "";
|
|
329
|
+
if (quote) {
|
|
330
|
+
out += char;
|
|
331
|
+
if (char === "\\") {
|
|
332
|
+
out += next;
|
|
333
|
+
index += 2;
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
if (char === quote) quote = void 0;
|
|
337
|
+
index += 1;
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
if (char === '"' || char === "'" || char === "`") {
|
|
341
|
+
quote = char;
|
|
342
|
+
out += char;
|
|
343
|
+
index += 1;
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
if (char === "/" && next === "/") {
|
|
347
|
+
while (index < source.length && source[index] !== "\n") index += 1;
|
|
348
|
+
out += "\n";
|
|
349
|
+
index += 1;
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
352
|
+
if (char === "/" && next === "*") {
|
|
353
|
+
index += 2;
|
|
354
|
+
while (index < source.length && !(source[index] === "*" && source[index + 1] === "/")) index += 1;
|
|
355
|
+
index += 2;
|
|
356
|
+
out += " ";
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
out += char;
|
|
360
|
+
index += 1;
|
|
361
|
+
}
|
|
362
|
+
if (quote) throw new Error("Unterminated string in static JavaScript literal.");
|
|
363
|
+
return out;
|
|
364
|
+
};
|
|
365
|
+
var LiteralParser = class {
|
|
366
|
+
constructor(source) {
|
|
367
|
+
this.source = source;
|
|
368
|
+
}
|
|
369
|
+
source;
|
|
370
|
+
index = 0;
|
|
371
|
+
parseAt(index) {
|
|
372
|
+
this.index = index;
|
|
373
|
+
const value = this.value();
|
|
374
|
+
this.space();
|
|
375
|
+
return value;
|
|
376
|
+
}
|
|
377
|
+
space() {
|
|
378
|
+
while (/\s/.test(this.source[this.index] ?? "")) this.index += 1;
|
|
379
|
+
}
|
|
380
|
+
value() {
|
|
381
|
+
this.space();
|
|
382
|
+
const char = this.source[this.index];
|
|
383
|
+
if (char === "{") return this.object();
|
|
384
|
+
if (char === "[") return this.array();
|
|
385
|
+
if (char === '"' || char === "'") return this.string();
|
|
386
|
+
const word = this.word();
|
|
387
|
+
if (word === "true") return true;
|
|
388
|
+
if (word === "false") return false;
|
|
389
|
+
if (word === "null") return null;
|
|
390
|
+
if (/^-?\d+(?:\.\d+)?$/.test(word)) return Number(word);
|
|
391
|
+
throw new Error(`Unsupported dynamic sidebar expression near "${word || char || "EOF"}".`);
|
|
392
|
+
}
|
|
393
|
+
object() {
|
|
394
|
+
const result = {};
|
|
395
|
+
this.index += 1;
|
|
396
|
+
this.space();
|
|
397
|
+
while (this.source[this.index] !== "}") {
|
|
398
|
+
const key = this.source[this.index] === '"' || this.source[this.index] === "'" ? this.string() : this.word();
|
|
399
|
+
if (!key) throw new Error("Static sidebar object key is required.");
|
|
400
|
+
this.space();
|
|
401
|
+
if (this.source[this.index] !== ":") throw new Error(`Static sidebar key "${key}" requires a literal value.`);
|
|
402
|
+
this.index += 1;
|
|
403
|
+
result[key] = this.value();
|
|
404
|
+
this.space();
|
|
405
|
+
if (this.source[this.index] === ",") {
|
|
406
|
+
this.index += 1;
|
|
407
|
+
this.space();
|
|
408
|
+
continue;
|
|
409
|
+
}
|
|
410
|
+
if (this.source[this.index] !== "}") throw new Error("Expected comma or closing brace in static sidebar.");
|
|
411
|
+
}
|
|
412
|
+
this.index += 1;
|
|
413
|
+
return result;
|
|
414
|
+
}
|
|
415
|
+
array() {
|
|
416
|
+
const result = [];
|
|
417
|
+
this.index += 1;
|
|
418
|
+
this.space();
|
|
419
|
+
while (this.source[this.index] !== "]") {
|
|
420
|
+
result.push(this.value());
|
|
421
|
+
this.space();
|
|
422
|
+
if (this.source[this.index] === ",") {
|
|
423
|
+
this.index += 1;
|
|
424
|
+
this.space();
|
|
425
|
+
continue;
|
|
426
|
+
}
|
|
427
|
+
if (this.source[this.index] !== "]") throw new Error("Expected comma or closing bracket in static sidebar.");
|
|
428
|
+
}
|
|
429
|
+
this.index += 1;
|
|
430
|
+
return result;
|
|
431
|
+
}
|
|
432
|
+
string() {
|
|
433
|
+
const quote = this.source[this.index] ?? "";
|
|
434
|
+
this.index += 1;
|
|
435
|
+
let result = "";
|
|
436
|
+
while (this.index < this.source.length) {
|
|
437
|
+
const char = this.source[this.index] ?? "";
|
|
438
|
+
if (char === quote) {
|
|
439
|
+
this.index += 1;
|
|
440
|
+
return result;
|
|
441
|
+
}
|
|
442
|
+
if (char === "\\") {
|
|
443
|
+
const escaped = this.source[this.index + 1];
|
|
444
|
+
if (escaped === void 0) break;
|
|
445
|
+
const escapes = { n: "\n", r: "\r", t: " " };
|
|
446
|
+
result += escapes[escaped] ?? escaped;
|
|
447
|
+
this.index += 2;
|
|
448
|
+
continue;
|
|
449
|
+
}
|
|
450
|
+
result += char;
|
|
451
|
+
this.index += 1;
|
|
452
|
+
}
|
|
453
|
+
throw new Error("Unterminated string in static sidebar.");
|
|
454
|
+
}
|
|
455
|
+
word() {
|
|
456
|
+
this.space();
|
|
457
|
+
const start = this.index;
|
|
458
|
+
while (/[A-Za-z0-9_$.-]/.test(this.source[this.index] ?? "")) this.index += 1;
|
|
459
|
+
return this.source.slice(start, this.index);
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
var maskStrings = (source) => {
|
|
463
|
+
const chars = [...source];
|
|
464
|
+
let quote;
|
|
465
|
+
let previousToken;
|
|
466
|
+
const regexPrefixKeywords = /* @__PURE__ */ new Set([
|
|
467
|
+
"await",
|
|
468
|
+
"case",
|
|
469
|
+
"delete",
|
|
470
|
+
"do",
|
|
471
|
+
"else",
|
|
472
|
+
"in",
|
|
473
|
+
"instanceof",
|
|
474
|
+
"new",
|
|
475
|
+
"of",
|
|
476
|
+
"return",
|
|
477
|
+
"throw",
|
|
478
|
+
"typeof",
|
|
479
|
+
"void",
|
|
480
|
+
"yield"
|
|
481
|
+
]);
|
|
482
|
+
const canStartRegex = () => previousToken === void 0 || "=(:,[!&|?{};".includes(previousToken) || previousToken === "=>" || regexPrefixKeywords.has(previousToken);
|
|
483
|
+
for (let index = 0; index < chars.length; index += 1) {
|
|
484
|
+
const char = chars[index] ?? "";
|
|
485
|
+
if (quote) {
|
|
486
|
+
chars[index] = " ";
|
|
487
|
+
if (char === "\\") {
|
|
488
|
+
if (index + 1 < chars.length) chars[index + 1] = " ";
|
|
489
|
+
index += 1;
|
|
490
|
+
} else if (char === quote) {
|
|
491
|
+
quote = void 0;
|
|
492
|
+
previousToken = "literal";
|
|
493
|
+
}
|
|
494
|
+
continue;
|
|
495
|
+
}
|
|
496
|
+
if (char === '"' || char === "'" || char === "`") {
|
|
497
|
+
quote = char;
|
|
498
|
+
chars[index] = " ";
|
|
499
|
+
continue;
|
|
500
|
+
}
|
|
501
|
+
if (char === "/" && canStartRegex()) {
|
|
502
|
+
chars[index] = " ";
|
|
503
|
+
let inClass = false;
|
|
504
|
+
for (index += 1; index < chars.length; index += 1) {
|
|
505
|
+
const regexChar = chars[index] ?? "";
|
|
506
|
+
chars[index] = " ";
|
|
507
|
+
if (regexChar === "\\") {
|
|
508
|
+
if (index + 1 < chars.length) chars[index + 1] = " ";
|
|
509
|
+
index += 1;
|
|
510
|
+
} else if (regexChar === "[") {
|
|
511
|
+
inClass = true;
|
|
512
|
+
} else if (regexChar === "]") {
|
|
513
|
+
inClass = false;
|
|
514
|
+
} else if (regexChar === "/" && !inClass) {
|
|
515
|
+
while (/[A-Za-z]/.test(chars[index + 1] ?? "")) {
|
|
516
|
+
index += 1;
|
|
517
|
+
chars[index] = " ";
|
|
518
|
+
}
|
|
519
|
+
break;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
previousToken = "literal";
|
|
523
|
+
continue;
|
|
524
|
+
}
|
|
525
|
+
if (/[A-Za-z_$]/.test(char)) {
|
|
526
|
+
const start = index;
|
|
527
|
+
while (/[A-Za-z0-9_$]/.test(chars[index + 1] ?? "")) index += 1;
|
|
528
|
+
previousToken = chars.slice(start, index + 1).join("");
|
|
529
|
+
continue;
|
|
530
|
+
}
|
|
531
|
+
if (char === "=" && chars[index + 1] === ">") {
|
|
532
|
+
previousToken = "=>";
|
|
533
|
+
index += 1;
|
|
534
|
+
continue;
|
|
535
|
+
}
|
|
536
|
+
if (!/\s/.test(char)) previousToken = char;
|
|
537
|
+
}
|
|
538
|
+
return chars.join("");
|
|
539
|
+
};
|
|
540
|
+
var nonSpace = (source, start) => {
|
|
541
|
+
let index = start;
|
|
542
|
+
while (/\s/.test(source[index] ?? "")) index += 1;
|
|
543
|
+
return index;
|
|
544
|
+
};
|
|
545
|
+
var escapedRegex = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
546
|
+
var parseStaticJsObject = (source) => {
|
|
547
|
+
const clean = stripComments(source);
|
|
548
|
+
const mask = maskStrings(clean);
|
|
549
|
+
const parseBinding = (identifier) => {
|
|
550
|
+
const declaration = new RegExp(`\\b(?:const|let|var)\\s+${escapedRegex(identifier)}(?:\\s*:[^=;]+)?\\s*=`).exec(mask);
|
|
551
|
+
if (!declaration) throw new Error(`Exported binding "${identifier}" must reference a static object declaration.`);
|
|
552
|
+
const start = nonSpace(mask, declaration.index + declaration[0].length);
|
|
553
|
+
if (mask[start] !== "{") throw new Error(`Exported binding "${identifier}" must be a static object literal.`);
|
|
554
|
+
return new LiteralParser(clean).parseAt(start);
|
|
555
|
+
};
|
|
556
|
+
const commonJs = /\bmodule\.exports\s*=/.exec(mask);
|
|
557
|
+
if (commonJs) {
|
|
558
|
+
const start = nonSpace(mask, commonJs.index + commonJs[0].length);
|
|
559
|
+
if (mask[start] === "{") return new LiteralParser(clean).parseAt(start);
|
|
560
|
+
const identifier = /^[A-Za-z_$][\w$]*/.exec(mask.slice(start))?.[0];
|
|
561
|
+
if (identifier) return parseBinding(identifier);
|
|
562
|
+
throw new Error("module.exports must be assigned a static object literal or binding.");
|
|
563
|
+
}
|
|
564
|
+
const exported = /\bexport\s+default\b/.exec(mask);
|
|
565
|
+
if (exported) {
|
|
566
|
+
let start = nonSpace(mask, exported.index + exported[0].length);
|
|
567
|
+
if (mask.slice(start).startsWith("defineConfig")) {
|
|
568
|
+
start = nonSpace(mask, start + "defineConfig".length);
|
|
569
|
+
if (mask[start] !== "(") throw new Error("defineConfig must be called with a static object literal.");
|
|
570
|
+
start = nonSpace(mask, start + 1);
|
|
571
|
+
if (mask[start] !== "{") throw new Error("defineConfig must be called with a static object literal.");
|
|
572
|
+
return new LiteralParser(clean).parseAt(start);
|
|
573
|
+
}
|
|
574
|
+
if (mask[start] === "{") return new LiteralParser(clean).parseAt(start);
|
|
575
|
+
const identifier = /^[A-Za-z_$][\w$]*/.exec(mask.slice(start))?.[0];
|
|
576
|
+
if (identifier) return parseBinding(identifier);
|
|
577
|
+
}
|
|
578
|
+
throw new Error("Docusaurus sidebar must export a static object or assign one to a const.");
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
// src/config/load-config.ts
|
|
255
582
|
var CONFIG_CANDIDATES = [
|
|
256
583
|
"doc-bridge.config.ts",
|
|
257
584
|
"doc-bridge.config.mts",
|
|
@@ -295,22 +622,16 @@ var parseJsonConfig = (raw, path) => {
|
|
|
295
622
|
}
|
|
296
623
|
};
|
|
297
624
|
var parseCodeConfig = (raw, path) => {
|
|
298
|
-
const
|
|
299
|
-
if (/\bimport\b/.test(
|
|
625
|
+
const unsupportedImports = raw.replace(/import\s+type\s+[\s\S]*?;?\n/g, "").replace(/import\s+\{\s*defineConfig\s*\}\s+from\s+['"]@agentskit\/doc-bridge(?:\/config)?['"];?\n?/g, "");
|
|
626
|
+
if (/\bimport\b/.test(unsupportedImports)) {
|
|
300
627
|
throw new Error(`Unsupported import in ${path}. Static config only supports defineConfig imports.`);
|
|
301
628
|
}
|
|
302
|
-
const sandbox = {
|
|
303
|
-
module: { exports: {} },
|
|
304
|
-
exports: {},
|
|
305
|
-
defineConfig: (config) => config
|
|
306
|
-
};
|
|
307
629
|
try {
|
|
308
|
-
|
|
630
|
+
return parseStaticJsObject(raw);
|
|
309
631
|
} catch (error) {
|
|
310
632
|
const message = error instanceof Error ? error.message : String(error);
|
|
311
633
|
throw new Error(`Failed to load config at ${path}: ${message}`);
|
|
312
634
|
}
|
|
313
|
-
return sandbox.module.exports.default;
|
|
314
635
|
};
|
|
315
636
|
var parseConfig = (input) => {
|
|
316
637
|
const result = DocBridgeConfigV1Schema.safeParse(input);
|
|
@@ -353,7 +674,11 @@ var projectRootFromConfigPath = (configFilePath, projectRootField) => {
|
|
|
353
674
|
export {
|
|
354
675
|
AgentCorpusConfigSchema,
|
|
355
676
|
ConfigNotFoundError,
|
|
677
|
+
ConformanceConfigSchema,
|
|
356
678
|
DocBridgeConfigV1Schema,
|
|
679
|
+
DocumentationStandardRuleIdSchema,
|
|
680
|
+
DocumentationStandardV1ConfigSchema,
|
|
681
|
+
EcosystemContractEvidenceSchema,
|
|
357
682
|
HumanCorpusConfigSchema,
|
|
358
683
|
applyConfigDefaults,
|
|
359
684
|
defineConfig,
|
package/dist/config/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config/defaults.ts","../../src/config/schema.ts","../../src/config/define-config.ts","../../src/config/load-config.ts"],"sourcesContent":["import type { DocBridgeConfigV1 } from './schema.js'\n\nconst DEFAULT_AGENT_EXCLUDE = ['**/node_modules/**', '**/.git/**'] as const\n\nexport const applyConfigDefaults = (config: DocBridgeConfigV1): DocBridgeConfigV1 => {\n const agentRoot = config.corpus.agent.root\n const agentIndex = config.corpus.agent.index ?? `${agentRoot}/INDEX.md`\n\n return {\n ...config,\n corpus: {\n ...config.corpus,\n agent: {\n ...config.corpus.agent,\n index: agentIndex,\n include: config.corpus.agent.include ?? ['**/*.{md,mdx}'],\n exclude: config.corpus.agent.exclude ?? [...DEFAULT_AGENT_EXCLUDE],\n },\n },\n index: {\n outFile: '.doc-bridge/index.json',\n contentHash: 'sha256-normalized-v1',\n llmsTxt: {\n enabled: true,\n outFile: 'llms.txt',\n ...config.index?.llmsTxt,\n },\n capabilities: {\n enabled: true,\n outFile: '.doc-bridge/capabilities.json',\n ...config.index?.capabilities,\n },\n ...config.index,\n },\n gates: {\n preset: 'minimal',\n ...config.gates,\n },\n surfaces: {\n cli: {\n bin: 'ak-docs',\n defaultFormat: 'json',\n ...config.surfaces?.cli,\n },\n mcp: {\n enabled: true,\n tools: ['handoff.resolve', 'doc.search', 'doc.get', 'gate.status'],\n transport: 'stdio',\n ...config.surfaces?.mcp,\n },\n ...config.surfaces,\n },\n intelligence: config.intelligence\n ? {\n enabled: false,\n ...config.intelligence,\n chat: config.intelligence.chat\n ? { handoffFirst: true, ...config.intelligence.chat }\n : undefined,\n }\n : { enabled: false },\n }\n}\n","import { z } from 'zod'\n\nexport const CONFIG_SCHEMA_VERSION = 1 as const\n\nexport const HumanCorpusPluginIdSchema = z.enum([\n 'plain-markdown',\n 'fumadocs',\n 'docusaurus',\n 'mkdocs',\n 'vitepress',\n 'custom',\n])\n\nexport const AgentCorpusConfigSchema = z\n .object({\n root: z.string().min(1).max(512),\n index: z.string().min(1).max(512).optional(),\n include: z.array(z.string().min(1).max(256)).max(64).optional(),\n exclude: z.array(z.string().min(1).max(256)).max(64).optional(),\n okf: z\n .object({\n requireType: z.boolean().optional(),\n allowedTypes: z.array(z.string().min(1).max(128)).max(64).optional(),\n })\n .strict()\n .optional(),\n })\n .strict()\n\nexport const HumanCorpusConfigSchema = z\n .object({\n plugin: HumanCorpusPluginIdSchema,\n options: z.record(z.string(), z.unknown()).optional(),\n })\n .strict()\n\nexport const IndexConfigSchema = z\n .object({\n outFile: z.string().min(1).max(512).optional(),\n llmsTxt: z\n .object({\n enabled: z.boolean().optional(),\n outFile: z.string().min(1).max(512).optional(),\n preamble: z.string().max(4_000).optional(),\n })\n .strict()\n .optional(),\n capabilities: z\n .object({\n enabled: z.boolean().optional(),\n outFile: z.string().min(1).max(512).optional(),\n })\n .strict()\n .optional(),\n contentHash: z.literal('sha256-normalized-v1').optional(),\n })\n .strict()\n\nexport const OwnershipEntrySchema = z\n .object({\n path: z.string().min(1).max(512),\n group: z.string().min(1).max(128).optional(),\n layer: z.string().min(1).max(32).optional(),\n purpose: z.string().max(1024).optional(),\n checks: z.array(z.string().min(1).max(256)).max(32).optional(),\n agentDoc: z.string().min(1).max(512).optional(),\n humanDoc: z.string().min(1).max(512).optional(),\n })\n .strict()\n\nexport const RoutingConfigSchema = z\n .object({\n plugin: z\n .enum(['pnpm-monorepo', 'npm-workspaces', 'yarn-workspaces', 'pattern-files', 'custom'])\n .optional(),\n options: z\n .object({\n packages: z.array(z.string().min(1).max(256)).max(128).optional(),\n /** Infer ownership from corpus paths/frontmatter (default true). */\n ownershipFromCorpus: z.boolean().optional(),\n ownership: z.record(z.string().min(1).max(256), OwnershipEntrySchema).optional(),\n intents: z\n .array(\n z\n .object({\n id: z.string().min(1).max(128),\n title: z.string().min(1).max(256),\n paths: z.array(z.string().min(1).max(512)).max(32),\n })\n .strict(),\n )\n .max(128)\n .optional(),\n changes: z\n .array(\n z\n .object({\n id: z.string().min(1).max(128),\n title: z.string().min(1).max(256),\n startHere: z.string().min(1).max(512),\n relatedPackages: z.array(z.string().min(1).max(256)).max(32).optional(),\n })\n .strict(),\n )\n .max(128)\n .optional(),\n })\n .strict()\n .optional(),\n })\n .strict()\n\nexport const GatesConfigSchema = z\n .object({\n /** minimal: freshness · standard: + human links · strict: + okf-type · playbook: freshness + okf soft style */\n preset: z.enum(['minimal', 'standard', 'strict', 'playbook']).optional(),\n include: z\n .array(\n z.enum([\n 'index-freshness',\n 'human-guide-links',\n 'link-rot',\n 'okf-type',\n 'docs-style',\n 'routing-currency',\n 'bootstrap-size',\n ]),\n )\n .max(16)\n .optional(),\n exclude: z\n .array(\n z.enum([\n 'index-freshness',\n 'human-guide-links',\n 'link-rot',\n 'okf-type',\n 'docs-style',\n 'routing-currency',\n 'bootstrap-size',\n ]),\n )\n .max(16)\n .optional(),\n options: z.record(z.string(), z.unknown()).optional(),\n })\n .strict()\n\nexport const SurfacesConfigSchema = z\n .object({\n cli: z\n .object({\n bin: z.string().min(1).max(64).optional(),\n defaultFormat: z.enum(['json', 'text']).optional(),\n })\n .strict()\n .optional(),\n mcp: z\n .object({\n enabled: z.boolean().optional(),\n tools: z\n .array(\n z.enum([\n 'handoff.resolve',\n 'doc.search',\n 'doc.get',\n 'gate.status',\n 'playbook.pattern.get',\n 'retriever.query',\n 'memory.classify',\n 'memory.promoteDraft',\n 'registry.topology',\n ]),\n )\n .max(16)\n .optional(),\n transport: z.enum(['stdio', 'http']).optional(),\n http: z\n .object({\n port: z.number().int().min(1).max(65_535).optional(),\n path: z.string().min(1).max(256).optional(),\n })\n .strict()\n .optional(),\n })\n .strict()\n .optional(),\n })\n .strict()\n\nexport const IntelligenceConfigSchema = z\n .object({\n enabled: z.boolean().optional(),\n adapter: z\n .object({\n provider: z.enum(['openai', 'anthropic', 'ollama', 'openrouter', 'custom']),\n model: z.string().min(1).max(128).optional(),\n apiKeyEnv: z.string().min(0).max(128).optional(),\n baseUrl: z.string().url().optional(),\n options: z.record(z.string(), z.unknown()).optional(),\n })\n .strict()\n .optional(),\n chat: z\n .object({\n enabled: z.boolean().optional(),\n sources: z.array(z.enum(['agent', 'human', 'federation'])).max(8).optional(),\n handoffFirst: z.boolean().optional(),\n })\n .strict()\n .optional(),\n retriever: z\n .object({\n enabled: z.boolean().optional(),\n mode: z.enum(['local', 'remote', 'bm25', 'agentskit-rag']).optional(),\n embedModel: z.string().min(1).max(128).optional(),\n chunkSize: z.number().int().min(128).max(16_384).optional(),\n options: z.record(z.string(), z.unknown()).optional(),\n })\n .strict()\n .optional(),\n memory: z\n .object({\n enabled: z.boolean().optional(),\n adapters: z\n .array(z.enum(['playbook-memory', 'cursor-rules', 'session-export', 'bootstrap-delta']))\n .max(8)\n .optional(),\n ingestDir: z.string().min(1).max(512).optional(),\n classify: z.boolean().optional(),\n promote: z\n .object({\n enabled: z.boolean().optional(),\n targets: z.array(z.enum(['agent', 'human', 'agents-md'])).max(8).optional(),\n requireApproval: z.boolean().optional(),\n })\n .strict()\n .optional(),\n })\n .strict()\n .optional(),\n runtime: z.enum(['agentskit', 'custom']).optional(),\n runtimeModule: z.string().min(1).max(512).optional(),\n })\n .strict()\n\nexport const FederationConfigSchema = z\n .object({\n enabled: z.boolean().optional(),\n sources: z\n .array(\n z\n .object({\n id: z.string().min(1).max(64),\n llmsTxt: z.string().min(1).max(512).optional(),\n rawBaseUrl: z.string().url().optional(),\n includeInRetriever: z.boolean().optional(),\n includeInChat: z.boolean().optional(),\n })\n .strict(),\n )\n .max(16)\n .optional(),\n })\n .strict()\n\nexport const DocBridgeConfigV1Schema = z\n .object({\n schemaVersion: z.literal(CONFIG_SCHEMA_VERSION),\n project: z\n .object({\n name: z.string().min(1).max(128).optional(),\n root: z.string().min(1).max(512).optional(),\n })\n .strict()\n .optional(),\n corpus: z\n .object({\n agent: AgentCorpusConfigSchema,\n human: z.union([HumanCorpusConfigSchema, z.array(HumanCorpusConfigSchema).max(8)]).optional(),\n })\n .strict(),\n index: IndexConfigSchema.optional(),\n routing: RoutingConfigSchema.optional(),\n gates: GatesConfigSchema.optional(),\n surfaces: SurfacesConfigSchema.optional(),\n intelligence: IntelligenceConfigSchema.optional(),\n federation: FederationConfigSchema.optional(),\n })\n .strict()\n\nexport type DocBridgeConfigV1 = z.infer<typeof DocBridgeConfigV1Schema>\nexport type AgentCorpusConfig = z.infer<typeof AgentCorpusConfigSchema>\nexport type HumanCorpusConfig = z.infer<typeof HumanCorpusConfigSchema>\n","import { applyConfigDefaults } from './defaults.js'\nimport { DocBridgeConfigV1Schema, type DocBridgeConfigV1 } from './schema.js'\n\n/** Type-safe config helper for `doc-bridge.config.ts`. */\nexport const defineConfig = (config: DocBridgeConfigV1): DocBridgeConfigV1 =>\n applyConfigDefaults(DocBridgeConfigV1Schema.parse(config))","import { existsSync, readFileSync } from 'node:fs'\nimport { basename, dirname, join, resolve } from 'node:path'\nimport vm from 'node:vm'\n\nimport { applyConfigDefaults } from './defaults.js'\nimport { DocBridgeConfigV1Schema, type DocBridgeConfigV1 } from './schema.js'\n\nconst CONFIG_CANDIDATES = [\n 'doc-bridge.config.ts',\n 'doc-bridge.config.mts',\n 'doc-bridge.config.js',\n 'doc-bridge.config.mjs',\n 'doc-bridge.config.json',\n 'doc-bridge.config.yaml',\n 'doc-bridge.config.yml',\n 'package.json',\n] as const\n\nexport type LoadConfigOptions = {\n readonly cwd?: string\n readonly explicitPath?: string\n}\n\nexport type LoadConfigResult = {\n readonly config: DocBridgeConfigV1\n readonly path: string\n}\n\nexport class ConfigNotFoundError extends Error {\n constructor(readonly cwd: string) {\n super(\n `No doc-bridge config found in ${cwd}. Run: ak-docs init — or pass --config <path>.`,\n )\n this.name = 'ConfigNotFoundError'\n }\n}\n\nconst findConfigPath = (cwd: string, explicitPath?: string): string | null => {\n if (explicitPath) {\n const abs = resolve(cwd, explicitPath)\n return existsSync(abs) ? abs : null\n }\n for (const name of CONFIG_CANDIDATES) {\n const candidate = join(cwd, name)\n if (!existsSync(candidate)) continue\n if (name !== 'package.json') return candidate\n const pkg = parseJsonConfig(readFileSync(candidate, 'utf8'), candidate) as { docBridge?: unknown }\n if (pkg.docBridge) return candidate\n }\n return null\n}\n\nconst parseJsonConfig = (raw: string, path: string): unknown => {\n try {\n return JSON.parse(raw) as unknown\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n throw new Error(`Failed to parse JSON config at ${path}: ${message}`)\n }\n}\n\nconst parseCodeConfig = (raw: string, path: string): unknown => {\n const code = raw\n .replace(/import\\s+type\\s+[\\s\\S]*?;?\\n/g, '')\n .replace(/import\\s+\\{\\s*defineConfig\\s*\\}\\s+from\\s+['\"]@agentskit\\/doc-bridge(?:\\/config)?['\"];?\\n?/g, '')\n .replace(/\\s+satisfies\\s+[A-Za-z0-9_.$<>{}\\[\\],\\s]+(?=\\s*(?:;|\\)|$))/g, '')\n .replace(/export\\s+default/, 'module.exports.default =')\n\n if (/\\bimport\\b/.test(code)) {\n throw new Error(`Unsupported import in ${path}. Static config only supports defineConfig imports.`)\n }\n\n const sandbox = {\n module: { exports: {} as { default?: unknown } },\n exports: {},\n defineConfig: (config: unknown) => config,\n }\n try {\n vm.runInNewContext(code, sandbox, { timeout: 250, filename: path })\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n throw new Error(`Failed to load config at ${path}: ${message}`)\n }\n return sandbox.module.exports.default\n}\n\nconst parseConfig = (input: unknown): DocBridgeConfigV1 => {\n const result = DocBridgeConfigV1Schema.safeParse(input)\n if (result.success) return result.data\n throw new Error(\n `Invalid doc-bridge config:\\n${result.error.issues.map((issue) =>\n ` - ${issue.path.join('.') || '(root)'}: ${issue.message}`,\n ).join('\\n')}`,\n )\n}\n\n/** v0.1 — static JS/TS config, JSON config files, and package.json#docBridge. */\nexport const loadConfig = (opts: LoadConfigOptions = {}): LoadConfigResult => {\n const cwd = resolve(opts.cwd ?? process.cwd())\n const path = findConfigPath(cwd, opts.explicitPath)\n if (!path) throw new ConfigNotFoundError(cwd)\n\n const raw = readFileSync(path, 'utf8')\n const ext = path.split('.').pop()?.toLowerCase()\n if (ext === 'yaml' || ext === 'yml') {\n throw new Error(`YAML config is not supported yet (${path}). Use doc-bridge.config.json for now.`)\n }\n\n const parsed =\n basename(path) === 'package.json'\n ? (parseJsonConfig(raw, path) as { docBridge?: unknown }).docBridge\n : ext === 'ts' || ext === 'mts' || ext === 'js' || ext === 'mjs'\n ? parseCodeConfig(raw, path)\n : parseJsonConfig(raw, path)\n const config = applyConfigDefaults(parseConfig(parsed))\n return { config, path }\n}\n\nexport const resolveProjectRoot = (start = process.cwd()): string => {\n let cur = resolve(start)\n for (let i = 0; i < 12; i += 1) {\n if (findConfigPath(cur)) return cur\n const parent = dirname(cur)\n if (parent === cur) break\n cur = parent\n }\n return resolve(start)\n}\n\n/** Project root for a loaded config file path (directory of the config). */\nexport const projectRootFromConfigPath = (\n configFilePath: string,\n projectRootField?: string,\n): string => {\n const configDir = dirname(resolve(configFilePath))\n if (projectRootField) return resolve(configDir, projectRoot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,IAAK;AACpB,UAAM;AAAA,EACR;AACA,SAAO,QAAQ,KAAK;AACtB;AAGO,IAAM,4BAA4B,CACvC,gBACA,qBACW;AACX,QAAM,YAAY,QAAQ,QAAQ,cAAc,CAAC;AACjD,MAAI,iBAAkB,QAAO,QAAQ,WAAW,gBAAgB;AAChE,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/config/defaults.ts","../../src/config/schema.ts","../../src/config/define-config.ts","../../src/config/load-config.ts","../../src/lib/static-js-literal.ts"],"sourcesContent":["import type { DocBridgeConfigV1 } from './schema.js'\n\nconst DEFAULT_AGENT_EXCLUDE = ['**/node_modules/**', '**/.git/**'] as const\n\nexport const applyConfigDefaults = (config: DocBridgeConfigV1): DocBridgeConfigV1 => {\n const agentRoot = config.corpus.agent.root\n const agentIndex = config.corpus.agent.index ?? `${agentRoot}/INDEX.md`\n\n return {\n ...config,\n corpus: {\n ...config.corpus,\n agent: {\n ...config.corpus.agent,\n index: agentIndex,\n include: config.corpus.agent.include ?? ['**/*.{md,mdx}'],\n exclude: config.corpus.agent.exclude ?? [...DEFAULT_AGENT_EXCLUDE],\n },\n },\n index: {\n outFile: '.doc-bridge/index.json',\n contentHash: 'sha256-normalized-v1',\n llmsTxt: {\n enabled: true,\n outFile: 'llms.txt',\n ...config.index?.llmsTxt,\n },\n capabilities: {\n enabled: true,\n outFile: '.doc-bridge/capabilities.json',\n ...config.index?.capabilities,\n },\n ...config.index,\n },\n gates: {\n preset: 'minimal',\n ...config.gates,\n },\n surfaces: {\n cli: {\n bin: 'ak-docs',\n defaultFormat: 'json',\n ...config.surfaces?.cli,\n },\n mcp: {\n enabled: true,\n tools: ['handoff.resolve', 'doc.search', 'doc.get', 'gate.status'],\n transport: 'stdio',\n ...config.surfaces?.mcp,\n },\n ...config.surfaces,\n },\n intelligence: config.intelligence\n ? {\n enabled: false,\n ...config.intelligence,\n chat: config.intelligence.chat\n ? { handoffFirst: true, ...config.intelligence.chat }\n : undefined,\n }\n : { enabled: false },\n }\n}\n","import { z } from 'zod'\n\nexport const CONFIG_SCHEMA_VERSION = 1 as const\n\nexport const HumanCorpusPluginIdSchema = z.enum([\n 'plain-markdown',\n 'fumadocs',\n 'docusaurus',\n 'mkdocs',\n 'vitepress',\n 'custom',\n])\n\nexport const AgentCorpusConfigSchema = z\n .object({\n root: z.string().min(1).max(512),\n index: z.string().min(1).max(512).optional(),\n include: z.array(z.string().min(1).max(256)).max(64).optional(),\n exclude: z.array(z.string().min(1).max(256)).max(64).optional(),\n okf: z\n .object({\n requireType: z.boolean().optional(),\n allowedTypes: z.array(z.string().min(1).max(128)).max(64).optional(),\n })\n .strict()\n .optional(),\n })\n .strict()\n\nexport const HumanCorpusConfigSchema = z\n .object({\n plugin: HumanCorpusPluginIdSchema,\n options: z.record(z.string(), z.unknown()).optional(),\n })\n .strict()\n\nexport const IndexConfigSchema = z\n .object({\n outFile: z.string().min(1).max(512).optional(),\n llmsTxt: z\n .object({\n enabled: z.boolean().optional(),\n outFile: z.string().min(1).max(512).optional(),\n preamble: z.string().max(4_000).optional(),\n })\n .strict()\n .optional(),\n capabilities: z\n .object({\n enabled: z.boolean().optional(),\n outFile: z.string().min(1).max(512).optional(),\n })\n .strict()\n .optional(),\n contentHash: z.literal('sha256-normalized-v1').optional(),\n })\n .strict()\n\nexport const OwnershipEntrySchema = z\n .object({\n path: z.string().min(1).max(512),\n group: z.string().min(1).max(128).optional(),\n layer: z.string().min(1).max(32).optional(),\n purpose: z.string().max(1024).optional(),\n checks: z.array(z.string().min(1).max(256)).max(32).optional(),\n agentDoc: z.string().min(1).max(512).optional(),\n humanDoc: z.string().min(1).max(512).optional(),\n })\n .strict()\n\nexport const RoutingConfigSchema = z\n .object({\n plugin: z\n .enum(['pnpm-monorepo', 'npm-workspaces', 'yarn-workspaces', 'pattern-files', 'custom'])\n .optional(),\n options: z\n .object({\n packages: z.array(z.string().min(1).max(256)).max(128).optional(),\n /** Infer ownership from corpus paths/frontmatter (default true). */\n ownershipFromCorpus: z.boolean().optional(),\n ownership: z.record(z.string().min(1).max(256), OwnershipEntrySchema).optional(),\n intents: z\n .array(\n z\n .object({\n id: z.string().min(1).max(128),\n title: z.string().min(1).max(256),\n paths: z.array(z.string().min(1).max(512)).max(32),\n })\n .strict(),\n )\n .max(128)\n .optional(),\n changes: z\n .array(\n z\n .object({\n id: z.string().min(1).max(128),\n title: z.string().min(1).max(256),\n startHere: z.string().min(1).max(512),\n relatedPackages: z.array(z.string().min(1).max(256)).max(32).optional(),\n })\n .strict(),\n )\n .max(128)\n .optional(),\n })\n .strict()\n .optional(),\n })\n .strict()\n\nexport const GatesConfigSchema = z\n .object({\n /** minimal: freshness · standard: + human links · strict: + okf-type · playbook: freshness + okf soft style */\n preset: z.enum(['minimal', 'standard', 'strict', 'playbook']).optional(),\n include: z\n .array(\n z.enum([\n 'index-freshness',\n 'human-guide-links',\n 'link-rot',\n 'okf-type',\n 'docs-style',\n 'routing-currency',\n 'bootstrap-size',\n 'documentation-standard-v1',\n ]),\n )\n .max(16)\n .optional(),\n exclude: z\n .array(\n z.enum([\n 'index-freshness',\n 'human-guide-links',\n 'link-rot',\n 'okf-type',\n 'docs-style',\n 'routing-currency',\n 'bootstrap-size',\n 'documentation-standard-v1',\n ]),\n )\n .max(16)\n .optional(),\n options: z.record(z.string(), z.unknown()).optional(),\n })\n .strict()\n\nexport const SurfacesConfigSchema = z\n .object({\n cli: z\n .object({\n bin: z.string().min(1).max(64).optional(),\n defaultFormat: z.enum(['json', 'text']).optional(),\n })\n .strict()\n .optional(),\n mcp: z\n .object({\n enabled: z.boolean().optional(),\n tools: z\n .array(\n z.enum([\n 'handoff.resolve',\n 'doc.search',\n 'doc.get',\n 'gate.status',\n 'playbook.pattern.get',\n 'retriever.query',\n 'memory.classify',\n 'memory.promoteDraft',\n 'registry.topology',\n ]),\n )\n .max(16)\n .optional(),\n transport: z.enum(['stdio', 'http']).optional(),\n http: z\n .object({\n port: z.number().int().min(1).max(65_535).optional(),\n path: z.string().min(1).max(256).optional(),\n })\n .strict()\n .optional(),\n })\n .strict()\n .optional(),\n })\n .strict()\n\nexport const IntelligenceConfigSchema = z\n .object({\n enabled: z.boolean().optional(),\n adapter: z\n .object({\n provider: z.enum(['openai', 'anthropic', 'ollama', 'openrouter', 'custom']),\n model: z.string().min(1).max(128).optional(),\n apiKeyEnv: z.string().min(0).max(128).optional(),\n baseUrl: z.string().url().optional(),\n options: z.record(z.string(), z.unknown()).optional(),\n })\n .strict()\n .optional(),\n chat: z\n .object({\n enabled: z.boolean().optional(),\n sources: z.array(z.enum(['agent', 'human', 'federation'])).max(8).optional(),\n handoffFirst: z.boolean().optional(),\n })\n .strict()\n .optional(),\n retriever: z\n .object({\n enabled: z.boolean().optional(),\n mode: z.enum(['local', 'remote', 'bm25', 'agentskit-rag']).optional(),\n embedModel: z.string().min(1).max(128).optional(),\n chunkSize: z.number().int().min(128).max(16_384).optional(),\n options: z.record(z.string(), z.unknown()).optional(),\n })\n .strict()\n .optional(),\n memory: z\n .object({\n enabled: z.boolean().optional(),\n adapters: z\n .array(z.enum(['playbook-memory', 'cursor-rules', 'session-export', 'bootstrap-delta']))\n .max(8)\n .optional(),\n ingestDir: z.string().min(1).max(512).optional(),\n classify: z.boolean().optional(),\n promote: z\n .object({\n enabled: z.boolean().optional(),\n targets: z.array(z.enum(['agent', 'human', 'agents-md'])).max(8).optional(),\n requireApproval: z.boolean().optional(),\n })\n .strict()\n .optional(),\n })\n .strict()\n .optional(),\n runtime: z.enum(['agentskit', 'custom']).optional(),\n runtimeModule: z.string().min(1).max(512).optional(),\n })\n .strict()\n\nexport const FederationConfigSchema = z\n .object({\n enabled: z.boolean().optional(),\n sources: z\n .array(\n z\n .object({\n id: z.string().min(1).max(64),\n llmsTxt: z.string().min(1).max(512).optional(),\n rawBaseUrl: z.string().url().optional(),\n includeInRetriever: z.boolean().optional(),\n includeInChat: z.boolean().optional(),\n })\n .strict(),\n )\n .max(16)\n .optional(),\n })\n .strict()\n\nexport const DocumentationEvidenceFileSchema = z\n .object({\n path: z.string().min(1).max(512),\n contains: z.array(z.string().min(1).max(512)).min(1).max(32),\n })\n .strict()\n\nexport const DocumentationLinkEvidenceSchema = z\n .object({\n url: z.string().url().max(512),\n paths: z.array(z.string().min(1).max(512)).min(1).max(32),\n })\n .strict()\n\nexport const DocumentationQuickstartEvidenceSchema = z\n .object({\n id: z.string().regex(/^[a-z][a-z0-9-]*$/).max(128),\n doc: z.string().min(1).max(512),\n test: z.string().min(1).max(512),\n command: z.string().min(1).max(512),\n testContains: z.array(z.string().min(1).max(256)).min(1).max(16),\n })\n .strict()\n\nexport const EcosystemContractEvidenceSchema = z\n .object({\n manifest: z.string().min(1).max(512),\n claims: z.string().min(1).max(512),\n productId: z.string().regex(/^[a-z][a-z0-9-]*$/).max(128),\n })\n .strict()\n\nexport const DocumentationStandardRuleIdSchema = z.enum([\n 'human-docs',\n 'llms-and-raw-source',\n 'agent-handoffs',\n 'contribution',\n 'metadata',\n 'cross-links',\n 'tested-quickstarts',\n 'visual-explanations',\n 'structured-diagrams',\n])\n\nexport const DocumentationStandardExceptionSchema = z\n .object({\n ruleId: DocumentationStandardRuleIdSchema,\n reason: z.string().min(10).max(1_024),\n approvedBy: z.string().min(1).max(256),\n trackingUrl: z.string().url().max(512),\n })\n .strict()\n\nexport const DocumentationStandardV1ConfigSchema = z\n .object({\n rawSources: z.array(z.string().min(1).max(512)).max(64).optional(),\n contributionPaths: z.array(z.string().min(1).max(512)).max(16).optional(),\n metadata: z.array(DocumentationEvidenceFileSchema).max(32).optional(),\n links: z.array(DocumentationLinkEvidenceSchema).max(64).optional(),\n quickstarts: z.array(DocumentationQuickstartEvidenceSchema).max(32).optional(),\n visuals: z.array(z.string().min(1).max(512)).max(64).optional(),\n diagrams: z.array(DocumentationEvidenceFileSchema).max(32).optional(),\n ecosystemContract: EcosystemContractEvidenceSchema.optional(),\n exceptions: z.array(DocumentationStandardExceptionSchema).max(32).optional(),\n })\n .strict()\n .superRefine((value, context) => {\n const seen = new Set<string>()\n for (const [index, exception] of (value.exceptions ?? []).entries()) {\n if (seen.has(exception.ruleId)) {\n context.addIssue({\n code: 'custom',\n path: ['exceptions', index, 'ruleId'],\n message: `Duplicate exception for rule ${exception.ruleId}`,\n })\n }\n seen.add(exception.ruleId)\n }\n })\n\nexport const ConformanceConfigSchema = z\n .object({\n documentationStandardV1: DocumentationStandardV1ConfigSchema.optional(),\n })\n .strict()\n\nexport const DocBridgeConfigV1Schema = z\n .object({\n schemaVersion: z.literal(CONFIG_SCHEMA_VERSION),\n project: z\n .object({\n name: z.string().min(1).max(128).optional(),\n root: z.string().min(1).max(512).optional(),\n })\n .strict()\n .optional(),\n corpus: z\n .object({\n agent: AgentCorpusConfigSchema,\n human: z.union([HumanCorpusConfigSchema, z.array(HumanCorpusConfigSchema).max(8)]).optional(),\n })\n .strict(),\n index: IndexConfigSchema.optional(),\n routing: RoutingConfigSchema.optional(),\n gates: GatesConfigSchema.optional(),\n surfaces: SurfacesConfigSchema.optional(),\n intelligence: IntelligenceConfigSchema.optional(),\n federation: FederationConfigSchema.optional(),\n conformance: ConformanceConfigSchema.optional(),\n })\n .strict()\n\nexport type DocBridgeConfigV1 = z.infer<typeof DocBridgeConfigV1Schema>\nexport type AgentCorpusConfig = z.infer<typeof AgentCorpusConfigSchema>\nexport type HumanCorpusConfig = z.infer<typeof HumanCorpusConfigSchema>\nexport type DocumentationStandardV1Config = z.infer<typeof DocumentationStandardV1ConfigSchema>\nexport type DocumentationStandardRuleId = z.infer<typeof DocumentationStandardRuleIdSchema>\n","import { applyConfigDefaults } from './defaults.js'\nimport { DocBridgeConfigV1Schema, type DocBridgeConfigV1 } from './schema.js'\n\n/** Type-safe config helper for `doc-bridge.config.ts`. */\nexport const defineConfig = (config: DocBridgeConfigV1): DocBridgeConfigV1 =>\n applyConfigDefaults(DocBridgeConfigV1Schema.parse(config))","import { existsSync, readFileSync } from 'node:fs'\nimport { basename, dirname, join, resolve } from 'node:path'\n\nimport { parseStaticJsObject } from '../lib/static-js-literal.js'\nimport { applyConfigDefaults } from './defaults.js'\nimport { DocBridgeConfigV1Schema, type DocBridgeConfigV1 } from './schema.js'\n\nconst CONFIG_CANDIDATES = [\n 'doc-bridge.config.ts',\n 'doc-bridge.config.mts',\n 'doc-bridge.config.js',\n 'doc-bridge.config.mjs',\n 'doc-bridge.config.json',\n 'doc-bridge.config.yaml',\n 'doc-bridge.config.yml',\n 'package.json',\n] as const\n\nexport type LoadConfigOptions = {\n readonly cwd?: string\n readonly explicitPath?: string\n}\n\nexport type LoadConfigResult = {\n readonly config: DocBridgeConfigV1\n readonly path: string\n}\n\nexport class ConfigNotFoundError extends Error {\n constructor(readonly cwd: string) {\n super(\n `No doc-bridge config found in ${cwd}. Run: ak-docs init — or pass --config <path>.`,\n )\n this.name = 'ConfigNotFoundError'\n }\n}\n\nconst findConfigPath = (cwd: string, explicitPath?: string): string | null => {\n if (explicitPath) {\n const abs = resolve(cwd, explicitPath)\n return existsSync(abs) ? abs : null\n }\n for (const name of CONFIG_CANDIDATES) {\n const candidate = join(cwd, name)\n if (!existsSync(candidate)) continue\n if (name !== 'package.json') return candidate\n const pkg = parseJsonConfig(readFileSync(candidate, 'utf8'), candidate) as { docBridge?: unknown }\n if (pkg.docBridge) return candidate\n }\n return null\n}\n\nconst parseJsonConfig = (raw: string, path: string): unknown => {\n try {\n return JSON.parse(raw) as unknown\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n throw new Error(`Failed to parse JSON config at ${path}: ${message}`)\n }\n}\n\nconst parseCodeConfig = (raw: string, path: string): unknown => {\n const unsupportedImports = raw\n .replace(/import\\s+type\\s+[\\s\\S]*?;?\\n/g, '')\n .replace(/import\\s+\\{\\s*defineConfig\\s*\\}\\s+from\\s+['\"]@agentskit\\/doc-bridge(?:\\/config)?['\"];?\\n?/g, '')\n if (/\\bimport\\b/.test(unsupportedImports)) {\n throw new Error(`Unsupported import in ${path}. Static config only supports defineConfig imports.`)\n }\n try {\n return parseStaticJsObject(raw)\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n throw new Error(`Failed to load config at ${path}: ${message}`)\n }\n}\n\nconst parseConfig = (input: unknown): DocBridgeConfigV1 => {\n const result = DocBridgeConfigV1Schema.safeParse(input)\n if (result.success) return result.data\n throw new Error(\n `Invalid doc-bridge config:\\n${result.error.issues.map((issue) =>\n ` - ${issue.path.join('.') || '(root)'}: ${issue.message}`,\n ).join('\\n')}`,\n )\n}\n\n/** v0.1 — static JS/TS config, JSON config files, and package.json#docBridge. */\nexport const loadConfig = (opts: LoadConfigOptions = {}): LoadConfigResult => {\n const cwd = resolve(opts.cwd ?? process.cwd())\n const path = findConfigPath(cwd, opts.explicitPath)\n if (!path) throw new ConfigNotFoundError(cwd)\n\n const raw = readFileSync(path, 'utf8')\n const ext = path.split('.').pop()?.toLowerCase()\n if (ext === 'yaml' || ext === 'yml') {\n throw new Error(`YAML config is not supported yet (${path}). Use doc-bridge.config.json for now.`)\n }\n\n const parsed =\n basename(path) === 'package.json'\n ? (parseJsonConfig(raw, path) as { docBridge?: unknown }).docBridge\n : ext === 'ts' || ext === 'mts' || ext === 'js' || ext === 'mjs'\n ? parseCodeConfig(raw, path)\n : parseJsonConfig(raw, path)\n const config = applyConfigDefaults(parseConfig(parsed))\n return { config, path }\n}\n\nexport const resolveProjectRoot = (start = process.cwd()): string => {\n let cur = resolve(start)\n for (let i = 0; i < 12; i += 1) {\n if (findConfigPath(cur)) return cur\n const parent = dirname(cur)\n if (parent === cur) break\n cur = parent\n }\n return resolve(start)\n}\n\n/** Project root for a loaded config file path (directory of the config). */\nexport const projectRootFromConfigPath = (\n configFilePath: string,\n projectRootField?: string,\n): string => {\n const configDir = dirname(resolve(configFilePath))\n if (projectRootField) return resolve(configDir, projectRootField)\n return configDir\n}\n","const stripComments = (source: string): string => {\n let out = ''\n let index = 0\n let quote: string | undefined\n while (index < source.length) {\n const char = source[index] ?? ''\n const next = source[index + 1] ?? ''\n if (quote) {\n out += char\n if (char === '\\\\') {\n out += next\n index += 2\n continue\n }\n if (char === quote) quote = undefined\n index += 1\n continue\n }\n if (char === '\"' || char === \"'\" || char === '`') {\n quote = char\n out += char\n index += 1\n continue\n }\n if (char === '/' && next === '/') {\n while (index < source.length && source[index] !== '\\n') index += 1\n out += '\\n'\n index += 1\n continue\n }\n if (char === '/' && next === '*') {\n index += 2\n while (index < source.length && !(source[index] === '*' && source[index + 1] === '/')) index += 1\n index += 2\n out += ' '\n continue\n }\n out += char\n index += 1\n }\n if (quote) throw new Error('Unterminated string in static JavaScript literal.')\n return out\n}\n\nclass LiteralParser {\n private index = 0\n\n constructor(private readonly source: string) {}\n\n parseAt(index: number): unknown {\n this.index = index\n const value = this.value()\n this.space()\n return value\n }\n\n private space(): void {\n while (/\\s/.test(this.source[this.index] ?? '')) this.index += 1\n }\n\n private value(): unknown {\n this.space()\n const char = this.source[this.index]\n if (char === '{') return this.object()\n if (char === '[') return this.array()\n if (char === '\"' || char === \"'\") return this.string()\n const word = this.word()\n if (word === 'true') return true\n if (word === 'false') return false\n if (word === 'null') return null\n if (/^-?\\d+(?:\\.\\d+)?$/.test(word)) return Number(word)\n throw new Error(`Unsupported dynamic sidebar expression near \"${word || char || 'EOF'}\".`)\n }\n\n private object(): Record<string, unknown> {\n const result: Record<string, unknown> = {}\n this.index += 1\n this.space()\n while (this.source[this.index] !== '}') {\n const key = this.source[this.index] === '\"' || this.source[this.index] === \"'\" ? this.string() : this.word()\n if (!key) throw new Error('Static sidebar object key is required.')\n this.space()\n if (this.source[this.index] !== ':') throw new Error(`Static sidebar key \"${key}\" requires a literal value.`)\n this.index += 1\n result[key] = this.value()\n this.space()\n if (this.source[this.index] === ',') {\n this.index += 1\n this.space()\n continue\n }\n if (this.source[this.index] !== '}') throw new Error('Expected comma or closing brace in static sidebar.')\n }\n this.index += 1\n return result\n }\n\n private array(): unknown[] {\n const result: unknown[] = []\n this.index += 1\n this.space()\n while (this.source[this.index] !== ']') {\n result.push(this.value())\n this.space()\n if (this.source[this.index] === ',') {\n this.index += 1\n this.space()\n continue\n }\n if (this.source[this.index] !== ']') throw new Error('Expected comma or closing bracket in static sidebar.')\n }\n this.index += 1\n return result\n }\n\n private string(): string {\n const quote = this.source[this.index] ?? ''\n this.index += 1\n let result = ''\n while (this.index < this.source.length) {\n const char = this.source[this.index] ?? ''\n if (char === quote) {\n this.index += 1\n return result\n }\n if (char === '\\\\') {\n const escaped = this.source[this.index + 1]\n if (escaped === undefined) break\n const escapes: Record<string, string> = { n: '\\n', r: '\\r', t: '\\t' }\n result += escapes[escaped] ?? escaped\n this.index += 2\n continue\n }\n result += char\n this.index += 1\n }\n throw new Error('Unterminated string in static sidebar.')\n }\n\n private word(): string {\n this.space()\n const start = this.index\n while (/[A-Za-z0-9_$.-]/.test(this.source[this.index] ?? '')) this.index += 1\n return this.source.slice(start, this.index)\n }\n}\n\nconst maskStrings = (source: string): string => {\n const chars = [...source]\n let quote: string | undefined\n let previousToken: string | undefined\n const regexPrefixKeywords = new Set([\n 'await', 'case', 'delete', 'do', 'else', 'in', 'instanceof', 'new',\n 'of', 'return', 'throw', 'typeof', 'void', 'yield',\n ])\n const canStartRegex = (): boolean => previousToken === undefined\n || '=(:,[!&|?{};'.includes(previousToken)\n || previousToken === '=>'\n || regexPrefixKeywords.has(previousToken)\n for (let index = 0; index < chars.length; index += 1) {\n const char = chars[index] ?? ''\n if (quote) {\n chars[index] = ' '\n if (char === '\\\\') {\n if (index + 1 < chars.length) chars[index + 1] = ' '\n index += 1\n } else if (char === quote) {\n quote = undefined\n previousToken = 'literal'\n }\n continue\n }\n if (char === '\"' || char === \"'\" || char === '`') {\n quote = char\n chars[index] = ' '\n continue\n }\n if (char === '/' && canStartRegex()) {\n chars[index] = ' '\n let inClass = false\n for (index += 1; index < chars.length; index += 1) {\n const regexChar = chars[index] ?? ''\n chars[index] = ' '\n if (regexChar === '\\\\') {\n if (index + 1 < chars.length) chars[index + 1] = ' '\n index += 1\n } else if (regexChar === '[') {\n inClass = true\n } else if (regexChar === ']') {\n inClass = false\n } else if (regexChar === '/' && !inClass) {\n while (/[A-Za-z]/.test(chars[index + 1] ?? '')) {\n index += 1\n chars[index] = ' '\n }\n break\n }\n }\n previousToken = 'literal'\n continue\n }\n if (/[A-Za-z_$]/.test(char)) {\n const start = index\n while (/[A-Za-z0-9_$]/.test(chars[index + 1] ?? '')) index += 1\n previousToken = chars.slice(start, index + 1).join('')\n continue\n }\n if (char === '=' && chars[index + 1] === '>') {\n previousToken = '=>'\n index += 1\n continue\n }\n if (!/\\s/.test(char)) previousToken = char\n }\n return chars.join('')\n}\n\nconst nonSpace = (source: string, start: number): number => {\n let index = start\n while (/\\s/.test(source[index] ?? '')) index += 1\n return index\n}\n\nconst escapedRegex = (value: string): string => value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n\nexport const parseStaticJsObject = (source: string): unknown => {\n const clean = stripComments(source)\n const mask = maskStrings(clean)\n const parseBinding = (identifier: string): unknown => {\n const declaration = new RegExp(`\\\\b(?:const|let|var)\\\\s+${escapedRegex(identifier)}(?:\\\\s*:[^=;]+)?\\\\s*=`).exec(mask)\n if (!declaration) throw new Error(`Exported binding \"${identifier}\" must reference a static object declaration.`)\n const start = nonSpace(mask, declaration.index + declaration[0].length)\n if (mask[start] !== '{') throw new Error(`Exported binding \"${identifier}\" must be a static object literal.`)\n return new LiteralParser(clean).parseAt(start)\n }\n const commonJs = /\\bmodule\\.exports\\s*=/.exec(mask)\n if (commonJs) {\n const start = nonSpace(mask, commonJs.index + commonJs[0].length)\n if (mask[start] === '{') return new LiteralParser(clean).parseAt(start)\n const identifier = /^[A-Za-z_$][\\w$]*/.exec(mask.slice(start))?.[0]\n if (identifier) return parseBinding(identifier)\n throw new Error('module.exports must be assigned a static object literal or binding.')\n }\n\n const exported = /\\bexport\\s+default\\b/.exec(mask)\n if (exported) {\n let start = nonSpace(mask, exported.index + exported[0].length)\n if (mask.slice(start).startsWith('defineConfig')) {\n start = nonSpace(mask, start + 'defineConfig'.length)\n if (mask[start] !== '(') throw new Error('defineConfig must be called with a static object literal.')\n start = nonSpace(mask, start + 1)\n if (mask[start] !== '{') throw new Error('defineConfig must be called with a static object literal.')\n return new LiteralParser(clean).parseAt(start)\n }\n if (mask[start] === '{') return new LiteralParser(clean).parseAt(start)\n\n const identifier = /^[A-Za-z_$][\\w$]*/.exec(mask.slice(start))?.[0]\n if (identifier) return parseBinding(identifier)\n }\n throw new Error('Docusaurus sidebar must export a static object or assign one to a const.')\n}\n"],"mappings":";AAEA,IAAM,wBAAwB,CAAC,sBAAsB,YAAY;AAE1D,IAAM,sBAAsB,CAAC,WAAiD;AACnF,QAAM,YAAY,OAAO,OAAO,MAAM;AACtC,QAAM,aAAa,OAAO,OAAO,MAAM,SAAS,GAAG,SAAS;AAE5D,SAAO;AAAA,IACL,GAAG;AAAA,IACH,QAAQ;AAAA,MACN,GAAG,OAAO;AAAA,MACV,OAAO;AAAA,QACL,GAAG,OAAO,OAAO;AAAA,QACjB,OAAO;AAAA,QACP,SAAS,OAAO,OAAO,MAAM,WAAW,CAAC,eAAe;AAAA,QACxD,SAAS,OAAO,OAAO,MAAM,WAAW,CAAC,GAAG,qBAAqB;AAAA,MACnE;AAAA,IACF;AAAA,IACA,OAAO;AAAA,MACL,SAAS;AAAA,MACT,aAAa;AAAA,MACb,SAAS;AAAA,QACP,SAAS;AAAA,QACT,SAAS;AAAA,QACT,GAAG,OAAO,OAAO;AAAA,MACnB;AAAA,MACA,cAAc;AAAA,QACZ,SAAS;AAAA,QACT,SAAS;AAAA,QACT,GAAG,OAAO,OAAO;AAAA,MACnB;AAAA,MACA,GAAG,OAAO;AAAA,IACZ;AAAA,IACA,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,GAAG,OAAO;AAAA,IACZ;AAAA,IACA,UAAU;AAAA,MACR,KAAK;AAAA,QACH,KAAK;AAAA,QACL,eAAe;AAAA,QACf,GAAG,OAAO,UAAU;AAAA,MACtB;AAAA,MACA,KAAK;AAAA,QACH,S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