@tea-agent/loop-agent 0.8.0 → 0.9.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/AGENTS.md +2 -0
- package/CHANGELOG.md +22 -3
- package/dist/application/dag/args.js +9 -2
- package/dist/executors/shell-executor.js +74 -8
- package/dist/shared/reference-context.js +48 -22
- package/dist/task/config-types.js +1 -1
- package/dist/task/runtime.js +1 -1
- package/dist/worker/loop-agent/loop-agent-client.js +51 -10
- package/dist/worker/observe/routes.js +78 -20
- package/dist/worker/observe/server.js +8 -6
- package/dist/worker/observe/static/app.js +628 -142
- package/dist/worker/observe/static/index.html +68 -43
- package/dist/worker/observe/static/styles.css +478 -602
- package/docs/README.md +4 -0
- package/docs/design/README.md +2 -2
- package/docs/exec-plans/active/README.md +2 -2
- package/docs/exec-plans/completed/README.md +8 -0
- package/docs/reports/README.md +3 -0
- package/package.json +1 -1
- package/scripts/check-task-pool-root.sh +1 -1
- package/skills/loop-agent/references/verification-and-failure-handling.md +8 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createServer } from "node:http";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { handleRequest, serveStatic } from "./routes.js";
|
|
4
|
+
import { createObserveSnapshotCache, handleRequest, serveStatic, } from "./routes.js";
|
|
5
5
|
const STATIC_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "static");
|
|
6
6
|
export function createObserveServer(options) {
|
|
7
7
|
const repoRoot = path.resolve(options.repoRoot);
|
|
@@ -11,6 +11,12 @@ export function createObserveServer(options) {
|
|
|
11
11
|
}
|
|
12
12
|
const port = options.port ?? 0;
|
|
13
13
|
const pollIntervalMs = options.pollIntervalMs ?? 1000;
|
|
14
|
+
const routeContext = {
|
|
15
|
+
repoRoot,
|
|
16
|
+
pollIntervalMs,
|
|
17
|
+
staticDir: STATIC_DIR,
|
|
18
|
+
snapshotCache: createObserveSnapshotCache(),
|
|
19
|
+
};
|
|
14
20
|
return new Promise((resolve, reject) => {
|
|
15
21
|
const server = createServer((req, res) => {
|
|
16
22
|
void dispatch(req, res).catch((error) => {
|
|
@@ -27,11 +33,7 @@ export function createObserveServer(options) {
|
|
|
27
33
|
});
|
|
28
34
|
});
|
|
29
35
|
async function dispatch(req, res) {
|
|
30
|
-
const handled = await handleRequest(req, res,
|
|
31
|
-
repoRoot,
|
|
32
|
-
pollIntervalMs,
|
|
33
|
-
staticDir: STATIC_DIR,
|
|
34
|
-
});
|
|
36
|
+
const handled = await handleRequest(req, res, routeContext);
|
|
35
37
|
if (!handled) {
|
|
36
38
|
await serveStatic(req, res, STATIC_DIR);
|
|
37
39
|
}
|