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,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// https://github.com/tc39/proposal-accessible-object-hasownproperty/blob/main/polyfill.js
|
|
4
|
+
if (!Object.hasOwn) {
|
|
5
|
+
Object.defineProperty(Object, "hasOwn", {
|
|
6
|
+
value: function (object, property) {
|
|
7
|
+
if (object == null) {
|
|
8
|
+
throw new TypeError("Cannot convert undefined or null to object");
|
|
9
|
+
}
|
|
10
|
+
return Object.prototype.hasOwnProperty.call(Object(object), property);
|
|
11
|
+
},
|
|
12
|
+
configurable: true,
|
|
13
|
+
enumerable: false,
|
|
14
|
+
writable: true,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadAgents = exports.parseAgent = exports.createAgentRegistry = void 0;
|
|
4
|
+
var registry_js_1 = require("./registry.js");
|
|
5
|
+
Object.defineProperty(exports, "createAgentRegistry", { enumerable: true, get: function () { return registry_js_1.createAgentRegistry; } });
|
|
6
|
+
var parser_js_1 = require("./parser.js");
|
|
7
|
+
Object.defineProperty(exports, "parseAgent", { enumerable: true, get: function () { return parser_js_1.parseAgent; } });
|
|
8
|
+
var loader_js_1 = require("./loader.js");
|
|
9
|
+
Object.defineProperty(exports, "loadAgents", { enumerable: true, get: function () { return loader_js_1.loadAgents; } });
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadAgents = void 0;
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const parser_js_1 = require("./parser.js");
|
|
7
|
+
const loadAgents = async (dir) => {
|
|
8
|
+
let entries;
|
|
9
|
+
try {
|
|
10
|
+
entries = await (0, promises_1.readdir)(dir);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
const files = entries.filter((name) => name.endsWith('.md')).sort();
|
|
16
|
+
const agents = [];
|
|
17
|
+
for (const file of files) {
|
|
18
|
+
try {
|
|
19
|
+
const source = await (0, promises_1.readFile)((0, node_path_1.join)(dir, file), 'utf-8');
|
|
20
|
+
agents.push((0, parser_js_1.parseAgent)(source, (0, node_path_1.basename)(file, '.md')));
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return agents;
|
|
27
|
+
};
|
|
28
|
+
exports.loadAgents = loadAgents;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseAgent = void 0;
|
|
4
|
+
const index_js_1 = require("../common/index.js");
|
|
5
|
+
const parseToolList = (raw) => {
|
|
6
|
+
if (Array.isArray(raw)) {
|
|
7
|
+
return raw.filter((entry) => typeof entry === 'string').map((entry) => entry.trim()).filter(Boolean);
|
|
8
|
+
}
|
|
9
|
+
if (typeof raw === 'string')
|
|
10
|
+
return raw.split(',').map((part) => part.trim()).filter(Boolean);
|
|
11
|
+
return undefined;
|
|
12
|
+
};
|
|
13
|
+
const parseAgent = (source, fallbackName) => {
|
|
14
|
+
const { fields, body } = (0, index_js_1.parseFrontmatter)(source);
|
|
15
|
+
return {
|
|
16
|
+
name: (0, index_js_1.str)(fields.name) ?? fallbackName,
|
|
17
|
+
description: (0, index_js_1.str)(fields.description) ?? '',
|
|
18
|
+
prompt: body,
|
|
19
|
+
tools: parseToolList(fields.tools),
|
|
20
|
+
model: (0, index_js_1.str)(fields.model),
|
|
21
|
+
extends: (0, index_js_1.str)(fields.extends),
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
exports.parseAgent = parseAgent;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAgentRegistry = void 0;
|
|
4
|
+
const merge = (base, child) => ({
|
|
5
|
+
name: child.name,
|
|
6
|
+
description: child.description || base.description,
|
|
7
|
+
prompt: child.prompt || base.prompt,
|
|
8
|
+
tools: child.tools ?? base.tools,
|
|
9
|
+
model: child.model ?? base.model,
|
|
10
|
+
});
|
|
11
|
+
const createAgentRegistry = (agents = []) => {
|
|
12
|
+
const raw = new Map();
|
|
13
|
+
for (const agent of agents)
|
|
14
|
+
if (!raw.has(agent.name))
|
|
15
|
+
raw.set(agent.name, agent);
|
|
16
|
+
const resolve = (name, seen) => {
|
|
17
|
+
const agent = raw.get(name);
|
|
18
|
+
if (!agent.extends)
|
|
19
|
+
return agent;
|
|
20
|
+
if (seen.has(name))
|
|
21
|
+
throw new Error(`AgentRegistry: "extends" cycle at "${name}"`);
|
|
22
|
+
const base = raw.get(agent.extends);
|
|
23
|
+
if (!base)
|
|
24
|
+
throw new Error(`AgentRegistry: "${name}" extends unknown agent "${agent.extends}"`);
|
|
25
|
+
return merge(resolve(agent.extends, new Set(seen).add(name)), agent);
|
|
26
|
+
};
|
|
27
|
+
const byName = new Map();
|
|
28
|
+
for (const name of raw.keys())
|
|
29
|
+
byName.set(name, resolve(name, new Set()));
|
|
30
|
+
return {
|
|
31
|
+
list: () => [...byName.values()],
|
|
32
|
+
get: (name) => byName.get(name),
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
exports.createAgentRegistry = createAgentRegistry;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createChannel = void 0;
|
|
4
|
+
const index_js_1 = require("../common/index.js");
|
|
5
|
+
const createChannel = (config) => {
|
|
6
|
+
let session;
|
|
7
|
+
const emitter = (0, index_js_1.createEmitter)();
|
|
8
|
+
const ensure = () => {
|
|
9
|
+
if (!session) {
|
|
10
|
+
session = config.createSession();
|
|
11
|
+
session.subscribe(emitter.emit);
|
|
12
|
+
}
|
|
13
|
+
return session;
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
id: config.id,
|
|
17
|
+
title: config.title,
|
|
18
|
+
get started() {
|
|
19
|
+
return session !== undefined;
|
|
20
|
+
},
|
|
21
|
+
get messages() {
|
|
22
|
+
return session?.messages ?? [];
|
|
23
|
+
},
|
|
24
|
+
send: (input) => ensure().send(input),
|
|
25
|
+
abort: () => session?.abort(),
|
|
26
|
+
subscribe: emitter.subscribe,
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
exports.createChannel = createChannel;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createChannelManager = exports.createChannel = void 0;
|
|
4
|
+
var channel_js_1 = require("./channel.js");
|
|
5
|
+
Object.defineProperty(exports, "createChannel", { enumerable: true, get: function () { return channel_js_1.createChannel; } });
|
|
6
|
+
var manager_js_1 = require("./manager.js");
|
|
7
|
+
Object.defineProperty(exports, "createChannelManager", { enumerable: true, get: function () { return manager_js_1.createChannelManager; } });
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createChannelManager = void 0;
|
|
4
|
+
const index_js_1 = require("../common/index.js");
|
|
5
|
+
const channel_js_1 = require("./channel.js");
|
|
6
|
+
const createChannelManager = (config) => {
|
|
7
|
+
const channels = new Map();
|
|
8
|
+
const unsubs = new Map();
|
|
9
|
+
const emitter = (0, index_js_1.createEmitter)();
|
|
10
|
+
const idGen = config.idGen ?? (() => crypto.randomUUID());
|
|
11
|
+
return {
|
|
12
|
+
open(opts) {
|
|
13
|
+
const id = opts?.id ?? idGen();
|
|
14
|
+
const title = opts?.title ?? id;
|
|
15
|
+
const channel = (0, channel_js_1.createChannel)({ id, title, createSession: config.createSession });
|
|
16
|
+
channels.set(id, channel);
|
|
17
|
+
unsubs.set(id, channel.subscribe((event) => emitter.emit({ channelId: id, ...event })));
|
|
18
|
+
emitter.emit({ channelId: id, type: 'channel_open', title });
|
|
19
|
+
return channel;
|
|
20
|
+
},
|
|
21
|
+
get: (id) => channels.get(id),
|
|
22
|
+
list: () => [...channels.values()],
|
|
23
|
+
close(id) {
|
|
24
|
+
unsubs.get(id)?.();
|
|
25
|
+
unsubs.delete(id);
|
|
26
|
+
if (channels.delete(id))
|
|
27
|
+
emitter.emit({ channelId: id, type: 'channel_close' });
|
|
28
|
+
},
|
|
29
|
+
subscribe: emitter.subscribe,
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
exports.createChannelManager = createChannelManager;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ContentPart, Message } from 'mu-core';
|
|
2
|
+
import type { AgentSessionEvent } from '../session/index.js';
|
|
3
|
+
export type ChannelEvent = AgentSessionEvent | {
|
|
4
|
+
type: 'channel_open';
|
|
5
|
+
title: string;
|
|
6
|
+
} | {
|
|
7
|
+
type: 'channel_close';
|
|
8
|
+
};
|
|
9
|
+
export type ChannelManagerEvent = {
|
|
10
|
+
channelId: string;
|
|
11
|
+
} & ChannelEvent;
|
|
12
|
+
export interface Channel {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly title: string;
|
|
15
|
+
readonly started: boolean;
|
|
16
|
+
readonly messages: readonly Message[];
|
|
17
|
+
send(input: string | ContentPart[]): Promise<void>;
|
|
18
|
+
abort(): void;
|
|
19
|
+
subscribe(listener: (event: AgentSessionEvent) => void): () => void;
|
|
20
|
+
}
|
|
21
|
+
export interface ChannelManager {
|
|
22
|
+
open(opts?: {
|
|
23
|
+
id?: string;
|
|
24
|
+
title?: string;
|
|
25
|
+
}): Channel;
|
|
26
|
+
get(id: string): Channel | undefined;
|
|
27
|
+
list(): Channel[];
|
|
28
|
+
close(id: string): void;
|
|
29
|
+
subscribe(listener: (event: ChannelManagerEvent) => void): () => void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AgentRegistry } from '../agents/index.js';
|
|
2
|
+
import type { SessionManager } from '../session/index.js';
|
|
3
|
+
import type { SkillRegistry } from '../skills/index.js';
|
|
4
|
+
import type { Command } from './types.js';
|
|
5
|
+
export declare const createAgentsCommand: (agents: AgentRegistry) => Command;
|
|
6
|
+
export declare const createSkillsCommand: (skills: SkillRegistry) => Command;
|
|
7
|
+
export declare const createSessionsCommand: (sessions: SessionManager) => Command;
|
|
8
|
+
export declare const createQuitCommand: (onQuit: () => void | Promise<void>) => Command;
|
|
9
|
+
export declare const createHelpCommand: (list: () => Command[]) => Command;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createHelpCommand = exports.createQuitCommand = exports.createSessionsCommand = exports.createSkillsCommand = exports.createAgentsCommand = void 0;
|
|
4
|
+
const createAgentsCommand = (agents) => ({
|
|
5
|
+
name: 'agents',
|
|
6
|
+
description: 'List available agents',
|
|
7
|
+
run: () => {
|
|
8
|
+
const list = agents.list();
|
|
9
|
+
if (list.length === 0)
|
|
10
|
+
return { ok: true, output: 'No agents configured.' };
|
|
11
|
+
const lines = list.map((a) => `- ${a.name}${a.description ? ` — ${a.description}` : ''}`);
|
|
12
|
+
return { ok: true, output: lines.join('\n') };
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
exports.createAgentsCommand = createAgentsCommand;
|
|
16
|
+
const createSkillsCommand = (skills) => ({
|
|
17
|
+
name: 'skills',
|
|
18
|
+
description: 'List available skills',
|
|
19
|
+
run: () => {
|
|
20
|
+
const list = skills.list();
|
|
21
|
+
if (list.length === 0)
|
|
22
|
+
return { ok: true, output: 'No skills configured.' };
|
|
23
|
+
const lines = list.map((s) => `- ${s.name}${s.description ? ` — ${s.description}` : ''}`);
|
|
24
|
+
return { ok: true, output: lines.join('\n') };
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
exports.createSkillsCommand = createSkillsCommand;
|
|
28
|
+
const createSessionsCommand = (sessions) => ({
|
|
29
|
+
name: 'sessions',
|
|
30
|
+
description: 'List saved sessions',
|
|
31
|
+
run: async () => {
|
|
32
|
+
const list = await sessions.list();
|
|
33
|
+
if (list.length === 0)
|
|
34
|
+
return { ok: true, output: 'No sessions yet.' };
|
|
35
|
+
const lines = list.map((s) => `- ${s.title || s.id}`);
|
|
36
|
+
return { ok: true, output: lines.join('\n') };
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
exports.createSessionsCommand = createSessionsCommand;
|
|
40
|
+
const createQuitCommand = (onQuit) => ({
|
|
41
|
+
name: 'quit',
|
|
42
|
+
description: 'Exit the session',
|
|
43
|
+
aliases: ['q'],
|
|
44
|
+
run: async () => {
|
|
45
|
+
await onQuit();
|
|
46
|
+
return { ok: true };
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
exports.createQuitCommand = createQuitCommand;
|
|
50
|
+
const createHelpCommand = (list) => ({
|
|
51
|
+
name: 'help',
|
|
52
|
+
description: 'Show available commands',
|
|
53
|
+
run: () => {
|
|
54
|
+
const commands = list();
|
|
55
|
+
if (commands.length === 0)
|
|
56
|
+
return { ok: true, output: 'No commands registered.' };
|
|
57
|
+
const lines = commands.map((c) => `/${c.name} — ${c.description}`);
|
|
58
|
+
return { ok: true, output: lines.join('\n') };
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
exports.createHelpCommand = createHelpCommand;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { createAgentsCommand, createHelpCommand, createQuitCommand, createSessionsCommand, createSkillsCommand, } from './defaults.js';
|
|
2
|
+
export { createCommandRegistry } from './registry.js';
|
|
3
|
+
export type { Command, CommandContext, CommandRegistry, CommandResult } from './types.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createCommandRegistry = exports.createSkillsCommand = exports.createSessionsCommand = exports.createQuitCommand = exports.createHelpCommand = exports.createAgentsCommand = void 0;
|
|
4
|
+
var defaults_js_1 = require("./defaults.js");
|
|
5
|
+
Object.defineProperty(exports, "createAgentsCommand", { enumerable: true, get: function () { return defaults_js_1.createAgentsCommand; } });
|
|
6
|
+
Object.defineProperty(exports, "createHelpCommand", { enumerable: true, get: function () { return defaults_js_1.createHelpCommand; } });
|
|
7
|
+
Object.defineProperty(exports, "createQuitCommand", { enumerable: true, get: function () { return defaults_js_1.createQuitCommand; } });
|
|
8
|
+
Object.defineProperty(exports, "createSessionsCommand", { enumerable: true, get: function () { return defaults_js_1.createSessionsCommand; } });
|
|
9
|
+
Object.defineProperty(exports, "createSkillsCommand", { enumerable: true, get: function () { return defaults_js_1.createSkillsCommand; } });
|
|
10
|
+
var registry_js_1 = require("./registry.js");
|
|
11
|
+
Object.defineProperty(exports, "createCommandRegistry", { enumerable: true, get: function () { return registry_js_1.createCommandRegistry; } });
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createCommandRegistry = void 0;
|
|
4
|
+
const createCommandRegistry = (commands = []) => {
|
|
5
|
+
const byName = new Map();
|
|
6
|
+
const aliasToName = new Map();
|
|
7
|
+
const resolve = (name) => byName.get(aliasToName.get(name) ?? name);
|
|
8
|
+
const register = (command, options = {}) => {
|
|
9
|
+
const taken = byName.has(command.name) || aliasToName.has(command.name);
|
|
10
|
+
if (taken && !options.override)
|
|
11
|
+
throw new Error(`Command "${command.name}" is already registered`);
|
|
12
|
+
const existing = byName.get(command.name);
|
|
13
|
+
if (existing) {
|
|
14
|
+
for (const alias of existing.aliases ?? [])
|
|
15
|
+
aliasToName.delete(alias);
|
|
16
|
+
}
|
|
17
|
+
byName.set(command.name, command);
|
|
18
|
+
for (const alias of command.aliases ?? []) {
|
|
19
|
+
if ((byName.has(alias) || aliasToName.has(alias)) && !options.override) {
|
|
20
|
+
throw new Error(`Command alias "${alias}" collides with an existing name or alias`);
|
|
21
|
+
}
|
|
22
|
+
aliasToName.set(alias, command.name);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
for (const command of commands)
|
|
26
|
+
register(command);
|
|
27
|
+
const parse = (input) => {
|
|
28
|
+
const trimmed = input.trimStart();
|
|
29
|
+
if (!trimmed.startsWith('/'))
|
|
30
|
+
return undefined;
|
|
31
|
+
const body = trimmed.slice(1);
|
|
32
|
+
const firstSpace = body.search(/\s/);
|
|
33
|
+
const name = firstSpace === -1 ? body : body.slice(0, firstSpace);
|
|
34
|
+
const args = firstSpace === -1 ? '' : body.slice(firstSpace + 1).trim();
|
|
35
|
+
const command = resolve(name);
|
|
36
|
+
return command ? { command, args } : undefined;
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
register,
|
|
40
|
+
unregister: (name) => {
|
|
41
|
+
const command = byName.get(name);
|
|
42
|
+
if (!command)
|
|
43
|
+
return;
|
|
44
|
+
byName.delete(name);
|
|
45
|
+
for (const alias of command.aliases ?? [])
|
|
46
|
+
aliasToName.delete(alias);
|
|
47
|
+
},
|
|
48
|
+
list: () => [...byName.values()],
|
|
49
|
+
get: resolve,
|
|
50
|
+
run: async (input, ctx = {}) => {
|
|
51
|
+
const parsed = parse(input);
|
|
52
|
+
if (!parsed)
|
|
53
|
+
return { ok: false, error: `Unknown command: "${input}"` };
|
|
54
|
+
try {
|
|
55
|
+
return await parsed.command.run(parsed.args, ctx);
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
return { ok: false, error: err instanceof Error ? err.message : String(err) };
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
exports.createCommandRegistry = createCommandRegistry;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface CommandResult {
|
|
2
|
+
ok: boolean;
|
|
3
|
+
output?: unknown;
|
|
4
|
+
error?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CommandContext {
|
|
7
|
+
sessionId?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Command {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
aliases?: string[];
|
|
13
|
+
run: (args: string, ctx: CommandContext) => CommandResult | Promise<CommandResult>;
|
|
14
|
+
}
|
|
15
|
+
export interface CommandRegistry {
|
|
16
|
+
register(command: Command, options?: {
|
|
17
|
+
override?: boolean;
|
|
18
|
+
}): void;
|
|
19
|
+
unregister(name: string): void;
|
|
20
|
+
list(): Command[];
|
|
21
|
+
get(name: string): Command | undefined;
|
|
22
|
+
run(input: string, ctx?: CommandContext): Promise<CommandResult>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.str = exports.parseFrontmatter = void 0;
|
|
4
|
+
const mod_js_1 = require("../deps/jsr.io/@std/yaml/1.1.0/mod.js");
|
|
5
|
+
const FRONTMATTER = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/;
|
|
6
|
+
const parseFrontmatter = (source) => {
|
|
7
|
+
const match = source.match(FRONTMATTER);
|
|
8
|
+
let fields = {};
|
|
9
|
+
if (match) {
|
|
10
|
+
try {
|
|
11
|
+
const parsed = (0, mod_js_1.parse)(match[1]);
|
|
12
|
+
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed))
|
|
13
|
+
fields = parsed;
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
fields = {};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return { fields, body: (match ? match[2] : source).trim() };
|
|
20
|
+
};
|
|
21
|
+
exports.parseFrontmatter = parseFrontmatter;
|
|
22
|
+
const str = (value) => (typeof value === 'string' ? value : undefined);
|
|
23
|
+
exports.str = str;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.str = exports.parseFrontmatter = exports.createEmitter = void 0;
|
|
4
|
+
var utils_js_1 = require("./utils.js");
|
|
5
|
+
Object.defineProperty(exports, "createEmitter", { enumerable: true, get: function () { return utils_js_1.createEmitter; } });
|
|
6
|
+
var frontmatter_js_1 = require("./frontmatter.js");
|
|
7
|
+
Object.defineProperty(exports, "parseFrontmatter", { enumerable: true, get: function () { return frontmatter_js_1.parseFrontmatter; } });
|
|
8
|
+
Object.defineProperty(exports, "str", { enumerable: true, get: function () { return frontmatter_js_1.str; } });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createEmitter = void 0;
|
|
4
|
+
const createEmitter = () => {
|
|
5
|
+
const listeners = new Set();
|
|
6
|
+
return {
|
|
7
|
+
emit: (event) => {
|
|
8
|
+
for (const listener of listeners)
|
|
9
|
+
listener(event);
|
|
10
|
+
},
|
|
11
|
+
subscribe: (listener) => {
|
|
12
|
+
listeners.add(listener);
|
|
13
|
+
return () => listeners.delete(listener);
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
exports.createEmitter = createEmitter;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createHarnessConfig = void 0;
|
|
4
|
+
var resolve_js_1 = require("./resolve.js");
|
|
5
|
+
Object.defineProperty(exports, "createHarnessConfig", { enumerable: true, get: function () { return resolve_js_1.createHarnessConfig; } });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createHarnessConfig = void 0;
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
|
+
const createHarnessConfig = (options) => {
|
|
6
|
+
const { hostName, xdg } = options;
|
|
7
|
+
return {
|
|
8
|
+
hostName,
|
|
9
|
+
configDir: (0, node_path_1.join)(xdg.configHome, hostName),
|
|
10
|
+
dataDir: (0, node_path_1.join)(xdg.dataHome, hostName),
|
|
11
|
+
stateDir: (0, node_path_1.join)(xdg.stateHome, hostName),
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
exports.createHarnessConfig = createHarnessConfig;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface XdgDirs {
|
|
2
|
+
configHome: string;
|
|
3
|
+
dataHome: string;
|
|
4
|
+
stateHome: string;
|
|
5
|
+
}
|
|
6
|
+
export interface HarnessConfigOptions {
|
|
7
|
+
hostName: string;
|
|
8
|
+
xdg: XdgDirs;
|
|
9
|
+
}
|
|
10
|
+
export interface HarnessConfig {
|
|
11
|
+
hostName: string;
|
|
12
|
+
configDir: string;
|
|
13
|
+
dataDir: string;
|
|
14
|
+
stateDir: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const BOM = 65279;
|
|
2
|
+
export declare const TAB = 9;
|
|
3
|
+
export declare const LINE_FEED = 10;
|
|
4
|
+
export declare const CARRIAGE_RETURN = 13;
|
|
5
|
+
export declare const SPACE = 32;
|
|
6
|
+
export declare const EXCLAMATION = 33;
|
|
7
|
+
export declare const DOUBLE_QUOTE = 34;
|
|
8
|
+
export declare const SHARP = 35;
|
|
9
|
+
export declare const PERCENT = 37;
|
|
10
|
+
export declare const AMPERSAND = 38;
|
|
11
|
+
export declare const SINGLE_QUOTE = 39;
|
|
12
|
+
export declare const ASTERISK = 42;
|
|
13
|
+
export declare const PLUS = 43;
|
|
14
|
+
export declare const COMMA = 44;
|
|
15
|
+
export declare const MINUS = 45;
|
|
16
|
+
export declare const DOT = 46;
|
|
17
|
+
export declare const COLON = 58;
|
|
18
|
+
export declare const SMALLER_THAN = 60;
|
|
19
|
+
export declare const GREATER_THAN = 62;
|
|
20
|
+
export declare const QUESTION = 63;
|
|
21
|
+
export declare const COMMERCIAL_AT = 64;
|
|
22
|
+
export declare const LEFT_SQUARE_BRACKET = 91;
|
|
23
|
+
export declare const BACKSLASH = 92;
|
|
24
|
+
export declare const RIGHT_SQUARE_BRACKET = 93;
|
|
25
|
+
export declare const GRAVE_ACCENT = 96;
|
|
26
|
+
export declare const LEFT_CURLY_BRACKET = 123;
|
|
27
|
+
export declare const VERTICAL_LINE = 124;
|
|
28
|
+
export declare const RIGHT_CURLY_BRACKET = 125;
|
|
29
|
+
export declare function isEOL(c: number): boolean;
|
|
30
|
+
export declare function isWhiteSpace(c: number): boolean;
|
|
31
|
+
export declare function isWhiteSpaceOrEOL(c: number): boolean;
|
|
32
|
+
export declare function isFlowIndicator(c: number): boolean;
|