@orion-agents/orion-code 0.4.8 → 0.4.9
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.
- package/CHANGELOG.md +8 -0
- package/README.md +5 -5
- package/README.zh-CN.md +5 -5
- package/dist/cli.js +42 -3
- package/dist/commands/session-command-handlers.js +8 -3
- package/dist/commands/system-commands.js +3 -3
- package/dist/commands/types.d.ts +3 -0
- package/dist/framework/loop-progress.js +3 -1
- package/dist/framework/query.d.ts +3 -1
- package/dist/framework/query.js +18 -3
- package/dist/framework/tool-serializer.d.ts +12 -0
- package/dist/framework/tool-serializer.js +35 -0
- package/dist/framework/tool.d.ts +2 -0
- package/dist/harness/ledger.js +2 -1
- package/dist/print-ui/delivery.d.ts +15 -0
- package/dist/print-ui/delivery.js +131 -0
- package/dist/print-ui/event-stream.d.ts +6 -1
- package/dist/print-ui/event-stream.js +56 -10
- package/dist/print-ui/launch.d.ts +5 -0
- package/dist/print-ui/launch.js +66 -9
- package/dist/runtime/agent-loop.d.ts +3 -1
- package/dist/runtime/agent-loop.js +20 -8
- package/dist/runtime/agent-runtime-controller.d.ts +4 -1
- package/dist/runtime/agent-runtime-controller.js +36 -22
- package/dist/runtime/agent-runtime-runner.d.ts +4 -0
- package/dist/runtime/agent-runtime-runner.js +9 -0
- package/dist/runtime/builtin-tool-provider.js +6 -5
- package/dist/runtime/composer/layout.d.ts +1 -1
- package/dist/runtime/composer/layout.js +5 -5
- package/dist/runtime/core-tools/descriptors.d.ts +1 -1
- package/dist/runtime/core-tools/descriptors.js +39 -1
- package/dist/runtime/first-party-core-provider.js +1 -0
- package/dist/runtime/first-party-tool-services.js +10 -0
- package/dist/runtime/goals/evidence.js +2 -0
- package/dist/runtime/legacy-thread-materializer.d.ts +7 -0
- package/dist/runtime/legacy-thread-materializer.js +32 -6
- package/dist/runtime/orion-runtime-v1.d.ts +2 -1
- package/dist/runtime/orion-runtime-v1.js +1 -0
- package/dist/runtime/product-bootstrap.d.ts +2 -0
- package/dist/runtime/product-bootstrap.js +1 -0
- package/dist/runtime/product-orion-runtime.d.ts +2 -1
- package/dist/runtime/product-orion-runtime.js +1 -0
- package/dist/runtime/rich-text/layout.d.ts +3 -1
- package/dist/runtime/rich-text/layout.js +37 -22
- package/dist/runtime/shell-process-sessions.d.ts +41 -0
- package/dist/runtime/shell-process-sessions.js +258 -0
- package/dist/runtime/step-snapshot.js +4 -1
- package/dist/runtime/subagents/presets.d.ts +1 -1
- package/dist/runtime/subagents/presets.js +1 -0
- package/dist/runtime/task-context-recovery.js +7 -0
- package/dist/runtime/thread-event-store.d.ts +3 -0
- package/dist/runtime/thread-event-store.js +35 -22
- package/dist/runtime/thread-session-index.d.ts +15 -3
- package/dist/runtime/thread-session-index.js +152 -45
- package/dist/runtime/thread-session-view.js +1 -1
- package/dist/runtime/thread-ui-adapter.d.ts +1 -1
- package/dist/runtime/thread-ui-adapter.js +14 -8
- package/dist/runtime/tool-gateway.d.ts +1 -0
- package/dist/runtime/tool-gateway.js +1 -0
- package/dist/runtime/tool-transcript-entry.d.ts +8 -1
- package/dist/runtime/tool-transcript-entry.js +35 -7
- package/dist/runtime/ui-events.d.ts +7 -0
- package/dist/services/global-config.d.ts +1 -1
- package/dist/services/global-config.js +2 -0
- package/dist/services/llm.d.ts +3 -0
- package/dist/services/llm.js +48 -4
- package/dist/terminal-ui/raw-editor.js +2 -1
- package/dist/tools/core/exec-command.js +51 -42
- package/dist/tools/core/index.d.ts +2 -1
- package/dist/tools/core/index.js +4 -1
- package/dist/tools/core/process-session.d.ts +2 -0
- package/dist/tools/core/process-session.js +54 -0
- package/dist/tui-core/frame.d.ts +2 -0
- package/dist/tui-core/frame.js +19 -0
- package/dist/tui-core/input-parser.d.ts +4 -1
- package/dist/tui-core/input-parser.js +22 -0
- package/dist/tui-ui/chrome-view-model.d.ts +0 -2
- package/dist/tui-ui/chrome-view-model.js +54 -56
- package/dist/tui-ui/launch.js +133 -202
- package/dist/tui-ui/layout.d.ts +16 -41
- package/dist/tui-ui/layout.js +408 -295
- package/dist/tui-ui/render-scheduler.d.ts +2 -5
- package/dist/tui-ui/render-scheduler.js +10 -10
- package/dist/tui-ui/response-clipboard.d.ts +17 -0
- package/dist/tui-ui/response-clipboard.js +201 -0
- package/dist/tui-ui/runner.d.ts +65 -80
- package/dist/tui-ui/runner.js +545 -738
- package/dist/tui-ui/session-picker-preview.d.ts +8 -0
- package/dist/tui-ui/session-picker-preview.js +119 -0
- package/dist/tui-ui/session-picker.d.ts +20 -0
- package/dist/tui-ui/session-picker.js +42 -0
- package/dist/tui-ui/state.d.ts +34 -81
- package/dist/tui-ui/state.js +155 -288
- package/dist/tui-ui/terminal-image.d.ts +3 -7
- package/dist/tui-ui/terminal-image.js +18 -47
- package/dist/tui-ui/terminal-viewport.d.ts +55 -0
- package/dist/tui-ui/terminal-viewport.js +221 -0
- package/dist/tui-ui/transcript-layout.d.ts +5 -0
- package/dist/tui-ui/transcript-layout.js +43 -28
- package/dist/tui-ui/transcript-pager.d.ts +39 -0
- package/dist/tui-ui/transcript-pager.js +278 -0
- package/dist/tui-ui/transcript-tool-output.d.ts +16 -0
- package/dist/tui-ui/transcript-tool-output.js +102 -0
- package/dist/utils/bounded-file.d.ts +4 -0
- package/dist/utils/bounded-file.js +30 -0
- package/dist/utils/command-process.d.ts +4 -0
- package/dist/utils/command-process.js +23 -0
- package/docs/cli-guide.md +50 -6
- package/npm-shrinkwrap.json +115 -15
- package/package.json +4 -1
- package/dist/tui-ui/inline-surface.d.ts +0 -191
- package/dist/tui-ui/inline-surface.js +0 -644
- package/dist/tui-ui/input-ownership.d.ts +0 -46
- package/dist/tui-ui/input-ownership.js +0 -74
- package/dist/tui-ui/transcript-inspector-layout.d.ts +0 -9
- package/dist/tui-ui/transcript-inspector-layout.js +0 -107
- package/dist/tui-ui/transcript-inspector-surface.d.ts +0 -18
- package/dist/tui-ui/transcript-inspector-surface.js +0 -91
- package/dist/tui-ui/transcript-inspector.d.ts +0 -36
- package/dist/tui-ui/transcript-inspector.js +0 -129
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orion-agents/orion-code",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@orion-agents/orion-code",
|
|
9
|
-
"version": "0.4.
|
|
9
|
+
"version": "0.4.9",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@agentclientprotocol/sdk": "2.12.0",
|
|
13
13
|
"@clack/prompts": "^0.7.0",
|
|
14
|
+
"ajv": "8.20.0",
|
|
15
|
+
"ajv-formats": "3.0.1",
|
|
14
16
|
"axios": "^1.6.0",
|
|
15
17
|
"better-sqlite3": "^12.10.0",
|
|
16
18
|
"chalk": "^4.1.2",
|
|
@@ -39,6 +41,7 @@
|
|
|
39
41
|
"@types/node": "^22.0.0",
|
|
40
42
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
41
43
|
"@typescript-eslint/parser": "^7.18.0",
|
|
44
|
+
"@xterm/headless": "6.0.0",
|
|
42
45
|
"eslint": "^8.56.0",
|
|
43
46
|
"eslint-config-prettier": "^9.1.2",
|
|
44
47
|
"jest": "^29.7.0",
|
|
@@ -706,6 +709,30 @@
|
|
|
706
709
|
"url": "https://opencollective.com/eslint"
|
|
707
710
|
}
|
|
708
711
|
},
|
|
712
|
+
"node_modules/@eslint/eslintrc/node_modules/ajv": {
|
|
713
|
+
"version": "6.15.0",
|
|
714
|
+
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz",
|
|
715
|
+
"integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==",
|
|
716
|
+
"dev": true,
|
|
717
|
+
"license": "MIT",
|
|
718
|
+
"dependencies": {
|
|
719
|
+
"fast-deep-equal": "^3.1.1",
|
|
720
|
+
"fast-json-stable-stringify": "^2.0.0",
|
|
721
|
+
"json-schema-traverse": "^0.4.1",
|
|
722
|
+
"uri-js": "^4.2.2"
|
|
723
|
+
},
|
|
724
|
+
"funding": {
|
|
725
|
+
"type": "github",
|
|
726
|
+
"url": "https://github.com/sponsors/epoberezkin"
|
|
727
|
+
}
|
|
728
|
+
},
|
|
729
|
+
"node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": {
|
|
730
|
+
"version": "0.4.1",
|
|
731
|
+
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
|
|
732
|
+
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
|
|
733
|
+
"dev": true,
|
|
734
|
+
"license": "MIT"
|
|
735
|
+
},
|
|
709
736
|
"node_modules/@eslint/js": {
|
|
710
737
|
"version": "8.57.1",
|
|
711
738
|
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz",
|
|
@@ -1695,6 +1722,16 @@
|
|
|
1695
1722
|
"dev": true,
|
|
1696
1723
|
"license": "ISC"
|
|
1697
1724
|
},
|
|
1725
|
+
"node_modules/@xterm/headless": {
|
|
1726
|
+
"version": "6.0.0",
|
|
1727
|
+
"resolved": "https://registry.npmjs.org/@xterm/headless/-/headless-6.0.0.tgz",
|
|
1728
|
+
"integrity": "sha512-5Yj1QINYCyzrZtf8OFIHi47iQtI+0qYFPHmouEfG8dHNxbZ9Tb9YGSuLcsEwj9Z+OL75GJqPyJbyoFer80a2Hw==",
|
|
1729
|
+
"dev": true,
|
|
1730
|
+
"license": "MIT",
|
|
1731
|
+
"workspaces": [
|
|
1732
|
+
"addons/*"
|
|
1733
|
+
]
|
|
1734
|
+
},
|
|
1698
1735
|
"node_modules/abort-controller": {
|
|
1699
1736
|
"version": "3.0.0",
|
|
1700
1737
|
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
|
|
@@ -1756,22 +1793,38 @@
|
|
|
1756
1793
|
}
|
|
1757
1794
|
},
|
|
1758
1795
|
"node_modules/ajv": {
|
|
1759
|
-
"version": "
|
|
1760
|
-
"resolved": "https://registry.npmjs.org/ajv/-/ajv-
|
|
1761
|
-
"integrity": "sha512-
|
|
1762
|
-
"dev": true,
|
|
1796
|
+
"version": "8.20.0",
|
|
1797
|
+
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz",
|
|
1798
|
+
"integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",
|
|
1763
1799
|
"license": "MIT",
|
|
1764
1800
|
"dependencies": {
|
|
1765
|
-
"fast-deep-equal": "^3.1.
|
|
1766
|
-
"fast-
|
|
1767
|
-
"json-schema-traverse": "^0.
|
|
1768
|
-
"
|
|
1801
|
+
"fast-deep-equal": "^3.1.3",
|
|
1802
|
+
"fast-uri": "^3.0.1",
|
|
1803
|
+
"json-schema-traverse": "^1.0.0",
|
|
1804
|
+
"require-from-string": "^2.0.2"
|
|
1769
1805
|
},
|
|
1770
1806
|
"funding": {
|
|
1771
1807
|
"type": "github",
|
|
1772
1808
|
"url": "https://github.com/sponsors/epoberezkin"
|
|
1773
1809
|
}
|
|
1774
1810
|
},
|
|
1811
|
+
"node_modules/ajv-formats": {
|
|
1812
|
+
"version": "3.0.1",
|
|
1813
|
+
"resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz",
|
|
1814
|
+
"integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==",
|
|
1815
|
+
"license": "MIT",
|
|
1816
|
+
"dependencies": {
|
|
1817
|
+
"ajv": "^8.0.0"
|
|
1818
|
+
},
|
|
1819
|
+
"peerDependencies": {
|
|
1820
|
+
"ajv": "^8.0.0"
|
|
1821
|
+
},
|
|
1822
|
+
"peerDependenciesMeta": {
|
|
1823
|
+
"ajv": {
|
|
1824
|
+
"optional": true
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
},
|
|
1775
1828
|
"node_modules/ansi-escapes": {
|
|
1776
1829
|
"version": "4.3.2",
|
|
1777
1830
|
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz",
|
|
@@ -2957,6 +3010,30 @@
|
|
|
2957
3010
|
"url": "https://opencollective.com/eslint"
|
|
2958
3011
|
}
|
|
2959
3012
|
},
|
|
3013
|
+
"node_modules/eslint/node_modules/ajv": {
|
|
3014
|
+
"version": "6.15.0",
|
|
3015
|
+
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz",
|
|
3016
|
+
"integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==",
|
|
3017
|
+
"dev": true,
|
|
3018
|
+
"license": "MIT",
|
|
3019
|
+
"dependencies": {
|
|
3020
|
+
"fast-deep-equal": "^3.1.1",
|
|
3021
|
+
"fast-json-stable-stringify": "^2.0.0",
|
|
3022
|
+
"json-schema-traverse": "^0.4.1",
|
|
3023
|
+
"uri-js": "^4.2.2"
|
|
3024
|
+
},
|
|
3025
|
+
"funding": {
|
|
3026
|
+
"type": "github",
|
|
3027
|
+
"url": "https://github.com/sponsors/epoberezkin"
|
|
3028
|
+
}
|
|
3029
|
+
},
|
|
3030
|
+
"node_modules/eslint/node_modules/json-schema-traverse": {
|
|
3031
|
+
"version": "0.4.1",
|
|
3032
|
+
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
|
|
3033
|
+
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
|
|
3034
|
+
"dev": true,
|
|
3035
|
+
"license": "MIT"
|
|
3036
|
+
},
|
|
2960
3037
|
"node_modules/espree": {
|
|
2961
3038
|
"version": "9.6.1",
|
|
2962
3039
|
"resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
|
|
@@ -3128,7 +3205,6 @@
|
|
|
3128
3205
|
"version": "3.1.3",
|
|
3129
3206
|
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
|
3130
3207
|
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
|
|
3131
|
-
"dev": true,
|
|
3132
3208
|
"license": "MIT"
|
|
3133
3209
|
},
|
|
3134
3210
|
"node_modules/fast-glob": {
|
|
@@ -3175,6 +3251,22 @@
|
|
|
3175
3251
|
"dev": true,
|
|
3176
3252
|
"license": "MIT"
|
|
3177
3253
|
},
|
|
3254
|
+
"node_modules/fast-uri": {
|
|
3255
|
+
"version": "3.1.9",
|
|
3256
|
+
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz",
|
|
3257
|
+
"integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==",
|
|
3258
|
+
"funding": [
|
|
3259
|
+
{
|
|
3260
|
+
"type": "github",
|
|
3261
|
+
"url": "https://github.com/sponsors/fastify"
|
|
3262
|
+
},
|
|
3263
|
+
{
|
|
3264
|
+
"type": "opencollective",
|
|
3265
|
+
"url": "https://opencollective.com/fastify"
|
|
3266
|
+
}
|
|
3267
|
+
],
|
|
3268
|
+
"license": "BSD-3-Clause"
|
|
3269
|
+
},
|
|
3178
3270
|
"node_modules/fastq": {
|
|
3179
3271
|
"version": "1.20.1",
|
|
3180
3272
|
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz",
|
|
@@ -4597,10 +4689,9 @@
|
|
|
4597
4689
|
"license": "MIT"
|
|
4598
4690
|
},
|
|
4599
4691
|
"node_modules/json-schema-traverse": {
|
|
4600
|
-
"version": "0.
|
|
4601
|
-
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.
|
|
4602
|
-
"integrity": "sha512-
|
|
4603
|
-
"dev": true,
|
|
4692
|
+
"version": "1.0.0",
|
|
4693
|
+
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
|
|
4694
|
+
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
|
|
4604
4695
|
"license": "MIT"
|
|
4605
4696
|
},
|
|
4606
4697
|
"node_modules/json-stable-stringify-without-jsonify": {
|
|
@@ -5647,6 +5738,15 @@
|
|
|
5647
5738
|
"node": ">=0.10.0"
|
|
5648
5739
|
}
|
|
5649
5740
|
},
|
|
5741
|
+
"node_modules/require-from-string": {
|
|
5742
|
+
"version": "2.0.2",
|
|
5743
|
+
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
|
|
5744
|
+
"integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
|
|
5745
|
+
"license": "MIT",
|
|
5746
|
+
"engines": {
|
|
5747
|
+
"node": ">=0.10.0"
|
|
5748
|
+
}
|
|
5749
|
+
},
|
|
5650
5750
|
"node_modules/resolve": {
|
|
5651
5751
|
"version": "1.22.12",
|
|
5652
5752
|
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.12.tgz",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orion-agents/orion-code",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"description": "Orion Code - local-first goal-driven coding agent for the terminal.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -78,6 +78,8 @@
|
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@agentclientprotocol/sdk": "2.12.0",
|
|
80
80
|
"@clack/prompts": "^0.7.0",
|
|
81
|
+
"ajv": "8.20.0",
|
|
82
|
+
"ajv-formats": "3.0.1",
|
|
81
83
|
"axios": "^1.6.0",
|
|
82
84
|
"better-sqlite3": "^12.10.0",
|
|
83
85
|
"chalk": "^4.1.2",
|
|
@@ -103,6 +105,7 @@
|
|
|
103
105
|
"@types/node": "^22.0.0",
|
|
104
106
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
105
107
|
"@typescript-eslint/parser": "^7.18.0",
|
|
108
|
+
"@xterm/headless": "6.0.0",
|
|
106
109
|
"eslint": "^8.56.0",
|
|
107
110
|
"eslint-config-prettier": "^9.1.2",
|
|
108
111
|
"jest": "^29.7.0",
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* InlineTerminalSurface: primary-screen inline TUI surface.
|
|
3
|
-
*
|
|
4
|
-
* Replaces the alternate-screen (1049) approach. Finalized transcript
|
|
5
|
-
* content is committed once to stdout (entering shell native scrollback),
|
|
6
|
-
* while the bottom live region holds only ephemeral content (streaming
|
|
7
|
-
* assistant, running tools, overlay, status, prompt).
|
|
8
|
-
*
|
|
9
|
-
* Control sequences used (relative addressing only):
|
|
10
|
-
* CR \r return to column 0
|
|
11
|
-
* EL2 \x1b[2K erase current line
|
|
12
|
-
* CUU(n) \x1b[<n>A cursor up (relative)
|
|
13
|
-
* CUD(n) \x1b[<n>B cursor down (relative)
|
|
14
|
-
* CUF(n) \x1b[<n>C cursor forward (relative)
|
|
15
|
-
* SGR0 \x1b[0m reset style
|
|
16
|
-
* DECTCEM \x1b[?25l/?25h hide/show cursor
|
|
17
|
-
* DECAWM \x1b[?7l/?7h disable/enable autowrap (paint batch)
|
|
18
|
-
*
|
|
19
|
-
* Forbidden (never emitted):
|
|
20
|
-
* \x1b[?1049h / \x1b[?1049l (alternate screen)
|
|
21
|
-
* CSI row;col H / f (absolute cursor positioning)
|
|
22
|
-
* CSI 2J (full screen clear)
|
|
23
|
-
* mouse reporting, OSC52, OSC8
|
|
24
|
-
*
|
|
25
|
-
* All operations are serialized via an internal FIFO queue so commit,
|
|
26
|
-
* renderLive, resize, suspend, and unmount never interleave on the same stream.
|
|
27
|
-
*/
|
|
28
|
-
import { type TuiFrame } from '../tui-core/frame';
|
|
29
|
-
/** Minimal output stream interface. */
|
|
30
|
-
export type SurfaceOutputEvent = 'drain' | 'error' | 'close';
|
|
31
|
-
export interface SurfaceOutput {
|
|
32
|
-
write(chunk: string | Uint8Array): boolean;
|
|
33
|
-
on(event: SurfaceOutputEvent, listener: (error?: unknown) => void): this;
|
|
34
|
-
off(event: SurfaceOutputEvent, listener: (error?: unknown) => void): this;
|
|
35
|
-
readonly writable: boolean;
|
|
36
|
-
}
|
|
37
|
-
export interface InlineSurfaceOptions {
|
|
38
|
-
output: SurfaceOutput;
|
|
39
|
-
/** Inject for deterministic tests. */
|
|
40
|
-
now?: () => number;
|
|
41
|
-
}
|
|
42
|
-
export type SurfacePhase = 'idle' | 'mounted' | 'suspended' | 'unmounted' | 'failed';
|
|
43
|
-
export interface InlineSurfaceState {
|
|
44
|
-
phase: SurfacePhase;
|
|
45
|
-
width: number;
|
|
46
|
-
height: number;
|
|
47
|
-
/** Height of the bottom live band. */
|
|
48
|
-
liveBandRows: number;
|
|
49
|
-
/** Rows currently owned by the inline live block. */
|
|
50
|
-
liveRegionCapacity: number;
|
|
51
|
-
cursorRow: number;
|
|
52
|
-
cursorColumn: number;
|
|
53
|
-
previousFrame: TuiFrame | null;
|
|
54
|
-
}
|
|
55
|
-
/** A committed transcript entry rendered to styled rows. */
|
|
56
|
-
export interface CommittedEntry {
|
|
57
|
-
displayKey: string;
|
|
58
|
-
rows: {
|
|
59
|
-
text: string;
|
|
60
|
-
style?: import('../tui-core/style').TuiStyle;
|
|
61
|
-
}[][];
|
|
62
|
-
}
|
|
63
|
-
export interface TranscriptCommitBatch {
|
|
64
|
-
batchId?: string;
|
|
65
|
-
generation: number;
|
|
66
|
-
reason: 'append' | 'finalize' | 'restore' | 'replace' | 'clear-divider';
|
|
67
|
-
entries: CommittedEntry[];
|
|
68
|
-
}
|
|
69
|
-
export interface TuiTerminalRenderResult {
|
|
70
|
-
output: string;
|
|
71
|
-
committedEntries: number;
|
|
72
|
-
batchId?: string;
|
|
73
|
-
generation?: number;
|
|
74
|
-
displayKeys?: string[];
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Get the latest live frame for rendering after a commit.
|
|
78
|
-
* The runner provides this so commit + finalize interleaving uses fresh state.
|
|
79
|
-
*/
|
|
80
|
-
export type LiveFrameProvider = () => TuiFrame | null;
|
|
81
|
-
export declare class InlineTerminalSurface {
|
|
82
|
-
private phase;
|
|
83
|
-
private width;
|
|
84
|
-
private height;
|
|
85
|
-
/** Height of the bottom live band (status + prompt + live tail). */
|
|
86
|
-
private liveBandRows;
|
|
87
|
-
private liveRegionCapacity;
|
|
88
|
-
private cursorRow;
|
|
89
|
-
private cursorColumn;
|
|
90
|
-
private previousFrame;
|
|
91
|
-
/** Suppress stale-width live paints between SIGWINCH and the resize repaint. */
|
|
92
|
-
private resizePending;
|
|
93
|
-
private pendingResizeWidth;
|
|
94
|
-
private resizeGeneration;
|
|
95
|
-
private resizeWaiters;
|
|
96
|
-
private readonly output;
|
|
97
|
-
private readonly now;
|
|
98
|
-
private readonly suppressColor;
|
|
99
|
-
/** Serialized FIFO queue of pending operations. */
|
|
100
|
-
private queue;
|
|
101
|
-
private processing;
|
|
102
|
-
constructor(options: InlineSurfaceOptions);
|
|
103
|
-
/** Compute the live band height (~75% of screen, min 8, max height-1). */
|
|
104
|
-
private static computeBandRows;
|
|
105
|
-
/** Live band height for the runner to size its live frame. */
|
|
106
|
-
getLiveBandRows(): number;
|
|
107
|
-
/** History area rows above the band (recently scrolled committed lines). */
|
|
108
|
-
get historyAreaRows(): number;
|
|
109
|
-
getState(): InlineSurfaceState;
|
|
110
|
-
/** Mark the terminal as resizing before the debounced layout pass runs. */
|
|
111
|
-
beginResize(width?: number): number;
|
|
112
|
-
/**
|
|
113
|
-
* Await completion of all queued operations.
|
|
114
|
-
* Because the queue is strictly FIFO, enqueueing a no-op and awaiting it
|
|
115
|
-
* guarantees every operation enqueued before this call has finished. Used by
|
|
116
|
-
* tests to deterministically observe the terminal after a burst of renders.
|
|
117
|
-
*/
|
|
118
|
-
whenIdle(): Promise<void>;
|
|
119
|
-
/** Safe content width: never write the last column (avoid pending-wrap). */
|
|
120
|
-
get safeContentWidth(): number;
|
|
121
|
-
/** Enqueue an operation; FIFO guarantees no interleaving. */
|
|
122
|
-
private enqueue;
|
|
123
|
-
private drainQueue;
|
|
124
|
-
/** Mount: enable bracketed paste + hide cursor. NO alternate screen. */
|
|
125
|
-
mount(width: number, height: number): Promise<void>;
|
|
126
|
-
/**
|
|
127
|
-
* Commit finalized transcript entries to native scrollback.
|
|
128
|
-
*
|
|
129
|
-
* Protocol:
|
|
130
|
-
* 1. Erase only the live rows owned by this surface and return to their top.
|
|
131
|
-
* 2. Release that block and write finalized rows as ordinary line-oriented
|
|
132
|
-
* shell output. The terminal decides when those lines enter scrollback.
|
|
133
|
-
* 3. Allocate a fresh live block from the resulting cursor and repaint the
|
|
134
|
-
* latest live frame below the committed output.
|
|
135
|
-
*/
|
|
136
|
-
commit(batch: TranscriptCommitBatch, getLatestLiveFrame: LiveFrameProvider): Promise<TuiTerminalRenderResult>;
|
|
137
|
-
/** Render the live region frame (relative addressing, changed-row diff). */
|
|
138
|
-
renderLive(frame: TuiFrame): Promise<string>;
|
|
139
|
-
/** Forget the diff baseline and repaint only the currently owned live region. */
|
|
140
|
-
forceRedraw(frame: TuiFrame): Promise<string>;
|
|
141
|
-
private renderLiveInternal;
|
|
142
|
-
/** Render a single styled frame row to ANSI chunks (text + SGR + reset). */
|
|
143
|
-
private renderRowChunks;
|
|
144
|
-
/** Stable string form of a styled row, used for changed-row comparison. */
|
|
145
|
-
private renderRowString;
|
|
146
|
-
private trimDefaultTrailingCells;
|
|
147
|
-
private renderedRowWidth;
|
|
148
|
-
/**
|
|
149
|
-
* Ensure the surface owns exactly `requiredRows` rows starting at the current
|
|
150
|
-
* cursor. Allocation uses ordinary newlines, so existing shell output is
|
|
151
|
-
* preserved and may naturally move into terminal scrollback.
|
|
152
|
-
*/
|
|
153
|
-
private ensureCapacity;
|
|
154
|
-
/** Clear the live band rows (relative, no absolute addressing). */
|
|
155
|
-
private clearLiveRegion;
|
|
156
|
-
/**
|
|
157
|
-
* Clear the old live block after the terminal has already adopted a new
|
|
158
|
-
* width. A previously full row can occupy multiple physical rows after
|
|
159
|
-
* reflow, so tracked logical rows are not sufficient during resize.
|
|
160
|
-
*/
|
|
161
|
-
private clearReflowedLiveRegion;
|
|
162
|
-
private clearOwnedLiveRegion;
|
|
163
|
-
private waitForResizeCompletion;
|
|
164
|
-
private completeResize;
|
|
165
|
-
private releaseLiveRegion;
|
|
166
|
-
/** Resize: erase only the owned block, then rebuild from the current cursor. */
|
|
167
|
-
resize(width: number, height: number, getLatestLiveFrame: LiveFrameProvider, generation?: number): Promise<void>;
|
|
168
|
-
/** Suspend for child process: clear live region, disable bracketed paste, show cursor. */
|
|
169
|
-
suspend(): Promise<void>;
|
|
170
|
-
/** Restore after child process: re-enable bracketed paste, rebuild live frame. */
|
|
171
|
-
restore(getLatestLiveFrame: LiveFrameProvider, width?: number, height?: number): Promise<void>;
|
|
172
|
-
/** Unmount: clear live region, restore terminal state. Does NOT erase scrollback. */
|
|
173
|
-
unmount(): Promise<void>;
|
|
174
|
-
/** Flush all operations enqueued before this call without timer polling. */
|
|
175
|
-
flush(): Promise<void>;
|
|
176
|
-
private writeRaw;
|
|
177
|
-
/** Reset for tests. */
|
|
178
|
-
reset(): void;
|
|
179
|
-
}
|
|
180
|
-
export declare class MemoryOutput implements SurfaceOutput {
|
|
181
|
-
chunks: string[];
|
|
182
|
-
writable: boolean;
|
|
183
|
-
private drainListeners;
|
|
184
|
-
write(chunk: string | Uint8Array): boolean;
|
|
185
|
-
on(event: SurfaceOutputEvent, listener: (error?: unknown) => void): this;
|
|
186
|
-
off(event: SurfaceOutputEvent, listener: (error?: unknown) => void): this;
|
|
187
|
-
text(): string;
|
|
188
|
-
/** Assert output never contains forbidden sequences. */
|
|
189
|
-
assertNoForbidden(): void;
|
|
190
|
-
}
|
|
191
|
-
//# sourceMappingURL=inline-surface.d.ts.map
|