MCPcopy
hub / github.com/simstudioai/sim / kbOwnershipMetadata

Function kbOwnershipMetadata

apps/sim/lib/knowledge/connectors/sync-engine.ts:1084–1091  ·  view source on GitHub ↗

* Build the storage `metadata` that records a trusted ownership binding for a * synced `kb/` object. Returns `undefined` for legacy null-workspace KBs (no * workspace-scoped ownership to bind), which `uploadFile` treats as "no binding".

(
  kbOwner: KnowledgeBaseOwner,
  originalName: string
)

Source from the content-addressed store, hash-verified

1082 * workspace-scoped ownership to bind), which `uploadFile` treats as "no binding".
1083 */
1084function kbOwnershipMetadata(
1085 kbOwner: KnowledgeBaseOwner,
1086 originalName: string
1087): { workspaceId: string; userId: string; originalName: string } | undefined {
1088 return kbOwner.workspaceId
1089 ? { workspaceId: kbOwner.workspaceId, userId: kbOwner.userId, originalName }
1090 : undefined
1091}
1092
1093/** Builds a content-less `failed` document row for a skipped (e.g. oversized) file. */
1094function buildSkippedDocumentRow(

Callers 2

addDocumentFunction · 0.85
updateDocumentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected