@inneranimalmedia/agentsam-sdk 1.1.1 → 1.5.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/DEVELOPMENT.md +4 -1
- package/README.md +79 -43
- package/docs/CLI_SHELL.md +90 -0
- package/examples/gorilla-shell/App.tsx +540 -0
- package/examples/gorilla-shell/README.md +22 -0
- package/examples/gorilla-shell/index.html +15 -0
- package/examples/gorilla-shell/main.jsx +9 -0
- package/examples/gorilla-shell/package.json +19 -0
- package/examples/gorilla-shell/vite.config.js +10 -0
- package/package.json +8 -2
- package/src/cli.js +114 -167
- package/src/commands/deploy.js +146 -0
- package/src/commands/start-local.js +61 -0
- package/src/index.js +6 -0
- package/src/lib/auth.js +76 -0
- package/src/lib/core-client.js +88 -0
- package/src/lib/detect-context.js +345 -0
- package/src/lib/gcp-setup.js +54 -0
- package/src/lib/local-scaffold.js +373 -0
- package/src/lib/prompt-byok.js +57 -0
- package/src/lib/save-sdk-token.js +19 -0
- package/src/lib/scaffold.js +7 -259
- package/src/lib/slash-commands.js +40 -0
- package/src/lib/write-files.js +21 -0
- package/src/local-pty/server.js +133 -0
- package/test/smoke.mjs +28 -5
package/DEVELOPMENT.md
CHANGED
|
@@ -51,5 +51,8 @@ npx agentsam init \
|
|
|
51
51
|
## Known gaps (roadmap)
|
|
52
52
|
|
|
53
53
|
- `agentsam deploy`, `status`, `logs` — not implemented yet
|
|
54
|
-
-
|
|
54
|
+
- Gorilla Shell Phase 1 — PTY WebSocket bridge to ExecOS
|
|
55
|
+
- CMS lane in README — CLI has 5 lanes (Full Stack, CMS, Data, CRM, Creative)
|
|
55
56
|
- Published API route may differ; stub mode works without `AGENTSAM_API_KEY`
|
|
57
|
+
|
|
58
|
+
See [docs/CLI_SHELL.md](./docs/CLI_SHELL.md) for the game-feel terminal UX path.
|
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Agent Sam is a full-stack autonomous agent SDK built on Cloudflare Workers, D1, Supabase, Durable Objects, and MCP — designed to converse, plan, and execute real work across your entire stack. CMS websites, full-stack applications, data pipelines, creative workflows, terminal execution, deployments, and multi-step agentic pipelines — all through one unified agent interface.
|
|
6
6
|
|
|
7
|
+
**Repo:** [github.com/SamPrimeaux/agentsam-sdk](https://github.com/SamPrimeaux/agentsam-sdk) · **npm:** `@inneranimalmedia/agentsam-sdk`
|
|
8
|
+
|
|
7
9
|
---
|
|
8
10
|
|
|
9
11
|
## What is Agent Sam?
|
|
@@ -20,34 +22,74 @@ It is not a wrapper around a chat API. It is a command fabric with a conversatio
|
|
|
20
22
|
|
|
21
23
|
---
|
|
22
24
|
|
|
23
|
-
## Quickstart
|
|
25
|
+
## Quickstart (local-first — Node only)
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
```bash
|
|
26
28
|
npx @inneranimalmedia/agentsam-sdk init
|
|
27
|
-
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Default path: **localhost**. No IAM login, no Cloudflare OAuth, no accounts. Under 2 minutes with Node 20+ installed.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
cd my-project
|
|
35
|
+
npm install
|
|
36
|
+
npm run smoke
|
|
37
|
+
npx agentsam start-local # local PTY on ws://127.0.0.1:3099
|
|
38
|
+
npm run dev # http://127.0.0.1:8787
|
|
39
|
+
npm run db:migrate # local D1 schema
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
When you're ready to ship to **your** Cloudflare account:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx agentsam deploy
|
|
46
|
+
```
|
|
28
47
|
|
|
29
|
-
|
|
48
|
+
Cloudflare OAuth is prompted **only at deploy** — not at init.
|
|
30
49
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
--
|
|
36
|
-
--
|
|
50
|
+
Non-interactive init:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx @inneranimalmedia/agentsam-sdk init \
|
|
54
|
+
--name my-agent \
|
|
55
|
+
--lane fullstack \
|
|
56
|
+
--run-target local \
|
|
37
57
|
--yes
|
|
38
|
-
|
|
58
|
+
```
|
|
39
59
|
|
|
40
|
-
|
|
60
|
+
Run targets at init: `local` (default) · `cloudflare` · `gcp` — all scaffold locally first; cloud credentials come at deploy.
|
|
41
61
|
|
|
42
62
|
See [DEVELOPMENT.md](./DEVELOPMENT.md) for linking the SDK into Inner Animal Media locally.
|
|
43
63
|
|
|
44
64
|
---
|
|
45
65
|
|
|
66
|
+
## CLI Shell Experience (Gorilla)
|
|
67
|
+
|
|
68
|
+
The SDK ships a **game-feel terminal UX** alongside the scaffold CLI — consolidated from the Gorilla Mode experiment:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npx @inneranimalmedia/agentsam-sdk shell
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
| Piece | Location |
|
|
75
|
+
|-------|----------|
|
|
76
|
+
| Slash command registry | `src/lib/slash-commands.js` |
|
|
77
|
+
| Phase 0 visual prototype | `examples/gorilla-shell/` |
|
|
78
|
+
| Architecture + phases | [docs/CLI_SHELL.md](./docs/CLI_SHELL.md) |
|
|
79
|
+
|
|
80
|
+
Run the prototype:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
cd examples/gorilla-shell && npm install && npm run dev
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
46
88
|
## Installation
|
|
47
89
|
|
|
48
|
-
|
|
90
|
+
```bash
|
|
49
91
|
npm install @inneranimalmedia/agentsam-sdk
|
|
50
|
-
|
|
92
|
+
```
|
|
51
93
|
|
|
52
94
|
---
|
|
53
95
|
|
|
@@ -77,7 +119,7 @@ npm install @inneranimalmedia/agentsam-sdk
|
|
|
77
119
|
|
|
78
120
|
## How It Works
|
|
79
121
|
|
|
80
|
-
|
|
122
|
+
```
|
|
81
123
|
User Intent (chat or CLI)
|
|
82
124
|
↓
|
|
83
125
|
Agent Sam — intent classification + command match
|
|
@@ -87,7 +129,7 @@ User Intent (chat or CLI)
|
|
|
87
129
|
Execution — terminal / D1 / Supabase / R2 / KV / DO / browser / deploy / MCP
|
|
88
130
|
↓
|
|
89
131
|
Telemetry — every action logged, measured, improvable
|
|
90
|
-
|
|
132
|
+
```
|
|
91
133
|
|
|
92
134
|
Capabilities are data-driven — new tools are added via D1, not Worker redeployments. The same tool catalog powers the dashboard, the CLI, and any MCP-connected client like Cursor or Claude Desktop.
|
|
93
135
|
|
|
@@ -125,35 +167,25 @@ Agent Sam routes work to the right environment automatically:
|
|
|
125
167
|
|
|
126
168
|
## What Gets Scaffolded
|
|
127
169
|
|
|
128
|
-
Running
|
|
170
|
+
Running `agentsam init` generates a production-ready project for your lane:
|
|
129
171
|
|
|
130
172
|
**All lanes include:**
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
|
|
137
|
-
**CMS lane adds:**
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
**
|
|
142
|
-
- D1 + Supabase Hyperdrive connection config
|
|
143
|
-
- Vector embedding pipeline scaffold
|
|
144
|
-
- Migration templates for core data models
|
|
145
|
-
|
|
146
|
-
**Full Stack adds:**
|
|
147
|
-
- Durable Object session scaffold
|
|
148
|
-
- Auth tables and session management
|
|
149
|
-
- Full agent chat + tool loop worker
|
|
173
|
+
- `agentsam.config.js` — project config, lane, provider, agent
|
|
174
|
+
- `wrangler.toml` — Worker, D1, R2, KV, Durable Object bindings
|
|
175
|
+
- `.env.example` — all required secrets pre-listed
|
|
176
|
+
- `src/index.js` — Worker entry point wired to your agent
|
|
177
|
+
- `README.md` — setup and deploy instructions
|
|
178
|
+
|
|
179
|
+
**CMS lane adds:** page/section/asset schema migrations and CMS worker scaffold.
|
|
180
|
+
|
|
181
|
+
**Data lane adds:** D1 + Hyperdrive config and migration templates.
|
|
182
|
+
|
|
183
|
+
**Full Stack adds:** Durable Object session scaffold, auth tables, full agent chat loop.
|
|
150
184
|
|
|
151
185
|
---
|
|
152
186
|
|
|
153
187
|
## Multi-Tenant & Client Policy
|
|
154
188
|
|
|
155
|
-
Agent Sam is built for isolation from the ground up:
|
|
156
|
-
|
|
157
189
|
- Each user or client gets a scoped workspace
|
|
158
190
|
- Terminal execution is path-isolated — no cross-tenant access
|
|
159
191
|
- AI usage is policy-gated — BYOK, managed, or disabled per client
|
|
@@ -164,10 +196,12 @@ Agent Sam is built for isolation from the ground up:
|
|
|
164
196
|
|
|
165
197
|
## Roadmap
|
|
166
198
|
|
|
167
|
-
- [
|
|
168
|
-
- [
|
|
169
|
-
- [ ]
|
|
170
|
-
- [ ]
|
|
199
|
+
- [x] `agentsam shell` — shell UX info + slash command registry
|
|
200
|
+
- [x] Gorilla Shell Phase 0 prototype in `examples/gorilla-shell/`
|
|
201
|
+
- [ ] `agentsam deploy` — push your project from CLI
|
|
202
|
+
- [ ] `agentsam status` — live agent and infrastructure health
|
|
203
|
+
- [ ] `agentsam logs` — tail tool call and command logs
|
|
204
|
+
- [ ] PTY bridge (Phase 1) — ExecOS WebSocket in shell
|
|
171
205
|
- [ ] Kit marketplace — CMS, ecommerce, nonprofit, SaaS starters
|
|
172
206
|
- [ ] BYOK AI key support per project
|
|
173
207
|
|
|
@@ -175,7 +209,9 @@ Agent Sam is built for isolation from the ground up:
|
|
|
175
209
|
|
|
176
210
|
## Built By
|
|
177
211
|
|
|
178
|
-
[Inner Animal Media](https://inneranimalmedia.com) — Agent Sam is the operator brain behind the
|
|
212
|
+
[Inner Animal Media](https://inneranimalmedia.com) — Agent Sam is the operator brain behind the platform. The SDK is how we productize that infrastructure for other developers.
|
|
213
|
+
|
|
214
|
+
**Legacy:** [InnerAnimal/gorilla-mode](https://github.com/InnerAnimal/gorilla-mode) → consolidated here.
|
|
179
215
|
|
|
180
216
|
---
|
|
181
217
|
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Agent Sam SDK — CLI Shell Experience
|
|
2
|
+
|
|
3
|
+
The SDK ships two complementary surfaces:
|
|
4
|
+
|
|
5
|
+
1. **`agentsam init`** — scaffold Workers + D1 + agent loop (resell/scale path)
|
|
6
|
+
2. **Gorilla Shell** (`examples/gorilla-shell/`) — game-feel terminal UX layer (unique install experience)
|
|
7
|
+
|
|
8
|
+
Gorilla Mode was consolidated from the standalone [InnerAnimal/gorilla-mode](https://github.com/InnerAnimal/gorilla-mode) experiment into this repo. **Do not start new work in gorilla-mode** — extend here.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Why a game shell?
|
|
13
|
+
|
|
14
|
+
Developers installing `@inneranimalmedia/agentsam-sdk` get:
|
|
15
|
+
|
|
16
|
+
- Efficient tooling (`init`, future `deploy` / `status` / `logs`)
|
|
17
|
+
- A **memorable CLI identity** — pixel HUD, slash commands, themed moods, deploy reactions
|
|
18
|
+
|
|
19
|
+
The shell is not a toy terminal emulator. It is a **presentation layer** on real PTY + MCP + D1 tool execution — the same stack IAM runs in production.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Architecture
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
User
|
|
27
|
+
└─ agentsam shell (CLI) or embedded <AgentSamShell />
|
|
28
|
+
└─ Gorilla HUD (themes, sprite, quest log)
|
|
29
|
+
└─ xterm.js ↔ ExecOS / iam-pty WebSocket
|
|
30
|
+
└─ Slash commands → SDK router → MCP / wrangler / D1
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
| Layer | Location in SDK |
|
|
34
|
+
|-------|-----------------|
|
|
35
|
+
| Slash command registry | `src/lib/slash-commands.js` |
|
|
36
|
+
| Phase 0 visual prototype | `examples/gorilla-shell/App.tsx` |
|
|
37
|
+
| Scaffold + Worker agent | `src/lib/scaffold.js`, `src/AgentSam.js` |
|
|
38
|
+
| Future PTY bridge | `src/lib/shell/` (Phase 1) |
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Phases
|
|
43
|
+
|
|
44
|
+
See `SHELL_PHASES` in `src/lib/slash-commands.js`. Current status:
|
|
45
|
+
|
|
46
|
+
| Phase | Status |
|
|
47
|
+
|-------|--------|
|
|
48
|
+
| 0 — Visual prototype | **Complete** (demo scenarios, themes, sprite) |
|
|
49
|
+
| 1 — Real PTY | **Next** — wire to ExecOS / `terminal.inneranimalmedia.com` |
|
|
50
|
+
| 2 — HUD (quest log, tool gate, XP) | Planned |
|
|
51
|
+
| 3 — Buddy (`/buddy`, MCP stream) | Planned |
|
|
52
|
+
| 4 — Dashboard embed | Planned |
|
|
53
|
+
| 5 — Standalone PWA as SDK default | Planned |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Run the prototype
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
cd examples/gorilla-shell
|
|
61
|
+
npm install
|
|
62
|
+
npm run dev
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Deploy preview (Cloudflare Pages):
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm run build
|
|
69
|
+
npx wrangler pages deploy dist
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Platform linkage (IAM)
|
|
75
|
+
|
|
76
|
+
| Shell feature | IAM SSOT |
|
|
77
|
+
|---------------|----------|
|
|
78
|
+
| PTY sessions | `terminal_connections` + ExecOS |
|
|
79
|
+
| Tool execution | `agentsam_tools` → catalog executor |
|
|
80
|
+
| Buddy / MCP | `mcp.inneranimalmedia.com` |
|
|
81
|
+
| XP (future) | `gorilla_xp` D1 table |
|
|
82
|
+
| Themes (future) | user preferences / `cms_themes` pattern |
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Repo history
|
|
87
|
+
|
|
88
|
+
- **Before:** `InnerAnimal/gorilla-mode` (Phase 0 only, single-file React artifact)
|
|
89
|
+
- **Now:** `SamPrimeaux/agentsam-sdk/examples/gorilla-shell`
|
|
90
|
+
- **D1 project:** `proj_agentsam_sdk` (replaces `proj_gorilla_mode` on the IAM projects grid)
|