mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 15:14:10 +00:00
feat(metadata): replace aiAutofill boolean with autofillSource enum (#302)
* feat(metadata): replace aiAutofill boolean with autofillSource enum * fix(agent): validate creation-context metadata and make writes transactional Address code review feedback on the autofillSource migration: - Update the agent system prompt to reference the 'metadata' parameter of create_file/create_version instead of the removed 'context' parameter, which was being silently discarded by the activity - Write metadata inside the caller's transaction via the new metadataService.updateAssetMetadataInTx, keeping metadata rows atomic with asset creation instead of opening a separate non-atomic transaction - Reject metadata keys that are not defined CREATION_CONTEXT fields of the project with a non-retryable ApplicationFailure before creating the asset - Remove dead agentContext handling from autofillAiActivity and its tests, and drop the unused ai_autofill i18n keys (paraglide recompiled) - Derive the DTO autofillSource enum from the AutofillSource const instead of a hardcoded z.enum to prevent drift
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Autofill_Source_None_ExampleInputs */
|
||||
|
||||
const en_autofill_source_none_example = /** @type {(inputs: Autofill_Source_None_ExampleInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Example: Internal tags, manual notes, status tracking flags.`)
|
||||
};
|
||||
|
||||
const zh_autofill_source_none_example = /** @type {(inputs: Autofill_Source_None_ExampleInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`示例:内部标签、手动备注、状态标记。`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Example: Internal tags, manual notes, status tracking flags." |
|
||||
*
|
||||
* @param {Autofill_Source_None_ExampleInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const autofill_source_none_example = /** @type {((inputs?: Autofill_Source_None_ExampleInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Autofill_Source_None_ExampleInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_autofill_source_none_example(inputs)
|
||||
return zh_autofill_source_none_example(inputs)
|
||||
});
|
||||
Reference in New Issue
Block a user