@faable/faable 4.5.1 → 4.5.2
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/dist/api/FaableApi.js +7 -2
- package/dist/mcp/http.js +5 -5
- package/dist/mcp/server.js +1 -0
- package/package.json +1 -1
package/dist/api/FaableApi.js
CHANGED
|
@@ -88,9 +88,14 @@ class FaableApi {
|
|
|
88
88
|
// Uniform handling for an expired/invalid session across every
|
|
89
89
|
// command, regardless of which endpoint returned the 401.
|
|
90
90
|
if (res.status === 401) {
|
|
91
|
-
|
|
91
|
+
// With an API key there is no session to renew: the key itself
|
|
92
|
+
// is wrong or was revoked (the hosted MCP server runs on keys).
|
|
93
|
+
const by_key = !!process.env.FAABLE_API_KEY && !process.env.FAABLE_TOKEN;
|
|
94
|
+
const expired = new Error(by_key
|
|
95
|
+
? 'This Faable API key is invalid or was revoked. Create a new one in the dashboard (project settings → API Keys).'
|
|
96
|
+
: 'Your Faable session has expired or is invalid. Run `faable login` to sign in again.', { cause: error });
|
|
92
97
|
expired.status = 401;
|
|
93
|
-
expired.code = 'session_expired';
|
|
98
|
+
expired.code = by_key ? 'apikey_invalid' : 'session_expired';
|
|
94
99
|
throw expired;
|
|
95
100
|
}
|
|
96
101
|
const serverMessage = res.data?.message || res.statusText || 'Unknown Error';
|
package/dist/mcp/http.js
CHANGED
|
@@ -15,14 +15,14 @@ import { TOOLS } from './tools.js';
|
|
|
15
15
|
// Streamable HTTP, stateless: every POST /mcp builds a server and a transport
|
|
16
16
|
// for that one request, so any instance can answer anything. The caller
|
|
17
17
|
// authenticates with a Faable API key (dashboard → project settings → API
|
|
18
|
-
// keys).
|
|
19
|
-
//
|
|
20
|
-
//
|
|
18
|
+
// keys). A key belongs to the project it was created in, and the api holds it
|
|
19
|
+
// there (api 2.199.2, backlog §302): it never acts as its owner nor reaches
|
|
20
|
+
// another project. Each tool call runs the CLI as a child
|
|
21
21
|
// with THAT key in its environment and an empty HOME of its own — two
|
|
22
22
|
// callers' credentials never meet in one process, and the key is never
|
|
23
23
|
// logged.
|
|
24
24
|
//
|
|
25
|
-
// POST /mcp
|
|
25
|
+
// POST /mcp the key's project
|
|
26
26
|
// POST /mcp/<project> pinned to one project (id, name or slug)
|
|
27
27
|
// ?mode=write also the reversible writes
|
|
28
28
|
// ?readonly=1 reads only — not even deploy_app
|
|
@@ -151,7 +151,7 @@ const llms_txt = (base = PUBLIC_URL) => [
|
|
|
151
151
|
'',
|
|
152
152
|
'> Connects Claude, Cursor and any MCP client to Faable Deploy: read apps, deployments, build and runtime logs, traffic and domains, and deploy — without leaving the editor.',
|
|
153
153
|
'',
|
|
154
|
-
`Endpoint: ${base}/mcp (Streamable HTTP). Authenticate with a Faable API key: \`Authorization: Bearer <key>\` (create one in the dashboard, project settings → API keys). The key
|
|
154
|
+
`Endpoint: ${base}/mcp (Streamable HTTP). Authenticate with a Faable API key: \`Authorization: Bearer <key>\` (create one in the dashboard, project settings → API keys). The key belongs to one project and only acts there.`,
|
|
155
155
|
'',
|
|
156
156
|
`- \`${base}/mcp/<project>\` pins every call to one project.`,
|
|
157
157
|
'- `?mode=write` adds the reversible writes (create apps, set secrets, add domains, retry or cancel builds, change deploy settings). Nothing destructive is exposed.',
|
package/dist/mcp/server.js
CHANGED
|
@@ -32,6 +32,7 @@ const NEXT_STEP = {
|
|
|
32
32
|
session_expired: 'The Faable session expired. Ask the user to run `faable login` in a terminal, then retry.',
|
|
33
33
|
account_suspended: 'This Faable account is suspended; the user should contact support@faable.com.',
|
|
34
34
|
apikey_session: 'The user is logged in with an API key; this needs `faable login` without --apikey.',
|
|
35
|
+
apikey_invalid: 'The API key this server was given is invalid or was revoked. The user needs a new one from the dashboard (project settings → API Keys).',
|
|
35
36
|
not_found: 'Check the id or name — list_apps / list_deployments show what exists.',
|
|
36
37
|
forbidden: 'This session has no access there — check the project (list_projects).',
|
|
37
38
|
app_required: 'Pass `app` (id, name or slug).',
|