@putdotio/taizn 1.6.0 → 1.8.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
@@ -50,6 +50,7 @@ taizn apps
50
50
  taizn apps put
51
51
  taizn launch GinifYRGmZ.putio
52
52
  taizn prove GinifYRGmZ.putio
53
+ taizn prove --json GinifYRGmZ.putio
53
54
  taizn profile
54
55
  taizn package
55
56
  taizn install
@@ -66,7 +67,8 @@ targets without requiring `taizn.json`. `apps` lists installed applications on
66
67
  the target, with an optional query filter. `launch` starts an already-installed
67
68
  application by exact application ID, exact name, or a unique query. `prove`
68
69
  checks the installed app inventory, launches the matched app, and prints a
69
- compact proof transcript. `profile` imports
70
+ compact proof transcript. Add `--json` when an agent or script needs structured
71
+ proof output. `profile` imports
70
72
  `.taizn/certificates/author.p12` and
71
73
  `.taizn/certificates/distributor.p12` into a Tizen security profile.
72
74
  `package` builds and signs a `.wgt`. `install` packages and sideloads it.
package/dist/taizn.mjs CHANGED
@@ -831,10 +831,25 @@ const launchInstalledApplication = Effect.fn("launchInstalledApplication")(funct
831
831
  yield* launchApplication(tizenPath, target, application);
832
832
  yield* Console.log(`Launched ${application.name} (${application.applicationId}) on ${target}`);
833
833
  });
834
- const proveInstalledApplication = Effect.fn("proveInstalledApplication")(function* (env, query) {
834
+ const proveInstalledApplication = Effect.fn("proveInstalledApplication")(function* (env, query, options = {}) {
835
835
  const tizenPath = yield* resolveTizenCli(env);
836
- const { applications, target } = yield* loadInstalledApplications(env);
836
+ const { applications, target } = yield* loadInstalledApplications(env, { quiet: options.json });
837
837
  const application = yield* resolveInstalledApplication(query, applications);
838
+ if (options.json) {
839
+ const launchOutput = yield* launchApplication(tizenPath, target, application, { captureOutput: true });
840
+ yield* Console.log(JSON.stringify({
841
+ application: {
842
+ id: application.applicationId,
843
+ name: application.name
844
+ },
845
+ launch: {
846
+ output: launchOutput.trim(),
847
+ started: true
848
+ },
849
+ target
850
+ }));
851
+ return;
852
+ }
838
853
  yield* Console.log(`Tizen target: ${target}`);
839
854
  yield* Console.log(`Installed application: ${application.name} (${application.applicationId})`);
840
855
  yield* launchApplication(tizenPath, target, application);
@@ -1018,23 +1033,24 @@ const resolveRunTarget = Effect.fn("resolveRunTarget")(function* (env, sdbPath)
1018
1033
  }
1019
1034
  if (devices.length > 1) return yield* MultipleTargetsConnected.make({ targets: devices.map((device) => device.id) });
1020
1035
  });
1021
- const resolveRequiredSdbTarget = Effect.fn("resolveRequiredSdbTarget")(function* (env, sdbPath) {
1036
+ const resolveRequiredSdbTarget = Effect.fn("resolveRequiredSdbTarget")(function* (env, sdbPath, options = {}) {
1022
1037
  if (env.target) return env.target;
1023
1038
  const devices = yield* listSdbDevices(sdbPath);
1024
1039
  if (devices.length === 1) {
1025
1040
  const device = devices[0];
1026
1041
  if (device) {
1027
- yield* Console.log(`Using connected Tizen target: ${device.id}${device.label ? ` (${device.label})` : ""}`);
1042
+ if (!options.quiet) yield* Console.log(`Using connected Tizen target: ${device.id}${device.label ? ` (${device.label})` : ""}`);
1028
1043
  return device.id;
1029
1044
  }
1030
1045
  }
1031
1046
  if (devices.length > 1) return yield* MultipleTargetsConnected.make({ targets: devices.map((device) => device.id) });
1032
1047
  return yield* MissingTizenTarget.make({});
1033
1048
  });
1034
- const loadInstalledApplications = Effect.fn("loadInstalledApplications")(function* (env) {
1049
+ const loadInstalledApplications = Effect.fn("loadInstalledApplications")(function* (env, options = {}) {
1035
1050
  const sdbPath = yield* resolveSdb(env);
1036
- if (env.target) yield* run$1(sdbPath, ["connect", env.target], { env: yield* baseChildEnv() });
1037
- const target = yield* resolveRequiredSdbTarget(env, sdbPath);
1051
+ if (env.target) if (options.quiet) yield* capture(sdbPath, ["connect", env.target]);
1052
+ else yield* run$1(sdbPath, ["connect", env.target], { env: yield* baseChildEnv() });
1053
+ const target = yield* resolveRequiredSdbTarget(env, sdbPath, { quiet: options.quiet });
1038
1054
  return {
1039
1055
  applications: parseInstalledApplications(yield* capture(sdbPath, [
1040
1056
  "-s",
@@ -1083,7 +1099,14 @@ const resolveInstalledApplication = Effect.fn("resolveInstalledApplication")(fun
1083
1099
  });
1084
1100
  return yield* ApplicationNotFound.make({ query: queryLabel });
1085
1101
  });
1086
- const launchApplication = Effect.fn("launchApplication")(function* (tizenPath, target, application) {
1102
+ const launchApplication = Effect.fn("launchApplication")(function* (tizenPath, target, application, options = {}) {
1103
+ if (options.captureOutput) return yield* capture(tizenPath, [
1104
+ "run",
1105
+ "-p",
1106
+ application.applicationId,
1107
+ "-s",
1108
+ target
1109
+ ]);
1087
1110
  yield* run$1(tizenPath, [
1088
1111
  "run",
1089
1112
  "-p",
@@ -1091,6 +1114,7 @@ const launchApplication = Effect.fn("launchApplication")(function* (tizenPath, t
1091
1114
  "-s",
1092
1115
  target
1093
1116
  ], { env: yield* baseChildEnv() });
1117
+ return "";
1094
1118
  });
1095
1119
  const run$1 = Effect.fn("run")(function* (command, args, options) {
1096
1120
  const paths = yield* getPaths();
@@ -1155,8 +1179,11 @@ const apps = Command.make("apps", { query: Argument.string("query").pipe(Argumen
1155
1179
  const launch = Command.make("launch", { query: Argument.string("query") }, ({ query }) => Effect.gen(function* () {
1156
1180
  yield* launchInstalledApplication(yield* loadEnv(), query);
1157
1181
  }));
1158
- const prove = Command.make("prove", { query: Argument.string("query") }, ({ query }) => Effect.gen(function* () {
1159
- yield* proveInstalledApplication(yield* loadEnv(), query);
1182
+ const prove = Command.make("prove", {
1183
+ json: Flag.boolean("json"),
1184
+ query: Argument.string("query")
1185
+ }, ({ json, query }) => Effect.gen(function* () {
1186
+ yield* proveInstalledApplication(yield* loadEnv(), query, { json });
1160
1187
  }));
1161
1188
  const profile = Command.make("profile", {}, () => withContext((context) => createProfile(context)));
1162
1189
  const pack = Command.make("package", {}, () => withContext((context) => packageWidget(context).pipe(Effect.asVoid)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putdotio/taizn",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "A tiny CLI companion for interacting with Tizen ecosystem.",
5
5
  "keywords": [
6
6
  "cli",
@@ -38,6 +38,7 @@
38
38
  "dev": "vp pack src/taizn.ts --watch",
39
39
  "live:test": "vp pack src/taizn.ts && node live-test/run-live-test.ts",
40
40
  "live:test:install": "vp pack src/taizn.ts && node live-test/run-live-test.ts --install",
41
+ "live:test:prove": "vp pack src/taizn.ts && node live-test/run-live-test.ts --prove",
41
42
  "live:test:profile": "vp pack src/taizn.ts && node live-test/run-live-test.ts --profile",
42
43
  "prepack": "vp pack src/taizn.ts",
43
44
  "prepare": "./scripts/prepare-effect.sh",