grexal 0.1.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/LICENSE +21 -0
- package/README.md +180 -0
- package/dist/commands/deploy.d.ts +2 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +161 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/dev.d.ts +4 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +232 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +76 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/login.d.ts +2 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +96 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +2 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +12 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/validate.d.ts +2 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +55 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/dev-server/server.d.ts +31 -0
- package/dist/dev-server/server.d.ts.map +1 -0
- package/dist/dev-server/server.js +89 -0
- package/dist/dev-server/server.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest/constants.d.ts +31 -0
- package/dist/manifest/constants.d.ts.map +1 -0
- package/dist/manifest/constants.js +54 -0
- package/dist/manifest/constants.js.map +1 -0
- package/dist/manifest/types.d.ts +66 -0
- package/dist/manifest/types.d.ts.map +1 -0
- package/dist/manifest/types.js +3 -0
- package/dist/manifest/types.js.map +1 -0
- package/dist/manifest/validator.d.ts +7 -0
- package/dist/manifest/validator.d.ts.map +1 -0
- package/dist/manifest/validator.js +435 -0
- package/dist/manifest/validator.js.map +1 -0
- package/dist/templates/python.d.ts +4 -0
- package/dist/templates/python.d.ts.map +1 -0
- package/dist/templates/python.js +35 -0
- package/dist/templates/python.js.map +1 -0
- package/dist/templates/shared.d.ts +3 -0
- package/dist/templates/shared.d.ts.map +1 -0
- package/dist/templates/shared.js +29 -0
- package/dist/templates/shared.js.map +1 -0
- package/dist/templates/typescript.d.ts +5 -0
- package/dist/templates/typescript.d.ts.map +1 -0
- package/dist/templates/typescript.js +55 -0
- package/dist/templates/typescript.js.map +1 -0
- package/dist/utils/api.d.ts +12 -0
- package/dist/utils/api.d.ts.map +1 -0
- package/dist/utils/api.js +23 -0
- package/dist/utils/api.js.map +1 -0
- package/dist/utils/auth.d.ts +10 -0
- package/dist/utils/auth.d.ts.map +1 -0
- package/dist/utils/auth.js +46 -0
- package/dist/utils/auth.js.map +1 -0
- package/dist/utils/manifest.d.ts +3 -0
- package/dist/utils/manifest.d.ts.map +1 -0
- package/dist/utils/manifest.js +32 -0
- package/dist/utils/manifest.js.map +1 -0
- package/dist/utils/process.d.ts +18 -0
- package/dist/utils/process.d.ts.map +1 -0
- package/dist/utils/process.js +30 -0
- package/dist/utils/process.js.map +1 -0
- package/package.json +29 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Grexal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# grexal
|
|
2
|
+
|
|
3
|
+
The developer CLI for building, testing, and deploying agents to the [Grexal](https://grexal.ai) marketplace.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx grexal login
|
|
7
|
+
npx grexal init
|
|
8
|
+
npx grexal dev
|
|
9
|
+
npx grexal deploy
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
No global install required.
|
|
13
|
+
|
|
14
|
+
## Commands
|
|
15
|
+
|
|
16
|
+
### `grexal login`
|
|
17
|
+
|
|
18
|
+
Authenticate with the Grexal platform. Opens a browser-based auth flow and stores a token locally at `~/.grexal/credentials.json`. Required before deploying.
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
$ npx grexal login
|
|
22
|
+
|
|
23
|
+
Opening browser to authenticate...
|
|
24
|
+
✓ Logged in as developer@example.com
|
|
25
|
+
Credentials saved to ~/.grexal/credentials.json
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### `grexal logout`
|
|
29
|
+
|
|
30
|
+
Clear stored credentials.
|
|
31
|
+
|
|
32
|
+
### `grexal init`
|
|
33
|
+
|
|
34
|
+
Scaffold a new agent project. Two questions — language and name — and you're writing code.
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
$ npx grexal init
|
|
38
|
+
|
|
39
|
+
Language (typescript/python) [typescript]:
|
|
40
|
+
Agent name: invoice-parser
|
|
41
|
+
|
|
42
|
+
Created invoice-parser/ (typescript)
|
|
43
|
+
|
|
44
|
+
cd invoice-parser
|
|
45
|
+
npm install
|
|
46
|
+
npx grexal dev
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Generates:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
invoice-parser/
|
|
53
|
+
├── grexal.json — agent manifest
|
|
54
|
+
├── index.ts (or agent.py) — entrypoint using the SDK
|
|
55
|
+
├── package.json (or requirements.txt)
|
|
56
|
+
├── tsconfig.json — TypeScript only
|
|
57
|
+
├── .gitignore
|
|
58
|
+
└── .grexal/
|
|
59
|
+
└── connections.json — local dev credentials
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### `grexal dev`
|
|
63
|
+
|
|
64
|
+
Run the agent locally in a simulated environment. This is the primary development tool — the `npm run dev` equivalent for agents.
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
$ npx grexal dev
|
|
68
|
+
|
|
69
|
+
Grexal Dev Server running
|
|
70
|
+
Agent: invoice-parser (typescript)
|
|
71
|
+
Listening on localhost:4700
|
|
72
|
+
|
|
73
|
+
Connections loaded from .grexal/connections.json
|
|
74
|
+
✓ google_drive
|
|
75
|
+
|
|
76
|
+
Enter task input (JSON):
|
|
77
|
+
> {"folder_id": "1a2b3c"}
|
|
78
|
+
|
|
79
|
+
Running...
|
|
80
|
+
[log] Scanning folder for PDFs...
|
|
81
|
+
[log] Found 12 invoices
|
|
82
|
+
[progress] 80%
|
|
83
|
+
[result] {"invoices": [{"vendor": "Acme", "total": 1250.00}], "count": 12}
|
|
84
|
+
|
|
85
|
+
Run completed in 3.2s
|
|
86
|
+
|
|
87
|
+
Enter task input (JSON):
|
|
88
|
+
>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The dev server starts on `localhost:4700` and mimics the Grexal platform API. The SDK doesn't know it's in dev mode — same code, same env vars, different target.
|
|
92
|
+
|
|
93
|
+
What it does:
|
|
94
|
+
|
|
95
|
+
- Validates `grexal.json` on startup and on every file change
|
|
96
|
+
- Loads connection credentials from `.grexal/connections.json`
|
|
97
|
+
- Warns if declared connections are missing
|
|
98
|
+
- Sets platform-equivalent environment variables
|
|
99
|
+
- Spawns the agent process and captures logs, progress, and results
|
|
100
|
+
- Watches for file changes and restarts automatically
|
|
101
|
+
|
|
102
|
+
Skip the interactive prompt with `--input`:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
npx grexal dev --input '{"folder_id": "1a2b3c"}'
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### `grexal deploy`
|
|
109
|
+
|
|
110
|
+
Deploy the agent to the Grexal marketplace. Every deployment goes through a mandatory AI security review before the build starts.
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
$ npx grexal deploy
|
|
114
|
+
|
|
115
|
+
Deploying invoice-parser...
|
|
116
|
+
Branch: main
|
|
117
|
+
Commit: a1b2c3d4
|
|
118
|
+
Packaging source...
|
|
119
|
+
Package size: 12 KB
|
|
120
|
+
Uploading...
|
|
121
|
+
|
|
122
|
+
[build] Running security review...
|
|
123
|
+
[build] ✓ Security review passed
|
|
124
|
+
[build] Installing dependencies...
|
|
125
|
+
[build] Cache hit — restoring dependencies
|
|
126
|
+
[build] Packaging artifact (42 MB)
|
|
127
|
+
[build] ✓ Build succeeded (8.3s)
|
|
128
|
+
|
|
129
|
+
Deployed invoice-parser v13 successfully!
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
The deploy flow:
|
|
133
|
+
|
|
134
|
+
1. Validates `grexal.json`
|
|
135
|
+
2. Packages source (respects `.gitignore`)
|
|
136
|
+
3. Uploads to the platform
|
|
137
|
+
4. AI security review checks for credential abuse
|
|
138
|
+
5. Build runs in an isolated sandbox
|
|
139
|
+
6. Logs stream to your terminal in real-time
|
|
140
|
+
|
|
141
|
+
### `grexal validate`
|
|
142
|
+
|
|
143
|
+
Standalone validation of the agent manifest. Checks that `grexal.json` is valid, the entrypoint file exists, resource limits are within bounds, and connections are well-formed.
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
$ npx grexal validate
|
|
147
|
+
|
|
148
|
+
✓ grexal.json is valid
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Useful in CI or as a pre-commit hook. During `grexal dev`, this runs automatically on every file change.
|
|
152
|
+
|
|
153
|
+
## Connections in Dev Mode
|
|
154
|
+
|
|
155
|
+
Connection credentials for local testing go in `.grexal/connections.json` (not `.env`). The structure mirrors what `grexal.json` declares:
|
|
156
|
+
|
|
157
|
+
```json
|
|
158
|
+
{
|
|
159
|
+
"google_drive": {
|
|
160
|
+
"access_token": "ya29.test-token"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The CLI warns on startup if any declared connections are missing from this file. Add `.grexal/connections.json` to your `.gitignore` — it contains test credentials that should never be committed.
|
|
166
|
+
|
|
167
|
+
## Environment Variables
|
|
168
|
+
|
|
169
|
+
| Variable | Purpose |
|
|
170
|
+
|---|---|
|
|
171
|
+
| `GREXAL_API_URL` | Override the platform API endpoint |
|
|
172
|
+
| `GREXAL_WEB_URL` | Override the web UI URL used during login |
|
|
173
|
+
|
|
174
|
+
## Documentation
|
|
175
|
+
|
|
176
|
+
Full documentation at [grexal.ai/docs](https://grexal.ai/docs)
|
|
177
|
+
|
|
178
|
+
## License
|
|
179
|
+
|
|
180
|
+
[MIT](./LICENSE)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AA+DA,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CA8J/C"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { execSync } from "node:child_process";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import { requireAuth } from "../utils/auth.js";
|
|
7
|
+
import { platformFetch, getPlatformUrl } from "../utils/api.js";
|
|
8
|
+
import { loadManifest } from "../utils/manifest.js";
|
|
9
|
+
function sleep(ms) {
|
|
10
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
11
|
+
}
|
|
12
|
+
function getGitInfo() {
|
|
13
|
+
try {
|
|
14
|
+
const commitSha = execSync("git rev-parse HEAD", { encoding: "utf-8" }).trim();
|
|
15
|
+
const branch = execSync("git rev-parse --abbrev-ref HEAD", {
|
|
16
|
+
encoding: "utf-8",
|
|
17
|
+
}).trim();
|
|
18
|
+
const commitMessage = execSync("git log -1 --format=%s", {
|
|
19
|
+
encoding: "utf-8",
|
|
20
|
+
}).trim();
|
|
21
|
+
return { commitSha, branch, commitMessage };
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function createTarball() {
|
|
28
|
+
const tarballPath = join(tmpdir(), `grexal-deploy-${Date.now()}.tar.gz`);
|
|
29
|
+
try {
|
|
30
|
+
// Use git ls-files to respect .gitignore
|
|
31
|
+
execSync(`git ls-files -z | tar -czf "${tarballPath}" --null -T -`, { stdio: "pipe" });
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
// Fallback for non-git directories
|
|
35
|
+
execSync(`tar -czf "${tarballPath}" --exclude=node_modules --exclude=.git --exclude=dist --exclude=.grexal --exclude=__pycache__ --exclude=.venv .`, { stdio: "pipe" });
|
|
36
|
+
}
|
|
37
|
+
return execSync(`cat "${tarballPath}"`, {
|
|
38
|
+
maxBuffer: 100 * 1024 * 1024, // 100MB
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export async function runDeploy() {
|
|
42
|
+
// Load and validate manifest
|
|
43
|
+
const manifestPath = resolve("grexal.json");
|
|
44
|
+
const manifest = await loadManifest(manifestPath);
|
|
45
|
+
// Check authentication
|
|
46
|
+
const creds = await requireAuth();
|
|
47
|
+
console.log("");
|
|
48
|
+
console.log(` Deploying ${manifest.name}...`);
|
|
49
|
+
// Get git info
|
|
50
|
+
const gitInfo = getGitInfo();
|
|
51
|
+
if (gitInfo.branch) {
|
|
52
|
+
console.log(` Branch: ${gitInfo.branch}`);
|
|
53
|
+
}
|
|
54
|
+
if (gitInfo.commitSha) {
|
|
55
|
+
console.log(` Commit: ${gitInfo.commitSha.slice(0, 8)}`);
|
|
56
|
+
}
|
|
57
|
+
// Check for dirty working tree
|
|
58
|
+
try {
|
|
59
|
+
const status = execSync("git status --porcelain", { encoding: "utf-8" });
|
|
60
|
+
if (status.trim()) {
|
|
61
|
+
console.log(" Warning: working tree has uncommitted changes");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
// Not a git repo
|
|
66
|
+
}
|
|
67
|
+
// Create tarball
|
|
68
|
+
console.log(" Packaging source...");
|
|
69
|
+
let tarball;
|
|
70
|
+
try {
|
|
71
|
+
tarball = createTarball();
|
|
72
|
+
}
|
|
73
|
+
catch (e) {
|
|
74
|
+
console.error(` Error: Failed to create tarball — ${e instanceof Error ? e.message : e}`);
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
console.log(` Package size: ${(tarball.length / 1024).toFixed(0)} KB`);
|
|
78
|
+
// Read raw manifest for upload
|
|
79
|
+
const manifestJson = await readFile(manifestPath, "utf-8");
|
|
80
|
+
const manifestB64 = Buffer.from(manifestJson).toString("base64");
|
|
81
|
+
// Upload to platform
|
|
82
|
+
console.log(" Uploading...\n");
|
|
83
|
+
const headers = {
|
|
84
|
+
"Content-Type": "application/gzip",
|
|
85
|
+
"X-Grexal-Manifest": manifestB64,
|
|
86
|
+
"X-Grexal-Agent-Name": manifest.name,
|
|
87
|
+
};
|
|
88
|
+
if (gitInfo.commitSha)
|
|
89
|
+
headers["X-Grexal-Commit-Sha"] = gitInfo.commitSha;
|
|
90
|
+
if (gitInfo.branch)
|
|
91
|
+
headers["X-Grexal-Branch"] = gitInfo.branch;
|
|
92
|
+
if (gitInfo.commitMessage)
|
|
93
|
+
headers["X-Grexal-Commit-Message"] = gitInfo.commitMessage;
|
|
94
|
+
let deploymentId;
|
|
95
|
+
try {
|
|
96
|
+
const resp = await platformFetch("/api/deploy/upload", {
|
|
97
|
+
method: "POST",
|
|
98
|
+
headers,
|
|
99
|
+
body: tarball,
|
|
100
|
+
token: creds.token,
|
|
101
|
+
});
|
|
102
|
+
if (!resp.ok) {
|
|
103
|
+
const text = await resp.text();
|
|
104
|
+
console.error(` Error: Upload failed — ${text}`);
|
|
105
|
+
process.exit(1);
|
|
106
|
+
}
|
|
107
|
+
const data = (await resp.json());
|
|
108
|
+
deploymentId = data.deploymentId;
|
|
109
|
+
}
|
|
110
|
+
catch (e) {
|
|
111
|
+
console.error(` Error: Could not connect to platform at ${getPlatformUrl()}`);
|
|
112
|
+
console.error(` Set GREXAL_API_URL if you're using a custom deployment.\n`);
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
// Poll for build status and stream logs
|
|
116
|
+
let logCursor;
|
|
117
|
+
let lastStatus = "";
|
|
118
|
+
while (true) {
|
|
119
|
+
await sleep(1500);
|
|
120
|
+
try {
|
|
121
|
+
const params = new URLSearchParams({ deploymentId });
|
|
122
|
+
if (logCursor !== undefined) {
|
|
123
|
+
params.set("logCursor", String(logCursor));
|
|
124
|
+
}
|
|
125
|
+
const resp = await platformFetch(`/api/deploy/status?${params.toString()}`, {
|
|
126
|
+
method: "GET",
|
|
127
|
+
token: creds.token,
|
|
128
|
+
});
|
|
129
|
+
if (!resp.ok) {
|
|
130
|
+
// Retry on transient errors
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
const data = (await resp.json());
|
|
134
|
+
// Print new log entries
|
|
135
|
+
for (const entry of data.logs) {
|
|
136
|
+
const prefix = entry.stream === "system"
|
|
137
|
+
? " [build]"
|
|
138
|
+
: entry.stream === "stderr"
|
|
139
|
+
? " [build:err]"
|
|
140
|
+
: " [build]";
|
|
141
|
+
console.log(`${prefix} ${entry.message}`);
|
|
142
|
+
}
|
|
143
|
+
if (data.nextLogCursor !== null) {
|
|
144
|
+
logCursor = data.nextLogCursor;
|
|
145
|
+
}
|
|
146
|
+
lastStatus = data.status;
|
|
147
|
+
if (data.status === "succeeded") {
|
|
148
|
+
console.log(`\n Deployed ${manifest.name} v${data.version ?? "?"} successfully!\n`);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (data.status === "failed") {
|
|
152
|
+
console.error(`\n Deployment failed: ${data.errorMessage ?? "Unknown error"}\n`);
|
|
153
|
+
process.exit(1);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
// Network error — keep polling
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=deploy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,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CAAC,MAAM,KAAK,QAAQ;wBACzB,CAAC,CAAC,eAAe;wBACjB,CAAC,CAAC,WAAW,CAAC;gBACpB,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YAC5C,CAAC;YAED,IAAI,IAAI,CAAC,aAAa,KAAK,IAAI,EAAE,CAAC;gBAChC,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC;YACjC,CAAC;YAED,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC;YAEzB,IAAI,IAAI,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;gBAChC,OAAO,CAAC,GAAG,CACT,gBAAgB,QAAQ,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,IAAI,GAAG,kBAAkB,CACxE,CAAC;gBACF,OAAO;YACT,CAAC;YAED,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;gBAC7B,OAAO,CAAC,KAAK,CACX,0BAA0B,IAAI,CAAC,YAAY,IAAI,eAAe,IAAI,CACnE,CAAC;gBACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,+BAA+B;QACjC,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAYA,wBAAsB,MAAM,CAAC,OAAO,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAwJvE"}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { resolve, dirname } from "node:path";
|
|
3
|
+
import { createInterface } from "node:readline/promises";
|
|
4
|
+
import { watch } from "chokidar";
|
|
5
|
+
import { DevServer } from "../dev-server/server.js";
|
|
6
|
+
import { spawnAgent } from "../utils/process.js";
|
|
7
|
+
import { loadManifest } from "../utils/manifest.js";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
const DEV_SERVER_PORT = 4700;
|
|
10
|
+
export async function runDev(options) {
|
|
11
|
+
// --- Read and validate manifest ---
|
|
12
|
+
const manifestPath = resolve("grexal.json");
|
|
13
|
+
const manifest = await loadManifest(manifestPath);
|
|
14
|
+
// --- Load connections ---
|
|
15
|
+
const connectionsPath = resolve(".grexal", "connections.json");
|
|
16
|
+
const connections = await loadConnections(connectionsPath, manifest);
|
|
17
|
+
// --- Start dev server ---
|
|
18
|
+
let currentSubmitResolve = null;
|
|
19
|
+
let submitResult = undefined;
|
|
20
|
+
let hasSubmitted = false;
|
|
21
|
+
const server = new DevServer({
|
|
22
|
+
onSubmit: (result) => {
|
|
23
|
+
hasSubmitted = true;
|
|
24
|
+
submitResult = result;
|
|
25
|
+
currentSubmitResolve?.(result);
|
|
26
|
+
},
|
|
27
|
+
onLog: (entries) => {
|
|
28
|
+
for (const entry of entries) {
|
|
29
|
+
printLogEntry(entry);
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
await server.listen(DEV_SERVER_PORT);
|
|
34
|
+
console.log("");
|
|
35
|
+
console.log(` Grexal Dev Server running`);
|
|
36
|
+
console.log(` Agent: ${manifest.name} (${manifest.runtime.language})`);
|
|
37
|
+
console.log(` Listening on localhost:${DEV_SERVER_PORT}`);
|
|
38
|
+
console.log("");
|
|
39
|
+
// --- File watcher ---
|
|
40
|
+
let currentProcess = null;
|
|
41
|
+
let isRunning = false;
|
|
42
|
+
const watcher = watch(".", {
|
|
43
|
+
ignored: [
|
|
44
|
+
"**/node_modules/**",
|
|
45
|
+
"**/dist/**",
|
|
46
|
+
"**/.grexal/**",
|
|
47
|
+
"**/.git/**",
|
|
48
|
+
"**/__pycache__/**",
|
|
49
|
+
"**/.venv/**",
|
|
50
|
+
],
|
|
51
|
+
ignoreInitial: true,
|
|
52
|
+
persistent: true,
|
|
53
|
+
});
|
|
54
|
+
watcher.on("change", () => {
|
|
55
|
+
if (isRunning && currentProcess) {
|
|
56
|
+
console.log("\n File changed, restarting...\n");
|
|
57
|
+
currentProcess.kill();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
// --- SIGINT handling ---
|
|
61
|
+
process.on("SIGINT", async () => {
|
|
62
|
+
console.log("\n Shutting down...");
|
|
63
|
+
currentProcess?.kill();
|
|
64
|
+
watcher.close();
|
|
65
|
+
await server.close();
|
|
66
|
+
process.exit(0);
|
|
67
|
+
});
|
|
68
|
+
// --- Input loop ---
|
|
69
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
70
|
+
// First input from --input flag or prompt
|
|
71
|
+
let firstInput = options.input;
|
|
72
|
+
while (true) {
|
|
73
|
+
let taskInput;
|
|
74
|
+
if (firstInput !== undefined) {
|
|
75
|
+
taskInput = firstInput;
|
|
76
|
+
firstInput = undefined;
|
|
77
|
+
console.log(` Task input: ${taskInput}`);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
try {
|
|
81
|
+
taskInput = await rl.question(" Enter task input (JSON):\n > ");
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// stdin closed (e.g., piped input exhausted)
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// Validate JSON
|
|
89
|
+
const trimmed = taskInput.trim();
|
|
90
|
+
if (!trimmed)
|
|
91
|
+
continue;
|
|
92
|
+
try {
|
|
93
|
+
JSON.parse(trimmed);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
console.error(" Invalid JSON. Try again.\n");
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
// Run the agent
|
|
100
|
+
isRunning = true;
|
|
101
|
+
hasSubmitted = false;
|
|
102
|
+
submitResult = undefined;
|
|
103
|
+
server.reset();
|
|
104
|
+
const runId = `dev-${Date.now()}`;
|
|
105
|
+
const startTime = Date.now();
|
|
106
|
+
console.log("\n Running...");
|
|
107
|
+
const submitPromise = new Promise((resolve) => {
|
|
108
|
+
currentSubmitResolve = resolve;
|
|
109
|
+
});
|
|
110
|
+
const env = {
|
|
111
|
+
GREXAL_RUN_ID: runId,
|
|
112
|
+
GREXAL_PLATFORM_URL: `http://127.0.0.1:${DEV_SERVER_PORT}`,
|
|
113
|
+
GREXAL_RUN_TOKEN: "dev-token",
|
|
114
|
+
GREXAL_TASK_INPUT: trimmed,
|
|
115
|
+
GREXAL_CONNECTIONS: JSON.stringify(connections),
|
|
116
|
+
};
|
|
117
|
+
const { command, args } = getRunCommand(manifest);
|
|
118
|
+
currentProcess = spawnAgent({ command, args, env });
|
|
119
|
+
// Wait for either submit or process exit
|
|
120
|
+
const exitPromise = new Promise((resolve) => {
|
|
121
|
+
currentProcess.onExit(resolve);
|
|
122
|
+
});
|
|
123
|
+
const exitCode = await exitPromise;
|
|
124
|
+
const duration = ((Date.now() - startTime) / 1000).toFixed(1);
|
|
125
|
+
if (hasSubmitted) {
|
|
126
|
+
console.log(` [result] ${JSON.stringify(submitResult, null, 2)}`);
|
|
127
|
+
console.log(`\n Run completed in ${duration}s\n`);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
console.log(`\n Run exited with code ${exitCode ?? "unknown"} (no result submitted)`);
|
|
131
|
+
console.log(` Duration: ${duration}s\n`);
|
|
132
|
+
}
|
|
133
|
+
isRunning = false;
|
|
134
|
+
currentProcess = null;
|
|
135
|
+
currentSubmitResolve = null;
|
|
136
|
+
}
|
|
137
|
+
rl.close();
|
|
138
|
+
watcher.close();
|
|
139
|
+
await server.close();
|
|
140
|
+
}
|
|
141
|
+
// --- Helpers ---
|
|
142
|
+
async function loadConnections(path, manifest) {
|
|
143
|
+
let raw;
|
|
144
|
+
try {
|
|
145
|
+
raw = await readFile(path, "utf-8");
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
// No connections file — that's fine if no connections declared
|
|
149
|
+
if (manifest.connections && manifest.connections.length > 0) {
|
|
150
|
+
console.log(" Connections:");
|
|
151
|
+
for (const conn of manifest.connections) {
|
|
152
|
+
console.log(` ⚠ Missing: ${conn.id} (no .grexal/connections.json found)`);
|
|
153
|
+
}
|
|
154
|
+
console.log("");
|
|
155
|
+
}
|
|
156
|
+
return {};
|
|
157
|
+
}
|
|
158
|
+
try {
|
|
159
|
+
const parsed = JSON.parse(raw);
|
|
160
|
+
if (manifest.connections && manifest.connections.length > 0) {
|
|
161
|
+
console.log(" Connections loaded from .grexal/connections.json");
|
|
162
|
+
for (const conn of manifest.connections) {
|
|
163
|
+
if (conn.id in parsed) {
|
|
164
|
+
console.log(` ✓ ${conn.id}`);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
console.log(` ⚠ Missing: ${conn.id}`);
|
|
168
|
+
console.log(` Declared in grexal.json but not found in .grexal/connections.json`);
|
|
169
|
+
console.log(` ctx.connect("${conn.id}") will fail at runtime`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
console.log("");
|
|
173
|
+
}
|
|
174
|
+
return parsed;
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
console.error(" Warning: .grexal/connections.json contains invalid JSON, ignoring\n");
|
|
178
|
+
return {};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function getRunCommand(manifest) {
|
|
182
|
+
// Find the SDK runner path relative to this CLI package
|
|
183
|
+
// In development, @grexal/sdk is a workspace dependency
|
|
184
|
+
const sdkRunnerPath = resolveSDKRunner();
|
|
185
|
+
if (manifest.runtime.language === "typescript") {
|
|
186
|
+
// Resolve tsx from the CLI's own node_modules so it works
|
|
187
|
+
// regardless of the agent's cwd
|
|
188
|
+
const tsxPath = resolveTsx();
|
|
189
|
+
return {
|
|
190
|
+
command: "node",
|
|
191
|
+
args: ["--import", tsxPath, sdkRunnerPath, manifest.entrypoint],
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
// Python — future support
|
|
195
|
+
return {
|
|
196
|
+
command: "python",
|
|
197
|
+
args: ["-m", "grexal_sdk.runner", manifest.entrypoint],
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function resolveSDKRunner() {
|
|
201
|
+
// Try to resolve @grexal/sdk/runner from the CLI package
|
|
202
|
+
// In the monorepo, this resolves to packages/sdk-ts/dist/runner.js
|
|
203
|
+
try {
|
|
204
|
+
const sdkPath = import.meta.resolve("@grexal/sdk/runner");
|
|
205
|
+
return fileURLToPath(sdkPath);
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
// Fallback: try a relative path from CLI dist
|
|
209
|
+
const thisDir = dirname(fileURLToPath(import.meta.url));
|
|
210
|
+
return resolve(thisDir, "../../sdk-ts/dist/runner.js");
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
function resolveTsx() {
|
|
214
|
+
// Resolve tsx from the CLI package's own dependencies
|
|
215
|
+
try {
|
|
216
|
+
return import.meta.resolve("tsx");
|
|
217
|
+
}
|
|
218
|
+
catch {
|
|
219
|
+
// Fallback: try known path in monorepo
|
|
220
|
+
const thisDir = dirname(fileURLToPath(import.meta.url));
|
|
221
|
+
return "file://" + resolve(thisDir, "../../node_modules/tsx/dist/esm/index.mjs");
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
function printLogEntry(entry) {
|
|
225
|
+
if (entry.type === "log" && entry.message) {
|
|
226
|
+
console.log(` [log] ${entry.message}`);
|
|
227
|
+
}
|
|
228
|
+
else if (entry.type === "progress" && entry.value !== undefined) {
|
|
229
|
+
console.log(` [progress] ${Math.round(entry.value * 100)}%`);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=dev.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAA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