@raidiant/notifai 10.0.0 → 10.1.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 (127) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +4 -1
  3. package/dist/cli-bin.d.ts +21 -1
  4. package/dist/cli-bin.js +141 -10
  5. package/dist/cli-bin.js.map +1 -1
  6. package/dist/cli-update-contract.d.ts +7 -0
  7. package/dist/cli-update-contract.js +10 -0
  8. package/dist/cli-update-contract.js.map +1 -0
  9. package/dist/client.d.ts +6 -1
  10. package/dist/client.js +1 -0
  11. package/dist/client.js.map +1 -1
  12. package/dist/codex-wake.d.ts +2 -0
  13. package/dist/codex-wake.js +2 -1
  14. package/dist/codex-wake.js.map +1 -1
  15. package/dist/commands-auth.d.ts +15 -1
  16. package/dist/commands-auth.js +32 -14
  17. package/dist/commands-auth.js.map +1 -1
  18. package/dist/commands-core.d.ts +10 -1
  19. package/dist/commands-core.js +13 -4
  20. package/dist/commands-core.js.map +1 -1
  21. package/dist/commands-devices.d.ts +10 -1
  22. package/dist/commands-devices.js +17 -13
  23. package/dist/commands-devices.js.map +1 -1
  24. package/dist/commands-doctor.js +158 -71
  25. package/dist/commands-doctor.js.map +1 -1
  26. package/dist/commands-harness-context.js +8 -0
  27. package/dist/commands-harness-context.js.map +1 -1
  28. package/dist/commands-hooks.js +169 -15
  29. package/dist/commands-hooks.js.map +1 -1
  30. package/dist/commands-init.d.ts +16 -0
  31. package/dist/commands-init.js +254 -91
  32. package/dist/commands-init.js.map +1 -1
  33. package/dist/commands-send.d.ts +1 -1
  34. package/dist/commands-send.js +121 -35
  35. package/dist/commands-send.js.map +1 -1
  36. package/dist/commands-update.d.ts +10 -0
  37. package/dist/commands-update.js +141 -0
  38. package/dist/commands-update.js.map +1 -0
  39. package/dist/commands.d.ts +2 -1
  40. package/dist/commands.js +2 -1
  41. package/dist/commands.js.map +1 -1
  42. package/dist/harnesses.d.ts +2 -2
  43. package/dist/harnesses.js +22 -2
  44. package/dist/harnesses.js.map +1 -1
  45. package/dist/hook-adapter.d.ts +2 -0
  46. package/dist/hook-adapter.js +12 -1
  47. package/dist/hook-adapter.js.map +1 -1
  48. package/dist/hooks.d.ts +43 -2
  49. package/dist/hooks.js +163 -21
  50. package/dist/hooks.js.map +1 -1
  51. package/dist/install-hooks.js +15 -9
  52. package/dist/install-hooks.js.map +1 -1
  53. package/dist/interactive.js +20 -23
  54. package/dist/interactive.js.map +1 -1
  55. package/dist/main-run.d.ts +1 -0
  56. package/dist/main-run.js +42 -0
  57. package/dist/main-run.js.map +1 -0
  58. package/dist/main.js +10 -31
  59. package/dist/main.js.map +1 -1
  60. package/dist/node-floor.d.ts +18 -0
  61. package/dist/node-floor.js +35 -0
  62. package/dist/node-floor.js.map +1 -0
  63. package/dist/openclaw-plugin.d.ts +49 -0
  64. package/dist/openclaw-plugin.js +350 -0
  65. package/dist/openclaw-plugin.js.map +1 -0
  66. package/dist/program.d.ts +2 -1
  67. package/dist/program.js +31 -13
  68. package/dist/program.js.map +1 -1
  69. package/dist/question-settlement-process.d.ts +15 -0
  70. package/dist/question-settlement-process.js +35 -0
  71. package/dist/question-settlement-process.js.map +1 -0
  72. package/dist/readiness.d.ts +25 -1
  73. package/dist/readiness.js +32 -2
  74. package/dist/readiness.js.map +1 -1
  75. package/dist/session-activation.js +1 -1
  76. package/dist/session-activation.js.map +1 -1
  77. package/dist/setup-destinations.d.ts +23 -0
  78. package/dist/setup-destinations.js +44 -0
  79. package/dist/setup-destinations.js.map +1 -0
  80. package/dist/ui/help.d.ts +4 -5
  81. package/dist/ui/help.js +5 -6
  82. package/dist/ui/help.js.map +1 -1
  83. package/package.json +2 -2
  84. package/src/cli-bin.test.ts +145 -7
  85. package/src/cli-bin.ts +176 -10
  86. package/src/cli-update-contract.ts +9 -0
  87. package/src/cli-update.test.ts +125 -0
  88. package/src/client.ts +7 -0
  89. package/src/codex-wake.ts +5 -1
  90. package/src/commands-auth.ts +47 -13
  91. package/src/commands-core.ts +21 -4
  92. package/src/commands-devices.ts +23 -16
  93. package/src/commands-doctor.ts +197 -75
  94. package/src/commands-harness-context.ts +8 -0
  95. package/src/commands-hooks.ts +210 -18
  96. package/src/commands-init.ts +275 -92
  97. package/src/commands-send.ts +145 -39
  98. package/src/commands-update.ts +180 -0
  99. package/src/commands.test.ts +701 -53
  100. package/src/commands.ts +2 -0
  101. package/src/fixtures/openclaw-2026.7.1-2-agent-local.json +57 -0
  102. package/src/harness-integration.test.ts +82 -0
  103. package/src/harnesses.test.ts +9 -1
  104. package/src/harnesses.ts +24 -2
  105. package/src/hook-adapter.ts +14 -0
  106. package/src/hooks.test.ts +275 -0
  107. package/src/hooks.ts +270 -18
  108. package/src/install-hooks.test.ts +208 -0
  109. package/src/install-hooks.ts +19 -9
  110. package/src/interactive.test.ts +31 -0
  111. package/src/interactive.ts +20 -26
  112. package/src/main-run.ts +45 -0
  113. package/src/main.ts +9 -33
  114. package/src/node-floor.test.ts +27 -0
  115. package/src/node-floor.ts +37 -0
  116. package/src/openclaw-plugin.ts +409 -0
  117. package/src/program.test.ts +35 -0
  118. package/src/program.ts +37 -12
  119. package/src/question-settlement-process.ts +47 -0
  120. package/src/readiness.ts +35 -2
  121. package/src/session-activation.ts +1 -1
  122. package/src/setup-destinations.test.ts +41 -0
  123. package/src/setup-destinations.ts +50 -0
  124. package/src/skill.test.ts +13 -2
  125. package/src/ui/help.test.ts +16 -0
  126. package/src/ui/help.ts +6 -7
  127. package/src/commands-devices.test.ts +0 -15
@@ -0,0 +1,35 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { fileURLToPath } from 'node:url';
3
+ /** Private handoff from the short prompt hook to its detached question owner. */
4
+ export const QUESTION_SETTLEMENT_INPUT_ENV = 'NOTIFAI_INTERNAL_QUESTION_SETTLEMENT_INPUT';
5
+ /**
6
+ * Launch the exact installed CLI build as a detached owner.
7
+ *
8
+ * UserPromptSubmit sits in front of the User's new turn, so it may only pay the
9
+ * process-spawn cost. The child owns submission and the complete answer window.
10
+ */
11
+ export function spawnQuestionSettlement(launch) {
12
+ const child = spawn(process.execPath, [
13
+ fileURLToPath(new URL('./main.js', import.meta.url)),
14
+ 'hook',
15
+ 'question-settlement',
16
+ '--owner',
17
+ 'notifai',
18
+ '--harness',
19
+ launch.harness,
20
+ ], {
21
+ cwd: launch.envelope.cwd ?? process.cwd(),
22
+ detached: true,
23
+ env: {
24
+ ...process.env,
25
+ [QUESTION_SETTLEMENT_INPUT_ENV]: JSON.stringify(launch.envelope),
26
+ },
27
+ stdio: 'ignore',
28
+ windowsHide: true,
29
+ });
30
+ // Spawn failures are diagnosed by the next ordinary lifecycle hook, which
31
+ // still owns the durable registration. Never turn one into a prompt delay.
32
+ child.once('error', () => undefined);
33
+ child.unref();
34
+ }
35
+ //# sourceMappingURL=question-settlement-process.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"question-settlement-process.js","sourceRoot":"","sources":["../src/question-settlement-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAIxC,iFAAiF;AACjF,MAAM,CAAC,MAAM,6BAA6B,GAAG,4CAA4C,CAAA;AAOzF;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAgC;IACtE,MAAM,KAAK,GAAG,KAAK,CACjB,OAAO,CAAC,QAAQ,EAChB;QACE,aAAa,CAAC,IAAI,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpD,MAAM;QACN,qBAAqB;QACrB,SAAS;QACT,SAAS;QACT,WAAW;QACX,MAAM,CAAC,OAAO;KACf,EACD;QACE,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE;QACzC,QAAQ,EAAE,IAAI;QACd,GAAG,EAAE;YACH,GAAG,OAAO,CAAC,GAAG;YACd,CAAC,6BAA6B,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC;SACjE;QACD,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,IAAI;KAClB,CACF,CAAA;IACD,0EAA0E;IAC1E,2EAA2E;IAC3E,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;IACpC,KAAK,CAAC,KAAK,EAAE,CAAA;AACf,CAAC"}
@@ -84,12 +84,36 @@ export interface Readiness {
84
84
  }
85
85
  /** The first thing standing in the way, or null when nothing is. */
86
86
  export declare function firstBlocker(readiness: Readiness): ReadinessState | null;
87
+ /**
88
+ * Question Routing: what lets a question reach a phone when nobody is at the
89
+ * terminal. Hooks, their sub-states, and the setting that admits them.
90
+ *
91
+ * Separate from `isOptionalSetup` because these are also the states a human
92
+ * should not be handed as leftovers — "Optional, not set up" is a fair line
93
+ * about the agent skill and a confusing one about a session pointer.
94
+ */
95
+ export declare function isOptionalAutomation(id: string): boolean;
96
+ /**
97
+ * Automation layered on top of a product that already sends: Question Routing
98
+ * and the agent guidance skill.
99
+ *
100
+ * Real, and reported. `doctor` is the report and judges it strictly. Anything
101
+ * whose job is to get a first notification delivered treats it as a line to
102
+ * print, never a gate — a hook diagnostic or a duplicate skill install in
103
+ * front of the delivery proof means a setup that can already send never proves
104
+ * that it can. The one that fires most often, a turn that has not ended yet,
105
+ * cannot be closed by the agent standing inside that turn at all.
106
+ */
107
+ export declare function isOptionalSetup(id: string): boolean;
108
+ /** The first thing in the way that is not optional automation. */
109
+ export declare function firstRequiredBlocker(readiness: Readiness): ReadinessState | null;
87
110
  /**
88
111
  * Ready enough to be useful, which is not the same as every box ticked.
89
112
  *
90
113
  * Hooks and the agent skill are genuinely optional — `send` works without
91
114
  * them — so an install that declined both is finished, not half-done. Saying
92
- * otherwise trains people to ignore the summary line.
115
+ * otherwise trains people to ignore the summary line, and it is the summary
116
+ * line an agent branches on.
93
117
  */
94
118
  export declare function isReady(readiness: Readiness): boolean;
95
119
  /** Baseline Notification Requests can be submitted in the final assessed state. */
package/dist/readiness.js CHANGED
@@ -23,15 +23,45 @@
23
23
  export function firstBlocker(readiness) {
24
24
  return readiness.states.find((s) => s.status === 'gap') ?? null;
25
25
  }
26
+ /**
27
+ * Question Routing: what lets a question reach a phone when nobody is at the
28
+ * terminal. Hooks, their sub-states, and the setting that admits them.
29
+ *
30
+ * Separate from `isOptionalSetup` because these are also the states a human
31
+ * should not be handed as leftovers — "Optional, not set up" is a fair line
32
+ * about the agent skill and a confusing one about a session pointer.
33
+ */
34
+ export function isOptionalAutomation(id) {
35
+ return id === 'hooks' || id.startsWith('hooks-') || id === 'question-routing-settings';
36
+ }
37
+ /**
38
+ * Automation layered on top of a product that already sends: Question Routing
39
+ * and the agent guidance skill.
40
+ *
41
+ * Real, and reported. `doctor` is the report and judges it strictly. Anything
42
+ * whose job is to get a first notification delivered treats it as a line to
43
+ * print, never a gate — a hook diagnostic or a duplicate skill install in
44
+ * front of the delivery proof means a setup that can already send never proves
45
+ * that it can. The one that fires most often, a turn that has not ended yet,
46
+ * cannot be closed by the agent standing inside that turn at all.
47
+ */
48
+ export function isOptionalSetup(id) {
49
+ return id === 'skill' || isOptionalAutomation(id);
50
+ }
51
+ /** The first thing in the way that is not optional automation. */
52
+ export function firstRequiredBlocker(readiness) {
53
+ return readiness.states.find((s) => s.status === 'gap' && !isOptionalSetup(s.id)) ?? null;
54
+ }
26
55
  /**
27
56
  * Ready enough to be useful, which is not the same as every box ticked.
28
57
  *
29
58
  * Hooks and the agent skill are genuinely optional — `send` works without
30
59
  * them — so an install that declined both is finished, not half-done. Saying
31
- * otherwise trains people to ignore the summary line.
60
+ * otherwise trains people to ignore the summary line, and it is the summary
61
+ * line an agent branches on.
32
62
  */
33
63
  export function isReady(readiness) {
34
- return firstBlocker(readiness) === null;
64
+ return firstRequiredBlocker(readiness) === null;
35
65
  }
36
66
  const SEND_PREREQUISITES =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CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;IACpE,CAAC;AACH,CAAC"}
@@ -17,7 +17,7 @@ export function sessionActivationOutput(harness, hookEventName, cwd = process.cw
17
17
  const context = hookEventName === 'SubagentStart'
18
18
  ? WORKER_ACTIVATION_CONTEXT
19
19
  : rootActivationContext(cwd, env);
20
- if (harness === 'opencode')
20
+ if (harness === 'opencode' || harness === 'openclaw')
21
21
  return context;
22
22
  if (harness === 'cursor') {
23
23
  return JSON.stringify({ additional_context: context });
@@ -1 +1 @@
1
- {"version":3,"file":"session-activation.js","sourceRoot":"","sources":["../src/session-activation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AAE3F,MAAM,cAAc,GAClB,sHAAsH;IACtH,iEAAiE,CAAA;AAEnE,MAAM,CAAC,MAAM,yBAAyB,GACpC,6WAA6W,CAAA;AAE/W,MAAM,CAAC,MAAM,kCAAkC,GAC7C,2JAA2J,CAAA;AAE7J,SAAS,qBAAqB,CAAC,GAAW,EAAE,GAAsB;IAChE,MAAM,QAAQ,GAAG,wBAAwB,CAAC;QACxC,GAAG;QACH,GAAG;QACH,QAAQ,EAAE,0BAA0B,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,cAAc,MAAM,EAAE,MAAM,CAAC;KAC1F,CAAC,CAAA;IACF,OAAO,GAAG,cAAc,OAAO,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAA;AACrF,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,uBAAuB,CACrC,OAAgC,EAChC,aAA+C,EAC/C,MAAc,OAAO,CAAC,GAAG,EAAE,EAC3B,MAAyB,OAAO,CAAC,GAAG;IAEpC,MAAM,OAAO,GAAG,aAAa,KAAK,eAAe;QAC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errand is finished.
3
+ *
4
+ * Every handoff opens the destination for exactly one errand, carrying the
5
+ * platform when this terminal already asked for it. The omnibus help page is
6
+ * help: it covers access, two install routes, billing, refunds, deletion,
7
+ * privacy and terms, and its own next step is to go somewhere else. Sending
8
+ * someone there for a named gate makes them find it themselves.
9
+ *
10
+ * The server prints these same paths into `next_action`, which is the value
11
+ * this CLI prefers whenever it has one. These builders are the fallback for
12
+ * the paths where it does not, and they must stay spelled the same.
13
+ */
14
+ /** The two platforms that can receive a notification. Mac is not one. */
15
+ export declare const COMPANION_PLATFORMS: readonly ["iphone", "android"];
16
+ export type CompanionPlatform = (typeof COMPANION_PLATFORMS)[number];
17
+ export declare function companionPlatformLabel(platform: CompanionPlatform): string;
18
+ /** Getting this Account access to Notifai, and nothing else. */
19
+ export declare function setupAccessUrl(baseUrl: string, platform?: CompanionPlatform): string;
20
+ /** Installing the Companion App on one named platform. */
21
+ export declare function setupCompanionUrl(baseUrl: string, platform?: CompanionPlatform): string;
22
+ /** General help: billing, policies, and everything setup is not. */
23
+ export declare function supportPageUrl(baseUrl: string): string;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Where a cross-surface setup errand is finished.
3
+ *
4
+ * Every handoff opens the destination for exactly one errand, carrying the
5
+ * platform when this terminal already asked for it. The omnibus help page is
6
+ * help: it covers access, two install routes, billing, refunds, deletion,
7
+ * privacy and terms, and its own next step is to go somewhere else. Sending
8
+ * someone there for a named gate makes them find it themselves.
9
+ *
10
+ * The server prints these same paths into `next_action`, which is the value
11
+ * this CLI prefers whenever it has one. These builders are the fallback for
12
+ * the paths where it does not, and they must stay spelled the same.
13
+ */
14
+ /** The two platforms that can receive a notification. Mac is not one. */
15
+ export const COMPANION_PLATFORMS = ['iphone', 'android'];
16
+ export function companionPlatformLabel(platform) {
17
+ return platform === 'iphone' ? 'iPhone' : 'Android';
18
+ }
19
+ /**
20
+ * The dashboard a reader can sign in to, which is not always the API origin.
21
+ * Only the hosted deployment splits them; a self-host serves both from one.
22
+ */
23
+ function dashboardOrigin(baseUrl) {
24
+ const normalized = baseUrl.replace(/\/+$/, '');
25
+ if (normalized === 'https://api.notifai.sh' || normalized === 'https://notifai.fly.dev') {
26
+ return 'https://app.notifai.sh';
27
+ }
28
+ return normalized;
29
+ }
30
+ /** Getting this Account access to Notifai, and nothing else. */
31
+ export function setupAccessUrl(baseUrl, platform) {
32
+ const base = `${dashboardOrigin(baseUrl)}/setup/access`;
33
+ return platform === undefined ? base : `${base}?platform=${platform}`;
34
+ }
35
+ /** Installing the Companion App on one named platform. */
36
+ export function setupCompanionUrl(baseUrl, platform) {
37
+ const base = `${dashboardOrigin(baseUrl)}/setup/companion`;
38
+ return platform === undefined ? base : `${base}?platform=${platform}`;
39
+ }
40
+ /** General help: billing, policies, and everything setup is not. */
41
+ export function supportPageUrl(baseUrl) {
42
+ return `${dashboardOrigin(baseUrl)}/support`;
43
+ }
44
+ //# sourceMappingURL=setup-destinations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-destinations.js","sourceRoot":"","sources":["../src/setup-destinations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,yEAAyE;AACzE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAU,CAAA;AAGjE,MAAM,UAAU,sBAAsB,CAAC,QAA2B;IAChE,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAA;AACrD,CAAC;AAED;;;GAGG;AACH,SAAS,eAAe,CAAC,OAAe;IACtC,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IAC9C,IAAI,UAAU,KAAK,wBAAwB,IAAI,UAAU,KAAK,yBAAyB,EAAE,CAAC;QACxF,OAAO,wBAAwB,CAAA;IACjC,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,cAAc,CAAC,OAAe,EAAE,QAA4B;IAC1E,MAAM,IAAI,GAAG,GAAG,eAAe,CAAC,OAAO,CAAC,eAAe,CAAA;IACvD,OAAO,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,aAAa,QAAQ,EAAE,CAAA;AACvE,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,iBAAiB,CAAC,OAAe,EAAE,QAA4B;IAC7E,MAAM,IAAI,GAAG,GAAG,eAAe,CAAC,OAAO,CAAC,kBAAkB,CAAA;IAC1D,OAAO,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,aAAa,QAAQ,EAAE,CAAA;AACvE,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,UAAU,CAAA;AAC9C,CAAC"}
package/dist/ui/help.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Help that answers "what can I do here", not "what strings does argv accept".
3
3
  *
4
- * The old help listed seventeen commands in one flat column, with the two a new
5
- * user needs (`init`, `login`) sitting between a platform capability dump and
4
+ * The old help listed seventeen commands in one flat column, with the one a new
5
+ * user needs (`init`) sitting between a platform capability dump and
6
6
  * an entry point marked "Internal:". Everything was equally prominent, which is
7
7
  * the same as nothing being prominent.
8
8
  *
@@ -38,8 +38,7 @@ export declare const helpConfiguration: HelpConfiguration;
38
38
  /**
39
39
  * Footer for the root help.
40
40
  *
41
- * Its whole job is to make the interactive app discoverable, because someone
42
- * reading a wall of flags has already demonstrated they did not know it was
43
- * there.
41
+ * First-run is `notifai init`. The interactive app is what a human opens
42
+ * later, once setup is no longer the thing in the way.
44
43
  */
45
44
  export declare function rootHelpFooter(): string;
package/dist/ui/help.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Help that answers "what can I do here", not "what strings does argv accept".
3
3
  *
4
- * The old help listed seventeen commands in one flat column, with the two a new
5
- * user needs (`init`, `login`) sitting between a platform capability dump and
4
+ * The old help listed seventeen commands in one flat column, with the one a new
5
+ * user needs (`init`) sitting between a platform capability dump and
6
6
  * an entry point marked "Internal:". Everything was equally prominent, which is
7
7
  * the same as nothing being prominent.
8
8
  *
@@ -84,16 +84,15 @@ export const helpConfiguration = {
84
84
  /**
85
85
  * Footer for the root help.
86
86
  *
87
- * Its whole job is to make the interactive app discoverable, because someone
88
- * reading a wall of flags has already demonstrated they did not know it was
89
- * there.
87
+ * First-run is `notifai init`. The interactive app is what a human opens
88
+ * later, once setup is no longer the thing in the way.
90
89
  */
91
90
  export function rootHelpFooter() {
92
91
  const lines = [
93
92
  '',
94
93
  style.heading('Start here'),
95
- ` ${style.code('notifai')} ${style.dim(`${glyph.arrow} the interactive app: status, settings, devices, test sends`)}`,
96
94
  ` ${style.code('notifai init')} ${style.dim(`${glyph.arrow} set this project up, step by step`)}`,
95
+ ` ${style.code('notifai')} ${style.dim(`${glyph.arrow} after setup: status, settings, devices, test sends`)}`,
97
96
  '',
98
97
  style.heading('First call, for an agent'),
99
98
  ` ${style.code('notifai send --kind done --title "All 42 tests passed" --body "Finished in 3m 10s. Next: review the release candidate."')}`,
@@ -1 +1 @@
1
- {"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/ui/help.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,IAAI,EAAqD,MAAM,WAAW,CAAA;AACnF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAEzC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,KAAK,EAAE,kBAAkB;IACzB,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,yBAAyB;IAChC,QAAQ,EAAE,qBAAqB;CACvB,CAAA;AAEV,4DAA4D;AAC5D,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,OAAO,EAAE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- "version": "10.0.0",
3
+ "version": "10.1.1",
4
4
  "type": "module",
5
5
  "description": "Send native device notifications from agents and local programs",
6
6
  "bin": {
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@clack/prompts": "^1.7.0",
24
- "@raidiant/notifai-protocol": "6.0.0",
24
+ "@raidiant/notifai-protocol": "6.0.2",
25
25
  "commander": "^14.0.0",
26
26
  "picocolors": "^1.1.1",
27
27
  "smol-toml": "^1.4.0"
@@ -1,10 +1,60 @@
1
- import { chmodSync, mkdirSync, mkdtempSync, writeFileSync } from 'node:fs'
1
+ import {
2
+ chmodSync,
3
+ mkdirSync,
4
+ mkdtempSync,
5
+ realpathSync,
6
+ symlinkSync,
7
+ writeFileSync,
8
+ } from 'node:fs'
2
9
  import os from 'node:os'
3
10
  import path from 'node:path'
4
11
  import { describe, expect, it } from 'vitest'
5
12
  import { cliBinReadiness, isExecutablePath, pathNotifaiEntries } from './cli-bin.js'
13
+ import { cliUpdateRecoveryCommand } from './cli-update-contract.js'
6
14
 
7
15
  describe('PATH notifai diagnosis', () => {
16
+ function posixInstall(root: string, name: string, version: string) {
17
+ const prefix = path.join(root, name)
18
+ const artifact = path.join(
19
+ prefix,
20
+ 'lib',
21
+ 'node_modules',
22
+ '@raidiant',
23
+ 'notifai',
24
+ 'dist',
25
+ 'main.js',
26
+ )
27
+ const command = path.join(prefix, 'bin', 'notifai')
28
+ mkdirSync(path.dirname(artifact), { recursive: true })
29
+ mkdirSync(path.dirname(command), { recursive: true })
30
+ writeFileSync(path.join(path.dirname(path.dirname(artifact)), 'package.json'), JSON.stringify({ version }))
31
+ writeFileSync(artifact, '#!/usr/bin/env node\n')
32
+ chmodSync(artifact, 0o755)
33
+ symlinkSync(path.relative(path.dirname(command), artifact), command)
34
+ return { prefix, artifact, command }
35
+ }
36
+
37
+ function windowsInstall(root: string, name: string, version: string) {
38
+ const prefix = path.join(root, name)
39
+ const artifact = path.join(
40
+ prefix,
41
+ 'node_modules',
42
+ '@raidiant',
43
+ 'notifai',
44
+ 'dist',
45
+ 'main.js',
46
+ )
47
+ const command = path.join(prefix, 'notifai.cmd')
48
+ mkdirSync(path.dirname(artifact), { recursive: true })
49
+ writeFileSync(path.join(path.dirname(path.dirname(artifact)), 'package.json'), JSON.stringify({ version }))
50
+ writeFileSync(artifact, '#!/usr/bin/env node\n')
51
+ writeFileSync(
52
+ command,
53
+ '@ECHO off\r\nnode "%dp0%node_modules\\@raidiant\\notifai\\dist\\main.js" %*\r\n',
54
+ )
55
+ return { prefix, artifact, command }
56
+ }
57
+
8
58
  it('reports a non-executable PATH binary as a gap', () => {
9
59
  if (process.platform === 'win32') return
10
60
  const directory = mkdtempSync(path.join(os.tmpdir(), 'notifai-bin-gap-'))
@@ -14,8 +64,10 @@ describe('PATH notifai diagnosis', () => {
14
64
  expect(isExecutablePath(file, 'darwin')).toBe(false)
15
65
  const state = cliBinReadiness({ PATH: directory }, 'darwin')
16
66
  expect(state.status).toBe('gap')
17
- expect(state.detail).toContain(file)
18
- expect(state.remedy?.command).toBe('npm install -g @raidiant/notifai')
67
+ expect(state.detail).not.toContain(file)
68
+ expect(state.technical).toMatchObject({ entries: [{ command_path: file, executable: false }] })
69
+ expect(state.remedy?.command).not.toBe('notifai update')
70
+ expect(state.remedy?.command).toMatch(/ update$/)
19
71
  })
20
72
 
21
73
  it('treats an executable PATH binary as ready', () => {
@@ -25,14 +77,100 @@ describe('PATH notifai diagnosis', () => {
25
77
  writeFileSync(file, '#!/usr/bin/env node\n')
26
78
  chmodSync(file, 0o755)
27
79
  expect(pathNotifaiEntries({ PATH: directory }, 'darwin')).toEqual([file])
28
- expect(cliBinReadiness({ PATH: directory }, 'darwin').status).toBe('ready')
80
+ expect(
81
+ cliBinReadiness({ PATH: directory }, 'darwin', {
82
+ runningArtifactPath: file,
83
+ currentVersion: null,
84
+ }).status,
85
+ ).toBe('ready')
86
+ })
87
+
88
+ it('does not call an older executable PATH winner ready when this process is the current CLI', () => {
89
+ const root = mkdtempSync(path.join(os.tmpdir(), 'notifai-bin-stale-winner-'))
90
+ const old = posixInstall(root, 'old', '3.0.1')
91
+ const current = posixInstall(root, 'current', '10.1.0')
92
+
93
+ const state = cliBinReadiness(
94
+ { PATH: `${path.dirname(old.command)}:${path.dirname(current.command)}` },
95
+ 'darwin',
96
+ {
97
+ runningArtifactPath: current.artifact,
98
+ currentVersion: '10.1.0',
99
+ },
100
+ )
101
+
102
+ expect(state.status).toBe('gap')
103
+ expect(state.detail).not.toContain(old.command)
104
+ expect(state.remedy?.command).toBe(
105
+ cliUpdateRecoveryCommand(),
106
+ )
107
+ expect(state.remedy?.command).not.toContain(old.command)
108
+ expect(state.technical).toMatchObject({
109
+ current: { artifact_path: realpathSync(current.artifact), version: '10.1.0' },
110
+ effective: { command_path: old.command, artifact_path: realpathSync(old.artifact), version: '3.0.1' },
111
+ })
112
+ })
113
+
114
+ it('uses Windows Path order to reject an older executable winner', () => {
115
+ const root = mkdtempSync(path.join(os.tmpdir(), 'notifai-bin-windows-winner-'))
116
+ const old = windowsInstall(root, 'old', '3.0.1')
117
+ const current = windowsInstall(root, 'current', '10.1.0')
118
+
119
+ const state = cliBinReadiness(
120
+ { Path: `${old.prefix};${current.prefix}` },
121
+ 'win32',
122
+ {
123
+ runningArtifactPath: current.artifact,
124
+ currentVersion: '10.1.0',
125
+ },
126
+ )
127
+
128
+ expect(state.status).toBe('gap')
129
+ expect(state.remedy?.command).toBe(
130
+ cliUpdateRecoveryCommand(),
131
+ )
132
+ expect(state.technical).toMatchObject({
133
+ effective: {
134
+ command_path: old.command,
135
+ artifact_path: realpathSync(old.artifact),
136
+ version: '3.0.1',
137
+ },
138
+ })
139
+ })
140
+
141
+ it('keeps a healthy winner ready while reporting a later broken duplicate for cleanup', () => {
142
+ const root = mkdtempSync(path.join(os.tmpdir(), 'notifai-bin-later-broken-'))
143
+ const current = posixInstall(root, 'current', '10.1.0')
144
+ const broken = posixInstall(root, 'broken', '3.0.1')
145
+ chmodSync(broken.artifact, 0o644)
146
+
147
+ const state = cliBinReadiness(
148
+ { PATH: `${path.dirname(current.command)}:${path.dirname(broken.command)}` },
149
+ 'darwin',
150
+ { runningArtifactPath: current.artifact, currentVersion: '10.1.0' },
151
+ )
152
+
153
+ expect(state.status).toBe('optional-gap')
154
+ expect(state.detail).toContain('ready')
155
+ expect(state.detail).not.toContain(broken.command)
156
+ expect(state.technical).toMatchObject({
157
+ effective: { command_path: current.command, executable: true },
158
+ entries: [
159
+ { command_path: current.command, executable: true },
160
+ { command_path: broken.command, executable: false },
161
+ ],
162
+ })
29
163
  })
30
164
 
31
- it('is ready when PATH has no notifai entry', () => {
165
+ it('does not call a PATH with no notifai entry ready', () => {
32
166
  const directory = mkdtempSync(path.join(os.tmpdir(), 'notifai-bin-empty-'))
33
167
  mkdirSync(directory, { recursive: true })
34
168
  const state = cliBinReadiness({ PATH: directory }, process.platform)
35
- expect(state.status).toBe('ready')
36
- expect(state.detail).toContain('no notifai binary was on PATH')
169
+ // The running process proves nothing about the command every printed next
170
+ // step names — but it is running, so this cannot stand in the way either.
171
+ expect(state.status).toBe('optional-gap')
172
+ expect(state.detail).toContain('will not be found')
173
+ expect(state.remedy?.command).not.toBe('notifai update')
174
+ expect(state.remedy?.command).toMatch(/ update$/)
37
175
  })
38
176
  })