dsh-task-time-cost 0.0.0-stage → 0.2.8-beta.2
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/CHANGELOG.md +29 -0
- package/COMPATIBILITY.md +26 -0
- package/CONTRIBUTING.md +11 -0
- package/LICENSE +21 -0
- package/README.en.md +60 -0
- package/README.md +59 -2
- package/THIRD_PARTY_NOTICES.md +113 -0
- package/cordis.patch.yml +4 -0
- package/data/baselines.json +12 -0
- package/data/defaults.json +21 -0
- package/data/models-dev-prices.json +1 -0
- package/data/prices.json +7 -0
- package/data/sources.json +15 -0
- package/docs/public/DETAIL.md +1 -0
- package/docs/public/DETAIL.zh.md +1 -0
- package/docs/public/acceptance.md +26 -0
- package/docs/public/guide.en.md +33 -0
- package/docs/public/guide.zh.md +35 -0
- package/docs/public/preview.svg +1 -0
- package/docs/public/privacy.md +13 -0
- package/docs/public/publishing.md +9 -0
- package/icon.svg +1 -0
- package/lib/client.js +175 -0
- package/lib/index.js +22948 -0
- package/lib/index.js.map +7 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +122 -4
- package/scripts/import-public-prices.mjs +35 -0
- package/src/client/INTEGRATION.md +61 -0
- package/src/client/config.ts +24 -0
- package/src/client/details.tsx +126 -0
- package/src/client/format.ts +218 -0
- package/src/client/index.tsx +225 -0
- package/src/client/locale.ts +353 -0
- package/src/client/management.tsx +246 -0
- package/src/client/placement.ts +26 -0
- package/src/client/remote.ts +59 -0
- package/src/client/store.ts +210 -0
- package/src/client/styles.ts +94 -0
- package/src/client/use-panel-placement.ts +54 -0
- package/src/client-entry.ts +12 -0
- package/src/host/config-entry.ts +47 -0
- package/src/host/config.ts +85 -0
- package/src/host/engine.ts +580 -0
- package/src/host/facts.ts +170 -0
- package/src/host/forecast-cost.ts +16 -0
- package/src/host/index.ts +269 -0
- package/src/host/record-schema.ts +175 -0
- package/src/host/repository.ts +167 -0
- package/src/host/runtime.ts +99 -0
- package/src/shared/ai-plan.ts +45 -0
- package/src/shared/baseline-selection.ts +43 -0
- package/src/shared/baselines.ts +135 -0
- package/src/shared/call-size.ts +32 -0
- package/src/shared/config.ts +65 -0
- package/src/shared/forecast.ts +91 -0
- package/src/shared/index.ts +12 -0
- package/src/shared/ledger.ts +38 -0
- package/src/shared/money.ts +46 -0
- package/src/shared/performance.ts +216 -0
- package/src/shared/pricing.ts +293 -0
- package/src/shared/public-prices.ts +57 -0
- package/src/shared/remote-contract.ts +72 -0
- package/src/shared/retained-time.ts +14 -0
- package/src/shared/time.ts +207 -0
- package/src/shared/types.ts +66 -0
- package/src/shared/usage.ts +232 -0
- package/src/shared/wire.ts +134 -0
- package/src/shared/workload.ts +265 -0
package/data/prices.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"version": "unpriced-v1",
|
|
4
|
+
"notice": "No verifiable current provider price is bundled. Add explicit provider/model/endpoint prices in per-million-token units. Missing prices remain unknown; an explicit free entry alone may mark a route free.",
|
|
5
|
+
"entries": [],
|
|
6
|
+
"sameAs": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"version": "engineering-v1",
|
|
4
|
+
"date": "2026-11-12",
|
|
5
|
+
"defaultSourceKind": "heuristic",
|
|
6
|
+
"notice": "All shipped baseline numbers are configurable engineering assumptions. No public measured benchmark samples are bundled. A separate public models.dev catalog supplies list-price references, not provider invoices.",
|
|
7
|
+
"sources": [
|
|
8
|
+
{ "id": "user-design-v1.1", "title": "任务耗时与费用预估:DSH 插件开发与上架规格 v1.1", "sourceKind": "heuristic", "url": null, "dataVersion": "engineering-v1", "sampleCount": null, "scope": "Sections 5.3, 6.2, 12: engineering startup templates; not measured data" }
|
|
9
|
+
],
|
|
10
|
+
"referenceOnly": [
|
|
11
|
+
{ "title": "Artificial Analysis Coding Agents", "url": "https://artificialanalysis.ai/agents/coding-agents/", "imported": false },
|
|
12
|
+
{ "title": "Harbor trial result schema", "url": "https://github.com/harbor-framework/harbor/blob/main/src/harbor/models/trial/result.py", "imported": false },
|
|
13
|
+
{ "title": "Magpie usage and pricing reference", "url": "https://github.com/yetone/magpie/blob/main/docs/reference.md", "imported": false }
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+

|
|
@@ -0,0 +1 @@
|
|
|
1
|
+

|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Acceptance / 原始验收门槛
|
|
2
|
+
|
|
3
|
+
Original P0 is incomplete. The external current-version report is authoritative; pending items remain pending. This public summary preserves the original gates; detailed internal observations are not shipped. A passing test suite, import, factory or CLI composition is not full UI acceptance.
|
|
4
|
+
|
|
5
|
+
## Functional and UI gates
|
|
6
|
+
|
|
7
|
+
- Exact running-line ETA; composer entry beside native usage; no crowding, native font/hover/card appearance and placement; compact reference ranges.
|
|
8
|
+
- Completed duration-only native action, with Tokens in details; estimated Token budget details and correctly scoped totals.
|
|
9
|
+
- Executing-AI bounded plan, replay/invalidation after new human scope, token-to-time semantics and last-valid retained time reference.
|
|
10
|
+
- Automatic public-price references with source/version and override precedence; unknown/partial/free remain distinct.
|
|
11
|
+
- Actual Client mount, cold boot and complete unfiltered error Console with separately attributed plugin and unrelated errors.
|
|
12
|
+
- Management read/save/read-back, JSON and CSV import, atomic invalid-batch rejection, actually saved export and cancellation, reset confirm/cancel/execution on safe data.
|
|
13
|
+
- Loading/success/error/timeout/refusal feedback and keyboard focus through all supported flows.
|
|
14
|
+
- Light/dark, narrow viewport, keyboard, zoom and reduced motion; original native controls remain usable.
|
|
15
|
+
- Open-popup unmount removes both registrations and portal; re-enable returns one each; polling, timers, in-flight requests, listeners and observers are cleaned up.
|
|
16
|
+
- Three reviewed real-feature captures: active ETA/time/cost coverage; route profiles with source/date/samples; completed initial-versus-actual, usage and price coverage. No mock shell or repainted values.
|
|
17
|
+
- Actual Desktop uninstall/reinstall retains the tested historical data; upgrade/reopen and repeated rederivation remain idempotent, with raw usage/original prices/initial forecast preserved.
|
|
18
|
+
|
|
19
|
+
## Package and measurement gates
|
|
20
|
+
|
|
21
|
+
- Clean dependencies, strict types, all tests without failures/skips and both builds; actual archive contents, license review and all local links.
|
|
22
|
+
- Exact archive hash/bytes and installed-file equality in an isolated profile; enabled/disabled composition, removal and original base composition restored.
|
|
23
|
+
- Private histories, credentials, internal development notes and machine-specific narratives excluded from the published package.
|
|
24
|
+
- Whole-task accuracy, controlled provider comparisons and full observer/dispatch overhead keep their original measurement requirements. Pure-function elapsed time and component replay do not substitute for them.
|
|
25
|
+
|
|
26
|
+
每一项需记录版本、源/产物范围、观察方式、实际结果和限制。保留失败与恢复两个观察,不改标签沿用旧版,不删除未通过门槛,也不把更宽区间或目录参考当成可靠性/账单保证。未验证的项目不勾选。
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# User guide
|
|
2
|
+
|
|
3
|
+
[Introduction](../../README.en.md) · [中文](guide.zh.md)
|
|
4
|
+
|
|
5
|
+
## Entry and estimates
|
|
6
|
+
|
|
7
|
+
Open the clock/estimate beside native Token statistics. Details expand on demand. Completed actions show elapsed time without duplicate Tokens. Active time, manual waits, remaining reference and estimated total are distinct; retained historical references carry a timestamp.
|
|
8
|
+
|
|
9
|
+
Complete normal tasks to collect local calibration. Profiles show route, source, date, samples and available metrics. Defaults of10s first text,50 visible tok/s,30s total call and0.5/2.5 reference factors are engineering priors, not provider measurements.
|
|
10
|
+
|
|
11
|
+
Provider, endpoint identity, model, mode, reasoning settings and tier distinguish routes. Unsupported endpoint identity remains unknown. Only configure a stable identity free of secrets, never an API key or credential-bearing URL.
|
|
12
|
+
|
|
13
|
+
## Costs and Tokens
|
|
14
|
+
|
|
15
|
+
Explicit rates win over bundled models.dev list-price references. Source/version are retained; list prices are not relay/subscription invoices. Complete means estimated under known usage/price semantics; partial retains a known subset, unpriced means insufficient evidence, and free requires explicit zero prices. Currencies stay separate.
|
|
16
|
+
|
|
17
|
+
Uncached input, cache reads/writes, output and reasoning follow verified semantics without double counting. A reported subtotal is not a complete total. Incomplete future budgets keep total forecasts unknown.
|
|
18
|
+
|
|
19
|
+
## Management
|
|
20
|
+
|
|
21
|
+
Read and edit full configuration before saving; fragments do not replace the complete document. Advanced JSON covers rates, route semantics and workload templates. Prediction refresh defaults to5000ms; the1000ms local display clock sends no RPC.
|
|
22
|
+
|
|
23
|
+
JSON/CSV baselines carry seedId, version, task/route scope, source, date, statistic, samples and ranges. Imports merge by identity and reject an invalid batch as a whole. Do not label means as quantiles or import an entire statistics export as baseline data.
|
|
24
|
+
|
|
25
|
+
Export preparation does not establish that a system Save dialog completed. Cancellation and an actually saved file are separate outcomes. Exports are not anonymous; review [privacy](privacy.md) before sharing.
|
|
26
|
+
|
|
27
|
+
Confirmed calibration reset advances the learning cutoff but retains historical usage/prices, configuration, imported baselines and DSH sessions. Uninstall retention depends on tested Host operations and options; it is not a backup substitute.
|
|
28
|
+
|
|
29
|
+
## Errors and updates
|
|
30
|
+
|
|
31
|
+
Missing/partial is not free or complete. The estimator does not stop tasks, switch models or declare completion. Storage faults produce diagnostics while the Host continues task execution.
|
|
32
|
+
|
|
33
|
+
After package replacement, follow the Host restart requirement. For failures, record version, Console and reproduction steps, without repeatedly reloading or modifying unrelated plugins. Test destructive controls with isolated data. Remove identities, secrets and message bodies before reporting.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# 使用指南
|
|
2
|
+
|
|
3
|
+
[返回介绍](../../README.md) · [English](guide.en.md)
|
|
4
|
+
|
|
5
|
+
## 入口与详情
|
|
6
|
+
|
|
7
|
+
点击 Token 统计旁的时钟/预估打开浮窗。预估详情按需展开;已结束回合的操作行显示「用时」,不重复 Token。工作时间、等待用户、剩余参考和预计总时间分别理解。历史保留参考附带更新时间。
|
|
8
|
+
|
|
9
|
+
## 首次校准
|
|
10
|
+
|
|
11
|
+
先正常完成若干回合。设置中的路由画像按最近真实观测排序,显示来源、日期、样本数和可测指标。默认首正文10秒、可见正文50 tok/s、总调用30秒及0.5/2.5参考倍率均为工程起点;无合格样本时仍属参考,不代表供应商实测。
|
|
12
|
+
|
|
13
|
+
同名模型在不同 provider、端点、模式、推理设置和服务档位下不视为同一路由。SDK不能统一提供的端点身份保持 unknown;需要覆盖时只填不含秘密的稳定身份,不填 API Key 或带凭证的 URL。
|
|
14
|
+
|
|
15
|
+
## 费用和 Token
|
|
16
|
+
|
|
17
|
+
自定义费率优先,随包 models.dev 公共目录作为参考来源。参考价保留来源和版本,不代表渠道账单。complete表示当前用量/价格语义下完整估价;partial是已知子集;unpriced表示证据不足;free需要明确零价。不同币种分别展示。
|
|
18
|
+
|
|
19
|
+
输入、缓存读取、缓存写入、输出与推理按可确认的合同计量,避免重复相加。已报告 Token 小计不代表完整总量;未来工作没有完整预算时总预测保持未知。
|
|
20
|
+
|
|
21
|
+
## 管理操作
|
|
22
|
+
|
|
23
|
+
读取配置后再编辑。保存写完整配置,不能把片段当全量覆盖;高级 JSON 可包含自定义费率、路由语义和工作量模板。刷新默认5000ms,本地显示时钟1000ms;显示时钟不发 RPC。
|
|
24
|
+
|
|
25
|
+
JSON/CSV 基线包含 seedId、数据版本、任务/路由范围、来源、日期、统计口径、样本数和范围。导入按身份合并;非法批次整体拒绝。不要把均值伪装成分位数,也不要把不完整统计导出整体作为基线导入。
|
|
26
|
+
|
|
27
|
+
导出准备完成不保证用户已在系统保存对话框落盘;取消保存仍需要与成功保存区分。导出数据并非匿名,分享前按[隐私说明](privacy.md)检查。
|
|
28
|
+
|
|
29
|
+
重置校准需要确认,仅重置学习并推进 cutoff;历史用量、原始价格、配置、导入基线和 DSH 会话保留。卸载后的数据保留以当前实际验收和宿主操作选项为准,不替代备份。
|
|
30
|
+
|
|
31
|
+
## 异常与更新
|
|
32
|
+
|
|
33
|
+
空值或部分覆盖不应被理解为免费或已完成。预估不替你停止任务、切换模型或判断回合结束。存储故障会显示诊断,主任务仍由宿主执行。
|
|
34
|
+
|
|
35
|
+
更新包后按宿主要求重启。若遇到加载失败,保存当前 Console/版本/操作顺序;不用真实业务数据试清空操作,也不反复刷新或修改其他插件。报告问题时移除会话身份、端点秘密及正文。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="640" height="300" viewBox="0 0 640 300" role="img" aria-labelledby="title"><title>Time, workload and cost reference illustration</title><circle cx="153" cy="143" r="78" fill="none" stroke="#5087ad" stroke-width="10"/><path d="M153 93v53l35 22" fill="none" stroke="#5087ad" stroke-width="10" stroke-linecap="round" stroke-linejoin="round"/><path d="M153 53v10m-90 80h10m80 80v10" stroke="#5087ad" stroke-width="5" stroke-linecap="round"/><circle cx="214" cy="211" r="34" fill="#bc9454"/><path d="M224 197h-14a7 7 0 0 0 0 14h9a7 7 0 0 1 0 14h-15m10-35v42" fill="none" stroke="#203b4e" stroke-width="4" stroke-linecap="round"/><path d="M304 92h242m-242 58h180m-180 58h218" stroke="#5087ad" stroke-opacity=".25" stroke-width="18" stroke-linecap="round"/><path d="M304 92h145m-145 58h105" stroke="#5087ad" stroke-width="18" stroke-linecap="round"/><path d="M304 208h163" stroke="#bc9454" stroke-width="18" stroke-linecap="round"/></svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Privacy and data / 隐私与数据
|
|
2
|
+
|
|
3
|
+
The plugin keeps task/route, timing, counters, reported usage, price resolution and estimation metadata in its own local storage domain. Prompt text may be transiently classified or counted on Host; prompts, code bodies, tool arguments and credentials are not stored in plugin statistics. Client does not read conversation bodies.
|
|
4
|
+
|
|
5
|
+
默认不上传统计、不额外调用估价模型、不自动联网更新。执行 AI 可以用本次任务中的工具提交有界数字计划。公共价目录随包提供;维护脚本的手动联网更新与插件正常运行分开。
|
|
6
|
+
|
|
7
|
+
Configuration can contain provider/model identities, stable route fingerprints and custom rates. Do not put secrets in identity/source fields. A full export includes configuration, session/turn identities, history and calibration; it is **not anonymous**. Review and redact before sharing. Raw exports and conversation captures are excluded from the runtime package.
|
|
8
|
+
|
|
9
|
+
历史初始预估和原始价格版本保留。校准重置推进学习边界,保留调用/任务历史、用量、价格、配置、导入基线与原 DSH 会话,不承担匿名化或删除全部数据的含义。
|
|
10
|
+
|
|
11
|
+
Uninstall and explicit Host data-cleanup options are distinct operations. The current report states which retention path was actually tested. Preserve backups before data management; a version label alone does not establish retention or migration success.
|
|
12
|
+
|
|
13
|
+
Only reviewed, cropped captures of the actual feature may be shared. Do not share other sessions, message bodies, private endpoints or credentials. Diagnostics for publication use safe aggregate metadata and counts rather than raw histories.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Distribution / 分发
|
|
2
|
+
|
|
3
|
+
The public preview is distributed as a prebuilt GitHub Release archive from [leicheng42/dsh-task-time-cost](https://github.com/leicheng42/dsh-task-time-cost/releases). Source and support links name the authenticated maintainer. npm previews use the explicit beta distribution tag. Package publishing targets the public npm registry; stable promotion is separate. The original GitHub beta.1 remains frozen.
|
|
4
|
+
|
|
5
|
+
Preview publication does not complete original P0 acceptance. [Acceptance](acceptance.md), [compatibility](../../COMPATIBILITY.md) and per-release verification retain known gaps and unmeasured areas. Stable promotion needs its own evidence.
|
|
6
|
+
|
|
7
|
+
Each release freezes version, archive, checksum and safe verification summary. Validate exact installed bytes in an isolated profile, then independently verify the public download. Never package private exports, development instructions, session content, credentials or machine paths.
|
|
8
|
+
|
|
9
|
+
The optional detail document contains one original text-free illustration, with localized alternative text; it does not depict measured values or simulate a DSH screen. Rendered details and actual UI acceptance are separate checks.
|
package/icon.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36" role="img" aria-label="Task time and cost"><circle cx="15.5" cy="15.5" r="10" fill="none" stroke="#5087ad" stroke-width="2.4"/><path d="M15.5 9.5v6.8l4.2 2.4" fill="none" stroke="#5087ad" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/><circle cx="25" cy="25" r="6.5" fill="#bc9454"/><path d="M27 22h-3a1.5 1.5 0 0 0 0 3h2a1.5 1.5 0 0 1 0 3h-3m2-7.5v9" fill="none" stroke="#203b4e" stroke-width="1.3" stroke-linecap="round"/></svg>
|