@elaraai/east-plugin 1.0.89 → 1.0.91

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.
@@ -0,0 +1,93 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Assembles East's plugins as the hosts install them — the directories a
4
+ * release publishes as `@elaraai/east-claude-plugin` and
5
+ * `@elaraai/east-codex-plugin` — under `libs/east-plugin/marketplace/`, and
6
+ * writes that directory's marketplace files, so a checkout is a local
7
+ * marketplace for both hosts, under the catalog's names — a maintainer swaps
8
+ * the source of `elaraai` between the catalog and a checkout with one
9
+ * `marketplace add`, and `east@elaraai` stays the plugin (#1309):
10
+ *
11
+ * claude plugin marketplace add <checkout>/libs/east-plugin/marketplace
12
+ * codex plugin marketplace add <checkout>/libs/east-plugin/marketplace
13
+ *
14
+ * Usage: node dist/scripts/package.js [--host claude|codex] [--out <dir>]
15
+ * --host assemble one host's plugin (default both)
16
+ * --out the marketplace directory (default libs/east-plugin/marketplace);
17
+ * a directory this script wrote before, or an empty or absent one —
18
+ * anything else there is refused, since the plugins and the
19
+ * marketplace files replace what they find
20
+ *
21
+ * Each host's `.build/` must exist (pnpm --filter <host> run bundle).
22
+ */
23
+ import { existsSync } from "node:fs";
24
+ import { mkdir, readdir, writeFile } from "node:fs/promises";
25
+ import { dirname, join, resolve } from "node:path";
26
+ import { fileURLToPath } from "node:url";
27
+ import { argument } from "../lib/args.js";
28
+ import { assemblePlugin } from "../lib/package.js";
29
+ // dist/scripts/package.js → libs/east-plugin
30
+ const root = resolve(dirname(fileURLToPath(import.meta.url)), "..", "..");
31
+ const libs = resolve(root, "..");
32
+ /** East's plugins: the host, its source package, and the package it is published as. */
33
+ const PLUGINS = {
34
+ claude: { source: join(libs, "east-claude-plugin"), dir: "east-claude-plugin", plugin: "east" },
35
+ codex: { source: join(libs, "east-codex-plugin"), dir: "east-codex-plugin", plugin: "east-codex-plugin" },
36
+ };
37
+ /** What this script writes under the marketplace directory: the plugins and the marketplace files, and nothing else may be there. */
38
+ const WRITTEN = new Set([PLUGINS.claude.dir, PLUGINS.codex.dir, `${PLUGINS.claude.dir}.assembling`, `${PLUGINS.codex.dir}.assembling`, ".claude-plugin", ".agents"]);
39
+ const OWNER = { name: "Elara AI", email: "support@elara.ai", url: "https://elaraai.com" };
40
+ const DESCRIPTION = "East programming language ecosystem - types, expressions, Node.js/Python runtimes, UI components, and durable execution";
41
+ const args = process.argv.slice(2);
42
+ const host = argument(args, "--host");
43
+ if (host !== undefined && host !== "claude" && host !== "codex") {
44
+ console.error(`--host takes claude or codex, not ${host}`);
45
+ process.exit(2);
46
+ }
47
+ const out = resolve(argument(args, "--out") ?? join(root, "marketplace"));
48
+ const hosts = host === undefined ? ["claude", "codex"] : [host];
49
+ // Refused before anything is written: a plugin source, a package, the repo
50
+ // root — each holds what no assembly wrote, and would lose it.
51
+ if (existsSync(out)) {
52
+ const foreign = (await readdir(out)).filter((name) => !WRITTEN.has(name));
53
+ if (foreign.length > 0) {
54
+ console.error(`Refusing to write a marketplace into ${out}: it holds ${foreign.join(", ")}, which no assembly wrote`);
55
+ process.exit(2);
56
+ }
57
+ }
58
+ for (const which of hosts) {
59
+ const { source, dir } = PLUGINS[which];
60
+ const manifest = await assemblePlugin({
61
+ host: which,
62
+ source,
63
+ skills: join(root, "skills"),
64
+ index: join(root, "index.json"),
65
+ out: join(out, dir),
66
+ });
67
+ console.log(`assembled ${manifest.name}@${manifest.version} → ${join(out, dir)}`);
68
+ }
69
+ // The marketplace files name every plugin assembled here, so a host added to
70
+ // this directory installs what is on disk, under the published catalog's
71
+ // names (elaraai, elaraai-codex): one name registers once, and a maintainer
72
+ // points it at a checkout or at the catalog.
73
+ const present = (which) => existsSync(join(out, PLUGINS[which].dir, "package.json"));
74
+ await mkdir(join(out, ".claude-plugin"), { recursive: true });
75
+ await writeFile(join(out, ".claude-plugin", "marketplace.json"), `${JSON.stringify({
76
+ name: "elaraai",
77
+ description: "East's agent plugins, assembled from this checkout",
78
+ owner: OWNER,
79
+ plugins: present("claude") ? [{ name: PLUGINS.claude.plugin, source: `./${PLUGINS.claude.dir}`, description: DESCRIPTION }] : [],
80
+ }, null, 2)}\n`);
81
+ await mkdir(join(out, ".agents", "plugins"), { recursive: true });
82
+ await writeFile(join(out, ".agents", "plugins", "marketplace.json"), `${JSON.stringify({
83
+ name: "elaraai-codex",
84
+ interface: { displayName: "Elara AI (this checkout)" },
85
+ plugins: present("codex") ? [{
86
+ name: PLUGINS.codex.plugin,
87
+ source: { source: "local", path: `./${PLUGINS.codex.dir}` },
88
+ policy: { installation: "AVAILABLE", authentication: "ON_INSTALL" },
89
+ category: "Productivity",
90
+ }] : [],
91
+ }, null, 2)}\n`);
92
+ console.log(`marketplace: ${out} (elaraai, elaraai-codex)`);
93
+ //# sourceMappingURL=package.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.js","sourceRoot":"","sources":["../../scripts/package.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAmB,MAAM,mBAAmB,CAAC;AAEpE,6CAA6C;AAC7C,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAC1E,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAEjC,wFAAwF;AACxF,MAAM,OAA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