@framers/agentos 0.13.65 → 0.13.67
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/api/generateText.d.ts +9 -2
- package/dist/api/generateText.d.ts.map +1 -1
- package/dist/api/generateText.js +35 -2
- package/dist/api/generateText.js.map +1 -1
- package/dist/api/runtime/completionGateway.d.ts +36 -4
- package/dist/api/runtime/completionGateway.d.ts.map +1 -1
- package/dist/api/runtime/completionGateway.js +32 -3
- package/dist/api/runtime/completionGateway.js.map +1 -1
- package/dist/api/runtime/strategies/hierarchical.js +8 -8
- package/dist/api/runtime/strategies/hierarchical.js.map +1 -1
- package/dist/api/runtime/strategies/parallel.d.ts.map +1 -1
- package/dist/api/runtime/strategies/parallel.js +11 -10
- package/dist/api/runtime/strategies/parallel.js.map +1 -1
- package/dist/api/runtime/strategies/sequential.d.ts.map +1 -1
- package/dist/api/runtime/strategies/sequential.js +19 -22
- package/dist/api/runtime/strategies/sequential.js.map +1 -1
- package/dist/api/runtime/strategies/shared.d.ts +53 -0
- package/dist/api/runtime/strategies/shared.d.ts.map +1 -1
- package/dist/api/runtime/strategies/shared.js +63 -5
- package/dist/api/runtime/strategies/shared.js.map +1 -1
- package/dist/api/streamText.d.ts.map +1 -1
- package/dist/api/streamText.js +1 -0
- package/dist/api/streamText.js.map +1 -1
- package/dist/api/types.d.ts +7 -4
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/types.js.map +1 -1
- package/dist/cognition/emergent/EmergentAgentForge.d.ts.map +1 -1
- package/dist/cognition/emergent/EmergentAgentForge.js +5 -4
- package/dist/cognition/emergent/EmergentAgentForge.js.map +1 -1
- package/dist/cognition/emergent/EmergentCapabilityEngine.d.ts +2 -0
- package/dist/cognition/emergent/EmergentCapabilityEngine.d.ts.map +1 -1
- package/dist/cognition/emergent/EmergentCapabilityEngine.js +10 -0
- package/dist/cognition/emergent/EmergentCapabilityEngine.js.map +1 -1
- package/dist/cognition/emergent/ForgeToolMetaTool.d.ts +4 -1
- package/dist/cognition/emergent/ForgeToolMetaTool.d.ts.map +1 -1
- package/dist/cognition/emergent/ForgeToolMetaTool.js +14 -1
- package/dist/cognition/emergent/ForgeToolMetaTool.js.map +1 -1
- package/dist/cognition/emergent/SkillExporter.d.ts +44 -3
- package/dist/cognition/emergent/SkillExporter.d.ts.map +1 -1
- package/dist/cognition/emergent/SkillExporter.js +124 -18
- package/dist/cognition/emergent/SkillExporter.js.map +1 -1
- package/dist/cognition/emergent/ToolName.d.ts +63 -0
- package/dist/cognition/emergent/ToolName.d.ts.map +1 -0
- package/dist/cognition/emergent/ToolName.js +79 -0
- package/dist/cognition/emergent/ToolName.js.map +1 -0
- package/dist/cognition/emergent/index.d.ts +3 -1
- package/dist/cognition/emergent/index.d.ts.map +1 -1
- package/dist/cognition/emergent/index.js +2 -1
- package/dist/cognition/emergent/index.js.map +1 -1
- package/dist/cognition/memory/io/MarkdownExporter.d.ts +27 -17
- package/dist/cognition/memory/io/MarkdownExporter.d.ts.map +1 -1
- package/dist/cognition/memory/io/MarkdownExporter.js +101 -88
- package/dist/cognition/memory/io/MarkdownExporter.js.map +1 -1
- package/dist/cognition/memory/io/facade/Memory.d.ts +3 -2
- package/dist/cognition/memory/io/facade/Memory.d.ts.map +1 -1
- package/dist/cognition/memory/io/facade/Memory.js +3 -2
- package/dist/cognition/memory/io/facade/Memory.js.map +1 -1
- package/dist/cognition/memory/io/facade/types.d.ts +10 -6
- package/dist/cognition/memory/io/facade/types.d.ts.map +1 -1
- package/dist/cognition/substrate/GMI.d.ts.map +1 -1
- package/dist/cognition/substrate/GMI.js +2 -1
- package/dist/cognition/substrate/GMI.js.map +1 -1
- package/dist/cognition/substrate/memory/wiki/WikiPageId.d.ts.map +1 -1
- package/dist/cognition/substrate/memory/wiki/WikiPageId.js +2 -10
- package/dist/cognition/substrate/memory/wiki/WikiPageId.js.map +1 -1
- package/dist/core/utils/linkFreeWrite.d.ts +66 -0
- package/dist/core/utils/linkFreeWrite.d.ts.map +1 -0
- package/dist/core/utils/linkFreeWrite.js +140 -0
- package/dist/core/utils/linkFreeWrite.js.map +1 -0
- package/dist/core/utils/pathName.d.ts +11 -4
- package/dist/core/utils/pathName.d.ts.map +1 -1
- package/dist/core/utils/pathName.js +17 -4
- package/dist/core/utils/pathName.js.map +1 -1
- package/dist/safety/guardrails/IGuardrailService.d.ts +43 -9
- package/dist/safety/guardrails/IGuardrailService.d.ts.map +1 -1
- package/dist/safety/guardrails/ParallelGuardrailDispatcher.d.ts +7 -1
- package/dist/safety/guardrails/ParallelGuardrailDispatcher.d.ts.map +1 -1
- package/dist/safety/guardrails/ParallelGuardrailDispatcher.js +82 -2
- package/dist/safety/guardrails/ParallelGuardrailDispatcher.js.map +1 -1
- package/dist/safety/guardrails/guardrailDispatcher.d.ts +3 -1
- package/dist/safety/guardrails/guardrailDispatcher.d.ts.map +1 -1
- package/dist/safety/guardrails/guardrailDispatcher.js +3 -1
- package/dist/safety/guardrails/guardrailDispatcher.js.map +1 -1
- package/package.json +1 -1
|
@@ -15,10 +15,21 @@
|
|
|
15
15
|
* - `writeSkillFile()` — writes a single SKILL.md to disk
|
|
16
16
|
* - `exportToolAsSkillPack()` — writes both SKILL.md and CAPABILITY.yaml (a full
|
|
17
17
|
* capability directory ready for scanner pickup)
|
|
18
|
+
*
|
|
19
|
+
* The two that write name the tool's folder after the tool, so they hold the
|
|
20
|
+
* name to the rule every name built from data meets and write only when the
|
|
21
|
+
* folder resolves inside the output directory (`resolveToolFolder`). A tool
|
|
22
|
+
* whose name fails either check is refused with an `InvalidToolNameError`
|
|
23
|
+
* before any folder is made or file written. Below the output directory they
|
|
24
|
+
* make the tool's folder and write its files never through a link, and only
|
|
25
|
+
* into regular files with one name (`core/utils/linkFreeWrite`); anything else
|
|
26
|
+
* there is refused with a `SkillExportRefusedError`, and nothing is written.
|
|
18
27
|
*/
|
|
19
28
|
import * as fs from 'node:fs/promises';
|
|
20
29
|
import * as path from 'node:path';
|
|
21
30
|
import YAML from 'yaml';
|
|
31
|
+
import { lookOutsideLinks, makeFoldersOutsideLinks, openFileOutsideLinks, } from '../../core/utils/linkFreeWrite.js';
|
|
32
|
+
import { resolveToolFolder } from './ToolName.js';
|
|
22
33
|
// ============================================================================
|
|
23
34
|
// FRONTMATTER HELPERS
|
|
24
35
|
// ============================================================================
|
|
@@ -276,16 +287,113 @@ export function buildCapabilityYaml(tool) {
|
|
|
276
287
|
// ============================================================================
|
|
277
288
|
// FILE I/O
|
|
278
289
|
// ============================================================================
|
|
290
|
+
/**
|
|
291
|
+
* Thrown by `writeSkillFile` and `exportToolAsSkillPack` when something below
|
|
292
|
+
* the output directory is not written through: a symbolic link at the tool's
|
|
293
|
+
* folder or at one of its files, a second name (a hard link) for one of its
|
|
294
|
+
* files, or anything but a regular file at a file's place. Nothing is written.
|
|
295
|
+
*/
|
|
296
|
+
export class SkillExportRefusedError extends Error {
|
|
297
|
+
/**
|
|
298
|
+
* @param problem - `link` for a symbolic link or a second name, `special` for anything but a regular file.
|
|
299
|
+
* @param target - The absolute path of the folder or file refused.
|
|
300
|
+
*/
|
|
301
|
+
constructor(problem, target) {
|
|
302
|
+
super(`skill export refused: ${problem === 'link' ? 'a link' : 'something other than a regular file'} is at ${target}`);
|
|
303
|
+
this.problem = problem;
|
|
304
|
+
this.target = target;
|
|
305
|
+
/** A stable code for callers that branch on the kind of failure. */
|
|
306
|
+
this.code = 'SKILL_EXPORT_REFUSED';
|
|
307
|
+
this.name = 'SkillExportRefusedError';
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Write a tool's files into its own folder under `outputDir`, all of them or
|
|
312
|
+
* none. The folder is resolved by `resolveToolFolder`, which refuses a name that
|
|
313
|
+
* is not a safe folder name or a folder outside `outputDir`. The output
|
|
314
|
+
* directory is the caller's: it is made when missing and used as it is, even
|
|
315
|
+
* when it is a link. Below it, the tool's folder is made never through a link;
|
|
316
|
+
* every file's place is looked at before any file is opened, and every file is
|
|
317
|
+
* opened and checked before any is written.
|
|
318
|
+
*
|
|
319
|
+
* @param tool - The tool whose files are written.
|
|
320
|
+
* @param outputDir - The folder the tool's folder is made in.
|
|
321
|
+
* @param files - Each file's name in the tool's folder and its content.
|
|
322
|
+
* @returns The absolute path of each file, in the order given.
|
|
323
|
+
* @throws {InvalidToolNameError} When the name is refused. Nothing is written.
|
|
324
|
+
* @throws {SkillExportRefusedError} When a link or anything but a regular file
|
|
325
|
+
* is in the way. Nothing is written.
|
|
326
|
+
*/
|
|
327
|
+
async function writeToolFiles(tool, outputDir, files) {
|
|
328
|
+
const folder = resolveToolFolder(outputDir, tool.name);
|
|
329
|
+
const root = path.resolve(outputDir);
|
|
330
|
+
await fs.mkdir(root, { recursive: true });
|
|
331
|
+
if (!(await makeFoldersOutsideLinks(root, path.relative(root, folder)))) {
|
|
332
|
+
throw new SkillExportRefusedError('link', folder);
|
|
333
|
+
}
|
|
334
|
+
// Every file's place is looked at before any file is opened, so a link or a special file already there refuses
|
|
335
|
+
// the export before an open makes a missing file.
|
|
336
|
+
const paths = files.map((file) => path.join(folder, file.name));
|
|
337
|
+
for (const file of paths) {
|
|
338
|
+
const refusal = await lookOutsideLinks(file);
|
|
339
|
+
if (refusal)
|
|
340
|
+
throw new SkillExportRefusedError(refusal, file);
|
|
341
|
+
}
|
|
342
|
+
const opened = await Promise.allSettled(paths.map((file) => openFileOutsideLinks(file)));
|
|
343
|
+
const handles = [];
|
|
344
|
+
for (const outcome of opened) {
|
|
345
|
+
if (outcome.status !== 'fulfilled')
|
|
346
|
+
continue;
|
|
347
|
+
const value = outcome.value;
|
|
348
|
+
if (typeof value !== 'string')
|
|
349
|
+
handles.push(value.handle);
|
|
350
|
+
}
|
|
351
|
+
let failure;
|
|
352
|
+
try {
|
|
353
|
+
const ready = [];
|
|
354
|
+
for (let index = 0; index < opened.length; index++) {
|
|
355
|
+
const outcome = opened[index];
|
|
356
|
+
if (outcome.status === 'rejected')
|
|
357
|
+
throw outcome.reason;
|
|
358
|
+
const value = outcome.value;
|
|
359
|
+
if (typeof value === 'string')
|
|
360
|
+
throw new SkillExportRefusedError(value, paths[index]);
|
|
361
|
+
ready.push({ handle: value.handle, content: files[index].content });
|
|
362
|
+
}
|
|
363
|
+
await Promise.all(ready.map(async ({ handle, content }) => {
|
|
364
|
+
await handle.truncate(0);
|
|
365
|
+
await handle.writeFile(content, 'utf8');
|
|
366
|
+
}));
|
|
367
|
+
}
|
|
368
|
+
catch (error) {
|
|
369
|
+
failure = { error };
|
|
370
|
+
}
|
|
371
|
+
// A file whose close fails may not hold what was written, so that fails the export too.
|
|
372
|
+
for (const closed of await Promise.allSettled(handles.map((handle) => handle.close()))) {
|
|
373
|
+
if (closed.status === 'rejected')
|
|
374
|
+
failure ?? (failure = { error: closed.reason });
|
|
375
|
+
}
|
|
376
|
+
if (failure)
|
|
377
|
+
throw failure.error;
|
|
378
|
+
return paths;
|
|
379
|
+
}
|
|
279
380
|
/**
|
|
280
381
|
* Writes a SKILL.md file to disk for an emergent tool.
|
|
281
382
|
*
|
|
282
383
|
* Creates the output directory if it does not exist. The file is written to
|
|
283
|
-
* `<outputDir>/<tool.name>/SKILL.md`.
|
|
384
|
+
* `<outputDir>/<tool.name>/SKILL.md`. The tool's name must be a safe folder
|
|
385
|
+
* name and its folder must resolve inside `outputDir`, and below `outputDir`
|
|
386
|
+
* the file is written through no link and only into a regular file; otherwise
|
|
387
|
+
* nothing is written.
|
|
284
388
|
*
|
|
285
389
|
* @param tool - The emergent tool to export.
|
|
286
390
|
* @param outputDir - Base directory where the skill subdirectory will be created.
|
|
287
391
|
* @returns Absolute path to the written SKILL.md file.
|
|
288
392
|
*
|
|
393
|
+
* @throws {InvalidToolNameError} If the tool's name is not a safe folder name
|
|
394
|
+
* or its folder would lie outside `outputDir`. Nothing is written.
|
|
395
|
+
* @throws {SkillExportRefusedError} If a link, a second name or anything but a
|
|
396
|
+
* regular file is at the tool's folder or at SKILL.md. Nothing is written.
|
|
289
397
|
* @throws {Error} If the filesystem write fails (permissions, disk full, etc.).
|
|
290
398
|
*
|
|
291
399
|
* @example
|
|
@@ -295,11 +403,9 @@ export function buildCapabilityYaml(tool) {
|
|
|
295
403
|
* ```
|
|
296
404
|
*/
|
|
297
405
|
export async function writeSkillFile(tool, outputDir) {
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
const content = exportToolAsSkill(tool);
|
|
302
|
-
await fs.writeFile(skillPath, content, 'utf-8');
|
|
406
|
+
const [skillPath] = await writeToolFiles(tool, outputDir, [
|
|
407
|
+
{ name: 'SKILL.md', content: exportToolAsSkill(tool) },
|
|
408
|
+
]);
|
|
303
409
|
return skillPath;
|
|
304
410
|
}
|
|
305
411
|
/**
|
|
@@ -309,12 +415,19 @@ export async function writeSkillFile(tool, outputDir) {
|
|
|
309
415
|
* files. This directory structure is compatible with the
|
|
310
416
|
* capability manifest scanner and can be placed in any scan directory
|
|
311
417
|
* (`~/.wunderland/capabilities/`, `./.wunderland/capabilities/`, etc.) for
|
|
312
|
-
* automatic discovery.
|
|
418
|
+
* automatic discovery. The tool's name must be a safe folder name and its
|
|
419
|
+
* folder must resolve inside `outputDir`, and below `outputDir` the files are
|
|
420
|
+
* written through no link and only into regular files; otherwise nothing is
|
|
421
|
+
* written.
|
|
313
422
|
*
|
|
314
423
|
* @param tool - The emergent tool to export.
|
|
315
424
|
* @param outputDir - Base directory where the skill subdirectory will be created.
|
|
316
|
-
* @returns
|
|
425
|
+
* @returns Absolute paths to the written SKILL.md and CAPABILITY.yaml files.
|
|
317
426
|
*
|
|
427
|
+
* @throws {InvalidToolNameError} If the tool's name is not a safe folder name
|
|
428
|
+
* or its folder would lie outside `outputDir`. Nothing is written.
|
|
429
|
+
* @throws {SkillExportRefusedError} If a link, a second name or anything but a
|
|
430
|
+
* regular file is at the tool's folder or at either file. Nothing is written.
|
|
318
431
|
* @throws {Error} If the filesystem writes fail (permissions, disk full, etc.).
|
|
319
432
|
*
|
|
320
433
|
* @example
|
|
@@ -328,16 +441,9 @@ export async function writeSkillFile(tool, outputDir) {
|
|
|
328
441
|
* ```
|
|
329
442
|
*/
|
|
330
443
|
export async function exportToolAsSkillPack(tool, outputDir) {
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
const skillContent = exportToolAsSkill(tool);
|
|
335
|
-
const capabilityContent = buildCapabilityYaml(tool);
|
|
336
|
-
const skillPath = path.join(skillDir, 'SKILL.md');
|
|
337
|
-
const capabilityPath = path.join(skillDir, 'CAPABILITY.yaml');
|
|
338
|
-
await Promise.all([
|
|
339
|
-
fs.writeFile(skillPath, skillContent, 'utf-8'),
|
|
340
|
-
fs.writeFile(capabilityPath, capabilityContent, 'utf-8'),
|
|
444
|
+
const [skillPath, capabilityPath] = await writeToolFiles(tool, outputDir, [
|
|
445
|
+
{ name: 'SKILL.md', content: exportToolAsSkill(tool) },
|
|
446
|
+
{ name: 'CAPABILITY.yaml', content: buildCapabilityYaml(tool) },
|
|
341
447
|
]);
|
|
342
448
|
return { skillPath, capabilityPath };
|
|
343
449
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkillExporter.js","sourceRoot":"","sources":["../../../src/cognition/emergent/SkillExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,IAAI,MAAM,MAAM,CAAC;AAKxB,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E;;;;;;;;;;;GAWG;AACH,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAC7E,CAAC;AAED;;;;;;GAMG;AACH,SAAS,o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D,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,mBAAmB,CAAC,IAAI,CAAC,EAAE;KAChE,CAAC,CAAC;IACH,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview The name rule for a forged tool, and the folder a tool is exported to.
|
|
3
|
+
*
|
|
4
|
+
* A model names the tool it forges, and the skill exporter names a folder after the tool. The forge holds the name
|
|
5
|
+
* to the rule every name built from data meets (`pathNameProblem` in `core/utils/pathName`) and to an identifier
|
|
6
|
+
* pattern. The exporter checks the name against the first rule again and writes only inside its output folder, so
|
|
7
|
+
* a tool the forge did not check, such as one loaded from a stored row or one a host builds itself, is checked as
|
|
8
|
+
* well.
|
|
9
|
+
*
|
|
10
|
+
* @module agentos/emergent/ToolName
|
|
11
|
+
*/
|
|
12
|
+
import * as path from 'node:path';
|
|
13
|
+
import { type PathNameProblem } from '../../core/utils/pathName.js';
|
|
14
|
+
/**
|
|
15
|
+
* The identifier pattern for a name a model gives: a forged tool's name, and a synthesised agent's role
|
|
16
|
+
* (`EmergentAgentForge`), which names its `delegate_to_<role>` tool. An ASCII letter, then ASCII letters, digits,
|
|
17
|
+
* underscores and hyphens.
|
|
18
|
+
*/
|
|
19
|
+
export declare const IDENTIFIER_PATTERN: RegExp;
|
|
20
|
+
/**
|
|
21
|
+
* Why a tool's name was refused:
|
|
22
|
+
* - `'type'`: the name is not a string.
|
|
23
|
+
* - `'empty'`, `'character'`, `'dot'`, `'edge'` and `'length'`: the name breaks the rule every name built from
|
|
24
|
+
* data meets (`PathNameProblem` in `core/utils/pathName`). It is empty; it holds a slash, a backslash, a colon,
|
|
25
|
+
* one of `"`, `*`, `<`, `>`, `?` and `|`, or a control character; it starts with a dot; it starts or ends with a
|
|
26
|
+
* space, or ends with a dot; or it holds more than 200 bytes in UTF-8.
|
|
27
|
+
* - `'identifier'`: the forge's own rule. The name is not an ASCII letter followed by ASCII letters, digits,
|
|
28
|
+
* underscores and hyphens ({@link IDENTIFIER_PATTERN}).
|
|
29
|
+
* - `'outside'`: the tool's folder would not lie inside the output folder.
|
|
30
|
+
*/
|
|
31
|
+
export type ToolNameProblem = 'type' | PathNameProblem | 'identifier' | 'outside';
|
|
32
|
+
/** Reported or thrown when a tool's name is refused. Nothing is forged or written for the refused name. */
|
|
33
|
+
export declare class InvalidToolNameError extends Error {
|
|
34
|
+
readonly problem: ToolNameProblem;
|
|
35
|
+
/** A stable code for callers that branch on the kind of failure. */
|
|
36
|
+
readonly code = "INVALID_TOOL_NAME";
|
|
37
|
+
/**
|
|
38
|
+
* @param problem - The part of the name rule the name breaks.
|
|
39
|
+
* @param name - The refused name. The message shows at most its first 64 characters, escaped.
|
|
40
|
+
*/
|
|
41
|
+
constructor(problem: ToolNameProblem, name: unknown);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The part of the forge's name rule `name` breaks, or null when a tool may be forged under it. The name is held to
|
|
45
|
+
* the rule every name built from data meets, then to {@link IDENTIFIER_PATTERN}. A name the forge accepts is
|
|
46
|
+
* therefore one the skill exporter accepts.
|
|
47
|
+
*
|
|
48
|
+
* @param name - The name a forge request gives the tool.
|
|
49
|
+
*/
|
|
50
|
+
export declare function forgedToolNameProblem(name: unknown): ToolNameProblem | null;
|
|
51
|
+
/**
|
|
52
|
+
* The folder that a tool named `name` is exported to under `outputDir`, resolved. The name is held to the rule
|
|
53
|
+
* every name built from data meets. Then the resolved folder must lie inside the resolved output folder, a second
|
|
54
|
+
* guard should a platform's path rules ever place the folder of an accepted name elsewhere.
|
|
55
|
+
*
|
|
56
|
+
* @param outputDir - The folder the tool's own folder is made in.
|
|
57
|
+
* @param name - The tool's name.
|
|
58
|
+
* @param paths - The path functions to resolve with: the platform's by default, `path.win32` or `path.posix` to pick one.
|
|
59
|
+
* @returns The absolute path of the tool's folder.
|
|
60
|
+
* @throws InvalidToolNameError when the name is refused or its folder would be outside `outputDir`.
|
|
61
|
+
*/
|
|
62
|
+
export declare function resolveToolFolder(outputDir: string, name: unknown, paths?: Pick<path.PlatformPath, 'resolve' | 'sep'>): string;
|
|
63
|
+
//# sourceMappingURL=ToolName.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolName.d.ts","sourceRoot":"","sources":["../../../src/cognition/emergent/ToolName.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,8BAA8B,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,QAA6B,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,eAAe,GAAG,YAAY,GAAG,SAAS,CAAC;AAclF,2GAA2G;AAC3G,qBAAa,oBAAqB,SAAQ,KAAK;IAS3C,QAAQ,CAAC,OAAO,EAAE,eAAe;IARnC,oEAAoE;IACpE,QAAQ,CAAC,IAAI,uBAAuB;IAEpC;;;OAGG;gBAEQ,OAAO,EAAE,eAAe,EACjC,IAAI,EAAE,OAAO;CAKhB;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAG3E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,OAAO,EACb,KAAK,GAAE,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,KAAK,CAAQ,GACvD,MAAM,CAOR"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview The name rule for a forged tool, and the folder a tool is exported to.
|
|
3
|
+
*
|
|
4
|
+
* A model names the tool it forges, and the skill exporter names a folder after the tool. The forge holds the name
|
|
5
|
+
* to the rule every name built from data meets (`pathNameProblem` in `core/utils/pathName`) and to an identifier
|
|
6
|
+
* pattern. The exporter checks the name against the first rule again and writes only inside its output folder, so
|
|
7
|
+
* a tool the forge did not check, such as one loaded from a stored row or one a host builds itself, is checked as
|
|
8
|
+
* well.
|
|
9
|
+
*
|
|
10
|
+
* @module agentos/emergent/ToolName
|
|
11
|
+
*/
|
|
12
|
+
import * as path from 'node:path';
|
|
13
|
+
import { MAX_PATH_NAME_BYTES, describeRefusedName, pathNameProblem, resolveInsideFolder, } from '../../core/utils/pathName.js';
|
|
14
|
+
/**
|
|
15
|
+
* The identifier pattern for a name a model gives: a forged tool's name, and a synthesised agent's role
|
|
16
|
+
* (`EmergentAgentForge`), which names its `delegate_to_<role>` tool. An ASCII letter, then ASCII letters, digits,
|
|
17
|
+
* underscores and hyphens.
|
|
18
|
+
*/
|
|
19
|
+
export const IDENTIFIER_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]*$/;
|
|
20
|
+
/** The part of the rule each problem breaks, as the error message words it. */
|
|
21
|
+
const RULE_BROKEN = {
|
|
22
|
+
type: 'a tool name is a string',
|
|
23
|
+
empty: 'a tool name is not empty',
|
|
24
|
+
character: 'a tool name holds no slash, no backslash, no colon, none of " * < > ? | and no control character',
|
|
25
|
+
dot: 'a tool name does not start with a dot',
|
|
26
|
+
edge: 'a tool name does not start or end with a space, or end with a dot',
|
|
27
|
+
length: `a tool name is at most ${MAX_PATH_NAME_BYTES} bytes in UTF-8`,
|
|
28
|
+
identifier: 'a forged tool name is an ASCII letter followed by ASCII letters, digits, underscores and hyphens',
|
|
29
|
+
outside: "the tool's folder would be outside the output folder",
|
|
30
|
+
};
|
|
31
|
+
/** Reported or thrown when a tool's name is refused. Nothing is forged or written for the refused name. */
|
|
32
|
+
export class InvalidToolNameError extends Error {
|
|
33
|
+
/**
|
|
34
|
+
* @param problem - The part of the name rule the name breaks.
|
|
35
|
+
* @param name - The refused name. The message shows at most its first 64 characters, escaped.
|
|
36
|
+
*/
|
|
37
|
+
constructor(problem, name) {
|
|
38
|
+
super(`tool name ${describeRefusedName(name)} refused: ${RULE_BROKEN[problem]}`);
|
|
39
|
+
this.problem = problem;
|
|
40
|
+
/** A stable code for callers that branch on the kind of failure. */
|
|
41
|
+
this.code = 'INVALID_TOOL_NAME';
|
|
42
|
+
this.name = 'InvalidToolNameError';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The part of the forge's name rule `name` breaks, or null when a tool may be forged under it. The name is held to
|
|
47
|
+
* the rule every name built from data meets, then to {@link IDENTIFIER_PATTERN}. A name the forge accepts is
|
|
48
|
+
* therefore one the skill exporter accepts.
|
|
49
|
+
*
|
|
50
|
+
* @param name - The name a forge request gives the tool.
|
|
51
|
+
*/
|
|
52
|
+
export function forgedToolNameProblem(name) {
|
|
53
|
+
if (typeof name !== 'string')
|
|
54
|
+
return 'type';
|
|
55
|
+
return pathNameProblem(name) ?? (IDENTIFIER_PATTERN.test(name) ? null : 'identifier');
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The folder that a tool named `name` is exported to under `outputDir`, resolved. The name is held to the rule
|
|
59
|
+
* every name built from data meets. Then the resolved folder must lie inside the resolved output folder, a second
|
|
60
|
+
* guard should a platform's path rules ever place the folder of an accepted name elsewhere.
|
|
61
|
+
*
|
|
62
|
+
* @param outputDir - The folder the tool's own folder is made in.
|
|
63
|
+
* @param name - The tool's name.
|
|
64
|
+
* @param paths - The path functions to resolve with: the platform's by default, `path.win32` or `path.posix` to pick one.
|
|
65
|
+
* @returns The absolute path of the tool's folder.
|
|
66
|
+
* @throws InvalidToolNameError when the name is refused or its folder would be outside `outputDir`.
|
|
67
|
+
*/
|
|
68
|
+
export function resolveToolFolder(outputDir, name, paths = path) {
|
|
69
|
+
if (typeof name !== 'string')
|
|
70
|
+
throw new InvalidToolNameError('type', name);
|
|
71
|
+
const problem = pathNameProblem(name);
|
|
72
|
+
if (problem)
|
|
73
|
+
throw new InvalidToolNameError(problem, name);
|
|
74
|
+
const folder = resolveInsideFolder(outputDir, [name], paths);
|
|
75
|
+
if (folder === null)
|
|
76
|
+
throw new InvalidToolNameError('outside', name);
|
|
77
|
+
return folder;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=ToolName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolName.js","sourceRoot":"","sources":["../../../src/cognition/emergent/ToolName.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,GAEpB,MAAM,8BAA8B,CAAC;AAEtC;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,0BAA0B,CAAC;AAe7D,+EAA+E;AAC/E,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,yBAAyB;IAC/B,KAAK,EAAE,0BAA0B;IACjC,SAAS,EAAE,kGAAkG;IAC7G,GAAG,EAAE,uCAAuC;IAC5C,IAAI,EAAE,mEAAmE;IACzE,MAAM,EAAE,0BAA0B,mBAAmB,iBAAiB;IACtE,UAAU,EAAE,kGAAkG;IAC9G,OAAO,EAAE,sDAAsD;CAChE,CAAC;AAEF,2GAA2G;AAC3G,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAI7C;;;OAGG;IACH,YACW,OAAwB,EACjC,IAAa;QAEb,KAAK,CAAC,aAAa,mBAAmB,CAAC,IAAI,CAAC,aAAa,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAHxE,YAAO,GAAP,OAAO,CAAiB;QARnC,oEAAoE;QAC3D,SAAI,GAAG,mBAAmB,CAAC;QAWlC,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAa;IACjD,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC;IAC5C,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;AACxF,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAC/B,SAAiB,EACjB,IAAa,EACb,QAAoD,IAAI;IAExD,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,MAAM,IAAI,oBAAoB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC3E,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,OAAO;QAAE,MAAM,IAAI,oBAAoB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC3D,MAAM,MAAM,GAAG,mBAAmB,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IAC7D,IAAI,MAAM,KAAK,IAAI;QAAE,MAAM,IAAI,oBAAoB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACrE,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -35,7 +35,9 @@ export { EmergentCapabilityEngine } from './EmergentCapabilityEngine.js';
|
|
|
35
35
|
export type { EmergentCapabilityEngineDeps, EmergentExecutableTool, FailedToolLoad, LoadedToolOutcome, LoadPersistedToolsOptions, LoadPersistedToolsResult, } from './EmergentCapabilityEngine.js';
|
|
36
36
|
export { ForgeToolMetaTool } from './ForgeToolMetaTool.js';
|
|
37
37
|
export type { ForgeToolInput } from './ForgeToolMetaTool.js';
|
|
38
|
-
export { exportToolAsSkill, buildCapabilityYaml, writeSkillFile, exportToolAsSkillPack, } from './SkillExporter.js';
|
|
38
|
+
export { exportToolAsSkill, buildCapabilityYaml, writeSkillFile, exportToolAsSkillPack, SkillExportRefusedError, } from './SkillExporter.js';
|
|
39
|
+
export { InvalidToolNameError } from './ToolName.js';
|
|
40
|
+
export type { ToolNameProblem } from './ToolName.js';
|
|
39
41
|
export { AdaptPersonalityTool } from './AdaptPersonalityTool.js';
|
|
40
42
|
export { ManageSkillsTool } from './ManageSkillsTool.js';
|
|
41
43
|
export { CreateWorkflowTool } from './CreateWorkflowTool.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cognition/emergent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,KAAK,qBAAqB,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AACzG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAClH,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAC1G,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACrG,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5G,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChI,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACt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,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,KAAK,UAAU,GAChB,MAAM,2BAA2B,CAAC;AAInC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EACV,SAAS,EACT,aAAa,EACb,WAAW,GACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EACV,wBAAwB,EACxB,YAAY,EACZ,iBAAiB,GAClB,MAAM,yBAAyB,CAAC"}
|
|
@@ -25,7 +25,8 @@ export { EMERGENT_TOOL_PACKAGE_SCHEMA_VERSION, buildEmergentToolPackage, seriali
|
|
|
25
25
|
export { EmergentJudge } from './EmergentJudge.js';
|
|
26
26
|
export { EmergentCapabilityEngine } from './EmergentCapabilityEngine.js';
|
|
27
27
|
export { ForgeToolMetaTool } from './ForgeToolMetaTool.js';
|
|
28
|
-
export { exportToolAsSkill, buildCapabilityYaml, writeSkillFile, exportToolAsSkillPack, } from './SkillExporter.js';
|
|
28
|
+
export { exportToolAsSkill, buildCapabilityYaml, writeSkillFile, exportToolAsSkillPack, SkillExportRefusedError, } from './SkillExporter.js';
|
|
29
|
+
export { InvalidToolNameError } from './ToolName.js';
|
|
29
30
|
export { AdaptPersonalityTool } from './AdaptPersonalityTool.js';
|
|
30
31
|
export { ManageSkillsTool } from './ManageSkillsTool.js';
|
|
31
32
|
export { CreateWorkflowTool } from './CreateWorkflowTool.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cognition/emergent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,YAAY,CAAC;AAC3B,OAAO,EAA8B,+BAA+B,EAAE,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EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAIzE,qEAAqE;AACrE,wEAAwE;AACxE,mEAAmE;AACnE,eAAe;AACf,OAAO,EACL,sBAAsB,GAEvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kBAAkB,GAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,wBAAwB,GAEzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,aAAa,GAId,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,eAAe,GAEhB,MAAM,2BAA2B,CAAC;AAEnC,oEAAoE;AACpE,0EAA0E;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAM7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -13,11 +13,14 @@
|
|
|
13
13
|
* to the name rule in `core/utils/pathName` before anything is written, and the
|
|
14
14
|
* file's resolved path must lie inside the export folder. Below the export
|
|
15
15
|
* folder no folder or file is made or written through a link, symbolic or
|
|
16
|
-
* hard, and
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
16
|
+
* hard, and nothing but a regular file is written, a named pipe at a file's
|
|
17
|
+
* place refused at once, never waited on (`core/utils/linkFreeWrite`). Two
|
|
18
|
+
* traces whose files would be one, where names ignore case or by the file
|
|
19
|
+
* system's own reckoning, are not both written. A trace that fails any of these is left
|
|
20
|
+
* out and reported in the export's result. The checks run as each folder is
|
|
21
|
+
* made and each file opened; Node has no `openat`, so a process that swaps a
|
|
22
|
+
* folder below the export folder for a link while the export runs is outside
|
|
23
|
+
* what they stop.
|
|
21
24
|
*
|
|
22
25
|
* ## Folder layout
|
|
23
26
|
* ```
|
|
@@ -47,6 +50,11 @@ interface TraceRow {
|
|
|
47
50
|
created_at: number;
|
|
48
51
|
tags: string;
|
|
49
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* The most trace files one export holds open at once. The files are opened, checked and written a batch of this many
|
|
55
|
+
* at a time, in export order, so a large export does not run out of file descriptors.
|
|
56
|
+
*/
|
|
57
|
+
export declare const MAX_OPEN_TRACE_FILES = 64;
|
|
50
58
|
/**
|
|
51
59
|
* Exports memory traces as Markdown files with YAML front-matter.
|
|
52
60
|
*
|
|
@@ -69,13 +77,19 @@ export declare class MarkdownExporter {
|
|
|
69
77
|
* written, and is reported in the result, when its scope, type or id is not
|
|
70
78
|
* a safe file or folder name, when its file would lie outside `outputDir`,
|
|
71
79
|
* when a folder or file in its place under `outputDir` is a symbolic link or
|
|
72
|
-
* its file has a second name (a hard link),
|
|
73
|
-
*
|
|
80
|
+
* its file has a second name (a hard link), when something other than a
|
|
81
|
+
* regular file holds its file's place (a folder, a named pipe, a socket, a
|
|
82
|
+
* device), or when an older trace's file is the same file, where names
|
|
83
|
+
* ignore case or by the file system's own reckoning. Every other trace is
|
|
84
|
+
* written. At most {@link MAX_OPEN_TRACE_FILES} files are open at once.
|
|
74
85
|
*
|
|
75
86
|
* @param outputDir - Root directory to write the Markdown vault into.
|
|
76
87
|
* @param _options - Optional export configuration (currently unused but
|
|
77
88
|
* accepted for API consistency with other exporters).
|
|
78
89
|
* @returns The traces left out, with the reason for each.
|
|
90
|
+
* @throws The first error met opening or writing a file for a reason other
|
|
91
|
+
* than the refusals above, such as a full disk, once every other trace has
|
|
92
|
+
* been tried.
|
|
79
93
|
*/
|
|
80
94
|
export(outputDir: string, _options?: ExportOptions): Promise<ExportResult>;
|
|
81
95
|
/**
|
|
@@ -112,18 +126,14 @@ export declare class MarkdownExporter {
|
|
|
112
126
|
*/
|
|
113
127
|
private _placeTrace;
|
|
114
128
|
/**
|
|
115
|
-
* Write a
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
* there since. A file with a second name (a hard link) is the same file as
|
|
119
|
-
* that name, which may be outside the export folder, so the open file is
|
|
120
|
-
* refused before it is emptied.
|
|
129
|
+
* Write a trace into its file, opened and checked by `openFileOutsideLinks`
|
|
130
|
+
* and claimed for this trace alone: the content is built, then the file is
|
|
131
|
+
* emptied and written.
|
|
121
132
|
*
|
|
122
|
-
* @param
|
|
123
|
-
* @param trace
|
|
124
|
-
* @returns The refusal when a link holds the file's place, or null once the file is written.
|
|
133
|
+
* @param handle - The trace's open file.
|
|
134
|
+
* @param trace - Trace row to serialise.
|
|
125
135
|
*/
|
|
126
|
-
private
|
|
136
|
+
private _fillTrace;
|
|
127
137
|
}
|
|
128
138
|
export {};
|
|
129
139
|
//# sourceMappingURL=MarkdownExporter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownExporter.d.ts","sourceRoot":"","sources":["../../../../src/cognition/memory/io/MarkdownExporter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"MarkdownExporter.d.ts","sourceRoot":"","sources":["../../../../src/cognition/memory/io/MarkdownExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAsB,MAAM,mBAAmB,CAAC;AACzF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AASzD,oDAAoD;AACpD,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAKD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAiBvC;;;;;;;;GAQG;AACH,qBAAa,gBAAgB;IAIf,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK;IAH3C;;OAEG;gBAC4B,KAAK,EAAE,KAAK;IAM3C;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAyGhF;;;;;;;;OAQG;IACH,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM;IAoBnD;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM;IAQpD;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW;IAWnB;;;;;;;OAOG;YACW,UAAU;CAKzB"}
|