Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/components/WorkflowEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ export function WorkflowEditor(props: WorkflowEditorProps) {
'info',
);
}
// ApplicationConfig format detected but no file resolver provided — warn the user
// rather than silently converting the format.
if (config._applicationConfig && !onResolveFile) {
addToast(
'ApplicationConfig format detected. Configure a workspace file resolver to render the full application graph from referenced sub-files.',
'warning',
);
}
Comment on lines +70 to +77
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warning is meant to trigger when ApplicationConfig is detected but onResolveFile is not provided. This check uses !sourceMapProp, which can suppress the warning when a host passes a sourceMap but no resolver (still cannot resolve referenced sub-files). Consider keying this warning off !onResolveFile (and optionally also when resolver returns missing files).

Copilot uses AI. Check for mistakes.
}
const mapFromProp = sourceMapProp ? new Map(Object.entries(sourceMapProp)) : undefined;
importFromConfig(config, mapFromProp);
Expand Down
5 changes: 5 additions & 0 deletions src/stores/workflowStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,11 @@ const useWorkflowStore = create<WorkflowStore>()(
if (Object.keys(importedPipelines).length > 0) {
config.pipelines = importedPipelines;
}
// Reattach ApplicationConfig metadata so configToYaml / exportMainFileYaml
// can reconstruct the original `application:` format on export.
if (originalConfig?._applicationConfig) {
config._applicationConfig = originalConfig._applicationConfig;
}
return config;
},

Expand Down
14 changes: 14 additions & 0 deletions src/types/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ export interface ModuleConfig {
ui_position?: { x: number; y: number };
}

/**
* Metadata preserved when a YAML file uses the ApplicationConfig format
* (`application:` top-level key with `workflows[].file` references).
* Stored alongside the merged WorkflowConfig so the original structure can be
* reconstructed on export without converting to the flat WorkflowConfig format.
*/
export interface ApplicationConfigMeta {
name?: string;
version?: string;
workflows: Array<{ file: string }>;
}

export interface WorkflowConfig {
name?: string;
version?: string;
Expand All @@ -23,6 +35,8 @@ export interface WorkflowConfig {
infrastructure?: Record<string, unknown>;
sidecars?: unknown[];
_originalKeys?: string[];
/** Present when the source file used the ApplicationConfig format. */
_applicationConfig?: ApplicationConfigMeta;
/** Preserves unknown top-level keys that are not part of the known schema (e.g. engine:, custom config blocks). */
_extraTopLevelKeys?: Record<string, unknown>;
}
Expand Down
1 change: 1 addition & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export {
exportToFiles,
exportMainFileYaml,
hasFileReferences,
buildApplicationConfigYaml,
} from './serialization';
export { layoutNodes } from './autoLayout';
export {
Expand Down
Loading
Loading