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,327 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseLine = parseLine;
|
|
4
|
+
exports.cellsToAnsi = cellsToAnsi;
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const cell_1 = require("./cell");
|
|
7
|
+
const color_1 = require("./color");
|
|
8
|
+
function parseLine(line) {
|
|
9
|
+
const cells = [];
|
|
10
|
+
let style = (0, cell_1.defaultStyle)();
|
|
11
|
+
let i = 0;
|
|
12
|
+
const n = line.length;
|
|
13
|
+
while (i < n) {
|
|
14
|
+
const code = line.codePointAt(i);
|
|
15
|
+
if (code === undefined) {
|
|
16
|
+
i++;
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
if (code === 0x1b) {
|
|
20
|
+
i = consumeEscape(line, i + 1, (newStyle) => {
|
|
21
|
+
style = newStyle;
|
|
22
|
+
}, style);
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
const w = (0, utils_1.charWidth)(code);
|
|
26
|
+
const step = code > 0xffff ? 2 : 1;
|
|
27
|
+
const grapheme = line.slice(i, i + step);
|
|
28
|
+
i += step;
|
|
29
|
+
if (w === 0) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
cells.push({ grapheme, width: w, style: cloneStyle(style) });
|
|
33
|
+
if (w === 2)
|
|
34
|
+
cells.push((0, cell_1.continuationCell)());
|
|
35
|
+
}
|
|
36
|
+
return cells;
|
|
37
|
+
}
|
|
38
|
+
function cellsToAnsi(cells) {
|
|
39
|
+
let out = '';
|
|
40
|
+
let prev = null;
|
|
41
|
+
let prevLink;
|
|
42
|
+
let needsReset = false;
|
|
43
|
+
for (const cell of cells) {
|
|
44
|
+
if (cell.width === 0)
|
|
45
|
+
continue;
|
|
46
|
+
if (!prev || !(0, cell_1.styleEqual)(prev, cell.style)) {
|
|
47
|
+
const delta = sgrDelta(prev, cell.style);
|
|
48
|
+
if (delta.length > 0) {
|
|
49
|
+
out += delta;
|
|
50
|
+
needsReset = true;
|
|
51
|
+
}
|
|
52
|
+
prev = cell.style;
|
|
53
|
+
}
|
|
54
|
+
if (cell.style.link !== prevLink) {
|
|
55
|
+
out += linkEscape(cell.style.link);
|
|
56
|
+
prevLink = cell.style.link;
|
|
57
|
+
if (cell.style.link)
|
|
58
|
+
needsReset = true;
|
|
59
|
+
}
|
|
60
|
+
out += cell.grapheme || ' ';
|
|
61
|
+
}
|
|
62
|
+
if (needsReset)
|
|
63
|
+
out += '\x1b[0m';
|
|
64
|
+
if (prevLink)
|
|
65
|
+
out += '\x1b]8;;\x07';
|
|
66
|
+
return out;
|
|
67
|
+
}
|
|
68
|
+
function consumeEscape(input, index, setStyle, currentStyle) {
|
|
69
|
+
if (index >= input.length)
|
|
70
|
+
return index;
|
|
71
|
+
const next = input.charCodeAt(index);
|
|
72
|
+
if (next === 0x5b) {
|
|
73
|
+
let j = index + 1;
|
|
74
|
+
while (j < input.length) {
|
|
75
|
+
const c = input.charCodeAt(j);
|
|
76
|
+
if (c >= 0x40 && c <= 0x7e) {
|
|
77
|
+
const params = input.slice(index + 1, j);
|
|
78
|
+
if (c === 0x6d) {
|
|
79
|
+
setStyle(applySgr(currentStyle, params));
|
|
80
|
+
}
|
|
81
|
+
return j + 1;
|
|
82
|
+
}
|
|
83
|
+
j++;
|
|
84
|
+
}
|
|
85
|
+
return input.length;
|
|
86
|
+
}
|
|
87
|
+
if (next === 0x5d) {
|
|
88
|
+
let j = index + 1;
|
|
89
|
+
while (j < input.length) {
|
|
90
|
+
const c = input.charCodeAt(j);
|
|
91
|
+
if (c === 0x07) {
|
|
92
|
+
const payload = input.slice(index + 1, j);
|
|
93
|
+
applyOsc(payload, setStyle, currentStyle);
|
|
94
|
+
return j + 1;
|
|
95
|
+
}
|
|
96
|
+
if (c === 0x1b && j + 1 < input.length && input.charCodeAt(j + 1) === 0x5c) {
|
|
97
|
+
const payload = input.slice(index + 1, j);
|
|
98
|
+
applyOsc(payload, setStyle, currentStyle);
|
|
99
|
+
return j + 2;
|
|
100
|
+
}
|
|
101
|
+
j++;
|
|
102
|
+
}
|
|
103
|
+
return input.length;
|
|
104
|
+
}
|
|
105
|
+
if (next === 0x50 || next === 0x5e || next === 0x5f || next === 0x58) {
|
|
106
|
+
let j = index + 1;
|
|
107
|
+
while (j < input.length - 1) {
|
|
108
|
+
if (input.charCodeAt(j) === 0x1b && input.charCodeAt(j + 1) === 0x5c) {
|
|
109
|
+
return j + 2;
|
|
110
|
+
}
|
|
111
|
+
j++;
|
|
112
|
+
}
|
|
113
|
+
return input.length;
|
|
114
|
+
}
|
|
115
|
+
return index + 1;
|
|
116
|
+
}
|
|
117
|
+
function applyOsc(payload, setStyle, current) {
|
|
118
|
+
if (payload.startsWith('8;')) {
|
|
119
|
+
const semi = payload.indexOf(';', 2);
|
|
120
|
+
const url = semi === -1 ? '' : payload.slice(semi + 1);
|
|
121
|
+
const next = { ...current, link: url.length > 0 ? url : undefined };
|
|
122
|
+
setStyle(next);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function applySgr(current, params) {
|
|
126
|
+
const next = cloneStyle(current);
|
|
127
|
+
if (params.length === 0)
|
|
128
|
+
return resetStyle(next);
|
|
129
|
+
const parts = params.split(';');
|
|
130
|
+
let i = 0;
|
|
131
|
+
while (i < parts.length) {
|
|
132
|
+
const n = parts[i] === '' ? 0 : Number.parseInt(parts[i], 10);
|
|
133
|
+
if (Number.isNaN(n)) {
|
|
134
|
+
i++;
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
switch (n) {
|
|
138
|
+
case 0:
|
|
139
|
+
resetStyle(next);
|
|
140
|
+
break;
|
|
141
|
+
case 1:
|
|
142
|
+
next.bold = true;
|
|
143
|
+
break;
|
|
144
|
+
case 2:
|
|
145
|
+
next.dim = true;
|
|
146
|
+
break;
|
|
147
|
+
case 3:
|
|
148
|
+
next.italic = true;
|
|
149
|
+
break;
|
|
150
|
+
case 4:
|
|
151
|
+
next.underline = true;
|
|
152
|
+
break;
|
|
153
|
+
case 5:
|
|
154
|
+
case 6:
|
|
155
|
+
next.blink = true;
|
|
156
|
+
break;
|
|
157
|
+
case 7:
|
|
158
|
+
next.reverse = true;
|
|
159
|
+
break;
|
|
160
|
+
case 9:
|
|
161
|
+
next.strikethrough = true;
|
|
162
|
+
break;
|
|
163
|
+
case 22:
|
|
164
|
+
next.bold = false;
|
|
165
|
+
next.dim = false;
|
|
166
|
+
break;
|
|
167
|
+
case 23:
|
|
168
|
+
next.italic = false;
|
|
169
|
+
break;
|
|
170
|
+
case 24:
|
|
171
|
+
next.underline = false;
|
|
172
|
+
break;
|
|
173
|
+
case 25:
|
|
174
|
+
next.blink = false;
|
|
175
|
+
break;
|
|
176
|
+
case 27:
|
|
177
|
+
next.reverse = false;
|
|
178
|
+
break;
|
|
179
|
+
case 29:
|
|
180
|
+
next.strikethrough = false;
|
|
181
|
+
break;
|
|
182
|
+
case 38: {
|
|
183
|
+
const consumed = parseExtendedColor(parts, i + 1, (rgba) => {
|
|
184
|
+
next.fg = rgba;
|
|
185
|
+
});
|
|
186
|
+
i += consumed;
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
case 48: {
|
|
190
|
+
const consumed = parseExtendedColor(parts, i + 1, (rgba) => {
|
|
191
|
+
next.bg = rgba;
|
|
192
|
+
});
|
|
193
|
+
i += consumed;
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
case 39:
|
|
197
|
+
next.fg = { ...color_1.DEFAULT_FG };
|
|
198
|
+
break;
|
|
199
|
+
case 49:
|
|
200
|
+
next.bg = { ...color_1.DEFAULT_BG };
|
|
201
|
+
break;
|
|
202
|
+
default:
|
|
203
|
+
if (n >= 30 && n <= 37)
|
|
204
|
+
next.fg = indexed(n - 30);
|
|
205
|
+
else if (n >= 40 && n <= 47)
|
|
206
|
+
next.bg = indexed(n - 40);
|
|
207
|
+
else if (n >= 90 && n <= 97)
|
|
208
|
+
next.fg = indexed(n - 90 + 8);
|
|
209
|
+
else if (n >= 100 && n <= 107)
|
|
210
|
+
next.bg = indexed(n - 100 + 8);
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
i++;
|
|
214
|
+
}
|
|
215
|
+
return next;
|
|
216
|
+
}
|
|
217
|
+
function parseExtendedColor(parts, from, set) {
|
|
218
|
+
const mode = parts[from] === undefined ? -1 : Number.parseInt(parts[from], 10);
|
|
219
|
+
if (mode === 5) {
|
|
220
|
+
const idx = Number.parseInt(parts[from + 1] ?? '0', 10);
|
|
221
|
+
set((0, color_1.indexedColor)(Number.isNaN(idx) ? 0 : idx));
|
|
222
|
+
return 2;
|
|
223
|
+
}
|
|
224
|
+
if (mode === 2) {
|
|
225
|
+
const r = Number.parseInt(parts[from + 1] ?? '0', 10);
|
|
226
|
+
const g = Number.parseInt(parts[from + 2] ?? '0', 10);
|
|
227
|
+
const b = Number.parseInt(parts[from + 3] ?? '0', 10);
|
|
228
|
+
set((0, color_1.rgbColor)(clamp255(r), clamp255(g), clamp255(b)));
|
|
229
|
+
return 4;
|
|
230
|
+
}
|
|
231
|
+
return 0;
|
|
232
|
+
}
|
|
233
|
+
function indexed(index) {
|
|
234
|
+
const [r, g, b] = (0, color_1.palette256)(index);
|
|
235
|
+
return { r, g, b, a: 1, intent: 'indexed', index };
|
|
236
|
+
}
|
|
237
|
+
function clamp255(n) {
|
|
238
|
+
if (Number.isNaN(n))
|
|
239
|
+
return 0;
|
|
240
|
+
return Math.max(0, Math.min(255, n));
|
|
241
|
+
}
|
|
242
|
+
function resetStyle(style) {
|
|
243
|
+
style.fg = { ...color_1.DEFAULT_FG };
|
|
244
|
+
style.bg = { ...color_1.DEFAULT_BG };
|
|
245
|
+
style.bold = false;
|
|
246
|
+
style.dim = false;
|
|
247
|
+
style.italic = false;
|
|
248
|
+
style.underline = false;
|
|
249
|
+
style.strikethrough = false;
|
|
250
|
+
style.reverse = false;
|
|
251
|
+
style.blink = false;
|
|
252
|
+
style.link = undefined;
|
|
253
|
+
return style;
|
|
254
|
+
}
|
|
255
|
+
function cloneStyle(style) {
|
|
256
|
+
return {
|
|
257
|
+
fg: { ...style.fg },
|
|
258
|
+
bg: { ...style.bg },
|
|
259
|
+
bold: style.bold,
|
|
260
|
+
dim: style.dim,
|
|
261
|
+
italic: style.italic,
|
|
262
|
+
underline: style.underline,
|
|
263
|
+
strikethrough: style.strikethrough,
|
|
264
|
+
reverse: style.reverse,
|
|
265
|
+
blink: style.blink,
|
|
266
|
+
link: style.link,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
function sgrDelta(prev, next) {
|
|
270
|
+
const params = [];
|
|
271
|
+
if (!prev) {
|
|
272
|
+
if (next.bold)
|
|
273
|
+
params.push('1');
|
|
274
|
+
if (next.dim)
|
|
275
|
+
params.push('2');
|
|
276
|
+
if (next.italic)
|
|
277
|
+
params.push('3');
|
|
278
|
+
if (next.underline)
|
|
279
|
+
params.push('4');
|
|
280
|
+
if (next.blink)
|
|
281
|
+
params.push('5');
|
|
282
|
+
if (next.reverse)
|
|
283
|
+
params.push('7');
|
|
284
|
+
if (next.strikethrough)
|
|
285
|
+
params.push('9');
|
|
286
|
+
if (next.fg.intent !== 'default')
|
|
287
|
+
params.push((0, color_1.rgbaToSgr)(next.fg, 'fg'));
|
|
288
|
+
if (next.bg.intent !== 'default' && next.bg.a > 0)
|
|
289
|
+
params.push((0, color_1.rgbaToSgr)(next.bg, 'bg'));
|
|
290
|
+
if (params.length === 0)
|
|
291
|
+
return '';
|
|
292
|
+
return `\x1b[${params.join(';')}m`;
|
|
293
|
+
}
|
|
294
|
+
if (prev.bold !== next.bold || prev.dim !== next.dim) {
|
|
295
|
+
if (!next.bold && !next.dim && (prev.bold || prev.dim))
|
|
296
|
+
params.push('22');
|
|
297
|
+
if (next.bold && !prev.bold)
|
|
298
|
+
params.push('1');
|
|
299
|
+
if (next.dim && !prev.dim)
|
|
300
|
+
params.push('2');
|
|
301
|
+
}
|
|
302
|
+
if (prev.italic !== next.italic)
|
|
303
|
+
params.push(next.italic ? '3' : '23');
|
|
304
|
+
if (prev.underline !== next.underline)
|
|
305
|
+
params.push(next.underline ? '4' : '24');
|
|
306
|
+
if (prev.blink !== next.blink)
|
|
307
|
+
params.push(next.blink ? '5' : '25');
|
|
308
|
+
if (prev.reverse !== next.reverse)
|
|
309
|
+
params.push(next.reverse ? '7' : '27');
|
|
310
|
+
if (prev.strikethrough !== next.strikethrough)
|
|
311
|
+
params.push(next.strikethrough ? '9' : '29');
|
|
312
|
+
if (!rgbaShallowEqual(prev.fg, next.fg))
|
|
313
|
+
params.push((0, color_1.rgbaToSgr)(next.fg, 'fg'));
|
|
314
|
+
if (!rgbaShallowEqual(prev.bg, next.bg))
|
|
315
|
+
params.push((0, color_1.rgbaToSgr)(next.bg, 'bg'));
|
|
316
|
+
if (params.length === 0)
|
|
317
|
+
return '';
|
|
318
|
+
return `\x1b[${params.join(';')}m`;
|
|
319
|
+
}
|
|
320
|
+
function rgbaShallowEqual(a, b) {
|
|
321
|
+
return (a.r === b.r && a.g === b.g && a.b === b.b && a.a === b.a && a.intent === b.intent && a.index === b.index);
|
|
322
|
+
}
|
|
323
|
+
function linkEscape(link) {
|
|
324
|
+
if (!link)
|
|
325
|
+
return '\x1b]8;;\x07';
|
|
326
|
+
return `\x1b]8;;${link}\x07`;
|
|
327
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Rgba } from './color';
|
|
2
|
+
export interface CellStyle {
|
|
3
|
+
fg: Rgba;
|
|
4
|
+
bg: Rgba;
|
|
5
|
+
bold: boolean;
|
|
6
|
+
dim: boolean;
|
|
7
|
+
italic: boolean;
|
|
8
|
+
underline: boolean;
|
|
9
|
+
strikethrough: boolean;
|
|
10
|
+
reverse: boolean;
|
|
11
|
+
blink: boolean;
|
|
12
|
+
link?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface Cell {
|
|
15
|
+
grapheme: string;
|
|
16
|
+
width: 0 | 1 | 2;
|
|
17
|
+
style: CellStyle;
|
|
18
|
+
}
|
|
19
|
+
export declare const DEFAULT_STYLE: CellStyle;
|
|
20
|
+
export declare function defaultStyle(): CellStyle;
|
|
21
|
+
export declare function emptyCell(): Cell;
|
|
22
|
+
export declare function continuationCell(): Cell;
|
|
23
|
+
export declare function styleEqual(a: CellStyle, b: CellStyle): boolean;
|
|
24
|
+
export declare function cellEqual(a: Cell, b: Cell): boolean;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_STYLE = void 0;
|
|
4
|
+
exports.defaultStyle = defaultStyle;
|
|
5
|
+
exports.emptyCell = emptyCell;
|
|
6
|
+
exports.continuationCell = continuationCell;
|
|
7
|
+
exports.styleEqual = styleEqual;
|
|
8
|
+
exports.cellEqual = cellEqual;
|
|
9
|
+
const color_1 = require("./color");
|
|
10
|
+
exports.DEFAULT_STYLE = {
|
|
11
|
+
fg: color_1.DEFAULT_FG,
|
|
12
|
+
bg: color_1.DEFAULT_BG,
|
|
13
|
+
bold: false,
|
|
14
|
+
dim: false,
|
|
15
|
+
italic: false,
|
|
16
|
+
underline: false,
|
|
17
|
+
strikethrough: false,
|
|
18
|
+
reverse: false,
|
|
19
|
+
blink: false,
|
|
20
|
+
};
|
|
21
|
+
function defaultStyle() {
|
|
22
|
+
return {
|
|
23
|
+
fg: color_1.DEFAULT_FG,
|
|
24
|
+
bg: color_1.DEFAULT_BG,
|
|
25
|
+
bold: false,
|
|
26
|
+
dim: false,
|
|
27
|
+
italic: false,
|
|
28
|
+
underline: false,
|
|
29
|
+
strikethrough: false,
|
|
30
|
+
reverse: false,
|
|
31
|
+
blink: false,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function emptyCell() {
|
|
35
|
+
return { grapheme: ' ', width: 1, style: defaultStyle() };
|
|
36
|
+
}
|
|
37
|
+
function continuationCell() {
|
|
38
|
+
return { grapheme: '', width: 0, style: defaultStyle() };
|
|
39
|
+
}
|
|
40
|
+
function styleEqual(a, b) {
|
|
41
|
+
return (a.bold === b.bold &&
|
|
42
|
+
a.dim === b.dim &&
|
|
43
|
+
a.italic === b.italic &&
|
|
44
|
+
a.underline === b.underline &&
|
|
45
|
+
a.strikethrough === b.strikethrough &&
|
|
46
|
+
a.reverse === b.reverse &&
|
|
47
|
+
a.blink === b.blink &&
|
|
48
|
+
a.link === b.link &&
|
|
49
|
+
(0, color_1.rgbaEqual)(a.fg, b.fg) &&
|
|
50
|
+
(0, color_1.rgbaEqual)(a.bg, b.bg));
|
|
51
|
+
}
|
|
52
|
+
function cellEqual(a, b) {
|
|
53
|
+
return a.grapheme === b.grapheme && a.width === b.width && styleEqual(a.style, b.style);
|
|
54
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type Cell } from './cell';
|
|
2
|
+
import { type Rgba } from './color';
|
|
3
|
+
import type { BorderStyle, Rect } from './types';
|
|
4
|
+
export interface CellBuffer {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
cells: Cell[];
|
|
8
|
+
backdropColor: Rgba;
|
|
9
|
+
opacityStack: number[];
|
|
10
|
+
}
|
|
11
|
+
export declare function createCellBuffer(width: number, height: number, backdropColor?: Rgba): CellBuffer;
|
|
12
|
+
export declare function setBackdropColor(buf: CellBuffer, color: Rgba): void;
|
|
13
|
+
export declare function pushOpacity(buf: CellBuffer, opacity: number): void;
|
|
14
|
+
export declare function popOpacity(buf: CellBuffer): void;
|
|
15
|
+
export declare function effectiveOpacity(buf: CellBuffer): number;
|
|
16
|
+
export declare function getCell(buf: CellBuffer, x: number, y: number): Cell;
|
|
17
|
+
export declare function compositeCell(buf: CellBuffer, x: number, y: number, incoming: Cell, opacity?: number): void;
|
|
18
|
+
export declare function fillBackground(buf: CellBuffer, rect: Rect, color: Rgba, clip: Rect): void;
|
|
19
|
+
export declare function writeCells(buf: CellBuffer, x: number, y: number, cells: Cell[], clip: Rect): void;
|
|
20
|
+
export declare function drawBorderCells(buf: CellBuffer, rect: Rect, style: BorderStyle | true, clip: Rect): void;
|
|
21
|
+
export declare function cellBufferToLines(buf: CellBuffer): string[];
|
|
22
|
+
export declare function bufferUsedHeight(buf: CellBuffer): number;
|
|
23
|
+
export interface DiffRun {
|
|
24
|
+
y: number;
|
|
25
|
+
x: number;
|
|
26
|
+
cells: Cell[];
|
|
27
|
+
clear?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare function diffBuffer(prev: CellBuffer, next: CellBuffer, maxRow: number, mergeGap?: number): DiffRun[];
|