teamai-cli 0.20.0-beta.5 → 0.20.0-beta.6

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 +51 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9676,6 +9676,11 @@ async function push(options) {
9676
9676
  const { localConfig, teamConfig } = await autoDetectInit();
9677
9677
  assertNotReadOnly(localConfig, "teamai push");
9678
9678
  if (localConfig.repo.kind === "self") {
9679
+ try {
9680
+ const { migrateSelfModeGitignore: migrateSelfModeGitignore2 } = await Promise.resolve().then(() => (init_init(), init_exports));
9681
+ await migrateSelfModeGitignore2(localConfig);
9682
+ } catch {
9683
+ }
9679
9684
  const { withKnowledgeWorktree: withKnowledgeWorktree2, EmptyRepoError: EmptyRepoError2 } = await Promise.resolve().then(() => (init_reports_branch(), reports_branch_exports));
9680
9685
  try {
9681
9686
  await withKnowledgeWorktree2(localConfig, (wtConfig) => pushCore(wtConfig, teamConfig, options));
@@ -10845,6 +10850,8 @@ __export(init_exports, {
10845
10850
  init: () => init,
10846
10851
  initHttp: () => initHttp,
10847
10852
  initSelfRepo: () => initSelfRepo,
10853
+ migrateSelfModeGitignore: () => migrateSelfModeGitignore,
10854
+ migrateSelfModeGitignoreContent: () => migrateSelfModeGitignoreContent,
10848
10855
  promptForSelfModeAgents: () => promptForSelfModeAgents,
10849
10856
  resolveInheritUserScope: () => resolveInheritUserScope,
10850
10857
  resolveInitRepo: () => resolveInitRepo,
@@ -11136,6 +11143,45 @@ function buildSelfModeGitignore() {
11136
11143
  ""
11137
11144
  ].join("\n");
11138
11145
  }
11146
+ function migrateSelfModeGitignoreContent(content) {
11147
+ const lines = content.split("\n");
11148
+ let changed = false;
11149
+ const filtered = lines.filter((line) => {
11150
+ if (line.trim() === "env") {
11151
+ changed = true;
11152
+ return false;
11153
+ }
11154
+ return true;
11155
+ });
11156
+ const hasEnvLocal = filtered.some((l) => l.trim() === "env.local");
11157
+ if (!hasEnvLocal) {
11158
+ const envShIdx = filtered.findIndex((l) => l.trim() === "env.sh");
11159
+ if (envShIdx >= 0) {
11160
+ filtered.splice(envShIdx + 1, 0, "env.local");
11161
+ } else {
11162
+ const lastNonEmpty = filtered.reduce((acc, l, i) => l.trim() ? i : acc, -1);
11163
+ filtered.splice(lastNonEmpty + 1, 0, "env.local");
11164
+ }
11165
+ changed = true;
11166
+ }
11167
+ return { changed, content: filtered.join("\n") };
11168
+ }
11169
+ async function migrateSelfModeGitignore(localConfig) {
11170
+ if (localConfig.repo.kind !== "self" || !localConfig.projectRoot) return;
11171
+ const gitignorePath = path38.join(localConfig.projectRoot, ".teamai", ".gitignore");
11172
+ try {
11173
+ const current = await readFileSafe(gitignorePath);
11174
+ if (current === null) return;
11175
+ const { changed, content } = migrateSelfModeGitignoreContent(current);
11176
+ if (!changed) return;
11177
+ await writeFile(gitignorePath, content);
11178
+ log.info(
11179
+ "Updated .teamai/.gitignore so team env vars (.teamai/env/env.yaml) can be shared \u2014 please `git add .teamai/.gitignore` and commit it."
11180
+ );
11181
+ } catch (e) {
11182
+ log.debug(`[self-mode] gitignore migration skipped: ${e.message}`);
11183
+ }
11184
+ }
11139
11185
  function resolveSelfModeSelection(indices, detected) {
11140
11186
  const out = [];
11141
11187
  const seen = /* @__PURE__ */ new Set();
@@ -14648,6 +14694,11 @@ async function refreshTeamRepo(localConfig) {
14648
14694
  return { label: "HTTP (report/sync delivery)", version: null, reportingOnly: true };
14649
14695
  }
14650
14696
  if (localConfig.repo.kind === "self") {
14697
+ try {
14698
+ const { migrateSelfModeGitignore: migrateSelfModeGitignore2 } = await Promise.resolve().then(() => (init_init(), init_exports));
14699
+ await migrateSelfModeGitignore2(localConfig);
14700
+ } catch {
14701
+ }
14651
14702
  let version3 = null;
14652
14703
  try {
14653
14704
  version3 = await getHeadRev(localConfig.repo.localPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teamai-cli",
3
- "version": "0.20.0-beta.5",
3
+ "version": "0.20.0-beta.6",
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": {