@rbbtsn0w/adg 0.9.1-beta.1 → 0.9.1-beta.2

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.
@@ -1,8 +1,9 @@
1
- import { existsSync, statSync } from "node:fs";
1
+ import { existsSync, readFileSync, statSync } from "node:fs";
2
2
  import { join } from "node:path";
3
3
  import { ADG_SCHEMA_VERSION } from "../types.js";
4
- import { validateManifest } from "../manifest.js";
5
- import { toPosix } from "../fsutil.js";
4
+ import { ADG_MANIFEST_PATH, validateManifest } from "../manifest.js";
5
+ import { toPosix, writeJson } from "../fsutil.js";
6
+ import { scanNativePlugins } from "../sources.js";
6
7
  /**
7
8
  * Reverse-adapt a runtime-native manifest (.claude-plugin/plugin.json or
8
9
  * .codex-plugin/plugin.json) into a canonical ADG manifest. This is the inverse
@@ -96,3 +97,20 @@ function toSkillPath(ref) {
96
97
  const name = ref.replace(/[\\/]+$/, "").split(/[\\/]/).pop() || ref;
97
98
  return `./skills/${name}`;
98
99
  }
100
+ /**
101
+ * Reverse-adapt all native (Claude/Codex) manifests found under `root` into
102
+ * canonical `.agents/.plugin.json` manifests in place. Returns the list of
103
+ * converted plugin names.
104
+ */
105
+ export function adaptNativePlugins(root) {
106
+ const converted = [];
107
+ for (const native of scanNativePlugins(root)) {
108
+ if (native.kind === "adg")
109
+ continue;
110
+ const raw = JSON.parse(readFileSync(native.manifestFile, "utf8"));
111
+ const manifest = fromNativeManifest(raw, native.kind, native.dir);
112
+ writeJson(join(native.dir, ADG_MANIFEST_PATH), manifest);
113
+ converted.push(manifest.name);
114
+ }
115
+ return converted;
116
+ }
@@ -95,7 +95,8 @@ export function syncAntigravityPluginConfig(name, enabled, env = process.env) {
95
95
  typeof parsed.plugins === "object" &&
96
96
  !Array.isArray(parsed.plugins)) {
97
97
  const plugins = parsed.plugins;
98
- if (plugins[name] || !enabled) {
98
+ const isCurrentlyEnabled = plugins[name]?.enabled ?? false;
99
+ if (isCurrentlyEnabled !== enabled) {
99
100
  plugins[name] = { ...plugins[name], enabled };
100
101
  writeFileSync(configPath, `${JSON.stringify(parsed, null, 2)}\n`);
101
102
  }
@@ -1,11 +1,7 @@
1
- import { readFileSync } from "node:fs";
2
- import { join } from "node:path";
3
- import { fromNativeManifest } from "../../adapters/reverse.js";
4
- import { writeJson } from "../../fsutil.js";
1
+ import { adaptNativePlugins } from "../../adapters/reverse.js";
5
2
  import { lockPath } from "../../paths.js";
6
3
  import { readLock } from "../../lock.js";
7
- import { ADG_MANIFEST_PATH } from "../../manifest.js";
8
- import { scanNativePlugins, scanPlugins } from "../../sources.js";
4
+ import { scanPlugins } from "../../sources.js";
9
5
  import { COMPONENT_TYPES, } from "../../types.js";
10
6
  import { pluginContents, presentComponents } from "../../components.js";
11
7
  import { skillDescriptionLoader } from "../../skills.js";
@@ -17,15 +13,7 @@ import { removePlugin } from "../remove.js";
17
13
  * whole source speaks ADG, so selection and install treat all plugins uniformly.
18
14
  */
19
15
  export function discoverPlugins(root) {
20
- const converted = [];
21
- for (const native of scanNativePlugins(root)) {
22
- if (native.kind === "adg")
23
- continue;
24
- const raw = JSON.parse(readFileSync(native.manifestFile, "utf8"));
25
- const manifest = fromNativeManifest(raw, native.kind, native.dir);
26
- writeJson(join(native.dir, ADG_MANIFEST_PATH), manifest);
27
- converted.push(manifest.name);
28
- }
16
+ const converted = adaptNativePlugins(root);
29
17
  return { candidates: scanPlugins(root), converted };
30
18
  }
31
19
  /** Resolve which discovered plugins to install from the selection options. */
@@ -1,8 +1,11 @@
1
1
  import { existsSync, mkdtempSync, rmSync } from "node:fs";
2
2
  import { tmpdir } from "node:os";
3
3
  import { isAbsolute, join, relative, resolve, sep } from "node:path";
4
+ import { adaptNativePlugins } from "./adapters/reverse.js";
5
+ import { resolveDefaultDsl } from "./default-dsl.js";
6
+ import { writeJson } from "./fsutil.js";
4
7
  import { folderHash } from "./hash.js";
5
- import { readManifest } from "./manifest.js";
8
+ import { ADG_MANIFEST_PATH, findManifestFile, readManifest } from "./manifest.js";
6
9
  import { withPluginSourceCache } from "./materialize.js";
7
10
  import { PROJECTION_DIRS, packageFilter } from "./package.js";
8
11
  import { legacyPluginSourceCacheDir, pluginSourceCacheDir } from "./paths.js";
@@ -41,6 +44,8 @@ function restoreExactRemoteSnapshot(pluginsDir, name, entry) {
41
44
  // Do not check out origin/ref: it is user update intent and can move. Fetch
42
45
  // only the exact commit persisted by the v4 lock instead.
43
46
  runGit(["-C", temp, "init"]);
47
+ runGit(["-C", temp, "config", "core.autocrlf", "false"]);
48
+ runGit(["-C", temp, "config", "core.eol", "lf"]);
44
49
  runGit(["-C", temp, "remote", "add", "origin", url]);
45
50
  // Bounded like every other network git call: an unbounded fetch is an
46
51
  // indefinite, output-free hang.
@@ -53,6 +58,19 @@ function restoreExactRemoteSnapshot(pluginsDir, name, entry) {
53
58
  }
54
59
  if (!existsSync(source))
55
60
  throw new Error(`locked source path is missing for "${name}"`);
61
+ if (!findManifestFile(source)) {
62
+ adaptNativePlugins(source);
63
+ if (!findManifestFile(source) && entry.definition?.kind === "default-dsl/v1") {
64
+ const generated = resolveDefaultDsl(source, {
65
+ name: entry.definition.as ?? name,
66
+ description: entry.definition.description,
67
+ }, {
68
+ ...(entry.resolvedRevision ? { resolvedRevision: entry.resolvedRevision } : {}),
69
+ recordTelemetry: false,
70
+ });
71
+ writeJson(join(source, ADG_MANIFEST_PATH), generated.manifest);
72
+ }
73
+ }
56
74
  assertSourceHash(source, name, entry.sourceHash);
57
75
  const manifest = readManifest(source);
58
76
  return withPluginSourceCache(source, pluginSourceCacheDir(pluginsDir, name), manifest, (snapshot) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbbtsn0w/adg",
3
- "version": "0.9.1-beta.1",
3
+ "version": "0.9.1-beta.2",
4
4
  "description": "Agent Directory Group (ADG) toolkit — two domains: plugins and skills.",
5
5
  "type": "module",
6
6
  "license": "MIT",