@codyswann/lisa 2.199.0 → 2.200.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 (77) hide show
  1. package/dist/cli/index.d.ts +6 -0
  2. package/dist/cli/index.d.ts.map +1 -1
  3. package/dist/cli/index.js +30 -3
  4. package/dist/cli/index.js.map +1 -1
  5. package/dist/cli/sync-cmd.d.ts +21 -0
  6. package/dist/cli/sync-cmd.d.ts.map +1 -0
  7. package/dist/cli/sync-cmd.js +43 -0
  8. package/dist/cli/sync-cmd.js.map +1 -0
  9. package/dist/cli/ui-cmd.d.ts +35 -0
  10. package/dist/cli/ui-cmd.d.ts.map +1 -0
  11. package/dist/cli/ui-cmd.js +104 -0
  12. package/dist/cli/ui-cmd.js.map +1 -0
  13. package/dist/sync/config-sync.d.ts +42 -0
  14. package/dist/sync/config-sync.d.ts.map +1 -0
  15. package/dist/sync/config-sync.js +272 -0
  16. package/dist/sync/config-sync.js.map +1 -0
  17. package/dist/sync/json-path.d.ts +58 -0
  18. package/dist/sync/json-path.d.ts.map +1 -0
  19. package/dist/sync/json-path.js +107 -0
  20. package/dist/sync/json-path.js.map +1 -0
  21. package/dist/sync/registry.d.ts +64 -0
  22. package/dist/sync/registry.d.ts.map +1 -0
  23. package/dist/sync/registry.js +207 -0
  24. package/dist/sync/registry.js.map +1 -0
  25. package/package.json +2 -1
  26. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  27. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  28. package/plugins/lisa-agy/plugin.json +1 -1
  29. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  30. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  31. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  32. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  33. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  34. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  35. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  38. package/plugins/lisa-expo-agy/plugin.json +1 -1
  39. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  40. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  43. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  44. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  46. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  48. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  49. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  50. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  52. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  53. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  54. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  57. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  58. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  59. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  63. package/plugins/lisa-rails-agy/plugin.json +1 -1
  64. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  68. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  69. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  73. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  74. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  76. package/ui/README.md +180 -0
  77. package/ui/index.html +5396 -0
@@ -5,6 +5,8 @@ import { runDoctor } from "./doctor.js";
5
5
  import { printUpdateWarning } from "./print-update-warning.js";
6
6
  import { runSetupProject } from "./setup-project.js";
7
7
  import { runSetupWiki } from "./setup-wiki.js";
8
+ import { runSync } from "./sync-cmd.js";
9
+ import { runUi } from "./ui-cmd.js";
8
10
  import { runUpdate } from "./update-cmd.js";
9
11
  import { runUpdateCheck } from "./update-check.js";
10
12
  import { runVersion } from "./version-cmd.js";
@@ -28,6 +30,10 @@ export interface ProgramDependencies {
28
30
  runDoctor: typeof runDoctor;
29
31
  /** Cross-pollinates locally-authored agent definitions across the fleet. */
30
32
  runCrossPollinate: typeof runCrossPollinate;
33
+ /** Populates and syncs `.lisa.config.json` with its mirrored artifacts. */
34
+ runSync: typeof runSync;
35
+ /** Serves the Lisa settings console (after a config sync). */
36
+ runUi: typeof runUi;
31
37
  /** Runs the non-fatal npm update check (defaults to {@link runUpdateCheck}). */
32
38
  runUpdateCheck: typeof runUpdateCheck;
33
39
  /** Prints the update warning (defaults to {@link printUpdateWarning}). */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAEL,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,6EAA6E;IAC7E,QAAQ,EAAE,OAAO,QAAQ,CAAC;IAC1B,kEAAkE;IAClE,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,4DAA4D;IAC5D,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,wCAAwC;IACxC,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,yDAAyD;IACzD,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,qCAAqC;IACrC,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,4EAA4E;IAC5E,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,gFAAgF;IAChF,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,0EAA0E;IAC1E,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;CAC/C;AAyED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,YA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O,OAAO,CAAC;IACxB,8DAA8D;IAC9D,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,gFAAgF;IAChF,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,0EAA0E;IAC1E,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;CAC/C;AAyGD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,YAAY,GAAE,OAAO,CAAC,mBAAmB,CAAM,GAC9C,OAAO,CA4ET;AAED,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
package/dist/cli/index.js CHANGED
@@ -7,6 +7,8 @@ import { runSetupProject } from "./setup-project.js";
7
7
  import { runSetupWiki } from "./setup-wiki.js";
8
8
  import { addSharedOptions } from "./shared-options.js";
9
9
  import { SETUP_TYPES } from "./starters.js";
10
+ import { runSync } from "./sync-cmd.js";
11
+ import { runUi } from "./ui-cmd.js";
10
12
  import { runUpdate } from "./update-cmd.js";
11
13
  import { runUpdateCheck } from "./update-check.js";
12
14
  import { runVersion } from "./version-cmd.js";
@@ -19,9 +21,13 @@ const DEFAULT_DEPENDENCIES = {
19
21
  runUpdate,
20
22
  runDoctor,
21
23
  runCrossPollinate,
24
+ runSync,
25
+ runUi,
22
26
  runUpdateCheck,
23
27
  printUpdateWarning,
24
28
  };
29
+ /** Shared help text for the optional project-path positional argument. */
30
+ const PATH_ARG_DESCRIPTION = "Project path (default: current directory)";
25
31
  /**
26
32
  * Register CLI maintenance commands that do not run the root update warning.
27
33
  * @param program - Commander program to mutate
@@ -54,10 +60,31 @@ function addMaintenanceCommands(program, deps) {
54
60
  .action(async (targetPath, options) => {
55
61
  await deps.runDoctor(targetPath, options);
56
62
  });
63
+ program
64
+ .command("sync")
65
+ .description("Populate .lisa.config.json with every missing setting and sync mirrored files (config wins)")
66
+ .argument("[path]", PATH_ARG_DESCRIPTION)
67
+ .option("--dry-run", "Report what would change without writing")
68
+ .option("--json", "Emit the report as JSON")
69
+ .action(async (targetPath, options) => {
70
+ const code = await deps.runSync(targetPath, options);
71
+ if (code !== 0) {
72
+ process.exitCode = code;
73
+ }
74
+ });
75
+ program
76
+ .command("ui")
77
+ .description("Serve the Lisa settings console for a project (runs a config sync first)")
78
+ .argument("[path]", PATH_ARG_DESCRIPTION)
79
+ .option("--port <port>", "Port to listen on", "4780")
80
+ .option("--no-sync", "Skip the config sync on startup")
81
+ .action(async (targetPath, options) => {
82
+ await deps.runUi(targetPath, options);
83
+ });
57
84
  program
58
85
  .command("cross-pollinate")
59
86
  .description("Make locally-authored agent definitions available to the other agents this project supports")
60
- .argument("[path]", "Project path (default: current directory)")
87
+ .argument("[path]", PATH_ARG_DESCRIPTION)
61
88
  .option("--write", "Apply emits and update the lockfile (default: dry-run)")
62
89
  .action(async (targetPath, options) => {
63
90
  await deps.runCrossPollinate(targetPath, options);
@@ -89,7 +116,7 @@ export function createProgram(dependencies = {}) {
89
116
  // Run the npm update-check once per invocation, before the matched action.
90
117
  // It is non-fatal: a failed check never blocks the action from running.
91
118
  program.hook("preAction", async (_thisCommand, actionCommand) => {
92
- if (["doctor", "update", "version"].includes(actionCommand.name())) {
119
+ if (["doctor", "sync", "ui", "update", "version"].includes(actionCommand.name())) {
93
120
  return;
94
121
  }
95
122
  if (program.opts().updateCheck === false) {
@@ -119,7 +146,7 @@ export function createProgram(dependencies = {}) {
119
146
  addSharedOptions(program
120
147
  .command("setup-wiki")
121
148
  .description("Prepare an existing project for embedded Lisa wiki setup")
122
- .argument("[path]", "Project path (default: current directory)")).action(async (destination, options) => {
149
+ .argument("[path]", PATH_ARG_DESCRIPTION)).action(async (destination, options) => {
123
150
  await deps.runSetupWiki(destination, options);
124
151
  });
125
152
  addMaintenanceCommands(program, deps);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC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IAEH,gBAAgB,CACd,OAAO;SACJ,OAAO,CAAC,eAAe,CAAC;SACxB,WAAW,CAAC,uDAAuD,CAAC;SACpE,cAAc,CACb,eAAe,EACf,iBAAiB,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAC3C;SACA,QAAQ,CAAC,eAAe,EAAE,8CAA8C,CAAC,CAC7E,CAAC,MAAM,CACN,KAAK,EACH,WAA+B,EAC/B,OAAuC,EACvC,EAAE;QACF,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC,CACF,CAAC;IAEF,gBAAgB,CACd,OAAO;SACJ,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CAAC,0DAA0D,CAAC;SACvE,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAC5C,CAAC,MAAM,CAAC,KAAK,EAAE,WAA+B,EAAE,OAAmB,EAAE,EAAE;QACtE,MAAM,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,sBAAsB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAEtC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { type SyncReport } from "../sync/config-sync.js";
2
+ /** CLI options for `lisa sync`. */
3
+ export interface SyncCmdOptions {
4
+ /** Report what would change without writing */
5
+ readonly dryRun?: boolean;
6
+ /** Emit the report as JSON instead of human-readable lines */
7
+ readonly json?: boolean;
8
+ }
9
+ /**
10
+ * Print a sync report in human-readable form.
11
+ * @param report - Report returned by the sync engine
12
+ */
13
+ export declare function printSyncReport(report: SyncReport): void;
14
+ /**
15
+ * Run the `lisa sync` command.
16
+ * @param targetPath - Project path argument (defaults to the current directory)
17
+ * @param options - CLI options
18
+ * @returns Exit code (0 on success, 1 when required keys are missing)
19
+ */
20
+ export declare function runSync(targetPath: string | undefined, options?: SyncCmdOptions): Promise<number>;
21
+ //# sourceMappingURL=sync-cmd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-cmd.d.ts","sourceRoot":"","sources":["../../src/cli/sync-cmd.ts"],"names":[],"mappings":"AAMA,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAExE,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAaxD;AAED;;;;;GAKG;AACH,wBAAsB,OAAO,CAC3B,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,MAAM,CAAC,CAWjB"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * `lisa sync` — populate `.lisa.config.json` with every missing setting and
3
+ * push config values back into the artifact files that mirror them.
4
+ * @module cli/sync-cmd
5
+ */
6
+ import * as path from "node:path";
7
+ import { runConfigSync } from "../sync/config-sync.js";
8
+ /**
9
+ * Print a sync report in human-readable form.
10
+ * @param report - Report returned by the sync engine
11
+ */
12
+ export function printSyncReport(report) {
13
+ const prefix = report.dryRun ? "[dry-run] " : "";
14
+ if (report.actions.length === 0) {
15
+ console.log(`${prefix}Config is in sync — nothing to do.`);
16
+ }
17
+ report.actions.forEach(action => {
18
+ console.log(`${prefix}${action.kind} ${action.key} — ${action.detail}`);
19
+ });
20
+ report.missingRequired.forEach(missing => {
21
+ console.warn(`${prefix}missing-required ${missing.key} — cannot be defaulted; run ${missing.setupHint}`);
22
+ });
23
+ }
24
+ /**
25
+ * Run the `lisa sync` command.
26
+ * @param targetPath - Project path argument (defaults to the current directory)
27
+ * @param options - CLI options
28
+ * @returns Exit code (0 on success, 1 when required keys are missing)
29
+ */
30
+ export async function runSync(targetPath, options = {}) {
31
+ const destDir = path.resolve(targetPath ?? ".");
32
+ const report = await runConfigSync(destDir, {
33
+ dryRun: options.dryRun === true,
34
+ });
35
+ if (options.json === true) {
36
+ console.log(JSON.stringify(report, null, 2));
37
+ }
38
+ else {
39
+ printSyncReport(report);
40
+ }
41
+ return report.missingRequired.length > 0 ? 1 : 0;
42
+ }
43
+ //# sourceMappingURL=sync-cmd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-cmd.js","sourceRoot":"","sources":["../../src/cli/sync-cmd.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAmB,MAAM,wBAAwB,CAAC;AAUxE;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,MAAkB;IAChD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IACjD,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,oCAAoC,CAAC,CAAC;IAC7D,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAC9B,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACvC,OAAO,CAAC,IAAI,CACV,GAAG,MAAM,qBAAqB,OAAO,CAAC,GAAG,+BAA+B,OAAO,CAAC,SAAS,EAAE,CAC5F,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,UAA8B,EAC9B,UAA0B,EAAE;IAE5B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,OAAO,EAAE;QAC1C,MAAM,EAAE,OAAO,CAAC,MAAM,KAAK,IAAI;KAChC,CAAC,CAAC;IACH,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC;SAAM,CAAC;QACN,eAAe,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,MAAM,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,35 @@
1
+ import * as http from "node:http";
2
+ import { type JsonObject } from "../sync/json-path.js";
3
+ /** Default port for the settings console. */
4
+ export declare const DEFAULT_UI_PORT = 4780;
5
+ /** CLI options for `lisa ui`. */
6
+ export interface UiCmdOptions {
7
+ /** Port to listen on (string because Commander passes raw option values) */
8
+ readonly port?: string;
9
+ /** Set false (via --no-sync) to skip the config sync on startup */
10
+ readonly sync?: boolean;
11
+ }
12
+ /**
13
+ * Locate the packaged `ui/index.html` by walking up from this module until a
14
+ * directory containing `ui/index.html` is found (works from both `src/` and
15
+ * the compiled `dist/`).
16
+ * @param startDir - Directory to start searching from
17
+ * @returns Absolute path to ui/index.html
18
+ */
19
+ export declare function findUiHtml(startDir: string): string;
20
+ /**
21
+ * Inject the live config into the console HTML as a script tag. The JSON is
22
+ * escaped so a value containing `</script>` cannot break out of the tag.
23
+ * @param html - Packaged console HTML
24
+ * @param config - Merged live config
25
+ * @returns HTML with the injected config
26
+ */
27
+ export declare function injectLiveConfig(html: string, config: JsonObject): string;
28
+ /**
29
+ * Run the `lisa ui` command: sync, then serve the console until interrupted.
30
+ * @param targetPath - Project path argument (defaults to the current directory)
31
+ * @param options - CLI options
32
+ * @returns The listening server (callers/tests are responsible for closing it)
33
+ */
34
+ export declare function runUi(targetPath: string | undefined, options?: UiCmdOptions): Promise<http.Server>;
35
+ //# sourceMappingURL=ui-cmd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-cmd.d.ts","sourceRoot":"","sources":["../../src/cli/ui-cmd.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAIlC,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIrE,6CAA6C;AAC7C,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC,iCAAiC;AACjC,MAAM,WAAW,YAAY;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,mEAAmE;IACnE,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAUnD;AAmBD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,CAIzE;AAED;;;;;GAKG;AACH,wBAAsB,KAAK,CACzB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAoCtB"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * `lisa ui` — serve the Lisa settings console for a project.
3
+ *
4
+ * Runs a config sync first (so the config file is fully populated — the UI's
5
+ * contract is "no unset configs"), then serves the packaged `ui/index.html`
6
+ * with the project's merged live config injected as
7
+ * `window.LISA_LIVE_CONFIG`, which the page uses to hydrate its controls.
8
+ * @module cli/ui-cmd
9
+ */
10
+ import { existsSync } from "node:fs";
11
+ import { readFile } from "node:fs/promises";
12
+ import * as http from "node:http";
13
+ import * as path from "node:path";
14
+ import { fileURLToPath } from "node:url";
15
+ import { runConfigSync } from "../sync/config-sync.js";
16
+ import { isJsonObject } from "../sync/json-path.js";
17
+ import { deepMerge, readJsonOrNull } from "../utils/index.js";
18
+ import { printSyncReport } from "./sync-cmd.js";
19
+ /** Default port for the settings console. */
20
+ export const DEFAULT_UI_PORT = 4780;
21
+ /**
22
+ * Locate the packaged `ui/index.html` by walking up from this module until a
23
+ * directory containing `ui/index.html` is found (works from both `src/` and
24
+ * the compiled `dist/`).
25
+ * @param startDir - Directory to start searching from
26
+ * @returns Absolute path to ui/index.html
27
+ */
28
+ export function findUiHtml(startDir) {
29
+ const candidate = path.join(startDir, "ui", "index.html");
30
+ if (existsSync(candidate)) {
31
+ return candidate;
32
+ }
33
+ const parent = path.dirname(startDir);
34
+ if (parent === startDir) {
35
+ throw new Error("Unable to locate the packaged ui/index.html");
36
+ }
37
+ return findUiHtml(parent);
38
+ }
39
+ /**
40
+ * Read the project's merged config view (local overlay wins per key).
41
+ * @param destDir - Project root
42
+ * @returns Merged config object
43
+ */
44
+ async function readMergedConfig(destDir) {
45
+ const committed = await readJsonOrNull(path.join(destDir, ".lisa.config.json"));
46
+ const local = await readJsonOrNull(path.join(destDir, ".lisa.config.local.json"));
47
+ const committedObject = isJsonObject(committed) ? committed : {};
48
+ const localObject = isJsonObject(local) ? local : {};
49
+ return deepMerge(committedObject, localObject);
50
+ }
51
+ /**
52
+ * Inject the live config into the console HTML as a script tag. The JSON is
53
+ * escaped so a value containing `</script>` cannot break out of the tag.
54
+ * @param html - Packaged console HTML
55
+ * @param config - Merged live config
56
+ * @returns HTML with the injected config
57
+ */
58
+ export function injectLiveConfig(html, config) {
59
+ const payload = JSON.stringify(config).replace(/<\//g, "<\\/");
60
+ const tag = `<script>window.LISA_LIVE_CONFIG = ${payload};</script>`;
61
+ return html.replace("</body>", `${tag}\n</body>`);
62
+ }
63
+ /**
64
+ * Run the `lisa ui` command: sync, then serve the console until interrupted.
65
+ * @param targetPath - Project path argument (defaults to the current directory)
66
+ * @param options - CLI options
67
+ * @returns The listening server (callers/tests are responsible for closing it)
68
+ */
69
+ export async function runUi(targetPath, options = {}) {
70
+ const destDir = path.resolve(targetPath ?? ".");
71
+ const port = Number.parseInt(options.port ?? `${DEFAULT_UI_PORT}`, 10);
72
+ if (Number.isNaN(port) || port < 0 || port > 65535) {
73
+ throw new Error(`Invalid --port value: ${options.port}`);
74
+ }
75
+ if (options.sync !== false) {
76
+ const report = await runConfigSync(destDir);
77
+ printSyncReport(report);
78
+ }
79
+ const moduleDir = path.dirname(fileURLToPath(import.meta.url));
80
+ const htmlPath = findUiHtml(moduleDir);
81
+ const html = await readFile(htmlPath, "utf8");
82
+ const config = await readMergedConfig(destDir);
83
+ const page = injectLiveConfig(html, config);
84
+ const server = http.createServer((request, response) => {
85
+ const url = request.url ?? "/";
86
+ if (url === "/" || url.startsWith("/index.html") || url.startsWith("/#")) {
87
+ response.writeHead(200, { "content-type": "text/html; charset=utf-8" });
88
+ response.end(page);
89
+ return;
90
+ }
91
+ response.writeHead(404, { "content-type": "text/plain" });
92
+ response.end("Not found");
93
+ });
94
+ await new Promise(resolve => {
95
+ server.listen(port, "127.0.0.1", resolve);
96
+ });
97
+ const address = server.address();
98
+ const boundPort = typeof address === "object" && address !== null ? address.port : port;
99
+ console.log(`Lisa console for ${destDir}`);
100
+ console.log(` → http://127.0.0.1:${boundPort}`);
101
+ console.log("Press Ctrl+C to stop.");
102
+ return server;
103
+ }
104
+ //# sourceMappingURL=ui-cmd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-cmd.js","sourceRoot":"","sources":["../../src/cli/ui-cmd.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,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AC,CAAC,CAAC,IAAI,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;IAC3C,OAAO,CAAC,GAAG,CAAC,wBAAwB,SAAS,EAAE,CAAC,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACrC,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,42 @@
1
+ /** Key holding sync provenance metadata inside `.lisa.config.json`. */
2
+ export declare const SYNC_METADATA_KEY = "_lisaSync";
3
+ /** What sync did (or would do, in dry-run) for one setting. */
4
+ export type SyncActionKind = "absorbed-artifact" | "populated-default" | "filled-missing" | "default-evolved" | "artifact-synced" | "unchanged";
5
+ /** One reportable sync action. */
6
+ export interface SyncAction {
7
+ /** Config key the action applies to */
8
+ readonly key: string;
9
+ /** What happened */
10
+ readonly kind: SyncActionKind;
11
+ /** Human-readable detail (e.g. which artifact file was involved) */
12
+ readonly detail: string;
13
+ }
14
+ /** Result of one sync run. */
15
+ export interface SyncReport {
16
+ /** Actions taken (or planned, when dryRun) — excludes unchanged entries */
17
+ readonly actions: readonly SyncAction[];
18
+ /** Required keys that are missing and cannot be defaulted */
19
+ readonly missingRequired: readonly {
20
+ key: string;
21
+ setupHint: string;
22
+ }[];
23
+ /** True when the run was a dry run (nothing written) */
24
+ readonly dryRun: boolean;
25
+ }
26
+ /** Options for {@link runConfigSync}. */
27
+ export interface SyncOptions {
28
+ /** Report without writing anything */
29
+ readonly dryRun?: boolean;
30
+ }
31
+ /**
32
+ * Run one populate-and-sync pass over a project.
33
+ *
34
+ * Precedence per setting: existing config value → existing artifact value →
35
+ * built-in default. After population, every existing artifact file is
36
+ * rewritten from the (local-overlaid) config value.
37
+ * @param destDir - Absolute path to the project root
38
+ * @param options - Sync options
39
+ * @returns Report of every action taken (or planned, when dryRun)
40
+ */
41
+ export declare function runConfigSync(destDir: string, options?: SyncOptions): Promise<SyncReport>;
42
+ //# sourceMappingURL=config-sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-sync.d.ts","sourceRoot":"","sources":["../../src/sync/config-sync.ts"],"names":[],"mappings":"AAkCA,uEAAuE;AACvE,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAE7C,+DAA+D;AAC/D,MAAM,MAAM,cAAc,GACtB,mBAAmB,GACnB,mBAAmB,GACnB,gBAAgB,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,WAAW,CAAC;AAEhB,kCAAkC;AAClC,MAAM,WAAW,UAAU;IACzB,uCAAuC;IACvC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,oBAAoB;IACpB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,8BAA8B;AAC9B,MAAM,WAAW,UAAU;IACzB,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IACxC,6DAA6D;IAC7D,QAAQ,CAAC,eAAe,EAAE,SAAS;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxE,wDAAwD;IACxD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED,yCAAyC;AACzC,MAAM,WAAW,WAAW;IAC1B,sCAAsC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAsQD;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,UAAU,CAAC,CAoCrB"}