@hasna/oldpal 0.1.1 → 0.1.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/dist/index.js CHANGED
@@ -20591,17 +20591,17 @@ class AnthropicClient {
20591
20591
  }));
20592
20592
  }
20593
20593
  getDefaultSystemPrompt() {
20594
- return `You are Oldpal, a helpful personal AI assistant running in the terminal.
20594
+ return `You are a helpful personal AI assistant running in the terminal.
20595
20595
 
20596
- You have access to various tools and connectors to help the user with their tasks:
20597
- - Connectors for services like Notion, Google Drive, Gmail, Calendar, Linear, Slack
20596
+ You have access to various tools and connectors:
20597
+ - Connectors for Notion, Google Drive, Gmail, Calendar, Linear, Slack
20598
20598
  - Filesystem operations (read, write, search files)
20599
20599
  - Shell command execution
20600
20600
 
20601
20601
  Guidelines:
20602
- - Be concise and direct in your responses
20602
+ - Be concise and direct
20603
+ - Don't introduce yourself or say your name
20603
20604
  - Use tools proactively to accomplish tasks
20604
- - When using connectors, explain what you're doing
20605
20605
  - Format output nicely for the terminal (use markdown)
20606
20606
  - If a task requires multiple steps, break it down clearly
20607
20607
 
@@ -87231,20 +87231,13 @@ function Messages4({ messages, currentResponse }) {
87231
87231
  }, message.id, false, undefined, this)),
87232
87232
  currentResponse && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
87233
87233
  marginY: 1,
87234
- flexDirection: "column",
87235
87234
  children: [
87236
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
87237
- children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
87238
- color: "magenta",
87239
- bold: true,
87240
- children: [
87241
- "assistant:",
87242
- " "
87243
- ]
87244
- }, undefined, true, undefined, this)
87235
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
87236
+ color: "white",
87237
+ children: "\u25CF "
87245
87238
  }, undefined, false, undefined, this),
87246
87239
  /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
87247
- marginLeft: 2,
87240
+ flexGrow: 1,
87248
87241
  children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Markdown, {
87249
87242
  content: currentResponse
87250
87243
  }, undefined, false, undefined, this)
@@ -87258,38 +87251,34 @@ function MessageBubble({ message }) {
87258
87251
  const isUser = message.role === "user";
87259
87252
  const isSystem = message.role === "system";
87260
87253
  if (isSystem) {
87254
+ return null;
87255
+ }
87256
+ if (isUser) {
87261
87257
  return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
87262
87258
  marginY: 1,
87263
- children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
87264
- color: "gray",
87265
- dimColor: true,
87266
- children: [
87267
- "[system] ",
87268
- message.content
87269
- ]
87270
- }, undefined, true, undefined, this)
87271
- }, undefined, false, undefined, this);
87259
+ children: [
87260
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
87261
+ color: "gray",
87262
+ children: "\u276F "
87263
+ }, undefined, false, undefined, this),
87264
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
87265
+ color: "white",
87266
+ backgroundColor: "gray",
87267
+ children: message.content
87268
+ }, undefined, false, undefined, this)
87269
+ ]
87270
+ }, undefined, true, undefined, this);
87272
87271
  }
87273
87272
  return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
87274
87273
  marginY: 1,
87275
- flexDirection: "column",
87276
87274
  children: [
87277
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
87278
- children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
87279
- color: isUser ? "blue" : "magenta",
87280
- bold: true,
87281
- children: [
87282
- isUser ? "you" : "assistant",
87283
- ":",
87284
- " "
87285
- ]
87286
- }, undefined, true, undefined, this)
87275
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
87276
+ color: "white",
87277
+ children: "\u25CF "
87287
87278
  }, undefined, false, undefined, this),
87288
87279
  /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
87289
- marginLeft: 2,
87290
- children: isUser ? /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
87291
- children: message.content
87292
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Markdown, {
87280
+ flexGrow: 1,
87281
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Markdown, {
87293
87282
  content: message.content
87294
87283
  }, undefined, false, undefined, this)
87295
87284
  }, undefined, false, undefined, this)
@@ -87398,13 +87387,15 @@ function App2({ cwd: cwd2 }) {
87398
87387
  const [isInitializing, setIsInitializing] = import_react25.useState(true);
87399
87388
  const [error, setError] = import_react25.useState(null);
87400
87389
  const [toolStatus, setToolStatus] = import_react25.useState(null);
87390
+ const responseRef = import_react25.useRef("");
87401
87391
  import_react25.useEffect(() => {
87402
87392
  const initClient = async () => {
87403
87393
  try {
87404
87394
  const newClient = new EmbeddedClient(cwd2);
87405
87395
  newClient.onChunk((chunk) => {
87406
87396
  if (chunk.type === "text" && chunk.content) {
87407
- setCurrentResponse((prev) => prev + chunk.content);
87397
+ responseRef.current += chunk.content;
87398
+ setCurrentResponse(responseRef.current);
87408
87399
  } else if (chunk.type === "tool_use" && chunk.toolCall) {
87409
87400
  setToolStatus(`Running: ${chunk.toolCall.name}`);
87410
87401
  } else if (chunk.type === "tool_result") {
@@ -87413,6 +87404,19 @@ function App2({ cwd: cwd2 }) {
87413
87404
  setError(chunk.error);
87414
87405
  setIsProcessing(false);
87415
87406
  } else if (chunk.type === "done") {
87407
+ if (responseRef.current) {
87408
+ setMessages((prev) => [
87409
+ ...prev,
87410
+ {
87411
+ id: generateId(),
87412
+ role: "assistant",
87413
+ content: responseRef.current,
87414
+ timestamp: now()
87415
+ }
87416
+ ]);
87417
+ setCurrentResponse("");
87418
+ responseRef.current = "";
87419
+ }
87416
87420
  setIsProcessing(false);
87417
87421
  }
87418
87422
  });
@@ -87452,49 +87456,18 @@ function App2({ cwd: cwd2 }) {
87452
87456
  };
87453
87457
  setMessages((prev) => [...prev, userMessage]);
87454
87458
  setCurrentResponse("");
87459
+ responseRef.current = "";
87455
87460
  setError(null);
87456
87461
  setIsProcessing(true);
87457
87462
  await client.send(trimmedInput);
87458
- setMessages((prev) => {
87459
- const assistantMessage = {
87460
- id: generateId(),
87461
- role: "assistant",
87462
- content: currentResponse,
87463
- timestamp: now()
87464
- };
87465
- return [...prev, assistantMessage];
87466
- });
87467
- }, [client, isProcessing, currentResponse]);
87468
- import_react25.useEffect(() => {
87469
- if (!isProcessing && currentResponse) {
87470
- setMessages((prev) => {
87471
- const last = prev[prev.length - 1];
87472
- if (last?.role === "assistant") {
87473
- return [
87474
- ...prev.slice(0, -1),
87475
- { ...last, content: currentResponse }
87476
- ];
87477
- }
87478
- return [
87479
- ...prev,
87480
- {
87481
- id: generateId(),
87482
- role: "assistant",
87483
- content: currentResponse,
87484
- timestamp: now()
87485
- }
87486
- ];
87487
- });
87488
- setCurrentResponse("");
87489
- }
87490
- }, [isProcessing, currentResponse]);
87463
+ }, [client, isProcessing]);
87491
87464
  if (isInitializing) {
87492
87465
  return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
87493
87466
  flexDirection: "column",
87494
87467
  padding: 1,
87495
87468
  children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
87496
87469
  children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Spinner2, {
87497
- label: "Initializing oldpal..."
87470
+ label: "Initializing..."
87498
87471
  }, undefined, false, undefined, this)
87499
87472
  }, undefined, false, undefined, this)
87500
87473
  }, undefined, false, undefined, this);
@@ -87503,23 +87476,9 @@ function App2({ cwd: cwd2 }) {
87503
87476
  flexDirection: "column",
87504
87477
  padding: 1,
87505
87478
  children: [
87506
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
87507
- marginBottom: 1,
87508
- children: [
87509
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
87510
- bold: true,
87511
- color: "cyan",
87512
- children: "oldpal"
87513
- }, undefined, false, undefined, this),
87514
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
87515
- color: "gray",
87516
- children: " - Your personal AI assistant"
87517
- }, undefined, false, undefined, this)
87518
- ]
87519
- }, undefined, true, undefined, this),
87520
87479
  /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Messages4, {
87521
87480
  messages,
87522
- currentResponse
87481
+ currentResponse: isProcessing ? currentResponse : undefined
87523
87482
  }, undefined, false, undefined, this),
87524
87483
  toolStatus && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
87525
87484
  marginY: 1,
@@ -87537,7 +87496,7 @@ function App2({ cwd: cwd2 }) {
87537
87496
  ]
87538
87497
  }, undefined, true, undefined, this)
87539
87498
  }, undefined, false, undefined, this),
87540
- isProcessing && !toolStatus && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
87499
+ isProcessing && !toolStatus && !currentResponse && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
87541
87500
  marginY: 1,
87542
87501
  children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Spinner2, {
87543
87502
  label: "Thinking..."
@@ -87595,4 +87554,4 @@ waitUntilExit().then(() => {
87595
87554
  process.exit(0);
87596
87555
  });
87597
87556
 
87598
- //# debugId=D4B20D698CC1E6E964756E2164756E21
87557
+ //# debugId=247F96E7A96FC18464756E2164756E21