@nwire/cli 0.7.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.
Files changed (131) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -0
  3. package/dist/__tests__/doctor.test.d.ts +10 -0
  4. package/dist/__tests__/doctor.test.d.ts.map +1 -0
  5. package/dist/__tests__/doctor.test.js +105 -0
  6. package/dist/__tests__/doctor.test.js.map +1 -0
  7. package/dist/cache-runner.d.ts +2 -0
  8. package/dist/cache-runner.d.ts.map +1 -0
  9. package/dist/cache-runner.js +58 -0
  10. package/dist/cache-runner.js.map +1 -0
  11. package/dist/cli.d.ts +16 -0
  12. package/dist/cli.d.ts.map +1 -0
  13. package/dist/cli.js +67 -0
  14. package/dist/cli.js.map +1 -0
  15. package/dist/commands/build.d.ts +13 -0
  16. package/dist/commands/build.d.ts.map +1 -0
  17. package/dist/commands/build.js +74 -0
  18. package/dist/commands/build.js.map +1 -0
  19. package/dist/commands/cache.d.ts +6 -0
  20. package/dist/commands/cache.d.ts.map +1 -0
  21. package/dist/commands/cache.js +27 -0
  22. package/dist/commands/cache.js.map +1 -0
  23. package/dist/commands/check.d.ts +6 -0
  24. package/dist/commands/check.d.ts.map +1 -0
  25. package/dist/commands/check.js +21 -0
  26. package/dist/commands/check.js.map +1 -0
  27. package/dist/commands/dev.d.ts +11 -0
  28. package/dist/commands/dev.d.ts.map +1 -0
  29. package/dist/commands/dev.js +165 -0
  30. package/dist/commands/dev.js.map +1 -0
  31. package/dist/commands/doctor.d.ts +59 -0
  32. package/dist/commands/doctor.d.ts.map +1 -0
  33. package/dist/commands/doctor.js +399 -0
  34. package/dist/commands/doctor.js.map +1 -0
  35. package/dist/commands/fmt.d.ts +13 -0
  36. package/dist/commands/fmt.d.ts.map +1 -0
  37. package/dist/commands/fmt.js +33 -0
  38. package/dist/commands/fmt.js.map +1 -0
  39. package/dist/commands/greeting.d.ts +6 -0
  40. package/dist/commands/greeting.d.ts.map +1 -0
  41. package/dist/commands/greeting.js +25 -0
  42. package/dist/commands/greeting.js.map +1 -0
  43. package/dist/commands/infra.d.ts +14 -0
  44. package/dist/commands/infra.d.ts.map +1 -0
  45. package/dist/commands/infra.js +146 -0
  46. package/dist/commands/infra.js.map +1 -0
  47. package/dist/commands/lint.d.ts +12 -0
  48. package/dist/commands/lint.d.ts.map +1 -0
  49. package/dist/commands/lint.js +32 -0
  50. package/dist/commands/lint.js.map +1 -0
  51. package/dist/commands/logs.d.ts +21 -0
  52. package/dist/commands/logs.d.ts.map +1 -0
  53. package/dist/commands/logs.js +73 -0
  54. package/dist/commands/logs.js.map +1 -0
  55. package/dist/commands/ls.d.ts +5 -0
  56. package/dist/commands/ls.d.ts.map +1 -0
  57. package/dist/commands/ls.js +26 -0
  58. package/dist/commands/ls.js.map +1 -0
  59. package/dist/commands/please.d.ts +13 -0
  60. package/dist/commands/please.d.ts.map +1 -0
  61. package/dist/commands/please.js +46 -0
  62. package/dist/commands/please.js.map +1 -0
  63. package/dist/commands/ps.d.ts +6 -0
  64. package/dist/commands/ps.d.ts.map +1 -0
  65. package/dist/commands/ps.js +21 -0
  66. package/dist/commands/ps.js.map +1 -0
  67. package/dist/commands/run.d.ts +19 -0
  68. package/dist/commands/run.d.ts.map +1 -0
  69. package/dist/commands/run.js +112 -0
  70. package/dist/commands/run.js.map +1 -0
  71. package/dist/commands/studio.d.ts +9 -0
  72. package/dist/commands/studio.d.ts.map +1 -0
  73. package/dist/commands/studio.js +46 -0
  74. package/dist/commands/studio.js.map +1 -0
  75. package/dist/commands/test.d.ts +26 -0
  76. package/dist/commands/test.d.ts.map +1 -0
  77. package/dist/commands/test.js +143 -0
  78. package/dist/commands/test.js.map +1 -0
  79. package/dist/index.d.ts +11 -0
  80. package/dist/index.d.ts.map +1 -0
  81. package/dist/index.js +11 -0
  82. package/dist/index.js.map +1 -0
  83. package/dist/kernel-instance.d.ts +8 -0
  84. package/dist/kernel-instance.d.ts.map +1 -0
  85. package/dist/kernel-instance.js +13 -0
  86. package/dist/kernel-instance.js.map +1 -0
  87. package/dist/lib/colors.d.ts +19 -0
  88. package/dist/lib/colors.d.ts.map +1 -0
  89. package/dist/lib/colors.js +18 -0
  90. package/dist/lib/colors.js.map +1 -0
  91. package/dist/lib/exec.d.ts +30 -0
  92. package/dist/lib/exec.d.ts.map +1 -0
  93. package/dist/lib/exec.js +58 -0
  94. package/dist/lib/exec.js.map +1 -0
  95. package/dist/lib/process-state.d.ts +30 -0
  96. package/dist/lib/process-state.d.ts.map +1 -0
  97. package/dist/lib/process-state.js +68 -0
  98. package/dist/lib/process-state.js.map +1 -0
  99. package/dist/lib/project.d.ts +15 -0
  100. package/dist/lib/project.d.ts.map +1 -0
  101. package/dist/lib/project.js +52 -0
  102. package/dist/lib/project.js.map +1 -0
  103. package/dist/lib/run-task.d.ts +32 -0
  104. package/dist/lib/run-task.d.ts.map +1 -0
  105. package/dist/lib/run-task.js +70 -0
  106. package/dist/lib/run-task.js.map +1 -0
  107. package/dist/lib/vite-node.d.ts +10 -0
  108. package/dist/lib/vite-node.d.ts.map +1 -0
  109. package/dist/lib/vite-node.js +14 -0
  110. package/dist/lib/vite-node.js.map +1 -0
  111. package/dist/load-config.d.ts +27 -0
  112. package/dist/load-config.d.ts.map +1 -0
  113. package/dist/load-config.js +38 -0
  114. package/dist/load-config.js.map +1 -0
  115. package/dist/ls-runner.d.ts +2 -0
  116. package/dist/ls-runner.d.ts.map +1 -0
  117. package/dist/ls-runner.js +55 -0
  118. package/dist/ls-runner.js.map +1 -0
  119. package/dist/ui/dev-dashboard.d.ts +23 -0
  120. package/dist/ui/dev-dashboard.d.ts.map +1 -0
  121. package/dist/ui/dev-dashboard.js +53 -0
  122. package/dist/ui/dev-dashboard.js.map +1 -0
  123. package/dist/ui/greeting.d.ts +16 -0
  124. package/dist/ui/greeting.d.ts.map +1 -0
  125. package/dist/ui/greeting.js +16 -0
  126. package/dist/ui/greeting.js.map +1 -0
  127. package/dist/ui/process-table.d.ts +13 -0
  128. package/dist/ui/process-table.d.ts.map +1 -0
  129. package/dist/ui/process-table.js +26 -0
  130. package/dist/ui/process-table.js.map +1 -0
  131. package/package.json +49 -0
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Per-process state files under `.nwire/processes/`.
3
+ *
4
+ * Long-running CLI commands (`dev`, `run` once it shells through kernel)
5
+ * write one JSON record per child process they manage. `nwire ps` reads
6
+ * every record back to render a live table; `nwire logs <id>` reads the
7
+ * companion `.log` file. State files are NOT crash-safe — they're a
8
+ * developer convenience, not a queue.
9
+ */
10
+ import { mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
11
+ import { resolve } from "node:path";
12
+ function dir(cwd) {
13
+ return resolve(cwd, ".nwire", "processes");
14
+ }
15
+ export function recordPath(cwd, id) {
16
+ return resolve(dir(cwd), `${id}.json`);
17
+ }
18
+ export function logPath(cwd, id) {
19
+ return resolve(dir(cwd), `${id}.log`);
20
+ }
21
+ export function ensureDir(cwd) {
22
+ mkdirSync(dir(cwd), { recursive: true });
23
+ }
24
+ export function writeRecord(cwd, record) {
25
+ ensureDir(cwd);
26
+ writeFileSync(recordPath(cwd, record.id), JSON.stringify(record, null, 2));
27
+ }
28
+ export function readRecord(cwd, id) {
29
+ try {
30
+ const data = readFileSync(recordPath(cwd, id), "utf8");
31
+ return JSON.parse(data);
32
+ }
33
+ catch {
34
+ return undefined;
35
+ }
36
+ }
37
+ export function listRecords(cwd) {
38
+ const d = dir(cwd);
39
+ let entries;
40
+ try {
41
+ entries = readdirSync(d);
42
+ }
43
+ catch {
44
+ return [];
45
+ }
46
+ const out = [];
47
+ for (const f of entries) {
48
+ if (!f.endsWith(".json"))
49
+ continue;
50
+ try {
51
+ const data = readFileSync(resolve(d, f), "utf8");
52
+ out.push(JSON.parse(data));
53
+ }
54
+ catch {
55
+ // skip malformed entry
56
+ }
57
+ }
58
+ return out.sort((a, b) => b.startedAt.localeCompare(a.startedAt));
59
+ }
60
+ export function removeRecord(cwd, id) {
61
+ try {
62
+ rmSync(recordPath(cwd, id), { force: true });
63
+ }
64
+ catch {
65
+ // already gone
66
+ }
67
+ }
68
+ //# sourceMappingURL=process-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-state.js","sourceRoot":"","sources":["../../src/lib/process-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBpC,SAAS,GAAG,CAAC,GAAW;IACtB,OAAO,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAW,EAAE,EAAU;IAChD,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,GAAW,EAAE,EAAU;IAC7C,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,GAAW,EAAE,MAAqB;IAC5D,SAAS,CAAC,GAAG,CAAC,CAAC;IACf,aAAa,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAW,EAAE,EAAU;IAChD,IAAI,CAAC;QACH,MAAM,IAAI,GAA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;IACjB,CAAC;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Project introspection — figures out what shape of Nwire project we're
3
+ * sitting inside. Commands use this to render the greeting and to validate
4
+ * arguments before spawning anything.
5
+ */
6
+ export interface ProjectInfo {
7
+ readonly cwd: string;
8
+ readonly name: string;
9
+ readonly hasNwireConfig: boolean;
10
+ readonly wires: readonly string[];
11
+ readonly hasDevAll: boolean;
12
+ readonly hasPlease: boolean;
13
+ }
14
+ export declare function detectProject(cwd?: string): ProjectInfo;
15
+ //# sourceMappingURL=project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/lib/project.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAAsB,GAAG,WAAW,CA0CtE"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Project introspection — figures out what shape of Nwire project we're
3
+ * sitting inside. Commands use this to render the greeting and to validate
4
+ * arguments before spawning anything.
5
+ */
6
+ import { existsSync, readdirSync, readFileSync } from "node:fs";
7
+ import { resolve } from "node:path";
8
+ export function detectProject(cwd = process.cwd()) {
9
+ const pkgPath = resolve(cwd, "package.json");
10
+ let name = "(unnamed)";
11
+ try {
12
+ if (existsSync(pkgPath)) {
13
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
14
+ if (pkg.name)
15
+ name = pkg.name;
16
+ }
17
+ }
18
+ catch {
19
+ // keep default name
20
+ }
21
+ const appsDir = resolve(cwd, "apps");
22
+ const wires = [];
23
+ let hasDevAll = false;
24
+ let hasPlease = false;
25
+ if (existsSync(appsDir)) {
26
+ for (const entry of readdirSync(appsDir, { withFileTypes: true })) {
27
+ if (!entry.isDirectory())
28
+ continue;
29
+ const appDir = resolve(appsDir, entry.name);
30
+ // A wire is any app folder with a recognized entry file. We accept
31
+ // both the older `run.ts` convention and the current `main.ts`
32
+ // convention so the greeting works across projects mid-migration.
33
+ const hasEntry = existsSync(resolve(appDir, "run.ts")) || existsSync(resolve(appDir, "main.ts"));
34
+ if (hasEntry)
35
+ wires.push(entry.name);
36
+ if (entry.name === "dev-all" && existsSync(resolve(appDir, "run.ts"))) {
37
+ hasDevAll = true;
38
+ }
39
+ if (existsSync(resolve(appDir, "run.please.ts")))
40
+ hasPlease = true;
41
+ }
42
+ }
43
+ return {
44
+ cwd,
45
+ name,
46
+ hasNwireConfig: existsSync(resolve(cwd, "nwire.config.ts")),
47
+ wires: wires.sort(),
48
+ hasDevAll,
49
+ hasPlease,
50
+ };
51
+ }
52
+ //# sourceMappingURL=project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/lib/project.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,MAAM,UAAU,aAAa,CAAC,MAAc,OAAO,CAAC,GAAG,EAAE;IACvD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IAC7C,IAAI,IAAI,GAAG,WAAW,CAAC;IACvB,IAAI,CAAC;QACH,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YACxB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAsB,CAAC;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EAAE,iBAAiB,CAAC,CAAC;QAC3D,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE;QACnB,SAAS;QACT,SAAS;KACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Shared task runner — wraps an external command in a listr2 task with
3
+ * uniform progress styling. The command runs through pnpm exec so it
4
+ * picks up workspace-local binaries.
5
+ */
6
+ export interface TaskRunSpec {
7
+ readonly title: string;
8
+ readonly command: string;
9
+ readonly args: readonly string[];
10
+ /** Cwd. Defaults to process.cwd(). */
11
+ readonly cwd?: string;
12
+ /** Continue subsequent tasks even if this one fails. Default false. */
13
+ readonly skipOnFail?: boolean;
14
+ }
15
+ /**
16
+ * Run a single command and resolve with its exit code. The command's
17
+ * stdout/stderr are captured and discarded — listr2 owns the visual
18
+ * surface during task execution. On non-zero exit the task is marked
19
+ * failed and the captured stderr surfaces in the error message.
20
+ */
21
+ export declare function runCommand(spec: TaskRunSpec): Promise<{
22
+ code: number;
23
+ stderr: string;
24
+ stdout: string;
25
+ }>;
26
+ /**
27
+ * Run a list of named tasks sequentially with listr2's default renderer.
28
+ * Fails the run if any task's exit code is non-zero (unless `skipOnFail`
29
+ * is set). Returns the aggregate exit code.
30
+ */
31
+ export declare function runTaskList(tasks: readonly TaskRunSpec[]): Promise<number>;
32
+ //# sourceMappingURL=run-task.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-task.d.ts","sourceRoot":"","sources":["../../src/lib/run-task.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,sCAAsC;IACtC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,uEAAuE;IACvE,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAkBD;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAkChF"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Shared task runner — wraps an external command in a listr2 task with
3
+ * uniform progress styling. The command runs through pnpm exec so it
4
+ * picks up workspace-local binaries.
5
+ */
6
+ import { spawn } from "node:child_process";
7
+ import { Listr } from "listr2";
8
+ import { palette } from "./colors.js";
9
+ /**
10
+ * Run a single command and resolve with its exit code. The command's
11
+ * stdout/stderr are captured and discarded — listr2 owns the visual
12
+ * surface during task execution. On non-zero exit the task is marked
13
+ * failed and the captured stderr surfaces in the error message.
14
+ */
15
+ export function runCommand(spec) {
16
+ return new Promise((resolve) => {
17
+ const child = spawn(spec.command, spec.args, {
18
+ cwd: spec.cwd,
19
+ stdio: ["ignore", "pipe", "pipe"],
20
+ });
21
+ const stdoutChunks = [];
22
+ const stderrChunks = [];
23
+ child.stdout?.on("data", (c) => stdoutChunks.push(c));
24
+ child.stderr?.on("data", (c) => stderrChunks.push(c));
25
+ child.on("exit", (code) => resolve({
26
+ code: code ?? 0,
27
+ stdout: Buffer.concat(stdoutChunks).toString(),
28
+ stderr: Buffer.concat(stderrChunks).toString(),
29
+ }));
30
+ });
31
+ }
32
+ /**
33
+ * Run a list of named tasks sequentially with listr2's default renderer.
34
+ * Fails the run if any task's exit code is non-zero (unless `skipOnFail`
35
+ * is set). Returns the aggregate exit code.
36
+ */
37
+ export async function runTaskList(tasks) {
38
+ let aggregate = 0;
39
+ const list = new Listr(tasks.map((t) => ({
40
+ title: t.title,
41
+ task: async (_, taskCtx) => {
42
+ const result = await runCommand(t);
43
+ if (result.code !== 0) {
44
+ aggregate = aggregate || result.code;
45
+ const detail = result.stderr || result.stdout || `exit ${result.code}`;
46
+ if (t.skipOnFail) {
47
+ taskCtx.skip(detail.trim().split("\n")[0]);
48
+ return;
49
+ }
50
+ throw new Error(detail.trim());
51
+ }
52
+ },
53
+ })), {
54
+ concurrent: false,
55
+ exitOnError: false,
56
+ rendererOptions: { collapseSubtasks: false, showSubtasks: true },
57
+ });
58
+ try {
59
+ await list.run();
60
+ }
61
+ catch {
62
+ // listr2 already rendered the error
63
+ }
64
+ if (aggregate !== 0) {
65
+ // eslint-disable-next-line no-console
66
+ console.log(palette.err("\nOne or more tasks failed."));
67
+ }
68
+ return aggregate;
69
+ }
70
+ //# sourceMappingURL=run-task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-task.js","sourceRoot":"","sources":["../../src/lib/run-task.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAYnC;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,IAAiB;IAK1C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAgB,EAAE;YACvD,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;SAClC,CAAC,CAAC;QACH,MAAM,YAAY,GAAa,EAAE,CAAC;QAClC,MAAM,YAAY,GAAa,EAAE,CAAC;QAClC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CA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gBACT,CAAC;gBACD,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;KACF,CAAC,CAAC,EACH;QACE,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,KAAK;QAClB,eAAe,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE;KACjE,CACF,CAAC;IACF,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;IACnB,CAAC;IAAC,MAAM,CAAC;QACP,oCAAoC;IACtC,CAAC;IACD,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC;QACpB,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Thin wrappers around vite-node. Backend Nwire wires execute as Node
3
+ * scripts with Vite's resolver — TS-on-the-fly, path aliases, no bundle.
4
+ */
5
+ export declare function viteNode(scriptPath: string, scriptArgs?: readonly string[]): number;
6
+ export declare function viteNodeWatch(scriptPath: string): {
7
+ child: import("child_process").ChildProcess;
8
+ done: Promise<number>;
9
+ };
10
+ //# sourceMappingURL=vite-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite-node.d.ts","sourceRoot":"","sources":["../../src/lib/vite-node.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,GAAE,SAAS,MAAM,EAAO,GAAG,MAAM,CAEvF;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM;;;EAI/C"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Thin wrappers around vite-node. Backend Nwire wires execute as Node
3
+ * scripts with Vite's resolver — TS-on-the-fly, path aliases, no bundle.
4
+ */
5
+ import { execSync, spawnInteractive } from "./exec.js";
6
+ export function viteNode(scriptPath, scriptArgs = []) {
7
+ return execSync("pnpm", ["exec", "vite-node", scriptPath, ...scriptArgs]);
8
+ }
9
+ export function viteNodeWatch(scriptPath) {
10
+ return spawnInteractive("pnpm", ["exec", "vite-node", "--watch", scriptPath], {
11
+ stoppedMessage: "Dev server stopped.",
12
+ });
13
+ }
14
+ //# sourceMappingURL=vite-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite-node.js","sourceRoot":"","sources":["../../src/lib/vite-node.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAEpD,MAAM,UAAU,QAAQ,CAAC,UAAkB,EAAE,aAAgC,EAAE;IAC7E,OAAO,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,UAAkB;IAC9C,OAAO,gBAAgB,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE;QAC5E,cAAc,EAAE,qBAAqB;KACtC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * `nwire.config.ts` discovery + loading.
3
+ *
4
+ * Each project can declare where its apps live and where to write the
5
+ * cache. Falls back to amit-style layout (`apps/apps.ts` → `allApps`) when
6
+ * no config file is present.
7
+ */
8
+ export interface NwireConfig {
9
+ /**
10
+ * Path to the module that exports the apps registry. Resolved relative
11
+ * to the project root (CWD). Accepts .ts / .js / .mts / .mjs.
12
+ *
13
+ * The module must export the apps registry as one of:
14
+ * - default export: `AppDefinition` or `AppDefinition[]`
15
+ * - named export `apps: AppDefinition[]`
16
+ * - named export `allApps: AppDefinition[]`
17
+ *
18
+ * Default: `apps/apps.ts` (the amit/consumer-app shape).
19
+ */
20
+ readonly appsEntry?: string;
21
+ /** Where to write the static cache. Default `.nwire`. */
22
+ readonly cacheDir?: string;
23
+ }
24
+ export declare function defineConfig(cfg: NwireConfig): NwireConfig;
25
+ export declare function loadConfig(cwd: string): Promise<NwireConfig>;
26
+ export declare function resolveAppsEntry(cwd: string, config: NwireConfig): string;
27
+ //# sourceMappingURL=load-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../src/load-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAE5B,yDAAyD;IACzD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,CAE1D;AAMD,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAWlE;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM,CAQzE"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * `nwire.config.ts` discovery + loading.
3
+ *
4
+ * Each project can declare where its apps live and where to write the
5
+ * cache. Falls back to amit-style layout (`apps/apps.ts` → `allApps`) when
6
+ * no config file is present.
7
+ */
8
+ import { resolve } from "node:path";
9
+ import { existsSync } from "node:fs";
10
+ export function defineConfig(cfg) {
11
+ return cfg;
12
+ }
13
+ const CONFIG_NAMES = ["nwire.config.ts", "nwire.config.mts", "nwire.config.js", "nwire.config.mjs"];
14
+ const FALLBACK_ENTRIES = ["apps/apps.ts", "apps/index.ts", "src/main.ts", "src/index.ts"];
15
+ export async function loadConfig(cwd) {
16
+ for (const name of CONFIG_NAMES) {
17
+ const p = resolve(cwd, name);
18
+ if (existsSync(p)) {
19
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
+ const mod = await import(/* @vite-ignore */ p);
21
+ const cfg = (mod.default ?? mod.config ?? mod);
22
+ return cfg;
23
+ }
24
+ }
25
+ return {};
26
+ }
27
+ export function resolveAppsEntry(cwd, config) {
28
+ if (config.appsEntry)
29
+ return resolve(cwd, config.appsEntry);
30
+ // No config — try known locations.
31
+ for (const entry of FALLBACK_ENTRIES) {
32
+ const p = resolve(cwd, entry);
33
+ if (existsSync(p))
34
+ return p;
35
+ }
36
+ return resolve(cwd, "apps/apps.ts"); // canonical default; will error if missing
37
+ }
38
+ //# sourceMappingURL=load-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-config.js","sourceRoot":"","sources":["../src/load-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAoBrC,MAAM,UAAU,YAAY,CAAC,GAAgB;IAC3C,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,YAAY,GAAG,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;AAEpG,MAAM,gBAAgB,GAAG,CAAC,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;AAE1F,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAW;IAC1C,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;QAChC,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC7B,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;YAClB,8DAA8D;YAC9D,MAAM,GAAG,GAAQ,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;YACpD,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAgB,CAAC;YAC9D,OAAO,GAAG,CAAC;QACb,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,GAAW,EAAE,MAAmB;IAC/D,IAAI,MAAM,CAAC,SAAS;QAAE,OAAO,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IAC5D,mCAAmC;IACnC,KAAK,MAAM,KAAK,IAAI,gBAAgB,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC9B,IAAI,UAAU,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,CAAC,2CAA2C;AAClF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ls-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ls-runner.d.ts","sourceRoot":"","sources":["../src/ls-runner.ts"],"names":[],"mappings":""}
@@ -0,0 +1,55 @@
1
+ // `nwire ls` — list every wire + every action across all apps.
2
+ import { resolve } from "node:path";
3
+ import { readdirSync, statSync, existsSync } from "node:fs";
4
+ function listWires(appsRoot) {
5
+ if (!existsSync(appsRoot))
6
+ return [];
7
+ const wires = [];
8
+ for (const app of readdirSync(appsRoot)) {
9
+ const appDir = resolve(appsRoot, app);
10
+ if (!statSync(appDir).isDirectory())
11
+ continue;
12
+ for (const file of readdirSync(appDir)) {
13
+ if (!file.startsWith("run") || !file.endsWith(".ts"))
14
+ continue;
15
+ if (file.endsWith(".d.ts"))
16
+ continue;
17
+ const stem = file.slice(0, -3);
18
+ const variant = stem === "run" ? "" : `.${stem.slice(4)}`;
19
+ wires.push({ wire: `${app}${variant}`, path: resolve(appDir, file) });
20
+ }
21
+ }
22
+ return wires;
23
+ }
24
+ async function main() {
25
+ const cwd = process.cwd();
26
+ const appsRoot = resolve(cwd, "apps");
27
+ const wires = listWires(appsRoot);
28
+ console.log("Wires:");
29
+ for (const { wire, path } of wires) {
30
+ const rel = path.replace(cwd + "/", "");
31
+ console.log(` ${wire.padEnd(28)} ${rel}`);
32
+ }
33
+ console.log();
34
+ // Try to list actions from the apps registry.
35
+ const appsPath = resolve(cwd, "apps/apps.ts");
36
+ if (existsSync(appsPath)) {
37
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
+ const mod = await import(/* @vite-ignore */ appsPath);
39
+ const apps = mod.allApps ?? mod.apps ?? [];
40
+ console.log("Actions:");
41
+ for (const app of apps) {
42
+ for (const module of app.modules) {
43
+ for (const action of module.manifest.actions ?? []) {
44
+ const label = `${action.name}`.padEnd(40);
45
+ console.log(` ${label} ${app.name}/${module.name}`);
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ main().catch((err) => {
52
+ console.error(err);
53
+ process.exit(1);
54
+ });
55
+ //# sourceMappingURL=ls-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ls-runner.js","sourceRoot":"","sources":["../src/ls-runner.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAE/D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE5D,SAAS,SAAS,CAAC,QAAgB;IACjC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,EAAE,CAAC;IACrC,MAAM,KAAK,GAA0C,EAAE,CAAC;IACxD,KAAK,MAAM,GAAG,IAAI,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxC,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QACtC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE;YAAE,SAAS;QAC9C,KAAK,MAAM,IAAI,IAAI,W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MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IAC9C,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzB,8DAA8D;QAC9D,MAAM,GAAG,GAAQ,MAAM,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QAC3D,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACxB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;gBACjC,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;oBACnD,MAAM,KAAK,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;oBAC1C,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,IAAI,GAAG,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;gBACvD,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Live dev dashboard. Subscribes to a stdout/stderr stream from a child
3
+ * process (vite-node --watch in slice 1, supervisor-managed wires in
4
+ * later slices) and renders a header + recent log tail.
5
+ *
6
+ * Detection heuristics here are intentionally loose — we just want a
7
+ * "Ready · http://localhost:3003" line when the server is up.
8
+ */
9
+ import React from "react";
10
+ export interface LogChunk {
11
+ readonly id: number;
12
+ readonly stream: "stdout" | "stderr";
13
+ readonly text: string;
14
+ }
15
+ interface DevDashboardProps {
16
+ readonly title: string;
17
+ readonly subtitle?: string;
18
+ readonly subscribe: (push: (chunk: Omit<LogChunk, "id">) => void) => () => void;
19
+ readonly maxLines?: number;
20
+ }
21
+ export declare function DevDashboard({ title, subtitle, subscribe, maxLines, }: DevDashboardProps): React.ReactElement;
22
+ export {};
23
+ //# sourceMappingURL=dev-dashboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-dashboard.d.ts","sourceRoot":"","sources":["../../src/ui/dev-dashboard.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,iBAAiB;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;IAChF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AA0BD,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,SAAS,EACT,QAAa,GACd,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,CA8DxC"}
@@ -0,0 +1,53 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Live dev dashboard. Subscribes to a stdout/stderr stream from a child
4
+ * process (vite-node --watch in slice 1, supervisor-managed wires in
5
+ * later slices) and renders a header + recent log tail.
6
+ *
7
+ * Detection heuristics here are intentionally loose — we just want a
8
+ * "Ready · http://localhost:3003" line when the server is up.
9
+ */
10
+ import { useEffect, useState } from "react";
11
+ import { Box, Static, Text } from "ink";
12
+ const READY_PATTERNS = [
13
+ /ready in\s+([0-9]+\s*ms)/i,
14
+ /Local:\s+(http[s]?:\/\/\S+)/i,
15
+ /listening on\s+(http[s]?:\/\/\S+)/i,
16
+ ];
17
+ function detectReady(line, prev) {
18
+ let next = { ...prev };
19
+ for (const pattern of READY_PATTERNS) {
20
+ const match = pattern.exec(line);
21
+ if (!match)
22
+ continue;
23
+ next = { ...next, ready: true };
24
+ if (match[1]?.startsWith("http"))
25
+ next.url = match[1];
26
+ else if (match[1]?.includes("ms"))
27
+ next.elapsed = match[1];
28
+ }
29
+ return next;
30
+ }
31
+ export function DevDashboard({ title, subtitle, subscribe, maxLines = 18, }) {
32
+ const [lines, setLines] = useState([]);
33
+ const [ready, setReady] = useState({ ready: false });
34
+ const [counter, setCounter] = useState(0);
35
+ useEffect(() => {
36
+ let id = 0;
37
+ const off = subscribe((chunk) => {
38
+ id += 1;
39
+ const next = { ...chunk, id };
40
+ setLines((prev) => {
41
+ const merged = [...prev, next];
42
+ return merged.slice(Math.max(0, merged.length - maxLines));
43
+ });
44
+ setReady((prev) => detectReady(chunk.text, prev));
45
+ setCounter((n) => n + 1);
46
+ });
47
+ return off;
48
+ }, [subscribe, maxLines]);
49
+ const statusColor = ready.ready ? "green" : "yellow";
50
+ const statusLabel = ready.ready ? "running" : "booting";
51
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { borderStyle: "round", borderColor: "cyan", flexDirection: "column", paddingX: 2, children: [_jsxs(Box, { children: [_jsx(Text, { bold: true, color: "cyan", children: title }), subtitle ? _jsx(Text, { dimColor: true, children: ` · ${subtitle}` }) : null] }), _jsxs(Box, { marginTop: 1, children: [_jsx(Box, { width: 10, children: _jsx(Text, { dimColor: true, children: "status" }) }), _jsx(Text, { color: statusColor, children: statusLabel }), ready.url ? _jsx(Text, { dimColor: true, children: ` · ${ready.url}` }) : null, ready.elapsed ? _jsx(Text, { dimColor: true, children: ` · ${ready.elapsed}` }) : null] }), _jsxs(Box, { children: [_jsx(Box, { width: 10, children: _jsx(Text, { dimColor: true, children: "output" }) }), _jsx(Text, { dimColor: true, children: `${counter} line${counter === 1 ? "" : "s"}` })] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Press Ctrl+C to stop." }) })] }), _jsx(Box, { flexDirection: "column", marginTop: 1, marginLeft: 1, children: _jsx(Static, { items: lines, children: (chunk) => (_jsx(Box, { children: _jsx(Text, { color: chunk.stream === "stderr" ? "red" : undefined, children: chunk.text }) }, chunk.id)) }) })] }));
52
+ }
53
+ //# sourceMappingURL=dev-dashboard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-dashboard.js","sourceRoot":"","sources":["../../src/ui/dev-dashboard.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AAEH,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAqBxC,MAAM,cAAc,GAAa;IAC/B,2BAA2B;IAC3B,8BAA8B;IAC9B,oCAAoC;CACrC,CAAC;AAEF,SAAS,WAAW,CAAC,IAAY,EAAE,IAAgB;IACjD,IAAI,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;IACvB,KAAK,MAAM,OAAO,IAAI,cAAc,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK;YAAE,SAAS;QACrB,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QAChC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC;YAAE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ACZ,KAAC,IAAI,IAAC,QAAQ,6BAAc,GACxB,EACN,KAAC,IAAI,IAAC,QAAQ,kBAAE,GAAG,OAAO,QAAQ,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,GAAQ,IAChE,EACN,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,QAAQ,4CAA6B,GACvC,IACF,EAEN,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,YACrD,KAAC,MAAM,IAAC,KAAK,EAAE,KAAK,YACjB,CAAC,KAAK,EAAE,EAAE,CAAC,CACV,KAAC,GAAG,cACF,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,YAAG,KAAK,CAAC,IAAI,GAAQ,IADvE,KAAK,CAAC,EAAE,CAEZ,CACP,GACM,GACL,IACF,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Greeting screen — branded box, project summary, suggested commands.
3
+ *
4
+ * Rendered with ink for one reason: a single declarative tree describes
5
+ * the entire panel, the same way Studio's Vue components do. Adding a new
6
+ * row (e.g. "modules detected") is one line, not three console.logs.
7
+ */
8
+ import React from "react";
9
+ import type { ProjectInfo } from "../lib/project.js";
10
+ interface GreetingProps {
11
+ readonly project: ProjectInfo;
12
+ readonly version: string;
13
+ }
14
+ export declare function Greeting({ project, version }: GreetingProps): React.ReactElement;
15
+ export {};
16
+ //# sourceMappingURL=greeting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"greeting.d.ts","sourceRoot":"","sources":["../../src/ui/greeting.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,UAAU,aAAa;IACrB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,aAAa,GAAG,KAAK,CAAC,YAAY,CA4DhF"}
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ export function Greeting({ project, version }) {
4
+ const suggestions = [];
5
+ if (project.hasDevAll)
6
+ suggestions.push("nwire dev");
7
+ if (project.wires.length > 0)
8
+ suggestions.push(`nwire run ${project.wires[0]}`);
9
+ if (project.hasPlease)
10
+ suggestions.push("nwire please <command>");
11
+ suggestions.push("nwire studio", "nwire ps", "nwire --help");
12
+ return (_jsxs(Box, { flexDirection: "column", paddingX: 1, paddingY: 0, children: [_jsxs(Box, { borderStyle: "round", borderColor: "cyan", flexDirection: "column", paddingX: 2, paddingY: 0, children: [_jsxs(Box, { children: [_jsx(Text, { bold: true, color: "cyan", children: "Nwire" }), _jsx(Text, { dimColor: true, children: ` v${version}` }), _jsx(Text, { children: ` ` }), _jsx(Text, { dimColor: true, children: project.name })] }), _jsxs(Box, { marginTop: 1, children: [_jsx(Box, { width: 10, children: _jsx(Text, { dimColor: true, children: "wires" }) }), _jsx(Text, { children: project.wires.length > 0
13
+ ? project.wires.join(", ")
14
+ : "(none detected — expected apps/<name>/{run,main}.ts)" })] }), _jsxs(Box, { children: [_jsx(Box, { width: 10, children: _jsx(Text, { dimColor: true, children: "please" }) }), _jsx(Text, { color: project.hasPlease ? "green" : undefined, children: project.hasPlease ? "ready" : "—" })] }), _jsxs(Box, { children: [_jsx(Box, { width: 10, children: _jsx(Text, { dimColor: true, children: "config" }) }), _jsx(Text, { color: project.hasNwireConfig ? "green" : undefined, children: project.hasNwireConfig ? "nwire.config.ts" : "(default)" })] })] }), _jsxs(Box, { flexDirection: "column", marginTop: 1, marginLeft: 1, children: [_jsx(Text, { dimColor: true, children: "Try:" }), suggestions.map((s) => (_jsxs(Box, { children: [_jsx(Text, { color: "magenta", children: " › " }), _jsx(Text, { children: s })] }, s)))] })] }));
15
+ }
16
+ //# sourceMappingURL=greeting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"greeting.js","sourceRoot":"","sources":["../../src/ui/greeting.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAShC,MAAM,UAAU,QAAQ,CAAC,EAAE,OAAO,EAAE,OAAO,EAAiB;IAC1D,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,IAAI,OAAO,CAAC,SAAS;QAAE,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACrD,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,WAAW,CAAC,IAAI,CAAC,aAAa,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAChF,IAAI,OAAO,CAAC,SAAS;QAAE,WAAW,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IAClE,WAAW,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;IAE7D,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,aAClD,MAAC,GAAG,IAAC,WAAW,EAAC,OAAO,EAAC,WAAW,EAAC,MAAM,EAAC,aAAa,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,aACzF,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,MAAM,sBAEhB,EACP,KAAC,IAAI,IAAC,QAAQ,kBAAE,KAAK,OAAO,EAAE,GAAQ,EACtC,KAAC,IAAI,c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AAQ,EACrC,KAAC,IAAI,cAAE,CAAC,GAAQ,KAFR,CAAC,CAGL,CACP,CAAC,IACE,IACF,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * `nwire ps` table — one row per managed process record discovered under
3
+ * `.nwire/processes/`. Ink-rendered for the same visual language as the
4
+ * greeting and dev dashboard.
5
+ */
6
+ import React from "react";
7
+ import type { ProcessRecord } from "../lib/process-state.js";
8
+ interface ProcessTableProps {
9
+ readonly records: readonly ProcessRecord[];
10
+ }
11
+ export declare function ProcessTable({ records }: ProcessTableProps): React.ReactElement;
12
+ export {};
13
+ //# sourceMappingURL=process-table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-table.d.ts","sourceRoot":"","sources":["../../src/ui/process-table.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,UAAU,iBAAiB;IACzB,QAAQ,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;CAC5C;AAqBD,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,CAwD/E"}
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ function statusColor(status) {
4
+ switch (status) {
5
+ case "running":
6
+ return "green";
7
+ case "starting":
8
+ return "yellow";
9
+ case "stopping":
10
+ return "yellow";
11
+ case "exited":
12
+ return "gray";
13
+ case "crashed":
14
+ return "red";
15
+ }
16
+ }
17
+ function shortId(id) {
18
+ return id.slice(0, 8);
19
+ }
20
+ export function ProcessTable({ records }) {
21
+ if (records.length === 0) {
22
+ return (_jsx(Box, { flexDirection: "column", paddingY: 1, paddingX: 1, children: _jsx(Text, { dimColor: true, children: "No managed processes. Start one with `nwire dev` or `nwire run <wire>`." }) }));
23
+ }
24
+ return (_jsxs(Box, { flexDirection: "column", paddingY: 1, paddingX: 1, children: [_jsxs(Box, { children: [_jsx(Box, { width: 10, children: _jsx(Text, { dimColor: true, children: "ID" }) }), _jsx(Box, { width: 24, children: _jsx(Text, { dimColor: true, children: "NAME" }) }), _jsx(Box, { width: 10, children: _jsx(Text, { dimColor: true, children: "STATUS" }) }), _jsx(Box, { width: 8, children: _jsx(Text, { dimColor: true, children: "PORT" }) }), _jsx(Box, { width: 8, children: _jsx(Text, { dimColor: true, children: "PID" }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "STARTED" }) })] }), records.map((r) => (_jsxs(Box, { children: [_jsx(Box, { width: 10, children: _jsx(Text, { children: shortId(r.id) }) }), _jsx(Box, { width: 24, children: _jsx(Text, { children: r.name }) }), _jsx(Box, { width: 10, children: _jsx(Text, { color: statusColor(r.status), children: r.status }) }), _jsx(Box, { width: 8, children: _jsx(Text, { children: r.port ?? "—" }) }), _jsx(Box, { width: 8, children: _jsx(Text, { children: r.pid }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: r.startedAt }) })] }, r.id)))] }));
25
+ }
26
+ //# sourceMappingURL=process-table.js.map