mu-harness 0.16.3
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/esm/core/src/agent.d.ts +39 -0
- package/esm/core/src/agent.js +96 -0
- package/esm/core/src/index.d.ts +4 -0
- package/esm/core/src/index.js +2 -0
- package/esm/core/src/types.d.ts +59 -0
- package/esm/core/src/types.js +3 -0
- package/esm/harness/npm/src/_dnt.polyfills.d.ts +11 -0
- package/esm/harness/npm/src/_dnt.polyfills.js +15 -0
- package/esm/harness/npm/src/agents/index.d.ts +4 -0
- package/esm/harness/npm/src/agents/index.js +3 -0
- package/esm/harness/npm/src/agents/loader.d.ts +2 -0
- package/esm/harness/npm/src/agents/loader.js +24 -0
- package/esm/harness/npm/src/agents/parser.d.ts +2 -0
- package/esm/harness/npm/src/agents/parser.js +20 -0
- package/esm/harness/npm/src/agents/registry.d.ts +6 -0
- package/esm/harness/npm/src/agents/registry.js +31 -0
- package/esm/harness/npm/src/agents/types.d.ts +8 -0
- package/esm/harness/npm/src/agents/types.js +1 -0
- package/esm/harness/npm/src/channels/channel.d.ts +7 -0
- package/esm/harness/npm/src/channels/channel.js +25 -0
- package/esm/harness/npm/src/channels/index.d.ts +3 -0
- package/esm/harness/npm/src/channels/index.js +2 -0
- package/esm/harness/npm/src/channels/manager.d.ts +6 -0
- package/esm/harness/npm/src/channels/manager.js +28 -0
- package/esm/harness/npm/src/channels/types.d.ts +30 -0
- package/esm/harness/npm/src/channels/types.js +1 -0
- package/esm/harness/npm/src/commands/defaults.d.ts +9 -0
- package/esm/harness/npm/src/commands/defaults.js +53 -0
- package/esm/harness/npm/src/commands/index.d.ts +3 -0
- package/esm/harness/npm/src/commands/index.js +2 -0
- package/esm/harness/npm/src/commands/registry.d.ts +2 -0
- package/esm/harness/npm/src/commands/registry.js +59 -0
- package/esm/harness/npm/src/commands/types.d.ts +23 -0
- package/esm/harness/npm/src/commands/types.js +1 -0
- package/esm/harness/npm/src/common/frontmatter.d.ts +6 -0
- package/esm/harness/npm/src/common/frontmatter.js +18 -0
- package/esm/harness/npm/src/common/index.d.ts +2 -0
- package/esm/harness/npm/src/common/index.js +2 -0
- package/esm/harness/npm/src/common/utils.d.ts +5 -0
- package/esm/harness/npm/src/common/utils.js +13 -0
- package/esm/harness/npm/src/config/index.d.ts +2 -0
- package/esm/harness/npm/src/config/index.js +1 -0
- package/esm/harness/npm/src/config/resolve.d.ts +2 -0
- package/esm/harness/npm/src/config/resolve.js +10 -0
- package/esm/harness/npm/src/config/types.d.ts +15 -0
- package/esm/harness/npm/src/config/types.js +1 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_chars.d.ts +32 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_chars.js +48 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_dumper_state.d.ts +105 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_dumper_state.js +638 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_loader_state.d.ts +63 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_loader_state.js +1371 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_schema.d.ts +43 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_schema.js +117 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/binary.d.ts +2 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/binary.js +103 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/bool.d.ts +2 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/bool.js +32 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/float.d.ts +2 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/float.js +96 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/int.d.ts +2 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/int.js +159 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/map.d.ts +2 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/map.js +14 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/merge.d.ts +2 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/merge.js +10 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/nil.d.ts +2 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/nil.js +22 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/omap.d.ts +2 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/omap.js +29 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/pairs.d.ts +2 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/pairs.js +19 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/regexp.d.ts +2 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/regexp.js +30 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/seq.d.ts +2 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/seq.js +10 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/set.d.ts +2 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/set.js +14 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/str.d.ts +2 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/str.js +9 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/timestamp.d.ts +2 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/timestamp.js +81 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/undefined.d.ts +2 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/undefined.js +20 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type.d.ts +31 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type.js +6 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_utils.d.ts +3 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_utils.js +13 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/mod.d.ts +49 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/mod.js +52 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/parse.d.ts +75 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/parse.js +91 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/stringify.d.ts +99 -0
- package/esm/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/stringify.js +33 -0
- package/esm/harness/npm/src/harness/create.d.ts +2 -0
- package/esm/harness/npm/src/harness/create.js +139 -0
- package/esm/harness/npm/src/harness/index.d.ts +3 -0
- package/esm/harness/npm/src/harness/index.js +2 -0
- package/esm/harness/npm/src/harness/models.d.ts +16 -0
- package/esm/harness/npm/src/harness/models.js +30 -0
- package/esm/harness/npm/src/harness/types.d.ts +35 -0
- package/esm/harness/npm/src/harness/types.js +1 -0
- package/esm/harness/npm/src/hooks/index.d.ts +3 -0
- package/esm/harness/npm/src/hooks/index.js +2 -0
- package/esm/harness/npm/src/hooks/merge-hooks.d.ts +2 -0
- package/esm/harness/npm/src/hooks/merge-hooks.js +42 -0
- package/esm/harness/npm/src/hooks/types.d.ts +20 -0
- package/esm/harness/npm/src/hooks/types.js +1 -0
- package/esm/harness/npm/src/hooks/with-hooks.d.ts +3 -0
- package/esm/harness/npm/src/hooks/with-hooks.js +12 -0
- package/esm/harness/npm/src/index.d.ts +15 -0
- package/esm/harness/npm/src/index.js +15 -0
- package/esm/harness/npm/src/permissions/allow-list.d.ts +4 -0
- package/esm/harness/npm/src/permissions/allow-list.js +8 -0
- package/esm/harness/npm/src/permissions/approval.d.ts +17 -0
- package/esm/harness/npm/src/permissions/approval.js +13 -0
- package/esm/harness/npm/src/permissions/glob.d.ts +1 -0
- package/esm/harness/npm/src/permissions/glob.js +2 -0
- package/esm/harness/npm/src/permissions/index.d.ts +3 -0
- package/esm/harness/npm/src/permissions/index.js +3 -0
- package/esm/harness/npm/src/plugin/define.d.ts +2 -0
- package/esm/harness/npm/src/plugin/define.js +1 -0
- package/esm/harness/npm/src/plugin/import-ts.d.ts +1 -0
- package/esm/harness/npm/src/plugin/import-ts.js +85 -0
- package/esm/harness/npm/src/plugin/index.d.ts +5 -0
- package/esm/harness/npm/src/plugin/index.js +4 -0
- package/esm/harness/npm/src/plugin/resolve.d.ts +13 -0
- package/esm/harness/npm/src/plugin/resolve.js +17 -0
- package/esm/harness/npm/src/plugin/store.d.ts +8 -0
- package/esm/harness/npm/src/plugin/store.js +26 -0
- package/esm/harness/npm/src/plugin/types.d.ts +11 -0
- package/esm/harness/npm/src/plugin/types.js +1 -0
- package/esm/harness/npm/src/scheduler/command.d.ts +3 -0
- package/esm/harness/npm/src/scheduler/command.js +19 -0
- package/esm/harness/npm/src/scheduler/engine/index.d.ts +3 -0
- package/esm/harness/npm/src/scheduler/engine/index.js +2 -0
- package/esm/harness/npm/src/scheduler/engine/scheduler.d.ts +12 -0
- package/esm/harness/npm/src/scheduler/engine/scheduler.js +65 -0
- package/esm/harness/npm/src/scheduler/engine/store.d.ts +4 -0
- package/esm/harness/npm/src/scheduler/engine/store.js +55 -0
- package/esm/harness/npm/src/scheduler/engine/types.d.ts +37 -0
- package/esm/harness/npm/src/scheduler/engine/types.js +1 -0
- package/esm/harness/npm/src/scheduler/index.d.ts +4 -0
- package/esm/harness/npm/src/scheduler/index.js +3 -0
- package/esm/harness/npm/src/scheduler/tool.d.ts +8 -0
- package/esm/harness/npm/src/scheduler/tool.js +49 -0
- package/esm/harness/npm/src/session/agent-session.d.ts +15 -0
- package/esm/harness/npm/src/session/agent-session.js +82 -0
- package/esm/harness/npm/src/session/catalog.d.ts +24 -0
- package/esm/harness/npm/src/session/catalog.js +55 -0
- package/esm/harness/npm/src/session/index.d.ts +7 -0
- package/esm/harness/npm/src/session/index.js +6 -0
- package/esm/harness/npm/src/session/manager.d.ts +39 -0
- package/esm/harness/npm/src/session/manager.js +62 -0
- package/esm/harness/npm/src/session/persist.d.ts +3 -0
- package/esm/harness/npm/src/session/persist.js +21 -0
- package/esm/harness/npm/src/session/store.d.ts +13 -0
- package/esm/harness/npm/src/session/store.js +24 -0
- package/esm/harness/npm/src/session/title.d.ts +9 -0
- package/esm/harness/npm/src/session/title.js +24 -0
- package/esm/harness/npm/src/session/types.d.ts +17 -0
- package/esm/harness/npm/src/session/types.js +1 -0
- package/esm/harness/npm/src/skills/index.d.ts +7 -0
- package/esm/harness/npm/src/skills/index.js +6 -0
- package/esm/harness/npm/src/skills/loader.d.ts +2 -0
- package/esm/harness/npm/src/skills/loader.js +26 -0
- package/esm/harness/npm/src/skills/parser.d.ts +2 -0
- package/esm/harness/npm/src/skills/parser.js +10 -0
- package/esm/harness/npm/src/skills/registry.d.ts +8 -0
- package/esm/harness/npm/src/skills/registry.js +16 -0
- package/esm/harness/npm/src/skills/run.d.ts +14 -0
- package/esm/harness/npm/src/skills/run.js +45 -0
- package/esm/harness/npm/src/skills/tool.d.ts +3 -0
- package/esm/harness/npm/src/skills/tool.js +31 -0
- package/esm/harness/npm/src/skills/types.d.ts +6 -0
- package/esm/harness/npm/src/skills/types.js +1 -0
- package/esm/harness/npm/src/skills/writer.d.ts +7 -0
- package/esm/harness/npm/src/skills/writer.js +43 -0
- package/esm/harness/npm/src/subAgents/index.d.ts +4 -0
- package/esm/harness/npm/src/subAgents/index.js +3 -0
- package/esm/harness/npm/src/subAgents/registry.d.ts +2 -0
- package/esm/harness/npm/src/subAgents/registry.js +18 -0
- package/esm/harness/npm/src/subAgents/runner.d.ts +15 -0
- package/esm/harness/npm/src/subAgents/runner.js +33 -0
- package/esm/harness/npm/src/subAgents/tool.d.ts +6 -0
- package/esm/harness/npm/src/subAgents/tool.js +30 -0
- package/esm/harness/npm/src/subAgents/types.d.ts +18 -0
- package/esm/harness/npm/src/subAgents/types.js +1 -0
- package/esm/harness/npm/src/tui/channel.d.ts +3 -0
- package/esm/harness/npm/src/tui/channel.js +53 -0
- package/esm/harness/npm/src/tui/components/composer.d.ts +3 -0
- package/esm/harness/npm/src/tui/components/composer.js +13 -0
- package/esm/harness/npm/src/tui/components/header.d.ts +3 -0
- package/esm/harness/npm/src/tui/components/header.js +1 -0
- package/esm/harness/npm/src/tui/components/index.d.ts +5 -0
- package/esm/harness/npm/src/tui/components/index.js +5 -0
- package/esm/harness/npm/src/tui/components/message.d.ts +6 -0
- package/esm/harness/npm/src/tui/components/message.js +26 -0
- package/esm/harness/npm/src/tui/components/status.d.ts +3 -0
- package/esm/harness/npm/src/tui/components/status.js +8 -0
- package/esm/harness/npm/src/tui/components/transcript.d.ts +4 -0
- package/esm/harness/npm/src/tui/components/transcript.js +4 -0
- package/esm/harness/npm/src/tui/index.d.ts +7 -0
- package/esm/harness/npm/src/tui/index.js +10 -0
- package/esm/harness/npm/src/tui/kit.d.ts +15 -0
- package/esm/harness/npm/src/tui/kit.js +7 -0
- package/esm/harness/npm/src/tui/types.d.ts +38 -0
- package/esm/harness/npm/src/tui/types.js +1 -0
- package/esm/package.json +3 -0
- package/esm/tui/src/capabilities.d.ts +72 -0
- package/esm/tui/src/capabilities.js +90 -0
- package/esm/tui/src/components/command-palette.d.ts +24 -0
- package/esm/tui/src/components/command-palette.js +60 -0
- package/esm/tui/src/components/editor.d.ts +26 -0
- package/esm/tui/src/components/editor.js +111 -0
- package/esm/tui/src/components/scroll-view.d.ts +14 -0
- package/esm/tui/src/components/scroll-view.js +45 -0
- package/esm/tui/src/components/select-list.d.ts +24 -0
- package/esm/tui/src/components/select-list.js +69 -0
- package/esm/tui/src/events.d.ts +56 -0
- package/esm/tui/src/events.js +6 -0
- package/esm/tui/src/index.d.ts +17 -0
- package/esm/tui/src/index.js +13 -0
- package/esm/tui/src/inputRouter.d.ts +28 -0
- package/esm/tui/src/inputRouter.js +122 -0
- package/esm/tui/src/keybinds.d.ts +13 -0
- package/esm/tui/src/keybinds.js +15 -0
- package/esm/tui/src/keyboard.d.ts +2 -0
- package/esm/tui/src/keyboard.js +305 -0
- package/esm/tui/src/layout/ansi.d.ts +3 -0
- package/esm/tui/src/layout/ansi.js +323 -0
- package/esm/tui/src/layout/cell.d.ts +24 -0
- package/esm/tui/src/layout/cell.js +46 -0
- package/esm/tui/src/layout/cellbuffer.d.ts +29 -0
- package/esm/tui/src/layout/cellbuffer.js +306 -0
- package/esm/tui/src/layout/color.d.ts +22 -0
- package/esm/tui/src/layout/color.js +163 -0
- package/esm/tui/src/layout/insets.d.ts +8 -0
- package/esm/tui/src/layout/insets.js +55 -0
- package/esm/tui/src/layout/types.d.ts +33 -0
- package/esm/tui/src/layout/types.js +8 -0
- package/esm/tui/src/parser.d.ts +18 -0
- package/esm/tui/src/parser.js +136 -0
- package/esm/tui/src/renderer.d.ts +32 -0
- package/esm/tui/src/renderer.js +168 -0
- package/esm/tui/src/surface.d.ts +27 -0
- package/esm/tui/src/surface.js +110 -0
- package/esm/tui/src/terminal.d.ts +48 -0
- package/esm/tui/src/terminal.js +255 -0
- package/esm/tui/src/tui.d.ts +60 -0
- package/esm/tui/src/tui.js +194 -0
- package/esm/tui/src/types/terminal.d.ts +20 -0
- package/esm/tui/src/types/terminal.js +1 -0
- package/esm/tui/src/utils.d.ts +6 -0
- package/esm/tui/src/utils.js +292 -0
- package/esm/tui/src/views.d.ts +35 -0
- package/esm/tui/src/views.js +112 -0
- package/package.json +23 -0
- package/script/core/src/agent.d.ts +39 -0
- package/script/core/src/agent.js +101 -0
- package/script/core/src/index.d.ts +4 -0
- package/script/core/src/index.js +10 -0
- package/script/core/src/types.d.ts +59 -0
- package/script/core/src/types.js +9 -0
- package/script/harness/npm/src/_dnt.polyfills.d.ts +11 -0
- package/script/harness/npm/src/_dnt.polyfills.js +16 -0
- package/script/harness/npm/src/agents/index.d.ts +4 -0
- package/script/harness/npm/src/agents/index.js +9 -0
- package/script/harness/npm/src/agents/loader.d.ts +2 -0
- package/script/harness/npm/src/agents/loader.js +28 -0
- package/script/harness/npm/src/agents/parser.d.ts +2 -0
- package/script/harness/npm/src/agents/parser.js +24 -0
- package/script/harness/npm/src/agents/registry.d.ts +6 -0
- package/script/harness/npm/src/agents/registry.js +35 -0
- package/script/harness/npm/src/agents/types.d.ts +8 -0
- package/script/harness/npm/src/agents/types.js +2 -0
- package/script/harness/npm/src/channels/channel.d.ts +7 -0
- package/script/harness/npm/src/channels/channel.js +29 -0
- package/script/harness/npm/src/channels/index.d.ts +3 -0
- package/script/harness/npm/src/channels/index.js +7 -0
- package/script/harness/npm/src/channels/manager.d.ts +6 -0
- package/script/harness/npm/src/channels/manager.js +32 -0
- package/script/harness/npm/src/channels/types.d.ts +30 -0
- package/script/harness/npm/src/channels/types.js +2 -0
- package/script/harness/npm/src/commands/defaults.d.ts +9 -0
- package/script/harness/npm/src/commands/defaults.js +61 -0
- package/script/harness/npm/src/commands/index.d.ts +3 -0
- package/script/harness/npm/src/commands/index.js +11 -0
- package/script/harness/npm/src/commands/registry.d.ts +2 -0
- package/script/harness/npm/src/commands/registry.js +63 -0
- package/script/harness/npm/src/commands/types.d.ts +23 -0
- package/script/harness/npm/src/commands/types.js +2 -0
- package/script/harness/npm/src/common/frontmatter.d.ts +6 -0
- package/script/harness/npm/src/common/frontmatter.js +23 -0
- package/script/harness/npm/src/common/index.d.ts +2 -0
- package/script/harness/npm/src/common/index.js +8 -0
- package/script/harness/npm/src/common/utils.d.ts +5 -0
- package/script/harness/npm/src/common/utils.js +17 -0
- package/script/harness/npm/src/config/index.d.ts +2 -0
- package/script/harness/npm/src/config/index.js +5 -0
- package/script/harness/npm/src/config/resolve.d.ts +2 -0
- package/script/harness/npm/src/config/resolve.js +14 -0
- package/script/harness/npm/src/config/types.d.ts +15 -0
- package/script/harness/npm/src/config/types.js +2 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_chars.d.ts +32 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_chars.js +55 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_dumper_state.d.ts +105 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_dumper_state.js +642 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_loader_state.d.ts +63 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_loader_state.js +1375 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_schema.d.ts +43 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_schema.js +121 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/binary.d.ts +2 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/binary.js +106 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/bool.d.ts +2 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/bool.js +35 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/float.d.ts +2 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/float.js +99 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/int.d.ts +2 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/int.js +162 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/map.d.ts +2 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/map.js +17 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/merge.d.ts +2 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/merge.js +13 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/nil.d.ts +2 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/nil.js +25 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/omap.d.ts +2 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/omap.js +32 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/pairs.d.ts +2 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/pairs.js +22 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/regexp.d.ts +2 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/regexp.js +33 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/seq.d.ts +2 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/seq.js +13 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/set.d.ts +2 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/set.js +17 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/str.d.ts +2 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/str.js +12 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/timestamp.d.ts +2 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/timestamp.js +84 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/undefined.d.ts +2 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type/undefined.js +23 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type.d.ts +31 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_type.js +7 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_utils.d.ts +3 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/_utils.js +18 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/mod.d.ts +49 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/mod.js +68 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/parse.d.ts +75 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/parse.js +95 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/stringify.d.ts +99 -0
- package/script/harness/npm/src/deps/jsr.io/@std/yaml/1.1.0/stringify.js +36 -0
- package/script/harness/npm/src/harness/create.d.ts +2 -0
- package/script/harness/npm/src/harness/create.js +146 -0
- package/script/harness/npm/src/harness/index.d.ts +3 -0
- package/script/harness/npm/src/harness/index.js +7 -0
- package/script/harness/npm/src/harness/models.d.ts +16 -0
- package/script/harness/npm/src/harness/models.js +34 -0
- package/script/harness/npm/src/harness/types.d.ts +35 -0
- package/script/harness/npm/src/harness/types.js +2 -0
- package/script/harness/npm/src/hooks/index.d.ts +3 -0
- package/script/harness/npm/src/hooks/index.js +7 -0
- package/script/harness/npm/src/hooks/merge-hooks.d.ts +2 -0
- package/script/harness/npm/src/hooks/merge-hooks.js +46 -0
- package/script/harness/npm/src/hooks/types.d.ts +20 -0
- package/script/harness/npm/src/hooks/types.js +2 -0
- package/script/harness/npm/src/hooks/with-hooks.d.ts +3 -0
- package/script/harness/npm/src/hooks/with-hooks.js +16 -0
- package/script/harness/npm/src/index.d.ts +15 -0
- package/script/harness/npm/src/index.js +31 -0
- package/script/harness/npm/src/permissions/allow-list.d.ts +4 -0
- package/script/harness/npm/src/permissions/allow-list.js +13 -0
- package/script/harness/npm/src/permissions/approval.d.ts +17 -0
- package/script/harness/npm/src/permissions/approval.js +17 -0
- package/script/harness/npm/src/permissions/glob.d.ts +1 -0
- package/script/harness/npm/src/permissions/glob.js +6 -0
- package/script/harness/npm/src/permissions/index.d.ts +3 -0
- package/script/harness/npm/src/permissions/index.js +10 -0
- package/script/harness/npm/src/plugin/define.d.ts +2 -0
- package/script/harness/npm/src/plugin/define.js +5 -0
- package/script/harness/npm/src/plugin/import-ts.d.ts +1 -0
- package/script/harness/npm/src/plugin/import-ts.js +122 -0
- package/script/harness/npm/src/plugin/index.d.ts +5 -0
- package/script/harness/npm/src/plugin/index.js +11 -0
- package/script/harness/npm/src/plugin/resolve.d.ts +13 -0
- package/script/harness/npm/src/plugin/resolve.js +21 -0
- package/script/harness/npm/src/plugin/store.d.ts +8 -0
- package/script/harness/npm/src/plugin/store.js +30 -0
- package/script/harness/npm/src/plugin/types.d.ts +11 -0
- package/script/harness/npm/src/plugin/types.js +2 -0
- package/script/harness/npm/src/scheduler/command.d.ts +3 -0
- package/script/harness/npm/src/scheduler/command.js +23 -0
- package/script/harness/npm/src/scheduler/engine/index.d.ts +3 -0
- package/script/harness/npm/src/scheduler/engine/index.js +7 -0
- package/script/harness/npm/src/scheduler/engine/scheduler.d.ts +12 -0
- package/script/harness/npm/src/scheduler/engine/scheduler.js +69 -0
- package/script/harness/npm/src/scheduler/engine/store.d.ts +4 -0
- package/script/harness/npm/src/scheduler/engine/store.js +59 -0
- package/script/harness/npm/src/scheduler/engine/types.d.ts +37 -0
- package/script/harness/npm/src/scheduler/engine/types.js +2 -0
- package/script/harness/npm/src/scheduler/index.d.ts +4 -0
- package/script/harness/npm/src/scheduler/index.js +10 -0
- package/script/harness/npm/src/scheduler/tool.d.ts +8 -0
- package/script/harness/npm/src/scheduler/tool.js +53 -0
- package/script/harness/npm/src/session/agent-session.d.ts +15 -0
- package/script/harness/npm/src/session/agent-session.js +86 -0
- package/script/harness/npm/src/session/catalog.d.ts +24 -0
- package/script/harness/npm/src/session/catalog.js +59 -0
- package/script/harness/npm/src/session/index.d.ts +7 -0
- package/script/harness/npm/src/session/index.js +17 -0
- package/script/harness/npm/src/session/manager.d.ts +39 -0
- package/script/harness/npm/src/session/manager.js +66 -0
- package/script/harness/npm/src/session/persist.d.ts +3 -0
- package/script/harness/npm/src/session/persist.js +25 -0
- package/script/harness/npm/src/session/store.d.ts +13 -0
- package/script/harness/npm/src/session/store.js +28 -0
- package/script/harness/npm/src/session/title.d.ts +9 -0
- package/script/harness/npm/src/session/title.js +30 -0
- package/script/harness/npm/src/session/types.d.ts +17 -0
- package/script/harness/npm/src/session/types.js +2 -0
- package/script/harness/npm/src/skills/index.d.ts +7 -0
- package/script/harness/npm/src/skills/index.js +16 -0
- package/script/harness/npm/src/skills/loader.d.ts +2 -0
- package/script/harness/npm/src/skills/loader.js +30 -0
- package/script/harness/npm/src/skills/parser.d.ts +2 -0
- package/script/harness/npm/src/skills/parser.js +14 -0
- package/script/harness/npm/src/skills/registry.d.ts +8 -0
- package/script/harness/npm/src/skills/registry.js +20 -0
- package/script/harness/npm/src/skills/run.d.ts +14 -0
- package/script/harness/npm/src/skills/run.js +50 -0
- package/script/harness/npm/src/skills/tool.d.ts +3 -0
- package/script/harness/npm/src/skills/tool.js +35 -0
- package/script/harness/npm/src/skills/types.d.ts +6 -0
- package/script/harness/npm/src/skills/types.js +2 -0
- package/script/harness/npm/src/skills/writer.d.ts +7 -0
- package/script/harness/npm/src/skills/writer.js +47 -0
- package/script/harness/npm/src/subAgents/index.d.ts +4 -0
- package/script/harness/npm/src/subAgents/index.js +9 -0
- package/script/harness/npm/src/subAgents/registry.d.ts +2 -0
- package/script/harness/npm/src/subAgents/registry.js +22 -0
- package/script/harness/npm/src/subAgents/runner.d.ts +15 -0
- package/script/harness/npm/src/subAgents/runner.js +37 -0
- package/script/harness/npm/src/subAgents/tool.d.ts +6 -0
- package/script/harness/npm/src/subAgents/tool.js +34 -0
- package/script/harness/npm/src/subAgents/types.d.ts +18 -0
- package/script/harness/npm/src/subAgents/types.js +2 -0
- package/script/harness/npm/src/tui/channel.d.ts +3 -0
- package/script/harness/npm/src/tui/channel.js +57 -0
- package/script/harness/npm/src/tui/components/composer.d.ts +3 -0
- package/script/harness/npm/src/tui/components/composer.js +17 -0
- package/script/harness/npm/src/tui/components/header.d.ts +3 -0
- package/script/harness/npm/src/tui/components/header.js +5 -0
- package/script/harness/npm/src/tui/components/index.d.ts +5 -0
- package/script/harness/npm/src/tui/components/index.js +16 -0
- package/script/harness/npm/src/tui/components/message.d.ts +6 -0
- package/script/harness/npm/src/tui/components/message.js +32 -0
- package/script/harness/npm/src/tui/components/status.d.ts +3 -0
- package/script/harness/npm/src/tui/components/status.js +12 -0
- package/script/harness/npm/src/tui/components/transcript.d.ts +4 -0
- package/script/harness/npm/src/tui/components/transcript.js +9 -0
- package/script/harness/npm/src/tui/index.d.ts +7 -0
- package/script/harness/npm/src/tui/index.js +29 -0
- package/script/harness/npm/src/tui/kit.d.ts +15 -0
- package/script/harness/npm/src/tui/kit.js +10 -0
- package/script/harness/npm/src/tui/types.d.ts +38 -0
- package/script/harness/npm/src/tui/types.js +2 -0
- package/script/package.json +3 -0
- package/script/tui/src/capabilities.d.ts +72 -0
- package/script/tui/src/capabilities.js +98 -0
- package/script/tui/src/components/command-palette.d.ts +24 -0
- package/script/tui/src/components/command-palette.js +65 -0
- package/script/tui/src/components/editor.d.ts +26 -0
- package/script/tui/src/components/editor.js +116 -0
- package/script/tui/src/components/scroll-view.d.ts +14 -0
- package/script/tui/src/components/scroll-view.js +50 -0
- package/script/tui/src/components/select-list.d.ts +24 -0
- package/script/tui/src/components/select-list.js +74 -0
- package/script/tui/src/events.d.ts +56 -0
- package/script/tui/src/events.js +9 -0
- package/script/tui/src/index.d.ts +17 -0
- package/script/tui/src/index.js +46 -0
- package/script/tui/src/inputRouter.d.ts +28 -0
- package/script/tui/src/inputRouter.js +126 -0
- package/script/tui/src/keybinds.d.ts +13 -0
- package/script/tui/src/keybinds.js +18 -0
- package/script/tui/src/keyboard.d.ts +2 -0
- package/script/tui/src/keyboard.js +308 -0
- package/script/tui/src/layout/ansi.d.ts +3 -0
- package/script/tui/src/layout/ansi.js +327 -0
- package/script/tui/src/layout/cell.d.ts +24 -0
- package/script/tui/src/layout/cell.js +54 -0
- package/script/tui/src/layout/cellbuffer.d.ts +29 -0
- package/script/tui/src/layout/cellbuffer.js +321 -0
- package/script/tui/src/layout/color.d.ts +22 -0
- package/script/tui/src/layout/color.js +174 -0
- package/script/tui/src/layout/insets.d.ts +8 -0
- package/script/tui/src/layout/insets.js +64 -0
- package/script/tui/src/layout/types.d.ts +33 -0
- package/script/tui/src/layout/types.js +11 -0
- package/script/tui/src/parser.d.ts +18 -0
- package/script/tui/src/parser.js +140 -0
- package/script/tui/src/renderer.d.ts +32 -0
- package/script/tui/src/renderer.js +175 -0
- package/script/tui/src/surface.d.ts +27 -0
- package/script/tui/src/surface.js +115 -0
- package/script/tui/src/terminal.d.ts +48 -0
- package/script/tui/src/terminal.js +262 -0
- package/script/tui/src/tui.d.ts +60 -0
- package/script/tui/src/tui.js +198 -0
- package/script/tui/src/types/terminal.d.ts +20 -0
- package/script/tui/src/types/terminal.js +2 -0
- package/script/tui/src/utils.d.ts +6 -0
- package/script/tui/src/utils.js +300 -0
- package/script/tui/src/views.d.ts +35 -0
- package/script/tui/src/views.js +123 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TerminalInputParser = void 0;
|
|
4
|
+
const keyboard_1 = require("./keyboard");
|
|
5
|
+
const ESC = '\x1b';
|
|
6
|
+
const PASTE_START = '\x1b[200~';
|
|
7
|
+
const PASTE_END = '\x1b[201~';
|
|
8
|
+
class TerminalInputParser {
|
|
9
|
+
options;
|
|
10
|
+
buffer = '';
|
|
11
|
+
paste = '';
|
|
12
|
+
inPaste = false;
|
|
13
|
+
pasteOverflowed = false;
|
|
14
|
+
constructor(options = {}) {
|
|
15
|
+
this.options = options;
|
|
16
|
+
}
|
|
17
|
+
feed(data) {
|
|
18
|
+
this.buffer += data;
|
|
19
|
+
const events = [];
|
|
20
|
+
while (this.buffer.length > 0) {
|
|
21
|
+
if (this.inPaste) {
|
|
22
|
+
const end = this.buffer.indexOf(PASTE_END);
|
|
23
|
+
if (end === -1) {
|
|
24
|
+
if (!this.pasteOverflowed) {
|
|
25
|
+
this.paste += this.buffer;
|
|
26
|
+
if (this.paste.length > this.maxPasteBytes) {
|
|
27
|
+
this.paste = this.paste.slice(0, this.maxPasteBytes);
|
|
28
|
+
this.pasteOverflowed = true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
this.buffer = '';
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
if (!this.pasteOverflowed) {
|
|
35
|
+
this.paste += this.buffer.slice(0, end);
|
|
36
|
+
if (this.paste.length > this.maxPasteBytes) {
|
|
37
|
+
this.paste = this.paste.slice(0, this.maxPasteBytes);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
this.buffer = this.buffer.slice(end + PASTE_END.length);
|
|
41
|
+
events.push({ type: 'paste', text: this.paste, raw: `${PASTE_START}${this.paste}${PASTE_END}` });
|
|
42
|
+
this.paste = '';
|
|
43
|
+
this.inPaste = false;
|
|
44
|
+
this.pasteOverflowed = false;
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (this.buffer.startsWith(PASTE_START)) {
|
|
48
|
+
this.buffer = this.buffer.slice(PASTE_START.length);
|
|
49
|
+
this.inPaste = true;
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
const token = takeToken(this.buffer);
|
|
53
|
+
if (token === null) {
|
|
54
|
+
if (this.buffer.length > this.maxBufferBytes) {
|
|
55
|
+
events.push({
|
|
56
|
+
type: 'terminalResponse',
|
|
57
|
+
raw: this.buffer.slice(0, this.maxBufferBytes),
|
|
58
|
+
sequence: 'unknown',
|
|
59
|
+
});
|
|
60
|
+
this.buffer = '';
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
this.buffer = this.buffer.slice(token.length);
|
|
66
|
+
const event = (0, keyboard_1.parseInput)(token);
|
|
67
|
+
if (event)
|
|
68
|
+
events.push(event);
|
|
69
|
+
}
|
|
70
|
+
return events;
|
|
71
|
+
}
|
|
72
|
+
flushPending() {
|
|
73
|
+
if (this.buffer.length === 0)
|
|
74
|
+
return [];
|
|
75
|
+
const raw = this.buffer;
|
|
76
|
+
this.buffer = '';
|
|
77
|
+
const event = (0, keyboard_1.parseInput)(raw);
|
|
78
|
+
return event ? [event] : [{ type: 'terminalResponse', raw, sequence: 'unknown' }];
|
|
79
|
+
}
|
|
80
|
+
hasPending() {
|
|
81
|
+
return this.buffer.length > 0;
|
|
82
|
+
}
|
|
83
|
+
get maxBufferBytes() {
|
|
84
|
+
return this.options.maxBufferBytes ?? 64 * 1024;
|
|
85
|
+
}
|
|
86
|
+
get maxPasteBytes() {
|
|
87
|
+
return this.options.maxPasteBytes ?? 1024 * 1024;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.TerminalInputParser = TerminalInputParser;
|
|
91
|
+
function takeToken(input) {
|
|
92
|
+
if (input.length === 0)
|
|
93
|
+
return null;
|
|
94
|
+
if (!input.startsWith(ESC))
|
|
95
|
+
return takeTextOrControl(input);
|
|
96
|
+
if (input.length === 1)
|
|
97
|
+
return null;
|
|
98
|
+
const prefix = input.slice(0, 2);
|
|
99
|
+
if (prefix === '\x1b[')
|
|
100
|
+
return takeCsi(input);
|
|
101
|
+
if (prefix === '\x1b]')
|
|
102
|
+
return takeString(input, true);
|
|
103
|
+
if (prefix === '\x1bP' || prefix === '\x1b_' || prefix === '\x1b^' || prefix === '\x1bX') {
|
|
104
|
+
return takeString(input, false);
|
|
105
|
+
}
|
|
106
|
+
if (prefix === '\x1bO')
|
|
107
|
+
return input.length >= 3 ? input.slice(0, 3) : null;
|
|
108
|
+
return Array.from(input).length >= 2 ? ESC + Array.from(input.slice(1))[0] : null;
|
|
109
|
+
}
|
|
110
|
+
function takeTextOrControl(input) {
|
|
111
|
+
const first = input.codePointAt(0) ?? 0;
|
|
112
|
+
if (first < 0x20 || first === 0x7f)
|
|
113
|
+
return input.slice(0, 1);
|
|
114
|
+
let end = 0;
|
|
115
|
+
for (const ch of input) {
|
|
116
|
+
const code = ch.codePointAt(0) ?? 0;
|
|
117
|
+
if (ch === ESC || code < 0x20 || code === 0x7f)
|
|
118
|
+
break;
|
|
119
|
+
end += ch.length;
|
|
120
|
+
}
|
|
121
|
+
return input.slice(0, end);
|
|
122
|
+
}
|
|
123
|
+
function takeCsi(input) {
|
|
124
|
+
for (let i = 2; i < input.length; i++) {
|
|
125
|
+
const code = input.charCodeAt(i);
|
|
126
|
+
if (code >= 0x40 && code <= 0x7e) {
|
|
127
|
+
return input.slice(0, i + 1);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
function takeString(input, allowBel) {
|
|
133
|
+
for (let i = 2; i < input.length; i++) {
|
|
134
|
+
if (allowBel && input.charCodeAt(i) === 0x07)
|
|
135
|
+
return input.slice(0, i + 1);
|
|
136
|
+
if (input[i] === ESC && input[i + 1] === '\\')
|
|
137
|
+
return input.slice(0, i + 2);
|
|
138
|
+
}
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Rgba } from './layout/color';
|
|
2
|
+
import { type Component, type SurfaceEntry } from './surface';
|
|
3
|
+
import type { Terminal } from './types/terminal';
|
|
4
|
+
export interface RendererHost {
|
|
5
|
+
getRoot(): Component | null;
|
|
6
|
+
isFocused(component: Component): boolean;
|
|
7
|
+
setEntries(entries: SurfaceEntry[]): void;
|
|
8
|
+
getBackdropColor(): Rgba;
|
|
9
|
+
}
|
|
10
|
+
export declare class Renderer {
|
|
11
|
+
private readonly terminal;
|
|
12
|
+
private readonly host;
|
|
13
|
+
private readonly useSynchronizedOutput;
|
|
14
|
+
private previousBuffer;
|
|
15
|
+
private previousUsedHeight;
|
|
16
|
+
private renderRequested;
|
|
17
|
+
private renderTimer;
|
|
18
|
+
private lastRenderAt;
|
|
19
|
+
private stopped;
|
|
20
|
+
private static readonly MIN_RENDER_INTERVAL_MS;
|
|
21
|
+
constructor(terminal: Terminal, host: RendererHost, useSynchronizedOutput: boolean);
|
|
22
|
+
setStopped(stopped: boolean): void;
|
|
23
|
+
requestRender(force?: boolean): void;
|
|
24
|
+
private scheduleRender;
|
|
25
|
+
private renderFrame;
|
|
26
|
+
doRender(): void;
|
|
27
|
+
private fullRender;
|
|
28
|
+
private cellDiffRender;
|
|
29
|
+
moveCursorAfterRenderedContent(): void;
|
|
30
|
+
private frameStart;
|
|
31
|
+
private frameEnd;
|
|
32
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Renderer = void 0;
|
|
7
|
+
const node_perf_hooks_1 = require("node:perf_hooks");
|
|
8
|
+
const node_process_1 = __importDefault(require("node:process"));
|
|
9
|
+
const ansi_1 = require("./layout/ansi");
|
|
10
|
+
const cellbuffer_1 = require("./layout/cellbuffer");
|
|
11
|
+
const surface_1 = require("./surface");
|
|
12
|
+
class Renderer {
|
|
13
|
+
terminal;
|
|
14
|
+
host;
|
|
15
|
+
useSynchronizedOutput;
|
|
16
|
+
previousBuffer = null;
|
|
17
|
+
previousUsedHeight = 0;
|
|
18
|
+
renderRequested = false;
|
|
19
|
+
renderTimer;
|
|
20
|
+
lastRenderAt = 0;
|
|
21
|
+
stopped = false;
|
|
22
|
+
static MIN_RENDER_INTERVAL_MS = 16;
|
|
23
|
+
constructor(terminal, host, useSynchronizedOutput) {
|
|
24
|
+
this.terminal = terminal;
|
|
25
|
+
this.host = host;
|
|
26
|
+
this.useSynchronizedOutput = useSynchronizedOutput;
|
|
27
|
+
}
|
|
28
|
+
setStopped(stopped) {
|
|
29
|
+
this.stopped = stopped;
|
|
30
|
+
if (stopped && this.renderTimer) {
|
|
31
|
+
clearTimeout(this.renderTimer);
|
|
32
|
+
this.renderTimer = undefined;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
requestRender(force = false) {
|
|
36
|
+
if (force) {
|
|
37
|
+
this.previousBuffer = null;
|
|
38
|
+
this.previousUsedHeight = 0;
|
|
39
|
+
if (this.renderTimer) {
|
|
40
|
+
clearTimeout(this.renderTimer);
|
|
41
|
+
this.renderTimer = undefined;
|
|
42
|
+
}
|
|
43
|
+
this.renderRequested = true;
|
|
44
|
+
node_process_1.default.nextTick(() => {
|
|
45
|
+
if (this.stopped || !this.renderRequested)
|
|
46
|
+
return;
|
|
47
|
+
this.renderRequested = false;
|
|
48
|
+
this.lastRenderAt = node_perf_hooks_1.performance.now();
|
|
49
|
+
this.doRender();
|
|
50
|
+
});
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (this.renderRequested)
|
|
54
|
+
return;
|
|
55
|
+
this.renderRequested = true;
|
|
56
|
+
node_process_1.default.nextTick(() => this.scheduleRender());
|
|
57
|
+
}
|
|
58
|
+
scheduleRender() {
|
|
59
|
+
if (this.stopped || this.renderTimer || !this.renderRequested)
|
|
60
|
+
return;
|
|
61
|
+
const elapsed = node_perf_hooks_1.performance.now() - this.lastRenderAt;
|
|
62
|
+
const delay = Math.max(0, Renderer.MIN_RENDER_INTERVAL_MS - elapsed);
|
|
63
|
+
this.renderTimer = setTimeout(() => {
|
|
64
|
+
this.renderTimer = undefined;
|
|
65
|
+
if (this.stopped || !this.renderRequested)
|
|
66
|
+
return;
|
|
67
|
+
this.renderRequested = false;
|
|
68
|
+
this.lastRenderAt = node_perf_hooks_1.performance.now();
|
|
69
|
+
this.doRender();
|
|
70
|
+
if (this.renderRequested) {
|
|
71
|
+
this.scheduleRender();
|
|
72
|
+
}
|
|
73
|
+
}, delay);
|
|
74
|
+
}
|
|
75
|
+
renderFrame(width, height) {
|
|
76
|
+
const backdrop = this.host.getBackdropColor();
|
|
77
|
+
const buffer = (0, cellbuffer_1.createCellBuffer)(width, height, backdrop);
|
|
78
|
+
(0, cellbuffer_1.setBackdropColor)(buffer, backdrop);
|
|
79
|
+
const root = this.host.getRoot();
|
|
80
|
+
if (root) {
|
|
81
|
+
this.host.setEntries((0, surface_1.renderToBuffer)(root, buffer, (component) => this.host.isFocused(component)));
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
this.host.setEntries([]);
|
|
85
|
+
}
|
|
86
|
+
return buffer;
|
|
87
|
+
}
|
|
88
|
+
doRender() {
|
|
89
|
+
if (this.stopped)
|
|
90
|
+
return;
|
|
91
|
+
const width = this.terminal.columns;
|
|
92
|
+
const height = this.terminal.rows;
|
|
93
|
+
const buffer = this.renderFrame(width, height);
|
|
94
|
+
const usedHeight = (0, cellbuffer_1.bufferUsedHeight)(buffer);
|
|
95
|
+
const prev = this.previousBuffer;
|
|
96
|
+
const sizeChanged = prev !== null && (prev.width !== width || prev.height !== height);
|
|
97
|
+
if (prev === null || sizeChanged || usedHeight > this.previousUsedHeight) {
|
|
98
|
+
this.fullRender(buffer, usedHeight, sizeChanged);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
this.cellDiffRender(prev, buffer, usedHeight);
|
|
102
|
+
}
|
|
103
|
+
this.previousBuffer = buffer;
|
|
104
|
+
this.previousUsedHeight = usedHeight;
|
|
105
|
+
}
|
|
106
|
+
fullRender(buffer, usedHeight, clear) {
|
|
107
|
+
const lines = (0, cellbuffer_1.cellBufferToLines)(buffer).slice(0, usedHeight);
|
|
108
|
+
const reset = '\x1b[0m\x1b]8;;\x07';
|
|
109
|
+
for (let i = 0; i < lines.length; i++)
|
|
110
|
+
lines[i] += reset;
|
|
111
|
+
let out = this.frameStart();
|
|
112
|
+
if (clear) {
|
|
113
|
+
out += '\x1b[2J\x1b[H\x1b[3J';
|
|
114
|
+
}
|
|
115
|
+
else if (this.previousBuffer !== null) {
|
|
116
|
+
out += '\x1b8';
|
|
117
|
+
}
|
|
118
|
+
for (let i = 0; i < lines.length; i++) {
|
|
119
|
+
if (i > 0)
|
|
120
|
+
out += '\r\n';
|
|
121
|
+
out += lines[i];
|
|
122
|
+
}
|
|
123
|
+
if (lines.length > 1) {
|
|
124
|
+
out += `\r\x1b[${lines.length - 1}A`;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
out += '\r';
|
|
128
|
+
}
|
|
129
|
+
out += '\x1b7';
|
|
130
|
+
out += this.frameEnd();
|
|
131
|
+
this.terminal.write(out);
|
|
132
|
+
}
|
|
133
|
+
cellDiffRender(prev, next, usedHeight) {
|
|
134
|
+
const maxRow = Math.max(usedHeight, this.previousUsedHeight);
|
|
135
|
+
const runs = (0, cellbuffer_1.diffBuffer)(prev, next, maxRow);
|
|
136
|
+
if (runs.length === 0)
|
|
137
|
+
return;
|
|
138
|
+
let out = this.frameStart();
|
|
139
|
+
let curRow = -1;
|
|
140
|
+
for (const run of runs) {
|
|
141
|
+
if (run.y !== curRow) {
|
|
142
|
+
out += '\x1b8';
|
|
143
|
+
if (run.y > 0)
|
|
144
|
+
out += `\x1b[${run.y}B`;
|
|
145
|
+
curRow = run.y;
|
|
146
|
+
}
|
|
147
|
+
if (run.clear) {
|
|
148
|
+
out += '\x1b[0m\x1b[2K';
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
out += `\x1b[${run.x + 1}G`;
|
|
152
|
+
out += (0, ansi_1.cellsToAnsi)(run.cells);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
out += '\x1b8';
|
|
156
|
+
out += this.frameEnd();
|
|
157
|
+
this.terminal.write(out);
|
|
158
|
+
}
|
|
159
|
+
moveCursorAfterRenderedContent() {
|
|
160
|
+
if (this.previousBuffer === null)
|
|
161
|
+
return;
|
|
162
|
+
let out = '';
|
|
163
|
+
if (this.previousUsedHeight > 0)
|
|
164
|
+
out += `\x1b[${this.previousUsedHeight}B`;
|
|
165
|
+
out += '\r\n';
|
|
166
|
+
this.terminal.write(out);
|
|
167
|
+
}
|
|
168
|
+
frameStart() {
|
|
169
|
+
return this.useSynchronizedOutput ? '\x1b[?2026h' : '';
|
|
170
|
+
}
|
|
171
|
+
frameEnd() {
|
|
172
|
+
return this.useSynchronizedOutput ? '\x1b[?2026l' : '';
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
exports.Renderer = Renderer;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { InputEvent } from './events';
|
|
2
|
+
import { type CellBuffer } from './layout/cellbuffer';
|
|
3
|
+
import type { Color, Rect } from './layout/types';
|
|
4
|
+
export interface Component {
|
|
5
|
+
render(surface: Surface): void;
|
|
6
|
+
handleInput?(event: InputEvent): void;
|
|
7
|
+
wantsKeyRelease?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface Surface {
|
|
10
|
+
readonly width: number;
|
|
11
|
+
readonly height: number;
|
|
12
|
+
readonly focused: boolean;
|
|
13
|
+
text(x: number, y: number, value: string): void;
|
|
14
|
+
fill(rect: Rect, color: Color, opacity?: number): void;
|
|
15
|
+
measure(child: Component, width: number): number;
|
|
16
|
+
child(child: Component, rect: Rect, opts?: {
|
|
17
|
+
opacity?: number;
|
|
18
|
+
focused?: boolean;
|
|
19
|
+
}): void;
|
|
20
|
+
}
|
|
21
|
+
export interface SurfaceEntry {
|
|
22
|
+
component: Component;
|
|
23
|
+
rect: Rect;
|
|
24
|
+
}
|
|
25
|
+
export declare function measure(component: Component, width: number): number;
|
|
26
|
+
export declare function measureWidth(component: Component, maxWidth: number): number;
|
|
27
|
+
export declare function renderToBuffer(component: Component, buffer: CellBuffer, isFocused?: (component: Component) => boolean): SurfaceEntry[];
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.measure = measure;
|
|
4
|
+
exports.measureWidth = measureWidth;
|
|
5
|
+
exports.renderToBuffer = renderToBuffer;
|
|
6
|
+
const ansi_1 = require("./layout/ansi");
|
|
7
|
+
const cellbuffer_1 = require("./layout/cellbuffer");
|
|
8
|
+
const color_1 = require("./layout/color");
|
|
9
|
+
const insets_1 = require("./layout/insets");
|
|
10
|
+
const utils_1 = require("./utils");
|
|
11
|
+
class BufferSurface {
|
|
12
|
+
env;
|
|
13
|
+
ox;
|
|
14
|
+
oy;
|
|
15
|
+
width;
|
|
16
|
+
height;
|
|
17
|
+
clip;
|
|
18
|
+
focused;
|
|
19
|
+
constructor(env, ox, oy, width, height, clip, focused) {
|
|
20
|
+
this.env = env;
|
|
21
|
+
this.ox = ox;
|
|
22
|
+
this.oy = oy;
|
|
23
|
+
this.width = width;
|
|
24
|
+
this.height = height;
|
|
25
|
+
this.clip = clip;
|
|
26
|
+
this.focused = focused;
|
|
27
|
+
}
|
|
28
|
+
text(x, y, value) {
|
|
29
|
+
if (y < 0 || y >= this.height)
|
|
30
|
+
return;
|
|
31
|
+
(0, cellbuffer_1.writeCells)(this.env.buffer, this.ox + x, this.oy + y, (0, ansi_1.parseLine)(value), this.clip);
|
|
32
|
+
}
|
|
33
|
+
fill(rect, color, opacity = 1) {
|
|
34
|
+
const abs = { x: this.ox + rect.x, y: this.oy + rect.y, width: rect.width, height: rect.height };
|
|
35
|
+
(0, cellbuffer_1.fillBackground)(this.env.buffer, abs, (0, color_1.colorToRgba)(color, opacity), this.clip);
|
|
36
|
+
}
|
|
37
|
+
measure(child, width) {
|
|
38
|
+
return measure(child, width);
|
|
39
|
+
}
|
|
40
|
+
child(child, rect, opts) {
|
|
41
|
+
const ox = this.ox + rect.x;
|
|
42
|
+
const oy = this.oy + rect.y;
|
|
43
|
+
const abs = { x: ox, y: oy, width: rect.width, height: rect.height };
|
|
44
|
+
const clip = (0, insets_1.intersectRect)(this.clip, abs);
|
|
45
|
+
const focused = opts?.focused ?? this.env.isFocused(child);
|
|
46
|
+
const sub = new BufferSurface(this.env, ox, oy, rect.width, rect.height, clip, focused);
|
|
47
|
+
this.env.entries.push({ component: child, rect: abs });
|
|
48
|
+
const dim = opts?.opacity !== undefined && opts.opacity < 1;
|
|
49
|
+
if (dim)
|
|
50
|
+
(0, cellbuffer_1.pushOpacity)(this.env.buffer, opts.opacity);
|
|
51
|
+
child.render(sub);
|
|
52
|
+
if (dim)
|
|
53
|
+
(0, cellbuffer_1.popOpacity)(this.env.buffer);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
class ProbeSurface {
|
|
57
|
+
width;
|
|
58
|
+
maxRow = 0;
|
|
59
|
+
maxCol = 0;
|
|
60
|
+
height = Number.POSITIVE_INFINITY;
|
|
61
|
+
focused = false;
|
|
62
|
+
constructor(width) {
|
|
63
|
+
this.width = width;
|
|
64
|
+
}
|
|
65
|
+
bumpRow(row) {
|
|
66
|
+
if (row > this.maxRow)
|
|
67
|
+
this.maxRow = row;
|
|
68
|
+
}
|
|
69
|
+
bumpCol(col) {
|
|
70
|
+
if (col > this.maxCol)
|
|
71
|
+
this.maxCol = col;
|
|
72
|
+
}
|
|
73
|
+
text(x, y, value) {
|
|
74
|
+
this.bumpRow(y + value.split('\n').length);
|
|
75
|
+
let width = 0;
|
|
76
|
+
for (const line of value.split('\n')) {
|
|
77
|
+
const lineWidth = (0, utils_1.visibleWidth)(line);
|
|
78
|
+
if (lineWidth > width)
|
|
79
|
+
width = lineWidth;
|
|
80
|
+
}
|
|
81
|
+
this.bumpCol(x + width);
|
|
82
|
+
}
|
|
83
|
+
fill(rect) {
|
|
84
|
+
if (Number.isFinite(rect.height))
|
|
85
|
+
this.bumpRow(rect.y + rect.height);
|
|
86
|
+
if (Number.isFinite(rect.width))
|
|
87
|
+
this.bumpCol(rect.x + rect.width);
|
|
88
|
+
}
|
|
89
|
+
measure(child, width) {
|
|
90
|
+
return measure(child, width);
|
|
91
|
+
}
|
|
92
|
+
child(_child, rect) {
|
|
93
|
+
if (Number.isFinite(rect.height))
|
|
94
|
+
this.bumpRow(rect.y + rect.height);
|
|
95
|
+
if (Number.isFinite(rect.width))
|
|
96
|
+
this.bumpCol(rect.x + rect.width);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function measure(component, width) {
|
|
100
|
+
const probe = new ProbeSurface(Math.max(0, width));
|
|
101
|
+
component.render(probe);
|
|
102
|
+
return probe.maxRow;
|
|
103
|
+
}
|
|
104
|
+
function measureWidth(component, maxWidth) {
|
|
105
|
+
const probe = new ProbeSurface(Math.max(0, maxWidth));
|
|
106
|
+
component.render(probe);
|
|
107
|
+
return probe.maxCol;
|
|
108
|
+
}
|
|
109
|
+
function renderToBuffer(component, buffer, isFocused = () => false) {
|
|
110
|
+
const entries = [];
|
|
111
|
+
const env = { buffer, isFocused, entries };
|
|
112
|
+
const clip = { x: 0, y: 0, width: buffer.width, height: buffer.height };
|
|
113
|
+
component.render(new BufferSurface(env, 0, 0, buffer.width, buffer.height, clip, false));
|
|
114
|
+
return entries;
|
|
115
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type Capabilities, type PartialCapabilities } from './capabilities';
|
|
2
|
+
import type { Terminal, TerminalMode } from './types/terminal';
|
|
3
|
+
export interface ProcessTerminalOptions {
|
|
4
|
+
capabilities?: PartialCapabilities;
|
|
5
|
+
alternateScreen?: boolean;
|
|
6
|
+
bracketedPaste?: boolean;
|
|
7
|
+
focusEvents?: boolean;
|
|
8
|
+
keyboard?: boolean;
|
|
9
|
+
mouse?: boolean | {
|
|
10
|
+
drag?: boolean;
|
|
11
|
+
motion?: boolean;
|
|
12
|
+
pixel?: boolean;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare class ProcessTerminal implements Terminal {
|
|
16
|
+
private readonly options;
|
|
17
|
+
private _columns;
|
|
18
|
+
private _rows;
|
|
19
|
+
private onData;
|
|
20
|
+
private onResize;
|
|
21
|
+
private cleanupHandlers;
|
|
22
|
+
private stdinDataHandler;
|
|
23
|
+
private stdoutResizeHandler;
|
|
24
|
+
private started;
|
|
25
|
+
private readonly enabledModes;
|
|
26
|
+
readonly capabilities: Capabilities;
|
|
27
|
+
constructor(options?: ProcessTerminalOptions);
|
|
28
|
+
get columns(): number;
|
|
29
|
+
get rows(): number;
|
|
30
|
+
write(data: string): void;
|
|
31
|
+
hideCursor(): void;
|
|
32
|
+
showCursor(): void;
|
|
33
|
+
clearScreen(): void;
|
|
34
|
+
clearLine(): void;
|
|
35
|
+
clearFromCursor(): void;
|
|
36
|
+
moveBy(lines: number): void;
|
|
37
|
+
enableMode(mode: TerminalMode): void;
|
|
38
|
+
disableMode(mode: TerminalMode): void;
|
|
39
|
+
enableMouse(): void;
|
|
40
|
+
disableMouse(): void;
|
|
41
|
+
start(onInput: (data: string) => void, onResize: () => void): void;
|
|
42
|
+
stop(): void;
|
|
43
|
+
private applyStartupModes;
|
|
44
|
+
private restoreModes;
|
|
45
|
+
private restoreInputAfterDrain;
|
|
46
|
+
private stopNow;
|
|
47
|
+
private restoreInputNow;
|
|
48
|
+
}
|