@usecoil/skill-claude 0.1.1 → 0.1.3

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 CHANGED
@@ -1,11 +1,13 @@
1
1
  # Coil Claude Code Skill
2
2
 
3
- Installable Claude Code skill package for Coil agent workflows. It verifies the
4
- installed CLI and installs the compatible public `@usecoil/cli` package when
3
+ Installable Claude Code skill package for Coil agent workflows. The command
4
+ below is the exact install form for this immutable package. Confirm registry
5
+ availability against the reviewed release manifest before use. It verifies the
6
+ installed CLI and installs the compatible `@usecoil/cli` package when
5
7
  `coil` is not already available:
6
8
 
7
9
  ```bash
8
- npx --yes @usecoil/skill-claude@0.1.1 --base-url https://www.usecoil.com
10
+ npx --yes @usecoil/skill-claude@0.1.3 --base-url https://www.usecoil.com
9
11
  coil config set-base-url https://www.usecoil.com --profile prod
10
12
  printf '%s' "$COIL_API_KEY" | coil auth login --profile prod --key -
11
13
  coil --profile prod agent-context --json
package/bin/install.mjs CHANGED
@@ -307,6 +307,12 @@ function checkCli() {
307
307
  && fetchCount?.required === true
308
308
  && fetchCount?.minimum === 1
309
309
  && fetchCount?.maximum === 25;
310
+ const hasCommand = (group, name) => Array.isArray(context.commands?.[group]?.commands)
311
+ && context.commands[group].commands.some((command) => command?.name === name);
312
+ const hasLeadImport = hasCommand('leads', 'leads import');
313
+ const hasImportOutcomes = hasCommand('recipes', 'recipe-runs import-outcomes');
314
+ const hasImportedLeads = hasCommand('recipes', 'recipe-runs leads');
315
+ const hasNamedAgents = hasCommand('agents', 'agents list');
310
316
  const compatible = contextResult.status === 0
311
317
  && context.cli?.name === 'coil'
312
318
  && context.cli?.version === version.replace(/^v/, '')
@@ -314,7 +320,11 @@ function checkCli() {
314
320
  && hasSpendGate
315
321
  && hasStarterCap
316
322
  && Array.isArray(context.commands?.recipes?.commands)
317
- && context.commands.recipes.commands.some((command) => command?.name === 'recipes run');
323
+ && context.commands.recipes.commands.some((command) => command?.name === 'recipes run')
324
+ && hasLeadImport
325
+ && hasImportOutcomes
326
+ && hasImportedLeads
327
+ && hasNamedAgents;
318
328
  return {
319
329
  ok: Boolean(compatible),
320
330
  present: true,
@@ -561,7 +571,7 @@ if (!cli.ok) {
561
571
  if (!cli.ok) {
562
572
  const rollbackFailed = installedCli && !rollbackCliInstall();
563
573
  const detail = cli.reason ?? (cli.version ? `Found ${cli.version}; supported versions are ${SUPPORTED_CLI_RANGE}.` : 'No coil executable was found.');
564
- console.error(`Error: ${detail} Install @usecoil/cli ${PUBLIC_CLI_SPEC} from the public npm registry, or rerun with --cli-package <path-to-reviewed-tarball>.`);
574
+ console.error(`Error: ${detail} Install ${PUBLIC_CLI_SPEC} from the public npm registry, or rerun with --cli-package <path-to-reviewed-tarball>.`);
565
575
  if (rollbackFailed) console.error('Warning: automatic rollback of the newly installed Coil CLI failed; remove @usecoil/cli manually.');
566
576
  process.exit(1);
567
577
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usecoil/skill-claude",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Claude Code skill package for Coil agent workflows",
5
5
  "type": "module",
6
6
  "bin": {
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "coilCompatibility": {
30
30
  "cli": "0.1.x",
31
- "preferredVersion": "0.1.1"
31
+ "preferredVersion": "0.1.4"
32
32
  },
33
33
  "coilRuntime": {
34
34
  "name": "claude",
package/skill/SKILL.md CHANGED
@@ -16,7 +16,7 @@ it can do:
16
16
 
17
17
  ```bash
18
18
  if ! command -v coil >/dev/null 2>&1; then
19
- npm install --global @usecoil/cli@0.1.1
19
+ npm install --global @usecoil/cli@0.1.4
20
20
  fi
21
21
  coil --version
22
22
  ```
@@ -77,7 +77,7 @@ The runtime-specific installer or registry handles placement; Coil operations
77
77
  always use the same public JSON CLI:
78
78
 
79
79
  ```bash
80
- npm install --global @usecoil/cli@0.1.1
80
+ npm install --global @usecoil/cli@0.1.4
81
81
  coil config set-base-url https://www.usecoil.com --profile prod
82
82
  printf '%s' "$COIL_API_KEY" | coil auth login --profile prod --key -
83
83
  coil --profile prod agent-context --json
@@ -98,6 +98,44 @@ other runtimes may use their own secret manager. Do not add `COIL_ORG_ID`.
98
98
  - Diagnostics and errors go to stderr.
99
99
  - Global flags: `--profile`, `--base-url`, `--json`, `--output-version`.
100
100
 
101
+ ## Human action handoffs
102
+
103
+ When a raw Coil API success response includes `meta.human_action`, or a blocked
104
+ API error includes `error.details.human_action`, relay the returned action to
105
+ the user. In CLI `--json` success output, object results and V2 list envelopes
106
+ expose the same action as a top-level `human_action` field. The V1 automations
107
+ result list keeps its array shape and adds `human_action` to the matching item.
108
+ CLI errors preserve it under
109
+ `error.details.human_action`. State whether it is required or recommended,
110
+ include the exact `url` verbatim, and use its human-readable `label`. Do not
111
+ say only “go to the dashboard,” fabricate a URL, or direct draft review to the
112
+ public `/recipes` concept pages. If no specific recipe ID is available, use the
113
+ server-approved `/dashboard/recipes/review` queue. Treat opening the URL as
114
+ navigation only; the destination still authenticates and authorizes the human.
115
+
116
+ Older Actor Lab responses may also contain `approval_url`. Preserve and relay
117
+ that server-provided URL when present, while preferring the standardized
118
+ `human_action` object for machine reasoning.
119
+
120
+ Automation handoffs use the server-provided absolute `/automations` URL. After
121
+ an agent creates or validates a draft, relay the required publication action
122
+ verbatim: the human org admin must review and publish the draft. If a run or
123
+ result has `reconciliation_required`, relay the required reconciliation action
124
+ verbatim and do not retry the webhook. A policy-review action means a human
125
+ must decide the governance policy; it is not an instruction to weaken policy.
126
+
127
+ Provider integration status is a specific success-envelope case. When the
128
+ current credential-scoped `execution_readiness` contains a `blocked` scope,
129
+ `GET /api/integrations/{provider}` returns the same required Coil action at
130
+ `meta.human_action` and the temporary compatibility alias `data.human_action`.
131
+ The current CLI promotes one copy to top-level `human_action`; older clients
132
+ that unwrap `data` still retain the alias. Relay the Coil `url` verbatim even
133
+ when `execution_readiness[].actionUrl` is `null`. A non-null provider
134
+ `actionUrl` is a separate safe external provider-authorization link. Do not
135
+ invent, rewrite, or treat either URL as approval or authority. Automatic
136
+ `open`, `half_open`, `degraded`, `ready`, and `unknown` states do not require
137
+ this handoff.
138
+
101
139
  ## Common Workflows
102
140
 
103
141
  ### Orient
@@ -112,6 +150,24 @@ coil --profile prod auth status --json
112
150
 
113
151
  Use the server-derived activation state before starting a new workspace flow. Provider-backed runs require a healthy saved connection and explicit spend confirmation.
114
152
 
153
+ `coil activation status --json` may include a server-provided `human_action`.
154
+ State whether it is required or recommended and relay its absolute `url`
155
+ verbatim. Do not map `nextAction` to a guessed dashboard route. `start_run`
156
+ still needs explicit provider-spend confirmation; a human-action URL is only
157
+ navigation and does not grant approval or authority.
158
+
159
+ Machine recipe creation, draft updates, and template installation return a required
160
+ `human_action` for the specific `/dashboard/recipes/{recipeId}` detail surface.
161
+ Successful machine validation of a draft returns the same action. Relay its
162
+ absolute `url` verbatim. A machine publish `403` preserves the scoped action in
163
+ `error.details.human_action` when the draft exists; do not treat the URL as
164
+ approval or authority.
165
+
166
+ For `recipes create --json`, preserve every returned recipe field and relay the
167
+ top-level `human_action` when the server provides it. If the response contains
168
+ only `data` or omits valid metadata, report the unchanged recipe result. Never
169
+ infer or fabricate a dashboard URL or human action.
170
+
115
171
  ```bash
116
172
  coil --profile prod activation status --json
117
173
  coil --profile prod marketplace templates --json
@@ -147,7 +203,24 @@ coil --profile prod recipe-runs cancel <run-id> --json
147
203
  coil --profile prod recipe-runs retry <run-id> --json
148
204
  ```
149
205
 
150
- Publication and ambiguous-effect reconciliation require a human organization admin. Retry/cancel behavior follows the durable run state returned by the API.
206
+ Publication and ambiguous-effect reconciliation require a human organization admin. If a run has an unresolved provider effect, relay the server-provided `human_action.url` from the view/wait/watch state (or `error.details.human_action` from a machine reconcile denial) verbatim. The URL opens `/dashboard/recipe-runs/{runId}` for evidence review; it is navigation only and does not prove provider acceptance or authorize a decision. Retry/cancel behavior follows the durable run state and `next_actions`, not the presence of a URL.
207
+
208
+ ### Lead-list imports
209
+
210
+ ```bash
211
+ coil --profile prod --json leads import ./prospects.csv --mapping '{"Work email":"email"}' --admission-key import-september-001
212
+ coil --profile prod recipe-runs view <run-id> --json
213
+ coil --profile prod recipe-runs import-outcomes <run-id> --outcome rejected --json
214
+ coil --profile prod recipe-runs leads <run-id> --json
215
+ ```
216
+
217
+ Imports accept at most 2,000 data rows and 2 MiB of CSV input. Use header
218
+ mapping for ambiguous columns and a stable admission key when a retry could be
219
+ uncertain. A `202` response means durable admission, not terminal success. Do
220
+ not report completion until the run is terminal and its outcomes and attributed
221
+ leads have been inspected. Rejected-row PII is not printed. Successful inputs
222
+ are scrubbed after completion; failed or cancelled normalized replay data is
223
+ retained for up to 30 days. The original CSV is never stored.
151
224
 
152
225
  ### Scrapes
153
226
 
@@ -175,6 +248,14 @@ coil --profile prod leads emails <scrape-id>
175
248
 
176
249
  API-key agents can create draft automations. Human org admins publish drafts after validation.
177
250
 
251
+ Creation and successful draft validation may return a required `human_action`
252
+ with an absolute `/automations` URL. Tell the user that the draft is ready but
253
+ requires human admin review and publication, and relay `human_action.url`
254
+ verbatim. A machine publish attempt returns the same structured action in the
255
+ 403 error details. When run or result state is `reconciliation_required`, the
256
+ same operations URL is a required human reconciliation handoff; never infer a
257
+ URL from a status string or replay the ambiguous webhook.
258
+
178
259
  ```bash
179
260
  coil --profile prod automations create --name "Enrich leads" --webhook-url "https://hooks.example.com/enrich" --input-fields email,company_name --scope global --json
180
261
  coil --profile prod automations list --status draft --json --output-version 2
@@ -11,6 +11,12 @@ Content-Type: application/json
11
11
 
12
12
  Coil organization API keys (`ak_...`) are accepted by agent-compatible routes.
13
13
 
14
+ Coil first-party credentials authenticate durable named agents. The agent ID is
15
+ the machine actor ID; the credential ID identifies only one credential.
16
+ Existing credentials were identity-preserving backfilled. Credential
17
+ administration requires a human organization admin, and permanent credential
18
+ plaintext is returned only once.
19
+
14
20
  ## Auth and Context
15
21
 
16
22
  | Method | Path | Notes |
@@ -20,12 +26,31 @@ Coil organization API keys (`ak_...`) are accepted by agent-compatible routes.
20
26
  | DELETE | `/api/auth/api-keys/{id}` | Revokes a Coil organization API key for human org admins. |
21
27
  | POST | `/api/auth/verify-key` | Verifies a Coil organization API key without exposing it. |
22
28
 
29
+ Named-agent management is human-admin only:
30
+
31
+ | Method | Path | CLI |
32
+ | --- | --- | --- |
33
+ | GET | `/api/agents` | `coil agents list --json` |
34
+ | POST | `/api/agents` | `coil agents create --name ... --json` |
35
+ | GET | `/api/agents/{id}` | `coil agents view <agent-id> --json` |
36
+ | POST | `/api/agents/{id}/setup` | `coil agents setup <agent-id> --runtime ... --profile ... --json` |
37
+ | POST | `/api/agents/{id}/credentials` | `coil agents issue-credential <agent-id> --json` |
38
+ | DELETE | `/api/agents/{id}/credentials/{credentialId}` | `coil agents revoke-credential <agent-id> <credential-id> --json` |
39
+
40
+ `--replace` changes the generated local setup command. It does not revoke an
41
+ existing credential. Replacement credentials keep the same durable agent ID.
42
+
23
43
  CLI discovery wrapper:
24
44
 
25
45
  ```bash
26
46
  coil agent-context --json
27
47
  ```
28
48
 
49
+ When a response requires or recommends a human web handoff, the API returns a
50
+ typed `human_action` in success `meta` or blocked error `details`, and the CLI
51
+ preserves it in JSON output. Agents must relay the exact URL and its required
52
+ or recommended state. The URL does not grant authority or imply approval.
53
+
29
54
  ## Activation, Marketplace, and Recipes
30
55
 
31
56
  | Method | Path | CLI |
@@ -71,6 +96,20 @@ Machine callers can create scrapes. Admin-gated destructive routes require a hum
71
96
  | PATCH | `/api/leads/bulk` | `coil leads bulk-update --ids ... --fields '{...}' --json` |
72
97
  | POST | `/api/export/csv` | `coil leads export <scrape-id> [--filter/--view/--ids] [--output]` |
73
98
  | GET | `/api/leads/emails?scrapeId={id}` | `coil leads emails <scrape-id>` |
99
+ | POST | `/api/leads/import` | `coil --json leads import <file> [--mapping ...] [--admission-key ...]` |
100
+ | GET | `/api/recipe-runs/{id}/import-outcomes` | `coil recipe-runs import-outcomes <run-id> --outcome rejected --json` |
101
+ | GET | `/api/recipe-runs/{id}/leads` | `coil recipe-runs leads <run-id> --json` |
102
+
103
+ Lead-list imports accept at most 2,000 data rows and 2 MiB of CSV input. The
104
+ CLI maps supported headers before admission; use `--mapping` for ambiguous
105
+ headers and a stable `--admission-key` when a retry may be uncertain. A `202`
106
+ response means durable admission, not terminal success. Inspect
107
+ `coil recipe-runs view`, `coil recipe-runs import-outcomes`, and
108
+ `coil recipe-runs leads` and wait for a terminal run state before reporting
109
+ completion. The API is organization-scoped, does not retain the original CSV,
110
+ and does not print rejected-row PII. Successful inputs are scrubbed after
111
+ completion; failed or cancelled normalized replay data is retained for up to
112
+ 30 days.
74
113
 
75
114
  ## Automations
76
115
 
@@ -95,6 +134,12 @@ Machine callers can create scrapes. Admin-gated destructive routes require a hum
95
134
 
96
135
  API-key callers create draft automations. Publishing, deletion, and policy changes require a human org admin session. Automation result links are deliberately narrow traceability records for delivery evidence; they are not a generic metadata surface.
97
136
 
137
+ Draft creation/validation, unresolved automation run/result reads, and exact
138
+ admission replays of unresolved runs may include
139
+ `meta.human_action` with the absolute `/automations` review or reconciliation
140
+ URL. Machine publication and reconciliation attempts preserve the same action
141
+ under `error.details.human_action`.
142
+
98
143
  ## Settings, Preferences, Members
99
144
 
100
145
  | Method | Path | CLI |
@@ -119,6 +164,17 @@ API-key callers create draft automations. Publishing, deletion, and policy chang
119
164
  | GET | `/api/integrations/smartlead/campaigns/sequences?campaignId={id}` | `coil smartlead sequences --campaign <id> --json` |
120
165
  | POST | `/api/integrations/smartlead/send` | `coil smartlead send <scrape-id> --campaign <id> --json` |
121
166
 
167
+ `GET /api/integrations/{provider}` includes current credential-scoped
168
+ `execution_readiness`. For a `blocked` scope, the response returns one
169
+ server-generated absolute Coil operator URL at canonical `meta.human_action`
170
+ and the temporary compatibility alias `data.human_action`. Relay that Coil URL
171
+ verbatim even when `execution_readiness[].actionUrl` is `null`. The CLI exposes
172
+ one top-level `human_action` in JSON and an explicit text-mode URL. A safe,
173
+ non-null `execution_readiness[].actionUrl` remains a separate provider-side
174
+ authorization link and must not be rewritten or treated as Coil approval.
175
+ `open`, `half_open`, `degraded`, `ready`, and `unknown` states do not include a
176
+ required human action.
177
+
122
178
  ## Feedback
123
179
 
124
180
  | Method | Path | CLI |
@@ -32,6 +32,44 @@ Use `--json --output-version 2` on list commands when possible:
32
32
  }
33
33
  ```
34
34
 
35
+ ## Human action
36
+
37
+ API success envelopes may include `meta.human_action`; blocked errors may
38
+ include the same object at `error.details.human_action`:
39
+
40
+ | Field | Type | Notes |
41
+ | --- | --- | --- |
42
+ | `kind` | `approval`/`review`/`reconciliation`/`operator_intervention` | Human handoff category. |
43
+ | `required` | boolean | Whether the human action is required to continue. |
44
+ | `label` | string | Short human-readable action description. |
45
+ | `url` | absolute HTTP(S) URL | Server-provided navigation URL. It is not a bearer token or approval capability. |
46
+ | `resource_type` | string/null | Optional Coil resource type. |
47
+ | `resource_id` | string/null | Optional resource identifier. |
48
+
49
+ The CLI preserves this action as a top-level `human_action` field for object
50
+ JSON results and V2 list envelopes. The V1 automations result list keeps its
51
+ array shape and adds `human_action` to the matching item. Text mode prints the
52
+ URL explicitly. Do not invent
53
+ one when the server does not return it. Legacy Actor Lab `approval_url` remains
54
+ available during the compatibility window.
55
+
56
+ ### Provider integration status
57
+
58
+ `GET /api/integrations/{provider}` reports the current credential-scoped
59
+ `execution_readiness` records. If a current scope is `blocked`, the raw API
60
+ success envelope contains the same `Human action` object at both
61
+ `meta.human_action` (canonical) and `data.human_action` (temporary compatibility
62
+ alias for clients that unwrap `data`). The current CLI exposes one copy as
63
+ top-level `human_action` in JSON and prints its label and URL explicitly in
64
+ text mode.
65
+
66
+ `execution_readiness[].actionUrl` remains the separately validated provider
67
+ authorization URL and may be `null`; it must not be copied into the Coil
68
+ action. Relay the absolute Coil URL verbatim even when the provider URL is
69
+ `null`. Only `blocked` requires this operator handoff. `open`, `half_open`,
70
+ `degraded`, `ready`, and `unknown` retain automatic retry or reconciliation
71
+ semantics and do not advertise required human intervention.
72
+
35
73
  ## Scrape
36
74
 
37
75
  | Field | Type | Notes |
@@ -125,8 +163,8 @@ Supported operators include equality, contains, empty/not-empty, booleans, and d
125
163
  | `scrape_id` | string/null | Required for scrape-scoped automation. |
126
164
  | `status` | `draft`/`published`/`disabled` | API-key agents create drafts. |
127
165
  | `created_by_actor_type` | `human`/`machine` | Actor attribution. |
128
- | `created_by_actor_id` | string | User ID or API key ID. |
129
- | `created_by_actor_name` | string/null | API key display name when available. |
166
+ | `created_by_actor_id` | string | User ID or durable Coil agent ID. |
167
+ | `created_by_actor_name` | string/null | Durable agent display name when available. |
130
168
  | `published_by_user_id` | string/null | Human admin publisher. |
131
169
  | `published_at` | ISO string/null | Publication timestamp. |
132
170
 
@@ -149,12 +187,18 @@ Create payload:
149
187
  | `id` | string | UUID. |
150
188
  | `automation_id` | string | Parent automation. |
151
189
  | `lead_id` | string | Processed lead. |
152
- | `status` | `pending`/`running`/`success`/`error` | Delivery state. |
190
+ | `status` | `pending`/`running`/`success`/`error`/`cancelled`/`reconciliation_required` | Delivery state. `reconciliation_required` is ambiguous provider delivery and requires a human action; it is never a retry instruction. |
153
191
  | `result` | string/null | Webhook response or summary. |
154
192
  | `error_message` | string/null | Failure detail. |
155
193
  | `created_at` | ISO string | Creation timestamp. |
156
194
  | `updated_at` | ISO string | Last status update. |
157
195
 
196
+ When automation creation or draft validation requires publication, or an
197
+ automation run/result requires reconciliation, the API returns
198
+ `meta.human_action` (or `error.details.human_action` for a blocked request).
199
+ The URL is an absolute, secret-free `/automations` navigation URL. Relay it
200
+ verbatim; opening it does not grant approval or change policy.
201
+
158
202
  ## Automation Result Link
159
203
 
160
204
  | Field | Type | Notes |
@@ -198,5 +242,9 @@ Settings are stored in org-scoped JSON. Common keys:
198
242
  ## Agent Caveats
199
243
 
200
244
  - API-key agents currently behave as org members, not org admins.
245
+ - A first-party credential authenticates a durable named agent. Credential IDs and agent IDs are separate; existing credentials were identity-preserving backfilled.
246
+ - Browser credential checking does not update `last_used_at` and does not prove that an external agent runtime is connected.
247
+ - Replacement uses temporary credential overlap and explicit old-credential revocation.
248
+ - Clerk organization API keys remain a separate compatibility path.
201
249
  - Admin-gated actions include destructive scrape/automation operations, automation policy management, and automation publishing.
202
250
  - Prefer `coil feedback` for platform friction discovered while operating Coil.