teamai-cli 0.20.0-beta.3 → 0.20.0-beta.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.
Files changed (2) hide show
  1. package/dist/index.js +35 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10791,7 +10791,8 @@ __export(init_exports, {
10791
10791
  promptForSelfModeAgents: () => promptForSelfModeAgents,
10792
10792
  resolveInheritUserScope: () => resolveInheritUserScope,
10793
10793
  resolveInitRepo: () => resolveInitRepo,
10794
- resolveInitScope: () => resolveInitScope
10794
+ resolveInitScope: () => resolveInitScope,
10795
+ resolveSelfModeSelection: () => resolveSelfModeSelection
10795
10796
  });
10796
10797
  import YAML10 from "yaml";
10797
10798
  import fs14 from "fs";
@@ -11072,34 +11073,60 @@ function buildSelfModeGitignore() {
11072
11073
  ""
11073
11074
  ].join("\n");
11074
11075
  }
11076
+ function resolveSelfModeSelection(indices, detected) {
11077
+ const out = [];
11078
+ const seen = /* @__PURE__ */ new Set();
11079
+ const add = (id) => {
11080
+ if (id && !seen.has(id)) {
11081
+ seen.add(id);
11082
+ out.push(id);
11083
+ }
11084
+ };
11085
+ const pickedAuto = indices.includes(0);
11086
+ if (pickedAuto) {
11087
+ if (detected.length > 0) detected.forEach(add);
11088
+ else add("claude");
11089
+ }
11090
+ for (const i of indices) {
11091
+ if (i === 0) continue;
11092
+ const id = SELF_MODE_AGENT_CHOICES[i - 1];
11093
+ if (id) add(id);
11094
+ }
11095
+ return out;
11096
+ }
11075
11097
  async function promptForSelfModeAgents(options) {
11076
11098
  const explicit = normalizeAgentList(options.agent);
11077
11099
  if (explicit.length > 0) return explicit;
11078
11100
  if (options.silent || options.force || !process.stdin.isTTY) {
11079
11101
  return detectHomeInstalledAgents();
11080
11102
  }
11081
- const choices = SELF_MODE_AGENT_CHOICES.map((id) => {
11103
+ const detected = await detectHomeInstalledAgents();
11104
+ const tools = SELF_MODE_AGENT_CHOICES.map((id) => {
11082
11105
  const meta = KNOWN_AGENTS.find((a) => a.id === id);
11083
11106
  const root = meta?.skillsPath.split("/")[0] ?? `.${id}`;
11084
11107
  return { id, label: meta?.displayName ?? id, root };
11085
11108
  });
11109
+ const detectedLabels = detected.map((id) => tools.find((t) => t.id === id)?.label ?? id).join(", ");
11110
+ const autoLabel = detected.length > 0 ? `Auto \u2014 the AI tools already installed here: ${detectedLabels}` : "Auto \u2014 none detected (will set up Claude Code)";
11086
11111
  console.log("");
11087
11112
  console.log("Which AI tools should teamai set up in this repo?");
11088
11113
  console.log("(creates the skills dir, injects hooks, commits settings to main)");
11089
11114
  console.log("");
11090
- choices.forEach((c, i) => {
11091
- console.log(` ${i + 1}. ${c.label} (${c.root})`);
11115
+ console.log(` 1. ${autoLabel}`);
11116
+ tools.forEach((t, i) => {
11117
+ console.log(` ${i + 2}. ${t.label} (${t.root})`);
11092
11118
  });
11093
11119
  console.log("");
11120
+ const optionCount = tools.length + 1;
11094
11121
  const indices = await askSelection(
11095
- `Select [1-${choices.length}, comma/range, or "all"] (default: 1 = ${choices[0].label}): `,
11096
- choices.length,
11122
+ `Select [1-${optionCount}, comma/range, or "all"] (default: 1 = Auto): `,
11123
+ optionCount,
11097
11124
  false
11098
11125
  );
11099
11126
  if (!indices || indices.length === 0) {
11100
- return ["claude"];
11127
+ return resolveSelfModeSelection([0], detected);
11101
11128
  }
11102
- return indices.map((i) => choices[i].id);
11129
+ return resolveSelfModeSelection(indices, detected);
11103
11130
  }
11104
11131
  async function initSelfRepo(options) {
11105
11132
  log.info("Initializing teamai (single-repo mode)...");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teamai-cli",
3
- "version": "0.20.0-beta.3",
3
+ "version": "0.20.0-beta.4",
4
4
  "description": "TeamAI — the team harness for AI agents (skill sync + shared knowledge base, powered by Git)",
5
5
  "type": "module",
6
6
  "bin": {