@optima-chat/optima-agent 0.1.24 → 0.1.26

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.
@@ -3,7 +3,7 @@ import { parseArgs } from "node:util";
3
3
  import { OptimaAgent } from "../src/index.js";
4
4
  import { startInteractiveMode } from "../src/ui/index.js";
5
5
  import { startServer } from "../src/server/index.js";
6
- const VERSION = "0.1.24";
6
+ const VERSION = "0.1.26";
7
7
  function printHelp() {
8
8
  console.log(`
9
9
  Optima Agent - 电商运营 AI 助手
@@ -3,7 +3,7 @@ import { useState, useCallback, useRef } from "react";
3
3
  import { Box, useApp, useInput } from "ink";
4
4
  import { Header, Composer, MessageList, StatusBar, Spinner, } from "./components/index.js";
5
5
  import { OptimaAgent } from "../agent.js";
6
- const VERSION = "0.1.24";
6
+ const VERSION = "0.1.25";
7
7
  export function App({ cwd }) {
8
8
  const { exit } = useApp();
9
9
  const [input, setInput] = useState("");
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import { MessageItem } from "./Message.js";
3
3
  interface MessageListProps {
4
4
  messages: MessageItem[];
5
+ maxVisible?: number;
5
6
  }
6
7
  export declare const MessageList: React.NamedExoticComponent<MessageListProps>;
7
8
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAW,WAAW,EAAE,MAAM,cAAc,CAAC;AAEpD,UAAU,gBAAgB;IACxB,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB;AAED,eAAO,MAAM,WAAW,8CAQtB,CAAC"}
1
+ {"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAW,WAAW,EAAE,MAAM,cAAc,CAAC;AAEpD,UAAU,gBAAgB;IACxB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,WAAW,8CA6BtB,CAAC"}
@@ -1,8 +1,18 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { memo } from "react";
3
- import { Box } from "ink";
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { memo, useMemo } from "react";
3
+ import { Box, Text } from "ink";
4
4
  import { Message } from "./Message.js";
5
- export const MessageList = memo(function MessageList({ messages }) {
6
- return (_jsx(Box, { flexDirection: "column", flexGrow: 1, children: messages.map((msg, index) => (_jsx(Message, { message: msg }, index))) }));
5
+ export const MessageList = memo(function MessageList({ messages, maxVisible = 10 }) {
6
+ // 只显示最近的消息,避免内容超出屏幕导致闪烁
7
+ const { visibleMessages, hiddenCount } = useMemo(() => {
8
+ if (messages.length <= maxVisible) {
9
+ return { visibleMessages: messages, hiddenCount: 0 };
10
+ }
11
+ return {
12
+ visibleMessages: messages.slice(-maxVisible),
13
+ hiddenCount: messages.length - maxVisible,
14
+ };
15
+ }, [messages, maxVisible]);
16
+ return (_jsxs(Box, { flexDirection: "column", flexGrow: 1, children: [hiddenCount > 0 && (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { color: "gray", italic: true, children: ["... ", hiddenCount, " \u6761\u5386\u53F2\u6D88\u606F\u5DF2\u9690\u85CF (\u4F7F\u7528 /clear \u6E05\u7A7A)"] }) })), visibleMessages.map((msg, index) => (_jsx(Message, { message: msg }, messages.length - maxVisible + index)))] }));
7
17
  });
8
18
  //# sourceMappingURL=MessageList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MessageList.js","sourceRoot":"","sources":["../../../../src/ui/components/MessageList.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAA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,EAAC,QAAQ,EAAE,CAAC,aACpC,WAAW,GAAG,CAAC,IAAI,CAClB,KAAC,GAAG,IAAC,YAAY,EAAE,CAAC,YAClB,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,MAAM,2BAClB,WAAW,4FACX,GACH,CACP,EACA,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CACnC,KAAC,OAAO,IAA4C,OAAO,EAAE,GAAG,IAAlD,QAAQ,CAAC,MAAM,GAAG,UAAU,GAAG,KAAK,CAAkB,CACrE,CAAC,IACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare function startInteractiveMode(cwd?: string): void;
1
+ export { startStreamMode as startInteractiveMode } from "./stream.js";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/index.tsx"],"names":[],"mappings":"AAIA,wBAAgB,oBAAoB,CAAC,GAAG,CAAC,EAAE,MAAM,QAEhD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAC"}
@@ -1,7 +1,2 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render } from "ink";
3
- import { App } from "./App.js";
4
- export function startInteractiveMode(cwd) {
5
- render(_jsx(App, { cwd: cwd }));
6
- }
1
+ export { startStreamMode as startInteractiveMode } from "./stream.js";
7
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,MAAM,UAAU,oBAAoB,CAAC,GAAY;IAC/C,MAAM,CAAC,KAAC,GAAG,IAAC,GAAG,EAAE,GAAG,GAAI,CAAC,CAAC;AAC5B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function startStreamMode(cwd?: string): void;
2
+ //# sourceMappingURL=stream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../src/ui/stream.ts"],"names":[],"mappings":"AA2DA,wBAAgB,eAAe,CAAC,GAAG,CAAC,EAAE,MAAM,QA8G3C"}
@@ -0,0 +1,152 @@
1
+ import * as readline from "readline";
2
+ import { OptimaAgent } from "../agent.js";
3
+ const VERSION = "0.1.26";
4
+ // ANSI 颜色
5
+ const colors = {
6
+ reset: "\x1b[0m",
7
+ bold: "\x1b[1m",
8
+ dim: "\x1b[2m",
9
+ cyan: "\x1b[36m",
10
+ green: "\x1b[32m",
11
+ yellow: "\x1b[33m",
12
+ red: "\x1b[31m",
13
+ gray: "\x1b[90m",
14
+ };
15
+ function printHeader() {
16
+ console.log(`${colors.cyan}${colors.bold}Optima Agent${colors.reset} ${colors.gray}v${VERSION}${colors.reset}`);
17
+ console.log(`${colors.gray}输入消息开始对话,/help 查看帮助,Ctrl+C 退出${colors.reset}`);
18
+ console.log();
19
+ }
20
+ function printHelp() {
21
+ console.log(`${colors.cyan}可用命令:${colors.reset}`);
22
+ console.log(` /help - 显示帮助`);
23
+ console.log(` /clear - 清空对话历史`);
24
+ console.log(` /exit - 退出`);
25
+ console.log();
26
+ }
27
+ function printToolCall(name, input) {
28
+ const inputStr = typeof input === "string" ? input : JSON.stringify(input, null, 2);
29
+ console.log(`${colors.yellow}┌─ ${name}${colors.reset}`);
30
+ // 缩进每行
31
+ const lines = inputStr.split("\n");
32
+ for (const line of lines) {
33
+ console.log(`${colors.gray}│ ${line}${colors.reset}`);
34
+ }
35
+ console.log(`${colors.yellow}└─${colors.reset}`);
36
+ }
37
+ function printError(message) {
38
+ console.log(`${colors.red}错误: ${message}${colors.reset}`);
39
+ }
40
+ function printStatus(skills, tokens) {
41
+ const parts = [];
42
+ if (skills.length > 0) {
43
+ parts.push(`Skills: ${colors.cyan}${skills.join(", ")}${colors.reset}`);
44
+ }
45
+ if (tokens) {
46
+ parts.push(`Tokens: ${tokens.input.toLocaleString()} in / ${tokens.output.toLocaleString()} out`);
47
+ }
48
+ if (parts.length > 0) {
49
+ console.log(`${colors.gray}${parts.join(" | ")}${colors.reset}`);
50
+ }
51
+ }
52
+ export function startStreamMode(cwd) {
53
+ const agent = new OptimaAgent({ cwd });
54
+ let skills = [];
55
+ let totalTokens = { input: 0, output: 0 };
56
+ let isProcessing = false;
57
+ const rl = readline.createInterface({
58
+ input: process.stdin,
59
+ output: process.stdout,
60
+ });
61
+ printHeader();
62
+ const prompt = () => {
63
+ rl.question(`${colors.green}>${colors.reset} `, async (input) => {
64
+ const text = input.trim();
65
+ if (!text) {
66
+ prompt();
67
+ return;
68
+ }
69
+ // 处理斜杠命令
70
+ if (text.startsWith("/")) {
71
+ const cmd = text.toLowerCase();
72
+ if (cmd === "/help") {
73
+ printHelp();
74
+ prompt();
75
+ return;
76
+ }
77
+ if (cmd === "/clear") {
78
+ agent.reset();
79
+ skills = [];
80
+ totalTokens = { input: 0, output: 0 };
81
+ console.log(`${colors.gray}对话已清空${colors.reset}`);
82
+ console.log();
83
+ prompt();
84
+ return;
85
+ }
86
+ if (cmd === "/exit") {
87
+ rl.close();
88
+ process.exit(0);
89
+ }
90
+ }
91
+ // 处理消息
92
+ isProcessing = true;
93
+ let assistantContent = "";
94
+ try {
95
+ for await (const msg of agent.chat(text)) {
96
+ // 处理系统消息(获取 skills)
97
+ if (msg.type === "system" && "skills" in msg && msg.skills) {
98
+ skills = msg.skills.filter(Boolean);
99
+ }
100
+ // 处理助手消息
101
+ if (msg.type === "assistant" && msg.message?.content) {
102
+ for (const block of msg.message.content) {
103
+ if (block.type === "text") {
104
+ assistantContent += block.text;
105
+ }
106
+ else if (block.type === "tool_use") {
107
+ // 先输出之前积累的文本
108
+ if (assistantContent) {
109
+ console.log(assistantContent);
110
+ assistantContent = "";
111
+ }
112
+ // 显示工具调用
113
+ printToolCall(block.name, block.input);
114
+ }
115
+ }
116
+ }
117
+ // 处理结果(累计 tokens)
118
+ if (msg.type === "result") {
119
+ const usage = msg.usage;
120
+ totalTokens.input += usage?.input_tokens ?? 0;
121
+ totalTokens.output += usage?.output_tokens ?? 0;
122
+ }
123
+ }
124
+ // 输出剩余的助手内容
125
+ if (assistantContent) {
126
+ console.log(assistantContent);
127
+ }
128
+ console.log();
129
+ printStatus(skills, totalTokens);
130
+ console.log();
131
+ }
132
+ catch (error) {
133
+ const errorMsg = error instanceof Error ? error.message : "未知错误";
134
+ if (!errorMsg.includes("aborted")) {
135
+ printError(errorMsg);
136
+ }
137
+ }
138
+ finally {
139
+ isProcessing = false;
140
+ prompt();
141
+ }
142
+ });
143
+ };
144
+ // 处理 Ctrl+C
145
+ rl.on("close", () => {
146
+ console.log();
147
+ process.exit(0);
148
+ });
149
+ // 开始提示
150
+ prompt();
151
+ }
152
+ //# sourceMappingURL=stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream.js","sourceRoot":"","sources":["../../../src/ui/stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,OAAO,GAAG,QAAQ,CAAC;AAEzB,UAAU;AACV,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,GAAG,EAAE,UAAU;IACf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a,IAAI,CAAC,CAAC;oBAClD,CAAC;gBACH,CAAC;gBAED,YAAY;gBACZ,IAAI,gBAAgB,EAAE,CAAC;oBACrB,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;gBAChC,CAAC;gBAED,OAAO,CAAC,GAAG,EAAE,CAAC;gBACd,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;gBACjC,OAAO,CAAC,GAAG,EAAE,CAAC;YAEhB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,QAAQ,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;gBACjE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;oBAClC,UAAU,CAAC,QAAQ,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC;oBAAS,CAAC;gBACT,YAAY,GAAG,KAAK,CAAC;gBACrB,MAAM,EAAE,CAAC;YACX,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,YAAY;IACZ,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;QAClB,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,OAAO;IACP,MAAM,EAAE,CAAC;AACX,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optima-chat/optima-agent",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "description": "基于 Claude Agent SDK 的电商运营 AI 助手",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",