@skrr-ai/cli 0.1.62 → 0.1.63
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.
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
const daemon_binding_1 = require("../../lib/daemon-binding");
|
|
5
5
|
const exec_runtime_binary_1 = require("../../lib/exec-runtime-binary");
|
|
6
|
+
const live_runtime_binary_1 = require("../../lib/live-runtime-binary");
|
|
6
7
|
/**
|
|
7
8
|
* `skrr daemon login` — authenticate the local runtime.
|
|
8
9
|
*
|
|
@@ -37,11 +38,28 @@ class DaemonLogin extends core_1.Command {
|
|
|
37
38
|
// (OSK-296).
|
|
38
39
|
const argv = this.argv;
|
|
39
40
|
try {
|
|
41
|
+
const boundArgv = (0, daemon_binding_1.bindToCliSession)(argv);
|
|
42
|
+
// A re-login must prove the key the running service uses. A development
|
|
43
|
+
// skrrd earlier on PATH can have a different auth configuration and
|
|
44
|
+
// silently leave the service's server pin unchanged (OSK-12758).
|
|
45
|
+
const pathBinary = (0, exec_runtime_binary_1.findRuntimeBinary)();
|
|
46
|
+
const decision = pathBinary
|
|
47
|
+
? (0, live_runtime_binary_1.decideStatusBinary)(pathBinary, (0, live_runtime_binary_1.profileFromArgs)(boundArgv), (0, live_runtime_binary_1.defaultLiveRuntimeDeps)())
|
|
48
|
+
: null;
|
|
49
|
+
if (decision?.kind === 'mismatch') {
|
|
50
|
+
this.error(`The live daemon runs ${decision.live}, but this command found ${decision.binary} on PATH. ` +
|
|
51
|
+
'Run login with the live daemon program so it proves the same device key.');
|
|
52
|
+
}
|
|
53
|
+
if (decision?.kind === 'forward-live') {
|
|
54
|
+
this.warn(`Signing in with the live daemon binary ${decision.binary}.`);
|
|
55
|
+
}
|
|
40
56
|
// `--cwd` is deliberately NOT defaulted here. `skrrd login` resolves it
|
|
41
57
|
// from the installed service definition, which is the only authoritative
|
|
42
58
|
// answer; guessing it from the CLI's cwd is exactly the mistake that made
|
|
43
59
|
// the old default wrong.
|
|
44
|
-
const code = await (0, exec_runtime_binary_1.execRuntimeBinary)(['login', ...
|
|
60
|
+
const code = await (0, exec_runtime_binary_1.execRuntimeBinary)(['login', ...boundArgv], {
|
|
61
|
+
binary: decision?.binary,
|
|
62
|
+
});
|
|
45
63
|
this.exit(code);
|
|
46
64
|
}
|
|
47
65
|
catch (err) {
|
|
@@ -214,8 +214,8 @@ function notInstalledMessage() {
|
|
|
214
214
|
*/
|
|
215
215
|
function execRuntimeBinary(args, opts = {}) {
|
|
216
216
|
return new Promise((resolve, reject) => {
|
|
217
|
-
// `binary` lets
|
|
218
|
-
// the first one on PATH (OSK-12102)
|
|
217
|
+
// `binary` lets status and login use the LIVE daemon's program rather than
|
|
218
|
+
// the first one on PATH (OSK-12102, OSK-12758).
|
|
219
219
|
const bin = opts.binary ?? findRuntimeBinary();
|
|
220
220
|
if (!bin) {
|
|
221
221
|
reject(new Error('runtime-binary-not-installed'));
|
|
@@ -10,7 +10,8 @@ exports.scriptFromArgs = scriptFromArgs;
|
|
|
10
10
|
exports.defaultLiveRuntimeDeps = defaultLiveRuntimeDeps;
|
|
11
11
|
/**
|
|
12
12
|
* Which runtime binary is the LIVE daemon running, and is it the one
|
|
13
|
-
* `skrr daemon status` is about to forward to?
|
|
13
|
+
* `skrr daemon status` or `skrr daemon login` is about to forward to?
|
|
14
|
+
* (OSK-12102, OSK-12758)
|
|
14
15
|
*
|
|
15
16
|
* `execRuntimeBinary` forwards to the first `skrrd` on PATH. That is right for
|
|
16
17
|
* lifecycle verbs, where PATH order is the person's choice of install. It is
|
|
@@ -48514,7 +48514,7 @@ exports.ACCEPTED_AGENT_TRIGGER_FIRE_OUTCOMES = ["succeeded", "in_progress", "awa
|
|
|
48514
48514
|
var r2 = null === (t2 = e2.resolution) || void 0 === t2 ? void 0 : t2.closure;
|
|
48515
48515
|
return r2 ? (null !== (o2 = null === (n2 = r2.overrode) || void 0 === n2 ? void 0 : n2.length) && void 0 !== o2 ? o2 : 0) > 0 ? "overridden" : false === r2.closable ? "open_items" : r2.degraded ? "unrecorded" : "clean" : "unrecorded";
|
|
48516
48516
|
}, exports.deriveTaskCompletion = function(e2) {
|
|
48517
|
-
var t2, n2 = (function(e3) {
|
|
48517
|
+
var t2, n2, o2 = (function(e3) {
|
|
48518
48518
|
for (var t3 = false !== e3.evidenceRead, n3 = (e3.deliverables || []).filter(function(e4) {
|
|
48519
48519
|
return gb(e4);
|
|
48520
48520
|
}), o3 = null, r3 = 0, a3 = n3; r3 < a3.length; r3++) {
|
|
@@ -48526,23 +48526,23 @@ exports.ACCEPTED_AGENT_TRIGGER_FIRE_OUTCOMES = ["succeeded", "in_progress", "awa
|
|
|
48526
48526
|
if (!(function(e3) {
|
|
48527
48527
|
return e3.statusType ? "completed" === e3.statusType : "done" === e3.status;
|
|
48528
48528
|
})(e2)) {
|
|
48529
|
-
var
|
|
48530
|
-
return { state: "not_done", label: hb.not_done, sentence: "".concat(hb.not_done, ", because ").concat(Tb(
|
|
48529
|
+
var r2 = Sb(e2);
|
|
48530
|
+
return { state: "not_done", label: hb.not_done, sentence: "".concat(hb.not_done, ", because ").concat(Tb(r2.text)), reason: r2, alsoOutstanding: [], evidence: o2 };
|
|
48531
48531
|
}
|
|
48532
|
-
var
|
|
48533
|
-
|
|
48534
|
-
for (var
|
|
48535
|
-
var
|
|
48536
|
-
|
|
48532
|
+
var a2 = [], i2 = e2.closure;
|
|
48533
|
+
o2.read || a2.push("The record of what was produced could not be read just now."), (null === (t2 = null == i2 ? void 0 : i2.overrode) || void 0 === t2 ? void 0 : t2.length) && a2.push("Someone closed it past a gate its owner had declared.");
|
|
48534
|
+
for (var s2 = 0, c2 = Gy(i2); s2 < c2.length; s2++) {
|
|
48535
|
+
var l2 = c2[s2];
|
|
48536
|
+
a2.push(l2);
|
|
48537
48537
|
}
|
|
48538
|
-
if (
|
|
48539
|
-
var
|
|
48538
|
+
if (i2 || a2.push("It was closed before the platform recorded what it was closed over."), o2.read && (0 === o2.arrived ? a2.push((null === (n2 = e2.deliverables) || void 0 === n2 ? void 0 : n2.some(Boolean)) ? "A deliverable is recorded, but its availability has not been confirmed." : "No deliverable is recorded for this task.") : o2.aboveSelfReport || a2.push("The only thing standing behind what it produced is ".concat(lb(o2.highestLevel), "."))), 0 === a2.length) {
|
|
48539
|
+
var u2 = "".concat((function(e3) {
|
|
48540
48540
|
return e3 ? e3[0].toUpperCase() + e3.slice(1) : e3;
|
|
48541
|
-
})(lb(
|
|
48542
|
-
return { state: "done_and_checked", label: hb.done_and_checked, sentence: "".concat(hb.done_and_checked, " \u2014 ").concat(Tb(
|
|
48541
|
+
})(lb(o2.highestLevel)), " stands behind what it produced.");
|
|
48542
|
+
return { state: "done_and_checked", label: hb.done_and_checked, sentence: "".concat(hb.done_and_checked, " \u2014 ").concat(Tb(u2)), reason: { text: u2, phrased: true, code: null }, alsoOutstanding: [], evidence: o2 };
|
|
48543
48543
|
}
|
|
48544
|
-
var
|
|
48545
|
-
return { state: "done_needs_your_eyes", label: hb.done_needs_your_eyes, sentence: "".concat(hb.done_needs_your_eyes, " \u2014 ").concat(Tb(
|
|
48544
|
+
var d2 = a2[0], p2 = a2.slice(1);
|
|
48545
|
+
return { state: "done_needs_your_eyes", label: hb.done_needs_your_eyes, sentence: "".concat(hb.done_needs_your_eyes, " \u2014 ").concat(Tb(d2)), reason: { text: d2, phrased: true, code: null }, alsoOutstanding: p2, evidence: o2 };
|
|
48546
48546
|
}, exports.deriveWorkEdges = function(e2) {
|
|
48547
48547
|
for (var t2, n2, o2 = /* @__PURE__ */ new Map(), r2 = 0, a2 = e2; r2 < a2.length; r2++) {
|
|
48548
48548
|
var i2 = a2[r2];
|