teamai-cli 0.21.0-beta.1 → 0.21.0-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.
Files changed (2) hide show
  1. package/dist/index.js +57 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9379,8 +9379,9 @@ __export(builtin_agents_exports, {
9379
9379
  });
9380
9380
  import fs12 from "fs";
9381
9381
  import path28 from "path";
9382
+ import { fileURLToPath as fileURLToPath3 } from "url";
9382
9383
  function getBuiltinAgentsDir() {
9383
- const distDir = path28.dirname(new URL(import.meta.url).pathname);
9384
+ const distDir = path28.dirname(fileURLToPath3(import.meta.url));
9384
9385
  return path28.join(distDir, "..", "agents");
9385
9386
  }
9386
9387
  async function deployBuiltinAgents(teamConfig, localConfig, options) {
@@ -10932,6 +10933,7 @@ async function push(options) {
10932
10933
  async function pushCore(localConfig, teamConfig, options) {
10933
10934
  const selfMode = localConfig.repo.kind === "self";
10934
10935
  const scopeLabel = localConfig.scope;
10936
+ let pendingTeamConfig = null;
10935
10937
  if (!selfMode) {
10936
10938
  const pullSpin = spinner("Pulling latest changes...").start();
10937
10939
  try {
@@ -10941,8 +10943,19 @@ async function pushCore(localConfig, teamConfig, options) {
10941
10943
  pullSpin.fail("Cannot push: team repo path is not a dedicated git root. Run `teamai init` to re-clone the team repo before pushing.");
10942
10944
  return;
10943
10945
  }
10946
+ const yamlPath = path34.join(repoPath, "teamai.yaml");
10947
+ const workingContent = await readFileSafe(yamlPath);
10948
+ if (workingContent !== null) {
10949
+ const committed = await getFileContentAtRev(repoPath, "HEAD", "teamai.yaml");
10950
+ if (committed === null || committed.toString() !== workingContent) {
10951
+ pendingTeamConfig = workingContent;
10952
+ }
10953
+ }
10944
10954
  await resetToCleanMaster(git, repoPath);
10945
10955
  await pullRepo(repoPath);
10956
+ if (pendingTeamConfig !== null) {
10957
+ await writeFile(yamlPath, pendingTeamConfig);
10958
+ }
10946
10959
  pullSpin.succeed("Up to date");
10947
10960
  } catch (e) {
10948
10961
  pullSpin.warn(`Pull failed: ${e.message}`);
@@ -11049,6 +11062,10 @@ async function pushCore(localConfig, teamConfig, options) {
11049
11062
  allItems.push(matchedItem);
11050
11063
  }
11051
11064
  if (allItems.length === 0) {
11065
+ if (pendingTeamConfig !== null) {
11066
+ await pushTeamConfigOnly(localConfig, teamConfig, options);
11067
+ return;
11068
+ }
11052
11069
  log.info("No new or modified resources to push");
11053
11070
  return;
11054
11071
  }
@@ -11185,7 +11202,8 @@ async function pushCore(localConfig, teamConfig, options) {
11185
11202
  localConfig.repo.localPath,
11186
11203
  sweeperCandidates
11187
11204
  );
11188
- const gitFiles = [.../* @__PURE__ */ new Set([...pushedFiles, ...existingSweepers])];
11205
+ const configFiles = pendingTeamConfig !== null ? ["teamai.yaml"] : [];
11206
+ const gitFiles = [.../* @__PURE__ */ new Set([...pushedFiles, ...existingSweepers, ...configFiles])];
11189
11207
  const branchName = generateBranchName(localConfig.username);
11190
11208
  const commitMsg = `[teamai] Push ${selectedItems.length} resource(s) from ${localConfig.username}`;
11191
11209
  const hasChanges = await pushRepoBranch(
@@ -11240,6 +11258,43 @@ ${selectedItems.map((i) => `- [${i.type}] ${i.name}`).join("\n")}`
11240
11258
  }
11241
11259
  await saveStateForScope(state, localConfig.scope, localConfig.projectRoot);
11242
11260
  }
11261
+ async function pushTeamConfigOnly(localConfig, teamConfig, options) {
11262
+ console.log("");
11263
+ console.log("Found team config change to push:");
11264
+ console.log(" - teamai.yaml");
11265
+ console.log("");
11266
+ if (options.dryRun) {
11267
+ log.info("Dry run \u2014 no changes made");
11268
+ return;
11269
+ }
11270
+ const pushSpin = spinner("Pushing team config...").start();
11271
+ const branchName = generateBranchName(localConfig.username);
11272
+ const commitMsg = `[teamai] Update team config from ${localConfig.username}`;
11273
+ try {
11274
+ const hasChanges = await pushRepoBranch(
11275
+ localConfig.repo.localPath,
11276
+ commitMsg,
11277
+ ["teamai.yaml"],
11278
+ branchName
11279
+ );
11280
+ if (!hasChanges) {
11281
+ pushSpin.succeed("No changes to push (config already up to date)");
11282
+ return;
11283
+ }
11284
+ pushSpin.succeed(`Pushed branch ${branchName}`);
11285
+ await createPrWithFallback(
11286
+ teamConfig,
11287
+ localConfig,
11288
+ branchName,
11289
+ commitMsg,
11290
+ "Updated team config (teamai.yaml)"
11291
+ );
11292
+ await checkoutMaster(localConfig.repo.localPath);
11293
+ } catch (e) {
11294
+ pushSpin.fail(`Push failed: ${e.message}`);
11295
+ return;
11296
+ }
11297
+ }
11243
11298
  var SELF_KNOWLEDGE_SCAN_KEY;
11244
11299
  var init_push = __esm({
11245
11300
  "src/push.ts"() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teamai-cli",
3
- "version": "0.21.0-beta.1",
3
+ "version": "0.21.0-beta.2",
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": {