dsh-math-calculator 2.0.0 → 2.1.1
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 +103 -0
- package/README.md +52 -10
- package/dsh.plugin.json +15 -8
- package/lib/awareness.js +16 -13
- package/lib/body-catalog.js +488 -0
- package/lib/body-scaling.js +288 -0
- package/lib/body-taxonomy.js +719 -0
- package/lib/detector.js +361 -16
- package/lib/empirical-decomposition.js +321 -0
- package/lib/format.js +113 -5
- package/lib/formula-library-generic.js +226 -0
- package/lib/formulas.js +71 -13
- package/lib/index.js +623 -77
- package/lib/ops/bodies-op.js +368 -0
- package/lib/ops/shared.js +64 -4
- package/lib/ops/workspace-op.js +19 -1
- package/lib/ops/world-op.js +22 -0
- package/lib/playbook.js +6 -1
- package/lib/precision-report.js +80 -0
- package/lib/result-cache.js +144 -0
- package/lib/types/awareness.d.ts +10 -4
- package/lib/types/body-catalog.d.ts +156 -0
- package/lib/types/body-scaling.d.ts +123 -0
- package/lib/types/body-taxonomy.d.ts +95 -0
- package/lib/types/detector.d.ts +18 -0
- package/lib/types/empirical-decomposition.d.ts +107 -0
- package/lib/types/format.d.ts +33 -4
- package/lib/types/formula-library-generic.d.ts +37 -0
- package/lib/types/formulas.d.ts +35 -7
- package/lib/types/index.d.ts +16 -0
- package/lib/types/ops/bodies-op.d.ts +35 -0
- package/lib/types/ops/shared.d.ts +94 -3
- package/lib/types/precision-report.d.ts +59 -0
- package/lib/types/result-cache.d.ts +78 -0
- package/lib/types/workspace.d.ts +24 -0
- package/lib/types/world.d.ts +8 -0
- package/lib/workspace.js +22 -0
- package/lib/world.js +38 -3
- package/package.json +1 -1
- package/src/awareness.ts +16 -13
- package/src/body-catalog.ts +619 -0
- package/src/body-scaling.ts +357 -0
- package/src/body-taxonomy.ts +806 -0
- package/src/detector.ts +403 -15
- package/src/empirical-decomposition.ts +411 -0
- package/src/format.ts +123 -5
- package/src/formula-library-generic.ts +242 -0
- package/src/formulas.ts +79 -13
- package/src/index.ts +652 -64
- package/src/ops/bodies-op.ts +415 -0
- package/src/ops/shared.ts +141 -4
- package/src/ops/workspace-op.ts +21 -1
- package/src/ops/world-op.ts +22 -0
- package/src/playbook.ts +6 -1
- package/src/precision-report.ts +87 -0
- package/src/result-cache.ts +157 -0
- package/src/workspace.ts +34 -0
- package/src/world.ts +51 -4
package/src/awareness.ts
CHANGED
|
@@ -50,31 +50,34 @@ export function getPromptMode(): PromptMode {
|
|
|
50
50
|
/**
|
|
51
51
|
* 第一层:工具描述。
|
|
52
52
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
53
|
+
* 这是模型**每次**看工具清单时都会读到的内容 —— 属于每轮固定成本,
|
|
54
|
+
* 所以要跟 parameters schema 一样抠字数。
|
|
55
|
+
*
|
|
56
|
+
* 压缩原则:
|
|
57
|
+
* · **不重复 enum**:operation 的取值已在 schema 的 enum 里列全(300 字符),
|
|
58
|
+
* 这里再列一遍是纯重复。只保留「怎么选」的判断线索。
|
|
59
|
+
* · **能移到 help 的就移**:详细字段表、单位清单等只在用到时才需要,
|
|
60
|
+
* 放 help 里不占每轮成本。
|
|
61
|
+
* · **保留行为约束**:如「必须调本工具」「精度分两层」这类会改变模型行为的,
|
|
62
|
+
* 不能砍 —— 它们省下的重算远多于自身开销。
|
|
57
63
|
*/
|
|
58
64
|
export const TOOL_DESCRIPTION = [
|
|
59
65
|
'本地数学与物理推演引擎(BigNumber 64 位 + 符号代数 + 架空世界推演)。',
|
|
60
66
|
'',
|
|
61
67
|
'⚠️ 数值计算必须调用本工具:不要心算、不要用 bash 拼凑算术。',
|
|
62
|
-
'
|
|
63
|
-
'
|
|
68
|
+
'触发场景:算术/三角、解方程、微积分、线代、统计、单位换算、公式求值、',
|
|
69
|
+
'改常数看后果、推演星球/恒星/卫星/生命、势力收支。',
|
|
64
70
|
'',
|
|
65
|
-
'operation
|
|
66
|
-
'
|
|
67
|
-
' 线代 matrix eigen | 统计 stats dist regression | 微分方程 ode',
|
|
68
|
-
' 公式 formula formulas | 世界 world | 常数 constants quantities impact',
|
|
69
|
-
' 单位 units | 收支 balance | 推演 derivation(pipeline/dead/backSolve/flip 等)',
|
|
70
|
-
' 自创量 custom | 设定校验 feasibility | 数据 workspace formula-table | 自查 help',
|
|
71
|
+
'operation 见参数 enum(30 个);不确定用 help。选法:一条式子用 evaluate,',
|
|
72
|
+
'数据用 stats/dist,改设定后用 world/derivation。',
|
|
71
73
|
'',
|
|
72
74
|
'读输出约定:',
|
|
73
75
|
' · [精确]/[标度]/[量级]/[仅方向] 是可信度标签,引用时保留;',
|
|
74
76
|
' · 【跨模块一致性】✓/⚠/✗,看到 ✗ 先修正设定;',
|
|
75
77
|
' · 【模型可信度】标出哪些数只是地球标定,常数偏离现实时会失真。',
|
|
76
78
|
'',
|
|
77
|
-
'
|
|
79
|
+
'精度分两层:precision(计算,默认 64,调低会算错大数)不要为好看而动;',
|
|
80
|
+
'displayPrecision(显示,**小数点后几位**,默认 8)只截小数、整数永远完整。',
|
|
78
81
|
].join('\n')
|
|
79
82
|
|
|
80
83
|
/**
|