@nyte-ai/plugin 0.0.24 → 0.0.25-nightly.20261025.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.
- package/THIRD-PARTY-NOTICES.md +13 -5
- package/dist/chunks/bash-description-0ah30s12.js +33 -0
- package/dist/chunks/{bash-description-qnwggxq3.js → bash-description-1neewp76.js} +19 -8
- package/dist/chunks/bash-description-4cdbmar0.js +124 -0
- package/dist/chunks/bash-description-4h0hnsv4.js +68 -0
- package/dist/chunks/bash-description-5dpf5hpt.js +724 -0
- package/dist/chunks/bash-description-9gw9ets8.js +162 -0
- package/dist/chunks/bash-description-b78pre8c.js +147 -0
- package/dist/chunks/{bash-description-necnb2k7.js → bash-description-vg0xecwm.js} +17 -7
- package/dist/src/acp/connection.js +1 -1
- package/dist/src/acp/index.d.ts +3 -3
- package/dist/src/acp/index.js +1 -1
- package/dist/src/approvals/approvals.d.ts +16 -16
- package/dist/src/approvals/schema.d.ts +18 -18
- package/dist/src/bash-description.d.ts +1 -1
- package/dist/src/bash-description.js +3 -5
- package/dist/src/canvas/canvas-protocol.d.ts +12 -12
- package/dist/src/canvas/canvas.d.ts +12 -3
- package/dist/src/canvas/canvas.js +33 -11
- package/dist/src/canvas/schema.d.ts +48 -8
- package/dist/src/canvas/schema.js +5 -1
- package/dist/src/claude-code-sdk/index.d.ts +1 -1
- package/dist/src/claude-code-sdk/index.js +1 -0
- package/dist/src/client/notifications.d.ts +1 -1
- package/dist/src/client/presentation.d.ts +1 -27
- package/dist/src/client/presentation.js +1 -19
- package/dist/src/codemode.js +148 -41
- package/dist/src/core.d.ts +1 -1
- package/dist/src/question/question.d.ts +14 -14
- package/dist/src/question/schema.d.ts +23 -23
- package/dist/src/rename.d.ts +17 -32
- package/dist/src/rename.js +115 -48
- package/dist/src/subagents.d.ts +30 -0
- package/dist/src/subagents.js +323 -0
- package/dist/src/telemetry.d.ts +1 -1
- package/dist/src/tool-search.d.ts +49 -0
- package/dist/src/tool-search.js +14 -0
- package/dist/src/web/body.d.ts +3 -0
- package/dist/src/web/body.js +6 -0
- package/dist/src/web/fetch.d.ts +16 -0
- package/dist/src/web/fetch.js +8 -0
- package/dist/src/web/html-markdown.d.ts +9 -0
- package/dist/src/web/html-markdown.js +10 -0
- package/dist/src/web/index.d.ts +24 -0
- package/dist/src/web/index.js +93 -0
- package/dist/src/web/providers.d.ts +60 -0
- package/dist/src/web/providers.js +11 -0
- package/dist/src/web/search.d.ts +21 -0
- package/dist/src/web/search.js +6 -0
- package/package.json +17 -9
- package/dist/src/web-search.d.ts +0 -78
- package/dist/src/web-search.js +0 -219
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import {
|
|
2
|
+
readCapped2
|
|
3
|
+
} from "./bash-description-0ah30s12.js";
|
|
4
|
+
|
|
5
|
+
// src/web/providers.ts
|
|
6
|
+
import { Type } from "typebox";
|
|
7
|
+
import { Value } from "typebox/value";
|
|
8
|
+
var PROVIDERS2 = [
|
|
9
|
+
{ id: "exa", name: "Exa" },
|
|
10
|
+
{ id: "tavily", name: "Tavily" },
|
|
11
|
+
{ id: "firecrawl", name: "Firecrawl" },
|
|
12
|
+
{ id: "parallel", name: "Parallel" }
|
|
13
|
+
];
|
|
14
|
+
var MAX_RESPONSE_BYTES = 256 * 1024;
|
|
15
|
+
var textBlocks = Type.Object({
|
|
16
|
+
content: Type.Array(Type.Object({ type: Type.String(), text: Type.Optional(Type.String()) }))
|
|
17
|
+
});
|
|
18
|
+
var tavilyResponse = Type.Object({
|
|
19
|
+
results: Type.Array(Type.Object({ url: Type.String(), title: Type.String(), content: Type.String() }))
|
|
20
|
+
});
|
|
21
|
+
var firecrawlResponse = Type.Object({
|
|
22
|
+
data: Type.Object({
|
|
23
|
+
web: Type.Array(Type.Object({
|
|
24
|
+
url: Type.String(),
|
|
25
|
+
title: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
26
|
+
description: Type.Optional(Type.Union([Type.String(), Type.Null()]))
|
|
27
|
+
}))
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
var parallelResponse = Type.Object({
|
|
31
|
+
structuredContent: Type.Object({
|
|
32
|
+
results: Type.Array(Type.Object({
|
|
33
|
+
url: Type.String(),
|
|
34
|
+
title: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
35
|
+
publish_date: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
36
|
+
excerpts: Type.Array(Type.String())
|
|
37
|
+
}))
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
var adapters2 = {
|
|
41
|
+
async tavily({ query, key, fetch, signal }) {
|
|
42
|
+
const response = await fetch("https://api.tavily.com/search", {
|
|
43
|
+
method: "POST",
|
|
44
|
+
headers: {
|
|
45
|
+
"Content-Type": "application/json",
|
|
46
|
+
...key === undefined ? { "X-Tavily-Access-Mode": "keyless" } : { Authorization: `Bearer ${key}` }
|
|
47
|
+
},
|
|
48
|
+
body: JSON.stringify({ query, search_depth: "basic", max_results: 8 }),
|
|
49
|
+
signal
|
|
50
|
+
});
|
|
51
|
+
const body = parse(await answered(response, "tavily"));
|
|
52
|
+
return Value.Check(tavilyResponse, body) ? body.results.map((hit) => ({ url: hit.url, title: hit.title, content: hit.content })) : [];
|
|
53
|
+
},
|
|
54
|
+
async exa({ query, key, fetch, signal }) {
|
|
55
|
+
const endpoint = new URL("https://mcp.exa.ai/mcp");
|
|
56
|
+
if (key !== undefined)
|
|
57
|
+
endpoint.searchParams.set("exaApiKey", key);
|
|
58
|
+
const result = await callTool(fetch, endpoint, "exa", undefined, "web_search_exa", {
|
|
59
|
+
query,
|
|
60
|
+
numResults: 8
|
|
61
|
+
}, signal);
|
|
62
|
+
const text = Value.Check(textBlocks, result) ? result.content.find((block) => block.text !== undefined)?.text ?? "" : "";
|
|
63
|
+
return text.split(/\n\n---\n\n/).flatMap((block) => {
|
|
64
|
+
const url = field(block, "URL");
|
|
65
|
+
const published = field(block, "Published");
|
|
66
|
+
return url === undefined ? [] : [
|
|
67
|
+
{
|
|
68
|
+
url,
|
|
69
|
+
title: field(block, "Title"),
|
|
70
|
+
content: block.match(/^(?:Highlights|Text):\s*\n?([\s\S]*)$/m)?.[1]?.trim(),
|
|
71
|
+
published: published === undefined ? undefined : Date.parse(published)
|
|
72
|
+
}
|
|
73
|
+
];
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
async firecrawl({ query, key, fetch, signal }) {
|
|
77
|
+
const result = await callTool(fetch, new URL("https://mcp.firecrawl.dev/v2/mcp"), "firecrawl", key, "firecrawl_search", { query, limit: 8 }, signal);
|
|
78
|
+
const text = Value.Check(textBlocks, result) ? result.content.find((block) => block.text !== undefined)?.text ?? "" : "";
|
|
79
|
+
const body = parse(text);
|
|
80
|
+
return Value.Check(firecrawlResponse, body) ? body.data.web.map((hit) => ({
|
|
81
|
+
url: hit.url,
|
|
82
|
+
title: hit.title ?? undefined,
|
|
83
|
+
content: hit.description ?? undefined
|
|
84
|
+
})) : [];
|
|
85
|
+
},
|
|
86
|
+
async parallel({ query, key, fetch, signal }) {
|
|
87
|
+
const result = await callTool(fetch, new URL("https://search.parallel.ai/mcp"), "parallel", key, "web_search", { objective: query, search_queries: [query] }, signal);
|
|
88
|
+
return Value.Check(parallelResponse, result) ? result.structuredContent.results.map((hit) => ({
|
|
89
|
+
url: hit.url,
|
|
90
|
+
title: hit.title ?? undefined,
|
|
91
|
+
content: hit.excerpts.length === 0 ? undefined : hit.excerpts.join(`
|
|
92
|
+
|
|
93
|
+
`),
|
|
94
|
+
published: hit.publish_date === undefined || hit.publish_date === null ? undefined : Date.parse(hit.publish_date)
|
|
95
|
+
})) : [];
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
function shippedProviders2(fetch, key) {
|
|
99
|
+
return PROVIDERS2.map((provider) => ({
|
|
100
|
+
id: provider.id,
|
|
101
|
+
name: provider.name,
|
|
102
|
+
search: async (input) => adapters2[provider.id]({
|
|
103
|
+
query: input.query,
|
|
104
|
+
key: await key(provider.id),
|
|
105
|
+
fetch,
|
|
106
|
+
signal: input.signal
|
|
107
|
+
})
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
async function callTool(fetch, url, provider, key, tool, args, signal) {
|
|
111
|
+
const response = await fetch(url, {
|
|
112
|
+
method: "POST",
|
|
113
|
+
headers: {
|
|
114
|
+
Accept: "application/json, text/event-stream",
|
|
115
|
+
"Content-Type": "application/json",
|
|
116
|
+
...key === undefined ? {} : { Authorization: `Bearer ${key}` }
|
|
117
|
+
},
|
|
118
|
+
body: JSON.stringify({
|
|
119
|
+
jsonrpc: "2.0",
|
|
120
|
+
id: 1,
|
|
121
|
+
method: "tools/call",
|
|
122
|
+
params: { name: tool, arguments: args }
|
|
123
|
+
}),
|
|
124
|
+
signal
|
|
125
|
+
});
|
|
126
|
+
const body = await answered(response, provider);
|
|
127
|
+
const frames = [
|
|
128
|
+
body,
|
|
129
|
+
...body.split(`
|
|
130
|
+
`).flatMap((line) => line.startsWith("data: ") ? [line.slice(6)] : [])
|
|
131
|
+
];
|
|
132
|
+
for (const frame of frames) {
|
|
133
|
+
const message = parse(frame);
|
|
134
|
+
if (typeof message === "object" && message !== null && "result" in message)
|
|
135
|
+
return message.result;
|
|
136
|
+
}
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
async function answered(response, provider) {
|
|
140
|
+
const body = new TextDecoder().decode(await readCapped2(response, MAX_RESPONSE_BYTES));
|
|
141
|
+
const name = PROVIDERS2.find((known) => known.id === provider)?.name ?? provider;
|
|
142
|
+
if (response.status === 401)
|
|
143
|
+
throw new Error(`${name} refused the search (HTTP 401). Set a key with /websearch-key ${provider} <key>.`);
|
|
144
|
+
if (response.status === 429)
|
|
145
|
+
throw new Error(`${name} is rate limiting searches (HTTP 429). Try again later, or set a key with /websearch-key ${provider} <key>.`);
|
|
146
|
+
if (!response.ok)
|
|
147
|
+
throw new Error(`HTTP ${response.status}: ${body.trim().slice(0, 200) || response.statusText}`);
|
|
148
|
+
return body;
|
|
149
|
+
}
|
|
150
|
+
function parse(text) {
|
|
151
|
+
try {
|
|
152
|
+
return JSON.parse(text);
|
|
153
|
+
} catch {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function field(block, name) {
|
|
158
|
+
const value = block.match(new RegExp(`^${name}:\\s*(.+)$`, "m"))?.[1]?.trim();
|
|
159
|
+
return value === undefined || value === "" || value === "N/A" ? undefined : value;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export { PROVIDERS2, adapters2, shippedProviders2 };
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// src/tool-search.ts
|
|
2
|
+
import { isJsonObject, standard } from "@nyte-ai/schema";
|
|
3
|
+
import { Type } from "typebox";
|
|
4
|
+
var DEFAULT_SEARCH_LIMIT2 = 8;
|
|
5
|
+
var STOP_WORDS = new Set([
|
|
6
|
+
"a",
|
|
7
|
+
"an",
|
|
8
|
+
"and",
|
|
9
|
+
"are",
|
|
10
|
+
"as",
|
|
11
|
+
"at",
|
|
12
|
+
"be",
|
|
13
|
+
"by",
|
|
14
|
+
"for",
|
|
15
|
+
"from",
|
|
16
|
+
"in",
|
|
17
|
+
"is",
|
|
18
|
+
"it",
|
|
19
|
+
"of",
|
|
20
|
+
"on",
|
|
21
|
+
"or",
|
|
22
|
+
"that",
|
|
23
|
+
"the",
|
|
24
|
+
"this",
|
|
25
|
+
"to",
|
|
26
|
+
"with"
|
|
27
|
+
]);
|
|
28
|
+
var K1 = 1.2;
|
|
29
|
+
var B = 0.75;
|
|
30
|
+
var DESCRIPTION = `Searches over deferred tool metadata with BM25 and exposes matching tools for the next model call.
|
|
31
|
+
|
|
32
|
+
Some of the tools, such as tools of MCP servers, may not have been provided to you upfront, and you should use this tool (\`tool_search\`) to search for the required tools. For MCP tool discovery, always use \`tool_search\`.`;
|
|
33
|
+
var parameters = standard(Type.Object({
|
|
34
|
+
query: Type.String({ description: "Search query for deferred tools." }),
|
|
35
|
+
limit: Type.Optional(Type.Integer({
|
|
36
|
+
minimum: 1,
|
|
37
|
+
description: `Maximum number of tools to return. Defaults to ${DEFAULT_SEARCH_LIMIT2}.`
|
|
38
|
+
}))
|
|
39
|
+
}));
|
|
40
|
+
var output = standard(Type.Object({ loaded: Type.Array(Type.String()) }));
|
|
41
|
+
var tool_search_default = {
|
|
42
|
+
id: "tool-search",
|
|
43
|
+
activate(api) {
|
|
44
|
+
const namespaces = () => new Map(api.contribute.tools.list().flatMap((definition) => definition.namespace === undefined ? [] : [[definition.name, definition.namespace]]));
|
|
45
|
+
const search = {
|
|
46
|
+
name: "tool_search",
|
|
47
|
+
description: DESCRIPTION,
|
|
48
|
+
parameters,
|
|
49
|
+
output,
|
|
50
|
+
exposure: "model-only",
|
|
51
|
+
class: () => ({ kind: "custom", label: "Searching tools" }),
|
|
52
|
+
effects: "none",
|
|
53
|
+
approval: "never",
|
|
54
|
+
replay: "safe",
|
|
55
|
+
loads: (result) => result.loaded,
|
|
56
|
+
async execute(args, invocation) {
|
|
57
|
+
if (args.query.trim() === "")
|
|
58
|
+
throw new Error("query must not be empty");
|
|
59
|
+
const loaded = new Set(await invocation.tools.loaded());
|
|
60
|
+
const found = namespaces();
|
|
61
|
+
const candidates = invocation.tools.list().filter((info) => (info.exposure === "code" || info.exposure === "deferred") && !loaded.has(info.name));
|
|
62
|
+
const names = rankTools2(args.query, candidates.map((info) => createToolSearchDocument2(info, found.get(info.name))), args.limit ?? DEFAULT_SEARCH_LIMIT2);
|
|
63
|
+
const lines = names.map((name) => {
|
|
64
|
+
const [line = ""] = (candidates.find((info) => info.name === name)?.description ?? "").trim().split(/\r?\n/);
|
|
65
|
+
return `- ${name}: ${line}`;
|
|
66
|
+
});
|
|
67
|
+
return {
|
|
68
|
+
content: [
|
|
69
|
+
{
|
|
70
|
+
kind: "text",
|
|
71
|
+
text: names.length === 0 ? "No matching tools found." : `Loaded ${names.length} tool${names.length === 1 ? "" : "s"}. They are available from your next call:
|
|
72
|
+
${lines.join(`
|
|
73
|
+
`)}`
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
output: { loaded: [...names] }
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
api.contribute.tools.add(search);
|
|
81
|
+
api.hook("transform_transcript", (transcript) => {
|
|
82
|
+
const declared = new Set(transcript.tools.map((info) => info.name));
|
|
83
|
+
const pending = api.contribute.tools.list().some((definition) => definition.exposure === "deferred" && !declared.has(definition.name));
|
|
84
|
+
return pending ? transcript : { ...transcript, tools: transcript.tools.filter((info) => info.name !== search.name) };
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
function tokenize2(text) {
|
|
89
|
+
return text.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter((term) => term.length > 0 && !STOP_WORDS.has(term)).map(stem);
|
|
90
|
+
}
|
|
91
|
+
function stem(term) {
|
|
92
|
+
if (term.length > 4 && term.endsWith("ies"))
|
|
93
|
+
return `${term.slice(0, -3)}y`;
|
|
94
|
+
if (term.length > 4 && /(ches|shes|sses|xes|zes)$/.test(term))
|
|
95
|
+
return term.slice(0, -2);
|
|
96
|
+
if (term.length > 3 && term.endsWith("s") && !term.endsWith("ss"))
|
|
97
|
+
return term.slice(0, -1);
|
|
98
|
+
return term;
|
|
99
|
+
}
|
|
100
|
+
function createToolSearchDocument2(tool, namespace) {
|
|
101
|
+
const parts = [
|
|
102
|
+
tool.name,
|
|
103
|
+
tool.name.replaceAll("_", " "),
|
|
104
|
+
tool.description,
|
|
105
|
+
...describeSchema(tool.parameters),
|
|
106
|
+
...namespace === undefined ? [] : [namespace.name, namespace.description ?? "", namespace.instructions ?? ""]
|
|
107
|
+
];
|
|
108
|
+
return { name: tool.name, text: parts.filter((part) => part.trim() !== "").join(" ") };
|
|
109
|
+
}
|
|
110
|
+
function describeSchema(schema) {
|
|
111
|
+
if (schema === undefined || !isJsonObject(schema))
|
|
112
|
+
return [];
|
|
113
|
+
const properties = isJsonObject(schema.properties) ? Object.entries(schema.properties) : [];
|
|
114
|
+
return [
|
|
115
|
+
...typeof schema.description === "string" ? [schema.description] : [],
|
|
116
|
+
...properties.flatMap(([name, property]) => [name, ...describeSchema(property)]),
|
|
117
|
+
...describeSchema(schema.items),
|
|
118
|
+
...["anyOf", "oneOf", "allOf"].flatMap((key) => {
|
|
119
|
+
const variants = schema[key];
|
|
120
|
+
return Array.isArray(variants) ? variants.flatMap(describeSchema) : [];
|
|
121
|
+
})
|
|
122
|
+
];
|
|
123
|
+
}
|
|
124
|
+
function rankTools2(query, documents, limit) {
|
|
125
|
+
const terms = [...new Set(tokenize2(query))];
|
|
126
|
+
if (terms.length === 0 || documents.length === 0)
|
|
127
|
+
return [];
|
|
128
|
+
const indexed = documents.map((document) => {
|
|
129
|
+
const tokens = tokenize2(document.text);
|
|
130
|
+
return { name: document.name, length: tokens.length, counts: Map.groupBy(tokens, (t) => t) };
|
|
131
|
+
});
|
|
132
|
+
const average = indexed.reduce((sum, entry) => sum + entry.length, 0) / indexed.length || 1;
|
|
133
|
+
const idf = new Map(terms.map((term) => {
|
|
134
|
+
const frequency = indexed.filter((entry) => entry.counts.has(term)).length;
|
|
135
|
+
return [term, Math.log(1 + (indexed.length - frequency + 0.5) / (frequency + 0.5))];
|
|
136
|
+
}));
|
|
137
|
+
return indexed.map((entry) => ({
|
|
138
|
+
name: entry.name,
|
|
139
|
+
score: terms.reduce((score, term) => {
|
|
140
|
+
const count = entry.counts.get(term)?.length ?? 0;
|
|
141
|
+
const norm = K1 * (1 - B + B * entry.length / average);
|
|
142
|
+
return score + (idf.get(term) ?? 0) * (count * (K1 + 1)) / (count + norm);
|
|
143
|
+
}, 0)
|
|
144
|
+
})).filter((match) => match.score > 0).toSorted((left, right) => right.score - left.score).slice(0, limit).map((match) => match.name);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export { DEFAULT_SEARCH_LIMIT2, tool_search_default, tokenize2, createToolSearchDocument2, rankTools2 };
|
|
@@ -15,7 +15,7 @@ import { processEnvironment } from "@nyte-ai/core";
|
|
|
15
15
|
// package.json
|
|
16
16
|
var package_default = {
|
|
17
17
|
name: "@nyte-ai/plugin",
|
|
18
|
-
version: "0.0.
|
|
18
|
+
version: "0.0.25-nightly.20261025.2",
|
|
19
19
|
private: false,
|
|
20
20
|
license: "MIT",
|
|
21
21
|
repository: {
|
|
@@ -46,8 +46,10 @@ var package_default = {
|
|
|
46
46
|
"./core/openai-compaction": "./src/openai-compaction.ts",
|
|
47
47
|
"./core/question": "./src/question/question.ts",
|
|
48
48
|
"./core/rename": "./src/rename.ts",
|
|
49
|
+
"./core/subagents": "./src/subagents.ts",
|
|
49
50
|
"./core/telemetry": "./src/telemetry.ts",
|
|
50
|
-
"./core/
|
|
51
|
+
"./core/tool-search": "./src/tool-search.ts",
|
|
52
|
+
"./core/web": "./src/web/index.ts",
|
|
51
53
|
"./client": "./src/client.ts",
|
|
52
54
|
"./client/mount": "./src/client/mount.ts",
|
|
53
55
|
"./client/notifications": "./src/client/notifications.ts",
|
|
@@ -127,13 +129,21 @@ var package_default = {
|
|
|
127
129
|
types: "./dist/src/rename.d.ts",
|
|
128
130
|
import: "./dist/src/rename.js"
|
|
129
131
|
},
|
|
132
|
+
"./core/subagents": {
|
|
133
|
+
types: "./dist/src/subagents.d.ts",
|
|
134
|
+
import: "./dist/src/subagents.js"
|
|
135
|
+
},
|
|
130
136
|
"./core/telemetry": {
|
|
131
137
|
types: "./dist/src/telemetry.d.ts",
|
|
132
138
|
import: "./dist/src/telemetry.js"
|
|
133
139
|
},
|
|
134
|
-
"./core/
|
|
135
|
-
types: "./dist/src/
|
|
136
|
-
import: "./dist/src/
|
|
140
|
+
"./core/tool-search": {
|
|
141
|
+
types: "./dist/src/tool-search.d.ts",
|
|
142
|
+
import: "./dist/src/tool-search.js"
|
|
143
|
+
},
|
|
144
|
+
"./core/web": {
|
|
145
|
+
types: "./dist/src/web/index.d.ts",
|
|
146
|
+
import: "./dist/src/web/index.js"
|
|
137
147
|
},
|
|
138
148
|
"./client": {
|
|
139
149
|
types: "./dist/src/client.d.ts",
|
|
@@ -190,7 +200,7 @@ var package_default = {
|
|
|
190
200
|
scripts: {
|
|
191
201
|
clean: "rm -rf node_modules .turbo",
|
|
192
202
|
test: "vitest --run",
|
|
193
|
-
typecheck: "
|
|
203
|
+
typecheck: "tsc --noEmit",
|
|
194
204
|
"build:package": "bun ../../scripts/sdk-packages.mjs build plugin"
|
|
195
205
|
},
|
|
196
206
|
dependencies: {
|
|
@@ -206,6 +216,7 @@ var package_default = {
|
|
|
206
216
|
"@opentelemetry/sdk-trace": "^3.0.0",
|
|
207
217
|
"@opentelemetry/semantic-conventions": "^1.43.0",
|
|
208
218
|
"es-module-lexer": "^3.0.4",
|
|
219
|
+
htmlparser2: "^8.0.2",
|
|
209
220
|
sucrase: "^3.35.1",
|
|
210
221
|
typebox: "^1.4.2",
|
|
211
222
|
zod: "^4.6.7"
|
|
@@ -215,7 +226,6 @@ var package_default = {
|
|
|
215
226
|
"@types/node": "^26.6.5",
|
|
216
227
|
"@types/react": "^19.3.0",
|
|
217
228
|
react: "^19.3.1",
|
|
218
|
-
typescript: "6.0.3",
|
|
219
229
|
vitest: "^5.0.5"
|
|
220
230
|
},
|
|
221
231
|
peerDependencies: {
|
package/dist/src/acp/index.d.ts
CHANGED
|
@@ -25,11 +25,11 @@ export declare function acpAgents(options?: {
|
|
|
25
25
|
id: string;
|
|
26
26
|
contribute: {
|
|
27
27
|
tools: ToolDefinition<{
|
|
28
|
+
thread: string;
|
|
28
29
|
id: string;
|
|
29
|
-
kind: string;
|
|
30
30
|
title: string;
|
|
31
|
+
kind: string;
|
|
31
32
|
input: Record<string, unknown>;
|
|
32
|
-
thread: string;
|
|
33
33
|
paths: string[];
|
|
34
34
|
}, unknown>[];
|
|
35
35
|
};
|
|
@@ -39,7 +39,7 @@ export declare function acpAgents(options?: {
|
|
|
39
39
|
readonly contribute: import("@nyte-ai/core").Registries<"core">;
|
|
40
40
|
readonly storage: import("@nyte-ai/core").PluginStorage;
|
|
41
41
|
readonly signal: AbortSignal;
|
|
42
|
-
hook<N extends "
|
|
42
|
+
hook<N extends import("@nyte-ai/core").HookName<"core">>(name: N, entry: import("@nyte-ai/core").HookEntry<"core", N>): import("@nyte-ai/schema").Disposer;
|
|
43
43
|
report(issue: import("@nyte-ai/schema").ValidationIssue): void;
|
|
44
44
|
reload(): void;
|
|
45
45
|
} & {
|
package/dist/src/acp/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import"../../chunks/bash-description-svrhh5a5.js";
|
|
9
9
|
import {
|
|
10
10
|
AcpProcess2
|
|
11
|
-
} from "../../chunks/bash-description-
|
|
11
|
+
} from "../../chunks/bash-description-vg0xecwm.js";
|
|
12
12
|
import"../../chunks/bash-description-4vz9pxyx.js";
|
|
13
13
|
import {
|
|
14
14
|
registryEntries2,
|
|
@@ -32,6 +32,7 @@ export declare function approvalReason(policy: ApprovalPolicy, tool: ApprovalToo
|
|
|
32
32
|
* @since 0.1.0
|
|
33
33
|
*/
|
|
34
34
|
export declare const approval: import("@nyte-ai/core").PartDefinition<{
|
|
35
|
+
tool: string;
|
|
35
36
|
class: {
|
|
36
37
|
kind: "read";
|
|
37
38
|
path: string;
|
|
@@ -42,21 +43,20 @@ export declare const approval: import("@nyte-ai/core").PartDefinition<{
|
|
|
42
43
|
kind: "edit";
|
|
43
44
|
path: string;
|
|
44
45
|
} | {
|
|
45
|
-
description?: string | undefined;
|
|
46
46
|
kind: "shell";
|
|
47
47
|
command: string;
|
|
48
|
+
description?: string | undefined;
|
|
48
49
|
} | {
|
|
49
50
|
kind: "delegate";
|
|
50
|
-
title: string | null;
|
|
51
|
-
role: "read" | "task" | "create" | "send" | "await" | "stop";
|
|
52
51
|
child: import("@nyte-ai/schema").Id<"session"> | null;
|
|
52
|
+
role: "await" | "create" | "read" | "send" | "stop" | "task";
|
|
53
|
+
title: string | null;
|
|
53
54
|
} | {
|
|
54
55
|
kind: "custom";
|
|
55
56
|
label: string;
|
|
56
57
|
};
|
|
57
|
-
reason: "edit" | "
|
|
58
|
-
|
|
59
|
-
decision: "session" | "once" | "deny" | null;
|
|
58
|
+
reason: "edit" | "outside" | "shell" | "tool";
|
|
59
|
+
decision: "deny" | "once" | "session" | null;
|
|
60
60
|
}, {
|
|
61
61
|
once: {
|
|
62
62
|
input: import("@nyte-ai/schema").Schema<object>;
|
|
@@ -89,6 +89,7 @@ declare const _default: {
|
|
|
89
89
|
id: string;
|
|
90
90
|
contribute: {
|
|
91
91
|
parts: import("@nyte-ai/core").PartDefinition<{
|
|
92
|
+
tool: string;
|
|
92
93
|
class: {
|
|
93
94
|
kind: "read";
|
|
94
95
|
path: string;
|
|
@@ -99,21 +100,20 @@ declare const _default: {
|
|
|
99
100
|
kind: "edit";
|
|
100
101
|
path: string;
|
|
101
102
|
} | {
|
|
102
|
-
description?: string | undefined;
|
|
103
103
|
kind: "shell";
|
|
104
104
|
command: string;
|
|
105
|
+
description?: string | undefined;
|
|
105
106
|
} | {
|
|
106
107
|
kind: "delegate";
|
|
107
|
-
title: string | null;
|
|
108
|
-
role: "read" | "task" | "create" | "send" | "await" | "stop";
|
|
109
108
|
child: import("@nyte-ai/schema").Id<"session"> | null;
|
|
109
|
+
role: "await" | "create" | "read" | "send" | "stop" | "task";
|
|
110
|
+
title: string | null;
|
|
110
111
|
} | {
|
|
111
112
|
kind: "custom";
|
|
112
113
|
label: string;
|
|
113
114
|
};
|
|
114
|
-
reason: "edit" | "
|
|
115
|
-
|
|
116
|
-
decision: "session" | "once" | "deny" | null;
|
|
115
|
+
reason: "edit" | "outside" | "shell" | "tool";
|
|
116
|
+
decision: "deny" | "once" | "session" | null;
|
|
117
117
|
}, {
|
|
118
118
|
once: {
|
|
119
119
|
input: import("@nyte-ai/schema").Schema<object>;
|
|
@@ -143,14 +143,14 @@ declare const _default: {
|
|
|
143
143
|
readonly kind: "edit";
|
|
144
144
|
readonly path: string;
|
|
145
145
|
} | {
|
|
146
|
-
readonly description?: string | undefined;
|
|
147
146
|
readonly kind: "shell";
|
|
148
147
|
readonly command: string;
|
|
148
|
+
readonly description?: string | undefined;
|
|
149
149
|
} | {
|
|
150
150
|
readonly kind: "delegate";
|
|
151
|
-
readonly title: string | null;
|
|
152
|
-
readonly role: "read" | "task" | "create" | "send" | "await" | "stop";
|
|
153
151
|
readonly child: import("@nyte-ai/schema").Id<"session"> | null;
|
|
152
|
+
readonly role: "await" | "create" | "read" | "send" | "stop" | "task";
|
|
153
|
+
readonly title: string | null;
|
|
154
154
|
} | {
|
|
155
155
|
readonly kind: "custom";
|
|
156
156
|
readonly label: string;
|
|
@@ -162,7 +162,7 @@ declare const _default: {
|
|
|
162
162
|
readonly contribute: import("@nyte-ai/core").Registries<"core">;
|
|
163
163
|
readonly storage: import("@nyte-ai/core").PluginStorage;
|
|
164
164
|
readonly signal: AbortSignal;
|
|
165
|
-
hook<N extends "
|
|
165
|
+
hook<N extends import("@nyte-ai/core").HookName<"core">>(name: N, entry: import("@nyte-ai/core").HookEntry<"core", N>): import("@nyte-ai/schema").Disposer;
|
|
166
166
|
report(issue: import("@nyte-ai/schema").ValidationIssue): void;
|
|
167
167
|
reload(): void;
|
|
168
168
|
} & {
|
|
@@ -25,6 +25,7 @@ export declare const APPROVAL_POLICIES: readonly [{
|
|
|
25
25
|
readonly description: "Runs every tool without asking";
|
|
26
26
|
}];
|
|
27
27
|
declare const state: import("@nyte-ai/schema").Schema<{
|
|
28
|
+
tool: string;
|
|
28
29
|
class: {
|
|
29
30
|
kind: "read";
|
|
30
31
|
path: string;
|
|
@@ -35,21 +36,20 @@ declare const state: import("@nyte-ai/schema").Schema<{
|
|
|
35
36
|
kind: "edit";
|
|
36
37
|
path: string;
|
|
37
38
|
} | {
|
|
38
|
-
description?: string | undefined;
|
|
39
39
|
kind: "shell";
|
|
40
40
|
command: string;
|
|
41
|
+
description?: string | undefined;
|
|
41
42
|
} | {
|
|
42
43
|
kind: "delegate";
|
|
43
|
-
title: string | null;
|
|
44
|
-
role: "read" | "task" | "create" | "send" | "await" | "stop";
|
|
45
44
|
child: import("@nyte-ai/schema").Id<"session"> | null;
|
|
45
|
+
role: "await" | "create" | "read" | "send" | "stop" | "task";
|
|
46
|
+
title: string | null;
|
|
46
47
|
} | {
|
|
47
48
|
kind: "custom";
|
|
48
49
|
label: string;
|
|
49
50
|
};
|
|
50
|
-
reason: "edit" | "
|
|
51
|
-
|
|
52
|
-
decision: "session" | "once" | "deny" | null;
|
|
51
|
+
reason: "edit" | "outside" | "shell" | "tool";
|
|
52
|
+
decision: "deny" | "once" | "session" | null;
|
|
53
53
|
}>;
|
|
54
54
|
/**
|
|
55
55
|
* One gated tool call: its tool, its class, why it asks (`shell`, `edit` in
|
|
@@ -87,6 +87,7 @@ export declare function approvalPrompt(current: Pick<ApprovalState, "tool" | "cl
|
|
|
87
87
|
export declare const approval: {
|
|
88
88
|
kind: string;
|
|
89
89
|
state: import("@nyte-ai/schema").Schema<{
|
|
90
|
+
tool: string;
|
|
90
91
|
class: {
|
|
91
92
|
kind: "read";
|
|
92
93
|
path: string;
|
|
@@ -97,21 +98,20 @@ export declare const approval: {
|
|
|
97
98
|
kind: "edit";
|
|
98
99
|
path: string;
|
|
99
100
|
} | {
|
|
100
|
-
description?: string | undefined;
|
|
101
101
|
kind: "shell";
|
|
102
102
|
command: string;
|
|
103
|
+
description?: string | undefined;
|
|
103
104
|
} | {
|
|
104
105
|
kind: "delegate";
|
|
105
|
-
title: string | null;
|
|
106
|
-
role: "read" | "task" | "create" | "send" | "await" | "stop";
|
|
107
106
|
child: import("@nyte-ai/schema").Id<"session"> | null;
|
|
107
|
+
role: "await" | "create" | "read" | "send" | "stop" | "task";
|
|
108
|
+
title: string | null;
|
|
108
109
|
} | {
|
|
109
110
|
kind: "custom";
|
|
110
111
|
label: string;
|
|
111
112
|
};
|
|
112
|
-
reason: "edit" | "
|
|
113
|
-
|
|
114
|
-
decision: "session" | "once" | "deny" | null;
|
|
113
|
+
reason: "edit" | "outside" | "shell" | "tool";
|
|
114
|
+
decision: "deny" | "once" | "session" | null;
|
|
115
115
|
}>;
|
|
116
116
|
actions: {
|
|
117
117
|
once: {
|
|
@@ -125,6 +125,7 @@ export declare const approval: {
|
|
|
125
125
|
};
|
|
126
126
|
};
|
|
127
127
|
fallback: (current: {
|
|
128
|
+
tool: string;
|
|
128
129
|
class: {
|
|
129
130
|
kind: "read";
|
|
130
131
|
path: string;
|
|
@@ -135,21 +136,20 @@ export declare const approval: {
|
|
|
135
136
|
kind: "edit";
|
|
136
137
|
path: string;
|
|
137
138
|
} | {
|
|
138
|
-
description?: string | undefined;
|
|
139
139
|
kind: "shell";
|
|
140
140
|
command: string;
|
|
141
|
+
description?: string | undefined;
|
|
141
142
|
} | {
|
|
142
143
|
kind: "delegate";
|
|
143
|
-
title: string | null;
|
|
144
|
-
role: "read" | "task" | "create" | "send" | "await" | "stop";
|
|
145
144
|
child: import("@nyte-ai/schema").Id<"session"> | null;
|
|
145
|
+
role: "await" | "create" | "read" | "send" | "stop" | "task";
|
|
146
|
+
title: string | null;
|
|
146
147
|
} | {
|
|
147
148
|
kind: "custom";
|
|
148
149
|
label: string;
|
|
149
150
|
};
|
|
150
|
-
reason: "edit" | "
|
|
151
|
-
|
|
152
|
-
decision: "session" | "once" | "deny" | null;
|
|
151
|
+
reason: "edit" | "outside" | "shell" | "tool";
|
|
152
|
+
decision: "deny" | "once" | "session" | null;
|
|
153
153
|
}, { id }: {
|
|
154
154
|
readonly id: PartId;
|
|
155
155
|
}) => string;
|
|
@@ -15,7 +15,7 @@ declare const _default: {
|
|
|
15
15
|
readonly contribute: import("@nyte-ai/core").Registries<"core">;
|
|
16
16
|
readonly storage: import("@nyte-ai/core").PluginStorage;
|
|
17
17
|
readonly signal: AbortSignal;
|
|
18
|
-
hook<N extends "
|
|
18
|
+
hook<N extends import("@nyte-ai/core").HookName<"core">>(name: N, entry: import("@nyte-ai/core").HookEntry<"core", N>): import("@nyte-ai/schema").Disposer;
|
|
19
19
|
report(issue: import("@nyte-ai/schema").ValidationIssue): void;
|
|
20
20
|
reload(): void;
|
|
21
21
|
} & {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
// src/bash-description.ts
|
|
2
|
+
import { bashProperties } from "@nyte-ai/core";
|
|
2
3
|
import { standard } from "@nyte-ai/schema";
|
|
3
4
|
import { Type } from "typebox";
|
|
4
5
|
var parameters = standard(Type.Object({
|
|
5
|
-
|
|
6
|
+
...bashProperties,
|
|
6
7
|
description: Type.String({
|
|
7
8
|
description: "Clear, concise description of what this command does in 5-10 words, in active voice."
|
|
8
|
-
})
|
|
9
|
-
background: Type.Optional(Type.Boolean({
|
|
10
|
-
description: "Start the command and return a job id with its first output instead of waiting for it to exit. Use for servers, watchers, and other long-lived commands, without a trailing &. The command keeps running across turns, and you are told when it exits; read its output or stop it with the job tool. Do not use it to speed up ordinary commands."
|
|
11
|
-
}))
|
|
9
|
+
})
|
|
12
10
|
}));
|
|
13
11
|
var bash_description_default = {
|
|
14
12
|
id: "bash-description",
|