wayang-ai 0.6.0 → 0.6.2
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/cli.js +71 -41
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -819,37 +819,6 @@ function formatWorkerTag(ctx) {
|
|
|
819
819
|
|
|
820
820
|
// src/tui/components/chat-area/user-row.tsx
|
|
821
821
|
import { Box, Text } from "ink";
|
|
822
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
823
|
-
function UserRow({ item, width }) {
|
|
824
|
-
const dim = !item.read;
|
|
825
|
-
const text = item.content;
|
|
826
|
-
const padded = text.length < width ? text + " ".repeat(4) : text;
|
|
827
|
-
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
828
|
-
/* @__PURE__ */ jsxs(
|
|
829
|
-
Text,
|
|
830
|
-
{
|
|
831
|
-
backgroundColor: theme.user.bgHex,
|
|
832
|
-
color: theme.user.prefixColor,
|
|
833
|
-
bold: true,
|
|
834
|
-
children: [
|
|
835
|
-
theme.user.prefix,
|
|
836
|
-
" "
|
|
837
|
-
]
|
|
838
|
-
}
|
|
839
|
-
),
|
|
840
|
-
/* @__PURE__ */ jsx2(
|
|
841
|
-
Text,
|
|
842
|
-
{
|
|
843
|
-
backgroundColor: theme.user.bgHex,
|
|
844
|
-
color: dim ? theme.baseToken.color.textSubtle : theme.baseToken.color.textNormal,
|
|
845
|
-
children: padded
|
|
846
|
-
}
|
|
847
|
-
)
|
|
848
|
-
] });
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
// src/tui/components/chat-area/assistant-step-row.tsx
|
|
852
|
-
import { Box as Box2, Text as Text2 } from "ink";
|
|
853
822
|
|
|
854
823
|
// src/tui/utils/text-width.ts
|
|
855
824
|
function charWidth(cp) {
|
|
@@ -894,6 +863,43 @@ function shortId(id) {
|
|
|
894
863
|
return id.slice(-4);
|
|
895
864
|
}
|
|
896
865
|
|
|
866
|
+
// src/tui/components/chat-area/user-row.tsx
|
|
867
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
868
|
+
var PREFIX = `${theme.user.prefix} `;
|
|
869
|
+
var PREFIX_WIDTH = stringWidth(PREFIX);
|
|
870
|
+
function fillRow(line, width) {
|
|
871
|
+
const fill = width - stringWidth(line);
|
|
872
|
+
return fill > 0 ? line + " ".repeat(fill) : line;
|
|
873
|
+
}
|
|
874
|
+
function UserRow({ item, width }) {
|
|
875
|
+
const dim = !item.read;
|
|
876
|
+
const rowWidth = Math.max(0, width);
|
|
877
|
+
const textWidth = Math.max(0, rowWidth - PREFIX_WIDTH);
|
|
878
|
+
const body = item.content.split("\n").map((line) => stringWidth(line) <= textWidth ? fillRow(line, textWidth) : line).join("\n");
|
|
879
|
+
return /* @__PURE__ */ jsxs(Box, { width: rowWidth > 0 ? rowWidth : void 0, children: [
|
|
880
|
+
/* @__PURE__ */ jsx2(
|
|
881
|
+
Text,
|
|
882
|
+
{
|
|
883
|
+
backgroundColor: theme.user.bgHex,
|
|
884
|
+
color: theme.user.prefixColor,
|
|
885
|
+
bold: true,
|
|
886
|
+
children: PREFIX
|
|
887
|
+
}
|
|
888
|
+
),
|
|
889
|
+
/* @__PURE__ */ jsx2(
|
|
890
|
+
Text,
|
|
891
|
+
{
|
|
892
|
+
backgroundColor: theme.user.bgHex,
|
|
893
|
+
color: dim ? theme.baseToken.color.textSubtle : theme.baseToken.color.textNormal,
|
|
894
|
+
children: body
|
|
895
|
+
}
|
|
896
|
+
)
|
|
897
|
+
] });
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
// src/tui/components/chat-area/assistant-step-row.tsx
|
|
901
|
+
import { Box as Box2, Text as Text2 } from "ink";
|
|
902
|
+
|
|
897
903
|
// src/tui/utils/permission-summary.ts
|
|
898
904
|
function shortenPath(p, maxSegments = 3) {
|
|
899
905
|
const segs = p.split("/").filter((s) => s.length > 0);
|
|
@@ -1598,6 +1604,7 @@ function StreamingSpinner(props) {
|
|
|
1598
1604
|
|
|
1599
1605
|
// src/tui/components/chat-area/chat-area.tsx
|
|
1600
1606
|
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1607
|
+
var PENDING_INDENT = theme.secondary.indent;
|
|
1601
1608
|
function shouldShowGap(prev, _current) {
|
|
1602
1609
|
if (!prev) return false;
|
|
1603
1610
|
return true;
|
|
@@ -1621,13 +1628,24 @@ var ChatArea = React2.memo(function ChatArea2({ items, busy, streamingItems, con
|
|
|
1621
1628
|
},
|
|
1622
1629
|
item.id
|
|
1623
1630
|
) }, "chat"),
|
|
1624
|
-
/* @__PURE__ */ jsxs5(Box5, {
|
|
1625
|
-
/* @__PURE__ */
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
/* @__PURE__ */
|
|
1630
|
-
|
|
1631
|
+
/* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", children: [
|
|
1632
|
+
/* @__PURE__ */ jsxs5(Box5, { paddingX: 1, marginTop: items.length > 0 ? theme.spacing.blockGap : 0, children: [
|
|
1633
|
+
/* @__PURE__ */ jsx8(StreamingSpinner, { spinning: busy }),
|
|
1634
|
+
/* @__PURE__ */ jsx8(Box5, { flexDirection: "column", flexGrow: 1, children: streamingItems?.[0]?.content && /* @__PURE__ */ jsx8(Text6, { children: streamingItems[0].content }) })
|
|
1635
|
+
] }),
|
|
1636
|
+
dynamicItems.length > 0 && /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingX: 1, marginTop: theme.spacing.blockGap, marginBottom: 1, children: [
|
|
1637
|
+
/* @__PURE__ */ jsx8(Box5, { marginLeft: PENDING_INDENT, justifyContent: "flex-start", children: /* @__PURE__ */ jsx8(Text6, { color: theme.baseToken.color.textSubtle, dimColor: true, children: "\xB7\xB7\xB7 waiting for process \xB7\xB7\xB7" }) }),
|
|
1638
|
+
dynamicItems.map((item, idx) => /* @__PURE__ */ jsx8(
|
|
1639
|
+
Box5,
|
|
1640
|
+
{
|
|
1641
|
+
flexDirection: "column",
|
|
1642
|
+
marginLeft: PENDING_INDENT,
|
|
1643
|
+
marginTop: shouldShowGap(idx > 0 ? dynamicItems[idx - 1] : null, item) ? theme.spacing.blockGap : 0,
|
|
1644
|
+
children: /* @__PURE__ */ jsx8(ItemRow, { item, contentWidth: width - PENDING_INDENT, lookups })
|
|
1645
|
+
},
|
|
1646
|
+
item.id
|
|
1647
|
+
))
|
|
1648
|
+
] })
|
|
1631
1649
|
] })
|
|
1632
1650
|
] });
|
|
1633
1651
|
});
|
|
@@ -2374,7 +2392,7 @@ function ControllerPage({ onExit }) {
|
|
|
2374
2392
|
});
|
|
2375
2393
|
});
|
|
2376
2394
|
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
|
|
2377
|
-
/* @__PURE__ */ jsx13(Box10, { marginBottom: 1, children: /* @__PURE__ */ jsx13(
|
|
2395
|
+
/* @__PURE__ */ jsx13(Box10, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsx13(
|
|
2378
2396
|
ChatArea,
|
|
2379
2397
|
{
|
|
2380
2398
|
items: displayItems,
|
|
@@ -2430,7 +2448,7 @@ function AppContent() {
|
|
|
2430
2448
|
// package.json
|
|
2431
2449
|
var package_default = {
|
|
2432
2450
|
name: "wayang-ai",
|
|
2433
|
-
version: "0.6.
|
|
2451
|
+
version: "0.6.2",
|
|
2434
2452
|
description: "Multi-agent orchestration platform",
|
|
2435
2453
|
type: "module",
|
|
2436
2454
|
license: "MIT",
|
|
@@ -5493,6 +5511,11 @@ var ClaudeCodeWorker = class _ClaudeCodeWorker {
|
|
|
5493
5511
|
if (wirePermissions) {
|
|
5494
5512
|
options.canUseTool = (toolName, input) => this.handleCanUseTool(toolName, input);
|
|
5495
5513
|
}
|
|
5514
|
+
options.stderr = (data) => {
|
|
5515
|
+
const text = String(data).trimEnd();
|
|
5516
|
+
if (!text.trim()) return;
|
|
5517
|
+
this.logger.debug({ workerId: this.id }, `[claude stderr] ${text}`);
|
|
5518
|
+
};
|
|
5496
5519
|
const stream = query({
|
|
5497
5520
|
prompt: this.buildPromptIterable(task.description),
|
|
5498
5521
|
options
|
|
@@ -5502,6 +5525,7 @@ var ClaudeCodeWorker = class _ClaudeCodeWorker {
|
|
|
5502
5525
|
for await (const message of stream) {
|
|
5503
5526
|
if (this.abortController.signal.aborted) break;
|
|
5504
5527
|
this.processStreamMessage(message, onProgress);
|
|
5528
|
+
if (this._terminalResult) break;
|
|
5505
5529
|
}
|
|
5506
5530
|
} finally {
|
|
5507
5531
|
this._activeQuery = null;
|
|
@@ -5655,10 +5679,11 @@ ${leftoverText}` : `${buildThirdPartyPrompt(this.skills)}${initialPrompt}`;
|
|
|
5655
5679
|
done: false
|
|
5656
5680
|
};
|
|
5657
5681
|
}
|
|
5658
|
-
while (
|
|
5682
|
+
while (true) {
|
|
5659
5683
|
if (this.abortController.signal.aborted || this._terminalResult) {
|
|
5660
5684
|
return { value: void 0, done: true };
|
|
5661
5685
|
}
|
|
5686
|
+
if (this._messageQueue.length > 0) break;
|
|
5662
5687
|
await new Promise((resolve11) => {
|
|
5663
5688
|
this._messageResolve = resolve11;
|
|
5664
5689
|
});
|
|
@@ -5786,6 +5811,11 @@ controller: ${answer}`,
|
|
|
5786
5811
|
error: msg.errors.join("\n") || `Claude Code error: ${msg.subtype}`
|
|
5787
5812
|
};
|
|
5788
5813
|
}
|
|
5814
|
+
if (this._messageResolve) {
|
|
5815
|
+
const resolve11 = this._messageResolve;
|
|
5816
|
+
this._messageResolve = null;
|
|
5817
|
+
resolve11();
|
|
5818
|
+
}
|
|
5789
5819
|
const prev = this.state.get("runtimeState");
|
|
5790
5820
|
this.state.set("runtimeState", {
|
|
5791
5821
|
...prev,
|