{"record":{"id":"4578d8067935d0fd","repo":"ruvnet/ruflo","slug":"agntcy-slim-bindings-is-installed-but-does-not","errorCode":null,"errorMessage":"\"@agntcy/slim-bindings\" is installed but does not export publishAgentRecord()","messagePattern":"\"@agntcy/slim-bindings\" is installed but does not export publishAgentRecord\\(\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"v3/@claude-flow/cli/src/commands/agntcy/publish.ts","lineNumber":144,"sourceCode":"    // Directory publish call.\n    const status = await detectAgntcyRuntime();\n\n    if (!status.configured) {\n      output.printInfo(AGNTCY_NOT_CONFIGURED_MESSAGE);\n      output.printInfo(\n        `Validated OASF record at \"${manifestPath}\" locally (name=${(parsed as OasfAgentRecordShape).name}, ` +\n          `version=${(parsed as OasfAgentRecordShape).version}); publish to the Directory was skipped.`,\n      );\n      return {\n        success: true,\n        data: { published: false, manifestPath, configured: false, reason: status.reason },\n      };\n    }\n\n    try {\n      const mod = (await import(AGNTCY_PACKAGE_NAME)) as AgntcyDirectoryModule;\n      if (typeof mod.publishAgentRecord !== 'function') {\n        throw new Error(`\"${AGNTCY_PACKAGE_NAME}\" is installed but does not export publishAgentRecord()`);\n      }\n      const result = await mod.publishAgentRecord({\n        endpoint: status.endpoint as string,\n        record: parsed as OasfAgentRecordShape,\n      });\n      output.printSuccess(`Published agent record${result?.uri ? ` to ${result.uri}` : ''}.`);\n      return { success: true, data: { published: true, manifestPath, uri: result?.uri } };\n    } catch (error) {\n      const message = error instanceof Error ? error.message : String(error);\n      output.printError(`Directory publish failed: ${message}`);\n      return { success: true, data: { published: false, manifestPath, error: message } };\n    }\n  },\n};\n\nexport { publishCommand as agentPublishCommand };\nexport default publishCommand;\n","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/commands/agntcy/publish.ts#L126-L162","documentation":"Thrown by the 'ruflo agent publish' command (ADR-380 §2). When detectAgntcyRuntime() reports the optional @agntcy/slim-bindings package as installed and an endpoint configured, the command dynamic-imports it and requires a publishAgentRecord() export. If the module loads but lacks that function (wrong, placeholder, or squatted package under the same name), this error is thrown, immediately caught, and surfaced as 'Directory publish failed: ...'. The command still returns success:true with data { published:false, error } — a degraded, non-fatal outcome.","triggerScenarios":"Running `ruflo agent publish` (with a valid OASF manifest) in an environment where some @agntcy/slim-bindings package resolves AND the AGNTCY endpoint is configured, but the resolved module has no publishAgentRecord export. Per the file header, the real package was never published to npm (404 on every plausible name), so any resolvable version is likely a stub or name-squat.","commonSituations":"A private registry or vendored node_modules contains a placeholder package under @agntcy/slim-bindings; a future real version renames its API; a dependency survey installed an unrelated squatted package.","solutions":["Uninstall/remove @agntcy/slim-bindings — the command then takes its 'not configured' path and still validates the manifest locally (the supported behavior today)","If a real runtime is intended, pin the exact version whose exports include publishAgentRecord() and verify with a probe import before publishing","Inspect CommandResult.data.error rather than exit code — the command reports this as published:false with success:true"],"exampleFix":"// before: stub package shadows nothing, publish probe fails\nnpm install @agntcy/slim-bindings  # squatted/placeholder\nruflo agent publish\n// after: remove it; command validates locally and skips Directory publish\nnpm uninstall @agntcy/slim-bindings\nruflo agent publish  # -> 'Validated OASF record ... publish skipped'","handlingStrategy":"fallback","validationCode":"// probe before relying on the publish path\nlet canPublish = false;\ntry {\n  const mod = (await import('@agntcy/slim-bindings')) as { publishAgentRecord?: unknown };\n  canPublish = typeof mod.publishAgentRecord === 'function';\n} catch { canPublish = false; }\nif (!canPublish) skipDirectoryPublish();","typeGuard":"function exportsPublishAgentRecord(m: unknown): m is { publishAgentRecord: (o: { endpoint: string; record: unknown }) => Promise<{ uri?: string }> } {\n  return typeof (m as { publishAgentRecord?: unknown })?.publishAgentRecord === 'function';\n}","tryCatchPattern":"// The command already swallows this; handle the degraded result:\nconst res = await runCommand('agent', ['publish']);\nif (res.success && res.data?.published === false && res.data?.error) {\n  log.warn('directory publish skipped:', res.data.error);\n}","preventionTips":["Do not install @agntcy/slim-bindings until the real runtime ships — the not-configured path validates manifests locally","Pin exact versions and probe optional-peer exports at startup","Treat published:false + error in CommandResult.data as the signal, not the exit code"],"tags":["agntcy","optional-dependency","dynamic-import","package-exports","degraded-mode"],"backgroundTag":"missing-package-export","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}