@akshar5/cohall 0.12.1 → 0.12.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.12.3](https://github.com/AksharP5/cohall/compare/v0.12.2...v0.12.3) (2026-10-15)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **providers:** preserve errors when prompt delivery fails ([#203](https://github.com/AksharP5/cohall/issues/203)) ([a56272a](https://github.com/AksharP5/cohall/commit/a56272a8103923ad2099efe3e93775981c675a16))
9
+ * **service:** keep custom pnpm providers available ([#201](https://github.com/AksharP5/cohall/issues/201)) ([b9914a1](https://github.com/AksharP5/cohall/commit/b9914a1152df950c91848694dc712d7b61e39a53))
10
+ * **tasks:** resolve Bot names with retry request IDs ([#204](https://github.com/AksharP5/cohall/issues/204)) ([f481a45](https://github.com/AksharP5/cohall/commit/f481a4519ee65a8be338ae7e2d04b165ed7df31d))
11
+
12
+ ## [0.12.2](https://github.com/AksharP5/cohall/compare/v0.12.1...v0.12.2) (2026-10-15)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **providers:** show why a Codex turn failed ([#198](https://github.com/AksharP5/cohall/issues/198)) ([14b4df2](https://github.com/AksharP5/cohall/commit/14b4df241d3e091dba5924bbfff5d896739caf01))
18
+ * **relay:** reject updates from closing connections ([#199](https://github.com/AksharP5/cohall/issues/199)) ([110645c](https://github.com/AksharP5/cohall/commit/110645cbad2e271fa6764f868ef6abe0885442c2))
19
+
3
20
  ## [0.12.1](https://github.com/AksharP5/cohall/compare/v0.12.0...v0.12.1) (2026-10-13)
4
21
 
5
22
 
package/bin/cohall.js CHANGED
@@ -17,7 +17,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
17
17
 
18
18
  // packages/protocol/src/index.ts
19
19
  import { Effect, Schema } from "effect";
20
- var version = "0.12.1", maxSocketPayloadBytes, maxAttachmentBytes, maxTaskAttachments = 2, maxProgressNoteBytes = 1024, bounded = (maxLength) => Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(maxLength)), optionalText = (maxLength) => Schema.String.check(Schema.isMaxLength(maxLength)), boundedArray = (schema, maxLength) => Schema.Array(schema).check(Schema.isMaxLength(maxLength)), count, uuid = (name) => Schema.String.check(Schema.isUUID(4)).pipe(Schema.brand(name)), isoTimestamp = (name) => Schema.String.check(Schema.isPattern(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?Z$/, {
20
+ var version = "0.12.3", maxSocketPayloadBytes, maxAttachmentBytes, maxTaskAttachments = 2, maxProgressNoteBytes = 1024, bounded = (maxLength) => Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(maxLength)), optionalText = (maxLength) => Schema.String.check(Schema.isMaxLength(maxLength)), boundedArray = (schema, maxLength) => Schema.Array(schema).check(Schema.isMaxLength(maxLength)), count, uuid = (name) => Schema.String.check(Schema.isUUID(4)).pipe(Schema.brand(name)), isoTimestamp = (name) => Schema.String.check(Schema.isPattern(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?Z$/, {
21
21
  expected: "an ISO-8601 UTC timestamp"
22
22
  })).pipe(Schema.brand(name)), BotId, Bot, DeviceId, ThreadId, MessageId, TaskId, TaskRequestId, TaskRunId, ClarificationId, AuthSessionId, OperationId, Timestamp, TaskDeadline, taskDeadlineError = "Task deadline exceeded", taskDeadlinePassed = (task, time = Date.now()) => task.expiresAt !== undefined && Date.parse(task.expiresAt) <= time, Platform, Provider, DeviceStatus, TaskStatus, OperationStatus, TaskTraceEventKind, MessageRole, ConnectionRole, AuthSession, CreatePairingInput, PairingCredential, ExchangePairingInput, SessionCredential, PairingResult, Capability, Workspace, Device, DeviceOverview, maxDevicePageDevices = 16, maxDevicePageResponseBytes, DevicePage, minimumDeviceOperationVersion = "0.5.0", parsedVersion = (value) => {
23
23
  const match = /^v?(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.exec(value);
@@ -540,6 +540,9 @@ class Hub {
540
540
  return true;
541
541
  }
542
542
  isAuthorized(socket) {
543
+ if (socket.readyState !== WebSocket3.OPEN) {
544
+ return false;
545
+ }
543
546
  const principal = this.#principals.get(socket);
544
547
  if (principal === undefined) {
545
548
  return false;
@@ -3662,6 +3665,12 @@ var parseCodex = async (stdout, existingSession) => {
3662
3665
  let sessionId = existingSession;
3663
3666
  let discardedEvent = false;
3664
3667
  await forEachJsonEvent(stdout, (event) => {
3668
+ if (text(event.type) === "turn.failed") {
3669
+ throw new ProviderRunError({
3670
+ provider: "codex",
3671
+ message: (text(record(event.error)?.message) || "Codex turn failed").slice(0, 16384)
3672
+ });
3673
+ }
3665
3674
  if (text(event.type) === "thread.started") {
3666
3675
  sessionId = text(event.thread_id) ?? sessionId;
3667
3676
  }
@@ -3918,22 +3927,28 @@ var run = (options) => Effect3.callback((resume, signal) => {
3918
3927
  child.stdin.once("error", reject);
3919
3928
  child.stdin.end(prepared.input, (cause) => cause === undefined || cause === null ? resolve2() : reject(cause));
3920
3929
  });
3921
- const [output, stderr, exit] = await Promise.all([
3930
+ const [output, stderr, exit, input] = await Promise.all([
3922
3931
  settlePromise(readOutput(options, child.stdout, terminate)),
3923
3932
  captureText(child.stderr, 64 * 1024),
3924
3933
  settlePromise(exited),
3925
- written
3934
+ settlePromise(written.catch((cause) => {
3935
+ terminate();
3936
+ throw cause;
3937
+ }))
3926
3938
  ]);
3927
3939
  if (output._tag === "Failure" && output.error instanceof ProviderRunError)
3928
3940
  throw output.error;
3929
- if (exit._tag === "Failure" && (output._tag === "Success" || child.pid === undefined)) {
3941
+ if (exit._tag === "Failure" && (child.pid === undefined || output._tag === "Success" && input._tag === "Success")) {
3930
3942
  throw exit.error;
3931
3943
  }
3932
3944
  const exitCode = exit._tag === "Success" ? exit.value : undefined;
3933
- if (exitCode !== 0) {
3945
+ if (exitCode !== 0 || input._tag === "Failure") {
3934
3946
  let diagnostic = stderr;
3935
3947
  if (stderr.text.trim().length === 0) {
3936
- const message = output._tag === "Failure" ? output.error instanceof Error ? output.error.message : String(output.error) : typeof output.value === "string" ? claudeFailureMessage(output.value) : undefined;
3948
+ let message = output._tag === "Failure" ? output.error instanceof Error ? output.error.message : String(output.error) : typeof output.value === "string" ? claudeFailureMessage(output.value) : undefined;
3949
+ if (message === undefined && input._tag === "Failure") {
3950
+ message = input.error instanceof Error ? input.error.message : String(input.error);
3951
+ }
3937
3952
  if (message !== undefined)
3938
3953
  diagnostic = { text: message, truncated: false };
3939
3954
  }
@@ -4808,7 +4823,7 @@ var createDelegation = Effect5.fn("Cohall.createDelegation")(function* (client,
4808
4823
  const provider = botId === undefined ? options.provider : "grok-bot";
4809
4824
  const inheritedThread = configuration.mcpThreadId;
4810
4825
  const parentTaskId = options.parentTaskId ?? (configuration.mcpTaskId === undefined ? undefined : yield* Schema5.decodeUnknownEffect(TaskId)(configuration.mcpTaskId));
4811
- return yield* client.createTask({
4826
+ const input = {
4812
4827
  prompt: options.prompt,
4813
4828
  ...options.requestId === undefined ? {} : { requestId: options.requestId },
4814
4829
  ...target === undefined ? {} : { targetDeviceId: target.deviceId },
@@ -4820,7 +4835,16 @@ var createDelegation = Effect5.fn("Cohall.createDelegation")(function* (client,
4820
4835
  ...parentTaskId === undefined ? {} : { parentTaskId },
4821
4836
  ...options.attachments === undefined ? {} : { attachments: options.attachments },
4822
4837
  ...options.expiresAt === undefined ? {} : { expiresAt: options.expiresAt }
4823
- });
4838
+ };
4839
+ return yield* client.createTask(input).pipe(Effect5.catch((cause) => Effect5.gen(function* () {
4840
+ const suppliedTarget = options.target;
4841
+ if (directTarget?.botId === undefined || suppliedTarget === undefined || !(cause instanceof RelayRequestError) || cause.status !== 404 && cause.status !== 409)
4842
+ return yield* Effect5.fail(cause);
4843
+ const resolved = yield* client.devices().pipe(Effect5.flatMap((devices2) => selectTarget(devices2, suppliedTarget)), Effect5.catch((error) => Effect5.fail(cause.status === 409 ? cause : error)));
4844
+ if (resolved.botId === undefined || resolved.botId === directTarget.botId)
4845
+ return yield* Effect5.fail(cause);
4846
+ return yield* client.createTask({ ...input, botId: resolved.botId });
4847
+ })));
4824
4848
  });
4825
4849
  var waitForTask = Effect5.fn("Cohall.waitForTask")(function* (client, initial, timeoutSeconds) {
4826
4850
  const id = typeof initial === "string" ? initial : initial.id;
@@ -6333,7 +6357,7 @@ var pnpmHomeDirectory = (platform4, home) => {
6333
6357
  return process.env.LOCALAPPDATA ? join5(process.env.LOCALAPPDATA, "pnpm") : join5(home, ".pnpm");
6334
6358
  };
6335
6359
  var deviceServicePlan = (options) => {
6336
- const pnpmHome = options.pnpm?.home ?? (options.platform === "darwin" ? join5(options.home, "Library", "pnpm") : join5(options.home, ".local", "share", "pnpm"));
6360
+ const pnpmHome = options.pnpm?.home ?? pnpmHomeDirectory(options.platform, options.home);
6337
6361
  const servicePath = [
6338
6362
  dirname4(options.nodeExecutable),
6339
6363
  ...options.npmPrefix === undefined ? [] : [join5(options.npmPrefix, "bin")],
@@ -9166,4 +9190,4 @@ await main().catch((cause) => {
9166
9190
  process.exitCode = 1;
9167
9191
  });
9168
9192
 
9169
- //# debugId=72424FF151CC8BDE64756E2164756E21
9193
+ //# debugId=76D03BD06599D2D464756E2164756E21