@agentuity/claude-code 1.0.5 → 1.0.7

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.
@@ -34,33 +34,33 @@ Before running ANY command, detect the correct runtime:
34
34
 
35
35
  ### JavaScript/TypeScript (bun/npm/pnpm/yarn)
36
36
 
37
- | Task | bun | npm | pnpm |
38
- |------|-----|-----|------|
39
- | install | `bun install` | `npm install` | `pnpm install` |
40
- | build | `bun run build` | `npm run build` | `pnpm run build` |
41
- | test | `bun test` | `npm test` | `pnpm test` |
37
+ | Task | bun | npm | pnpm |
38
+ | --------- | ------------------- | ------------------- | -------------------- |
39
+ | install | `bun install` | `npm install` | `pnpm install` |
40
+ | build | `bun run build` | `npm run build` | `pnpm run build` |
41
+ | test | `bun test` | `npm test` | `pnpm test` |
42
42
  | typecheck | `bun run typecheck` | `npm run typecheck` | `pnpm run typecheck` |
43
- | lint | `bun run lint` | `npm run lint` | `pnpm run lint` |
44
- | format | `bun run format` | `npm run format` | `pnpm run format` |
45
- | clean | `bun run clean` | `npm run clean` | `pnpm run clean` |
43
+ | lint | `bun run lint` | `npm run lint` | `pnpm run lint` |
44
+ | format | `bun run format` | `npm run format` | `pnpm run format` |
45
+ | clean | `bun run clean` | `npm run clean` | `pnpm run clean` |
46
46
 
47
47
  ### Go
48
48
 
49
- | Task | Command |
50
- |------|---------|
51
- | build | `go build ./...` |
52
- | test | `go test ./...` |
53
- | lint | `golangci-lint run` |
54
- | format | `go fmt ./...` |
49
+ | Task | Command |
50
+ | ------ | ------------------- |
51
+ | build | `go build ./...` |
52
+ | test | `go test ./...` |
53
+ | lint | `golangci-lint run` |
54
+ | format | `go fmt ./...` |
55
55
 
56
56
  ### Rust (cargo)
57
57
 
58
- | Task | Command |
59
- |------|---------|
60
- | build | `cargo build` |
61
- | test | `cargo test` |
62
- | lint | `cargo clippy` |
63
- | format | `cargo fmt` |
58
+ | Task | Command |
59
+ | ------ | -------------- |
60
+ | build | `cargo build` |
61
+ | test | `cargo test` |
62
+ | lint | `cargo clippy` |
63
+ | format | `cargo fmt` |
64
64
 
65
65
  ## Output Parsing Intelligence
66
66
 
@@ -74,17 +74,18 @@ Before running ANY command, detect the correct runtime:
74
74
 
75
75
  ### Error Classification
76
76
 
77
- | Type | Signal Words |
78
- |------|-------------|
79
- | Type Error | "Type", "TS", "cannot assign", "not assignable" |
80
- | Syntax Error | "Unexpected", "SyntaxError", "Parse error" |
81
- | Lint Error | "eslint", "biome", "warning", "rule" |
82
- | Test Failure | "FAIL", "AssertionError", "expect", "assert" |
83
- | Build Error | "Build failed", "Cannot find module" |
77
+ | Type | Signal Words |
78
+ | ------------ | ----------------------------------------------- |
79
+ | Type Error | "Type", "TS", "cannot assign", "not assignable" |
80
+ | Syntax Error | "Unexpected", "SyntaxError", "Parse error" |
81
+ | Lint Error | "eslint", "biome", "warning", "rule" |
82
+ | Test Failure | "FAIL", "AssertionError", "expect", "assert" |
83
+ | Build Error | "Build failed", "Cannot find module" |
84
84
 
85
85
  ### Location Extraction
86
86
 
87
87
  Extract file:line from common formats:
88
+
88
89
  - TypeScript: `src/foo.ts(10,5): error TS2322`
89
90
  - ESLint: `src/foo.ts:10:5 error`
90
91
  - Go: `./pkg/foo.go:10:5:`
@@ -103,15 +104,15 @@ Extract file:line from common formats:
103
104
 
104
105
  ### Errors ([count])
105
106
 
106
- | File | Line | Type | Message |
107
- |------|------|------|---------|
108
- | `src/foo.ts` | 45 | Type | Type 'string' is not assignable to type 'number' |
107
+ | File | Line | Type | Message |
108
+ | ------------ | ---- | ---- | ------------------------------------------------ |
109
+ | `src/foo.ts` | 45 | Type | Type 'string' is not assignable to type 'number' |
109
110
 
110
111
  ### Warnings ([count])
111
112
 
112
- | File | Line | Message |
113
- |------|------|---------|
114
- | `src/baz.ts` | 8 | Unused import 'y' |
113
+ | File | Line | Message |
114
+ | ------------ | ---- | ----------------- |
115
+ | `src/baz.ts` | 8 | Unused import 'y' |
115
116
 
116
117
  ### Summary
117
118
 
@@ -10,16 +10,17 @@ Deep reference material for the Agentuity SDK frontend packages used to build we
10
10
 
11
11
  ## Package Overview
12
12
 
13
- | Package | Purpose |
14
- |---------|---------|
15
- | `@agentuity/react` | React hooks for calling agents (useAPI, useWebsocket) |
16
- | `@agentuity/frontend` | Framework-agnostic web utilities |
17
- | `@agentuity/auth` | Authentication (server + client) |
18
- | `@agentuity/workbench` | Dev UI for testing agents |
13
+ | Package | Purpose |
14
+ | ---------------------- | ----------------------------------------------------- |
15
+ | `@agentuity/react` | React hooks for calling agents (useAPI, useWebsocket) |
16
+ | `@agentuity/frontend` | Framework-agnostic web utilities |
17
+ | `@agentuity/auth` | Authentication (server + client) |
18
+ | `@agentuity/workbench` | Dev UI for testing agents |
19
19
 
20
20
  ## Reference URLs
21
21
 
22
22
  When uncertain, look up:
23
+
23
24
  - **SDK Source**: https://github.com/agentuity/sdk/tree/main/packages
24
25
  - **Docs**: https://agentuity.dev
25
26
  - **React Package**: https://github.com/agentuity/sdk/tree/main/packages/react/src
@@ -37,11 +38,11 @@ React hooks and components for Agentuity web applications.
37
38
  import { AgentuityProvider } from '@agentuity/react';
38
39
 
39
40
  function App() {
40
- return (
41
- <AgentuityProvider>
42
- <MyApp />
43
- </AgentuityProvider>
44
- );
41
+ return (
42
+ <AgentuityProvider>
43
+ <MyApp />
44
+ </AgentuityProvider>
45
+ );
45
46
  }
46
47
  ```
47
48
 
@@ -55,42 +56,43 @@ Call agents/routes from React components with automatic type inference.
55
56
  import { useAPI } from '@agentuity/react';
56
57
 
57
58
  function ChatComponent() {
58
- // For POST/mutation routes
59
- const { data, invoke, isLoading, isSuccess, isError, error, reset } = useAPI('POST /agent/chat');
60
-
61
- const handleSubmit = async (message: string) => {
62
- await invoke({ message });
63
- };
64
-
65
- return (
66
- <div>
67
- {isLoading && <p>Loading...</p>}
68
- {data && <p>Response: {data.reply}</p>}
69
- {error && <p>Error: {error.message}</p>}
70
- <button onClick={() => handleSubmit('Hello!')}>Send</button>
71
- </div>
72
- );
59
+ // For POST/mutation routes
60
+ const { data, invoke, isLoading, isSuccess, isError, error, reset } = useAPI('POST /agent/chat');
61
+
62
+ const handleSubmit = async (message: string) => {
63
+ await invoke({ message });
64
+ };
65
+
66
+ return (
67
+ <div>
68
+ {isLoading && <p>Loading...</p>}
69
+ {data && <p>Response: {data.reply}</p>}
70
+ {error && <p>Error: {error.message}</p>}
71
+ <button onClick={() => handleSubmit('Hello!')}>Send</button>
72
+ </div>
73
+ );
73
74
  }
74
75
 
75
76
  // For GET routes (auto-fetches on mount)
76
77
  function UserProfile() {
77
- const { data, isLoading, isFetching, refetch } = useAPI('GET /api/user');
78
- // data is fetched automatically on mount
79
- // isFetching is true during refetches
78
+ const { data, isLoading, isFetching, refetch } = useAPI('GET /api/user');
79
+ // data is fetched automatically on mount
80
+ // isFetching is true during refetches
80
81
  }
81
82
  ```
82
83
 
83
84
  **Options:**
85
+
84
86
  ```typescript
85
87
  const { data, invoke } = useAPI({
86
- route: 'POST /agent/my-agent',
87
- headers: { 'X-Custom': 'value' },
88
+ route: 'POST /agent/my-agent',
89
+ headers: { 'X-Custom': 'value' },
88
90
  });
89
91
 
90
92
  // Streaming support
91
93
  const { data, invoke } = useAPI('POST /agent/stream', {
92
- delimiter: '\n',
93
- onChunk: (chunk) => console.log('Received chunk:', chunk),
94
+ delimiter: '\n',
95
+ onChunk: (chunk) => console.log('Received chunk:', chunk),
94
96
  });
95
97
  ```
96
98
 
@@ -102,37 +104,40 @@ Real-time bidirectional communication.
102
104
  import { useWebsocket } from '@agentuity/react';
103
105
 
104
106
  function LiveChat() {
105
- const {
106
- isConnected,
107
- send,
108
- close,
109
- data, // Latest message
110
- messages, // All messages array
111
- clearMessages, // Clear message history
112
- error,
113
- readyState
114
- } = useWebsocket('/ws/chat');
115
-
116
- // Messages are accessed via data (latest) or messages (all)
117
- useEffect(() => {
118
- if (data) {
119
- console.log('Received:', data);
120
- }
121
- }, [data]);
122
-
123
- return (
124
- <div>
125
- <p>Status: {isConnected ? 'Connected' : 'Disconnected'}</p>
126
- <button onClick={() => send({ type: 'ping' })}>Ping</button>
127
- <ul>
128
- {messages.map((msg, i) => <li key={i}>{JSON.stringify(msg)}</li>)}
129
- </ul>
130
- </div>
131
- );
107
+ const {
108
+ isConnected,
109
+ send,
110
+ close,
111
+ data, // Latest message
112
+ messages, // All messages array
113
+ clearMessages, // Clear message history
114
+ error,
115
+ readyState,
116
+ } = useWebsocket('/ws/chat');
117
+
118
+ // Messages are accessed via data (latest) or messages (all)
119
+ useEffect(() => {
120
+ if (data) {
121
+ console.log('Received:', data);
122
+ }
123
+ }, [data]);
124
+
125
+ return (
126
+ <div>
127
+ <p>Status: {isConnected ? 'Connected' : 'Disconnected'}</p>
128
+ <button onClick={() => send({ type: 'ping' })}>Ping</button>
129
+ <ul>
130
+ {messages.map((msg, i) => (
131
+ <li key={i}>{JSON.stringify(msg)}</li>
132
+ ))}
133
+ </ul>
134
+ </div>
135
+ );
132
136
  }
133
137
  ```
134
138
 
135
139
  **Features:**
140
+
136
141
  - Auto-reconnection on connection loss
137
142
  - Message queuing when disconnected
138
143
  - Auth tokens auto-injected when AuthProvider is in tree
@@ -146,12 +151,12 @@ Access authentication state.
146
151
  import { useAuth } from '@agentuity/react';
147
152
 
148
153
  function UserProfile() {
149
- const { isAuthenticated, authLoading, authHeader } = useAuth();
154
+ const { isAuthenticated, authLoading, authHeader } = useAuth();
150
155
 
151
- if (authLoading) return <p>Loading...</p>;
152
- if (!isAuthenticated) return <p>Please sign in</p>;
156
+ if (authLoading) return <p>Loading...</p>;
157
+ if (!isAuthenticated) return <p>Please sign in</p>;
153
158
 
154
- return <p>Welcome back!</p>;
159
+ return <p>Welcome back!</p>;
155
160
  }
156
161
  ```
157
162
 
@@ -171,9 +176,9 @@ import { createRouter } from '@agentuity/runtime';
171
176
 
172
177
  // Create auth instance
173
178
  const auth = createAuth({
174
- connectionString: process.env.DATABASE_URL,
175
- // Optional: custom base path (default: /api/auth)
176
- basePath: '/api/auth',
179
+ connectionString: process.env.DATABASE_URL,
180
+ // Optional: custom base path (default: /api/auth)
181
+ basePath: '/api/auth',
177
182
  });
178
183
 
179
184
  const router = createRouter();
@@ -193,16 +198,16 @@ When using auth middleware, `ctx.auth` is available in agent handlers:
193
198
  import { createAgent } from '@agentuity/runtime';
194
199
 
195
200
  export default createAgent('protected-agent', {
196
- handler: async (ctx, input) => {
197
- // ctx.auth is null for unauthenticated requests
198
- if (!ctx.auth) {
199
- return { error: 'Please sign in' };
200
- }
201
-
202
- // Get authenticated user
203
- const user = await ctx.auth.getUser();
204
- return { message: `Hello ${user.name}` };
205
- },
201
+ handler: async (ctx, input) => {
202
+ // ctx.auth is null for unauthenticated requests
203
+ if (!ctx.auth) {
204
+ return { error: 'Please sign in' };
205
+ }
206
+
207
+ // Get authenticated user
208
+ const user = await ctx.auth.getUser();
209
+ return { message: `Hello ${user.name}` };
210
+ },
206
211
  });
207
212
  ```
208
213
 
@@ -212,13 +217,13 @@ export default createAgent('protected-agent', {
212
217
  import { AuthProvider } from '@agentuity/react';
213
218
 
214
219
  function App() {
215
- return (
216
- <AuthProvider>
217
- <AgentuityProvider>
218
- <MyApp />
219
- </AgentuityProvider>
220
- </AuthProvider>
221
- );
220
+ return (
221
+ <AuthProvider>
222
+ <AgentuityProvider>
223
+ <MyApp />
224
+ </AgentuityProvider>
225
+ </AuthProvider>
226
+ );
222
227
  }
223
228
  ```
224
229
 
@@ -232,7 +237,7 @@ import * as schema from './schema';
232
237
  const { db, close } = createPostgresDrizzle({ schema });
233
238
 
234
239
  const auth = createAuth({
235
- database: drizzleAdapter(db, { provider: 'pg' }),
240
+ database: drizzleAdapter(db, { provider: 'pg' }),
236
241
  });
237
242
  ```
238
243
 
@@ -287,35 +292,35 @@ src/
287
292
  import { AuthProvider, AgentuityProvider, useAPI, useAuth } from '@agentuity/react';
288
293
 
289
294
  function App() {
290
- return (
291
- <AuthProvider>
292
- <AgentuityProvider>
293
- <ProtectedChat />
294
- </AgentuityProvider>
295
- </AuthProvider>
296
- );
295
+ return (
296
+ <AuthProvider>
297
+ <AgentuityProvider>
298
+ <ProtectedChat />
299
+ </AgentuityProvider>
300
+ </AuthProvider>
301
+ );
297
302
  }
298
303
 
299
304
  function ProtectedChat() {
300
- const { isAuthenticated } = useAuth();
301
- const { data, invoke } = useAPI('POST /agent/chat');
305
+ const { isAuthenticated } = useAuth();
306
+ const { data, invoke } = useAPI('POST /agent/chat');
302
307
 
303
- if (!isAuthenticated) return <SignIn />;
308
+ if (!isAuthenticated) return <SignIn />;
304
309
 
305
- return (
306
- <div>
307
- <button onClick={() => invoke({ message: 'Hello' })}>Chat</button>
308
- {data && <p>{data.reply}</p>}
309
- </div>
310
- );
310
+ return (
311
+ <div>
312
+ <button onClick={() => invoke({ message: 'Hello' })}>Chat</button>
313
+ {data && <p>{data.reply}</p>}
314
+ </div>
315
+ );
311
316
  }
312
317
  ```
313
318
 
314
319
  ## Common Mistakes
315
320
 
316
- | Mistake | Better Approach | Why |
317
- |---------|-----------------|-----|
318
- | Adding `baseUrl` inside Agentuity project | Omit `baseUrl` | Auto-detected in full-stack projects |
319
- | Using `fetch` directly for agents | Use `useAPI` hook | Type inference, auth injection, loading states |
320
- | Manual WebSocket management | Use `useWebsocket` hook | Auto-reconnect, auth injection, message queuing |
321
- | Missing AuthProvider | Wrap app with AuthProvider | Required for auth token injection |
321
+ | Mistake | Better Approach | Why |
322
+ | ----------------------------------------- | -------------------------- | ----------------------------------------------- |
323
+ | Adding `baseUrl` inside Agentuity project | Omit `baseUrl` | Auto-detected in full-stack projects |
324
+ | Using `fetch` directly for agents | Use `useAPI` hook | Type inference, auth injection, loading states |
325
+ | Manual WebSocket management | Use `useWebsocket` hook | Auto-reconnect, auth injection, message queuing |
326
+ | Missing AuthProvider | Wrap app with AuthProvider | Required for auth token injection |
@@ -37,15 +37,15 @@ cat agentuity.json 2>/dev/null | grep region
37
37
 
38
38
  ## Golden Commands
39
39
 
40
- | Purpose | Command |
41
- |---------|---------|
42
- | Create project | `agentuity new` (interactive) or `agentuity new --name <name>` |
43
- | Start dev server | `bun run dev` → read output for actual URL |
44
- | Deploy | `agentuity deploy` → read output for deployment URL |
45
- | Check auth | `agentuity auth whoami` |
46
- | List regions | `agentuity region list` |
47
- | Get CLI help | `agentuity <command> --help` |
48
- | Show all commands | `agentuity ai schema show` |
40
+ | Purpose | Command |
41
+ | ----------------- | -------------------------------------------------------------- |
42
+ | Create project | `agentuity new` (interactive) or `agentuity new --name <name>` |
43
+ | Start dev server | `bun run dev` → read output for actual URL |
44
+ | Deploy | `agentuity deploy` → read output for deployment URL |
45
+ | Check auth | `agentuity auth whoami` |
46
+ | List regions | `agentuity region list` |
47
+ | Get CLI help | `agentuity <command> --help` |
48
+ | Show all commands | `agentuity ai schema show` |
49
49
 
50
50
  ---
51
51
 
@@ -127,13 +127,13 @@ agentuity cloud sandbox snapshot list --json
127
127
 
128
128
  ### Network & Public URLs
129
129
 
130
- | Scenario | Use `--network`? | Use `--port`? |
131
- |----------|------------------|---------------|
132
- | Running tests locally | No | No |
133
- | Installing npm packages | Yes | No |
134
- | Running web server for internal testing | Yes | No |
135
- | Exposing dev preview to share | Yes | Yes |
136
- | API that external services call | Yes | Yes |
130
+ | Scenario | Use `--network`? | Use `--port`? |
131
+ | --------------------------------------- | ---------------- | ------------- |
132
+ | Running tests locally | No | No |
133
+ | Installing npm packages | Yes | No |
134
+ | Running web server for internal testing | Yes | No |
135
+ | Exposing dev preview to share | Yes | Yes |
136
+ | API that external services call | Yes | Yes |
137
137
 
138
138
  **Public URL format:** `https://s{identifier}.agentuity.run`
139
139
 
@@ -186,9 +186,9 @@ agentuity cloud deployment get <deploymentId> --json
186
186
 
187
187
  ```json
188
188
  {
189
- "projectId": "proj_abc123",
190
- "orgId": "org_xyz",
191
- "region": "use"
189
+ "projectId": "proj_abc123",
190
+ "orgId": "org_xyz",
191
+ "region": "use"
192
192
  }
193
193
  ```
194
194
 
@@ -198,10 +198,10 @@ Contains `orgId` from `preferences.orgId` — used as fallback when `agentuity.j
198
198
 
199
199
  ## Common Mistakes
200
200
 
201
- | Mistake | Better Approach | Why |
202
- |---------|-----------------|-----|
203
- | Blindly adding `--region` flag | Check config first | Region may already be configured |
204
- | Using npm for Agentuity projects | Always use `bun` | Agentuity is Bun-native |
201
+ | Mistake | Better Approach | Why |
202
+ | ---------------------------------- | --------------------- | ------------------------------------ |
203
+ | Blindly adding `--region` flag | Check config first | Region may already be configured |
204
+ | Using npm for Agentuity projects | Always use `bun` | Agentuity is Bun-native |
205
205
  | Hardcoding sandbox paths as `/app` | Use `/home/agentuity` | That's the default working directory |
206
- | Making up CLI flags | Run `--help` first | Flags change between versions |
207
- | Fabricating deployment URLs | Read actual output | URLs are generated dynamically |
206
+ | Making up CLI flags | Run `--help` first | Flags change between versions |
207
+ | Fabricating deployment URLs | Read actual output | URLs are generated dynamically |
package/src/install.ts CHANGED
@@ -5,8 +5,8 @@
5
5
  * Sets up permissions for Agentuity Cloud CLI commands.
6
6
  */
7
7
 
8
- import { join } from "node:path";
9
- import { homedir } from "node:os";
8
+ import { join } from 'node:path';
9
+ import { homedir } from 'node:os';
10
10
 
11
11
  export interface InstallConfig {
12
12
  projectId?: string;
@@ -23,16 +23,13 @@ interface ClaudeSettings {
23
23
  [key: string]: unknown;
24
24
  }
25
25
 
26
- const AGENTUITY_PERMISSIONS = [
27
- "Bash(agentuity cloud *)",
28
- "Bash(agentuity auth whoami *)",
29
- ];
26
+ const AGENTUITY_PERMISSIONS = ['Bash(agentuity cloud *)', 'Bash(agentuity auth whoami *)'];
30
27
 
31
28
  const AGENTUITY_DENY_PERMISSIONS = [
32
- "Bash(agentuity cloud secrets *)",
33
- "Bash(agentuity cloud secret *)",
34
- "Bash(agentuity cloud apikey *)",
35
- "Bash(agentuity auth token *)",
29
+ 'Bash(agentuity cloud secrets *)',
30
+ 'Bash(agentuity cloud secret *)',
31
+ 'Bash(agentuity cloud apikey *)',
32
+ 'Bash(agentuity auth token *)',
36
33
  ];
37
34
 
38
35
  /**
@@ -40,7 +37,7 @@ const AGENTUITY_DENY_PERMISSIONS = [
40
37
  */
41
38
  export async function readProjectConfig(): Promise<InstallConfig> {
42
39
  try {
43
- const file = Bun.file("agentuity.json");
40
+ const file = Bun.file('agentuity.json');
44
41
  if (await file.exists()) {
45
42
  const config = await file.json();
46
43
  return {
@@ -73,11 +70,8 @@ async function readSettings(path: string): Promise<ClaudeSettings> {
73
70
  /**
74
71
  * Write a Claude Code settings JSON file.
75
72
  */
76
- async function writeSettings(
77
- path: string,
78
- settings: ClaudeSettings,
79
- ): Promise<void> {
80
- await Bun.write(path, JSON.stringify(settings, null, 2) + "\n");
73
+ async function writeSettings(path: string, settings: ClaudeSettings): Promise<void> {
74
+ await Bun.write(path, JSON.stringify(settings, null, 2) + '\n');
81
75
  }
82
76
 
83
77
  /**
@@ -85,7 +79,7 @@ async function writeSettings(
85
79
  * Adds allow rules for agentuity cloud commands and deny rules for sensitive ones.
86
80
  */
87
81
  async function configurePermissions(): Promise<{ added: number }> {
88
- const settingsPath = join(homedir(), ".claude", "settings.local.json");
82
+ const settingsPath = join(homedir(), '.claude', 'settings.local.json');
89
83
  const settings = await readSettings(settingsPath);
90
84
 
91
85
  if (!settings.permissions) {
@@ -131,18 +125,14 @@ export async function install(): Promise<void> {
131
125
  // Configure Claude Code permissions for Agentuity Cloud commands
132
126
  const { added } = await configurePermissions();
133
127
  if (added > 0) {
134
- console.log(
135
- `Configured ${added} permission rules for Agentuity Cloud commands`,
136
- );
128
+ console.log(`Configured ${added} permission rules for Agentuity Cloud commands`);
137
129
  }
138
130
 
139
131
  if (config.projectId) {
140
- console.log(
141
- `Agentuity Coder configured for project: ${config.projectId}`,
142
- );
132
+ console.log(`Agentuity Coder configured for project: ${config.projectId}`);
143
133
  } else {
144
134
  console.log(
145
- "Agentuity Coder installed (no agentuity.json found - will use session-start hook for context)",
135
+ 'Agentuity Coder installed (no agentuity.json found - will use session-start hook for context)'
146
136
  );
147
137
  }
148
138
  }