@revition/cli 0.0.0-reserved → 0.1.0-canary.2a173bc

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 (161) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +8 -0
  3. package/bin/corvito +5 -0
  4. package/bin/run +30 -0
  5. package/dist/background-worker.d.ts +1 -0
  6. package/dist/background-worker.js +40 -0
  7. package/dist/background-worker.js.map +1 -0
  8. package/dist/bundle/startup.js +16167 -0
  9. package/dist/commands/auth/status.d.ts +22 -0
  10. package/dist/commands/auth/status.js +49 -0
  11. package/dist/commands/auth/status.js.map +1 -0
  12. package/dist/commands/autocomplete.d.ts +17 -0
  13. package/dist/commands/autocomplete.js +41 -0
  14. package/dist/commands/autocomplete.js.map +1 -0
  15. package/dist/commands/commands.d.ts +35 -0
  16. package/dist/commands/commands.js +49 -0
  17. package/dist/commands/commands.js.map +1 -0
  18. package/dist/commands/config/edit.d.ts +12 -0
  19. package/dist/commands/config/edit.js +40 -0
  20. package/dist/commands/config/edit.js.map +1 -0
  21. package/dist/commands/config/get.d.ts +16 -0
  22. package/dist/commands/config/get.js +29 -0
  23. package/dist/commands/config/get.js.map +1 -0
  24. package/dist/commands/config/list.d.ts +13 -0
  25. package/dist/commands/config/list.js +26 -0
  26. package/dist/commands/config/list.js.map +1 -0
  27. package/dist/commands/config/path.d.ts +8 -0
  28. package/dist/commands/config/path.js +22 -0
  29. package/dist/commands/config/path.js.map +1 -0
  30. package/dist/commands/config/set.d.ts +21 -0
  31. package/dist/commands/config/set.js +46 -0
  32. package/dist/commands/config/set.js.map +1 -0
  33. package/dist/commands/config/unset.d.ts +16 -0
  34. package/dist/commands/config/unset.js +28 -0
  35. package/dist/commands/config/unset.js.map +1 -0
  36. package/dist/commands/doctor.d.ts +8 -0
  37. package/dist/commands/doctor.js +97 -0
  38. package/dist/commands/doctor.js.map +1 -0
  39. package/dist/commands/flags/probe.d.ts +22 -0
  40. package/dist/commands/flags/probe.js +44 -0
  41. package/dist/commands/flags/probe.js.map +1 -0
  42. package/dist/commands/login.d.ts +29 -0
  43. package/dist/commands/login.js +141 -0
  44. package/dist/commands/login.js.map +1 -0
  45. package/dist/commands/logout.d.ts +15 -0
  46. package/dist/commands/logout.js +50 -0
  47. package/dist/commands/logout.js.map +1 -0
  48. package/dist/commands/plugins/install.d.ts +28 -0
  49. package/dist/commands/plugins/install.js +51 -0
  50. package/dist/commands/plugins/install.js.map +1 -0
  51. package/dist/commands/plugins/list.d.ts +21 -0
  52. package/dist/commands/plugins/list.js +38 -0
  53. package/dist/commands/plugins/list.js.map +1 -0
  54. package/dist/commands/plugins/remove.d.ts +16 -0
  55. package/dist/commands/plugins/remove.js +30 -0
  56. package/dist/commands/plugins/remove.js.map +1 -0
  57. package/dist/commands/plugins/run.d.ts +23 -0
  58. package/dist/commands/plugins/run.js +49 -0
  59. package/dist/commands/plugins/run.js.map +1 -0
  60. package/dist/commands/plugins/search.d.ts +23 -0
  61. package/dist/commands/plugins/search.js +32 -0
  62. package/dist/commands/plugins/search.js.map +1 -0
  63. package/dist/commands/plugins/update.d.ts +27 -0
  64. package/dist/commands/plugins/update.js +50 -0
  65. package/dist/commands/plugins/update.js.map +1 -0
  66. package/dist/commands/profiles/list.d.ts +18 -0
  67. package/dist/commands/profiles/list.js +30 -0
  68. package/dist/commands/profiles/list.js.map +1 -0
  69. package/dist/commands/profiles/remove.d.ts +17 -0
  70. package/dist/commands/profiles/remove.js +42 -0
  71. package/dist/commands/profiles/remove.js.map +1 -0
  72. package/dist/commands/profiles/use.d.ts +15 -0
  73. package/dist/commands/profiles/use.js +28 -0
  74. package/dist/commands/profiles/use.js.map +1 -0
  75. package/dist/commands/telemetry/disable.d.ts +13 -0
  76. package/dist/commands/telemetry/disable.js +27 -0
  77. package/dist/commands/telemetry/disable.js.map +1 -0
  78. package/dist/commands/telemetry/enable.d.ts +13 -0
  79. package/dist/commands/telemetry/enable.js +28 -0
  80. package/dist/commands/telemetry/enable.js.map +1 -0
  81. package/dist/commands/telemetry/show-last.d.ts +12 -0
  82. package/dist/commands/telemetry/show-last.js +22 -0
  83. package/dist/commands/telemetry/show-last.js.map +1 -0
  84. package/dist/commands/telemetry/status.d.ts +15 -0
  85. package/dist/commands/telemetry/status.js +28 -0
  86. package/dist/commands/telemetry/status.js.map +1 -0
  87. package/dist/commands/token/create.d.ts +27 -0
  88. package/dist/commands/token/create.js +51 -0
  89. package/dist/commands/token/create.js.map +1 -0
  90. package/dist/commands/token/list.d.ts +21 -0
  91. package/dist/commands/token/list.js +38 -0
  92. package/dist/commands/token/list.js.map +1 -0
  93. package/dist/commands/token/revoke.d.ts +16 -0
  94. package/dist/commands/token/revoke.js +29 -0
  95. package/dist/commands/token/revoke.js.map +1 -0
  96. package/dist/commands/upgrade.d.ts +19 -0
  97. package/dist/commands/upgrade.js +47 -0
  98. package/dist/commands/upgrade.js.map +1 -0
  99. package/dist/commands/whoami.d.ts +8 -0
  100. package/dist/commands/whoami.js +43 -0
  101. package/dist/commands/whoami.js.map +1 -0
  102. package/dist/completion.d.ts +13 -0
  103. package/dist/completion.js +108 -0
  104. package/dist/completion.js.map +1 -0
  105. package/dist/doctor-credential.d.ts +9 -0
  106. package/dist/doctor-credential.js +19 -0
  107. package/dist/doctor-credential.js.map +1 -0
  108. package/dist/enabled-flags.d.ts +6 -0
  109. package/dist/enabled-flags.js +11 -0
  110. package/dist/enabled-flags.js.map +1 -0
  111. package/dist/help.d.ts +12 -0
  112. package/dist/help.js +28 -0
  113. package/dist/help.js.map +1 -0
  114. package/dist/hooks/command-not-found.d.ts +4 -0
  115. package/dist/hooks/command-not-found.js +13 -0
  116. package/dist/hooks/command-not-found.js.map +1 -0
  117. package/dist/hooks/init.d.ts +11 -0
  118. package/dist/hooks/init.js +35 -0
  119. package/dist/hooks/init.js.map +1 -0
  120. package/dist/hooks/postrun.d.ts +4 -0
  121. package/dist/hooks/postrun.js +7 -0
  122. package/dist/hooks/postrun.js.map +1 -0
  123. package/dist/hooks/prerun.d.ts +7 -0
  124. package/dist/hooks/prerun.js +15 -0
  125. package/dist/hooks/prerun.js.map +1 -0
  126. package/dist/plugin-guard.d.ts +17 -0
  127. package/dist/plugin-guard.js +11 -0
  128. package/dist/plugin-guard.js.map +1 -0
  129. package/dist/plugins-runtime.d.ts +14 -0
  130. package/dist/plugins-runtime.js +20 -0
  131. package/dist/plugins-runtime.js.map +1 -0
  132. package/dist/runtime.d.ts +1 -0
  133. package/dist/runtime.js +4 -0
  134. package/dist/runtime.js.map +1 -0
  135. package/dist/services.d.ts +2 -0
  136. package/dist/services.js +61 -0
  137. package/dist/services.js.map +1 -0
  138. package/dist/signals.d.ts +9 -0
  139. package/dist/signals.js +19 -0
  140. package/dist/signals.js.map +1 -0
  141. package/dist/startup-bundle.d.ts +10 -0
  142. package/dist/startup-bundle.js +11 -0
  143. package/dist/startup-bundle.js.map +1 -0
  144. package/dist/startup-path.d.ts +13 -0
  145. package/dist/startup-path.js +16 -0
  146. package/dist/startup-path.js.map +1 -0
  147. package/dist/suggest.d.ts +7 -0
  148. package/dist/suggest.js +40 -0
  149. package/dist/suggest.js.map +1 -0
  150. package/dist/telemetry-flags.d.ts +13 -0
  151. package/dist/telemetry-flags.js +82 -0
  152. package/dist/telemetry-flags.js.map +1 -0
  153. package/dist/update-notifier.d.ts +8 -0
  154. package/dist/update-notifier.js +41 -0
  155. package/dist/update-notifier.js.map +1 -0
  156. package/dist/update-worker.d.ts +1 -0
  157. package/dist/update-worker.js +7 -0
  158. package/dist/update-worker.js.map +1 -0
  159. package/oclif.manifest.json +3128 -0
  160. package/package.json +90 -7
  161. package/README.md +0 -6
@@ -0,0 +1,35 @@
1
+ import { duplicateCommandRefusals } from '../plugin-guard.js';
2
+ import { infoOnlyRun } from '../startup-path.js';
3
+ /** Exit code for a policy refusal (permission denied, T1.1.3). */
4
+ const POLICY_EXIT = 4;
5
+ /**
6
+ * T1.1.1 - runs before any command: Ctrl-C handling; the plugin policy (a plugin that redefines a core command is
7
+ * refused). Third-party installs are decided by `plugins install` itself (T4.2.1-T4.2.3: listed + allowed + verified;
8
+ * anything else refused with the policy, exit 4).
9
+ *
10
+ * T1.1.1 AC6 (startup <= 300 ms): a `--version` / `--help` run executes no command, so the command setup (and the core
11
+ * it imports) is loaded only for a run that executes one. The plugin policy is checked on every run.
12
+ */
13
+ const hook = async function (opts) {
14
+ const argv = opts.id === undefined ? opts.argv : [opts.id, ...opts.argv];
15
+ if (!infoOnlyRun(argv, opts.config.pjson.oclif)) {
16
+ const [{ setDefaultServices }, { cliServices }, { printUpdateNotice }, { installSigint }] = await Promise.all([
17
+ import('@revition/cli-core'),
18
+ import('../services.js'),
19
+ import('../update-notifier.js'),
20
+ import('../signals.js'),
21
+ ]);
22
+ installSigint();
23
+ setDefaultServices(cliServices(opts.config.version));
24
+ await printUpdateNotice(opts.argv, opts.config.version);
25
+ }
26
+ const owners = opts.config.commands.map((c) => ({ id: c.id, pluginName: c.pluginName ?? '' }));
27
+ const dupes = duplicateCommandRefusals(owners, opts.config.name);
28
+ if (dupes.length > 0) {
29
+ for (const d of dupes)
30
+ process.stderr.write(`${d}\n`);
31
+ this.exit(POLICY_EXIT);
32
+ }
33
+ };
34
+ export default hook;
35
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/hooks/init.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAuB,MAAM,oBAAoB,CAAC;AAEtE,kEAAkE;AAClE,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB;;;;;;;GAOG;AACH,MAAM,IAAI,GAAiB,KAAK,WAAW,IAAI;IAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,G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-0,0 +1,4 @@
1
+ import type { Hook } from '@oclif/core';
2
+ /** T1.4.1 - after the command finished: start the background update check (detached; never waited for). */
3
+ declare const hook: Hook<'postrun'>;
4
+ export default hook;
@@ -0,0 +1,7 @@
1
+ import { scheduleUpdateCheck } from '../update-notifier.js';
2
+ /** T1.4.1 - after the command finished: start the background update check (detached; never waited for). */
3
+ const hook = async function (opts) {
4
+ await scheduleUpdateCheck(opts.argv, opts.config.version);
5
+ };
6
+ export default hook;
7
+ //# sourceMappingURL=postrun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postrun.js","sourceRoot":"","sources":["../../src/hooks/postrun.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,2GAA2G;AAC3G,MAAM,IAAI,GAAoB,KAAK,WAAW,IAAI;IAChD,MAAM,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { Hook } from '@oclif/core';
2
+ /**
3
+ * T1.1.1 - before a command runs: it must be a RevitionCommand with complete `meta` (the manifest test proves this
4
+ * for every bundled command; this guards a plugin's command at runtime). An incomplete contract is refused.
5
+ */
6
+ declare const hook: Hook<'prerun'>;
7
+ export default hook;
@@ -0,0 +1,15 @@
1
+ import { metaProblems } from '@revition/cli-core';
2
+ /**
3
+ * T1.1.1 - before a command runs: it must be a RevitionCommand with complete `meta` (the manifest test proves this
4
+ * for every bundled command; this guards a plugin's command at runtime). An incomplete contract is refused.
5
+ */
6
+ const hook = async function (opts) {
7
+ const meta = opts.Command.meta;
8
+ const problems = metaProblems(meta);
9
+ if (problems.length > 0) {
10
+ process.stderr.write(`Refused: "${opts.Command.id}" does not declare a complete command contract (${problems.join('; ')}).\n`);
11
+ this.exit(4);
12
+ }
13
+ };
14
+ export default hook;
15
+ //# sourceMappingURL=prerun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prerun.js","sourceRoot":"","sources":["../../src/hooks/prerun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD;;;GAGG;AACH,MAAM,IAAI,GAAmB,KAAK,WAAW,IAAI;IAC/C,MAAM,IAAI,GAAI,IAAI,CAAC,OAAyC,CAAC,IAAI,CAAC;IAClE,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,aAAa,IAAI,CAAC,OAAO,CAAC,EAAE,mDAAmD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CACzG,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * T1.1.1 - the plugin host's own guard: two plugins defining the same command id - the core wins and the plugin is
3
+ * refused. PURE.
4
+ *
5
+ * Third-party INSTALLS (T1.1.1 AC4, CLI:765) are refused by `revition plugins install` itself since Phase 4 (T4.2.1-T4.2.3):
6
+ * a plugin that is not in the Revition registry, not allowed by the workspace, unsigned, or from an unregistered
7
+ * publisher is refused with exit 4 and the plugin policy (ADR 0007, `PLUGIN_POLICY_URL` in the core).
8
+ */
9
+ export interface CommandOwner {
10
+ readonly id: string;
11
+ readonly pluginName: string;
12
+ }
13
+ /**
14
+ * Command ids defined by a non-core plugin that the core also defines: the core keeps them, the plugin is refused.
15
+ * Returns one message per collision.
16
+ */
17
+ export declare function duplicateCommandRefusals(commands: readonly CommandOwner[], corePlugin: string): string[];
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Command ids defined by a non-core plugin that the core also defines: the core keeps them, the plugin is refused.
3
+ * Returns one message per collision.
4
+ */
5
+ export function duplicateCommandRefusals(commands, corePlugin) {
6
+ const core = new Set(commands.filter((c) => c.pluginName === corePlugin).map((c) => c.id));
7
+ return commands
8
+ .filter((c) => c.pluginName !== corePlugin && core.has(c.id))
9
+ .map((c) => `Refused plugin ${c.pluginName}: it redefines the core command "${c.id.replace(/:/g, ' ')}".`);
10
+ }
11
+ //# sourceMappingURL=plugin-guard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-guard.js","sourceRoot":"","sources":["../src/plugin-guard.ts"],"names":[],"mappings":"AAaA;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAAiC,EAAE,UAAkB;IAC5F,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3F,OAAO,QAAQ;SACZ,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,UAAU,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAC5D,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,CAAC,UAAU,oCAAoC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;AAC/G,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type CommandContext, type Runtime } from '@revition/cli-core';
2
+ import { type ApiCall, type PluginIndex, type PublisherDirectory } from '@revition/cli-core/plugins';
3
+ /** T4.2.3 - what every `plugins` command needs: the signed-in client, the platform's registry index and publishers. */
4
+ export interface PluginsRuntime {
5
+ readonly rt: Runtime;
6
+ readonly platform: PluginIndex & PublisherDirectory;
7
+ readonly configDir: string;
8
+ /** Core's API call for a plugin (the credential stays here; the plugin gets only the response). */
9
+ readonly api: (call: ApiCall) => Promise<{
10
+ readonly status: number;
11
+ readonly body: unknown;
12
+ }>;
13
+ }
14
+ export declare function pluginsRuntime(ctx: CommandContext): Promise<PluginsRuntime>;
@@ -0,0 +1,20 @@
1
+ import { runtime } from '@revition/cli-core';
2
+ import { platformPlugins } from '@revition/cli-core/plugins';
3
+ export async function pluginsRuntime(ctx) {
4
+ const rt = await runtime(ctx);
5
+ const client = rt.session.client;
6
+ return {
7
+ rt,
8
+ configDir: rt.paths.configDir,
9
+ platform: platformPlugins(async (r) => ({ body: (await client.request(r)).body })),
10
+ api: async (call) => {
11
+ const r = await client.request({
12
+ method: call.method,
13
+ path: call.path,
14
+ ...(call.body === undefined ? {} : { body: call.body }),
15
+ });
16
+ return { status: r.status, body: r.body };
17
+ },
18
+ };
19
+ }
20
+ //# sourceMappingURL=plugins-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins-runtime.js","sourceRoot":"","sources":["../src/plugins-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAqC,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,eAAe,EAA2D,MAAM,4BAA4B,CAAC;AAWtH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAmB;IACtD,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;IACjC,OAAO;QACL,EAAE;QACF,SAAS,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS;QAC7B,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAK,CAAkC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,MAAM,CAAC,OAAO,CAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QACzH,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;YAClB,MAAM,CAAC,GAAG,MAAM,MAAM,CAAC,OAAO,CAAU;gBACtC,MAAM,EAAE,IAAI,CAAC,MAAqD;gBAClE,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;aACxD,CAAC,CAAC;YACH,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAC5C,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ export { logoutDeps, passphrasePrompt, runtime, storeFor, type Runtime } from '@revition/cli-core';
@@ -0,0 +1,4 @@
1
+ // The networked-command runtime moved into @revition/cli-core (T2.1.1: first-party plugins sign in the same way);
2
+ // the shell's commands keep importing it from here.
3
+ export { logoutDeps, passphrasePrompt, runtime, storeFor } from '@revition/cli-core';
4
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,kHAAkH;AAClH,oDAAoD;AACpD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,OAAO,EAAE,QAAQ,EAAgB,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { type CoreServices } from '@revition/cli-core';
2
+ export declare function cliServices(cliVersion: string): CoreServices;
@@ -0,0 +1,61 @@
1
+ import { actingBanner, ApiClient, CLI_SCOPES, defaultCliPaths, loadProjectFile, loadUserConfig, patFromEnv, resolveSettings, selectStore, } from '@revition/cli-core';
2
+ import { featureFromCache, recordRun } from './telemetry-flags.js';
3
+ /**
4
+ * The services the core pipeline uses in the real CLI: the profile from config, the signed-in state from REVITION_TOKEN
5
+ * or the credential store (never reading a secret into output), the acting banner for mutating commands. The client
6
+ * scope check is an early, clear error only: the server re-checks every call, so a known credential reports all scopes
7
+ * and the platform answers 403 for anything outside the credential's real scopes.
8
+ */
9
+ async function where(profileFlag) {
10
+ const paths = defaultCliPaths();
11
+ const { config } = await loadUserConfig(paths.configFile);
12
+ const project = await loadProjectFile(process.cwd()).catch(() => null);
13
+ const s = resolveSettings({ flags: { profile: profileFlag }, env: process.env, project: project?.project ?? null, user: config });
14
+ return { profile: s.profile.value, host: s.host.value, stateDir: paths.stateDir };
15
+ }
16
+ const noPassphrase = async () => {
17
+ throw new Error('no passphrase in a preflight');
18
+ };
19
+ export function cliServices(cliVersion) {
20
+ return {
21
+ loadProfile: async (p) => ({ name: (await where(p)).profile }),
22
+ resolveAuth: async (profile) => {
23
+ if (patFromEnv(process.env) !== null)
24
+ return { scopes: CLI_SCOPES };
25
+ const w = await where(profile);
26
+ try {
27
+ const store = await selectStore({ profile, stateDir: w.stateDir, env: process.env, insecureStorageFlag: false, askPassphrase: noPassphrase });
28
+ if (store.backend === 'encrypted-file')
29
+ return { scopes: CLI_SCOPES }; // known only after the passphrase; the command asks
30
+ return (await store.get({ profile, host: w.host })) === null ? null : { scopes: CLI_SCOPES };
31
+ }
32
+ catch {
33
+ return null;
34
+ }
35
+ },
36
+ featureEnabled: async (name, profile) => featureFromCache(name, profile, cliVersion),
37
+ afterRun: async (run) => recordRun({ ...run, version: cliVersion }),
38
+ actingBanner: async (profile) => {
39
+ const w = await where(profile);
40
+ const pat = patFromEnv(process.env);
41
+ let email = null;
42
+ let token = pat;
43
+ if (token === null) {
44
+ const store = await selectStore({ profile, stateDir: w.stateDir, env: process.env, insecureStorageFlag: false, askPassphrase: noPassphrase });
45
+ const c = await store.get({ profile, host: w.host });
46
+ if (c === null)
47
+ return null;
48
+ email = c.email;
49
+ token = c.credential;
50
+ }
51
+ const t = token;
52
+ const me = (await new ApiClient({ host: w.host, token: async () => t, cliVersion, retries: 0, timeoutMs: 5_000 }).request({ method: 'GET', path: '/dev/me' })).body;
53
+ return actingBanner({
54
+ user: email ?? me.identityRef,
55
+ workspace: me.kind === 'tenant_member' ? me.linkedOrgId : null,
56
+ host: w.host,
57
+ });
58
+ },
59
+ };
60
+ }
61
+ //# sourceMappingURL=services.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services.js","sourceRoot":"","sources":["../src/services.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,SAAS,EACT,UAAU,EACV,eAAe,EACf,eAAe,EACf,cAAc,EACd,UAAU,EACV,eAAe,EACf,WAAW,GAGZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEnE;;;;;GAKG;AACH,KAAK,UAAU,KAAK,CAAC,WAA+B;IAClD,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAChC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACvE,MAAM,CAAC,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAClI,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;AACpF,CAAC;AAED,MAAM,YAAY,GAAG,KAAK,IAAqB,EAAE;IAC/C,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;AAClD,CAAC,CAAC;AAE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S,EAAE,EAAE,CAAC,IAAI,KAAK,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI;gBAC9D,IAAI,EAAE,CAAC,CAAC,IAAI;aACb,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { onCancelCleanup } from '@revition/cli-core';
2
+ /**
3
+ * T1.1.1 - Ctrl-C (SIGINT) exits immediately with code 11; a second Ctrl-C skips cleanup. Work is crash-only (the next
4
+ * run cleans stale locks and temp files), so cleanup is best effort and bounded. The registry is the core's, so a
5
+ * plugin's cleanup (T2.1.4: delete a cloud sandbox) runs too.
6
+ */
7
+ export declare const CANCELLED_EXIT = 11;
8
+ export { onCancelCleanup };
9
+ export declare function installSigint(proc?: Pick<NodeJS.Process, 'on' | 'exit' | 'stderr'>, cleanupBudgetMs?: number): void;
@@ -0,0 +1,19 @@
1
+ import { onCancelCleanup, runCancelCleanups } from '@revition/cli-core';
2
+ /**
3
+ * T1.1.1 - Ctrl-C (SIGINT) exits immediately with code 11; a second Ctrl-C skips cleanup. Work is crash-only (the next
4
+ * run cleans stale locks and temp files), so cleanup is best effort and bounded. The registry is the core's, so a
5
+ * plugin's cleanup (T2.1.4: delete a cloud sandbox) runs too.
6
+ */
7
+ export const CANCELLED_EXIT = 11;
8
+ export { onCancelCleanup };
9
+ export function installSigint(proc = process, cleanupBudgetMs = 150) {
10
+ let interrupted = false;
11
+ proc.on('SIGINT', () => {
12
+ if (interrupted)
13
+ proc.exit(CANCELLED_EXIT);
14
+ interrupted = true;
15
+ proc.stderr.write('\nCancelled.\n');
16
+ void runCancelCleanups(cleanupBudgetMs).then(() => proc.exit(CANCELLED_EXIT));
17
+ });
18
+ }
19
+ //# sourceMappingURL=signals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signals.js","sourceRoot":"","sources":["../src/signals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAExE;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,MAAM,UAAU,aAAa,CAC3B,OAAuD,OAAO,EAC9D,eAAe,GAAG,GAAG;IAErB,IAAI,WAAW,GAAG,KAAK,CAAC;IACxB,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;QACrB,IAAI,WAAW;YAAE,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC3C,WAAW,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACpC,KAAK,iBAAiB,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;IAChF,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * T1.1.1 AC6 (startup <= 300 ms on the 3 OS): the entry of the startup bundle (scripts/bundle-startup.mjs ->
3
+ * dist/bundle/startup.js). The root help run (`revition` / `revition --help`, bin/run) starts oclif from this ONE file
4
+ * instead of the ~110 module files of @oclif/core and its dependencies: on Windows each module file costs a resolve and
5
+ * an open (PR #11: --help 537 ms unbundled). The help class is resolved from here for every run (package.json
6
+ * oclif.helpClass, the {target, identifier} form of oclif's plugin-test-esbuild). A command run keeps the unbundled
7
+ * oclif: its command classes import @oclif/core, and one run never mixes two copies of it.
8
+ */
9
+ export { execute } from '@oclif/core/execute';
10
+ export { default as RevitionHelp } from './help.js';
@@ -0,0 +1,11 @@
1
+ /**
2
+ * T1.1.1 AC6 (startup <= 300 ms on the 3 OS): the entry of the startup bundle (scripts/bundle-startup.mjs ->
3
+ * dist/bundle/startup.js). The root help run (`revition` / `revition --help`, bin/run) starts oclif from this ONE file
4
+ * instead of the ~110 module files of @oclif/core and its dependencies: on Windows each module file costs a resolve and
5
+ * an open (PR #11: --help 537 ms unbundled). The help class is resolved from here for every run (package.json
6
+ * oclif.helpClass, the {target, identifier} form of oclif's plugin-test-esbuild). A command run keeps the unbundled
7
+ * oclif: its command classes import @oclif/core, and one run never mixes two copies of it.
8
+ */
9
+ export { execute } from '@oclif/core/execute';
10
+ export { default as RevitionHelp } from './help.js';
11
+ //# sourceMappingURL=startup-bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"startup-bundle.js","sourceRoot":"","sources":["../src/startup-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * T1.1.1 AC6 (REVITION-CLI-PLAN.md:755: `revition --version` and `--help` start in <= 300 ms). PURE.
3
+ *
4
+ * oclif prints the version or the help and exits WITHOUT running a command when (its own rule, @oclif/core main.js
5
+ * `versionAddition` / `helpAddition`): the first argument is a version flag; a help flag comes before any `--`; or there
6
+ * are no arguments. Such a run needs none of the command setup (services, Ctrl-C handler, the pre-command update
7
+ * notice), so the init hook skips it and never imports the core for it.
8
+ */
9
+ export interface OclifInfoFlags {
10
+ readonly additionalVersionFlags?: readonly string[];
11
+ readonly additionalHelpFlags?: readonly string[];
12
+ }
13
+ export declare function infoOnlyRun(argv: readonly string[], flags?: OclifInfoFlags): boolean;
@@ -0,0 +1,16 @@
1
+ export function infoOnlyRun(argv, flags = {}) {
2
+ if (argv.length === 0)
3
+ return true;
4
+ const version = new Set(['--version', ...(flags.additionalVersionFlags ?? [])]);
5
+ if (version.has(argv[0] ?? ''))
6
+ return true;
7
+ const help = new Set(['--help', ...(flags.additionalHelpFlags ?? [])]);
8
+ for (const arg of argv) {
9
+ if (arg === '--')
10
+ return false;
11
+ if (help.has(arg))
12
+ return true;
13
+ }
14
+ return false;
15
+ }
16
+ //# sourceMappingURL=startup-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"startup-path.js","sourceRoot":"","sources":["../src/startup-path.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,WAAW,CAAC,IAAuB,EAAE,QAAwB,EAAE;IAC7E,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,KAAK,CAAC,sBAAsB,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAChF,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5C,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,KAAK,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACvE,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,GAAG,KAAK,IAAI;YAAE,OAAO,KAAK,CAAC;QAC/B,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;IACjC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * T1.1.6 - did-you-mean: `revition aps list` -> "Did you mean 'apps list'?". A suggestion only: it never runs the
3
+ * suggested command (and there is no catch-all command, T1.1.1). PURE.
4
+ */
5
+ export declare function editDistance(a: string, b: string): number;
6
+ /** The closest command (space-separated) to what was typed, or null when nothing is close enough. */
7
+ export declare function suggestCommand(typed: string, commandIds: readonly string[]): string | null;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * T1.1.6 - did-you-mean: `revition aps list` -> "Did you mean 'apps list'?". A suggestion only: it never runs the
3
+ * suggested command (and there is no catch-all command, T1.1.1). PURE.
4
+ */
5
+ export function editDistance(a, b) {
6
+ const prev = Array.from({ length: b.length + 1 }, (_, j) => j);
7
+ for (let i = 1; i <= a.length; i++) {
8
+ let diag = prev[0] ?? 0;
9
+ prev[0] = i;
10
+ for (let j = 1; j <= b.length; j++) {
11
+ const up = prev[j] ?? 0;
12
+ prev[j] = Math.min(up + 1, (prev[j - 1] ?? 0) + 1, diag + (a[i - 1] === b[j - 1] ? 0 : 1));
13
+ diag = up;
14
+ }
15
+ }
16
+ return prev[b.length] ?? 0;
17
+ }
18
+ /** The closest command (space-separated) to what was typed, or null when nothing is close enough. */
19
+ export function suggestCommand(typed, commandIds) {
20
+ // oclif hands over everything typed (arguments included) as one id; only the leading words can name a command.
21
+ const typedWords = typed.replace(/:/g, ' ').trim().toLowerCase().split(/\s+/).filter((w) => w !== '');
22
+ if (typedWords.length === 0)
23
+ return null;
24
+ let best = null;
25
+ for (const id of commandIds) {
26
+ const cmdWords = id.split(':');
27
+ const n = Math.min(cmdWords.length, typedWords.length);
28
+ const target = cmdWords.slice(0, n).join(' ');
29
+ const head = typedWords.slice(0, n).join(' ');
30
+ const d = editDistance(head, target);
31
+ // Prefer the closest; on a tie, the candidate that matches more words.
32
+ if (best === null || d < best.d || (d === best.d && n > best.len))
33
+ best = { id: target, d, len: n };
34
+ }
35
+ if (best === null)
36
+ return null;
37
+ const threshold = Math.max(2, Math.floor(best.id.length / 4));
38
+ return best.d <= threshold && best.d > 0 ? best.id : null;
39
+ }
40
+ //# sourceMappingURL=suggest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggest.js","sourceRoot":"","sources":["../src/suggest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,CAAS,EAAE,CAAS;IAC/C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,C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emetry' | 'flags', profile: string | undefined, version: string): void;
3
+ /** T1.4.3: a command's flag from the cache (fresh or stale); a stale or missing cache is refreshed in the background. */
4
+ export declare function featureFromCache(name: string, profile: string, version: string): boolean;
5
+ export { enabledFlags } from './enabled-flags.js';
6
+ export declare function recordRun(run: {
7
+ readonly command: string;
8
+ readonly argv: readonly string[];
9
+ readonly exitCode: number;
10
+ readonly durationMs: number;
11
+ readonly json: boolean;
12
+ readonly version: string;
13
+ }): Promise<void>;
@@ -0,0 +1,82 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { ask, atomicWriteFile, buildEvent, defaultCliPaths, enqueue, flagCacheFresh, impliedNoInput, installId, isCi, loadUserConfig, readFlagCache, setConfigValue, telemetryEnabled, telemetryForcedOff, TELEMETRY_DOCS_URL, createIo, } from '@revition/cli-core';
4
+ export const BACKGROUND_WORKER = fileURLToPath(new URL('./background-worker.js', import.meta.url));
5
+ export function startBackground(task, profile, version) {
6
+ try {
7
+ const child = spawn(process.execPath, [BACKGROUND_WORKER, task, profile ?? '', version], { detached: true, stdio: 'ignore', env: process.env });
8
+ child.unref();
9
+ }
10
+ catch {
11
+ // never fails a command
12
+ }
13
+ }
14
+ /** T1.4.3: a command's flag from the cache (fresh or stale); a stale or missing cache is refreshed in the background. */
15
+ export function featureFromCache(name, profile, version) {
16
+ const { cacheDir } = defaultCliPaths();
17
+ const c = readFlagCache(cacheDir, profile);
18
+ if (!flagCacheFresh(c, Date.now()))
19
+ startBackground('flags', profile, version);
20
+ return c?.flags[name] === true;
21
+ }
22
+ export { enabledFlags } from './enabled-flags.js';
23
+ /** T1.4.2: the first interactive run asks once (default No); a non-interactive first run never asks and stays off. */
24
+ async function firstRunConsent(json) {
25
+ const paths = defaultCliPaths();
26
+ const { config } = await loadUserConfig(paths.configFile);
27
+ if (config.telemetry !== 'unset')
28
+ return config.telemetry;
29
+ // DO_NOT_TRACK / REVITION_TELEMETRY=0 always win (REVITION-CLI-PLAN.md:1655, :1671): the answer is already given, so
30
+ // nothing is asked and nothing is written (L3 in a real PTY, 2026-11-18, found the question asked under DO_NOT_TRACK=1).
31
+ if (telemetryForcedOff(process.env))
32
+ return 'unset';
33
+ if (json || isCi(process.env) || impliedNoInput(process.env, process.stdin.isTTY === true) || process.stdout.isTTY !== true)
34
+ return 'unset';
35
+ const io = createIo({
36
+ stdout: process.stdout,
37
+ stderr: process.stderr,
38
+ stdin: process.stdin,
39
+ // End of input (Ctrl-D, a closed terminal) is the default answer, No: the command never hangs or dies on the
40
+ // question ("it never blocks a command", :1673). Before, only 'data' settled it, so EOF exited 13 (unsettled await).
41
+ readLine: async () => new Promise((resolve) => {
42
+ const settle = (answer) => {
43
+ process.stdin.off('data', onData);
44
+ process.stdin.off('end', onEnd);
45
+ resolve(answer);
46
+ };
47
+ const onData = (d) => settle(String(d));
48
+ const onEnd = () => settle('');
49
+ process.stdin.once('data', onData);
50
+ process.stdin.once('end', onEnd);
51
+ }),
52
+ });
53
+ const answer = await ask(io, `Help improve the Revition CLI by sending anonymous usage data? (y/N) Details: ${TELEMETRY_DOCS_URL}`);
54
+ const choice = /^(y|yes)$/i.test(answer) ? 'on' : 'off';
55
+ await atomicWriteFile(paths.configFile, `${JSON.stringify(setConfigValue(config, 'telemetry', choice), null, 2)}\n`);
56
+ process.stdin.pause();
57
+ return choice;
58
+ }
59
+ export async function recordRun(run) {
60
+ const choice = await firstRunConsent(run.json);
61
+ if (!telemetryEnabled(process.env, choice))
62
+ return;
63
+ const paths = defaultCliPaths();
64
+ const event = buildEvent({
65
+ installId: await installId(paths.stateDir),
66
+ cliVersion: run.version,
67
+ platform: process.platform,
68
+ nodeVersion: process.version,
69
+ command: run.command,
70
+ argv: run.argv,
71
+ exitCode: run.exitCode,
72
+ durationMs: run.durationMs,
73
+ env: process.env,
74
+ now: new Date(),
75
+ });
76
+ if (event === null)
77
+ return;
78
+ await enqueue(paths.stateDir, event);
79
+ const profileIdx = run.argv.indexOf('--profile');
80
+ startBackground('telemetry', profileIdx >= 0 ? run.argv[profileIdx + 1] : undefined, run.version);
81
+ }
82
+ //# sourceMappingURL=telemetry-flags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-flags.js","sourceRoot":"","sources":["../src/telemetry-flags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,GAAG,EACH,eAAe,EACf,UAAU,EACV,eAAe,EACf,OAAO,EACP,cAAc,EACd,cAAc,EACd,SAAS,EACT,IAAI,EACJ,cAAc,EACd,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,QAAQ,GAET,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,wBAAwB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAEnG,MAAM,UAAU,eAAe,CAAC,IAA2B,EAAE,OAA2B,EAAE,OAAe;IACvG,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,iBAAiB,EAAE,IAAI,EAAE,OAAO,IAAI,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAChJ,KAAK,CAAC,KAAK,EAAE,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,wBAAwB;IAC1B,CAAC;AACH,CAAC;AAED,yHAAyH;AACzH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,OAAe,EAAE,OAAe;IAC7E,MAAM,EAAE,QAAQ,EAAE,GAAG,eAAe,EAAE,CAAC;IACvC,MAAM,CAAC,GAAG,aAAa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C,MAAM,KAAK,GAAG,UAAU,CAAC;QACvB,SAAS,EAAE,MAAM,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;QAC1C,UAAU,EAAE,GAAG,CAAC,OAAO;QACvB,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,WAAW,EAAE,OAAO,CAAC,OAAO;QAC5B,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,GAAG,EAAE,IAAI,IAAI,EAAE;KAChB,CAAC,CAAC;IACH,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO;IAC3B,MAAM,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACrC,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACjD,eAAe,CAAC,WAAW,EAAE,UAAU,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;AACpG,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * T1.4.1 - the notifier around every command: before it, print a notice from the cache (if any); after it, start the
3
+ * registry check in a DETACHED process when the cache is stale. Neither step can delay or fail the command.
4
+ */
5
+ export declare const WORKER: string;
6
+ export declare function printUpdateNotice(argv: readonly string[], version: string, env?: NodeJS.ProcessEnv): Promise<void>;
7
+ /** Returns at once: the check runs in its own detached process (measured by its own timing, never the command's). */
8
+ export declare function scheduleUpdateCheck(argv: readonly string[], version: string, env?: NodeJS.ProcessEnv, force?: boolean): Promise<boolean>;
@@ -0,0 +1,41 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { channelOf, defaultCliPaths, isStale, loadUserConfig, readUpdateCache, updateCheckAllowed, updateNotice, } from '@revition/cli-core';
4
+ /**
5
+ * T1.4.1 - the notifier around every command: before it, print a notice from the cache (if any); after it, start the
6
+ * registry check in a DETACHED process when the cache is stale. Neither step can delay or fail the command.
7
+ */
8
+ export const WORKER = fileURLToPath(new URL('./update-worker.js', import.meta.url));
9
+ async function allowed(argv, env) {
10
+ const { config } = await loadUserConfig(defaultCliPaths().configFile).catch(() => ({ config: { updateCheck: true } }));
11
+ return updateCheckAllowed({ json: argv.includes('--json'), env, stderrIsTTY: process.stderr.isTTY === true, configUpdateCheck: config.updateCheck });
12
+ }
13
+ export async function printUpdateNotice(argv, version, env = process.env) {
14
+ try {
15
+ if (!(await allowed(argv, env)))
16
+ return;
17
+ const notice = updateNotice(await readUpdateCache(defaultCliPaths().cacheDir), version);
18
+ if (notice !== null)
19
+ process.stderr.write(notice);
20
+ }
21
+ catch {
22
+ // never fails a command
23
+ }
24
+ }
25
+ /** Returns at once: the check runs in its own detached process (measured by its own timing, never the command's). */
26
+ export async function scheduleUpdateCheck(argv, version, env = process.env, force = false) {
27
+ try {
28
+ if (!force && !(await allowed(argv, env)))
29
+ return false;
30
+ const { cacheDir } = defaultCliPaths();
31
+ if (!isStale(await readUpdateCache(cacheDir), channelOf(version), version, Date.now()))
32
+ return false;
33
+ const child = spawn(process.execPath, [WORKER, version, cacheDir], { detached: true, stdio: 'ignore', env });
34
+ child.unref();
35
+ return true;
36
+ }
37
+ catch {
38
+ return false;
39
+ }
40
+ }
41
+ //# sourceMappingURL=update-notifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-notifier.js","sourceRoot":"","sources":["../src/update-notifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,SAAS,EACT,eAAe,EACf,OAAO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AAE,MAAyB,OAAO,CAAC,GAAG,EAAE,KAAK,GAAG,KAAK;IACrI,IAAI,CAAC;QACH,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,MAAM,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;QACxD,MAAM,EAAE,QAAQ,EAAE,GAAG,eAAe,EAAE,CAAC;QACvC,IAAI,CAAC,OAAO,CAAC,MAAM,eAAe,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;YAAE,OAAO,KAAK,CAAC;QACrG,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC;QAC7G,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ // T1.4.1 - the detached background update check: argv = <installed version> <cache dir>. Offline = silently skipped.
2
+ import { runUpdateCheck } from '@revition/cli-core';
3
+ const [version, cacheDir] = process.argv.slice(2);
4
+ if (version !== undefined && cacheDir !== undefined) {
5
+ await runUpdateCheck({ installedVersion: version, cacheDir, env: process.env, now: Date.now() }).catch(() => undefined);
6
+ }
7
+ //# sourceMappingURL=update-worker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-worker.js","sourceRoot":"","sources":["../src/update-worker.ts"],"names":[],"mappings":"AAAA,qHAAqH;AACrH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAClD,IAAI,OAAO,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;IACpD,MAAM,cAAc,CAAC,EAAE,gBAAgB,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;AAC1H,CAAC"}