@kairyou/agent-tools 0.15.0 → 0.17.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.md +6 -6
- package/README.zh-CN.md +6 -6
- package/{integrations → capabilities}/vision/mcp-server.mjs +1 -1
- package/dist/log/hook.mjs +2 -2
- package/dist/log/opencode-plugin.mjs +1 -1
- package/dist/statusline/claude-statusline.mjs +2 -2
- package/dist/usage/cli.mjs +4 -4
- package/dist/usage/codex-hook.mjs +1 -1
- package/dist/usage/core.mjs +11 -11
- package/dist/usage/opencode-plugin.mjs +1 -1
- package/dist/usage/opencode-tui.mjs +1 -1
- package/dist/vision/cli.mjs +13 -13
- package/dist/vision/mcp-server.mjs +12 -12
- package/docs/en/repository-structure.md +4 -4
- package/docs/zh-CN/repository-structure.md +4 -4
- package/package.json +3 -3
- package/scripts/build.mjs +13 -13
- package/scripts/install.mjs +13 -13
- package/skills/systems/at-zentao/SKILL.md +184 -0
- package/skills/systems/at-zentao/scripts/zentao-cli.mjs +607 -0
- package/skills/workflow/at-review/SKILL.md +4 -2
- package/skills/workflow/at-review/references/review-targets.md +70 -0
- package/skills/integrations/at-zentao/SKILL.md +0 -148
- /package/{integrations → capabilities}/log/hook.mjs +0 -0
- /package/{integrations → capabilities}/log/opencode-plugin.mjs +0 -0
- /package/{integrations → capabilities}/statusline/claude-statusline.mjs +0 -0
- /package/{integrations → capabilities}/usage/cli.mjs +0 -0
- /package/{integrations → capabilities}/usage/codex-hook.mjs +0 -0
- /package/{integrations → capabilities}/usage/core.mjs +0 -0
- /package/{integrations → capabilities}/usage/lib/cache.mjs +0 -0
- /package/{integrations → capabilities}/usage/lib/config.mjs +0 -0
- /package/{integrations → capabilities}/usage/lib/context.mjs +0 -0
- /package/{integrations → capabilities}/usage/lib/format.mjs +0 -0
- /package/{integrations → capabilities}/usage/lib/http.mjs +0 -0
- /package/{integrations → capabilities}/usage/lib/routes.mjs +0 -0
- /package/{integrations → capabilities}/usage/lib/urls.mjs +0 -0
- /package/{integrations → capabilities}/usage/opencode-plugin.mjs +0 -0
- /package/{integrations → capabilities}/usage/opencode-tui.mjs +0 -0
- /package/{integrations → capabilities}/usage/routes/.gitkeep +0 -0
- /package/{integrations → capabilities}/usage/skills/at-usage/SKILL.md +0 -0
- /package/{integrations → capabilities}/vision/lib/cli.mjs +0 -0
- /package/{integrations → capabilities}/vision/lib/config.mjs +0 -0
- /package/{integrations → capabilities}/vision/lib/errors.mjs +0 -0
- /package/{integrations → capabilities}/vision/lib/image-source.mjs +0 -0
- /package/{integrations → capabilities}/vision/lib/inspect.mjs +0 -0
- /package/{integrations → capabilities}/vision/lib/providers/anthropic-compatible.mjs +0 -0
- /package/{integrations → capabilities}/vision/lib/providers/openai-compatible.mjs +0 -0
- /package/{integrations → capabilities}/vision/lib/providers/shared.mjs +0 -0
- /package/{integrations → capabilities}/vision/lib/rate-limit.mjs +0 -0
- /package/{integrations → capabilities}/vision/lib/redact.mjs +0 -0
- /package/{integrations → capabilities}/vision/skills/at-vision/SKILL.md +0 -0
package/scripts/install.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// agent-tools installer: wires statusline / usage into each agent's config.
|
|
3
3
|
// Runtime-dependent skills are installed with their capability. Standalone
|
|
4
|
-
//
|
|
4
|
+
// Standalone skills are still handled by `npx skills add`.
|
|
5
5
|
//
|
|
6
6
|
// Capabilities (all global for now — they target the user-level config):
|
|
7
7
|
// statusline Claude Code statusLine script (claude only).
|
|
@@ -68,7 +68,7 @@ const PACKAGE_VERSION = (() => {
|
|
|
68
68
|
}
|
|
69
69
|
})();
|
|
70
70
|
// Everything copied into ~/.agent-tools is built output from dist/ (see
|
|
71
|
-
// scripts/build.mjs);
|
|
71
|
+
// scripts/build.mjs); capabilities/ holds the sources.
|
|
72
72
|
const SOURCE = {
|
|
73
73
|
logHook: path.join(REPO_ROOT, "dist", "log", "hook.mjs"),
|
|
74
74
|
logOpencodePlugin: path.join(REPO_ROOT, "dist", "log", "opencode-plugin.mjs"),
|
|
@@ -100,12 +100,12 @@ const AGENT_CAPS = {
|
|
|
100
100
|
};
|
|
101
101
|
const VISION_MCP_NAME = "agent-tools-vision";
|
|
102
102
|
const VISION_SKILL_NAME = "at-vision";
|
|
103
|
-
// The at-vision skill ships inside the vision capability dir (
|
|
103
|
+
// The at-vision skill ships inside the vision capability dir (capabilities/vision),
|
|
104
104
|
// not skills/: it is unusable without the MCP server, so it must not surface
|
|
105
105
|
// as an independently installable skill.
|
|
106
|
-
const VISION_SKILL_SRC = path.join(REPO_ROOT, "
|
|
106
|
+
const VISION_SKILL_SRC = path.join(REPO_ROOT, "capabilities", "vision", "skills", VISION_SKILL_NAME);
|
|
107
107
|
const USAGE_SKILL_NAME = "at-usage";
|
|
108
|
-
const USAGE_SKILL_SRC = path.join(REPO_ROOT, "
|
|
108
|
+
const USAGE_SKILL_SRC = path.join(REPO_ROOT, "capabilities", "usage", "skills", USAGE_SKILL_NAME);
|
|
109
109
|
const VISION_BUNDLED_MCP_SERVER = path.join(REPO_ROOT, "dist", "vision", "mcp-server.mjs");
|
|
110
110
|
const VISION_BUNDLED_CLI = path.join(REPO_ROOT, "dist", "vision", "cli.mjs");
|
|
111
111
|
const INSTALL_STATE_PATH = path.join(INSTALL_ROOT, "install-state.json");
|
|
@@ -292,7 +292,7 @@ function syncUsageRoutesDir(dryRun) {
|
|
|
292
292
|
function parseArgs(argv) {
|
|
293
293
|
const opts = {
|
|
294
294
|
agents: [],
|
|
295
|
-
|
|
295
|
+
capabilities: [],
|
|
296
296
|
settings: null,
|
|
297
297
|
codexHooks: null,
|
|
298
298
|
opencodeConfigDir: null,
|
|
@@ -343,15 +343,15 @@ function parseArgs(argv) {
|
|
|
343
343
|
console.error(`Unknown option: ${a}`);
|
|
344
344
|
process.exit(2);
|
|
345
345
|
}
|
|
346
|
-
opts.
|
|
346
|
+
opts.capabilities.push(a);
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
349
|
if (opts.agents.length === 0) opts.agents = ["claude"];
|
|
350
|
-
if (!opts.help && opts.
|
|
350
|
+
if (!opts.help && opts.capabilities.length === 0) {
|
|
351
351
|
console.error(`Missing capability (available: ${ALL_CAPS.join(", ")})`);
|
|
352
352
|
process.exit(2);
|
|
353
353
|
}
|
|
354
|
-
for (const name of opts.
|
|
354
|
+
for (const name of opts.capabilities) {
|
|
355
355
|
if (!ALL_CAPS.includes(name)) {
|
|
356
356
|
console.error(`Unknown capability: ${name} (available: ${ALL_CAPS.join(", ")})`);
|
|
357
357
|
process.exit(2);
|
|
@@ -361,14 +361,14 @@ function parseArgs(argv) {
|
|
|
361
361
|
}
|
|
362
362
|
|
|
363
363
|
function wants(opts, cap) {
|
|
364
|
-
return opts.
|
|
364
|
+
return opts.capabilities.length === 0 || opts.capabilities.includes(cap);
|
|
365
365
|
}
|
|
366
366
|
|
|
367
367
|
function validateAgentCapabilities(opts) {
|
|
368
368
|
const invalid = [];
|
|
369
369
|
for (const agent of opts.agents) {
|
|
370
370
|
const supported = AGENT_CAPS[agent] || [];
|
|
371
|
-
for (const cap of opts.
|
|
371
|
+
for (const cap of opts.capabilities) {
|
|
372
372
|
if (!supported.includes(cap)) invalid.push(`${cap} -a ${agent}`);
|
|
373
373
|
}
|
|
374
374
|
}
|
|
@@ -1181,7 +1181,7 @@ function cleanupVisionRuntimeIfUnused(opts) {
|
|
|
1181
1181
|
try {
|
|
1182
1182
|
fs.rmdirSync(path.dirname(VISION_RATE_LIMIT_STATE));
|
|
1183
1183
|
} catch {
|
|
1184
|
-
// The shared cache directory may contain state for other
|
|
1184
|
+
// The shared cache directory may contain state for other capabilities.
|
|
1185
1185
|
}
|
|
1186
1186
|
}
|
|
1187
1187
|
console.log(` removed unused vision runtime ${VISION_RUNTIME_DIR}`);
|
|
@@ -1218,7 +1218,7 @@ function main() {
|
|
|
1218
1218
|
}
|
|
1219
1219
|
|
|
1220
1220
|
// Standalone vision commands dispatch before capability parsing so image
|
|
1221
|
-
// paths and questions are never mistaken for
|
|
1221
|
+
// paths and questions are never mistaken for capabilities.
|
|
1222
1222
|
const subcommand = process.argv[2];
|
|
1223
1223
|
if (subcommand === "inspect-image") {
|
|
1224
1224
|
const { runInspectImageCli } = await import(
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: at-zentao
|
|
3
|
+
description: "Work ZenTao bugs/tasks end to end: fetch details, confirm understanding, fix, verify, stage with git add, then ask before committing and before writing status back to ZenTao. Supports single items and sequential batches. Use when the user references ZenTao (禅道) bugs or tasks."
|
|
4
|
+
argument-hint: "bug <id> | task <id> | bugs | tasks | export bug|task <id>"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# ZenTao Bug/Task Workflow
|
|
8
|
+
|
|
9
|
+
## Secure CLI boundary
|
|
10
|
+
|
|
11
|
+
This Skill bundles `scripts/zentao-cli.mjs`. Resolve the Skill root as the
|
|
12
|
+
directory containing this `SKILL.md`, then run the script with Node using its
|
|
13
|
+
resolved path from any working directory:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
node <skill-root>/scripts/zentao-cli.mjs <command>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The script is the only component allowed to read ZenTao configuration,
|
|
20
|
+
exchange credentials for a token, send authenticated requests, or inspect raw
|
|
21
|
+
error responses. Run it directly without reading or copying its source into
|
|
22
|
+
the conversation. Never read `~/.agent-tools/config.jsonc`, print ZenTao env
|
|
23
|
+
vars, call the token endpoint, or construct a ZenTao `Token` header yourself.
|
|
24
|
+
|
|
25
|
+
The CLI emits only sanitized JSON. Treat a nonzero exit as a stopped ZenTao
|
|
26
|
+
operation and report its safe `error`, `message`, and optional HTTP `status`.
|
|
27
|
+
Do not work around the CLI with `curl` when authentication or an endpoint
|
|
28
|
+
fails.
|
|
29
|
+
|
|
30
|
+
## Configuration
|
|
31
|
+
|
|
32
|
+
The CLI reads the global `~/.agent-tools/config.jsonc`, or
|
|
33
|
+
`$AGENT_TOOLS_HOME/config.jsonc` when `AGENT_TOOLS_HOME` is set. It never reads
|
|
34
|
+
repository-level configuration. Basic configuration:
|
|
35
|
+
|
|
36
|
+
```jsonc
|
|
37
|
+
{
|
|
38
|
+
"zentao": {
|
|
39
|
+
"url": "https://zentao.example.com",
|
|
40
|
+
"account": "user",
|
|
41
|
+
"password": "your-password"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
To avoid storing the password in the file, use
|
|
47
|
+
`"password": { "env": "ZENTAO_PASSWORD" }` and set that environment variable.
|
|
48
|
+
Direct env overrides are `ZENTAO_URL`, `ZENTAO_ACCOUNT`, and
|
|
49
|
+
`ZENTAO_PASSWORD`. `ZENTAO_TOKEN` may be used instead of password exchange; it
|
|
50
|
+
is accepted only from the environment.
|
|
51
|
+
|
|
52
|
+
When configuration is missing, tell the user which file to edit and show the
|
|
53
|
+
template above. Never ask them to paste a password or token into chat, and do
|
|
54
|
+
not edit or inspect the file after they add credentials. Ask them to say
|
|
55
|
+
"done", then validate with:
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
node <skill-root>/scripts/zentao-cli.mjs doctor
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Report only whether the connection succeeded and whether authentication used
|
|
62
|
+
`token` or `account-password`.
|
|
63
|
+
|
|
64
|
+
## CLI commands
|
|
65
|
+
|
|
66
|
+
Read-only commands:
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
node <skill-root>/scripts/zentao-cli.mjs list bugs
|
|
70
|
+
node <skill-root>/scripts/zentao-cli.mjs list tasks
|
|
71
|
+
node <skill-root>/scripts/zentao-cli.mjs get bug <id>
|
|
72
|
+
node <skill-root>/scripts/zentao-cli.mjs get task <id>
|
|
73
|
+
node <skill-root>/scripts/zentao-cli.mjs get bug <id> --download-dir <path>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`get` downloads token-gated inline images and attachments into a temporary
|
|
77
|
+
directory by default and returns only local paths. Inspect those local files;
|
|
78
|
+
never pass the original ZenTao URL to an image tool.
|
|
79
|
+
|
|
80
|
+
Write commands require JSON on stdin and are allowed only after the explicit
|
|
81
|
+
confirmation steps below:
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
node <skill-root>/scripts/zentao-cli.mjs comment bug <id>
|
|
85
|
+
node <skill-root>/scripts/zentao-cli.mjs comment task <id>
|
|
86
|
+
node <skill-root>/scripts/zentao-cli.mjs resolve bug <id>
|
|
87
|
+
node <skill-root>/scripts/zentao-cli.mjs finish task <id>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Input shapes:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{"comment":"Root cause and result."}
|
|
94
|
+
{"resolution":"fixed","resolvedBuild":"trunk","comment":"Root cause and result, commit abc1234."}
|
|
95
|
+
{"currentConsumed":1.5,"realStarted":"2026-08-11 09:00:00","finishedDate":"2026-08-11 10:30:00"}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
For `duplicate`, also pass `"duplicateBug": <id>`. Send JSON through stdin,
|
|
99
|
+
not as a command-line argument. The CLI handles UTF-8 form encoding and
|
|
100
|
+
computes a task's total consumed hours from its current ZenTao value.
|
|
101
|
+
|
|
102
|
+
## Usage
|
|
103
|
+
|
|
104
|
+
- `/at-zentao bug <id>` — handle a single bug.
|
|
105
|
+
- `/at-zentao task <id>` — handle a single task.
|
|
106
|
+
- `/at-zentao bugs` — list bugs assigned to the configured account; let the
|
|
107
|
+
user select one or more.
|
|
108
|
+
- `/at-zentao tasks` — list assigned tasks and let the user select.
|
|
109
|
+
- `/at-zentao export bug <id>` or `export task <id>` — create a read-only,
|
|
110
|
+
self-contained handoff bundle.
|
|
111
|
+
|
|
112
|
+
If a list response includes pager data showing more items than returned, tell
|
|
113
|
+
the user the shown and total counts. Do not silently imply the list is complete.
|
|
114
|
+
Do not browse through products/projects; start from assigned lists or an
|
|
115
|
+
explicit item id.
|
|
116
|
+
|
|
117
|
+
## Per-item workflow
|
|
118
|
+
|
|
119
|
+
Follow these steps in order:
|
|
120
|
+
|
|
121
|
+
1. **Fetch details** — use the CLI `get` command. Read every downloaded image
|
|
122
|
+
now so screenshots inform the fix. If no image-inspection tool is available,
|
|
123
|
+
continue from text and state that screenshots were skipped.
|
|
124
|
+
2. **Restate and confirm** — explain the problem and intended fix in your own
|
|
125
|
+
words. Ask before editing when the item is ambiguous.
|
|
126
|
+
3. **Locate the code** — search the current project and explain how the relevant
|
|
127
|
+
code was identified.
|
|
128
|
+
4. **Fix** — change only what this item requires.
|
|
129
|
+
5. **Verify** — run the narrowest meaningful test, build, or typecheck. Reproduce
|
|
130
|
+
a code-observable bug before and after when practical. For visual changes,
|
|
131
|
+
state what was checked and what still needs the user's eyes. Stop on a failed
|
|
132
|
+
check.
|
|
133
|
+
6. **Stage** — first inspect `git diff --staged --name-only`. If unrelated files
|
|
134
|
+
are staged, stop and ask how to handle them. Otherwise stage only files for
|
|
135
|
+
this item by explicit path; never use `git add -A`.
|
|
136
|
+
7. **Ask whether to commit** — offer Commit, Not yet, or Needs adjustment. For a
|
|
137
|
+
commit, show a single-line Conventional Commit message before committing.
|
|
138
|
+
Put `bug#<id>` or `task#<id>` immediately after `type(scope):`, for example
|
|
139
|
+
`fix(auth): bug#30887 reject expired sessions`. Never commit automatically.
|
|
140
|
+
8. **Ask whether to update ZenTao** — draft the exact resolution/comment and
|
|
141
|
+
offer Submit, Edit first, or Comment only. Never invoke a write CLI command
|
|
142
|
+
before confirmation. A `fixed` resolution must cite a real commit; without a
|
|
143
|
+
commit, offer at most a comment with status unchanged.
|
|
144
|
+
|
|
145
|
+
Bug resolutions are `fixed`, `notrepro`, `duplicate`, `bydesign`, `external`,
|
|
146
|
+
`postponed`, and `willnotfix`. Choose what matches the verified outcome. A
|
|
147
|
+
write-back comment is one sentence containing root cause, change summary, and
|
|
148
|
+
the commit hash when committed.
|
|
149
|
+
|
|
150
|
+
For tasks, default to comment only. Offer `finish` only for a simple task
|
|
151
|
+
completed in one sitting, and ask the user for `currentConsumed`; never invent
|
|
152
|
+
hours. For multi-day work or per-day time records, comment and direct the user
|
|
153
|
+
to ZenTao's web UI.
|
|
154
|
+
|
|
155
|
+
## Export mode
|
|
156
|
+
|
|
157
|
+
Export is read-only and never fixes code, commits, or writes back:
|
|
158
|
+
|
|
159
|
+
1. Fetch the item with `get`, including every downloaded image/attachment.
|
|
160
|
+
2. Ask where to save; default to the Desktop and never the code repository.
|
|
161
|
+
3. Write a Markdown handoff with id, title, status, severity/priority,
|
|
162
|
+
module/product, description/steps, and useful history available in the safe
|
|
163
|
+
CLI response. Do not include credentials or login-gated URLs.
|
|
164
|
+
4. With no images, write `<dest>/zentao-<bug|task>-<id>.md`. With images, create
|
|
165
|
+
a same-named directory containing the Markdown and real image files, rewrite
|
|
166
|
+
image references to relative paths, and zip only when a single artifact is
|
|
167
|
+
needed.
|
|
168
|
+
|
|
169
|
+
## Batch mode
|
|
170
|
+
|
|
171
|
+
- Process one item at a time, each with its own stage and commit.
|
|
172
|
+
- Show the pending order before starting.
|
|
173
|
+
- Continue only after the current item is committed. If it remains staged,
|
|
174
|
+
offer commit, stash and continue, or stop.
|
|
175
|
+
- After each item, ask whether to continue or stop and summarize progress.
|
|
176
|
+
|
|
177
|
+
## Hard rules
|
|
178
|
+
|
|
179
|
+
- Never expose account, password, token, cookies, or authorization headers.
|
|
180
|
+
- Never bypass the bundled CLI for ZenTao authentication or API access.
|
|
181
|
+
- Never commit or change ZenTao state without separate explicit confirmation.
|
|
182
|
+
- Keep the `bug#<id>` or `task#<id>` token in every related commit subject.
|
|
183
|
+
- Collect free-form values such as output paths and hours in plain chat, not a
|
|
184
|
+
fixed-choice prompt. Passwords and tokens are never collected in chat.
|