agentplugged 1.0.3 → 1.0.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.
@@ -20035,6 +20035,17 @@ function compareSemver(a, b) {
20035
20035
  }
20036
20036
  return 0;
20037
20037
  }
20038
+ /** The engine version `method.yaml` pins in the repository's main working folder, if readable. */
20039
+ async function mainCheckoutPin(files) {
20040
+ try {
20041
+ const text = await files.readMainCheckoutText?.(METHOD_CONFIG_PATH);
20042
+ if (text === void 0) return void 0;
20043
+ const version = parseDocument(text).toJS()?.engine_version;
20044
+ return SemverSchema.safeParse(version).success ? version : void 0;
20045
+ } catch {
20046
+ return;
20047
+ }
20048
+ }
20038
20049
  /**
20039
20050
  * Checks, before anything is written, that the running engine may work on this product:
20040
20051
  * a `format_version` newer than the engine knows stops with `UPGRADE_REQUIRED`, an older one with
@@ -20077,6 +20088,11 @@ async function checkEngine(files, options) {
20077
20088
  overridden: false,
20078
20089
  older: false
20079
20090
  };
20091
+ if (!options.upgrade && !options.engineAny && compareSemver(options.engineVersion, pinned) > 0 && await mainCheckoutPin(files) === options.engineVersion) return {
20092
+ pinned,
20093
+ overridden: false,
20094
+ older: false
20095
+ };
20080
20096
  const details = {
20081
20097
  path: METHOD_CONFIG_PATH,
20082
20098
  pinned,
package/dist/main.js CHANGED
@@ -6299,6 +6299,28 @@ var NodeWorkspaceFiles = class {
6299
6299
  async readBytes(path) {
6300
6300
  return new Uint8Array(await readFile(this.resolve(path)));
6301
6301
  }
6302
+ async readMainCheckoutText(path) {
6303
+ try {
6304
+ const target = this.resolve(path);
6305
+ for (let top = this.root;; top = dirname(top)) {
6306
+ const marker = join(top, ".git");
6307
+ const info = await stat(marker).catch(() => void 0);
6308
+ if (info?.isDirectory() === true) return void 0;
6309
+ if (info?.isFile() === true) {
6310
+ const named = /^gitdir:\s*(.+?)\s*$/m.exec(await readFile(marker, "utf8"))?.[1];
6311
+ if (named === void 0) return void 0;
6312
+ const own = resolve(top, named);
6313
+ const common = resolve(own, (await readFile(join(own, "commondir"), "utf8")).trim());
6314
+ if (basename(common) !== ".git") return void 0;
6315
+ const main = join(dirname(common), relative(top, this.root));
6316
+ return await readFile(join(main, relative(this.root, target)), "utf8");
6317
+ }
6318
+ if (dirname(top) === top) return void 0;
6319
+ }
6320
+ } catch {
6321
+ return;
6322
+ }
6323
+ }
6302
6324
  /**
6303
6325
  * Writes to a temporary file next to the target, then renames it over the target. A symbolic
6304
6326
  * link is followed, so the real file is replaced and the creator's link is kept.
@@ -6788,9 +6810,11 @@ const REQUEST_TIMEOUT_MS = 3e4;
6788
6810
  /** `CredentialBackend` through a PowerShell helper, started on the first request. */
6789
6811
  var PowerShellCredentials = class PowerShellCredentials {
6790
6812
  #powershell;
6813
+ #startupTimeoutMs;
6791
6814
  #session;
6792
- constructor(powershell) {
6815
+ constructor(powershell, startupTimeoutMs) {
6793
6816
  this.#powershell = powershell;
6817
+ this.#startupTimeoutMs = startupTimeoutMs;
6794
6818
  }
6795
6819
  /**
6796
6820
  * Starts the helper now. Rejects with `PowerShellUnavailableError` when PowerShell is absent, in
@@ -6799,14 +6823,14 @@ var PowerShellCredentials = class PowerShellCredentials {
6799
6823
  static async open(options = {}) {
6800
6824
  const powershell = options.powershell ?? windowsPowerShellPath();
6801
6825
  if (powershell === void 0) throw new PowerShellUnavailableError("Windows PowerShell was not found");
6802
- const backend = new PowerShellCredentials(powershell);
6826
+ const backend = new PowerShellCredentials(powershell, options.startupTimeoutMs ?? STARTUP_TIMEOUT_MS);
6803
6827
  await backend.#ensure();
6804
6828
  return backend;
6805
6829
  }
6806
6830
  /** The running helper; a new one when the last stopped. */
6807
6831
  async #ensure() {
6808
6832
  for (let attempt = 0; attempt < 2; attempt += 1) {
6809
- this.#session ??= Session.start(this.#powershell, STARTUP_TIMEOUT_MS).catch((error) => {
6833
+ this.#session ??= Session.start(this.#powershell, this.#startupTimeoutMs).catch((error) => {
6810
6834
  this.#session = void 0;
6811
6835
  throw error;
6812
6836
  });
@@ -6963,22 +6987,22 @@ async function nativeBackend() {
6963
6987
  }
6964
6988
  let system;
6965
6989
  /**
6966
- * The system keychain of this machine. On Windows, the PowerShell helper first (no native module
6967
- * to load, which Smart App Control may refuse), then `@napi-rs/keyring` when PowerShell cannot be
6968
- * used; elsewhere `@napi-rs/keyring`. Chosen once per process, kept once it works.
6990
+ * The system keychain of this machine: `@napi-rs/keyring`, and on Windows the PowerShell helper
6991
+ * when the native module cannot be loaded (Smart App Control may refuse it). The native module
6992
+ * comes first: it answers at once, where the helper compiles itself in each new process. Chosen
6993
+ * once per process, kept once it works.
6969
6994
  */
6970
6995
  function systemCredentials() {
6971
6996
  system ??= (async () => {
6972
- let powershell;
6973
- if (process.platform === "win32") try {
6974
- return await PowerShellCredentials.open();
6975
- } catch (error) {
6976
- powershell = error;
6977
- }
6978
6997
  try {
6979
6998
  return await nativeBackend();
6980
6999
  } catch (error) {
6981
- throw powershell === void 0 ? error : unavailableKeychainError(nativeCause(error), powershell);
7000
+ if (process.platform !== "win32") throw error;
7001
+ try {
7002
+ return await PowerShellCredentials.open();
7003
+ } catch (powershell) {
7004
+ throw unavailableKeychainError(nativeCause(error), powershell);
7005
+ }
6982
7006
  }
6983
7007
  })().catch((error) => {
6984
7008
  system = void 0;
@@ -7000,8 +7024,8 @@ async function explained(operation) {
7000
7024
  }
7001
7025
  /**
7002
7026
  * `KeyStore` in the system keychain (Windows Credential Manager, macOS Keychain, the Secret
7003
- * Service on Linux): through a PowerShell helper on Windows (`systemCredentials`) and
7004
- * `@napi-rs/keyring` elsewhere, or when PowerShell cannot be used. Tests pass their own service
7027
+ * Service on Linux): through `@napi-rs/keyring`, or on Windows a PowerShell helper when the
7028
+ * native module cannot be loaded (`systemCredentials`). Tests pass their own service
7005
7029
  * name and delete their entries afterwards: the machine's real entries are never touched.
7006
7030
  */
7007
7031
  var NodeKeyStore = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentplugged",
3
- "version": "1.0.3",
3
+ "version": "1.0.6",
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.3",
51
- "@agentplugged/adapters-tools": "1.0.3",
52
- "@agentplugged/core": "1.0.3",
53
- "@agentplugged/crypto": "1.0.3",
54
- "@agentplugged/i18n": "1.0.3",
55
- "@agentplugged/mcp": "1.0.3",
50
+ "@agentplugged/adapters-git": "1.0.6",
51
+ "@agentplugged/adapters-tools": "1.0.6",
52
+ "@agentplugged/core": "1.0.6",
53
+ "@agentplugged/crypto": "1.0.6",
54
+ "@agentplugged/i18n": "1.0.6",
55
+ "@agentplugged/mcp": "1.0.6",
56
56
  "@agentplugged/method": "0.0.0",
57
- "@agentplugged/protocol": "1.0.3",
57
+ "@agentplugged/protocol": "1.0.6",
58
58
  "@biomejs/biome": "~2.5.15",
59
59
  "@modelcontextprotocol/client": "~2.3.0",
60
60
  "@types/node": "^24.19.1",