@opencode-ai/schema 0.0.0-dev-17471

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.
Files changed (193) hide show
  1. package/dist/agent.d.ts +164 -0
  2. package/dist/agent.js +46 -0
  3. package/dist/ai.d.ts +4 -0
  4. package/dist/ai.js +5 -0
  5. package/dist/catalog.d.ts +69 -0
  6. package/dist/catalog.js +4 -0
  7. package/dist/command.d.ts +124 -0
  8. package/dist/command.js +19 -0
  9. package/dist/config/agent.d.ts +42 -0
  10. package/dist/config/agent.js +20 -0
  11. package/dist/config/command.d.ts +27 -0
  12. package/dist/config/command.js +12 -0
  13. package/dist/config/compaction.d.ts +14 -0
  14. package/dist/config/compaction.js +13 -0
  15. package/dist/config/experimental.d.ts +17 -0
  16. package/dist/config/experimental.js +16 -0
  17. package/dist/config/formatter.d.ts +11 -0
  18. package/dist/config/formatter.js +11 -0
  19. package/dist/config/lsp.d.ts +20 -0
  20. package/dist/config/lsp.js +16 -0
  21. package/dist/config/mcp.d.ts +18 -0
  22. package/dist/config/mcp.js +14 -0
  23. package/dist/config/media.d.ts +15 -0
  24. package/dist/config/media.js +14 -0
  25. package/dist/config/model.d.ts +18 -0
  26. package/dist/config/model.js +28 -0
  27. package/dist/config/plugin.d.ts +11 -0
  28. package/dist/config/plugin.js +10 -0
  29. package/dist/config/policy.d.ts +10 -0
  30. package/dist/config/policy.js +8 -0
  31. package/dist/config/provider.d.ts +106 -0
  32. package/dist/config/provider.js +62 -0
  33. package/dist/config/reference.d.ts +21 -0
  34. package/dist/config/reference.js +18 -0
  35. package/dist/config/tool-output.d.ts +8 -0
  36. package/dist/config/tool-output.js +8 -0
  37. package/dist/config/warming.d.ts +10 -0
  38. package/dist/config/warming.js +16 -0
  39. package/dist/config/watcher.d.ts +7 -0
  40. package/dist/config/watcher.js +7 -0
  41. package/dist/config/websearch.d.ts +9 -0
  42. package/dist/config/websearch.js +8 -0
  43. package/dist/config.d.ts +175 -0
  44. package/dist/config.js +136 -0
  45. package/dist/connection.d.ts +28 -0
  46. package/dist/connection.js +15 -0
  47. package/dist/credential.d.ts +38 -0
  48. package/dist/credential.js +25 -0
  49. package/dist/durable-event-manifest.d.ts +3 -0
  50. package/dist/durable-event-manifest.js +5 -0
  51. package/dist/event-log.d.ts +14 -0
  52. package/dist/event-log.js +17 -0
  53. package/dist/event-manifest.d.ts +11372 -0
  54. package/dist/event-manifest.js +45 -0
  55. package/dist/event.d.ts +142 -0
  56. package/dist/event.js +110 -0
  57. package/dist/file-diff.d.ts +21 -0
  58. package/dist/file-diff.js +18 -0
  59. package/dist/filesystem-v1.d.ts +1 -0
  60. package/dist/filesystem-v1.js +1 -0
  61. package/dist/filesystem.d.ts +118 -0
  62. package/dist/filesystem.js +35 -0
  63. package/dist/form.d.ts +1259 -0
  64. package/dist/form.js +120 -0
  65. package/dist/ide-event.d.ts +76 -0
  66. package/dist/ide-event.js +10 -0
  67. package/dist/identifier.d.ts +3 -0
  68. package/dist/identifier.js +24 -0
  69. package/dist/index.d.ts +39 -0
  70. package/dist/index.js +39 -0
  71. package/dist/installation-event.d.ts +149 -0
  72. package/dist/installation-event.js +16 -0
  73. package/dist/instruction-entry.d.ts +23 -0
  74. package/dist/instruction-entry.js +22 -0
  75. package/dist/instruction.d.ts +13 -0
  76. package/dist/instruction.js +8 -0
  77. package/dist/integration-id.d.ts +5 -0
  78. package/dist/integration-id.js +3 -0
  79. package/dist/integration.d.ts +1675 -0
  80. package/dist/integration.js +87 -0
  81. package/dist/legacy-event.d.ts +1 -0
  82. package/dist/legacy-event.js +1 -0
  83. package/dist/llm.d.ts +4 -0
  84. package/dist/llm.js +3 -0
  85. package/dist/location.d.ts +37 -0
  86. package/dist/location.js +22 -0
  87. package/dist/lsp-event.d.ts +67 -0
  88. package/dist/lsp-event.js +4 -0
  89. package/dist/mcp-event.d.ts +222 -0
  90. package/dist/mcp-event.js +24 -0
  91. package/dist/mcp.d.ts +138 -0
  92. package/dist/mcp.js +111 -0
  93. package/dist/model.d.ts +186 -0
  94. package/dist/model.js +104 -0
  95. package/dist/models-dev.d.ts +69 -0
  96. package/dist/models-dev.js +7 -0
  97. package/dist/money.d.ts +10 -0
  98. package/dist/money.js +5 -0
  99. package/dist/permission-saved.d.ts +18 -0
  100. package/dist/permission-saved.js +12 -0
  101. package/dist/permission-v1.d.ts +1 -0
  102. package/dist/permission-v1.js +1 -0
  103. package/dist/permission.d.ts +306 -0
  104. package/dist/permission.js +45 -0
  105. package/dist/plugin.d.ts +150 -0
  106. package/dist/plugin.js +16 -0
  107. package/dist/project-id.d.ts +5 -0
  108. package/dist/project-id.js +3 -0
  109. package/dist/project.d.ts +241 -0
  110. package/dist/project.js +37 -0
  111. package/dist/prompt-input.d.ts +143 -0
  112. package/dist/prompt-input.js +25 -0
  113. package/dist/prompt.d.ts +297 -0
  114. package/dist/prompt.js +61 -0
  115. package/dist/provider.d.ts +60 -0
  116. package/dist/provider.js +42 -0
  117. package/dist/pty-ticket.d.ts +8 -0
  118. package/dist/pty-ticket.js +7 -0
  119. package/dist/pty.d.ts +462 -0
  120. package/dist/pty.js +43 -0
  121. package/dist/question-v1.d.ts +1 -0
  122. package/dist/question-v1.js +1 -0
  123. package/dist/question.d.ts +15 -0
  124. package/dist/question.js +15 -0
  125. package/dist/reference.d.ts +120 -0
  126. package/dist/reference.js +30 -0
  127. package/dist/schema.d.ts +10 -0
  128. package/dist/schema.js +14 -0
  129. package/dist/server-event.d.ts +132 -0
  130. package/dist/server-event.js +5 -0
  131. package/dist/session-compaction-event.d.ts +87 -0
  132. package/dist/session-compaction-event.js +10 -0
  133. package/dist/session-error.d.ts +9 -0
  134. package/dist/session-error.js +8 -0
  135. package/dist/session-event.d.ts +17994 -0
  136. package/dist/session-event.js +499 -0
  137. package/dist/session-fork.d.ts +26 -0
  138. package/dist/session-fork.js +11 -0
  139. package/dist/session-id.d.ts +6 -0
  140. package/dist/session-id.js +10 -0
  141. package/dist/session-inbox.d.ts +748 -0
  142. package/dist/session-inbox.js +47 -0
  143. package/dist/session-message.d.ts +1512 -0
  144. package/dist/session-message.js +209 -0
  145. package/dist/session-revert.d.ts +480 -0
  146. package/dist/session-revert.js +63 -0
  147. package/dist/session-status-event.d.ts +299 -0
  148. package/dist/session-status-event.js +43 -0
  149. package/dist/session-transfer.d.ts +744 -0
  150. package/dist/session-transfer.js +8 -0
  151. package/dist/session-v1.d.ts +1 -0
  152. package/dist/session-v1.js +1 -0
  153. package/dist/session.d.ts +218 -0
  154. package/dist/session.js +45 -0
  155. package/dist/shell.d.ts +381 -0
  156. package/dist/shell.js +58 -0
  157. package/dist/skill.d.ts +133 -0
  158. package/dist/skill.js +48 -0
  159. package/dist/snapshot.d.ts +4 -0
  160. package/dist/snapshot.js +3 -0
  161. package/dist/token-usage.d.ts +13 -0
  162. package/dist/token-usage.js +11 -0
  163. package/dist/tool.d.ts +74 -0
  164. package/dist/tool.js +22 -0
  165. package/dist/tui-event.d.ts +307 -0
  166. package/dist/tui-event.js +53 -0
  167. package/dist/v1/filesystem.d.ts +78 -0
  168. package/dist/v1/filesystem.js +8 -0
  169. package/dist/v1/legacy-event.d.ts +108 -0
  170. package/dist/v1/legacy-event.js +15 -0
  171. package/dist/v1/permission.d.ts +316 -0
  172. package/dist/v1/permission.js +41 -0
  173. package/dist/v1/question.d.ts +444 -0
  174. package/dist/v1/question.js +57 -0
  175. package/dist/v1/session.d.ts +7657 -0
  176. package/dist/v1/session.js +535 -0
  177. package/dist/vcs-event.d.ts +76 -0
  178. package/dist/vcs-event.js +11 -0
  179. package/dist/vcs.d.ts +26 -0
  180. package/dist/vcs.js +17 -0
  181. package/dist/websearch.d.ts +108 -0
  182. package/dist/websearch.js +31 -0
  183. package/dist/workspace-event.d.ts +247 -0
  184. package/dist/workspace-event.js +25 -0
  185. package/dist/workspace-id.d.ts +6 -0
  186. package/dist/workspace-id.js +16 -0
  187. package/dist/workspace.d.ts +9 -0
  188. package/dist/workspace.js +5 -0
  189. package/dist/worktree-event.d.ts +153 -0
  190. package/dist/worktree-event.js +18 -0
  191. package/dist/worktree.d.ts +255 -0
  192. package/dist/worktree.js +61 -0
  193. package/package.json +42 -0
package/dist/mcp.js ADDED
@@ -0,0 +1,111 @@
1
+ export * as Mcp from "./mcp.js";
2
+ import { Schema } from "effect";
3
+ import { optional, PositiveInt } from "./schema.js";
4
+ import { IntegrationID } from "./integration-id.js";
5
+ export class TimeoutConfig extends Schema.Class("Mcp.TimeoutConfig")({
6
+ startup: PositiveInt.pipe(optional).annotate({
7
+ description: "Maximum time in milliseconds to establish and initialize the MCP server.",
8
+ }),
9
+ catalog: PositiveInt.pipe(optional).annotate({
10
+ description: "Maximum time in milliseconds to wait for MCP discovery requests such as tools/list and prompts/list.",
11
+ }),
12
+ execution: PositiveInt.pipe(optional).annotate({
13
+ description: "Maximum time in milliseconds to wait for MCP tool and prompt execution.",
14
+ }),
15
+ }) {
16
+ }
17
+ export class LocalConfig extends Schema.Class("Mcp.LocalConfig")({
18
+ type: Schema.Literal("local"),
19
+ command: Schema.String.pipe(Schema.Array),
20
+ cwd: Schema.String.pipe(optional).annotate({
21
+ description: "Working directory for the MCP server process. Relative paths resolve from the workspace directory.",
22
+ }),
23
+ environment: Schema.Record(Schema.String, Schema.String).pipe(optional),
24
+ disabled: Schema.Boolean.pipe(optional),
25
+ codemode: Schema.Boolean.pipe(optional).annotate({
26
+ description: "Expose this server's tools through Code Mode. Defaults to true.",
27
+ }),
28
+ timeout: TimeoutConfig.pipe(optional),
29
+ }) {
30
+ }
31
+ export class OAuthConfig extends Schema.Class("Mcp.OAuthConfig")({
32
+ client_id: Schema.String.pipe(optional),
33
+ client_secret: Schema.String.pipe(optional),
34
+ scope: Schema.String.pipe(optional),
35
+ callback_port: Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 65535 })).pipe(optional),
36
+ redirect_uri: Schema.String.pipe(optional),
37
+ }) {
38
+ }
39
+ export class RemoteConfig extends Schema.Class("Mcp.RemoteConfig")({
40
+ type: Schema.Literal("remote"),
41
+ url: Schema.String,
42
+ headers: Schema.Record(Schema.String, Schema.String).pipe(optional),
43
+ oauth: Schema.Union([OAuthConfig, Schema.Literal(false)]).pipe(optional),
44
+ disabled: Schema.Boolean.pipe(optional),
45
+ codemode: Schema.Boolean.pipe(optional).annotate({
46
+ description: "Expose this server's tools through Code Mode. Defaults to true.",
47
+ }),
48
+ timeout: TimeoutConfig.pipe(optional),
49
+ }) {
50
+ }
51
+ export const ServerConfig = Schema.Union([LocalConfig, RemoteConfig]).pipe(Schema.toTaggedUnion("type"));
52
+ const Connected = Schema.Struct({ status: Schema.Literal("connected") }).annotate({
53
+ identifier: "Mcp.Status.Connected",
54
+ });
55
+ const Pending = Schema.Struct({ status: Schema.Literal("pending") }).annotate({
56
+ identifier: "Mcp.Status.Pending",
57
+ });
58
+ const Disabled = Schema.Struct({ status: Schema.Literal("disabled") }).annotate({
59
+ identifier: "Mcp.Status.Disabled",
60
+ });
61
+ const Failed = Schema.Struct({ status: Schema.Literal("failed"), error: Schema.String }).annotate({
62
+ identifier: "Mcp.Status.Failed",
63
+ });
64
+ const NeedsAuth = Schema.Struct({ status: Schema.Literal("needs_auth") }).annotate({
65
+ identifier: "Mcp.Status.NeedsAuth",
66
+ });
67
+ export const Status = Schema.Union([Connected, Pending, Disabled, Failed, NeedsAuth]).pipe(Schema.toTaggedUnion("status"));
68
+ export const Server = Schema.Struct({
69
+ name: Schema.String,
70
+ status: Status,
71
+ // Set for remote servers registered as OAuth integrations; lets clients act on the right integration
72
+ // without matching by name, which could collide with provider or plugin integrations.
73
+ integrationID: optional(IntegrationID),
74
+ }).annotate({ identifier: "Mcp.Server" });
75
+ export const Resource = Schema.Struct({
76
+ server: Schema.String,
77
+ name: Schema.String,
78
+ uri: Schema.String,
79
+ description: optional(Schema.String),
80
+ mimeType: optional(Schema.String),
81
+ }).annotate({ identifier: "Mcp.Resource" });
82
+ export const ResourceTemplate = Schema.Struct({
83
+ server: Schema.String,
84
+ name: Schema.String,
85
+ uriTemplate: Schema.String,
86
+ description: optional(Schema.String),
87
+ mimeType: optional(Schema.String),
88
+ }).annotate({ identifier: "Mcp.ResourceTemplate" });
89
+ export const ResourceCatalog = Schema.Struct({
90
+ resources: Schema.Array(Resource),
91
+ templates: Schema.Array(ResourceTemplate),
92
+ }).annotate({ identifier: "Mcp.ResourceCatalog" });
93
+ export const ResourceContentPart = Schema.Union([
94
+ Schema.Struct({
95
+ type: Schema.Literal("text"),
96
+ uri: Schema.String,
97
+ text: Schema.String,
98
+ mimeType: optional(Schema.String),
99
+ }),
100
+ Schema.Struct({
101
+ type: Schema.Literal("blob"),
102
+ uri: Schema.String,
103
+ blob: Schema.String,
104
+ mimeType: optional(Schema.String),
105
+ }),
106
+ ]).pipe(Schema.toTaggedUnion("type"), Schema.annotate({ identifier: "Mcp.ResourceContentPart" }));
107
+ export const ResourceContent = Schema.Struct({
108
+ server: Schema.String,
109
+ uri: Schema.String,
110
+ contents: Schema.Array(ResourceContentPart),
111
+ }).annotate({ identifier: "Mcp.ResourceContent" });
@@ -0,0 +1,186 @@
1
+ export * as Model from "./model.js";
2
+ import { Schema } from "effect";
3
+ import { Provider } from "./provider.js";
4
+ export declare const ID: Schema.brand<Schema.String, "Model.ID">;
5
+ export type ID = typeof ID.Type;
6
+ export declare const VariantID: Schema.brand<Schema.String, "Model.VariantID">;
7
+ export type VariantID = typeof VariantID.Type;
8
+ export declare const Ref: Schema.Struct<{
9
+ readonly id: Schema.brand<Schema.String, "Model.ID">;
10
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
11
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
12
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
13
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
14
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
15
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
16
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
17
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
18
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
19
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
20
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
21
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
22
+ };
23
+ readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
24
+ }> & {
25
+ parse: (input: string) => {
26
+ readonly id: string & import("effect/Brand").Brand<"Model.ID">;
27
+ readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
28
+ readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
29
+ };
30
+ };
31
+ export interface Ref extends Schema.Schema.Type<typeof Ref> {
32
+ }
33
+ export declare const Family: Schema.brand<Schema.String, "Model.Family">;
34
+ export type Family = typeof Family.Type;
35
+ export type ReasoningField = "reasoning" | "reasoning_content" | "reasoning_text" | (string & {});
36
+ export declare const ReasoningField: Schema.Codec<ReasoningField>;
37
+ export declare const MaxTokensField: Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>;
38
+ export type MaxTokensField = typeof MaxTokensField.Type;
39
+ export interface Compatibility extends Schema.Schema.Type<typeof Compatibility> {
40
+ }
41
+ export declare const Compatibility: Schema.Struct<{
42
+ readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<ReasoningField, ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<ReasoningField, ReasoningField, never, never>>, never, never>;
43
+ readonly maxTokensField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>>, Schema.optionalKey<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>, never, never>;
44
+ readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
45
+ }>;
46
+ export interface Capabilities extends Schema.Schema.Type<typeof Capabilities> {
47
+ }
48
+ export declare const Capabilities: Schema.Struct<{
49
+ readonly tools: Schema.Boolean;
50
+ readonly input: Schema.$Array<Schema.String>;
51
+ readonly output: Schema.$Array<Schema.String>;
52
+ }>;
53
+ export interface Cost extends Schema.Schema.Type<typeof Cost> {
54
+ }
55
+ export declare const Cost: Schema.Struct<{
56
+ readonly tier: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
57
+ readonly type: Schema.tag<"context">;
58
+ readonly size: Schema.Int;
59
+ }>>>, Schema.optionalKey<Schema.Struct<{
60
+ readonly type: Schema.tag<"context">;
61
+ readonly size: Schema.Int;
62
+ }>>, never, never>;
63
+ readonly input: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
64
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
65
+ };
66
+ readonly output: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
67
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
68
+ };
69
+ readonly cache: Schema.Struct<{
70
+ readonly read: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
71
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
72
+ };
73
+ readonly write: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
74
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
75
+ };
76
+ }>;
77
+ }>;
78
+ export interface Variant extends Schema.Schema.Type<typeof Variant> {
79
+ }
80
+ export declare const Variant: Schema.Struct<{
81
+ readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
82
+ readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
83
+ readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
84
+ readonly id: Schema.brand<Schema.String, "Model.VariantID">;
85
+ }>;
86
+ export interface Info extends Schema.Schema.Type<typeof Info> {
87
+ }
88
+ export declare const Info: Schema.Struct<{
89
+ readonly capabilities: Schema.Struct<{
90
+ readonly tools: Schema.Boolean;
91
+ readonly input: Schema.$Array<Schema.String>;
92
+ readonly output: Schema.$Array<Schema.String>;
93
+ }>;
94
+ readonly variants: Schema.$Array<Schema.Struct<{
95
+ readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
96
+ readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
97
+ readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
98
+ readonly id: Schema.brand<Schema.String, "Model.VariantID">;
99
+ }>>;
100
+ readonly time: Schema.Struct<{
101
+ readonly released: Schema.Finite;
102
+ }>;
103
+ readonly cost: Schema.$Array<Schema.Struct<{
104
+ readonly tier: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
105
+ readonly type: Schema.tag<"context">;
106
+ readonly size: Schema.Int;
107
+ }>>>, Schema.optionalKey<Schema.Struct<{
108
+ readonly type: Schema.tag<"context">;
109
+ readonly size: Schema.Int;
110
+ }>>, never, never>;
111
+ readonly input: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
112
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
113
+ };
114
+ readonly output: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
115
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
116
+ };
117
+ readonly cache: Schema.Struct<{
118
+ readonly read: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
119
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
120
+ };
121
+ readonly write: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
122
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
123
+ };
124
+ }>;
125
+ }>>;
126
+ readonly status: Schema.Literals<readonly ["alpha", "beta", "deprecated", "active"]>;
127
+ readonly enabled: Schema.Boolean;
128
+ readonly limit: Schema.Struct<{
129
+ readonly context: Schema.Int;
130
+ readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
131
+ readonly output: Schema.Int;
132
+ }>;
133
+ readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
134
+ readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
135
+ readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
136
+ readonly id: Schema.brand<Schema.String, "Model.ID">;
137
+ readonly modelID: Schema.brand<Schema.String, "Model.ID">;
138
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
139
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
140
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
141
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
142
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
143
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
144
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
145
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
146
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
147
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
148
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
149
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
150
+ };
151
+ readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.Family">>, never, never>;
152
+ readonly name: Schema.String;
153
+ readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
154
+ readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<ReasoningField, ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<ReasoningField, ReasoningField, never, never>>, never, never>;
155
+ readonly maxTokensField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>>, Schema.optionalKey<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>, never, never>;
156
+ readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
157
+ }>>>, Schema.optionalKey<Schema.Struct<{
158
+ readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<ReasoningField, ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<ReasoningField, ReasoningField, never, never>>, never, never>;
159
+ readonly maxTokensField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>>, Schema.optionalKey<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>, never, never>;
160
+ readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
161
+ }>>, never, never>;
162
+ readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
163
+ }> & {
164
+ default: (providerID: Provider.ID, id: ID) => {
165
+ id: string & import("effect/Brand").Brand<"Model.ID">;
166
+ modelID: string & import("effect/Brand").Brand<"Model.ID">;
167
+ providerID: string & import("effect/Brand").Brand<"Provider.ID">;
168
+ name: string & import("effect/Brand").Brand<"Model.ID">;
169
+ capabilities: {
170
+ tools: true;
171
+ input: string[];
172
+ output: string[];
173
+ };
174
+ variants: never[];
175
+ time: {
176
+ released: number;
177
+ };
178
+ cost: never[];
179
+ status: "active";
180
+ enabled: true;
181
+ limit: {
182
+ context: number;
183
+ output: number;
184
+ };
185
+ };
186
+ };
package/dist/model.js ADDED
@@ -0,0 +1,104 @@
1
+ export * as Model from "./model.js";
2
+ import { Schema } from "effect";
3
+ import { optional, statics } from "./schema.js";
4
+ import { Provider } from "./provider.js";
5
+ import { Money } from "./money.js";
6
+ export const ID = Schema.String.pipe(Schema.brand("Model.ID"));
7
+ export const VariantID = Schema.String.pipe(Schema.brand("Model.VariantID"));
8
+ export const Ref = Schema.Struct({
9
+ id: ID,
10
+ providerID: Provider.ID,
11
+ variant: VariantID.pipe(optional),
12
+ })
13
+ .annotate({ identifier: "Model.Ref" })
14
+ .pipe(statics((schema) => ({
15
+ parse: (input) => {
16
+ const providerEnd = input.indexOf("/");
17
+ if (providerEnd <= 0)
18
+ throw new Error(`Invalid model reference: ${input}`);
19
+ const providerID = input.slice(0, providerEnd);
20
+ const variantStart = input.indexOf("#", providerEnd + 1);
21
+ const id = input.slice(providerEnd + 1, variantStart === -1 ? undefined : variantStart);
22
+ const variant = variantStart === -1 ? undefined : input.slice(variantStart + 1);
23
+ if (!id || providerID.includes("#") || (variant !== undefined && (!variant || variant.includes("#"))))
24
+ throw new Error(`Invalid model reference: ${input}`);
25
+ return schema.make({
26
+ providerID: Provider.ID.make(providerID),
27
+ id: ID.make(id),
28
+ ...(variant ? { variant: VariantID.make(variant) } : {}),
29
+ });
30
+ },
31
+ })));
32
+ export const Family = Schema.String.pipe(Schema.brand("Model.Family"));
33
+ export const ReasoningField = Schema.Union([
34
+ Schema.Literals(["reasoning", "reasoning_content", "reasoning_text"]),
35
+ Schema.String,
36
+ ]).annotate({ identifier: "Model.ReasoningField" });
37
+ export const MaxTokensField = Schema.Literals(["max_completion_tokens", "max_tokens"]).annotate({
38
+ identifier: "Model.MaxTokensField",
39
+ });
40
+ export const Compatibility = Schema.Struct({
41
+ reasoningField: ReasoningField.pipe(optional),
42
+ maxTokensField: MaxTokensField.pipe(optional),
43
+ requireFinishReason: Schema.Boolean.pipe(optional),
44
+ }).annotate({ identifier: "Model.Compatibility" });
45
+ export const Capabilities = Schema.Struct({
46
+ tools: Schema.Boolean,
47
+ input: Schema.Array(Schema.String),
48
+ output: Schema.Array(Schema.String),
49
+ }).annotate({ identifier: "Model.Capabilities" });
50
+ export const Cost = Schema.Struct({
51
+ tier: Schema.Struct({
52
+ type: Schema.tag("context"),
53
+ size: Schema.Int,
54
+ }).pipe(optional),
55
+ input: Money.USDPerMillionTokens,
56
+ output: Money.USDPerMillionTokens,
57
+ cache: Schema.Struct({
58
+ read: Money.USDPerMillionTokens,
59
+ write: Money.USDPerMillionTokens,
60
+ }),
61
+ }).annotate({ identifier: "Model.Cost" });
62
+ export const Variant = Schema.Struct({
63
+ id: VariantID,
64
+ ...Provider.Overlays,
65
+ }).annotate({ identifier: "Model.Variant" });
66
+ export const Info = Schema.Struct({
67
+ id: ID,
68
+ modelID: ID,
69
+ providerID: Provider.ID,
70
+ family: Family.pipe(optional),
71
+ name: Schema.String,
72
+ compatibility: Compatibility.pipe(optional),
73
+ package: Provider.Package.pipe(optional),
74
+ ...Provider.Overlays,
75
+ capabilities: Capabilities,
76
+ variants: Schema.Array(Variant),
77
+ time: Schema.Struct({
78
+ released: Schema.Finite,
79
+ }),
80
+ cost: Schema.Array(Cost),
81
+ status: Schema.Literals(["alpha", "beta", "deprecated", "active"]),
82
+ enabled: Schema.Boolean,
83
+ limit: Schema.Struct({
84
+ context: Schema.Int,
85
+ input: Schema.Int.pipe(optional),
86
+ output: Schema.Int,
87
+ }),
88
+ })
89
+ .annotate({ identifier: "Model.Info" })
90
+ .pipe(statics(() => ({
91
+ default: (providerID, id) => ({
92
+ id,
93
+ modelID: id,
94
+ providerID,
95
+ name: id,
96
+ capabilities: { tools: true, input: ["text", "image"], output: ["text"] },
97
+ variants: [],
98
+ time: { released: 0 },
99
+ cost: [],
100
+ status: "active",
101
+ enabled: true,
102
+ limit: { context: 0, output: 0 },
103
+ }),
104
+ })));
@@ -0,0 +1,69 @@
1
+ export * as ModelsDev from "./models-dev.js";
2
+ export declare const Event: {
3
+ Refreshed: import("effect/Schema").Struct<{
4
+ readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
5
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
6
+ };
7
+ readonly created: import("effect/Schema").Finite;
8
+ readonly metadata: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>, never, never>;
9
+ readonly type: import("effect/Schema").Literal<"models-dev.refreshed">;
10
+ readonly location: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
11
+ readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
12
+ readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
13
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
14
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
15
+ }>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
16
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
17
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
18
+ }>, never, never>;
19
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
20
+ readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
21
+ readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
22
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
23
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
24
+ }>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
25
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
26
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
27
+ }>, never, never>;
28
+ }>>, never, never>;
29
+ readonly data: import("effect/Schema").Struct<{}>;
30
+ }> & {
31
+ type: "models-dev.refreshed";
32
+ durability: "ephemeral";
33
+ durable: undefined;
34
+ data: import("effect/Schema").Struct<{}>;
35
+ };
36
+ Definitions: readonly [import("effect/Schema").Struct<{
37
+ readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
38
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
39
+ };
40
+ readonly created: import("effect/Schema").Finite;
41
+ readonly metadata: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>, never, never>;
42
+ readonly type: import("effect/Schema").Literal<"models-dev.refreshed">;
43
+ readonly location: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
44
+ readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
45
+ readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
46
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
47
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
48
+ }>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
49
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
50
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
51
+ }>, never, never>;
52
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
53
+ readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
54
+ readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
55
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
56
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
57
+ }>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
58
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
59
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
60
+ }>, never, never>;
61
+ }>>, never, never>;
62
+ readonly data: import("effect/Schema").Struct<{}>;
63
+ }> & {
64
+ type: "models-dev.refreshed";
65
+ durability: "ephemeral";
66
+ durable: undefined;
67
+ data: import("effect/Schema").Struct<{}>;
68
+ }];
69
+ };
@@ -0,0 +1,7 @@
1
+ export * as ModelsDev from "./models-dev.js";
2
+ import { ephemeral, inventory } from "./event.js";
3
+ const Refreshed = ephemeral({
4
+ type: "models-dev.refreshed",
5
+ schema: {},
6
+ });
7
+ export const Event = { Refreshed, Definitions: inventory(Refreshed) };
@@ -0,0 +1,10 @@
1
+ export * as Money from "./money.js";
2
+ import { Schema } from "effect";
3
+ export declare const USD: Schema.brand<Schema.Finite, "Money.USD"> & {
4
+ zero: number & import("effect/Brand").Brand<"Money.USD">;
5
+ };
6
+ export type USD = typeof USD.Type;
7
+ export declare const USDPerMillionTokens: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
8
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
9
+ };
10
+ export type USDPerMillionTokens = typeof USDPerMillionTokens.Type;
package/dist/money.js ADDED
@@ -0,0 +1,5 @@
1
+ export * as Money from "./money.js";
2
+ import { Schema } from "effect";
3
+ import { statics } from "./schema.js";
4
+ export const USD = Schema.Finite.pipe(Schema.brand("Money.USD"), Schema.annotate({ identifier: "Money.USD" }), statics((schema) => ({ zero: schema.make(0) })));
5
+ export const USDPerMillionTokens = Schema.Finite.pipe(Schema.brand("Money.USDPerMillionTokens"), Schema.annotate({ identifier: "Money.USDPerMillionTokens" }), statics((schema) => ({ zero: schema.make(0) })));
@@ -0,0 +1,18 @@
1
+ export * as PermissionSaved from "./permission-saved.js";
2
+ import { Schema } from "effect";
3
+ export declare const ID: Schema.brand<Schema.String, "PermissionSaved.ID"> & {
4
+ create: () => string & import("effect/Brand").Brand<"PermissionSaved.ID">;
5
+ };
6
+ export type ID = typeof ID.Type;
7
+ export declare const Info: Schema.Struct<{
8
+ readonly id: Schema.brand<Schema.String, "PermissionSaved.ID"> & {
9
+ create: () => string & import("effect/Brand").Brand<"PermissionSaved.ID">;
10
+ };
11
+ readonly projectID: Schema.brand<Schema.String, "Project.ID"> & {
12
+ global: string & import("effect/Brand").Brand<"Project.ID">;
13
+ };
14
+ readonly action: Schema.String;
15
+ readonly resource: Schema.String;
16
+ }>;
17
+ export interface Info extends Schema.Schema.Type<typeof Info> {
18
+ }
@@ -0,0 +1,12 @@
1
+ export * as PermissionSaved from "./permission-saved.js";
2
+ import { Schema } from "effect";
3
+ import { ascending } from "./identifier.js";
4
+ import { ProjectID } from "./project-id.js";
5
+ import { statics } from "./schema.js";
6
+ export const ID = Schema.String.pipe(Schema.brand("PermissionSaved.ID"), statics((schema) => ({ create: () => schema.make("psv_" + ascending()) })));
7
+ export const Info = Schema.Struct({
8
+ id: ID,
9
+ projectID: ProjectID,
10
+ action: Schema.String,
11
+ resource: Schema.String,
12
+ }).annotate({ identifier: "PermissionSaved.Info" });
@@ -0,0 +1 @@
1
+ export * from "./v1/permission.js";
@@ -0,0 +1 @@
1
+ export * from "./v1/permission.js";