@opencode-ai/protocol 0.0.0-dev-17852 → 0.0.0-dev-17853
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/simulation.js +4 -3
- package/package.json +2 -2
package/dist/simulation.js
CHANGED
|
@@ -340,8 +340,9 @@ export var Backend;
|
|
|
340
340
|
name: Schema.optionalKey(Schema.String),
|
|
341
341
|
}),
|
|
342
342
|
]);
|
|
343
|
-
const
|
|
344
|
-
const
|
|
343
|
+
const ProviderSafeName = /^[A-Za-z][A-Za-z0-9_-]{0,63}$/;
|
|
344
|
+
const ToolName = Schema.NonEmptyString.check(Schema.makeFilter((name) => ProviderSafeName.test(name) ? undefined : "simulated tool names must be provider-safe"));
|
|
345
|
+
const ToolNamespace = Schema.NonEmptyString.check(Schema.makeFilter((namespace) => namespace.split(".").every((segment) => ProviderSafeName.test(segment))
|
|
345
346
|
? undefined
|
|
346
347
|
: "simulated tool namespaces must contain provider-safe segments"));
|
|
347
348
|
Backend.ToolRegistration = Schema.Struct({
|
|
@@ -358,7 +359,7 @@ export var Backend;
|
|
|
358
359
|
Backend.ToolAttachParams = Schema.Struct({
|
|
359
360
|
tools: Schema.Array(Backend.ToolRegistration).check(Schema.makeFilter((tools) => {
|
|
360
361
|
const names = tools.map(exposedToolName);
|
|
361
|
-
if (names.some((name) =>
|
|
362
|
+
if (names.some((name) => !ProviderSafeName.test(name)))
|
|
362
363
|
return "simulated tool names including namespaces must be provider-safe";
|
|
363
364
|
if (new Set(names).size !== names.length)
|
|
364
365
|
return "simulated tool registrations must have unique exposed names";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode-ai/protocol",
|
|
4
|
-
"version": "0.0.0-dev-
|
|
4
|
+
"version": "0.0.0-dev-17853",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"typecheck": "tsgo --noEmit"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@opencode-ai/schema": "0.0.0-dev-
|
|
35
|
+
"@opencode-ai/schema": "0.0.0-dev-17853",
|
|
36
36
|
"effect": "4.0.0-rc.110"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|