agentplugged 1.0.0 → 1.0.1

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.
@@ -19775,9 +19775,9 @@ const syncCommand = defineCommand({
19775
19775
  flavor: claudeFlavor(loaded.config.permissions?.mode),
19776
19776
  current: claudeSettings
19777
19777
  }, has("claude-code") ? {
19778
- deny: unique([...denyRules(permissionInputs), ...claudeRules.deny]),
19779
- allow: claudeRules.allow,
19780
- ask: claudeRules.ask
19778
+ deny: claudeWritable(unique([...denyRules(permissionInputs), ...claudeRules.deny])),
19779
+ allow: claudeWritable(claudeRules.allow),
19780
+ ask: claudeWritable(claudeRules.ask)
19781
19781
  } : {}, {
19782
19782
  deny: manifest.permissions,
19783
19783
  ...previousLists[CLAUDE_SETTINGS_PATH]
@@ -19878,6 +19878,14 @@ const CODEX_HOME_DENY = [
19878
19878
  function unique(rules) {
19879
19879
  return [...new Set(rules)];
19880
19880
  }
19881
+ /**
19882
+ * The rules Claude Code's settings can hold: a backslash before the closing parenthesis escapes it
19883
+ * there, so such a rule would be malformed (the `C:/` spelling of the same root stays). The
19884
+ * engine's own guards keep them: they read the rules themselves.
19885
+ */
19886
+ function claudeWritable(rules) {
19887
+ return rules.filter((rule) => !rule.endsWith("\\)"));
19888
+ }
19881
19889
  /** The tool a generated path belongs to, for the summary. */
19882
19890
  function groupOf(path) {
19883
19891
  if (path.startsWith(".claude/") || path === "CLAUDE.md") return "claude-code";
package/dist/main.js CHANGED
@@ -510,6 +510,48 @@ function withoutPart(files, part) {
510
510
  };
511
511
  }
512
512
  //#endregion
513
+ //#region ../../packages/adapters-git/dist/atomic-rename.js
514
+ /** The pauses, in milliseconds, before each new try: about a second and a half in all. */
515
+ const RETRY_DELAYS_MS = [
516
+ 25,
517
+ 50,
518
+ 100,
519
+ 200,
520
+ 400,
521
+ 700
522
+ ];
523
+ /** The errors Windows gives when another program (an AI tool, an editor, an antivirus) holds a file. */
524
+ const HELD_CODES = /* @__PURE__ */ new Set([
525
+ "EPERM",
526
+ "EBUSY",
527
+ "EACCES"
528
+ ]);
529
+ /**
530
+ * Renames `from` over `to`, as the last step of an atomic write. On Windows a file another program
531
+ * holds open cannot be replaced, and that is most often brief: the rename is tried again a few times
532
+ * with growing pauses (about a second and a half in all). When the file stays held, the error names
533
+ * the file and says that another program holds it. Elsewhere, and for any other error, the first
534
+ * error is the answer.
535
+ */
536
+ async function renameWithRetry(from, to, options = {}) {
537
+ const move = options.rename ?? rename;
538
+ const windows = (options.platform ?? process.platform) === "win32";
539
+ const wait = options.wait ?? ((ms) => new Promise((done) => setTimeout(done, ms)));
540
+ for (let attempt = 0;; attempt++) try {
541
+ await move(from, to);
542
+ return;
543
+ } catch (error) {
544
+ const code = error?.code;
545
+ if (!windows || code === void 0 || !HELD_CODES.has(code)) throw error;
546
+ const pause = RETRY_DELAYS_MS[attempt];
547
+ if (pause === void 0) throw new AgentPluggedError(ErrorCode.UNEXPECTED, "error.file_in_use", {
548
+ path: to,
549
+ code
550
+ });
551
+ await wait(pause);
552
+ }
553
+ }
554
+ //#endregion
513
555
  //#region ../../packages/adapters-git/dist/git-process.js
514
556
  /** Variables that would point `git` at another repository, index or object store. */
515
557
  const REPOSITORY_VARIABLES = [
@@ -3943,7 +3985,7 @@ var GitStateStore = class {
3943
3985
  this.#memoryWrites += 1;
3944
3986
  const temporary = `${target}.${process.pid}.${this.#memoryWrites}.tmp`;
3945
3987
  await writeFile(temporary, `${text}\n`, "utf8");
3946
- await rename(temporary, target);
3988
+ await renameWithRetry(temporary, target);
3947
3989
  }
3948
3990
  async backupRemote(options) {
3949
3991
  await this.#repository();
@@ -6095,7 +6137,7 @@ var NodeCodexUserConfig = class {
6095
6137
  encoding: "utf8",
6096
6138
  mode: 384
6097
6139
  });
6098
- await rename(temporary, target);
6140
+ await renameWithRetry(temporary, target);
6099
6141
  } finally {
6100
6142
  await rm(temporary, { force: true }).catch(() => void 0);
6101
6143
  }
@@ -6163,7 +6205,7 @@ var NodeCommonMemory = class {
6163
6205
  mode: 384,
6164
6206
  flag: "wx"
6165
6207
  });
6166
- await rename(temporary, target);
6208
+ await renameWithRetry(temporary, target);
6167
6209
  } catch (error) {
6168
6210
  await rm(temporary, { force: true });
6169
6211
  throw error;
@@ -6278,7 +6320,7 @@ var NodeWorkspaceFiles = class {
6278
6320
  encoding: "utf8",
6279
6321
  flag: "wx"
6280
6322
  } : { flag: "wx" });
6281
- await rename(temp, target);
6323
+ await renameWithRetry(temp, target);
6282
6324
  } catch (error) {
6283
6325
  await rm(temp, { force: true });
6284
6326
  throw error;
@@ -6936,7 +6978,7 @@ var NodeRootPinStore = class {
6936
6978
  } finally {
6937
6979
  await handle.close();
6938
6980
  }
6939
- await rename(temporary, target);
6981
+ await renameWithRetry(temporary, target);
6940
6982
  await syncFolder(folder);
6941
6983
  this.#onFlush?.("folder");
6942
6984
  } catch (error) {
@@ -7208,6 +7250,7 @@ const en = {
7208
7250
  "error.unknown_command": "Unknown command \"{command}\".",
7209
7251
  "error.invalid_arguments": "Invalid arguments: {reason}",
7210
7252
  "error.unexpected": "Unexpected error: {reason}",
7253
+ "error.file_in_use": "{path} is held open by another program (your AI tool, your editor or your antivirus): nothing was changed. Close it or wait a moment, then run the command again.",
7211
7254
  "error.engine_version_mismatch": "{path} pins engine {pinned}, and this engine is {engine_version}: nothing was written. Run `npx agentplugged@{pinned} {command}`, or `npx agentplugged init --upgrade-engine` to pin {engine_version}, or add `--engine-any` to run anyway.",
7212
7255
  "error.upgrade_required": "{path} uses format {format_version}, newer than this engine knows (format {supported}, engine {engine_version}): nothing was written. Run `npx agentplugged@{version} {command}`.",
7213
7256
  "cli.warning.engine_any": "Warning: {path} pins engine {pinned}, but engine {engine_version} runs anyway (--engine-any). Run `npx agentplugged init --upgrade-engine` to pin it.",
@@ -9127,6 +9170,7 @@ const fr = {
9127
9170
  "error.unknown_command": "Commande inconnue « {command} ».",
9128
9171
  "error.invalid_arguments": "Arguments invalides : {reason}",
9129
9172
  "error.unexpected": "Erreur inattendue : {reason}",
9173
+ "error.file_in_use": "{path} est tenu ouvert par un autre programme (ton outil d'IA, ton éditeur ou ton antivirus) : rien n'a été modifié. Ferme-le ou attends un instant, puis relance la commande.",
9130
9174
  "error.engine_version_mismatch": "{path} épingle le moteur {pinned}, et ce moteur est en {engine_version} : rien n'a été écrit. Lance `npx agentplugged@{pinned} {command}`, ou `npx agentplugged init --upgrade-engine` pour épingler {engine_version}, ou ajoute `--engine-any` pour passer outre.",
9131
9175
  "error.upgrade_required": "{path} utilise le format {format_version}, plus récent que celui que connaît ce moteur (format {supported}, moteur {engine_version}) : rien n'a été écrit. Lance `npx agentplugged@{version} {command}`.",
9132
9176
  "cli.warning.engine_any": "Attention : {path} épingle le moteur {pinned}, mais le moteur {engine_version} s'exécute quand même (--engine-any). Lance `npx agentplugged init --upgrade-engine` pour l'épingler.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentplugged",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Install the AgentPlugged method in a repository and make its agents callable from Claude Code, Codex, Antigravity/Gemini CLI and Cursor.",
5
5
  "releaseSummary": "The engine updates itself: your session moves to a newer version between two calls, with nothing to reconnect.",
6
6
  "license": "FSL-1.1-MIT",
@@ -47,14 +47,14 @@
47
47
  "koffi": "~3.3.2"
48
48
  },
49
49
  "devDependencies": {
50
- "@agentplugged/adapters-git": "1.0.0",
51
- "@agentplugged/adapters-tools": "1.0.0",
52
- "@agentplugged/core": "1.0.0",
53
- "@agentplugged/crypto": "1.0.0",
54
- "@agentplugged/i18n": "1.0.0",
55
- "@agentplugged/mcp": "1.0.0",
50
+ "@agentplugged/adapters-git": "1.0.1",
51
+ "@agentplugged/adapters-tools": "1.0.1",
52
+ "@agentplugged/core": "1.0.1",
53
+ "@agentplugged/crypto": "1.0.1",
54
+ "@agentplugged/i18n": "1.0.1",
55
+ "@agentplugged/mcp": "1.0.1",
56
56
  "@agentplugged/method": "0.0.0",
57
- "@agentplugged/protocol": "1.0.0",
57
+ "@agentplugged/protocol": "1.0.1",
58
58
  "@biomejs/biome": "~2.5.15",
59
59
  "@modelcontextprotocol/client": "~2.3.0",
60
60
  "@types/node": "^24.19.1",