@dot-agent/compiler 0.10.0 → 0.10.2

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.
@@ -0,0 +1,66 @@
1
+ import { A as PackOptions, C as Capability, D as LangId, E as Integrity, F as StateDef, I as Statement, L as TriggerDecl, M as ParseDiagnostic, N as PropertyDecl, O as LintMessage, P as PropertyType, R as TypeDefinition, S as BuildAboutmeOptions, T as IdParts, _ as AgentBundle, a as createZip, b as AnnotatedRef, d as extractName, f as parseId, g as AboutMe, h as parseAboutme, i as isInContentNamespace, j as PackResult, k as OntologyRef, l as buildId, m as buildAboutme, n as ContentNamespace, o as extractFiles, p as aboutmeToJson, r as classifyContentPath, t as CONTENT_NAMESPACES, u as extractDigest, v as AgentDecl, w as DescriptionFile, x as BehaviorFile, y as AgentFiles } from "./namespace-DsoVSANe.mjs";
2
+ import { Node, Tree } from "web-tree-sitter";
3
+ import JSZip from "jszip";
4
+ //#region src/parser.d.ts
5
+ declare function initBehaviorParser(): Promise<void>;
6
+ interface ParseResult<T> {
7
+ ok: T | null;
8
+ diagnostics: ParseDiagnostic[];
9
+ }
10
+ declare function parseBehaviorFile(text: string): ParseResult<BehaviorFile>;
11
+ declare function parseDescriptionFile(text: string): ParseResult<DescriptionFile>;
12
+ declare function getBehaviorScxml(text: string): string;
13
+ declare function initParsers(): Promise<void>;
14
+ /**
15
+ * Parse source text and return a tree-sitter Tree.
16
+ *
17
+ * @param langId - 'description' or 'behavior'
18
+ * @param text - source text to parse
19
+ * @param previousTree - optional previous tree for incremental parsing (LSP use)
20
+ */
21
+ declare function parse(langId: LangId, text: string, previousTree?: Tree): Promise<Tree>;
22
+ /** Parse without initializing if parsers are already ready. Returns null if not initialized. */
23
+ declare function parseSync(langId: LangId, text: string, previousTree?: Tree): Tree | null;
24
+ declare function nodesOfType(tree: Tree, type: string): Node[];
25
+ declare function nodeAtOffset(tree: Tree, offset: number): Node | null;
26
+ declare function nodeToRange(node: Node): {
27
+ start: {
28
+ line: number;
29
+ character: number;
30
+ };
31
+ end: {
32
+ line: number;
33
+ character: number;
34
+ };
35
+ };
36
+ declare function positionToOffset(text: string, line: number, character: number): number;
37
+ declare function getContextNode(tree: Tree, offset: number): Node;
38
+ //#endregion
39
+ //#region src/linter.d.ts
40
+ declare function lintDescription(text: string, file?: string): Promise<LintMessage[]>;
41
+ declare function lintBehavior(text: string, file?: string, docPath?: string, consolidated?: boolean, externalStates?: Set<string>, mergedText?: string): Promise<LintMessage[]>;
42
+ declare function createLinter(): Promise<{
43
+ lintDescription: typeof lintDescription;
44
+ lintBehavior: typeof lintBehavior;
45
+ }>;
46
+ //#endregion
47
+ //#region src/zip.d.ts
48
+ declare function readZip(filePath: string): Promise<JSZip>;
49
+ declare function validateZipBomb(filePath: string): Promise<boolean>;
50
+ declare function validateMagicBytes(filePath: string): Promise<boolean>;
51
+ declare function writeZip(zip: JSZip, outPath: string): Promise<void>;
52
+ //#endregion
53
+ //#region src/pack.d.ts
54
+ interface ConsolidateResult {
55
+ mergedText: string;
56
+ mergeSources: string[];
57
+ }
58
+ declare function consolidate(agentRoot: string, entryFile: string): Promise<ConsolidateResult>;
59
+ declare function collectFiles(dir: string, descriptionFile: string, mergedBehaviorText: string, mergeSources: string[], personaFile?: string): Promise<Map<string, string>>;
60
+ declare function pack(options?: PackOptions): Promise<PackResult>;
61
+ //#endregion
62
+ //#region src/bundle.d.ts
63
+ declare function bundleFromDir(dir: string): Promise<AgentBundle>;
64
+ //#endregion
65
+ export { type AboutMe, type AgentBundle, type AgentDecl, type AgentFiles, type AnnotatedRef, type BehaviorFile, type BuildAboutmeOptions, CONTENT_NAMESPACES, type Capability, type ContentNamespace, type DescriptionFile, type IdParts, type Integrity, type LangId, type LintMessage, type OntologyRef, type PackOptions, type PackResult, type PropertyDecl, type PropertyType, type StateDef, type Statement, type TriggerDecl, type TypeDefinition, aboutmeToJson, buildAboutme, buildId, bundleFromDir, classifyContentPath, collectFiles, consolidate, createLinter, createZip, extractDigest, extractFiles, extractName, getBehaviorScxml, getContextNode, initBehaviorParser, initParsers, isInContentNamespace, lintBehavior, lintDescription, nodeAtOffset, nodeToRange, nodesOfType, pack, parse, parseAboutme, parseBehaviorFile, parseDescriptionFile, parseId, parseSync, positionToOffset, readZip, validateMagicBytes, validateZipBomb, writeZip };
66
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/parser.ts","../src/linter.ts","../src/zip.ts","../src/pack.ts","../src/bundle.ts"],"mappings":";;;;iBAyBsB,sBAAsB;UAM3B,YAAY;EAC3B,IAAI;EACJ,aAAa;;iBAGC,kBAAkB,eAAe,YAAY;iBAI7C,qBAAqB,eAAe,YAAY;iBAIhD,iBAAiB;iBAIX,eAAe;;;;;;;;iBAmBf,MACpB,QAAQ,QACR,cACA,eAAe,OACd,QAAQ;;iBAOK,UAAU,QAAQ,QAAQ,cAAc,eAAe,OAAO;iBAQ9D,YAAY,MAAM,MAAM,eAAe;iBAKvC,aAAa,MAAM,MAAM,iBAAiB;iBAK1C,YAAY,MAAM;EAChC;IAAS;IAAc;;EACvB;IAAO;IAAc;;;iBAQP,iBAAiB,cAAc,cAAc;iBAS7C,eAAe,MAAM,MAAM,iBAAiB;;;iBCtCtC,gBAAgB,cAAc,gBAA6B,QAAQ;iBAqKnE,aACpB,cACA,eACA,kBACA,wBACA,iBAAiB,aACjB,sBACC,QAAQ;iBAgUW,gBAAY;;;;;;iBCniBZ,QAAQ,mBAAmB,QAAQ;iBAKnC,gBAAgB,mBAAmB;iBAOnC,mBAAmB,mBAAmB;iBAMtC,SAAS,KAAK,OAAO,kBAAkB;;;UC6HnD;EACR;EACA;;iBAGoB,YAAY,mBAAmB,oBAAoB,QAAQ;iBAoN3D,aACpB,aACA,yBACA,4BACA,wBACA,uBACC,QAAQ;iBAiFW,KAAK,UAAS,cAAmB,QAAQ;;;iBCjczC,cAAc,cAAc,QAAQ"}