rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Dynesshely/dsh-plugin-portara
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
See the gateway route behind every reply — channel, account, upstream model, failover history — as a collapsible row in the DeepSeek Harness chat stream.
When a model route is a Portara gateway, the reply you read was chosen by a load balancer: a channel, an upstream account, maybe a retry after someone else's quota ran out. Normally that context is invisible from inside the conversation. This bundle puts it where the answer is.
⚡ Switched to OpenDesign / ACP-003 (attempt 2) · deepseek-v4.1-flash ▸
One row per conversation Turn, rendered at the opening of that Turn's assistant content — after the prompt and the completion header, above the process rows — at the same level as a tool-call card. It stays outside the process fold, so folding a turn's work never hides the route. No failover means a one-line summary; a failover expands into the attempts that produced the answer.
The routed model is also still appended to the end of each turn's status row: `⚡
And /portara route prints the same facts once, on demand, without spending a model call — falling back to
the session's last recorded route when the gateway's 15-minute live cache has already expired.
Attempt 1 · CommandCode / ACP-002 · quota cooldown · HTTP 429 · 00:22:31
Attempt 2 · OpenDesign / ACP-003 · failover succeeded · 00:22:39
The bundle has two halves that share one package and one profile row — no kernel file is modified.
| Half | Seam | What it does |
|---|---|---|
| Host | llm-pi-ai/request-headers |
stamps the harness session id as x-portara-client-session, so the gateway partitions the request and the later query under the same session key |
| Host | llm/stream |
after each conversation call (successful or failed) queries GET <baseURL>/route-info, optionally polling while the call is still streaming |
| Host | appendPluginRecord() |
writes a plugin:portara/route record — an ignorable, log-only event that older readers retain and skip, stamped with the Turn's prompt sequence so the card placement never depends on the browser's loaded history window |
| Client | uiConversation.events.register() |
one Chat row per Turn, keyed by the gateway session and the Turn number; later records of that Turn update it instead of stacking |
| Client | conversation.chat.node slot |
the collapsible row, localized in English and Chinese, styled with host theme tokens |
| Client | conversation.chat.assistant-actions slot |
appends the routed model to the turn status row via one flex item ordered after the host-owned clock |
| Host | /portara command |
route prints the session's current route and refreshes the card; the handler answers the UI directly, so no model call is spent |
Session.append() cannot mark an event ignorable, and an unknown
non-ignorable event makes the session unreadable on the next load. The plugin writes only plugin:
records through appendPluginRecord() and resolves the Host's own Session module instance first, because
a second copy of that module cannot brand the Host's Session.The reasoning behind these choices, including the rejected alternatives, is in docs/DESIGN.md.
Requires DeepSeek Harness 0.2.x with the llm-pi-ai adapter and a gateway that can answer
/v1/route-info.
git clone https://github.com/Dynesshely/dsh-plugin-portara.git
dsh plugin install ./dsh-plugin-portara
Or from the Web UI: Plugin manager → install a local bundle. A new bundle can activate through the
loader's hot reload; the browser half loads on the next page load. No dsh restart is required.
See Releases for tagged versions and CHANGELOG.md for what changed.
The gateway hides upstream topology by default. Turn disclosure on where you accept that exposure:
exposeRoutingInfo: true
exposeRoutingDetail: channel # off | alias | channel
With disclosure off, the endpoint answers with an empty structure and this plugin writes nothing — no card, no error, and no polling while a reply streams.
Every key is optional; the defaults work as-is.
- insert:
- id: portara-route
name: dsh-plugin-portara
config:
enabled: true # false disables observation entirely
timeoutMs: 1500 # route-info budget, clamped to 100…10000
pollIntervalMs: 2000 # in-flight failover polling; 0 disables
injectSessionHeader: true # only confirmed gateway endpoints receive the session header
gateways: # optional explicit gateways (skips discovery)
- baseURL: https://portara.example/v1
apiKeyEnv: GATEWAY_API_KEY
Gateway discovery reads the live model-provider configuration: every provider that declares a baseURL and
an apiKeyEnv is probed once, and an endpoint that answers as a route.info data plane is treated as a
gateway. Credentials resolve through the Host credential service, falling back to the process environment.
⚡ Routed to … row appears next to the reply; with a failover it is collapsible.⚡ <channel> / <account> · <full model id>./portara route — the command prints channel, account, upstream model, and the failover history;
in an old conversation it reports the last recorded route and says so.plugin:portara/route event with ignorable: true.Issues and pull requests are welcome — open an issue first for anything larger than a typo, so the approach can be agreed before code.
git clone https://github.com/Dynesshely/dsh-plugin-portara.git
cd dsh-plugin-portara
npm test # node:test — payload, gateway client, provider discovery, client rendering, Host integration
npm run check # node --check on every shipped source file
window.__ModuleLoader__.load() bundle that takes React from the page's module table.Session, a local
HTTP gateway, and a temporary profile whose node_modules links the installed
@deepseek-ai/dsh-session, so the record path is exercised without a running Harness. It skips itself
when that package is unavailable.Portara is an aggregated, enterprise-grade AI API gateway: one endpoint in front of many providers and accounts, with routing, quota, billing, and audit behind it. This plugin consumes its routing disclosure data-plane API. Its icon is Portara's own brand mark — the marble gate on Naxos that gave the gateway its name.
Two channels carry the facts:
| Channel | Where | Use |
|---|---|---|
| Response headers | every /v1/* response |
the route of one request, at zero extra cost |
| Query endpoint | GET /v1/route-info |
the session's current route plus its failover history |
Session keys are resolved in this order — the same value must be used by the request and the query:
x-portara-client-sessionx-deepseek-harness-session-idprompt_cache_key{
"object": "route.info",
"sessionKey": "8ff4d582",
"updatedAt": "2026-11-11T16:22:39.250Z",
"route": {
"alias": "balance/deepseek-flash",
"channel": "OpenDesign",
"account": "ACP-003",
"upstreamModel": "deepseek-v4.1-flash"
},
"history": [
{
"attempt": 1,
"channel": "CommandCode",
"account": "ACP-002",
"outcome": "quota_cooldown",
"statusCode": 429,
"reason": "…",
"at": "2026-11-11T16:22:31.000Z"
}
]
}
The plugin never talks to Portara's management API, never stores route history, and never sends the API key outside the Host process.
dsh-plugin-portara/
├── index.js # Host entry: apply, inject, name
├── client.js # browser half: Conversation Definition, Chat row, locale copy
├── cordis.patch.yml # the bundle's one profile row
├── package.json # dsh.bundle + dsh.client manifest
├── icon.svg # Plugin Manager artwork: Portara's gate mark
├── locale/
│ ├── en.json # plugin-manager title and description
│ └── zh.json
├── src/
│ ├── payload.js # durable payload normalization and dedupe signature
│ └── host/
│ ├── index.js # listener wiring, polling, dedupe, /portara registration
│ ├── command.js # /portara verb grammar and plain-text route formatting
│ ├── gateway.js # timeout-bounded, silent /route-info client
│ ├── provider.js # provider discovery, credential resolution, header decision
│ └── records.js # Host Session module resolution and plugin-record append
├── test/
│ ├── payload.test.js
│ ├── gateway.test.js
│ ├── provider.test.js
│ ├── client.test.js
│ ├── host.test.js # real Session + local HTTP gateway
│ └── manifest.test.js # package, patch, locale, icon, README checks
├── docs/
│ └── DESIGN.md
├── CHANGELOG.md # release notes by version
└── assets/
├── banner.svg # source of the banner
└── banner.png # rendered banner used above
MIT © 2026 Dynesshely
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: llm-gateway、deepseek-harness。