@opencode-ai/protocol
Advanced tools
@@ -8,3 +8,3 @@ import { SessionMessage } from "@opencode-ai/schema/session-message"; | ||
| import { Project } from "@opencode-ai/schema/project"; | ||
| import { AbsolutePath, PositiveInt, RelativePath, statics } from "@opencode-ai/schema/schema"; | ||
| import { AbsolutePath, NonNegativeInt, PositiveInt, RelativePath, statics } from "@opencode-ai/schema/schema"; | ||
| import { Event } from "@opencode-ai/schema/event"; | ||
@@ -523,2 +523,12 @@ import { Workspace } from "@opencode-ai/schema/workspace"; | ||
| }))) | ||
| .add(HttpApiEndpoint.post("session.view", "/api/session/:sessionID/view", { | ||
| params: { sessionID: Session.ID }, | ||
| payload: Schema.Struct({ idle: NonNegativeInt }), | ||
| success: HttpApiSchema.NoContent, | ||
| error: SessionNotFoundError, | ||
| }).annotateMerge(OpenApi.annotations({ | ||
| identifier: "v2.session.view", | ||
| summary: "View session", | ||
| description: "Mark the idle transition observed by the viewer as viewed.", | ||
| }))) | ||
| .annotateMerge(OpenApi.annotations({ | ||
@@ -525,0 +535,0 @@ title: "session", |
@@ -343,4 +343,5 @@ import { Effect, Schema } from "effect"; | ||
| ]); | ||
| const ToolName = Schema.NonEmptyString.check(Schema.makeFilter((name) => /^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(name) ? undefined : "simulated tool names must be provider-safe")); | ||
| const ToolNamespace = Schema.NonEmptyString.check(Schema.makeFilter((namespace) => namespace.split(".").every((segment) => /^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(segment)) | ||
| const ProviderSafeName = /^[A-Za-z][A-Za-z0-9_-]{0,63}$/; | ||
| const ToolName = Schema.NonEmptyString.check(Schema.makeFilter((name) => ProviderSafeName.test(name) ? undefined : "simulated tool names must be provider-safe")); | ||
| const ToolNamespace = Schema.NonEmptyString.check(Schema.makeFilter((namespace) => namespace.split(".").every((segment) => ProviderSafeName.test(segment)) | ||
| ? undefined | ||
@@ -362,3 +363,3 @@ : "simulated tool namespaces must contain provider-safe segments")); | ||
| const names = tools.map(exposedToolName); | ||
| if (names.some((name) => !/^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(name))) | ||
| if (names.some((name) => !ProviderSafeName.test(name))) | ||
| return "simulated tool names including namespaces must be provider-safe"; | ||
@@ -365,0 +366,0 @@ if (new Set(names).size !== names.length) |
+3
-2
| { | ||
| "$schema": "https://json.schemastore.org/package.json", | ||
| "name": "@opencode-ai/protocol", | ||
| "version": "0.0.0-beta-17823", | ||
| "version": "0.0.0-beta-17887", | ||
| "type": "module", | ||
@@ -35,3 +35,3 @@ "license": "MIT", | ||
| "dependencies": { | ||
| "@opencode-ai/schema": "0.0.0-beta-17823", | ||
| "@opencode-ai/schema": "0.0.0-beta-17887", | ||
| "effect": "4.0.0-rc.110" | ||
@@ -43,4 +43,5 @@ }, | ||
| "@typescript/native-preview": "7.0.0-dev.20251207.1", | ||
| "prettier": "3.6.2", | ||
| "typescript": "5.8.2" | ||
| } | ||
| } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
1918744
1.08%30955
0.98%5
25%+ Added
- Removed