agent-steward 0.0.0-stage → 0.0.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 +376 -0
- package/CROSS_PLATFORM.md +149 -0
- package/LICENSE +21 -0
- package/README.md +314 -2
- package/ROADMAP-STRATEGY.md +147 -0
- package/ROADMAP.md +1069 -0
- package/dist/core/analytics.d.ts +132 -0
- package/dist/core/analytics.d.ts.map +1 -0
- package/dist/core/analytics.js +290 -0
- package/dist/core/audit.d.ts +96 -0
- package/dist/core/audit.d.ts.map +1 -0
- package/dist/core/audit.js +297 -0
- package/dist/core/cron-to-schtasks.d.ts +20 -0
- package/dist/core/cron-to-schtasks.d.ts.map +1 -0
- package/dist/core/cron-to-schtasks.js +250 -0
- package/dist/core/dry-run.d.ts +102 -0
- package/dist/core/dry-run.d.ts.map +1 -0
- package/dist/core/dry-run.js +447 -0
- package/dist/core/file-watcher.d.ts +31 -0
- package/dist/core/file-watcher.d.ts.map +1 -0
- package/dist/core/file-watcher.js +186 -0
- package/dist/core/git-trigger.d.ts +82 -0
- package/dist/core/git-trigger.d.ts.map +1 -0
- package/dist/core/git-trigger.js +312 -0
- package/dist/core/glob.d.ts +38 -0
- package/dist/core/glob.d.ts.map +1 -0
- package/dist/core/glob.js +233 -0
- package/dist/core/local-ai.d.ts +52 -0
- package/dist/core/local-ai.d.ts.map +1 -0
- package/dist/core/local-ai.js +119 -0
- package/dist/core/lock.d.ts +57 -0
- package/dist/core/lock.d.ts.map +1 -0
- package/dist/core/lock.js +195 -0
- package/dist/core/matrix.d.ts +167 -0
- package/dist/core/matrix.d.ts.map +1 -0
- package/dist/core/matrix.js +724 -0
- package/dist/core/native-notify.d.ts +36 -0
- package/dist/core/native-notify.d.ts.map +1 -0
- package/dist/core/native-notify.js +113 -0
- package/dist/core/one-shot.d.ts +68 -0
- package/dist/core/one-shot.d.ts.map +1 -0
- package/dist/core/one-shot.js +139 -0
- package/dist/core/otel.d.ts +4 -0
- package/dist/core/otel.d.ts.map +1 -0
- package/dist/core/otel.js +98 -0
- package/dist/core/permissions.d.ts +69 -0
- package/dist/core/permissions.d.ts.map +1 -0
- package/dist/core/permissions.js +143 -0
- package/dist/core/prometheus.d.ts +23 -0
- package/dist/core/prometheus.d.ts.map +1 -0
- package/dist/core/prometheus.js +146 -0
- package/dist/core/ps-wrapper.d.ts +73 -0
- package/dist/core/ps-wrapper.d.ts.map +1 -0
- package/dist/core/ps-wrapper.js +1071 -0
- package/dist/core/record-history.d.ts +25 -0
- package/dist/core/record-history.d.ts.map +1 -0
- package/dist/core/record-history.js +471 -0
- package/dist/core/retention.d.ts +29 -0
- package/dist/core/retention.d.ts.map +1 -0
- package/dist/core/retention.js +98 -0
- package/dist/core/savings.d.ts +70 -0
- package/dist/core/savings.d.ts.map +1 -0
- package/dist/core/savings.js +87 -0
- package/dist/core/schedule-gate.d.ts +2 -0
- package/dist/core/schedule-gate.d.ts.map +1 -0
- package/dist/core/schedule-gate.js +211 -0
- package/dist/core/schedule-v2.d.ts +116 -0
- package/dist/core/schedule-v2.d.ts.map +1 -0
- package/dist/core/schedule-v2.js +586 -0
- package/dist/core/scheduler/index.d.ts +32 -0
- package/dist/core/scheduler/index.d.ts.map +1 -0
- package/dist/core/scheduler/index.js +63 -0
- package/dist/core/scheduler/linux.d.ts +44 -0
- package/dist/core/scheduler/linux.d.ts.map +1 -0
- package/dist/core/scheduler/linux.js +225 -0
- package/dist/core/scheduler/logs.d.ts +11 -0
- package/dist/core/scheduler/logs.d.ts.map +1 -0
- package/dist/core/scheduler/logs.js +34 -0
- package/dist/core/scheduler/mac.d.ts +40 -0
- package/dist/core/scheduler/mac.d.ts.map +1 -0
- package/dist/core/scheduler/mac.js +207 -0
- package/dist/core/scheduler/posix.d.ts +40 -0
- package/dist/core/scheduler/posix.d.ts.map +1 -0
- package/dist/core/scheduler/posix.js +89 -0
- package/dist/core/scheduler/registry.d.ts +41 -0
- package/dist/core/scheduler/registry.d.ts.map +1 -0
- package/dist/core/scheduler/registry.js +57 -0
- package/dist/core/scheduler/types.d.ts +86 -0
- package/dist/core/scheduler/types.d.ts.map +1 -0
- package/dist/core/scheduler/types.js +1 -0
- package/dist/core/scheduler/windows.d.ts +99 -0
- package/dist/core/scheduler/windows.d.ts.map +1 -0
- package/dist/core/scheduler/windows.js +596 -0
- package/dist/core/secrets.d.ts +66 -0
- package/dist/core/secrets.d.ts.map +1 -0
- package/dist/core/secrets.js +433 -0
- package/dist/core/self-analysis.d.ts +117 -0
- package/dist/core/self-analysis.d.ts.map +1 -0
- package/dist/core/self-analysis.js +539 -0
- package/dist/core/self-analysis.test.d.ts +2 -0
- package/dist/core/self-analysis.test.d.ts.map +1 -0
- package/dist/core/self-analysis.test.js +219 -0
- package/dist/core/session.d.ts +42 -0
- package/dist/core/session.d.ts.map +1 -0
- package/dist/core/session.js +134 -0
- package/dist/core/shutdown.d.ts +26 -0
- package/dist/core/shutdown.d.ts.map +1 -0
- package/dist/core/shutdown.js +49 -0
- package/dist/core/structured-log.d.ts +84 -0
- package/dist/core/structured-log.d.ts.map +1 -0
- package/dist/core/structured-log.js +146 -0
- package/dist/core/summary.d.ts +69 -0
- package/dist/core/summary.d.ts.map +1 -0
- package/dist/core/summary.js +250 -0
- package/dist/core/telegram.d.ts +55 -0
- package/dist/core/telegram.d.ts.map +1 -0
- package/dist/core/telegram.js +344 -0
- package/dist/core/triage-chain.d.ts +40 -0
- package/dist/core/triage-chain.d.ts.map +1 -0
- package/dist/core/triage-chain.js +80 -0
- package/dist/core/triage-compare.d.ts +68 -0
- package/dist/core/triage-compare.d.ts.map +1 -0
- package/dist/core/triage-compare.js +184 -0
- package/dist/core/triage-rules.d.ts +23 -0
- package/dist/core/triage-rules.d.ts.map +1 -0
- package/dist/core/triage-rules.js +196 -0
- package/dist/core/triage-shadow.d.ts +91 -0
- package/dist/core/triage-shadow.d.ts.map +1 -0
- package/dist/core/triage-shadow.js +160 -0
- package/dist/core/triage-worker.d.ts +55 -0
- package/dist/core/triage-worker.d.ts.map +1 -0
- package/dist/core/triage-worker.js +314 -0
- package/dist/core/triage.d.ts +76 -0
- package/dist/core/triage.d.ts.map +1 -0
- package/dist/core/triage.js +271 -0
- package/dist/core/watch-paths.d.ts +6 -0
- package/dist/core/watch-paths.d.ts.map +1 -0
- package/dist/core/watch-paths.js +62 -0
- package/dist/core/wrappers/bash.d.ts +95 -0
- package/dist/core/wrappers/bash.d.ts.map +1 -0
- package/dist/core/wrappers/bash.js +413 -0
- package/dist/db/git-state-repo.d.ts +16 -0
- package/dist/db/git-state-repo.d.ts.map +1 -0
- package/dist/db/git-state-repo.js +38 -0
- package/dist/db/history-repo.d.ts +110 -0
- package/dist/db/history-repo.d.ts.map +1 -0
- package/dist/db/history-repo.js +300 -0
- package/dist/db/index.d.ts +47 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +120 -0
- package/dist/db/metrics-repo.d.ts +46 -0
- package/dist/db/metrics-repo.d.ts.map +1 -0
- package/dist/db/metrics-repo.js +103 -0
- package/dist/db/migrate.d.ts +24 -0
- package/dist/db/migrate.d.ts.map +1 -0
- package/dist/db/migrate.js +244 -0
- package/dist/db/recovery.d.ts +11 -0
- package/dist/db/recovery.d.ts.map +1 -0
- package/dist/db/recovery.js +38 -0
- package/dist/db/schema.d.ts +24 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +170 -0
- package/dist/db/settings-repo.d.ts +8 -0
- package/dist/db/settings-repo.d.ts.map +1 -0
- package/dist/db/settings-repo.js +27 -0
- package/dist/db/tasks-repo.d.ts +26 -0
- package/dist/db/tasks-repo.d.ts.map +1 -0
- package/dist/db/tasks-repo.js +120 -0
- package/dist/db/templates-repo.d.ts +17 -0
- package/dist/db/templates-repo.d.ts.map +1 -0
- package/dist/db/templates-repo.js +57 -0
- package/dist/gui-experimental.cjs +1 -0
- package/dist/history.d.ts +60 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +70 -0
- package/dist/i18n.d.ts +75 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +357 -0
- package/dist/index.d.ts +858 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5179 -0
- package/dist/integrations.d.ts +72 -0
- package/dist/integrations.d.ts.map +1 -0
- package/dist/integrations.js +233 -0
- package/dist/notifications.d.ts +199 -0
- package/dist/notifications.d.ts.map +1 -0
- package/dist/notifications.js +967 -0
- package/dist/profiles.d.ts +60 -0
- package/dist/profiles.d.ts.map +1 -0
- package/dist/profiles.js +227 -0
- package/dist/rpc.d.ts +3806 -0
- package/dist/rpc.d.ts.map +1 -0
- package/dist/rpc.js +1507 -0
- package/dist/schtasks.d.ts +32 -0
- package/dist/schtasks.d.ts.map +1 -0
- package/dist/schtasks.js +45 -0
- package/dist/server.d.ts +128 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +2413 -0
- package/dist/settings.d.ts +389 -0
- package/dist/settings.d.ts.map +1 -0
- package/dist/settings.js +770 -0
- package/dist/shared/jobs-view.d.ts +59 -0
- package/dist/shared/jobs-view.d.ts.map +1 -0
- package/dist/shared/jobs-view.js +146 -0
- package/dist/skill.d.ts +15 -0
- package/dist/skill.d.ts.map +1 -0
- package/dist/skill.js +93 -0
- package/dist/task-transfer.d.ts +252 -0
- package/dist/task-transfer.d.ts.map +1 -0
- package/dist/task-transfer.js +628 -0
- package/dist/templates.d.ts +57 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +16 -0
- package/dist/types.d.ts +96 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +130 -0
- package/dist/version.d.ts +8 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +27 -0
- package/dist/workspaces.d.ts +113 -0
- package/dist/workspaces.d.ts.map +1 -0
- package/dist/workspaces.js +393 -0
- package/docs/ARCHITECTURE.md +457 -0
- package/docs/COMPATIBILITY.md +233 -0
- package/docs/CONCEPT.md +230 -0
- package/docs/CROSS_PLATFORM.ru.md +150 -0
- package/docs/CROSS_PLATFORM.zh.md +146 -0
- package/docs/FAQ.md +52 -0
- package/docs/FAQ.ru.md +53 -0
- package/docs/FAQ.zh.md +43 -0
- package/docs/FEATURES.md +698 -0
- package/docs/FEATURES.zh.md +655 -0
- package/docs/LOCAL-AI.md +300 -0
- package/docs/MIGRATION.md +355 -0
- package/docs/README.ru.md +268 -0
- package/docs/README.zh.md +305 -0
- package/docs/SAVINGS.md +61 -0
- package/docs/SAVINGS.ru.md +60 -0
- package/docs/SAVINGS.zh.md +52 -0
- package/docs/V1-V2-COMPATIBILITY-PLAN.md +366 -0
- package/docs/ZH-LOCALE-PLAN.md +324 -0
- package/docs/dashboard.png +0 -0
- package/docs/spikes/local-model-structured-output.md +81 -0
- package/docs/spikes/ollama-qwen3-4b-smoke.json +28 -0
- package/docs/spikes/ollama-qwen3-4b.json +163 -0
- package/gui-experimental.cjs +9 -0
- package/index.js +1 -0
- package/locales/en.json +780 -0
- package/locales/ru.json +780 -0
- package/locales/zh.json +780 -0
- package/package.json +149 -4
- package/scripts/bench-local.mjs +321 -0
- package/scripts/check-zh-locale.mjs +218 -0
- package/scripts/demo-dashboard.mjs +209 -0
- package/scripts/run-tests.mjs +236 -0
- package/scripts/spike-local-structured.mjs +182 -0
- package/scripts/test-locale.mjs +45 -0
- package/skills/scheduled-job-best-practices/SKILL.md +158 -0
- package/skills/scheduled-job-best-practices/references/recipes.md +163 -0
- package/src/core/analytics.ts +424 -0
- package/src/core/audit.ts +418 -0
- package/src/core/cron-to-schtasks.ts +288 -0
- package/src/core/dry-run.ts +601 -0
- package/src/core/file-watcher.ts +245 -0
- package/src/core/git-trigger.ts +391 -0
- package/src/core/glob.ts +226 -0
- package/src/core/local-ai.ts +173 -0
- package/src/core/lock.ts +219 -0
- package/src/core/matrix.ts +947 -0
- package/src/core/native-notify.ts +157 -0
- package/src/core/one-shot.ts +189 -0
- package/src/core/otel.ts +128 -0
- package/src/core/permissions.ts +200 -0
- package/src/core/prometheus.ts +215 -0
- package/src/core/ps-wrapper.ts +1140 -0
- package/src/core/record-history.ts +615 -0
- package/src/core/retention.ts +141 -0
- package/src/core/savings.ts +150 -0
- package/src/core/schedule-gate.ts +253 -0
- package/src/core/schedule-v2.ts +668 -0
- package/src/core/scheduler/index.ts +82 -0
- package/src/core/scheduler/linux.ts +257 -0
- package/src/core/scheduler/logs.ts +37 -0
- package/src/core/scheduler/mac.ts +270 -0
- package/src/core/scheduler/posix.ts +114 -0
- package/src/core/scheduler/registry.ts +99 -0
- package/src/core/scheduler/types.ts +90 -0
- package/src/core/scheduler/windows.ts +711 -0
- package/src/core/secrets.ts +503 -0
- package/src/core/self-analysis.ts +744 -0
- package/src/core/session.ts +150 -0
- package/src/core/shutdown.ts +69 -0
- package/src/core/structured-log.ts +214 -0
- package/src/core/summary.ts +318 -0
- package/src/core/telegram.ts +436 -0
- package/src/core/triage-chain.ts +125 -0
- package/src/core/triage-compare.ts +277 -0
- package/src/core/triage-rules.ts +238 -0
- package/src/core/triage-shadow.ts +240 -0
- package/src/core/triage-worker.ts +344 -0
- package/src/core/triage.ts +366 -0
- package/src/core/watch-paths.ts +70 -0
- package/src/core/wrappers/bash.ts +532 -0
- package/src/db/git-state-repo.ts +62 -0
- package/src/db/history-repo.ts +492 -0
- package/src/db/index.ts +166 -0
- package/src/db/metrics-repo.ts +170 -0
- package/src/db/migrate.ts +328 -0
- package/src/db/recovery.ts +46 -0
- package/src/db/schema.ts +188 -0
- package/src/db/settings-repo.ts +31 -0
- package/src/db/tasks-repo.ts +162 -0
- package/src/db/templates-repo.ts +77 -0
- package/src/gui.tsx +5222 -0
- package/src/history.ts +128 -0
- package/src/i18n.ts +413 -0
- package/src/index.ts +6605 -0
- package/src/integrations.ts +297 -0
- package/src/notifications.ts +1346 -0
- package/src/profiles.ts +254 -0
- package/src/rpc.ts +1609 -0
- package/src/schtasks.ts +75 -0
- package/src/server.ts +2662 -0
- package/src/settings.ts +1369 -0
- package/src/shared/jobs-view.ts +188 -0
- package/src/skill.ts +113 -0
- package/src/task-transfer.ts +944 -0
- package/src/templates.ts +67 -0
- package/src/tui-v1.tsx +341 -0
- package/src/tui.tsx +329 -0
- package/src/types.ts +191 -0
- package/src/version.ts +27 -0
- package/src/workspaces.ts +487 -0
package/package.json
CHANGED
|
@@ -1,6 +1,151 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-steward",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "OpenCode v2 plugin for scheduling and orchestrating AI agent jobs: cron, one-shot runs, DAG pipelines, matrix builds, quality gates, SQLite history, metrics and a local web dashboard. Windows, macOS and Linux. Free and open source (MIT).",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "agent-steward contributors",
|
|
7
|
+
"homepage": "https://github.com/DeadSno/agent-steward#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/DeadSno/agent-steward.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/DeadSno/agent-steward/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"opencode",
|
|
17
|
+
"opencode-plugin",
|
|
18
|
+
"opencode-v2",
|
|
19
|
+
"scheduler",
|
|
20
|
+
"cron",
|
|
21
|
+
"task-scheduler",
|
|
22
|
+
"windows-scheduler",
|
|
23
|
+
"launchd",
|
|
24
|
+
"systemd",
|
|
25
|
+
"ai-agents",
|
|
26
|
+
"ai-automation",
|
|
27
|
+
"agent-orchestration",
|
|
28
|
+
"workflow-orchestration",
|
|
29
|
+
"workflow-automation",
|
|
30
|
+
"job-scheduler",
|
|
31
|
+
"dag",
|
|
32
|
+
"matrix-builds",
|
|
33
|
+
"quality-gates",
|
|
34
|
+
"observability",
|
|
35
|
+
"local-first"
|
|
36
|
+
],
|
|
37
|
+
"main": "dist/index.js",
|
|
38
|
+
"types": "dist/index.d.ts",
|
|
39
|
+
"type": "module",
|
|
40
|
+
"exports": {
|
|
41
|
+
".": "./dist/index.js",
|
|
42
|
+
"./tui": "./src/tui.tsx",
|
|
43
|
+
"./gui-experimental": "./gui-experimental.cjs"
|
|
44
|
+
},
|
|
45
|
+
"files": [
|
|
46
|
+
"dist",
|
|
47
|
+
"src",
|
|
48
|
+
"index.js",
|
|
49
|
+
"gui-experimental.cjs",
|
|
50
|
+
"skills",
|
|
51
|
+
"locales",
|
|
52
|
+
"scripts",
|
|
53
|
+
"docs",
|
|
54
|
+
"README.md",
|
|
55
|
+
"LICENSE",
|
|
56
|
+
"CHANGELOG.md",
|
|
57
|
+
"CROSS_PLATFORM.md",
|
|
58
|
+
"ROADMAP.md",
|
|
59
|
+
"ROADMAP-STRATEGY.md"
|
|
60
|
+
],
|
|
61
|
+
"engines": {
|
|
62
|
+
"node": ">=22.22.0"
|
|
63
|
+
},
|
|
64
|
+
"publishConfig": {
|
|
65
|
+
"access": "public"
|
|
66
|
+
},
|
|
67
|
+
"scripts": {
|
|
68
|
+
"build": "tsc",
|
|
69
|
+
"build:gui": "vite build",
|
|
70
|
+
"demo": "node scripts/demo-dashboard.mjs",
|
|
71
|
+
"bench:local": "node scripts/bench-local.mjs",
|
|
72
|
+
"prepare": "npm run build",
|
|
73
|
+
"prepublishOnly": "npm run build && npm run build:gui",
|
|
74
|
+
"pretest": "npm run build",
|
|
75
|
+
"test": "node test-sqlite.mjs && node test-crash-recovery.mjs && node test-workspaces.mjs && node test-role-scoped.mjs && node test-permissions-policy.mjs && node test-dry-run.mjs && node test-matrix.mjs && node test-matrix-lifecycle.mjs && node test-matrix-sync.mjs && node test-retention.mjs && node test-metrics.mjs && node test-savings.mjs && node test-schedule-v2.mjs && node test-notifications-v2.mjs && node test-notifications-dedup.mjs && node test-notifications-embedding.mjs && node test-notifications-summary.mjs && node test-settings.mjs && node test-notifications-v3.mjs && node test-triage.mjs && node test-triage-rules.mjs && node test-triage-compare.mjs && node test-triage-chain.mjs && node test-triage-shadow.mjs && node test-triage-audit.mjs && node test-triage-async.mjs && node test-local-ai.mjs && node test-secrets.mjs && node test-audit.mjs && node test-profiles.mjs && node test-env.mjs && node test-agent-tools.mjs && node test-skill.mjs && node test-integrations.mjs && node test-one-shot.mjs && node test-session-continuity.mjs && node test-task-status.mjs && node test-jobs-view.mjs && node test-dag.mjs && node test-dashboard.mjs && node test-dashboard-trust.mjs && node test-dashboard-dag.mjs && node test-dashboard-json.mjs && node test-docs.mjs && node test-glob.mjs && node test-git-trigger.mjs && node test-window-v3.mjs && node test-i18n.mjs && node test-gui-bundle.mjs && node test-stale-lock.mjs && node test-task-name-limit.mjs && node test-task-name-limit-profile.mjs && node test-delete-profile.mjs && node test-execution-hardening.mjs && node test-path-safety.mjs && node test-watch-paths.mjs && node test-windows-oem.mjs && node test-schtasks-errors.mjs && node test-shutdown.mjs && node test-dual-entry.mjs && node test-v1-integration.mjs && node test-usage-from-log.mjs && node test-posix-e2e.mjs",
|
|
76
|
+
"test:sqlite": "node test-sqlite.mjs",
|
|
77
|
+
"test:crash": "node test-crash-recovery.mjs",
|
|
78
|
+
"test:workspaces": "node test-workspaces.mjs",
|
|
79
|
+
"test:role": "node test-role-scoped.mjs",
|
|
80
|
+
"test:dry-run": "node test-dry-run.mjs",
|
|
81
|
+
"test:matrix": "node test-matrix.mjs",
|
|
82
|
+
"test:matrix-lifecycle": "node test-matrix-lifecycle.mjs",
|
|
83
|
+
"test:matrix-sync": "node test-matrix-sync.mjs",
|
|
84
|
+
"test:retention": "node test-retention.mjs",
|
|
85
|
+
"test:metrics": "node test-metrics.mjs",
|
|
86
|
+
"test:schedule-v2": "node test-schedule-v2.mjs",
|
|
87
|
+
"test:notifications-v2": "node test-notifications-v2.mjs",
|
|
88
|
+
"test:notifications-v3": "node test-notifications-v3.mjs",
|
|
89
|
+
"test:settings": "node test-settings.mjs",
|
|
90
|
+
"test:triage": "node test-triage.mjs",
|
|
91
|
+
"test:triage-rules": "node test-triage-rules.mjs",
|
|
92
|
+
"test:triage-chain": "node test-triage-chain.mjs",
|
|
93
|
+
"test:triage-shadow": "node test-triage-shadow.mjs",
|
|
94
|
+
"test:triage-audit": "node test-triage-audit.mjs",
|
|
95
|
+
"test:triage-async": "node test-triage-async.mjs",
|
|
96
|
+
"test:local-ai": "node test-local-ai.mjs",
|
|
97
|
+
"test:secrets": "node test-secrets.mjs",
|
|
98
|
+
"test:audit": "node test-audit.mjs",
|
|
99
|
+
"test:profiles": "node test-profiles.mjs",
|
|
100
|
+
"test:env": "node test-env.mjs",
|
|
101
|
+
"test:agent": "node test-agent-tools.mjs",
|
|
102
|
+
"test:skill": "node test-skill.mjs",
|
|
103
|
+
"test:integrations": "node test-integrations.mjs",
|
|
104
|
+
"test:session-continuity": "node test-session-continuity.mjs",
|
|
105
|
+
"test:task-status": "node test-task-status.mjs",
|
|
106
|
+
"test:jobs-view": "node test-jobs-view.mjs",
|
|
107
|
+
"test:one-shot": "node test-one-shot.mjs",
|
|
108
|
+
"test:dag": "node test-dag.mjs",
|
|
109
|
+
"test:dashboard": "node test-dashboard.mjs",
|
|
110
|
+
"test:dashboard-dag": "node test-dashboard-dag.mjs",
|
|
111
|
+
"test:dashboard-json": "node test-dashboard-json.mjs",
|
|
112
|
+
"test:docs": "node test-docs.mjs",
|
|
113
|
+
"test:glob": "node test-glob.mjs",
|
|
114
|
+
"test:git-trigger": "node test-git-trigger.mjs",
|
|
115
|
+
"test:window-v3": "node test-window-v3.mjs",
|
|
116
|
+
"test:self-analysis": "node test-self-analysis.mjs",
|
|
117
|
+
"test:i18n": "node test-i18n.mjs",
|
|
118
|
+
"test:gui-bundle": "node test-gui-bundle.mjs",
|
|
119
|
+
"test:stale-lock": "node test-stale-lock.mjs",
|
|
120
|
+
"test:task-name-limit": "node test-task-name-limit.mjs && node test-task-name-limit-profile.mjs",
|
|
121
|
+
"test:delete-profile": "node test-delete-profile.mjs",
|
|
122
|
+
"test:windows-oem": "node test-windows-oem.mjs",
|
|
123
|
+
"test:schtasks-errors": "node test-schtasks-errors.mjs",
|
|
124
|
+
"test:shutdown": "node test-shutdown.mjs",
|
|
125
|
+
"test:usage-from-log": "node test-usage-from-log.mjs",
|
|
126
|
+
"test:posix-e2e": "node test-posix-e2e.mjs",
|
|
127
|
+
"test:watch-paths": "node test-watch-paths.mjs",
|
|
128
|
+
"test:en": "node scripts/test-locale.mjs en",
|
|
129
|
+
"test:zh": "node scripts/test-locale.mjs zh",
|
|
130
|
+
"test:parallel": "node scripts/run-tests.mjs",
|
|
131
|
+
"test:parallel:en": "node scripts/run-tests.mjs --locale=en",
|
|
132
|
+
"test:parallel:zh": "node scripts/run-tests.mjs --locale=zh"
|
|
133
|
+
},
|
|
134
|
+
"dependencies": {
|
|
135
|
+
"@opencode/plugin": "^2.2.7",
|
|
136
|
+
"@opencode/schema": "^2.2.7",
|
|
137
|
+
"chokidar": "^6.0.0",
|
|
138
|
+
"iconv-lite": "^0.7.3",
|
|
139
|
+
"zod": "^4.6.7"
|
|
140
|
+
},
|
|
141
|
+
"devDependencies": {
|
|
142
|
+
"@opencode-ai/plugin": "1.19.5",
|
|
143
|
+
"@opentui/core": ">=0.8.1",
|
|
144
|
+
"@opentui/solid": ">=0.8.1",
|
|
145
|
+
"@types/node": "^22.0.0",
|
|
146
|
+
"solid-js": "^1.9.0",
|
|
147
|
+
"typescript": "^5.9.3",
|
|
148
|
+
"vite": "^7.0.0",
|
|
149
|
+
"vite-plugin-solid": "^2.11.0"
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Бенчмарк локальной модели для триажа уведомлений (Спринт 30.8).
|
|
3
|
+
*
|
|
4
|
+
* Запуск:
|
|
5
|
+
* node scripts/bench-local.mjs --model qwen3:4b --runs 3
|
|
6
|
+
*
|
|
7
|
+
* Скрипт не входит в `npm test`: он требует запущенную Ollama и скачанную
|
|
8
|
+
* модель. Цель — измерить скорость (tok/s), латентность и долю схемо-валидных
|
|
9
|
+
* ответов, подобрать тир по объёму RAM и выдать версионированный JSON,
|
|
10
|
+
* пригодный для краудсорсинга (`--out`).
|
|
11
|
+
*
|
|
12
|
+
* Без Ollama скрипт не падает молча: он печатает понятную ошибку и всё равно
|
|
13
|
+
* формирует валидный JSON с `available: false`, чтобы замер можно было
|
|
14
|
+
* приложить к отчёту.
|
|
15
|
+
*/
|
|
16
|
+
import fs from "node:fs";
|
|
17
|
+
import os from "node:os";
|
|
18
|
+
import path from "node:path";
|
|
19
|
+
|
|
20
|
+
const SCHEMA_VERSION = "1";
|
|
21
|
+
|
|
22
|
+
const DEFAULTS = {
|
|
23
|
+
baseUrl: "http://127.0.0.1:11434",
|
|
24
|
+
model: "qwen3:4b",
|
|
25
|
+
runs: 3,
|
|
26
|
+
timeoutMs: 120000,
|
|
27
|
+
out: "",
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
function parseArgs(argv) {
|
|
31
|
+
const args = { ...DEFAULTS };
|
|
32
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
33
|
+
const key = argv[i];
|
|
34
|
+
const value = argv[i + 1];
|
|
35
|
+
if (key === "--base-url") args.baseUrl = value;
|
|
36
|
+
else if (key === "--model") args.model = value;
|
|
37
|
+
else if (key === "--runs") args.runs = Number(value);
|
|
38
|
+
else if (key === "--timeout") args.timeoutMs = Number(value);
|
|
39
|
+
else if (key === "--out") args.out = value;
|
|
40
|
+
else if (key === "--help" || key === "-h") {
|
|
41
|
+
console.log(
|
|
42
|
+
"node scripts/bench-local.mjs [--model qwen3:4b] [--runs 3] [--base-url URL] [--timeout MS] [--out FILE]"
|
|
43
|
+
);
|
|
44
|
+
process.exit(0);
|
|
45
|
+
} else {
|
|
46
|
+
console.error(`Неизвестный аргумент: ${key}`);
|
|
47
|
+
process.exit(2);
|
|
48
|
+
}
|
|
49
|
+
i += 1;
|
|
50
|
+
}
|
|
51
|
+
if (!Number.isInteger(args.runs) || args.runs < 1 || args.runs > 50) {
|
|
52
|
+
console.error("--runs должен быть целым числом от 1 до 50.");
|
|
53
|
+
process.exit(2);
|
|
54
|
+
}
|
|
55
|
+
if (!Number.isInteger(args.timeoutMs) || args.timeoutMs < 1000 || args.timeoutMs > 600000) {
|
|
56
|
+
console.error("--timeout должен быть целым числом от 1000 до 600000 мс.");
|
|
57
|
+
process.exit(2);
|
|
58
|
+
}
|
|
59
|
+
return args;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const schema = {
|
|
63
|
+
type: "object",
|
|
64
|
+
properties: {
|
|
65
|
+
category: { type: "string", enum: ["quality", "timeout", "permission", "network", "unknown"] },
|
|
66
|
+
severity: { type: "string", enum: ["low", "medium", "high"] },
|
|
67
|
+
confidence: { type: "number", minimum: 0, maximum: 1 },
|
|
68
|
+
reason: { type: "string" },
|
|
69
|
+
},
|
|
70
|
+
required: ["category", "severity", "confidence", "reason"],
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const prompt = `Ты классифицируешь уведомление планировщика задач.
|
|
74
|
+
Верни только JSON без markdown и пояснений по схеме:
|
|
75
|
+
{"category":"quality|timeout|permission|network|unknown","severity":"low|medium|high","confidence":0..1,"reason":"кратко"}
|
|
76
|
+
|
|
77
|
+
Уведомление:
|
|
78
|
+
Задача "nightly-tests" упала за 2.3s. Quality Gate вернул код 1: 3 теста не прошли в auth-модуле.`;
|
|
79
|
+
|
|
80
|
+
function validate(value) {
|
|
81
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return "not an object";
|
|
82
|
+
for (const key of schema.required) {
|
|
83
|
+
if (!(key in value)) return `missing ${key}`;
|
|
84
|
+
}
|
|
85
|
+
if (!schema.properties.category.enum.includes(value.category)) return "bad category";
|
|
86
|
+
if (!schema.properties.severity.enum.includes(value.severity)) return "bad severity";
|
|
87
|
+
if (typeof value.confidence !== "number" || value.confidence < 0 || value.confidence > 1) return "bad confidence";
|
|
88
|
+
if (typeof value.reason !== "string" || value.reason.trim() === "") return "bad reason";
|
|
89
|
+
return "";
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Тир по объёму RAM: рекомендация модели и причина выбора. */
|
|
93
|
+
function pickTier(ramGb) {
|
|
94
|
+
if (ramGb < 8) {
|
|
95
|
+
return {
|
|
96
|
+
id: "rules-only",
|
|
97
|
+
recommendedModel: "qwen3:0.6b",
|
|
98
|
+
reason: `RAM ${ramGb} ГБ: локальная модель не помещается с запасом — работают только правила.`,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
if (ramGb < 15) {
|
|
102
|
+
return {
|
|
103
|
+
id: "light",
|
|
104
|
+
recommendedModel: "qwen3:1.7b",
|
|
105
|
+
reason: `RAM ${ramGb} ГБ: хватает на маленькую модель, ожидайте скромную точность.`,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
if (ramGb < 30) {
|
|
109
|
+
return {
|
|
110
|
+
id: "balanced",
|
|
111
|
+
recommendedModel: "qwen3:4b",
|
|
112
|
+
reason: `RAM ${ramGb} ГБ: рекомендуемый тир для триажа — qwen3:4b на CPU.`,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
id: "max",
|
|
117
|
+
recommendedModel: "qwen3:8b",
|
|
118
|
+
reason: `RAM ${ramGb} ГБ: можно позволить модель крупнее для лучшей точности.`,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function round(value, digits = 2) {
|
|
123
|
+
return Number.isFinite(value) ? Number(value.toFixed(digits)) : null;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function percentile(sorted, fraction) {
|
|
127
|
+
if (sorted.length === 0) return null;
|
|
128
|
+
return sorted[Math.max(0, Math.ceil(sorted.length * fraction) - 1)];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function machineInfo() {
|
|
132
|
+
const cpus = os.cpus();
|
|
133
|
+
return {
|
|
134
|
+
platform: os.platform(),
|
|
135
|
+
osRelease: os.release(),
|
|
136
|
+
arch: os.arch(),
|
|
137
|
+
cpu: cpus.length > 0 ? cpus[0].model.trim() : "unknown",
|
|
138
|
+
cpuCount: cpus.length,
|
|
139
|
+
ramGb: round(os.totalmem() / 1024 ** 3, 1),
|
|
140
|
+
nodeVersion: process.version,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
async function loadModel(baseUrl, model) {
|
|
145
|
+
const response = await fetch(`${baseUrl}/api/tags`, { signal: AbortSignal.timeout(10000) });
|
|
146
|
+
if (!response.ok) throw new Error(`/api/tags: HTTP ${response.status}`);
|
|
147
|
+
const data = await response.json();
|
|
148
|
+
const names = (data.models ?? []).map((item) => item.name);
|
|
149
|
+
if (names.length === 0) {
|
|
150
|
+
throw new Error(`Ollama запущена, но моделей нет: выполните "ollama pull ${model}"`);
|
|
151
|
+
}
|
|
152
|
+
if (!names.some((name) => name === model || name === `${model}:latest`)) {
|
|
153
|
+
throw new Error(`Модель "${model}" не найдена. Доступны: ${names.join(", ")}`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** Один прогон: латентность, счётчики токенов и валидность схемы. */
|
|
158
|
+
async function runOnce(args, index) {
|
|
159
|
+
const started = Date.now();
|
|
160
|
+
const body = {
|
|
161
|
+
model: args.model,
|
|
162
|
+
messages: [{ role: "user", content: prompt }],
|
|
163
|
+
stream: false,
|
|
164
|
+
format: schema,
|
|
165
|
+
options: { temperature: 0, seed: index + 1 },
|
|
166
|
+
};
|
|
167
|
+
let response;
|
|
168
|
+
try {
|
|
169
|
+
response = await fetch(`${args.baseUrl}/api/chat`, {
|
|
170
|
+
method: "POST",
|
|
171
|
+
headers: { "content-type": "application/json" },
|
|
172
|
+
body: JSON.stringify(body),
|
|
173
|
+
signal: AbortSignal.timeout(args.timeoutMs),
|
|
174
|
+
});
|
|
175
|
+
} catch (error) {
|
|
176
|
+
return {
|
|
177
|
+
run: index + 1,
|
|
178
|
+
ok: false,
|
|
179
|
+
jsonValid: false,
|
|
180
|
+
schemaValid: false,
|
|
181
|
+
latencyMs: Date.now() - started,
|
|
182
|
+
evalCount: null,
|
|
183
|
+
evalMs: null,
|
|
184
|
+
tokPerSec: null,
|
|
185
|
+
error: error instanceof Error ? error.message : String(error),
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
const latencyMs = Date.now() - started;
|
|
189
|
+
if (!response.ok) {
|
|
190
|
+
return { run: index + 1, ok: false, jsonValid: false, schemaValid: false, latencyMs, evalCount: null, evalMs: null, tokPerSec: null, error: `HTTP ${response.status}` };
|
|
191
|
+
}
|
|
192
|
+
const data = await response.json();
|
|
193
|
+
const content = data?.message?.content ?? "";
|
|
194
|
+
const evalCount = typeof data?.eval_count === "number" ? data.eval_count : null;
|
|
195
|
+
const evalNs = typeof data?.eval_duration === "number" ? data.eval_duration : null;
|
|
196
|
+
const evalMs = evalNs !== null ? Math.round(evalNs / 1e6) : null;
|
|
197
|
+
const tokPerSec = evalCount !== null && evalNs !== null && evalNs > 0 ? (evalCount / evalNs) * 1e9 : null;
|
|
198
|
+
|
|
199
|
+
let parsed;
|
|
200
|
+
try {
|
|
201
|
+
parsed = JSON.parse(content);
|
|
202
|
+
} catch {
|
|
203
|
+
return { run: index + 1, ok: false, jsonValid: false, schemaValid: false, latencyMs, evalCount, evalMs, tokPerSec, content, error: "invalid JSON" };
|
|
204
|
+
}
|
|
205
|
+
const error = validate(parsed);
|
|
206
|
+
return {
|
|
207
|
+
run: index + 1,
|
|
208
|
+
ok: !error,
|
|
209
|
+
jsonValid: true,
|
|
210
|
+
schemaValid: !error,
|
|
211
|
+
latencyMs,
|
|
212
|
+
evalCount,
|
|
213
|
+
evalMs,
|
|
214
|
+
tokPerSec: round(tokPerSec),
|
|
215
|
+
content,
|
|
216
|
+
parsed,
|
|
217
|
+
error,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function buildReport({ args, machine, tier, available, error, results }) {
|
|
222
|
+
const completed = results.filter((item) => item.schemaValid);
|
|
223
|
+
const validRuns = results.filter((item) => item.jsonValid);
|
|
224
|
+
const latencies = results.map((item) => item.latencyMs).sort((a, b) => a - b);
|
|
225
|
+
const throughput = results
|
|
226
|
+
.map((item) => item.tokPerSec)
|
|
227
|
+
.filter((value) => typeof value === "number")
|
|
228
|
+
.sort((a, b) => a - b);
|
|
229
|
+
const avg = (values) => (values.length === 0 ? null : values.reduce((sum, value) => sum + value, 0) / values.length);
|
|
230
|
+
|
|
231
|
+
return {
|
|
232
|
+
schemaVersion: SCHEMA_VERSION,
|
|
233
|
+
generatedAt: new Date().toISOString(),
|
|
234
|
+
available,
|
|
235
|
+
error: error ?? null,
|
|
236
|
+
machine,
|
|
237
|
+
tier,
|
|
238
|
+
baseUrl: args.baseUrl,
|
|
239
|
+
model: args.model,
|
|
240
|
+
runs: args.runs,
|
|
241
|
+
metrics: {
|
|
242
|
+
schemaValid: completed.length,
|
|
243
|
+
schemaValidRate: results.length === 0 ? 0 : round(completed.length / results.length, 2),
|
|
244
|
+
jsonValid: validRuns.length,
|
|
245
|
+
jsonValidRate: results.length === 0 ? 0 : round(validRuns.length / results.length, 2),
|
|
246
|
+
avgLatencyMs: latencies.length === 0 ? null : Math.round(avg(latencies)),
|
|
247
|
+
p95LatencyMs: percentile(latencies, 0.95),
|
|
248
|
+
avgTokPerSec: throughput.length === 0 ? null : round(avg(throughput), 1),
|
|
249
|
+
p95TokPerSec: percentile(throughput, 0.95) === null ? null : round(percentile(throughput, 0.95), 1),
|
|
250
|
+
},
|
|
251
|
+
notes: [
|
|
252
|
+
"tok/s считается по eval_count / eval_duration из ответа Ollama /api/chat.",
|
|
253
|
+
"Тир подобран по объёму RAM; модель можно переопределить флагом --model.",
|
|
254
|
+
"Формат версионирован (schemaVersion) для краудсорсинга замеров.",
|
|
255
|
+
],
|
|
256
|
+
results,
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
const args = parseArgs(process.argv.slice(2));
|
|
261
|
+
const machine = machineInfo();
|
|
262
|
+
const tier = pickTier(machine.ramGb);
|
|
263
|
+
|
|
264
|
+
let available = true;
|
|
265
|
+
let availabilityError = null;
|
|
266
|
+
try {
|
|
267
|
+
await loadModel(args.baseUrl, args.model);
|
|
268
|
+
} catch (error) {
|
|
269
|
+
available = false;
|
|
270
|
+
availabilityError = error instanceof Error ? error.message : String(error);
|
|
271
|
+
console.error(`Не удалось подключиться к Ollama: ${availabilityError}`);
|
|
272
|
+
console.error(`Бенчмарк заблокирован: установите Ollama, выполните "ollama serve" и "ollama pull ${args.model}".`);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
const results = [];
|
|
276
|
+
if (available) {
|
|
277
|
+
for (let i = 0; i < args.runs; i += 1) {
|
|
278
|
+
const result = await runOnce(args, i);
|
|
279
|
+
results.push(result);
|
|
280
|
+
const mark = result.schemaValid ? "OK" : "FAIL";
|
|
281
|
+
console.log(
|
|
282
|
+
`${result.run}/${args.runs} ${mark} ${result.latencyMs}ms${result.tokPerSec ? ` ${result.tokPerSec} tok/s` : ""}${result.error ? ` — ${result.error}` : ""}`
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
const report = buildReport({ args, machine, tier, available, error: availabilityError, results });
|
|
288
|
+
|
|
289
|
+
console.log("");
|
|
290
|
+
console.log(`Машина: ${machine.cpu} × ${machine.cpuCount}, ${machine.ramGb} ГБ RAM, ${machine.platform}/${machine.arch}`);
|
|
291
|
+
console.log(`Тир: ${tier.id} → рекомендуется ${tier.recommendedModel}`);
|
|
292
|
+
console.log(tier.reason);
|
|
293
|
+
if (available) {
|
|
294
|
+
console.log(
|
|
295
|
+
`Схема: ${report.metrics.schemaValid}/${args.runs} (${Math.round(report.metrics.schemaValidRate * 100)}%); JSON: ${report.metrics.jsonValid}/${args.runs}`
|
|
296
|
+
);
|
|
297
|
+
const speed = report.metrics.avgTokPerSec === null ? "n/a" : `${report.metrics.avgTokPerSec} tok/s`;
|
|
298
|
+
console.log(`Латентность: avg ${report.metrics.avgLatencyMs}ms, p95 ${report.metrics.p95LatencyMs}ms; скорость: ${speed}`);
|
|
299
|
+
if (report.metrics.schemaValidRate >= 0.9) {
|
|
300
|
+
console.log("Вывод: модель подходит для триажа, валидацию схемы всё равно оставить.");
|
|
301
|
+
} else if (report.metrics.schemaValidRate >= 0.7) {
|
|
302
|
+
console.log("Вывод: нужен один retry и fallback на правила.");
|
|
303
|
+
} else {
|
|
304
|
+
console.log("Вывод: модель не подходит для критичных вердиктов — только правила или модель крупнее.");
|
|
305
|
+
}
|
|
306
|
+
} else {
|
|
307
|
+
console.log("Вывод: замер не выполнен, JSON всё равно сформирован для отчёта.");
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
if (args.out) {
|
|
311
|
+
const target = path.resolve(args.out);
|
|
312
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
313
|
+
fs.writeFileSync(target, `${JSON.stringify(report, null, 2)}\n`, "utf8");
|
|
314
|
+
console.log(`Результат: ${target}`);
|
|
315
|
+
} else {
|
|
316
|
+
console.log("");
|
|
317
|
+
console.log(JSON.stringify(report, null, 2));
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
if (!available) process.exit(2);
|
|
321
|
+
process.exit(report.metrics.schemaValidRate >= 0.7 ? 0 : 1);
|