web/src/lib/slashExec.ts and web/src/components/SlashPopover.tsx had zero
importers since the React composer was replaced by the PTY-embedded TUI
(f49afd3122) — exactly what web/AGENTS.md forbids, now orphaned. Their
parseSlash still carried the `(.*)` newline bug and lacked the `prefill`
variant. Desktop and the TUI each hand-rolled the same slash split and the
same command.dispatch narrowing; the multi-line fix (#41323, #55510) had to
be applied to each copy separately.
Sites:
web/src/lib/slashExec.ts::executeSlash/parseSlash/parseCommandDispatch -> deleted
web/src/components/SlashPopover.tsx::SlashPopover -> deleted
apps/desktop/src/lib/chat-runtime.ts::parseSlashCommand -> apps/shared/src/slash.ts::parseSlashCommand
apps/desktop/src/lib/chat-runtime.ts::parseCommandDispatch -> apps/shared/src/slash.ts::parseCommandDispatch
apps/desktop/src/lib/chat-runtime.ts::SLASH_COMMAND_RE -> apps/shared/src/slash.ts::SLASH_COMMAND_RE
apps/desktop/src/app/types.ts::*CommandDispatchResponse (5 interfaces) -> apps/shared/src/slash.ts
ui-tui/src/domain/slash.ts::parseSlashCommand/looksLikeSlashCommand -> apps/shared/src/slash.ts
ui-tui/src/lib/rpc.ts::asCommandDispatch -> apps/shared/src/slash.ts::parseCommandDispatch
ui-tui/src/gatewayTypes.ts::CommandDispatchResponse -> apps/shared/src/slash.ts
9 desktop importers + 3 TUI importers repointed.
Behavior change: desktop `parseSlashCommand` now lower-cases the command
name like the TUI, backend `resolve_command` and `slash.exec` already do
(`/Help` resolved before via the case-insensitive backend; local desktop
action lookups were case-sensitive). TUI's parsed result no longer carries
the redundant `cmd` echo (no consumer read it).
Tests: apps/shared/src/slash.test.ts (parseSlashCommand multi-line /
newline-boundary / degenerate cases; parseCommandDispatch every variant +
malformed rejection). Sabotage: restoring `(.*)` in SLASH_PARTS_RE fails
2 tests; restored -> 7 pass. Desktop chat-runtime.test.ts and TUI
asCommandDispatch.test.ts cases moved here; slashParity.test.ts repointed.
36 lines
1.1 KiB
JSON
36 lines
1.1 KiB
JSON
{
|
|
"name": "@hermes/shared",
|
|
"private": true,
|
|
"version": "0.0.0",
|
|
"type": "module",
|
|
"exports": {
|
|
".": "./src/index.ts",
|
|
"./ansi": "./src/ansi.ts",
|
|
"./billing": "./src/billing-types.ts",
|
|
"./billing-policy": "./src/billing-policy.ts",
|
|
"./charge-settlement": "./src/charge-settlement.ts",
|
|
"./color": "./src/color.ts",
|
|
"./format": "./src/format.ts",
|
|
"./fuzzy": "./src/fuzzy.ts",
|
|
"./gateway-events": "./src/gateway-events.ts",
|
|
"./i18n": "./src/i18n.ts",
|
|
"./json-rpc-channel": "./src/json-rpc-channel.ts",
|
|
"./model-search-text": "./src/model-search-text.ts",
|
|
"./reasoning-effort": "./src/reasoning-effort.ts",
|
|
"./reconnect-backoff": "./src/reconnect-backoff.ts",
|
|
"./skin": "./src/skin.ts",
|
|
"./slash": "./src/slash.ts"
|
|
},
|
|
"types": "./src/index.ts",
|
|
"scripts": {
|
|
"lint": "eslint src/",
|
|
"lint:fix": "eslint src/ --fix",
|
|
"fix": "npm run lint:fix",
|
|
"typecheck": "tsc -p . --noEmit",
|
|
"check": "npm run typecheck && npm run lint"
|
|
},
|
|
"devDependencies": {
|
|
"typescript": "6.0.3"
|
|
}
|
|
}
|