feat: initial Cutdex application

Add the Flutter video editing application with project management, media
import, timeline editing, preview, AI assistance, diagnostics and settings.

Include shared UI and native host packages, platform runners, application
tests and release tooling.

Provide usage and contribution guides, the MIT license and third-party
notices. Exclude local credentials, build outputs and validation data.
This commit is contained in:
lingjhf committed 2026-10-05 23:36:23 +08:00
commit 27e77fff39
718 files changed
+183958

No files matched your search

+69
View File
@@ -0,0 +1,69 @@
import 'package:cutdex_agent/cutdex_agent.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'agent_prompt_policy.dart';
part 'agent_models.freezed.dart';
enum AgentApiType { openAiChatCompletions, openAiResponses, anthropicMessages }
@freezed
abstract class AgentModelSettings with _$AgentModelSettings {
const AgentModelSettings._();
const factory AgentModelSettings({
required String id,
int? contextWindow,
int? maxOutputTokens,
}) = _AgentModelSettings;
/// Reserve at most half of a small window when output is unspecified.
int get effectiveMaxOutputTokens =>
maxOutputTokens ??
(contextWindow == null || contextWindow! >= 8192
? 4096
: contextWindow! ~/ 2);
int get effectiveMaxInputTokens =>
contextWindow == null ? 32000 : contextWindow! - effectiveMaxOutputTokens;
bool get hasInstructionBudget =>
effectiveMaxInputTokens >=
ContextBuilder().measureInput(system: AgentPromptPolicy.editorAssistant);
bool get hasValidTokenBudget =>
effectiveMaxInputTokens > 0 && effectiveMaxOutputTokens > 0;
}
@freezed
abstract class AgentProviderSettings with _$AgentProviderSettings {
const AgentProviderSettings._();
const factory AgentProviderSettings({
required String id,
required String name,
required String apiType,
required String baseUrl,
required List<AgentModelSettings> models,
String? credentialId,
@Default(true) bool enabled,
}) = _AgentProviderSettings;
}
@freezed
abstract class AgentSettingsState with _$AgentSettingsState {
const AgentSettingsState._();
const factory AgentSettingsState({
@Default(false) bool enabled,
@Default([]) List<AgentProviderSettings> providers,
String? selectedProviderId,
String? selectedModelId,
@Default(0) int revision,
}) = _AgentSettingsState;
}
abstract interface class AgentSettingsRepository {
Future<AgentSettingsState> load();
Future<void> save(AgentSettingsState settings);
}