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,300 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stripAnsi = stripAnsi;
|
|
4
|
+
exports.visibleWidth = visibleWidth;
|
|
5
|
+
exports.charWidth = charWidth;
|
|
6
|
+
exports.truncateToWidth = truncateToWidth;
|
|
7
|
+
exports.wrapText = wrapText;
|
|
8
|
+
exports.sliceByColumn = sliceByColumn;
|
|
9
|
+
// deno-lint-ignore no-control-regex
|
|
10
|
+
const ANSI_RE = /\u001B\[[0-?]*[ -/]*[@-~]|\u001B\][^\u0007]*(?:\u0007|\u001B\\)/g;
|
|
11
|
+
// deno-lint-ignore no-control-regex
|
|
12
|
+
const ANSI_TOKEN_RE = /\u001B\[[0-?]*[ -/]*[@-~]|\u001B\][^\u0007]*(?:\u0007|\u001B\\)/gy;
|
|
13
|
+
function stripAnsi(s) {
|
|
14
|
+
return s.replace(ANSI_RE, '');
|
|
15
|
+
}
|
|
16
|
+
function visibleWidth(s) {
|
|
17
|
+
const stripped = stripAnsi(s);
|
|
18
|
+
let w = 0;
|
|
19
|
+
for (let i = 0; i < stripped.length;) {
|
|
20
|
+
const code = stripped.codePointAt(i) ?? 0;
|
|
21
|
+
w += charWidth(code);
|
|
22
|
+
i += code > 0xffff ? 2 : 1;
|
|
23
|
+
}
|
|
24
|
+
return w;
|
|
25
|
+
}
|
|
26
|
+
function charWidth(code) {
|
|
27
|
+
if (code === 0 || code < 0x20 || code === 0x7f)
|
|
28
|
+
return 0;
|
|
29
|
+
if ((code >= 0x1100 && code <= 0x115f) ||
|
|
30
|
+
(code >= 0x231a && code <= 0x231b) ||
|
|
31
|
+
(code >= 0x2329 && code <= 0x232a) ||
|
|
32
|
+
(code >= 0x23e9 && code <= 0x23f3) ||
|
|
33
|
+
(code >= 0x23f8 && code <= 0x23fa) ||
|
|
34
|
+
(code >= 0x25fd && code <= 0x25fe) ||
|
|
35
|
+
(code >= 0x2614 && code <= 0x2615) ||
|
|
36
|
+
(code >= 0x2648 && code <= 0x2653) ||
|
|
37
|
+
code === 0x267f ||
|
|
38
|
+
code === 0x2693 ||
|
|
39
|
+
code === 0x26a1 ||
|
|
40
|
+
(code >= 0x26aa && code <= 0x26ab) ||
|
|
41
|
+
(code >= 0x26bd && code <= 0x26be) ||
|
|
42
|
+
(code >= 0x26c4 && code <= 0x26c5) ||
|
|
43
|
+
code === 0x26ce ||
|
|
44
|
+
code === 0x26d4 ||
|
|
45
|
+
code === 0x26ea ||
|
|
46
|
+
(code >= 0x26f2 && code <= 0x26f3) ||
|
|
47
|
+
code === 0x26f5 ||
|
|
48
|
+
code === 0x26fa ||
|
|
49
|
+
code === 0x26fd ||
|
|
50
|
+
code === 0x2702 ||
|
|
51
|
+
code === 0x2705 ||
|
|
52
|
+
(code >= 0x2708 && code <= 0x270d) ||
|
|
53
|
+
code === 0x270f ||
|
|
54
|
+
code === 0x2712 ||
|
|
55
|
+
code === 0x2714 ||
|
|
56
|
+
code === 0x2716 ||
|
|
57
|
+
code === 0x271d ||
|
|
58
|
+
code === 0x2721 ||
|
|
59
|
+
code === 0x2728 ||
|
|
60
|
+
(code >= 0x2733 && code <= 0x2734) ||
|
|
61
|
+
code === 0x2744 ||
|
|
62
|
+
code === 0x2747 ||
|
|
63
|
+
code === 0x274c ||
|
|
64
|
+
code === 0x274e ||
|
|
65
|
+
(code >= 0x2753 && code <= 0x2755) ||
|
|
66
|
+
code === 0x2757 ||
|
|
67
|
+
(code >= 0x2795 && code <= 0x2797) ||
|
|
68
|
+
code === 0x27a1 ||
|
|
69
|
+
code === 0x27b0 ||
|
|
70
|
+
code === 0x27bf ||
|
|
71
|
+
(code >= 0x2934 && code <= 0x2935) ||
|
|
72
|
+
(code >= 0x2b05 && code <= 0x2b07) ||
|
|
73
|
+
(code >= 0x2b1b && code <= 0x2b1c) ||
|
|
74
|
+
code === 0x2b50 ||
|
|
75
|
+
code === 0x2b55 ||
|
|
76
|
+
(code >= 0x2e80 && code <= 0x303e) ||
|
|
77
|
+
(code >= 0x3041 && code <= 0x33ff) ||
|
|
78
|
+
(code >= 0x3400 && code <= 0x4dbf) ||
|
|
79
|
+
(code >= 0x4e00 && code <= 0x9fff) ||
|
|
80
|
+
(code >= 0xa000 && code <= 0xa4cf) ||
|
|
81
|
+
(code >= 0xac00 && code <= 0xd7a3) ||
|
|
82
|
+
(code >= 0xf900 && code <= 0xfaff) ||
|
|
83
|
+
(code >= 0xfe30 && code <= 0xfe4f) ||
|
|
84
|
+
(code >= 0xff00 && code <= 0xff60) ||
|
|
85
|
+
(code >= 0xffe0 && code <= 0xffe6) ||
|
|
86
|
+
(code >= 0x1f004 && code <= 0x1f004) ||
|
|
87
|
+
(code >= 0x1f0cf && code <= 0x1f0cf) ||
|
|
88
|
+
(code >= 0x1f170 && code <= 0x1f171) ||
|
|
89
|
+
code === 0x1f17e ||
|
|
90
|
+
code === 0x1f17f ||
|
|
91
|
+
code === 0x1f18e ||
|
|
92
|
+
(code >= 0x1f191 && code <= 0x1f19a) ||
|
|
93
|
+
(code >= 0x1f1e0 && code <= 0x1f1ff) ||
|
|
94
|
+
(code >= 0x1f200 && code <= 0x1f202) ||
|
|
95
|
+
code === 0x1f21a ||
|
|
96
|
+
code === 0x1f22f ||
|
|
97
|
+
(code >= 0x1f232 && code <= 0x1f23a) ||
|
|
98
|
+
(code >= 0x1f250 && code <= 0x1f251) ||
|
|
99
|
+
(code >= 0x1f300 && code <= 0x1f321) ||
|
|
100
|
+
(code >= 0x1f324 && code <= 0x1f393) ||
|
|
101
|
+
(code >= 0x1f396 && code <= 0x1f397) ||
|
|
102
|
+
(code >= 0x1f399 && code <= 0x1f39b) ||
|
|
103
|
+
(code >= 0x1f39e && code <= 0x1f3f0) ||
|
|
104
|
+
(code >= 0x1f3f3 && code <= 0x1f3f5) ||
|
|
105
|
+
(code >= 0x1f3f7 && code <= 0x1f4fd) ||
|
|
106
|
+
(code >= 0x1f4ff && code <= 0x1f53d) ||
|
|
107
|
+
(code >= 0x1f549 && code <= 0x1f54e) ||
|
|
108
|
+
(code >= 0x1f550 && code <= 0x1f567) ||
|
|
109
|
+
(code >= 0x1f56f && code <= 0x1f570) ||
|
|
110
|
+
(code >= 0x1f573 && code <= 0x1f57a) ||
|
|
111
|
+
code === 0x1f587 ||
|
|
112
|
+
(code >= 0x1f58a && code <= 0x1f58d) ||
|
|
113
|
+
code === 0x1f590 ||
|
|
114
|
+
(code >= 0x1f595 && code <= 0x1f596) ||
|
|
115
|
+
code === 0x1f5a4 ||
|
|
116
|
+
(code >= 0x1f5a5 && code <= 0x1f5a8) ||
|
|
117
|
+
(code >= 0x1f5b1 && code <= 0x1f5b2) ||
|
|
118
|
+
code === 0x1f5bc ||
|
|
119
|
+
(code >= 0x1f5c2 && code <= 0x1f5c4) ||
|
|
120
|
+
(code >= 0x1f5d1 && code <= 0x1f5d3) ||
|
|
121
|
+
(code >= 0x1f5dc && code <= 0x1f5de) ||
|
|
122
|
+
code === 0x1f5e1 ||
|
|
123
|
+
code === 0x1f5e3 ||
|
|
124
|
+
code === 0x1f5e8 ||
|
|
125
|
+
code === 0x1f5ef ||
|
|
126
|
+
code === 0x1f5f3 ||
|
|
127
|
+
(code >= 0x1f5fa && code <= 0x1f64f) ||
|
|
128
|
+
(code >= 0x1f680 && code <= 0x1f6c5) ||
|
|
129
|
+
(code >= 0x1f6cb && code <= 0x1f6d2) ||
|
|
130
|
+
(code >= 0x1f6d5 && code <= 0x1f6d7) ||
|
|
131
|
+
(code >= 0x1f6e0 && code <= 0x1f6e5) ||
|
|
132
|
+
code === 0x1f6e9 ||
|
|
133
|
+
(code >= 0x1f6eb && code <= 0x1f6ec) ||
|
|
134
|
+
code === 0x1f6f0 ||
|
|
135
|
+
(code >= 0x1f6f3 && code <= 0x1f6fc) ||
|
|
136
|
+
(code >= 0x1f7e0 && code <= 0x1f7eb) ||
|
|
137
|
+
(code >= 0x1f90c && code <= 0x1f93a) ||
|
|
138
|
+
(code >= 0x1f93c && code <= 0x1f945) ||
|
|
139
|
+
(code >= 0x1f947 && code <= 0x1f9ff) ||
|
|
140
|
+
(code >= 0x1fa00 && code <= 0x1fa53) ||
|
|
141
|
+
(code >= 0x1fa60 && code <= 0x1fa6d) ||
|
|
142
|
+
(code >= 0x1fa70 && code <= 0x1fa7c) ||
|
|
143
|
+
(code >= 0x1fa80 && code <= 0x1fa88) ||
|
|
144
|
+
(code >= 0x1fa90 && code <= 0x1fabd) ||
|
|
145
|
+
(code >= 0x1fabf && code <= 0x1fac5) ||
|
|
146
|
+
(code >= 0x1face && code <= 0x1fadb) ||
|
|
147
|
+
(code >= 0x1fae0 && code <= 0x1fae8) ||
|
|
148
|
+
(code >= 0x1faf0 && code <= 0x1faf8)) {
|
|
149
|
+
return 2;
|
|
150
|
+
}
|
|
151
|
+
return 1;
|
|
152
|
+
}
|
|
153
|
+
function truncateToWidth(s, width, ellipsis = '\u2026') {
|
|
154
|
+
if (visibleWidth(s) <= width)
|
|
155
|
+
return s;
|
|
156
|
+
const ellipsisWidth = visibleWidth(ellipsis);
|
|
157
|
+
let result = '';
|
|
158
|
+
let currentWidth = 0;
|
|
159
|
+
const targetWidth = Math.max(0, width - ellipsisWidth);
|
|
160
|
+
for (const token of tokenizeAnsi(s)) {
|
|
161
|
+
if (token.ansi) {
|
|
162
|
+
result += token.value;
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
for (const ch of token.value) {
|
|
166
|
+
const code = ch.codePointAt(0) ?? 0;
|
|
167
|
+
const chWidth = charWidth(code);
|
|
168
|
+
if (currentWidth + chWidth > targetWidth) {
|
|
169
|
+
return result + ellipsis + extractTrailingAnsi(s);
|
|
170
|
+
}
|
|
171
|
+
result += ch;
|
|
172
|
+
currentWidth += chWidth;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return result + ellipsis + extractTrailingAnsi(s);
|
|
176
|
+
}
|
|
177
|
+
function wrapText(text, width) {
|
|
178
|
+
if (width <= 0 || !text)
|
|
179
|
+
return [''];
|
|
180
|
+
const out = [];
|
|
181
|
+
for (const segment of text.split('\n')) {
|
|
182
|
+
const wrapped = wrapSegment(segment, width);
|
|
183
|
+
out.push(...wrapped);
|
|
184
|
+
}
|
|
185
|
+
return out.length === 0 ? [''] : out;
|
|
186
|
+
}
|
|
187
|
+
function pushLine(state) {
|
|
188
|
+
state.lines.push(state.current);
|
|
189
|
+
state.current = '';
|
|
190
|
+
state.col = 0;
|
|
191
|
+
}
|
|
192
|
+
function wrapSegment(segment, width) {
|
|
193
|
+
if (segment.length === 0)
|
|
194
|
+
return [''];
|
|
195
|
+
const tokens = segment.split(/(\s+)/);
|
|
196
|
+
const state = { lines: [], current: '', col: 0 };
|
|
197
|
+
for (const tok of tokens) {
|
|
198
|
+
if (tok.length === 0)
|
|
199
|
+
continue;
|
|
200
|
+
const w = visibleWidth(tok);
|
|
201
|
+
if (w === 0)
|
|
202
|
+
continue;
|
|
203
|
+
if (/^\s+$/.test(tok)) {
|
|
204
|
+
if (state.col === 0) {
|
|
205
|
+
state.current += tok;
|
|
206
|
+
state.col += w;
|
|
207
|
+
}
|
|
208
|
+
else if (state.col + w <= width) {
|
|
209
|
+
state.current += tok;
|
|
210
|
+
state.col += w;
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
pushLine(state);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
else if (w > width) {
|
|
217
|
+
if (state.col > 0)
|
|
218
|
+
pushLine(state);
|
|
219
|
+
let j = 0;
|
|
220
|
+
let buf = '';
|
|
221
|
+
let bufW = 0;
|
|
222
|
+
while (j < tok.length) {
|
|
223
|
+
const code = tok.codePointAt(j) ?? 0;
|
|
224
|
+
const chW = charWidth(code);
|
|
225
|
+
const chStr = code > 0xffff ? tok.slice(j, j + 2) : tok.slice(j, j + 1);
|
|
226
|
+
if (bufW + chW > width) {
|
|
227
|
+
state.lines.push(buf);
|
|
228
|
+
buf = chStr;
|
|
229
|
+
bufW = chW;
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
buf += chStr;
|
|
233
|
+
bufW += chW;
|
|
234
|
+
}
|
|
235
|
+
j += code > 0xffff ? 2 : 1;
|
|
236
|
+
}
|
|
237
|
+
state.current = buf;
|
|
238
|
+
state.col = bufW;
|
|
239
|
+
}
|
|
240
|
+
else if (state.col + w > width) {
|
|
241
|
+
pushLine(state);
|
|
242
|
+
state.current = tok;
|
|
243
|
+
state.col = w;
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
state.current += tok;
|
|
247
|
+
state.col += w;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
state.lines.push(state.current);
|
|
251
|
+
return state.lines;
|
|
252
|
+
}
|
|
253
|
+
function sliceByColumn(s, start, end, strict = false) {
|
|
254
|
+
let col = 0;
|
|
255
|
+
let result = '';
|
|
256
|
+
for (const token of tokenizeAnsi(s)) {
|
|
257
|
+
if (token.ansi) {
|
|
258
|
+
result += token.value;
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
for (const ch of token.value) {
|
|
262
|
+
const code = ch.codePointAt(0) ?? 0;
|
|
263
|
+
const chWidth = charWidth(code);
|
|
264
|
+
const nextCol = col + chWidth;
|
|
265
|
+
if (nextCol > start) {
|
|
266
|
+
if (col >= end)
|
|
267
|
+
return result + extractTrailingAnsi(s);
|
|
268
|
+
if (col >= start) {
|
|
269
|
+
if (!strict || nextCol <= end)
|
|
270
|
+
result += ch;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
col = nextCol;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return result + extractTrailingAnsi(s);
|
|
277
|
+
}
|
|
278
|
+
function tokenizeAnsi(s) {
|
|
279
|
+
const tokens = [];
|
|
280
|
+
let index = 0;
|
|
281
|
+
while (index < s.length) {
|
|
282
|
+
ANSI_TOKEN_RE.lastIndex = index;
|
|
283
|
+
const match = ANSI_TOKEN_RE.exec(s);
|
|
284
|
+
if (match) {
|
|
285
|
+
tokens.push({ value: match[0], ansi: true });
|
|
286
|
+
index = ANSI_TOKEN_RE.lastIndex;
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
const nextEsc = s.indexOf('\x1b', index + 1);
|
|
290
|
+
const end = nextEsc === -1 ? s.length : nextEsc;
|
|
291
|
+
tokens.push({ value: s.slice(index, end), ansi: false });
|
|
292
|
+
index = end;
|
|
293
|
+
}
|
|
294
|
+
return tokens;
|
|
295
|
+
}
|
|
296
|
+
function extractTrailingAnsi(s) {
|
|
297
|
+
// deno-lint-ignore no-control-regex
|
|
298
|
+
const match = s.match(/(\u001B\[[0-?]*[ -/]*[@-~])$/);
|
|
299
|
+
return match ? match[1] : '';
|
|
300
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type Color } from './layout/types';
|
|
2
|
+
import { type Component } from './surface';
|
|
3
|
+
export declare const text: (value: string) => Component;
|
|
4
|
+
export interface FlexItem {
|
|
5
|
+
readonly flex: number;
|
|
6
|
+
readonly component: Component;
|
|
7
|
+
}
|
|
8
|
+
export declare const flex: (component: Component, weight?: number) => FlexItem;
|
|
9
|
+
export declare const column: (children: (Component | FlexItem)[]) => Component;
|
|
10
|
+
export declare const row: (children: (Component | FlexItem)[]) => Component;
|
|
11
|
+
export interface BoxOptions {
|
|
12
|
+
border?: boolean;
|
|
13
|
+
background?: Color;
|
|
14
|
+
backgroundOpacity?: number;
|
|
15
|
+
padding?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const box: (child: Component, opts?: BoxOptions) => Component;
|
|
18
|
+
export interface OverlayOptions {
|
|
19
|
+
width?: number;
|
|
20
|
+
opacity?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare const overlay: (background: Component, panel: Component, opts?: OverlayOptions) => Component;
|
|
23
|
+
export interface ModalOptions {
|
|
24
|
+
title?: string;
|
|
25
|
+
width?: number;
|
|
26
|
+
opacity?: number;
|
|
27
|
+
border?: boolean;
|
|
28
|
+
background?: Color;
|
|
29
|
+
}
|
|
30
|
+
export type ToastKind = 'info' | 'success' | 'error';
|
|
31
|
+
export interface ToastOptions {
|
|
32
|
+
kind?: ToastKind;
|
|
33
|
+
}
|
|
34
|
+
export declare const toast: (message: string, opts?: ToastOptions) => Component;
|
|
35
|
+
export declare const modal: (content: Component, opts?: ModalOptions) => Component;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.modal = exports.toast = exports.overlay = exports.box = exports.row = exports.column = exports.flex = exports.text = void 0;
|
|
4
|
+
const types_1 = require("./layout/types");
|
|
5
|
+
const surface_1 = require("./surface");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
const text = (value) => ({
|
|
8
|
+
render: (s) => {
|
|
9
|
+
const lines = (0, utils_1.wrapText)(value, s.width);
|
|
10
|
+
for (let i = 0; i < lines.length && i < s.height; i++)
|
|
11
|
+
s.text(0, i, lines[i]);
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
exports.text = text;
|
|
15
|
+
const flex = (component, weight = 1) => ({ flex: weight, component });
|
|
16
|
+
exports.flex = flex;
|
|
17
|
+
const isFlex = (item) => 'flex' in item;
|
|
18
|
+
const distributeFlex = (children, sizes, remaining) => {
|
|
19
|
+
const totalFlex = children.reduce((sum, item) => (isFlex(item) ? sum + item.flex : sum), 0);
|
|
20
|
+
if (totalFlex === 0)
|
|
21
|
+
return;
|
|
22
|
+
const flexIndices = children.flatMap((item, i) => (isFlex(item) ? [i] : []));
|
|
23
|
+
let used = 0;
|
|
24
|
+
flexIndices.forEach((index, k) => {
|
|
25
|
+
const item = children[index];
|
|
26
|
+
const last = k === flexIndices.length - 1;
|
|
27
|
+
sizes[index] = Math.max(0, last ? remaining - used : Math.floor((remaining * item.flex) / totalFlex));
|
|
28
|
+
used += sizes[index];
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
const column = (children) => ({
|
|
32
|
+
render: (s) => {
|
|
33
|
+
const sizes = children.map((item) => (isFlex(item) ? -1 : s.measure(item, s.width)));
|
|
34
|
+
const usedAuto = sizes.reduce((sum, h) => (h >= 0 ? sum + h : sum), 0);
|
|
35
|
+
distributeFlex(children, sizes, Math.max(0, s.height - usedAuto));
|
|
36
|
+
let y = 0;
|
|
37
|
+
for (let i = 0; i < children.length; i++) {
|
|
38
|
+
const item = children[i];
|
|
39
|
+
const component = isFlex(item) ? item.component : item;
|
|
40
|
+
if (sizes[i] > 0)
|
|
41
|
+
s.child(component, { x: 0, y, width: s.width, height: sizes[i] });
|
|
42
|
+
y += sizes[i];
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
exports.column = column;
|
|
47
|
+
const row = (children) => ({
|
|
48
|
+
render: (s) => {
|
|
49
|
+
const sizes = children.map((item) => (isFlex(item) ? -1 : (0, surface_1.measureWidth)(item, s.width)));
|
|
50
|
+
const usedAuto = sizes.reduce((sum, w) => (w >= 0 ? sum + w : sum), 0);
|
|
51
|
+
distributeFlex(children, sizes, Math.max(0, s.width - usedAuto));
|
|
52
|
+
let x = 0;
|
|
53
|
+
for (let i = 0; i < children.length; i++) {
|
|
54
|
+
const item = children[i];
|
|
55
|
+
const component = isFlex(item) ? item.component : item;
|
|
56
|
+
if (sizes[i] > 0)
|
|
57
|
+
s.child(component, { x, y: 0, width: sizes[i], height: s.height });
|
|
58
|
+
x += sizes[i];
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
exports.row = row;
|
|
63
|
+
const drawBorder = (s, height) => {
|
|
64
|
+
const w = s.width;
|
|
65
|
+
if (w < 2 || height < 2)
|
|
66
|
+
return;
|
|
67
|
+
const c = types_1.DEFAULT_BORDER_CHARS;
|
|
68
|
+
s.text(0, 0, c.topLeft + c.horizontal.repeat(w - 2) + c.topRight);
|
|
69
|
+
for (let y = 1; y < height - 1; y++) {
|
|
70
|
+
s.text(0, y, c.vertical);
|
|
71
|
+
s.text(w - 1, y, c.vertical);
|
|
72
|
+
}
|
|
73
|
+
s.text(0, height - 1, c.bottomLeft + c.horizontal.repeat(w - 2) + c.bottomRight);
|
|
74
|
+
};
|
|
75
|
+
const box = (child, opts = {}) => ({
|
|
76
|
+
render: (s) => {
|
|
77
|
+
const inset = (opts.border ? 1 : 0) + (opts.padding ?? 0);
|
|
78
|
+
const innerW = Math.max(0, s.width - 2 * inset);
|
|
79
|
+
const contentH = s.measure(child, innerW);
|
|
80
|
+
const selfH = Math.min(contentH + 2 * inset, s.height);
|
|
81
|
+
if (opts.background) {
|
|
82
|
+
s.fill({ x: 0, y: 0, width: s.width, height: selfH }, opts.background, opts.backgroundOpacity);
|
|
83
|
+
}
|
|
84
|
+
if (opts.border)
|
|
85
|
+
drawBorder(s, selfH);
|
|
86
|
+
const innerH = Math.max(0, selfH - 2 * inset);
|
|
87
|
+
if (innerW > 0 && innerH > 0)
|
|
88
|
+
s.child(child, { x: inset, y: inset, width: innerW, height: innerH });
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
exports.box = box;
|
|
92
|
+
const overlay = (background, panel, opts = {}) => ({
|
|
93
|
+
render: (s) => {
|
|
94
|
+
s.child(background, { x: 0, y: 0, width: s.width, height: s.height });
|
|
95
|
+
s.fill({ x: 0, y: 0, width: s.width, height: s.height }, '#000000', opts.opacity ?? 0.6);
|
|
96
|
+
const w = Math.min(opts.width ?? 60, s.width);
|
|
97
|
+
const h = Math.min(s.measure(panel, w), s.height);
|
|
98
|
+
const x = Math.max(0, Math.floor((s.width - w) / 2));
|
|
99
|
+
const y = Math.max(0, Math.floor((s.height - h) / 2));
|
|
100
|
+
s.child(panel, { x, y, width: w, height: h });
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
exports.overlay = overlay;
|
|
104
|
+
const TOAST_BACKGROUND = {
|
|
105
|
+
info: '#1e3a5f',
|
|
106
|
+
success: '#1e4620',
|
|
107
|
+
error: '#5f1e1e',
|
|
108
|
+
};
|
|
109
|
+
const toast = (message, opts = {}) => (0, exports.box)((0, exports.text)(message), { border: true, background: TOAST_BACKGROUND[opts.kind ?? 'info'], padding: 0 });
|
|
110
|
+
exports.toast = toast;
|
|
111
|
+
const modal = (content, opts = {}) => ({
|
|
112
|
+
render: (s) => {
|
|
113
|
+
s.fill({ x: 0, y: 0, width: s.width, height: s.height }, '#000000', opts.opacity ?? 0.6);
|
|
114
|
+
const inner = opts.title ? (0, exports.column)([(0, exports.text)(opts.title), content]) : content;
|
|
115
|
+
const panel = (0, exports.box)(inner, { border: opts.border ?? true, background: opts.background ?? '#1c1c1c' });
|
|
116
|
+
const w = Math.min(opts.width ?? 60, Math.max(0, s.width - 2));
|
|
117
|
+
const h = Math.min(s.measure(panel, w), Math.max(0, s.height - 2));
|
|
118
|
+
const x = Math.max(0, Math.floor((s.width - w) / 2));
|
|
119
|
+
const y = Math.max(0, Math.floor((s.height - h) / 2));
|
|
120
|
+
s.child(panel, { x, y, width: w, height: h });
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
exports.modal = modal;
|