@akshar5/cohall 0.12.12 → 0.12.14

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +15 -5
  3. package/bin/{chunk-1ekexd73.js → chunk-318jbf1v.js} +17 -13
  4. package/bin/chunk-318jbf1v.js.map +10 -0
  5. package/bin/{chunk-94dpwj2b.js → chunk-6r5hdtcx.js} +4 -4
  6. package/bin/{chunk-vm7gzczr.js → chunk-7vn72ejw.js} +3 -3
  7. package/bin/{chunk-zkhqkh0y.js → chunk-89z9anfx.js} +32 -15
  8. package/bin/chunk-89z9anfx.js.map +11 -0
  9. package/bin/{chunk-04a27ybz.js → chunk-aj2btss5.js} +2 -5
  10. package/bin/{chunk-04a27ybz.js.map → chunk-aj2btss5.js.map} +3 -3
  11. package/bin/{chunk-f8qjez08.js → chunk-dy48ndmb.js} +32 -15
  12. package/bin/chunk-dy48ndmb.js.map +15 -0
  13. package/bin/{chunk-qbcgvhf1.js → chunk-hg08s7y1.js} +2 -2
  14. package/bin/{chunk-qbcgvhf1.js.map → chunk-hg08s7y1.js.map} +1 -1
  15. package/bin/{chunk-bpnafwbg.js → chunk-kc5awrf4.js} +65 -14
  16. package/bin/chunk-kc5awrf4.js.map +13 -0
  17. package/bin/{chunk-g6b3zmtw.js → chunk-m82xx6vz.js} +1 -1
  18. package/bin/{chunk-1m1566kp.js → chunk-t16mw8kv.js} +3 -3
  19. package/bin/{chunk-4trfnawd.js → chunk-tc7gfcwe.js} +7 -7
  20. package/bin/chunk-tc7gfcwe.js.map +10 -0
  21. package/bin/{chunk-c78dff66.js → chunk-vphkssrc.js} +69 -21
  22. package/bin/chunk-vphkssrc.js.map +14 -0
  23. package/bin/{chunk-baep7sfx.js → chunk-wexfaech.js} +2 -2
  24. package/bin/cohall.js +13 -10
  25. package/bin/cohall.js.map +3 -3
  26. package/docs/install.md +3 -1
  27. package/docs/integrations.md +22 -4
  28. package/docs/onboarding.md +8 -3
  29. package/docs/services.md +3 -0
  30. package/package.json +1 -1
  31. package/bin/chunk-1ekexd73.js.map +0 -10
  32. package/bin/chunk-4trfnawd.js.map +0 -10
  33. package/bin/chunk-bpnafwbg.js.map +0 -13
  34. package/bin/chunk-c78dff66.js.map +0 -14
  35. package/bin/chunk-f8qjez08.js.map +0 -15
  36. package/bin/chunk-zkhqkh0y.js.map +0 -11
  37. /package/bin/{chunk-94dpwj2b.js.map → chunk-6r5hdtcx.js.map} +0 -0
  38. /package/bin/{chunk-vm7gzczr.js.map → chunk-7vn72ejw.js.map} +0 -0
  39. /package/bin/{chunk-g6b3zmtw.js.map → chunk-m82xx6vz.js.map} +0 -0
  40. /package/bin/{chunk-1m1566kp.js.map → chunk-t16mw8kv.js.map} +0 -0
  41. /package/bin/{chunk-baep7sfx.js.map → chunk-wexfaech.js.map} +0 -0
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../packages/protocol/src/index.ts"],
4
4
  "sourcesContent": [
5
- "import { Effect, Schema } from \"effect\"\n\nexport { version } from \"./version.ts\"\n\nexport const maxSocketPayloadBytes = 1024 * 1024\nexport const maxAuthTokenBytes = 512\nexport const maxAttachmentBytes = 256 * 1024\nexport const maxTaskAttachments = 2\nexport const maxProgressNoteBytes = 1024\n\nconst bounded = (maxLength: number) =>\n Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(maxLength))\nconst optionalText = (maxLength: number) => Schema.String.check(Schema.isMaxLength(maxLength))\nconst boundedArray = <S extends Schema.Top>(schema: S, maxLength: number) =>\n Schema.Array(schema).check(Schema.isMaxLength(maxLength))\nconst count = Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER }))\n\nexport const assertOwnerToken = (token: string): void => {\n if (token.length < 32) {\n throw new Error(\"The Cohall relay owner token must be at least 32 characters\")\n }\n if (new TextEncoder().encode(token).byteLength > maxAuthTokenBytes) {\n throw new Error(`The Cohall relay owner token must be at most ${maxAuthTokenBytes} UTF-8 bytes`)\n }\n if (token.trim() !== token || !/^[\\t\\x20-\\x7e\\x80-\\xff]+$/.test(token)) {\n throw new Error(\n \"The Cohall relay owner token must fit an HTTP header without leading or trailing whitespace\",\n )\n }\n}\n\nconst uuid = <Name extends string>(name: Name) =>\n Schema.String.check(Schema.isUUID(4)).pipe(Schema.brand(name))\nconst isoTimestamp = <Name extends string>(name: Name) =>\n Schema.String.check(\n Schema.isPattern(/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?Z$/, {\n expected: \"an ISO-8601 UTC timestamp\",\n }),\n ).pipe(Schema.brand(name))\n\nexport const BotId = bounded(256).pipe(Schema.brand(\"BotId\"))\nexport type BotId = typeof BotId.Type\n\nexport const Bot = Schema.Struct({\n id: BotId,\n name: bounded(128),\n description: Schema.optionalKey(optionalText(512)),\n})\nexport interface Bot extends Schema.Schema.Type<typeof Bot> {}\n\nexport const DeviceId = uuid(\"DeviceId\")\nexport type DeviceId = typeof DeviceId.Type\nexport const ThreadId = uuid(\"ThreadId\")\nexport type ThreadId = typeof ThreadId.Type\nexport const MessageId = uuid(\"MessageId\")\nexport type MessageId = typeof MessageId.Type\nexport const TaskId = uuid(\"TaskId\")\nexport type TaskId = typeof TaskId.Type\nexport const TaskRequestId = uuid(\"TaskRequestId\")\nexport type TaskRequestId = typeof TaskRequestId.Type\nexport const TaskRunId = uuid(\"TaskRunId\")\nexport type TaskRunId = typeof TaskRunId.Type\nexport const ClarificationId = uuid(\"ClarificationId\")\nexport type ClarificationId = typeof ClarificationId.Type\nexport const AuthSessionId = uuid(\"AuthSessionId\")\nexport type AuthSessionId = typeof AuthSessionId.Type\nexport const OperationId = uuid(\"OperationId\")\nexport type OperationId = typeof OperationId.Type\nexport const Timestamp = isoTimestamp(\"Timestamp\")\nexport type Timestamp = typeof Timestamp.Type\n\nexport const TaskDeadline = Timestamp.check(\n Schema.makeFilter((value) => {\n const time = Date.parse(value)\n return Number.isFinite(time) && new Date(time).toISOString().slice(0, 19) === value.slice(0, 19)\n ? undefined\n : \"Expected a valid ISO-8601 UTC deadline\"\n }),\n)\nexport const taskDeadlineError = \"Task deadline exceeded\"\nexport const taskDeadlinePassed = (task: { readonly expiresAt?: Timestamp }, time = Date.now()) =>\n task.expiresAt !== undefined && Date.parse(task.expiresAt) <= time\n\nexport const Platform = Schema.Literals([\"darwin\", \"linux\", \"windows\", \"unknown\"])\nexport type Platform = typeof Platform.Type\nexport const Provider = Schema.Literals([\"codex\", \"claude-code\", \"opencode\", \"grok-bot\"])\nexport type Provider = typeof Provider.Type\nexport const DeviceStatus = Schema.Literals([\"online\", \"busy\", \"offline\"])\nexport type DeviceStatus = typeof DeviceStatus.Type\nexport const TaskStatus = Schema.Literals([\n \"queued\",\n \"assigned\",\n \"running\",\n \"needs_input\",\n \"cancelling\",\n \"completed\",\n \"failed\",\n \"cancelled\",\n])\nexport type TaskStatus = typeof TaskStatus.Type\nexport const OperationStatus = Schema.Literals([\n \"queued\",\n \"assigned\",\n \"running\",\n \"completed\",\n \"failed\",\n])\nexport type OperationStatus = typeof OperationStatus.Type\nexport const TaskTraceEventKind = Schema.Literals([\n ...TaskStatus.literals,\n \"requeued\",\n \"input_requested\",\n \"input_answered\",\n])\nexport type TaskTraceEventKind = typeof TaskTraceEventKind.Type\nexport const MessageRole = Schema.Literals([\"human\", \"agent\", \"system\"])\nexport type MessageRole = typeof MessageRole.Type\nexport const ConnectionRole = Schema.Literals([\"client\", \"device\"])\nexport type ConnectionRole = typeof ConnectionRole.Type\n\nexport const AuthSession = Schema.Struct({\n id: AuthSessionId,\n label: bounded(128),\n role: ConnectionRole,\n createdAt: Timestamp,\n expiresAt: Timestamp,\n lastSeenAt: Timestamp,\n deviceId: Schema.optionalKey(DeviceId),\n revokedAt: Schema.optionalKey(Timestamp),\n})\nexport interface AuthSession extends Schema.Schema.Type<typeof AuthSession> {}\n\nexport const CreatePairingInput = Schema.Struct({\n label: bounded(128),\n roles: boundedArray(ConnectionRole, 2),\n})\nexport interface CreatePairingInput extends Schema.Schema.Type<typeof CreatePairingInput> {}\n\nexport const PairingCredential = Schema.Struct({\n token: bounded(256),\n expiresAt: Timestamp,\n})\nexport interface PairingCredential extends Schema.Schema.Type<typeof PairingCredential> {}\n\nexport const ExchangePairingInput = Schema.Struct({\n token: bounded(256),\n})\nexport interface ExchangePairingInput extends Schema.Schema.Type<typeof ExchangePairingInput> {}\n\nexport const SessionCredential = Schema.Struct({\n token: bounded(256),\n session: AuthSession,\n})\nexport interface SessionCredential extends Schema.Schema.Type<typeof SessionCredential> {}\n\nexport const PairingResult = Schema.Struct({\n credentials: boundedArray(SessionCredential, 2),\n})\nexport interface PairingResult extends Schema.Schema.Type<typeof PairingResult> {}\n\nexport const Capability = Schema.Struct({\n id: bounded(64),\n label: bounded(128),\n detail: Schema.optionalKey(optionalText(512)),\n})\nexport interface Capability extends Schema.Schema.Type<typeof Capability> {}\n\nexport const Workspace = Schema.Struct({\n path: bounded(4096),\n label: bounded(256),\n})\nexport interface Workspace extends Schema.Schema.Type<typeof Workspace> {}\n\nexport const Device = Schema.Struct({\n id: DeviceId,\n name: bounded(128),\n description: Schema.optionalKey(optionalText(512)),\n hostname: bounded(256),\n platform: Platform,\n architecture: bounded(64),\n status: DeviceStatus,\n providers: boundedArray(Provider, Provider.literals.length),\n bots: Schema.optionalKey(boundedArray(Bot, 256)),\n capabilities: boundedArray(Capability, 64),\n workspaces: boundedArray(Workspace, 64),\n version: bounded(32),\n lastSeenAt: Timestamp,\n connectedAt: Schema.optionalKey(Timestamp),\n queue: Schema.optionalKey(\n Schema.Struct({\n queued: count,\n oldestQueuedAt: Schema.optionalKey(Timestamp),\n }),\n ),\n})\nexport interface Device extends Schema.Schema.Type<typeof Device> {}\n\nexport const DeviceOverview = Schema.Struct({\n id: Device.fields.id,\n name: Device.fields.name,\n description: Device.fields.description,\n status: Device.fields.status,\n version: Device.fields.version,\n lastSeenAt: Device.fields.lastSeenAt,\n queued: count,\n active: count,\n needsInput: count,\n cancelling: count,\n oldestQueuedAt: Schema.optionalKey(Timestamp),\n})\nexport interface DeviceOverview extends Schema.Schema.Type<typeof DeviceOverview> {}\n\nexport const maxDevicePageDevices = 16\nexport const maxDevicePageResponseBytes = 3 * 1024 * 1024\nexport const DevicePage = Schema.Struct({\n devices: boundedArray(Device, maxDevicePageDevices),\n nextCursor: Schema.optionalKey(DeviceId),\n}).check(\n Schema.makeFilter((page) => {\n let previous: DeviceId | undefined\n for (const device of page.devices) {\n if (previous !== undefined && device.id <= previous)\n return \"Device pages must be ordered by ID\"\n previous = device.id\n }\n return page.nextCursor === undefined || page.nextCursor === previous\n ? undefined\n : \"The next cursor must be the last device ID\"\n }),\n)\nexport interface DevicePage extends Schema.Schema.Type<typeof DevicePage> {}\n\nexport const minimumDeviceOperationVersion = \"0.5.0\"\n\nconst parsedVersion = (value: string): readonly [number, number, number, boolean] | undefined => {\n const match = /^v?(\\d+)\\.(\\d+)\\.(\\d+)(-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/.exec(value)\n if (match === null) {\n return undefined\n }\n const core = match.slice(1, 4).map(Number)\n if (core.length !== 3 || core.some((part) => !Number.isSafeInteger(part))) {\n return undefined\n }\n return [core[0] ?? 0, core[1] ?? 0, core[2] ?? 0, match[4] !== undefined]\n}\n\nexport const supportsDeviceOperations = (candidate: string): boolean => {\n if (candidate === \"0.0.0-development\") {\n return true\n }\n const current = parsedVersion(candidate)\n const minimum = parsedVersion(minimumDeviceOperationVersion)\n if (current === undefined || minimum === undefined) {\n return false\n }\n for (let index = 0; index < 3; index += 1) {\n if (current[index] !== minimum[index]) {\n return (current[index] ?? 0) > (minimum[index] ?? 0)\n }\n }\n return !current[3]\n}\n\nexport const assertDeviceOperationSupport = (\n devices: ReadonlyArray<{ readonly name: string; readonly version: string }>,\n): void => {\n const unsupported = devices.filter((device) => !supportsDeviceOperations(device.version))\n if (unsupported.length === 0) {\n return\n }\n throw new Error(\n `All-device upgrades require Cohall ${minimumDeviceOperationVersion} or newer on every device. Upgrade individually first: ${unsupported.map((device) => `${device.name} (${device.version})`).join(\", \")}`,\n )\n}\n\nexport const Thread = Schema.Struct({\n id: ThreadId,\n title: bounded(256),\n createdAt: Timestamp,\n updatedAt: Timestamp,\n defaultDeviceId: Schema.optionalKey(DeviceId),\n})\nexport interface Thread extends Schema.Schema.Type<typeof Thread> {}\n\nexport const Message = Schema.Struct({\n id: MessageId,\n threadId: ThreadId,\n role: MessageRole,\n authorName: bounded(128),\n content: optionalText(131_072),\n createdAt: Timestamp,\n taskId: Schema.optionalKey(TaskId),\n deviceId: Schema.optionalKey(DeviceId),\n})\nexport interface Message extends Schema.Schema.Type<typeof Message> {}\n\nexport const AttachmentName = Schema.String.check(\n Schema.isMinLength(1),\n Schema.isMaxLength(128),\n Schema.makeFilter((name) =>\n name !== \".\" &&\n name !== \"..\" &&\n !/[<>:\"/\\\\|?*]/.test(name) &&\n !/[. ]$/.test(name) &&\n !/^(?:CON|PRN|AUX|NUL|CONIN\\$|CONOUT\\$|COM[1-9¹²³]|LPT[1-9¹²³])(?:\\.|$)/i.test(name) &&\n new TextEncoder().encode(name).byteLength <= 128 &&\n [...name].every((character) => character.charCodeAt(0) >= 32 && character.charCodeAt(0) !== 127)\n ? undefined\n : \"Use a file name without path separators or control characters\",\n ),\n)\nexport type AttachmentName = typeof AttachmentName.Type\n\nexport const AttachmentDirection = Schema.Literals([\"input\", \"output\"])\nexport type AttachmentDirection = typeof AttachmentDirection.Type\n\nexport const TaskAttachment = Schema.Struct({\n name: AttachmentName,\n direction: AttachmentDirection,\n bytes: Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: maxAttachmentBytes })),\n})\nexport interface TaskAttachment extends Schema.Schema.Type<typeof TaskAttachment> {}\n\nexport const InputAttachment = Schema.Struct({\n name: AttachmentName,\n data: Schema.String.check(\n Schema.isMaxLength(Math.ceil(maxAttachmentBytes / 3) * 4),\n Schema.makeFilter((value) =>\n value.length > 0 &&\n value.length % 4 === 0 &&\n (value.length / 4) * 3 - (value.endsWith(\"==\") ? 2 : value.endsWith(\"=\") ? 1 : 0) <=\n maxAttachmentBytes &&\n /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(value)\n ? undefined\n : \"Expected nonempty base64 data\",\n ),\n ),\n})\nexport interface InputAttachment extends Schema.Schema.Type<typeof InputAttachment> {}\n\nconst attachments = boundedArray(InputAttachment, maxTaskAttachments).check(\n Schema.makeFilter((files) =>\n new Set(files.map((file) => file.name.normalize(\"NFC\").toLocaleLowerCase(\"en-US\"))).size ===\n files.length\n ? undefined\n : \"Attachment names must be unique\",\n ),\n)\n\nconst validBotTarget = (input: {\n readonly provider?: Provider\n readonly botId?: BotId\n readonly workspace?: string\n}) => {\n const provider = input.provider ?? (input.botId === undefined ? \"codex\" : \"grok-bot\")\n if (provider === \"grok-bot\" && input.workspace !== undefined) {\n return \"Grok Bots use their own computer context; omit workspace\"\n }\n return (provider === \"grok-bot\") === (input.botId !== undefined)\n ? undefined\n : \"The grok-bot provider requires botId; other providers cannot select a bot\"\n}\n\nexport const TaskProgressInput = Schema.Struct({\n note: bounded(maxProgressNoteBytes)\n .check(\n Schema.makeFilter((value) =>\n value.trim().length > 0 &&\n new TextEncoder().encode(value).byteLength <= maxProgressNoteBytes\n ? undefined\n : `Expected a nonblank progress note of at most ${maxProgressNoteBytes} UTF-8 bytes`,\n ),\n )\n .pipe(Schema.brand(\"TaskProgressNote\")),\n})\nexport interface TaskProgressInput extends Schema.Schema.Type<typeof TaskProgressInput> {}\n\nexport const TaskProgress = Schema.Struct({ ...TaskProgressInput.fields, at: Timestamp })\nexport interface TaskProgress extends Schema.Schema.Type<typeof TaskProgress> {}\n\nexport const maxClarificationBytes = 4096\nexport const maxTaskClarifications = 10\nconst clarificationText = bounded(maxClarificationBytes)\n .check(\n Schema.makeFilter((value) =>\n value.trim().length > 0 && new TextEncoder().encode(value).byteLength <= maxClarificationBytes\n ? undefined\n : `Expected nonblank text of at most ${maxClarificationBytes} UTF-8 bytes`,\n ),\n )\n .pipe(Schema.brand(\"ClarificationText\"))\n\nexport const RequestTaskInput = Schema.Struct({ runId: TaskRunId, question: clarificationText })\nexport interface RequestTaskInput extends Schema.Schema.Type<typeof RequestTaskInput> {}\nexport const AnswerTaskInput = Schema.Struct({\n requestId: ClarificationId,\n answer: clarificationText,\n})\nexport interface AnswerTaskInput extends Schema.Schema.Type<typeof AnswerTaskInput> {}\nexport const TaskClarification = Schema.Struct({\n id: ClarificationId,\n question: RequestTaskInput.fields.question,\n at: Timestamp,\n answer: Schema.optionalKey(Schema.Struct({ text: AnswerTaskInput.fields.answer, at: Timestamp })),\n})\nexport interface TaskClarification extends Schema.Schema.Type<typeof TaskClarification> {}\nconst clarifications = boundedArray(TaskClarification, maxTaskClarifications)\n\nconst validClarificationState = (task: {\n readonly status: TaskStatus\n readonly clarifications?: ReadonlyArray<TaskClarification>\n}) =>\n task.status !== \"needs_input\" ||\n (task.clarifications?.at(-1) !== undefined && task.clarifications.at(-1)?.answer === undefined)\n ? undefined\n : \"A task awaiting input must have an unanswered question\"\n\nexport const Task = Schema.Struct({\n id: TaskId,\n runId: Schema.optionalKey(TaskRunId),\n threadId: ThreadId,\n prompt: bounded(131_072),\n context: Schema.optionalKey(optionalText(131_072)),\n provider: Provider,\n botId: Schema.optionalKey(BotId),\n status: TaskStatus,\n sourceDeviceId: Schema.optionalKey(DeviceId),\n targetDeviceId: DeviceId,\n parentTaskId: Schema.optionalKey(TaskId),\n workspace: Schema.optionalKey(bounded(4096)),\n providerSessionId: Schema.optionalKey(bounded(4096)),\n result: Schema.optionalKey(optionalText(131_072)),\n inputAttachmentNames: Schema.optionalKey(boundedArray(AttachmentName, maxTaskAttachments)),\n error: Schema.optionalKey(optionalText(16_384)),\n progress: Schema.optionalKey(TaskProgress),\n clarifications: Schema.optionalKey(clarifications),\n createdAt: Timestamp,\n updatedAt: Timestamp,\n startedAt: Schema.optionalKey(Timestamp),\n completedAt: Schema.optionalKey(Timestamp),\n expiresAt: Schema.optionalKey(TaskDeadline),\n}).check(Schema.makeFilter(validBotTarget), Schema.makeFilter(validClarificationState))\nexport interface Task extends Schema.Schema.Type<typeof Task> {}\n\nexport const TaskInboxItem = Schema.Struct({\n id: TaskId,\n threadId: ThreadId,\n targetDeviceId: DeviceId,\n provider: Provider,\n botId: Schema.optionalKey(BotId),\n status: Schema.Literals([\"needs_input\", \"completed\", \"failed\", \"cancelled\"]),\n promptPreview: optionalText(320),\n resultPreview: Schema.optionalKey(optionalText(1024)),\n errorPreview: Schema.optionalKey(optionalText(1024)),\n completedAt: Schema.optionalKey(Timestamp),\n inputRequest: Schema.optionalKey(TaskClarification),\n}).check(\n Schema.makeFilter((item) =>\n item.status === \"needs_input\"\n ? item.inputRequest !== undefined &&\n item.inputRequest.answer === undefined &&\n item.completedAt === undefined\n ? undefined\n : \"An input request must have an unanswered question and no completion time\"\n : item.completedAt !== undefined && item.inputRequest === undefined\n ? undefined\n : \"A completion must have a completion time and no input request\",\n ),\n)\nexport interface TaskInboxItem extends Schema.Schema.Type<typeof TaskInboxItem> {}\n\nexport const TaskInbox = Schema.Struct({\n items: boundedArray(TaskInboxItem, 20),\n hasMore: Schema.Boolean,\n})\nexport interface TaskInbox extends Schema.Schema.Type<typeof TaskInbox> {}\n\nexport const taskSlot = (task: Pick<Task, \"provider\" | \"botId\">): string =>\n task.provider === \"grok-bot\" ? `grok-bot:${task.botId}` : \"cli\"\n\nconst upgradeVersion = Schema.String.check(\n Schema.isPattern(/^(?:latest|v?\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?)$/, {\n expected: \"latest or an exact semantic version\",\n }),\n)\n\nexport const CreateUpgradeOperationsInput = Schema.Struct({\n target: upgradeVersion,\n restart: Schema.Boolean,\n})\nexport interface CreateUpgradeOperationsInput extends Schema.Schema.Type<\n typeof CreateUpgradeOperationsInput\n> {}\n\nexport const DeviceOperation = Schema.Struct({\n id: OperationId,\n kind: Schema.Literal(\"upgrade\"),\n status: OperationStatus,\n targetDeviceId: DeviceId,\n requestedVersion: upgradeVersion,\n restart: Schema.Boolean,\n result: Schema.optionalKey(optionalText(16_384)),\n error: Schema.optionalKey(optionalText(16_384)),\n createdAt: Timestamp,\n updatedAt: Timestamp,\n completedAt: Schema.optionalKey(Timestamp),\n})\nexport interface DeviceOperation extends Schema.Schema.Type<typeof DeviceOperation> {}\n\nexport const TaskStatusCounts = Schema.Struct({\n queued: count,\n assigned: count,\n running: count,\n needs_input: Schema.optionalKey(count),\n cancelling: count,\n completed: count,\n failed: count,\n cancelled: count,\n})\nexport interface TaskStatusCounts extends Schema.Schema.Type<typeof TaskStatusCounts> {}\n\nexport const ProviderUsage = Schema.Struct({\n provider: Provider,\n tasks: count,\n})\nexport interface ProviderUsage extends Schema.Schema.Type<typeof ProviderUsage> {}\n\nexport const DeviceUsage = Schema.Struct({\n deviceId: DeviceId,\n deviceName: bounded(128),\n tasks: count,\n byStatus: TaskStatusCounts,\n byProvider: boundedArray(ProviderUsage, Provider.literals.length),\n})\nexport interface DeviceUsage extends Schema.Schema.Type<typeof DeviceUsage> {}\n\nexport const UsageSummary = Schema.Struct({\n retainedTasks: count,\n byStatus: TaskStatusCounts,\n byProvider: boundedArray(ProviderUsage, Provider.literals.length),\n devices: Schema.Array(DeviceUsage),\n})\nexport interface UsageSummary extends Schema.Schema.Type<typeof UsageSummary> {}\n\nexport const TaskTraceEvent = Schema.Struct({\n kind: TaskTraceEventKind,\n at: Timestamp,\n detail: Schema.optionalKey(optionalText(512)),\n})\nexport interface TaskTraceEvent extends Schema.Schema.Type<typeof TaskTraceEvent> {}\n\nexport const TaskTrace = Schema.Struct({\n taskId: TaskId,\n threadId: ThreadId,\n status: TaskStatus,\n provider: Provider,\n botId: Schema.optionalKey(BotId),\n sourceDeviceId: Schema.optionalKey(DeviceId),\n targetDevice: Device,\n parentTaskId: Schema.optionalKey(TaskId),\n workspace: Schema.optionalKey(bounded(4096)),\n createdAt: Timestamp,\n updatedAt: Timestamp,\n startedAt: Schema.optionalKey(Timestamp),\n completedAt: Schema.optionalKey(Timestamp),\n expiresAt: Schema.optionalKey(TaskDeadline),\n events: boundedArray(TaskTraceEvent, 100),\n truncated: Schema.Boolean,\n error: Schema.optionalKey(optionalText(16_384)),\n progress: Schema.optionalKey(TaskProgress),\n clarifications: Schema.optionalKey(clarifications),\n}).check(Schema.makeFilter(validBotTarget), Schema.makeFilter(validClarificationState))\nexport interface TaskTrace extends Schema.Schema.Type<typeof TaskTrace> {}\n\nexport const ThreadContext = Schema.Struct({\n thread: Thread,\n messages: boundedArray(Message, 20),\n tasks: boundedArray(Task, 20),\n truncated: Schema.Boolean,\n})\nexport interface ThreadContext extends Schema.Schema.Type<typeof ThreadContext> {}\n\nexport const CreateTaskInput = Schema.Struct({\n requestId: Schema.optionalKey(TaskRequestId),\n threadId: Schema.optionalKey(ThreadId),\n title: Schema.optionalKey(bounded(256)),\n prompt: bounded(131_072),\n context: Schema.optionalKey(optionalText(131_072)),\n provider: Schema.optionalKey(Provider),\n botId: Schema.optionalKey(BotId),\n targetDeviceId: Schema.optionalKey(DeviceId),\n parentTaskId: Schema.optionalKey(TaskId),\n expiresAt: Schema.optionalKey(TaskDeadline),\n workspace: Schema.optionalKey(bounded(4096)),\n attachments: Schema.optionalKey(attachments),\n}).check(Schema.makeFilter(validBotTarget))\nexport interface CreateTaskInput extends Schema.Schema.Type<typeof CreateTaskInput> {}\n\nexport const SocketEvent = Schema.TaggedUnion({\n Authenticate: {\n token: bounded(maxAuthTokenBytes).check(\n Schema.makeFilter((token) =>\n new TextEncoder().encode(token).byteLength <= maxAuthTokenBytes\n ? undefined\n : `Authentication token exceeds ${maxAuthTokenBytes} UTF-8 bytes`,\n ),\n ),\n },\n Connected: {\n serverVersion: bounded(32),\n connectedAt: Timestamp,\n taskAttachments: Schema.optionalKey(Schema.Boolean),\n taskClarification: Schema.optionalKey(Schema.Boolean),\n taskDeadlines: Schema.optionalKey(Schema.Boolean),\n },\n DeviceHello: { device: Device },\n DeviceHeartbeat: {\n deviceId: DeviceId,\n status: DeviceStatus,\n bots: Schema.optionalKey(boundedArray(Bot, 256)),\n },\n TaskAssigned: { task: Task },\n TaskAccepted: { taskId: TaskId, runId: Schema.optionalKey(TaskRunId) },\n TaskFinished: {\n taskId: TaskId,\n runId: Schema.optionalKey(TaskRunId),\n result: optionalText(131_072),\n attachments: Schema.optionalKey(attachments),\n providerSessionId: Schema.optionalKey(bounded(4096)),\n },\n TaskInputRequested: {\n taskId: TaskId,\n ...RequestTaskInput.fields,\n },\n TaskFailed: { taskId: TaskId, runId: Schema.optionalKey(TaskRunId), error: bounded(16_384) },\n TaskCancelled: { taskId: TaskId, runId: Schema.optionalKey(TaskRunId) },\n TaskSettled: { taskId: TaskId, runId: Schema.optionalKey(TaskRunId) },\n CancelTask: { taskId: TaskId, runId: Schema.optionalKey(TaskRunId) },\n OperationAssigned: { operation: DeviceOperation },\n OperationAccepted: { operationId: OperationId },\n OperationFinished: { operationId: OperationId, result: optionalText(16_384) },\n OperationFailed: { operationId: OperationId, error: bounded(16_384) },\n OperationSettled: { operationId: OperationId },\n Error: { code: bounded(64), message: bounded(2048) },\n})\nexport type SocketEvent = typeof SocketEvent.Type\n\nexport const ErrorResponse = Schema.Struct({\n error: bounded(2048),\n})\nexport interface ErrorResponse extends Schema.Schema.Type<typeof ErrorResponse> {}\n\nexport const terminalTaskStatuses: ReadonlySet<TaskStatus> = new Set([\n \"completed\",\n \"failed\",\n \"cancelled\",\n])\nexport const isTerminalTask = (task: Task): boolean => terminalTaskStatuses.has(task.status)\nexport const now = (): Timestamp => Timestamp.make(new Date().toISOString())\nexport const makeDeviceId = (): DeviceId => DeviceId.make(crypto.randomUUID())\nexport const makeThreadId = (): ThreadId => ThreadId.make(crypto.randomUUID())\nexport const makeMessageId = (): MessageId => MessageId.make(crypto.randomUUID())\nexport const makeTaskId = (): TaskId => TaskId.make(crypto.randomUUID())\nexport const makeAuthSessionId = (): AuthSessionId => AuthSessionId.make(crypto.randomUUID())\nexport const makeOperationId = (): OperationId => OperationId.make(crypto.randomUUID())\n\nexport const decodeCreatePairingInput = Schema.decodeUnknownEffect(CreatePairingInput)\nexport const decodeTaskProgressInput = Schema.decodeUnknownEffect(TaskProgressInput)\nexport const decodeRequestTaskInput = Schema.decodeUnknownEffect(RequestTaskInput)\nexport const decodeAnswerTaskInput = Schema.decodeUnknownEffect(AnswerTaskInput)\nexport const decodeExchangePairingInput = Schema.decodeUnknownEffect(ExchangePairingInput)\nexport const decodeCreateTaskInput = (input: unknown) =>\n Schema.decodeUnknownEffect(CreateTaskInput)(input).pipe(\n Effect.map(\n (task): CreateTaskInput => ({\n ...task,\n provider: task.provider ?? (task.botId === undefined ? \"codex\" : \"grok-bot\"),\n }),\n ),\n )\nexport const decodeCreateUpgradeOperationsInput = Schema.decodeUnknownEffect(\n CreateUpgradeOperationsInput,\n)\nexport const decodeDevice = Schema.decodeUnknownEffect(Device)\nexport const decodeSocketEvent = Schema.decodeUnknownEffect(SocketEvent)\n"
5
+ "import { Effect, Schema } from \"effect\"\n\nexport { version } from \"./version.ts\"\n\nexport const maxSocketPayloadBytes = 1024 * 1024\nexport const maxAuthTokenBytes = 512\nexport const maxAttachmentBytes = 256 * 1024\nexport const maxTaskAttachments = 2\nexport const maxProgressNoteBytes = 1024\n\nconst bounded = (maxLength: number) =>\n Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(maxLength))\nconst optionalText = (maxLength: number) => Schema.String.check(Schema.isMaxLength(maxLength))\nconst boundedArray = <S extends Schema.Top>(schema: S, maxLength: number) =>\n Schema.Array(schema).check(Schema.isMaxLength(maxLength))\nconst count = Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER }))\n\nexport const assertOwnerToken = (token: string): void => {\n if (token.length < 32) {\n throw new Error(\"The Cohall relay owner token must be at least 32 characters\")\n }\n if (new TextEncoder().encode(token).byteLength > maxAuthTokenBytes) {\n throw new Error(`The Cohall relay owner token must be at most ${maxAuthTokenBytes} UTF-8 bytes`)\n }\n if (token.trim() !== token || !/^[\\t\\x20-\\x7e\\x80-\\xff]+$/.test(token)) {\n throw new Error(\n \"The Cohall relay owner token must fit an HTTP header without leading or trailing whitespace\",\n )\n }\n}\n\nconst uuid = <Name extends string>(name: Name) =>\n Schema.String.check(Schema.isUUID(4)).pipe(Schema.brand(name))\nconst isoTimestamp = <Name extends string>(name: Name) =>\n Schema.String.check(\n Schema.isPattern(/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?Z$/, {\n expected: \"an ISO-8601 UTC timestamp\",\n }),\n ).pipe(Schema.brand(name))\n\nexport const BotId = bounded(256).pipe(Schema.brand(\"BotId\"))\nexport type BotId = typeof BotId.Type\n\nexport const Bot = Schema.Struct({\n id: BotId,\n name: bounded(128),\n description: Schema.optionalKey(optionalText(512)),\n})\nexport interface Bot extends Schema.Schema.Type<typeof Bot> {}\n\nexport const DeviceId = uuid(\"DeviceId\")\nexport type DeviceId = typeof DeviceId.Type\nexport const ThreadId = uuid(\"ThreadId\")\nexport type ThreadId = typeof ThreadId.Type\nexport const MessageId = uuid(\"MessageId\")\nexport type MessageId = typeof MessageId.Type\nexport const TaskId = uuid(\"TaskId\")\nexport type TaskId = typeof TaskId.Type\nexport const TaskRequestId = uuid(\"TaskRequestId\")\nexport type TaskRequestId = typeof TaskRequestId.Type\nexport const TaskRunId = uuid(\"TaskRunId\")\nexport type TaskRunId = typeof TaskRunId.Type\nexport const ClarificationId = uuid(\"ClarificationId\")\nexport type ClarificationId = typeof ClarificationId.Type\nexport const AuthSessionId = uuid(\"AuthSessionId\")\nexport type AuthSessionId = typeof AuthSessionId.Type\nexport const OperationId = uuid(\"OperationId\")\nexport type OperationId = typeof OperationId.Type\nexport const Timestamp = isoTimestamp(\"Timestamp\")\nexport type Timestamp = typeof Timestamp.Type\n\nexport const TaskDeadline = Timestamp.check(\n Schema.makeFilter((value) => {\n const time = Date.parse(value)\n return Number.isFinite(time) && new Date(time).toISOString().slice(0, 19) === value.slice(0, 19)\n ? undefined\n : \"Expected a valid ISO-8601 UTC deadline\"\n }),\n)\nexport const taskDeadlineError = \"Task deadline exceeded\"\nexport const taskDeadlinePassed = (task: { readonly expiresAt?: Timestamp }, time = Date.now()) =>\n task.expiresAt !== undefined && Date.parse(task.expiresAt) <= time\n\nexport const Platform = Schema.Literals([\"darwin\", \"linux\", \"windows\", \"unknown\"])\nexport type Platform = typeof Platform.Type\nexport const Provider = Schema.Literals([\"codex\", \"claude-code\", \"opencode\", \"grok-bot\"])\nexport type Provider = typeof Provider.Type\nexport const DeviceStatus = Schema.Literals([\"online\", \"busy\", \"offline\"])\nexport type DeviceStatus = typeof DeviceStatus.Type\nexport const TaskStatus = Schema.Literals([\n \"queued\",\n \"assigned\",\n \"running\",\n \"needs_input\",\n \"cancelling\",\n \"completed\",\n \"failed\",\n \"cancelled\",\n])\nexport type TaskStatus = typeof TaskStatus.Type\nexport const OperationStatus = Schema.Literals([\n \"queued\",\n \"assigned\",\n \"running\",\n \"completed\",\n \"failed\",\n])\nexport type OperationStatus = typeof OperationStatus.Type\nexport const TaskTraceEventKind = Schema.Literals([\n ...TaskStatus.literals,\n \"requeued\",\n \"input_requested\",\n \"input_answered\",\n])\nexport type TaskTraceEventKind = typeof TaskTraceEventKind.Type\nexport const MessageRole = Schema.Literals([\"human\", \"agent\", \"system\"])\nexport type MessageRole = typeof MessageRole.Type\nexport const ConnectionRole = Schema.Literals([\"client\", \"device\"])\nexport type ConnectionRole = typeof ConnectionRole.Type\n\nexport const AuthSession = Schema.Struct({\n id: AuthSessionId,\n label: bounded(128),\n role: ConnectionRole,\n createdAt: Timestamp,\n expiresAt: Timestamp,\n lastSeenAt: Timestamp,\n deviceId: Schema.optionalKey(DeviceId),\n revokedAt: Schema.optionalKey(Timestamp),\n})\nexport interface AuthSession extends Schema.Schema.Type<typeof AuthSession> {}\n\nexport const CreatePairingInput = Schema.Struct({\n label: bounded(128),\n roles: boundedArray(ConnectionRole, 2),\n})\nexport interface CreatePairingInput extends Schema.Schema.Type<typeof CreatePairingInput> {}\n\nexport const PairingCredential = Schema.Struct({\n token: bounded(256),\n expiresAt: Timestamp,\n})\nexport interface PairingCredential extends Schema.Schema.Type<typeof PairingCredential> {}\n\nexport const ExchangePairingInput = Schema.Struct({\n token: bounded(256),\n})\nexport interface ExchangePairingInput extends Schema.Schema.Type<typeof ExchangePairingInput> {}\n\nexport const SessionCredential = Schema.Struct({\n token: bounded(256),\n session: AuthSession,\n})\nexport interface SessionCredential extends Schema.Schema.Type<typeof SessionCredential> {}\n\nexport const PairingResult = Schema.Struct({\n credentials: boundedArray(SessionCredential, 2),\n})\nexport interface PairingResult extends Schema.Schema.Type<typeof PairingResult> {}\n\nexport const Capability = Schema.Struct({\n id: bounded(64),\n label: bounded(128),\n detail: Schema.optionalKey(optionalText(512)),\n})\nexport interface Capability extends Schema.Schema.Type<typeof Capability> {}\n\nexport const Workspace = Schema.Struct({\n path: bounded(4096),\n label: bounded(256),\n})\nexport interface Workspace extends Schema.Schema.Type<typeof Workspace> {}\n\nexport const Device = Schema.Struct({\n id: DeviceId,\n name: bounded(128),\n description: Schema.optionalKey(optionalText(512)),\n hostname: bounded(256),\n platform: Platform,\n architecture: bounded(64),\n status: DeviceStatus,\n providers: boundedArray(Provider, Provider.literals.length),\n bots: Schema.optionalKey(boundedArray(Bot, 256)),\n capabilities: boundedArray(Capability, 64),\n workspaces: boundedArray(Workspace, 64),\n version: bounded(32),\n lastSeenAt: Timestamp,\n connectedAt: Schema.optionalKey(Timestamp),\n queue: Schema.optionalKey(\n Schema.Struct({\n queued: count,\n oldestQueuedAt: Schema.optionalKey(Timestamp),\n }),\n ),\n})\nexport interface Device extends Schema.Schema.Type<typeof Device> {}\n\nexport const DeviceOverview = Schema.Struct({\n id: Device.fields.id,\n name: Device.fields.name,\n description: Device.fields.description,\n status: Device.fields.status,\n version: Device.fields.version,\n lastSeenAt: Device.fields.lastSeenAt,\n queued: count,\n active: count,\n needsInput: count,\n cancelling: count,\n oldestQueuedAt: Schema.optionalKey(Timestamp),\n})\nexport interface DeviceOverview extends Schema.Schema.Type<typeof DeviceOverview> {}\n\nexport const maxDevicePageDevices = 16\nexport const maxDevicePageResponseBytes = 3 * 1024 * 1024\nexport const DevicePage = Schema.Struct({\n devices: boundedArray(Device, maxDevicePageDevices),\n nextCursor: Schema.optionalKey(DeviceId),\n}).check(\n Schema.makeFilter((page) => {\n let previous: DeviceId | undefined\n for (const device of page.devices) {\n if (previous !== undefined && device.id <= previous)\n return \"Device pages must be ordered by ID\"\n previous = device.id\n }\n return page.nextCursor === undefined || page.nextCursor === previous\n ? undefined\n : \"The next cursor must be the last device ID\"\n }),\n)\nexport interface DevicePage extends Schema.Schema.Type<typeof DevicePage> {}\n\nexport const minimumDeviceOperationVersion = \"0.5.0\"\n\nconst parsedVersion = (value: string): readonly [number, number, number, boolean] | undefined => {\n const match = /^v?(\\d+)\\.(\\d+)\\.(\\d+)(-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/.exec(value)\n if (match === null) {\n return undefined\n }\n const core = match.slice(1, 4).map(Number)\n if (core.length !== 3 || core.some((part) => !Number.isSafeInteger(part))) {\n return undefined\n }\n return [core[0] ?? 0, core[1] ?? 0, core[2] ?? 0, match[4] !== undefined]\n}\n\nexport const supportsDeviceOperations = (candidate: string): boolean => {\n if (candidate === \"0.0.0-development\") {\n return true\n }\n const current = parsedVersion(candidate)\n const minimum = parsedVersion(minimumDeviceOperationVersion)\n if (current === undefined || minimum === undefined) {\n return false\n }\n for (let index = 0; index < 3; index += 1) {\n if (current[index] !== minimum[index]) {\n return (current[index] ?? 0) > (minimum[index] ?? 0)\n }\n }\n return !current[3]\n}\n\nexport const assertDeviceOperationSupport = (\n devices: ReadonlyArray<{ readonly name: string; readonly version: string }>,\n): void => {\n const unsupported = devices.filter((device) => !supportsDeviceOperations(device.version))\n if (unsupported.length === 0) {\n return\n }\n throw new Error(\n `All-device upgrades require Cohall ${minimumDeviceOperationVersion} or newer on every device. Upgrade individually first: ${unsupported.map((device) => `${device.name} (${device.version})`).join(\", \")}`,\n )\n}\n\nexport const Thread = Schema.Struct({\n id: ThreadId,\n title: bounded(256),\n createdAt: Timestamp,\n updatedAt: Timestamp,\n defaultDeviceId: Schema.optionalKey(DeviceId),\n})\nexport interface Thread extends Schema.Schema.Type<typeof Thread> {}\n\nexport const Message = Schema.Struct({\n id: MessageId,\n threadId: ThreadId,\n role: MessageRole,\n authorName: bounded(128),\n content: optionalText(131_072),\n createdAt: Timestamp,\n taskId: Schema.optionalKey(TaskId),\n deviceId: Schema.optionalKey(DeviceId),\n})\nexport interface Message extends Schema.Schema.Type<typeof Message> {}\n\nexport const AttachmentName = Schema.String.check(\n Schema.isMinLength(1),\n Schema.isMaxLength(128),\n Schema.makeFilter((name) =>\n name !== \".\" &&\n name !== \"..\" &&\n !/[<>:\"/\\\\|?*]/.test(name) &&\n !/[. ]$/.test(name) &&\n !/^(?:CON|PRN|AUX|NUL|CONIN\\$|CONOUT\\$|COM[1-9¹²³]|LPT[1-9¹²³])(?:\\.|$)/i.test(name) &&\n new TextEncoder().encode(name).byteLength <= 128 &&\n [...name].every((character) => character.charCodeAt(0) >= 32 && character.charCodeAt(0) !== 127)\n ? undefined\n : \"Use a file name without path separators or control characters\",\n ),\n)\nexport type AttachmentName = typeof AttachmentName.Type\n\nexport const AttachmentDirection = Schema.Literals([\"input\", \"output\"])\nexport type AttachmentDirection = typeof AttachmentDirection.Type\n\nexport const TaskAttachment = Schema.Struct({\n name: AttachmentName,\n direction: AttachmentDirection,\n bytes: Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: maxAttachmentBytes })),\n})\nexport interface TaskAttachment extends Schema.Schema.Type<typeof TaskAttachment> {}\n\nexport const InputAttachment = Schema.Struct({\n name: AttachmentName,\n data: Schema.String.check(\n Schema.isMaxLength(Math.ceil(maxAttachmentBytes / 3) * 4),\n Schema.makeFilter((value) =>\n value.length > 0 &&\n value.length % 4 === 0 &&\n (value.length / 4) * 3 - (value.endsWith(\"==\") ? 2 : value.endsWith(\"=\") ? 1 : 0) <=\n maxAttachmentBytes &&\n /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(value)\n ? undefined\n : \"Expected nonempty base64 data\",\n ),\n ),\n})\nexport interface InputAttachment extends Schema.Schema.Type<typeof InputAttachment> {}\n\nconst attachments = boundedArray(InputAttachment, maxTaskAttachments).check(\n Schema.makeFilter((files) =>\n new Set(files.map((file) => file.name.normalize(\"NFC\").toLocaleLowerCase(\"en-US\"))).size ===\n files.length\n ? undefined\n : \"Attachment names must be unique\",\n ),\n)\n\nconst validBotTarget = (input: {\n readonly provider?: Provider\n readonly botId?: BotId\n readonly workspace?: string\n}) => {\n const provider = input.provider ?? (input.botId === undefined ? \"codex\" : \"grok-bot\")\n if (provider === \"grok-bot\" && input.workspace !== undefined) {\n return \"Grok Bots use their own computer context; omit workspace\"\n }\n return (provider === \"grok-bot\") === (input.botId !== undefined)\n ? undefined\n : \"The grok-bot provider requires botId; other providers cannot select a bot\"\n}\n\nexport const TaskProgressInput = Schema.Struct({\n note: bounded(maxProgressNoteBytes)\n .check(\n Schema.makeFilter((value) =>\n value.trim().length > 0 &&\n new TextEncoder().encode(value).byteLength <= maxProgressNoteBytes\n ? undefined\n : `Expected a nonblank progress note of at most ${maxProgressNoteBytes} UTF-8 bytes`,\n ),\n )\n .pipe(Schema.brand(\"TaskProgressNote\")),\n})\nexport interface TaskProgressInput extends Schema.Schema.Type<typeof TaskProgressInput> {}\n\nexport const TaskProgress = Schema.Struct({ ...TaskProgressInput.fields, at: Timestamp })\nexport interface TaskProgress extends Schema.Schema.Type<typeof TaskProgress> {}\n\nexport const maxClarificationBytes = 4096\nexport const maxTaskClarifications = 10\nconst clarificationText = bounded(maxClarificationBytes)\n .check(\n Schema.makeFilter((value) =>\n value.trim().length > 0 && new TextEncoder().encode(value).byteLength <= maxClarificationBytes\n ? undefined\n : `Expected nonblank text of at most ${maxClarificationBytes} UTF-8 bytes`,\n ),\n )\n .pipe(Schema.brand(\"ClarificationText\"))\n\nexport const RequestTaskInput = Schema.Struct({ runId: TaskRunId, question: clarificationText })\nexport interface RequestTaskInput extends Schema.Schema.Type<typeof RequestTaskInput> {}\nexport const AnswerTaskInput = Schema.Struct({\n requestId: ClarificationId,\n answer: clarificationText,\n})\nexport interface AnswerTaskInput extends Schema.Schema.Type<typeof AnswerTaskInput> {}\nexport const TaskClarification = Schema.Struct({\n id: ClarificationId,\n question: RequestTaskInput.fields.question,\n at: Timestamp,\n answer: Schema.optionalKey(Schema.Struct({ text: AnswerTaskInput.fields.answer, at: Timestamp })),\n})\nexport interface TaskClarification extends Schema.Schema.Type<typeof TaskClarification> {}\nconst clarifications = boundedArray(TaskClarification, maxTaskClarifications)\n\nconst validClarificationState = (task: {\n readonly status: TaskStatus\n readonly clarifications?: ReadonlyArray<TaskClarification>\n}) =>\n task.status !== \"needs_input\" ||\n (task.clarifications?.at(-1) !== undefined && task.clarifications.at(-1)?.answer === undefined)\n ? undefined\n : \"A task awaiting input must have an unanswered question\"\n\nexport const Task = Schema.Struct({\n id: TaskId,\n runId: Schema.optionalKey(TaskRunId),\n threadId: ThreadId,\n prompt: bounded(131_072),\n context: Schema.optionalKey(optionalText(131_072)),\n provider: Provider,\n botId: Schema.optionalKey(BotId),\n status: TaskStatus,\n sourceDeviceId: Schema.optionalKey(DeviceId),\n targetDeviceId: DeviceId,\n parentTaskId: Schema.optionalKey(TaskId),\n workspace: Schema.optionalKey(bounded(4096)),\n providerSessionId: Schema.optionalKey(bounded(4096)),\n result: Schema.optionalKey(optionalText(131_072)),\n inputAttachmentNames: Schema.optionalKey(boundedArray(AttachmentName, maxTaskAttachments)),\n error: Schema.optionalKey(optionalText(16_384)),\n progress: Schema.optionalKey(TaskProgress),\n clarifications: Schema.optionalKey(clarifications),\n createdAt: Timestamp,\n updatedAt: Timestamp,\n startedAt: Schema.optionalKey(Timestamp),\n completedAt: Schema.optionalKey(Timestamp),\n expiresAt: Schema.optionalKey(TaskDeadline),\n}).check(Schema.makeFilter(validBotTarget), Schema.makeFilter(validClarificationState))\nexport interface Task extends Schema.Schema.Type<typeof Task> {}\n\nexport const TaskInboxItem = Schema.Struct({\n id: TaskId,\n threadId: ThreadId,\n targetDeviceId: DeviceId,\n provider: Provider,\n botId: Schema.optionalKey(BotId),\n status: Schema.Literals([\"needs_input\", \"completed\", \"failed\", \"cancelled\"]),\n promptPreview: optionalText(320),\n resultPreview: Schema.optionalKey(optionalText(1024)),\n errorPreview: Schema.optionalKey(optionalText(1024)),\n completedAt: Schema.optionalKey(Timestamp),\n inputRequest: Schema.optionalKey(TaskClarification),\n}).check(\n Schema.makeFilter((item) =>\n item.status === \"needs_input\"\n ? item.inputRequest !== undefined &&\n item.inputRequest.answer === undefined &&\n item.completedAt === undefined\n ? undefined\n : \"An input request must have an unanswered question and no completion time\"\n : item.completedAt !== undefined && item.inputRequest === undefined\n ? undefined\n : \"A completion must have a completion time and no input request\",\n ),\n)\nexport interface TaskInboxItem extends Schema.Schema.Type<typeof TaskInboxItem> {}\n\nexport const TaskInbox = Schema.Struct({\n items: boundedArray(TaskInboxItem, 20),\n hasMore: Schema.Boolean,\n})\nexport interface TaskInbox extends Schema.Schema.Type<typeof TaskInbox> {}\n\nexport const taskSlot = (task: Pick<Task, \"provider\" | \"botId\">): string =>\n task.provider === \"grok-bot\" ? `grok-bot:${task.botId}` : \"cli\"\n\nconst upgradeVersion = Schema.String.check(\n Schema.isPattern(/^(?:latest|v?\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?)$/, {\n expected: \"latest or an exact semantic version\",\n }),\n)\n\nexport const CreateUpgradeOperationsInput = Schema.Struct({\n target: upgradeVersion,\n restart: Schema.Boolean,\n})\nexport interface CreateUpgradeOperationsInput extends Schema.Schema.Type<\n typeof CreateUpgradeOperationsInput\n> {}\n\nexport const DeviceOperation = Schema.Struct({\n id: OperationId,\n kind: Schema.Literal(\"upgrade\"),\n status: OperationStatus,\n targetDeviceId: DeviceId,\n requestedVersion: upgradeVersion,\n restart: Schema.Boolean,\n result: Schema.optionalKey(optionalText(16_384)),\n error: Schema.optionalKey(optionalText(16_384)),\n createdAt: Timestamp,\n updatedAt: Timestamp,\n completedAt: Schema.optionalKey(Timestamp),\n})\nexport interface DeviceOperation extends Schema.Schema.Type<typeof DeviceOperation> {}\n\nexport const TaskStatusCounts = Schema.Struct({\n queued: count,\n assigned: count,\n running: count,\n needs_input: Schema.optionalKey(count),\n cancelling: count,\n completed: count,\n failed: count,\n cancelled: count,\n})\nexport interface TaskStatusCounts extends Schema.Schema.Type<typeof TaskStatusCounts> {}\n\nexport const ProviderUsage = Schema.Struct({\n provider: Provider,\n tasks: count,\n})\nexport interface ProviderUsage extends Schema.Schema.Type<typeof ProviderUsage> {}\n\nexport const DeviceUsage = Schema.Struct({\n deviceId: DeviceId,\n deviceName: bounded(128),\n tasks: count,\n byStatus: TaskStatusCounts,\n byProvider: boundedArray(ProviderUsage, Provider.literals.length),\n})\nexport interface DeviceUsage extends Schema.Schema.Type<typeof DeviceUsage> {}\n\nexport const UsageSummary = Schema.Struct({\n retainedTasks: count,\n byStatus: TaskStatusCounts,\n byProvider: boundedArray(ProviderUsage, Provider.literals.length),\n devices: Schema.Array(DeviceUsage),\n})\nexport interface UsageSummary extends Schema.Schema.Type<typeof UsageSummary> {}\n\nexport const TaskTraceEvent = Schema.Struct({\n kind: TaskTraceEventKind,\n at: Timestamp,\n detail: Schema.optionalKey(optionalText(512)),\n})\nexport interface TaskTraceEvent extends Schema.Schema.Type<typeof TaskTraceEvent> {}\n\nexport const TaskTrace = Schema.Struct({\n taskId: TaskId,\n threadId: ThreadId,\n status: TaskStatus,\n provider: Provider,\n botId: Schema.optionalKey(BotId),\n sourceDeviceId: Schema.optionalKey(DeviceId),\n targetDevice: Device,\n parentTaskId: Schema.optionalKey(TaskId),\n workspace: Schema.optionalKey(bounded(4096)),\n createdAt: Timestamp,\n updatedAt: Timestamp,\n startedAt: Schema.optionalKey(Timestamp),\n completedAt: Schema.optionalKey(Timestamp),\n expiresAt: Schema.optionalKey(TaskDeadline),\n events: boundedArray(TaskTraceEvent, 100),\n truncated: Schema.Boolean,\n error: Schema.optionalKey(optionalText(16_384)),\n progress: Schema.optionalKey(TaskProgress),\n clarifications: Schema.optionalKey(clarifications),\n}).check(Schema.makeFilter(validBotTarget), Schema.makeFilter(validClarificationState))\nexport interface TaskTrace extends Schema.Schema.Type<typeof TaskTrace> {}\n\nexport const ThreadContext = Schema.Struct({\n thread: Thread,\n messages: boundedArray(Message, 20),\n tasks: boundedArray(Task, 20),\n truncated: Schema.Boolean,\n})\nexport interface ThreadContext extends Schema.Schema.Type<typeof ThreadContext> {}\n\nexport const CreateTaskInput = Schema.Struct({\n requestId: Schema.optionalKey(TaskRequestId),\n threadId: Schema.optionalKey(ThreadId),\n title: Schema.optionalKey(bounded(256)),\n prompt: bounded(131_072),\n context: Schema.optionalKey(optionalText(131_072)),\n provider: Schema.optionalKey(Provider),\n botId: Schema.optionalKey(BotId),\n targetDeviceId: Schema.optionalKey(DeviceId),\n parentTaskId: Schema.optionalKey(TaskId),\n expiresAt: Schema.optionalKey(TaskDeadline),\n workspace: Schema.optionalKey(bounded(4096)),\n attachments: Schema.optionalKey(attachments),\n}).check(Schema.makeFilter(validBotTarget))\nexport interface CreateTaskInput extends Schema.Schema.Type<typeof CreateTaskInput> {}\n\nexport const SocketEvent = Schema.TaggedUnion({\n Authenticate: {\n token: bounded(maxAuthTokenBytes).check(\n Schema.makeFilter((token) =>\n new TextEncoder().encode(token).byteLength <= maxAuthTokenBytes\n ? undefined\n : `Authentication token exceeds ${maxAuthTokenBytes} UTF-8 bytes`,\n ),\n ),\n },\n Connected: {\n serverVersion: bounded(32),\n connectedAt: Timestamp,\n taskAttachments: Schema.optionalKey(Schema.Boolean),\n taskClarification: Schema.optionalKey(Schema.Boolean),\n taskDeadlines: Schema.optionalKey(Schema.Boolean),\n },\n DeviceHello: { device: Device },\n DeviceHeartbeat: {\n deviceId: DeviceId,\n status: DeviceStatus,\n bots: Schema.optionalKey(boundedArray(Bot, 256)),\n },\n TaskAssigned: { task: Task },\n TaskAccepted: { taskId: TaskId, runId: Schema.optionalKey(TaskRunId) },\n TaskFinished: {\n taskId: TaskId,\n runId: Schema.optionalKey(TaskRunId),\n result: optionalText(131_072),\n attachments: Schema.optionalKey(attachments),\n providerSessionId: Schema.optionalKey(bounded(4096)),\n },\n TaskInputRequested: {\n taskId: TaskId,\n ...RequestTaskInput.fields,\n },\n TaskFailed: { taskId: TaskId, runId: Schema.optionalKey(TaskRunId), error: bounded(16_384) },\n TaskCancelled: { taskId: TaskId, runId: Schema.optionalKey(TaskRunId) },\n TaskSettled: { taskId: TaskId, runId: Schema.optionalKey(TaskRunId) },\n CancelTask: { taskId: TaskId, runId: Schema.optionalKey(TaskRunId) },\n OperationAssigned: { operation: DeviceOperation },\n OperationAccepted: { operationId: OperationId },\n OperationFinished: { operationId: OperationId, result: optionalText(16_384) },\n OperationFailed: { operationId: OperationId, error: bounded(16_384) },\n OperationSettled: { operationId: OperationId },\n Error: { code: bounded(64), message: bounded(2048) },\n})\nexport type SocketEvent = typeof SocketEvent.Type\n\nexport const ErrorResponse = Schema.Struct({\n error: bounded(2048),\n})\nexport interface ErrorResponse extends Schema.Schema.Type<typeof ErrorResponse> {}\n\nexport const terminalTaskStatuses: ReadonlySet<TaskStatus> = new Set([\n \"completed\",\n \"failed\",\n \"cancelled\",\n])\nexport const isTerminalTask = (task: Task): boolean => terminalTaskStatuses.has(task.status)\nexport const now = (): Timestamp => Timestamp.make(new Date().toISOString())\nexport const makeDeviceId = (): DeviceId => DeviceId.make(crypto.randomUUID())\nexport const makeThreadId = (): ThreadId => ThreadId.make(crypto.randomUUID())\nexport const makeMessageId = (): MessageId => MessageId.make(crypto.randomUUID())\nexport const makeTaskId = (): TaskId => TaskId.make(crypto.randomUUID())\nexport const makeAuthSessionId = (): AuthSessionId => AuthSessionId.make(crypto.randomUUID())\nexport const makeOperationId = (): OperationId => OperationId.make(crypto.randomUUID())\n\nexport const decodeCreatePairingInput = Schema.decodeUnknownEffect(CreatePairingInput)\nexport const decodeTaskProgressInput = Schema.decodeUnknownEffect(TaskProgressInput)\nexport const decodeRequestTaskInput = Schema.decodeUnknownEffect(RequestTaskInput)\nexport const decodeAnswerTaskInput = Schema.decodeUnknownEffect(AnswerTaskInput)\nexport const decodeExchangePairingInput = Schema.decodeUnknownEffect(ExchangePairingInput)\nexport const decodeCreateTaskInput = (input: unknown) =>\n Schema.decodeUnknownEffect(CreateTaskInput)(input).pipe(\n // The relay resolves an omitted coding provider, from the thread for a follow-up.\n Effect.map(\n (task): CreateTaskInput =>\n task.provider !== undefined || task.botId === undefined\n ? task\n : { ...task, provider: \"grok-bot\" },\n ),\n )\nexport const decodeCreateUpgradeOperationsInput = Schema.decodeUnknownEffect(\n CreateUpgradeOperationsInput,\n)\nexport const decodeDevice = Schema.decodeUnknownEffect(Device)\nexport const decodeSocketEvent = Schema.decodeUnknownEffect(SocketEvent)\n"
6
6
  ],
7
- "mappings": ";AAAA;AAIO,IAAM,wBAAwB,OAAO;AACrC,IAAM,oBAAoB;AAC1B,IAAM,qBAAqB,MAAM;AACjC,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB;AAEpC,IAAM,UAAU,CAAC,cACf,OAAO,OAAO,MAAM,OAAO,YAAY,CAAC,GAAG,OAAO,YAAY,SAAS,CAAC;AAC1E,IAAM,eAAe,CAAC,cAAsB,OAAO,OAAO,MAAM,OAAO,YAAY,SAAS,CAAC;AAC7F,IAAM,eAAe,CAAuB,QAAW,cACrD,OAAO,MAAM,MAAM,EAAE,MAAM,OAAO,YAAY,SAAS,CAAC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AAE,KAAK,EAAE,KAEjD,OAAO,IACL,CAAC,SACC,KAAK,aAAa,aAAa,KAAK,UAAU,YAC1C,OACA,KAAK,MAAM,UAAU,WAAW,CACxC,CACF;AACK,IAAM,qCAAqC,OAAO,oBACvD,4BACF;AACO,IAAM,eAAe,OAAO,oBAAoB,MAAM;AACtD,IAAM,oBAAoB,OAAO,oBAAoB,WAAW;",
8
+ "debugId": "19808C785FC8AE7964756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -9,7 +9,7 @@ import {
9
9
  trustedExecutable,
10
10
  upgrade,
11
11
  writeBotReply
12
- } from "./chunk-bpnafwbg.js";
12
+ } from "./chunk-kc5awrf4.js";
13
13
  import {
14
14
  acknowledgedTaskResult,
15
15
  createDelegation,
@@ -19,14 +19,14 @@ import {
19
19
  taskResult,
20
20
  threadContext,
21
21
  waitForTask
22
- } from "./chunk-1ekexd73.js";
22
+ } from "./chunk-318jbf1v.js";
23
23
  import {
24
24
  RelayDecodeError,
25
25
  RelayRequestError,
26
26
  exchangePairing,
27
27
  exports_src,
28
28
  readInputAttachments
29
- } from "./chunk-baep7sfx.js";
29
+ } from "./chunk-wexfaech.js";
30
30
  import {
31
31
  readBoundedFile
32
32
  } from "./chunk-p493vm5f.js";
@@ -43,7 +43,7 @@ import {
43
43
  readStoredConfiguration,
44
44
  relayDataDirectory,
45
45
  writeStoredConfiguration
46
- } from "./chunk-g6b3zmtw.js";
46
+ } from "./chunk-m82xx6vz.js";
47
47
  import {
48
48
  AnswerTaskInput,
49
49
  AttachmentDirection,
@@ -66,11 +66,11 @@ import {
66
66
  assertOwnerToken,
67
67
  makeDeviceId,
68
68
  maxAuthTokenBytes
69
- } from "./chunk-04a27ybz.js";
69
+ } from "./chunk-aj2btss5.js";
70
70
  import {
71
71
  __require,
72
72
  version
73
- } from "./chunk-qbcgvhf1.js";
73
+ } from "./chunk-hg08s7y1.js";
74
74
 
75
75
  // apps/device/src/cli.ts
76
76
  import { Effect as Effect4, Schema as Schema3 } from "effect";
@@ -145,7 +145,8 @@ Do not delegate ordinary local work when the other device provides no advantage.
145
145
  \`\`\`
146
146
 
147
147
  Coding providers are \`codex\`, \`claude-code\`, and \`opencode\`. Omit \`--provider\`
148
- to use Codex on a computer; selecting a named bot infers \`grok-bot\`.
148
+ to use Codex on a computer, or the thread's provider for a follow-up;
149
+ selecting a named bot infers \`grok-bot\`.
149
150
  Omit \`--target\` only when Cohall may choose a matching computer.
150
151
 
151
152
  For a submission you may need to retry, generate and save a UUID v4 before
@@ -417,12 +418,17 @@ Read them through a hidden terminal prompt, stdin, or a private token file.
417
418
  3. Run guided setup with the confirmed address:
418
419
 
419
420
  \`\`\`bash
420
- cohall init --relay https://your-relay.example
421
+ cohall init --relay https://your-relay.example \\
422
+ --workspace "$HOME/dev" --providers codex
421
423
  \`\`\`
422
424
 
423
- A terminal prompts for the pairing token without echoing it. Scripts and
424
- agents without an interactive terminal supply it on stdin or with
425
+ Use the workspace roots and providers chosen in step 2. A terminal prompts
426
+ for omitted values and for the pairing token without echoing it. Scripts and
427
+ agents without an interactive terminal supply the token on stdin or with
425
428
  \`--token-file\`; see the [pairing examples](https://github.com/AksharP5/cohall/blob/main/docs/install.md#pair-a-machine).
429
+ Without a terminal, nothing else is prompted: a new device setup requires
430
+ \`--workspace\`, the device name defaults to the hostname, and providers to
431
+ \`auto\`.
426
432
  Client-only setup adds \`--client-only\` and uses a client-only pairing.
427
433
  \`init\` writes configuration and installs the Cohall skill for Codex,
428
434
  Claude Code, and OpenCode. It preserves existing settings during repair.
@@ -595,7 +601,11 @@ var guidedSetupInput = async (options, prompter) => {
595
601
  const hasRequiredCredentials = credentials.clientToken !== undefined && (options.clientOnly || credentials.deviceToken !== undefined);
596
602
  let workspaces = options.clientOnly ? existing?.workspaces ?? [] : options.workspaces;
597
603
  if (!options.clientOnly && workspaces.length === 0) {
598
- const root = await prompter.answer("Workspace root", existing?.workspaces[0] ?? options.cwd);
604
+ const fallback = existing?.workspaces[0] ?? options.cwd;
605
+ if (fallback === undefined) {
606
+ throw new Error("At least one --workspace is required to set up a device without a terminal");
607
+ }
608
+ const root = await prompter.answer("Workspace root", fallback);
599
609
  workspaces = existing !== undefined && root === existing.workspaces[0] ? existing.workspaces : [root];
600
610
  }
601
611
  const deviceName = options.clientOnly ? undefined : Schema.decodeUnknownSync(Device.fields.name)(options.deviceName ?? await prompter.answer("Device name", existing?.deviceName ?? hostname()));
@@ -982,6 +992,12 @@ var backupRelay = async (destinationInput) => {
982
992
  } finally {
983
993
  database.close();
984
994
  }
995
+ const copy = new DatabaseSync(databasePath);
996
+ try {
997
+ copy.exec("PRAGMA journal_mode = DELETE");
998
+ } finally {
999
+ copy.close();
1000
+ }
985
1001
  verifyDatabase(databasePath);
986
1002
  const token = await ownerToken(sourceDirectory);
987
1003
  assertOwnerToken(token);
@@ -1540,7 +1556,7 @@ var runCli = async (command, raw) => {
1540
1556
  const input = await guidedSetupInput({
1541
1557
  clientOnly,
1542
1558
  workspaces: values(arguments_, "workspace"),
1543
- cwd: process.cwd(),
1559
+ ...interactive ? { cwd: process.cwd() } : {},
1544
1560
  ...relayUrl === undefined ? {} : { relayUrl },
1545
1561
  ...tokenFile === undefined ? {} : { readToken: () => pairingToken(arguments_) },
1546
1562
  ...deviceName === undefined ? {} : { deviceName },
@@ -1804,7 +1820,8 @@ var runCli = async (command, raw) => {
1804
1820
  "[mcp_servers.cohall]",
1805
1821
  'command = "npx"',
1806
1822
  'args = ["-y", "@akshar5/cohall", "mcp"]',
1807
- 'env_vars = ["COHALL_CONFIG", "COHALL_THREAD_ID", "COHALL_TASK_ID", "COHALL_TASK_RUN_ID"]'
1823
+ 'env_vars = ["COHALL_CONFIG", "COHALL_THREAD_ID", "COHALL_TASK_ID", "COHALL_TASK_RUN_ID"]',
1824
+ "tool_timeout_sec = 960"
1808
1825
  ].join(`
1809
1826
  `),
1810
1827
  claude_mcp: "claude mcp add --transport stdio --scope user cohall -- npx -y @akshar5/cohall mcp",
@@ -1828,7 +1845,7 @@ var runCli = async (command, raw) => {
1828
1845
  print(allDeviceHealth(await Effect4.runPromise(relay2.devices()), version));
1829
1846
  return;
1830
1847
  }
1831
- const { checkMcp, readMcpHostDiagnostics } = await import("./chunk-94dpwj2b.js");
1848
+ const { checkMcp, readMcpHostDiagnostics } = await import("./chunk-6r5hdtcx.js");
1832
1849
  const configuration2 = await readStoredConfiguration();
1833
1850
  const relayUrl = normalizeRelayUrl(process.env.COHALL_RELAY_URL ?? configuration2?.relayUrl ?? "http://127.0.0.1:8787");
1834
1851
  const storedCredentials = credentialsForRelay(configuration2, relayUrl);
@@ -2169,4 +2186,4 @@ export {
2169
2186
  printSkill
2170
2187
  };
2171
2188
 
2172
- //# debugId=23B19D2F440E26EF64756E2164756E21
2189
+ //# debugId=DA9ED6E6CBA05B3364756E2164756E21