grab 0.0.78 → 0.0.81

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.
@@ -100,6 +100,7 @@ interface AgentContext<T = unknown> {
100
100
  content: string;
101
101
  prompt: string;
102
102
  options?: T;
103
+ sessionId?: string;
103
104
  }
104
105
  interface AgentSession {
105
106
  id: string;
@@ -107,6 +108,7 @@ interface AgentSession {
107
108
  lastStatus: string;
108
109
  isStreaming: boolean;
109
110
  createdAt: number;
111
+ lastUpdatedAt: number;
110
112
  position: {
111
113
  x: number;
112
114
  y: number;
@@ -119,7 +121,9 @@ interface AgentSession {
119
121
  interface AgentProvider<T = any> {
120
122
  send: (context: AgentContext<T>, signal: AbortSignal) => AsyncIterable<string>;
121
123
  resume?: (sessionId: string, signal: AbortSignal, storage: AgentSessionStorage) => AsyncIterable<string>;
124
+ abort?: (sessionId: string) => Promise<void>;
122
125
  supportsResume?: boolean;
126
+ supportsFollowUp?: boolean;
123
127
  checkConnection?: () => Promise<boolean>;
124
128
  getCompletionMessage?: () => string | undefined;
125
129
  undo?: () => Promise<void>;
@@ -247,13 +251,18 @@ interface ReactGrabRendererProps {
247
251
  crosshairVisible?: boolean;
248
252
  inputValue?: string;
249
253
  isInputExpanded?: boolean;
254
+ replyToPrompt?: string;
250
255
  hasAgent?: boolean;
251
256
  isAgentConnected?: boolean;
252
257
  agentSessions?: Map<string, AgentSession>;
258
+ supportsUndo?: boolean;
259
+ supportsFollowUp?: boolean;
253
260
  onAbortSession?: (sessionId: string) => void;
254
261
  onDismissSession?: (sessionId: string) => void;
255
262
  onUndoSession?: (sessionId: string) => void;
263
+ onReplySession?: (sessionId: string) => void;
256
264
  onAcknowledgeSessionError?: (sessionId: string) => void;
265
+ onRetrySession?: (sessionId: string) => void;
257
266
  onInputChange?: (value: string) => void;
258
267
  onInputSubmit?: () => void;
259
268
  onInputCancel?: () => void;
@@ -100,6 +100,7 @@ interface AgentContext<T = unknown> {
100
100
  content: string;
101
101
  prompt: string;
102
102
  options?: T;
103
+ sessionId?: string;
103
104
  }
104
105
  interface AgentSession {
105
106
  id: string;
@@ -107,6 +108,7 @@ interface AgentSession {
107
108
  lastStatus: string;
108
109
  isStreaming: boolean;
109
110
  createdAt: number;
111
+ lastUpdatedAt: number;
110
112
  position: {
111
113
  x: number;
112
114
  y: number;
@@ -119,7 +121,9 @@ interface AgentSession {
119
121
  interface AgentProvider<T = any> {
120
122
  send: (context: AgentContext<T>, signal: AbortSignal) => AsyncIterable<string>;
121
123
  resume?: (sessionId: string, signal: AbortSignal, storage: AgentSessionStorage) => AsyncIterable<string>;
124
+ abort?: (sessionId: string) => Promise<void>;
122
125
  supportsResume?: boolean;
126
+ supportsFollowUp?: boolean;
123
127
  checkConnection?: () => Promise<boolean>;
124
128
  getCompletionMessage?: () => string | undefined;
125
129
  undo?: () => Promise<void>;
@@ -247,13 +251,18 @@ interface ReactGrabRendererProps {
247
251
  crosshairVisible?: boolean;
248
252
  inputValue?: string;
249
253
  isInputExpanded?: boolean;
254
+ replyToPrompt?: string;
250
255
  hasAgent?: boolean;
251
256
  isAgentConnected?: boolean;
252
257
  agentSessions?: Map<string, AgentSession>;
258
+ supportsUndo?: boolean;
259
+ supportsFollowUp?: boolean;
253
260
  onAbortSession?: (sessionId: string) => void;
254
261
  onDismissSession?: (sessionId: string) => void;
255
262
  onUndoSession?: (sessionId: string) => void;
263
+ onReplySession?: (sessionId: string) => void;
256
264
  onAcknowledgeSessionError?: (sessionId: string) => void;
265
+ onRetrySession?: (sessionId: string) => void;
257
266
  onInputChange?: (value: string) => void;
258
267
  onInputSubmit?: () => void;
259
268
  onInputCancel?: () => void;
package/dist/core.cjs CHANGED
@@ -1,30 +1 @@
1
- 'use strict';
2
-
3
- var chunkIOEUCYGF_cjs = require('./chunk-IOEUCYGF.cjs');
4
-
5
-
6
-
7
- Object.defineProperty(exports, "DEFAULT_THEME", {
8
- enumerable: true,
9
- get: function () { return chunkIOEUCYGF_cjs.DEFAULT_THEME; }
10
- });
11
- Object.defineProperty(exports, "formatElementInfo", {
12
- enumerable: true,
13
- get: function () { return chunkIOEUCYGF_cjs.getElementContext; }
14
- });
15
- Object.defineProperty(exports, "generateSnippet", {
16
- enumerable: true,
17
- get: function () { return chunkIOEUCYGF_cjs.generateSnippet; }
18
- });
19
- Object.defineProperty(exports, "getStack", {
20
- enumerable: true,
21
- get: function () { return chunkIOEUCYGF_cjs.getStack; }
22
- });
23
- Object.defineProperty(exports, "init", {
24
- enumerable: true,
25
- get: function () { return chunkIOEUCYGF_cjs.init; }
26
- });
27
- Object.defineProperty(exports, "isInstrumentationActive", {
28
- enumerable: true,
29
- get: function () { return chunkIOEUCYGF_cjs.Ee; }
30
- });
1
+ 'use strict';var chunkHUGHVCPX_cjs=require('./chunk-HUGHVCPX.cjs');Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkHUGHVCPX_cjs.d}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkHUGHVCPX_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkHUGHVCPX_cjs.e}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkHUGHVCPX_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkHUGHVCPX_cjs.f}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkHUGHVCPX_cjs.a}});
package/dist/core.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- export { o as AgentCompleteResult, A as AgentContext, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, D as DEFAULT_THEME, O as Options, d as OverlayBounds, R as ReactGrabAPI, p as ReactGrabRendererProps, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-BIJVr_bk.cjs';
1
+ export { o as AgentCompleteResult, A as AgentContext, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, D as DEFAULT_THEME, O as Options, d as OverlayBounds, R as ReactGrabAPI, p as ReactGrabRendererProps, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-CO-ZnW1x.cjs';
2
2
  export { isInstrumentationActive } from 'bippy';
3
3
  import 'bippy/source';
package/dist/core.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { o as AgentCompleteResult, A as AgentContext, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, D as DEFAULT_THEME, O as Options, d as OverlayBounds, R as ReactGrabAPI, p as ReactGrabRendererProps, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-BIJVr_bk.js';
1
+ export { o as AgentCompleteResult, A as AgentContext, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, D as DEFAULT_THEME, O as Options, d as OverlayBounds, R as ReactGrabAPI, p as ReactGrabRendererProps, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-CO-ZnW1x.js';
2
2
  export { isInstrumentationActive } from 'bippy';
3
3
  import 'bippy/source';
package/dist/core.js CHANGED
@@ -1 +1 @@
1
- export { DEFAULT_THEME, getElementContext as formatElementInfo, generateSnippet, getStack, init, Ee as isInstrumentationActive } from './chunk-PJCJQBH7.js';
1
+ export{d as DEFAULT_THEME,c as formatElementInfo,e as generateSnippet,b as getStack,f as init,a as isInstrumentationActive}from'./chunk-YE5UYZQC.js';
package/dist/index.cjs CHANGED
@@ -1,8 +1,4 @@
1
- 'use strict';
2
-
3
- var chunkIOEUCYGF_cjs = require('./chunk-IOEUCYGF.cjs');
4
-
5
- /**
1
+ 'use strict';var chunkHUGHVCPX_cjs=require('./chunk-HUGHVCPX.cjs');/**
6
2
  * @license MIT
7
3
  *
8
4
  * Copyright (c) 2025 Aiden Bai
@@ -10,58 +6,4 @@ var chunkIOEUCYGF_cjs = require('./chunk-IOEUCYGF.cjs');
10
6
  * This source code is licensed under the MIT license found in the
11
7
  * LICENSE file in the root directory of this source tree.
12
8
  */
13
-
14
- // src/index.ts
15
- var globalApi = null;
16
- var getGlobalApi = () => {
17
- if (typeof window === "undefined") return globalApi;
18
- return window.__REACT_GRAB__ ?? globalApi ?? null;
19
- };
20
- var setGlobalApi = (api) => {
21
- globalApi = api;
22
- if (typeof window !== "undefined") {
23
- if (api) {
24
- window.__REACT_GRAB__ = api;
25
- } else {
26
- delete window.__REACT_GRAB__;
27
- }
28
- }
29
- };
30
- if (typeof window !== "undefined") {
31
- if (window.__REACT_GRAB__) {
32
- globalApi = window.__REACT_GRAB__;
33
- } else {
34
- globalApi = chunkIOEUCYGF_cjs.init();
35
- window.__REACT_GRAB__ = globalApi;
36
- window.dispatchEvent(
37
- new CustomEvent("react-grab:init", { detail: globalApi })
38
- );
39
- }
40
- }
41
-
42
- Object.defineProperty(exports, "DEFAULT_THEME", {
43
- enumerable: true,
44
- get: function () { return chunkIOEUCYGF_cjs.DEFAULT_THEME; }
45
- });
46
- Object.defineProperty(exports, "formatElementInfo", {
47
- enumerable: true,
48
- get: function () { return chunkIOEUCYGF_cjs.getElementContext; }
49
- });
50
- Object.defineProperty(exports, "generateSnippet", {
51
- enumerable: true,
52
- get: function () { return chunkIOEUCYGF_cjs.generateSnippet; }
53
- });
54
- Object.defineProperty(exports, "getStack", {
55
- enumerable: true,
56
- get: function () { return chunkIOEUCYGF_cjs.getStack; }
57
- });
58
- Object.defineProperty(exports, "init", {
59
- enumerable: true,
60
- get: function () { return chunkIOEUCYGF_cjs.init; }
61
- });
62
- Object.defineProperty(exports, "isInstrumentationActive", {
63
- enumerable: true,
64
- get: function () { return chunkIOEUCYGF_cjs.Ee; }
65
- });
66
- exports.getGlobalApi = getGlobalApi;
67
- exports.setGlobalApi = setGlobalApi;
9
+ var e=null,A=()=>typeof window>"u"?e:window.__REACT_GRAB__??e??null,d=t=>{e=t,typeof window<"u"&&(t?window.__REACT_GRAB__=t:delete window.__REACT_GRAB__);};typeof window<"u"&&(window.__REACT_GRAB__?e=window.__REACT_GRAB__:(e=chunkHUGHVCPX_cjs.f(),window.__REACT_GRAB__=e,window.dispatchEvent(new CustomEvent("react-grab:init",{detail:e}))));Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkHUGHVCPX_cjs.d}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkHUGHVCPX_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkHUGHVCPX_cjs.e}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkHUGHVCPX_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkHUGHVCPX_cjs.f}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkHUGHVCPX_cjs.a}});exports.getGlobalApi=A;exports.setGlobalApi=d;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as ReactGrabAPI } from './core-BIJVr_bk.cjs';
2
- export { o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, I as InputModeContext, O as Options, d as OverlayBounds, c as ReactGrabState, f as Rect, T as Theme, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-BIJVr_bk.cjs';
1
+ import { R as ReactGrabAPI } from './core-CO-ZnW1x.cjs';
2
+ export { o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, I as InputModeContext, O as Options, d as OverlayBounds, c as ReactGrabState, f as Rect, T as Theme, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-CO-ZnW1x.cjs';
3
3
  export { isInstrumentationActive } from 'bippy';
4
4
  import 'bippy/source';
5
5
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as ReactGrabAPI } from './core-BIJVr_bk.js';
2
- export { o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, I as InputModeContext, O as Options, d as OverlayBounds, c as ReactGrabState, f as Rect, T as Theme, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-BIJVr_bk.js';
1
+ import { R as ReactGrabAPI } from './core-CO-ZnW1x.js';
2
+ export { o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, I as InputModeContext, O as Options, d as OverlayBounds, c as ReactGrabState, f as Rect, T as Theme, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-CO-ZnW1x.js';
3
3
  export { isInstrumentationActive } from 'bippy';
4
4
  import 'bippy/source';
5
5