@ascenda-one/github-collector 0.1.36 → 0.1.38
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 +228 -13
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -506,6 +506,24 @@ var require_metricKeys = __commonJS({
|
|
|
506
506
|
cacheReadTokens: { family: "context", readBy: ["backend"], backendAliases: ["cacheReadTokens", "cache_read_tokens"], unit: "tokens" },
|
|
507
507
|
queuedPrompts: { family: "counts", readBy: ["backend"], backendAliases: ["queuedPrompts", "queued_prompts"] },
|
|
508
508
|
linesChangedBucket: { family: "edits", readBy: ["backend"], backendAliases: ["linesChangedBucket", "lines_changed_bucket"] },
|
|
509
|
+
gitAction: {
|
|
510
|
+
family: "git",
|
|
511
|
+
readBy: ["backend"],
|
|
512
|
+
backendAliases: ["gitAction", "git_action"],
|
|
513
|
+
note: "The live hooks set it on a shell event; the git extractor sets it to commit on each commit event it emits."
|
|
514
|
+
},
|
|
515
|
+
repoKey: {
|
|
516
|
+
family: "repo",
|
|
517
|
+
readBy: ["backend"],
|
|
518
|
+
backendAliases: ["repoKey", "repo_key"],
|
|
519
|
+
note: "Same derivation as the live hooks (forgeRepoKey of the github.com remote), so a commit joins a session and a pull request. Absent for other forges, a checkout with no remote, and when repo keys are turned off."
|
|
520
|
+
},
|
|
521
|
+
branchKey: {
|
|
522
|
+
family: "repo",
|
|
523
|
+
readBy: ["backend"],
|
|
524
|
+
backendAliases: ["branchKey", "branch_key"],
|
|
525
|
+
note: "forgeBranchKey of the repository and the branch a commit is reachable from. Absent on the default branch, like the live hooks."
|
|
526
|
+
},
|
|
509
527
|
// ── Read by the local handoff only ──────────────────────────────────────
|
|
510
528
|
activeMinutes: { family: "session", readBy: ["handoff"], unit: "minutes" },
|
|
511
529
|
syntheticPromptLines: {
|
|
@@ -728,6 +746,23 @@ var require_metricKeys = __commonJS({
|
|
|
728
746
|
backendAliases: ["toolName", "tool_name"],
|
|
729
747
|
note: "Set per ai_tool_call_started event by #43's extractors. Declared diagnostic until 23 Sep 2026 on the belief that nothing resolved it server-side; two backend readers do \u2014 one to see a sub-agent dispatch, one composing per-tool metrics. This is the inverse of the mismatch this module was written for: contextUsagePercent was a key nobody read, and a key a reader resolves without being declared drops nothing, so it has no symptom at all. What it costs is that readBy stops being a true census of what the server sees, which is what you consult when deciding what a collector should stop sending. Registered after the fact in the first place: #38 and #43 merged past each other, and the union caught it on the next compile \u2014 metaLines all over again."
|
|
730
748
|
},
|
|
749
|
+
activity: {
|
|
750
|
+
family: "git",
|
|
751
|
+
readBy: ["diagnostic"],
|
|
752
|
+
note: "Names what an editor_activity row is. The git extractor sends git_commit; the backend cadence reader keys on gitAction, and this is how a person reading the row tells it from an editor event."
|
|
753
|
+
},
|
|
754
|
+
isMergeCommit: { family: "git", readBy: ["diagnostic"], note: "True when the commit has more than one parent. A merge commit carries no size figures: they would only restate the commits it merged." },
|
|
755
|
+
authoredByMe: { family: "git", readBy: ["diagnostic"], note: "Whether the commit's author email matches the git config email on this machine. The extractor emits only commits where it does, so today this is always true; the key exists so a wider read can be told apart." },
|
|
756
|
+
linesAddedBucket: { family: "git", readBy: ["diagnostic"], note: "Lines added by a commit, in the same buckets as linesChangedBucket." },
|
|
757
|
+
linesRemovedBucket: { family: "git", readBy: ["diagnostic"], note: "Lines removed by a commit, in the same buckets as linesChangedBucket." },
|
|
758
|
+
gitReposRead: { family: "reading", readBy: ["diagnostic"], note: "Git extractor epoch: repositories whose history was read." },
|
|
759
|
+
gitReposSkipped: { family: "reading", readBy: ["diagnostic"], note: "Git extractor epoch: repositories a transcript named that could not be read (deleted, not a repository, git failed)." },
|
|
760
|
+
gitReposWithoutIdentity: { family: "reading", readBy: ["diagnostic"], note: "Git extractor epoch: repositories with no user.email in git config, so no commit could be called mine and none was emitted." },
|
|
761
|
+
compactionOrdinal: {
|
|
762
|
+
family: "context",
|
|
763
|
+
readBy: ["diagnostic"],
|
|
764
|
+
note: "Claude Code only: 1-based position of this compaction within its session, counting manual and auto together. Present on per-compaction context_compression_* rows. Older imports wrote one row per session and trigger at the session's last timestamp, with no ordinal and compactionCount set to the session total. Where a session has ordinal rows, a reader should ignore its rows without one."
|
|
765
|
+
},
|
|
731
766
|
toolResultCount: { family: "tools", readBy: ["diagnostic"] },
|
|
732
767
|
toolResultErrorCount: { family: "outcome", readBy: ["diagnostic"] },
|
|
733
768
|
unknownBubbles: { family: "reading", readBy: ["diagnostic"] },
|
|
@@ -1143,7 +1178,7 @@ var require_collectorVersion = __commonJS({
|
|
|
1143
1178
|
exports.COLLECTOR_VERSION = exports.UNRELEASED_COLLECTOR_VERSION = void 0;
|
|
1144
1179
|
exports.describeCollectorVersion = describeCollectorVersion;
|
|
1145
1180
|
exports.UNRELEASED_COLLECTOR_VERSION = "unreleased";
|
|
1146
|
-
exports.COLLECTOR_VERSION = "0.1.
|
|
1181
|
+
exports.COLLECTOR_VERSION = "0.1.38" ? "0.1.38" : exports.UNRELEASED_COLLECTOR_VERSION;
|
|
1147
1182
|
function describeCollectorVersion(version = exports.COLLECTOR_VERSION) {
|
|
1148
1183
|
return version === exports.UNRELEASED_COLLECTOR_VERSION ? `${version} (built from a checkout, not a release)` : version;
|
|
1149
1184
|
}
|
|
@@ -3899,6 +3934,40 @@ var require_hookAdapter = __commonJS({
|
|
|
3899
3934
|
}
|
|
3900
3935
|
});
|
|
3901
3936
|
|
|
3937
|
+
// ../packages/tool-kit/out/confirmLinks.js
|
|
3938
|
+
var require_confirmLinks = __commonJS({
|
|
3939
|
+
"../packages/tool-kit/out/confirmLinks.js"(exports) {
|
|
3940
|
+
"use strict";
|
|
3941
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3942
|
+
exports.pairingConfirmUrl = pairingConfirmUrl;
|
|
3943
|
+
exports.pairingConfirmLines = pairingConfirmLines;
|
|
3944
|
+
exports.studyJoinConfirmUrl = studyJoinConfirmUrl;
|
|
3945
|
+
function pairingConfirmUrl(qrUrl) {
|
|
3946
|
+
return isHttps(qrUrl) ? qrUrl : void 0;
|
|
3947
|
+
}
|
|
3948
|
+
function pairingConfirmLines(qrUrl, code) {
|
|
3949
|
+
const url = pairingConfirmUrl(qrUrl);
|
|
3950
|
+
if (!url)
|
|
3951
|
+
return [`Confirm in the Ascenda app \u2014 code ${code}`];
|
|
3952
|
+
return [`Open this link to confirm: ${url}`, `Or paste code ${code} in the Ascenda app.`];
|
|
3953
|
+
}
|
|
3954
|
+
function studyJoinConfirmUrl(apiBaseUrl, deviceCode) {
|
|
3955
|
+
if (!isHttps(apiBaseUrl))
|
|
3956
|
+
return void 0;
|
|
3957
|
+
return `${apiBaseUrl.replace(/\/+$/, "")}/join/${encodeURIComponent(deviceCode)}`;
|
|
3958
|
+
}
|
|
3959
|
+
function isHttps(value) {
|
|
3960
|
+
if (!value)
|
|
3961
|
+
return false;
|
|
3962
|
+
try {
|
|
3963
|
+
return new URL(value).protocol === "https:";
|
|
3964
|
+
} catch {
|
|
3965
|
+
return false;
|
|
3966
|
+
}
|
|
3967
|
+
}
|
|
3968
|
+
}
|
|
3969
|
+
});
|
|
3970
|
+
|
|
3902
3971
|
// ../packages/tool-kit/out/hookSet.js
|
|
3903
3972
|
var require_hookSet = __commonJS({
|
|
3904
3973
|
"../packages/tool-kit/out/hookSet.js"(exports) {
|
|
@@ -3999,12 +4068,16 @@ var require_studyJoin = __commonJS({
|
|
|
3999
4068
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4000
4069
|
exports.runStudyJoin = runStudyJoin;
|
|
4001
4070
|
exports.formatWindow = formatWindow;
|
|
4071
|
+
exports.describeStudyGrant = describeStudyGrant;
|
|
4072
|
+
exports.describeStudyKind = describeStudyKind;
|
|
4002
4073
|
var readline = __importStar(__require("node:readline"));
|
|
4074
|
+
var confirmLinks_1 = require_confirmLinks();
|
|
4003
4075
|
var http_1 = require_http();
|
|
4004
4076
|
var STUDY_JOIN_MODE = "report";
|
|
4005
4077
|
var POLL_INTERVAL_MS = 3e3;
|
|
4006
4078
|
var POLL_TIMEOUT_MS = 11 * 60 * 1e3;
|
|
4007
4079
|
async function runStudyJoin(ctx) {
|
|
4080
|
+
const report = (outcome) => ctx.onOutcome?.(outcome);
|
|
4008
4081
|
const stdin = ctx.stdin ?? process.stdin;
|
|
4009
4082
|
const stdout = ctx.stdout ?? process.stdout;
|
|
4010
4083
|
const stderr = ctx.stderr ?? process.stderr;
|
|
@@ -4012,10 +4085,12 @@ var require_studyJoin = __commonJS({
|
|
|
4012
4085
|
`);
|
|
4013
4086
|
if (!stdin.isTTY || !stdout.isTTY) {
|
|
4014
4087
|
stderr.write("join needs an interactive terminal (stdin and stdout). Run it directly, not from a script or a pipe.\n");
|
|
4088
|
+
report({ status: "no_terminal", granted: [] });
|
|
4015
4089
|
return 0;
|
|
4016
4090
|
}
|
|
4017
4091
|
if (!ctx.joinCode) {
|
|
4018
4092
|
stderr.write("Usage: join <code>\n");
|
|
4093
|
+
report({ status: "failed", granted: [], message: "No join code given." });
|
|
4019
4094
|
return 1;
|
|
4020
4095
|
}
|
|
4021
4096
|
let start;
|
|
@@ -4024,6 +4099,7 @@ var require_studyJoin = __commonJS({
|
|
|
4024
4099
|
} catch (error) {
|
|
4025
4100
|
stderr.write(`${describeStartError(error)}
|
|
4026
4101
|
`);
|
|
4102
|
+
report({ status: "failed", granted: [], message: describeStartError(error) });
|
|
4027
4103
|
return 1;
|
|
4028
4104
|
}
|
|
4029
4105
|
print("");
|
|
@@ -4032,7 +4108,7 @@ var require_studyJoin = __commonJS({
|
|
|
4032
4108
|
print("");
|
|
4033
4109
|
print("Report (30 days) grants:");
|
|
4034
4110
|
for (const grant of start.grants)
|
|
4035
|
-
print(` ${
|
|
4111
|
+
print(` ${describeStudyGrant(grant)}`);
|
|
4036
4112
|
print("");
|
|
4037
4113
|
print("Study mode needs the Ascenda app. Open the app to join that way instead.");
|
|
4038
4114
|
print("");
|
|
@@ -4043,10 +4119,17 @@ var require_studyJoin = __commonJS({
|
|
|
4043
4119
|
const answer = await askChoice(stdin, stdout);
|
|
4044
4120
|
if (!/^(1|report)$/i.test(answer)) {
|
|
4045
4121
|
print("Not now.");
|
|
4122
|
+
report({ status: "not_now", start, granted: [] });
|
|
4046
4123
|
return 0;
|
|
4047
4124
|
}
|
|
4048
4125
|
print("");
|
|
4049
|
-
|
|
4126
|
+
const confirmUrl = (0, confirmLinks_1.studyJoinConfirmUrl)(ctx.apiBaseUrl, start.deviceCode);
|
|
4127
|
+
if (confirmUrl) {
|
|
4128
|
+
print(`Open this link to confirm: ${confirmUrl}`);
|
|
4129
|
+
print(`Or confirm in the Ascenda app with code ${start.deviceCode}.`);
|
|
4130
|
+
} else {
|
|
4131
|
+
print(`Confirm in the Ascenda app with code ${start.deviceCode}`);
|
|
4132
|
+
}
|
|
4050
4133
|
print(`Waiting for confirmation (expires ${formatLocalTime(start.expiresAt)})...`);
|
|
4051
4134
|
const pollIntervalMs = ctx.pollIntervalMs ?? POLL_INTERVAL_MS;
|
|
4052
4135
|
const deadline = Math.min(Date.parse(start.expiresAt) || Date.now() + POLL_TIMEOUT_MS, Date.now() + POLL_TIMEOUT_MS);
|
|
@@ -4060,6 +4143,7 @@ var require_studyJoin = __commonJS({
|
|
|
4060
4143
|
continue;
|
|
4061
4144
|
stderr.write(`${describeStartError(error)}
|
|
4062
4145
|
`);
|
|
4146
|
+
report({ status: "failed", start, granted: [], message: describeStartError(error) });
|
|
4063
4147
|
return 1;
|
|
4064
4148
|
}
|
|
4065
4149
|
if (poll.status === "pending")
|
|
@@ -4069,20 +4153,23 @@ var require_studyJoin = __commonJS({
|
|
|
4069
4153
|
if (granted.length === 0) {
|
|
4070
4154
|
print("");
|
|
4071
4155
|
print("Nothing was granted. Run join again, or check with your organisation.");
|
|
4156
|
+
report({ status: "refused", start, granted: [], message: "Nothing was granted." });
|
|
4072
4157
|
return 1;
|
|
4073
4158
|
}
|
|
4074
4159
|
print("");
|
|
4075
4160
|
print("Joined. Granted:");
|
|
4076
4161
|
for (const grant of granted)
|
|
4077
|
-
print(` ${
|
|
4162
|
+
print(` ${describeStudyGrant(grant)}`);
|
|
4078
4163
|
print("");
|
|
4079
4164
|
print("Each of these can be turned off separately, in the app's consent settings.");
|
|
4080
4165
|
print("The organisation sees group counts, never who joined.");
|
|
4166
|
+
report({ status: "joined", start, granted });
|
|
4081
4167
|
return 0;
|
|
4082
4168
|
}
|
|
4083
4169
|
if (poll.status === "expired") {
|
|
4084
4170
|
print("");
|
|
4085
4171
|
print("This code expired before it was confirmed. Run join again for a fresh code.");
|
|
4172
|
+
report({ status: "expired", start, granted: [] });
|
|
4086
4173
|
return 1;
|
|
4087
4174
|
}
|
|
4088
4175
|
if (poll.refusedReason === "grant_failed") {
|
|
@@ -4093,19 +4180,22 @@ var require_studyJoin = __commonJS({
|
|
|
4093
4180
|
print("");
|
|
4094
4181
|
print("Granted before the failure:");
|
|
4095
4182
|
for (const grant of granted)
|
|
4096
|
-
print(` ${
|
|
4183
|
+
print(` ${describeStudyGrant(grant)}`);
|
|
4097
4184
|
print("");
|
|
4098
4185
|
print("Each of these can be turned off separately, in the app's consent settings.");
|
|
4099
4186
|
}
|
|
4100
4187
|
print("Run join again, or check with your organisation.");
|
|
4188
|
+
report({ status: "refused", start, granted, refusedReason: poll.refusedReason, message: describeRefusal(poll.refusedReason) });
|
|
4101
4189
|
return 1;
|
|
4102
4190
|
}
|
|
4103
4191
|
print("");
|
|
4104
4192
|
print(describeRefusal(poll.refusedReason));
|
|
4193
|
+
report({ status: "refused", start, granted: [], refusedReason: poll.refusedReason, message: describeRefusal(poll.refusedReason) });
|
|
4105
4194
|
return 1;
|
|
4106
4195
|
}
|
|
4107
4196
|
print("");
|
|
4108
4197
|
print("Timed out waiting for confirmation. Run join again for a fresh code.");
|
|
4198
|
+
report({ status: "expired", start, granted: [] });
|
|
4109
4199
|
return 1;
|
|
4110
4200
|
}
|
|
4111
4201
|
function isRetryablePollError(error) {
|
|
@@ -4148,7 +4238,7 @@ var require_studyJoin = __commonJS({
|
|
|
4148
4238
|
501: "AI assistant data processing consent",
|
|
4149
4239
|
507: "Import of the AI-work history already on your machine"
|
|
4150
4240
|
};
|
|
4151
|
-
function
|
|
4241
|
+
function describeStudyGrant(grant) {
|
|
4152
4242
|
return GRANT_SENTENCES[grant.code] ?? humanise(grant.name);
|
|
4153
4243
|
}
|
|
4154
4244
|
var STUDY_KIND_SENTENCES = {
|
|
@@ -4168,7 +4258,7 @@ var require_studyJoin = __commonJS({
|
|
|
4168
4258
|
// table is ever consulted — present so the type stays exhaustive, and as
|
|
4169
4259
|
// a plain fallback should something call this function with it directly.
|
|
4170
4260
|
grant_failed: "Join failed partway through. Some grants may not have gone through.",
|
|
4171
|
-
declined: "You declined
|
|
4261
|
+
declined: "You declined the join. Nothing was granted.",
|
|
4172
4262
|
not_enrolled: "That study couldn't enrol you, so nothing was granted."
|
|
4173
4263
|
};
|
|
4174
4264
|
function describeRefusal(refusedReason) {
|
|
@@ -5548,6 +5638,7 @@ var require_cliAgentSetup = __commonJS({
|
|
|
5548
5638
|
var credentials_1 = require_credentials();
|
|
5549
5639
|
var eventLog_1 = require_eventLog();
|
|
5550
5640
|
var hookAdapter_1 = require_hookAdapter();
|
|
5641
|
+
var confirmLinks_1 = require_confirmLinks();
|
|
5551
5642
|
var http_1 = require_http();
|
|
5552
5643
|
var hookSet_1 = require_hookSet();
|
|
5553
5644
|
var initiatives_1 = require_initiatives();
|
|
@@ -5882,7 +5973,7 @@ Could not reach ${apiBaseUrl} to pair: ${error instanceof Error ? error.message
|
|
|
5882
5973
|
console.error("Start the local dev server and use --local, or pass --api-base-url for your backend.");
|
|
5883
5974
|
return void 0;
|
|
5884
5975
|
}
|
|
5885
|
-
const token = await pollForToken(apiBaseUrl, session.pairingSessionId, session.code, session.expiresAt);
|
|
5976
|
+
const token = await pollForToken(apiBaseUrl, session.pairingSessionId, session.code, session.qrUrl, session.expiresAt);
|
|
5886
5977
|
if (!token)
|
|
5887
5978
|
return void 0;
|
|
5888
5979
|
(0, tokenStore_1.persistEventWriteToken)((0, tokenStore_1.defaultTokenFilePath)(toolInstallationId), token);
|
|
@@ -5900,7 +5991,7 @@ Could not reach ${apiBaseUrl} to pair: ${error instanceof Error ? error.message
|
|
|
5900
5991
|
}
|
|
5901
5992
|
return "keep";
|
|
5902
5993
|
}
|
|
5903
|
-
async function pollForToken(apiBaseUrl, pairingSessionId, code, expiresAt) {
|
|
5994
|
+
async function pollForToken(apiBaseUrl, pairingSessionId, code, qrUrl, expiresAt) {
|
|
5904
5995
|
const deadline = Math.min(Date.parse(expiresAt) || Date.now() + 3e5, Date.now() + 3e5);
|
|
5905
5996
|
let announced = false;
|
|
5906
5997
|
while (Date.now() < deadline) {
|
|
@@ -5913,8 +6004,9 @@ Pairing ${status.status}. Run setup again.`);
|
|
|
5913
6004
|
return void 0;
|
|
5914
6005
|
}
|
|
5915
6006
|
if (!announced) {
|
|
5916
|
-
console.log(
|
|
5917
|
-
|
|
6007
|
+
console.log("");
|
|
6008
|
+
for (const line of (0, confirmLinks_1.pairingConfirmLines)(qrUrl, code))
|
|
6009
|
+
console.log(` ${line}`);
|
|
5918
6010
|
console.log(" Waiting...");
|
|
5919
6011
|
announced = true;
|
|
5920
6012
|
}
|
|
@@ -6409,6 +6501,100 @@ var require_turnState = __commonJS({
|
|
|
6409
6501
|
}
|
|
6410
6502
|
});
|
|
6411
6503
|
|
|
6504
|
+
// ../packages/tool-kit/out/pluginBundle.js
|
|
6505
|
+
var require_pluginBundle = __commonJS({
|
|
6506
|
+
"../packages/tool-kit/out/pluginBundle.js"(exports) {
|
|
6507
|
+
"use strict";
|
|
6508
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
6509
|
+
if (k2 === void 0) k2 = k;
|
|
6510
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6511
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6512
|
+
desc = { enumerable: true, get: function() {
|
|
6513
|
+
return m[k];
|
|
6514
|
+
} };
|
|
6515
|
+
}
|
|
6516
|
+
Object.defineProperty(o, k2, desc);
|
|
6517
|
+
} : function(o, m, k, k2) {
|
|
6518
|
+
if (k2 === void 0) k2 = k;
|
|
6519
|
+
o[k2] = m[k];
|
|
6520
|
+
});
|
|
6521
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
6522
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
6523
|
+
} : function(o, v) {
|
|
6524
|
+
o["default"] = v;
|
|
6525
|
+
});
|
|
6526
|
+
var __importStar = exports && exports.__importStar || /* @__PURE__ */ function() {
|
|
6527
|
+
var ownKeys = function(o) {
|
|
6528
|
+
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
6529
|
+
var ar = [];
|
|
6530
|
+
for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
|
|
6531
|
+
return ar;
|
|
6532
|
+
};
|
|
6533
|
+
return ownKeys(o);
|
|
6534
|
+
};
|
|
6535
|
+
return function(mod) {
|
|
6536
|
+
if (mod && mod.__esModule) return mod;
|
|
6537
|
+
var result = {};
|
|
6538
|
+
if (mod != null) {
|
|
6539
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
6540
|
+
}
|
|
6541
|
+
__setModuleDefault(result, mod);
|
|
6542
|
+
return result;
|
|
6543
|
+
};
|
|
6544
|
+
}();
|
|
6545
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6546
|
+
exports.pluginBundlePaths = pluginBundlePaths;
|
|
6547
|
+
exports.installPluginBundle = installPluginBundle;
|
|
6548
|
+
exports.describePluginBundleOutcome = describePluginBundleOutcome;
|
|
6549
|
+
var fs = __importStar(__require("fs"));
|
|
6550
|
+
var path = __importStar(__require("path"));
|
|
6551
|
+
var collectorVersion_1 = require_collectorVersion();
|
|
6552
|
+
var hookRunner_1 = require_hookRunner();
|
|
6553
|
+
var tokenStore_1 = require_tokenStore();
|
|
6554
|
+
function pluginBundlePaths(name) {
|
|
6555
|
+
const base2 = path.join((0, tokenStore_1.ascendaHome)(), "plugin", name);
|
|
6556
|
+
return { bundle: `${base2}.mjs`, version: `${base2}.version`, checked: `${base2}.checked` };
|
|
6557
|
+
}
|
|
6558
|
+
function installPluginBundle(options) {
|
|
6559
|
+
const paths = pluginBundlePaths(options.name);
|
|
6560
|
+
const source = path.resolve(options.source ?? process.argv[1]);
|
|
6561
|
+
const incoming = options.version ?? collectorVersion_1.COLLECTOR_VERSION;
|
|
6562
|
+
const installed = readVersion(paths.version);
|
|
6563
|
+
const present = fs.existsSync(paths.bundle);
|
|
6564
|
+
if (source === path.resolve(paths.bundle))
|
|
6565
|
+
return { kind: "current", version: installed ?? incoming };
|
|
6566
|
+
if (present && installed && (0, hookRunner_1.isDowngrade)(installed, incoming))
|
|
6567
|
+
return { kind: "kept-newer", installed, incoming };
|
|
6568
|
+
const contents = fs.readFileSync(source);
|
|
6569
|
+
if (present && installed === incoming && contents.equals(fs.readFileSync(paths.bundle))) {
|
|
6570
|
+
return { kind: "current", version: incoming };
|
|
6571
|
+
}
|
|
6572
|
+
fs.mkdirSync(path.dirname(paths.bundle), { recursive: true });
|
|
6573
|
+
(0, hookRunner_1.writeAtomically)(paths.bundle, contents, 420);
|
|
6574
|
+
(0, hookRunner_1.writeAtomically)(paths.version, `${incoming}
|
|
6575
|
+
`, 420);
|
|
6576
|
+
return present && installed ? { kind: "installed", version: incoming, replaced: installed } : { kind: "installed", version: incoming };
|
|
6577
|
+
}
|
|
6578
|
+
function describePluginBundleOutcome(outcome, bundle) {
|
|
6579
|
+
switch (outcome.kind) {
|
|
6580
|
+
case "installed":
|
|
6581
|
+
return outcome.replaced && outcome.replaced !== outcome.version ? `Updated the plugin's bundle from ${outcome.replaced} to ${outcome.version}: ${bundle}` : `Installed the plugin's bundle (${outcome.version}): ${bundle}`;
|
|
6582
|
+
case "current":
|
|
6583
|
+
return `The plugin's bundle is already ${outcome.version}: ${bundle}`;
|
|
6584
|
+
case "kept-newer":
|
|
6585
|
+
return `Kept the plugin's bundle at ${outcome.installed}. This copy is the older ${outcome.incoming}.`;
|
|
6586
|
+
}
|
|
6587
|
+
}
|
|
6588
|
+
function readVersion(file) {
|
|
6589
|
+
try {
|
|
6590
|
+
return fs.readFileSync(file, "utf8").trim() || void 0;
|
|
6591
|
+
} catch {
|
|
6592
|
+
return void 0;
|
|
6593
|
+
}
|
|
6594
|
+
}
|
|
6595
|
+
}
|
|
6596
|
+
});
|
|
6597
|
+
|
|
6412
6598
|
// ../packages/tool-kit/out/agentProcess.js
|
|
6413
6599
|
var require_agentProcess = __commonJS({
|
|
6414
6600
|
"../packages/tool-kit/out/agentProcess.js"(exports) {
|
|
@@ -6556,8 +6742,8 @@ var require_out3 = __commonJS({
|
|
|
6556
6742
|
exports.resolveEventLog = exports.parseEventLogFlag = exports.expandUserPath = exports.describeEventLog = exports.defaultEventLogPath = exports.appendEventLog = exports.EVENT_LOG_OFF = exports.EVENT_LOG_ENV_VAR = exports.toAgentEvent = exports.buildEventPayload = exports.buildEventBody = exports.TOKEN_RENEW_LEAD_MS = exports.AscendaSemanticEventError = exports.AscendaEventSender = exports.startBackgroundFlush = exports.runOutboxFlush = exports.hookDeliveryInline = exports.flushLockPath = exports.OUTBOX_FLUSH_COMMAND = exports.HOOK_DELIVERY_ENV_VAR = exports.FLUSH_LOCK_FRESH_MS = exports.describeCollectorVersion = exports.UNRELEASED_COLLECTOR_VERSION = exports.COLLECTOR_VERSION = exports.mintIdempotencyKey = exports.looksLikeCorrection = exports.outcomeForHook = exports.inferOutcome = exports.getNestedNumber = exports.getNestedString = exports.getNested = exports.getNumber = exports.getString = exports.localHourAt = exports.utcOffsetMinutesAt = exports.BUSINESS_DAY = exports.isOutsideBusinessHours = exports.isAfterHours = exports.bucketDurationMs = exports.bucketLinesChanged = exports.classifyModelClass = exports.autonomyBand = exports.shellCommandFacts = exports.invitesDebrief = exports.classifyMcpWorkMilestone = exports.classifyWorkMilestone = exports.isReworkGitAction = exports.classifyGitAction = exports.isVerificationCommand = exports.classifyCommand = void 0;
|
|
6557
6743
|
exports.unresolvedStateFilePath = exports.markFailureNotified = exports.shouldAnnounceFailure = exports.recordSendOutcome = exports.readCollectorState = exports.defaultStateFilePath = exports.tokenExpiryFilePath = exports.readTokenFile = exports.readTokenExpiry = exports.persistEventWriteToken = exports.listPersistedToolInstallationIds = exports.defaultTokenFilePath = exports.ascendaHome = exports.EVENT_TOKEN_TTL_MS = exports.recordTurnStart = exports.readTurnPromptId = exports.consumeTurnDurationMs = exports.writeTopLevelCredentials = exports.writeMachineCredentials = exports.writeRepoKeysSetting = exports.writeEventLogSetting = exports.writeHostCredentials = exports.removeHostCredentials = exports.readMachineCredentials = exports.readHostCredentials = exports.isLocalOnlyHostInstall = exports.credentialsFilePath = exports.renderSetupDisclosure = exports.REFUSALS = exports.FREE_TEXT_KEYS = exports.FAMILY_SENTENCES = exports.ALWAYS_SENT = exports.writeHookSettings = exports.trustProblemLines = exports.runCliAgentSetup = exports.registeredHookSets = exports.ourHookPositions = exports.isCliAgentManagementCommand = exports.findStaleHookCommands = exports.cliAgentHookBinPath = exports.resolveContextHashes = exports.resolveCliAgentInstallationId = exports.withPromptId = exports.withForgeKeys = exports.loadCliAgentConfig = exports.flushHookOutbox = exports.deliverHookEvents = exports.MissingInstallationIdError = exports.DEFAULT_API_BASE_URL = exports.resolveEventLogPath = void 0;
|
|
6558
6744
|
exports.saverSupportDir = exports.saverStatusDir = exports.saverReplayPath = exports.saverContainerDir = exports.readSaverStatuses = exports.probeSocket = exports.heldForSaver = exports.holdForSaver = exports.LIVE_BUS_BACKGROUND_TRUST_MS = exports.liveBusSocketCandidates = exports.liveBusSocketPath = exports.bucketPromptSize = exports.deliverLine = exports.emitLiveSignal = exports.repoKeysEnabled = exports.deriveForgeKeysForCwd = exports.REPO_KEYS_ENV_VAR = exports.recordForgeProjectAlias = exports.forgeFullNameFromConfig = exports.readForgeFullName = exports.parseForgeFullName = exports.forgeBranchKey = exports.forgeRepoKey = exports.forgeProjectHash = exports.workContextRegistryFilePath = exports.readWorkContextRegistry = exports.recordWorkContextAlias = exports.recordWorkContext = exports.readBranchName = exports.normalizeBranchName = exports.deriveBranchHashForCwd = exports.deriveBranchHash = exports.deriveWorkContext = exports.hashWithMachineSalt = exports.readOrCreateMachineSalt = exports.machineSaltFilePath = exports.fixedTimeProvider = exports.systemTimeProvider = exports.enforceOutboxBounds = exports.claimOutbox = exports.readOutboxSummary = exports.appendToOutbox = exports.defaultOutboxFilePath = exports.outboxDrainEnabled = exports.DEFAULT_OUTBOX_DRAIN_BATCH_SIZE = exports.DEFAULT_OUTBOX_MAX_AGE_MS = exports.DEFAULT_OUTBOX_MAX_ENTRIES = exports.OUTBOX_DRAIN_ENV_VAR = exports.recordOutboxDiscard = exports.unresolvedToolInstallationId = void 0;
|
|
6559
|
-
exports.
|
|
6560
|
-
exports.runStudyJoin = exports.studyNoticeStatus = exports.runStudyObjection = exports.renderStudyNotices = exports.NOTICED_PURPOSES = exports.renderInitiatives = exports.initiativesStatusLines = exports.INITIATIVE_COPY = void 0;
|
|
6745
|
+
exports.readStudyNotices = exports.readInitiatives = exports.isRetryableStatus = exports.parseIngestResponse = exports.postToolEventsBatch = exports.postToolEvent = exports.renewToolToken = exports.getStudyJoinStatus = exports.getPairingStatus = exports.createPairingSession = exports.AscendaApiError = exports.scriptMarkerIn = exports.psLookup = exports.psArgsLookup = exports.livePidFields = exports.findAgentProcess = exports.findAgentPid = exports.AGENT_PROCESS = exports.readViaPlugin = exports.readHookSet = exports.isHookSet = exports.hookSetOfCommand = exports.hookSetChanges = exports.hookSetArgument = exports.describeHookSetChanges = exports.UNVERSIONED_HOOK_SET = exports.HOOK_SET_FLAG = exports.liveSignalDoctorLines = exports.doctorRow = exports.DOCTOR_VALUE_COLUMN = exports.pluginBundlePaths = exports.installPluginBundle = exports.describePluginBundleOutcome = exports.replaceSettingsFile = exports.writeAtomically = exports.tidyHomePath = exports.stampLastHook = exports.resolveHookNode = exports.removeHookRunner = exports.readLastHook = exports.lastHookPath = exports.isDowngrade = exports.installHookRunner = exports.hookRunnerPaths = exports.hookRunnerCommand = exports.hookLauncherScript = exports.describeAge = exports.terminalStyle = exports.colourEnabled = exports.SAVER_REPLAY_WINDOW_MS = void 0;
|
|
6746
|
+
exports.studyJoinConfirmUrl = exports.pairingConfirmUrl = exports.pairingConfirmLines = exports.runStudyJoin = exports.formatWindow = exports.describeStudyGrant = exports.describeStudyKind = exports.studyNoticeStatus = exports.runStudyObjection = exports.renderStudyNotices = exports.NOTICED_PURPOSES = exports.renderInitiatives = exports.initiativesStatusLines = exports.INITIATIVE_COPY = exports.startStudyJoin = exports.setStudyObjection = exports.markStudyNoticeShown = void 0;
|
|
6561
6747
|
var commandClassifier_1 = require_commandClassifier();
|
|
6562
6748
|
Object.defineProperty(exports, "classifyCommand", { enumerable: true, get: function() {
|
|
6563
6749
|
return commandClassifier_1.classifyCommand;
|
|
@@ -7092,6 +7278,16 @@ var require_out3 = __commonJS({
|
|
|
7092
7278
|
Object.defineProperty(exports, "replaceSettingsFile", { enumerable: true, get: function() {
|
|
7093
7279
|
return settingsFile_1.replaceSettingsFile;
|
|
7094
7280
|
} });
|
|
7281
|
+
var pluginBundle_1 = require_pluginBundle();
|
|
7282
|
+
Object.defineProperty(exports, "describePluginBundleOutcome", { enumerable: true, get: function() {
|
|
7283
|
+
return pluginBundle_1.describePluginBundleOutcome;
|
|
7284
|
+
} });
|
|
7285
|
+
Object.defineProperty(exports, "installPluginBundle", { enumerable: true, get: function() {
|
|
7286
|
+
return pluginBundle_1.installPluginBundle;
|
|
7287
|
+
} });
|
|
7288
|
+
Object.defineProperty(exports, "pluginBundlePaths", { enumerable: true, get: function() {
|
|
7289
|
+
return pluginBundle_1.pluginBundlePaths;
|
|
7290
|
+
} });
|
|
7095
7291
|
var liveSignalDoctor_1 = require_liveSignalDoctor();
|
|
7096
7292
|
Object.defineProperty(exports, "DOCTOR_VALUE_COLUMN", { enumerable: true, get: function() {
|
|
7097
7293
|
return liveSignalDoctor_1.DOCTOR_VALUE_COLUMN;
|
|
@@ -7219,9 +7415,28 @@ var require_out3 = __commonJS({
|
|
|
7219
7415
|
return studyNotices_1.studyNoticeStatus;
|
|
7220
7416
|
} });
|
|
7221
7417
|
var studyJoin_1 = require_studyJoin();
|
|
7418
|
+
Object.defineProperty(exports, "describeStudyKind", { enumerable: true, get: function() {
|
|
7419
|
+
return studyJoin_1.describeStudyKind;
|
|
7420
|
+
} });
|
|
7421
|
+
Object.defineProperty(exports, "describeStudyGrant", { enumerable: true, get: function() {
|
|
7422
|
+
return studyJoin_1.describeStudyGrant;
|
|
7423
|
+
} });
|
|
7424
|
+
Object.defineProperty(exports, "formatWindow", { enumerable: true, get: function() {
|
|
7425
|
+
return studyJoin_1.formatWindow;
|
|
7426
|
+
} });
|
|
7222
7427
|
Object.defineProperty(exports, "runStudyJoin", { enumerable: true, get: function() {
|
|
7223
7428
|
return studyJoin_1.runStudyJoin;
|
|
7224
7429
|
} });
|
|
7430
|
+
var confirmLinks_1 = require_confirmLinks();
|
|
7431
|
+
Object.defineProperty(exports, "pairingConfirmLines", { enumerable: true, get: function() {
|
|
7432
|
+
return confirmLinks_1.pairingConfirmLines;
|
|
7433
|
+
} });
|
|
7434
|
+
Object.defineProperty(exports, "pairingConfirmUrl", { enumerable: true, get: function() {
|
|
7435
|
+
return confirmLinks_1.pairingConfirmUrl;
|
|
7436
|
+
} });
|
|
7437
|
+
Object.defineProperty(exports, "studyJoinConfirmUrl", { enumerable: true, get: function() {
|
|
7438
|
+
return confirmLinks_1.studyJoinConfirmUrl;
|
|
7439
|
+
} });
|
|
7225
7440
|
}
|
|
7226
7441
|
});
|
|
7227
7442
|
|
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.38",
|
|
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",
|