MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / metaFromIdentity

Function metaFromIdentity

apps/cloud/src/mcp/session-meta.ts:113–131  ·  view source on GitHub ↗
(
  token: McpSessionInit,
  organization: {
    readonly name: string;
    readonly slug?: string;
  },
)

Source from the content-addressed store, hash-verified

111 isUserStoreError(failure) ? failure.reason : "upstream";
112
113const metaFromIdentity = (
114 token: McpSessionInit,
115 organization: {
116 readonly name: string;
117 readonly slug?: string;
118 },
119): SessionMeta => {
120 return {
121 organizationId: token.organizationId,
122 organizationName: organization.name,
123 ...(organization.slug === undefined ? {} : { organizationSlug: organization.slug }),
124 ...sessionOrgRoleMetadata(token),
125 userId: token.userId,
126 resource: token.resource,
127 elicitationMode: token.elicitationMode,
128 artifactsEnabled: token.artifactsEnabled,
129 searchToolsEnabled: token.searchToolsEnabled,
130 };
131};
132
133/**
134 * Read the organization row, retrying only failures a retry can clear, and

Callers 1

Calls 1

sessionOrgRoleMetadataFunction · 0.90

Tested by

no test coverage detected