opencode-drive 0.1.5 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli/index.ts +40 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "opencode-drive",
4
- "version": "0.1.5",
4
+ "version": "0.1.6",
5
5
  "description": "Drive real and simulated OpenCode instances",
6
6
  "license": "MIT",
7
7
  "type": "module",
package/src/cli/index.ts CHANGED
@@ -29,6 +29,7 @@ const startCommand = Command.make(
29
29
  {
30
30
  name: startName,
31
31
  daemon: Flag.boolean("daemon").pipe(
32
+ Flag.withHidden,
32
33
  Flag.withDescription("Run as detached instance owner"),
33
34
  ),
34
35
  script: Flag.string("script").pipe(
@@ -90,6 +91,42 @@ const sendCommand = Command.make("send", { name }, (config) =>
90
91
  ]),
91
92
  )
92
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
+
93
130
  const apiCommand = Command.make("api", {}, () => execute(api)).pipe(
94
131
  Command.withDescription("Print the OpenCode drive UI protocol"),
95
132
  )
@@ -142,6 +179,9 @@ const root = Command.make("opencode-drive").pipe(
142
179
  Command.withSubcommands([
143
180
  startCommand,
144
181
  sendCommand,
182
+ screenshotCommand,
183
+ startRecordingCommand,
184
+ endRecordingCommand,
145
185
  listCommand,
146
186
  responsesCommand,
147
187
  logsCommand,