Remove Ask/Execute modes and general product tool approvals so requests use the selected runtime, enabled capabilities, and execution account permissions. Migrate retired application metadata while preserving user content. Retire the Results page while retaining conversation images and stored artifacts. Add local and remote workspace file imports, timestamps and sorting, improve image discovery and saving, and refine workspace navigation and supervision responsiveness. Include the accompanying web-search changes, tests, probes, and product documentation. Remote imports require an updated Agent. Existing artifacts are not automatically copied into project directories. Validation evidence and outstanding failures remain documented in feature progress files; no full test suite or real-model calls were rerun for this commit. Release note: Run requests without switching work modes, import files into a selected local or remote workspace folder, sort workspace files by date, and keep using conversation images after removal of the Results page.
36 lines
1.9 KiB
TypeScript
36 lines
1.9 KiB
TypeScript
import { z } from 'zod'
|
|
import {
|
|
imageSaveToolDescription, imageSaveToolInputSchema, imageSaveToolName,
|
|
imageToolInputSchema, imageToolName,
|
|
type ImageOperation, type ImageRequestContext, type ImageSaveResult
|
|
} from '../../shared/image-generation-contracts'
|
|
|
|
export type ImageToolBinding = {
|
|
context: Readonly<ImageRequestContext>
|
|
describe(): Promise<string | undefined>
|
|
call(input: unknown, callId: string, waitSignal?: AbortSignal): Promise<ImageOperation>
|
|
/** Writes an existing conversation image to a local file. Absent for bindings without local file access. */
|
|
save?(input: unknown, signal?: AbortSignal): Promise<ImageSaveResult>
|
|
/** Returns image bytes in the requested format so a remote Agent can write them on its own host. */
|
|
readForSave?(artifactId: string, mimeType: ImageSaveResult['mimeType']): Promise<Buffer>
|
|
/** save_image description with this conversation's image IDs; undefined when saving is not meaningful. */
|
|
describeSave?(): Promise<string | undefined>
|
|
}
|
|
|
|
export async function imageToolDefinition(binding: ImageToolBinding | undefined) {
|
|
const description = await binding?.describe()
|
|
if (!description) return undefined
|
|
const inputSchema = z.toJSONSchema(imageToolInputSchema, { target: 'draft-7', io: 'input' })
|
|
Reflect.deleteProperty(inputSchema, '$schema')
|
|
return { name: imageToolName, displayName: 'Generate or edit image', description, inputSchema, source: 'builtin' as const }
|
|
}
|
|
|
|
export async function imageSaveToolDefinition(binding: ImageToolBinding | undefined) {
|
|
if (!binding?.save) return undefined
|
|
const description = binding.describeSave ? await binding.describeSave() : imageSaveToolDescription
|
|
if (!description) return undefined
|
|
const inputSchema = z.toJSONSchema(imageSaveToolInputSchema, { target: 'draft-7', io: 'input' })
|
|
Reflect.deleteProperty(inputSchema, '$schema')
|
|
return { name: imageSaveToolName, displayName: 'Save image to file', description, inputSchema, source: 'builtin' as const }
|
|
}
|