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,7 @@
|
|
|
1
|
+
import type { Channel } from '../channels/index.js';
|
|
2
|
+
import type { ChatApp, ChatAppOptions } from './types.js';
|
|
3
|
+
export * from './types.js';
|
|
4
|
+
export * from './kit.js';
|
|
5
|
+
export * from './components/index.js';
|
|
6
|
+
export { createChatApp } from './channel.js';
|
|
7
|
+
export declare const runChat: (channel: Channel, opts?: ChatAppOptions) => ChatApp;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createChatApp } from './channel.js';
|
|
2
|
+
export * from './types.js';
|
|
3
|
+
export * from './kit.js';
|
|
4
|
+
export * from './components/index.js';
|
|
5
|
+
export { createChatApp } from './channel.js';
|
|
6
|
+
export const runChat = (channel, opts) => {
|
|
7
|
+
const app = createChatApp(channel, opts);
|
|
8
|
+
app.start();
|
|
9
|
+
return app;
|
|
10
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Component, type FlexItem } from 'mu-tui';
|
|
2
|
+
export interface EditorHandle extends Component {
|
|
3
|
+
getValue(): string;
|
|
4
|
+
setValue(value: string): void;
|
|
5
|
+
}
|
|
6
|
+
export interface ComponentKit {
|
|
7
|
+
text(value: string): Component;
|
|
8
|
+
column(children: (Component | FlexItem)[]): Component;
|
|
9
|
+
scrollView(content: Component): Component;
|
|
10
|
+
editor(opts: {
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
onSubmit?: (value: string) => void;
|
|
13
|
+
}): EditorHandle;
|
|
14
|
+
}
|
|
15
|
+
export declare const defaultKit: ComponentKit;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Message } from 'mu-core';
|
|
2
|
+
import type { Component, Terminal, TUI } from 'mu-tui';
|
|
3
|
+
import type { Channel } from '../channels/index.js';
|
|
4
|
+
import type { ComponentKit } from './kit.js';
|
|
5
|
+
export type ChatStatus = 'idle' | 'thinking' | 'error';
|
|
6
|
+
export interface ChatContext {
|
|
7
|
+
channel: Channel;
|
|
8
|
+
components: ComponentKit;
|
|
9
|
+
renderMessage: (message: Message) => Component;
|
|
10
|
+
status: {
|
|
11
|
+
current: ChatStatus;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ChatParts {
|
|
15
|
+
header: Component;
|
|
16
|
+
transcript: Component;
|
|
17
|
+
status: Component;
|
|
18
|
+
composer: Component;
|
|
19
|
+
}
|
|
20
|
+
export interface ChatSlots {
|
|
21
|
+
message?: (message: Message, ctx: ChatContext) => Component;
|
|
22
|
+
header?: (ctx: ChatContext) => Component;
|
|
23
|
+
transcript?: (ctx: ChatContext) => Component;
|
|
24
|
+
status?: (ctx: ChatContext) => Component;
|
|
25
|
+
composer?: (ctx: ChatContext) => Component;
|
|
26
|
+
layout?: (parts: ChatParts, ctx: ChatContext) => Component;
|
|
27
|
+
}
|
|
28
|
+
export interface ChatAppOptions {
|
|
29
|
+
terminal?: Terminal;
|
|
30
|
+
components?: Partial<ComponentKit>;
|
|
31
|
+
slots?: ChatSlots;
|
|
32
|
+
onExit?: () => void;
|
|
33
|
+
}
|
|
34
|
+
export interface ChatApp {
|
|
35
|
+
readonly tui: TUI;
|
|
36
|
+
start(): void;
|
|
37
|
+
stop(): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export type CapabilitySource = 'default' | 'env' | 'terminfo' | 'probe' | 'policy' | 'feature' | 'configured' | 'disabled';
|
|
2
|
+
export interface Capability<T> {
|
|
3
|
+
value: T;
|
|
4
|
+
source: CapabilitySource;
|
|
5
|
+
}
|
|
6
|
+
export interface TerminalIdentity {
|
|
7
|
+
term: string;
|
|
8
|
+
program: string;
|
|
9
|
+
multiplexer: 'none' | 'tmux' | 'screen' | 'zellij' | 'unknown';
|
|
10
|
+
transport: 'tty' | 'pipe' | 'ssh' | 'conpty' | 'unknown';
|
|
11
|
+
platform: NodeJS.Platform;
|
|
12
|
+
}
|
|
13
|
+
export interface ScreenCapabilities {
|
|
14
|
+
alternateScreen: Capability<boolean>;
|
|
15
|
+
}
|
|
16
|
+
export interface ColorCapabilities {
|
|
17
|
+
ansi16: Capability<boolean>;
|
|
18
|
+
palette256: Capability<boolean>;
|
|
19
|
+
truecolor: Capability<boolean>;
|
|
20
|
+
}
|
|
21
|
+
export interface InputCapabilities {
|
|
22
|
+
legacy: Capability<boolean>;
|
|
23
|
+
xtermModifiedKeys: Capability<boolean>;
|
|
24
|
+
kittyKeyboard: Capability<boolean>;
|
|
25
|
+
bracketedPaste: Capability<boolean>;
|
|
26
|
+
focusEvents: Capability<boolean>;
|
|
27
|
+
}
|
|
28
|
+
export interface MouseCapabilities {
|
|
29
|
+
sgr: Capability<boolean>;
|
|
30
|
+
drag: Capability<boolean>;
|
|
31
|
+
}
|
|
32
|
+
export interface OscCapabilities {
|
|
33
|
+
title: Capability<boolean>;
|
|
34
|
+
hyperlinks: Capability<boolean>;
|
|
35
|
+
shellIntegration: Capability<boolean>;
|
|
36
|
+
}
|
|
37
|
+
export interface GraphicsCapabilities {
|
|
38
|
+
unicode: Capability<boolean>;
|
|
39
|
+
kitty: Capability<boolean>;
|
|
40
|
+
iterm2: Capability<boolean>;
|
|
41
|
+
}
|
|
42
|
+
export interface SecurityPolicy {
|
|
43
|
+
hyperlinks: 'deny' | 'allow';
|
|
44
|
+
clipboardWrite: 'deny' | 'ask' | 'allow';
|
|
45
|
+
clipboardRead: 'deny' | 'ask' | 'allow';
|
|
46
|
+
images: 'deny' | 'allow';
|
|
47
|
+
shellIntegration: 'deny' | 'allow';
|
|
48
|
+
maxPayloadBytes: number;
|
|
49
|
+
}
|
|
50
|
+
export interface Capabilities {
|
|
51
|
+
identity: TerminalIdentity;
|
|
52
|
+
screen: ScreenCapabilities;
|
|
53
|
+
colors: ColorCapabilities;
|
|
54
|
+
input: InputCapabilities;
|
|
55
|
+
mouse: MouseCapabilities;
|
|
56
|
+
osc: OscCapabilities;
|
|
57
|
+
graphics: GraphicsCapabilities;
|
|
58
|
+
security: SecurityPolicy;
|
|
59
|
+
}
|
|
60
|
+
export type PartialCapabilities = Partial<{
|
|
61
|
+
identity: Partial<TerminalIdentity>;
|
|
62
|
+
screen: Partial<ScreenCapabilities>;
|
|
63
|
+
colors: Partial<ColorCapabilities>;
|
|
64
|
+
input: Partial<InputCapabilities>;
|
|
65
|
+
mouse: Partial<MouseCapabilities>;
|
|
66
|
+
osc: Partial<OscCapabilities>;
|
|
67
|
+
graphics: Partial<GraphicsCapabilities>;
|
|
68
|
+
security: Partial<SecurityPolicy>;
|
|
69
|
+
}>;
|
|
70
|
+
export declare function capability<T>(value: T, source?: CapabilitySource): Capability<T>;
|
|
71
|
+
export declare function createDefaultCapabilities(env?: NodeJS.ProcessEnv): Capabilities;
|
|
72
|
+
export declare function mergeCapabilities(base: Capabilities, patch?: PartialCapabilities): Capabilities;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import process from 'node:process';
|
|
2
|
+
export function capability(value, source = 'default') {
|
|
3
|
+
return { value, source };
|
|
4
|
+
}
|
|
5
|
+
export function createDefaultCapabilities(env = process.env) {
|
|
6
|
+
const term = env.TERM ?? 'dumb';
|
|
7
|
+
const program = env.TERM_PROGRAM ?? env.TERMINAL_EMULATOR ?? (env.KITTY_WINDOW_ID ? 'kitty' : 'unknown');
|
|
8
|
+
const multiplexer = detectMultiplexer(env);
|
|
9
|
+
const transport = detectTransport(env);
|
|
10
|
+
const truecolor = env.COLORTERM === 'truecolor' || env.COLORTERM === '24bit';
|
|
11
|
+
const modernTerm = /xterm|kitty|wezterm|ghostty|alacritty|foot|tmux|screen|vte|rxvt|iterm|mintty/i.test(term);
|
|
12
|
+
return {
|
|
13
|
+
identity: {
|
|
14
|
+
term,
|
|
15
|
+
program,
|
|
16
|
+
multiplexer,
|
|
17
|
+
transport,
|
|
18
|
+
platform: process.platform,
|
|
19
|
+
},
|
|
20
|
+
screen: {
|
|
21
|
+
alternateScreen: capability(modernTerm, modernTerm ? 'env' : 'default'),
|
|
22
|
+
},
|
|
23
|
+
colors: {
|
|
24
|
+
ansi16: capability(term !== 'dumb'),
|
|
25
|
+
palette256: capability(term.includes('256color'), term.includes('256color') ? 'env' : 'default'),
|
|
26
|
+
truecolor: capability(truecolor, truecolor ? 'env' : 'default'),
|
|
27
|
+
},
|
|
28
|
+
input: {
|
|
29
|
+
legacy: capability(true),
|
|
30
|
+
xtermModifiedKeys: capability(modernTerm, modernTerm ? 'env' : 'default'),
|
|
31
|
+
kittyKeyboard: capability(Boolean(env.KITTY_WINDOW_ID), env.KITTY_WINDOW_ID ? 'env' : 'default'),
|
|
32
|
+
bracketedPaste: capability(modernTerm, modernTerm ? 'env' : 'default'),
|
|
33
|
+
focusEvents: capability(modernTerm, modernTerm ? 'env' : 'default'),
|
|
34
|
+
},
|
|
35
|
+
mouse: {
|
|
36
|
+
sgr: capability(modernTerm, modernTerm ? 'env' : 'default'),
|
|
37
|
+
drag: capability(modernTerm, modernTerm ? 'env' : 'default'),
|
|
38
|
+
},
|
|
39
|
+
osc: {
|
|
40
|
+
title: capability(modernTerm, modernTerm ? 'env' : 'default'),
|
|
41
|
+
hyperlinks: capability(modernTerm, modernTerm ? 'env' : 'default'),
|
|
42
|
+
shellIntegration: capability(false),
|
|
43
|
+
},
|
|
44
|
+
graphics: {
|
|
45
|
+
unicode: capability(true),
|
|
46
|
+
kitty: capability(Boolean(env.KITTY_WINDOW_ID), env.KITTY_WINDOW_ID ? 'env' : 'default'),
|
|
47
|
+
iterm2: capability(program === 'iTerm.app', program === 'iTerm.app' ? 'env' : 'default'),
|
|
48
|
+
},
|
|
49
|
+
security: {
|
|
50
|
+
hyperlinks: 'allow',
|
|
51
|
+
clipboardWrite: 'deny',
|
|
52
|
+
clipboardRead: 'deny',
|
|
53
|
+
images: 'deny',
|
|
54
|
+
shellIntegration: 'deny',
|
|
55
|
+
maxPayloadBytes: 1024 * 1024,
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export function mergeCapabilities(base, patch) {
|
|
60
|
+
if (!patch)
|
|
61
|
+
return base;
|
|
62
|
+
return {
|
|
63
|
+
identity: { ...base.identity, ...patch.identity },
|
|
64
|
+
screen: { ...base.screen, ...patch.screen },
|
|
65
|
+
colors: { ...base.colors, ...patch.colors },
|
|
66
|
+
input: { ...base.input, ...patch.input },
|
|
67
|
+
mouse: { ...base.mouse, ...patch.mouse },
|
|
68
|
+
osc: { ...base.osc, ...patch.osc },
|
|
69
|
+
graphics: { ...base.graphics, ...patch.graphics },
|
|
70
|
+
security: { ...base.security, ...patch.security },
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function detectMultiplexer(env) {
|
|
74
|
+
if (env.TMUX)
|
|
75
|
+
return 'tmux';
|
|
76
|
+
if (env.STY)
|
|
77
|
+
return 'screen';
|
|
78
|
+
if (env.ZELLIJ)
|
|
79
|
+
return 'zellij';
|
|
80
|
+
return 'none';
|
|
81
|
+
}
|
|
82
|
+
function detectTransport(env) {
|
|
83
|
+
if (env.SSH_TTY || env.SSH_CONNECTION)
|
|
84
|
+
return 'ssh';
|
|
85
|
+
if (env.WT_SESSION || process.platform === 'win32')
|
|
86
|
+
return 'conpty';
|
|
87
|
+
if (process.stdin.isTTY && process.stdout.isTTY)
|
|
88
|
+
return 'tty';
|
|
89
|
+
return 'pipe';
|
|
90
|
+
}
|
|
@@ -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,60 @@
|
|
|
1
|
+
import { box } from '../views';
|
|
2
|
+
import { editor } from './editor';
|
|
3
|
+
import { selectList } from './select-list';
|
|
4
|
+
export class CommandPalette {
|
|
5
|
+
commands;
|
|
6
|
+
query;
|
|
7
|
+
list;
|
|
8
|
+
width;
|
|
9
|
+
onRun;
|
|
10
|
+
constructor(commands, opts) {
|
|
11
|
+
this.commands = commands;
|
|
12
|
+
this.onRun = opts.onRun;
|
|
13
|
+
this.width = opts.width ?? 60;
|
|
14
|
+
this.query = editor({ placeholder: opts.placeholder ?? 'Rechercher une commande…' });
|
|
15
|
+
this.list = selectList([]);
|
|
16
|
+
this.refilter();
|
|
17
|
+
}
|
|
18
|
+
render(s) {
|
|
19
|
+
s.fill({ x: 0, y: 0, width: s.width, height: s.height }, '#000000', 0.5);
|
|
20
|
+
const panel = {
|
|
21
|
+
render: (ps) => {
|
|
22
|
+
ps.child(this.query, { x: 0, y: 0, width: ps.width, height: 1 }, { focused: true });
|
|
23
|
+
const listHeight = ps.measure(this.list, ps.width);
|
|
24
|
+
ps.child(this.list, { x: 0, y: 1, width: ps.width, height: listHeight });
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
const boxed = box(panel, { border: true, background: '#1c1c1c' });
|
|
28
|
+
const w = Math.min(this.width, Math.max(0, s.width - 2));
|
|
29
|
+
const h = Math.min(s.measure(boxed, w), Math.max(0, s.height - 2));
|
|
30
|
+
const x = Math.max(0, Math.floor((s.width - w) / 2));
|
|
31
|
+
const y = Math.max(0, Math.floor((s.height - h) / 3));
|
|
32
|
+
s.child(boxed, { x, y, width: w, height: h });
|
|
33
|
+
}
|
|
34
|
+
handleInput(event) {
|
|
35
|
+
if (event.type === 'key' && event.kind !== 'release') {
|
|
36
|
+
if (event.key === 'up') {
|
|
37
|
+
this.list.move(-1);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (event.key === 'down') {
|
|
41
|
+
this.list.move(1);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (event.key === 'enter') {
|
|
45
|
+
const item = this.list.selectedItem();
|
|
46
|
+
if (item)
|
|
47
|
+
this.onRun(item.value);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
this.query.handleInput(event);
|
|
52
|
+
this.refilter();
|
|
53
|
+
}
|
|
54
|
+
refilter() {
|
|
55
|
+
const query = this.query.getValue().toLowerCase();
|
|
56
|
+
const matched = this.commands.filter((command) => command.label.toLowerCase().includes(query));
|
|
57
|
+
this.list.setItems(matched.map((command) => ({ label: command.label, value: command })));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export const commandPalette = (commands, opts) => new CommandPalette(commands, opts);
|
|
@@ -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,111 @@
|
|
|
1
|
+
import { sliceByColumn } from '../utils';
|
|
2
|
+
const CURSOR = '\x1b[7m';
|
|
3
|
+
const RESET = '\x1b[0m';
|
|
4
|
+
const DIM = '\x1b[2m';
|
|
5
|
+
export class Editor {
|
|
6
|
+
value;
|
|
7
|
+
cursor;
|
|
8
|
+
scroll = 0;
|
|
9
|
+
placeholder;
|
|
10
|
+
onSubmit;
|
|
11
|
+
onChange;
|
|
12
|
+
constructor(opts = {}) {
|
|
13
|
+
this.value = opts.value ?? '';
|
|
14
|
+
this.cursor = this.value.length;
|
|
15
|
+
this.placeholder = opts.placeholder ?? '';
|
|
16
|
+
this.onSubmit = opts.onSubmit;
|
|
17
|
+
this.onChange = opts.onChange;
|
|
18
|
+
}
|
|
19
|
+
getValue() {
|
|
20
|
+
return this.value;
|
|
21
|
+
}
|
|
22
|
+
setValue(value) {
|
|
23
|
+
this.value = value;
|
|
24
|
+
if (this.cursor > value.length)
|
|
25
|
+
this.cursor = value.length;
|
|
26
|
+
this.onChange?.(value);
|
|
27
|
+
}
|
|
28
|
+
render(s) {
|
|
29
|
+
const width = s.width;
|
|
30
|
+
if (width <= 0)
|
|
31
|
+
return;
|
|
32
|
+
if (this.value.length === 0 && this.placeholder && !s.focused) {
|
|
33
|
+
s.text(0, 0, `${DIM}${sliceByColumn(this.placeholder, 0, width, true)}${RESET}`);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (this.cursor < this.scroll)
|
|
37
|
+
this.scroll = this.cursor;
|
|
38
|
+
else if (this.cursor >= this.scroll + width)
|
|
39
|
+
this.scroll = this.cursor - width + 1;
|
|
40
|
+
const visible = this.value.slice(this.scroll, this.scroll + width);
|
|
41
|
+
if (!s.focused) {
|
|
42
|
+
s.text(0, 0, visible);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const col = this.cursor - this.scroll;
|
|
46
|
+
const before = visible.slice(0, col);
|
|
47
|
+
const at = visible.slice(col, col + 1) || ' ';
|
|
48
|
+
const after = visible.slice(col + 1);
|
|
49
|
+
s.text(0, 0, `${before}${CURSOR}${at}${RESET}${after}`);
|
|
50
|
+
}
|
|
51
|
+
handleInput(event) {
|
|
52
|
+
if (event.type === 'paste') {
|
|
53
|
+
this.insert(event.text.replace(/\n/g, ' '));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (event.type === 'text') {
|
|
57
|
+
this.insert(event.text);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (event.type !== 'key' || event.kind === 'release')
|
|
61
|
+
return;
|
|
62
|
+
this.handleKey(event);
|
|
63
|
+
}
|
|
64
|
+
handleKey(event) {
|
|
65
|
+
switch (event.key) {
|
|
66
|
+
case 'enter':
|
|
67
|
+
this.onSubmit?.(this.value);
|
|
68
|
+
return;
|
|
69
|
+
case 'backspace':
|
|
70
|
+
this.backspace();
|
|
71
|
+
return;
|
|
72
|
+
case 'delete':
|
|
73
|
+
this.deleteForward();
|
|
74
|
+
return;
|
|
75
|
+
case 'left':
|
|
76
|
+
this.cursor = Math.max(0, this.cursor - 1);
|
|
77
|
+
return;
|
|
78
|
+
case 'right':
|
|
79
|
+
this.cursor = Math.min(this.value.length, this.cursor + 1);
|
|
80
|
+
return;
|
|
81
|
+
case 'home':
|
|
82
|
+
this.cursor = 0;
|
|
83
|
+
return;
|
|
84
|
+
case 'end':
|
|
85
|
+
this.cursor = this.value.length;
|
|
86
|
+
return;
|
|
87
|
+
default:
|
|
88
|
+
if (event.text && !event.ctrl && !event.meta && !event.alt)
|
|
89
|
+
this.insert(event.text);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
insert(text) {
|
|
93
|
+
this.value = this.value.slice(0, this.cursor) + text + this.value.slice(this.cursor);
|
|
94
|
+
this.cursor += text.length;
|
|
95
|
+
this.onChange?.(this.value);
|
|
96
|
+
}
|
|
97
|
+
backspace() {
|
|
98
|
+
if (this.cursor === 0)
|
|
99
|
+
return;
|
|
100
|
+
this.value = this.value.slice(0, this.cursor - 1) + this.value.slice(this.cursor);
|
|
101
|
+
this.cursor -= 1;
|
|
102
|
+
this.onChange?.(this.value);
|
|
103
|
+
}
|
|
104
|
+
deleteForward() {
|
|
105
|
+
if (this.cursor >= this.value.length)
|
|
106
|
+
return;
|
|
107
|
+
this.value = this.value.slice(0, this.cursor) + this.value.slice(this.cursor + 1);
|
|
108
|
+
this.onChange?.(this.value);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
export const editor = (opts) => new Editor(opts);
|
|
@@ -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,45 @@
|
|
|
1
|
+
export class ScrollView {
|
|
2
|
+
content;
|
|
3
|
+
scrollY = 0;
|
|
4
|
+
stick = true;
|
|
5
|
+
constructor(content) {
|
|
6
|
+
this.content = content;
|
|
7
|
+
}
|
|
8
|
+
setContent(content) {
|
|
9
|
+
this.content = content;
|
|
10
|
+
}
|
|
11
|
+
scrollToBottom() {
|
|
12
|
+
this.stick = true;
|
|
13
|
+
}
|
|
14
|
+
render(s) {
|
|
15
|
+
const contentHeight = s.measure(this.content, s.width);
|
|
16
|
+
if (Number.isFinite(s.height)) {
|
|
17
|
+
const maxScroll = Math.max(0, contentHeight - s.height);
|
|
18
|
+
if (!this.stick && this.scrollY >= maxScroll)
|
|
19
|
+
this.stick = true;
|
|
20
|
+
this.scrollY = this.stick ? maxScroll : Math.min(this.scrollY, maxScroll);
|
|
21
|
+
}
|
|
22
|
+
const scroll = Number.isFinite(s.height) ? this.scrollY : 0;
|
|
23
|
+
s.child(this.content, { x: 0, y: -scroll, width: s.width, height: contentHeight });
|
|
24
|
+
}
|
|
25
|
+
handleInput(event) {
|
|
26
|
+
if (event.type === 'mouse' && event.kind === 'wheel') {
|
|
27
|
+
if (event.button === 'wheelUp')
|
|
28
|
+
this.scrollBy(-1);
|
|
29
|
+
else if (event.button === 'wheelDown')
|
|
30
|
+
this.scrollBy(1);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (event.type !== 'key' || event.kind === 'release')
|
|
34
|
+
return;
|
|
35
|
+
if (event.key === 'up')
|
|
36
|
+
this.scrollBy(-1);
|
|
37
|
+
else if (event.key === 'down')
|
|
38
|
+
this.scrollBy(1);
|
|
39
|
+
}
|
|
40
|
+
scrollBy(delta) {
|
|
41
|
+
this.stick = false;
|
|
42
|
+
this.scrollY = Math.max(0, this.scrollY + delta);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export const scrollView = (content) => new ScrollView(content);
|
|
@@ -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,69 @@
|
|
|
1
|
+
import { truncateToWidth, visibleWidth } from '../utils';
|
|
2
|
+
const SELECTED = '\x1b[7m';
|
|
3
|
+
const RESET = '\x1b[0m';
|
|
4
|
+
const pad = (value, width) => {
|
|
5
|
+
const fitted = visibleWidth(value) > width ? truncateToWidth(value, width) : value;
|
|
6
|
+
const gap = width - visibleWidth(fitted);
|
|
7
|
+
return gap > 0 ? fitted + ' '.repeat(gap) : fitted;
|
|
8
|
+
};
|
|
9
|
+
export class SelectList {
|
|
10
|
+
items;
|
|
11
|
+
selected = 0;
|
|
12
|
+
top = 0;
|
|
13
|
+
maxRows;
|
|
14
|
+
onSelect;
|
|
15
|
+
constructor(items = [], opts = {}) {
|
|
16
|
+
this.items = items;
|
|
17
|
+
this.maxRows = opts.maxRows ?? 10;
|
|
18
|
+
}
|
|
19
|
+
setItems(items) {
|
|
20
|
+
this.items = items;
|
|
21
|
+
if (this.selected >= items.length)
|
|
22
|
+
this.selected = Math.max(0, items.length - 1);
|
|
23
|
+
}
|
|
24
|
+
selectedItem() {
|
|
25
|
+
return this.items[this.selected];
|
|
26
|
+
}
|
|
27
|
+
move(delta) {
|
|
28
|
+
if (this.items.length === 0)
|
|
29
|
+
return;
|
|
30
|
+
this.selected = (this.selected + delta + this.items.length) % this.items.length;
|
|
31
|
+
}
|
|
32
|
+
render(s) {
|
|
33
|
+
const rows = Math.min(this.items.length, this.maxRows, s.height === Infinity ? this.maxRows : s.height);
|
|
34
|
+
if (this.selected < this.top)
|
|
35
|
+
this.top = this.selected;
|
|
36
|
+
else if (this.selected >= this.top + rows)
|
|
37
|
+
this.top = this.selected - rows + 1;
|
|
38
|
+
for (let i = 0; i < rows; i++) {
|
|
39
|
+
const index = this.top + i;
|
|
40
|
+
const item = this.items[index];
|
|
41
|
+
if (!item)
|
|
42
|
+
break;
|
|
43
|
+
const line = pad(item.label, s.width);
|
|
44
|
+
s.text(0, i, index === this.selected ? `${SELECTED}${line}${RESET}` : line);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
handleInput(event) {
|
|
48
|
+
if (event.type === 'mouse' && event.kind === 'press' && event.button === 'left') {
|
|
49
|
+
const index = this.top + (event.localY ?? 0);
|
|
50
|
+
if (index >= 0 && index < this.items.length) {
|
|
51
|
+
this.selected = index;
|
|
52
|
+
this.onSelect?.(this.items[index]);
|
|
53
|
+
}
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (event.type !== 'key' || event.kind === 'release')
|
|
57
|
+
return;
|
|
58
|
+
if (event.key === 'up')
|
|
59
|
+
this.move(-1);
|
|
60
|
+
else if (event.key === 'down')
|
|
61
|
+
this.move(1);
|
|
62
|
+
else if (event.key === 'enter') {
|
|
63
|
+
const item = this.selectedItem();
|
|
64
|
+
if (item)
|
|
65
|
+
this.onSelect?.(item);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export const selectList = (items, opts) => new SelectList(items ?? [], opts ?? {});
|