@vm0/cli 9.221.4 → 9.221.6
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/{agent-SRJW4DJV.js → agent-DYWIJQ2R.js} +4 -4
- package/{automation-THUDKXQR.js → automation-U62LQKYO.js} +7 -9
- package/{automation-THUDKXQR.js.map → automation-U62LQKYO.js.map} +1 -1
- package/{banking-ED4LTRY3.js → banking-NLYZOBEM.js} +2 -2
- package/{chat-WMXIEDEY.js → chat-5UZFU2YR.js} +2 -2
- package/{chunk-3NMCKGNJ.js → chunk-65CYJRLA.js} +2 -2
- package/{chunk-4YUV2CMK.js → chunk-6OGS5SQ6.js} +3 -3
- package/{chunk-M5MXYLLZ.js → chunk-7TDL7YQG.js} +129 -222
- package/chunk-7TDL7YQG.js.map +1 -0
- package/{chunk-J7RLLIWI.js → chunk-HQFETCZ6.js} +26 -2
- package/chunk-HQFETCZ6.js.map +1 -0
- package/{chunk-2K5GNYND.js → chunk-IFA2V7EW.js} +2 -2
- package/{chunk-RR5CO7IT.js → chunk-IMZDXXSW.js} +2 -2
- package/{chunk-QV73BJ3B.js → chunk-PCBM5SRN.js} +320 -134
- package/chunk-PCBM5SRN.js.map +1 -0
- package/{chunk-QCYPFXRV.js → chunk-PX6FH3KT.js} +2 -2
- package/{chunk-AYR37FIN.js → chunk-ZOZTDOZE.js} +3 -3
- package/{chunk-DAC5OAWI.js → chunk-ZQYA5M55.js} +3 -64
- package/{chunk-DAC5OAWI.js.map → chunk-ZQYA5M55.js.map} +1 -1
- package/{computer-use-WINYVPQS.js → computer-use-JWVNMBIM.js} +2 -2
- package/{connector-WBM4EKRR.js → connector-YJX3MZGN.js} +382 -395
- package/connector-YJX3MZGN.js.map +1 -0
- package/{credit-KJRMNSQ2.js → credit-FHOJ736M.js} +2 -2
- package/{developer-support-DMUPPQB2.js → developer-support-BJVUM5OZ.js} +2 -2
- package/{doctor-VGQ6YI6G.js → doctor-BDSKVS5W.js} +5 -5
- package/{generate-STQVPQZO.js → generate-EA5ZRXFE.js} +60 -81
- package/generate-EA5ZRXFE.js.map +1 -0
- package/{github-LSFYZXO3.js → github-NU7VA3WB.js} +2 -2
- package/{goal-BNN7NM52.js → goal-4H4GUEMC.js} +2 -2
- package/{host-4MVX223U.js → host-SCI3ZPFT.js} +2 -2
- package/index.js +13 -13
- package/{logs-2VYXOUSW.js → logs-WHJPLPCR.js} +6 -6
- package/{maps-AMT7SMTH.js → maps-E5GVYSKP.js} +2 -2
- package/{model-HRRTGQQW.js → model-XP7ACN22.js} +3 -3
- package/{model-provider-HRK3C42K.js → model-provider-TAGWSIEW.js} +3 -3
- package/{org-M6Z5HXLU.js → org-4CMXX52G.js} +2 -2
- package/package.json +1 -1
- package/{phone-XM2DDX3C.js → phone-T7VLFMEU.js} +2 -2
- package/{preference-OQ3NRFCT.js → preference-Q4ZCLD2L.js} +2 -2
- package/{resource-NR6R2I6J.js → resource-QKFJESUB.js} +2 -2
- package/{search-RVTPT6N3.js → search-CTYF6KGG.js} +6 -6
- package/{secret-JPLOSNN3.js → secret-LMPIFKPU.js} +3 -3
- package/{slack-ETMPZQYC.js → slack-FKENH3DZ.js} +2 -2
- package/{telegram-IOHI44M5.js → telegram-ZG24OBRU.js} +2 -2
- package/{variable-URYGYI2W.js → variable-BOATQUX3.js} +2 -2
- package/{web-OAVP3LA4.js → web-3ASTXCH7.js} +2 -2
- package/{whoami-5RMEOJGY.js → whoami-DHCS6YIJ.js} +4 -4
- package/{workflow-JJXIMM3C.js → workflow-T2TTFE6C.js} +4 -6
- package/{workflow-JJXIMM3C.js.map → workflow-T2TTFE6C.js.map} +1 -1
- package/zero.js +31 -31
- package/chunk-J7RLLIWI.js.map +0 -1
- package/chunk-M5MXYLLZ.js.map +0 -1
- package/chunk-QV73BJ3B.js.map +0 -1
- package/chunk-RGP625TN.js +0 -47
- package/chunk-RGP625TN.js.map +0 -1
- package/connector-WBM4EKRR.js.map +0 -1
- package/generate-STQVPQZO.js.map +0 -1
- /package/{agent-SRJW4DJV.js.map → agent-DYWIJQ2R.js.map} +0 -0
- /package/{banking-ED4LTRY3.js.map → banking-NLYZOBEM.js.map} +0 -0
- /package/{chat-WMXIEDEY.js.map → chat-5UZFU2YR.js.map} +0 -0
- /package/{chunk-3NMCKGNJ.js.map → chunk-65CYJRLA.js.map} +0 -0
- /package/{chunk-4YUV2CMK.js.map → chunk-6OGS5SQ6.js.map} +0 -0
- /package/{chunk-2K5GNYND.js.map → chunk-IFA2V7EW.js.map} +0 -0
- /package/{chunk-RR5CO7IT.js.map → chunk-IMZDXXSW.js.map} +0 -0
- /package/{chunk-QCYPFXRV.js.map → chunk-PX6FH3KT.js.map} +0 -0
- /package/{chunk-AYR37FIN.js.map → chunk-ZOZTDOZE.js.map} +0 -0
- /package/{computer-use-WINYVPQS.js.map → computer-use-JWVNMBIM.js.map} +0 -0
- /package/{credit-KJRMNSQ2.js.map → credit-FHOJ736M.js.map} +0 -0
- /package/{developer-support-DMUPPQB2.js.map → developer-support-BJVUM5OZ.js.map} +0 -0
- /package/{doctor-VGQ6YI6G.js.map → doctor-BDSKVS5W.js.map} +0 -0
- /package/{github-LSFYZXO3.js.map → github-NU7VA3WB.js.map} +0 -0
- /package/{goal-BNN7NM52.js.map → goal-4H4GUEMC.js.map} +0 -0
- /package/{host-4MVX223U.js.map → host-SCI3ZPFT.js.map} +0 -0
- /package/{logs-2VYXOUSW.js.map → logs-WHJPLPCR.js.map} +0 -0
- /package/{maps-AMT7SMTH.js.map → maps-E5GVYSKP.js.map} +0 -0
- /package/{model-HRRTGQQW.js.map → model-XP7ACN22.js.map} +0 -0
- /package/{model-provider-HRK3C42K.js.map → model-provider-TAGWSIEW.js.map} +0 -0
- /package/{org-M6Z5HXLU.js.map → org-4CMXX52G.js.map} +0 -0
- /package/{phone-XM2DDX3C.js.map → phone-T7VLFMEU.js.map} +0 -0
- /package/{preference-OQ3NRFCT.js.map → preference-Q4ZCLD2L.js.map} +0 -0
- /package/{resource-NR6R2I6J.js.map → resource-QKFJESUB.js.map} +0 -0
- /package/{search-RVTPT6N3.js.map → search-CTYF6KGG.js.map} +0 -0
- /package/{secret-JPLOSNN3.js.map → secret-LMPIFKPU.js.map} +0 -0
- /package/{slack-ETMPZQYC.js.map → slack-FKENH3DZ.js.map} +0 -0
- /package/{telegram-IOHI44M5.js.map → telegram-ZG24OBRU.js.map} +0 -0
- /package/{variable-URYGYI2W.js.map → variable-BOATQUX3.js.map} +0 -0
- /package/{web-OAVP3LA4.js.map → web-3ASTXCH7.js.map} +0 -0
- /package/{whoami-5RMEOJGY.js.map → whoami-DHCS6YIJ.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/zero/connector/index.ts","../src/commands/zero/connector/connect.ts","../src/commands/zero/connector/public-catalog.ts","../src/commands/zero/connector/list.ts","../src/commands/zero/connector/agent-context.ts","../src/commands/zero/connector/connected-as.ts","../src/commands/zero/connector/search.ts","../src/commands/zero/connector/status.ts","../src/commands/zero/connector/custom/index.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { connectCommand } from \"./connect\";\nimport { listCommand } from \"./list\";\nimport { searchCommand } from \"./search\";\nimport { statusCommand } from \"./status\";\nimport { customConnectorCommand } from \"./custom\";\n\nexport const zeroConnectorCommand = new Command()\n .name(\"connector\")\n .description(\"Check third-party service connections (GitHub, Slack, etc.)\")\n .addCommand(customConnectorCommand)\n .addCommand(connectCommand)\n .addCommand(listCommand)\n .addCommand(searchCommand)\n .addCommand(statusCommand);\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport {\n connectZeroConnectorManualGrant,\n listZeroConnectorCatalogStatus,\n} from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport {\n availableConnectorRefs,\n findConnectorStatusItem,\n parseConnectorAuthMethodIdForAction,\n parseConnectorTypeForAction,\n resolveManualGrantAuthMethod,\n} from \"./public-catalog\";\n\ninterface ConnectOptions {\n readonly authMethod?: string;\n readonly value?: readonly string[];\n readonly json?: boolean;\n}\n\nfunction collectValue(value: string, previous: string[]): string[] {\n return [...previous, value];\n}\n\nfunction parseConnectorValues(rawValues: readonly string[] | undefined) {\n if (!rawValues || rawValues.length === 0) {\n throw new Error(\"At least one --value NAME=VALUE is required\", {\n cause: new Error(\n \"Example: zero connector connect zendesk --value apiToken=token\",\n ),\n });\n }\n\n const values: Record<string, string> = {};\n for (const rawValue of rawValues) {\n const separatorIndex = rawValue.indexOf(\"=\");\n if (separatorIndex <= 0) {\n throw new Error(\"Invalid --value format\", {\n cause: new Error(\"Use --value NAME=VALUE\"),\n });\n }\n\n const name = rawValue.slice(0, separatorIndex);\n if (!name.trim()) {\n throw new Error(\"Invalid --value format\", {\n cause: new Error(\"Field name cannot be empty\"),\n });\n }\n\n values[name] = rawValue.slice(separatorIndex + 1);\n }\n\n return values;\n}\n\nexport const connectCommand = new Command()\n .name(\"connect\")\n .description(\"Connect a connector with manual grant values\")\n .argument(\"<type>\", \"Connector type (e.g., zendesk)\")\n .option(\"--auth-method <method>\", \"Connector auth method to use\")\n .option(\n \"--value <name=value>\",\n \"Connector field value; repeat for multiple fields\",\n collectValue,\n [],\n )\n .option(\"--json\", \"Print the connector response as JSON\")\n .action(\n withErrorHandler(async (type: string, options: ConnectOptions) => {\n const values = parseConnectorValues(options.value);\n const catalog = await listZeroConnectorCatalogStatus();\n const connectorMetadata = findConnectorStatusItem(\n catalog.connectors,\n type,\n );\n if (!connectorMetadata) {\n throw new Error(`Unknown or unavailable connector: ${type}`, {\n cause: new Error(\n `Available connectors: ${availableConnectorRefs(catalog.connectors)}`,\n ),\n });\n }\n\n const connectorType = parseConnectorTypeForAction(\n connectorMetadata.connectorRef,\n );\n const authMethod = resolveManualGrantAuthMethod(\n connectorMetadata,\n options.authMethod,\n );\n const connector = await connectZeroConnectorManualGrant(\n connectorType,\n parseConnectorAuthMethodIdForAction(authMethod.id),\n values,\n );\n\n if (options.json) {\n console.log(JSON.stringify(connector, null, 2));\n return;\n }\n\n console.log(chalk.green(`✓ ${connectorMetadata.label} connected`));\n console.log(chalk.dim(` Type: ${connector.type}`));\n console.log(chalk.dim(` Auth Method: ${connector.authMethod}`));\n console.log(chalk.dim(` Run: zero connector status ${connector.type}`));\n }),\n );\n","import type {\n PublicConnectorCatalogAuthMethodDetail,\n PublicConnectorCatalogItem,\n PublicConnectorCatalogStatusItem,\n} from \"@vm0/api-contracts/contracts/zero-connector-catalog\";\nimport {\n connectorAuthMethodIdSchema,\n connectorTypeSchema,\n type ConnectorAuthMethodId,\n type ConnectorType,\n} from \"@vm0/connectors/connectors\";\n\nexport type PublicConnectorStatus = PublicConnectorCatalogStatusItem;\n\ninterface PublicConnectorSearchResult {\n readonly connector: PublicConnectorStatus;\n readonly score: number;\n readonly matchedField: string;\n}\n\ninterface PublicConnectorSearchOutput {\n readonly results: readonly PublicConnectorSearchResult[];\n readonly total: number;\n}\n\nconst TOKEN_BOUNDARY = /[_\\-\\s]+/;\nconst CASE_BOUNDARY = /(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/;\nconst MIN_SCORE = 10;\n\nfunction tokenize(input: string): Set<string> {\n const tokens = new Set<string>();\n for (const chunk of input.split(TOKEN_BOUNDARY)) {\n if (!chunk) continue;\n for (const sub of chunk.split(CASE_BOUNDARY)) {\n const lower = sub.toLowerCase();\n if (lower) tokens.add(lower);\n }\n }\n return tokens;\n}\n\nfunction publicStrings(connector: PublicConnectorCatalogItem): string[] {\n return [\n connector.connectorRef,\n connector.label,\n connector.description,\n connector.category,\n ...connector.tags,\n ...connector.generation,\n ...connector.authMethods.flatMap((authMethod) => {\n return [\n authMethod.id,\n authMethod.label,\n ...(authMethod.description ? [authMethod.description] : []),\n ];\n }),\n ];\n}\n\ntype ScoreHit = { score: number; matchedField: string };\n\nfunction best(candidates: readonly (ScoreHit | null)[]): ScoreHit | null {\n return candidates.reduce<ScoreHit | null>((bestHit, hit) => {\n if (!hit) return bestHit;\n if (!bestHit || hit.score > bestHit.score) return hit;\n return bestHit;\n }, null);\n}\n\nfunction scoreExact(\n keywordLower: string,\n skipPrivateIdentifierMatches: boolean,\n connector: PublicConnectorStatus,\n): ScoreHit | null {\n if (connector.connectorRef.toLowerCase() === keywordLower) {\n return { score: 100, matchedField: \"connectorRef\" };\n }\n if (connector.label.toLowerCase() === keywordLower) {\n return { score: 80, matchedField: \"label\" };\n }\n for (const tag of connector.tags) {\n if (skipPrivateIdentifierMatches && tag.includes(\"_\")) continue;\n if (tag.toLowerCase() === keywordLower) {\n return { score: 70, matchedField: `tag:${tag}` };\n }\n }\n for (const generationType of connector.generation) {\n if (generationType.toLowerCase() === keywordLower) {\n return { score: 65, matchedField: `generation:${generationType}` };\n }\n }\n for (const authMethod of connector.authMethods) {\n if (authMethod.id.toLowerCase() === keywordLower) {\n return { score: 60, matchedField: `auth-method:${authMethod.id}` };\n }\n if (authMethod.label.toLowerCase() === keywordLower) {\n return { score: 60, matchedField: `auth-method:${authMethod.label}` };\n }\n }\n if (connector.category.toLowerCase() === keywordLower) {\n return { score: 55, matchedField: \"category\" };\n }\n return null;\n}\n\nfunction scoreSubstring(\n keywordLower: string,\n skipPrivateIdentifierMatches: boolean,\n connector: PublicConnectorStatus,\n): ScoreHit | null {\n const candidates: ScoreHit[] = [];\n if (connector.connectorRef.toLowerCase().includes(keywordLower)) {\n candidates.push({ score: 50, matchedField: \"connectorRef\" });\n }\n if (connector.label.toLowerCase().includes(keywordLower)) {\n candidates.push({ score: 50, matchedField: \"label\" });\n }\n for (const tag of connector.tags) {\n if (skipPrivateIdentifierMatches && tag.includes(\"_\")) continue;\n if (tag.toLowerCase().includes(keywordLower)) {\n candidates.push({ score: 25, matchedField: `tag:${tag}` });\n }\n }\n for (const generationType of connector.generation) {\n if (generationType.toLowerCase().includes(keywordLower)) {\n candidates.push({\n score: 25,\n matchedField: `generation:${generationType}`,\n });\n }\n }\n for (const authMethod of connector.authMethods) {\n if (\n authMethod.id.toLowerCase().includes(keywordLower) ||\n authMethod.label.toLowerCase().includes(keywordLower)\n ) {\n candidates.push({\n score: 20,\n matchedField: `auth-method:${authMethod.id}`,\n });\n }\n }\n if (connector.category.toLowerCase().includes(keywordLower)) {\n candidates.push({ score: 20, matchedField: \"category\" });\n }\n if (connector.description.toLowerCase().includes(keywordLower)) {\n candidates.push({ score: 15, matchedField: \"description\" });\n }\n\n return best(candidates);\n}\n\nfunction scoreTokens(\n keywordTokens: ReadonlySet<string>,\n connector: PublicConnectorStatus,\n): ScoreHit | null {\n const candidateTokens = new Set<string>();\n for (const source of publicStrings(connector)) {\n for (const token of tokenize(source)) {\n candidateTokens.add(token);\n }\n }\n\n let intersection = 0;\n let firstCommon = \"\";\n for (const token of keywordTokens) {\n if (candidateTokens.has(token)) {\n intersection++;\n if (!firstCommon) firstCommon = token;\n }\n }\n if (intersection === 0) return null;\n return { score: 10 * intersection, matchedField: `token:${firstCommon}` };\n}\n\nfunction scoreConnector(\n keywordLower: string,\n keyword: string,\n keywordTokens: ReadonlySet<string>,\n connector: PublicConnectorStatus,\n): ScoreHit | null {\n const skipPrivateIdentifierMatches =\n /^[A-Za-z0-9_]+$/.test(keyword) && keyword.includes(\"_\");\n const tokenHit = skipPrivateIdentifierMatches\n ? null\n : scoreTokens(keywordTokens, connector);\n const hit = best([\n scoreExact(keywordLower, skipPrivateIdentifierMatches, connector),\n scoreSubstring(keywordLower, skipPrivateIdentifierMatches, connector),\n tokenHit,\n ]);\n if (!hit || hit.score < MIN_SCORE) return null;\n return hit;\n}\n\nexport function searchPublicConnectorCatalog(\n connectors: readonly PublicConnectorStatus[],\n keyword: string,\n limit: number,\n): PublicConnectorSearchOutput {\n const trimmed = keyword.trim();\n if (!trimmed) return { results: [], total: 0 };\n\n const keywordLower = trimmed.toLowerCase();\n const keywordTokens = tokenize(trimmed);\n const hits = connectors.flatMap(\n (connector): PublicConnectorSearchResult[] => {\n const hit = scoreConnector(\n keywordLower,\n trimmed,\n keywordTokens,\n connector,\n );\n if (!hit) return [];\n return [\n {\n connector,\n score: hit.score,\n matchedField: hit.matchedField,\n },\n ];\n },\n );\n\n hits.sort((a, b) => {\n if (b.score !== a.score) return b.score - a.score;\n return a.connector.connectorRef.localeCompare(b.connector.connectorRef);\n });\n\n return {\n results: hits.slice(0, limit),\n total: hits.length,\n };\n}\n\nexport function findConnectorStatusItem(\n connectors: readonly PublicConnectorStatus[],\n connectorRef: string,\n): PublicConnectorStatus | null {\n const exact = connectors.find((connector) => {\n return connector.connectorRef === connectorRef;\n });\n if (exact) return exact;\n\n const lower = connectorRef.toLowerCase();\n return (\n connectors.find((connector) => {\n return connector.connectorRef.toLowerCase() === lower;\n }) ?? null\n );\n}\n\nexport function availableConnectorRefs(\n connectors: readonly PublicConnectorStatus[],\n): string {\n return connectors\n .map((connector) => {\n return connector.connectorRef;\n })\n .join(\", \");\n}\n\nexport function parseConnectorTypeForAction(\n connectorRef: string,\n): ConnectorType {\n const parsed = connectorTypeSchema.safeParse(connectorRef);\n if (parsed.success) return parsed.data;\n\n throw new Error(\n `Connector ${connectorRef} cannot be used by this CLI action`,\n {\n cause: new Error(\n \"This action still uses the connector action API, which only accepts built-in connector refs.\",\n ),\n },\n );\n}\n\nexport function parseConnectorAuthMethodIdForAction(\n authMethodId: string,\n): ConnectorAuthMethodId {\n const parsed = connectorAuthMethodIdSchema.safeParse(authMethodId);\n if (parsed.success) return parsed.data;\n\n throw new Error(\n `Auth method ${authMethodId} cannot be used by this CLI action`,\n {\n cause: new Error(\n \"This action still uses the connector action API, which only accepts built-in auth method ids.\",\n ),\n },\n );\n}\n\nexport function resolveManualGrantAuthMethod(\n connector: PublicConnectorStatus,\n rawAuthMethod: string | undefined,\n): PublicConnectorCatalogAuthMethodDetail {\n if (rawAuthMethod) {\n const authMethod = connector.authMethods.find((method) => {\n return method.id === rawAuthMethod;\n });\n if (!authMethod) {\n throw new Error(\n `${connector.connectorRef} connector does not have ${rawAuthMethod} auth method`,\n {\n cause: new Error(\n `Available auth methods: ${connector.authMethods\n .map((method) => {\n return method.id;\n })\n .join(\", \")}`,\n ),\n },\n );\n }\n\n if (authMethod.grantKind === \"manual\") {\n return authMethod;\n }\n\n throw new Error(\n `${connector.connectorRef} ${authMethod.id} auth method does not use a manual grant`,\n );\n }\n\n const manualAuthMethods = connector.authMethods.filter((method) => {\n return method.grantKind === \"manual\";\n });\n const authMethod = manualAuthMethods[0];\n if (manualAuthMethods.length === 1 && authMethod) {\n return authMethod;\n }\n if (manualAuthMethods.length === 0) {\n throw new Error(\n `${connector.connectorRef} connector does not use a manual grant`,\n );\n }\n\n throw new Error(\n `${connector.connectorRef} connector has multiple manual grant auth methods`,\n {\n cause: new Error(\n `Pass --auth-method ${manualAuthMethods\n .map((method) => {\n return method.id;\n })\n .join(\"|\")}`,\n ),\n },\n );\n}\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { listZeroConnectorCatalogStatus } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { resolveAgentContext } from \"./agent-context\";\nimport { padEndAnsi, renderConnectedAsCell, stripAnsi } from \"./connected-as\";\n\nexport const listCommand = new Command()\n .name(\"list\")\n .alias(\"ls\")\n .description(\"List all connectors and their status\")\n .option(\"--agent <id>\", \"Show per-agent authorization column\")\n .action(\n withErrorHandler(async (options: { agent?: string }) => {\n const [{ connectors }, agentCtx] = await Promise.all([\n listZeroConnectorCatalogStatus(),\n resolveAgentContext(options.agent),\n ]);\n\n const allTypes = connectors.map((connector) => {\n return connector.connectorRef;\n });\n\n const typeWidth = Math.max(\n 4,\n ...allTypes.map((t) => {\n return t.length;\n }),\n );\n\n const connectedAsHeader = \"CONNECTED AS\";\n const connectedCells = connectors.map((connector) => {\n return renderConnectedAsCell(connector);\n });\n const connectedAsWidth = Math.max(\n connectedAsHeader.length,\n ...connectedCells.map((c) => {\n return stripAnsi(c).length;\n }),\n );\n\n const authorizedHeader = agentCtx\n ? `AUTHORIZED FOR ${agentCtx.displayName}`\n : null;\n\n // Print header\n const headerParts = [\n \"TYPE\".padEnd(typeWidth),\n connectedAsHeader.padEnd(connectedAsWidth),\n ];\n if (authorizedHeader) headerParts.push(authorizedHeader);\n console.log(chalk.dim(headerParts.join(\" \")));\n\n // Print rows\n for (let i = 0; i < allTypes.length; i++) {\n const type = allTypes[i]!;\n const connectedCell = padEndAnsi(connectedCells[i]!, connectedAsWidth);\n const parts = [type.padEnd(typeWidth), connectedCell];\n if (agentCtx) {\n parts.push(\n agentCtx.authorizedTypes.has(type)\n ? chalk.green(\"✓\")\n : chalk.dim(\"-\"),\n );\n }\n console.log(parts.join(\" \"));\n }\n }),\n );\n","import { getZeroAgent, getZeroAgentUserConnectors } from \"../../../lib/api\";\n\ninterface AgentContext {\n agentId: string;\n displayName: string;\n authorizedTypes: Set<string>;\n}\n\nexport async function resolveAgentContext(\n flagAgentId: string | undefined,\n): Promise<AgentContext | null> {\n const agentId = flagAgentId ?? process.env.ZERO_AGENT_ID;\n if (!agentId) return null;\n\n const [agent, enabledTypes] = await Promise.all([\n getZeroAgent(agentId),\n getZeroAgentUserConnectors(agentId),\n ]);\n\n return {\n agentId: agent.agentId,\n displayName: agent.displayName ?? agent.agentId,\n authorizedTypes: new Set(enabledTypes),\n };\n}\n","import chalk from \"chalk\";\nimport type { PublicConnectorStatus } from \"./public-catalog\";\n\nfunction renderIdentity(connector: PublicConnectorStatus): string {\n if (connector.connection?.externalUsername) {\n return `@${connector.connection.externalUsername}`;\n }\n if (connector.connection?.externalEmail)\n return connector.connection.externalEmail;\n return \"-\";\n}\n\nexport function renderConnectedAsCell(\n connector: PublicConnectorStatus | undefined,\n): string {\n if (!connector || connector.connectionStatus === \"not-connected\") {\n return chalk.dim(\"(not connected)\");\n }\n const identity = renderIdentity(connector);\n if (connector.connectionStatus === \"reconnect-required\") {\n return chalk.yellow(`${identity} (reconnect needed)`);\n }\n if (\n connector.scopeMismatch ||\n connector.connectionStatus === \"scope-mismatch\"\n ) {\n return chalk.yellow(`${identity} (permissions update available)`);\n }\n return identity;\n}\n\nconst ESC = \"\\u001b\";\nconst ANSI_PATTERN = new RegExp(`${ESC}\\\\[[0-9;]*m`, \"g\");\n\nexport function stripAnsi(s: string): string {\n return s.replace(ANSI_PATTERN, \"\");\n}\n\nexport function padEndAnsi(s: string, width: number): string {\n const visible = stripAnsi(s).length;\n return s + \" \".repeat(Math.max(0, width - visible));\n}\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { listZeroConnectorCatalogStatus } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { resolveAgentContext } from \"./agent-context\";\nimport { padEndAnsi, renderConnectedAsCell, stripAnsi } from \"./connected-as\";\nimport { searchPublicConnectorCatalog } from \"./public-catalog\";\n\nconst DEFAULT_LIMIT = 5;\nconst EXACT_MATCH_THRESHOLD = 80;\n\nfunction parseLimit(raw: string): number {\n const trimmed = raw.trim();\n const n = Number(trimmed);\n if (!/^\\d+$/.test(trimmed) || !Number.isSafeInteger(n) || n <= 0) {\n throw new Error(`--limit must be a positive integer, got \"${raw}\".`);\n }\n return n;\n}\n\nexport const searchCommand = new Command()\n .name(\"search\")\n .description(\n \"Search connectors by type, label, category, generation type, or tag\",\n )\n .argument(\"<keyword>\", \"Search keyword (case-insensitive)\")\n .option(\"--agent <id>\", \"Show per-agent authorization column\")\n .option(\n \"--limit <n>\",\n `Maximum number of results to display (default ${DEFAULT_LIMIT})`,\n parseLimit,\n DEFAULT_LIMIT,\n )\n .action(\n withErrorHandler(\n async (keyword: string, options: { agent?: string; limit: number }) => {\n const trimmed = keyword.trim();\n if (!trimmed) {\n throw new Error(\"Keyword cannot be empty.\");\n }\n\n const [{ connectors }, agentCtx] = await Promise.all([\n listZeroConnectorCatalogStatus(),\n resolveAgentContext(options.agent),\n ]);\n const { results, total } = searchPublicConnectorCatalog(\n connectors,\n trimmed,\n options.limit,\n );\n\n if (results.length === 0) {\n console.log(\"No matches found.\");\n return;\n }\n\n const topScore = results[0]!.score;\n if (topScore < EXACT_MATCH_THRESHOLD) {\n console.log(\"No exact match. Showing closest:\");\n }\n if (total > options.limit) {\n console.log(`Too many results (top ${options.limit} of ${total}):`);\n }\n\n const typeHeader = \"TYPE\";\n const connectedAsHeader = \"CONNECTED AS\";\n\n const connectedCells = results.map((r) => {\n return renderConnectedAsCell(r.connector);\n });\n\n const typeWidth = Math.max(\n typeHeader.length,\n ...results.map((r) => {\n return r.connector.connectorRef.length;\n }),\n );\n const connectedAsWidth = Math.max(\n connectedAsHeader.length,\n ...connectedCells.map((c) => {\n return stripAnsi(c).length;\n }),\n );\n\n const headerParts = [\n typeHeader.padEnd(typeWidth),\n connectedAsHeader.padEnd(connectedAsWidth),\n ];\n if (agentCtx) {\n headerParts.push(`AUTHORIZED FOR ${agentCtx.displayName}`);\n }\n console.log(chalk.dim(headerParts.join(\" \")));\n\n for (let i = 0; i < results.length; i++) {\n const result = results[i]!;\n const parts = [\n result.connector.connectorRef.padEnd(typeWidth),\n padEndAnsi(connectedCells[i]!, connectedAsWidth),\n ];\n if (agentCtx) {\n parts.push(\n agentCtx.authorizedTypes.has(result.connector.connectorRef)\n ? chalk.green(\"✓\")\n : chalk.dim(\"-\"),\n );\n }\n console.log(parts.join(\" \"));\n }\n },\n ),\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { listZeroConnectorCatalogStatus } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { resolveAgentContext } from \"./agent-context\";\nimport { getPlatformOrigin } from \"../doctor/platform-url\";\nimport {\n availableConnectorRefs,\n findConnectorStatusItem,\n type PublicConnectorStatus,\n} from \"./public-catalog\";\n\nconst LABEL_WIDTH = 16;\n\ntype AgentContext = NonNullable<\n Awaited<ReturnType<typeof resolveAgentContext>>\n>;\n\nfunction printConnectorDetails(connector: PublicConnectorStatus): void {\n if (connector.connectionStatus === \"not-connected\") {\n console.log(\n `${\"Status:\".padEnd(LABEL_WIDTH)}${chalk.dim(\"not connected\")}`,\n );\n return;\n }\n\n console.log(\n `${\"Status:\".padEnd(LABEL_WIDTH)}${\n connector.connectionStatus === \"reconnect-required\"\n ? chalk.yellow(\"reconnect needed\")\n : chalk.green(\"connected\")\n }`,\n );\n if (connector.connection?.externalUsername) {\n console.log(\n `${\"Account:\".padEnd(LABEL_WIDTH)}@${connector.connection.externalUsername}`,\n );\n } else if (connector.connection?.externalEmail) {\n console.log(\n `${\"Account:\".padEnd(LABEL_WIDTH)}${connector.connection.externalEmail}`,\n );\n }\n if (connector.connection?.authMethod) {\n console.log(\n `${\"Auth Method:\".padEnd(LABEL_WIDTH)}${connector.connection.authMethod}`,\n );\n }\n if (connector.scopeMismatch) {\n console.log(\n `${\"Permissions:\".padEnd(LABEL_WIDTH)}${chalk.yellow(\"update available\")}`,\n );\n }\n if (connector.tokenExpiresAt) {\n console.log(\n `${\"Token Expires:\".padEnd(LABEL_WIDTH)}${connector.tokenExpiresAt}`,\n );\n }\n}\n\nasync function printAgentAction(\n connector: PublicConnectorStatus,\n agentCtx: AgentContext,\n): Promise<void> {\n const connectorRef = connector.connectorRef;\n const authorized = agentCtx.authorizedTypes.has(connectorRef);\n const isConnected = connector.connected;\n const needsReconnect = connector.connectionStatus === \"reconnect-required\";\n const agentLabel =\n agentCtx.displayName === agentCtx.agentId\n ? agentCtx.agentId\n : `${agentCtx.displayName} (${agentCtx.agentId})`;\n\n console.log();\n if (needsReconnect) {\n const origin = await getPlatformOrigin();\n const url = `${origin}/connectors`;\n console.log(\n `The ${connectorRef} connector is connected but needs to be reconnected before agent ${agentLabel} can use it.`,\n );\n console.log(`Reconnect it at: [Reconnect ${connectorRef}](${url})`);\n } else if (authorized && !isConnected) {\n const origin = await getPlatformOrigin();\n const url = `${origin}/connectors/${connectorRef}/connect?agentId=${agentCtx.agentId}`;\n console.log(\n `The ${connectorRef} connector is authorized for agent ${agentLabel}, but it is not connected.`,\n );\n console.log(`Connect it at: [Connect ${connectorRef}](${url})`);\n } else if (authorized) {\n console.log(\n `The ${connectorRef} connector is authorized for agent ${agentLabel}.`,\n );\n } else if (!isConnected) {\n const origin = await getPlatformOrigin();\n const url = `${origin}/connectors/${connectorRef}/connect?agentId=${agentCtx.agentId}`;\n console.log(\n `The ${connectorRef} connector is not connected. Once connected, it will be authorized for agent ${agentLabel}.`,\n );\n console.log(\n `Connect and authorize it at: [Connect ${connectorRef}](${url})`,\n );\n } else {\n const origin = await getPlatformOrigin();\n const url = `${origin}/connectors/${connectorRef}/authorize?agentId=${agentCtx.agentId}`;\n console.log(\n `The ${connectorRef} connector is not authorized for agent ${agentLabel}.`,\n );\n console.log(`Authorize it at: [Authorize ${connectorRef}](${url})`);\n }\n}\n\nasync function printStandaloneAction(\n connector: PublicConnectorStatus,\n): Promise<void> {\n const connectorRef = connector.connectorRef;\n if (\n connector.connectionStatus === \"connected\" ||\n connector.connectionStatus === \"scope-mismatch\"\n ) {\n return;\n }\n\n const origin = await getPlatformOrigin();\n console.log();\n if (connector.connectionStatus === \"reconnect-required\") {\n const url = `${origin}/connectors`;\n console.log(\n `The ${connectorRef} connector is connected but needs to be reconnected.`,\n );\n console.log(`Reconnect it at: [Reconnect ${connectorRef}](${url})`);\n } else {\n const url = `${origin}/connectors/${connectorRef}/connect`;\n console.log(`Connect it at: [Connect ${connectorRef}](${url})`);\n }\n}\n\nexport const statusCommand = new Command()\n .name(\"status\")\n .description(\"Show detailed status of a connector\")\n .argument(\"<type>\", \"Connector type (e.g., github)\")\n .option(\"--agent <id>\", \"Show authorization state for the given agent\")\n .action(\n withErrorHandler(async (type: string, options: { agent?: string }) => {\n const [catalog, agentCtx] = await Promise.all([\n listZeroConnectorCatalogStatus(),\n resolveAgentContext(options.agent),\n ]);\n const connector = findConnectorStatusItem(catalog.connectors, type);\n if (!connector) {\n throw new Error(`Unknown or unavailable connector: ${type}`, {\n cause: new Error(\n `Available connectors: ${availableConnectorRefs(catalog.connectors)}`,\n ),\n });\n }\n\n console.log(`Connector: ${chalk.cyan(connector.connectorRef)}`);\n console.log();\n\n printConnectorDetails(connector);\n\n if (agentCtx) {\n await printAgentAction(connector, agentCtx);\n } else {\n await printStandaloneAction(connector);\n }\n }),\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { readFile } from \"node:fs/promises\";\nimport { customConnectorProposalSchema } from \"@vm0/api-contracts/contracts/zero-custom-connectors\";\nimport {\n getZeroAgent,\n getZeroAgentCustomConnectors,\n getZeroCustomConnector,\n listZeroCustomConnectors,\n} from \"../../../../lib/api\";\nimport { withErrorHandler } from \"../../../../lib/command\";\nimport { getPlatformOrigin } from \"../../doctor/platform-url\";\n\nconst LABEL_WIDTH = 18;\n\nfunction renderConnected(connector: {\n readonly connected: boolean;\n readonly missingRequiredFields: readonly string[];\n}): string {\n if (connector.connected) {\n return chalk.green(\"connected\");\n }\n if (connector.missingRequiredFields.length === 0) {\n return chalk.dim(\"not connected\");\n }\n return chalk.yellow(`missing ${connector.missingRequiredFields.join(\", \")}`);\n}\n\nfunction encodeBase64UrlJson(value: unknown): string {\n return Buffer.from(JSON.stringify(value), \"utf8\").toString(\"base64url\");\n}\n\nfunction isJsonObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nasync function resolveCustomAgentContext(agentId: string | undefined): Promise<{\n readonly agentId: string;\n readonly displayName: string;\n readonly authorizedIds: Set<string>;\n} | null> {\n const resolvedAgentId = agentId ?? process.env.ZERO_AGENT_ID;\n if (!resolvedAgentId) {\n return null;\n }\n const [agent, enabledIds] = await Promise.all([\n getZeroAgent(resolvedAgentId),\n getZeroAgentCustomConnectors(resolvedAgentId),\n ]);\n return {\n agentId: agent.agentId,\n displayName: agent.displayName ?? agent.agentId,\n authorizedIds: new Set(enabledIds),\n };\n}\n\nconst listCommand = new Command()\n .name(\"list\")\n .alias(\"ls\")\n .description(\"List org custom connectors\")\n .option(\"--agent <id>\", \"Show per-agent authorization column\")\n .action(\n withErrorHandler(async (options: { agent?: string }) => {\n const [connectors, agentCtx] = await Promise.all([\n listZeroCustomConnectors(),\n resolveCustomAgentContext(options.agent),\n ]);\n const idWidth = Math.max(\n 2,\n ...connectors.map((connector) => {\n return connector.id.length;\n }),\n );\n const nameWidth = Math.max(\n 4,\n ...connectors.map((connector) => {\n return connector.displayName.length;\n }),\n );\n const header = [\"ID\".padEnd(idWidth), \"NAME\".padEnd(nameWidth), \"STATUS\"];\n if (agentCtx) {\n header.push(`AUTHORIZED FOR ${agentCtx.displayName}`);\n }\n console.log(chalk.dim(header.join(\" \")));\n for (const connector of connectors) {\n const row = [\n connector.id.padEnd(idWidth),\n connector.displayName.padEnd(nameWidth),\n renderConnected(connector),\n ];\n if (agentCtx) {\n row.push(\n agentCtx.authorizedIds.has(connector.id)\n ? chalk.green(\"✓\")\n : chalk.dim(\"-\"),\n );\n }\n console.log(row.join(\" \"));\n }\n }),\n );\n\nconst statusCommand = new Command()\n .name(\"status\")\n .description(\"Show detailed status of a custom connector\")\n .argument(\"<connector-id>\", \"Custom connector id\")\n .option(\"--agent <id>\", \"Show authorization state for the given agent\")\n .action(\n withErrorHandler(\n async (connectorId: string, options: { agent?: string }) => {\n const [connector, agentCtx] = await Promise.all([\n getZeroCustomConnector(connectorId),\n resolveCustomAgentContext(options.agent),\n ]);\n if (!connector) {\n throw new Error(`Custom connector not found: ${connectorId}`);\n }\n console.log(`Custom connector: ${chalk.cyan(connector.displayName)}`);\n console.log();\n console.log(`${\"ID:\".padEnd(LABEL_WIDTH)}${connector.id}`);\n console.log(\n `${\"Status:\".padEnd(LABEL_WIDTH)}${renderConnected(connector)}`,\n );\n console.log(\n `${\"Prefixes:\".padEnd(LABEL_WIDTH)}${connector.prefixTemplates.join(\", \")}`,\n );\n console.log(\n `${\"Fields:\".padEnd(LABEL_WIDTH)}${connector.fields\n .map((field) => {\n return `${field.kind}:${field.key}${field.required ? \"\" : \"?\"}`;\n })\n .join(\", \")}`,\n );\n if (connector.headerInjections.length > 0) {\n console.log(\n `${\"Headers:\".padEnd(LABEL_WIDTH)}${connector.headerInjections\n .map((header) => {\n return header.name;\n })\n .join(\", \")}`,\n );\n }\n if (connector.queryInjections.length > 0) {\n console.log(\n `${\"Query params:\".padEnd(LABEL_WIDTH)}${connector.queryInjections\n .map((query) => {\n return query.name;\n })\n .join(\", \")}`,\n );\n }\n if (agentCtx) {\n console.log(\n `${\"Authorized:\".padEnd(LABEL_WIDTH)}${\n agentCtx.authorizedIds.has(connector.id)\n ? chalk.green(\"yes\")\n : chalk.yellow(\"no\")\n }`,\n );\n }\n },\n ),\n );\n\nconst proposeCommand = new Command()\n .name(\"propose\")\n .description(\"Create a browser save link for a custom connector proposal\")\n .requiredOption(\"--proposal-file <path>\", \"JSON proposal file\")\n .option(\"--connector-id <id>\", \"Override connector id for update proposals\")\n .option(\"--agent <id>\", \"Authorize this agent when the proposal is saved\")\n .action(\n withErrorHandler(\n async (options: {\n proposalFile: string;\n connectorId?: string;\n agent?: string;\n }) => {\n const raw = await readFile(options.proposalFile, \"utf8\");\n const proposalJson: unknown = JSON.parse(raw);\n if (!isJsonObject(proposalJson)) {\n throw new Error(\"Proposal file must contain a JSON object\");\n }\n const parsed = customConnectorProposalSchema.parse({\n ...proposalJson,\n ...(options.connectorId ? { connectorId: options.connectorId } : {}),\n });\n const origin = await getPlatformOrigin();\n const params = new URLSearchParams({\n p: encodeBase64UrlJson(parsed),\n });\n const agentId = options.agent ?? process.env.ZERO_AGENT_ID;\n if (agentId) {\n params.set(\"agentId\", agentId);\n }\n const url = `${origin}/connectors/custom/proposal?${params.toString()}`;\n console.log(`[Configure ${parsed.displayName}](${url})`);\n console.log();\n console.log(\n \"Open this link to review, save values, and authorize the connector.\",\n );\n },\n ),\n );\n\nexport const customConnectorCommand = new Command()\n .name(\"custom\")\n .description(\"Inspect and propose org custom connectors\")\n .addCommand(listCommand)\n .addCommand(statusCommand)\n .addCommand(proposeCommand);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;;;ACAA;AAyBA,IAAM,iBAAiB;AACvB,IA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,UAAU,QAAQ,SAAS,QAAQ,IAAI;AAC7C,UAAI,SAAS;AACX,eAAO,IAAI,WAAW,OAAO;AAAA,MAC/B;AACA,YAAM,MAAM,GAAG,MAAM,+BAA+B,OAAO,SAAS,CAAC;AACrE,cAAQ,IAAI,cAAc,OAAO,WAAW,KAAK,GAAG,GAAG;AACvD,cAAQ,IAAI;AACZ,cAAQ;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEK,IAAM,yBAAyB,IAAI,QAAQ,EAC/C,KAAK,QAAQ,EACb,YAAY,2CAA2C,EACvD,WAAWC,YAAW,EACtB,WAAWC,cAAa,EACxB,WAAW,cAAc;;;AR1MrB,IAAM,uBAAuB,IAAI,QAAQ,EAC7C,KAAK,WAAW,EAChB,YAAY,6DAA6D,EACzE,WAAW,sBAAsB,EACjC,WAAW,cAAc,EACzB,WAAW,WAAW,EACtB,WAAW,aAAa,EACxB,WAAW,aAAa;","names":["authMethod","LABEL_WIDTH","listCommand","statusCommand"]}
|
|
@@ -8,7 +8,7 @@ import "./chunk-LTDQISD7.js";
|
|
|
8
8
|
import {
|
|
9
9
|
createZeroCreditCheckout,
|
|
10
10
|
getZeroOrgMembers
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-PCBM5SRN.js";
|
|
12
12
|
import {
|
|
13
13
|
withErrorHandler
|
|
14
14
|
} from "./chunk-3F4RFLPX.js";
|
|
@@ -87,4 +87,4 @@ var zeroCreditCommand = new Command().name("credit").description("Create a Strip
|
|
|
87
87
|
export {
|
|
88
88
|
zeroCreditCommand
|
|
89
89
|
};
|
|
90
|
-
//# sourceMappingURL=credit-
|
|
90
|
+
//# sourceMappingURL=credit-FHOJ736M.js.map
|
|
@@ -5,7 +5,7 @@ import "./chunk-LTDQISD7.js";
|
|
|
5
5
|
import {
|
|
6
6
|
requestDeveloperSupportConsent,
|
|
7
7
|
submitDeveloperSupport
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PCBM5SRN.js";
|
|
9
9
|
import {
|
|
10
10
|
withErrorHandler
|
|
11
11
|
} from "./chunk-3F4RFLPX.js";
|
|
@@ -61,4 +61,4 @@ Notes:
|
|
|
61
61
|
export {
|
|
62
62
|
zeroDeveloperSupportCommand
|
|
63
63
|
};
|
|
64
|
-
//# sourceMappingURL=developer-support-
|
|
64
|
+
//# sourceMappingURL=developer-support-BJVUM5OZ.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
findFirewallMetadataPermission,
|
|
6
6
|
getFirewallPermissionSummary,
|
|
7
7
|
loadFirewallPermissionMetadata
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PX6FH3KT.js";
|
|
9
9
|
import {
|
|
10
10
|
getPlatformOrigin,
|
|
11
11
|
toPlatformUrl
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
findMatchingRoutingPermissions,
|
|
15
15
|
matchFirewallBaseUrl
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-IFA2V7EW.js";
|
|
17
17
|
import {
|
|
18
18
|
getConnectorEnvBindingEntries,
|
|
19
19
|
getDiagnosticConnectorTypeForRuntimeEnvName
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-ZQYA5M55.js";
|
|
21
21
|
import "./chunk-LTDQISD7.js";
|
|
22
22
|
import {
|
|
23
23
|
CONNECTOR_TYPES,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
hasUnsafeFirewallPath,
|
|
33
33
|
resolveFirewallBaseUrlTemplate,
|
|
34
34
|
searchZeroConnectors
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-PCBM5SRN.js";
|
|
36
36
|
import {
|
|
37
37
|
ApiRequestError,
|
|
38
38
|
getApiUrl,
|
|
@@ -8446,4 +8446,4 @@ Notes:
|
|
|
8446
8446
|
export {
|
|
8447
8447
|
zeroDoctorCommand
|
|
8448
8448
|
};
|
|
8449
|
-
//# sourceMappingURL=doctor-
|
|
8449
|
+
//# sourceMappingURL=doctor-BDSKVS5W.js.map
|
|
@@ -17,17 +17,12 @@ import {
|
|
|
17
17
|
selectResourceCandidates,
|
|
18
18
|
toGenerationTarget
|
|
19
19
|
} from "./chunk-7HZXC5CL.js";
|
|
20
|
-
import {
|
|
21
|
-
getConnectorGenerationTypes
|
|
22
|
-
} from "./chunk-DAC5OAWI.js";
|
|
23
20
|
import "./chunk-LTDQISD7.js";
|
|
24
21
|
import {
|
|
25
|
-
CONNECTOR_TYPES,
|
|
26
|
-
CONNECTOR_TYPE_KEYS,
|
|
27
22
|
getZeroAgentUserConnectors,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} from "./chunk-
|
|
23
|
+
listZeroConnectorCatalog,
|
|
24
|
+
listZeroConnectorCatalogStatus
|
|
25
|
+
} from "./chunk-PCBM5SRN.js";
|
|
31
26
|
import {
|
|
32
27
|
generateWebImage,
|
|
33
28
|
generateWebVideo,
|
|
@@ -222,30 +217,46 @@ function toConnectorGenerationType(generationType) {
|
|
|
222
217
|
case "docs-design":
|
|
223
218
|
case "mobile-app-design":
|
|
224
219
|
case "poster":
|
|
220
|
+
case "presentation":
|
|
225
221
|
case "report":
|
|
222
|
+
case "sprite":
|
|
223
|
+
case "website":
|
|
226
224
|
return null;
|
|
227
|
-
|
|
225
|
+
case "audio":
|
|
226
|
+
case "code":
|
|
227
|
+
case "document":
|
|
228
|
+
case "image":
|
|
229
|
+
case "text":
|
|
230
|
+
case "video":
|
|
228
231
|
return generationType;
|
|
229
232
|
}
|
|
230
233
|
}
|
|
231
|
-
function
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
if (
|
|
236
|
-
const
|
|
234
|
+
function findConnector(connectors, provider) {
|
|
235
|
+
const exact = connectors.find((connector) => {
|
|
236
|
+
return connector.connectorRef === provider;
|
|
237
|
+
});
|
|
238
|
+
if (exact) return exact;
|
|
239
|
+
const lower = provider.toLowerCase();
|
|
240
|
+
return connectors.find((connector) => {
|
|
241
|
+
return connector.connectorRef.toLowerCase() === lower;
|
|
242
|
+
}) ?? null;
|
|
243
|
+
}
|
|
244
|
+
async function resolveConnector(provider, generationType) {
|
|
245
|
+
const catalog = await listZeroConnectorCatalog();
|
|
246
|
+
const connector = findConnector(catalog.connectors, provider);
|
|
247
|
+
if (!connector) return null;
|
|
237
248
|
const connectorGenerationType = toConnectorGenerationType(generationType);
|
|
238
|
-
const supports = connectorGenerationType !== null &&
|
|
249
|
+
const supports = connectorGenerationType !== null && connector.generation.some((entry) => {
|
|
239
250
|
return entry === connectorGenerationType;
|
|
240
251
|
});
|
|
241
252
|
return {
|
|
242
|
-
type:
|
|
243
|
-
label:
|
|
253
|
+
type: connector.connectorRef,
|
|
254
|
+
label: connector.label,
|
|
244
255
|
supportsGenerationType: supports
|
|
245
256
|
};
|
|
246
257
|
}
|
|
247
|
-
function printConnectorGuidance(generationType, provider) {
|
|
248
|
-
const guidance = resolveConnector(provider, generationType);
|
|
258
|
+
async function printConnectorGuidance(generationType, provider) {
|
|
259
|
+
const guidance = await resolveConnector(provider, generationType);
|
|
249
260
|
if (!guidance) {
|
|
250
261
|
console.log(`Provider "${provider}" is not a known connector.`);
|
|
251
262
|
console.log("");
|
|
@@ -495,30 +506,20 @@ function getBuiltInCommand(generationType) {
|
|
|
495
506
|
function getGenerationContext(generationType) {
|
|
496
507
|
return GENERATION_CONTEXT[generationType] ?? null;
|
|
497
508
|
}
|
|
498
|
-
function getGenerationConnectors(generationType) {
|
|
499
|
-
return
|
|
500
|
-
return
|
|
501
|
-
}).
|
|
502
|
-
return
|
|
503
|
-
}).sort(([a], [b]) => {
|
|
504
|
-
return a.localeCompare(b);
|
|
509
|
+
function getGenerationConnectors(generationType, connectors) {
|
|
510
|
+
return connectors.filter((connector) => {
|
|
511
|
+
return connector.generation.includes(generationType);
|
|
512
|
+
}).sort((a, b) => {
|
|
513
|
+
return a.connectorRef.localeCompare(b.connectorRef);
|
|
505
514
|
});
|
|
506
515
|
}
|
|
507
|
-
function isConnectorType2(type) {
|
|
508
|
-
return type in CONNECTOR_TYPES;
|
|
509
|
-
}
|
|
510
|
-
async function getFeatureAvailableConnectorTypes() {
|
|
511
|
-
const catalog = await searchZeroConnectors();
|
|
512
|
-
return new Set(
|
|
513
|
-
catalog.connectors.map((connector) => {
|
|
514
|
-
return connector.id;
|
|
515
|
-
}).filter(isConnectorType2)
|
|
516
|
-
);
|
|
517
|
-
}
|
|
518
516
|
function formatAccount(connector) {
|
|
519
|
-
if (connector.externalUsername)
|
|
520
|
-
|
|
521
|
-
|
|
517
|
+
if (connector.connection?.externalUsername) {
|
|
518
|
+
return `@${connector.connection.externalUsername}`;
|
|
519
|
+
}
|
|
520
|
+
if (connector.connection?.externalEmail) {
|
|
521
|
+
return connector.connection.externalEmail;
|
|
522
|
+
}
|
|
522
523
|
return void 0;
|
|
523
524
|
}
|
|
524
525
|
function getAction(status, type, label, agentId, platformOrigin) {
|
|
@@ -549,27 +550,16 @@ function getAction(status, type, label, agentId, platformOrigin) {
|
|
|
549
550
|
return {};
|
|
550
551
|
}
|
|
551
552
|
function toCandidate(params) {
|
|
552
|
-
const {
|
|
553
|
-
|
|
554
|
-
config,
|
|
555
|
-
connector,
|
|
556
|
-
configuredTypes,
|
|
557
|
-
availableTypes,
|
|
558
|
-
authorizedTypes,
|
|
559
|
-
agentId,
|
|
560
|
-
platformOrigin
|
|
561
|
-
} = params;
|
|
553
|
+
const { connector, authorizedTypes, agentId, platformOrigin } = params;
|
|
554
|
+
const type = connector.connectorRef;
|
|
562
555
|
let status;
|
|
563
556
|
let reason;
|
|
564
|
-
if (
|
|
565
|
-
status = "not-available";
|
|
566
|
-
reason = "not available for this account";
|
|
567
|
-
} else if (connector?.connectionStatus === "reconnect-required") {
|
|
557
|
+
if (connector.connectionStatus === "reconnect-required") {
|
|
568
558
|
status = "needs-reconnect";
|
|
569
559
|
reason = "connected, reconnect required";
|
|
570
|
-
} else if (!connector) {
|
|
571
|
-
status =
|
|
572
|
-
reason =
|
|
560
|
+
} else if (!connector.connected) {
|
|
561
|
+
status = "not-connected";
|
|
562
|
+
reason = agentId ? "not connected or authorized for current agent" : "not connected";
|
|
573
563
|
} else if (authorizedTypes && !authorizedTypes.has(type)) {
|
|
574
564
|
status = "not-authorized";
|
|
575
565
|
reason = "connected, not authorized for current agent";
|
|
@@ -579,12 +569,12 @@ function toCandidate(params) {
|
|
|
579
569
|
}
|
|
580
570
|
return {
|
|
581
571
|
type,
|
|
582
|
-
label:
|
|
572
|
+
label: connector.label,
|
|
583
573
|
status,
|
|
584
574
|
reason,
|
|
585
|
-
account: connector ? formatAccount(connector) : void 0,
|
|
586
|
-
authMethod: connector?.authMethod,
|
|
587
|
-
...getAction(status, type,
|
|
575
|
+
account: connector.connected ? formatAccount(connector) : void 0,
|
|
576
|
+
authMethod: connector.connection?.authMethod,
|
|
577
|
+
...getAction(status, type, connector.label, agentId, platformOrigin)
|
|
588
578
|
};
|
|
589
579
|
}
|
|
590
580
|
function pad(value, width) {
|
|
@@ -691,27 +681,16 @@ function renderText(params) {
|
|
|
691
681
|
async function runLister(generationType, options = {}) {
|
|
692
682
|
const connectorGenerationType = getConnectorGenerationType(generationType);
|
|
693
683
|
const agentId = process.env.ZERO_AGENT_ID;
|
|
694
|
-
const [
|
|
695
|
-
|
|
696
|
-
getFeatureAvailableConnectorTypes(),
|
|
684
|
+
const [catalog, enabledTypes, platformOrigin] = await Promise.all([
|
|
685
|
+
listZeroConnectorCatalogStatus(),
|
|
697
686
|
agentId ? getZeroAgentUserConnectors(agentId) : Promise.resolve(null),
|
|
698
687
|
getPlatformOrigin()
|
|
699
688
|
]);
|
|
700
|
-
const connectedMap = new Map(
|
|
701
|
-
connectorList.connectors.map((connector) => {
|
|
702
|
-
return [connector.type, connector];
|
|
703
|
-
})
|
|
704
|
-
);
|
|
705
|
-
const configuredTypes = new Set(connectorList.configuredTypes);
|
|
706
689
|
const authorizedTypes = enabledTypes ? new Set(enabledTypes) : null;
|
|
707
|
-
const candidates = connectorGenerationType ? getGenerationConnectors(connectorGenerationType).map(
|
|
708
|
-
(
|
|
690
|
+
const candidates = connectorGenerationType ? getGenerationConnectors(connectorGenerationType, catalog.connectors).map(
|
|
691
|
+
(connector) => {
|
|
709
692
|
return toCandidate({
|
|
710
|
-
|
|
711
|
-
config,
|
|
712
|
-
connector: connectedMap.get(connectorType),
|
|
713
|
-
configuredTypes,
|
|
714
|
-
availableTypes,
|
|
693
|
+
connector,
|
|
715
694
|
authorizedTypes,
|
|
716
695
|
agentId,
|
|
717
696
|
platformOrigin
|
|
@@ -746,7 +725,7 @@ async function runLister(generationType, options = {}) {
|
|
|
746
725
|
async function dispatchGenerate(options) {
|
|
747
726
|
const provider = options.provider?.trim();
|
|
748
727
|
if (provider && provider !== "built-in") {
|
|
749
|
-
printConnectorGuidance(options.generationType, provider);
|
|
728
|
+
await printConnectorGuidance(options.generationType, provider);
|
|
750
729
|
return { outcome: "handled" };
|
|
751
730
|
}
|
|
752
731
|
const resolvedPrompt = resolvePrompt(options.prompt);
|
|
@@ -2626,7 +2605,7 @@ Notes:
|
|
|
2626
2605
|
withErrorHandler(async (options) => {
|
|
2627
2606
|
const provider = options.provider?.trim();
|
|
2628
2607
|
if (provider && provider !== "built-in") {
|
|
2629
|
-
printConnectorGuidance(config.generationType, provider);
|
|
2608
|
+
await printConnectorGuidance(config.generationType, provider);
|
|
2630
2609
|
return;
|
|
2631
2610
|
}
|
|
2632
2611
|
if (provider === "built-in") {
|
|
@@ -2699,4 +2678,4 @@ var generateCommand = new Command().name("generate").description(
|
|
|
2699
2678
|
export {
|
|
2700
2679
|
generateCommand
|
|
2701
2680
|
};
|
|
2702
|
-
//# sourceMappingURL=generate-
|
|
2681
|
+
//# sourceMappingURL=generate-EA5ZRXFE.js.map
|