@ascenda-one/github-collector 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
|
@@ -1113,8 +1113,8 @@ var require_tokenStore = __commonJS({
|
|
|
1113
1113
|
var fs = __importStar(__require("fs"));
|
|
1114
1114
|
var os = __importStar(__require("os"));
|
|
1115
1115
|
var path = __importStar(__require("path"));
|
|
1116
|
-
function ascendaHome() {
|
|
1117
|
-
return process.env.ASCENDA_HOME ?? path.join(
|
|
1116
|
+
function ascendaHome(home = os.homedir()) {
|
|
1117
|
+
return process.env.ASCENDA_HOME ?? path.join(home, ".ascenda");
|
|
1118
1118
|
}
|
|
1119
1119
|
function defaultTokenFilePath2(toolInstallationId) {
|
|
1120
1120
|
return path.join(ascendaHome(), "tokens", sanitizeFilePart(toolInstallationId));
|
|
@@ -2397,10 +2397,10 @@ var require_salt = __commonJS({
|
|
|
2397
2397
|
exports.hashWithMachineSalt = hashWithMachineSalt;
|
|
2398
2398
|
var crypto = __importStar(__require("crypto"));
|
|
2399
2399
|
var fs = __importStar(__require("fs"));
|
|
2400
|
-
var os = __importStar(__require("os"));
|
|
2401
2400
|
var path = __importStar(__require("path"));
|
|
2401
|
+
var tokenStore_1 = require_tokenStore();
|
|
2402
2402
|
function machineSaltFilePath() {
|
|
2403
|
-
return path.join(
|
|
2403
|
+
return path.join((0, tokenStore_1.ascendaHome)(), "salt");
|
|
2404
2404
|
}
|
|
2405
2405
|
var cache = /* @__PURE__ */ new Map();
|
|
2406
2406
|
function readOrCreateMachineSalt(saltFilePath = machineSaltFilePath()) {
|
|
@@ -2672,10 +2672,10 @@ var require_hookAdapter = __commonJS({
|
|
|
2672
2672
|
exports.MissingInstallationIdError = MissingInstallationIdError;
|
|
2673
2673
|
function resolveCliAgentInstallationId(toolType, identity = {}) {
|
|
2674
2674
|
const fromEnv = process.env.ASCENDA_TOOL_INSTALLATION_ID?.trim();
|
|
2675
|
-
if (fromEnv)
|
|
2675
|
+
if (fromEnv && belongsToToolType(toolType, fromEnv))
|
|
2676
2676
|
return { toolInstallationId: qualify(toolType, fromEnv), source: "env" };
|
|
2677
2677
|
const fromCredentials = identity.host ? (0, credentials_1.readHostCredentials)(identity.host)?.toolInstallationId?.trim() : void 0;
|
|
2678
|
-
if (fromCredentials)
|
|
2678
|
+
if (fromCredentials && belongsToToolType(toolType, fromCredentials))
|
|
2679
2679
|
return { toolInstallationId: qualify(toolType, fromCredentials), source: "credentials" };
|
|
2680
2680
|
const candidates = (0, tokenStore_1.listPersistedToolInstallationIds)(toolType);
|
|
2681
2681
|
if (candidates.length === 1)
|
|
@@ -2685,6 +2685,9 @@ var require_hookAdapter = __commonJS({
|
|
|
2685
2685
|
function defaultSetupCommand(host) {
|
|
2686
2686
|
return host ? `npx @ascenda-one/${host.replace(/_cli$/, "")}-hooks setup` : "the agent's setup command";
|
|
2687
2687
|
}
|
|
2688
|
+
function belongsToToolType(toolType, value) {
|
|
2689
|
+
return !value.includes(":") || value.startsWith(`${toolType}:`);
|
|
2690
|
+
}
|
|
2688
2691
|
function qualify(toolType, value) {
|
|
2689
2692
|
return value.includes(":") ? value : `${toolType}:${value}`;
|
|
2690
2693
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"publishConfig": { "access": "public" },
|
|
3
3
|
"name": "@ascenda-one/github-collector",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.21",
|
|
5
5
|
"description": "Code-forge collaboration collector for Ascenda work telemetry — first-person review and pull-request signals.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|