@zenera/neo 1.1.0 → 1.1.3
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 +0 -1
- package/dist/models/factory.d.ts +2 -1
- package/dist/models/factory.js +10 -2
- package/dist/project/config.d.ts +29 -0
- package/dist/project/config.js +59 -12
- package/dist/project/index.d.ts +2 -2
- package/dist/project/index.js +1 -1
- package/dist/project/load.d.ts +40 -0
- package/dist/project/load.js +67 -10
- package/dist/skill-providers/file.d.ts +20 -5
- package/dist/skill-providers/file.js +24 -27
- package/dist/skills.d.ts +8 -1
- package/dist/skills.js +11 -1
- package/dist/tools/sandbox.d.ts +11 -0
- package/dist/tools/sandbox.js +15 -0
- package/dist/tools/workspace.d.ts +29 -3
- package/dist/tools/workspace.js +253 -73
- package/dist/types.d.ts +4 -3
- package/dist/types.js +21 -3
- package/package.json +1 -1
package/dist/types.js
CHANGED
|
@@ -59,9 +59,10 @@ export function tool(def) {
|
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Resolves selectors against the tools a host provided, in the order written
|
|
62
|
-
* and without duplicates. A selector is a tool name, `<group
|
|
63
|
-
* in
|
|
64
|
-
* what it matches from
|
|
62
|
+
* and without duplicates. A selector is a tool name, `<group>:<name>` for the
|
|
63
|
+
* same tool written out in full, `<group>:*` for every tool in a group, or `*`
|
|
64
|
+
* for everything; any of them prefixed with `-` removes what it matches from
|
|
65
|
+
* the selection so far.
|
|
65
66
|
*/
|
|
66
67
|
export function selectTools(available, selectors, opts) {
|
|
67
68
|
const chosen = new Map();
|
|
@@ -100,6 +101,23 @@ function matchTools(available, selector, opts) {
|
|
|
100
101
|
if (exact) {
|
|
101
102
|
return [exact];
|
|
102
103
|
}
|
|
104
|
+
// `workspace:read_file` is the same thing as `read_file`: an author who
|
|
105
|
+
// writes `workspace:*` on one line should not be told the qualified form
|
|
106
|
+
// is a typo on the next.
|
|
107
|
+
const colon = selector.lastIndexOf(':');
|
|
108
|
+
if (colon > 0) {
|
|
109
|
+
const group = selector.slice(0, colon);
|
|
110
|
+
const name = selector.slice(colon + 1);
|
|
111
|
+
const qualified = available.find((t) => t.group === group && t.name === name);
|
|
112
|
+
if (qualified) {
|
|
113
|
+
return [qualified];
|
|
114
|
+
}
|
|
115
|
+
const elsewhere = available.find((t) => t.name === name);
|
|
116
|
+
if (elsewhere) {
|
|
117
|
+
throw new Error(`${opts.where}: unknown tool "${selector}" ` +
|
|
118
|
+
`("${name}" is in group "${elsewhere.group ?? 'none'}", not "${group}")`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
103
121
|
const known = available.map((t) => t.name).join(', ') || 'none';
|
|
104
122
|
throw new Error(`${opts.where}: unknown tool "${selector}" ` +
|
|
105
123
|
(opts.hint ? `(${opts.hint}; known: ${known})` : `(known: ${known})`));
|