MCPcopy Index your code
hub / github.com/coder/mux / stageAttachment

Method stageAttachment

src/node/services/workspaceService.ts:6944–6965  ·  view source on GitHub ↗
(input: {
    workspaceId: string;
    filename: string;
    mediaType?: string | null;
    sizeBytes: number;
    dataBase64: string;
  })

Source from the content-addressed store, hash-verified

6942 }
6943
6944 async stageAttachment(input: {
6945 workspaceId: string;
6946 filename: string;
6947 mediaType?: string | null;
6948 sizeBytes: number;
6949 dataBase64: string;
6950 }): Promise<Result<StagedWorkspaceAttachment, string>> {
6951 const metadata = await this.getInfo(input.workspaceId);
6952 if (metadata == null) {
6953 return Err("Workspace not found");
6954 }
6955
6956 const { runtime, workspacePath } = createRuntimeContextForWorkspace(metadata);
6957 return stageWorkspaceAttachment({
6958 runtime,
6959 workspacePath,
6960 filename: input.filename,
6961 mediaType: input.mediaType,
6962 sizeBytes: input.sizeBytes,
6963 dataBase64: input.dataBase64,
6964 });
6965 }
6966
6967 async downloadStagedAttachment(input: {
6968 workspaceId: string;

Callers 2

ChatInputInnerFunction · 0.80
routerFunction · 0.80

Calls 4

getInfoMethod · 0.95
ErrFunction · 0.90
stageWorkspaceAttachmentFunction · 0.90

Tested by

no test coverage detected