@getxflow/cli 0.10.0 → 0.10.1

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/state.js CHANGED
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.shouldNudge = shouldNudge;
4
+ exports.shouldNudgeSkill = shouldNudgeSkill;
5
+ exports.markSkillNudged = markSkillNudged;
4
6
  exports.markNudged = markNudged;
5
7
  const node_fs_1 = require("node:fs");
6
8
  const node_os_1 = require("node:os");
@@ -33,11 +35,43 @@ function shouldNudge(version) {
33
35
  return true;
34
36
  return Date.now() - at > NUDGE_INTERVAL_MS;
35
37
  }
36
- /** Best effort: a read-only home folder must not break the command that just worked. */
38
+ /**
39
+ * Same window, but per stale copy rather than per version. The key carries the CLI
40
+ * version, so the day a release actually changes the skill the notice speaks again
41
+ * instead of staying quiet on yesterday's answer.
42
+ *
43
+ * A window and not a single "already said it": the copy stays wrong until somebody
44
+ * refreshes it, and an agent whose session starts tomorrow has to hear about it too.
45
+ */
46
+ function shouldNudgeSkill(key) {
47
+ if (process.env.CI)
48
+ return false;
49
+ const at = read().skillNudgedAt?.[key];
50
+ const said = at ? Date.parse(at) : Number.NaN;
51
+ if (!Number.isFinite(said))
52
+ return true;
53
+ return Date.now() - said > NUDGE_INTERVAL_MS;
54
+ }
55
+ /** Entries pile up across versions and folders, so the stale ones go on every write. */
56
+ function markSkillNudged(key) {
57
+ const now = Date.now();
58
+ const kept = {};
59
+ for (const [seen, at] of Object.entries(read().skillNudgedAt ?? {})) {
60
+ const said = Date.parse(at);
61
+ if (Number.isFinite(said) && now - said < NUDGE_INTERVAL_MS * 30)
62
+ kept[seen] = at;
63
+ }
64
+ kept[key] = new Date(now).toISOString();
65
+ write({ skillNudgedAt: kept });
66
+ }
37
67
  function markNudged(version) {
68
+ write({ nudgedVersion: version, nudgedAt: new Date().toISOString() });
69
+ }
70
+ /** Best effort: a read-only home folder must not break the command that just worked. */
71
+ function write(patch) {
38
72
  try {
39
73
  (0, node_fs_1.mkdirSync)((0, node_path_1.join)((0, node_os_1.homedir)(), '.xflow'), { recursive: true, mode: 0o700 });
40
- const state = { ...read(), nudgedVersion: version, nudgedAt: new Date().toISOString() };
74
+ const state = { ...read(), ...patch };
41
75
  (0, node_fs_1.writeFileSync)(statePath(), `${JSON.stringify(state, null, 2)}\n`, 'utf-8');
42
76
  }
43
77
  catch {
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.10.0';
5
+ exports.CLI_VERSION = '0.10.1';
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
@@ -1,24 +1,24 @@
1
- {
2
- "name": "@getxflow/cli",
3
- "version": "0.10.0",
4
- "description": "CLI for the XFlow platform: source sync, deployment and publishing of applications",
5
- "license": "UNLICENSED",
6
- "engines": {
7
- "node": ">=20"
8
- },
9
- "bin": {
10
- "xflow": "dist/bin.js"
11
- },
12
- "files": [
13
- "dist",
14
- "skills"
15
- ],
16
- "scripts": {
17
- "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
18
- "build": "npm run clean && tsc -p tsconfig.json",
19
- "prepublishOnly": "npm run build"
20
- },
21
- "publishConfig": {
22
- "access": "public"
23
- }
24
- }
1
+ {
2
+ "name": "@getxflow/cli",
3
+ "version": "0.10.1",
4
+ "description": "CLI for the XFlow platform: source sync, deployment and publishing of applications",
5
+ "license": "UNLICENSED",
6
+ "engines": {
7
+ "node": ">=20"
8
+ },
9
+ "bin": {
10
+ "xflow": "dist/bin.js"
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "skills"
15
+ ],
16
+ "scripts": {
17
+ "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
18
+ "build": "npm run clean && tsc -p tsconfig.json",
19
+ "prepublishOnly": "npm run build"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ }
24
+ }