Compare commits

...

1 Commits

Author SHA1 Message Date
a07307bd0a For @nadr0 2025-05-16 10:50:44 -04:00
2 changed files with 14 additions and 3 deletions

View File

@ -150,6 +150,7 @@ export type ModelingCommandSchema = {
namedValue: KclCommandValue namedValue: KclCommandValue
} }
'Prompt-to-edit': { 'Prompt-to-edit': {
projectEntrypoint: string
prompt: string prompt: string
selection: Selections selection: Selections
} }
@ -946,6 +947,12 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig<
icon: 'chat', icon: 'chat',
status: IS_ML_EXPERIMENTAL ? 'experimental' : 'active', status: IS_ML_EXPERIMENTAL ? 'experimental' : 'active',
args: { args: {
projectEntrypoint: {
defaultValue: (argsToSubmit, modelingMachine, fileMachineContext) =>
false, //fileMachineContext.currentProject,
hidden: () => false, //!contains"main.kcl",
required: true,
},
selection: { selection: {
inputType: 'selectionMixed', inputType: 'selectionMixed',
selectionTypes: [ selectionTypes: [

View File

@ -13,6 +13,7 @@ import type {
CommandBarContext, CommandBarContext,
commandBarMachine, commandBarMachine,
} from '@src/machines/commandBarMachine' } from '@src/machines/commandBarMachine'
import type { fileMachine } from '@src/machines/fileMachine'
type Icon = CustomIconName type Icon = CustomIconName
const _PLATFORMS = ['both', 'web', 'desktop'] as const const _PLATFORMS = ['both', 'web', 'desktop'] as const
@ -144,7 +145,8 @@ export type CommandArgumentConfig<
| boolean | boolean
| (( | ((
commandBarContext: { argumentsToSubmit: Record<string, unknown> }, // Should be the commandbarMachine's context, but it creates a circular dependency commandBarContext: { argumentsToSubmit: Record<string, unknown> }, // Should be the commandbarMachine's context, but it creates a circular dependency
machineContext?: C machineContext?: C,
fileMachineContext?: ContextFrom<typeof fileMachine>
) => boolean) ) => boolean)
skip?: boolean skip?: boolean
/** For showing a summary display of the current value, such as in /** For showing a summary display of the current value, such as in
@ -168,7 +170,8 @@ export type CommandArgumentConfig<
| OutputType | OutputType
| (( | ((
commandBarContext: ContextFrom<typeof commandBarMachine>, commandBarContext: ContextFrom<typeof commandBarMachine>,
machineContext?: C machineContext?: C,
fileMachineContext?: ContextFrom<typeof fileMachine>
) => OutputType) ) => OutputType)
defaultValueFromContext?: (context: C) => OutputType defaultValueFromContext?: (context: C) => OutputType
} }
@ -276,7 +279,8 @@ export type CommandArgument<
| boolean | boolean
| (( | ((
commandBarContext: { argumentsToSubmit: Record<string, unknown> }, // Should be the commandbarMachine's context, but it creates a circular dependency commandBarContext: { argumentsToSubmit: Record<string, unknown> }, // Should be the commandbarMachine's context, but it creates a circular dependency
machineContext?: ContextFrom<T> machineContext?: ContextFrom<T>,
fileMachineContext?: ContextFrom<typeof fileMachine>
) => boolean) ) => boolean)
skip?: boolean skip?: boolean
machineActor?: Actor<T> machineActor?: Actor<T>