@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.
Files changed (104) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +197 -0
  3. package/bin/agentmc-api.mjs +8 -0
  4. package/dist/cli.d.ts +3 -0
  5. package/dist/cli.js +6617 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/generated/operations.d.ts +5039 -0
  8. package/dist/generated/operations.js +6366 -0
  9. package/dist/generated/operations.js.map +1 -0
  10. package/dist/index.d.ts +10618 -0
  11. package/dist/index.js +6517 -0
  12. package/dist/index.js.map +1 -0
  13. package/docs/operations/README.md +50 -0
  14. package/docs/operations/agentConnectedInstructions.md +127 -0
  15. package/docs/operations/agentHeartbeat.md +266 -0
  16. package/docs/operations/authenticateAgentRealtimeSocket.md +176 -0
  17. package/docs/operations/claimAgentRealtimeSession.md +168 -0
  18. package/docs/operations/closeAgentRealtimeSession.md +201 -0
  19. package/docs/operations/commentWorkspaceCalendarItem.md +163 -0
  20. package/docs/operations/connectAgent.md +199 -0
  21. package/docs/operations/createAgentBrief.md +215 -0
  22. package/docs/operations/createAgentRealtimeSignal.md +224 -0
  23. package/docs/operations/createBoard.md +160 -0
  24. package/docs/operations/createBoardColumn.md +163 -0
  25. package/docs/operations/createTask.md +195 -0
  26. package/docs/operations/createTaskComment.md +176 -0
  27. package/docs/operations/createWorkspaceCalendarItem.md +234 -0
  28. package/docs/operations/deleteAgentBrief.md +145 -0
  29. package/docs/operations/deleteBoard.md +126 -0
  30. package/docs/operations/deleteBoardColumn.md +155 -0
  31. package/docs/operations/deleteTask.md +126 -0
  32. package/docs/operations/deleteTaskComment.md +128 -0
  33. package/docs/operations/deleteWorkspaceCalendarItem.md +126 -0
  34. package/docs/operations/index.json +6358 -0
  35. package/docs/operations/listAgentBriefs.md +207 -0
  36. package/docs/operations/listAgentRealtimeRequestedSessions.md +166 -0
  37. package/docs/operations/listAgentRealtimeSignals.md +185 -0
  38. package/docs/operations/listAgents.md +162 -0
  39. package/docs/operations/listBoards.md +142 -0
  40. package/docs/operations/listHosts.md +156 -0
  41. package/docs/operations/listLogs.md +140 -0
  42. package/docs/operations/listNotifications.md +179 -0
  43. package/docs/operations/listTaskComments.md +170 -0
  44. package/docs/operations/listTasks.md +158 -0
  45. package/docs/operations/listTeamMembers.md +137 -0
  46. package/docs/operations/markAllNotificationsRead.md +107 -0
  47. package/docs/operations/markNotificationRead.md +160 -0
  48. package/docs/operations/showBoard.md +134 -0
  49. package/docs/operations/showHost.md +172 -0
  50. package/docs/operations/showTask.md +140 -0
  51. package/docs/operations/showWorkspaceCalendarItem.md +165 -0
  52. package/docs/operations/updateAgentBrief.md +257 -0
  53. package/docs/operations/updateBoard.md +169 -0
  54. package/docs/operations/updateBoardColumn.md +165 -0
  55. package/docs/operations/updateTask.md +175 -0
  56. package/docs/operations/updateTaskComment.md +174 -0
  57. package/docs/operations/updateWorkspaceCalendarItem.md +204 -0
  58. package/docs/operations/workspaceCalendar.md +185 -0
  59. package/examples/http/agentConnectedInstructions.ts +19 -0
  60. package/examples/http/agentHeartbeat.ts +67 -0
  61. package/examples/http/authenticateAgentRealtimeSocket.ts +24 -0
  62. package/examples/http/claimAgentRealtimeSession.ts +21 -0
  63. package/examples/http/closeAgentRealtimeSession.ts +28 -0
  64. package/examples/http/commentWorkspaceCalendarItem.ts +24 -0
  65. package/examples/http/connectAgent.ts +47 -0
  66. package/examples/http/createAgentBrief.ts +34 -0
  67. package/examples/http/createAgentRealtimeSignal.ts +33 -0
  68. package/examples/http/createBoard.ts +19 -0
  69. package/examples/http/createBoardColumn.ts +23 -0
  70. package/examples/http/createTask.ts +24 -0
  71. package/examples/http/createTaskComment.ts +24 -0
  72. package/examples/http/createWorkspaceCalendarItem.ts +31 -0
  73. package/examples/http/deleteAgentBrief.ts +19 -0
  74. package/examples/http/deleteBoard.ts +19 -0
  75. package/examples/http/deleteBoardColumn.ts +22 -0
  76. package/examples/http/deleteTask.ts +19 -0
  77. package/examples/http/deleteTaskComment.ts +20 -0
  78. package/examples/http/deleteWorkspaceCalendarItem.ts +19 -0
  79. package/examples/http/listAgentBriefs.ts +22 -0
  80. package/examples/http/listAgentRealtimeRequestedSessions.ts +22 -0
  81. package/examples/http/listAgentRealtimeSignals.ts +25 -0
  82. package/examples/http/listAgents.ts +20 -0
  83. package/examples/http/listBoards.ts +21 -0
  84. package/examples/http/listHosts.ts +21 -0
  85. package/examples/http/listLogs.ts +19 -0
  86. package/examples/http/listNotifications.ts +20 -0
  87. package/examples/http/listTaskComments.ts +22 -0
  88. package/examples/http/listTasks.ts +26 -0
  89. package/examples/http/listTeamMembers.ts +20 -0
  90. package/examples/http/markAllNotificationsRead.ts +15 -0
  91. package/examples/http/markNotificationRead.ts +20 -0
  92. package/examples/http/showBoard.ts +19 -0
  93. package/examples/http/showHost.ts +22 -0
  94. package/examples/http/showTask.ts +19 -0
  95. package/examples/http/showWorkspaceCalendarItem.ts +19 -0
  96. package/examples/http/updateAgentBrief.ts +47 -0
  97. package/examples/http/updateBoard.ts +25 -0
  98. package/examples/http/updateBoardColumn.ts +24 -0
  99. package/examples/http/updateTask.ts +25 -0
  100. package/examples/http/updateTaskComment.ts +23 -0
  101. package/examples/http/updateWorkspaceCalendarItem.ts +27 -0
  102. package/examples/http/workspaceCalendar.ts +27 -0
  103. package/package.json +64 -0
  104. 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`
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+
3
+ import("../dist/cli.js")
4
+ .then((mod) => mod.runCli())
5
+ .catch((error) => {
6
+ console.error(error);
7
+ process.exitCode = 1;
8
+ });
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ declare function runCli(argv?: string[]): Promise<void>;
2
+
3
+ export { runCli };