agentworkshop 0.4.1 → 0.5.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/README-zh.md +5 -6
- package/README.md +5 -6
- package/app/config/index.ts +6 -0
- package/cli/commands/doctor.mjs +17 -0
- package/cli/commands/start.mjs +25 -2
- package/cli/infra.mjs +109 -0
- package/package.json +142 -142
- package/scripts/_dbg-app-shot.mjs +1 -3
- package/server/data/dcw-rollback.json +1 -1
package/README-zh.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<img src="docs/readme-assets/hero.png" alt="AgentWorkShop — 让 Agent 运行产线" width="100%" />
|
|
3
|
+
<img src="https://raw.githubusercontent.com/kingdol666/AgentWorkShop/main/docs/readme-assets/hero.png" alt="AgentWorkShop — 让 Agent 运行产线" width="100%" />
|
|
4
4
|
|
|
5
5
|
# AgentWorkShop
|
|
6
6
|
|
|
@@ -19,8 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
|
-
>
|
|
23
|
-
> **定位声明:监督层。** AgentWorkShop 是面向产线管理、数字孪生、数采与 Agent 编排的**监督层**(SCADA 同位)平台,运行在**秒级软实时**档位。它**不是**硬实时控制器:任何时序关键回路(**< 10 ms**、联锁、安全、伺服)**必须在 PLC 内实现**;本平台下发的值均为建议性设定值,产线侧逻辑可否决。
|
|
22
|
+
> ⚠️ **定位声明:监督层。** AgentWorkShop 是面向产线管理、数字孪生、数采与 Agent 编排的**监督层**(SCADA 同位)平台,运行在**秒级软实时**档位。它**不是**硬实时控制器:任何时序关键回路(**< 10 ms**、联锁、安全、伺服)**必须在 PLC 内实现**;本平台下发的值均为建议性设定值,产线侧逻辑可否决。
|
|
24
23
|
|
|
25
24
|
---
|
|
26
25
|
|
|
@@ -33,7 +32,7 @@ AgentWorkShop 起家于**多智能体软件工作坊**——Channel 内的编码
|
|
|
33
32
|
最终效果:提交一个目标,比如「分析熔体温度趋势并优化设定值」——Agent 团队读取真实传感器历史、计算统计量、提议新设定值、在 HITL 面板等您批准、写入 PLC、校验回读、带着数值汇报。**端到端,自动化 E2E 已验证。**
|
|
34
33
|
|
|
35
34
|
<div align="center">
|
|
36
|
-
<img src="docs/readme-assets/town-demo.gif" alt="3D 数字孪生 — 实时产线" width="86%" />
|
|
35
|
+
<img src="https://raw.githubusercontent.com/kingdol666/AgentWorkShop/main/docs/readme-assets/town-demo.gif" alt="3D 数字孪生 — 实时产线" width="86%" />
|
|
37
36
|
<br><sub><b>实时 3D 孪生。</b>产线设备、设备健康、数采通道与趋势分析——全部由实时遥测驱动。</sub>
|
|
38
37
|
</div>
|
|
39
38
|
|
|
@@ -62,11 +61,11 @@ AgentWorkShop 起家于**多智能体软件工作坊**——Channel 内的编码
|
|
|
62
61
|
|
|
63
62
|
| Agent 工作台 | 产线运营 |
|
|
64
63
|
|:---:|:---:|
|
|
65
|
-
|  |  |
|
|
64
|
+
|  |  |
|
|
66
65
|
|
|
67
66
|
| 数采中心 | 数字孪生小镇 |
|
|
68
67
|
|:---:|:---:|
|
|
69
|
-
|  |  |
|
|
68
|
+
|  |  |
|
|
70
69
|
|
|
71
70
|
</div>
|
|
72
71
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<img src="docs/readme-assets/hero.png" alt="AgentWorkShop — Agents that run the production line" width="100%" />
|
|
3
|
+
<img src="https://raw.githubusercontent.com/kingdol666/AgentWorkShop/main/docs/readme-assets/hero.png" alt="AgentWorkShop — Agents that run the production line" width="100%" />
|
|
4
4
|
|
|
5
5
|
# AgentWorkShop
|
|
6
6
|
|
|
@@ -19,8 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
|
-
>
|
|
23
|
-
> **Positioning: supervisory layer.** AgentWorkShop is a *supervisory* (SCADA-adjacent) layer for production-line management, digital twins, DAQ and agent orchestration, operating at **second-level soft real-time**. It is **not** a hard real-time controller: any time-critical loop (**< 10 ms**, interlocks, safety, servo) **must live inside the PLC**. Setpoints written here are advisory — plant-side logic may veto.
|
|
22
|
+
> ⚠️ **Positioning: supervisory layer.** AgentWorkShop is a *supervisory* (SCADA-adjacent) layer for production-line management, digital twins, DAQ and agent orchestration, operating at **second-level soft real-time**. It is **not** a hard real-time controller: any time-critical loop (**< 10 ms**, interlocks, safety, servo) **must live inside the PLC**. Setpoints written here are advisory — plant-side logic may veto.
|
|
24
23
|
|
|
25
24
|
---
|
|
26
25
|
|
|
@@ -33,7 +32,7 @@ It grew an **industrial half**: a full data-acquisition and write-control stack
|
|
|
33
32
|
The result: submit a goal like *"analyze the melt temperature trend and optimize the setpoint"* — and an agent team reads real sensor history, computes statistics, proposes a new setpoint, waits for your approval in the HITL panel, writes it to the PLC, verifies the readback, and reports the numbers back. **End to end, verified by automated E2E.**
|
|
34
33
|
|
|
35
34
|
<div align="center">
|
|
36
|
-
<img src="docs/readme-assets/town-demo.gif" alt="3D digital twin — live production line" width="86%" />
|
|
35
|
+
<img src="https://raw.githubusercontent.com/kingdol666/AgentWorkShop/main/docs/readme-assets/town-demo.gif" alt="3D digital twin — live production line" width="86%" />
|
|
37
36
|
<br><sub><b>Live 3D twin.</b> Line equipment, device health, DAQ channels and trend analysis — all driven by real-time telemetry.</sub>
|
|
38
37
|
</div>
|
|
39
38
|
|
|
@@ -62,11 +61,11 @@ The result: submit a goal like *"analyze the melt temperature trend and optimize
|
|
|
62
61
|
|
|
63
62
|
| Agent Workbench | Line Operations |
|
|
64
63
|
|:---:|:---:|
|
|
65
|
-
|  |  |
|
|
64
|
+
|  |  |
|
|
66
65
|
|
|
67
66
|
| DAQ Center | Digital Twin Town |
|
|
68
67
|
|:---:|:---:|
|
|
69
|
-
|  |  |
|
|
68
|
+
|  |  |
|
|
70
69
|
|
|
71
70
|
</div>
|
|
72
71
|
|
package/app/config/index.ts
CHANGED
|
@@ -57,6 +57,12 @@ function applyRuntimeOverrides(raw: Record<string, unknown>): void {
|
|
|
57
57
|
export function loadConfig(): AppConfig {
|
|
58
58
|
if (cached) return cached
|
|
59
59
|
const raw = (YAML.load(readFileSync(configPath, 'utf8')) ?? {}) as Record<string, unknown>
|
|
60
|
+
// 版本号唯一事实来源 = package.json;config.yml 的 app.version 仅作兜底,防止两处漂移
|
|
61
|
+
if (raw.app == null || typeof raw.app !== 'object') raw.app = {}
|
|
62
|
+
try {
|
|
63
|
+
const pkg = JSON.parse(readFileSync(join(packageRoot, 'package.json'), 'utf8')) as { version?: string }
|
|
64
|
+
if (pkg.version) (raw.app as Record<string, unknown>).version = pkg.version
|
|
65
|
+
} catch { /* 载荷异常时保留 yml 兜底值 */ }
|
|
60
66
|
applyRuntimeOverrides(raw)
|
|
61
67
|
cached = appConfigSchema.parse(raw)
|
|
62
68
|
return cached
|
package/cli/commands/doctor.mjs
CHANGED
|
@@ -35,6 +35,23 @@ export async function run(argv, ctx) {
|
|
|
35
35
|
const homeEnv = join(home, '.env')
|
|
36
36
|
add('AW Home .env 密钥', existsSync(homeEnv), existsSync(homeEnv) ? '已生成(含随机 session 密钥)' : '未生成(aw home 可初始化)')
|
|
37
37
|
|
|
38
|
+
// ── Docker 与数采基础设施(MQTT/Timescale 连通性;doctor 只探测不拉起) ──
|
|
39
|
+
const { detectDocker, probeTcp } = await import('../../cli/infra.mjs')
|
|
40
|
+
const dockerInfo = detectDocker()
|
|
41
|
+
add('Docker', dockerInfo.ok, dockerInfo.ok ? dockerInfo.version : '未安装(依赖容器编排不可用,可改配外部依赖)')
|
|
42
|
+
try {
|
|
43
|
+
const eff = ctx.config.load().effective ?? {}
|
|
44
|
+
const mqHost = String(eff['daq.mqtt.host'] ?? '127.0.0.1')
|
|
45
|
+
const mqPort = Number(eff['daq.mqtt.port'] ?? 1883)
|
|
46
|
+
const tsHost = String(eff['daq.timescale.host'] ?? '127.0.0.1')
|
|
47
|
+
const tsPort = Number(eff['daq.timescale.port'] ?? 5432)
|
|
48
|
+
const mqUp = (await probeTcp(mqPort, mqHost)) === 'online'
|
|
49
|
+
const tsUp = (await probeTcp(tsPort, tsHost)) === 'online'
|
|
50
|
+
add('MQTT 连通', mqUp, `${mqHost}:${mqPort}${mqUp ? '' : ' — aw start 可经 Docker 自动拉起'}`)
|
|
51
|
+
add('TimescaleDB 连通', tsUp, `${tsHost}:${tsPort}${tsUp ? '' : ' — aw start 可经 Docker 自动拉起'}`)
|
|
52
|
+
}
|
|
53
|
+
catch { /* 配置不可用(未初始化)时跳过 */ }
|
|
54
|
+
|
|
38
55
|
// ── 项目上下文 ──
|
|
39
56
|
if (ctx.root) {
|
|
40
57
|
add('项目检测', true, ctx.root)
|
package/cli/commands/start.mjs
CHANGED
|
@@ -14,13 +14,17 @@ import { join } from 'node:path'
|
|
|
14
14
|
import { color } from '../core/logger.mjs'
|
|
15
15
|
import { localBypassEnv, preloadDotEnv } from '../core/context.mjs'
|
|
16
16
|
import { runBootstrap } from '../../scripts/home-bootstrap.mjs'
|
|
17
|
+
import { daqPreflight, printInfraGuidance } from '../infra.mjs'
|
|
17
18
|
|
|
18
19
|
export const meta = {
|
|
19
20
|
name: 'start',
|
|
20
21
|
aliases: ['s', 'prod', 'preview'],
|
|
21
22
|
group: '运行',
|
|
22
23
|
summary: '一键启动生产服务(配置驱动端口,项目检出内外皆可)',
|
|
23
|
-
usage: 'aw start [--port <n>] [--host <h>]',
|
|
24
|
+
usage: 'aw start [--port <n>] [--host <h>] [--skip-infra]',
|
|
25
|
+
options: [
|
|
26
|
+
{ name: 'skip-infra', type: 'boolean', description: '跳过数采基础设施前置检查(compose 拉起/回退引导)' },
|
|
27
|
+
],
|
|
24
28
|
needsProject: false,
|
|
25
29
|
}
|
|
26
30
|
|
|
@@ -79,6 +83,26 @@ export async function run(argv, ctx) {
|
|
|
79
83
|
// HOST 环境变量被 scripts/start.mjs 以最高优先读取(CLI 显式 --host 等效)
|
|
80
84
|
if (flags.host !== undefined) envExtra.HOST = host
|
|
81
85
|
|
|
86
|
+
// ---- 数采基础设施前置检查(Docker 编排/回退引导;失败不阻断,服务内自动重连) ----
|
|
87
|
+
if (flags['skip-infra'] !== true) {
|
|
88
|
+
try {
|
|
89
|
+
const infra = await daqPreflight({ daq: eff.effective, configRoot: ctx.paths?.configRoot ?? ctx.configRoot ?? cwd })
|
|
90
|
+
if (infra.ok) {
|
|
91
|
+
console.log(`${color.green('✔')} 数采依赖就绪(MQTT ${infra.mqtt.host}:${infra.mqtt.port} · Timescale ${infra.timescale.host}:${infra.timescale.port})`)
|
|
92
|
+
}
|
|
93
|
+
else if (infra.pulled) {
|
|
94
|
+
console.log(`${color.yellow('⚠')} 依赖容器已拉起但端口尚未全部就绪——服务将继续启动,数采自动重连`)
|
|
95
|
+
printInfraGuidance(infra)
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
printInfraGuidance(infra)
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
catch (err) {
|
|
102
|
+
console.log(`${color.dim('›')} 基础设施前置检查跳过: ${err?.message ?? err}`)
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
82
106
|
console.log(`${color.cyan('›')} 生产服务(${isRepo ? 'repo' : 'home'} 模式) -> http://${host}:${port} ${color.dim(`(端口来源: ${portSource})`)}`)
|
|
83
107
|
console.log(`${color.cyan('›')} ${color.dim(`配置: ${ctx.configPath} · 数据: ${ctx.dataDir}`)}`)
|
|
84
108
|
console.log(`${color.cyan('›')} 停止: Ctrl+C`)
|
|
@@ -86,7 +110,6 @@ export async function run(argv, ctx) {
|
|
|
86
110
|
const launcher = join(appRoot, 'scripts', 'start.mjs')
|
|
87
111
|
const args = existsSync(launcher) ? [launcher] : [outputEntry]
|
|
88
112
|
if (flags.port !== undefined) args.push('--port', String(port))
|
|
89
|
-
|
|
90
113
|
const child = spawn(process.execPath, args, {
|
|
91
114
|
cwd,
|
|
92
115
|
stdio: 'inherit',
|
package/cli/infra.mjs
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// AgentWorkShop CLI — 数采基础设施前置检查(Docker 编排)
|
|
3
|
+
// ------------------------------------------------------------
|
|
4
|
+
// aw start 启动服务前的引导层:
|
|
5
|
+
// 1. 探测 MQTT / TimescaleDB 端口连通(按有效配置的 host/port)
|
|
6
|
+
// 2. 已连通 → 依赖就绪,直接通过
|
|
7
|
+
// 3. 未连通且本机 Docker 可用且策略允许 → docker compose up -d 拉起并等待端口
|
|
8
|
+
// 4. 无 Docker → 打印回退引导:安装 Docker,或在 config.yml 按需配置外部依赖地址
|
|
9
|
+
// 真正的容器编排与降级重连在服务进程内(server/plugins/daq.ts → ensureDaqInfrastructure);
|
|
10
|
+
// 本模块只做启动前置探测与引导,失败不阻断服务启动(平台降级可用)。
|
|
11
|
+
// ============================================================
|
|
12
|
+
import { spawnSync } from 'node:child_process'
|
|
13
|
+
import { existsSync } from 'node:fs'
|
|
14
|
+
import { connect } from 'node:net'
|
|
15
|
+
import { join } from 'node:path'
|
|
16
|
+
import { color } from './core/logger.mjs'
|
|
17
|
+
|
|
18
|
+
/** 本机 Docker 可用性(docker -v) */
|
|
19
|
+
export function detectDocker() {
|
|
20
|
+
const r = spawnSync('docker', ['-v'], { encoding: 'utf8', shell: process.platform === 'win32' })
|
|
21
|
+
if (r.status === 0) return { ok: true, version: (r.stdout ?? '').trim().replace(/^Docker version\s*/i, '') }
|
|
22
|
+
return { ok: false, version: null }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** TCP 端口连通探测(毫秒级超时;resolve('online'|'offline')) */
|
|
26
|
+
export function probeTcp(port, host = '127.0.0.1', timeoutMs = 1200) {
|
|
27
|
+
return new Promise((resolveState) => {
|
|
28
|
+
const sock = connect({ port: Number(port), host })
|
|
29
|
+
const done = (state) => {
|
|
30
|
+
sock.destroy()
|
|
31
|
+
resolveState(state)
|
|
32
|
+
}
|
|
33
|
+
sock.setTimeout(timeoutMs)
|
|
34
|
+
sock.on('connect', () => done('online'))
|
|
35
|
+
sock.on('timeout', () => done('offline'))
|
|
36
|
+
sock.on('error', () => done('offline'))
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** 在 compose 目录执行 docker compose up -d(阻塞至命令结束) */
|
|
41
|
+
export function composeUp(composeDir) {
|
|
42
|
+
const r = spawnSync('docker', ['compose', 'up', '-d'], {
|
|
43
|
+
cwd: composeDir,
|
|
44
|
+
stdio: 'inherit',
|
|
45
|
+
shell: process.platform === 'win32',
|
|
46
|
+
})
|
|
47
|
+
return r.status === 0
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 数采基础设施前置检查。
|
|
52
|
+
* @param {{ daq: any, configRoot: string }} opts ctx.config 片段与配置根(daQ compose 种子所在)
|
|
53
|
+
* @returns {{ ok: boolean, mqtt: object, timescale: object, docker: object }}
|
|
54
|
+
*/
|
|
55
|
+
export async function daqPreflight({ daq, configRoot }) {
|
|
56
|
+
const mqtt = {
|
|
57
|
+
host: String(daq?.['daq.mqtt.host'] ?? '127.0.0.1'),
|
|
58
|
+
port: Number(daq?.['daq.mqtt.port'] ?? 1883),
|
|
59
|
+
online: null,
|
|
60
|
+
}
|
|
61
|
+
const timescale = {
|
|
62
|
+
host: String(daq?.['daq.timescale.host'] ?? '127.0.0.1'),
|
|
63
|
+
port: Number(daq?.['daq.timescale.port'] ?? 5432),
|
|
64
|
+
online: null,
|
|
65
|
+
}
|
|
66
|
+
const policy = String(daq?.['daq.startInfrastructure'] ?? 'auto')
|
|
67
|
+
|
|
68
|
+
const docker = detectDocker()
|
|
69
|
+
mqtt.online = (await probeTcp(mqtt.port, mqtt.host)) === 'online'
|
|
70
|
+
timescale.online = (await probeTcp(timescale.port, timescale.host)) === 'online'
|
|
71
|
+
const allOnline = mqtt.online && timescale.online
|
|
72
|
+
const composeDir = existsSync(join(configRoot, 'docker-compose.yml')) ? configRoot : null
|
|
73
|
+
|
|
74
|
+
const result = { ok: allOnline, mqtt, timescale, docker, policy, composeDir }
|
|
75
|
+
|
|
76
|
+
if (allOnline) return result
|
|
77
|
+
|
|
78
|
+
// 未全连通:
|
|
79
|
+
// · Docker 可用 + 策略允许(auto/always)+ 本地有 compose 定义 → 拉起并等待端口上线
|
|
80
|
+
if (docker.ok && policy !== 'never' && composeDir) {
|
|
81
|
+
console.log(`${color.cyan('›')} 数采依赖未就绪(MQTT ${mqtt.online ? '✓' : '✗'} / Timescale ${timescale.online ? '✓' : '✗'})——docker compose up -d 拉起 ...`)
|
|
82
|
+
const up = composeUp(composeDir)
|
|
83
|
+
// 等待端口上线(最长 30s;Timescale 首启初始化较慢)
|
|
84
|
+
for (let i = 0; i < 15; i++) {
|
|
85
|
+
await new Promise(r => setTimeout(r, 2000))
|
|
86
|
+
mqtt.online = (await probeTcp(mqtt.port, mqtt.host)) === 'online'
|
|
87
|
+
timescale.online = (await probeTcp(timescale.port, timescale.host)) === 'online'
|
|
88
|
+
if (mqtt.online && timescale.online) break
|
|
89
|
+
}
|
|
90
|
+
result.ok = mqtt.online && timescale.online
|
|
91
|
+
result.pulled = up
|
|
92
|
+
return result
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return result
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** 打印回退引导(无 Docker 且依赖不可达时) */
|
|
99
|
+
export function printInfraGuidance({ mqtt, timescale, docker }) {
|
|
100
|
+
console.log('')
|
|
101
|
+
console.log(color.yellow('⚠ 数采基础设施不可达(MQTT/TimescaleDB)——服务将继续启动,数采功能降级并每 30s 自动重连。'))
|
|
102
|
+
console.log(color.dim(' 解决方式(二选一):'))
|
|
103
|
+
console.log(` ${color.cyan('1.')} 安装 Docker Desktop 后重启本命令,依赖容器将自动拉起`)
|
|
104
|
+
console.log(` ${color.cyan('2.')} 在 config.yml 的 daq 段按需配置外部依赖:`)
|
|
105
|
+
console.log(color.dim(` daq.mqtt.host/port (当前 ${mqtt.host}:${mqtt.port} ✗)`))
|
|
106
|
+
console.log(color.dim(` daq.timescale.host/port (当前 ${timescale.host}:${timescale.port} ✗)`))
|
|
107
|
+
if (!docker.ok) console.log(color.dim(' (本机未检测到 Docker)'))
|
|
108
|
+
console.log('')
|
|
109
|
+
}
|
package/package.json
CHANGED
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "agentworkshop",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "AgentWorkShop 软件开发系统 - 基于 Nuxt 4 的配置驱动运行范式",
|
|
6
|
-
"license": "PolyForm-Noncommercial-1.0.0",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"types": "./sdk/index.d.mts",
|
|
10
|
-
"default": "./sdk/index.mjs"
|
|
11
|
-
},
|
|
12
|
-
"./sdk": {
|
|
13
|
-
"types": "./sdk/index.d.mts",
|
|
14
|
-
"default": "./sdk/index.mjs"
|
|
15
|
-
},
|
|
16
|
-
"./sdk/client": {
|
|
17
|
-
"types": "./sdk/client.d.mts",
|
|
18
|
-
"default": "./sdk/client.mjs"
|
|
19
|
-
},
|
|
20
|
-
"./package.json": "./package.json"
|
|
21
|
-
},
|
|
22
|
-
"bin": {
|
|
23
|
-
"aw": "bin/aw.mjs",
|
|
24
|
-
"agentworkshop": "bin/aw.mjs"
|
|
25
|
-
},
|
|
26
|
-
"files": [
|
|
27
|
-
"bin",
|
|
28
|
-
"cli",
|
|
29
|
-
"sdk",
|
|
30
|
-
"app",
|
|
31
|
-
"server",
|
|
32
|
-
"shared",
|
|
33
|
-
"i18n",
|
|
34
|
-
"public",
|
|
35
|
-
"scripts",
|
|
36
|
-
".AgentWorkShop/prompts",
|
|
37
|
-
"config.yml",
|
|
38
|
-
"nuxt.config.ts",
|
|
39
|
-
"tsconfig.json",
|
|
40
|
-
"uno.config.ts",
|
|
41
|
-
"docker-compose.yml",
|
|
42
|
-
".env.example",
|
|
43
|
-
"README-zh.md",
|
|
44
|
-
"docs/cli.md",
|
|
45
|
-
"docs/plugins.md",
|
|
46
|
-
"docs/sdk.md"
|
|
47
|
-
],
|
|
48
|
-
"packageManager": "pnpm@11.9.0",
|
|
49
|
-
"engines": {
|
|
50
|
-
"node": ">=23.4.0"
|
|
51
|
-
},
|
|
52
|
-
"scripts": {
|
|
53
|
-
"dev": "node bin/aw.mjs dev",
|
|
54
|
-
"build": "node bin/aw.mjs build",
|
|
55
|
-
"start": "node bin/aw.mjs start",
|
|
56
|
-
"generate": "nuxt generate",
|
|
57
|
-
"preview": "node bin/aw.mjs start",
|
|
58
|
-
"cli": "node bin/aw.mjs",
|
|
59
|
-
"postinstall": "node scripts/home-bootstrap.mjs",
|
|
60
|
-
"prepublishOnly": "node bin/aw.mjs build",
|
|
61
|
-
"lint": "eslint .",
|
|
62
|
-
"lint:fix": "eslint . --fix",
|
|
63
|
-
"typecheck": "nuxt typecheck",
|
|
64
|
-
"prepare": "husky",
|
|
65
|
-
"game:test": "tsx scripts/test-agent-brain.ts && tsx scripts/test-game-session.ts",
|
|
66
|
-
"test:api-live": "node scripts/api-live-e2e.mjs",
|
|
67
|
-
"game:verify": "node scripts/verify-game.mjs",
|
|
68
|
-
"game:build-assets": "node scripts/build-player-sheet.mjs",
|
|
69
|
-
"game:build-wuwa": "node scripts/build-wuwa-assets.mjs",
|
|
70
|
-
"game:build-models": "node scripts/build-character-models.mjs",
|
|
71
|
-
"game:build-world": "node scripts/build-world-map.mjs",
|
|
72
|
-
"game:build-model3d": "node scripts/build-model-3d.mjs"
|
|
73
|
-
},
|
|
74
|
-
"lint-staged": {
|
|
75
|
-
"*.{js,mjs,cjs,ts,vue}": "eslint --fix"
|
|
76
|
-
},
|
|
77
|
-
"dependencies": {
|
|
78
|
-
"@ant-design-vue/nuxt": "^1.4.6",
|
|
79
|
-
"@ant-design/icons-vue": "^7.0.1",
|
|
80
|
-
"@fontsource-variable/fraunces": "^5.3.0",
|
|
81
|
-
"@fontsource-variable/geist": "^5.3.0",
|
|
82
|
-
"@fontsource-variable/geist-mono": "^5.3.0",
|
|
83
|
-
"@fontsource-variable/inter": "^5.3.0",
|
|
84
|
-
"@fontsource/eb-garamond": "^5.3.0",
|
|
85
|
-
"@fontsource/ibm-plex-mono": "^5.3.0",
|
|
86
|
-
"@iconify-json/tabler": "^1.2.0",
|
|
87
|
-
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
88
|
-
"@nuxtjs/i18n": "^9.0.0",
|
|
89
|
-
"@pinia/nuxt": "^0.11.0",
|
|
90
|
-
"@unocss/nuxt": "^66.0.0",
|
|
91
|
-
"@unocss/preset-attributify": "^66.0.0",
|
|
92
|
-
"@unocss/preset-icons": "^66.7.5",
|
|
93
|
-
"@unocss/preset-typography": "^66.0.0",
|
|
94
|
-
"@vueuse/core": "^13.0.0",
|
|
95
|
-
"@vueuse/nuxt": "^13.0.0",
|
|
96
|
-
"@xterm/addon-fit": "^0.11.0",
|
|
97
|
-
"@xterm/xterm": "^6.0.0",
|
|
98
|
-
"ant-design-vue": "^4.2.6",
|
|
99
|
-
"axios": "^1.7.9",
|
|
100
|
-
"echarts": "^5.6.0",
|
|
101
|
-
"h3": "2.0.1-rc.26",
|
|
102
|
-
"js-yaml": "^4.1.0",
|
|
103
|
-
"modbus-serial": "^8.0.25",
|
|
104
|
-
"mqtt": "^5.15.2",
|
|
105
|
-
"node-opcua": "^2.178.0",
|
|
106
|
-
"nuxt": "^4.0.0",
|
|
107
|
-
"nuxt-auth-utils": "^0.5.0",
|
|
108
|
-
"pg": "^8.23.0",
|
|
109
|
-
"phaser": "^4.0.0",
|
|
110
|
-
"pinia": "^3.0.0",
|
|
111
|
-
"pinia-plugin-persistedstate": "^4.2.0",
|
|
112
|
-
"sqlite-vec": "^0.1.9",
|
|
113
|
-
"three": "^0.185.1",
|
|
114
|
-
"unocss": "^66.0.0",
|
|
115
|
-
"unplugin-icons": "^22.0.0",
|
|
116
|
-
"vue": "^3.5.13",
|
|
117
|
-
"vue-echarts": "^7.0.3",
|
|
118
|
-
"vue-router": "^4.5.0",
|
|
119
|
-
"zod": "^3.24.1"
|
|
120
|
-
},
|
|
121
|
-
"devDependencies": {
|
|
122
|
-
"@commitlint/cli": "^19.6.1",
|
|
123
|
-
"@commitlint/config-conventional": "^19.6.0",
|
|
124
|
-
"@nuxt/eslint": "^1.0.0",
|
|
125
|
-
"@types/js-yaml": "^4.0.9",
|
|
126
|
-
"@types/node": "^26.2.0",
|
|
127
|
-
"@types/three": "^0.185.4",
|
|
128
|
-
"eslint": "^9.17.0",
|
|
129
|
-
"husky": "^9.1.7",
|
|
130
|
-
"lint-staged": "^15.3.0",
|
|
131
|
-
"pngjs": "^7.0.0",
|
|
132
|
-
"puppeteer-core": "^25.5.0",
|
|
133
|
-
"tsx": "^4.23.12",
|
|
134
|
-
"typescript": "^5.7.3",
|
|
135
|
-
"vue-tsc": "^3.3.10"
|
|
136
|
-
},
|
|
137
|
-
"pnpm": {
|
|
138
|
-
"ignoredBuiltDependencies": [
|
|
139
|
-
"@serialport/bindings-cpp"
|
|
140
|
-
]
|
|
141
|
-
}
|
|
142
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "agentworkshop",
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "AgentWorkShop 软件开发系统 - 基于 Nuxt 4 的配置驱动运行范式",
|
|
6
|
+
"license": "PolyForm-Noncommercial-1.0.0",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./sdk/index.d.mts",
|
|
10
|
+
"default": "./sdk/index.mjs"
|
|
11
|
+
},
|
|
12
|
+
"./sdk": {
|
|
13
|
+
"types": "./sdk/index.d.mts",
|
|
14
|
+
"default": "./sdk/index.mjs"
|
|
15
|
+
},
|
|
16
|
+
"./sdk/client": {
|
|
17
|
+
"types": "./sdk/client.d.mts",
|
|
18
|
+
"default": "./sdk/client.mjs"
|
|
19
|
+
},
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"bin": {
|
|
23
|
+
"aw": "bin/aw.mjs",
|
|
24
|
+
"agentworkshop": "bin/aw.mjs"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"bin",
|
|
28
|
+
"cli",
|
|
29
|
+
"sdk",
|
|
30
|
+
"app",
|
|
31
|
+
"server",
|
|
32
|
+
"shared",
|
|
33
|
+
"i18n",
|
|
34
|
+
"public",
|
|
35
|
+
"scripts",
|
|
36
|
+
".AgentWorkShop/prompts",
|
|
37
|
+
"config.yml",
|
|
38
|
+
"nuxt.config.ts",
|
|
39
|
+
"tsconfig.json",
|
|
40
|
+
"uno.config.ts",
|
|
41
|
+
"docker-compose.yml",
|
|
42
|
+
".env.example",
|
|
43
|
+
"README-zh.md",
|
|
44
|
+
"docs/cli.md",
|
|
45
|
+
"docs/plugins.md",
|
|
46
|
+
"docs/sdk.md"
|
|
47
|
+
],
|
|
48
|
+
"packageManager": "pnpm@11.9.0",
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=23.4.0"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"dev": "node bin/aw.mjs dev",
|
|
54
|
+
"build": "node bin/aw.mjs build",
|
|
55
|
+
"start": "node bin/aw.mjs start",
|
|
56
|
+
"generate": "nuxt generate",
|
|
57
|
+
"preview": "node bin/aw.mjs start",
|
|
58
|
+
"cli": "node bin/aw.mjs",
|
|
59
|
+
"postinstall": "node scripts/home-bootstrap.mjs",
|
|
60
|
+
"prepublishOnly": "node bin/aw.mjs build",
|
|
61
|
+
"lint": "eslint .",
|
|
62
|
+
"lint:fix": "eslint . --fix",
|
|
63
|
+
"typecheck": "nuxt typecheck",
|
|
64
|
+
"prepare": "husky",
|
|
65
|
+
"game:test": "tsx scripts/test-agent-brain.ts && tsx scripts/test-game-session.ts",
|
|
66
|
+
"test:api-live": "node scripts/api-live-e2e.mjs",
|
|
67
|
+
"game:verify": "node scripts/verify-game.mjs",
|
|
68
|
+
"game:build-assets": "node scripts/build-player-sheet.mjs",
|
|
69
|
+
"game:build-wuwa": "node scripts/build-wuwa-assets.mjs",
|
|
70
|
+
"game:build-models": "node scripts/build-character-models.mjs",
|
|
71
|
+
"game:build-world": "node scripts/build-world-map.mjs",
|
|
72
|
+
"game:build-model3d": "node scripts/build-model-3d.mjs"
|
|
73
|
+
},
|
|
74
|
+
"lint-staged": {
|
|
75
|
+
"*.{js,mjs,cjs,ts,vue}": "eslint --fix"
|
|
76
|
+
},
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"@ant-design-vue/nuxt": "^1.4.6",
|
|
79
|
+
"@ant-design/icons-vue": "^7.0.1",
|
|
80
|
+
"@fontsource-variable/fraunces": "^5.3.0",
|
|
81
|
+
"@fontsource-variable/geist": "^5.3.0",
|
|
82
|
+
"@fontsource-variable/geist-mono": "^5.3.0",
|
|
83
|
+
"@fontsource-variable/inter": "^5.3.0",
|
|
84
|
+
"@fontsource/eb-garamond": "^5.3.0",
|
|
85
|
+
"@fontsource/ibm-plex-mono": "^5.3.0",
|
|
86
|
+
"@iconify-json/tabler": "^1.2.0",
|
|
87
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
88
|
+
"@nuxtjs/i18n": "^9.0.0",
|
|
89
|
+
"@pinia/nuxt": "^0.11.0",
|
|
90
|
+
"@unocss/nuxt": "^66.0.0",
|
|
91
|
+
"@unocss/preset-attributify": "^66.0.0",
|
|
92
|
+
"@unocss/preset-icons": "^66.7.5",
|
|
93
|
+
"@unocss/preset-typography": "^66.0.0",
|
|
94
|
+
"@vueuse/core": "^13.0.0",
|
|
95
|
+
"@vueuse/nuxt": "^13.0.0",
|
|
96
|
+
"@xterm/addon-fit": "^0.11.0",
|
|
97
|
+
"@xterm/xterm": "^6.0.0",
|
|
98
|
+
"ant-design-vue": "^4.2.6",
|
|
99
|
+
"axios": "^1.7.9",
|
|
100
|
+
"echarts": "^5.6.0",
|
|
101
|
+
"h3": "2.0.1-rc.26",
|
|
102
|
+
"js-yaml": "^4.1.0",
|
|
103
|
+
"modbus-serial": "^8.0.25",
|
|
104
|
+
"mqtt": "^5.15.2",
|
|
105
|
+
"node-opcua": "^2.178.0",
|
|
106
|
+
"nuxt": "^4.0.0",
|
|
107
|
+
"nuxt-auth-utils": "^0.5.0",
|
|
108
|
+
"pg": "^8.23.0",
|
|
109
|
+
"phaser": "^4.0.0",
|
|
110
|
+
"pinia": "^3.0.0",
|
|
111
|
+
"pinia-plugin-persistedstate": "^4.2.0",
|
|
112
|
+
"sqlite-vec": "^0.1.9",
|
|
113
|
+
"three": "^0.185.1",
|
|
114
|
+
"unocss": "^66.0.0",
|
|
115
|
+
"unplugin-icons": "^22.0.0",
|
|
116
|
+
"vue": "^3.5.13",
|
|
117
|
+
"vue-echarts": "^7.0.3",
|
|
118
|
+
"vue-router": "^4.5.0",
|
|
119
|
+
"zod": "^3.24.1"
|
|
120
|
+
},
|
|
121
|
+
"devDependencies": {
|
|
122
|
+
"@commitlint/cli": "^19.6.1",
|
|
123
|
+
"@commitlint/config-conventional": "^19.6.0",
|
|
124
|
+
"@nuxt/eslint": "^1.0.0",
|
|
125
|
+
"@types/js-yaml": "^4.0.9",
|
|
126
|
+
"@types/node": "^26.2.0",
|
|
127
|
+
"@types/three": "^0.185.4",
|
|
128
|
+
"eslint": "^9.17.0",
|
|
129
|
+
"husky": "^9.1.7",
|
|
130
|
+
"lint-staged": "^15.3.0",
|
|
131
|
+
"pngjs": "^7.0.0",
|
|
132
|
+
"puppeteer-core": "^25.5.0",
|
|
133
|
+
"tsx": "^4.23.12",
|
|
134
|
+
"typescript": "^5.7.3",
|
|
135
|
+
"vue-tsc": "^3.3.10"
|
|
136
|
+
},
|
|
137
|
+
"pnpm": {
|
|
138
|
+
"ignoredBuiltDependencies": [
|
|
139
|
+
"@serialport/bindings-cpp"
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -31,9 +31,7 @@ const main = async () => {
|
|
|
31
31
|
const token = reg?.data?.token ?? reg?.data?.session?.token
|
|
32
32
|
if (token) {
|
|
33
33
|
await page.evaluate((t) => {
|
|
34
|
-
|
|
35
|
-
localStorage.setItem('token', t)
|
|
36
|
-
document.cookie = `aw_token=${t}; path=/`
|
|
34
|
+
document.cookie = `token=${t}; path=/`
|
|
37
35
|
}, token)
|
|
38
36
|
}
|
|
39
37
|
console.log('registered:', !!token)
|