mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-10 02:08:31 +00:00
feat(schema): publish package
This commit is contained in:
parent
d51ba6ed94
commit
5e47501b8b
77 changed files with 413 additions and 325 deletions
2
bun.lock
2
bun.lock
|
|
@ -722,6 +722,7 @@
|
|||
},
|
||||
"packages/schema": {
|
||||
"name": "@opencode-ai/schema",
|
||||
"version": "1.17.11",
|
||||
"dependencies": {
|
||||
"effect": "catalog:",
|
||||
},
|
||||
|
|
@ -729,6 +730,7 @@
|
|||
"@tsconfig/bun": "catalog:",
|
||||
"@types/bun": "catalog:",
|
||||
"@typescript/native-preview": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
},
|
||||
},
|
||||
"packages/script": {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,26 @@
|
|||
{
|
||||
"$schema": "https://json.schemastore.org/package.json",
|
||||
"name": "@opencode-ai/schema",
|
||||
"private": true,
|
||||
"version": "1.17.11",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/anomalyco/opencode.git",
|
||||
"directory": "packages/schema"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./*": "./src/*.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "bun run script/build.ts",
|
||||
"typecheck": "tsgo --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
@ -17,6 +29,7 @@
|
|||
"devDependencies": {
|
||||
"@tsconfig/bun": "catalog:",
|
||||
"@types/bun": "catalog:",
|
||||
"@typescript/native-preview": "catalog:"
|
||||
"@typescript/native-preview": "catalog:",
|
||||
"typescript": "catalog:"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
9
packages/schema/script/build.ts
Normal file
9
packages/schema/script/build.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env bun
|
||||
|
||||
import { $ } from "bun"
|
||||
import { fileURLToPath } from "node:url"
|
||||
|
||||
process.chdir(fileURLToPath(new URL("..", import.meta.url)))
|
||||
|
||||
await $`rm -rf dist`
|
||||
await $`bun tsc -p tsconfig.build.json`
|
||||
45
packages/schema/script/publish.ts
Normal file
45
packages/schema/script/publish.ts
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#!/usr/bin/env bun
|
||||
|
||||
import { Script } from "@opencode-ai/script"
|
||||
import { $ } from "bun"
|
||||
import { rm } from "node:fs/promises"
|
||||
import { fileURLToPath } from "node:url"
|
||||
|
||||
process.chdir(fileURLToPath(new URL("..", import.meta.url)))
|
||||
|
||||
const originalText = await Bun.file("package.json").text()
|
||||
const pkg = JSON.parse(originalText) as {
|
||||
name: string
|
||||
version: string
|
||||
exports: Record<string, string | { import: string; types: string }>
|
||||
}
|
||||
const tarball = `${pkg.name.replace("@", "").replace("/", "-")}-${pkg.version}.tgz`
|
||||
|
||||
if ((await $`npm view ${pkg.name}@${pkg.version} version`.nothrow()).exitCode === 0) {
|
||||
console.log(`already published ${pkg.name}@${pkg.version}`)
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
try {
|
||||
await $`bun run typecheck`
|
||||
await $`bun run build`
|
||||
pkg.exports = Object.fromEntries(
|
||||
Object.entries(pkg.exports).map(([key, value]) => {
|
||||
if (typeof value !== "string") return [key, value]
|
||||
return [
|
||||
key,
|
||||
{
|
||||
import: value.replace("./src/", "./dist/").replace(/\.ts$/, ".js"),
|
||||
types: value.replace("./src/", "./dist/").replace(/\.ts$/, ".d.ts"),
|
||||
},
|
||||
]
|
||||
}),
|
||||
)
|
||||
await Bun.write("package.json", JSON.stringify(pkg, null, 2) + "\n")
|
||||
await rm(tarball, { force: true })
|
||||
await $`bun pm pack`
|
||||
await $`npm publish ${tarball} --tag ${Script.channel} --access public`
|
||||
} finally {
|
||||
await Bun.write("package.json", originalText)
|
||||
await rm(tarball, { force: true })
|
||||
}
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
export * as Agent from "./agent"
|
||||
export * as Agent from "./agent.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { define, inventory } from "./event"
|
||||
import { optional } from "./schema"
|
||||
import { Model } from "./model"
|
||||
import { Permission } from "./permission"
|
||||
import { Provider } from "./provider"
|
||||
import { PositiveInt, statics } from "./schema"
|
||||
import { define, inventory } from "./event.js"
|
||||
import { optional } from "./schema.js"
|
||||
import { Model } from "./model.js"
|
||||
import { Permission } from "./permission.js"
|
||||
import { Provider } from "./provider.js"
|
||||
import { PositiveInt, statics } from "./schema.js"
|
||||
|
||||
const Updated = define({ type: "agent.updated", schema: {} })
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
export * as Catalog from "./catalog"
|
||||
export * as Catalog from "./catalog.js"
|
||||
|
||||
import { define, inventory } from "./event"
|
||||
import { define, inventory } from "./event.js"
|
||||
|
||||
const Updated = define({ type: "catalog.updated", schema: {} })
|
||||
export const Event = { Updated, Definitions: inventory(Updated) }
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
export * as Command from "./command"
|
||||
export * as Command from "./command.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { Model } from "./model"
|
||||
import { optional } from "./schema.js"
|
||||
import { Model } from "./model.js"
|
||||
|
||||
export interface Info extends Schema.Schema.Type<typeof Info> {}
|
||||
export const Info = Schema.Struct({
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export * as Connection from "./connection"
|
||||
export * as Connection from "./connection.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { Credential } from "./credential"
|
||||
import { Credential } from "./credential.js"
|
||||
|
||||
export interface CredentialInfo extends Schema.Schema.Type<typeof CredentialInfo> {}
|
||||
export const CredentialInfo = Schema.Struct({
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
export * as Credential from "./credential"
|
||||
export * as Credential from "./credential.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { IntegrationMethodID } from "./integration-id"
|
||||
import { ascending } from "./identifier"
|
||||
import { NonNegativeInt, statics } from "./schema"
|
||||
import { optional } from "./schema.js"
|
||||
import { IntegrationMethodID } from "./integration-id.js"
|
||||
import { ascending } from "./identifier.js"
|
||||
import { NonNegativeInt, statics } from "./schema.js"
|
||||
|
||||
export const ID = Schema.String.pipe(
|
||||
Schema.brand("Credential.ID"),
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
export * as DurableEventManifest from "./durable-event-manifest"
|
||||
export * as DurableEventManifest from "./durable-event-manifest.js"
|
||||
|
||||
import { Event } from "./event"
|
||||
import { SessionEvent } from "./session-event"
|
||||
import { SessionV1 } from "./session-v1"
|
||||
import { Event } from "./event.js"
|
||||
import { SessionEvent } from "./session-event.js"
|
||||
import { SessionV1 } from "./session-v1.js"
|
||||
|
||||
export const SessionDurable = {
|
||||
definitions: Event.durable(SessionEvent.DurableDefinitions),
|
||||
|
|
|
|||
|
|
@ -1,37 +1,37 @@
|
|||
export * as EventManifest from "./event-manifest"
|
||||
export * as EventManifest from "./event-manifest.js"
|
||||
|
||||
import { Agent } from "./agent"
|
||||
import { Catalog } from "./catalog"
|
||||
import { Durable } from "./durable-event-manifest"
|
||||
import { Event } from "./event"
|
||||
import { FileSystem } from "./filesystem"
|
||||
import { FileSystemWatcher } from "./filesystem-watcher"
|
||||
import { InstallationEvent } from "./installation-event"
|
||||
import { Integration } from "./integration"
|
||||
import { LegacyEvent } from "./legacy-event"
|
||||
import { LspEvent } from "./lsp-event"
|
||||
import { McpEvent } from "./mcp-event"
|
||||
import { ModelsDev } from "./models-dev"
|
||||
import { Permission } from "./permission"
|
||||
import { PermissionV1 } from "./permission-v1"
|
||||
import { Plugin } from "./plugin"
|
||||
import { Project } from "./project"
|
||||
import { ProjectDirectories } from "./project-directories"
|
||||
import { Pty } from "./pty"
|
||||
import { Question } from "./question"
|
||||
import { QuestionV1 } from "./question-v1"
|
||||
import { Reference } from "./reference"
|
||||
import { ServerEvent } from "./server-event"
|
||||
import { Shell } from "./shell"
|
||||
import { SessionCompactionEvent } from "./session-compaction-event"
|
||||
import { SessionEvent } from "./session-event"
|
||||
import { SessionStatusEvent } from "./session-status-event"
|
||||
import { SessionTodo } from "./session-todo"
|
||||
import { SessionV1 } from "./session-v1"
|
||||
import { TuiEvent } from "./tui-event"
|
||||
import { VcsEvent } from "./vcs-event"
|
||||
import { WorkspaceEvent } from "./workspace-event"
|
||||
import { WorktreeEvent } from "./worktree-event"
|
||||
import { Agent } from "./agent.js"
|
||||
import { Catalog } from "./catalog.js"
|
||||
import { Durable } from "./durable-event-manifest.js"
|
||||
import { Event } from "./event.js"
|
||||
import { FileSystem } from "./filesystem.js"
|
||||
import { FileSystemWatcher } from "./filesystem-watcher.js"
|
||||
import { InstallationEvent } from "./installation-event.js"
|
||||
import { Integration } from "./integration.js"
|
||||
import { LegacyEvent } from "./legacy-event.js"
|
||||
import { LspEvent } from "./lsp-event.js"
|
||||
import { McpEvent } from "./mcp-event.js"
|
||||
import { ModelsDev } from "./models-dev.js"
|
||||
import { Permission } from "./permission.js"
|
||||
import { PermissionV1 } from "./permission-v1.js"
|
||||
import { Plugin } from "./plugin.js"
|
||||
import { Project } from "./project.js"
|
||||
import { ProjectDirectories } from "./project-directories.js"
|
||||
import { Pty } from "./pty.js"
|
||||
import { Question } from "./question.js"
|
||||
import { QuestionV1 } from "./question-v1.js"
|
||||
import { Reference } from "./reference.js"
|
||||
import { ServerEvent } from "./server-event.js"
|
||||
import { Shell } from "./shell.js"
|
||||
import { SessionCompactionEvent } from "./session-compaction-event.js"
|
||||
import { SessionEvent } from "./session-event.js"
|
||||
import { SessionStatusEvent } from "./session-status-event.js"
|
||||
import { SessionTodo } from "./session-todo.js"
|
||||
import { SessionV1 } from "./session-v1.js"
|
||||
import { TuiEvent } from "./tui-event.js"
|
||||
import { VcsEvent } from "./vcs-event.js"
|
||||
import { WorkspaceEvent } from "./workspace-event.js"
|
||||
import { WorktreeEvent } from "./worktree-event.js"
|
||||
|
||||
const sessionV1DurableDefinitions = SessionV1.Event.Definitions.filter((definition) => definition.durable !== undefined)
|
||||
const sessionV1LiveDefinitions = SessionV1.Event.Definitions.filter((definition) => definition.durable === undefined)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
export * as Event from "./event"
|
||||
export * as Event from "./event.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { ascending } from "./identifier"
|
||||
import { Location } from "./location"
|
||||
import { statics } from "./schema"
|
||||
import { optional } from "./schema.js"
|
||||
import { ascending } from "./identifier.js"
|
||||
import { Location } from "./location.js"
|
||||
import { statics } from "./schema.js"
|
||||
|
||||
export const ID = Schema.String.check(Schema.isStartsWith("evt_")).pipe(
|
||||
Schema.brand("Event.ID"),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export * as FileDiff from "./file-diff"
|
||||
export * as FileDiff from "./file-diff.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { optional } from "./schema.js"
|
||||
|
||||
export const Info = Schema.Struct({
|
||||
file: optional(Schema.String),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export * as FileSystemWatcher from "./filesystem-watcher"
|
||||
export * as FileSystemWatcher from "./filesystem-watcher.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { define, inventory } from "./event"
|
||||
import { define, inventory } from "./event.js"
|
||||
|
||||
const Updated = define({
|
||||
type: "file.watcher.updated",
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
export * as FileSystem from "./filesystem"
|
||||
export * as FileSystem from "./filesystem.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { define, inventory } from "./event"
|
||||
import { NonNegativeInt, PositiveInt, RelativePath } from "./schema"
|
||||
import { optional } from "./schema.js"
|
||||
import { define, inventory } from "./event.js"
|
||||
import { NonNegativeInt, PositiveInt, RelativePath } from "./schema.js"
|
||||
|
||||
const Edited = define({
|
||||
type: "file.edited",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export * as IdeEvent from "./ide-event"
|
||||
export * as IdeEvent from "./ide-event.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { Event } from "./event"
|
||||
import { Event } from "./event.js"
|
||||
|
||||
export const Installed = Event.define({
|
||||
type: "ide.installed",
|
||||
|
|
|
|||
|
|
@ -1,29 +1,29 @@
|
|||
export { Agent } from "./agent"
|
||||
export { Command } from "./command"
|
||||
export { Connection } from "./connection"
|
||||
export { Credential } from "./credential"
|
||||
export { Event } from "./event"
|
||||
export { FileSystem } from "./filesystem"
|
||||
export { Integration } from "./integration"
|
||||
export { LLM } from "./llm"
|
||||
export { Location } from "./location"
|
||||
export { Model } from "./model"
|
||||
export { Permission } from "./permission"
|
||||
export { PermissionSaved } from "./permission-saved"
|
||||
export { Project } from "./project"
|
||||
export { ProjectCopy } from "./project-copy"
|
||||
export { Provider } from "./provider"
|
||||
export { Reference } from "./reference"
|
||||
export { Revert } from "./revert"
|
||||
export { Session } from "./session"
|
||||
export { SessionInput } from "./session-input"
|
||||
export { SessionMessage } from "./session-message"
|
||||
export { Shell } from "./shell"
|
||||
export { Skill } from "./skill"
|
||||
export { Pty } from "./pty"
|
||||
export { PtyTicket } from "./pty-ticket"
|
||||
export { Question } from "./question"
|
||||
export { Workspace } from "./workspace"
|
||||
export { Prompt, Source, FileAttachment, AgentAttachment } from "./prompt"
|
||||
export { PromptInput } from "./prompt-input"
|
||||
export * from "./schema"
|
||||
export { Agent } from "./agent.js"
|
||||
export { Command } from "./command.js"
|
||||
export { Connection } from "./connection.js"
|
||||
export { Credential } from "./credential.js"
|
||||
export { Event } from "./event.js"
|
||||
export { FileSystem } from "./filesystem.js"
|
||||
export { Integration } from "./integration.js"
|
||||
export { LLM } from "./llm.js"
|
||||
export { Location } from "./location.js"
|
||||
export { Model } from "./model.js"
|
||||
export { Permission } from "./permission.js"
|
||||
export { PermissionSaved } from "./permission-saved.js"
|
||||
export { Project } from "./project.js"
|
||||
export { ProjectCopy } from "./project-copy.js"
|
||||
export { Provider } from "./provider.js"
|
||||
export { Reference } from "./reference.js"
|
||||
export { Revert } from "./revert.js"
|
||||
export { Session } from "./session.js"
|
||||
export { SessionInput } from "./session-input.js"
|
||||
export { SessionMessage } from "./session-message.js"
|
||||
export { Shell } from "./shell.js"
|
||||
export { Skill } from "./skill.js"
|
||||
export { Pty } from "./pty.js"
|
||||
export { PtyTicket } from "./pty-ticket.js"
|
||||
export { Question } from "./question.js"
|
||||
export { Workspace } from "./workspace.js"
|
||||
export { Prompt, Source, FileAttachment, AgentAttachment } from "./prompt.js"
|
||||
export { PromptInput } from "./prompt-input.js"
|
||||
export * from "./schema.js"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export * as InstallationEvent from "./installation-event"
|
||||
export * as InstallationEvent from "./installation-event.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { Event } from "./event"
|
||||
import { Event } from "./event.js"
|
||||
|
||||
export const Updated = Event.define({
|
||||
type: "installation.updated",
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
export * as Integration from "./integration"
|
||||
export * as Integration from "./integration.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { define, inventory } from "./event"
|
||||
import { Connection } from "./connection"
|
||||
import { ascending } from "./identifier"
|
||||
import { statics } from "./schema"
|
||||
import { IntegrationID, IntegrationMethodID } from "./integration-id"
|
||||
import { optional } from "./schema.js"
|
||||
import { define, inventory } from "./event.js"
|
||||
import { Connection } from "./connection.js"
|
||||
import { ascending } from "./identifier.js"
|
||||
import { statics } from "./schema.js"
|
||||
import { IntegrationID, IntegrationMethodID } from "./integration-id.js"
|
||||
|
||||
export const ID = IntegrationID
|
||||
export type ID = typeof ID.Type
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
export * from "./v1/legacy-event"
|
||||
export * from "./v1/legacy-event.js"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export * as LLM from "./llm"
|
||||
export * as LLM from "./llm.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { optional } from "./schema.js"
|
||||
|
||||
export const ProviderMetadata = Schema.Record(Schema.String, Schema.Record(Schema.String, Schema.Unknown)).annotate({
|
||||
identifier: "LLM.ProviderMetadata",
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
export * as Location from "./location"
|
||||
export * as Location from "./location.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { AbsolutePath, optional } from "./schema"
|
||||
import { ProjectID } from "./project-id"
|
||||
import { WorkspaceID } from "./workspace-id"
|
||||
import { AbsolutePath, optional } from "./schema.js"
|
||||
import { ProjectID } from "./project-id.js"
|
||||
import { WorkspaceID } from "./workspace-id.js"
|
||||
|
||||
export interface Ref extends Schema.Schema.Type<typeof Ref> {}
|
||||
export const Ref = Schema.Struct({
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
export * as LspEvent from "./lsp-event"
|
||||
export * as LspEvent from "./lsp-event.js"
|
||||
|
||||
import { Event } from "./event"
|
||||
import { Event } from "./event.js"
|
||||
|
||||
export const Updated = Event.define({ type: "lsp.updated", schema: {} })
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export * as McpEvent from "./mcp-event"
|
||||
export * as McpEvent from "./mcp-event.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { Event } from "./event"
|
||||
import { Event } from "./event.js"
|
||||
|
||||
export const ToolsChanged = Event.define({
|
||||
type: "mcp.tools.changed",
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
export * as Mcp from "./mcp"
|
||||
export * as Mcp from "./mcp.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { IntegrationID } from "./integration-id"
|
||||
import { optional } from "./schema.js"
|
||||
import { IntegrationID } from "./integration-id.js"
|
||||
|
||||
const Connected = Schema.Struct({ status: Schema.Literal("connected") }).annotate({
|
||||
identifier: "Mcp.Status.Connected",
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
export * as Model from "./model"
|
||||
export * as Model from "./model.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { Provider } from "./provider"
|
||||
import { statics } from "./schema"
|
||||
import { optional } from "./schema.js"
|
||||
import { Provider } from "./provider.js"
|
||||
import { statics } from "./schema.js"
|
||||
|
||||
export const ID = Schema.String.pipe(Schema.brand("ModelV2.ID"))
|
||||
export type ID = typeof ID.Type
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
export * as ModelsDev from "./models-dev"
|
||||
export * as ModelsDev from "./models-dev.js"
|
||||
|
||||
import { define, inventory } from "./event"
|
||||
import { define, inventory } from "./event.js"
|
||||
|
||||
const Refreshed = define({
|
||||
type: "models-dev.refreshed",
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
export * as PermissionSaved from "./permission-saved"
|
||||
export * as PermissionSaved from "./permission-saved.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { ascending } from "./identifier"
|
||||
import { ProjectID } from "./project-id"
|
||||
import { statics } from "./schema"
|
||||
import { ascending } from "./identifier.js"
|
||||
import { ProjectID } from "./project-id.js"
|
||||
import { statics } from "./schema.js"
|
||||
|
||||
export const ID = Schema.String.pipe(
|
||||
Schema.brand("PermissionSaved.ID"),
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
export * from "./v1/permission"
|
||||
export * from "./v1/permission.js"
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
export * as Permission from "./permission"
|
||||
export * as Permission from "./permission.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { define, inventory } from "./event"
|
||||
import { ascending } from "./identifier"
|
||||
import { SessionID } from "./session-id"
|
||||
import { statics } from "./schema"
|
||||
import { optional } from "./schema.js"
|
||||
import { define, inventory } from "./event.js"
|
||||
import { ascending } from "./identifier.js"
|
||||
import { SessionID } from "./session-id.js"
|
||||
import { statics } from "./schema.js"
|
||||
|
||||
export const ID = Schema.String.check(Schema.isStartsWith("per")).pipe(
|
||||
Schema.brand("PermissionV2.ID"),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export * as Plugin from "./plugin"
|
||||
export * as Plugin from "./plugin.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { define, inventory } from "./event"
|
||||
import { define, inventory } from "./event.js"
|
||||
|
||||
export const ID = Schema.String.pipe(Schema.brand("Plugin.ID"))
|
||||
export type ID = typeof ID.Type
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
export * as ProjectCopy from "./project-copy"
|
||||
export * as ProjectCopy from "./project-copy.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { ProjectID } from "./project-id"
|
||||
import { AbsolutePath } from "./schema"
|
||||
import { optional } from "./schema.js"
|
||||
import { ProjectID } from "./project-id.js"
|
||||
import { AbsolutePath } from "./schema.js"
|
||||
|
||||
export const StrategyID = Schema.Trim.pipe(Schema.check(Schema.isNonEmpty()), Schema.brand("ProjectCopy.StrategyID"))
|
||||
export type StrategyID = typeof StrategyID.Type
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export * as ProjectDirectories from "./project-directories"
|
||||
export * as ProjectDirectories from "./project-directories.js"
|
||||
|
||||
import { define, inventory } from "./event"
|
||||
import { Project } from "./project"
|
||||
import { define, inventory } from "./event.js"
|
||||
import { Project } from "./project.js"
|
||||
|
||||
const Updated = define({
|
||||
type: "project.directories.updated",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Schema } from "effect"
|
||||
import { statics } from "./schema"
|
||||
import { statics } from "./schema.js"
|
||||
|
||||
export const ProjectID = Schema.String.pipe(
|
||||
Schema.brand("Project.ID"),
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
export * as Project from "./project"
|
||||
export * as Project from "./project.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { define, inventory } from "./event"
|
||||
import { AbsolutePath, NonNegativeInt, optional } from "./schema"
|
||||
import { ProjectID } from "./project-id"
|
||||
import { define, inventory } from "./event.js"
|
||||
import { AbsolutePath, NonNegativeInt, optional } from "./schema.js"
|
||||
import { ProjectID } from "./project-id.js"
|
||||
|
||||
export const ID = ProjectID
|
||||
export type ID = typeof ID.Type
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
export * as PromptInput from "./prompt-input"
|
||||
export * as PromptInput from "./prompt-input.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { AgentAttachment, Source } from "./prompt"
|
||||
import { optional, statics } from "./schema"
|
||||
import { AgentAttachment, Source } from "./prompt.js"
|
||||
import { optional, statics } from "./schema.js"
|
||||
|
||||
export interface FileAttachment extends Schema.Schema.Type<typeof FileAttachment> {}
|
||||
export const FileAttachment = Schema.Struct({
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { statics } from "./schema"
|
||||
import { optional } from "./schema.js"
|
||||
import { statics } from "./schema.js"
|
||||
|
||||
export interface Source extends Schema.Schema.Type<typeof Source> {}
|
||||
export const Source = Schema.Struct({
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
export * as Provider from "./provider"
|
||||
export * as Provider from "./provider.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { Integration } from "./integration"
|
||||
import { statics } from "./schema"
|
||||
import { optional } from "./schema.js"
|
||||
import { Integration } from "./integration.js"
|
||||
import { statics } from "./schema.js"
|
||||
|
||||
export const ID = Schema.String.pipe(
|
||||
Schema.brand("ProviderV2.ID"),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export * as PtyTicket from "./pty-ticket"
|
||||
export * as PtyTicket from "./pty-ticket.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { PositiveInt } from "./schema"
|
||||
import { PositiveInt } from "./schema.js"
|
||||
|
||||
export const ConnectToken = Schema.Struct({
|
||||
ticket: Schema.String,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
export * as Pty from "./pty"
|
||||
export * as Pty from "./pty.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { define, inventory } from "./event"
|
||||
import { ascending } from "./identifier"
|
||||
import { NonNegativeInt, PositiveInt, statics } from "./schema"
|
||||
import { optional } from "./schema.js"
|
||||
import { define, inventory } from "./event.js"
|
||||
import { ascending } from "./identifier.js"
|
||||
import { NonNegativeInt, PositiveInt, statics } from "./schema.js"
|
||||
|
||||
const IDSchema = Schema.String.check(Schema.isStartsWith("pty")).pipe(Schema.brand("PtyID"))
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
export * from "./v1/question"
|
||||
export * from "./v1/question.js"
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
export * as Question from "./question"
|
||||
export * as Question from "./question.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { define, inventory } from "./event"
|
||||
import { ascending } from "./identifier"
|
||||
import { SessionID } from "./session-id"
|
||||
import { statics } from "./schema"
|
||||
import { optional } from "./schema.js"
|
||||
import { define, inventory } from "./event.js"
|
||||
import { ascending } from "./identifier.js"
|
||||
import { SessionID } from "./session-id.js"
|
||||
import { statics } from "./schema.js"
|
||||
|
||||
export const ID = Schema.String.check(Schema.isStartsWith("que")).pipe(
|
||||
Schema.brand("QuestionV2.ID"),
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
export * as Reference from "./reference"
|
||||
export * as Reference from "./reference.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { define, inventory } from "./event"
|
||||
import { AbsolutePath } from "./schema"
|
||||
import { optional } from "./schema.js"
|
||||
import { define, inventory } from "./event.js"
|
||||
import { AbsolutePath } from "./schema.js"
|
||||
|
||||
const Updated = define({ type: "reference.updated", schema: {} })
|
||||
export const Event = { Updated, Definitions: inventory(Updated) }
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
export * as Revert from "./revert"
|
||||
export * as Revert from "./revert.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { NonNegativeInt, RelativePath } from "./schema"
|
||||
import { SessionMessage } from "./session-message"
|
||||
import { optional } from "./schema.js"
|
||||
import { NonNegativeInt, RelativePath } from "./schema.js"
|
||||
import { SessionMessage } from "./session-message.js"
|
||||
|
||||
export const FileDiff = Schema.Struct({
|
||||
path: RelativePath,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
export * as ServerEvent from "./server-event"
|
||||
export * as ServerEvent from "./server-event.js"
|
||||
|
||||
import { Event } from "./event"
|
||||
import { Event } from "./event.js"
|
||||
|
||||
export const Connected = Event.define({ type: "server.connected", schema: {} })
|
||||
export const Disposed = Event.define({ type: "global.disposed", schema: {} })
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export * as SessionCompactionEvent from "./session-compaction-event"
|
||||
export * as SessionCompactionEvent from "./session-compaction-event.js"
|
||||
|
||||
import { Event } from "./event"
|
||||
import { SessionID } from "./session-id"
|
||||
import { Event } from "./event.js"
|
||||
import { SessionID } from "./session-id.js"
|
||||
|
||||
export const Compacted = Event.define({
|
||||
type: "session.compacted",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
export * as SessionDelivery from "./session-delivery"
|
||||
export * as SessionDelivery from "./session-delivery.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
export * as SessionEvent from "./session-event"
|
||||
export * as SessionEvent from "./session-event.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { Event } from "./event"
|
||||
import { ProviderMetadata, ToolContent } from "./llm"
|
||||
import { Delivery } from "./session-delivery"
|
||||
import { Model } from "./model"
|
||||
import { DateTimeUtcFromMillis, NonNegativeInt, RelativePath } from "./schema"
|
||||
import { FileAttachment, Prompt } from "./prompt"
|
||||
import { SessionID } from "./session-id"
|
||||
import { Location } from "./location"
|
||||
import { SessionMessage } from "./session-message"
|
||||
import { Revert } from "./revert"
|
||||
import { optional } from "./schema.js"
|
||||
import { Event } from "./event.js"
|
||||
import { ProviderMetadata, ToolContent } from "./llm.js"
|
||||
import { Delivery } from "./session-delivery.js"
|
||||
import { Model } from "./model.js"
|
||||
import { DateTimeUtcFromMillis, NonNegativeInt, RelativePath } from "./schema.js"
|
||||
import { FileAttachment, Prompt } from "./prompt.js"
|
||||
import { SessionID } from "./session-id.js"
|
||||
import { Location } from "./location.js"
|
||||
import { SessionMessage } from "./session-message.js"
|
||||
import { Revert } from "./revert.js"
|
||||
|
||||
export { FileAttachment }
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Schema } from "effect"
|
||||
import { descending } from "./identifier"
|
||||
import { statics } from "./schema"
|
||||
import { descending } from "./identifier.js"
|
||||
import { statics } from "./schema.js"
|
||||
|
||||
export const SessionID = Schema.String.check(Schema.isStartsWith("ses")).pipe(
|
||||
Schema.brand("SessionID"),
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
export * as SessionInput from "./session-input"
|
||||
export * as SessionInput from "./session-input.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { Prompt } from "./prompt"
|
||||
import { DateTimeUtcFromMillis, NonNegativeInt } from "./schema"
|
||||
import { SessionDelivery } from "./session-delivery"
|
||||
import { SessionID } from "./session-id"
|
||||
import { SessionMessage } from "./session-message"
|
||||
import { optional } from "./schema.js"
|
||||
import { Prompt } from "./prompt.js"
|
||||
import { DateTimeUtcFromMillis, NonNegativeInt } from "./schema.js"
|
||||
import { SessionDelivery } from "./session-delivery.js"
|
||||
import { SessionID } from "./session-id.js"
|
||||
import { SessionMessage } from "./session-message.js"
|
||||
|
||||
export const Delivery = SessionDelivery.Delivery
|
||||
export type Delivery = SessionDelivery.Delivery
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
export * as SessionMessage from "./session-message"
|
||||
export * as SessionMessage from "./session-message.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { ProviderMetadata, ToolContent } from "./llm"
|
||||
import { Model } from "./model"
|
||||
import { FileAttachment, Prompt } from "./prompt"
|
||||
import { DateTimeUtcFromMillis, RelativePath, statics } from "./schema"
|
||||
import { SessionID } from "./session-id"
|
||||
import { ascending } from "./identifier"
|
||||
import { optional } from "./schema.js"
|
||||
import { ProviderMetadata, ToolContent } from "./llm.js"
|
||||
import { Model } from "./model.js"
|
||||
import { FileAttachment, Prompt } from "./prompt.js"
|
||||
import { DateTimeUtcFromMillis, RelativePath, statics } from "./schema.js"
|
||||
import { SessionID } from "./session-id.js"
|
||||
import { ascending } from "./identifier.js"
|
||||
|
||||
export const ID = Schema.String.check(Schema.isStartsWith("msg_")).pipe(
|
||||
Schema.brand("Session.Message.ID"),
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
export * as SessionStatusEvent from "./session-status-event"
|
||||
export * as SessionStatusEvent from "./session-status-event.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { Event } from "./event"
|
||||
import { NonNegativeInt } from "./schema"
|
||||
import { SessionID } from "./session-id"
|
||||
import { optional } from "./schema.js"
|
||||
import { Event } from "./event.js"
|
||||
import { NonNegativeInt } from "./schema.js"
|
||||
import { SessionID } from "./session-id.js"
|
||||
|
||||
export const Info = Schema.Union([
|
||||
Schema.Struct({
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
export * as SessionTodo from "./session-todo"
|
||||
export * as SessionTodo from "./session-todo.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { define, inventory } from "./event"
|
||||
import { SessionID } from "./session-id"
|
||||
import { define, inventory } from "./event.js"
|
||||
import { SessionID } from "./session-id.js"
|
||||
|
||||
export const Info = Schema.Struct({
|
||||
content: Schema.String.annotate({ description: "Brief description of the task" }),
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
export * from "./v1/session"
|
||||
export * from "./v1/session.js"
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
export * as Session from "./session"
|
||||
export * as Session from "./session.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { Agent } from "./agent"
|
||||
import { Location } from "./location"
|
||||
import { Model } from "./model"
|
||||
import { Project } from "./project"
|
||||
import { DateTimeUtcFromMillis, optional, RelativePath } from "./schema"
|
||||
import { SessionEvent } from "./session-event"
|
||||
import { SessionID } from "./session-id"
|
||||
import { Revert } from "./revert"
|
||||
import { Agent } from "./agent.js"
|
||||
import { Location } from "./location.js"
|
||||
import { Model } from "./model.js"
|
||||
import { Project } from "./project.js"
|
||||
import { DateTimeUtcFromMillis, optional, RelativePath } from "./schema.js"
|
||||
import { SessionEvent } from "./session-event.js"
|
||||
import { SessionID } from "./session-id.js"
|
||||
import { Revert } from "./revert.js"
|
||||
|
||||
export const ID = SessionID
|
||||
export type ID = SessionID
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
export * as Shell from "./shell"
|
||||
export * as Shell from "./shell.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { define, inventory } from "./event"
|
||||
import { ascending } from "./identifier"
|
||||
import { NonNegativeInt, statics } from "./schema"
|
||||
import { optional } from "./schema.js"
|
||||
import { define, inventory } from "./event.js"
|
||||
import { ascending } from "./identifier.js"
|
||||
import { NonNegativeInt, statics } from "./schema.js"
|
||||
|
||||
const IDSchema = Schema.String.check(Schema.isStartsWith("sh_")).pipe(Schema.brand("ShellID"))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
export * as Skill from "./skill"
|
||||
export * as Skill from "./skill.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { AbsolutePath } from "./schema"
|
||||
import { optional } from "./schema.js"
|
||||
import { AbsolutePath } from "./schema.js"
|
||||
|
||||
export interface DirectorySource extends Schema.Schema.Type<typeof DirectorySource> {}
|
||||
export const DirectorySource = Schema.Struct({
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
export * as TuiEvent from "./tui-event"
|
||||
export * as TuiEvent from "./tui-event.js"
|
||||
|
||||
import { Effect, Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { Event } from "./event"
|
||||
import { PositiveInt } from "./schema"
|
||||
import { SessionID } from "./session-id"
|
||||
import { optional } from "./schema.js"
|
||||
import { Event } from "./event.js"
|
||||
import { PositiveInt } from "./schema.js"
|
||||
import { SessionID } from "./session-id.js"
|
||||
|
||||
const DEFAULT_TOAST_DURATION = 5000
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
export * as LegacyEvent from "./legacy-event"
|
||||
export * as LegacyEvent from "./legacy-event.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { define, inventory } from "../event"
|
||||
import { SessionID } from "../session-id"
|
||||
import { SessionV1 } from "./session"
|
||||
import { define, inventory } from "../event.js"
|
||||
import { SessionID } from "../session-id.js"
|
||||
import { SessionV1 } from "./session.js"
|
||||
|
||||
export const CommandExecuted = define({
|
||||
type: "command.executed",
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
export * as PermissionV1 from "./permission"
|
||||
export * as PermissionV1 from "./permission.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { define, inventory } from "../event"
|
||||
import { ascending } from "../identifier"
|
||||
import { Project } from "../project"
|
||||
import { statics } from "../schema"
|
||||
import { SessionID } from "../session-id"
|
||||
import { define, inventory } from "../event.js"
|
||||
import { ascending } from "../identifier.js"
|
||||
import { Project } from "../project.js"
|
||||
import { statics } from "../schema.js"
|
||||
import { SessionID } from "../session-id.js"
|
||||
|
||||
export const ID = Schema.String.check(Schema.isStartsWith("per")).pipe(
|
||||
Schema.brand("PermissionID"),
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
export * as QuestionV1 from "./question"
|
||||
export * as QuestionV1 from "./question.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { define, inventory } from "../event"
|
||||
import { ascending } from "../identifier"
|
||||
import { statics } from "../schema"
|
||||
import { SessionID } from "../session-id"
|
||||
import { SessionV1 } from "./session"
|
||||
import { define, inventory } from "../event.js"
|
||||
import { ascending } from "../identifier.js"
|
||||
import { statics } from "../schema.js"
|
||||
import { SessionID } from "../session-id.js"
|
||||
import { SessionV1 } from "./session.js"
|
||||
|
||||
export const ID = Schema.String.check(Schema.isStartsWith("que")).pipe(
|
||||
Schema.brand("QuestionID"),
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
export * as SessionV1 from "./session"
|
||||
export * as SessionV1 from "./session.js"
|
||||
|
||||
import { Effect, Schema, Types } from "effect"
|
||||
import { define, inventory } from "../event"
|
||||
import { FileDiff } from "../file-diff"
|
||||
import { Project } from "../project"
|
||||
import { Provider } from "../provider"
|
||||
import { Model } from "../model"
|
||||
import { NonNegativeInt, optional, statics } from "../schema"
|
||||
import { ascending } from "../identifier"
|
||||
import { SessionID } from "../session-id"
|
||||
import { WorkspaceID } from "../workspace-id"
|
||||
import { PermissionV1 } from "./permission"
|
||||
import { define, inventory } from "../event.js"
|
||||
import { FileDiff } from "../file-diff.js"
|
||||
import { Project } from "../project.js"
|
||||
import { Provider } from "../provider.js"
|
||||
import { Model } from "../model.js"
|
||||
import { NonNegativeInt, optional, statics } from "../schema.js"
|
||||
import { ascending } from "../identifier.js"
|
||||
import { SessionID } from "../session-id.js"
|
||||
import { WorkspaceID } from "../workspace-id.js"
|
||||
import { PermissionV1 } from "./permission.js"
|
||||
|
||||
const Timestamp = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
export * as VcsEvent from "./vcs-event"
|
||||
export * as VcsEvent from "./vcs-event.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { Event } from "./event"
|
||||
import { optional } from "./schema.js"
|
||||
import { Event } from "./event.js"
|
||||
|
||||
export const BranchUpdated = Event.define({
|
||||
type: "vcs.branch.updated",
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
export * as WorkspaceEvent from "./workspace-event"
|
||||
export * as WorkspaceEvent from "./workspace-event.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { Event } from "./event"
|
||||
import { WorkspaceID } from "./workspace-id"
|
||||
import { Event } from "./event.js"
|
||||
import { WorkspaceID } from "./workspace-id.js"
|
||||
|
||||
export const ConnectionStatus = Schema.Struct({
|
||||
workspaceID: WorkspaceID,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Schema } from "effect"
|
||||
import { ascending } from "./identifier"
|
||||
import { statics } from "./schema"
|
||||
import { ascending } from "./identifier.js"
|
||||
import { statics } from "./schema.js"
|
||||
|
||||
export const WorkspaceID = Schema.String.check(Schema.isStartsWith("wrk")).pipe(
|
||||
Schema.brand("WorkspaceV2.ID"),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export * as Workspace from "./workspace"
|
||||
export * as Workspace from "./workspace.js"
|
||||
|
||||
import { WorkspaceEvent } from "./workspace-event"
|
||||
import { WorkspaceID } from "./workspace-id"
|
||||
import { WorkspaceEvent } from "./workspace-event.js"
|
||||
import { WorkspaceID } from "./workspace-id.js"
|
||||
|
||||
export const ID = WorkspaceID
|
||||
export type ID = WorkspaceID
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
export * as WorktreeEvent from "./worktree-event"
|
||||
export * as WorktreeEvent from "./worktree-event.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { Event } from "./event"
|
||||
import { optional } from "./schema.js"
|
||||
import { Event } from "./event.js"
|
||||
|
||||
export const Ready = Event.define({
|
||||
type: "worktree.ready",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { describe, expect, test } from "bun:test"
|
||||
import { FileSystem } from "../src/filesystem"
|
||||
import { FileSystem } from "../src/filesystem.js"
|
||||
|
||||
describe("schema compatibility", () => {
|
||||
test("moved class schemas remain constructible", () => {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import { describe, expect, test } from "bun:test"
|
||||
import { Schema } from "effect"
|
||||
import { Agent } from "../src/agent"
|
||||
import { FileSystem } from "../src/filesystem"
|
||||
import { Model } from "../src/model"
|
||||
import { Project } from "../src/project"
|
||||
import { Pty } from "../src/pty"
|
||||
import { Question } from "../src/question"
|
||||
import { Session } from "../src/session"
|
||||
import { SessionTodo } from "../src/session-todo"
|
||||
import { optional } from "../src/schema"
|
||||
import { Agent } from "../src/agent.js"
|
||||
import { FileSystem } from "../src/filesystem.js"
|
||||
import { Model } from "../src/model.js"
|
||||
import { Project } from "../src/project.js"
|
||||
import { Pty } from "../src/pty.js"
|
||||
import { Question } from "../src/question.js"
|
||||
import { Session } from "../src/session.js"
|
||||
import { SessionTodo } from "../src/session-todo.js"
|
||||
import { optional } from "../src/schema.js"
|
||||
|
||||
describe("contract hygiene", () => {
|
||||
test("optional properties preserve transformations and omit undefined while encoding", () => {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { describe, expect, test } from "bun:test"
|
||||
import { Agent, FileSystem, Integration, Permission, Project, Reference, Session, Workspace } from "../src"
|
||||
import { EventManifest } from "../src/event-manifest"
|
||||
import { IdeEvent } from "../src/ide-event"
|
||||
import { SessionEvent } from "../src/session-event"
|
||||
import { SessionTodo } from "../src/session-todo"
|
||||
import { SessionV1 } from "../src/session-v1"
|
||||
import { WorkspaceEvent } from "../src/workspace-event"
|
||||
import { Agent, FileSystem, Integration, Permission, Project, Reference, Session, Workspace } from "../src/index.js"
|
||||
import { EventManifest } from "../src/event-manifest.js"
|
||||
import { IdeEvent } from "../src/ide-event.js"
|
||||
import { SessionEvent } from "../src/session-event.js"
|
||||
import { SessionTodo } from "../src/session-todo.js"
|
||||
import { SessionV1 } from "../src/session-v1.js"
|
||||
import { WorkspaceEvent } from "../src/workspace-event.js"
|
||||
|
||||
describe("public event manifest", () => {
|
||||
test("owns the complete public event surface", () => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { describe, expect, test } from "bun:test"
|
||||
import { Schema } from "effect"
|
||||
import { Event } from "../src/event"
|
||||
import { Event } from "../src/event.js"
|
||||
|
||||
describe("public event schemas", () => {
|
||||
test("definition is pure", () => {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { describe, expect, test } from "bun:test"
|
||||
import { LegacyEvent } from "../src/legacy-event"
|
||||
import { PermissionV1 } from "../src/permission-v1"
|
||||
import { QuestionV1 } from "../src/question-v1"
|
||||
import { Project } from "../src/project"
|
||||
import { SessionV1 } from "../src/session-v1"
|
||||
import { LegacyEvent } from "../src/legacy-event.js"
|
||||
import { PermissionV1 } from "../src/permission-v1.js"
|
||||
import { QuestionV1 } from "../src/question-v1.js"
|
||||
import { Project } from "../src/project.js"
|
||||
import { SessionV1 } from "../src/session-v1.js"
|
||||
|
||||
describe("legacy public event schemas", () => {
|
||||
test("owns all SessionV1 definitions", () => {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { expect, test } from "bun:test"
|
||||
import { LegacyEvent } from "../src/legacy-event"
|
||||
import { PermissionV1 } from "../src/permission-v1"
|
||||
import { QuestionV1 } from "../src/question-v1"
|
||||
import { SessionV1 } from "../src/session-v1"
|
||||
import { LegacyEvent as IsolatedLegacyEvent } from "../src/v1/legacy-event"
|
||||
import { PermissionV1 as IsolatedPermissionV1 } from "../src/v1/permission"
|
||||
import { QuestionV1 as IsolatedQuestionV1 } from "../src/v1/question"
|
||||
import { SessionV1 as IsolatedSessionV1 } from "../src/v1/session"
|
||||
import { LegacyEvent } from "../src/legacy-event.js"
|
||||
import { PermissionV1 } from "../src/permission-v1.js"
|
||||
import { QuestionV1 } from "../src/question-v1.js"
|
||||
import { SessionV1 } from "../src/session-v1.js"
|
||||
import { LegacyEvent as IsolatedLegacyEvent } from "../src/v1/legacy-event.js"
|
||||
import { PermissionV1 as IsolatedPermissionV1 } from "../src/v1/permission.js"
|
||||
import { QuestionV1 as IsolatedQuestionV1 } from "../src/v1/question.js"
|
||||
import { SessionV1 as IsolatedSessionV1 } from "../src/v1/session.js"
|
||||
|
||||
test("compatibility entrypoints preserve isolated V1 schema identity", () => {
|
||||
expect(LegacyEvent).toBe(IsolatedLegacyEvent)
|
||||
|
|
|
|||
11
packages/schema/tsconfig.build.json
Normal file
11
packages/schema/tsconfig.build.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "dist",
|
||||
"noEmit": false,
|
||||
"declaration": true
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
|
|
@ -3,6 +3,10 @@
|
|||
"extends": "@tsconfig/bun/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"allowImportingTsExtensions": false,
|
||||
"allowJs": false,
|
||||
"noUncheckedIndexedAccess": false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"$schema": "https://json.schemastore.org/package",
|
||||
"name": "@opencode-ai/script",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"semver": "^7.6.3"
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@ if (Script.release && !Script.preview) {
|
|||
|
||||
await prepareReleaseFiles()
|
||||
|
||||
console.log("\n=== schema ===\n")
|
||||
await $`bun ./packages/schema/script/publish.ts`
|
||||
|
||||
console.log("\n=== cli ===\n")
|
||||
await $`bun ./packages/cli/script/publish.ts`
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue