@getxflow/cli 0.11.1 → 0.11.2
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/api.js +1 -0
- package/dist/bin.js +16 -7
- package/dist/state.js +5 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/skills/xflow/SKILL.md +2 -2
package/dist/api.js
CHANGED
package/dist/bin.js
CHANGED
|
@@ -227,13 +227,15 @@ function nudge() {
|
|
|
227
227
|
}
|
|
228
228
|
/**
|
|
229
229
|
* The other staleness, and the one that costs more: the instructions an agent reads are
|
|
230
|
-
*
|
|
231
|
-
* than the notice above because it is wrong now rather than out of date soon, and
|
|
232
|
-
* the file, because a machine can hold a dozen copies and the wrong one gets edited.
|
|
230
|
+
* not the ones the CLI answering it ships, and nothing about that is visible in the text.
|
|
231
|
+
* Louder than the notice above because it is wrong now rather than out of date soon, and
|
|
232
|
+
* it names the file, because a machine can hold a dozen copies and the wrong one gets edited.
|
|
233
233
|
*
|
|
234
234
|
* The command is skills --refresh, not update: what is out of step here is the copies, not
|
|
235
235
|
* the package, and refreshing needs no network, no npm and no rights on a global folder.
|
|
236
|
-
* The re-read is half the repair, so it is in the same breath as the command.
|
|
236
|
+
* The re-read is half the repair, so it is in the same breath as the command. Except when
|
|
237
|
+
* a newer CLI is known: then the package itself is behind, a refresh would rewrite the
|
|
238
|
+
* copies from it, and the update notice above is the whole advice.
|
|
237
239
|
*/
|
|
238
240
|
function nudgeSkill() {
|
|
239
241
|
const stale = (0, skills_1.staleSkillCopy)(process.cwd());
|
|
@@ -243,10 +245,17 @@ function nudgeSkill() {
|
|
|
243
245
|
(0, state_1.clearSkillNudges)();
|
|
244
246
|
return;
|
|
245
247
|
}
|
|
248
|
+
// A newer CLI is published: the copy that differs may well be ahead of this package,
|
|
249
|
+
// and a refresh would "repair" it backwards. The update notice is the whole advice —
|
|
250
|
+
// xflow update brings the package and every copy along. Network-free commands see no
|
|
251
|
+
// headers, so the version an earlier notice named counts as known too.
|
|
252
|
+
const nudged = (0, state_1.lastNudgedVersion)();
|
|
253
|
+
if ((0, api_1.newerVersionSeen)() !== null || (nudged !== null && (0, api_1.isOlder)(version_1.CLI_VERSION, nudged)))
|
|
254
|
+
return;
|
|
246
255
|
const key = `${stale} ${version_1.CLI_VERSION}`;
|
|
247
256
|
if (!(0, state_1.shouldNudgeSkill)(key))
|
|
248
257
|
return;
|
|
249
|
-
(0, ui_1.warn)(`${stale}
|
|
258
|
+
(0, ui_1.warn)(`${stale} does not match this CLI`);
|
|
250
259
|
(0, ui_1.note)((0, ui_1.dim)(' Run xflow skills --refresh, then read that file again: the refresh only writes it to disk'));
|
|
251
260
|
(0, state_1.markSkillNudged)(key);
|
|
252
261
|
}
|
|
@@ -304,8 +313,8 @@ async function main() {
|
|
|
304
313
|
if (!quiet)
|
|
305
314
|
nudge();
|
|
306
315
|
// Not behind the same flag: a copy out of step with the running package stays wrong
|
|
307
|
-
// whatever the command was, and when the package itself is the problem
|
|
308
|
-
//
|
|
316
|
+
// whatever the command was, and when the package itself is the problem this steps
|
|
317
|
+
// aside on its own.
|
|
309
318
|
nudgeSkill();
|
|
310
319
|
}
|
|
311
320
|
}
|
package/dist/state.js
CHANGED
|
@@ -5,6 +5,7 @@ exports.shouldNudgeSkill = shouldNudgeSkill;
|
|
|
5
5
|
exports.markSkillNudged = markSkillNudged;
|
|
6
6
|
exports.clearSkillNudges = clearSkillNudges;
|
|
7
7
|
exports.markNudged = markNudged;
|
|
8
|
+
exports.lastNudgedVersion = lastNudgedVersion;
|
|
8
9
|
const node_fs_1 = require("node:fs");
|
|
9
10
|
const node_os_1 = require("node:os");
|
|
10
11
|
const node_path_1 = require("node:path");
|
|
@@ -78,6 +79,10 @@ function clearSkillNudges() {
|
|
|
78
79
|
function markNudged(version) {
|
|
79
80
|
write({ nudgedVersion: version, nudgedAt: new Date().toISOString() });
|
|
80
81
|
}
|
|
82
|
+
/** What the update notice last named, for callers that outlive the process that saw it. */
|
|
83
|
+
function lastNudgedVersion() {
|
|
84
|
+
return read().nudgedVersion ?? null;
|
|
85
|
+
}
|
|
81
86
|
/** Best effort: a read-only home folder must not break the command that just worked. */
|
|
82
87
|
function write(patch) {
|
|
83
88
|
try {
|
package/dist/version.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEFAULT_API_URL = exports.CLI_VERSION = void 0;
|
|
4
4
|
/** Keep in sync with cli/package.json. */
|
|
5
|
-
exports.CLI_VERSION = '0.11.
|
|
5
|
+
exports.CLI_VERSION = '0.11.2';
|
|
6
6
|
/** Overridden by XFLOW_API_URL or the `api` field in xflow.json. */
|
|
7
7
|
exports.DEFAULT_API_URL = 'https://app.getxflow.com';
|
package/package.json
CHANGED
package/skills/xflow/SKILL.md
CHANGED
|
@@ -24,11 +24,11 @@ contains the fix.
|
|
|
24
24
|
|
|
25
25
|
## Keeping these instructions current
|
|
26
26
|
|
|
27
|
-
These instructions ship with xflow CLI 0.11.
|
|
27
|
+
These instructions ship with xflow CLI 0.11.2. They travel inside the package, so the copy
|
|
28
28
|
you are reading can be older than the CLI answering your commands, and nothing about that
|
|
29
29
|
is visible in the text itself.
|
|
30
30
|
|
|
31
|
-
When the CLI says this file
|
|
31
|
+
When the CLI says this file does not match it, run `xflow skills --refresh` and then **read
|
|
32
32
|
again the file it names**. Refreshing only writes new text to disk; until you re-read it you
|
|
33
33
|
are still working from the old rules, and the command will look like it did nothing. This
|
|
34
34
|
repair is yours to make, no need to ask anyone.
|