@react-grab/codex 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 = "codex";
|
|
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: createCodexAgentProvider, attachAgent } = createProviderClientPlugin({
|
|
443
|
+
agentId: "codex",
|
|
444
|
+
pluginName: "codex-agent",
|
|
445
|
+
actionId: "edit-with-codex",
|
|
446
|
+
actionLabel: "Edit with Codex"
|
|
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 createCodexAgentProvider: (providerOptions?: CodexAgentProviderOptions) => AgentProvider;
|
|
9
|
-
declare global {
|
|
10
|
-
interface Window {
|
|
11
|
-
__REACT_GRAB__?: ReturnType<typeof init>;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
4
|
+
declare const createCodexAgentProvider: (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, createCodexAgentProvider };
|
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 createCodexAgentProvider: (providerOptions?: CodexAgentProviderOptions) => AgentProvider;
|
|
9
|
-
declare global {
|
|
10
|
-
interface Window {
|
|
11
|
-
__REACT_GRAB__?: ReturnType<typeof init>;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
4
|
+
declare const createCodexAgentProvider: (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, createCodexAgentProvider };
|
package/dist/client.global.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var ReactGrabCodex=(function(exports){'use strict';var $=4722,q=3e3,
|
|
2
|
-
exports.attachAgent=
|
|
1
|
+
var ReactGrabCodex=(function(exports){'use strict';var $=4722,q=3e3,O="token",D=(s={})=>{let r=s.serverUrl??`ws://localhost:${$}`,w=s.autoReconnect??true,p=s.reconnectIntervalMs??q,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,l=()=>{!w||d||A||(d=setTimeout(()=>{d=null,b().catch(()=>{});},p));},c=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}?${O}=${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=c,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);l();},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,l=null,c=false,b=null,R=()=>{r.abortAgent(w,A),c=true,o&&(o({value:void 0,done:true}),o=null,l=null);};t.addEventListener("abort",R,{once:true});let M=u=>{!u&&!c&&(b="Relay connection lost",c=true,l&&(l(new Error(b)),o=null,l=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,l=null);}}else u.type==="agent-done"?(c=true,o&&(o({value:void 0,done:true}),o=null,l=null)):u.type==="agent-error"&&(b=u.content??"Unknown error",c=true,l&&(l(new Error(b)),o=null,l=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(c||t.aborted)break;let u=await new Promise((E,k)=>{o=E,l=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(),l());},o=r.onMessage(c=>{c.sessionId===e&&(g(),c.type==="agent-done"?t():c.type==="agent-error"&&A(new Error(c.content??"Operation failed")));}),l=r.onConnectionChange(c=>{c||(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__,_):(_||(_=D(),window.__REACT_GRAB_RELAY__=_),_),P=s=>typeof s=="object"&&s!==null&&"registerPlugin"in s,x=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}=x({agentId:"codex",pluginName:"codex-agent",actionId:"edit-with-codex",actionLabel:"Edit with Codex"});U();
|
|
2
|
+
exports.attachAgent=U;exports.createCodexAgentProvider=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 = "codex";
|
|
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: createCodexAgentProvider, attachAgent } = createProviderClientPlugin({
|
|
441
|
+
agentId: "codex",
|
|
442
|
+
pluginName: "codex-agent",
|
|
443
|
+
actionId: "edit-with-codex",
|
|
444
|
+
actionLabel: "Edit with Codex"
|
|
445
|
+
});
|
|
439
446
|
attachAgent();
|
|
440
447
|
|
|
441
448
|
export { attachAgent, createCodexAgentProvider };
|
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');
|
|
@@ -7856,7 +7855,7 @@ async function fkill(inputs, options = {}) {
|
|
|
7856
7855
|
}
|
|
7857
7856
|
}
|
|
7858
7857
|
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
7859
|
-
var VERSION = "0.1.
|
|
7858
|
+
var VERSION = "0.1.17";
|
|
7860
7859
|
var checkIfRelayServerIsRunning = async (port, token) => {
|
|
7861
7860
|
try {
|
|
7862
7861
|
const healthUrl = token ? `http://localhost:${port}/health?${RELAY_TOKEN_PARAM}=${encodeURIComponent(token)}` : `http://localhost:${port}/health`;
|
|
@@ -8088,6 +8087,13 @@ var printStartupMessage = (agentId, port) => {
|
|
|
8088
8087
|
);
|
|
8089
8088
|
console.log(`- Local: ${import_picocolors.default.cyan(`ws://localhost:${port}`)}`);
|
|
8090
8089
|
};
|
|
8090
|
+
var startProviderServer = (source, handler) => {
|
|
8091
|
+
fetch(
|
|
8092
|
+
`https://www.react-grab.com/api/version?source=${source}&t=${Date.now()}`
|
|
8093
|
+
).catch(() => {
|
|
8094
|
+
});
|
|
8095
|
+
connectRelay({ handler });
|
|
8096
|
+
};
|
|
8091
8097
|
async function createOutputSchemaFile(schema) {
|
|
8092
8098
|
if (schema === void 0) {
|
|
8093
8099
|
return { cleanup: async () => {
|
|
@@ -8530,8 +8536,8 @@ var codexAgentHandler = {
|
|
|
8530
8536
|
};
|
|
8531
8537
|
|
|
8532
8538
|
// src/server.ts
|
|
8533
|
-
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
|
|
8539
|
+
var startServer = () => {
|
|
8540
|
+
startProviderServer("codex", codexAgentHandler);
|
|
8541
|
+
};
|
|
8542
|
+
|
|
8543
|
+
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 from 'process';
|
|
4
3
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
@@ -7845,7 +7844,7 @@ async function fkill(inputs, options = {}) {
|
|
|
7845
7844
|
}
|
|
7846
7845
|
}
|
|
7847
7846
|
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
7848
|
-
var VERSION = "0.1.
|
|
7847
|
+
var VERSION = "0.1.17";
|
|
7849
7848
|
var checkIfRelayServerIsRunning = async (port, token) => {
|
|
7850
7849
|
try {
|
|
7851
7850
|
const healthUrl = token ? `http://localhost:${port}/health?${RELAY_TOKEN_PARAM}=${encodeURIComponent(token)}` : `http://localhost:${port}/health`;
|
|
@@ -8077,6 +8076,13 @@ var printStartupMessage = (agentId, port) => {
|
|
|
8077
8076
|
);
|
|
8078
8077
|
console.log(`- Local: ${import_picocolors.default.cyan(`ws://localhost:${port}`)}`);
|
|
8079
8078
|
};
|
|
8079
|
+
var startProviderServer = (source, handler) => {
|
|
8080
|
+
fetch(
|
|
8081
|
+
`https://www.react-grab.com/api/version?source=${source}&t=${Date.now()}`
|
|
8082
|
+
).catch(() => {
|
|
8083
|
+
});
|
|
8084
|
+
connectRelay({ handler });
|
|
8085
|
+
};
|
|
8080
8086
|
async function createOutputSchemaFile(schema) {
|
|
8081
8087
|
if (schema === void 0) {
|
|
8082
8088
|
return { cleanup: async () => {
|
|
@@ -8519,8 +8525,8 @@ var codexAgentHandler = {
|
|
|
8519
8525
|
};
|
|
8520
8526
|
|
|
8521
8527
|
// src/server.ts
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8528
|
+
var startServer = () => {
|
|
8529
|
+
startProviderServer("codex", codexAgentHandler);
|
|
8530
|
+
};
|
|
8531
|
+
|
|
8532
|
+
export { startServer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-grab/codex",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"bin": {
|
|
5
5
|
"react-grab-codex": "./dist/cli.cjs"
|
|
6
6
|
},
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@openai/codex-sdk": "^0.66.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",
|