@codyswann/lisa 2.341.6 → 2.342.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/apply.d.ts.map +1 -1
- package/dist/cli/apply.js +34 -4
- package/dist/cli/apply.js.map +1 -1
- package/dist/cli/shared-options.d.ts +9 -1
- package/dist/cli/shared-options.d.ts.map +1 -1
- package/dist/cli/shared-options.js +22 -0
- package/dist/cli/shared-options.js.map +1 -1
- package/dist/core/config.d.ts +49 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +33 -0
- package/dist/core/config.js.map +1 -1
- package/dist/core/lisa.d.ts +17 -0
- package/dist/core/lisa.d.ts.map +1 -1
- package/dist/core/lisa.js +42 -0
- package/dist/core/lisa.js.map +1 -1
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +2 -0
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/strategies/copy-contents.d.ts.map +1 -1
- package/dist/strategies/copy-contents.js +3 -1
- package/dist/strategies/copy-contents.js.map +1 -1
- package/dist/strategies/copy-overwrite.d.ts +16 -0
- package/dist/strategies/copy-overwrite.d.ts.map +1 -1
- package/dist/strategies/copy-overwrite.js +41 -1
- package/dist/strategies/copy-overwrite.js.map +1 -1
- package/package.json +1 -1
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
package/dist/cli/apply.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/cli/apply.ts"],"names":[],"mappings":"AAiBA,OAAO,
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/cli/apply.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,qBAAqB,CAAC;AA+J7B;;;;;;;;;;GAUG;AACH,wBAAsB,QAAQ,CAC5B,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,IAAI,CAAC,CAqEf"}
|
package/dist/cli/apply.js
CHANGED
|
@@ -7,7 +7,7 @@ import { detectLegacyHarnessMigration, projectConfigExists, readProjectConfig, r
|
|
|
7
7
|
import { ConsoleLogger } from "../logging/index.js";
|
|
8
8
|
import { toAbsolutePath } from "../utils/path-utils.js";
|
|
9
9
|
import { nudgeCrossPollinate } from "./cross-pollinate-nudge.js";
|
|
10
|
-
import { createDependencies } from "./shared-options.js";
|
|
10
|
+
import { createDependencies, parseRefreshTemplates, } from "./shared-options.js";
|
|
11
11
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
12
12
|
/**
|
|
13
13
|
* Get Lisa directory (where configs are stored)
|
|
@@ -30,6 +30,11 @@ function printUsageAndExit() {
|
|
|
30
30
|
console.log(" -y, --yes Non-interactive mode (auto-accept defaults, overwrite on conflict)");
|
|
31
31
|
console.log(" -v, --validate Validate project compatibility without applying changes");
|
|
32
32
|
console.log(" --skip-git-check Skip dirty git working directory check (for postinstall use)");
|
|
33
|
+
console.log(" --refresh-templates [paths]");
|
|
34
|
+
console.log(" Let a non-interactive apply replace managed files it would");
|
|
35
|
+
console.log(" otherwise report as out of date. Optionally scope to a");
|
|
36
|
+
console.log(" comma-separated path list, e.g.");
|
|
37
|
+
console.log(" --refresh-templates=scripts/lisa-hooks. Backs up first.");
|
|
33
38
|
console.log(" --no-update-check Skip the npm latest-version check");
|
|
34
39
|
console.log(` --harness <h> Target harness for emitted artifacts: ${ACCEPTED_HARNESS_INPUTS.join(" | ")} (persisted in .lisa.config.json)`);
|
|
35
40
|
console.log(" -h, --help Show this help message");
|
|
@@ -79,6 +84,30 @@ async function migrateLegacyHarnessIfNeeded(destDir, logger) {
|
|
|
79
84
|
await writeProjectConfig(destDir, { harness: migration.to });
|
|
80
85
|
logger.info(`Migrated legacy harness "${migration.from}" to "${migration.to}" in .lisa.config.json`);
|
|
81
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Assemble the apply config.
|
|
89
|
+
*
|
|
90
|
+
* Split out so the optional `refreshTemplates` key can be omitted entirely
|
|
91
|
+
* rather than set to undefined — `exactOptionalPropertyTypes` distinguishes
|
|
92
|
+
* the two — without that conditional counting against `runApply`.
|
|
93
|
+
* @param parts - Resolved settings for this invocation
|
|
94
|
+
* @param parts.destDir - Project directory being applied to
|
|
95
|
+
* @param parts.dryRun - Whether to report without writing
|
|
96
|
+
* @param parts.yesMode - Whether prompts auto-accept
|
|
97
|
+
* @param parts.validateOnly - Whether to validate instead of apply
|
|
98
|
+
* @param parts.skipGitCheck - Whether the dirty-tree prompt is skipped
|
|
99
|
+
* @param parts.refreshTemplates - Opted-in managed files, if any
|
|
100
|
+
* @param parts.harness - Target harness for emitted artifacts
|
|
101
|
+
* @returns The config to hand to Lisa
|
|
102
|
+
*/
|
|
103
|
+
function buildApplyConfig(parts) {
|
|
104
|
+
const { refreshTemplates, ...rest } = parts;
|
|
105
|
+
return {
|
|
106
|
+
lisaDir: getLisaDir(),
|
|
107
|
+
...rest,
|
|
108
|
+
...(refreshTemplates === undefined ? {} : { refreshTemplates }),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
82
111
|
/**
|
|
83
112
|
* Apply Lisa to the given destination with the given options.
|
|
84
113
|
*
|
|
@@ -105,15 +134,16 @@ export async function runApply(destination, options) {
|
|
|
105
134
|
const projectConfig = await readProjectConfig(destDir);
|
|
106
135
|
const configFileExists = await projectConfigExists(destDir);
|
|
107
136
|
const harness = resolveHarness(options.harness, projectConfig);
|
|
108
|
-
const
|
|
109
|
-
|
|
137
|
+
const refreshTemplates = parseRefreshTemplates(options.refreshTemplates);
|
|
138
|
+
const config = buildApplyConfig({
|
|
110
139
|
destDir,
|
|
111
140
|
dryRun,
|
|
112
141
|
yesMode,
|
|
113
142
|
validateOnly,
|
|
114
143
|
skipGitCheck: options.skipGitCheck ?? false,
|
|
144
|
+
refreshTemplates,
|
|
115
145
|
harness,
|
|
116
|
-
};
|
|
146
|
+
});
|
|
117
147
|
const deps = createDependencies(dryRun, yesMode, logger);
|
|
118
148
|
const lisa = new Lisa(config, deps);
|
|
119
149
|
try {
|
package/dist/cli/apply.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../src/cli/apply.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,mB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,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Command } from "commander";
|
|
2
|
-
import type { Harness } from "../core/config.js";
|
|
2
|
+
import type { Harness, RefreshTemplates } from "../core/config.js";
|
|
3
3
|
import type { LisaDependencies } from "../core/lisa.js";
|
|
4
4
|
import type { ConsoleLogger } from "../logging/index.js";
|
|
5
5
|
/**
|
|
@@ -11,8 +11,16 @@ export interface CLIOptions {
|
|
|
11
11
|
yes?: boolean;
|
|
12
12
|
validate?: boolean;
|
|
13
13
|
skipGitCheck?: boolean;
|
|
14
|
+
/** Bare `--refresh-templates` yields true; with a value, the raw path list. */
|
|
15
|
+
refreshTemplates?: boolean | string;
|
|
14
16
|
harness?: Harness;
|
|
15
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Resolve `--refresh-templates` into the selection the strategies consume.
|
|
20
|
+
* @param value - Raw commander value: absent, true, or a comma-separated list
|
|
21
|
+
* @returns The selection, or undefined when the flag was not passed
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseRefreshTemplates(value: boolean | string | undefined): RefreshTemplates | undefined;
|
|
16
24
|
/**
|
|
17
25
|
* Validate the --harness CLI argument. Commander invokes this with the raw
|
|
18
26
|
* user-supplied string and expects either the parsed value or a thrown
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-options.d.ts","sourceRoot":"","sources":["../../src/cli/shared-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAwB,MAAM,WAAW,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"shared-options.d.ts","sourceRoot":"","sources":["../../src/cli/shared-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAwB,MAAM,WAAW,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAOzD;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,GAClC,gBAAgB,GAAG,SAAS,CAW9B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAStD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CA0B1D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,aAAa,GACpB,gBAAgB,CAYlB"}
|
|
@@ -7,6 +7,25 @@ import { normalizeHarness } from "../core/project-config.js";
|
|
|
7
7
|
import { StrategyRegistry } from "../strategies/index.js";
|
|
8
8
|
import { BackupService, DryRunBackupService } from "../transaction/index.js";
|
|
9
9
|
import { createPrompter } from "./prompts.js";
|
|
10
|
+
/**
|
|
11
|
+
* Resolve `--refresh-templates` into the selection the strategies consume.
|
|
12
|
+
* @param value - Raw commander value: absent, true, or a comma-separated list
|
|
13
|
+
* @returns The selection, or undefined when the flag was not passed
|
|
14
|
+
*/
|
|
15
|
+
export function parseRefreshTemplates(value) {
|
|
16
|
+
if (value === undefined || value === false)
|
|
17
|
+
return undefined;
|
|
18
|
+
if (value === true)
|
|
19
|
+
return { mode: "all" };
|
|
20
|
+
const paths = value
|
|
21
|
+
.split(",")
|
|
22
|
+
.map(entry => entry.trim())
|
|
23
|
+
.filter(entry => entry.length > 0);
|
|
24
|
+
// `--refresh-templates=` with nothing after it reads as "refresh nothing",
|
|
25
|
+
// which is a footgun either way. Treat it as the bare flag rather than
|
|
26
|
+
// silently matching no path.
|
|
27
|
+
return paths.length > 0 ? { mode: "paths", paths } : { mode: "all" };
|
|
28
|
+
}
|
|
10
29
|
/**
|
|
11
30
|
* Validate the --harness CLI argument. Commander invokes this with the raw
|
|
12
31
|
* user-supplied string and expects either the parsed value or a thrown
|
|
@@ -34,6 +53,9 @@ export function addSharedOptions(command) {
|
|
|
34
53
|
.option("-y, --yes", "Non-interactive mode (auto-accept defaults, overwrite on conflict)")
|
|
35
54
|
.option("-v, --validate", "Validate project compatibility without applying changes")
|
|
36
55
|
.option("--skip-git-check", "Skip dirty git working directory check (for postinstall use)")
|
|
56
|
+
.option("--refresh-templates [paths]", "Let a non-interactive apply replace managed files it would otherwise report as out of date. " +
|
|
57
|
+
"Optionally scope to a comma-separated list of repo-relative paths " +
|
|
58
|
+
"(e.g. --refresh-templates=scripts/lisa-hooks). Backs up before replacing.")
|
|
37
59
|
.option("--harness <harness>", `Target harness for emitted artifacts: ${ACCEPTED_HARNESS_INPUTS.join(" | ")} (default: claude, or value from .lisa.config.json)`, parseHarnessArg);
|
|
38
60
|
}
|
|
39
61
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-options.js","sourceRoot":"","sources":["../../src/cli/shared-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAE/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,gBA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,EAAE,cAAc,CAAC,OAAO,CAAC;QACjC,aAAa,EAAE,MAAM;YACnB,CAAC,CAAC,IAAI,mBAAmB,EAAE;YAC3B,CAAC,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC;QAC7B,gBAAgB,EAAE,IAAI,gBAAgB,EAAE;QACxC,gBAAgB,EAAE,IAAI,gBAAgB,EAAE;QACxC,UAAU,EAAE,IAAI,UAAU,EAAE;QAC5B,iBAAiB,EAAE,IAAI,iBAAiB,EAAE;KAC3C,CAAC;AACJ,CAAC"}
|
package/dist/core/config.d.ts
CHANGED
|
@@ -99,9 +99,45 @@ export interface LisaConfig {
|
|
|
99
99
|
readonly validateOnly: boolean;
|
|
100
100
|
/** If true, skip the dirty git working directory check (for postinstall use) */
|
|
101
101
|
readonly skipGitCheck: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Opt-in permission for a non-interactive apply to replace managed files it
|
|
104
|
+
* would otherwise only report as `stale`.
|
|
105
|
+
*
|
|
106
|
+
* Undefined — the default — keeps the conservative behaviour: a
|
|
107
|
+
* non-interactive apply never replaces a file the project may have
|
|
108
|
+
* customised. Set only when the operator has decided to take upstream's
|
|
109
|
+
* version, which is the supported way to deliver a changed enforcement guard
|
|
110
|
+
* without hand-deleting it first.
|
|
111
|
+
*/
|
|
112
|
+
readonly refreshTemplates?: RefreshTemplates;
|
|
102
113
|
/** Target harness(es) for emitted artifacts (e.g. claude | codex | fleet) */
|
|
103
114
|
readonly harness: Harness;
|
|
104
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Which managed files a non-interactive apply may refresh.
|
|
118
|
+
*
|
|
119
|
+
* Scoping exists because the blunt form is genuinely dangerous: the managed set
|
|
120
|
+
* includes files projects legitimately customise (`tsconfig.json`, `knip.json`,
|
|
121
|
+
* `eslint.config.ts`). Refreshing only `scripts/lisa-hooks` to take a security
|
|
122
|
+
* fix should not cost a project its build config.
|
|
123
|
+
*/
|
|
124
|
+
export type RefreshTemplates =
|
|
125
|
+
/** Every stale managed file. */
|
|
126
|
+
{
|
|
127
|
+
readonly mode: "all";
|
|
128
|
+
}
|
|
129
|
+
/** Only files at, or beneath, these repo-relative paths. */
|
|
130
|
+
| {
|
|
131
|
+
readonly mode: "paths";
|
|
132
|
+
readonly paths: readonly string[];
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Whether a non-interactive apply may replace this managed file.
|
|
136
|
+
* @param relativePath - Repo-relative path of the managed file
|
|
137
|
+
* @param refresh - The resolved --refresh-templates selection, if any
|
|
138
|
+
* @returns True when the operator opted this path in
|
|
139
|
+
*/
|
|
140
|
+
export declare function mayRefreshTemplate(relativePath: string, refresh: RefreshTemplates | undefined): boolean;
|
|
105
141
|
/**
|
|
106
142
|
* Operation mode for Lisa execution
|
|
107
143
|
*/
|
|
@@ -112,7 +148,17 @@ export type OperationMode = "apply" | "validate";
|
|
|
112
148
|
export interface FileOperationResult {
|
|
113
149
|
readonly relativePath: string;
|
|
114
150
|
readonly strategy: CopyStrategy;
|
|
115
|
-
readonly action: "copied" | "skipped"
|
|
151
|
+
readonly action: "copied" | "skipped"
|
|
152
|
+
/**
|
|
153
|
+
* The managed template differs from the installed file and this apply
|
|
154
|
+
* could not update it, because a non-interactive apply cannot prompt
|
|
155
|
+
* before replacing a file a project may have customised.
|
|
156
|
+
*
|
|
157
|
+
* Distinct from "skipped" on purpose. Folding the two together is what
|
|
158
|
+
* let template changes — including fixes to the enforcement guards —
|
|
159
|
+
* go undelivered while the summary read exactly like a clean no-op.
|
|
160
|
+
*/
|
|
161
|
+
| "stale" | "overwritten" | "appended" | "merged" | "created";
|
|
116
162
|
readonly linesAdded?: number;
|
|
117
163
|
}
|
|
118
164
|
/**
|
|
@@ -121,6 +167,8 @@ export interface FileOperationResult {
|
|
|
121
167
|
export interface OperationCounters {
|
|
122
168
|
copied: number;
|
|
123
169
|
skipped: number;
|
|
170
|
+
/** Managed files left out of date because this apply could not overwrite them. */
|
|
171
|
+
stale: number;
|
|
124
172
|
overwritten: number;
|
|
125
173
|
appended: number;
|
|
126
174
|
merged: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,gBAAgB,GAChB,eAAe,GACf,aAAa,GACb,OAAO,GACP,cAAc,GACd,cAAc,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,YAAY,GACZ,MAAM,GACN,QAAQ,GACR,KAAK,GACL,eAAe,GACf,QAAQ,GACR,aAAa,GACb,OAAO,CAAC;AAEZ;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAC3C,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC,CAU/B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,WAAW,EAS3C,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,YAAY,EAOzC,CAAC;AAEX;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,OAAO,GACf,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,KAAK,GACL,SAAS,GACT,UAAU,GACV,OAAO,CAAC;AAEZ;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,OAAO,EAQnC,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE7D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAGpD,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEpE,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,GAAG,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QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,6CAA6C;IAC7C,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,oEAAoE;IACpE,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,aAAa,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/C,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,iBAAiB,CAazD"}
|
package/dist/core/config.js
CHANGED
|
@@ -98,6 +98,38 @@ export function harnessIncludesAgent(harness, agent) {
|
|
|
98
98
|
* host projects predate Codex support and have always emitted .claude/ artifacts)
|
|
99
99
|
*/
|
|
100
100
|
export const DEFAULT_HARNESS = "claude";
|
|
101
|
+
/**
|
|
102
|
+
* Whether a non-interactive apply may replace this managed file.
|
|
103
|
+
* @param relativePath - Repo-relative path of the managed file
|
|
104
|
+
* @param refresh - The resolved --refresh-templates selection, if any
|
|
105
|
+
* @returns True when the operator opted this path in
|
|
106
|
+
*/
|
|
107
|
+
export function mayRefreshTemplate(relativePath, refresh) {
|
|
108
|
+
if (refresh === undefined)
|
|
109
|
+
return false;
|
|
110
|
+
if (refresh.mode === "all")
|
|
111
|
+
return true;
|
|
112
|
+
// Normalise so `scripts/lisa-hooks`, `scripts/lisa-hooks/`, and an exact file
|
|
113
|
+
// path all behave the way the flag reads.
|
|
114
|
+
const target = relativePath.replaceAll("\\", "/");
|
|
115
|
+
return refresh.paths.some(raw => {
|
|
116
|
+
const scope = stripTrailingSlashes(raw.replaceAll("\\", "/"));
|
|
117
|
+
return scope === target || target.startsWith(`${scope}/`);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Drop trailing slashes so `scripts/lisa-hooks/` and `scripts/lisa-hooks` are
|
|
122
|
+
* one scope.
|
|
123
|
+
*
|
|
124
|
+
* Written as a loop rather than a `/\/+$/` replace: that pattern is
|
|
125
|
+
* super-linear on a pathological input, and a scope string comes straight from
|
|
126
|
+
* the command line.
|
|
127
|
+
* @param value - Normalised, forward-slashed path
|
|
128
|
+
* @returns The path without any trailing slashes
|
|
129
|
+
*/
|
|
130
|
+
function stripTrailingSlashes(value) {
|
|
131
|
+
return value.endsWith("/") ? stripTrailingSlashes(value.slice(0, -1)) : value;
|
|
132
|
+
}
|
|
101
133
|
/**
|
|
102
134
|
* Create initial operation counters with all values at zero
|
|
103
135
|
* @returns Operation counters initialized to zero
|
|
@@ -106,6 +138,7 @@ export function createInitialCounters() {
|
|
|
106
138
|
return {
|
|
107
139
|
copied: 0,
|
|
108
140
|
skipped: 0,
|
|
141
|
+
stale: 0,
|
|
109
142
|
overwritten: 0,
|
|
110
143
|
appended: 0,
|
|
111
144
|
merged: 0,
|
package/dist/core/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAwBA;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAE/B;IACF,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,YAAY;IACpB,GAAG,EAAE,YAAY;IACjB,eAAe,EAAE,YAAY;IAC7B,MAAM,EAAE,YAAY;IACpB,aAAa,EAAE,YAAY;IAC3B,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,SAAS;CACR,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA2B;IACxD,YAAY;IACZ,aAAa;IACb,eAAe;IACf,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,KAAK;IACL,OAAO;CACC,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAA4B;IACtD,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,OAAO;IACP,cAAc;IACd,cAAc;CACN,CAAC;AAyBX;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAuB;IAChD,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,KAAK;IACL,SAAS;IACT,UAAU;IACV,OAAO;CACC,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAsC;IAChE,GAAG,EAAE,OAAO;CACb,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,GAAG,cAAc;IACjB,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC;CAChC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAsC;IACvE,IAAI,EAAE,OAAO;CACd,CAAC;AASF;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAgB,EAChB,KAAgB;IAEhB,IAAI,OAAO,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO,OAAO,KAAK,KAAK,CAAC;AAC3B,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAY,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAwBA;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAE/B;IACF,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,YAAY;IACpB,GAAG,EAAE,YAAY;IACjB,eAAe,EAAE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AAO,CAAC,IAAI,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IACxC,8EAA8E;IAC9E,0CAA0C;IAC1C,MAAM,MAAM,GAAG,YAAY,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAClD,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAC9B,MAAM,KAAK,GAAG,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;QAC9D,OAAO,KAAK,KAAK,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,oBAAoB,CAAC,KAAa;IACzC,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAChF,CAAC;AAuED;;;GAGG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;QACV,KAAK,EAAE,CAAC;QACR,WAAW,EAAE,CAAC;QACd,QAAQ,EAAE,CAAC;QACX,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,CAAC;QACV,iBAAiB,EAAE,CAAC;QACpB,iBAAiB,EAAE,CAAC;KACrB,CAAC;AACJ,CAAC"}
|
package/dist/core/lisa.d.ts
CHANGED
|
@@ -25,6 +25,14 @@ export declare class Lisa {
|
|
|
25
25
|
private readonly config;
|
|
26
26
|
private readonly deps;
|
|
27
27
|
private counters;
|
|
28
|
+
/**
|
|
29
|
+
* Managed files this apply found out of date but could not update.
|
|
30
|
+
*
|
|
31
|
+
* Named so the summary can list them: a count alone tells an operator that
|
|
32
|
+
* something did not land without telling them what, which is most of the way
|
|
33
|
+
* back to the silence this exists to end.
|
|
34
|
+
*/
|
|
35
|
+
private readonly stalePaths;
|
|
28
36
|
private detectedTypes;
|
|
29
37
|
private ignorePatterns;
|
|
30
38
|
/**
|
|
@@ -635,6 +643,15 @@ export declare class Lisa {
|
|
|
635
643
|
* Print summary statistics for apply mode
|
|
636
644
|
*/
|
|
637
645
|
private printApplyStats;
|
|
646
|
+
/**
|
|
647
|
+
* Name the out-of-date managed files and say how to update them.
|
|
648
|
+
*
|
|
649
|
+
* A bare count is not enough to act on. An operator taking an upgrade needs
|
|
650
|
+
* to see WHICH managed files the release changed and did not deliver —
|
|
651
|
+
* particularly the enforcement guards, where the gap is a security control
|
|
652
|
+
* that stayed on its old version while the release notes said otherwise.
|
|
653
|
+
*/
|
|
654
|
+
private printStaleDetail;
|
|
638
655
|
/**
|
|
639
656
|
* Print summary statistics
|
|
640
657
|
*/
|
package/dist/core/lisa.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lisa.d.ts","sourceRoot":"","sources":["../../src/core/lisa.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AA2BnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAOzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,iBAAiB,EAGlB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAwB,MAAM,wBAAwB,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAe9D,OAAO,KAAK,EAIV,UAAU,EACV,UAAU,EAGX,MAAM,aAAa,CAAC;AAcrB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAsBpD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,C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OAGG;YACW,kBAAkB;IAuBhC;;;;;;;OAOG;YACW,gBAAgB;IAuD9B;;;;;;;OAOG;IACH,OAAO,CAAC,0BAA0B;IAelC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,iBAAiB;IA+BzB;;;;;;OAMG;IACH,OAAO,CAAC,OAAO;IAaf;;;;;;OAMG;YACW,qBAAqB;IAyBnC;;;;OAIG;YACW,QAAQ;IAatB;;;OAGG;IACH,OAAO,CAAC,cAAc;IAyBtB;;;;OAIG;IACH,OAAO,CAAC,UAAU;IAKlB;;;OAGG;IACH,OAAO,CAAC,SAAS;IA4CjB;;OAEG;YACW,mBAAmB;IAajC;;OAEG;YACW,gBAAgB;IA+B9B;;OAEG;IACH,OAAO,CAAC,WAAW;IA4BnB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IAYrB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAmB1B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAoCxB;;OAEG;IACH,OAAO,CAAC,eAAe;IAoCvB;;;;;;;OAOG;IACH,OAAO,CAAC,gBAAgB;IAoBxB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAezB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAazB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAgB7B;;OAEG;IACH,OAAO,CAAC,YAAY;IAOpB;;;;;OAKG;YACW,WAAW;IAQzB;;;;;OAKG;YACW,qBAAqB;CAqDpC"}
|
package/dist/core/lisa.js
CHANGED
|
@@ -45,6 +45,14 @@ export class Lisa {
|
|
|
45
45
|
config;
|
|
46
46
|
deps;
|
|
47
47
|
counters = createInitialCounters();
|
|
48
|
+
/**
|
|
49
|
+
* Managed files this apply found out of date but could not update.
|
|
50
|
+
*
|
|
51
|
+
* Named so the summary can list them: a count alone tells an operator that
|
|
52
|
+
* something did not land without telling them what, which is most of the way
|
|
53
|
+
* back to the silence this exists to end.
|
|
54
|
+
*/
|
|
55
|
+
stalePaths = [];
|
|
48
56
|
detectedTypes = [];
|
|
49
57
|
ignorePatterns = {
|
|
50
58
|
patterns: [],
|
|
@@ -1464,6 +1472,10 @@ export class Lisa {
|
|
|
1464
1472
|
case "skipped":
|
|
1465
1473
|
this.counters.skipped++;
|
|
1466
1474
|
break;
|
|
1475
|
+
case "stale":
|
|
1476
|
+
this.counters.stale++;
|
|
1477
|
+
this.stalePaths.push(result.relativePath);
|
|
1478
|
+
break;
|
|
1467
1479
|
case "overwritten":
|
|
1468
1480
|
this.counters.overwritten++;
|
|
1469
1481
|
break;
|
|
@@ -1499,6 +1511,11 @@ export class Lisa {
|
|
|
1499
1511
|
case "skipped":
|
|
1500
1512
|
// Silent for skipped files
|
|
1501
1513
|
break;
|
|
1514
|
+
case "stale":
|
|
1515
|
+
this.deps.logger.warn(this.config.dryRun
|
|
1516
|
+
? `Out of date, would not be updated: ${result.relativePath}`
|
|
1517
|
+
: `Out of date, not updated: ${result.relativePath}`);
|
|
1518
|
+
break;
|
|
1502
1519
|
case "overwritten":
|
|
1503
1520
|
this.logMessage(`Would prompt to overwrite: ${result.relativePath}`, `Overwritten: ${result.relativePath}`);
|
|
1504
1521
|
break;
|
|
@@ -1631,12 +1648,14 @@ export class Lisa {
|
|
|
1631
1648
|
this.printStatLine("Would copy: ", copied, pc.green);
|
|
1632
1649
|
this.printStatLine("Would skip: ", skipped, pc.blue, "(identical or create-only)");
|
|
1633
1650
|
this.printStatLine("Would prompt: ", overwritten, pc.yellow, "(differ)");
|
|
1651
|
+
this.printStatLine("Out of date: ", this.counters.stale, pc.yellow, "(managed templates changed; would NOT be updated)");
|
|
1634
1652
|
this.printStatLine("Would append: ", appended, pc.blue, "(copy-contents)");
|
|
1635
1653
|
this.printStatLine("Would merge: ", merged, pc.green, "(JSON)");
|
|
1636
1654
|
this.printStatLine("Would delete: ", deleted, pc.red);
|
|
1637
1655
|
if (ignored > 0) {
|
|
1638
1656
|
this.printStatLine("Would ignore: ", ignored, pc.magenta, this.lisaignoreSuffix);
|
|
1639
1657
|
}
|
|
1658
|
+
this.printStaleDetail();
|
|
1640
1659
|
}
|
|
1641
1660
|
/**
|
|
1642
1661
|
* Print summary statistics for apply mode
|
|
@@ -1646,12 +1665,35 @@ export class Lisa {
|
|
|
1646
1665
|
this.printStatLine("Copied: ", copied, pc.green);
|
|
1647
1666
|
this.printStatLine("Skipped: ", skipped, pc.blue, "(identical or create-only)");
|
|
1648
1667
|
this.printStatLine("Overwritten:", overwritten, pc.yellow, "(user approved)");
|
|
1668
|
+
this.printStatLine("Out of date:", this.counters.stale, pc.yellow, "(managed templates changed; NOT updated)");
|
|
1649
1669
|
this.printStatLine("Appended: ", appended, pc.blue, "(copy-contents)");
|
|
1650
1670
|
this.printStatLine("Merged: ", merged, pc.green, "(JSON merged)");
|
|
1651
1671
|
this.printStatLine("Deleted: ", deleted, pc.red);
|
|
1652
1672
|
if (ignored > 0) {
|
|
1653
1673
|
this.printStatLine("Ignored: ", ignored, pc.magenta, this.lisaignoreSuffix);
|
|
1654
1674
|
}
|
|
1675
|
+
this.printStaleDetail();
|
|
1676
|
+
}
|
|
1677
|
+
/**
|
|
1678
|
+
* Name the out-of-date managed files and say how to update them.
|
|
1679
|
+
*
|
|
1680
|
+
* A bare count is not enough to act on. An operator taking an upgrade needs
|
|
1681
|
+
* to see WHICH managed files the release changed and did not deliver —
|
|
1682
|
+
* particularly the enforcement guards, where the gap is a security control
|
|
1683
|
+
* that stayed on its old version while the release notes said otherwise.
|
|
1684
|
+
*/
|
|
1685
|
+
printStaleDetail() {
|
|
1686
|
+
if (this.counters.stale === 0)
|
|
1687
|
+
return;
|
|
1688
|
+
const { logger } = this.deps;
|
|
1689
|
+
logger.warn(this.config.dryRun
|
|
1690
|
+
? `${this.counters.stale} managed file(s) changed upstream and would be left as-is:`
|
|
1691
|
+
: `${this.counters.stale} managed file(s) changed upstream but were left as-is:`);
|
|
1692
|
+
for (const relativePath of this.stalePaths) {
|
|
1693
|
+
logger.warn(` ${relativePath}`);
|
|
1694
|
+
}
|
|
1695
|
+
logger.info("A non-interactive apply will not replace a file your project may have customised.");
|
|
1696
|
+
logger.info("Review the differences and run `lisa apply .` interactively to take them, or add paths to .lisaignore to keep yours.");
|
|
1655
1697
|
}
|
|
1656
1698
|
/**
|
|
1657
1699
|
* Print summary statistics
|