144 lines
3.3 KiB
TypeScript
144 lines
3.3 KiB
TypeScript
import type { ConditionalMechanicDraftV1 } from '$lib/calculations/mechanic-editor';
|
|
|
|
export const AI_MECHANIC_SOURCE_KINDS = [
|
|
'talent',
|
|
'exotic_weapon_talent',
|
|
'os_protocol_talent',
|
|
'skill_chip_talent',
|
|
'specialization_tree_rank',
|
|
] as const;
|
|
|
|
export type AiMechanicSourceKind = (typeof AI_MECHANIC_SOURCE_KINDS)[number];
|
|
|
|
export const AI_MECHANIC_SOURCE_PROFILES = {
|
|
talent: {
|
|
variantKeys: ['I', 'II'],
|
|
allowAssignedAbility: false,
|
|
allowProtocolUpgradeScaling: false,
|
|
},
|
|
exotic_weapon_talent: {
|
|
variantKeys: ['I', 'II'],
|
|
allowAssignedAbility: false,
|
|
allowProtocolUpgradeScaling: false,
|
|
},
|
|
os_protocol_talent: {
|
|
variantKeys: ['base'],
|
|
allowAssignedAbility: false,
|
|
allowProtocolUpgradeScaling: true,
|
|
},
|
|
skill_chip_talent: {
|
|
variantKeys: ['minimum', 'maximum'],
|
|
allowAssignedAbility: true,
|
|
allowProtocolUpgradeScaling: false,
|
|
},
|
|
specialization_tree_rank: {
|
|
variantKeys: ['base'],
|
|
allowAssignedAbility: false,
|
|
allowProtocolUpgradeScaling: false,
|
|
},
|
|
} as const satisfies Record<
|
|
AiMechanicSourceKind,
|
|
{
|
|
variantKeys: readonly string[];
|
|
allowAssignedAbility: boolean;
|
|
allowProtocolUpgradeScaling: boolean;
|
|
}
|
|
>;
|
|
|
|
export type AiMechanicContext = {
|
|
sourceKind: AiMechanicSourceKind;
|
|
sourceName: string;
|
|
sourceDescription: string;
|
|
};
|
|
|
|
export type AiMechanicValueColumn = {
|
|
key: string;
|
|
variantKey: string;
|
|
label: string;
|
|
};
|
|
|
|
export type AiMechanicTranscriptEntry = {
|
|
questionId: string;
|
|
question: string;
|
|
answer: string | number | boolean;
|
|
};
|
|
|
|
export type AiMechanicAuthoringRequest = {
|
|
context: AiMechanicContext;
|
|
currentDraft: ConditionalMechanicDraftV1;
|
|
valueColumns: AiMechanicValueColumn[];
|
|
allowAssignedAbility: boolean;
|
|
allowProtocolUpgradeScaling: boolean;
|
|
transcript: AiMechanicTranscriptEntry[];
|
|
};
|
|
|
|
export type AiMechanicQuestion = {
|
|
id: string;
|
|
question: string;
|
|
reason: string;
|
|
answerType: 'text' | 'number' | 'choice' | 'boolean';
|
|
options: string[];
|
|
};
|
|
|
|
export type AiMechanicResponseMeta = {
|
|
requestId: string;
|
|
model: string;
|
|
inputTokens: number;
|
|
outputTokens: number;
|
|
totalTokens: number;
|
|
};
|
|
|
|
export type AiMechanicClarificationResponse = {
|
|
status: 'clarification_required';
|
|
summary: string;
|
|
assumptions: string[];
|
|
warnings: string[];
|
|
questions: AiMechanicQuestion[];
|
|
meta: AiMechanicResponseMeta;
|
|
};
|
|
|
|
export type AiMechanicDraftResponse = {
|
|
status: 'draft_ready';
|
|
draft: ConditionalMechanicDraftV1;
|
|
summary: string;
|
|
assumptions: string[];
|
|
warnings: string[];
|
|
pseudoScript: string;
|
|
meta: AiMechanicResponseMeta;
|
|
};
|
|
|
|
export type AiMechanicCapabilityGap = {
|
|
area:
|
|
| 'event'
|
|
| 'predicate'
|
|
| 'reducer'
|
|
| 'mutation'
|
|
| 'outcome'
|
|
| 'scope'
|
|
| 'value_reference'
|
|
| 'source_variant'
|
|
| 'runtime';
|
|
requiredBehavior: string;
|
|
whyUnsupported: string;
|
|
developerChange: string;
|
|
workaround: string | null;
|
|
};
|
|
|
|
export type AiMechanicCapabilityGapResponse = {
|
|
status: 'capability_gap';
|
|
summary: string;
|
|
assumptions: string[];
|
|
warnings: string[];
|
|
gaps: AiMechanicCapabilityGap[];
|
|
meta: AiMechanicResponseMeta;
|
|
};
|
|
|
|
export type AiMechanicAuthoringResponse =
|
|
| AiMechanicClarificationResponse
|
|
| AiMechanicDraftResponse
|
|
| AiMechanicCapabilityGapResponse;
|
|
|
|
export type AiMechanicAuthoringError = {
|
|
message: string;
|
|
};
|