@putdotio/taizn 1.11.0 → 1.12.0

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/README.md CHANGED
@@ -61,6 +61,7 @@ taizn tv info
61
61
  taizn tv info --json
62
62
  taizn tv pair
63
63
  taizn tv press KEY_ENTER
64
+ taizn tv press --json KEY_ENTER
64
65
  taizn tv press --delay-ms 250 KEY_HOME KEY_DOWN KEY_ENTER
65
66
  taizn --version
66
67
  ```
@@ -80,7 +81,8 @@ proof output. `profile` imports
80
81
  `run` launches the configured variant application on the target. `tv` commands use
81
82
  Samsung's websocket remote-control API to inspect a TV,
82
83
  pair for a remote token, and send remote-control key presses. Add `--json` to
83
- `tv info` for a structured TV capability snapshot. See
84
+ `tv info` for a structured TV capability snapshot, or to `tv press` for a
85
+ structured key-sequence receipt. See
84
86
  [Samsung TV Remote](./docs/TV_REMOTE.md) for pairing, environment, and limits.
85
87
  `tv press` accepts one key or a sequence of keys.
86
88
 
package/dist/taizn.mjs CHANGED
@@ -461,11 +461,27 @@ Effect.fn("sendSamsungTvKey")(function* (env, key) {
461
461
  });
462
462
  const sendSamsungTvKeys = Effect.fn("sendSamsungTvKeys")(function* (env, keys, pressOptions) {
463
463
  const remoteOptions = yield* resolveRemoteOptions(env, { requireToken: true });
464
- if (!remoteOptions.token) return yield* MissingTvRemoteToken.make({});
464
+ const token = remoteOptions.token;
465
+ const delayMs = Math.max(0, pressOptions?.delayMs ?? 250);
466
+ if (!token) return yield* MissingTvRemoteToken.make({});
465
467
  yield* connectRemote(remoteOptions, {
466
- delayMs: Math.max(0, pressOptions?.delayMs ?? 250),
468
+ delayMs,
467
469
  keys
468
470
  });
471
+ if (pressOptions?.json) {
472
+ yield* Console.log(JSON.stringify({
473
+ delayMs,
474
+ keys,
475
+ keyCount: keys.length,
476
+ target: {
477
+ host: remoteOptions.host,
478
+ port: remoteOptions.port,
479
+ protocol: remoteOptions.protocol,
480
+ url: remoteTarget(remoteOptions)
481
+ }
482
+ }));
483
+ return;
484
+ }
469
485
  yield* Console.log(keys.length === 1 ? `Sent Samsung TV remote key: ${keys[0]}` : `Sent Samsung TV remote keys: ${keys.join(", ")}`);
470
486
  });
471
487
  const showSamsungTvInfo = Effect.fn("showSamsungTvInfo")(function* (env, infoOptions = {}) {
@@ -1248,9 +1264,13 @@ const tvPair = Command.make("pair", {}, () => Effect.gen(function* () {
1248
1264
  }));
1249
1265
  const tvPress = Command.make("press", {
1250
1266
  delayMs: Flag.integer("delay-ms").pipe(Flag.withDefault(250)),
1267
+ json: Flag.boolean("json"),
1251
1268
  keys: Argument.string("key").pipe(Argument.variadic({ min: 1 }))
1252
- }, ({ delayMs, keys }) => Effect.gen(function* () {
1253
- yield* sendSamsungTvKeys(yield* loadEnv(), keys, { delayMs });
1269
+ }, ({ delayMs, json, keys }) => Effect.gen(function* () {
1270
+ yield* sendSamsungTvKeys(yield* loadEnv(), keys, {
1271
+ delayMs,
1272
+ json
1273
+ });
1254
1274
  }));
1255
1275
  const tvInfo = Command.make("info", { json: Flag.boolean("json") }, ({ json }) => Effect.gen(function* () {
1256
1276
  yield* showSamsungTvInfo(yield* loadEnv(), { json });
package/docs/TV_REMOTE.md CHANGED
@@ -10,6 +10,7 @@ taizn tv info
10
10
  taizn tv info --json
11
11
  taizn tv pair
12
12
  taizn tv press KEY_ENTER
13
+ taizn tv press --json KEY_ENTER
13
14
  taizn tv press --delay-ms 250 KEY_HOME KEY_DOWN KEY_ENTER
14
15
  ```
15
16
 
@@ -22,6 +23,7 @@ taizn tv press --delay-ms 250 KEY_HOME KEY_DOWN KEY_ENTER
22
23
  as `KEY_HOME`, `KEY_BACK`, `KEY_UP`, `KEY_DOWN`, `KEY_LEFT`, `KEY_RIGHT`, or
23
24
  `KEY_ENTER`. Pass multiple keys to send a navigation sequence on one
24
25
  websocket connection. `--delay-ms` controls the delay between sequence keys.
26
+ Add `--json` to emit a redacted receipt with the target, delay, and keys sent.
25
27
 
26
28
  ## Environment
27
29
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putdotio/taizn",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "A tiny CLI companion for interacting with Tizen ecosystem.",
5
5
  "keywords": [
6
6
  "cli",