@taskless/cli 0.11.1 → 0.11.2

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
@@ -16,10 +16,11 @@ npx @taskless/cli
16
16
 
17
17
  Run with no arguments in a terminal to launch the installer, which detects the
18
18
  agent tools in your project (Claude Code, Cursor, OpenCode) and installs into
19
- each of them. For scripted installs, skip the prompts:
19
+ each of them. For scripted installs and upgrades, `init` runs the same install
20
+ without prompts, in a terminal or not:
20
21
 
21
22
  ```bash
22
- npx @taskless/cli init --no-interactive
23
+ npx @taskless/cli init
23
24
  ```
24
25
 
25
26
  New to Taskless? Run `npx @taskless/cli onboard` after installing. It walks your
@@ -0,0 +1,108 @@
1
+ import { spawnSync as g } from "node:child_process";
2
+ import { existsSync as c } from "node:fs";
3
+ import { createRequire as y } from "node:module";
4
+ import { resolve as s, dirname as m } from "node:path";
5
+ import o from "node:process";
6
+ import { fileURLToPath as b } from "node:url";
7
+ const _ = {
8
+ label: "ast-grep",
9
+ packagePrefix: "@ast-grep/cli",
10
+ toolchainSuffix: !0,
11
+ binaryNames: ["ast-grep", "sg"],
12
+ identity: /ast-grep/i
13
+ };
14
+ function p(e) {
15
+ const t = [o.platform, o.arch];
16
+ return e.toolchainSuffix && (o.platform === "linux" ? t.push("gnu") : o.platform === "win32" && t.push("msvc")), `${e.packagePrefix}-${t.join("-")}`;
17
+ }
18
+ function i(e) {
19
+ return o.platform === "win32" ? `${e}.exe` : e;
20
+ }
21
+ function d(e) {
22
+ return e.binaryNames.toReversed();
23
+ }
24
+ function P(e) {
25
+ return i(d(e)[0] ?? e.label);
26
+ }
27
+ function h(e, t) {
28
+ try {
29
+ const a = y(import.meta.url).resolve(
30
+ `${p(e)}/package.json`
31
+ );
32
+ return s(m(a), t);
33
+ } catch {
34
+ return;
35
+ }
36
+ }
37
+ function k(e) {
38
+ const t = o.platform === "win32" ? ";" : ":";
39
+ for (const r of (o.env.PATH ?? "").split(t)) {
40
+ if (r === "") continue;
41
+ const a = s(r, e);
42
+ if (c(a)) return a;
43
+ }
44
+ }
45
+ function x(e, t) {
46
+ if (!c(t)) return !1;
47
+ const r = g(t, ["--version"], {
48
+ encoding: "utf8",
49
+ timeout: 5e3
50
+ });
51
+ return r.error !== void 0 || r.status !== 0 ? !1 : e.identity.test(`${r.stdout ?? ""}${r.stderr ?? ""}`);
52
+ }
53
+ function N(e) {
54
+ const t = s(
55
+ m(b(import.meta.url)),
56
+ "..",
57
+ "node_modules",
58
+ ".bin"
59
+ ), r = d(e), a = [
60
+ [
61
+ "platform-package",
62
+ p(e),
63
+ h(
64
+ e,
65
+ i(e.binaryNames[0] ?? e.label)
66
+ )
67
+ ],
68
+ ...r.map(
69
+ (n) => [
70
+ "node_modules/.bin",
71
+ "node_modules/.bin",
72
+ s(t, i(n))
73
+ ]
74
+ ),
75
+ ...r.map(
76
+ (n) => ["PATH", "PATH", k(i(n))]
77
+ )
78
+ ], f = [...new Set(a.map(([, n]) => n))];
79
+ for (const [n, , l] of a)
80
+ if (l !== void 0 && x(e, l))
81
+ return { path: l, source: n, tried: f };
82
+ return { path: void 0, source: void 0, tried: f };
83
+ }
84
+ const v = {
85
+ label: "vale",
86
+ packagePrefix: "@taskless/vale",
87
+ toolchainSuffix: !1,
88
+ binaryNames: ["vale"],
89
+ identity: /vale/i
90
+ };
91
+ let u;
92
+ function w() {
93
+ return u ??= N(v), u;
94
+ }
95
+ function H(e) {
96
+ return `Vale binary not found. Looked in: ${e.join(", ")}. Install a supported platform build, or put \`${P(v)}\` on your PATH. Other engines still ran.`;
97
+ }
98
+ export {
99
+ _ as A,
100
+ v as V,
101
+ p as a,
102
+ w as b,
103
+ k as f,
104
+ x as i,
105
+ P as p,
106
+ N as r,
107
+ H as v
108
+ };