@react-grab/claude-code 0.1.15 → 0.1.17
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/cli.cjs +8 -4
- package/dist/cli.js +8 -4
- package/dist/client.cjs +67 -60
- package/dist/client.d.cts +4 -11
- package/dist/client.d.ts +4 -11
- package/dist/client.global.js +2 -2
- package/dist/client.js +67 -60
- package/dist/server.cjs +13 -7
- package/dist/server.d.cts +3 -1
- package/dist/server.d.ts +3 -1
- package/dist/server.js +13 -7
- package/package.json +4 -4
package/dist/cli.cjs
CHANGED
|
@@ -8,9 +8,13 @@ var path = require('path');
|
|
|
8
8
|
var realScriptPath = fs.realpathSync(process.argv[1]);
|
|
9
9
|
var scriptDir = path.dirname(realScriptPath);
|
|
10
10
|
var serverPath = path.join(scriptDir, "server.cjs");
|
|
11
|
-
var child = child_process.spawn(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
var child = child_process.spawn(
|
|
12
|
+
process.execPath,
|
|
13
|
+
["-e", `require(${JSON.stringify(serverPath)}).startServer()`],
|
|
14
|
+
{
|
|
15
|
+
detached: true,
|
|
16
|
+
stdio: "inherit"
|
|
17
|
+
}
|
|
18
|
+
);
|
|
15
19
|
child.unref();
|
|
16
20
|
process.exit(0);
|
package/dist/cli.js
CHANGED
|
@@ -6,9 +6,13 @@ import { dirname, join } from 'path';
|
|
|
6
6
|
var realScriptPath = realpathSync(process.argv[1]);
|
|
7
7
|
var scriptDir = dirname(realScriptPath);
|
|
8
8
|
var serverPath = join(scriptDir, "server.cjs");
|
|
9
|
-
var child = spawn(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
var child = spawn(
|
|
10
|
+
process.execPath,
|
|
11
|
+
["-e", `require(${JSON.stringify(serverPath)}).startServer()`],
|
|
12
|
+
{
|
|
13
|
+
detached: true,
|
|
14
|
+
stdio: "inherit"
|
|
15
|
+
}
|
|
16
|
+
);
|
|
13
17
|
child.unref();
|
|
14
18
|
process.exit(0);
|
package/dist/client.cjs
CHANGED
|
@@ -374,70 +374,77 @@ var getDefaultRelayClient = () => {
|
|
|
374
374
|
}
|
|
375
375
|
return defaultRelayClient;
|
|
376
376
|
};
|
|
377
|
-
|
|
378
|
-
// src/client.ts
|
|
379
|
-
var AGENT_ID = "claude-code";
|
|
380
377
|
var isReactGrabApi = (value) => typeof value === "object" && value !== null && "registerPlugin" in value;
|
|
381
|
-
var
|
|
382
|
-
const
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
};
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
actionContext
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
378
|
+
var createProviderClientPlugin = (config) => {
|
|
379
|
+
const createAgentProvider = (providerOptions = {}) => {
|
|
380
|
+
const relayClient = providerOptions.relayClient ?? getDefaultRelayClient();
|
|
381
|
+
if (!relayClient) {
|
|
382
|
+
throw new Error("RelayClient is required in browser environments");
|
|
383
|
+
}
|
|
384
|
+
return createRelayAgentProvider({
|
|
385
|
+
relayClient,
|
|
386
|
+
agentId: config.agentId
|
|
387
|
+
});
|
|
388
|
+
};
|
|
389
|
+
const attachAgent2 = async () => {
|
|
390
|
+
if (typeof window === "undefined") return;
|
|
391
|
+
const relayClient = getDefaultRelayClient();
|
|
392
|
+
if (!relayClient) return;
|
|
393
|
+
try {
|
|
394
|
+
await relayClient.connect();
|
|
395
|
+
} catch {
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
const provider = createRelayAgentProvider({
|
|
399
|
+
relayClient,
|
|
400
|
+
agentId: config.agentId
|
|
401
|
+
});
|
|
402
|
+
const attach = (api) => {
|
|
403
|
+
const agent = { provider, storage: sessionStorage };
|
|
404
|
+
api.registerPlugin({
|
|
405
|
+
name: config.pluginName,
|
|
406
|
+
actions: [
|
|
407
|
+
{
|
|
408
|
+
id: config.actionId,
|
|
409
|
+
label: config.actionLabel,
|
|
410
|
+
shortcut: "Enter",
|
|
411
|
+
onAction: (actionContext) => {
|
|
412
|
+
actionContext.enterPromptMode?.(agent);
|
|
413
|
+
},
|
|
414
|
+
agent
|
|
415
|
+
}
|
|
416
|
+
]
|
|
417
|
+
});
|
|
419
418
|
};
|
|
420
|
-
|
|
419
|
+
const existingApi = window.__REACT_GRAB__;
|
|
420
|
+
if (isReactGrabApi(existingApi)) {
|
|
421
|
+
attach(existingApi);
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
window.addEventListener(
|
|
425
|
+
"react-grab:init",
|
|
426
|
+
(event) => {
|
|
427
|
+
if (!(event instanceof CustomEvent)) return;
|
|
428
|
+
if (!isReactGrabApi(event.detail)) return;
|
|
429
|
+
attach(event.detail);
|
|
430
|
+
},
|
|
431
|
+
{ once: true }
|
|
432
|
+
);
|
|
433
|
+
const apiAfterListener = window.__REACT_GRAB__;
|
|
434
|
+
if (isReactGrabApi(apiAfterListener)) {
|
|
435
|
+
attach(apiAfterListener);
|
|
436
|
+
}
|
|
421
437
|
};
|
|
422
|
-
|
|
423
|
-
if (isReactGrabApi(existingApi)) {
|
|
424
|
-
attach(existingApi);
|
|
425
|
-
return;
|
|
426
|
-
}
|
|
427
|
-
window.addEventListener(
|
|
428
|
-
"react-grab:init",
|
|
429
|
-
(event) => {
|
|
430
|
-
if (!(event instanceof CustomEvent)) return;
|
|
431
|
-
if (!isReactGrabApi(event.detail)) return;
|
|
432
|
-
attach(event.detail);
|
|
433
|
-
},
|
|
434
|
-
{ once: true }
|
|
435
|
-
);
|
|
436
|
-
const apiAfterListener = window.__REACT_GRAB__;
|
|
437
|
-
if (isReactGrabApi(apiAfterListener)) {
|
|
438
|
-
attach(apiAfterListener);
|
|
439
|
-
}
|
|
438
|
+
return { createAgentProvider, attachAgent: attachAgent2 };
|
|
440
439
|
};
|
|
440
|
+
|
|
441
|
+
// src/client.ts
|
|
442
|
+
var { createAgentProvider: createClaudeAgentProvider, attachAgent } = createProviderClientPlugin({
|
|
443
|
+
agentId: "claude-code",
|
|
444
|
+
pluginName: "claude-code-agent",
|
|
445
|
+
actionId: "edit-with-claude-code",
|
|
446
|
+
actionLabel: "Edit with Claude"
|
|
447
|
+
});
|
|
441
448
|
attachAgent();
|
|
442
449
|
|
|
443
450
|
exports.attachAgent = attachAgent;
|
package/dist/client.d.cts
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _react_grab_relay_client from '@react-grab/relay/client';
|
|
2
2
|
export { AgentCompleteResult } from 'react-grab/core';
|
|
3
|
-
import { RelayClient, AgentProvider } from '@react-grab/relay/client';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
relayClient?: RelayClient;
|
|
7
|
-
}
|
|
8
|
-
declare const createClaudeAgentProvider: (providerOptions?: ClaudeAgentProviderOptions) => AgentProvider;
|
|
9
|
-
declare global {
|
|
10
|
-
interface Window {
|
|
11
|
-
__REACT_GRAB__?: ReturnType<typeof init>;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
4
|
+
declare const createClaudeAgentProvider: (providerOptions?: {
|
|
5
|
+
relayClient?: _react_grab_relay_client.RelayClient;
|
|
6
|
+
}) => _react_grab_relay_client.AgentProvider;
|
|
14
7
|
declare const attachAgent: () => Promise<void>;
|
|
15
8
|
|
|
16
9
|
export { attachAgent, createClaudeAgentProvider };
|
package/dist/client.d.ts
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _react_grab_relay_client from '@react-grab/relay/client';
|
|
2
2
|
export { AgentCompleteResult } from 'react-grab/core';
|
|
3
|
-
import { RelayClient, AgentProvider } from '@react-grab/relay/client';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
relayClient?: RelayClient;
|
|
7
|
-
}
|
|
8
|
-
declare const createClaudeAgentProvider: (providerOptions?: ClaudeAgentProviderOptions) => AgentProvider;
|
|
9
|
-
declare global {
|
|
10
|
-
interface Window {
|
|
11
|
-
__REACT_GRAB__?: ReturnType<typeof init>;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
4
|
+
declare const createClaudeAgentProvider: (providerOptions?: {
|
|
5
|
+
relayClient?: _react_grab_relay_client.RelayClient;
|
|
6
|
+
}) => _react_grab_relay_client.AgentProvider;
|
|
14
7
|
declare const attachAgent: () => Promise<void>;
|
|
15
8
|
|
|
16
9
|
export { attachAgent, createClaudeAgentProvider };
|
package/dist/client.global.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var ReactGrabClaudeCode=(function(exports){'use strict';var q=4722,
|
|
2
|
-
exports.attachAgent=
|
|
1
|
+
var ReactGrabClaudeCode=(function(exports){'use strict';var q=4722,O=3e3,D="token",x=(s={})=>{let r=s.serverUrl??`ws://localhost:${q}`,w=s.autoReconnect??true,p=s.reconnectIntervalMs??O,h=s.token,i=null,f=false,C=[],d=null,e=null,t=null,A=false,y=new Set,g=new Set,o=new Set,c=()=>{!w||d||A||(d=setTimeout(()=>{d=null,b().catch(()=>{});},p));},l=n=>{try{let a=JSON.parse(n.data);if(a.type==="handlers"&&a.handlers){C=a.handlers;for(let S of g)S(C);}for(let S of y)S(a);}catch{}},b=()=>i?.readyState===WebSocket.OPEN?Promise.resolve():e||(A=false,e=new Promise((n,a)=>{t=a;let S=h?`${r}?${D}=${encodeURIComponent(h)}`:r;i=new WebSocket(S),i.onopen=()=>{e=null,t=null,f=true;for(let m of o)m(true);n();},i.onmessage=l,i.onclose=()=>{t&&(t(new Error("WebSocket connection closed")),t=null),e=null,f=false,C=[];for(let m of g)m(C);for(let m of o)m(false);c();},i.onerror=()=>{e=null,t=null,f=false,a(new Error("WebSocket connection failed"));};}),e),R=()=>{A=true,d&&(clearTimeout(d),d=null),t&&(t(new Error("Connection aborted")),t=null),e=null,i?.close(),i=null,f=false,C=[];},M=()=>f,v=n=>i?.readyState===WebSocket.OPEN?(i.send(JSON.stringify(n)),true):false;return {connect:b,disconnect:R,isConnected:M,sendAgentRequest:(n,a)=>v({type:"agent-request",agentId:n,sessionId:a.sessionId,context:a}),abortAgent:(n,a)=>{v({type:"agent-abort",agentId:n,sessionId:a});},undoAgent:(n,a)=>v({type:"agent-undo",agentId:n,sessionId:a}),redoAgent:(n,a)=>v({type:"agent-redo",agentId:n,sessionId:a}),onMessage:n=>(y.add(n),()=>y.delete(n)),onHandlersChange:n=>(g.add(n),()=>g.delete(n)),onConnectionChange:n=>(o.add(n),queueMicrotask(()=>{o.has(n)&&n(f);}),()=>o.delete(n)),getAvailableHandlers:()=>C}},L=s=>{let{relayClient:r,agentId:w}=s,p=async()=>{if(!r.isConnected())try{await r.connect();}catch{return false}return r.getAvailableHandlers().includes(w)},h=async function*(e,t){if(t.aborted)throw new DOMException("Aborted","AbortError");yield "Connecting\u2026";let A=e.sessionId??`session-${Date.now()}-${Math.random().toString(36).slice(2)}`,y={...e,sessionId:A},g=[],o=null,c=null,l=false,b=null,R=()=>{r.abortAgent(w,A),l=true,o&&(o({value:void 0,done:true}),o=null,c=null);};t.addEventListener("abort",R,{once:true});let M=u=>{!u&&!l&&(b="Relay connection lost",l=true,c&&(c(new Error(b)),o=null,c=null));},v=r.onConnectionChange(M),I=r.onMessage(u=>{if(u.sessionId===A)if(u.type==="agent-status"&&u.content){if(g.push(u.content),o){let E=g.shift();E!==void 0&&(o({value:E,done:false}),o=null,c=null);}}else u.type==="agent-done"?(l=true,o&&(o({value:void 0,done:true}),o=null,c=null)):u.type==="agent-error"&&(b=u.content??"Unknown error",l=true,c&&(c(new Error(b)),o=null,c=null));});if(!r.isConnected())throw v(),I(),t.removeEventListener("abort",R),new Error("Relay connection is not open");if(!r.sendAgentRequest(w,y))throw v(),I(),t.removeEventListener("abort",R),new Error("Failed to send agent request: connection not open");try{for(;;){if(g.length>0){let E=g.shift();E!==void 0&&(yield E);continue}if(l||t.aborted)break;let u=await new Promise((E,k)=>{o=E,c=k;});if(u.done)break;yield u.value;}if(b)throw new Error(b)}finally{t.removeEventListener("abort",R),v(),I();}},i=async e=>{r.abortAgent(w,e);},f=e=>new Promise((t,A)=>{let y=false,g=()=>{y||(y=true,o(),c());},o=r.onMessage(l=>{l.sessionId===e&&(g(),l.type==="agent-done"?t():l.type==="agent-error"&&A(new Error(l.content??"Operation failed")));}),c=r.onConnectionChange(l=>{l||(g(),A(new Error("Connection lost while waiting for operation response")));});});return {send:h,abort:i,undo:async()=>{let e=`undo-${w}-${Date.now()}-${Math.random().toString(36).slice(2)}`;if(!r.undoAgent(w,e))throw new Error("Failed to send undo request: connection not open");return f(e)},redo:async()=>{let e=`redo-${w}-${Date.now()}-${Math.random().toString(36).slice(2)}`;if(!r.redoAgent(w,e))throw new Error("Failed to send redo request: connection not open");return f(e)},checkConnection:p,supportsResume:true,supportsFollowUp:true}},_=null,T=()=>typeof window>"u"?null:window.__REACT_GRAB_RELAY__?(_=window.__REACT_GRAB_RELAY__,_):(_||(_=x(),window.__REACT_GRAB_RELAY__=_),_),P=s=>typeof s=="object"&&s!==null&&"registerPlugin"in s,N=s=>({createAgentProvider:(p={})=>{let h=p.relayClient??T();if(!h)throw new Error("RelayClient is required in browser environments");return L({relayClient:h,agentId:s.agentId})},attachAgent:async()=>{if(typeof window>"u")return;let p=T();if(!p)return;try{await p.connect();}catch{return}let h=L({relayClient:p,agentId:s.agentId}),i=d=>{let e={provider:h,storage:sessionStorage};d.registerPlugin({name:s.pluginName,actions:[{id:s.actionId,label:s.actionLabel,shortcut:"Enter",onAction:t=>{t.enterPromptMode?.(e);},agent:e}]});},f=window.__REACT_GRAB__;if(P(f)){i(f);return}window.addEventListener("react-grab:init",d=>{d instanceof CustomEvent&&P(d.detail)&&i(d.detail);},{once:true});let C=window.__REACT_GRAB__;P(C)&&i(C);}});var {createAgentProvider:Y,attachAgent:U}=N({agentId:"claude-code",pluginName:"claude-code-agent",actionId:"edit-with-claude-code",actionLabel:"Edit with Claude"});U();
|
|
2
|
+
exports.attachAgent=U;exports.createClaudeAgentProvider=Y;return exports;})({});
|
package/dist/client.js
CHANGED
|
@@ -372,70 +372,77 @@ var getDefaultRelayClient = () => {
|
|
|
372
372
|
}
|
|
373
373
|
return defaultRelayClient;
|
|
374
374
|
};
|
|
375
|
-
|
|
376
|
-
// src/client.ts
|
|
377
|
-
var AGENT_ID = "claude-code";
|
|
378
375
|
var isReactGrabApi = (value) => typeof value === "object" && value !== null && "registerPlugin" in value;
|
|
379
|
-
var
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
};
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
const
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
actionContext
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
376
|
+
var createProviderClientPlugin = (config) => {
|
|
377
|
+
const createAgentProvider = (providerOptions = {}) => {
|
|
378
|
+
const relayClient = providerOptions.relayClient ?? getDefaultRelayClient();
|
|
379
|
+
if (!relayClient) {
|
|
380
|
+
throw new Error("RelayClient is required in browser environments");
|
|
381
|
+
}
|
|
382
|
+
return createRelayAgentProvider({
|
|
383
|
+
relayClient,
|
|
384
|
+
agentId: config.agentId
|
|
385
|
+
});
|
|
386
|
+
};
|
|
387
|
+
const attachAgent2 = async () => {
|
|
388
|
+
if (typeof window === "undefined") return;
|
|
389
|
+
const relayClient = getDefaultRelayClient();
|
|
390
|
+
if (!relayClient) return;
|
|
391
|
+
try {
|
|
392
|
+
await relayClient.connect();
|
|
393
|
+
} catch {
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
const provider = createRelayAgentProvider({
|
|
397
|
+
relayClient,
|
|
398
|
+
agentId: config.agentId
|
|
399
|
+
});
|
|
400
|
+
const attach = (api) => {
|
|
401
|
+
const agent = { provider, storage: sessionStorage };
|
|
402
|
+
api.registerPlugin({
|
|
403
|
+
name: config.pluginName,
|
|
404
|
+
actions: [
|
|
405
|
+
{
|
|
406
|
+
id: config.actionId,
|
|
407
|
+
label: config.actionLabel,
|
|
408
|
+
shortcut: "Enter",
|
|
409
|
+
onAction: (actionContext) => {
|
|
410
|
+
actionContext.enterPromptMode?.(agent);
|
|
411
|
+
},
|
|
412
|
+
agent
|
|
413
|
+
}
|
|
414
|
+
]
|
|
415
|
+
});
|
|
417
416
|
};
|
|
418
|
-
|
|
417
|
+
const existingApi = window.__REACT_GRAB__;
|
|
418
|
+
if (isReactGrabApi(existingApi)) {
|
|
419
|
+
attach(existingApi);
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
window.addEventListener(
|
|
423
|
+
"react-grab:init",
|
|
424
|
+
(event) => {
|
|
425
|
+
if (!(event instanceof CustomEvent)) return;
|
|
426
|
+
if (!isReactGrabApi(event.detail)) return;
|
|
427
|
+
attach(event.detail);
|
|
428
|
+
},
|
|
429
|
+
{ once: true }
|
|
430
|
+
);
|
|
431
|
+
const apiAfterListener = window.__REACT_GRAB__;
|
|
432
|
+
if (isReactGrabApi(apiAfterListener)) {
|
|
433
|
+
attach(apiAfterListener);
|
|
434
|
+
}
|
|
419
435
|
};
|
|
420
|
-
|
|
421
|
-
if (isReactGrabApi(existingApi)) {
|
|
422
|
-
attach(existingApi);
|
|
423
|
-
return;
|
|
424
|
-
}
|
|
425
|
-
window.addEventListener(
|
|
426
|
-
"react-grab:init",
|
|
427
|
-
(event) => {
|
|
428
|
-
if (!(event instanceof CustomEvent)) return;
|
|
429
|
-
if (!isReactGrabApi(event.detail)) return;
|
|
430
|
-
attach(event.detail);
|
|
431
|
-
},
|
|
432
|
-
{ once: true }
|
|
433
|
-
);
|
|
434
|
-
const apiAfterListener = window.__REACT_GRAB__;
|
|
435
|
-
if (isReactGrabApi(apiAfterListener)) {
|
|
436
|
-
attach(apiAfterListener);
|
|
437
|
-
}
|
|
436
|
+
return { createAgentProvider, attachAgent: attachAgent2 };
|
|
438
437
|
};
|
|
438
|
+
|
|
439
|
+
// src/client.ts
|
|
440
|
+
var { createAgentProvider: createClaudeAgentProvider, attachAgent } = createProviderClientPlugin({
|
|
441
|
+
agentId: "claude-code",
|
|
442
|
+
pluginName: "claude-code-agent",
|
|
443
|
+
actionId: "edit-with-claude-code",
|
|
444
|
+
actionLabel: "Edit with Claude"
|
|
445
|
+
});
|
|
439
446
|
attachAgent();
|
|
440
447
|
|
|
441
448
|
export { attachAgent, createClaudeAgentProvider };
|
package/dist/server.cjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
'use strict';
|
|
3
2
|
|
|
4
3
|
var http = require('http');
|
|
@@ -7877,7 +7876,7 @@ async function fkill(inputs, options = {}) {
|
|
|
7877
7876
|
}
|
|
7878
7877
|
}
|
|
7879
7878
|
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
7880
|
-
var VERSION = "0.1.
|
|
7879
|
+
var VERSION = "0.1.17";
|
|
7881
7880
|
var checkIfRelayServerIsRunning = async (port, token) => {
|
|
7882
7881
|
try {
|
|
7883
7882
|
const healthUrl = token ? `http://localhost:${port}/health?${RELAY_TOKEN_PARAM}=${encodeURIComponent(token)}` : `http://localhost:${port}/health`;
|
|
@@ -8109,6 +8108,13 @@ var printStartupMessage = (agentId, port) => {
|
|
|
8109
8108
|
);
|
|
8110
8109
|
console.log(`- Local: ${import_picocolors.default.cyan(`ws://localhost:${port}`)}`);
|
|
8111
8110
|
};
|
|
8111
|
+
var startProviderServer = (source, handler) => {
|
|
8112
|
+
fetch(
|
|
8113
|
+
`https://www.react-grab.com/api/version?source=${source}&t=${Date.now()}`
|
|
8114
|
+
).catch(() => {
|
|
8115
|
+
});
|
|
8116
|
+
connectRelay({ handler });
|
|
8117
|
+
};
|
|
8112
8118
|
var __create2 = Object.create;
|
|
8113
8119
|
var __getProtoOf2 = Object.getPrototypeOf;
|
|
8114
8120
|
var __defProp2 = Object.defineProperty;
|
|
@@ -20569,8 +20575,8 @@ var claudeAgentHandler = {
|
|
|
20569
20575
|
};
|
|
20570
20576
|
|
|
20571
20577
|
// src/server.ts
|
|
20572
|
-
|
|
20573
|
-
|
|
20574
|
-
|
|
20575
|
-
|
|
20576
|
-
|
|
20578
|
+
var startServer = () => {
|
|
20579
|
+
startProviderServer("claude-code", claudeAgentHandler);
|
|
20580
|
+
};
|
|
20581
|
+
|
|
20582
|
+
exports.startServer = startServer;
|
package/dist/server.d.cts
CHANGED
package/dist/server.d.ts
CHANGED
package/dist/server.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
import { createServer } from 'http';
|
|
3
2
|
import process2, { cwd } from 'process';
|
|
4
3
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
@@ -7849,7 +7848,7 @@ async function fkill(inputs, options = {}) {
|
|
|
7849
7848
|
}
|
|
7850
7849
|
}
|
|
7851
7850
|
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
7852
|
-
var VERSION = "0.1.
|
|
7851
|
+
var VERSION = "0.1.17";
|
|
7853
7852
|
var checkIfRelayServerIsRunning = async (port, token) => {
|
|
7854
7853
|
try {
|
|
7855
7854
|
const healthUrl = token ? `http://localhost:${port}/health?${RELAY_TOKEN_PARAM}=${encodeURIComponent(token)}` : `http://localhost:${port}/health`;
|
|
@@ -8081,6 +8080,13 @@ var printStartupMessage = (agentId, port) => {
|
|
|
8081
8080
|
);
|
|
8082
8081
|
console.log(`- Local: ${import_picocolors.default.cyan(`ws://localhost:${port}`)}`);
|
|
8083
8082
|
};
|
|
8083
|
+
var startProviderServer = (source, handler) => {
|
|
8084
|
+
fetch(
|
|
8085
|
+
`https://www.react-grab.com/api/version?source=${source}&t=${Date.now()}`
|
|
8086
|
+
).catch(() => {
|
|
8087
|
+
});
|
|
8088
|
+
connectRelay({ handler });
|
|
8089
|
+
};
|
|
8084
8090
|
var __create2 = Object.create;
|
|
8085
8091
|
var __getProtoOf2 = Object.getPrototypeOf;
|
|
8086
8092
|
var __defProp2 = Object.defineProperty;
|
|
@@ -20541,8 +20547,8 @@ var claudeAgentHandler = {
|
|
|
20541
20547
|
};
|
|
20542
20548
|
|
|
20543
20549
|
// src/server.ts
|
|
20544
|
-
|
|
20545
|
-
|
|
20546
|
-
|
|
20547
|
-
|
|
20548
|
-
|
|
20550
|
+
var startServer = () => {
|
|
20551
|
+
startProviderServer("claude-code", claudeAgentHandler);
|
|
20552
|
+
};
|
|
20553
|
+
|
|
20554
|
+
export { startServer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-grab/claude-code",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"bin": {
|
|
5
5
|
"react-grab-claude-code": "./dist/cli.cjs"
|
|
6
6
|
},
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@anthropic-ai/claude-agent-sdk": "^0.1.0",
|
|
33
|
-
"@react-grab/relay": "0.1.
|
|
34
|
-
"react-grab": "0.1.
|
|
33
|
+
"@react-grab/relay": "0.1.17",
|
|
34
|
+
"react-grab": "0.1.17"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^22.10.7",
|
|
38
38
|
"tsup": "^8.4.0",
|
|
39
|
-
"@react-grab/utils": "0.1.
|
|
39
|
+
"@react-grab/utils": "0.1.17"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"dev": "tsup --watch",
|