@maiaos/cli 0.1.0-canary.90 → 0.1.0-canary.91

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/cli.js CHANGED
@@ -712,7 +712,7 @@ const makeDefaultCliDependencies = (binding) => ({
712
712
  names: ["callCoordinatorTool", "serveMcp"],
713
713
  }),
714
714
  ...lazyDependencies(loadStatus, (module, node) => module.makeStatusClient(node), { ...binding, names: ["createMonitorBootstrap", "readStatus"] }),
715
- startLocalNode: (profile) => Effect.flatMap(Effect.promise(loadLaunch), (module) => module.startLocalNode(profile)),
715
+ startLocalNode: (profile, version) => Effect.flatMap(Effect.promise(loadLaunch), (module) => module.startLocalNode(profile, version)),
716
716
  });
717
717
  const remoteConnector = (remote, local, ssh) => {
718
718
  const cache = {};
@@ -11,7 +11,7 @@ export type LaunchedNode = {
11
11
  readonly exited: Effect.Effect<number>;
12
12
  readonly via: "process" | "service";
13
13
  };
14
- export type StartLocalNode = (profile?: string) => Effect.Effect<LaunchedNode, LocalNodeLaunchError, Scope.Scope>;
14
+ export type StartLocalNode = (profile: string | undefined, version: string) => Effect.Effect<LaunchedNode, LocalNodeLaunchError, Scope.Scope>;
15
15
  export declare const launchArguments: (profile?: string) => readonly string[];
16
16
  export declare const serviceStartArguments: (profile?: string) => readonly string[];
17
17
  export declare const startLocalNode: StartLocalNode;
@@ -10,7 +10,7 @@ import * as Stream from "effect/Stream";
10
10
  import "../index.js";
11
11
  class LocalNodeLaunchError extends Data.TaggedError("LocalNodeLaunchError") {
12
12
  }
13
- const NODE_EXECUTABLE = "maia-node", SERVICE_DEADLINE = "35 seconds", EXIT_USAGE = 64, profileArguments = (profile) => profile === void 0 ? [] : ["--profile", profile], launchArguments = (profile) => [
13
+ const NODE_EXECUTABLE = "maia-node", SERVICE_DEADLINE = "35 seconds", VERSION_DEADLINE = "10 seconds", EXIT_USAGE = 64, profileArguments = (profile) => profile === void 0 ? [] : ["--profile", profile], launchArguments = (profile) => [
14
14
  "--desktop",
15
15
  ...profileArguments(profile)
16
16
  ], serviceStartArguments = (profile) => [
@@ -37,10 +37,21 @@ const NODE_EXECUTABLE = "maia-node", SERVICE_DEADLINE = "35 seconds", EXIT_USAGE
37
37
  }).pipe(Effect.scoped, Effect.mapError(launchFailed), Effect.flatMap((answer) => serviceAnswer(profile, answer)), Effect.timeoutOrElse({
38
38
  duration: SERVICE_DEADLINE,
39
39
  orElse: () => Effect.fail(failure(`The Node's background service did not answer within ${SERVICE_DEADLINE}.`))
40
- })), spawnNode = (profile) => Effect.gen(function* () {
40
+ })), nodeVersion = Effect.gen(function* () {
41
+ const handle = yield* ChildProcess.make(NODE_EXECUTABLE, ["--version"], {
42
+ extendEnv: !0,
43
+ stderr: "ignore",
44
+ stdin: "ignore",
45
+ stdout: "pipe"
46
+ }), [stdout, code] = yield* Effect.all([text(handle.stdout), Effect.map(handle.exitCode, Number)], { concurrency: "unbounded" });
47
+ return code === 0 ? stdout.trim() : void 0;
48
+ }).pipe(Effect.scoped, Effect.mapError(launchFailed), Effect.timeoutOrElse({
49
+ duration: VERSION_DEADLINE,
50
+ orElse: () => Effect.void
51
+ })), matchingNode = (version) => Effect.flatMap(nodeVersion, (found) => found === version ? Effect.void : Effect.fail(failure(`The '${NODE_EXECUTABLE}' first on the PATH is ${found === void 0 || found === "" ? "of an unknown version" : `version ${found}`}, not ${version} like this maia, so this command starts no Node. Install the matching Node with 'pnpm add -g @maiaos/node@${version}', or put the folder of the matching ${NODE_EXECUTABLE} first on the PATH.`))), spawnNode = (profile) => Effect.gen(function* () {
41
52
  const environment = yield* testEnvironment(profile), handle = yield* ChildProcess.make(NODE_EXECUTABLE, launchArguments(profile), { ...DETACHED, env: environment });
42
53
  return yield* handle.unref, { exited: handle.exitCode.pipe(Effect.map(Number), Effect.orElseSucceed(() => -1)), via: "process" };
43
- }).pipe(Effect.mapError(launchFailed)), startLocalNode = (profile) => startedService(profile).pipe(Effect.flatMap((installed) => installed ? Effect.succeed({ exited: Effect.never, via: "service" }) : spawnNode(profile)), Effect.provide(spawner));
54
+ }).pipe(Effect.mapError(launchFailed)), startLocalNode = (profile, version) => startedService(profile).pipe(Effect.flatMap((installed) => installed ? Effect.succeed({ exited: Effect.never, via: "service" }) : Effect.andThen(matchingNode(version), spawnNode(profile))), Effect.provide(spawner));
44
55
  export {
45
56
  LocalNodeLaunchError,
46
57
  launchArguments,
@@ -369,6 +369,7 @@ const lifecycleOf = (context) => {
369
369
  ...(context.profile === undefined ? {} : { profile: context.profile }),
370
370
  readStatus,
371
371
  startLocalNode,
372
+ version: context.version,
372
373
  });
373
374
  };
374
375
  export const runNodeStart = (tokens, context) => guarded(Effect.gen(function* () {
@@ -33,7 +33,7 @@ const answersReady = (lifecycle) => readStatus(lifecycle).pipe(Effect.mapError(n
33
33
  : Effect.fail(notReady())), Effect.retry({ schedule: POLL }));
34
34
  const launchOnce = (lifecycle) => Effect.scoped(Effect.gen(function* () {
35
35
  const launched = yield* lifecycle
36
- .startLocalNode(lifecycle.profile)
36
+ .startLocalNode(lifecycle.profile, lifecycle.version)
37
37
  .pipe(Effect.mapError((error) => fail("node_unavailable", error.message, false)));
38
38
  return yield* answersReady(lifecycle).pipe(Effect.map((status) => ({ status, tag: "ready" })), Effect.raceFirst(Effect.map(launched.exited, (code) => ({
39
39
  code,
@@ -5,10 +5,18 @@ import { formatHeldTasks } from "./held.js";
5
5
  import { formatSessionObservation } from "./observe.js";
6
6
  import { activityLabel, formatSessionList, formatSessionTasks, } from "./tasks.js";
7
7
  const formatSessionInbox = (deliveries) => formatRows(deliveries, (delivery) => `${delivery.deliveryId}\t${delivery.sequence}\t${cell(delivery.message.senderSessionId)}\t${cell(delivery.message.subject)}\t${cell(delivery.message.body)}`);
8
+ const accessLabel = (session) => {
9
+ if (session.executor === undefined || session.containment !== undefined)
10
+ return undefined;
11
+ return session.worktree === undefined
12
+ ? "read-only (no worktree: create with --base to write)"
13
+ : "write (own worktree)";
14
+ };
8
15
  const formatSessionCreation = (result) => `${fields([
9
16
  ["session", result.sessionId],
10
17
  ["account", result.executor?.connectionId],
11
18
  ["containment", result.containment],
19
+ ["access", accessLabel(result)],
12
20
  ["permission", result.permission],
13
21
  [
14
22
  "workspace",
@@ -65,6 +73,7 @@ export const formatSessionShow = ({ remoteChildren = [], session, }) => `${field
65
73
  ["revision", session.revision],
66
74
  ["workspace", session.workspaceId],
67
75
  ["containment", session.containment],
76
+ ["access", accessLabel(session)],
68
77
  ["permission", session.permission],
69
78
  [
70
79
  "labels",
@@ -40,7 +40,7 @@ export const SESSION_TREE = {
40
40
  "session.create",
41
41
  "Create a Session, optionally starting it with a first message.",
42
42
  {
43
- example: "maia --json session create --text 'Fix the build'",
43
+ example: "maia --json session create --harness codex-cli --base HEAD --text 'Fix the build'",
44
44
  route: ["--project", "--workspace"],
45
45
  run: [session, "runSessionCreate"],
46
46
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiaos/cli",
3
- "version": "0.1.0-canary.90",
3
+ "version": "0.1.0-canary.91",
4
4
  "description": "The maia CLI and MCP server: start, drive, observe and stop swarms of Claude Code and Codex agents from a terminal, a script or another agent.",
5
5
  "keywords": [
6
6
  "maia",
@@ -65,9 +65,9 @@
65
65
  "dependencies": {
66
66
  "@earendil-works/pi-tui": "1.0.0",
67
67
  "@effect/platform-node-shared": "4.0.0",
68
- "@maiaos/agent": "0.1.0-canary.90",
69
- "@maiaos/client-core": "0.1.0-canary.90",
70
- "@maiaos/sdk": "0.1.0-canary.90",
68
+ "@maiaos/agent": "0.1.0-canary.91",
69
+ "@maiaos/client-core": "0.1.0-canary.91",
70
+ "@maiaos/sdk": "0.1.0-canary.91",
71
71
  "effect": "4.0.0"
72
72
  },
73
73
  "scripts": {