| ... | @@ -12,13 +12,10 @@ import { | ... | @@ -12,13 +12,10 @@ import { |
| 12 | import { ProviderInstanceId } from "./providerInstance.ts"; | 12 | import { ProviderInstanceId } from "./providerInstance.ts"; |
| 13 | | 13 | |
| 14 | const BoundedUrl = Schema.String.check(Schema.isTrimmed()) | 14 | const BoundedUrl = Schema.String.check(Schema.isTrimmed()) |
| 15 | .check( | 15 | .check(Schema.isNonEmpty()) |
| 16 | Schema.isNonEmpty({ | | |
| 17 | description: | | |
| 18 | "Absolute http(s) URL or a schemeless host such as t3.chat or localhost:5173. Schemeless public hosts use https; loopback hosts use http.", | | |
| 19 | }), | | |
| 20 | ) | | |
| 21 | .check(Schema.isMaxLength(2048)); | 16 | .check(Schema.isMaxLength(2048)); |
| | 17 | const URL_GUIDANCE = |
| | 18 | "Absolute http(s) URL or a schemeless host such as t3.chat or localhost:5173. Schemeless public hosts use https; loopback hosts use http."; |
| 22 | const OptionalTimeoutMs = Schema.optional( | 19 | const OptionalTimeoutMs = Schema.optional( |
| 23 | Schema.Int.check(Schema.isGreaterThan(0)) | 20 | Schema.Int.check(Schema.isGreaterThan(0)) |
| 24 | .check(Schema.isLessThanOrEqualTo(60_000)) | 21 | .check(Schema.isLessThanOrEqualTo(60_000)) |
| ... | @@ -83,8 +80,7 @@ export type PreviewAutomationStatus = typeof PreviewAutomationStatus.Type; | ... | @@ -83,8 +80,7 @@ export type PreviewAutomationStatus = typeof PreviewAutomationStatus.Type; |
| 83 | export const PreviewAutomationOpenInput = Schema.Struct({ | 80 | export const PreviewAutomationOpenInput = Schema.Struct({ |
| 84 | ...PreviewAutomationTabTargetFields, | 81 | ...PreviewAutomationTabTargetFields, |
| 85 | url: Schema.optional(BoundedUrl).annotate({ | 82 | url: Schema.optional(BoundedUrl).annotate({ |
| 86 | description: | 83 | description: `Optional initial page URL. ${URL_GUIDANCE} Omit to open a blank tab.`, |
| 87 | "Optional initial page URL, for example https://t3.chat or localhost:5173. Omit to open a blank tab.", | | |
| 88 | }), | 84 | }), |
| 89 | open: Schema.optional( | 85 | open: Schema.optional( |
| 90 | Schema.Boolean.annotate({ | 86 | Schema.Boolean.annotate({ |
| ... | @@ -124,7 +120,7 @@ export const BrowserNavigationTarget = Schema.Union([ | ... | @@ -124,7 +120,7 @@ export const BrowserNavigationTarget = Schema.Union([ |
| 124 | description: "Selects direct URL navigation.", | 120 | description: "Selects direct URL navigation.", |
| 125 | }), | 121 | }), |
| 126 | url: BoundedUrl.annotate({ | 122 | url: BoundedUrl.annotate({ |
| 127 | description: "Direct website URL.", | 123 | description: `Direct website URL. ${URL_GUIDANCE}`, |
| 128 | }), | 124 | }), |
| 129 | }), | 125 | }), |
| 130 | Schema.Struct({ | 126 | Schema.Struct({ |
| ... | @@ -151,8 +147,7 @@ export type BrowserNavigationTarget = typeof BrowserNavigationTarget.Type; | ... | @@ -151,8 +147,7 @@ export type BrowserNavigationTarget = typeof BrowserNavigationTarget.Type; |
| 151 | export const PreviewAutomationNavigateInput = Schema.Struct({ | 147 | export const PreviewAutomationNavigateInput = Schema.Struct({ |
| 152 | ...PreviewAutomationTabTargetFields, | 148 | ...PreviewAutomationTabTargetFields, |
| 153 | url: Schema.optional(BoundedUrl).annotate({ | 149 | url: Schema.optional(BoundedUrl).annotate({ |
| 154 | description: | 150 | description: `Website URL. ${URL_GUIDANCE} Use this for public pages and directly reachable URLs.`, |
| 155 | "Website URL, for example https://t3.chat. Use this for public pages and directly reachable URLs.", | | |
| 156 | }), | 151 | }), |
| 157 | target: Schema.optional( | 152 | target: Schema.optional( |
| 158 | BrowserNavigationTarget.annotate({ | 153 | BrowserNavigationTarget.annotate({ |