@opencode/schema 0.0.0-dev-21908 → 0.0.0-dev-21920
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/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/prompt.d.ts +96 -0
- package/dist/prompt.js +15 -0
- package/dist/session-inbox.d.ts +714 -86
- package/dist/session-inbox.js +10 -1
- package/dist/session-message.d.ts +968 -0
- package/dist/session-message.js +19 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,6 @@ export { PersistentPty } from "./persistent-pty.js";
|
|
|
36
36
|
export { PtyTicket } from "./pty-ticket.js";
|
|
37
37
|
export { Question } from "./question.js";
|
|
38
38
|
export { Workspace } from "./workspace.js";
|
|
39
|
-
export { Prompt, PromptMention, FileSource, FileAttachment, AgentAttachment } from "./prompt.js";
|
|
39
|
+
export { Prompt, PromptMention, FileSource, FileAttachment, MediaRef, MediaFileAttachment, Attachment, AgentAttachment, } from "./prompt.js";
|
|
40
40
|
export { PromptInput } from "./prompt-input.js";
|
|
41
41
|
export * from "./schema.js";
|
package/dist/index.js
CHANGED
|
@@ -36,6 +36,6 @@ export { PersistentPty } from "./persistent-pty.js";
|
|
|
36
36
|
export { PtyTicket } from "./pty-ticket.js";
|
|
37
37
|
export { Question } from "./question.js";
|
|
38
38
|
export { Workspace } from "./workspace.js";
|
|
39
|
-
export { Prompt, PromptMention, FileSource, FileAttachment, AgentAttachment } from "./prompt.js";
|
|
39
|
+
export { Prompt, PromptMention, FileSource, FileAttachment, MediaRef, MediaFileAttachment, Attachment, AgentAttachment, } from "./prompt.js";
|
|
40
40
|
export { PromptInput } from "./prompt-input.js";
|
|
41
41
|
export * from "./schema.js";
|
package/dist/prompt.d.ts
CHANGED
|
@@ -56,6 +56,102 @@ export declare const FileAttachment: Schema.Struct<{
|
|
|
56
56
|
} | undefined;
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
|
+
/** `media:` and the lowercase hex SHA-256 of a stored blob's bytes. Names no server route. */
|
|
60
|
+
export declare const MediaRef: Schema.String;
|
|
61
|
+
export type MediaRef = typeof MediaRef.Type;
|
|
62
|
+
/**
|
|
63
|
+
* An attachment whose bytes stay on the server, sent to clients that opt in with the experimental `experimental-media-uri`
|
|
64
|
+
* capability. Fetch the bytes from `GET /api/experimental/media/:hash`.
|
|
65
|
+
*/
|
|
66
|
+
export interface MediaFileAttachment extends Schema.Schema.Type<typeof MediaFileAttachment> {
|
|
67
|
+
}
|
|
68
|
+
export declare const MediaFileAttachment: Schema.Struct<{
|
|
69
|
+
readonly mime: Schema.String;
|
|
70
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
71
|
+
readonly type: Schema.Literal<"inline">;
|
|
72
|
+
}>, Schema.Struct<{
|
|
73
|
+
readonly type: Schema.Literal<"uri">;
|
|
74
|
+
readonly uri: Schema.String;
|
|
75
|
+
}>]>;
|
|
76
|
+
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
77
|
+
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
78
|
+
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
79
|
+
readonly start: Schema.Finite;
|
|
80
|
+
readonly end: Schema.Finite;
|
|
81
|
+
readonly text: Schema.String;
|
|
82
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
83
|
+
readonly start: Schema.Finite;
|
|
84
|
+
readonly end: Schema.Finite;
|
|
85
|
+
readonly text: Schema.String;
|
|
86
|
+
}>>, never, never>;
|
|
87
|
+
readonly uri: Schema.String;
|
|
88
|
+
readonly bytes: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
89
|
+
readonly width: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
90
|
+
readonly height: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
91
|
+
}>;
|
|
92
|
+
export declare const Attachment: Schema.Union<readonly [Schema.Struct<{
|
|
93
|
+
readonly data: Schema.String;
|
|
94
|
+
readonly mime: Schema.String;
|
|
95
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
96
|
+
readonly type: Schema.Literal<"inline">;
|
|
97
|
+
}>, Schema.Struct<{
|
|
98
|
+
readonly type: Schema.Literal<"uri">;
|
|
99
|
+
readonly uri: Schema.String;
|
|
100
|
+
}>]>;
|
|
101
|
+
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
102
|
+
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
103
|
+
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
104
|
+
readonly start: Schema.Finite;
|
|
105
|
+
readonly end: Schema.Finite;
|
|
106
|
+
readonly text: Schema.String;
|
|
107
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
108
|
+
readonly start: Schema.Finite;
|
|
109
|
+
readonly end: Schema.Finite;
|
|
110
|
+
readonly text: Schema.String;
|
|
111
|
+
}>>, never, never>;
|
|
112
|
+
}> & {
|
|
113
|
+
create: (input: FileAttachment) => {
|
|
114
|
+
readonly data: string;
|
|
115
|
+
readonly mime: string;
|
|
116
|
+
readonly source: {
|
|
117
|
+
readonly type: "inline";
|
|
118
|
+
} | {
|
|
119
|
+
readonly type: "uri";
|
|
120
|
+
readonly uri: string;
|
|
121
|
+
};
|
|
122
|
+
readonly name?: string | undefined;
|
|
123
|
+
readonly description?: string | undefined;
|
|
124
|
+
readonly mention?: {
|
|
125
|
+
readonly start: number;
|
|
126
|
+
readonly end: number;
|
|
127
|
+
readonly text: string;
|
|
128
|
+
} | undefined;
|
|
129
|
+
};
|
|
130
|
+
}, Schema.Struct<{
|
|
131
|
+
readonly mime: Schema.String;
|
|
132
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
133
|
+
readonly type: Schema.Literal<"inline">;
|
|
134
|
+
}>, Schema.Struct<{
|
|
135
|
+
readonly type: Schema.Literal<"uri">;
|
|
136
|
+
readonly uri: Schema.String;
|
|
137
|
+
}>]>;
|
|
138
|
+
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
139
|
+
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
140
|
+
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
141
|
+
readonly start: Schema.Finite;
|
|
142
|
+
readonly end: Schema.Finite;
|
|
143
|
+
readonly text: Schema.String;
|
|
144
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
145
|
+
readonly start: Schema.Finite;
|
|
146
|
+
readonly end: Schema.Finite;
|
|
147
|
+
readonly text: Schema.String;
|
|
148
|
+
}>>, never, never>;
|
|
149
|
+
readonly uri: Schema.String;
|
|
150
|
+
readonly bytes: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
151
|
+
readonly width: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
152
|
+
readonly height: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
153
|
+
}>]>;
|
|
154
|
+
export type Attachment = typeof Attachment.Type;
|
|
59
155
|
export interface AgentAttachment extends Schema.Schema.Type<typeof AgentAttachment> {
|
|
60
156
|
}
|
|
61
157
|
export declare const AgentAttachment: Schema.Struct<{
|
package/dist/prompt.js
CHANGED
|
@@ -34,6 +34,21 @@ export const FileAttachment = Schema.Struct({
|
|
|
34
34
|
mention: input.mention,
|
|
35
35
|
}),
|
|
36
36
|
})));
|
|
37
|
+
/** `media:` and the lowercase hex SHA-256 of a stored blob's bytes. Names no server route. */
|
|
38
|
+
export const MediaRef = Schema.String.check(Schema.isPattern(/^media:[0-9a-f]{64}$/)).annotate({
|
|
39
|
+
identifier: "Prompt.MediaRef",
|
|
40
|
+
});
|
|
41
|
+
const { data: _, ...fileAttachmentFields } = FileAttachment.fields;
|
|
42
|
+
export const MediaFileAttachment = Schema.Struct({
|
|
43
|
+
...fileAttachmentFields,
|
|
44
|
+
uri: MediaRef,
|
|
45
|
+
bytes: Schema.Int.pipe(optional),
|
|
46
|
+
width: Schema.Int.pipe(optional),
|
|
47
|
+
height: Schema.Int.pipe(optional),
|
|
48
|
+
}).annotate({ identifier: "Prompt.MediaFileAttachment" });
|
|
49
|
+
export const Attachment = Schema.Union([FileAttachment, MediaFileAttachment]).annotate({
|
|
50
|
+
identifier: "Prompt.Attachment",
|
|
51
|
+
});
|
|
37
52
|
export const AgentAttachment = Schema.Struct({
|
|
38
53
|
name: Schema.String,
|
|
39
54
|
mention: PromptMention.pipe(optional),
|