@raidiant/notifai 10.1.6 → 11.0.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 (161) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +28 -16
  3. package/dist/claude-wake.d.ts +1 -2
  4. package/dist/claude-wake.js +15 -61
  5. package/dist/claude-wake.js.map +1 -1
  6. package/dist/cli-bin.js +3 -14
  7. package/dist/cli-bin.js.map +1 -1
  8. package/dist/cli-contract.d.ts +12 -0
  9. package/dist/cli-contract.js +19 -0
  10. package/dist/cli-contract.js.map +1 -0
  11. package/dist/cli-release.d.ts +0 -1
  12. package/dist/cli-release.js +5 -21
  13. package/dist/cli-release.js.map +1 -1
  14. package/dist/client.d.ts +2 -2
  15. package/dist/codex-wake.d.ts +1 -1
  16. package/dist/codex-wake.js +8 -36
  17. package/dist/codex-wake.js.map +1 -1
  18. package/dist/command-session.js +2 -1
  19. package/dist/command-session.js.map +1 -1
  20. package/dist/commands-acknowledge.d.ts +13 -0
  21. package/dist/commands-acknowledge.js +67 -0
  22. package/dist/commands-acknowledge.js.map +1 -0
  23. package/dist/commands-ask.d.ts +63 -0
  24. package/dist/commands-ask.js +407 -0
  25. package/dist/commands-ask.js.map +1 -0
  26. package/dist/commands-close.d.ts +6 -0
  27. package/dist/commands-close.js +197 -0
  28. package/dist/commands-close.js.map +1 -0
  29. package/dist/commands-config.js +2 -2
  30. package/dist/commands-config.js.map +1 -1
  31. package/dist/commands-core.js +2 -2
  32. package/dist/commands-core.js.map +1 -1
  33. package/dist/commands-doctor.js +89 -134
  34. package/dist/commands-doctor.js.map +1 -1
  35. package/dist/commands-harness-context.d.ts +0 -1
  36. package/dist/commands-harness-context.js +2 -4
  37. package/dist/commands-harness-context.js.map +1 -1
  38. package/dist/commands-hook-diagnostics.d.ts +27 -0
  39. package/dist/commands-hook-diagnostics.js +97 -0
  40. package/dist/commands-hook-diagnostics.js.map +1 -0
  41. package/dist/commands-hook-install.d.ts +26 -0
  42. package/dist/commands-hook-install.js +549 -0
  43. package/dist/commands-hook-install.js.map +1 -0
  44. package/dist/commands-hook-run.d.ts +29 -0
  45. package/dist/commands-hook-run.js +517 -0
  46. package/dist/commands-hook-run.js.map +1 -0
  47. package/dist/commands-init.d.ts +2 -7
  48. package/dist/commands-init.js +59 -92
  49. package/dist/commands-init.js.map +1 -1
  50. package/dist/commands-send.js +35 -3
  51. package/dist/commands-send.js.map +1 -1
  52. package/dist/commands-skill.js +5 -5
  53. package/dist/commands-skill.js.map +1 -1
  54. package/dist/commands-update.js +17 -31
  55. package/dist/commands-update.js.map +1 -1
  56. package/dist/commands.d.ts +11 -6
  57. package/dist/commands.js +9 -4
  58. package/dist/commands.js.map +1 -1
  59. package/dist/config-schema.js +2 -2
  60. package/dist/config-schema.js.map +1 -1
  61. package/dist/config.d.ts +14 -4
  62. package/dist/config.js +35 -9
  63. package/dist/config.js.map +1 -1
  64. package/dist/file-lock.d.ts +3 -0
  65. package/dist/file-lock.js +33 -17
  66. package/dist/file-lock.js.map +1 -1
  67. package/dist/guidance-content.js +30 -15
  68. package/dist/guidance-content.js.map +1 -1
  69. package/dist/harnesses.d.ts +2 -2
  70. package/dist/harnesses.js +10 -2
  71. package/dist/harnesses.js.map +1 -1
  72. package/dist/hook-acknowledgements.d.ts +42 -0
  73. package/dist/hook-acknowledgements.js +316 -0
  74. package/dist/hook-acknowledgements.js.map +1 -0
  75. package/dist/hook-adapter.js +7 -4
  76. package/dist/hook-adapter.js.map +1 -1
  77. package/dist/hook-events.d.ts +6 -0
  78. package/dist/hook-events.js +22 -0
  79. package/dist/hook-events.js.map +1 -0
  80. package/dist/hook-gates.d.ts +7 -0
  81. package/dist/hook-gates.js +21 -0
  82. package/dist/hook-gates.js.map +1 -0
  83. package/dist/hook-lifecycle.d.ts +93 -0
  84. package/dist/{hooks.js → hook-lifecycle.js} +61 -1359
  85. package/dist/hook-lifecycle.js.map +1 -0
  86. package/dist/hook-project-sessions.d.ts +28 -0
  87. package/dist/hook-project-sessions.js +141 -0
  88. package/dist/hook-project-sessions.js.map +1 -0
  89. package/dist/hook-question-lock.d.ts +7 -0
  90. package/dist/hook-question-lock.js +173 -0
  91. package/dist/hook-question-lock.js.map +1 -0
  92. package/dist/hook-question-retirement.d.ts +57 -0
  93. package/dist/hook-question-retirement.js +261 -0
  94. package/dist/hook-question-retirement.js.map +1 -0
  95. package/dist/hook-question-state.d.ts +45 -0
  96. package/dist/hook-question-state.js +196 -0
  97. package/dist/hook-question-state.js.map +1 -0
  98. package/dist/hook-session-state.d.ts +31 -0
  99. package/dist/hook-session-state.js +249 -0
  100. package/dist/hook-session-state.js.map +1 -0
  101. package/dist/{hooks.d.ts → hook-types.d.ts} +17 -236
  102. package/dist/hook-types.js +4 -0
  103. package/dist/hook-types.js.map +1 -0
  104. package/dist/install-hooks.d.ts +72 -60
  105. package/dist/install-hooks.js +292 -211
  106. package/dist/install-hooks.js.map +1 -1
  107. package/dist/interactive.d.ts +3 -16
  108. package/dist/interactive.js +19 -95
  109. package/dist/interactive.js.map +1 -1
  110. package/dist/local-path.d.ts +7 -0
  111. package/dist/local-path.js +27 -0
  112. package/dist/local-path.js.map +1 -0
  113. package/dist/node-floor.js +3 -10
  114. package/dist/node-floor.js.map +1 -1
  115. package/dist/npm-invocation.d.ts +34 -0
  116. package/dist/npm-invocation.js +53 -0
  117. package/dist/npm-invocation.js.map +1 -0
  118. package/dist/openclaw-plugin.d.ts +12 -3
  119. package/dist/openclaw-plugin.js +42 -16
  120. package/dist/openclaw-plugin.js.map +1 -1
  121. package/dist/opencode-plugin.d.ts +2 -2
  122. package/dist/opencode-plugin.js +4 -6
  123. package/dist/opencode-plugin.js.map +1 -1
  124. package/dist/program.js +11 -13
  125. package/dist/program.js.map +1 -1
  126. package/dist/project-enablement.d.ts +6 -0
  127. package/dist/project-enablement.js +11 -27
  128. package/dist/project-enablement.js.map +1 -1
  129. package/dist/question-settlement-process.d.ts +1 -1
  130. package/dist/readiness.d.ts +3 -3
  131. package/dist/readiness.js +14 -6
  132. package/dist/readiness.js.map +1 -1
  133. package/dist/send.d.ts +8 -4
  134. package/dist/send.js +145 -26
  135. package/dist/send.js.map +1 -1
  136. package/dist/session-activation.d.ts +3 -1
  137. package/dist/session-activation.js +16 -0
  138. package/dist/session-activation.js.map +1 -1
  139. package/dist/skill-source/manifest.json +4 -4
  140. package/dist/skill-source/notifai/SKILL.md +67 -63
  141. package/dist/skill-source/notifai/references/harness-setup.md +62 -28
  142. package/dist/ui/config-view.d.ts +0 -2
  143. package/dist/ui/config-view.js +1 -5
  144. package/dist/ui/config-view.js.map +1 -1
  145. package/dist/ui/theme.d.ts +0 -3
  146. package/dist/ui/theme.js +0 -1
  147. package/dist/ui/theme.js.map +1 -1
  148. package/dist/version.d.ts +22 -0
  149. package/dist/version.js +51 -0
  150. package/dist/version.js.map +1 -0
  151. package/dist/wake-support.d.ts +8 -0
  152. package/dist/wake-support.js +38 -0
  153. package/dist/wake-support.js.map +1 -0
  154. package/package.json +2 -2
  155. package/dist/cli-update-contract.d.ts +0 -7
  156. package/dist/cli-update-contract.js +0 -10
  157. package/dist/cli-update-contract.js.map +0 -1
  158. package/dist/commands-hooks.d.ts +0 -160
  159. package/dist/commands-hooks.js +0 -1798
  160. package/dist/commands-hooks.js.map +0 -1
  161. package/dist/hooks.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wake-support.js","sourceRoot":"","sources":["../src/wake-support.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAG1C,MAAM,UAAU,eAAe,CAAC,MAAc;IAC5C,OAAO;QACL,KAAK,EAAE,CAAC,kDAAkD,MAAM,EAAE,CAAC;QACnE,GAAG,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE;QAC7D,eAAe,EAAE,MAAM;KACxB,CAAA;AACH,CAAC;AAED,MAAM,UAAU,iBAA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MAAM,CAAC,CAAA;QAC3B,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;YAClC,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;gBACf,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;gBACzC,OAAM;YACR,CAAC;YACD,MAAM,CACJ,IAAI,KAAK,CACP,GAAG,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,WAAW,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAC1I,CACF,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raidiant/notifai",
3
- "version": "10.1.6",
3
+ "version": "11.0.1",
4
4
  "type": "module",
5
5
  "description": "Send native device notifications from agents and local programs",
6
6
  "bin": {
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "dependencies": {
14
14
  "@clack/prompts": "^1.7.0",
15
- "@raidiant/notifai-protocol": "6.0.7",
15
+ "@raidiant/notifai-protocol": "6.1.1",
16
16
  "commander": "^14.0.0",
17
17
  "picocolors": "^1.1.1",
18
18
  "smol-toml": "^1.4.0"
@@ -1,7 +0,0 @@
1
- /**
2
- * Resolve the current published CLI independently of every installed
3
- * `notifai` command. The fetched build owns the locally derived prefix repair,
4
- * so this action neither invokes the stale PATH winner nor exposes local
5
- * installation paths.
6
- */
7
- export declare function cliUpdateRecoveryCommand(): string;
@@ -1,10 +0,0 @@
1
- /**
2
- * Resolve the current published CLI independently of every installed
3
- * `notifai` command. The fetched build owns the locally derived prefix repair,
4
- * so this action neither invokes the stale PATH winner nor exposes local
5
- * installation paths.
6
- */
7
- export function cliUpdateRecoveryCommand() {
8
- return 'npx --yes @raidiant/notifai@latest update';
9
- }
10
- //# sourceMappingURL=cli-update-contract.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-update-contract.js","sourceRoot":"","sources":["../src/cli-update-contract.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB;IACtC,OAAO,2CAA2C,CAAA;AACpD,CAAC"}
@@ -1,160 +0,0 @@
1
- import { type QuestionT } from '@raidiant/notifai-protocol';
2
- import { type HookInstallableHarness } from './harnesses.js';
3
- import { type HookHarness } from './hooks.js';
4
- import { type Installation } from './install-hooks.js';
5
- import { type CommandDeps } from './commands-core.js';
6
- import { type ActiveHarnessSession } from './commands-harness-context.js';
7
- export declare const HOOK_EVENTS: readonly ["session-start", "subagent-start", "activation-stop", "user-prompt-submit", "stop", "session-end"];
8
- export type HookEvent = (typeof HOOK_EVENTS)[number];
9
- /** Lifecycle handlers one installed harness must carry in this CLI build. */
10
- export declare function requiredHookEvents(harness: HookInstallableHarness): readonly HookEvent[];
11
- /** SessionEnd cleanup must precede every diagnostic that can wait on a file lock. */
12
- export declare function hookDefersDiagnosticsUntilAfterCleanup(event: unknown): event is 'session-end';
13
- /**
14
- * Runs one harness hook. Contract with every harness: hook JSON arrives on
15
- * stdin, harness output (if any) goes to stdout, diagnostics go to stderr, and
16
- * exit 0 with no stdout means "no decision or added context — carry on as normal".
17
- *
18
- * Every failure path in here must reach that no-decision state. A hook that
19
- * throws, or that blocks past the harness's timeout, degrades the agent for a
20
- * feature the user only asked to make it more convenient.
21
- */
22
- export declare function hookRunCommand(deps: CommandDeps, event: string, readStdin: () => Promise<string>, harness?: HookHarness): Promise<number>;
23
- /**
24
- * What went wrong, in terms of what to do about it.
25
- *
26
- * On 2026-08-03 a contract change shipped without the server deploy that goes
27
- * with it. The CLI stamped `lifecycle` on every question draft, the deployed
28
- * server rejected the unknown field, and escalation stopped working entirely —
29
- * announced as "hook failed, deferring to the terminal", which reads like a
30
- * flaky network. The information needed to diagnose it in one second was
31
- * already in hand: a 422 whose details name the offending path. It was being
32
- * thrown away by `String(err)`.
33
- *
34
- * A hook still exits 0 whatever this says. Handing the terminal back is always
35
- * right; the only question is whether the user is told anything they can use.
36
- */
37
- export declare function describeHookFailure(err: unknown): string[];
38
- export interface AskFlags {
39
- /** Emit the registration and its turn obligation as one JSON object. */
40
- json?: boolean;
41
- choice?: string[];
42
- /** The single question is multi-select: several answers may be chosen. */
43
- multi?: boolean;
44
- /** Optional Markdown context appended after the question block. */
45
- body?: string;
46
- /** Allow visible backslash-n sequences in `--body`. */
47
- literalBackslashN?: boolean;
48
- /** Raw JSON for a multi-question form; replaces the positional question. */
49
- form?: string;
50
- image?: string[];
51
- imageAlt?: string[];
52
- project?: string;
53
- sessionLabel?: string;
54
- }
55
- export interface AskFailure {
56
- ok: false;
57
- registered: false;
58
- code: string;
59
- check_id: string;
60
- exit_code: number;
61
- remedy: string;
62
- message: string;
63
- user_action?: {
64
- code: string;
65
- harness: string;
66
- action: string;
67
- message: string;
68
- };
69
- }
70
- export declare const CODEX_HOOK_APPROVAL_USER_ACTION: {
71
- readonly code: "codex_hook_approval_required";
72
- readonly harness: "codex";
73
- readonly action: "approve_or_enable_notifai_hooks";
74
- readonly message: "Open `/hooks` in Codex, approve or enable the Notifai handlers, then tell me when it is done. I will finish setup and verify a fresh session.";
75
- };
76
- export declare const CODEX_FRESH_SESSION_USER_ACTION: {
77
- readonly code: "codex_fresh_session_required";
78
- readonly harness: "codex";
79
- readonly action: "start_fresh_codex_session";
80
- readonly message: "Start one fresh Codex session, send one prompt in it, then retry the question.";
81
- };
82
- export declare const CODEX_STALE_STOP_DEFINITION_PROBLEM = "the exact Codex Agent Session activated before the current Stop definition; Codex can keep the earlier timeout in that session even when the file on disk is current. Start one fresh Codex session, send one prompt in it, then retry";
83
- export declare const CODEX_STOP_DEFINITION_NOT_SINGULAR_PROBLEM = "the active Codex configuration does not contain exactly one Notifai Stop definition, so no singular turn-end owner can be proven";
84
- export declare const CODEX_ACTIVATION_INSTALLATION_MISSING_PROBLEM = "the exact Codex Agent Session activation checkout has no matching hook installation";
85
- /** One stable failure contract for every machine-readable ask refusal. */
86
- export declare function reportAskFailure(deps: CommandDeps, flags: Pick<AskFlags, 'json'>, failure: Omit<AskFailure, 'ok' | 'registered'>): number;
87
- export interface BuiltQuestions {
88
- questions: QuestionT[];
89
- /**
90
- * Canonical Markdown body. The question already travels as the notification
91
- * title and as structured questions, so the body carries only the context —
92
- * repeating the question there put it on the lock screen and the reply
93
- * screen twice. Only when there is no context does the question text stand
94
- * in, because the wire requires a body.
95
- */
96
- body: string;
97
- }
98
- /**
99
- * Turn ask input into questions plus their canonical body. Everything is
100
- * validated at registration because a later hook failure is easy to miss.
101
- */
102
- export declare function buildQuestions(flags: AskFlags, question: string | undefined): {
103
- ok: true;
104
- questions: QuestionT[];
105
- body: string;
106
- } | {
107
- ok: false;
108
- error: string;
109
- };
110
- /**
111
- * Registers a question for turn-end routing. Returns immediately so the agent
112
- * can ask in prose and end its turn; the terminal keeps the question to itself
113
- * for `ask_grace_seconds` before it reaches any device.
114
- */
115
- export declare function askCommand(deps: CommandDeps, question: string | undefined, flags: AskFlags): number | Promise<number>;
116
- /**
117
- * One fail-closed admission gate shared by every active harness route.
118
- * Finding a file is not readiness: the exact session, one current definition,
119
- * the stable adapter, a long enough Stop owner, and (for Codex) trust must all
120
- * be true before `ask` is allowed to create an answerable notification.
121
- */
122
- export declare function activeQuestionRouteProblems(deps: CommandDeps, active: ActiveHarnessSession, installations: Installation[]): string[];
123
- /** The least disruptive verified way to make each installed adapter run once. */
124
- export declare function hookActivationAdvice(installations: Installation[]): string;
125
- /**
126
- * Record the one Agent Acknowledgement associated with a replied-to request.
127
- *
128
- * `--text` is optional here because the acknowledgement is not: an account may
129
- * turn the agent's written reply off, and the receipt must still be recorded so
130
- * the user sees that an agent read the answer. The service holds the account's
131
- * snapshot, so it — not this process — decides whether text was owed.
132
- */
133
- export declare function acknowledgeCommand(deps: CommandDeps, requestId: string, flags: {
134
- text?: string;
135
- json?: boolean;
136
- }): Promise<number>;
137
- /** Retire a question so a late answer is rejected rather than silently lost. */
138
- export declare function closeCommand(deps: CommandDeps, requestId: string | undefined, flags?: {
139
- json?: boolean;
140
- pending?: boolean;
141
- }): Promise<number>;
142
- export interface HooksInstallFlags {
143
- harness?: string;
144
- global?: boolean;
145
- /** Init owns the final setup result and suppresses per-harness close narration. */
146
- narrate?: boolean;
147
- /** Test seam; production resolves the running CLI. */
148
- execPath?: string;
149
- scriptPath?: string;
150
- }
151
- /** True when this process is `npx` / `npm exec`, not a global or linked install. */
152
- export declare function runningViaNpx(env: NodeJS.ProcessEnv, scriptPath: string): boolean;
153
- export declare function hooksInstallCommand(deps: CommandDeps, flags: HooksInstallFlags): number;
154
- export declare function hooksUninstallCommand(deps: CommandDeps, flags: HooksInstallFlags): number;
155
- /**
156
- * Which harnesses to wire. An explicit `--harness` still wins as a singleton.
157
- * Otherwise: every detected harness, or a human picker when detection is empty
158
- * or names more than one.
159
- */
160
- export declare function pickHarnessesToInstall(deps: CommandDeps, requested?: string): Promise<HookInstallableHarness[] | null>;