@akshar5/cohall 0.12.2 → 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,14 @@
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
+
3
12
  ## [0.12.2](https://github.com/AksharP5/cohall/compare/v0.12.1...v0.12.2) (2026-10-15)
4
13
 
5
14
 
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.2", 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);
@@ -3927,22 +3927,28 @@ var run = (options) => Effect3.callback((resume, signal) => {
3927
3927
  child.stdin.once("error", reject);
3928
3928
  child.stdin.end(prepared.input, (cause) => cause === undefined || cause === null ? resolve2() : reject(cause));
3929
3929
  });
3930
- const [output, stderr, exit] = await Promise.all([
3930
+ const [output, stderr, exit, input] = await Promise.all([
3931
3931
  settlePromise(readOutput(options, child.stdout, terminate)),
3932
3932
  captureText(child.stderr, 64 * 1024),
3933
3933
  settlePromise(exited),
3934
- written
3934
+ settlePromise(written.catch((cause) => {
3935
+ terminate();
3936
+ throw cause;
3937
+ }))
3935
3938
  ]);
3936
3939
  if (output._tag === "Failure" && output.error instanceof ProviderRunError)
3937
3940
  throw output.error;
3938
- if (exit._tag === "Failure" && (output._tag === "Success" || child.pid === undefined)) {
3941
+ if (exit._tag === "Failure" && (child.pid === undefined || output._tag === "Success" && input._tag === "Success")) {
3939
3942
  throw exit.error;
3940
3943
  }
3941
3944
  const exitCode = exit._tag === "Success" ? exit.value : undefined;
3942
- if (exitCode !== 0) {
3945
+ if (exitCode !== 0 || input._tag === "Failure") {
3943
3946
  let diagnostic = stderr;
3944
3947
  if (stderr.text.trim().length === 0) {
3945
- 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
+ }
3946
3952
  if (message !== undefined)
3947
3953
  diagnostic = { text: message, truncated: false };
3948
3954
  }
@@ -4817,7 +4823,7 @@ var createDelegation = Effect5.fn("Cohall.createDelegation")(function* (client,
4817
4823
  const provider = botId === undefined ? options.provider : "grok-bot";
4818
4824
  const inheritedThread = configuration.mcpThreadId;
4819
4825
  const parentTaskId = options.parentTaskId ?? (configuration.mcpTaskId === undefined ? undefined : yield* Schema5.decodeUnknownEffect(TaskId)(configuration.mcpTaskId));
4820
- return yield* client.createTask({
4826
+ const input = {
4821
4827
  prompt: options.prompt,
4822
4828
  ...options.requestId === undefined ? {} : { requestId: options.requestId },
4823
4829
  ...target === undefined ? {} : { targetDeviceId: target.deviceId },
@@ -4829,7 +4835,16 @@ var createDelegation = Effect5.fn("Cohall.createDelegation")(function* (client,
4829
4835
  ...parentTaskId === undefined ? {} : { parentTaskId },
4830
4836
  ...options.attachments === undefined ? {} : { attachments: options.attachments },
4831
4837
  ...options.expiresAt === undefined ? {} : { expiresAt: options.expiresAt }
4832
- });
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
+ })));
4833
4848
  });
4834
4849
  var waitForTask = Effect5.fn("Cohall.waitForTask")(function* (client, initial, timeoutSeconds) {
4835
4850
  const id = typeof initial === "string" ? initial : initial.id;
@@ -6342,7 +6357,7 @@ var pnpmHomeDirectory = (platform4, home) => {
6342
6357
  return process.env.LOCALAPPDATA ? join5(process.env.LOCALAPPDATA, "pnpm") : join5(home, ".pnpm");
6343
6358
  };
6344
6359
  var deviceServicePlan = (options) => {
6345
- 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);
6346
6361
  const servicePath = [
6347
6362
  dirname4(options.nodeExecutable),
6348
6363
  ...options.npmPrefix === undefined ? [] : [join5(options.npmPrefix, "bin")],
@@ -9175,4 +9190,4 @@ await main().catch((cause) => {
9175
9190
  process.exitCode = 1;
9176
9191
  });
9177
9192
 
9178
- //# debugId=4B3B01B78A1B929E64756E2164756E21
9193
+ //# debugId=76D03BD06599D2D464756E2164756E21