@tea-agent/loop-agent 0.44.0-next.1 → 0.44.0-next.3
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/CHANGELOG.md +178 -175
- package/dist/build-stamp.json +3 -3
- package/dist/executors/pi-sdk-executor.js +29 -1
- package/dist/shared/wizard-local-telemetry.js +50 -0
- package/dist/worker/console/chat/chat-event-store.js +3 -0
- package/dist/worker/console/chat/db-connections.js +790 -0
- package/dist/worker/console/chat/pi-runtime/custom-tools/operator-tools.js +1 -1
- package/dist/worker/console/chat/pi-runtime/custom-tools/sql-tools.js +627 -0
- package/dist/worker/console/chat/pi-runtime.js +66 -6
- package/dist/worker/console/chat/routes.js +154 -3
- package/dist/worker/console/chat/sdd-data-alignment.js +8 -31
- package/dist/worker/console/chat/timeline-message-order.js +22 -0
- package/dist/worker/console/chat/tools.js +34 -0
- package/dist/worker/console/chat/turn-process.js +43 -39
- package/dist/worker/console/dag-confirmation.js +3 -0
- package/dist/worker/console/dag-execution-receipt.js +3 -0
- package/dist/worker/console/operator-actions.js +32 -2
- package/dist/worker/console/server.js +5 -1
- package/dist/worker/console/static/assets/{abnfDiagram-N423BO3Z-8-j6y-sd.js → abnfDiagram-N423BO3Z-COQlLTI7.js} +1 -1
- package/dist/worker/console/static/assets/{arc-eoQiMvuk.js → arc-zN3QkNaV.js} +1 -1
- package/dist/worker/console/static/assets/{architectureDiagram-T3A2C74G-C4A3uMcI.js → architectureDiagram-T3A2C74G-Pyoyj5f2.js} +1 -1
- package/dist/worker/console/static/assets/{blockDiagram-VBNYF7ZC-D4zD2F-Q.js → blockDiagram-VBNYF7ZC-BNppA5WW.js} +1 -1
- package/dist/worker/console/static/assets/{c4Diagram-5PPSVZJV-j1RkJziL.js → c4Diagram-5PPSVZJV-lyxL8nTx.js} +1 -1
- package/dist/worker/console/static/assets/channel-CgLPkTw2.js +1 -0
- package/dist/worker/console/static/assets/{chunk-2GRJ4B5K-YBHmhik1.js → chunk-2GRJ4B5K-0hgjcdK4.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-2Q5K7J3B-COfWyo9P.js → chunk-2Q5K7J3B-D63N9d4i.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5RXB4S5H-I99OUkHY.js → chunk-5RXB4S5H-CUw2AyB5.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5VM5RSS4-XKxoJNJ4.js → chunk-5VM5RSS4-Q_kwZT30.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-6Q2QTUOP-DLT_cYx1.js → chunk-6Q2QTUOP-C7vMiKcw.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-GF5L2VYU-CxcKZ9mV.js → chunk-GF5L2VYU-T9GbV5Hz.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-JWPE2WC7-V1EqXdjY.js → chunk-JWPE2WC7-D8nUSUJI.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-KBJHAD2P-DebTtdFp.js → chunk-KBJHAD2P-BCH2ewdp.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-RYQCIY6F-B-ivNRDf.js → chunk-RYQCIY6F-BTdDuDBN.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-XXDRQBXY-DC_Ds11b.js → chunk-XXDRQBXY-Cqm2RcKF.js} +1 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-CuSD1Mhb.js +1 -0
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-CuSD1Mhb.js +1 -0
- package/dist/worker/console/static/assets/{cose-bilkent-JH36ORCC-sWEqKwIb.js → cose-bilkent-JH36ORCC-pjwfpVu4.js} +1 -1
- package/dist/worker/console/static/assets/{cynefin-VYW2F7L2-BXa_dcu4.js → cynefin-VYW2F7L2-BvalptKA.js} +1 -1
- package/dist/worker/console/static/assets/{cynefinDiagram-MW4NZA55-C-Mle84F.js → cynefinDiagram-MW4NZA55-BU4qJ6d7.js} +1 -1
- package/dist/worker/console/static/assets/{dagre-VZM6K2ZE-CXPDBITe.js → dagre-VZM6K2ZE-DVTpq8J9.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-7IWD3JNH-CC-WJQfa.js → diagram-7IWD3JNH-B8s1W6Fc.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-B4RE2ZJO-CDAV5Vs4.js → diagram-B4RE2ZJO-DPrFk9yH.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-LBJQPF4R-CmFiAcNz.js → diagram-LBJQPF4R-CnQIQsHC.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-Q27KOJAE-DPBZHuyn.js → diagram-Q27KOJAE-op0DEpCv.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-UB23O5K3-jUlm_Ds3.js → diagram-UB23O5K3-DXQamm4T.js} +1 -1
- package/dist/worker/console/static/assets/{ebnfDiagram-BXEA7PRR-DWhQ3mfY.js → ebnfDiagram-BXEA7PRR-b1ad2C0r.js} +1 -1
- package/dist/worker/console/static/assets/{erDiagram-JOGREHBK-Tr2gMqet.js → erDiagram-JOGREHBK-B4cD-ZFJ.js} +1 -1
- package/dist/worker/console/static/assets/{flowDiagram-UKHOOZJN-DJjVQHPA.js → flowDiagram-UKHOOZJN-CrgGjlQ1.js} +1 -1
- package/dist/worker/console/static/assets/{ganttDiagram-PKOTCBZU-D74dQ4u0.js → ganttDiagram-PKOTCBZU-DovmXQNV.js} +1 -1
- package/dist/worker/console/static/assets/{gitGraphDiagram-DS77QQ5N-DwW0tZ0X.js → gitGraphDiagram-DS77QQ5N-DpFyu2Jn.js} +1 -1
- package/dist/worker/console/static/assets/index-DHBWEwz_.css +1 -0
- package/dist/worker/console/static/assets/index-JRfTUgP7.js +478 -0
- package/dist/worker/console/static/assets/{infoDiagram-6WML65LV-ILCbxJyb.js → infoDiagram-6WML65LV-D3MoQZIl.js} +1 -1
- package/dist/worker/console/static/assets/{ishikawaDiagram-WSZJBQD7-DeuWBQ89.js → ishikawaDiagram-WSZJBQD7-Ci6C1yjS.js} +1 -1
- package/dist/worker/console/static/assets/{journeyDiagram-NVQOT4AX-CF5ih8Fk.js → journeyDiagram-NVQOT4AX-BWMo2lIP.js} +1 -1
- package/dist/worker/console/static/assets/{kanban-definition-27J2QSJJ-C7yOSuRO.js → kanban-definition-27J2QSJJ-BdthIAg3.js} +1 -1
- package/dist/worker/console/static/assets/{linear-BDZ9riWi.js → linear-DuFAlSOj.js} +1 -1
- package/dist/worker/console/static/assets/{mermaid.core-7pKqYtpZ.js → mermaid.core-Dqz3Slj9.js} +5 -5
- package/dist/worker/console/static/assets/{mindmap-definition-FAOFIHXS-LeJDybSU.js → mindmap-definition-FAOFIHXS-DNVTrD09.js} +1 -1
- package/dist/worker/console/static/assets/{pegDiagram-VL7TDLO6-BJvT3pMD.js → pegDiagram-VL7TDLO6-CgfZPfBh.js} +1 -1
- package/dist/worker/console/static/assets/{pieDiagram-7S7Q4E2Y-_rGqpMan.js → pieDiagram-7S7Q4E2Y-ClM9P7yo.js} +1 -1
- package/dist/worker/console/static/assets/{quadrantDiagram-CIZ2JOQS-DPcSv5aA.js → quadrantDiagram-CIZ2JOQS-DwnEak2J.js} +1 -1
- package/dist/worker/console/static/assets/{railroadDiagram-AXF67PYL-Drxx4hkJ.js → railroadDiagram-AXF67PYL-rK4hxt9P.js} +1 -1
- package/dist/worker/console/static/assets/{requirementDiagram-LRYGKXZP-BCTUdU4z.js → requirementDiagram-LRYGKXZP-Cjqa6vo3.js} +1 -1
- package/dist/worker/console/static/assets/{sankeyDiagram-W5VNT64P-B6wzbZmB.js → sankeyDiagram-W5VNT64P-D3Fa250Z.js} +1 -1
- package/dist/worker/console/static/assets/{sequenceDiagram-SI44F4Z6-BGt8d3QQ.js → sequenceDiagram-SI44F4Z6-2PdrNajj.js} +1 -1
- package/dist/worker/console/static/assets/{sizeCapture-X5ZJPWSS-7nlhJKo7.js → sizeCapture-X5ZJPWSS-BBcuGeZn.js} +1 -1
- package/dist/worker/console/static/assets/{stateDiagram-OKZ733FA-Cv2stqMA.js → stateDiagram-OKZ733FA-CSJX9X6s.js} +1 -1
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-Cqskj0zt.js +1 -0
- package/dist/worker/console/static/assets/{swimlanes-SLNWSIFB-qDAo4Yc1.js → swimlanes-SLNWSIFB-pOUU1bic.js} +2 -2
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-CM0ZIhNP.js +8 -0
- package/dist/worker/console/static/assets/{timeline-definition-Z64GVDOM-CKbDNKTr.js → timeline-definition-Z64GVDOM-CAeqfQn0.js} +1 -1
- package/dist/worker/console/static/assets/{vennDiagram-T6HMQDX7-DI-9EHic.js → vennDiagram-T6HMQDX7-DYPLOMVO.js} +1 -1
- package/dist/worker/console/static/assets/{wardleyDiagram-T6FBY63Y-BrzzRDpX.js → wardleyDiagram-T6FBY63Y-Dy2V0Cha.js} +1 -1
- package/dist/worker/console/static/assets/{xychartDiagram-ELKLHX3M-BclH5hGh.js → xychartDiagram-ELKLHX3M-Dj9o7jrn.js} +1 -1
- package/dist/worker/console/static/index.html +2 -2
- package/dist/worker/console/static-src/operator-chat/chat-sse-events.js +33 -1
- package/dist/worker/console/static-src/operator-chat/chat-stream-continuity.js +101 -0
- package/dist/worker/console/static-src/operator-chat/compaction-message.js +18 -3
- package/dist/worker/console/static-src/operator-chat/pending-user-message.js +17 -3
- package/dist/worker/console/static-src/operator-chat/tools-catalog.js +16 -7
- package/dist/worker/console/static-src/operator-chat/useChatSessions.js +15 -7
- package/dist/worker/console/static-src/operator-chat/useChatStream.js +47 -5
- package/dist/worker/console/static-src/operator-chat/useChatThread.js +24 -2
- package/dist/worker/console/workspace-context.js +2 -0
- package/dist/worker/observe/static/console-theme.css +174 -0
- package/dist/worker/observe/static/console-theme.js +36 -0
- package/dist/worker/observe/static/operator-chrome.css +85 -0
- package/dist/worker/observe/static/operator-chrome.js +51 -0
- package/dist/worker/scheduler/scheduled-goal-evidence.js +60 -2
- package/dist/worker/scheduler/scheduled-goal-store.js +10 -0
- package/package.json +3 -1
- package/dist/worker/console/static/assets/channel-ChE7y-cx.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-C01TCf2X.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-C01TCf2X.js +0 -1
- package/dist/worker/console/static/assets/index-BWkIfcrK.css +0 -1
- package/dist/worker/console/static/assets/index-Cdkvw_H6.js +0 -469
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-DC7V5vcq.js +0 -1
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-Bwy4QUTO.js +0 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { execFile } from "node:child_process";
|
|
2
|
+
import { execFile, spawn } from "node:child_process";
|
|
3
3
|
import { promisify } from "node:util";
|
|
4
4
|
import { lstat, readFile, readlink, realpath } from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
@@ -7,6 +7,59 @@ import { pathMatchesPattern } from "../../shared/git-progress.js";
|
|
|
7
7
|
import { scheduledGoalDraftSchema } from "./scheduled-goal-types.js";
|
|
8
8
|
const execFileAsync = promisify(execFile);
|
|
9
9
|
const sha256 = (value) => createHash("sha256").update(value).digest("hex");
|
|
10
|
+
/** Working-copy paths that are plain files, so Git can read them back. */
|
|
11
|
+
async function plainFileNames(root, names) {
|
|
12
|
+
const plain = [];
|
|
13
|
+
for (const name of names) {
|
|
14
|
+
const info = await lstat(path.resolve(root, name)).catch(() => undefined);
|
|
15
|
+
if (info?.isFile())
|
|
16
|
+
plain.push(name);
|
|
17
|
+
}
|
|
18
|
+
return plain;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Repository-form blob IDs for working-copy files, computed by Git itself so
|
|
22
|
+
* that `core.autocrlf` and `eol` attributes normalize exactly as a commit
|
|
23
|
+
* would. Hashing never consults the index, so staged-only and
|
|
24
|
+
* `assume-unchanged` paths keep their raw-byte meaning. A failure degrades to
|
|
25
|
+
* the caller's raw-byte blob, which can only over-report change, never hide it;
|
|
26
|
+
* `--stdin-paths` cannot carry names containing a newline.
|
|
27
|
+
*/
|
|
28
|
+
async function gitNormalizedBlobIds(root, names) {
|
|
29
|
+
const ids = new Map();
|
|
30
|
+
const candidates = names.filter((name) => !name.includes("\n"));
|
|
31
|
+
if (candidates.length === 0)
|
|
32
|
+
return ids;
|
|
33
|
+
let stdout;
|
|
34
|
+
try {
|
|
35
|
+
stdout = await new Promise((resolve, reject) => {
|
|
36
|
+
const child = spawn("git", ["-C", root, "hash-object", "--stdin-paths"], { stdio: ["pipe", "pipe", "pipe"] });
|
|
37
|
+
let output = "";
|
|
38
|
+
let failure = "";
|
|
39
|
+
child.stdout.setEncoding("utf8");
|
|
40
|
+
child.stdout.on("data", (chunk) => { output += chunk; });
|
|
41
|
+
child.stderr.setEncoding("utf8");
|
|
42
|
+
child.stderr.on("data", (chunk) => { failure += chunk; });
|
|
43
|
+
child.on("error", reject);
|
|
44
|
+
child.on("close", (code) => {
|
|
45
|
+
if (code === 0)
|
|
46
|
+
resolve(output);
|
|
47
|
+
else
|
|
48
|
+
reject(new Error(`git hash-object failed: ${failure.trim()}`));
|
|
49
|
+
});
|
|
50
|
+
child.stdin.end(`${candidates.join("\n")}\n`);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return ids;
|
|
55
|
+
}
|
|
56
|
+
const hashes = stdout.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
57
|
+
if (hashes.length !== candidates.length)
|
|
58
|
+
return ids;
|
|
59
|
+
for (let index = 0; index < candidates.length; index += 1)
|
|
60
|
+
ids.set(candidates[index], hashes[index]);
|
|
61
|
+
return ids;
|
|
62
|
+
}
|
|
10
63
|
/** Run only frozen AC commands. A timeout is uncertain execution, never a passing or repairable failure. */
|
|
11
64
|
export async function evaluateScheduledGoalCriteria(frozen, options = {}) {
|
|
12
65
|
frozen = scheduledGoalDraftSchema.pick({ worktreeRef: true, frozenBase: true, allowedPaths: true, forbiddenPaths: true, acceptance: true, time: true }).strip().parse(frozen);
|
|
@@ -115,6 +168,11 @@ export async function captureScheduledGoalTree(worktree, base, allowedPaths, for
|
|
|
115
168
|
const blobId = (bytes) => createHash(objectFormat).update(`blob ${bytes.length}\0`).update(bytes).digest("hex");
|
|
116
169
|
const names = [...new Set([...entries(tracked), ...entries(untracked), ...baseEntries.keys()])].sort();
|
|
117
170
|
const deliveryNames = new Set(names);
|
|
171
|
+
// Compare content identity through Git's own normalization: a working copy
|
|
172
|
+
// materialized with `core.autocrlf` (or an `eol` attribute) is stored as LF
|
|
173
|
+
// while the checkout is CRLF, and raw bytes would report that as drift on
|
|
174
|
+
// every text file.
|
|
175
|
+
const normalizedIds = await gitNormalizedBlobIds(root, await plainFileNames(root, names));
|
|
118
176
|
const files = [];
|
|
119
177
|
const changedPaths = [];
|
|
120
178
|
for (const name of names) {
|
|
@@ -144,7 +202,7 @@ export async function captureScheduledGoalTree(worktree, base, allowedPaths, for
|
|
|
144
202
|
else if (stat.isFile()) {
|
|
145
203
|
const bytes = await readFile(target);
|
|
146
204
|
files.push({ name, kind: "file", hash: sha256(bytes), executable: Boolean(stat.mode & 0o111) });
|
|
147
|
-
actualId = blobId(bytes);
|
|
205
|
+
actualId = normalizedIds.get(name) ?? blobId(bytes);
|
|
148
206
|
actualMode = stat.mode & 0o111 ? "100755" : "100644";
|
|
149
207
|
}
|
|
150
208
|
else
|
|
@@ -16,6 +16,16 @@ async function syncDirectory(directoryPath) {
|
|
|
16
16
|
try {
|
|
17
17
|
await directory.sync();
|
|
18
18
|
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
// The file body is already durable from the file-level fsync above.
|
|
21
|
+
// Windows refuses to flush a directory handle (EPERM) and some
|
|
22
|
+
// filesystems reject the call outright, so a directory-only failure must
|
|
23
|
+
// not abort a transaction whose data is already on disk.
|
|
24
|
+
const code = error.code;
|
|
25
|
+
if (code !== "EPERM" && code !== "EACCES" && code !== "EINVAL"
|
|
26
|
+
&& code !== "ENOTSUP" && code !== "EOPNOTSUPP" && code !== "ENOSYS")
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
19
29
|
finally {
|
|
20
30
|
await directory.close();
|
|
21
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tea-agent/loop-agent",
|
|
3
|
-
"version": "0.44.0-next.
|
|
3
|
+
"version": "0.44.0-next.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"loop-agent": "bin/loop-agent.js",
|
|
@@ -84,7 +84,9 @@
|
|
|
84
84
|
"commander": "^12.1.0",
|
|
85
85
|
"katex": "^0.16.47",
|
|
86
86
|
"mermaid": "^11.16.1",
|
|
87
|
+
"mysql2": "^3.24.4",
|
|
87
88
|
"node-pty": "^1.2.0-beta.15",
|
|
89
|
+
"pg": "^8.23.0",
|
|
88
90
|
"playwright-core": "^1.63.0",
|
|
89
91
|
"rehype-highlight": "^7.0.2",
|
|
90
92
|
"rehype-katex": "^7.0.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ag as o,ah as n}from"./mermaid.core-7pKqYtpZ.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-GF5L2VYU-CxcKZ9mV.js";import{_ as i}from"./mermaid.core-7pKqYtpZ.js";import"./chunk-5VM5RSS4-XKxoJNJ4.js";import"./chunk-XXDRQBXY-DC_Ds11b.js";import"./chunk-KBJHAD2P-DebTtdFp.js";import"./chunk-2GRJ4B5K-YBHmhik1.js";import"./index-Cdkvw_H6.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-GF5L2VYU-CxcKZ9mV.js";import{_ as i}from"./mermaid.core-7pKqYtpZ.js";import"./chunk-5VM5RSS4-XKxoJNJ4.js";import"./chunk-XXDRQBXY-DC_Ds11b.js";import"./chunk-KBJHAD2P-DebTtdFp.js";import"./chunk-2GRJ4B5K-YBHmhik1.js";import"./index-Cdkvw_H6.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|