@xopcai/xopc 0.0.311 → 0.0.312
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/README.md +2 -1
- package/README.zh-CN.md +2 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-zKINl7UH.js → agent-avatar-dicebear-BVIJMP8w.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-D2ePZKdY.js → agent-defaults-settings-panel-K3hTmu9d.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-BiD9STyv.js → agents-D6g_SeWI.js} +1 -1
- package/dist/gateway/static/root/assets/app-link-CKueEVbT.js +1 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-C94LAxyt.js → app-management-settings-panel-CLg_aXYG.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CP01zHvC.js → appearance-settings-CU52MfIT.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-ZpA1-6ad.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-SwWFt5MT.js → archive-plugin-CHO3heHX.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-DdTFml9l.js → attachment-load-BsmsBCI2.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-Kmr5WVFp.js → automations-page-CftigJlf.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-bkijiu-Y.js → automations-workspace-IEAxKRME.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-47UTtDNq.js → binary-plugins-CRCLWBo2.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DvzZkMG8.js → block-editor-D0LDiOTT.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-DrUKNL9X.js → browser-automations-page-Djyv3vy-.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-Dhf_MWCf.js → browser-settings-page-CU4VWsmX.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-BCubrDf8.js → capabilities-settings-panel-C9XQk3HL.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-e4T1DEfN.js → channels-settings-Bqlhjooi.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Bg_m7HUE.js → chat-terminal-dock-CIsKqdET.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-CosCmVsT.js → computer-settings-page-C0YL9J7m.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BL-hSR7_.js → connector-service-page-BmH17JnO.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-C0WWxnxJ.js → connectors-page-zkx8Q-e6.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-DqYFVasF.js → date-picker-CDsfv8R0.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-DCyyFLKp.js → dependency-picker-DvhPj3CZ.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CFnnpRA_.js → desktop-pet-Cyg8XMpL.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-U5wWRH4c.js → desktop-pet-settings-CE4GOlMM.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-BhHxvFO1.js → device-pairing-wizard-CdKJqnnw.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DA8WJ3-E.js → extension-debug-page-D-AVJU3q.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-C2BIB88m.js → extension-page-DrFoQ9xt.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-kpYo979N.js → extension-settings-page-DxWjESC1.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CE9t1yTa.js → gateway-settings-CgXp2zq4.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-C7Ezx8Du.js → home-page-D6Idk732.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-NPk698vI.js → imports-page-BKucJlXI.js} +1 -1
- package/dist/gateway/static/root/assets/{index-DxYitLp8.js → index-PFQHPGgi.js} +45 -45
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BhreF0_O.js → keyboard-shortcuts-settings-BxLXD-yU.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CPmynb3x.js → local-app-workbench-page-BmAqTRb4.js} +2 -2
- package/dist/gateway/static/root/assets/{local-apps-page-DOZZBdqj.js → local-apps-page-BAsQJQKJ.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-M8kz26yo.js → logs-page-ZjVYXXyM.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-JLqHYQvY.js → management-settings-CSTkYVOZ.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BDpcjR_Z.js → markdown-view-DYGPxPee.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-B75SWUJd.js → media-plugins-CQtQzLyg.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-B_Ft0M32.js → note-detail-panel-DuXCt-MM.js} +3 -3
- package/dist/gateway/static/root/assets/notes-page-BjOgBVq5.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-CMlQUzT6.js → page-tabs-B6DjkyMM.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-cZ2hszQT.js → preview-open-alternatives-Dn57uLhr.js} +1 -1
- package/dist/gateway/static/root/assets/product-delivery-CrAI8ZEa.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-CPoSbglF.js → product-open-page-H2YMk8TY.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-DYttWua0.js → project-detail-page-0zi4-i9X.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-D46drWbl.js → projects-page-B18OxmJj.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-C9n9Nuhi.js → remote-access-hub-z-DxbuaE.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-bMLWRApp.js → runtime-tools-settings-panel-DGsBTbo6.js} +1 -1
- package/dist/gateway/static/root/assets/scenes-page-Bgba03B_.js +1 -0
- package/dist/gateway/static/root/assets/{schema-form-UVJV_7AS.js → schema-form-CblI9WUA.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-C8P6ff91.js → sessions-page-B1t3bMsm.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CBX0Ezhf.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BqzOqonM.js → settings-form-section-BAaVyxJH.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DQ9RJ8-b.js → settings-page-CKNPbm5q.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-D3Spald3.js → settings-page-layout-DqNCGKxQ.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-C8u601m8.js → setup-status-panel-Bw71C2X3.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BcgYzA7y.js → share-preview-page-BzMfp_HM.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-Bv-2rZ8e.js → shares-settings-BoVDQolc.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-LM-cgWUS.js → skill-reload-api-DtTptpAt.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-ggmb7rCW.js → skills-page-DIht92q6.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-ADABzrtk.js → skills-page.utils-DLYRiEn3.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DfkcW_Za.js → system-settings-panel-yYs4YgYk.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-DC4yqDFd.js → task-detail-page-vgkiGo-D.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-CTuwTdMm.js → tunnel-api-BasDYxvx.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-5ZDd9XKh.js → use-autosave-CWAUHhcb.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-BFKFhdZ0.js → user-model-page-CAGafNfP.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-D3urfd-n.js → voice-api-key-field-Kc4UlxZs.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-JzM3Ylbs.js → work-discovery-overlay-BPC_c9dO.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Bn2CtRdB.js → workflow-run-setup-panel-DBTciOrq.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-BiCmt98A.js → workflows-page-CSxHVs1p.js} +1 -1
- package/dist/gateway/static/root/index.html +4 -4
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/product-delivery.js +1 -0
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +43 -16
- package/dist/src/agent/tools/xopc-use-tool.js +60 -3
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/schema.d.ts +9 -0
- package/dist/src/config/schema.js +8 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +3 -0
- package/dist/src/gateway/hono/lib/config-payload.js +1 -0
- package/dist/src/gateway/scenes/host.js +5 -4
- package/dist/src/gateway/service.js +2 -2
- package/dist/src/scenes/metrics.d.ts +3 -1
- package/dist/src/scenes/metrics.js +7 -1
- package/dist/src/scenes/model.d.ts +3 -0
- package/dist/src/scenes/model.js +10 -0
- package/package.json +4 -4
- package/dist/gateway/static/root/assets/app-link-wamYbNUl.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-B7DmSJQj.js +0 -1
- package/dist/gateway/static/root/assets/notes-page-C32mxSD-.js +0 -8
- package/dist/gateway/static/root/assets/product-delivery-CCC4FJ3Y.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-Dw3hmHAr.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-whpUsAy3.js +0 -1
|
@@ -8,7 +8,7 @@ Load this manual before a non-trivial mutation.
|
|
|
8
8
|
|
|
9
9
|
\`\`\`json
|
|
10
10
|
{
|
|
11
|
-
"mode": "
|
|
11
|
+
"mode": "scene | project | automation | note | task | task_run | local_app | settings",
|
|
12
12
|
"command": "...",
|
|
13
13
|
"args": {},
|
|
14
14
|
"dryRun": false
|
|
@@ -18,19 +18,18 @@ Load this manual before a non-trivial mutation.
|
|
|
18
18
|
Send one object command per call. Inspect the returned JSON \`ok\` field; a tool call can
|
|
19
19
|
complete successfully while the product command returns \`ok: false\`.
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Scene delegation
|
|
22
22
|
|
|
23
|
-
Use mode
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
On a communication card, continue_card with its id reads current work and binds this conversation to the delegation.
|
|
28
|
-
Use the returned exact connectionId when retrieving or replying to the thread. Review current recipients and the full draft with the user and retain connector confirmation for sending. Never mark sent from an approval alone; require a successful provider receipt. The delegation continues watching synchronized replies until explicitly ended.
|
|
23
|
+
Use mode \`scene\` only after the user explicitly delegates recurring or future work. Inspect
|
|
24
|
+
\`list\` before \`start\`; configure an existing matching scene instead of creating a duplicate.
|
|
25
|
+
Confirm the goal, source scope, timing, promised result, and read-only action boundary in ordinary
|
|
26
|
+
language. A scene prepares suggestions or drafts and never sends mail or performs external writes.
|
|
29
27
|
|
|
30
28
|
## Object routing
|
|
31
29
|
|
|
32
30
|
| Object | Tool |
|
|
33
31
|
| --- | --- |
|
|
32
|
+
| Scene and scene result | \`xopc_use\` mode \`scene\` |
|
|
34
33
|
| Project, milestone, project update | \`xopc_use\` mode \`project\` |
|
|
35
34
|
| Automation | \`xopc_use\` mode \`automation\` |
|
|
36
35
|
| Task intent and lifecycle | \`xopc_use\` mode \`task\` |
|
|
@@ -58,15 +57,43 @@ Timestamps are Unix epoch milliseconds. Array fields are arrays of strings. Omis
|
|
|
58
57
|
preserves a patchable field; an empty array intentionally clears it. Prefer explicit
|
|
59
58
|
\`projectId\`, \`taskId\`, \`runId\`, \`noteId\`, and \`localAppId\` fields over \`id\`.
|
|
60
59
|
|
|
61
|
-
##
|
|
60
|
+
## Scenes
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
|
|
62
|
+
Commands: \`templates\`, \`list\`, \`get\`, \`mail_accounts\`, \`mail_search\`,
|
|
63
|
+
\`mail_sources\`, \`read_notes\`, \`preflight\`, \`start\`, \`configure\`, \`transition\`,
|
|
64
|
+
\`check\`, \`notes\`, \`work_item\`, \`update_work_item\`, \`schedule\`, \`results\`,
|
|
65
|
+
\`feedback\`, \`mark_read\`, \`diagnostics\`, \`get_preferences\`, and \`set_preferences\`.
|
|
66
|
+
|
|
67
|
+
The built-in templates are \`weekly-family-plan\` and \`mail-follow-up\`, currently version
|
|
68
|
+
\`1.0.0\`. Discover templates instead of guessing keys or versions. Timestamps are Unix epoch
|
|
69
|
+
milliseconds. Use \`preflight\` or \`dryRun: true\` before \`start\` when account or model readiness
|
|
70
|
+
is uncertain.
|
|
71
|
+
|
|
72
|
+
### Safe start protocol
|
|
73
|
+
|
|
74
|
+
1. Call \`list\` and reuse a matching activation when one exists.
|
|
75
|
+
2. Call \`templates\`; for mail, call \`mail_accounts\` and \`mail_search\` with the exact account.
|
|
76
|
+
3. Explain the selected source and timing to the user before creating the scene.
|
|
77
|
+
4. Call \`preflight\` with the complete start input.
|
|
78
|
+
5. Call \`start\` with the same input and a stable \`requestId\` for retry safety.
|
|
79
|
+
6. Add notes, a work item, or a schedule as required; then call \`get\` to verify the state.
|
|
80
|
+
|
|
81
|
+
Family plans use scope \`{ "kind": "personal" }\` and permissions with only
|
|
82
|
+
\`user_notes\`. Mail follow-up uses one selected mail source in an objects scope and exactly one
|
|
83
|
+
authorized account. Never broaden either scope to make preflight pass.
|
|
84
|
+
|
|
85
|
+
### Mutations and results
|
|
86
|
+
|
|
87
|
+
Read the current activation \`revision\` before \`configure\` or \`transition\`. Read the current
|
|
88
|
+
notes, schedule, work-item, or feedback revision before changing that object. On a conflict,
|
|
89
|
+
read again and reconsider; do not retry with a guessed revision.
|
|
90
|
+
|
|
91
|
+
\`check\` queues work and does not mean a result already exists. Use a stable \`requestId\` and
|
|
92
|
+
inspect \`results\` later. \`no_change\` intentionally creates no user-facing draft. A returned
|
|
93
|
+
draft is not a sent message. Use \`diagnostics\` for source, model, queue, or notification failures.
|
|
94
|
+
|
|
95
|
+
Scene preferences control checks and reminders globally for the current principal. Read them
|
|
96
|
+
with \`get_preferences\` before \`set_preferences\`; preserve fields the user did not ask to change.
|
|
70
97
|
|
|
71
98
|
## Projects
|
|
72
99
|
|
|
@@ -39,7 +39,7 @@ const XopcUseToolSchema = Type.Object({
|
|
|
39
39
|
Type.Literal("local_app"),
|
|
40
40
|
Type.Literal("settings")
|
|
41
41
|
]),
|
|
42
|
-
command: Type.String({ description: "Object command. Scene commands: templates, list, get {id}, mail_accounts, mail_search {accountId, query}, mail_sources, preflight/start {templateKey, templateVersion, goal, scope, permissions}, configure {id, expectedRevision, goal, scope, permissions}, transition {id, expectedRevision, status: paused|active|completed|archived}, check {id}, notes {id, expectedRevision, content, validUntil?}, work_item {id, subjectId, accountId, dueAt}, schedule {id, triggerKey, expectedRevision, schedule}, results {id}. Start and check accept a stable requestId for retries. Scenes prepare read-only suggestions and drafts; never send mail. Only create a scene for work explicitly delegated by the user; inspect existing scenes first. Supports project list/get/create/update/resolve_workspace/list_milestones/create_milestone/update_milestone/list_updates/create_update, automation list/get/create/update/delete/run/pause/resume/history, note list/get/create/append/update/preview_edit/delete, task list/get/create/update_dependencies/add_context/remove_context/command/delete, task_run list/get/cancel, local_app list/get/create/validate, and settings open." }),
|
|
42
|
+
command: Type.String({ description: "Object command. Scene commands: templates, list, get {id}, mail_accounts, mail_search {accountId, query}, mail_sources, read_notes {id}, preflight/start {templateKey, templateVersion, goal, scope, permissions}, configure {id, expectedRevision, goal, scope, permissions}, transition {id, expectedRevision, status: paused|active|completed|archived}, check {id}, notes {id, expectedRevision, content, validUntil?}, work_item {id, subjectId, accountId, dueAt}, update_work_item {workItemId, expectedRevision, dueAt?, status?}, schedule {id, triggerKey, expectedRevision, schedule}, results {id?}, feedback {presentationId, expectedRevision, rating}, mark_read {presentationId, read}, diagnostics, get_preferences, set_preferences {expectedRevision, ...preferences}. Start and check accept a stable requestId for retries. Scenes prepare read-only suggestions and drafts; never send mail. Only create a scene for work explicitly delegated by the user; inspect existing scenes first. Supports project list/get/create/update/resolve_workspace/list_milestones/create_milestone/update_milestone/list_updates/create_update, automation list/get/create/update/delete/run/pause/resume/history, note list/get/create/append/update/preview_edit/delete, task list/get/create/update_dependencies/add_context/remove_context/command/delete, task_run list/get/cancel, local_app list/get/create/validate, and settings open." }),
|
|
43
43
|
args: Type.Optional(Type.Record(Type.String(), Type.Any())),
|
|
44
44
|
dryRun: Type.Optional(Type.Boolean({ description: "Validate and preview the action without mutating xopc state." }))
|
|
45
45
|
});
|
|
@@ -223,6 +223,21 @@ function deliveryForXopcResult(mode, command, result, dryRun) {
|
|
|
223
223
|
]
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
|
+
} else if (mode === "scene") {
|
|
227
|
+
source = record(resultRecord.activation);
|
|
228
|
+
const id = deliveryText(source?.id);
|
|
229
|
+
if (id) primary = {
|
|
230
|
+
kind: "scene",
|
|
231
|
+
id,
|
|
232
|
+
title: deliveryText(source?.goal) ?? "Scene",
|
|
233
|
+
status: deliveryText(source?.status),
|
|
234
|
+
revision: deliveryRevision(source?.revision),
|
|
235
|
+
capabilities: [
|
|
236
|
+
"open",
|
|
237
|
+
"edit",
|
|
238
|
+
"continue_in_chat"
|
|
239
|
+
]
|
|
240
|
+
};
|
|
226
241
|
} else if (mode === "note") {
|
|
227
242
|
source = record(resultRecord.note);
|
|
228
243
|
const id = deliveryText(source?.id);
|
|
@@ -314,7 +329,7 @@ function deliveryForXopcResult(mode, command, result, dryRun) {
|
|
|
314
329
|
if (!primary) return void 0;
|
|
315
330
|
return {
|
|
316
331
|
version: 1,
|
|
317
|
-
operation: mode === "task" && deliveryText(resultRecord.runId) || mode === "automation" && command === "run" ? "started" : command === "create" ? "created" : command === "get" || command === "resolve_workspace" || mode === "settings" ? "opened" : command === "validate" ? "completed" : "updated",
|
|
332
|
+
operation: mode === "task" && deliveryText(resultRecord.runId) || mode === "automation" && command === "run" || mode === "scene" && command === "check" ? "started" : command === "create" || mode === "scene" && command === "start" ? "created" : command === "get" || command === "resolve_workspace" || mode === "settings" ? "opened" : command === "validate" ? "completed" : "updated",
|
|
318
333
|
primary
|
|
319
334
|
};
|
|
320
335
|
}
|
|
@@ -1763,7 +1778,7 @@ function createXopcUseTool(deps) {
|
|
|
1763
1778
|
return {
|
|
1764
1779
|
name: "xopc_use",
|
|
1765
1780
|
label: "XOPC Use",
|
|
1766
|
-
description: "Operate first-class xopc objects through one safe entry point. Use for projects, automations, notes, tasks, TaskRuns, local apps, and exact settings jump targets instead of editing storage files directly. For non-trivial object changes, load the built-in manual first with tool_manual({ tool: \"xopc_use\" }).",
|
|
1781
|
+
description: "Operate first-class xopc objects through one safe entry point. Use for scenes, projects, automations, notes, tasks, TaskRuns, local apps, and exact settings jump targets instead of editing storage files directly. For non-trivial object changes, load the built-in manual first with tool_manual({ tool: \"xopc_use\" }).",
|
|
1767
1782
|
parameters: XopcUseToolSchema,
|
|
1768
1783
|
mutatesWorkspace: true,
|
|
1769
1784
|
mutationScope: "external",
|
|
@@ -1839,8 +1854,27 @@ async function handleScene(command, args, deps, dryRun, toolCallId) {
|
|
|
1839
1854
|
if (command === "read_notes") return { notes: services.repository.readNotes(principal, activationId) };
|
|
1840
1855
|
if (command === "mail_sources") return { sources: services.mail.listSources(principal) };
|
|
1841
1856
|
if (command === "results") return { outcomes: services.repository.listInbox(principal, 50, "", activationId || null) };
|
|
1857
|
+
if (command === "diagnostics") return services.metrics.diagnostics(principal);
|
|
1858
|
+
if (command === "get_preferences") return services.preferences.get(principal);
|
|
1842
1859
|
if (command === "preflight" || command === "start" && dryRun) return services.application.preflight(principal, input);
|
|
1843
1860
|
if (dryRun) {
|
|
1861
|
+
if (command === "set_preferences") return {
|
|
1862
|
+
preview: true,
|
|
1863
|
+
command,
|
|
1864
|
+
input: args
|
|
1865
|
+
};
|
|
1866
|
+
if (command === "update_work_item") return {
|
|
1867
|
+
preview: true,
|
|
1868
|
+
command,
|
|
1869
|
+
workItemId: args.workItemId ?? id,
|
|
1870
|
+
input
|
|
1871
|
+
};
|
|
1872
|
+
if (command === "feedback" || command === "mark_read") return {
|
|
1873
|
+
preview: true,
|
|
1874
|
+
command,
|
|
1875
|
+
presentationId: args.presentationId ?? id,
|
|
1876
|
+
input
|
|
1877
|
+
};
|
|
1844
1878
|
services.repository.getActivation(principal, activationId);
|
|
1845
1879
|
return {
|
|
1846
1880
|
preview: true,
|
|
@@ -1855,7 +1889,30 @@ async function handleScene(command, args, deps, dryRun, toolCallId) {
|
|
|
1855
1889
|
if (command === "check") return { intentId: services.application.check(principal, activationId, request) };
|
|
1856
1890
|
if (command === "notes") return { revision: services.application.writeNotes(principal, activationId, input) };
|
|
1857
1891
|
if (command === "work_item") return { workItem: services.application.createWorkItem(principal, activationId, input) };
|
|
1892
|
+
if (command === "update_work_item") {
|
|
1893
|
+
const workItemId = typeof args.workItemId === "string" ? args.workItemId : activationId;
|
|
1894
|
+
const { workItemId: _workItemId, ...workItemInput } = args;
|
|
1895
|
+
return { workItem: services.application.updateWorkItem(principal, workItemId, workItemInput) };
|
|
1896
|
+
}
|
|
1858
1897
|
if (command === "schedule") return { revision: services.application.setSchedule(principal, activationId, String(triggerKey ?? ""), input) };
|
|
1898
|
+
if (command === "set_preferences") return services.preferences.update(principal, args);
|
|
1899
|
+
if (command === "feedback") {
|
|
1900
|
+
const presentationId = typeof args.presentationId === "string" ? args.presentationId : activationId;
|
|
1901
|
+
if (!presentationId.trim()) throw new Error("presentationId is required");
|
|
1902
|
+
const { presentationId: _presentationId, ...feedbackInput } = args;
|
|
1903
|
+
return { revision: services.inbox.feedback(principal, presentationId, feedbackInput) };
|
|
1904
|
+
}
|
|
1905
|
+
if (command === "mark_read") {
|
|
1906
|
+
const presentationId = typeof args.presentationId === "string" ? args.presentationId : activationId;
|
|
1907
|
+
if (!presentationId.trim()) throw new Error("presentationId is required");
|
|
1908
|
+
if (typeof args.read !== "boolean") throw new Error("read must be a boolean");
|
|
1909
|
+
services.inbox.setRead(principal, presentationId, args.read);
|
|
1910
|
+
return {
|
|
1911
|
+
ok: true,
|
|
1912
|
+
presentationId,
|
|
1913
|
+
read: args.read
|
|
1914
|
+
};
|
|
1915
|
+
}
|
|
1859
1916
|
throw new Error("Unsupported scene command");
|
|
1860
1917
|
}
|
|
1861
1918
|
//#endregion
|
package/dist/src/config/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ENV_VARS, XOPC_DB_FILENAME, resolveHomeDir, resolveStateDir, resolveXopcCloudCatalogCachePath, resolveXopcDatabasePath } from "./paths-state.js";
|
|
2
2
|
import { TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema } from "../../extensions/telegram/src/config-schema.js";
|
|
3
3
|
import { WeixinAccountConfigSchema, WeixinConfigSchema } from "../../extensions/weixin/src/config-schema.js";
|
|
4
|
-
import { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentsConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CommandsConfigSchema, ConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GatewayWebchatConfigSchema, HeartbeatConfigSchema, McpConfigSchema, McpOAuthConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelsDevConfigSchema, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, RuntimeToolsConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, UpdateAutoConfigSchema, UpdateConfigSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef } from "./schema.js";
|
|
4
|
+
import { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentsConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CommandsConfigSchema, ConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewayScenesConfigSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GatewayWebchatConfigSchema, HeartbeatConfigSchema, McpConfigSchema, McpOAuthConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelsDevConfigSchema, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, RuntimeToolsConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, UpdateAutoConfigSchema, UpdateConfigSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef } from "./schema.js";
|
|
5
5
|
import { applyConfigOverrides, getConfigOverrides, resetConfigOverrides, setConfigOverride, unsetConfigOverride } from "./runtime-overrides.js";
|
|
6
6
|
import { expandWorkspacePathString, init_workspace_path, normalizeWorkspaceDir, resolveWorkspaceRoot } from "./workspace-path.js";
|
|
7
7
|
import { resolveDefaultAgentWorkspaceDir } from "./workspace-defaults.js";
|
|
@@ -27,4 +27,4 @@ init_workspace_path();
|
|
|
27
27
|
init_models_json();
|
|
28
28
|
init_resolve_config_value();
|
|
29
29
|
//#endregion
|
|
30
|
-
export { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentsConfigSchema, BASE_RELOAD_RULES, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CommandsConfigSchema, ConfigHotReloader, ConfigSchema, ConnectorsConfigSchema, CustomModelSchema, ENV_VARS, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, FILENAMES, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GatewayWebchatConfigSchema, HeartbeatConfigSchema, ImageGenerationCapabilitiesSchema, ImageGenerationModelSchema, ImageGenerationProviderSchema, McpConfigSchema, McpOAuthConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelOverrideSchema, ModelsDevConfigSchema, ModelsJsonSchema, OpenAICompatSchema, OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema, OpenRouterRoutingSchema, ProfileManager, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, RuntimeToolsConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, UpdateAutoConfigSchema, UpdateConfigSchema, VercelGatewayRoutingSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WORKSPACE_FILES, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WeixinAccountConfigSchema, WeixinConfigSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, XOPC_DB_FILENAME, applyConfigOverrides, assertConfigRewriteSafeForRunningGateway, buildReloadPlan, canonicalizeConfiguredMcpServer, clearConfigValueCache, createProfile, deleteProfile, diffConfigPaths, existsSync, expandWorkspacePathString, extractProfileAgentId, formatThinkingLevels, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, getAllowedCommands, getCacheStats, getConfigOverrides, getCurrentProfile, getDefaultModelValues, resolveModelsJsonPath as getModelsJsonPath, getProfileManager, getProfileNameFromDir, getSwitchCommand, getWorkspacePath, hasBundledExtensionManifest, isKnownCliMcpTypeAlias, listAgentProfileMarkdownDirs, listAgentWorkspaceDirs, listProfiles, listThinkingLevels, loadConfig, loadModelsJson, matchReloadRule, modelsJsonExists, normalizeConfiguredMcpServers, normalizeElevatedMode, normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel, normalizeWorkspaceDir, parseModelRef, resetConfigOverrides, resolveAgentAuthProfilesPath, resolveAgentDir, resolveAgentDir$1 as resolveAgentDirFromConfig, resolveAgentHomeDir, resolveAgentHomeDir$1 as resolveAgentHomeDirFromConfig, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAgentWorkspaceDir, resolveAuthProfilesPath, resolveBinDir, resolveBundledExtensionsDir, resolveBundledSkillsDir, resolveConfigPath, resolveConfigValue, resolveCredentialsDir, resolveDefaultAgentWorkspaceDir, resolveEffectiveAgentConfigForAgent, resolveEffectiveAgentConfigForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession, resolveExtensionSdkPath, resolveExtensionsDir, resolveExtensionsLockPath, resolveHeaders, resolveHomeDir, resolveInboxDir, resolveInboxMessagePath, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogPath, resolveLogsDir, resolveMcpOAuthPath, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveProfileStateDir, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStateDir, resolveStatusPath, resolveToolsDir, resolveWorkspaceExtensionsDir, resolveWorkspaceFile, resolveWorkspaceRoot, resolveWorkspaceStateDir, resolveWorkspaceStatePath, resolveXopcBinPath, resolveXopcCloudCatalogCachePath, resolveXopcDatabasePath, resolveXopcMcpTransportAlias, saveConfig, saveModelsJson, setConfigOverride, testApiKeyResolution, thinkLevelToNumber, unsetConfigOverride, validateModelsConfig };
|
|
30
|
+
export { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentsConfigSchema, BASE_RELOAD_RULES, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CommandsConfigSchema, ConfigHotReloader, ConfigSchema, ConnectorsConfigSchema, CustomModelSchema, ENV_VARS, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, FILENAMES, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewayScenesConfigSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GatewayWebchatConfigSchema, HeartbeatConfigSchema, ImageGenerationCapabilitiesSchema, ImageGenerationModelSchema, ImageGenerationProviderSchema, McpConfigSchema, McpOAuthConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelOverrideSchema, ModelsDevConfigSchema, ModelsJsonSchema, OpenAICompatSchema, OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema, OpenRouterRoutingSchema, ProfileManager, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, RuntimeToolsConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, UpdateAutoConfigSchema, UpdateConfigSchema, VercelGatewayRoutingSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WORKSPACE_FILES, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WeixinAccountConfigSchema, WeixinConfigSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, XOPC_DB_FILENAME, applyConfigOverrides, assertConfigRewriteSafeForRunningGateway, buildReloadPlan, canonicalizeConfiguredMcpServer, clearConfigValueCache, createProfile, deleteProfile, diffConfigPaths, existsSync, expandWorkspacePathString, extractProfileAgentId, formatThinkingLevels, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, getAllowedCommands, getCacheStats, getConfigOverrides, getCurrentProfile, getDefaultModelValues, resolveModelsJsonPath as getModelsJsonPath, getProfileManager, getProfileNameFromDir, getSwitchCommand, getWorkspacePath, hasBundledExtensionManifest, isKnownCliMcpTypeAlias, listAgentProfileMarkdownDirs, listAgentWorkspaceDirs, listProfiles, listThinkingLevels, loadConfig, loadModelsJson, matchReloadRule, modelsJsonExists, normalizeConfiguredMcpServers, normalizeElevatedMode, normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel, normalizeWorkspaceDir, parseModelRef, resetConfigOverrides, resolveAgentAuthProfilesPath, resolveAgentDir, resolveAgentDir$1 as resolveAgentDirFromConfig, resolveAgentHomeDir, resolveAgentHomeDir$1 as resolveAgentHomeDirFromConfig, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAgentWorkspaceDir, resolveAuthProfilesPath, resolveBinDir, resolveBundledExtensionsDir, resolveBundledSkillsDir, resolveConfigPath, resolveConfigValue, resolveCredentialsDir, resolveDefaultAgentWorkspaceDir, resolveEffectiveAgentConfigForAgent, resolveEffectiveAgentConfigForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession, resolveExtensionSdkPath, resolveExtensionsDir, resolveExtensionsLockPath, resolveHeaders, resolveHomeDir, resolveInboxDir, resolveInboxMessagePath, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogPath, resolveLogsDir, resolveMcpOAuthPath, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveProfileStateDir, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStateDir, resolveStatusPath, resolveToolsDir, resolveWorkspaceExtensionsDir, resolveWorkspaceFile, resolveWorkspaceRoot, resolveWorkspaceStateDir, resolveWorkspaceStatePath, resolveXopcBinPath, resolveXopcCloudCatalogCachePath, resolveXopcDatabasePath, resolveXopcMcpTransportAlias, saveConfig, saveModelsJson, setConfigOverride, testApiKeyResolution, thinkLevelToNumber, unsetConfigOverride, validateModelsConfig };
|
|
@@ -771,6 +771,9 @@ export declare const GatewayWebchatConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
771
771
|
off: "off";
|
|
772
772
|
}>>;
|
|
773
773
|
}, z.core.$strip>>;
|
|
774
|
+
export declare const GatewayScenesConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
775
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
776
|
+
}, z.core.$strip>>;
|
|
774
777
|
export declare const GatewayConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
775
778
|
bind: z.ZodOptional<z.ZodEnum<{
|
|
776
779
|
custom: "custom";
|
|
@@ -863,6 +866,9 @@ export declare const GatewayConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
863
866
|
off: "off";
|
|
864
867
|
}>>;
|
|
865
868
|
}, z.core.$strip>>>;
|
|
869
|
+
scenes: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
870
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
871
|
+
}, z.core.$strip>>>;
|
|
866
872
|
corsOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
867
873
|
publicUrl: z.ZodOptional<z.ZodString>;
|
|
868
874
|
dangerouslyAllowHostHeaderOriginFallback: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1905,6 +1911,9 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
1905
1911
|
off: "off";
|
|
1906
1912
|
}>>;
|
|
1907
1913
|
}, z.core.$strip>>>;
|
|
1914
|
+
scenes: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
1915
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1916
|
+
}, z.core.$strip>>>;
|
|
1908
1917
|
corsOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1909
1918
|
publicUrl: z.ZodOptional<z.ZodString>;
|
|
1910
1919
|
dangerouslyAllowHostHeaderOriginFallback: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -38,7 +38,7 @@ function parseModelRef(ref) {
|
|
|
38
38
|
model: trimmed.slice(idx + 1).trim()
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
var AgentModelRefSchema, AgentImageGenerationModelSchema, AgentModelsSchema, AgentsConfigSchema, BrowserDriverSchema, BrowserHostnameSchema, BrowserConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, SessionDmScopeSchema, SessionStorageConfigSchema, SessionResetModeSchema, SessionResetConfigSchema, SessionResetByTypeSchema, SessionScopeSchema, SessionConfigSchema, ChannelsConfigSchema, SearchProviderEntrySchema, WebSearchConfigSchema, WebsiteBlocklistSchema, WebToolsConfigSchema, ToolsConfigSchema, RuntimePreferenceSchema, RuntimeProvisionSchema, RuntimeVersionRequestSchema, LanguageRuntimeSchema, DEFAULT_RUNTIME_TOOLS_CONFIG, RuntimeToolsConfigSchema, GatewayAuthRateLimitSchema, GatewaySecuritySchema, GatewayTrustedProxySchema, GatewayAuthSchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayRemoteSchema, GatewayTlsSchema, GatewayModeSchema, HeartbeatConfigSchema, GatewayChannelConnectDeferModeSchema, TunnelConsentSchema, TunnelConfigSchema, WorkspaceImportConfigSchema, WorkspaceConfigSchema, GatewayBindModeSchema, GatewayWebchatConfigSchema, GatewayConfigSchema, ModelsDevConfigSchema, ModelCatalogConfigSchema, SttProviderConfigCatchallSchema, STTProviderConfigSchema, STTFallbackConfigSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, STTConfigSchema, TtsProviderConfigCatchallSchema, TTSProviderConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSEdgeConfigSchema, TTSSummarizationConfigSchema, TTSConfigSchema, VoiceRefinementConfigSchema, VoiceConfigSchema, MessagesConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProviderAuthConfigSchema, ProvidersConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, UpdateAutoConfigSchema, UpdateConfigSchema, CommandsConfigSchema, TuiConfigSchema, McpHttpUrlSchema, ConnectorSecretReferenceSchema, McpConfigScalarSchema, McpOAuthConfigSchema, McpServerSchema, McpConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ConfigSchema;
|
|
41
|
+
var AgentModelRefSchema, AgentImageGenerationModelSchema, AgentModelsSchema, AgentsConfigSchema, BrowserDriverSchema, BrowserHostnameSchema, BrowserConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, SessionDmScopeSchema, SessionStorageConfigSchema, SessionResetModeSchema, SessionResetConfigSchema, SessionResetByTypeSchema, SessionScopeSchema, SessionConfigSchema, ChannelsConfigSchema, SearchProviderEntrySchema, WebSearchConfigSchema, WebsiteBlocklistSchema, WebToolsConfigSchema, ToolsConfigSchema, RuntimePreferenceSchema, RuntimeProvisionSchema, RuntimeVersionRequestSchema, LanguageRuntimeSchema, DEFAULT_RUNTIME_TOOLS_CONFIG, RuntimeToolsConfigSchema, GatewayAuthRateLimitSchema, GatewaySecuritySchema, GatewayTrustedProxySchema, GatewayAuthSchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayRemoteSchema, GatewayTlsSchema, GatewayModeSchema, HeartbeatConfigSchema, GatewayChannelConnectDeferModeSchema, TunnelConsentSchema, TunnelConfigSchema, WorkspaceImportConfigSchema, WorkspaceConfigSchema, GatewayBindModeSchema, GatewayWebchatConfigSchema, GatewayScenesConfigSchema, GatewayConfigSchema, ModelsDevConfigSchema, ModelCatalogConfigSchema, SttProviderConfigCatchallSchema, STTProviderConfigSchema, STTFallbackConfigSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, STTConfigSchema, TtsProviderConfigCatchallSchema, TTSProviderConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSEdgeConfigSchema, TTSSummarizationConfigSchema, TTSConfigSchema, VoiceRefinementConfigSchema, VoiceConfigSchema, MessagesConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProviderAuthConfigSchema, ProvidersConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, UpdateAutoConfigSchema, UpdateConfigSchema, CommandsConfigSchema, TuiConfigSchema, McpHttpUrlSchema, ConnectorSecretReferenceSchema, McpConfigScalarSchema, McpOAuthConfigSchema, McpServerSchema, McpConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ConfigSchema;
|
|
42
42
|
var init_schema = __esmMin((() => {
|
|
43
43
|
init_config();
|
|
44
44
|
init_agent_config();
|
|
@@ -484,6 +484,9 @@ activityDetailDefault: z.enum([
|
|
|
484
484
|
"on",
|
|
485
485
|
"stream"
|
|
486
486
|
]).default("on") }).default({ activityDetailDefault: "on" });
|
|
487
|
+
GatewayScenesConfigSchema = z.object({
|
|
488
|
+
/** Explicit opt-in while real-device and sustained-load launch gates remain open. */
|
|
489
|
+
enabled: z.boolean().default(false) }).default({ enabled: false });
|
|
487
490
|
GatewayConfigSchema = z.object({
|
|
488
491
|
/** Semantic bind mode. */
|
|
489
492
|
bind: GatewayBindModeSchema.optional(),
|
|
@@ -499,6 +502,7 @@ activityDetailDefault: z.enum([
|
|
|
499
502
|
auth: GatewayAuthSchema.optional(),
|
|
500
503
|
heartbeat: z.preprocess(() => void 0, HeartbeatConfigSchema.optional()),
|
|
501
504
|
webchat: GatewayWebchatConfigSchema.optional(),
|
|
505
|
+
scenes: GatewayScenesConfigSchema.optional(),
|
|
502
506
|
corsOrigins: z.array(z.string()).optional(),
|
|
503
507
|
/**
|
|
504
508
|
* Reverse-proxy publicly reachable URL (e.g. `https://gateway.example.com`).
|
|
@@ -685,6 +689,7 @@ activityDetailDefault: z.enum([
|
|
|
685
689
|
port: 18790,
|
|
686
690
|
auth: { mode: "token" },
|
|
687
691
|
webchat: { activityDetailDefault: "on" },
|
|
692
|
+
scenes: { enabled: false },
|
|
688
693
|
corsOrigins: [],
|
|
689
694
|
skillsMarketplaceProvider: "store",
|
|
690
695
|
skillsStoreBaseUrl: "https://store.xopc.ai"
|
|
@@ -1145,6 +1150,7 @@ workDiscoveryOnboarding: z.boolean().default(true) }).strict().default({ workDis
|
|
|
1145
1150
|
port: 18790,
|
|
1146
1151
|
auth: { mode: "token" },
|
|
1147
1152
|
webchat: { activityDetailDefault: "on" },
|
|
1153
|
+
scenes: { enabled: false },
|
|
1148
1154
|
corsOrigins: [],
|
|
1149
1155
|
skillsMarketplaceProvider: "store",
|
|
1150
1156
|
skillsStoreBaseUrl: "https://store.xopc.ai"
|
|
@@ -1200,4 +1206,4 @@ workDiscoveryOnboarding: z.boolean().default(true) }).strict().default({ workDis
|
|
|
1200
1206
|
}));
|
|
1201
1207
|
//#endregion
|
|
1202
1208
|
init_schema();
|
|
1203
|
-
export { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentsConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CommandsConfigSchema, ConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GatewayWebchatConfigSchema, HeartbeatConfigSchema, McpConfigSchema, McpOAuthConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelsDevConfigSchema, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, RuntimeToolsConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, UpdateAutoConfigSchema, UpdateConfigSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WeixinAccountConfigSchema, WeixinConfigSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef };
|
|
1209
|
+
export { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentsConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CommandsConfigSchema, ConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewayScenesConfigSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GatewayWebchatConfigSchema, HeartbeatConfigSchema, McpConfigSchema, McpOAuthConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelsDevConfigSchema, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, RuntimeToolsConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, UpdateAutoConfigSchema, UpdateConfigSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WeixinAccountConfigSchema, WeixinConfigSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef };
|
|
@@ -179,6 +179,9 @@ export declare function buildSafeWebConfigPayload(service: GatewayService, optio
|
|
|
179
179
|
webchat: {
|
|
180
180
|
activityDetailDefault: "stream" | "on" | "off";
|
|
181
181
|
};
|
|
182
|
+
scenes: {
|
|
183
|
+
enabled: boolean;
|
|
184
|
+
};
|
|
182
185
|
channelConnectDeferMode: "explicit" | "off" | "auto";
|
|
183
186
|
channelConnectDeferIds: string[];
|
|
184
187
|
channelConnectDeferSkipIds: string[];
|
|
@@ -125,6 +125,7 @@ async function buildSafeWebConfigPayload(service, options = {}) {
|
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
127
|
webchat: { activityDetailDefault: config.gateway?.webchat?.activityDetailDefault ?? "on" },
|
|
128
|
+
scenes: { enabled: config.gateway?.scenes?.enabled === true },
|
|
128
129
|
channelConnectDeferMode: config.gateway?.channelConnectDeferMode ?? "auto",
|
|
129
130
|
channelConnectDeferIds: Array.isArray(config.gateway?.channelConnectDeferIds) ? config.gateway.channelConnectDeferIds : [],
|
|
130
131
|
channelConnectDeferSkipIds: Array.isArray(config.gateway?.channelConnectDeferSkipIds) ? config.gateway.channelConnectDeferSkipIds : [],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { assertSceneStorageReady, init_scenes_schema } from "../../storage/sqlite/scenes-schema.js";
|
|
4
|
-
import {
|
|
4
|
+
import { init_providers, isProviderConfiguredSync, resolveModel } from "../../providers/index.js";
|
|
5
5
|
import { BrowserSubscriptionService } from "../../notifications/browserSubscriptions.js";
|
|
6
6
|
import { SceneRepository } from "../../scenes/repository.js";
|
|
7
7
|
import { ScenePreferenceService } from "../../scenes/preferences.js";
|
|
@@ -11,6 +11,7 @@ import { SceneInboxService } from "../../scenes/inbox.js";
|
|
|
11
11
|
import { SceneMailObservationService } from "../../scenes/mailObservations.js";
|
|
12
12
|
import { maintainSceneStorage } from "../../scenes/maintenance.js";
|
|
13
13
|
import { SceneMetrics } from "../../scenes/metrics.js";
|
|
14
|
+
import { resolveSceneModelRef } from "../../scenes/model.js";
|
|
14
15
|
import { SceneResultNotifications } from "../../scenes/resultNotifications.js";
|
|
15
16
|
import { SceneRuntime } from "../../scenes/runtime.js";
|
|
16
17
|
import { SceneApplicationService } from "../../scenes/service.js";
|
|
@@ -59,7 +60,7 @@ var GatewaySceneHost = class {
|
|
|
59
60
|
};
|
|
60
61
|
};
|
|
61
62
|
const grant = async (activation) => authorize(activation);
|
|
62
|
-
const executor = input.executor ?? new SceneAgentExecutor(() => resolveModel(
|
|
63
|
+
const executor = input.executor ?? new SceneAgentExecutor(() => resolveModel(resolveSceneModelRef(input.config())));
|
|
63
64
|
this.http = {
|
|
64
65
|
repository,
|
|
65
66
|
mail,
|
|
@@ -67,7 +68,7 @@ var GatewaySceneHost = class {
|
|
|
67
68
|
application: new SceneApplicationService(repository, providers, grant, clock, () => {
|
|
68
69
|
if (input.executor) return [];
|
|
69
70
|
try {
|
|
70
|
-
return isProviderConfiguredSync(resolveModel(
|
|
71
|
+
return isProviderConfiguredSync(resolveModel(resolveSceneModelRef(input.config())).provider) ? [] : ["model_credentials"];
|
|
71
72
|
} catch {
|
|
72
73
|
return ["model_configuration"];
|
|
73
74
|
}
|
|
@@ -75,7 +76,7 @@ var GatewaySceneHost = class {
|
|
|
75
76
|
inbox: new SceneInboxService(db, clock),
|
|
76
77
|
browser: new BrowserSubscriptionService(db, clock),
|
|
77
78
|
preferences: new ScenePreferenceService(db),
|
|
78
|
-
metrics: new SceneMetrics(db, clock)
|
|
79
|
+
metrics: new SceneMetrics(db, clock, () => input.executor ? null : resolveSceneModelRef(input.config()))
|
|
79
80
|
};
|
|
80
81
|
this.runtime = new SceneRuntime(repository, new SceneExecutionService(repository, providers, executor, grant, clock), new SceneMailObservationService(repository, mail, grant, clock, 6e4), clock, input.intervalMs ?? 5e3);
|
|
81
82
|
this.notifications = new SceneResultNotifications(db, authorize, (event) => input.publish("notification.created", event), clock);
|
|
@@ -956,7 +956,7 @@ var GatewayService = class {
|
|
|
956
956
|
this.running = true;
|
|
957
957
|
this.taskRunDispatchTimer = setInterval(() => this.dispatchTaskRuns(), 1e3);
|
|
958
958
|
this.taskRunDispatchTimer.unref?.();
|
|
959
|
-
this.sceneHost = new GatewaySceneHost(getSqliteDatabase(), {
|
|
959
|
+
if (this.config.gateway?.scenes?.enabled === true) this.sceneHost = new GatewaySceneHost(getSqliteDatabase(), {
|
|
960
960
|
principal: {
|
|
961
961
|
ownerId: "local-owner",
|
|
962
962
|
workspaceId: this.workspacePath
|
|
@@ -1149,7 +1149,7 @@ var GatewayService = class {
|
|
|
1149
1149
|
import("../share/share-auto.js").then(({ runStagingSweep }) => runStagingSweep([...new Set([getDefaultAgentId(this.config), ...listAgentEntries(this.config).map((entry) => entry.id)])].map((agentId) => resolveAgentWorkspaceDir(this.config, agentId)))).catch((err) => log.warn({ err }, "Share staging sweep failed"));
|
|
1150
1150
|
if (this.serviceConfig.deferChannelConnectUntilAfterHttp !== true) this.markGatewayReady();
|
|
1151
1151
|
else trace.mark("service.started-awaiting-http");
|
|
1152
|
-
this.sceneHost
|
|
1152
|
+
this.sceneHost?.start();
|
|
1153
1153
|
log.debug("Gateway service started");
|
|
1154
1154
|
}
|
|
1155
1155
|
/** Called when the HTTP listener is bound (before deferred channel work). */
|
|
@@ -4,9 +4,11 @@ import type { ScenePrincipal } from './contracts.js';
|
|
|
4
4
|
export declare class SceneMetrics {
|
|
5
5
|
private readonly db;
|
|
6
6
|
private readonly clock;
|
|
7
|
-
|
|
7
|
+
private readonly modelRef;
|
|
8
|
+
constructor(db: DatabaseSync, clock?: () => number, modelRef?: () => string | null);
|
|
8
9
|
diagnostics(principal: ScenePrincipal): {
|
|
9
10
|
checksPaused: boolean;
|
|
11
|
+
currentModel: string;
|
|
10
12
|
pendingChecks: number;
|
|
11
13
|
oldestDueWaitMs: number;
|
|
12
14
|
lastSevenDays: {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
//#region src/scenes/metrics.ts
|
|
2
2
|
/** Explicit feedback is a usefulness signal, not proof of adoption or saved time. */
|
|
3
3
|
var SceneMetrics = class {
|
|
4
|
-
constructor(db, clock = Date.now) {
|
|
4
|
+
constructor(db, clock = Date.now, modelRef = () => null) {
|
|
5
5
|
this.db = db;
|
|
6
6
|
this.clock = clock;
|
|
7
|
+
this.modelRef = modelRef;
|
|
7
8
|
}
|
|
8
9
|
diagnostics(principal) {
|
|
9
10
|
if (!principal.ownerId.trim() || !principal.workspaceId.trim()) throw new Error("Scene principal is required");
|
|
@@ -39,8 +40,13 @@ var SceneMetrics = class {
|
|
|
39
40
|
activation.next_deadline_check_at = null;
|
|
40
41
|
activation.retry_at = null;
|
|
41
42
|
}
|
|
43
|
+
let currentModel = null;
|
|
44
|
+
try {
|
|
45
|
+
currentModel = this.modelRef();
|
|
46
|
+
} catch {}
|
|
42
47
|
return {
|
|
43
48
|
checksPaused,
|
|
49
|
+
currentModel,
|
|
44
50
|
pendingChecks: Number(queue.depth),
|
|
45
51
|
oldestDueWaitMs: queue.oldest == null ? 0 : Math.max(0, now - Number(queue.oldest)),
|
|
46
52
|
lastSevenDays: {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { init_agent_scope, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
2
|
+
import { resolveModelSelector } from "../config/agent-model-intents.js";
|
|
3
|
+
//#region src/scenes/model.ts
|
|
4
|
+
init_agent_scope();
|
|
5
|
+
/** Scene reasoning follows the existing agent model policy and falls back to chat. */
|
|
6
|
+
function resolveSceneModelRef(config) {
|
|
7
|
+
return resolveModelSelector(config, resolveDefaultAgentId(config), "@reasoning");
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { resolveSceneModelRef };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Local-first personal AI
|
|
3
|
+
"version": "0.0.312",
|
|
4
|
+
"description": "Local-first personal AI for the one-person company, with durable context, tasks, workflows, automations, and local or cloud models.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"types": "dist/src/index.d.ts",
|
|
@@ -169,11 +169,11 @@
|
|
|
169
169
|
"vitest": "4.1.5",
|
|
170
170
|
"vue": "^3.5.35",
|
|
171
171
|
"@xopcai/browser-control-contract": "0.1.0",
|
|
172
|
-
"@xopcai/computer-control-contract": "0.1.0",
|
|
173
172
|
"@xopcai/endpoint-tools-client": "0.0.0",
|
|
173
|
+
"@xopcai/computer-control-contract": "0.1.0",
|
|
174
174
|
"@xopcai/endpoint-tools-protocol": "0.0.0",
|
|
175
|
-
"@xopcai/realtime-client": "0.0.0",
|
|
176
175
|
"@xopcai/gateway-contract": "0.0.0",
|
|
176
|
+
"@xopcai/realtime-client": "0.0.0",
|
|
177
177
|
"@xopcai/realtime-protocol": "0.0.0"
|
|
178
178
|
},
|
|
179
179
|
"scripts": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t}from"./product-delivery-CCC4FJ3Y.js";var n=new Set([`agents`,`automations`,`browser-automations`,`channels`,`chat`,`connectors`,`extensions`,`local-apps`,`notes`,`onboarding`,`open`,`projects`,`settings`,`skills`,`tasks`,`workflows`,`you`]);function r(e){if(!e.startsWith(`/`)||e.startsWith(`//`)||e.includes(`\\`))return null;let t=e.slice(1).split(/[/?#]/,1)[0]??``;return t&&n.has(t)?e:null}function i(e){try{let t=new URL(e);return t.protocol!==`xopc:`||t.hostname!==`settings`?null:r(`/settings${t.pathname===`/`?``:t.pathname}${t.search}${t.hash}`)}catch{return null}}function a(n,a=window.location.href){let o=n.trim();if(!o)return{kind:`blocked`};let s=t(o);if(s){let t=e({...s,title:s.id,capabilities:[`open`]});return t?{kind:`internal-route`,route:t}:{kind:`blocked`}}let c=i(o);if(c)return{kind:`internal-route`,route:c};if(o.startsWith(`#/`)){let e=r(o.slice(1));return e?{kind:`internal-route`,route:e}:{kind:`blocked`}}if(o.startsWith(`/`)){let e=r(o);return e?{kind:`internal-route`,route:e}:{kind:`blocked`}}try{let e=new URL(o,a);if(e.protocol!==`http:`&&e.protocol!==`https:`||e.username||e.password)return{kind:`blocked`};let t=new URL(a);if(e.origin===t.origin&&e.hash.startsWith(`#/`)){let t=r(e.hash.slice(1));if(t)return{kind:`internal-route`,route:t}}return{kind:`external-http`,url:e.toString()}}catch{return{kind:`blocked`}}}function o(e,t,n){for(let r of e.querySelectorAll(`a`)){if(n?.(r))continue;let e=a(r.getAttribute(`href`)??``);if(r.dataset.xopcLinkKind=e.kind,e.kind===`blocked`){r.replaceWith(...Array.from(r.childNodes));continue}if(e.kind===`internal-route`){if(r.setAttribute(`href`,`#${e.route}`),r.removeAttribute(`target`),t){let n=e.route.slice(1).split(/[/?#]/,1)[0]??``,i=t.destinations[n]??t.open,a=r.dataset.xopcLinkLabel??r.textContent?.trim()??``;r.dataset.xopcLinkLabel=a,(/^(?:xopc:\/\/|#\/)/i.test(a)||/^(?:Open(?: in xopc)?|打开)$/i.test(a))&&(r.textContent=i),r.title||=i}continue}r.target=`_blank`;let i=new Set(r.rel.split(/\s+/).filter(Boolean));i.add(`noopener`),i.add(`noreferrer`),r.rel=[...i].join(` `)}}async function s(e){let t=a(e);if(t.kind!==`external-http`)return{ok:!1,error:`Only external HTTP(S) links can be opened`};let n=window.electronAPI?.shell?.openExternalUrl;return n?n(t.url):(window.open(t.url,`_blank`,`noopener,noreferrer`),{ok:!0})}export{s as n,a as r,o as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{g as i,t as a}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as o}from"./check-DUBLcKHA.js";import{t as s}from"./markdown-view-BDpcjR_Z.js";import{t as c}from"./plus-Q2yW6OE7.js";import{t as l}from"./x-B_N4OPjy.js";import{t as u}from"./cn-JdwAhgNB.js";import{a as d,c as f,i as p,n as m,r as h}from"./locale-store-DA0Z5jM_.js";import{t as g}from"./messages-4BtQKYlM.js";import{a as _,i as v,o as y,r as b,s as x,t as S}from"./dist-BGTk37IG.js";import{a as C,i as w}from"./vendor-swr-BIWyz7Rc.js";import{t as T}from"./button-CS04eWY9.js";import{t as E}from"./skeleton-BwbyijEw.js";import{o as D}from"./gateway-realtime-CGOW0-b4.js";import{Ec as O,Ga as k,Ja as A,Ou as j,Ru as M,Sc as N,Xa as P,Ya as F,Yc as I,Yu as ee,bc as te,do as L,ec as ne,fl as re,iu as R,na as z,qa as B,tc as ie}from"./index-DxYitLp8.js";import{t as V}from"./page-tabs-CMlQUzT6.js";var H=e(t(),1),U=n();function W(e){return e===`builtin`||e===`user`?e:`marketplace`}async function G(e){try{let t=await e.json();if(typeof t.error==`string`)return t.error;if(t.error&&typeof t.error==`object`&&typeof t.error.message==`string`)return t.error.message;if(typeof t.message==`string`)return t.message}catch{}return e.statusText||`HTTP ${e.status}`}async function ae(e){let t=await p(h(`/api/marketplace/packages/${encodeURIComponent(e.trim())}`),{cache:`no-store`});if(!t.ok)throw Error(await G(t));let n=await t.json();if(!n.ok||!n.payload?.id)throw Error(n.error??`Invalid response`);return n.payload}async function K(e){let t=await p(h(`/api/marketplace/install`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await G(t));let n=await t.json();if(!n.ok||!n.payload?.extensionId)throw Error(n.error??`Invalid response`);return n.payload}async function q(e){let t=await p(h(`/api/extensions/bundled/activation`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({extensionId:e.extensionId.trim(),enabled:e.enabled})});if(!t.ok)throw Error(await G(t));let n=await t.json();if(!n.ok||!n.payload)throw Error(n.error?.message??`Invalid response`);return n.payload}async function J(e){let t=await p(h(`/api/marketplace/uninstall`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({extensionId:e})});if(!t.ok)throw Error(await G(t));let n=await t.json();if(!n.ok||!n.payload)throw Error(n.error??`Invalid response`);return n.payload}var Y=r();function oe(e,t){let n=e.find(e=>e.id===t);return n?n.source===`bundled`?`bundled`:`user`:`absent`}var X={q:``,debounced:``,detailPkg:null,rowBusy:null,actionError:null,restartHint:null};function Z({className:e}){let t=g(m(e=>e.language)).extensionsPage,n=f(e=>!!e.conversationId),r=B(),{mutate:i}=C(),[a,o]=(0,H.useReducer)(z,X),{q:s,debounced:c,detailPkg:l,rowBusy:p,actionError:_,restartHint:v}=a,y=n?`marketplace-${c}`:null;(0,H.useEffect)(()=>{let e=window.setTimeout(()=>o({type:`patch`,patch:{debounced:s.trim()}}),300);return()=>window.clearTimeout(e)},[s]);let{data:b,isLoading:x,error:S}=w(y,async()=>d(c.length>0?h(`/api/marketplace?q=${encodeURIComponent(c)}`):h(`/api/marketplace`)),{revalidateOnFocus:!1}),T=(0,H.useCallback)(()=>{i(`gateway-extensions-list`),D()},[i]),k=(0,H.useCallback)(async(e,n)=>{o({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let r=await K({name:e,overwrite:n});T(),r.requiresGatewayRestart&&o({type:`patch`,patch:{restartHint:t.marketplaceRestartHint}})}catch(e){throw o({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.marketplaceInstallFailed}}),e}finally{o({type:`patch`,patch:{rowBusy:null}})}},[t.marketplaceInstallFailed,t.marketplaceRestartHint,T]),A=(0,H.useCallback)(async e=>{o({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let n=await J(e);T(),n.requiresGatewayRestart&&o({type:`patch`,patch:{restartHint:t.marketplaceRestartHint}})}catch(e){throw o({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.marketplaceUninstallFailed}}),e}finally{o({type:`patch`,patch:{rowBusy:null}})}},[t.marketplaceRestartHint,t.marketplaceUninstallFailed,T]),M=b?.extensions??[];return(0,Y.jsxs)(`div`,{className:u(`flex flex-col gap-4`,e),children:[(0,Y.jsxs)(`div`,{className:`relative`,children:[(0,Y.jsx)(O,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-muted`,strokeWidth:1.75,"aria-hidden":!0}),(0,Y.jsx)(`input`,{type:`search`,value:s,onChange:e=>o({type:`patch`,patch:{q:e.target.value}}),placeholder:t.marketplaceSearchPlaceholder,className:`ui-input h-10 w-full rounded-lg border border-edge bg-surface-base pl-9 pr-3 text-sm text-fg placeholder:text-fg-muted`})]}),S?(0,Y.jsx)(`p`,{className:`text-sm text-fg-muted`,children:S instanceof Error?S.message:t.marketplaceLoadFailed}):null,_?(0,Y.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:_}):null,v?(0,Y.jsx)(`p`,{className:`text-sm text-fg-muted`,children:v}):null,x&&!b?(0,Y.jsx)(`ul`,{className:`flex flex-col gap-3`,"aria-label":t.marketplaceLoading,children:[0,1,2].map(e=>(0,Y.jsx)(`li`,{className:`rounded-xl bg-surface-panel p-4 shadow-surface`,children:(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2.5`,children:[(0,Y.jsx)(E,{className:`h-5 w-40`}),(0,Y.jsx)(E,{className:`h-4 w-full max-w-xl`}),(0,Y.jsx)(E,{className:`h-4 w-2/3 max-w-md`})]}),(0,Y.jsx)(E,{className:`h-8 w-20`})]})},e))}):(0,Y.jsx)(`ul`,{className:`flex flex-col gap-3`,children:M.length===0?(0,Y.jsx)(`li`,{className:`text-sm text-fg-muted`,children:t.marketplaceEmpty}):M.map(e=>{let n=oe(r,e.id),i=p===e.id;return(0,Y.jsx)(`li`,{className:`list-none`,children:(0,Y.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-label":`${e.name}, ${t.marketplaceDetailTitle}`,onClick:()=>o({type:`patch`,patch:{detailPkg:e.id}}),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),o({type:`patch`,patch:{detailPkg:e.id}}))},className:u(`flex w-full cursor-pointer flex-wrap items-start gap-3 rounded-xl bg-surface-panel p-4 text-left shadow-surface`,`transition-[transform,background-color,box-shadow] duration-150 ease-out`,`hover:bg-surface-hover/40`,`active:scale-[0.992] active:bg-surface-hover/55`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:hover:bg-surface-hover/25 dark:active:bg-surface-hover/35`),children:[(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(`h3`,{className:`font-semibold text-fg`,children:e.name}),e.verified?(0,Y.jsx)(j,{className:`size-4 shrink-0 text-emerald-600 dark:text-emerald-400`,strokeWidth:1.75,"aria-label":`Verified`}):null,e.version?(0,Y.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e.version}):null]}),e.description?(0,Y.jsx)(`p`,{className:`mt-1 line-clamp-2 text-sm text-fg-muted`,children:e.description}):null,(0,Y.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:(e.categories??[]).map(e=>(0,Y.jsx)(`span`,{className:`rounded-md border border-edge bg-surface-panel px-2 py-0.5 text-[11px] text-fg-muted`,children:e},e))}),(0,Y.jsxs)(`p`,{className:`mt-2 flex items-center gap-1.5 text-xs text-fg-muted`,children:[(0,Y.jsx)(I,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),(0,Y.jsx)(`code`,{className:`rounded bg-surface-panel px-1 py-0.5`,children:e.npmPackage})]})]}),(0,Y.jsx)(`div`,{role:`group`,className:`flex shrink-0 flex-col items-end gap-2 sm:min-w-[9rem]`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:n===`bundled`?(0,Y.jsx)(`span`,{className:`rounded-md bg-surface-hover px-2 py-1 text-[11px] font-medium text-fg-muted`,children:t.marketplaceBuiltin}):n===`user`?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`text-[11px] font-medium text-fg-muted`,children:t.marketplaceInstalled}),(0,Y.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>{window.confirm(t.marketplaceUninstallConfirm)&&A(e.id).catch(()=>{})},className:u(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-colors active:scale-[0.98] active:bg-surface-hover/80`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[i?(0,Y.jsx)(re,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,Y.jsx)(ie,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),t.marketplaceUninstall]})]}):(0,Y.jsx)(`button`,{type:`button`,onClick:()=>o({type:`patch`,patch:{detailPkg:e.id}}),className:u(`inline-flex w-full items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-[transform,background-color] active:scale-[0.98]`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:t.marketplaceReview})})]})},e.id)})}),l?(0,Y.jsx)(Q,{packageName:l,copy:t,extensions:r,onClose:()=>o({type:`patch`,patch:{detailPkg:null}}),onInstall:k,onUninstall:A}):null]})}function Q(e){let t=(0,U.c)(102),{packageName:n,copy:r,extensions:i,onClose:o,onInstall:c,onUninstall:d}=e,[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(!1),v=f(de)?`ext-mp-detail-${n}`:null,C;t[0]===n?C=t[1]:(C=async()=>ae(n),t[0]=n,t[1]=C);let T;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(T={revalidateOnFocus:!1},t[2]=T):T=t[2];let{data:D,error:O,isLoading:k}=w(v,C,T),A;t[3]!==i||t[4]!==n?(A=oe(i,n),t[3]=i,t[4]=n,t[5]=A):A=t[5];let j=A,M=j===`user`,N=D?.manifest?.permissions,P,F,I,L,R,z,B,V,W,G,K;if(t[6]!==r.detailBack||t[7]!==r.detailClose||t[8]!==r.marketplaceAuthor||t[9]!==r.marketplaceCodeRisk||t[10]!==r.marketplaceDependencies||t[11]!==r.marketplaceDetailLoadFailed||t[12]!==r.marketplaceDetailReadmeHeading||t[13]!==r.marketplaceDetailTitle||t[14]!==r.marketplaceDownloads||t[15]!==r.marketplaceIntegrity||t[16]!==r.marketplaceIntegrityVerified||t[17]!==r.marketplaceLifecycleScripts||t[18]!==r.marketplaceLoadFailed||t[19]!==r.marketplaceLoading||t[20]!==r.marketplaceNoReadme||t[21]!==r.marketplacePermissions||t[22]!==r.marketplacePermissionsNone||t[23]!==r.marketplaceRiskConfirm||t[24]!==r.marketplaceRiskTitle||t[25]!==r.marketplaceUnavailableBody||t[26]!==r.marketplaceUnavailableTitle||t[27]!==r.marketplaceVersion||t[28]!==D||t[29]!==O||t[30]!==j||t[31]!==k||t[32]!==o||t[33]!==N||t[34]!==h){let e=N&&typeof N==`object`&&!Array.isArray(N)?Object.entries(N):[],n;t[46]!==r.marketplaceNoReadme||t[47]!==D?(n=D?.readme?.trim()||(D?.description?.trim()?`### ${D.name}\n\n${D.description}`:`*${r.marketplaceNoReadme}*`),t[46]=r.marketplaceNoReadme,t[47]=D,t[48]=n):n=t[48];let i=n;I=S,L=!0,t[49]===o?R=t[50]:(R=e=>!e&&o(),t[49]=o,t[50]=R),F=y,t[51]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Y.jsx)(_,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[51]=K):K=t[51],P=b,V=`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex h-[min(44rem,calc(100vh-1.5rem))] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,W=ue;let a;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(ee,{className:`size-5`}),t[52]=a):a=t[52];let c;t[53]!==r.detailBack||t[54]!==o?(c=(0,Y.jsx)(`button`,{type:`button`,onClick:o,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":r.detailBack,children:a}),t[53]=r.detailBack,t[54]=o,t[55]=c):c=t[55];let u;t[56]===r.marketplaceDetailTitle?u=t[57]:(u=(0,Y.jsx)(x,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:r.marketplaceDetailTitle}),t[56]=r.marketplaceDetailTitle,t[57]=u);let d;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Y.jsx)(l,{className:`size-5`}),t[58]=d):d=t[58];let f;t[59]!==r.detailClose||t[60]!==o?(f=(0,Y.jsx)(`button`,{type:`button`,onClick:o,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":r.detailClose,children:d}),t[59]=r.detailClose,t[60]=o,t[61]=f):f=t[61],t[62]!==c||t[63]!==u||t[64]!==f?(G=(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[c,u,f]}),t[62]=c,t[63]=u,t[64]=f,t[65]=G):G=t[65],z=`min-h-0 flex-1 overflow-y-auto p-5`,B=k&&!D?(0,Y.jsxs)(`div`,{className:`space-y-4`,"aria-label":r.marketplaceLoading,children:[(0,Y.jsx)(E,{className:`h-6 w-48`}),(0,Y.jsx)(E,{className:`h-4 w-28`}),(0,Y.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,Y.jsx)(E,{className:`h-12`}),(0,Y.jsx)(E,{className:`h-12`})]}),(0,Y.jsx)(E,{className:`h-28 w-full`}),(0,Y.jsx)(E,{className:`h-36 w-full`})]}):O?(0,Y.jsxs)(`div`,{className:`rounded-lg border border-red-300/70 bg-red-50 p-4 text-sm dark:border-red-900 dark:bg-red-950/30`,children:[(0,Y.jsx)(`p`,{className:`font-medium text-red-700 dark:text-red-300`,children:r.marketplaceDetailLoadFailed}),(0,Y.jsx)(`p`,{className:`mt-1 break-words text-red-600 dark:text-red-400`,children:O instanceof Error?O.message:r.marketplaceLoadFailed})]}):D?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:D.name}),(0,Y.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:(0,Y.jsx)(`code`,{className:`rounded bg-surface-panel px-1 py-0.5`,children:D.id})}),(0,Y.jsxs)(`dl`,{className:`mt-3 grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`font-medium text-fg`,children:r.marketplaceAuthor}),(0,Y.jsx)(`dd`,{children:D.author.username})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`font-medium text-fg`,children:r.marketplaceVersion}),(0,Y.jsx)(`dd`,{children:D.latestVersion.version})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`font-medium text-fg`,children:r.marketplaceDownloads}),(0,Y.jsx)(`dd`,{children:D.downloads})]})]}),j===`bundled`?null:(0,Y.jsxs)(`section`,{className:`mt-5 space-y-3 rounded-lg border border-edge bg-surface-base p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[D.installability.available?(0,Y.jsx)(te,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}):(0,Y.jsx)(ne,{className:`mt-0.5 size-5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":!0}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:D.installability.available?r.marketplaceRiskTitle:r.marketplaceUnavailableTitle}),(0,Y.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:D.installability.available?r.marketplaceCodeRisk:D.installability.reason??r.marketplaceUnavailableBody})]})]}),D.installability.available?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`dl`,{className:`grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`font-medium text-fg`,children:r.marketplaceIntegrity}),(0,Y.jsx)(`dd`,{children:r.marketplaceIntegrityVerified})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`font-medium text-fg`,children:r.marketplaceDependencies}),(0,Y.jsx)(`dd`,{children:D.packageSummary?.dependencyCount??0})]})]}),(0,Y.jsxs)(`div`,{className:`text-xs text-fg-muted`,children:[(0,Y.jsx)(`p`,{className:`font-medium text-fg`,children:r.marketplacePermissions}),e.length>0?(0,Y.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.map(le)}):(0,Y.jsx)(`p`,{className:`mt-1`,children:r.marketplacePermissionsNone})]}),(D.packageSummary?.lifecycleScripts.length??0)>0?(0,Y.jsxs)(`p`,{className:`text-xs leading-relaxed text-amber-700 dark:text-amber-300`,children:[r.marketplaceLifecycleScripts,`: `,D.packageSummary?.lifecycleScripts.join(`, `)]}):null,(0,Y.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,checked:h,onChange:e=>g(e.target.checked),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,Y.jsx)(`span`,{children:r.marketplaceRiskConfirm})]})]}):null]}),D.readme?.trim()?(0,Y.jsx)(`h4`,{className:`mb-2 mt-6 text-sm font-semibold text-fg`,children:r.marketplaceDetailReadmeHeading}):null,(0,Y.jsx)(`div`,{className:`markdown-content min-w-0 break-words text-sm`,children:(0,Y.jsx)(s,{content:i})})]}):null,t[6]=r.detailBack,t[7]=r.detailClose,t[8]=r.marketplaceAuthor,t[9]=r.marketplaceCodeRisk,t[10]=r.marketplaceDependencies,t[11]=r.marketplaceDetailLoadFailed,t[12]=r.marketplaceDetailReadmeHeading,t[13]=r.marketplaceDetailTitle,t[14]=r.marketplaceDownloads,t[15]=r.marketplaceIntegrity,t[16]=r.marketplaceIntegrityVerified,t[17]=r.marketplaceLifecycleScripts,t[18]=r.marketplaceLoadFailed,t[19]=r.marketplaceLoading,t[20]=r.marketplaceNoReadme,t[21]=r.marketplacePermissions,t[22]=r.marketplacePermissionsNone,t[23]=r.marketplaceRiskConfirm,t[24]=r.marketplaceRiskTitle,t[25]=r.marketplaceUnavailableBody,t[26]=r.marketplaceUnavailableTitle,t[27]=r.marketplaceVersion,t[28]=D,t[29]=O,t[30]=j,t[31]=k,t[32]=o,t[33]=N,t[34]=h,t[35]=P,t[36]=F,t[37]=I,t[38]=L,t[39]=R,t[40]=z,t[41]=B,t[42]=V,t[43]=W,t[44]=G,t[45]=K}else P=t[35],F=t[36],I=t[37],L=t[38],R=t[39],z=t[40],B=t[41],V=t[42],W=t[43],G=t[44],K=t[45];let q;t[66]!==z||t[67]!==B?(q=(0,Y.jsx)(`div`,{className:z,children:B}),t[66]=z,t[67]=B,t[68]=q):q=t[68];let J;t[69]!==p||t[70]!==r.marketplaceBuiltinGoBuiltin||t[71]!==r.marketplaceBuiltinManageHint||t[72]!==r.marketplaceInstall||t[73]!==r.marketplaceReinstall||t[74]!==r.marketplaceReinstallConfirm||t[75]!==r.marketplaceUninstall||t[76]!==r.marketplaceUninstallConfirm||t[77]!==D||t[78]!==j||t[79]!==o||t[80]!==c||t[81]!==d||t[82]!==n||t[83]!==h||t[84]!==M?(J=D?(0,Y.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-edge-subtle px-5 py-4`,children:j===`bundled`?(0,Y.jsxs)(`div`,{className:`flex w-full flex-col items-stretch gap-2`,children:[(0,Y.jsx)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:r.marketplaceBuiltinManageHint}),(0,Y.jsx)(a,{to:`/extensions?tab=builtin`,onClick:o,className:`inline-flex w-fit items-center justify-center rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:r.marketplaceBuiltinGoBuiltin})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`button`,{type:`button`,disabled:p||!D.installability.available||!h,onClick:()=>{M&&!window.confirm(r.marketplaceReinstallConfirm)||(m(!0),c(n,M).catch(ce).finally(()=>m(!1)))},className:u(`inline-flex items-center justify-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium`,`bg-accent text-on-accent shadow-surface hover:bg-accent-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`disabled:pointer-events-none disabled:opacity-50`),children:[p?(0,Y.jsx)(re,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,M?r.marketplaceReinstall:r.marketplaceInstall]}),M?(0,Y.jsxs)(`button`,{type:`button`,disabled:p,onClick:()=>{window.confirm(r.marketplaceUninstallConfirm)&&(m(!0),d(n).then(()=>o()).catch(se).finally(()=>m(!1)))},className:u(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[(0,Y.jsx)(ie,{className:`size-4 shrink-0`,"aria-hidden":!0}),r.marketplaceUninstall]}):null]})}):null,t[69]=p,t[70]=r.marketplaceBuiltinGoBuiltin,t[71]=r.marketplaceBuiltinManageHint,t[72]=r.marketplaceInstall,t[73]=r.marketplaceReinstall,t[74]=r.marketplaceReinstallConfirm,t[75]=r.marketplaceUninstall,t[76]=r.marketplaceUninstallConfirm,t[77]=D,t[78]=j,t[79]=o,t[80]=c,t[81]=d,t[82]=n,t[83]=h,t[84]=M,t[85]=J):J=t[85];let X;t[86]!==P||t[87]!==q||t[88]!==J||t[89]!==V||t[90]!==W||t[91]!==G?(X=(0,Y.jsxs)(P,{className:V,onOpenAutoFocus:W,children:[G,q,J]}),t[86]=P,t[87]=q,t[88]=J,t[89]=V,t[90]=W,t[91]=G,t[92]=X):X=t[92];let Z;t[93]!==F||t[94]!==X||t[95]!==K?(Z=(0,Y.jsxs)(F,{children:[K,X]}),t[93]=F,t[94]=X,t[95]=K,t[96]=Z):Z=t[96];let Q;return t[97]!==I||t[98]!==L||t[99]!==R||t[100]!==Z?(Q=(0,Y.jsx)(I,{defaultOpen:L,onOpenChange:R,children:Z}),t[97]=I,t[98]=L,t[99]=R,t[100]=Z,t[101]=Q):Q=t[101],Q}function se(){}function ce(){}function le(e){let[t,n]=e;return(0,Y.jsxs)(`li`,{className:`break-words`,children:[(0,Y.jsx)(`code`,{children:t}),`: `,Array.isArray(n)?n.join(`, `):String(n)]},t)}function ue(e){return e.preventDefault()}function de(e){return!!e.conversationId}function fe(){let e=m(e=>e.language),t=g(e),n=L(e=>e.setPageHeader),r=L(e=>e.clearPageHeader),o=B(),s=A(),[l,u]=i(),d=W(l.get(`tab`)),f=l.get(`q`)??``,[p,h]=(0,H.useState)(d),[_,v]=(0,H.useState)(f),[y,b]=(0,H.useState)(null),x=l.toString(),S=(0,H.useRef)(x);if(S.current!==x){S.current=x;let e=W(l.get(`tab`)),t=l.get(`q`)??``;h(t=>t===e?t:e),v(e=>e===t?e:t)}(0,H.useEffect)(()=>{u(e=>{let t=new URLSearchParams(e),n=_.trim();return n?t.set(`q`,n):t.delete(`q`),p===`marketplace`?t.delete(`tab`):t.set(`tab`,p),t.toString()===e.toString()?e:t},{replace:!0})},[p,_,u]);let C=(0,H.useMemo)(()=>o.filter(e=>e.source===`bundled`),[o]),w=(0,H.useMemo)(()=>o.filter(e=>e.source!==`bundled`),[o]),E=p===`builtin`?C:w,D=(0,H.useMemo)(()=>{let t=_.trim().toLowerCase(),n=E;return t&&(n=n.filter(e=>(e.name??``).toLowerCase().includes(t)||e.id.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t))),n.toSorted((t,n)=>t.hasUi===n.hasUi?(t.name||t.id).localeCompare(n.name||n.id,e):t.hasUi?-1:1)},[E,_,e]);if((0,H.useEffect)(()=>{b(e=>{if(!e)return e;let t=o.find(t=>t.id===e.id);return t?$(e)===$(t)&&e.active===t.active?e:t:null})},[o]),(0,H.useLayoutEffect)(()=>(n({startExtra:null,main:(0,Y.jsx)(`div`,{className:`min-w-0`,children:(0,Y.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:t.extensionsPage.title})}),end:(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(T,{asChild:!0,variant:`secondary`,className:`h-9`,children:(0,Y.jsxs)(a,{to:`/local-apps`,"aria-label":t.extensionsPage.openLocalApps,title:t.extensionsPage.openLocalApps,children:[(0,Y.jsx)(M,{className:`size-4`}),(0,Y.jsx)(`span`,{className:`hidden sm:inline`,children:t.extensionsPage.openLocalApps})]})}),(0,Y.jsx)(T,{asChild:!0,variant:`primary`,className:`h-9`,children:(0,Y.jsxs)(a,{to:`/local-apps/new`,children:[(0,Y.jsx)(c,{className:`size-4`}),t.extensionsPage.createLocalApp]})})]})}),()=>r()),[r,t.extensionsPage.createLocalApp,t.extensionsPage.openLocalApps,t.extensionsPage.title,n]),s&&p!==`marketplace`)return(0,Y.jsx)(ye,{});let k=p!==`marketplace`&&E.length>0;return(0,Y.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:[(0,Y.jsxs)(`div`,{className:`mx-auto w-full max-w-7xl px-4 py-7 sm:px-6 lg:px-8 lg:py-9`,children:[(0,Y.jsxs)(`div`,{className:`mb-6 flex flex-col gap-3 border-b border-edge-subtle pb-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Y.jsx)(V,{items:[{id:`marketplace`,label:t.extensionsPage.tabMarketplace},{id:`builtin`,label:t.extensionsPage.tabBuiltin,count:C.length},{id:`user`,label:t.extensionsPage.tabUser,count:w.length}],activeTab:p,onChange:h,ariaLabel:t.extensionsPage.extensionsNavAria,tabIdPrefix:`extensions-tab`,panelIdPrefix:`extensions-panel`,className:`flex-wrap`}),k?(0,Y.jsxs)(`div`,{className:`relative w-full min-w-0 sm:max-w-xs`,children:[(0,Y.jsx)(O,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-muted`,"aria-hidden":!0}),(0,Y.jsx)(`input`,{type:`search`,value:_,onChange:e=>v(e.target.value),placeholder:t.extensionsPage.searchPlaceholder,className:`w-full rounded-lg border border-edge bg-surface-base py-2 pl-9 pr-3 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,autoComplete:`off`})]}):null]}),p===`marketplace`?(0,Y.jsx)(Z,{}):p===`builtin`&&C.length===0?(0,Y.jsx)(xe,{message:t.extensionsPage.emptyBuiltin}):p===`user`&&w.length===0?(0,Y.jsx)(xe,{message:t.extensionsPage.emptyUser}):D.length===0?(0,Y.jsx)(`p`,{className:`px-3 py-14 text-center text-sm text-fg-muted sm:px-5 xl:px-6`,children:t.extensionsPage.noSearchResults}):(0,Y.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:D.map(e=>(0,Y.jsx)(ge,{extension:e,copy:t.extensionsPage,showSourceBadge:p===`user`,onOpen:()=>b(e)},e.id))})]}),y?(0,Y.jsx)(_e,{extension:y,copy:t.extensionsPage,onClose:()=>b(null)},y.id):null]})}function $(e){return e.activationEligible??e.active}function pe(e,t){return e.source===`bundled`?t.providerBundled:e.source===`global`?t.providerGlobal:e.source===`workspace`?t.providerWorkspace:t.providerOther}function me(e,t){return e.source===`global`?t.badgeSourceGlobal:e.source===`workspace`?t.badgeSourceWorkspace:t.badgeSourceOther}function he(e,t){let n=$(e);return n&&e.active?t.runStateLive:n&&!e.active?t.runStatePendingOn:!n&&e.active?t.runStatePendingOff:t.runStateOff}function ge(e){let t=(0,U.c)(45),{extension:n,copy:r,showSourceBadge:i,onOpen:a}=e,s;t[0]===n?s=t[1]:(s=$(n),t[0]=n,t[1]=s);let l=s,d=n.hasUi?r.cardTooltipHasUi:r.cardTooltipNoUi,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=u(`group flex w-full flex-col rounded-xl border border-edge-subtle bg-surface-base p-4 text-left shadow-surface transition-colors`,`hover:bg-surface-hover/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`dark:hover:bg-surface-hover/25`),t[2]=f):f=t[2];let p=n.name||n.id,m;t[3]===p?m=t[4]:(m=p.charAt(0).toUpperCase(),t[3]=p,t[4]=m);let h;t[5]===m?h=t[6]:(h=(0,Y.jsx)(`div`,{className:`flex size-12 shrink-0 items-center justify-center rounded-xl bg-accent-soft text-base font-semibold text-accent-fg`,"aria-hidden":!0,children:m}),t[5]=m,t[6]=h);let g;t[7]===n.name?g=t[8]:(g=(0,Y.jsx)(`h2`,{className:`truncate text-sm font-semibold text-fg`,children:n.name}),t[7]=n.name,t[8]=g);let _;t[9]===n.version?_=t[10]:(_=n.version?(0,Y.jsxs)(`span`,{className:`text-[11px] text-fg-muted`,children:[`v`,n.version]}):null,t[9]=n.version,t[10]=_);let v;t[11]!==g||t[12]!==_?(v=(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[g,_]}),t[11]=g,t[12]=_,t[13]=v):v=t[13];let y;t[14]!==r.statusEnabled||t[15]!==l?(y=l?(0,Y.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-surface-hover px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:[(0,Y.jsx)(o,{className:`size-3`,strokeWidth:2.5,"aria-hidden":!0}),r.statusEnabled]}):(0,Y.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full border-2 border-accent text-accent`,"aria-hidden":!0,children:(0,Y.jsx)(c,{className:`size-4`,strokeWidth:2.5})}),t[14]=r.statusEnabled,t[15]=l,t[16]=y):y=t[16];let b;t[17]!==v||t[18]!==y?(b=(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[v,y]}),t[17]=v,t[18]=y,t[19]=b):b=t[19];let x;t[20]!==r.cardNoDescription||t[21]!==n.description?(x=n.description?.trim()||r.cardNoDescription,t[20]=r.cardNoDescription,t[21]=n.description,t[22]=x):x=t[22];let S;t[23]===x?S=t[24]:(S=(0,Y.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-relaxed text-fg-muted`,children:x}),t[23]=x,t[24]=S);let C=n.hasUi?r.badgeKindUi:r.badgeKindBackend,w;t[25]!==C||t[26]!==d?(w=(0,Y.jsx)(`span`,{title:d,className:`rounded-md bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-fg-muted`,children:C}),t[25]=C,t[26]=d,t[27]=w):w=t[27];let T;t[28]!==r||t[29]!==n||t[30]!==i?(T=n.source===`bundled`?(0,Y.jsx)(`span`,{className:`rounded-md bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-fg-muted`,children:r.badgeBundled}):i?(0,Y.jsx)(`span`,{title:pe(n,r),className:`rounded-md bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-fg-muted`,children:me(n,r)}):null,t[28]=r,t[29]=n,t[30]=i,t[31]=T):T=t[31];let E;t[32]!==w||t[33]!==T?(E=(0,Y.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[w,T]}),t[32]=w,t[33]=T,t[34]=E):E=t[34];let D;t[35]!==b||t[36]!==S||t[37]!==E?(D=(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[b,S,E]}),t[35]=b,t[36]=S,t[37]=E,t[38]=D):D=t[38];let O;t[39]!==D||t[40]!==h?(O=(0,Y.jsxs)(`div`,{className:`flex gap-3`,children:[h,D]}),t[39]=D,t[40]=h,t[41]=O):O=t[41];let k;return t[42]!==a||t[43]!==O?(k=(0,Y.jsx)(`button`,{type:`button`,onClick:a,className:f,children:O}),t[42]=a,t[43]=O,t[44]=k):k=t[44],k}function _e({extension:e,copy:t,onClose:n}){let{mutate:r}=C(),[i,o]=(0,H.useState)(!1),[s,c]=(0,H.useState)(null),[d,f]=(0,H.useState)(!1),p=e.activationEligible===!0,m=(0,H.useCallback)(async()=>{if(e.source===`bundled`){c(null),f(!1),o(!0);try{let{requiresGatewayRestart:t}=await q({extensionId:e.id,enabled:!p});await r(`gateway-extensions-list`),D(),f(t)}catch(e){c(e instanceof Error?e.message:t.builtinToggleFailed)}finally{o(!1)}}},[p,t.builtinToggleFailed,e.id,e.source,r]),h=e.ui?.contributions?.pages??[],g=e.ui?.contributions?.settingsPanels??[],w=e.ui?.contributions?.chatWidgets??[],E=h.find(e=>e.showInNav)??h[0],O=g[0],A=E?k(e.id,E):null,j=O?`/settings/ext/${e.id}/${O.id}`:e.hasConfigSchema||F(e)?`/settings/ext/${e.id}`:null;return(0,Y.jsx)(S,{defaultOpen:!0,onOpenChange:e=>!e&&n(),children:(0,Y.jsxs)(y,{children:[(0,Y.jsx)(_,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),(0,Y.jsxs)(b,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex max-h-[min(90vh,44rem)] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[(0,Y.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailBack,children:(0,Y.jsx)(ee,{className:`size-5`})}),(0,Y.jsx)(x,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:t.detailTitle}),(0,Y.jsxs)(v,{className:`sr-only`,children:[e.name,` (`,e.id,`)`]}),(0,Y.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailClose,children:(0,Y.jsx)(l,{className:`size-5`})})]}),(0,Y.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4`,children:[(0,Y.jsx)(`div`,{className:`flex size-16 shrink-0 items-center justify-center rounded-2xl bg-accent-soft text-xl font-semibold text-accent-fg`,"aria-hidden":!0,children:(e.name||e.id).charAt(0).toUpperCase()}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:e.name}),(0,Y.jsxs)(`p`,{className:`mt-0.5 text-sm text-fg-muted`,children:[t.detailProviderPrefix,` `,pe(e,t)]}),e.version?(0,Y.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[`v`,e.version]}):null]})]}),(0,Y.jsx)(`p`,{className:`mt-5 text-sm leading-relaxed text-fg`,children:e.description?.trim()||t.detailNoDescription}),e.hasUi?null:(0,Y.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:t.backendOnlyHint}),(0,Y.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:he(e,t)}),e.source===`bundled`?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-hover/40 px-3 py-2 text-xs text-fg-muted shadow-surface dark:bg-surface-hover/20`,children:t.builtinConfigHint}),(0,Y.jsxs)(`div`,{className:`mt-3 rounded-lg bg-surface-hover/40 p-3 shadow-surface dark:bg-surface-hover/20`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:t.builtinRuntimeToggle}),(0,Y.jsx)(T,{type:`button`,variant:`secondary`,disabled:i,onClick:()=>void m(),className:`shrink-0 py-1.5 text-xs`,children:i?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(re,{className:`mr-1.5 size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}),t.builtinToggleBusy]}):p?t.builtinToggleDisable:t.builtinToggleEnable})]}),s?(0,Y.jsx)(`p`,{className:`mt-2 text-xs text-rose-600 dark:text-rose-400`,children:s}):null,d?(0,Y.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.builtinToggleRestartHint}):null]})]}):(0,Y.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-hover/40 px-3 py-2 text-xs text-fg-muted shadow-surface dark:bg-surface-hover/20`,children:t.cliManageHint}),e.hasUi&&(h.length>0||g.length>0||w.length>0)?(0,Y.jsxs)(`section`,{className:`mt-8`,children:[(0,Y.jsx)(`h4`,{className:`mb-3 text-sm font-semibold text-fg`,children:t.detailSectionFeatures}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,Y.jsx)(ve,{template:t.badgePages,count:h.length,hidden:h.length===0}),(0,Y.jsx)(ve,{template:t.badgeSettings,count:g.length,hidden:g.length===0}),(0,Y.jsx)(ve,{template:t.badgeWidgets,count:w.length,hidden:w.length===0})]})]}):null,P(e)&&(A||j)?(0,Y.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 border-t border-edge-subtle pt-4`,children:[A?(0,Y.jsxs)(a,{to:A,onClick:n,className:u(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,Y.jsx)(R,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.open]}):null,j?(0,Y.jsxs)(a,{to:j,onClick:n,className:u(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,Y.jsx)(N,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.openSettings]}):null]}):null,(0,Y.jsx)(`p`,{className:`mt-6 text-[11px] leading-relaxed text-fg-muted`,children:t.restartNote})]})]})]})})}function ve(e){let t=(0,U.c)(6),{template:n,count:r,hidden:i}=e;if(i||r===0)return null;let a;if(t[0]!==r||t[1]!==n){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\{\{count\}\}/g,t[3]=e):e=t[3],a=n.replace(e,String(r)),t[0]=r,t[1]=n,t[2]=a}else a=t[2];let o;return t[4]===a?o=t[5]:(o=(0,Y.jsx)(`span`,{className:`inline-flex items-center rounded-md bg-surface-hover px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:a}),t[4]=a,t[5]=o),o}function ye(){let e=(0,U.c)(5),t,n,r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(`div`,{className:`mb-6 h-8 w-40 max-w-full animate-pulse rounded-md bg-surface-hover`}),n=(0,Y.jsx)(`div`,{className:`mb-2 h-4 w-full max-w-md animate-pulse rounded bg-surface-hover`}),r=(0,Y.jsx)(`div`,{className:`mb-5 h-9 w-full max-w-lg animate-pulse rounded-full bg-surface-hover`}),e[0]=t,e[1]=n,e[2]=r):(t=e[0],n=e[1],r=e[2]);let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`ap0`,`ap1`,`ap2`,`ap3`,`ap4`,`ap5`],e[3]=i):i=e[3];let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:(0,Y.jsxs)(`div`,{className:`w-full px-3 py-8 sm:px-5 xl:px-6`,children:[t,n,r,(0,Y.jsx)(`div`,{className:`mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:i.map(be)})]})}),e[4]=a):a=e[4],a}function be(e){return(0,Y.jsx)(`div`,{className:`h-36 animate-pulse rounded-xl border border-edge-subtle bg-surface-base shadow-surface`},e)}function xe(e){let t=(0,U.c)(2),{message:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Y.jsx)(`div`,{className:`flex min-h-[min(40vh,16rem)] flex-col items-center justify-center rounded-xl border border-edge-subtle bg-surface-base px-4 py-12 text-center shadow-surface`,children:(0,Y.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n})}),t[0]=n,t[1]=r),r}export{fe as ExtensionsPage};
|