@ascenda-one/claude-code-hooks 0.1.19 → 0.1.21
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.
- package/dist/cli.js +9 -6
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1120,8 +1120,8 @@ var require_tokenStore = __commonJS({
|
|
|
1120
1120
|
var fs3 = __importStar(__require("fs"));
|
|
1121
1121
|
var os2 = __importStar(__require("os"));
|
|
1122
1122
|
var path3 = __importStar(__require("path"));
|
|
1123
|
-
function ascendaHome3() {
|
|
1124
|
-
return process.env.ASCENDA_HOME ?? path3.join(
|
|
1123
|
+
function ascendaHome3(home = os2.homedir()) {
|
|
1124
|
+
return process.env.ASCENDA_HOME ?? path3.join(home, ".ascenda");
|
|
1125
1125
|
}
|
|
1126
1126
|
function defaultTokenFilePath4(toolInstallationId) {
|
|
1127
1127
|
return path3.join(ascendaHome3(), "tokens", sanitizeFilePart(toolInstallationId));
|
|
@@ -2404,10 +2404,10 @@ var require_salt = __commonJS({
|
|
|
2404
2404
|
exports.hashWithMachineSalt = hashWithMachineSalt;
|
|
2405
2405
|
var crypto2 = __importStar(__require("crypto"));
|
|
2406
2406
|
var fs3 = __importStar(__require("fs"));
|
|
2407
|
-
var os2 = __importStar(__require("os"));
|
|
2408
2407
|
var path3 = __importStar(__require("path"));
|
|
2408
|
+
var tokenStore_1 = require_tokenStore();
|
|
2409
2409
|
function machineSaltFilePath() {
|
|
2410
|
-
return path3.join(
|
|
2410
|
+
return path3.join((0, tokenStore_1.ascendaHome)(), "salt");
|
|
2411
2411
|
}
|
|
2412
2412
|
var cache = /* @__PURE__ */ new Map();
|
|
2413
2413
|
function readOrCreateMachineSalt(saltFilePath = machineSaltFilePath()) {
|
|
@@ -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