@react-grab/gemini 0.0.81 → 0.0.82

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 CHANGED
@@ -1,10 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- var url = require('url');
5
4
  var path = require('path');
6
5
 
7
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
8
6
  var __create = Object.create;
9
7
  var __defProp = Object.defineProperty;
10
8
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -605,10 +603,8 @@ var import_picocolors = __toESM(require_picocolors());
605
603
  var DEFAULT_PORT = 8567;
606
604
 
607
605
  // src/cli.ts
608
- var VERSION = "0.0.81";
609
- var __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.cjs', document.baseURI).href)));
610
- var __dirname$1 = path.dirname(__filename$1);
611
- var serverPath = path.join(__dirname$1, "server.js");
606
+ var VERSION = "0.0.82";
607
+ var serverPath = path.join(__dirname, "server.cjs");
612
608
  (0, import_cross_spawn.default)(process.execPath, [serverPath], {
613
609
  detached: true,
614
610
  stdio: "ignore"
package/dist/cli.js CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { fileURLToPath } from 'url';
3
- import { dirname, join } from 'path';
2
+ import { join } from 'path';
4
3
 
5
4
  var __create = Object.create;
6
5
  var __defProp = Object.defineProperty;
@@ -602,10 +601,8 @@ var import_picocolors = __toESM(require_picocolors());
602
601
  var DEFAULT_PORT = 8567;
603
602
 
604
603
  // src/cli.ts
605
- var VERSION = "0.0.81";
606
- var __filename = fileURLToPath(import.meta.url);
607
- var __dirname = dirname(__filename);
608
- var serverPath = join(__dirname, "server.js");
604
+ var VERSION = "0.0.82";
605
+ var serverPath = join(__dirname, "server.cjs");
609
606
  (0, import_cross_spawn.default)(process.execPath, [serverPath], {
610
607
  detached: true,
611
608
  stdio: "ignore"
package/dist/server.cjs CHANGED
@@ -5831,7 +5831,8 @@ var import_picocolors = __toESM(require_picocolors());
5831
5831
  var DEFAULT_PORT = 8567;
5832
5832
 
5833
5833
  // src/server.ts
5834
- var VERSION = "0.0.81";
5834
+ var VERSION = "0.0.82";
5835
+ var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
5835
5836
  var geminiSessionMap = /* @__PURE__ */ new Map();
5836
5837
  var activeProcesses = /* @__PURE__ */ new Map();
5837
5838
  var parseStreamLine = (line) => {
@@ -5855,19 +5856,14 @@ var createServer = () => {
5855
5856
 
5856
5857
  ${content}`;
5857
5858
  return streamSSE(context, async (stream2) => {
5858
- const geminiArgs = [
5859
- "--prompt",
5860
- userPrompt,
5861
- "--output-format",
5862
- "stream-json",
5863
- "--yolo"
5864
- ];
5859
+ const geminiArgs = ["--output-format", "stream-json", "--yolo"];
5865
5860
  if (options?.model) {
5866
5861
  geminiArgs.push("--model", options.model);
5867
5862
  }
5868
5863
  if (options?.includeDirectories) {
5869
5864
  geminiArgs.push("--include-directories", options.includeDirectories);
5870
5865
  }
5866
+ geminiArgs.push(userPrompt);
5871
5867
  let geminiProcess;
5872
5868
  let stderrBuffer = "";
5873
5869
  try {
@@ -6012,6 +6008,7 @@ ${stderrContent}` : errorMessage;
6012
6008
  var startServer = async (port = DEFAULT_PORT) => {
6013
6009
  await fkill(`:${port}`, { force: true, silent: true }).catch(() => {
6014
6010
  });
6011
+ await sleep(100);
6015
6012
  const app = createServer();
6016
6013
  serve({ fetch: app.fetch, port });
6017
6014
  console.log(`${import_picocolors.default.magenta("\u269B")} ${import_picocolors.default.bold("React Grab")} ${import_picocolors.default.gray(VERSION)} ${import_picocolors.default.dim("(Gemini)")}`);
package/dist/server.js CHANGED
@@ -5820,7 +5820,8 @@ var import_picocolors = __toESM(require_picocolors());
5820
5820
  var DEFAULT_PORT = 8567;
5821
5821
 
5822
5822
  // src/server.ts
5823
- var VERSION = "0.0.81";
5823
+ var VERSION = "0.0.82";
5824
+ var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
5824
5825
  var geminiSessionMap = /* @__PURE__ */ new Map();
5825
5826
  var activeProcesses = /* @__PURE__ */ new Map();
5826
5827
  var parseStreamLine = (line) => {
@@ -5844,19 +5845,14 @@ var createServer = () => {
5844
5845
 
5845
5846
  ${content}`;
5846
5847
  return streamSSE(context, async (stream2) => {
5847
- const geminiArgs = [
5848
- "--prompt",
5849
- userPrompt,
5850
- "--output-format",
5851
- "stream-json",
5852
- "--yolo"
5853
- ];
5848
+ const geminiArgs = ["--output-format", "stream-json", "--yolo"];
5854
5849
  if (options?.model) {
5855
5850
  geminiArgs.push("--model", options.model);
5856
5851
  }
5857
5852
  if (options?.includeDirectories) {
5858
5853
  geminiArgs.push("--include-directories", options.includeDirectories);
5859
5854
  }
5855
+ geminiArgs.push(userPrompt);
5860
5856
  let geminiProcess;
5861
5857
  let stderrBuffer = "";
5862
5858
  try {
@@ -6001,6 +5997,7 @@ ${stderrContent}` : errorMessage;
6001
5997
  var startServer = async (port = DEFAULT_PORT) => {
6002
5998
  await fkill(`:${port}`, { force: true, silent: true }).catch(() => {
6003
5999
  });
6000
+ await sleep(100);
6004
6001
  const app = createServer();
6005
6002
  serve({ fetch: app.fetch, port });
6006
6003
  console.log(`${import_picocolors.default.magenta("\u269B")} ${import_picocolors.default.bold("React Grab")} ${import_picocolors.default.gray(VERSION)} ${import_picocolors.default.dim("(Gemini)")}`);
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@react-grab/gemini",
3
- "version": "0.0.81",
3
+ "version": "0.0.82",
4
4
  "type": "module",
5
5
  "bin": {
6
- "react-grab-gemini": "./dist/cli.js"
6
+ "react-grab-gemini": "./dist/cli.cjs"
7
7
  },
8
8
  "exports": {
9
9
  "./client": {
@@ -33,7 +33,7 @@
33
33
  "fkill": "^9.0.0",
34
34
  "hono": "^4.0.0",
35
35
  "picocolors": "^1.1.1",
36
- "react-grab": "0.0.81"
36
+ "react-grab": "0.0.82"
37
37
  },
38
38
  "scripts": {
39
39
  "dev": "tsup --watch",