@automagik/omni 2.260409.6 → 2.260421.3

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/db/drizzle/0018_supreme_puma.sql +6 -0
  2. package/db/drizzle/0019_idle_chat_follow_up.sql +23 -0
  3. package/db/drizzle/0020_follow_up_config.sql +2 -0
  4. package/db/drizzle/0021_idle_follow_up_seed.sql +51 -0
  5. package/db/drizzle/0022_idle_follow_up_prompt_v2.sql +34 -0
  6. package/db/drizzle/0023_dispatcher_inbound_age.sql +8 -0
  7. package/db/drizzle/0024_quiet_gabe_jones.sql +23 -0
  8. package/db/drizzle/0025_panoramic_sinister_six.sql +5 -0
  9. package/db/drizzle/0026_agent_key_profiles.sql +19 -0
  10. package/db/drizzle/0027_bridge_tmux_session.sql +13 -0
  11. package/db/drizzle/meta/{0014_snapshot.json → 0018_snapshot.json} +678 -430
  12. package/db/drizzle/meta/{0013_snapshot.json → 0019_snapshot.json} +919 -445
  13. package/db/drizzle/meta/0020_snapshot.json +7240 -0
  14. package/db/drizzle/meta/0021_snapshot.json +7240 -0
  15. package/db/drizzle/meta/0024_snapshot.json +7240 -0
  16. package/db/drizzle/meta/0025_snapshot.json +7240 -0
  17. package/db/drizzle/meta/0026_snapshot.json +7274 -0
  18. package/db/drizzle/meta/_journal.json +70 -0
  19. package/dist/__tests__/mock-api.d.ts +24 -0
  20. package/dist/__tests__/mock-api.d.ts.map +1 -1
  21. package/dist/commands/agents.d.ts +2 -0
  22. package/dist/commands/agents.d.ts.map +1 -1
  23. package/dist/commands/doctor.d.ts +24 -15
  24. package/dist/commands/doctor.d.ts.map +1 -1
  25. package/dist/commands/events.d.ts +25 -0
  26. package/dist/commands/events.d.ts.map +1 -1
  27. package/dist/commands/follow-up.d.ts +13 -0
  28. package/dist/commands/follow-up.d.ts.map +1 -0
  29. package/dist/commands/install.d.ts +28 -29
  30. package/dist/commands/install.d.ts.map +1 -1
  31. package/dist/commands/instances.d.ts.map +1 -1
  32. package/dist/commands/keys.d.ts +43 -0
  33. package/dist/commands/keys.d.ts.map +1 -1
  34. package/dist/commands/start.d.ts.map +1 -1
  35. package/dist/commands/update.d.ts +12 -0
  36. package/dist/commands/update.d.ts.map +1 -1
  37. package/dist/commands/voice.d.ts +11 -0
  38. package/dist/commands/voice.d.ts.map +1 -0
  39. package/dist/config.d.ts +1 -1
  40. package/dist/config.d.ts.map +1 -1
  41. package/dist/index.js +94536 -65466
  42. package/dist/install-helpers.d.ts +32 -0
  43. package/dist/install-helpers.d.ts.map +1 -0
  44. package/dist/nats-install.d.ts +11 -0
  45. package/dist/nats-install.d.ts.map +1 -0
  46. package/dist/output.d.ts +14 -5
  47. package/dist/output.d.ts.map +1 -1
  48. package/dist/pm2.d.ts +46 -0
  49. package/dist/pm2.d.ts.map +1 -1
  50. package/dist/server/davey.linux-x64-gnu-vevevdy2.node +0 -0
  51. package/dist/server/davey.linux-x64-musl-3vkb94zg.node +0 -0
  52. package/dist/server/index.js +97148 -13518
  53. package/package.json +10 -10
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Install Helpers
3
+ *
4
+ * Extracted from commands/install.ts to keep the main command a thin wiring
5
+ * layer. Each helper is independently testable.
6
+ */
7
+ export interface ReinstallSignals {
8
+ isReinstall: boolean;
9
+ hasConfig: boolean;
10
+ hasPm2Process: boolean;
11
+ hasDataDir: boolean;
12
+ }
13
+ /**
14
+ * Any single signal flags reinstall mode. We err toward reinstall because
15
+ * reinstall mode is strictly safer (preserves data, skips prompts).
16
+ */
17
+ export declare function detectReinstall(dataDirOverride?: string): Promise<ReinstallSignals>;
18
+ /** pm2-logrotate settings we enforce. */
19
+ export declare const PM2_LOGROTATE_SETTINGS: {
20
+ readonly max_size: "10M";
21
+ readonly retain: "5";
22
+ readonly compress: "true";
23
+ readonly rotateInterval: "0 0 * * *";
24
+ };
25
+ /**
26
+ * Install and configure pm2-logrotate. Best-effort: WARN on failure but never
27
+ * throw. Idempotent — skips re-install if the module is already configured.
28
+ */
29
+ export declare function installPm2Logrotate(): Promise<void>;
30
+ /** Write systemd unit files for omni-api and omni-nats under `/etc/systemd/system/`. */
31
+ export declare function writeSystemdUnit(dataDir: string): void;
32
+ //# sourceMappingURL=install-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-helpers.d.ts","sourceRoot":"","sources":["../src/install-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgBH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAUzF;AAqCD,yCAAyC;AACzC,eAAO,MAAM,sBAAsB;;;;;CAKzB,CAAC;AAEX;;;GAGG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAiBzD;AAeD,wFAAwF;AACxF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAsCtD"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * NATS Installer
3
+ *
4
+ * Downloads and installs the NATS server binary to `~/.omni/nats-server`.
5
+ * Extracted from install.ts so the install command stays focused on wiring,
6
+ * not platform-specific download logic.
7
+ */
8
+ export declare const NATS_BINARY_PATH: string;
9
+ /** Ensure NATS is installed. No-op if the binary already exists. */
10
+ export declare function ensureNats(): Promise<void>;
11
+ //# sourceMappingURL=nats-install.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nats-install.d.ts","sourceRoot":"","sources":["../src/nats-install.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,eAAO,MAAM,gBAAgB,QAAgC,CAAC;AAoE9D,oEAAoE;AACpE,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAOhD"}
package/dist/output.d.ts CHANGED
@@ -34,13 +34,22 @@ export declare function keyValue(key: string, value: unknown): void;
34
34
  export declare function header(title: string): void;
35
35
  /** Print dimmed/secondary text */
36
36
  export declare function dim(text: string): void;
37
- /** Raw console.log (for custom formatting) */
37
+ /** Raw stdout line (for custom formatting) */
38
38
  export declare function raw(text: string): void;
39
39
  /**
40
- * Flush stdout to ensure all buffered data is written.
41
- * When stdout is a pipe (e.g., `--json | jq`), writes are buffered.
42
- * Without explicit flushing, the process can exit before all data is written,
43
- * causing truncated output.
40
+ * Flush stdout to ensure all buffered data is written before exit.
41
+ * When stdout is a pipe (e.g., `--json | cat > file`), writes above the kernel
42
+ * pipe buffer (64KB on Linux) trigger backpressure and get queued in Bun's
43
+ * internal stream buffer. If the process exits before those bytes drain,
44
+ * output is truncated at exactly 64KB boundaries.
45
+ *
46
+ * All output paths in this module route through `writeStdoutLine`, which uses
47
+ * `process.stdout.write(chunk, cb)`. The callback fires only after the chunk
48
+ * is actually drained; we track those promises in `pendingStdoutWrites` and
49
+ * await them here.
50
+ *
51
+ * A trailing empty-write drain gives any stdout bytes written outside this
52
+ * module (e.g., direct `process.stdout.write` calls) a final chance to drain.
44
53
  */
45
54
  export declare function flushStdout(): Promise<void>;
46
55
  //# sourceMappingURL=output.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,2CAA2C;AAC3C,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAED,kCAAkC;AAClC,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAWD,yBAAyB;AACzB,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,CAAC;AAE5C,4BAA4B;AAC5B,wBAAgB,gBAAgB,IAAI,YAAY,CAE/C;AAED,6BAA6B;AAC7B,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,E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AI,EAAE,MAAM,GAAG,IAAI,CAEtC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAOjD"}
package/dist/pm2.d.ts CHANGED
@@ -8,6 +8,52 @@ export declare const PM2_PROCESSES: {
8
8
  readonly api: "omni-api";
9
9
  readonly nats: "omni-nats";
10
10
  };
11
+ /**
12
+ * Hardened PM2 launch flags for `omni-api` and `omni-nats`.
13
+ *
14
+ * Shared by install and start so both paths use identical restart/memory/log
15
+ * throttling. This is the fix for the 2026-04-09 incident where a crash loop
16
+ * grew `omni-api-error.log` to 283 GB because pm2 had no `--max-restarts` or
17
+ * log rotation configured. See WISH: omni-install-resilience.
18
+ */
19
+ export declare const PM2_HARDENED_DEFAULTS: {
20
+ readonly maxRestarts: 10;
21
+ readonly restartDelayMs: 5000;
22
+ readonly apiMaxMemory: "2G";
23
+ readonly natsMaxMemory: "1G";
24
+ readonly logDateFormat: "YYYY-MM-DD HH:mm:ss.SSS";
25
+ };
26
+ /** Directory where hardened pm2 logs are written. */
27
+ export declare function getPm2LogDir(): string;
28
+ /** Hardened log path for a given pm2 process name. */
29
+ export declare function getPm2LogPaths(processName: string): {
30
+ out: string;
31
+ error: string;
32
+ };
33
+ /**
34
+ * Options for `buildPm2StartArgs`. Either an `api` or `nats` launch.
35
+ */
36
+ export interface Pm2StartArgsOptions {
37
+ /** Target process kind — controls memory limit and log paths. */
38
+ kind: 'api' | 'nats';
39
+ /** Script/binary to launch (e.g. the server launcher shell or the nats binary). */
40
+ script: string;
41
+ /** pm2 process name (`omni-api` or `omni-nats`). */
42
+ name: string;
43
+ /**
44
+ * Optional `--interpreter <name>` value. API launches via `bash` to hit the
45
+ * shell launcher; NATS runs as a native binary and should pass `'none'`.
46
+ */
47
+ interpreter?: string;
48
+ /** Arguments forwarded after `--` to the spawned process. */
49
+ scriptArgs?: string[];
50
+ }
51
+ /**
52
+ * Build the full `pm2 start ...` argv for hardened launches. Both install and
53
+ * start consume this so the restart/memory/log flags live in exactly one
54
+ * place.
55
+ */
56
+ export declare function buildPm2StartArgs(options: Pm2StartArgsOptions): string[];
11
57
  /** Map CLI service arg to PM2 process name */
12
58
  export declare function resolveProcessName(service: string): string;
13
59
  /** Check if PM2 is available in PATH */
package/dist/pm2.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"pm2.d.ts","sourceRoot":"","sources":["../src/pm2.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,wCAAwC;AACxC,eAAO,MAAM,aAAa;;;CAGhB,CAAC;AAEX,8CAA8C;AAC9C,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI1D;AAED,wCAAwC;AACxC,wBAAsB,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAYvD;AAED,gEAAgE;AAChE,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CASnG;AAED,2CAA2C;AAC3C,wBAAsB,UAAU,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAU7F;AAED,sDAAsD;AACtD,wBAAgB,gBAAgB,IAAI,KAAK,CAExC"}
1
+ {"version":3,"file":"pm2.d.ts","sourceRoot":"","sources":["../src/pm2.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,wCAAwC;AACxC,eAAO,MAAM,aAAa;;;CAGhB,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB;;;;;;CAMxB,CAAC;AAEX,qDAAqD;AACrD,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,sDAAsD;AACtD,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MA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