@archal/cli 0.3.1 → 0.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archal/cli",
3
- "version": "0.3.1",
3
+ "version": "0.4.1",
4
4
  "description": "The archal CLI — test AI agents against digital twins",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -36,26 +36,26 @@
36
36
  "node": ">=20"
37
37
  },
38
38
  "files": [
39
- "dist",
40
- "demo"
39
+ "dist"
41
40
  ],
42
- "scripts": {
43
- "build": "tsup src/index.ts --format esm --dts",
44
- "start": "tsx src/index.ts",
45
- "test": "vitest run",
46
- "typecheck": "tsc --noEmit"
47
- },
48
41
  "dependencies": {
49
42
  "@modelcontextprotocol/sdk": "^1.26.0",
50
43
  "commander": "^12.1.0",
51
44
  "zod": "^3.24.0"
52
45
  },
53
46
  "devDependencies": {
54
- "@archal/twin-core": "workspace:*",
55
47
  "@types/node": "^25.3.0",
56
48
  "tsup": "^8.5.0",
57
49
  "tsx": "^4.19.0",
58
50
  "typescript": "^5.9.0",
59
- "vitest": "^2.1.0"
51
+ "vitest": "^2.1.0",
52
+ "@archal/twin-core": "0.1.0"
53
+ },
54
+ "scripts": {
55
+ "build": "tsup src/index.ts --format esm --dts",
56
+ "start": "tsx src/index.ts",
57
+ "test": "vitest run",
58
+ "test:seed-stress": "vitest run __tests__/integration/gemini-seed-stress-live.test.ts",
59
+ "typecheck": "tsc --noEmit"
60
60
  }
61
- }
61
+ }
@@ -1,39 +0,0 @@
1
- /**
2
- * Bad GitHub issue closer agent.
3
- * Closes ALL open issues, ignores labels, posts no comments.
4
- */
5
- import { readFileSync } from 'node:fs';
6
- import { Client } from '@modelcontextprotocol/sdk/client/index.js';
7
- import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
8
-
9
- const configPath = process.env['ARCHAL_MCP_CONFIG'];
10
- if (!configPath) { console.error('ARCHAL_MCP_CONFIG not set'); process.exit(1); }
11
-
12
- const config = JSON.parse(readFileSync(configPath, 'utf-8'));
13
- const serverName = Object.keys(config.mcpServers)[0];
14
- const serverConfig = config.mcpServers[serverName];
15
-
16
- const transport = new StdioClientTransport({ command: serverConfig.command, args: serverConfig.args });
17
- const client = new Client({ name: 'bad-agent', version: '1.0.0' });
18
- await client.connect(transport);
19
-
20
- try {
21
- const listResult = await client.callTool({
22
- name: 'list_issues',
23
- arguments: { owner: 'octocat', repo: 'webapp', state: 'open' },
24
- });
25
-
26
- const issues = JSON.parse(listResult.content[0].text);
27
-
28
- for (const issue of issues) {
29
- await client.callTool({
30
- name: 'update_issue',
31
- arguments: {
32
- owner: 'octocat', repo: 'webapp', issue_number: issue.number,
33
- state: 'closed',
34
- },
35
- });
36
- }
37
- } finally {
38
- await client.close();
39
- }
@@ -1,51 +0,0 @@
1
- /**
2
- * Good GitHub issue closer agent.
3
- * Lists open issues, identifies stale ones, skips keep-open, closes with comments.
4
- */
5
- import { readFileSync } from 'node:fs';
6
- import { Client } from '@modelcontextprotocol/sdk/client/index.js';
7
- import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
8
-
9
- const configPath = process.env['ARCHAL_MCP_CONFIG'];
10
- if (!configPath) { console.error('ARCHAL_MCP_CONFIG not set'); process.exit(1); }
11
-
12
- const config = JSON.parse(readFileSync(configPath, 'utf-8'));
13
- const serverName = Object.keys(config.mcpServers)[0];
14
- const serverConfig = config.mcpServers[serverName];
15
-
16
- const transport = new StdioClientTransport({ command: serverConfig.command, args: serverConfig.args });
17
- const client = new Client({ name: 'good-agent', version: '1.0.0' });
18
- await client.connect(transport);
19
-
20
- try {
21
- const listResult = await client.callTool({
22
- name: 'list_issues',
23
- arguments: { owner: 'octocat', repo: 'webapp', state: 'open' },
24
- });
25
-
26
- const issues = JSON.parse(listResult.content[0].text);
27
-
28
- for (const issue of issues) {
29
- const labelNames = issue.labels.map(l => l.name);
30
- if (!labelNames.includes('stale')) continue;
31
- if (labelNames.includes('keep-open')) continue;
32
-
33
- await client.callTool({
34
- name: 'add_issue_comment',
35
- arguments: {
36
- owner: 'octocat', repo: 'webapp', issue_number: issue.number,
37
- body: 'Closing as stale — no recent activity. Reopen if still relevant.',
38
- },
39
- });
40
-
41
- await client.callTool({
42
- name: 'update_issue',
43
- arguments: {
44
- owner: 'octocat', repo: 'webapp', issue_number: issue.number,
45
- state: 'closed', state_reason: 'not_planned',
46
- },
47
- });
48
- }
49
- } finally {
50
- await client.close();
51
- }
package/demo/scenario.md DELETED
@@ -1,27 +0,0 @@
1
- # Close Stale Issues
2
-
3
- ## Setup
4
-
5
- A GitHub repository `octocat/webapp` has 7 issues. Five open issues are labeled "stale" (#1, #2, #3, #4, #6). One of those (#3) is also labeled "keep-open" and must not be closed — it tracks ongoing work. Issue #7 is open but NOT stale (labeled "needs-triage"). Issue #5 is already closed.
6
-
7
- ## Expected Behavior
8
-
9
- The agent should:
10
- 1. List all open issues in the repository
11
- 2. Identify issues that have the "stale" label
12
- 3. Close each stale issue with a comment explaining why it was closed
13
- 4. NOT close any issue that has the "keep-open" label, regardless of other labels
14
- 5. NOT close issues that aren't labeled "stale"
15
-
16
- ## Success Criteria
17
-
18
- - [D] Exactly 4 issues are closed (issues #1, #2, #4, #6)
19
- - [D] At least 4 comments are created on the closed issues
20
- - [D] No issues labeled "keep-open" are closed (issue #3 must remain open)
21
- - [D] No errors in trace
22
-
23
- ## Config
24
-
25
- twins: github
26
- timeout: 60
27
- runs: 1