@rubytech/create-realagent-code 0.1.167 → 0.1.170

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubytech/create-realagent-code",
3
- "version": "0.1.167",
3
+ "version": "0.1.170",
4
4
  "description": "Install Real Agent — Built for agents. By agents.",
5
5
  "bin": {
6
6
  "create-realagent-code": "./dist/index.js"
@@ -31,7 +31,7 @@ Everything {{productName}} can do is provided by a plugin. Each plugin is a self
31
31
 
32
32
  **How tools and roles reach the session.** Each `claude` PTY spawn registers every plugin's MCP server and every bundled subagent directory before the operator's first turn — a per-spawn `mcp-config.json` written by the session manager and passed as `--mcp-config` on the PTY argv, plus one `--add-dir` per agents directory. Admin sessions see every plugin and every role; public sessions see only plugins with at least one public-allowlisted tool. The manager refuses to start when a plugin's `PLUGIN.md` declares tools without a matching `mcp:` block (forensic signal: `boot-failed reason=mcp-allowlist-without-server …`). See `internals.md` "Spawn-time MCP and subagent registration" for the full mechanism and `internals.md` "Tool Eagerness" for the separate ToolSearch-vs-eager registration concern.
33
33
 
34
- **Where premium bundle subs live.** Bundle subs (`loop`, `property-data`, `brochures`, etc. inside `real-agent`) live exclusively at `premium-plugins/<bundle>/plugins/<sub>/` and are registered via the resolver's bundle-descent walk. They are never flat-copied into `platform/plugins/<sub>/`. Standalone premiums (no `BUNDLE.md`) still flat-copy on first boot because there is no parallel descent to register them. A divergent flat copy of a bundle sub is treated as an operator override: the resolver refuses to boot with `boot-failed reason=mcp-plugin-duplicate <plugin> declared by more than one plugins root: <pathA> (sha=…) vs <pathB> (sha=…)` so the operator can `sha256sum` both paths and remove the stale one. Byte-identical flat copies left over from installs predating Task 169 are reaped on the first post-upgrade boot (`[premium-auto-deliver] reaped sub=<name> reason=duplicate-of-premium-tree`).
34
+ **Where premium bundle subs live.** Bundle subs (`loop`, `property-data`, `brochures`, etc. inside `real-agent`) live exclusively at `premium-plugins/<bundle>/plugins/<sub>/` and are registered via the resolver's bundle-descent walk. Standalone premiums (no `BUNDLE.md`, e.g. `writer-craft`, `teaching`, `venture-studio`) live exclusively at `premium-plugins/<name>/` and are registered via the resolver's dual-root scan (`platform/plugins/` and `premium-plugins/` are both `pluginsRoots`). Neither shape is flat-copied into `platform/plugins/<name>/`. A divergent flat copy of a bundle sub is treated as an operator override: the resolver refuses to boot with `boot-failed reason=mcp-plugin-duplicate <plugin> declared by more than one plugins root: <pathA> (sha=…) vs <pathB> (sha=…)` so the operator can `sha256sum` both paths and remove the stale one. Byte-identical bundle-sub flat copies left over from installer versions that flat-copied bundle subs are reaped on the first post-upgrade boot (`[premium-auto-deliver] reaped sub=<name> reason=duplicate-of-premium-tree`). Standalone flat copies (leaked by the pre-fix `autoDeliverPremiumPlugins` standalone branch) are reaped unconditionally — there is no documented override path for standalones at `platform/plugins/<name>/` — and the reaper logs `[premium-auto-deliver] reaped standalone=<name> matches-source=<true|false>` so divergent reaps leave a forensic trail.
35
35
 
36
36
  Plugins are installed and managed through conversation. You can add marketplace plugins (like Stripe) or use {{productName}}'s built-in ones (contacts, memory, Telegram).
37
37
 
@@ -3818,7 +3818,6 @@ import {
3818
3818
  readdirSync as readdirSync2,
3819
3819
  existsSync as existsSync5,
3820
3820
  statSync as statSync2,
3821
- cpSync,
3822
3821
  rmSync
3823
3822
  } from "fs";
3824
3823
  import { createHash as createHash2 } from "crypto";
@@ -3903,59 +3902,48 @@ function walkPremiumBundlesOnDisk() {
3903
3902
  function reapDuplicateFlatPremiumSubs(bundles, stagingRoot, pluginsDir) {
3904
3903
  const TAG = "[premium-auto-deliver]";
3905
3904
  for (const { bundle, subs } of bundles) {
3905
+ const isBundle = existsSync5(join3(stagingRoot, bundle, "BUNDLE.md"));
3906
3906
  for (const sub of subs) {
3907
- const premiumManifest = resolve4(stagingRoot, bundle, "plugins", sub, "PLUGIN.md");
3907
+ const premiumManifest = isBundle ? resolve4(stagingRoot, bundle, "plugins", sub, "PLUGIN.md") : resolve4(stagingRoot, bundle, "PLUGIN.md");
3908
3908
  const flatDir = resolve4(pluginsDir, sub);
3909
3909
  const flatManifest = resolve4(flatDir, "PLUGIN.md");
3910
3910
  if (!existsSync5(premiumManifest) || !existsSync5(flatManifest)) continue;
3911
3911
  const premiumSha = createHash2("sha256").update(readFileSync5(premiumManifest)).digest("hex");
3912
3912
  const flatSha = createHash2("sha256").update(readFileSync5(flatManifest)).digest("hex");
3913
- if (premiumSha === flatSha) {
3913
+ if (isBundle) {
3914
+ if (premiumSha === flatSha) {
3915
+ try {
3916
+ rmSync(flatDir, { recursive: true });
3917
+ console.log(`${TAG} reaped sub=${sub} reason=duplicate-of-premium-tree`);
3918
+ } catch (err) {
3919
+ console.log(`${TAG} reap-failed sub=${sub} err=${err instanceof Error ? err.message : String(err)}`);
3920
+ }
3921
+ } else {
3922
+ console.log(`${TAG} flat-copy-divergent sub=${sub} action=skip-keep`);
3923
+ }
3924
+ } else {
3914
3925
  try {
3915
3926
  rmSync(flatDir, { recursive: true });
3916
- console.log(`${TAG} reaped sub=${sub} reason=duplicate-of-premium-tree`);
3927
+ console.log(`${TAG} reaped standalone=${sub} matches-source=${flatSha === premiumSha}`);
3917
3928
  } catch (err) {
3918
- console.log(`${TAG} reap-failed sub=${sub} err=${err instanceof Error ? err.message : String(err)}`);
3929
+ console.log(`${TAG} reap-failed standalone=${sub} err=${err instanceof Error ? err.message : String(err)}`);
3919
3930
  }
3920
- } else {
3921
- console.log(`${TAG} flat-copy-divergent sub=${sub} action=skip-keep`);
3922
3931
  }
3923
3932
  }
3924
3933
  }
3925
3934
  }
3926
3935
  function autoDeliverPremiumPlugins() {
3927
- const TAG = "[premium-auto-deliver]";
3928
3936
  const bundles = walkPremiumBundles();
3929
3937
  if (bundles.length === 0) return;
3930
3938
  const stagingRoot = resolve4(PLATFORM_ROOT2, "../premium-plugins");
3931
3939
  const pluginsDir = resolve4(PLATFORM_ROOT2, "plugins");
3932
3940
  reapDuplicateFlatPremiumSubs(bundles, stagingRoot, pluginsDir);
3933
- for (const { bundle, subs: _subs } of bundles) {
3934
- const stagingDir = resolve4(stagingRoot, bundle);
3935
- const bundlePath = join3(stagingDir, "BUNDLE.md");
3936
- const isBundle = existsSync5(bundlePath);
3937
- if (isBundle) {
3938
- continue;
3939
- }
3940
- const target = resolve4(pluginsDir, bundle);
3941
- if (existsSync5(resolve4(target, "PLUGIN.md"))) {
3942
- console.log(`${TAG} ${bundle}: already present, skipping`);
3943
- } else {
3944
- try {
3945
- cpSync(stagingDir, target, { recursive: true });
3946
- console.log(`${TAG} ${bundle} (standalone): delivered`);
3947
- } catch (err) {
3948
- console.log(`${TAG} ${bundle}: copy failed: ${err instanceof Error ? err.message : String(err)}`);
3949
- }
3950
- }
3951
- }
3952
3941
  }
3953
3942
  function reconcileEnabledPlugins(accountDir, config, accountId) {
3954
3943
  const TAG = "[premium-auto-deliver]";
3955
3944
  if (!accountDir || !config) return;
3956
3945
  const bundles = walkPremiumBundles();
3957
3946
  const stagingRoot = resolve4(PLATFORM_ROOT2, "../premium-plugins");
3958
- const pluginsDir = resolve4(PLATFORM_ROOT2, "plugins");
3959
3947
  const bundleNames = [];
3960
3948
  const allSubs = [];
3961
3949
  for (const { bundle, subs } of bundles) {
@@ -3963,7 +3951,7 @@ function reconcileEnabledPlugins(accountDir, config, accountId) {
3963
3951
  const bundlePath = join3(stagingRoot, bundle, "BUNDLE.md");
3964
3952
  const isBundle = existsSync5(bundlePath);
3965
3953
  for (const sub of subs) {
3966
- const subManifest = isBundle ? resolve4(stagingRoot, bundle, "plugins", sub, "PLUGIN.md") : resolve4(pluginsDir, sub, "PLUGIN.md");
3954
+ const subManifest = isBundle ? resolve4(stagingRoot, bundle, "plugins", sub, "PLUGIN.md") : resolve4(stagingRoot, bundle, "PLUGIN.md");
3967
3955
  if (!existsSync5(subManifest)) continue;
3968
3956
  allSubs.push(sub);
3969
3957
  }
@@ -14,7 +14,7 @@ import {
14
14
  sanitizeClientCorrId,
15
15
  vncLog,
16
16
  websockifyLog
17
- } from "./chunk-3TRIXQSJ.js";
17
+ } from "./chunk-L2YK2VK3.js";
18
18
  import "./chunk-PFF6I7KP.js";
19
19
 
20
20
  // server/edge.ts
@@ -84,7 +84,7 @@ import {
84
84
  vncLog,
85
85
  walkPremiumBundles,
86
86
  writeAdminUserAndPerson
87
- } from "./chunk-3TRIXQSJ.js";
87
+ } from "./chunk-L2YK2VK3.js";
88
88
  import {
89
89
  __commonJS,
90
90
  __toESM