@engenty/wizards-runtime 0.14.2 → 0.15.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/apps/runtime/dist/agents/studio-assistant.js +50 -3
- package/apps/runtime/dist/app.js +9 -2
- package/apps/runtime/dist/broker/call.js +2 -0
- package/apps/runtime/dist/broker/host.js +1 -0
- package/apps/runtime/dist/broker/rwx.js +38 -4
- package/apps/runtime/dist/db/migrations/tenant/0040_rwx_elements.sql +21 -0
- package/apps/runtime/dist/db/migrations/tenant/0041_broker_log_client.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0040_snapshot.json +5153 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0041_snapshot.json +5160 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +14 -0
- package/apps/runtime/dist/db/schema.js +2 -0
- package/apps/runtime/dist/docs/dev/api.md +24 -2
- package/apps/runtime/dist/docs/dev/architecture.md +13 -2
- package/apps/runtime/dist/elements/caller.js +45 -0
- package/apps/runtime/dist/elements/catalogue.js +14 -0
- package/apps/runtime/dist/elements/connections.js +60 -0
- package/apps/runtime/dist/elements/gate.js +81 -0
- package/apps/runtime/dist/elements/knowledge.js +139 -0
- package/apps/runtime/dist/elements/outside.js +103 -0
- package/apps/runtime/dist/elements/specs.js +102 -0
- package/apps/runtime/dist/elements/wizards.js +59 -0
- package/apps/runtime/dist/env.js +5 -2
- package/apps/runtime/dist/mcp/elements.js +88 -0
- package/apps/runtime/dist/mcp/handler.js +2 -0
- package/apps/runtime/dist/mcp/scopes.js +5 -0
- package/apps/runtime/dist/prompts/authoring.md +2 -2
- package/apps/runtime/dist/prompts/tools.md +3 -0
- package/apps/runtime/dist/routes/api.js +2 -2
- package/apps/runtime/dist/routes/elements.js +76 -0
- package/apps/runtime/dist/services/work-ai.js +27 -19
- package/apps/runtime/dist/services/work-connections.js +2 -2
- package/apps/runtime/dist/tools/index.js +5 -4
- package/apps/runtime/dist/tools/skills.js +80 -54
- package/apps/runtime/dist/tools/space.js +8 -152
- package/apps/web/dist/assets/{AboutDialog-Cag3RJuT.js → AboutDialog-DaWEIHFN.js} +1 -1
- package/apps/web/dist/assets/{CapabilitiesPage-BQYiN0gT.js → CapabilitiesPage-Dt91U_sK.js} +2 -2
- package/apps/web/dist/assets/{ChangelogDialog-D_dQOMIq.js → ChangelogDialog-Do7pwmFv.js} +1 -1
- package/apps/web/dist/assets/{CodeEditor-nxoOt8ge.js → CodeEditor-Cdox-51M.js} +1 -1
- package/apps/web/dist/assets/{EditorPage-C4_8LsQN.js → EditorPage-DS_a5K3s.js} +1 -1
- package/apps/web/dist/assets/{FlowPreview-aMfwcPul.js → FlowPreview-BPS86xzA.js} +1 -1
- package/apps/web/dist/assets/{LangSwitch-DpD0inR4.js → LangSwitch-BRHbi_Sd.js} +1 -1
- package/apps/web/dist/assets/{Marketplace-CpzD9pNQ.js → Marketplace-CS7JTgiv.js} +2 -2
- package/apps/web/dist/assets/{NewWizardChannels-CcE3UMVb.js → NewWizardChannels-D-OLsex6.js} +1 -1
- package/apps/web/dist/assets/{NewWizardPage-BzN7zrQx.js → NewWizardPage-BM_pkk41.js} +1 -1
- package/apps/web/dist/assets/{OnboardingPage-ztHT01ah.js → OnboardingPage-Cpn5pubC.js} +1 -1
- package/apps/web/dist/assets/{PreviewPane-BabMbBZI.js → PreviewPane-BOk1-yO4.js} +1 -1
- package/apps/web/dist/assets/{PublicRunner-D-JmtqCi.js → PublicRunner-CgzMZb0r.js} +1 -1
- package/apps/web/dist/assets/{ReadOnly-GAORKKqV.js → ReadOnly-8DEx-ly3.js} +1 -1
- package/apps/web/dist/assets/{SettingsPage-BKAiYmXl.js → SettingsPage-CcrknFcI.js} +2 -2
- package/apps/web/dist/assets/{SetupPage-C1EZZHIp.js → SetupPage-D5nzjgPU.js} +1 -1
- package/apps/web/dist/assets/{SharePage-N80EhoD7.js → SharePage-PKHX8a8a.js} +1 -1
- package/apps/web/dist/assets/{SkillEditor-CqQMg2MC.js → SkillEditor-BsXTqNli.js} +1 -1
- package/apps/web/dist/assets/{Skills-CnhpgoOA.js → Skills-C_X1ZsKg.js} +1 -1
- package/apps/web/dist/assets/{SpacePage-CRR8JvV1.js → SpacePage-wZGqUoSQ.js} +2 -2
- package/apps/web/dist/assets/{UpdateCheck-CfXZBQNv.js → UpdateCheck-D6x7MqEl.js} +2 -2
- package/apps/web/dist/assets/changelog-M-eOBqgu.js +1 -0
- package/apps/web/dist/assets/{circle-alert-C8Ma-bPY.js → circle-alert-DJbCyxcg.js} +1 -1
- package/apps/web/dist/assets/{circle-check-Bu9Z3mlJ.js → circle-check-jqtsKi_b.js} +1 -1
- package/apps/web/dist/assets/{code-editor-CfTGqOpp.js → code-editor-BpCEnf8H.js} +2 -2
- package/apps/web/dist/assets/{code-xml-B4kLFZSj.js → code-xml-q88cSTV8.js} +1 -1
- package/apps/web/dist/assets/{connection-sign-in-B2D0O8W-.js → connection-sign-in-UJ6xk-TD.js} +1 -1
- package/apps/web/dist/assets/{eye-BpoKpIdt.js → eye-CgkvVlba.js} +1 -1
- package/apps/web/dist/assets/{host-BlKXX7YK.js → host-Bd_bon_c.js} +7 -7
- package/apps/web/dist/assets/{i18n-BJ7Ld6O6.js → i18n-0fUKyVRE.js} +1 -1
- package/apps/web/dist/assets/{index-66tE1oti.js → index-DOgwxnto.js} +3 -3
- package/apps/web/dist/assets/{phone-Ctvf-Am-.js → phone-CjPvZ0nk.js} +1 -1
- package/apps/web/dist/assets/{read-aloud-Da_RSm2S.js → read-aloud-CLXo_asN.js} +1 -1
- package/apps/web/dist/assets/{runners-CyIvJIHr.js → runners-BoPaPsjN.js} +1 -1
- package/apps/web/dist/assets/{scroll-text-ChrjRu9Y.js → scroll-text-2BhJO_W7.js} +1 -1
- package/apps/web/dist/assets/{session-SXPtTWRK.js → session-CpYa5hwd.js} +1 -1
- package/apps/web/dist/assets/{theme-Br1S0j5h.js → theme-Bj3wNQR0.js} +1 -1
- package/apps/web/dist/assets/{ui-Uqnx1UpK.js → ui-CktezodE.js} +1 -1
- package/apps/web/dist/assets/{upload-BchUnQGV.js → upload-CHGCFVZK.js} +1 -1
- package/apps/web/dist/assets/{useMutation-DEkZhp5c.js → useMutation-7_FOHoEl.js} +1 -1
- package/apps/web/dist/assets/{volume-2-CU_oy81Z.js → volume-2-Bw5KASy8.js} +1 -1
- package/apps/web/dist/index.html +13 -13
- package/apps/web/dist/mcp/flow.html +1 -1
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +3 -0
- package/node_modules/@engenty/wizards-shared/dist/run.js +6 -0
- package/node_modules/@engenty/wizards-shared/dist/rwx.d.ts +1 -1
- package/node_modules/@engenty/wizards-shared/dist/rwx.js +3 -0
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/README.md +3 -0
- package/plugin/plugin.json +1 -1
- package/plugin/skills/work-in-space/SKILL.md +16 -0
- package/apps/web/dist/assets/changelog-6MqC8Vy8.js +0 -1
|
@@ -281,6 +281,20 @@
|
|
|
281
281
|
"when": 1793411368904,
|
|
282
282
|
"tag": "0039_members_studio",
|
|
283
283
|
"breakpoints": true
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"idx": 40,
|
|
287
|
+
"version": "6",
|
|
288
|
+
"when": 1793462355176,
|
|
289
|
+
"tag": "0040_rwx_elements",
|
|
290
|
+
"breakpoints": true
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"idx": 41,
|
|
294
|
+
"version": "6",
|
|
295
|
+
"when": 1793462415359,
|
|
296
|
+
"tag": "0041_broker_log_client",
|
|
297
|
+
"breakpoints": true
|
|
284
298
|
}
|
|
285
299
|
]
|
|
286
300
|
}
|
|
@@ -840,6 +840,8 @@ export const brokerLog = sqliteTable("broker_log", {
|
|
|
840
840
|
runId: text("run_id"),
|
|
841
841
|
/** The step of the run that called; null outside a step. */
|
|
842
842
|
stepId: text("step_id"),
|
|
843
|
+
/** The outside client that called, as it names itself (an MCP client, `x-wizards-client`); null inside the runtime. */
|
|
844
|
+
client: text("client"),
|
|
843
845
|
chatId: text("chat_id"),
|
|
844
846
|
wizardId: text("wizard_id"),
|
|
845
847
|
spaceId: text("space_id"),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: The API
|
|
3
3
|
description: What a program may rely on when it talks to a runtime, and what is private.
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.15.0
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
A runtime answers HTTP under `/api`. Three parts are a contract: they are versioned, documented
|
|
@@ -12,9 +12,31 @@ and change with notice. Everything else is the studio’s own and changes withou
|
|
|
12
12
|
| Part | For | Signed in as |
|
|
13
13
|
|---|---|---|
|
|
14
14
|
| `/api/v1/…` | programs that build and publish wizards: the spaces of a local install, importing a wizard | an access token of the account, with scopes (`wizards:read`, `wizards:write`, `wizards:publish`, `runs:test`); see [the Manage-App contract](https://github.com/engenty/engenty-wizards/blob/main/docs/manage-contract.md) |
|
|
15
|
-
| `/api/
|
|
15
|
+
| `/api/v1/spaces/:spaceId/elements` | programs that use a space: search its knowledge, read its skills, call its connections, run its wizards (see below) | the same tokens, with `data:read`, `elements:read`, `elements:run` |
|
|
16
|
+
| `/api/mcp` | AI apps: every tool of [the MCP server](../user-guide/ai-apps.md), the space’s elements among them | the same tokens, or the local ticket `wizards mcp` carries |
|
|
16
17
|
| The public run API: `/api/public/wizards/:token`, `/api/public/wizards/:token/runs`, `/api/public/codes/:code`, `/api/runs/:id/…` | running a published wizard by its link: what the runner in a browser does | nobody; a visitor cookie, or the `x-wizards-visitor` header where a cookie does not survive |
|
|
17
18
|
|
|
19
|
+
## A space’s elements
|
|
20
|
+
|
|
21
|
+
What Studio makes in a space – its knowledge, skills, connections and published wizards – is open
|
|
22
|
+
to programs and AI apps the way a Work chat uses it, as the person the token belongs to.
|
|
23
|
+
`GET /api/v1/spaces/:spaceId/elements` lists the calls the token may make, each with its scope
|
|
24
|
+
and its input as JSON Schema. `POST /api/v1/spaces/:spaceId/elements/:name` with
|
|
25
|
+
`{ "input": { … } }` makes one and answers `{ "result": … }`, or an error with why. The MCP
|
|
26
|
+
server has the same calls as tools, each with a `spaceId`.
|
|
27
|
+
|
|
28
|
+
| Call | Scope | Does |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| `space_search`, `space_list`, `page_read`, `table_read`, `space_document` | `data:read` | Search and read the space’s knowledge |
|
|
31
|
+
| `skill_list`, `skill_load`, `skill_read` | `elements:read` | Read the space’s skills |
|
|
32
|
+
| `connection_list`, `wizard_list` | `elements:read` | Name the connections' actions and the published wizards |
|
|
33
|
+
| `connection_call`, `wizard_run`, `run_command` | `elements:run` | Call an action, run a wizard, run a skill’s scripts in a sandbox of the space |
|
|
34
|
+
|
|
35
|
+
The space’s rules decide every call, and each is a line of the broker’s log with the client’s
|
|
36
|
+
name (`x-wizards-client`, or the MCP client’s). A space outside the token’s organization is
|
|
37
|
+
refused. A write, a send or a delete on a connection runs only where the space allows it without a
|
|
38
|
+
person’s yes.
|
|
39
|
+
|
|
18
40
|
## Private
|
|
19
41
|
|
|
20
42
|
`/api/studio/…`, `/api/auth/…` and `/api/internal/…` belong to the studio, the sign-in and the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Architecture
|
|
3
3
|
description: How engenty wizards is built – the runtime and its roles, your computer and the cloud, tenants and spaces, the engine and its sandboxes, skills, plugins, the broker and the feature switches.
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.15.0
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
engenty wizards is one server program, the **runtime**, and one web app, the **studio**, that it
|
|
@@ -28,7 +28,8 @@ and whether it takes runs.
|
|
|
28
28
|
|
|
29
29
|
| Role | Serves |
|
|
30
30
|
|---|---|
|
|
31
|
-
| `studio` | The makers’ half: sign-in, `/api/studio`, the
|
|
31
|
+
| `studio` | The makers’ half: sign-in, `/api/studio`, `/install.sh`, the studio’s pages. Until the cloud routes them to an `api` process, also what `api` serves |
|
|
32
|
+
| `api` | Outside clients: the MCP server (`/api/mcp`) and the API (`/api/v1`), the space’s elements among them, so they scale and fail apart from the studio |
|
|
32
33
|
| `doors` | The customers’ half: `/api/public`, shared results, the plugins’ public routes and webhooks, `/embed.js`, the pages `/w/<token>` and `/s/<token>` |
|
|
33
34
|
| `web` | Both halves |
|
|
34
35
|
| `runner` | Takes the runs that wait and drives them. It serves the routes too, for what only the process holding a run can answer, such as its browser’s screen |
|
|
@@ -177,6 +178,16 @@ action and writes one line of the log. Model calls don’t pass it.
|
|
|
177
178
|
|
|
178
179
|

|
|
179
180
|
|
|
181
|
+
## The tool catalogue
|
|
182
|
+
|
|
183
|
+
A space’s elements reach every AI through one list (`apps/runtime/src/elements/`): its knowledge,
|
|
184
|
+
its skills, its published wizards and, for outside clients, its connections. A wizard’s step, a
|
|
185
|
+
Work chat, Goose and the MCP and API clients take their tools from it, for a caller fixed before
|
|
186
|
+
a model sees a tool: no tool takes who calls or for whom. Every call goes through the broker’s
|
|
187
|
+
gate, which decides wizards (`x` to run), skills (`r` to read, `x` for their scripts) and a
|
|
188
|
+
space’s setup (`w`, Goose’s writes) by the RWX rules, and writes a line of the log with the
|
|
189
|
+
client’s name.
|
|
190
|
+
|
|
180
191
|
## Work mode
|
|
181
192
|
|
|
182
193
|
Work mode has chats with the space’s AI (`services/work-chats.ts`, `services/work-ai.ts`,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { whereOf, whoOf } from "../broker/call.js";
|
|
2
|
+
import { subjectsOf, subjectsOfGoose, subjectsOfPerson } from "../broker/rwx.js";
|
|
3
|
+
/** A step of a run: its holder and its wizard, in the run. */
|
|
4
|
+
export function stepCaller(ctx, sandbox = null) {
|
|
5
|
+
return {
|
|
6
|
+
space: { id: ctx.space.id, name: ctx.space.name },
|
|
7
|
+
who: whoOf(ctx.store.holder, ctx.holder.kind === "person" ? ctx.holder.role : undefined),
|
|
8
|
+
subjects: subjectsOf(ctx),
|
|
9
|
+
where: whereOf(ctx),
|
|
10
|
+
signal: ctx.signal,
|
|
11
|
+
note: (note) => ctx.emit("tool", note),
|
|
12
|
+
sandbox,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/** A signed-in person: in a Work chat, or through an outside client that signed in as them. */
|
|
16
|
+
export function personCaller(input) {
|
|
17
|
+
return {
|
|
18
|
+
space: input.space,
|
|
19
|
+
who: whoOf(`u:${input.userId}`, input.role),
|
|
20
|
+
subjects: subjectsOfPerson(input.userId, input.role),
|
|
21
|
+
where: {
|
|
22
|
+
spaceId: input.space.id,
|
|
23
|
+
...(input.chatId ? { chatId: input.chatId } : {}),
|
|
24
|
+
...(input.client ? { client: input.client } : {}),
|
|
25
|
+
},
|
|
26
|
+
signal: input.signal,
|
|
27
|
+
client: input.client,
|
|
28
|
+
sandbox: input.sandbox ?? null,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/** Goose for a person: its own rules count, and the person's. */
|
|
32
|
+
export function gooseCaller(input) {
|
|
33
|
+
return {
|
|
34
|
+
space: input.space,
|
|
35
|
+
who: {
|
|
36
|
+
kind: "goose",
|
|
37
|
+
id: input.userId,
|
|
38
|
+
admin: input.role === "owner" || input.role === "admin",
|
|
39
|
+
},
|
|
40
|
+
subjects: subjectsOfGoose(input.userId, input.role),
|
|
41
|
+
where: { spaceId: input.space.id, ...(input.chatId ? { chatId: input.chatId } : {}) },
|
|
42
|
+
signal: input.signal,
|
|
43
|
+
note: input.note,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { skillToolsOf } from "../tools/skills.js";
|
|
2
|
+
import { connectionElementTools } from "./connections.js";
|
|
3
|
+
import { knowledgeTools } from "./knowledge.js";
|
|
4
|
+
import { wizardTools } from "./wizards.js";
|
|
5
|
+
/** The element tools for the caller, by what it asks for. */
|
|
6
|
+
export async function elementTools(caller, request) {
|
|
7
|
+
return {
|
|
8
|
+
...(request.knowledge ? await knowledgeTools(caller) : {}),
|
|
9
|
+
...(request.skills ? skillToolsOf(request.skills, caller) : {}),
|
|
10
|
+
...(request.wizards ? await wizardTools(caller) : {}),
|
|
11
|
+
...(request.connections ? await connectionElementTools(caller) : {}),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export { ELEMENT_TOOL_NAMES } from "./specs.js";
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { createTool } from "@mastra/core/tools";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { chatConnectionTools } from "../services/work-connections.js";
|
|
4
|
+
import { callConnection, connectionResult } from "../tools/connections.js";
|
|
5
|
+
import { attempt } from "../tools/shared.js";
|
|
6
|
+
import { ELEMENT_SPECS } from "./specs.js";
|
|
7
|
+
/**
|
|
8
|
+
* The space's connections for an outside client (docs/plans/modular.md, phase 3): the actions the
|
|
9
|
+
* person may use, as a Work chat has them, behind two calls. Each call is the broker's
|
|
10
|
+
* (`brokerCall`), which decides it by the connection's audience and rules and writes its line
|
|
11
|
+
* with the client's name. A write, a send or a delete runs only where the rules say *Immer*: the
|
|
12
|
+
* person's yes is never taken from the client (I4), and a call that waits for the space's
|
|
13
|
+
* admins („Mit Freigabe“) is refused with why. Its secret stays in the broker (I5).
|
|
14
|
+
*/
|
|
15
|
+
const personOf = (caller) => (caller.who.kind === "person" || caller.who.kind === "admin") && caller.who.id
|
|
16
|
+
? caller.who.id
|
|
17
|
+
: null;
|
|
18
|
+
export async function connectionElementTools(caller) {
|
|
19
|
+
const userId = personOf(caller);
|
|
20
|
+
if (!userId) {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
const tools = await chatConnectionTools(caller.space.id, userId, caller.who);
|
|
24
|
+
if (!tools.length) {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
const service = (t) => `${t.row.name} (${t.connector.name})`;
|
|
28
|
+
return {
|
|
29
|
+
connection_list: createTool({
|
|
30
|
+
id: "connection_list",
|
|
31
|
+
description: ELEMENT_SPECS.connection_list.description(),
|
|
32
|
+
inputSchema: ELEMENT_SPECS.connection_list.input,
|
|
33
|
+
execute: async () => ({
|
|
34
|
+
actions: tools.map((t) => ({
|
|
35
|
+
name: t.name,
|
|
36
|
+
service: service(t),
|
|
37
|
+
does: t.action.summary || t.action.id,
|
|
38
|
+
kind: t.kind,
|
|
39
|
+
input: t.action.inputSchema
|
|
40
|
+
? z.toJSONSchema(t.action.inputSchema, { unrepresentable: "any" })
|
|
41
|
+
: {},
|
|
42
|
+
})),
|
|
43
|
+
}),
|
|
44
|
+
}),
|
|
45
|
+
connection_call: createTool({
|
|
46
|
+
id: "connection_call",
|
|
47
|
+
description: ELEMENT_SPECS.connection_call.description(),
|
|
48
|
+
inputSchema: ELEMENT_SPECS.connection_call.input,
|
|
49
|
+
execute: ({ name, input }) => attempt(async () => {
|
|
50
|
+
const tool = tools.find((t) => t.name === name);
|
|
51
|
+
if (!tool) {
|
|
52
|
+
return { error: `No action ${name}. connection_list names the ones you may use.` };
|
|
53
|
+
}
|
|
54
|
+
// No ask and no yes: a write that needs one is refused by the broker, not run.
|
|
55
|
+
const out = await callConnection(tool, caller.who, caller.where, input);
|
|
56
|
+
return connectionResult(out, service(tool));
|
|
57
|
+
}),
|
|
58
|
+
}),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { summarizeInput, writeLog } from "../broker/log.js";
|
|
2
|
+
import { decide, ENFORCED, forbidden } from "../broker/rwx.js";
|
|
3
|
+
import { attempt } from "../tools/shared.js";
|
|
4
|
+
const KIND = { r: "read", w: "write", x: "run" };
|
|
5
|
+
/** The log's name for what was called: `knowledge`, `skill:<name>`, `wizard:<id>`, `setup`. */
|
|
6
|
+
const subjectOf = (call) => call.resource ? `${call.resource.kind}:${call.resource.id}` : (call.about ?? "knowledge");
|
|
7
|
+
const sizeOf = (result) => {
|
|
8
|
+
try {
|
|
9
|
+
return JSON.stringify(result ?? null).length;
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
async function logCall(caller, call, outcome, result, started, extra = {}) {
|
|
16
|
+
await writeLog({
|
|
17
|
+
at: new Date(started),
|
|
18
|
+
durationMs: Date.now() - started,
|
|
19
|
+
whoKind: caller.who.kind,
|
|
20
|
+
whoId: caller.who.id ?? null,
|
|
21
|
+
runId: caller.where.runId ?? null,
|
|
22
|
+
stepId: caller.where.stepId ?? null,
|
|
23
|
+
chatId: caller.where.chatId ?? null,
|
|
24
|
+
wizardId: caller.where.wizardId ?? null,
|
|
25
|
+
spaceId: caller.space.id,
|
|
26
|
+
client: caller.client ?? null,
|
|
27
|
+
connectionId: subjectOf(call),
|
|
28
|
+
actionId: call.action,
|
|
29
|
+
kind: KIND[call.perm],
|
|
30
|
+
inputSummary: summarizeInput(call.input),
|
|
31
|
+
outcome,
|
|
32
|
+
rule: extra.rule ?? null,
|
|
33
|
+
reason: extra.reason ?? null,
|
|
34
|
+
result,
|
|
35
|
+
resultSize: extra.resultSize ?? null,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** Whether the caller may do `perm` on the resource, without running anything or logging. */
|
|
39
|
+
export async function mayDo(caller, resource, perm) {
|
|
40
|
+
return (await decide(caller.space.id, caller.subjects, resource, perm)).ok;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Runs `run` once the rules allow the call, and logs it either way. A refusal throws the
|
|
44
|
+
* broker's 403 (`forbidden`), which a tool hands the model as its error.
|
|
45
|
+
*/
|
|
46
|
+
export async function elementCall(caller, call, run) {
|
|
47
|
+
const started = Date.now();
|
|
48
|
+
if (call.resource && ENFORCED.includes(call.resource.kind)) {
|
|
49
|
+
const decision = await decide(caller.space.id, caller.subjects, call.resource, call.perm);
|
|
50
|
+
if (!decision.ok) {
|
|
51
|
+
await logCall(caller, call, "deny", "forbidden", started, {
|
|
52
|
+
rule: decision.rule,
|
|
53
|
+
reason: decision.reason,
|
|
54
|
+
});
|
|
55
|
+
throw forbidden(decision.of, call.perm);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
const result = await run();
|
|
60
|
+
await logCall(caller, call, "allow", "ok", started, { resultSize: sizeOf(result) });
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
const name = err?.code ?? err?.name ?? "error";
|
|
65
|
+
await logCall(caller, call, "allow", String(name).slice(0, 40), started);
|
|
66
|
+
throw err;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A tool whose every call goes through the gate: `callOf` says, from the model's input, what the
|
|
71
|
+
* call is about. A refusal comes back to the model as the tool's error.
|
|
72
|
+
*/
|
|
73
|
+
export function brokered(tool, caller, callOf) {
|
|
74
|
+
const execute = tool.execute;
|
|
75
|
+
if (!execute) {
|
|
76
|
+
return tool;
|
|
77
|
+
}
|
|
78
|
+
return Object.assign(Object.create(Object.getPrototypeOf(tool)), tool, {
|
|
79
|
+
execute: (input, ...rest) => attempt(() => elementCall(caller, callOf(input), async () => execute.call(tool, input, ...rest))),
|
|
80
|
+
});
|
|
81
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { createTool } from "@mastra/core/tools";
|
|
2
|
+
import { and, eq } from "drizzle-orm";
|
|
3
|
+
import { assertRwx } from "../broker/rwx.js";
|
|
4
|
+
import { db, schema } from "../db/client.js";
|
|
5
|
+
import { prompt } from "../prompts.js";
|
|
6
|
+
import { filePaths, knowledgeCounts, listForStep, readPage, readTable, resolvePath, } from "../services/knowledge.js";
|
|
7
|
+
import { documentText, hasIndexEntries, searchKnowledge } from "../services/space-index.js";
|
|
8
|
+
import { attempt, clip } from "../tools/shared.js";
|
|
9
|
+
import { elementCall } from "./gate.js";
|
|
10
|
+
import { ELEMENT_SPECS } from "./specs.js";
|
|
11
|
+
/**
|
|
12
|
+
* The space's Knowledge as tools of the catalogue: search it (a question, filtered by categories
|
|
13
|
+
* first, checked by a classifier after), list it by categories, read a page, a table or a file
|
|
14
|
+
* whole by its path. Hits and reads look like files — a path, front matter, Markdown or CSV — so
|
|
15
|
+
* a model reads them as it reads files. The search also finds what the space's plugins put into
|
|
16
|
+
* the index. Every read is the caller's: the broker decides each item before it is handed out
|
|
17
|
+
* (broker/rwx.ts), and each call is a line of its log (gate.ts).
|
|
18
|
+
*/
|
|
19
|
+
export { pageReadInput } from "./specs.js";
|
|
20
|
+
/** A page of Knowledge by its path, for the caller: its front matter and Markdown, in parts. */
|
|
21
|
+
export function readKnowledgePage(caller, input) {
|
|
22
|
+
return attempt(() => elementCall(caller, { action: "page_read", perm: "r", input }, async () => {
|
|
23
|
+
const read = await readPage(caller.space.id, input.path, input, caller.subjects);
|
|
24
|
+
await caller.note?.({ code: "reads", params: { name: read.path } });
|
|
25
|
+
return read;
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
/** The Knowledge tools for the caller; none where the space has no Knowledge yet. */
|
|
29
|
+
export async function knowledgeTools(caller) {
|
|
30
|
+
const spaceId = caller.space.id;
|
|
31
|
+
const who = caller.subjects;
|
|
32
|
+
const counts = await knowledgeCounts(spaceId);
|
|
33
|
+
const entries = await hasIndexEntries(spaceId);
|
|
34
|
+
if (!(counts.pages || counts.tables || counts.files || entries)) {
|
|
35
|
+
return {};
|
|
36
|
+
}
|
|
37
|
+
const call = (action, input, run) => attempt(() => elementCall(caller, { action, perm: "r", input }, run));
|
|
38
|
+
const tools = {
|
|
39
|
+
space_search: createTool({
|
|
40
|
+
id: "space_search",
|
|
41
|
+
description: prompt("tools", "tool.space_search"),
|
|
42
|
+
inputSchema: ELEMENT_SPECS.space_search.input,
|
|
43
|
+
execute: (input) => call("space_search", input, async () => {
|
|
44
|
+
const found = await searchKnowledge(spaceId, input.query, {
|
|
45
|
+
where: input.where,
|
|
46
|
+
limit: input.limit,
|
|
47
|
+
signal: caller.signal,
|
|
48
|
+
who,
|
|
49
|
+
});
|
|
50
|
+
await caller.note?.({
|
|
51
|
+
code: "searchesKnowledge",
|
|
52
|
+
params: {
|
|
53
|
+
query: input.query.slice(0, 60),
|
|
54
|
+
relevant: found.hits.length,
|
|
55
|
+
candidates: found.candidates,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
hits: found.hits.map((h) => ({
|
|
60
|
+
...(h.path ? { path: h.path } : {}),
|
|
61
|
+
...(h.open ? { open: h.open } : {}),
|
|
62
|
+
title: h.title,
|
|
63
|
+
...(h.categories.length ? { categories: h.categories } : {}),
|
|
64
|
+
...(h.heading ? { section: h.heading } : {}),
|
|
65
|
+
...(h.sheet ? { page: h.sheet } : {}),
|
|
66
|
+
...(h.relevance !== null ? { relevance: h.relevance } : {}),
|
|
67
|
+
text: clip(h.text, 1500),
|
|
68
|
+
})),
|
|
69
|
+
checked: found.checked,
|
|
70
|
+
candidates: found.candidates,
|
|
71
|
+
...(found.filtered !== null ? { filtered: found.filtered } : {}),
|
|
72
|
+
};
|
|
73
|
+
}),
|
|
74
|
+
}),
|
|
75
|
+
space_list: createTool({
|
|
76
|
+
id: "space_list",
|
|
77
|
+
description: prompt("tools", "tool.space_list"),
|
|
78
|
+
inputSchema: ELEMENT_SPECS.space_list.input,
|
|
79
|
+
execute: (input) => call("space_list", input, async () => {
|
|
80
|
+
const listed = await listForStep(spaceId, input.where, who);
|
|
81
|
+
await caller.note?.({ code: "listsKnowledge" });
|
|
82
|
+
return listed;
|
|
83
|
+
}),
|
|
84
|
+
}),
|
|
85
|
+
};
|
|
86
|
+
if (counts.pages) {
|
|
87
|
+
tools.page_read = createTool({
|
|
88
|
+
id: "page_read",
|
|
89
|
+
description: prompt("tools", "tool.page_read.knowledge"),
|
|
90
|
+
inputSchema: ELEMENT_SPECS.page_read.input,
|
|
91
|
+
execute: (input) => readKnowledgePage(caller, input),
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
if (counts.tables) {
|
|
95
|
+
tools.table_read = createTool({
|
|
96
|
+
id: "table_read",
|
|
97
|
+
description: prompt("tools", "tool.table_read"),
|
|
98
|
+
inputSchema: ELEMENT_SPECS.table_read.input,
|
|
99
|
+
execute: (input) => call("table_read", input, async () => {
|
|
100
|
+
const read = await readTable(spaceId, input.path, input, who);
|
|
101
|
+
await caller.note?.({ code: "reads", params: { name: read.path } });
|
|
102
|
+
return read;
|
|
103
|
+
}),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
if (counts.files) {
|
|
107
|
+
tools.space_document = createTool({
|
|
108
|
+
id: "space_document",
|
|
109
|
+
description: prompt("tools", "tool.space_document"),
|
|
110
|
+
inputSchema: ELEMENT_SPECS.space_document.input,
|
|
111
|
+
execute: (input) => call("space_document", input, async () => {
|
|
112
|
+
const { path, from } = input;
|
|
113
|
+
const found = await resolvePath(spaceId, path.startsWith("files/") ? path : `files/${path}`);
|
|
114
|
+
if (found?.kind !== "file") {
|
|
115
|
+
const there = [...(await filePaths(spaceId)).values()].slice(0, 40);
|
|
116
|
+
throw new Error(`No file "${path}". There are: ${there.join(", ")}`);
|
|
117
|
+
}
|
|
118
|
+
const file = await db.query.spaceFile.findFirst({
|
|
119
|
+
where: and(eq(schema.spaceFile.id, found.id), eq(schema.spaceFile.spaceId, spaceId)),
|
|
120
|
+
});
|
|
121
|
+
if (!file) {
|
|
122
|
+
throw new Error(`No file "${path}".`);
|
|
123
|
+
}
|
|
124
|
+
await assertRwx(spaceId, who, { kind: "document", id: file.id }, "r");
|
|
125
|
+
await caller.note?.({ code: "reads", params: { name: file.name } });
|
|
126
|
+
const text = (await documentText(file)) || file.description;
|
|
127
|
+
const start = Math.min(from ?? 0, text.length);
|
|
128
|
+
const part = text.slice(start, start + 12_000);
|
|
129
|
+
return {
|
|
130
|
+
path: found.path,
|
|
131
|
+
text: clip(part, 12_000),
|
|
132
|
+
next: start + part.length < text.length ? start + part.length : null,
|
|
133
|
+
length: text.length,
|
|
134
|
+
};
|
|
135
|
+
}),
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
return tools;
|
|
139
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { createTool } from "@mastra/core/tools";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { currentFeatures } from "../features.js";
|
|
4
|
+
import { sandboxCapabilities, shellToolDescription } from "../sandbox/index.js";
|
|
5
|
+
import { activeSkills } from "../services/skills.js";
|
|
6
|
+
import { defaultSpace, ownedSpace } from "../services/spaces.js";
|
|
7
|
+
import { chatSandbox } from "../services/work-sandbox.js";
|
|
8
|
+
import { clip } from "../tools/shared.js";
|
|
9
|
+
import { personCaller } from "./caller.js";
|
|
10
|
+
import { elementTools } from "./catalogue.js";
|
|
11
|
+
import { elementCall } from "./gate.js";
|
|
12
|
+
import { ELEMENT_SPECS } from "./specs.js";
|
|
13
|
+
/** `run_command` in the outside client's sandbox: only for clients that may run elements. */
|
|
14
|
+
export const RUN_COMMAND = {
|
|
15
|
+
scope: "elements:run",
|
|
16
|
+
input: z.object({ command: z.string(), timeoutSeconds: z.number().int().optional() }),
|
|
17
|
+
};
|
|
18
|
+
/** The space a call names, checked against the token; the person's first one when none. */
|
|
19
|
+
export async function outsideSpace(who, spaceId) {
|
|
20
|
+
return spaceId ? ownedSpace(who.userId, spaceId) : defaultSpace(who.userId);
|
|
21
|
+
}
|
|
22
|
+
/** The sandbox an outside client's skills run in: one per person, space and client. */
|
|
23
|
+
function outsideSandbox(who, spaceId) {
|
|
24
|
+
const caps = sandboxCapabilities();
|
|
25
|
+
if (!caps) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
const key = `outside-${who.tenantId}-${who.userId}-${spaceId}-${who.client}`.replace(/[^A-Za-z0-9_-]/g, "_");
|
|
29
|
+
return { handle: () => chatSandbox(key), workdir: caps.workdir };
|
|
30
|
+
}
|
|
31
|
+
/** The catalogue's tools for an outside caller in a space, by the token's scopes. */
|
|
32
|
+
export async function outsideTools(who, spaceId, signal) {
|
|
33
|
+
const space = await outsideSpace(who, spaceId);
|
|
34
|
+
const sandbox = who.scopes.includes("elements:run") ? outsideSandbox(who, space.id) : null;
|
|
35
|
+
const caller = personCaller({
|
|
36
|
+
space: { id: space.id, name: space.name },
|
|
37
|
+
userId: who.userId,
|
|
38
|
+
role: who.role,
|
|
39
|
+
signal,
|
|
40
|
+
client: who.client,
|
|
41
|
+
sandbox,
|
|
42
|
+
});
|
|
43
|
+
const skills = (await currentFeatures()).skills === true ? await activeSkills(space.id) : null;
|
|
44
|
+
const tools = await elementTools(caller, {
|
|
45
|
+
knowledge: true,
|
|
46
|
+
skills,
|
|
47
|
+
wizards: true,
|
|
48
|
+
connections: true,
|
|
49
|
+
});
|
|
50
|
+
if (sandbox) {
|
|
51
|
+
const report = (result) => ({
|
|
52
|
+
exitCode: result.exitCode,
|
|
53
|
+
stdout: clip(result.stdout, 8000),
|
|
54
|
+
stderr: clip(result.stderr, 4000),
|
|
55
|
+
});
|
|
56
|
+
tools.run_command = createTool({
|
|
57
|
+
id: "run_command",
|
|
58
|
+
description: shellToolDescription(sandboxCapabilities()),
|
|
59
|
+
inputSchema: RUN_COMMAND.input,
|
|
60
|
+
execute: (input) => elementCall(caller, { action: "run_command", about: "sandbox", perm: "x", input }, async () => report(await sandbox.handle().exec(input.command, {
|
|
61
|
+
timeoutMs: Math.min((input.timeoutSeconds ?? 120) * 1000, 600_000),
|
|
62
|
+
}))),
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
// What the token's scopes allow, nothing more.
|
|
66
|
+
for (const name of Object.keys(tools)) {
|
|
67
|
+
const scope = name === "run_command" ? RUN_COMMAND.scope : ELEMENT_SPECS[name]?.scope;
|
|
68
|
+
if (!(scope && who.scopes.includes(scope))) {
|
|
69
|
+
delete tools[name];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return tools;
|
|
73
|
+
}
|
|
74
|
+
/** One element call of an outside client. */
|
|
75
|
+
export async function callOutside(who, spaceId, name, input, signal) {
|
|
76
|
+
const tools = await outsideTools(who, spaceId, signal);
|
|
77
|
+
const tool = tools[name];
|
|
78
|
+
if (!tool?.execute) {
|
|
79
|
+
return {
|
|
80
|
+
ok: false,
|
|
81
|
+
error: `${name} is not open to this client in this space: the token's scopes, or nothing of the kind in the space.`,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
let data = input ?? {};
|
|
85
|
+
if (tool.inputSchema) {
|
|
86
|
+
const parsed = tool.inputSchema.safeParse(data);
|
|
87
|
+
if (!parsed.success) {
|
|
88
|
+
return { ok: false, error: "Invalid input", data: parsed.error.issues };
|
|
89
|
+
}
|
|
90
|
+
data = parsed.data;
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
const result = await tool.execute(data);
|
|
94
|
+
if (result && typeof result === "object" && "error" in result) {
|
|
95
|
+
const { error, ...data } = result;
|
|
96
|
+
return { ok: false, error, data };
|
|
97
|
+
}
|
|
98
|
+
return { ok: true, result };
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
return { ok: false, error: String(err?.message ?? err).slice(0, 400) };
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { whereSchema } from "@engenty/wizards-shared/knowledge";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { prompt } from "../prompts.js";
|
|
4
|
+
const where = whereSchema.optional().describe(prompt("tools", "tool.space.where"));
|
|
5
|
+
export const pageReadInput = {
|
|
6
|
+
path: z.string().describe("The page's path, as space_search or space_list give it: pages/…"),
|
|
7
|
+
section: z
|
|
8
|
+
.string()
|
|
9
|
+
.optional()
|
|
10
|
+
.describe("Only this section: a heading of the page, or the start of one"),
|
|
11
|
+
from: z.number().int().min(0).optional().describe("Character to continue a long page at"),
|
|
12
|
+
};
|
|
13
|
+
export const ELEMENT_SPECS = {
|
|
14
|
+
space_search: {
|
|
15
|
+
scope: "data:read",
|
|
16
|
+
description: () => prompt("tools", "tool.space_search"),
|
|
17
|
+
input: z.object({
|
|
18
|
+
query: z.string().describe("What to look for: a question or keywords"),
|
|
19
|
+
where,
|
|
20
|
+
limit: z.number().int().min(1).max(12).optional().describe("Items to get, 6 by default"),
|
|
21
|
+
}),
|
|
22
|
+
},
|
|
23
|
+
space_list: {
|
|
24
|
+
scope: "data:read",
|
|
25
|
+
description: () => prompt("tools", "tool.space_list"),
|
|
26
|
+
input: z.object({ where }),
|
|
27
|
+
},
|
|
28
|
+
page_read: {
|
|
29
|
+
scope: "data:read",
|
|
30
|
+
description: () => prompt("tools", "tool.page_read.knowledge"),
|
|
31
|
+
input: z.object(pageReadInput),
|
|
32
|
+
},
|
|
33
|
+
table_read: {
|
|
34
|
+
scope: "data:read",
|
|
35
|
+
description: () => prompt("tools", "tool.table_read"),
|
|
36
|
+
input: z.object({
|
|
37
|
+
path: z.string().describe("The table's path: tables/…"),
|
|
38
|
+
where: whereSchema.optional().describe("Filter by columns, by their names"),
|
|
39
|
+
columns: z.array(z.string()).max(40).optional().describe("Only these columns"),
|
|
40
|
+
limit: z.number().int().min(1).max(1000).optional(),
|
|
41
|
+
offset: z.number().int().min(0).optional(),
|
|
42
|
+
}),
|
|
43
|
+
},
|
|
44
|
+
space_document: {
|
|
45
|
+
scope: "data:read",
|
|
46
|
+
description: () => prompt("tools", "tool.space_document"),
|
|
47
|
+
input: z.object({
|
|
48
|
+
path: z
|
|
49
|
+
.string()
|
|
50
|
+
.describe("The file's path: files/…, as the page's front matter or a hit names it"),
|
|
51
|
+
from: z.number().int().min(0).optional().describe("Character to start at"),
|
|
52
|
+
}),
|
|
53
|
+
},
|
|
54
|
+
skill_list: {
|
|
55
|
+
scope: "elements:read",
|
|
56
|
+
description: () => "Lists the space's skills you may read: their name and what each is for. Load one with skill_load.",
|
|
57
|
+
input: z.object({}),
|
|
58
|
+
},
|
|
59
|
+
skill_load: {
|
|
60
|
+
scope: "elements:read",
|
|
61
|
+
description: () => "Loads one of the space's skills by its name: its instructions and the files it brings. skill_list names them.",
|
|
62
|
+
input: z.object({ name: z.string().describe("The skill's name, as listed") }),
|
|
63
|
+
},
|
|
64
|
+
skill_read: {
|
|
65
|
+
scope: "elements:read",
|
|
66
|
+
description: () => prompt("tools", "tool.skill_read"),
|
|
67
|
+
input: z.object({
|
|
68
|
+
name: z.string().describe("The skill's name"),
|
|
69
|
+
path: z.string().describe("The file's path in the skill, e.g. references/forms.md"),
|
|
70
|
+
from: z.number().int().min(0).optional().describe("Character to continue a long file at"),
|
|
71
|
+
}),
|
|
72
|
+
},
|
|
73
|
+
connection_list: {
|
|
74
|
+
scope: "elements:read",
|
|
75
|
+
description: () => "Lists the actions of the space's connections (mail, calendar, CRM …) you may use: each action's name, what it does, whether it reads or writes, and its input. Call one with connection_call.",
|
|
76
|
+
input: z.object({}),
|
|
77
|
+
},
|
|
78
|
+
connection_call: {
|
|
79
|
+
scope: "elements:run",
|
|
80
|
+
description: () => "Calls one action of the space's connections, as connection_list names it, with its input. A read runs at once; a write, a send or a delete runs only where the space's rules allow it without a person's yes: otherwise it is refused and says why.",
|
|
81
|
+
input: z.object({
|
|
82
|
+
name: z.string().describe("The action's name, as connection_list gives it"),
|
|
83
|
+
input: z.record(z.string(), z.unknown()).default({}),
|
|
84
|
+
}),
|
|
85
|
+
},
|
|
86
|
+
wizard_list: {
|
|
87
|
+
scope: "elements:read",
|
|
88
|
+
description: () => "Lists the space's published wizards you may run: their id, title and what they do. Run one with wizard_run.",
|
|
89
|
+
input: z.object({}),
|
|
90
|
+
},
|
|
91
|
+
wizard_run: {
|
|
92
|
+
scope: "elements:run",
|
|
93
|
+
description: () => "Runs one of the space's published wizards as the person you work for, with answers for its first page. Returns the run: its result, or the page or confirmation it waits for.",
|
|
94
|
+
input: z.object({
|
|
95
|
+
wizardId: z.string().describe("The wizard's id, as wizard_list gives it"),
|
|
96
|
+
answers: z.record(z.string(), z.unknown()).default({}),
|
|
97
|
+
waitSeconds: z.number().int().min(0).max(45).default(20),
|
|
98
|
+
}),
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
/** The names the catalogue can give. */
|
|
102
|
+
export const ELEMENT_TOOL_NAMES = Object.keys(ELEMENT_SPECS);
|