@humain/humain-code 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/bundle/chunks/{anthropic-messages-UZB5HJE3.js → anthropic-messages-XFCDMGD6.js} +4 -4
  3. package/dist/bundle/chunks/{azure-openai-responses-J3LCMWPQ.js → azure-openai-responses-F4KQM3NK.js} +3 -3
  4. package/dist/bundle/chunks/{chunk-7EONJCBE.js → chunk-2JNJJ6SZ.js} +1 -1
  5. package/dist/bundle/chunks/{chunk-WRYGY5XG.js → chunk-4MKATHT2.js} +1 -1
  6. package/dist/bundle/chunks/{chunk-ATFZAFMS.js → chunk-65FLSKDA.js} +1 -1
  7. package/dist/bundle/chunks/{chunk-CET2MXXN.js → chunk-6P6MMQUH.js} +1 -1
  8. package/dist/bundle/chunks/{chunk-CU6KU7JK.js → chunk-6TTMNQXI.js} +13 -13
  9. package/dist/bundle/chunks/{chunk-KQXXBQ57.js → chunk-6YVORXTX.js} +155 -125
  10. package/dist/bundle/chunks/{chunk-SQ7NTRLJ.js → chunk-7X6DNT45.js} +17 -16
  11. package/dist/bundle/chunks/{chunk-PGVDL4KB.js → chunk-CQ2CE3RB.js} +1 -1
  12. package/dist/bundle/chunks/{chunk-QRYDGY5I.js → chunk-DJG2WUNM.js} +1 -1
  13. package/dist/bundle/chunks/{chunk-R3VDXQW2.js → chunk-E7OBH44W.js} +5 -5
  14. package/dist/bundle/chunks/{chunk-4EV7CK26.js → chunk-F2H47FRF.js} +1 -1
  15. package/dist/bundle/chunks/chunk-FQ4KS5S4.js +23 -0
  16. package/dist/bundle/chunks/{chunk-TYN46EVI.js → chunk-GPLWWO5Q.js} +1 -1
  17. package/dist/bundle/chunks/{chunk-EMBIUIQ2.js → chunk-IMUFBWEK.js} +4 -4
  18. package/dist/bundle/chunks/{chunk-Z5UFSRO4.js → chunk-KI7CHPWC.js} +1 -1
  19. package/dist/bundle/chunks/{chunk-VKQNYZUA.js → chunk-KRBELWQH.js} +1 -1
  20. package/dist/bundle/chunks/{chunk-AI7EHDAX.js → chunk-LSRXA7OS.js} +1 -1
  21. package/dist/bundle/chunks/{chunk-XVIQYONJ.js → chunk-MIAXMK5F.js} +1 -1
  22. package/dist/bundle/chunks/{chunk-NNWNIBLG.js → chunk-NICPFMOP.js} +1 -1
  23. package/dist/bundle/chunks/{chunk-4SFWYKL5.js → chunk-P42E6YY6.js} +441 -415
  24. package/dist/bundle/chunks/{chunk-WGXMYMPE.js → chunk-PFBAIRCY.js} +2 -2
  25. package/dist/bundle/chunks/{chunk-OVDMYBIT.js → chunk-PWFM6AQQ.js} +1 -1
  26. package/dist/bundle/chunks/{chunk-JV7VHOAY.js → chunk-QRRVZYTG.js} +1 -1
  27. package/dist/bundle/chunks/{chunk-IOLLZXQN.js → chunk-ROFZVEFN.js} +125 -114
  28. package/dist/bundle/chunks/{chunk-C4DHVDYT.js → chunk-SXOIQWNX.js} +1 -1
  29. package/dist/bundle/chunks/{chunk-IXQYPQRQ.js → chunk-XZ7FTBXS.js} +1446 -1423
  30. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-ETKC6B2S.js → cloudflare-workers-ai-system-one-JEZVYITT.js} +1 -1
  31. package/dist/bundle/chunks/{compat-HS4ARZK3.js → compat-SRCNS6OQ.js} +6 -6
  32. package/dist/bundle/chunks/{curator-server-TC7RVVN2.js → curator-server-QB4GITGS.js} +1 -1
  33. package/dist/bundle/chunks/{dist-5AQPJ2TI.js → dist-4OMLHRJE.js} +1 -1
  34. package/dist/bundle/chunks/{dist-NMEXYUP3.js → dist-CBODG4CA.js} +5 -5
  35. package/dist/bundle/chunks/{dist-DYB3AR7C.js → dist-TRAK7EXI.js} +7 -7
  36. package/dist/bundle/chunks/{extract-QHZTEVJP.js → extract-L373D6O7.js} +2 -2
  37. package/dist/bundle/chunks/{flow-implementer-QMN3HKE2.js → flow-implementer-4KO3Q4B5.js} +4 -4
  38. package/dist/bundle/chunks/github-copilot.js +53 -56
  39. package/dist/bundle/chunks/{google-generative-ai-ZND73WDQ.js → google-generative-ai-WIASMWS3.js} +2 -2
  40. package/dist/bundle/chunks/{google-vertex-YAH62YRM.js → google-vertex-WSPHRZIZ.js} +3 -3
  41. package/dist/bundle/chunks/{host-Q565BCXB.js → host-WOLZCWQQ.js} +1 -1
  42. package/dist/bundle/chunks/{inprocess-453SLFL5.js → inprocess-TOBRVK4C.js} +5 -5
  43. package/dist/bundle/chunks/{interactive-mode-MVZOJ5OU.js → interactive-mode-BJJKPBXD.js} +3 -3
  44. package/dist/bundle/chunks/{llama-cpp-classify-Z4GZY4GC.js → llama-cpp-classify-KYZT532X.js} +1 -1
  45. package/dist/bundle/chunks/{mistral-conversations-7I5JURDP.js → mistral-conversations-7JYDDRUT.js} +2 -2
  46. package/dist/bundle/chunks/{node-IMSYVRPL.js → node-N7TPBUJB.js} +1 -1
  47. package/dist/bundle/chunks/{openai-codex-responses-LTHOMN37.js → openai-codex-responses-7PAML4NF.js} +3 -3
  48. package/dist/bundle/chunks/{openai-completions-W2X635EE.js → openai-completions-UJDAIGTK.js} +3 -3
  49. package/dist/bundle/chunks/{openai-decisions-TN2GNOYI.js → openai-decisions-JMSDGR7K.js} +1 -1
  50. package/dist/bundle/chunks/{openai-responses-DVY4QXOG.js → openai-responses-2WNCE6AY.js} +3 -3
  51. package/dist/bundle/chunks/{openrouter-images-SE2JMS44.js → openrouter-images-V3UCCO6X.js} +1 -1
  52. package/dist/bundle/chunks/{pi-messages-WAS6Z5L5.js → pi-messages-TQ7LJUNQ.js} +2 -2
  53. package/dist/bundle/chunks/{session-picker-XNVLSJ22.js → session-picker-4JQEGLDD.js} +1 -1
  54. package/dist/bundle/chunks/{startup-ui-3TCT465D.js → startup-ui-AKTA4NDP.js} +1 -1
  55. package/dist/bundle/chunks/{typesafe-system-one-AAZH6S3I.js → typesafe-system-one-YP7GGN4C.js} +1 -1
  56. package/dist/bundle/chunks/{virtual-modules-CIVXCEAN.js → virtual-modules-3CT5BMBA.js} +8 -8
  57. package/dist/bundle/cli-runtime.js +5 -5
  58. package/dist/bundle/index.js +8 -8
  59. package/dist/bundle/rpc-entry.js +4 -4
  60. package/dist/cli/args.js +1 -1
  61. package/dist/cli/args.js.map +1 -1
  62. package/dist/cli/list-models.d.ts.map +1 -1
  63. package/dist/cli/list-models.js +16 -1
  64. package/dist/cli/list-models.js.map +1 -1
  65. package/dist/cli/setup.d.ts +1 -1
  66. package/dist/cli/setup.d.ts.map +1 -1
  67. package/dist/cli/setup.js +3 -2
  68. package/dist/cli/setup.js.map +1 -1
  69. package/dist/cli.js.map +1 -1
  70. package/dist/core/agent-session-runtime.d.ts +3 -0
  71. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  72. package/dist/core/agent-session-runtime.js +11 -2
  73. package/dist/core/agent-session-runtime.js.map +1 -1
  74. package/dist/core/keybindings.d.ts +24 -0
  75. package/dist/core/keybindings.d.ts.map +1 -1
  76. package/dist/core/keybindings.js +3 -0
  77. package/dist/core/keybindings.js.map +1 -1
  78. package/dist/core/model-registry.d.ts.map +1 -1
  79. package/dist/core/model-registry.js +12 -1
  80. package/dist/core/model-registry.js.map +1 -1
  81. package/dist/core/model-resolver.d.ts.map +1 -1
  82. package/dist/core/model-resolver.js +11 -7
  83. package/dist/core/model-resolver.js.map +1 -1
  84. package/dist/core/model-runtime.d.ts +11 -2
  85. package/dist/core/model-runtime.d.ts.map +1 -1
  86. package/dist/core/model-runtime.js +23 -6
  87. package/dist/core/model-runtime.js.map +1 -1
  88. package/dist/core/oauth-account-pool.d.ts +4 -0
  89. package/dist/core/oauth-account-pool.d.ts.map +1 -1
  90. package/dist/core/oauth-account-pool.js +104 -20
  91. package/dist/core/oauth-account-pool.js.map +1 -1
  92. package/dist/core/sdk.js +2 -2
  93. package/dist/core/sdk.js.map +1 -1
  94. package/dist/core/slash-commands.d.ts.map +1 -1
  95. package/dist/core/slash-commands.js +1 -0
  96. package/dist/core/slash-commands.js.map +1 -1
  97. package/dist/extensions/usage/confirmation.d.ts.map +1 -1
  98. package/dist/extensions/usage/confirmation.js +1 -1
  99. package/dist/extensions/usage/confirmation.js.map +1 -1
  100. package/dist/extensions/usage/index.js +1 -1
  101. package/dist/extensions/usage/index.js.map +1 -1
  102. package/dist/extensions/usage/panes.d.ts +5 -0
  103. package/dist/extensions/usage/panes.d.ts.map +1 -0
  104. package/dist/extensions/usage/panes.js +10 -0
  105. package/dist/extensions/usage/panes.js.map +1 -0
  106. package/dist/extensions/usage/popup.d.ts.map +1 -1
  107. package/dist/extensions/usage/popup.js +9 -18
  108. package/dist/extensions/usage/popup.js.map +1 -1
  109. package/dist/humain/hcode/contracts.d.ts +15 -0
  110. package/dist/humain/hcode/contracts.d.ts.map +1 -1
  111. package/dist/humain/hcode/contracts.js +85 -10
  112. package/dist/humain/hcode/contracts.js.map +1 -1
  113. package/dist/humain/hcode/environment.d.ts.map +1 -1
  114. package/dist/humain/hcode/environment.js +4 -2
  115. package/dist/humain/hcode/environment.js.map +1 -1
  116. package/dist/humain/hcode/images.d.ts.map +1 -1
  117. package/dist/humain/hcode/images.js +4 -2
  118. package/dist/humain/hcode/images.js.map +1 -1
  119. package/dist/humain/hcode/login-copy.js +1 -1
  120. package/dist/humain/hcode/login-copy.js.map +1 -1
  121. package/dist/humain/hcode/notices.d.ts +22 -1
  122. package/dist/humain/hcode/notices.d.ts.map +1 -1
  123. package/dist/humain/hcode/notices.js +34 -3
  124. package/dist/humain/hcode/notices.js.map +1 -1
  125. package/dist/humain/hcode/provider.d.ts +3 -1
  126. package/dist/humain/hcode/provider.d.ts.map +1 -1
  127. package/dist/humain/hcode/provider.js +126 -46
  128. package/dist/humain/hcode/provider.js.map +1 -1
  129. package/dist/humain/hcode/run-credential.d.ts +21 -0
  130. package/dist/humain/hcode/run-credential.d.ts.map +1 -0
  131. package/dist/humain/hcode/run-credential.js +140 -0
  132. package/dist/humain/hcode/run-credential.js.map +1 -0
  133. package/dist/humain/hcode/sandbox.d.ts +6 -0
  134. package/dist/humain/hcode/sandbox.d.ts.map +1 -0
  135. package/dist/humain/hcode/sandbox.js +139 -0
  136. package/dist/humain/hcode/sandbox.js.map +1 -0
  137. package/dist/humain/hcode/selection.d.ts +7 -2
  138. package/dist/humain/hcode/selection.d.ts.map +1 -1
  139. package/dist/humain/hcode/selection.js +29 -5
  140. package/dist/humain/hcode/selection.js.map +1 -1
  141. package/dist/humain/hcode/transport.d.ts +3 -2
  142. package/dist/humain/hcode/transport.d.ts.map +1 -1
  143. package/dist/humain/hcode/transport.js +22 -7
  144. package/dist/humain/hcode/transport.js.map +1 -1
  145. package/dist/humain/remote/broker.d.ts +84 -0
  146. package/dist/humain/remote/broker.d.ts.map +1 -0
  147. package/dist/humain/remote/broker.js +427 -0
  148. package/dist/humain/remote/broker.js.map +1 -0
  149. package/dist/humain/remote/deny-store.d.ts +12 -0
  150. package/dist/humain/remote/deny-store.d.ts.map +1 -0
  151. package/dist/humain/remote/deny-store.js +164 -0
  152. package/dist/humain/remote/deny-store.js.map +1 -0
  153. package/dist/humain/remote/enablement.d.ts +5 -0
  154. package/dist/humain/remote/enablement.d.ts.map +1 -0
  155. package/dist/humain/remote/enablement.js +8 -0
  156. package/dist/humain/remote/enablement.js.map +1 -0
  157. package/dist/humain/remote/environment.d.ts +11 -0
  158. package/dist/humain/remote/environment.d.ts.map +1 -0
  159. package/dist/humain/remote/environment.js +19 -0
  160. package/dist/humain/remote/environment.js.map +1 -0
  161. package/dist/humain/remote/host-watch.d.ts +21 -0
  162. package/dist/humain/remote/host-watch.d.ts.map +1 -0
  163. package/dist/humain/remote/host-watch.js +186 -0
  164. package/dist/humain/remote/host-watch.js.map +1 -0
  165. package/dist/humain/remote/ipc-posix.d.ts +5 -0
  166. package/dist/humain/remote/ipc-posix.d.ts.map +1 -0
  167. package/dist/humain/remote/ipc-posix.js +29 -0
  168. package/dist/humain/remote/ipc-posix.js.map +1 -0
  169. package/dist/humain/remote/ipc-windows.d.ts +3 -0
  170. package/dist/humain/remote/ipc-windows.d.ts.map +1 -0
  171. package/dist/humain/remote/ipc-windows.js +5 -0
  172. package/dist/humain/remote/ipc-windows.js.map +1 -0
  173. package/dist/humain/remote/ipc.d.ts +10 -0
  174. package/dist/humain/remote/ipc.d.ts.map +1 -0
  175. package/dist/humain/remote/ipc.js +19 -0
  176. package/dist/humain/remote/ipc.js.map +1 -0
  177. package/dist/humain/remote/protocol.d.ts +43 -0
  178. package/dist/humain/remote/protocol.d.ts.map +1 -0
  179. package/dist/humain/remote/protocol.js +76 -0
  180. package/dist/humain/remote/protocol.js.map +1 -0
  181. package/dist/humain/remote/relay-socket.d.ts +30 -0
  182. package/dist/humain/remote/relay-socket.d.ts.map +1 -0
  183. package/dist/humain/remote/relay-socket.js +137 -0
  184. package/dist/humain/remote/relay-socket.js.map +1 -0
  185. package/dist/humain/remote/secure-channel.d.ts +10 -0
  186. package/dist/humain/remote/secure-channel.d.ts.map +1 -0
  187. package/dist/humain/remote/secure-channel.js +5 -0
  188. package/dist/humain/remote/secure-channel.js.map +1 -0
  189. package/dist/humain/remote/terminal.d.ts +48 -0
  190. package/dist/humain/remote/terminal.d.ts.map +1 -0
  191. package/dist/humain/remote/terminal.js +119 -0
  192. package/dist/humain/remote/terminal.js.map +1 -0
  193. package/dist/humain/remote/tickets.d.ts +35 -0
  194. package/dist/humain/remote/tickets.d.ts.map +1 -0
  195. package/dist/humain/remote/tickets.js +132 -0
  196. package/dist/humain/remote/tickets.js.map +1 -0
  197. package/dist/main.d.ts +1 -1
  198. package/dist/main.d.ts.map +1 -1
  199. package/dist/main.js +13 -1
  200. package/dist/main.js.map +1 -1
  201. package/dist/modes/interactive/components/account-picker.d.ts +31 -0
  202. package/dist/modes/interactive/components/account-picker.d.ts.map +1 -0
  203. package/dist/modes/interactive/components/account-picker.js +150 -0
  204. package/dist/modes/interactive/components/account-picker.js.map +1 -0
  205. package/dist/modes/interactive/interactive-mode.d.ts +15 -2
  206. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  207. package/dist/modes/interactive/interactive-mode.js +225 -36
  208. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  209. package/dist/modes/interactive/oauth-account-format.d.ts +9 -0
  210. package/dist/modes/interactive/oauth-account-format.d.ts.map +1 -1
  211. package/dist/modes/interactive/oauth-account-format.js +31 -22
  212. package/dist/modes/interactive/oauth-account-format.js.map +1 -1
  213. package/docs/cli.md +1 -1
  214. package/docs/forge-run-bootstrap.md +46 -0
  215. package/docs/humain-code.md +2 -2
  216. package/docs/index.md +2 -1
  217. package/docs/keybindings.md +10 -0
  218. package/docs/providers.md +2 -2
  219. package/docs/quickstart.md +16 -2
  220. package/docs/slash-commands.md +4 -2
  221. package/npm-shrinkwrap.json +2 -2
  222. package/package.json +1 -1
  223. package/schemas/keybindings.schema.json +12 -0
  224. package/dist/bundle/chunks/chunk-J5TSAJGC.js +0 -22
@@ -19,6 +19,15 @@ export type OAuthAccountUsageState = {
19
19
  export declare function formatSubscriptionCredits(credits: SubscriptionCreditsStatus | undefined): string;
20
20
  /** Concise per-account comparison from the same provider snapshot used by /usage. */
21
21
  export declare function formatSubscriptionAccountSummary(result: CodexUsageDetailsResult | AnthropicUsageResult | undefined): string;
22
+ export declare function subscriptionAccountUsage(result: CodexUsageDetailsResult | AnthropicUsageResult | undefined): {
23
+ expired: boolean;
24
+ weeklyLeft: number | undefined;
25
+ reset: string | undefined;
26
+ availability: ("allowed" | "blocked" | "unknown") | undefined;
27
+ savedResets: string;
28
+ paidCredits: string;
29
+ extraUsage: string | undefined;
30
+ };
22
31
  export declare function formatNextQuotaReset(windows: readonly {
23
32
  resetsAt?: number;
24
33
  }[], now?: number): string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-account-format.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/oauth-account-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAC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AM,CAmB7E;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAG7F"}
@@ -17,28 +17,37 @@ export function formatSubscriptionCredits(credits) {
17
17
  }
18
18
  /** Concise per-account comparison from the same provider snapshot used by /usage. */
19
19
  export function formatSubscriptionAccountSummary(result) {
20
- let weekly = formatOAuthAccountUsage({
21
- kind: "unavailable",
22
- ...(result?.status === "unavailable" ? { reason: result.reason } : {}),
23
- });
24
- if (result?.status !== "ok")
25
- return `${weekly}, saved resets: unavailable, paid credits: unavailable`;
26
- if ("fetchedAt" in result) {
27
- const window = result.windows.find((window) => window.id === "seven_day");
28
- if (window) {
29
- weekly = `weekly: ${Math.round(100 - window.usedPercent)}% left`;
30
- }
31
- const reset = formatNextQuotaReset(result.windows);
32
- if (reset)
33
- weekly += `, Next reset ${reset}`;
34
- }
35
- else if (result.usage) {
36
- weekly = formatOAuthAccountUsage({ kind: "available", ...result.usage });
37
- }
38
- const count = result.resets?.availableCount;
39
- const resets = count === undefined ? "unavailable" : count === 0 ? "none" : String(count);
40
- const enabled = result.credits?.enabled;
41
- return `${weekly}, saved resets: ${resets}, paid credits: ${formatSubscriptionCredits(result.credits)}${enabled === undefined ? "" : `, extra usage: ${enabled ? "enabled" : "disabled"}`}`;
20
+ const usage = subscriptionAccountUsage(result);
21
+ let weekly = usage.weeklyLeft === undefined
22
+ ? `weekly usage: unavailable${usage.expired ? " (sign-in expired)" : ""}`
23
+ : `weekly: ${usage.weeklyLeft}% left`;
24
+ if (usage.availability)
25
+ weekly += `, provider: ${usage.availability}`;
26
+ if (usage.reset)
27
+ weekly += usage.availability ? `, resets ${usage.reset}` : `, Next reset ${usage.reset}`;
28
+ return `${weekly}, saved resets: ${usage.savedResets}, paid credits: ${usage.paidCredits}${usage.extraUsage === undefined ? "" : `, extra usage: ${usage.extraUsage}`}`;
29
+ }
30
+ export function subscriptionAccountUsage(result) {
31
+ const ok = result?.status === "ok" ? result : undefined;
32
+ const claude = ok && "fetchedAt" in ok ? ok : undefined;
33
+ const codex = ok && "usage" in ok ? ok.usage : undefined;
34
+ const weekly = claude?.windows.find((window) => window.id === "seven_day");
35
+ const percent = weekly ? 100 - weekly.usedPercent : codex?.remainingPercent;
36
+ const count = ok?.resets?.availableCount;
37
+ const enabled = ok?.credits?.enabled;
38
+ return {
39
+ expired: result?.status === "unavailable" && result.reason === "expired_credential",
40
+ weeklyLeft: percent === undefined ? undefined : Math.round(percent),
41
+ reset: claude
42
+ ? formatNextQuotaReset(claude.windows)
43
+ : codex?.resetsAt === undefined
44
+ ? undefined
45
+ : formatOAuthAccountResetTime(codex.resetsAt),
46
+ availability: codex ? getCodexAvailability(codex) : undefined,
47
+ savedResets: count === undefined ? "unavailable" : count === 0 ? "none" : String(count),
48
+ paidCredits: formatSubscriptionCredits(ok?.credits),
49
+ extraUsage: enabled === undefined ? undefined : enabled ? "enabled" : "disabled",
50
+ };
42
51
  }
43
52
  export function formatNextQuotaReset(windows, now = Date.now()) {
44
53
  let nearest = Infinity;
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-account-format.js","sourceRoot":"","sources":["../../../src/modes/interactive/oauth-account-format.ts"],"names":[],"mappings":"AACA,OAAO,EAIN,oBAAoB,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,6BAA6B,EAAkC,MAAM,oCAAoC,CAAC;AASnH,uFAAuF;AACvF,MAAM,UAAU,yBAAyB,CAAC,OAA8C;IACvF,IAAI,OAAO,EAAE,SAAS,KAAK,IAAI;QAAE,OAAO,WAAW,CAAC;IACpD,IAAI,OAAO,EAAE,UAAU,KAAK,KAAK;QAAE,OAAO,MAAM,CAAC;IACjD,MAAM,OAAO,GAAG,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAChE,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,EAAE,IAAI,KAAK,SAAS;QAAE,OAAO,aAAa,CAAC;IAC/E,IAAI,MAAM,C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ACF,CAAC;AACF,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAAa,EAAE,KAA6B;IACpF,MAAM,SAAS,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC;IACjD,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,SAAS,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;AACtD,CAAC","sourcesContent":["import type { AnthropicUsageResult, AnthropicUsageUnavailableReason } from \"../../core/anthropic-subscription-usage.ts\";\nimport {\n\ttype CodexUsageDetailsResult,\n\ttype CodexUsageUnavailableReason,\n\ttype CodexWeeklyUsage,\n\tgetCodexAvailability,\n} from \"../../core/codex-usage.ts\";\nimport { parseSubscriptionCreditAmount, type SubscriptionCreditsStatus } from \"../../core/subscription-credits.ts\";\n\nexport type OAuthAccountUsageState =\n\t| { kind: \"none\" }\n\t| { kind: \"loading\" }\n\t| { kind: \"subscription\"; result: CodexUsageDetailsResult | AnthropicUsageResult | undefined; status?: string }\n\t| { kind: \"unavailable\"; reason?: CodexUsageUnavailableReason | AnthropicUsageUnavailableReason }\n\t| ({ kind: \"available\" } & CodexWeeklyUsage);\n\n/** Paid balance only: billing enablement and saved reset grants are separate facts. */\nexport function formatSubscriptionCredits(credits: SubscriptionCreditsStatus | undefined): string {\n\tif (credits?.unlimited === true) return \"unlimited\";\n\tif (credits?.hasCredits === false) return \"none\";\n\tconst balance = parseSubscriptionCreditAmount(credits?.balance);\n\tif (balance === undefined || credits?.unit === undefined) return \"unavailable\";\n\tif (Number(balance) === 0) return \"none\";\n\tconst [integer, fraction] = balance.split(\".\");\n\tconst amount = `${Number(integer).toLocaleString(\"en-US\")}${fraction === undefined ? \"\" : `.${fraction}`}`;\n\treturn credits.unit === \"USD\" ? `$${amount}` : `${amount} credits`;\n}\n\n/** Concise per-account comparison from the same provider snapshot used by /usage. */\nexport function formatSubscriptionAccountSummary(\n\tresult: CodexUsageDetailsResult | AnthropicUsageResult | undefined,\n): string {\n\tlet weekly = formatOAuthAccountUsage({\n\t\tkind: \"unavailable\",\n\t\t...(result?.status === \"unavailable\" ? { reason: result.reason } : {}),\n\t});\n\tif (result?.status !== \"ok\") return `${weekly}, saved resets: unavailable, paid credits: unavailable`;\n\tif (\"fetchedAt\" in result) {\n\t\tconst window = result.windows.find((window) => window.id === \"seven_day\");\n\t\tif (window) {\n\t\t\tweekly = `weekly: ${Math.round(100 - window.usedPercent)}% left`;\n\t\t}\n\t\tconst reset = formatNextQuotaReset(result.windows);\n\t\tif (reset) weekly += `, Next reset ${reset}`;\n\t} else if (result.usage) {\n\t\tweekly = formatOAuthAccountUsage({ kind: \"available\", ...result.usage });\n\t}\n\tconst count = result.resets?.availableCount;\n\tconst resets = count === undefined ? \"unavailable\" : count === 0 ? \"none\" : String(count);\n\tconst enabled = result.credits?.enabled;\n\treturn `${weekly}, saved resets: ${resets}, paid credits: ${formatSubscriptionCredits(result.credits)}${\n\t\tenabled === undefined ? \"\" : `, extra usage: ${enabled ? \"enabled\" : \"disabled\"}`\n\t}`;\n}\n\nexport function formatNextQuotaReset(windows: readonly { resetsAt?: number }[], now = Date.now()): string | undefined {\n\tlet nearest = Infinity;\n\tfor (const { resetsAt } of windows) {\n\t\tif (resetsAt !== undefined && resetsAt > now && resetsAt < nearest) nearest = resetsAt;\n\t}\n\treturn nearest === Infinity ? undefined : formatOAuthAccountResetTime(nearest);\n}\n\nexport function formatOAuthAccountResetTime(epochMs: number): string {\n\tconst date = new Date(epochMs);\n\tconst time = `${String(date.getHours()).padStart(2, \"0\")}:${String(date.getMinutes()).padStart(2, \"0\")}`;\n\treturn date.toDateString() === new Date().toDateString() ? time : `${time} on ${date.toLocaleDateString()}`;\n}\n\nexport function formatOAuthAccountUsage(usage: OAuthAccountUsageState): string {\n\tswitch (usage.kind) {\n\t\tcase \"none\":\n\t\t\treturn \"\";\n\t\tcase \"loading\":\n\t\t\treturn \"weekly usage: loading…\";\n\t\tcase \"subscription\":\n\t\t\treturn [usage.status, formatSubscriptionAccountSummary(usage.result)].filter(Boolean).join(\", \");\n\t\tcase \"unavailable\":\n\t\t\treturn usage.reason === \"expired_credential\"\n\t\t\t\t? \"weekly usage: unavailable (sign-in expired)\"\n\t\t\t\t: \"weekly usage: unavailable\";\n\t\tcase \"available\": {\n\t\t\tconst remaining = `weekly: ${Math.round(usage.remainingPercent)}% left, provider: ${getCodexAvailability(usage)}`;\n\t\t\treturn usage.resetsAt !== undefined\n\t\t\t\t? `${remaining}, resets ${formatOAuthAccountResetTime(usage.resetsAt)}`\n\t\t\t\t: remaining;\n\t\t}\n\t}\n}\n\nexport function formatOAuthAccountOption(label: string, usage: OAuthAccountUsageState): string {\n\tconst usageText = formatOAuthAccountUsage(usage);\n\treturn usageText ? `${label} (${usageText})` : label;\n}\n"]}
1
+ {"version":3,"file":"oauth-account-format.js","sourceRoot":"","sources":["../../../src/modes/interactive/oauth-account-format.ts"],"names":[],"mappings":"AACA,OAAO,EAIN,oBAAoB,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,6BAA6B,EAAkC,MAAM,oCAAoC,CAAC;AASnH,uFAAuF;AACvF,MAAM,UAAU,yBAAyB,CAAC,OAA8C;IACvF,IAAI,OAAO,EAAE,SAAS,KAAK,IAAI;QAAE,OAAO,WAAW,CAAC;IACpD,IAAI,OAAO,EAAE,UAAU,KAAK,KAAK;QAAE,OAAO,MAAM,CAAC;IACjD,MAAM,OAAO,GAAG,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAChE,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,EAAE,IAAI,KAAK,SAAS;QAAE,OAAO,aAAa,CAAC;IAC/E,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC;IACzC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC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AC,IAAI,EAAE,CAAC;QACpB,KAAK,MAAM;YACV,OAAO,EAAE,CAAC;QACX,KAAK,SAAS;YACb,OAAO,wBAAwB,CAAC;QACjC,KAAK,cAAc;YAClB,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,gCAAgC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClG,KAAK,aAAa;YACjB,OAAO,KAAK,CAAC,MAAM,KAAK,oBAAoB;gBAC3C,CAAC,CAAC,6CAA6C;gBAC/C,CAAC,CAAC,2BAA2B,CAAC;QAChC,KAAK,WAAW,EAAE,CAAC;YAClB,MAAM,SAAS,GAAG,WAAW,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,qBAAqB,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC;YAClH,OAAO,KAAK,CAAC,QAAQ,KAAK,SAAS;gBAClC,CAAC,CAAC,GAAG,SAAS,YAAY,2BAA2B,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;gBACvE,CAAC,CAAC,SAAS,CAAC;QACd,CAAC;IACF,CAAC;AACF,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAAa,EAAE,KAA6B;IACpF,MAAM,SAAS,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC;IACjD,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,SAAS,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;AACtD,CAAC","sourcesContent":["import type { AnthropicUsageResult, AnthropicUsageUnavailableReason } from \"../../core/anthropic-subscription-usage.ts\";\nimport {\n\ttype CodexUsageDetailsResult,\n\ttype CodexUsageUnavailableReason,\n\ttype CodexWeeklyUsage,\n\tgetCodexAvailability,\n} from \"../../core/codex-usage.ts\";\nimport { parseSubscriptionCreditAmount, type SubscriptionCreditsStatus } from \"../../core/subscription-credits.ts\";\n\nexport type OAuthAccountUsageState =\n\t| { kind: \"none\" }\n\t| { kind: \"loading\" }\n\t| { kind: \"subscription\"; result: CodexUsageDetailsResult | AnthropicUsageResult | undefined; status?: string }\n\t| { kind: \"unavailable\"; reason?: CodexUsageUnavailableReason | AnthropicUsageUnavailableReason }\n\t| ({ kind: \"available\" } & CodexWeeklyUsage);\n\n/** Paid balance only: billing enablement and saved reset grants are separate facts. */\nexport function formatSubscriptionCredits(credits: SubscriptionCreditsStatus | undefined): string {\n\tif (credits?.unlimited === true) return \"unlimited\";\n\tif (credits?.hasCredits === false) return \"none\";\n\tconst balance = parseSubscriptionCreditAmount(credits?.balance);\n\tif (balance === undefined || credits?.unit === undefined) return \"unavailable\";\n\tif (Number(balance) === 0) return \"none\";\n\tconst [integer, fraction] = balance.split(\".\");\n\tconst amount = `${Number(integer).toLocaleString(\"en-US\")}${fraction === undefined ? \"\" : `.${fraction}`}`;\n\treturn credits.unit === \"USD\" ? `$${amount}` : `${amount} credits`;\n}\n\n/** Concise per-account comparison from the same provider snapshot used by /usage. */\nexport function formatSubscriptionAccountSummary(\n\tresult: CodexUsageDetailsResult | AnthropicUsageResult | undefined,\n): string {\n\tconst usage = subscriptionAccountUsage(result);\n\tlet weekly =\n\t\tusage.weeklyLeft === undefined\n\t\t\t? `weekly usage: unavailable${usage.expired ? \" (sign-in expired)\" : \"\"}`\n\t\t\t: `weekly: ${usage.weeklyLeft}% left`;\n\tif (usage.availability) weekly += `, provider: ${usage.availability}`;\n\tif (usage.reset) weekly += usage.availability ? `, resets ${usage.reset}` : `, Next reset ${usage.reset}`;\n\treturn `${weekly}, saved resets: ${usage.savedResets}, paid credits: ${usage.paidCredits}${\n\t\tusage.extraUsage === undefined ? \"\" : `, extra usage: ${usage.extraUsage}`\n\t}`;\n}\n\nexport function subscriptionAccountUsage(result: CodexUsageDetailsResult | AnthropicUsageResult | undefined) {\n\tconst ok = result?.status === \"ok\" ? result : undefined;\n\tconst claude = ok && \"fetchedAt\" in ok ? ok : undefined;\n\tconst codex = ok && \"usage\" in ok ? ok.usage : undefined;\n\tconst weekly = claude?.windows.find((window) => window.id === \"seven_day\");\n\tconst percent = weekly ? 100 - weekly.usedPercent : codex?.remainingPercent;\n\tconst count = ok?.resets?.availableCount;\n\tconst enabled = ok?.credits?.enabled;\n\treturn {\n\t\texpired: result?.status === \"unavailable\" && result.reason === \"expired_credential\",\n\t\tweeklyLeft: percent === undefined ? undefined : Math.round(percent),\n\t\treset: claude\n\t\t\t? formatNextQuotaReset(claude.windows)\n\t\t\t: codex?.resetsAt === undefined\n\t\t\t\t? undefined\n\t\t\t\t: formatOAuthAccountResetTime(codex.resetsAt),\n\t\tavailability: codex ? getCodexAvailability(codex) : undefined,\n\t\tsavedResets: count === undefined ? \"unavailable\" : count === 0 ? \"none\" : String(count),\n\t\tpaidCredits: formatSubscriptionCredits(ok?.credits),\n\t\textraUsage: enabled === undefined ? undefined : enabled ? \"enabled\" : \"disabled\",\n\t};\n}\n\nexport function formatNextQuotaReset(windows: readonly { resetsAt?: number }[], now = Date.now()): string | undefined {\n\tlet nearest = Infinity;\n\tfor (const { resetsAt } of windows) {\n\t\tif (resetsAt !== undefined && resetsAt > now && resetsAt < nearest) nearest = resetsAt;\n\t}\n\treturn nearest === Infinity ? undefined : formatOAuthAccountResetTime(nearest);\n}\n\nexport function formatOAuthAccountResetTime(epochMs: number): string {\n\tconst date = new Date(epochMs);\n\tconst time = `${String(date.getHours()).padStart(2, \"0\")}:${String(date.getMinutes()).padStart(2, \"0\")}`;\n\treturn date.toDateString() === new Date().toDateString() ? time : `${time} on ${date.toLocaleDateString()}`;\n}\n\nexport function formatOAuthAccountUsage(usage: OAuthAccountUsageState): string {\n\tswitch (usage.kind) {\n\t\tcase \"none\":\n\t\t\treturn \"\";\n\t\tcase \"loading\":\n\t\t\treturn \"weekly usage: loading…\";\n\t\tcase \"subscription\":\n\t\t\treturn [usage.status, formatSubscriptionAccountSummary(usage.result)].filter(Boolean).join(\", \");\n\t\tcase \"unavailable\":\n\t\t\treturn usage.reason === \"expired_credential\"\n\t\t\t\t? \"weekly usage: unavailable (sign-in expired)\"\n\t\t\t\t: \"weekly usage: unavailable\";\n\t\tcase \"available\": {\n\t\t\tconst remaining = `weekly: ${Math.round(usage.remainingPercent)}% left, provider: ${getCodexAvailability(usage)}`;\n\t\t\treturn usage.resetsAt !== undefined\n\t\t\t\t? `${remaining}, resets ${formatOAuthAccountResetTime(usage.resetsAt)}`\n\t\t\t\t: remaining;\n\t\t}\n\t}\n}\n\nexport function formatOAuthAccountOption(label: string, usage: OAuthAccountUsageState): string {\n\tconst usageText = formatOAuthAccountUsage(usage);\n\treturn usageText ? `${label} (${usageText})` : label;\n}\n"]}
package/docs/cli.md CHANGED
@@ -55,7 +55,7 @@ RPC mode rejects `@file` arguments. JSON and RPC modes reserve stdout for protoc
55
55
 
56
56
  ## HUMAIN Code environment
57
57
 
58
- Use `--env dev|staging|stg|production` (default: production) before starting any mode or credential command. `stg` is an alias for `staging`. It selects only native provider `humain-code-account`: dev uses `https://code.dev.humain.com`, staging uses `https://code.stg.humain.com`, production uses `https://code.humain.com`. Invalid, missing or repeated values fail before network or credential access. No custom origin or fallback is accepted; independent providers are unchanged.
58
+ Use `--env dev|staging|stg|production|prod` (default: production) before starting any mode or credential command. `stg` is an alias for `staging`, and `prod` is an alias for `production`. It selects only native provider `humain-code-account`: dev uses `https://code.dev.humain.com`, staging uses `https://code.stg.humain.com`, production uses `https://code.humain.com`. Invalid, missing or repeated values fail before network or credential access. No custom origin or fallback is accepted; independent providers are unchanged.
59
59
 
60
60
  Native Code appears in `/login` only after a fresh public readiness check. Direct `/login humain-code-account` uses the same guard. Session-only consent, encrypted storage, bounded normal-exit revocation and removed legacy provider behavior are documented under [HUMAIN Code](providers.md#humain-code). Session-only grants do not survive a new CLI process; `--no-session` controls transcript persistence, not credential lifetime. Unconfirmed exit revocation goes to stderr, never JSON/RPC stdout.
61
61
 
@@ -0,0 +1,46 @@
1
+ # Forge run bootstrap (OFF in CLI 0.8.1)
2
+
3
+ EPIC13T is OFF by default and cannot be enabled by launch configuration. The
4
+ source-controlled private-channel qualification gate remains disabled until
5
+ DeployNow #176 supplies and qualifies private credential custody. The sandbox
6
+ marker is not attestation and an environment token is not a qualified channel.
7
+ No replacement channel is implemented or implied here.
8
+
9
+ When either `HUMAIN_CODE_FORGE_ORIGIN` or `HUMAIN_CODE_RUN_TOKEN` is present,
10
+ including empty values or case variants, bootstrap removes both variables and
11
+ fails closed before CLI setup/resource loading/child launch. Even a syntactically
12
+ valid token, canonical origin and `HUMAIN_CODE_SANDBOX=1` cannot authorize a run.
13
+ With neither variable, normal desktop startup remains unchanged. Scrubbing does
14
+ not protect the original launch environment from process inspection; launchers
15
+ must not inject tokens through this unqualified path.
16
+
17
+ Never put a token in argv, logs, or shared files. Do not enable the Forge flag
18
+ based on these tests. Reopening admission requires implementing and qualifying
19
+ the private channel from DeployNow #176, not merely changing the gate or adding
20
+ an environment override. No npm release or version bump is included.
21
+
22
+ The dormant implementation is retained for future integration. It compares
23
+ origins literally against the built-in destinations:
24
+
25
+ - `https://code.dev.humain.com`
26
+ - `https://code.stg.humain.com`
27
+ - `https://code.humain.com`
28
+
29
+ No paths, trailing slash, explicit port, URL credentials, query or fragment are
30
+ accepted. Only the native `humain-code-account` provider has send authority, for
31
+ `GET /api/inference/models` and `POST /api/inference/messages`. Redirects are
32
+ refused, cookies omitted, and the account store, account sign-in, provider-key
33
+ fallback and provider metadata are not used. The session/model registry are in
34
+ memory, with automatic retries disabled. Forge remains authoritative for scope,
35
+ expiry, revocation and metering.
36
+
37
+ The retained path targets Node single-shot `-p` or `--mode json`, one literal
38
+ prompt, and an explicit exact catalog model. Extensions, project resources and
39
+ subagent execution are disabled. Bun, RPC, frozen admission and Flow fail closed
40
+ before inference. Flow worker custody and Build artifact compatibility remain
41
+ unqualified. These are implementation constraints, not supported launch modes
42
+ while the gate is disabled.
43
+
44
+ A 401 from Forge is reported as an expired or revoked Build token (no retry, no
45
+ fallback, token never printed). Ambient `SYSTEM.md` and `APPEND_SYSTEM.md` in the
46
+ agent directory or project are not loaded into the session.
@@ -1,6 +1,6 @@
1
1
  # HUMAIN Code CLI
2
2
 
3
- HUMAIN Code CLI is the branded distribution of the coding agent. The primary command is `humain-code`; `humain-code-cli`, `humain`, `hc`, `hcc`, and `ht` are executable aliases for the same CLI. The old `humain-terminal` command still works but is deprecated: it prints `humain-terminal is deprecated; use humain-code.` to stderr (suppress with `HUMAIN_SUPPRESS_DEPRECATION=1`; never printed with `--mode json`, `--mode rpc`, `--mode agent-exec`, or `-p` with piped stdout). See [Migrating to humain-code](../../../docs/migration-humain-code.md#compatibility) for what keeps the old name.
3
+ HUMAIN Code CLI is the branded distribution of the coding agent. The primary command is `humain-code`; `humain-code-cli`, `humain`, `hc`, `hcc`, `hcode`, and `ht` are executable aliases for the same CLI. The old `humain-terminal` command still works but is deprecated: it prints `humain-terminal is deprecated; use humain-code.` to stderr (suppress with `HUMAIN_SUPPRESS_DEPRECATION=1`; never printed with `--mode json`, `--mode rpc`, `--mode agent-exec`, or `-p` with piped stdout). See [Migrating to humain-code](../../../docs/migration-humain-code.md#compatibility) for what keeps the old name.
4
4
 
5
5
  ## Config
6
6
 
@@ -83,7 +83,7 @@ Sending `normal mode` as the whole message disables all three for the session. A
83
83
 
84
84
  ## Native HUMAIN Code
85
85
 
86
- Use `/login` → **Sign in with HUMAIN**. Provider `humain-code-account` is presented as **HUMAIN Code** in production (the default), **HUMAIN Code (DEV)** with `--env dev`, or **HUMAIN Code (STG)** with `--env staging` (alias `stg`). The menu orders Code, Node, Gateway, Fuse. Code shows `checking connection…` until the selected environment's sign-in configuration is verified; if unavailable, the entry gives a reason and offers Retry. Incompatible sign-in settings offer Details instead. If production sign-in is unavailable, the CLI does not switch to DEV. Direct `/login humain-code-account` checks readiness too. Startup and unrelated providers do not wait for native readiness or private account discovery.
86
+ Use `/login` → **Sign in with HUMAIN**. Provider `humain-code-account` is presented as **HUMAIN Code** in production (the default), **HUMAIN Code (Dev)** with `--env dev`, or **HUMAIN Code (Staging)** with `--env staging` (alias `stg`). The menu orders Code, Node, Gateway, Fuse. Code shows `checking connection…` until the selected environment's sign-in configuration is verified; if unavailable, the entry gives a reason and offers Retry. Incompatible sign-in settings offer Details instead. If production sign-in is unavailable, the CLI does not switch to DEV. Direct `/login humain-code-account` checks readiness too. Startup and unrelated providers do not wait for native readiness or private account discovery.
87
87
 
88
88
  Native login uses browser/device authorization and MFA, not an API key. Persistent grants use encrypted private account files and an OS-keychain purpose key. If the secure keychain is unavailable, explicit session-only consent is offered before acquiring a grant. Nothing from that sign-in is saved; normal interactive, print, JSON and RPC exits attempt one bounded device-family revocation within 3,000 ms. Unconfirmed revocation is reported on stderr; a crash leaves validity until expiry. Persistent accounts survive ordinary exit. See [HUMAIN Code setup](providers.md#humain-code) for environments, storage boundaries, Retry/Cancel and activation limits.
89
89
 
package/docs/index.md CHANGED
@@ -6,7 +6,7 @@ Use HUMAIN Code CLI for software development, research notes, writing projects,
6
6
 
7
7
  ## Start using HUMAIN Code CLI
8
8
 
9
- New to HUMAIN Code CLI? Follow the [Quickstart](quickstart.md) to install HUMAIN Code CLI, connect a model, and complete your first task.
9
+ New to HUMAIN Code CLI? Follow the [Quickstart](quickstart.md) to install HUMAIN Code CLI, connect a model, make a small change, and review your first diff.
10
10
 
11
11
  If HUMAIN Code CLI is already installed, choose what you want to do:
12
12
 
@@ -27,6 +27,7 @@ Use the [Quickstart customization chooser](quickstart.md#choose-how-to-customize
27
27
  - Use [JSON event stream mode](json.md) to consume structured events from one run.
28
28
  - Use [RPC mode](rpc.md) to control a separate HUMAIN Code CLI process.
29
29
  - Check [headless admission and terminal outcomes](run-preflight.md) before relying on exit codes or automated completion.
30
+ - Read the [Forge run bootstrap](forge-run-bootstrap.md) for the sandbox-only Build-token start.
30
31
  - Use the [TypeScript SDK](sdk.md) to run HUMAIN Code CLI inside an application.
31
32
 
32
33
  ## Find reference and setup information
@@ -182,6 +182,16 @@ To keep `Tab` exclusively for completion, disable the busy-only action:
182
182
 
183
183
  You can also rebind this action independently of `tui.input.tab` and `app.message.followUp`.
184
184
 
185
+ ### Account Picker
186
+
187
+ In `/accounts`, use the select movement and confirm keys to highlight and use an account or open a list action. Page Up/Page Down scroll the highlighted item's details.
188
+
189
+ | Keybinding id | Default | Description |
190
+ |--------|---------|-------------|
191
+ | `app.accounts.reconnect` | `r` | Re-sign in to the selected account |
192
+ | `app.accounts.remove` | `d` | Review removal of the selected account; requires confirmation |
193
+ | `app.accounts.more` | `m` | Open more actions for the selected account |
194
+
185
195
  ### Usage Popup
186
196
 
187
197
  Used inside `/usage`'s full-terminal overlay, independent of extension widgets and input dock height. Accounts is the default when saved Codex or Claude accounts exist; otherwise Session opens.
package/docs/providers.md CHANGED
@@ -261,7 +261,7 @@ To use a service-account key file instead, set `GOOGLE_APPLICATION_CREDENTIALS`
261
261
 
262
262
  ## HUMAIN Code
263
263
 
264
- Native provider `humain-code-account` is shown as **HUMAIN Code** in production, **HUMAIN Code (DEV)** in dev, and **HUMAIN Code (STG)** in staging. Under **Sign in with HUMAIN**, order is Code, Node, Gateway, Fuse. All entries render at once. Code shows `checking connection…` (greyed) until the selected environment's `/api/cli/config` proves the complete qualified native device/issuer/audience/scopes/expiry/revocation profile and the issuer's discovery document matches it; it then shows `✓ connected`. HUMAIN Code CLI starts this check at startup and reuses a ready result for 5 minutes, so the menu is usually already connected; otherwise opening the menu checks again and updates it without losing search or selection. Selecting Code while the check runs waits inline with a spinner and continues to sign-in when it succeeds. Failures never block independent providers and name the cause:
264
+ Native provider `humain-code-account` is shown as **HUMAIN Code** in production, **HUMAIN Code (Dev)** in dev, and **HUMAIN Code (Staging)** in staging. Under **Sign in with HUMAIN**, order is Code, Node, Gateway, Fuse. All entries render at once. Code shows `checking connection…` (greyed) until the selected environment's `/api/cli/config` proves the complete qualified native device/issuer/audience/scopes/expiry/revocation profile and the issuer's discovery document matches it; it then shows `✓ connected`. HUMAIN Code CLI starts this check at startup and reuses a ready result for 5 minutes, so the menu is usually already connected; otherwise opening the menu checks again and updates it without losing search or selection. Selecting Code while the check runs waits inline with a spinner and continues to sign-in when it succeeds. Failures never block independent providers and name the cause:
265
265
 
266
266
  - `✗ Can't reach <host>: check VPN/Zscaler [Retry]`: DNS, connection, TLS, timeout or a server error. Enter retries and continues when ready.
267
267
  - `✗ Server sign-in settings don't match this CLI version [Details]`: the server answered with settings this CLI does not accept. Enter explains: update the CLI, or ask the HUMAIN Code platform team to check the server's CLI sign-in configuration.
@@ -277,7 +277,7 @@ Only genuine keychain unavailability permits the prompt **Secure keychain unavai
277
277
 
278
278
  Normal interactive, print, JSON and RPC completion attempts one device-family revocation within 3,000 ms before erasing memory. Persistent login is not revoked on ordinary exit. Unconfirmed revocation writes only to stderr: `HUMAIN Code session revocation could not be confirmed. The session will expire automatically.` There is no disk revoke spool or background retry. Crashes and network loss do not guarantee revocation; qualified short expiry and isolated-family revocation require separate live activation evidence.
279
279
 
280
- After sign-in, use `/model` to choose an approved native model; login does not change your current model. If the account has no models yet, sign-in still succeeds and you return to the prompt with a notice; the current model is kept and other providers stay usable. The notice says why and who can fix it when Forge sends a reason: no model is approved for CLI (ask an admin to set a model to Web + CLI or CLI only in Settings > Model Access), the provider key isn't enabled for CLI (ask an admin to enable CLI on the key in Settings > Provider Keys), or this server hasn't finished CLI setup for the approved models (ask an admin to report it to the HUMAIN Code platform team). Without a reason it says your admin hasn't enabled CLI models yet; a load failure says the model list couldn't be loaded and to check your network, VPN or Zscaler. The status line shows `HUMAIN Code: signed in · 0 models`. HUMAIN Code CLI checks again every 60 seconds for 10 minutes, then only when `/model` opens, and announces `N HUMAIN Code models are now available` when they appear. `/model` lists the account as `HUMAIN Code (DEV) · 0 available: <reason> [Retry]`; Enter on that row reloads it. `/login status` shows the account, model count, reason and sign-in server check. If the list becomes empty in the account picker opened after a fresh sign-in, it shows the same reasons with Retry/Cancel.
280
+ After sign-in, use `/model` to choose an approved native model; login does not change your current model. If the account has no models yet, sign-in still succeeds and you return to the prompt with a notice; the current model is kept and other providers stay usable. The notice says why and who can fix it when Forge sends a reason: no model is approved for CLI (ask an admin to set a model to Web + CLI or CLI only in Settings > Model Access), the provider key isn't enabled for CLI (ask an admin to enable CLI on the key in Settings > Provider Keys), or this server hasn't finished CLI setup for the approved models (ask an admin to report it to the HUMAIN Code platform team). Without a reason it says your admin hasn't enabled CLI models yet; a load failure says the model list couldn't be loaded and to check your network, VPN or Zscaler. The status line shows `HUMAIN Code: signed in · 0 models`. HUMAIN Code CLI checks again every 60 seconds for 10 minutes, then only when `/model` opens, and announces `N HUMAIN Code models are now available` when they appear. `/model` lists the account as `HUMAIN Code (Dev) · 0 available: <reason> [Retry]`; Enter on that row reloads it. `/login status` shows the account, model count, reason and sign-in server check. If the list becomes empty in the account picker opened after a fresh sign-in, it shows the same reasons with Retry/Cancel.
281
281
 
282
282
  Native inference uses the managed `pi-messages` transport at the selected origin's `/api/inference/messages`. The account owner adds authorization only at final dispatch. Each invocation submits once, with no automatic inference retry, account/model fallback, or response replay. Stream queue overflow cancels the request; an ambiguous outcome may still charge, so check `/usage` before retrying manually.
283
283
 
@@ -58,11 +58,25 @@ Run `/model` afterward to choose a model: **Enter** uses it for this session, an
58
58
 
59
59
  See [Choose a model and provider](models.md) for supported providers, environment-variable authentication, local models, and custom endpoints.
60
60
 
61
- ## 4. Give HUMAIN Code CLI a task
61
+ ## 4. Make a small change and review the diff
62
62
 
63
63
  HUMAIN Code CLI shows each file read, search, command, and edit it performs. It does not ask before every tool call.
64
64
 
65
- Enter a task that matches your work, for example:
65
+ For a first run, use a disposable Git repository with a committed `README.md` containing the heading `# Demo`. In HUMAIN Code CLI, enter:
66
+
67
+ ```text
68
+ Change only the heading in README.md from Demo to My first CLI change.
69
+ ```
70
+
71
+ After the response, run this from the repository in another terminal or after exiting the CLI:
72
+
73
+ ```bash
74
+ git diff -- README.md
75
+ ```
76
+
77
+ Check that the diff shows only the heading change. If it shows anything else, inspect it before keeping or committing the change.
78
+
79
+ For other tasks, try:
66
80
 
67
81
  ```text
68
82
  Summarize @meeting-notes.md and save the action items to action-items.md.
@@ -34,7 +34,7 @@ Extensions, prompt templates, and skills can add commands. The command menu in H
34
34
 
35
35
  ### /usage
36
36
 
37
- In interactive mode, `/usage` opens a full-terminal overlay through `ctx.ui.custom`, independent of extension widgets and input dock height. It defaults to **Accounts** when saved Codex or Claude OAuth accounts exist, otherwise **Session**. Accounts appear in a provider-grouped list with selected-account details, not a truncated tab strip. They are shown regardless of the selected model, provider or API-key use. These are subscription limits, not API-key quotas; other providers' subscription limits are not shown. **Session** shows tokens, cost, context use and duration.
37
+ In interactive mode, `/usage` opens a full-terminal overlay through `ctx.ui.custom`, independent of extension widgets and input dock height. It and its confirmation dialogs hide the chat until closed. It defaults to **Accounts** when saved Codex or Claude OAuth accounts exist, otherwise **Session**. Accounts appear in a provider-grouped list with selected-account details, not a truncated tab strip. They are shown regardless of the selected model, provider or API-key use. These are subscription limits, not API-key quotas; other providers' subscription limits are not shown. **Session** shows tokens, cost, context use and duration.
38
38
 
39
39
  `humain-code -p "/usage"` prints an aligned, read-only snapshot of session statistics and every saved Codex and Claude account's reported limits. `humain-code --mode json "/usage"` emits a JSONL record with `type: "usage"`, `session` and `accounts`; each account includes its label, active status and complete usage overview. Noninteractive snapshots cannot redeem resets, open billing pages or switch accounts. RPC does not support this command.
40
40
 
@@ -79,7 +79,9 @@ Confirmed redemption refreshes that account's usage. Only fresh, explicitly prov
79
79
 
80
80
  ### /accounts
81
81
 
82
- `/accounts` retains account management and cooldown recovery. Its Codex and Claude account summaries share `/usage`'s weekly allowance, saved-reset and paid-credit interpretation. Missing values remain unavailable; Claude extra-usage enablement is separate from purchased credits. Refreshing Codex availability retains guarded cooldown recovery: only fresh provider-allowed limits can clear an unchanged saved cooldown, without selecting a different account. Adding, selecting and removing accounts remain explicit management actions; `/usage` never performs them.
82
+ `/accounts` shows a compact account list and details for the highlighted item, side by side at 76 columns or wider and stacked below that. Use Up/Down to move, Page Up/Page Down to scroll details, and Enter to use an account for future requests or open a highlighted list action. The default shortcuts are R to re-sign in, D to review removal (a separate confirmation), and M for more actions such as rename and Claude usage refresh. Add another account and Provider policy remain list actions. Highlighting an account never switches to it. The picker keeps full account labels and wraps status when needed. Both views group only provider-verified identity aliases, never accounts that merely share an email. On login, an expired alias is removed only if the same refresh token is represented by a live credential; independently refreshable slots are retained. Its Codex and Claude account summaries share `/usage`'s weekly allowance, saved-reset and paid-credit interpretation. Missing values remain unavailable; Claude extra-usage enablement is separate from purchased credits. Refreshing Codex availability retains guarded cooldown recovery: only fresh provider-allowed limits can clear an unchanged saved cooldown, without selecting a different account. Adding, selecting and removing accounts remain explicit management actions; `/usage` never performs them.
83
+
84
+ If browser sign-in returns a different known account or workspace, re-sign-in stops without replacing the selected credential. Sign in to the selected account or use **Add another account** to save a separate login.
83
85
 
84
86
  ## Export and share
85
87
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@humain/humain-code",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@humain/humain-code",
9
- "version": "0.8.0",
9
+ "version": "0.8.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@humain/humain-code-contracts": "0.4.22",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humain/humain-code",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "humainTerminalConfig": {
@@ -279,6 +279,18 @@
279
279
  "$ref": "#/$defs/KeybindingValue",
280
280
  "description": "Reconnect the selected Claude account"
281
281
  },
282
+ "app.accounts.reconnect": {
283
+ "$ref": "#/$defs/KeybindingValue",
284
+ "description": "Re-sign in to the selected account"
285
+ },
286
+ "app.accounts.remove": {
287
+ "$ref": "#/$defs/KeybindingValue",
288
+ "description": "Review removal of the selected account"
289
+ },
290
+ "app.accounts.more": {
291
+ "$ref": "#/$defs/KeybindingValue",
292
+ "description": "Open more actions for the selected account"
293
+ },
282
294
  "app.thinking.toggle": {
283
295
  "$ref": "#/$defs/KeybindingValue",
284
296
  "description": "Toggle thinking blocks"
@@ -1,22 +0,0 @@
1
- import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{theme}from"./chunk-KONLZKPL.js";import{Key,KeybindingsManager,TUI_KEYBINDINGS}from"./chunk-WBSGWISD.js";import{Compile}from"./chunk-VCMXBP5S.js";import{typebox_exports}from"./chunk-VEGJT52D.js";import{getAgentDir,stripBom}from"./chunk-VFLVWPLZ.js";function areExperimentalFeaturesEnabled(){return process.env.PI_EXPERIMENTAL==="1"}import{existsSync,readFileSync}from"fs";import{join}from"path";var modifiers=["ctrl","shift","alt","super"],baseKeyPattern=`(?:[a-z0-9]|${Object.values(Key).flatMap(value=>typeof value=="string"?[value.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")]:[]).join("|")})`,duplicateModifierPattern=modifiers.map(modifier=>`${modifier}\\+.*${modifier}\\+`).join("|"),KeyIdSchema=typebox_exports.Unsafe(typebox_exports.String({pattern:`^(?!.*(?:${duplicateModifierPattern}))(?:(?:${modifiers.join("|")})\\+){0,4}${baseKeyPattern}$`,description:"Key identifier with optional ctrl, \
3
- shift, alt, or super modifiers."}));function keybindingValueSchema(options){return typebox_exports.Union([KeyIdSchema,typebox_exports.Array(KeyIdSchema)],options)}var KeybindingValueSchema=keybindingValueSchema();function useWindowsKeybindings(platform=process.platform,env=process.env){return platform==="win32"||platform==="linux"&&!!(env.WSL_DISTRO_NAME||env.WSL_INTEROP)}var windowsKeybindings=useWindowsKeybindings(),APP_KEYBINDINGS={"app.interrupt":{defaultKeys:"escape",description:"Cancel or abort"},"app.clear":{defaultKeys:"ctrl+c",description:"Clear editor"},"app.exit":{defaultKeys:"ctrl+d",description:"Exit when editor is empty"},"app.suspend":{defaultKeys:process.platform==="win32"?[]:"ctrl+z",description:"\
4
- Suspend to background"},"app.thinking.cycle":{defaultKeys:"shift+tab",description:"Cycle thinking level"},"app.thinking.save":{defaultKeys:"ctrl+s",description:"Save thinking level"},"app.model.cycleForward":{defaultKeys:"ctrl+p",description:"Cycle to next model"},"app.model.cycleBackward":{defaultKeys:windowsKeybindings?"alt+p":"shift+ctrl+p",description:"Cycle to previous model"},"app.model.select":{defaultKeys:"ctrl+l",description:"Open model selector"},"app.tools.expand":{defaultKeys:"ctrl+o",
5
- description:"Toggle tool output"},"app.select.upAlternate":{defaultKeys:"k",description:"Alternate up key in Trust and Extension selectors"},"app.select.downAlternate":{defaultKeys:"j",description:"Alternate down key in Trust and Extension selectors"},"app.usage.nextTab":{defaultKeys:["tab","right"],description:"Next usage account"},"app.usage.previousTab":{defaultKeys:["shift+tab","left"],description:"Previous usage account"},"app.usage.showAccounts":{defaultKeys:"a",description:"Show subscript\
6
- ion accounts"},"app.usage.toggleDetails":{defaultKeys:"d",description:"Toggle recent HUMAIN Code requests"},"app.usage.showSession":{defaultKeys:"s",description:"Show session usage"},"app.usage.reset":{defaultKeys:"r",description:"Check or use a saved reset"},"app.usage.billing":{defaultKeys:"b",description:"Open provider billing settings"},"app.usage.refresh":{defaultKeys:"f",description:"Refresh Claude account usage"},"app.usage.reconnect":{defaultKeys:"c",description:"Reconnect the selected C\
7
- laude account"},"app.thinking.toggle":{defaultKeys:"ctrl+t",description:"Toggle thinking blocks"},"app.session.toggleNamedFilter":{defaultKeys:"ctrl+n",description:"Toggle named session filter"},"app.editor.external":{defaultKeys:"ctrl+g",description:"Open external editor"},"app.message.copy":{defaultKeys:"ctrl+x",description:"Copy selection or last assistant message"},"app.block.copy":{defaultKeys:"ctrl+alt+c",description:"Choose an assistant fenced block to copy"},"app.message.followUp":{defaultKeys:windowsKeybindings?
8
- "ctrl+q":"alt+enter",description:"Queue follow-up message"},"app.message.followUpWhileBusy":{defaultKeys:"tab",description:"Queue follow-up while busy (autocomplete takes precedence)"},"app.message.dequeue":{defaultKeys:windowsKeybindings?"alt+q":"alt+up",description:"Restore queued messages"},"app.clipboard.pasteImage":{defaultKeys:windowsKeybindings?["alt+v","ctrl+v"]:"ctrl+v",description:"Paste files on macOS, images, or text from clipboard"},"app.session.new":{defaultKeys:[],description:"Sta\
9
- rt a new session"},"app.session.tree":{defaultKeys:[],description:"Open session tree"},"app.session.fork":{defaultKeys:[],description:"Fork current session"},"app.session.resume":{defaultKeys:[],description:"Resume a session"},"app.tree.foldOrUp":{defaultKeys:process.platform==="darwin"?["alt+left","ctrl+left"]:["ctrl+left","alt+left"],description:"Fold tree branch or move up"},"app.tree.unfoldOrDown":{defaultKeys:process.platform==="darwin"?["alt+right","ctrl+right"]:["ctrl+right","alt+right"],
10
- description:"Unfold tree branch or move down"},"app.tree.editLabel":{defaultKeys:"shift+l",description:"Edit tree label"},"app.tree.toggleLabelTimestamp":{defaultKeys:"shift+t",description:"Toggle tree label timestamps"},"app.session.togglePath":{defaultKeys:"ctrl+p",description:"Toggle session path display"},"app.session.toggleSort":{defaultKeys:"ctrl+s",description:"Toggle session sort mode"},"app.session.rename":{defaultKeys:"ctrl+r",description:"Rename session"},"app.session.delete":{defaultKeys:"\
11
- ctrl+d",description:"Delete session"},"app.session.deleteNoninvasive":{defaultKeys:"ctrl+backspace",description:"Delete session when query is empty"},"app.models.save":{defaultKeys:"ctrl+s",description:"Save model selection"},"app.models.enableAll":{defaultKeys:"ctrl+a",description:"Enable all models"},"app.models.clearAll":{defaultKeys:"ctrl+x",description:"Clear all models"},"app.models.toggleProvider":{defaultKeys:"ctrl+p",description:"Toggle all models for provider"},"app.models.reorderUp":{
12
- defaultKeys:"alt+up",description:"Move model up in order"},"app.models.reorderDown":{defaultKeys:"alt+down",description:"Move model down in order"},"app.tree.filter.default":{defaultKeys:"ctrl+d",description:"Tree filter: default view"},"app.tree.filter.noTools":{defaultKeys:"ctrl+t",description:"Tree filter: hide tool results"},"app.tree.filter.userOnly":{defaultKeys:"ctrl+u",description:"Tree filter: user messages only"},"app.tree.filter.labeledOnly":{defaultKeys:"ctrl+l",description:"Tree fil\
13
- ter: labeled entries only"},"app.tree.filter.all":{defaultKeys:"ctrl+a",description:"Tree filter: show all entries"},"app.tree.filter.cycleForward":{defaultKeys:"ctrl+o",description:"Tree filter: cycle forward"},"app.tree.filter.cycleBackward":{defaultKeys:"shift+ctrl+o",description:"Tree filter: cycle backward"}},KEYBINDINGS={...TUI_KEYBINDINGS,"tui.editor.undo":{...TUI_KEYBINDINGS["tui.editor.undo"],defaultKeys:process.platform==="win32"?"ctrl+z":windowsKeybindings?"alt+z":"ctrl+-"},"tui.altSc\
14
- reen.previousPrompt":{...TUI_KEYBINDINGS["tui.altScreen.previousPrompt"],defaultKeys:windowsKeybindings?"ctrl+up":["ctrl+shift+up","ctrl+up"]},"tui.altScreen.nextPrompt":{...TUI_KEYBINDINGS["tui.altScreen.nextPrompt"],defaultKeys:windowsKeybindings?"ctrl+down":["ctrl+shift+down","ctrl+down"]},"tui.altScreen.search":{...TUI_KEYBINDINGS["tui.altScreen.search"],defaultKeys:windowsKeybindings?"ctrl+f":"ctrl+shift+f"},...APP_KEYBINDINGS},KEYBINDING_NAME_MIGRATIONS={cursorUp:"tui.editor.cursorUp",cursorDown:"\
15
- tui.editor.cursorDown",cursorLeft:"tui.editor.cursorLeft",cursorRight:"tui.editor.cursorRight",cursorWordLeft:"tui.editor.cursorWordLeft",cursorWordRight:"tui.editor.cursorWordRight",cursorLineStart:"tui.editor.cursorLineStart",cursorLineEnd:"tui.editor.cursorLineEnd",jumpForward:"tui.editor.jumpForward",jumpBackward:"tui.editor.jumpBackward",pageUp:"tui.editor.pageUp",pageDown:"tui.editor.pageDown",deleteCharBackward:"tui.editor.deleteCharBackward",deleteCharForward:"tui.editor.deleteCharForwar\
16
- d",deleteWordBackward:"tui.editor.deleteWordBackward",deleteWordForward:"tui.editor.deleteWordForward",deleteToLineStart:"tui.editor.deleteToLineStart",deleteToLineEnd:"tui.editor.deleteToLineEnd",yank:"tui.editor.yank",yankPop:"tui.editor.yankPop",undo:"tui.editor.undo",newLine:"tui.input.newLine",submit:"tui.input.submit",tab:"tui.input.tab",copy:"tui.input.copy",selectUp:"tui.select.up",selectDown:"tui.select.down",selectPageUp:"tui.select.pageUp",selectPageDown:"tui.select.pageDown",selectConfirm:"\
17
- tui.select.confirm",selectCancel:"tui.select.cancel",interrupt:"app.interrupt",clear:"app.clear",exit:"app.exit",suspend:"app.suspend",cycleThinkingLevel:"app.thinking.cycle",cycleModelForward:"app.model.cycleForward",cycleModelBackward:"app.model.cycleBackward",selectModel:"app.model.select",expandTools:"app.tools.expand",toggleThinking:"app.thinking.toggle",toggleSessionNamedFilter:"app.session.toggleNamedFilter",externalEditor:"app.editor.external",followUp:"app.message.followUp",dequeue:"app\
18
- .message.dequeue",pasteImage:"app.clipboard.pasteImage",newSession:"app.session.new",tree:"app.session.tree",fork:"app.session.fork",resume:"app.session.resume",treeFoldOrUp:"app.tree.foldOrUp",treeUnfoldOrDown:"app.tree.unfoldOrDown",treeEditLabel:"app.tree.editLabel",treeToggleLabelTimestamp:"app.tree.toggleLabelTimestamp",toggleSessionPath:"app.session.togglePath",toggleSessionSort:"app.session.toggleSort",renameSession:"app.session.rename",deleteSession:"app.session.delete",deleteSessionNoninvasive:"\
19
- app.session.deleteNoninvasive"};function isLegacyKeybindingName(key){return key in KEYBINDING_NAME_MIGRATIONS}var keybindingValueValidator;function toKeybindingsConfig(value){let config={};for(let[key,binding]of Object.entries(value))key!=="$schema"&&(keybindingValueValidator??=Compile(KeybindingValueSchema),keybindingValueValidator.Check(binding)&&(config[key]=binding));return config}function migrateKeybindingsConfig(rawConfig){let config={},migrated=!1;for(let[key,value]of Object.entries(rawConfig)){
20
- let nextKey=isLegacyKeybindingName(key)?KEYBINDING_NAME_MIGRATIONS[key]:key;if(nextKey!==key&&(migrated=!0),key!==nextKey&&Object.hasOwn(rawConfig,nextKey)){migrated=!0;continue}config[nextKey]=value}return{config:orderKeybindingsConfig(config),migrated}}function orderKeybindingsConfig(config){let ordered={};for(let keybinding of Object.keys(KEYBINDINGS))Object.hasOwn(config,keybinding)&&(ordered[keybinding]=config[keybinding]);let extras=Object.keys(config).filter(key=>!Object.hasOwn(ordered,key)).
21
- sort();for(let key of extras)ordered[key]=config[key];return ordered}function loadRawConfig(path){if(existsSync(path))try{let parsed=JSON.parse(stripBom(readFileSync(path,"utf-8")));return typeof parsed!="object"||parsed===null?void 0:parsed}catch{return}}var KeybindingsManager2=class _KeybindingsManager extends KeybindingsManager{configPath;constructor(userBindings={},configPath){super(KEYBINDINGS,userBindings),this.configPath=configPath}static create(agentDir=getAgentDir()){let configPath=join(
22
- agentDir,"keybindings.json"),userBindings=_KeybindingsManager.loadFromFile(configPath);return new _KeybindingsManager(userBindings,configPath)}reload(){this.configPath&&this.setUserBindings(_KeybindingsManager.loadFromFile(this.configPath))}getEffectiveConfig(){return this.getResolvedBindings()}static loadFromFile(path){let rawConfig=loadRawConfig(path);return rawConfig?toKeybindingsConfig(migrateKeybindingsConfig(rawConfig).config):{}}};var DynamicBorder=class{color;constructor(color=str=>theme.fg("border",str)){this.color=color}invalidate(){}render(width){return[this.color("\u2500".repeat(Math.max(1,width)))]}};function flushStdout(){return new Promise(resolve=>{let finish=error=>{clearTimeout(timer),error||process.stdout.off("error",finish),resolve()},timer=setTimeout(finish,1e3);process.stdout.on("error",finish),process.stdout.write("",finish)})}export{areExperimentalFeaturesEnabled,migrateKeybindingsConfig,KeybindingsManager2 as KeybindingsManager,DynamicBorder,flushStdout};