@opencode-ai/schema 0.0.0-next-14659
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 +175 -0
- package/dist/agent.js +43 -0
- package/dist/catalog.d.ts +89 -0
- package/dist/catalog.js +4 -0
- package/dist/command.d.ts +44 -0
- package/dist/command.js +12 -0
- package/dist/connection.d.ts +28 -0
- package/dist/connection.js +15 -0
- package/dist/credential.d.ts +36 -0
- package/dist/credential.js +23 -0
- package/dist/durable-event-manifest.d.ts +10626 -0
- package/dist/durable-event-manifest.js +12 -0
- package/dist/event-manifest.d.ts +15309 -0
- package/dist/event-manifest.js +43 -0
- package/dist/event.d.ts +82 -0
- package/dist/event.js +73 -0
- package/dist/file-diff.d.ts +11 -0
- package/dist/file-diff.js +10 -0
- package/dist/filesystem-watcher.d.ts +102 -0
- package/dist/filesystem-watcher.js +11 -0
- package/dist/filesystem.d.ts +134 -0
- package/dist/filesystem.js +32 -0
- package/dist/ide-event.d.ts +96 -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 +29 -0
- package/dist/index.js +29 -0
- package/dist/installation-event.d.ts +189 -0
- package/dist/installation-event.js +16 -0
- package/dist/integration-id.d.ts +5 -0
- package/dist/integration-id.js +3 -0
- package/dist/integration.d.ts +572 -0
- package/dist/integration.js +93 -0
- package/dist/legacy-event.d.ts +1 -0
- package/dist/legacy-event.js +1 -0
- package/dist/llm.d.ts +28 -0
- package/dist/llm.js +19 -0
- package/dist/location.d.ts +36 -0
- package/dist/location.js +21 -0
- package/dist/lsp-event.d.ts +87 -0
- package/dist/lsp-event.js +4 -0
- package/dist/mcp-event.d.ts +286 -0
- package/dist/mcp-event.js +25 -0
- package/dist/mcp.d.ts +39 -0
- package/dist/mcp.js +38 -0
- package/dist/model.d.ts +205 -0
- package/dist/model.js +86 -0
- package/dist/models-dev.d.ts +89 -0
- package/dist/models-dev.js +7 -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 +346 -0
- package/dist/permission.js +45 -0
- package/dist/plugin.d.ts +105 -0
- package/dist/plugin.js +12 -0
- package/dist/project-copy.d.ts +29 -0
- package/dist/project-copy.js +21 -0
- package/dist/project-directories.d.ts +105 -0
- package/dist/project-directories.js +8 -0
- package/dist/project-id.d.ts +5 -0
- package/dist/project-id.js +3 -0
- package/dist/project.d.ts +278 -0
- package/dist/project.js +44 -0
- package/dist/prompt-input.d.ts +106 -0
- package/dist/prompt-input.js +19 -0
- package/dist/prompt.d.ts +177 -0
- package/dist/prompt.js +43 -0
- package/dist/provider.d.ts +111 -0
- package/dist/provider.js +53 -0
- package/dist/pty-ticket.d.ts +8 -0
- package/dist/pty-ticket.js +7 -0
- package/dist/pty.d.ts +542 -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 +516 -0
- package/dist/question.js +64 -0
- package/dist/reference.d.ts +140 -0
- package/dist/reference.js +31 -0
- package/dist/revert.d.ts +34 -0
- package/dist/revert.js +19 -0
- package/dist/schema.d.ts +10 -0
- package/dist/schema.js +14 -0
- package/dist/server-event.d.ts +172 -0
- package/dist/server-event.js +5 -0
- package/dist/session-compaction-event.d.ts +107 -0
- package/dist/session-compaction-event.js +10 -0
- package/dist/session-delivery.d.ts +4 -0
- package/dist/session-delivery.js +3 -0
- package/dist/session-event.d.ts +14225 -0
- package/dist/session-event.js +421 -0
- package/dist/session-id.d.ts +6 -0
- package/dist/session-id.js +10 -0
- package/dist/session-input.d.ts +145 -0
- package/dist/session-input.js +18 -0
- package/dist/session-message.d.ts +1318 -0
- package/dist/session-message.js +171 -0
- package/dist/session-status-event.d.ts +339 -0
- package/dist/session-status-event.js +43 -0
- package/dist/session-todo.d.ts +137 -0
- package/dist/session-todo.js +21 -0
- package/dist/session-v1.d.ts +1 -0
- package/dist/session-v1.js +1 -0
- package/dist/session.d.ts +140 -0
- package/dist/session.js +43 -0
- package/dist/shell.d.ts +441 -0
- package/dist/shell.js +58 -0
- package/dist/skill.d.ts +146 -0
- package/dist/skill.js +45 -0
- package/dist/tui-event.d.ts +387 -0
- package/dist/tui-event.js +53 -0
- package/dist/v1/legacy-event.d.ts +128 -0
- package/dist/v1/legacy-event.js +15 -0
- package/dist/v1/permission.d.ts +356 -0
- package/dist/v1/permission.js +41 -0
- package/dist/v1/question.d.ts +504 -0
- package/dist/v1/question.js +57 -0
- package/dist/v1/session.d.ts +7775 -0
- package/dist/v1/session.js +535 -0
- package/dist/vcs-event.d.ts +96 -0
- package/dist/vcs-event.js +11 -0
- package/dist/workspace-event.d.ts +307 -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 +9 -0
- package/dist/workspace.js +5 -0
- package/dist/worktree-event.d.ts +193 -0
- package/dist/worktree-event.js +18 -0
- package/package.json +41 -0
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
export * as Question from "./question.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const ID: Schema.brand<Schema.String, "QuestionV2.ID"> & {
|
|
4
|
+
create: () => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
5
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
6
|
+
};
|
|
7
|
+
export type ID = typeof ID.Type;
|
|
8
|
+
export declare const Option: Schema.Struct<{
|
|
9
|
+
readonly label: Schema.String;
|
|
10
|
+
readonly description: Schema.String;
|
|
11
|
+
}>;
|
|
12
|
+
export interface Option extends Schema.Schema.Type<typeof Option> {
|
|
13
|
+
}
|
|
14
|
+
export declare const Info: Schema.Struct<{
|
|
15
|
+
readonly custom: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
16
|
+
readonly question: Schema.String;
|
|
17
|
+
readonly header: Schema.String;
|
|
18
|
+
readonly options: Schema.$Array<Schema.Struct<{
|
|
19
|
+
readonly label: Schema.String;
|
|
20
|
+
readonly description: Schema.String;
|
|
21
|
+
}>>;
|
|
22
|
+
readonly multiple: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
23
|
+
}>;
|
|
24
|
+
export interface Info extends Schema.Schema.Type<typeof Info> {
|
|
25
|
+
}
|
|
26
|
+
export declare const Prompt: Schema.Struct<{
|
|
27
|
+
question: Schema.String;
|
|
28
|
+
header: Schema.String;
|
|
29
|
+
options: Schema.$Array<Schema.Struct<{
|
|
30
|
+
readonly label: Schema.String;
|
|
31
|
+
readonly description: Schema.String;
|
|
32
|
+
}>>;
|
|
33
|
+
multiple: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
34
|
+
}>;
|
|
35
|
+
export interface Prompt extends Schema.Schema.Type<typeof Prompt> {
|
|
36
|
+
}
|
|
37
|
+
export declare const Tool: Schema.Struct<{
|
|
38
|
+
readonly messageID: Schema.String;
|
|
39
|
+
readonly callID: Schema.String;
|
|
40
|
+
}>;
|
|
41
|
+
export interface Tool extends Schema.Schema.Type<typeof Tool> {
|
|
42
|
+
}
|
|
43
|
+
export declare const Request: Schema.Struct<{
|
|
44
|
+
readonly id: Schema.brand<Schema.String, "QuestionV2.ID"> & {
|
|
45
|
+
create: () => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
46
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
47
|
+
};
|
|
48
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
49
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
50
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
51
|
+
};
|
|
52
|
+
readonly questions: Schema.$Array<Schema.Struct<{
|
|
53
|
+
readonly custom: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
54
|
+
readonly question: Schema.String;
|
|
55
|
+
readonly header: Schema.String;
|
|
56
|
+
readonly options: Schema.$Array<Schema.Struct<{
|
|
57
|
+
readonly label: Schema.String;
|
|
58
|
+
readonly description: Schema.String;
|
|
59
|
+
}>>;
|
|
60
|
+
readonly multiple: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
61
|
+
}>>;
|
|
62
|
+
readonly tool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
63
|
+
readonly messageID: Schema.String;
|
|
64
|
+
readonly callID: Schema.String;
|
|
65
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
66
|
+
readonly messageID: Schema.String;
|
|
67
|
+
readonly callID: Schema.String;
|
|
68
|
+
}>>, never, never>;
|
|
69
|
+
}>;
|
|
70
|
+
export interface Request extends Schema.Schema.Type<typeof Request> {
|
|
71
|
+
}
|
|
72
|
+
export declare const Answer: Schema.$Array<Schema.String>;
|
|
73
|
+
export type Answer = typeof Answer.Type;
|
|
74
|
+
export declare const Reply: Schema.Struct<{
|
|
75
|
+
readonly answers: Schema.$Array<Schema.$Array<Schema.String>>;
|
|
76
|
+
}>;
|
|
77
|
+
export interface Reply extends Schema.Schema.Type<typeof Reply> {
|
|
78
|
+
}
|
|
79
|
+
export declare const Event: {
|
|
80
|
+
Asked: Schema.Struct<{
|
|
81
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
82
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
83
|
+
};
|
|
84
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
85
|
+
readonly type: Schema.Literal<"question.v2.asked">;
|
|
86
|
+
readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
87
|
+
readonly aggregateID: Schema.String;
|
|
88
|
+
readonly seq: Schema.Int;
|
|
89
|
+
readonly version: Schema.Int;
|
|
90
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
91
|
+
readonly aggregateID: Schema.String;
|
|
92
|
+
readonly seq: Schema.Int;
|
|
93
|
+
readonly version: Schema.Int;
|
|
94
|
+
}>>, never, never>;
|
|
95
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
96
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
97
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
98
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
99
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
100
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
101
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
102
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
103
|
+
}>, never, never>;
|
|
104
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
105
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
106
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
107
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
108
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
109
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
110
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
111
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
112
|
+
}>, never, never>;
|
|
113
|
+
}>>, never, never>;
|
|
114
|
+
readonly data: Schema.Struct<{
|
|
115
|
+
readonly id: Schema.brand<Schema.String, "QuestionV2.ID"> & {
|
|
116
|
+
create: () => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
117
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
118
|
+
};
|
|
119
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
120
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
121
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
122
|
+
};
|
|
123
|
+
readonly questions: Schema.$Array<Schema.Struct<{
|
|
124
|
+
readonly custom: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
125
|
+
readonly question: Schema.String;
|
|
126
|
+
readonly header: Schema.String;
|
|
127
|
+
readonly options: Schema.$Array<Schema.Struct<{
|
|
128
|
+
readonly label: Schema.String;
|
|
129
|
+
readonly description: Schema.String;
|
|
130
|
+
}>>;
|
|
131
|
+
readonly multiple: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
132
|
+
}>>;
|
|
133
|
+
readonly tool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
134
|
+
readonly messageID: Schema.String;
|
|
135
|
+
readonly callID: Schema.String;
|
|
136
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
137
|
+
readonly messageID: Schema.String;
|
|
138
|
+
readonly callID: Schema.String;
|
|
139
|
+
}>>, never, never>;
|
|
140
|
+
}>;
|
|
141
|
+
}> & {
|
|
142
|
+
data: Schema.Struct<{
|
|
143
|
+
readonly id: Schema.brand<Schema.String, "QuestionV2.ID"> & {
|
|
144
|
+
create: () => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
145
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
146
|
+
};
|
|
147
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
148
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
149
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
150
|
+
};
|
|
151
|
+
readonly questions: Schema.$Array<Schema.Struct<{
|
|
152
|
+
readonly custom: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
153
|
+
readonly question: Schema.String;
|
|
154
|
+
readonly header: Schema.String;
|
|
155
|
+
readonly options: Schema.$Array<Schema.Struct<{
|
|
156
|
+
readonly label: Schema.String;
|
|
157
|
+
readonly description: Schema.String;
|
|
158
|
+
}>>;
|
|
159
|
+
readonly multiple: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
160
|
+
}>>;
|
|
161
|
+
readonly tool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
162
|
+
readonly messageID: Schema.String;
|
|
163
|
+
readonly callID: Schema.String;
|
|
164
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
165
|
+
readonly messageID: Schema.String;
|
|
166
|
+
readonly callID: Schema.String;
|
|
167
|
+
}>>, never, never>;
|
|
168
|
+
}>;
|
|
169
|
+
durable?: {
|
|
170
|
+
readonly version: number;
|
|
171
|
+
readonly aggregate: string;
|
|
172
|
+
} | undefined;
|
|
173
|
+
type: "question.v2.asked";
|
|
174
|
+
};
|
|
175
|
+
Replied: Schema.Struct<{
|
|
176
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
177
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
178
|
+
};
|
|
179
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
180
|
+
readonly type: Schema.Literal<"question.v2.replied">;
|
|
181
|
+
readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
182
|
+
readonly aggregateID: Schema.String;
|
|
183
|
+
readonly seq: Schema.Int;
|
|
184
|
+
readonly version: Schema.Int;
|
|
185
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
186
|
+
readonly aggregateID: Schema.String;
|
|
187
|
+
readonly seq: Schema.Int;
|
|
188
|
+
readonly version: Schema.Int;
|
|
189
|
+
}>>, never, never>;
|
|
190
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
191
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
192
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
193
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
194
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
195
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
196
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
197
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
198
|
+
}>, never, never>;
|
|
199
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
200
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
201
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
202
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
203
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
204
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
205
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
206
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
207
|
+
}>, never, never>;
|
|
208
|
+
}>>, never, never>;
|
|
209
|
+
readonly data: Schema.Struct<{
|
|
210
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
211
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
212
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
213
|
+
};
|
|
214
|
+
readonly requestID: Schema.brand<Schema.String, "QuestionV2.ID"> & {
|
|
215
|
+
create: () => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
216
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
217
|
+
};
|
|
218
|
+
readonly answers: Schema.$Array<Schema.$Array<Schema.String>>;
|
|
219
|
+
}>;
|
|
220
|
+
}> & {
|
|
221
|
+
data: Schema.Struct<{
|
|
222
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
223
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
224
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
225
|
+
};
|
|
226
|
+
readonly requestID: Schema.brand<Schema.String, "QuestionV2.ID"> & {
|
|
227
|
+
create: () => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
228
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
229
|
+
};
|
|
230
|
+
readonly answers: Schema.$Array<Schema.$Array<Schema.String>>;
|
|
231
|
+
}>;
|
|
232
|
+
durable?: {
|
|
233
|
+
readonly version: number;
|
|
234
|
+
readonly aggregate: string;
|
|
235
|
+
} | undefined;
|
|
236
|
+
type: "question.v2.replied";
|
|
237
|
+
};
|
|
238
|
+
Rejected: Schema.Struct<{
|
|
239
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
240
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
241
|
+
};
|
|
242
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
243
|
+
readonly type: Schema.Literal<"question.v2.rejected">;
|
|
244
|
+
readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
245
|
+
readonly aggregateID: Schema.String;
|
|
246
|
+
readonly seq: Schema.Int;
|
|
247
|
+
readonly version: Schema.Int;
|
|
248
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
249
|
+
readonly aggregateID: Schema.String;
|
|
250
|
+
readonly seq: Schema.Int;
|
|
251
|
+
readonly version: Schema.Int;
|
|
252
|
+
}>>, never, never>;
|
|
253
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
254
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
255
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
256
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
257
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
258
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
259
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
260
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
261
|
+
}>, never, never>;
|
|
262
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
263
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
264
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
265
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
266
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
267
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
268
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
269
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
270
|
+
}>, never, never>;
|
|
271
|
+
}>>, never, never>;
|
|
272
|
+
readonly data: Schema.Struct<{
|
|
273
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
274
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
275
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
276
|
+
};
|
|
277
|
+
readonly requestID: Schema.brand<Schema.String, "QuestionV2.ID"> & {
|
|
278
|
+
create: () => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
279
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
280
|
+
};
|
|
281
|
+
}>;
|
|
282
|
+
}> & {
|
|
283
|
+
data: Schema.Struct<{
|
|
284
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
285
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
286
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
287
|
+
};
|
|
288
|
+
readonly requestID: Schema.brand<Schema.String, "QuestionV2.ID"> & {
|
|
289
|
+
create: () => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
290
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
291
|
+
};
|
|
292
|
+
}>;
|
|
293
|
+
durable?: {
|
|
294
|
+
readonly version: number;
|
|
295
|
+
readonly aggregate: string;
|
|
296
|
+
} | undefined;
|
|
297
|
+
type: "question.v2.rejected";
|
|
298
|
+
};
|
|
299
|
+
Definitions: readonly [Schema.Struct<{
|
|
300
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
301
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
302
|
+
};
|
|
303
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
304
|
+
readonly type: Schema.Literal<"question.v2.asked">;
|
|
305
|
+
readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
306
|
+
readonly aggregateID: Schema.String;
|
|
307
|
+
readonly seq: Schema.Int;
|
|
308
|
+
readonly version: Schema.Int;
|
|
309
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
310
|
+
readonly aggregateID: Schema.String;
|
|
311
|
+
readonly seq: Schema.Int;
|
|
312
|
+
readonly version: Schema.Int;
|
|
313
|
+
}>>, never, never>;
|
|
314
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
315
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
316
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
317
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
318
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
319
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
320
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
321
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
322
|
+
}>, never, never>;
|
|
323
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
324
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
325
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
326
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
327
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
328
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
329
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
330
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
331
|
+
}>, never, never>;
|
|
332
|
+
}>>, never, never>;
|
|
333
|
+
readonly data: Schema.Struct<{
|
|
334
|
+
readonly id: Schema.brand<Schema.String, "QuestionV2.ID"> & {
|
|
335
|
+
create: () => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
336
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
337
|
+
};
|
|
338
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
339
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
340
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
341
|
+
};
|
|
342
|
+
readonly questions: Schema.$Array<Schema.Struct<{
|
|
343
|
+
readonly custom: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
344
|
+
readonly question: Schema.String;
|
|
345
|
+
readonly header: Schema.String;
|
|
346
|
+
readonly options: Schema.$Array<Schema.Struct<{
|
|
347
|
+
readonly label: Schema.String;
|
|
348
|
+
readonly description: Schema.String;
|
|
349
|
+
}>>;
|
|
350
|
+
readonly multiple: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
351
|
+
}>>;
|
|
352
|
+
readonly tool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
353
|
+
readonly messageID: Schema.String;
|
|
354
|
+
readonly callID: Schema.String;
|
|
355
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
356
|
+
readonly messageID: Schema.String;
|
|
357
|
+
readonly callID: Schema.String;
|
|
358
|
+
}>>, never, never>;
|
|
359
|
+
}>;
|
|
360
|
+
}> & {
|
|
361
|
+
data: Schema.Struct<{
|
|
362
|
+
readonly id: Schema.brand<Schema.String, "QuestionV2.ID"> & {
|
|
363
|
+
create: () => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
364
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
365
|
+
};
|
|
366
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
367
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
368
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
369
|
+
};
|
|
370
|
+
readonly questions: Schema.$Array<Schema.Struct<{
|
|
371
|
+
readonly custom: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
372
|
+
readonly question: Schema.String;
|
|
373
|
+
readonly header: Schema.String;
|
|
374
|
+
readonly options: Schema.$Array<Schema.Struct<{
|
|
375
|
+
readonly label: Schema.String;
|
|
376
|
+
readonly description: Schema.String;
|
|
377
|
+
}>>;
|
|
378
|
+
readonly multiple: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
379
|
+
}>>;
|
|
380
|
+
readonly tool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
381
|
+
readonly messageID: Schema.String;
|
|
382
|
+
readonly callID: Schema.String;
|
|
383
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
384
|
+
readonly messageID: Schema.String;
|
|
385
|
+
readonly callID: Schema.String;
|
|
386
|
+
}>>, never, never>;
|
|
387
|
+
}>;
|
|
388
|
+
durable?: {
|
|
389
|
+
readonly version: number;
|
|
390
|
+
readonly aggregate: string;
|
|
391
|
+
} | undefined;
|
|
392
|
+
type: "question.v2.asked";
|
|
393
|
+
}, Schema.Struct<{
|
|
394
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
395
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
396
|
+
};
|
|
397
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
398
|
+
readonly type: Schema.Literal<"question.v2.replied">;
|
|
399
|
+
readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
400
|
+
readonly aggregateID: Schema.String;
|
|
401
|
+
readonly seq: Schema.Int;
|
|
402
|
+
readonly version: Schema.Int;
|
|
403
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
404
|
+
readonly aggregateID: Schema.String;
|
|
405
|
+
readonly seq: Schema.Int;
|
|
406
|
+
readonly version: Schema.Int;
|
|
407
|
+
}>>, never, never>;
|
|
408
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
409
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
410
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
411
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
412
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
413
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
414
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
415
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
416
|
+
}>, never, never>;
|
|
417
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
418
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
419
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
420
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
421
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
422
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
423
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
424
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
425
|
+
}>, never, never>;
|
|
426
|
+
}>>, never, never>;
|
|
427
|
+
readonly data: Schema.Struct<{
|
|
428
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
429
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
430
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
431
|
+
};
|
|
432
|
+
readonly requestID: Schema.brand<Schema.String, "QuestionV2.ID"> & {
|
|
433
|
+
create: () => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
434
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
435
|
+
};
|
|
436
|
+
readonly answers: Schema.$Array<Schema.$Array<Schema.String>>;
|
|
437
|
+
}>;
|
|
438
|
+
}> & {
|
|
439
|
+
data: Schema.Struct<{
|
|
440
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
441
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
442
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
443
|
+
};
|
|
444
|
+
readonly requestID: Schema.brand<Schema.String, "QuestionV2.ID"> & {
|
|
445
|
+
create: () => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
446
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
447
|
+
};
|
|
448
|
+
readonly answers: Schema.$Array<Schema.$Array<Schema.String>>;
|
|
449
|
+
}>;
|
|
450
|
+
durable?: {
|
|
451
|
+
readonly version: number;
|
|
452
|
+
readonly aggregate: string;
|
|
453
|
+
} | undefined;
|
|
454
|
+
type: "question.v2.replied";
|
|
455
|
+
}, Schema.Struct<{
|
|
456
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
457
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
458
|
+
};
|
|
459
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
460
|
+
readonly type: Schema.Literal<"question.v2.rejected">;
|
|
461
|
+
readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
462
|
+
readonly aggregateID: Schema.String;
|
|
463
|
+
readonly seq: Schema.Int;
|
|
464
|
+
readonly version: Schema.Int;
|
|
465
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
466
|
+
readonly aggregateID: Schema.String;
|
|
467
|
+
readonly seq: Schema.Int;
|
|
468
|
+
readonly version: Schema.Int;
|
|
469
|
+
}>>, never, never>;
|
|
470
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
471
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
472
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
473
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
474
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
475
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
476
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
477
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
478
|
+
}>, never, never>;
|
|
479
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
480
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
481
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
482
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
483
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
484
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
|
|
485
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
486
|
+
create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
|
|
487
|
+
}>, never, never>;
|
|
488
|
+
}>>, never, never>;
|
|
489
|
+
readonly data: Schema.Struct<{
|
|
490
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
491
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
492
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
493
|
+
};
|
|
494
|
+
readonly requestID: Schema.brand<Schema.String, "QuestionV2.ID"> & {
|
|
495
|
+
create: () => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
496
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
497
|
+
};
|
|
498
|
+
}>;
|
|
499
|
+
}> & {
|
|
500
|
+
data: Schema.Struct<{
|
|
501
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
502
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
503
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
504
|
+
};
|
|
505
|
+
readonly requestID: Schema.brand<Schema.String, "QuestionV2.ID"> & {
|
|
506
|
+
create: () => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
507
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"QuestionV2.ID">;
|
|
508
|
+
};
|
|
509
|
+
}>;
|
|
510
|
+
durable?: {
|
|
511
|
+
readonly version: number;
|
|
512
|
+
readonly aggregate: string;
|
|
513
|
+
} | undefined;
|
|
514
|
+
type: "question.v2.rejected";
|
|
515
|
+
}];
|
|
516
|
+
};
|
package/dist/question.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export * as Question from "./question.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { optional } from "./schema.js";
|
|
4
|
+
import { define, inventory } from "./event.js";
|
|
5
|
+
import { ascending } from "./identifier.js";
|
|
6
|
+
import { SessionID } from "./session-id.js";
|
|
7
|
+
import { statics } from "./schema.js";
|
|
8
|
+
export const ID = Schema.String.check(Schema.isStartsWith("que")).pipe(Schema.brand("QuestionV2.ID"), statics((schema) => {
|
|
9
|
+
const create = () => schema.make("que_" + ascending());
|
|
10
|
+
return {
|
|
11
|
+
create,
|
|
12
|
+
ascending: (id) => (id === undefined ? create() : schema.make(id)),
|
|
13
|
+
};
|
|
14
|
+
}));
|
|
15
|
+
export const Option = Schema.Struct({
|
|
16
|
+
label: Schema.String.annotate({ description: "Display text (1-5 words, concise)" }),
|
|
17
|
+
description: Schema.String.annotate({ description: "Explanation of choice" }),
|
|
18
|
+
}).annotate({ identifier: "QuestionV2.Option" });
|
|
19
|
+
const base = {
|
|
20
|
+
question: Schema.String.annotate({ description: "Complete question" }),
|
|
21
|
+
header: Schema.String.annotate({ description: "Very short label (max 30 chars)" }),
|
|
22
|
+
options: Schema.Array(Option).annotate({ description: "Available choices" }),
|
|
23
|
+
multiple: Schema.Boolean.pipe(optional).annotate({ description: "Allow selecting multiple choices" }),
|
|
24
|
+
};
|
|
25
|
+
export const Info = Schema.Struct({
|
|
26
|
+
...base,
|
|
27
|
+
custom: Schema.Boolean.pipe(optional).annotate({
|
|
28
|
+
description: "Allow typing a custom answer (default: true)",
|
|
29
|
+
}),
|
|
30
|
+
}).annotate({ identifier: "QuestionV2.Info" });
|
|
31
|
+
export const Prompt = Schema.Struct(base).annotate({ identifier: "QuestionV2.Prompt" });
|
|
32
|
+
export const Tool = Schema.Struct({
|
|
33
|
+
messageID: Schema.String,
|
|
34
|
+
callID: Schema.String,
|
|
35
|
+
}).annotate({ identifier: "QuestionV2.Tool" });
|
|
36
|
+
export const Request = Schema.Struct({
|
|
37
|
+
id: ID,
|
|
38
|
+
sessionID: SessionID,
|
|
39
|
+
questions: Schema.Array(Info).annotate({ description: "Questions to ask" }),
|
|
40
|
+
tool: Tool.pipe(optional),
|
|
41
|
+
}).annotate({ identifier: "QuestionV2.Request" });
|
|
42
|
+
export const Answer = Schema.Array(Schema.String).annotate({ identifier: "QuestionV2.Answer" });
|
|
43
|
+
export const Reply = Schema.Struct({
|
|
44
|
+
answers: Schema.Array(Answer).annotate({
|
|
45
|
+
description: "User answers in order of questions (each answer is an array of selected labels)",
|
|
46
|
+
}),
|
|
47
|
+
}).annotate({ identifier: "QuestionV2.Reply" });
|
|
48
|
+
const Asked = define({ type: "question.v2.asked", schema: Request.fields });
|
|
49
|
+
const Replied = define({
|
|
50
|
+
type: "question.v2.replied",
|
|
51
|
+
schema: {
|
|
52
|
+
sessionID: SessionID,
|
|
53
|
+
requestID: ID,
|
|
54
|
+
answers: Schema.Array(Answer),
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
const Rejected = define({
|
|
58
|
+
type: "question.v2.rejected",
|
|
59
|
+
schema: {
|
|
60
|
+
sessionID: SessionID,
|
|
61
|
+
requestID: ID,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
export const Event = { Asked, Replied, Rejected, Definitions: inventory(Asked, Replied, Rejected) };
|