@opencode/schema 0.0.0-reserved → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.d.ts +164 -0
- package/dist/agent.js +46 -0
- package/dist/catalog.d.ts +69 -0
- package/dist/catalog.js +4 -0
- package/dist/command.d.ts +76 -0
- package/dist/command.js +13 -0
- package/dist/config/agent.d.ts +42 -0
- package/dist/config/agent.js +20 -0
- package/dist/config/command.d.ts +28 -0
- package/dist/config/command.js +13 -0
- package/dist/config/compaction.d.ts +14 -0
- package/dist/config/compaction.js +13 -0
- package/dist/config/experimental.d.ts +17 -0
- package/dist/config/experimental.js +16 -0
- package/dist/config/formatter.d.ts +11 -0
- package/dist/config/formatter.js +11 -0
- package/dist/config/lsp.d.ts +20 -0
- package/dist/config/lsp.js +16 -0
- package/dist/config/mcp.d.ts +18 -0
- package/dist/config/mcp.js +14 -0
- package/dist/config/media.d.ts +15 -0
- package/dist/config/media.js +14 -0
- package/dist/config/model.d.ts +18 -0
- package/dist/config/model.js +28 -0
- package/dist/config/plugin.d.ts +11 -0
- package/dist/config/plugin.js +10 -0
- package/dist/config/policy.d.ts +10 -0
- package/dist/config/policy.js +8 -0
- package/dist/config/provider.d.ts +173 -0
- package/dist/config/provider.js +72 -0
- package/dist/config/reference.d.ts +21 -0
- package/dist/config/reference.js +18 -0
- package/dist/config/tool-output.d.ts +8 -0
- package/dist/config/tool-output.js +8 -0
- package/dist/config/warming.d.ts +10 -0
- package/dist/config/warming.js +16 -0
- package/dist/config/watcher.d.ts +7 -0
- package/dist/config/watcher.js +7 -0
- package/dist/config/websearch.d.ts +9 -0
- package/dist/config/websearch.js +13 -0
- package/dist/config/worktree.d.ts +7 -0
- package/dist/config/worktree.js +7 -0
- package/dist/config.d.ts +180 -0
- package/dist/config.js +138 -0
- package/dist/connection.d.ts +28 -0
- package/dist/connection.js +15 -0
- package/dist/credential.d.ts +191 -0
- package/dist/credential.js +39 -0
- package/dist/durable-event-manifest.d.ts +3 -0
- package/dist/durable-event-manifest.js +5 -0
- package/dist/event-log.d.ts +14 -0
- package/dist/event-log.js +17 -0
- package/dist/event-manifest.d.ts +12758 -0
- package/dist/event-manifest.js +47 -0
- package/dist/event.d.ts +142 -0
- package/dist/event.js +110 -0
- package/dist/file-diff.d.ts +21 -0
- package/dist/file-diff.js +18 -0
- package/dist/filesystem-v1.d.ts +1 -0
- package/dist/filesystem-v1.js +1 -0
- package/dist/filesystem.d.ts +118 -0
- package/dist/filesystem.js +35 -0
- package/dist/form.d.ts +1259 -0
- package/dist/form.js +120 -0
- package/dist/ide-event.d.ts +76 -0
- package/dist/ide-event.js +10 -0
- package/dist/identifier.d.ts +3 -0
- package/dist/identifier.js +24 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +41 -0
- package/dist/installation-event.d.ts +149 -0
- package/dist/installation-event.js +16 -0
- package/dist/instruction-entry.d.ts +29 -0
- package/dist/instruction-entry.js +26 -0
- package/dist/instruction.d.ts +13 -0
- package/dist/instruction.js +8 -0
- package/dist/integration-id.d.ts +5 -0
- package/dist/integration-id.js +3 -0
- package/dist/integration.d.ts +1604 -0
- package/dist/integration.js +85 -0
- package/dist/legacy-event.d.ts +1 -0
- package/dist/legacy-event.js +1 -0
- package/dist/llm.d.ts +4 -0
- package/dist/llm.js +3 -0
- package/dist/location.d.ts +37 -0
- package/dist/location.js +22 -0
- package/dist/lsp-event.d.ts +67 -0
- package/dist/lsp-event.js +4 -0
- package/dist/mcp-event.d.ts +222 -0
- package/dist/mcp-event.js +24 -0
- package/dist/mcp.d.ts +138 -0
- package/dist/mcp.js +111 -0
- package/dist/model.d.ts +247 -0
- package/dist/model.js +116 -0
- package/dist/models-dev.d.ts +69 -0
- package/dist/models-dev.js +7 -0
- package/dist/money.d.ts +10 -0
- package/dist/money.js +5 -0
- package/dist/permission-saved.d.ts +18 -0
- package/dist/permission-saved.js +12 -0
- package/dist/permission-v1.d.ts +1 -0
- package/dist/permission-v1.js +1 -0
- package/dist/permission.d.ts +311 -0
- package/dist/permission.js +46 -0
- package/dist/persistent-pty.d.ts +559 -0
- package/dist/persistent-pty.js +55 -0
- package/dist/plugin.d.ts +132 -0
- package/dist/plugin.js +37 -0
- package/dist/project-id.d.ts +5 -0
- package/dist/project-id.js +3 -0
- package/dist/project.d.ts +264 -0
- package/dist/project.js +46 -0
- package/dist/prompt-input.d.ts +143 -0
- package/dist/prompt-input.js +25 -0
- package/dist/prompt.d.ts +297 -0
- package/dist/prompt.js +61 -0
- package/dist/provider.d.ts +105 -0
- package/dist/provider.js +50 -0
- package/dist/pty-ticket.d.ts +8 -0
- package/dist/pty-ticket.js +7 -0
- package/dist/pty.d.ts +462 -0
- package/dist/pty.js +43 -0
- package/dist/question-v1.d.ts +1 -0
- package/dist/question-v1.js +1 -0
- package/dist/question.d.ts +15 -0
- package/dist/question.js +15 -0
- package/dist/reference.d.ts +120 -0
- package/dist/reference.js +30 -0
- package/dist/rpc.d.ts +111 -0
- package/dist/rpc.js +9 -0
- package/dist/schema.d.ts +10 -0
- package/dist/schema.js +14 -0
- package/dist/server-event.d.ts +132 -0
- package/dist/server-event.js +5 -0
- package/dist/session-compaction-event.d.ts +87 -0
- package/dist/session-compaction-event.js +10 -0
- package/dist/session-error.d.ts +9 -0
- package/dist/session-error.js +8 -0
- package/dist/session-event.d.ts +21315 -0
- package/dist/session-event.js +557 -0
- package/dist/session-fork.d.ts +26 -0
- package/dist/session-fork.js +11 -0
- package/dist/session-id.d.ts +6 -0
- package/dist/session-id.js +10 -0
- package/dist/session-inbox.d.ts +748 -0
- package/dist/session-inbox.js +47 -0
- package/dist/session-message.d.ts +2007 -0
- package/dist/session-message.js +227 -0
- package/dist/session-metadata.d.ts +8 -0
- package/dist/session-metadata.js +9 -0
- package/dist/session-provider-context.d.ts +54 -0
- package/dist/session-provider-context.js +17 -0
- package/dist/session-revert.d.ts +672 -0
- package/dist/session-revert.js +63 -0
- package/dist/session-stats.d.ts +186 -0
- package/dist/session-stats.js +53 -0
- package/dist/session-status-event.d.ts +299 -0
- package/dist/session-status-event.js +45 -0
- package/dist/session-transfer.d.ts +897 -0
- package/dist/session-transfer.js +8 -0
- package/dist/session-v1.d.ts +1 -0
- package/dist/session-v1.js +1 -0
- package/dist/session.d.ts +236 -0
- package/dist/session.js +55 -0
- package/dist/shell.d.ts +381 -0
- package/dist/shell.js +58 -0
- package/dist/skill.d.ts +133 -0
- package/dist/skill.js +48 -0
- package/dist/snapshot.d.ts +4 -0
- package/dist/snapshot.js +3 -0
- package/dist/token-usage.d.ts +14 -0
- package/dist/token-usage.js +14 -0
- package/dist/tool.d.ts +78 -0
- package/dist/tool.js +22 -0
- package/dist/tui-event.d.ts +307 -0
- package/dist/tui-event.js +53 -0
- package/dist/v1/filesystem.d.ts +78 -0
- package/dist/v1/filesystem.js +8 -0
- package/dist/v1/legacy-event.d.ts +108 -0
- package/dist/v1/legacy-event.js +15 -0
- package/dist/v1/permission.d.ts +316 -0
- package/dist/v1/permission.js +41 -0
- package/dist/v1/question.d.ts +444 -0
- package/dist/v1/question.js +57 -0
- package/dist/v1/session.d.ts +7657 -0
- package/dist/v1/session.js +535 -0
- package/dist/vcs-event.d.ts +76 -0
- package/dist/vcs-event.js +11 -0
- package/dist/vcs.d.ts +35 -0
- package/dist/vcs.js +23 -0
- package/dist/websearch.d.ts +108 -0
- package/dist/websearch.js +31 -0
- package/dist/workspace-event.d.ts +247 -0
- package/dist/workspace-event.js +25 -0
- package/dist/workspace-id.d.ts +6 -0
- package/dist/workspace-id.js +16 -0
- package/dist/workspace.d.ts +15 -0
- package/dist/workspace.js +14 -0
- package/dist/worktree-event.d.ts +153 -0
- package/dist/worktree-event.js +18 -0
- package/dist/worktree.d.ts +277 -0
- package/dist/worktree.js +82 -0
- package/package.json +33 -6
- package/README.md +0 -5
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * as SessionTransfer from "./session-transfer.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { Session } from "./session.js";
|
|
4
|
+
import { SessionMessage } from "./session-message.js";
|
|
5
|
+
export const Data = Schema.Struct({
|
|
6
|
+
info: Session.Info,
|
|
7
|
+
messages: Schema.Array(SessionMessage.Info),
|
|
8
|
+
}).annotate({ identifier: "SessionTransfer.Data" });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./v1/session.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./v1/session.js";
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
export * as Session from "./session.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { SessionEvent } from "./session-event.js";
|
|
4
|
+
import { SessionID } from "./session-id.js";
|
|
5
|
+
import { SessionMetadata } from "./session-metadata.js";
|
|
6
|
+
import { Revert } from "./session-revert.js";
|
|
7
|
+
import { SessionFork } from "./session-fork.js";
|
|
8
|
+
export declare const ID: Schema.brand<Schema.String, "SessionID"> & {
|
|
9
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
10
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
11
|
+
};
|
|
12
|
+
export type ID = SessionID;
|
|
13
|
+
export declare const Metadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
14
|
+
export type Metadata = SessionMetadata;
|
|
15
|
+
export declare const Event: typeof SessionEvent;
|
|
16
|
+
export { Revert };
|
|
17
|
+
export declare const ForkBoundary: Schema.Union<readonly [Schema.Struct<{
|
|
18
|
+
readonly type: Schema.Literal<"before">;
|
|
19
|
+
readonly messageID: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
20
|
+
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
21
|
+
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
22
|
+
};
|
|
23
|
+
}>, Schema.Struct<{
|
|
24
|
+
readonly type: Schema.Literal<"through">;
|
|
25
|
+
readonly messageID: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
26
|
+
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
27
|
+
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
28
|
+
};
|
|
29
|
+
}>]>;
|
|
30
|
+
export type ForkBoundary = SessionFork.Boundary;
|
|
31
|
+
export declare const ForkRequestBoundary: Schema.Union<readonly [Schema.Struct<{
|
|
32
|
+
readonly type: Schema.Literal<"before">;
|
|
33
|
+
readonly messageID: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
34
|
+
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
35
|
+
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
36
|
+
};
|
|
37
|
+
}>, Schema.Struct<{
|
|
38
|
+
readonly type: Schema.Literal<"through">;
|
|
39
|
+
}>]>;
|
|
40
|
+
export type ForkRequestBoundary = SessionFork.RequestBoundary;
|
|
41
|
+
export interface Info extends Schema.Schema.Type<typeof Info> {
|
|
42
|
+
}
|
|
43
|
+
export declare const Info: Schema.Struct<{
|
|
44
|
+
readonly id: Schema.brand<Schema.String, "SessionID"> & {
|
|
45
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
46
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
47
|
+
};
|
|
48
|
+
readonly parentID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "SessionID"> & {
|
|
49
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
50
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
51
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "SessionID"> & {
|
|
52
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
53
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
54
|
+
}>, never, never>;
|
|
55
|
+
readonly fork: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
56
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
57
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
58
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
59
|
+
};
|
|
60
|
+
readonly boundary: Schema.Union<readonly [Schema.Struct<{
|
|
61
|
+
readonly type: Schema.Literal<"before">;
|
|
62
|
+
readonly messageID: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
63
|
+
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
64
|
+
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
65
|
+
};
|
|
66
|
+
}>, Schema.Struct<{
|
|
67
|
+
readonly type: Schema.Literal<"through">;
|
|
68
|
+
readonly messageID: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
69
|
+
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
70
|
+
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
71
|
+
};
|
|
72
|
+
}>]>;
|
|
73
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
74
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
75
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
76
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
77
|
+
};
|
|
78
|
+
readonly boundary: Schema.Union<readonly [Schema.Struct<{
|
|
79
|
+
readonly type: Schema.Literal<"before">;
|
|
80
|
+
readonly messageID: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
81
|
+
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
82
|
+
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
83
|
+
};
|
|
84
|
+
}>, Schema.Struct<{
|
|
85
|
+
readonly type: Schema.Literal<"through">;
|
|
86
|
+
readonly messageID: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
87
|
+
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
88
|
+
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
89
|
+
};
|
|
90
|
+
}>]>;
|
|
91
|
+
}>>, never, never>;
|
|
92
|
+
readonly projectID: Schema.brand<Schema.String, "Project.ID"> & {
|
|
93
|
+
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
94
|
+
};
|
|
95
|
+
readonly agent: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Agent.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Agent.ID">>, never, never>;
|
|
96
|
+
readonly model: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
97
|
+
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
98
|
+
readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
|
|
99
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
100
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
101
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
102
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
103
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
104
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
105
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
106
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
107
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
108
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
109
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
110
|
+
};
|
|
111
|
+
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
|
|
112
|
+
}> & {
|
|
113
|
+
parse: (input: string) => {
|
|
114
|
+
readonly id: string & import("effect/Brand").Brand<"Model.ID">;
|
|
115
|
+
readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
116
|
+
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
117
|
+
};
|
|
118
|
+
}>>, Schema.optionalKey<Schema.Struct<{
|
|
119
|
+
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
120
|
+
readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
|
|
121
|
+
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
122
|
+
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
123
|
+
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
124
|
+
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
125
|
+
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
126
|
+
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
127
|
+
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
128
|
+
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
129
|
+
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
130
|
+
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
131
|
+
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
132
|
+
};
|
|
133
|
+
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
|
|
134
|
+
}> & {
|
|
135
|
+
parse: (input: string) => {
|
|
136
|
+
readonly id: string & import("effect/Brand").Brand<"Model.ID">;
|
|
137
|
+
readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
138
|
+
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
139
|
+
};
|
|
140
|
+
}>, never, never>;
|
|
141
|
+
readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
142
|
+
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
143
|
+
};
|
|
144
|
+
readonly tokens: Schema.Struct<{
|
|
145
|
+
readonly input: Schema.Finite;
|
|
146
|
+
readonly output: Schema.Finite;
|
|
147
|
+
readonly reasoning: Schema.Finite;
|
|
148
|
+
readonly cache: Schema.Struct<{
|
|
149
|
+
readonly read: Schema.Finite;
|
|
150
|
+
readonly write: Schema.Finite;
|
|
151
|
+
}>;
|
|
152
|
+
}>;
|
|
153
|
+
/** Outcome of the last completed execution, recorded at `time.idle`. Absent until a run reaches a terminal transition. */
|
|
154
|
+
readonly outcome: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["succeeded", "failed", "interrupted"]>>>, Schema.optionalKey<Schema.Literals<readonly ["succeeded", "failed", "interrupted"]>>, never, never>;
|
|
155
|
+
readonly time: Schema.Struct<{
|
|
156
|
+
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
157
|
+
readonly updated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
158
|
+
readonly idle: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
|
|
159
|
+
readonly viewed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
|
|
160
|
+
readonly archived: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
|
|
161
|
+
}>;
|
|
162
|
+
readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
163
|
+
readonly location: Schema.Struct<{
|
|
164
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
165
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
166
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
167
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
168
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
169
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
170
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
171
|
+
}>, never, never>;
|
|
172
|
+
}>;
|
|
173
|
+
readonly subpath: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "RelativePath">>>, Schema.optionalKey<Schema.brand<Schema.String, "RelativePath">>, never, never>;
|
|
174
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
|
175
|
+
/** Evaluated after the agent's rules; the last matching rule wins. */
|
|
176
|
+
readonly permissions: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
177
|
+
readonly action: Schema.String;
|
|
178
|
+
readonly resource: Schema.String;
|
|
179
|
+
readonly effect: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
180
|
+
}>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
181
|
+
readonly action: Schema.String;
|
|
182
|
+
readonly resource: Schema.String;
|
|
183
|
+
readonly effect: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
184
|
+
}>>>, never, never>;
|
|
185
|
+
readonly revert: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
186
|
+
readonly messageID: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
187
|
+
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
188
|
+
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
189
|
+
};
|
|
190
|
+
readonly partID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
191
|
+
readonly snapshot: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Snapshot.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Snapshot.ID">>, never, never>;
|
|
192
|
+
readonly files: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
193
|
+
readonly file: Schema.String;
|
|
194
|
+
readonly patch: Schema.String;
|
|
195
|
+
readonly additions: Schema.Int;
|
|
196
|
+
readonly deletions: Schema.Int;
|
|
197
|
+
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
198
|
+
}>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
199
|
+
readonly file: Schema.String;
|
|
200
|
+
readonly patch: Schema.String;
|
|
201
|
+
readonly additions: Schema.Int;
|
|
202
|
+
readonly deletions: Schema.Int;
|
|
203
|
+
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
204
|
+
}>>>, never, never>;
|
|
205
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
206
|
+
readonly messageID: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
207
|
+
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
208
|
+
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
209
|
+
};
|
|
210
|
+
readonly partID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
211
|
+
readonly snapshot: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Snapshot.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Snapshot.ID">>, never, never>;
|
|
212
|
+
readonly files: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
213
|
+
readonly file: Schema.String;
|
|
214
|
+
readonly patch: Schema.String;
|
|
215
|
+
readonly additions: Schema.Int;
|
|
216
|
+
readonly deletions: Schema.Int;
|
|
217
|
+
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
218
|
+
}>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
219
|
+
readonly file: Schema.String;
|
|
220
|
+
readonly patch: Schema.String;
|
|
221
|
+
readonly additions: Schema.Int;
|
|
222
|
+
readonly deletions: Schema.Int;
|
|
223
|
+
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
224
|
+
}>>>, never, never>;
|
|
225
|
+
}>>, never, never>;
|
|
226
|
+
}>;
|
|
227
|
+
export declare const ListAnchor: Schema.Struct<{
|
|
228
|
+
readonly id: Schema.brand<Schema.String, "SessionID"> & {
|
|
229
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
230
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
231
|
+
};
|
|
232
|
+
readonly time: Schema.Finite;
|
|
233
|
+
readonly direction: Schema.Literals<readonly ["previous", "next"]>;
|
|
234
|
+
}>;
|
|
235
|
+
export interface ListAnchor extends Schema.Schema.Type<typeof ListAnchor> {
|
|
236
|
+
}
|
package/dist/session.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export * as Session from "./session.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { Agent } from "./agent.js";
|
|
4
|
+
import { Location } from "./location.js";
|
|
5
|
+
import { Model } from "./model.js";
|
|
6
|
+
import { Project } from "./project.js";
|
|
7
|
+
import { DateTimeUtcFromMillis, optional, RelativePath } from "./schema.js";
|
|
8
|
+
import { SessionEvent } from "./session-event.js";
|
|
9
|
+
import { SessionID } from "./session-id.js";
|
|
10
|
+
import { SessionMetadata } from "./session-metadata.js";
|
|
11
|
+
import { Money } from "./money.js";
|
|
12
|
+
import { Permission } from "./permission.js";
|
|
13
|
+
import { TokenUsage } from "./token-usage.js";
|
|
14
|
+
import { Revert } from "./session-revert.js";
|
|
15
|
+
import { SessionFork } from "./session-fork.js";
|
|
16
|
+
export const ID = SessionID;
|
|
17
|
+
export const Metadata = SessionMetadata;
|
|
18
|
+
export const Event = SessionEvent;
|
|
19
|
+
export { Revert };
|
|
20
|
+
export const ForkBoundary = SessionFork.Boundary;
|
|
21
|
+
export const ForkRequestBoundary = SessionFork.RequestBoundary;
|
|
22
|
+
export const Info = Schema.Struct({
|
|
23
|
+
id: ID,
|
|
24
|
+
parentID: ID.pipe(optional),
|
|
25
|
+
fork: Schema.Struct({
|
|
26
|
+
sessionID: ID,
|
|
27
|
+
boundary: ForkBoundary,
|
|
28
|
+
}).pipe(optional),
|
|
29
|
+
projectID: Project.ID,
|
|
30
|
+
agent: Agent.ID.pipe(optional),
|
|
31
|
+
model: Model.Ref.pipe(optional),
|
|
32
|
+
cost: Money.USD,
|
|
33
|
+
tokens: TokenUsage.Info,
|
|
34
|
+
/** Outcome of the last completed execution, recorded at `time.idle`. Absent until a run reaches a terminal transition. */
|
|
35
|
+
outcome: Schema.Literals(["succeeded", "failed", "interrupted"]).pipe(optional),
|
|
36
|
+
time: Schema.Struct({
|
|
37
|
+
created: DateTimeUtcFromMillis,
|
|
38
|
+
updated: DateTimeUtcFromMillis,
|
|
39
|
+
idle: DateTimeUtcFromMillis.pipe(optional),
|
|
40
|
+
viewed: DateTimeUtcFromMillis.pipe(optional),
|
|
41
|
+
archived: DateTimeUtcFromMillis.pipe(optional),
|
|
42
|
+
}),
|
|
43
|
+
title: Schema.String.pipe(optional),
|
|
44
|
+
location: Location.Ref,
|
|
45
|
+
subpath: RelativePath.pipe(optional),
|
|
46
|
+
metadata: Metadata.pipe(optional),
|
|
47
|
+
/** Evaluated after the agent's rules; the last matching rule wins. */
|
|
48
|
+
permissions: Permission.Ruleset.pipe(optional),
|
|
49
|
+
revert: Revert.pipe(optional),
|
|
50
|
+
}).annotate({ identifier: "Session.Info" });
|
|
51
|
+
export const ListAnchor = Schema.Struct({
|
|
52
|
+
id: ID,
|
|
53
|
+
time: Schema.Finite,
|
|
54
|
+
direction: Schema.Literals(["previous", "next"]),
|
|
55
|
+
}).annotate({ identifier: "Session.ListAnchor" });
|