Add the flow editor: canvas, node panel and live values

The browser half of M3. Flows open on a full-bleed canvas with their chrome
floating over it: flow tabs top, dock bottom, node settings in a panel on the
right that leaves the graph visible and running behind it.

- Connections are derived, not stored. A node declares the messages it reads
  and publishes; every matching pair draws an edge, so two producers of one
  message converge on their consumer. Dragging output to input is shorthand
  for pointing that input at the producer's message, and asks before it
  replaces an existing one.
- Values land on the edges as they flow, over a websocket that feeds a store
  outside React, so a value arriving re-renders its own chip and nothing else.
  Clicking an edge shows the last payload and when it arrived.
- Node source is edited in Monaco, loaded only when a panel opens and themed
  from the design tokens.
- Edits autosave; identical documents are skipped server-side, so a quiet
  canvas writes nothing.
- Validation from the API shows on the node it belongs to and is summarised in
  the dock, where each entry pans to its node.
- Works on a phone: touch-connect, 44px dock targets, and the node panel
  becomes a full-screen sheet.

Two new tokens (--status-success, --font-mono) are mirrored in the website repo
and recorded in DESIGN-GUIDELINES.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WzrvW7rjQbynnhF6pxh6i
This commit is contained in:
Melvin Strobl
2026-08-15 18:10:50 +02:00
co-authored by Claude Fable 5
parent 06a4506767
commit 8c82549cf6
40 changed files with 5027 additions and 66 deletions
+296 -1
View File
@@ -3,7 +3,242 @@
import type { CancelablePromise } from './core/CancelablePromise';
import { OpenAPI } from './core/OpenAPI';
import { request as __request } from './core/request';
import type { ItemsReadItemsData, ItemsReadItemsResponse, ItemsCreateItemData, ItemsCreateItemResponse, ItemsReadItemData, ItemsReadItemResponse, ItemsUpdateItemData, ItemsUpdateItemResponse, ItemsDeleteItemData, ItemsDeleteItemResponse, LoginLoginAccessTokenData, LoginLoginAccessTokenResponse, LoginTestTokenResponse, LoginRecoverPasswordData, LoginRecoverPasswordResponse, LoginResetPasswordData, LoginResetPasswordResponse, LoginRecoverPasswordHtmlContentData, LoginRecoverPasswordHtmlContentResponse, PrivateCreateUserData, PrivateCreateUserResponse, UsersReadUsersData, UsersReadUsersResponse, UsersCreateUserData, UsersCreateUserResponse, UsersReadUserMeResponse, UsersDeleteUserMeResponse, UsersUpdateUserMeData, UsersUpdateUserMeResponse, UsersUpdatePasswordMeData, UsersUpdatePasswordMeResponse, UsersRegisterUserData, UsersRegisterUserResponse, UsersReadUserByIdData, UsersReadUserByIdResponse, UsersUpdateUserData, UsersUpdateUserResponse, UsersDeleteUserData, UsersDeleteUserResponse, UtilsTestEmailData, UtilsTestEmailResponse, UtilsHealthCheckResponse } from './types.gen';
import type { FlowsReadFlowsResponse, FlowsReadNodeTypesResponse, FlowsReadFlowData, FlowsReadFlowResponse, FlowsSaveFlowData, FlowsSaveFlowResponse, FlowsDeleteFlowData, FlowsDeleteFlowResponse, FlowsReadNodeSourceData, FlowsReadNodeSourceResponse, FlowsSaveNodeSourceData, FlowsSaveNodeSourceResponse, FlowsValidateFlowData, FlowsValidateFlowResponse, FlowsRunFlowData, FlowsRunFlowResponse, FlowsTriggerNodeData, FlowsTriggerNodeResponse, FlowsReadFlowStateData, FlowsReadFlowStateResponse, ItemsReadItemsData, ItemsReadItemsResponse, ItemsCreateItemData, ItemsCreateItemResponse, ItemsReadItemData, ItemsReadItemResponse, ItemsUpdateItemData, ItemsUpdateItemResponse, ItemsDeleteItemData, ItemsDeleteItemResponse, LoginLoginAccessTokenData, LoginLoginAccessTokenResponse, LoginTestTokenResponse, LoginRecoverPasswordData, LoginRecoverPasswordResponse, LoginResetPasswordData, LoginResetPasswordResponse, LoginRecoverPasswordHtmlContentData, LoginRecoverPasswordHtmlContentResponse, PrivateCreateUserData, PrivateCreateUserResponse, SecretsReadSecretsResponse, SecretsSaveSecretData, SecretsSaveSecretResponse, SecretsDeleteSecretData, SecretsDeleteSecretResponse, UsersReadUsersData, UsersReadUsersResponse, UsersCreateUserData, UsersCreateUserResponse, UsersReadUserMeResponse, UsersDeleteUserMeResponse, UsersUpdateUserMeData, UsersUpdateUserMeResponse, UsersUpdatePasswordMeData, UsersUpdatePasswordMeResponse, UsersRegisterUserData, UsersRegisterUserResponse, UsersReadUserByIdData, UsersReadUserByIdResponse, UsersUpdateUserData, UsersUpdateUserResponse, UsersDeleteUserData, UsersDeleteUserResponse, UtilsTestEmailData, UtilsTestEmailResponse, UtilsHealthCheckResponse } from './types.gen';
export class FlowsService {
/**
* Read Flows
* List every flow.
* @returns FlowsPublic Successful Response
* @throws ApiError
*/
public static readFlows(): CancelablePromise<FlowsReadFlowsResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/flows/'
});
}
/**
* Read Node Types
* The node types that can be placed on a canvas.
* @returns NodeTypeInfo Successful Response
* @throws ApiError
*/
public static readNodeTypes(): CancelablePromise<FlowsReadNodeTypesResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/flows/node-types'
});
}
/**
* Read Flow
* Read one flow, with the state of its nodes.
* @param data The data for the request.
* @param data.name
* @returns FlowDetail Successful Response
* @throws ApiError
*/
public static readFlow(data: FlowsReadFlowData): CancelablePromise<FlowsReadFlowResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/flows/{name}',
path: {
name: data.name
},
errors: {
422: 'Validation Error'
}
});
}
/**
* Save Flow
* Create or replace a flow. Saving the same content again changes nothing.
* @param data The data for the request.
* @param data.name
* @param data.requestBody
* @returns FlowDetail Successful Response
* @throws ApiError
*/
public static saveFlow(data: FlowsSaveFlowData): CancelablePromise<FlowsSaveFlowResponse> {
return __request(OpenAPI, {
method: 'PUT',
url: '/api/v1/flows/{name}',
path: {
name: data.name
},
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Delete Flow
* Delete a flow and everything in it.
* @param data The data for the request.
* @param data.name
* @returns Message Successful Response
* @throws ApiError
*/
public static deleteFlow(data: FlowsDeleteFlowData): CancelablePromise<FlowsDeleteFlowResponse> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/api/v1/flows/{name}',
path: {
name: data.name
},
errors: {
422: 'Validation Error'
}
});
}
/**
* Read Node Source
* Read a node's Python source.
* @param data The data for the request.
* @param data.name
* @param data.nodeId
* @returns NodeSource Successful Response
* @throws ApiError
*/
public static readNodeSource(data: FlowsReadNodeSourceData): CancelablePromise<FlowsReadNodeSourceResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/flows/{name}/nodes/{node_id}/source',
path: {
name: data.name,
node_id: data.nodeId
},
errors: {
422: 'Validation Error'
}
});
}
/**
* Save Node Source
* Save a node's source and report whether it loads.
* @param data The data for the request.
* @param data.name
* @param data.nodeId
* @param data.requestBody
* @returns NodeStatusPublic Successful Response
* @throws ApiError
*/
public static saveNodeSource(data: FlowsSaveNodeSourceData): CancelablePromise<FlowsSaveNodeSourceResponse> {
return __request(OpenAPI, {
method: 'PUT',
url: '/api/v1/flows/{name}/nodes/{node_id}/source',
path: {
name: data.name,
node_id: data.nodeId
},
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Validate Flow
* Report what would keep this flow from running.
* @param data The data for the request.
* @param data.name
* @returns ValidationResult Successful Response
* @throws ApiError
*/
public static validateFlow(data: FlowsValidateFlowData): CancelablePromise<FlowsValidateFlowResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/flows/{name}/validate',
path: {
name: data.name
},
errors: {
422: 'Validation Error'
}
});
}
/**
* Run Flow
* Run every node of a flow once.
* @param data The data for the request.
* @param data.name
* @param data.requestBody
* @returns FlowStatePublic Successful Response
* @throws ApiError
*/
public static runFlow(data: FlowsRunFlowData): CancelablePromise<FlowsRunFlowResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/flows/{name}/run',
path: {
name: data.name
},
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Trigger Node
* Feed values into a single node.
* @param data The data for the request.
* @param data.name
* @param data.nodeId
* @param data.requestBody
* @returns FlowStatePublic Successful Response
* @throws ApiError
*/
public static triggerNode(data: FlowsTriggerNodeData): CancelablePromise<FlowsTriggerNodeResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/flows/{name}/nodes/{node_id}/trigger',
path: {
name: data.name,
node_id: data.nodeId
},
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Read Flow State
* The last value seen on every message of this flow.
* @param data The data for the request.
* @param data.name
* @returns FlowStatePublic Successful Response
* @throws ApiError
*/
public static readFlowState(data: FlowsReadFlowStateData): CancelablePromise<FlowsReadFlowStateResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/flows/{name}/state',
path: {
name: data.name
},
errors: {
422: 'Validation Error'
}
});
}
}
export class ItemsService {
/**
@@ -235,6 +470,66 @@ export class PrivateService {
}
}
export class SecretsService {
/**
* Read Secrets
* List the names of stored secrets.
* @returns SecretNames Successful Response
* @throws ApiError
*/
public static readSecrets(): CancelablePromise<SecretsReadSecretsResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/secrets/'
});
}
/**
* Save Secret
* Store a secret under a name that nodes can reference.
* @param data The data for the request.
* @param data.name
* @param data.requestBody
* @returns Message Successful Response
* @throws ApiError
*/
public static saveSecret(data: SecretsSaveSecretData): CancelablePromise<SecretsSaveSecretResponse> {
return __request(OpenAPI, {
method: 'PUT',
url: '/api/v1/secrets/{name}',
path: {
name: data.name
},
body: data.requestBody,
mediaType: 'application/json',
errors: {
422: 'Validation Error'
}
});
}
/**
* Delete Secret
* Delete a secret.
* @param data The data for the request.
* @param data.name
* @returns Message Successful Response
* @throws ApiError
*/
public static deleteSecret(data: SecretsDeleteSecretData): CancelablePromise<SecretsDeleteSecretResponse> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/api/v1/secrets/{name}',
path: {
name: data.name
},
errors: {
422: 'Validation Error'
}
});
}
}
export class UsersService {
/**
* Read Users