@agentuity/claude-code 1.0.6 → 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.
- package/.claude-plugin/plugin.json +1 -1
- package/AGENTS.md +34 -32
- package/README.md +41 -40
- package/agents/architect.md +94 -83
- package/agents/builder.md +111 -95
- package/agents/lead.md +182 -136
- package/agents/memory.md +247 -215
- package/agents/product.md +127 -80
- package/agents/reviewer.md +99 -65
- package/agents/scout.md +89 -63
- package/commands/agentuity-cadence-cancel.md +6 -1
- package/commands/agentuity-cadence.md +11 -9
- package/commands/agentuity-coder.md +1 -0
- package/commands/agentuity-memory-save.md +1 -0
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +11 -14
- package/dist/install.js.map +1 -1
- package/hooks/hooks.json +65 -65
- package/package.json +1 -1
- package/skills/agentuity-backend/SKILL.md +161 -152
- package/skills/agentuity-cloud/SKILL.md +37 -31
- package/skills/agentuity-command-runner/SKILL.md +34 -33
- package/skills/agentuity-frontend/SKILL.md +112 -107
- package/skills/agentuity-ops/SKILL.md +25 -25
- package/src/install.ts +14 -24
|
@@ -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
|
|
38
|
-
|
|
39
|
-
| install
|
|
40
|
-
| build
|
|
41
|
-
| 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
|
|
44
|
-
| format
|
|
45
|
-
| 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
|
|
50
|
-
|
|
51
|
-
| build
|
|
52
|
-
| test
|
|
53
|
-
| lint
|
|
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
|
|
59
|
-
|
|
60
|
-
| build
|
|
61
|
-
| test
|
|
62
|
-
| lint
|
|
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
|
|
78
|
-
|
|
79
|
-
| Type Error
|
|
80
|
-
| Syntax Error | "Unexpected", "SyntaxError", "Parse error"
|
|
81
|
-
| Lint Error
|
|
82
|
-
| Test Failure | "FAIL", "AssertionError", "expect", "assert"
|
|
83
|
-
| Build Error
|
|
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
|
|
107
|
-
|
|
108
|
-
| `src/foo.ts` | 45
|
|
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
|
|
113
|
-
|
|
114
|
-
| `src/baz.ts` | 8
|
|
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
|
|
14
|
-
|
|
15
|
-
| `@agentuity/react`
|
|
16
|
-
| `@agentuity/frontend`
|
|
17
|
-
| `@agentuity/auth`
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
87
|
-
|
|
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
|
-
|
|
93
|
-
|
|
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
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
-
|
|
154
|
+
const { isAuthenticated, authLoading, authHeader } = useAuth();
|
|
150
155
|
|
|
151
|
-
|
|
152
|
-
|
|
156
|
+
if (authLoading) return <p>Loading...</p>;
|
|
157
|
+
if (!isAuthenticated) return <p>Please sign in</p>;
|
|
153
158
|
|
|
154
|
-
|
|
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
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
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
|
-
|
|
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
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
295
|
+
return (
|
|
296
|
+
<AuthProvider>
|
|
297
|
+
<AgentuityProvider>
|
|
298
|
+
<ProtectedChat />
|
|
299
|
+
</AgentuityProvider>
|
|
300
|
+
</AuthProvider>
|
|
301
|
+
);
|
|
297
302
|
}
|
|
298
303
|
|
|
299
304
|
function ProtectedChat() {
|
|
300
|
-
|
|
301
|
-
|
|
305
|
+
const { isAuthenticated } = useAuth();
|
|
306
|
+
const { data, invoke } = useAPI('POST /agent/chat');
|
|
302
307
|
|
|
303
|
-
|
|
308
|
+
if (!isAuthenticated) return <SignIn />;
|
|
304
309
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
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
|
|
317
|
-
|
|
318
|
-
| Adding `baseUrl` inside Agentuity project | Omit `baseUrl`
|
|
319
|
-
| Using `fetch` directly for agents
|
|
320
|
-
| Manual WebSocket management
|
|
321
|
-
| Missing AuthProvider
|
|
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
|
|
41
|
-
|
|
42
|
-
| Create project
|
|
43
|
-
| Start dev server
|
|
44
|
-
| Deploy
|
|
45
|
-
| Check auth
|
|
46
|
-
| List regions
|
|
47
|
-
| Get CLI 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
|
|
131
|
-
|
|
132
|
-
| Running tests locally
|
|
133
|
-
| Installing npm packages
|
|
134
|
-
| Running web server for internal testing | Yes
|
|
135
|
-
| Exposing dev preview to share
|
|
136
|
-
| API that external services call
|
|
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
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
|
202
|
-
|
|
203
|
-
| Blindly adding `--region` flag
|
|
204
|
-
| Using npm for Agentuity projects
|
|
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
|
|
207
|
-
| Fabricating deployment URLs
|
|
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
|
|
9
|
-
import { homedir } from
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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(
|
|
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
|
|
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(),
|
|
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
|
-
|
|
135
|
+
'Agentuity Coder installed (no agentuity.json found - will use session-start hook for context)'
|
|
146
136
|
);
|
|
147
137
|
}
|
|
148
138
|
}
|