@plitzi/sdk-mcp 0.38.21 → 0.38.23

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/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # @plitzi/sdk-mcp
2
2
 
3
+ ## 0.38.23
4
+
5
+ ### Patch Changes
6
+
7
+ - 1e93ac7: ## Server
8
+
9
+ - **The project's server sends OAuth providers back to its loopback** (`@plitzi/sdk-server`) — PZ-160. 0.38.22 chose
10
+ `publicUrl`, which without `PUBLIC_URL` is the machine's address on the network: a private IP the router may change and
11
+ providers refuse, so a project opened to the network could no longer connect a new account. The callback origin is now
12
+ `127.0.0.1` unless `PUBLIC_URL` is HTTPS, and `serverOptions.functions.oauth.callbackOrigin` names another without
13
+ touching `PUBLIC_URL`. Open to the network with a loopback callback, the server says that a sign-in another device
14
+ starts needs a name of its own.
15
+
16
+ - Updated dependencies [1e93ac7]
17
+ - @plitzi/plitzi-sdk@0.38.23
18
+ - @plitzi/sdk-server@0.38.23
19
+ - @plitzi/sdk-authoring@0.38.23
20
+ - @plitzi/sdk-schema@0.38.23
21
+ - @plitzi/sdk-shared@0.38.23
22
+ - @plitzi/sdk-style@0.38.23
23
+
24
+ ## 0.38.22
25
+
26
+ ### Patch Changes
27
+
28
+ - 19fbc45: ## Server
29
+
30
+ - **`ctx.oauth`, after a project moved onto it** (`@plitzi/sdk-server`, `@plitzi/sdk-shared`) — PZ-155..158.
31
+ `functions.oauth.callbackOrigin` fixes the one address providers send a visitor back to, on a server of one space
32
+ reached on several: `serveProject` sets it to the address people reach it on, or its loopback `127.0.0.1` when that is
33
+ plain HTTP (providers refuse `http` past loopback, and `localhost`), and prints it as it starts; the callback then sends
34
+ the visitor on to `returnTo` on the address they started from — its `location` is absolute now. `connect(name,
35
+ { returnTo, authorizeParams })` adds to the connection's parameters for one consent (`prompt: 'select_account'`), and
36
+ refuses one the platform writes. `ctx.fetch` and `ctx.oauth.fetch` take `init.signal`: in the sandbox and a runtime the
37
+ request is numbered and the code's `abort` cuts it on the platform. `ActionRefusal` takes `{ code }`; `ctx.oauth`
38
+ refuses with `oauth-not-connected` and `oauth-no-owner`.
39
+ - **A refusal of the platform's stays one across the sandbox** (`@plitzi/sdk-server`). A call answered with an
40
+ `ActionRefusal` crossed the isolate, the runner service and a runtime as a plain error: caught, the code could not tell
41
+ it apart; uncaught, a route answered 500 `This route failed` instead of 400 and the reason. The answer carries
42
+ `refused` and `code` now, and the code catches the refusal it was thrown.
43
+
44
+ - Updated dependencies [19fbc45]
45
+ - @plitzi/plitzi-sdk@0.38.22
46
+ - @plitzi/sdk-server@0.38.22
47
+ - @plitzi/sdk-authoring@0.38.22
48
+ - @plitzi/sdk-schema@0.38.22
49
+ - @plitzi/sdk-shared@0.38.22
50
+ - @plitzi/sdk-style@0.38.22
51
+
3
52
  ## 0.38.21
4
53
 
5
54
  ### Patch Changes
@@ -770,7 +770,19 @@ any other (\`<namespace>.<action>\`), listed in \`plitzi://actions/{env}/tasks\`
770
770
  \`allow.hosts\` names (\`*.example.com\` for subdomains), \`ctx.publish/grant/revoke\` (channels),
771
771
  \`ctx.data("products.json")\` (one file of the space's data, parsed — never imported), \`ctx.log\`, \`ctx.user\` (who
772
772
  asked, never their session). A secret is NAMED, never read: \`ctx.fetch(url, { credential: "stripe",
773
- headers: { authorization: "Bearer {{ credential.apiKey }}" } })\`.
773
+ headers: { authorization: "Bearer {{ credential.apiKey }}" } })\`. \`signal\` in the init cuts a slow request short
774
+ (\`AbortSignal.timeout(12000)\`).
775
+ - **Refuse with \`ActionRefusal\`** (from \`@plitzi/sdk-server/functions\`): its message is written for whoever asked and
776
+ reaches them (\`{{ step.error }}\`, a route's \`400 { error }\`); anything else thrown stays in the run's record.
777
+ \`new ActionRefusal(message, { code })\` names it for code that catches it — compare \`error.code\`, never the message.
778
+ - **An API on behalf of a visitor** (their calendar, their music) is an OAuth connection declared as data:
779
+ \`defineFunctions({ oauth: { calendar: { issuer, credential, scopes } } })\` — \`issuer\` for OpenID, or
780
+ \`authorizeUrl\`/\`tokenUrl\`; the credential holds the app's \`clientId\`/\`clientSecret\`. A route redirects to
781
+ \`(await ctx.oauth.connect("calendar", { returnTo: "/settings" })).url\` (\`authorizeParams\` adds to that one consent:
782
+ \`{ prompt: "select_account" }\`), and \`ctx.oauth.fetch("calendar", url)\` calls the API with the token written in;
783
+ \`status\`, \`disconnect\` beside them. The platform keeps the token sealed and renews it — never put one in \`kv\`. The
784
+ user registers \`/fn/oauth/callback\` on the space's host with the provider. Not connected yet is a refusal with
785
+ \`code: "oauth-not-connected"\`. \`token\` hands the access token only to a connection declaring \`exposeToken: true\`.
774
786
  - **Stateless:** nothing a function keeps in memory outlives the call — a module-level cache or counter starts empty
775
787
  every time, on whichever instance runs it. What must last goes in \`ctx.kv\`. A call gets 100 ms of CPU and 10 s;
776
788
  a task that needs more says so — \`limits: { cpuMs: 1000, wallMs: 20000 }\`, or \`defineFunctions({ limits })\` for
@@ -73,7 +73,7 @@ var createMcpServer = async ({ adapters, getGrant, preview, screenshot, logger,
73
73
  const getSpace = () => spacePromise ??= loadSpace();
74
74
  const server = new McpServer({
75
75
  name: "plitzi-mcp",
76
- version: "0.38.21"
76
+ version: "0.38.23"
77
77
  }, { instructions: hasSpace ? serverInstructions : widgetsOnlyInstructions });
78
78
  const { getChanges } = adapters;
79
79
  registerResources(server, getSpace, MCP_ENV, log, hasSpace, getChanges ? (query) => getChanges(requireSpaceId(), MCP_ENV, query) : void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-mcp",
3
- "version": "0.38.21",
3
+ "version": "0.38.23",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist",
@@ -41,12 +41,12 @@
41
41
  "dependencies": {
42
42
  "@modelcontextprotocol/ext-apps": "^1.7.5",
43
43
  "@modelcontextprotocol/sdk": "^1.32.1",
44
- "@plitzi/plitzi-sdk": "0.38.21",
45
- "@plitzi/sdk-authoring": "0.38.21",
46
- "@plitzi/sdk-schema": "0.38.21",
47
- "@plitzi/sdk-server": "0.38.21",
48
- "@plitzi/sdk-shared": "0.38.21",
49
- "@plitzi/sdk-style": "0.38.21",
44
+ "@plitzi/plitzi-sdk": "0.38.23",
45
+ "@plitzi/sdk-authoring": "0.38.23",
46
+ "@plitzi/sdk-schema": "0.38.23",
47
+ "@plitzi/sdk-server": "0.38.23",
48
+ "@plitzi/sdk-shared": "0.38.23",
49
+ "@plitzi/sdk-style": "0.38.23",
50
50
  "ejs": "^7.0.2",
51
51
  "esbuild": "^0.28.2",
52
52
  "zod": "^4.6.7"