@rbbtsn0w/adg 0.10.1 → 0.11.0-dev.pr166.1007d82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/src/adapters/antigravity-hooks.js +4 -2
- package/dist/src/commands/adapt.js +2 -2
- package/dist/src/commands/install/install-one.js +76 -5
- package/dist/src/commands/install.js +10 -2
- package/dist/src/commands/marketplace.js +6 -1
- package/dist/src/commands/update.js +4 -1
- package/dist/src/materialize.js +1 -1
- package/dist/src/plugin-changes.js +22 -0
- package/dist/src/render/plugins.js +21 -3
- package/dist/src/sources.js +3 -1
- package/dist/vendor/skills/src/add.js +597 -281
- package/dist/vendor/skills/src/agents.js +42 -7
- package/dist/vendor/skills/src/blob.js +96 -42
- package/dist/vendor/skills/src/cli.js +64 -36
- package/dist/vendor/skills/src/detect-agent.js +1 -1
- package/dist/vendor/skills/src/download-source.js +11 -8
- package/dist/vendor/skills/src/find.js +5 -5
- package/dist/vendor/skills/src/frontmatter.js +1 -1
- package/dist/vendor/skills/src/git-tree.js +1 -1
- package/dist/vendor/skills/src/git.js +84 -3
- package/dist/vendor/skills/src/install.js +27 -16
- package/dist/vendor/skills/src/installer.js +68 -42
- package/dist/vendor/skills/src/list.js +5 -5
- package/dist/vendor/skills/src/local-lock.js +18 -7
- package/dist/vendor/skills/src/notion-test.js +440 -0
- package/dist/vendor/skills/src/prompts/search-multiselect.js +22 -0
- package/dist/vendor/skills/src/providers/index.js +2 -2
- package/dist/vendor/skills/src/providers/wellknown.js +4 -4
- package/dist/vendor/skills/src/remove.js +37 -16
- package/dist/vendor/skills/src/skill-lock.js +2 -2
- package/dist/vendor/skills/src/skill-relocation.js +56 -0
- package/dist/vendor/skills/src/skills-field.js +50 -0
- package/dist/vendor/skills/src/skills.js +78 -58
- package/dist/vendor/skills/src/source-parser.js +76 -2
- package/dist/vendor/skills/src/sync.js +610 -190
- package/dist/vendor/skills/src/telemetry.js +1 -1
- package/dist/vendor/skills/src/test-utils.js +6 -9
- package/dist/vendor/skills/src/update.js +147 -62
- package/dist/vendor/skills/src/use.js +13 -12
- package/docs/agents-spec.md +5 -0
- package/docs/plugin-update-semantics.md +152 -0
- package/package.json +7 -7
- package/vendor/skills/PROVENANCE.md +130 -10
- package/vendor/skills/ThirdPartyNoticeText.txt +4 -4
package/README.md
CHANGED
|
@@ -358,6 +358,15 @@ of [vercel-labs/skills](https://github.com/vercel-labs/skills) under
|
|
|
358
358
|
[vendor/skills/](vendor/skills/) — `adg skills` forwards all args to it. Run
|
|
359
359
|
`adg skills --help` for its full usage.
|
|
360
360
|
|
|
361
|
+
The vendored baseline is v1.7.4. `add --json` emits a single machine-readable
|
|
362
|
+
result; Git sources accept a full commit SHA as a ref. `experimental_sync`
|
|
363
|
+
(alias `sync`) reads dependency and workspace skills, links them to installed
|
|
364
|
+
packages by default, and cleans up skills it owns when their dependency stops
|
|
365
|
+
shipping them. Use `--dry-run` to preview, `--copy` for copies, `--no-cleanup`
|
|
366
|
+
to retain old skills, or `--no-remote` to skip Git sources from package `skills`
|
|
367
|
+
fields. Existing ADG path, authentication, and telemetry patches are tracked in
|
|
368
|
+
[the vendoring history](vendor/skills/PROVENANCE.md).
|
|
369
|
+
|
|
361
370
|
> **License.** Upstream `skills` is **MIT** (declared in its README and
|
|
362
371
|
> `package.json`). The vendored copy retains a reconstructed
|
|
363
372
|
> [LICENSE](vendor/skills/LICENSE) (MIT + attribution) and the upstream
|
|
@@ -313,7 +313,7 @@ function translateDocument(pluginDir, pluginName, document) {
|
|
|
313
313
|
return { definition, warnings };
|
|
314
314
|
}
|
|
315
315
|
/** Materialize a plugin's hooks under Antigravity's required root filename and native schema. */
|
|
316
|
-
export function writeAntigravityHooks(pluginDir, manifest, selection) {
|
|
316
|
+
export function writeAntigravityHooks(pluginDir, manifest, selection, runtimeRoot = pluginDir) {
|
|
317
317
|
const target = join(pluginDir, TARGET_FILE);
|
|
318
318
|
const sources = hookSources(pluginDir, manifest);
|
|
319
319
|
const sourceIsTarget = sources.canonical !== undefined && resolve(sources.canonical) === resolve(target);
|
|
@@ -333,7 +333,9 @@ export function writeAntigravityHooks(pluginDir, manifest, selection) {
|
|
|
333
333
|
return [];
|
|
334
334
|
}
|
|
335
335
|
const document = parseJsonFile(sources.canonical, "canonical hooks");
|
|
336
|
-
|
|
336
|
+
// Commands execute after staging is promoted: embed the installed location,
|
|
337
|
+
// while source reads and generated file writes still use the staging folder.
|
|
338
|
+
const { definition, warnings } = translateDocument(runtimeRoot, manifest.name, document);
|
|
337
339
|
if (Object.keys(definition).length) {
|
|
338
340
|
const projected = { [manifest.name]: definition };
|
|
339
341
|
validateNativeDocument(projected);
|
|
@@ -11,7 +11,7 @@ import { writeAntigravityHooks } from "../adapters/antigravity-hooks.js";
|
|
|
11
11
|
* mapping when present, otherwise falls back to the adapter's default path.
|
|
12
12
|
* An optional `selection` narrows what the generated manifests expose.
|
|
13
13
|
*/
|
|
14
|
-
export function adaptPlugin(pluginDir, targets, selection) {
|
|
14
|
+
export function adaptPlugin(pluginDir, targets, selection, runtimeRoot = pluginDir) {
|
|
15
15
|
const manifest = readManifest(pluginDir);
|
|
16
16
|
const results = [];
|
|
17
17
|
// Surface target event gaps before they become silent no-ops. Antigravity's
|
|
@@ -28,7 +28,7 @@ export function adaptPlugin(pluginDir, targets, selection) {
|
|
|
28
28
|
writeJson(file, out);
|
|
29
29
|
if (target === "antigravity") {
|
|
30
30
|
writeAntigravityMcpConfig(pluginDir, manifest, selection);
|
|
31
|
-
for (const warning of writeAntigravityHooks(pluginDir, manifest, selection))
|
|
31
|
+
for (const warning of writeAntigravityHooks(pluginDir, manifest, selection, runtimeRoot))
|
|
32
32
|
hookWarnings.add(warning);
|
|
33
33
|
}
|
|
34
34
|
results.push({ target, file });
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { existsSync } from "node:fs";
|
|
1
|
+
import { existsSync, mkdtempSync, readdirSync, rmSync } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
2
3
|
import { basename, join, relative, resolve } from "node:path";
|
|
3
4
|
import { isDeepStrictEqual } from "node:util";
|
|
4
5
|
import { ADAPTER_TARGETS } from "../../adapters/index.js";
|
|
@@ -10,9 +11,10 @@ import { readLock, upsertEntry, writeLock } from "../../lock.js";
|
|
|
10
11
|
import { readManifest } from "../../manifest.js";
|
|
11
12
|
import { recordTelemetryEvent } from "../../telemetry.js";
|
|
12
13
|
import { readMarketplace, upsertMarketplacePlugin, writeMarketplace } from "../../marketplace.js";
|
|
13
|
-
import { normalizePluginSelection, resolveSelectionDependencies, sameSource, } from "../../types.js";
|
|
14
|
+
import { normalizePluginSelection, COMPONENT_TYPES, resolveSelectionDependencies, sameSource, } from "../../types.js";
|
|
14
15
|
import { pluginContents } from "../../components.js";
|
|
15
16
|
import { effectivePackageFilter, materializePlugin, withPluginSourceCache } from "../../materialize.js";
|
|
17
|
+
import { pluginComparisonHash } from "../../plugin-changes.js";
|
|
16
18
|
// Generated runtime projections never count toward a plugin's content hash.
|
|
17
19
|
const HASH_IGNORE = PROJECTION_DIRS;
|
|
18
20
|
/** Content hash over a plugin's packaged payload (hooks files are authored content, not generated). */
|
|
@@ -78,14 +80,79 @@ export function installPlugin(opts) {
|
|
|
78
80
|
}
|
|
79
81
|
const sourceHash = contentHash(source, manifest);
|
|
80
82
|
const cacheDir = pluginSourceCacheDir(opts.pluginsDir, name);
|
|
83
|
+
const targets = opts.targets ?? [...ADAPTER_TARGETS];
|
|
84
|
+
const contents = pluginContents(source, manifest);
|
|
85
|
+
const selectedContents = (value) => Object.fromEntries(COMPONENT_TYPES.map((component) => {
|
|
86
|
+
const available = contents[component];
|
|
87
|
+
const selected = component === "skills" ? value?.skills : component === "mcp" ? value?.mcp : undefined;
|
|
88
|
+
return [component, value && !value.components.includes(component) ? [] : available.filter((name) => !selected || selected.includes(name)).sort()];
|
|
89
|
+
}));
|
|
90
|
+
const effectiveSelectionChanged = !isDeepStrictEqual(selectedContents(resolveSelectionDependencies(manifest, prev?.selection)), selectedContents(selection));
|
|
91
|
+
const changes = {
|
|
92
|
+
version: !prev || prev.version !== manifest.version,
|
|
93
|
+
content: true,
|
|
94
|
+
selection: !isDeepStrictEqual(prev?.selection, desiredSelection),
|
|
95
|
+
source: Boolean(prev && opts.resolvedRevision && prev.resolvedRevision !== opts.resolvedRevision),
|
|
96
|
+
};
|
|
97
|
+
// Capture comparison evidence before the cache transaction replaces it.
|
|
98
|
+
if (prev && existsSync(cacheDir)) {
|
|
99
|
+
try {
|
|
100
|
+
const priorManifest = readManifest(cacheDir);
|
|
101
|
+
if (contentHash(cacheDir, priorManifest) === prev.sourceHash) {
|
|
102
|
+
changes.content = pluginComparisonHash(cacheDir, priorManifest) !== pluginComparisonHash(source, manifest);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch { /* Missing/invalid comparison evidence requires a conservative update. */ }
|
|
106
|
+
}
|
|
107
|
+
let projectionsIntact = false;
|
|
108
|
+
let installationIntact = false;
|
|
109
|
+
try {
|
|
110
|
+
const installedManifest = readManifest(dest);
|
|
111
|
+
const previousSelection = resolveSelectionDependencies(installedManifest, prev?.selection);
|
|
112
|
+
installationIntact = Boolean(prev && folderHash(dest, PROJECTION_DIRS, effectivePackageFilter(installedManifest, previousSelection)) === prev.installedHash);
|
|
113
|
+
// Generate the complete expected installation, including auxiliary MCP,
|
|
114
|
+
// hooks and runner files that are outside native manifest directories.
|
|
115
|
+
const work = mkdtempSync(join(tmpdir(), "adg-projection-check-"));
|
|
116
|
+
try {
|
|
117
|
+
const expected = join(work, "expected");
|
|
118
|
+
materializePlugin({ source: dest, destination: expected, manifest: installedManifest, selection: previousSelection,
|
|
119
|
+
build: (staging) => { adaptPlugin(staging, targets, previousSelection, dest); } });
|
|
120
|
+
const paths = new Set();
|
|
121
|
+
const collect = (dir, prefix = "") => {
|
|
122
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
123
|
+
const path = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
124
|
+
paths.add(path);
|
|
125
|
+
if (entry.isDirectory())
|
|
126
|
+
collect(join(dir, entry.name), path);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
collect(expected);
|
|
130
|
+
projectionsIntact = folderHash(expected) === folderHash(dest, [], (path) => paths.has(path));
|
|
131
|
+
}
|
|
132
|
+
finally {
|
|
133
|
+
rmSync(work, { recursive: true, force: true });
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
catch { /* Missing or damaged projections must be regenerated. */ }
|
|
81
137
|
return withPluginSourceCache(source, cacheDir, manifest, (snapshot) => {
|
|
82
138
|
// Detect-then-update compares the complete source snapshot, never the
|
|
83
139
|
// selection-pruned runtime installation.
|
|
84
140
|
if (!opts.forceMaterialize && opts.skipUnchanged && prev
|
|
141
|
+
&& !effectiveSelectionChanged && projectionsIntact
|
|
85
142
|
&& prev.sourceHash === sourceHash && prev.version === manifest.version) {
|
|
86
143
|
const installedIntact = existsSync(dest)
|
|
87
144
|
&& folderHash(dest, PROJECTION_DIRS, effectivePackageFilter(manifest, selection)) === prev.installedHash;
|
|
88
145
|
if (installedIntact) {
|
|
146
|
+
if (changes.source || changes.selection) {
|
|
147
|
+
// Exact bytes are verified at this revision; this is not an install.
|
|
148
|
+
lock.plugins[name] = {
|
|
149
|
+
...prev,
|
|
150
|
+
...(changes.source ? { resolvedRevision: opts.resolvedRevision } : {}),
|
|
151
|
+
...(desiredSelection ? { selection: desiredSelection } : {}),
|
|
152
|
+
};
|
|
153
|
+
writeLock(lockFile, lock);
|
|
154
|
+
}
|
|
155
|
+
recordTelemetryEvent("adg.install.change", { ...changes, "runtime.refresh_required": false }, opts.telemetrySpan);
|
|
89
156
|
return {
|
|
90
157
|
name,
|
|
91
158
|
version: manifest.version,
|
|
@@ -94,10 +161,11 @@ export function installPlugin(opts) {
|
|
|
94
161
|
installedHash: prev.installedHash,
|
|
95
162
|
adapted: [],
|
|
96
163
|
changed: false,
|
|
164
|
+
changes,
|
|
165
|
+
runtimeRefreshRequired: false,
|
|
97
166
|
};
|
|
98
167
|
}
|
|
99
168
|
}
|
|
100
|
-
const targets = opts.targets ?? [...ADAPTER_TARGETS];
|
|
101
169
|
const adapted = [];
|
|
102
170
|
let installedHash = "";
|
|
103
171
|
materializePlugin({
|
|
@@ -106,7 +174,7 @@ export function installPlugin(opts) {
|
|
|
106
174
|
manifest,
|
|
107
175
|
selection,
|
|
108
176
|
build: (staging) => {
|
|
109
|
-
adapted.push(...adaptPlugin(staging, targets, selection).map((r) => relative(staging, r.file)));
|
|
177
|
+
adapted.push(...adaptPlugin(staging, targets, selection, dest).map((r) => relative(staging, r.file)));
|
|
110
178
|
installedHash = folderHash(staging, PROJECTION_DIRS, effectivePackageFilter(manifest, selection));
|
|
111
179
|
},
|
|
112
180
|
});
|
|
@@ -143,6 +211,9 @@ export function installPlugin(opts) {
|
|
|
143
211
|
...(manifest.category ? { category: manifest.category } : {}),
|
|
144
212
|
});
|
|
145
213
|
writeMarketplace(marketFile, market);
|
|
146
|
-
|
|
214
|
+
const runtimeRefreshRequired = !prev || changes.version || changes.selection || !projectionsIntact || !installationIntact
|
|
215
|
+
|| prev.installedHash !== installedHash || Boolean(opts.forceMaterialize);
|
|
216
|
+
recordTelemetryEvent("adg.install.change", { ...changes, "runtime.refresh_required": runtimeRefreshRequired }, opts.telemetrySpan);
|
|
217
|
+
return { name, version: manifest.version, installedTo: dest, sourceHash, installedHash, adapted: adaptedFiles, changed, changes, runtimeRefreshRequired };
|
|
147
218
|
});
|
|
148
219
|
}
|
|
@@ -70,7 +70,7 @@ async function prepareSource(opts, parsed, sourceRef) {
|
|
|
70
70
|
function activateInstalled(opts, targets, installed, existingPlugins) {
|
|
71
71
|
const updatedLock = readLock(lockPath(opts.pluginsDir));
|
|
72
72
|
const eligible = installed.filter((result) => pluginState(updatedLock.plugins[result.name]) === "enabled");
|
|
73
|
-
const toActivate = opts.skipUnchanged ? eligible.filter((result) => result.changed) : eligible;
|
|
73
|
+
const toActivate = opts.skipUnchanged ? eligible.filter((result) => result.runtimeRefreshRequired ?? result.changed) : eligible;
|
|
74
74
|
if (!opts.activate || toActivate.length === 0)
|
|
75
75
|
return undefined;
|
|
76
76
|
const resolved = opts.agents ?? resolveAgents(targets);
|
|
@@ -90,7 +90,15 @@ function activateInstalled(opts, targets, installed, existingPlugins) {
|
|
|
90
90
|
parts.push(agent.activate(ctxFor(activateNames)));
|
|
91
91
|
if (refreshNames.length > 0)
|
|
92
92
|
parts.push(agent.refresh(ctxFor(refreshNames)));
|
|
93
|
-
return parts.reduce((acc, result) => ({
|
|
93
|
+
return parts.reduce((acc, result) => ({
|
|
94
|
+
agent: result.agent,
|
|
95
|
+
affected: [...acc.affected, ...result.affected],
|
|
96
|
+
skipped: acc.skipped && result.skipped,
|
|
97
|
+
...((acc.failures?.length || result.failures?.length) ? { failures: [...(acc.failures ?? []), ...(result.failures ?? [])] } : {}),
|
|
98
|
+
...Object.fromEntries(["verified", "unverified", "preservedDisabled"]
|
|
99
|
+
.filter((field) => acc[field] !== undefined || result[field] !== undefined)
|
|
100
|
+
.map((field) => [field, [...new Set([...(acc[field] ?? []), ...(result[field] ?? [])])]])),
|
|
101
|
+
}), { agent: agent.id, affected: [], skipped: true });
|
|
94
102
|
});
|
|
95
103
|
}
|
|
96
104
|
/**
|
|
@@ -231,6 +231,9 @@ export async function updatePlugins(opts) {
|
|
|
231
231
|
unchanged: installed.filter((r) => !r.changed).map((r) => r.name).sort(),
|
|
232
232
|
deleted: group.installed.filter((n) => !availableSet.has(n)).sort(),
|
|
233
233
|
available: [...available].filter((n) => !installedNow.has(n) && !group.installed.includes(n)).sort(),
|
|
234
|
+
changes: installed.filter((r) => r.changes).map((r) => ({
|
|
235
|
+
name: r.name, ...r.changes, runtimeRefreshRequired: r.runtimeRefreshRequired ?? r.changed,
|
|
236
|
+
})).sort((a, b) => a.name.localeCompare(b.name)),
|
|
234
237
|
});
|
|
235
238
|
}
|
|
236
239
|
catch (err) {
|
|
@@ -266,7 +269,9 @@ export async function updatePlugins(opts) {
|
|
|
266
269
|
scope: opts.agentScope ?? "project",
|
|
267
270
|
}, false, repairAgent, {
|
|
268
271
|
initial, observed: true,
|
|
269
|
-
changed: [...remote.flatMap((source) => source.
|
|
272
|
+
changed: [...remote.flatMap((source) => source.changes
|
|
273
|
+
? source.changes.filter((plugin) => plugin.runtimeRefreshRequired).map((plugin) => plugin.name)
|
|
274
|
+
: source.updated), ...local.results.filter((plugin) => plugin.runtimeRefreshRequired ?? plugin.changed).map((plugin) => plugin.name)],
|
|
270
275
|
removed: repairNames.filter((name) => !currentLock.plugins[name]),
|
|
271
276
|
})] : [];
|
|
272
277
|
const agents = mergeAgentResults([remoteAgents, local.agents ?? [], repairs]);
|
|
@@ -8,6 +8,7 @@ import { installPlugin } from "./install.js";
|
|
|
8
8
|
import { resolveDefaultDsl } from "../default-dsl.js";
|
|
9
9
|
import { ADG_MANIFEST_PATH } from "../manifest.js";
|
|
10
10
|
import { copyPluginDir, writeJson } from "../fsutil.js";
|
|
11
|
+
import { pluginState } from "../types.js";
|
|
11
12
|
/**
|
|
12
13
|
* Refresh local sources and repair effective installations from their complete
|
|
13
14
|
* source snapshots. Runtime installations are never treated as upstream input.
|
|
@@ -80,7 +81,7 @@ export function updateLock(pluginsDir, now = new Date().toISOString(), opts = {}
|
|
|
80
81
|
if (staging)
|
|
81
82
|
rmSync(staging, { recursive: true, force: true });
|
|
82
83
|
}
|
|
83
|
-
if (result.changed)
|
|
84
|
+
if ((result.runtimeRefreshRequired ?? result.changed) && pluginState(entry) === "enabled")
|
|
84
85
|
changedNames.push(name);
|
|
85
86
|
results.push({
|
|
86
87
|
name,
|
|
@@ -88,6 +89,8 @@ export function updateLock(pluginsDir, now = new Date().toISOString(), opts = {}
|
|
|
88
89
|
version: result.version,
|
|
89
90
|
sourceHash: result.sourceHash,
|
|
90
91
|
installedHash: result.installedHash,
|
|
92
|
+
...(result.changes ? { changes: result.changes } : {}),
|
|
93
|
+
runtimeRefreshRequired: result.runtimeRefreshRequired ?? result.changed,
|
|
91
94
|
});
|
|
92
95
|
}
|
|
93
96
|
const out = { results, missing };
|
package/dist/src/materialize.js
CHANGED
|
@@ -74,7 +74,7 @@ export function effectivePackageFilter(manifest, selection) {
|
|
|
74
74
|
if (rawPath === "")
|
|
75
75
|
return true;
|
|
76
76
|
const relPath = toPosix(rawPath);
|
|
77
|
-
if (relPath === ".agents" || relPath === ADG_MANIFEST_PATH)
|
|
77
|
+
if (relPath === ".agents" || relPath === toPosix(ADG_MANIFEST_PATH))
|
|
78
78
|
return true;
|
|
79
79
|
if (relPath.startsWith("../") || relPath === "..")
|
|
80
80
|
return false;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { relative } from "node:path";
|
|
4
|
+
import { folderHash } from "./hash.js";
|
|
5
|
+
import { findManifestFile } from "./manifest.js";
|
|
6
|
+
import { packageFilter, PROJECTION_DIRS } from "./package.js";
|
|
7
|
+
function stable(value) {
|
|
8
|
+
return JSON.stringify(value, (_key, item) => item && typeof item === "object" && !Array.isArray(item)
|
|
9
|
+
? Object.fromEntries(Object.entries(item).sort(([a], [b]) => a.localeCompare(b))) : item);
|
|
10
|
+
}
|
|
11
|
+
/** Comparison only: never replaces exact source/installation integrity digests. */
|
|
12
|
+
export function pluginComparisonHash(dir, manifest) {
|
|
13
|
+
const file = findManifestFile(dir);
|
|
14
|
+
const manifestPath = file && relative(dir, file).replaceAll("\\", "/");
|
|
15
|
+
const include = packageFilter(manifest, { includeProjections: false });
|
|
16
|
+
const payload = folderHash(dir, PROJECTION_DIRS, (path) => path !== manifestPath && include(path));
|
|
17
|
+
// Preserve authored and inherited fields. Only the top-level version is omitted.
|
|
18
|
+
const raw = file ? JSON.parse(readFileSync(file, "utf8")) : manifest;
|
|
19
|
+
const { version: _rawVersion, ...rawContent } = raw;
|
|
20
|
+
const { version: _version, ...resolvedContent } = manifest;
|
|
21
|
+
return `comparison-v1-${createHash("sha256").update(payload).update(stable(rawContent)).update(stable(resolvedContent)).digest("hex")}`;
|
|
22
|
+
}
|
|
@@ -28,9 +28,14 @@ export function renderAgentReport(agents, verb) {
|
|
|
28
28
|
const name = getAgent(r.agent)?.displayName ?? r.agent;
|
|
29
29
|
for (const failure of r.failures ?? [])
|
|
30
30
|
out.push(ui.err(`${name}: ${failure.stage}${failure.plugin ? ` ${failure.plugin}` : ""}: ${failure.message}`));
|
|
31
|
-
const
|
|
31
|
+
const failed = new Set((r.failures ?? []).flatMap((failure) => failure.plugin ? [failure.plugin] : []));
|
|
32
|
+
const uncertain = new Set(r.unverified ?? []);
|
|
33
|
+
const globalFailure = r.failures?.some((failure) => !failure.plugin);
|
|
34
|
+
const completed = (r.verified ?? (globalFailure ? [] : r.affected)).filter((plugin) => !failed.has(plugin) && !uncertain.has(plugin));
|
|
32
35
|
if (completed.length > 0)
|
|
33
36
|
out.push(`${ui.ok(verb)} in ${ui.name(name)}: ${completed.join(", ")}`);
|
|
37
|
+
if (r.failures?.length || r.unverified?.length)
|
|
38
|
+
out.push(ui.warn(`runtime synchronization pending in ${name}; run \`adg plugins sync --target ${r.agent}\` with the same scope to retry.`));
|
|
34
39
|
if (r.unverified?.length)
|
|
35
40
|
out.push(ui.warn(`installed, recovery unverified in ${name}: ${r.unverified.join(", ")}`));
|
|
36
41
|
if (r.preservedDisabled?.length)
|
|
@@ -106,7 +111,18 @@ export function renderUpdateReport(result) {
|
|
|
106
111
|
out.push(`${head} ${ui.err("could not be checked")} ${ui.meta(`— ${r.failed}`)}`);
|
|
107
112
|
continue;
|
|
108
113
|
}
|
|
109
|
-
if (r.updated.length > 0)
|
|
114
|
+
if (r.updated.length > 0 && r.changes) {
|
|
115
|
+
const versionOnly = r.updated.filter((name) => {
|
|
116
|
+
const change = r.changes.find((item) => item.name === name);
|
|
117
|
+
return change?.version && !change.content && !change.selection;
|
|
118
|
+
});
|
|
119
|
+
const content = r.updated.filter((name) => !versionOnly.includes(name));
|
|
120
|
+
if (content.length > 0)
|
|
121
|
+
out.push(`${head}: ${ui.ok(`content/configuration updated ${content.join(", ")}`)}`);
|
|
122
|
+
if (versionOnly.length > 0)
|
|
123
|
+
out.push(`${head}: ${ui.meta(`version only ${versionOnly.join(", ")} (component files unchanged)`)}`);
|
|
124
|
+
}
|
|
125
|
+
else if (r.updated.length > 0)
|
|
110
126
|
out.push(`${head}: ${ui.ok(`updated ${r.updated.join(", ")}`)}`);
|
|
111
127
|
else
|
|
112
128
|
out.push(`${head}: ${ui.meta(`up to date (${r.unchanged.length})`)}`);
|
|
@@ -118,7 +134,9 @@ export function renderUpdateReport(result) {
|
|
|
118
134
|
}
|
|
119
135
|
}
|
|
120
136
|
for (const res of result.local.results) {
|
|
121
|
-
|
|
137
|
+
const versionOnly = res.changes?.version && !res.changes.content && !res.changes.selection;
|
|
138
|
+
const label = !res.changed ? ui.meta("unchanged") : versionOnly ? ui.meta("version only") : ui.ok("content/configuration updated");
|
|
139
|
+
out.push(`${label} ${ui.name(`${res.name}@${res.version}`)} ${ui.meta("(local)")}`);
|
|
122
140
|
}
|
|
123
141
|
for (const m of result.local.missing)
|
|
124
142
|
out.push(ui.warn(` ! missing directory for locked plugin: ${m}`));
|
package/dist/src/sources.js
CHANGED
|
@@ -182,7 +182,9 @@ export function runGit(args, captureOutput = false, timeoutMs) {
|
|
|
182
182
|
const output = execFileSync("git", fullArgs, {
|
|
183
183
|
...(captureOutput
|
|
184
184
|
? { stdio: "pipe", encoding: "utf8" }
|
|
185
|
-
|
|
185
|
+
// Retain Git's failure reason for the CLI report while discarding
|
|
186
|
+
// unused stdout (which can exceed maxBuffer on large repositories).
|
|
187
|
+
: { stdio: ["ignore", "ignore", "pipe"] }),
|
|
186
188
|
env: gitEnv(),
|
|
187
189
|
...(timeoutMs === undefined ? {} : { timeout: timeoutMs }),
|
|
188
190
|
});
|