@opencode/codemode 0.0.0-dev-19921 → 0.0.0-dev-19926
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/tool-runtime.d.ts +2 -0
- package/dist/tool-runtime.js +2 -0
- package/package.json +1 -1
package/dist/tool-runtime.d.ts
CHANGED
|
@@ -66,6 +66,8 @@ export type Prepared<R = never> = {
|
|
|
66
66
|
};
|
|
67
67
|
export type SearchEntry = {
|
|
68
68
|
readonly description: ToolDescription;
|
|
69
|
+
/** The path split into words, so `zones` matches `get_zones` as a word rather than as a substring of `timezones`. */
|
|
70
|
+
readonly pathWords: ReadonlyArray<string>;
|
|
69
71
|
readonly searchText: string;
|
|
70
72
|
};
|
|
71
73
|
/** Exact callable signature of the built-in `search` function, for host-owned instructions. */
|
package/dist/tool-runtime.js
CHANGED
|
@@ -136,6 +136,7 @@ const makeSearchTool = (searchIndex) => ({
|
|
|
136
136
|
const description = entry.description.description.toLowerCase();
|
|
137
137
|
const score = terms.reduce((total, forms) => total +
|
|
138
138
|
(forms.some((form) => path === form || path.endsWith(`.${form}`)) ? 20 : 0) +
|
|
139
|
+
(forms.some((form) => entry.pathWords.includes(form)) ? 12 : 0) +
|
|
139
140
|
(forms.some((form) => path.includes(form)) ? 8 : 0) +
|
|
140
141
|
(forms.some((form) => description.includes(form)) ? 4 : 0) +
|
|
141
142
|
(forms.some((form) => entry.searchText.includes(form)) ? 2 : 0), 0);
|
|
@@ -163,6 +164,7 @@ export const searchSignature = (() => {
|
|
|
163
164
|
})();
|
|
164
165
|
const toSearchEntry = (visible) => ({
|
|
165
166
|
description: describeTool(visible),
|
|
167
|
+
pathWords: tokenize(visible.path),
|
|
166
168
|
searchText: [
|
|
167
169
|
visible.path,
|
|
168
170
|
visible.tool.description,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode/codemode",
|
|
4
|
-
"version": "0.0.0-dev-
|
|
4
|
+
"version": "0.0.0-dev-19926",
|
|
5
5
|
"description": "Effect-native confined code execution over schema-described tools",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|