agentworkshop 0.7.46 → 0.7.47
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/.output/.AgentWorkShop/aml-python/__pycache__/amlkit.cpython-312.pyc +0 -0
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/1b18aaf2-ccbc-45e0-b9c3-107655b226f9.json +1 -0
- package/.output/server/chunks/_/nitro.mjs +833 -748
- package/.output/server/package.json +1 -1
- package/README-zh.md +2 -2
- package/README.md +2 -2
- package/config.yml +1 -1
- package/docs/aml.md +1 -0
- package/docs/cli.en.md +2 -2
- package/docs/cli.md +2 -2
- package/docs/full-test-plan.md +1 -1
- package/docs/plugins.en.md +1 -1
- package/docs/plugins.md +1 -1
- package/docs/sdk.en.md +1 -1
- package/docs/sdk.md +1 -1
- package/package.json +1 -1
- package/scripts/_aw-packaged-start.cjs +22 -0
- package/scripts/_aw0746-stage12.mjs +94 -0
- package/scripts/_aw0746-stage34.mjs +134 -0
- package/scripts/_aw0746-stage5.mjs +106 -0
- package/scripts/_aw0746-stage6-aml.mjs +177 -0
- package/scripts/_aw0746-stage6b-train-sweep.mjs +142 -0
- package/scripts/_aw0746-stage7-twin.mjs +259 -0
- package/scripts/_aw0746-train-strong.py +142 -0
- package/scripts/_plc-sim-detached.cjs +22 -0
- package/scripts/_probe-density.cjs +15 -0
- package/scripts/_probe-gate-model.mjs +34 -0
- package/scripts/_probe-model-eligibility.cjs +13 -0
- package/server/services/workshop/agents/industrial/twin-tools.ts +85 -10
- package/server/services/workshop/aml/job-orchestrator/start-job.ts +140 -124
- package/server/services/workshop/aml/python/__pycache__/amlkit.cpython-312.pyc +0 -0
- package/server/services/workshop/aml/twin/repo.ts +9 -4
- package/.output/public/_nuxt/builds/meta/7827fe9f-b4c2-461f-b1fb-c0c7da7d66b8.json +0 -1
|
@@ -8,19 +8,24 @@ export function createTwinRepo(db: DatabaseSync) {
|
|
|
8
8
|
const insertSnapshotStmt = db.prepare(`INSERT OR IGNORE INTO twin_snapshots(id,scene_id,scene_version,line_id,product_id,recipe_id,phase,snapshot_hash,watermark_ms,freshness_json,payload_json,created_by,created_at) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)`)
|
|
9
9
|
const insertTrialStmt = db.prepare(`INSERT OR IGNORE INTO twin_trials(id,snapshot_id,twin_model_id,objective_id,candidate_executed,status,result_json,result_hash,created_by,created_at) VALUES(?,?,?,?,0,?,?,?,?,?)`)
|
|
10
10
|
const insertRecStmt = db.prepare(`INSERT OR IGNORE INTO twin_recommendations(id,trial_id,certificate_hash,status,certificate_json,expires_at,created_by,created_at) VALUES(?,?,?,?,?,?,?,?)`)
|
|
11
|
+
// 绑定值直接来自调用方(scene_json/snapshot_json 都是外部输入):对象/undefined 会以
|
|
12
|
+
// "Provided value cannot be bound to SQLite parameter N" 这种驱动级报错冒出来(实测踩过),
|
|
13
|
+
// 这里统一收敛成字符串/有限数字,让参数形状问题不再污染错误面。
|
|
14
|
+
const text = (v: unknown): string => (v == null ? '' : typeof v === 'string' ? v : String(v))
|
|
15
|
+
const num = (v: unknown): number => (Number.isFinite(Number(v)) ? Number(v) : 0)
|
|
11
16
|
return {
|
|
12
17
|
upsertScene(scene: SceneContract, createdBy: string): void {
|
|
13
18
|
const now = new Date().toISOString()
|
|
14
|
-
upsertSceneStmt.run(scene.sceneId, scene.sceneVersion, scene.schemaVersion, JSON.stringify(scene), sha256(scene), scene.lineId, scene.productId
|
|
19
|
+
upsertSceneStmt.run(text(scene.sceneId), text(scene.sceneVersion), num(scene.schemaVersion), JSON.stringify(scene), sha256(scene), text(scene.lineId), text(scene.productId), text(scene.recipeId), 'draft', text(createdBy), text(scene.createdAt) || now, now)
|
|
15
20
|
},
|
|
16
21
|
insertSnapshot(snapshot: TwinSnapshot): void {
|
|
17
|
-
insertSnapshotStmt.run(snapshot.snapshotId, snapshot.sceneId, snapshot.sceneVersion, snapshot.lineId, snapshot.productId
|
|
22
|
+
insertSnapshotStmt.run(text(snapshot.snapshotId), text(snapshot.sceneId), text(snapshot.sceneVersion), text(snapshot.lineId), text(snapshot.productId), text(snapshot.recipeId), text(snapshot.phase), text(snapshot.snapshotHash), num(snapshot.daqWatermark), JSON.stringify(snapshot.dataQuality ?? {}), JSON.stringify(snapshot), text(snapshot.createdBy), text(snapshot.createdAt))
|
|
18
23
|
},
|
|
19
24
|
insertTrial(trial: VirtualTrial, twinModelId?: string): void {
|
|
20
|
-
insertTrialStmt.run(trial.trialId, trial.snapshotId, twinModelId ?? trial.modelId, trial.objectiveId, 'completed', JSON.stringify(trial), sha256(trial), trial.createdBy, trial.createdAt)
|
|
25
|
+
insertTrialStmt.run(text(trial.trialId), text(trial.snapshotId), text(twinModelId ?? trial.modelId), text(trial.objectiveId), 'completed', JSON.stringify(trial), sha256(trial), text(trial.createdBy), text(trial.createdAt))
|
|
21
26
|
},
|
|
22
27
|
insertRecommendation(certificate: RecommendationCertificate, createdBy: string, expiresAt?: string): void {
|
|
23
|
-
insertRecStmt.run(certificate.recommendationId, certificate.trialId, certificate.certificateHash, certificate.status.toLowerCase(), JSON.stringify(certificate), expiresAt ?? null, createdBy, certificate.createdAt)
|
|
28
|
+
insertRecStmt.run(text(certificate.recommendationId), text(certificate.trialId), text(certificate.certificateHash), text(certificate.status).toLowerCase(), JSON.stringify(certificate), expiresAt ?? null, text(createdBy), text(certificate.createdAt))
|
|
24
29
|
},
|
|
25
30
|
}
|
|
26
31
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"7827fe9f-b4c2-461f-b1fb-c0c7da7d66b8","timestamp":1790316372736,"prerendered":[]}
|