crewbee 0.1.3 → 0.1.4

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 CHANGED
@@ -2,10 +2,25 @@
2
2
 
3
3
  [English](README.md) | [简体中文](README.zh-CN.md)
4
4
 
5
+ <p align="center">
6
+ <img src="assets/crewbee-icon.png" alt="CrewBee icon" width="220" />
7
+ </p>
8
+
9
+ <p align="center"><strong>Team-first agent engineering for real host runtimes.</strong></p>
10
+
5
11
  CrewBee is a **Team-first** Agent Team framework.
6
12
 
7
13
  It provides a Team-oriented way to define, project, and adapt agent systems to host runtimes, turning scattered prompts, rules, and collaboration conventions into maintainable, portable, and runnable Team assets.
8
14
 
15
+ **Current focus:** make Team-based agent systems portable, composable, and actually runnable inside OpenCode.
16
+
17
+ ## Why CrewBee
18
+
19
+ - **Team-first, not prompt-first** — model leaders, members, workflow, and policy as durable engineering assets.
20
+ - **Host-agnostic core** — keep Team definitions independent from any single runtime.
21
+ - **Projection-based runtime model** — map one Team definition into a concrete host safely and repeatably.
22
+ - **OpenCode-ready today** — includes the full plugin, agent projection, install, doctor, and release path.
23
+
9
24
  The current version already delivers a complete **CrewBee → OpenCode** MVP path:
10
25
 
11
26
  * host-agnostic Team / Agent definitions
@@ -19,6 +34,12 @@ The current version already delivers a complete **CrewBee → OpenCode** MVP pat
19
34
  >
20
35
  > **CrewBee = Agent Team definition framework + Runtime Projection layer + host adapter layer (currently OpenCode)**
21
36
 
37
+ ## Quick Links
38
+
39
+ - [Installation Guide](docs/guide/installation.md)
40
+ - [Release Guide](docs/guide/release.md)
41
+ - [Architecture](docs/architecture.md)
42
+
22
43
  ---
23
44
 
24
45
  ## Table of Contents
package/README.zh-CN.md CHANGED
@@ -2,10 +2,25 @@
2
2
 
3
3
  [English](README.md) | [简体中文](README.zh-CN.md)
4
4
 
5
+ <p align="center">
6
+ <img src="assets/crewbee-icon.png" alt="CrewBee icon" width="220" />
7
+ </p>
8
+
9
+ <p align="center"><strong>面向真实宿主运行时的 Team-first Agent 工程框架。</strong></p>
10
+
5
11
  CrewBee 是一个 **Team-first(团队优先)** 的 Agent Team 框架。
6
12
 
7
13
  它提供一套面向 Team 的定义、投影与宿主适配方式,用来把零散的 Agent prompt、规则和协作约定沉淀为可维护、可迁移、可运行的 Team 资产。
8
14
 
15
+ **当前重点:**让 Team 级 Agent 系统能够被稳定定义、跨宿主投影,并真正运行在 OpenCode 中。
16
+
17
+ ## 为什么是 CrewBee
18
+
19
+ - **Team-first,而不是 prompt-first** —— Leader、members、workflow、policy 都是可维护的工程对象。
20
+ - **宿主无关核心** —— Team 定义不被某一个运行时绑死。
21
+ - **基于 Projection 的运行模型** —— 一套 Team 定义可以稳定映射到具体宿主。
22
+ - **今天就能接入 OpenCode** —— 已具备插件、agent 投影、安装、doctor 和 release 链路。
23
+
9
24
  当前版本已经打通了 **CrewBee → OpenCode** 的完整 MVP 链路:
10
25
 
11
26
  * Team / Agent 宿主无关定义
@@ -19,6 +34,12 @@ CrewBee 是一个 **Team-first(团队优先)** 的 Agent Team 框架。
19
34
  >
20
35
  > **CrewBee = Agent Team 定义框架 + Runtime Projection 层 + 宿主适配层(当前为 OpenCode)**
21
36
 
37
+ ## 快速入口
38
+
39
+ - [安装指南](docs/guide/installation.md)
40
+ - [发布指南](docs/guide/release.md)
41
+ - [架构文档](docs/architecture.md)
42
+
22
43
  ---
23
44
 
24
45
  ## 目录
@@ -303,7 +324,7 @@ User-level install
303
324
  当前真实可运行的文件型 Team 结构是:
304
325
 
305
326
  ```text
306
- AgentTeams/<TeamName>/
327
+ teams/<team-name>/
307
328
  team.manifest.yaml
308
329
  team.policy.yaml
309
330
  <agent>.agent.md
@@ -1,4 +1,4 @@
1
- export declare const TEAM_CONFIG_ROOT = "AgentTeams";
1
+ export declare const TEAM_CONFIG_ROOT = "teams";
2
2
  export declare const CREWBEE_CONFIG_FILE = "crewbee.json";
3
3
  export declare const BUILTIN_CODING_TEAM_ID = "coding-team";
4
4
  export declare const DEFAULT_EMBEDDED_TEAM_PRIORITY = 0;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/agent-teams/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAClD,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AACpD,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAChD,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C,eAAO,MAAM,iBAAiB,0BAAoC,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/agent-teams/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,UAAU,CAAC;AACxC,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAClD,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AACpD,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAChD,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C,eAAO,MAAM,iBAAiB,0BAAoC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EMBEDDED_TEAM_IDS = exports.DEFAULT_FILE_TEAM_PRIORITY = exports.DEFAULT_EMBEDDED_TEAM_PRIORITY = exports.BUILTIN_CODING_TEAM_ID = exports.CREWBEE_CONFIG_FILE = exports.TEAM_CONFIG_ROOT = void 0;
4
- exports.TEAM_CONFIG_ROOT = "AgentTeams";
4
+ exports.TEAM_CONFIG_ROOT = "teams";
5
5
  exports.CREWBEE_CONFIG_FILE = "crewbee.json";
6
6
  exports.BUILTIN_CODING_TEAM_ID = "coding-team";
7
7
  exports.DEFAULT_EMBEDDED_TEAM_PRIORITY = 0;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/agent-teams/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,YAAY,CAAC;AAChC,QAAA,mBAAmB,GAAG,cAAc,CAAC;AACrC,QAAA,sBAAsB,GAAG,aAAa,CAAC;AACvC,QAAA,8BAA8B,GAAG,CAAC,CAAC;AACnC,QAAA,0BAA0B,GAAG,CAAC,CAAC;AAE/B,QAAA,iBAAiB,GAAG,CAAC,8BAAsB,CAAU,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/agent-teams/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,OAAO,CAAC;AAC3B,QAAA,mBAAmB,GAAG,cAAc,CAAC;AACrC,QAAA,sBAAsB,GAAG,aAAa,CAAC;AACvC,QAAA,8BAA8B,GAAG,CAAC,CAAC;AACnC,QAAA,0BAA0B,GAAG,CAAC,CAAC;AAE/B,QAAA,iBAAiB,GAAG,CAAC,8BAAsB,CAAU,CAAC"}
@@ -32,7 +32,7 @@ function parseVersionOptions(argv) {
32
32
  async function runVersionCommand(argv, io, context) {
33
33
  try {
34
34
  const options = parseVersionOptions(argv);
35
- const installedPackageRoot = (0, install_1.resolveInstalledPackageRoot)((0, install_1.resolveInstallRoot)(options.installRoot));
35
+ const installedPackageRoot = (0, install_1.detectInstalledPackageRoot)((0, install_1.resolveInstallRoot)(options.installRoot));
36
36
  const current = {
37
37
  packageName: (0, package_version_1.readPackageName)(context.packageRoot),
38
38
  version: (0, package_version_1.readPackageVersion)(context.packageRoot),
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/cli/version.ts"],"names":[],"mappings":";;AA0CA,8CAwCC;AAhFD,wCAA6E;AAC7E,gEAAiF;AAOjF,SAAS,mBAAmB,CAAC,IAAc;IACzC,IAAI,WAA+B,CAAC;IACpC,IAAI,IAAI,GAAG,KAAK,CAAC;IAEjB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC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C,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/install/doctor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE3D,wBAAsB,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAwB7E"}
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/install/doctor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE3D,wBAAsB,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAyB7E"}
@@ -13,13 +13,14 @@ async function runDoctor(options) {
13
13
  const configPath = (0, install_root_1.resolveOpenCodeConfigPath)(options.configPath);
14
14
  const installRoot = (0, install_root_1.resolveInstallRoot)(options.installRoot);
15
15
  const expectedPluginEntry = (0, plugin_entry_1.createCanonicalPluginEntry)(installRoot);
16
- const installedPackageRoot = (0, plugin_entry_1.resolveInstalledPackageRoot)(installRoot);
16
+ const installedPackageRoot = (0, plugin_entry_1.detectInstalledPackageRoot)(installRoot);
17
17
  const currentPluginEntries = (0, config_writer_1.findCrewBeePluginEntries)((0, config_writer_1.readOpenCodeConfig)(configPath).config);
18
18
  const hasWorkspaceManifest = (0, node_fs_1.existsSync)(node_path_1.default.join(installRoot, "package.json"));
19
+ const hasPackageCacheRoot = (0, node_fs_1.existsSync)(node_path_1.default.join(installRoot, "packages"));
19
20
  const hasInstalledPackage = (0, node_fs_1.existsSync)(node_path_1.default.join(installedPackageRoot, "package.json"));
20
- const hasPluginFile = (0, node_fs_1.existsSync)((0, plugin_entry_1.resolveInstalledPluginPath)(installRoot));
21
+ const hasPluginFile = (0, node_fs_1.existsSync)((0, plugin_entry_1.detectInstalledPluginPath)(installRoot));
21
22
  const configMatchesCanonical = currentPluginEntries.length === 1 && currentPluginEntries[0] === expectedPluginEntry;
22
- const healthy = hasWorkspaceManifest && hasInstalledPackage && hasPluginFile && configMatchesCanonical;
23
+ const healthy = (hasWorkspaceManifest || hasPackageCacheRoot) && hasInstalledPackage && hasPluginFile && configMatchesCanonical;
23
24
  return {
24
25
  configMatchesCanonical,
25
26
  configPath,
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../../src/install/doctor.ts"],"names":[],"mappings":";;;;;AAQA,8BAwBC;AAhCD,qCAAqC;AACrC,0DAA6B;AAE7B,mDAA+E;AAC/E,iDAA+E;AAC/E,iDAAqH;AAG9G,KAAK,UAAU,SAAS,CAAC,OAAsB;IACpD,MAAM,UAAU,GAAG,IAAA,wCAAyB,EAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,IAAA,iCAAkB,EAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC5D,MAAM,mBAAmB,GAAG,IAAA,yCAA0B,EAAC,WAAW,CAAC,CAAC;IACpE,MAAM,oBAAoB,GAAG,IAAA,0CAA2B,EAAC,WAAW,CAAC,CAAC;IACtE,MAAM,oBAAoB,GAAG,IAAA,wCAAwB,EAAC,IAAA,kCAAkB,EAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;IAC7F,MAAM,oBAAoB,GAAG,IAAA,oBAAU,EAAC,mBAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC;IAChF,MAAM,mBAAmB,GAAG,IAAA,oBAAU,EAAC,mBAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,cAAc,CAAC,CAAC,CAAC;IACxF,MAAM,aAAa,GAAG,IAAA,oBAAU,EAAC,IAAA,yCAA0B,EAAC,WAAW,CAAC,CAAC,CAAC;IAC1E,MAAM,sBAAsB,GAAG,oBAAoB,CAAC,MAAM,KAAK,CAAC,IAAI,oBAAoB,CA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BAAU,EAAC,IAAA,wCAAyB,EAAC,WAAW,CAAC,CAAC,CAAC;IACzE,MAAM,sBAAsB,GAAG,oBAAoB,CAAC,MAAM,KAAK,CAAC,IAAI,oBAAoB,CAAC,CAAC,CAAC,KAAK,mBAAmB,CAAC;IACpH,MAAM,OAAO,GAAG,CAAC,oBAAoB,IAAI,mBAAmB,CAAC,IAAI,mBAAmB,IAAI,aAAa,IAAI,sBAAsB,CAAC;IAEhI,OAAO;QACL,sBAAsB;QACtB,UAAU;QACV,oBAAoB;QACpB,mBAAmB;QACnB,mBAAmB;QACnB,aAAa;QACb,oBAAoB;QACpB,OAAO;QACP,oBAAoB;QACpB,WAAW;KACZ,CAAC;AACJ,CAAC"}
@@ -4,7 +4,7 @@ export { installCrewBee } from "./install";
4
4
  export { resolveOpenCodeConfigPath, resolveOpenCodeConfigRoot, resolveInstallRoot } from "./install-root";
5
5
  export { resolveLocalTarballPath } from "./local-tarball";
6
6
  export { installLocalTarball, installRegistryPackage, uninstallCrewBeePackage } from "./package-manager";
7
- export { assertInstalledPluginExists, createCanonicalPluginEntry, resolveInstalledPackageRoot, resolveInstalledPluginPath, } from "./plugin-entry";
7
+ export { assertInstalledPluginExists, createCanonicalPluginEntry, detectInstalledPackageRoot, detectInstalledPluginPath, resolveInstalledPackageRoot, resolveInstalledPackageRootCandidates, resolveInstalledPluginPath, } from "./plugin-entry";
8
8
  export type { DoctorOptions, DoctorResult, InstallCommandContext, InstallCommandOptions, InstallResult, InstallSource, UninstallOptions, UninstallResult } from "./types";
9
9
  export { uninstallCrewBee } from "./uninstall";
10
10
  export { ensureInstallWorkspace } from "./workspace";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/install/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAChI,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,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gBAAgB,CAAC;AACxB,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1K,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ensureInstallWorkspace = exports.uninstallCrewBee = exports.resolveInstalledPluginPath = exports.resolveInstalledPackageRoot = exports.createCanonicalPluginEntry = exports.assertInstalledPluginExists = exports.uninstallCrewBeePackage = exports.installRegistryPackage = exports.installLocalTarball = exports.resolveLocalTarballPath = exports.resolveInstallRoot = exports.resolveOpenCodeConfigRoot = exports.resolveOpenCodeConfigPath = exports.installCrewBee = exports.runDoctor = exports.writeOpenCodeConfig = exports.upsertCrewBeePluginEntry = exports.removeCrewBeePluginEntries = exports.readOpenCodeConfig = void 0;
3
+ exports.ensureInstallWorkspace = exports.uninstallCrewBee = exports.resolveInstalledPluginPath = exports.resolveInstalledPackageRootCandidates = exports.resolveInstalledPackageRoot = exports.detectInstalledPluginPath = exports.detectInstalledPackageRoot = exports.createCanonicalPluginEntry = exports.assertInstalledPluginExists = exports.uninstallCrewBeePackage = exports.installRegistryPackage = exports.installLocalTarball = exports.resolveLocalTarballPath = exports.resolveInstallRoot = exports.resolveOpenCodeConfigRoot = exports.resolveOpenCodeConfigPath = exports.installCrewBee = exports.runDoctor = exports.writeOpenCodeConfig = exports.upsertCrewBeePluginEntry = exports.removeCrewBeePluginEntries = exports.readOpenCodeConfig = void 0;
4
4
  var config_writer_1 = require("./config-writer");
5
5
  Object.defineProperty(exports, "readOpenCodeConfig", { enumerable: true, get: function () { return config_writer_1.readOpenCodeConfig; } });
6
6
  Object.defineProperty(exports, "removeCrewBeePluginEntries", { enumerable: true, get: function () { return config_writer_1.removeCrewBeePluginEntries; } });
@@ -23,7 +23,10 @@ Object.defineProperty(exports, "uninstallCrewBeePackage", { enumerable: true, ge
23
23
  var plugin_entry_1 = require("./plugin-entry");
24
24
  Object.defineProperty(exports, "assertInstalledPluginExists", { enumerable: true, get: function () { return plugin_entry_1.assertInstalledPluginExists; } });
25
25
  Object.defineProperty(exports, "createCanonicalPluginEntry", { enumerable: true, get: function () { return plugin_entry_1.createCanonicalPluginEntry; } });
26
+ Object.defineProperty(exports, "detectInstalledPackageRoot", { enumerable: true, get: function () { return plugin_entry_1.detectInstalledPackageRoot; } });
27
+ Object.defineProperty(exports, "detectInstalledPluginPath", { enumerable: true, get: function () { return plugin_entry_1.detectInstalledPluginPath; } });
26
28
  Object.defineProperty(exports, "resolveInstalledPackageRoot", { enumerable: true, get: function () { return plugin_entry_1.resolveInstalledPackageRoot; } });
29
+ Object.defineProperty(exports, "resolveInstalledPackageRootCandidates", { enumerable: true, get: function () { return plugin_entry_1.resolveInstalledPackageRootCandidates; } });
27
30
  Object.defineProperty(exports, "resolveInstalledPluginPath", { enumerable: true, get: function () { return plugin_entry_1.resolveInstalledPluginPath; } });
28
31
  var uninstall_1 = require("./uninstall");
29
32
  Object.defineProperty(exports, "uninstallCrewBee", { enumerable: true, get: function () { return uninstall_1.uninstallCrewBee; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/install/index.ts"],"names":[],"mappings":";;;AAAA,iDAAgI;AAAvH,mHAAA,kBAAkB,OAAA;AAAE,2HAAA,0BAA0B,OAAA;AAAE,yHAAA,wBAAwB,OAAA;AAAE,oHAAA,mBAAmB,OAAA;AACtG,mCAAqC;AAA5B,mGAAA,SAAS,OAAA;AAClB,qCAA2C;AAAlC,yGAAA,cAAc,OAAA;AACvB,+CAA0G;AAAjG,yHAAA,yBAAyB,OAAA;AAAE,yHAAA,yBAAyB,OAAA;AAAE,kHAAA,kBAAkB,OAAA;AACjF,iDAA0D;AAAjD,wHAAA,uBAAuB,OAAA;AAChC,qDAAyG;AAAhG,sHAAA,mBAAmB,OAAA;AAAE,yHAAA,sBAAsB,OAAA;AAAE,0HAAA,uBAAuB,OAAA;AAC7E,+CAKwB;AAJtB,2HAAA,2BAA2B,OAAA;AAC3B,0HAAA,0BAA0B,OAAA;AAC1B,2HAAA,2BAA2B,OAAA;AAC3B,0HAAA,0BAA0B,OAAA;AAG5B,yCAA+C;AAAtC,6GAAA,gBAAgB,OAAA;AACzB,yCAAqD;AAA5C,mHAAA,sBAAsB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/install/index.ts"],"names":[],"mappings":";;;AAAA,iDAAgI;AAAvH,mHAAA,kBAAkB,OAAA;AAAE,2HAAA,0BAA0B,OAAA;AAAE,yHAAA,wBAAwB,OAAA;AAAE,oHAAA,mBAAmB,OAAA;AACtG,mCAAqC;AAA5B,mGAAA,SAAS,OAAA;AAClB,qCAA2C;AAAlC,yGAAA,cAAc,OAAA;AACvB,+CAA0G;AAAjG,yHAAA,yBAAyB,OAAA;AAAE,yHAAA,yBAAyB,OAAA;AAAE,kHAAA,kBAAkB,OAAA;AACjF,iDAA0D;AAAjD,wHAAA,uBAAuB,OAAA;AAChC,qDAAyG;AAAhG,sHAAA,mBAAmB,OAAA;AAAE,yHAAA,sBAAsB,OAAA;AAAE,0HAAA,uBAAuB,OAAA;AAC7E,+CAQwB;AAPtB,2HAAA,2BAA2B,OAAA;AAC3B,0HAAA,0BAA0B,OAAA;AAC1B,0HAAA,0BAA0B,OAAA;AAC1B,yHAAA,yBAAyB,OAAA;AACzB,2HAAA,2BAA2B,OAAA;AAC3B,qIAAA,qCAAqC,OAAA;AACrC,0HAAA,0BAA0B,OAAA;AAG5B,yCAA+C;AAAtC,6GAAA,gBAAgB,OAAA;AACzB,yCAAqD;AAA5C,mHAAA,sBAAsB,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"package-manager.d.ts","sourceRoot":"","sources":["../../../src/install/package-manager.ts"],"names":[],"mappings":"AAwCA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IACzC,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,IAAI,CAMP;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,IAAI,CAEP;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAyBV"}
1
+ {"version":3,"file":"package-manager.d.ts","sourceRoot":"","sources":["../../../src/install/package-manager.ts"],"names":[],"mappings":"AA0CA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IACzC,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,IAAI,CAMP;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,IAAI,CAEP;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAsCV"}
@@ -9,6 +9,7 @@ exports.uninstallCrewBeePackage = uninstallCrewBeePackage;
9
9
  const node_fs_1 = require("node:fs");
10
10
  const node_path_1 = __importDefault(require("node:path"));
11
11
  const node_child_process_1 = require("node:child_process");
12
+ const plugin_entry_1 = require("./plugin-entry");
12
13
  function runNpmCommand(args) {
13
14
  const result = (0, node_child_process_1.spawnSync)("npm", args, {
14
15
  shell: process.platform === "win32",
@@ -46,18 +47,30 @@ function installRegistryPackage(input) {
46
47
  installPackageSpec(input);
47
48
  }
48
49
  function uninstallCrewBeePackage(input) {
49
- const installedPackageRoot = node_path_1.default.join(input.installRoot, "node_modules", "crewbee");
50
- if (!(0, node_fs_1.existsSync)(installedPackageRoot)) {
50
+ const installedPackageRoot = node_path_1.default.join(input.installRoot, "node_modules", plugin_entry_1.CREWBEE_PACKAGE_NAME);
51
+ const packageCacheRoot = node_path_1.default.join(input.installRoot, "packages");
52
+ const cachedPackageDirs = (0, node_fs_1.existsSync)(packageCacheRoot)
53
+ ? (0, node_fs_1.readdirSync)(packageCacheRoot, { withFileTypes: true })
54
+ .filter((entry) => entry.isDirectory() && entry.name.startsWith(`${plugin_entry_1.CREWBEE_PACKAGE_NAME}@`))
55
+ .map((entry) => node_path_1.default.join(packageCacheRoot, entry.name))
56
+ : [];
57
+ if (!(0, node_fs_1.existsSync)(installedPackageRoot) && cachedPackageDirs.length === 0) {
51
58
  return false;
52
59
  }
53
60
  if (input.dryRun) {
54
61
  return true;
55
62
  }
63
+ if (cachedPackageDirs.length > 0) {
64
+ for (const cachedPackageDir of cachedPackageDirs) {
65
+ (0, node_fs_1.rmSync)(cachedPackageDir, { recursive: true, force: true });
66
+ }
67
+ return true;
68
+ }
56
69
  const exitCode = runNpmCommand([
57
70
  "uninstall",
58
71
  "--prefix",
59
72
  input.installRoot,
60
- "crewbee",
73
+ plugin_entry_1.CREWBEE_PACKAGE_NAME,
61
74
  "--no-audit",
62
75
  "--no-fund",
63
76
  ]);
@@ -1 +1 @@
1
- {"version":3,"file":"package-manager.js","sourceRoot":"","sources":["../../../src/install/package-manager.ts"],"names":[],"mappings":";;;;;AAwCA,kDAUC;AAED,wDAMC;AAED,0DA4BC;AAxFD,qCAAqC;AACrC,0DAA6B;AAC7B,2DAA+C;AAE/C,SAAS,aAAa,CAAC,IAAc;IACnC,MAAM,MAAM,GAAG,IAAA,8BAAS,EAAC,KAAK,EAAE,IAA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AAG,aAAa,CAAC;QAC7B,WAAW;QACX,UAAU;QACV,KAAK,CAAC,WAAW;QACjB,SAAS;QACT,YAAY;QACZ,WAAW;KACZ,CAAC,CAAC;IAEH,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,uCAAuC,QAAQ,GAAG,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"package-manager.js","sourceRoot":"","sources":["../../../src/install/package-manager.ts"],"names":[],"mappings":";;;;;AA0CA,kDAUC;AAED,wDAMC;AAED,0DAyCC;AAvGD,qCAA0D;AAC1D,0DAA6B;AAC7B,2DAA+C;AAE/C,iDAAsD;AAEtD,SAAS,aAAa,CAAC,IAAc;IACnC,MAAM,MAAM,GAAG,IAAA,8BAAS,EAAC,KAAK,EAAE,IAAI,EAAE;QACpC,KAAK,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO;QACnC,KAAK,EAAE,SAAS;KACjB,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,MAAM,MAAM,CAAC,KAAK,CAAC;IACrB,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,kBAAkB,CAAC,KAI3B;IACC,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjB,OAAO;IACT,CAAC;IAED,MAAM,QAAQ,GAAG,aAAa,CAAC;QAC7B,SAAS;QACT,UAAU;QACV,KAAK,CAAC,WAAW;QACjB,KAAK,CAAC,WAAW;QACjB,YAAY;QACZ,WAAW;KACZ,CAAC,CAAC;IAEH,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,qCAAqC,QAAQ,GAAG,CAAC,CAAC;IACpE,CAAC;AACH,CAAC;AAED,SAAgB,mBAAmB,CAAC,KAInC;IACC,kBAAkB,CAAC;QACjB,MAAM,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AAC,gBAAgB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,QAAQ,GAAG,aAAa,CAAC;QAC7B,WAAW;QACX,UAAU;QACV,KAAK,CAAC,WAAW;QACjB,mCAAoB;QACpB,YAAY;QACZ,WAAW;KACZ,CAAC,CAAC;IAEH,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,uCAAuC,QAAQ,GAAG,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,6 +1,9 @@
1
1
  export declare const CREWBEE_PACKAGE_NAME = "crewbee";
2
2
  export declare function resolveInstalledPackageRoot(installRoot: string): string;
3
3
  export declare function resolveInstalledPluginPath(installRoot: string): string;
4
+ export declare function resolveInstalledPackageRootCandidates(installRoot: string): string[];
5
+ export declare function detectInstalledPackageRoot(installRoot: string): string;
6
+ export declare function detectInstalledPluginPath(installRoot: string): string;
4
7
  export declare function createCanonicalPluginEntry(_installRoot?: string): string;
5
8
  export declare function assertInstalledPluginExists(installRoot: string): void;
6
9
  //# sourceMappingURL=plugin-entry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-entry.d.ts","sourceRoot":"","sources":["../../../src/install/plugin-entry.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEvE;AAED,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,0BAA0B,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAMrE"}
1
+ {"version":3,"file":"plugin-entry.d.ts","sourceRoot":"","sources":["../../../src/install/plugin-entry.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEvE;AAED,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,qCAAqC,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAgBnF;AAED,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAQtE;AAED,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,wBAAgB,0BAA0B,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAMrE"}
@@ -6,6 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CREWBEE_PACKAGE_NAME = void 0;
7
7
  exports.resolveInstalledPackageRoot = resolveInstalledPackageRoot;
8
8
  exports.resolveInstalledPluginPath = resolveInstalledPluginPath;
9
+ exports.resolveInstalledPackageRootCandidates = resolveInstalledPackageRootCandidates;
10
+ exports.detectInstalledPackageRoot = detectInstalledPackageRoot;
11
+ exports.detectInstalledPluginPath = detectInstalledPluginPath;
9
12
  exports.createCanonicalPluginEntry = createCanonicalPluginEntry;
10
13
  exports.assertInstalledPluginExists = assertInstalledPluginExists;
11
14
  const node_fs_1 = require("node:fs");
@@ -17,11 +20,36 @@ function resolveInstalledPackageRoot(installRoot) {
17
20
  function resolveInstalledPluginPath(installRoot) {
18
21
  return node_path_1.default.join(resolveInstalledPackageRoot(installRoot), "opencode-plugin.mjs");
19
22
  }
23
+ function resolveInstalledPackageRootCandidates(installRoot) {
24
+ const candidates = [];
25
+ const packageCacheRoot = node_path_1.default.join(installRoot, "packages");
26
+ if ((0, node_fs_1.existsSync)(packageCacheRoot)) {
27
+ for (const entry of (0, node_fs_1.readdirSync)(packageCacheRoot, { withFileTypes: true })) {
28
+ if (!entry.isDirectory() || !entry.name.startsWith(`${exports.CREWBEE_PACKAGE_NAME}@`)) {
29
+ continue;
30
+ }
31
+ candidates.push(node_path_1.default.join(packageCacheRoot, entry.name, "node_modules", exports.CREWBEE_PACKAGE_NAME));
32
+ }
33
+ }
34
+ candidates.push(resolveInstalledPackageRoot(installRoot));
35
+ return candidates;
36
+ }
37
+ function detectInstalledPackageRoot(installRoot) {
38
+ for (const candidate of resolveInstalledPackageRootCandidates(installRoot)) {
39
+ if ((0, node_fs_1.existsSync)(node_path_1.default.join(candidate, "package.json"))) {
40
+ return candidate;
41
+ }
42
+ }
43
+ return resolveInstalledPackageRoot(installRoot);
44
+ }
45
+ function detectInstalledPluginPath(installRoot) {
46
+ return node_path_1.default.join(detectInstalledPackageRoot(installRoot), "opencode-plugin.mjs");
47
+ }
20
48
  function createCanonicalPluginEntry(_installRoot) {
21
49
  return exports.CREWBEE_PACKAGE_NAME;
22
50
  }
23
51
  function assertInstalledPluginExists(installRoot) {
24
- const pluginPath = resolveInstalledPluginPath(installRoot);
52
+ const pluginPath = detectInstalledPluginPath(installRoot);
25
53
  if (!(0, node_fs_1.existsSync)(pluginPath)) {
26
54
  throw new Error(`CrewBee plugin entry does not exist at ${pluginPath}.`);
27
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-entry.js","sourceRoot":"","sources":["../../../src/install/plugin-entry.ts"],"names":[],"mappings":";;;;;;AAKA,kEAEC;AAED,gEAEC;AAED,gEAEC;AAED,kEAMC;AAvBD,qCAAqC;AACrC,0DAA6B;AAEhB,QAAA,oBAAoB,GAAG,SAAS,CAAC;AAE9C,SAAgB,2BAA2B,CAAC,WAAmB;IAC7D,OAAO,mBAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,4BAAoB,CAAC,CAAC;AACtE,CAAC;AAED,SAAgB,0BAA0B,CAAC,WAA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
1
1
  {
2
2
  "name": "crewbee",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "A Team-first Agent System",
5
5
  "license": "MIT",
6
6
  "repository": {