@putdotio/taizn 1.7.0 → 1.9.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
@@ -48,8 +48,10 @@ Project files:
48
48
  taizn check
49
49
  taizn apps
50
50
  taizn apps put
51
+ taizn apps --json put
51
52
  taizn launch GinifYRGmZ.putio
52
53
  taizn prove GinifYRGmZ.putio
54
+ taizn prove --json GinifYRGmZ.putio
53
55
  taizn profile
54
56
  taizn package
55
57
  taizn install
@@ -63,10 +65,12 @@ taizn --version
63
65
 
64
66
  `check` verifies the configured Tizen CLI and `sdb`, then prints connected
65
67
  targets without requiring `taizn.json`. `apps` lists installed applications on
66
- the target, with an optional query filter. `launch` starts an already-installed
68
+ the target, with an optional query filter. Add `--json` to emit a structured
69
+ inventory for agents and scripts. `launch` starts an already-installed
67
70
  application by exact application ID, exact name, or a unique query. `prove`
68
71
  checks the installed app inventory, launches the matched app, and prints a
69
- compact proof transcript. `profile` imports
72
+ compact proof transcript. Add `--json` when an agent or script needs structured
73
+ proof output. `profile` imports
70
74
  `.taizn/certificates/author.p12` and
71
75
  `.taizn/certificates/distributor.p12` into a Tizen security profile.
72
76
  `package` builds and signs a `.wgt`. `install` packages and sideloads it.
package/dist/taizn.mjs CHANGED
@@ -811,11 +811,22 @@ const runWidget = Effect.fn("runWidget")(function* ({ config, env }) {
811
811
  ], { env: yield* baseChildEnv() });
812
812
  yield* Console.log(`Launched ${variant.applicationId}`);
813
813
  });
814
- const listInstalledApplications = Effect.fn("listInstalledApplications")(function* (env, query) {
815
- const { applications: installedApplications, target } = yield* loadInstalledApplications(env);
814
+ const listInstalledApplications = Effect.fn("listInstalledApplications")(function* (env, query, options = {}) {
815
+ const { applications: installedApplications, target } = yield* loadInstalledApplications(env, { quiet: options.json });
816
816
  const queryLabel = query?.trim();
817
817
  const normalizedQuery = normalizeQuery(queryLabel);
818
818
  const applications = installedApplications.filter((application) => matchesApplicationQuery(application, normalizedQuery));
819
+ if (options.json) {
820
+ yield* Console.log(JSON.stringify({
821
+ applications: applications.map((application) => ({
822
+ id: application.applicationId,
823
+ name: application.name
824
+ })),
825
+ query: queryLabel || void 0,
826
+ target
827
+ }));
828
+ return;
829
+ }
819
830
  const suffix = queryLabel ? ` matching "${queryLabel}"` : "";
820
831
  yield* Console.log(`Installed Tizen applications${suffix} on ${target}:`);
821
832
  if (applications.length === 0) {
@@ -831,10 +842,25 @@ const launchInstalledApplication = Effect.fn("launchInstalledApplication")(funct
831
842
  yield* launchApplication(tizenPath, target, application);
832
843
  yield* Console.log(`Launched ${application.name} (${application.applicationId}) on ${target}`);
833
844
  });
834
- const proveInstalledApplication = Effect.fn("proveInstalledApplication")(function* (env, query) {
845
+ const proveInstalledApplication = Effect.fn("proveInstalledApplication")(function* (env, query, options = {}) {
835
846
  const tizenPath = yield* resolveTizenCli(env);
836
- const { applications, target } = yield* loadInstalledApplications(env);
847
+ const { applications, target } = yield* loadInstalledApplications(env, { quiet: options.json });
837
848
  const application = yield* resolveInstalledApplication(query, applications);
849
+ if (options.json) {
850
+ const launchOutput = yield* launchApplication(tizenPath, target, application, { captureOutput: true });
851
+ yield* Console.log(JSON.stringify({
852
+ application: {
853
+ id: application.applicationId,
854
+ name: application.name
855
+ },
856
+ launch: {
857
+ output: launchOutput.trim(),
858
+ started: true
859
+ },
860
+ target
861
+ }));
862
+ return;
863
+ }
838
864
  yield* Console.log(`Tizen target: ${target}`);
839
865
  yield* Console.log(`Installed application: ${application.name} (${application.applicationId})`);
840
866
  yield* launchApplication(tizenPath, target, application);
@@ -1018,23 +1044,24 @@ const resolveRunTarget = Effect.fn("resolveRunTarget")(function* (env, sdbPath)
1018
1044
  }
1019
1045
  if (devices.length > 1) return yield* MultipleTargetsConnected.make({ targets: devices.map((device) => device.id) });
1020
1046
  });
1021
- const resolveRequiredSdbTarget = Effect.fn("resolveRequiredSdbTarget")(function* (env, sdbPath) {
1047
+ const resolveRequiredSdbTarget = Effect.fn("resolveRequiredSdbTarget")(function* (env, sdbPath, options = {}) {
1022
1048
  if (env.target) return env.target;
1023
1049
  const devices = yield* listSdbDevices(sdbPath);
1024
1050
  if (devices.length === 1) {
1025
1051
  const device = devices[0];
1026
1052
  if (device) {
1027
- yield* Console.log(`Using connected Tizen target: ${device.id}${device.label ? ` (${device.label})` : ""}`);
1053
+ if (!options.quiet) yield* Console.log(`Using connected Tizen target: ${device.id}${device.label ? ` (${device.label})` : ""}`);
1028
1054
  return device.id;
1029
1055
  }
1030
1056
  }
1031
1057
  if (devices.length > 1) return yield* MultipleTargetsConnected.make({ targets: devices.map((device) => device.id) });
1032
1058
  return yield* MissingTizenTarget.make({});
1033
1059
  });
1034
- const loadInstalledApplications = Effect.fn("loadInstalledApplications")(function* (env) {
1060
+ const loadInstalledApplications = Effect.fn("loadInstalledApplications")(function* (env, options = {}) {
1035
1061
  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);
1062
+ if (env.target) if (options.quiet) yield* capture(sdbPath, ["connect", env.target]);
1063
+ else yield* run$1(sdbPath, ["connect", env.target], { env: yield* baseChildEnv() });
1064
+ const target = yield* resolveRequiredSdbTarget(env, sdbPath, { quiet: options.quiet });
1038
1065
  return {
1039
1066
  applications: parseInstalledApplications(yield* capture(sdbPath, [
1040
1067
  "-s",
@@ -1083,7 +1110,14 @@ const resolveInstalledApplication = Effect.fn("resolveInstalledApplication")(fun
1083
1110
  });
1084
1111
  return yield* ApplicationNotFound.make({ query: queryLabel });
1085
1112
  });
1086
- const launchApplication = Effect.fn("launchApplication")(function* (tizenPath, target, application) {
1113
+ const launchApplication = Effect.fn("launchApplication")(function* (tizenPath, target, application, options = {}) {
1114
+ if (options.captureOutput) return yield* capture(tizenPath, [
1115
+ "run",
1116
+ "-p",
1117
+ application.applicationId,
1118
+ "-s",
1119
+ target
1120
+ ]);
1087
1121
  yield* run$1(tizenPath, [
1088
1122
  "run",
1089
1123
  "-p",
@@ -1091,6 +1125,7 @@ const launchApplication = Effect.fn("launchApplication")(function* (tizenPath, t
1091
1125
  "-s",
1092
1126
  target
1093
1127
  ], { env: yield* baseChildEnv() });
1128
+ return "";
1094
1129
  });
1095
1130
  const run$1 = Effect.fn("run")(function* (command, args, options) {
1096
1131
  const paths = yield* getPaths();
@@ -1149,14 +1184,20 @@ const taizn = Command.make("taizn", {}, () => withContext((context) => packageWi
1149
1184
  const check = Command.make("check", {}, () => Effect.gen(function* () {
1150
1185
  yield* checkTizen(yield* loadEnv());
1151
1186
  }));
1152
- const apps = Command.make("apps", { query: Argument.string("query").pipe(Argument.optional) }, ({ query }) => Effect.gen(function* () {
1153
- yield* listInstalledApplications(yield* loadEnv(), Option.getOrUndefined(query));
1187
+ const apps = Command.make("apps", {
1188
+ json: Flag.boolean("json"),
1189
+ query: Argument.string("query").pipe(Argument.optional)
1190
+ }, ({ json, query }) => Effect.gen(function* () {
1191
+ yield* listInstalledApplications(yield* loadEnv(), Option.getOrUndefined(query), { json });
1154
1192
  }));
1155
1193
  const launch = Command.make("launch", { query: Argument.string("query") }, ({ query }) => Effect.gen(function* () {
1156
1194
  yield* launchInstalledApplication(yield* loadEnv(), query);
1157
1195
  }));
1158
- const prove = Command.make("prove", { query: Argument.string("query") }, ({ query }) => Effect.gen(function* () {
1159
- yield* proveInstalledApplication(yield* loadEnv(), query);
1196
+ const prove = Command.make("prove", {
1197
+ json: Flag.boolean("json"),
1198
+ query: Argument.string("query")
1199
+ }, ({ json, query }) => Effect.gen(function* () {
1200
+ yield* proveInstalledApplication(yield* loadEnv(), query, { json });
1160
1201
  }));
1161
1202
  const profile = Command.make("profile", {}, () => withContext((context) => createProfile(context)));
1162
1203
  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.7.0",
3
+ "version": "1.9.0",
4
4
  "description": "A tiny CLI companion for interacting with Tizen ecosystem.",
5
5
  "keywords": [
6
6
  "cli",