@aventurevc/aventure-cli 0.8.180 → 0.8.182

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/aventure-cli/index.js +1 -1
  2. package/dist/aventure-cli/unified-operations.json +19 -268
  3. package/dist/chunks/api-key-bearer-credential-BQEuNZq_.js +1 -0
  4. package/dist/chunks/{api-key-bearer-credential-08YUx1xO.js → api-key-bearer-credential-Cxons3cm.js} +1 -1
  5. package/dist/chunks/{aventure-cli-1wY4a8zo.js → aventure-cli-ByArqREK.js} +6 -6
  6. package/dist/chunks/{cli-help-policy-ClfxVVMO.js → cli-help-policy-CEZmY2LL.js} +1 -1
  7. package/dist/chunks/contract-B7W2M1r5.js +27 -0
  8. package/dist/chunks/detail-D3FyUXbw.js +1 -0
  9. package/dist/chunks/detail-DIjiKrvq.js +1 -0
  10. package/dist/chunks/{dist-COybJYus.js → dist-CQcCS3UF.js} +2 -2
  11. package/dist/chunks/{env-Casn05NX.js → env-gpTPURvt.js} +1 -1
  12. package/dist/chunks/logging-B7HscXAR.js +1 -0
  13. package/dist/chunks/{logging-BkyFCiym.js → logging-D_7xwm_N.js} +1 -1
  14. package/dist/chunks/mcp-generation-contract-BpLARuaA.js +1 -0
  15. package/dist/chunks/mcp-generation-contract-CNIjHJrb.js +1 -0
  16. package/dist/chunks/{oauth-bearer-credential-BdZ-pdVf.js → oauth-bearer-credential--cPkgsoT.js} +2 -2
  17. package/dist/chunks/oauth-bearer-credential-Hs2M6E5C.js +1 -0
  18. package/dist/chunks/oauth-login-CItCJmFw.js +1 -0
  19. package/dist/chunks/{oauth-login-BfnyHuts.js → oauth-login-CUvfOm07.js} +1 -1
  20. package/dist/chunks/openapi-commands-BJPh7WgV.js +1 -0
  21. package/dist/chunks/openapi-commands-M0moPVNe.js +1 -0
  22. package/dist/chunks/output-mode-ClwZIjEf.js +1 -0
  23. package/dist/chunks/{output-mode-Bl9hZ5Qe.js → output-mode-DTYU9WPD.js} +1 -1
  24. package/dist/chunks/{output-spill-CjiBFqUS.js → output-spill-BRyuNqcH.js} +1 -1
  25. package/dist/chunks/provider-catalog-9sCD-sMl.js +1 -0
  26. package/dist/chunks/{response-problem-DpVA-CLe.js → response-problem-D6NByFDg.js} +1 -1
  27. package/dist/chunks/result-envelope-BQn5YxYv.js +1 -0
  28. package/dist/chunks/startup-auth-BgliDNpy.js +1 -0
  29. package/dist/chunks/{startup-auth-DaJp5qea.js → startup-auth-V9kB5Weo.js} +1 -1
  30. package/dist/chunks/{tool-policy-DDfbFJCQ.js → tool-policy-CrjzsCMg.js} +1 -1
  31. package/package.json +3 -3
  32. package/scripts/install-zsh-completion-loader.mjs +1 -1
  33. package/dist/chunks/api-key-bearer-credential-CbAZG3UK.js +0 -1
  34. package/dist/chunks/contract-qNgU9Yeq.js +0 -27
  35. package/dist/chunks/detail-B93equBj.js +0 -1
  36. package/dist/chunks/detail-DDrpot7C.js +0 -1
  37. package/dist/chunks/logging-SpDUtMAq.js +0 -1
  38. package/dist/chunks/mcp-generation-contract-57Ma8uaG.js +0 -1
  39. package/dist/chunks/mcp-generation-contract-qkSbgO9-.js +0 -1
  40. package/dist/chunks/oauth-bearer-credential-nO_y4YXf.js +0 -1
  41. package/dist/chunks/oauth-login-Cgjwcc4U.js +0 -1
  42. package/dist/chunks/openapi-commands-BQWRBrXR.js +0 -1
  43. package/dist/chunks/openapi-commands-EyRhLowQ.js +0 -1
  44. package/dist/chunks/output-mode-BszZ_T22.js +0 -1
  45. package/dist/chunks/provider-catalog-sHoS3jIA.js +0 -1
  46. package/dist/chunks/result-envelope-CFE7wPAr.js +0 -1
  47. package/dist/chunks/startup-auth-G6Utbedw.js +0 -1
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{enableCompileCache as e}from"node:module";e();var{CommanderError:t}=await import(`../chunks/commander-Cj79cOD4.js`),{logWarn:n,setStderrLogging:r}=await import(`../chunks/logging-SpDUtMAq.js`),{readRuntimePackage:i}=await import(`../chunks/package-N5oYCiVc.js`),{locateRuntimeManifest:a}=await import(`../chunks/runtime-identity-Bva_KyCh.js`),{materializeCliOAuthBearerCredential:o,materializeSavedCliOAuthBearerCredential:s}=await import(`../chunks/oauth-bearer-credential-nO_y4YXf.js`),{materializeCliApiKeyBearerCredential:c}=await import(`../chunks/api-key-bearer-credential-CbAZG3UK.js`),{commandAuthMaterializationMode:l}=await import(`../chunks/startup-auth-G6Utbedw.js`),{setTextAllFields:u}=await import(`../chunks/text-field-CxrRvM47.js`),{cliMachineOutputSelected:d}=await import(`../chunks/output-mode-BszZ_T22.js`),{GENERATED_OPENAPI_COMMAND_SPECS:f}=await import(`../chunks/openapi-commands-EyRhLowQ.js`),p=process.argv.slice(2);d(p)&&r(!1),p.includes(`--all-fields`)&&u(!0);try{a();let e=l(p,f);if(e===`stored`||e===`optional`)try{await(e===`stored`?s():o()),await c()}catch(e){n({component:i().bin[0],event:`optional_auth_materialization_failed`,message:`saved credential unavailable; continuing with credential-optional command`,error:e})}await import(`../chunks/aventure-cli-1wY4a8zo.js`)}catch(e){if(!(e instanceof t))throw e;process.stderr.write(`${e.message}\n`),process.exitCode=e.exitCode}export{};
2
+ import{enableCompileCache as e}from"node:module";e();var{CommanderError:t}=await import(`../chunks/commander-Cj79cOD4.js`),{logWarn:n,setStderrLogging:r}=await import(`../chunks/logging-B7HscXAR.js`),{readRuntimePackage:i}=await import(`../chunks/package-N5oYCiVc.js`),{locateRuntimeManifest:a}=await import(`../chunks/runtime-identity-Bva_KyCh.js`),{materializeCliOAuthBearerCredential:o,materializeSavedCliOAuthBearerCredential:s}=await import(`../chunks/oauth-bearer-credential-Hs2M6E5C.js`),{materializeCliApiKeyBearerCredential:c}=await import(`../chunks/api-key-bearer-credential-BQEuNZq_.js`),{commandAuthMaterializationMode:l}=await import(`../chunks/startup-auth-BgliDNpy.js`),{setTextAllFields:u}=await import(`../chunks/text-field-CxrRvM47.js`),{cliMachineOutputSelected:d}=await import(`../chunks/output-mode-ClwZIjEf.js`),{GENERATED_OPENAPI_COMMAND_SPECS:f}=await import(`../chunks/openapi-commands-BJPh7WgV.js`),p=process.argv.slice(2);d(p)&&r(!1),p.includes(`--all-fields`)&&u(!0);try{a();let e=l(p,f);if(e===`stored`||e===`optional`)try{await(e===`stored`?s():o()),await c()}catch(e){n({component:i().bin[0],event:`optional_auth_materialization_failed`,message:`saved credential unavailable; continuing with credential-optional command`,error:e})}await import(`../chunks/aventure-cli-ByArqREK.js`)}catch(e){if(!(e instanceof t))throw e;process.stderr.write(`${e.message}\n`),process.exitCode=e.exitCode}export{};
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "generatedFrom": "MCP_GENERATION_CONTRACT",
4
- "generatedAt": "2026-10-14T15:01:41.253Z",
5
- "totalOperations": 146,
4
+ "generatedAt": "2026-10-14T21:07:15.209Z",
5
+ "totalOperations": 133,
6
6
  "note": "Projection of MCP_GENERATION_CONTRACT - see mcp/scripts/build-unified-operations.ts header for SSOT rules.",
7
7
  "operations": [
8
8
  {
@@ -44,26 +44,6 @@
44
44
  "scope": "read",
45
45
  "destructive": false
46
46
  },
47
- {
48
- "operationId": "authorizeOperations",
49
- "method": "POST",
50
- "path": "/v1/auth/me/permissions",
51
- "resource": "auth",
52
- "intent": "write",
53
- "cliCommand": "auth me permissions authorize",
54
- "cliPath": [
55
- "auth",
56
- "me",
57
- "permissions",
58
- "authorize"
59
- ],
60
- "mcpTool": "aventure_write",
61
- "bodySchemaName": "AuthOperationFilterSchema",
62
- "bodySchemaImport": "@aventurevc/api-schemas/auth/operation-filter",
63
- "auth": "bearer",
64
- "scope": "write",
65
- "destructive": false
66
- },
67
47
  {
68
48
  "operationId": "getAuthProviderCatalog",
69
49
  "method": "GET",
@@ -83,25 +63,6 @@
83
63
  "scope": "read",
84
64
  "destructive": false
85
65
  },
86
- {
87
- "operationId": "updateAdditionalUsage",
88
- "method": "PATCH",
89
- "path": "/v1/billing/additional-usage",
90
- "resource": "billing",
91
- "intent": "write",
92
- "cliCommand": "billing additional-usage update",
93
- "cliPath": [
94
- "billing",
95
- "additional-usage",
96
- "update"
97
- ],
98
- "mcpTool": "aventure_write",
99
- "bodySchemaName": "BillingAdditionalUsageMutationSchema",
100
- "bodySchemaImport": "@aventurevc/api-schemas/billing/additional-usage-mutation",
101
- "auth": "bearer",
102
- "scope": "write",
103
- "destructive": false
104
- },
105
66
  {
106
67
  "operationId": "getAiCredits",
107
68
  "method": "GET",
@@ -121,44 +82,6 @@
121
82
  "scope": "read",
122
83
  "destructive": false
123
84
  },
124
- {
125
- "operationId": "createBillingCheckoutSession",
126
- "method": "POST",
127
- "path": "/v1/billing/checkout-sessions",
128
- "resource": "billing",
129
- "intent": "write",
130
- "cliCommand": "billing checkout-sessions create",
131
- "cliPath": [
132
- "billing",
133
- "checkout-sessions",
134
- "create"
135
- ],
136
- "mcpTool": "aventure_write",
137
- "bodySchemaName": "BillingCheckoutMutationSchema",
138
- "bodySchemaImport": "@aventurevc/api-schemas/billing/checkout-mutation",
139
- "auth": "bearer",
140
- "scope": "write",
141
- "destructive": false
142
- },
143
- {
144
- "operationId": "createBillingCreditPurchase",
145
- "method": "POST",
146
- "path": "/v1/billing/credit-purchases",
147
- "resource": "billing",
148
- "intent": "write",
149
- "cliCommand": "billing credit-purchases create",
150
- "cliPath": [
151
- "billing",
152
- "credit-purchases",
153
- "create"
154
- ],
155
- "mcpTool": "aventure_write",
156
- "bodySchemaName": "BillingCreditPurchaseMutationSchema",
157
- "bodySchemaImport": "@aventurevc/api-schemas/billing/credit-purchase-mutation",
158
- "auth": "bearer",
159
- "scope": "write",
160
- "destructive": false
161
- },
162
85
  {
163
86
  "operationId": "getBillingCreditPurchase",
164
87
  "method": "GET",
@@ -178,44 +101,6 @@
178
101
  "scope": "read",
179
102
  "destructive": false
180
103
  },
181
- {
182
- "operationId": "createBillingPlanChangePreview",
183
- "method": "POST",
184
- "path": "/v1/billing/plan-change-previews",
185
- "resource": "billing",
186
- "intent": "write",
187
- "cliCommand": "billing plan-change-previews create",
188
- "cliPath": [
189
- "billing",
190
- "plan-change-previews",
191
- "create"
192
- ],
193
- "mcpTool": "aventure_write",
194
- "bodySchemaName": "BillingPlanChangeMutationSchema",
195
- "bodySchemaImport": "@aventurevc/api-schemas/billing/plan-change-mutation",
196
- "auth": "bearer",
197
- "scope": "write",
198
- "destructive": false
199
- },
200
- {
201
- "operationId": "createBillingPlanChange",
202
- "method": "POST",
203
- "path": "/v1/billing/plan-changes",
204
- "resource": "billing",
205
- "intent": "write",
206
- "cliCommand": "billing plan-changes create",
207
- "cliPath": [
208
- "billing",
209
- "plan-changes",
210
- "create"
211
- ],
212
- "mcpTool": "aventure_write",
213
- "bodySchemaName": "BillingPlanChangeMutationSchema",
214
- "bodySchemaImport": "@aventurevc/api-schemas/billing/plan-change-mutation",
215
- "auth": "bearer",
216
- "scope": "write",
217
- "destructive": false
218
- },
219
104
  {
220
105
  "operationId": "listPlans",
221
106
  "method": "GET",
@@ -235,25 +120,6 @@
235
120
  "scope": "read",
236
121
  "destructive": false
237
122
  },
238
- {
239
- "operationId": "createBillingPortalSession",
240
- "method": "POST",
241
- "path": "/v1/billing/portal-sessions",
242
- "resource": "billing",
243
- "intent": "write",
244
- "cliCommand": "billing portal-sessions create",
245
- "cliPath": [
246
- "billing",
247
- "portal-sessions",
248
- "create"
249
- ],
250
- "mcpTool": "aventure_write",
251
- "bodySchemaName": "BillingPortalMutationSchema",
252
- "bodySchemaImport": "@aventurevc/api-schemas/billing/portal-mutation",
253
- "auth": "bearer",
254
- "scope": "write",
255
- "destructive": false
256
- },
257
123
  {
258
124
  "operationId": "getBillingSubscription",
259
125
  "method": "GET",
@@ -273,25 +139,6 @@
273
139
  "scope": "read",
274
140
  "destructive": false
275
141
  },
276
- {
277
- "operationId": "updateBillingSubscription",
278
- "method": "PATCH",
279
- "path": "/v1/billing/subscription",
280
- "resource": "billing",
281
- "intent": "write",
282
- "cliCommand": "billing subscription update",
283
- "cliPath": [
284
- "billing",
285
- "subscription",
286
- "update"
287
- ],
288
- "mcpTool": "aventure_write",
289
- "bodySchemaName": "BillingSubscriptionMutationSchema",
290
- "bodySchemaImport": "@aventurevc/api-schemas/billing/subscription-mutation",
291
- "auth": "bearer",
292
- "scope": "write",
293
- "destructive": false
294
- },
295
142
  {
296
143
  "operationId": "getBillingNextCharge",
297
144
  "method": "GET",
@@ -337,17 +184,17 @@
337
184
  "method": "POST",
338
185
  "path": "/v1/enrichments",
339
186
  "resource": "enrichments",
340
- "intent": "write",
187
+ "intent": "job",
341
188
  "cliCommand": "enrichments enrich",
342
189
  "cliPath": [
343
190
  "enrichments",
344
191
  "enrich"
345
192
  ],
346
- "mcpTool": "aventure_write",
193
+ "mcpTool": "aventure_job",
347
194
  "bodySchemaName": "EnrichmentBatchSchema",
348
195
  "bodySchemaImport": "@aventurevc/api-schemas/enrichment/batch",
349
196
  "auth": "bearer",
350
- "scope": "write",
197
+ "scope": "read",
351
198
  "destructive": false
352
199
  },
353
200
  {
@@ -621,18 +468,18 @@
621
468
  "method": "POST",
622
469
  "path": "/v1/entities/{entityId}/enrichments",
623
470
  "resource": "entities",
624
- "intent": "write",
471
+ "intent": "job",
625
472
  "cliCommand": "entities enrichments enrich",
626
473
  "cliPath": [
627
474
  "entities",
628
475
  "enrichments",
629
476
  "enrich"
630
477
  ],
631
- "mcpTool": "aventure_write",
478
+ "mcpTool": "aventure_job",
632
479
  "bodySchemaName": "EnrichmentPromptSchema",
633
480
  "bodySchemaImport": "@aventurevc/api-schemas/enrichment/prompt",
634
481
  "auth": "bearer",
635
- "scope": "write",
482
+ "scope": "read",
636
483
  "destructive": false
637
484
  },
638
485
  {
@@ -1588,17 +1435,17 @@
1588
1435
  "method": "POST",
1589
1436
  "path": "/v1/lookup-jobs",
1590
1437
  "resource": "lookup-jobs",
1591
- "intent": "write",
1438
+ "intent": "job",
1592
1439
  "cliCommand": "lookup-jobs create",
1593
1440
  "cliPath": [
1594
1441
  "lookup-jobs",
1595
1442
  "create"
1596
1443
  ],
1597
- "mcpTool": "aventure_write",
1444
+ "mcpTool": "aventure_job",
1598
1445
  "bodySchemaName": "LookupJobMutationSchema",
1599
1446
  "bodySchemaImport": "@aventurevc/api-schemas/lookup/job-mutation",
1600
1447
  "auth": "bearer",
1601
- "scope": "write",
1448
+ "scope": "read",
1602
1449
  "destructive": false
1603
1450
  },
1604
1451
  {
@@ -1633,7 +1480,7 @@
1633
1480
  "bodySchemaName": "LookupJobMutationSchema",
1634
1481
  "bodySchemaImport": "@aventurevc/api-schemas/lookup/job-mutation",
1635
1482
  "auth": "bearer",
1636
- "scope": "write",
1483
+ "scope": "read",
1637
1484
  "destructive": false
1638
1485
  },
1639
1486
  {
@@ -1727,25 +1574,6 @@
1727
1574
  "scope": "read",
1728
1575
  "destructive": false
1729
1576
  },
1730
- {
1731
- "operationId": "createNewsFeedback",
1732
- "method": "POST",
1733
- "path": "/v1/news/feedback",
1734
- "resource": "news",
1735
- "intent": "write",
1736
- "cliCommand": "news feedback create",
1737
- "cliPath": [
1738
- "news",
1739
- "feedback",
1740
- "create"
1741
- ],
1742
- "mcpTool": "aventure_write",
1743
- "bodySchemaName": "NewsFeedbackSchema",
1744
- "bodySchemaImport": "@aventurevc/api-schemas/news/feedback",
1745
- "auth": "bearer",
1746
- "scope": "write",
1747
- "destructive": false
1748
- },
1749
1577
  {
1750
1578
  "operationId": "lookupNews",
1751
1579
  "method": "GET",
@@ -1764,25 +1592,6 @@
1764
1592
  "scope": "read",
1765
1593
  "destructive": false
1766
1594
  },
1767
- {
1768
- "operationId": "unsubscribeNewsSubscription",
1769
- "method": "DELETE",
1770
- "path": "/v1/news/subscriptions",
1771
- "resource": "news",
1772
- "intent": "delete",
1773
- "cliCommand": "news subscriptions unsubscribe",
1774
- "cliPath": [
1775
- "news",
1776
- "subscriptions",
1777
- "unsubscribe"
1778
- ],
1779
- "mcpTool": "aventure_delete",
1780
- "bodySchemaName": "NewsSubscriptionKeySchema",
1781
- "bodySchemaImport": "@aventurevc/api-schemas/news/subscription-key",
1782
- "auth": "bearer",
1783
- "scope": "write",
1784
- "destructive": true
1785
- },
1786
1595
  {
1787
1596
  "operationId": "listNewsSubscriptions",
1788
1597
  "method": "GET",
@@ -1802,45 +1611,6 @@
1802
1611
  "scope": "read",
1803
1612
  "destructive": false
1804
1613
  },
1805
- {
1806
- "operationId": "subscribeNewsSubscription",
1807
- "method": "PUT",
1808
- "path": "/v1/news/subscriptions",
1809
- "resource": "news",
1810
- "intent": "write",
1811
- "cliCommand": "news subscriptions subscribe",
1812
- "cliPath": [
1813
- "news",
1814
- "subscriptions",
1815
- "subscribe"
1816
- ],
1817
- "mcpTool": "aventure_write",
1818
- "bodySchemaName": "NewsSubscriptionSchema",
1819
- "bodySchemaImport": "@aventurevc/api-schemas/news/subscription",
1820
- "auth": "bearer",
1821
- "scope": "write",
1822
- "destructive": false
1823
- },
1824
- {
1825
- "operationId": "sendNewsSubscriptionTestEvent",
1826
- "method": "POST",
1827
- "path": "/v1/news/subscriptions/{subscriptionId}/test-events",
1828
- "resource": "news",
1829
- "intent": "write",
1830
- "cliCommand": "news subscriptions test-events send",
1831
- "cliPath": [
1832
- "news",
1833
- "subscriptions",
1834
- "test-events",
1835
- "send"
1836
- ],
1837
- "mcpTool": "aventure_write",
1838
- "bodySchemaName": null,
1839
- "bodySchemaImport": null,
1840
- "auth": "bearer",
1841
- "scope": "write",
1842
- "destructive": false
1843
- },
1844
1614
  {
1845
1615
  "operationId": "listPeople",
1846
1616
  "method": "GET",
@@ -2016,18 +1786,18 @@
2016
1786
  "method": "POST",
2017
1787
  "path": "/v1/people/{personId}/enrichments",
2018
1788
  "resource": "people",
2019
- "intent": "write",
1789
+ "intent": "job",
2020
1790
  "cliCommand": "people enrichments enrich",
2021
1791
  "cliPath": [
2022
1792
  "people",
2023
1793
  "enrichments",
2024
1794
  "enrich"
2025
1795
  ],
2026
- "mcpTool": "aventure_write",
1796
+ "mcpTool": "aventure_job",
2027
1797
  "bodySchemaName": "EnrichmentPromptSchema",
2028
1798
  "bodySchemaImport": "@aventurevc/api-schemas/enrichment/prompt",
2029
1799
  "auth": "bearer",
2030
- "scope": "write",
1800
+ "scope": "read",
2031
1801
  "destructive": false
2032
1802
  },
2033
1803
  {
@@ -2432,17 +2202,17 @@
2432
2202
  "method": "POST",
2433
2203
  "path": "/v1/research-runs",
2434
2204
  "resource": "research-runs",
2435
- "intent": "write",
2205
+ "intent": "job",
2436
2206
  "cliCommand": "research-runs create",
2437
2207
  "cliPath": [
2438
2208
  "research-runs",
2439
2209
  "create"
2440
2210
  ],
2441
- "mcpTool": "aventure_write",
2211
+ "mcpTool": "aventure_job",
2442
2212
  "bodySchemaName": "HarnessRunCreateSchema",
2443
2213
  "bodySchemaImport": "@aventurevc/api-schemas/harness/run-create",
2444
2214
  "auth": "bearer",
2445
- "scope": "write",
2215
+ "scope": "read",
2446
2216
  "destructive": false
2447
2217
  },
2448
2218
  {
@@ -2612,25 +2382,6 @@
2612
2382
  "scope": "read",
2613
2383
  "destructive": false
2614
2384
  },
2615
- {
2616
- "operationId": "createSharedSearch",
2617
- "method": "POST",
2618
- "path": "/v1/search/shared",
2619
- "resource": "search",
2620
- "intent": "write",
2621
- "cliCommand": "search shared create",
2622
- "cliPath": [
2623
- "search",
2624
- "shared",
2625
- "create"
2626
- ],
2627
- "mcpTool": "aventure_write",
2628
- "bodySchemaName": "SharedSearchMutationSchema",
2629
- "bodySchemaImport": "@aventurevc/api-schemas/shared/search-mutation",
2630
- "auth": "bearer",
2631
- "scope": "write",
2632
- "destructive": false
2633
- },
2634
2385
  {
2635
2386
  "operationId": "getSharedSearch",
2636
2387
  "method": "GET",
@@ -2740,7 +2491,7 @@
2740
2491
  "bodySchemaName": "SearchSchema",
2741
2492
  "bodySchemaImport": "@aventurevc/api-schemas/search/search",
2742
2493
  "auth": "bearer",
2743
- "scope": "write",
2494
+ "scope": "read",
2744
2495
  "destructive": false
2745
2496
  },
2746
2497
  {
@@ -0,0 +1 @@
1
+ import{t as e}from"./api-key-bearer-credential-Cxons3cm.js";export{e as materializeCliApiKeyBearerCredential};
@@ -1,4 +1,4 @@
1
- import{o as e,r as t}from"./logging-BkyFCiym.js";import{a as n,t as r,u as i}from"./env-Casn05NX.js";import{i as a,l as o,o as s,w as c,y as l}from"./person-owner-BJgNYLKX.js";import{a as u}from"./package-DPDX5zmx.js";import{r as d}from"./response-problem-DpVA-CLe.js";import{execFile as f}from"node:child_process";import{dirname as p,join as m}from"node:path";import{homedir as h,platform as g}from"node:os";import{setTimeout as _}from"node:timers/promises";import{randomUUID as v}from"node:crypto";import{AsyncLocalStorage as ee}from"node:async_hooks";import{chmod as te,mkdir as y,readFile as b,rename as x,rm as S,stat as ne,writeFile as C}from"node:fs/promises";function w(e){let t=e.trim();if(t.length===0)throw Error(`API host must not be blank`);let n=new URL(ae(t)?t:`${oe(t)}://${t}`),r=E(n.hostname);if(n.protocol!==`https:`&&n.protocol!==`http:`||n.username.length>0||n.password.length>0||n.pathname!==`/`&&n.pathname!==``||n.search.length>0||n.hash.length>0)throw Error(`API host must contain only an HTTP(S) host and optional port`);if(n.protocol===`http:`&&!r)throw Error(`stored credentials require HTTPS except for loopback API hosts`);return{host:n.host.toLowerCase(),origin:n.origin,isLoopback:r}}function T(e){let t=w(e);return t.isLoopback?w(n()).host:t.host}function re(e){return{...e,host:w(e.host).origin}}function ie(e){let t=w(e);if(t.isLoopback)return`http://localhost:3000`;if(t.host===`api.aventure.vc`)return`https://aventure.vc`;throw Error(`no first-party browser origin is configured for API host ${t.host}`)}function ae(e){return/^[a-z][a-z\d+.-]*:\/\//iu.test(e)}function oe(e){let t=e.split(`/`,1)[0]?.toLowerCase()??``;try{return E(new URL(`http://${t}`).hostname)?`http`:`https`}catch{return`https`}}function E(e){let t=e.toLowerCase();return t===`localhost`||t===`127.0.0.1`||t===`0.0.0.0`||t===`[::1]`}var D=l({createdAt:a({offset:!0}),description:c().nullish(),expiresAt:a({offset:!0}).nullish(),id:c().regex(/^ak_[0-9A-Fa-f]{32}$/),lastUsedAt:a({offset:!0}).nullish(),name:c(),revocationReason:c().nullish(),scopes:o(c()),status:s([`ACTIVE`,`REVOKED`,`EXPIRED`]),subject:c(),updatedAt:a({offset:!0})});function O(e,t=[]){let n=e instanceof Error?e.message:String(e);return d(n,t)}function se(e,t=[]){let n=d(e.title,t),r=d(e.detail?.trim()??``,t);return`${e.status} ${n}${r?` — ${r}`:``}`}function ce(){if(g()===`win32`){let e=process.env.APPDATA??m(h(),`AppData`,`Roaming`);return m(e,`aventure`,`config.json`)}let e=process.env.XDG_CONFIG_HOME??m(h(),`.config`);return m(e,`aventure`,`config.json`)}function le(){let e=process.env[r.authToken];return typeof e==`string`&&e.length>0?{present:!0,source:`env`}:{present:!1,source:null}}function k(e,t){return typeof e==`object`&&!!e&&`code`in e&&e.code===t}var ue=2;function de(e,t){return j(e,t).redactedUrl}async function fe(e,t,n){let r=j(e,t);return await A(new URL(r.openerUrl),n)}async function A(e,t){let n=t.environment??process.env,r=t.operatingSystem??g(),i=M(t.noBrowser,n,r);if(i!==null)return{state:`skipped`,reason:i};let a=pe(r,e.toString());if(a===null)return{state:`failed`,reason:`unsupported browser-opening platform: ${r}`};try{return await me(a.command,a.arguments),{state:`opened`,reason:null}}catch{return{state:`failed`,reason:`browser opener failed`}}}function j(e,t){let{id:n,verificationUrl:r,pollSecret:i}=e,a,o;try{a=new URL(r),o=new URL(t)}catch{throw Error(`broker returned an invalid browser verification URL`)}if(o.username.length>0||o.password.length>0||o.pathname!==`/`||o.search.length>0||o.hash.length>0)throw Error(`configured browser origin must contain only an origin`);let s=E(o.hostname);if(o.protocol!==`https:`&&!(o.protocol===`http:`&&s))throw Error(`configured browser origin must use HTTPS except for loopback development`);let c=new URLSearchParams(a.hash.slice(1)),l=[...c.keys()],u=c.getAll(`cliAuthorizationId`),d=c.getAll(`browserSecret`),f=d[0]??``;if(a.origin!==o.origin||a.protocol!==o.protocol||a.username.length>0||a.password.length>0||a.pathname!==`/settings/developer`||a.search.length>0||l.length!==ue||u.length!==1||u[0]!==n||d.length!==1||f.length===0||i.length===0||f===i)throw Error(`broker returned a browser verification URL outside the configured first-party approval flow`);let p;try{p=decodeURIComponent(r)}catch{throw Error(`broker returned a browser verification URL outside the configured first-party approval flow`)}if(r.includes(i)||p.includes(i))throw Error(`broker returned a browser verification URL outside the configured first-party approval flow`);let m=new URL(a);return m.hash=new URLSearchParams({cliAuthorizationId:n,browserSecret:`<redacted>`}).toString(),{openerUrl:r,redactedUrl:m.toString()}}function M(e,t,n){return e?`--no-browser was set`:n===`darwin`&&t.CODEX_SESSION_ID?`macOS Codex browser process boundary`:t.SSH_CONNECTION||t.SSH_CLIENT||t.SSH_TTY?`SSH/headless session detected`:(n===`linux`||n===`freebsd`)&&!t.DISPLAY&&!t.WAYLAND_DISPLAY?`no graphical display detected`:null}function pe(e,t){return e===`darwin`?{command:`open`,arguments:[t]}:e===`win32`?{command:`rundll32.exe`,arguments:[`url.dll,FileProtocolHandler`,t]}:e===`linux`||e===`freebsd`?{command:`xdg-open`,arguments:[t]}:null}function me(e,t){return new Promise((n,r)=>{f(e,[...t],{timeout:5e3,windowsHide:!0},e=>e?r(e):n())})}var he=100,N=3e4,ge=6e4,P=new ee;function F(){return m(p(ce()),`credentials.json`)}function I(e){return`OS keyring is unusable (${e}); the credential will be stored in ${F()} (mode 0600).\n`}async function L(e,t){let n=(await W())[e]?.[t];if(n!==void 0)return{record:{provider:`file`,value:n}};try{let n=await(await U(e,t)).getPassword()??void 0;return n===void 0?{}:{record:{provider:`keyring`,value:n}}}catch(e){return{keyringFailure:H(e)}}}async function R(e,t,n){if((await W())[e]?.[t]!==void 0)return await z(e,t,n,`file store holds this account`);let r;try{let i=await U(e,t);if(await i.setPassword(n),await i.getPassword()===n)return await q(e,t,void 0),`keyring`;r=`Error: keyring readback did not match`}catch(e){r=H(e,[n])}return await z(e,t,n,r)}async function z(e,t,n,r){if(await q(e,t,n),(await W())[e]?.[t]!==n)throw Error(`credential storage did not confirm a durable write (keyring: ${r}; file: readback did not match)`);return`file`}async function B(e,t){try{let n=await U(e,t),r;try{await n.deleteCredential()}catch(e){r=e}let i;try{i=await n.getPassword()??void 0}catch(e){throw Error(`OS keyring removal outcome is unknown (${H(r??e)})`,{cause:e})}if(i!==void 0)throw Error(`OS keyring did not confirm removal (${H(r)})`,r===void 0?void 0:{cause:r})}finally{await q(e,t,void 0)}}async function V(e,t){let n=`${t}:probe:${v()}`,r=`aventure-cli-credential-probe:${v()}`,i;try{let t=await U(e,n);await t.setPassword(r);let a=await(await U(e,n)).getPassword(),o=await t.deleteCredential(),s=await(await U(e,n)).getPassword()??void 0;if(a!==r)i=`Error: probe readback did not match`;else if(!o||s!==void 0)i=`Error: probe cleanup was not confirmed`;else return{provider:`keyring`}}catch(e){i=H(e,[r])}try{await K(async()=>{await q(e,n,r);let t=(await W())[e]?.[n];if(await q(e,n,void 0),t!==r)throw Error(`probe readback did not match`)})}catch(e){throw Error(`credential storage is unavailable (keyring: ${i}; file ${F()}: ${H(e,[r])})`,{cause:e})}return{provider:`file`,keyringFailure:i}}function H(e,t=[]){if(!(e instanceof Error))return`Error`;let n=e.name||`Error`,[r=``]=O(e,t).trim().split(`
1
+ import{o as e,r as t}from"./logging-D_7xwm_N.js";import{a as n,t as r,u as i}from"./env-gpTPURvt.js";import{i as a,l as o,o as s,w as c,y as l}from"./person-owner-BJgNYLKX.js";import{a as u}from"./package-DPDX5zmx.js";import{r as d}from"./response-problem-D6NByFDg.js";import{execFile as f}from"node:child_process";import{dirname as p,join as m}from"node:path";import{homedir as h,platform as g}from"node:os";import{setTimeout as _}from"node:timers/promises";import{randomUUID as v}from"node:crypto";import{AsyncLocalStorage as ee}from"node:async_hooks";import{chmod as te,mkdir as y,readFile as b,rename as x,rm as S,stat as ne,writeFile as C}from"node:fs/promises";function w(e){let t=e.trim();if(t.length===0)throw Error(`API host must not be blank`);let n=new URL(ae(t)?t:`${oe(t)}://${t}`),r=E(n.hostname);if(n.protocol!==`https:`&&n.protocol!==`http:`||n.username.length>0||n.password.length>0||n.pathname!==`/`&&n.pathname!==``||n.search.length>0||n.hash.length>0)throw Error(`API host must contain only an HTTP(S) host and optional port`);if(n.protocol===`http:`&&!r)throw Error(`stored credentials require HTTPS except for loopback API hosts`);return{host:n.host.toLowerCase(),origin:n.origin,isLoopback:r}}function T(e){let t=w(e);return t.isLoopback?w(n()).host:t.host}function re(e){return{...e,host:w(e.host).origin}}function ie(e){let t=w(e);if(t.isLoopback)return`http://localhost:3000`;if(t.host===`api.aventure.vc`)return`https://aventure.vc`;throw Error(`no first-party browser origin is configured for API host ${t.host}`)}function ae(e){return/^[a-z][a-z\d+.-]*:\/\//iu.test(e)}function oe(e){let t=e.split(`/`,1)[0]?.toLowerCase()??``;try{return E(new URL(`http://${t}`).hostname)?`http`:`https`}catch{return`https`}}function E(e){let t=e.toLowerCase();return t===`localhost`||t===`127.0.0.1`||t===`0.0.0.0`||t===`[::1]`}var D=l({createdAt:a({offset:!0}),description:c().nullish(),expiresAt:a({offset:!0}).nullish(),id:c().regex(/^ak_[0-9A-Fa-f]{32}$/),lastUsedAt:a({offset:!0}).nullish(),name:c(),revocationReason:c().nullish(),scopes:o(c()),status:s([`ACTIVE`,`REVOKED`,`EXPIRED`]),subject:c(),updatedAt:a({offset:!0})});function O(e,t=[]){let n=e instanceof Error?e.message:String(e);return d(n,t)}function se(e,t=[]){let n=d(e.title,t),r=d(e.detail?.trim()??``,t);return`${e.status} ${n}${r?` — ${r}`:``}`}function ce(){if(g()===`win32`){let e=process.env.APPDATA??m(h(),`AppData`,`Roaming`);return m(e,`aventure`,`config.json`)}let e=process.env.XDG_CONFIG_HOME??m(h(),`.config`);return m(e,`aventure`,`config.json`)}function le(){let e=process.env[r.authToken];return typeof e==`string`&&e.length>0?{present:!0,source:`env`}:{present:!1,source:null}}function k(e,t){return typeof e==`object`&&!!e&&`code`in e&&e.code===t}var ue=2;function de(e,t){return j(e,t).redactedUrl}async function fe(e,t,n){let r=j(e,t);return await A(new URL(r.openerUrl),n)}async function A(e,t){let n=t.environment??process.env,r=t.operatingSystem??g(),i=M(t.noBrowser,n,r);if(i!==null)return{state:`skipped`,reason:i};let a=pe(r,e.toString());if(a===null)return{state:`failed`,reason:`unsupported browser-opening platform: ${r}`};try{return await me(a.command,a.arguments),{state:`opened`,reason:null}}catch{return{state:`failed`,reason:`browser opener failed`}}}function j(e,t){let{id:n,verificationUrl:r,pollSecret:i}=e,a,o;try{a=new URL(r),o=new URL(t)}catch{throw Error(`broker returned an invalid browser verification URL`)}if(o.username.length>0||o.password.length>0||o.pathname!==`/`||o.search.length>0||o.hash.length>0)throw Error(`configured browser origin must contain only an origin`);let s=E(o.hostname);if(o.protocol!==`https:`&&!(o.protocol===`http:`&&s))throw Error(`configured browser origin must use HTTPS except for loopback development`);let c=new URLSearchParams(a.hash.slice(1)),l=[...c.keys()],u=c.getAll(`cliAuthorizationId`),d=c.getAll(`browserSecret`),f=d[0]??``;if(a.origin!==o.origin||a.protocol!==o.protocol||a.username.length>0||a.password.length>0||a.pathname!==`/settings/developer`||a.search.length>0||l.length!==ue||u.length!==1||u[0]!==n||d.length!==1||f.length===0||i.length===0||f===i)throw Error(`broker returned a browser verification URL outside the configured first-party approval flow`);let p;try{p=decodeURIComponent(r)}catch{throw Error(`broker returned a browser verification URL outside the configured first-party approval flow`)}if(r.includes(i)||p.includes(i))throw Error(`broker returned a browser verification URL outside the configured first-party approval flow`);let m=new URL(a);return m.hash=new URLSearchParams({cliAuthorizationId:n,browserSecret:`<redacted>`}).toString(),{openerUrl:r,redactedUrl:m.toString()}}function M(e,t,n){return e?`--no-browser was set`:n===`darwin`&&t.CODEX_SESSION_ID?`macOS Codex browser process boundary`:t.SSH_CONNECTION||t.SSH_CLIENT||t.SSH_TTY?`SSH/headless session detected`:(n===`linux`||n===`freebsd`)&&!t.DISPLAY&&!t.WAYLAND_DISPLAY?`no graphical display detected`:null}function pe(e,t){return e===`darwin`?{command:`open`,arguments:[t]}:e===`win32`?{command:`rundll32.exe`,arguments:[`url.dll,FileProtocolHandler`,t]}:e===`linux`||e===`freebsd`?{command:`xdg-open`,arguments:[t]}:null}function me(e,t){return new Promise((n,r)=>{f(e,[...t],{timeout:5e3,windowsHide:!0},e=>e?r(e):n())})}var he=100,N=3e4,ge=6e4,P=new ee;function F(){return m(p(ce()),`credentials.json`)}function I(e){return`OS keyring is unusable (${e}); the credential will be stored in ${F()} (mode 0600).\n`}async function L(e,t){let n=(await W())[e]?.[t];if(n!==void 0)return{record:{provider:`file`,value:n}};try{let n=await(await U(e,t)).getPassword()??void 0;return n===void 0?{}:{record:{provider:`keyring`,value:n}}}catch(e){return{keyringFailure:H(e)}}}async function R(e,t,n){if((await W())[e]?.[t]!==void 0)return await z(e,t,n,`file store holds this account`);let r;try{let i=await U(e,t);if(await i.setPassword(n),await i.getPassword()===n)return await q(e,t,void 0),`keyring`;r=`Error: keyring readback did not match`}catch(e){r=H(e,[n])}return await z(e,t,n,r)}async function z(e,t,n,r){if(await q(e,t,n),(await W())[e]?.[t]!==n)throw Error(`credential storage did not confirm a durable write (keyring: ${r}; file: readback did not match)`);return`file`}async function B(e,t){try{let n=await U(e,t),r;try{await n.deleteCredential()}catch(e){r=e}let i;try{i=await n.getPassword()??void 0}catch(e){throw Error(`OS keyring removal outcome is unknown (${H(r??e)})`,{cause:e})}if(i!==void 0)throw Error(`OS keyring did not confirm removal (${H(r)})`,r===void 0?void 0:{cause:r})}finally{await q(e,t,void 0)}}async function V(e,t){let n=`${t}:probe:${v()}`,r=`aventure-cli-credential-probe:${v()}`,i;try{let t=await U(e,n);await t.setPassword(r);let a=await(await U(e,n)).getPassword(),o=await t.deleteCredential(),s=await(await U(e,n)).getPassword()??void 0;if(a!==r)i=`Error: probe readback did not match`;else if(!o||s!==void 0)i=`Error: probe cleanup was not confirmed`;else return{provider:`keyring`}}catch(e){i=H(e,[r])}try{await K(async()=>{await q(e,n,r);let t=(await W())[e]?.[n];if(await q(e,n,void 0),t!==r)throw Error(`probe readback did not match`)})}catch(e){throw Error(`credential storage is unavailable (keyring: ${i}; file ${F()}: ${H(e,[r])})`,{cause:e})}return{provider:`file`,keyringFailure:i}}function H(e,t=[]){if(!(e instanceof Error))return`Error`;let n=e.name||`Error`,[r=``]=O(e,t).trim().split(`
2
2
  `,1);return r&&r!==n?`${n}: ${r}`:n}async function U(e,t){let n=g(),r=n===`linux`||n===`freebsd`?M(!1,process.env,n):null;if(r!==null)throw Error(`OS keyring unlock prompt is unreachable (${r})`);let{AsyncEntry:i}=await import(`@napi-rs/keyring`);return new i(e,t)}async function W(){let e=F(),t;try{t=await b(e,`utf8`)}catch(e){if(k(e,`ENOENT`))return{};throw e}let n;try{n=JSON.parse(t)}catch(t){return await G(e,t)}return ve(n)?n:await G(e,void 0)}async function G(t,n){let r=`${t}.corrupt-${new Date().toISOString().replace(/[:.]/gu,`-`)}`;try{await x(t,r)}catch(e){if(k(e,`ENOENT`))return{};throw Error(`${t} is not a valid credential file and could not be moved aside`,{cause:e})}return e({component:u().bin[0],event:`credential_file_quarantined`,message:`${t} is not a valid credential file; moved it to ${r} and continuing with an empty file store`,...n===void 0?{}:{error:n}}),{}}async function K(e){if(P.getStore()===!0)return await e();let t=`${F()}.lock`;await y(p(t),{recursive:!0,mode:448});let n=Date.now()+N,r=v();for(;;){try{await C(t,r,{flag:`wx`,mode:384});break}catch(e){if(!k(e,`EEXIST`))throw e}if(await ne(t).then(e=>Date.now()-e.mtimeMs,()=>0)>ge)await S(t,{force:!0});else if(Date.now()>n)throw Error(`credential store is locked by another CLI process (${t})`);else await _(he)}try{return await P.run(!0,e)}finally{await b(t,`utf8`).catch(()=>``)===r&&await S(t,{force:!0})}}async function q(e,t,n){await K(async()=>await _e(e,t,n))}async function _e(e,t,n){let r=F(),i=await W(),a={...i[e]};if(n===void 0?delete a[t]:a[t]=n,Object.keys(a).length===0?delete i[e]:i[e]=a,Object.keys(i).length===0){await S(r,{force:!0});return}await y(p(r),{recursive:!0,mode:448});let o=`${r}.${v()}.tmp`;await C(o,`${JSON.stringify(i,null,2)}\n`,{mode:384}),await te(o,384),await x(o,r)}function ve(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.values(e).every(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.values(e).every(e=>typeof e==`string`))}var J=`vc.aventure.aventure-cli`,Y=`aventure-cli-personal-v1`;async function ye(e,t,n){let r=T(e),i=Se(t,n),a;try{a=await R(J,r,i)}catch(e){throw Error(`${O(e,[i,t.secret])}; broker acknowledgment was withheld. Re-run auth status before retrying.`,{cause:e})}return{host:r,provider:a,activation:n,credential:t}}async function X(e){let t=T(e),n;try{n=await L(J,t)}catch(e){return Z(O(e))}let{record:r,keyringFailure:i}=n;return r===void 0?i===void 0?{state:`missing`}:{state:`missing`,keyringFailure:i}:{state:`found`,stored:{host:t,provider:r.provider,...Ce(r.value)}}}async function be(e){let t=await X(e);if(t.state!==`missing`)return t;try{let{keyringFailure:t}=await V(J,T(e));return t===void 0?{state:`missing`}:{state:`missing`,keyringFailure:t}}catch(e){return Z(O(e))}}async function xe(e){await B(J,T(e))}function Z(e){return{state:`unavailable`,summary:e,cause:`storage`}}function Se(e,t){return`${Y}:${t}\n${JSON.stringify(e.apiKey)}\n${e.secret}`}function Ce(e){let t=e.indexOf(`
3
3
  `),n=t<0?-1:e.indexOf(`
4
4
  `,t+1),r=t<0?e:e.slice(0,t),i=r===`${Y}:active`?`active`:`pending`;if(t<0||n<0||r!==`${Y}:pending`&&r!==`${Y}:active`)throw Error(`OS credential entry has an unsupported format`);let a=e.slice(n+1);if(a.length===0)throw Error(`OS credential entry has an empty secret`);let o;try{o=JSON.parse(e.slice(t+1,n))}catch(e){throw Error(`OS credential entry failed canonical schema validation`,{cause:e})}let s=D.safeParse(o);if(!s.success)throw Error(`OS credential entry failed canonical schema validation`,{cause:s.error});return{activation:i,credential:{apiKey:s.data,secret:a}}}async function we(n){if(Q())return;let a=T(i().host);try{let e=await X(a);if(e.state===`unavailable`){t($(`keyring`,Error(e.summary)));return}e.state===`found`&&e.stored.activation===`active`&&!Q()&&(process.env[r.authToken]=e.stored.credential.secret,n?.(`api-key`))}catch(t){e($(`parse`,t))}}function Q(){return(process.env[r.authToken]?.trim().length??0)>0}function $(e,t){return{component:u().bin[0],event:`api_key_materialization_unavailable`,message:`saved API key could not be loaded; continuing with environment auth`,fields:{source:e},error:t}}export{re as S,se as _,ye as a,w as b,V as c,R as d,A as f,O as g,le as h,X as i,L as l,de as m,xe as n,B as o,fe as p,be as r,I as s,we as t,K as u,D as v,T as x,ie as y};