@xopcai/xopc 0.0.161 → 0.0.162
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/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-o7GRljfD.js → activity-store-hpcNv9MZ.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-9R3szLMc.js → agent-avatar-dicebear-Zf9UQEmQ.js} +1 -1
- package/dist/gateway/static/root/assets/agents-DfVkZlHc.js +2 -0
- package/dist/gateway/static/root/assets/{api-jSTqFMq9.js → api-Dnatri09.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-D81cyE76.js → app-management-settings-panel-BBTR9wJP.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-Ct6bZQCV.js → appearance-settings-C2zpLCHD.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BMtAa4Ra.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-CfD7AZKn.js → archive-plugin-9eR_ODY1.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CP_Gaxt3.js → attachment-load-DPuWYUeX.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-BGKM_NDZ.js → automation-suggestion-card-Dw49OJRl.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-BiSAMYTr.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-IPr2EVnS.js → binary-plugins-BdkJpDFm.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-B6aHEGA6.js → block-editor-CAi7SXYU.js} +47 -47
- package/dist/gateway/static/root/assets/browser-settings-page-DHmaEJS2.js +8 -0
- package/dist/gateway/static/root/assets/browser-workflow-inputs-Dx6wkGz1.js +1 -0
- package/dist/gateway/static/root/assets/browser-workflows-page-Skertc-A.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-B5wSgf4f.js +2 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-CCX9-LjU.js → capability-presets-api-CNFl7dM3.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-DyvFZwBj.js +2 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-MmLMLDWf.js → channel-recipient-api-DYQyGDw4.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-BBKEqDZn.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-Drk110ve.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-BbjzIs87.js → connector-logo-Bng6kxYF.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-HpgaUDQ1.js +2 -0
- package/dist/gateway/static/root/assets/desktop-pet-Bpf6oegd.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DQLqGLc0.js → desktop-pet-settings-BVUyefSd.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-ClsiXhmz.js → directory-picker-path-field-DjSZAPz_.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-CjMPPdzg.js → dreaming-settings-CAZk2AM4.js} +3 -3
- package/dist/gateway/static/root/assets/{extension-debug-page-57eizjhB.js → extension-debug-page-C2F6vTTd.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CsbSb3u1.js → extension-page-AnIt4bn4.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DKA9-lyP.js → extension-settings-page-CLSc6682.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-DIPJuzBZ.js → gateway-config-api-DLFyZv33.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CDLqAQY7.js → gateway-settings-DnQAA-qq.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DrfSJtvT.js → gateway-startup-retry-DbzLyJ3R.js} +1 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-DrnKFC6M.js +1 -0
- package/dist/gateway/static/root/assets/goal-detail-page-Cw1hpJkZ.js +4 -0
- package/dist/gateway/static/root/assets/{goals-config-api-lGC10UkU.js → goals-config-api-REmr3QCr.js} +1 -1
- package/dist/gateway/static/root/assets/goals-page-BDGkTVma.js +2 -0
- package/dist/gateway/static/root/assets/{goals-settings-BWq0pdrA.js → goals-settings-Dz0F3uRO.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-D4o8BJVv.js → heartbeat-settings-CQFY5gYs.js} +1 -1
- package/dist/gateway/static/root/assets/index-C8JkTS6d.js +199 -0
- package/dist/gateway/static/root/assets/index-hmrG55qg.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-6T2QYehS.js → keyboard-shortcuts-settings-BnOQXU5k.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Bdef1b7F.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DCjg2K9f.js → local-apps-page-KsOtWOyM.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Dar-xqQr.js → locale-store-0lpYdNDr.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-CyYCBqym.js → logs-page-CwLPgrWh.js} +3 -3
- package/dist/gateway/static/root/assets/{markdown-split-rt1XO43g.js → markdown-split-D5GRg10r.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Bwo8CJuh.js → media-plugins-C1ryULGs.js} +1 -1
- package/dist/gateway/static/root/assets/messages-BwQ3WssU.js +5 -0
- package/dist/gateway/static/root/assets/{notes-page-Dp-pkX7d.js → notes-page-CIeZ1_DT.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-Cf06q19x.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-CzZ4iKOb.js → page-tabs-Caj1-E_X.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-3E_Qa-58.js → preview-open-alternatives-DKwEce-9.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-B2T48Sbt.js → product-open-page-B90ZskkN.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-SHTurM4t.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-BcC2qUAw.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-6vGefBHv.js +1 -0
- package/dist/gateway/static/root/assets/save-bar-controls-BDYt53uQ.js +1 -0
- package/dist/gateway/static/root/assets/{schedule-field-TkqUL3wm.js → schedule-field-Bcdni4Pj.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DC-iU5IG.js → schema-form-D7oCARF7.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-C5014a53.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CDY3ZI1K.js +1 -0
- package/dist/gateway/static/root/assets/{settings-collapsible-section-Dpqth3oA.js → settings-collapsible-section-6eNF8Jey.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-form-section-CNqF6IwY.js → settings-form-section-CARTHCxH.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-DkvwitK_.js → settings-loading-skeleton-DEwYqESe.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-B6vVdHeQ.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-layout-DWvNgISx.js → settings-page-layout-D3srt5Bi.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-z-rF0Hdg.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DGpSPW-n.js → share-preview-page-Ck9SxiXw.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-CHZFXE_d.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-B7p2QNXt.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-ncw3tX9P.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-8TxxSbUw.js → system-settings-panel-DLBUQSk2.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-B5FzMWOx.js → theme-store-C1oaqeD2.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-DEGtSA5h.js → typed-models-lib-Divbg_C4.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-BDU6FneG.js → use-channel-catalog-CP9a_rAf.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-iYfeSLKI.js +1 -0
- package/dist/gateway/static/root/assets/voice-api-key-field-CrwkicvT.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-page-BQWxyPg8.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-50ZzGay5.js +1 -0
- package/dist/gateway/static/root/assets/work-page-DPqEahx7.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Cwi8Pz7n.js → workflow-run-setup-panel-DbDPYQwB.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-C3eIC5HZ.js +11 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +1 -0
- package/dist/src/agent/client-error-format.js +3 -3
- package/dist/src/agent/outcomes/task-evaluation.d.ts +20 -0
- package/dist/src/agent/outcomes/task-evaluation.js +48 -0
- package/dist/src/agent/outcomes/task-verifier.d.ts +29 -0
- package/dist/src/agent/outcomes/task-verifier.js +71 -0
- package/dist/src/agent/prompt/memory/index.js +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +32 -1
- package/dist/src/agent/service.js +1 -0
- package/dist/src/agent/service.types.d.ts +1 -0
- package/dist/src/agent/tools/browser/tool/browser-use-tool.d.ts +1 -7
- package/dist/src/agent/tools/browser/tool/browser-use-tool.js +2 -73
- package/dist/src/agent/tools/browser/tool/schemas.d.ts +1 -13
- package/dist/src/agent/tools/browser/tool/schemas.js +1 -9
- package/dist/src/agent/tools/browser-recipe-tool.d.ts +12 -0
- package/dist/src/agent/tools/browser-recipe-tool.js +113 -0
- package/dist/src/agent/tools/factory.d.ts +2 -0
- package/dist/src/agent/tools/factory.js +2 -0
- package/dist/src/agent/tools/index.d.ts +1 -0
- package/dist/src/agent/tools/index.js +2 -1
- package/dist/src/automations/domain/types.d.ts +13 -0
- package/dist/src/automations/domain/validation.d.ts +44 -24
- package/dist/src/automations/domain/validation.js +27 -18
- package/dist/src/automations/draft/automation-draft-validator.d.ts +6 -1
- package/dist/src/automations/draft/automation-draft-validator.js +1 -0
- package/dist/src/automations/service/action-executor.d.ts +1 -0
- package/dist/src/automations/service/action-executor.js +22 -0
- package/dist/src/browser/index.d.ts +0 -1
- package/dist/src/browser/index.js +1 -2
- package/dist/src/browser/pipeline/runner.d.ts +9 -2
- package/dist/src/browser/pipeline/runner.js +151 -105
- package/dist/src/browser/pipeline/schema.d.ts +21 -15
- package/dist/src/browser/pipeline/schema.js +93 -99
- package/dist/src/browser/recipes/index.d.ts +3 -0
- package/dist/src/browser/recipes/index.js +3 -0
- package/dist/src/browser/recipes/repository.d.ts +13 -0
- package/dist/src/browser/recipes/repository.js +81 -0
- package/dist/src/browser/recipes/runtime-service.d.ts +6 -0
- package/dist/src/browser/recipes/runtime-service.js +30 -0
- package/dist/src/browser/recipes/service.d.ts +36 -0
- package/dist/src/browser/recipes/service.js +186 -0
- package/dist/src/browser/recipes/types.d.ts +36 -0
- package/dist/src/browser/recipes/types.js +1 -0
- package/dist/src/cli/commands/browser-cli-helpers.js +6 -12
- package/dist/src/cli/commands/browser.js +4 -3
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/schema.d.ts +3 -3
- package/dist/src/config/schema.js +21 -21
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -1
- package/dist/src/gateway/hono/routes/browser-workflows.d.ts +3 -0
- package/dist/src/gateway/hono/routes/browser-workflows.js +78 -0
- package/dist/src/gateway/hono/routes/home.js +1 -0
- package/dist/src/gateway/hono/routes/index.js +4 -0
- package/dist/src/gateway/hono/routes/interaction-state.d.ts +3 -0
- package/dist/src/gateway/hono/routes/interaction-state.js +45 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/memory.js +33 -4
- package/dist/src/gateway/hono/routes/task-outcomes.d.ts +3 -0
- package/dist/src/gateway/hono/routes/task-outcomes.js +109 -0
- package/dist/src/gateway/hono/routes/you.d.ts +10 -2
- package/dist/src/gateway/hono/routes/you.js +184 -28
- package/dist/src/gateway/service/run-gateway-agent.js +84 -0
- package/dist/src/gateway/service.d.ts +3 -0
- package/dist/src/gateway/service.js +14 -0
- package/dist/src/proactive/insight-repository.d.ts +2 -0
- package/dist/src/proactive/insight-repository.js +5 -2
- package/dist/src/proactive/run-processor.js +22 -1
- package/dist/src/proactive/types.d.ts +2 -0
- package/dist/src/proactive/value-score.d.ts +13 -0
- package/dist/src/proactive/value-score.js +30 -0
- package/dist/src/share/share-types.js +5 -5
- package/dist/src/share/site-share-types.d.ts +1 -1
- package/dist/src/share/site-share-types.js +5 -5
- package/dist/src/storage/sqlite/index.d.ts +3 -0
- package/dist/src/storage/sqlite/index.js +4 -1
- package/dist/src/storage/sqlite/interaction-state-repository.d.ts +17 -0
- package/dist/src/storage/sqlite/interaction-state-repository.js +60 -0
- package/dist/src/storage/sqlite/memory-records-repository.js +1 -1
- package/dist/src/storage/sqlite/migrations/053_browser_recipes.sql +45 -0
- package/dist/src/storage/sqlite/migrations/054_task_outcomes.sql +24 -0
- package/dist/src/storage/sqlite/migrations/055_relationship_settings.sql +14 -0
- package/dist/src/storage/sqlite/migrations/056_task_verification.sql +6 -0
- package/dist/src/storage/sqlite/migrations/057_interaction_states.sql +11 -0
- package/dist/src/storage/sqlite/migrations/058_proactive_value.sql +3 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/relationship-settings-repository.d.ts +17 -0
- package/dist/src/storage/sqlite/relationship-settings-repository.js +64 -0
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/schema.sql +46 -0
- package/dist/src/storage/sqlite/task-outcome-repository.d.ts +90 -0
- package/dist/src/storage/sqlite/task-outcome-repository.js +138 -0
- package/dist/src/user-context/interaction-state.d.ts +13 -0
- package/dist/src/user-context/interaction-state.js +69 -0
- package/dist/src/user-context/memory-use-audit.d.ts +10 -0
- package/dist/src/user-context/memory-use-audit.js +25 -0
- package/dist/src/user-context/personal-playbook.d.ts +11 -0
- package/dist/src/user-context/personal-playbook.js +41 -0
- package/dist/src/user-context/projection.d.ts +4 -0
- package/dist/src/user-context/projection.js +5 -1
- package/dist/src/user-context/relationship-continuity.d.ts +14 -0
- package/dist/src/user-context/relationship-continuity.js +51 -0
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/action-boundary-settings-panel-BIVBUiNT.js +0 -1
- package/dist/gateway/static/root/assets/agents-_qbUaYbs.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-0sPqD0FK.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-BxWBuBsE.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-C499b9AH.js +0 -8
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-Dva9SiPK.js +0 -2
- package/dist/gateway/static/root/assets/channels-settings-DNAU7u9o.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-CIOH7tgn.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-TwiBp8vY.js +0 -2
- package/dist/gateway/static/root/assets/desktop-pet-CYH5ZSXy.js +0 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-Q3B0E-0s.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-C5VAK04G.js +0 -4
- package/dist/gateway/static/root/assets/goals-page-BJb-5IYw.js +0 -2
- package/dist/gateway/static/root/assets/index-CkUHH170.css +0 -1
- package/dist/gateway/static/root/assets/index-vq_cJZJC.js +0 -199
- package/dist/gateway/static/root/assets/local-app-workbench-page-euH17Kvb.js +0 -2
- package/dist/gateway/static/root/assets/messages-CxySDn9d.js +0 -5
- package/dist/gateway/static/root/assets/models-hub-panel-DObxxjc9.js +0 -2
- package/dist/gateway/static/root/assets/notes-workbench-CCb4RXcZ.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-BvEcriRC.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-B_e79MRJ.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-DGcqnYfR.js +0 -1
- package/dist/gateway/static/root/assets/save-bar-controls-CkeKasGm.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-DQZhrDJ8.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BkdeN99Y.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-qPG7I2zd.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-lwRAh9aw.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BGj9IVUr.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-B2UBAs5U.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-DdjzFZ8I.js +0 -2
- package/dist/gateway/static/root/assets/user-context-page-BTTZpAGV.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-DuDQd-WU.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BUVkVCsW.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-DeEPPu4n.js +0 -1
- package/dist/gateway/static/root/assets/work-page-DQNUyTUq.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-BIy4wrzO.js +0 -11
- package/dist/src/browser/pipeline/source.d.ts +0 -9
- package/dist/src/browser/pipeline/source.js +0 -77
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=20260713-1" />
|
|
12
12
|
<link rel="manifest" href="/site.webmanifest?v=20260713-1" />
|
|
13
13
|
<title>xopc</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-C8JkTS6d.js"></script>
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-aKtaBQYM.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-zJ_50EbN.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BOUWij0V.js">
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/assets/check-DUBLcKHA.js">
|
|
25
25
|
<link rel="modulepreload" crossorigin href="/assets/circle-alert-BEjgurr2.js">
|
|
26
26
|
<link rel="modulepreload" crossorigin href="/assets/middleware-Pd0e8Igk.js">
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/assets/messages-
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/locale-store-
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/assets/messages-BwQ3WssU.js">
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/locale-store-0lpYdNDr.js">
|
|
29
29
|
<link rel="modulepreload" crossorigin href="/assets/cn-JdwAhgNB.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/schemas-DgQq6Z5S.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/product-delivery-BTRT9kCS.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/config-reload-event-Bjh2zoKp.js">
|
|
33
33
|
<link rel="modulepreload" crossorigin href="/assets/copy-to-clipboard-HOJ79TWv.js">
|
|
34
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-
|
|
35
|
-
<link rel="modulepreload" crossorigin href="/assets/activity-store-
|
|
36
|
-
<link rel="modulepreload" crossorigin href="/assets/theme-store-
|
|
37
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
34
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-DbzLyJ3R.js">
|
|
35
|
+
<link rel="modulepreload" crossorigin href="/assets/activity-store-hpcNv9MZ.js">
|
|
36
|
+
<link rel="modulepreload" crossorigin href="/assets/theme-store-C1oaqeD2.js">
|
|
37
|
+
<link rel="stylesheet" crossorigin href="/assets/index-hmrG55qg.css">
|
|
38
38
|
</head>
|
|
39
39
|
<body>
|
|
40
40
|
<div id="root"></div>
|
package/dist/package.js
CHANGED
|
@@ -84,6 +84,7 @@ export interface AgentManagerConfig {
|
|
|
84
84
|
};
|
|
85
85
|
/** Gateway: exposes AutomationService for the `automation` tool. */
|
|
86
86
|
getAutomationService?: () => AutomationService | undefined;
|
|
87
|
+
getBrowserRecipeService?: () => import('../browser/recipes/index.js').BrowserRecipeService | undefined;
|
|
87
88
|
/** Gateway: exposes first-class xopc product objects for the `xopc_use` tool. */
|
|
88
89
|
getNotesService?: () => NotesService | undefined;
|
|
89
90
|
getProjectService?: () => ProjectService | undefined;
|
|
@@ -230,6 +230,7 @@ var AgentManager = class {
|
|
|
230
230
|
getSessionStore: this.config.getSessionStore,
|
|
231
231
|
gatewayClarify: this.config.gatewayClarify,
|
|
232
232
|
getAutomationService: this.config.getAutomationService,
|
|
233
|
+
getBrowserRecipeService: this.config.getBrowserRecipeService,
|
|
233
234
|
getNotesService: this.config.getNotesService,
|
|
234
235
|
getProjectService: this.config.getProjectService,
|
|
235
236
|
getWorkItemService: this.config.getWorkItemService,
|
|
@@ -21,7 +21,7 @@ function reasonToCode(reason) {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
function providerDeepLink(kind) {
|
|
24
|
-
if (kind === "provider_setup_required" || kind === "provider_auth_invalid") return "/settings/
|
|
24
|
+
if (kind === "provider_setup_required" || kind === "provider_auth_invalid") return "/settings/capabilities/models";
|
|
25
25
|
}
|
|
26
26
|
function tryParseStructuredPayload(text) {
|
|
27
27
|
if (!text.startsWith("{")) return null;
|
|
@@ -61,7 +61,7 @@ function formatAgentRunErrorForClient(rawError, context) {
|
|
|
61
61
|
kind: "provider_setup_required",
|
|
62
62
|
code: "provider_setup_required",
|
|
63
63
|
provider,
|
|
64
|
-
deepLink: "/settings/
|
|
64
|
+
deepLink: "/settings/capabilities/models",
|
|
65
65
|
message: trimmed
|
|
66
66
|
});
|
|
67
67
|
}
|
|
@@ -79,7 +79,7 @@ function formatAgentRunErrorForClient(rawError, context) {
|
|
|
79
79
|
if (kind === "unknown" && isAuthErrorMessage(trimmed)) {
|
|
80
80
|
payload.kind = "provider_auth_invalid";
|
|
81
81
|
payload.code = "provider_auth_invalid";
|
|
82
|
-
payload.deepLink = "/settings/
|
|
82
|
+
payload.deepLink = "/settings/capabilities/models";
|
|
83
83
|
}
|
|
84
84
|
return JSON.stringify(payload);
|
|
85
85
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TaskOutcome } from '../../storage/sqlite/task-outcome-repository.js';
|
|
2
|
+
export interface TaskEvaluationReplay {
|
|
3
|
+
total: number;
|
|
4
|
+
falseCompletions: number;
|
|
5
|
+
verificationDrift: number;
|
|
6
|
+
supportMismatches: number;
|
|
7
|
+
channelConsistencyGap: number;
|
|
8
|
+
byChannel: Record<string, {
|
|
9
|
+
total: number;
|
|
10
|
+
verified: number;
|
|
11
|
+
helpful: number;
|
|
12
|
+
rated: number;
|
|
13
|
+
}>;
|
|
14
|
+
cases: Array<{
|
|
15
|
+
runId: string;
|
|
16
|
+
storedVerification: string;
|
|
17
|
+
replayedVerification: string;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
export declare function replayTaskEvaluation(outcomes: TaskOutcome[]): TaskEvaluationReplay;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { verifyTaskCompletion } from "./task-verifier.js";
|
|
2
|
+
//#region src/agent/outcomes/task-evaluation.ts
|
|
3
|
+
function replayTaskEvaluation(outcomes) {
|
|
4
|
+
const completed = outcomes.filter((outcome) => outcome.status !== "running");
|
|
5
|
+
const byChannel = {};
|
|
6
|
+
const cases = [];
|
|
7
|
+
let falseCompletions = 0;
|
|
8
|
+
let supportMismatches = 0;
|
|
9
|
+
for (const outcome of completed) {
|
|
10
|
+
const replayed = verifyTaskCompletion({
|
|
11
|
+
status: outcome.status,
|
|
12
|
+
acceptanceCriteria: outcome.contract?.acceptanceCriteria ?? [],
|
|
13
|
+
evidence: outcome.evidence
|
|
14
|
+
});
|
|
15
|
+
if (replayed.status !== outcome.verification.status) cases.push({
|
|
16
|
+
runId: outcome.runId,
|
|
17
|
+
storedVerification: outcome.verification.status,
|
|
18
|
+
replayedVerification: replayed.status
|
|
19
|
+
});
|
|
20
|
+
if (outcome.status === "succeeded" && replayed.status !== "passed") falseCompletions += 1;
|
|
21
|
+
if (outcome.feedback?.supportFit === false) supportMismatches += 1;
|
|
22
|
+
const channel = byChannel[outcome.channel] ?? {
|
|
23
|
+
total: 0,
|
|
24
|
+
verified: 0,
|
|
25
|
+
helpful: 0,
|
|
26
|
+
rated: 0
|
|
27
|
+
};
|
|
28
|
+
channel.total += 1;
|
|
29
|
+
if (replayed.status === "passed") channel.verified += 1;
|
|
30
|
+
if (outcome.feedback) {
|
|
31
|
+
channel.rated += 1;
|
|
32
|
+
if (outcome.feedback.outcome === "helpful") channel.helpful += 1;
|
|
33
|
+
}
|
|
34
|
+
byChannel[outcome.channel] = channel;
|
|
35
|
+
}
|
|
36
|
+
const verificationRates = Object.values(byChannel).filter((item) => item.total > 0).map((item) => item.verified / item.total);
|
|
37
|
+
return {
|
|
38
|
+
total: completed.length,
|
|
39
|
+
falseCompletions,
|
|
40
|
+
verificationDrift: cases.length,
|
|
41
|
+
supportMismatches,
|
|
42
|
+
channelConsistencyGap: verificationRates.length > 1 ? Math.max(...verificationRates) - Math.min(...verificationRates) : 0,
|
|
43
|
+
byChannel,
|
|
44
|
+
cases
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { replayTaskEvaluation };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type TaskVerificationStatus = 'passed' | 'failed' | 'unverified';
|
|
2
|
+
export type TaskFailurePhase = 'planning' | 'execution' | 'verification' | 'approval' | 'runtime';
|
|
3
|
+
export type TaskFailureCode = 'cancelled' | 'timeout' | 'tool_failed' | 'verification_failed' | 'approval_required' | 'conflict' | 'model_failed' | 'unknown';
|
|
4
|
+
export type TaskRecoveryAction = 'replan' | 'retry_with_changed_strategy' | 'request_user_input' | 'none';
|
|
5
|
+
export interface TaskVerification {
|
|
6
|
+
status: TaskVerificationStatus;
|
|
7
|
+
checks: Array<{
|
|
8
|
+
criterion: string;
|
|
9
|
+
status: TaskVerificationStatus;
|
|
10
|
+
evidenceTitles: string[];
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
export interface TaskFailureDiagnosis {
|
|
14
|
+
code: TaskFailureCode;
|
|
15
|
+
phase: TaskFailurePhase;
|
|
16
|
+
recoveryAction: TaskRecoveryAction;
|
|
17
|
+
}
|
|
18
|
+
export declare function verifyTaskCompletion(input: {
|
|
19
|
+
status: 'succeeded' | 'failed' | 'cancelled';
|
|
20
|
+
acceptanceCriteria: string[];
|
|
21
|
+
evidence: Array<{
|
|
22
|
+
title: string;
|
|
23
|
+
verifies?: string[];
|
|
24
|
+
}>;
|
|
25
|
+
}): TaskVerification;
|
|
26
|
+
export declare function diagnoseTaskFailure(input: {
|
|
27
|
+
status: 'failed' | 'cancelled';
|
|
28
|
+
summary: string;
|
|
29
|
+
}): TaskFailureDiagnosis;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
//#region src/agent/outcomes/task-verifier.ts
|
|
2
|
+
function verifyTaskCompletion(input) {
|
|
3
|
+
const checks = input.acceptanceCriteria.map((criterion) => {
|
|
4
|
+
const evidenceTitles = input.evidence.filter((evidence) => evidence.verifies?.includes(criterion)).map((evidence) => evidence.title);
|
|
5
|
+
return {
|
|
6
|
+
criterion,
|
|
7
|
+
status: evidenceTitles.length > 0 ? "passed" : "unverified",
|
|
8
|
+
evidenceTitles
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
if (input.status === "failed" || input.status === "cancelled") return {
|
|
12
|
+
status: "failed",
|
|
13
|
+
checks: checks.map((check) => ({
|
|
14
|
+
...check,
|
|
15
|
+
status: "failed"
|
|
16
|
+
}))
|
|
17
|
+
};
|
|
18
|
+
if (checks.length === 0 || checks.some((check) => check.status !== "passed")) return {
|
|
19
|
+
status: "unverified",
|
|
20
|
+
checks
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
status: "passed",
|
|
24
|
+
checks
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function diagnoseTaskFailure(input) {
|
|
28
|
+
const text = input.summary.toLocaleLowerCase();
|
|
29
|
+
if (input.status === "cancelled") return {
|
|
30
|
+
code: "cancelled",
|
|
31
|
+
phase: "runtime",
|
|
32
|
+
recoveryAction: "none"
|
|
33
|
+
};
|
|
34
|
+
if (/timeout|timed out|deadline exceeded/.test(text)) return {
|
|
35
|
+
code: "timeout",
|
|
36
|
+
phase: "runtime",
|
|
37
|
+
recoveryAction: "retry_with_changed_strategy"
|
|
38
|
+
};
|
|
39
|
+
if (/approval|permission|authorization|forbidden/.test(text)) return {
|
|
40
|
+
code: "approval_required",
|
|
41
|
+
phase: "approval",
|
|
42
|
+
recoveryAction: "request_user_input"
|
|
43
|
+
};
|
|
44
|
+
if (/test|typecheck|lint|build|verification|acceptance/.test(text)) return {
|
|
45
|
+
code: "verification_failed",
|
|
46
|
+
phase: "verification",
|
|
47
|
+
recoveryAction: "replan"
|
|
48
|
+
};
|
|
49
|
+
if (/already processing|conflict|locked|concurrent/.test(text)) return {
|
|
50
|
+
code: "conflict",
|
|
51
|
+
phase: "execution",
|
|
52
|
+
recoveryAction: "retry_with_changed_strategy"
|
|
53
|
+
};
|
|
54
|
+
if (/tool|command|exit code|enoent|not found/.test(text)) return {
|
|
55
|
+
code: "tool_failed",
|
|
56
|
+
phase: "execution",
|
|
57
|
+
recoveryAction: "replan"
|
|
58
|
+
};
|
|
59
|
+
if (/model|provider|rate limit|context length/.test(text)) return {
|
|
60
|
+
code: "model_failed",
|
|
61
|
+
phase: "runtime",
|
|
62
|
+
recoveryAction: "retry_with_changed_strategy"
|
|
63
|
+
};
|
|
64
|
+
return {
|
|
65
|
+
code: "unknown",
|
|
66
|
+
phase: "execution",
|
|
67
|
+
recoveryAction: "replan"
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
export { diagnoseTaskFailure, verifyTaskCompletion };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../../utils/logger.js";
|
|
3
3
|
import { requireXopcDatabase } from "../../../storage/sqlite/connection.js";
|
|
4
|
-
import { searchMemoryIndex, syncMemoryIndex } from "../../../storage/sqlite/memory-index-repository.js";
|
|
5
4
|
import { LOCAL_USER_ID } from "../../../user-context/owner.js";
|
|
5
|
+
import { searchMemoryIndex, syncMemoryIndex } from "../../../storage/sqlite/memory-index-repository.js";
|
|
6
6
|
import "../../../storage/sqlite/index.js";
|
|
7
7
|
import { join, relative } from "path";
|
|
8
8
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { isXopcDatabaseOpen } from "../../storage/sqlite/connection.js";
|
|
4
|
+
import { buildInteractionStatePrompt } from "../../user-context/interaction-state.js";
|
|
5
|
+
import { getInteractionState } from "../../storage/sqlite/interaction-state-repository.js";
|
|
6
|
+
import { buildRelationshipPrompt, getRelationshipSettings } from "../../storage/sqlite/relationship-settings-repository.js";
|
|
7
|
+
import { listMemoryRecords } from "../../storage/sqlite/memory-records-repository.js";
|
|
4
8
|
import { DEFAULT_USER_TRUST_LEVEL, buildActionTrustPrompt } from "../../user-context/trust-policy.js";
|
|
5
9
|
import { getUserTrustPolicy } from "../../storage/sqlite/user-trust-repository.js";
|
|
6
10
|
import "../../storage/sqlite/index.js";
|
|
11
|
+
import { init_session_key, parseSessionKey } from "../../routing/session-key.js";
|
|
7
12
|
import { resolveSystemPromptBuildParams } from "./system-prompt-params.js";
|
|
8
13
|
import { buildSystemPrompt } from "./system-prompt.js";
|
|
9
14
|
import { buildTtsSystemPromptHint } from "../../voice/tts/directives.js";
|
|
10
15
|
import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
|
|
16
|
+
import { buildPersonalPlaybookPrompt } from "../../user-context/personal-playbook.js";
|
|
17
|
+
import { buildRelationshipContinuityPrompt } from "../../user-context/relationship-continuity.js";
|
|
11
18
|
//#region src/agent/prompt/service-prompt-builder.ts
|
|
19
|
+
init_session_key();
|
|
12
20
|
init_logger();
|
|
13
21
|
const log = createLogger("SystemPromptBuilder");
|
|
14
22
|
var SystemPromptBuilder = class {
|
|
@@ -23,6 +31,19 @@ var SystemPromptBuilder = class {
|
|
|
23
31
|
build(contextFiles, options) {
|
|
24
32
|
const ws = options.workspaceOverride ?? this.workspace;
|
|
25
33
|
const actionTrustLevel = isXopcDatabaseOpen() ? getUserTrustPolicy().defaultActionLevel : DEFAULT_USER_TRUST_LEVEL;
|
|
34
|
+
const relationshipPrompt = isXopcDatabaseOpen() ? buildRelationshipPrompt(getRelationshipSettings()) : "";
|
|
35
|
+
const interactionState = isXopcDatabaseOpen() && options.sessionKey ? getInteractionState(options.sessionKey) : void 0;
|
|
36
|
+
const session = parseSessionKey(options.sessionKey);
|
|
37
|
+
const activeMemories = isXopcDatabaseOpen() ? listMemoryRecords({
|
|
38
|
+
status: "active",
|
|
39
|
+
limit: 500
|
|
40
|
+
}) : [];
|
|
41
|
+
const playbookPrompt = isXopcDatabaseOpen() ? buildPersonalPlaybookPrompt(activeMemories, {
|
|
42
|
+
...session ? { channel: session.source } : {},
|
|
43
|
+
...interactionState ? { supportNeed: interactionState.supportNeed } : {}
|
|
44
|
+
}) : "";
|
|
45
|
+
const continuityPrompt = buildRelationshipContinuityPrompt(activeMemories);
|
|
46
|
+
const interactionPrompt = interactionState ? buildInteractionStatePrompt(interactionState) : "";
|
|
26
47
|
if (options.systemPromptOverride?.trim()) {
|
|
27
48
|
const skillPrompt = options.skillPromptText !== void 0 ? options.skillPromptText : this.skillManager.getPromptForSkillAllowlist(options.skillAllowlist, options.registeredToolNames);
|
|
28
49
|
const trimmed = options.systemPromptOverride.trim();
|
|
@@ -38,6 +59,10 @@ var SystemPromptBuilder = class {
|
|
|
38
59
|
});
|
|
39
60
|
if (ttsHint?.trim()) fullPrompt = `${fullPrompt}\n\n## Voice (TTS)\n\n${ttsHint.trim()}`;
|
|
40
61
|
fullPrompt = `${fullPrompt}\n\n${buildActionTrustPrompt(actionTrustLevel)}`;
|
|
62
|
+
if (relationshipPrompt) fullPrompt = `${fullPrompt}\n\n${relationshipPrompt}`;
|
|
63
|
+
if (playbookPrompt) fullPrompt = `${fullPrompt}\n\n${playbookPrompt}`;
|
|
64
|
+
if (interactionPrompt) fullPrompt = `${fullPrompt}\n\n${interactionPrompt}`;
|
|
65
|
+
if (continuityPrompt) fullPrompt = `${fullPrompt}\n\n${continuityPrompt}`;
|
|
41
66
|
log.debug({
|
|
42
67
|
baseLength: trimmed.length,
|
|
43
68
|
skillLength: skillPrompt.length,
|
|
@@ -65,7 +90,13 @@ var SystemPromptBuilder = class {
|
|
|
65
90
|
externalMemoryInstructions: options.externalMemoryInstructions,
|
|
66
91
|
heartbeatEnabled,
|
|
67
92
|
ttsSystemHint,
|
|
68
|
-
extraSystemPrompt:
|
|
93
|
+
extraSystemPrompt: [
|
|
94
|
+
options.extraSystemPrompt,
|
|
95
|
+
relationshipPrompt,
|
|
96
|
+
playbookPrompt,
|
|
97
|
+
interactionPrompt,
|
|
98
|
+
continuityPrompt
|
|
99
|
+
].filter(Boolean).join("\n\n"),
|
|
69
100
|
activeProjectContext: options.activeProjectContext,
|
|
70
101
|
modelRef: options.modelRef,
|
|
71
102
|
agentId: options.agentId,
|
|
@@ -228,6 +228,7 @@ var AgentService = class {
|
|
|
228
228
|
verboseLevel: config.verboseLevel,
|
|
229
229
|
gatewayClarify: config.gatewayClarify,
|
|
230
230
|
getAutomationService: config.getAutomationService,
|
|
231
|
+
getBrowserRecipeService: config.getBrowserRecipeService,
|
|
231
232
|
getNotesService: config.getNotesService,
|
|
232
233
|
getProjectService: config.getProjectService,
|
|
233
234
|
getWorkItemService: config.getWorkItemService,
|
|
@@ -28,6 +28,7 @@ export interface AgentServiceConfig {
|
|
|
28
28
|
requestClarification: GatewayClarifyRequestFn;
|
|
29
29
|
};
|
|
30
30
|
getAutomationService?: () => AutomationService | undefined;
|
|
31
|
+
getBrowserRecipeService?: () => import('../browser/recipes/index.js').BrowserRecipeService | undefined;
|
|
31
32
|
/** Gateway: exposes first-class xopc product objects for the `xopc_use` tool. */
|
|
32
33
|
getNotesService?: () => NotesService | undefined;
|
|
33
34
|
getProjectService?: () => ProjectService | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* browser_use — unified browser AgentTool.
|
|
3
3
|
*
|
|
4
|
-
* Modes: command |
|
|
4
|
+
* Modes: command | inspect | close.
|
|
5
5
|
* Replaces the 14 fine-grained browser_* tools with a single entry point.
|
|
6
6
|
*/
|
|
7
7
|
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
@@ -9,7 +9,6 @@ import type { Config } from '../../../../config/schema.js';
|
|
|
9
9
|
import type { BrowserManager } from '../../../../browser/manager.js';
|
|
10
10
|
import type { CdpSupervisor } from '../../../../browser/cdp-supervisor.js';
|
|
11
11
|
import type { Page } from 'playwright-core';
|
|
12
|
-
import type { BrowserActionContext, BrowserActionResult } from '../../../../browser/actions/types.js';
|
|
13
12
|
import type { BrowserNotReadyError } from '../../../../browser/readiness.js';
|
|
14
13
|
export interface CreateBrowserUseToolDeps {
|
|
15
14
|
getManager: () => BrowserManager;
|
|
@@ -24,10 +23,5 @@ export interface CreateBrowserUseToolDeps {
|
|
|
24
23
|
* card. Cache the result upstream (~30s) so back-to-back calls don't reprobe.
|
|
25
24
|
*/
|
|
26
25
|
getReadiness?: () => Promise<BrowserNotReadyError | null>;
|
|
27
|
-
/** Pipeline runner (injected to avoid circular deps; lazy-loaded if not provided). */
|
|
28
|
-
runPipeline?: (yaml: string, args: Record<string, unknown>, ctx: BrowserActionContext, options: {
|
|
29
|
-
dryRun?: boolean;
|
|
30
|
-
sourceLocation?: string;
|
|
31
|
-
}) => Promise<BrowserActionResult>;
|
|
32
26
|
}
|
|
33
27
|
export declare function createBrowserUseTool(deps: CreateBrowserUseToolDeps): AgentTool<any, any>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "../../../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../../../utils/logger.js";
|
|
3
3
|
import { createBrowserActionRegistry } from "../../../../browser/actions/registry.js";
|
|
4
|
-
import { loadBrowserPipelineSource } from "../../../../browser/pipeline/source.js";
|
|
5
4
|
import { BrowserUseSchema } from "./schemas.js";
|
|
6
5
|
//#region src/agent/tools/browser/tool/browser-use-tool.ts
|
|
7
6
|
init_logger();
|
|
@@ -85,10 +84,10 @@ function createBrowserUseTool(deps) {
|
|
|
85
84
|
return {
|
|
86
85
|
name: "browser_use",
|
|
87
86
|
label: "🌐 Browser",
|
|
88
|
-
description: "Use a persistent browser for
|
|
87
|
+
description: "Use a persistent browser for navigation, inspection, interaction, screenshots, and network capture. Use browser_recipe for saved repeatable browser work.",
|
|
89
88
|
parameters: BrowserUseSchema,
|
|
90
89
|
async execute(_toolCallId, params, signal, _onUpdate) {
|
|
91
|
-
const { mode, command, args: cmdArgs,
|
|
90
|
+
const { mode, command, args: cmdArgs, options: _options } = params;
|
|
92
91
|
if (deps.getReadiness) try {
|
|
93
92
|
const notReady = await deps.getReadiness();
|
|
94
93
|
if (notReady) return formatNotReady(notReady.hint);
|
|
@@ -173,76 +172,6 @@ function createBrowserUseTool(deps) {
|
|
|
173
172
|
const args = cmdArgs ?? {};
|
|
174
173
|
return formatResult(await registry.execute(command, ctx, args));
|
|
175
174
|
}
|
|
176
|
-
if (mode === "pipeline") {
|
|
177
|
-
if (!pipelineParams) return {
|
|
178
|
-
content: [{
|
|
179
|
-
type: "text",
|
|
180
|
-
text: "Missing `pipeline` parameter for pipeline mode."
|
|
181
|
-
}],
|
|
182
|
-
details: {
|
|
183
|
-
ok: false,
|
|
184
|
-
mode: "pipeline"
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
let yamlSource = pipelineParams.yaml ?? "";
|
|
188
|
-
let sourceLocation;
|
|
189
|
-
if (!yamlSource && pipelineParams.path) try {
|
|
190
|
-
const loaded = await loadBrowserPipelineSource(pipelineParams.path);
|
|
191
|
-
yamlSource = loaded.source;
|
|
192
|
-
sourceLocation = loaded.location;
|
|
193
|
-
} catch (e) {
|
|
194
|
-
const msg = e instanceof Error ? e.message : String(e);
|
|
195
|
-
return {
|
|
196
|
-
content: [{
|
|
197
|
-
type: "text",
|
|
198
|
-
text: `Failed to read pipeline source: ${msg}`
|
|
199
|
-
}],
|
|
200
|
-
details: {
|
|
201
|
-
ok: false,
|
|
202
|
-
mode: "pipeline",
|
|
203
|
-
error: msg
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
if (!yamlSource) return {
|
|
208
|
-
content: [{
|
|
209
|
-
type: "text",
|
|
210
|
-
text: "Pipeline mode requires `yaml`, `script`, or `path`."
|
|
211
|
-
}],
|
|
212
|
-
details: {
|
|
213
|
-
ok: false,
|
|
214
|
-
mode: "pipeline"
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
const pipelineArgs = pipelineParams.args ?? {};
|
|
218
|
-
const dryRun = pipelineParams.dryRun === true;
|
|
219
|
-
const ctx = buildContext(await deps.getPageForTask(), signal);
|
|
220
|
-
if (deps.runPipeline) return formatResult(await deps.runPipeline(yamlSource, pipelineArgs, ctx, {
|
|
221
|
-
dryRun,
|
|
222
|
-
sourceLocation
|
|
223
|
-
}));
|
|
224
|
-
try {
|
|
225
|
-
const { runBrowserPipeline } = await import("../../../../browser/pipeline/runner.js");
|
|
226
|
-
return formatResult(await runBrowserPipeline(yamlSource, pipelineArgs, ctx, registry, {
|
|
227
|
-
dryRun,
|
|
228
|
-
sourceLocation
|
|
229
|
-
}));
|
|
230
|
-
} catch (e) {
|
|
231
|
-
const msg = e instanceof Error ? e.message : String(e);
|
|
232
|
-
log.error({ err: e }, `Pipeline execution failed: ${msg}`);
|
|
233
|
-
return {
|
|
234
|
-
content: [{
|
|
235
|
-
type: "text",
|
|
236
|
-
text: `Pipeline failed: ${msg}`
|
|
237
|
-
}],
|
|
238
|
-
details: {
|
|
239
|
-
ok: false,
|
|
240
|
-
mode: "pipeline",
|
|
241
|
-
error: msg
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
175
|
return {
|
|
247
176
|
content: [{
|
|
248
177
|
type: "text",
|
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* BrowserUseSchema — Typebox schema for the unified `browser_use` AgentTool.
|
|
3
3
|
*/
|
|
4
|
-
export declare const BrowserUsePipelineSchema: import("@sinclair/typebox").TObject<{
|
|
5
|
-
yaml: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
6
|
-
path: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
7
|
-
args: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
|
|
8
|
-
dryRun: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
9
|
-
}>;
|
|
10
4
|
export declare const BrowserUseOptionsSchema: import("@sinclair/typebox").TObject<{
|
|
11
5
|
timeout: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
12
6
|
headless: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
13
7
|
}>;
|
|
14
8
|
export declare const BrowserUseSchema: import("@sinclair/typebox").TObject<{
|
|
15
|
-
mode: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"command">, import("@sinclair/typebox").TLiteral<"
|
|
9
|
+
mode: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"command">, import("@sinclair/typebox").TLiteral<"inspect">, import("@sinclair/typebox").TLiteral<"close">]>;
|
|
16
10
|
command: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
17
11
|
args: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
|
|
18
|
-
pipeline: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
19
|
-
yaml: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
20
|
-
path: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
21
|
-
args: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
|
|
22
|
-
dryRun: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
23
|
-
}>>;
|
|
24
12
|
options: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
25
13
|
timeout: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
26
14
|
headless: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
@@ -3,12 +3,6 @@ import { Type } from "@sinclair/typebox";
|
|
|
3
3
|
/**
|
|
4
4
|
* BrowserUseSchema — Typebox schema for the unified `browser_use` AgentTool.
|
|
5
5
|
*/
|
|
6
|
-
const BrowserUsePipelineSchema = Type.Object({
|
|
7
|
-
yaml: Type.Optional(Type.String({ description: "Inline YAML browser pipeline." })),
|
|
8
|
-
path: Type.Optional(Type.String({ description: "Path or http(s) URL to a .yaml pipeline file." })),
|
|
9
|
-
args: Type.Optional(Type.Record(Type.String(), Type.Unknown(), { description: "Override pipeline arg defaults." })),
|
|
10
|
-
dryRun: Type.Optional(Type.Boolean({ description: "Only parse & validate, do not execute." }))
|
|
11
|
-
});
|
|
12
6
|
const BrowserUseOptionsSchema = Type.Object({
|
|
13
7
|
timeout: Type.Optional(Type.Number({ description: "Action timeout override (ms)." })),
|
|
14
8
|
headless: Type.Optional(Type.Boolean({ description: "Override headless mode for this call." }))
|
|
@@ -16,14 +10,12 @@ const BrowserUseOptionsSchema = Type.Object({
|
|
|
16
10
|
const BrowserUseSchema = Type.Object({
|
|
17
11
|
mode: Type.Union([
|
|
18
12
|
Type.Literal("command"),
|
|
19
|
-
Type.Literal("pipeline"),
|
|
20
13
|
Type.Literal("inspect"),
|
|
21
14
|
Type.Literal("close")
|
|
22
15
|
], { description: "Execution mode." }),
|
|
23
16
|
command: Type.Optional(Type.String({ description: "Browser action name (command mode). E.g. open, click, type, screenshot." })),
|
|
24
17
|
args: Type.Optional(Type.Record(Type.String(), Type.Unknown(), { description: "Action arguments (command mode)." })),
|
|
25
|
-
pipeline: Type.Optional(BrowserUsePipelineSchema),
|
|
26
18
|
options: Type.Optional(BrowserUseOptionsSchema)
|
|
27
19
|
});
|
|
28
20
|
//#endregion
|
|
29
|
-
export { BrowserUseOptionsSchema,
|
|
21
|
+
export { BrowserUseOptionsSchema, BrowserUseSchema };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
|
+
import type { BrowserRecipeService } from '../../browser/recipes/index.js';
|
|
3
|
+
declare const BrowserRecipeToolSchema: import("@sinclair/typebox").TObject<{
|
|
4
|
+
action: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"list">, import("@sinclair/typebox").TLiteral<"get">, import("@sinclair/typebox").TLiteral<"save">, import("@sinclair/typebox").TLiteral<"enable">, import("@sinclair/typebox").TLiteral<"disable">, import("@sinclair/typebox").TLiteral<"delete">, import("@sinclair/typebox").TLiteral<"run">]>;
|
|
5
|
+
recipeId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
6
|
+
yaml: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
7
|
+
args: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function createBrowserRecipeTool(deps: {
|
|
10
|
+
getBrowserRecipeService: () => BrowserRecipeService | undefined;
|
|
11
|
+
}): AgentTool<typeof BrowserRecipeToolSchema, Record<string, unknown>>;
|
|
12
|
+
export {};
|