@agentmc/api 0.1.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/LICENSE +21 -0
- package/README.md +197 -0
- package/bin/agentmc-api.mjs +8 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +6617 -0
- package/dist/cli.js.map +1 -0
- package/dist/generated/operations.d.ts +5039 -0
- package/dist/generated/operations.js +6366 -0
- package/dist/generated/operations.js.map +1 -0
- package/dist/index.d.ts +10618 -0
- package/dist/index.js +6517 -0
- package/dist/index.js.map +1 -0
- package/docs/operations/README.md +50 -0
- package/docs/operations/agentConnectedInstructions.md +127 -0
- package/docs/operations/agentHeartbeat.md +266 -0
- package/docs/operations/authenticateAgentRealtimeSocket.md +176 -0
- package/docs/operations/claimAgentRealtimeSession.md +168 -0
- package/docs/operations/closeAgentRealtimeSession.md +201 -0
- package/docs/operations/commentWorkspaceCalendarItem.md +163 -0
- package/docs/operations/connectAgent.md +199 -0
- package/docs/operations/createAgentBrief.md +215 -0
- package/docs/operations/createAgentRealtimeSignal.md +224 -0
- package/docs/operations/createBoard.md +160 -0
- package/docs/operations/createBoardColumn.md +163 -0
- package/docs/operations/createTask.md +195 -0
- package/docs/operations/createTaskComment.md +176 -0
- package/docs/operations/createWorkspaceCalendarItem.md +234 -0
- package/docs/operations/deleteAgentBrief.md +145 -0
- package/docs/operations/deleteBoard.md +126 -0
- package/docs/operations/deleteBoardColumn.md +155 -0
- package/docs/operations/deleteTask.md +126 -0
- package/docs/operations/deleteTaskComment.md +128 -0
- package/docs/operations/deleteWorkspaceCalendarItem.md +126 -0
- package/docs/operations/index.json +6358 -0
- package/docs/operations/listAgentBriefs.md +207 -0
- package/docs/operations/listAgentRealtimeRequestedSessions.md +166 -0
- package/docs/operations/listAgentRealtimeSignals.md +185 -0
- package/docs/operations/listAgents.md +162 -0
- package/docs/operations/listBoards.md +142 -0
- package/docs/operations/listHosts.md +156 -0
- package/docs/operations/listLogs.md +140 -0
- package/docs/operations/listNotifications.md +179 -0
- package/docs/operations/listTaskComments.md +170 -0
- package/docs/operations/listTasks.md +158 -0
- package/docs/operations/listTeamMembers.md +137 -0
- package/docs/operations/markAllNotificationsRead.md +107 -0
- package/docs/operations/markNotificationRead.md +160 -0
- package/docs/operations/showBoard.md +134 -0
- package/docs/operations/showHost.md +172 -0
- package/docs/operations/showTask.md +140 -0
- package/docs/operations/showWorkspaceCalendarItem.md +165 -0
- package/docs/operations/updateAgentBrief.md +257 -0
- package/docs/operations/updateBoard.md +169 -0
- package/docs/operations/updateBoardColumn.md +165 -0
- package/docs/operations/updateTask.md +175 -0
- package/docs/operations/updateTaskComment.md +174 -0
- package/docs/operations/updateWorkspaceCalendarItem.md +204 -0
- package/docs/operations/workspaceCalendar.md +185 -0
- package/examples/http/agentConnectedInstructions.ts +19 -0
- package/examples/http/agentHeartbeat.ts +67 -0
- package/examples/http/authenticateAgentRealtimeSocket.ts +24 -0
- package/examples/http/claimAgentRealtimeSession.ts +21 -0
- package/examples/http/closeAgentRealtimeSession.ts +28 -0
- package/examples/http/commentWorkspaceCalendarItem.ts +24 -0
- package/examples/http/connectAgent.ts +47 -0
- package/examples/http/createAgentBrief.ts +34 -0
- package/examples/http/createAgentRealtimeSignal.ts +33 -0
- package/examples/http/createBoard.ts +19 -0
- package/examples/http/createBoardColumn.ts +23 -0
- package/examples/http/createTask.ts +24 -0
- package/examples/http/createTaskComment.ts +24 -0
- package/examples/http/createWorkspaceCalendarItem.ts +31 -0
- package/examples/http/deleteAgentBrief.ts +19 -0
- package/examples/http/deleteBoard.ts +19 -0
- package/examples/http/deleteBoardColumn.ts +22 -0
- package/examples/http/deleteTask.ts +19 -0
- package/examples/http/deleteTaskComment.ts +20 -0
- package/examples/http/deleteWorkspaceCalendarItem.ts +19 -0
- package/examples/http/listAgentBriefs.ts +22 -0
- package/examples/http/listAgentRealtimeRequestedSessions.ts +22 -0
- package/examples/http/listAgentRealtimeSignals.ts +25 -0
- package/examples/http/listAgents.ts +20 -0
- package/examples/http/listBoards.ts +21 -0
- package/examples/http/listHosts.ts +21 -0
- package/examples/http/listLogs.ts +19 -0
- package/examples/http/listNotifications.ts +20 -0
- package/examples/http/listTaskComments.ts +22 -0
- package/examples/http/listTasks.ts +26 -0
- package/examples/http/listTeamMembers.ts +20 -0
- package/examples/http/markAllNotificationsRead.ts +15 -0
- package/examples/http/markNotificationRead.ts +20 -0
- package/examples/http/showBoard.ts +19 -0
- package/examples/http/showHost.ts +22 -0
- package/examples/http/showTask.ts +19 -0
- package/examples/http/showWorkspaceCalendarItem.ts +19 -0
- package/examples/http/updateAgentBrief.ts +47 -0
- package/examples/http/updateBoard.ts +25 -0
- package/examples/http/updateBoardColumn.ts +24 -0
- package/examples/http/updateTask.ts +25 -0
- package/examples/http/updateTaskComment.ts +23 -0
- package/examples/http/updateWorkspaceCalendarItem.ts +27 -0
- package/examples/http/workspaceCalendar.ts +27 -0
- package/package.json +64 -0
- package/spec/openapi.filtered.json +12925 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AgentMC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# @agentmc/api
|
|
2
|
+
|
|
3
|
+
TypeScript SDK + endpoint docs + CLI for the AgentMC API.
|
|
4
|
+
|
|
5
|
+
- API domain: [https://agentmc.ai](https://agentmc.ai)
|
|
6
|
+
- OpenAPI source: `https://agentmc.ai/api/openapi.json`
|
|
7
|
+
- Default SDK base URL: `https://agentmc.ai/api/v1`
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @agentmc/api
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## What This Package Includes
|
|
16
|
+
|
|
17
|
+
- Fully generated, typed SDK surface from OpenAPI.
|
|
18
|
+
- Generated operation docs for every included endpoint:
|
|
19
|
+
- `docs/operations/*.md`
|
|
20
|
+
- `docs/operations/index.json`
|
|
21
|
+
- Per-endpoint runnable TypeScript examples:
|
|
22
|
+
- `examples/http/*.ts`
|
|
23
|
+
- CLI for operation discovery and direct API calls.
|
|
24
|
+
|
|
25
|
+
## Included Endpoint Scope
|
|
26
|
+
|
|
27
|
+
This package includes the documented AgentMC HTTP integration endpoints for Node clients.
|
|
28
|
+
|
|
29
|
+
## Quick Start (SDK)
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { AgentMCApi } from "@agentmc/api";
|
|
33
|
+
|
|
34
|
+
const client = new AgentMCApi({
|
|
35
|
+
apiKey: process.env.AGENTMC_API_KEY
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const result = await client.operations.listTasks({
|
|
39
|
+
params: {
|
|
40
|
+
query: {
|
|
41
|
+
per_page: 20
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
if (result.error) {
|
|
47
|
+
console.error(result.status, result.error);
|
|
48
|
+
} else {
|
|
49
|
+
console.log(result.data);
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Auth Configuration
|
|
54
|
+
|
|
55
|
+
Supported auth schemes:
|
|
56
|
+
|
|
57
|
+
- `ApiKeyAuth` via `X-Api-Key`
|
|
58
|
+
- `AgentBearerAuth` via `Authorization: Bearer <agent-token>`
|
|
59
|
+
- `BearerAuth` via `Authorization: Bearer <user-token>`
|
|
60
|
+
- `ConnectTokenAuth` via `X-Connect-Token` (for `/agents/connect`)
|
|
61
|
+
|
|
62
|
+
Configure once at client creation:
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
const client = new AgentMCApi({
|
|
66
|
+
apiKey: process.env.AGENTMC_API_KEY,
|
|
67
|
+
agentToken: process.env.AGENTMC_AGENT_TOKEN,
|
|
68
|
+
bearerToken: process.env.AGENTMC_BEARER_TOKEN,
|
|
69
|
+
connectToken: process.env.AGENTMC_CONNECT_TOKEN
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Override auth per request:
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
await client.request("connectAgent", {
|
|
77
|
+
auth: {
|
|
78
|
+
connectToken: process.env.AGENTMC_CONNECT_TOKEN
|
|
79
|
+
},
|
|
80
|
+
body: {
|
|
81
|
+
runtime: {
|
|
82
|
+
name: "example-runtime"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## API Discovery Helpers
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
import { operations, operationsById } from "@agentmc/api";
|
|
92
|
+
|
|
93
|
+
console.log(operations.length); // 44
|
|
94
|
+
console.log(operationsById.listTasks.path); // /tasks
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Runtime helpers on client:
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
const allOperations = client.listOperations();
|
|
101
|
+
const oneOperation = client.getOperation("listTasks");
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## CLI
|
|
105
|
+
|
|
106
|
+
After install, use:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npx agentmc-api list-operations
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
List as JSON:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
npx agentmc-api list-operations --json
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Show operation metadata:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
npx agentmc-api show-operation listTasks
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Show generated markdown docs:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
npx agentmc-api show-doc listTasks
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Call endpoint directly:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
npx agentmc-api call listTasks \
|
|
134
|
+
--api-key "$AGENTMC_API_KEY" \
|
|
135
|
+
--params '{"query":{"limit":20}}'
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Development
|
|
139
|
+
|
|
140
|
+
### 1) Install
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
npm install
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 2) Sync source OpenAPI
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
npm run sync:spec
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Optional environment variables:
|
|
153
|
+
|
|
154
|
+
- `AGENTMC_OPENAPI_PATH` (local file path override)
|
|
155
|
+
- `AGENTMC_OPENAPI_URL` (remote URL override)
|
|
156
|
+
|
|
157
|
+
### 3) Generate typed client artifacts/docs/examples
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
npm run generate
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Outputs:
|
|
164
|
+
|
|
165
|
+
- `spec/openapi.filtered.json`
|
|
166
|
+
- `src/generated/schema.ts`
|
|
167
|
+
- `src/generated/operations.ts`
|
|
168
|
+
- `docs/operations/*.md`
|
|
169
|
+
- `docs/operations/index.json`
|
|
170
|
+
- `examples/http/*.ts`
|
|
171
|
+
|
|
172
|
+
### 4) Build package
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
npm run build
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Release Flow (Auto-Publish)
|
|
179
|
+
|
|
180
|
+
This repo uses Changesets + GitHub Actions:
|
|
181
|
+
|
|
182
|
+
- CI workflow validates build and generated artifacts.
|
|
183
|
+
- Release workflow on `main` automatically:
|
|
184
|
+
- opens/updates a release PR from pending changesets
|
|
185
|
+
- publishes to npm when the release PR is merged
|
|
186
|
+
|
|
187
|
+
Required secrets:
|
|
188
|
+
|
|
189
|
+
- `NPM_TOKEN`
|
|
190
|
+
|
|
191
|
+
## Notes For Agent Authors
|
|
192
|
+
|
|
193
|
+
- Use `client.operations.<operationId>` for named operation calls.
|
|
194
|
+
- Use `client.request(operationId, options)` for dynamic routing.
|
|
195
|
+
- Read per-endpoint docs from `docs/operations/<operationId>.md` when selecting params/body fields.
|
|
196
|
+
- Treat the generated docs/index as the operation registry:
|
|
197
|
+
- `docs/operations/index.json`
|
package/dist/cli.d.ts
ADDED