@cortexkit/opencode-openai-auth 0.11.1 → 1.0.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 (204) hide show
  1. package/README.md +15 -26
  2. package/dist/index-766sfrh5.js +1 -0
  3. package/dist/index-8kj7sa1p.js +12 -0
  4. package/dist/index-8rqfbhfw.js +221 -0
  5. package/dist/index-b3q3j39x.js +2 -0
  6. package/dist/index-bmd7x5aq.js +2 -0
  7. package/dist/index-eqh53k8v.js +2 -0
  8. package/dist/{index-sdt2d2ra.js → index-hy9030jh.js} +1 -1
  9. package/dist/index-jyr8y8k4.js +7 -0
  10. package/dist/index-rv08jmd4.js +2 -0
  11. package/dist/index.d.ts +578 -145
  12. package/dist/index.js +1 -110
  13. package/dist/pool-lifecycle-DbDmgabd.d.ts +2430 -0
  14. package/dist/port-file-Do3lQIEk.d.ts +29 -0
  15. package/dist/protocol-BOBdkqqm.d.ts +198 -0
  16. package/dist/rpc/port-file.d.ts +4 -17
  17. package/dist/rpc/port-file.js +1 -1
  18. package/dist/rpc/protocol.d.ts +2 -2
  19. package/dist/rpc/protocol.js +1 -0
  20. package/dist/rpc/rpc-client.d.ts +5 -4
  21. package/dist/rpc/rpc-client.js +1 -1
  22. package/dist/rpc/rpc-dir.d.ts +2 -0
  23. package/dist/rpc/rpc-dir.js +1 -1
  24. package/dist/sidebar-state-D6cUKgkm.d.ts +385 -0
  25. package/dist/sidebar-state.d.ts +2 -2
  26. package/dist/sidebar-state.js +1 -1
  27. package/dist/token-util-wdza526f.js +1 -0
  28. package/dist/{token-9823y0pc.js → token-ypk61xj0.js} +1 -1
  29. package/dist/tui-preferences.js +5 -2
  30. package/dist/tui.d.ts +9 -4
  31. package/dist/v2/server.d.ts +54 -0
  32. package/dist/v2/server.js +4 -0
  33. package/package.json +21 -9
  34. package/src/tui/entry.mjs +26 -25
  35. package/src/tui-compiled/raw/logger.js +24 -0
  36. package/src/tui-compiled/raw/rpc/protocol.js +3 -0
  37. package/src/tui-compiled/raw/rpc/rpc-client.js +7 -0
  38. package/src/tui-compiled/raw/rpc/rpc-dir.js +27 -0
  39. package/src/tui-compiled/raw/selector.js +21 -0
  40. package/src/tui-compiled/raw/shared/0332701351b3eeec-format.js +138 -0
  41. package/src/tui-compiled/raw/shared/04a6357627de5ed0-errors.js +38 -0
  42. package/src/tui-compiled/raw/shared/053cc17b5419261e-codec.js +12 -0
  43. package/src/tui-compiled/raw/shared/0766d78c6f481f18-watcher.js +157 -0
  44. package/src/tui-compiled/raw/shared/08eef45626a94992-reserved.js +13 -0
  45. package/src/tui-compiled/raw/shared/39c3cb05738fcf6d-projection.js +134 -0
  46. package/src/tui-compiled/raw/shared/3c2d4169d00f907e-tui-support.js +5 -0
  47. package/src/tui-compiled/raw/shared/3e7d45a77c6ad4d5-index.js +4 -0
  48. package/src/tui-compiled/raw/shared/415792e85d80819e-capture-sink.js +13 -0
  49. package/src/tui-compiled/raw/shared/42ae93ab554fcec2-open-url.js +28 -0
  50. package/src/tui-compiled/raw/shared/43fc9e6b994519c7-refresh-lock.js +136 -0
  51. package/src/tui-compiled/raw/shared/458b934e92490331-mutate.js +500 -0
  52. package/src/tui-compiled/raw/shared/45bf5343bbbf9add-admission.js +142 -0
  53. package/src/tui-compiled/raw/shared/46f3dff1266160e8-client.js +2 -0
  54. package/src/tui-compiled/raw/shared/4825e03209d6ae3e-with-lock.js +48 -0
  55. package/src/tui-compiled/raw/shared/4f36d333d081d040-merge.js +162 -0
  56. package/src/tui-compiled/raw/shared/54eba94fd64c8c3c-index.js +7 -0
  57. package/src/tui-compiled/raw/shared/7211cfec06a298bc-atomic-write.js +80 -0
  58. package/src/tui-compiled/raw/shared/754d6017f8e419cf-builtins.js +534 -0
  59. package/src/tui-compiled/raw/shared/75bd8c3bd63b315f-identity.js +79 -0
  60. package/src/tui-compiled/raw/shared/7a91bb630e6f4804-index.js +1 -0
  61. package/src/tui-compiled/raw/shared/826342a4b6a8b89b-model.js +16 -0
  62. package/src/tui-compiled/raw/shared/83068c0dbe8a6f13-publication.js +304 -0
  63. package/src/tui-compiled/raw/shared/836fc615de6afbd9-settings.js +120 -0
  64. package/src/tui-compiled/raw/shared/83bc3ba9d0fe2761-runtime.js +68 -0
  65. package/src/tui-compiled/raw/shared/8a18abe4fa2977c8-menu.js +300 -0
  66. package/src/tui-compiled/raw/shared/901e149c5a0dbbff-sticky.js +339 -0
  67. package/src/tui-compiled/raw/shared/9020c407ce64f672-ordered.js +58 -0
  68. package/src/tui-compiled/raw/shared/905bffc0220f43d0-map.js +105 -0
  69. package/src/tui-compiled/raw/shared/94820e324f2b4c09-seam.js +301 -0
  70. package/src/tui-compiled/raw/shared/97484d9bb98c705b-provider-state.js +226 -0
  71. package/src/tui-compiled/raw/shared/9968e3cade6969a1-index.js +2 -0
  72. package/src/tui-compiled/raw/shared/9b4da614c45f9cd0-lock-constants.js +14 -0
  73. package/src/tui-compiled/raw/shared/9d3fc9e37456504e-refresh.js +225 -0
  74. package/src/tui-compiled/raw/shared/9deae3c4da4fd63b-hooks.js +34 -0
  75. package/src/tui-compiled/raw/shared/a09b6a533c11858f-tui-preferences.js +77 -0
  76. package/src/tui-compiled/raw/shared/a62a27a204266acd-attribution.js +60 -0
  77. package/src/tui-compiled/raw/shared/a910277ac43a8626-pull.js +143 -0
  78. package/src/tui-compiled/raw/shared/b85c5301fddcb98a-paths.js +5 -0
  79. package/src/tui-compiled/raw/shared/c14988621dc60a75-port-file.js +217 -0
  80. package/src/tui-compiled/raw/shared/c64d7afbc14ca125-sidebar-file.js +157 -0
  81. package/src/tui-compiled/raw/shared/c6b176708c446d6d-pins.js +34 -0
  82. package/src/tui-compiled/raw/shared/c7d252bedee01600-pi.js +206 -0
  83. package/src/tui-compiled/raw/shared/c852a15cfe489d12-pool.js +120 -0
  84. package/src/tui-compiled/raw/shared/cc9e0702a752cea7-index.js +3 -0
  85. package/src/tui-compiled/raw/shared/cd94316a888b0a8e-schema.js +754 -0
  86. package/src/tui-compiled/raw/shared/d319517e3ea6ad70-redact.js +83 -0
  87. package/src/tui-compiled/raw/shared/d5a8f1061ee2f114-index.js +5 -0
  88. package/src/tui-compiled/raw/shared/d669d72c40e9e116-logger.js +19 -0
  89. package/src/tui-compiled/raw/shared/d7dcba96fea1685c-engine.js +246 -0
  90. package/src/tui-compiled/raw/shared/dbef697d1df1cd84-index.js +5 -0
  91. package/src/tui-compiled/raw/shared/e4acc4cb713f300c-protocol.js +3 -0
  92. package/src/tui-compiled/raw/shared/e8cd4929507508d8-refresh-file-lock.js +501 -0
  93. package/src/tui-compiled/raw/shared/ec971142548df90e-index.js +6 -0
  94. package/src/tui-compiled/raw/shared/f37fcefc7aedbf25-error.js +11 -0
  95. package/src/tui-compiled/raw/shared/fbcdcd0f925e74c0-rpc-client.js +253 -0
  96. package/src/tui-compiled/raw/shared/fd45e82f2f9c0a0d-torn.js +294 -0
  97. package/src/tui-compiled/raw/shared/fe02abeadc535f77-rows.js +1258 -0
  98. package/src/tui-compiled/raw/sidebar-state.js +960 -0
  99. package/src/tui-compiled/raw/tui/command-dialogs.tsx +424 -0
  100. package/src/tui-compiled/raw/tui-preferences.js +135 -0
  101. package/src/tui-compiled/raw/tui.tsx +135 -143
  102. package/src/tui-compiled/runtime/logger.js +24 -0
  103. package/src/tui-compiled/runtime/rpc/protocol.js +3 -0
  104. package/src/tui-compiled/runtime/rpc/rpc-client.js +7 -0
  105. package/src/tui-compiled/runtime/rpc/rpc-dir.js +27 -0
  106. package/src/tui-compiled/runtime/selector.js +21 -0
  107. package/src/tui-compiled/runtime/shared/0332701351b3eeec-format.js +138 -0
  108. package/src/tui-compiled/runtime/shared/04a6357627de5ed0-errors.js +38 -0
  109. package/src/tui-compiled/runtime/shared/053cc17b5419261e-codec.js +12 -0
  110. package/src/tui-compiled/runtime/shared/0766d78c6f481f18-watcher.js +157 -0
  111. package/src/tui-compiled/runtime/shared/08eef45626a94992-reserved.js +13 -0
  112. package/src/tui-compiled/runtime/shared/39c3cb05738fcf6d-projection.js +134 -0
  113. package/src/tui-compiled/runtime/shared/3c2d4169d00f907e-tui-support.js +5 -0
  114. package/src/tui-compiled/runtime/shared/3e7d45a77c6ad4d5-index.js +4 -0
  115. package/src/tui-compiled/runtime/shared/415792e85d80819e-capture-sink.js +13 -0
  116. package/src/tui-compiled/runtime/shared/42ae93ab554fcec2-open-url.js +28 -0
  117. package/src/tui-compiled/runtime/shared/43fc9e6b994519c7-refresh-lock.js +136 -0
  118. package/src/tui-compiled/runtime/shared/458b934e92490331-mutate.js +500 -0
  119. package/src/tui-compiled/runtime/shared/45bf5343bbbf9add-admission.js +142 -0
  120. package/src/tui-compiled/runtime/shared/46f3dff1266160e8-client.js +2 -0
  121. package/src/tui-compiled/runtime/shared/4825e03209d6ae3e-with-lock.js +48 -0
  122. package/src/tui-compiled/runtime/shared/4f36d333d081d040-merge.js +162 -0
  123. package/src/tui-compiled/runtime/shared/54eba94fd64c8c3c-index.js +7 -0
  124. package/src/tui-compiled/runtime/shared/7211cfec06a298bc-atomic-write.js +80 -0
  125. package/src/tui-compiled/runtime/shared/754d6017f8e419cf-builtins.js +534 -0
  126. package/src/tui-compiled/runtime/shared/75bd8c3bd63b315f-identity.js +79 -0
  127. package/src/tui-compiled/runtime/shared/7a91bb630e6f4804-index.js +1 -0
  128. package/src/tui-compiled/runtime/shared/826342a4b6a8b89b-model.js +16 -0
  129. package/src/tui-compiled/runtime/shared/83068c0dbe8a6f13-publication.js +304 -0
  130. package/src/tui-compiled/runtime/shared/836fc615de6afbd9-settings.js +120 -0
  131. package/src/tui-compiled/runtime/shared/83bc3ba9d0fe2761-runtime.js +68 -0
  132. package/src/tui-compiled/runtime/shared/8a18abe4fa2977c8-menu.js +300 -0
  133. package/src/tui-compiled/runtime/shared/901e149c5a0dbbff-sticky.js +339 -0
  134. package/src/tui-compiled/runtime/shared/9020c407ce64f672-ordered.js +58 -0
  135. package/src/tui-compiled/runtime/shared/905bffc0220f43d0-map.js +105 -0
  136. package/src/tui-compiled/runtime/shared/94820e324f2b4c09-seam.js +301 -0
  137. package/src/tui-compiled/runtime/shared/97484d9bb98c705b-provider-state.js +226 -0
  138. package/src/tui-compiled/runtime/shared/9968e3cade6969a1-index.js +2 -0
  139. package/src/tui-compiled/runtime/shared/9b4da614c45f9cd0-lock-constants.js +14 -0
  140. package/src/tui-compiled/runtime/shared/9d3fc9e37456504e-refresh.js +225 -0
  141. package/src/tui-compiled/runtime/shared/9deae3c4da4fd63b-hooks.js +34 -0
  142. package/src/tui-compiled/runtime/shared/a09b6a533c11858f-tui-preferences.js +77 -0
  143. package/src/tui-compiled/runtime/shared/a62a27a204266acd-attribution.js +60 -0
  144. package/src/tui-compiled/runtime/shared/a910277ac43a8626-pull.js +143 -0
  145. package/src/tui-compiled/runtime/shared/b85c5301fddcb98a-paths.js +5 -0
  146. package/src/tui-compiled/runtime/shared/c14988621dc60a75-port-file.js +217 -0
  147. package/src/tui-compiled/runtime/shared/c64d7afbc14ca125-sidebar-file.js +157 -0
  148. package/src/tui-compiled/runtime/shared/c6b176708c446d6d-pins.js +34 -0
  149. package/src/tui-compiled/runtime/shared/c7d252bedee01600-pi.js +206 -0
  150. package/src/tui-compiled/runtime/shared/c852a15cfe489d12-pool.js +120 -0
  151. package/src/tui-compiled/runtime/shared/cc9e0702a752cea7-index.js +3 -0
  152. package/src/tui-compiled/runtime/shared/cd94316a888b0a8e-schema.js +754 -0
  153. package/src/tui-compiled/runtime/shared/d319517e3ea6ad70-redact.js +83 -0
  154. package/src/tui-compiled/runtime/shared/d5a8f1061ee2f114-index.js +5 -0
  155. package/src/tui-compiled/runtime/shared/d669d72c40e9e116-logger.js +19 -0
  156. package/src/tui-compiled/runtime/shared/d7dcba96fea1685c-engine.js +246 -0
  157. package/src/tui-compiled/runtime/shared/dbef697d1df1cd84-index.js +5 -0
  158. package/src/tui-compiled/runtime/shared/e4acc4cb713f300c-protocol.js +3 -0
  159. package/src/tui-compiled/runtime/shared/e8cd4929507508d8-refresh-file-lock.js +501 -0
  160. package/src/tui-compiled/runtime/shared/ec971142548df90e-index.js +6 -0
  161. package/src/tui-compiled/runtime/shared/f37fcefc7aedbf25-error.js +11 -0
  162. package/src/tui-compiled/runtime/shared/fbcdcd0f925e74c0-rpc-client.js +253 -0
  163. package/src/tui-compiled/runtime/shared/fd45e82f2f9c0a0d-torn.js +294 -0
  164. package/src/tui-compiled/runtime/shared/fe02abeadc535f77-rows.js +1258 -0
  165. package/src/tui-compiled/runtime/sidebar-state.js +960 -0
  166. package/src/tui-compiled/runtime/tui/command-dialogs.js +378 -0
  167. package/src/tui-compiled/runtime/tui-preferences.js +135 -0
  168. package/src/tui-compiled/runtime/{tui.tsx → tui.js} +288 -316
  169. package/dist/index-4effjmr6.js +0 -2
  170. package/dist/index-9ehhb051.js +0 -2
  171. package/dist/index-g3hsdjh4.js +0 -2
  172. package/dist/index-hh52v8sb.js +0 -2
  173. package/dist/index-jwn4r3sw.js +0 -1
  174. package/dist/index-sq36b120.js +0 -211
  175. package/dist/internal-BTndPmW2.d.ts +0 -914
  176. package/dist/quota-normalize-08hpp51v.js +0 -1
  177. package/dist/sidebar-state-CoKYKcLn.d.ts +0 -220
  178. package/dist/token-util-ypgz7rge.js +0 -1
  179. package/src/tui-compiled/raw/core-account-paths.ts +0 -114
  180. package/src/tui-compiled/raw/core-custody-state.ts +0 -243
  181. package/src/tui-compiled/raw/logger.ts +0 -53
  182. package/src/tui-compiled/raw/rpc-port-file.ts +0 -177
  183. package/src/tui-compiled/raw/rpc-protocol.ts +0 -12
  184. package/src/tui-compiled/raw/rpc-rpc-client.ts +0 -82
  185. package/src/tui-compiled/raw/rpc-rpc-dir.ts +0 -46
  186. package/src/tui-compiled/raw/sidebar-state.ts +0 -1659
  187. package/src/tui-compiled/raw/tui-command-dialogs.tsx +0 -1096
  188. package/src/tui-compiled/raw/tui-preferences.ts +0 -328
  189. package/src/tui-compiled/runtime/core-account-paths.ts +0 -114
  190. package/src/tui-compiled/runtime/core-custody-state.ts +0 -243
  191. package/src/tui-compiled/runtime/logger.ts +0 -53
  192. package/src/tui-compiled/runtime/rpc-port-file.ts +0 -177
  193. package/src/tui-compiled/runtime/rpc-protocol.ts +0 -12
  194. package/src/tui-compiled/runtime/rpc-rpc-client.ts +0 -82
  195. package/src/tui-compiled/runtime/rpc-rpc-dir.ts +0 -46
  196. package/src/tui-compiled/runtime/sidebar-state.ts +0 -1659
  197. package/src/tui-compiled/runtime/tui-command-dialogs.tsx +0 -855
  198. package/src/tui-compiled/runtime/tui-preferences.ts +0 -328
  199. package/src/tui-compiled/shared/internal.ts +0 -6
  200. package/src/tui-compiled/shared/logger.ts +0 -264
  201. package/src/tui-compiled/shared/paths.ts +0 -33
  202. package/src/tui-compiled/shared/refresh-file-lock.ts +0 -384
  203. package/src/tui-compiled/shared/util/error.ts +0 -9
  204. package/src/tui-compiled/shared/util/open-url.ts +0 -30
@@ -0,0 +1,29 @@
1
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.14.2+49be191d46b46482/node_modules/@cortexkit/common-auth/dist/rpc/port-file.d.ts
2
+ interface PortFileEntry {
3
+ port: number;
4
+ token: string;
5
+ pid: number;
6
+ startedAt: number;
7
+ }
8
+ declare function writePortFile(dir: string, entry: {
9
+ port: number;
10
+ token: string;
11
+ pid: number;
12
+ }, options?: {
13
+ secureDir?: boolean;
14
+ beforeWrite?: () => void | Promise<void>;
15
+ /** Test seam for forcing staging-name collisions; defaults to randomUUID. */
16
+ stageName?: () => string;
17
+ }): Promise<string>;
18
+ interface DiscoverPortFileOptions {
19
+ /**
20
+ * Return only the expected PID's entry, or null; never fall back to
21
+ * another live server. Without an expected PID nothing matches, so the
22
+ * result is null. Off by default, when a missing or unmatched expected PID
23
+ * falls back to the newest live entry.
24
+ */
25
+ exactPid?: boolean;
26
+ }
27
+ declare function discoverPortFile(dir: string, expectedPid?: number, options?: DiscoverPortFileOptions): Promise<PortFileEntry | null>;
28
+ //#endregion
29
+ export { discoverPortFile as n, writePortFile as r, PortFileEntry as t };
@@ -0,0 +1,198 @@
1
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.14.2+49be191d46b46482/node_modules/@cortexkit/common-auth/dist/commands/model.d.ts
2
+ /** The section slots, in the one order every renderer shows them. */
3
+ declare const SECTION_SLOTS: readonly ['accounts', 'quota', 'routing', 'limits', 'cache', 'diagnostics', 'extra'];
4
+ type SectionSlot = (typeof SECTION_SLOTS)[number];
5
+ /** One choice of a `choice` input. */
6
+ interface MenuChoice {
7
+ value: string;
8
+ label: string;
9
+ }
10
+ /**
11
+ * A typed input an action collects before it runs. `value` is the current
12
+ * setting, shown as the default. A `number` or `text` input that is not
13
+ * `required` may be left empty, which the action receives as `null`.
14
+ */
15
+ type MenuKnob = {
16
+ kind: 'choice';
17
+ id: string;
18
+ label: string;
19
+ choices: MenuChoice[];
20
+ value?: string;
21
+ } | {
22
+ kind: 'toggle';
23
+ id: string;
24
+ label: string;
25
+ value: boolean;
26
+ } | {
27
+ kind: 'number';
28
+ id: string;
29
+ label: string;
30
+ value?: number;
31
+ min?: number;
32
+ max?: number;
33
+ required?: boolean;
34
+ } | {
35
+ kind: 'text';
36
+ id: string;
37
+ label: string;
38
+ value?: string;
39
+ placeholder?: string;
40
+ /** Hide what is typed (a pasted secret, for example). */
41
+ masked?: boolean;
42
+ required?: boolean;
43
+ };
44
+ type KnobValue = string | number | boolean | null;
45
+ type KnobValues = Readonly<Record<string, KnobValue>>;
46
+ interface MenuConfirmation {
47
+ message: string;
48
+ /** Irreversible actions always carry a confirmation. */
49
+ irreversible: boolean;
50
+ }
51
+ interface MenuAction {
52
+ id: string;
53
+ label: string;
54
+ description?: string;
55
+ /**
56
+ * The header a section-level action is listed under (`Actions`). See
57
+ * `MenuSection` for how renderers draw groups.
58
+ */
59
+ group?: string;
60
+ knobs: MenuKnob[];
61
+ /** Present when the action must be confirmed before it is applied. */
62
+ confirm?: MenuConfirmation;
63
+ }
64
+ /**
65
+ * The account fields a renderer may show, and nothing else: an account is
66
+ * always projected field by field, never spread, so a credential the store
67
+ * row carries cannot reach a payload.
68
+ */
69
+ interface MenuAccount {
70
+ id: string;
71
+ label?: string;
72
+ enabled: boolean;
73
+ type: 'oauth' | 'api';
74
+ /** What the plugin chose to show for the account's identity. */
75
+ identity?: string;
76
+ }
77
+ interface MenuItem {
78
+ id: string;
79
+ label: string;
80
+ detail?: string;
81
+ /** The header the item is listed under (`Accounts`); see `MenuSection`. */
82
+ group?: string;
83
+ /**
84
+ * A short value shown right-aligned beside the label (`enabled`,
85
+ * `5h 58% left`): an OpenCode dialog option's `footer`.
86
+ */
87
+ status?: string;
88
+ account?: MenuAccount;
89
+ /**
90
+ * Extra name/value pairs a drawer may list under the item. Plugin data
91
+ * passes through here, so it is scrubbed of credential-shaped names.
92
+ */
93
+ facts?: Record<string, unknown>;
94
+ actions: MenuAction[];
95
+ }
96
+ /**
97
+ * One section of the menu. How every renderer draws it:
98
+ *
99
+ * - Every option a renderer shows can be selected and does something: it is
100
+ * an item with at least one action, or a section-level action. Text that
101
+ * does nothing is never an option; it is a group header or a line.
102
+ * - `lines` are read-only text. On OpenCode they are drawn as header text
103
+ * (a `category`) above the first group; on Pi they are part of the select
104
+ * title.
105
+ * - The options are the items, then the section-level actions, in that
106
+ * order. When an option's `group` differs from the previous one's, a
107
+ * header naming the group is drawn first. A header is never selectable
108
+ * (on OpenCode it is the option's `category`).
109
+ * - An item's `status` is drawn right-aligned beside its label (on
110
+ * OpenCode, `footer`); its `detail` and an action's `description` are
111
+ * the secondary text (`description`).
112
+ *
113
+ * The built-in sections never emit an item without actions, and a plugin
114
+ * section should not either. A renderer that meets one must not offer it as
115
+ * an option: on OpenCode a `disabled` option is hidden altogether, so the
116
+ * item is written as header text instead, and Pi writes it into the title.
117
+ */
118
+ interface MenuSection {
119
+ id: string;
120
+ slot: SectionSlot;
121
+ title: string;
122
+ /** Read-only text shown above the rows; never a selectable option. */
123
+ lines: string[];
124
+ items: MenuItem[];
125
+ actions: MenuAction[];
126
+ facts?: Record<string, unknown>;
127
+ }
128
+ interface CommandMenuModel {
129
+ /** The slash command's name, without the slash. */
130
+ command: string;
131
+ title: string;
132
+ sections: MenuSection[];
133
+ }
134
+ /** What a host's TUI receives when the slash command opens the dialog. */
135
+ interface CommandDialogPayload {
136
+ command: string;
137
+ menu: CommandMenuModel;
138
+ }
139
+ /**
140
+ * One applied action, as a renderer sends it back. `itemId` names the item
141
+ * the action sits on; absent for a section-level action.
142
+ */
143
+ interface CommandApplyRequest {
144
+ command: string;
145
+ sectionId: string;
146
+ itemId?: string;
147
+ actionId: string;
148
+ values?: KnobValues;
149
+ /** True once the user confirmed an action that carries a confirmation. */
150
+ confirmed?: boolean;
151
+ sessionId?: string;
152
+ }
153
+ /** The outcome of an apply: a message for the user and the refreshed menu. */
154
+ interface CommandApplyResult {
155
+ command: string;
156
+ ok: boolean;
157
+ text: string;
158
+ /**
159
+ * A stable code naming why the apply failed; present on every failure.
160
+ * The library's own codes are `unavailable`, `needs-confirmation`,
161
+ * `invalid-input`, `refused`, `action-failed` and `pool-<store failure
162
+ * kind>`; a plugin's `CommandError` or `ActionOutcome` names its own.
163
+ */
164
+ code?: string;
165
+ /** True when the action was refused only for want of a confirmation. */
166
+ needsConfirmation?: boolean;
167
+ menu: CommandMenuModel;
168
+ }
169
+ type NotifyKind = 'info' | 'warning' | 'error';
170
+ //#endregion
171
+ //#region ../core/dist/protocol.d.ts
172
+ /** The menu, as the slash command opens it in the TUI. */
173
+ type OpenDialogPayload = CommandDialogPayload;
174
+ /**
175
+ * A message for the user from work a menu action left running (a login that
176
+ * finishes after the action returned).
177
+ */
178
+ interface NotifyPayload {
179
+ command: string;
180
+ notify: {
181
+ message: string;
182
+ kind: NotifyKind;
183
+ };
184
+ }
185
+ interface RpcNotification {
186
+ id: number;
187
+ type: 'open-dialog';
188
+ payload: OpenDialogPayload | NotifyPayload;
189
+ sessionId?: string;
190
+ }
191
+ /** One action applied from the drawer. */
192
+ type ApplyRequest = CommandApplyRequest;
193
+ /** Its message and the refreshed menu. */
194
+ type ApplyResult = CommandApplyResult;
195
+ /** Whether a pushed notification is the menu itself or a message. */
196
+ declare function isNotifyPayload(payload: OpenDialogPayload | NotifyPayload): payload is NotifyPayload;
197
+ //#endregion
198
+ export { RpcNotification as a, OpenDialogPayload as i, ApplyResult as n, isNotifyPayload as o, NotifyPayload as r, ApplyRequest as t };
@@ -1,18 +1,5 @@
1
+ import { n as discoverPortFile, r as writePortFile, t as PortFileEntry } from "../port-file-Do3lQIEk.js";
1
2
  //#region src/rpc/port-file.d.ts
2
- export interface PortFileEntry {
3
- port: number;
4
- token: string;
5
- pid: number;
6
- startedAt: number;
7
- }
8
- export declare function writePortFile(dir: string, entry: {
9
- port: number;
10
- token: string;
11
- pid: number;
12
- }, options?: {
13
- secureDir?: boolean;
14
- beforeWrite?: () => void | Promise<void>;
15
- }): Promise<string>;
16
- export declare function sweepRpcState(root: string, activeDir: string): Promise<void>;
17
- export declare function discoverPortFile(dir: string, expectedPid?: number): Promise<PortFileEntry | null>;
18
- //#endregion
3
+ export declare const isOpenaiRpcStateDir: (name: string) => boolean;
4
+ //#endregion
5
+ export { type PortFileEntry, discoverPortFile, writePortFile };
@@ -1 +1 @@
1
- import{I as a,J as b,K as c}from"../index-4effjmr6.js";import"../index-sq36b120.js";import"../index-hh52v8sb.js";import"../index-9ehhb051.js";export{a as writePortFile,b as sweepRpcState,c as discoverPortFile};
1
+ import{Yb as c}from"../index-rv08jmd4.js";import{_b as a,ac as b}from"../index-8kj7sa1p.js";import"../index-766sfrh5.js";import"../index-b3q3j39x.js";export{a as writePortFile,c as isOpenaiRpcStateDir,b as discoverPortFile};
@@ -1,2 +1,2 @@
1
- import { a as CommandModalName, i as ApplyResult, o as OpenDialogPayload, r as ApplyRequest, s as RpcNotification } from "../internal-BTndPmW2.js";
2
- export type { ApplyRequest, ApplyResult, CommandModalName, OpenDialogPayload, RpcNotification };
1
+ import { a as RpcNotification, i as OpenDialogPayload, n as ApplyResult, o as isNotifyPayload, r as NotifyPayload, t as ApplyRequest } from "../protocol-BOBdkqqm.js";
2
+ export { type ApplyRequest, type ApplyResult, type NotifyPayload, type OpenDialogPayload, type RpcNotification, isNotifyPayload };
@@ -0,0 +1 @@
1
+ import{mc as b}from"../index-bmd7x5aq.js";import"../index-b3q3j39x.js";export{b as isNotifyPayload};
@@ -1,11 +1,12 @@
1
- import { i as ApplyResult, r as ApplyRequest, s as RpcNotification } from "../internal-BTndPmW2.js";
2
- import { PortFileEntry } from "./port-file.js";
3
- import "./protocol.js";
1
+ import { a as RpcNotification, n as ApplyResult, t as ApplyRequest } from "../protocol-BOBdkqqm.js";
2
+ import { t as PortFileEntry } from "../port-file-Do3lQIEk.js";
3
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.14.2+49be191d46b46482/node_modules/@cortexkit/common-auth/dist/rpc/rpc-client.d.ts
4
+ export declare const DEFAULT_RPC_TIMEOUT_MS = 2000;
5
+ //#endregion
4
6
  //#region src/rpc/rpc-client.d.ts
5
7
  export interface RpcClient {
6
8
  pending: (lastReceivedId: number, sessionId?: string) => Promise<RpcNotification[]>;
7
9
  apply: (request: ApplyRequest, timeoutMs?: number) => Promise<ApplyResult>;
8
10
  }
9
- export declare const DEFAULT_RPC_TIMEOUT_MS = 2000;
10
11
  export declare function createRpcClient(dir: string, expectedPid?: number, onSelected?: (entry: PortFileEntry | null) => void): RpcClient;
11
12
  //#endregion
@@ -1 +1 @@
1
- import{K as c}from"../index-4effjmr6.js";import"../index-sq36b120.js";import"../index-hh52v8sb.js";import"../index-9ehhb051.js";var y=2000;async function p(n,r,s,o,i,e=y){let t=await c(n,r);if(s?.(t),!t)return null;let l=new AbortController,u=setTimeout(()=>l.abort(),e);try{let a=await fetch(`http://127.0.0.1:${t.port}/rpc/${o}`,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${t.token}`},body:JSON.stringify(i),signal:l.signal});if(!a.ok)return null;return await a.json()}catch{return null}finally{clearTimeout(u)}}function m(n,r,s){let o=!1,i=(e)=>{if(o)return;o=!0,s?.(e)};return{async pending(e,t){return(await p(n,r,i,"pending-notifications",{lastReceivedId:e,sessionId:t}))?.messages??[]},async apply(e,t){return await p(n,r,i,"apply",{...e},t)??{text:"apply failed",knobs:{}}}}}export{m as createRpcClient,y as DEFAULT_RPC_TIMEOUT_MS};
1
+ import{bc as F,cc as f}from"../index-8kj7sa1p.js";import"../index-b3q3j39x.js";function y(r,s,v){return f(r,s,v)}export{y as createRpcClient,F as DEFAULT_RPC_TIMEOUT_MS};
@@ -1,5 +1,7 @@
1
1
  import { tmpdir } from "node:os";
2
2
  //#region src/rpc/rpc-dir.d.ts
3
+ /** Name prefix of this plugin's per-project RPC state directories. */
4
+ export declare const RPC_DIRECTORY_PREFIX = "openai-auth-";
3
5
  export interface RpcDirResolution {
4
6
  dir: string;
5
7
  secureDir: boolean;
@@ -1 +1 @@
1
- import{ib as a,jb as b,kb as c}from"../index-jwn4r3sw.js";import"../index-9ehhb051.js";export{a as tmpdir,c as resolveRpcDir,b as getRpcDir};
1
+ import{oc as a,pc as b,qc as c,rc as d}from"../index-766sfrh5.js";import"../index-b3q3j39x.js";export{a as tmpdir,d as resolveRpcDir,c as getRpcDir,b as RPC_DIRECTORY_PREFIX};