{"record":{"id":"aaf6aedf1d6b4e30","repo":"ruvnet/ruflo","slug":"agntcy-package-name-is-installed-but-does-not","errorCode":null,"errorMessage":"\"${AGNTCY_PACKAGE_NAME}\" is installed but does not export publishAgentRecord()","messagePattern":"\"(.+?)\" 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/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/commands/agntcy/publish.ts#L126-L162","documentation":"Thrown inside the agent publish command (ADR-380 §2) when the optional package '@agntcy/slim-bindings' is installed and resolves, but its module object does not have a callable 'publishAgentRecord' function. This indicates a version mismatch — the installed version of the SLIM bindings does not export the Directory publish API the command expects. The throw is immediately caught by the enclosing try/catch and returned as a soft failure (success: true, published: false) with the error message in the return data.","triggerScenarios":"RUFLO_AGNTCY_SLIM_ENDPOINT is set, @agntcy/slim-bindings is installed, detectAgntcyRuntime() returns configured: true, but the resolved module's publishAgentRecord is undefined or not a function. This happens with an older or incompatible version of the package.","commonSituations":"An older version of @agntcy/slim-bindings (pre-2.0.0-alpha.5) is installed that does not yet export publishAgentRecord; the package was installed from a different registry or fork with a different API surface; the package.json version pin was accidentally widened.","solutions":["Install or upgrade to the pinned version: npm install @agntcy/slim-bindings@2.0.0-alpha.5 (or later alpha)","Verify the package exports publishAgentRecord by inspecting its dist or types","If the API is genuinely unavailable, rely on the local validation path — the command already returns success with published: false"],"exampleFix":"// before: package.json has\n\"@agntcy/slim-bindings\": \"^1.4.1\"\n\n// after: pin the working alpha\n\"@agntcy/slim-bindings\": \"2.0.0-alpha.5\"","handlingStrategy":"type-guard","validationCode":"import type { AgntcyDirectoryModule } from './publish';\n\nasync function hasPublishAgentRecord(pkgName: string): Promise<boolean> {\n  try {\n    const mod = await import(pkgName) as AgntcyDirectoryModule;\n    return typeof mod.publishAgentRecord === 'function';\n  } catch {\n    return false;\n  }\n}\n\nif (!await hasPublishAgentRecord('@agntcy/slim-bindings')) {\n  console.error('Upgrade @agntcy/slim-bindings to 2.0.0-alpha.5 or later');\n}","typeGuard":"function hasPublishAgentRecord(mod: unknown): mod is { publishAgentRecord: (opts: { endpoint: string; record: unknown }) => Promise<{ uri?: string }> } {\n  return typeof (mod as Record<string, unknown>)?.publishAgentRecord === 'function';\n}","tryCatchPattern":"// The command already catches this internally. Check the return value:\nconst result = await agentPublishCommand.action(ctx);\nif (result.data?.published === false && result.data?.error) {\n  console.error('Publish failed:', result.data.error);\n  // The error is soft — the command returned success: true\n}","preventionTips":["Pin @agntcy/slim-bindings to 2.0.0-alpha.5 in optionalDependencies","Verify the package exports publishAgentRecord before relying on Directory publish","The command degrades gracefully — check result.data.published rather than expecting an exception"],"tags":["agntcy","slim","publish","version-mismatch","optional-dep","adr-380"],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}