@nexface/tools 0.1.0 → 0.1.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/toolset.js +1 -0
- package/dist/browser/toolset.js.map +1 -1
- package/dist/definition.d.ts +1 -0
- package/dist/definition.js +13 -1
- package/dist/definition.js.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/internal-react.d.ts +1 -0
- package/dist/internal-react.js +2 -1
- package/dist/internal-react.js.map +1 -1
- package/dist/internal-types.d.ts +4 -0
- package/dist/navigation.d.ts +32 -0
- package/dist/navigation.js +40 -0
- package/dist/navigation.js.map +1 -0
- package/dist/operation-host.d.ts +17 -0
- package/dist/operation-host.js +9 -0
- package/dist/operation-host.js.map +1 -0
- package/dist/operation-surface.d.ts +7 -0
- package/dist/operation-surface.js +82 -0
- package/dist/operation-surface.js.map +1 -0
- package/dist/operation-types.d.ts +17 -0
- package/dist/operation-types.js +2 -0
- package/dist/operation-types.js.map +1 -0
- package/dist/operation-view.d.ts +14 -0
- package/dist/operation-view.js +376 -0
- package/dist/operation-view.js.map +1 -0
- package/dist/react.d.ts +42 -3
- package/dist/react.js +115 -6
- package/dist/react.js.map +1 -1
- package/dist/runtime.d.ts +47 -6
- package/dist/runtime.js +129 -20
- package/dist/runtime.js.map +1 -1
- package/dist/styles.css +189 -0
- package/dist/types.d.ts +2 -0
- package/dist/webmcp.js +11 -10
- package/dist/webmcp.js.map +1 -1
- package/package.json +23 -2
- package/src/browser/controller.ts +0 -984
- package/src/browser/dom.ts +0 -507
- package/src/browser/feedback.ts +0 -5
- package/src/browser/locator.ts +0 -383
- package/src/browser/prompt.generated.ts +0 -50
- package/src/browser/prompt.ts +0 -10
- package/src/browser/snapshot.ts +0 -542
- package/src/browser/toolset.ts +0 -522
- package/src/browser/types.ts +0 -172
- package/src/browser/worker-runner.ts +0 -468
- package/src/definition.ts +0 -115
- package/src/index.ts +0 -35
- package/src/internal-react.tsx +0 -62
- package/src/internal-types.ts +0 -12
- package/src/internal.ts +0 -36
- package/src/react.tsx +0 -397
- package/src/runtime.ts +0 -722
- package/src/schema.ts +0 -52
- package/src/types.ts +0 -123
- package/src/webmcp.ts +0 -102
- package/tsconfig.json +0 -8
package/dist/styles.css
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
.agent-operation { --agent-operation-accent: #6366f1; --agent-operation-glow: #22d3ee; position: fixed; z-index: 2147483150; inset: 0; pointer-events: none; }
|
|
2
|
+
.agent-operation__surface { position: fixed; z-index: 0; overflow: hidden; contain: paint; border: 1px solid rgba(96,156,245,.9); border-radius: 8px; background: rgba(96,156,245,.06); pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.72),0 0 8px rgba(96,156,245,.2); }
|
|
3
|
+
.agent-operation__surface::before,.agent-operation__surface::after { position: absolute; z-index: 2; inset: 0; border-radius: inherit; content: ""; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom,#000 0,rgba(0,0,0,.7) 7px,transparent 28px),linear-gradient(to left,#000 0,rgba(0,0,0,.7) 7px,transparent 28px),linear-gradient(to top,#000 0,rgba(0,0,0,.7) 7px,transparent 28px),linear-gradient(to right,#000 0,rgba(0,0,0,.7) 7px,transparent 28px); mask-image: linear-gradient(to bottom,#000 0,rgba(0,0,0,.7) 7px,transparent 28px),linear-gradient(to left,#000 0,rgba(0,0,0,.7) 7px,transparent 28px),linear-gradient(to top,#000 0,rgba(0,0,0,.7) 7px,transparent 28px),linear-gradient(to right,#000 0,rgba(0,0,0,.7) 7px,transparent 28px); }
|
|
4
|
+
.agent-operation__surface::before { --agent-operation-edge-primary-angle: 0deg; background: conic-gradient(from var(--agent-operation-edge-primary-angle) at 50% 50%,transparent 0% 8%,rgba(139,92,246,.24) 11%,rgba(139,92,246,.76) 17%,rgba(34,211,238,.9) 23%,#3b82f6 26%,rgba(191,219,254,.92) 27.5%,transparent 31% 56%,rgba(139,92,246,.3) 61%,rgba(34,211,238,.46) 66%,transparent 72% 100%); filter: blur(32px); opacity: .68; animation: agent-operation-surface-edge-primary 6s linear infinite; }
|
|
5
|
+
.agent-operation__surface::after { --agent-operation-edge-secondary-angle: 0deg; z-index: 3; background: conic-gradient(from var(--agent-operation-edge-secondary-angle) at 50% 50%,transparent 0% 18%,rgba(139,92,246,.5) 23%,rgba(34,211,238,.58) 30%,rgba(59,130,246,.88) 35%,transparent 41% 75%,rgba(34,211,238,.28) 80%,rgba(167,139,250,.46) 86%,transparent 91% 100%); filter: blur(44px); opacity: .52; mix-blend-mode: screen; animation: agent-operation-surface-edge-secondary 8s linear infinite; }
|
|
6
|
+
.agent-operation__surface[style*="--agent-operation-cutout"] { -webkit-mask-image: linear-gradient(#000 0 0),linear-gradient(#000 0 0); -webkit-mask-position: 0 0,var(--agent-operation-cutout-left) var(--agent-operation-cutout-top); -webkit-mask-repeat: no-repeat; -webkit-mask-size: 100% 100%,var(--agent-operation-cutout-width) var(--agent-operation-cutout-height); -webkit-mask-composite: xor; mask-image: linear-gradient(#000 0 0),linear-gradient(#000 0 0); mask-position: 0 0,var(--agent-operation-cutout-left) var(--agent-operation-cutout-top); mask-repeat: no-repeat; mask-size: 100% 100%,var(--agent-operation-cutout-width) var(--agent-operation-cutout-height); mask-composite: exclude; }
|
|
7
|
+
.agent-operation__target { position: fixed; z-index: 1; overflow: hidden; border: 2px solid #4f7cff; border-radius: 10px; background: transparent; pointer-events: none; box-shadow: 0 0 0 4px rgba(99,102,241,.16),0 0 22px rgba(34,211,238,.34),0 0 48px rgba(79,70,229,.2); transition: inset .12s ease,width .12s ease,height .12s ease; animation: agent-operation-pulse 2.6s ease-in-out infinite; }
|
|
8
|
+
.agent-operation__pointer-effect { position: fixed; z-index: 2; top: 0; left: 0; width: 0; height: 0; opacity: 1; pointer-events: none; transform: translate3d(var(--agent-operation-pointer-x),var(--agent-operation-pointer-y),0); transition: transform var(--agent-operation-pointer-duration) cubic-bezier(.22,1,.36,1),opacity .12s ease-out; will-change: transform,opacity; }
|
|
9
|
+
.agent-operation__pointer-effect[data-phase="hidden"] { opacity: 0; }
|
|
10
|
+
.agent-operation__pointer-cursor { position: absolute; z-index: 1; top: -4px; left: -3px; display: block; width: 24px; height: 24px; transform-origin: 4px 4px; }
|
|
11
|
+
.agent-operation__pointer-effect[data-active="true"][data-phase="resting"] .agent-operation__pointer-cursor { animation: agent-operation-pointer-float 1.6s ease-in-out infinite; }
|
|
12
|
+
.agent-operation__pointer-effect[data-phase="arrived"] .agent-operation__pointer-cursor { animation: agent-operation-pointer-press .11s ease-out both; }
|
|
13
|
+
.agent-operation__pointer-ripple { position: absolute; top: 0; left: 0; width: 64px; height: 64px; border: 2px solid rgba(79,124,255,.78); border-radius: 50%; opacity: 0; transform: translate(-50%,-50%) scale(.35); box-shadow: 0 0 18px rgba(96,156,245,.34); }
|
|
14
|
+
.agent-operation__pointer-ripple--primary { animation: agent-operation-pointer-ripple var(--agent-operation-ripple-duration) ease-out both; }
|
|
15
|
+
.agent-operation__pointer { position: relative; z-index: 2; display: block; color: #111827; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 1px 2px rgba(15,23,42,.32)); }
|
|
16
|
+
.agent-operation__pointer-label { position: absolute; z-index: 2; top: 27px; left: 19px; display: flex; max-width: min(300px,48vw); overflow: hidden; align-items: center; gap: 9px; border: 1px solid rgba(24,24,27,.1); border-radius: 11px; padding: 7px 11px; color: #27272a; background: rgba(255,255,255,.97); box-shadow: 0 6px 20px rgba(15,23,42,.13); font: 500 13px/1.35 Inter,ui-sans-serif,system-ui,sans-serif; white-space: nowrap; }
|
|
17
|
+
.agent-operation__pointer-label:is([data-operation-effect="read"],[data-operation-effect="navigate"]) { top: 12px; left: 10px; overflow: visible; gap: 5px; border: 0; padding: 0; background: transparent; box-shadow: none; }
|
|
18
|
+
.agent-operation__pointer-label-text { overflow: hidden; text-overflow: ellipsis; }
|
|
19
|
+
.agent-operation__pointer-label:is([data-operation-effect="read"],[data-operation-effect="navigate"]) .agent-operation__pointer-label-text { display: flex; box-sizing: border-box; height: 32px; align-items: center; border: 1px solid rgba(24,24,27,.08); border-radius: 12px; padding: 6px 12px; background: rgba(255,255,255,.97); box-shadow: 0 6px 20px rgba(15,23,42,.13); }
|
|
20
|
+
.agent-operation__pointer-read-scan { display: flex; width: 36px; height: 32px; flex: none; align-items: center; justify-content: center; gap: 4px; pointer-events: none; }
|
|
21
|
+
.agent-operation__pointer-read-scan i { width: 3px; height: 11px; border-radius: 999px; background: #609cf5; opacity: .34; transform: scaleY(.58); transform-origin: center; animation: agent-operation-pointer-read-bar 1.05s ease-in-out infinite; }
|
|
22
|
+
.agent-operation__pointer-read-scan i:nth-child(2) { animation-delay: .1s; }
|
|
23
|
+
.agent-operation__pointer-read-scan i:nth-child(3) { animation-delay: .2s; }
|
|
24
|
+
.agent-operation__pointer-read-scan i:nth-child(4) { animation-delay: .3s; }
|
|
25
|
+
.agent-operation__pointer-read-scan i:nth-child(5) { animation-delay: .4s; }
|
|
26
|
+
.agent-operation__pointer-navigation-trail { position: relative; width: 36px; height: 32px; flex: none; filter: drop-shadow(0 1px 3px rgba(96,156,245,.32)); pointer-events: none; }
|
|
27
|
+
.agent-operation__pointer-navigation-trail::before,.agent-operation__pointer-navigation-trail::after { position: absolute; top: 9px; width: 10px; height: 10px; border-top: 2px solid #609cf5; border-right: 2px solid #609cf5; border-radius: 2px; content: ""; transform: rotate(45deg); animation: agent-operation-pointer-navigation-chevron .9s ease-in-out infinite; }
|
|
28
|
+
.agent-operation__pointer-navigation-trail::before { left: 1px; opacity: .3; }
|
|
29
|
+
.agent-operation__pointer-navigation-trail::after { left: 11px; animation-delay: .15s; }
|
|
30
|
+
.agent-operation__controller { --agent-operation-controller-x: -50%; position: fixed; z-index: 3; left: 50%; bottom: 22px; display: flex; width: 760px; min-width: min(760px,calc(100vw - 32px)); max-width: calc(100vw - 32px); align-items: center; gap: 10px; border: 1px solid rgba(165,180,252,.28); border-radius: 15px; padding: 9px 10px 9px 12px; color: #fff; background: linear-gradient(135deg,#3a3a40 0%,#303036 48%,#29292e 100%); box-shadow: inset 0 0 0 1px rgba(103,232,249,.06),0 16px 38px rgba(0,0,0,.28); pointer-events: auto; transform: translate(var(--agent-operation-controller-x),0); font-family: Inter,ui-sans-serif,system-ui,sans-serif; animation: agent-operation-controller-enter .4s cubic-bezier(.22,1,.36,1) both,agent-operation-edge-breathe 2.8s ease-in-out .4s infinite; will-change: transform,opacity; }
|
|
31
|
+
.agent-operation__controller[data-visibility="exiting"] { pointer-events: none; animation: agent-operation-controller-exit .3s cubic-bezier(.4,0,1,1) both; }
|
|
32
|
+
.agent-operation__controller::after { position: absolute; z-index: 0; inset: 1px; border-radius: 13px; background: linear-gradient(110deg,rgba(255,255,255,.13),transparent 30%,transparent 68%,rgba(129,140,248,.15)); content: ""; pointer-events: none; }
|
|
33
|
+
.agent-operation__controller>:not(.agent-operation__edge-flow) { position: relative; z-index: 2; }
|
|
34
|
+
.agent-operation__edge-flow { position: absolute; z-index: 1; inset: -1px; overflow: hidden; border-radius: inherit; pointer-events: none; }
|
|
35
|
+
.agent-operation__edge-flow::before,.agent-operation__edge-flow::after { position: absolute; height: 2px; content: ""; }
|
|
36
|
+
.agent-operation__edge-flow::before { top: 0; left: -34%; width: 34%; background: linear-gradient(90deg,transparent,rgba(165,180,252,.72),#e0f2fe,rgba(34,211,238,.9),transparent); animation: agent-operation-edge-flow 2.65s ease-in-out infinite; }
|
|
37
|
+
.agent-operation__edge-flow::after { right: -12%; bottom: 0; width: 28%; background: linear-gradient(90deg,transparent,rgba(129,140,248,.78),rgba(103,232,249,.68),transparent); animation: agent-operation-edge-flow-reverse 3.1s ease-in-out infinite; }
|
|
38
|
+
.agent-operation__pause-mark { display: flex; width: 9px; flex: 0 0 9px; justify-content: center; gap: 2px; opacity: .52; }
|
|
39
|
+
.agent-operation__pause-mark i { width: 2px; height: 9px; border-radius: 2px; background: #d4d4d8; }
|
|
40
|
+
.agent-operation__activity { position: relative; display: grid; width: 26px; height: 26px; flex: 0 0 26px; place-items: center; }
|
|
41
|
+
.agent-operation__activity-icon { display: none; }
|
|
42
|
+
.agent-operation__activity i { position: absolute; inset: 3px; border: 1px solid rgba(255,255,255,.14); border-top-color: #c7d2fe; border-radius: 50%; animation: agent-operation-spin 1.8s linear infinite; }
|
|
43
|
+
.agent-operation__activity b { color: #eef2ff; font-size: 17px; font-weight: 400; line-height: 1; }
|
|
44
|
+
.agent-operation__controller>div { display: grid; min-width: 0; flex: 1; gap: 1px; }
|
|
45
|
+
.agent-operation__heading { display: flex; min-width: 0; align-items: center; gap: 7px; }
|
|
46
|
+
.agent-operation__controller strong { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
|
|
47
|
+
.agent-operation__controller code { overflow: hidden; padding: 1px 5px; border-radius: 5px; color: #a1a1aa; background: rgba(255,255,255,.07); font: 500 8px/1.45 ui-monospace,SFMono-Regular,Menlo,monospace; text-overflow: ellipsis; white-space: nowrap; }
|
|
48
|
+
.agent-operation__description { display: flex; min-width: 0; overflow: hidden; align-items: center; color: #e4e4e7; font-size: 10px; white-space: nowrap; }
|
|
49
|
+
.agent-operation__compact-status { display: none; }
|
|
50
|
+
.agent-operation__controller button { border: 0; border-radius: 9px; padding: 7px 10px; color: #e4e4e7; background: #3f3f46; font-size: 10px; font-weight: 650; }
|
|
51
|
+
.agent-operation__controller .agent-operation__activity { border: 0; padding: 0; cursor: pointer; }
|
|
52
|
+
.agent-operation__controller .agent-operation__activity:disabled { cursor: default; opacity: .55; }
|
|
53
|
+
.agent-operation__controller>.agent-operation__history { position: absolute; z-index: 4; bottom: calc(100% + 10px); left: 0; display: grid; width: 360px; max-width: 100%; max-height: min(320px,50vh); overflow: hidden; border: 1px solid rgba(165,180,252,.28); border-radius: 14px; color: #f4f4f5; background: #303036; box-shadow: 0 16px 38px rgba(0,0,0,.28); pointer-events: auto; }
|
|
54
|
+
.agent-operation__history header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.08); padding: 11px 13px; }
|
|
55
|
+
.agent-operation__history header span { display: grid; min-width: 20px; height: 20px; place-items: center; border-radius: 10px; color: #c7d2fe; background: rgba(129,140,248,.16); font-size: 10px; }
|
|
56
|
+
.agent-operation__history ol { display: grid; overflow: auto; margin: 0; padding: 5px 0; list-style: none; }
|
|
57
|
+
.agent-operation__history li { display: grid; grid-template-columns: 22px minmax(0,1fr); align-items: start; gap: 8px; padding: 8px 13px; }
|
|
58
|
+
.agent-operation__history li>span { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: #c7d2fe; background: rgba(129,140,248,.12); font-size: 9px; }
|
|
59
|
+
.agent-operation__history p { margin: 1px 0 0; overflow-wrap: anywhere; color: #e4e4e7; font-size: 11px; line-height: 18px; }
|
|
60
|
+
.agent-operation__controller .agent-operation__stop { color: #fecaca; background: #7f1d1d; }
|
|
61
|
+
.agent-operation[data-status="completed"] .agent-operation__target { border-color: #609cf5; }
|
|
62
|
+
.agent-operation[data-status="failed"] .agent-operation__target { border-color: #dc2626; animation: none; }
|
|
63
|
+
.agent-operation[data-run-active="false"] .agent-operation__activity i,.agent-operation[data-run-active="false"] .agent-operation__edge-flow::before,.agent-operation[data-run-active="false"] .agent-operation__edge-flow::after,.agent-operation[data-run-active="false"] .agent-operation__surface::before,.agent-operation[data-run-active="false"] .agent-operation__surface::after { animation: none; }
|
|
64
|
+
@keyframes agent-operation-spin { to { transform: rotate(360deg); } }
|
|
65
|
+
@keyframes agent-operation-edge-flow { 0% { left: -24%; opacity: 0; } 12%,78% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
|
|
66
|
+
@keyframes agent-operation-edge-flow-reverse { 0% { right: -20%; opacity: 0; } 18%,76% { opacity: .8; } 100% { right: 100%; opacity: 0; } }
|
|
67
|
+
@keyframes agent-operation-edge-breathe { 50% { border-color: rgba(103,232,249,.42); } }
|
|
68
|
+
@keyframes agent-operation-pulse { 50% { border-color: #38bdf8; box-shadow: 0 0 0 6px rgba(99,102,241,.12),0 0 28px rgba(34,211,238,.4),0 0 58px rgba(79,70,229,.24); } }
|
|
69
|
+
@keyframes agent-operation-pointer-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
|
|
70
|
+
@keyframes agent-operation-pointer-press { 0%,100% { transform: translate(0) scale(1); } 48% { transform: translate(1px,1px) scale(.94); } }
|
|
71
|
+
@property --agent-operation-edge-primary-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
|
|
72
|
+
@property --agent-operation-edge-secondary-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
|
|
73
|
+
@keyframes agent-operation-surface-edge-primary { 0% { --agent-operation-edge-primary-angle: 0deg; animation-timing-function: cubic-bezier(.4,.25,.6,.75); } 100% { --agent-operation-edge-primary-angle: 360deg; } }
|
|
74
|
+
@keyframes agent-operation-surface-edge-secondary { 0% { --agent-operation-edge-secondary-angle: 0deg; animation-timing-function: cubic-bezier(.4,.3,.6,.7); } 100% { --agent-operation-edge-secondary-angle: 360deg; } }
|
|
75
|
+
@keyframes agent-operation-controller-enter { 0% { opacity: 0; transform: translate(var(--agent-operation-controller-x),calc(100% + 28px)); } 100% { opacity: 1; transform: translate(var(--agent-operation-controller-x),0); } }
|
|
76
|
+
@keyframes agent-operation-controller-exit { 0% { opacity: 1; transform: translate(var(--agent-operation-controller-x),0); } 100% { opacity: 0; transform: translate(var(--agent-operation-controller-x),calc(100% + 28px)); } }
|
|
77
|
+
@keyframes agent-operation-pointer-ripple { 0% { opacity: .82; transform: translate(-50%,-50%) scale(.35); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.45); } }
|
|
78
|
+
@keyframes agent-operation-pointer-read-bar { 0%,18%,100% { opacity: .34; transform: scaleY(.58); box-shadow: none; } 42% { opacity: 1; transform: scaleY(1.27); box-shadow: 0 0 6px rgba(96,156,245,.52); } 68% { opacity: .58; transform: scaleY(.78); box-shadow: none; } }
|
|
79
|
+
@keyframes agent-operation-pointer-navigation-chevron { 0%,100% { opacity: .24; transform: translateX(-3px) rotate(45deg); } 48% { opacity: 1; transform: translateX(2px) rotate(45deg); } 72% { opacity: .62; transform: translateX(4px) rotate(45deg); } }
|
|
80
|
+
@media (prefers-reduced-motion: reduce) { .agent-operation__surface,.agent-operation__target,.agent-operation__controller,.agent-operation__activity i,.agent-operation__edge-flow::before,.agent-operation__edge-flow::after,.agent-operation__pointer-cursor,.agent-operation__pointer-read-scan i,.agent-operation__pointer-navigation-trail::before,.agent-operation__pointer-navigation-trail::after { animation: none; } .agent-operation__pointer-effect { transition: none; } .agent-operation__pointer-ripple,.agent-operation__surface::before,.agent-operation__surface::after { display: none; } }
|
|
81
|
+
@media (max-width:520px) { .agent-operation__controller { --agent-operation-controller-x: 0%; right: 12px; bottom: 12px; left: 12px; width: auto; min-width: 0; } .agent-operation__controller>.agent-operation__history { width: 100%; } }
|
|
82
|
+
|
|
83
|
+
.nexface-operation-surface { width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: auto; }
|
|
84
|
+
.agent-operation .agent-operation__controller { box-sizing: border-box; min-width: 0; }
|
|
85
|
+
.agent-operation__controller {
|
|
86
|
+
top: auto;
|
|
87
|
+
bottom: 14px;
|
|
88
|
+
width: 440px;
|
|
89
|
+
height: 48px;
|
|
90
|
+
min-width: 0;
|
|
91
|
+
justify-content: flex-start;
|
|
92
|
+
gap: 8px;
|
|
93
|
+
border: 0;
|
|
94
|
+
border-radius: 24px;
|
|
95
|
+
padding: 5px;
|
|
96
|
+
color: #fff;
|
|
97
|
+
background: transparent;
|
|
98
|
+
box-shadow: none;
|
|
99
|
+
backdrop-filter: blur(16px) saturate(120%);
|
|
100
|
+
-webkit-backdrop-filter: blur(16px) saturate(120%);
|
|
101
|
+
pointer-events: none;
|
|
102
|
+
}
|
|
103
|
+
.agent-operation__controller::after {
|
|
104
|
+
inset: 0;
|
|
105
|
+
width: auto;
|
|
106
|
+
border: 1px solid rgb(255 255 255 / 12%);
|
|
107
|
+
border-radius: 24px;
|
|
108
|
+
background: rgb(18 18 20 / 88%);
|
|
109
|
+
box-shadow: 0 8px 28px rgb(0 0 0 / 24%);
|
|
110
|
+
}
|
|
111
|
+
.agent-operation__controller .agent-operation__edge-flow,
|
|
112
|
+
.agent-operation__controller .agent-operation__pause-mark,
|
|
113
|
+
.agent-operation__controller .agent-operation__compact-status { display: none; }
|
|
114
|
+
.agent-operation__controller .agent-operation__activity {
|
|
115
|
+
width: 38px;
|
|
116
|
+
height: 38px;
|
|
117
|
+
flex: 0 0 38px;
|
|
118
|
+
border: 1px solid rgb(255 255 255 / 11%);
|
|
119
|
+
border-radius: 50%;
|
|
120
|
+
padding: 0;
|
|
121
|
+
color: #a9c9ff;
|
|
122
|
+
background: rgb(255 255 255 / 7%);
|
|
123
|
+
pointer-events: auto;
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
}
|
|
126
|
+
.agent-operation__controller .agent-operation__activity:not(:disabled):hover,
|
|
127
|
+
.agent-operation__controller .agent-operation__activity[data-open="true"] { border-color: rgb(169 201 255 / 38%); background: rgb(169 201 255 / 14%); }
|
|
128
|
+
.agent-operation__controller .agent-operation__activity:disabled { cursor: default; opacity: .82; }
|
|
129
|
+
.agent-operation__controller .agent-operation__activity i { display: none; }
|
|
130
|
+
.agent-operation__controller .agent-operation__activity-icon { display: block; }
|
|
131
|
+
.agent-operation__controller .agent-operation__activity b { display: none; }
|
|
132
|
+
.agent-operation__controller > div { display: grid; min-width: 0; flex: 1; gap: 1px; }
|
|
133
|
+
.agent-operation__controller .agent-operation__heading { display: block; min-width: 0; }
|
|
134
|
+
.agent-operation__controller .agent-operation__heading strong { display: block; overflow: hidden; color: rgb(255 255 255 / 96%); font-size: 12px; font-weight: 500; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
|
|
135
|
+
.agent-operation__controller .agent-operation__description { display: block; overflow: hidden; color: rgb(255 255 255 / 58%); font-size: 10px; line-height: 13px; text-overflow: ellipsis; white-space: nowrap; }
|
|
136
|
+
.agent-operation[data-human-control="true"] .agent-operation__controller .agent-operation__description { color: #9fc3ff; }
|
|
137
|
+
.agent-operation__controller .agent-operation__stop {
|
|
138
|
+
min-width: 84px;
|
|
139
|
+
height: 38px;
|
|
140
|
+
border-radius: 19px;
|
|
141
|
+
padding: 0 12px;
|
|
142
|
+
color: #ff7187;
|
|
143
|
+
background: rgb(255 72 101 / 15%);
|
|
144
|
+
box-shadow: inset 0 0 0 1px rgb(255 113 135 / 8%);
|
|
145
|
+
pointer-events: auto;
|
|
146
|
+
font-size: 11px;
|
|
147
|
+
font-weight: 500;
|
|
148
|
+
}
|
|
149
|
+
.agent-operation__controller > .agent-operation__history {
|
|
150
|
+
width: 360px;
|
|
151
|
+
border: 1px solid rgb(255 255 255 / 12%);
|
|
152
|
+
border-radius: 14px;
|
|
153
|
+
color: #fff;
|
|
154
|
+
background: rgb(18 18 20 / 92%);
|
|
155
|
+
box-shadow: 0 12px 36px rgb(0 0 0 / 28%);
|
|
156
|
+
backdrop-filter: blur(16px) saturate(120%);
|
|
157
|
+
-webkit-backdrop-filter: blur(16px) saturate(120%);
|
|
158
|
+
}
|
|
159
|
+
.agent-operation__history header { border-bottom-color: rgb(255 255 255 / 9%); padding: 12px 14px; }
|
|
160
|
+
.agent-operation__history header strong { color: rgb(255 255 255 / 96%); font-size: 12px; font-weight: 600; }
|
|
161
|
+
.agent-operation__history header span { color: #a9c9ff; background: rgb(169 201 255 / 14%); }
|
|
162
|
+
.agent-operation__history li { padding: 8px 14px; }
|
|
163
|
+
.agent-operation__history li > span { color: #a9c9ff; background: rgb(169 201 255 / 11%); }
|
|
164
|
+
.agent-operation__history p { color: rgb(255 255 255 / 76%); font-size: 12px; line-height: 20px; }
|
|
165
|
+
.agent-operation[data-interaction-pending="true"] .agent-operation__controller { box-shadow: none; }
|
|
166
|
+
.agent-operation[data-interaction-pending="true"] .agent-operation__activity b { color: #609cf5; text-shadow: none; }
|
|
167
|
+
.agent-operation__target { border: 1px solid #4f9cff; border-radius: 10px; box-shadow: 0 0 0 1px rgb(79 156 255 / 14%); animation: store-operation-target-in .16s ease-out both; }
|
|
168
|
+
.agent-operation__pointer-label { border-color: #ebecf0; color: #525252; box-shadow: 0 4px 16px rgb(29 41 57 / 12%); }
|
|
169
|
+
.agent-operation__surface {
|
|
170
|
+
border: 1px solid rgb(96 156 245 / 90%);
|
|
171
|
+
border-radius: 12px;
|
|
172
|
+
background: rgb(96 156 245 / 6%);
|
|
173
|
+
box-shadow: inset 0 0 0 1px rgb(255 255 255 / 72%), 0 0 8px rgb(96 156 245 / 20%);
|
|
174
|
+
animation: store-operation-mask-in .18s ease-out both;
|
|
175
|
+
}
|
|
176
|
+
.agent-operation__surface[style*="--agent-operation-cutout"] {
|
|
177
|
+
-webkit-mask-image: none;
|
|
178
|
+
mask-image: none;
|
|
179
|
+
}
|
|
180
|
+
.agent-operation__pointer-ripple { border-color: rgb(61 146 255 / 86%); background-image: none; }
|
|
181
|
+
@keyframes store-operation-mask-in { from { opacity: 0; } to { opacity: 1; } }
|
|
182
|
+
@keyframes store-operation-target-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: scale(1); } }
|
|
183
|
+
@media (prefers-reduced-motion: reduce) {
|
|
184
|
+
.agent-operation__surface,
|
|
185
|
+
.agent-operation__target { animation: none; }
|
|
186
|
+
}
|
|
187
|
+
.agent-operation, .agent-operation *, .agent-operation::before, .agent-operation::after, .agent-operation *::before, .agent-operation *::after { box-sizing: border-box; }
|
|
188
|
+
.agent-operation__pointer-navigation-trail::before,.agent-operation__pointer-navigation-trail::after { box-sizing: content-box; }
|
|
189
|
+
.agent-operation__pointer-indicator { position: absolute; top: 12px; left: 10px; display: flex; align-items: center; gap: 5px; }
|
package/dist/types.d.ts
CHANGED
|
@@ -65,7 +65,9 @@ export interface AgentToolMetadata {
|
|
|
65
65
|
name: string;
|
|
66
66
|
description: string;
|
|
67
67
|
inputSchema: AgentToolInputSchema;
|
|
68
|
+
effect: AgentToolEffect;
|
|
68
69
|
}
|
|
70
|
+
export type AgentToolEffect = "read" | "action" | "navigate";
|
|
69
71
|
export interface AgentToolDefinition<TInput = Record<string, unknown>, TResult = unknown> extends AgentToolMetadata {
|
|
70
72
|
readonly __input?: TInput;
|
|
71
73
|
readonly __result?: TResult;
|
package/dist/webmcp.js
CHANGED
|
@@ -15,9 +15,10 @@ export function connectToolRuntimeToWebMcp(runtime) {
|
|
|
15
15
|
return () => undefined;
|
|
16
16
|
const registrations = new Map();
|
|
17
17
|
let disposed = false;
|
|
18
|
-
const register = (
|
|
18
|
+
const register = (tool) => {
|
|
19
|
+
const { definition } = tool;
|
|
19
20
|
const controller = new AbortController();
|
|
20
|
-
const registration = { controller,
|
|
21
|
+
const registration = { controller, tool };
|
|
21
22
|
registrations.set(definition.name, registration);
|
|
22
23
|
let result;
|
|
23
24
|
try {
|
|
@@ -25,7 +26,7 @@ export function connectToolRuntimeToWebMcp(runtime) {
|
|
|
25
26
|
name: definition.name,
|
|
26
27
|
description: definition.description,
|
|
27
28
|
inputSchema: definition.inputSchema,
|
|
28
|
-
execute: async (input) => runtime.execute(
|
|
29
|
+
execute: async (input) => runtime.execute(tool, input),
|
|
29
30
|
}, { signal: controller.signal });
|
|
30
31
|
}
|
|
31
32
|
catch (error) {
|
|
@@ -43,26 +44,26 @@ export function connectToolRuntimeToWebMcp(runtime) {
|
|
|
43
44
|
});
|
|
44
45
|
};
|
|
45
46
|
const reconcile = () => {
|
|
46
|
-
const
|
|
47
|
+
const tools = new Map(runtime.getWebMcpTools().map((tool) => [tool.definition.name, tool]));
|
|
47
48
|
for (const [name, registration] of registrations) {
|
|
48
|
-
if (
|
|
49
|
+
if (tools.get(name) === registration.tool)
|
|
49
50
|
continue;
|
|
50
51
|
registration.controller.abort();
|
|
51
52
|
registrations.delete(name);
|
|
52
53
|
}
|
|
53
|
-
for (const
|
|
54
|
-
if (!registrations.has(definition.name))
|
|
55
|
-
register(
|
|
54
|
+
for (const tool of tools.values()) {
|
|
55
|
+
if (!registrations.has(tool.definition.name))
|
|
56
|
+
register(tool);
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
|
-
runtime.
|
|
59
|
+
const unsubscribeRuntime = runtime.on("toolchange", reconcile);
|
|
59
60
|
modelContext.addEventListener?.("toolchange", reconcile);
|
|
60
61
|
reconcile();
|
|
61
62
|
return () => {
|
|
62
63
|
if (disposed)
|
|
63
64
|
return;
|
|
64
65
|
disposed = true;
|
|
65
|
-
|
|
66
|
+
unsubscribeRuntime();
|
|
66
67
|
modelContext.removeEventListener?.("toolchange", reconcile);
|
|
67
68
|
for (const registration of registrations.values()) {
|
|
68
69
|
registration.controller.abort();
|
package/dist/webmcp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webmcp.js","sourceRoot":"","sources":["../src/webmcp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webmcp.js","sourceRoot":"","sources":["../src/webmcp.ts"],"names":[],"mappings":"AAuBA,SAAS,qBAAqB;IAC5B,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAO,SAAS,CAAC;IACtD,MAAM,YAAY,GAAI,QAEpB,CAAC,YAAY,CAAC;IAChB,OAAO,OAAO,YAAY,EAAE,YAAY,KAAK,UAAU;QACrD,CAAC,CAAC,YAAkC;QACpC,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,SAAS,sBAAsB,CAAC,IAAY,EAAE,KAAc;IAC1D,OAAO,CAAC,IAAI,CAAC,mCAAmC,IAAI,IAAI,EAAE,KAAK,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,OAA4B;IAE5B,MAAM,YAAY,GAAG,qBAAqB,EAAE,CAAC;IAC7C,IAAI,CAAC,YAAY;QAAE,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC;IAE1C,MAAM,aAAa,GAAG,IAAI,GAAG,EAA8B,CAAC;IAC5D,IAAI,QAAQ,GAAG,KAAK,CAAC;IAErB,MAAM,QAAQ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AAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexface/tools",
|
|
3
|
-
"version": "0.1.0",
|
|
3
|
+
"version": "0.1.1-alpha.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"default": "./dist/index.js"
|
|
9
9
|
},
|
|
10
|
+
"./styles.css": "./dist/styles.css",
|
|
10
11
|
"./internal": {
|
|
11
12
|
"types": "./dist/internal.d.ts",
|
|
12
13
|
"default": "./dist/internal.js"
|
|
@@ -17,10 +18,30 @@
|
|
|
17
18
|
}
|
|
18
19
|
},
|
|
19
20
|
"scripts": {
|
|
20
|
-
"build": "node ../../scripts/generate-browser-tools-skill.mjs --check && tsc -p tsconfig.json",
|
|
21
|
+
"build": "node ../../scripts/generate-browser-tools-skill.mjs --check && tsc -p tsconfig.json && cp src/styles.css dist/styles.css",
|
|
21
22
|
"typecheck": "node ../../scripts/generate-browser-tools-skill.mjs --check && tsc -p tsconfig.json --noEmit"
|
|
22
23
|
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@phosphor-icons/react": "^2.1.10"
|
|
26
|
+
},
|
|
23
27
|
"peerDependencies": {
|
|
28
|
+
"react-dom": ">=18",
|
|
24
29
|
"react": ">=18"
|
|
30
|
+
},
|
|
31
|
+
"peerDependenciesMeta": {
|
|
32
|
+
"react-dom": {
|
|
33
|
+
"optional": true
|
|
34
|
+
},
|
|
35
|
+
"react": {
|
|
36
|
+
"optional": true
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist"
|
|
41
|
+
],
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"registry": "https://registry.npmjs.org",
|
|
44
|
+
"tag": "alpha",
|
|
45
|
+
"access": "public"
|
|
25
46
|
}
|
|
26
47
|
}
|