@secemp/elwood 0.1.0 → 0.1.2
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/README.md +7 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# elwood
|
|
2
|
+
<img width="1448" height="1086" alt="image" src="https://github.com/user-attachments/assets/5e200c1b-aad5-4354-b968-2edbe6055b0d" />
|
|
2
3
|
|
|
3
4
|
Programmatically import and instrument the locally installed Claude Code CLI via Babel AST. Drop-in replacement for `@anthropic-ai/claude-agent-sdk` that runs **in-process** -- zero subprocess spawning.
|
|
4
5
|
|
|
@@ -17,7 +18,7 @@ This gives you the same API as `@anthropic-ai/claude-agent-sdk` with lower laten
|
|
|
17
18
|
## Install
|
|
18
19
|
|
|
19
20
|
```bash
|
|
20
|
-
npm install elwood
|
|
21
|
+
npm install @secemp/elwood
|
|
21
22
|
```
|
|
22
23
|
|
|
23
24
|
Requires Claude Code to be installed:
|
|
@@ -28,7 +29,7 @@ npm install -g @anthropic-ai/claude-code
|
|
|
28
29
|
## Quick start
|
|
29
30
|
|
|
30
31
|
```js
|
|
31
|
-
import { query } from 'elwood';
|
|
32
|
+
import { query } from '@secemp/elwood';
|
|
32
33
|
|
|
33
34
|
for await (const message of query({
|
|
34
35
|
prompt: 'What files are in this directory?',
|
|
@@ -74,7 +75,7 @@ conversation.close(); // cleanup
|
|
|
74
75
|
### tool(name, description, schema, handler)
|
|
75
76
|
|
|
76
77
|
```js
|
|
77
|
-
import { tool, createSdkMcpServer, query } from 'elwood';
|
|
78
|
+
import { tool, createSdkMcpServer, query } from '@secemp/elwood';
|
|
78
79
|
|
|
79
80
|
const weather = tool('get_weather', 'Get weather',
|
|
80
81
|
{ type: 'object', properties: { city: { type: 'string' } } },
|
|
@@ -92,7 +93,7 @@ for await (const msg of query({
|
|
|
92
93
|
### Session utilities
|
|
93
94
|
|
|
94
95
|
```js
|
|
95
|
-
import { listSessions, getSessionMessages, getSessionInfo } from 'elwood';
|
|
96
|
+
import { listSessions, getSessionMessages, getSessionInfo } from '@secemp/elwood';
|
|
96
97
|
|
|
97
98
|
const sessions = await listSessions();
|
|
98
99
|
const messages = await getSessionMessages(sessions[0].id);
|
|
@@ -101,7 +102,7 @@ const messages = await getSessionMessages(sessions[0].id);
|
|
|
101
102
|
### V2 Session API
|
|
102
103
|
|
|
103
104
|
```js
|
|
104
|
-
import { unstable_v2_createSession, unstable_v2_prompt } from 'elwood';
|
|
105
|
+
import { unstable_v2_createSession, unstable_v2_prompt } from '@secemp/elwood';
|
|
105
106
|
|
|
106
107
|
const result = await unstable_v2_prompt('Explain recursion');
|
|
107
108
|
```
|
|
@@ -109,7 +110,7 @@ const result = await unstable_v2_prompt('Explain recursion');
|
|
|
109
110
|
### Low-level AST access
|
|
110
111
|
|
|
111
112
|
```js
|
|
112
|
-
import { locate, load, instrument, parseBundle } from 'elwood';
|
|
113
|
+
import { locate, load, instrument, parseBundle } from '@secemp/elwood';
|
|
113
114
|
|
|
114
115
|
const { cliPath, version } = await locate();
|
|
115
116
|
const ast = parseBundle(cliPath);
|