@guiho/runx 0.4.1 → 0.5.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/DOCS.md +24 -4
  3. package/README.md +6 -1
  4. package/devops/build-binaries.ts +3 -3
  5. package/devops/devops.xdocs.md +9 -6
  6. package/devops/extract-release-notes.spec.ts +54 -0
  7. package/devops/extract-release-notes.ts +40 -0
  8. package/devops/install.ps1 +29 -6
  9. package/devops/install.sh +36 -11
  10. package/devops/installers.spec.ts +152 -5
  11. package/devops/verify-release-assets.ts +14 -0
  12. package/docs/architecture/architecture.xdocs.md +2 -1
  13. package/docs/architecture/cli-architecture.md +18 -9
  14. package/docs/decisions/decisions.xdocs.md +4 -0
  15. package/docs/decisions/markdown-release-assets-and-version-scoped-notes.md +84 -0
  16. package/docs/plans/automatic-agent-maintenance.md +120 -0
  17. package/docs/plans/plans.xdocs.md +2 -0
  18. package/docs/plans/rfc-0034-cli-compliance-migration.md +17 -8
  19. package/docs/plans/upgrade-reliability-implementation.md +1 -1
  20. package/docs/reviews/implementation/automatic-agent-maintenance-review.md +63 -0
  21. package/docs/reviews/implementation/bash-installer-review.md +42 -0
  22. package/docs/reviews/implementation/implementation.xdocs.md +10 -0
  23. package/docs/reviews/implementation/rfc-0034-cli-compliance-migration-review.md +5 -2
  24. package/docs/reviews/implementation/unicode-help-tree-review.md +41 -0
  25. package/docs/reviews/implementation/upgrade-reliability-issue-12-review.md +62 -0
  26. package/docs/reviews/implementation/upgrade-reliability-issue-13-review.md +63 -0
  27. package/docs/reviews/plans/automatic-agent-maintenance-review.md +56 -0
  28. package/docs/reviews/plans/plans.xdocs.md +2 -0
  29. package/docs/superpowers/specs/2026-07-15-upgrade-reliability-design.md +1 -1
  30. package/docs/todo/automatic-agent-maintenance-implementation.md +55 -0
  31. package/docs/todo/automatic-agent-maintenance.md +86 -0
  32. package/docs/todo/bash-installer.md +45 -0
  33. package/docs/todo/rfc-0034-cli-compliance-migration-implementation.md +7 -2
  34. package/docs/todo/rfc-0034-cli-compliance-migration.md +7 -3
  35. package/docs/todo/todo.xdocs.md +10 -0
  36. package/docs/todo/unicode-help-tree.md +44 -0
  37. package/docs/todo/upgrade-reliability.md +51 -0
  38. package/docs/validation/automatic-agent-maintenance.md +63 -0
  39. package/docs/validation/bash-installer.md +55 -0
  40. package/docs/validation/rfc-0034-cli-compliance-migration.md +10 -4
  41. package/docs/validation/unicode-help-tree.md +43 -0
  42. package/docs/validation/upgrade-reliability-issue-12.md +74 -0
  43. package/docs/validation/upgrade-reliability-issue-13.md +72 -0
  44. package/docs/validation/upgrade-reliability.md +38 -99
  45. package/docs/validation/validation.xdocs.md +12 -2
  46. package/library/agent-maintenance.d.ts +19 -0
  47. package/library/agent-maintenance.d.ts.map +1 -0
  48. package/library/agent-maintenance.js +49 -0
  49. package/library/agents.d.ts +6 -1
  50. package/library/agents.d.ts.map +1 -1
  51. package/library/agents.js +58 -11
  52. package/library/cli.d.ts.map +1 -1
  53. package/library/cli.js +24 -7
  54. package/library/recovery.js +1 -1
  55. package/library/release-catalog.d.ts +2 -1
  56. package/library/release-catalog.d.ts.map +1 -1
  57. package/library/release-catalog.js +9 -1
  58. package/library/storage.d.ts +2 -1
  59. package/library/storage.d.ts.map +1 -1
  60. package/library/storage.js +13 -1
  61. package/package.json +1 -1
  62. package/skills/guiho-s-runx/SKILL.md +11 -0
  63. package/skills/guiho-s-runx/guiho-s-runx.xdocs.md +4 -1
@@ -2,7 +2,7 @@
2
2
  * @copyright Copyright © 2026 GUIHO Technologies as represented by Cristóvão GUIHO. All Rights Reserved.
3
3
  */
4
4
  import type { ReleaseAsset, ReleaseCatalog, UpgradeArch, UpgradeOs, UpgradeVariant } from './upgrade-types.js';
5
- export { assetCandidates, fetchReleaseCatalog, findCompatibleAsset, normalizeReleaseVersion, resolveUpgradePlatform, };
5
+ export { assetCandidates, fetchReleaseCatalog, findCompatibleAsset, normalizeReleaseVersion, paginateReleaseCatalog, resolveUpgradePlatform, };
6
6
  declare const githubReleaseSchema: import("@sinclair/typebox").TObject<{
7
7
  tag_name: import("@sinclair/typebox").TString;
8
8
  draft: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
@@ -29,4 +29,5 @@ declare const findCompatibleAsset: (release: GitHubRelease, platform: ReleasePla
29
29
  declare const assetCandidates: ({ os, arch, variant }: ReleasePlatform) => string[];
30
30
  declare const resolveUpgradePlatform: (platform?: NodeJS.Platform, architecture?: NodeJS.Architecture) => ReleasePlatform;
31
31
  declare const normalizeReleaseVersion: (tag: string) => string;
32
+ declare const paginateReleaseCatalog: (catalog: ReleaseCatalog, page?: number, perPage?: number) => ReleaseCatalog;
32
33
  //# sourceMappingURL=release-catalog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"release-catalog.d.ts","sourceRoot":"","sources":["../source/release-catalog.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAuB,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnI,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,GACvB,CAAA;AAED,QAAA,MAAM,mBAAmB;;;;;;;;;;EAUS,CAAA;AAIlC,MAAM,MAAM,aAAa,GAAG,OAAO,mBAAmB,EAAE,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE1F,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,SAAS,CAAA;IACb,IAAI,EAAE,WAAW,CAAA;IACjB,OAAO,EAAE,cAAc,CAAA;CACxB,CAAA;AAED,KAAK,mBAAmB,GAAG,eAAe,GAAG;IAC3C,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;CACzB,CAAA;AAID,QAAA,MAAM,mBAAmB,YAAmB,mBAAmB,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sB,sEAA+D,eAM1F,CAAA;AAED,QAAA,MAAM,uBAAuB,QAAS,MAAM,KAAG,MAA6D,CAAA;AAE5G,QAAA,MAAM,sBAAsB,YAAa,cAAc,SAAS,MAAM,YAAY,MAAM,KAAG,cAM1F,CAAA"}
@@ -5,7 +5,7 @@ import { Type } from '@sinclair/typebox';
5
5
  import { Value } from '@sinclair/typebox/value';
6
6
  import { compare, parse, valid } from 'semver';
7
7
  import { RunXError } from './errors.js';
8
- export { assetCandidates, fetchReleaseCatalog, findCompatibleAsset, normalizeReleaseVersion, resolveUpgradePlatform, };
8
+ export { assetCandidates, fetchReleaseCatalog, findCompatibleAsset, normalizeReleaseVersion, paginateReleaseCatalog, resolveUpgradePlatform, };
9
9
  const githubReleaseSchema = Type.Object({
10
10
  tag_name: Type.String(),
11
11
  draft: Type.Optional(Type.Boolean()),
@@ -100,6 +100,14 @@ const resolveUpgradePlatform = (platform = process.platform, architecture = proc
100
100
  return { os, arch, variant: 'baseline' };
101
101
  };
102
102
  const normalizeReleaseVersion = (tag) => tag.replace(/^@guiho\/runx@/, '').replace(/^v/, '');
103
+ const paginateReleaseCatalog = (catalog, page, perPage) => {
104
+ if (page === undefined && perPage === undefined)
105
+ return catalog;
106
+ const selectedPage = page ?? 1;
107
+ const selectedPageSize = perPage ?? 20;
108
+ const start = (selectedPage - 1) * selectedPageSize;
109
+ return { ...catalog, releases: catalog.releases.slice(start, start + selectedPageSize) };
110
+ };
103
111
  const releaseChannel = (version, prerelease) => {
104
112
  const parsed = parse(version);
105
113
  if (!parsed)
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @copyright Copyright © 2026 GUIHO Technologies as represented by Cristóvão GUIHO. All Rights Reserved.
3
3
  */
4
- export { copyTextFile, ensureDirectory, globalRunXDirectory, movePath, pathExists, readTextIfExists, removePath, writeTextFile, };
4
+ export { copyTextFile, ensureDirectory, globalRunXDirectory, movePath, pathExists, readTextIfExists, removePath, writeTextFile, writeTextFileAtomic, };
5
5
  declare function globalRunXDirectory(): string;
6
6
  declare function pathExists(path: string): Promise<boolean>;
7
7
  declare function ensureDirectory(path: string): Promise<void>;
@@ -9,5 +9,6 @@ declare function removePath(path: string): Promise<void>;
9
9
  declare function movePath(from: string, to: string): Promise<void>;
10
10
  declare function readTextIfExists(path: string): Promise<string | null>;
11
11
  declare function writeTextFile(path: string, value: string): Promise<void>;
12
+ declare function writeTextFileAtomic(path: string, value: string): Promise<void>;
12
13
  declare function copyTextFile(source: string, target: string): Promise<void>;
13
14
  //# sourceMappingURL=storage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../source/storage.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EACL,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,aAAa,GACd,CAAA;AAED,iBAAS,mBAAmB,IAAI,MAAM,CAErC;AAED,iBAAe,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAExD;AAED,iBAAe,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1D;AAED,iBAAe,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAErD;AAED,iBAAe,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ/D;AAED,iBAAe,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAEpE;AAED,iBAAe,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGvE;AAED,iBAAe,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE"}
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../source/storage.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EACL,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,mBAAmB,GACpB,CAAA;AAED,iBAAS,mBAAmB,IAAI,MAAM,CAErC;AAED,iBAAe,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAExD;AAED,iBAAe,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1D;AAED,iBAAe,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAErD;AAED,iBAAe,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ/D;AAED,iBAAe,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAEpE;AAED,iBAAe,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGvE;AAED,iBAAe,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAU7E;AAED,iBAAe,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE"}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { $ } from 'bun';
5
5
  import { directoryName, homeDirectory, joinPath } from './path-utils.js';
6
- export { copyTextFile, ensureDirectory, globalRunXDirectory, movePath, pathExists, readTextIfExists, removePath, writeTextFile, };
6
+ export { copyTextFile, ensureDirectory, globalRunXDirectory, movePath, pathExists, readTextIfExists, removePath, writeTextFile, writeTextFileAtomic, };
7
7
  function globalRunXDirectory() {
8
8
  return joinPath(homeDirectory(), '.guiho', 'runx');
9
9
  }
@@ -33,6 +33,18 @@ async function writeTextFile(path, value) {
33
33
  await ensureDirectory(directoryName(path));
34
34
  await Bun.write(path, value);
35
35
  }
36
+ async function writeTextFileAtomic(path, value) {
37
+ await ensureDirectory(directoryName(path));
38
+ const temporary = `${path}.${process.pid}.${crypto.randomUUID()}.tmp`;
39
+ try {
40
+ await Bun.write(temporary, value);
41
+ await movePath(temporary, path);
42
+ }
43
+ catch (error) {
44
+ await removePath(temporary);
45
+ throw error;
46
+ }
47
+ }
36
48
  async function copyTextFile(source, target) {
37
49
  await writeTextFile(target, await Bun.file(source).text());
38
50
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@guiho/runx",
3
3
  "description": "A language-agnostic, documented command catalog and local CLI executor.",
4
- "version": "0.4.1",
4
+ "version": "0.5.1",
5
5
  "type": "module",
6
6
  "main": "./library/guiho-runx.js",
7
7
  "types": "./library/guiho-runx.d.ts",
@@ -76,3 +76,14 @@ runx upgrade --dry-run
76
76
 
77
77
  Use `--help`, `--help-tree`, or `--help-docs` at any command scope for the
78
78
  current executable contract.
79
+
80
+ ## Automatic Agent Maintenance
81
+
82
+ Ordinary RunX commands schedule a silent, non-blocking worker that keeps the
83
+ bundled skill current in both global agent-tool directories and reconciles one
84
+ compact managed block in the nearest `AGENTS.md`. A current installation is not
85
+ rewritten. Automatic failures never fail or pollute the foreground command.
86
+
87
+ Explicit `runx agent ...` commands remain the manual repair and local-scope
88
+ interface. Explicit agent-resource removal and `runx uninstall` do not schedule
89
+ automatic reinstallation.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  subject: guiho-s-runx
3
- description: Agent workflow for safe RunX catalog execution and verified native upgrade/list/recovery operations.
3
+ description: Agent workflow for safe RunX catalog work, automatic resource maintenance, and verified native upgrade/list/recovery operations.
4
4
  parent: runx-skills
5
5
  children: []
6
6
  files:
@@ -17,6 +17,7 @@ keywords:
17
17
  - dry run
18
18
  - runx upgrade
19
19
  - recovery install
20
+ - automatic maintenance
20
21
  flags: []
21
22
  status: stable
22
23
  ---
@@ -24,3 +25,5 @@ status: stable
24
25
  The skill makes manifest inspection, UID selection, dry runs, and explicit
25
26
  confirmation the default agent workflow for RunX commands and teaches agents
26
27
  how to interpret transactional native upgrades and their recovery contract.
28
+ Ordinary RunX invocations also reconcile the current global skill and nearest
29
+ managed project instruction block through a silent detached worker.