@agentic-surfaces/server 0.1.7 → 0.1.9
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/dist/editor/assets/{index-tZEgT0Bn.css → index-BgnkW1wX.css} +1 -1
- package/dist/editor/assets/{index-CsNSnoPS.js → index-CaahXTxn.js} +70 -70
- package/dist/editor/index.html +2 -2
- package/dist/http.d.ts +11 -1
- package/dist/http.js +13 -1
- package/dist/serve.d.ts +11 -1
- package/dist/serve.js +2 -0
- package/package.json +2 -2
package/dist/editor/index.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>agentic-surfaces — workflow editor</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-CaahXTxn.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BgnkW1wX.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|
package/dist/http.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import http from "node:http";
|
|
2
|
-
import type { Workflow } from "@agentic-surfaces/core";
|
|
2
|
+
import type { Workflow, AgentDefinition } from "@agentic-surfaces/core";
|
|
3
3
|
import type { StreamingObserver } from "./streaming-observer.js";
|
|
4
4
|
/** Minimal run record kept in-memory for the /api/runs endpoint. */
|
|
5
5
|
export interface RunRecord {
|
|
@@ -21,6 +21,16 @@ export interface ServerOptions {
|
|
|
21
21
|
* (the editor renders read-only).
|
|
22
22
|
*/
|
|
23
23
|
onRun?: (name: string) => void | Promise<unknown>;
|
|
24
|
+
/** Project-level config surfaced at GET /api/config (so the UI shows effective agent defaults). */
|
|
25
|
+
config?: {
|
|
26
|
+
dryRun?: boolean;
|
|
27
|
+
agent?: {
|
|
28
|
+
model?: string;
|
|
29
|
+
effort?: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/** File-based agent definitions, surfaced at GET /api/agents (for the node detail view). */
|
|
33
|
+
agents?: AgentDefinition[];
|
|
24
34
|
}
|
|
25
35
|
/** Build an http.Server that serves the workflow-engine API and optional static files. */
|
|
26
36
|
export declare function createServer(opts: ServerOptions): http.Server;
|
package/dist/http.js
CHANGED
|
@@ -26,7 +26,7 @@ function writeEvent(res, event) {
|
|
|
26
26
|
}
|
|
27
27
|
/** Build an http.Server that serves the workflow-engine API and optional static files. */
|
|
28
28
|
export function createServer(opts) {
|
|
29
|
-
const { observer, workflows = [], staticDir, onRun } = opts;
|
|
29
|
+
const { observer, workflows = [], staticDir, onRun, config, agents = [] } = opts;
|
|
30
30
|
const workflowByName = new Map(workflows.map((w) => [w.name, w]));
|
|
31
31
|
// In-memory run registry — populated by listening to the observer.
|
|
32
32
|
const runs = new Map();
|
|
@@ -133,6 +133,18 @@ export function createServer(opts) {
|
|
|
133
133
|
});
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
|
+
if (pathname === "/api/config") {
|
|
137
|
+
json(res, config ?? {});
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (pathname === "/api/agents") {
|
|
141
|
+
// Metadata only — not the full instructions body.
|
|
142
|
+
json(res, agents.map((a) => ({
|
|
143
|
+
name: a.name, model: a.model, effort: a.effort,
|
|
144
|
+
commands: a.commands ?? null, fallback: a.fallback ?? null,
|
|
145
|
+
})));
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
136
148
|
if (pathname === "/api/runs") {
|
|
137
149
|
json(res, [...runs.values()].sort((a, b) => b.startedAt - a.startedAt));
|
|
138
150
|
return;
|
package/dist/serve.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import type { Workflow } from "@agentic-surfaces/core";
|
|
2
|
+
import type { Workflow, AgentDefinition } from "@agentic-surfaces/core";
|
|
3
3
|
import { StreamingObserver } from "./streaming-observer.js";
|
|
4
4
|
export interface ServeOptions {
|
|
5
5
|
port?: number;
|
|
@@ -11,6 +11,16 @@ export interface ServeOptions {
|
|
|
11
11
|
workflows?: Workflow[];
|
|
12
12
|
/** Trigger a run by name from the UI (POST /api/run). */
|
|
13
13
|
onRun?: (name: string) => void | Promise<unknown>;
|
|
14
|
+
/** Project config surfaced at GET /api/config (effective agent defaults, dryRun). */
|
|
15
|
+
config?: {
|
|
16
|
+
dryRun?: boolean;
|
|
17
|
+
agent?: {
|
|
18
|
+
model?: string;
|
|
19
|
+
effort?: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
/** Agent definitions surfaced at GET /api/agents. */
|
|
23
|
+
agents?: AgentDefinition[];
|
|
14
24
|
}
|
|
15
25
|
/**
|
|
16
26
|
* Locate the built editor assets to serve. Checks, in order:
|
package/dist/serve.js
CHANGED
|
@@ -34,6 +34,8 @@ export function serve(opts = {}) {
|
|
|
34
34
|
observer, port, host, staticDir,
|
|
35
35
|
workflows: opts.workflows,
|
|
36
36
|
onRun: opts.onRun,
|
|
37
|
+
config: opts.config,
|
|
38
|
+
agents: opts.agents,
|
|
37
39
|
});
|
|
38
40
|
server.listen(port, host, () => {
|
|
39
41
|
console.log(`[flow-server] listening on http://${host}:${port}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentic-surfaces/server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@agentic-surfaces/core": "0.1.
|
|
24
|
+
"@agentic-surfaces/core": "0.1.9"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "tsc -b",
|