@cuna_labs/cli 0.1.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 (624) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +9 -0
  3. package/README.md +169 -0
  4. package/THIRD_PARTY_NOTICES.md +29 -0
  5. package/dist/api/capability-evidence.d.ts +19 -0
  6. package/dist/api/capability-evidence.d.ts.map +1 -0
  7. package/dist/api/capability-evidence.js +38 -0
  8. package/dist/api/capability-evidence.js.map +1 -0
  9. package/dist/api/client.d.ts +167 -0
  10. package/dist/api/client.d.ts.map +1 -0
  11. package/dist/api/client.js +937 -0
  12. package/dist/api/client.js.map +1 -0
  13. package/dist/api/contracts.d.ts +345 -0
  14. package/dist/api/contracts.d.ts.map +1 -0
  15. package/dist/api/contracts.js +976 -0
  16. package/dist/api/contracts.js.map +1 -0
  17. package/dist/api/execution-workspaces.d.ts +17 -0
  18. package/dist/api/execution-workspaces.d.ts.map +1 -0
  19. package/dist/api/execution-workspaces.js +46 -0
  20. package/dist/api/execution-workspaces.js.map +1 -0
  21. package/dist/api/http.d.ts +76 -0
  22. package/dist/api/http.d.ts.map +1 -0
  23. package/dist/api/http.js +838 -0
  24. package/dist/api/http.js.map +1 -0
  25. package/dist/api/managed-executions.d.ts +37 -0
  26. package/dist/api/managed-executions.d.ts.map +1 -0
  27. package/dist/api/managed-executions.js +80 -0
  28. package/dist/api/managed-executions.js.map +1 -0
  29. package/dist/api/observer-v2-schema.d.ts +206 -0
  30. package/dist/api/observer-v2-schema.d.ts.map +1 -0
  31. package/dist/api/observer-v2-schema.js +264 -0
  32. package/dist/api/observer-v2-schema.js.map +1 -0
  33. package/dist/api/observer-v2.d.ts +33 -0
  34. package/dist/api/observer-v2.d.ts.map +1 -0
  35. package/dist/api/observer-v2.js +60 -0
  36. package/dist/api/observer-v2.js.map +1 -0
  37. package/dist/api/owner-observe-grants-v2-schema.d.ts +678 -0
  38. package/dist/api/owner-observe-grants-v2-schema.d.ts.map +1 -0
  39. package/dist/api/owner-observe-grants-v2-schema.js +887 -0
  40. package/dist/api/owner-observe-grants-v2-schema.js.map +1 -0
  41. package/dist/api/owner-observe-grants-v2.d.ts +268 -0
  42. package/dist/api/owner-observe-grants-v2.d.ts.map +1 -0
  43. package/dist/api/owner-observe-grants-v2.js +604 -0
  44. package/dist/api/owner-observe-grants-v2.js.map +1 -0
  45. package/dist/api/provider-v2-schema.d.ts +293 -0
  46. package/dist/api/provider-v2-schema.d.ts.map +1 -0
  47. package/dist/api/provider-v2-schema.js +381 -0
  48. package/dist/api/provider-v2-schema.js.map +1 -0
  49. package/dist/api/provider-v2.d.ts +55 -0
  50. package/dist/api/provider-v2.d.ts.map +1 -0
  51. package/dist/api/provider-v2.js +54 -0
  52. package/dist/api/provider-v2.js.map +1 -0
  53. package/dist/api/remote-workspace.d.ts +29 -0
  54. package/dist/api/remote-workspace.d.ts.map +1 -0
  55. package/dist/api/remote-workspace.js +62 -0
  56. package/dist/api/remote-workspace.js.map +1 -0
  57. package/dist/api/supervisor-live-update.d.ts +248 -0
  58. package/dist/api/supervisor-live-update.d.ts.map +1 -0
  59. package/dist/api/supervisor-live-update.js +434 -0
  60. package/dist/api/supervisor-live-update.js.map +1 -0
  61. package/dist/api/terminal-reason.d.ts +5 -0
  62. package/dist/api/terminal-reason.d.ts.map +1 -0
  63. package/dist/api/terminal-reason.js +12 -0
  64. package/dist/api/terminal-reason.js.map +1 -0
  65. package/dist/auth/browser-handoff.d.ts +59 -0
  66. package/dist/auth/browser-handoff.d.ts.map +1 -0
  67. package/dist/auth/browser-handoff.js +33 -0
  68. package/dist/auth/browser-handoff.js.map +1 -0
  69. package/dist/auth/browser.d.ts +11 -0
  70. package/dist/auth/browser.d.ts.map +1 -0
  71. package/dist/auth/browser.js +47 -0
  72. package/dist/auth/browser.js.map +1 -0
  73. package/dist/auth/human-client.d.ts +39 -0
  74. package/dist/auth/human-client.d.ts.map +1 -0
  75. package/dist/auth/human-client.js +66 -0
  76. package/dist/auth/human-client.js.map +1 -0
  77. package/dist/auth/human-contracts.d.ts +52 -0
  78. package/dist/auth/human-contracts.d.ts.map +1 -0
  79. package/dist/auth/human-contracts.js +229 -0
  80. package/dist/auth/human-contracts.js.map +1 -0
  81. package/dist/auth/human-session.d.ts +48 -0
  82. package/dist/auth/human-session.d.ts.map +1 -0
  83. package/dist/auth/human-session.js +902 -0
  84. package/dist/auth/human-session.js.map +1 -0
  85. package/dist/auth/onboarding-state.d.ts +31 -0
  86. package/dist/auth/onboarding-state.d.ts.map +1 -0
  87. package/dist/auth/onboarding-state.js +52 -0
  88. package/dist/auth/onboarding-state.js.map +1 -0
  89. package/dist/auth/pkce.d.ts +15 -0
  90. package/dist/auth/pkce.d.ts.map +1 -0
  91. package/dist/auth/pkce.js +19 -0
  92. package/dist/auth/pkce.js.map +1 -0
  93. package/dist/bin/cuna.d.ts +3 -0
  94. package/dist/bin/cuna.d.ts.map +1 -0
  95. package/dist/bin/cuna.js +4 -0
  96. package/dist/bin/cuna.js.map +1 -0
  97. package/dist/build-identity.d.ts +20 -0
  98. package/dist/build-identity.d.ts.map +1 -0
  99. package/dist/build-identity.js +77 -0
  100. package/dist/build-identity.js.map +1 -0
  101. package/dist/cli/command-help.d.ts +9 -0
  102. package/dist/cli/command-help.d.ts.map +1 -0
  103. package/dist/cli/command-help.js +324 -0
  104. package/dist/cli/command-help.js.map +1 -0
  105. package/dist/cli/help.d.ts +40 -0
  106. package/dist/cli/help.d.ts.map +1 -0
  107. package/dist/cli/help.js +256 -0
  108. package/dist/cli/help.js.map +1 -0
  109. package/dist/cli/output.d.ts +28 -0
  110. package/dist/cli/output.d.ts.map +1 -0
  111. package/dist/cli/output.js +95 -0
  112. package/dist/cli/output.js.map +1 -0
  113. package/dist/cli/parser.d.ts +65 -0
  114. package/dist/cli/parser.d.ts.map +1 -0
  115. package/dist/cli/parser.js +294 -0
  116. package/dist/cli/parser.js.map +1 -0
  117. package/dist/cli/process-entrypoint.d.ts +18 -0
  118. package/dist/cli/process-entrypoint.d.ts.map +1 -0
  119. package/dist/cli/process-entrypoint.js +26 -0
  120. package/dist/cli/process-entrypoint.js.map +1 -0
  121. package/dist/cli/run.d.ts +114 -0
  122. package/dist/cli/run.d.ts.map +1 -0
  123. package/dist/cli/run.js +1969 -0
  124. package/dist/cli/run.js.map +1 -0
  125. package/dist/commands/commands.d.ts +74 -0
  126. package/dist/commands/commands.d.ts.map +1 -0
  127. package/dist/commands/commands.js +2814 -0
  128. package/dist/commands/commands.js.map +1 -0
  129. package/dist/config/config.d.ts +86 -0
  130. package/dist/config/config.d.ts.map +1 -0
  131. package/dist/config/config.js +323 -0
  132. package/dist/config/config.js.map +1 -0
  133. package/dist/config/infra-contract-witness.d.ts +29 -0
  134. package/dist/config/infra-contract-witness.d.ts.map +1 -0
  135. package/dist/config/infra-contract-witness.js +30 -0
  136. package/dist/config/infra-contract-witness.js.map +1 -0
  137. package/dist/core/browser-url.d.ts +2 -0
  138. package/dist/core/browser-url.d.ts.map +1 -0
  139. package/dist/core/browser-url.js +20 -0
  140. package/dist/core/browser-url.js.map +1 -0
  141. package/dist/core/deployed-wire-compatibility.d.ts +15 -0
  142. package/dist/core/deployed-wire-compatibility.d.ts.map +1 -0
  143. package/dist/core/deployed-wire-compatibility.js +15 -0
  144. package/dist/core/deployed-wire-compatibility.js.map +1 -0
  145. package/dist/core/errors.d.ts +59 -0
  146. package/dist/core/errors.d.ts.map +1 -0
  147. package/dist/core/errors.js +82 -0
  148. package/dist/core/errors.js.map +1 -0
  149. package/dist/core/exit-codes.d.ts +68 -0
  150. package/dist/core/exit-codes.d.ts.map +1 -0
  151. package/dist/core/exit-codes.js +84 -0
  152. package/dist/core/exit-codes.js.map +1 -0
  153. package/dist/core/instant.d.ts +60 -0
  154. package/dist/core/instant.d.ts.map +1 -0
  155. package/dist/core/instant.js +90 -0
  156. package/dist/core/instant.js.map +1 -0
  157. package/dist/core/namespace.d.ts +171 -0
  158. package/dist/core/namespace.d.ts.map +1 -0
  159. package/dist/core/namespace.js +227 -0
  160. package/dist/core/namespace.js.map +1 -0
  161. package/dist/core/observation-budget.d.ts +185 -0
  162. package/dist/core/observation-budget.d.ts.map +1 -0
  163. package/dist/core/observation-budget.js +209 -0
  164. package/dist/core/observation-budget.js.map +1 -0
  165. package/dist/core/product-web.d.ts +81 -0
  166. package/dist/core/product-web.d.ts.map +1 -0
  167. package/dist/core/product-web.js +87 -0
  168. package/dist/core/product-web.js.map +1 -0
  169. package/dist/core/validation.d.ts +90 -0
  170. package/dist/core/validation.d.ts.map +1 -0
  171. package/dist/core/validation.js +199 -0
  172. package/dist/core/validation.js.map +1 -0
  173. package/dist/credentials/contracts.d.ts +82 -0
  174. package/dist/credentials/contracts.d.ts.map +1 -0
  175. package/dist/credentials/contracts.js +2 -0
  176. package/dist/credentials/contracts.js.map +1 -0
  177. package/dist/credentials/errors.d.ts +19 -0
  178. package/dist/credentials/errors.d.ts.map +1 -0
  179. package/dist/credentials/errors.js +16 -0
  180. package/dist/credentials/errors.js.map +1 -0
  181. package/dist/credentials/index.d.ts +6 -0
  182. package/dist/credentials/index.d.ts.map +1 -0
  183. package/dist/credentials/index.js +6 -0
  184. package/dist/credentials/index.js.map +1 -0
  185. package/dist/credentials/local-session.d.ts +101 -0
  186. package/dist/credentials/local-session.d.ts.map +1 -0
  187. package/dist/credentials/local-session.js +839 -0
  188. package/dist/credentials/local-session.js.map +1 -0
  189. package/dist/credentials/secret-material.d.ts +17 -0
  190. package/dist/credentials/secret-material.d.ts.map +1 -0
  191. package/dist/credentials/secret-material.js +49 -0
  192. package/dist/credentials/secret-material.js.map +1 -0
  193. package/dist/credentials/vault.d.ts +41 -0
  194. package/dist/credentials/vault.d.ts.map +1 -0
  195. package/dist/credentials/vault.js +719 -0
  196. package/dist/credentials/vault.js.map +1 -0
  197. package/dist/daemon/endpoint.d.ts +29 -0
  198. package/dist/daemon/endpoint.d.ts.map +1 -0
  199. package/dist/daemon/endpoint.js +66 -0
  200. package/dist/daemon/endpoint.js.map +1 -0
  201. package/dist/daemon/journal.d.ts +62 -0
  202. package/dist/daemon/journal.d.ts.map +1 -0
  203. package/dist/daemon/journal.js +299 -0
  204. package/dist/daemon/journal.js.map +1 -0
  205. package/dist/daemon/lease.d.ts +25 -0
  206. package/dist/daemon/lease.d.ts.map +1 -0
  207. package/dist/daemon/lease.js +94 -0
  208. package/dist/daemon/lease.js.map +1 -0
  209. package/dist/daemon/lifecycle.d.ts +14 -0
  210. package/dist/daemon/lifecycle.d.ts.map +1 -0
  211. package/dist/daemon/lifecycle.js +29 -0
  212. package/dist/daemon/lifecycle.js.map +1 -0
  213. package/dist/daemon/protocol.d.ts +65 -0
  214. package/dist/daemon/protocol.d.ts.map +1 -0
  215. package/dist/daemon/protocol.js +194 -0
  216. package/dist/daemon/protocol.js.map +1 -0
  217. package/dist/daemon/supervisor.d.ts +29 -0
  218. package/dist/daemon/supervisor.d.ts.map +1 -0
  219. package/dist/daemon/supervisor.js +87 -0
  220. package/dist/daemon/supervisor.js.map +1 -0
  221. package/dist/daemon/views.d.ts +31 -0
  222. package/dist/daemon/views.d.ts.map +1 -0
  223. package/dist/daemon/views.js +86 -0
  224. package/dist/daemon/views.js.map +1 -0
  225. package/dist/index.d.ts +38 -0
  226. package/dist/index.d.ts.map +1 -0
  227. package/dist/index.js +38 -0
  228. package/dist/index.js.map +1 -0
  229. package/dist/journey/api-effects.d.ts +59 -0
  230. package/dist/journey/api-effects.d.ts.map +1 -0
  231. package/dist/journey/api-effects.js +386 -0
  232. package/dist/journey/api-effects.js.map +1 -0
  233. package/dist/journey/derived-identity.d.ts +91 -0
  234. package/dist/journey/derived-identity.d.ts.map +1 -0
  235. package/dist/journey/derived-identity.js +123 -0
  236. package/dist/journey/derived-identity.js.map +1 -0
  237. package/dist/journey/index.d.ts +6 -0
  238. package/dist/journey/index.d.ts.map +1 -0
  239. package/dist/journey/index.js +6 -0
  240. package/dist/journey/index.js.map +1 -0
  241. package/dist/journey/intent.d.ts +36 -0
  242. package/dist/journey/intent.d.ts.map +1 -0
  243. package/dist/journey/intent.js +191 -0
  244. package/dist/journey/intent.js.map +1 -0
  245. package/dist/journey/orchestrator.d.ts +140 -0
  246. package/dist/journey/orchestrator.d.ts.map +1 -0
  247. package/dist/journey/orchestrator.js +415 -0
  248. package/dist/journey/orchestrator.js.map +1 -0
  249. package/dist/journey/provider-launch-intent.d.ts +12 -0
  250. package/dist/journey/provider-launch-intent.d.ts.map +1 -0
  251. package/dist/journey/provider-launch-intent.js +40 -0
  252. package/dist/journey/provider-launch-intent.js.map +1 -0
  253. package/dist/journey/remote-workspace.d.ts +34 -0
  254. package/dist/journey/remote-workspace.d.ts.map +1 -0
  255. package/dist/journey/remote-workspace.js +91 -0
  256. package/dist/journey/remote-workspace.js.map +1 -0
  257. package/dist/journey/root-entry.d.ts +56 -0
  258. package/dist/journey/root-entry.d.ts.map +1 -0
  259. package/dist/journey/root-entry.js +19 -0
  260. package/dist/journey/root-entry.js.map +1 -0
  261. package/dist/journey/selection.d.ts +165 -0
  262. package/dist/journey/selection.d.ts.map +1 -0
  263. package/dist/journey/selection.js +565 -0
  264. package/dist/journey/selection.js.map +1 -0
  265. package/dist/journey/session-failure.d.ts +4 -0
  266. package/dist/journey/session-failure.d.ts.map +1 -0
  267. package/dist/journey/session-failure.js +28 -0
  268. package/dist/journey/session-failure.js.map +1 -0
  269. package/dist/journey/workspace-effects.d.ts +30 -0
  270. package/dist/journey/workspace-effects.d.ts.map +1 -0
  271. package/dist/journey/workspace-effects.js +348 -0
  272. package/dist/journey/workspace-effects.js.map +1 -0
  273. package/dist/local-actions/broker.d.ts +32 -0
  274. package/dist/local-actions/broker.d.ts.map +1 -0
  275. package/dist/local-actions/broker.js +400 -0
  276. package/dist/local-actions/broker.js.map +1 -0
  277. package/dist/local-actions/browser-action.d.ts +78 -0
  278. package/dist/local-actions/browser-action.d.ts.map +1 -0
  279. package/dist/local-actions/browser-action.js +307 -0
  280. package/dist/local-actions/browser-action.js.map +1 -0
  281. package/dist/local-actions/callback-relay.d.ts +45 -0
  282. package/dist/local-actions/callback-relay.d.ts.map +1 -0
  283. package/dist/local-actions/callback-relay.js +265 -0
  284. package/dist/local-actions/callback-relay.js.map +1 -0
  285. package/dist/local-actions/clipboard.d.ts +3 -0
  286. package/dist/local-actions/clipboard.d.ts.map +1 -0
  287. package/dist/local-actions/clipboard.js +18 -0
  288. package/dist/local-actions/clipboard.js.map +1 -0
  289. package/dist/local-actions/contracts.d.ts +63 -0
  290. package/dist/local-actions/contracts.d.ts.map +1 -0
  291. package/dist/local-actions/contracts.js +18 -0
  292. package/dist/local-actions/contracts.js.map +1 -0
  293. package/dist/local-actions/desktop-presentation.d.ts +141 -0
  294. package/dist/local-actions/desktop-presentation.d.ts.map +1 -0
  295. package/dist/local-actions/desktop-presentation.js +253 -0
  296. package/dist/local-actions/desktop-presentation.js.map +1 -0
  297. package/dist/local-actions/device-selection.d.ts +43 -0
  298. package/dist/local-actions/device-selection.d.ts.map +1 -0
  299. package/dist/local-actions/device-selection.js +154 -0
  300. package/dist/local-actions/device-selection.js.map +1 -0
  301. package/dist/local-actions/executor.d.ts +49 -0
  302. package/dist/local-actions/executor.d.ts.map +1 -0
  303. package/dist/local-actions/executor.js +329 -0
  304. package/dist/local-actions/executor.js.map +1 -0
  305. package/dist/local-actions/file-transfers.d.ts +141 -0
  306. package/dist/local-actions/file-transfers.d.ts.map +1 -0
  307. package/dist/local-actions/file-transfers.js +446 -0
  308. package/dist/local-actions/file-transfers.js.map +1 -0
  309. package/dist/local-actions/foreground-notifications.d.ts +45 -0
  310. package/dist/local-actions/foreground-notifications.d.ts.map +1 -0
  311. package/dist/local-actions/foreground-notifications.js +163 -0
  312. package/dist/local-actions/foreground-notifications.js.map +1 -0
  313. package/dist/local-actions/git-signing.d.ts +39 -0
  314. package/dist/local-actions/git-signing.d.ts.map +1 -0
  315. package/dist/local-actions/git-signing.js +135 -0
  316. package/dist/local-actions/git-signing.js.map +1 -0
  317. package/dist/local-actions/index.d.ts +19 -0
  318. package/dist/local-actions/index.d.ts.map +1 -0
  319. package/dist/local-actions/index.js +19 -0
  320. package/dist/local-actions/index.js.map +1 -0
  321. package/dist/local-actions/local-service-actions.d.ts +87 -0
  322. package/dist/local-actions/local-service-actions.d.ts.map +1 -0
  323. package/dist/local-actions/local-service-actions.js +347 -0
  324. package/dist/local-actions/local-service-actions.js.map +1 -0
  325. package/dist/local-actions/loopback.d.ts +5 -0
  326. package/dist/local-actions/loopback.d.ts.map +1 -0
  327. package/dist/local-actions/loopback.js +15 -0
  328. package/dist/local-actions/loopback.js.map +1 -0
  329. package/dist/local-actions/policy-store.d.ts +7 -0
  330. package/dist/local-actions/policy-store.d.ts.map +1 -0
  331. package/dist/local-actions/policy-store.js +70 -0
  332. package/dist/local-actions/policy-store.js.map +1 -0
  333. package/dist/local-actions/policy.d.ts +21 -0
  334. package/dist/local-actions/policy.d.ts.map +1 -0
  335. package/dist/local-actions/policy.js +43 -0
  336. package/dist/local-actions/policy.js.map +1 -0
  337. package/dist/local-actions/private-port-forward.d.ts +36 -0
  338. package/dist/local-actions/private-port-forward.d.ts.map +1 -0
  339. package/dist/local-actions/private-port-forward.js +154 -0
  340. package/dist/local-actions/private-port-forward.js.map +1 -0
  341. package/dist/local-actions/provider-mcp-config.d.ts +101 -0
  342. package/dist/local-actions/provider-mcp-config.d.ts.map +1 -0
  343. package/dist/local-actions/provider-mcp-config.js +166 -0
  344. package/dist/local-actions/provider-mcp-config.js.map +1 -0
  345. package/dist/local-actions/providers.d.ts +12 -0
  346. package/dist/local-actions/providers.d.ts.map +1 -0
  347. package/dist/local-actions/providers.js +42 -0
  348. package/dist/local-actions/providers.js.map +1 -0
  349. package/dist/local-actions/schemas.d.ts +4 -0
  350. package/dist/local-actions/schemas.d.ts.map +1 -0
  351. package/dist/local-actions/schemas.js +314 -0
  352. package/dist/local-actions/schemas.js.map +1 -0
  353. package/dist/local-actions/sensitive-consent.d.ts +32 -0
  354. package/dist/local-actions/sensitive-consent.d.ts.map +1 -0
  355. package/dist/local-actions/sensitive-consent.js +47 -0
  356. package/dist/local-actions/sensitive-consent.js.map +1 -0
  357. package/dist/machines/command-launch.d.ts +17 -0
  358. package/dist/machines/command-launch.d.ts.map +1 -0
  359. package/dist/machines/command-launch.js +52 -0
  360. package/dist/machines/command-launch.js.map +1 -0
  361. package/dist/machines/execution-receipt.d.ts +18 -0
  362. package/dist/machines/execution-receipt.d.ts.map +1 -0
  363. package/dist/machines/execution-receipt.js +87 -0
  364. package/dist/machines/execution-receipt.js.map +1 -0
  365. package/dist/machines/executions-screen.d.ts +6 -0
  366. package/dist/machines/executions-screen.d.ts.map +1 -0
  367. package/dist/machines/executions-screen.js +410 -0
  368. package/dist/machines/executions-screen.js.map +1 -0
  369. package/dist/machines/explorer.d.ts +75 -0
  370. package/dist/machines/explorer.d.ts.map +1 -0
  371. package/dist/machines/explorer.js +1726 -0
  372. package/dist/machines/explorer.js.map +1 -0
  373. package/dist/machines/live-supervisor-update.d.ts +325 -0
  374. package/dist/machines/live-supervisor-update.d.ts.map +1 -0
  375. package/dist/machines/live-supervisor-update.js +513 -0
  376. package/dist/machines/live-supervisor-update.js.map +1 -0
  377. package/dist/machines/machine-first.d.ts +123 -0
  378. package/dist/machines/machine-first.d.ts.map +1 -0
  379. package/dist/machines/machine-first.js +119 -0
  380. package/dist/machines/machine-first.js.map +1 -0
  381. package/dist/machines/opencode-supervisor.d.ts +51 -0
  382. package/dist/machines/opencode-supervisor.d.ts.map +1 -0
  383. package/dist/machines/opencode-supervisor.js +124 -0
  384. package/dist/machines/opencode-supervisor.js.map +1 -0
  385. package/dist/machines/pagination.d.ts +4 -0
  386. package/dist/machines/pagination.d.ts.map +1 -0
  387. package/dist/machines/pagination.js +7 -0
  388. package/dist/machines/pagination.js.map +1 -0
  389. package/dist/machines/provider-availability.d.ts +42 -0
  390. package/dist/machines/provider-availability.d.ts.map +1 -0
  391. package/dist/machines/provider-availability.js +82 -0
  392. package/dist/machines/provider-availability.js.map +1 -0
  393. package/dist/machines/provider-screen.d.ts +12 -0
  394. package/dist/machines/provider-screen.d.ts.map +1 -0
  395. package/dist/machines/provider-screen.js +129 -0
  396. package/dist/machines/provider-screen.js.map +1 -0
  397. package/dist/machines/session-actionability.d.ts +86 -0
  398. package/dist/machines/session-actionability.d.ts.map +1 -0
  399. package/dist/machines/session-actionability.js +125 -0
  400. package/dist/machines/session-actionability.js.map +1 -0
  401. package/dist/machines/session-visibility.d.ts +139 -0
  402. package/dist/machines/session-visibility.d.ts.map +1 -0
  403. package/dist/machines/session-visibility.js +109 -0
  404. package/dist/machines/session-visibility.js.map +1 -0
  405. package/dist/platform/adapter.d.ts +62 -0
  406. package/dist/platform/adapter.d.ts.map +1 -0
  407. package/dist/platform/adapter.js +240 -0
  408. package/dist/platform/adapter.js.map +1 -0
  409. package/dist/platform/support.d.ts +12 -0
  410. package/dist/platform/support.d.ts.map +1 -0
  411. package/dist/platform/support.js +25 -0
  412. package/dist/platform/support.js.map +1 -0
  413. package/dist/pty/contracts.d.ts +45 -0
  414. package/dist/pty/contracts.d.ts.map +1 -0
  415. package/dist/pty/contracts.js +2 -0
  416. package/dist/pty/contracts.js.map +1 -0
  417. package/dist/pty/evidence-gate.d.ts +14 -0
  418. package/dist/pty/evidence-gate.d.ts.map +1 -0
  419. package/dist/pty/evidence-gate.js +35 -0
  420. package/dist/pty/evidence-gate.js.map +1 -0
  421. package/dist/pty/index.d.ts +5 -0
  422. package/dist/pty/index.d.ts.map +1 -0
  423. package/dist/pty/index.js +5 -0
  424. package/dist/pty/index.js.map +1 -0
  425. package/dist/pty/node-host-terminal.d.ts +14 -0
  426. package/dist/pty/node-host-terminal.d.ts.map +1 -0
  427. package/dist/pty/node-host-terminal.js +173 -0
  428. package/dist/pty/node-host-terminal.js.map +1 -0
  429. package/dist/pty/node-process.d.ts +26 -0
  430. package/dist/pty/node-process.d.ts.map +1 -0
  431. package/dist/pty/node-process.js +102 -0
  432. package/dist/pty/node-process.js.map +1 -0
  433. package/dist/runtime/api-terminal-control-plane.d.ts +7 -0
  434. package/dist/runtime/api-terminal-control-plane.d.ts.map +1 -0
  435. package/dist/runtime/api-terminal-control-plane.js +95 -0
  436. package/dist/runtime/api-terminal-control-plane.js.map +1 -0
  437. package/dist/runtime/backoff.d.ts +17 -0
  438. package/dist/runtime/backoff.d.ts.map +1 -0
  439. package/dist/runtime/backoff.js +61 -0
  440. package/dist/runtime/backoff.js.map +1 -0
  441. package/dist/runtime/boundary.d.ts +171 -0
  442. package/dist/runtime/boundary.d.ts.map +1 -0
  443. package/dist/runtime/boundary.js +1858 -0
  444. package/dist/runtime/boundary.js.map +1 -0
  445. package/dist/runtime/capability-gate.d.ts +25 -0
  446. package/dist/runtime/capability-gate.d.ts.map +1 -0
  447. package/dist/runtime/capability-gate.js +77 -0
  448. package/dist/runtime/capability-gate.js.map +1 -0
  449. package/dist/runtime/contracts.d.ts +25 -0
  450. package/dist/runtime/contracts.d.ts.map +1 -0
  451. package/dist/runtime/contracts.js +66 -0
  452. package/dist/runtime/contracts.js.map +1 -0
  453. package/dist/runtime/errors.d.ts +20 -0
  454. package/dist/runtime/errors.d.ts.map +1 -0
  455. package/dist/runtime/errors.js +22 -0
  456. package/dist/runtime/errors.js.map +1 -0
  457. package/dist/runtime/index.d.ts +9 -0
  458. package/dist/runtime/index.d.ts.map +1 -0
  459. package/dist/runtime/index.js +9 -0
  460. package/dist/runtime/index.js.map +1 -0
  461. package/dist/runtime/node-foreground-session.d.ts +50 -0
  462. package/dist/runtime/node-foreground-session.d.ts.map +1 -0
  463. package/dist/runtime/node-foreground-session.js +431 -0
  464. package/dist/runtime/node-foreground-session.js.map +1 -0
  465. package/dist/runtime/node-websocket-connector.d.ts +6 -0
  466. package/dist/runtime/node-websocket-connector.d.ts.map +1 -0
  467. package/dist/runtime/node-websocket-connector.js +344 -0
  468. package/dist/runtime/node-websocket-connector.js.map +1 -0
  469. package/dist/runtime/observer-screen.d.ts +6 -0
  470. package/dist/runtime/observer-screen.d.ts.map +1 -0
  471. package/dist/runtime/observer-screen.js +144 -0
  472. package/dist/runtime/observer-screen.js.map +1 -0
  473. package/dist/runtime/owner-grant-operations.d.ts +136 -0
  474. package/dist/runtime/owner-grant-operations.d.ts.map +1 -0
  475. package/dist/runtime/owner-grant-operations.js +216 -0
  476. package/dist/runtime/owner-grant-operations.js.map +1 -0
  477. package/dist/runtime/owner-grants-screen.d.ts +40 -0
  478. package/dist/runtime/owner-grants-screen.d.ts.map +1 -0
  479. package/dist/runtime/owner-grants-screen.js +987 -0
  480. package/dist/runtime/owner-grants-screen.js.map +1 -0
  481. package/dist/runtime/terminal-transport.d.ts +85 -0
  482. package/dist/runtime/terminal-transport.d.ts.map +1 -0
  483. package/dist/runtime/terminal-transport.js +152 -0
  484. package/dist/runtime/terminal-transport.js.map +1 -0
  485. package/dist/sync/continuous-sync-supervisor.d.ts +107 -0
  486. package/dist/sync/continuous-sync-supervisor.d.ts.map +1 -0
  487. package/dist/sync/continuous-sync-supervisor.js +1117 -0
  488. package/dist/sync/continuous-sync-supervisor.js.map +1 -0
  489. package/dist/sync/index.d.ts +9 -0
  490. package/dist/sync/index.d.ts.map +1 -0
  491. package/dist/sync/index.js +9 -0
  492. package/dist/sync/index.js.map +1 -0
  493. package/dist/sync/journal.d.ts +57 -0
  494. package/dist/sync/journal.d.ts.map +1 -0
  495. package/dist/sync/journal.js +685 -0
  496. package/dist/sync/journal.js.map +1 -0
  497. package/dist/sync/revisions.d.ts +118 -0
  498. package/dist/sync/revisions.d.ts.map +1 -0
  499. package/dist/sync/revisions.js +364 -0
  500. package/dist/sync/revisions.js.map +1 -0
  501. package/dist/sync/supervisor.d.ts +107 -0
  502. package/dist/sync/supervisor.d.ts.map +1 -0
  503. package/dist/sync/supervisor.js +246 -0
  504. package/dist/sync/supervisor.js.map +1 -0
  505. package/dist/sync/workspace-sync-client.d.ts +18 -0
  506. package/dist/sync/workspace-sync-client.d.ts.map +1 -0
  507. package/dist/sync/workspace-sync-client.js +150 -0
  508. package/dist/sync/workspace-sync-client.js.map +1 -0
  509. package/dist/sync/workspace-sync-coordinator.d.ts +76 -0
  510. package/dist/sync/workspace-sync-coordinator.d.ts.map +1 -0
  511. package/dist/sync/workspace-sync-coordinator.js +621 -0
  512. package/dist/sync/workspace-sync-coordinator.js.map +1 -0
  513. package/dist/sync/workspace-sync-product-service.d.ts +79 -0
  514. package/dist/sync/workspace-sync-product-service.d.ts.map +1 -0
  515. package/dist/sync/workspace-sync-product-service.js +398 -0
  516. package/dist/sync/workspace-sync-product-service.js.map +1 -0
  517. package/dist/sync/workspace-sync-protocol.d.ts +145 -0
  518. package/dist/sync/workspace-sync-protocol.d.ts.map +1 -0
  519. package/dist/sync/workspace-sync-protocol.js +347 -0
  520. package/dist/sync/workspace-sync-protocol.js.map +1 -0
  521. package/dist/terminal/appbar.d.ts +40 -0
  522. package/dist/terminal/appbar.d.ts.map +1 -0
  523. package/dist/terminal/appbar.js +55 -0
  524. package/dist/terminal/appbar.js.map +1 -0
  525. package/dist/terminal/cell-width.d.ts +3 -0
  526. package/dist/terminal/cell-width.d.ts.map +1 -0
  527. package/dist/terminal/cell-width.js +53 -0
  528. package/dist/terminal/cell-width.js.map +1 -0
  529. package/dist/terminal/codec.d.ts +107 -0
  530. package/dist/terminal/codec.d.ts.map +1 -0
  531. package/dist/terminal/codec.js +538 -0
  532. package/dist/terminal/codec.js.map +1 -0
  533. package/dist/terminal/foreground.d.ts +135 -0
  534. package/dist/terminal/foreground.d.ts.map +1 -0
  535. package/dist/terminal/foreground.js +2097 -0
  536. package/dist/terminal/foreground.js.map +1 -0
  537. package/dist/terminal/generated/terminal-wire-v1.d.ts +26 -0
  538. package/dist/terminal/generated/terminal-wire-v1.d.ts.map +1 -0
  539. package/dist/terminal/generated/terminal-wire-v1.js +27 -0
  540. package/dist/terminal/generated/terminal-wire-v1.js.map +1 -0
  541. package/dist/terminal/mode.d.ts +33 -0
  542. package/dist/terminal/mode.d.ts.map +1 -0
  543. package/dist/terminal/mode.js +99 -0
  544. package/dist/terminal/mode.js.map +1 -0
  545. package/dist/terminal/passthrough.d.ts +47 -0
  546. package/dist/terminal/passthrough.d.ts.map +1 -0
  547. package/dist/terminal/passthrough.js +666 -0
  548. package/dist/terminal/passthrough.js.map +1 -0
  549. package/dist/terminal/resume.d.ts +58 -0
  550. package/dist/terminal/resume.d.ts.map +1 -0
  551. package/dist/terminal/resume.js +185 -0
  552. package/dist/terminal/resume.js.map +1 -0
  553. package/dist/terminal/viewport.d.ts +93 -0
  554. package/dist/terminal/viewport.d.ts.map +1 -0
  555. package/dist/terminal/viewport.js +266 -0
  556. package/dist/terminal/viewport.js.map +1 -0
  557. package/dist/terminal/workbench.d.ts +32 -0
  558. package/dist/terminal/workbench.d.ts.map +1 -0
  559. package/dist/terminal/workbench.js +316 -0
  560. package/dist/terminal/workbench.js.map +1 -0
  561. package/dist/terminal/xterm-vte.d.ts +49 -0
  562. package/dist/terminal/xterm-vte.d.ts.map +1 -0
  563. package/dist/terminal/xterm-vte.js +602 -0
  564. package/dist/terminal/xterm-vte.js.map +1 -0
  565. package/dist/version.d.ts +3 -0
  566. package/dist/version.d.ts.map +1 -0
  567. package/dist/version.js +3 -0
  568. package/dist/version.js.map +1 -0
  569. package/dist/workspace/binding-path.d.ts +17 -0
  570. package/dist/workspace/binding-path.d.ts.map +1 -0
  571. package/dist/workspace/binding-path.js +91 -0
  572. package/dist/workspace/binding-path.js.map +1 -0
  573. package/dist/workspace/binding-store.d.ts +107 -0
  574. package/dist/workspace/binding-store.d.ts.map +1 -0
  575. package/dist/workspace/binding-store.js +783 -0
  576. package/dist/workspace/binding-store.js.map +1 -0
  577. package/dist/workspace/binding.d.ts +35 -0
  578. package/dist/workspace/binding.d.ts.map +1 -0
  579. package/dist/workspace/binding.js +70 -0
  580. package/dist/workspace/binding.js.map +1 -0
  581. package/dist/workspace/errors.d.ts +4 -0
  582. package/dist/workspace/errors.d.ts.map +1 -0
  583. package/dist/workspace/errors.js +19 -0
  584. package/dist/workspace/errors.js.map +1 -0
  585. package/dist/workspace/exclusion.d.ts +21 -0
  586. package/dist/workspace/exclusion.d.ts.map +1 -0
  587. package/dist/workspace/exclusion.js +243 -0
  588. package/dist/workspace/exclusion.js.map +1 -0
  589. package/dist/workspace/index.d.ts +8 -0
  590. package/dist/workspace/index.d.ts.map +1 -0
  591. package/dist/workspace/index.js +8 -0
  592. package/dist/workspace/index.js.map +1 -0
  593. package/dist/workspace/lifecycle.d.ts +56 -0
  594. package/dist/workspace/lifecycle.d.ts.map +1 -0
  595. package/dist/workspace/lifecycle.js +94 -0
  596. package/dist/workspace/lifecycle.js.map +1 -0
  597. package/dist/workspace/manifest.d.ts +47 -0
  598. package/dist/workspace/manifest.d.ts.map +1 -0
  599. package/dist/workspace/manifest.js +243 -0
  600. package/dist/workspace/manifest.js.map +1 -0
  601. package/dist/workspace/paths.d.ts +14 -0
  602. package/dist/workspace/paths.d.ts.map +1 -0
  603. package/dist/workspace/paths.js +67 -0
  604. package/dist/workspace/paths.js.map +1 -0
  605. package/dist/workspace/schema.d.ts +15 -0
  606. package/dist/workspace/schema.d.ts.map +1 -0
  607. package/dist/workspace/schema.js +33 -0
  608. package/dist/workspace/schema.js.map +1 -0
  609. package/dist/workspace/selection-screen.d.ts +4 -0
  610. package/dist/workspace/selection-screen.d.ts.map +1 -0
  611. package/dist/workspace/selection-screen.js +216 -0
  612. package/dist/workspace/selection-screen.js.map +1 -0
  613. package/dist/workspace/selection-service.d.ts +16 -0
  614. package/dist/workspace/selection-service.d.ts.map +1 -0
  615. package/dist/workspace/selection-service.js +65 -0
  616. package/dist/workspace/selection-service.js.map +1 -0
  617. package/node_modules/@xterm/headless/README.md +31 -0
  618. package/node_modules/@xterm/headless/lib-headless/xterm-headless.js +2 -0
  619. package/node_modules/@xterm/headless/lib-headless/xterm-headless.js.map +1 -0
  620. package/node_modules/@xterm/headless/lib-headless/xterm-headless.mjs +46 -0
  621. package/node_modules/@xterm/headless/lib-headless/xterm-headless.mjs.map +7 -0
  622. package/node_modules/@xterm/headless/package.json +29 -0
  623. package/node_modules/@xterm/headless/typings/xterm-headless.d.ts +1385 -0
  624. package/package.json +75 -0
@@ -0,0 +1,1385 @@
1
+ /**
2
+ * @license MIT
3
+ *
4
+ * This contains the type declarations for the xterm.js library. Note that
5
+ * some interfaces differ between this file and the actual implementation in
6
+ * src/, that's because this file declares the *public* API which is intended
7
+ * to be stable and consumed by external programs.
8
+ */
9
+
10
+ declare module '@xterm/headless' {
11
+ /**
12
+ * A string representing log level.
13
+ */
14
+ export type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'off';
15
+
16
+ /**
17
+ * An object containing options for the terminal.
18
+ */
19
+ export interface ITerminalOptions {
20
+ /**
21
+ * Whether to allow the use of proposed API. When false, any usage of APIs
22
+ * marked as experimental/proposed will throw an error. The default is
23
+ * false.
24
+ */
25
+ allowProposedApi?: boolean;
26
+
27
+ /**
28
+ * Whether background should support non-opaque color. It must be set before
29
+ * executing the `Terminal.open()` method and can't be changed later without
30
+ * executing it again. Note that enabling this can negatively impact
31
+ * performance.
32
+ */
33
+ allowTransparency?: boolean;
34
+
35
+ /**
36
+ * If enabled, alt + click will move the prompt cursor to position
37
+ * underneath the mouse. The default is true.
38
+ */
39
+ altClickMovesCursor?: boolean;
40
+
41
+ /**
42
+ * When enabled the cursor will be set to the beginning of the next line
43
+ * with every new line. This is equivalent to sending '\r\n' for each '\n'.
44
+ * Normally the termios settings of the underlying PTY deals with the
45
+ * translation of '\n' to '\r\n' and this setting should not be used. If you
46
+ * deal with data from a non-PTY related source, this settings might be
47
+ * useful.
48
+ */
49
+ convertEol?: boolean;
50
+
51
+ /**
52
+ * Whether the cursor blinks.
53
+ */
54
+ cursorBlink?: boolean;
55
+
56
+ /**
57
+ * The style of the cursor.
58
+ */
59
+ cursorStyle?: 'block' | 'underline' | 'bar';
60
+
61
+ /**
62
+ * The width of the cursor in CSS pixels when `cursorStyle` is set to 'bar'.
63
+ */
64
+ cursorWidth?: number;
65
+
66
+ /**
67
+ * Whether to draw custom glyphs for block element and box drawing
68
+ * characters instead of using the font. This should typically result in
69
+ * better rendering with continuous lines, even when line height and letter
70
+ * spacing is used. Note that this doesn't work with the DOM renderer which
71
+ * renders all characters using the font. The default is true.
72
+ */
73
+ customGlyphs?: boolean;
74
+ /**
75
+ * Whether input should be disabled.
76
+ */
77
+ disableStdin?: boolean;
78
+
79
+ /**
80
+ * Whether to draw bold text in bright colors. The default is true.
81
+ */
82
+ drawBoldTextInBrightColors?: boolean;
83
+
84
+ /**
85
+ * The modifier key hold to multiply scroll speed.
86
+ * @deprecated This option is no longer available and will always use alt.
87
+ * Setting this will be ignored.
88
+ */
89
+ fastScrollModifier?: 'none' | 'alt' | 'ctrl' | 'shift';
90
+
91
+ /**
92
+ * The spacing in whole pixels between characters.
93
+ */
94
+ letterSpacing?: number;
95
+
96
+ /**
97
+ * The line height used to render text.
98
+ */
99
+ lineHeight?: number;
100
+
101
+ /**
102
+ * What log level to use, this will log for all levels below and including
103
+ * what is set:
104
+ *
105
+ * 1. trace
106
+ * 2. debug
107
+ * 3. info (default)
108
+ * 4. warn
109
+ * 5. error
110
+ * 6. off
111
+ */
112
+ logLevel?: LogLevel;
113
+
114
+ /**
115
+ * A logger to use instead of `console`.
116
+ */
117
+ logger?: ILogger | null;
118
+
119
+ /**
120
+ * Whether to treat option as the meta key.
121
+ */
122
+ macOptionIsMeta?: boolean;
123
+
124
+ /**
125
+ * Whether holding a modifier key will force normal selection behavior,
126
+ * regardless of whether the terminal is in mouse events mode. This will
127
+ * also prevent mouse events from being emitted by the terminal. For
128
+ * example, this allows you to use xterm.js' regular selection inside tmux
129
+ * with mouse mode enabled.
130
+ */
131
+ macOptionClickForcesSelection?: boolean;
132
+
133
+ /**
134
+ * The minimum contrast ratio for text in the terminal, setting this will
135
+ * change the foreground color dynamically depending on whether the contrast
136
+ * ratio is met. Example values:
137
+ *
138
+ * - 1: The default, do nothing.
139
+ * - 4.5: Minimum for WCAG AA compliance.
140
+ * - 7: Minimum for WCAG AAA compliance.
141
+ * - 21: White on black or black on white.
142
+ */
143
+ minimumContrastRatio?: number;
144
+
145
+ /**
146
+ * Whether to reflow the line containing the cursor when the terminal is
147
+ * resized. Defaults to false, because shells usually handle this
148
+ * themselves.
149
+ */
150
+ reflowCursorLine?: boolean;
151
+
152
+ /**
153
+ * Whether to rescale glyphs horizontally that are a single cell wide but
154
+ * have glyphs that would overlap following cell(s). This typically happens
155
+ * for ambiguous width characters (eg. the roman numeral characters U+2160+)
156
+ * which aren't featured in monospace fonts. This is an important feature
157
+ * for achieving GB18030 compliance.
158
+ *
159
+ * The following glyphs will never be rescaled:
160
+ *
161
+ * - Emoji glyphs
162
+ * - Powerline glyphs
163
+ * - Nerd font glyphs
164
+ *
165
+ * Note that this doesn't work with the DOM renderer. The default is false.
166
+ */
167
+ rescaleOverlappingGlyphs?: boolean;
168
+
169
+ /**
170
+ * Whether to select the word under the cursor on right click, this is
171
+ * standard behavior in a lot of macOS applications.
172
+ */
173
+ rightClickSelectsWord?: boolean;
174
+
175
+ /**
176
+ * Whether screen reader support is enabled. When on this will expose
177
+ * supporting elements in the DOM to support NVDA on Windows and VoiceOver
178
+ * on macOS.
179
+ */
180
+ screenReaderMode?: boolean;
181
+
182
+ /**
183
+ * The amount of scrollback in the terminal. Scrollback is the amount of
184
+ * rows that are retained when lines are scrolled beyond the initial
185
+ * viewport. Defaults to 1000.
186
+ */
187
+ scrollback?: number;
188
+
189
+ /**
190
+ * If enabled the Erase in Display All (ED2) escape sequence will push
191
+ * erased text to scrollback, instead of clearing only the viewport portion.
192
+ * This emulates PuTTY's default clear screen behavior.
193
+ */
194
+ scrollOnEraseInDisplay?: boolean;
195
+
196
+ /**
197
+ * The scrolling speed multiplier used for adjusting normal scrolling speed.
198
+ */
199
+ scrollSensitivity?: number;
200
+
201
+ /**
202
+ * The duration to smoothly scroll between the origin and the target in
203
+ * milliseconds. Set to 0 to disable smooth scrolling and scroll instantly.
204
+ */
205
+ smoothScrollDuration?: number;
206
+
207
+ /**
208
+ * The size of tab stops in the terminal.
209
+ */
210
+ tabStopWidth?: number;
211
+
212
+ /**
213
+ * The color theme of the terminal.
214
+ */
215
+ theme?: ITheme;
216
+
217
+ /**
218
+ * Whether "Windows mode" is enabled. Because Windows backends winpty and
219
+ * conpty operate by doing line wrapping on their side, xterm.js does not
220
+ * have access to wrapped lines. When Windows mode is enabled the following
221
+ * changes will be in effect:
222
+ *
223
+ * - Reflow is disabled.
224
+ * - Lines are assumed to be wrapped if the last character of the line is
225
+ * not whitespace.
226
+ *
227
+ * When using conpty on Windows 11 version >= 21376, it is recommended to
228
+ * disable this because native text wrapping sequences are output correctly
229
+ * thanks to https://github.com/microsoft/terminal/issues/405
230
+ *
231
+ * @deprecated Use {@link windowsPty}. This value will be ignored if
232
+ * windowsPty is set.
233
+ */
234
+ windowsMode?: boolean;
235
+
236
+ /**
237
+ * Compatibility information when the pty is known to be hosted on Windows.
238
+ * Setting this will turn on certain heuristics/workarounds depending on the
239
+ * values:
240
+ *
241
+ * - `if (!!windowsCompat)`
242
+ * - When increasing the rows in the terminal, the amount increased into
243
+ * the scrollback. This is done because ConPTY does not behave like
244
+ * expect scrollback to come back into the viewport, instead it makes
245
+ * empty rows at of the viewport. Not having this behavior can result in
246
+ * missing data as the rows get replaced.
247
+ * - `if !(backend === 'conpty' && buildNumber >= 21376)`
248
+ * - Reflow is disabled
249
+ * - Lines are assumed to be wrapped if the last character of the line is
250
+ * not whitespace.
251
+ */
252
+ windowsPty?: IWindowsPty;
253
+
254
+ /**
255
+ * A string containing all characters that are considered word separated by
256
+ * the double click to select work logic.
257
+ */
258
+ wordSeparator?: string;
259
+
260
+ /**
261
+ * Enable various window manipulation and report features.
262
+ * All features are disabled by default for security reasons.
263
+ */
264
+ windowOptions?: IWindowOptions;
265
+ }
266
+
267
+ /**
268
+ * An object containing additional options for the terminal that can only be
269
+ * set on start up.
270
+ */
271
+ export interface ITerminalInitOnlyOptions {
272
+ /**
273
+ * The number of columns in the terminal.
274
+ */
275
+ cols?: number;
276
+
277
+ /**
278
+ * The number of rows in the terminal.
279
+ */
280
+ rows?: number;
281
+ }
282
+
283
+ /**
284
+ * Contains colors to theme the terminal with.
285
+ */
286
+ export interface ITheme {
287
+ /** The default foreground color */
288
+ foreground?: string;
289
+ /** The default background color */
290
+ background?: string;
291
+ /** The cursor color */
292
+ cursor?: string;
293
+ /** The accent color of the cursor (fg color for a block cursor) */
294
+ cursorAccent?: string;
295
+ /** The selection background color (can be transparent) */
296
+ selection?: string;
297
+ /** ANSI black (eg. `\x1b[30m`) */
298
+ black?: string;
299
+ /** ANSI red (eg. `\x1b[31m`) */
300
+ red?: string;
301
+ /** ANSI green (eg. `\x1b[32m`) */
302
+ green?: string;
303
+ /** ANSI yellow (eg. `\x1b[33m`) */
304
+ yellow?: string;
305
+ /** ANSI blue (eg. `\x1b[34m`) */
306
+ blue?: string;
307
+ /** ANSI magenta (eg. `\x1b[35m`) */
308
+ magenta?: string;
309
+ /** ANSI cyan (eg. `\x1b[36m`) */
310
+ cyan?: string;
311
+ /** ANSI white (eg. `\x1b[37m`) */
312
+ white?: string;
313
+ /** ANSI bright black (eg. `\x1b[1;30m`) */
314
+ brightBlack?: string;
315
+ /** ANSI bright red (eg. `\x1b[1;31m`) */
316
+ brightRed?: string;
317
+ /** ANSI bright green (eg. `\x1b[1;32m`) */
318
+ brightGreen?: string;
319
+ /** ANSI bright yellow (eg. `\x1b[1;33m`) */
320
+ brightYellow?: string;
321
+ /** ANSI bright blue (eg. `\x1b[1;34m`) */
322
+ brightBlue?: string;
323
+ /** ANSI bright magenta (eg. `\x1b[1;35m`) */
324
+ brightMagenta?: string;
325
+ /** ANSI bright cyan (eg. `\x1b[1;36m`) */
326
+ brightCyan?: string;
327
+ /** ANSI bright white (eg. `\x1b[1;37m`) */
328
+ brightWhite?: string;
329
+ /** ANSI extended colors (16-255) */
330
+ extendedAnsi?: string[];
331
+ }
332
+
333
+ /**
334
+ * Pty information for Windows.
335
+ */
336
+ export interface IWindowsPty {
337
+ /**
338
+ * What pty emulation backend is being used.
339
+ */
340
+ backend?: 'conpty' | 'winpty';
341
+ /**
342
+ * The Windows build version (eg. 19045)
343
+ */
344
+ buildNumber?: number;
345
+ }
346
+
347
+ /**
348
+ * A replacement logger for `console`.
349
+ */
350
+ export interface ILogger {
351
+ /**
352
+ * Log a trace message, this will only be called if
353
+ * {@link ITerminalOptions.logLevel} is set to trace.
354
+ */
355
+ trace(message: string, ...args: any[]): void;
356
+ /**
357
+ * Log a debug message, this will only be called if
358
+ * {@link ITerminalOptions.logLevel} is set to debug or below.
359
+ */
360
+ debug(message: string, ...args: any[]): void;
361
+ /**
362
+ * Log a debug message, this will only be called if
363
+ * {@link ITerminalOptions.logLevel} is set to info or below.
364
+ */
365
+ info(message: string, ...args: any[]): void;
366
+ /**
367
+ * Log a debug message, this will only be called if
368
+ * {@link ITerminalOptions.logLevel} is set to warn or below.
369
+ */
370
+ warn(message: string, ...args: any[]): void;
371
+ /**
372
+ * Log a debug message, this will only be called if
373
+ * {@link ITerminalOptions.logLevel} is set to error or below.
374
+ */
375
+ error(message: string | Error, ...args: any[]): void;
376
+ }
377
+
378
+ /**
379
+ * An object that can be disposed via a dispose function.
380
+ */
381
+ export interface IDisposable {
382
+ dispose(): void;
383
+ }
384
+
385
+ /**
386
+ * An event that can be listened to.
387
+ * @returns an `IDisposable` to stop listening.
388
+ */
389
+ export interface IEvent<T, U = void> {
390
+ (listener: (arg1: T, arg2: U) => any): IDisposable;
391
+ }
392
+
393
+ /**
394
+ * Represents a specific line in the terminal that is tracked when scrollback
395
+ * is trimmed and lines are added or removed. This is a single line that may
396
+ * be part of a larger wrapped line.
397
+ */
398
+ export interface IMarker extends IDisposableWithEvent {
399
+ /**
400
+ * A unique identifier for this marker.
401
+ */
402
+ readonly id: number;
403
+
404
+ /**
405
+ * The actual line index in the buffer at this point in time. This is set to
406
+ * -1 if the marker has been disposed.
407
+ */
408
+ readonly line: number;
409
+ }
410
+
411
+ /**
412
+ * Represents a disposable that tracks is disposed state.
413
+ */
414
+ export interface IDisposableWithEvent extends IDisposable {
415
+ /**
416
+ * Event listener to get notified when this gets disposed.
417
+ */
418
+ onDispose: IEvent<void>;
419
+
420
+ /**
421
+ * Whether this is disposed.
422
+ */
423
+ readonly isDisposed: boolean;
424
+ }
425
+
426
+ /**
427
+ * The set of localizable strings.
428
+ */
429
+ export interface ILocalizableStrings {
430
+ /**
431
+ * The aria label for the underlying input textarea for the terminal.
432
+ */
433
+ promptLabel: string;
434
+
435
+ /**
436
+ * Announcement for when line reading is suppressed due to too many lines
437
+ * being printed to the terminal when `screenReaderMode` is enabled.
438
+ */
439
+ tooMuchOutput: string;
440
+ }
441
+
442
+ /**
443
+ * Enable various window manipulation and report features
444
+ * (`CSI Ps ; Ps ; Ps t`).
445
+ *
446
+ * Most settings have no default implementation, as they heavily rely on
447
+ * the embedding environment.
448
+ *
449
+ * To implement a feature, create a custom CSI hook like this:
450
+ * ```ts
451
+ * term.parser.addCsiHandler({final: 't'}, params => {
452
+ * const ps = params[0];
453
+ * switch (ps) {
454
+ * case XY:
455
+ * ... // your implementation for option XY
456
+ * return true; // signal Ps=XY was handled
457
+ * }
458
+ * return false; // any Ps that was not handled
459
+ * });
460
+ * ```
461
+ *
462
+ * Note on security:
463
+ * Most features are meant to deal with some information of the host machine
464
+ * where the terminal runs on. This is seen as a security risk possibly
465
+ * leaking sensitive data of the host to the program in the terminal.
466
+ * Therefore all options (even those without a default implementation) are
467
+ * guarded by the boolean flag and disabled by default.
468
+ */
469
+ export interface IWindowOptions {
470
+ /**
471
+ * Ps=1 De-iconify window.
472
+ * No default implementation.
473
+ */
474
+ restoreWin?: boolean;
475
+ /**
476
+ * Ps=2 Iconify window.
477
+ * No default implementation.
478
+ */
479
+ minimizeWin?: boolean;
480
+ /**
481
+ * Ps=3 ; x ; y
482
+ * Move window to [x, y].
483
+ * No default implementation.
484
+ */
485
+ setWinPosition?: boolean;
486
+ /**
487
+ * Ps = 4 ; height ; width
488
+ * Resize the window to given `height` and `width` in pixels.
489
+ * Omitted parameters should reuse the current height or width.
490
+ * Zero parameters should use the display's height or width.
491
+ * No default implementation.
492
+ */
493
+ setWinSizePixels?: boolean;
494
+ /**
495
+ * Ps=5 Raise the window to the front of the stacking order.
496
+ * No default implementation.
497
+ */
498
+ raiseWin?: boolean;
499
+ /**
500
+ * Ps=6 Lower the xterm window to the bottom of the stacking order.
501
+ * No default implementation.
502
+ */
503
+ lowerWin?: boolean;
504
+ /** Ps=7 Refresh the window. */
505
+ refreshWin?: boolean;
506
+ /**
507
+ * Ps = 8 ; height ; width
508
+ * Resize the text area to given height and width in characters.
509
+ * Omitted parameters should reuse the current height or width.
510
+ * Zero parameters use the display's height or width.
511
+ * No default implementation.
512
+ */
513
+ setWinSizeChars?: boolean;
514
+ /**
515
+ * Ps=9 ; 0 Restore maximized window.
516
+ * Ps=9 ; 1 Maximize window (i.e., resize to screen size).
517
+ * Ps=9 ; 2 Maximize window vertically.
518
+ * Ps=9 ; 3 Maximize window horizontally.
519
+ * No default implementation.
520
+ */
521
+ maximizeWin?: boolean;
522
+ /**
523
+ * Ps=10 ; 0 Undo full-screen mode.
524
+ * Ps=10 ; 1 Change to full-screen.
525
+ * Ps=10 ; 2 Toggle full-screen.
526
+ * No default implementation.
527
+ */
528
+ fullscreenWin?: boolean;
529
+ /** Ps=11 Report xterm window state.
530
+ * If the xterm window is non-iconified, it returns "CSI 1 t".
531
+ * If the xterm window is iconified, it returns "CSI 2 t".
532
+ * No default implementation.
533
+ */
534
+ getWinState?: boolean;
535
+ /**
536
+ * Ps=13 Report xterm window position. Result is "CSI 3 ; x ; y t".
537
+ * Ps=13 ; 2 Report xterm text-area position. Result is "CSI 3 ; x ; y t".
538
+ * No default implementation.
539
+ */
540
+ getWinPosition?: boolean;
541
+ /**
542
+ * Ps=14 Report xterm text area size in pixels. Result is "CSI 4 ; height ; width t".
543
+ * Ps=14 ; 2 Report xterm window size in pixels. Result is "CSI 4 ; height ; width t".
544
+ * Has a default implementation.
545
+ */
546
+ getWinSizePixels?: boolean;
547
+ /**
548
+ * Ps=15 Report size of the screen in pixels. Result is "CSI 5 ; height ; width t".
549
+ * No default implementation.
550
+ */
551
+ getScreenSizePixels?: boolean;
552
+ /**
553
+ * Ps=16 Report xterm character cell size in pixels. Result is "CSI 6 ; height ; width t".
554
+ * Has a default implementation.
555
+ */
556
+ getCellSizePixels?: boolean;
557
+ /**
558
+ * Ps=18 Report the size of the text area in characters. Result is "CSI 8 ; height ; width t".
559
+ * Has a default implementation.
560
+ */
561
+ getWinSizeChars?: boolean;
562
+ /**
563
+ * Ps=19 Report the size of the screen in characters. Result is "CSI 9 ; height ; width t".
564
+ * No default implementation.
565
+ */
566
+ getScreenSizeChars?: boolean;
567
+ /**
568
+ * Ps=20 Report xterm window's icon label. Result is "OSC L label ST".
569
+ * No default implementation.
570
+ */
571
+ getIconTitle?: boolean;
572
+ /**
573
+ * Ps=21 Report xterm window's title. Result is "OSC l label ST".
574
+ * No default implementation.
575
+ */
576
+ getWinTitle?: boolean;
577
+ /**
578
+ * Ps=22 ; 0 Save xterm icon and window title on stack.
579
+ * Ps=22 ; 1 Save xterm icon title on stack.
580
+ * Ps=22 ; 2 Save xterm window title on stack.
581
+ * All variants have a default implementation.
582
+ */
583
+ pushTitle?: boolean;
584
+ /**
585
+ * Ps=23 ; 0 Restore xterm icon and window title from stack.
586
+ * Ps=23 ; 1 Restore xterm icon title from stack.
587
+ * Ps=23 ; 2 Restore xterm window title from stack.
588
+ * All variants have a default implementation.
589
+ */
590
+ popTitle?: boolean;
591
+ /**
592
+ * Ps>=24 Resize to Ps lines (DECSLPP).
593
+ * DECSLPP is not implemented. This settings is also used to
594
+ * enable / disable DECCOLM (earlier variant of DECSLPP).
595
+ */
596
+ setWinLines?: boolean;
597
+ }
598
+
599
+ /**
600
+ * The class that represents an xterm.js terminal.
601
+ */
602
+ export class Terminal implements IDisposable {
603
+ /**
604
+ * The number of rows in the terminal's viewport. Use
605
+ * `ITerminalOptions.rows` to set this in the constructor and
606
+ * `Terminal.resize` for when the terminal exists.
607
+ */
608
+ readonly rows: number;
609
+
610
+ /**
611
+ * The number of columns in the terminal's viewport. Use
612
+ * `ITerminalOptions.cols` to set this in the constructor and
613
+ * `Terminal.resize` for when the terminal exists.
614
+ */
615
+ readonly cols: number;
616
+
617
+ /**
618
+ * (EXPERIMENTAL) The terminal's current buffer, this might be either the
619
+ * normal buffer or the alt buffer depending on what's running in the
620
+ * terminal.
621
+ */
622
+ readonly buffer: IBufferNamespace;
623
+
624
+ /**
625
+ * (EXPERIMENTAL) Get all markers registered against the buffer. If the alt
626
+ * buffer is active this will always return [].
627
+ */
628
+ readonly markers: ReadonlyArray<IMarker>;
629
+
630
+ /**
631
+ * (EXPERIMENTAL) Get the parser interface to register
632
+ * custom escape sequence handlers.
633
+ */
634
+ readonly parser: IParser;
635
+
636
+ /**
637
+ * (EXPERIMENTAL) Get the Unicode handling interface
638
+ * to register and switch Unicode version.
639
+ */
640
+ readonly unicode: IUnicodeHandling;
641
+
642
+ /**
643
+ * Gets the terminal modes as set by SM/DECSET.
644
+ */
645
+ readonly modes: IModes;
646
+
647
+ /**
648
+ * Gets or sets the terminal options. This supports setting multiple
649
+ * options.
650
+ *
651
+ * @example Get a single option
652
+ * ```ts
653
+ * console.log(terminal.options.fontSize);
654
+ * ```
655
+ *
656
+ * @example Set a single option:
657
+ * ```ts
658
+ * terminal.options.fontSize = 12;
659
+ * ```
660
+ * Note that for options that are object, a new object must be used in order
661
+ * to take effect as a reference comparison will be done:
662
+ * ```ts
663
+ * const newValue = terminal.options.theme;
664
+ * newValue.background = '#000000';
665
+ *
666
+ * // This won't work
667
+ * terminal.options.theme = newValue;
668
+ *
669
+ * // This will work
670
+ * terminal.options.theme = { ...newValue };
671
+ * ```
672
+ *
673
+ * @example Set multiple options
674
+ * ```ts
675
+ * terminal.options = {
676
+ * fontSize: 12,
677
+ * fontFamily: 'Courier New'
678
+ * };
679
+ * ```
680
+ */
681
+ options: ITerminalOptions;
682
+
683
+ /**
684
+ * Natural language strings that can be localized.
685
+ */
686
+ static strings: ILocalizableStrings;
687
+
688
+ /**
689
+ * Creates a new `Terminal` object.
690
+ *
691
+ * @param options An object containing a set of options.
692
+ */
693
+ constructor(options?: ITerminalOptions & ITerminalInitOnlyOptions);
694
+
695
+ /**
696
+ * Adds an event listener for when the bell is triggered.
697
+ * @returns an `IDisposable` to stop listening.
698
+ */
699
+ onBell: IEvent<void>;
700
+
701
+ /**
702
+ * Adds an event listener for when a binary event fires. This is used to
703
+ * enable non UTF-8 conformant binary messages to be sent to the backend.
704
+ * Currently this is only used for a certain type of mouse reports that
705
+ * happen to be not UTF-8 compatible.
706
+ * The event value is a JS string, pass it to the underlying pty as
707
+ * binary data, e.g. `pty.write(Buffer.from(data, 'binary'))`.
708
+ * @returns an `IDisposable` to stop listening.
709
+ */
710
+ onBinary: IEvent<string>;
711
+
712
+ /**
713
+ * Adds an event listener for the cursor moves.
714
+ * @returns an `IDisposable` to stop listening.
715
+ */
716
+ onCursorMove: IEvent<void>;
717
+
718
+ /**
719
+ * Adds an event listener for when a data event fires. This happens for
720
+ * example when the user types or pastes into the terminal. The event value
721
+ * is whatever `string` results, in a typical setup, this should be passed
722
+ * on to the backing pty.
723
+ * @returns an `IDisposable` to stop listening.
724
+ */
725
+ onData: IEvent<string>;
726
+
727
+ /**
728
+ * Adds an event listener for when a line feed is added.
729
+ * @returns an `IDisposable` to stop listening.
730
+ */
731
+ onLineFeed: IEvent<void>;
732
+
733
+ /**
734
+ * Adds an event listener for when data has been parsed by the terminal,
735
+ * after {@link write} is called. This event is useful to listen for any
736
+ * changes in the buffer.
737
+ *
738
+ * This fires at most once per frame, after data parsing completes. Note
739
+ * that this can fire when there are still writes pending if there is a lot
740
+ * of data.
741
+ */
742
+ onWriteParsed: IEvent<void>;
743
+
744
+ /**
745
+ * Adds an event listener for when the terminal is resized. The event value
746
+ * contains the new size.
747
+ * @returns an `IDisposable` to stop listening.
748
+ */
749
+ onResize: IEvent<{ cols: number, rows: number }>;
750
+
751
+ /**
752
+ * Adds an event listener for when a scroll occurs. The event value is the
753
+ * new position of the viewport.
754
+ * @returns an `IDisposable` to stop listening.
755
+ */
756
+ onScroll: IEvent<number>;
757
+
758
+ /**
759
+ * Adds an event listener for when an OSC 0 or OSC 2 title change occurs.
760
+ * The event value is the new title.
761
+ * @returns an `IDisposable` to stop listening.
762
+ */
763
+ onTitleChange: IEvent<string>;
764
+
765
+ /**
766
+ * Input data to application side. The data is treated the same way input
767
+ * typed into the terminal would (ie. the {@link onData} event will fire).
768
+ * @param data The data to forward to the application.
769
+ * @param wasUserInput Whether the input is genuine user input. This is true
770
+ * by default and triggers additionalbehavior like focus or selection
771
+ * clearing. Set this to false if the data sent should not be treated like
772
+ * user input would, for example passing an escape sequence to the
773
+ * application.
774
+ */
775
+ input(data: string, wasUserInput?: boolean): void;
776
+
777
+ /**
778
+ * Resizes the terminal. It's best practice to debounce calls to resize,
779
+ * this will help ensure that the pty can respond to the resize event
780
+ * before another one occurs.
781
+ * @param x The number of columns to resize to.
782
+ * @param y The number of rows to resize to.
783
+ */
784
+ resize(columns: number, rows: number): void;
785
+
786
+ /**
787
+ * Adds a marker to the normal buffer and returns it. If the alt buffer is
788
+ * active, undefined is returned.
789
+ * @param cursorYOffset The y position offset of the marker from the cursor.
790
+ * @returns The new marker or undefined.
791
+ */
792
+ registerMarker(cursorYOffset?: number): IMarker | undefined;
793
+
794
+ /*
795
+ * Disposes of the terminal, detaching it from the DOM and removing any
796
+ * active listeners. Once the terminal is disposed it should not be used
797
+ * again.
798
+ */
799
+ dispose(): void;
800
+
801
+ /**
802
+ * Scroll the display of the terminal
803
+ * @param amount The number of lines to scroll down (negative scroll up).
804
+ */
805
+ scrollLines(amount: number): void;
806
+
807
+ /**
808
+ * Scroll the display of the terminal by a number of pages.
809
+ * @param pageCount The number of pages to scroll (negative scrolls up).
810
+ */
811
+ scrollPages(pageCount: number): void;
812
+
813
+ /**
814
+ * Scrolls the display of the terminal to the top.
815
+ */
816
+ scrollToTop(): void;
817
+
818
+ /**
819
+ * Scrolls the display of the terminal to the bottom.
820
+ */
821
+ scrollToBottom(): void;
822
+
823
+ /**
824
+ * Scrolls to a line within the buffer.
825
+ * @param line The 0-based line index to scroll to.
826
+ */
827
+ scrollToLine(line: number): void;
828
+
829
+ /**
830
+ * Clear the entire buffer, making the prompt line the new first line.
831
+ */
832
+ clear(): void;
833
+
834
+ /**
835
+ * Write data to the terminal.
836
+ *
837
+ * Note that the change will not be reflected in the {@link buffer}
838
+ * immediately as the data is processed asynchronously. Provide a
839
+ * {@link callback} to know when the data was processed.
840
+ * @param data The data to write to the terminal. This can either be raw
841
+ * bytes given as Uint8Array from the pty or a string. Raw bytes will always
842
+ * be treated as UTF-8 encoded, string data as UTF-16.
843
+ * @param callback Optional callback that fires when the data was processed
844
+ * by the parser. This callback must be provided and awaited in order for
845
+ * {@link buffer} to reflect the change in the write.
846
+ */
847
+ write(data: string | Uint8Array, callback?: () => void): void;
848
+
849
+ /**
850
+ * Writes data to the terminal, followed by a break line character (\n).
851
+ *
852
+ * Note that the change will not be reflected in the {@link buffer}
853
+ * immediately as the data is processed asynchronously. Provide a
854
+ * {@link callback} to know when the data was processed.
855
+ * @param data The data to write to the terminal. This can either be raw
856
+ * bytes given as Uint8Array from the pty or a string. Raw bytes will always
857
+ * be treated as UTF-8 encoded, string data as UTF-16.
858
+ * @param callback Optional callback that fires when the data was processed
859
+ * by the parser. This callback must be provided and awaited in order for
860
+ * {@link buffer} to reflect the change in the write.
861
+ */
862
+ writeln(data: string | Uint8Array, callback?: () => void): void;
863
+
864
+ /**
865
+ * Perform a full reset (RIS, aka '\x1bc').
866
+ */
867
+ reset(): void;
868
+
869
+ /**
870
+ * Loads an addon into this instance of xterm.js.
871
+ * @param addon The addon to load.
872
+ */
873
+ loadAddon(addon: ITerminalAddon): void;
874
+ }
875
+
876
+ /**
877
+ * An addon that can provide additional functionality to the terminal.
878
+ */
879
+ export interface ITerminalAddon extends IDisposable {
880
+ /**
881
+ * This is called when the addon is activated.
882
+ */
883
+ activate(terminal: Terminal): void;
884
+ }
885
+
886
+ /**
887
+ * An object representing a range within the viewport of the terminal.
888
+ */
889
+ export interface IViewportRange {
890
+ /**
891
+ * The start of the range.
892
+ */
893
+ start: IViewportRangePosition;
894
+
895
+ /**
896
+ * The end of the range.
897
+ */
898
+ end: IViewportRangePosition;
899
+ }
900
+
901
+ /**
902
+ * An object representing a cell position within the viewport of the terminal.
903
+ */
904
+ interface IViewportRangePosition {
905
+ /**
906
+ * The x position of the cell. This is a 0-based index that refers to the
907
+ * space in between columns, not the column itself. Index 0 refers to the
908
+ * left side of the viewport, index `Terminal.cols` refers to the right side
909
+ * of the viewport. This can be thought of as how a cursor is positioned in
910
+ * a text editor.
911
+ */
912
+ x: number;
913
+
914
+ /**
915
+ * The y position of the cell. This is a 0-based index that refers to a
916
+ * specific row.
917
+ */
918
+ y: number;
919
+ }
920
+
921
+ /**
922
+ * A range within a buffer.
923
+ */
924
+ interface IBufferRange {
925
+ /**
926
+ * The start position of the range.
927
+ */
928
+ start: IBufferCellPosition;
929
+
930
+ /**
931
+ * The end position of the range.
932
+ */
933
+ end: IBufferCellPosition;
934
+ }
935
+
936
+ /**
937
+ * A position within a buffer.
938
+ */
939
+ interface IBufferCellPosition {
940
+ /**
941
+ * The x position within the buffer.
942
+ */
943
+ x: number;
944
+
945
+ /**
946
+ * The y position within the buffer.
947
+ */
948
+ y: number;
949
+ }
950
+
951
+ /**
952
+ * Represents a terminal buffer.
953
+ */
954
+ interface IBuffer {
955
+ /**
956
+ * The type of the buffer.
957
+ */
958
+ readonly type: 'normal' | 'alternate';
959
+
960
+ /**
961
+ * The y position of the cursor. This ranges between `0` (when the
962
+ * cursor is at baseY) and `Terminal.rows - 1` (when the cursor is on the
963
+ * last row).
964
+ */
965
+ readonly cursorY: number;
966
+
967
+ /**
968
+ * The x position of the cursor. This ranges between `0` (left side) and
969
+ * `Terminal.cols` (after last cell of the row).
970
+ */
971
+ readonly cursorX: number;
972
+
973
+ /**
974
+ * The line within the buffer where the top of the viewport is.
975
+ */
976
+ readonly viewportY: number;
977
+
978
+ /**
979
+ * The line within the buffer where the top of the bottom page is (when
980
+ * fully scrolled down).
981
+ */
982
+ readonly baseY: number;
983
+
984
+ /**
985
+ * The amount of lines in the buffer.
986
+ */
987
+ readonly length: number;
988
+
989
+ /**
990
+ * Gets a line from the buffer, or undefined if the line index does not
991
+ * exist.
992
+ *
993
+ * Note that the result of this function should be used immediately after
994
+ * calling as when the terminal updates it could lead to unexpected
995
+ * behavior.
996
+ *
997
+ * @param y The line index to get.
998
+ */
999
+ getLine(y: number): IBufferLine | undefined;
1000
+
1001
+ /**
1002
+ * Creates an empty cell object suitable as a cell reference in
1003
+ * `line.getCell(x, cell)`. Use this to avoid costly recreation of
1004
+ * cell objects when dealing with tons of cells.
1005
+ */
1006
+ getNullCell(): IBufferCell;
1007
+ }
1008
+
1009
+ /**
1010
+ * Represents the terminal's set of buffers.
1011
+ */
1012
+ interface IBufferNamespace {
1013
+ /**
1014
+ * The active buffer, this will either be the normal or alternate buffers.
1015
+ */
1016
+ readonly active: IBuffer;
1017
+
1018
+ /**
1019
+ * The normal buffer.
1020
+ */
1021
+ readonly normal: IBuffer;
1022
+
1023
+ /**
1024
+ * The alternate buffer, this becomes the active buffer when an application
1025
+ * enters this mode via DECSET (`CSI ? 4 7 h`)
1026
+ */
1027
+ readonly alternate: IBuffer;
1028
+
1029
+ /**
1030
+ * Adds an event listener for when the active buffer changes.
1031
+ * @returns an `IDisposable` to stop listening.
1032
+ */
1033
+ onBufferChange: IEvent<IBuffer>;
1034
+ }
1035
+
1036
+ /**
1037
+ * Represents a line in the terminal's buffer.
1038
+ */
1039
+ interface IBufferLine {
1040
+ /**
1041
+ * Whether the line is wrapped from the previous line.
1042
+ */
1043
+ readonly isWrapped: boolean;
1044
+
1045
+ /**
1046
+ * The length of the line, all call to getCell beyond the length will result
1047
+ * in `undefined`.
1048
+ */
1049
+ readonly length: number;
1050
+
1051
+ /**
1052
+ * Gets a cell from the line, or undefined if the line index does not exist.
1053
+ *
1054
+ * Note that the result of this function should be used immediately after
1055
+ * calling as when the terminal updates it could lead to unexpected
1056
+ * behavior.
1057
+ *
1058
+ * @param x The character index to get.
1059
+ * @param cell Optional cell object to load data into for performance
1060
+ * reasons. This is mainly useful when every cell in the buffer is being
1061
+ * looped over to avoid creating new objects for every cell.
1062
+ */
1063
+ getCell(x: number, cell?: IBufferCell): IBufferCell | undefined;
1064
+
1065
+ /**
1066
+ * Gets the line as a string. Note that this is gets only the string for the
1067
+ * line, not taking isWrapped into account.
1068
+ *
1069
+ * @param trimRight Whether to trim any whitespace at the right of the line.
1070
+ * @param startColumn The column to start from (inclusive).
1071
+ * @param endColumn The column to end at (exclusive).
1072
+ */
1073
+ translateToString(trimRight?: boolean, startColumn?: number, endColumn?: number): string;
1074
+ }
1075
+
1076
+ /**
1077
+ * Represents a single cell in the terminal's buffer.
1078
+ */
1079
+ interface IBufferCell {
1080
+ /**
1081
+ * The width of the character. Some examples:
1082
+ *
1083
+ * - `1` for most cells.
1084
+ * - `2` for wide character like CJK glyphs.
1085
+ * - `0` for cells immediately following cells with a width of `2`.
1086
+ */
1087
+ getWidth(): number;
1088
+
1089
+ /**
1090
+ * The character(s) within the cell. Examples of what this can contain:
1091
+ *
1092
+ * - A normal width character
1093
+ * - A wide character (eg. CJK)
1094
+ * - An emoji
1095
+ */
1096
+ getChars(): string;
1097
+
1098
+ /**
1099
+ * Gets the UTF32 codepoint of single characters, if content is a combined
1100
+ * string it returns the codepoint of the last character in the string.
1101
+ */
1102
+ getCode(): number;
1103
+
1104
+ /**
1105
+ * Gets the number representation of the foreground color mode, this can be
1106
+ * used to perform quick comparisons of 2 cells to see if they're the same.
1107
+ * Use `isFgRGB`, `isFgPalette` and `isFgDefault` to check what color mode
1108
+ * a cell is.
1109
+ */
1110
+ getFgColorMode(): number;
1111
+
1112
+ /**
1113
+ * Gets the number representation of the background color mode, this can be
1114
+ * used to perform quick comparisons of 2 cells to see if they're the same.
1115
+ * Use `isBgRGB`, `isBgPalette` and `isBgDefault` to check what color mode
1116
+ * a cell is.
1117
+ */
1118
+ getBgColorMode(): number;
1119
+
1120
+ /**
1121
+ * Gets a cell's foreground color number, this differs depending on what the
1122
+ * color mode of the cell is:
1123
+ *
1124
+ * - Default: This should be 0, representing the default foreground color
1125
+ * (CSI 39 m).
1126
+ * - Palette: This is a number from 0 to 255 of ANSI colors (CSI 3(0-7) m,
1127
+ * CSI 9(0-7) m, CSI 38 ; 5 ; 0-255 m).
1128
+ * - RGB: A hex value representing a 'true color': 0xRRGGBB.
1129
+ * (CSI 3 8 ; 2 ; Pi ; Pr ; Pg ; Pb)
1130
+ */
1131
+ getFgColor(): number;
1132
+
1133
+ /**
1134
+ * Gets a cell's background color number, this differs depending on what the
1135
+ * color mode of the cell is:
1136
+ *
1137
+ * - Default: This should be 0, representing the default background color
1138
+ * (CSI 49 m).
1139
+ * - Palette: This is a number from 0 to 255 of ANSI colors
1140
+ * (CSI 4(0-7) m, CSI 10(0-7) m, CSI 48 ; 5 ; 0-255 m).
1141
+ * - RGB: A hex value representing a 'true color': 0xRRGGBB
1142
+ * (CSI 4 8 ; 2 ; Pi ; Pr ; Pg ; Pb)
1143
+ */
1144
+ getBgColor(): number;
1145
+
1146
+ /** Whether the cell has the bold attribute (CSI 1 m). */
1147
+ isBold(): number;
1148
+ /** Whether the cell has the italic attribute (CSI 3 m). */
1149
+ isItalic(): number;
1150
+ /** Whether the cell has the dim attribute (CSI 2 m). */
1151
+ isDim(): number;
1152
+ /** Whether the cell has the underline attribute (CSI 4 m). */
1153
+ isUnderline(): number;
1154
+ /** Whether the cell has the blink attribute (CSI 5 m). */
1155
+ isBlink(): number;
1156
+ /** Whether the cell has the inverse attribute (CSI 7 m). */
1157
+ isInverse(): number;
1158
+ /** Whether the cell has the invisible attribute (CSI 8 m). */
1159
+ isInvisible(): number;
1160
+ /** Whether the cell has the strikethrough attribute (CSI 9 m). */
1161
+ isStrikethrough(): number;
1162
+ /** Whether the cell has the overline attribute (CSI 53 m). */
1163
+ isOverline(): number;
1164
+
1165
+ /** Whether the cell is using the RGB foreground color mode. */
1166
+ isFgRGB(): boolean;
1167
+ /** Whether the cell is using the RGB background color mode. */
1168
+ isBgRGB(): boolean;
1169
+ /** Whether the cell is using the palette foreground color mode. */
1170
+ isFgPalette(): boolean;
1171
+ /** Whether the cell is using the palette background color mode. */
1172
+ isBgPalette(): boolean;
1173
+ /** Whether the cell is using the default foreground color mode. */
1174
+ isFgDefault(): boolean;
1175
+ /** Whether the cell is using the default background color mode. */
1176
+ isBgDefault(): boolean;
1177
+
1178
+ /** Whether the cell has the default attribute (no color or style). */
1179
+ isAttributeDefault(): boolean;
1180
+ }
1181
+
1182
+ /**
1183
+ * Data type to register a CSI, DCS or ESC callback in the parser
1184
+ * in the form:
1185
+ * ESC I..I F
1186
+ * CSI Prefix P..P I..I F
1187
+ * DCS Prefix P..P I..I F data_bytes ST
1188
+ *
1189
+ * with these rules/restrictions:
1190
+ * - prefix can only be used with CSI and DCS
1191
+ * - only one leading prefix byte is recognized by the parser
1192
+ * before any other parameter bytes (P..P)
1193
+ * - intermediate bytes are recognized up to 2
1194
+ *
1195
+ * For custom sequences make sure to read ECMA-48 and the resources at
1196
+ * vt100.net to not clash with existing sequences or reserved address space.
1197
+ * General recommendations:
1198
+ * - use private address space (see ECMA-48)
1199
+ * - use max one intermediate byte (technically not limited by the spec,
1200
+ * in practice there are no sequences with more than one intermediate byte,
1201
+ * thus parsers might get confused with more intermediates)
1202
+ * - test against other common emulators to check whether they escape/ignore
1203
+ * the sequence correctly
1204
+ *
1205
+ * Notes: OSC command registration is handled differently (see addOscHandler)
1206
+ * APC, PM or SOS is currently not supported.
1207
+ */
1208
+ export interface IFunctionIdentifier {
1209
+ /**
1210
+ * Optional prefix byte, must be in range \x3c .. \x3f.
1211
+ * Usable in CSI and DCS.
1212
+ */
1213
+ prefix?: string;
1214
+ /**
1215
+ * Optional intermediate bytes, must be in range \x20 .. \x2f.
1216
+ * Usable in CSI, DCS and ESC.
1217
+ */
1218
+ intermediates?: string;
1219
+ /**
1220
+ * Final byte, must be in range \x40 .. \x7e for CSI and DCS,
1221
+ * \x30 .. \x7e for ESC.
1222
+ */
1223
+ final: string;
1224
+ }
1225
+
1226
+ /**
1227
+ * Allows hooking into the parser for custom handling of escape sequences.
1228
+ */
1229
+ export interface IParser {
1230
+ /**
1231
+ * Adds a handler for CSI escape sequences.
1232
+ * @param id Specifies the function identifier under which the callback
1233
+ * gets registered, e.g. {final: 'm'} for SGR.
1234
+ * @param callback The function to handle the sequence. The callback is
1235
+ * called with the numerical params. If the sequence has subparams the
1236
+ * array will contain subarrays with their numercial values.
1237
+ * Return true if the sequence was handled; false if we should try
1238
+ * a previous handler (set by addCsiHandler or setCsiHandler).
1239
+ * The most recently added handler is tried first.
1240
+ * @returns An IDisposable you can call to remove this handler.
1241
+ */
1242
+ registerCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean): IDisposable;
1243
+
1244
+ /**
1245
+ * Adds a handler for DCS escape sequences.
1246
+ * @param id Specifies the function identifier under which the callback
1247
+ * gets registered, e.g. {intermediates: '$' final: 'q'} for DECRQSS.
1248
+ * @param callback The function to handle the sequence. Note that the
1249
+ * function will only be called once if the sequence finished sucessfully.
1250
+ * There is currently no way to intercept smaller data chunks, data chunks
1251
+ * will be stored up until the sequence is finished. Since DCS sequences
1252
+ * are not limited by the amount of data this might impose a problem for
1253
+ * big payloads. Currently xterm.js limits DCS payload to 10 MB
1254
+ * which should give enough room for most use cases.
1255
+ * The function gets the payload and numerical parameters as arguments.
1256
+ * Return true if the sequence was handled; false if we should try
1257
+ * a previous handler (set by addDcsHandler or setDcsHandler).
1258
+ * The most recently added handler is tried first.
1259
+ * @returns An IDisposable you can call to remove this handler.
1260
+ */
1261
+ registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean): IDisposable;
1262
+
1263
+ /**
1264
+ * Adds a handler for ESC escape sequences.
1265
+ * @param id Specifies the function identifier under which the callback
1266
+ * gets registered, e.g. {intermediates: '%' final: 'G'} for
1267
+ * default charset selection.
1268
+ * @param callback The function to handle the sequence.
1269
+ * Return true if the sequence was handled; false if we should try
1270
+ * a previous handler (set by addEscHandler or setEscHandler).
1271
+ * The most recently added handler is tried first.
1272
+ * @returns An IDisposable you can call to remove this handler.
1273
+ */
1274
+ registerEscHandler(id: IFunctionIdentifier, handler: () => boolean): IDisposable;
1275
+
1276
+ /**
1277
+ * Adds a handler for OSC escape sequences.
1278
+ * @param ident The number (first parameter) of the sequence.
1279
+ * @param callback The function to handle the sequence. Note that the
1280
+ * function will only be called once if the sequence finished sucessfully.
1281
+ * There is currently no way to intercept smaller data chunks, data chunks
1282
+ * will be stored up until the sequence is finished. Since OSC sequences
1283
+ * are not limited by the amount of data this might impose a problem for
1284
+ * big payloads. Currently xterm.js limits OSC payload to 10 MB
1285
+ * which should give enough room for most use cases.
1286
+ * The callback is called with OSC data string.
1287
+ * Return true if the sequence was handled; false if we should try
1288
+ * a previous handler (set by addOscHandler or setOscHandler).
1289
+ * The most recently added handler is tried first.
1290
+ * @returns An IDisposable you can call to remove this handler.
1291
+ */
1292
+ registerOscHandler(ident: number, callback: (data: string) => boolean): IDisposable;
1293
+ }
1294
+
1295
+ /**
1296
+ * (EXPERIMENTAL) Unicode version provider.
1297
+ * Used to register custom Unicode versions with `Terminal.unicode.register`.
1298
+ */
1299
+ export interface IUnicodeVersionProvider {
1300
+ /**
1301
+ * String indicating the Unicode version provided.
1302
+ */
1303
+ readonly version: string;
1304
+
1305
+ /**
1306
+ * Unicode version dependent wcwidth implementation.
1307
+ */
1308
+ wcwidth(codepoint: number): 0 | 1 | 2;
1309
+ charProperties(codepoint: number, preceding: number): number;
1310
+ }
1311
+
1312
+ /**
1313
+ * (EXPERIMENTAL) Unicode handling interface.
1314
+ */
1315
+ export interface IUnicodeHandling {
1316
+ /**
1317
+ * Register a custom Unicode version provider.
1318
+ */
1319
+ register(provider: IUnicodeVersionProvider): void;
1320
+
1321
+ /**
1322
+ * Registered Unicode versions.
1323
+ */
1324
+ readonly versions: ReadonlyArray<string>;
1325
+
1326
+ /**
1327
+ * Getter/setter for active Unicode version.
1328
+ */
1329
+ activeVersion: string;
1330
+ }
1331
+
1332
+ /**
1333
+ * Terminal modes as set by SM/DECSET.
1334
+ */
1335
+ export interface IModes {
1336
+ /**
1337
+ * Application Cursor Keys (DECCKM): `CSI ? 1 h`
1338
+ */
1339
+ readonly applicationCursorKeysMode: boolean;
1340
+ /**
1341
+ * Application Keypad Mode (DECNKM): `CSI ? 6 6 h`
1342
+ */
1343
+ readonly applicationKeypadMode: boolean;
1344
+ /**
1345
+ * Bracketed Paste Mode: `CSI ? 2 0 0 4 h`
1346
+ */
1347
+ readonly bracketedPasteMode: boolean;
1348
+ /**
1349
+ * Insert Mode (IRM): `CSI 4 h`
1350
+ */
1351
+ readonly insertMode: boolean;
1352
+ /**
1353
+ * Mouse Tracking, this can be one of the following:
1354
+ * - none: This is the default value and can be reset with DECRST
1355
+ * - x10: Send Mouse X & Y on button press `CSI ? 9 h`
1356
+ * - vt200: Send Mouse X & Y on button press and release `CSI ? 1 0 0 0 h`
1357
+ * - drag: Use Cell Motion Mouse Tracking `CSI ? 1 0 0 2 h`
1358
+ * - any: Use All Motion Mouse Tracking `CSI ? 1 0 0 3 h`
1359
+ */
1360
+ readonly mouseTrackingMode: 'none' | 'x10' | 'vt200' | 'drag' | 'any';
1361
+ /**
1362
+ * Origin Mode (DECOM): `CSI ? 6 h`
1363
+ */
1364
+ readonly originMode: boolean;
1365
+ /**
1366
+ * Reverse-wraparound Mode: `CSI ? 4 5 h`
1367
+ */
1368
+ readonly reverseWraparoundMode: boolean;
1369
+ /**
1370
+ * Send FocusIn/FocusOut events: `CSI ? 1 0 0 4 h`
1371
+ */
1372
+ readonly sendFocusMode: boolean;
1373
+ /**
1374
+ * Synchronized Output Mode: `CSI ? 2 0 2 6 h`
1375
+ *
1376
+ * When enabled, output is buffered and only rendered when the mode is
1377
+ * disabled, allowing for atomic screen updates without tearing.
1378
+ */
1379
+ readonly synchronizedOutputMode: boolean;
1380
+ /**
1381
+ * Auto-Wrap Mode (DECAWM): `CSI ? 7 h`
1382
+ */
1383
+ readonly wraparoundMode: boolean;
1384
+ }
1385
+ }