flockbay-cli 0.10.8 → 0.10.9

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.
@@ -3,7 +3,7 @@
3
3
  var chalk = require('chalk');
4
4
  var os = require('node:os');
5
5
  var crypto = require('node:crypto');
6
- var types = require('./types-Cwt6oNZm.cjs');
6
+ var types = require('./types-D4INIyRf.cjs');
7
7
  var node_child_process = require('node:child_process');
8
8
  var path = require('node:path');
9
9
  var node_readline = require('node:readline');
@@ -1217,7 +1217,7 @@ function buildDaemonSafeEnv(baseEnv, binPath) {
1217
1217
  env[pathKey] = [...prepend, ...existingParts].join(pathSep);
1218
1218
  return env;
1219
1219
  }
1220
- const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-DzloCl3J.cjs', document.baseURI).href)));
1220
+ const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-BG_P2ZhF.cjs', document.baseURI).href)));
1221
1221
  const __dirname$1 = path.join(__filename$1, "..");
1222
1222
  function getGlobalClaudeVersion(claudeExecutable) {
1223
1223
  try {
@@ -12352,7 +12352,7 @@ async function walkForKitJsonFiles(rootDir) {
12352
12352
  return out.sort((a, b) => a.localeCompare(b));
12353
12353
  }
12354
12354
  async function listBuiltInKits() {
12355
- const here = path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-DzloCl3J.cjs', document.baseURI).href))));
12355
+ const here = path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-BG_P2ZhF.cjs', document.baseURI).href))));
12356
12356
  const pkgRoot = await findPackageRootForCli(here);
12357
12357
  const kitsDir = path.join(pkgRoot, "kits");
12358
12358
  if (!await pathExists$4(kitsDir)) return [];
@@ -14501,7 +14501,7 @@ ${chalk.bold("Options:")}
14501
14501
  } else if (subcommand === "codex") {
14502
14502
  try {
14503
14503
  await chdirToNearestUprojectRootIfPresent();
14504
- const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-B4ZqM_xX.cjs'); });
14504
+ const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-CbaAW7SY.cjs'); });
14505
14505
  let startedBy = void 0;
14506
14506
  for (let i = 1; i < args.length; i++) {
14507
14507
  if (args[i] === "--started-by") {
@@ -14593,7 +14593,7 @@ ${chalk.bold("Options:")}
14593
14593
  }
14594
14594
  try {
14595
14595
  await chdirToNearestUprojectRootIfPresent();
14596
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-Ck1we_ey.cjs'); });
14596
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-Bpk5BicJ.cjs'); });
14597
14597
  let startedBy = void 0;
14598
14598
  for (let i = 1; i < args.length; i++) {
14599
14599
  if (args[i] === "--started-by") {
@@ -1,7 +1,7 @@
1
1
  import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import chalk from 'chalk';
2
2
  import os, { homedir } from 'node:os';
3
3
  import crypto, { randomUUID, randomBytes, createHash as createHash$1 } from 'node:crypto';
4
- import { l as logger, p as projectPath, d as backoff, e as delay, R as RawJSONLinesSchema, f as AsyncLock, c as configuration, g as readDaemonState, h as clearDaemonState, b as packageJson, r as readSettings, i as readCredentials, j as encodeBase64, u as updateSettings, k as encodeBase64Url, m as decodeBase64, w as writeCredentialsLegacy, n as writeCredentialsDataKey, o as acquireDaemonLock, q as writeDaemonState, A as ApiClient, s as releaseDaemonLock, t as clearCredentials, v as clearMachineId, x as getLatestDaemonLog } from './types-DiE1MW0X.mjs';
4
+ import { l as logger, p as projectPath, d as backoff, e as delay, R as RawJSONLinesSchema, f as AsyncLock, c as configuration, g as readDaemonState, h as clearDaemonState, b as packageJson, r as readSettings, i as readCredentials, j as encodeBase64, u as updateSettings, k as encodeBase64Url, m as decodeBase64, w as writeCredentialsLegacy, n as writeCredentialsDataKey, o as acquireDaemonLock, q as writeDaemonState, A as ApiClient, s as releaseDaemonLock, t as clearCredentials, v as clearMachineId, x as getLatestDaemonLog } from './types-C4663W73.mjs';
5
5
  import { spawn, execFileSync, execSync } from 'node:child_process';
6
6
  import path$1, { resolve, join, dirname } from 'node:path';
7
7
  import { createInterface } from 'node:readline';
@@ -14479,7 +14479,7 @@ ${chalk.bold("Options:")}
14479
14479
  } else if (subcommand === "codex") {
14480
14480
  try {
14481
14481
  await chdirToNearestUprojectRootIfPresent();
14482
- const { runCodex } = await import('./runCodex-CxCQnG4-.mjs');
14482
+ const { runCodex } = await import('./runCodex-BZLbUq_B.mjs');
14483
14483
  let startedBy = void 0;
14484
14484
  for (let i = 1; i < args.length; i++) {
14485
14485
  if (args[i] === "--started-by") {
@@ -14571,7 +14571,7 @@ ${chalk.bold("Options:")}
14571
14571
  }
14572
14572
  try {
14573
14573
  await chdirToNearestUprojectRootIfPresent();
14574
- const { runGemini } = await import('./runGemini-F5MibO9S.mjs');
14574
+ const { runGemini } = await import('./runGemini-Ch6pixIP.mjs');
14575
14575
  let startedBy = void 0;
14576
14576
  for (let i = 1; i < args.length; i++) {
14577
14577
  if (args[i] === "--started-by") {
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  require('chalk');
4
- require('./index-DzloCl3J.cjs');
5
- require('./types-Cwt6oNZm.cjs');
4
+ require('./index-BG_P2ZhF.cjs');
5
+ require('./types-D4INIyRf.cjs');
6
6
  require('zod');
7
7
  require('node:child_process');
8
8
  require('node:fs');
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'chalk';
2
- import './index-lah0k5ZB.mjs';
3
- import './types-DiE1MW0X.mjs';
2
+ import './index-FbVwPVUa.mjs';
3
+ import './types-C4663W73.mjs';
4
4
  import 'zod';
5
5
  import 'node:child_process';
6
6
  import 'node:fs';
package/dist/lib.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var types = require('./types-Cwt6oNZm.cjs');
3
+ var types = require('./types-D4INIyRf.cjs');
4
4
  require('axios');
5
5
  require('chalk');
6
6
  require('fs');
package/dist/lib.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { A as ApiClient, a as ApiSessionClient, R as RawJSONLinesSchema, c as configuration, l as logger } from './types-DiE1MW0X.mjs';
1
+ export { A as ApiClient, a as ApiSessionClient, R as RawJSONLinesSchema, c as configuration, l as logger } from './types-C4663W73.mjs';
2
2
  import 'axios';
3
3
  import 'chalk';
4
4
  import 'fs';
@@ -1,6 +1,6 @@
1
1
  import { useStdout, useInput, Box, Text, render } from 'ink';
2
2
  import React, { useState, useRef, useEffect, useCallback } from 'react';
3
- import { l as logger, A as ApiClient, r as readSettings, p as projectPath, c as configuration, b as packageJson } from './types-DiE1MW0X.mjs';
3
+ import { l as logger, A as ApiClient, r as readSettings, p as projectPath, c as configuration, b as packageJson } from './types-C4663W73.mjs';
4
4
  import { Client } from '@modelcontextprotocol/sdk/client/index.js';
5
5
  import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
6
6
  import { z } from 'zod';
@@ -10,7 +10,7 @@ import fs__default from 'node:fs';
10
10
  import os from 'node:os';
11
11
  import path, { resolve, join } from 'node:path';
12
12
  import { spawnSync } from 'node:child_process';
13
- import { s as shouldCountToolCall, c as consumeToolQuota, f as formatQuotaDeniedReason, h as hashObject, i as initialMachineMetadata, E as ElicitationHub, n as notifyDaemonSessionStarted, M as MessageQueue2, P as PLATFORM_SYSTEM_PROMPT, a as setLatestUserImages, w as withUserImagesMarker, b as formatFlockbaySdkDetectionSummary, d as detectFlockbaySdk, r as registerKillSessionHandler, e as MessageBuffer, g as startFlockbayServer, j as buildProjectCapsule, t as trimIdent, k as autoFinalizeCoordinationWorkItem, l as applyCoordinationSideEffectsFromMcpToolResult, m as stopCaffeinate } from './index-lah0k5ZB.mjs';
13
+ import { s as shouldCountToolCall, c as consumeToolQuota, f as formatQuotaDeniedReason, h as hashObject, i as initialMachineMetadata, E as ElicitationHub, n as notifyDaemonSessionStarted, M as MessageQueue2, P as PLATFORM_SYSTEM_PROMPT, a as setLatestUserImages, w as withUserImagesMarker, b as formatFlockbaySdkDetectionSummary, d as detectFlockbaySdk, r as registerKillSessionHandler, e as MessageBuffer, g as startFlockbayServer, j as buildProjectCapsule, t as trimIdent, k as autoFinalizeCoordinationWorkItem, l as applyCoordinationSideEffectsFromMcpToolResult, m as stopCaffeinate } from './index-FbVwPVUa.mjs';
14
14
  import { d as detectScreenshotsForGate } from './flockbayScreenshotGate-DJX3Is5d.mjs';
15
15
  import 'axios';
16
16
  import 'chalk';
@@ -2141,6 +2141,46 @@ function hashCodexSessionModeFromEnhancedMode(mode) {
2141
2141
  return hashCodexSessionMode({ model: mode.model, appendSystemPrompt: mode.appendSystemPrompt });
2142
2142
  }
2143
2143
 
2144
+ function readCodexAuthIsChatGptAccount() {
2145
+ try {
2146
+ const authPath = path.join(os.homedir(), ".codex", "auth.json");
2147
+ const raw = fs__default.readFileSync(authPath, "utf8");
2148
+ const parsed = JSON.parse(raw);
2149
+ const accessToken = parsed?.tokens?.access_token;
2150
+ if (typeof accessToken !== "string" || !accessToken) return false;
2151
+ return Boolean(parsed?.tokens?.account_id) && parsed?.OPENAI_API_KEY === null;
2152
+ } catch {
2153
+ return false;
2154
+ }
2155
+ }
2156
+ function parseEffortSuffix(model) {
2157
+ const m = String(model || "").trim();
2158
+ if (!m) return null;
2159
+ if (m.endsWith("-low")) return "low";
2160
+ if (m.endsWith("-medium")) return "medium";
2161
+ if (m.endsWith("-high")) return "high";
2162
+ return null;
2163
+ }
2164
+ function resolveCodexModelOverride(rawModel) {
2165
+ const model = typeof rawModel === "string" ? rawModel.trim() : "";
2166
+ if (!model) return {};
2167
+ const isChatGptAuth = readCodexAuthIsChatGptAccount();
2168
+ if (!isChatGptAuth) {
2169
+ return { config: { model } };
2170
+ }
2171
+ const effort = parseEffortSuffix(model);
2172
+ if (model === "gpt-5-minimal" || model.startsWith("gpt-5-codex-") || model.startsWith("gpt-5-")) {
2173
+ const nextEffort = effort ?? "medium";
2174
+ return {
2175
+ config: {
2176
+ model: "gpt-5.2",
2177
+ model_reasoning_effort: nextEffort
2178
+ }
2179
+ };
2180
+ }
2181
+ return { config: { model } };
2182
+ }
2183
+
2144
2184
  function emitReadyIfIdle({ pending, queueSize, shouldExit, sendReady, notify }) {
2145
2185
  if (shouldExit) {
2146
2186
  return false;
@@ -3319,14 +3359,15 @@ Error: ${message}`,
3319
3359
  }
3320
3360
  if (!wasCreated) {
3321
3361
  const projectCapsule = await buildProjectCapsule({ startDir: process.cwd() });
3362
+ const modelOverride = resolveCodexModelOverride(message.mode.model);
3322
3363
  const startConfig = {
3323
3364
  prompt: message.message,
3324
3365
  config: { mcp_servers: mcpServers }
3325
3366
  };
3326
3367
  startConfig.sandbox = overrides.sandbox;
3327
3368
  startConfig["approval-policy"] = overrides.approvalPolicy;
3328
- if (message.mode.model) {
3329
- startConfig.model = message.mode.model;
3369
+ if (modelOverride.config && typeof startConfig.config === "object" && startConfig.config) {
3370
+ startConfig.config = { ...startConfig.config, ...modelOverride.config };
3330
3371
  }
3331
3372
  startConfig["developer-instructions"] = sanitizeCodexInstructions(
3332
3373
  [
@@ -2,7 +2,7 @@
2
2
 
3
3
  var ink = require('ink');
4
4
  var React = require('react');
5
- var types = require('./types-Cwt6oNZm.cjs');
5
+ var types = require('./types-D4INIyRf.cjs');
6
6
  var index_js = require('@modelcontextprotocol/sdk/client/index.js');
7
7
  var stdio_js = require('@modelcontextprotocol/sdk/client/stdio.js');
8
8
  var z = require('zod');
@@ -12,7 +12,7 @@ var fs = require('node:fs');
12
12
  var os = require('node:os');
13
13
  var path = require('node:path');
14
14
  var node_child_process = require('node:child_process');
15
- var index = require('./index-DzloCl3J.cjs');
15
+ var index = require('./index-BG_P2ZhF.cjs');
16
16
  var flockbayScreenshotGate = require('./flockbayScreenshotGate-DkxU24cR.cjs');
17
17
  require('axios');
18
18
  require('chalk');
@@ -2143,6 +2143,46 @@ function hashCodexSessionModeFromEnhancedMode(mode) {
2143
2143
  return hashCodexSessionMode({ model: mode.model, appendSystemPrompt: mode.appendSystemPrompt });
2144
2144
  }
2145
2145
 
2146
+ function readCodexAuthIsChatGptAccount() {
2147
+ try {
2148
+ const authPath = path.join(os.homedir(), ".codex", "auth.json");
2149
+ const raw = fs.readFileSync(authPath, "utf8");
2150
+ const parsed = JSON.parse(raw);
2151
+ const accessToken = parsed?.tokens?.access_token;
2152
+ if (typeof accessToken !== "string" || !accessToken) return false;
2153
+ return Boolean(parsed?.tokens?.account_id) && parsed?.OPENAI_API_KEY === null;
2154
+ } catch {
2155
+ return false;
2156
+ }
2157
+ }
2158
+ function parseEffortSuffix(model) {
2159
+ const m = String(model || "").trim();
2160
+ if (!m) return null;
2161
+ if (m.endsWith("-low")) return "low";
2162
+ if (m.endsWith("-medium")) return "medium";
2163
+ if (m.endsWith("-high")) return "high";
2164
+ return null;
2165
+ }
2166
+ function resolveCodexModelOverride(rawModel) {
2167
+ const model = typeof rawModel === "string" ? rawModel.trim() : "";
2168
+ if (!model) return {};
2169
+ const isChatGptAuth = readCodexAuthIsChatGptAccount();
2170
+ if (!isChatGptAuth) {
2171
+ return { config: { model } };
2172
+ }
2173
+ const effort = parseEffortSuffix(model);
2174
+ if (model === "gpt-5-minimal" || model.startsWith("gpt-5-codex-") || model.startsWith("gpt-5-")) {
2175
+ const nextEffort = effort ?? "medium";
2176
+ return {
2177
+ config: {
2178
+ model: "gpt-5.2",
2179
+ model_reasoning_effort: nextEffort
2180
+ }
2181
+ };
2182
+ }
2183
+ return { config: { model } };
2184
+ }
2185
+
2146
2186
  function emitReadyIfIdle({ pending, queueSize, shouldExit, sendReady, notify }) {
2147
2187
  if (shouldExit) {
2148
2188
  return false;
@@ -3321,14 +3361,15 @@ Error: ${message}`,
3321
3361
  }
3322
3362
  if (!wasCreated) {
3323
3363
  const projectCapsule = await index.buildProjectCapsule({ startDir: process.cwd() });
3364
+ const modelOverride = resolveCodexModelOverride(message.mode.model);
3324
3365
  const startConfig = {
3325
3366
  prompt: message.message,
3326
3367
  config: { mcp_servers: mcpServers }
3327
3368
  };
3328
3369
  startConfig.sandbox = overrides.sandbox;
3329
3370
  startConfig["approval-policy"] = overrides.approvalPolicy;
3330
- if (message.mode.model) {
3331
- startConfig.model = message.mode.model;
3371
+ if (modelOverride.config && typeof startConfig.config === "object" && startConfig.config) {
3372
+ startConfig.config = { ...startConfig.config, ...modelOverride.config };
3332
3373
  }
3333
3374
  startConfig["developer-instructions"] = sanitizeCodexInstructions(
3334
3375
  [
@@ -6,8 +6,8 @@ var crypto = require('node:crypto');
6
6
  var os = require('node:os');
7
7
  var path = require('node:path');
8
8
  var fs$2 = require('node:fs/promises');
9
- var types = require('./types-Cwt6oNZm.cjs');
10
- var index = require('./index-DzloCl3J.cjs');
9
+ var types = require('./types-D4INIyRf.cjs');
10
+ var index = require('./index-BG_P2ZhF.cjs');
11
11
  var node_child_process = require('node:child_process');
12
12
  var sdk = require('@agentclientprotocol/sdk');
13
13
  var fs = require('fs');
@@ -4,8 +4,8 @@ import { randomUUID, createHash } from 'node:crypto';
4
4
  import os from 'node:os';
5
5
  import path, { resolve, join as join$1, basename } from 'node:path';
6
6
  import { mkdir, writeFile, readFile } from 'node:fs/promises';
7
- import { l as logger, b as packageJson, A as ApiClient, r as readSettings, p as projectPath, c as configuration } from './types-DiE1MW0X.mjs';
8
- import { s as shouldCountToolCall, c as consumeToolQuota, f as formatQuotaDeniedReason, h as hashObject, i as initialMachineMetadata, n as notifyDaemonSessionStarted, M as MessageQueue2, j as buildProjectCapsule, a as setLatestUserImages, e as MessageBuffer, w as withUserImagesMarker, b as formatFlockbaySdkDetectionSummary, d as detectFlockbaySdk, P as PLATFORM_SYSTEM_PROMPT, r as registerKillSessionHandler, g as startFlockbayServer, o as extractUserImagesMarker, p as getLatestUserImages, k as autoFinalizeCoordinationWorkItem, E as ElicitationHub, m as stopCaffeinate } from './index-lah0k5ZB.mjs';
7
+ import { l as logger, b as packageJson, A as ApiClient, r as readSettings, p as projectPath, c as configuration } from './types-C4663W73.mjs';
8
+ import { s as shouldCountToolCall, c as consumeToolQuota, f as formatQuotaDeniedReason, h as hashObject, i as initialMachineMetadata, n as notifyDaemonSessionStarted, M as MessageQueue2, j as buildProjectCapsule, a as setLatestUserImages, e as MessageBuffer, w as withUserImagesMarker, b as formatFlockbaySdkDetectionSummary, d as detectFlockbaySdk, P as PLATFORM_SYSTEM_PROMPT, r as registerKillSessionHandler, g as startFlockbayServer, o as extractUserImagesMarker, p as getLatestUserImages, k as autoFinalizeCoordinationWorkItem, E as ElicitationHub, m as stopCaffeinate } from './index-FbVwPVUa.mjs';
9
9
  import { spawn, spawnSync } from 'node:child_process';
10
10
  import { ndJsonStream, ClientSideConnection } from '@agentclientprotocol/sdk';
11
11
  import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
@@ -22,7 +22,7 @@ import { platform } from 'os';
22
22
  import { Expo } from 'expo-server-sdk';
23
23
 
24
24
  var name = "flockbay-cli";
25
- var version = "0.10.8";
25
+ var version = "0.10.9";
26
26
  var description = "Flockbay CLI (local agent + daemon + Codex mode)";
27
27
  var author = "Kirill Dubovitskiy";
28
28
  var license = "MIT";
@@ -43,7 +43,7 @@ function _interopNamespaceDefault(e) {
43
43
  var z__namespace = /*#__PURE__*/_interopNamespaceDefault(z);
44
44
 
45
45
  var name = "flockbay-cli";
46
- var version = "0.10.8";
46
+ var version = "0.10.9";
47
47
  var description = "Flockbay CLI (local agent + daemon + Codex mode)";
48
48
  var author = "Kirill Dubovitskiy";
49
49
  var license = "MIT";
@@ -1083,7 +1083,7 @@ class RpcHandlerManager {
1083
1083
  }
1084
1084
  }
1085
1085
 
1086
- const __dirname$1 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('types-Cwt6oNZm.cjs', document.baseURI).href))));
1086
+ const __dirname$1 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('types-D4INIyRf.cjs', document.baseURI).href))));
1087
1087
  function projectPath() {
1088
1088
  const path = path$1.resolve(__dirname$1, "..");
1089
1089
  return path;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flockbay-cli",
3
- "version": "0.10.8",
3
+ "version": "0.10.9",
4
4
  "description": "Flockbay CLI (local agent + daemon + Codex mode)",
5
5
  "author": "Kirill Dubovitskiy",
6
6
  "license": "MIT",