// @bun
// src/components/docs/knowledge/KnowledgeOverviewPage.tsx
import Link from "@contractspec/lib.ui-link";
import { ChevronRight } from "lucide-react";
import { jsx, jsxs } from "react/jsx-runtime";
function KnowledgeOverviewPage() {
  return /* @__PURE__ */ jsxs("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h1", {
            className: "text-4xl font-bold",
            children: "Knowledge & Context"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground",
            children: "ContractSpec provides first-class support for knowledge management, enabling semantic search, RAG (Retrieval-Augmented Generation), and context-aware decision-making. Knowledge is organized into typed spaces with different trust levels and access controls."
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Why knowledge matters"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground",
            children: "Modern applications need to:"
          }),
          /* @__PURE__ */ jsxs("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsxs("li", {
                children: [
                  /* @__PURE__ */ jsx("strong", {
                    children: "Understand context"
                  }),
                  " - Access relevant information to make informed decisions"
                ]
              }),
              /* @__PURE__ */ jsxs("li", {
                children: [
                  /* @__PURE__ */ jsx("strong", {
                    children: "Learn from history"
                  }),
                  " - Use past interactions to improve future responses"
                ]
              }),
              /* @__PURE__ */ jsxs("li", {
                children: [
                  /* @__PURE__ */ jsx("strong", {
                    children: "Trust sources"
                  }),
                  " - Distinguish between authoritative and reference information"
                ]
              }),
              /* @__PURE__ */ jsxs("li", {
                children: [
                  /* @__PURE__ */ jsx("strong", {
                    children: "Scale knowledge"
                  }),
                  " - Handle growing amounts of documentation and data"
                ]
              }),
              /* @__PURE__ */ jsxs("li", {
                children: [
                  /* @__PURE__ */ jsx("strong", {
                    children: "Maintain privacy"
                  }),
                  " - Keep tenant knowledge isolated and secure"
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Knowledge architecture"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground",
            children: "ContractSpec's knowledge system has three main components:"
          }),
          /* @__PURE__ */ jsxs("div", {
            className: "space-y-6",
            children: [
              /* @__PURE__ */ jsxs("div", {
                className: "card-subtle p-4",
                children: [
                  /* @__PURE__ */ jsx("h3", {
                    className: "mb-2 text-lg font-semibold",
                    children: "1. Knowledge Categories"
                  }),
                  /* @__PURE__ */ jsx("p", {
                    className: "text-muted-foreground mb-3 text-sm",
                    children: "Four trust levels that determine how knowledge is used:"
                  }),
                  /* @__PURE__ */ jsxs("div", {
                    className: "space-y-2 text-sm",
                    children: [
                      /* @__PURE__ */ jsxs("div", {
                        className: "flex items-start gap-3",
                        children: [
                          /* @__PURE__ */ jsx("code", {
                            className: "bg-background/50 rounded px-2 py-1 text-xs",
                            children: "canonical"
                          }),
                          /* @__PURE__ */ jsx("span", {
                            className: "text-muted-foreground",
                            children: "Ground truth - product specs, schemas, official policies"
                          })
                        ]
                      }),
                      /* @__PURE__ */ jsxs("div", {
                        className: "flex items-start gap-3",
                        children: [
                          /* @__PURE__ */ jsx("code", {
                            className: "bg-background/50 rounded px-2 py-1 text-xs",
                            children: "operational"
                          }),
                          /* @__PURE__ */ jsx("span", {
                            className: "text-muted-foreground",
                            children: "Internal docs - support tickets, runbooks, sales materials"
                          })
                        ]
                      }),
                      /* @__PURE__ */ jsxs("div", {
                        className: "flex items-start gap-3",
                        children: [
                          /* @__PURE__ */ jsx("code", {
                            className: "bg-background/50 rounded px-2 py-1 text-xs",
                            children: "external"
                          }),
                          /* @__PURE__ */ jsx("span", {
                            className: "text-muted-foreground",
                            children: "Third-party - PSP docs, regulations, integration guides"
                          })
                        ]
                      }),
                      /* @__PURE__ */ jsxs("div", {
                        className: "flex items-start gap-3",
                        children: [
                          /* @__PURE__ */ jsx("code", {
                            className: "bg-background/50 rounded px-2 py-1 text-xs",
                            children: "ephemeral"
                          }),
                          /* @__PURE__ */ jsx("span", {
                            className: "text-muted-foreground",
                            children: "Temporary - agent scratchpads, session context, drafts"
                          })
                        ]
                      })
                    ]
                  }),
                  /* @__PURE__ */ jsx(Link, {
                    href: "/docs/knowledge/categories",
                    className: "mt-3 inline-block text-sm text-violet-400 hover:text-violet-300",
                    children: "Learn more about categories \u2192"
                  })
                ]
              }),
              /* @__PURE__ */ jsxs("div", {
                className: "card-subtle p-4",
                children: [
                  /* @__PURE__ */ jsx("h3", {
                    className: "mb-2 text-lg font-semibold",
                    children: "2. Knowledge Spaces"
                  }),
                  /* @__PURE__ */ jsx("p", {
                    className: "text-muted-foreground mb-3 text-sm",
                    children: "Logical domains of knowledge defined globally:"
                  }),
                  /* @__PURE__ */ jsx("div", {
                    className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded border p-3 font-mono text-xs",
                    children: /* @__PURE__ */ jsx("pre", {
                      children: `type KnowledgeSpaceSpec = {
  id: string;
  label: string;
  category: KnowledgeCategory;
  storageStrategy: "vector" | "search" | "hybrid";
  indexProvider: string;  // e.g., "qdrant"
  retentionPolicy: { days?: number };
  intendedAudience: "agents" | "humans" | "admin-only";
};`
                    })
                  }),
                  /* @__PURE__ */ jsx(Link, {
                    href: "/docs/knowledge/spaces",
                    className: "mt-3 inline-block text-sm text-violet-400 hover:text-violet-300",
                    children: "Learn more about spaces \u2192"
                  })
                ]
              }),
              /* @__PURE__ */ jsxs("div", {
                className: "card-subtle p-4",
                children: [
                  /* @__PURE__ */ jsx("h3", {
                    className: "mb-2 text-lg font-semibold",
                    children: "3. Knowledge Sources"
                  }),
                  /* @__PURE__ */ jsx("p", {
                    className: "text-muted-foreground mb-3 text-sm",
                    children: "Per-tenant data sources that feed knowledge spaces:"
                  }),
                  /* @__PURE__ */ jsx("div", {
                    className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded border p-3 font-mono text-xs",
                    children: /* @__PURE__ */ jsx("pre", {
                      children: `type KnowledgeSourceConfig = {
  id: string;
  tenantId: string;
  spaceId: string;
  kind: "uploaded-document" | "url" | "email" 
        | "notion" | "database-query" | "raw-text";
  location: string;
  syncPolicy: { interval?: string; webhook?: boolean };
  lastSyncedAt?: string;
};`
                    })
                  }),
                  /* @__PURE__ */ jsx(Link, {
                    href: "/docs/knowledge/sources",
                    className: "mt-3 inline-block text-sm text-violet-400 hover:text-violet-300",
                    children: "Learn more about sources \u2192"
                  })
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "How it works"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground",
            children: "Knowledge flows through ContractSpec in four stages:"
          }),
          /* @__PURE__ */ jsxs("ol", {
            className: "text-muted-foreground list-inside list-decimal space-y-3",
            children: [
              /* @__PURE__ */ jsxs("li", {
                children: [
                  /* @__PURE__ */ jsx("strong", {
                    children: "Define spaces"
                  }),
                  ' - Create KnowledgeSpaceSpec for each logical domain (e.g., "Product Canon", "Support FAQ")'
                ]
              }),
              /* @__PURE__ */ jsxs("li", {
                children: [
                  /* @__PURE__ */ jsx("strong", {
                    children: "Configure sources"
                  }),
                  " - Tenants connect their data sources (Notion, Gmail, uploads, etc.)"
                ]
              }),
              /* @__PURE__ */ jsxs("li", {
                children: [
                  /* @__PURE__ */ jsx("strong", {
                    children: "Sync & index"
                  }),
                  " - Sources are synced, chunked, and indexed in vector databases"
                ]
              }),
              /* @__PURE__ */ jsxs("li", {
                children: [
                  /* @__PURE__ */ jsx("strong", {
                    children: "Query & retrieve"
                  }),
                  " - Workflows and agents perform semantic search to find relevant context"
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Use cases"
          }),
          /* @__PURE__ */ jsxs("div", {
            className: "grid gap-4 md:grid-cols-2",
            children: [
              /* @__PURE__ */ jsxs("div", {
                className: "card-subtle p-4",
                children: [
                  /* @__PURE__ */ jsx("h3", {
                    className: "mb-2 font-semibold",
                    children: "Support Agents"
                  }),
                  /* @__PURE__ */ jsx("p", {
                    className: "text-muted-foreground text-sm",
                    children: "Answer customer questions using product documentation (canonical) and past support tickets (operational)."
                  })
                ]
              }),
              /* @__PURE__ */ jsxs("div", {
                className: "card-subtle p-4",
                children: [
                  /* @__PURE__ */ jsx("h3", {
                    className: "mb-2 font-semibold",
                    children: "Invoice Generation"
                  }),
                  /* @__PURE__ */ jsx("p", {
                    className: "text-muted-foreground text-sm",
                    children: "Generate invoices using product catalog (canonical) and pricing rules (operational)."
                  })
                ]
              }),
              /* @__PURE__ */ jsxs("div", {
                className: "card-subtle p-4",
                children: [
                  /* @__PURE__ */ jsx("h3", {
                    className: "mb-2 font-semibold",
                    children: "Compliance Checking"
                  }),
                  /* @__PURE__ */ jsx("p", {
                    className: "text-muted-foreground text-sm",
                    children: "Validate operations against regulatory requirements (external) and internal policies (canonical)."
                  })
                ]
              }),
              /* @__PURE__ */ jsxs("div", {
                className: "card-subtle p-4",
                children: [
                  /* @__PURE__ */ jsx("h3", {
                    className: "mb-2 font-semibold",
                    children: "Semantic Search"
                  }),
                  /* @__PURE__ */ jsx("p", {
                    className: "text-muted-foreground text-sm",
                    children: "Find relevant documents, tickets, or records using natural language queries."
                  })
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Integration with workflows"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground",
            children: "Knowledge spaces are consumed by workflows through standard capabilities:"
          }),
          /* @__PURE__ */ jsx("div", {
            className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
            children: /* @__PURE__ */ jsx("pre", {
              children: `import { defineWorkflow } from '@contractspec/lib.contracts-spec/workflow';
import { OpenAIEmbeddings, VectorSearch, OpenAIChat } from './specs';

export const AnswerSupportQuestion = defineWorkflow({
  meta: {
    key: 'support.answerQuestion',
    version: '1.0.0',
    description: 'Answer support questions using RAG',
    owners: ['team-support'],
    tags: ['ai', 'support'],
    stability: 'stable',
  },
  steps: [
    {
      id: 'embed-question',
      operation: OpenAIEmbeddings,
      inputs: (ctx, input) => ({
        text: input.question,
      }),
    },
    {
      id: 'search-knowledge',
      operation: VectorSearch,
      inputs: (ctx, input, steps) => ({
        collection: 'product-canon', // KnowledgeSpace
        vector: steps['embed-question'].output.embedding,
        limit: 5,
      }),
    },
    {
      id: 'generate-answer',
      operation: OpenAIChat,
      inputs: (ctx, input, steps) => ({
        messages: [
          { role: 'system', content: 'Answer using the provided context' },
          { 
            role: 'user', 
            content: \`Context: \${steps['search-knowledge'].output.results}\\nQuestion: \${input.question}\`
          },
        ],
      }),
    },
  ],
});`
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Real-world examples"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground",
            children: "See how different applications use knowledge spaces:"
          }),
          /* @__PURE__ */ jsxs(Link, {
            href: "/docs/knowledge/examples",
            className: "btn-primary inline-flex items-center gap-2",
            children: [
              "View Examples ",
              /* @__PURE__ */ jsx(ChevronRight, {
                size: 16
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "flex items-center gap-4 pt-4",
        children: [
          /* @__PURE__ */ jsxs(Link, {
            href: "/docs/knowledge/categories",
            className: "btn-primary",
            children: [
              "Knowledge Categories ",
              /* @__PURE__ */ jsx(ChevronRight, {
                size: 16
              })
            ]
          }),
          /* @__PURE__ */ jsx(Link, {
            href: "/docs/knowledge/spaces",
            className: "btn-ghost",
            children: "Knowledge Spaces"
          })
        ]
      })
    ]
  });
}

// src/components/docs/knowledge/KnowledgeCategoriesPage.tsx
import Link2 from "@contractspec/lib.ui-link";
import { ChevronRight as ChevronRight2 } from "lucide-react";
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
function KnowledgeCategoriesPage() {
  return /* @__PURE__ */ jsxs2("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs2("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx2("h1", {
            className: "text-4xl font-bold",
            children: "Knowledge Categories"
          }),
          /* @__PURE__ */ jsx2("p", {
            className: "text-muted-foreground",
            children: "ContractSpec classifies knowledge into four categories based on trust level, source authority, and intended use. This classification determines how knowledge can be used in workflows, policy decisions, and agent responses."
          })
        ]
      }),
      /* @__PURE__ */ jsxs2("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx2("h2", {
            className: "text-2xl font-bold",
            children: "The four categories"
          }),
          /* @__PURE__ */ jsx2("div", {
            className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
            children: /* @__PURE__ */ jsx2("pre", {
              children: `type KnowledgeCategory =
  | "canonical"   // Internal ground truth
  | "operational" // Internal operational docs
  | "external"    // Third-party reference
  | "ephemeral";  // Temporary context`
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs2("div", {
        className: "space-y-6",
        children: [
          /* @__PURE__ */ jsxs2("div", {
            className: "space-y-4",
            children: [
              /* @__PURE__ */ jsx2("h3", {
                className: "text-xl font-semibold",
                children: "1. Canonical"
              }),
              /* @__PURE__ */ jsxs2("p", {
                className: "text-muted-foreground",
                children: [
                  /* @__PURE__ */ jsx2("strong", {
                    children: "Trust level:"
                  }),
                  " Highest - Authoritative ground truth"
                ]
              }),
              /* @__PURE__ */ jsxs2("div", {
                className: "space-y-3",
                children: [
                  /* @__PURE__ */ jsxs2("div", {
                    children: [
                      /* @__PURE__ */ jsx2("h4", {
                        className: "mb-2 text-sm font-semibold",
                        children: "What it contains:"
                      }),
                      /* @__PURE__ */ jsxs2("ul", {
                        className: "text-muted-foreground ml-4 list-inside list-disc space-y-1 text-sm",
                        children: [
                          /* @__PURE__ */ jsx2("li", {
                            children: "Official product specifications and schemas"
                          }),
                          /* @__PURE__ */ jsx2("li", {
                            children: "Company policies and procedures"
                          }),
                          /* @__PURE__ */ jsx2("li", {
                            children: "Legal terms and compliance requirements"
                          }),
                          /* @__PURE__ */ jsx2("li", {
                            children: "Pricing rules and business logic"
                          }),
                          /* @__PURE__ */ jsx2("li", {
                            children: "Data classification and security policies"
                          })
                        ]
                      })
                    ]
                  }),
                  /* @__PURE__ */ jsxs2("div", {
                    children: [
                      /* @__PURE__ */ jsx2("h4", {
                        className: "mb-2 text-sm font-semibold",
                        children: "How it's used:"
                      }),
                      /* @__PURE__ */ jsxs2("ul", {
                        className: "text-muted-foreground ml-4 list-inside list-disc space-y-1 text-sm",
                        children: [
                          /* @__PURE__ */ jsxs2("li", {
                            children: [
                              /* @__PURE__ */ jsx2("strong", {
                                children: "Policy decisions"
                              }),
                              " - Can drive PDP decisions"
                            ]
                          }),
                          /* @__PURE__ */ jsxs2("li", {
                            children: [
                              /* @__PURE__ */ jsx2("strong", {
                                children: "Validation"
                              }),
                              " - Used to validate user inputs and operations"
                            ]
                          }),
                          /* @__PURE__ */ jsxs2("li", {
                            children: [
                              /* @__PURE__ */ jsx2("strong", {
                                children: "Code generation"
                              }),
                              " - Source of truth for generated code"
                            ]
                          }),
                          /* @__PURE__ */ jsxs2("li", {
                            children: [
                              /* @__PURE__ */ jsx2("strong", {
                                children: "Compliance"
                              }),
                              " - Reference for audit and regulatory checks"
                            ]
                          })
                        ]
                      })
                    ]
                  }),
                  /* @__PURE__ */ jsxs2("div", {
                    children: [
                      /* @__PURE__ */ jsx2("h4", {
                        className: "mb-2 text-sm font-semibold",
                        children: "Examples:"
                      }),
                      /* @__PURE__ */ jsx2("div", {
                        className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded border p-3 font-mono text-xs",
                        children: /* @__PURE__ */ jsx2("pre", {
                          children: `// Product Canon space
{
  id: "product-canon",
  category: "canonical",
  sources: [
    "database-schema.sql",
    "product-catalog.yaml",
    "pricing-rules.json"
  ]
}

// Policy Canon space
{
  id: "policy-canon",
  category: "canonical",
  sources: [
    "data-classification.yaml",
    "access-policies.rego",
    "compliance-requirements.md"
  ]
}`
                        })
                      })
                    ]
                  }),
                  /* @__PURE__ */ jsx2("div", {
                    className: "card-subtle border-violet-500/30 bg-violet-500/10 p-3",
                    children: /* @__PURE__ */ jsxs2("p", {
                      className: "text-sm text-violet-300",
                      children: [
                        /* @__PURE__ */ jsx2("strong", {
                          children: "\u26A0\uFE0F Important:"
                        }),
                        " Canonical knowledge is immutable once indexed. Changes require re-sync and versioning."
                      ]
                    })
                  })
                ]
              })
            ]
          }),
          /* @__PURE__ */ jsxs2("div", {
            className: "space-y-4",
            children: [
              /* @__PURE__ */ jsx2("h3", {
                className: "text-xl font-semibold",
                children: "2. Operational"
              }),
              /* @__PURE__ */ jsxs2("p", {
                className: "text-muted-foreground",
                children: [
                  /* @__PURE__ */ jsx2("strong", {
                    children: "Trust level:"
                  }),
                  " High - Internal but not authoritative"
                ]
              }),
              /* @__PURE__ */ jsxs2("div", {
                className: "space-y-3",
                children: [
                  /* @__PURE__ */ jsxs2("div", {
                    children: [
                      /* @__PURE__ */ jsx2("h4", {
                        className: "mb-2 text-sm font-semibold",
                        children: "What it contains:"
                      }),
                      /* @__PURE__ */ jsxs2("ul", {
                        className: "text-muted-foreground ml-4 list-inside list-disc space-y-1 text-sm",
                        children: [
                          /* @__PURE__ */ jsx2("li", {
                            children: "Support ticket history and resolutions"
                          }),
                          /* @__PURE__ */ jsx2("li", {
                            children: "Internal runbooks and playbooks"
                          }),
                          /* @__PURE__ */ jsx2("li", {
                            children: "Sales materials and customer communications"
                          }),
                          /* @__PURE__ */ jsx2("li", {
                            children: "Product management docs and roadmaps"
                          }),
                          /* @__PURE__ */ jsx2("li", {
                            children: "Team wikis and knowledge bases"
                          })
                        ]
                      })
                    ]
                  }),
                  /* @__PURE__ */ jsxs2("div", {
                    children: [
                      /* @__PURE__ */ jsx2("h4", {
                        className: "mb-2 text-sm font-semibold",
                        children: "How it's used:"
                      }),
                      /* @__PURE__ */ jsxs2("ul", {
                        className: "text-muted-foreground ml-4 list-inside list-disc space-y-1 text-sm",
                        children: [
                          /* @__PURE__ */ jsxs2("li", {
                            children: [
                              /* @__PURE__ */ jsx2("strong", {
                                children: "Context"
                              }),
                              " - Provides helpful context for decisions"
                            ]
                          }),
                          /* @__PURE__ */ jsxs2("li", {
                            children: [
                              /* @__PURE__ */ jsx2("strong", {
                                children: "Suggestions"
                              }),
                              " - Informs recommendations, not requirements"
                            ]
                          }),
                          /* @__PURE__ */ jsxs2("li", {
                            children: [
                              /* @__PURE__ */ jsx2("strong", {
                                children: "Learning"
                              }),
                              " - Helps agents learn from past interactions"
                            ]
                          }),
                          /* @__PURE__ */ jsxs2("li", {
                            children: [
                              /* @__PURE__ */ jsx2("strong", {
                                children: "Troubleshooting"
                              }),
                              " - Guides problem-solving workflows"
                            ]
                          })
                        ]
                      })
                    ]
                  }),
                  /* @__PURE__ */ jsxs2("div", {
                    children: [
                      /* @__PURE__ */ jsx2("h4", {
                        className: "mb-2 text-sm font-semibold",
                        children: "Examples:"
                      }),
                      /* @__PURE__ */ jsx2("div", {
                        className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded border p-3 font-mono text-xs",
                        children: /* @__PURE__ */ jsx2("pre", {
                          children: `// Support History space
{
  id: "support-history",
  category: "operational",
  sources: [
    "gmail:support@company.com",
    "zendesk:tickets",
    "slack:support-channel"
  ]
}

// Internal Docs space
{
  id: "internal-docs",
  category: "operational",
  sources: [
    "notion:engineering-wiki",
    "confluence:product-docs",
    "google-drive:runbooks"
  ]
}`
                        })
                      })
                    ]
                  })
                ]
              })
            ]
          }),
          /* @__PURE__ */ jsxs2("div", {
            className: "space-y-4",
            children: [
              /* @__PURE__ */ jsx2("h3", {
                className: "text-xl font-semibold",
                children: "3. External"
              }),
              /* @__PURE__ */ jsxs2("p", {
                className: "text-muted-foreground",
                children: [
                  /* @__PURE__ */ jsx2("strong", {
                    children: "Trust level:"
                  }),
                  " Medium - Reference only"
                ]
              }),
              /* @__PURE__ */ jsxs2("div", {
                className: "space-y-3",
                children: [
                  /* @__PURE__ */ jsxs2("div", {
                    children: [
                      /* @__PURE__ */ jsx2("h4", {
                        className: "mb-2 text-sm font-semibold",
                        children: "What it contains:"
                      }),
                      /* @__PURE__ */ jsxs2("ul", {
                        className: "text-muted-foreground ml-4 list-inside list-disc space-y-1 text-sm",
                        children: [
                          /* @__PURE__ */ jsx2("li", {
                            children: "Third-party integration documentation (Stripe, Twilio)"
                          }),
                          /* @__PURE__ */ jsx2("li", {
                            children: "Regulatory and compliance documents"
                          }),
                          /* @__PURE__ */ jsx2("li", {
                            children: "Industry standards and best practices"
                          }),
                          /* @__PURE__ */ jsx2("li", {
                            children: "Public API documentation"
                          }),
                          /* @__PURE__ */ jsx2("li", {
                            children: "External knowledge bases"
                          })
                        ]
                      })
                    ]
                  }),
                  /* @__PURE__ */ jsxs2("div", {
                    children: [
                      /* @__PURE__ */ jsx2("h4", {
                        className: "mb-2 text-sm font-semibold",
                        children: "How it's used:"
                      }),
                      /* @__PURE__ */ jsxs2("ul", {
                        className: "text-muted-foreground ml-4 list-inside list-disc space-y-1 text-sm",
                        children: [
                          /* @__PURE__ */ jsxs2("li", {
                            children: [
                              /* @__PURE__ */ jsx2("strong", {
                                children: "Reference"
                              }),
                              " - Consulted but not authoritative"
                            ]
                          }),
                          /* @__PURE__ */ jsxs2("li", {
                            children: [
                              /* @__PURE__ */ jsx2("strong", {
                                children: "Integration help"
                              }),
                              " - Guides external API usage"
                            ]
                          }),
                          /* @__PURE__ */ jsxs2("li", {
                            children: [
                              /* @__PURE__ */ jsx2("strong", {
                                children: "Compliance context"
                              }),
                              " - Provides regulatory background"
                            ]
                          }),
                          /* @__PURE__ */ jsxs2("li", {
                            children: [
                              /* @__PURE__ */ jsx2("strong", {
                                children: "Never for policy"
                              }),
                              " - Cannot drive policy decisions"
                            ]
                          })
                        ]
                      })
                    ]
                  }),
                  /* @__PURE__ */ jsxs2("div", {
                    children: [
                      /* @__PURE__ */ jsx2("h4", {
                        className: "mb-2 text-sm font-semibold",
                        children: "Examples:"
                      }),
                      /* @__PURE__ */ jsx2("div", {
                        className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded border p-3 font-mono text-xs",
                        children: /* @__PURE__ */ jsx2("pre", {
                          children: `// External Provider Docs space
{
  id: "provider-docs",
  category: "external",
  sources: [
    "url:https://stripe.com/docs",
    "url:https://twilio.com/docs",
    "url:https://openai.com/docs"
  ]
}

// Regulatory Docs space
{
  id: "regulatory-docs",
  category: "external",
  sources: [
    "url:https://gdpr.eu/",
    "url:https://www.hhs.gov/hipaa",
    "pdf:SOC2-requirements.pdf"
  ]
}`
                        })
                      })
                    ]
                  }),
                  /* @__PURE__ */ jsx2("div", {
                    className: "card-subtle border-amber-500/30 bg-amber-500/10 p-3",
                    children: /* @__PURE__ */ jsxs2("p", {
                      className: "text-sm text-amber-300",
                      children: [
                        /* @__PURE__ */ jsx2("strong", {
                          children: "\u26A0\uFE0F Note:"
                        }),
                        ` External knowledge should be clearly marked in agent responses as "according to [source]" to indicate it's not internal authority.`
                      ]
                    })
                  })
                ]
              })
            ]
          }),
          /* @__PURE__ */ jsxs2("div", {
            className: "space-y-4",
            children: [
              /* @__PURE__ */ jsx2("h3", {
                className: "text-xl font-semibold",
                children: "4. Ephemeral"
              }),
              /* @__PURE__ */ jsxs2("p", {
                className: "text-muted-foreground",
                children: [
                  /* @__PURE__ */ jsx2("strong", {
                    children: "Trust level:"
                  }),
                  " Low - Temporary context only"
                ]
              }),
              /* @__PURE__ */ jsxs2("div", {
                className: "space-y-3",
                children: [
                  /* @__PURE__ */ jsxs2("div", {
                    children: [
                      /* @__PURE__ */ jsx2("h4", {
                        className: "mb-2 text-sm font-semibold",
                        children: "What it contains:"
                      }),
                      /* @__PURE__ */ jsxs2("ul", {
                        className: "text-muted-foreground ml-4 list-inside list-disc space-y-1 text-sm",
                        children: [
                          /* @__PURE__ */ jsx2("li", {
                            children: "Agent conversation history and scratchpads"
                          }),
                          /* @__PURE__ */ jsx2("li", {
                            children: "Session-specific context and state"
                          }),
                          /* @__PURE__ */ jsx2("li", {
                            children: "Draft documents and work-in-progress"
                          }),
                          /* @__PURE__ */ jsx2("li", {
                            children: "Temporary calculations and intermediate results"
                          }),
                          /* @__PURE__ */ jsx2("li", {
                            children: "User-provided context for current task"
                          })
                        ]
                      })
                    ]
                  }),
                  /* @__PURE__ */ jsxs2("div", {
                    children: [
                      /* @__PURE__ */ jsx2("h4", {
                        className: "mb-2 text-sm font-semibold",
                        children: "How it's used:"
                      }),
                      /* @__PURE__ */ jsxs2("ul", {
                        className: "text-muted-foreground ml-4 list-inside list-disc space-y-1 text-sm",
                        children: [
                          /* @__PURE__ */ jsxs2("li", {
                            children: [
                              /* @__PURE__ */ jsx2("strong", {
                                children: "Session continuity"
                              }),
                              " - Maintains conversation context"
                            ]
                          }),
                          /* @__PURE__ */ jsxs2("li", {
                            children: [
                              /* @__PURE__ */ jsx2("strong", {
                                children: "Working memory"
                              }),
                              " - Stores intermediate results"
                            ]
                          }),
                          /* @__PURE__ */ jsxs2("li", {
                            children: [
                              /* @__PURE__ */ jsx2("strong", {
                                children: "Never persisted long-term"
                              }),
                              " - Auto-purged after session"
                            ]
                          }),
                          /* @__PURE__ */ jsxs2("li", {
                            children: [
                              /* @__PURE__ */ jsx2("strong", {
                                children: "Never for decisions"
                              }),
                              " - Cannot influence policy or validation"
                            ]
                          })
                        ]
                      })
                    ]
                  }),
                  /* @__PURE__ */ jsxs2("div", {
                    children: [
                      /* @__PURE__ */ jsx2("h4", {
                        className: "mb-2 text-sm font-semibold",
                        children: "Examples:"
                      }),
                      /* @__PURE__ */ jsx2("div", {
                        className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded border p-3 font-mono text-xs",
                        children: /* @__PURE__ */ jsx2("pre", {
                          children: `// Agent Scratchpad space
{
  id: "agent-scratchpad",
  category: "ephemeral",
  retentionPolicy: { days: 1 },
  sources: [
    "session:current-conversation",
    "memory:agent-working-memory"
  ]
}

// User Session space
{
  id: "user-session",
  category: "ephemeral",
  retentionPolicy: { days: 7 },
  sources: [
    "session:user-uploads",
    "session:form-drafts"
  ]
}`
                        })
                      })
                    ]
                  }),
                  /* @__PURE__ */ jsx2("div", {
                    className: "card-subtle border-red-500/30 bg-red-500/10 p-3",
                    children: /* @__PURE__ */ jsxs2("p", {
                      className: "text-sm text-red-300",
                      children: [
                        /* @__PURE__ */ jsx2("strong", {
                          children: "\u26A0\uFE0F Critical:"
                        }),
                        " Ephemeral knowledge is never used for policy decisions, compliance checks, or any authoritative purpose."
                      ]
                    })
                  })
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs2("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx2("h2", {
            className: "text-2xl font-bold",
            children: "Category comparison"
          }),
          /* @__PURE__ */ jsx2("div", {
            className: "border-border/50 overflow-x-auto rounded-lg border",
            children: /* @__PURE__ */ jsxs2("table", {
              className: "w-full text-left text-sm",
              children: [
                /* @__PURE__ */ jsx2("thead", {
                  className: "bg-card/50",
                  children: /* @__PURE__ */ jsxs2("tr", {
                    className: "border-border/50 border-b",
                    children: [
                      /* @__PURE__ */ jsx2("th", {
                        className: "px-4 py-3 font-semibold",
                        children: "Feature"
                      }),
                      /* @__PURE__ */ jsx2("th", {
                        className: "px-4 py-3 font-semibold",
                        children: "Canonical"
                      }),
                      /* @__PURE__ */ jsx2("th", {
                        className: "px-4 py-3 font-semibold",
                        children: "Operational"
                      }),
                      /* @__PURE__ */ jsx2("th", {
                        className: "px-4 py-3 font-semibold",
                        children: "External"
                      }),
                      /* @__PURE__ */ jsx2("th", {
                        className: "px-4 py-3 font-semibold",
                        children: "Ephemeral"
                      })
                    ]
                  })
                }),
                /* @__PURE__ */ jsxs2("tbody", {
                  className: "divide-border/50 divide-y",
                  children: [
                    /* @__PURE__ */ jsxs2("tr", {
                      children: [
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3 font-semibold",
                          children: "Trust Level"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "Highest"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "High"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "Medium"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "Low"
                        })
                      ]
                    }),
                    /* @__PURE__ */ jsxs2("tr", {
                      children: [
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3 font-semibold",
                          children: "Policy Impact"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "\u2705 Can drive decisions"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "\u26A0\uFE0F Can inform"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "\u274C Reference only"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "\u274C Never used"
                        })
                      ]
                    }),
                    /* @__PURE__ */ jsxs2("tr", {
                      children: [
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3 font-semibold",
                          children: "Mutability"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "Immutable"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "Mutable"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "Mutable"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "Temporary"
                        })
                      ]
                    }),
                    /* @__PURE__ */ jsxs2("tr", {
                      children: [
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3 font-semibold",
                          children: "Retention"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "Permanent"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "Long-term"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "Long-term"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "Short-term"
                        })
                      ]
                    }),
                    /* @__PURE__ */ jsxs2("tr", {
                      children: [
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3 font-semibold",
                          children: "Audit Level"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "Full audit"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "Full audit"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "Basic audit"
                        }),
                        /* @__PURE__ */ jsx2("td", {
                          className: "px-4 py-3",
                          children: "Minimal audit"
                        })
                      ]
                    })
                  ]
                })
              ]
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs2("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx2("h2", {
            className: "text-2xl font-bold",
            children: "Best practices"
          }),
          /* @__PURE__ */ jsxs2("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsx2("li", {
                children: "Use canonical for anything that affects policy, pricing, or compliance"
              }),
              /* @__PURE__ */ jsx2("li", {
                children: "Use operational for context that helps but doesn't dictate decisions"
              }),
              /* @__PURE__ */ jsx2("li", {
                children: "Use external for reference material that's helpful but not authoritative"
              }),
              /* @__PURE__ */ jsx2("li", {
                children: "Use ephemeral for temporary working memory that shouldn't persist"
              }),
              /* @__PURE__ */ jsx2("li", {
                children: "Never mix categories in a single knowledge space - keep them separate"
              }),
              /* @__PURE__ */ jsx2("li", {
                children: "Document the category and purpose of each knowledge space clearly"
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs2("div", {
        className: "flex items-center gap-4 pt-4",
        children: [
          /* @__PURE__ */ jsx2(Link2, {
            href: "/docs/knowledge",
            className: "btn-ghost",
            children: "Back to Knowledge"
          }),
          /* @__PURE__ */ jsxs2(Link2, {
            href: "/docs/knowledge/spaces",
            className: "btn-primary",
            children: [
              "Knowledge Spaces ",
              /* @__PURE__ */ jsx2(ChevronRight2, {
                size: 16
              })
            ]
          })
        ]
      })
    ]
  });
}

// src/components/docs/knowledge/KnowledgeExamplesPage.tsx
import Link3 from "@contractspec/lib.ui-link";
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
function KnowledgeExamplesPage() {
  return /* @__PURE__ */ jsxs3("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs3("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx3("h1", {
            className: "text-4xl font-bold",
            children: "Knowledge Examples"
          }),
          /* @__PURE__ */ jsx3("p", {
            className: "text-muted-foreground",
            children: "Real-world examples of how different applications use knowledge spaces to power intelligent workflows and agents."
          })
        ]
      }),
      /* @__PURE__ */ jsxs3("div", {
        className: "space-y-6",
        children: [
          /* @__PURE__ */ jsxs3("div", {
            className: "space-y-4",
            children: [
              /* @__PURE__ */ jsx3("h2", {
                className: "text-2xl font-bold",
                children: "Example 1: ArtisanOS Support Agent"
              }),
              /* @__PURE__ */ jsxs3("p", {
                className: "text-muted-foreground",
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Context:"
                  }),
                  " ArtisanOS needs a support agent that can answer product questions using official documentation and learn from past support tickets."
                ]
              }),
              /* @__PURE__ */ jsx3("div", {
                className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
                children: /* @__PURE__ */ jsx3("pre", {
                  children: `// Knowledge spaces
knowledgeSpaces: [
  {
    id: "product-canon",
    category: "canonical",
    sources: [
      { kind: "notion", location: "product-docs" },
      { kind: "database-query", location: "SELECT * FROM features" }
    ]
  },
  {
    id: "support-history",
    category: "operational",
    sources: [
      { kind: "email", location: "support@artisanos.com" },
      { kind: "slack", location: "#support-channel" }
    ]
  }
]

// Workflow
workflowId: answer-support-question
steps:
  - id: embed-question
    capability: openai-embeddings
    inputs:
      text: \${input.question}
  
  - id: search-canon
    capability: vector.search
    inputs:
      collection: "product-canon"
      vector: \${steps.embed-question.output.embedding}
      limit: 5
  
  - id: search-history
    capability: vector.search
    inputs:
      collection: "support-history"
      vector: \${steps.embed-question.output.embedding}
      limit: 3
  
  - id: generate-answer
    capability: openai-chat
    inputs:
      messages:
        - role: "system"
          content: |
            Answer using canonical docs as authority.
            Use support history for helpful context.
        - role: "user"
          content: |
            Question: \${input.question}
            Docs: \${steps.search-canon.output.results}
            History: \${steps.search-history.output.results}`
                })
              })
            ]
          }),
          /* @__PURE__ */ jsxs3("div", {
            className: "space-y-4",
            children: [
              /* @__PURE__ */ jsx3("h2", {
                className: "text-2xl font-bold",
                children: "Example 2: HCircle Invoice Generation"
              }),
              /* @__PURE__ */ jsxs3("p", {
                className: "text-muted-foreground",
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Context:"
                  }),
                  " HCircle needs to generate invoices using house playbook rules and resident service history."
                ]
              }),
              /* @__PURE__ */ jsx3("div", {
                className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
                children: /* @__PURE__ */ jsx3("pre", {
                  children: `// Knowledge spaces
knowledgeSpaces: [
  {
    id: "house-playbook",
    category: "canonical",
    sources: [
      { kind: "uploaded-document", location: "playbook.pdf" },
      { kind: "database-query", location: "SELECT * FROM pricing_rules" }
    ]
  },
  {
    id: "resident-history",
    category: "operational",
    sources: [
      { kind: "database-query", location: "SELECT * FROM services" },
      { kind: "database-query", location: "SELECT * FROM invoices" }
    ]
  }
]

// Workflow
workflowId: generate-invoice
steps:
  - id: fetch-services
    capability: database.query
    inputs:
      query: "SELECT * FROM services WHERE resident_id = ?"
      params: [\${input.residentId}]
  
  - id: search-pricing-rules
    capability: vector.search
    inputs:
      collection: "house-playbook"
      query: "pricing rules for \${steps.fetch-services.output.serviceType}"
      limit: 3
  
  - id: calculate-total
    capability: calculate
    inputs:
      services: \${steps.fetch-services.output.rows}
      rules: \${steps.search-pricing-rules.output.results}
  
  - id: create-invoice
    capability: database.insert
    inputs:
      table: "invoices"
      data: \${steps.calculate-total.output}`
                })
              })
            ]
          }),
          /* @__PURE__ */ jsxs3("div", {
            className: "space-y-4",
            children: [
              /* @__PURE__ */ jsx3("h2", {
                className: "text-2xl font-bold",
                children: "Example 3: Multi-tenant SaaS with External Docs"
              }),
              /* @__PURE__ */ jsxs3("p", {
                className: "text-muted-foreground",
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Context:"
                  }),
                  " A SaaS platform needs to help users integrate with Stripe, using both internal guides and Stripe's official documentation."
                ]
              }),
              /* @__PURE__ */ jsx3("div", {
                className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
                children: /* @__PURE__ */ jsx3("pre", {
                  children: `// Knowledge spaces
knowledgeSpaces: [
  {
    id: "integration-guides",
    category: "canonical",
    sources: [
      { kind: "notion", location: "integration-guides" }
    ]
  },
  {
    id: "stripe-docs",
    category: "external",
    sources: [
      { kind: "url", location: "https://stripe.com/docs" }
    ]
  },
  {
    id: "customer-questions",
    category: "operational",
    sources: [
      { kind: "email", location: "support@saas.com" }
    ]
  }
]

// Workflow
workflowId: answer-integration-question
steps:
  - id: embed-question
    capability: openai-embeddings
    inputs:
      text: \${input.question}
  
  - id: search-internal-guides
    capability: vector.search
    inputs:
      collection: "integration-guides"
      vector: \${steps.embed-question.output.embedding}
      limit: 3
  
  - id: search-stripe-docs
    capability: vector.search
    inputs:
      collection: "stripe-docs"
      vector: \${steps.embed-question.output.embedding}
      limit: 2
  
  - id: search-past-questions
    capability: vector.search
    inputs:
      collection: "customer-questions"
      vector: \${steps.embed-question.output.embedding}
      limit: 2
  
  - id: generate-answer
    capability: openai-chat
    inputs:
      messages:
        - role: "system"
          content: |
            Prioritize internal guides (authoritative).
            Use Stripe docs for API details (reference).
            Use past questions for common issues (context).
        - role: "user"
          content: |
            Question: \${input.question}
            Internal: \${steps.search-internal-guides.output.results}
            Stripe: \${steps.search-stripe-docs.output.results}
            Past: \${steps.search-past-questions.output.results}`
                })
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs3("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx3("h2", {
            className: "text-2xl font-bold",
            children: "Key patterns"
          }),
          /* @__PURE__ */ jsxs3("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Canonical first"
                  }),
                  " - Always search canonical spaces before operational or external"
                ]
              }),
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Category-aware prompts"
                  }),
                  " - Tell the LLM which sources are authoritative vs reference"
                ]
              }),
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Multi-space queries"
                  }),
                  " - Combine results from multiple spaces for richer context"
                ]
              }),
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Limit results"
                  }),
                  " - Use appropriate limits (3-5) to avoid token overflow"
                ]
              }),
              /* @__PURE__ */ jsxs3("li", {
                children: [
                  /* @__PURE__ */ jsx3("strong", {
                    children: "Audit everything"
                  }),
                  " - Log all knowledge queries for debugging and compliance"
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs3("div", {
        className: "flex items-center gap-4 pt-4",
        children: [
          /* @__PURE__ */ jsx3(Link3, {
            href: "/docs/knowledge/sources",
            className: "btn-ghost",
            children: "Previous: Sources"
          }),
          /* @__PURE__ */ jsx3(Link3, {
            href: "/docs/architecture/knowledge-binding",
            className: "btn-ghost",
            children: "Knowledge Binding"
          })
        ]
      })
    ]
  });
}

// src/components/docs/knowledge/KnowledgeSourcesPage.tsx
import Link4 from "@contractspec/lib.ui-link";
import { ChevronRight as ChevronRight3 } from "lucide-react";
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
function KnowledgeSourcesPage() {
  return /* @__PURE__ */ jsxs4("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs4("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx4("h1", {
            className: "text-4xl font-bold",
            children: "Knowledge Sources"
          }),
          /* @__PURE__ */ jsxs4("p", {
            className: "text-muted-foreground",
            children: [
              "A ",
              /* @__PURE__ */ jsx4("strong", {
                children: "KnowledgeSourceConfig"
              }),
              " connects a tenant's data sources (Notion, Gmail, uploads, databases) to knowledge spaces. Each source is synced, chunked, embedded, and indexed according to the space's configuration."
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs4("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx4("h2", {
            className: "text-2xl font-bold",
            children: "KnowledgeSourceConfig"
          }),
          /* @__PURE__ */ jsx4("div", {
            className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
            children: /* @__PURE__ */ jsx4("pre", {
              children: `type KnowledgeSourceConfig = {
  id: string;
  tenantId: string;
  spaceId: string;
  
  // Source type and location
  kind: "uploaded-document" | "url" | "email" 
        | "notion" | "database-query" | "raw-text"
        | "slack" | "confluence" | "google-drive";
  location: string;
  
  // Sync configuration
  syncPolicy: {
    interval?: string;  // e.g., "1h", "24h"
    webhook?: boolean;
    manual?: boolean;
  };
  
  // State
  status: "active" | "paused" | "error";
  lastSyncedAt?: string;
  lastErrorMessage?: string;
  
  // Metadata
  metadata?: Record<string, unknown>;
  createdAt: string;
  updatedAt: string;
};`
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs4("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx4("h2", {
            className: "text-2xl font-bold",
            children: "Source types"
          }),
          /* @__PURE__ */ jsxs4("div", {
            className: "space-y-6",
            children: [
              /* @__PURE__ */ jsxs4("div", {
                className: "card-subtle p-4",
                children: [
                  /* @__PURE__ */ jsx4("h3", {
                    className: "mb-2 text-lg font-semibold",
                    children: "Uploaded Documents"
                  }),
                  /* @__PURE__ */ jsx4("div", {
                    className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded border p-3 font-mono text-xs",
                    children: /* @__PURE__ */ jsx4("pre", {
                      children: `{
  kind: "uploaded-document",
  location: "s3://bucket/tenant-123/docs/product-spec.pdf",
  syncPolicy: { manual: true }
}`
                    })
                  }),
                  /* @__PURE__ */ jsx4("p", {
                    className: "text-muted-foreground mt-2 text-sm",
                    children: "PDFs, Word docs, presentations uploaded by users"
                  })
                ]
              }),
              /* @__PURE__ */ jsxs4("div", {
                className: "card-subtle p-4",
                children: [
                  /* @__PURE__ */ jsx4("h3", {
                    className: "mb-2 text-lg font-semibold",
                    children: "Notion"
                  }),
                  /* @__PURE__ */ jsx4("div", {
                    className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded border p-3 font-mono text-xs",
                    children: /* @__PURE__ */ jsx4("pre", {
                      children: `{
  kind: "notion",
  location: "https://notion.so/workspace/product-docs",
  syncPolicy: { interval: "1h", webhook: true }
}`
                    })
                  }),
                  /* @__PURE__ */ jsx4("p", {
                    className: "text-muted-foreground mt-2 text-sm",
                    children: "Notion pages and databases with real-time webhook updates"
                  })
                ]
              }),
              /* @__PURE__ */ jsxs4("div", {
                className: "card-subtle p-4",
                children: [
                  /* @__PURE__ */ jsx4("h3", {
                    className: "mb-2 text-lg font-semibold",
                    children: "Gmail / Email"
                  }),
                  /* @__PURE__ */ jsx4("div", {
                    className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded border p-3 font-mono text-xs",
                    children: /* @__PURE__ */ jsx4("pre", {
                      children: `{
  kind: "email",
  location: "support@company.com",
  syncPolicy: { webhook: true }
}`
                    })
                  }),
                  /* @__PURE__ */ jsx4("p", {
                    className: "text-muted-foreground mt-2 text-sm",
                    children: "Email threads from Gmail or other providers"
                  })
                ]
              }),
              /* @__PURE__ */ jsxs4("div", {
                className: "card-subtle p-4",
                children: [
                  /* @__PURE__ */ jsx4("h3", {
                    className: "mb-2 text-lg font-semibold",
                    children: "Database Query"
                  }),
                  /* @__PURE__ */ jsx4("div", {
                    className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded border p-3 font-mono text-xs",
                    children: /* @__PURE__ */ jsx4("pre", {
                      children: `{
  kind: "database-query",
  location: "SELECT * FROM products WHERE active = true",
  syncPolicy: { interval: "24h" }
}`
                    })
                  }),
                  /* @__PURE__ */ jsx4("p", {
                    className: "text-muted-foreground mt-2 text-sm",
                    children: "Structured data from application databases"
                  })
                ]
              }),
              /* @__PURE__ */ jsxs4("div", {
                className: "card-subtle p-4",
                children: [
                  /* @__PURE__ */ jsx4("h3", {
                    className: "mb-2 text-lg font-semibold",
                    children: "URL / Web Scraping"
                  }),
                  /* @__PURE__ */ jsx4("div", {
                    className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded border p-3 font-mono text-xs",
                    children: /* @__PURE__ */ jsx4("pre", {
                      children: `{
  kind: "url",
  location: "https://stripe.com/docs",
  syncPolicy: { interval: "24h" }
}`
                    })
                  }),
                  /* @__PURE__ */ jsx4("p", {
                    className: "text-muted-foreground mt-2 text-sm",
                    children: "External documentation and web content"
                  })
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs4("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx4("h2", {
            className: "text-2xl font-bold",
            children: "Sync strategies"
          }),
          /* @__PURE__ */ jsx4("div", {
            className: "border-border/50 overflow-x-auto rounded-lg border",
            children: /* @__PURE__ */ jsxs4("table", {
              className: "w-full text-left text-sm",
              children: [
                /* @__PURE__ */ jsx4("thead", {
                  className: "bg-card/50",
                  children: /* @__PURE__ */ jsxs4("tr", {
                    className: "border-border/50 border-b",
                    children: [
                      /* @__PURE__ */ jsx4("th", {
                        className: "px-4 py-3 font-semibold",
                        children: "Strategy"
                      }),
                      /* @__PURE__ */ jsx4("th", {
                        className: "px-4 py-3 font-semibold",
                        children: "When to Use"
                      }),
                      /* @__PURE__ */ jsx4("th", {
                        className: "px-4 py-3 font-semibold",
                        children: "Latency"
                      })
                    ]
                  })
                }),
                /* @__PURE__ */ jsxs4("tbody", {
                  className: "divide-border/50 divide-y",
                  children: [
                    /* @__PURE__ */ jsxs4("tr", {
                      children: [
                        /* @__PURE__ */ jsx4("td", {
                          className: "px-4 py-3 font-mono text-xs",
                          children: "webhook"
                        }),
                        /* @__PURE__ */ jsx4("td", {
                          className: "px-4 py-3",
                          children: "Real-time updates (Notion, Gmail, Slack)"
                        }),
                        /* @__PURE__ */ jsx4("td", {
                          className: "px-4 py-3",
                          children: "Seconds"
                        })
                      ]
                    }),
                    /* @__PURE__ */ jsxs4("tr", {
                      children: [
                        /* @__PURE__ */ jsx4("td", {
                          className: "px-4 py-3 font-mono text-xs",
                          children: "interval"
                        }),
                        /* @__PURE__ */ jsx4("td", {
                          className: "px-4 py-3",
                          children: "Periodic sync (databases, URLs)"
                        }),
                        /* @__PURE__ */ jsx4("td", {
                          className: "px-4 py-3",
                          children: "Minutes to hours"
                        })
                      ]
                    }),
                    /* @__PURE__ */ jsxs4("tr", {
                      children: [
                        /* @__PURE__ */ jsx4("td", {
                          className: "px-4 py-3 font-mono text-xs",
                          children: "manual"
                        }),
                        /* @__PURE__ */ jsx4("td", {
                          className: "px-4 py-3",
                          children: "User-triggered (uploads, one-time imports)"
                        }),
                        /* @__PURE__ */ jsx4("td", {
                          className: "px-4 py-3",
                          children: "On-demand"
                        })
                      ]
                    })
                  ]
                })
              ]
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs4("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx4("h2", {
            className: "text-2xl font-bold",
            children: "Example: Multi-source space"
          }),
          /* @__PURE__ */ jsx4("p", {
            className: "text-muted-foreground",
            children: "A single knowledge space can be fed by multiple sources:"
          }),
          /* @__PURE__ */ jsx4("div", {
            className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
            children: /* @__PURE__ */ jsx4("pre", {
              children: `// Product Canon space with multiple sources
{
  spaceId: "product-canon",
  sources: [
    {
      id: "src_database_schema",
      kind: "database-query",
      location: "SELECT * FROM schema_definitions",
      syncPolicy: { interval: "1h" }
    },
    {
      id: "src_notion_product_docs",
      kind: "notion",
      location: "https://notion.so/product-docs",
      syncPolicy: { interval: "1h", webhook: true }
    },
    {
      id: "src_uploaded_specs",
      kind: "uploaded-document",
      location: "s3://bucket/specs/",
      syncPolicy: { manual: true }
    }
  ]
}`
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs4("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx4("h2", {
            className: "text-2xl font-bold",
            children: "Processing pipeline"
          }),
          /* @__PURE__ */ jsx4("p", {
            className: "text-muted-foreground",
            children: "When a source is synced, ContractSpec processes it through several stages:"
          }),
          /* @__PURE__ */ jsxs4("ol", {
            className: "text-muted-foreground list-inside list-decimal space-y-3",
            children: [
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Fetch"
                  }),
                  " - Retrieve content from source (API, database, file)"
                ]
              }),
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Parse"
                  }),
                  " - Extract text from documents (PDF, Word, HTML)"
                ]
              }),
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Chunk"
                  }),
                  " - Split into semantic chunks (paragraphs, sections)"
                ]
              }),
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Embed"
                  }),
                  " - Generate vector embeddings (OpenAI, Cohere)"
                ]
              }),
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Index"
                  }),
                  " - Store in vector database (Qdrant) or search engine"
                ]
              }),
              /* @__PURE__ */ jsxs4("li", {
                children: [
                  /* @__PURE__ */ jsx4("strong", {
                    children: "Audit"
                  }),
                  " - Log sync operation and results"
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs4("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx4("h2", {
            className: "text-2xl font-bold",
            children: "Best practices"
          }),
          /* @__PURE__ */ jsxs4("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsx4("li", {
                children: "Use webhooks for real-time sources (Notion, Gmail) to minimize latency"
              }),
              /* @__PURE__ */ jsx4("li", {
                children: "Set appropriate sync intervals - hourly for active docs, daily for stable content"
              }),
              /* @__PURE__ */ jsx4("li", {
                children: "Monitor sync failures and set up alerts for critical sources"
              }),
              /* @__PURE__ */ jsx4("li", {
                children: "Test sources in sandbox before enabling in production"
              }),
              /* @__PURE__ */ jsx4("li", {
                children: "Document the purpose and ownership of each source for your team"
              }),
              /* @__PURE__ */ jsx4("li", {
                children: "Use manual sync for sensitive or infrequently updated content"
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs4("div", {
        className: "flex items-center gap-4 pt-4",
        children: [
          /* @__PURE__ */ jsx4(Link4, {
            href: "/docs/knowledge/spaces",
            className: "btn-ghost",
            children: "Previous: Spaces"
          }),
          /* @__PURE__ */ jsxs4(Link4, {
            href: "/docs/knowledge/examples",
            className: "btn-primary",
            children: [
              "Examples ",
              /* @__PURE__ */ jsx4(ChevronRight3, {
                size: 16
              })
            ]
          })
        ]
      })
    ]
  });
}

// src/components/docs/knowledge/KnowledgeSpacesPage.tsx
import Link5 from "@contractspec/lib.ui-link";
import { ChevronRight as ChevronRight4 } from "lucide-react";
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
function KnowledgeSpacesPage() {
  return /* @__PURE__ */ jsxs5("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs5("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx5("h1", {
            className: "text-4xl font-bold",
            children: "Knowledge Spaces"
          }),
          /* @__PURE__ */ jsxs5("p", {
            className: "text-muted-foreground",
            children: [
              "A ",
              /* @__PURE__ */ jsx5("strong", {
                children: "KnowledgeSpaceSpec"
              }),
              " defines a logical domain of knowledge with a specific category, storage strategy, and intended audience. Spaces are defined globally and populated per-tenant through knowledge sources."
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs5("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx5("h2", {
            className: "text-2xl font-bold",
            children: "KnowledgeSpaceSpec"
          }),
          /* @__PURE__ */ jsx5("div", {
            className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
            children: /* @__PURE__ */ jsx5("pre", {
              children: `type KnowledgeSpaceSpec = {
  id: string;
  label: string;
  description: string;
  
  // Trust and access
  category: KnowledgeCategory;
  intendedAudience: "agents" | "humans" | "admin-only";
  
  // Storage and indexing
  storageStrategy: "vector" | "search" | "hybrid";
  indexProvider: string;  // e.g., "qdrant", "elasticsearch"
  vectorDimensions?: number;  // For vector storage
  
  // Lifecycle
  retentionPolicy: {
    days?: number;
    versions?: number;
  };
  
  // Metadata
  tags?: string[];
  owner?: string;
  createdAt: string;
  updatedAt: string;
};`
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs5("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx5("h2", {
            className: "text-2xl font-bold",
            children: "Common knowledge spaces"
          }),
          /* @__PURE__ */ jsxs5("div", {
            className: "space-y-6",
            children: [
              /* @__PURE__ */ jsxs5("div", {
                className: "card-subtle p-4",
                children: [
                  /* @__PURE__ */ jsx5("h3", {
                    className: "mb-2 text-lg font-semibold",
                    children: "Product Canon"
                  }),
                  /* @__PURE__ */ jsx5("div", {
                    className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded border p-3 font-mono text-xs",
                    children: /* @__PURE__ */ jsx5("pre", {
                      children: `{
  id: "product-canon",
  label: "Product Canon",
  description: "Official product specifications and schemas",
  category: "canonical",
  intendedAudience: "agents",
  storageStrategy: "hybrid",
  indexProvider: "qdrant",
  vectorDimensions: 1536,
  retentionPolicy: { versions: 10 }
}`
                    })
                  }),
                  /* @__PURE__ */ jsxs5("p", {
                    className: "text-muted-foreground mt-2 text-sm",
                    children: [
                      /* @__PURE__ */ jsx5("strong", {
                        children: "Use cases:"
                      }),
                      " Invoice generation, quote creation, product recommendations, schema validation"
                    ]
                  })
                ]
              }),
              /* @__PURE__ */ jsxs5("div", {
                className: "card-subtle p-4",
                children: [
                  /* @__PURE__ */ jsx5("h3", {
                    className: "mb-2 text-lg font-semibold",
                    children: "Support History"
                  }),
                  /* @__PURE__ */ jsx5("div", {
                    className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded border p-3 font-mono text-xs",
                    children: /* @__PURE__ */ jsx5("pre", {
                      children: `{
  id: "support-history",
  label: "Support History",
  description: "Past support tickets and resolutions",
  category: "operational",
  intendedAudience: "agents",
  storageStrategy: "vector",
  indexProvider: "qdrant",
  vectorDimensions: 1536,
  retentionPolicy: { days: 365 }
}`
                    })
                  }),
                  /* @__PURE__ */ jsxs5("p", {
                    className: "text-muted-foreground mt-2 text-sm",
                    children: [
                      /* @__PURE__ */ jsx5("strong", {
                        children: "Use cases:"
                      }),
                      " Customer support, troubleshooting, similar issue detection"
                    ]
                  })
                ]
              }),
              /* @__PURE__ */ jsxs5("div", {
                className: "card-subtle p-4",
                children: [
                  /* @__PURE__ */ jsx5("h3", {
                    className: "mb-2 text-lg font-semibold",
                    children: "External Provider Docs"
                  }),
                  /* @__PURE__ */ jsx5("div", {
                    className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded border p-3 font-mono text-xs",
                    children: /* @__PURE__ */ jsx5("pre", {
                      children: `{
  id: "provider-docs",
  label: "External Provider Docs",
  description: "Third-party integration documentation",
  category: "external",
  intendedAudience: "agents",
  storageStrategy: "search",
  indexProvider: "elasticsearch",
  retentionPolicy: { days: 90 }
}`
                    })
                  }),
                  /* @__PURE__ */ jsxs5("p", {
                    className: "text-muted-foreground mt-2 text-sm",
                    children: [
                      /* @__PURE__ */ jsx5("strong", {
                        children: "Use cases:"
                      }),
                      " Integration help, API reference, troubleshooting external services"
                    ]
                  })
                ]
              }),
              /* @__PURE__ */ jsxs5("div", {
                className: "card-subtle p-4",
                children: [
                  /* @__PURE__ */ jsx5("h3", {
                    className: "mb-2 text-lg font-semibold",
                    children: "Agent Scratchpad"
                  }),
                  /* @__PURE__ */ jsx5("div", {
                    className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded border p-3 font-mono text-xs",
                    children: /* @__PURE__ */ jsx5("pre", {
                      children: `{
  id: "agent-scratchpad",
  label: "Agent Scratchpad",
  description: "Temporary agent working memory",
  category: "ephemeral",
  intendedAudience: "agents",
  storageStrategy: "vector",
  indexProvider: "qdrant",
  vectorDimensions: 1536,
  retentionPolicy: { days: 1 }
}`
                    })
                  }),
                  /* @__PURE__ */ jsxs5("p", {
                    className: "text-muted-foreground mt-2 text-sm",
                    children: [
                      /* @__PURE__ */ jsx5("strong", {
                        children: "Use cases:"
                      }),
                      " Conversation continuity, intermediate calculations, session state"
                    ]
                  })
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs5("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx5("h2", {
            className: "text-2xl font-bold",
            children: "Storage strategies"
          }),
          /* @__PURE__ */ jsx5("div", {
            className: "border-border/50 overflow-x-auto rounded-lg border",
            children: /* @__PURE__ */ jsxs5("table", {
              className: "w-full text-left text-sm",
              children: [
                /* @__PURE__ */ jsx5("thead", {
                  className: "bg-card/50",
                  children: /* @__PURE__ */ jsxs5("tr", {
                    className: "border-border/50 border-b",
                    children: [
                      /* @__PURE__ */ jsx5("th", {
                        className: "px-4 py-3 font-semibold",
                        children: "Strategy"
                      }),
                      /* @__PURE__ */ jsx5("th", {
                        className: "px-4 py-3 font-semibold",
                        children: "Best For"
                      }),
                      /* @__PURE__ */ jsx5("th", {
                        className: "px-4 py-3 font-semibold",
                        children: "Providers"
                      })
                    ]
                  })
                }),
                /* @__PURE__ */ jsxs5("tbody", {
                  className: "divide-border/50 divide-y",
                  children: [
                    /* @__PURE__ */ jsxs5("tr", {
                      children: [
                        /* @__PURE__ */ jsx5("td", {
                          className: "px-4 py-3 font-mono text-xs",
                          children: "vector"
                        }),
                        /* @__PURE__ */ jsx5("td", {
                          className: "px-4 py-3",
                          children: "Semantic search, RAG, similarity matching"
                        }),
                        /* @__PURE__ */ jsx5("td", {
                          className: "px-4 py-3",
                          children: "Qdrant, Pinecone, Weaviate"
                        })
                      ]
                    }),
                    /* @__PURE__ */ jsxs5("tr", {
                      children: [
                        /* @__PURE__ */ jsx5("td", {
                          className: "px-4 py-3 font-mono text-xs",
                          children: "search"
                        }),
                        /* @__PURE__ */ jsx5("td", {
                          className: "px-4 py-3",
                          children: "Keyword search, exact matching, filtering"
                        }),
                        /* @__PURE__ */ jsx5("td", {
                          className: "px-4 py-3",
                          children: "Elasticsearch, Algolia"
                        })
                      ]
                    }),
                    /* @__PURE__ */ jsxs5("tr", {
                      children: [
                        /* @__PURE__ */ jsx5("td", {
                          className: "px-4 py-3 font-mono text-xs",
                          children: "hybrid"
                        }),
                        /* @__PURE__ */ jsx5("td", {
                          className: "px-4 py-3",
                          children: "Combined semantic + keyword search"
                        }),
                        /* @__PURE__ */ jsx5("td", {
                          className: "px-4 py-3",
                          children: "Qdrant + Elasticsearch"
                        })
                      ]
                    })
                  ]
                })
              ]
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs5("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx5("h2", {
            className: "text-2xl font-bold",
            children: "Best practices"
          }),
          /* @__PURE__ */ jsxs5("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsx5("li", {
                children: "Choose storage strategy based on query patterns - use vector for semantic, search for exact"
              }),
              /* @__PURE__ */ jsx5("li", {
                children: "Set appropriate retention policies - canonical is permanent, ephemeral is short-lived"
              }),
              /* @__PURE__ */ jsx5("li", {
                children: "Use consistent vector dimensions across spaces that will be queried together"
              }),
              /* @__PURE__ */ jsx5("li", {
                children: "Document the intended audience and use cases for each space"
              }),
              /* @__PURE__ */ jsx5("li", {
                children: "Monitor space size and query performance - add sharding if needed"
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs5("div", {
        className: "flex items-center gap-4 pt-4",
        children: [
          /* @__PURE__ */ jsx5(Link5, {
            href: "/docs/knowledge/categories",
            className: "btn-ghost",
            children: "Previous: Categories"
          }),
          /* @__PURE__ */ jsxs5(Link5, {
            href: "/docs/knowledge/sources",
            className: "btn-primary",
            children: [
              "Knowledge Sources ",
              /* @__PURE__ */ jsx5(ChevronRight4, {
                size: 16
              })
            ]
          })
        ]
      })
    ]
  });
}
export {
  KnowledgeSpacesPage,
  KnowledgeSourcesPage,
  KnowledgeOverviewPage,
  KnowledgeExamplesPage,
  KnowledgeCategoriesPage
};
