@fbp/examples 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +40 -0
- package/esm/graphs/agent-review-loop.js +117 -0
- package/esm/graphs/agentic-embed.js +57 -0
- package/esm/graphs/agentic-kit.js +94 -0
- package/esm/graphs/coding-agent.js +80 -0
- package/esm/graphs/coding-session.js +70 -0
- package/esm/graphs/email-send.js +141 -0
- package/esm/graphs/failed-check-fanout.js +78 -0
- package/esm/graphs/hello-string.js +50 -0
- package/esm/graphs/math-pipeline.js +53 -0
- package/esm/index.js +47 -0
- package/esm/types.js +1 -0
- package/graphs/agent-review-loop.d.ts +23 -0
- package/graphs/agent-review-loop.js +120 -0
- package/graphs/agentic-embed.d.ts +13 -0
- package/graphs/agentic-embed.js +60 -0
- package/graphs/agentic-kit.d.ts +20 -0
- package/graphs/agentic-kit.js +97 -0
- package/graphs/coding-agent.d.ts +17 -0
- package/graphs/coding-agent.js +83 -0
- package/graphs/coding-session.d.ts +18 -0
- package/graphs/coding-session.js +73 -0
- package/graphs/email-send.d.ts +12 -0
- package/graphs/email-send.js +144 -0
- package/graphs/failed-check-fanout.d.ts +22 -0
- package/graphs/failed-check-fanout.js +81 -0
- package/graphs/hello-string.d.ts +10 -0
- package/graphs/hello-string.js +53 -0
- package/graphs/math-pipeline.d.ts +9 -0
- package/graphs/math-pipeline.js +56 -0
- package/index.d.ts +24 -0
- package/index.js +63 -0
- package/package.json +40 -0
- package/types.d.ts +26 -0
- package/types.js +2 -0
package/index.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getExampleFlow = exports.findExampleFlow = exports.exampleFlows = exports.mathPipelineExpectedOutput = exports.mathPipeline = exports.helloStringExpectedOutput = exports.helloString = exports.failedCheckFanout = exports.emailSend = exports.codingSession = exports.codingAgent = exports.agenticKit = exports.agenticEmbed = exports.agentReviewLoop = void 0;
|
|
4
|
+
const agent_review_loop_1 = require("./graphs/agent-review-loop");
|
|
5
|
+
const agentic_embed_1 = require("./graphs/agentic-embed");
|
|
6
|
+
const agentic_kit_1 = require("./graphs/agentic-kit");
|
|
7
|
+
const coding_agent_1 = require("./graphs/coding-agent");
|
|
8
|
+
const coding_session_1 = require("./graphs/coding-session");
|
|
9
|
+
const email_send_1 = require("./graphs/email-send");
|
|
10
|
+
const failed_check_fanout_1 = require("./graphs/failed-check-fanout");
|
|
11
|
+
const hello_string_1 = require("./graphs/hello-string");
|
|
12
|
+
const math_pipeline_1 = require("./graphs/math-pipeline");
|
|
13
|
+
var agent_review_loop_2 = require("./graphs/agent-review-loop");
|
|
14
|
+
Object.defineProperty(exports, "agentReviewLoop", { enumerable: true, get: function () { return agent_review_loop_2.agentReviewLoop; } });
|
|
15
|
+
var agentic_embed_2 = require("./graphs/agentic-embed");
|
|
16
|
+
Object.defineProperty(exports, "agenticEmbed", { enumerable: true, get: function () { return agentic_embed_2.agenticEmbed; } });
|
|
17
|
+
var agentic_kit_2 = require("./graphs/agentic-kit");
|
|
18
|
+
Object.defineProperty(exports, "agenticKit", { enumerable: true, get: function () { return agentic_kit_2.agenticKit; } });
|
|
19
|
+
var coding_agent_2 = require("./graphs/coding-agent");
|
|
20
|
+
Object.defineProperty(exports, "codingAgent", { enumerable: true, get: function () { return coding_agent_2.codingAgent; } });
|
|
21
|
+
var coding_session_2 = require("./graphs/coding-session");
|
|
22
|
+
Object.defineProperty(exports, "codingSession", { enumerable: true, get: function () { return coding_session_2.codingSession; } });
|
|
23
|
+
var email_send_2 = require("./graphs/email-send");
|
|
24
|
+
Object.defineProperty(exports, "emailSend", { enumerable: true, get: function () { return email_send_2.emailSend; } });
|
|
25
|
+
var failed_check_fanout_2 = require("./graphs/failed-check-fanout");
|
|
26
|
+
Object.defineProperty(exports, "failedCheckFanout", { enumerable: true, get: function () { return failed_check_fanout_2.failedCheckFanout; } });
|
|
27
|
+
var hello_string_2 = require("./graphs/hello-string");
|
|
28
|
+
Object.defineProperty(exports, "helloString", { enumerable: true, get: function () { return hello_string_2.helloString; } });
|
|
29
|
+
Object.defineProperty(exports, "helloStringExpectedOutput", { enumerable: true, get: function () { return hello_string_2.helloStringExpectedOutput; } });
|
|
30
|
+
var math_pipeline_2 = require("./graphs/math-pipeline");
|
|
31
|
+
Object.defineProperty(exports, "mathPipeline", { enumerable: true, get: function () { return math_pipeline_2.mathPipeline; } });
|
|
32
|
+
Object.defineProperty(exports, "mathPipelineExpectedOutput", { enumerable: true, get: function () { return math_pipeline_2.mathPipelineExpectedOutput; } });
|
|
33
|
+
/**
|
|
34
|
+
* Every example flow, in the order the Flows panel offers them: the two that
|
|
35
|
+
* run with no platform first, then the ones that address registered functions.
|
|
36
|
+
*/
|
|
37
|
+
exports.exampleFlows = [
|
|
38
|
+
hello_string_1.helloString,
|
|
39
|
+
math_pipeline_1.mathPipeline,
|
|
40
|
+
failed_check_fanout_1.failedCheckFanout,
|
|
41
|
+
agentic_embed_1.agenticEmbed,
|
|
42
|
+
agentic_kit_1.agenticKit,
|
|
43
|
+
email_send_1.emailSend,
|
|
44
|
+
coding_agent_1.codingAgent,
|
|
45
|
+
coding_session_1.codingSession,
|
|
46
|
+
agent_review_loop_1.agentReviewLoop,
|
|
47
|
+
];
|
|
48
|
+
/** The example with this id, or undefined. */
|
|
49
|
+
const findExampleFlow = (id) => exports.exampleFlows.find((example) => example.id === id);
|
|
50
|
+
exports.findExampleFlow = findExampleFlow;
|
|
51
|
+
/**
|
|
52
|
+
* The example with this id. Throws when it does not exist: a caller naming an
|
|
53
|
+
* example by id has a graph in mind, and silently handing back an empty one
|
|
54
|
+
* turns a typo into a green run over nothing.
|
|
55
|
+
*/
|
|
56
|
+
const getExampleFlow = (id) => {
|
|
57
|
+
const found = (0, exports.findExampleFlow)(id);
|
|
58
|
+
if (!found) {
|
|
59
|
+
throw new Error(`Unknown example flow "${id}" — known ids: ${exports.exampleFlows.map((e) => e.id).join(', ')}`);
|
|
60
|
+
}
|
|
61
|
+
return found;
|
|
62
|
+
};
|
|
63
|
+
exports.getExampleFlow = getExampleFlow;
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fbp/examples",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Example FBP flow graphs — the catalog the Flows panel offers and the suites execute",
|
|
5
|
+
"author": "Constructive <developers@constructive.io>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "index.js",
|
|
8
|
+
"module": "esm/index.js",
|
|
9
|
+
"types": "index.d.ts",
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public",
|
|
12
|
+
"directory": "dist"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "makage build",
|
|
16
|
+
"build:dev": "makage build --dev",
|
|
17
|
+
"clean": "makage clean",
|
|
18
|
+
"test": "jest"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@fbp/types": "workspace:*"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@fbp/evaluator": "workspace:*",
|
|
25
|
+
"@types/jest": "^29.5.14",
|
|
26
|
+
"@types/node": "^22.10.4",
|
|
27
|
+
"jest": "^29.7.0",
|
|
28
|
+
"makage": "^0.1.12",
|
|
29
|
+
"ts-jest": "^29.2.0",
|
|
30
|
+
"typescript": "^5.7.0"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/constructive-io/fbp",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/constructive-io/fbp"
|
|
36
|
+
},
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/constructive-io/fbp/issues"
|
|
39
|
+
}
|
|
40
|
+
}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Graph } from '@fbp/types';
|
|
2
|
+
/**
|
|
3
|
+
* What an example needs before it can run.
|
|
4
|
+
*
|
|
5
|
+
* - `local` — every node is an inline node, so the editor's local preview
|
|
6
|
+
* evaluates the whole graph in the browser with no platform at all.
|
|
7
|
+
* - `server` — the graph addresses registered cloud functions, so it only runs
|
|
8
|
+
* through `Run on Server` (compute-worker → knative).
|
|
9
|
+
*/
|
|
10
|
+
export type ExampleRuntime = 'local' | 'server';
|
|
11
|
+
export interface ExampleFlow {
|
|
12
|
+
/** Stable id — what a test or a deep link addresses. */
|
|
13
|
+
id: string;
|
|
14
|
+
/** Label shown in the Flows panel's Examples menu. */
|
|
15
|
+
name: string;
|
|
16
|
+
/** One line saying what the graph demonstrates. */
|
|
17
|
+
description: string;
|
|
18
|
+
runtime: ExampleRuntime;
|
|
19
|
+
/**
|
|
20
|
+
* Task identifiers the graph expects to be registered, empty for a graph made
|
|
21
|
+
* only of inline nodes. Listed so a suite can skip an example whose functions
|
|
22
|
+
* the environment under test does not carry.
|
|
23
|
+
*/
|
|
24
|
+
requiresFunctions: string[];
|
|
25
|
+
graph: Graph;
|
|
26
|
+
}
|
package/types.js
ADDED