@opencode/schema 0.0.0-dev-1341 → 0.0.0-dev-1343
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/automation.js +1 -0
- package/dist/prompt-input.js +3 -1
- package/dist/prompt.js +4 -1
- package/dist/session-inbox.js +4 -1
- package/dist/shell.js +5 -2
- package/dist/tool.d.ts +8 -0
- package/package.json +1 -1
package/dist/automation.js
CHANGED
|
@@ -119,6 +119,7 @@ export const CodeActionInput = Schema.Struct({
|
|
|
119
119
|
description: [
|
|
120
120
|
"Code Mode JavaScript run on each trigger with no model (32 KB output cap).",
|
|
121
121
|
'Call tools statically as tools.<ns>.<tool>(...) or tools["ns-name"].tool(...); each is authorized once at creation to run unattended.',
|
|
122
|
+
"A shell command still running at its timeout is stopped and the call throws; it never moves to the background.",
|
|
122
123
|
"Receives input = { state, now, runs, args } (also globals): state starts null, now is epoch ms, runs counts earlier runs.",
|
|
123
124
|
"Event triggers also receive input.event = { id, timestamp, data }; data follows the event type's payloadSchema.",
|
|
124
125
|
"Return nothing, or { state?, done?, send? }. JSON state is kept for the next run; done: true stops. lastOutput shows the delivery target and any logs.",
|
package/dist/prompt-input.js
CHANGED
|
@@ -4,7 +4,9 @@ import { AgentAttachment, FileSource, PromptMention } from "./prompt.js";
|
|
|
4
4
|
import { optional } from "./schema.js";
|
|
5
5
|
import { Skill } from "./skill.js";
|
|
6
6
|
export const FileAttachment = Schema.Struct({
|
|
7
|
-
uri: Schema.String
|
|
7
|
+
uri: Schema.String.annotate({
|
|
8
|
+
description: "A file: URL on the server (a file, a directory, or ?start=N&end=M for lines of a text file), a data: URL, or a media: ref from a message. Up to 20 MB.",
|
|
9
|
+
}),
|
|
8
10
|
// Source metadata does not require reopening the original file.
|
|
9
11
|
source: FileSource.pipe(optional),
|
|
10
12
|
name: Schema.String.pipe(optional),
|
package/dist/prompt.js
CHANGED
|
@@ -52,7 +52,10 @@ export const Attachment = Schema.Union([FileAttachment, MediaFileAttachment]).an
|
|
|
52
52
|
export const AgentAttachment = Schema.Struct({
|
|
53
53
|
name: Schema.String,
|
|
54
54
|
mention: PromptMention.pipe(optional),
|
|
55
|
-
}).annotate({
|
|
55
|
+
}).annotate({
|
|
56
|
+
identifier: "Prompt.AgentAttachment",
|
|
57
|
+
description: "An agent @-mentioned in the prompt, such as @explore, to suggest the model use it. Only the @name in text reaches the model; this records which agent it names and doesn't change the session's own agent.",
|
|
58
|
+
});
|
|
56
59
|
export const SkillAttachment = Schema.Struct({
|
|
57
60
|
id: Skill.ID,
|
|
58
61
|
name: Skill.Name,
|
package/dist/session-inbox.js
CHANGED
|
@@ -6,7 +6,10 @@ import { Attachment, Prompt } from "./prompt.js";
|
|
|
6
6
|
import { DateTimeUtcFromMillis, optional, RelativePath } from "./schema.js";
|
|
7
7
|
import { SessionID } from "./session-id.js";
|
|
8
8
|
import { SessionMessage } from "./session-message.js";
|
|
9
|
-
export const Delivery = Schema.Literals(["steer", "queue"]).annotate({
|
|
9
|
+
export const Delivery = Schema.Literals(["steer", "queue"]).annotate({
|
|
10
|
+
identifier: "Session.Inbox.Delivery",
|
|
11
|
+
description: "steer delivers before the agent's next model call, even mid-work. queue waits until the agent finishes its current work, then delivers one queued item at a time. Sending defaults to steer.",
|
|
12
|
+
});
|
|
10
13
|
export const UserPayload = Schema.Struct({
|
|
11
14
|
...Prompt.fields,
|
|
12
15
|
metadata: Schema.Record(Schema.String, Schema.Unknown).pipe(optional),
|
package/dist/shell.js
CHANGED
|
@@ -47,9 +47,12 @@ export const CreateInput = Schema.Struct({
|
|
|
47
47
|
timeout: optional(NonNegativeInt),
|
|
48
48
|
metadata: optional(Metadata),
|
|
49
49
|
});
|
|
50
|
+
// Descriptions sit on the inner schema because the query string codec drops annotations on `optional` itself.
|
|
50
51
|
export const OutputInput = Schema.Struct({
|
|
51
|
-
cursor: optional(NonNegativeInt
|
|
52
|
-
|
|
52
|
+
cursor: optional(NonNegativeInt.annotateKey({
|
|
53
|
+
description: "Byte offset to read from, such as the cursor of the previous page. Defaults to 0.",
|
|
54
|
+
})),
|
|
55
|
+
limit: optional(NonNegativeInt.annotateKey({ description: "Maximum number of bytes to return. Defaults to 65536." })),
|
|
53
56
|
});
|
|
54
57
|
export const Output = Schema.Struct({
|
|
55
58
|
output: Schema.String,
|
package/dist/tool.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * as Tool from "./tool.js";
|
|
|
2
2
|
import { Effect, JsonSchema, Schema } from "effect";
|
|
3
3
|
import type { StandardSchemaV1 } from "@standard-schema/spec";
|
|
4
4
|
import type { Agent } from "./agent.js";
|
|
5
|
+
import type { Automation } from "./automation.js";
|
|
5
6
|
import type { Session } from "./session.js";
|
|
6
7
|
import type { SessionMessage } from "./session-message.js";
|
|
7
8
|
export type Metadata = Readonly<Record<string, any>>;
|
|
@@ -32,6 +33,13 @@ export interface Context {
|
|
|
32
33
|
readonly cancel?: Effect.Effect<void>;
|
|
33
34
|
/** True when the tool is invoked from inside Code Mode (`execute`). */
|
|
34
35
|
readonly codemode?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Set when an automation's code makes the call. No model waits on it, and nobody hears about work it leaves
|
|
38
|
+
* running, so a tool must finish its work within the call.
|
|
39
|
+
*/
|
|
40
|
+
readonly automation?: {
|
|
41
|
+
readonly id: Automation.ID;
|
|
42
|
+
};
|
|
35
43
|
}
|
|
36
44
|
export interface Namespace {
|
|
37
45
|
readonly name: string;
|