@inquir/compute-cli 0.1.4 → 0.2.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/README.md +64 -5
- package/dist/commands/apps.d.ts +21 -0
- package/dist/commands/apps.d.ts.map +1 -0
- package/dist/commands/apps.js +857 -0
- package/dist/commands/apps.js.map +1 -0
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +207 -93
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +4 -2
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/mcp.d.ts +15 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +269 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/api.d.ts +52 -2
- package/dist/utils/api.d.ts.map +1 -1
- package/dist/utils/api.js +95 -2
- package/dist/utils/api.js.map +1 -1
- package/dist/utils/apps-presentation.d.ts +25 -0
- package/dist/utils/apps-presentation.d.ts.map +1 -0
- package/dist/utils/apps-presentation.js +71 -0
- package/dist/utils/apps-presentation.js.map +1 -0
- package/dist/utils/auth.d.ts.map +1 -1
- package/dist/utils/auth.js +13 -5
- package/dist/utils/auth.js.map +1 -1
- package/dist/utils/context.d.ts.map +1 -1
- package/dist/utils/context.js +3 -1
- package/dist/utils/context.js.map +1 -1
- package/dist/utils/detect.d.ts +45 -0
- package/dist/utils/detect.d.ts.map +1 -0
- package/dist/utils/detect.js +358 -0
- package/dist/utils/detect.js.map +1 -0
- package/dist/utils/ensure-auth.d.ts.map +1 -1
- package/dist/utils/ensure-auth.js +7 -1
- package/dist/utils/ensure-auth.js.map +1 -1
- package/package.json +5 -4
- package/skill/SKILL.md +60 -0
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inquir/compute-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Workspace-first CLI for Inquir Compute.",
|
|
6
6
|
"bin": {
|
|
7
7
|
"inquir": "./dist/index.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
|
-
"dist"
|
|
10
|
+
"dist",
|
|
11
|
+
"skill"
|
|
11
12
|
],
|
|
12
13
|
"scripts": {
|
|
13
14
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
@@ -20,11 +21,11 @@
|
|
|
20
21
|
"access": "public"
|
|
21
22
|
},
|
|
22
23
|
"dependencies": {
|
|
23
|
-
"@inquir/compute": "^0.
|
|
24
|
+
"@inquir/compute": "^0.2.0",
|
|
24
25
|
"tsx": "^4.19.2"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
28
|
"@types/node": "^22.9.0",
|
|
28
29
|
"typescript": "^5.6.3"
|
|
29
30
|
}
|
|
30
|
-
}
|
|
31
|
+
}
|
package/skill/SKILL.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: inquir-compute
|
|
3
|
+
description: Deploy and run functions, background jobs, and web apps on Inquir Compute — use when code needs to run remotely, on a schedule, longer than a request cycle, or behind a stable URL. Zero-config deploys via `inquir deploy` or the inquir MCP tools.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Inquir Compute — deploy & run workloads
|
|
7
|
+
|
|
8
|
+
Inquir Compute runs three kinds of workloads in isolated containers:
|
|
9
|
+
|
|
10
|
+
1. **Functions** — Lambda-compatible handlers (`exports.handler`, `def handler`, Go `Handler`). Best for event processing, API routes, webhooks, cron.
|
|
11
|
+
2. **Web apps** — any HTTP server (Express, Fastify, FastAPI, Flask, raw `http`). Deployed as-is; the platform runs it with `PORT` set and proxies requests. No code changes needed.
|
|
12
|
+
3. **Jobs / durable orchestrations** — async invocations with retries, queues, timers, `waitForEvent`, and human-approval waits that survive process restarts.
|
|
13
|
+
|
|
14
|
+
## When to reach for Inquir instead of local code
|
|
15
|
+
|
|
16
|
+
- The user's code must run **after this session ends** (schedules, webhooks, background processing).
|
|
17
|
+
- A task will outlive an HTTP request → use `invoke-async` (jobs) or a durable orchestration, not a long request.
|
|
18
|
+
- The user asks to "deploy", "host", or "get a URL for" something.
|
|
19
|
+
|
|
20
|
+
## Deploying (zero config)
|
|
21
|
+
|
|
22
|
+
From a directory — no config file, no SDK, any of Node / Python / Go:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
inquir deploy # deploy current directory, auto-detect everything
|
|
26
|
+
inquir deploy ./api --name billing --set LOG_LEVEL=debug
|
|
27
|
+
inquir deploy --dry-run # show the detection plan without deploying
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Detection rules:
|
|
31
|
+
- `exports.handler` / `def handler` / `func Handler` in the entry file → **function**.
|
|
32
|
+
- A server app (`.listen(`, Express/FastAPI/Flask imports, or a `start` script) → **web app**; start command is auto-derived (`node server.js`, `python -m uvicorn main:app …`). Override with `--start "<cmd>"`.
|
|
33
|
+
- Entry file: package.json `main`, then `index/main/app/server.*` at root or `src/`.
|
|
34
|
+
- Dependencies are installed **server-side at deploy** (npm/pip) — never commit `node_modules`.
|
|
35
|
+
|
|
36
|
+
Overrides when detection guesses wrong: `--runtime`, `--handler <module.export>`, `--mode handler|web`, `--start "<cmd>"`.
|
|
37
|
+
|
|
38
|
+
## MCP tools (preferred for agents)
|
|
39
|
+
|
|
40
|
+
Register once: `claude mcp add inquir -- inquir mcp`
|
|
41
|
+
|
|
42
|
+
- `deploy {path, name?, start?, env?}` — detect + deploy a directory; returns detection reasons, deploy status, and error logs on failure.
|
|
43
|
+
- `invoke {function, payload}` — run a function and get result + logs.
|
|
44
|
+
- `exec {function, command, target?}` — run a shell command inside the function's container (its runtime image + code). `target: "source"` (default) is read-write: use it for installing deps, running tests, debugging.
|
|
45
|
+
- `list_invocations {function}` — recent runs with errors and logs: the debugging entry point.
|
|
46
|
+
- `deploy_status {deployId}`, `rollback {function, deployId}`, `list_functions`.
|
|
47
|
+
|
|
48
|
+
## Debug loop that works
|
|
49
|
+
|
|
50
|
+
1. `deploy` → read `deploy.error` and status.
|
|
51
|
+
2. If failing at runtime: `list_invocations` → read logs.
|
|
52
|
+
3. Reproduce inside the container: `exec {command: "npm test"}` or `exec {command: "python -c '...'"}`.
|
|
53
|
+
4. Fix code locally, `deploy` again. Deploys are versioned; `rollback` restores any previous success.
|
|
54
|
+
|
|
55
|
+
## Contracts that matter
|
|
56
|
+
|
|
57
|
+
- Handlers: return JSON-serializable values; HTTP-fronted functions return `{statusCode, headers, body}`.
|
|
58
|
+
- Web apps MUST listen on `process.env.PORT` / `$PORT` (any host binding on `0.0.0.0`).
|
|
59
|
+
- Web apps get no streaming invocations (SSE) yet; use a function for streaming responses.
|
|
60
|
+
- Secrets: pass with `--set KEY=VALUE` or `--env-file`; never hardcode.
|