@revenexx/cli 0.2.1 → 0.3.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 (124) hide show
  1. package/README.md +60 -4
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.mjs +12592 -7107
  4. package/dist/index.cjs +2 -64
  5. package/dist/index.js +2 -64
  6. package/dist/lib/client.d.ts +0 -46
  7. package/dist/lib/client.d.ts.map +1 -1
  8. package/dist/lib/commands/generators/base.d.ts +1 -1
  9. package/dist/lib/commands/generic.d.ts.map +1 -1
  10. package/dist/lib/commands/repl.d.ts.map +1 -1
  11. package/dist/lib/commands/services/carts-io.d.ts +3 -0
  12. package/dist/lib/commands/services/carts-io.d.ts.map +1 -0
  13. package/dist/lib/commands/services/carts-items.d.ts +3 -0
  14. package/dist/lib/commands/services/carts-items.d.ts.map +1 -0
  15. package/dist/lib/commands/services/customers-contacts.d.ts +3 -0
  16. package/dist/lib/commands/services/customers-contacts.d.ts.map +1 -0
  17. package/dist/lib/commands/services/customers-organizations.d.ts +3 -0
  18. package/dist/lib/commands/services/customers-organizations.d.ts.map +1 -0
  19. package/dist/lib/commands/services/customers-roles.d.ts +3 -0
  20. package/dist/lib/commands/services/customers-roles.d.ts.map +1 -0
  21. package/dist/lib/commands/services/customers-segments.d.ts +3 -0
  22. package/dist/lib/commands/services/customers-segments.d.ts.map +1 -0
  23. package/dist/lib/commands/services/customers-value-lists.d.ts +3 -0
  24. package/dist/lib/commands/services/customers-value-lists.d.ts.map +1 -0
  25. package/dist/lib/commands/services/customers.d.ts.map +1 -1
  26. package/dist/lib/commands/services/health.d.ts +3 -0
  27. package/dist/lib/commands/services/health.d.ts.map +1 -0
  28. package/dist/lib/commands/services/inventories-locations.d.ts +3 -0
  29. package/dist/lib/commands/services/inventories-locations.d.ts.map +1 -0
  30. package/dist/lib/commands/services/inventories-reservations.d.ts +3 -0
  31. package/dist/lib/commands/services/inventories-reservations.d.ts.map +1 -0
  32. package/dist/lib/commands/services/inventories-stock.d.ts +3 -0
  33. package/dist/lib/commands/services/inventories-stock.d.ts.map +1 -0
  34. package/dist/lib/commands/services/io.d.ts.map +1 -1
  35. package/dist/lib/commands/services/pages-collaboration.d.ts +3 -0
  36. package/dist/lib/commands/services/pages-collaboration.d.ts.map +1 -0
  37. package/dist/lib/commands/services/pages-delivery.d.ts +3 -0
  38. package/dist/lib/commands/services/pages-delivery.d.ts.map +1 -0
  39. package/dist/lib/commands/services/pages-editor.d.ts +3 -0
  40. package/dist/lib/commands/services/pages-editor.d.ts.map +1 -0
  41. package/dist/lib/commands/services/payments-ledger.d.ts +3 -0
  42. package/dist/lib/commands/services/payments-ledger.d.ts.map +1 -0
  43. package/dist/lib/commands/services/payments-methods.d.ts +3 -0
  44. package/dist/lib/commands/services/payments-methods.d.ts.map +1 -0
  45. package/dist/lib/commands/services/payments-providers.d.ts +3 -0
  46. package/dist/lib/commands/services/payments-providers.d.ts.map +1 -0
  47. package/dist/lib/commands/services/products-assets.d.ts +3 -0
  48. package/dist/lib/commands/services/products-assets.d.ts.map +1 -0
  49. package/dist/lib/commands/services/products-categories.d.ts +3 -0
  50. package/dist/lib/commands/services/products-categories.d.ts.map +1 -0
  51. package/dist/lib/commands/services/products-data-model.d.ts +3 -0
  52. package/dist/lib/commands/services/products-data-model.d.ts.map +1 -0
  53. package/dist/lib/commands/services/products-references.d.ts +3 -0
  54. package/dist/lib/commands/services/products-references.d.ts.map +1 -0
  55. package/dist/lib/commands/services/shipping-carriers.d.ts +3 -0
  56. package/dist/lib/commands/services/shipping-carriers.d.ts.map +1 -0
  57. package/dist/lib/commands/services/shipping-methods.d.ts +3 -0
  58. package/dist/lib/commands/services/shipping-methods.d.ts.map +1 -0
  59. package/dist/lib/commands/services/shipping-value-lists.d.ts +3 -0
  60. package/dist/lib/commands/services/shipping-value-lists.d.ts.map +1 -0
  61. package/dist/lib/commands/tui.d.ts.map +1 -1
  62. package/dist/lib/commands/watch.d.ts +23 -0
  63. package/dist/lib/commands/watch.d.ts.map +1 -0
  64. package/dist/lib/constants.d.ts +1 -1
  65. package/dist/lib/parser.d.ts.map +1 -1
  66. package/dist/lib/sdks.d.ts.map +1 -1
  67. package/dist/lib/tui/app.d.ts.map +1 -1
  68. package/dist/lib/tui/command-tree.d.ts +3 -2
  69. package/dist/lib/tui/command-tree.d.ts.map +1 -1
  70. package/dist/lib/tui/slash-commands.d.ts +62 -0
  71. package/dist/lib/tui/slash-commands.d.ts.map +1 -0
  72. package/dist/lib/tui/watch-create.d.ts +17 -0
  73. package/dist/lib/tui/watch-create.d.ts.map +1 -0
  74. package/dist/lib/tui/watch-pane.d.ts +7 -0
  75. package/dist/lib/tui/watch-pane.d.ts.map +1 -0
  76. package/dist/lib/type-generation/languages/csharp.d.ts.map +1 -1
  77. package/dist/lib/type-generation/languages/dart.d.ts.map +1 -1
  78. package/dist/lib/type-generation/languages/java.d.ts.map +1 -1
  79. package/dist/lib/type-generation/languages/javascript.d.ts.map +1 -1
  80. package/dist/lib/type-generation/languages/kotlin.d.ts.map +1 -1
  81. package/dist/lib/type-generation/languages/php.d.ts.map +1 -1
  82. package/dist/lib/type-generation/languages/swift.d.ts.map +1 -1
  83. package/dist/lib/type-generation/languages/typescript.d.ts.map +1 -1
  84. package/dist/lib/watch/condition.d.ts +51 -0
  85. package/dist/lib/watch/condition.d.ts.map +1 -0
  86. package/dist/lib/watch/duration.d.ts +28 -0
  87. package/dist/lib/watch/duration.d.ts.map +1 -0
  88. package/dist/lib/watch/field-path.d.ts +54 -0
  89. package/dist/lib/watch/field-path.d.ts.map +1 -0
  90. package/dist/lib/watch/notify.d.ts +49 -0
  91. package/dist/lib/watch/notify.d.ts.map +1 -0
  92. package/dist/lib/watch/registry.d.ts +25 -0
  93. package/dist/lib/watch/registry.d.ts.map +1 -0
  94. package/dist/lib/watch/run-queue.d.ts +55 -0
  95. package/dist/lib/watch/run-queue.d.ts.map +1 -0
  96. package/dist/lib/watch/scheduler.d.ts +78 -0
  97. package/dist/lib/watch/scheduler.d.ts.map +1 -0
  98. package/dist/lib/watch/session.d.ts +17 -0
  99. package/dist/lib/watch/session.d.ts.map +1 -0
  100. package/dist/lib/watch/types.d.ts +144 -0
  101. package/dist/lib/watch/types.d.ts.map +1 -0
  102. package/dist/lib/watch/use-watchers.d.ts +25 -0
  103. package/dist/lib/watch/use-watchers.d.ts.map +1 -0
  104. package/dist/tests/watch-condition.test.d.ts +2 -0
  105. package/dist/tests/watch-condition.test.d.ts.map +1 -0
  106. package/dist/tests/watch-field-path.test.d.ts +2 -0
  107. package/dist/tests/watch-field-path.test.d.ts.map +1 -0
  108. package/dist/tests/watch-notify.test.d.ts +2 -0
  109. package/dist/tests/watch-notify.test.d.ts.map +1 -0
  110. package/dist/tests/watch-registry.test.d.ts +2 -0
  111. package/dist/tests/watch-registry.test.d.ts.map +1 -0
  112. package/dist/tests/watch-run-queue.test.d.ts +2 -0
  113. package/dist/tests/watch-run-queue.test.d.ts.map +1 -0
  114. package/dist/tests/watch-scheduler.test.d.ts +2 -0
  115. package/dist/tests/watch-scheduler.test.d.ts.map +1 -0
  116. package/package.json +1 -1
  117. package/dist/lib/commands/services/inventories.d.ts +0 -3
  118. package/dist/lib/commands/services/inventories.d.ts.map +0 -1
  119. package/dist/lib/commands/services/payments.d.ts +0 -3
  120. package/dist/lib/commands/services/payments.d.ts.map +0 -1
  121. package/dist/lib/commands/services/shipping.d.ts +0 -3
  122. package/dist/lib/commands/services/shipping.d.ts.map +0 -1
  123. package/dist/lib/commands/services/tokens.d.ts +0 -3
  124. package/dist/lib/commands/services/tokens.d.ts.map +0 -1
@@ -0,0 +1,62 @@
1
+ /**
2
+ * The TUI's `/`-command registry (DX-141): the closed set of words that mean
3
+ * "do a thing" rather than "search for a command", replacing the hardcoded
4
+ * exit/debug/fps chain that used to sit inline in app.tsx's filter handler.
5
+ *
6
+ * `/` does not open a separate palette — it enters the fuzzy command filter
7
+ * with an empty query, so `/` followed by a word *is* the slash command.
8
+ *
9
+ * The visible entries are also the source of their **nav rows**: lib/commands/
10
+ * tui.ts turns them into synthetic CommandNodes (slashNavEntries) so they can be
11
+ * browsed and searched like anything else, rather than only being findable by
12
+ * someone who already knows the word. One registry, both surfaces.
13
+ *
14
+ * Pure and ink-free on purpose: the matching is unit-testable without rendering
15
+ * an app, tui.ts can import it on the one-shot path, and the actions arrive as
16
+ * a context object supplied by App.
17
+ */
18
+ import type { CommandLeaf, CommandNode } from "./command-tree.js";
19
+ /** Callbacks App hands the registry; one per action a slash command can take. */
20
+ export type SlashContext = {
21
+ requestQuit: () => void;
22
+ toggleDebug: () => void;
23
+ openWatchCreate: () => void;
24
+ openWatchList: () => void;
25
+ };
26
+ export type SlashCommand = {
27
+ name: string;
28
+ aliases?: readonly string[];
29
+ description: string;
30
+ /**
31
+ * Dispatchable by typing the word, but never given a nav row. The three
32
+ * inherited words are hidden to preserve their long-standing behaviour
33
+ * exactly: typing `exi` or `deb` has always shown "no matches", and `debug`
34
+ * is an undocumented diagnostics egg.
35
+ */
36
+ hidden?: boolean;
37
+ /** Which in-app pane a visible entry opens, for its synthetic nav row. */
38
+ tuiAction?: NonNullable<CommandLeaf["tuiAction"]>;
39
+ run: (context: SlashContext) => void;
40
+ };
41
+ export declare const SLASH_COMMANDS: readonly SlashCommand[];
42
+ /**
43
+ * Exact-word lookup for the **hidden** words only, which fire the instant the
44
+ * word completes — the behaviour `exit`, `debug` and `fps` have always had, and
45
+ * the reason typing `exi` shows no matches rather than a row.
46
+ *
47
+ * Visible commands deliberately do NOT fire this way. `watch` is a prefix of
48
+ * `watchlist`, so instant-firing on the shorter word would make the longer one
49
+ * impossible to type; they are offered as rows and dispatched on Enter, which
50
+ * is also how you discover them.
51
+ */
52
+ export declare const matchInstantSlash: (word: string) => SlashCommand | undefined;
53
+ /**
54
+ * The visible commands as browsable nav rows. They land in the root "commands"
55
+ * section next to `login`/`status` — a synthetic node with no subcommands and a
56
+ * tuiAction, exactly the shape the `themes` entry already uses — so the
57
+ * watchlist is something you can find by looking rather than only by knowing
58
+ * the word. Because they are real nav entries, flattenTree picks them up and
59
+ * they appear in `/` search too, with no second code path.
60
+ */
61
+ export declare const slashNavEntries: () => CommandNode[];
62
+ //# sourceMappingURL=slash-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../../lib/tui/slash-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAElE,iFAAiF;AACjF,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;IAClD,GAAG,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EA2BjD,CAAC;AASF;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,YAAY,GAAG,SAM/D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,QAAO,WAAW,EAMzC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { CommandNode, PaletteEntry } from "./command-tree.js";
2
+ import type { PromptSpec, ResourceRecord } from "../interactive.js";
3
+ export declare const WATCH_CREATE_HINTS: [string, string][];
4
+ /**
5
+ * Get-by-id commands, enumerated straight off the command tree. flattenTree
6
+ * deliberately drops leaves folded behind their list (which is exactly what a
7
+ * get is), so it can't be reused here.
8
+ */
9
+ export declare const getByIdEntries: (commands: CommandNode[]) => PaletteEntry[];
10
+ export declare const WatchCreate: ({ commands, width, onClose, onNotice, loadResourceRecords, }: {
11
+ commands: CommandNode[];
12
+ width: number;
13
+ onClose: () => void;
14
+ onNotice: (text: string, tone: "success" | "danger" | "warn") => void;
15
+ loadResourceRecords?: (spec: PromptSpec, query?: string) => Promise<ResourceRecord[]>;
16
+ }) => import("react").JSX.Element;
17
+ //# sourceMappingURL=watch-create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch-create.d.ts","sourceRoot":"","sources":["../../../lib/tui/watch-create.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAe,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAiBhF,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAMpE,eAAO,MAAM,kBAAkB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAIhD,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,WAAW,EAAE,KAAG,YAAY,EAclE,CAAC;AA+EJ,eAAO,MAAM,WAAW,GAAI,8DAMzB;IACD,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,KAAK,IAAI,CAAC;IACtE,mBAAmB,CAAC,EAAE,CACpB,IAAI,EAAE,UAAU,EAChB,KAAK,CAAC,EAAE,MAAM,KACX,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;CAChC,gCAibA,CAAC"}
@@ -0,0 +1,7 @@
1
+ /** Status-bar keys while this pane owns the keyboard. */
2
+ export declare const WATCH_PANE_HINTS: [string, string][];
3
+ export declare const WatchPane: ({ width, onClose, }: {
4
+ width: number;
5
+ onClose: () => void;
6
+ }) => import("react").JSX.Element;
7
+ //# sourceMappingURL=watch-pane.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch-pane.d.ts","sourceRoot":"","sources":["../../../lib/tui/watch-pane.tsx"],"names":[],"mappings":"AAyBA,yDAAyD;AACzD,eAAO,MAAM,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAK9C,CAAC;AA0EF,eAAO,MAAM,SAAS,GAAI,qBAGvB;IACD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,gCAkGA,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"csharp.d.ts","sourceRoot":"","sources":["../../../../lib/type-generation/languages/csharp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEpE,qBAAa,MAAO,SAAQ,YAAY;IACtC,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM;IA8DT,WAAW,IAAI,MAAM;IAqHrB,WAAW,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;CAG5C"}
1
+ {"version":3,"file":"csharp.d.ts","sourceRoot":"","sources":["../../../../lib/type-generation/languages/csharp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGpE,qBAAa,MAAO,SAAQ,YAAY;IACtC,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM;IA8DT,WAAW,IAAI,MAAM;IAqHrB,WAAW,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;CAG5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"dart.d.ts","sourceRoot":"","sources":["../../../../lib/type-generation/languages/dart.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EACZ,SAAS,EACT,UAAU,EACV,cAAc,EAEf,MAAM,eAAe,CAAC;AAmBvB,qBAAa,IAAK,SAAQ,YAAY;IACpC,cAAc,IAAI,MAAM;IAqCxB,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM;IA8DT,YAAY,CACV,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAAE,GACjB,cAAc;IAWjB,WAAW,IAAI,MAAM;IA+GrB,WAAW,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;CAG5C"}
1
+ {"version":3,"file":"dart.d.ts","sourceRoot":"","sources":["../../../../lib/type-generation/languages/dart.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EACZ,SAAS,EACT,UAAU,EACV,cAAc,EAEf,MAAM,eAAe,CAAC;AAoBvB,qBAAa,IAAK,SAAQ,YAAY;IACpC,cAAc,IAAI,MAAM;IAqCxB,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM;IA8DT,YAAY,CACV,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAAE,GACjB,cAAc;IAWjB,WAAW,IAAI,MAAM;IA+GrB,WAAW,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;CAG5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"java.d.ts","sourceRoot":"","sources":["../../../../lib/type-generation/languages/java.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEpE,qBAAa,IAAK,SAAQ,YAAY;IACpC,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM;IA2DT,WAAW,IAAI,MAAM;IAiFrB,WAAW,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;CAG5C"}
1
+ {"version":3,"file":"java.d.ts","sourceRoot":"","sources":["../../../../lib/type-generation/languages/java.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGpE,qBAAa,IAAK,SAAQ,YAAY;IACpC,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM;IA2DT,WAAW,IAAI,MAAM;IAiFrB,WAAW,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;CAG5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"javascript.d.ts","sourceRoot":"","sources":["../../../../lib/type-generation/languages/javascript.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEpE,qBAAa,UAAW,SAAQ,YAAY;IAC1C,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,MAAM;IA4DjE,YAAY,IAAI,OAAO;IAIvB,OAAO,CAAC,iBAAiB;IAezB,WAAW,IAAI,MAAM;IA8BrB,WAAW,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM;CAG/C"}
1
+ {"version":3,"file":"javascript.d.ts","sourceRoot":"","sources":["../../../../lib/type-generation/languages/javascript.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGpE,qBAAa,UAAW,SAAQ,YAAY;IAC1C,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,MAAM;IA4DjE,YAAY,IAAI,OAAO;IAIvB,OAAO,CAAC,iBAAiB;IAezB,WAAW,IAAI,MAAM;IA8BrB,WAAW,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM;CAG/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"kotlin.d.ts","sourceRoot":"","sources":["../../../../lib/type-generation/languages/kotlin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEpE,qBAAa,MAAO,SAAQ,YAAY;IACtC,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM;IA8DT,WAAW,IAAI,MAAM;IAiCrB,WAAW,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;CAG5C"}
1
+ {"version":3,"file":"kotlin.d.ts","sourceRoot":"","sources":["../../../../lib/type-generation/languages/kotlin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGpE,qBAAa,MAAO,SAAQ,YAAY;IACtC,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM;IA8DT,WAAW,IAAI,MAAM;IAiCrB,WAAW,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;CAG5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"php.d.ts","sourceRoot":"","sources":["../../../../lib/type-generation/languages/php.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEpE,qBAAa,GAAI,SAAQ,YAAY;IACnC,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM;IA0DT,WAAW,IAAI,MAAM;IA0DrB,WAAW,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;CAG5C"}
1
+ {"version":3,"file":"php.d.ts","sourceRoot":"","sources":["../../../../lib/type-generation/languages/php.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGpE,qBAAa,GAAI,SAAQ,YAAY;IACnC,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM;IA0DT,WAAW,IAAI,MAAM;IA0DrB,WAAW,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;CAG5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"swift.d.ts","sourceRoot":"","sources":["../../../../lib/type-generation/languages/swift.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEpE,qBAAa,KAAM,SAAQ,YAAY;IACrC,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM;IA8DT,WAAW,IAAI,MAAM;IAiHrB,WAAW,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;CAG5C"}
1
+ {"version":3,"file":"swift.d.ts","sourceRoot":"","sources":["../../../../lib/type-generation/languages/swift.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGpE,qBAAa,KAAM,SAAQ,YAAY;IACrC,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM;IA8DT,WAAW,IAAI,MAAM;IAiHrB,WAAW,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;CAG5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../../../lib/type-generation/languages/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,SAAS,EACT,UAAU,EACV,cAAc,EAEf,MAAM,eAAe,CAAC;AAyBvB,qBAAa,UAAW,SAAQ,YAAY;IAC1C,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM;IAuBT,YAAY,IAAI,OAAO;IAIvB,YAAY,CACV,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAAE,GACjB,cAAc;IAWjB,WAAW,IAAI,MAAM;IAiCrB,WAAW,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM;CAG/C"}
1
+ {"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../../../lib/type-generation/languages/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,SAAS,EACT,UAAU,EACV,cAAc,EAEf,MAAM,eAAe,CAAC;AA0BvB,qBAAa,UAAW,SAAQ,YAAY;IAC1C,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM;IAuBT,YAAY,IAAI,OAAO;IAIvB,YAAY,CACV,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAAE,GACjB,cAAc;IAWjB,WAAW,IAAI,MAAM;IAiCrB,WAAW,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM;CAG/C"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Watch conditions (DX-141): the closed set of ways a watcher can decide it is
3
+ * done, plus the parser behind `--until` and the formatter the UIs echo back.
4
+ */
5
+ import type { Resolved, WatchCondition } from "./types.js";
6
+ export declare const CONDITION_KEYWORDS: readonly ["changed", "equals", "matches", "terminal", "truthy"];
7
+ /**
8
+ * "Terminal" means *stopped moving*, not *won*: a watcher must stop and tell
9
+ * you the deploy failed, not spin to timeout while the resource sits in
10
+ * `failed`. Both the success and the failure sinks are in the set.
11
+ */
12
+ export declare const DEFAULT_TERMINAL_STATES: readonly string[];
13
+ export declare const defaultTerminalStates: () => readonly string[];
14
+ /**
15
+ * The absent arm of each branch is declared as `undefined` rather than omitted:
16
+ * this package compiles with `strict: false`, where TypeScript will not narrow
17
+ * a union by a boolean discriminant, so callers must be able to read `.error`
18
+ * off the union directly.
19
+ */
20
+ export type ConditionParse = {
21
+ ok: true;
22
+ condition: WatchCondition;
23
+ error?: undefined;
24
+ } | {
25
+ ok: false;
26
+ condition?: undefined;
27
+ error: string;
28
+ };
29
+ export declare const parseCondition: (text: string) => ConditionParse;
30
+ export type UntilParse = {
31
+ ok: true;
32
+ fieldPath: string;
33
+ condition: WatchCondition;
34
+ error?: undefined;
35
+ } | {
36
+ ok: false;
37
+ fieldPath?: undefined;
38
+ condition?: undefined;
39
+ error: string;
40
+ };
41
+ /**
42
+ * `[<field-path>] <condition>` — the shape `--until` takes. One flag carries
43
+ * both because `--until 'status equals ready'` reads better than splitting it,
44
+ * and the condition keywords are a closed set, so a leading token that is not
45
+ * one of them is unambiguously the field path. Callers that pass `--field`
46
+ * separately can use parseCondition directly.
47
+ */
48
+ export declare const parseUntil: (text: string) => UntilParse;
49
+ export declare const evaluateCondition: (condition: WatchCondition, current: Resolved, baseline: Resolved | null) => boolean;
50
+ export declare const formatCondition: (condition: WatchCondition) => string;
51
+ //# sourceMappingURL=condition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../../../lib/watch/condition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE3D,eAAO,MAAM,kBAAkB,iEAMrB,CAAC;AAMX;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAuBpD,CAAC;AAuBF,eAAO,MAAM,qBAAqB,QAAO,SAAS,MAAM,EACoB,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GACtB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,SAAS,EAAE,cAAc,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAAE,GAC1D;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAwDxD,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,cA+B7C,CAAC;AAYF,MAAM,MAAM,UAAU,GAClB;IACE,EAAE,EAAE,IAAI,CAAC;IACT,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,cAAc,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,GACD;IACE,EAAE,EAAE,KAAK,CAAC;IACV,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEN;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,KAAG,UAkBzC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,WAAW,cAAc,EACzB,SAAS,QAAQ,EACjB,UAAU,QAAQ,GAAG,IAAI,KACxB,OAuCF,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,WAAW,cAAc,KAAG,MAe3D,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Human durations for the watch flags (`--every 5s`, `--for 10m`) and the TUI
3
+ * wizard's cadence step (DX-141).
4
+ */
5
+ /**
6
+ * The absent arm of each branch is declared as `undefined` rather than omitted:
7
+ * this package compiles with `strict: false`, where TypeScript will not narrow
8
+ * a union by a boolean discriminant, so callers must be able to read `.error`
9
+ * off the union directly.
10
+ */
11
+ export type DurationParse = {
12
+ ok: true;
13
+ ms: number;
14
+ error?: undefined;
15
+ } | {
16
+ ok: false;
17
+ ms?: undefined;
18
+ error: string;
19
+ };
20
+ /**
21
+ * `500ms` | `5s` | `2m` | `1h` | `30` — a bare number is **seconds**, which is
22
+ * what everyone means when they type `--every 5`. Fractions are allowed
23
+ * (`0.5m`); the result is rounded to whole milliseconds.
24
+ */
25
+ export declare const parseDuration: (text: string) => DurationParse;
26
+ /** Compact, for status lines and table cells: `900ms`, `42s`, `3m 05s`, `2h 07m`. */
27
+ export declare const formatDuration: (ms: number) => string;
28
+ //# sourceMappingURL=duration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duration.d.ts","sourceRoot":"","sources":["../../../lib/watch/duration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAAE,GAC3C;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,EAAE,CAAC,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,KAAG,aAoB5C,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,cAAc,GAAI,IAAI,MAAM,KAAG,MAS3C,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Dot-path resolution into a poll payload, plus the canonical text form every
3
+ * condition compares against (DX-141).
4
+ *
5
+ * The one design decision worth knowing before reading: there is **no implicit
6
+ * descent into a list envelope**. See resolveFieldPath.
7
+ */
8
+ import type { Resolved } from "./types.js";
9
+ /**
10
+ * Comparable text for a resolved value. Scalars stringify to exactly what a
11
+ * user would type at the flag (`null`, `true`, `42`, `ready`), so
12
+ * `--until 'code equals 200'` matches the number 200 and
13
+ * `--until 'error equals null'` matches JSON null without the caller having to
14
+ * guess the wire type. Containers get stable JSON — `equals` on them is
15
+ * possible, though `matches` is the sane tool there.
16
+ */
17
+ export declare const canonical: (value: unknown) => string;
18
+ /** Segments, or null when the path is malformed (an empty segment). */
19
+ export declare const parseFieldPath: (path: string) => string[] | null;
20
+ /**
21
+ * Walk `path` into `data`.
22
+ *
23
+ * Deliberately strict about list envelopes: a bare `status` against the
24
+ * gateway's `{ items, page }` resolves to `missing`, **not** `items[0].status`.
25
+ * A page of 50 records has 50 statuses, and picking `[0]` would depend on a
26
+ * default sort the CLI neither controls nor displays — a watcher silently
27
+ * tracking whichever row sorted first is a wrong answer wearing a right
28
+ * answer's clothes. It would also make the same `--until 'status equals ready'`
29
+ * mean two different things depending on which command it was pointed at.
30
+ * Being explicit costs eight characters: `items.0.status`. What falls out free
31
+ * and is worth knowing: `page.total`, `page.hasMore`, `items.length`.
32
+ */
33
+ export declare const resolveFieldPath: (data: unknown, path: string) => Resolved;
34
+ /**
35
+ * Every path a surface can offer as a suggestion, depth-first and capped. Used
36
+ * by the TUI wizard to turn a probed payload into a pick list instead of making
37
+ * the user know the field names.
38
+ */
39
+ export declare const enumerateFieldPaths: (data: unknown, { maxDepth, maxPaths }?: {
40
+ maxDepth?: number;
41
+ maxPaths?: number;
42
+ }) => string[];
43
+ /**
44
+ * Advisory only — a prefill for the surfaces, never applied by the resolver. A
45
+ * get-by-id response is a bare object whose interesting field is nearly always
46
+ * `status`; a list envelope's is `page.total`.
47
+ */
48
+ export declare const suggestFieldPath: (data: unknown) => string | null;
49
+ /**
50
+ * Short display text for a resolved value: an em dash for a miss, scalars bare,
51
+ * containers as truncated JSON.
52
+ */
53
+ export declare const formatResolved: (resolved: Resolved | null, max?: number) => string;
54
+ //# sourceMappingURL=field-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-path.d.ts","sourceRoot":"","sources":["../../../lib/watch/field-path.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAO3C;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,OAAO,KAAG,MAkB1C,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,MAAM,EAAE,GAAG,IAKxD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,OAAO,EAAE,MAAM,MAAM,KAAG,QAkC9D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,MAAM,OAAO,EACb,yBAAkC;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,KAC9E,MAAM,EAqBR,CAAC;AAKF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,OAAO,KAAG,MAAM,GAAG,IAOzD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,QAAQ,GAAG,IAAI,EAAE,YAAQ,KAAG,MAIpE,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Notification ports for the watchlist (DX-141). The scheduler calls one
3
+ * interface on every state transition; the TUI renders a toast and a badge, the
4
+ * REPL prints a line and rings the bell. Ports differ in *rendering*, not in
5
+ * which transitions they care about — filtering belongs to the port.
6
+ */
7
+ import type { WatchState, Watcher } from "./types.js";
8
+ export type WatchNotification = {
9
+ watcher: Watcher;
10
+ /** The state it left, so a port can ignore intra-poll churn. */
11
+ from: WatchState;
12
+ to: WatchState;
13
+ };
14
+ export type NotificationPort = {
15
+ onTransition(event: WatchNotification): void;
16
+ };
17
+ export type NotificationPortSet = NotificationPort & {
18
+ /** Returns a detach function, mirroring registry.subscribe. */
19
+ attach(port: NotificationPort): () => void;
20
+ };
21
+ export declare const createPortSet: () => NotificationPortSet;
22
+ /** The scheduler singleton's port set. */
23
+ export declare const watchPorts: NotificationPortSet;
24
+ /** Test seam (and a hook for any future surface). Pass null to restore. */
25
+ export declare const bindOutOfBandWriter: (write: ((chunk: string) => void) | null) => void;
26
+ export declare const writeOutOfBand: (chunk: string) => void;
27
+ /** Reset the coalescing window. Tests only. */
28
+ export declare const resetBellState: () => void;
29
+ export declare const ringBell: (now?: () => number) => void;
30
+ /** Glyph + a one-line summary of how a watcher ended. */
31
+ export declare const formatWatchOutcome: (watcher: Watcher) => {
32
+ glyph: string;
33
+ tone: "success" | "danger" | "warn";
34
+ text: string;
35
+ };
36
+ /**
37
+ * REPL: a line plus a bell. readline may be parked mid-prompt, so the notice
38
+ * starts with \r + erase-line rather than half-overwriting the prompt, and the
39
+ * caller's `redraw` repaints it afterwards — otherwise the user is left
40
+ * apparently prompt-less until the next keystroke.
41
+ */
42
+ export declare const createReplNotificationPort: (redraw: () => void) => NotificationPort;
43
+ /**
44
+ * TUI: an in-app toast plus the bell. Built once and handed a ref-backed
45
+ * callback — the scheduler holds the port for the process lifetime, so a port
46
+ * closing over a render-scoped setter would go stale.
47
+ */
48
+ export declare const createTuiNotificationPort: (toast: (text: string, tone: "success" | "danger" | "warn") => void) => NotificationPort;
49
+ //# sourceMappingURL=notify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notify.d.ts","sourceRoot":"","sources":["../../../lib/watch/notify.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,gEAAgE;IAChE,IAAI,EAAE,UAAU,CAAC;IACjB,EAAE,EAAE,UAAU,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG;IACnD,+DAA+D;IAC/D,MAAM,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,IAAI,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,aAAa,QAAO,mBAoBhC,CAAC;AAEF,0CAA0C;AAC1C,eAAO,MAAM,UAAU,EAAE,mBAAqC,CAAC;AAsB/D,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB,GAC9B,OAAO,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,KACtC,IAEF,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,IAE9C,CAAC;AAgBF,+CAA+C;AAC/C,eAAO,MAAM,cAAc,QAAO,IAEjC,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,MAAK,MAAM,MAAiB,KAAG,IAOvD,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,kBAAkB,GAC7B,SAAS,OAAO,KACf;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAyCpE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,GACrC,QAAQ,MAAM,IAAI,KACjB,gBAQD,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GACpC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,KAAK,IAAI,KACjE,gBAOD,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The watcher store (DX-141). A mutable exported singleton, which is the grain
3
+ * of this codebase — lib/tui/theme.ts does the same with the active palette,
4
+ * and the TUI has no context or event bus (everything else is prop-drilled from
5
+ * App). The REPL, the one-shot `watch` command and the TUI pane all read the
6
+ * same store, so the surfaces cannot disagree about what is running.
7
+ */
8
+ import type { Watcher } from "./types.js";
9
+ export type WatchRegistry = {
10
+ get(id: string): Watcher | undefined;
11
+ /** Referentially stable between mutations — see the note on emit(). */
12
+ snapshot(): readonly Watcher[];
13
+ add(watcher: Watcher): Watcher;
14
+ update(id: string, patch: Partial<Watcher>): Watcher | undefined;
15
+ remove(id: string): boolean;
16
+ clear(): void;
17
+ /** Drop finished watchers past MAX_RETAINED_WATCHERS, oldest-finished first. */
18
+ prune(): void;
19
+ /** Listeners are NOT invoked on subscribe; callers read snapshot() first. */
20
+ subscribe(listener: () => void): () => void;
21
+ };
22
+ export declare const createWatchRegistry: () => WatchRegistry;
23
+ /** Process-wide store, shared by every surface. */
24
+ export declare const watchRegistry: WatchRegistry;
25
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../lib/watch/registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IACrC,uEAAuE;IACvE,QAAQ,IAAI,SAAS,OAAO,EAAE,CAAC;IAC/B,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;IAC/B,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,SAAS,CAAC;IACjE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,KAAK,IAAI,IAAI,CAAC;IACd,gFAAgF;IAChF,KAAK,IAAI,IAAI,CAAC;IACd,6EAA6E;IAC7E,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;CAC7C,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAAO,aAmEtC,CAAC;AAEF,mDAAmD;AACnD,eAAO,MAAM,aAAa,EAAE,aAAqC,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * One process-wide lock over "something is driving the commander program right
3
+ * now" (DX-141). Everything that patches the shared process globals must pass
4
+ * through it:
5
+ *
6
+ * - lib/tui/executor.ts's runner patches process.exit, both stream writes,
7
+ * all five console.* methods and cliConfig, restoring them in a finally.
8
+ * Two overlapping calls corrupt each other — the inner finally restores
9
+ * while the outer is still running, so the outer's output leaks onto the
10
+ * ink frame and its captured buffers come back wrong.
11
+ * - lib/commands/repl.ts's runLine patches process.exit and resets cliConfig
12
+ * around a bare parseAsync — a different mechanism over the same globals.
13
+ *
14
+ * Background polls therefore cannot merely serialize against each other; they
15
+ * have to serialize against the foreground too. That is why the primitive here
16
+ * is a lock over *thunks* rather than a queue of token arrays: the REPL's line
17
+ * runner is not a TuiRunner call and could not otherwise be covered.
18
+ *
19
+ * RE-ENTRANCY RULE: never call withRunLock (or enqueueRun) from inside a locked
20
+ * task — it deadlocks. The scheduler's first poll is deliberately deferred onto
21
+ * a timer for exactly this reason: `watch add` typed at the REPL executes
22
+ * inside runLine, which already holds the lock.
23
+ */
24
+ import type { ExecutionResult, TuiRunner } from "../tui/executor.js";
25
+ export type RunPriority = "foreground" | "background";
26
+ /** Rejection handed to entries dropped by drainRunQueue. */
27
+ export declare class RunQueueClosed extends Error {
28
+ constructor();
29
+ }
30
+ /** The TUI and the REPL bind the live program's runner for the session. */
31
+ export declare const bindRunQueue: (runner: TuiRunner | null) => void;
32
+ export declare const isRunQueueBound: () => boolean;
33
+ /** For the status bar: "polling · 2 queued". */
34
+ export declare const runQueueDepth: () => {
35
+ running: boolean;
36
+ queued: number;
37
+ };
38
+ export declare const withRunLock: <T>(task: () => Promise<T>, priority?: RunPriority) => Promise<T>;
39
+ export declare const enqueueRun: (tokens: readonly string[], options?: {
40
+ force?: boolean;
41
+ priority?: RunPriority;
42
+ }) => Promise<ExecutionResult>;
43
+ /**
44
+ * Teardown: drop everything not yet started, then await the in-flight run so
45
+ * nothing resolves into a torn-down ink tree.
46
+ *
47
+ * Bounded, because "in flight" can mean a request the client is still retrying:
48
+ * its own timeout is 30 s and it retries idempotent GETs three times, so an
49
+ * unbounded wait would leave someone staring at a restored terminal for a
50
+ * minute after pressing q. Abandoning the wait is safe — every watcher has
51
+ * already been cancelled by the time this runs, so the poll's continuation
52
+ * re-reads a terminal state and does nothing.
53
+ */
54
+ export declare const drainRunQueue: (timeoutMs?: number) => Promise<void>;
55
+ //# sourceMappingURL=run-queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-queue.d.ts","sourceRoot":"","sources":["../../../lib/watch/run-queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAErE,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,YAAY,CAAC;AAEtD,4DAA4D;AAC5D,qBAAa,cAAe,SAAQ,KAAK;;CAKxC;AAaD,2EAA2E;AAC3E,eAAO,MAAM,YAAY,GAAI,QAAQ,SAAS,GAAG,IAAI,KAAG,IAEvD,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,OAAyB,CAAC;AAE7D,gDAAgD;AAChD,eAAO,MAAM,aAAa,QAAO;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAGjE,CAAC;AAqBH,eAAO,MAAM,WAAW,GAAI,CAAC,EAC3B,MAAM,MAAM,OAAO,CAAC,CAAC,CAAC,EACtB,WAAU,WAA0B,KACnC,OAAO,CAAC,CAAC,CAmBR,CAAC;AAEL,eAAO,MAAM,UAAU,GACrB,QAAQ,SAAS,MAAM,EAAE,EACzB,UAAS;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,WAAW,CAAA;CAAO,KACxD,OAAO,CAAC,eAAe,CAIY,CAAC;AAKvC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,GACxB,kBAA4B,KAC3B,OAAO,CAAC,IAAI,CAOd,CAAC"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * The poller behind the watchlist (DX-141). Surface-agnostic: it knows how to
3
+ * run argv, read a field, evaluate a condition and decide when to give up, and
4
+ * nothing at all about ink or readline.
5
+ *
6
+ * Every dependency that touches the outside world — the runner, the clock, the
7
+ * timers, the RNG — is injected, so tests own all four and never need
8
+ * vi.useFakeTimers() (which cannot drive the microtask queue an awaited poll
9
+ * suspends on).
10
+ */
11
+ import type { WatchSpec, Watcher } from "./types.js";
12
+ import type { NotificationPortSet } from "./notify.js";
13
+ import type { WatchRegistry } from "./registry.js";
14
+ import type { ExecutionResult } from "../tui/executor.js";
15
+ export type TimerHandle = unknown;
16
+ export type SchedulerDeps = {
17
+ /** Injected so tests pass a fake; production binds enqueueRun. */
18
+ run: (tokens: readonly string[]) => Promise<ExecutionResult>;
19
+ now: () => number;
20
+ setTimer: (fn: () => void, ms: number) => TimerHandle;
21
+ clearTimer: (handle: TimerHandle) => void;
22
+ random: () => number;
23
+ registry: WatchRegistry;
24
+ ports: NotificationPortSet;
25
+ newId: () => string;
26
+ };
27
+ /** Absent arms are declared `undefined` because this package compiles with
28
+ * `strict: false`, where a boolean discriminant does not narrow a union. */
29
+ export type StartOutcome = {
30
+ ok: true;
31
+ watcher: Watcher;
32
+ reason?: undefined;
33
+ } | {
34
+ ok: false;
35
+ reason: "capacity" | "duplicate";
36
+ watcher?: Watcher;
37
+ };
38
+ export type WatchContext = {
39
+ tenant?: string;
40
+ endpoint?: string;
41
+ };
42
+ export type WatchScheduler = {
43
+ start(spec: WatchSpec, context?: WatchContext): StartOutcome;
44
+ cancel(id: string): boolean;
45
+ cancelAll(): Promise<void>;
46
+ /** Resolves when the watcher reaches a terminal state — the await point for
47
+ * a blocking one-shot `watch add`. */
48
+ settled(id: string): Promise<Watcher>;
49
+ activeCount(): number;
50
+ };
51
+ /**
52
+ * Freeze the tenant/endpoint the watcher was created under onto its argv.
53
+ *
54
+ * Poll runs otherwise inherit whatever cliConfig holds *at poll time*, and that
55
+ * moves: the REPL calls resetCliConfig(baseline) before every line, so a
56
+ * watcher created after `--tenant acme` on one line would silently start
57
+ * polling the baseline tenant a few seconds later. "Watch this thing" has to
58
+ * keep meaning this thing.
59
+ *
60
+ * The flags go *in front of* the command path: the generated service commands
61
+ * re-declare their own --tenant/--endpoint, so a trailing global would be
62
+ * parsed by the subcommand (or rejected as unknown). Leading is unambiguously
63
+ * the program's.
64
+ */
65
+ export declare const buildWatchTokens: (spec: WatchSpec, context: WatchContext) => string[];
66
+ export declare const createWatchScheduler: (overrides?: Partial<SchedulerDeps>) => WatchScheduler;
67
+ /**
68
+ * Process-wide scheduler over the singleton registry. Nothing runs until
69
+ * start() is called, so eager construction at import is free.
70
+ */
71
+ export declare const watchScheduler: WatchScheduler;
72
+ /** Test helper: a fully isolated scheduler with its own store and ports. */
73
+ export declare const createIsolatedScheduler: (overrides?: Partial<SchedulerDeps>) => {
74
+ scheduler: WatchScheduler;
75
+ registry: WatchRegistry;
76
+ ports: NotificationPortSet;
77
+ };
78
+ //# sourceMappingURL=scheduler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../lib/watch/scheduler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAmBH,OAAO,KAAK,EAAE,SAAS,EAAc,OAAO,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC;AAElC,MAAM,MAAM,aAAa,GAAG;IAC1B,kEAAkE;IAClE,GAAG,EAAE,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IAC7D,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,KAAK,WAAW,CAAC;IACtD,UAAU,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC1C,MAAM,EAAE,MAAM,MAAM,CAAC;IACrB,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,EAAE,mBAAmB,CAAC;IAC3B,KAAK,EAAE,MAAM,MAAM,CAAC;CACrB,CAAC;AAEF;4EAC4E;AAC5E,MAAM,MAAM,YAAY,GACpB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,GAClD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,UAAU,GAAG,WAAW,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEvE,MAAM,MAAM,YAAY,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAElE,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IAC7D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B;0CACsC;IACtC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACtC,WAAW,IAAI,MAAM,CAAC;CACvB,CAAC;AA+CF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,GAC3B,MAAM,SAAS,EACf,SAAS,YAAY,KACpB,MAAM,EAkBR,CAAC;AAUF,eAAO,MAAM,oBAAoB,GAC/B,YAAW,OAAO,CAAC,aAAa,CAAM,KACrC,cAsRF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,cAAuC,CAAC;AAErE,4EAA4E;AAC5E,eAAO,MAAM,uBAAuB,GAClC,YAAW,OAAO,CAAC,aAAa,CAAM,KACrC;IAAE,SAAS,EAAE,cAAc,CAAC;IAAC,QAAQ,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,mBAAmB,CAAA;CAQlF,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Whether an interactive session is hosting watchers right now (DX-141).
3
+ *
4
+ * `watch add` means two different things depending on the answer. Inside the
5
+ * REPL or the TUI there is a process that outlives the command, so the watcher
6
+ * is registered and the prompt comes straight back. One-shot there is nothing
7
+ * to come back to, so the command blocks until the watcher settles and turns
8
+ * its outcome into an exit code.
9
+ *
10
+ * A tiny module of its own rather than a flag on cliConfig: repl.ts's
11
+ * resetCliConfig is a hand-maintained mirror of CliConfig with no compile-time
12
+ * link, and a field missing from it becomes silently sticky across REPL lines.
13
+ */
14
+ export declare const beginWatchSession: () => void;
15
+ export declare const endWatchSession: () => void;
16
+ export declare const isWatchSessionActive: () => boolean;
17
+ //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../lib/watch/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,eAAO,MAAM,iBAAiB,QAAO,IAEpC,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,IAElC,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAO,OAAoB,CAAC"}