opencode-drive 0.1.4 → 0.1.6
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/package.json +1 -1
- package/src/cli/index.ts +42 -1
package/package.json
CHANGED
package/src/cli/index.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { NodeRuntime, NodeServices } from "@effect/platform-node"
|
|
3
3
|
import { Effect, Option } from "effect"
|
|
4
4
|
import { Command, Flag } from "effect/unstable/cli"
|
|
5
|
+
import packageJson from "../../package.json" with { type: "json" }
|
|
5
6
|
import { api } from "./api.js"
|
|
6
7
|
import { extractCommands } from "./parse.js"
|
|
7
8
|
import { list } from "./list.js"
|
|
@@ -28,6 +29,7 @@ const startCommand = Command.make(
|
|
|
28
29
|
{
|
|
29
30
|
name: startName,
|
|
30
31
|
daemon: Flag.boolean("daemon").pipe(
|
|
32
|
+
Flag.withHidden,
|
|
31
33
|
Flag.withDescription("Run as detached instance owner"),
|
|
32
34
|
),
|
|
33
35
|
script: Flag.string("script").pipe(
|
|
@@ -89,6 +91,42 @@ const sendCommand = Command.make("send", { name }, (config) =>
|
|
|
89
91
|
]),
|
|
90
92
|
)
|
|
91
93
|
|
|
94
|
+
const screenshotCommand = Command.make("screenshot", { name }, (config) =>
|
|
95
|
+
execute(() =>
|
|
96
|
+
send({
|
|
97
|
+
kind: "send",
|
|
98
|
+
name: Option.getOrUndefined(config.name),
|
|
99
|
+
commands: [{ operation: "ui.screenshot" }],
|
|
100
|
+
}),
|
|
101
|
+
),
|
|
102
|
+
).pipe(Command.withDescription("Take a screenshot and print its path"))
|
|
103
|
+
|
|
104
|
+
const startRecordingCommand = Command.make(
|
|
105
|
+
"record-start",
|
|
106
|
+
{ name },
|
|
107
|
+
(config) =>
|
|
108
|
+
execute(() =>
|
|
109
|
+
send({
|
|
110
|
+
kind: "send",
|
|
111
|
+
name: Option.getOrUndefined(config.name),
|
|
112
|
+
commands: [{ operation: "ui.start-record" }],
|
|
113
|
+
}),
|
|
114
|
+
),
|
|
115
|
+
).pipe(Command.withDescription("Start recording the UI"))
|
|
116
|
+
|
|
117
|
+
const endRecordingCommand = Command.make(
|
|
118
|
+
"record-end",
|
|
119
|
+
{ name },
|
|
120
|
+
(config) =>
|
|
121
|
+
execute(() =>
|
|
122
|
+
send({
|
|
123
|
+
kind: "send",
|
|
124
|
+
name: Option.getOrUndefined(config.name),
|
|
125
|
+
commands: [{ operation: "ui.end-record" }],
|
|
126
|
+
}),
|
|
127
|
+
),
|
|
128
|
+
).pipe(Command.withDescription("Stop recording and print its path"))
|
|
129
|
+
|
|
92
130
|
const apiCommand = Command.make("api", {}, () => execute(api)).pipe(
|
|
93
131
|
Command.withDescription("Print the OpenCode drive UI protocol"),
|
|
94
132
|
)
|
|
@@ -141,6 +179,9 @@ const root = Command.make("opencode-drive").pipe(
|
|
|
141
179
|
Command.withSubcommands([
|
|
142
180
|
startCommand,
|
|
143
181
|
sendCommand,
|
|
182
|
+
screenshotCommand,
|
|
183
|
+
startRecordingCommand,
|
|
184
|
+
endRecordingCommand,
|
|
144
185
|
listCommand,
|
|
145
186
|
responsesCommand,
|
|
146
187
|
logsCommand,
|
|
@@ -150,7 +191,7 @@ const root = Command.make("opencode-drive").pipe(
|
|
|
150
191
|
]),
|
|
151
192
|
)
|
|
152
193
|
|
|
153
|
-
Command.runWith(root, { version:
|
|
194
|
+
Command.runWith(root, { version: packageJson.version })(extracted.args).pipe(
|
|
154
195
|
Effect.provide(NodeServices.layer),
|
|
155
196
|
NodeRuntime.runMain,
|
|
156
197
|
)
|