@engenty/wizards-runtime 0.16.2 → 0.17.1
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 +13 -6
- package/apps/runtime/dist/app.js +2 -0
- package/apps/runtime/dist/assistant/knows.js +15 -2
- package/apps/runtime/dist/broker/account.js +20 -1
- package/apps/runtime/dist/broker/call.js +131 -22
- package/apps/runtime/dist/broker/grant.js +25 -1
- package/apps/runtime/dist/broker/host.js +8 -2
- package/apps/runtime/dist/broker/index.js +5 -4
- package/apps/runtime/dist/broker/log.js +178 -24
- package/apps/runtime/dist/broker/over.js +38 -0
- package/apps/runtime/dist/broker/rights.js +192 -0
- package/apps/runtime/dist/broker/rwx.js +309 -53
- package/apps/runtime/dist/broker/send.js +109 -44
- package/apps/runtime/dist/bundles/fetch.js +119 -0
- package/apps/runtime/dist/bundles/index.js +621 -0
- package/apps/runtime/dist/bundles/read.js +607 -0
- package/apps/runtime/dist/connectors/external.js +532 -61
- package/apps/runtime/dist/connectors/person-sign-ins.js +1 -0
- package/apps/runtime/dist/connectors/reload.js +73 -0
- package/apps/runtime/dist/connectors/space-connections.js +118 -6
- package/apps/runtime/dist/db/migrations/tenant/0058_mcp_state_across_roles.sql +26 -0
- package/apps/runtime/dist/db/migrations/tenant/0059_space_connection_paused.sql +2 -0
- package/apps/runtime/dist/db/migrations/tenant/0060_space_bundle.sql +21 -0
- package/apps/runtime/dist/db/migrations/tenant/0061_space_connection_limits.sql +2 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0058_snapshot.json +6696 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0059_snapshot.json +6710 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0060_snapshot.json +6857 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0061_snapshot.json +6871 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +28 -0
- package/apps/runtime/dist/db/schema.js +81 -3
- package/apps/runtime/dist/docs/dev/broker.md +316 -50
- package/apps/runtime/dist/docs/dev/plugins/space.md +13 -2
- package/apps/runtime/dist/docs/user-guide/capabilities.md +172 -10
- package/apps/runtime/dist/docs/user-guide/connectors.md +57 -7
- package/apps/runtime/dist/docs/user-guide/protocol.md +44 -7
- package/apps/runtime/dist/docs/user-guide/test-and-share.md +1 -1
- package/apps/runtime/dist/docs/user-guide/together.md +4 -4
- package/apps/runtime/dist/elements/caller.js +2 -2
- package/apps/runtime/dist/elements/knowledge.js +16 -12
- package/apps/runtime/dist/engenty/connections-external/build-connector.js +23 -8
- package/apps/runtime/dist/engenty/connections-external/import-service.js +18 -9
- package/apps/runtime/dist/engenty/connections-external/importer/classify.js +12 -0
- package/apps/runtime/dist/engenty/connections-external/invoke/http-invoker.js +1 -0
- package/apps/runtime/dist/engenty/connections-external/net/guarded-fetch.js +6 -3
- package/apps/runtime/dist/engenty/connections-sdk/oauth2.js +2 -2
- package/apps/runtime/dist/engenty/shims/web-ingest.js +64 -0
- package/apps/runtime/dist/engine/resources.js +15 -6
- package/apps/runtime/dist/engine/runner.js +2 -1
- package/apps/runtime/dist/engine/steps.js +3 -2
- package/apps/runtime/dist/env.js +2 -0
- package/apps/runtime/dist/index.js +19 -2
- package/apps/runtime/dist/live/hub.js +17 -3
- package/apps/runtime/dist/live/origin.js +6 -4
- package/apps/runtime/dist/live/views.js +38 -7
- package/apps/runtime/dist/mcp/handler.js +2 -2
- package/apps/runtime/dist/mcp/seen.js +71 -51
- package/apps/runtime/dist/mcp/tools.js +5 -1
- package/apps/runtime/dist/models.js +18 -0
- package/apps/runtime/dist/prompts/mcp.md +1 -1
- package/apps/runtime/dist/prompts/tools.md +17 -1
- package/apps/runtime/dist/routes/api.js +2 -2
- package/apps/runtime/dist/routes/broker.js +59 -20
- package/apps/runtime/dist/routes/bundles.js +91 -0
- package/apps/runtime/dist/routes/connections.js +14 -3
- package/apps/runtime/dist/routes/live.js +4 -2
- package/apps/runtime/dist/routes/rules.js +53 -9
- package/apps/runtime/dist/routes/studio.js +36 -20
- package/apps/runtime/dist/services/api.js +4 -2
- package/apps/runtime/dist/services/cloud.js +2 -0
- package/apps/runtime/dist/services/draft-events.js +79 -6
- package/apps/runtime/dist/services/errors.js +1 -0
- package/apps/runtime/dist/services/files.js +2 -2
- package/apps/runtime/dist/services/knowledge.js +93 -27
- package/apps/runtime/dist/services/members-studio.js +22 -2
- package/apps/runtime/dist/services/skills.js +61 -5
- package/apps/runtime/dist/services/space-categories.js +83 -5
- package/apps/runtime/dist/services/space-index.js +173 -25
- package/apps/runtime/dist/services/space-origin.js +28 -11
- package/apps/runtime/dist/services/synced-spaces.js +5 -1
- package/apps/runtime/dist/services/wizards.js +48 -2
- package/apps/runtime/dist/services/work-ai.js +15 -5
- package/apps/runtime/dist/sharing/jobs.js +8 -2
- package/apps/runtime/dist/sync/hub.js +17 -3
- package/apps/runtime/dist/sync/records.js +6 -1
- package/apps/runtime/dist/texts.js +42 -5
- package/apps/runtime/dist/tools/connections.js +8 -0
- package/apps/runtime/dist/tools/connector.js +13 -1
- package/apps/runtime/dist/tools/index.js +21 -10
- package/apps/runtime/dist/tools/skills.js +11 -1
- package/apps/runtime/dist/tools/web-search.js +36 -0
- package/apps/web/dist/assets/{AboutDialog-BCcD8hKm.js → AboutDialog-mZCBU7KF.js} +1 -1
- package/apps/web/dist/assets/{BlockEditor-DgaUm2pR.js → BlockEditor-Dk0QwLSU.js} +1 -1
- package/apps/web/dist/assets/CapabilitiesPage-GkpgF-wZ.js +2 -0
- package/apps/web/dist/assets/{ChangelogDialog-B08elwyr.js → ChangelogDialog-BhyilZWA.js} +1 -1
- package/apps/web/dist/assets/{CodeEditor-BiyOk_SC.js → CodeEditor-DULYZbuE.js} +1 -1
- package/apps/web/dist/assets/EditorPage-D_mCdYdZ.js +3 -0
- package/apps/web/dist/assets/{FlowPreview-DF_6TvZ0.js → FlowPreview-ykxZxWnk.js} +1 -1
- package/apps/web/dist/assets/{LangSwitch-Ba4OWLzJ.js → LangSwitch-iO54w9AP.js} +1 -1
- package/apps/web/dist/assets/{Marketplace-DqziLf66.js → Marketplace-C97fH7UC.js} +2 -2
- package/apps/web/dist/assets/{NewWizardChannels-CsIGp0nZ.js → NewWizardChannels-CsSV7sm2.js} +1 -1
- package/apps/web/dist/assets/{NewWizardPage-CzQAkKMy.js → NewWizardPage-Ebgw-Vf_.js} +1 -1
- package/apps/web/dist/assets/{OnboardingPage-B9gr2OX5.js → OnboardingPage-BZlloT7v.js} +1 -1
- package/apps/web/dist/assets/PreviewPane-CJuqY5uA.js +7 -0
- package/apps/web/dist/assets/ProtocolSection-CPaDKVpZ.js +1 -0
- package/apps/web/dist/assets/{PublicRunner-BVs8-Vu3.js → PublicRunner-4Lf4SnwB.js} +1 -1
- package/apps/web/dist/assets/{ReadOnly--4CIJCDD.js → ReadOnly-CXQ41R9Q.js} +1 -1
- package/apps/web/dist/assets/SettingsPage-C-8BgK9O.js +2 -0
- package/apps/web/dist/assets/{SetupPage-9Zk-KUGA.js → SetupPage-4_K083Wl.js} +1 -1
- package/apps/web/dist/assets/{SharePage-D_Ab0gjr.js → SharePage-CQjgMcDI.js} +1 -1
- package/apps/web/dist/assets/{SkillEditor-DvtameHg.js → SkillEditor-DT5hQwbg.js} +1 -1
- package/apps/web/dist/assets/{Skills-Cf1Kl4Fy.js → Skills-D7V_9_xo.js} +1 -1
- package/apps/web/dist/assets/SpacePage-D3rYS1bA.js +2 -0
- package/apps/web/dist/assets/{UpdateCheck-DweZBVP6.js → UpdateCheck-DVgAJmy8.js} +2 -2
- package/apps/web/dist/assets/changelog-DzQCUSsx.js +1 -0
- package/apps/web/dist/assets/{code-editor-B1RbFTAZ.js → code-editor-5T7ilBjd.js} +2 -2
- package/apps/web/dist/assets/{host-CKS5U5Vg.js → host-CCijW1hj.js} +6 -6
- package/apps/web/dist/assets/i18n-DCPDesT-.js +55 -0
- package/apps/web/dist/assets/{index-Ckcn5vy7.js → index-C_iWl8iS.js} +3 -3
- package/apps/web/dist/assets/index-zcPlodHx.css +1 -0
- package/apps/web/dist/assets/minus-BpYkOkYw.js +1 -0
- package/apps/web/dist/assets/{read-aloud-Bq88XUHC.js → read-aloud-Qb719not.js} +1 -1
- package/apps/web/dist/assets/{runners-DvYVe9Dt.js → runners-BeZ84YH_.js} +1 -1
- package/apps/web/dist/assets/{session-D2bjiA3P.js → session-CEJRkSP5.js} +1 -1
- package/apps/web/dist/assets/{theme-CNJIC2be.js → theme-y_owNosi.js} +1 -1
- package/apps/web/dist/assets/{ui-Mplfhz_Z.js → ui-BacfkQ7Q.js} +1 -1
- package/apps/web/dist/assets/{useMutation-8QRM-z4M.js → useMutation-CgzFr4qH.js} +1 -1
- package/apps/web/dist/assets/{viewers-CEocUV_2.js → viewers-CkyHAjnk.js} +2 -2
- package/apps/web/dist/index.html +12 -12
- package/apps/web/dist/mcp/flow.html +2 -2
- package/node_modules/@engenty/wizards/dist/plugin/index.d.ts +7 -2
- package/node_modules/@engenty/wizards-shared/dist/bundles.d.ts +219 -0
- package/node_modules/@engenty/wizards-shared/dist/bundles.js +19 -0
- package/node_modules/@engenty/wizards-shared/dist/connectors.d.ts +117 -4
- package/node_modules/@engenty/wizards-shared/dist/connectors.js +14 -0
- package/node_modules/@engenty/wizards-shared/dist/feature-flags.d.ts +12 -0
- package/node_modules/@engenty/wizards-shared/dist/feature-flags.js +12 -0
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +11 -0
- package/node_modules/@engenty/wizards-shared/dist/run.js +22 -0
- package/node_modules/@engenty/wizards-shared/dist/rwx.d.ts +84 -1
- package/node_modules/@engenty/wizards-shared/dist/rwx.js +69 -1
- package/node_modules/@engenty/wizards-shared/dist/skills.d.ts +20 -3
- package/node_modules/@engenty/wizards-shared/dist/skills.js +5 -2
- package/node_modules/@engenty/wizards-shared/dist/spaces.d.ts +3 -2
- package/node_modules/@engenty/wizards-shared/dist/spaces.js +12 -3
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/web/dist/assets/CapabilitiesPage-DuJJV1ll.js +0 -2
- package/apps/web/dist/assets/EditorPage-EMFTHEYD.js +0 -3
- package/apps/web/dist/assets/PreviewPane-DSOV3o-1.js +0 -7
- package/apps/web/dist/assets/SettingsPage-z2u8lSe2.js +0 -2
- package/apps/web/dist/assets/SpacePage-CyqVzX9b.js +0 -2
- package/apps/web/dist/assets/changelog-C85v9OWg.js +0 -1
- package/apps/web/dist/assets/connection-sign-in-CaVvh5GQ.js +0 -1
- package/apps/web/dist/assets/i18n-Bymk5Ev-.js +0 -55
- package/apps/web/dist/assets/index-w-3J3ZJ9.css +0 -1
|
@@ -4,6 +4,7 @@ import { note } from "@engenty/wizards-shared/run";
|
|
|
4
4
|
import { and, desc, eq, sql } from "drizzle-orm";
|
|
5
5
|
import { nanoid } from "nanoid";
|
|
6
6
|
import { applyOps, OpError } from "../authoring/ops.js";
|
|
7
|
+
import { decide, kindOf } from "../broker/index.js";
|
|
7
8
|
import { listConnectors, resolveConnector } from "../connectors/external.js";
|
|
8
9
|
import { listSpaceConnections } from "../connectors/space-connections.js";
|
|
9
10
|
import { db, schema } from "../db/client.js";
|
|
@@ -233,6 +234,49 @@ async function spaceConnectionIssues(spaceId, draft) {
|
|
|
233
234
|
}
|
|
234
235
|
return issues;
|
|
235
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* The fixed steps of a draft that fail in a run as the space's rules are now
|
|
239
|
+
* (docs/plans/capabilities-next.md, 2b): a `call` on a connection of the space whose rule for
|
|
240
|
+
* that kind of action is „Mit Freigabe“ asks the space's admins, and nothing in a run waits for
|
|
241
|
+
* them. The broker's own decision says so, read from the rule as it is: the warning is gone once
|
|
242
|
+
* the rule says „Erlaubt“, and a wizard's own connection or a read never has one. No issue: the
|
|
243
|
+
* wizard saves and publishes.
|
|
244
|
+
*/
|
|
245
|
+
export async function stepWarnings(spaceId, draft) {
|
|
246
|
+
const fixed = draft.steps.filter((s) => s.type === "agent" && s.call && "connection" in s.call);
|
|
247
|
+
const ofSpace = new Map((draft.connections ?? []).flatMap((c) => c.spaceConnection ? [[c.id, c.spaceConnection]] : []));
|
|
248
|
+
if (!fixed.some((step) => ofSpace.has(step.call.connection))) {
|
|
249
|
+
return [];
|
|
250
|
+
}
|
|
251
|
+
const rows = await listSpaceConnections(spaceId);
|
|
252
|
+
const warnings = [];
|
|
253
|
+
for (const step of fixed) {
|
|
254
|
+
const row = rows.find((r) => r.id === ofSpace.get(step.call.connection));
|
|
255
|
+
const connector = row ? (await resolveConnector(spaceId, row.connectorId))?.connector : null;
|
|
256
|
+
const action = connector?.actions.find((a) => a.id === step.call.action);
|
|
257
|
+
if (!(row && connector && action)) {
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
const kind = kindOf(action.group);
|
|
261
|
+
// As the step of an admin's run: in every audience, so only the rule speaks.
|
|
262
|
+
const decision = decide({
|
|
263
|
+
who: { kind: "step", for: { kind: "admin" } },
|
|
264
|
+
where: {},
|
|
265
|
+
connection: { kind: "space_connection", row, connector },
|
|
266
|
+
actionId: action.id,
|
|
267
|
+
kind,
|
|
268
|
+
});
|
|
269
|
+
if (decision.outcome === "ask" && decision.admins) {
|
|
270
|
+
warnings.push({
|
|
271
|
+
stepId: step.id,
|
|
272
|
+
kind: "needs_approval",
|
|
273
|
+
connection: { id: row.id, name: row.name },
|
|
274
|
+
action: { id: action.id, kind },
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return warnings;
|
|
279
|
+
}
|
|
236
280
|
/** Everything wrong with a draft: its structure, its workspace files, its space's connectors and plugins. */
|
|
237
281
|
export async function checkDraft(spaceId, draft, files) {
|
|
238
282
|
return [
|
|
@@ -256,6 +300,8 @@ export async function wizardState(w) {
|
|
|
256
300
|
draft: w.draft,
|
|
257
301
|
files,
|
|
258
302
|
issues: await checkDraft(w.spaceId, w.draft, files.map((f) => f.path)),
|
|
303
|
+
/** Steps that save and publish and fail in a run as the space's rules are now. */
|
|
304
|
+
warnings: await stepWarnings(w.spaceId, w.draft),
|
|
259
305
|
dirty: !published ||
|
|
260
306
|
JSON.stringify(published.definition) !== JSON.stringify(w.draft) ||
|
|
261
307
|
!sameFiles(published.files, files),
|
|
@@ -402,7 +448,7 @@ export async function writeDraft(userId, wizardId, input, writer = { source: "st
|
|
|
402
448
|
if (input.note) {
|
|
403
449
|
await addMessage(w.id, { role: "assistant", content: input.note, changed: true }, writer);
|
|
404
450
|
}
|
|
405
|
-
emitDraftChanged({
|
|
451
|
+
await emitDraftChanged({
|
|
406
452
|
wizardId: w.id,
|
|
407
453
|
kind: "draft",
|
|
408
454
|
revision: row.revision,
|
|
@@ -411,7 +457,7 @@ export async function writeDraft(userId, wizardId, input, writer = { source: "st
|
|
|
411
457
|
note: input.note ?? null,
|
|
412
458
|
touched: changedSteps(w.draft, draft),
|
|
413
459
|
});
|
|
414
|
-
return { revision: row.revision, issues, draft };
|
|
460
|
+
return { revision: row.revision, issues, warnings: await stepWarnings(w.spaceId, draft), draft };
|
|
415
461
|
}
|
|
416
462
|
export async function editWizard(userId, wizardId, input, writer) {
|
|
417
463
|
const w = await writableWizard(userId, wizardId);
|
|
@@ -9,7 +9,7 @@ import { elementTools } from "../elements/catalogue.js";
|
|
|
9
9
|
import { currentFeatures } from "../features.js";
|
|
10
10
|
import { HarnessModel } from "../harness/index.js";
|
|
11
11
|
import { managed } from "../manage.js";
|
|
12
|
-
import { attachTools, chatModel, gatewayTools } from "../models.js";
|
|
12
|
+
import { attachTools, chatModel, gatewayTools, toolAccess, } from "../models.js";
|
|
13
13
|
import { pluginsOf } from "../plugins/registry.js";
|
|
14
14
|
import { prompt } from "../prompts.js";
|
|
15
15
|
import { sandboxCapabilities, shellToolDescription } from "../sandbox/index.js";
|
|
@@ -17,6 +17,7 @@ import { currentTenant } from "../tenants/tenant.js";
|
|
|
17
17
|
import { assistantToolPlugin, assistantToolRisk, assistantToolsOf } from "../tools/plugin.js";
|
|
18
18
|
import { clip } from "../tools/shared.js";
|
|
19
19
|
import { skillsBlock } from "../tools/skills.js";
|
|
20
|
+
import { gatewayWebSearch } from "../tools/web-search.js";
|
|
20
21
|
import { roleOf } from "./access.js";
|
|
21
22
|
import { ClientSteps } from "./client-steps.js";
|
|
22
23
|
import { activeSkills } from "./skills.js";
|
|
@@ -137,7 +138,7 @@ async function clientTools(space, userId, signal, chatId) {
|
|
|
137
138
|
* and the web the person turned off (`choice`) left out. A client gets `clientTools` alone.
|
|
138
139
|
* `role`: the person's, where the session knows it; else the organization's list says.
|
|
139
140
|
*/
|
|
140
|
-
async function toolsFor(resolved, space, userId, signal, choice = {}, chatId = null, approved = null, known = null) {
|
|
141
|
+
async function toolsFor(resolved, space, userId, signal, choice = {}, chatId = null, approved = null, known = null, web = null) {
|
|
141
142
|
const role = known ?? (await roleOf(userId));
|
|
142
143
|
if (role === "client") {
|
|
143
144
|
return clientTools(space, userId, signal, chatId ?? approved?.chatId ?? null);
|
|
@@ -184,7 +185,12 @@ async function toolsFor(resolved, space, userId, signal, choice = {}, chatId = n
|
|
|
184
185
|
delete tools[name];
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
|
-
|
|
188
|
+
// The gateway's search where the gateway is reached, for every model; else the model's own.
|
|
189
|
+
const access = choice.web !== false ? web : null;
|
|
190
|
+
if (access) {
|
|
191
|
+
tools.web_search = gatewayWebSearch(access);
|
|
192
|
+
}
|
|
193
|
+
else if (choice.web !== false && resolved?.vendor === "anthropic") {
|
|
188
194
|
tools.web_search = anthropic.tools.webSearch_20250305({ maxUses: 5 });
|
|
189
195
|
}
|
|
190
196
|
else if (choice.web !== false && resolved?.gateway) {
|
|
@@ -253,9 +259,13 @@ export async function toolToRun(space, userId, name, signal, approved) {
|
|
|
253
259
|
* composer.
|
|
254
260
|
*/
|
|
255
261
|
export async function workTurn(turn, signal, steps, choice = {}) {
|
|
256
|
-
|
|
262
|
+
// The gateway's way for web search, asked beside the model rather than after it.
|
|
263
|
+
const [resolved, web] = await Promise.all([
|
|
264
|
+
chatTurnWay(managed).then((way) => chatModel(way, choice.extra ? "high" : "standard")),
|
|
265
|
+
choice.web !== false ? toolAccess() : null,
|
|
266
|
+
]);
|
|
257
267
|
const client = turn.role === "client";
|
|
258
|
-
const made = gated(await toolsFor(resolved, turn.space, turn.userId, signal, choice, turn.chatId, null, turn.role ?? null), turn);
|
|
268
|
+
const made = gated(await toolsFor(resolved, turn.space, turn.userId, signal, choice, turn.chatId, null, turn.role ?? null, web), turn);
|
|
259
269
|
const tools = resolved.model instanceof HarnessModel ? steps.wrap(made) : made;
|
|
260
270
|
attachTools(resolved, tools);
|
|
261
271
|
const skills = client ? null : await spaceSkills(turn.space.id);
|
|
@@ -40,6 +40,9 @@ const heldBy = (run, def, spaceId) => ({ kind: "store_secret", def, scope: scope
|
|
|
40
40
|
function contextOf(run, spaceId, entry, who, job) {
|
|
41
41
|
const connection = entry.target.connection?.() ?? null;
|
|
42
42
|
const signal = job?.signal ?? new AbortController().signal;
|
|
43
|
+
// The run is done and the person sends its result on: the one call the broker takes of a run
|
|
44
|
+
// that is done (broker/over.ts).
|
|
45
|
+
const where = { ...whereOfRun(run, holderOf(run), spaceId), share: true };
|
|
43
46
|
const emit = (message) => job ? addJobEvent(run.id, job.id, sayIn(who.lang, message)) : Promise.resolve();
|
|
44
47
|
const ask = (question) => !job || run.unattended
|
|
45
48
|
? Promise.resolve(null)
|
|
@@ -60,7 +63,7 @@ function contextOf(run, spaceId, entry, who, job) {
|
|
|
60
63
|
// The person filled the form and sent it: a write is theirs, nothing asks again.
|
|
61
64
|
const out = await brokerCall({
|
|
62
65
|
who: whoOf(holderOf(run)),
|
|
63
|
-
where
|
|
66
|
+
where,
|
|
64
67
|
connection: heldBy(run, connection, spaceId),
|
|
65
68
|
action,
|
|
66
69
|
input,
|
|
@@ -77,7 +80,7 @@ function contextOf(run, spaceId, entry, who, job) {
|
|
|
77
80
|
sendFromServer: async (recipients, input, handler) => {
|
|
78
81
|
const out = await brokerSend({
|
|
79
82
|
who: whoOf(holderOf(run)),
|
|
80
|
-
where
|
|
83
|
+
where,
|
|
81
84
|
recipients,
|
|
82
85
|
input,
|
|
83
86
|
handler,
|
|
@@ -90,6 +93,7 @@ function contextOf(run, spaceId, entry, who, job) {
|
|
|
90
93
|
link: async () => (publicOrigin() ? (await shareRun(run)).url : null),
|
|
91
94
|
step: async () => makeContext(run, await loadSpace(run), structuredClone(run.state), signal, {
|
|
92
95
|
stepId: SHARE_STEP,
|
|
96
|
+
share: true,
|
|
93
97
|
emit: (_type, message) => emit(typeof message === "string" ? message : noteText(message, who.lang)),
|
|
94
98
|
ask,
|
|
95
99
|
}),
|
|
@@ -100,6 +104,8 @@ function refusalLine(refused) {
|
|
|
100
104
|
switch (refused) {
|
|
101
105
|
case "not_allowed_recipient":
|
|
102
106
|
return line("shareGuestRecipient");
|
|
107
|
+
case "channel_not_fixed":
|
|
108
|
+
return line("shareGuestChannel");
|
|
103
109
|
case "run_limit":
|
|
104
110
|
return line("shareGuestRunMails", { mails: GUEST_MAILS_PER_RUN });
|
|
105
111
|
case "day_limit":
|
|
@@ -5,6 +5,7 @@ import { getBlob, hasBlob, putBlobOf } from "../files/blobs.js";
|
|
|
5
5
|
import { managed, tenantInfo } from "../manage.js";
|
|
6
6
|
import { currentRole, isAdminRole, MEMBERS_EDIT_ONLY, mayBuild } from "../services/access.js";
|
|
7
7
|
import { ServiceError } from "../services/errors.js";
|
|
8
|
+
import { studioSpaces } from "../services/members-studio.js";
|
|
8
9
|
import { spaceLimit } from "../services/spaces.js";
|
|
9
10
|
import { publishWizard, rotateShareLink, shareUrl } from "../services/wizards.js";
|
|
10
11
|
import { codeOf } from "../tenants/control.js";
|
|
@@ -26,13 +27,18 @@ function requireSchema(theirs) {
|
|
|
26
27
|
throw new ServiceError("refused", order(theirs) < order(tenantSchemaVersion) ? note("syncUpdateHere") : note("syncUpdateCloud"), { reason: "schema_mismatch", schema: tenantSchemaVersion });
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* The organization as an install meets it: its schema, its number of spaces, its spaces. The
|
|
32
|
+
* install of a member meets the spaces whose Studio is open to members; the others refuse its
|
|
33
|
+
* pulls and pushes (services/members-studio.ts), so they are not offered to it.
|
|
34
|
+
*/
|
|
30
35
|
export async function syncOverview() {
|
|
31
|
-
const
|
|
36
|
+
const open = await studioSpaces();
|
|
37
|
+
const spaces = (await db.query.space.findMany({
|
|
32
38
|
where: eq(schema.space.tenantId, currentTenant()),
|
|
33
39
|
columns: { id: true, name: true, origin: true },
|
|
34
40
|
orderBy: [schema.space.createdAt],
|
|
35
|
-
});
|
|
41
|
+
})).filter((s) => !open || open.has(s.id));
|
|
36
42
|
const info = managed ? await tenantInfo(currentTenant()).catch(() => null) : null;
|
|
37
43
|
const limit = await spaceLimit();
|
|
38
44
|
return {
|
|
@@ -45,6 +51,14 @@ export async function syncOverview() {
|
|
|
45
51
|
spaces: await Promise.all(spaces.map(async (s) => ({ id: s.id, name: s.name, seq: await spaceSeq(s.id) }))),
|
|
46
52
|
};
|
|
47
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* What of the feed's changes an install hears as spaces to pull (`GET /sync/live`): for a
|
|
56
|
+
* member's install, none of a space whose Studio is closed to members.
|
|
57
|
+
*/
|
|
58
|
+
export async function syncHears(changes) {
|
|
59
|
+
const open = await studioSpaces();
|
|
60
|
+
return open ? changes.filter((x) => !x.spaceId || open.has(x.spaceId)) : changes;
|
|
61
|
+
}
|
|
48
62
|
/**
|
|
49
63
|
* What changed in a space after `since`. From 0 it is every item of the space, a page at a
|
|
50
64
|
* time (`cursor`); `next` then is the number the log stood at when the listing began.
|
|
@@ -151,6 +151,7 @@ const wizard = {
|
|
|
151
151
|
draft: w.draft,
|
|
152
152
|
shareEnabled: w.shareEnabled,
|
|
153
153
|
dailyRunLimit: w.dailyRunLimit,
|
|
154
|
+
dailyMailLimit: w.dailyMailLimit,
|
|
154
155
|
starter: w.starter,
|
|
155
156
|
starterRevision: w.starterRevision,
|
|
156
157
|
runners: w.runners,
|
|
@@ -176,6 +177,10 @@ const wizard = {
|
|
|
176
177
|
draft,
|
|
177
178
|
shareEnabled: bool(r.shareEnabled, true),
|
|
178
179
|
...(num(r.dailyRunLimit) ? { dailyRunLimit: num(r.dailyRunLimit) } : {}),
|
|
180
|
+
// None is a number too: guests' runs send nothing.
|
|
181
|
+
...(num(r.dailyMailLimit) !== null
|
|
182
|
+
? { dailyMailLimit: Math.max(0, Math.round(num(r.dailyMailLimit))) }
|
|
183
|
+
: {}),
|
|
179
184
|
starter: str(r.starter),
|
|
180
185
|
starterRevision: num(r.starterRevision),
|
|
181
186
|
runners: (r.runners ?? null),
|
|
@@ -213,7 +218,7 @@ const wizard = {
|
|
|
213
218
|
where: eq(schema.wizard.id, id),
|
|
214
219
|
columns: { revision: true },
|
|
215
220
|
});
|
|
216
|
-
emitDraftChanged({
|
|
221
|
+
await emitDraftChanged({
|
|
217
222
|
wizardId: id,
|
|
218
223
|
kind: "draft",
|
|
219
224
|
revision: row?.revision ?? 0,
|
|
@@ -152,8 +152,9 @@ const EN = {
|
|
|
152
152
|
shareMailboxLimit: "The attachments are too large for this mailbox (at most 3 MB). Choose fewer files or share the link.",
|
|
153
153
|
shareVisitorRecipients: "From here, an email goes to at most {recipients} addresses.",
|
|
154
154
|
shareGuestRecipient: "From here, an email goes only to the address you gave in the wizard or to the team’s own addresses.",
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
shareGuestChannel: "From here, no message goes to a Slack channel.",
|
|
156
|
+
shareGuestRunMails: "This run has sent its {mails} emails and messages.",
|
|
157
|
+
shareGuestDayMails: "This wizard has sent its emails and messages for today. Try again tomorrow.",
|
|
157
158
|
shareConnectMailbox: "Connect a mailbox first.",
|
|
158
159
|
shareSendingFrom: "Sending from {account}",
|
|
159
160
|
shareSentTo: "Sent to {to}",
|
|
@@ -234,6 +235,24 @@ const EN = {
|
|
|
234
235
|
connectorsRegistryDown: "integrations.sh did not answer. Try again in a moment.",
|
|
235
236
|
skillsRegistryMissing: "skills.sh has no skill at {ref}.",
|
|
236
237
|
skillUpdateChanged: "skills.sh changed the skill again since you looked. Look at the changes once more.",
|
|
238
|
+
// A Connector that brings skills: a plugin for Claude Code or Cursor (bundles/).
|
|
239
|
+
skillOfBundleReadOnly: "A skill that came with a connector stays as it is. Copy it as your own skill to change it.",
|
|
240
|
+
skillOfBundleStays: "This skill came with a connector. Switch it off, or remove the connector with everything it brought.",
|
|
241
|
+
bundleNotARepository: "This is no address of a repository on GitHub. It looks like https://github.com/owner/name.",
|
|
242
|
+
bundleRepoNotFound: "GitHub has no public repository {repo}, or not this branch of it.",
|
|
243
|
+
bundleRepoDown: "GitHub did not answer. Try again in a moment.",
|
|
244
|
+
bundleTooLarge: "This is too large. A repository or a zip may have {mb} MB and 50,000 files.",
|
|
245
|
+
bundleUploadKind: "Upload a plugin as a .zip or a .plugin file.",
|
|
246
|
+
bundleManifestUnreadable: "{file} in the plugin is not valid JSON.",
|
|
247
|
+
bundleNoFolder: "The plugin has no folder “{path}”.",
|
|
248
|
+
bundleNoPlugin: "Nothing here is a plugin for Claude Code or Cursor. A plugin has a manifest, an MCP file or a skills folder.",
|
|
249
|
+
bundleChoose: "This repository holds several plugins. Choose one of them.",
|
|
250
|
+
bundleNothingToTake: "This plugin brings nothing a space takes: no MCP server over http and no skill.",
|
|
251
|
+
bundleAlreadyThere: "The space has “{name}” from here already. Update it on its connector’s page.",
|
|
252
|
+
bundleChanged: "The plugin changed since you looked. Check it once more.",
|
|
253
|
+
bundleServerUnknown: "The plugin names no server “{key}”.",
|
|
254
|
+
bundleServerFailed: "The server “{key}” could not be imported. Leave it out or correct it, then try again: {detail}",
|
|
255
|
+
bundleUploadAgain: "This one came from a file. Upload the new file to update it.",
|
|
237
256
|
};
|
|
238
257
|
const DE = {
|
|
239
258
|
criticalMailSubject: {
|
|
@@ -246,7 +265,7 @@ const DE = {
|
|
|
246
265
|
"criticalKind.refused_write": "Abgelehnt: ein Schreiben, Löschen oder Senden",
|
|
247
266
|
"criticalKind.outside_audience": "Ein Gast hat eine Verbindung erreicht, die nicht für Gäste ist",
|
|
248
267
|
"criticalKind.host_not_in_grant": "Eine Anfrage an einen Host, den der Lauf nicht erreichen darf",
|
|
249
|
-
"criticalKind.limit_reached": "
|
|
268
|
+
"criticalKind.limit_reached": "Eine Grenze ist erreicht",
|
|
250
269
|
"criticalKind.sign_in_failed": "Eine Anmeldung ist abgelaufen oder wurde abgelehnt",
|
|
251
270
|
"criticalKind.first_use": "Eine Verbindung wurde zum ersten Mal verwendet",
|
|
252
271
|
"criticalKind.rule_changed": "Eine Regel wurde geändert",
|
|
@@ -378,8 +397,9 @@ const DE = {
|
|
|
378
397
|
shareMailboxLimit: "Die Anhänge sind zu groß für dieses Postfach (höchstens 3 MB). Wähle weniger Dateien oder teile den Link.",
|
|
379
398
|
shareVisitorRecipients: "Von hier geht eine E-Mail an höchstens {recipients} Adressen.",
|
|
380
399
|
shareGuestRecipient: "Von hier geht eine E-Mail nur an die Adresse, die du im Wizard angegeben hast, oder an Adressen des Teams.",
|
|
381
|
-
|
|
382
|
-
|
|
400
|
+
shareGuestChannel: "Von hier geht keine Nachricht in einen Slack-Kanal.",
|
|
401
|
+
shareGuestRunMails: "Dieser Lauf hat seine {mails} E-Mails und Nachrichten gesendet.",
|
|
402
|
+
shareGuestDayMails: "Dieser Wizard hat seine E-Mails und Nachrichten für heute gesendet. Versuch es morgen wieder.",
|
|
383
403
|
shareConnectMailbox: "Verbinde zuerst ein Postfach.",
|
|
384
404
|
shareSendingFrom: "Sendet von {account}",
|
|
385
405
|
shareSentTo: "Gesendet an {to}",
|
|
@@ -457,6 +477,23 @@ const DE = {
|
|
|
457
477
|
connectorsRegistryDown: "integrations.sh antwortet nicht. Versuch es gleich noch einmal.",
|
|
458
478
|
skillsRegistryMissing: "Auf skills.sh gibt es keinen Skill unter {ref}.",
|
|
459
479
|
skillUpdateChanged: "skills.sh hat den Skill seitdem wieder geändert. Sieh dir die Änderungen noch einmal an.",
|
|
480
|
+
skillOfBundleReadOnly: "Ein Skill, der mit einem Connector kam, bleibt, wie er ist. Kopiere ihn als eigenen Skill, um ihn zu ändern.",
|
|
481
|
+
skillOfBundleStays: "Dieser Skill kam mit einem Connector. Schalte ihn aus oder entferne den Connector mit allem, was er mitgebracht hat.",
|
|
482
|
+
bundleNotARepository: "Das ist keine Adresse eines Repositorys auf GitHub. Sie sieht so aus: https://github.com/owner/name.",
|
|
483
|
+
bundleRepoNotFound: "GitHub hat kein öffentliches Repository {repo}, oder nicht diesen Branch davon.",
|
|
484
|
+
bundleRepoDown: "GitHub antwortet nicht. Versuch es gleich noch einmal.",
|
|
485
|
+
bundleTooLarge: "Das ist zu groß. Ein Repository oder ein Zip darf {mb} MB und 50.000 Dateien haben.",
|
|
486
|
+
bundleUploadKind: "Lade ein Plugin als .zip oder .plugin hoch.",
|
|
487
|
+
bundleManifestUnreadable: "{file} im Plugin ist kein gültiges JSON.",
|
|
488
|
+
bundleNoFolder: "Das Plugin hat keinen Ordner „{path}“.",
|
|
489
|
+
bundleNoPlugin: "Hier liegt kein Plugin für Claude Code oder Cursor. Ein Plugin hat ein Manifest, eine MCP-Datei oder einen Ordner mit Skills.",
|
|
490
|
+
bundleChoose: "In diesem Repository liegen mehrere Plugins. Wähle eines davon.",
|
|
491
|
+
bundleNothingToTake: "Dieses Plugin bringt nichts mit, was ein Space übernimmt: keinen MCP-Server über http und keinen Skill.",
|
|
492
|
+
bundleAlreadyThere: "Der Space hat „{name}“ von hier schon. Aktualisiere es auf der Seite seines Connectors.",
|
|
493
|
+
bundleChanged: "Das Plugin hat sich geändert, seit du es angesehen hast. Prüfe es noch einmal.",
|
|
494
|
+
bundleServerUnknown: "Das Plugin nennt keinen Server „{key}“.",
|
|
495
|
+
bundleServerFailed: "Der Server „{key}“ ließ sich nicht importieren. Lass ihn weg oder korrigiere ihn und versuch es dann noch einmal: {detail}",
|
|
496
|
+
bundleUploadAgain: "Das kam aus einer Datei. Lade die neue Datei hoch, um es zu aktualisieren.",
|
|
460
497
|
};
|
|
461
498
|
export const SERVER_TEXTS = { en: EN, de: DE };
|
|
462
499
|
/** A line of the server's table in a language; English where the language lacks it. */
|
|
@@ -52,6 +52,14 @@ export function connectionRefusalNote(refused, service) {
|
|
|
52
52
|
return prompt("tools", "note.connector_declined");
|
|
53
53
|
case "needs_approval":
|
|
54
54
|
return prompt("tools", "note.connector_needs_approval", { service });
|
|
55
|
+
case "paused":
|
|
56
|
+
return prompt("tools", "note.connector_paused", { service });
|
|
57
|
+
case "calls_per_run":
|
|
58
|
+
return prompt("tools", "note.connector_calls_per_run", { service });
|
|
59
|
+
case "calls_per_day":
|
|
60
|
+
return prompt("tools", "note.connector_calls_per_day", { service });
|
|
61
|
+
case "run_ended":
|
|
62
|
+
return prompt("tools", "note.run_ended");
|
|
55
63
|
default:
|
|
56
64
|
return prompt("tools", "note.connector_refused", { service });
|
|
57
65
|
}
|
|
@@ -113,6 +113,14 @@ function refusalNote(refused, service) {
|
|
|
113
113
|
return prompt("tools", "note.connector_needs_approval", { service });
|
|
114
114
|
case "ai_step_writes":
|
|
115
115
|
return prompt("tools", "note.connector_ai_step_writes", { service });
|
|
116
|
+
case "paused":
|
|
117
|
+
return prompt("tools", "note.connector_paused", { service });
|
|
118
|
+
case "calls_per_run":
|
|
119
|
+
return prompt("tools", "note.connector_calls_per_run", { service });
|
|
120
|
+
case "calls_per_day":
|
|
121
|
+
return prompt("tools", "note.connector_calls_per_day", { service });
|
|
122
|
+
case "run_ended":
|
|
123
|
+
return prompt("tools", "note.run_ended");
|
|
116
124
|
default:
|
|
117
125
|
return prompt("tools", "note.connector_refused", { service });
|
|
118
126
|
}
|
|
@@ -195,7 +203,11 @@ export async function callConnection(call, input, ctx) {
|
|
|
195
203
|
if (!out.ok) {
|
|
196
204
|
throw new StepError(out.refused === "declined" || out.refused === "nobody"
|
|
197
205
|
? note("stepCallNotAllowed", { service })
|
|
198
|
-
:
|
|
206
|
+
: out.refused === "calls_per_run"
|
|
207
|
+
? note("stepCallsPerRun", { service })
|
|
208
|
+
: out.refused === "calls_per_day"
|
|
209
|
+
? note("stepCallsPerDay", { service })
|
|
210
|
+
: note("stepCallRefused", { service, action: action.id, reason: out.reason }));
|
|
199
211
|
}
|
|
200
212
|
return out.result;
|
|
201
213
|
}
|
|
@@ -8,7 +8,7 @@ import { stepCaller } from "../elements/caller.js";
|
|
|
8
8
|
import { elementTools } from "../elements/catalogue.js";
|
|
9
9
|
import { generateImageMedia } from "../media/generate.js";
|
|
10
10
|
import { markMedia } from "../media/marking.js";
|
|
11
|
-
import { gatewayTools, isHarnessVendor, searchAllowed } from "../models.js";
|
|
11
|
+
import { gatewayTools, isHarnessVendor, searchAllowed, toolAccess, } from "../models.js";
|
|
12
12
|
import { prompt } from "../prompts.js";
|
|
13
13
|
import { htmlToMarkdown } from "../render/convert.js";
|
|
14
14
|
import { shellToolDescription } from "../sandbox/index.js";
|
|
@@ -24,6 +24,7 @@ import { pluginTools, spaceContextOf } from "./plugin.js";
|
|
|
24
24
|
import { clip, FileKeeper } from "./shared.js";
|
|
25
25
|
import { skillsOf } from "./skills.js";
|
|
26
26
|
import { storeTools } from "./store.js";
|
|
27
|
+
import { gatewayWebSearch } from "./web-search.js";
|
|
27
28
|
// A request to a host is a send to that host; the broker holds a guest's run to the hosts in its grant.
|
|
28
29
|
reachesOutside("http_request", { connection: "host", action: "http_request", kind: "send" });
|
|
29
30
|
/**
|
|
@@ -65,12 +66,11 @@ export async function buildStepTools(step, ctx, resolved, uploads) {
|
|
|
65
66
|
const allowed = new Set(step.tools);
|
|
66
67
|
// A tier without web search leaves the tool out; the builder says so before a run.
|
|
67
68
|
if (allowed.has("web_search") && (await searchAllowed())) {
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
// An installed client searches with its own tool; naming it here switches it on.
|
|
69
|
+
// An installed client searches with its own tool; naming it here switches it on. Else the
|
|
70
|
+
// gateway's search where it is reached, for every model alike; else Anthropic models search
|
|
71
|
+
// natively, other models through the AI Gateway's tool.
|
|
72
|
+
const access = isHarnessVendor(resolved.vendor) ? null : await toolAccess();
|
|
73
|
+
if (isHarnessVendor(resolved.vendor)) {
|
|
74
74
|
tools.web_search = createTool({
|
|
75
75
|
id: "web_search",
|
|
76
76
|
description: prompt("tools", "tool.web_search"),
|
|
@@ -78,6 +78,12 @@ export async function buildStepTools(step, ctx, resolved, uploads) {
|
|
|
78
78
|
execute: async () => ({ error: "The client searches itself." }),
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
+
else if (access) {
|
|
82
|
+
tools.web_search = gatewayWebSearch(access, { runId: ctx.runId });
|
|
83
|
+
}
|
|
84
|
+
else if (resolved.vendor === "anthropic") {
|
|
85
|
+
tools.web_search = anthropic.tools.webSearch_20250305({ maxUses: 8 });
|
|
86
|
+
}
|
|
81
87
|
else if (resolved.gateway) {
|
|
82
88
|
tools.web_search = gatewayTools.perplexitySearch({ maxResults: 8 });
|
|
83
89
|
}
|
|
@@ -153,9 +159,14 @@ export async function buildStepTools(step, ctx, resolved, uploads) {
|
|
|
153
159
|
return { status: res.status, body: clip(await res.text(), 8000) };
|
|
154
160
|
},
|
|
155
161
|
});
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
162
|
+
if (out.ok) {
|
|
163
|
+
return out.result;
|
|
164
|
+
}
|
|
165
|
+
return {
|
|
166
|
+
error: out.refused === "run_ended"
|
|
167
|
+
? prompt("tools", "note.run_ended")
|
|
168
|
+
: prompt("tools", "note.host_not_in_grant", { host: safe.hostname }),
|
|
169
|
+
};
|
|
159
170
|
},
|
|
160
171
|
});
|
|
161
172
|
}
|
|
@@ -6,7 +6,7 @@ import { elementCall, mayDo } from "../elements/gate.js";
|
|
|
6
6
|
import { ELEMENT_SPECS } from "../elements/specs.js";
|
|
7
7
|
import { getBlob } from "../files/blobs.js";
|
|
8
8
|
import { prompt } from "../prompts.js";
|
|
9
|
-
import { activeSkills } from "../services/skills.js";
|
|
9
|
+
import { activeSkills, skillConnectors } from "../services/skills.js";
|
|
10
10
|
import { attempt, clip } from "./shared.js";
|
|
11
11
|
const found = new WeakMap();
|
|
12
12
|
/** The space's skills that count, asked once per step. */
|
|
@@ -157,11 +157,21 @@ export function skillToolsOf(skills, caller) {
|
|
|
157
157
|
const placed = await place(k);
|
|
158
158
|
// In the sandbox, the files for its scripts are there too.
|
|
159
159
|
const files = placed?.folder ? [...k.files, ...k.blobFiles] : k.files;
|
|
160
|
+
// A plugin brought it together with a connector: the step hears which one.
|
|
161
|
+
const connectors = await skillConnectors(k);
|
|
160
162
|
return {
|
|
161
163
|
name: k.name,
|
|
162
164
|
instructions: clip(k.body, 60_000),
|
|
163
165
|
files: files.map((f) => f.path).sort(),
|
|
164
166
|
...placed,
|
|
167
|
+
...(connectors.length
|
|
168
|
+
? {
|
|
169
|
+
connector: prompt("tools", "note.skill_connector", {
|
|
170
|
+
names: connectors.map((c) => c.name).join(", "),
|
|
171
|
+
prefixes: connectors.map((c) => `${c.toolPrefix}_`).join(", "),
|
|
172
|
+
}),
|
|
173
|
+
}
|
|
174
|
+
: {}),
|
|
165
175
|
};
|
|
166
176
|
});
|
|
167
177
|
}),
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createTool } from "@mastra/core/tools";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { prompt } from "../prompts.js";
|
|
4
|
+
/**
|
|
5
|
+
* `web_search` through the gateway: the same tool for every model and client (a Work chat,
|
|
6
|
+
* Goose, a step, a local AI client), metered and booked there, its provider the gateway's
|
|
7
|
+
* business. Reading a result's page is `web_fetch`, the runtime's own.
|
|
8
|
+
*/
|
|
9
|
+
export function gatewayWebSearch(access, meta = {}) {
|
|
10
|
+
return createTool({
|
|
11
|
+
id: "web_search",
|
|
12
|
+
description: prompt("tools", "tool.web_search"),
|
|
13
|
+
inputSchema: z.object({
|
|
14
|
+
query: z.string().min(1).max(500).describe("What to search for, as one would type it"),
|
|
15
|
+
num: z.number().int().min(1).max(10).optional().describe("How many results, 6 by default"),
|
|
16
|
+
}),
|
|
17
|
+
execute: async ({ query, num }, options) => {
|
|
18
|
+
const res = await fetch(`${access.baseUrl}/v1/web/search`, {
|
|
19
|
+
method: "POST",
|
|
20
|
+
signal: options?.abortSignal,
|
|
21
|
+
headers: {
|
|
22
|
+
authorization: `Bearer ${access.token}`,
|
|
23
|
+
"content-type": "application/json",
|
|
24
|
+
...(access.tenant ? { "x-wizards-tenant": access.tenant } : {}),
|
|
25
|
+
...(meta.runId ? { "x-wizards-run": meta.runId } : {}),
|
|
26
|
+
},
|
|
27
|
+
body: JSON.stringify({ query, ...(num ? { num } : {}) }),
|
|
28
|
+
});
|
|
29
|
+
const body = (await res.json().catch(() => null));
|
|
30
|
+
if (!res.ok) {
|
|
31
|
+
return { error: body?.error?.message ?? `The web search answered ${res.status}.` };
|
|
32
|
+
}
|
|
33
|
+
return { results: body?.results ?? [] };
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Yn as r,an as i,hn as a,in as o,nn as s,pn as c,rn as l,un as u}from"./ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Yn as r,an as i,hn as a,in as o,nn as s,pn as c,rn as l,un as u}from"./ui-BacfkQ7Q.js";import{t as d}from"./preload-helper-DpV6A1kQ.js";import{c as f,n as p}from"./marked.esm-DQ7XA7AC.js";import{t as m}from"./logo-BpnjXTRy.js";import{s as h}from"./i18n-DCPDesT-.js";import{g,h as _,m as v,t as y,u as b}from"./UpdateCheck-DVgAJmy8.js";import{ReleaseNotes as x,loadReleases as S,releaseDate as C,releaseLabel as w}from"./ChangelogDialog-BhyilZWA.js";var T=e(t(),1),E=[{name:`engenty wizards`,description:`credit.engenty-wizards`,homepage:`https://github.com/engenty/wizards`,license:`FSL-1.1-MIT`},{name:`engenty`,description:`credit.engenty`,homepage:`https://github.com/engenty/engenty`,license:`FSL-1.1-MIT`}],D=[{name:`Mastra`,description:`credit.mastra`,homepage:`https://github.com/mastra-ai/mastra`,license:`Apache-2.0`},{name:`AI SDK`,description:`credit.ai-sdk`,homepage:`https://github.com/vercel/ai`,license:`Apache-2.0`},{name:`Model Context Protocol`,description:`credit.model-context-protocol`,homepage:`https://github.com/modelcontextprotocol/typescript-sdk`,license:`MIT`},{name:`Hono`,description:`credit.hono`,homepage:`https://github.com/honojs/hono`,license:`MIT`},{name:`Drizzle ORM`,description:`credit.drizzle-orm`,homepage:`https://github.com/drizzle-team/drizzle-orm`,license:`Apache-2.0`},{name:`libSQL`,description:`credit.libsql`,homepage:`https://github.com/tursodatabase/libsql`,license:`MIT`},{name:`Playwright`,description:`credit.playwright`,homepage:`https://github.com/microsoft/playwright`,license:`Apache-2.0`},{name:`React`,description:`credit.react`,homepage:`https://github.com/facebook/react`,license:`MIT`},{name:`Vite`,description:`credit.vite`,homepage:`https://github.com/vitejs/vite`,license:`MIT`},{name:`Tailwind CSS`,description:`credit.tailwind-css`,homepage:`https://github.com/tailwindlabs/tailwindcss`,license:`MIT`},{name:`React Flow`,description:`credit.react-flow`,homepage:`https://github.com/xyflow/xyflow`,license:`MIT`},{name:`TanStack Query`,description:`credit.tanstack-query`,homepage:`https://github.com/TanStack/query`,license:`MIT`},{name:`xterm.js`,description:`credit.xterm-js`,homepage:`https://github.com/xtermjs/xterm.js`,license:`MIT`},{name:`Lucide`,description:`credit.lucide`,homepage:`https://github.com/lucide-icons/lucide`,license:`ISC`},{name:`Geist & Geist Mono`,description:`credit.geist-geist-mono`,homepage:`https://github.com/vercel/geist-font`,license:`OFL-1.1`},{name:`Space Grotesk`,description:`credit.space-grotesk`,homepage:`https://github.com/floriankarsten/space-grotesk`,license:`OFL-1.1`},{name:`git-cliff`,description:`credit.git-cliff`,homepage:`https://github.com/orhun/git-cliff`,license:`MIT OR Apache-2.0`}],O=e(n(),1),k=(e,...t)=>t.some(t=>t?.toLowerCase().includes(e));function A({name:e,homepage:t,version:n,license:r,description:i}){return(0,O.jsxs)(`li`,{className:`py-2.5`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,children:[t?(0,O.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 font-medium text-[0.875rem] text-ink underline-offset-4 hover:underline`,children:[e,(0,O.jsx)(f,{"aria-hidden":!0,className:`size-3 text-ink-4`})]}):(0,O.jsx)(`span`,{className:`font-medium text-[0.875rem] text-ink`,children:e}),n?(0,O.jsx)(`span`,{className:`text-[0.75rem] text-ink-3 tabular-nums`,children:n}):null,(0,O.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:r})]}),i?(0,O.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:i}):null]})}function j({title:e,hint:t,children:n}){return(0,O.jsxs)(`section`,{className:`mt-6`,children:[(0,O.jsx)(`h3`,{className:`border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:e}),t?(0,O.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3`,children:t}):null,n]})}function M({credits:e}){return(0,O.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:e.map(e=>(0,O.jsx)(A,{name:e.name,homepage:e.homepage,license:e.license,description:h(e.description)},e.name))})}function N({label:e,packages:t}){return(0,O.jsxs)(`div`,{className:`mt-4`,children:[(0,O.jsx)(`h4`,{className:`font-medium text-[0.75rem] text-ink-3 tracking-wide`,children:e}),(0,O.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:t.map(e=>(0,O.jsx)(A,{...e},e.name))})]})}function P({active:e}){let[t,n]=(0,T.useState)(null),[r,a]=(0,T.useState)(``);(0,T.useEffect)(()=>{if(!e||t)return;let r=!1;return d(()=>import(`./oss-credits-BrwV0a4F.js`).then(e=>{r||n(e.default)}),[]),()=>{r=!0}},[e,t]),(0,T.useEffect)(()=>{e||a(``)},[e]);let o=r.trim().toLowerCase(),s=e=>o?e.filter(e=>k(o,e.name,e.license,h(e.description))):e,c=e=>o?e.filter(e=>k(o,e.name,e.license,e.version)):e,f=s(E),p=s(D),m=t?[{id:`shared`,label:h(`about.creditsShared`),packages:c(t.shared)},...t.groups.map(e=>({id:e.id,label:e.label,packages:c(e.packages)}))].filter(e=>e.packages.length>0):[],g=f.length===0&&p.length===0&&m.length===0;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-3`,children:h(`about.creditsHint`)}),(0,O.jsx)(i,{type:`search`,value:r,placeholder:h(`about.search`),onChange:e=>a(e.target.value)}),f.length>0?(0,O.jsx)(j,{title:h(`about.creditsProduct`),children:(0,O.jsx)(M,{credits:f})}):null,p.length>0?(0,O.jsx)(j,{title:h(`about.creditsBuiltWith`),children:(0,O.jsx)(M,{credits:p})}):null,t===null?(0,O.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,O.jsx)(u,{})}):m.length>0?(0,O.jsx)(j,{title:h(`about.creditsDeps`),hint:o?void 0:h(`about.creditsDepsHint`),children:m.map(e=>(0,O.jsx)(N,{label:e.label,packages:e.packages},e.id))}):null,t!==null&&g?(0,O.jsx)(l,{children:h(`about.noMatches`)}):null]})}var F=[`new`,`earlier`,`credits`],I=e=>h(e===`new`?`about.tab.new`:e===`earlier`?`about.tab.earlier`:`about.credits`),L=e=>e===1?h(`about.change`):h(`about.changes`,{n:e});function R({me:e,active:t,initialTab:n=`new`}){let i=e?.mode===`local`,{data:o,latest:s}=_(i&&t),[l,d]=(0,T.useState)(null),[f,p]=(0,T.useState)(n);(0,T.useEffect)(()=>p(n),[n]);let E=v(F.indexOf(f)),D=o?.newer&&s?s:g;(0,T.useEffect)(()=>{if(!t)return;let e=!1;return d(null),S(D===`0.17.1`?void 0:D).then(t=>{e||d(t)}),()=>{e=!0}},[t,D]);let k=l?.find(e=>e.version===`v${D}`)??l?.[0]??null,A=l?.filter(e=>e!==k)??[],j=i?o?.kind??null:`cloud`;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`flex flex-col items-center pt-4 text-center`,children:[(0,O.jsx)(m,{size:96}),(0,O.jsxs)(`div`,{className:`mt-4 font-display font-semibold text-[1.5rem] tracking-tight`,children:[`engenty`,(0,O.jsx)(`span`,{className:`text-ember`,children:`.`}),(0,O.jsx)(`span`,{className:`ml-1.5 font-normal text-ink-3`,children:`wizards`})]}),(0,O.jsxs)(`div`,{className:`mt-1 text-[0.9375rem] text-ink-3 tabular-nums`,children:[h(`about.version`,{v:g}),j?` · ${h(`about.kind.${j}`)}`:``]})]}),i?(0,O.jsx)(`div`,{className:`mt-5`,children:(0,O.jsx)(y,{enabled:t})}):null,(0,O.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,O.jsx)(c,{value:f,onChange:p,options:F.map(e=>({id:e,label:I(e)})),label:h(`about.title`)})}),(0,O.jsxs)(`div`,{className:a(`mt-5`,b(E)),children:[f===`new`?l===null?(0,O.jsx)(`div`,{className:`flex justify-center py-6 text-ink-3`,children:(0,O.jsx)(u,{})}):k?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`h3`,{className:`flex items-baseline gap-3 border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:[w(k),(0,O.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:C(k)})]}),(0,O.jsx)(`div`,{className:`mt-3`,children:(0,O.jsx)(x,{release:k})})]}):(0,O.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:h(`about.changelogEmpty`)}):null,f===`earlier`?(0,O.jsx)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:A.map(e=>(0,O.jsxs)(`details`,{className:`group/r py-2`,children:[(0,O.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-baseline gap-3 text-[0.875rem] [&::-webkit-details-marker]:hidden`,children:[(0,O.jsx)(r,{className:`size-3.5 shrink-0 self-center text-ink-4 transition group-open/r:rotate-90`}),(0,O.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:w(e)}),(0,O.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3 tabular-nums`,children:C(e)}),(0,O.jsx)(`span`,{className:`ml-auto text-[0.8125rem] text-ink-4`,children:L(e.commits.length)})]}),(0,O.jsx)(`div`,{className:`mt-2 pl-6`,children:(0,O.jsx)(x,{release:e})})]},e.version??`unreleased`))}):null,f===`credits`?(0,O.jsx)(P,{active:!0}):null]},f)]})}function z({open:e,onClose:t,me:n}){return(0,O.jsxs)(s,{open:e,onClose:t,wide:!0,height:`tall`,children:[(0,O.jsx)(`div`,{className:`-mt-2 -mr-2 sticky top-0 z-10 flex h-0 justify-end`,children:(0,O.jsx)(o,{label:h(`common.close`),onClick:t,children:(0,O.jsx)(p,{className:`size-4`})})}),(0,O.jsx)(R,{me:n,active:e})]})}export{z as AboutDialog,R as AboutPanel};
|