function assertTenantContext(ctx) {
  if (typeof ctx.tenantId !== "string" || ctx.tenantId.length === 0) {
    throw new Error("[search.inbox_ops] Missing tenantId in search build context");
  }
}
const searchConfig = {
  entities: [
    {
      entityId: "inbox_ops:inbox_proposal",
      enabled: true,
      priority: 6,
      fieldPolicy: {
        searchable: ["summary", "category"],
        excluded: ["metadata", "participants"]
      },
      buildSource: async (ctx) => {
        assertTenantContext(ctx);
        const record = ctx.record;
        if (!record.summary) return null;
        return {
          text: String(record.summary || ""),
          fields: {
            status: record.status,
            confidence: record.confidence,
            category: record.category,
            detected_language: record.detected_language
          },
          presenter: {
            title: String(record.summary || "Inbox Proposal").slice(0, 80),
            subtitle: `Confidence: ${record.confidence} - Status: ${record.status}${record.category ? ` - Category: ${record.category}` : ""}`,
            icon: "inbox"
          },
          checksumSource: {
            summary: record.summary,
            status: record.status,
            confidence: record.confidence,
            category: record.category,
            detectedLanguage: record.detected_language
          }
        };
      },
      formatResult: async (ctx) => {
        return {
          title: String(ctx.record.summary || "Inbox Proposal").slice(0, 80),
          subtitle: `Confidence: ${ctx.record.confidence} - Status: ${ctx.record.status}${ctx.record.category ? ` - Category: ${ctx.record.category}` : ""}`,
          icon: "inbox"
        };
      },
      resolveUrl: async (ctx) => {
        const id = ctx.record.id;
        if (!id) return null;
        return `/backend/inbox-ops/proposals/${encodeURIComponent(String(id))}`;
      }
    }
  ]
};
const config = searchConfig;
var search_default = searchConfig;
export {
  config,
  search_default as default,
  searchConfig
};
//# sourceMappingURL=search.js.map
