feat(coding): add model tools and device packages

This commit is contained in:
2026-09-02 18:35:26 +08:00
parent 841273b433
commit 664b8823a0
60 changed files with 3847 additions and 2068 deletions

36
shared/model-tools.ts Normal file
View File

@@ -0,0 +1,36 @@
export type ModelWebSearchErrorCode =
| 'model_web_search_unsupported'
| 'model_context_changed'
| 'model_web_search_rate_limited'
| 'model_web_search_unavailable'
| 'model_web_search_invalid_result';
export type ModelWebSearchSourceV1 = Readonly<{
title: string;
url: string;
}>;
export type ModelWebSearchSuccessV1 = Readonly<{
schema: 'makelore-model-tool.v1';
tool: 'web_search';
status: 'succeeded';
modelId: string;
answer: string;
sources: ReadonlyArray<ModelWebSearchSourceV1>;
sourceMode: 'structured' | 'inline-or-structured';
}>;
export type ModelWebSearchFailureV1 = Readonly<{
schema: 'makelore-model-tool.v1';
tool: 'web_search';
status: 'failed';
modelId: string;
error: Readonly<{
code: ModelWebSearchErrorCode;
message: string;
httpStatus: 400 | 409 | 429 | 502 | 503;
retryable: boolean;
}>;
}>;
export type ModelToolDetailsV1 = ModelWebSearchSuccessV1 | ModelWebSearchFailureV1;