Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
4d89c56
effect schema foundation
adilhbay Jan 21, 2026
1208a27
simplify schema generation: auto-generate arrays, remove boilerplate
adilhbay Jan 21, 2026
b2520c5
Add TypeSpec AI Tools emitter to generate Effect Schemas
adilhbay Jan 21, 2026
dd6d2dd
Derive mutation tool schemas from collection models via @mutationTool…
adilhbay Jan 23, 2026
173498b
Add exploration and execution tool schema generation
adilhbay Jan 23, 2026
8355026
Add @explorationTool decorator and include all tool categories in sch…
adilhbay Jan 23, 2026
1431528
Slim down emitter.tsx by extracting field-schema and unifying components
adilhbay Jan 23, 2026
6aabb34
Merge branch 'the-dev-tools:main' into feature/schema-gen
adilhbay Jan 24, 2026
4923a38
Fix schema generation for optional sourceHandle and excluded kind field
adilhbay Jan 24, 2026
179acb0
Merge branch 'main' of https://github.com/the-dev-tools/dev-tools int…
adilhbay Jan 26, 2026
d182062
Merge branch 'feature/schema-gen' of https://github.com/adilhbay/dev-…
adilhbay Jan 26, 2026
d07a174
Split ConnectNodes into sequential and branching tools
adilhbay Jan 26, 2026
eaa923c
Fix TypeScript errors in schema generation
adilhbay Jan 26, 2026
0e78548
Move schema generation to runtime by inlining common schemas into emi…
adilhbay Jan 27, 2026
6399fd8
Auto-derive decorator defaults from model names for explorationTool a…
adilhbay Jan 27, 2026
e9364c5
Replace raw string expressions with alloy-js primitives in emitter
adilhbay Jan 27, 2026
783b5c8
Remove ValidateWorkflow and add NodeExecution exploration tools
adilhbay Jan 27, 2026
0266e48
remove tools which will be added later on
adilhbay Jan 28, 2026
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
51 changes: 46 additions & 5 deletions packages/spec/api/flow.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ model FlowDuplicateRequest {

op FlowDuplicate(...FlowDuplicateRequest): {};

@AITools.aiTool(#{ category: AITools.ToolCategory.Execution, title: "Run Flow" })
@doc("Execute a workflow from the start node.")
model FlowRunRequest {
flowId: Id;
@doc("The ULID of the workflow to run") flowId: Id;
}

op FlowRun(...FlowRunRequest): {};

@AITools.aiTool(#{ category: AITools.ToolCategory.Execution, title: "Stop Flow" })
@doc("Stop a running workflow execution.")
model FlowStopRequest {
flowId: Id;
@doc("The ULID of the workflow to stop") flowId: Id;
}

op FlowStop(...FlowStopRequest): {};
Expand All @@ -35,6 +39,11 @@ model FlowVersion {
@foreignKey flowId: Id;
}

@AITools.explorationTool
@AITools.mutationTool(
#{ operation: AITools.CrudOperation.Insert, title: "Create Variable", name: "CreateVariable", description: "Create a new workflow variable that can be referenced in node expressions." },
#{ operation: AITools.CrudOperation.Update, title: "Update Variable", name: "UpdateVariable", description: "Update an existing workflow variable." }
)
@TanStackDB.collection
model FlowVariable {
@primaryKey flowVariableId: Id;
Expand All @@ -47,6 +56,12 @@ enum HandleKind {
Loop,
}

@AITools.explorationTool
@AITools.mutationTool(
#{ operation: AITools.CrudOperation.Insert, title: "Connect Sequential Nodes", name: "ConnectSequentialNodes", exclude: #["sourceHandle"], description: "Connect two nodes in a sequential flow. Use this for ManualStart, JavaScript, and HTTP nodes which have a single output." },
#{ operation: AITools.CrudOperation.Insert, title: "Connect Branching Nodes", name: "ConnectBranchingNodes", description: "Connect a branching node (Condition, For, ForEach) to another node. Requires sourceHandle: 'then' or 'else' for Condition nodes, 'then' or 'loop' for For/ForEach nodes." },
#{ operation: AITools.CrudOperation.Delete, title: "Disconnect Nodes", name: "DisconnectNodes", description: "Remove an edge connection between nodes." }
)
@TanStackDB.collection
model Edge {
@primaryKey edgeId: Id;
Expand Down Expand Up @@ -78,6 +93,11 @@ model Position {
y: float32;
}

@AITools.explorationTool
@AITools.mutationTool(
#{ operation: AITools.CrudOperation.Update, title: "Update Node Config", name: "UpdateNodeConfig", exclude: #["kind"], description: "Update general node properties like name or position." },
#{ operation: AITools.CrudOperation.Delete, description: "Delete a node from the workflow. Also removes all connected edges." }
)
@TanStackDB.collection
model Node {
@primaryKey nodeId: Id;
Expand All @@ -89,10 +109,14 @@ model Node {
@visibility(Lifecycle.Read) info?: string;
}

@AITools.explorationTool
@AITools.mutationTool(
#{ operation: AITools.CrudOperation.Insert, title: "Create HTTP Node", name: "CreateHttpNode", parent: "Node", exclude: #["kind"], description: "Create a new HTTP request node that makes an API call." }
)
@TanStackDB.collection
model NodeHttp {
@primaryKey nodeId: Id;
@foreignKey httpId: Id;
@doc("The ULID of the HTTP request definition to use") @foreignKey httpId: Id;
@foreignKey deltaHttpId?: Id;
}

Expand All @@ -101,28 +125,45 @@ enum ErrorHandling {
Break,
}

@AITools.explorationTool
@AITools.mutationTool(
#{ operation: AITools.CrudOperation.Insert, title: "Create For Loop Node", name: "CreateForNode", parent: "Node", exclude: #["kind"], description: "Create a for-loop node that iterates a fixed number of times." }
)
@TanStackDB.collection
model NodeFor {
@primaryKey nodeId: Id;
iterations: int32;
@doc("Number of iterations to perform") iterations: int32;
condition: string;
errorHandling: ErrorHandling;
}

@AITools.explorationTool
@AITools.mutationTool(
#{ operation: AITools.CrudOperation.Insert, title: "Create ForEach Loop Node", name: "CreateForEachNode", parent: "Node", exclude: #["kind"], description: "Create a forEach node that iterates over an array or object." }
)
@TanStackDB.collection
model NodeForEach {
@primaryKey nodeId: Id;
path: string;
@doc("Path to the array/object to iterate (e.g., \"input.items\")") path: string;
condition: string;
errorHandling: ErrorHandling;
}

@AITools.explorationTool
@AITools.mutationTool(
#{ operation: AITools.CrudOperation.Insert, title: "Create Condition Node", name: "CreateConditionNode", parent: "Node", exclude: #["kind"], description: "Create a condition node that routes flow based on a boolean expression. Has THEN and ELSE output handles." }
)
@TanStackDB.collection
model NodeCondition {
@primaryKey nodeId: Id;
condition: string;
}

@AITools.explorationTool
@AITools.mutationTool(
#{ operation: AITools.CrudOperation.Insert, title: "Create JavaScript Node", name: "CreateJsNode", parent: "Node", exclude: #["kind"], description: "Create a new JavaScript node in the workflow. JS nodes can transform data, make calculations, or perform custom logic." },
#{ operation: AITools.CrudOperation.Update, title: "Update Node Code", name: "UpdateNodeCode", description: "Update the JavaScript code of a JS node." }
)
@TanStackDB.collection
model NodeJs {
@primaryKey nodeId: Id;
Expand Down
11 changes: 6 additions & 5 deletions packages/spec/api/main.tsp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "@the-dev-tools/spec-lib/core";
import "@the-dev-tools/spec-lib/protobuf";
import "@the-dev-tools/spec-lib/tanstack-db";
import "@the-dev-tools/spec-lib/ai-tools";

import "./environment.tsp";
import "./export.tsp";
Expand All @@ -20,11 +21,11 @@ alias Id = bytes;

model CommonTableFields<TParent extends Reflection.Model> {
...Keys<TParent, #{ primary: KeyAs.Foreign, foreign: KeyAs.Omit }>;
key: string;
enabled: boolean;
value: string;
description: string;
order: float32;
@doc("Variable name (used to reference it in expressions)") key: string;
@doc("Whether the variable is active") enabled: boolean;
@doc("Variable value") value: string;
@doc("Description of what the variable is for") description: string;
@doc("Display order") order: float32;
}

@DevTools.project
Expand Down
13 changes: 11 additions & 2 deletions packages/spec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@
"type": "module",
"files": [
"dist",
"src",
"go.mod",
"go.sum"
],
"exports": {
"./buf/*": "./dist/buf/typescript/*.ts",
"./tanstack-db/*": "./dist/tanstack-db/typescript/*.ts"
"./tanstack-db/*": "./dist/tanstack-db/typescript/*.ts",
"./tools": "./dist/ai-tools/v1/index.ts",
"./tools/common": "./dist/ai-tools/v1/common.ts",
"./tools/execution": "./dist/ai-tools/v1/execution.ts",
"./tools/exploration": "./dist/ai-tools/v1/exploration.ts",
"./tools/mutation": "./dist/ai-tools/v1/mutation.ts"
},
"dependencies": {
"effect": "catalog:"
},
"devDependencies": {
"@bufbuild/buf": "catalog:",
Expand All @@ -18,8 +27,8 @@
"@the-dev-tools/eslint-config": "workspace:^",
"@the-dev-tools/spec-lib": "workspace:^",
"@types/node": "catalog:",
"effect": "catalog:",
"prettier": "catalog:",
"tsx": "^4.19.0",
"typescript": "catalog:"
}
}
2 changes: 1 addition & 1 deletion packages/spec/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "../../tsconfig.json",
"include": ["dist", "lib"],
"include": ["dist", "lib", "src/tools"],
"exclude": ["node_modules", "*.ts"],
"references": [
{
Expand Down
1 change: 1 addition & 0 deletions packages/spec/tspconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ output-dir: '{project-root}/dist'
emit:
- '@the-dev-tools/spec-lib/protobuf'
- '@the-dev-tools/spec-lib/tanstack-db'
- '@the-dev-tools/spec-lib/ai-tools'

options:
'@the-dev-tools/spec-lib':
Expand Down
10 changes: 7 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions tools/spec-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"types": "./dist/src/tanstack-db/index.d.ts",
"default": "./dist/src/tanstack-db/index.js",
"typespec": "./src/tanstack-db/main.tsp"
},
"./ai-tools": {
"types": "./dist/src/ai-tools/index.d.ts",
"default": "./dist/src/ai-tools/index.js",
"typespec": "./src/ai-tools/main.tsp"
}
},
"devDependencies": {
Expand Down
Loading