agentweaver 0.1.19 → 0.1.20

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.
Files changed (50) hide show
  1. package/README.md +47 -7
  2. package/dist/artifacts.js +9 -0
  3. package/dist/executors/git-commit-executor.js +24 -6
  4. package/dist/flow-state.js +3 -8
  5. package/dist/git/git-diff-parser.js +223 -0
  6. package/dist/git/git-service.js +562 -0
  7. package/dist/git/git-stage-selection.js +24 -0
  8. package/dist/git/git-status-parser.js +171 -0
  9. package/dist/git/git-types.js +1 -0
  10. package/dist/index.js +450 -108
  11. package/dist/interactive/auto-flow.js +644 -0
  12. package/dist/interactive/controller.js +417 -9
  13. package/dist/interactive/progress.js +194 -1
  14. package/dist/interactive/state.js +25 -0
  15. package/dist/interactive/web/index.js +97 -12
  16. package/dist/interactive/web/protocol.js +216 -1
  17. package/dist/interactive/web/server.js +72 -14
  18. package/dist/interactive/web/static/app.js +1603 -49
  19. package/dist/interactive/web/static/index.html +76 -11
  20. package/dist/interactive/web/static/styles.css +1 -1
  21. package/dist/interactive/web/static/styles.input.css +901 -47
  22. package/dist/pipeline/auto-flow-blocks.js +307 -0
  23. package/dist/pipeline/auto-flow-config.js +273 -0
  24. package/dist/pipeline/auto-flow-identity.js +49 -0
  25. package/dist/pipeline/auto-flow-presets.js +52 -0
  26. package/dist/pipeline/auto-flow-resolver.js +830 -0
  27. package/dist/pipeline/auto-flow-types.js +17 -0
  28. package/dist/pipeline/context.js +1 -0
  29. package/dist/pipeline/declarative-flows.js +27 -1
  30. package/dist/pipeline/flow-specs/auto-common-guided.json +11 -0
  31. package/dist/pipeline/flow-specs/auto-golang.json +12 -1
  32. package/dist/pipeline/flow-specs/bugz/bug-analyze.json +54 -1
  33. package/dist/pipeline/flow-specs/gitlab/gitlab-diff-review.json +19 -1
  34. package/dist/pipeline/flow-specs/gitlab/gitlab-review.json +33 -1
  35. package/dist/pipeline/flow-specs/review/review-project.json +19 -1
  36. package/dist/pipeline/flow-specs/task-source/manual-jira-input.json +70 -0
  37. package/dist/pipeline/node-registry.js +9 -0
  38. package/dist/pipeline/nodes/codex-prompt-node.js +8 -1
  39. package/dist/pipeline/nodes/flow-run-node.js +5 -3
  40. package/dist/pipeline/nodes/git-status-node.js +2 -168
  41. package/dist/pipeline/nodes/manual-jira-task-input-node.js +146 -0
  42. package/dist/pipeline/nodes/opencode-prompt-node.js +8 -1
  43. package/dist/pipeline/nodes/plan-codex-node.js +8 -1
  44. package/dist/pipeline/spec-loader.js +14 -4
  45. package/dist/runtime/artifact-catalog.js +29 -5
  46. package/dist/runtime/settings.js +114 -0
  47. package/dist/scope.js +14 -4
  48. package/package.json +1 -1
  49. package/dist/pipeline/flow-specs/auto-common.json +0 -179
  50. package/dist/pipeline/flow-specs/auto-simple.json +0 -141
@@ -0,0 +1,171 @@
1
+ export function unquoteGitPath(s) {
2
+ if (s.length < 2 || s[0] !== '"' || s[s.length - 1] !== '"') {
3
+ return s;
4
+ }
5
+ const inner = s.slice(1, -1);
6
+ const decoder = new TextDecoder();
7
+ let result = "";
8
+ const byteBuf = [];
9
+ const flushBytes = () => {
10
+ if (byteBuf.length > 0) {
11
+ result += decoder.decode(new Uint8Array(byteBuf));
12
+ byteBuf.length = 0;
13
+ }
14
+ };
15
+ for (let i = 0; i < inner.length; i += 1) {
16
+ if (inner[i] === "\\" && i + 1 < inner.length) {
17
+ const next = inner[i + 1];
18
+ switch (next) {
19
+ case "\\":
20
+ flushBytes();
21
+ result += "\\";
22
+ i += 1;
23
+ break;
24
+ case '"':
25
+ flushBytes();
26
+ result += '"';
27
+ i += 1;
28
+ break;
29
+ case "a":
30
+ flushBytes();
31
+ result += "\x07";
32
+ i += 1;
33
+ break;
34
+ case "b":
35
+ flushBytes();
36
+ result += "\b";
37
+ i += 1;
38
+ break;
39
+ case "f":
40
+ flushBytes();
41
+ result += "\f";
42
+ i += 1;
43
+ break;
44
+ case "n":
45
+ flushBytes();
46
+ result += "\n";
47
+ i += 1;
48
+ break;
49
+ case "r":
50
+ flushBytes();
51
+ result += "\r";
52
+ i += 1;
53
+ break;
54
+ case "t":
55
+ flushBytes();
56
+ result += "\t";
57
+ i += 1;
58
+ break;
59
+ case "v":
60
+ flushBytes();
61
+ result += "\v";
62
+ i += 1;
63
+ break;
64
+ default:
65
+ if (next >= "0" && next <= "7") {
66
+ let octal = next;
67
+ let consumed = 0;
68
+ for (let j = 1; j <= 2 && i + 1 + j < inner.length; j += 1) {
69
+ const ch = inner[i + 1 + j];
70
+ if (ch !== undefined && ch >= "0" && ch <= "7") {
71
+ octal += ch;
72
+ consumed = j;
73
+ }
74
+ else {
75
+ break;
76
+ }
77
+ }
78
+ byteBuf.push(parseInt(octal, 8) & 0xff);
79
+ i += 1 + consumed;
80
+ }
81
+ else {
82
+ flushBytes();
83
+ result += inner[i];
84
+ }
85
+ }
86
+ }
87
+ else {
88
+ flushBytes();
89
+ result += inner[i];
90
+ }
91
+ }
92
+ flushBytes();
93
+ return result;
94
+ }
95
+ export function splitRename(raw) {
96
+ let inQuote = false;
97
+ for (let i = 0; i <= raw.length - 4; i += 1) {
98
+ if (raw[i] === "\\" && inQuote) {
99
+ i += 1;
100
+ continue;
101
+ }
102
+ if (raw[i] === '"') {
103
+ inQuote = !inQuote;
104
+ continue;
105
+ }
106
+ if (!inQuote && raw.slice(i, i + 4) === " -> ") {
107
+ return { original: raw.slice(0, i), file: raw.slice(i + 4) };
108
+ }
109
+ }
110
+ return null;
111
+ }
112
+ function classify(indexStatus, workTreeStatus) {
113
+ if (indexStatus === "U" || workTreeStatus === "U" || (indexStatus === "A" && workTreeStatus === "A") || (indexStatus === "D" && workTreeStatus === "D")) {
114
+ return "conflicted";
115
+ }
116
+ if (indexStatus === "A" || workTreeStatus === "A") {
117
+ return "added";
118
+ }
119
+ if (indexStatus === "D" || workTreeStatus === "D") {
120
+ return "deleted";
121
+ }
122
+ if (indexStatus === "R") {
123
+ return "renamed";
124
+ }
125
+ if (indexStatus === "?" && workTreeStatus === "?") {
126
+ return "untracked";
127
+ }
128
+ return "modified";
129
+ }
130
+ export function parsePorcelain(output) {
131
+ const lines = output.split(/\r?\n/);
132
+ const files = [];
133
+ for (const line of lines) {
134
+ if (!line.trim() || line.startsWith("## ")) {
135
+ continue;
136
+ }
137
+ const xy = line.slice(0, 2);
138
+ const rawFile = line.slice(3);
139
+ const indexStatus = xy[0] ?? " ";
140
+ const workTreeStatus = xy[1] ?? " ";
141
+ const staged = indexStatus !== " " && indexStatus !== "?";
142
+ const type = classify(indexStatus, workTreeStatus);
143
+ let file;
144
+ let originalFile;
145
+ if (indexStatus === "R" || indexStatus === "C") {
146
+ const parts = splitRename(rawFile);
147
+ if (parts) {
148
+ originalFile = unquoteGitPath(parts.original);
149
+ file = unquoteGitPath(parts.file);
150
+ }
151
+ else {
152
+ file = unquoteGitPath(rawFile);
153
+ }
154
+ }
155
+ else {
156
+ file = unquoteGitPath(rawFile);
157
+ }
158
+ files.push({
159
+ xy,
160
+ indexStatus,
161
+ workTreeStatus,
162
+ file,
163
+ ...(originalFile !== undefined ? { originalFile } : {}),
164
+ path: file,
165
+ ...(originalFile !== undefined ? { originalPath: originalFile } : {}),
166
+ staged,
167
+ type,
168
+ });
169
+ }
170
+ return files;
171
+ }
@@ -0,0 +1 @@
1
+ export {};