@fitlab-ai/agent-infra 0.5.7 → 0.5.9

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 (132) hide show
  1. package/README.md +44 -4
  2. package/README.zh-CN.md +44 -4
  3. package/lib/defaults.json +4 -2
  4. package/lib/init.js +18 -1
  5. package/lib/sandbox/commands/vm.js +7 -1
  6. package/lib/sandbox/constants.js +3 -0
  7. package/lib/sandbox/engine.js +57 -3
  8. package/lib/sandbox/runtimes/base.dockerfile +9 -2
  9. package/lib/sandbox/shell.js +36 -2
  10. package/lib/update.js +14 -3
  11. package/package.json +6 -4
  12. package/templates/.agents/QUICKSTART.en.md +2 -2
  13. package/templates/.agents/QUICKSTART.zh-CN.md +2 -2
  14. package/templates/.agents/README.en.md +1 -1
  15. package/templates/.agents/README.zh-CN.md +1 -1
  16. package/templates/.agents/rules/create-issue.en.md +5 -0
  17. package/templates/.agents/rules/create-issue.github.en.md +178 -0
  18. package/templates/.agents/rules/create-issue.github.zh-CN.md +178 -0
  19. package/templates/.agents/rules/create-issue.zh-CN.md +5 -0
  20. package/templates/.agents/rules/issue-pr-commands.github.en.md +60 -0
  21. package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +60 -0
  22. package/templates/.agents/rules/issue-sync.en.md +14 -0
  23. package/templates/.agents/rules/issue-sync.github.en.md +15 -1
  24. package/templates/.agents/rules/issue-sync.github.zh-CN.md +15 -1
  25. package/templates/.agents/rules/issue-sync.zh-CN.md +14 -0
  26. package/templates/.agents/rules/label-milestone-setup.github.en.md +10 -0
  27. package/templates/.agents/rules/label-milestone-setup.github.zh-CN.md +10 -0
  28. package/templates/.agents/rules/milestone-inference.github.en.md +2 -2
  29. package/templates/.agents/rules/milestone-inference.github.zh-CN.md +2 -2
  30. package/templates/.agents/rules/release-commands.github.en.md +16 -0
  31. package/templates/.agents/rules/release-commands.github.zh-CN.md +16 -0
  32. package/templates/.agents/scripts/platform-adapters/find-existing-task.github.js +272 -0
  33. package/templates/.agents/scripts/platform-adapters/find-existing-task.js +5 -0
  34. package/templates/.agents/scripts/platform-adapters/platform-sync.github.js +134 -9
  35. package/templates/.agents/scripts/platform-adapters/platform-sync.js +7 -0
  36. package/templates/.agents/skills/analyze-task/SKILL.en.md +3 -3
  37. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +3 -3
  38. package/templates/.agents/skills/analyze-task/config/verify.json +3 -1
  39. package/templates/.agents/skills/block-task/config/verify.json +2 -1
  40. package/templates/.agents/skills/cancel-task/SKILL.en.md +2 -2
  41. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +2 -2
  42. package/templates/.agents/skills/cancel-task/config/verify.json +2 -1
  43. package/templates/.agents/skills/close-codescan/SKILL.en.md +2 -2
  44. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +2 -2
  45. package/templates/.agents/skills/commit/SKILL.en.md +1 -1
  46. package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
  47. package/templates/.agents/skills/commit/config/verify.json +2 -1
  48. package/templates/.agents/skills/complete-task/SKILL.en.md +1 -1
  49. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +1 -1
  50. package/templates/.agents/skills/complete-task/config/verify.json +2 -1
  51. package/templates/.agents/skills/create-pr/SKILL.en.md +2 -2
  52. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +2 -2
  53. package/templates/.agents/skills/create-pr/config/verify.json +2 -1
  54. package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +7 -17
  55. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +27 -37
  56. package/templates/.agents/skills/create-release-note/SKILL.en.md +9 -9
  57. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +9 -9
  58. package/templates/.agents/skills/create-task/SKILL.en.md +70 -12
  59. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +71 -13
  60. package/templates/.agents/skills/create-task/config/verify.json +6 -1
  61. package/templates/.agents/skills/implement-task/SKILL.en.md +1 -1
  62. package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +1 -1
  63. package/templates/.agents/skills/implement-task/config/verify.json +3 -1
  64. package/templates/.agents/skills/implement-task/reference/implementation-rules.en.md +7 -12
  65. package/templates/.agents/skills/implement-task/reference/implementation-rules.zh-CN.md +7 -12
  66. package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
  67. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
  68. package/templates/.agents/skills/import-issue/SKILL.en.md +40 -10
  69. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +40 -10
  70. package/templates/.agents/skills/init-labels/SKILL.en.md +9 -9
  71. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +9 -9
  72. package/templates/.agents/skills/init-milestones/SKILL.en.md +7 -7
  73. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +7 -7
  74. package/templates/.agents/skills/plan-task/SKILL.en.md +1 -1
  75. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +1 -1
  76. package/templates/.agents/skills/plan-task/config/verify.json +3 -1
  77. package/templates/.agents/skills/refine-task/SKILL.en.md +1 -1
  78. package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +1 -1
  79. package/templates/.agents/skills/refine-task/config/verify.json +3 -1
  80. package/templates/.agents/skills/refine-task/reference/fix-workflow.en.md +2 -2
  81. package/templates/.agents/skills/refine-task/reference/fix-workflow.zh-CN.md +2 -2
  82. package/templates/.agents/skills/restore-task/SKILL.en.md +13 -64
  83. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +13 -64
  84. package/templates/.agents/skills/review-task/SKILL.en.md +1 -1
  85. package/templates/.agents/skills/review-task/SKILL.zh-CN.md +1 -1
  86. package/templates/.agents/skills/review-task/config/verify.json +3 -1
  87. package/templates/.agents/skills/test/SKILL.en.md +45 -6
  88. package/templates/.agents/skills/test/SKILL.zh-CN.md +45 -6
  89. package/templates/.agents/skills/update-agent-infra/SKILL.en.md +2 -0
  90. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +2 -0
  91. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +56 -5
  92. package/templates/.claude/commands/import-issue.en.md +1 -1
  93. package/templates/.claude/commands/import-issue.zh-CN.md +1 -1
  94. package/templates/.claude/commands/init-labels.en.md +1 -1
  95. package/templates/.claude/commands/init-labels.zh-CN.md +1 -1
  96. package/templates/.claude/commands/init-milestones.en.md +1 -1
  97. package/templates/.claude/commands/init-milestones.zh-CN.md +1 -1
  98. package/templates/.claude/commands/restore-task.en.md +1 -1
  99. package/templates/.claude/commands/restore-task.zh-CN.md +1 -1
  100. package/templates/.claude/hooks/check-version-format.sh +1 -1
  101. package/templates/.gemini/commands/_project_/import-issue.en.toml +1 -1
  102. package/templates/.gemini/commands/_project_/import-issue.zh-CN.toml +1 -1
  103. package/templates/.gemini/commands/_project_/init-labels.en.toml +2 -2
  104. package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +2 -2
  105. package/templates/.gemini/commands/_project_/init-milestones.en.toml +2 -2
  106. package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +2 -2
  107. package/templates/.gemini/commands/_project_/restore-task.en.toml +1 -1
  108. package/templates/.gemini/commands/_project_/restore-task.zh-CN.toml +1 -1
  109. package/templates/{.github/hooks → .git-hooks}/check-version-format.sh +2 -2
  110. package/templates/.github/workflows/pr-label.yml +1 -1
  111. package/templates/.opencode/commands/import-issue.en.md +1 -1
  112. package/templates/.opencode/commands/import-issue.zh-CN.md +1 -1
  113. package/templates/.opencode/commands/init-labels.en.md +1 -1
  114. package/templates/.opencode/commands/init-labels.zh-CN.md +1 -1
  115. package/templates/.opencode/commands/init-milestones.en.md +1 -1
  116. package/templates/.opencode/commands/init-milestones.zh-CN.md +1 -1
  117. package/templates/.opencode/commands/restore-task.en.md +1 -1
  118. package/templates/.opencode/commands/restore-task.zh-CN.md +1 -1
  119. package/templates/.agents/skills/create-issue/SKILL.en.md +0 -118
  120. package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +0 -118
  121. package/templates/.agents/skills/create-issue/config/verify.json +0 -29
  122. package/templates/.agents/skills/create-issue/reference/label-and-type.en.md +0 -71
  123. package/templates/.agents/skills/create-issue/reference/label-and-type.zh-CN.md +0 -71
  124. package/templates/.agents/skills/create-issue/reference/template-matching.en.md +0 -45
  125. package/templates/.agents/skills/create-issue/reference/template-matching.zh-CN.md +0 -45
  126. package/templates/.claude/commands/create-issue.en.md +0 -8
  127. package/templates/.claude/commands/create-issue.zh-CN.md +0 -8
  128. package/templates/.gemini/commands/_project_/create-issue.en.toml +0 -8
  129. package/templates/.gemini/commands/_project_/create-issue.zh-CN.toml +0 -8
  130. package/templates/.opencode/commands/create-issue.en.md +0 -11
  131. package/templates/.opencode/commands/create-issue.zh-CN.md +0 -11
  132. /package/templates/{.github/hooks → .git-hooks}/pre-commit +0 -0
@@ -1,71 +0,0 @@
1
- # Labels, Issue Type, and Milestone Rules
2
-
3
- Read this file before applying labels, Issue Type, milestone, or `in:` labels.
4
-
5
- ## Default Body Format (Fallback)
6
-
7
- Recommended fallback:
8
-
9
- ```markdown
10
- ## Description
11
-
12
- {task-description}
13
-
14
- ## Requirements
15
-
16
- - [ ] {requirement-1}
17
- - [ ] {requirement-2}
18
- ```
19
-
20
- Map task types to GitHub labels and Issue Types, but keep only labels that actually exist.
21
-
22
- Fallback label mapping:
23
-
24
- | task.md type | GitHub label |
25
- |---|---|
26
- | `bug`, `bugfix` | `type: bug` |
27
- | `feature` | `type: feature` |
28
- | `enhancement` | `type: enhancement` |
29
- | `docs`, `documentation` | `type: documentation` |
30
- | `dependency-upgrade` | `type: dependency-upgrade` |
31
- | `task`, `chore` | `type: task` |
32
- | `refactor`, `refactoring` | `type: enhancement` |
33
- | other values | skip |
34
-
35
- Issue Type fallback mapping:
36
-
37
- | task.md type | GitHub Issue Type |
38
- |---|---|
39
- | `bug`, `bugfix` | `Bug` |
40
- | `feature`, `enhancement` | `Feature` |
41
- | `task`, `documentation`, `dependency-upgrade`, `chore`, `docs`, `refactor`, `refactoring`, and all other values | `Task` |
42
-
43
- ## Create the Issue
44
-
45
- Before creating the Issue, read `.agents/rules/issue-pr-commands.md` and use its "Create an Issue" command template.
46
-
47
- Before calling the creation command, follow `.agents/rules/issue-sync.md` / `.agents/rules/issue-pr-commands.md` to complete the prerequisite authentication and code-hosting platform detection steps.
48
-
49
- If no valid labels remain, omit label arguments.
50
-
51
- For milestone inference, read `.agents/rules/milestone-inference.md` and follow "Phase 1: `create-issue`" before creating the Issue.
52
-
53
- Issue Type setup follows the matching commands in `.agents/rules/issue-pr-commands.md`.
54
-
55
- - handle direct writes for labels, milestones, `in:` labels, and Issue Type by following the permission-degradation rules in `.agents/rules/issue-pr-commands.md` and `.agents/rules/issue-sync.md`
56
- - when those rules say to skip a direct write, continue without failing Issue creation
57
-
58
- `in:` labels (coarse selection):
59
-
60
- Prepare label edit arguments by following the Issue update command in `.agents/rules/issue-pr-commands.md`.
61
-
62
- Use the returned labels to do semantic matching against the task.md title and description:
63
- - add a label when the task **explicitly mentions** a module (for example, "fix CLI argument parsing" -> `in: cli`)
64
- - add a label when the task **strongly implies** a module
65
- - skip the label when the mapping is ambiguous or uncertain
66
-
67
- Principle: prefer missing labels over wrong labels. Coarse selection does not need to be perfect because implement-task / create-pr will refine `in:` labels from actual changed files later.
68
-
69
- Handle relevant `in:` labels by following the permission-degradation rules in `.agents/rules/issue-sync.md`. Do not fail Issue creation when `in:` labels are unavailable, irrelevant, or skipped by those rules.
70
-
71
- Skip unavailable labels, Issue Types, or milestones without failing the Issue creation flow.
@@ -1,71 +0,0 @@
1
- # Label、Issue Type 和 Milestone 规则
2
-
3
- 在应用 label、Issue Type、milestone 或 `in:` label 之前先读取本文件。
4
-
5
- ## 默认正文格式(Fallback)
6
-
7
- 推荐 fallback:
8
-
9
- ```markdown
10
- ## Description
11
-
12
- {task-description}
13
-
14
- ## Requirements
15
-
16
- - [ ] {requirement-1}
17
- - [ ] {requirement-2}
18
- ```
19
-
20
- 将任务类型映射到 GitHub label 和 Issue Type,但只保留仓库里实际存在的 label。
21
-
22
- Fallback label 映射:
23
-
24
- | task.md type | GitHub label |
25
- |---|---|
26
- | `bug`, `bugfix` | `type: bug` |
27
- | `feature` | `type: feature` |
28
- | `enhancement` | `type: enhancement` |
29
- | `docs`, `documentation` | `type: documentation` |
30
- | `dependency-upgrade` | `type: dependency-upgrade` |
31
- | `task`, `chore` | `type: task` |
32
- | `refactor`, `refactoring` | `type: enhancement` |
33
- | 其他值 | 跳过 |
34
-
35
- Issue Type fallback 映射:
36
-
37
- | task.md type | GitHub Issue Type |
38
- |---|---|
39
- | `bug`, `bugfix` | `Bug` |
40
- | `feature`, `enhancement` | `Feature` |
41
- | `task`, `documentation`, `dependency-upgrade`, `chore`, `docs`, `refactor`, `refactoring` 以及其他所有值 | `Task` |
42
-
43
- ## 创建 Issue
44
-
45
- 创建 Issue 时,执行前先读取 `.agents/rules/issue-pr-commands.md`,并使用其中的 “创建 Issue” 命令模板。
46
-
47
- 调用创建命令前,先按 `.agents/rules/issue-sync.md` / `.agents/rules/issue-pr-commands.md` 完成前置步骤中的认证和代码托管平台检测。
48
-
49
- 如果最终没有有效 label,就省略 label 参数。
50
-
51
- Milestone 推断规则见 `.agents/rules/milestone-inference.md` 的「阶段 1:`create-issue`」。推断前先读取该文件。
52
-
53
- Issue Type 设置同样遵循 `.agents/rules/issue-pr-commands.md` 中的对应命令。
54
-
55
- - Label、milestone、`in:` label 和 Issue Type 的直接设置,都按 `.agents/rules/issue-pr-commands.md` 与 `.agents/rules/issue-sync.md` 的权限降级规则处理
56
- - 当规则判定应跳过直接写入时,继续创建 Issue,不要让流程失败
57
-
58
- `in:` label(粗选):
59
-
60
- 执行前先按 `.agents/rules/issue-pr-commands.md` 的 Issue 更新命令准备 label 编辑参数。
61
-
62
- 从查询结果中,根据 task.md 的标题和描述进行语义匹配:
63
- - 任务描述**明确提及**某个模块(如"修复 CLI 参数解析"→ `in: cli`)→ 添加
64
- - 任务描述**强烈暗示**某个模块 → 添加
65
- - 无法确定或模糊 → **不添加**
66
-
67
- 原则:宁缺毋滥。粗选阶段不求精确,后续 implement-task / create-pr 阶段会基于实际改动文件精修。
68
-
69
- 相关 `in:` label 的添加按 `.agents/rules/issue-sync.md` 的权限降级规则处理。当 `in:` label 不可用、不相关或规则判定应跳过时,不要让创建 Issue 流程失败。
70
-
71
- 当 label、Issue Type 或 milestone 不可用时,应跳过并继续,不要让 Issue 创建失败。
@@ -1,45 +0,0 @@
1
- # Issue Template Matching
2
-
3
- Read this file before deciding how to build the Issue body from `.github/ISSUE_TEMPLATE`.
4
-
5
- ## Detect Issue Templates
6
-
7
- Search project templates with:
8
-
9
- ```bash
10
- rg --files .github/ISSUE_TEMPLATE -g '*.yml' -g '!config.yml'
11
- ```
12
-
13
- If templates exist, inspect their top-level `name:` fields and choose the best match for the task title and description.
14
-
15
- Typical candidate templates:
16
- - `bug_report.yml` for bug work
17
- - `question.yml` for question or investigation work
18
- - `feature_request.yml` for feature work
19
- - `documentation.yml` for documentation work
20
- - `other.yml` as the general fallback
21
-
22
- If no template matches clearly, choose the nearest candidate. If templates are missing, unreadable, or parsing fails, fall back to the default body path.
23
-
24
- ## Build the Body from the Matched Template
25
-
26
- Read the matched template's:
27
- - `name`
28
- - `type:`
29
- - `labels:`
30
- - `body:`
31
-
32
- Field handling rules:
33
- - `textarea` and `input`: use `attributes.label` as the markdown heading and fill values from task.md
34
- - `markdown`: skip template explanation prose
35
- - `dropdown` and `checkboxes`: skip
36
- - when task.md lacks a suitable value, write `N/A`
37
-
38
- Suggested field mapping:
39
-
40
- | Template field hint | task.md source |
41
- |---|---|
42
- | `summary`, `title` | task title |
43
- | `description`, `problem`, `what happened`, `issue-description`, `current-content` | task description |
44
- | `solution`, `requirements`, `steps`, `suggested-content`, `impact`, `context`, `alternatives`, `expected` | requirements list |
45
- | other `textarea` / `input` fields | task description, otherwise `N/A` |
@@ -1,45 +0,0 @@
1
- # Issue 模板匹配
2
-
3
- 在决定如何从 `.github/ISSUE_TEMPLATE` 构建 Issue 正文之前先读取本文件。
4
-
5
- ## 探测 Issue 模板
6
-
7
- 用下面的命令搜索项目模板:
8
-
9
- ```bash
10
- rg --files .github/ISSUE_TEMPLATE -g '*.yml' -g '!config.yml'
11
- ```
12
-
13
- 如果模板存在,检查其顶层 `name:` 字段,并为当前任务标题和描述选择最匹配的模板。
14
-
15
- 常见候选模板:
16
- - `bug_report.yml`:用于 bug 类工作
17
- - `question.yml`:用于问题排查或调研类工作
18
- - `feature_request.yml`:用于功能类工作
19
- - `documentation.yml`:用于文档类工作
20
- - `other.yml`:通用 fallback
21
-
22
- 如果没有明显匹配的模板,选择最接近的候选项。如果模板缺失、不可读取或解析失败,就回退到默认正文路径。
23
-
24
- ## 使用匹配到的模板构建正文
25
-
26
- 读取匹配模板中的:
27
- - `name`
28
- - `type:`
29
- - `labels:`
30
- - `body:`
31
-
32
- 字段处理规则:
33
- - `textarea` 和 `input`:使用 `attributes.label` 作为 Markdown 标题,并从 task.md 填充值
34
- - `markdown`:跳过模板解释性文字
35
- - `dropdown` 和 `checkboxes`:跳过
36
- - 当 task.md 没有合适值时,写入 `N/A`
37
-
38
- 建议字段映射:
39
-
40
- | 模板字段提示 | task.md 来源 |
41
- |---|---|
42
- | `summary`, `title` | 任务标题 |
43
- | `description`, `problem`, `what happened`, `issue-description`, `current-content` | 任务描述 |
44
- | `solution`, `requirements`, `steps`, `suggested-content`, `impact`, `context`, `alternatives`, `expected` | 需求列表 |
45
- | 其他 `textarea` / `input` 字段 | 优先使用任务描述,否则写 `N/A` |
@@ -1,8 +0,0 @@
1
- ---
2
- description: "Create a GitHub Issue from a task file"
3
- usage: "/create-issue <task-id>"
4
- ---
5
-
6
- Read and execute the create-issue skill from `.agents/skills/create-issue/SKILL.md`.
7
-
8
- Follow all steps defined in the skill exactly.
@@ -1,8 +0,0 @@
1
- ---
2
- description: "从任务文件创建 GitHub Issue"
3
- usage: "/create-issue <task-id>"
4
- ---
5
-
6
- 读取并执行 `.agents/skills/create-issue/SKILL.md` 中的 create-issue 技能。
7
-
8
- 严格按照技能中定义的所有步骤执行。
@@ -1,8 +0,0 @@
1
- description = "Create a GitHub Issue from a task file"
2
- prompt = """
3
- Create Issue for task {{args}}.
4
-
5
- Read and execute the create-issue skill from `.agents/skills/create-issue/SKILL.md`.
6
-
7
- Follow all steps defined in the skill exactly.
8
- """
@@ -1,8 +0,0 @@
1
- description = "从任务文件创建 GitHub Issue"
2
- prompt = """
3
- 为任务 {{args}} 创建 Issue。
4
-
5
- 读取并执行 `.agents/skills/create-issue/SKILL.md` 中的 create-issue 技能。
6
-
7
- 严格按照技能中定义的所有步骤执行。
8
- """
@@ -1,11 +0,0 @@
1
- ---
2
- description: "Create a GitHub Issue from a task file"
3
- agent: general
4
- subtask: false
5
- ---
6
-
7
- Create Issue for task $1.
8
-
9
- Read and execute the create-issue skill from `.agents/skills/create-issue/SKILL.md`.
10
-
11
- Follow all steps defined in the skill exactly.
@@ -1,11 +0,0 @@
1
- ---
2
- description: "从任务文件创建 GitHub Issue"
3
- agent: general
4
- subtask: false
5
- ---
6
-
7
- 为任务 $1 创建 Issue。
8
-
9
- 读取并执行 `.agents/skills/create-issue/SKILL.md` 中的 create-issue 技能。
10
-
11
- 严格按照技能中定义的所有步骤执行。