@zmeel/server 0.3.2 → 2026.404.0-canary.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/dist/app.d.ts +1 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +1 -0
- package/dist/app.js.map +1 -1
- package/dist/auth/better-auth.d.ts +1 -1
- package/dist/auth/better-auth.d.ts.map +1 -1
- package/dist/auth/better-auth.js +13 -1
- package/dist/auth/better-auth.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +6 -2
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/routes/authz.d.ts +5 -5
- package/dist/routes/health.d.ts +1 -0
- package/dist/routes/health.d.ts.map +1 -1
- package/dist/routes/health.js +6 -1
- package/dist/routes/health.js.map +1 -1
- package/dist/services/activity.d.ts +3 -3
- package/dist/services/agents.d.ts +3 -3
- package/dist/services/approvals.d.ts +2 -2
- package/dist/services/costs.d.ts +2 -2
- package/dist/services/feedback.d.ts +2 -2
- package/dist/services/finance.d.ts +2 -2
- package/dist/services/goals.d.ts +6 -6
- package/dist/services/heartbeat.d.ts +17 -17
- package/dist/services/issues.d.ts +3 -3
- package/dist/services/plugin-registry.d.ts +73 -73
- package/dist/services/routines.d.ts +15 -15
- package/dist/services/saas-provisioning.d.ts +17 -0
- package/dist/services/saas-provisioning.d.ts.map +1 -0
- package/dist/services/saas-provisioning.js +55 -0
- package/dist/services/saas-provisioning.js.map +1 -0
- package/dist/services/workspace-runtime.d.ts +2 -2
- package/package.json +13 -13
- package/skills/para-memory-files/SKILL.md +104 -0
- package/skills/para-memory-files/references/schemas.md +35 -0
- package/skills/zmeel/SKILL.md +390 -0
- package/skills/zmeel/references/api-reference.md +721 -0
- package/skills/zmeel/references/company-skills.md +193 -0
- package/skills/zmeel/references/routines.md +187 -0
- package/skills/zmeel-create-agent/SKILL.md +142 -0
- package/skills/zmeel-create-agent/references/api-reference.md +105 -0
- package/skills/zmeel-create-plugin/SKILL.md +101 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# Company Skills Workflow
|
|
2
|
+
|
|
3
|
+
Use this reference when a board user, CEO, or manager asks you to find a skill, install it into the company library, or assign it to an agent.
|
|
4
|
+
|
|
5
|
+
## What Exists
|
|
6
|
+
|
|
7
|
+
- Company skill library: install, inspect, update, and read imported skills for the whole company.
|
|
8
|
+
- Agent skill assignment: add or remove company skills on an existing agent.
|
|
9
|
+
- Hire/create composition: pass `desiredSkills` when creating or hiring an agent so the same assignment model applies immediately.
|
|
10
|
+
|
|
11
|
+
The canonical model is:
|
|
12
|
+
|
|
13
|
+
1. install the skill into the company
|
|
14
|
+
2. assign the company skill to the agent
|
|
15
|
+
3. optionally do step 2 during hire/create with `desiredSkills`
|
|
16
|
+
|
|
17
|
+
## Permission Model
|
|
18
|
+
|
|
19
|
+
- Company skill reads: any same-company actor
|
|
20
|
+
- Company skill mutations: board, CEO, or an agent with the effective `agents:create` capability
|
|
21
|
+
- Agent skill assignment: same permission model as updating that agent
|
|
22
|
+
|
|
23
|
+
## Core Endpoints
|
|
24
|
+
|
|
25
|
+
- `GET /api/companies/:companyId/skills`
|
|
26
|
+
- `GET /api/companies/:companyId/skills/:skillId`
|
|
27
|
+
- `POST /api/companies/:companyId/skills/import`
|
|
28
|
+
- `POST /api/companies/:companyId/skills/scan-projects`
|
|
29
|
+
- `POST /api/companies/:companyId/skills/:skillId/install-update`
|
|
30
|
+
- `GET /api/agents/:agentId/skills`
|
|
31
|
+
- `POST /api/agents/:agentId/skills/sync`
|
|
32
|
+
- `POST /api/companies/:companyId/agent-hires`
|
|
33
|
+
- `POST /api/companies/:companyId/agents`
|
|
34
|
+
|
|
35
|
+
## Install A Skill Into The Company
|
|
36
|
+
|
|
37
|
+
Import using a **skills.sh URL**, a key-style source string, a GitHub URL, or a local path.
|
|
38
|
+
|
|
39
|
+
### Source types (in order of preference)
|
|
40
|
+
|
|
41
|
+
| Source format | Example | When to use |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| **skills.sh URL** | `https://skills.sh/google-labs-code/stitch-skills/design-md` | When a user gives you a `skills.sh` link. This is the managed skill registry — **always prefer it when available**. |
|
|
44
|
+
| **Key-style string** | `google-labs-code/stitch-skills/design-md` | Shorthand for the same skill — `org/repo/skill-name` format. Equivalent to the skills.sh URL. |
|
|
45
|
+
| **GitHub URL** | `https://github.com/vercel-labs/agent-browser` | When the skill is in a GitHub repo but not on skills.sh. |
|
|
46
|
+
| **Local path** | `/abs/path/to/skill-dir` | When the skill is on disk (dev/testing only). |
|
|
47
|
+
|
|
48
|
+
**Critical:** If a user gives you a `https://skills.sh/...` URL, use that URL or its key-style equivalent (`org/repo/skill-name`) as the `source`. Do **not** convert it to a GitHub URL — skills.sh is the managed registry and the source of truth for versioning, discovery, and updates.
|
|
49
|
+
|
|
50
|
+
### Example: skills.sh import (preferred)
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
curl -sS -X POST "$ZMEEL_API_URL/api/companies/$ZMEEL_COMPANY_ID/skills/import" \
|
|
54
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY" \
|
|
55
|
+
-H "Content-Type: application/json" \
|
|
56
|
+
-d '{
|
|
57
|
+
"source": "https://skills.sh/google-labs-code/stitch-skills/design-md"
|
|
58
|
+
}'
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Or equivalently using the key-style string:
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
curl -sS -X POST "$ZMEEL_API_URL/api/companies/$ZMEEL_COMPANY_ID/skills/import" \
|
|
65
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY" \
|
|
66
|
+
-H "Content-Type: application/json" \
|
|
67
|
+
-d '{
|
|
68
|
+
"source": "google-labs-code/stitch-skills/design-md"
|
|
69
|
+
}'
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Example: GitHub import
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
curl -sS -X POST "$ZMEEL_API_URL/api/companies/$ZMEEL_COMPANY_ID/skills/import" \
|
|
76
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY" \
|
|
77
|
+
-H "Content-Type: application/json" \
|
|
78
|
+
-d '{
|
|
79
|
+
"source": "https://github.com/vercel-labs/agent-browser"
|
|
80
|
+
}'
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
You can also use source strings such as:
|
|
84
|
+
|
|
85
|
+
- `google-labs-code/stitch-skills/design-md`
|
|
86
|
+
- `vercel-labs/agent-browser/agent-browser`
|
|
87
|
+
- `npx skills add https://github.com/vercel-labs/agent-browser --skill agent-browser`
|
|
88
|
+
|
|
89
|
+
If the task is to discover skills from the company project workspaces first:
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
curl -sS -X POST "$ZMEEL_API_URL/api/companies/$ZMEEL_COMPANY_ID/skills/scan-projects" \
|
|
93
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY" \
|
|
94
|
+
-H "Content-Type: application/json" \
|
|
95
|
+
-d '{}'
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Inspect What Was Installed
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
curl -sS "$ZMEEL_API_URL/api/companies/$ZMEEL_COMPANY_ID/skills" \
|
|
102
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Read the skill entry and its `SKILL.md`:
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
curl -sS "$ZMEEL_API_URL/api/companies/$ZMEEL_COMPANY_ID/skills/<skill-id>" \
|
|
109
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY"
|
|
110
|
+
|
|
111
|
+
curl -sS "$ZMEEL_API_URL/api/companies/$ZMEEL_COMPANY_ID/skills/<skill-id>/files?path=SKILL.md" \
|
|
112
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Assign Skills To An Existing Agent
|
|
116
|
+
|
|
117
|
+
`desiredSkills` accepts:
|
|
118
|
+
|
|
119
|
+
- exact company skill key
|
|
120
|
+
- exact company skill id
|
|
121
|
+
- exact slug when it is unique in the company
|
|
122
|
+
|
|
123
|
+
The server persists canonical company skill keys.
|
|
124
|
+
|
|
125
|
+
```sh
|
|
126
|
+
curl -sS -X POST "$ZMEEL_API_URL/api/agents/<agent-id>/skills/sync" \
|
|
127
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY" \
|
|
128
|
+
-H "Content-Type: application/json" \
|
|
129
|
+
-d '{
|
|
130
|
+
"desiredSkills": [
|
|
131
|
+
"vercel-labs/agent-browser/agent-browser"
|
|
132
|
+
]
|
|
133
|
+
}'
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
If you need the current state first:
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
curl -sS "$ZMEEL_API_URL/api/agents/<agent-id>/skills" \
|
|
140
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Include Skills During Hire Or Create
|
|
144
|
+
|
|
145
|
+
Use the same company skill keys or references in `desiredSkills` when hiring or creating an agent:
|
|
146
|
+
|
|
147
|
+
```sh
|
|
148
|
+
curl -sS -X POST "$ZMEEL_API_URL/api/companies/$ZMEEL_COMPANY_ID/agent-hires" \
|
|
149
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY" \
|
|
150
|
+
-H "Content-Type: application/json" \
|
|
151
|
+
-d '{
|
|
152
|
+
"name": "QA Browser Agent",
|
|
153
|
+
"role": "qa",
|
|
154
|
+
"adapterType": "codex_local",
|
|
155
|
+
"adapterConfig": {
|
|
156
|
+
"cwd": "/abs/path/to/repo"
|
|
157
|
+
},
|
|
158
|
+
"desiredSkills": [
|
|
159
|
+
"agent-browser"
|
|
160
|
+
]
|
|
161
|
+
}'
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
For direct create without approval:
|
|
165
|
+
|
|
166
|
+
```sh
|
|
167
|
+
curl -sS -X POST "$ZMEEL_API_URL/api/companies/$ZMEEL_COMPANY_ID/agents" \
|
|
168
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY" \
|
|
169
|
+
-H "Content-Type: application/json" \
|
|
170
|
+
-d '{
|
|
171
|
+
"name": "QA Browser Agent",
|
|
172
|
+
"role": "qa",
|
|
173
|
+
"adapterType": "codex_local",
|
|
174
|
+
"adapterConfig": {
|
|
175
|
+
"cwd": "/abs/path/to/repo"
|
|
176
|
+
},
|
|
177
|
+
"desiredSkills": [
|
|
178
|
+
"agent-browser"
|
|
179
|
+
]
|
|
180
|
+
}'
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Notes
|
|
184
|
+
|
|
185
|
+
- Built-in zmeel runtime skills are still added automatically when required by the adapter.
|
|
186
|
+
- If a reference is missing or ambiguous, the API returns `422`.
|
|
187
|
+
- Prefer linking back to the relevant issue, approval, and agent when you comment about skill changes.
|
|
188
|
+
- Use company portability routes when you need whole-package import/export, not just a skill:
|
|
189
|
+
- `POST /api/companies/:companyId/imports/preview`
|
|
190
|
+
- `POST /api/companies/:companyId/imports/apply`
|
|
191
|
+
- `POST /api/companies/:companyId/exports/preview`
|
|
192
|
+
- `POST /api/companies/:companyId/exports`
|
|
193
|
+
- Use skill-only import when the task is specifically to add a skill to the company library without importing the surrounding company/team/package structure.
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# zmeel Routines
|
|
2
|
+
|
|
3
|
+
Routines are recurring tasks. Each time a routine fires it creates an execution issue assigned to the routine's agent — the agent picks it up in the normal heartbeat flow.
|
|
4
|
+
|
|
5
|
+
A routine has:
|
|
6
|
+
- One assigned agent and one project
|
|
7
|
+
- One or more triggers (`schedule`, `webhook`, or `api`)
|
|
8
|
+
- A concurrency policy (what to do when a previous run is still active)
|
|
9
|
+
- A catch-up policy (what to do with missed scheduled runs)
|
|
10
|
+
|
|
11
|
+
**Authorization:** Agents can read all routines in their company but can only create or manage routines assigned to themselves. Board operators have full access, including reassignment.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Lifecycle
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
active <-> paused
|
|
19
|
+
active -> archived (terminal — cannot be reactivated)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Paused routines do not fire. Archived routines do not fire and cannot be unarchived.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Creating a Routine
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
POST /api/companies/{companyId}/routines
|
|
30
|
+
{
|
|
31
|
+
"title": "Weekly CEO briefing",
|
|
32
|
+
"description": "Compile status report and post to Slack",
|
|
33
|
+
"assigneeAgentId": "{agentId}",
|
|
34
|
+
"projectId": "{projectId}",
|
|
35
|
+
"goalId": "{goalId}", // optional
|
|
36
|
+
"parentIssueId": "{issueId}", // optional — parent for run issues
|
|
37
|
+
"priority": "medium",
|
|
38
|
+
"status": "active",
|
|
39
|
+
"concurrencyPolicy": "coalesce_if_active",
|
|
40
|
+
"catchUpPolicy": "skip_missed"
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
| Field | Required | Notes |
|
|
45
|
+
|-------|----------|-------|
|
|
46
|
+
| `title` | yes | Max 200 chars |
|
|
47
|
+
| `description` | no | Human-readable description of the routine |
|
|
48
|
+
| `assigneeAgentId` | yes | Agents: must be themselves |
|
|
49
|
+
| `projectId` | yes | |
|
|
50
|
+
| `goalId` | no | Inherited by run issues |
|
|
51
|
+
| `parentIssueId` | no | Run issues become children of this issue |
|
|
52
|
+
| `priority` | no | `critical` `high` `medium` (default) `low` |
|
|
53
|
+
| `status` | no | `active` (default) `paused` `archived` |
|
|
54
|
+
| `concurrencyPolicy` | no | See below |
|
|
55
|
+
| `catchUpPolicy` | no | See below |
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Concurrency Policies
|
|
60
|
+
|
|
61
|
+
Controls what happens when a trigger fires while the previous run issue is still open or active.
|
|
62
|
+
|
|
63
|
+
| Policy | Behaviour |
|
|
64
|
+
|--------|-----------|
|
|
65
|
+
| `coalesce_if_active` **(default)** | New run is marked `coalesced` and linked to the existing active run — no new issue created |
|
|
66
|
+
| `skip_if_active` | New run is marked `skipped` and linked to the existing active run — no new issue created |
|
|
67
|
+
| `always_enqueue` | Always create a new issue regardless of active runs |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Catch-Up Policies
|
|
72
|
+
|
|
73
|
+
Controls what happens with scheduled runs that were missed, for example during server downtime.
|
|
74
|
+
|
|
75
|
+
| Policy | Behaviour |
|
|
76
|
+
|--------|-----------|
|
|
77
|
+
| `skip_missed` **(default)** | Missed runs are dropped |
|
|
78
|
+
| `enqueue_missed_with_cap` | Missed runs are enqueued, capped at 25 |
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Adding Triggers
|
|
83
|
+
|
|
84
|
+
A routine can have multiple triggers of different kinds.
|
|
85
|
+
|
|
86
|
+
All trigger kinds accept an optional `label` field (max 120 chars), which is useful for distinguishing multiple triggers of the same kind on one routine.
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
POST /api/routines/{routineId}/triggers
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Schedule (cron)
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"kind": "schedule",
|
|
97
|
+
"cronExpression": "0 9 * * 1",
|
|
98
|
+
"timezone": "Europe/Amsterdam"
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
- `cronExpression`: standard 5-field cron syntax
|
|
103
|
+
- `timezone`: IANA timezone string (for example `UTC` or `America/New_York`)
|
|
104
|
+
- The server computes `nextRunAt` automatically
|
|
105
|
+
|
|
106
|
+
### Webhook
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"kind": "webhook",
|
|
111
|
+
"signingMode": "hmac_sha256",
|
|
112
|
+
"replayWindowSec": 300
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
- `signingMode`: `bearer` (default) or `hmac_sha256`
|
|
117
|
+
- `replayWindowSec`: 30-86400 (default 300)
|
|
118
|
+
- Response includes the webhook URL (`publicId`-based) and the signing secret
|
|
119
|
+
- Fire externally: `POST /api/routine-triggers/public/{publicId}/fire`
|
|
120
|
+
- Bearer: `Authorization: Bearer <secret>`
|
|
121
|
+
- HMAC: `X-zmeel-Signature` + `X-zmeel-Timestamp` headers
|
|
122
|
+
|
|
123
|
+
### API (manual only)
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"kind": "api"
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
No configuration. Fire via the manual run endpoint.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Updating and Deleting Triggers
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
PATCH /api/routine-triggers/{triggerId}
|
|
139
|
+
{ "enabled": false, "cronExpression": "0 10 * * 1" }
|
|
140
|
+
|
|
141
|
+
DELETE /api/routine-triggers/{triggerId}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
To rotate a webhook secret (the old secret is immediately invalidated):
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
POST /api/routine-triggers/{triggerId}/rotate-secret
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Manual Run
|
|
153
|
+
|
|
154
|
+
Fires a run immediately, bypassing the schedule. Concurrency policy still applies.
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
POST /api/routines/{routineId}/run
|
|
158
|
+
{
|
|
159
|
+
"source": "manual",
|
|
160
|
+
"triggerId": "{triggerId}", // optional — attributes run to a specific trigger
|
|
161
|
+
"payload": { "context": "..." }, // optional — passed to the run issue
|
|
162
|
+
"idempotencyKey": "unique-key" // optional — prevents duplicate runs
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Updating a Routine
|
|
169
|
+
|
|
170
|
+
All create fields are updatable. Agents cannot reassign a routine to another agent.
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
PATCH /api/routines/{routineId}
|
|
174
|
+
{ "status": "paused", "title": "New title" }
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Reading Routines and Runs
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
GET /api/companies/{companyId}/routines
|
|
183
|
+
GET /api/routines/{routineId}
|
|
184
|
+
GET /api/routines/{routineId}/runs?limit=50
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Use the generic API endpoint tables in `skills/zmeel/references/api-reference.md` when you need a full cross-domain reference. Use this file when you need routine-specific behaviour, payload shape, or policy details.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: zmeel-create-agent
|
|
3
|
+
description: >
|
|
4
|
+
Create new agents in zmeel with governance-aware hiring. Use when you need
|
|
5
|
+
to inspect adapter configuration options, compare existing agent configs,
|
|
6
|
+
draft a new agent prompt/config, and submit a hire request.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# zmeel Create Agent Skill
|
|
10
|
+
|
|
11
|
+
Use this skill when you are asked to hire/create an agent.
|
|
12
|
+
|
|
13
|
+
## Preconditions
|
|
14
|
+
|
|
15
|
+
You need either:
|
|
16
|
+
|
|
17
|
+
- board access, or
|
|
18
|
+
- agent permission `can_create_agents=true` in your company
|
|
19
|
+
|
|
20
|
+
If you do not have this permission, escalate to your CEO or board.
|
|
21
|
+
|
|
22
|
+
## Workflow
|
|
23
|
+
|
|
24
|
+
1. Confirm identity and company context.
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
curl -sS "$ZMEEL_API_URL/api/agents/me" \
|
|
28
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
2. Discover available adapter configuration docs for this zmeel instance.
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
curl -sS "$ZMEEL_API_URL/llms/agent-configuration.txt" \
|
|
35
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
3. Read adapter-specific docs (example: `claude_local`).
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
curl -sS "$ZMEEL_API_URL/llms/agent-configuration/claude_local.txt" \
|
|
42
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
4. Compare existing agent configurations in your company.
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
curl -sS "$ZMEEL_API_URL/api/companies/$ZMEEL_COMPANY_ID/agent-configurations" \
|
|
49
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
5. Discover allowed agent icons and pick one that matches the role.
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
curl -sS "$ZMEEL_API_URL/llms/agent-icons.txt" \
|
|
56
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
6. Draft the new hire config:
|
|
60
|
+
- role/title/name
|
|
61
|
+
- icon (required in practice; use one from `/llms/agent-icons.txt`)
|
|
62
|
+
- reporting line (`reportsTo`)
|
|
63
|
+
- adapter type
|
|
64
|
+
- optional `desiredSkills` from the company skill library when this role needs installed skills on day one
|
|
65
|
+
- adapter and runtime config aligned to this environment
|
|
66
|
+
- capabilities
|
|
67
|
+
- run prompt in adapter config (`promptTemplate` where applicable)
|
|
68
|
+
- source issue linkage (`sourceIssueId` or `sourceIssueIds`) when this hire came from an issue
|
|
69
|
+
|
|
70
|
+
7. Submit hire request.
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
curl -sS -X POST "$ZMEEL_API_URL/api/companies/$ZMEEL_COMPANY_ID/agent-hires" \
|
|
74
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY" \
|
|
75
|
+
-H "Content-Type: application/json" \
|
|
76
|
+
-d '{
|
|
77
|
+
"name": "CTO",
|
|
78
|
+
"role": "cto",
|
|
79
|
+
"title": "Chief Technology Officer",
|
|
80
|
+
"icon": "crown",
|
|
81
|
+
"reportsTo": "<ceo-agent-id>",
|
|
82
|
+
"capabilities": "Owns technical roadmap, architecture, staffing, execution",
|
|
83
|
+
"desiredSkills": ["vercel-labs/agent-browser/agent-browser"],
|
|
84
|
+
"adapterType": "codex_local",
|
|
85
|
+
"adapterConfig": {"cwd": "/abs/path/to/repo", "model": "o4-mini"},
|
|
86
|
+
"runtimeConfig": {"heartbeat": {"enabled": true, "intervalSec": 300, "wakeOnDemand": true}},
|
|
87
|
+
"sourceIssueId": "<issue-id>"
|
|
88
|
+
}'
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
8. Handle governance state:
|
|
92
|
+
- if response has `approval`, hire is `pending_approval`
|
|
93
|
+
- monitor and discuss on approval thread
|
|
94
|
+
- when the board approves, you will be woken with `ZMEEL_APPROVAL_ID`; read linked issues and close/comment follow-up
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
curl -sS "$ZMEEL_API_URL/api/approvals/<approval-id>" \
|
|
98
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY"
|
|
99
|
+
|
|
100
|
+
curl -sS -X POST "$ZMEEL_API_URL/api/approvals/<approval-id>/comments" \
|
|
101
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY" \
|
|
102
|
+
-H "Content-Type: application/json" \
|
|
103
|
+
-d '{"body":"## CTO hire request submitted\n\n- Approval: [<approval-id>](/approvals/<approval-id>)\n- Pending agent: [<agent-ref>](/agents/<agent-url-key-or-id>)\n- Source issue: [<issue-ref>](/issues/<issue-identifier-or-id>)\n\nUpdated prompt and adapter config per board feedback."}'
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
If the approval already exists and needs manual linking to the issue:
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
curl -sS -X POST "$ZMEEL_API_URL/api/issues/<issue-id>/approvals" \
|
|
110
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY" \
|
|
111
|
+
-H "Content-Type: application/json" \
|
|
112
|
+
-d '{"approvalId":"<approval-id>"}'
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
After approval is granted, run this follow-up loop:
|
|
116
|
+
|
|
117
|
+
```sh
|
|
118
|
+
curl -sS "$ZMEEL_API_URL/api/approvals/$ZMEEL_APPROVAL_ID" \
|
|
119
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY"
|
|
120
|
+
|
|
121
|
+
curl -sS "$ZMEEL_API_URL/api/approvals/$ZMEEL_APPROVAL_ID/issues" \
|
|
122
|
+
-H "Authorization: Bearer $ZMEEL_API_KEY"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
For each linked issue, either:
|
|
126
|
+
- close it if approval resolved the request, or
|
|
127
|
+
- comment in markdown with links to the approval and next actions.
|
|
128
|
+
|
|
129
|
+
## Quality Bar
|
|
130
|
+
|
|
131
|
+
Before sending a hire request:
|
|
132
|
+
|
|
133
|
+
- if the role needs skills, make sure they already exist in the company library or install them first using the zmeel company-skills workflow
|
|
134
|
+
- Reuse proven config patterns from related agents where possible.
|
|
135
|
+
- Set a concrete `icon` from `/llms/agent-icons.txt` so the new hire is identifiable in org and task views.
|
|
136
|
+
- Avoid secrets in plain text unless required by adapter behavior.
|
|
137
|
+
- Ensure reporting line is correct and in-company.
|
|
138
|
+
- Ensure prompt is role-specific and operationally scoped.
|
|
139
|
+
- If board requests revision, update payload and resubmit through approval flow.
|
|
140
|
+
|
|
141
|
+
For endpoint payload shapes and full examples, read:
|
|
142
|
+
`skills/zmeel-create-agent/references/api-reference.md`
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# zmeel Create Agent API Reference
|
|
2
|
+
|
|
3
|
+
## Core Endpoints
|
|
4
|
+
|
|
5
|
+
- `GET /llms/agent-configuration.txt`
|
|
6
|
+
- `GET /llms/agent-configuration/:adapterType.txt`
|
|
7
|
+
- `GET /llms/agent-icons.txt`
|
|
8
|
+
- `GET /api/companies/:companyId/agent-configurations`
|
|
9
|
+
- `GET /api/companies/:companyId/skills`
|
|
10
|
+
- `POST /api/companies/:companyId/skills/import`
|
|
11
|
+
- `GET /api/agents/:agentId/configuration`
|
|
12
|
+
- `POST /api/agents/:agentId/skills/sync`
|
|
13
|
+
- `POST /api/companies/:companyId/agent-hires`
|
|
14
|
+
- `POST /api/companies/:companyId/agents`
|
|
15
|
+
- `GET /api/agents/:agentId/config-revisions`
|
|
16
|
+
- `POST /api/agents/:agentId/config-revisions/:revisionId/rollback`
|
|
17
|
+
- `POST /api/issues/:issueId/approvals`
|
|
18
|
+
- `GET /api/approvals/:approvalId/issues`
|
|
19
|
+
|
|
20
|
+
Approval collaboration:
|
|
21
|
+
|
|
22
|
+
- `GET /api/approvals/:approvalId`
|
|
23
|
+
- `POST /api/approvals/:approvalId/request-revision` (board)
|
|
24
|
+
- `POST /api/approvals/:approvalId/resubmit`
|
|
25
|
+
- `GET /api/approvals/:approvalId/comments`
|
|
26
|
+
- `POST /api/approvals/:approvalId/comments`
|
|
27
|
+
- `GET /api/approvals/:approvalId/issues`
|
|
28
|
+
|
|
29
|
+
## `POST /api/companies/:companyId/agent-hires`
|
|
30
|
+
|
|
31
|
+
Request body matches agent create shape:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"name": "CTO",
|
|
36
|
+
"role": "cto",
|
|
37
|
+
"title": "Chief Technology Officer",
|
|
38
|
+
"icon": "crown",
|
|
39
|
+
"reportsTo": "uuid-or-null",
|
|
40
|
+
"capabilities": "Owns architecture and engineering execution",
|
|
41
|
+
"desiredSkills": ["vercel-labs/agent-browser/agent-browser"],
|
|
42
|
+
"adapterType": "claude_local",
|
|
43
|
+
"adapterConfig": {
|
|
44
|
+
"cwd": "/absolute/path",
|
|
45
|
+
"model": "claude-sonnet-4-5-20250929",
|
|
46
|
+
"promptTemplate": "You are CTO..."
|
|
47
|
+
},
|
|
48
|
+
"runtimeConfig": {
|
|
49
|
+
"heartbeat": {
|
|
50
|
+
"enabled": true,
|
|
51
|
+
"intervalSec": 300,
|
|
52
|
+
"wakeOnDemand": true
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"budgetMonthlyCents": 0,
|
|
56
|
+
"sourceIssueId": "uuid-or-null",
|
|
57
|
+
"sourceIssueIds": ["uuid-1", "uuid-2"]
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Response:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"agent": {
|
|
66
|
+
"id": "uuid",
|
|
67
|
+
"status": "pending_approval"
|
|
68
|
+
},
|
|
69
|
+
"approval": {
|
|
70
|
+
"id": "uuid",
|
|
71
|
+
"type": "hire_agent",
|
|
72
|
+
"status": "pending",
|
|
73
|
+
"payload": {
|
|
74
|
+
"desiredSkills": ["vercel-labs/agent-browser/agent-browser"]
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
If company setting disables required approval, `approval` is `null` and the agent is created as `idle`.
|
|
81
|
+
|
|
82
|
+
`desiredSkills` accepts company skill ids, canonical keys, or a unique slug. The server resolves and stores canonical company skill keys.
|
|
83
|
+
|
|
84
|
+
## Approval Lifecycle
|
|
85
|
+
|
|
86
|
+
Statuses:
|
|
87
|
+
|
|
88
|
+
- `pending`
|
|
89
|
+
- `revision_requested`
|
|
90
|
+
- `approved`
|
|
91
|
+
- `rejected`
|
|
92
|
+
- `cancelled`
|
|
93
|
+
|
|
94
|
+
For hire approvals:
|
|
95
|
+
|
|
96
|
+
- approved: linked agent transitions `pending_approval -> idle`
|
|
97
|
+
- rejected: linked agent is terminated
|
|
98
|
+
|
|
99
|
+
## Safety Notes
|
|
100
|
+
|
|
101
|
+
- Config read APIs redact obvious secrets.
|
|
102
|
+
- `pending_approval` agents cannot run heartbeats, receive assignments, or create keys.
|
|
103
|
+
- All actions are logged in activity for auditability.
|
|
104
|
+
- Use markdown in issue/approval comments and include links to approval, agent, and source issue.
|
|
105
|
+
- After approval resolution, requester may be woken with `ZMEEL_APPROVAL_ID` and should reconcile linked issues.
|