@cereworker/cli 0.1.0
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/app.d.ts +7 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +95 -0
- package/dist/app.js.map +1 -0
- package/dist/components/ChatView.d.ts +10 -0
- package/dist/components/ChatView.d.ts.map +1 -0
- package/dist/components/ChatView.js +31 -0
- package/dist/components/ChatView.js.map +1 -0
- package/dist/components/InputBar.d.ts +8 -0
- package/dist/components/InputBar.d.ts.map +1 -0
- package/dist/components/InputBar.js +35 -0
- package/dist/components/InputBar.js.map +1 -0
- package/dist/components/StatusBar.d.ts +11 -0
- package/dist/components/StatusBar.d.ts.map +1 -0
- package/dist/components/StatusBar.js +6 -0
- package/dist/components/StatusBar.js.map +1 -0
- package/dist/hooks/useCerebellum.d.ts +6 -0
- package/dist/hooks/useCerebellum.d.ts.map +1 -0
- package/dist/hooks/useCerebellum.js +17 -0
- package/dist/hooks/useCerebellum.js.map +1 -0
- package/dist/hooks/useChat.d.ts +17 -0
- package/dist/hooks/useChat.d.ts.map +1 -0
- package/dist/hooks/useChat.js +56 -0
- package/dist/hooks/useChat.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/package.json +44 -0
package/dist/app.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAS3D,UAAU,QAAQ;IAChB,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED,wBAAgB,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,QAAQ,2CA+HvC"}
|
package/dist/app.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useCallback, useEffect, useState } from 'react';
|
|
3
|
+
import { Box, Text, useApp } from 'ink';
|
|
4
|
+
import { Orchestrator } from '@cereworker/core';
|
|
5
|
+
import { CerebrumProvider } from '@cereworker/cerebrum';
|
|
6
|
+
import { createChannelManager } from '@cereworker/channels';
|
|
7
|
+
import { browserToolDefinitions } from '@cereworker/browser';
|
|
8
|
+
import { StatusBar } from './components/StatusBar.js';
|
|
9
|
+
import { ChatView } from './components/ChatView.js';
|
|
10
|
+
import { InputBar } from './components/InputBar.js';
|
|
11
|
+
import { useChat } from './hooks/useChat.js';
|
|
12
|
+
import { useCerebellum } from './hooks/useCerebellum.js';
|
|
13
|
+
export function App({ config }) {
|
|
14
|
+
const { exit } = useApp();
|
|
15
|
+
const [channelCount, setChannelCount] = useState(0);
|
|
16
|
+
const { orchestrator, channelManager } = useMemo(() => {
|
|
17
|
+
const orch = new Orchestrator();
|
|
18
|
+
const cerebrumConfig = {
|
|
19
|
+
defaultProvider: config.cerebrum.defaultProvider,
|
|
20
|
+
defaultModel: config.cerebrum.defaultModel,
|
|
21
|
+
providers: config.cerebrum.providers,
|
|
22
|
+
maxSteps: config.cerebrum.maxSteps,
|
|
23
|
+
temperature: config.cerebrum.temperature,
|
|
24
|
+
};
|
|
25
|
+
const cerebrum = new CerebrumProvider(cerebrumConfig, {
|
|
26
|
+
denyList: config.tools.shell.denyList,
|
|
27
|
+
timeout: config.tools.shell.timeout,
|
|
28
|
+
maxOutputSize: config.tools.shell.maxOutputSize,
|
|
29
|
+
});
|
|
30
|
+
// Bridge CerebrumProvider to Orchestrator's CerebrumAdapter interface
|
|
31
|
+
orch.setCerebrum({
|
|
32
|
+
stream: async (messages, _tools, callbacks) => {
|
|
33
|
+
await cerebrum.stream(messages, callbacks);
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
// Register browser tools with orchestrator
|
|
37
|
+
for (const [name, toolDef] of Object.entries(browserToolDefinitions)) {
|
|
38
|
+
orch.registerTool(name, {
|
|
39
|
+
description: toolDef.description,
|
|
40
|
+
parameters: {},
|
|
41
|
+
execute: async (args) => toolDef.execute(args),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
// Create channel manager
|
|
45
|
+
const chMgr = createChannelManager(config);
|
|
46
|
+
// Wire channels to orchestrator
|
|
47
|
+
chMgr.setHandler(async (msg) => {
|
|
48
|
+
// Send inbound channel message through the orchestrator
|
|
49
|
+
// For now, return a placeholder - full integration would route through cerebrum
|
|
50
|
+
await orch.sendMessage(msg.text);
|
|
51
|
+
const messages = orch.getMessages();
|
|
52
|
+
const lastMsg = messages[messages.length - 1];
|
|
53
|
+
return lastMsg?.role === 'cerebrum' ? lastMsg.content : undefined;
|
|
54
|
+
});
|
|
55
|
+
orch.start();
|
|
56
|
+
return { orchestrator: orch, channelManager: chMgr };
|
|
57
|
+
}, [config]);
|
|
58
|
+
// Start channels in background
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
const channels = channelManager.list();
|
|
61
|
+
if (channels.length > 0) {
|
|
62
|
+
channelManager.startAll().then(() => {
|
|
63
|
+
setChannelCount(channelManager.listConnected().length);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return () => {
|
|
67
|
+
channelManager.stopAll();
|
|
68
|
+
};
|
|
69
|
+
}, [channelManager]);
|
|
70
|
+
const { messages, isStreaming, streamingContent, activeToolCall, error } = useChat(orchestrator);
|
|
71
|
+
const { status: cerebellumStatus } = useCerebellum(orchestrator);
|
|
72
|
+
const handleSubmit = useCallback((text) => {
|
|
73
|
+
orchestrator.sendMessage(text);
|
|
74
|
+
}, [orchestrator]);
|
|
75
|
+
const handleCommand = useCallback((command, args) => {
|
|
76
|
+
switch (command) {
|
|
77
|
+
case 'quit':
|
|
78
|
+
case 'exit':
|
|
79
|
+
orchestrator.stop();
|
|
80
|
+
channelManager.stopAll();
|
|
81
|
+
exit();
|
|
82
|
+
break;
|
|
83
|
+
case 'clear':
|
|
84
|
+
orchestrator.startConversation();
|
|
85
|
+
break;
|
|
86
|
+
case 'channels':
|
|
87
|
+
// Display connected channels
|
|
88
|
+
break;
|
|
89
|
+
default:
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
}, [orchestrator, channelManager, exit]);
|
|
93
|
+
return (_jsxs(Box, { flexDirection: "column", height: "100%", children: [_jsx(StatusBar, { provider: config.cerebrum.defaultProvider, model: config.cerebrum.defaultModel, cerebellumStatus: cerebellumStatus, isStreaming: isStreaming, channelCount: channelCount }), _jsx(ChatView, { messages: messages, streamingContent: streamingContent, isStreaming: isStreaming, activeToolCall: activeToolCall }), error && (_jsx(Box, { paddingX: 1, children: _jsxs(Text, { color: "red", children: ["Error: ", error] }) })), _jsx(InputBar, { onSubmit: handleSubmit, onCommand: handleCommand, disabled: isStreaming })] }));
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=app.js.map
|
package/dist/app.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,oBAAoB,EAAuB,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE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AC1B,EACF,KAAC,QAAQ,IACP,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,GAC9B,EACD,KAAK,IAAI,CACR,KAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,YACd,MAAC,IAAI,IAAC,KAAK,EAAC,KAAK,wBAAS,KAAK,IAAQ,GACnC,CACP,EACD,KAAC,QAAQ,IACP,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,aAAa,EACxB,QAAQ,EAAE,WAAW,GACrB,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Message } from '@cereworker/core';
|
|
2
|
+
interface ChatViewProps {
|
|
3
|
+
messages: Message[];
|
|
4
|
+
streamingContent: string;
|
|
5
|
+
isStreaming: boolean;
|
|
6
|
+
activeToolCall: string | null;
|
|
7
|
+
}
|
|
8
|
+
export declare function ChatView({ messages, streamingContent, isStreaming, activeToolCall }: ChatViewProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=ChatView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatView.d.ts","sourceRoot":"","sources":["../../src/components/ChatView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,UAAU,aAAa;IACrB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AA6CD,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAE,EAAE,aAAa,2CAwBlG"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
function MessageBlock({ message }) {
|
|
4
|
+
const roleColors = {
|
|
5
|
+
user: 'blue',
|
|
6
|
+
cerebrum: 'green',
|
|
7
|
+
tool: 'yellow',
|
|
8
|
+
system: 'gray',
|
|
9
|
+
cerebellum: 'magenta',
|
|
10
|
+
};
|
|
11
|
+
const roleLabels = {
|
|
12
|
+
user: 'You',
|
|
13
|
+
cerebrum: 'Cerebrum',
|
|
14
|
+
tool: 'Tool',
|
|
15
|
+
system: 'System',
|
|
16
|
+
cerebellum: 'Cerebellum',
|
|
17
|
+
};
|
|
18
|
+
const color = roleColors[message.role] ?? 'white';
|
|
19
|
+
const label = roleLabels[message.role] ?? message.role;
|
|
20
|
+
if (message.role === 'tool') {
|
|
21
|
+
const output = message.content.length > 500
|
|
22
|
+
? message.content.slice(0, 500) + '\n... (truncated)'
|
|
23
|
+
: message.content;
|
|
24
|
+
return (_jsxs(Box, { flexDirection: "column", marginLeft: 2, marginBottom: 1, children: [_jsxs(Text, { color: "yellow", dimColor: true, children: ["Tool: ", message.toolResult?.callId ?? 'unknown', message.toolResult?.isError ? ' (error)' : ''] }), _jsx(Text, { dimColor: true, children: output })] }));
|
|
25
|
+
}
|
|
26
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { bold: true, color: color, children: label }), _jsx(Text, { children: message.content })] }));
|
|
27
|
+
}
|
|
28
|
+
export function ChatView({ messages, streamingContent, isStreaming, activeToolCall }) {
|
|
29
|
+
return (_jsxs(Box, { flexDirection: "column", flexGrow: 1, paddingX: 1, children: [messages.map((msg) => (_jsx(MessageBlock, { message: msg }, msg.id))), activeToolCall && (_jsx(Box, { marginLeft: 2, children: _jsxs(Text, { color: "yellow", children: ["Running tool: ", activeToolCall, "..."] }) })), isStreaming && streamingContent && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { bold: true, color: "green", children: "Cerebrum" }), _jsxs(Text, { children: [streamingContent, _jsx(Text, { color: "green", children: "|" })] })] })), isStreaming && !streamingContent && !activeToolCall && (_jsx(Box, { children: _jsx(Text, { color: "gray", children: "Thinking..." }) }))] }));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=ChatView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatView.js","sourceRoot":"","sources":["../../src/components/ChatView.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAUhC,SAAS,YAAY,CAAC,EAAE,OAAO,EAAwB;IACrD,MAAM,UAAU,GAA2B;QACzC,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,SAAS;KACtB,CAAC;IAEF,MAAM,UAAU,GAA2B;QACzC,IAAI,EAAE,KAAK;QACX,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,YAAY;KACzB,CAAC;IAEF,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC;IAClD,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;IAEvD,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC5B,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG;YACzC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,mBAAmB;YACrD,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;QACpB,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,UAAU,EAAE,CAAC,EAAE,YAAY,EAAE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,IAAO,IACvD,CACP,EACA,WAAW,IAAI,CAAC,gBAAgB,IAAI,CAAC,cAAc,IAAI,CACtD,KAAC,GAAG,cACF,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,4BAAmB,GACjC,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface InputBarProps {
|
|
2
|
+
onSubmit: (text: string) => void;
|
|
3
|
+
onCommand: (command: string, args: string) => void;
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function InputBar({ onSubmit, onCommand, disabled }: InputBarProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=InputBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputBar.d.ts","sourceRoot":"","sources":["../../src/components/InputBar.tsx"],"names":[],"mappings":"AAGA,UAAU,aAAa;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,aAAa,2CAyCxE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Box, Text, useInput } from 'ink';
|
|
4
|
+
export function InputBar({ onSubmit, onCommand, disabled }) {
|
|
5
|
+
const [input, setInput] = useState('');
|
|
6
|
+
useInput((ch, key) => {
|
|
7
|
+
if (disabled)
|
|
8
|
+
return;
|
|
9
|
+
if (key.return) {
|
|
10
|
+
const trimmed = input.trim();
|
|
11
|
+
if (!trimmed)
|
|
12
|
+
return;
|
|
13
|
+
if (trimmed.startsWith('/')) {
|
|
14
|
+
const spaceIdx = trimmed.indexOf(' ');
|
|
15
|
+
const command = spaceIdx === -1 ? trimmed.slice(1) : trimmed.slice(1, spaceIdx);
|
|
16
|
+
const args = spaceIdx === -1 ? '' : trimmed.slice(spaceIdx + 1);
|
|
17
|
+
onCommand(command, args);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
onSubmit(trimmed);
|
|
21
|
+
}
|
|
22
|
+
setInput('');
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (key.backspace || key.delete) {
|
|
26
|
+
setInput((prev) => prev.slice(0, -1));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (ch && !key.ctrl && !key.meta) {
|
|
30
|
+
setInput((prev) => prev + ch);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return (_jsxs(Box, { borderStyle: "single", borderColor: disabled ? 'gray' : 'blue', paddingX: 1, children: [_jsx(Text, { color: disabled ? 'gray' : 'blue', bold: true, children: '> ' }), _jsx(Text, { children: input }), !disabled && _jsx(Text, { color: "blue", children: "|" })] }));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=InputBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputBar.js","sourceRoot":"","sources":["../../src/components/InputBar.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAQ1C,MAAM,UAAU,QAAQ,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAiB;IACvE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEvC,QAAQ,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE;QACnB,IAAI,QAAQ;YAAE,OAAO;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,EAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,aAC5E,KAAC,IAAI,IAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,kBAC1C,IAAI,GACA,EACP,KAAC,IAAI,cAAE,KAAK,GAAQ,EACnB,CAAC,QAAQ,IAAI,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,kBAAS,IACrC,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CerebellumStatus } from '@cereworker/core';
|
|
2
|
+
interface StatusBarProps {
|
|
3
|
+
provider: string;
|
|
4
|
+
model: string;
|
|
5
|
+
cerebellumStatus: CerebellumStatus | null;
|
|
6
|
+
isStreaming: boolean;
|
|
7
|
+
channelCount?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function StatusBar({ provider, model, cerebellumStatus, isStreaming, channelCount }: StatusBarProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=StatusBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusBar.d.ts","sourceRoot":"","sources":["../../src/components/StatusBar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,UAAU,cAAc;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC1C,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAgB,EAAE,EAAE,cAAc,2CAkB7G"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
export function StatusBar({ provider, model, cerebellumStatus, isStreaming, channelCount = 0 }) {
|
|
4
|
+
return (_jsxs(Box, { borderStyle: "single", borderColor: "gray", paddingX: 1, justifyContent: "space-between", children: [_jsxs(Box, { gap: 2, children: [_jsxs(Text, { color: "cyan", children: [provider, "/", model] }), _jsxs(Text, { color: cerebellumStatus?.healthy ? 'green' : 'yellow', children: ["Cerebellum: ", cerebellumStatus?.healthy ? 'connected' : 'offline', cerebellumStatus?.tasksRegistered ? ` (${cerebellumStatus.tasksRegistered} tasks)` : ''] }), channelCount > 0 && (_jsxs(Text, { color: "green", children: ["Channels: ", channelCount] }))] }), _jsx(Box, { children: isStreaming && _jsx(Text, { color: "yellow", children: "streaming..." }) })] }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=StatusBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusBar.js","sourceRoot":"","sources":["../../src/components/StatusBar.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAWhC,MAAM,UAAU,SAAS,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY,GAAG,CAAC,EAAkB;IAC5G,OAAO,CACL,MAAC,GAAG,IAAC,WAAW,EAAC,QAAQ,EAAC,WAAW,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC,EAAE,cAAc,EAAC,eAAe,aACtF,MAAC,GAAG,IAAC,GAAG,EAAE,CAAC,aACT,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,aAAE,QAAQ,OAAG,KAAK,IAAQ,EAC5C,MAAC,IAAI,IAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,6BAC5C,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAC/D,gBAAgB,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,gBAAgB,CAAC,eAAe,SAAS,CAAC,CAAC,CAAC,EAAE,IACnF,EACN,YAAY,GAAG,CAAC,IAAI,CACnB,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,2BAAY,YAAY,IAAQ,CACpD,IACG,EACN,KAAC,GAAG,cACD,WAAW,IAAI,KAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,6BAAoB,GACpD,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCerebellum.d.ts","sourceRoot":"","sources":["../../src/hooks/useCerebellum.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnF,wBAAgB,aAAa,CAAC,YAAY,EAAE,YAAY;;;EAuBvD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
export function useCerebellum(orchestrator) {
|
|
3
|
+
const [status, setStatus] = useState(null);
|
|
4
|
+
const [lastActions, setLastActions] = useState([]);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const unsubs = [];
|
|
7
|
+
unsubs.push(orchestrator.on('cerebellum:status', ({ status: s }) => {
|
|
8
|
+
setStatus(s);
|
|
9
|
+
}));
|
|
10
|
+
unsubs.push(orchestrator.on('heartbeat:tick', ({ actions }) => {
|
|
11
|
+
setLastActions(actions);
|
|
12
|
+
}));
|
|
13
|
+
return () => unsubs.forEach((u) => u());
|
|
14
|
+
}, [orchestrator]);
|
|
15
|
+
return { status, lastActions };
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=useCerebellum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCerebellum.js","sourceRoot":"","sources":["../../src/hooks/useCerebellum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,MAAM,UAAU,aAAa,CAAC,YAA0B;IACtD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAA0B,IAAI,CAAC,CAAC;IACpE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAe,EAAE,CAAC,CAAC;IAEjE,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,MAAM,GAAsB,EAAE,CAAC;QAErC,MAAM,CAAC,IAAI,CACT,YAAY,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE;YACrD,SAAS,CAAC,CAAC,CAAC,CAAC;QACf,CAAC,CAAC,CACH,CAAC;QAEF,MAAM,CAAC,IAAI,CACT,YAAY,CAAC,EAAE,CAAC,gBAAgB,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;YAChD,cAAc,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC,CAAC,CACH,CAAC;QAEF,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAC1C,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Orchestrator, Message } from '@cereworker/core';
|
|
2
|
+
export interface ChatState {
|
|
3
|
+
messages: Message[];
|
|
4
|
+
isStreaming: boolean;
|
|
5
|
+
streamingContent: string;
|
|
6
|
+
activeToolCall: string | null;
|
|
7
|
+
error: string | null;
|
|
8
|
+
}
|
|
9
|
+
export declare function useChat(orchestrator: Orchestrator): {
|
|
10
|
+
messages: Message[];
|
|
11
|
+
isStreaming: boolean;
|
|
12
|
+
streamingContent: string;
|
|
13
|
+
activeToolCall: string | null;
|
|
14
|
+
error: string | null;
|
|
15
|
+
sendMessage: (content: string) => Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useChat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChat.d.ts","sourceRoot":"","sources":["../../src/hooks/useChat.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE9D,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,wBAAgB,OAAO,CAAC,YAAY,EAAE,YAAY;;;;;;2BAyE9B,MAAM;EAQzB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
2
|
+
export function useChat(orchestrator) {
|
|
3
|
+
const [messages, setMessages] = useState([]);
|
|
4
|
+
const [isStreaming, setIsStreaming] = useState(false);
|
|
5
|
+
const [streamingContent, setStreamingContent] = useState('');
|
|
6
|
+
const [activeToolCall, setActiveToolCall] = useState(null);
|
|
7
|
+
const [error, setError] = useState(null);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const unsubs = [];
|
|
10
|
+
unsubs.push(orchestrator.on('message:user', ({ message }) => {
|
|
11
|
+
setMessages((prev) => [...prev, message]);
|
|
12
|
+
}));
|
|
13
|
+
unsubs.push(orchestrator.on('message:cerebrum:start', () => {
|
|
14
|
+
setIsStreaming(true);
|
|
15
|
+
setStreamingContent('');
|
|
16
|
+
setError(null);
|
|
17
|
+
}));
|
|
18
|
+
unsubs.push(orchestrator.on('message:cerebrum:chunk', ({ chunk }) => {
|
|
19
|
+
setStreamingContent((prev) => prev + chunk);
|
|
20
|
+
}));
|
|
21
|
+
unsubs.push(orchestrator.on('message:cerebrum:end', ({ message }) => {
|
|
22
|
+
setMessages((prev) => [...prev, message]);
|
|
23
|
+
setStreamingContent('');
|
|
24
|
+
setIsStreaming(false);
|
|
25
|
+
}));
|
|
26
|
+
unsubs.push(orchestrator.on('message:cerebrum:toolcall', ({ toolCall }) => {
|
|
27
|
+
setActiveToolCall(toolCall.name);
|
|
28
|
+
}));
|
|
29
|
+
unsubs.push(orchestrator.on('tool:end', ({ result }) => {
|
|
30
|
+
setActiveToolCall(null);
|
|
31
|
+
setMessages((prev) => [
|
|
32
|
+
...prev,
|
|
33
|
+
{
|
|
34
|
+
id: result.callId,
|
|
35
|
+
role: 'tool',
|
|
36
|
+
content: result.output,
|
|
37
|
+
toolResult: result,
|
|
38
|
+
timestamp: Date.now(),
|
|
39
|
+
},
|
|
40
|
+
]);
|
|
41
|
+
}));
|
|
42
|
+
unsubs.push(orchestrator.on('error', ({ error: err }) => {
|
|
43
|
+
setError(err.message);
|
|
44
|
+
setIsStreaming(false);
|
|
45
|
+
setStreamingContent('');
|
|
46
|
+
setActiveToolCall(null);
|
|
47
|
+
}));
|
|
48
|
+
return () => unsubs.forEach((u) => u());
|
|
49
|
+
}, [orchestrator]);
|
|
50
|
+
const sendMessage = useCallback(async (content) => {
|
|
51
|
+
setError(null);
|
|
52
|
+
await orchestrator.sendMessage(content);
|
|
53
|
+
}, [orchestrator]);
|
|
54
|
+
return { messages, isStreaming, streamingContent, activeToolCall, error, sendMessage };
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=useChat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChat.js","sourceRoot":"","sources":["../../src/hooks/useChat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAA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M,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAC1C,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,MAAM,WAAW,GAAG,WAAW,CAC7B,KAAK,EAAE,OAAe,EAAE,EAAE;QACxB,QAAQ,CAAC,IAAI,CAAC,CAAC;QACf,MAAM,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC,EACD,CAAC,YAAY,CAAC,CACf,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AACzF,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { render, Text, Box } from 'ink';
|
|
4
|
+
import { loadConfig } from '@cereworker/config';
|
|
5
|
+
import { App } from './app.js';
|
|
6
|
+
function main() {
|
|
7
|
+
try {
|
|
8
|
+
const config = loadConfig();
|
|
9
|
+
render(_jsx(App, { config: config }));
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
render(_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Text, { bold: true, color: "red", children: "Failed to start CereWorker" }), _jsx(Text, { color: "red", children: err instanceof Error ? err.message : String(err) }), _jsx(Text, { dimColor: true, children: "Check your config at ~/.cereworker/config.yaml" })] }));
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
main();
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;AAEA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,SAAS,IAAI;IACX,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;QAC5B,MAAM,CAAC,KAAC,GAAG,IAAC,MAAM,EAAE,MAAM,GAAI,CAAC,CAAC;IAClC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,CACJ,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,aACpC,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,KAAK,2CAAkC,EACxD,KAAC,IAAI,IAAC,KAAK,EAAC,KAAK,YAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAQ,EAC3E,KAAC,IAAI,IAAC,QAAQ,qEAAsD,IAChE,CACP,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cereworker/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"bin": {
|
|
6
|
+
"cereworker": "dist/index.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/Producible/CereWorker.git",
|
|
17
|
+
"directory": "apps/cli"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"ink": "^5.1.0",
|
|
21
|
+
"@inkjs/ui": "^2.0.0",
|
|
22
|
+
"react": "^18.3.1",
|
|
23
|
+
"@cereworker/core": "0.1.0",
|
|
24
|
+
"@cereworker/cerebrum": "0.1.0",
|
|
25
|
+
"@cereworker/cerebellum-client": "0.1.0",
|
|
26
|
+
"@cereworker/skills": "0.1.0",
|
|
27
|
+
"@cereworker/config": "0.1.0",
|
|
28
|
+
"@cereworker/channels": "0.1.0",
|
|
29
|
+
"@cereworker/browser": "0.1.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/react": "^18.3.0",
|
|
33
|
+
"tsx": "^4.19.0",
|
|
34
|
+
"typescript": "^5.7.3"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsc",
|
|
38
|
+
"dev": "tsx src/index.tsx",
|
|
39
|
+
"start": "node dist/index.js",
|
|
40
|
+
"typecheck": "tsc --noEmit",
|
|
41
|
+
"lint": "eslint src/",
|
|
42
|
+
"clean": "rm -rf dist"
|
|
43
|
+
}
|
|
44
|
+
}
|