Skip to content

Commit 4953af5

Browse files
committed
fix(mothership): bind media admission to loaded files
1 parent 29111a9 commit 4953af5

87 files changed

Lines changed: 259 additions & 298 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/sim/app/api/v2/lib/response.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import { type CursorKey, INVALID_CURSOR_MESSAGE } from '@/lib/api/list-query'
1010
import { getValidationErrorMessage, serializeZodIssues } from '@/lib/api/server'
1111
import { ADMISSION_RETRY_AFTER_SECONDS } from '@/lib/core/admission/transient-failure'
1212
import {
13+
ContentDeliveryUnobservedError,
1314
forbiddenErrorDetails,
1415
InsufficientScopeError,
1516
OAuthAccessTokenExpiredError,
1617
} from '@/lib/core/application'
17-
import { ContentDeliveryUnobservedError } from '@/lib/core/application/content-delivery'
1818
import {
1919
asOrchestrationError,
2020
OrchestrationError,

‎apps/sim/lib/api/server/routes/copilot-request.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { DelegatedPrincipal } from '@sim/auth/principal'
2-
import { noteContentDeliveryOperation } from '@/lib/core/application/content-delivery'
2+
import { noteContentDeliveryOperation } from '@/lib/core/application'
33
import { markCopilotWorkspaceInvocation } from '@/lib/core/application/copilot-workspace-invocation'
44
import type { ApplicationOperation, OperationUseCase } from '@/lib/core/application/operation'
55
import {

‎apps/sim/lib/benchmarks/application/access.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export function defineAuthorizedBenchmarkUseCase<
7676

7777
const targetOperation = defineOrganizationOperation({
7878
id: 'benchmarks.target.authorize',
79+
contentDelivery: 'none',
7980
minimumRole: 'member',
8081
capability: 'copilot.use',
8182
principalKinds: ['organization_delegated'],

‎apps/sim/lib/core/application/index.ts‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,26 @@ export {
6161
type WorkspaceOperation,
6262
} from '@/lib/core/application/workspace-operation'
6363
export { PermissionGroupCapabilityError } from '@/lib/permission-groups/capability-error'
64+
export {
65+
admitContent,
66+
admitEach,
67+
admitWrittenContent,
68+
type ContentDeliveryDeclaration,
69+
type ContentDeliveryGate,
70+
ContentDeliveryUnobservedError,
71+
ContentGateFailure,
72+
type ContentProvenance,
73+
ContentRefusedError,
74+
type ContentSource,
75+
type ContentSourceKind,
76+
type ContentView,
77+
isCopilotPrincipal,
78+
mustClassifyContent,
79+
noteContentDeliveryOperation,
80+
observeContentDelivery,
81+
observeContentOutsideModel,
82+
redactBeforeCutting,
83+
requireAdmittedContent,
84+
runDeclaredContentOperation,
85+
trackContentDelivery,
86+
} from './content-delivery'

‎apps/sim/lib/execution/sandbox/__integration__/content-reads.integration.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ vi.mock('@/lib/uploads/core/setup.server', () => ({
1919
}))
2020
vi.mock('@/tools', () => toolsMock)
2121

22-
import { observeContentDelivery } from '@/lib/core/application/content-delivery'
22+
import { observeContentDelivery } from '@/lib/core/application'
2323
import { encryptSecret } from '@/lib/core/security/encryption'
2424
import {
2525
createKnowledgeAclFixtureIds,

‎apps/sim/lib/knowledge/__integration__/content-delivery.integration.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { eq, inArray } from 'drizzle-orm'
1818
import { PostgresJsPreparedQuery } from 'drizzle-orm/postgres-js/session'
1919
import JSZip from 'jszip'
2020
import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from 'vitest'
21-
import { observeContentDelivery } from '@/lib/core/application/content-delivery'
21+
import { observeContentDelivery } from '@/lib/core/application'
2222
import { encryptSecret } from '@/lib/core/security/encryption'
2323
import type { DurableSecretProvenance } from '@/lib/execution/durable-secret-provenance'
2424
import {

‎apps/sim/lib/knowledge/__integration__/execution-archive-provenance.integration.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ vi.mock('@/lib/embeddings', async () => ({
6565

6666
import { functionExecuteBodySchema } from '@/lib/api/contracts'
6767
import { fileManageDecompressBodySchema } from '@/lib/api/contracts/tools/file'
68-
import { observeContentDelivery } from '@/lib/core/application/content-delivery'
68+
import { observeContentDelivery } from '@/lib/core/application'
6969
import { processOutboxEventById } from '@/lib/core/outbox/service'
7070
import { decryptSecret, encryptSecret } from '@/lib/core/security/encryption'
7171
import { isUserFile } from '@/lib/core/utils/user-file'

‎apps/sim/lib/knowledge/application/admit-knowledge-content.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Principal } from '@sim/auth/principal'
2-
import { admitEach, type ContentSourceKind } from '@/lib/core/application/content-delivery'
2+
import { admitEach, type ContentSourceKind } from '@/lib/core/application'
33
import {
44
classifyKnowledgeChunks,
55
classifyKnowledgeDocumentMetadata,

‎apps/sim/lib/knowledge/application/authorized-knowledge-use-case.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import {
55
type PrincipalForOperation,
66
recordProjectedUseCaseAuditEntries,
77
requireAllowedWorkspacePrincipal,
8+
runDeclaredContentOperation,
89
type WorkspaceUseCaseAuditEntry,
910
} from '@/lib/core/application'
10-
import { runDeclaredContentOperation } from '@/lib/core/application/content-delivery'
1111
import { authorizeOrganizationOperation } from '@/lib/core/application/organization-authorization'
1212
import { runWithOutboundOrganization } from '@/lib/core/network/context.server'
1313
import {

‎apps/sim/lib/knowledge/application/chunks.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ vi.mock('@/lib/knowledge/application/admit-knowledge-content', () => ({
4242
admitKnowledgeChunks: mocks.admitKnowledgeChunks,
4343
}))
4444

45-
import { admitContent } from '@/lib/core/application/content-delivery'
45+
import { admitContent } from '@/lib/core/application'
4646
import { ForbiddenOperationError } from '@/lib/core/application/forbidden'
4747
import { WORKSPACE_ACCESS_SCOPE } from '@/lib/knowledge/access/scope'
4848
import { KnowledgeDocumentNotReadyError } from '@/lib/knowledge/application/chunk-errors'

0 commit comments

Comments
 (0)