anpm-io 1.0.0 → 1.0.2
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 +168 -97
- package/dist/commands/access.js +10 -82
- package/dist/commands/adopt.js +1 -1
- package/dist/commands/changelog.js +9 -59
- package/dist/commands/check-update.js +8 -69
- package/dist/commands/create.js +56 -56
- package/dist/commands/deploy-record.js +10 -10
- package/dist/commands/deploy.js +1 -1
- package/dist/commands/diff.js +8 -8
- package/dist/commands/feedback.js +7 -7
- package/dist/commands/grant.js +28 -28
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.js +38 -38
- package/dist/commands/install.js +75 -71
- package/dist/commands/join.d.ts +1 -4
- package/dist/commands/join.js +15 -83
- package/dist/commands/list.js +12 -12
- package/dist/commands/login.d.ts +2 -2
- package/dist/commands/login.js +26 -26
- package/dist/commands/orgs.js +24 -24
- package/dist/commands/outdated.js +35 -11
- package/dist/commands/package.d.ts +8 -8
- package/dist/commands/package.js +76 -76
- package/dist/commands/ping.js +4 -4
- package/dist/commands/publish.js +113 -113
- package/dist/commands/run.js +10 -10
- package/dist/commands/search.js +8 -8
- package/dist/commands/status.js +9 -9
- package/dist/commands/uninstall.js +9 -9
- package/dist/commands/update.js +12 -12
- package/dist/commands/versions.js +6 -6
- package/dist/index.js +23 -20
- package/dist/lib/ai-tools.d.ts +8 -8
- package/dist/lib/ai-tools.js +10 -10
- package/dist/lib/api.js +8 -8
- package/dist/lib/command-adapter.d.ts +10 -10
- package/dist/lib/command-adapter.js +78 -78
- package/dist/lib/config.d.ts +20 -20
- package/dist/lib/config.js +41 -41
- package/dist/lib/contact-format.d.ts +3 -3
- package/dist/lib/contact-format.js +3 -3
- package/dist/lib/error-report.d.ts +2 -2
- package/dist/lib/error-report.js +2 -2
- package/dist/lib/git-operations.d.ts +2 -2
- package/dist/lib/git-operations.js +6 -6
- package/dist/lib/installer.d.ts +10 -10
- package/dist/lib/installer.js +32 -32
- package/dist/lib/paths.d.ts +4 -4
- package/dist/lib/paths.js +4 -4
- package/dist/lib/preamble.d.ts +7 -7
- package/dist/lib/preamble.js +24 -19
- package/dist/lib/relay-config.js +1 -1
- package/dist/lib/requires-suggest.d.ts +3 -3
- package/dist/lib/requires-suggest.js +28 -28
- package/dist/lib/setup-command.d.ts +2 -2
- package/dist/lib/setup-command.js +22 -22
- package/dist/lib/slug.d.ts +8 -8
- package/dist/lib/slug.js +16 -16
- package/dist/lib/step-tracker.d.ts +2 -2
- package/dist/lib/step-tracker.js +2 -2
- package/dist/lib/version-check.js +2 -2
- package/dist/mcp/server.js +15 -15
- package/dist/postinstall.d.ts +3 -3
- package/dist/postinstall.js +16 -16
- package/dist/prompts/_error-handling.md +26 -26
- package/dist/prompts/create.md +115 -115
- package/dist/prompts/explore.md +19 -19
- package/dist/prompts/index.js +2 -2
- package/dist/types.d.ts +10 -10
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,174 +1,245 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<strong>anpm</strong><br>
|
|
3
|
+
<em>The package manager for AI agents</em>
|
|
4
|
+
</p>
|
|
5
|
+
|
|
6
|
+
<p align="center">
|
|
7
|
+
<a href="https://www.npmjs.com/package/anpm-io"><img src="https://img.shields.io/npm/v/anpm-io?color=blue" alt="npm version"></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/anpm-io"><img src="https://img.shields.io/npm/dm/anpm-io?color=green" alt="npm downloads"></a>
|
|
9
|
+
<a href="https://github.com/anpm-io/anpm/blob/main/LICENSE"><img src="https://img.shields.io/github/license/anpm-io/anpm" alt="MIT License"></a>
|
|
10
|
+
</p>
|
|
2
11
|
|
|
3
|
-
|
|
12
|
+
---
|
|
4
13
|
|
|
5
|
-
|
|
14
|
+
Install, publish, and deploy AI agent packages. Works locally with Claude Code, Cursor, Codex, and 5+ other harnesses — or deploy to the cloud with Anthropic Managed Agents.
|
|
6
15
|
|
|
7
16
|
```bash
|
|
8
|
-
|
|
17
|
+
npm install -g anpm-io
|
|
18
|
+
anpm install @author/agent-name
|
|
9
19
|
```
|
|
10
20
|
|
|
11
21
|
```
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
✓ customer-support installed v1.0.0 by @acme
|
|
23
|
+
path: ~/.anpm/agents/acme/customer-support
|
|
24
|
+
scope: global
|
|
25
|
+
files: 8, symlinks: 3
|
|
26
|
+
|
|
27
|
+
Included commands:
|
|
28
|
+
/support — Handle customer inquiries
|
|
29
|
+
/escalate — Escalate complex issues
|
|
30
|
+
|
|
31
|
+
💡 Usage: /support
|
|
21
32
|
```
|
|
22
33
|
|
|
23
34
|
---
|
|
24
35
|
|
|
25
|
-
## Why
|
|
36
|
+
## Why anpm
|
|
26
37
|
|
|
27
|
-
AI agents are
|
|
38
|
+
AI agents are scattered across repos, gists, and docs with no standard way to discover, install, or track them.
|
|
28
39
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
| Problem | Relay |
|
|
40
|
+
| Problem | anpm |
|
|
32
41
|
|---|---|
|
|
33
|
-
| Agents locked to one
|
|
34
|
-
| No distribution
|
|
35
|
-
|
|
|
42
|
+
| Agents locked to one platform | Works across 8+ local harnesses and cloud deployment |
|
|
43
|
+
| No distribution | `anpm install` — one command, done |
|
|
44
|
+
| No visibility | Built-in install counts, DAU, WAU tracking |
|
|
45
|
+
| No cloud option | `anpm deploy` to Anthropic Managed Agents |
|
|
36
46
|
|
|
37
47
|
---
|
|
38
48
|
|
|
39
49
|
## Quick Start
|
|
40
50
|
|
|
51
|
+
### Install an agent
|
|
52
|
+
|
|
41
53
|
```bash
|
|
42
|
-
#
|
|
43
|
-
npx
|
|
54
|
+
# No global install needed
|
|
55
|
+
npx anpm-io install @author/agent-name
|
|
44
56
|
|
|
45
57
|
# Or install globally
|
|
46
|
-
npm i -g
|
|
47
|
-
|
|
58
|
+
npm i -g anpm-io
|
|
59
|
+
anpm install @author/agent-name
|
|
48
60
|
```
|
|
49
61
|
|
|
50
|
-
|
|
62
|
+
The agent is ready immediately — skills, rules, commands, all wired up.
|
|
63
|
+
|
|
64
|
+
### Install from anywhere
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# From the registry
|
|
68
|
+
anpm install @acme/customer-support
|
|
69
|
+
|
|
70
|
+
# From GitHub
|
|
71
|
+
anpm install github:user/repo
|
|
72
|
+
|
|
73
|
+
# From a local directory
|
|
74
|
+
anpm install ./my-agent
|
|
75
|
+
|
|
76
|
+
# Public agents — no login required
|
|
77
|
+
anpm install @tools/data-pipeline
|
|
78
|
+
```
|
|
51
79
|
|
|
52
80
|
---
|
|
53
81
|
|
|
54
82
|
## For Agent Builders
|
|
55
83
|
|
|
56
|
-
|
|
57
|
-
# Publish your agent to the registry
|
|
58
|
-
relay publish
|
|
84
|
+
### Create and publish
|
|
59
85
|
|
|
60
|
-
|
|
61
|
-
|
|
86
|
+
```bash
|
|
87
|
+
anpm create my-agent # scaffold a new agent project
|
|
88
|
+
anpm publish # publish to the registry
|
|
89
|
+
anpm publish --patch # bump version and publish
|
|
62
90
|
```
|
|
63
91
|
|
|
64
|
-
|
|
92
|
+
### Deploy to the cloud
|
|
65
93
|
|
|
66
|
-
|
|
94
|
+
Deploy your agent to Anthropic Managed Agents for always-on, serverless execution — no local harness needed.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
anpm deploy --to anthropic
|
|
98
|
+
```
|
|
67
99
|
|
|
68
100
|
```yaml
|
|
69
|
-
#
|
|
70
|
-
name:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
101
|
+
# anpm.yaml — cloud deployment config
|
|
102
|
+
name: customer-support
|
|
103
|
+
slug: customer-support
|
|
104
|
+
description: AI-powered customer support agent
|
|
105
|
+
version: 1.0.0
|
|
106
|
+
|
|
107
|
+
agent:
|
|
108
|
+
system: "You are a customer support agent..."
|
|
109
|
+
tools:
|
|
110
|
+
- computer
|
|
111
|
+
- text_editor
|
|
112
|
+
cloud:
|
|
113
|
+
anthropic:
|
|
114
|
+
model: claude-sonnet-4-6
|
|
115
|
+
networking: unrestricted
|
|
83
116
|
```
|
|
84
117
|
|
|
85
|
-
|
|
118
|
+
Managed Agents can handle any task — customer support, research, data analysis, content generation, workflow automation, and more.
|
|
86
119
|
|
|
87
120
|
---
|
|
88
121
|
|
|
89
122
|
## Commands
|
|
90
123
|
|
|
91
|
-
| Command |
|
|
124
|
+
| Command | Description |
|
|
92
125
|
|---|---|
|
|
93
|
-
| `
|
|
94
|
-
| `
|
|
95
|
-
| `
|
|
96
|
-
| `
|
|
97
|
-
| `
|
|
98
|
-
| `
|
|
99
|
-
| `
|
|
100
|
-
| `
|
|
101
|
-
|
|
102
|
-
|
|
126
|
+
| `anpm install [slug]` | Install an agent (registry, git, or local) |
|
|
127
|
+
| `anpm search <keyword>` | Search the marketplace |
|
|
128
|
+
| `anpm publish` | Publish your agent |
|
|
129
|
+
| `anpm deploy` | Deploy to cloud (Anthropic Managed Agents) |
|
|
130
|
+
| `anpm create <name>` | Scaffold a new agent project |
|
|
131
|
+
| `anpm list` | List installed agents |
|
|
132
|
+
| `anpm status` | Show environment and agent status |
|
|
133
|
+
| `anpm update <slug>` | Update to latest version |
|
|
134
|
+
| `anpm run <harness>` | Run harness with isolated agent environment |
|
|
135
|
+
| `anpm link` | Link local agent for development |
|
|
136
|
+
| `anpm config` | Manage CLI configuration |
|
|
137
|
+
|
|
138
|
+
All commands support `--json` for structured output, making anpm fully scriptable by AI agents.
|
|
103
139
|
|
|
104
140
|
---
|
|
105
141
|
|
|
106
142
|
## How It Works
|
|
107
143
|
|
|
108
144
|
```
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
145
|
+
anpm install @team/agent
|
|
146
|
+
│
|
|
147
|
+
╭──────────┴──────────╮
|
|
148
|
+
│ anpm Registry │
|
|
149
|
+
│ (anpm.io) │
|
|
150
|
+
╰──────────┬──────────╯
|
|
151
|
+
│
|
|
152
|
+
┌──────────────┼──────────────┐
|
|
153
|
+
│ │ │
|
|
154
|
+
╭─────┴─────╮ ╭─────┴─────╮ ╭──────┴──────╮
|
|
155
|
+
│ Local │ │ Local │ │ Cloud │
|
|
156
|
+
│ Harness │ │ Harness │ │ Deploy │
|
|
157
|
+
│ │ │ │ │ (Managed │
|
|
158
|
+
│ Claude, │ │ Cursor, │ │ Agents) │
|
|
159
|
+
│ Codex, │ │ Windsurf, │ │ │
|
|
160
|
+
│ Gemini │ │ Cline ... │ │ Anthropic │
|
|
161
|
+
╰───────────╯ ╰───────────╯ ╰─────────────╯
|
|
125
162
|
```
|
|
126
163
|
|
|
127
|
-
|
|
164
|
+
One spec. Local or cloud. anpm handles the rest.
|
|
128
165
|
|
|
129
166
|
---
|
|
130
167
|
|
|
131
|
-
##
|
|
168
|
+
## Environment Lockfile
|
|
132
169
|
|
|
133
|
-
|
|
170
|
+
Pin agent versions per-project, like `package.json` for agents:
|
|
134
171
|
|
|
135
172
|
```bash
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
# An agent installing what it needs
|
|
140
|
-
relay install @tools/db-migrate
|
|
141
|
-
# → {"status":"ok","agent":"db-migrate","skills":["migrate","rollback","seed"]}
|
|
173
|
+
anpm install @tools/formatter --save # adds to anpm.yaml
|
|
174
|
+
anpm install # install all from anpm.yaml
|
|
175
|
+
anpm run claude # launch with only declared agents
|
|
142
176
|
```
|
|
143
177
|
|
|
144
|
-
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## AI-Native
|
|
181
|
+
|
|
182
|
+
anpm is built for AI agents as first-class consumers. Structured JSON output, scriptable commands, and MCP server mode:
|
|
145
183
|
|
|
146
184
|
```bash
|
|
147
|
-
|
|
185
|
+
# AI agent searching for tools
|
|
186
|
+
anpm search "customer support" --json | jq '.results[].slug'
|
|
187
|
+
|
|
188
|
+
# AI agent installing what it needs
|
|
189
|
+
anpm install @acme/support-bot --json
|
|
190
|
+
# → {"status":"ok","slug":"@acme/support-bot","version":"1.0.0",...}
|
|
191
|
+
|
|
192
|
+
# MCP server mode
|
|
193
|
+
anpm mcp
|
|
148
194
|
```
|
|
149
195
|
|
|
150
196
|
---
|
|
151
197
|
|
|
152
|
-
##
|
|
198
|
+
## Supported Platforms
|
|
199
|
+
|
|
200
|
+
### Local Harnesses
|
|
201
|
+
|
|
202
|
+
| Harness | Skills | Rules | Commands | Agents |
|
|
203
|
+
|---|---|---|---|---|
|
|
204
|
+
| Claude Code | ✅ | ✅ | ✅ | ✅ |
|
|
205
|
+
| Cursor | ✅ | ✅ | ✅ | ✅ |
|
|
206
|
+
| Codex | ✅ | ✅ | ✅ | ✅ |
|
|
207
|
+
| Gemini CLI | ✅ | ✅ | ✅ | ✅ |
|
|
208
|
+
| Windsurf | ✅ | ✅ | ✅ | ✅ |
|
|
209
|
+
| Cline | ✅ | ✅ | ✅ | ✅ |
|
|
210
|
+
| RooCode | ✅ | ✅ | ✅ | ✅ |
|
|
211
|
+
| OpenCode | ✅ | ✅ | ✅ | ✅ |
|
|
212
|
+
|
|
213
|
+
### Cloud Providers
|
|
214
|
+
|
|
215
|
+
| Provider | Deploy | Status |
|
|
216
|
+
|---|---|---|
|
|
217
|
+
| Anthropic Managed Agents | ✅ | Available |
|
|
218
|
+
| OpenAI | — | Planned |
|
|
219
|
+
| Google | — | Planned |
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Open Source
|
|
153
224
|
|
|
154
|
-
The CLI and agent spec are open source (MIT). Build agents, publish them, self-host
|
|
225
|
+
The CLI and agent spec are open source (MIT). Build agents, publish them, self-host — no vendor lock-in.
|
|
155
226
|
|
|
156
|
-
[
|
|
157
|
-
-
|
|
158
|
-
-
|
|
227
|
+
[anpm.io](https://anpm.io) provides the hosted registry with:
|
|
228
|
+
- Agent marketplace and discovery
|
|
229
|
+
- Private agent hosting for organizations
|
|
159
230
|
- Usage analytics dashboard
|
|
160
|
-
-
|
|
231
|
+
- Cloud deployment to Anthropic Managed Agents
|
|
161
232
|
|
|
162
233
|
---
|
|
163
234
|
|
|
164
|
-
##
|
|
235
|
+
## Links
|
|
165
236
|
|
|
166
|
-
- [
|
|
167
|
-
- [
|
|
168
|
-
- [
|
|
237
|
+
- [anpm.io](https://anpm.io) — Registry and dashboard
|
|
238
|
+
- [Getting Started](https://anpm.io/getting-started) — Step-by-step guide
|
|
239
|
+
- [npm package](https://www.npmjs.com/package/anpm-io)
|
|
169
240
|
|
|
170
241
|
---
|
|
171
242
|
|
|
172
243
|
<p align="center">
|
|
173
|
-
<sub>
|
|
244
|
+
<sub>MIT License</sub>
|
|
174
245
|
</p>
|
package/dist/commands/access.js
CHANGED
|
@@ -1,90 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.registerAccess = registerAccess;
|
|
4
|
-
const commander_1 = require("commander");
|
|
5
|
-
const config_js_1 = require("../lib/config.js");
|
|
6
|
-
async function claimAccess(slug, code) {
|
|
7
|
-
const token = await (0, config_js_1.getValidToken)();
|
|
8
|
-
if (!token) {
|
|
9
|
-
throw new Error('LOGIN_REQUIRED');
|
|
10
|
-
}
|
|
11
|
-
const res = await fetch(`${config_js_1.API_URL}/api/agents/${slug}/claim-access`, {
|
|
12
|
-
method: 'POST',
|
|
13
|
-
headers: {
|
|
14
|
-
'Content-Type': 'application/json',
|
|
15
|
-
Authorization: `Bearer ${token}`,
|
|
16
|
-
},
|
|
17
|
-
body: JSON.stringify({ code }),
|
|
18
|
-
signal: AbortSignal.timeout(10000),
|
|
19
|
-
});
|
|
20
|
-
const body = (await res.json().catch(() => ({})));
|
|
21
|
-
if (!res.ok) {
|
|
22
|
-
const errCode = body.error ?? String(res.status);
|
|
23
|
-
switch (errCode) {
|
|
24
|
-
case 'INVALID_LINK':
|
|
25
|
-
throw new Error('초대 링크가 유효하지 않거나 만료되었습니다.');
|
|
26
|
-
case 'NOT_FOUND':
|
|
27
|
-
throw new Error('에이전트를 찾을 수 없습니다.');
|
|
28
|
-
case 'UNAUTHORIZED':
|
|
29
|
-
throw new Error('LOGIN_REQUIRED');
|
|
30
|
-
default:
|
|
31
|
-
throw new Error(body.message ?? `접근 권한 요청 실패 (${res.status})`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return body;
|
|
35
|
-
}
|
|
36
4
|
function registerAccess(program) {
|
|
37
5
|
program
|
|
38
|
-
.command('access <slug>')
|
|
39
|
-
.description('
|
|
40
|
-
.requiredOption('--code <code>', '
|
|
6
|
+
.command('access <slug>', { hidden: true })
|
|
7
|
+
.description('(deprecated) Use anpm install --code instead')
|
|
8
|
+
.requiredOption('--code <code>', 'Agent access code')
|
|
41
9
|
.action(async (slug, opts) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (json) {
|
|
50
|
-
console.log(JSON.stringify({ status: 'ok', agent: result.agent }));
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
console.log(`\x1b[32m접근 권한이 부여되었습니다: ${result.agent.name}\x1b[0m`);
|
|
54
|
-
console.log(`\x1b[33m에이전트를 설치합니다: anpm install ${agentSlug}\x1b[0m\n`);
|
|
55
|
-
}
|
|
56
|
-
// Automatically install the agent
|
|
57
|
-
const { registerInstall } = await import('./install.js');
|
|
58
|
-
const subProgram = new commander_1.Command();
|
|
59
|
-
subProgram.option('--json', '구조화된 JSON 출력');
|
|
60
|
-
if (json)
|
|
61
|
-
subProgram.setOptionValue('json', true);
|
|
62
|
-
registerInstall(subProgram);
|
|
63
|
-
await subProgram.parseAsync(['node', 'relay', 'install', agentSlug]);
|
|
64
|
-
}
|
|
65
|
-
catch (err) {
|
|
66
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
67
|
-
if (message === 'LOGIN_REQUIRED') {
|
|
68
|
-
if (json) {
|
|
69
|
-
console.error(JSON.stringify({
|
|
70
|
-
error: 'LOGIN_REQUIRED',
|
|
71
|
-
message: '로그인이 필요합니다. anpm login을 먼저 실행하세요.',
|
|
72
|
-
fix: 'anpm login 실행 후 재시도하세요.',
|
|
73
|
-
}));
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
console.error('\x1b[31m오류: 로그인이 필요합니다.\x1b[0m');
|
|
77
|
-
console.error(' anpm login을 먼저 실행하세요.');
|
|
78
|
-
}
|
|
79
|
-
process.exit(1);
|
|
80
|
-
}
|
|
81
|
-
if (json) {
|
|
82
|
-
console.error(JSON.stringify({ error: 'ACCESS_FAILED', message, fix: '접근 링크 코드를 확인하거나 에이전트 제작자에게 문의하세요.' }));
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
console.error(`\x1b[31m오류: ${message}\x1b[0m`);
|
|
86
|
-
}
|
|
87
|
-
process.exit(1);
|
|
88
|
-
}
|
|
10
|
+
console.error('\x1b[33m⚠ access is deprecated. Use "anpm install --code" instead.\x1b[0m\n');
|
|
11
|
+
// Delegate to install --code
|
|
12
|
+
const args = ['node', 'anpm', 'install', slug, '--code', opts.code];
|
|
13
|
+
const json = program.opts().json;
|
|
14
|
+
if (json)
|
|
15
|
+
args.push('--json');
|
|
16
|
+
await program.parseAsync(args, { from: 'user' });
|
|
89
17
|
});
|
|
90
18
|
}
|
package/dist/commands/adopt.js
CHANGED
|
@@ -13,7 +13,7 @@ const installer_js_1 = require("../lib/installer.js");
|
|
|
13
13
|
const agent_status_js_1 = require("../lib/agent-status.js");
|
|
14
14
|
function registerAdopt(program) {
|
|
15
15
|
program
|
|
16
|
-
.command('adopt [path]')
|
|
16
|
+
.command('adopt [path]', { hidden: true })
|
|
17
17
|
.description('Adopt unmanaged skills into anpm management')
|
|
18
18
|
.option('--all', 'Adopt all unmanaged skills')
|
|
19
19
|
.option('--global', 'Adopt to global scope')
|
|
@@ -1,67 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.registerChangelog = registerChangelog;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
10
4
|
function registerChangelog(program) {
|
|
11
|
-
|
|
12
|
-
.command('changelog')
|
|
13
|
-
.description('
|
|
14
|
-
|
|
15
|
-
.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
.action(async (message) => {
|
|
19
|
-
const yamlPath = path_1.default.resolve('relay.yaml');
|
|
20
|
-
if (!fs_1.default.existsSync(yamlPath)) {
|
|
21
|
-
console.error('relay.yaml을 찾을 수 없습니다. 에이전트 패키지 디렉토리에서 실행하세요.');
|
|
22
|
-
process.exit(1);
|
|
5
|
+
program
|
|
6
|
+
.command('changelog [slug]', { hidden: true })
|
|
7
|
+
.description('(deprecated) Use anpm versions instead')
|
|
8
|
+
.action(async (slug) => {
|
|
9
|
+
console.error('\x1b[33m⚠ changelog is deprecated. Use "anpm versions <slug>" instead.\x1b[0m\n');
|
|
10
|
+
if (slug) {
|
|
11
|
+
await program.parseAsync(['node', 'anpm', 'versions', slug], { from: 'user' });
|
|
23
12
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (!message) {
|
|
27
|
-
// Read from stdin if piped, otherwise prompt
|
|
28
|
-
const readline = await import('readline');
|
|
29
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
30
|
-
message = await new Promise((resolve) => {
|
|
31
|
-
rl.question('Changelog 메시지: ', (answer) => {
|
|
32
|
-
rl.close();
|
|
33
|
-
resolve(answer);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
13
|
+
else {
|
|
14
|
+
console.error('Usage: anpm versions <slug>');
|
|
36
15
|
}
|
|
37
|
-
if (!message || message.trim() === '') {
|
|
38
|
-
console.error('changelog 메시지가 비어있습니다.');
|
|
39
|
-
process.exit(1);
|
|
40
|
-
}
|
|
41
|
-
const version = String(doc.version ?? '1.0.0');
|
|
42
|
-
const date = new Date().toISOString().split('T')[0];
|
|
43
|
-
const entry = `## v${version} (${date})\n\n- ${message.trim()}`;
|
|
44
|
-
const existing = doc.changelog ? String(doc.changelog) : '';
|
|
45
|
-
doc.changelog = existing ? `${entry}\n\n${existing}` : entry;
|
|
46
|
-
fs_1.default.writeFileSync(yamlPath, js_yaml_1.default.dump(doc, { lineWidth: -1, noRefs: true }), 'utf-8');
|
|
47
|
-
console.log(`\x1b[32m✓\x1b[0m changelog 추가됨 (v${version})`);
|
|
48
|
-
console.log(` ${message.trim()}`);
|
|
49
|
-
});
|
|
50
|
-
changelog
|
|
51
|
-
.command('show')
|
|
52
|
-
.description('현재 relay.yaml의 changelog를 표시합니다')
|
|
53
|
-
.action(() => {
|
|
54
|
-
const yamlPath = path_1.default.resolve('relay.yaml');
|
|
55
|
-
if (!fs_1.default.existsSync(yamlPath)) {
|
|
56
|
-
console.error('relay.yaml을 찾을 수 없습니다.');
|
|
57
|
-
process.exit(1);
|
|
58
|
-
}
|
|
59
|
-
const content = fs_1.default.readFileSync(yamlPath, 'utf-8');
|
|
60
|
-
const doc = js_yaml_1.default.load(content) ?? {};
|
|
61
|
-
if (!doc.changelog) {
|
|
62
|
-
console.log('changelog가 없습니다. `anpm changelog add "메시지"`로 추가하세요.');
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
console.log(String(doc.changelog));
|
|
66
16
|
});
|
|
67
17
|
}
|
|
@@ -1,76 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.registerCheckUpdate = registerCheckUpdate;
|
|
4
|
-
const version_check_js_1 = require("../lib/version-check.js");
|
|
5
|
-
const slug_js_1 = require("../lib/slug.js");
|
|
6
4
|
function registerCheckUpdate(program) {
|
|
7
5
|
program
|
|
8
|
-
.command('check-update [slug]')
|
|
9
|
-
.description('
|
|
10
|
-
.option('--quiet', '
|
|
11
|
-
.option('--force', '
|
|
12
|
-
.action(async (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const cliResult = await (0, version_check_js_1.checkCliVersion)(force);
|
|
17
|
-
if (cliResult) {
|
|
18
|
-
if (quiet) {
|
|
19
|
-
console.log(`CLI_UPGRADE_AVAILABLE ${cliResult.current} ${cliResult.latest}`);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
console.log(`\n\x1b[33m⚠ anpm v${cliResult.latest} available\x1b[0m (현재 v${cliResult.current})`);
|
|
23
|
-
console.log(` 실행: npm update -g relayax-cli\n`);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
// Agent version check
|
|
27
|
-
if (slug) {
|
|
28
|
-
// Resolve to scoped slug
|
|
29
|
-
let scopedSlug;
|
|
30
|
-
if ((0, slug_js_1.isScopedSlug)(slug)) {
|
|
31
|
-
scopedSlug = slug;
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
try {
|
|
35
|
-
const parsed = await (0, slug_js_1.resolveSlug)(slug);
|
|
36
|
-
scopedSlug = parsed.full;
|
|
37
|
-
}
|
|
38
|
-
catch {
|
|
39
|
-
scopedSlug = slug;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
const agentResult = await (0, version_check_js_1.checkAgentVersion)(scopedSlug, force);
|
|
43
|
-
if (agentResult) {
|
|
44
|
-
if (quiet) {
|
|
45
|
-
const byAuthor = agentResult.author ? ` ${agentResult.author}` : '';
|
|
46
|
-
console.log(`AGENT_UPGRADE_AVAILABLE ${slug} ${agentResult.current} ${agentResult.latest}${byAuthor}`);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
const byAuthor = agentResult.author ? ` \x1b[90m(by @${agentResult.author})\x1b[0m` : '';
|
|
50
|
-
console.log(`\x1b[33m⚠ ${slug} v${agentResult.latest} available\x1b[0m${byAuthor} (현재 v${agentResult.current})`);
|
|
51
|
-
console.log(` 실행: anpm update ${slug}`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
else if (!quiet && !cliResult) {
|
|
55
|
-
console.log('모든 것이 최신 상태입니다.');
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
const agentResults = await (0, version_check_js_1.checkAllAgents)(force);
|
|
60
|
-
for (const result of agentResults) {
|
|
61
|
-
if (quiet) {
|
|
62
|
-
const byAuthor = result.author ? ` ${result.author}` : '';
|
|
63
|
-
console.log(`AGENT_UPGRADE_AVAILABLE ${result.slug} ${result.current} ${result.latest}${byAuthor}`);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
const byAuthor = result.author ? ` \x1b[90m(by @${result.author})\x1b[0m` : '';
|
|
67
|
-
console.log(`\x1b[33m⚠ ${result.slug} v${result.latest} available\x1b[0m${byAuthor} (현재 v${result.current})`);
|
|
68
|
-
console.log(` 실행: anpm update ${result.slug}`);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (!quiet && !cliResult && agentResults.length === 0) {
|
|
72
|
-
console.log('모든 것이 최신 상태입니다.');
|
|
73
|
-
}
|
|
74
|
-
}
|
|
6
|
+
.command('check-update [slug]', { hidden: true })
|
|
7
|
+
.description('(deprecated) Use anpm outdated instead')
|
|
8
|
+
.option('--quiet', 'Machine-readable output only when updates are available')
|
|
9
|
+
.option('--force', 'Force check, ignoring cache')
|
|
10
|
+
.action(async () => {
|
|
11
|
+
console.error('\x1b[33m⚠ check-update is deprecated. Use "anpm outdated" instead.\x1b[0m\n');
|
|
12
|
+
// Delegate to outdated
|
|
13
|
+
await program.parseAsync(['node', 'anpm', 'outdated'], { from: 'user' });
|
|
75
14
|
});
|
|
76
15
|
}
|