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,24 @@
|
|
|
1
|
+
import type { InputEvent } from '../events';
|
|
2
|
+
import type { Component, Surface } from '../surface';
|
|
3
|
+
export interface Command {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
run: () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface CommandPaletteOptions {
|
|
9
|
+
onRun: (command: Command) => void;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
width?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare class CommandPalette implements Component {
|
|
14
|
+
private readonly commands;
|
|
15
|
+
private readonly query;
|
|
16
|
+
private readonly list;
|
|
17
|
+
private readonly width;
|
|
18
|
+
private readonly onRun;
|
|
19
|
+
constructor(commands: Command[], opts: CommandPaletteOptions);
|
|
20
|
+
render(s: Surface): void;
|
|
21
|
+
handleInput(event: InputEvent): void;
|
|
22
|
+
private refilter;
|
|
23
|
+
}
|
|
24
|
+
export declare const commandPalette: (commands: Command[], opts: CommandPaletteOptions) => CommandPalette;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commandPalette = exports.CommandPalette = void 0;
|
|
4
|
+
const views_1 = require("../views");
|
|
5
|
+
const editor_1 = require("./editor");
|
|
6
|
+
const select_list_1 = require("./select-list");
|
|
7
|
+
class CommandPalette {
|
|
8
|
+
commands;
|
|
9
|
+
query;
|
|
10
|
+
list;
|
|
11
|
+
width;
|
|
12
|
+
onRun;
|
|
13
|
+
constructor(commands, opts) {
|
|
14
|
+
this.commands = commands;
|
|
15
|
+
this.onRun = opts.onRun;
|
|
16
|
+
this.width = opts.width ?? 60;
|
|
17
|
+
this.query = (0, editor_1.editor)({ placeholder: opts.placeholder ?? 'Rechercher une commande…' });
|
|
18
|
+
this.list = (0, select_list_1.selectList)([]);
|
|
19
|
+
this.refilter();
|
|
20
|
+
}
|
|
21
|
+
render(s) {
|
|
22
|
+
s.fill({ x: 0, y: 0, width: s.width, height: s.height }, '#000000', 0.5);
|
|
23
|
+
const panel = {
|
|
24
|
+
render: (ps) => {
|
|
25
|
+
ps.child(this.query, { x: 0, y: 0, width: ps.width, height: 1 }, { focused: true });
|
|
26
|
+
const listHeight = ps.measure(this.list, ps.width);
|
|
27
|
+
ps.child(this.list, { x: 0, y: 1, width: ps.width, height: listHeight });
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
const boxed = (0, views_1.box)(panel, { border: true, background: '#1c1c1c' });
|
|
31
|
+
const w = Math.min(this.width, Math.max(0, s.width - 2));
|
|
32
|
+
const h = Math.min(s.measure(boxed, w), Math.max(0, s.height - 2));
|
|
33
|
+
const x = Math.max(0, Math.floor((s.width - w) / 2));
|
|
34
|
+
const y = Math.max(0, Math.floor((s.height - h) / 3));
|
|
35
|
+
s.child(boxed, { x, y, width: w, height: h });
|
|
36
|
+
}
|
|
37
|
+
handleInput(event) {
|
|
38
|
+
if (event.type === 'key' && event.kind !== 'release') {
|
|
39
|
+
if (event.key === 'up') {
|
|
40
|
+
this.list.move(-1);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (event.key === 'down') {
|
|
44
|
+
this.list.move(1);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (event.key === 'enter') {
|
|
48
|
+
const item = this.list.selectedItem();
|
|
49
|
+
if (item)
|
|
50
|
+
this.onRun(item.value);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
this.query.handleInput(event);
|
|
55
|
+
this.refilter();
|
|
56
|
+
}
|
|
57
|
+
refilter() {
|
|
58
|
+
const query = this.query.getValue().toLowerCase();
|
|
59
|
+
const matched = this.commands.filter((command) => command.label.toLowerCase().includes(query));
|
|
60
|
+
this.list.setItems(matched.map((command) => ({ label: command.label, value: command })));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.CommandPalette = CommandPalette;
|
|
64
|
+
const commandPalette = (commands, opts) => new CommandPalette(commands, opts);
|
|
65
|
+
exports.commandPalette = commandPalette;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { InputEvent } from '../events';
|
|
2
|
+
import type { Component, Surface } from '../surface';
|
|
3
|
+
export interface EditorOptions {
|
|
4
|
+
value?: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
onSubmit?: (value: string) => void;
|
|
7
|
+
onChange?: (value: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare class Editor implements Component {
|
|
10
|
+
private value;
|
|
11
|
+
private cursor;
|
|
12
|
+
private scroll;
|
|
13
|
+
private readonly placeholder;
|
|
14
|
+
onSubmit?: (value: string) => void;
|
|
15
|
+
onChange?: (value: string) => void;
|
|
16
|
+
constructor(opts?: EditorOptions);
|
|
17
|
+
getValue(): string;
|
|
18
|
+
setValue(value: string): void;
|
|
19
|
+
render(s: Surface): void;
|
|
20
|
+
handleInput(event: InputEvent): void;
|
|
21
|
+
private handleKey;
|
|
22
|
+
private insert;
|
|
23
|
+
private backspace;
|
|
24
|
+
private deleteForward;
|
|
25
|
+
}
|
|
26
|
+
export declare const editor: (opts?: EditorOptions) => Editor;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.editor = exports.Editor = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const CURSOR = '\x1b[7m';
|
|
6
|
+
const RESET = '\x1b[0m';
|
|
7
|
+
const DIM = '\x1b[2m';
|
|
8
|
+
class Editor {
|
|
9
|
+
value;
|
|
10
|
+
cursor;
|
|
11
|
+
scroll = 0;
|
|
12
|
+
placeholder;
|
|
13
|
+
onSubmit;
|
|
14
|
+
onChange;
|
|
15
|
+
constructor(opts = {}) {
|
|
16
|
+
this.value = opts.value ?? '';
|
|
17
|
+
this.cursor = this.value.length;
|
|
18
|
+
this.placeholder = opts.placeholder ?? '';
|
|
19
|
+
this.onSubmit = opts.onSubmit;
|
|
20
|
+
this.onChange = opts.onChange;
|
|
21
|
+
}
|
|
22
|
+
getValue() {
|
|
23
|
+
return this.value;
|
|
24
|
+
}
|
|
25
|
+
setValue(value) {
|
|
26
|
+
this.value = value;
|
|
27
|
+
if (this.cursor > value.length)
|
|
28
|
+
this.cursor = value.length;
|
|
29
|
+
this.onChange?.(value);
|
|
30
|
+
}
|
|
31
|
+
render(s) {
|
|
32
|
+
const width = s.width;
|
|
33
|
+
if (width <= 0)
|
|
34
|
+
return;
|
|
35
|
+
if (this.value.length === 0 && this.placeholder && !s.focused) {
|
|
36
|
+
s.text(0, 0, `${DIM}${(0, utils_1.sliceByColumn)(this.placeholder, 0, width, true)}${RESET}`);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (this.cursor < this.scroll)
|
|
40
|
+
this.scroll = this.cursor;
|
|
41
|
+
else if (this.cursor >= this.scroll + width)
|
|
42
|
+
this.scroll = this.cursor - width + 1;
|
|
43
|
+
const visible = this.value.slice(this.scroll, this.scroll + width);
|
|
44
|
+
if (!s.focused) {
|
|
45
|
+
s.text(0, 0, visible);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const col = this.cursor - this.scroll;
|
|
49
|
+
const before = visible.slice(0, col);
|
|
50
|
+
const at = visible.slice(col, col + 1) || ' ';
|
|
51
|
+
const after = visible.slice(col + 1);
|
|
52
|
+
s.text(0, 0, `${before}${CURSOR}${at}${RESET}${after}`);
|
|
53
|
+
}
|
|
54
|
+
handleInput(event) {
|
|
55
|
+
if (event.type === 'paste') {
|
|
56
|
+
this.insert(event.text.replace(/\n/g, ' '));
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (event.type === 'text') {
|
|
60
|
+
this.insert(event.text);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (event.type !== 'key' || event.kind === 'release')
|
|
64
|
+
return;
|
|
65
|
+
this.handleKey(event);
|
|
66
|
+
}
|
|
67
|
+
handleKey(event) {
|
|
68
|
+
switch (event.key) {
|
|
69
|
+
case 'enter':
|
|
70
|
+
this.onSubmit?.(this.value);
|
|
71
|
+
return;
|
|
72
|
+
case 'backspace':
|
|
73
|
+
this.backspace();
|
|
74
|
+
return;
|
|
75
|
+
case 'delete':
|
|
76
|
+
this.deleteForward();
|
|
77
|
+
return;
|
|
78
|
+
case 'left':
|
|
79
|
+
this.cursor = Math.max(0, this.cursor - 1);
|
|
80
|
+
return;
|
|
81
|
+
case 'right':
|
|
82
|
+
this.cursor = Math.min(this.value.length, this.cursor + 1);
|
|
83
|
+
return;
|
|
84
|
+
case 'home':
|
|
85
|
+
this.cursor = 0;
|
|
86
|
+
return;
|
|
87
|
+
case 'end':
|
|
88
|
+
this.cursor = this.value.length;
|
|
89
|
+
return;
|
|
90
|
+
default:
|
|
91
|
+
if (event.text && !event.ctrl && !event.meta && !event.alt)
|
|
92
|
+
this.insert(event.text);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
insert(text) {
|
|
96
|
+
this.value = this.value.slice(0, this.cursor) + text + this.value.slice(this.cursor);
|
|
97
|
+
this.cursor += text.length;
|
|
98
|
+
this.onChange?.(this.value);
|
|
99
|
+
}
|
|
100
|
+
backspace() {
|
|
101
|
+
if (this.cursor === 0)
|
|
102
|
+
return;
|
|
103
|
+
this.value = this.value.slice(0, this.cursor - 1) + this.value.slice(this.cursor);
|
|
104
|
+
this.cursor -= 1;
|
|
105
|
+
this.onChange?.(this.value);
|
|
106
|
+
}
|
|
107
|
+
deleteForward() {
|
|
108
|
+
if (this.cursor >= this.value.length)
|
|
109
|
+
return;
|
|
110
|
+
this.value = this.value.slice(0, this.cursor) + this.value.slice(this.cursor + 1);
|
|
111
|
+
this.onChange?.(this.value);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.Editor = Editor;
|
|
115
|
+
const editor = (opts) => new Editor(opts);
|
|
116
|
+
exports.editor = editor;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { InputEvent } from '../events';
|
|
2
|
+
import type { Component, Surface } from '../surface';
|
|
3
|
+
export declare class ScrollView implements Component {
|
|
4
|
+
private content;
|
|
5
|
+
private scrollY;
|
|
6
|
+
private stick;
|
|
7
|
+
constructor(content: Component);
|
|
8
|
+
setContent(content: Component): void;
|
|
9
|
+
scrollToBottom(): void;
|
|
10
|
+
render(s: Surface): void;
|
|
11
|
+
handleInput(event: InputEvent): void;
|
|
12
|
+
private scrollBy;
|
|
13
|
+
}
|
|
14
|
+
export declare const scrollView: (content: Component) => ScrollView;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.scrollView = exports.ScrollView = void 0;
|
|
4
|
+
class ScrollView {
|
|
5
|
+
content;
|
|
6
|
+
scrollY = 0;
|
|
7
|
+
stick = true;
|
|
8
|
+
constructor(content) {
|
|
9
|
+
this.content = content;
|
|
10
|
+
}
|
|
11
|
+
setContent(content) {
|
|
12
|
+
this.content = content;
|
|
13
|
+
}
|
|
14
|
+
scrollToBottom() {
|
|
15
|
+
this.stick = true;
|
|
16
|
+
}
|
|
17
|
+
render(s) {
|
|
18
|
+
const contentHeight = s.measure(this.content, s.width);
|
|
19
|
+
if (Number.isFinite(s.height)) {
|
|
20
|
+
const maxScroll = Math.max(0, contentHeight - s.height);
|
|
21
|
+
if (!this.stick && this.scrollY >= maxScroll)
|
|
22
|
+
this.stick = true;
|
|
23
|
+
this.scrollY = this.stick ? maxScroll : Math.min(this.scrollY, maxScroll);
|
|
24
|
+
}
|
|
25
|
+
const scroll = Number.isFinite(s.height) ? this.scrollY : 0;
|
|
26
|
+
s.child(this.content, { x: 0, y: -scroll, width: s.width, height: contentHeight });
|
|
27
|
+
}
|
|
28
|
+
handleInput(event) {
|
|
29
|
+
if (event.type === 'mouse' && event.kind === 'wheel') {
|
|
30
|
+
if (event.button === 'wheelUp')
|
|
31
|
+
this.scrollBy(-1);
|
|
32
|
+
else if (event.button === 'wheelDown')
|
|
33
|
+
this.scrollBy(1);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (event.type !== 'key' || event.kind === 'release')
|
|
37
|
+
return;
|
|
38
|
+
if (event.key === 'up')
|
|
39
|
+
this.scrollBy(-1);
|
|
40
|
+
else if (event.key === 'down')
|
|
41
|
+
this.scrollBy(1);
|
|
42
|
+
}
|
|
43
|
+
scrollBy(delta) {
|
|
44
|
+
this.stick = false;
|
|
45
|
+
this.scrollY = Math.max(0, this.scrollY + delta);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.ScrollView = ScrollView;
|
|
49
|
+
const scrollView = (content) => new ScrollView(content);
|
|
50
|
+
exports.scrollView = scrollView;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { InputEvent } from '../events';
|
|
2
|
+
import type { Component, Surface } from '../surface';
|
|
3
|
+
export interface SelectItem<T> {
|
|
4
|
+
label: string;
|
|
5
|
+
value: T;
|
|
6
|
+
}
|
|
7
|
+
export declare class SelectList<T> implements Component {
|
|
8
|
+
private items;
|
|
9
|
+
private selected;
|
|
10
|
+
private top;
|
|
11
|
+
private readonly maxRows;
|
|
12
|
+
onSelect?: (item: SelectItem<T>) => void;
|
|
13
|
+
constructor(items?: SelectItem<T>[], opts?: {
|
|
14
|
+
maxRows?: number;
|
|
15
|
+
});
|
|
16
|
+
setItems(items: SelectItem<T>[]): void;
|
|
17
|
+
selectedItem(): SelectItem<T> | undefined;
|
|
18
|
+
move(delta: number): void;
|
|
19
|
+
render(s: Surface): void;
|
|
20
|
+
handleInput(event: InputEvent): void;
|
|
21
|
+
}
|
|
22
|
+
export declare const selectList: <T>(items?: SelectItem<T>[], opts?: {
|
|
23
|
+
maxRows?: number;
|
|
24
|
+
}) => SelectList<T>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.selectList = exports.SelectList = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const SELECTED = '\x1b[7m';
|
|
6
|
+
const RESET = '\x1b[0m';
|
|
7
|
+
const pad = (value, width) => {
|
|
8
|
+
const fitted = (0, utils_1.visibleWidth)(value) > width ? (0, utils_1.truncateToWidth)(value, width) : value;
|
|
9
|
+
const gap = width - (0, utils_1.visibleWidth)(fitted);
|
|
10
|
+
return gap > 0 ? fitted + ' '.repeat(gap) : fitted;
|
|
11
|
+
};
|
|
12
|
+
class SelectList {
|
|
13
|
+
items;
|
|
14
|
+
selected = 0;
|
|
15
|
+
top = 0;
|
|
16
|
+
maxRows;
|
|
17
|
+
onSelect;
|
|
18
|
+
constructor(items = [], opts = {}) {
|
|
19
|
+
this.items = items;
|
|
20
|
+
this.maxRows = opts.maxRows ?? 10;
|
|
21
|
+
}
|
|
22
|
+
setItems(items) {
|
|
23
|
+
this.items = items;
|
|
24
|
+
if (this.selected >= items.length)
|
|
25
|
+
this.selected = Math.max(0, items.length - 1);
|
|
26
|
+
}
|
|
27
|
+
selectedItem() {
|
|
28
|
+
return this.items[this.selected];
|
|
29
|
+
}
|
|
30
|
+
move(delta) {
|
|
31
|
+
if (this.items.length === 0)
|
|
32
|
+
return;
|
|
33
|
+
this.selected = (this.selected + delta + this.items.length) % this.items.length;
|
|
34
|
+
}
|
|
35
|
+
render(s) {
|
|
36
|
+
const rows = Math.min(this.items.length, this.maxRows, s.height === Infinity ? this.maxRows : s.height);
|
|
37
|
+
if (this.selected < this.top)
|
|
38
|
+
this.top = this.selected;
|
|
39
|
+
else if (this.selected >= this.top + rows)
|
|
40
|
+
this.top = this.selected - rows + 1;
|
|
41
|
+
for (let i = 0; i < rows; i++) {
|
|
42
|
+
const index = this.top + i;
|
|
43
|
+
const item = this.items[index];
|
|
44
|
+
if (!item)
|
|
45
|
+
break;
|
|
46
|
+
const line = pad(item.label, s.width);
|
|
47
|
+
s.text(0, i, index === this.selected ? `${SELECTED}${line}${RESET}` : line);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
handleInput(event) {
|
|
51
|
+
if (event.type === 'mouse' && event.kind === 'press' && event.button === 'left') {
|
|
52
|
+
const index = this.top + (event.localY ?? 0);
|
|
53
|
+
if (index >= 0 && index < this.items.length) {
|
|
54
|
+
this.selected = index;
|
|
55
|
+
this.onSelect?.(this.items[index]);
|
|
56
|
+
}
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (event.type !== 'key' || event.kind === 'release')
|
|
60
|
+
return;
|
|
61
|
+
if (event.key === 'up')
|
|
62
|
+
this.move(-1);
|
|
63
|
+
else if (event.key === 'down')
|
|
64
|
+
this.move(1);
|
|
65
|
+
else if (event.key === 'enter') {
|
|
66
|
+
const item = this.selectedItem();
|
|
67
|
+
if (item)
|
|
68
|
+
this.onSelect?.(item);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.SelectList = SelectList;
|
|
73
|
+
const selectList = (items, opts) => new SelectList(items ?? [], opts ?? {});
|
|
74
|
+
exports.selectList = selectList;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export interface Modifiers {
|
|
2
|
+
shift: boolean;
|
|
3
|
+
ctrl: boolean;
|
|
4
|
+
alt: boolean;
|
|
5
|
+
meta: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type KeyEventKind = 'press' | 'repeat' | 'release';
|
|
8
|
+
export interface KeyInputEvent extends Modifiers {
|
|
9
|
+
type: 'key';
|
|
10
|
+
key: string;
|
|
11
|
+
kind: KeyEventKind;
|
|
12
|
+
text?: string;
|
|
13
|
+
source: 'legacy' | 'xterm' | 'csi-u' | 'kitty' | 'unknown';
|
|
14
|
+
raw: string;
|
|
15
|
+
}
|
|
16
|
+
export interface TextInputEvent {
|
|
17
|
+
type: 'text';
|
|
18
|
+
text: string;
|
|
19
|
+
raw: string;
|
|
20
|
+
}
|
|
21
|
+
export type MouseButton = 'left' | 'middle' | 'right' | 'wheelUp' | 'wheelDown' | 'wheelLeft' | 'wheelRight' | 'unknown';
|
|
22
|
+
export type MouseEventKind = 'press' | 'release' | 'drag' | 'move' | 'wheel';
|
|
23
|
+
export interface MouseInputEvent extends Modifiers {
|
|
24
|
+
type: 'mouse';
|
|
25
|
+
kind: MouseEventKind;
|
|
26
|
+
button: MouseButton;
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
localX?: number;
|
|
30
|
+
localY?: number;
|
|
31
|
+
coordinateSpace: 'cells' | 'pixels';
|
|
32
|
+
source: 'sgr' | 'x10' | 'urxvt' | 'pixel' | 'unknown';
|
|
33
|
+
raw: string;
|
|
34
|
+
}
|
|
35
|
+
export interface PasteInputEvent {
|
|
36
|
+
type: 'paste';
|
|
37
|
+
text: string;
|
|
38
|
+
raw: string;
|
|
39
|
+
}
|
|
40
|
+
export interface FocusInputEvent {
|
|
41
|
+
type: 'focus';
|
|
42
|
+
focused: boolean;
|
|
43
|
+
raw: string;
|
|
44
|
+
}
|
|
45
|
+
export interface ResizeInputEvent {
|
|
46
|
+
type: 'resize';
|
|
47
|
+
columns: number;
|
|
48
|
+
rows: number;
|
|
49
|
+
}
|
|
50
|
+
export interface TerminalResponseEvent {
|
|
51
|
+
type: 'terminalResponse';
|
|
52
|
+
raw: string;
|
|
53
|
+
sequence: 'csi' | 'osc' | 'dcs' | 'apc' | 'pm' | 'sos' | 'escape' | 'unknown';
|
|
54
|
+
}
|
|
55
|
+
export type InputEvent = KeyInputEvent | TextInputEvent | MouseInputEvent | PasteInputEvent | FocusInputEvent | ResizeInputEvent | TerminalResponseEvent;
|
|
56
|
+
export declare const NO_MODIFIERS: Modifiers;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type { Component, Surface, SurfaceEntry } from './surface';
|
|
2
|
+
export { measure, measureWidth, renderToBuffer } from './surface';
|
|
3
|
+
export { box, type BoxOptions, column, flex, type FlexItem, modal, type ModalOptions, overlay, type OverlayOptions, row, text, toast, type ToastKind, type ToastOptions, } from './views';
|
|
4
|
+
export { Editor, editor, type EditorOptions } from './components/editor';
|
|
5
|
+
export { ScrollView, scrollView } from './components/scroll-view';
|
|
6
|
+
export { type SelectItem, SelectList, selectList } from './components/select-list';
|
|
7
|
+
export { type Command, CommandPalette, commandPalette, type CommandPaletteOptions } from './components/command-palette';
|
|
8
|
+
export { type LayerHandle, type ToastHandle, TUI, type TuiOptions } from './tui';
|
|
9
|
+
export { ProcessTerminal, type ProcessTerminalOptions } from './terminal';
|
|
10
|
+
export type { Terminal, TerminalMode } from './types/terminal';
|
|
11
|
+
export type { InputEvent, KeyInputEvent, Modifiers, MouseInputEvent } from './events';
|
|
12
|
+
export { parseInput } from './keyboard';
|
|
13
|
+
export { TerminalInputParser } from './parser';
|
|
14
|
+
export { type GlobalKeybinding, type KeyChord, keyMatches } from './keybinds';
|
|
15
|
+
export { type Capabilities, capability, type CapabilitySource, createDefaultCapabilities, mergeCapabilities, type PartialCapabilities, } from './capabilities';
|
|
16
|
+
export { truncateToWidth, visibleWidth, wrapText } from './utils';
|
|
17
|
+
export type { Color, Rect } from './layout/types';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wrapText = exports.visibleWidth = exports.truncateToWidth = exports.mergeCapabilities = exports.createDefaultCapabilities = exports.capability = exports.keyMatches = exports.TerminalInputParser = exports.parseInput = exports.ProcessTerminal = exports.TUI = exports.commandPalette = exports.CommandPalette = exports.selectList = exports.SelectList = exports.scrollView = exports.ScrollView = exports.editor = exports.Editor = exports.toast = exports.text = exports.row = exports.overlay = exports.modal = exports.flex = exports.column = exports.box = exports.renderToBuffer = exports.measureWidth = exports.measure = void 0;
|
|
4
|
+
var surface_1 = require("./surface");
|
|
5
|
+
Object.defineProperty(exports, "measure", { enumerable: true, get: function () { return surface_1.measure; } });
|
|
6
|
+
Object.defineProperty(exports, "measureWidth", { enumerable: true, get: function () { return surface_1.measureWidth; } });
|
|
7
|
+
Object.defineProperty(exports, "renderToBuffer", { enumerable: true, get: function () { return surface_1.renderToBuffer; } });
|
|
8
|
+
var views_1 = require("./views");
|
|
9
|
+
Object.defineProperty(exports, "box", { enumerable: true, get: function () { return views_1.box; } });
|
|
10
|
+
Object.defineProperty(exports, "column", { enumerable: true, get: function () { return views_1.column; } });
|
|
11
|
+
Object.defineProperty(exports, "flex", { enumerable: true, get: function () { return views_1.flex; } });
|
|
12
|
+
Object.defineProperty(exports, "modal", { enumerable: true, get: function () { return views_1.modal; } });
|
|
13
|
+
Object.defineProperty(exports, "overlay", { enumerable: true, get: function () { return views_1.overlay; } });
|
|
14
|
+
Object.defineProperty(exports, "row", { enumerable: true, get: function () { return views_1.row; } });
|
|
15
|
+
Object.defineProperty(exports, "text", { enumerable: true, get: function () { return views_1.text; } });
|
|
16
|
+
Object.defineProperty(exports, "toast", { enumerable: true, get: function () { return views_1.toast; } });
|
|
17
|
+
var editor_1 = require("./components/editor");
|
|
18
|
+
Object.defineProperty(exports, "Editor", { enumerable: true, get: function () { return editor_1.Editor; } });
|
|
19
|
+
Object.defineProperty(exports, "editor", { enumerable: true, get: function () { return editor_1.editor; } });
|
|
20
|
+
var scroll_view_1 = require("./components/scroll-view");
|
|
21
|
+
Object.defineProperty(exports, "ScrollView", { enumerable: true, get: function () { return scroll_view_1.ScrollView; } });
|
|
22
|
+
Object.defineProperty(exports, "scrollView", { enumerable: true, get: function () { return scroll_view_1.scrollView; } });
|
|
23
|
+
var select_list_1 = require("./components/select-list");
|
|
24
|
+
Object.defineProperty(exports, "SelectList", { enumerable: true, get: function () { return select_list_1.SelectList; } });
|
|
25
|
+
Object.defineProperty(exports, "selectList", { enumerable: true, get: function () { return select_list_1.selectList; } });
|
|
26
|
+
var command_palette_1 = require("./components/command-palette");
|
|
27
|
+
Object.defineProperty(exports, "CommandPalette", { enumerable: true, get: function () { return command_palette_1.CommandPalette; } });
|
|
28
|
+
Object.defineProperty(exports, "commandPalette", { enumerable: true, get: function () { return command_palette_1.commandPalette; } });
|
|
29
|
+
var tui_1 = require("./tui");
|
|
30
|
+
Object.defineProperty(exports, "TUI", { enumerable: true, get: function () { return tui_1.TUI; } });
|
|
31
|
+
var terminal_1 = require("./terminal");
|
|
32
|
+
Object.defineProperty(exports, "ProcessTerminal", { enumerable: true, get: function () { return terminal_1.ProcessTerminal; } });
|
|
33
|
+
var keyboard_1 = require("./keyboard");
|
|
34
|
+
Object.defineProperty(exports, "parseInput", { enumerable: true, get: function () { return keyboard_1.parseInput; } });
|
|
35
|
+
var parser_1 = require("./parser");
|
|
36
|
+
Object.defineProperty(exports, "TerminalInputParser", { enumerable: true, get: function () { return parser_1.TerminalInputParser; } });
|
|
37
|
+
var keybinds_1 = require("./keybinds");
|
|
38
|
+
Object.defineProperty(exports, "keyMatches", { enumerable: true, get: function () { return keybinds_1.keyMatches; } });
|
|
39
|
+
var capabilities_1 = require("./capabilities");
|
|
40
|
+
Object.defineProperty(exports, "capability", { enumerable: true, get: function () { return capabilities_1.capability; } });
|
|
41
|
+
Object.defineProperty(exports, "createDefaultCapabilities", { enumerable: true, get: function () { return capabilities_1.createDefaultCapabilities; } });
|
|
42
|
+
Object.defineProperty(exports, "mergeCapabilities", { enumerable: true, get: function () { return capabilities_1.mergeCapabilities; } });
|
|
43
|
+
var utils_1 = require("./utils");
|
|
44
|
+
Object.defineProperty(exports, "truncateToWidth", { enumerable: true, get: function () { return utils_1.truncateToWidth; } });
|
|
45
|
+
Object.defineProperty(exports, "visibleWidth", { enumerable: true, get: function () { return utils_1.visibleWidth; } });
|
|
46
|
+
Object.defineProperty(exports, "wrapText", { enumerable: true, get: function () { return utils_1.wrapText; } });
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { InputEvent } from './events';
|
|
2
|
+
import type { GlobalKeybinding } from './keybinds';
|
|
3
|
+
import type { Component, SurfaceEntry } from './surface';
|
|
4
|
+
export interface InputRouterHost {
|
|
5
|
+
getFocused(): Component | null;
|
|
6
|
+
getEntries(): SurfaceEntry[];
|
|
7
|
+
setTerminalFocused(focused: boolean): void;
|
|
8
|
+
getTerminalFocused(): boolean;
|
|
9
|
+
requestRender(force?: boolean): void;
|
|
10
|
+
}
|
|
11
|
+
export declare class InputRouter {
|
|
12
|
+
private readonly host;
|
|
13
|
+
private readonly parser;
|
|
14
|
+
private readonly inputInterceptors;
|
|
15
|
+
private readonly globalKeybindings;
|
|
16
|
+
private pendingEscapeTimer;
|
|
17
|
+
private readonly escapeTimeoutMs;
|
|
18
|
+
private stopped;
|
|
19
|
+
constructor(host: InputRouterHost);
|
|
20
|
+
setStopped(stopped: boolean): void;
|
|
21
|
+
addInputInterceptor(listener: (event: InputEvent) => boolean | undefined): () => void;
|
|
22
|
+
addGlobalKeybinding(binding: GlobalKeybinding): () => void;
|
|
23
|
+
feed(data: string): void;
|
|
24
|
+
private dispatchEvents;
|
|
25
|
+
dispatchEvent(event: InputEvent): void;
|
|
26
|
+
private handleMouseEvent;
|
|
27
|
+
private handleGlobalKeybinding;
|
|
28
|
+
}
|