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,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSubAgentTool = exports.runSubAgent = exports.createSubAgentRegistry = void 0;
|
|
4
|
+
var registry_js_1 = require("./registry.js");
|
|
5
|
+
Object.defineProperty(exports, "createSubAgentRegistry", { enumerable: true, get: function () { return registry_js_1.createSubAgentRegistry; } });
|
|
6
|
+
var runner_js_1 = require("./runner.js");
|
|
7
|
+
Object.defineProperty(exports, "runSubAgent", { enumerable: true, get: function () { return runner_js_1.runSubAgent; } });
|
|
8
|
+
var tool_js_1 = require("./tool.js");
|
|
9
|
+
Object.defineProperty(exports, "createSubAgentTool", { enumerable: true, get: function () { return tool_js_1.createSubAgentTool; } });
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSubAgentRegistry = void 0;
|
|
4
|
+
const createSubAgentRegistry = () => {
|
|
5
|
+
const runs = new Map();
|
|
6
|
+
const listeners = new Set();
|
|
7
|
+
return {
|
|
8
|
+
register: (run) => {
|
|
9
|
+
runs.set(run.runId, run);
|
|
10
|
+
for (const listener of listeners)
|
|
11
|
+
listener(run);
|
|
12
|
+
},
|
|
13
|
+
get: (runId) => runs.get(runId),
|
|
14
|
+
list: () => [...runs.values()],
|
|
15
|
+
byParent: (parentId) => [...runs.values()].filter((run) => run.parentId === parentId),
|
|
16
|
+
subscribe: (listener) => {
|
|
17
|
+
listeners.add(listener);
|
|
18
|
+
return () => listeners.delete(listener);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
exports.createSubAgentRegistry = createSubAgentRegistry;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Agent } from '../agents/index.js';
|
|
2
|
+
import type { AgentSession } from '../session/index.js';
|
|
3
|
+
import type { SubAgentRegistry, SubAgentResult } from './types.js';
|
|
4
|
+
export interface RunSubAgentDeps {
|
|
5
|
+
spawn(agent: Agent): AgentSession;
|
|
6
|
+
/** When provided, the spawned run is registered (so hosts can read/observe it). */
|
|
7
|
+
runs?: SubAgentRegistry;
|
|
8
|
+
/** Parent session id the run is attributed to. */
|
|
9
|
+
parentId?: string;
|
|
10
|
+
/** Run id; defaults to the spawned session's id so persistence keys align. */
|
|
11
|
+
runId?: string;
|
|
12
|
+
/** Aborts the spawned session when the parent turn is cancelled. */
|
|
13
|
+
signal?: AbortSignal;
|
|
14
|
+
}
|
|
15
|
+
export declare const runSubAgent: (agent: Agent, task: string, deps: RunSubAgentDeps) => Promise<SubAgentResult>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runSubAgent = void 0;
|
|
4
|
+
const finalText = (session) => {
|
|
5
|
+
for (let i = session.messages.length - 1; i >= 0; i--) {
|
|
6
|
+
const message = session.messages[i];
|
|
7
|
+
if (message.role === 'assistant') {
|
|
8
|
+
return message.content.map((part) => (part.type === 'text' ? part.text : '')).join('');
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return '';
|
|
12
|
+
};
|
|
13
|
+
const runSubAgent = async (agent, task, deps) => {
|
|
14
|
+
const session = deps.spawn(agent);
|
|
15
|
+
deps.runs?.register({ runId: deps.runId ?? session.id, agent: agent.name, parentId: deps.parentId, session });
|
|
16
|
+
const { signal } = deps;
|
|
17
|
+
if (signal?.aborted)
|
|
18
|
+
session.abort();
|
|
19
|
+
const onAbort = () => session.abort();
|
|
20
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
21
|
+
let failure;
|
|
22
|
+
const unsubscribe = session.subscribe((event) => {
|
|
23
|
+
if (event.type === 'error')
|
|
24
|
+
failure = event.error;
|
|
25
|
+
});
|
|
26
|
+
try {
|
|
27
|
+
await session.send(task);
|
|
28
|
+
}
|
|
29
|
+
finally {
|
|
30
|
+
unsubscribe();
|
|
31
|
+
signal?.removeEventListener('abort', onAbort);
|
|
32
|
+
}
|
|
33
|
+
if (failure !== undefined)
|
|
34
|
+
throw failure instanceof Error ? failure : new Error(String(failure));
|
|
35
|
+
return { agent: agent.name, text: finalText(session) };
|
|
36
|
+
};
|
|
37
|
+
exports.runSubAgent = runSubAgent;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSubAgentTool = void 0;
|
|
4
|
+
const runner_js_1 = require("./runner.js");
|
|
5
|
+
const createSubAgentTool = (deps) => ({
|
|
6
|
+
name: 'subagent',
|
|
7
|
+
description: 'Delegate an isolated task to a named sub-agent. Returns its final answer.',
|
|
8
|
+
prompt: 'Delegate self-contained research or sub-tasks to a named sub-agent with `subagent`; treat its answer as research input.',
|
|
9
|
+
parameters: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
agent: { type: 'string', description: 'Sub-agent name.' },
|
|
13
|
+
task: { type: 'string', description: 'The task to delegate.' },
|
|
14
|
+
},
|
|
15
|
+
required: ['agent', 'task'],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
run: async (input, ctx) => {
|
|
19
|
+
const { agent, task } = (input ?? {});
|
|
20
|
+
if (!agent || !task)
|
|
21
|
+
return [{ type: 'text', text: 'Error: subagent requires `agent` and `task`.' }];
|
|
22
|
+
const def = deps.registry.get(agent);
|
|
23
|
+
if (!def)
|
|
24
|
+
return [{ type: 'text', text: `Error: unknown sub-agent "${agent}".` }];
|
|
25
|
+
const result = await (0, runner_js_1.runSubAgent)(def, task, {
|
|
26
|
+
spawn: deps.spawn,
|
|
27
|
+
runs: deps.runs,
|
|
28
|
+
parentId: deps.parentId,
|
|
29
|
+
signal: ctx.signal,
|
|
30
|
+
});
|
|
31
|
+
return [{ type: 'text', text: result.text }];
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
exports.createSubAgentTool = createSubAgentTool;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AgentSession } from '../session/index.js';
|
|
2
|
+
export interface SubAgentResult {
|
|
3
|
+
agent: string;
|
|
4
|
+
text: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SubAgentRun {
|
|
7
|
+
runId: string;
|
|
8
|
+
agent: string;
|
|
9
|
+
parentId?: string;
|
|
10
|
+
session: AgentSession;
|
|
11
|
+
}
|
|
12
|
+
export interface SubAgentRegistry {
|
|
13
|
+
register(run: SubAgentRun): void;
|
|
14
|
+
get(runId: string): SubAgentRun | undefined;
|
|
15
|
+
list(): SubAgentRun[];
|
|
16
|
+
byParent(parentId: string): SubAgentRun[];
|
|
17
|
+
subscribe(listener: (run: SubAgentRun) => void): () => void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createChatApp = void 0;
|
|
4
|
+
const mu_tui_1 = require("mu-tui");
|
|
5
|
+
const index_js_1 = require("./components/index.js");
|
|
6
|
+
const kit_js_1 = require("./kit.js");
|
|
7
|
+
const defaultLayout = (parts, ctx) => ctx.components.column([parts.header, (0, mu_tui_1.flex)(parts.transcript), parts.status, parts.composer]);
|
|
8
|
+
const createChatApp = (channel, opts = {}) => {
|
|
9
|
+
const slots = opts.slots ?? {};
|
|
10
|
+
const components = { ...kit_js_1.defaultKit, ...opts.components };
|
|
11
|
+
const resolveMessage = slots.message ?? index_js_1.message;
|
|
12
|
+
const ctx = {
|
|
13
|
+
channel,
|
|
14
|
+
components,
|
|
15
|
+
renderMessage: (msg) => resolveMessage(msg, ctx),
|
|
16
|
+
status: { current: 'idle' },
|
|
17
|
+
};
|
|
18
|
+
const parts = {
|
|
19
|
+
header: (slots.header ?? index_js_1.header)(ctx),
|
|
20
|
+
transcript: (slots.transcript ?? index_js_1.transcript)(ctx),
|
|
21
|
+
status: (slots.status ?? index_js_1.status)(ctx),
|
|
22
|
+
composer: (slots.composer ?? index_js_1.composer)(ctx),
|
|
23
|
+
};
|
|
24
|
+
const root = (slots.layout ?? defaultLayout)(parts, ctx);
|
|
25
|
+
const terminal = opts.terminal ?? new mu_tui_1.ProcessTerminal({ bracketedPaste: true, focusEvents: true });
|
|
26
|
+
const tui = new mu_tui_1.TUI(terminal);
|
|
27
|
+
const unsubscribe = channel.subscribe((event) => {
|
|
28
|
+
if (event.type === 'turn_start')
|
|
29
|
+
ctx.status.current = 'thinking';
|
|
30
|
+
else if (event.type === 'turn_end')
|
|
31
|
+
ctx.status.current = 'idle';
|
|
32
|
+
else if (event.type === 'error')
|
|
33
|
+
ctx.status.current = 'error';
|
|
34
|
+
tui.requestRender();
|
|
35
|
+
});
|
|
36
|
+
tui.setRoot(root);
|
|
37
|
+
tui.setFocus(parts.composer);
|
|
38
|
+
const stop = () => {
|
|
39
|
+
unsubscribe();
|
|
40
|
+
tui.stop();
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
tui,
|
|
44
|
+
start: () => {
|
|
45
|
+
tui.addGlobalKeybinding({
|
|
46
|
+
chord: { key: 'c', ctrl: true },
|
|
47
|
+
handler: () => {
|
|
48
|
+
stop();
|
|
49
|
+
opts.onExit?.();
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
tui.start();
|
|
53
|
+
},
|
|
54
|
+
stop,
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
exports.createChatApp = createChatApp;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.composer = void 0;
|
|
4
|
+
const composer = (ctx) => {
|
|
5
|
+
const input = ctx.components.editor({
|
|
6
|
+
placeholder: 'Message…',
|
|
7
|
+
onSubmit: (value) => {
|
|
8
|
+
const trimmed = value.trim();
|
|
9
|
+
if (!trimmed)
|
|
10
|
+
return;
|
|
11
|
+
input.setValue('');
|
|
12
|
+
void ctx.channel.send(trimmed);
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
return input;
|
|
16
|
+
};
|
|
17
|
+
exports.composer = composer;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transcript = exports.messagesView = exports.status = exports.partToText = exports.message = exports.formatMessage = exports.header = exports.composer = void 0;
|
|
4
|
+
var composer_js_1 = require("./composer.js");
|
|
5
|
+
Object.defineProperty(exports, "composer", { enumerable: true, get: function () { return composer_js_1.composer; } });
|
|
6
|
+
var header_js_1 = require("./header.js");
|
|
7
|
+
Object.defineProperty(exports, "header", { enumerable: true, get: function () { return header_js_1.header; } });
|
|
8
|
+
var message_js_1 = require("./message.js");
|
|
9
|
+
Object.defineProperty(exports, "formatMessage", { enumerable: true, get: function () { return message_js_1.formatMessage; } });
|
|
10
|
+
Object.defineProperty(exports, "message", { enumerable: true, get: function () { return message_js_1.message; } });
|
|
11
|
+
Object.defineProperty(exports, "partToText", { enumerable: true, get: function () { return message_js_1.partToText; } });
|
|
12
|
+
var status_js_1 = require("./status.js");
|
|
13
|
+
Object.defineProperty(exports, "status", { enumerable: true, get: function () { return status_js_1.status; } });
|
|
14
|
+
var transcript_js_1 = require("./transcript.js");
|
|
15
|
+
Object.defineProperty(exports, "messagesView", { enumerable: true, get: function () { return transcript_js_1.messagesView; } });
|
|
16
|
+
Object.defineProperty(exports, "transcript", { enumerable: true, get: function () { return transcript_js_1.transcript; } });
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ContentPart, Message } from 'mu-core';
|
|
2
|
+
import type { Component } from 'mu-tui';
|
|
3
|
+
import type { ChatContext } from '../types.js';
|
|
4
|
+
export declare const partToText: (part: ContentPart) => string;
|
|
5
|
+
export declare const formatMessage: (message: Message) => string;
|
|
6
|
+
export declare const message: (msg: Message, ctx: ChatContext) => Component;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.message = exports.formatMessage = exports.partToText = void 0;
|
|
4
|
+
const partToText = (part) => {
|
|
5
|
+
switch (part.type) {
|
|
6
|
+
case 'text':
|
|
7
|
+
return part.text;
|
|
8
|
+
case 'tool_call':
|
|
9
|
+
return `\x1b[2m[${part.name}]\x1b[0m`;
|
|
10
|
+
case 'tool_result':
|
|
11
|
+
return part.content.map(exports.partToText).join('');
|
|
12
|
+
case 'image':
|
|
13
|
+
return '\x1b[2m[image]\x1b[0m';
|
|
14
|
+
case 'audio':
|
|
15
|
+
return '\x1b[2m[audio]\x1b[0m';
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
exports.partToText = partToText;
|
|
19
|
+
const isToolResults = (message) => message.content.length > 0 && message.content.every((part) => part.type === 'tool_result');
|
|
20
|
+
const label = (message) => {
|
|
21
|
+
if (isToolResults(message))
|
|
22
|
+
return '\x1b[2mtool\x1b[0m';
|
|
23
|
+
if (message.role === 'user')
|
|
24
|
+
return '\x1b[36myou\x1b[0m';
|
|
25
|
+
if (message.role === 'assistant')
|
|
26
|
+
return '\x1b[32magent\x1b[0m';
|
|
27
|
+
return `\x1b[2m${message.role}\x1b[0m`;
|
|
28
|
+
};
|
|
29
|
+
const formatMessage = (message) => `${label(message)} ${message.content.map(exports.partToText).join('')}`;
|
|
30
|
+
exports.formatMessage = formatMessage;
|
|
31
|
+
const message = (msg, ctx) => ctx.components.text((0, exports.formatMessage)(msg));
|
|
32
|
+
exports.message = message;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.status = void 0;
|
|
4
|
+
const LABELS = {
|
|
5
|
+
idle: '\x1b[2m● ready\x1b[0m',
|
|
6
|
+
thinking: '\x1b[33m◍ thinking…\x1b[0m',
|
|
7
|
+
error: '\x1b[31m✗ error\x1b[0m',
|
|
8
|
+
};
|
|
9
|
+
const status = (ctx) => ({
|
|
10
|
+
render: (s) => ctx.components.text(LABELS[ctx.status.current]).render(s),
|
|
11
|
+
});
|
|
12
|
+
exports.status = status;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transcript = exports.messagesView = void 0;
|
|
4
|
+
const messagesView = (ctx) => ({
|
|
5
|
+
render: (s) => ctx.components.column(ctx.channel.messages.map(ctx.renderMessage)).render(s),
|
|
6
|
+
});
|
|
7
|
+
exports.messagesView = messagesView;
|
|
8
|
+
const transcript = (ctx) => ctx.components.scrollView((0, exports.messagesView)(ctx));
|
|
9
|
+
exports.transcript = transcript;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Channel } from '../channels/index.js';
|
|
2
|
+
import type { ChatApp, ChatAppOptions } from './types.js';
|
|
3
|
+
export * from './types.js';
|
|
4
|
+
export * from './kit.js';
|
|
5
|
+
export * from './components/index.js';
|
|
6
|
+
export { createChatApp } from './channel.js';
|
|
7
|
+
export declare const runChat: (channel: Channel, opts?: ChatAppOptions) => ChatApp;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.runChat = exports.createChatApp = void 0;
|
|
18
|
+
const channel_js_1 = require("./channel.js");
|
|
19
|
+
__exportStar(require("./types.js"), exports);
|
|
20
|
+
__exportStar(require("./kit.js"), exports);
|
|
21
|
+
__exportStar(require("./components/index.js"), exports);
|
|
22
|
+
var channel_js_2 = require("./channel.js");
|
|
23
|
+
Object.defineProperty(exports, "createChatApp", { enumerable: true, get: function () { return channel_js_2.createChatApp; } });
|
|
24
|
+
const runChat = (channel, opts) => {
|
|
25
|
+
const app = (0, channel_js_1.createChatApp)(channel, opts);
|
|
26
|
+
app.start();
|
|
27
|
+
return app;
|
|
28
|
+
};
|
|
29
|
+
exports.runChat = runChat;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Component, type FlexItem } from 'mu-tui';
|
|
2
|
+
export interface EditorHandle extends Component {
|
|
3
|
+
getValue(): string;
|
|
4
|
+
setValue(value: string): void;
|
|
5
|
+
}
|
|
6
|
+
export interface ComponentKit {
|
|
7
|
+
text(value: string): Component;
|
|
8
|
+
column(children: (Component | FlexItem)[]): Component;
|
|
9
|
+
scrollView(content: Component): Component;
|
|
10
|
+
editor(opts: {
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
onSubmit?: (value: string) => void;
|
|
13
|
+
}): EditorHandle;
|
|
14
|
+
}
|
|
15
|
+
export declare const defaultKit: ComponentKit;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultKit = void 0;
|
|
4
|
+
const mu_tui_1 = require("mu-tui");
|
|
5
|
+
exports.defaultKit = {
|
|
6
|
+
text: mu_tui_1.text,
|
|
7
|
+
column: mu_tui_1.column,
|
|
8
|
+
scrollView: mu_tui_1.scrollView,
|
|
9
|
+
editor: mu_tui_1.editor,
|
|
10
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Message } from 'mu-core';
|
|
2
|
+
import type { Component, Terminal, TUI } from 'mu-tui';
|
|
3
|
+
import type { Channel } from '../channels/index.js';
|
|
4
|
+
import type { ComponentKit } from './kit.js';
|
|
5
|
+
export type ChatStatus = 'idle' | 'thinking' | 'error';
|
|
6
|
+
export interface ChatContext {
|
|
7
|
+
channel: Channel;
|
|
8
|
+
components: ComponentKit;
|
|
9
|
+
renderMessage: (message: Message) => Component;
|
|
10
|
+
status: {
|
|
11
|
+
current: ChatStatus;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ChatParts {
|
|
15
|
+
header: Component;
|
|
16
|
+
transcript: Component;
|
|
17
|
+
status: Component;
|
|
18
|
+
composer: Component;
|
|
19
|
+
}
|
|
20
|
+
export interface ChatSlots {
|
|
21
|
+
message?: (message: Message, ctx: ChatContext) => Component;
|
|
22
|
+
header?: (ctx: ChatContext) => Component;
|
|
23
|
+
transcript?: (ctx: ChatContext) => Component;
|
|
24
|
+
status?: (ctx: ChatContext) => Component;
|
|
25
|
+
composer?: (ctx: ChatContext) => Component;
|
|
26
|
+
layout?: (parts: ChatParts, ctx: ChatContext) => Component;
|
|
27
|
+
}
|
|
28
|
+
export interface ChatAppOptions {
|
|
29
|
+
terminal?: Terminal;
|
|
30
|
+
components?: Partial<ComponentKit>;
|
|
31
|
+
slots?: ChatSlots;
|
|
32
|
+
onExit?: () => void;
|
|
33
|
+
}
|
|
34
|
+
export interface ChatApp {
|
|
35
|
+
readonly tui: TUI;
|
|
36
|
+
start(): void;
|
|
37
|
+
stop(): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export type CapabilitySource = 'default' | 'env' | 'terminfo' | 'probe' | 'policy' | 'feature' | 'configured' | 'disabled';
|
|
2
|
+
export interface Capability<T> {
|
|
3
|
+
value: T;
|
|
4
|
+
source: CapabilitySource;
|
|
5
|
+
}
|
|
6
|
+
export interface TerminalIdentity {
|
|
7
|
+
term: string;
|
|
8
|
+
program: string;
|
|
9
|
+
multiplexer: 'none' | 'tmux' | 'screen' | 'zellij' | 'unknown';
|
|
10
|
+
transport: 'tty' | 'pipe' | 'ssh' | 'conpty' | 'unknown';
|
|
11
|
+
platform: NodeJS.Platform;
|
|
12
|
+
}
|
|
13
|
+
export interface ScreenCapabilities {
|
|
14
|
+
alternateScreen: Capability<boolean>;
|
|
15
|
+
}
|
|
16
|
+
export interface ColorCapabilities {
|
|
17
|
+
ansi16: Capability<boolean>;
|
|
18
|
+
palette256: Capability<boolean>;
|
|
19
|
+
truecolor: Capability<boolean>;
|
|
20
|
+
}
|
|
21
|
+
export interface InputCapabilities {
|
|
22
|
+
legacy: Capability<boolean>;
|
|
23
|
+
xtermModifiedKeys: Capability<boolean>;
|
|
24
|
+
kittyKeyboard: Capability<boolean>;
|
|
25
|
+
bracketedPaste: Capability<boolean>;
|
|
26
|
+
focusEvents: Capability<boolean>;
|
|
27
|
+
}
|
|
28
|
+
export interface MouseCapabilities {
|
|
29
|
+
sgr: Capability<boolean>;
|
|
30
|
+
drag: Capability<boolean>;
|
|
31
|
+
}
|
|
32
|
+
export interface OscCapabilities {
|
|
33
|
+
title: Capability<boolean>;
|
|
34
|
+
hyperlinks: Capability<boolean>;
|
|
35
|
+
shellIntegration: Capability<boolean>;
|
|
36
|
+
}
|
|
37
|
+
export interface GraphicsCapabilities {
|
|
38
|
+
unicode: Capability<boolean>;
|
|
39
|
+
kitty: Capability<boolean>;
|
|
40
|
+
iterm2: Capability<boolean>;
|
|
41
|
+
}
|
|
42
|
+
export interface SecurityPolicy {
|
|
43
|
+
hyperlinks: 'deny' | 'allow';
|
|
44
|
+
clipboardWrite: 'deny' | 'ask' | 'allow';
|
|
45
|
+
clipboardRead: 'deny' | 'ask' | 'allow';
|
|
46
|
+
images: 'deny' | 'allow';
|
|
47
|
+
shellIntegration: 'deny' | 'allow';
|
|
48
|
+
maxPayloadBytes: number;
|
|
49
|
+
}
|
|
50
|
+
export interface Capabilities {
|
|
51
|
+
identity: TerminalIdentity;
|
|
52
|
+
screen: ScreenCapabilities;
|
|
53
|
+
colors: ColorCapabilities;
|
|
54
|
+
input: InputCapabilities;
|
|
55
|
+
mouse: MouseCapabilities;
|
|
56
|
+
osc: OscCapabilities;
|
|
57
|
+
graphics: GraphicsCapabilities;
|
|
58
|
+
security: SecurityPolicy;
|
|
59
|
+
}
|
|
60
|
+
export type PartialCapabilities = Partial<{
|
|
61
|
+
identity: Partial<TerminalIdentity>;
|
|
62
|
+
screen: Partial<ScreenCapabilities>;
|
|
63
|
+
colors: Partial<ColorCapabilities>;
|
|
64
|
+
input: Partial<InputCapabilities>;
|
|
65
|
+
mouse: Partial<MouseCapabilities>;
|
|
66
|
+
osc: Partial<OscCapabilities>;
|
|
67
|
+
graphics: Partial<GraphicsCapabilities>;
|
|
68
|
+
security: Partial<SecurityPolicy>;
|
|
69
|
+
}>;
|
|
70
|
+
export declare function capability<T>(value: T, source?: CapabilitySource): Capability<T>;
|
|
71
|
+
export declare function createDefaultCapabilities(env?: NodeJS.ProcessEnv): Capabilities;
|
|
72
|
+
export declare function mergeCapabilities(base: Capabilities, patch?: PartialCapabilities): Capabilities;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.capability = capability;
|
|
7
|
+
exports.createDefaultCapabilities = createDefaultCapabilities;
|
|
8
|
+
exports.mergeCapabilities = mergeCapabilities;
|
|
9
|
+
const node_process_1 = __importDefault(require("node:process"));
|
|
10
|
+
function capability(value, source = 'default') {
|
|
11
|
+
return { value, source };
|
|
12
|
+
}
|
|
13
|
+
function createDefaultCapabilities(env = node_process_1.default.env) {
|
|
14
|
+
const term = env.TERM ?? 'dumb';
|
|
15
|
+
const program = env.TERM_PROGRAM ?? env.TERMINAL_EMULATOR ?? (env.KITTY_WINDOW_ID ? 'kitty' : 'unknown');
|
|
16
|
+
const multiplexer = detectMultiplexer(env);
|
|
17
|
+
const transport = detectTransport(env);
|
|
18
|
+
const truecolor = env.COLORTERM === 'truecolor' || env.COLORTERM === '24bit';
|
|
19
|
+
const modernTerm = /xterm|kitty|wezterm|ghostty|alacritty|foot|tmux|screen|vte|rxvt|iterm|mintty/i.test(term);
|
|
20
|
+
return {
|
|
21
|
+
identity: {
|
|
22
|
+
term,
|
|
23
|
+
program,
|
|
24
|
+
multiplexer,
|
|
25
|
+
transport,
|
|
26
|
+
platform: node_process_1.default.platform,
|
|
27
|
+
},
|
|
28
|
+
screen: {
|
|
29
|
+
alternateScreen: capability(modernTerm, modernTerm ? 'env' : 'default'),
|
|
30
|
+
},
|
|
31
|
+
colors: {
|
|
32
|
+
ansi16: capability(term !== 'dumb'),
|
|
33
|
+
palette256: capability(term.includes('256color'), term.includes('256color') ? 'env' : 'default'),
|
|
34
|
+
truecolor: capability(truecolor, truecolor ? 'env' : 'default'),
|
|
35
|
+
},
|
|
36
|
+
input: {
|
|
37
|
+
legacy: capability(true),
|
|
38
|
+
xtermModifiedKeys: capability(modernTerm, modernTerm ? 'env' : 'default'),
|
|
39
|
+
kittyKeyboard: capability(Boolean(env.KITTY_WINDOW_ID), env.KITTY_WINDOW_ID ? 'env' : 'default'),
|
|
40
|
+
bracketedPaste: capability(modernTerm, modernTerm ? 'env' : 'default'),
|
|
41
|
+
focusEvents: capability(modernTerm, modernTerm ? 'env' : 'default'),
|
|
42
|
+
},
|
|
43
|
+
mouse: {
|
|
44
|
+
sgr: capability(modernTerm, modernTerm ? 'env' : 'default'),
|
|
45
|
+
drag: capability(modernTerm, modernTerm ? 'env' : 'default'),
|
|
46
|
+
},
|
|
47
|
+
osc: {
|
|
48
|
+
title: capability(modernTerm, modernTerm ? 'env' : 'default'),
|
|
49
|
+
hyperlinks: capability(modernTerm, modernTerm ? 'env' : 'default'),
|
|
50
|
+
shellIntegration: capability(false),
|
|
51
|
+
},
|
|
52
|
+
graphics: {
|
|
53
|
+
unicode: capability(true),
|
|
54
|
+
kitty: capability(Boolean(env.KITTY_WINDOW_ID), env.KITTY_WINDOW_ID ? 'env' : 'default'),
|
|
55
|
+
iterm2: capability(program === 'iTerm.app', program === 'iTerm.app' ? 'env' : 'default'),
|
|
56
|
+
},
|
|
57
|
+
security: {
|
|
58
|
+
hyperlinks: 'allow',
|
|
59
|
+
clipboardWrite: 'deny',
|
|
60
|
+
clipboardRead: 'deny',
|
|
61
|
+
images: 'deny',
|
|
62
|
+
shellIntegration: 'deny',
|
|
63
|
+
maxPayloadBytes: 1024 * 1024,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function mergeCapabilities(base, patch) {
|
|
68
|
+
if (!patch)
|
|
69
|
+
return base;
|
|
70
|
+
return {
|
|
71
|
+
identity: { ...base.identity, ...patch.identity },
|
|
72
|
+
screen: { ...base.screen, ...patch.screen },
|
|
73
|
+
colors: { ...base.colors, ...patch.colors },
|
|
74
|
+
input: { ...base.input, ...patch.input },
|
|
75
|
+
mouse: { ...base.mouse, ...patch.mouse },
|
|
76
|
+
osc: { ...base.osc, ...patch.osc },
|
|
77
|
+
graphics: { ...base.graphics, ...patch.graphics },
|
|
78
|
+
security: { ...base.security, ...patch.security },
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function detectMultiplexer(env) {
|
|
82
|
+
if (env.TMUX)
|
|
83
|
+
return 'tmux';
|
|
84
|
+
if (env.STY)
|
|
85
|
+
return 'screen';
|
|
86
|
+
if (env.ZELLIJ)
|
|
87
|
+
return 'zellij';
|
|
88
|
+
return 'none';
|
|
89
|
+
}
|
|
90
|
+
function detectTransport(env) {
|
|
91
|
+
if (env.SSH_TTY || env.SSH_CONNECTION)
|
|
92
|
+
return 'ssh';
|
|
93
|
+
if (env.WT_SESSION || node_process_1.default.platform === 'win32')
|
|
94
|
+
return 'conpty';
|
|
95
|
+
if (node_process_1.default.stdin.isTTY && node_process_1.default.stdout.isTTY)
|
|
96
|
+
return 'tty';
|
|
97
|
+
return 'pipe';
|
|
98
|
+
}
|