@lace-cloud/chat-core 0.0.1-bootstrap.0 → 0.6.3-next.25704378412
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/LICENSE +19 -0
- package/README.md +75 -8
- package/dist/index.cjs +803 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +321 -0
- package/dist/index.d.ts +321 -0
- package/dist/index.mjs +764 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +33 -8
- package/index.js +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Proprietary — Lace Cloud Inc.
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lace Cloud Inc. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This source code and its compiled artifacts are proprietary to Lace
|
|
6
|
+
Cloud Inc. Use is permitted only as part of authorized Lace Cloud
|
|
7
|
+
products and services, under separate terms.
|
|
8
|
+
|
|
9
|
+
The following are NOT permitted without prior written permission
|
|
10
|
+
from Lace Cloud Inc.:
|
|
11
|
+
|
|
12
|
+
- Redistribution of source code or binaries
|
|
13
|
+
- Modification or derivative works
|
|
14
|
+
- Reverse-engineering beyond the legal minimum
|
|
15
|
+
- Hosting, embedding, or resale as a service
|
|
16
|
+
|
|
17
|
+
No warranties are made; use is at your own risk.
|
|
18
|
+
|
|
19
|
+
Subject to legal review.
|
package/README.md
CHANGED
|
@@ -1,11 +1,78 @@
|
|
|
1
|
-
# @lace-cloud/chat-core
|
|
1
|
+
# @lace-cloud/chat-core
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
IDE-agnostic chat machinery for Lace Cloud. The agentic loop, tool
|
|
4
|
+
registry, proactivity watcher, and history codec — all decoupled from
|
|
5
|
+
any particular IDE host.
|
|
6
6
|
|
|
7
|
-
**
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
**Zero `vscode` imports.** Editor adapters (VS Code, future JetBrains)
|
|
8
|
+
implement the `ChatHostAdapter` interface and pass an instance into
|
|
9
|
+
`AgentController`.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @lace-cloud/chat-core
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage (adapter implementer's perspective)
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import {
|
|
21
|
+
AgentController,
|
|
22
|
+
createToolRegistry,
|
|
23
|
+
ProactivityWatcher,
|
|
24
|
+
type ChatHostAdapter,
|
|
25
|
+
type WebviewTransport,
|
|
26
|
+
} from '@lace-cloud/chat-core';
|
|
27
|
+
|
|
28
|
+
// 1. Implement ChatHostAdapter for your IDE.
|
|
29
|
+
const adapter: ChatHostAdapter = {
|
|
30
|
+
selectModel: async (selector) => /* IDE's LM API */,
|
|
31
|
+
sendRequest: async (model, messages, tools, signal) => /* … */,
|
|
32
|
+
saveHistory: async (messages) => /* … */,
|
|
33
|
+
loadHistory: async () => /* … */,
|
|
34
|
+
getConfig: () => /* … */,
|
|
35
|
+
getWorkspaceName: () => /* … */,
|
|
36
|
+
log: (level, msg) => /* … */,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// 2. Implement WebviewTransport (postMessage shape).
|
|
40
|
+
const transport: WebviewTransport = {
|
|
41
|
+
postMessage: (msg) => webview.postMessage(msg),
|
|
42
|
+
onMessage: (handler) => webview.onDidReceiveMessage(handler),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// 3. Wire up the agentic loop.
|
|
46
|
+
const registry = createToolRegistry();
|
|
47
|
+
registry.register(/* your IDE-specific tools */);
|
|
48
|
+
|
|
49
|
+
const agent = new AgentController({
|
|
50
|
+
adapter,
|
|
51
|
+
transport,
|
|
52
|
+
toolRegistry: registry,
|
|
53
|
+
buildSystemPrompt: /* … */,
|
|
54
|
+
getCanvasView: () => latestView,
|
|
55
|
+
historyKey: 'lace.chatHistory',
|
|
56
|
+
});
|
|
57
|
+
await agent.init();
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Proactivity
|
|
61
|
+
|
|
62
|
+
Pure rule matchers. Adapter wires concrete IDE events to abstract
|
|
63
|
+
trigger types:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
import { ProactivityWatcher, defaultRules } from '@lace-cloud/chat-core';
|
|
67
|
+
|
|
68
|
+
const watcher = new ProactivityWatcher({
|
|
69
|
+
rules: defaultRules,
|
|
70
|
+
transport: laceTransport, // from @lace-cloud/host
|
|
71
|
+
onSuggestion: (text) => agent.injectSuggestion(text),
|
|
72
|
+
});
|
|
73
|
+
watcher.mount();
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
|
|
78
|
+
Proprietary — see [LICENSE](https://github.com/lace-cloud/lace/blob/main/LICENSE).
|