@cloop/runner 0.2.0 → 0.2.2

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.
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ LocalDriver
4
+ } from "./chunk-TFZSCXSS.js";
2
5
  import {
3
6
  MeshSocket,
4
7
  defaultSocketFactory
5
8
  } from "./chunk-ZILLDYL4.js";
6
- import {
7
- getMachine
8
- } from "./chunk-HS5CIDQF.js";
9
9
  import {
10
10
  BoxWatch,
11
- LocalDriver,
11
+ DEFAULT_FALLBACK_MODEL,
12
12
  T3Client,
13
13
  T3Driver,
14
14
  claudeDialect,
@@ -18,22 +18,27 @@ import {
18
18
  lockThreadsFile,
19
19
  mintSession,
20
20
  probeClaude,
21
+ probeClaudePermissions,
21
22
  probeCodex,
22
23
  readRunnerConfig,
23
- resolveT3Bin,
24
24
  runBoxTool,
25
25
  threadsFilePath,
26
26
  writeBoxConfig,
27
27
  writeRunnerState
28
- } from "./chunk-IIUHGZKX.js";
29
- import "./chunk-CMOMRXTA.js";
30
- import "./chunk-7K5W6ELQ.js";
31
- import "./chunk-4UE33DYW.js";
28
+ } from "./chunk-7PUGLQL2.js";
29
+ import {
30
+ getMachine
31
+ } from "./chunk-JX6VG5FE.js";
32
+ import "./chunk-R3CLO2FB.js";
33
+ import "./chunk-M6MHMCV6.js";
34
+ import "./chunk-F36GGCXC.js";
35
+ import "./chunk-AG6SI6I2.js";
36
+ import "./chunk-7BREDPJD.js";
32
37
  import {
33
38
  getMeshUrl,
34
39
  getToken,
35
40
  readCredentials
36
- } from "./chunk-SQJ7ZO4G.js";
41
+ } from "./chunk-3DIGCVL4.js";
37
42
 
38
43
  // src/commands/box.ts
39
44
  var BEAT_MS = 6e4;
@@ -59,10 +64,13 @@ async function machineHarnesses(cfg) {
59
64
  ]);
60
65
  return [claude, codex].filter((h) => h !== null);
61
66
  }
62
- function localDriver(cfg, name) {
67
+ async function localDriver(cfg, name) {
63
68
  const bin = cfg.driver === name ? cfg.bin : void 0;
64
69
  return new LocalDriver({
65
- dialect: name === "claude-code" ? claudeDialect(bin) : codexDialect(bin),
70
+ dialect: name === "claude-code" ? claudeDialect(bin, cfg.fallbackModels ?? DEFAULT_FALLBACK_MODEL, cfg.askEverything, {
71
+ ...await probeClaudePermissions(bin),
72
+ fullAccess: cfg.fullAccess
73
+ }) : codexDialect(bin, cfg.fullAccess),
66
74
  repos: cfg.repos,
67
75
  label: cfg.label,
68
76
  harnesses: () => machineHarnesses(cfg),
@@ -103,7 +111,7 @@ async function run() {
103
111
  out(`${red("\u2717")} Another \`cloop box run\` is running (pid ${lock.heldBy}). Stop it first.`);
104
112
  process.exit(1);
105
113
  }
106
- const driver = local && name !== "t3" ? localDriver(local, name) : new T3Driver({
114
+ const driver = local && name !== "t3" ? await localDriver(local, name) : new T3Driver({
107
115
  client: () => t3.client,
108
116
  t3Bin: isLocal(cfg) ? null : cfg.t3Bin,
109
117
  scope: () => cfg && !isLocal(cfg) ? cfg.scope : void 0,
@@ -175,9 +183,10 @@ async function run() {
175
183
  try {
176
184
  const disk = readRunnerConfig();
177
185
  const renewed = {
178
- ...await mintSession(cfg.t3Url, resolveT3Bin() ?? cfg.t3Bin),
186
+ ...await mintSession(cfg.t3Url, { stored: cfg.t3Bin }),
179
187
  // Read from disk: `cloop connect` may have replaced it since.
180
- deviceToken: disk?.deviceToken ?? cfg.deviceToken
188
+ deviceToken: disk?.deviceToken ?? cfg.deviceToken,
189
+ ...disk?.origin ?? cfg.origin ? { origin: disk?.origin ?? cfg.origin } : {}
181
190
  };
182
191
  cfg = renewed;
183
192
  writeBoxConfig(renewed);
@@ -60,6 +60,7 @@ function getMeshUrl() {
60
60
 
61
61
  export {
62
62
  CONFIG_DIR,
63
+ STAGING_ORIGIN,
63
64
  applyEnvironmentFlag,
64
65
  readCredentials,
65
66
  writeCredentials,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/version.ts
4
- var VERSION = true ? "0.2.0" : "0.0.0-dev";
4
+ var VERSION = true ? "0.2.2" : "0.0.0-dev";
5
5
 
6
6
  export {
7
7
  VERSION