@sakanano-moe/agenthelm 6.5.2 → 6.6.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.
Files changed (109) hide show
  1. package/bin/agenthelm.js +1 -1
  2. package/package.json +2 -2
  3. package/runtime/index.json +80 -0
  4. package/runtime/plugins/agent-pack/.codex-plugin/plugin.json +19 -0
  5. package/runtime/plugins/agent-pack/.mcp.json +12 -0
  6. package/runtime/plugins/agent-pack/hooks/hooks.json +16 -0
  7. package/runtime/plugins/agent-pack/mcp.json +14 -0
  8. package/runtime/plugins/agent-pack/plugin.json +20 -0
  9. package/runtime/plugins/agent-pack/references/capability-config.md +124 -0
  10. package/runtime/{agenthelm.py → plugins/agent-pack/runtime/agenthelm.py} +111 -28
  11. package/runtime/plugins/agent-pack/runtime/agenthelm_runtime.py +388 -0
  12. package/runtime/plugins/agent-pack/skills/agent-pack/SKILL.md +46 -0
  13. package/runtime/plugins/agents-init/.codex-plugin/plugin.json +22 -0
  14. package/runtime/plugins/agents-init/content.json +31 -0
  15. package/runtime/plugins/agents-init/plugin.json +19 -0
  16. package/runtime/plugins/agents-init/skills/agents-init/AGENT.template.md +376 -0
  17. package/runtime/plugins/agents-init/skills/agents-init/SKILL.md +119 -0
  18. package/runtime/plugins/agents-init/skills/agents-init/index.html +357 -0
  19. package/runtime/plugins/agents-init/skills/agents-init/launcher.sh +93 -0
  20. package/runtime/plugins/agents-init/skills/agents-init/project.schema.json +171 -0
  21. package/runtime/plugins/agents-init/skills/agents-init/scripts/init_project.py +1190 -0
  22. package/runtime/plugins/agents-init/skills/agents-init/scripts/test_init_project.py +678 -0
  23. package/runtime/plugins/agents-init/skills/agents-init/skill.json +122 -0
  24. package/runtime/plugins/opinion-manager/.codex-plugin/plugin.json +26 -0
  25. package/runtime/plugins/opinion-manager/catalog/README.md +15 -0
  26. package/runtime/plugins/opinion-manager/catalog/rules/.gitkeep +0 -0
  27. package/runtime/plugins/opinion-manager/catalog/rules/om.align-requirements/versions/1.0.0.json +11 -0
  28. package/runtime/plugins/opinion-manager/catalog/rules/om.assumptions-authority/versions/1.0.0.json +11 -0
  29. package/runtime/plugins/opinion-manager/catalog/rules/om.batch-questions/versions/1.0.0.json +11 -0
  30. package/runtime/plugins/opinion-manager/catalog/rules/om.bilingual-terms/versions/1.0.0.json +11 -0
  31. package/runtime/plugins/opinion-manager/catalog/rules/om.calculations/versions/1.0.0.json +11 -0
  32. package/runtime/plugins/opinion-manager/catalog/rules/om.chinese-response/versions/1.0.0.json +11 -0
  33. package/runtime/plugins/opinion-manager/catalog/rules/om.clean-deliverable/versions/1.0.0.json +11 -0
  34. package/runtime/plugins/opinion-manager/catalog/rules/om.complete-options/versions/1.0.0.json +11 -0
  35. package/runtime/plugins/opinion-manager/catalog/rules/om.conclusion-first/versions/1.0.0.json +11 -0
  36. package/runtime/plugins/opinion-manager/catalog/rules/om.concrete-titles/versions/1.0.0.json +11 -0
  37. package/runtime/plugins/opinion-manager/catalog/rules/om.consistent-items/versions/1.0.0.json +11 -0
  38. package/runtime/plugins/opinion-manager/catalog/rules/om.device-readable/versions/1.0.0.json +11 -0
  39. package/runtime/plugins/opinion-manager/catalog/rules/om.editable-diagrams/versions/1.0.0.json +11 -0
  40. package/runtime/plugins/opinion-manager/catalog/rules/om.evidence-inference/versions/1.0.0.json +11 -0
  41. package/runtime/plugins/opinion-manager/catalog/rules/om.maintenance-chinese/versions/1.0.0.json +11 -0
  42. package/runtime/plugins/opinion-manager/catalog/rules/om.maintenance-project-language/versions/1.0.0.json +11 -0
  43. package/runtime/plugins/opinion-manager/catalog/rules/om.markdown-structure/versions/1.0.0.json +11 -0
  44. package/runtime/plugins/opinion-manager/catalog/rules/om.portable-files/versions/1.0.0.json +11 -0
  45. package/runtime/plugins/opinion-manager/catalog/rules/om.report-context/versions/1.0.0.json +11 -0
  46. package/runtime/plugins/opinion-manager/catalog/rules/om.report-formats/versions/1.0.0.json +11 -0
  47. package/runtime/plugins/opinion-manager/catalog/rules/om.report-review/versions/1.0.0.json +11 -0
  48. package/runtime/plugins/opinion-manager/catalog/rules/om.response-brief/versions/1.0.0.json +11 -0
  49. package/runtime/plugins/opinion-manager/catalog/rules/om.response-dense/versions/1.0.0.json +11 -0
  50. package/runtime/plugins/opinion-manager/catalog/rules/om.rules-tools/versions/1.0.0.json +11 -0
  51. package/runtime/plugins/opinion-manager/catalog/rules/om.semantic-wrap/versions/1.0.0.json +11 -0
  52. package/runtime/plugins/opinion-manager/catalog/rules/om.solutions-proportional/versions/1.0.0.json +11 -0
  53. package/runtime/plugins/opinion-manager/catalog/rules/om.solutions-three-level/versions/1.0.0.json +11 -0
  54. package/runtime/plugins/opinion-manager/catalog/rules/om.tables-compact/versions/1.0.0.json +11 -0
  55. package/runtime/plugins/opinion-manager/catalog/rules/om.tables-list-first/versions/1.0.0.json +11 -0
  56. package/runtime/plugins/opinion-manager/catalog/rules/om.test-evidence/versions/1.0.0.json +11 -0
  57. package/runtime/plugins/opinion-manager/catalog/rules/om.versioned-files/versions/1.0.0.json +11 -0
  58. package/runtime/plugins/opinion-manager/catalog/templates/.gitkeep +0 -0
  59. package/runtime/plugins/opinion-manager/catalog/templates/delivery-standard/compact-tables/versions/1.0.0.json +21 -0
  60. package/runtime/plugins/opinion-manager/catalog/templates/delivery-standard/list-first/versions/1.0.0.json +21 -0
  61. package/runtime/plugins/opinion-manager/catalog/templates/development-standard/chinese-maintenance/versions/1.0.0.json +15 -0
  62. package/runtime/plugins/opinion-manager/catalog/templates/development-standard/project-language/versions/1.0.0.json +15 -0
  63. package/runtime/plugins/opinion-manager/catalog/templates/response-style/brief-chinese/versions/1.0.0.json +19 -0
  64. package/runtime/plugins/opinion-manager/catalog/templates/response-style/dense-chinese/versions/1.0.0.json +19 -0
  65. package/runtime/plugins/opinion-manager/catalog/templates/scenario/concise-project/versions/1.0.0.json +39 -0
  66. package/runtime/plugins/opinion-manager/catalog/templates/scenario/reviewed-project/versions/1.0.0.json +39 -0
  67. package/runtime/plugins/opinion-manager/catalog/templates/work-method/proportional/versions/1.0.0.json +20 -0
  68. package/runtime/plugins/opinion-manager/catalog/templates/work-method/three-level/versions/1.0.0.json +20 -0
  69. package/runtime/plugins/opinion-manager/content.json +63 -0
  70. package/runtime/plugins/opinion-manager/plugin.json +18 -0
  71. package/runtime/plugins/opinion-manager/references/lock.schema.json +14 -0
  72. package/runtime/plugins/opinion-manager/references/onboarding.md +57 -0
  73. package/runtime/plugins/opinion-manager/references/profile.schema.json +56 -0
  74. package/runtime/plugins/opinion-manager/references/rule.schema.json +16 -0
  75. package/runtime/plugins/opinion-manager/references/template.schema.json +71 -0
  76. package/runtime/plugins/opinion-manager/references/versioned-template.schema.json +19 -0
  77. package/runtime/plugins/opinion-manager/references/versioning.md +263 -0
  78. package/runtime/plugins/opinion-manager/runtime/constants.py +7 -0
  79. package/runtime/plugins/opinion-manager/runtime/context.py +180 -0
  80. package/runtime/plugins/opinion-manager/runtime/lifecycle.py +395 -0
  81. package/runtime/plugins/opinion-manager/runtime/opinion_manager.py +419 -0
  82. package/runtime/plugins/opinion-manager/runtime/versioned.py +705 -0
  83. package/runtime/plugins/opinion-manager/skills/opinion-manager/SKILL.md +62 -0
  84. package/runtime/plugins/opinion-manager/skills/opinion-manager/agents/openai.yaml +4 -0
  85. package/runtime/plugins/opinion-manager/templates/.gitkeep +1 -0
  86. package/runtime/plugins/project-orchestrator/.codex-plugin/plugin.json +18 -0
  87. package/runtime/plugins/project-orchestrator/content.json +37 -0
  88. package/runtime/plugins/project-orchestrator/plugin.json +19 -0
  89. package/runtime/plugins/project-orchestrator/references/asset-synonyms.example.json +8 -0
  90. package/runtime/plugins/project-orchestrator/references/case-workspaces.md +159 -0
  91. package/runtime/plugins/project-orchestrator/references/case.schema.json +31 -0
  92. package/runtime/plugins/project-orchestrator/runtime/assets.py +1288 -0
  93. package/runtime/plugins/project-orchestrator/runtime/case.py +557 -0
  94. package/runtime/plugins/project-orchestrator/runtime/case_workspace.py +350 -0
  95. package/runtime/plugins/project-orchestrator/runtime/memory.py +363 -0
  96. package/runtime/plugins/project-orchestrator/runtime/project_base.py +107 -0
  97. package/runtime/plugins/project-orchestrator/runtime/project_cli.py +599 -0
  98. package/runtime/plugins/project-orchestrator/runtime/project_demo.py +504 -0
  99. package/runtime/plugins/project-orchestrator/runtime/project_maintain.py +470 -0
  100. package/runtime/plugins/project-orchestrator/runtime/project_menu.py +394 -0
  101. package/runtime/plugins/project-orchestrator/runtime/project_real.py +522 -0
  102. package/runtime/plugins/project-orchestrator/runtime/project_write.py +329 -0
  103. package/runtime/plugins/project-orchestrator/runtime/wf.py +439 -0
  104. package/runtime/plugins/project-orchestrator/skills/project-orchestrator/SKILL.md +230 -0
  105. package/runtime/plugins/project-orchestrator/skills/project-orchestrator/agents/openai.yaml +4 -0
  106. package/runtime/plugins/project-orchestrator/templates/CASE.md +39 -0
  107. /package/runtime/{agent_pack_config.py → plugins/agent-pack/runtime/agent_pack_config.py} +0 -0
  108. /package/runtime/{mcp_env_launcher.py → plugins/agent-pack/runtime/mcp_env_launcher.py} +0 -0
  109. /package/runtime/{mcp_server.py → plugins/agent-pack/runtime/mcp_server.py} +0 -0
@@ -0,0 +1,357 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>agents-init v6 · 云端 Skills</title>
7
+ <meta name="description" content="创建或迁移通用项目骨架与 Project Profile;随包管理生命周期、扩展能力与 Opinion。">
8
+ <style>
9
+ :root {
10
+ color-scheme: light;
11
+ --ink: #171717;
12
+ --muted: #625f59;
13
+ --paper: #fbfaf6;
14
+ --panel: #ffffff;
15
+ --line: #d8d1c1;
16
+ --accent: #0f766e;
17
+ --accent-strong: #134e4a;
18
+ --soft: #edf7f5;
19
+ --warn: #f2c94c;
20
+ }
21
+
22
+ * {
23
+ box-sizing: border-box;
24
+ }
25
+
26
+ body {
27
+ margin: 0;
28
+ background: var(--paper);
29
+ color: var(--ink);
30
+ font-family: "Avenir Next", "Gill Sans", "Noto Sans SC", sans-serif;
31
+ line-height: 1.7;
32
+ }
33
+
34
+ a {
35
+ color: var(--accent-strong);
36
+ text-underline-offset: 0.18em;
37
+ }
38
+
39
+ .wrap {
40
+ width: min(980px, calc(100% - 32px));
41
+ margin: 0 auto;
42
+ padding: 38px 0 64px;
43
+ }
44
+
45
+ nav {
46
+ display: flex;
47
+ flex-wrap: wrap;
48
+ gap: 10px;
49
+ align-items: center;
50
+ justify-content: space-between;
51
+ padding-bottom: 22px;
52
+ border-bottom: 1px solid var(--line);
53
+ color: var(--muted);
54
+ font-size: 14px;
55
+ }
56
+
57
+ .crumb {
58
+ font-weight: 700;
59
+ }
60
+
61
+ .links {
62
+ display: flex;
63
+ flex-wrap: wrap;
64
+ gap: 8px;
65
+ }
66
+
67
+ .pill {
68
+ display: inline-flex;
69
+ align-items: center;
70
+ min-height: 34px;
71
+ padding: 6px 11px;
72
+ border: 1px solid var(--line);
73
+ border-radius: 6px;
74
+ background: #fff;
75
+ text-decoration: none;
76
+ font-weight: 700;
77
+ }
78
+
79
+ header {
80
+ padding: 42px 0 30px;
81
+ }
82
+
83
+ .eyebrow {
84
+ margin: 0 0 10px;
85
+ color: var(--accent-strong);
86
+ font-size: 13px;
87
+ font-weight: 800;
88
+ letter-spacing: 0.08em;
89
+ text-transform: uppercase;
90
+ }
91
+
92
+ h1 {
93
+ margin: 0;
94
+ font-family: Georgia, "Noto Serif SC", serif;
95
+ font-size: clamp(38px, 7vw, 78px);
96
+ line-height: 1;
97
+ letter-spacing: 0;
98
+ }
99
+
100
+ .lead {
101
+ max-width: 760px;
102
+ margin: 20px 0 0;
103
+ color: var(--muted);
104
+ font-size: 18px;
105
+ }
106
+
107
+ .meta {
108
+ display: grid;
109
+ grid-template-columns: repeat(4, minmax(0, 1fr));
110
+ gap: 10px;
111
+ margin: 26px 0 0;
112
+ }
113
+
114
+ .meta div {
115
+ padding: 12px;
116
+ border: 1px solid var(--line);
117
+ border-radius: 8px;
118
+ background: #fff;
119
+ }
120
+
121
+ .meta strong,
122
+ .meta span {
123
+ display: block;
124
+ }
125
+
126
+ .meta strong {
127
+ font-size: 12px;
128
+ color: var(--muted);
129
+ }
130
+
131
+ .meta span {
132
+ margin-top: 4px;
133
+ font-weight: 800;
134
+ }
135
+
136
+ main {
137
+ display: grid;
138
+ gap: 22px;
139
+ }
140
+
141
+ section {
142
+ padding: 24px;
143
+ border: 1px solid var(--line);
144
+ border-radius: 8px;
145
+ background: var(--panel);
146
+ }
147
+
148
+ h2 {
149
+ margin: 0 0 12px;
150
+ font-size: 22px;
151
+ line-height: 1.25;
152
+ }
153
+
154
+ p,
155
+ ul,
156
+ ol {
157
+ margin: 0;
158
+ color: var(--muted);
159
+ }
160
+
161
+ ul,
162
+ ol {
163
+ padding-left: 20px;
164
+ }
165
+
166
+ li + li {
167
+ margin-top: 5px;
168
+ }
169
+
170
+ code {
171
+ padding: 0.1em 0.28em;
172
+ border-radius: 4px;
173
+ background: rgba(242, 201, 76, 0.25);
174
+ color: #24221e;
175
+ font-family: "SFMono-Regular", Consolas, monospace;
176
+ font-size: 0.92em;
177
+ }
178
+
179
+ .resource-grid {
180
+ display: grid;
181
+ grid-template-columns: repeat(3, minmax(0, 1fr));
182
+ gap: 12px;
183
+ }
184
+
185
+ .resource {
186
+ display: block;
187
+ min-height: 94px;
188
+ padding: 14px;
189
+ border: 1px solid var(--line);
190
+ border-radius: 8px;
191
+ background: var(--soft);
192
+ text-decoration: none;
193
+ }
194
+
195
+ .resource strong,
196
+ .resource span {
197
+ display: block;
198
+ }
199
+
200
+ .resource strong {
201
+ color: var(--accent-strong);
202
+ }
203
+
204
+ .resource span {
205
+ margin-top: 6px;
206
+ color: var(--muted);
207
+ font-size: 14px;
208
+ font-weight: 400;
209
+ }
210
+
211
+ table {
212
+ width: 100%;
213
+ border-collapse: collapse;
214
+ overflow-wrap: anywhere;
215
+ }
216
+
217
+ th,
218
+ td {
219
+ padding: 10px;
220
+ border-bottom: 1px solid var(--line);
221
+ text-align: left;
222
+ vertical-align: top;
223
+ }
224
+
225
+ th {
226
+ color: var(--accent-strong);
227
+ font-size: 14px;
228
+ }
229
+
230
+ footer {
231
+ margin-top: 26px;
232
+ color: var(--muted);
233
+ font-size: 14px;
234
+ }
235
+
236
+ @media (max-width: 760px) {
237
+ .meta,
238
+ .resource-grid {
239
+ grid-template-columns: 1fr;
240
+ }
241
+
242
+ section {
243
+ padding: 18px;
244
+ }
245
+ }
246
+ </style>
247
+ </head>
248
+ <body>
249
+ <div class="wrap">
250
+ <nav>
251
+ <a class="crumb" href="../../index.html">← 云端 Skills</a>
252
+ <div class="links">
253
+ <a class="pill" href="./SKILL.md">SKILL.md</a>
254
+ <a class="pill" href="./skill.json">skill.json</a>
255
+ <a class="pill" href="./AGENT.template.md">AGENT.template.md</a>
256
+ </div>
257
+ </nav>
258
+
259
+ <header>
260
+ <p class="eyebrow">Skill · agents-init</p>
261
+ <h1>agents-init v6</h1>
262
+ <p class="lead">创建或迁移通用项目骨架与 Project Profile;写入前验证随包的 <code>project-orchestrator</code>、<code>agent-pack</code> 与 <code>opinion-manager</code>。</p>
263
+ <div class="meta" aria-label="Skill 元数据">
264
+ <div><strong>版本</strong><span>6.3.0</span></div>
265
+ <div><strong>状态</strong><span>stable</span></div>
266
+ <div><strong>更新</strong><span>2026-09-29</span></div>
267
+ <div><strong>语言</strong><span>zh-CN</span></div>
268
+ </div>
269
+ </header>
270
+
271
+ <main>
272
+ <section>
273
+ <h2>资源入口</h2>
274
+ <div class="resource-grid">
275
+ <a class="resource" href="./SKILL.md">
276
+ <strong>AI 原文</strong>
277
+ <span>执行入口与初始化流程,适合 Agent 直接读取。</span>
278
+ </a>
279
+ <a class="resource" href="./skill.json">
280
+ <strong>机器元数据</strong>
281
+ <span>版本、路径、标签、输入输出等结构化信息。</span>
282
+ </a>
283
+ <a class="resource" href="./AGENT.template.md">
284
+ <strong>模板文件</strong>
285
+ <span>v6 骨架契约、职责边界与迁移规则。</span>
286
+ </a>
287
+ </div>
288
+ </section>
289
+
290
+ <section>
291
+ <h2>文件分工</h2>
292
+ <table>
293
+ <thead>
294
+ <tr>
295
+ <th>文件</th>
296
+ <th>作用</th>
297
+ </tr>
298
+ </thead>
299
+ <tbody>
300
+ <tr><td><code>SKILL.md</code></td><td>AI Agent 的执行入口,说明触发方式、流程和必读文件。</td></tr>
301
+ <tr><td><code>AGENT.template.md</code></td><td>项目骨架、Project Profile 与迁移契约。</td></tr>
302
+ <tr><td><code>skill.json</code></td><td>机器可读元数据,用于索引、安装、版本检查和自动发现。</td></tr>
303
+ <tr><td><code>index.html</code></td><td>浏览器可读页面。</td></tr>
304
+ </tbody>
305
+ </table>
306
+ </section>
307
+
308
+ <section>
309
+ <h2>适用场景</h2>
310
+ <ul>
311
+ <li>新仓库需要统一的 Agent 入口与 Project Profile。</li>
312
+ <li>旧版 agents-init 项目(含 v5 project-runtime Profile)需要迁移到 v6 职责边界。</li>
313
+ <li>项目准备通过 project-orchestrator 管理 Task/Case 与 Git,通过 agent-pack 管理 Skill 与 MCP,通过 opinion-manager 管理 Agent 行为规则。</li>
314
+ <li>公开模板需要排除个人规则、凭据与私有路径。</li>
315
+ </ul>
316
+ </section>
317
+
318
+ <section>
319
+ <h2>输入信息</h2>
320
+ <table>
321
+ <thead>
322
+ <tr>
323
+ <th>字段</th>
324
+ <th>必填</th>
325
+ <th>说明</th>
326
+ </tr>
327
+ </thead>
328
+ <tbody>
329
+ <tr><td>项目名称</td><td>是</td><td>仓库或产品的名称。</td></tr>
330
+ <tr><td>项目类型</td><td>是</td><td>代码、文档、工作流或其他可组合类型。</td></tr>
331
+ <tr><td>技术栈</td><td>是</td><td>可从仓库文件确认的语言与框架。</td></tr>
332
+ <tr><td>运行环境</td><td>是</td><td>本地、容器、远程或混合。</td></tr>
333
+ <tr><td>Agent 客户端</td><td>是</td><td>Codex、Cursor、Claude Code 等入口。</td></tr>
334
+ <tr><td>项目命令</td><td>否</td><td>不能确认时保留 TODO,不由模板臆造。</td></tr>
335
+ </tbody>
336
+ </table>
337
+ </section>
338
+
339
+ <section>
340
+ <h2>标准流程</h2>
341
+ <ol>
342
+ <li>扫描仓库并确认可证实的 Project Profile 字段。</li>
343
+ <li>预览 v6 文件计划和所有路径冲突。</li>
344
+ <li>确认后运行无覆盖初始化器。</li>
345
+ <li>解析 JSON 并检查 Agent 路由一致性。</li>
346
+ <li>由随包 agent-pack 后续导入或同步 Skill/MCP。</li>
347
+ <li>由随包 opinion-manager 提供直接用模板、选择部分条目、从空白开始;另可基于已授权记忆提出候选。完整内容集中确认。</li>
348
+ </ol>
349
+ </section>
350
+ </main>
351
+
352
+ <footer>
353
+ <span>路径:plugins/agents-init/skills/agents-init/ · License: MIT</span>
354
+ </footer>
355
+ </div>
356
+ </body>
357
+ </html>
@@ -0,0 +1,93 @@
1
+ #!/bin/sh
2
+ # 项目入口(由 agents-init 生成,文件名可以改):./<本文件> 打开项目菜单,
3
+ # ./<本文件> --help 查看不进菜单时可用的命令。不调用模型,不联网下载代码。
4
+ #
5
+ # 按顺序查找 agenthelm 运行时,找到第一个就交给它:
6
+ # 1. 环境变量 AGENTHELM_BIN 指向的命令
7
+ # 2. 用户运行时目录 ${XDG_DATA_HOME:-~/.local/share}/agenthelm/current
8
+ # 3. PATH 上的 agenthelm
9
+ # 4. 已安装的 AI 客户端里随插件带来的 agent-pack(需要 Python 3.11+)
10
+ # 都找不到时说明原因和下一步,退出码 3。
11
+ set -u
12
+ LAUNCHER_API=1
13
+ root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
14
+
15
+ python_ok() {
16
+ "$1" -c 'import sys; sys.exit(0 if sys.version_info >= (3, 11) else 1)' >/dev/null 2>&1
17
+ }
18
+
19
+ find_python() {
20
+ for candidate in "${AGENTHELM_PYTHON:-}" python3 python; do
21
+ [ -n "$candidate" ] || continue
22
+ command -v "$candidate" >/dev/null 2>&1 || continue
23
+ if python_ok "$candidate"; then
24
+ printf '%s\n' "$candidate"
25
+ return 0
26
+ fi
27
+ done
28
+ return 1
29
+ }
30
+
31
+ if [ -n "${AGENTHELM_BIN:-}" ]; then
32
+ if [ -x "$AGENTHELM_BIN" ] || command -v "$AGENTHELM_BIN" >/dev/null 2>&1; then
33
+ exec "$AGENTHELM_BIN" project --project "$root" --via-launcher "$LAUNCHER_API" "$@"
34
+ fi
35
+ echo "AGENTHELM_BIN 指向的命令不存在:${AGENTHELM_BIN}" >&2
36
+ echo " · 改正或删除这个环境变量后重试" >&2
37
+ exit 3
38
+ fi
39
+
40
+ current="${XDG_DATA_HOME:-$HOME/.local/share}/agenthelm/current/bin/agenthelm"
41
+ if [ -x "$current" ]; then
42
+ exec "$current" project --project "$root" --via-launcher "$LAUNCHER_API" "$@"
43
+ fi
44
+
45
+ if command -v agenthelm >/dev/null 2>&1; then
46
+ exec agenthelm project --project "$root" --via-launcher "$LAUNCHER_API" "$@"
47
+ fi
48
+
49
+ python=$(find_python) || python=""
50
+ if [ -n "$python" ]; then
51
+ # 客户端插件缓存:Claude Code、Codex 为 <插件>/<版本>/,Cursor 为本地目录;取版本最高的一个。
52
+ best=$("$python" - "$HOME" "${CLAUDE_CONFIG_DIR:-$HOME/.claude}" "${CODEX_HOME:-$HOME/.codex}" <<'PY'
53
+ import re, sys
54
+ from pathlib import Path
55
+ home, claude, codex = map(Path, sys.argv[1:4])
56
+ patterns = [(claude / "plugins/cache/agenthelm/agent-pack", "*/runtime/agenthelm.py"),
57
+ (codex / "plugins/cache/agenthelm/agent-pack", "*/runtime/agenthelm.py"),
58
+ (home / ".cursor/plugins/local/agent-pack", "runtime/agenthelm.py")]
59
+ def key(path):
60
+ match = re.search(r"/(\d+)\.(\d+)\.(\d+)/runtime/", path.as_posix())
61
+ return tuple(map(int, match.groups())) if match else (0, 0, 0)
62
+ found = [path for base, pattern in patterns for path in base.glob(pattern)]
63
+ print(max(found, key=key) if found else "")
64
+ PY
65
+ )
66
+ if [ -n "$best" ]; then
67
+ exec "$python" "$best" project --project "$root" --via-launcher "$LAUNCHER_API" "$@"
68
+ fi
69
+ fi
70
+
71
+ {
72
+ echo "打不开项目菜单:本机还没有 agenthelm 运行时。"
73
+ if [ -z "$python" ]; then
74
+ old=$(python3 -c 'import platform; print(platform.python_version())' 2>/dev/null || true)
75
+ if [ -n "$old" ]; then
76
+ echo "原因:找到的 Python 是 ${old},需要 3.11 或更高版本(agenthelm 的日常功能只需要它,不需要 AI 客户端)。"
77
+ else
78
+ echo "原因:没有找到 Python 3.11 或更高版本(agenthelm 的日常功能只需要它,不需要 AI 客户端)。"
79
+ fi
80
+ echo "下一步:"
81
+ echo " 1. 安装 Python 3.11+(macOS 可用 python.org 安装包或 Homebrew;Linux 用发行版的包管理器)"
82
+ echo " 2. 已装在别处时:export AGENTHELM_PYTHON=/path/to/python3"
83
+ echo " 3. 然后安装运行时(见下)"
84
+ else
85
+ echo "原因:没有找到 agenthelm 运行时;日常使用只需要 Python 3.11+,不需要 AI 客户端。"
86
+ fi
87
+ echo "安装运行时(只需一次,之后打开菜单不再联网):"
88
+ echo " · 联网:npx @sakanano-moe/agenthelm runtime install --apply"
89
+ echo " · 离线:解压发布包(agenthelm-v<版本>.tar.gz)后运行"
90
+ echo " python3 <解压目录>/plugins/agent-pack/runtime/agenthelm.py runtime install --apply"
91
+ echo " · 已有运行时:export AGENTHELM_BIN=/path/to/agenthelm"
92
+ } >&2
93
+ exit 3
@@ -0,0 +1,171 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://skill.sakanano.moe/skills/agents-init/project.schema.json",
4
+ "title": "agents-init Project Profile",
5
+ "description": "由 project-orchestrator、agent-pack 与 opinion-manager 消费的可移植项目发现契约,位于 .agents/moe.sakanano.agent-pack/project.json。",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schema_version", "name", "profile", "runtime", "opinion", "capabilities", "work", "privacy"],
9
+ "properties": {
10
+ "$schema": {"type": "string", "format": "uri-reference"},
11
+ "schema_version": {"const": "1.0"},
12
+ "initializer_version": {"type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"},
13
+ "name": {"type": "string", "minLength": 1},
14
+ "profile": {
15
+ "type": "object",
16
+ "additionalProperties": true,
17
+ "required": ["project_type", "vcs", "stack", "runtime", "agent_cli"],
18
+ "properties": {
19
+ "project_type": {"$ref": "#/$defs/stringArray"},
20
+ "vcs": {"type": "string", "minLength": 1},
21
+ "stack": {"$ref": "#/$defs/stringArray"},
22
+ "runtime": {"type": "string", "minLength": 1},
23
+ "agent_cli": {"$ref": "#/$defs/stringArray"}
24
+ }
25
+ },
26
+ "runtime": {
27
+ "type": "object",
28
+ "additionalProperties": true,
29
+ "required": ["skill", "plugin", "capability_manager", "required", "commit_policy", "push_policy"],
30
+ "properties": {
31
+ "skill": {"const": "project-orchestrator"},
32
+ "plugin": {"const": "project-orchestrator"},
33
+ "capability_manager": {"const": "agent-pack"},
34
+ "distribution": {"enum": ["marketplace", "bundled", "external"]},
35
+ "required": {"type": "boolean"},
36
+ "commit_policy": {"enum": ["explicit", "project-policy"]},
37
+ "push_policy": {"enum": ["explicit", "project-policy"]}
38
+ }
39
+ },
40
+ "opinion": {
41
+ "type": "object",
42
+ "additionalProperties": true,
43
+ "required": ["provider", "project_overlay", "strict_mode"],
44
+ "properties": {
45
+ "provider": {"type": ["string", "null"]},
46
+ "project_overlay": {"type": ["string", "null"]},
47
+ "strict_mode": {"enum": ["smart", "strict", "disabled"]},
48
+ "loading_mode": {"enum": ["tiered", "full"]}
49
+ }
50
+ },
51
+ "memory": {
52
+ "type": "object",
53
+ "additionalProperties": true,
54
+ "required": ["provider"],
55
+ "properties": {
56
+ "provider": {"enum": ["project-orchestrator", "project"]},
57
+ "root": {"anyOf": [{"$ref": "#/$defs/relativePath"}, {"type": "null"}]},
58
+ "index_command": {"type": ["string", "null"]},
59
+ "check_command": {"type": ["string", "null"]},
60
+ "policy": {"anyOf": [{"$ref": "#/$defs/relativePath"}, {"type": "null"}]}
61
+ }
62
+ },
63
+ "capabilities": {
64
+ "type": "object",
65
+ "additionalProperties": false,
66
+ "required": ["plugin_roots", "plugin_dirs", "skill_roots", "mcp_sources", "destination_skill_root", "destination_mcp"],
67
+ "properties": {
68
+ "plugin_roots": {"$ref": "#/$defs/pathArray"},
69
+ "plugin_dirs": {"$ref": "#/$defs/pathArray"},
70
+ "skill_roots": {"$ref": "#/$defs/pathArray"},
71
+ "mcp_sources": {"$ref": "#/$defs/pathArray"},
72
+ "native_mcp_sources": {"$ref": "#/$defs/pathArray"},
73
+ "credential_env_file": {
74
+ "anyOf": [{"$ref": "#/$defs/relativePath"}, {"type": "null"}]
75
+ },
76
+ "mcp_client_policy": {
77
+ "type": "object",
78
+ "additionalProperties": {
79
+ "type": "object",
80
+ "additionalProperties": false,
81
+ "properties": {
82
+ "include": {"$ref": "#/$defs/stringArray"},
83
+ "exclude": {"$ref": "#/$defs/stringArray"}
84
+ },
85
+ "not": {"required": ["include", "exclude"]}
86
+ }
87
+ },
88
+ "destination_skill_root": {"$ref": "#/$defs/relativePath"},
89
+ "destination_mcp": {"$ref": "#/$defs/relativePath"}
90
+ }
91
+ },
92
+ "work": {
93
+ "type": "object", "additionalProperties": true,
94
+ "properties": {
95
+ "mode": {"enum": ["case-workspace", "legacy"]},
96
+ "task": {"type": ["object", "null"]},
97
+ "legacy_task": {"type": ["object", "null"]},
98
+ "case": {
99
+ "type": ["object", "null"], "additionalProperties": true,
100
+ "properties": {
101
+ "root": {"$ref": "#/$defs/relativePath"},
102
+ "artifact_mode": {"enum": ["case-local", "external-references"]}
103
+ }
104
+ },
105
+ "assets": {
106
+ "type": ["object", "null"], "additionalProperties": true,
107
+ "properties": {
108
+ "roots": {"$ref": "#/$defs/pathArray"}
109
+ }
110
+ }
111
+ }
112
+ },
113
+ "entry": {
114
+ "type": ["object", "null"],
115
+ "additionalProperties": true,
116
+ "description": "人用入口:不经过 AI Agent 打开项目菜单。缺省时仍可用 agenthelm project。",
117
+ "properties": {
118
+ "api": {"type": "integer", "minimum": 1, "description": "项目入口的接口版本;运行时不支持时启动器提示更新"},
119
+ "launcher": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$", "description": "根目录启动器的文件名"},
120
+ "about": {"type": "string"},
121
+ "guide": {"$ref": "#/$defs/relativePath"},
122
+ "tools": {"$ref": "#/$defs/relativePath"},
123
+ "where": {
124
+ "type": "array",
125
+ "items": {"type": "object", "required": ["label", "path"],
126
+ "properties": {"label": {"type": "string"}, "path": {"type": "string"}}}
127
+ },
128
+ "start": {"$ref": "#/$defs/stringArray"},
129
+ "items": {
130
+ "type": "object",
131
+ "additionalProperties": true,
132
+ "required": ["command"],
133
+ "properties": {
134
+ "command": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}},
135
+ "write": {"type": "boolean"},
136
+ "status_map": {
137
+ "type": "object",
138
+ "additionalProperties": {"enum": ["active", "waiting", "captured", "suspended", "done", "abandoned"]}
139
+ }
140
+ }
141
+ }
142
+ }
143
+ },
144
+ "privacy": {
145
+ "type": "object",
146
+ "additionalProperties": true,
147
+ "required": ["forbidden_default_reads", "generated_outputs"],
148
+ "properties": {
149
+ "forbidden_default_reads": {"$ref": "#/$defs/pathArray"},
150
+ "generated_outputs": {"$ref": "#/$defs/pathArray"}
151
+ }
152
+ }
153
+ },
154
+ "$defs": {
155
+ "stringArray": {
156
+ "type": "array",
157
+ "items": {"type": "string", "minLength": 1},
158
+ "uniqueItems": true
159
+ },
160
+ "relativePath": {
161
+ "type": "string",
162
+ "minLength": 1,
163
+ "not": {"pattern": "^(?:/|~|[A-Za-z]:[\\\\/])"}
164
+ },
165
+ "pathArray": {
166
+ "type": "array",
167
+ "items": {"$ref": "#/$defs/relativePath"},
168
+ "uniqueItems": true
169
+ }
170
+ }
171
+ }