@weapp-agent/cli 0.0.0 → 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/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-agent/cli",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"description": "Bootstrap placeholder for Weapp Agent CLI trusted publishing",
|
|
5
3
|
"type": "module",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"private": false,
|
|
6
|
+
"description": "AI coding agent for WeChat mini-programs",
|
|
7
|
+
"author": "ice breaker <hi@sonofmagic.top>",
|
|
6
8
|
"license": "MIT",
|
|
7
9
|
"homepage": "https://vite.weapp.dev/guide/agent/getting-started",
|
|
8
10
|
"repository": {
|
|
@@ -10,13 +12,61 @@
|
|
|
10
12
|
"url": "git+https://github.com/weapp-vite/weapp-vite.git",
|
|
11
13
|
"directory": "packages/agent-cli"
|
|
12
14
|
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/weapp-vite/weapp-vite/issues"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"weapp-vite",
|
|
20
|
+
"weapp",
|
|
21
|
+
"agent"
|
|
22
|
+
],
|
|
23
|
+
"bin": {
|
|
24
|
+
"weapp-agent": "dist/index.mjs"
|
|
25
|
+
},
|
|
13
26
|
"files": [
|
|
14
27
|
"README.md",
|
|
15
|
-
"
|
|
28
|
+
"dist",
|
|
29
|
+
"skills"
|
|
16
30
|
],
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=24.15.0"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@ai-sdk/anthropic": "4.0.76",
|
|
36
|
+
"@ai-sdk/openai": "4.0.89",
|
|
37
|
+
"@ai-sdk/openai-compatible": "3.0.66",
|
|
38
|
+
"@modelcontextprotocol/client": "^2.3.1",
|
|
39
|
+
"@modelcontextprotocol/server": "^2.3.1",
|
|
40
|
+
"@weapp-vite/acceptance": "0.1.0",
|
|
41
|
+
"@weapp-vite/mcp": "2.0.0",
|
|
42
|
+
"ai": "7.0.133",
|
|
43
|
+
"commander": "15.0.0",
|
|
44
|
+
"diff": "9.0.0",
|
|
45
|
+
"execa": "10.1.0",
|
|
46
|
+
"ink": "8.0.0",
|
|
47
|
+
"ink-text-input": "6.0.0",
|
|
48
|
+
"react": "19.3.0",
|
|
49
|
+
"weapp-ide-cli": "6.2.0",
|
|
50
|
+
"zod": "4.6.5"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@types/react": "^19.3.0",
|
|
54
|
+
"@weapp-agent/core": "0.0.0",
|
|
55
|
+
"@weapp-agent/mini-program": "0.0.1",
|
|
56
|
+
"@weapp-agent/providers": "0.0.0",
|
|
57
|
+
"tsdown": "0.23.0"
|
|
58
|
+
},
|
|
17
59
|
"publishConfig": {
|
|
18
60
|
"access": "public",
|
|
19
|
-
"registry": "https://registry.npmjs.org"
|
|
20
|
-
|
|
61
|
+
"registry": "https://registry.npmjs.org"
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"build": "tsdown",
|
|
65
|
+
"dev": "tsx src/index.ts",
|
|
66
|
+
"typecheck": "tsc --noEmit",
|
|
67
|
+
"test": "vitest run",
|
|
68
|
+
"lint": "eslint .",
|
|
69
|
+
"prebuild": "node ../../scripts/weapp-agent/sync-skill.mjs",
|
|
70
|
+
"test:pack": "node ../../scripts/weapp-agent/smoke-pack.mjs"
|
|
21
71
|
}
|
|
22
|
-
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: weapp-acceptance
|
|
3
|
+
description: Validate changes in weapp-vite native or Wevu WeChat projects with Weapp Agent build checks, deterministic DevTools scenarios, and source-bound evidence. Use after implementing a mini-program feature or investigating a failed acceptance task.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Weapp acceptance
|
|
7
|
+
|
|
8
|
+
Keep planning and code edits in the host agent. Weapp Agent executes checks and collects evidence; it does not need another model or API key.
|
|
9
|
+
|
|
10
|
+
1. Call `weapp_project_inspect` when available, or `wv accept <project> --inspect --json`. Limit acceptance claims to supported weapp-vite native/Wevu projects on WeChat.
|
|
11
|
+
2. Maintain `acceptance.scenarios` in `weapp-acceptance.config.json` for the requested behavior. Read [scenarios.md](references/scenarios.md) when creating or changing a scenario. Preserve unrelated checks and user changes. Choose assertions from the requested outcome, not from whichever output the current code produces.
|
|
12
|
+
3. Start `weapp_acceptance_start`, retain its `jobId`, and query `weapp_acceptance_status` until it is no longer `running`. Use CLI `wv accept <project> --json` if MCP is unavailable; CLI waits for completion. Do not launch duplicate jobs to poll progress.
|
|
13
|
+
4. Read `weapp_acceptance_report` and relevant named artifacts. Repair the cause of failures within the user's task, then run a new acceptance job. Repeated environment failures require resolving the stated prerequisite, not repeated navigation or input.
|
|
14
|
+
|
|
15
|
+
Honor existing host authorization. A tool's `action_required` result does not authorize silently adding `--trust`. Explain the concrete scripts/configuration that need review. Scenario edits invalidate the stored trust decision. Never lower required checks, delete assertions, or replace actual values with expected values to obtain a pass.
|
|
16
|
+
|
|
17
|
+
Reports use `version: 2`. Claim acceptance passed only when `passed` is true and `snapshot.stale` is false; state the report's `requiredChecks`. Build-only acceptance is not runtime verification. `verify --json` is the legacy command report and is not a full acceptance verdict.
|
|
18
|
+
|
|
19
|
+
Report failures, missing evidence, and environment blockers distinctly. Screenshots support inspection but do not prove visual correctness. `runtime: wechat-devtools` describes the developer-tool simulator, not a physical device. Interrupted tasks are not replayed: inspect the last recorded step and current state before starting a fresh job.
|
|
20
|
+
|
|
21
|
+
When reporting completion, provide the job ID, checks performed, failed/unverified categories, and relevant screenshot/log artifacts. Do not claim a runtime action occurred unless the report records it.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Scenario contract (version 1)
|
|
2
|
+
|
|
3
|
+
Add model-free configuration to the project, preserving existing fields:
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"version": 1,
|
|
8
|
+
"verification": [
|
|
9
|
+
{ "kind": "build", "command": "pnpm", "args": ["run", "build"] }
|
|
10
|
+
],
|
|
11
|
+
"acceptance": {
|
|
12
|
+
"requiredChecks": ["build", "devtools"],
|
|
13
|
+
"scenarios": ["acceptance/counter.json"],
|
|
14
|
+
"timeoutMs": 600000
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Use the project's actual package manager and scripts. Available required categories: typecheck, build, test, devtools. The default requires build and devtools; categories omitted from requirements are still reported when configured. An arbitrary command labelled devtools is not runtime proof for version 2 acceptance.
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"version": 1,
|
|
24
|
+
"name": "counter increments",
|
|
25
|
+
"steps": [
|
|
26
|
+
{ "action": "route", "path": "/pages/agent-proof/index" },
|
|
27
|
+
{ "action": "wait", "selector": "#count", "timeoutMs": 5000 },
|
|
28
|
+
{ "action": "assert", "selector": "#count", "text": "0" },
|
|
29
|
+
{ "action": "tap", "selector": "#increment" },
|
|
30
|
+
{ "action": "assert", "selector": "#count", "text": "1" },
|
|
31
|
+
{ "action": "screenshot" }
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Each scenario starts with route (reLaunch), contains at least one assert, and has a unique name. `find`, `tap`, and `wait` take selector; `input` takes selector and string value. `assert` compares exact element text, polling for up to timeoutMs (default 5000, maximum 60000). `wait` waits for an element. No JavaScript/eval step is supported. Use real route names and selectors from the project.
|
|
37
|
+
|
|
38
|
+
Navigation, input and taps run once. Only read assertions poll. Each successful scenario gets an automatic screenshot; a failed scenario attempts a screenshot. Console evidence is collected at the end when the connection remains available. Credentials, configured scripts, acceptance files and the AppID require review before trusting a project. Use an isolated test environment for interactions with external effects.
|
|
39
|
+
|
|
40
|
+
No automatic upload, publishing or submission is part of this workflow.
|