@engenty/wizards-runtime 0.17.0 → 0.17.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.
Files changed (149) hide show
  1. package/apps/runtime/dist/app.js +2 -0
  2. package/apps/runtime/dist/broker/account.js +20 -1
  3. package/apps/runtime/dist/broker/call.js +116 -20
  4. package/apps/runtime/dist/broker/host.js +8 -2
  5. package/apps/runtime/dist/broker/index.js +3 -2
  6. package/apps/runtime/dist/broker/log.js +149 -14
  7. package/apps/runtime/dist/broker/over.js +38 -0
  8. package/apps/runtime/dist/broker/rights.js +192 -0
  9. package/apps/runtime/dist/broker/rwx.js +295 -51
  10. package/apps/runtime/dist/broker/send.js +25 -12
  11. package/apps/runtime/dist/bundles/discover.js +133 -0
  12. package/apps/runtime/dist/bundles/fetch.js +119 -0
  13. package/apps/runtime/dist/bundles/index.js +621 -0
  14. package/apps/runtime/dist/bundles/read.js +607 -0
  15. package/apps/runtime/dist/connectors/external.js +540 -61
  16. package/apps/runtime/dist/connectors/person-sign-ins.js +1 -0
  17. package/apps/runtime/dist/connectors/reload.js +73 -0
  18. package/apps/runtime/dist/connectors/space-connections.js +73 -6
  19. package/apps/runtime/dist/db/migrations/tenant/0058_mcp_state_across_roles.sql +26 -0
  20. package/apps/runtime/dist/db/migrations/tenant/0059_space_connection_paused.sql +2 -0
  21. package/apps/runtime/dist/db/migrations/tenant/0060_space_bundle.sql +21 -0
  22. package/apps/runtime/dist/db/migrations/tenant/0061_space_connection_limits.sql +2 -0
  23. package/apps/runtime/dist/db/migrations/tenant/meta/0058_snapshot.json +6696 -0
  24. package/apps/runtime/dist/db/migrations/tenant/meta/0059_snapshot.json +6710 -0
  25. package/apps/runtime/dist/db/migrations/tenant/meta/0060_snapshot.json +6857 -0
  26. package/apps/runtime/dist/db/migrations/tenant/meta/0061_snapshot.json +6871 -0
  27. package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +28 -0
  28. package/apps/runtime/dist/db/schema.js +81 -3
  29. package/apps/runtime/dist/docs/dev/broker.md +312 -32
  30. package/apps/runtime/dist/docs/dev/skills.md +8 -1
  31. package/apps/runtime/dist/docs/user-guide/capabilities.md +127 -5
  32. package/apps/runtime/dist/docs/user-guide/connectors.md +103 -5
  33. package/apps/runtime/dist/docs/user-guide/protocol.md +15 -4
  34. package/apps/runtime/dist/docs/user-guide/skills.md +11 -1
  35. package/apps/runtime/dist/docs/user-guide/test-and-share.md +1 -1
  36. package/apps/runtime/dist/elements/caller.js +2 -2
  37. package/apps/runtime/dist/engenty/connections-external/build-connector.js +23 -8
  38. package/apps/runtime/dist/engenty/connections-external/import-service.js +18 -9
  39. package/apps/runtime/dist/engenty/connections-external/importer/classify.js +12 -0
  40. package/apps/runtime/dist/engenty/connections-external/invoke/http-invoker.js +1 -0
  41. package/apps/runtime/dist/engenty/connections-external/net/guarded-fetch.js +6 -3
  42. package/apps/runtime/dist/engenty/connections-sdk/oauth2.js +2 -2
  43. package/apps/runtime/dist/engenty/shims/web-ingest.js +64 -0
  44. package/apps/runtime/dist/engine/resources.js +15 -6
  45. package/apps/runtime/dist/engine/runner.js +2 -1
  46. package/apps/runtime/dist/env.js +2 -0
  47. package/apps/runtime/dist/index.js +11 -2
  48. package/apps/runtime/dist/mcp/handler.js +2 -2
  49. package/apps/runtime/dist/mcp/seen.js +71 -51
  50. package/apps/runtime/dist/mcp/tools.js +5 -1
  51. package/apps/runtime/dist/prompts/mcp.md +1 -1
  52. package/apps/runtime/dist/prompts/tools.md +16 -0
  53. package/apps/runtime/dist/routes/broker.js +1 -1
  54. package/apps/runtime/dist/routes/bundles.js +91 -0
  55. package/apps/runtime/dist/routes/connections.js +14 -3
  56. package/apps/runtime/dist/routes/discover.js +1 -0
  57. package/apps/runtime/dist/routes/rules.js +53 -9
  58. package/apps/runtime/dist/routes/studio.js +23 -18
  59. package/apps/runtime/dist/services/cloud.js +2 -0
  60. package/apps/runtime/dist/services/discover.js +9 -3
  61. package/apps/runtime/dist/services/draft-events.js +79 -6
  62. package/apps/runtime/dist/services/files.js +2 -2
  63. package/apps/runtime/dist/services/skills.js +61 -5
  64. package/apps/runtime/dist/services/space-index.js +113 -11
  65. package/apps/runtime/dist/services/synced-spaces.js +5 -1
  66. package/apps/runtime/dist/services/wizards.js +48 -2
  67. package/apps/runtime/dist/sharing/jobs.js +6 -2
  68. package/apps/runtime/dist/sync/records.js +6 -1
  69. package/apps/runtime/dist/texts.js +36 -1
  70. package/apps/runtime/dist/tools/connections.js +8 -0
  71. package/apps/runtime/dist/tools/connector.js +13 -1
  72. package/apps/runtime/dist/tools/index.js +8 -3
  73. package/apps/runtime/dist/tools/skills.js +11 -1
  74. package/apps/web/dist/assets/{AboutDialog-B2Xmxyj4.js → AboutDialog-NzB-GEj_.js} +1 -1
  75. package/apps/web/dist/assets/{BlockEditor-D0HoUSih.js → BlockEditor-HyDf8fOb.js} +1 -1
  76. package/apps/web/dist/assets/Bundle-B0Bhs0By.js +1 -0
  77. package/apps/web/dist/assets/CapabilitiesPage-CQSaMsWK.js +2 -0
  78. package/apps/web/dist/assets/{ChangelogDialog-BIrJbAKi.js → ChangelogDialog-Ngxuqubx.js} +1 -1
  79. package/apps/web/dist/assets/{CodeEditor-DUVcXI5P.js → CodeEditor-C2LBf4pS.js} +1 -1
  80. package/apps/web/dist/assets/EditorPage-Dysvvadu.js +3 -0
  81. package/apps/web/dist/assets/{FlowPreview-BIag8_Be.js → FlowPreview-CGfSaeYu.js} +1 -1
  82. package/apps/web/dist/assets/LangSwitch-B7UQlGh5.js +1 -0
  83. package/apps/web/dist/assets/Marketplace-BkIxd1PW.js +2 -0
  84. package/apps/web/dist/assets/{NewWizardChannels-DI3SQ4iS.js → NewWizardChannels-BWLaVFld.js} +1 -1
  85. package/apps/web/dist/assets/NewWizardPage-BpRd8tDF.js +7 -0
  86. package/apps/web/dist/assets/OnboardingPage-ScEcQcR0.js +1 -0
  87. package/apps/web/dist/assets/PreviewPane-CaC1FYxZ.js +7 -0
  88. package/apps/web/dist/assets/ProtocolSection-CILRCYLD.js +1 -0
  89. package/apps/web/dist/assets/PublicRunner-DHX431Pr.js +1 -0
  90. package/apps/web/dist/assets/{ReadOnly-CWf5x74a.js → ReadOnly-DqS1UDQs.js} +1 -1
  91. package/apps/web/dist/assets/SettingsPage-Dp2-rHXu.js +2 -0
  92. package/apps/web/dist/assets/SetupPage-mzMLQcD5.js +1 -0
  93. package/apps/web/dist/assets/SharePage-CBDgqEH7.js +1 -0
  94. package/apps/web/dist/assets/SkillEditor-Cf6FqkkU.js +1 -0
  95. package/apps/web/dist/assets/{Skills-CN4QE7Kx.js → Skills-DqV5Oqqu.js} +5 -5
  96. package/apps/web/dist/assets/SpacePage-C3SXe2hs.js +2 -0
  97. package/apps/web/dist/assets/{UpdateCheck-QhBI3rlQ.js → UpdateCheck-B51jMIhp.js} +2 -2
  98. package/apps/web/dist/assets/brand-CG35IRgr.js +2 -0
  99. package/apps/web/dist/assets/changelog-DN6sziTl.js +1 -0
  100. package/apps/web/dist/assets/{code-editor-DkPo1C-L.js → code-editor-Bsyy7cuT.js} +2 -2
  101. package/apps/web/dist/assets/{host-D6H6Z9Jp.js → host-DaDyLfqT.js} +16 -16
  102. package/apps/web/dist/assets/i18n-CyrHWeGk.js +55 -0
  103. package/apps/web/dist/assets/index-Db9JthZr.css +1 -0
  104. package/apps/web/dist/assets/index-LjwVRoki.js +10 -0
  105. package/apps/web/dist/assets/minus-BpYkOkYw.js +1 -0
  106. package/apps/web/dist/assets/plug-De3mHDFV.js +1 -0
  107. package/apps/web/dist/assets/{read-aloud-CnFwDSGD.js → read-aloud-DCTouK7J.js} +1 -1
  108. package/apps/web/dist/assets/{runners-0sTPbWzr.js → runners-DtiBHvG7.js} +1 -1
  109. package/apps/web/dist/assets/session-DKGZUy6h.js +1 -0
  110. package/apps/web/dist/assets/{theme-CkNTe-_Z.js → theme-Bcj8TXQr.js} +2 -2
  111. package/apps/web/dist/assets/{ui-DAk_vjrL.js → ui-C6vSmisV.js} +1 -1
  112. package/apps/web/dist/assets/{useMutation-isHfB33W.js → useMutation-B8hJ5Z6N.js} +1 -1
  113. package/apps/web/dist/assets/{viewers-ijNZHJFG.js → viewers-b9FdC42r.js} +2 -2
  114. package/apps/web/dist/assets/{volume-2-BqlBtCIJ.js → volume-2-B1roRk6x.js} +1 -1
  115. package/apps/web/dist/index.html +15 -13
  116. package/apps/web/dist/mcp/flow.html +2 -2
  117. package/node_modules/@engenty/wizards-shared/dist/bundles.d.ts +219 -0
  118. package/node_modules/@engenty/wizards-shared/dist/bundles.js +19 -0
  119. package/node_modules/@engenty/wizards-shared/dist/connectors.d.ts +105 -4
  120. package/node_modules/@engenty/wizards-shared/dist/connectors.js +6 -0
  121. package/node_modules/@engenty/wizards-shared/dist/discover.d.ts +28 -1
  122. package/node_modules/@engenty/wizards-shared/dist/run.d.ts +8 -0
  123. package/node_modules/@engenty/wizards-shared/dist/run.js +16 -0
  124. package/node_modules/@engenty/wizards-shared/dist/rwx.d.ts +84 -1
  125. package/node_modules/@engenty/wizards-shared/dist/rwx.js +69 -1
  126. package/node_modules/@engenty/wizards-shared/dist/skills.d.ts +20 -3
  127. package/node_modules/@engenty/wizards-shared/dist/skills.js +5 -2
  128. package/package.json +1 -1
  129. package/plugin/.claude-plugin/plugin.json +1 -1
  130. package/plugin/plugin.json +1 -1
  131. package/apps/web/dist/assets/CapabilitiesPage-C1th2cZE.js +0 -2
  132. package/apps/web/dist/assets/EditorPage-56sIqEfF.js +0 -3
  133. package/apps/web/dist/assets/LangSwitch-CJ00IgaO.js +0 -1
  134. package/apps/web/dist/assets/Marketplace-D7-ot9Dz.js +0 -2
  135. package/apps/web/dist/assets/NewWizardPage-CytheHxX.js +0 -7
  136. package/apps/web/dist/assets/OnboardingPage-_91Pa8Ad.js +0 -1
  137. package/apps/web/dist/assets/PreviewPane-BDsYm-_K.js +0 -7
  138. package/apps/web/dist/assets/ProtocolSection-D_zaxHEL.js +0 -1
  139. package/apps/web/dist/assets/PublicRunner-CEgXSk3r.js +0 -1
  140. package/apps/web/dist/assets/SettingsPage-Dr8SDk-L.js +0 -2
  141. package/apps/web/dist/assets/SetupPage-B68n0l4I.js +0 -1
  142. package/apps/web/dist/assets/SharePage-DfznN7ar.js +0 -1
  143. package/apps/web/dist/assets/SkillEditor-BIcIczRc.js +0 -1
  144. package/apps/web/dist/assets/SpacePage-DiVTwhnJ.js +0 -2
  145. package/apps/web/dist/assets/changelog-a_CuplMX.js +0 -1
  146. package/apps/web/dist/assets/i18n-BaPKbQ1s.js +0 -55
  147. package/apps/web/dist/assets/index-CCUG6Vnh.css +0 -1
  148. package/apps/web/dist/assets/index-De0Wb42y.js +0 -10
  149. package/apps/web/dist/assets/session-BMiUrqHg.js +0 -2
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: The broker
3
3
  description: The one path every connector call takes in engenty wizards – who calls, what decides, what a run may reach, what is logged and heard, the RWX rules and the routes the studio uses.
4
- version: 0.16.2
4
+ version: 0.17.1
5
5
  ---
6
6
 
7
7
  Every call a wizard step, a Work chat, Goose, a share target or a plugin makes to a connected
@@ -49,6 +49,7 @@ interface Where {
49
49
  spaceId?: string;
50
50
  mode?: "test" | "live";
51
51
  guest?: boolean; // a live run nobody signed in for
52
+ share?: boolean; // a share job: the one caller of a run that is done
52
53
  }
53
54
  ```
54
55
 
@@ -69,6 +70,15 @@ whose id or summary says send, mail, message, post or notify, and not draft, upd
69
70
  is a `send`. A caller may name the kind itself, as the mail tools, the share targets and
70
71
  `http_request` do.
71
72
 
73
+ An admin’s word comes before that guess. `PATCH /spaces/:id/connectors/:connectorId/actions`
74
+ keeps, per action of an imported connector, a kind and for a `send` the input field that holds
75
+ the recipient (`action_kinds` on the stored record, `body.to` for a field inside an HTTP body).
76
+ `groupIn` (`classify.ts`) reads it first, so the connector’s action carries the admin’s group and
77
+ `kindOf` returns the admin’s kind everywhere: in `brokerCall`, in the run’s grant and in „Was
78
+ darf …?“. The named field reaches the broker as the action’s `recipientField`. Reloading the
79
+ actions keeps both. A changed kind is logged like a changed rule (`change_rules`), once for every
80
+ connection on that connector.
81
+
72
82
  ## Connections
73
83
 
74
84
  `BrokerConnection` is one of two:
@@ -84,6 +94,76 @@ A space connection holds its `audience` (`admins`, `members` or `all`), its `rul
84
94
  decides the audience. A fixed step is in the audience of whom its run is held for, and Goose for
85
95
  an admin counts as an admin.
86
96
 
97
+ A space connection can pause: `paused_at` and `paused_by` on its row, set by
98
+ `pauseSpaceConnection` (`POST /connections/:id/pause` and `/resume`, admins only). While it pauses
99
+ the broker refuses every call through it. Nothing else changes: the sign-ins, the rules and the
100
+ audience stay.
101
+
102
+ A space connection can limit its calls: `calls_per_run` and `calls_per_day` on its row, both empty
103
+ on a new one, set with `PATCH /connections/:id` (admins only). See
104
+ [A connection’s limits](#a-connections-limits).
105
+
106
+ ## A stop that holds
107
+
108
+ Two things are asked before anything else, on every call. Neither trusts what a step or a chat
109
+ turn read when it started.
110
+
111
+ **The run.** `runOver(where)` in `broker/over.ts` reads `run.status` for `where.runId`. A run that
112
+ is `cancelled`, `done` or `failed` calls nothing more, whatever the connection: a space
113
+ connection, a wizard’s own, a host, the server’s mail, a kept secret. All four paths ask it first
114
+ (`brokerCall`, `brokerHost`, `brokerSend`, `brokerSecret`), refuse with `run_ended` and log the
115
+ call with the rule `run.<status>`. There is no separate revoke: stopping a run (`cancel()` in
116
+ `engine/runner.ts`, `POST /api/runs/:id/cancel`, MCP `control_run`, “Stop run” in the Audit) is
117
+ the revoke. Three things to know:
118
+
119
+ - A call already under way finishes. The broker refuses the next call and does not take back what
120
+ has left.
121
+ - A share job is the one caller of a run that is done. `sharing/jobs.ts` sets `where.share`, and
122
+ the share agent’s step and the run’s browser carry it. With `share` a `done` run calls, a
123
+ `cancelled` or `failed` one does not.
124
+ - A run this tenant does not have is not refused here. The grant refuses it for a wizard’s own
125
+ connection and for a bound host (`not_in_grant`).
126
+
127
+ **The pause.** For a space connection `brokerCall` reads `paused_at` again on every call
128
+ (`stateOf` in `broker/account.ts`, which reads the limits with it) and puts it on the row before
129
+ `decide` sees it. So a step whose
130
+ tools hold the row from before the pause is refused at its next call, and so is a chat turn. A
131
+ connection that was removed since is refused the same way, as `not_connected`. The account is not
132
+ read and no token is renewed for a call that is refused here.
133
+
134
+ ## A connection’s limits
135
+
136
+ A space connection takes at most `calls_per_run` calls from one run and `calls_per_day` calls a
137
+ day. Empty means no limit, and a new connection has both empty. They count for every caller: an
138
+ admin, a member, a guest, an AI step, a fixed step, Goose, a plugin’s own job. A wizard’s own
139
+ connection has none.
140
+
141
+ - **What counts.** A call the broker lets through to the service, whatever comes of it: one that
142
+ fails counts, and one still under way. A call that is refused, one that waits for an approval
143
+ and a changed rule count for nothing. `counted()` in `broker/log.ts` says so in one place, from
144
+ the lines of `broker_log`: there is no counter beside the log.
145
+ - **Per run** counts the lines of that connection with the call’s `run_id`. A call with no run (a
146
+ Work chat, Goose, a plugin’s job) is bound by the day only.
147
+ - **Per day** counts the connection’s lines since midnight UTC (`startOfToday`), runs, chats and
148
+ jobs together.
149
+ - **One write.** A call that would run takes its place first: `takePlace` writes the call’s line
150
+ with one `INSERT … SELECT … WHERE` whose condition is the count. Of two calls at once only one
151
+ gets the last place, in whichever process they run. The line has no `result` while the action
152
+ runs, and `closeLine` fills in `result`, `duration_ms` and `result_size` at its end. These are
153
+ the only rows of `broker_log` that are written twice. A connection without a limit keeps
154
+ writing its line once, at the end.
155
+ - **Read at the call.** The limits come from `stateOf` with the pause, so a changed limit binds a
156
+ step or a chat turn that read the row before.
157
+ - **Past a limit** the call is refused as `calls_per_run` or `calls_per_day`, with the rule
158
+ `limits.run` or `limits.day`, and the action does not run. Where the limits cannot be counted
159
+ (the database fails), `takePlace` throws and the call does not run either.
160
+ - **A guest’s mails keep their numbers.** `guestSendCheck` runs before, with `run_limit` and
161
+ `day_limit`. A connection’s limits come on top, under their own names.
162
+
163
+ `spaceConnectionViews` adds `callsPerRun`, `callsPerDay` and `callsToday` (`callsToday` in
164
+ `broker/log.ts`) to each view. A changed limit is logged with `logRuleChange`; its input is the one
165
+ field `limits` (`calls per run: none → 20`), which is how the Audit tells it from other changes.
166
+
87
167
  ## `decide`
88
168
 
89
169
  `decide({ who, where, connection, actionId, kind, grant })` is pure: it reads nothing and runs
@@ -93,6 +173,8 @@ admins `admins: true`. The checks run in this order:
93
173
 
94
174
  1. **The grant.** A wizard’s own connection in a run, outside the run’s grant: deny, rule `grant`.
95
175
  2. **A space connection:**
176
+ - a connection that pauses: deny, rule and refusal `paused`, for every caller and before a
177
+ plugin’s own job;
96
178
  - a plugin’s own job on a connection it set up, outside any run or chat: allow, `own_job`;
97
179
  - a caller outside the audience: deny, `audience`;
98
180
  - an action the connection is not for: deny, `actions`;
@@ -112,29 +194,36 @@ brokerCall({ who, where, connection, action: { id, kind? }, input, ctx?, handler
112
194
  → { ok: true, result, account } | { ok: false, refused, reason }
113
195
  ```
114
196
 
115
- ![brokerCall reads the account, checks the grant, decides, checks a guest’s send and asks where it must, then runs the action. Each check can refuse, and every call goes to broker_log](../../assets/diagrams/broker-order.svg)
197
+ ![brokerCall asks whether the run is over and whether the connection pauses, reads the account, checks the grant, decides, checks a guest’s send, asks where it must and takes the call’s place under a space connection’s limits, then runs the action. Each check can refuse, and every call goes to broker_log](../../assets/diagrams/broker-order.svg)
116
198
 
117
199
  In order, it:
118
200
 
119
- 1. reads the account. A sign-in that ran out and can’t be renewed is logged as `sign_in_failed`
201
+ 1. refuses a call of a run that is over (`runOver`, above): `run_ended`;
202
+ 2. reads a space connection’s pause and limits again and refuses a paused one (`paused`), and one
203
+ that was removed (`not_connected`);
204
+ 3. reads the account. A sign-in that ran out and can’t be renewed is logged as `sign_in_failed`
120
205
  and refused as `not_connected`;
121
- 2. checks the grant where one binds the call (`grantBinds`: a wizard’s own connection, in a run,
206
+ 4. checks the grant where one binds the call (`grantBinds`: a wizard’s own connection, in a run,
122
207
  and not a share target’s connection);
123
- 3. refuses a missing account (`not_connected`) or an unknown action (`no_action`);
124
- 4. asks `decide`. A deny returns its refusal;
125
- 5. checks a guest’s send (`guestSendCheck`, below);
126
- 6. on an ask of the admins, runs only with `ctx.approved`. Otherwise it refuses with
208
+ 5. refuses a missing account (`not_connected`) or an unknown action (`no_action`);
209
+ 6. asks `decide`. A deny returns its refusal;
210
+ 7. checks a guest’s send (`guestSendCheck`, below);
211
+ 8. on an ask of the admins, runs only with `ctx.approved`. Otherwise it refuses with
127
212
  `needs_approval`, and the caller holds the call (a Work chat in `chat_approval`, under the bell);
128
- 7. on an ask of the person, runs when `ctx.allowed` holds `<connection>:<action>` (“for the rest of
213
+ 9. on an ask of the person, runs when `ctx.allowed` holds `<connection>:<action>` (“for the rest of
129
214
  the run”) or `ctx.confirmed` is set and the call deletes nothing. Otherwise it calls `ctx.ask`.
130
215
  With no one to ask it refuses with `nobody`, and on a no with `declined`;
131
- 8. runs the action (the connector’s handler, or `handler`), marks the space connection used and
132
- logs the call. An error the action throws is logged and thrown on. A 401 or a lost OAuth grant
133
- is logged as `sign_in_failed`.
216
+ 10. takes the call’s place under a space connection’s limits (`takePlace`, above). With none left
217
+ it refuses with `calls_per_run` or `calls_per_day`;
218
+ 11. runs the action (the connector’s handler, or `handler`), marks the space connection used and
219
+ logs the call. An error the action throws is logged and thrown on. A 401 or a lost OAuth grant
220
+ is logged as `sign_in_failed`.
134
221
 
135
222
  `brokerConnected(connection, who)` says whether and as whom a connection is signed in, without the
136
223
  secret. `brokerSecret` reads a run’s kept secret that is no connection (the browser’s kept
137
- sign-ins) through the same log.
224
+ sign-ins) through the same log. It answers `{ ok: true, result }`, or for a run that is over
225
+ `{ ok: false, refused: "run_ended" }`. Then its handler does not run, and the run’s browser opens
226
+ signed in nowhere.
138
227
 
139
228
  ### Refusals
140
229
 
@@ -155,6 +244,35 @@ has words for each:
155
244
  | `channel_not_fixed` | A guest’s post to a channel that the published step does not fix |
156
245
  | `run_limit` | A guest’s run has sent its mails and posts (`GUEST_MAILS_PER_RUN`, 3) |
157
246
  | `day_limit` | The wizard’s guests have sent today’s mails and posts (`wizard.dailyMailLimit`, 50 unless set) |
247
+ | `calls_per_run` | The run has made the calls the space connection takes from one run |
248
+ | `calls_per_day` | The space connection has taken today’s calls |
249
+ | `run_ended` | The call’s run was stopped, is done or failed. The rule says which: `run.cancelled`, `run.done`, `run.failed` |
250
+ | `paused` | An admin paused the space connection |
251
+
252
+ The model reads each refusal in words from `prompts/tools.md`, through `refusalNote`
253
+ (`tools/connector.ts`) and `connectionRefusalNote` (`tools/connections.ts`): `note.run_ended` and
254
+ `note.connector_paused` for these two, `note.connector_calls_per_run` and
255
+ `note.connector_calls_per_day` for a connection’s limits. A fixed step that a limit refuses fails
256
+ with a note of its own (`stepCallsPerRun`, `stepCallsPerDay`). A share job reaches a space
257
+ connection only through its agent’s tools, so it reads the model’s note. A plugin’s call throws
258
+ the broker’s reason.
259
+
260
+ A connection’s limits have refusals of their own, apart from `run_limit` and `day_limit`. Four
261
+ readers word a refusal (the Audit, a model, a fixed step, the Audit’s filter by result), and three
262
+ of them see the refusal alone, not the rule beside it. With one name for both, a model would be
263
+ told of mails where a connection’s calls ran out.
264
+
265
+ ### A fixed step that would wait
266
+
267
+ „Mit Freigabe“ holds a call only in a Work chat. In a run nothing waits: a fixed step whose call
268
+ asks the space’s admins gets `needs_approval` and fails. `stepWarnings(spaceId, draft)` in
269
+ `services/wizards.ts` finds these steps before a run does. For each fixed step on a space
270
+ connection it asks `decide` as the step of an admin’s run, and warns where the answer is an ask of
271
+ the admins. It reads the rule as it is, so the warning is gone once the rule says *Erlaubt*. A
272
+ read, a rule on *Nie*, a paused connection and a wizard’s own connection never warn. The warnings
273
+ are `StepWarning[]` (shared) on the wizard’s state and on the answer of `PUT /wizards/:id/draft`,
274
+ beside `issues`. They are no issue: the draft saves and publishes. The editor words them in
275
+ `apps/web/src/studio/editor/step-warnings.ts`.
158
276
 
159
277
  ## The run’s grant
160
278
 
@@ -189,6 +307,8 @@ once from the run’s definition and writes it. `inGrant` always lets `list_tool
189
307
  - `brokerHost` (`broker/host.ts`) runs `http_request`. It logs the call as connection
190
308
  `host:<name>`, action `http_request`, kind `send`. A guest’s run reaches only the hosts in its
191
309
  grant. A member’s run reaches any public host, until the `broker` switch is on.
310
+ - `brokerHost` and `brokerSend` (the server’s own mail, `mail:server`) ask `runOver` first, like
311
+ `brokerCall`: a run that is over reaches no host and sends no mail.
192
312
  - `guestSendCheck` (`broker/send.ts`) lets a guest’s send go only to an address a page field of
193
313
  kind `email` collected in the run, or to the space’s `mailDomains`. It holds a connection’s
194
314
  send action as well as the email share target.
@@ -199,8 +319,11 @@ once from the run’s definition and writes it. `inGrant` always lets `list_tool
199
319
  decides it. Everything else is refused as `channel_not_fixed`: a templated channel, even
200
320
  where it renders to the same id, and the guest’s own call from an AI step or the Slack share
201
321
  target.
322
+ - `recipientsOf(input, field)` reads a send’s addresses from `to`, `cc`, `bcc`, `recipients` and
323
+ `recipient`, and from the field an admin named for the action (`recipientField`). The named
324
+ field comes on top of the others, never in their place: an address in `cc` still counts.
202
325
  - Any other send that names no address is refused as `not_allowed_recipient`. That holds an
203
- imported connector’s send: nothing says which of its inputs names where it goes.
326
+ imported connector’s send until an admin names the field with the recipient.
204
327
  - The limits count mails and posts together, per run and per wizard and day. They count what
205
328
  `broker_log` holds as an `ok` send of a guest (`who_kind` `guest`) or of a fixed step in a
206
329
  guest’s run (`who_kind` `step`), and no request to a host.
@@ -214,7 +337,9 @@ once from the run’s definition and writes it. `inGrant` always lets `list_tool
214
337
  `input_summary`, `outcome`, `rule`, `reason`, `result`, `result_size`, `critical` and
215
338
  `critical_kind`. `summarizeInput` keeps the input’s field names and sizes, one clipped value whose
216
339
  field name doesn’t look like a secret, and a SHA-256 of the whole. No token, key, password or body
217
- is ever written. A log that can’t be written never stops the call.
340
+ is ever written. A log that can’t be written never stops the call. The one exception is a call
341
+ through a space connection with a limit: its line is how it takes its place, so it is written
342
+ before the action runs and filled in after ([A connection’s limits](#a-connections-limits)).
218
343
 
219
344
  Admins read the whole log of a space. A member reads their own lines, where the space’s Studio is
220
345
  open to members (`services/members-studio.ts`). `ownLines(userId)` in `broker/log.ts` says which
@@ -241,10 +366,19 @@ member’s own call: the input’s summary, the outcome, the rule, the reason an
241
366
  | `refused_write` | A change, delete or send was refused |
242
367
  | `outside_audience` | A guest’s call was refused by a connection’s audience |
243
368
  | `host_not_in_grant` | `http_request` to a host the grant doesn’t include |
244
- | `limit_reached` | `run_limit` or `day_limit` |
369
+ | `limit_reached` | `run_limit` or `day_limit`, each time. `calls_per_run` or `calls_per_day`, the first time in that run or on that day |
245
370
  | `sign_in_failed` | A sign-in ran out, or the service refused it |
246
371
  | `first_use` | A space connection’s first call that ran |
247
- | `rule_changed` | An admin changed RWX rules, or a connection’s rules, audience or way of signing in (`logRuleChange`) |
372
+ | `rule_changed` | An admin changed RWX rules, or a connection’s rules, audience, limits or way of signing in, or paused or resumed a connection (`logRuleChange`) |
373
+
374
+ A call that a paused connection refuses is not critical, whatever its kind. The admins paused it
375
+ themselves and heard of that, and the hourly mail about critical lines may go through that very
376
+ connection. A refused call of a run that is over follows the rule above: critical where it wanted
377
+ to change, delete or send.
378
+
379
+ A connection’s limit is heard of once per run or day: the first call it refuses is critical, the
380
+ ones after it are refused and logged (`limitHeard`). A model that tries again, and the hourly mail
381
+ going through that connection, add no further critical lines.
248
382
 
249
383
  A critical row goes four ways:
250
384
 
@@ -266,21 +400,76 @@ registering. A new tool that calls a service registers there.
266
400
 
267
401
  ## RWX and the `broker` switch
268
402
 
269
- `broker/rwx.ts` keeps one table of permissions per space (`rwx_rule`): a subject (`guest`,
270
- `person`, `role`, `goose`, `wizard`, `plugin`), a resource (`document`, `table`, `page`,
271
- `connection`, `mail`, `host`, `sandbox`, with an id or `*`), and `r`, `w`, `x` each `allow`,
272
- `deny` or unset.
403
+ `broker/rwx.ts` keeps one table of permissions per space (`rwx_rule`): a subject, a resource (a
404
+ kind with an id, or `*` for all of the kind), and `r`, `w`, `x` each `allow`, `deny` or unset.
405
+
406
+ | Subject | Id | Who it is |
407
+ |---|---|---|
408
+ | `guest` | none | Someone at a shared link or a public page |
409
+ | `role` | `member`, `admin`, `owner`, `client` | Everyone with that role in the organization |
410
+ | `person` | The user’s id | One person |
411
+ | `goose` | The user’s id | Goose working for that person |
412
+ | `agent` | none | An AI working for a person: a Work chat, a client’s chat, Claude or Codex through MCP |
413
+ | `wizard` | The wizard’s id, or `*` | A run of that wizard |
414
+ | `plugin` | The plugin’s id | A plugin, beside whom it was called for |
273
415
 
274
416
  - Unset means deny, and a deny wins over every allow.
417
+ - A rule on a page of Wissen holds for what lies in it: its deny closes the folder, its allow
418
+ opens it (`withFolders`). The document behind a page or a table is asked as well.
275
419
  - Every space starts with a seed: owners and admins read, write and execute, members read and
276
- write, guests read.
277
- - Readers ask today for `document`, `table` and `page` (`ENFORCED`): the knowledge readers, and
278
- search filters its hits by `r`. The other resource kinds wait for their reader.
420
+ write, guests read. It holds flags no reader asks yet, so a later reader starts from them.
279
421
 
280
422
  All of this is behind the `broker` switch, on by default. With it off, `decide`, `readable` and
281
423
  `assertRwx` in `rwx.ts` say yes to everything, the rules routes answer 404, and a member’s
282
424
  `http_request` reaches any public host. On, the seed changes nothing until an admin
283
- writes a deny. No studio page draws the rules yet.
425
+ writes a deny.
426
+
427
+ ### What is asked
428
+
429
+ `RWX_ASKED` in `packages/shared/src/rwx.ts` is the one table of what a reader asks today: per
430
+ kind of resource and permission, the kinds of subject it is asked for. The runtime refuses a rule
431
+ outside it (`refusalOf`), and the studio offers nothing else.
432
+
433
+ | Resource | Perm | Asked for | By |
434
+ |---|---|---|---|
435
+ | `document` | `r` | every subject | Every reader of Knowledge; a plugin’s `files` and `readFile` |
436
+ | `page` | `r` | every subject | Every reader of Knowledge; a plugin’s `readPages` |
437
+ | `page` | `w` | `person`, `role`, `goose` | Goose’s `write_knowledge_page` |
438
+ | `table` | `r` | every subject but `plugin` | The readers of Knowledge and Daten, shared lists |
439
+ | `wizard` | `r`, `x` | `person`, `role`, `agent` | `wizard_list` and `wizard_run` in a Work chat and for outside clients; the client portal |
440
+ | `skill` | `r` | every subject but `plugin` | `skill_list`, `skill_load`, `skill_read` |
441
+ | `skill` | `x` | `guest`, `person`, `role`, `wizard`, `agent` | A skill’s scripts placed in a sandbox |
442
+ | `setup` | `w` | `person`, `role`, `goose` | Goose’s writes to the space’s setup |
443
+ | `mount` | `r` | every subject but `plugin` | `readableMounts` |
444
+ | `mount` | `w` | `person`, `role`, `agent` | A draft and „Veröffentlichen“ (`mounts/drafts.ts`) |
445
+
446
+ Nothing asks a rule on `connection`, `mail`, `host` or `sandbox`: a connection’s own audience and
447
+ rules decide (`broker/call.ts`), and a run’s grant decides hosts. Nothing asks `w` or `x` on a
448
+ document or a table, `x` on a page, `w` on a wizard or a skill, or `r` on the setup. What only
449
+ Goose asks (`w` on a page and on the setup) is not asked for the role `client`, who reaches no
450
+ studio.
451
+
452
+ Some of it is narrower than the kind suggests. `w` on a page and on the setup is asked where
453
+ Goose writes; a person changing them in the studio is not asked. `r` and `x` on a wizard are
454
+ asked for the AI’s tools and the client portal; a guest at a wizard’s link and a person starting
455
+ one in Work or the studio are not asked. A reader that starts asking adds its line to `RWX_ASKED`,
456
+ and `test/rwx-rules.test.ts` holds the table against `ENFORCED`.
457
+
458
+ ### Who writes rules
459
+
460
+ | Writer | What it writes | `origin` in the list |
461
+ |---|---|---|
462
+ | The seed (`seedRwx`), and Rechte for a role | A role’s or the guests’ rule on `*` of an enforced kind | `start` |
463
+ | „Wer sieht diesen Ordner“ (`setFolderAudience`) | On a page of Wissen: the team or the guests closed, the clients let in | `folder` |
464
+ | A mount’s form (`mountRules`) | Every rule on a mount | `mount` |
465
+ | „Für Kund:innen sichtbar“ (`setOpenToClients`) | The clients’ read on a document, a table or a wizard | `clients` |
466
+ | Rechte (`addRule`, `changeRule`, `deleteRule`) | Every other rule | `rights` |
467
+
468
+ `originOf` in `broker/rights.ts` reads the origin off the rule, with no column for it. A place
469
+ that shows a rule also replaces it, so a rule in the folder dialog’s shape is the dialog’s whoever
470
+ wrote the row. The rules routes add, change and remove one rule at a time and never touch
471
+ another. They refuse a rule on a mount: its form reads the rules back as its switches and replaces
472
+ them all.
284
473
 
285
474
  Every reader takes its subjects from whoever it serves: the studio’s person (`whoOf(c)`), a
286
475
  run’s holder and wizard (`subjectsOf(ctx)`, `runHolder(run)`), Goose for its person. What a step
@@ -310,18 +499,108 @@ All under `/api/studio`, for a signed-in person of the organization.
310
499
 
311
500
  | Route | What it does | Who |
312
501
  |---|---|---|
313
- | `GET /spaces/:id/connections` | The space’s connections, each with who set it up and, where a plugin holds it, the plugin (`plugin`, `pluginName`). `reachedByGuests` (shared) says which ones guests reach: `audience: "all"` and `signIn: "space"` | Everyone; a member sees the ones in their audience |
502
+ | `GET /spaces/:id/connections` | The space’s connections, each with who set it up and, where a plugin holds it, the plugin (`plugin`, `pluginName`). `reachedByGuests` (shared) says which ones guests reach: `audience: "all"` and `signIn: "space"`. `callsPerRun` and `callsPerDay` are its limits (null: none), `callsToday` the calls it took today | Everyone; a member sees the ones in their audience |
314
503
  | `POST /spaces/:id/connections` | Sets one up: connector, name, `signIn`, `audience`. `signIn: "person"` answers `403 { code: "plan" }` where the plan’s switch `personSignIn` is off | Admins |
315
- | `PATCH /connections/:id`, `DELETE /connections/:id` | Changes its name, `signIn`, audience, rules or the actions it is for, or removes it. A changed `signIn` forgets the sign-ins of the way it leaves; to `person` it answers `403 { code: "plan" }` without `personSignIn`, and `400` on a plugin’s connection | Admins |
504
+ | `PATCH /connections/:id`, `DELETE /connections/:id` | Changes its name, `signIn`, audience, rules, limits (`callsPerRun`, `callsPerDay`: a whole number from 1, or null for none) or the actions it is for, or removes it. A changed `signIn` forgets the sign-ins of the way it leaves; to `person` it answers `403 { code: "plan" }` without `personSignIn`, and `400` on a plugin’s connection | Admins |
505
+ | `POST /connections/:id/pause`, `POST /connections/:id/resume` | Pauses the connection, or resumes it. The view carries `pausedAt` and `pausedByName`. Logged as a changed rule | Admins |
316
506
  | `POST`, `DELETE /connections/:id/sign-in` | Signs the space in or out: `{ credentials }`, or `{ oauth: true }` for a sign-in page | Admins |
317
507
  | `POST`, `DELETE /connections/:id/my-sign-in` | The person’s own sign-in, where each person signs in | Everyone in the audience |
318
508
  | `GET /person/sign-ins` | The person’s connections across their spaces | The person |
319
- | `GET /spaces/:id/rules`, `PUT /spaces/:id/rules`, `DELETE /spaces/:id/rules/:ruleId` | The RWX rules, saved as a whole list | Admins; 404 while `broker` is off |
509
+ | `GET /spaces/:id/rules` | The RWX rules, each with its `origin` and the names of who and what it is about (`subjectName`, `resourceName`, `folder`) | Admins; 404 while `broker` is off |
510
+ | `POST /spaces/:id/rules` | Adds one rule: `subjectKind`, `subjectId`, `resourceKind`, `resourceId`, `r`, `w`, `x`. `400` with the reason for a rule no reader asks, one on a mount, one about a resource the space does not have, and a second rule about the same subject and resource | Admins; 404 while `broker` is off |
511
+ | `PATCH /spaces/:id/rules/:ruleId` | Sets the flags it names (`null` takes one away), and leaves the others. A flag set here is checked against `RWX_ASKED`; a rule left without a flag is refused | Admins; 404 while `broker` is off |
512
+ | `DELETE /spaces/:id/rules/:ruleId` | Removes one rule | Admins; 404 while `broker` is off |
513
+ | `GET /spaces/:id/rules/ask?who=&id=&for=&resource=&resourceId=&perm=` | „Was darf …?“ for content: `who` is `guest`, `person`, `goose`, `agent`, `wizard` (`for`: the person its run is held for, else a guest) or `plugin` (its own job); `resource` is `document`, `page`, `table`, `wizard`, `skill` or `setup`. Answers `{ ok, rule, reason }` by `decideWith`, as the readers decide. `400` for what no reader asks. Nothing is read, run or logged | Admins; 404 while `broker` is off |
514
+ | `GET /spaces/:id/rules/choices` | The people, wizards, plugins, documents, pages, tables and skills a rule can name | Admins; 404 while `broker` is off |
320
515
  | `GET /spaces/:id/broker/log` | The log, newest first. Filters: `connection`, `who`, `outcome`, `result`, `refused`, `critical`, `since`, `until`, `q`; `cursor` with the `next` of the page before, `limit` | Admins: every line. A member: their own lines (`ownLines`); 403 where the space’s Studio is closed to members |
321
- | `GET /spaces/:id/broker/log/:line` | One line, with the run’s grant | Admins. A member: their own line; 404 for another person’s |
516
+ | `GET /spaces/:id/broker/log/:line` | One line, with the run’s grant and status. The Audit’s “Stop run” reads the status and calls `POST /api/runs/:id/cancel` | Admins. A member: their own line; 404 for another person’s |
322
517
  | `GET /spaces/:id/broker/ask?who=&for=&resource=&action=&in=` | „Was darf …?“: `decide`’s outcome, rule and reason. A guest’s post to a channel is answered as the call is: a fixed step gets the connection’s rule and the condition in its reason, any other caller `deny` by `guest_send`. Nothing runs and nothing is logged | Admins (403 for a member) |
323
518
  | `GET /spaces/:id/broker/choices` | The people and the space’s connections with their actions, for the question | Admins (403 for a member) |
324
- | `GET /spaces/:id/discover?q=` | Skills from skills.sh and connectors from integrations.sh, marked where the space has them | Everyone; 404 while `capabilities` is off |
519
+ | `GET /spaces/:id/discover?q=` | Skills from skills.sh and connectors from integrations.sh, marked where the space has them. `bundles` names each repository among the skills that is a plugin with a server over http, with the hits it stands for (`covers`) | Everyone; 404 while `capabilities` is off |
520
+ | `POST /spaces/:id/connectors/preview` | Reads an address before it is imported: `{ sourceUrl, sourceKind?, signIn? }`. Answers what is there (`mcp` or `openapi`), each action with its guessed kind and input fields, the sign-in the source describes, the id and tool prefix its host suggests, and `privateAddress` | Admins of a space that can be changed here |
521
+ | `POST /spaces/:id/connectors` | Imports a connector. For a pasted address `domain`, `id` and `toolPrefix` may be left out, `signIn` is the admin’s choice (`described`, `header` with a name, `none`) and `actionKinds` what single actions do | Admins |
522
+ | `POST /spaces/:id/connectors/:connectorId/refresh` | „Aktionen neu laden“: reads the source again, with the sign-in of a signed-in connection on that connector. The broker reads the sign-in, so it is logged as `list_tools` | Admins |
523
+ | `PATCH /spaces/:id/connectors/:connectorId/actions` | What single actions do: `{ actions: { <id>: { kind, recipientField? } \| null } }`; `null` takes one back to the guess | Admins |
524
+ | `POST /spaces/:id/bundles/preview` | Reads a plugin for Claude Code or Cursor: `{ address, path?, servers? }`, or a form with `file` and the rest as JSON in `options`. Answers `{ preview, plugins }`: the name and version, each server over http as an address is read, the skills, what is left out, and a `hash`; `plugins` where the repository holds several | Admins of a space that can be changed here |
525
+ | `POST /spaces/:id/bundles` | Takes it: the same source, `hash`, `servers` (per server’s name: `take`, `id`, `toolPrefix`, `name`, `signIn`, `actionKinds`), `skills` (the folders to take). Answers the bundle, the connectors and warnings | Admins |
526
+ | `GET /spaces/:id/bundles` | What came together, each with its connectors, connections and skills | Admins |
527
+ | `GET /bundles/:id/update`, `POST /bundles/:id/update` | What the origin has now (`update`, or `upload: true` for one from a file), and taking it: `{ hash }`, or a form with the new `file` | Admins |
528
+ | `GET /bundles/:id/removal`, `DELETE /bundles/:id` | What removing takes and the wizards that use its connections, and removing all of it | Admins |
529
+
530
+ ### A connector from an address
531
+
532
+ A connector whose record has no `registry_surface_slug` came from a pasted address
533
+ (`connectors/external.ts`). Its view says `fromAddress`, the studio marks it „nicht geprüft“, and
534
+ a new connection on it defaults to the audience `admins`.
535
+
536
+ - **Sign-in.** An MCP server is asked for its tools without a sign-in. If it answers, the
537
+ connector needs none. If it answers 401, its own OAuth documents are read (`probeOAuth`: the
538
+ protected-resource document, then the authorization server’s metadata). Otherwise the import
539
+ takes the admin’s choice: a key in a header, stored as `api_key` with a header placement, or
540
+ none. An OpenAPI description says it in its security schemes. An import that can work out no
541
+ sign-in and got no choice refuses with a sentence that names the choices.
542
+ - **Private addresses.** `createGuardedFetch({ allowPrivate: true })` lets loopback and private
543
+ hosts pass and still refuses link-local ones. Only a connector from an address gets it, and only
544
+ on a runtime that is not managed (`reachesPrivate`). It is decided at every request and stored
545
+ nowhere, so the same record on a managed runtime stays behind the guard. On a managed runtime
546
+ the preview and the import refuse a private address with `connectorPrivateAddress`.
547
+ - **Token calls.** An imported connector’s code exchange, refresh and client registration go
548
+ through the same guarded fetch (`ConnectorOAuth2Config.fetchImpl`).
549
+ - **A server without SSE.** A server that answers 401 to streamable HTTP and 405 to the SSE try
550
+ loses its 401 on the way. Where its own OAuth documents are there, it is read as one that wants
551
+ a sign-in: its tools come once an account is connected.
552
+
553
+ ### A connector that brings skills
554
+
555
+ A plugin for Claude Code or Cursor, taken into a space (`apps/runtime/src/bundles/`). The studio
556
+ has no word for it: it shows a connector with its skills. The record is a `space_bundle`.
557
+
558
+ - **Reading** (`read.ts`). The source is a zip: a public repository’s archive from
559
+ `codeload.github.com` through the guarded fetch (`fetch.ts`), or an uploaded `.zip` or `.plugin`.
560
+ At most 60 MB and 50,000 files; a manifest or MCP file at most 1 MB; a skill’s files under the
561
+ limits of an uploaded skill. Read are `.claude-plugin/plugin.json` (optional), `.mcp.json` and
562
+ the manifest’s `mcpServers`, `skills/` and the manifest’s `skills`; for Cursor
563
+ `.cursor-plugin/plugin.json`, `mcp.json`, and a `plugin.json` at the root. A `marketplace.json`
564
+ lists the plugins of a repository that holds several: the preview answers with them, and `path`
565
+ or `…/tree/<branch>/<folder>` names one.
566
+ - **Taken.** Each server over http (`type` `http`, `streamable-http`, `sse`, or a `url` without a
567
+ type) goes through `importConnector` with the bundle’s id. Its headers with a fixed value are
568
+ kept as the record’s `required_headers`. A header that holds a key (`Bearer ${TOKEN}`) becomes
569
+ the sign-in where the server describes none. The connector is from an address: „nicht geprüft“,
570
+ admins first, a private address only on a runtime that is not managed. Each skill becomes a
571
+ `space_skill` with `source: "plugin"`, `origin` its folder in the plugin, `mode: "demand"`,
572
+ scripts off.
573
+ - **Left out, and named** (`leftOut`): commands, agents, hooks, Cursor rules, and servers with a
574
+ `reason`: `stdio`, `socket`, `noAddress`, `variable` (an address with `${…}` and no default),
575
+ `file` (an MCP bundle), `address`, `refused` (with the words in `detail`), `count`. A skill
576
+ whose `SKILL.md` cannot be read is left out as `invalid`.
577
+ - **The record.** `space_bundle` holds the name, version, format, origin (`github` with
578
+ repository, branch and folder, or `upload` with the file’s name), a hash of what was taken, and
579
+ what was left out. `bundle_id` is on `space_skill`, `space_connector` and `space_connection`; a
580
+ connection gets it from its connector when it is set up. `space_connection.plugin` is something
581
+ else: an engenty plugin that set a connection up.
582
+ - **Skills and no server, a server and no skills.** Skills alone come as skills with a bundle that
583
+ has no connector. A server alone comes as a connector with a bundle. Neither is refused.
584
+ - **Read only.** `PATCH /skills/:id` refuses a change to the content of a bundle’s skill, and
585
+ `DELETE` refuses it. `mode` and `runScripts` change. A copy is `own` and has no bundle.
586
+ - **The link.** A skill’s view names its bundle and the bundle’s connectors (`SkillSummary.bundle`),
587
+ a connector’s view its bundle (`ConnectorView.bundle`). `skill_load` tells the step which
588
+ connector the skill came with and what its tools’ names start with. `allowed-tools` is not read.
589
+ - **Update.** The origin is read again and its hash compared. Taken are skills that are new,
590
+ changed or gone, and new servers. A skill that changed keeps its name, `mode` and `runScripts`.
591
+ Connectors, connections and sign-ins are not touched. A connector whose server the origin no
592
+ longer names leaves the bundle (`bundle_id` null) and stays: no sign-in is sent to an address
593
+ that changed. A new server that cannot be imported as it stands is named in `notTaken`.
594
+ - **Removal.** `DELETE /bundles/:id` removes the connections on the bundle’s connectors, the
595
+ connectors, the skills and the record in one transaction.
596
+ - **Entdecken.** For up to six repositories among a search’s skills, the manifest and the MCP file
597
+ at the root are read from `raw.githubusercontent.com` (`bundles/discover.ts`,
598
+ `GITHUB_RAW_URL` for tests) and kept for an hour.
599
+
600
+ Not built: private repositories and hosts other than github.com; npm, archive and command
601
+ sources of a marketplace; a plugin’s `userConfig` and its `oauth.clientId`; moving a connector to
602
+ a changed address; a branch name with a slash in `…/tree/<branch>/<folder>`; the bundle’s record
603
+ in the sync of a local space.
325
604
 
326
605
  ## Not built
327
606
 
@@ -334,8 +613,9 @@ All under `/api/studio`, for a signed-in person of the organization.
334
613
  plans. The Manage-App’s Free plan doesn’t name it `false` yet, so every plan has it.
335
614
  - **The Manage-App’s side of the report.** The runtime posts to `POST /v1/broker/:tenant`, and the
336
615
  Manage-App has no endpoint for it yet.
337
- - **More of RWX.** No page in the studio draws the rules, and connections, mail, hosts and the
338
- sandbox have no reader that asks RWX. `space_search` still says how many items pass its
616
+ - **More of RWX.** Connections, mail, hosts and the sandbox have no reader that asks RWX, and
617
+ the runtime refuses a rule on them. A person changing a page, a table or the setup in the
618
+ studio, and a person or a guest starting a wizard, are not asked either. `space_search` still says how many items pass its
339
619
  `where` (`filtered`) without asking who reads, and what a plugin makes of pages it read in a
340
620
  job (the shop’s products) is the plugin’s own data: the rules don’t follow it.
341
621
  - A webhook for critical rows, a choice per kind of what notifies, and one connection offered to
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: Skills
3
3
  description: The skills of a space – the SKILL.md engenty wizards reads, its limits, the studio’s routes, the two tools a step reads skills with and how their scripts run in the sandbox.
4
- version: 0.13.0
4
+ version: 0.17.1
5
5
  ---
6
6
 
7
7
  A space’s skills are instructions in the Agent Skills format that its AI steps follow. They sit
@@ -114,6 +114,13 @@ Under `/api/studio`, signed in as for the studio:
114
114
  `mode` is `always`, `demand` or `off`. A skill from skills.sh changes its `mode` and
115
115
  `runScripts` only. Its content changes with an update. An upload takes up to 32 MB.
116
116
 
117
+ `source` is `own`, `upload`, `skills.sh` or `plugin`. A skill with the source `plugin` came with
118
+ a connector, from a plugin for Claude Code or Cursor
119
+ ([A connector that brings skills](./broker.md#a-connector-that-brings-skills)). Its view names
120
+ what it came with (`bundle`: the plugin’s name and its connectors). It changes its `mode` and
121
+ `runScripts` only, `DELETE` refuses it, and `skill_load` answers with a `connector` line: which
122
+ connector it came with and what that connector’s tools start with.
123
+
117
124
  ## skills.sh
118
125
 
119
126
  The runtime searches `https://skills.sh/api/search` and reads a skill from