@ascenda-one/claude-code-hooks 0.1.19 → 0.1.20

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/cli.js +5 -2
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -2679,10 +2679,10 @@ var require_hookAdapter = __commonJS({
2679
2679
  exports.MissingInstallationIdError = MissingInstallationIdError2;
2680
2680
  function resolveCliAgentInstallationId(toolType, identity = {}) {
2681
2681
  const fromEnv = process.env.ASCENDA_TOOL_INSTALLATION_ID?.trim();
2682
- if (fromEnv)
2682
+ if (fromEnv && belongsToToolType(toolType, fromEnv))
2683
2683
  return { toolInstallationId: qualify(toolType, fromEnv), source: "env" };
2684
2684
  const fromCredentials = identity.host ? (0, credentials_1.readHostCredentials)(identity.host)?.toolInstallationId?.trim() : void 0;
2685
- if (fromCredentials)
2685
+ if (fromCredentials && belongsToToolType(toolType, fromCredentials))
2686
2686
  return { toolInstallationId: qualify(toolType, fromCredentials), source: "credentials" };
2687
2687
  const candidates = (0, tokenStore_1.listPersistedToolInstallationIds)(toolType);
2688
2688
  if (candidates.length === 1)
@@ -2692,6 +2692,9 @@ var require_hookAdapter = __commonJS({
2692
2692
  function defaultSetupCommand(host) {
2693
2693
  return host ? `npx @ascenda-one/${host.replace(/_cli$/, "")}-hooks setup` : "the agent's setup command";
2694
2694
  }
2695
+ function belongsToToolType(toolType, value) {
2696
+ return !value.includes(":") || value.startsWith(`${toolType}:`);
2697
+ }
2695
2698
  function qualify(toolType, value) {
2696
2699
  return value.includes(":") ? value : `${toolType}:${value}`;
2697
2700
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "publishConfig": { "access": "public" },
3
3
  "name": "@ascenda-one/claude-code-hooks",
4
- "version": "0.1.19",
4
+ "version": "0.1.20",
5
5
  "description": "Claude Code hooks adapter for Ascenda AI workload telemetry.",
6
6
  "repository": {
7
7
  "type": "git",