@getxflow/cli 0.11.0 → 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/commands/db.js +5 -6
- package/dist/state.js +5 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/skills/xflow/SKILL.md +9 -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/commands/db.js
CHANGED
|
@@ -177,14 +177,13 @@ async function dbQuery(args) {
|
|
|
177
177
|
}
|
|
178
178
|
(0, ui_1.table)([data.columns, ...data.rows.map((row) => data.columns.map((column) => cell(row[column])))]);
|
|
179
179
|
if (data.truncated) {
|
|
180
|
-
//
|
|
181
|
-
//
|
|
182
|
-
// the flag
|
|
183
|
-
// says so only while there is room left.
|
|
180
|
+
// No exact total here: the platform stops reading at limit + 1 rows, so all
|
|
181
|
+
// it knows is that more exist. The "raise --limit" advice shows only while
|
|
182
|
+
// the flag still has room below the ceiling.
|
|
184
183
|
const room = data.limit !== undefined && data.limit_max !== undefined && data.limit < data.limit_max;
|
|
185
184
|
(0, ui_1.note)((0, ui_1.dim)(room
|
|
186
|
-
? ` Shown ${data.rows.length}
|
|
187
|
-
: ` Shown ${data.rows.length}
|
|
185
|
+
? ` Shown the first ${data.rows.length} rows, more exist: raise --limit (up to ${data.limit_max}), or narrow the query`
|
|
186
|
+
: ` Shown the first ${data.rows.length} rows, more exist: narrow the query, with a where clause or an offset`));
|
|
188
187
|
}
|
|
189
188
|
}
|
|
190
189
|
async function dbMigrate(args) {
|
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.
|
|
@@ -235,6 +235,13 @@ enforces this, but a project where every function answers its own way costs an a
|
|
|
235
235
|
on every call. Branch the frontend on `error.code`, never on `error.message`: wording
|
|
236
236
|
gets rewritten on any edit, a code does not.
|
|
237
237
|
|
|
238
|
+
How a non-2xx answer reaches the page depends on the generation of `src/lib/xflow.ts`
|
|
239
|
+
in the project, so look at that file before writing the catch: a copy that declares
|
|
240
|
+
`XFlowError` throws it carrying `code` and `status`, and a copy that says nothing about
|
|
241
|
+
errors is older and throws a plain `Error` whose message is all there is. In an older
|
|
242
|
+
project, a function that wants its error text seen on the page answers `200` with
|
|
243
|
+
`{ success: false, error }` in the body.
|
|
244
|
+
|
|
238
245
|
The sources are the whole truth about which functions exist. Delete the directory and the
|
|
239
246
|
next deploy would delete the function from the cloud, schedules included, and that cannot be
|
|
240
247
|
undone: a function created again later gets a different address. So never remove a function
|