ruvnet/ruflo · warning · Error

"${AGNTCY_PACKAGE_NAME}" is installed but does not export pu

Error message

"${AGNTCY_PACKAGE_NAME}" is installed but does not export publishAgentRecord()

What it means

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.

Source

Thrown at v3/@claude-flow/cli/src/commands/agntcy/publish.ts:144

    // Directory publish call.
    const status = await detectAgntcyRuntime();

    if (!status.configured) {
      output.printInfo(AGNTCY_NOT_CONFIGURED_MESSAGE);
      output.printInfo(
        `Validated OASF record at "${manifestPath}" locally (name=${(parsed as OasfAgentRecordShape).name}, ` +
          `version=${(parsed as OasfAgentRecordShape).version}); publish to the Directory was skipped.`,
      );
      return {
        success: true,
        data: { published: false, manifestPath, configured: false, reason: status.reason },
      };
    }

    try {
      const mod = (await import(AGNTCY_PACKAGE_NAME)) as AgntcyDirectoryModule;
      if (typeof mod.publishAgentRecord !== 'function') {
        throw new Error(`"${AGNTCY_PACKAGE_NAME}" is installed but does not export publishAgentRecord()`);
      }
      const result = await mod.publishAgentRecord({
        endpoint: status.endpoint as string,
        record: parsed as OasfAgentRecordShape,
      });
      output.printSuccess(`Published agent record${result?.uri ? ` to ${result.uri}` : ''}.`);
      return { success: true, data: { published: true, manifestPath, uri: result?.uri } };
    } catch (error) {
      const message = error instanceof Error ? error.message : String(error);
      output.printError(`Directory publish failed: ${message}`);
      return { success: true, data: { published: false, manifestPath, error: message } };
    }
  },
};

export { publishCommand as agentPublishCommand };
export default publishCommand;

View on GitHub (pinned to 6b01dc5a68)

Solutions

  1. Install or upgrade to the pinned version: npm install @agntcy/slim-bindings@2.0.0-alpha.5 (or later alpha)
  2. Verify the package exports publishAgentRecord by inspecting its dist or types
  3. If the API is genuinely unavailable, rely on the local validation path — the command already returns success with published: false

Example fix

// before: package.json has
"@agntcy/slim-bindings": "^1.4.1"

// after: pin the working alpha
"@agntcy/slim-bindings": "2.0.0-alpha.5"
Defensive patterns

Strategy: type-guard

Validate before calling

import type { AgntcyDirectoryModule } from './publish';

async function hasPublishAgentRecord(pkgName: string): Promise<boolean> {
  try {
    const mod = await import(pkgName) as AgntcyDirectoryModule;
    return typeof mod.publishAgentRecord === 'function';
  } catch {
    return false;
  }
}

if (!await hasPublishAgentRecord('@agntcy/slim-bindings')) {
  console.error('Upgrade @agntcy/slim-bindings to 2.0.0-alpha.5 or later');
}

Type guard

function hasPublishAgentRecord(mod: unknown): mod is { publishAgentRecord: (opts: { endpoint: string; record: unknown }) => Promise<{ uri?: string }> } {
  return typeof (mod as Record<string, unknown>)?.publishAgentRecord === 'function';
}

Try / catch

// The command already catches this internally. Check the return value:
const result = await agentPublishCommand.action(ctx);
if (result.data?.published === false && result.data?.error) {
  console.error('Publish failed:', result.data.error);
  // The error is soft — the command returned success: true
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of ruvnet/ruflo@6b01dc5a68 (2026-08-12). Data as JSON: /api/errors/aaf6aedf1d6b4e30. Report an issue: GitHub.