@genee/omp-opsx-addon 0.1.0
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.md +83 -0
- package/index.ts +1327 -0
- package/lib/agent-defs.ts +291 -0
- package/lib/change-scanner.ts +72 -0
- package/lib/cursor-auth.ts +230 -0
- package/lib/direct-fetchers.ts +155 -0
- package/lib/edit-variant-pin.ts +156 -0
- package/lib/error-scan.ts +97 -0
- package/lib/family-filter.ts +174 -0
- package/lib/model-selector.ts +307 -0
- package/lib/model-tiers.ts +164 -0
- package/lib/notify.ts +4 -0
- package/lib/openspec-tasks.ts +28 -0
- package/lib/peak-detector.ts +44 -0
- package/lib/reachability-cache.ts +288 -0
- package/lib/reachability-probe.ts +459 -0
- package/lib/reachability-refresh.ts +84 -0
- package/lib/selection-filters.ts +100 -0
- package/lib/selection-lifecycle.ts +17 -0
- package/lib/session-title.ts +186 -0
- package/lib/session-usage.ts +252 -0
- package/lib/state.ts +95 -0
- package/lib/system-prompt.ts +160 -0
- package/lib/tiers-data.ts +136 -0
- package/lib/tiers-updater.ts +146 -0
- package/lib/unified-config.ts +463 -0
- package/lib/usage-estimator.ts +154 -0
- package/lib/usage-poller.ts +1200 -0
- package/lib/usage-poller.worker.ts +31 -0
- package/lib/usage-redis-client.ts +594 -0
- package/lib/usage-redis-multiproc.worker.ts +80 -0
- package/lib/usage-redis-probe.ts +389 -0
- package/lib/usage-render.ts +526 -0
- package/lib/usage-resolver.ts +477 -0
- package/lib/usage-sampler.ts +77 -0
- package/lib/usage-widget.ts +112 -0
- package/package.json +47 -0
- package/types/bun.d.ts +21 -0
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# omp-opsx-addon
|
|
2
|
+
|
|
3
|
+
> Pi Extension: OpenSpec workflow orchestration — coder/reviewer/planner agents, session title & progress.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 架构
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
┌─────────────────────────────────────────────────────────┐
|
|
11
|
+
│ 主 agent (Orchestrator) │
|
|
12
|
+
│ system prompt 由 plugin 注入: model 选择决策 + 路由表 │
|
|
13
|
+
│ │
|
|
14
|
+
│ 用户说 "@coder 实现 X" → transform 成 task 委派指令 │
|
|
15
|
+
└───────────────────────┬─────────────────────────────────┘
|
|
16
|
+
│
|
|
17
|
+
┌───────▼────────┐
|
|
18
|
+
│ omp 内置 task │
|
|
19
|
+
│ (所有 role) │
|
|
20
|
+
│ 原生 subagent │
|
|
21
|
+
└───────┬────────┘
|
|
22
|
+
│
|
|
23
|
+
┌────────┴──────────┐
|
|
24
|
+
│ .omp/agents/ │
|
|
25
|
+
│ coder / planner │
|
|
26
|
+
│ code-reviewer / │
|
|
27
|
+
│ proposal-reviewer │
|
|
28
|
+
└───────────────────┘
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**核心机制**:主 agent 用 omp 内置 `task` 工具委派所有 4 个角色。model 选择由插件自动完成,不再有 acpx(外部 agent)路径。
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Dispatch 配置 (`opsx.yml`)
|
|
36
|
+
|
|
37
|
+
两层 `opsx.yml`(全局 `~/.omp/agent/opsx.yml` + 项目 `<cwd>/.omp/opsx.yml`,项目逐键覆盖全局)。
|
|
38
|
+
|
|
39
|
+
```yaml
|
|
40
|
+
# role 值可以是:
|
|
41
|
+
# 'auto' — 插件按 tier + usage 自动选 model
|
|
42
|
+
# 'smol' / 'slow' / 'default' — OMP role alias(由 OMP modelRoles 解析)
|
|
43
|
+
# 'gpt-5-pro' — 明确 model id
|
|
44
|
+
# 'anthropic/claude-opus-4-6' — provider/model 完全限定
|
|
45
|
+
|
|
46
|
+
coder: auto
|
|
47
|
+
reviewer: slow
|
|
48
|
+
planner: slow
|
|
49
|
+
proposal-reviewer: default
|
|
50
|
+
|
|
51
|
+
# 可选:限制自动选择时使用的 model 池
|
|
52
|
+
model_allowlist:
|
|
53
|
+
- "anthropic/claude-opus-*"
|
|
54
|
+
- "openai/gpt-5*"
|
|
55
|
+
|
|
56
|
+
# 可选:自定义 tier 评分
|
|
57
|
+
tiers:
|
|
58
|
+
- pattern: "*opus*"
|
|
59
|
+
tier: top
|
|
60
|
+
- pattern: "openai/gpt-4o-mini"
|
|
61
|
+
tier: low
|
|
62
|
+
|
|
63
|
+
# 可选:role → tier 期望
|
|
64
|
+
role_tiers:
|
|
65
|
+
planner: top
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Model 选择
|
|
71
|
+
|
|
72
|
+
插件启动时从 `ModelRegistry.getAvailable()` 拿所有有鉴权的 model,从 `authStorage.fetchUsageReports()` 拉用量报告,然后按 role → tier 期望 + 用量健康度自动选最优 model。
|
|
73
|
+
|
|
74
|
+
决策日志打印到 stderr:`[omp-opsx-addon] planner → anthropic/claude-opus-4-6 (tier=top, gap=0, remaining=0.80)`
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 开发
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npm run typecheck
|
|
82
|
+
bun test
|
|
83
|
+
```
|