@epilot/cli 0.1.194 → 0.1.195
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 +89 -1
- package/dist/{access-token-3XCBQDFI.js → access-token-Q2UGZIMP.js} +4 -4
- package/dist/{add-component-GTIUBZP6.js → add-component-USRY2DQG.js} +4 -4
- package/dist/{add-function-5RIKXAEC.js → add-function-RZTEKVSB.js} +4 -4
- package/dist/{address-ACXTZTLB.js → address-AX4UT6BO.js} +4 -4
- package/dist/{address-suggestions-MIUHAFVV.js → address-suggestions-GMVIIZY6.js} +4 -4
- package/dist/agent-auth-A2D2R6FP.js +42 -0
- package/dist/{ai-agents-OWQRQK5A.js → ai-agents-J2ZTLDLV.js} +4 -4
- package/dist/{api-PQZEGSUV.js → api-3L3XZYSQ.js} +4 -4
- package/dist/app-RHHZR5YW.js +26 -0
- package/dist/{audit-logs-3DVFWVWL.js → audit-logs-VLVHBCF5.js} +4 -4
- package/dist/auth-N3CDDMDS.js +235 -0
- package/dist/auth-login-ACQGAE72.js +34 -0
- package/dist/{auth-token-APXLIQAO.js → auth-token-JOSBGVGA.js} +2 -2
- package/dist/{automation-NHRRP6J4.js → automation-NYSYIXDW.js} +4 -4
- package/dist/{billing-PCSW2TQP.js → billing-6SWQNULS.js} +4 -4
- package/dist/bin/epilot.js +84 -60
- package/dist/{blueprint-manifest-BPWLPHIU.js → blueprint-manifest-3RS3SQE6.js} +4 -4
- package/dist/{calendar-Y6AGKVWR.js → calendar-WQIQK46M.js} +4 -4
- package/dist/{chat-567O35XV.js → chat-EMJD5AN5.js} +4 -4
- package/dist/{chunk-WWO5RPHF.js → chunk-36I64456.js} +7 -7
- package/dist/{chunk-5KHD2F3J.js → chunk-5DFIPWJS.js} +3 -3
- package/dist/chunk-5Q3PQUI2.js +602 -0
- package/dist/{chunk-KTCBDUL2.js → chunk-BYNI3AGG.js} +1 -1
- package/dist/{chunk-M3M3C5WH.js → chunk-G564QXNL.js} +17 -3
- package/dist/{chunk-YHQA2AVG.js → chunk-QPUCHKXS.js} +1 -0
- package/dist/{auth-login-3AY5U4JU.js → chunk-U4YGZRJY.js} +378 -11
- package/dist/{config-DGZIMLZK.js → config-PJWYWLQH.js} +1 -1
- package/dist/{configuration-hub-YPOS6ELC.js → configuration-hub-BVTAC26A.js} +4 -4
- package/dist/{consent-SFI4EUGQ.js → consent-UZSED4QQ.js} +4 -4
- package/dist/{customer-portal-UUKBB67Z.js → customer-portal-CZSHTI3Q.js} +4 -4
- package/dist/{dashboard-GERIZIZV.js → dashboard-NQHQ65ME.js} +4 -4
- package/dist/{data-governance-XVJWDVER.js → data-governance-WOUP2NNR.js} +4 -4
- package/dist/{deduplication-JJ46Y2CW.js → deduplication-EUAFCYY3.js} +4 -4
- package/dist/{deploy-GZMQOG6O.js → deploy-LRSKADBB.js} +4 -4
- package/dist/{design-LYYI4DLQ.js → design-XR6C6OTA.js} +4 -4
- package/dist/{dev-HDXS3UPB.js → dev-FGVM3R2Z.js} +4 -4
- package/dist/{document-5MD75ESX.js → document-EWDEIA2Z.js} +4 -4
- package/dist/{email-settings-UKM5LYDQ.js → email-settings-IOHMQBXH.js} +4 -4
- package/dist/{email-template-KT7YPDBF.js → email-template-K6X722R7.js} +4 -4
- package/dist/{entity-AG73SZKS.js → entity-Z6JH5EDY.js} +4 -4
- package/dist/{entity-mapping-6MIHNIDB.js → entity-mapping-PZY5PCRG.js} +4 -4
- package/dist/{environments-W7LRHBDB.js → environments-FL7IAAHN.js} +4 -4
- package/dist/{event-catalog-NCAHETDE.js → event-catalog-GUAWJ3RG.js} +4 -4
- package/dist/{export-2B5BAXHF.js → export-IXXFKWBZ.js} +4 -4
- package/dist/{external-values-NHZ2EZMQ.js → external-values-A7C75KBV.js} +4 -4
- package/dist/{file-Y6B2UFNC.js → file-IRUY5MWL.js} +4 -4
- package/dist/{iban-33N4BJUC.js → iban-3MLGKYKV.js} +4 -4
- package/dist/{identity-GQ5VOASS.js → identity-LI26M7EG.js} +4 -4
- package/dist/{init-5C4IJDPX.js → init-HRF5Q2UW.js} +4 -4
- package/dist/{integration-toolkit-KTUXC24K.js → integration-toolkit-GSDL2CE2.js} +4 -4
- package/dist/{journey-3X6BQOOO.js → journey-ASQNGOEH.js} +4 -4
- package/dist/{kanban-F7PRPBGV.js → kanban-7XW56ILD.js} +4 -4
- package/dist/{message-K4ZMKQJE.js → message-XYB34GBX.js} +4 -4
- package/dist/{metering-ZK6VMFZ7.js → metering-GJSVL6OZ.js} +4 -4
- package/dist/{notes-6Z42UHWN.js → notes-FZPFGPFO.js} +4 -4
- package/dist/{notification-NPY7FMPG.js → notification-X6IHCJDI.js} +4 -4
- package/dist/org-UWRWFPRZ.js +427 -0
- package/dist/{organization-NK3CCP7F.js → organization-374MUWDY.js} +4 -4
- package/dist/{partner-directory-WSFRXNTY.js → partner-directory-BC7XF3VN.js} +4 -4
- package/dist/{permissions-Q36SZHXQ.js → permissions-UAXXL2OG.js} +4 -4
- package/dist/{pricing-JSFN62BD.js → pricing-Q43OPFUT.js} +4 -4
- package/dist/{pricing-tier-XURRWW25.js → pricing-tier-AHRG3AVC.js} +4 -4
- package/dist/{profile-OZJL5ZPT.js → profile-G2FH3DXR.js} +1 -1
- package/dist/{purpose-GKPVUTBK.js → purpose-FXBJ24XT.js} +4 -4
- package/dist/{query-JZUAVWPY.js → query-Y5XZZBFS.js} +4 -4
- package/dist/{remove-component-KLWF3QZO.js → remove-component-WQLTK36T.js} +4 -4
- package/dist/{review-L4QLVEXC.js → review-XWKQ2QBF.js} +4 -4
- package/dist/{sandbox-EKAOWJSR.js → sandbox-7DPZVDMD.js} +4 -4
- package/dist/{sharing-TKHVDJ5B.js → sharing-4IMN5325.js} +4 -4
- package/dist/{snapshot-A2FU3NYU.js → snapshot-OE7NRZGS.js} +4 -4
- package/dist/{submission-NTQTZ2MG.js → submission-R2GYF5UV.js} +4 -4
- package/dist/{targeting-7HCCTEIJ.js → targeting-NLHZEKAE.js} +4 -4
- package/dist/{template-variables-ABHPJ6QR.js → template-variables-BEBZD6IW.js} +4 -4
- package/dist/{upgrade-YRZHOL6I.js → upgrade-ON2KV5LK.js} +1 -1
- package/dist/{user-WEW5SBST.js → user-C2MPCWFC.js} +4 -4
- package/dist/{validate-SX4DIEWH.js → validate-L3EVLLDB.js} +4 -4
- package/dist/{validation-rules-PNUE7RIC.js → validation-rules-MCQP5FYV.js} +4 -4
- package/dist/{versions-D5NPDKRX.js → versions-U4M5UMIX.js} +4 -4
- package/dist/{webhooks-ECQT77EA.js → webhooks-CXLFLDRO.js} +4 -4
- package/dist/{workflow-JOZVUSX2.js → workflow-WGG5Y45V.js} +4 -4
- package/dist/{workflow-definition-GPBXEKKH.js → workflow-definition-P5RIZCJK.js} +4 -4
- package/package.json +3 -2
- package/dist/app-EJONBOTI.js +0 -26
- package/dist/auth-WMXFMPWE.js +0 -119
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ npm install -g @epilot/cli
|
|
|
29
29
|
|
|
30
30
|
<!-- usage-help -->
|
|
31
31
|
```
|
|
32
|
-
epilot v0.1.
|
|
32
|
+
epilot v0.1.195 — CLI for epilot APIs
|
|
33
33
|
|
|
34
34
|
USAGE
|
|
35
35
|
epilot <api> <operationId> [params...] [flags]
|
|
@@ -60,6 +60,13 @@ COMMANDS
|
|
|
60
60
|
profile Manage named profiles
|
|
61
61
|
completion Generate shell completion scripts
|
|
62
62
|
|
|
63
|
+
AGENT MODE (optional)
|
|
64
|
+
auth login --agent Register this CLI as an Agent Auth agent (org switching, silent token refresh, scoped access profiles)
|
|
65
|
+
org list List your organizations and this CLI's access
|
|
66
|
+
org use <id> Switch the active organization
|
|
67
|
+
org request <id> Request access (--access <profile> --reason "…")
|
|
68
|
+
org current Show the active organization
|
|
69
|
+
|
|
63
70
|
APIs
|
|
64
71
|
access-token Access Token API
|
|
65
72
|
address Address API
|
|
@@ -123,6 +130,8 @@ EXAMPLES
|
|
|
123
130
|
$ epilot entity searchEntities -d '{"q":"*"}'
|
|
124
131
|
$ epilot entity searchEntities --jsonata 'results[0]._title'
|
|
125
132
|
$ echo '{"q":"*"}' | epilot entity searchEntities
|
|
133
|
+
$ epilot auth login --agent --org 739224 # agent mode (optional)
|
|
134
|
+
$ epilot org request 739224 --access config:write --reason "Fix the PV journey mapping"
|
|
126
135
|
|
|
127
136
|
Run epilot <api> to list available operations.
|
|
128
137
|
Run epilot <api> <operationId> --help for operation details.
|
|
@@ -158,6 +167,82 @@ Token resolution order:
|
|
|
158
167
|
4. Stored credentials (`~/.config/epilot/credentials.json`)
|
|
159
168
|
5. Interactive prompt (if TTY)
|
|
160
169
|
|
|
170
|
+
### Agent mode (optional)
|
|
171
|
+
|
|
172
|
+
`epilot auth login --agent` registers the CLI through the
|
|
173
|
+
[Agent Auth Protocol](https://agentauthprotocol.com/specification/v1.0-draft) (via
|
|
174
|
+
[`@epilot/agent-auth`](../agent-auth)): your machine is a **host**, the CLI is an **agent** you approve once in the
|
|
175
|
+
browser, and short-lived epilot tokens are issued per organization and refreshed silently. In return you get
|
|
176
|
+
organization switching, scoped **access profiles** and sessions that outlive a single token. Plain logins are not
|
|
177
|
+
affected: a profile without an agent behaves exactly as before.
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# Register the CLI as an agent and approve it in the browser (read access, your login organization)
|
|
181
|
+
epilot auth login --agent
|
|
182
|
+
|
|
183
|
+
# A specific organization, an access profile and the purpose shown to the approving user
|
|
184
|
+
epilot auth login --agent --org 739224 --access config:write --reason "Fix the PV registration journey mapping"
|
|
185
|
+
|
|
186
|
+
# Non-interactive (CI / agents): requires --org; prints the approval URL and polls until approved
|
|
187
|
+
epilot auth login --agent --org 739224 --no-interactive --json
|
|
188
|
+
|
|
189
|
+
# Status shows the agent, its grants (profile, expiry, reason); logout revokes the agent
|
|
190
|
+
epilot auth status
|
|
191
|
+
epilot auth logout
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Access profiles scope what the issued tokens may do. `read` is the default and lives as long as the agent; every
|
|
195
|
+
other profile is an escalation that requires a `--reason` (10–200 characters, prompted for in a TTY) and expires.
|
|
196
|
+
The flag is `--access` because `--profile` already selects a [named CLI profile](#profiles):
|
|
197
|
+
|
|
198
|
+
| `--access` | Meaning | Read-only | Expires after |
|
|
199
|
+
| --- | --- | --- | --- |
|
|
200
|
+
| `read` | Read everything you can see | yes | never (agent lifetime) |
|
|
201
|
+
| `config:read` | Read configuration (journeys, automations, workflows, schemas, portals, designs) | yes | 7 days |
|
|
202
|
+
| `config:write` | Change configuration | no | 24 hours |
|
|
203
|
+
| `data:read` | Read business data (contacts, opportunities, orders, files, messages) | yes | 7 days |
|
|
204
|
+
| `data:write` | Change business data | no | 24 hours |
|
|
205
|
+
| `full` | Everything your account can do | no | 24 hours |
|
|
206
|
+
|
|
207
|
+
Anonymization is a read-only property: `--anonymize` (and `org request` without `--full-pii`) only applies to read
|
|
208
|
+
profiles. Combining `--anonymize` with a write profile is an error ("anonymize is only available with read
|
|
209
|
+
profiles"), because an agent must never write masked data back. `--readonly` with a write profile downgrades it to
|
|
210
|
+
its read sibling (`config:write` → `config:read`, `full` → `read`). On the approval page the user can only narrow what
|
|
211
|
+
the CLI asked for; the CLI then issues tokens for the profile that was actually granted.
|
|
212
|
+
|
|
213
|
+
#### Organizations
|
|
214
|
+
|
|
215
|
+
One approval grants access to one organization. Switching or adding organizations goes through `epilot org`
|
|
216
|
+
(agent mode only — without an agent the commands exit 1 with "This profile has no agent identity. Run
|
|
217
|
+
`epilot auth login --agent` first.", or `{"error":"agent_required"}` with `--json`):
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
epilot org list # organizations with access (profile, anonymized, "expires in 23h", pending)
|
|
221
|
+
epilot org current # the active organization and its profile
|
|
222
|
+
epilot org use 911210 # switch: issues a token under the most permissive grant (asks for access otherwise)
|
|
223
|
+
epilot org use 911210 --access data:read # ...or under a specific granted profile
|
|
224
|
+
epilot org request 911210 # ask for read, anonymized access (approved in the browser)
|
|
225
|
+
epilot org request 911210 --full-pii # read access with unmasked personal data
|
|
226
|
+
epilot org request 911210 --access data:write --reason "Import meter readings from the portal export"
|
|
227
|
+
epilot org request 911210 --access full --reason "…" --no-interactive --json # prints the approval, exits 0 (pending)
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
`--write` is a deprecated alias for `--access full`. Write profiles always get full personal data (`--full-pii` is
|
|
231
|
+
implied). After an approval that happened outside the CLI (e.g. from a `--no-interactive` request),
|
|
232
|
+
`epilot org use <id>` completes the switch; `auth status` lists every grant with its profile, expiry and reason.
|
|
233
|
+
|
|
234
|
+
#### Silent refresh
|
|
235
|
+
|
|
236
|
+
Issued tokens are short-lived. Whenever a command runs and the stored token of an agent-mode profile is missing or
|
|
237
|
+
expires within two minutes, the CLI issues a fresh one through the agent (same organization and profile) and stores
|
|
238
|
+
it — you stay logged in for as long as the agent and its grant are active. If the agent was revoked or expired, run
|
|
239
|
+
`epilot auth login --agent` again. A plain `epilot auth login` (or `--token`) on the same profile revokes that
|
|
240
|
+
profile's agent, so plain tokens are never replaced.
|
|
241
|
+
|
|
242
|
+
Local state lives in `~/.config/epilot/agent-auth/` (`host.json` for the machine key, `agents/<profile>.json` for
|
|
243
|
+
the per-profile agent; both mode 0600). `EPILOT_AGENT_AUTH_ISSUER` overrides the Agent Auth server URL (defaults per
|
|
244
|
+
stage: `--use-dev`, `--use-staging`).
|
|
245
|
+
|
|
161
246
|
## Profiles
|
|
162
247
|
|
|
163
248
|
Manage multiple environments, similar to AWS CLI profiles:
|
|
@@ -383,6 +468,9 @@ Full documentation with sample calls and responses for all APIs:
|
|
|
383
468
|
# Install dependencies
|
|
384
469
|
pnpm install
|
|
385
470
|
|
|
471
|
+
# Build the workspace dependency once (bundled into the CLI by tsup; also needed by tests and `pnpm dev`)
|
|
472
|
+
pnpm --filter @epilot/agent-auth build
|
|
473
|
+
|
|
386
474
|
# Generate API commands + definitions + docs from client specs
|
|
387
475
|
pnpm generate
|
|
388
476
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
callApi
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-36I64456.js";
|
|
5
|
+
import "./chunk-BYNI3AGG.js";
|
|
5
6
|
import "./chunk-IOLKUHUB.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-YHQA2AVG.js";
|
|
7
|
+
import "./chunk-G564QXNL.js";
|
|
8
|
+
import "./chunk-QPUCHKXS.js";
|
|
9
9
|
import "./chunk-7ZQ666ZQ.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/apis/access-token.ts
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
log,
|
|
4
4
|
readManifest,
|
|
5
5
|
writeManifest
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-5DFIPWJS.js";
|
|
7
|
+
import "./chunk-BYNI3AGG.js";
|
|
8
|
+
import "./chunk-G564QXNL.js";
|
|
9
|
+
import "./chunk-QPUCHKXS.js";
|
|
10
10
|
import "./chunk-7ZQ666ZQ.js";
|
|
11
11
|
|
|
12
12
|
// src/commands/app/add-component.ts
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
readManifest,
|
|
5
5
|
validateScheduleExpression,
|
|
6
6
|
writeManifest
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-5DFIPWJS.js";
|
|
8
|
+
import "./chunk-BYNI3AGG.js";
|
|
9
|
+
import "./chunk-G564QXNL.js";
|
|
10
|
+
import "./chunk-QPUCHKXS.js";
|
|
11
11
|
import "./chunk-7ZQ666ZQ.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/app/add-function.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
callApi
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-36I64456.js";
|
|
5
|
+
import "./chunk-BYNI3AGG.js";
|
|
5
6
|
import "./chunk-IOLKUHUB.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-YHQA2AVG.js";
|
|
7
|
+
import "./chunk-G564QXNL.js";
|
|
8
|
+
import "./chunk-QPUCHKXS.js";
|
|
9
9
|
import "./chunk-7ZQ666ZQ.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/apis/address.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
callApi
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-36I64456.js";
|
|
5
|
+
import "./chunk-BYNI3AGG.js";
|
|
5
6
|
import "./chunk-IOLKUHUB.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-YHQA2AVG.js";
|
|
7
|
+
import "./chunk-G564QXNL.js";
|
|
8
|
+
import "./chunk-QPUCHKXS.js";
|
|
9
9
|
import "./chunk-7ZQ666ZQ.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/apis/address-suggestions.ts
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
REFRESH_WINDOW_MS,
|
|
4
|
+
agentPath,
|
|
5
|
+
agentProfileKey,
|
|
6
|
+
deleteAgentRecord,
|
|
7
|
+
ensureHostKey,
|
|
8
|
+
forgetAgentForProfile,
|
|
9
|
+
formatExpiresIn,
|
|
10
|
+
getAgentAuthClient,
|
|
11
|
+
isAgentGoneError,
|
|
12
|
+
issueTokenForOrg,
|
|
13
|
+
loadAgentIdentity,
|
|
14
|
+
loadAgentRecord,
|
|
15
|
+
loadHostKey,
|
|
16
|
+
printLoginAgainHint,
|
|
17
|
+
refreshTokenIfNeeded,
|
|
18
|
+
resolveAgentAuthIssuer,
|
|
19
|
+
saveAgentRecord
|
|
20
|
+
} from "./chunk-5Q3PQUI2.js";
|
|
21
|
+
import "./chunk-G564QXNL.js";
|
|
22
|
+
import "./chunk-QPUCHKXS.js";
|
|
23
|
+
import "./chunk-7ZQ666ZQ.js";
|
|
24
|
+
export {
|
|
25
|
+
REFRESH_WINDOW_MS,
|
|
26
|
+
agentPath,
|
|
27
|
+
agentProfileKey,
|
|
28
|
+
deleteAgentRecord,
|
|
29
|
+
ensureHostKey,
|
|
30
|
+
forgetAgentForProfile,
|
|
31
|
+
formatExpiresIn,
|
|
32
|
+
getAgentAuthClient,
|
|
33
|
+
isAgentGoneError,
|
|
34
|
+
issueTokenForOrg,
|
|
35
|
+
loadAgentIdentity,
|
|
36
|
+
loadAgentRecord,
|
|
37
|
+
loadHostKey,
|
|
38
|
+
printLoginAgainHint,
|
|
39
|
+
refreshTokenIfNeeded,
|
|
40
|
+
resolveAgentAuthIssuer,
|
|
41
|
+
saveAgentRecord
|
|
42
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
callApi
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-36I64456.js";
|
|
5
|
+
import "./chunk-BYNI3AGG.js";
|
|
5
6
|
import "./chunk-IOLKUHUB.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-YHQA2AVG.js";
|
|
7
|
+
import "./chunk-G564QXNL.js";
|
|
8
|
+
import "./chunk-QPUCHKXS.js";
|
|
9
9
|
import "./chunk-7ZQ666ZQ.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/apis/ai-agents.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
callApi
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-36I64456.js";
|
|
5
|
+
import "./chunk-BYNI3AGG.js";
|
|
5
6
|
import "./chunk-IOLKUHUB.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-YHQA2AVG.js";
|
|
7
|
+
import "./chunk-G564QXNL.js";
|
|
8
|
+
import "./chunk-QPUCHKXS.js";
|
|
9
9
|
import "./chunk-7ZQ666ZQ.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/app/api.ts
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/commands/app/index.ts
|
|
4
|
+
import { defineCommand } from "citty";
|
|
5
|
+
var app_default = defineCommand({
|
|
6
|
+
meta: {
|
|
7
|
+
name: "app",
|
|
8
|
+
description: "Manage epilot Apps \u2014 create, deploy, and manage app manifests"
|
|
9
|
+
},
|
|
10
|
+
subCommands: {
|
|
11
|
+
init: () => import("./init-HRF5Q2UW.js").then((m) => m.default),
|
|
12
|
+
"add-component": () => import("./add-component-USRY2DQG.js").then((m) => m.default),
|
|
13
|
+
"remove-component": () => import("./remove-component-WQLTK36T.js").then((m) => m.default),
|
|
14
|
+
"add-function": () => import("./add-function-RZTEKVSB.js").then((m) => m.default),
|
|
15
|
+
validate: () => import("./validate-L3EVLLDB.js").then((m) => m.default),
|
|
16
|
+
deploy: () => import("./deploy-LRSKADBB.js").then((m) => m.default),
|
|
17
|
+
dev: () => import("./dev-FGVM3R2Z.js").then((m) => m.default),
|
|
18
|
+
export: () => import("./export-IXXFKWBZ.js").then((m) => m.default),
|
|
19
|
+
versions: () => import("./versions-U4M5UMIX.js").then((m) => m.default),
|
|
20
|
+
review: () => import("./review-XWKQ2QBF.js").then((m) => m.default),
|
|
21
|
+
api: () => import("./api-3L3XZYSQ.js").then((m) => m.default)
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
app_default as default
|
|
26
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
callApi
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-36I64456.js";
|
|
5
|
+
import "./chunk-BYNI3AGG.js";
|
|
5
6
|
import "./chunk-IOLKUHUB.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-YHQA2AVG.js";
|
|
7
|
+
import "./chunk-G564QXNL.js";
|
|
8
|
+
import "./chunk-QPUCHKXS.js";
|
|
9
9
|
import "./chunk-7ZQ666ZQ.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/apis/audit-logs.ts
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
ACCESS_PROFILE_INFO,
|
|
4
|
+
AgentAuthError,
|
|
5
|
+
deleteAgentRecord,
|
|
6
|
+
formatExpiresIn,
|
|
7
|
+
isAccessProfile,
|
|
8
|
+
loadAgentIdentity,
|
|
9
|
+
organizationGrants
|
|
10
|
+
} from "./chunk-5Q3PQUI2.js";
|
|
11
|
+
import {
|
|
12
|
+
loadCredentials,
|
|
13
|
+
removeCredentials
|
|
14
|
+
} from "./chunk-G564QXNL.js";
|
|
15
|
+
import {
|
|
16
|
+
getResolvedProfile,
|
|
17
|
+
resolveProfileName,
|
|
18
|
+
upsertProfile
|
|
19
|
+
} from "./chunk-QPUCHKXS.js";
|
|
20
|
+
import {
|
|
21
|
+
BOLD,
|
|
22
|
+
DIM,
|
|
23
|
+
GREEN,
|
|
24
|
+
RED,
|
|
25
|
+
RESET,
|
|
26
|
+
YELLOW
|
|
27
|
+
} from "./chunk-7ZQ666ZQ.js";
|
|
28
|
+
|
|
29
|
+
// src/commands/auth.ts
|
|
30
|
+
import { defineCommand } from "citty";
|
|
31
|
+
var auth_default = defineCommand({
|
|
32
|
+
meta: {
|
|
33
|
+
name: "auth",
|
|
34
|
+
description: "Manage authentication"
|
|
35
|
+
},
|
|
36
|
+
subCommands: {
|
|
37
|
+
login: () => import("./auth-login-ACQGAE72.js").then((m) => m.default),
|
|
38
|
+
token: () => import("./auth-token-JOSBGVGA.js").then((m) => m.default),
|
|
39
|
+
logout: defineCommand({
|
|
40
|
+
meta: { name: "logout", description: "Remove stored credentials" },
|
|
41
|
+
args: {
|
|
42
|
+
profile: { type: "string", description: "Profile to log out (or EPILOT_PROFILE env)" }
|
|
43
|
+
},
|
|
44
|
+
run: async ({ args }) => {
|
|
45
|
+
const profileName = args.profile || process.env.EPILOT_PROFILE;
|
|
46
|
+
const loaded = loadAgentIdentity(profileName);
|
|
47
|
+
if (loaded) {
|
|
48
|
+
try {
|
|
49
|
+
await loaded.client.revokeAgent(loaded.identity.hostKey, loaded.identity.agentId);
|
|
50
|
+
process.stdout.write(`${DIM}Agent ${loaded.record.agent_id} revoked.${RESET}
|
|
51
|
+
`);
|
|
52
|
+
} catch (error) {
|
|
53
|
+
const reason = error instanceof AgentAuthError ? error.code : "error";
|
|
54
|
+
process.stdout.write(
|
|
55
|
+
`${DIM}Could not revoke agent ${loaded.record.agent_id} (${reason}); removing it locally.${RESET}
|
|
56
|
+
`
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
deleteAgentRecord(profileName);
|
|
60
|
+
const resolvedName = resolveProfileName(profileName);
|
|
61
|
+
if (resolvedName && getResolvedProfile(profileName)?.token) {
|
|
62
|
+
upsertProfile(resolvedName, {
|
|
63
|
+
token: void 0,
|
|
64
|
+
org_id: void 0,
|
|
65
|
+
user_id: void 0,
|
|
66
|
+
expires_at: void 0,
|
|
67
|
+
access_profile: void 0
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const removed = removeCredentials();
|
|
72
|
+
if (removed || loaded) {
|
|
73
|
+
process.stdout.write(`${GREEN}Logged out successfully.${RESET}
|
|
74
|
+
`);
|
|
75
|
+
} else {
|
|
76
|
+
process.stdout.write(`No stored credentials found.
|
|
77
|
+
`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}),
|
|
81
|
+
status: defineCommand({
|
|
82
|
+
meta: { name: "status", description: "Show authentication status" },
|
|
83
|
+
args: {
|
|
84
|
+
profile: { type: "string", description: "Profile to inspect (or EPILOT_PROFILE env)" }
|
|
85
|
+
},
|
|
86
|
+
run: async ({ args }) => {
|
|
87
|
+
const profileName = args.profile || process.env.EPILOT_PROFILE;
|
|
88
|
+
const loaded = loadAgentIdentity(profileName);
|
|
89
|
+
if (!loaded) {
|
|
90
|
+
const plain = loadCredentials();
|
|
91
|
+
if (!plain) {
|
|
92
|
+
process.stdout.write(`${YELLOW}Not authenticated.${RESET}
|
|
93
|
+
`);
|
|
94
|
+
process.stdout.write(`Run ${BOLD}epilot auth login${RESET} to authenticate.
|
|
95
|
+
`);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
printTokenStatus(plain, { agent: false });
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const creds = loadCredentials() ?? profileCredentials(profileName);
|
|
102
|
+
if (creds) {
|
|
103
|
+
printTokenStatus(creds, { agent: true });
|
|
104
|
+
} else {
|
|
105
|
+
process.stdout.write(`${YELLOW}No valid token stored${RESET} ${DIM}(issued on next API call)${RESET}
|
|
106
|
+
`);
|
|
107
|
+
}
|
|
108
|
+
process.stdout.write(`
|
|
109
|
+
${BOLD}Agent Auth${RESET}
|
|
110
|
+
`);
|
|
111
|
+
process.stdout.write(` Agent: ${loaded.record.agent_id} ${DIM}(${loaded.record.name})${RESET}
|
|
112
|
+
`);
|
|
113
|
+
process.stdout.write(` Host: ${loaded.record.host_id}
|
|
114
|
+
`);
|
|
115
|
+
process.stdout.write(` Issuer: ${loaded.record.issuer}
|
|
116
|
+
`);
|
|
117
|
+
try {
|
|
118
|
+
const status = await loaded.client.getAgentStatus(loaded.identity.hostKey, loaded.identity.agentId);
|
|
119
|
+
const color = status.status === "active" ? GREEN : status.status === "pending" ? YELLOW : RED;
|
|
120
|
+
process.stdout.write(` Status: ${color}${status.status}${RESET}`);
|
|
121
|
+
if (status.expires_at) process.stdout.write(` ${DIM}(expires ${status.expires_at})${RESET}`);
|
|
122
|
+
process.stdout.write("\n");
|
|
123
|
+
const grants = organizationGrants(status.agent_capability_grants);
|
|
124
|
+
if (grants.length) {
|
|
125
|
+
process.stdout.write(` Grants:
|
|
126
|
+
`);
|
|
127
|
+
for (const g of grants) {
|
|
128
|
+
const expiry = formatExpiresIn(g.expiresAt);
|
|
129
|
+
const expired = expiry === "expired";
|
|
130
|
+
const level = [g.profile, g.anonymized ? "anonymized" : "", expiry ?? ""].filter(Boolean);
|
|
131
|
+
const statusColor = g.grant.status === "active" && !expired ? GREEN : g.grant.status === "pending" ? YELLOW : RED;
|
|
132
|
+
const active = g.organizationId && g.organizationId === creds?.org_id && g.profile === (creds?.access_profile ?? "read") ? ` ${DIM}(active)${RESET}` : "";
|
|
133
|
+
const reason = g.reason ? ` ${DIM}\u2014 "${g.reason}"${RESET}` : "";
|
|
134
|
+
process.stdout.write(
|
|
135
|
+
` ${(g.organizationId ?? "login organization").padEnd(12)} ${statusColor}${expired ? "expired" : g.grant.status}${RESET} ${DIM}${level.join(", ")}${RESET}${active}${reason}
|
|
136
|
+
`
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
} catch (error) {
|
|
141
|
+
const reason = error instanceof AgentAuthError ? `${error.message} (${error.code})` : String(error);
|
|
142
|
+
process.stdout.write(` Status: ${RED}unavailable${RESET} ${DIM}${reason}${RESET}
|
|
143
|
+
`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
})
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
var profileCredentials = (profileName) => {
|
|
150
|
+
const profile = getResolvedProfile(profileName);
|
|
151
|
+
if (!profile?.token) return null;
|
|
152
|
+
if (profile.expires_at && new Date(profile.expires_at) < /* @__PURE__ */ new Date()) return null;
|
|
153
|
+
return {
|
|
154
|
+
token: profile.token,
|
|
155
|
+
org_id: profile.org_id,
|
|
156
|
+
user_id: profile.user_id,
|
|
157
|
+
expires_at: profile.expires_at,
|
|
158
|
+
access_profile: profile.access_profile
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
var printTokenStatus = (creds, { agent }) => {
|
|
162
|
+
const claims = parseJwtPayload(creds.token);
|
|
163
|
+
const isApiToken = claims?.token_type === "api";
|
|
164
|
+
const isCognitoToken = typeof claims?.iss === "string" && claims.iss.includes("cognito-idp");
|
|
165
|
+
const tokenType = isApiToken ? "API Token" : isCognitoToken ? "User Token" : "Token";
|
|
166
|
+
process.stdout.write(`${GREEN}${BOLD}Authenticated${RESET} ${DIM}(${tokenType})${RESET}
|
|
167
|
+
`);
|
|
168
|
+
const name = claims?.token_name || claims?.email || claims?.["cognito:username"] || creds.name;
|
|
169
|
+
const orgId = claims?.org_id || claims?.["custom:ivy_org_id"] || creds.org_id;
|
|
170
|
+
const userId = claims?.user_id || claims?.["custom:ivy_user_id"] || creds.user_id;
|
|
171
|
+
const tokenId = claims?.token_id;
|
|
172
|
+
const adminEmail = claims?.admin_email;
|
|
173
|
+
const tokenUse = claims?.token_use;
|
|
174
|
+
const roles = claims?.assume_roles;
|
|
175
|
+
const readOnly = claims?.read_only === true;
|
|
176
|
+
const anonymize = claims?.anonymize === true;
|
|
177
|
+
if (name) process.stdout.write(` Name: ${name}
|
|
178
|
+
`);
|
|
179
|
+
if (adminEmail && adminEmail !== name) process.stdout.write(` Email: ${adminEmail}
|
|
180
|
+
`);
|
|
181
|
+
if (orgId) process.stdout.write(` Org: ${orgId}
|
|
182
|
+
`);
|
|
183
|
+
if (userId) process.stdout.write(` User: ${userId}
|
|
184
|
+
`);
|
|
185
|
+
if (tokenId && tokenId !== userId) process.stdout.write(` Token ID: ${tokenId}
|
|
186
|
+
`);
|
|
187
|
+
if (tokenUse) process.stdout.write(` Use: ${tokenUse}
|
|
188
|
+
`);
|
|
189
|
+
if (roles?.length) process.stdout.write(` Roles: ${roles.join(", ")}
|
|
190
|
+
`);
|
|
191
|
+
process.stdout.write(` Access: ${readOnly ? `${YELLOW}read-only${RESET}` : `${GREEN}read-write${RESET}`}
|
|
192
|
+
`);
|
|
193
|
+
if (isAccessProfile(creds.access_profile)) {
|
|
194
|
+
process.stdout.write(
|
|
195
|
+
` Profile: ${creds.access_profile} ${DIM}(${ACCESS_PROFILE_INFO[creds.access_profile].title})${RESET}
|
|
196
|
+
`
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
if (anonymize) process.stdout.write(` Data: ${YELLOW}anonymized${RESET}
|
|
200
|
+
`);
|
|
201
|
+
if (creds.expires_at) {
|
|
202
|
+
const expiry = new Date(creds.expires_at);
|
|
203
|
+
const now = /* @__PURE__ */ new Date();
|
|
204
|
+
const diffMs = expiry.getTime() - now.getTime();
|
|
205
|
+
const label = agent ? diffMs < 864e5 ? `${Math.floor(diffMs / 36e5)}h ${Math.floor(diffMs % 36e5 / 6e4)}m` : `${Math.floor(diffMs / 864e5)} days` : `${Math.floor(diffMs / (1e3 * 60 * 60 * 24))} days`;
|
|
206
|
+
process.stdout.write(` Expires: ${creds.expires_at} ${DIM}(${label})${RESET}
|
|
207
|
+
`);
|
|
208
|
+
} else if (claims?.exp) {
|
|
209
|
+
const expiry = new Date(claims.exp * 1e3);
|
|
210
|
+
const now = /* @__PURE__ */ new Date();
|
|
211
|
+
const diffMs = expiry.getTime() - now.getTime();
|
|
212
|
+
const label = diffMs < 0 ? `${RED}expired${RESET}` : diffMs < 864e5 ? `${Math.floor(diffMs / 36e5)}h ${Math.floor(diffMs % 36e5 / 6e4)}m` : `${Math.floor(diffMs / 864e5)} days`;
|
|
213
|
+
process.stdout.write(` Expires: ${expiry.toISOString()} ${DIM}(${label})${RESET}
|
|
214
|
+
`);
|
|
215
|
+
} else if (claims?.iat && !claims?.exp) {
|
|
216
|
+
const issued = new Date(claims.iat * 1e3);
|
|
217
|
+
process.stdout.write(` Issued: ${issued.toISOString()} ${DIM}(no expiry)${RESET}
|
|
218
|
+
`);
|
|
219
|
+
}
|
|
220
|
+
process.stdout.write(` Token: ${creds.token.substring(0, 20)}...${RESET}
|
|
221
|
+
`);
|
|
222
|
+
};
|
|
223
|
+
var parseJwtPayload = (token) => {
|
|
224
|
+
try {
|
|
225
|
+
const parts = token.split(".");
|
|
226
|
+
if (parts.length !== 3) return null;
|
|
227
|
+
const payload = Buffer.from(parts[1], "base64url").toString("utf-8");
|
|
228
|
+
return JSON.parse(payload);
|
|
229
|
+
} catch {
|
|
230
|
+
return null;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
export {
|
|
234
|
+
auth_default as default
|
|
235
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
AGENT_FLAG_DESCRIPTION,
|
|
4
|
+
agentLogin,
|
|
5
|
+
auth_login_default,
|
|
6
|
+
browserLogin,
|
|
7
|
+
chooseOrganization,
|
|
8
|
+
describeAccess,
|
|
9
|
+
openBrowser,
|
|
10
|
+
parseAccessProfile,
|
|
11
|
+
printApproval,
|
|
12
|
+
readOnlySibling,
|
|
13
|
+
resolveLoginProfile,
|
|
14
|
+
resolveReason
|
|
15
|
+
} from "./chunk-U4YGZRJY.js";
|
|
16
|
+
import "./chunk-IOLKUHUB.js";
|
|
17
|
+
import "./chunk-5Q3PQUI2.js";
|
|
18
|
+
import "./chunk-G564QXNL.js";
|
|
19
|
+
import "./chunk-QPUCHKXS.js";
|
|
20
|
+
import "./chunk-7ZQ666ZQ.js";
|
|
21
|
+
export {
|
|
22
|
+
AGENT_FLAG_DESCRIPTION,
|
|
23
|
+
agentLogin,
|
|
24
|
+
browserLogin,
|
|
25
|
+
chooseOrganization,
|
|
26
|
+
auth_login_default as default,
|
|
27
|
+
describeAccess,
|
|
28
|
+
openBrowser,
|
|
29
|
+
parseAccessProfile,
|
|
30
|
+
printApproval,
|
|
31
|
+
readOnlySibling,
|
|
32
|
+
resolveLoginProfile,
|
|
33
|
+
resolveReason
|
|
34
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
callApi
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-36I64456.js";
|
|
5
|
+
import "./chunk-BYNI3AGG.js";
|
|
5
6
|
import "./chunk-IOLKUHUB.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-YHQA2AVG.js";
|
|
7
|
+
import "./chunk-G564QXNL.js";
|
|
8
|
+
import "./chunk-QPUCHKXS.js";
|
|
9
9
|
import "./chunk-7ZQ666ZQ.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/apis/automation.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
callApi
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-36I64456.js";
|
|
5
|
+
import "./chunk-BYNI3AGG.js";
|
|
5
6
|
import "./chunk-IOLKUHUB.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-YHQA2AVG.js";
|
|
7
|
+
import "./chunk-G564QXNL.js";
|
|
8
|
+
import "./chunk-QPUCHKXS.js";
|
|
9
9
|
import "./chunk-7ZQ666ZQ.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/apis/billing.ts
|