@agent-native/pinpoint 0.1.1 → 0.1.5

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 CHANGED
@@ -234,6 +234,7 @@ All options can be passed as props to `<Pinpoint />` or as the config object to
234
234
  | `outputFormat` | `'compact' \| 'standard' \| 'detailed'` | `'standard'` | Detail level in agent output |
235
235
  | `autoSubmit` | `boolean` | `true` | Auto-submit annotations to agent chat |
236
236
  | `clearOnSend` | `boolean` | `false` | Clear pins after sending |
237
+ | `sendToAgent` | `(output) => void \| Promise<void>` | — | Custom bridge for annotation delivery |
237
238
  | `blockInteractions` | `boolean` | `false` | Block page clicks during selection |
238
239
  | `compactPopup` | `boolean` | `true` | Hide technical details behind toggle |
239
240
  | `freezeJSTimers` | `boolean` | `false` | Freeze JS timers during selection |
@@ -395,6 +396,9 @@ Inside [Builder.io's Fusion](https://builder.io), annotations are sent via `send
395
396
 
396
397
  No additional configuration needed when running inside a Builder.io project.
397
398
 
399
+ Hosts with their own chat implementation can pass `sendToAgent` to reuse Pinpoint's pin,
400
+ draw, queue, and prompt UI while delivering `{ message, context, submit }` themselves.
401
+
398
402
  ## Architecture
399
403
 
400
404
  - **SolidJS overlay** in **Shadow DOM** — zero interference with host app styles or React reconciliation
@@ -3,11 +3,11 @@ import {
3
3
  formatPinsForAgent,
4
4
  formatQueueForAgent,
5
5
  formatRichPinContext
6
- } from "./chunk-EPXBFDY6.js";
6
+ } from "./chunk-C5OZ7ZT5.js";
7
7
  import "./chunk-BB7X7W3H.js";
8
8
  export {
9
9
  formatPinsForAgent,
10
10
  formatQueueForAgent,
11
11
  formatRichPinContext
12
12
  };
13
- //# sourceMappingURL=agent-context-76ZW6ODH.js.map
13
+ //# sourceMappingURL=agent-context-OICFLRJ7.js.map
@@ -85,4 +85,4 @@ export {
85
85
  formatPinsForAgent,
86
86
  formatQueueForAgent
87
87
  };
88
- //# sourceMappingURL=chunk-EPXBFDY6.js.map
88
+ //# sourceMappingURL=chunk-C5OZ7ZT5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/output/agent-context.ts"],"sourcesContent":["// @agent-native/pinpoint — Split output for sendToAgentChat()\n// MIT License\n//\n// Splits annotation output into { message, context } for the agent chat bridge.\n// The message is shown in chat UI. The context is hidden, appended for the agent.\n\nimport type {\n AgentOutput,\n Pin,\n OutputFormat,\n QueuedAnnotation,\n} from \"../types/index.js\";\nimport { formatPins } from \"./formatter.js\";\n\nexport type { AgentOutput } from \"../types/index.js\";\n\n/**\n * Format a single pin into rich context for the agent.\n *\n * ```\n * [Annotation on <button class=\"primary\"> in <Header> component]\n * Comment: \"This button should be blue instead of gray\"\n * Element: button.primary at (120, 45)\n * Source: src/components/Header.tsx:42\n * ```\n */\nexport function formatRichPinContext(pin: Pin): string {\n const lines: string[] = [];\n\n // Build element descriptor\n const tagName = pin.element.tagName.toLowerCase();\n const classes =\n pin.element.classNames.length > 0\n ? ` class=\"${pin.element.classNames.join(\" \")}\"`\n : \"\";\n const component = pin.framework?.componentPath\n ? ` in ${pin.framework.componentPath} component`\n : \"\";\n\n lines.push(`[Annotation on <${tagName}${classes}>${component}]`);\n lines.push(`Comment: \"${pin.comment}\"`);\n\n const rect = pin.element.boundingRect;\n const classStr =\n pin.element.classNames.length > 0\n ? `.${pin.element.classNames.join(\".\")}`\n : \"\";\n lines.push(\n `Element: ${tagName}${classStr} at (${Math.round(rect.x)}, ${Math.round(rect.y)})`,\n );\n\n if (pin.framework?.sourceFile) {\n lines.push(`Source: ${pin.framework.sourceFile}`);\n }\n\n if (pin.element.textContent) {\n const truncated = pin.element.textContent.slice(0, 80);\n lines.push(\n `Text: \"${truncated}${pin.element.textContent.length > 80 ? \"...\" : \"\"}\"`,\n );\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Format pins for agent chat.\n * The full formatted output goes into message (visible in chat UI) so the user\n * can see exactly what context the agent is working with.\n */\nexport function formatPinsForAgent(\n pins: Pin[],\n format: OutputFormat = \"standard\",\n): AgentOutput {\n if (pins.length === 0) {\n return { message: \"No annotations to send.\", context: \"\" };\n }\n\n // Use rich context format for each pin\n const richAnnotations = pins\n .map((pin) => formatRichPinContext(pin))\n .join(\"\\n\\n\");\n\n const instruction = `The user has annotated ${pins.length} element${pins.length === 1 ? \"\" : \"s\"} on the page with visual feedback. Review each annotation and make the requested changes.\\n\\n`;\n\n // Also include the structured format as context for the agent\n const details = formatPins(pins, format);\n const message = instruction + richAnnotations;\n\n return { message, context: details };\n}\n\n/**\n * Format queued annotations for batch sending.\n */\nexport function formatQueueForAgent(\n queue: QueuedAnnotation[],\n format: OutputFormat = \"standard\",\n): AgentOutput {\n if (queue.length === 0) {\n return { message: \"No queued annotations to send.\", context: \"\" };\n }\n\n const parts: string[] = [];\n const pins: Pin[] = [];\n\n parts.push(\n `The user has queued ${queue.length} annotation${queue.length === 1 ? \"\" : \"s\"} for batch review. Process each one:\\n`,\n );\n\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n parts.push(`--- Item ${i + 1} ---`);\n\n if (item.pin) {\n parts.push(formatRichPinContext(item.pin));\n pins.push(item.pin);\n }\n\n if (item.drawings && item.drawings.length > 0) {\n parts.push(`[Drawing: ${item.drawings.length} stroke(s) on the page]`);\n for (const stroke of item.drawings) {\n const startPt = stroke.points[0];\n const endPt = stroke.points[stroke.points.length - 1];\n parts.push(\n ` ${stroke.type} from (${Math.round(startPt.x)}, ${Math.round(startPt.y)}) to (${Math.round(endPt.x)}, ${Math.round(endPt.y)}) [${stroke.color}]`,\n );\n }\n }\n\n if (item.textNotes && item.textNotes.length > 0) {\n for (const note of item.textNotes) {\n parts.push(\n `[Text note at (${Math.round(note.x)}, ${Math.round(note.y)}): \"${note.text}\"]`,\n );\n }\n }\n\n parts.push(\"\");\n }\n\n const message = parts.join(\"\\n\");\n const context = pins.length > 0 ? formatPins(pins, format) : \"\";\n\n return { message, context };\n}\n"],"mappings":";;;;;;AA0BO,SAAS,qBAAqB,KAAkB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,KAAK,CAAC,CAAC,OAAO,KAAK,IAAI;AAAA,QAC7E;AAAA,MACF;AAAA,IACF;AAEA,UAAM,KAAK,EAAE;AAAA,EACf;AAEA,QAAM,UAAU,MAAM,KAAK,IAAI;AAC/B,QAAM,UAAU,KAAK,SAAS,IAAI,WAAW,MAAM,MAAM,IAAI;AAE7D,SAAO,EAAE,SAAS,QAAQ;AAC5B;","names":[]}
@@ -2955,14 +2955,40 @@ var LINE_WIDTHS = [{
2955
2955
  width: 8,
2956
2956
  name: "Thick"
2957
2957
  }];
2958
+ var EDGE_GAP = 16;
2959
+ var COLLAPSED_TOOLBAR_SIZE = 60;
2960
+ var EXPANDED_TOOLBAR_WIDTH = 320;
2961
+ var AGENT_SIDEBAR_SELECTOR = ".agent-sidebar-panel";
2962
+ function clampRightOffset(right, toolbarWidth) {
2963
+ if (typeof window === "undefined") return right;
2964
+ const maxRight = Math.max(0, window.innerWidth - toolbarWidth - EDGE_GAP);
2965
+ return Math.min(right, maxRight);
2966
+ }
2967
+ function getVisibleRightSidebarInset() {
2968
+ if (typeof window === "undefined") return 0;
2969
+ let inset = 0;
2970
+ for (const panel of document.querySelectorAll(AGENT_SIDEBAR_SELECTOR)) {
2971
+ const style2 = window.getComputedStyle(panel);
2972
+ if (style2.display === "none" || style2.visibility === "hidden" || panel.getAttribute("aria-hidden") === "true") {
2973
+ continue;
2974
+ }
2975
+ const rect = panel.getBoundingClientRect();
2976
+ const isVisible = rect.width > 0 && rect.height > 0;
2977
+ const isAnchoredToRight = rect.right >= window.innerWidth - 1 && rect.left < window.innerWidth - 1;
2978
+ if (!isVisible || !isAnchoredToRight) continue;
2979
+ inset = Math.max(inset, Math.ceil(window.innerWidth - rect.left));
2980
+ }
2981
+ return inset;
2982
+ }
2958
2983
  var Toolbar = (props) => {
2959
2984
  const [pos, setPos] = createSignal(props.position ? {
2960
2985
  right: window.innerWidth - props.position.x,
2961
2986
  bottom: window.innerHeight - props.position.y
2962
2987
  } : {
2963
- right: 16,
2964
- bottom: 16
2988
+ right: EDGE_GAP,
2989
+ bottom: EDGE_GAP
2965
2990
  });
2991
+ const [reservedRight, setReservedRight] = createSignal(0);
2966
2992
  const [dragging, setDragging] = createSignal(false);
2967
2993
  const [dragStart, setDragStart] = createSignal({
2968
2994
  x: 0,
@@ -2971,6 +2997,39 @@ var Toolbar = (props) => {
2971
2997
  bottom: 0
2972
2998
  });
2973
2999
  const [didDrag, setDidDrag] = createSignal(false);
3000
+ onMount(() => {
3001
+ if (typeof window === "undefined") return;
3002
+ let resizeObserver;
3003
+ const updateReservedRight = () => {
3004
+ setReservedRight(getVisibleRightSidebarInset());
3005
+ resizeObserver?.disconnect();
3006
+ if (typeof ResizeObserver === "undefined") return;
3007
+ resizeObserver = new ResizeObserver(() => {
3008
+ setReservedRight(getVisibleRightSidebarInset());
3009
+ });
3010
+ for (const panel of document.querySelectorAll(AGENT_SIDEBAR_SELECTOR)) {
3011
+ resizeObserver.observe(panel);
3012
+ }
3013
+ };
3014
+ updateReservedRight();
3015
+ const mutationObserver = new MutationObserver(updateReservedRight);
3016
+ mutationObserver.observe(document.body, {
3017
+ attributes: true,
3018
+ attributeFilter: ["class", "style", "aria-hidden"],
3019
+ childList: true,
3020
+ subtree: true
3021
+ });
3022
+ window.addEventListener("resize", updateReservedRight);
3023
+ onCleanup(() => {
3024
+ mutationObserver.disconnect();
3025
+ resizeObserver?.disconnect();
3026
+ window.removeEventListener("resize", updateReservedRight);
3027
+ });
3028
+ });
3029
+ const toolbarRight = () => {
3030
+ const toolbarWidth = props.expanded ? EXPANDED_TOOLBAR_WIDTH : COLLAPSED_TOOLBAR_SIZE;
3031
+ return clampRightOffset((props.expanded ? EDGE_GAP : pos().right) + reservedRight(), toolbarWidth);
3032
+ };
2974
3033
  function handleMouseDown(e) {
2975
3034
  if (props.expanded) return;
2976
3035
  setDragging(true);
@@ -2986,9 +3045,10 @@ var Toolbar = (props) => {
2986
3045
  const start = dragStart();
2987
3046
  const dx = e2.clientX - start.x;
2988
3047
  const dy = e2.clientY - start.y;
3048
+ const maxRight = Math.max(0, window.innerWidth - reservedRight() - COLLAPSED_TOOLBAR_SIZE);
2989
3049
  setPos({
2990
- right: Math.max(0, Math.min(window.innerWidth - 60, start.right - dx)),
2991
- bottom: Math.max(0, Math.min(window.innerHeight - 60, start.bottom - dy))
3050
+ right: Math.max(0, Math.min(maxRight, start.right - dx)),
3051
+ bottom: Math.max(0, Math.min(window.innerHeight - COLLAPSED_TOOLBAR_SIZE, start.bottom - dy))
2992
3052
  });
2993
3053
  };
2994
3054
  const handleUp = () => {
@@ -3347,10 +3407,10 @@ var Toolbar = (props) => {
3347
3407
  createRenderEffect((_p$) => {
3348
3408
  var _v$ = `pp-toolbar ${props.expanded ? "pp-toolbar--expanded" : "pp-toolbar--collapsed"}`, _v$2 = {
3349
3409
  ...props.expanded ? {
3350
- bottom: "16px",
3351
- right: "16px"
3410
+ bottom: `${EDGE_GAP}px`,
3411
+ right: `${toolbarRight()}px`
3352
3412
  } : {
3353
- right: `${pos().right}px`,
3413
+ right: `${toolbarRight()}px`,
3354
3414
  bottom: `${pos().bottom}px`
3355
3415
  }
3356
3416
  };
@@ -4076,6 +4136,24 @@ var PinpointApp = (props) => {
4076
4136
  const [blockInteractions, setBlockInteractions] = createSignal(props.config.blockInteractions ?? false);
4077
4137
  const [autoSubmit, setAutoSubmit] = createSignal(props.config.autoSubmit ?? true);
4078
4138
  const [compactPopup, setCompactPopup] = createSignal(props.config.compactPopup ?? true);
4139
+ async function deliverToAgent(output) {
4140
+ const agentOutput = {
4141
+ ...output,
4142
+ submit: output.submit ?? autoSubmit()
4143
+ };
4144
+ if (props.config.sendToAgent) {
4145
+ await props.config.sendToAgent(agentOutput);
4146
+ return;
4147
+ }
4148
+ try {
4149
+ const {
4150
+ sendToAgentChat
4151
+ } = await import("@agent-native/core/client");
4152
+ sendToAgentChat(agentOutput);
4153
+ } catch {
4154
+ await navigator.clipboard.writeText([agentOutput.message, agentOutput.context].filter(Boolean).join("\n\n"));
4155
+ }
4156
+ }
4079
4157
  const storage = props.config.storage || (props.config.endpoint ? new RestClient(props.config.endpoint) : new MemoryStore());
4080
4158
  const picker = new ElementPicker({
4081
4159
  ignoreSelector: "#pinpoint-root, [data-pinpoint-marker]",
@@ -4353,25 +4431,15 @@ var PinpointApp = (props) => {
4353
4431
  if (items.length === 0) return;
4354
4432
  const {
4355
4433
  formatQueueForAgent
4356
- } = await import("./agent-context-76ZW6ODH.js");
4434
+ } = await import("./agent-context-OICFLRJ7.js");
4357
4435
  const {
4358
4436
  message,
4359
4437
  context
4360
4438
  } = formatQueueForAgent(items, outputFormat());
4361
- try {
4362
- const {
4363
- sendToAgentChat
4364
- } = await import("@agent-native/core/client");
4365
- sendToAgentChat({
4366
- message,
4367
- context,
4368
- submit: autoSubmit()
4369
- });
4370
- } catch {
4371
- await navigator.clipboard.writeText(`${message}
4372
-
4373
- ${context}`);
4374
- }
4439
+ await deliverToAgent({
4440
+ message,
4441
+ context
4442
+ });
4375
4443
  setQueue([]);
4376
4444
  if (clearOnSend()) {
4377
4445
  const pageUrl = window.location.pathname;
@@ -4399,25 +4467,15 @@ ${context}`);
4399
4467
  const selected = pins().filter((p) => ids.has(p.id));
4400
4468
  const {
4401
4469
  formatPinsForAgent
4402
- } = await import("./agent-context-76ZW6ODH.js");
4470
+ } = await import("./agent-context-OICFLRJ7.js");
4403
4471
  const {
4404
4472
  message,
4405
4473
  context
4406
4474
  } = formatPinsForAgent(selected, outputFormat());
4407
- try {
4408
- const {
4409
- sendToAgentChat
4410
- } = await import("@agent-native/core/client");
4411
- sendToAgentChat({
4412
- message,
4413
- context,
4414
- submit: autoSubmit()
4415
- });
4416
- } catch {
4417
- await navigator.clipboard.writeText(`${message}
4418
-
4419
- ${context}`);
4420
- }
4475
+ await deliverToAgent({
4476
+ message,
4477
+ context
4478
+ });
4421
4479
  setSelectedPinIds(/* @__PURE__ */ new Set());
4422
4480
  }
4423
4481
  function toggleActive() {
@@ -4501,20 +4559,12 @@ ${context}`);
4501
4559
  const pin = addPin(el, comment);
4502
4560
  const {
4503
4561
  formatRichPinContext
4504
- } = await import("./agent-context-76ZW6ODH.js");
4562
+ } = await import("./agent-context-OICFLRJ7.js");
4505
4563
  const richMessage = `Please fix: ${formatRichPinContext(pin)}`;
4506
- try {
4507
- const {
4508
- sendToAgentChat
4509
- } = await import("@agent-native/core/client");
4510
- sendToAgentChat({
4511
- message: richMessage,
4512
- context: "",
4513
- submit: autoSubmit()
4514
- });
4515
- } catch {
4516
- await navigator.clipboard.writeText(richMessage);
4517
- }
4564
+ await deliverToAgent({
4565
+ message: richMessage,
4566
+ context: ""
4567
+ });
4518
4568
  }
4519
4569
  function openEditPopup(pin) {
4520
4570
  setShowPopup(false);
@@ -4552,25 +4602,15 @@ ${context}`);
4552
4602
  async function sendPins() {
4553
4603
  const {
4554
4604
  formatPinsForAgent
4555
- } = await import("./agent-context-76ZW6ODH.js");
4605
+ } = await import("./agent-context-OICFLRJ7.js");
4556
4606
  const {
4557
4607
  message,
4558
4608
  context
4559
4609
  } = formatPinsForAgent(pins(), outputFormat());
4560
- try {
4561
- const {
4562
- sendToAgentChat
4563
- } = await import("@agent-native/core/client");
4564
- sendToAgentChat({
4565
- message,
4566
- context,
4567
- submit: autoSubmit()
4568
- });
4569
- } catch {
4570
- await navigator.clipboard.writeText(`${message}
4571
-
4572
- ${context}`);
4573
- }
4610
+ await deliverToAgent({
4611
+ message,
4612
+ context
4613
+ });
4574
4614
  if (clearOnSend()) {
4575
4615
  const pageUrl = window.location.pathname;
4576
4616
  await storage.clear(pageUrl);
@@ -4807,18 +4847,11 @@ ${context}`);
4807
4847
  return selectedElement();
4808
4848
  },
4809
4849
  onSend: async (instruction) => {
4810
- try {
4811
- const {
4812
- sendToAgentChat
4813
- } = await import("@agent-native/core/client");
4814
- const context = buildElementContext(selectedElement());
4815
- sendToAgentChat({
4816
- message: instruction,
4817
- context: JSON.stringify(context, null, 2),
4818
- submit: autoSubmit()
4819
- });
4820
- } catch {
4821
- }
4850
+ const context = buildElementContext(selectedElement());
4851
+ await deliverToAgent({
4852
+ message: instruction,
4853
+ context: JSON.stringify(context, null, 2)
4854
+ });
4822
4855
  setShowPrompt(false);
4823
4856
  },
4824
4857
  onCancel: () => setShowPrompt(false)
@@ -4894,4 +4927,4 @@ export {
4894
4927
  mountPinpoint,
4895
4928
  unmountPinpoint
4896
4929
  };
4897
- //# sourceMappingURL=chunk-5OW42OKO.js.map
4930
+ //# sourceMappingURL=chunk-SI7E6GTM.js.map