@docusign/cli 1.1.0-rc → 1.3.0-rc
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 +13 -0
- package/dist/index.mjs +478 -241
- package/dist/templates/ai-skills/.claude/skills/ds-agm-autopilot/SKILL.md +13 -2
- package/dist/templates/ai-skills/.claude/skills/ds-agreement-manager-workflow/SKILL.md +11 -0
- package/dist/templates/ai-skills/.claude/skills/ds-package-autopilot/SKILL.md +514 -0
- package/dist/templates/ai-skills/.cursor/rules/docusign.mdc +2 -1
- package/dist/templates/ai-skills/.gemini/instructions.md +2 -1
- package/dist/templates/ai-skills/.github/instructions/docusign.instructions.md +18 -0
- package/dist/templates/ai-skills/aiSkills.spec.ts +57 -0
- package/dist/templates/integration/README.md +40 -0
- package/dist/templates/package/README.md +107 -0
- package/package.json +1 -1
|
@@ -403,7 +403,7 @@ I need values for <N> documents. Which fields do you want to populate?
|
|
|
403
403
|
(Tip: you don't need to fill all columns — just what matters for your use case)
|
|
404
404
|
|
|
405
405
|
Common metadata fields to fill:
|
|
406
|
-
• Salesforce
|
|
406
|
+
• Salesforce or other external-system linked records
|
|
407
407
|
• Any fields that can't be AI-extracted from the document content
|
|
408
408
|
|
|
409
409
|
Options:
|
|
@@ -417,6 +417,15 @@ Options:
|
|
|
417
417
|
Which approach?
|
|
418
418
|
```
|
|
419
419
|
|
|
420
|
+
For linked external records, use the exact `linked_data` column generated after `Filename`. Put the complete API array in one cell; do not create indexed columns such as `linked_data[0]` or `linked_data[0].application_name`. Leave the cell blank when the document has no linked records.
|
|
421
|
+
|
|
422
|
+
```csv
|
|
423
|
+
Filename,linked_data
|
|
424
|
+
agreement.pdf,"[{""application_name"":""Salesforce"",""object_name"":""Opportunity"",""record_id"":""006xx000001abc""}]"
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
Multiple linked records belong in the same JSON array. Preserve the exact snake_case property names `application_name`, `object_name`, and `record_id`.
|
|
428
|
+
|
|
420
429
|
**If A — inline collection:**
|
|
421
430
|
|
|
422
431
|
```
|
|
@@ -424,7 +433,9 @@ Enter values for each document.
|
|
|
424
433
|
Format: one line per field, or a full row, or a paste from a spreadsheet.
|
|
425
434
|
|
|
426
435
|
film_deal_001.html
|
|
427
|
-
|
|
436
|
+
Linked application name : _______________
|
|
437
|
+
Linked object name : _______________
|
|
438
|
+
Linked record ID : _______________
|
|
428
439
|
[other fields the user chose]
|
|
429
440
|
|
|
430
441
|
film_deal_002.html
|
|
@@ -188,12 +188,23 @@ ds agm ingest --directory ./agreement-manager/files/test --recursive -y
|
|
|
188
188
|
|
|
189
189
|
# Preview
|
|
190
190
|
ds agm ingest --directory ./agreement-manager/files/test --dry-run
|
|
191
|
+
|
|
192
|
+
# Generate and then ingest with metadata
|
|
193
|
+
ds agm ingest --directory ./agreement-manager/files/test --generate-metadata-template
|
|
194
|
+
ds agm ingest --directory ./agreement-manager/files/test --with-metadata -y
|
|
191
195
|
```
|
|
192
196
|
|
|
193
197
|
**Supported formats:** PDF, DOCX, DOC, HTML, XLSX, XLS, XLSB, PPTX, PPT, PPSX, RTF, JPG, PNG, TIF
|
|
194
198
|
|
|
195
199
|
Tracked in `agreement-manager/files/tracking.json` to prevent duplicate ingestion.
|
|
196
200
|
|
|
201
|
+
The generated `agreement-manager/metadata/metadata.csv` includes an optional `linked_data` column. Enter the complete Agreement Manager API array as JSON in that cell; do not use indexed headers such as `linked_data[0]`:
|
|
202
|
+
|
|
203
|
+
```csv
|
|
204
|
+
Filename,linked_data
|
|
205
|
+
agreement.pdf,"[{""application_name"":""Salesforce"",""object_name"":""Opportunity"",""record_id"":""006xx000001abc""}]"
|
|
206
|
+
```
|
|
207
|
+
|
|
197
208
|
---
|
|
198
209
|
|
|
199
210
|
## Step 7: Generate Test Template
|
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ds-package-autopilot
|
|
3
|
+
description: Guided, interactive autopilot for Docusign packages. Drives the full lifecycle — build a package from eSign templates, web forms, Maestro workflows and document templates, export it as a portable zip, install it into another account (connections, consent, drafts), resume an install, and diagnose failures. Use when working with ds package / ds pkg commands, moving configuration between Docusign accounts, or installing a package.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# DS Package Autopilot
|
|
7
|
+
|
|
8
|
+
You are an autonomous operator for Docusign packages. A package bundles configuration (eSign templates, web forms, Maestro workflows, document templates, and the apps and fields they depend on) so it can be moved to another account. You drive the whole flow with visual feedback at every stage, clear decision gates, and an honest verdict at the end. Never run silently — show the command, show its output, and confirm the result before moving on.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## How This Works
|
|
13
|
+
|
|
14
|
+
**Two modes:**
|
|
15
|
+
|
|
16
|
+
- **Guided** — You ask the user at each decision point (which components, which account, which connection).
|
|
17
|
+
- **Autonomous** — The user says "do everything" or "autopilot". You make sensible choices, show what you did, and ask only when genuinely ambiguous or when an action cannot be undone.
|
|
18
|
+
|
|
19
|
+
**At every stage you must:**
|
|
20
|
+
|
|
21
|
+
1. Print the stage banner before starting
|
|
22
|
+
2. Show the exact command being run
|
|
23
|
+
3. Show the full command output verbatim
|
|
24
|
+
4. Print the stage completion summary with key facts
|
|
25
|
+
5. State what's next before proceeding
|
|
26
|
+
|
|
27
|
+
**Visual pattern — use this exactly:**
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
── STAGE N: STAGE NAME ─────────────────────────────────
|
|
31
|
+
|
|
32
|
+
[What you're about to do, one sentence]
|
|
33
|
+
|
|
34
|
+
▶ Running: ds pkg <command>
|
|
35
|
+
|
|
36
|
+
<full command output here>
|
|
37
|
+
|
|
38
|
+
✅ STAGE N COMPLETE
|
|
39
|
+
Key fact 1
|
|
40
|
+
Key fact 2
|
|
41
|
+
→ Next: Stage N+1 — Name
|
|
42
|
+
────────────────────────────────────────────────────────
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Verify, do not assume.** A command that exits 0 is not proof. After every write, read the state back (`ds pkg view-details`, `ds pkg status`) and report what you saw, not what you expected.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Mental Model (read this first)
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
SOURCE ACCOUNT TARGET ACCOUNT
|
|
53
|
+
────────────── ──────────────
|
|
54
|
+
create ─▶ add components ─▶ export ──▶ my-package.zip ──▶ install
|
|
55
|
+
│ (publishes, │
|
|
56
|
+
│ freezes the package) ├─ pause: app connections
|
|
57
|
+
▼ ├─ pause: workflow consent
|
|
58
|
+
zip with every component └─ verdict
|
|
59
|
+
+ requirements.json
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Facts that shape every decision:
|
|
63
|
+
|
|
64
|
+
- **Import and install are the same thing.** `ds pkg install` and `ds pkg import` are one command. You never import first and install second.
|
|
65
|
+
- **The zip is the way between accounts.** A private package cannot be installed by id from another account. Export it, switch accounts, install the zip. A _public_ package can be installed from any account by name or id.
|
|
66
|
+
- **Installing does not add to `ds pkg list`.** The result is a set of components in the target account, not a new package entry.
|
|
67
|
+
- **Exporting publishes the package.** A Published package is frozen: no more components can be added. Tell the user before you export.
|
|
68
|
+
- **Nothing can be undone from the CLI.** Installed components, installed packages and exports can only be removed in the Docusign web app. Always use `--prefix` for test installs so they can be found and deleted.
|
|
69
|
+
- **A package carries what a component needs.** Adding a workflow brings in the apps, templates and forms it depends on. The server adds them; `ds pkg view-details` shows them as a tree.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Entry Point
|
|
74
|
+
|
|
75
|
+
When the skill is invoked, ask:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
Welcome to DS Package Autopilot. What would you like to do?
|
|
79
|
+
|
|
80
|
+
A Build a package and move it to another account (create → export → install)
|
|
81
|
+
B Install a zip I already have into this account
|
|
82
|
+
C Install a public package
|
|
83
|
+
D Resume an install that stopped
|
|
84
|
+
E An install failed — help me find out why
|
|
85
|
+
F Inspect packages in this account
|
|
86
|
+
|
|
87
|
+
Say a letter, describe what you want, or say "autopilot" to let me drive.
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Then proceed to the relevant workflow below.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## WORKFLOW A: Build a Package and Move It to Another Account
|
|
95
|
+
|
|
96
|
+
### Stage 1: Auth & Account Check
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
── STAGE 1: AUTH CHECK ──────────────────────────────────
|
|
100
|
+
▶ Running: ds auth test
|
|
101
|
+
<output>
|
|
102
|
+
✅ STAGE 1 COMPLETE
|
|
103
|
+
Account: <name> (<account id>)
|
|
104
|
+
Environment: <demo|integration|stage|production>
|
|
105
|
+
Token expires: <time>
|
|
106
|
+
→ Next: Stage 2 — Check scopes
|
|
107
|
+
────────────────────────────────────────────────────────
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
If auth fails: `ds auth login -e <environment>`. **Always state which account the CLI is on before any write.** Every account looks alike in the output; confusing source and target is the most common mistake.
|
|
111
|
+
|
|
112
|
+
### Stage 2: Scope Check (only if the package will hold a workflow with an app)
|
|
113
|
+
|
|
114
|
+
Workflows that use an app (ACT) need four restricted scopes in the login: `act_read`, `act_write`, `transaction_management_api`, `proof_create_transaction`. The CLI also asks for `adm_entity_esign_read` and `adm_entity_esign_write`.
|
|
115
|
+
|
|
116
|
+
- Restricted scopes are added to the **integration key** by an admin, then the user must **log in again** — a token keeps the scopes it was issued with. Adding scopes without a fresh login changes nothing.
|
|
117
|
+
- A token missing them shows up as a `403` when adding a workflow (`Failed to process component … of type MaestroWorkflow: Request failed with status code 403`), or as an app that fails to install.
|
|
118
|
+
- To check a token without printing it, decode the `scp` claim and compare **names only**. Never print the token.
|
|
119
|
+
|
|
120
|
+
### Stage 3: Find the Components
|
|
121
|
+
|
|
122
|
+
Ask:
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
What should go into the package? I need each component's id and a name.
|
|
126
|
+
|
|
127
|
+
eSign templates → --esign-templates "<id>:<name>"
|
|
128
|
+
Document templates → --templates "<id>:<name>"
|
|
129
|
+
Maestro workflows → --workflow "<id>:<name>"
|
|
130
|
+
Web forms → --webform "<id>:<name>"
|
|
131
|
+
|
|
132
|
+
You can paste the web-app URL for each — the id is in the path.
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Ids come from the Docusign web app URLs. A URL may carry a `hash=` or `mtsec=` parameter: that is a credential. **Use only the id from the path and never repeat the rest.**
|
|
136
|
+
|
|
137
|
+
The component must exist **in the account the CLI is logged into**. A `400` (eSign) or `403` (web form, workflow) on add usually means the component belongs to a different account, not that the id is wrong. Check `ds auth test` before anything else.
|
|
138
|
+
|
|
139
|
+
### Stage 4: Create the Package and Add Components
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
── STAGE 4: BUILD THE PACKAGE ───────────────────────────
|
|
143
|
+
|
|
144
|
+
▶ Running: ds pkg create --name=<name>
|
|
145
|
+
<output>
|
|
146
|
+
|
|
147
|
+
▶ Running: ds pkg add --id=<packageId> --esign-templates "<id>:<name>" --webform "<id>:<name>"
|
|
148
|
+
<output>
|
|
149
|
+
|
|
150
|
+
▶ Running: ds pkg view-details --id=<packageId>
|
|
151
|
+
<output>
|
|
152
|
+
|
|
153
|
+
✅ STAGE 4 COMPLETE
|
|
154
|
+
Package: <name> (<packageId>)
|
|
155
|
+
Components: <N> (<M> added by the server as dependencies)
|
|
156
|
+
→ Next: Stage 5 — Export
|
|
157
|
+
────────────────────────────────────────────────────────
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Rules:
|
|
161
|
+
|
|
162
|
+
- **Use `--id`, not `--name`, after creating.** Names are not unique. Read the id from the create output.
|
|
163
|
+
- **Add one risky component per call.** If a call fails, no component is added. Adding the workflow on its own isolates a failure.
|
|
164
|
+
- **Read back after every add.** The server can accept a request and still leave a component out. The CLI counts what the server kept and fails with "did not add N of M components", naming each one. When that happens, check the account (`ds auth test`) and the scopes. Run `ds pkg view-details` to see the tree.
|
|
165
|
+
- To change a component, `ds pkg remove` it and add it again. Only a Draft package can change.
|
|
166
|
+
|
|
167
|
+
### Stage 5: Export
|
|
168
|
+
|
|
169
|
+
Tell the user first: **exporting publishes the package and freezes it.**
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
── STAGE 5: EXPORT ──────────────────────────────────────
|
|
173
|
+
|
|
174
|
+
▶ Running: ds pkg export --id=<packageId>
|
|
175
|
+
<output>
|
|
176
|
+
|
|
177
|
+
✅ STAGE 5 COMPLETE
|
|
178
|
+
Zip: <path>/package/files/<name>-<first 8 of id>.zip
|
|
179
|
+
Size: <size>
|
|
180
|
+
Components: <N>
|
|
181
|
+
→ Next: Stage 6 — Inspect the zip
|
|
182
|
+
────────────────────────────────────────────────────────
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Then inspect the zip before moving on. It is a normal zip:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
unzip -l <zip> # one folder per component type, plus metadata.json and requirements.json
|
|
189
|
+
unzip -p <zip> requirements.json # what the target account must supply
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
`requirements.json` is an empty list `[]` when nothing is needed. When an app is used by a workflow it lists a `CONNECTION_INSTANCE` requirement, naming the app and the step that uses it. **That entry is what makes the install pause for a connection.** Tell the user what to expect: "This package needs a <app> connection in the target account."
|
|
193
|
+
|
|
194
|
+
If export ends with `Publishing ended with status FAILURE`, go to **Workflow E**.
|
|
195
|
+
|
|
196
|
+
### Stage 6: Switch to the Target Account
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
To install in another account:
|
|
200
|
+
1. Run: ds auth login -e <environment> (choose the TARGET account)
|
|
201
|
+
2. Tell me when you're logged in — I'll verify and continue.
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
You cannot answer the login's account prompt for the user. After they confirm, run `ds auth test` and **check the account id is the target and not the source.** Refuse to continue until it is.
|
|
205
|
+
|
|
206
|
+
### Stage 7: Pre-flight on the Target
|
|
207
|
+
|
|
208
|
+
- Scopes (Stage 2) for the target login, if the package holds an app.
|
|
209
|
+
- If `requirements.json` named an app: look at whether the target account already has an active connection for it. The install shows the connections it finds; there is no separate command.
|
|
210
|
+
- Tell the user about the **workflow limit**: an account can deploy only a fixed number of published workflows (3 was seen on a test account). A package with a workflow can fail at the very last step if the account is full. Ask them to free a slot beforehand if they know the account is busy, or plan to use `--draft-workflows`.
|
|
211
|
+
|
|
212
|
+
### Stage 8: Install
|
|
213
|
+
|
|
214
|
+
Choose the flags with the user:
|
|
215
|
+
|
|
216
|
+
| Goal | Flags |
|
|
217
|
+
| ------------------------------------------------ | --------------------------------------------- |
|
|
218
|
+
| Test install, easy to find and delete afterwards | `--prefix "cli-test-"` |
|
|
219
|
+
| Do not publish workflows, skip the consent step | `--draft-workflows` |
|
|
220
|
+
| Overwrite components that already exist | `--update` |
|
|
221
|
+
| Reuse a known connection | `--connection <appId>=<connectionInstanceId>` |
|
|
222
|
+
| Do not open a browser | `--no-browser` |
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
── STAGE 8: INSTALL ─────────────────────────────────────
|
|
226
|
+
|
|
227
|
+
▶ Running: ds pkg install --file <zip> --prefix "<prefix>"
|
|
228
|
+
<output — progress lines, then possibly a pause>
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
**Critical: the install is interactive.** A real terminal is needed to answer the connection and consent questions.
|
|
232
|
+
|
|
233
|
+
- **Your shell is not a terminal.** An AI agent's shell has no TTY. In it, the CLI never prompts: it prints the pause, exits 1, and leaves the install open on the server. That is correct behaviour, not a failure.
|
|
234
|
+
- **Run the first part yourself, hand the second part to the user.** Start the install with `-y` so it begins. If it pauses, print the resume command and ask the user to run it in a normal terminal:
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
The install is paused and waiting for you. In a normal terminal, run:
|
|
238
|
+
|
|
239
|
+
ds pkg install --resume
|
|
240
|
+
|
|
241
|
+
Pick the connection, finish the sign-in in the browser, and give consent when it asks.
|
|
242
|
+
Paste the output back here and I'll read the result.
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
- A `!` command inside an agent session also has no terminal. Tell the user to use a separate terminal window.
|
|
246
|
+
|
|
247
|
+
Handle each pause (see **Install Pauses** below), then read the verdict (see **Verdicts** below).
|
|
248
|
+
|
|
249
|
+
### Stage 9: Verify and Report
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
── STAGE 9: VERIFY ──────────────────────────────────────
|
|
253
|
+
|
|
254
|
+
▶ Running: ds pkg install --resume --event <eventId> (only if the install was left open)
|
|
255
|
+
|
|
256
|
+
✅ STAGE 9 COMPLETE
|
|
257
|
+
Verdict: Installed | Installed with drafts | Failed | Not finished
|
|
258
|
+
Created in <target account>:
|
|
259
|
+
<type> <name> (instance id <id>)
|
|
260
|
+
...
|
|
261
|
+
To clean up: search the Docusign web app for "<prefix>" and delete these.
|
|
262
|
+
────────────────────────────────────────────────────────
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**Always end with a cleanup list**: every component created, by name and type, with the prefix to search for. The CLI cannot delete them, so the user must.
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## WORKFLOW B: Install a Zip I Already Have
|
|
270
|
+
|
|
271
|
+
1. Run **Stage 1** (auth) and **Stage 7** (pre-flight) against the target account.
|
|
272
|
+
2. Inspect the zip (`unzip -l`, `unzip -p <zip> requirements.json`) and tell the user what it holds and what it needs.
|
|
273
|
+
3. Run **Stage 8** and **Stage 9**.
|
|
274
|
+
|
|
275
|
+
A bare file name is also looked up in the project's `package/files` folder, where `ds pkg export` writes.
|
|
276
|
+
|
|
277
|
+
A zip exported from the _same_ account installs as **copies** of what is already there, unless `--update` is given. Use `--prefix` to tell them apart.
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## WORKFLOW C: Install a Public Package
|
|
282
|
+
|
|
283
|
+
```
|
|
284
|
+
▶ Running: ds pkg list --visibility public
|
|
285
|
+
▶ Running: ds pkg install --name="<name>" --source public
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
- Public packages answer only to the public scope. The CLI tries your own packages first, then public ones; `--source public` makes it exact.
|
|
289
|
+
- Run `ds pkg install --name "<name>"` first without `-y` in a terminal to see the plan: it lists each component as `NEW` (will be created) or `EXISTS` (already in this account).
|
|
290
|
+
- Several public packages can share a name. If the CLI lists more than one id, pick with `--id`.
|
|
291
|
+
- A public package can hold an app. The app is installed but may have **no connection**; the final report warns `<app> is installed but has no active connection. Connect it in App Center`. That is a warning, not a failure.
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## WORKFLOW D: Resume an Install That Stopped
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
▶ Running: ds pkg install --resume
|
|
299
|
+
▶ Running: ds pkg install --resume --event <eventId>
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
- The install runs on the server. A closed terminal, a crash, or Ctrl+C loses nothing. `--resume` re-attaches and asks any pending question again.
|
|
303
|
+
- Details are saved under `~/.docusign/installs/<eventId>.json` (event id, account, source, options — never tokens). `--resume` with no `--event` picks the newest unfinished install **for the account the CLI is logged into**.
|
|
304
|
+
- Without a saved file, `--resume` searches the server for open install events.
|
|
305
|
+
- A saved install from another account is refused. Log into that account first.
|
|
306
|
+
- **Expired installs cannot be resumed.** Start a new one.
|
|
307
|
+
- A paused install stays open on the server. The lifetime is unknown — do not leave it for days.
|
|
308
|
+
- **To stop an install**, run `ds pkg install --cancel` (newest unfinished) or `--cancel --event <id>`. It asks first; pass `-y` without a terminal. The server cancels only an install that is waiting for the user or has not started work (`INIT`, `QUEUED`, `AWAITING_INPUT`). A running install cannot be cancelled; wait for it to pause. An install that already ended has nothing to cancel, so the CLI only forgets it. **Components created before the cancel stay**, and the CLI lists them.
|
|
309
|
+
- Resuming a **failed** install shows the old failure again and asks "Try the failed components again?". It does not change anything until the user says yes.
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## WORKFLOW E: An Install or Export Failed
|
|
314
|
+
|
|
315
|
+
Work in this order. Stop at the first thing that explains it.
|
|
316
|
+
|
|
317
|
+
**1. Read the verdict and the per-component lines.** They name the failed component and the server's reason. The server marks an install `COMPLETED` even when a component failed, so the CLI checks each component itself.
|
|
318
|
+
|
|
319
|
+
**2. Match the message:**
|
|
320
|
+
|
|
321
|
+
| Message | Likely cause | What to do |
|
|
322
|
+
| ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
323
|
+
| `All workflow deployments failed for workflow(s): <id>` | A general message. Two causes were seen: the target account's **workflow limit** (see below), or a **403** because the target account has no Maestro access (workflows are not available there; check in the web app before installing) | Check the dev/prod logs (below). Free a slot, then `--resume` and retry |
|
|
324
|
+
| `Publishing ended with status FAILURE` on export | A component could not be exported. The CLI is not given the reason | Read the worker logs. Known cause: a workflow step with no saved settings |
|
|
325
|
+
| `Config instance not found for step ID: <id>` (in logs) | A workflow step has no saved configuration, so ALM cannot export it | Open the workflow, find that step, save it again, retry the export |
|
|
326
|
+
| `403` when adding a workflow or web form | Component is in another account, or the token lacks scopes | `ds auth test`; check the four ACT scopes; log in again after an admin adds them |
|
|
327
|
+
| `400` when adding an eSign template | Template is in another account | Log into the account that owns it |
|
|
328
|
+
| `Your session has expired` | Token expired | `ds auth login`. Use `DOCUSIGN_SKIP_CHECKS=cli.version`, not `DOCUSIGN_NO_GLOBAL_CHECKS`, in scripts so token refresh stays on |
|
|
329
|
+
| `Zip file not found` / `is not a zip file` | Wrong path, or a different file | The CLI lists every place it looked |
|
|
330
|
+
| Install exits 1 with "Install not finished" | It is waiting for a connection or consent and there is no terminal | Run `ds pkg install --resume` in a normal terminal |
|
|
331
|
+
| The install keeps `AWAITING_INPUT` after you answered | The server did not accept the answer | The CLI retries a few times and shows the server's message |
|
|
332
|
+
|
|
333
|
+
**3. The workflow limit.** An account can deploy a fixed number of published workflows. When it is full, the final publish step fails with the general `All workflow deployments failed` message and the real reason (`Account(<id>) has reached its maximum workflow deployment limit (3)`) is only in the service logs. The workflow itself is created and stays a **draft**. Ways out:
|
|
334
|
+
|
|
335
|
+
- Free a slot (unpublish or delete a workflow in the target account), then `ds pkg install --resume --event <id>` and answer yes to the retry.
|
|
336
|
+
- Install into an account that has room.
|
|
337
|
+
- Install with `--draft-workflows` so workflows are never published. **This must be chosen on a new install or at the consent step.** A failed event accepts only a retry; it cannot be turned into "installed with drafts".
|
|
338
|
+
|
|
339
|
+
**4. Reading the logs.** The CLI keeps a log of every run in `~/.docusign/logs/`, independent of `--debug`. It holds every request and its status, and is the first place to look. Link codes in it should be redacted before pasting anywhere. For server-side reasons, search the service logs (Kusto) by the event id, the package id, the account id, and the workflow id; the ALM packaging workers log the cause of a failed publish or export.
|
|
340
|
+
|
|
341
|
+
**5. Retry carefully.** A retry re-runs the install for the failed components. The server may skip components the first try created, or may create them again. After a retry, look for duplicates by searching the account for the prefix.
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
## Install Pauses
|
|
346
|
+
|
|
347
|
+
An install can stop twice to ask for something. Both are normal.
|
|
348
|
+
|
|
349
|
+
### Pause 1: App connections (`REQUIREMENT_MAPPING`)
|
|
350
|
+
|
|
351
|
+
Happens when the package's `requirements.json` names an app connection the target account does not have. **Nothing is created until it is answered** — the whole install waits.
|
|
352
|
+
|
|
353
|
+
What the CLI does, in a terminal:
|
|
354
|
+
|
|
355
|
+
```
|
|
356
|
+
⚠ The install is paused: it needs a connection for each app below
|
|
357
|
+
Google Drive (oauth2Token connection)
|
|
358
|
+
Needed by: Google Drive workflow
|
|
359
|
+
You have no active Google Drive connection yet
|
|
360
|
+
? Connection to use for Google Drive (oauth2Token connection):
|
|
361
|
+
❯ Connect a new Google Drive account in the browser
|
|
362
|
+
Skip (the install stays paused)
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
1. It lists the account's **active** connections for the app. Only active ones can be used.
|
|
366
|
+
2. If the user chooses to connect a new one, the CLI asks the platform for the app's sign-in page (the same page the App Center's Connect button uses), opens it in the browser, and prints it.
|
|
367
|
+
3. It then polls every 3 seconds, up to 10 minutes, for a **new** active connection.
|
|
368
|
+
4. When one appears it asks "Use this connection?", checks the choice with the server, and resumes once with the answer.
|
|
369
|
+
|
|
370
|
+
Things to know:
|
|
371
|
+
|
|
372
|
+
- The sign-in page belongs to the app (for example Google). The CLI never sees a password. The user signs in as whoever they choose; the connection belongs to that user.
|
|
373
|
+
- The install event itself carries **no link**. The CLI gets the link from a separate call. If that call fails, the CLI says why and tells the user to connect in App Center. If the user is in that fallback, ask them to connect there and the CLI will detect the new connection by polling.
|
|
374
|
+
- The browser tab stays open after sign-in; the user closes it. The CLI does not listen for the redirect, it only polls.
|
|
375
|
+
- Pressing Ctrl+C stops the CLI. The install stays paused on the server; `--resume` continues.
|
|
376
|
+
- `--connection <appId>=<connectionInstanceId>` answers this up front and skips the question. The connection must already be active.
|
|
377
|
+
- Choosing "Skip" leaves the install paused. There is no way to install the rest without the connection.
|
|
378
|
+
|
|
379
|
+
### Pause 2: Workflow consent (`BULK_PUBLISH_CONSENT`)
|
|
380
|
+
|
|
381
|
+
Happens after the components are created, before workflows are published.
|
|
382
|
+
|
|
383
|
+
```
|
|
384
|
+
⚠ The install is paused: the workflows below need their owner's consent before they can be published
|
|
385
|
+
Workflows: <workflow id or name>
|
|
386
|
+
pendingUserInput.inputDetails.consentUrl: https://…/workflows/consent?…
|
|
387
|
+
? Consent for the workflows:
|
|
388
|
+
❯ I have given consent, continue
|
|
389
|
+
Create the workflows as drafts instead
|
|
390
|
+
Stop for now (the install can be resumed)
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
- The CLI opens the consent page. The user consents in the browser, then picks "I have given consent, continue".
|
|
394
|
+
- If the server still shows the pause, it was not detected; the CLI asks again, up to three times.
|
|
395
|
+
- "Create the workflows as drafts instead" (or `--draft-workflows` up front) leaves them unpublished. The verdict becomes **Installed with drafts**.
|
|
396
|
+
- Not every install reaches this pause. A simple workflow with no app installed and published straight through, with no consent step, so do not promise it.
|
|
397
|
+
- The consent link is a credential. Do not copy it into a PR, chat or note.
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
## Verdicts
|
|
402
|
+
|
|
403
|
+
| Verdict | Meaning | Exit |
|
|
404
|
+
| --------------------- | ------------------------------------------------------------------------ | ---- |
|
|
405
|
+
| Installed | Every component installed | 0 |
|
|
406
|
+
| Installed with drafts | Installed; some workflows left as unpublished drafts | 0 |
|
|
407
|
+
| Failed | One or more components failed | 1 |
|
|
408
|
+
| Not finished | Waiting for the user (connection or consent), or the CLI stopped waiting | 1 |
|
|
409
|
+
| Cancelled / Expired | The server ended it | 1 |
|
|
410
|
+
|
|
411
|
+
Read the **components**, not just the headline:
|
|
412
|
+
|
|
413
|
+
- A workflow may print "created as a draft" and then "installed". The server creates workflows as drafts and publishes them a moment later. Only a draft that is still a draft at the end counts as "left as drafts".
|
|
414
|
+
- An installed app with no active connection gives a warning, not a failure.
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
## Limitations & Workarounds
|
|
419
|
+
|
|
420
|
+
These are known behaviours, not blockers. Autopilot handles them.
|
|
421
|
+
|
|
422
|
+
| Situation | What happens | Autopilot handles it by |
|
|
423
|
+
| ------------------------------------------------------------ | ------------------------------------------------------ | ----------------------------------------------------------------------------- |
|
|
424
|
+
| Private package installed from another account | There is no sharing route in the public API | Using export → zip → install --file |
|
|
425
|
+
| `pkg add` accepted by the server but a component is left out | The CLI exits 1 with "did not add N of M components" | Checking the account and scopes, then reading back with `ds pkg view-details` |
|
|
426
|
+
| Export or publish fails with a bare `FAILURE` | The status carries no reason | Reading service logs by event id; asking the user to re-save the broken step |
|
|
427
|
+
| Install fails at the final publish with a general message | Real reason (e.g. workflow limit) is two services down | Reading the logs; freeing a slot; or `--draft-workflows` |
|
|
428
|
+
| Failed event cannot become "installed with drafts" | The server accepts only a retry on a failed event | Starting a new install with `--draft-workflows` and a new `--prefix` |
|
|
429
|
+
| Install needs a terminal for its questions | An agent's shell has none | Starting with `-y`, then handing `--resume` to the user |
|
|
430
|
+
| Installed components cannot be deleted from the CLI | No delete route | `--prefix` on every test install; a final cleanup list |
|
|
431
|
+
| A closed browser tab after sign-in | The CLI polls and does not listen for the redirect | Telling the user to close the tab |
|
|
432
|
+
| A `hash=` / `mtsec=` / `code=` value in a URL | These are credentials | Using only the id; never repeating the rest |
|
|
433
|
+
| A paused install stays open on the server | Lifetime unknown | Telling the user to resume, or to stop it with `ds pkg install --cancel` |
|
|
434
|
+
| `--resume` of a failed event | Shows the old failure and asks about a retry | Explaining it is history until the user says yes |
|
|
435
|
+
|
|
436
|
+
**Not yet observed** — say so honestly when asked, do not guess:
|
|
437
|
+
|
|
438
|
+
- How long a paused install lives on the server.
|
|
439
|
+
- Whether a retry re-creates components that the first try already made.
|
|
440
|
+
- Which workflows trigger the consent pause (one simple workflow did not).
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
## Commands Reference
|
|
445
|
+
|
|
446
|
+
### Authentication
|
|
447
|
+
|
|
448
|
+
```bash
|
|
449
|
+
ds auth login -e <demo|integration|stage|production> # Log in, then choose the account
|
|
450
|
+
ds auth test # Show the account, environment and token expiry
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### Build
|
|
454
|
+
|
|
455
|
+
```bash
|
|
456
|
+
ds pkg create --name=my-package
|
|
457
|
+
ds pkg add --id=<packageId> --esign-templates "555:NDA" "775:MSA"
|
|
458
|
+
ds pkg add --id=<packageId> --workflow "111:Invoice approval" --webform "9f2:Intake form"
|
|
459
|
+
ds pkg add --id=<packageId> --templates "333:Contract template"
|
|
460
|
+
ds pkg remove --id=<packageId> --esign-templates "775:MSA"
|
|
461
|
+
ds pkg view-details --id=<packageId> # Dependency tree
|
|
462
|
+
ds pkg status --id=<packageId> # Draft | Processing | Awaiting input | Installed | Published
|
|
463
|
+
ds pkg update --id=<packageId> --rename=new-name --description="…"
|
|
464
|
+
ds pkg list [--visibility private|public|any] [--status Draft|Published|Archived|Review]
|
|
465
|
+
ds pkg delete --id=<packageId> [-y] # Deletes the package, not what an install created
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
### Move
|
|
469
|
+
|
|
470
|
+
```bash
|
|
471
|
+
ds pkg export --id=<packageId> [--output ./backups/my.zip] # Publishes, then writes the zip
|
|
472
|
+
ds pkg install --file <zip> [--prefix "x-"] [--update] [--draft-workflows] [--connection a=c] [--no-browser] [-y]
|
|
473
|
+
ds pkg install --id=<packageId> [--source private|public|any]
|
|
474
|
+
ds pkg install --name="<name>" --source public
|
|
475
|
+
ds pkg install --resume [--event <eventId>]
|
|
476
|
+
ds pkg install --cancel [--event <eventId>] [-y]
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
### Inspect a zip
|
|
480
|
+
|
|
481
|
+
```bash
|
|
482
|
+
unzip -l <zip>
|
|
483
|
+
unzip -p <zip> requirements.json
|
|
484
|
+
unzip -p <zip> metadata.json
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
### Component flags
|
|
488
|
+
|
|
489
|
+
| Flag | Component type |
|
|
490
|
+
| ------------------- | ------------------- |
|
|
491
|
+
| `--esign-templates` | eSignature template |
|
|
492
|
+
| `--templates` | Document template |
|
|
493
|
+
| `--workflow` | Maestro workflow |
|
|
494
|
+
| `--webform` | Web form |
|
|
495
|
+
|
|
496
|
+
Each value is `<id>:<name>`. Quote names that contain spaces. List several after one flag or repeat the flag.
|
|
497
|
+
|
|
498
|
+
### Where things live
|
|
499
|
+
|
|
500
|
+
```
|
|
501
|
+
<workspace>/<project>/package/files/ # Exported zips are written here
|
|
502
|
+
~/.docusign/installs/<eventId>.json # Saved details for --resume (no tokens)
|
|
503
|
+
~/.docusign/logs/ # A log for every run
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
---
|
|
507
|
+
|
|
508
|
+
## Safety Rules
|
|
509
|
+
|
|
510
|
+
1. **Say which account you are on** before every write, and refuse to continue if it is not the one the user named.
|
|
511
|
+
2. **Ask before anything that cannot be undone**: export (freezes the package), install (creates components that only the web app can delete), retry of a failed install.
|
|
512
|
+
3. **Never print or store** tokens, `hash=`/`mtsec=`/`code=`/`state=` values, or consent links. Compare scopes by name only.
|
|
513
|
+
4. **Always use `--prefix`** for test installs, and finish with a list of what was created.
|
|
514
|
+
5. **Report outcomes faithfully.** If a component failed, say so with the server's words. If something was not tested, say that. Do not call an install successful because it exited 0.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Docusign
|
|
2
|
+
description: Docusign IAM Toolkit CLI workflow guides — Agreement Manager document extraction and package export/install
|
|
3
3
|
globs: ["**/*.json", "**/*.csv", "**/agreement-manager/**"]
|
|
4
4
|
alwaysApply: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
@file:.claude/skills/ds-agm-autopilot/SKILL.md
|
|
8
|
+
@file:.claude/skills/ds-package-autopilot/SKILL.md
|
|
8
9
|
@file:.claude/skills/ds-agreement-manager-workflow/SKILL.md
|
|
9
10
|
@file:.claude/skills/ds-testing/SKILL.md
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Read the following skill files for the full workflow guide and testing instructions:
|
|
4
4
|
|
|
5
5
|
- `.claude/skills/ds-agm-autopilot/SKILL.md`
|
|
6
|
+
- `.claude/skills/ds-package-autopilot/SKILL.md`
|
|
6
7
|
- `.claude/skills/ds-agreement-manager-workflow/SKILL.md`
|
|
7
8
|
- `.claude/skills/ds-testing/SKILL.md`
|
|
8
9
|
|
|
9
|
-
These files contain step-by-step guidance for the `ds agm` CLI commands, manifest authoring rules, AI-assisted testing workflows,
|
|
10
|
+
These files contain step-by-step guidance for the `ds agm` CLI commands, manifest authoring rules, AI-assisted testing workflows, full autopilot operation of the Agreement Manager lifecycle, and the package lifecycle (`ds pkg`: build, export, install in another account, resume, diagnose).
|
|
@@ -15,6 +15,8 @@ ds agm get catalog # Fetch standard types/fi
|
|
|
15
15
|
ds agm validate # Validate manifest
|
|
16
16
|
ds agm upload [-y|--dry-run] # Deploy manifest
|
|
17
17
|
ds agm ingest --directory <path> [-y|--dry-run] # Ingest documents
|
|
18
|
+
ds agm ingest --directory <path> --generate-metadata-template # Create metadata.csv
|
|
19
|
+
ds agm ingest --directory <path> --with-metadata -y # Validate and ingest metadata
|
|
18
20
|
ds agm test generate-test-template [-y] [--prefill-extractions] # Create test CSV
|
|
19
21
|
ds agm test run [-y] [--partial-match] # Run extraction tests
|
|
20
22
|
```
|
|
@@ -33,6 +35,7 @@ ds agm test run [-y] [--partial-match] # Run extraction tests
|
|
|
33
35
|
│ ├── tracking.json # Ingestion tracker
|
|
34
36
|
│ ├── standard-catalog.json # After 'get catalog'
|
|
35
37
|
│ └── custom-catalog.json
|
|
38
|
+
├── metadata/metadata.csv # Optional ingest metadata
|
|
36
39
|
├── tests/testing.csv # Test expectations
|
|
37
40
|
└── output/ # Test results
|
|
38
41
|
```
|
|
@@ -41,6 +44,10 @@ ds agm test run [-y] [--partial-match] # Run extraction tests
|
|
|
41
44
|
|
|
42
45
|
To drive the full Agreement Manager lifecycle interactively, invoke the `ds-agm-autopilot` skill. It guides you through auth, manifest creation, upload, ingest, metadata ingestion, testing, and config migration with visual stage feedback. Say "autopilot" for autonomous operation or answer prompts step-by-step.
|
|
43
46
|
|
|
47
|
+
## Package Autopilot Mode
|
|
48
|
+
|
|
49
|
+
To build a package, export it, and install it into another account, invoke the `ds-package-autopilot` skill. It covers `ds pkg` end to end: creating a package, adding eSign templates, web forms, Maestro workflows and document templates, exporting a portable zip, installing it (app connections, workflow consent, drafts), resuming an install, and diagnosing failures. Say "autopilot" for autonomous operation.
|
|
50
|
+
|
|
44
51
|
## Agreement Manager Workflow
|
|
45
52
|
|
|
46
53
|
1. `ds auth login -e demo`
|
|
@@ -53,6 +60,17 @@ To drive the full Agreement Manager lifecycle interactively, invoke the `ds-agm-
|
|
|
53
60
|
8. Fill expected values in `agreement-manager/tests/testing.csv`
|
|
54
61
|
9. `ds agm test run -y`
|
|
55
62
|
|
|
63
|
+
## Linked Data Metadata
|
|
64
|
+
|
|
65
|
+
The generated `agreement-manager/metadata/metadata.csv` includes the exact reserved column `linked_data`. Put the complete API array in one CSV cell and leave it blank when no linked records apply:
|
|
66
|
+
|
|
67
|
+
```csv
|
|
68
|
+
Filename,linked_data
|
|
69
|
+
agreement.pdf,"[{""application_name"":""Salesforce"",""object_name"":""Opportunity"",""record_id"":""006xx000001abc""}]"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Do not use indexed columns such as `linked_data[0]` or `linked_data[0].application_name`. Multiple linked records belong in the same array. Use the exact snake_case keys `application_name`, `object_name`, and `record_id`.
|
|
73
|
+
|
|
56
74
|
## Manifest Rules
|
|
57
75
|
|
|
58
76
|
**Custom field `key`** must start with `C_` (e.g., `C_TerminationDate`). Use `displayName` for human-readable name. Add `aiDefinition` when `customExtractionEnabled: true`.
|