@hasna/oldpal 0.1.2 → 0.1.4
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/index.js +37 -67
- package/dist/index.js.map +7 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -84539,14 +84539,14 @@ function Input({ onSubmit, disabled }) {
|
|
|
84539
84539
|
marginTop: 1,
|
|
84540
84540
|
children: [
|
|
84541
84541
|
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(Text, {
|
|
84542
|
-
|
|
84542
|
+
dimColor: disabled,
|
|
84543
84543
|
children: "\u276F "
|
|
84544
84544
|
}, undefined, false, undefined, this),
|
|
84545
84545
|
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(build_default, {
|
|
84546
84546
|
value,
|
|
84547
84547
|
onChange: setValue,
|
|
84548
84548
|
onSubmit: handleSubmit,
|
|
84549
|
-
placeholder: disabled ? "
|
|
84549
|
+
placeholder: disabled ? "" : "Type a message..."
|
|
84550
84550
|
}, undefined, false, undefined, this)
|
|
84551
84551
|
]
|
|
84552
84552
|
}, undefined, true, undefined, this);
|
|
@@ -87233,7 +87233,7 @@ function Messages4({ messages, currentResponse }) {
|
|
|
87233
87233
|
marginY: 1,
|
|
87234
87234
|
children: [
|
|
87235
87235
|
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
87236
|
-
|
|
87236
|
+
dimColor: true,
|
|
87237
87237
|
children: "\u25CF "
|
|
87238
87238
|
}, undefined, false, undefined, this),
|
|
87239
87239
|
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
|
|
@@ -87258,12 +87258,10 @@ function MessageBubble({ message }) {
|
|
|
87258
87258
|
marginY: 1,
|
|
87259
87259
|
children: [
|
|
87260
87260
|
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
87261
|
-
|
|
87261
|
+
dimColor: true,
|
|
87262
87262
|
children: "\u276F "
|
|
87263
87263
|
}, undefined, false, undefined, this),
|
|
87264
87264
|
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
87265
|
-
color: "white",
|
|
87266
|
-
backgroundColor: "gray",
|
|
87267
87265
|
children: message.content
|
|
87268
87266
|
}, undefined, false, undefined, this)
|
|
87269
87267
|
]
|
|
@@ -87273,7 +87271,7 @@ function MessageBubble({ message }) {
|
|
|
87273
87271
|
marginY: 1,
|
|
87274
87272
|
children: [
|
|
87275
87273
|
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
87276
|
-
|
|
87274
|
+
dimColor: true,
|
|
87277
87275
|
children: "\u25CF "
|
|
87278
87276
|
}, undefined, false, undefined, this),
|
|
87279
87277
|
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
|
|
@@ -87289,7 +87287,7 @@ function MessageBubble({ message }) {
|
|
|
87289
87287
|
// packages/terminal/src/components/Status.tsx
|
|
87290
87288
|
var jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
|
|
87291
87289
|
function Status({ isProcessing, cwd: cwd2 }) {
|
|
87292
|
-
const maxCwdLength =
|
|
87290
|
+
const maxCwdLength = 50;
|
|
87293
87291
|
const displayCwd = cwd2.length > maxCwdLength ? "..." + cwd2.slice(-(maxCwdLength - 3)) : cwd2;
|
|
87294
87292
|
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
|
|
87295
87293
|
marginTop: 1,
|
|
@@ -87298,32 +87296,20 @@ function Status({ isProcessing, cwd: cwd2 }) {
|
|
|
87298
87296
|
paddingX: 1,
|
|
87299
87297
|
justifyContent: "space-between",
|
|
87300
87298
|
children: [
|
|
87299
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
|
|
87300
|
+
dimColor: true,
|
|
87301
|
+
children: displayCwd
|
|
87302
|
+
}, undefined, false, undefined, this),
|
|
87301
87303
|
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
|
|
87302
87304
|
children: [
|
|
87303
87305
|
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
|
|
87304
|
-
|
|
87305
|
-
children: "cwd: "
|
|
87306
|
-
}, undefined, false, undefined, this),
|
|
87307
|
-
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
|
|
87308
|
-
color: "white",
|
|
87309
|
-
children: displayCwd
|
|
87310
|
-
}, undefined, false, undefined, this)
|
|
87311
|
-
]
|
|
87312
|
-
}, undefined, true, undefined, this),
|
|
87313
|
-
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Box_default, {
|
|
87314
|
-
children: [
|
|
87315
|
-
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
|
|
87316
|
-
color: isProcessing ? "yellow" : "green",
|
|
87306
|
+
dimColor: !isProcessing,
|
|
87317
87307
|
children: isProcessing ? "\u25CF processing" : "\u25CF ready"
|
|
87318
87308
|
}, undefined, false, undefined, this),
|
|
87319
87309
|
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
|
|
87320
|
-
|
|
87321
|
-
children: " | "
|
|
87322
|
-
}, undefined, false, undefined, this),
|
|
87323
|
-
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
|
|
87324
|
-
color: "gray",
|
|
87310
|
+
dimColor: true,
|
|
87325
87311
|
children: [
|
|
87326
|
-
"Ctrl+C to ",
|
|
87312
|
+
" | Ctrl+C to ",
|
|
87327
87313
|
isProcessing ? "stop" : "exit"
|
|
87328
87314
|
]
|
|
87329
87315
|
}, undefined, true, undefined, this)
|
|
@@ -87360,13 +87346,13 @@ function Spinner2({ label }) {
|
|
|
87360
87346
|
return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
|
|
87361
87347
|
children: [
|
|
87362
87348
|
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
|
|
87363
|
-
|
|
87349
|
+
dimColor: true,
|
|
87364
87350
|
children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(build_default2, {
|
|
87365
87351
|
type: "dots"
|
|
87366
87352
|
}, undefined, false, undefined, this)
|
|
87367
87353
|
}, undefined, false, undefined, this),
|
|
87368
87354
|
label && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
|
|
87369
|
-
|
|
87355
|
+
dimColor: true,
|
|
87370
87356
|
children: [
|
|
87371
87357
|
" ",
|
|
87372
87358
|
label
|
|
@@ -87387,13 +87373,15 @@ function App2({ cwd: cwd2 }) {
|
|
|
87387
87373
|
const [isInitializing, setIsInitializing] = import_react25.useState(true);
|
|
87388
87374
|
const [error, setError] = import_react25.useState(null);
|
|
87389
87375
|
const [toolStatus, setToolStatus] = import_react25.useState(null);
|
|
87376
|
+
const responseRef = import_react25.useRef("");
|
|
87390
87377
|
import_react25.useEffect(() => {
|
|
87391
87378
|
const initClient = async () => {
|
|
87392
87379
|
try {
|
|
87393
87380
|
const newClient = new EmbeddedClient(cwd2);
|
|
87394
87381
|
newClient.onChunk((chunk) => {
|
|
87395
87382
|
if (chunk.type === "text" && chunk.content) {
|
|
87396
|
-
|
|
87383
|
+
responseRef.current += chunk.content;
|
|
87384
|
+
setCurrentResponse(responseRef.current);
|
|
87397
87385
|
} else if (chunk.type === "tool_use" && chunk.toolCall) {
|
|
87398
87386
|
setToolStatus(`Running: ${chunk.toolCall.name}`);
|
|
87399
87387
|
} else if (chunk.type === "tool_result") {
|
|
@@ -87402,6 +87390,19 @@ function App2({ cwd: cwd2 }) {
|
|
|
87402
87390
|
setError(chunk.error);
|
|
87403
87391
|
setIsProcessing(false);
|
|
87404
87392
|
} else if (chunk.type === "done") {
|
|
87393
|
+
if (responseRef.current) {
|
|
87394
|
+
setMessages((prev) => [
|
|
87395
|
+
...prev,
|
|
87396
|
+
{
|
|
87397
|
+
id: generateId(),
|
|
87398
|
+
role: "assistant",
|
|
87399
|
+
content: responseRef.current,
|
|
87400
|
+
timestamp: now()
|
|
87401
|
+
}
|
|
87402
|
+
]);
|
|
87403
|
+
setCurrentResponse("");
|
|
87404
|
+
responseRef.current = "";
|
|
87405
|
+
}
|
|
87405
87406
|
setIsProcessing(false);
|
|
87406
87407
|
}
|
|
87407
87408
|
});
|
|
@@ -87441,49 +87442,18 @@ function App2({ cwd: cwd2 }) {
|
|
|
87441
87442
|
};
|
|
87442
87443
|
setMessages((prev) => [...prev, userMessage]);
|
|
87443
87444
|
setCurrentResponse("");
|
|
87445
|
+
responseRef.current = "";
|
|
87444
87446
|
setError(null);
|
|
87445
87447
|
setIsProcessing(true);
|
|
87446
87448
|
await client.send(trimmedInput);
|
|
87447
|
-
|
|
87448
|
-
const assistantMessage = {
|
|
87449
|
-
id: generateId(),
|
|
87450
|
-
role: "assistant",
|
|
87451
|
-
content: currentResponse,
|
|
87452
|
-
timestamp: now()
|
|
87453
|
-
};
|
|
87454
|
-
return [...prev, assistantMessage];
|
|
87455
|
-
});
|
|
87456
|
-
}, [client, isProcessing, currentResponse]);
|
|
87457
|
-
import_react25.useEffect(() => {
|
|
87458
|
-
if (!isProcessing && currentResponse) {
|
|
87459
|
-
setMessages((prev) => {
|
|
87460
|
-
const last = prev[prev.length - 1];
|
|
87461
|
-
if (last?.role === "assistant") {
|
|
87462
|
-
return [
|
|
87463
|
-
...prev.slice(0, -1),
|
|
87464
|
-
{ ...last, content: currentResponse }
|
|
87465
|
-
];
|
|
87466
|
-
}
|
|
87467
|
-
return [
|
|
87468
|
-
...prev,
|
|
87469
|
-
{
|
|
87470
|
-
id: generateId(),
|
|
87471
|
-
role: "assistant",
|
|
87472
|
-
content: currentResponse,
|
|
87473
|
-
timestamp: now()
|
|
87474
|
-
}
|
|
87475
|
-
];
|
|
87476
|
-
});
|
|
87477
|
-
setCurrentResponse("");
|
|
87478
|
-
}
|
|
87479
|
-
}, [isProcessing, currentResponse]);
|
|
87449
|
+
}, [client, isProcessing]);
|
|
87480
87450
|
if (isInitializing) {
|
|
87481
87451
|
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
|
|
87482
87452
|
flexDirection: "column",
|
|
87483
87453
|
padding: 1,
|
|
87484
87454
|
children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
|
|
87485
87455
|
children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Spinner2, {
|
|
87486
|
-
label: "Initializing
|
|
87456
|
+
label: "Initializing..."
|
|
87487
87457
|
}, undefined, false, undefined, this)
|
|
87488
87458
|
}, undefined, false, undefined, this)
|
|
87489
87459
|
}, undefined, false, undefined, this);
|
|
@@ -87494,7 +87464,7 @@ function App2({ cwd: cwd2 }) {
|
|
|
87494
87464
|
children: [
|
|
87495
87465
|
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Messages4, {
|
|
87496
87466
|
messages,
|
|
87497
|
-
currentResponse
|
|
87467
|
+
currentResponse: isProcessing ? currentResponse : undefined
|
|
87498
87468
|
}, undefined, false, undefined, this),
|
|
87499
87469
|
toolStatus && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
|
|
87500
87470
|
marginY: 1,
|
|
@@ -87512,7 +87482,7 @@ function App2({ cwd: cwd2 }) {
|
|
|
87512
87482
|
]
|
|
87513
87483
|
}, undefined, true, undefined, this)
|
|
87514
87484
|
}, undefined, false, undefined, this),
|
|
87515
|
-
isProcessing && !toolStatus && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
|
|
87485
|
+
isProcessing && !toolStatus && !currentResponse && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
|
|
87516
87486
|
marginY: 1,
|
|
87517
87487
|
children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Spinner2, {
|
|
87518
87488
|
label: "Thinking..."
|
|
@@ -87570,4 +87540,4 @@ waitUntilExit().then(() => {
|
|
|
87570
87540
|
process.exit(0);
|
|
87571
87541
|
});
|
|
87572
87542
|
|
|
87573
|
-
//# debugId=
|
|
87543
|
+
//# debugId=2B588D94A9B99F4964756E2164756E21
|