@nuucognition/flint-cli 0.6.0-dev.21 → 0.6.0-dev.23

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.
@@ -9,6 +9,9 @@ function resolveTuiRenderer(requested, envValue = process.env.ORBH_TUI_RENDERER)
9
9
  return "opentui";
10
10
  }
11
11
 
12
+ // ../orbh-cli/src/tui/browse-return.ts
13
+ var BROWSE_COMMAND_NAME = "browse";
14
+
12
15
  // ../orbh-cli/src/open-tui-invocation.ts
13
16
  function rendererArg(args) {
14
17
  let requested;
@@ -19,29 +22,39 @@ function rendererArg(args) {
19
22
  }
20
23
  return requested;
21
24
  }
22
- var CHROME_SUBCOMMANDS = /* @__PURE__ */ new Set(["i", "interactive", "attach"]);
23
- function isAttachChromeRoute(invocation) {
25
+ function shouldEnableOpenTuiFfi(invocation) {
24
26
  if (!invocation.stdinTty || !invocation.stdoutTty) return false;
25
- if (invocation.envNoChrome?.trim() === "1") return false;
27
+ if (invocation.cli === "flint" && invocation.args[0] === BROWSE_COMMAND_NAME) {
28
+ return !invocation.args.some((arg) => ["--help", "-h"].includes(arg));
29
+ }
30
+ if (invocation.cli === "flint" && invocation.args[0] === "orbtest") {
31
+ const separator2 = invocation.args.indexOf("--");
32
+ const options2 = separator2 < 0 ? invocation.args : invocation.args.slice(0, separator2);
33
+ if (options2.length === 1) return true;
34
+ return options2[1] === "view" && !options2.some((arg) => ["--print", "--help", "-h"].includes(arg));
35
+ }
26
36
  const args = invocation.cli === "orbh" ? invocation.args : invocation.args[0] === "orbh" ? invocation.args.slice(1) : null;
27
- if (!args || args.length === 0) return false;
28
- const subcommand = args[0];
29
- if (subcommand === void 0 || !CHROME_SUBCOMMANDS.has(subcommand)) return false;
30
- for (const arg of args) {
31
- if (arg === "--") break;
32
- if (arg === "--plain" || arg === "--no-detach" || arg === "--print" || arg === "--json" || arg === "--orbh-internal-manager") return false;
33
- }
34
- return true;
35
- }
36
- function shouldEnableOpenTuiFfi(invocation) {
37
- if (isAttachChromeRoute(invocation)) return true;
38
- const { cli, args } = invocation;
39
- const rootCockpit = cli === "orbh" ? args.length === 0 : args.length === 1 && args[0] === "orbh";
40
- const tuiOffset = cli === "orbh" ? args[0] === "tui" ? 0 : -1 : args[0] === "orbh" && args[1] === "tui" ? 1 : -1;
41
- const explicitTui = tuiOffset >= 0;
42
- if (!explicitTui && !(rootCockpit && invocation.stdinTty && invocation.stdoutTty)) return false;
43
- const tuiArgs = explicitTui ? args.slice(tuiOffset + 1) : [];
44
- const requested = rendererArg(tuiArgs);
37
+ if (!args) return false;
38
+ const separator = args.indexOf("--");
39
+ const options = separator < 0 ? args : args.slice(0, separator);
40
+ if (options.some((arg) => ["--help", "-h", "--json", "--print", "--orbh-internal-manager"].includes(arg))) {
41
+ return false;
42
+ }
43
+ const route = options[0];
44
+ if (route === "i" || route === "interactive") {
45
+ return !options.includes("--plain") && !options.includes("--no-detach");
46
+ }
47
+ if (route === "attach") return !options.includes("--plain");
48
+ if (route === "continue" || route === "c" || route === "watch") return true;
49
+ if (route === "fork") return options.includes("--attach");
50
+ if (route === "orchestrator" || route === "orch") {
51
+ return (options[1] === "managers" || options[1] === "ls") && (options.includes("-i") || options.includes("--interactive"));
52
+ }
53
+ if (route === "claude") {
54
+ return options[1] === "list" && (options.includes("-i") || options.includes("--interactive"));
55
+ }
56
+ if (route !== void 0 && !["tui", "v", "list", "active"].includes(route)) return false;
57
+ const requested = route === "tui" || route === "v" ? rendererArg(options.slice(1)) : void 0;
45
58
  if (requested === "ink") return false;
46
59
  if (requested === void 0 && invocation.envRenderer?.trim().toLowerCase() === "ink") return false;
47
60
  return resolveTuiRenderer(requested, invocation.envRenderer) === "opentui";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuucognition/flint-cli",
3
- "version": "0.6.0-dev.21",
3
+ "version": "0.6.0-dev.23",
4
4
  "type": "module",
5
5
  "description": "Flint cognitive workspace CLI",
6
6
  "license": "PROPRIETARY",
@@ -27,7 +27,8 @@
27
27
  "yaml": "^2.6.0"
28
28
  },
29
29
  "optionalDependencies": {
30
- "node-pty": "1.1.0"
30
+ "node-pty": "1.1.0",
31
+ "playwright": "^1.50.0"
31
32
  },
32
33
  "engines": {
33
34
  "node": ">=26.1"
@@ -40,17 +41,21 @@
40
41
  "tsup": "^8.3.5",
41
42
  "tsx": "^4.19.2",
42
43
  "typescript": "5.9.3",
43
- "@nuucognition/blacksmith-cli": "0.0.1",
44
- "@nuucognition/address": "0.1.0",
44
+ "@nuucognition/entity": "1.0.0",
45
45
  "@nuucognition/flint": "0.1.0",
46
- "@nuucognition/eslint-config": "0.0.0",
47
46
  "@nuucognition/flint-mcp": "0.1.0",
48
- "@nuucognition/flint-sdk": "0.1.0",
49
47
  "@nuucognition/flint-migrations": "0.1.0",
50
- "@nuucognition/orbh-cli": "0.1.0-dev.1",
51
- "@nuucognition/typescript-config": "0.0.0",
48
+ "@nuucognition/flint-sdk": "0.1.0",
52
49
  "@nuucognition/orbh": "0.0.1-dev.0",
53
- "@nuucognition/flint-server": "0.1.0"
50
+ "@nuucognition/flint-server": "0.1.0",
51
+ "@nuucognition/orbh-cli": "0.1.0-dev.1",
52
+ "@nuucognition/orbtest-agent-orbh": "0.1.0",
53
+ "@nuucognition/orbtest-cli": "0.1.0",
54
+ "@nuucognition/orbtest-source-postgres": "0.1.0",
55
+ "@nuucognition/places": "1.0.0",
56
+ "@nuucognition/blacksmith-cli": "0.0.1",
57
+ "@nuucognition/eslint-config": "0.0.0",
58
+ "@nuucognition/typescript-config": "0.0.0"
54
59
  },
55
60
  "peerDependencies": {
56
61
  "@nuucognition/blacksmith-cli": ">=0.0.1"
package/bin/flint.js DELETED
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { fileURLToPath } from 'node:url';
4
-
5
- import { launchFlint } from './launch-flint.js';
6
-
7
- await launchFlint({
8
- launcherPath: fileURLToPath(import.meta.url),
9
- preferLiveBuild: true,
10
- });
@@ -1,19 +0,0 @@
1
- import { existsSync } from 'node:fs';
2
- import { join, resolve } from 'node:path';
3
-
4
- const hasCompleteDist = (packageRoot) =>
5
- existsSync(join(packageRoot, 'dist', 'index.js')) &&
6
- existsSync(join(packageRoot, 'dist', 'open-tui-invocation.js'));
7
-
8
- /**
9
- * Source launchers prefer the atomically selected standalone release. A launcher
10
- * inside a deployed/npm package has no checkout-level pointer and uses its own
11
- * dist directory instead.
12
- */
13
- export function resolveLiveBuildPackageRoot(sourcePackageRoot, { preferLiveBuild = true } = {}) {
14
- if (!preferLiveBuild) return sourcePackageRoot;
15
- const checkoutRoot = resolve(sourcePackageRoot, '..', '..');
16
- const currentRelease = join(checkoutRoot, '.flint-live-build', 'current');
17
-
18
- return hasCompleteDist(currentRelease) ? currentRelease : sourcePackageRoot;
19
- }