{"record":{"id":"ca190304a340e93f","repo":"coleam00/Archon","slug":"unexpected-marketplace-response-format-expected-a","errorCode":null,"errorMessage":"Unexpected marketplace response format (expected array)","messagePattern":"Unexpected marketplace response format \\(expected array\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":5000,"sourceCode":"}\n\nconst DEFAULT_MARKETPLACE_URL = 'https://archon.diy/workflows.json';\n\nasync function fetchMarketplace(): Promise<MarketplaceEntryJson[]> {\n  const url = process.env.ARCHON_MARKETPLACE_URL ?? DEFAULT_MARKETPLACE_URL;\n  let res: Response;\n  try {\n    res = await fetch(url);\n  } catch (error) {\n    const err = error as Error;\n    throw new Error(`Cannot reach marketplace at ${url}: ${err.message}`);\n  }\n  if (!res.ok) {\n    throw new Error(`Marketplace fetch failed: HTTP ${String(res.status)} from ${url}`);\n  }\n  const raw: unknown = await res.json();\n  if (!Array.isArray(raw)) {\n    throw new Error('Unexpected marketplace response format (expected array)');\n  }\n  for (const item of raw) {\n    if (\n      typeof item !== 'object' ||\n      item === null ||\n      typeof (item as Record<string, unknown>).slug !== 'string' ||\n      typeof (item as Record<string, unknown>).sourceUrl !== 'string' ||\n      !Array.isArray((item as Record<string, unknown>).tags)\n    ) {\n      throw new Error('Marketplace response contains invalid entries');\n    }\n  }\n  return raw as MarketplaceEntryJson[];\n}\n\nexport async function workflowSearchCommand(query?: string, json?: boolean): Promise<void> {\n  const entries = await fetchMarketplace();\n","sourceCodeStart":4982,"sourceCodeEnd":5018,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L4982-L5018","documentation":"Error \"Unexpected marketplace response format (expected array)\" thrown in coleam00/Archon.","triggerScenarios":"Thrown at packages/cli/src/commands/workflow.ts:5000 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}