The TS profile-id grammar lived in electron/profile-id-guard.ts, so renderer code imported an Electron module for a regex, and the Bot creation dialog plus the dashboard ProfilesPage and ProfileBuilderPage still carried private copies. apps/shared/src/profile-id.ts now holds the one literal (PROFILE_ID_ARG_RE), exposed as the narrow @hermes/shared/profile-id subpath. Electron gates import it relatively (esbuild bundles electron/ without tsconfig paths); the renderer and the dashboard import the subpath; plugins get it through a one-line @hermes/plugin-sdk utility re-export, since the plugin fence allows only the SDK. profile-id-guard.ts keeps backendProfileArg and re-exports the regex. Per-caller trimming, case-folding, default/reserved names and the bot slugifier are unchanged. Guards swap the shared owner and prove every gate follows it, including the Bot dialog (owner-driven rejection on a reachable slug), ProfilesPage and ProfileBuilderPage, and backendProfileArg. Refs #155595
56 lines
2.0 KiB
JSON
56 lines
2.0 KiB
JSON
{
|
|
"name": "@hermes/shared",
|
|
"private": true,
|
|
"engines": {
|
|
"npm": "npm is refused here: run pnpm install --frozen-lockfile at the repository root"
|
|
},
|
|
"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",
|
|
"./circular-buffer": "./src/circular-buffer.ts",
|
|
"./color": "./src/color.ts",
|
|
"./format": "./src/format.ts",
|
|
"./fuzzy": "./src/fuzzy.ts",
|
|
"./gateway-canonical": "./src/gateway-canonical.ts",
|
|
"./gateway-client": "./src/node/gateway-client.ts",
|
|
"./gateway-events": "./src/gateway-events.ts",
|
|
"./gateway-text": "./src/gateway-text.ts",
|
|
"./gateway-types": "./src/gateway-types.ts",
|
|
"./i18n": "./src/i18n.ts",
|
|
"./interpolation": "./src/interpolation.ts",
|
|
"./json-rpc-channel": "./src/json-rpc-channel.ts",
|
|
"./model-search-text": "./src/model-search-text.ts",
|
|
"./plan-usage": "./src/plan-usage.ts",
|
|
"./profile-id": "./src/profile-id.ts",
|
|
"./prompt-history": "./src/node/prompt-history.ts",
|
|
"./provider-names": "./src/provider-names.ts",
|
|
"./reasoning-effort": "./src/reasoning-effort.ts",
|
|
"./reconnect-backoff": "./src/reconnect-backoff.ts",
|
|
"./skin": "./src/skin.ts",
|
|
"./slash": "./src/slash.ts",
|
|
"./slash-input": "./src/slash-input.ts",
|
|
"./slash-score": "./src/slash-score.ts",
|
|
"./theme-presets": "./src/theme-presets.ts",
|
|
"./usage-tick": "./src/usage-tick.ts"
|
|
},
|
|
"types": "./src/index.ts",
|
|
"scripts": {
|
|
"lint": "eslint src/",
|
|
"lint:fix": "eslint src/ --fix",
|
|
"fix": "pnpm run lint:fix",
|
|
"typecheck": "tsc -p . --noEmit && tsc -p tsconfig.node.json --noEmit",
|
|
"check": "pnpm run typecheck && pnpm run test && pnpm run lint",
|
|
"test": "vitest run"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "22.20.5",
|
|
"typescript": "6.0.3",
|
|
"vitest": "4.1.12"
|
|
}
|
|
}
|