@codyswann/lisa 4.99.10 → 4.100.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 (147) hide show
  1. package/all/create-only/.lisa/DEPENDENCY_DECISIONS.md +10 -1
  2. package/dist/cli/ui-enabled-plugins.d.ts.map +1 -1
  3. package/dist/cli/ui-enabled-plugins.js +5 -29
  4. package/dist/cli/ui-enabled-plugins.js.map +1 -1
  5. package/dist/core/lisa.d.ts +17 -1
  6. package/dist/core/lisa.d.ts.map +1 -1
  7. package/dist/core/lisa.js +51 -4
  8. package/dist/core/lisa.js.map +1 -1
  9. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  10. package/dist/core/plugin-command.d.ts +14 -0
  11. package/dist/core/plugin-command.d.ts.map +1 -1
  12. package/dist/core/plugin-command.js +21 -3
  13. package/dist/core/plugin-command.js.map +1 -1
  14. package/dist/core/plugin-marketplace-filter.d.ts +36 -0
  15. package/dist/core/plugin-marketplace-filter.d.ts.map +1 -0
  16. package/dist/core/plugin-marketplace-filter.js +35 -0
  17. package/dist/core/plugin-marketplace-filter.js.map +1 -0
  18. package/dist/core/plugin-registration-prune.d.ts +31 -0
  19. package/dist/core/plugin-registration-prune.d.ts.map +1 -0
  20. package/dist/core/plugin-registration-prune.js +257 -0
  21. package/dist/core/plugin-registration-prune.js.map +1 -0
  22. package/dist/core/project-config-dependencies.d.ts +103 -0
  23. package/dist/core/project-config-dependencies.d.ts.map +1 -0
  24. package/dist/core/project-config-dependencies.js +118 -0
  25. package/dist/core/project-config-dependencies.js.map +1 -0
  26. package/dist/core/project-config.d.ts +8 -0
  27. package/dist/core/project-config.d.ts.map +1 -1
  28. package/dist/core/project-config.js +4 -0
  29. package/dist/core/project-config.js.map +1 -1
  30. package/dist/core/retired-plugin-keys.d.ts +24 -0
  31. package/dist/core/retired-plugin-keys.d.ts.map +1 -0
  32. package/dist/core/retired-plugin-keys.js +12 -0
  33. package/dist/core/retired-plugin-keys.js.map +1 -0
  34. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  35. package/dist/core/upstream-evidence-manifest.js +21 -6
  36. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  37. package/dist/migrations/index.d.ts +1 -0
  38. package/dist/migrations/index.d.ts.map +1 -1
  39. package/dist/migrations/index.js +4 -0
  40. package/dist/migrations/index.js.map +1 -1
  41. package/dist/migrations/prune-retired-claude-stack-plugin-keys.d.ts +33 -0
  42. package/dist/migrations/prune-retired-claude-stack-plugin-keys.d.ts.map +1 -0
  43. package/dist/migrations/prune-retired-claude-stack-plugin-keys.js +98 -0
  44. package/dist/migrations/prune-retired-claude-stack-plugin-keys.js.map +1 -0
  45. package/dist/utils/marketplace-manifest.d.ts +19 -0
  46. package/dist/utils/marketplace-manifest.d.ts.map +1 -0
  47. package/dist/utils/marketplace-manifest.js +59 -0
  48. package/dist/utils/marketplace-manifest.js.map +1 -0
  49. package/package.json +4 -4
  50. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  52. package/plugins/lisa/.codex-plugin/skills/lisa-task-decomposition/SKILL.md +6 -3
  53. package/plugins/lisa/hooks/inject-resolved-config.mjs +94 -0
  54. package/plugins/lisa/rules/reference/config-resolution.md +1 -0
  55. package/plugins/lisa/rules/reference/dependency-decision-records.md +7 -0
  56. package/plugins/lisa/rules/reference/dependency-trust-classes.md +39 -1
  57. package/plugins/lisa/skills/lisa-task-decomposition/SKILL.md +6 -3
  58. package/plugins/lisa-agy/plugin.json +1 -1
  59. package/plugins/lisa-agy/skills/lisa-task-decomposition/SKILL.md +6 -3
  60. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  62. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  63. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  67. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  68. package/plugins/lisa-copilot/hooks/inject-resolved-config.mjs +94 -0
  69. package/plugins/lisa-copilot/rules/reference/config-resolution.md +1 -0
  70. package/plugins/lisa-copilot/rules/reference/dependency-decision-records.md +7 -0
  71. package/plugins/lisa-copilot/rules/reference/dependency-trust-classes.md +39 -1
  72. package/plugins/lisa-copilot/skills/lisa-task-decomposition/SKILL.md +6 -3
  73. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-cursor/hooks/inject-resolved-config.mjs +94 -0
  75. package/plugins/lisa-cursor/rules/config-resolution-reference.mdc +1 -0
  76. package/plugins/lisa-cursor/rules/dependency-decision-records-reference.mdc +7 -0
  77. package/plugins/lisa-cursor/rules/dependency-trust-classes-reference.mdc +39 -1
  78. package/plugins/lisa-cursor/skills/lisa-task-decomposition/SKILL.md +6 -3
  79. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  81. package/plugins/lisa-devin/hooks/inject-resolved-config.mjs +94 -0
  82. package/plugins/lisa-devin/rules/reference/config-resolution.md +1 -0
  83. package/plugins/lisa-devin/rules/reference/dependency-decision-records.md +7 -0
  84. package/plugins/lisa-devin/rules/reference/dependency-trust-classes.md +39 -1
  85. package/plugins/lisa-devin/skills/lisa-task-decomposition/SKILL.md +6 -3
  86. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  87. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  88. package/plugins/lisa-expo-agy/plugin.json +1 -1
  89. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  90. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  91. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  92. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  93. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  95. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  96. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  97. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  98. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  99. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  100. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  101. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  102. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  103. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  104. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  105. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  106. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  107. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  108. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  109. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  110. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  111. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  112. package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
  113. package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
  114. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  115. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  116. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  117. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  118. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  119. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  120. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  121. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  122. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  123. package/plugins/lisa-rails-agy/plugin.json +1 -1
  124. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  125. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  126. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  127. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  128. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  129. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  130. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  131. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  132. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  133. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  134. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  135. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  136. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  137. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  138. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  139. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  140. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  141. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  142. package/plugins/src/base/hooks/inject-resolved-config.mjs +94 -0
  143. package/plugins/src/base/rules/reference/config-resolution.md +1 -0
  144. package/plugins/src/base/rules/reference/dependency-decision-records.md +7 -0
  145. package/plugins/src/base/rules/reference/dependency-trust-classes.md +39 -1
  146. package/plugins/src/base/skills/lisa-task-decomposition/SKILL.md +6 -3
  147. package/typescript/copy-contents/.husky/post-checkout +28 -0
@@ -2,10 +2,24 @@
2
2
  export declare const PLUGIN_PROBE_TIMEOUT_MS = 15000;
3
3
  /** Registration shares the normal reconciliation wait budget across commands. */
4
4
  export declare const PLUGIN_REGISTRATION_TIMEOUT_MS = 120000;
5
+ /**
6
+ * Budget for pruning dead-checkout registrations in one apply. A machine with a
7
+ * large backlog clears it over several applies instead of stalling one.
8
+ */
9
+ export declare const PLUGIN_PRUNE_TIMEOUT_MS = 30000;
10
+ /**
11
+ * Capture limit for `claude plugin list --json`. The registry lists every
12
+ * project-scope registration on the machine, and a long-lived workstation's
13
+ * list passes 2 MB — over the default limit, which made each list call fail
14
+ * and every caller fall back silently (#4645).
15
+ */
16
+ export declare const PLUGIN_LIST_MAX_CAPTURE_BYTES = 33554432;
5
17
  /** One command's working directory and remaining operation budget. */
6
18
  export interface PluginCommandOptions {
7
19
  readonly cwd: string;
8
20
  readonly timeoutMs: number;
21
+ /** Per-stream capture limit; defaults to Node exec's 1 MiB. */
22
+ readonly maxCaptureBytes?: number;
9
23
  }
10
24
  /**
11
25
  * Run the vendor CLI without a shell or input prompts, with a command deadline.
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-command.d.ts","sourceRoot":"","sources":["../../src/core/plugin-command.ts"],"names":[],"mappings":"AAGA,8CAA8C;AAC9C,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAC9C,iFAAiF;AACjF,eAAO,MAAM,8BAA8B,SAAU,CAAC;AAMtD,sEAAsE;AACtE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAwBD;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CA2EtC"}
1
+ {"version":3,"file":"plugin-command.d.ts","sourceRoot":"","sources":["../../src/core/plugin-command.ts"],"names":[],"mappings":"AAGA,8CAA8C;AAC9C,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAC9C,iFAAiF;AACjF,eAAO,MAAM,8BAA8B,SAAU,CAAC;AACtD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAK9C;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,WAAa,CAAC;AAExD,sEAAsE;AACtE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,+DAA+D;IAC/D,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CACnC;AAwBD;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAiFtC"}
@@ -4,10 +4,22 @@ import { spawn } from "node:child_process";
4
4
  export const PLUGIN_PROBE_TIMEOUT_MS = 15_000;
5
5
  /** Registration shares the normal reconciliation wait budget across commands. */
6
6
  export const PLUGIN_REGISTRATION_TIMEOUT_MS = 120_000;
7
+ /**
8
+ * Budget for pruning dead-checkout registrations in one apply. A machine with a
9
+ * large backlog clears it over several applies instead of stalling one.
10
+ */
11
+ export const PLUGIN_PRUNE_TIMEOUT_MS = 30_000;
7
12
  /** Grace period for the owned CLI group to finish after termination. */
8
13
  const TERMINATION_GRACE_MS = 2_000;
9
14
  /** Preserve Node exec's default per-stream capture limit. */
10
15
  const MAX_CAPTURE_BYTES = 1_048_576;
16
+ /**
17
+ * Capture limit for `claude plugin list --json`. The registry lists every
18
+ * project-scope registration on the machine, and a long-lived workstation's
19
+ * list passes 2 MB — over the default limit, which made each list call fail
20
+ * and every caller fall back silently (#4645).
21
+ */
22
+ export const PLUGIN_LIST_MAX_CAPTURE_BYTES = 33_554_432;
11
23
  /**
12
24
  * Preserve the command's failure before attempting final cleanup.
13
25
  * @param failure - Earlier stream or command error
@@ -35,6 +47,7 @@ export async function runPluginCommand(args, options) {
35
47
  if (!Number.isFinite(options.timeoutMs) || options.timeoutMs <= 0) {
36
48
  throw new Error("Plugin registration operation deadline reached");
37
49
  }
50
+ const maxCaptureBytes = options.maxCaptureBytes ?? MAX_CAPTURE_BYTES;
38
51
  return await new Promise((resolve, reject) => {
39
52
  const grouped = process.platform !== "win32";
40
53
  // The vendor CLI is user-installed; argv is never evaluated by a shell.
@@ -76,9 +89,14 @@ export async function runPluginCommand(args, options) {
76
89
  stdoutBytes += size;
77
90
  else
78
91
  stderrBytes += size;
79
- if (stdoutBytes > MAX_CAPTURE_BYTES || stderrBytes > MAX_CAPTURE_BYTES) {
80
- failure ??= new Error("Plugin command output exceeded capture limit");
81
- terminate();
92
+ if (stdoutBytes > maxCaptureBytes || stderrBytes > maxCaptureBytes) {
93
+ // Terminate once. Buffered chunks keep arriving after SIGTERM, and
94
+ // re-signalling a group whose leader has exited throws EPERM on macOS
95
+ // from inside this stream listener — an uncaught exception.
96
+ if (failure === undefined) {
97
+ failure = new Error("Plugin command output exceeded capture limit");
98
+ terminate();
99
+ }
82
100
  }
83
101
  else if (stream === "stdout" && failure === undefined) {
84
102
  stdout += chunk;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-command.js","sourceRoot":"","sources":["../../src/core/plugin-command.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,8CAA8C;AAC9C,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAC9C,iFAAiF;AACjF,MAAM,CAAC,MAAM,8BAA8B,GAAG,OAAO,CAAC;A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YACxB,YAAY,CAAC,QAAQ,CAAC,CAAC;YACvB,YAAY,CAAC,SAAS,CAAC,CAAC;YACxB,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE;YACvB,sEAAsE;YACtE,uEAAuE;YACvE,YAAY,CAAC,QAAQ,CAAC,CAAC;YACvB,YAAY,CAAC,SAAS,CAAC,CAAC;YACxB,MAAM,YAAY,GAAG,eAAe,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC9D,IAAI,CAAC;gBACH,MAAM,CAAC,SAAS,CAAC,CAAC;YACpB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,YAAY,IAAI,KAAK,CAAC,CAAC;gBAC9B,OAAO;YACT,CAAC;YACD,IAAI,YAAY,KAAK,SAAS;gBAAE,MAAM,CAAC,YAAY,CAAC,CAAC;;gBAChD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Decide which enabled plugin keys can be installed from the Lisa marketplace.
3
+ *
4
+ * A `<name>@lisa` key whose `<name>` the Lisa marketplace manifest does not
5
+ * list cannot be installed: the CLI fails it on every attempt, which warned on
6
+ * every `lisa apply` and kept the plugin sync from ever completing
7
+ * (CodySwannGT/lisa#4645). Such keys are skipped with one warning naming them,
8
+ * and the skip does not count as a failed install.
9
+ *
10
+ * Only `@lisa` keys are judged — another marketplace's keys are never skipped.
11
+ * When the manifest cannot be read, or names no plugin, nothing is skipped, so an unreadable
12
+ * manifest falls back to the previous install-everything behaviour rather
13
+ * than silently dropping real plugins.
14
+ * @module core/plugin-marketplace-filter
15
+ */
16
+ import type { MarketplaceCatalog } from "../utils/marketplace-manifest.js";
17
+ /** Enabled keys split into what to install and what to skip. */
18
+ export interface PluginMarketplacePartition {
19
+ readonly installable: readonly string[];
20
+ readonly skipped: readonly string[];
21
+ }
22
+ /**
23
+ * Split enabled plugin keys by whether the Lisa marketplace can supply them.
24
+ * @param plugins - Enabled plugin keys
25
+ * @param catalog - The Lisa marketplace catalog, or null when unreadable
26
+ * @returns Installable keys and skipped keys, each in input order
27
+ */
28
+ export declare function partitionByLisaMarketplace(plugins: readonly string[], catalog: MarketplaceCatalog | null): PluginMarketplacePartition;
29
+ /**
30
+ * The one warning line for a skipped key, naming its successor when it is a
31
+ * key Lisa itself retired.
32
+ * @param key - Skipped plugin key
33
+ * @returns Warning text
34
+ */
35
+ export declare function describeSkippedPluginKey(key: string): string;
36
+ //# sourceMappingURL=plugin-marketplace-filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-marketplace-filter.d.ts","sourceRoot":"","sources":["../../src/core/plugin-marketplace-filter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAK3E,gEAAgE;AAChE,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,OAAO,EAAE,kBAAkB,GAAG,IAAI,GACjC,0BAA0B,CAa5B;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAM5D"}
@@ -0,0 +1,35 @@
1
+ import { RETIRED_STACK_PLUGIN_KEYS } from "./retired-plugin-keys.js";
2
+ const LISA_SUFFIX = "@lisa";
3
+ /**
4
+ * Split enabled plugin keys by whether the Lisa marketplace can supply them.
5
+ * @param plugins - Enabled plugin keys
6
+ * @param catalog - The Lisa marketplace catalog, or null when unreadable
7
+ * @returns Installable keys and skipped keys, each in input order
8
+ */
9
+ export function partitionByLisaMarketplace(plugins, catalog) {
10
+ // A manifest that names no plugin is as untrustworthy as an unreadable one:
11
+ // skipping against it would drop every real Lisa plugin.
12
+ if (catalog === null || catalog.plugins.length === 0) {
13
+ return { installable: plugins, skipped: [] };
14
+ }
15
+ const known = new Set(catalog.plugins.map(plugin => plugin.name));
16
+ const isMissing = (key) => key.endsWith(LISA_SUFFIX) && !known.has(key.slice(0, -LISA_SUFFIX.length));
17
+ return {
18
+ installable: plugins.filter(key => !isMissing(key)),
19
+ skipped: plugins.filter(isMissing),
20
+ };
21
+ }
22
+ /**
23
+ * The one warning line for a skipped key, naming its successor when it is a
24
+ * key Lisa itself retired.
25
+ * @param key - Skipped plugin key
26
+ * @returns Warning text
27
+ */
28
+ export function describeSkippedPluginKey(key) {
29
+ const successor = RETIRED_STACK_PLUGIN_KEYS.get(key)?.successor;
30
+ const base = `Skipping plugin ${key}: not in the Lisa marketplace`;
31
+ return successor === undefined
32
+ ? base
33
+ : `${base} (retired; its successor is ${successor})`;
34
+ }
35
+ //# sourceMappingURL=plugin-marketplace-filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-marketplace-filter.js","sourceRoot":"","sources":["../../src/core/plugin-marketplace-filter.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,MAAM,WAAW,GAAG,OAAO,CAAC;AAQ5B;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAA0B,EAC1B,OAAkC;IAElC,4EAA4E;IAC5E,yDAAyD;IACzD,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/C,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAClE,MAAM,SAAS,GAAG,CAAC,GAAW,EAAW,EAAE,CACzC,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7E,OAAO;QACL,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACnD,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;KACnC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,GAAW;IAClD,MAAM,SAAS,GAAG,yBAAyB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC;IAChE,MAAM,IAAI,GAAG,mBAAmB,GAAG,+BAA+B,CAAC;IACnE,OAAO,SAAS,KAAK,SAAS;QAC5B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,GAAG,IAAI,+BAA+B,SAAS,GAAG,CAAC;AACzD,CAAC"}
@@ -0,0 +1,31 @@
1
+ /** Runs `claude <args>` in `cwd`; rejects when the command fails. */
2
+ export type ClaudeRunner = (args: readonly string[], cwd: string) => Promise<{
3
+ readonly stdout?: unknown;
4
+ }>;
5
+ /** Collaborators for {@link pruneDeadPluginRegistrations}. */
6
+ export interface PluginRegistrationPruneDeps {
7
+ readonly runClaude: ClaudeRunner;
8
+ /** True once the prune budget is spent; omitted means unbounded. */
9
+ readonly deadlineReached?: () => boolean;
10
+ readonly logger: {
11
+ readonly info: (message: string) => void;
12
+ readonly warn: (message: string) => void;
13
+ };
14
+ }
15
+ /** How many dead registrations were removed, and how many could not be. */
16
+ export interface PluginRegistrationPruneOutcome {
17
+ readonly pruned: number;
18
+ readonly failed: number;
19
+ /** Left for the next apply because the budget ran out. */
20
+ readonly deferred: number;
21
+ }
22
+ /**
23
+ * Uninstall Lisa's project-scope registrations whose checkout no longer
24
+ * exists. Everything runs sequentially: a dead path's directory exists only
25
+ * while its own uninstalls run.
26
+ * @param cwd - Directory to run `claude plugin list --json` from
27
+ * @param deps - CLI runner and logger
28
+ * @returns Counts of pruned, unprunable and deferred registrations
29
+ */
30
+ export declare function pruneDeadPluginRegistrations(cwd: string, deps: PluginRegistrationPruneDeps): Promise<PluginRegistrationPruneOutcome>;
31
+ //# sourceMappingURL=plugin-registration-prune.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-registration-prune.d.ts","sourceRoot":"","sources":["../../src/core/plugin-registration-prune.ts"],"names":[],"mappings":"AAyCA,qEAAqE;AACrE,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,EAAE,MAAM,KACR,OAAO,CAAC;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAE5C,8DAA8D;AAC9D,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC,oEAAoE;IACpE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE;QACf,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;QACzC,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;KAC1C,CAAC;CACH;AAED,2EAA2E;AAC3E,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAmPD;;;;;;;GAOG;AACH,wBAAsB,4BAA4B,CAChD,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,2BAA2B,GAChC,OAAO,CAAC,8BAA8B,CAAC,CA+BzC"}
@@ -0,0 +1,257 @@
1
+ /**
2
+ * Prune Claude Code project-scope registrations Lisa made for checkouts that
3
+ * no longer exist.
4
+ *
5
+ * Lisa registers its plugins with `claude plugin install <id> --scope
6
+ * project`, which records the checkout's path in Claude Code's plugin
7
+ * registry — once per checkout, so once per worktree. Nothing removed those
8
+ * records when a worktree was deleted, and they accumulated without bound
9
+ * (CodySwannGT/lisa#4645).
10
+ *
11
+ * The CLI's `uninstall` acts only on its working directory and has no path
12
+ * flag, so each dead path is recreated just long enough to run the uninstall
13
+ * from it, then only the directories this call created are removed again —
14
+ * and only while empty, so nothing the CLI might have written is deleted.
15
+ * `--keep-data` keeps the plugin's shared data directory, which live
16
+ * installations of the same plugin still use.
17
+ *
18
+ * Scope is deliberately narrow: `scope === "project"` entries whose id ends in
19
+ * `@lisa` and whose absolute `projectPath` is missing on disk. Other vendors'
20
+ * plugins, user/local scopes, and paths that exist are never touched. Any
21
+ * failure is reported with the command to run by hand; it never fails the
22
+ * apply. "Missing" includes a checkout on a volume that is not mounted right
23
+ * now; its registrations are pruned, and the next apply run there registers
24
+ * them again.
25
+ *
26
+ * The prune runs on a budget. Once {@link PluginRegistrationPruneDeps}'s
27
+ * `deadlineReached` says it is spent, no further uninstall starts, and what is
28
+ * left is reported as deferred to the next apply — never as a failure.
29
+ *
30
+ * Agent parity: only Claude Code keeps per-path plugin registrations. The
31
+ * Codex, Cursor, OpenCode, Antigravity, Copilot and Devin installers write
32
+ * project-local files and record no registry entry per checkout, so there is
33
+ * nothing equivalent to prune on those agents.
34
+ * @module core/plugin-registration-prune
35
+ */
36
+ import { existsSync, mkdirSync, readdirSync, rmdirSync } from "node:fs";
37
+ import * as path from "node:path";
38
+ const LISA_SUFFIX = "@lisa";
39
+ const MAX_REPORTED_COMMANDS = 3;
40
+ /**
41
+ * Whether a registry entry is a Lisa project-scope registration for a path
42
+ * that no longer exists.
43
+ * @param entry - Raw `claude plugin list --json` entry
44
+ * @returns The entry's id and path when dead, else null
45
+ */
46
+ function asDeadLisaRegistration(entry) {
47
+ if (typeof entry !== "object" || entry === null)
48
+ return null;
49
+ const id = Reflect.get(entry, "id");
50
+ const scope = Reflect.get(entry, "scope");
51
+ const projectPath = Reflect.get(entry, "projectPath");
52
+ const isDead = scope === "project" &&
53
+ typeof id === "string" &&
54
+ id.endsWith(LISA_SUFFIX) &&
55
+ typeof projectPath === "string" &&
56
+ path.isAbsolute(projectPath) &&
57
+ !existsSync(projectPath);
58
+ return isDead ? { id, projectPath } : null;
59
+ }
60
+ /**
61
+ * Group dead Lisa registrations by path, de-duplicating ids.
62
+ * @param stdout - `claude plugin list --json` output
63
+ * @returns Dead paths with their ids, or null when unparseable
64
+ */
65
+ function findDeadPaths(stdout) {
66
+ try {
67
+ const parsed = JSON.parse(String(stdout ?? ""));
68
+ if (!Array.isArray(parsed))
69
+ return null;
70
+ const dead = parsed
71
+ .map(asDeadLisaRegistration)
72
+ .filter(registration => registration !== null);
73
+ const paths = [...new Set(dead.map(entry => entry.projectPath))];
74
+ return paths.map(projectPath => ({
75
+ projectPath,
76
+ ids: [
77
+ ...new Set(dead
78
+ .filter(entry => entry.projectPath === projectPath)
79
+ .map(entry => entry.id)),
80
+ ],
81
+ }));
82
+ }
83
+ catch {
84
+ return null;
85
+ }
86
+ }
87
+ /**
88
+ * The command an operator runs by hand to remove one registration.
89
+ * @param projectPath - Dead checkout path
90
+ * @param id - Plugin id
91
+ * @returns Shell command line
92
+ */
93
+ function manualCommand(projectPath, id) {
94
+ const quoted = shellQuote(projectPath);
95
+ return `mkdir -p ${quoted} && cd ${quoted} && claude plugin uninstall ${shellQuote(id)} --scope project --keep-data`;
96
+ }
97
+ /** A single quote as written inside a POSIX single-quoted string. */
98
+ const ESCAPED_QUOTE = String.raw `'\''`;
99
+ /**
100
+ * Single-quote a value for POSIX sh, so a printed recovery command stays
101
+ * copy-pasteable when a registry path contains a quote.
102
+ * @param value - Raw value
103
+ * @returns The value wrapped in single quotes with embedded quotes escaped
104
+ */
105
+ function shellQuote(value) {
106
+ const escaped = value.replaceAll("'", ESCAPED_QUOTE);
107
+ return `'${escaped}'`;
108
+ }
109
+ /**
110
+ * The directories from `dir` up to and including `top`, deepest first.
111
+ * @param dir - Starting directory (inside `top`)
112
+ * @param top - Topmost directory to include
113
+ * @returns The chain, or an empty list when `dir` is not inside `top`
114
+ */
115
+ function directoriesUpTo(dir, top) {
116
+ if (dir === top)
117
+ return [dir];
118
+ if (!dir.startsWith(top + path.sep))
119
+ return [];
120
+ return [dir, ...directoriesUpTo(path.dirname(dir), top)];
121
+ }
122
+ /**
123
+ * Remove the directories this prune created, deepest first, stopping at the
124
+ * first one that is not empty.
125
+ * @param projectPath - The recreated dead path
126
+ * @param firstCreated - Topmost directory `mkdirSync` created
127
+ * @returns True when every created directory was removed; false when one was
128
+ * not empty or could not be removed (never throws)
129
+ */
130
+ function removeCreatedDirectories(projectPath, firstCreated) {
131
+ try {
132
+ for (const dir of directoriesUpTo(projectPath, firstCreated)) {
133
+ if (readdirSync(dir).length > 0)
134
+ return false;
135
+ rmdirSync(dir);
136
+ }
137
+ return true;
138
+ }
139
+ catch {
140
+ return false;
141
+ }
142
+ }
143
+ /**
144
+ * Recreate a dead path, returning the topmost directory created.
145
+ * @param projectPath - Dead checkout path
146
+ * @returns The first directory created, or null when nothing could be created
147
+ */
148
+ function recreate(projectPath) {
149
+ try {
150
+ return mkdirSync(projectPath, { recursive: true }) ?? null;
151
+ }
152
+ catch {
153
+ return null;
154
+ }
155
+ }
156
+ /**
157
+ * Uninstall one id from its dead path, unless the budget is already spent.
158
+ * @param dead - Dead path the uninstall runs from
159
+ * @param id - Plugin id
160
+ * @param deps - Collaborators
161
+ * @returns What happened to this registration
162
+ */
163
+ async function uninstallOne(dead, id, deps) {
164
+ if (deps.deadlineReached?.() === true)
165
+ return "deferred";
166
+ return await deps
167
+ .runClaude(["plugin", "uninstall", id, "--scope", "project", "--keep-data"], dead.projectPath)
168
+ .then(() => "pruned", () => "failed");
169
+ }
170
+ /**
171
+ * Uninstall every Lisa id registered for one dead path, from that path.
172
+ * @param dead - Dead path and its ids
173
+ * @param deps - Collaborators
174
+ * @returns Pruned and deferred counts, and manual commands for failures
175
+ */
176
+ async function pruneDeadPath(dead, deps) {
177
+ const firstCreated = recreate(dead.projectPath);
178
+ if (firstCreated === null) {
179
+ return {
180
+ pruned: 0,
181
+ deferred: 0,
182
+ failedCommands: dead.ids.map(id => manualCommand(dead.projectPath, id)),
183
+ };
184
+ }
185
+ const results = await dead.ids.reduce(async (previous, id) => [
186
+ ...(await previous),
187
+ [id, await uninstallOne(dead, id, deps)],
188
+ ], Promise.resolve([]));
189
+ if (!removeCreatedDirectories(dead.projectPath, firstCreated)) {
190
+ deps.logger.warn(`Left ${firstCreated} in place: it could not be removed after pruning (not empty or not removable)`);
191
+ }
192
+ const count = (kind) => results.filter(([, result]) => result === kind).length;
193
+ return {
194
+ pruned: count("pruned"),
195
+ deferred: count("deferred"),
196
+ failedCommands: results
197
+ .filter(([, result]) => result === "failed")
198
+ .map(([id]) => manualCommand(dead.projectPath, id)),
199
+ };
200
+ }
201
+ /**
202
+ * Report what the prune did.
203
+ * @param outcome - Pruned, failed and deferred counts
204
+ * @param failedCommands - Manual commands for those left behind
205
+ * @param deps - Collaborators
206
+ */
207
+ function report(outcome, failedCommands, deps) {
208
+ const noun = (count) => count === 1 ? "registration" : "registrations";
209
+ const { pruned, deferred } = outcome;
210
+ if (pruned > 0) {
211
+ deps.logger.info(`Pruned ${pruned} Lisa plugin ${noun(pruned)} for deleted checkouts`);
212
+ }
213
+ if (deferred > 0) {
214
+ deps.logger.info(`Deferred ${deferred} Lisa plugin ${noun(deferred)} for deleted checkouts to the next apply (prune budget spent)`);
215
+ }
216
+ if (failedCommands.length > 0) {
217
+ const examples = failedCommands
218
+ .slice(0, MAX_REPORTED_COMMANDS)
219
+ .join("\n ");
220
+ deps.logger.warn(`Could not prune ${failedCommands.length} Lisa plugin ${noun(failedCommands.length)} for deleted checkouts; remove them by hand, e.g.:\n ${examples}`);
221
+ }
222
+ }
223
+ /**
224
+ * Uninstall Lisa's project-scope registrations whose checkout no longer
225
+ * exists. Everything runs sequentially: a dead path's directory exists only
226
+ * while its own uninstalls run.
227
+ * @param cwd - Directory to run `claude plugin list --json` from
228
+ * @param deps - CLI runner and logger
229
+ * @returns Counts of pruned, unprunable and deferred registrations
230
+ */
231
+ export async function pruneDeadPluginRegistrations(cwd, deps) {
232
+ const listed = await deps
233
+ .runClaude(["plugin", "list", "--json"], cwd)
234
+ .then(result => findDeadPaths(result.stdout))
235
+ .catch(() => null);
236
+ if (listed === null) {
237
+ deps.logger.warn("Could not read the Claude plugin registry (`claude plugin list --json`); skipped pruning registrations for deleted checkouts");
238
+ return { pruned: 0, failed: 0, deferred: 0 };
239
+ }
240
+ const outcomes = await listed.reduce(async (previous, dead) => {
241
+ const done = await previous;
242
+ // Stop starting new paths once the budget is spent (no mkdir either).
243
+ const outcome = deps.deadlineReached?.() === true
244
+ ? { pruned: 0, failedCommands: [], deferred: dead.ids.length }
245
+ : await pruneDeadPath(dead, deps);
246
+ return [...done, outcome];
247
+ }, Promise.resolve([]));
248
+ const failedCommands = outcomes.flatMap(outcome => outcome.failedCommands);
249
+ const result = {
250
+ pruned: outcomes.reduce((sum, outcome) => sum + outcome.pruned, 0),
251
+ failed: failedCommands.length,
252
+ deferred: outcomes.reduce((sum, outcome) => sum + outcome.deferred, 0),
253
+ };
254
+ report(result, failedCommands, deps);
255
+ return result;
256
+ }
257
+ //# sourceMappingURL=plugin-registration-prune.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-registration-prune.js","sourceRoot":"","sources":["../../src/core/plugin-registration-prune.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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Q,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;KACvE,CAAC;IACF,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IACrC,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * The `.lisa.config.json` `dependencies` block: whether dependency decisions
3
+ * ever wait on a person (CodySwannGT/lisa#4651).
4
+ *
5
+ * `dependency-trust-classes` requires human ratification for some classes —
6
+ * a runtime-critical service client to be added or major-upgraded, a thin
7
+ * wrapper to be kept, a temporary dependency to be extended. A project whose
8
+ * owner has decided no dependency should ever need a person's approval had no
9
+ * way to say so, and an autonomous build loop stopped for sign-off at every new
10
+ * vendor SDK. `humanSignOff: "none"` is that switch; omitting it keeps today's
11
+ * behavior, so no existing project changes.
12
+ *
13
+ * ## Why an invalid value degrades instead of throwing
14
+ *
15
+ * Every other closed config value in Lisa is rejected outright. This one is
16
+ * not, because it changes only what governed prose asks an agent to do —
17
+ * nothing Lisa writes depends on it — so a typo must not stop `lisa apply`.
18
+ * Degrading to `"default"` is the safe direction: the project keeps asking for
19
+ * sign-off it may not have wanted, rather than skipping sign-off it did. It is
20
+ * still REPORTED ({@link dependencySettingsWarning}, and an `INVALID` note in
21
+ * the session's resolved-config block), because a project that meant `"none"`
22
+ * and silently got `"default"` would otherwise see no symptom at all.
23
+ *
24
+ * The same holds for the block's SHAPE. A `dependencies` value that is not an
25
+ * object degrades to `"default"` and is reported too, rather than throwing like
26
+ * other config blocks do: a project that already carried any-shaped
27
+ * `dependencies` key before this setting existed must not find `lisa apply`
28
+ * broken by an upgrade, and the session hook already reports that shape as
29
+ * "treated as default" — the CLI must not disagree with it.
30
+ *
31
+ * The resolved-config session hook keeps its own copy of the vocabulary — it
32
+ * ships inside a plugin payload and cannot import this module — and its
33
+ * wiring test pins that copy against {@link DEPENDENCY_HUMAN_SIGN_OFF_VALUES}.
34
+ * @module core/project-config-dependencies
35
+ */
36
+ /** The closed vocabulary of `dependencies.humanSignOff`. */
37
+ export declare const DEPENDENCY_HUMAN_SIGN_OFF_VALUES: readonly ["default", "none"];
38
+ /** One accepted value of `dependencies.humanSignOff`. */
39
+ export type DependencyHumanSignOff = (typeof DEPENDENCY_HUMAN_SIGN_OFF_VALUES)[number];
40
+ /** Value in force when the key is absent or invalid: today's behavior. */
41
+ export declare const DEFAULT_DEPENDENCY_HUMAN_SIGN_OFF: DependencyHumanSignOff;
42
+ /**
43
+ * The optional `dependencies` block, as declared.
44
+ *
45
+ * `humanSignOff` is kept exactly as the file spelled it — possibly invalid —
46
+ * so the resolver, not the reader, decides validity and can report the
47
+ * rejected value. Unknown sibling keys are ignored rather than rejected, for
48
+ * the same reason an invalid value is not fatal.
49
+ */
50
+ export interface DependenciesConfig {
51
+ /** Raw declared value; resolve with {@link resolveDependencySettings}. */
52
+ readonly humanSignOff?: unknown;
53
+ /**
54
+ * The raw `dependencies` value when it was not an object. Present only then;
55
+ * the resolver reports it and falls back to the default.
56
+ */
57
+ readonly rejectedBlock?: unknown;
58
+ }
59
+ /** Minimum project-config shape the resolver reads. */
60
+ interface ConfigWithDependencies {
61
+ readonly dependencies?: DependenciesConfig;
62
+ }
63
+ /** Effective dependency settings derived from one config snapshot. */
64
+ export type ResolvedDependencySettings = Readonly<{
65
+ /** The value in force. */
66
+ humanSignOff: DependencyHumanSignOff;
67
+ /** Whether the project declared the key at all, valid or not. */
68
+ declared: boolean;
69
+ /** JSON spelling of a declared value that was rejected, when one was. */
70
+ rejected?: string;
71
+ /**
72
+ * Set to `"dependencies"` when the rejected value was the whole block (not an
73
+ * object) rather than `humanSignOff` itself.
74
+ */
75
+ rejectedAt?: "dependencies";
76
+ }>;
77
+ /**
78
+ * Validate the optional `dependencies` block.
79
+ *
80
+ * Never throws. A bad `humanSignOff` value is carried through as declared, and
81
+ * a block that is not an object is carried as `rejectedBlock`; the resolver
82
+ * reports either and resolves it to the default (see the module preamble).
83
+ * @param value - Raw `dependencies` value
84
+ * @param _source - Config source; kept for parity with the other block
85
+ * validators, unused because nothing here throws
86
+ * @returns The block, or undefined when absent
87
+ */
88
+ export declare function validateDependenciesConfig(value: unknown, _source: string): DependenciesConfig | undefined;
89
+ /**
90
+ * Resolve the effective `dependencies.humanSignOff`.
91
+ * @param config - Validated project config snapshot
92
+ * @returns The value in force, whether it was declared, and any rejected value
93
+ */
94
+ export declare function resolveDependencySettings(config: ConfigWithDependencies): ResolvedDependencySettings;
95
+ /**
96
+ * The warning to print for an invalid `dependencies.humanSignOff`, or for a
97
+ * `dependencies` block that is not an object.
98
+ * @param config - Validated project config snapshot
99
+ * @returns One warning line, or undefined when the value is absent or valid
100
+ */
101
+ export declare function dependencySettingsWarning(config: ConfigWithDependencies): string | undefined;
102
+ export {};
103
+ //# sourceMappingURL=project-config-dependencies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-config-dependencies.d.ts","sourceRoot":"","sources":["../../src/core/project-config-dependencies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,4DAA4D;AAC5D,eAAO,MAAM,gCAAgC,8BAA+B,CAAC;AAE7E,yDAAyD;AACzD,MAAM,MAAM,sBAAsB,GAChC,CAAC,OAAO,gCAAgC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpD,0EAA0E;AAC1E,eAAO,MAAM,iCAAiC,EAAE,sBACrC,CAAC;AAEZ;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,uDAAuD;AACvD,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,YAAY,CAAC,EAAE,kBAAkB,CAAC;CAC5C;AAED,sEAAsE;AACtE,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC;IAChD,0BAA0B;IAC1B,YAAY,EAAE,sBAAsB,CAAC;IACrC,iEAAiE;IACjE,QAAQ,EAAE,OAAO,CAAC;IAClB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B,CAAC,CAAC;AAEH;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,GACd,kBAAkB,GAAG,SAAS,CAShC;AAaD;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,sBAAsB,GAC7B,0BAA0B,CAyB5B;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,sBAAsB,GAC7B,MAAM,GAAG,SAAS,CAapB"}