@cotal-ai/connector-core 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/agent.d.ts +4 -2
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +29 -3
- package/dist/agent.js.map +1 -1
- package/dist/config.d.ts +13 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +33 -0
- package/dist/config.js.map +1 -1
- package/dist/docs-bundle.generated.d.ts +3 -0
- package/dist/docs-bundle.generated.d.ts.map +1 -0
- package/dist/docs-bundle.generated.js +218 -0
- package/dist/docs-bundle.generated.js.map +1 -0
- package/dist/docs.d.ts +53 -0
- package/dist/docs.d.ts.map +1 -0
- package/dist/docs.js +269 -0
- package/dist/docs.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/launch.d.ts +24 -0
- package/dist/launch.d.ts.map +1 -1
- package/dist/launch.js +46 -0
- package/dist/launch.js.map +1 -1
- package/dist/orientation.d.ts +1 -0
- package/dist/orientation.d.ts.map +1 -1
- package/dist/orientation.js +4 -1
- package/dist/orientation.js.map +1 -1
- package/dist/tool-specs.d.ts.map +1 -1
- package/dist/tool-specs.js +64 -21
- package/dist/tool-specs.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-bundle.generated.js","sourceRoot":"","sources":["../src/docs-bundle.generated.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,WAAW,GAAe;IACrC,SAAS,EAAE,QAAQ;IACnB,eAAe,EAAE,8CAA8C;IAC/D,OAAO,EAAE;QACP;YACE,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,eAAe;YACxB,MAAM,EAAE,0BAA0B;YAClC,SAAS,EAAE,+FAA+F;YAC1G,MAAM,EAAE,y3IAAy3I;SACl4I;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YAC5B,MAAM,EAAE,uBAAuB;YAC/B,SAAS,EAAE,2DAA2D;YACtE,MAAM,EAAE,+zKAA+zK;SACx0K;QACD;YACE,MAAM,EAAE,WAAW;YACnB,OAAO,EAAE,uBAAuB;YAChC,MAAM,EAAE,uBAAuB;YAC/B,SAAS,EAAE,kGAAkG;YAC7G,MAAM,EAAE,2yMAA2yM;SACpzM;QACD;YACE,MAAM,EAAE,cAAc;YACtB,OAAO,EAAE,cAAc;YACvB,MAAM,EAAE,qBAAqB;YAC7B,SAAS,EAAE,uHAAuH;YAClI,MAAM,EAAE,s6OAAs6O;SAC/6O;KACF;IACD,MAAM,EAAE;QACN,OAAO,EAAE,0BAA0B;QACnC,MAAM,EAAE,2xjEAA2xjE;KACpyjE;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,oCAAoC;QAC7C,MAAM,EAAE,ugRAAugR;KAChhR;CACF,CAAC"}
|
package/dist/docs.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ToolResult } from "./tool-specs.js";
|
|
2
|
+
export interface DocsPage {
|
|
3
|
+
/** URL-ish key, e.g. "architecture". Also the argument an agent passes as `page`. */
|
|
4
|
+
slug: string;
|
|
5
|
+
title: string;
|
|
6
|
+
/** The page's classification line, e.g. "Concept (informative)" or "Reference"; "" if none. */
|
|
7
|
+
kind: string;
|
|
8
|
+
/** One-line summary for the index. */
|
|
9
|
+
summary: string;
|
|
10
|
+
/** Full Markdown. */
|
|
11
|
+
body: string;
|
|
12
|
+
}
|
|
13
|
+
export interface DocsBundle {
|
|
14
|
+
/** The installed Cotal version these docs are exact for, e.g. "0.10.1". */
|
|
15
|
+
version: string;
|
|
16
|
+
generatedFrom: string;
|
|
17
|
+
pages: DocsPage[];
|
|
18
|
+
/** The normative wire contract (SPEC.md). Reachable as page "spec". */
|
|
19
|
+
spec: {
|
|
20
|
+
title: string;
|
|
21
|
+
body: string;
|
|
22
|
+
};
|
|
23
|
+
/** The machine-readable message schema (JSON). Reachable as page "schema". */
|
|
24
|
+
schema: {
|
|
25
|
+
title: string;
|
|
26
|
+
body: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/** The installed Cotal version, for stamping the orientation card and other surfaces. */
|
|
30
|
+
export declare const DOCS_VERSION: string;
|
|
31
|
+
/** The index: version banner + every page (slug · kind · summary) + spec/schema + how to
|
|
32
|
+
* go deeper. Cheap orientation an agent reads before answering anything about Cotal. */
|
|
33
|
+
export declare function renderDocsIndex(): string;
|
|
34
|
+
export interface DocHit {
|
|
35
|
+
/** Page slug to fetch in full via cotal_docs(page: slug). */
|
|
36
|
+
slug: string;
|
|
37
|
+
pageTitle: string;
|
|
38
|
+
heading: string;
|
|
39
|
+
/** The matching section's Markdown. */
|
|
40
|
+
text: string;
|
|
41
|
+
score: number;
|
|
42
|
+
}
|
|
43
|
+
/** BM25 search over heading-aware sections. Returns the best-matching sections (at most two per
|
|
44
|
+
* page, for diversity), each with a pointer to read the full page. Offline; no embeddings. */
|
|
45
|
+
export declare function searchDocs(query: string, limit?: number): DocHit[];
|
|
46
|
+
export interface DocsArgs {
|
|
47
|
+
page?: string;
|
|
48
|
+
query?: string;
|
|
49
|
+
refresh?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/** The `cotal_docs` tool body. Pure over the bundle except for the opt-in remote refresh. */
|
|
52
|
+
export declare function runDocs(args: DocsArgs): Promise<ToolResult>;
|
|
53
|
+
//# sourceMappingURL=docs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,WAAW,QAAQ;IACvB,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,+FAA+F;IAC/F,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACzB,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,uEAAuE;IACvE,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,8EAA8E;IAC9E,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACzC;AAED,yFAAyF;AACzF,eAAO,MAAM,YAAY,QAAsB,CAAC;AAqBhD;yFACyF;AACzF,wBAAgB,eAAe,IAAI,MAAM,CAuBxC;AA4GD,MAAM,WAAW,MAAM;IACrB,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;+FAC+F;AAC/F,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,MAAM,EAAE,CAiC7D;AAoDD,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,6FAA6F;AAC7F,wBAAsB,OAAO,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAiCjE"}
|
package/dist/docs.js
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cotal_docs` — the version-exact Cotal knowledge base an agent reads so it is never wrong
|
|
3
|
+
* about Cotal.
|
|
4
|
+
*
|
|
5
|
+
* The docs ship INSIDE the connector as a generated bundle ({@link DOCS_BUNDLE}), built at
|
|
6
|
+
* release time from /docs, /SPEC.md and the message schema and stamped with the installed
|
|
7
|
+
* version. That makes the baseline authoritative by construction: it matches the exact
|
|
8
|
+
* version running, works offline, and cannot drift newer or older than what's installed.
|
|
9
|
+
*
|
|
10
|
+
* `refresh: true` layers an OPTIONAL remote pass on top: it fetches the page from an IMMUTABLE
|
|
11
|
+
* version-pinned path on docs.cotal.ai (/v/<installed-version>/…), so a fetched body provably
|
|
12
|
+
* belongs to the installed version — there is nothing to skew against. When that path is absent
|
|
13
|
+
* (version-pinned docs aren't published yet) or unreachable, it falls back to the version-exact
|
|
14
|
+
* bundle. The tool always reports which source answered.
|
|
15
|
+
*/
|
|
16
|
+
import { DOCS_BUNDLE } from "./docs-bundle.generated.js";
|
|
17
|
+
/** The installed Cotal version, for stamping the orientation card and other surfaces. */
|
|
18
|
+
export const DOCS_VERSION = DOCS_BUNDLE.version;
|
|
19
|
+
const REMOTE_BASE = "https://docs.cotal.ai";
|
|
20
|
+
/** Resolve a `page` argument to a bundle entry. "spec"/"schema" are aliases for the two
|
|
21
|
+
* non-page docs; everything else matches a page slug (case-insensitive). */
|
|
22
|
+
function resolvePage(page) {
|
|
23
|
+
const key = page.trim().toLowerCase().replace(/\.md$/, "");
|
|
24
|
+
if (key === "spec")
|
|
25
|
+
return { slug: "spec", title: DOCS_BUNDLE.spec.title, kind: "normative", summary: "", body: DOCS_BUNDLE.spec.body };
|
|
26
|
+
if (key === "schema")
|
|
27
|
+
return { slug: "schema", title: DOCS_BUNDLE.schema.title, kind: "reference", summary: "", body: DOCS_BUNDLE.schema.body };
|
|
28
|
+
return DOCS_BUNDLE.pages.find((p) => p.slug === key);
|
|
29
|
+
}
|
|
30
|
+
/** Map a resolved slug to an IMMUTABLE, version-pinned URL on docs.cotal.ai. Pinning the version
|
|
31
|
+
* into the path is what makes a fetched body provably belong to the installed version. */
|
|
32
|
+
function remoteUrl(slug) {
|
|
33
|
+
const base = `${REMOTE_BASE}/v/${DOCS_BUNDLE.version}`;
|
|
34
|
+
if (slug === "schema")
|
|
35
|
+
return `${base}/cotal.schema.json`;
|
|
36
|
+
return `${base}/${slug}.md`;
|
|
37
|
+
}
|
|
38
|
+
/** The index: version banner + every page (slug · kind · summary) + spec/schema + how to
|
|
39
|
+
* go deeper. Cheap orientation an agent reads before answering anything about Cotal. */
|
|
40
|
+
export function renderDocsIndex() {
|
|
41
|
+
const rows = DOCS_BUNDLE.pages.map((p) => {
|
|
42
|
+
const kind = p.kind ? ` — ${p.kind}` : "";
|
|
43
|
+
return `- \`${p.slug}\`${kind}\n ${p.summary}`;
|
|
44
|
+
});
|
|
45
|
+
return [
|
|
46
|
+
`# Cotal v${DOCS_BUNDLE.version} — documentation`,
|
|
47
|
+
"",
|
|
48
|
+
"The authoritative docs for the exact version installed here. This is the index — it lists what",
|
|
49
|
+
"exists; it holds no answers itself. Your next call:",
|
|
50
|
+
'- Know the page? Read it in full: `cotal_docs(page: "<slug>")` (e.g. "spec", "architecture").',
|
|
51
|
+
'- Not sure which page? Search: `cotal_docs(query: "…")` returns the most relevant sections.',
|
|
52
|
+
"Prefer these docs over training memory, and read the full page before writing code or wire",
|
|
53
|
+
"frames. Docs are bundled and version-exact; add `refresh: true` to also pull any patches",
|
|
54
|
+
"published to docs.cotal.ai for this same version.",
|
|
55
|
+
"",
|
|
56
|
+
"## The normative sources",
|
|
57
|
+
`- \`spec\` — ${DOCS_BUNDLE.spec.title} (the wire contract; where a page disagrees, the spec wins)`,
|
|
58
|
+
`- \`schema\` — ${DOCS_BUNDLE.schema.title} (authoritative for message shapes)`,
|
|
59
|
+
"",
|
|
60
|
+
"## Pages",
|
|
61
|
+
...rows,
|
|
62
|
+
].join("\n");
|
|
63
|
+
}
|
|
64
|
+
/** Render one page for the model. `note` (e.g. the remote-source line) is prepended so the
|
|
65
|
+
* agent always sees where the text came from. */
|
|
66
|
+
function renderPage(p, note) {
|
|
67
|
+
return `${note}\n\n${p.body}`.trimStart();
|
|
68
|
+
}
|
|
69
|
+
/** Keep identifiers and subjects whole: `cotal_send`, `$SYS.ACCOUNT`, `#general`, `allowSubscribe`. */
|
|
70
|
+
const TOKEN = /[a-z0-9_$.#>*-]+/gi;
|
|
71
|
+
/** Trailing/leading subject-wildcard and punctuation noise: `$SYS.>` → `$SYS`, `team.*` → `team`. */
|
|
72
|
+
const EDGE = /^[.>*#-]+|[.>*#-]+$/g;
|
|
73
|
+
function tokenize(s) {
|
|
74
|
+
const raw = s.toLowerCase().match(TOKEN);
|
|
75
|
+
if (!raw)
|
|
76
|
+
return [];
|
|
77
|
+
const out = [];
|
|
78
|
+
for (const r of raw) {
|
|
79
|
+
// The raw form first, so an exact wildcard/identifier match (`team.>`, `cotal_send`) keeps
|
|
80
|
+
// its full weight and out-scores a mere base-subject match.
|
|
81
|
+
if (r.length >= 2)
|
|
82
|
+
out.push(r);
|
|
83
|
+
// The wildcard-stripped base, so `$SYS.>` still finds the section documenting `$SYS`.
|
|
84
|
+
const t = r.replace(EDGE, "");
|
|
85
|
+
if (t.length >= 2 && t !== r)
|
|
86
|
+
out.push(t);
|
|
87
|
+
// Dotted segments, so `cotal.schema.json` matches a `schema` query.
|
|
88
|
+
if (t.includes("."))
|
|
89
|
+
for (const seg of t.split("."))
|
|
90
|
+
if (seg.length >= 2)
|
|
91
|
+
out.push(seg);
|
|
92
|
+
}
|
|
93
|
+
return out;
|
|
94
|
+
}
|
|
95
|
+
// Query-side stopwords only (the corpus keeps everything so IDF stays honest).
|
|
96
|
+
const STOP = new Set("a an and are as at be by do for from has how in is it of on or that the this to use using was what when where which who with you your".split(" "));
|
|
97
|
+
function sectionsOf(slug, pageTitle, body) {
|
|
98
|
+
const out = [];
|
|
99
|
+
let heading = pageTitle;
|
|
100
|
+
let buf = [];
|
|
101
|
+
const flush = () => {
|
|
102
|
+
const text = buf.join("\n").trim();
|
|
103
|
+
if (text) {
|
|
104
|
+
const tokens = [
|
|
105
|
+
...tokenize(pageTitle), ...tokenize(pageTitle), ...tokenize(pageTitle), // title ×3
|
|
106
|
+
...tokenize(heading), ...tokenize(heading), // heading ×2
|
|
107
|
+
...tokenize(text),
|
|
108
|
+
];
|
|
109
|
+
out.push({ slug, pageTitle, heading, text, tokens, len: tokens.length });
|
|
110
|
+
}
|
|
111
|
+
buf = [];
|
|
112
|
+
};
|
|
113
|
+
let inFence = false;
|
|
114
|
+
for (const line of body.split("\n")) {
|
|
115
|
+
if (line.trimStart().startsWith("```"))
|
|
116
|
+
inFence = !inFence;
|
|
117
|
+
const h = inFence ? null : line.match(/^#{2,6}\s+(.+?)\s*$/);
|
|
118
|
+
if (h) {
|
|
119
|
+
flush();
|
|
120
|
+
heading = `${pageTitle} › ${h[1].trim()}`;
|
|
121
|
+
}
|
|
122
|
+
buf.push(line);
|
|
123
|
+
}
|
|
124
|
+
flush();
|
|
125
|
+
return out;
|
|
126
|
+
}
|
|
127
|
+
const K1 = 1.2;
|
|
128
|
+
const B = 0.75;
|
|
129
|
+
function buildIndex() {
|
|
130
|
+
const sections = [];
|
|
131
|
+
for (const p of DOCS_BUNDLE.pages)
|
|
132
|
+
sections.push(...sectionsOf(p.slug, p.title, p.body));
|
|
133
|
+
sections.push(...sectionsOf("spec", DOCS_BUNDLE.spec.title, DOCS_BUNDLE.spec.body));
|
|
134
|
+
// The schema is JSON (no Markdown headings) — index it as a single section.
|
|
135
|
+
const sTok = [...tokenize(DOCS_BUNDLE.schema.title), ...tokenize(DOCS_BUNDLE.schema.title), ...tokenize(DOCS_BUNDLE.schema.body)];
|
|
136
|
+
sections.push({ slug: "schema", pageTitle: DOCS_BUNDLE.schema.title, heading: DOCS_BUNDLE.schema.title, text: DOCS_BUNDLE.schema.body, tokens: sTok, len: sTok.length });
|
|
137
|
+
const df = new Map();
|
|
138
|
+
let total = 0;
|
|
139
|
+
for (const s of sections) {
|
|
140
|
+
total += s.len;
|
|
141
|
+
for (const t of new Set(s.tokens))
|
|
142
|
+
df.set(t, (df.get(t) ?? 0) + 1);
|
|
143
|
+
}
|
|
144
|
+
return { sections, df, avgdl: total / Math.max(1, sections.length) };
|
|
145
|
+
}
|
|
146
|
+
// Built once at import: the bundle is static, so the section index is too.
|
|
147
|
+
const INDEX = buildIndex();
|
|
148
|
+
/** BM25 search over heading-aware sections. Returns the best-matching sections (at most two per
|
|
149
|
+
* page, for diversity), each with a pointer to read the full page. Offline; no embeddings. */
|
|
150
|
+
export function searchDocs(query, limit = 5) {
|
|
151
|
+
let terms = tokenize(query).filter((t) => !STOP.has(t));
|
|
152
|
+
if (!terms.length)
|
|
153
|
+
terms = tokenize(query); // all-stopword query → keep the raw terms
|
|
154
|
+
const termSet = new Set(terms);
|
|
155
|
+
if (!termSet.size)
|
|
156
|
+
return [];
|
|
157
|
+
const N = INDEX.sections.length;
|
|
158
|
+
const scored = [];
|
|
159
|
+
for (const s of INDEX.sections) {
|
|
160
|
+
const tf = new Map();
|
|
161
|
+
for (const t of s.tokens)
|
|
162
|
+
if (termSet.has(t))
|
|
163
|
+
tf.set(t, (tf.get(t) ?? 0) + 1);
|
|
164
|
+
let score = 0;
|
|
165
|
+
for (const t of termSet) {
|
|
166
|
+
const f = tf.get(t) ?? 0;
|
|
167
|
+
if (!f)
|
|
168
|
+
continue;
|
|
169
|
+
const n = INDEX.df.get(t) ?? 0;
|
|
170
|
+
const idf = Math.log(1 + (N - n + 0.5) / (n + 0.5));
|
|
171
|
+
score += idf * ((f * (K1 + 1)) / (f + K1 * (1 - B + (B * s.len) / INDEX.avgdl)));
|
|
172
|
+
}
|
|
173
|
+
if (score > 0)
|
|
174
|
+
scored.push({ s, score });
|
|
175
|
+
}
|
|
176
|
+
scored.sort((a, b) => b.score - a.score);
|
|
177
|
+
const perPage = new Map();
|
|
178
|
+
const hits = [];
|
|
179
|
+
for (const { s, score } of scored) {
|
|
180
|
+
const seen = perPage.get(s.slug) ?? 0;
|
|
181
|
+
if (seen >= 2)
|
|
182
|
+
continue; // don't let one page crowd out the rest
|
|
183
|
+
perPage.set(s.slug, seen + 1);
|
|
184
|
+
hits.push({ slug: s.slug, pageTitle: s.pageTitle, heading: s.heading, text: s.text, score });
|
|
185
|
+
if (hits.length >= limit)
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
return hits;
|
|
189
|
+
}
|
|
190
|
+
/** Cap a section so a single long match can't blow the context; the pointer covers the rest. */
|
|
191
|
+
function capSection(text, maxLines = 48) {
|
|
192
|
+
const lines = text.split("\n");
|
|
193
|
+
if (lines.length <= maxLines)
|
|
194
|
+
return text.trim();
|
|
195
|
+
return lines.slice(0, maxLines).join("\n").trimEnd() + "\n\n… (section continues — read the full page)";
|
|
196
|
+
}
|
|
197
|
+
function renderSearch(query, hits) {
|
|
198
|
+
if (!hits.length) {
|
|
199
|
+
return `No matches for "${query}" in the Cotal v${DOCS_BUNDLE.version} docs. Call cotal_docs() for the page index, or search an exact identifier (a subject, a cotal_* tool, a field name).`;
|
|
200
|
+
}
|
|
201
|
+
const blocks = hits.map((h) => `## ${h.heading}\n${capSection(h.text)}\n\n→ read the full page: cotal_docs(page: "${h.slug}")`);
|
|
202
|
+
return [
|
|
203
|
+
`# Cotal v${DOCS_BUNDLE.version} docs — top matches for "${query}"`,
|
|
204
|
+
"The most relevant sections are below. Read the full page before writing code or wire frames.",
|
|
205
|
+
...blocks,
|
|
206
|
+
].join("\n\n");
|
|
207
|
+
}
|
|
208
|
+
async function remoteBody(slug) {
|
|
209
|
+
try {
|
|
210
|
+
const r = await fetch(remoteUrl(slug), { signal: AbortSignal.timeout(6000) });
|
|
211
|
+
if (!r.ok)
|
|
212
|
+
return null;
|
|
213
|
+
const text = await r.text();
|
|
214
|
+
return text.trim() ? text : null;
|
|
215
|
+
}
|
|
216
|
+
catch {
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Remote refresh for a page. It fetches the IMMUTABLE, version-pinned path
|
|
222
|
+
* (docs.cotal.ai/v/<installed-version>/…): a 200 body provably belongs to the installed
|
|
223
|
+
* version, so there is no separate version check to race or skew against. When that path is
|
|
224
|
+
* absent (version-pinned docs aren't published yet) or unreachable, it returns null and the
|
|
225
|
+
* caller serves the version-exact bundle. Fail-closed — an unverifiable remote is never served.
|
|
226
|
+
*/
|
|
227
|
+
async function refreshPage(slug) {
|
|
228
|
+
const body = await remoteBody(slug);
|
|
229
|
+
if (body === null) {
|
|
230
|
+
return {
|
|
231
|
+
body: null,
|
|
232
|
+
note: `(bundled v${DOCS_BUNDLE.version}; no version-pinned copy at docs.cotal.ai/v/${DOCS_BUNDLE.version} — showing bundled docs)`,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
return { body, note: `(refreshed from docs.cotal.ai — version-pinned copy for v${DOCS_BUNDLE.version})` };
|
|
236
|
+
}
|
|
237
|
+
/** The `cotal_docs` tool body. Pure over the bundle except for the opt-in remote refresh. */
|
|
238
|
+
export async function runDocs(args) {
|
|
239
|
+
const page = args.page?.trim();
|
|
240
|
+
const query = args.query?.trim();
|
|
241
|
+
if (page) {
|
|
242
|
+
const found = resolvePage(page);
|
|
243
|
+
if (!found) {
|
|
244
|
+
const names = DOCS_BUNDLE.pages.map((p) => p.slug).join(", ");
|
|
245
|
+
return {
|
|
246
|
+
text: `No Cotal doc page "${page}". Available: spec, schema, ${names}. Call cotal_docs() for the index.`,
|
|
247
|
+
isError: true,
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
let note = `(bundled v${DOCS_BUNDLE.version})`;
|
|
251
|
+
let body = found.body;
|
|
252
|
+
if (args.refresh) {
|
|
253
|
+
const r = await refreshPage(found.slug);
|
|
254
|
+
note = r.note;
|
|
255
|
+
if (r.body !== null)
|
|
256
|
+
body = r.body;
|
|
257
|
+
}
|
|
258
|
+
return { text: renderPage({ ...found, body }, note) };
|
|
259
|
+
}
|
|
260
|
+
// `refresh` only applies to reading a page; say so rather than silently ignore it, so an
|
|
261
|
+
// agent never believes a searched/indexed result was patched from the remote.
|
|
262
|
+
const refreshNote = args.refresh && !page
|
|
263
|
+
? "\n\n(note: `refresh` applies only when reading a page; the index and search use the bundled docs.)"
|
|
264
|
+
: "";
|
|
265
|
+
if (query)
|
|
266
|
+
return { text: renderSearch(query, searchDocs(query)) + refreshNote };
|
|
267
|
+
return { text: renderDocsIndex() + refreshNote };
|
|
268
|
+
}
|
|
269
|
+
//# sourceMappingURL=docs.js.map
|
package/dist/docs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AA0BzD,yFAAyF;AACzF,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC;AAEhD,MAAM,WAAW,GAAG,uBAAuB,CAAC;AAE5C;6EAC6E;AAC7E,SAAS,WAAW,CAAC,IAAY;IAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC3D,IAAI,GAAG,KAAK,MAAM;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACxI,IAAI,GAAG,KAAK,QAAQ;QAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAChJ,OAAO,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CA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,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
package/dist/launch.d.ts
CHANGED
|
@@ -48,6 +48,30 @@ export declare function aclEnv(opts: {
|
|
|
48
48
|
allowPublish?: string[];
|
|
49
49
|
capabilities?: string[];
|
|
50
50
|
}): Record<string, string>;
|
|
51
|
+
/** Validate a connector's opaque {@link LaunchOpts.launchOptions} bag and return its entries for the
|
|
52
|
+
* connector to render into its host form (CLI flags / config / env). This is a RAW passthrough: the
|
|
53
|
+
* connector forwards every option as-is. The trust boundary is the spawn capability itself — WHO may
|
|
54
|
+
* spawn (the caller's authenticated identity), not WHICH flags a spawn carries. An operator running
|
|
55
|
+
* `cotal spawn --opt` on their own host can already run the agent binary directly with any flag, so
|
|
56
|
+
* capping their flags is theater; a mesh peer's `cotal_spawn` is bounded by whether it holds the
|
|
57
|
+
* spawn capability at all. So no allow-list, no deny-list — the only check is a key-SHAPE guard for
|
|
58
|
+
* process integrity (see {@link LAUNCH_OPTION_KEY}, {@link UNSAFE_LAUNCH_OPTION_KEYS}): a key must
|
|
59
|
+
* name one flag / config field, never a prototype-polluting name or an `=`-embedding token that
|
|
60
|
+
* would corrupt the config object or garble a rendered flag. Core never sees this; each connector
|
|
61
|
+
* calls it for the surface IT renders. */
|
|
62
|
+
export declare function connectorLaunchOptions(connector: string, launchOptions: Record<string, unknown> | undefined): [string, unknown][];
|
|
63
|
+
/** USER-MODE launch identity as `COTAL_*` env, when present — the one place the LaunchOpts.userAuth
|
|
64
|
+
* → env mapping lives, so every connector forwards the identical contract configFromEnv parses.
|
|
65
|
+
* Refuses a creds+userAuth combination here (one launch, one identity plane — U10). */
|
|
66
|
+
export declare function userAuthEnv(opts: {
|
|
67
|
+
creds?: string;
|
|
68
|
+
userAuth?: {
|
|
69
|
+
owner: string;
|
|
70
|
+
actor: string;
|
|
71
|
+
sentinelCredsPath: string;
|
|
72
|
+
bearerCmd: string[];
|
|
73
|
+
};
|
|
74
|
+
}): Record<string, string>;
|
|
51
75
|
/** The per-agent transcript-mirror channel: `tr-<name>`, the name lowercased and reduced to
|
|
52
76
|
* subject-safe characters. The SINGLE source of this connector convention — connectors publish here
|
|
53
77
|
* (their plugin/runtime path AND their `Connector.transcriptChannel` method both call this), and the
|
package/dist/launch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../src/launch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AA0DpD;;;;+EAI+E;AAC/E,eAAO,MAAM,mBAAmB,4GAMtB,CAAC;AAEX;;;;;;;;;;0FAU0F;AAC1F,wBAAgB,SAAS,CACvB,IAAI,GAAE;IAAE,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAO,GAC3E,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAexB;AAED;;;;;mFAKmF;AACnF,wBAAgB,MAAM,CAAC,IAAI,EAAE;IAC3B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUzB;AAED;;;;;wGAKwG;AACxG,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;;kEAIkE;AAClE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,MAAM,EAAE,CAcjF"}
|
|
1
|
+
{"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../src/launch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,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E,aAAa,CAAC,GAAG,MAAM,EAAE,CAcjF"}
|
package/dist/launch.js
CHANGED
|
@@ -118,6 +118,52 @@ export function aclEnv(opts) {
|
|
|
118
118
|
env.COTAL_CAPABILITIES = opts.capabilities.join(",");
|
|
119
119
|
return env;
|
|
120
120
|
}
|
|
121
|
+
/** Property names that, assigned onto a plain object as `obj[k] = v`, corrupt its prototype chain
|
|
122
|
+
* (`__proto__`) or shadow a built-in the connector relies on (`constructor`/`prototype`). Refused
|
|
123
|
+
* for every connector — a launch option is a flag/config field, never these. This is process
|
|
124
|
+
* integrity (don't corrupt the JS config object a connector builds), not flag policy. */
|
|
125
|
+
const UNSAFE_LAUNCH_OPTION_KEYS = new Set(["__proto__", "constructor", "prototype"]);
|
|
126
|
+
/** A launch-option key must name ONE flag / config field: a letter-led token of letters, digits,
|
|
127
|
+
* `-` and `_`. This rejects, in particular, a key that embeds `=` — the CLI `--opt k=v` parser
|
|
128
|
+
* splits on the first `=`, but the map sources (persona `launchOptions:`, manifest, MCP `cotal_spawn`)
|
|
129
|
+
* do not, so a key like `"mcp-config=/tmp/evil.json"` would otherwise render as the single argv token
|
|
130
|
+
* `--mcp-config=/tmp/evil.json` — a garbled flag rather than the intended `--mcp-config /tmp/...`. It
|
|
131
|
+
* also rejects whitespace, control characters, and the empty key. */
|
|
132
|
+
const LAUNCH_OPTION_KEY = /^[A-Za-z][A-Za-z0-9_-]*$/;
|
|
133
|
+
/** Validate a connector's opaque {@link LaunchOpts.launchOptions} bag and return its entries for the
|
|
134
|
+
* connector to render into its host form (CLI flags / config / env). This is a RAW passthrough: the
|
|
135
|
+
* connector forwards every option as-is. The trust boundary is the spawn capability itself — WHO may
|
|
136
|
+
* spawn (the caller's authenticated identity), not WHICH flags a spawn carries. An operator running
|
|
137
|
+
* `cotal spawn --opt` on their own host can already run the agent binary directly with any flag, so
|
|
138
|
+
* capping their flags is theater; a mesh peer's `cotal_spawn` is bounded by whether it holds the
|
|
139
|
+
* spawn capability at all. So no allow-list, no deny-list — the only check is a key-SHAPE guard for
|
|
140
|
+
* process integrity (see {@link LAUNCH_OPTION_KEY}, {@link UNSAFE_LAUNCH_OPTION_KEYS}): a key must
|
|
141
|
+
* name one flag / config field, never a prototype-polluting name or an `=`-embedding token that
|
|
142
|
+
* would corrupt the config object or garble a rendered flag. Core never sees this; each connector
|
|
143
|
+
* calls it for the surface IT renders. */
|
|
144
|
+
export function connectorLaunchOptions(connector, launchOptions) {
|
|
145
|
+
if (!launchOptions)
|
|
146
|
+
return [];
|
|
147
|
+
for (const k of Object.keys(launchOptions))
|
|
148
|
+
if (UNSAFE_LAUNCH_OPTION_KEYS.has(k) || !LAUNCH_OPTION_KEY.test(k))
|
|
149
|
+
throw new Error(`${connector} connector: launch option key ${JSON.stringify(k)} is not a valid flag name`);
|
|
150
|
+
return Object.entries(launchOptions);
|
|
151
|
+
}
|
|
152
|
+
/** USER-MODE launch identity as `COTAL_*` env, when present — the one place the LaunchOpts.userAuth
|
|
153
|
+
* → env mapping lives, so every connector forwards the identical contract configFromEnv parses.
|
|
154
|
+
* Refuses a creds+userAuth combination here (one launch, one identity plane — U10). */
|
|
155
|
+
export function userAuthEnv(opts) {
|
|
156
|
+
if (!opts.userAuth)
|
|
157
|
+
return {};
|
|
158
|
+
if (opts.creds)
|
|
159
|
+
throw new Error("launch: creds (static auth) and userAuth (user-mode auth) are mutually exclusive — one launch carries one identity plane");
|
|
160
|
+
return {
|
|
161
|
+
COTAL_OWNER: opts.userAuth.owner,
|
|
162
|
+
COTAL_ACTOR: opts.userAuth.actor,
|
|
163
|
+
COTAL_SENTINEL_CREDS: opts.userAuth.sentinelCredsPath,
|
|
164
|
+
COTAL_BEARER_CMD: JSON.stringify(opts.userAuth.bearerCmd),
|
|
165
|
+
};
|
|
166
|
+
}
|
|
121
167
|
/** The per-agent transcript-mirror channel: `tr-<name>`, the name lowercased and reduced to
|
|
122
168
|
* subject-safe characters. The SINGLE source of this connector convention — connectors publish here
|
|
123
169
|
* (their plugin/runtime path AND their `Connector.transcriptChannel` method both call this), and the
|
package/dist/launch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch.js","sourceRoot":"","sources":["../src/launch.ts"],"names":[],"mappings":"AAkBA;;;;;;;;kGAQkG;AAClG,MAAM,YAAY,GAAG;IACnB,MAAM;IACN,MAAM;IACN,aAAa;IACb,WAAW;IACX,UAAU;IACV,MAAM;IACN,SAAS;IACT,OAAO;IACP,SAAS;IACT,SAAS;IACT,MAAM;IACN,WAAW;IACX,WAAW;IACX,MAAM;IACN,QAAQ;IACR,UAAU;IACV,aAAa;IACb,IAAI;IACJ,MAAM;IACN,QAAQ;IACR,KAAK;IACL,iBAAiB;IACjB,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,SAAS;IACT,cAAc;IACd,iBAAiB;IACjB,8FAA8F;IAC9F,gGAAgG;IAChG,kGAAkG;IAClG,kGAAkG;IAClG,0DAA0D;IAC1D,YAAY;IACZ,QAAQ;IACR,aAAa;IACb,wBAAwB;IACxB,sBAAsB;IACtB,iBAAiB;IACjB,aAAa;IACb,cAAc;IACd,mBAAmB;IACnB,oBAAoB;IACpB,QAAQ;CACA,CAAC;AAEX;;;;+EAI+E;AAC/E,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,oBAAoB;IACpB,cAAc;CACN,CAAC;AAEX;;;;;;;;;;0FAU0F;AAC1F,MAAM,UAAU,SAAS,CACvB,OAA0E,EAAE;IAE5E,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,iGAAiG;IACjG,+FAA+F;IAC/F,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC5C,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC;IAC5E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CAAA;KAAE,CAAC;IAC5C,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,aAAa,CAAC;IACzB,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1B,mEAAmE;IACnE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACxF;AAaD;;wFAEwF;AACxF,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,WAAW,EACnB,YAAY,EAAE,eAAe,EAAE,EAC/B,WAAW,EAAE,MAAM,GAClB,WAAW,CAuCb;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,WAAW,GAAG,MAAM,CAgCxD"}
|
package/dist/orientation.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DOCS_VERSION } from "./docs.js";
|
|
1
2
|
/** One-line connector bootstrap that points a joining agent at `cotal_orientation`. Folded into each
|
|
2
3
|
* connector's system prompt / MCP instructions so every agent — Claude Code, OpenCode, Hermes — is
|
|
3
4
|
* told to orient first, from a single source of truth. */
|
|
@@ -34,7 +35,7 @@ export function buildOrientation(agent, config, visibleTools, generatedAt) {
|
|
|
34
35
|
return {
|
|
35
36
|
v: 1,
|
|
36
37
|
generatedAt,
|
|
37
|
-
identity: { name: config.name, role: config.role, space: config.space, id: agent.id },
|
|
38
|
+
identity: { name: config.name, role: config.role, space: config.space, id: agent.id, cotalVersion: DOCS_VERSION },
|
|
38
39
|
access: {
|
|
39
40
|
authMode: !!config.creds,
|
|
40
41
|
read: config.subscribe,
|
|
@@ -63,6 +64,8 @@ export function renderOrientation(o) {
|
|
|
63
64
|
o.access.readAcl.some((c) => !o.access.read.includes(c));
|
|
64
65
|
const lines = [
|
|
65
66
|
`You are ${who} in space "${o.identity.space}" (id ${o.identity.id.slice(0, 8)}…).`,
|
|
67
|
+
`Cotal v${o.identity.cotalVersion} — call cotal_docs for the version-exact spec, schema, and guides. ` +
|
|
68
|
+
"Consult it before answering about Cotal or writing code against it; don't rely on training memory.",
|
|
66
69
|
"",
|
|
67
70
|
`Access — ${o.access.authMode ? "auth mode (grants are broker-enforced)" : "open mode (grants advisory, host-trusted)"}:`,
|
|
68
71
|
` • read: ${fmt(o.access.read)}`,
|
package/dist/orientation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orientation.js","sourceRoot":"","sources":["../src/orientation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"orientation.js","sourceRoot":"","sources":["../src/orientation.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;;2DAE2D;AAC3D,MAAM,CAAC,MAAM,qBAAqB,GAChC,gGAAgG;IAChG,mEAAmE,CAAC;AAqCtE;+FAC+F;AAC/F,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACzB,aAAa;IACb,YAAY;IACZ,UAAU;IACV,eAAe;IACf,cAAc;IACd,cAAc;CACf,CAAC,CAAC;AAEH;;wFAEwF;AACxF,MAAM,UAAU,gBAAgB,CAC9B,KAAgB,EAChB,MAAmB,EACnB,YAA+B,EAC/B,WAAmB;IAEnB,MAAM,IAAI,GAAsB,EAAE,CAAC;IACnC,MAAM,IAAI,GAAsB,EAAE,CAAC;IACnC,KAAK,MAAM,CAAC,IAAI,YAAY,EAAE,CAAC;QAC7B,IAAI,CAAC,CAAC,IAAI,KAAK,mBAAmB;YAAE,SAAS,CAAC,kDAAkD;QAChG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,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AAW,EAAE,IAAI,EAClE,eAAe,CAAC,CAAC,MAAM,iBAAiB,CAAC,CAAC,SAAS,EAAE,EACrD,sBAAsB,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,EAC5D,eAAe,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,EAC/B,EAAE,EACF,eAAe,CAAC,CAAC,OAAO,CAAC,IAAI,0BAA0B,CAAC,CAAC,OAAO,CAAC,YAAY,KAAK;QAChF,YAAY,CAAC,CAAC,OAAO,CAAC,YAAY,kBAAkB,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAC1E,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/tool-specs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-specs.d.ts","sourceRoot":"","sources":["../src/tool-specs.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAqC,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-specs.d.ts","sourceRoot":"","sources":["../src/tool-specs.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAqC,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAIlF;yDACyD;AACzD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAqBD,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,MAAM,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC;IACvB,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;CACzF;AAeD,2DAA2D;AAC3D,wBAAgB,OAAO,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAE5C;AA2CD,+FAA+F;AAC/F,wBAAgB,WAAW,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQhE;AAED;+DAC+D;AAC/D,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,SAAc,GAAG,aAAa,EAAE,CA+iBzF"}
|