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
6 changes: 3 additions & 3 deletions .agents/skills/fbp/references/fbp-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ import { insertNode, removeNode, renameNode, moveNode } from '@fbp/spec';
// Insert a node at root scope
const newGraph = insertNode(graph, '/', {
name: 'add1',
type: 'math/add'
type: 'math:add'
});

// Insert into a subnet
const newGraph = insertNode(graph, '/subnet1', {
name: 'multiply1',
type: 'math/multiply'
type: 'math:multiply'
});

// Remove a node and connected edges
Expand Down Expand Up @@ -130,7 +130,7 @@ const node = getNode(graph, '/subnet1/add1');
const rootNodes = getNodes(graph, '/');
const rootEdges = getEdges(graph, '/');

const addNodes = findNodes(graph, (node) => node.type === 'math/add');
const addNodes = findNodes(graph, (node) => node.type === 'math:add');
// [{ node: {...}, path: '/add1' }, { node: {...}, path: '/subnet1/add2' }]

const boundary = findBoundaryNodes(graph, '/subnet1');
Expand Down
8 changes: 4 additions & 4 deletions packages/evaluator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type { NodeDefinitionWithImpl } from '@fbp/evaluator';
const addDef: NodeDefinitionWithImpl = {
context: 'js',
category: 'math',
type: 'js/math/add',
name: 'add',
inputs: [
{ name: 'a', type: 'number' },
{ name: 'b', type: 'number' }
Expand All @@ -34,9 +34,9 @@ const addDef: NodeDefinitionWithImpl = {
const graph: Graph = {
name: 'simple-add',
nodes: [
{ name: 'num1', type: 'js/const/number', props: [{ name: 'value', type: 'number', value: 5 }] },
{ name: 'num2', type: 'js/const/number', props: [{ name: 'value', type: 'number', value: 3 }] },
{ name: 'add', type: 'js/math/add' }
{ name: 'num1', type: 'const:number', props: [{ name: 'value', type: 'number', value: 5 }] },
{ name: 'num2', type: 'const:number', props: [{ name: 'value', type: 'number', value: 3 }] },
{ name: 'add', type: 'math:add' }
],
edges: [
{ src: { node: 'num1', port: 'value' }, dst: { node: 'add', port: 'a' } },
Expand Down
6 changes: 3 additions & 3 deletions packages/graph-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A Houdini-inspired graph editor for Flow-Based Programming built with React, SVG
## Features

- **SVG-based canvas** with pan/zoom support
- **Node rendering** with fully-qualified type paths (e.g., `js/math/add`)
- **Node rendering** with `category:name` type identifiers (e.g., `math:add`)
- **Bezier edge connections** between ports
- **Selection system** with box select, shift-add/remove, and Cmd+D duplicate
- **Properties panel** auto-generated from `PropDefinition`
Expand All @@ -30,7 +30,7 @@ const graph: Graph = {
{
context: 'js',
category: 'math',
type: 'js/math/add',
name: 'add',
inputs: [
{ name: 'a', type: 'number' },
{ name: 'b', type: 'number' }
Expand All @@ -41,7 +41,7 @@ const graph: Graph = {
}
],
nodes: [
{ name: 'add1', type: 'js/math/add', meta: { x: 100, y: 100 } }
{ name: 'add1', type: 'math:add', meta: { x: 100, y: 100 } }
],
edges: []
};
Expand Down
14 changes: 7 additions & 7 deletions packages/spec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Definition of a reusable node type (like a class).

```typescript
interface NodeDefinition {
type: string; // Unique identifier (e.g., "math/add")
type: string; // Unique identifier (e.g., "math:add")
context?: string; // Namespace (e.g., "math", "ui")
category?: string; // Palette category
inputs?: PortDef[]; // Input port definitions
Expand Down Expand Up @@ -408,13 +408,13 @@ Insert a node at a scope.
```typescript
const newGraph = insertNode(graph, '/', {
name: 'add1',
type: 'math/add'
type: 'math:add'
});

// Insert into a subnet
const newGraph = insertNode(graph, '/subnet1', {
name: 'multiply1',
type: 'math/multiply'
type: 'math:multiply'
});
```

Expand Down Expand Up @@ -531,7 +531,7 @@ const subnetEdges = getEdges(graph, '/subnet1');
Find nodes recursively matching a predicate.

```typescript
const addNodes = findNodes(graph, (node) => node.type === 'math/add');
const addNodes = findNodes(graph, (node) => node.type === 'math:add');
// [{ node: {...}, path: '/add1' }, { node: {...}, path: '/subnet1/add2' }]
```

Expand Down Expand Up @@ -607,7 +607,7 @@ A graph that adds two numbers:
"meta": { "x": 0, "y": 100 },
"props": [{ "name": "portName", "value": "b" }, { "name": "dataType", "value": "number" }]
},
{ "name": "add1", "type": "math/add", "meta": { "x": 200, "y": 50 } },
{ "name": "add1", "type": "math:add", "meta": { "x": 200, "y": 50 } },
{
"name": "output_result",
"type": "graphOutput",
Expand Down Expand Up @@ -646,7 +646,7 @@ A graph with a reusable "double" subnet:
"type": "graphInput",
"props": [{ "name": "portName", "value": "x" }]
},
{ "name": "mult", "type": "math/multiply", "props": [{ "name": "b", "value": 2 }] },
{ "name": "mult", "type": "math:multiply", "props": [{ "name": "b", "value": 2 }] },
{
"name": "output_result",
"type": "graphOutput",
Expand Down Expand Up @@ -704,7 +704,7 @@ graph = insertNode(graph, '/', {
});

// Add processing node
graph = insertNode(graph, '/', { name: 'add1', type: 'math/add' });
graph = insertNode(graph, '/', { name: 'add1', type: 'math:add' });

// Connect edges (reference nodes by their keys)
graph = addEdge(graph, '/', {
Expand Down
3 changes: 2 additions & 1 deletion packages/spec/graph.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@
"name": {
"type": "string",
"minLength": 1,
"description": "Local identifier within the context (e.g., 'add', 'template', 'request')."
"pattern": "^[^/]+$",
"description": "Local identifier within the context (e.g., 'add', 'template', 'request'). Slash (/) is not allowed."
},
"category": {
"type": "string",
Expand Down
8 changes: 3 additions & 5 deletions packages/types/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,15 +316,14 @@ The `type` field on a `Node` identifies what kind of processing the node perform
### Format

```
category:name[/route]
category:name
```

* **`category`** (required) — domain grouping (e.g. `math`, `const`, `email`, `json`)
* **`name`** (required) — action name within the category (e.g. `add`, `string`, `send`)
* **`/route`** (optional) — sub-route for multi-method containers where a single service handles multiple actions
* **`name`** (required) — action name within the category (e.g. `add`, `string`, `send`). The name doubles as the HTTP route for HTTP-dispatched nodes.

The **colon** (`:`) separates category from name.
The **slash** (`/`) is reserved for optional routing within a function and must not be used as the category separator.
The **slash** (`/`) character is **not allowed** in node type names.

### Examples

Expand All @@ -333,7 +332,6 @@ math:add — pure math addition
const:string — constant string value
email:send — send an email
json:select — extract a value from JSON
email:postmaster/send — "send" route within the "postmaster" service
```

### Boundary Nodes
Expand Down
3 changes: 2 additions & 1 deletion packages/types/graph.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@
"type": {
"type": "string",
"minLength": 1,
"description": "Unique type identifier, typically in format 'context/category/name' (e.g. 'js/math/add')."
"pattern": "^[^/]+$",
"description": "Unique type identifier in format 'category:name' (e.g. 'math:add'). Slash (/) is not allowed."
},
"inputs": {
"type": "array",
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fbp/types",
"version": "1.1.0",
"version": "1.2.0",
"author": "Dan Lynch <pyramation@gmail.com>",
"description": "Flow-Based Programming schemas and converters in TypeScript",
"main": "index.js",
Expand Down
Loading