@ryodeushii/ai-product-team-agents 0.1.1 → 0.1.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/package.json +1 -1
  2. package/src/setup/index.ts +14 -10
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@ryodeushii/ai-product-team-agents",
4
- "version": "0.1.1",
4
+ "version": "0.1.2",
5
5
  "repository": {
6
6
  "url": "https://github.com/ryodeushii/ai-product-team-agents"
7
7
  },
@@ -22,6 +22,8 @@ interface SetupOptions {
22
22
  docsDir?: string;
23
23
  autonomy?: string;
24
24
  overwrite?: boolean;
25
+ /** When true (--update mode), skip re-installing the OpenCode plugin */
26
+ skipPluginInstall?: boolean;
25
27
  }
26
28
 
27
29
  export async function setupProject(
@@ -29,7 +31,7 @@ export async function setupProject(
29
31
  frameworkRoot: string,
30
32
  options: SetupOptions,
31
33
  ): Promise<void> {
32
- const { projectName, overwrite = false } = options;
34
+ const { projectName, overwrite = false, skipPluginInstall = false } = options;
33
35
 
34
36
  const write = async (dest: string, content: string) => {
35
37
  if (
@@ -155,7 +157,10 @@ export async function setupProject(
155
157
  await installClaudeHook(join(projectRoot, ".claude/settings.json"));
156
158
 
157
159
  // .opencode/plugins/agents-auto-update.ts — OpenCode session.created hook
158
- await installOpenCodePlugin(projectRoot, frameworkRoot);
160
+ // Skipped during --update to preserve user modifications.
161
+ if (!skipPluginInstall) {
162
+ await installOpenCodePlugin(projectRoot, frameworkRoot);
163
+ }
159
164
  }
160
165
 
161
166
  async function installOpenCodePlugin(
@@ -164,11 +169,6 @@ async function installOpenCodePlugin(
164
169
  ): Promise<void> {
165
170
  const pluginDir = join(projectRoot, ".opencode/plugins");
166
171
  const pluginDest = join(pluginDir, "agents-auto-update.ts");
167
- const exists = await lstat(pluginDest).then(
168
- () => true,
169
- () => false,
170
- );
171
- if (exists) return;
172
172
  await mkdir(pluginDir, { recursive: true });
173
173
  const src = await readFile(
174
174
  join(frameworkRoot, "templates/opencode-plugin.ts"),
@@ -279,9 +279,13 @@ if (import.meta.main) {
279
279
  console.log(`agents framework removed from ${projectRoot}`);
280
280
  } else {
281
281
  const projectName = args[0] ?? projectRoot.split("/").pop() ?? "project";
282
- const overwrite =
283
- flags.includes("--overwrite") || flags.includes("--update");
284
- await setupProject(projectRoot, frameworkRoot, { projectName, overwrite });
282
+ const isUpdate = flags.includes("--update");
283
+ const overwrite = flags.includes("--overwrite") || isUpdate;
284
+ await setupProject(projectRoot, frameworkRoot, {
285
+ projectName,
286
+ overwrite,
287
+ skipPluginInstall: isUpdate,
288
+ });
285
289
  console.log(`agents framework set up in ${projectRoot}`);
286
290
  }
287
291
  }