@indianic/dialout 1.12.0 → 1.13.0

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 (53) hide show
  1. package/README.md +4 -3
  2. package/dist/agent-restart.d.ts +46 -0
  3. package/dist/agent-restart.d.ts.map +1 -0
  4. package/dist/agent-restart.js +254 -0
  5. package/dist/agent-restart.js.map +1 -0
  6. package/dist/ai-sessions.d.ts +19 -0
  7. package/dist/ai-sessions.d.ts.map +1 -1
  8. package/dist/ai-sessions.js +25 -3
  9. package/dist/ai-sessions.js.map +1 -1
  10. package/dist/checklist.js +1 -1
  11. package/dist/checklist.js.map +1 -1
  12. package/dist/cli-client.d.ts +8 -0
  13. package/dist/cli-client.d.ts.map +1 -1
  14. package/dist/cli-client.js +33 -0
  15. package/dist/cli-client.js.map +1 -1
  16. package/dist/cli.js +106 -82
  17. package/dist/cli.js.map +1 -1
  18. package/dist/cowork.js +1 -1
  19. package/dist/has-command.d.ts +13 -0
  20. package/dist/has-command.d.ts.map +1 -1
  21. package/dist/has-command.js +92 -0
  22. package/dist/has-command.js.map +1 -1
  23. package/dist/ssh-local-network.js +1 -1
  24. package/dist/update-check.d.ts +9 -1
  25. package/dist/update-check.d.ts.map +1 -1
  26. package/dist/update-check.js +46 -14
  27. package/dist/update-check.js.map +1 -1
  28. package/node_modules/@indianic/dialout-shared/dist/index.d.ts +3 -1
  29. package/node_modules/@indianic/dialout-shared/dist/index.d.ts.map +1 -1
  30. package/node_modules/@indianic/dialout-shared/dist/index.js +22 -2
  31. package/node_modules/@indianic/dialout-shared/dist/notify-template.d.ts +129 -0
  32. package/node_modules/@indianic/dialout-shared/dist/notify-template.d.ts.map +1 -0
  33. package/node_modules/@indianic/dialout-shared/dist/notify-template.js +302 -0
  34. package/node_modules/@indianic/dialout-shared/dist/notify-template.test.d.ts +2 -0
  35. package/node_modules/@indianic/dialout-shared/dist/notify-template.test.d.ts.map +1 -0
  36. package/node_modules/@indianic/dialout-shared/dist/notify-template.test.js +285 -0
  37. package/node_modules/@indianic/dialout-shared/dist/notify.d.ts +9 -0
  38. package/node_modules/@indianic/dialout-shared/dist/notify.d.ts.map +1 -1
  39. package/node_modules/@indianic/dialout-shared/dist/notify.js +27 -0
  40. package/node_modules/@indianic/dialout-shared/dist/session-announce.d.ts +20 -0
  41. package/node_modules/@indianic/dialout-shared/dist/session-announce.d.ts.map +1 -0
  42. package/node_modules/@indianic/dialout-shared/dist/session-announce.js +20 -0
  43. package/node_modules/@indianic/dialout-shared/dist/session-announce.test.d.ts +2 -0
  44. package/node_modules/@indianic/dialout-shared/dist/session-announce.test.d.ts.map +1 -0
  45. package/node_modules/@indianic/dialout-shared/dist/session-announce.test.js +30 -0
  46. package/node_modules/@indianic/dialout-shared/src/index.ts +37 -1
  47. package/node_modules/@indianic/dialout-shared/src/notify-template.test.ts +352 -0
  48. package/node_modules/@indianic/dialout-shared/src/notify-template.ts +319 -0
  49. package/node_modules/@indianic/dialout-shared/src/notify.ts +51 -0
  50. package/node_modules/@indianic/dialout-shared/src/session-announce.test.ts +48 -0
  51. package/node_modules/@indianic/dialout-shared/src/session-announce.ts +40 -0
  52. package/package.json +1 -1
  53. package/scripts/postinstall.js +8 -9
package/dist/cowork.js CHANGED
@@ -251,7 +251,7 @@ function renderCoworkBlock(tokens, attachMode = 'auto') {
251
251
  const gate = indent(renderMatchGate(tokens), ' ');
252
252
  const body = indent(wrapBody(attachMode), ' ');
253
253
  return `${exports.COWORK_BEGIN}
254
- # Managed by "dialout setup-cowork" — do not edit inside the markers.
254
+ # Managed by "dialout remote-control" — do not edit inside the markers.
255
255
  case $- in
256
256
  *i*)
257
257
  if [ -z "$TMUX" ] && [ -z "$DEVDASH_NO_WRAP" ] && [ -z "$SSH_TTY" ] && [ -t 1 ] \\
@@ -9,4 +9,17 @@
9
9
  * shell syntax either.
10
10
  */
11
11
  export declare function hasCommand(bin: string): boolean;
12
+ export declare const COMMAND_FALLBACK_DIRS: string[];
13
+ /**
14
+ * Absolute path to `bin` if it exists on PATH or in COMMAND_FALLBACK_DIRS.
15
+ * Never throws. `bin` is joined as a path segment, never interpolated into a
16
+ * shell command.
17
+ */
18
+ export declare function resolveCommand(bin: string, envPath?: string, existsSync?: (p: string) => boolean): string | null;
19
+ /** Prepend `dir` to `process.env.PATH` when it is not already present. */
20
+ export declare function ensureOnPath(dir: string, env?: NodeJS.ProcessEnv): void;
21
+ export declare function shellRcReloadHint(shell?: string): {
22
+ rcFile: string;
23
+ command: string;
24
+ };
12
25
  //# sourceMappingURL=has-command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"has-command.d.ts","sourceRoot":"","sources":["../src/has-command.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAO/C"}
1
+ {"version":3,"file":"has-command.d.ts","sourceRoot":"","sources":["../src/has-command.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAO/C;AAKD,eAAO,MAAM,qBAAqB,UAKjC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,MAA+B,EACxC,UAAU,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAiC,GAC3D,MAAM,GAAG,IAAI,CAiBf;AAED,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,IAAI,CAKpF;AAED,wBAAgB,iBAAiB,CAAC,KAAK,GAAE,MAAgC,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAQ9G"}
@@ -1,7 +1,46 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.COMMAND_FALLBACK_DIRS = void 0;
3
37
  exports.hasCommand = hasCommand;
38
+ exports.resolveCommand = resolveCommand;
39
+ exports.ensureOnPath = ensureOnPath;
40
+ exports.shellRcReloadHint = shellRcReloadHint;
4
41
  const child_process_1 = require("child_process");
42
+ const fs = __importStar(require("fs"));
43
+ const path = __importStar(require("path"));
5
44
  /**
6
45
  * True when `bin` resolves on PATH. Never throws.
7
46
  *
@@ -21,4 +60,57 @@ function hasCommand(bin) {
21
60
  return false;
22
61
  }
23
62
  }
63
+ // Homebrew (Apple Silicon then Intel), then the FHS locations a package
64
+ // manager writes to. Used when this process's PATH still predates an install
65
+ // that just succeeded in the same session (brew/apt update the *next* shell).
66
+ exports.COMMAND_FALLBACK_DIRS = [
67
+ '/opt/homebrew/bin',
68
+ '/usr/local/bin',
69
+ '/usr/bin',
70
+ '/bin',
71
+ ];
72
+ /**
73
+ * Absolute path to `bin` if it exists on PATH or in COMMAND_FALLBACK_DIRS.
74
+ * Never throws. `bin` is joined as a path segment, never interpolated into a
75
+ * shell command.
76
+ */
77
+ function resolveCommand(bin, envPath = process.env.PATH || '', existsSync = (p) => fs.existsSync(p)) {
78
+ if (!bin || bin.includes('/') || bin.includes('\\') || bin === '..' || bin === '.') {
79
+ return null;
80
+ }
81
+ const dirs = [...envPath.split(path.delimiter).filter(Boolean), ...exports.COMMAND_FALLBACK_DIRS];
82
+ const seen = new Set();
83
+ for (const dir of dirs) {
84
+ if (seen.has(dir))
85
+ continue;
86
+ seen.add(dir);
87
+ const candidate = path.join(dir, bin);
88
+ try {
89
+ if (existsSync(candidate))
90
+ return candidate;
91
+ }
92
+ catch {
93
+ // Permission on a PATH entry must not abort the search.
94
+ }
95
+ }
96
+ return null;
97
+ }
98
+ /** Prepend `dir` to `process.env.PATH` when it is not already present. */
99
+ function ensureOnPath(dir, env = process.env) {
100
+ if (!dir)
101
+ return;
102
+ const parts = (env.PATH || '').split(path.delimiter).filter(Boolean);
103
+ if (parts.includes(dir))
104
+ return;
105
+ env.PATH = [dir, ...parts].join(path.delimiter);
106
+ }
107
+ function shellRcReloadHint(shell = process.env.SHELL || '') {
108
+ if (/fish/.test(shell)) {
109
+ return { rcFile: '~/.config/fish/config.fish', command: 'source ~/.config/fish/config.fish' };
110
+ }
111
+ if (/bash/.test(shell)) {
112
+ return { rcFile: '~/.bashrc', command: 'source ~/.bashrc' };
113
+ }
114
+ return { rcFile: '~/.zshrc', command: 'source ~/.zshrc' };
115
+ }
24
116
  //# sourceMappingURL=has-command.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"has-command.js","sourceRoot":"","sources":["../src/has-command.ts"],"names":[],"mappings":";;AAYA,gCAOC;AAnBD,iDAA6C;AA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,IAAI,EAAE;IACvE,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,MAAM,EAAE,4BAA4B,EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC;IAChG,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9D,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC5D,CAAC"}
@@ -108,7 +108,7 @@ function renderSshLocalNetworkBlock(timeoutSeconds = exports.DEFAULT_CONNECT_TIM
108
108
  # ConnectTimeout selects ssh's legacy BSD-socket connect, which is not gated.
109
109
  # The real cure is to allow tmux under System Settings > Privacy & Security >
110
110
  # Local Network. Removed by "dialout uninstall-service" and
111
- # "dialout setup-cowork --remove", or delete the block by hand.
111
+ # "dialout rc --remove", or delete the block by hand.
112
112
  Host *
113
113
  ConnectTimeout ${secs}
114
114
  ${exports.SSH_LN_END}`;
@@ -1,3 +1,11 @@
1
1
  export declare function checkForUpdate(): Promise<void>;
2
- export declare function performUpdate(): Promise<void>;
2
+ export interface PerformUpdateOpts {
3
+ yes?: boolean;
4
+ sudoPassword?: string;
5
+ }
6
+ export interface PerformUpdateDeps {
7
+ ask?: (q: string) => Promise<string>;
8
+ isTty?: () => boolean;
9
+ }
10
+ export declare function performUpdate(opts?: PerformUpdateOpts, deps?: PerformUpdateDeps): Promise<void>;
3
11
  //# sourceMappingURL=update-check.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-check.d.ts","sourceRoot":"","sources":["../src/update-check.ts"],"names":[],"mappings":"AA8EA,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAkBpD;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CA6EnD"}
1
+ {"version":3,"file":"update-check.d.ts","sourceRoot":"","sources":["../src/update-check.ts"],"names":[],"mappings":"AA8EA,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAkBpD;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,OAAO,CAAC;CACvB;AAaD,wBAAsB,aAAa,CACjC,IAAI,GAAE,iBAAsB,EAC5B,IAAI,GAAE,iBAAsB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAsGf"}
@@ -123,12 +123,22 @@ async function checkForUpdate() {
123
123
  console.log(`${YELLOW}╔══════════════════════════════════════════════════════════╗${NC}`);
124
124
  console.log(`${YELLOW}║${NC} ${BOLD}Update available!${NC} ${current} → ${GREEN}${latest}${NC} ${YELLOW}║${NC}`);
125
125
  console.log(`${YELLOW}║${NC} ${YELLOW}║${NC}`);
126
- console.log(`${YELLOW}║${NC} Run: ${CYAN}dialout update${NC} ${YELLOW}║${NC}`);
126
+ console.log(`${YELLOW}║${NC} Run: ${CYAN}dialout update${NC} or ${CYAN}upgrade${NC} ${YELLOW}║${NC}`);
127
127
  console.log(`${YELLOW}╚══════════════════════════════════════════════════════════╝${NC}`);
128
128
  console.log('');
129
129
  }
130
130
  }
131
- async function performUpdate() {
131
+ async function defaultAsk(q) {
132
+ const readline = await Promise.resolve().then(() => __importStar(require('readline')));
133
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
134
+ return new Promise((resolve) => {
135
+ rl.question(q, (ans) => {
136
+ rl.close();
137
+ resolve(ans);
138
+ });
139
+ });
140
+ }
141
+ async function performUpdate(opts = {}, deps = {}) {
132
142
  const current = getLocalVersion();
133
143
  const latest = await getLatestVersion();
134
144
  console.log('');
@@ -176,22 +186,44 @@ async function performUpdate() {
176
186
  // with nothing to show the self-heal never actually landed.
177
187
  console.error(` (watchdog repair skipped: ${e.message})`);
178
188
  }
179
- // Check if running as service or cron — suggest restart
180
- try {
181
- const { isServiceInstalled, isCronInstalled } = require('./service-installer');
182
- if (isServiceInstalled()) {
183
- console.log(` ${YELLOW}Service detected — restart to use new version:${NC}`);
184
- console.log(` dialout uninstall-service`);
185
- console.log(` dialout install-service`);
186
- console.log('');
189
+ // Pick up the new binary through the same path as `dialout restart`.
190
+ // Uninstall+install-service is the wrong advice: that rewrites the unit
191
+ // file and is how an upgrade silently left the old process running.
192
+ const { agentIsSupervised, restartRunningAgent, resolveSudoPassword } = require('./agent-restart');
193
+ if (!agentIsSupervised()) {
194
+ console.log(` ${YELLOW}Nothing is running yet.${NC} Start with:`);
195
+ console.log(' dialout start --daemon');
196
+ console.log(' dialout install-service');
197
+ console.log('');
198
+ return;
199
+ }
200
+ const isTty = deps.isTty ?? (() => Boolean(process.stdin.isTTY && process.stdout.isTTY));
201
+ let go = opts.yes === true;
202
+ if (!go) {
203
+ if (isTty()) {
204
+ const ask = deps.ask ?? defaultAsk;
205
+ const ans = (await ask('Restart the agent now so the new version takes effect? [Y/n]: ')).trim().toLowerCase();
206
+ go = ans === '' || ans === 'y' || ans === 'yes';
187
207
  }
188
- else if (isCronInstalled()) {
189
- console.log(` ${YELLOW}Cron watchdog will auto-restart with new version.${NC}`);
190
- console.log(` Or restart now: dialout stop && dialout start --daemon`);
208
+ else {
209
+ console.log(` ${YELLOW}Restart skipped (not a TTY).${NC} Run: dialout restart`);
191
210
  console.log('');
211
+ return;
192
212
  }
193
213
  }
194
- catch { }
214
+ if (!go) {
215
+ console.log(` ${YELLOW}Restart skipped.${NC} Run: dialout restart`);
216
+ console.log('');
217
+ return;
218
+ }
219
+ const result = await restartRunningAgent({
220
+ sudoPassword: resolveSudoPassword(opts.sudoPassword),
221
+ });
222
+ console.log(` ${result.ok ? GREEN : YELLOW}${result.message}${NC}`);
223
+ console.log('');
224
+ if (!result.ok) {
225
+ process.exitCode = 1;
226
+ }
195
227
  }
196
228
  catch (err) {
197
229
  console.error(` ${YELLOW}Update failed: ${err.message}${NC}`);
@@ -1 +1 @@
1
- {"version":3,"file":"update-check.js","sourceRoot":"","sources":["../src/update-check.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EA,wCAkBC;AAED,sCA6EC;AA/KD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,iDAAyC;AACzC,qCAAwC;AAExC,0EAA0E;AAC1E,0EAA0E;AAC1E,4CAA4C;AAC5C,MAAM,QAAQ,GAAG,4BAA4B,CAAC;AAC9C,wEAAwE;AACxE,2EAA2E;AAC3E,4BAA4B;AAC5B,MAAM,YAAY,GAAG,mBAAmB,CAAC;AACzC,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,UAAU;AAExD,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,MAAM,GAAG,UAAU,CAAC;AAC1B,MAAM,IAAI,GAAG,UAAU,CAAC;AACxB,MAAM,IAAI,GAAG,SAAS,CAAC;AACvB,MAAM,EAAE,GAAG,SAAS,CAAC;AAErB,SAAS,eAAe;IACtB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,CACrE,CAAC;QACF,OAAO,GAAG,CAAC,OAAO,CAAC;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,gBAAgB;IAC7B,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,GAAG,QAAQ,IAAI,YAAY,EAAE,EAAE;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CAAC;YACrE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAChB,OAAO;QACT,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC;YACvC,YAAY,EAAE,mBAAmB,CAAC,IAAI,CAAC,YAAY,CAAC;SACrD,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,GAAG,EAAE,EAAE,CAAC,CAAC;QACrE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,KAAK,MAAM,kBAAkB,GAAG,CAAC,OAAO,GAAG,EAAE,EAAE,CAAC,CAAC;QAC/D,OAAO,CAAC,KAAK,CAAC,kCAAkC,YAAY,EAAE,CAAC,CAAC;QAChE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -7,7 +7,8 @@ export type { AiSessionSummary } from './session';
7
7
  export type { AiUsage, AiRateWindow } from './usage';
8
8
  export { REPLAY_LIMIT } from './session';
9
9
  export type { CommandSource, AiCommand, McpServerInfo, AiCapabilities } from './capabilities';
10
- export { NOTIFY_COOLDOWN_MS, shouldNotifyAi, shouldNotifyPrompt } from './notify';
10
+ export { NOTIFY_COOLDOWN_MS, shouldNotifyAi, shouldNotifyPrompt, shouldNotifyNewTerminal, shouldNotifyNewAiSession, type PushPrefs, } from './notify';
11
+ export { shouldAnnounceSession, type PriorSession, } from './session-announce';
11
12
  export type { ToolItem, ChatBlock } from './chat-blocks';
12
13
  export { groupEvents, toolGroupStartsOpen } from './chat-blocks';
13
14
  export type { MessageNotice, NoticeKind, ReadMessage } from './notices';
@@ -32,4 +33,5 @@ export type { PanePrompt, PanePromptOption, PromptKey } from './pane-prompt';
32
33
  export { PROMPT_KEYS, detectPanePrompt, freeTextRow, isFreeTextOption, isSafeKeyList, promptKeys, promptMoveKeys } from './pane-prompt';
33
34
  export type { AttachmentRef } from './attachments';
34
35
  export { ATTACHMENT_DIR, ATTACHMENT_MAX_BYTES, ATTACHMENT_MAX_FILES, composeWithAttachments, isImageName, safeAttachmentName, splitAttachments, } from './attachments';
36
+ export { NOTIFICATION_TYPES, ACTION_KINDS, TEMPLATE_VARIABLES, DEFAULT_TEMPLATES, TITLE_MAX, BODY_MAX, MAX_ACTIONS, categoryId, renderNotification, parseActions, parseTemplatePatch, isNotificationType, shouldSendNotification, folderLabel, isSendable, type NotificationType, type ActionKind, type NotificationAction, type NotificationTemplate, type TemplateVars, type TemplatePatch, } from './notify-template';
35
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAElD,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAElE,YAAY,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE9F,OAAO,EAA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AE,eAAe,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE9D,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC7D,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAExI,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EACL,cAAc,EAAE,oBAAoB,EAAE,oBAAoB,EAC1D,sBAAsB,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,GAC1E,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACR,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ATTACHMENT_MAX_BYTES = exports.ATTACHMENT_DIR = exports.promptMoveKeys = exports.promptKeys = exports.isSafeKeyList = exports.isFreeTextOption = exports.freeTextRow = exports.detectPanePrompt = exports.PROMPT_KEYS = exports.thinkingLabel = exports.thinkingDuration = exports.parseCapturePage = exports.MAX_CAPTURE_PAGE = exports.EMPTY_CAPTURE = exports.mergeEvents = exports.EMPTY_TRANSCRIPT = exports.resolveTmuxPrefs = exports.isValidTmuxColor = exports.isValidStatusTemplate = exports.compileStatusTemplate = exports.MAX_STATUS_TEMPLATE = exports.STATUS_TOKENS = exports.DEFAULT_TMUX_PREFS = exports.renderTerminalName = exports.factsFromSession = exports.TERMINAL_NAME_TOKENS = exports.DEFAULT_TERMINAL_TEMPLATE = exports.setFunctionKeysVisible = exports.getFunctionKeysVisible = exports.FUNCTION_KEYS_PREF = exports.shouldSubmitOnEnter = exports.COARSE_POINTER_QUERY = exports.rankCommands = exports.commandQuery = exports.toolAppearance = exports.toolClass = exports.shouldFollow = exports.PIN_THRESHOLD_PX = exports.readUserMessage = exports.dedent = exports.toolGroupStartsOpen = exports.groupEvents = exports.shouldNotifyPrompt = exports.shouldNotifyAi = exports.NOTIFY_COOLDOWN_MS = exports.REPLAY_LIMIT = exports.isPermissionMode = exports.PERMISSION_MODES = exports.preview = exports.PREVIEW_LIMIT = void 0;
4
- exports.splitAttachments = exports.safeAttachmentName = exports.isImageName = exports.composeWithAttachments = exports.ATTACHMENT_MAX_FILES = void 0;
3
+ exports.promptKeys = exports.isSafeKeyList = exports.isFreeTextOption = exports.freeTextRow = exports.detectPanePrompt = exports.PROMPT_KEYS = exports.thinkingLabel = exports.thinkingDuration = exports.parseCapturePage = exports.MAX_CAPTURE_PAGE = exports.EMPTY_CAPTURE = exports.mergeEvents = exports.EMPTY_TRANSCRIPT = exports.resolveTmuxPrefs = exports.isValidTmuxColor = exports.isValidStatusTemplate = exports.compileStatusTemplate = exports.MAX_STATUS_TEMPLATE = exports.STATUS_TOKENS = exports.DEFAULT_TMUX_PREFS = exports.renderTerminalName = exports.factsFromSession = exports.TERMINAL_NAME_TOKENS = exports.DEFAULT_TERMINAL_TEMPLATE = exports.setFunctionKeysVisible = exports.getFunctionKeysVisible = exports.FUNCTION_KEYS_PREF = exports.shouldSubmitOnEnter = exports.COARSE_POINTER_QUERY = exports.rankCommands = exports.commandQuery = exports.toolAppearance = exports.toolClass = exports.shouldFollow = exports.PIN_THRESHOLD_PX = exports.readUserMessage = exports.dedent = exports.toolGroupStartsOpen = exports.groupEvents = exports.shouldAnnounceSession = exports.shouldNotifyNewAiSession = exports.shouldNotifyNewTerminal = exports.shouldNotifyPrompt = exports.shouldNotifyAi = exports.NOTIFY_COOLDOWN_MS = exports.REPLAY_LIMIT = exports.isPermissionMode = exports.PERMISSION_MODES = exports.preview = exports.PREVIEW_LIMIT = void 0;
4
+ exports.isSendable = exports.folderLabel = exports.shouldSendNotification = exports.isNotificationType = exports.parseTemplatePatch = exports.parseActions = exports.renderNotification = exports.categoryId = exports.MAX_ACTIONS = exports.BODY_MAX = exports.TITLE_MAX = exports.DEFAULT_TEMPLATES = exports.TEMPLATE_VARIABLES = exports.ACTION_KINDS = exports.NOTIFICATION_TYPES = exports.splitAttachments = exports.safeAttachmentName = exports.isImageName = exports.composeWithAttachments = exports.ATTACHMENT_MAX_FILES = exports.ATTACHMENT_MAX_BYTES = exports.ATTACHMENT_DIR = exports.promptMoveKeys = void 0;
5
5
  var events_1 = require("./events");
6
6
  Object.defineProperty(exports, "PREVIEW_LIMIT", { enumerable: true, get: function () { return events_1.PREVIEW_LIMIT; } });
7
7
  Object.defineProperty(exports, "preview", { enumerable: true, get: function () { return events_1.preview; } });
@@ -14,6 +14,10 @@ var notify_1 = require("./notify");
14
14
  Object.defineProperty(exports, "NOTIFY_COOLDOWN_MS", { enumerable: true, get: function () { return notify_1.NOTIFY_COOLDOWN_MS; } });
15
15
  Object.defineProperty(exports, "shouldNotifyAi", { enumerable: true, get: function () { return notify_1.shouldNotifyAi; } });
16
16
  Object.defineProperty(exports, "shouldNotifyPrompt", { enumerable: true, get: function () { return notify_1.shouldNotifyPrompt; } });
17
+ Object.defineProperty(exports, "shouldNotifyNewTerminal", { enumerable: true, get: function () { return notify_1.shouldNotifyNewTerminal; } });
18
+ Object.defineProperty(exports, "shouldNotifyNewAiSession", { enumerable: true, get: function () { return notify_1.shouldNotifyNewAiSession; } });
19
+ var session_announce_1 = require("./session-announce");
20
+ Object.defineProperty(exports, "shouldAnnounceSession", { enumerable: true, get: function () { return session_announce_1.shouldAnnounceSession; } });
17
21
  var chat_blocks_1 = require("./chat-blocks");
18
22
  Object.defineProperty(exports, "groupEvents", { enumerable: true, get: function () { return chat_blocks_1.groupEvents; } });
19
23
  Object.defineProperty(exports, "toolGroupStartsOpen", { enumerable: true, get: function () { return chat_blocks_1.toolGroupStartsOpen; } });
@@ -75,3 +79,19 @@ Object.defineProperty(exports, "composeWithAttachments", { enumerable: true, get
75
79
  Object.defineProperty(exports, "isImageName", { enumerable: true, get: function () { return attachments_1.isImageName; } });
76
80
  Object.defineProperty(exports, "safeAttachmentName", { enumerable: true, get: function () { return attachments_1.safeAttachmentName; } });
77
81
  Object.defineProperty(exports, "splitAttachments", { enumerable: true, get: function () { return attachments_1.splitAttachments; } });
82
+ var notify_template_1 = require("./notify-template");
83
+ Object.defineProperty(exports, "NOTIFICATION_TYPES", { enumerable: true, get: function () { return notify_template_1.NOTIFICATION_TYPES; } });
84
+ Object.defineProperty(exports, "ACTION_KINDS", { enumerable: true, get: function () { return notify_template_1.ACTION_KINDS; } });
85
+ Object.defineProperty(exports, "TEMPLATE_VARIABLES", { enumerable: true, get: function () { return notify_template_1.TEMPLATE_VARIABLES; } });
86
+ Object.defineProperty(exports, "DEFAULT_TEMPLATES", { enumerable: true, get: function () { return notify_template_1.DEFAULT_TEMPLATES; } });
87
+ Object.defineProperty(exports, "TITLE_MAX", { enumerable: true, get: function () { return notify_template_1.TITLE_MAX; } });
88
+ Object.defineProperty(exports, "BODY_MAX", { enumerable: true, get: function () { return notify_template_1.BODY_MAX; } });
89
+ Object.defineProperty(exports, "MAX_ACTIONS", { enumerable: true, get: function () { return notify_template_1.MAX_ACTIONS; } });
90
+ Object.defineProperty(exports, "categoryId", { enumerable: true, get: function () { return notify_template_1.categoryId; } });
91
+ Object.defineProperty(exports, "renderNotification", { enumerable: true, get: function () { return notify_template_1.renderNotification; } });
92
+ Object.defineProperty(exports, "parseActions", { enumerable: true, get: function () { return notify_template_1.parseActions; } });
93
+ Object.defineProperty(exports, "parseTemplatePatch", { enumerable: true, get: function () { return notify_template_1.parseTemplatePatch; } });
94
+ Object.defineProperty(exports, "isNotificationType", { enumerable: true, get: function () { return notify_template_1.isNotificationType; } });
95
+ Object.defineProperty(exports, "shouldSendNotification", { enumerable: true, get: function () { return notify_template_1.shouldSendNotification; } });
96
+ Object.defineProperty(exports, "folderLabel", { enumerable: true, get: function () { return notify_template_1.folderLabel; } });
97
+ Object.defineProperty(exports, "isSendable", { enumerable: true, get: function () { return notify_template_1.isSendable; } });
@@ -0,0 +1,129 @@
1
+ /**
2
+ * What an automatic notification says, and the buttons it carries.
3
+ *
4
+ * Pure, and here rather than in the ws-server for the same reason the
5
+ * shouldNotify* family is: src/ws-server/index.ts is one deliberately large
6
+ * file with no unit seams, so decision and rendering logic added inline there
7
+ * would be untestable. The ws-server stays the only side-effecting caller.
8
+ */
9
+ export declare const NOTIFICATION_TYPES: readonly ["ai_question", "new_terminal", "new_ai_session", "announcement"];
10
+ export type NotificationType = (typeof NOTIFICATION_TYPES)[number];
11
+ /** A closed set, so a configured button cannot ask for behaviour the app lacks. */
12
+ export declare const ACTION_KINDS: readonly ["open", "reply"];
13
+ export type ActionKind = (typeof ACTION_KINDS)[number];
14
+ export interface NotificationAction {
15
+ id: string;
16
+ label: string;
17
+ kind: ActionKind;
18
+ }
19
+ export interface NotificationTemplate {
20
+ type: NotificationType;
21
+ enabled: boolean;
22
+ title: string;
23
+ body: string;
24
+ actions: NotificationAction[];
25
+ }
26
+ /** Matches src/app/api/push/broadcast/route.ts, and both platforms truncate anyway. */
27
+ export declare const TITLE_MAX = 80;
28
+ export declare const BODY_MAX = 240;
29
+ /** iOS shows four actions on an expanded notification. */
30
+ export declare const MAX_ACTIONS = 4;
31
+ /**
32
+ * Which variables each type can supply. Per type, not global, because they are
33
+ * not interchangeable: {question} exists for an agent question and not for a
34
+ * new terminal, and offering it everywhere would produce templates that render
35
+ * a gap on every send.
36
+ */
37
+ export declare const TEMPLATE_VARIABLES: Record<NotificationType, string[]>;
38
+ /**
39
+ * Today's hardcoded wording, so shipping the feature changes nothing about
40
+ * what anyone receives. Mirrored in scripts/apply-notification-templates.mjs,
41
+ * which cannot import the built package — a drift between the two is a visible
42
+ * difference in a notification rather than a silent failure.
43
+ */
44
+ export declare const DEFAULT_TEMPLATES: Record<NotificationType, Omit<NotificationTemplate, 'type'>>;
45
+ /**
46
+ * The notification category a type registers under.
47
+ *
48
+ * Expo SDK 57's setNotificationCategoryAsync documents that an identifier may
49
+ * contain no `:` or `-`, and the failure is silent — the notification arrives
50
+ * with no buttons and nothing logs why. Stripping both from the type name
51
+ * makes `ai_question` land on exactly `aiquestion`, which is the string
52
+ * AI_CATEGORY already holds and the ws-server already sends, so notifications
53
+ * in flight during a deploy keep their Reply button.
54
+ */
55
+ export declare function categoryId(type: NotificationType): string;
56
+ /**
57
+ * The folder a notification should name, or `fallback` when there is none.
58
+ *
59
+ * Lives in the sender's vars rather than in the renderer on purpose. The
60
+ * renderer's rule for an empty variable is "render nothing and take the
61
+ * neighbouring separator with it", which cannot mend an English word stranded
62
+ * between two spaces ("agent in on Mac"). Only the sender knows what a sensible
63
+ * stand-in is for its type (a tmux name for a terminal, the word "session" for
64
+ * an agent), so every sender goes through this one function and none passes a
65
+ * raw nullable folder.
66
+ */
67
+ export declare function folderLabel(folder: string | null | undefined, fallback: string): string;
68
+ /**
69
+ * Whether a rendered notification is worth sending. A title alone or a body
70
+ * alone is a legitimate choice (an admin can clear either field), but with
71
+ * neither there is nothing to show: a blank banner is noise, so the sender
72
+ * skips it instead of discovering the case on a lock screen.
73
+ */
74
+ export declare function isSendable(rendered: {
75
+ title: string;
76
+ body: string;
77
+ }): boolean;
78
+ export type TemplateVars = Record<string, string | null | undefined>;
79
+ /**
80
+ * Renders a template's title and body.
81
+ *
82
+ * Never throws: it is called on the ws-server's notify path, where an
83
+ * exception would break the registry upsert chain whose ordering other
84
+ * sessions depend on.
85
+ *
86
+ * `vars.at` is an ISO timestamp used for {time} and {date}; every other key is
87
+ * substituted literally. An unknown or empty variable renders as nothing and
88
+ * takes any separator stranded beside it with it.
89
+ */
90
+ export declare function renderNotification(template: {
91
+ title: string;
92
+ body: string;
93
+ }, rawVars: TemplateVars, timezone: string): {
94
+ title: string;
95
+ body: string;
96
+ };
97
+ /** Normalises whatever the jsonb column or a request body hands over. */
98
+ export declare function parseActions(raw: unknown): NotificationAction[];
99
+ export type TemplatePatch = Partial<Pick<NotificationTemplate, 'enabled' | 'title' | 'body' | 'actions'>>;
100
+ export type TemplateParseResult = {
101
+ ok: true;
102
+ patch: TemplatePatch;
103
+ } | {
104
+ ok: false;
105
+ error: string;
106
+ };
107
+ /**
108
+ * Validates an edit. Text is capped rather than rejected: a long title is the
109
+ * author's problem to see in the preview, not a reason to refuse the save.
110
+ */
111
+ export declare function parseTemplatePatch(body: unknown): TemplateParseResult;
112
+ export declare function isNotificationType(t: string): t is NotificationType;
113
+ /**
114
+ * Whether this notification reaches this device. Both gates must say yes.
115
+ *
116
+ * `enabled` is the admin's instance-wide switch from notification_templates;
117
+ * `userOptedIn` is the recipient's own per-device switch from user_settings.
118
+ * Admin-off means nobody receives the type; user-off means that one device
119
+ * does not.
120
+ *
121
+ * The per-device opt-out is kept deliberately rather than replaced by the
122
+ * admin switch: App Store guideline 4.5.4 and Play policy both require
123
+ * announcement push to be refusable, and removing it risks a rejection.
124
+ *
125
+ * Trivial on purpose. It exists so the rule has one name and one test instead
126
+ * of being spelled out at each of the three senders.
127
+ */
128
+ export declare function shouldSendNotification(enabled: boolean, userOptedIn: boolean): boolean;
129
+ //# sourceMappingURL=notify-template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notify-template.d.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