@plitzi/sdk-mcp 0.38.21 → 0.38.22

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,33 @@
1
1
  # @plitzi/sdk-mcp
2
2
 
3
+ ## 0.38.22
4
+
5
+ ### Patch Changes
6
+
7
+ - 19fbc45: ## Server
8
+
9
+ - **`ctx.oauth`, after a project moved onto it** (`@plitzi/sdk-server`, `@plitzi/sdk-shared`) — PZ-155..158.
10
+ `functions.oauth.callbackOrigin` fixes the one address providers send a visitor back to, on a server of one space
11
+ reached on several: `serveProject` sets it to the address people reach it on, or its loopback `127.0.0.1` when that is
12
+ plain HTTP (providers refuse `http` past loopback, and `localhost`), and prints it as it starts; the callback then sends
13
+ the visitor on to `returnTo` on the address they started from — its `location` is absolute now. `connect(name,
14
+ { returnTo, authorizeParams })` adds to the connection's parameters for one consent (`prompt: 'select_account'`), and
15
+ refuses one the platform writes. `ctx.fetch` and `ctx.oauth.fetch` take `init.signal`: in the sandbox and a runtime the
16
+ request is numbered and the code's `abort` cuts it on the platform. `ActionRefusal` takes `{ code }`; `ctx.oauth`
17
+ refuses with `oauth-not-connected` and `oauth-no-owner`.
18
+ - **A refusal of the platform's stays one across the sandbox** (`@plitzi/sdk-server`). A call answered with an
19
+ `ActionRefusal` crossed the isolate, the runner service and a runtime as a plain error: caught, the code could not tell
20
+ it apart; uncaught, a route answered 500 `This route failed` instead of 400 and the reason. The answer carries
21
+ `refused` and `code` now, and the code catches the refusal it was thrown.
22
+
23
+ - Updated dependencies [19fbc45]
24
+ - @plitzi/plitzi-sdk@0.38.22
25
+ - @plitzi/sdk-server@0.38.22
26
+ - @plitzi/sdk-authoring@0.38.22
27
+ - @plitzi/sdk-schema@0.38.22
28
+ - @plitzi/sdk-shared@0.38.22
29
+ - @plitzi/sdk-style@0.38.22
30
+
3
31
  ## 0.38.21
4
32
 
5
33
  ### 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.22"
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.22",
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.22",
45
+ "@plitzi/sdk-authoring": "0.38.22",
46
+ "@plitzi/sdk-schema": "0.38.22",
47
+ "@plitzi/sdk-server": "0.38.22",
48
+ "@plitzi/sdk-shared": "0.38.22",
49
+ "@plitzi/sdk-style": "0.38.22",
50
50
  "ejs": "^7.0.2",
51
51
  "esbuild": "^0.28.2",
52
52
  "zod": "^4.6.7"