@putdotio/taizn 1.8.0 → 1.10.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 +6 -2
- package/dist/taizn.mjs +36 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,8 +46,10 @@ Project files:
|
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
48
|
taizn check
|
|
49
|
+
taizn check --json
|
|
49
50
|
taizn apps
|
|
50
51
|
taizn apps put
|
|
52
|
+
taizn apps --json put
|
|
51
53
|
taizn launch GinifYRGmZ.putio
|
|
52
54
|
taizn prove GinifYRGmZ.putio
|
|
53
55
|
taizn prove --json GinifYRGmZ.putio
|
|
@@ -63,8 +65,10 @@ taizn --version
|
|
|
63
65
|
```
|
|
64
66
|
|
|
65
67
|
`check` verifies the configured Tizen CLI and `sdb`, then prints connected
|
|
66
|
-
targets without requiring `taizn.json`. `
|
|
67
|
-
|
|
68
|
+
targets without requiring `taizn.json`. Add `--json` to emit the configured
|
|
69
|
+
tool paths and connected targets for agents and scripts. `apps` lists installed
|
|
70
|
+
applications on the target, with an optional query filter. Add `--json` to emit
|
|
71
|
+
a structured inventory for agents and scripts. `launch` starts an already-installed
|
|
68
72
|
application by exact application ID, exact name, or a unique query. `prove`
|
|
69
73
|
checks the installed app inventory, launches the matched app, and prints a
|
|
70
74
|
compact proof transcript. Add `--json` when an agent or script needs structured
|
package/dist/taizn.mjs
CHANGED
|
@@ -707,10 +707,25 @@ const setXmlAttribute = (tag, attribute, value) => {
|
|
|
707
707
|
};
|
|
708
708
|
//#endregion
|
|
709
709
|
//#region src/tizen.ts
|
|
710
|
-
const checkTizen = Effect.fn("checkTizen")(function* (env) {
|
|
710
|
+
const checkTizen = Effect.fn("checkTizen")(function* (env, options = {}) {
|
|
711
711
|
const tizenPath = yield* resolveTizenCli(env);
|
|
712
712
|
const sdbPath = yield* resolveSdb(env);
|
|
713
713
|
const devices = yield* listSdbDevices(sdbPath);
|
|
714
|
+
if (options.json) {
|
|
715
|
+
yield* Console.log(JSON.stringify({
|
|
716
|
+
configuredTarget: env.target,
|
|
717
|
+
targets: devices.map((device) => ({
|
|
718
|
+
id: device.id,
|
|
719
|
+
label: device.label,
|
|
720
|
+
state: device.state
|
|
721
|
+
})),
|
|
722
|
+
tools: {
|
|
723
|
+
sdb: sdbPath,
|
|
724
|
+
tizenCli: tizenPath
|
|
725
|
+
}
|
|
726
|
+
}));
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
714
729
|
yield* Console.log(`Tizen CLI: ${tizenPath}`);
|
|
715
730
|
yield* Console.log(`sdb: ${sdbPath}`);
|
|
716
731
|
if (devices.length === 0) {
|
|
@@ -811,11 +826,22 @@ const runWidget = Effect.fn("runWidget")(function* ({ config, env }) {
|
|
|
811
826
|
], { env: yield* baseChildEnv() });
|
|
812
827
|
yield* Console.log(`Launched ${variant.applicationId}`);
|
|
813
828
|
});
|
|
814
|
-
const listInstalledApplications = Effect.fn("listInstalledApplications")(function* (env, query) {
|
|
815
|
-
const { applications: installedApplications, target } = yield* loadInstalledApplications(env);
|
|
829
|
+
const listInstalledApplications = Effect.fn("listInstalledApplications")(function* (env, query, options = {}) {
|
|
830
|
+
const { applications: installedApplications, target } = yield* loadInstalledApplications(env, { quiet: options.json });
|
|
816
831
|
const queryLabel = query?.trim();
|
|
817
832
|
const normalizedQuery = normalizeQuery(queryLabel);
|
|
818
833
|
const applications = installedApplications.filter((application) => matchesApplicationQuery(application, normalizedQuery));
|
|
834
|
+
if (options.json) {
|
|
835
|
+
yield* Console.log(JSON.stringify({
|
|
836
|
+
applications: applications.map((application) => ({
|
|
837
|
+
id: application.applicationId,
|
|
838
|
+
name: application.name
|
|
839
|
+
})),
|
|
840
|
+
query: queryLabel || void 0,
|
|
841
|
+
target
|
|
842
|
+
}));
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
819
845
|
const suffix = queryLabel ? ` matching "${queryLabel}"` : "";
|
|
820
846
|
yield* Console.log(`Installed Tizen applications${suffix} on ${target}:`);
|
|
821
847
|
if (applications.length === 0) {
|
|
@@ -1170,11 +1196,14 @@ const withContext = (operation) => Effect.gen(function* () {
|
|
|
1170
1196
|
yield* operation(yield* loadContext());
|
|
1171
1197
|
});
|
|
1172
1198
|
const taizn = Command.make("taizn", {}, () => withContext((context) => packageWidget(context).pipe(Effect.asVoid)));
|
|
1173
|
-
const check = Command.make("check", {}, () => Effect.gen(function* () {
|
|
1174
|
-
yield* checkTizen(yield* loadEnv());
|
|
1199
|
+
const check = Command.make("check", { json: Flag.boolean("json") }, ({ json }) => Effect.gen(function* () {
|
|
1200
|
+
yield* checkTizen(yield* loadEnv(), { json });
|
|
1175
1201
|
}));
|
|
1176
|
-
const apps = Command.make("apps", {
|
|
1177
|
-
|
|
1202
|
+
const apps = Command.make("apps", {
|
|
1203
|
+
json: Flag.boolean("json"),
|
|
1204
|
+
query: Argument.string("query").pipe(Argument.optional)
|
|
1205
|
+
}, ({ json, query }) => Effect.gen(function* () {
|
|
1206
|
+
yield* listInstalledApplications(yield* loadEnv(), Option.getOrUndefined(query), { json });
|
|
1178
1207
|
}));
|
|
1179
1208
|
const launch = Command.make("launch", { query: Argument.string("query") }, ({ query }) => Effect.gen(function* () {
|
|
1180
1209
|
yield* launchInstalledApplication(yield* loadEnv(), query);
|