@vm0/cli 9.269.4 → 9.270.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/{agent-65YWPVBH.js → agent-GWRPSBTH.js} +6 -6
  2. package/{banking-FY4VYU53.js → banking-P6SCAW3O.js} +4 -4
  3. package/{browser-MNHJEMDA.js → browser-JY5OKWWH.js} +4 -4
  4. package/{chat-I4BOM4PE.js → chat-7RH3RGZQ.js} +5 -5
  5. package/{chunk-2J4CAMQV.js → chunk-4PFAYD37.js} +269 -224
  6. package/chunk-4PFAYD37.js.map +1 -0
  7. package/{chunk-L6MOA3RG.js → chunk-6AA2D344.js} +2 -2
  8. package/{chunk-3PIT5M5L.js → chunk-72ZGOFYI.js} +2 -2
  9. package/{chunk-W6UHMLBM.js → chunk-IWQVF27E.js} +2 -2
  10. package/{chunk-2EF4BXLJ.js → chunk-JSH7H3SB.js} +14 -2
  11. package/chunk-JSH7H3SB.js.map +1 -0
  12. package/{chunk-46U457KT.js → chunk-JUE2IIB6.js} +2 -2
  13. package/chunk-JUE2IIB6.js.map +1 -0
  14. package/{chunk-HPIFUDM3.js → chunk-NGVPA5PP.js} +88 -27
  15. package/chunk-NGVPA5PP.js.map +1 -0
  16. package/{chunk-FEI7ZJ5N.js → chunk-P46KNOFG.js} +2 -2
  17. package/{chunk-VKL5BLSI.js → chunk-W25EDDGL.js} +2 -2
  18. package/{chunk-ADUPVKAW.js → chunk-WFGX6IFZ.js} +2 -2
  19. package/{computer-use-WLFY3UFR.js → computer-use-KIPDCGWU.js} +4 -4
  20. package/{connector-FPYSJ7H6.js → connector-Y5RELY3X.js} +266 -46
  21. package/connector-Y5RELY3X.js.map +1 -0
  22. package/{credit-IIETH67M.js → credit-PYPLO2DH.js} +5 -5
  23. package/{developer-support-3SQS3W3Z.js → developer-support-BTVJRES3.js} +4 -4
  24. package/{doctor-JP6CR75D.js → doctor-6O6JP2WS.js} +5 -5
  25. package/{feishu-2HI256M7.js → feishu-JED4BVTP.js} +4 -4
  26. package/{finance-U63H4M7F.js → finance-3FHYRVG2.js} +4 -4
  27. package/{generate-NO3JSBW4.js → generate-37C27FP7.js} +5 -5
  28. package/{github-GZSZZXUK.js → github-EH2LQE7I.js} +4 -4
  29. package/{goal-4YSCRX3J.js → goal-XECU5EWN.js} +4 -4
  30. package/{host-IQB22QMQ.js → host-NEOIQLMT.js} +4 -4
  31. package/{logs-VA633M3U.js → logs-ETQTIIG4.js} +6 -6
  32. package/{mail-DCTPARYZ.js → mail-PZKZHOCR.js} +6 -6
  33. package/{maps-6ZFLY66W.js → maps-7M6YJZYG.js} +4 -4
  34. package/{model-IO4RD5HS.js → model-PGAUO6W5.js} +5 -5
  35. package/{model-provider-XKZC5QQW.js → model-provider-W5UVHH6U.js} +5 -5
  36. package/{org-4HXWUQ42.js → org-EUVQDJTX.js} +4 -4
  37. package/package.json +1 -1
  38. package/{people-search-7NTOQRBP.js → people-search-ZN6RLZXA.js} +4 -4
  39. package/{phone-KCECOM5T.js → phone-HXFIS3AF.js} +4 -4
  40. package/{preference-RO7LY22A.js → preference-PRQX4SKA.js} +4 -4
  41. package/{resource-JI6CFPOS.js → resource-JY6BVLHP.js} +4 -4
  42. package/{scrape-6N3CCAN5.js → scrape-K4JOJDHX.js} +4 -4
  43. package/{search-54WHPCTB.js → search-REY6675M.js} +6 -6
  44. package/{secret-53D676RF.js → secret-IHJS2ING.js} +4 -4
  45. package/{slack-HVMT6SK2.js → slack-JTSV74J5.js} +4 -4
  46. package/{teams-RUCHAD6W.js → teams-7WJFP33N.js} +4 -4
  47. package/{telegram-HFENZF6A.js → telegram-AC6MPDBH.js} +4 -4
  48. package/{upgrade-XFNYW6DI.js → upgrade-RHBB33B6.js} +3 -3
  49. package/{variable-HBXLBBME.js → variable-7T7HFEXZ.js} +4 -4
  50. package/{video-6XO2L3KX.js → video-KAR3CSKG.js} +3 -3
  51. package/{weather-UGBA3KJM.js → weather-2TV7QHNI.js} +4 -4
  52. package/{web-43RDKXAC.js → web-SHKUVKKL.js} +4 -4
  53. package/{web-search-M3JFWHRU.js → web-search-TLA5G6MO.js} +4 -4
  54. package/{whoami-6NSJEBTV.js → whoami-E7OQS7EL.js} +6 -6
  55. package/{workflow-QSAO3U3D.js → workflow-J5PQ5AXJ.js} +5 -5
  56. package/zero.js +44 -44
  57. package/zero.js.map +1 -1
  58. package/chunk-2EF4BXLJ.js.map +0 -1
  59. package/chunk-2J4CAMQV.js.map +0 -1
  60. package/chunk-46U457KT.js.map +0 -1
  61. package/chunk-HPIFUDM3.js.map +0 -1
  62. package/connector-FPYSJ7H6.js.map +0 -1
  63. /package/{agent-65YWPVBH.js.map → agent-GWRPSBTH.js.map} +0 -0
  64. /package/{banking-FY4VYU53.js.map → banking-P6SCAW3O.js.map} +0 -0
  65. /package/{browser-MNHJEMDA.js.map → browser-JY5OKWWH.js.map} +0 -0
  66. /package/{chat-I4BOM4PE.js.map → chat-7RH3RGZQ.js.map} +0 -0
  67. /package/{chunk-L6MOA3RG.js.map → chunk-6AA2D344.js.map} +0 -0
  68. /package/{chunk-3PIT5M5L.js.map → chunk-72ZGOFYI.js.map} +0 -0
  69. /package/{chunk-W6UHMLBM.js.map → chunk-IWQVF27E.js.map} +0 -0
  70. /package/{chunk-FEI7ZJ5N.js.map → chunk-P46KNOFG.js.map} +0 -0
  71. /package/{chunk-VKL5BLSI.js.map → chunk-W25EDDGL.js.map} +0 -0
  72. /package/{chunk-ADUPVKAW.js.map → chunk-WFGX6IFZ.js.map} +0 -0
  73. /package/{computer-use-WLFY3UFR.js.map → computer-use-KIPDCGWU.js.map} +0 -0
  74. /package/{credit-IIETH67M.js.map → credit-PYPLO2DH.js.map} +0 -0
  75. /package/{developer-support-3SQS3W3Z.js.map → developer-support-BTVJRES3.js.map} +0 -0
  76. /package/{doctor-JP6CR75D.js.map → doctor-6O6JP2WS.js.map} +0 -0
  77. /package/{feishu-2HI256M7.js.map → feishu-JED4BVTP.js.map} +0 -0
  78. /package/{finance-U63H4M7F.js.map → finance-3FHYRVG2.js.map} +0 -0
  79. /package/{generate-NO3JSBW4.js.map → generate-37C27FP7.js.map} +0 -0
  80. /package/{github-GZSZZXUK.js.map → github-EH2LQE7I.js.map} +0 -0
  81. /package/{goal-4YSCRX3J.js.map → goal-XECU5EWN.js.map} +0 -0
  82. /package/{host-IQB22QMQ.js.map → host-NEOIQLMT.js.map} +0 -0
  83. /package/{logs-VA633M3U.js.map → logs-ETQTIIG4.js.map} +0 -0
  84. /package/{mail-DCTPARYZ.js.map → mail-PZKZHOCR.js.map} +0 -0
  85. /package/{maps-6ZFLY66W.js.map → maps-7M6YJZYG.js.map} +0 -0
  86. /package/{model-IO4RD5HS.js.map → model-PGAUO6W5.js.map} +0 -0
  87. /package/{model-provider-XKZC5QQW.js.map → model-provider-W5UVHH6U.js.map} +0 -0
  88. /package/{org-4HXWUQ42.js.map → org-EUVQDJTX.js.map} +0 -0
  89. /package/{people-search-7NTOQRBP.js.map → people-search-ZN6RLZXA.js.map} +0 -0
  90. /package/{phone-KCECOM5T.js.map → phone-HXFIS3AF.js.map} +0 -0
  91. /package/{preference-RO7LY22A.js.map → preference-PRQX4SKA.js.map} +0 -0
  92. /package/{resource-JI6CFPOS.js.map → resource-JY6BVLHP.js.map} +0 -0
  93. /package/{scrape-6N3CCAN5.js.map → scrape-K4JOJDHX.js.map} +0 -0
  94. /package/{search-54WHPCTB.js.map → search-REY6675M.js.map} +0 -0
  95. /package/{secret-53D676RF.js.map → secret-IHJS2ING.js.map} +0 -0
  96. /package/{slack-HVMT6SK2.js.map → slack-JTSV74J5.js.map} +0 -0
  97. /package/{teams-RUCHAD6W.js.map → teams-7WJFP33N.js.map} +0 -0
  98. /package/{telegram-HFENZF6A.js.map → telegram-AC6MPDBH.js.map} +0 -0
  99. /package/{upgrade-XFNYW6DI.js.map → upgrade-RHBB33B6.js.map} +0 -0
  100. /package/{variable-HBXLBBME.js.map → variable-7T7HFEXZ.js.map} +0 -0
  101. /package/{video-6XO2L3KX.js.map → video-KAR3CSKG.js.map} +0 -0
  102. /package/{weather-UGBA3KJM.js.map → weather-2TV7QHNI.js.map} +0 -0
  103. /package/{web-43RDKXAC.js.map → web-SHKUVKKL.js.map} +0 -0
  104. /package/{web-search-M3JFWHRU.js.map → web-search-TLA5G6MO.js.map} +0 -0
  105. /package/{whoami-6NSJEBTV.js.map → whoami-E7OQS7EL.js.map} +0 -0
  106. /package/{workflow-QSAO3U3D.js.map → workflow-J5PQ5AXJ.js.map} +0 -0
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from "node:module";
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  getApiUrl
6
- } from "./chunk-46U457KT.js";
6
+ } from "./chunk-JUE2IIB6.js";
7
7
  import {
8
8
  init_esm_shims
9
9
  } from "./chunk-GPYQ24DR.js";
@@ -42,4 +42,4 @@ export {
42
42
  toPlatformUrl,
43
43
  getPlatformOrigin
44
44
  };
45
- //# sourceMappingURL=chunk-FEI7ZJ5N.js.map
45
+ //# sourceMappingURL=chunk-P46KNOFG.js.map
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from "node:module";
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  MODEL_PROVIDER_TYPES
6
- } from "./chunk-46U457KT.js";
6
+ } from "./chunk-JUE2IIB6.js";
7
7
  import {
8
8
  init_esm_shims
9
9
  } from "./chunk-GPYQ24DR.js";
@@ -40,4 +40,4 @@ export {
40
40
  formatModelProviderRoute,
41
41
  formatModelPolicyStatus
42
42
  };
43
- //# sourceMappingURL=chunk-VKL5BLSI.js.map
43
+ //# sourceMappingURL=chunk-W25EDDGL.js.map
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from "node:module";
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  source_default
6
- } from "./chunk-46U457KT.js";
6
+ } from "./chunk-JUE2IIB6.js";
7
7
  import {
8
8
  init_esm_shims
9
9
  } from "./chunk-GPYQ24DR.js";
@@ -19,4 +19,4 @@ function policyIcon(policy) {
19
19
  export {
20
20
  policyIcon
21
21
  };
22
- //# sourceMappingURL=chunk-ADUPVKAW.js.map
22
+ //# sourceMappingURL=chunk-WFGX6IFZ.js.map
@@ -12,12 +12,12 @@ import {
12
12
  fetchComputerUseScreenshot,
13
13
  getComputerUseCommand,
14
14
  listComputerUseHosts
15
- } from "./chunk-HPIFUDM3.js";
16
- import "./chunk-3PIT5M5L.js";
15
+ } from "./chunk-NGVPA5PP.js";
16
+ import "./chunk-72ZGOFYI.js";
17
17
  import {
18
18
  ApiRequestError,
19
19
  withErrorHandler
20
- } from "./chunk-46U457KT.js";
20
+ } from "./chunk-JUE2IIB6.js";
21
21
  import "./chunk-ZUHSC7WF.js";
22
22
  import {
23
23
  Command
@@ -970,4 +970,4 @@ export {
970
970
  formatComputerUseResultForConsole,
971
971
  zeroComputerUseCommand
972
972
  };
973
- //# sourceMappingURL=computer-use-WLFY3UFR.js.map
973
+ //# sourceMappingURL=computer-use-KIPDCGWU.js.map
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from "node:module";
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  hasConnectorFirewallMetadataPermission
6
- } from "./chunk-W6UHMLBM.js";
6
+ } from "./chunk-IWQVF27E.js";
7
7
  import {
8
8
  CALLBACK_PROMPT_PLACEHOLDER,
9
9
  addRequestedCallbackSearchParams,
@@ -18,13 +18,17 @@ import {
18
18
  resolveConnectorDiscoveryAgentContext,
19
19
  resolveManualGrantAuthMethod,
20
20
  searchConnectorCatalog
21
- } from "./chunk-L6MOA3RG.js";
21
+ } from "./chunk-6AA2D344.js";
22
22
  import {
23
23
  UNKNOWN_PERMISSION_GRANT,
24
+ addZeroAgentCustomConnector,
24
25
  connectZeroConnectorManualGrant,
25
26
  createBrowserAuthorizationRequest,
26
27
  createComputerUseAuthorizationRequest,
27
- customConnectorProposalSchema,
28
+ createZeroCustomConnector,
29
+ customConnectorAuthModeSchema,
30
+ customConnectorOAuthConfigInputSchema,
31
+ customConnectorValueInputSchema,
28
32
  diagnoseZeroConnectorCheck,
29
33
  getZeroAgent,
30
34
  getZeroAgentCustomConnectors,
@@ -33,21 +37,26 @@ import {
33
37
  getZeroConnectorCatalogPermissions,
34
38
  getZeroCustomConnector,
35
39
  listZeroConnectorCatalogStatus,
36
- listZeroCustomConnectors
37
- } from "./chunk-HPIFUDM3.js";
38
- import "./chunk-3PIT5M5L.js";
40
+ listZeroCustomConnectors,
41
+ setZeroCustomConnectorValues,
42
+ startZeroCustomConnectorOAuth2,
43
+ updateCustomConnectorBodySchema
44
+ } from "./chunk-NGVPA5PP.js";
45
+ import "./chunk-72ZGOFYI.js";
39
46
  import {
40
47
  getPlatformOrigin,
41
48
  toPlatformUrl
42
- } from "./chunk-FEI7ZJ5N.js";
49
+ } from "./chunk-P46KNOFG.js";
43
50
  import "./chunk-MA22KQYU.js";
44
51
  import {
45
52
  ApiRequestError,
46
53
  getApiUrl,
47
54
  source_default,
48
55
  withErrorHandler
49
- } from "./chunk-46U457KT.js";
50
- import "./chunk-ZUHSC7WF.js";
56
+ } from "./chunk-JUE2IIB6.js";
57
+ import {
58
+ decodeZeroTokenPayload
59
+ } from "./chunk-ZUHSC7WF.js";
51
60
  import {
52
61
  Command,
53
62
  Option
@@ -1244,7 +1253,253 @@ var statusCommand = new Command().name("status").description("Show detailed stat
1244
1253
 
1245
1254
  // src/commands/zero/connector/custom/index.ts
1246
1255
  init_esm_shims();
1256
+
1257
+ // src/commands/zero/connector/custom/create.ts
1258
+ init_esm_shims();
1247
1259
  import { readFile } from "fs/promises";
1260
+ var customConnectorDefinitionSchema = updateCustomConnectorBodySchema.omit({
1261
+ authMode: true,
1262
+ oauthConfig: true
1263
+ });
1264
+ var manualCustomConnectorCreateSchema = customConnectorDefinitionSchema.extend({
1265
+ authMode: customConnectorAuthModeSchema.extract(["manual"]),
1266
+ values: customConnectorValueInputSchema.array()
1267
+ }).strict();
1268
+ var oauthCreateConfigSchema = customConnectorOAuthConfigInputSchema.required({
1269
+ clientSecret: true
1270
+ });
1271
+ var oauthCustomConnectorCreateSchema = customConnectorDefinitionSchema.extend({
1272
+ authMode: customConnectorAuthModeSchema.extract(["oauth"]),
1273
+ oauthConfig: oauthCreateConfigSchema,
1274
+ values: customConnectorValueInputSchema.array()
1275
+ }).strict();
1276
+ var customConnectorCreateSchema = manualCustomConnectorCreateSchema.or(
1277
+ oauthCustomConnectorCreateSchema
1278
+ );
1279
+ function requireCustomConnectorWriteCapability() {
1280
+ const payload = decodeZeroTokenPayload();
1281
+ if (payload && !payload.capabilities.includes("connector:write")) {
1282
+ throw new Error(
1283
+ "Custom connector creation is not enabled for this agent run"
1284
+ );
1285
+ }
1286
+ }
1287
+ function valueMarker(value) {
1288
+ return `${value.kind}:${value.key}`;
1289
+ }
1290
+ function validateValues(definition) {
1291
+ const fields = new Map(
1292
+ definition.fields.map((field) => {
1293
+ return [valueMarker(field), field];
1294
+ })
1295
+ );
1296
+ const provided = /* @__PURE__ */ new Set();
1297
+ for (const value of definition.values) {
1298
+ const marker = valueMarker(value);
1299
+ if (!fields.has(marker)) {
1300
+ throw new Error(`Unknown custom connector value: ${marker}`);
1301
+ }
1302
+ if (provided.has(marker)) {
1303
+ throw new Error(`Duplicate custom connector value: ${marker}`);
1304
+ }
1305
+ provided.add(marker);
1306
+ }
1307
+ const missing = definition.fields.flatMap((field) => {
1308
+ const marker = valueMarker(field);
1309
+ return field.required && !provided.has(marker) ? [marker] : [];
1310
+ });
1311
+ if (missing.length > 0) {
1312
+ throw new Error(
1313
+ `Missing required custom connector values: ${missing.join(", ")}`
1314
+ );
1315
+ }
1316
+ }
1317
+ function printCreateResult(result, json) {
1318
+ if (json) {
1319
+ console.log(JSON.stringify(result, null, 2));
1320
+ return;
1321
+ }
1322
+ console.log(
1323
+ source_default.green(`\u2713 Custom connector "${result.connector.displayName}" created`)
1324
+ );
1325
+ console.log(source_default.dim(` ID: ${result.connector.id}`));
1326
+ console.log(source_default.dim(` Slug: ${result.connector.slug}`));
1327
+ console.log(
1328
+ source_default.dim(` Authentication: ${result.connector.authMode ?? "manual"}`)
1329
+ );
1330
+ console.log(
1331
+ source_default.dim(
1332
+ ` Status: ${result.connector.connected ? "connected" : "awaiting authorization"}`
1333
+ )
1334
+ );
1335
+ if (result.agentId && !result.authorizationUrl) {
1336
+ console.log(source_default.dim(` Agent: ${result.agentId} (authorized)`));
1337
+ }
1338
+ if (!result.authorizationUrl) {
1339
+ return;
1340
+ }
1341
+ console.log();
1342
+ console.log("Complete OAuth authorization:");
1343
+ console.log(
1344
+ ` [Authorize ${result.connector.displayName}](${result.authorizationUrl})`
1345
+ );
1346
+ if (result.agentId) {
1347
+ console.log(
1348
+ source_default.dim(
1349
+ ` Approval will also authorize this connector for agent ${result.agentId}.`
1350
+ )
1351
+ );
1352
+ }
1353
+ }
1354
+ async function createManualCustomConnector(definition, agentId) {
1355
+ validateValues(definition);
1356
+ const { values, ...body } = definition;
1357
+ const created = await createZeroCustomConnector(body);
1358
+ const connector = await setZeroCustomConnectorValues(created.id, values);
1359
+ if (agentId) {
1360
+ await addZeroAgentCustomConnector(agentId, connector.id);
1361
+ }
1362
+ return {
1363
+ connector,
1364
+ ...agentId ? { agentId } : {}
1365
+ };
1366
+ }
1367
+ async function createOAuthCustomConnector(definition, agentId) {
1368
+ const { values, ...body } = definition;
1369
+ if (body.fields.length > 0 || values.length > 0) {
1370
+ throw new Error(
1371
+ "OAuth custom connectors require empty fields and values arrays"
1372
+ );
1373
+ }
1374
+ const created = await createZeroCustomConnector(body);
1375
+ const authorizationUrl = await startZeroCustomConnectorOAuth2(
1376
+ created.id,
1377
+ agentId
1378
+ );
1379
+ return {
1380
+ connector: created,
1381
+ authorizationUrl,
1382
+ ...agentId ? { agentId } : {}
1383
+ };
1384
+ }
1385
+ var createCustomConnectorCommand = new Command().name("create").description(
1386
+ "Create and configure a manual or OAuth custom connector from JSON"
1387
+ ).requiredOption(
1388
+ "-f, --file <path>",
1389
+ "JSON file containing the connector definition and credentials"
1390
+ ).option(
1391
+ "--agent <id>",
1392
+ "Authorize this agent (defaults to ZERO_AGENT_ID when available)"
1393
+ ).option("--json", "Print the connector and authorization result as JSON").addHelpText(
1394
+ "after",
1395
+ `
1396
+ File format:
1397
+ The file must contain one complete connector definition. The agent should
1398
+ generate this file from the user's requirements and credentials.
1399
+
1400
+ Agent workflow:
1401
+ 1. Ask the user in chat only for missing API details and credentials.
1402
+ 2. Derive the prefixes, fields, injections, and OAuth settings.
1403
+ 3. Write a temporary JSON file, run this command, then remove the file.
1404
+ The user should not need to write JSON or run this command.
1405
+
1406
+ Common fields:
1407
+ displayName Human-readable connector name
1408
+ prefixTemplates Allowed HTTPS API URL prefixes
1409
+ fields Inputs referenced by manual templates
1410
+ headerInjections Headers added to matching requests
1411
+ queryInjections Query parameters added to matching requests
1412
+ authMode "manual" or "oauth"
1413
+
1414
+ Manual mode:
1415
+ Add a values array with one entry for every required field. References use
1416
+ {{secrets.KEY}} or {{variables.KEY}}. The command creates the connector,
1417
+ stores the values, and authorizes --agent in one flow.
1418
+
1419
+ {
1420
+ "displayName": "Acme API",
1421
+ "prefixTemplates": ["https://api.acme.example/v1/"],
1422
+ "fields": [
1423
+ {
1424
+ "key": "api_key",
1425
+ "label": "API key",
1426
+ "kind": "secret",
1427
+ "required": true
1428
+ }
1429
+ ],
1430
+ "headerInjections": [
1431
+ {
1432
+ "name": "Authorization",
1433
+ "valueTemplate": "Bearer {{secrets.api_key}}"
1434
+ }
1435
+ ],
1436
+ "queryInjections": [],
1437
+ "authMode": "manual",
1438
+ "values": [
1439
+ { "key": "api_key", "kind": "secret", "value": "<user-api-key>" }
1440
+ ]
1441
+ }
1442
+
1443
+ OAuth mode:
1444
+ Use {{oauth.access_token}} in an injection and provide the complete OAuth
1445
+ client configuration. OAuth mode requires empty fields and values arrays.
1446
+ The command prints an authorization link. If --agent is set, completing
1447
+ OAuth also authorizes that agent.
1448
+
1449
+ {
1450
+ "displayName": "Acme OAuth API",
1451
+ "prefixTemplates": ["https://api.acme.example/v1/"],
1452
+ "fields": [],
1453
+ "headerInjections": [
1454
+ {
1455
+ "name": "Authorization",
1456
+ "valueTemplate": "Bearer {{oauth.access_token}}"
1457
+ }
1458
+ ],
1459
+ "queryInjections": [],
1460
+ "authMode": "oauth",
1461
+ "values": [],
1462
+ "oauthConfig": {
1463
+ "providerAdapter": "standard",
1464
+ "clientId": "<oauth-client-id>",
1465
+ "clientSecret": "<oauth-client-secret>",
1466
+ "authorizationUrl": "https://acme.example/oauth/authorize",
1467
+ "tokenUrl": "https://acme.example/oauth/token",
1468
+ "tokenEndpointAuthMethod": "client_secret_post",
1469
+ "pkceMethod": "S256",
1470
+ "scopes": ["read", "write"],
1471
+ "authorizationParams": {}
1472
+ }
1473
+ }
1474
+
1475
+ Examples:
1476
+ zero connector custom create --file ./connector.json
1477
+ zero connector custom create --file ./connector.json --agent <agent-id>
1478
+ zero connector custom create --file ./connector.json --json
1479
+
1480
+ Notes:
1481
+ - Requires an organization admin
1482
+ - Requires the customConnectorCliCreate feature
1483
+ - OAuth custom connectors also require the customConnectorOAuth2 feature
1484
+ - --agent defaults to ZERO_AGENT_ID inside an agent run
1485
+ - OAuth always requires the user to approve the generated authorization link
1486
+ - The file contains plaintext credentials; keep it temporary and never commit it`
1487
+ ).action(
1488
+ withErrorHandler(async (options) => {
1489
+ requireCustomConnectorWriteCapability();
1490
+ const raw = await readFile(options.file, "utf8");
1491
+ const input = JSON.parse(raw);
1492
+ const definition = customConnectorCreateSchema.parse(input);
1493
+ const agentId = options.agent ?? process.env.ZERO_AGENT_ID;
1494
+ if (agentId) {
1495
+ await getZeroAgent(agentId);
1496
+ }
1497
+ const result = definition.authMode === "manual" ? await createManualCustomConnector(definition, agentId) : await createOAuthCustomConnector(definition, agentId);
1498
+ printCreateResult(result, options.json ?? false);
1499
+ })
1500
+ );
1501
+
1502
+ // src/commands/zero/connector/custom/index.ts
1248
1503
  var LABEL_WIDTH2 = 18;
1249
1504
  function renderConnected(connector) {
1250
1505
  if (connector.connected) {
@@ -1255,12 +1510,6 @@ function renderConnected(connector) {
1255
1510
  }
1256
1511
  return source_default.yellow(`missing ${connector.missingRequiredFields.join(", ")}`);
1257
1512
  }
1258
- function encodeBase64UrlJson(value) {
1259
- return Buffer.from(JSON.stringify(value), "utf8").toString("base64url");
1260
- }
1261
- function isJsonObject(value) {
1262
- return typeof value === "object" && value !== null && !Array.isArray(value);
1263
- }
1264
1513
  async function resolveCustomAgentContext(agentId) {
1265
1514
  const resolvedAgentId = agentId ?? process.env.ZERO_AGENT_ID;
1266
1515
  if (!resolvedAgentId) {
@@ -1360,36 +1609,7 @@ var statusCommand2 = new Command().name("status").description("Show detailed sta
1360
1609
  }
1361
1610
  )
1362
1611
  );
1363
- var proposeCommand = new Command().name("propose").description("Create a browser save link for a custom connector proposal").requiredOption("--proposal-file <path>", "JSON proposal file").option("--connector-id <id>", "Override connector id for update proposals").option("--agent <id>", "Authorize this agent when the proposal is saved").action(
1364
- withErrorHandler(
1365
- async (options) => {
1366
- const raw = await readFile(options.proposalFile, "utf8");
1367
- const proposalJson = JSON.parse(raw);
1368
- if (!isJsonObject(proposalJson)) {
1369
- throw new Error("Proposal file must contain a JSON object");
1370
- }
1371
- const parsed = customConnectorProposalSchema.parse({
1372
- ...proposalJson,
1373
- ...options.connectorId ? { connectorId: options.connectorId } : {}
1374
- });
1375
- const origin = await getPlatformOrigin();
1376
- const params = new URLSearchParams({
1377
- p: encodeBase64UrlJson(parsed)
1378
- });
1379
- const agentId = options.agent ?? process.env.ZERO_AGENT_ID;
1380
- if (agentId) {
1381
- params.set("agentId", agentId);
1382
- }
1383
- const url = `${origin}/connectors/custom/proposal?${params.toString()}`;
1384
- console.log(`[Configure ${parsed.displayName}](${url})`);
1385
- console.log();
1386
- console.log(
1387
- "Open this link to review, save values, and authorize the connector."
1388
- );
1389
- }
1390
- )
1391
- );
1392
- var customConnectorCommand = new Command().name("custom").description("Inspect and propose org custom connectors").addCommand(listCommand2).addCommand(statusCommand2).addCommand(proposeCommand);
1612
+ var customConnectorCommand = new Command().name("custom").description("Create and inspect org custom connectors").addCommand(createCustomConnectorCommand).addCommand(listCommand2).addCommand(statusCommand2);
1393
1613
 
1394
1614
  // src/commands/zero/connector/permission-request.ts
1395
1615
  init_esm_shims();
@@ -1625,4 +1845,4 @@ var zeroConnectorCommand = new Command().name("connector").description("Manage a
1625
1845
  export {
1626
1846
  zeroConnectorCommand
1627
1847
  };
1628
- //# sourceMappingURL=connector-FPYSJ7H6.js.map
1848
+ //# sourceMappingURL=connector-Y5RELY3X.js.map