@songsid/agend 2.3.2-beta.12 → 2.3.2-beta.14
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/auth-api.js +2 -0
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/kiro-classic-archive.js +55 -2
- package/dist/backend/kiro-classic-archive.js.map +1 -1
- package/dist/backend/kiro-classic-links.d.ts +24 -0
- package/dist/backend/kiro-classic-links.js +135 -0
- package/dist/backend/kiro-classic-links.js.map +1 -0
- package/dist/backend/kiro-identity.d.ts +71 -1
- package/dist/backend/kiro-identity.js +204 -31
- package/dist/backend/kiro-identity.js.map +1 -1
- package/dist/backend/kiro-v2-store-worker.js +6 -1
- package/dist/backend/kiro-v2-store-worker.js.map +1 -1
- package/dist/backend/kiro-v2-store.d.ts +12 -1
- package/dist/backend/kiro-v2-store.js +22 -12
- package/dist/backend/kiro-v2-store.js.map +1 -1
- package/dist/backend/kiro.d.ts +6 -0
- package/dist/backend/kiro.js +50 -7
- package/dist/backend/kiro.js.map +1 -1
- package/dist/fleet-manager.js +6 -1
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/web-dashboard/SKILL.canvas-worker-off.md +7 -1
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +7 -1
- package/dist/kiro-migrate.d.ts +8 -2
- package/dist/kiro-migrate.js +48 -5
- package/dist/kiro-migrate.js.map +1 -1
- package/dist/locale.js +32 -0
- package/dist/locale.js.map +1 -1
- package/dist/quickstart-api.d.ts +14 -0
- package/dist/quickstart-api.js +62 -11
- package/dist/quickstart-api.js.map +1 -1
- package/dist/settings-effect.js +5 -4
- package/dist/settings-effect.js.map +1 -1
- package/dist/setup-form.d.ts +2 -2
- package/dist/setup-form.js +124 -92
- package/dist/setup-form.js.map +1 -1
- package/dist/setup-i18n.d.ts +25 -0
- package/dist/setup-i18n.js +224 -0
- package/dist/setup-i18n.js.map +1 -0
- package/dist/ui/backend-signin.js +4 -3
- package/dist/ui/panel-settings.js +4 -2
- package/dist/ui/settings-discord.js +3 -2
- package/dist/ui/settings-strings.js +8 -2
- package/dist/ui/settings-token.js +3 -2
- package/dist/ui/settings-wizard.js +11 -6
- package/dist/ui/shared/setup-host-text.js +105 -0
- package/dist/ui/structured-signin.js +89 -38
- package/package.json +1 -1
- package/templates/windows-shortcuts.ps1 +3 -3
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Worker } from "node:worker_threads";
|
|
2
2
|
import { performance } from "node:perf_hooks";
|
|
3
3
|
export const KIRO_V2_STORE_BUDGET_MS = 15_000;
|
|
4
|
+
/** #2738: a classic store's compaction links read every transcript of the instance's key — its own lane, its own budget. */
|
|
5
|
+
export const KIRO_CLASSIC_LINKS_BUDGET_MS = 30_000;
|
|
4
6
|
export const KIRO_V2_STORE_QUEUE_LIMIT = 64;
|
|
5
7
|
const unreadable = (detail) => ({ kind: "unreadable", detail });
|
|
6
8
|
function createIsolate() {
|
|
@@ -15,30 +17,36 @@ function createIsolate() {
|
|
|
15
17
|
export class KiroV2StoreLane {
|
|
16
18
|
factory;
|
|
17
19
|
now;
|
|
20
|
+
budgetMs;
|
|
21
|
+
label;
|
|
18
22
|
worker = null;
|
|
19
23
|
retiring = false;
|
|
20
24
|
nextId = 0;
|
|
21
25
|
pending = new Map();
|
|
22
|
-
constructor(factory = createIsolate, now = () => performance.now()) {
|
|
26
|
+
constructor(factory = createIsolate, now = () => performance.now(), budgetMs = KIRO_V2_STORE_BUDGET_MS, label = "v2 session discovery") {
|
|
23
27
|
this.factory = factory;
|
|
24
28
|
this.now = now;
|
|
29
|
+
this.budgetMs = budgetMs;
|
|
30
|
+
this.label = label;
|
|
25
31
|
}
|
|
32
|
+
/** The detail of a reply that ran out of this lane's budget. */
|
|
33
|
+
get timedOut() { return `${this.label} timed out`; }
|
|
26
34
|
read(input) {
|
|
27
35
|
if (this.pending.size >= KIRO_V2_STORE_QUEUE_LIMIT)
|
|
28
|
-
return Promise.resolve(unreadable(
|
|
29
|
-
const id = ++this.nextId, deadlineAt = this.now() +
|
|
36
|
+
return Promise.resolve(unreadable(`${this.label} queue full`));
|
|
37
|
+
const id = ++this.nextId, deadlineAt = this.now() + this.budgetMs;
|
|
30
38
|
const promise = new Promise(resolve => {
|
|
31
39
|
this.pending.set(id, { input, deadlineAt, sent: false, resolve, timer: setTimeout(() => {
|
|
32
|
-
this.settle(id, unreadable(
|
|
40
|
+
this.settle(id, unreadable(this.timedOut));
|
|
33
41
|
this.retire();
|
|
34
|
-
},
|
|
42
|
+
}, this.budgetMs) });
|
|
35
43
|
});
|
|
36
44
|
this.pump();
|
|
37
45
|
return promise;
|
|
38
46
|
}
|
|
39
47
|
close() {
|
|
40
48
|
for (const id of this.pending.keys())
|
|
41
|
-
this.settle(id, unreadable(
|
|
49
|
+
this.settle(id, unreadable(`${this.label} closed`));
|
|
42
50
|
this.retire();
|
|
43
51
|
}
|
|
44
52
|
settle(id, reply) {
|
|
@@ -57,7 +65,7 @@ export class KiroV2StoreLane {
|
|
|
57
65
|
this.retiring = true;
|
|
58
66
|
for (const [id, request] of this.pending)
|
|
59
67
|
if (request.sent)
|
|
60
|
-
this.settle(id, unreadable(
|
|
68
|
+
this.settle(id, unreadable(`${this.label} worker retired`));
|
|
61
69
|
try {
|
|
62
70
|
void this.worker.terminate().catch(() => { });
|
|
63
71
|
}
|
|
@@ -68,7 +76,7 @@ export class KiroV2StoreLane {
|
|
|
68
76
|
return;
|
|
69
77
|
for (const [id, request] of this.pending) {
|
|
70
78
|
if (this.now() >= request.deadlineAt)
|
|
71
|
-
this.settle(id, unreadable(
|
|
79
|
+
this.settle(id, unreadable(this.timedOut));
|
|
72
80
|
}
|
|
73
81
|
if (!this.pending.size)
|
|
74
82
|
return;
|
|
@@ -83,7 +91,7 @@ export class KiroV2StoreLane {
|
|
|
83
91
|
if (!request)
|
|
84
92
|
return;
|
|
85
93
|
if (this.now() >= request.deadlineAt) {
|
|
86
|
-
this.settle(message.id, unreadable(
|
|
94
|
+
this.settle(message.id, unreadable(this.timedOut));
|
|
87
95
|
this.retire();
|
|
88
96
|
}
|
|
89
97
|
else
|
|
@@ -98,13 +106,13 @@ export class KiroV2StoreLane {
|
|
|
98
106
|
this.retiring = false;
|
|
99
107
|
for (const [id, request] of this.pending)
|
|
100
108
|
if (request.sent)
|
|
101
|
-
this.settle(id, unreadable(
|
|
109
|
+
this.settle(id, unreadable(`${this.label} worker exited`));
|
|
102
110
|
this.pump();
|
|
103
111
|
});
|
|
104
112
|
}
|
|
105
113
|
catch {
|
|
106
114
|
for (const id of this.pending.keys())
|
|
107
|
-
this.settle(id, unreadable(
|
|
115
|
+
this.settle(id, unreadable(`cannot start ${this.label} worker`));
|
|
108
116
|
return;
|
|
109
117
|
}
|
|
110
118
|
}
|
|
@@ -112,7 +120,7 @@ export class KiroV2StoreLane {
|
|
|
112
120
|
if (request.sent)
|
|
113
121
|
continue;
|
|
114
122
|
if (this.now() >= request.deadlineAt) {
|
|
115
|
-
this.settle(id, unreadable(
|
|
123
|
+
this.settle(id, unreadable(this.timedOut));
|
|
116
124
|
continue;
|
|
117
125
|
}
|
|
118
126
|
try {
|
|
@@ -128,4 +136,6 @@ export class KiroV2StoreLane {
|
|
|
128
136
|
}
|
|
129
137
|
}
|
|
130
138
|
export const sharedKiroV2StoreLane = new KiroV2StoreLane();
|
|
139
|
+
/** #2738: apart from the v2 lane, so a long classic read never spends a v2 launch's budget in its queue. */
|
|
140
|
+
export const sharedKiroClassicLinksLane = new KiroV2StoreLane(createIsolate, () => performance.now(), KIRO_CLASSIC_LINKS_BUDGET_MS, "classic compaction links");
|
|
131
141
|
//# sourceMappingURL=kiro-v2-store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kiro-v2-store.js","sourceRoot":"","sources":["../../src/backend/kiro-v2-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAA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UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAA+B,CAAC,CAAC;YACtH,CAAC;YAAC,MAAM,CAAC;gBAAC,IAAI,CAAC,MAAM,EAAE,CAAC;gBAAC,MAAM;YAAC,CAAC;QACnC,CAAC;IACH,CAAC;CACF;AACD,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,eAAe,EAAE,CAAC;AAC3D,4GAA4G;AAC5G,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,eAAe,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,4BAA4B,EAAE,0BAA0B,CAAC,CAAC"}
|
package/dist/backend/kiro.d.ts
CHANGED
|
@@ -345,12 +345,16 @@ export declare class KiroBackend implements CliBackend {
|
|
|
345
345
|
/** #1218: the last launch built in full (cleared when a build starts, set only when it returns). */
|
|
346
346
|
private builtLaunch;
|
|
347
347
|
private preparedV2Store;
|
|
348
|
+
/** #2738: a classic launch's compaction links, worked out in prepareLaunch on their worker lane (off the loop). */
|
|
349
|
+
private preparedClassicLinks;
|
|
348
350
|
/** #2648: the saved model of the v2 conversation this instance has recorded, read in prepareLaunch (off the loop). */
|
|
349
351
|
private preparedV2Model;
|
|
350
352
|
private storePreparation;
|
|
351
353
|
private preparedCarry;
|
|
352
354
|
private storeKey;
|
|
353
355
|
private readPreparedV2Store;
|
|
356
|
+
/** Not prepared for this launch: unproven, so the launch stays on the recorded conversation (never read here). */
|
|
357
|
+
private readPreparedClassicLinks;
|
|
354
358
|
/** Metadata only: identity claims/config writes remain synchronous, after
|
|
355
359
|
* the daemon rechecks its launch admission following this await. */
|
|
356
360
|
prepareLaunch(config?: CliBackendConfig): Promise<void>;
|
|
@@ -403,6 +407,8 @@ export declare class KiroBackend implements CliBackend {
|
|
|
403
407
|
/** Board 907c7899: classic and TUI V2 say on the pane how a /compact ended (verified 2.30.0); V3 is not read. */
|
|
404
408
|
compactPaneUi(): "legacy" | "tui" | null;
|
|
405
409
|
consumeLaunchWarning(): string | null;
|
|
410
|
+
private quietLaunchNotes;
|
|
411
|
+
consumeQuietLaunchNotes(): string[];
|
|
406
412
|
private shouldWarnUnsupportedEffort;
|
|
407
413
|
writeConfig(config: CliBackendConfig): void;
|
|
408
414
|
/** This instance's agent, by its fleet and its own wrapper scripts. */
|
package/dist/backend/kiro.js
CHANGED
|
@@ -5,7 +5,7 @@ import { homedir } from "node:os";
|
|
|
5
5
|
import { getAgendHome } from "../paths.js";
|
|
6
6
|
import { credentialHomeSpec, credentialProfileHome, credentialProfileStoreHome, prepareCredentialProfileHome, resolveCredentialProfile, } from "./credential-profile.js";
|
|
7
7
|
import { kiroAgentName, kiroFleetTag, writeKiroAgent, removeKiroAgent, writeSharedKiroMcpEntries, removeSharedKiroMcpEntries, writeTaggedKiroSteering, removeTaggedKiroSteering, } from "./kiro-agent.js";
|
|
8
|
-
import { resolveKiroIdentity, listKiroV1Sessions, listKiroV2Sessions, confirmKiroAgentSwitch, kiroAgentConfirmed, forgetKiroIdentity, kiroIdentityNeedsStore, kiroRecordedConversation, kiroCanonicalDirectory, KiroIdentityError, kiroEngineFloor, kiroCarryCandidate, } from "./kiro-identity.js";
|
|
8
|
+
import { resolveKiroIdentity, listKiroV1Sessions, listKiroV2Sessions, readKiroClassicLinks, confirmKiroAgentSwitch, kiroAgentConfirmed, forgetKiroIdentity, kiroIdentityNeedsStore, kiroRecordedConversation, kiroCanonicalDirectory, KiroIdentityError, kiroEngineFloor, kiroCarryCandidate, } from "./kiro-identity.js";
|
|
9
9
|
import { readKiroLedger, kiroHasNoLaunchRecord } from "./kiro-engine-ledger.js";
|
|
10
10
|
import { execFileSync } from "node:child_process";
|
|
11
11
|
import { writeFileSync, chmodSync, statSync } from "node:fs";
|
|
@@ -15,6 +15,7 @@ import { PIE_CLASS } from "../tui-glyphs.js";
|
|
|
15
15
|
import { KIRO_EXPIRED_LOGIN_SCREEN } from "../login-flows.js";
|
|
16
16
|
import { t } from "../locale.js";
|
|
17
17
|
import { sharedKiroV2StoreLane } from "./kiro-v2-store.js";
|
|
18
|
+
import { KIRO_CLASSIC_LINKS_NOT_PREPARED } from "./kiro-classic-links.js";
|
|
18
19
|
import { decideKiroModelError, readKiroKnownModels, readKiroModelRecords, readKiroV1SavedModel, readKiroV2SavedModel, writeKiroModelRecords, KIRO_FALLBACK_MODEL } from "./kiro-retired-model.js";
|
|
19
20
|
import { recordKiroLaunch } from "./kiro-engine-ledger.js";
|
|
20
21
|
import { forgetKiroV3Identity, resolveKiroV3Resume } from "./kiro-v3-identity.js";
|
|
@@ -1083,6 +1084,22 @@ function nextPatch(version) {
|
|
|
1083
1084
|
const [major, minor, patch] = parseSemver(version);
|
|
1084
1085
|
return `${major}.${minor}.${patch + 1}`;
|
|
1085
1086
|
}
|
|
1087
|
+
/** #2714: what a resume decision says about a compaction, for the log and the Log tab. */
|
|
1088
|
+
function kiroCompactionNotes(decision) {
|
|
1089
|
+
const notes = [];
|
|
1090
|
+
if (decision.followed?.length)
|
|
1091
|
+
notes.push(t("kiro.compaction_followed", decision.followed[0], decision.id));
|
|
1092
|
+
const kept = decision.kept;
|
|
1093
|
+
if (kept?.reason === "unreadable")
|
|
1094
|
+
notes.push(t("kiro.compaction_kept_unreadable", decision.id));
|
|
1095
|
+
else if (kept?.reason === "over-budget")
|
|
1096
|
+
notes.push(t("kiro.compaction_kept_over_budget", decision.id));
|
|
1097
|
+
else if (kept?.reason === "ambiguous")
|
|
1098
|
+
notes.push(t("kiro.compaction_kept_ambiguous", decision.id, kept.from, kept.candidates.join(", ")));
|
|
1099
|
+
else if (kept?.reason === "not-ours")
|
|
1100
|
+
notes.push(t("kiro.compaction_kept_not_ours", decision.id, kept.from, kept.candidate));
|
|
1101
|
+
return notes;
|
|
1102
|
+
}
|
|
1086
1103
|
/** #2598 B3: engines in the order a conversation can move between them (never back). */
|
|
1087
1104
|
const KIRO_ENGINE_RANK = { legacy: 1, tui: 2, v3: 3 };
|
|
1088
1105
|
/** Binary generations already told they cannot isolate (once each). */
|
|
@@ -1368,6 +1385,8 @@ export class KiroBackend {
|
|
|
1368
1385
|
/** #1218: the last launch built in full (cleared when a build starts, set only when it returns). */
|
|
1369
1386
|
builtLaunch = null;
|
|
1370
1387
|
preparedV2Store = null;
|
|
1388
|
+
/** #2738: a classic launch's compaction links, worked out in prepareLaunch on their worker lane (off the loop). */
|
|
1389
|
+
preparedClassicLinks = null;
|
|
1371
1390
|
/** #2648: the saved model of the v2 conversation this instance has recorded, read in prepareLaunch (off the loop). */
|
|
1372
1391
|
preparedV2Model = null;
|
|
1373
1392
|
storePreparation = 0;
|
|
@@ -1382,6 +1401,11 @@ export class KiroBackend {
|
|
|
1382
1401
|
}
|
|
1383
1402
|
return this.preparedV2Store.store;
|
|
1384
1403
|
}
|
|
1404
|
+
/** Not prepared for this launch: unproven, so the launch stays on the recorded conversation (never read here). */
|
|
1405
|
+
readPreparedClassicLinks(config) {
|
|
1406
|
+
return this.preparedClassicLinks?.key === this.storeKey(config) ? this.preparedClassicLinks.links
|
|
1407
|
+
: KIRO_CLASSIC_LINKS_NOT_PREPARED;
|
|
1408
|
+
}
|
|
1385
1409
|
/** Metadata only: identity claims/config writes remain synchronous, after
|
|
1386
1410
|
* the daemon rechecks its launch admission following this await. */
|
|
1387
1411
|
async prepareLaunch(config) {
|
|
@@ -1389,11 +1413,23 @@ export class KiroBackend {
|
|
|
1389
1413
|
this.preparedV2Store = null;
|
|
1390
1414
|
this.preparedV2Model = null;
|
|
1391
1415
|
this.preparedCarry = null;
|
|
1392
|
-
|
|
1416
|
+
this.preparedClassicLinks = null;
|
|
1417
|
+
if (!config)
|
|
1393
1418
|
return;
|
|
1394
1419
|
if (!this.fixedCompatibility)
|
|
1395
1420
|
this.compatibility = cachedKiroCliCompatibility(this.binaryPath).compatibility;
|
|
1396
1421
|
const key = this.storeKey(config);
|
|
1422
|
+
const classic = planKiroLaunch(config.kiroUi ?? "legacy", this.compatibility);
|
|
1423
|
+
if (classic.kind === "launch" && classic.flags.includes("--agent-engine=v1") && this.compatibility.supportsInstanceAgent && !config.skipResume) {
|
|
1424
|
+
// #2738: whether the recorded conversation was compacted reads every transcript of the key — a GB on a
|
|
1425
|
+
// long-lived instance. Worked out here on the worker lane; writeConfig only looks the answer up.
|
|
1426
|
+
const links = await readKiroClassicLinks(config.workingDirectory, kiroV1DbPath(resolveCredentialProfile(config.backendOptions)));
|
|
1427
|
+
if (preparation === this.storePreparation && key === this.storeKey(config))
|
|
1428
|
+
this.preparedClassicLinks = { key, links };
|
|
1429
|
+
return;
|
|
1430
|
+
}
|
|
1431
|
+
if (config.kiroUi !== "tui")
|
|
1432
|
+
return;
|
|
1397
1433
|
const plan = planKiroLaunch("tui", this.compatibility);
|
|
1398
1434
|
if (plan.kind !== "launch" || !plan.flags.includes("--agent-engine=v2") || !this.compatibility.supportsInstanceAgent)
|
|
1399
1435
|
return;
|
|
@@ -1611,6 +1647,8 @@ export class KiroBackend {
|
|
|
1611
1647
|
const lp = prepared ? this.launchPlan : this.planInstanceLaunch(config);
|
|
1612
1648
|
if (!prepared && lp.reason)
|
|
1613
1649
|
this.addLaunchWarning(lp.reason);
|
|
1650
|
+
if (!prepared)
|
|
1651
|
+
this.quietLaunchNotes.push(...lp.notes ?? []);
|
|
1614
1652
|
this.launchPlan = null;
|
|
1615
1653
|
this.activePlan = lp;
|
|
1616
1654
|
this.activeSpec = lp.mode === "legacy" ? null : this.agentSpec(config);
|
|
@@ -1747,6 +1785,8 @@ export class KiroBackend {
|
|
|
1747
1785
|
this.launchWarning = null;
|
|
1748
1786
|
return warning;
|
|
1749
1787
|
}
|
|
1788
|
+
quietLaunchNotes = [];
|
|
1789
|
+
consumeQuietLaunchNotes() { const notes = this.quietLaunchNotes; this.quietLaunchNotes = []; return notes; }
|
|
1750
1790
|
shouldWarnUnsupportedEffort() {
|
|
1751
1791
|
if (!this.compatibilityCacheKey) {
|
|
1752
1792
|
if (this.warnedUnsupportedEffort)
|
|
@@ -1784,6 +1824,7 @@ export class KiroBackend {
|
|
|
1784
1824
|
this.launchPlan = plan;
|
|
1785
1825
|
if (plan.reason)
|
|
1786
1826
|
this.addLaunchWarning(plan.reason);
|
|
1827
|
+
this.quietLaunchNotes.push(...plan.notes ?? []);
|
|
1787
1828
|
const spec = this.agentSpec(config);
|
|
1788
1829
|
const root = dirname(this.instanceDir);
|
|
1789
1830
|
if (plan.mode === "legacy") {
|
|
@@ -1935,7 +1976,7 @@ export class KiroBackend {
|
|
|
1935
1976
|
skipResume: config.skipResume,
|
|
1936
1977
|
agendHome,
|
|
1937
1978
|
readStore: () => engine === "v1"
|
|
1938
|
-
? listKiroV1Sessions(config.workingDirectory, kiroV1DbPath(credentialProfile))
|
|
1979
|
+
? listKiroV1Sessions(config.workingDirectory, kiroV1DbPath(credentialProfile), this.readPreparedClassicLinks(config))
|
|
1939
1980
|
: this.readPreparedV2Store(config),
|
|
1940
1981
|
launchedBefore: () => kiroLaunchedHereBefore(config.instanceName, config.workingDirectory, credentialProfile, engine),
|
|
1941
1982
|
upgradeAdoption: () => {
|
|
@@ -1956,10 +1997,12 @@ export class KiroBackend {
|
|
|
1956
1997
|
}
|
|
1957
1998
|
if (decision.mode === "legacy")
|
|
1958
1999
|
return legacy(t("kiro.identity_legacy", decision.reason));
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
2000
|
+
if (decision.mode === "resume") {
|
|
2001
|
+
return { ...base, mode: "resume", id: decision.id, agent, agentConfirmed: decision.agentConfirmed, reason: null, notes: kiroCompactionNotes(decision) };
|
|
2002
|
+
}
|
|
2003
|
+
const reasons = [decision.notice ? t(`kiro.upgrade_${decision.notice.replaceAll("-", "_")}`) : null,
|
|
2004
|
+
decision.lost ? t("kiro.claim_lost", decision.lost.id, t(`kiro.claim_lost_${decision.lost.claim.replaceAll("-", "_")}`)) : null];
|
|
2005
|
+
return { ...base, mode: "fresh", agent, agentConfirmed: true, reason: reasons.filter(r => r !== null).join("\n") || null };
|
|
1963
2006
|
}
|
|
1964
2007
|
/**
|
|
1965
2008
|
* After a resume as the instance's agent (#906 §3): what the daemon needs to read the active agent off the live
|