priiisk 0.1.2 → 0.1.4

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.
@@ -20,7 +20,7 @@ import {
20
20
  layerNet,
21
21
  makeCampSurfaceName,
22
22
  resolveProjectScopeSync
23
- } from "./chunk-EBRDSFGF.js";
23
+ } from "./chunk-QX5EESCS.js";
24
24
  import {
25
25
  Clock_exports,
26
26
  Config_exports,
@@ -111,7 +111,7 @@ var CliSurfaceSelectionError = class extends Data_exports.TaggedError("CliSurfac
111
111
  import { randomUUID } from "node:crypto";
112
112
 
113
113
  // packages/cli/src/domain/cliVersion.ts
114
- var PRIIISK_CLI_VERSION = "0.1.2";
114
+ var PRIIISK_CLI_VERSION = "0.1.4";
115
115
 
116
116
  // packages/cli/src/client/campRpcConnection.ts
117
117
  var PRIIISK_CONTROLLER_ID_ENV = "PRIIISK_CONTROLLER_ID";
@@ -4,14 +4,14 @@ const require = __priiiskCreateRequire(import.meta.url);
4
4
  import {
5
5
  NodeContext_exports,
6
6
  NodeRuntime_exports
7
- } from "./chunk-42LW4XTH.js";
7
+ } from "./chunk-GLWKYPVL.js";
8
8
  import {
9
9
  CampUiBackendError,
10
10
  CampUiHealthStatus,
11
11
  CampUiPlacement,
12
12
  CampUiRuntimeStatus,
13
13
  mountPiCampUi
14
- } from "./chunk-Z64QXV3O.js";
14
+ } from "./chunk-62BTCFUO.js";
15
15
  import {
16
16
  PiTransport,
17
17
  makePiOperatorResources,
@@ -19,7 +19,7 @@ import {
19
19
  makePiTransportLayer,
20
20
  requirePiModelCatalog,
21
21
  require_undici
22
- } from "./chunk-FMIRO6TM.js";
22
+ } from "./chunk-44I2RCT5.js";
23
23
  import {
24
24
  AgentRole,
25
25
  AgentRoleSchema,
@@ -66,11 +66,14 @@ import {
66
66
  campProjectPaths,
67
67
  campRecoveryDiagnosticFromCause,
68
68
  campRunPaths,
69
+ currentDirectToolSandbox,
69
70
  directToolName,
71
+ directToolSandboxCommand,
70
72
  findCampRecoveryHealthComponent,
71
73
  fromDuplex,
72
74
  fromWebSocket,
73
75
  hostStoppedCampManifest,
76
+ isDirectToolSandboxFailure,
74
77
  listWorkerModelCatalogEntries,
75
78
  loadCampManifest,
76
79
  loadReferencedMcpCredentials,
@@ -82,6 +85,7 @@ import {
82
85
  resolveCampMcpUnion,
83
86
  resolveDefaultPreset,
84
87
  resolveDirectTools,
88
+ resolveExecutablePath,
85
89
  resolveHirePreset,
86
90
  resolveMcpSecretEnv,
87
91
  resolveMcpServers,
@@ -96,7 +100,7 @@ import {
96
100
  runningCampManifest,
97
101
  saveCampHealth,
98
102
  saveCampManifest
99
- } from "./chunk-EBRDSFGF.js";
103
+ } from "./chunk-QX5EESCS.js";
100
104
  import {
101
105
  CampAskRouter,
102
106
  CampCancellationCode,
@@ -22412,7 +22416,7 @@ var Client = class extends Protocol {
22412
22416
  };
22413
22417
 
22414
22418
  // packages/mcp-backend/src/connections/clientIdentity.ts
22415
- var backendVersion = "0.1.2";
22419
+ var backendVersion = "0.1.4";
22416
22420
 
22417
22421
  // packages/mcp-backend/src/connections/mcpFailure.ts
22418
22422
  var McpFailure = class extends Data_exports.TaggedError("McpFailure") {
@@ -26419,39 +26423,42 @@ var truncate = (value, limit) => {
26419
26423
  return encoded.byteLength <= limit ? { text: value, truncated: false } : { text: encoded.subarray(0, limit).toString("utf8"), truncated: true };
26420
26424
  };
26421
26425
  var binaryCandidates = (bin) => bin === "fd" ? ["fd", "fdfind"] : [bin];
26422
- var runBinary = (bin, args, options, signal) => new Promise((resolve, reject) => {
26423
- const child = execFile(
26424
- bin,
26425
- [...args],
26426
- {
26427
- cwd: options.cwd,
26428
- env: directToolEnvironment(options.environment ?? process.env),
26429
- timeout: options.timeoutMs ?? DEFAULT_TIMEOUT_MS,
26430
- maxBuffer: MAX_BUFFER_BYTES,
26431
- ...signal === void 0 ? {} : { signal }
26432
- },
26433
- (error2, stdout, stderr) => {
26434
- const failure = error2;
26435
- if (failure !== null && failure.code === "ENOENT") {
26436
- reject(failure);
26437
- return;
26426
+ var runBinary = (executablePath, args, options, environment, signal) => {
26427
+ const sandbox = options.sandbox ?? currentDirectToolSandbox();
26428
+ const launch = directToolSandboxCommand(sandbox, executablePath, args, { cwd: options.cwd });
26429
+ return new Promise((resolve) => {
26430
+ const child = execFile(
26431
+ launch.command,
26432
+ [...launch.args],
26433
+ {
26434
+ cwd: options.cwd,
26435
+ env: environment,
26436
+ timeout: options.timeoutMs ?? DEFAULT_TIMEOUT_MS,
26437
+ maxBuffer: MAX_BUFFER_BYTES,
26438
+ ...signal === void 0 ? {} : { signal }
26439
+ },
26440
+ (error2, stdout, stderr) => {
26441
+ const failure = error2;
26442
+ const sandboxed = launch.command !== executablePath;
26443
+ resolve({
26444
+ stdout,
26445
+ stderr,
26446
+ exitCode: typeof failure?.code === "number" ? failure.code : failure === null ? 0 : 1,
26447
+ signal: child.signalCode ?? void 0,
26448
+ timedOut: failure?.killed === true,
26449
+ ...sandboxed && isDirectToolSandboxFailure(stderr) ? { sandboxFailed: true } : {},
26450
+ ...typeof failure?.code === "string" && failure.code !== "" ? { launchError: `${failure.code}: ${failure.message}` } : {}
26451
+ });
26438
26452
  }
26439
- resolve({
26440
- stdout,
26441
- stderr,
26442
- exitCode: typeof failure?.code === "number" ? failure.code : failure === null ? 0 : 1,
26443
- signal: child.signalCode ?? void 0,
26444
- timedOut: failure?.killed === true
26445
- });
26446
- }
26447
- );
26448
- });
26453
+ );
26454
+ });
26455
+ };
26449
26456
  var runWithFallback = async (policy, args, options, signal) => {
26457
+ const environment = directToolEnvironment(options.environment ?? process.env);
26450
26458
  for (const candidate of binaryCandidates(policy.bin)) {
26451
- try {
26452
- return await runBinary(candidate, args, options, signal);
26453
- } catch {
26454
- }
26459
+ const executablePath = resolveExecutablePath(candidate, environment);
26460
+ if (executablePath === void 0) continue;
26461
+ return await runBinary(executablePath, args, options, environment, signal);
26455
26462
  }
26456
26463
  return void 0;
26457
26464
  };
@@ -26523,7 +26530,19 @@ var makeDirectTool = (declared, options) => ({
26523
26530
  return refusal(detail);
26524
26531
  }
26525
26532
  const run = await runWithFallback(policy, args, options, signal);
26526
- return run === void 0 ? refusal(`\`${policy.bin}\` is not available on this machine.`) : resultOf(policy, run, options.maxOutputBytes ?? DEFAULT_MAX_OUTPUT_BYTES);
26533
+ if (run === void 0) {
26534
+ return refusal(`\`${policy.bin}\` is not available on this machine.`);
26535
+ }
26536
+ if (run.sandboxFailed === true) {
26537
+ return refusal(
26538
+ `\`${policy.bin}\` was not run: the OS sandbox refused to start it.
26539
+ ${run.stderr.trim()}`
26540
+ );
26541
+ }
26542
+ if (run.launchError !== void 0) {
26543
+ return refusal(`\`${policy.bin}\` could not be started: ${run.launchError}`);
26544
+ }
26545
+ return resultOf(policy, run, options.maxOutputBytes ?? DEFAULT_MAX_OUTPUT_BYTES);
26527
26546
  }
26528
26547
  });
26529
26548
  var makeDirectTools = (declared, options) => declared.map(
@@ -26645,7 +26664,7 @@ var acquireLiveCampHost = (options = {}) => Effect_exports.gen(function* () {
26645
26664
  if (options.manifestRunId !== void 0) {
26646
26665
  yield* prepareCampRunStorage(fs, paths, options.manifestRunId);
26647
26666
  }
26648
- const config2 = yield* loadWorkerConfig(fs);
26667
+ const config2 = yield* loadWorkerConfig(fs, { projectCwd: project.cwd });
26649
26668
  const piResources = options.piResources ?? (yield* makePiOperatorResources(
26650
26669
  options.piAgentDir === void 0 ? {} : { agentDir: options.piAgentDir }
26651
26670
  ));
package/dist/priiisk.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  fromReadable,
6
6
  layer,
7
7
  runMain
8
- } from "./chunk-42LW4XTH.js";
8
+ } from "./chunk-GLWKYPVL.js";
9
9
  import {
10
10
  CliCampLifecycleError,
11
11
  CliEquipmentConflict,
@@ -23,7 +23,7 @@ import {
23
23
  resolveCampSurface,
24
24
  withCampRpc,
25
25
  withCampRpcSession
26
- } from "./chunk-UDZECRNM.js";
26
+ } from "./chunk-XI3HWC7Q.js";
27
27
  import {
28
28
  CampCommandFailure,
29
29
  CampHostReadiness,
@@ -58,7 +58,7 @@ import {
58
58
  resolveProjectScopeSync,
59
59
  saveCampManifest,
60
60
  startingCampManifest
61
- } from "./chunk-EBRDSFGF.js";
61
+ } from "./chunk-QX5EESCS.js";
62
62
  import {
63
63
  Cause_exports,
64
64
  CommitPrototype,
@@ -19903,7 +19903,7 @@ var campResumeListCommand = Command_exports.make(
19903
19903
  )
19904
19904
  ).pipe(Command_exports.withDescription("Lists saved runs of this project that resume can restore."));
19905
19905
  var runIdArgument = Args_exports.text({ name: "runId" }).pipe(Args_exports.optional);
19906
- var selectCampRunOnDemand = (items) => Effect_exports.promise(() => import("./chunk-PIZUXHCN.js")).pipe(
19906
+ var selectCampRunOnDemand = (items) => Effect_exports.promise(() => import("./chunk-JFAW425C.js")).pipe(
19907
19907
  Effect_exports.flatMap((ui) => ui.selectCampRun({ items }))
19908
19908
  );
19909
19909
  var selectAndResume = (json) => {
@@ -19976,7 +19976,7 @@ var rootCommand = Command_exports.make(
19976
19976
  ).pipe(Command_exports.withDescription("Runs and observes a camp of collaborating workers."));
19977
19977
 
19978
19978
  // packages/cli/src/commands/doctorCommand.ts
19979
- var runDoctorOnDemand = Effect_exports.promise(() => import("./chunk-AZ2OCIIG.js")).pipe(
19979
+ var runDoctorOnDemand = Effect_exports.promise(() => import("./chunk-GZTHKLSX.js")).pipe(
19980
19980
  Effect_exports.flatMap((doctor) => doctor.runDoctor)
19981
19981
  );
19982
19982
  var statusLabel = {
@@ -20672,7 +20672,7 @@ var command = rootCommand.pipe(
20672
20672
  );
20673
20673
  var cli = Command_exports.run(command, {
20674
20674
  name: "priiisk camp control",
20675
- version: "0.1.2"
20675
+ version: "0.1.4"
20676
20676
  });
20677
20677
  var runCliCommand = (argumentsList) => cli(argumentsList).pipe(
20678
20678
  Effect_exports.matchEffect({
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "priiisk",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "CLI for running and observing a camp of collaborating agents",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "priiisk": "./dist/priiisk.js"
8
8
  },
9
9
  "files": [
10
- "dist/chunk-42LW4XTH.js",
11
- "dist/chunk-AZ2OCIIG.js",
12
- "dist/chunk-EBRDSFGF.js",
13
- "dist/chunk-EBRDSFGF.js.LEGAL.txt",
14
- "dist/chunk-FMIRO6TM.js",
15
- "dist/chunk-FMIRO6TM.js.LEGAL.txt",
10
+ "dist/chunk-44I2RCT5.js",
11
+ "dist/chunk-44I2RCT5.js.LEGAL.txt",
12
+ "dist/chunk-62BTCFUO.js",
13
+ "dist/chunk-GLWKYPVL.js",
14
+ "dist/chunk-GZTHKLSX.js",
15
+ "dist/chunk-JFAW425C.js",
16
16
  "dist/chunk-KFSFN6L5.js",
17
- "dist/chunk-PIZUXHCN.js",
18
- "dist/chunk-UDZECRNM.js",
19
- "dist/chunk-Z64QXV3O.js",
17
+ "dist/chunk-QX5EESCS.js",
18
+ "dist/chunk-QX5EESCS.js.LEGAL.txt",
19
+ "dist/chunk-XI3HWC7Q.js",
20
20
  "dist/priiisk-host.js",
21
21
  "dist/priiisk.js",
22
22
  "profiles",