@ours.network/cowork 0.3.3 → 0.3.5

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/README.md CHANGED
@@ -9,7 +9,7 @@ ours-cowork docs
9
9
 
10
10
  `ours-cowork web` starts the daemon if it is absent, waits for the console, and opens `http://127.0.0.1:3052/`. Create a room with a friendly display name first, then add each invitation requirement from its Invite panel. Names are trimmed, normalized to Unicode NFC, and may contain 1–64 Unicode characters excluding control and format characters. Duplicate names are allowed. The Communication view contains the human-readable room chat; operational records remain in Events and the complete ordered stream remains in Archive.
11
11
 
12
- The friendly `room_name` is presentation metadata. The opaque `room_id` remains the stable key for routing, URLs, storage, and identity correlation, and the underlying technical room identity is never renamed. Rooms created before friendly names existed migrate deterministically to `Room <first 8 room_id characters>`.
12
+ The friendly `room_name` is presentation metadata. New rooms announce the technical identity `ours-cowork-room:<initial room_name>`; that authenticated announced name is frozen when the display name later changes. Duplicate display and announced names are allowed because identity CIDs, not names, are the authorization and routing keys. The opaque `room_id` remains the stable key for URLs, storage, and identity correlation. Existing `cowork-room-<room_id>` identities are never renamed or recreated, and rooms created before friendly names existed migrate only their display metadata to `Room <first 8 room_id characters>`.
13
13
 
14
14
  The localhost HTTP console has no authentication. Keep it bound to `127.0.0.1`; do not proxy, forward, or expose the port to other hosts. Room state is refreshed by periodic polling, not pushed to the browser.
15
15
 
package/dist/cli.js CHANGED
@@ -4327,6 +4327,13 @@ var RoomNameSchema = external_exports.string().refine(
4327
4327
  });
4328
4328
  }
4329
4329
  });
4330
+ var ROOM_IDENTITY_PREFIX = "ours-cowork-room:";
4331
+ function roomIdentityName(roomName) {
4332
+ return `${ROOM_IDENTITY_PREFIX}${RoomNameSchema.parse(roomName)}`;
4333
+ }
4334
+ function legacyRoomIdentityName(roomId) {
4335
+ return `cowork-room-${LowerCrockfordUlidSchema.parse(roomId)}`;
4336
+ }
4330
4337
  var RoleSchema = utf8Bounded("role", MAX_ROLE_BYTES);
4331
4338
  var MissionTextSchema = utf8Bounded("mission text", MAX_TEXT_BYTES);
4332
4339
  var MessageTextSchema = utf8Bounded("message text", MAX_TEXT_BYTES);
@@ -4471,8 +4478,9 @@ var RoleBriefingSchema = external_exports.object({
4471
4478
  updated_at: Rfc3339Schema
4472
4479
  }).strict();
4473
4480
  function refineRoomLineage(room, context) {
4474
- const pendingIdentityName = `cowork-room-${room.room_id}`;
4475
- const exactPacketPending = room.state === "provisioning" && room.status === "packet_pending" && room.identity_name === pendingIdentityName && room.invites.length === 0 && room.seats.length === 0 && room.activated_at === void 0 && room.closed_at === void 0;
4481
+ const pendingIdentityName = legacyRoomIdentityName(room.room_id);
4482
+ const currentPendingIdentityName = room.room_name === void 0 ? void 0 : roomIdentityName(room.room_name);
4483
+ const exactPacketPending = room.state === "provisioning" && room.status === "packet_pending" && (room.identity_name === pendingIdentityName || room.identity_name === currentPendingIdentityName) && room.invites.length === 0 && room.seats.length === 0 && room.activated_at === void 0 && room.closed_at === void 0;
4476
4484
  if (room.identity_cid === "" && !exactPacketPending) {
4477
4485
  context.addIssue({
4478
4486
  code: external_exports.ZodIssueCode.custom,
package/dist/daemon.js CHANGED
@@ -4796,9 +4796,16 @@ function isStrictRfc3339(value) {
4796
4796
  function normalizeRoomName(value) {
4797
4797
  return value.trim().normalize("NFC");
4798
4798
  }
4799
+ function roomIdentityName(roomName) {
4800
+ return `${ROOM_IDENTITY_PREFIX}${RoomNameSchema.parse(roomName)}`;
4801
+ }
4802
+ function legacyRoomIdentityName(roomId) {
4803
+ return `cowork-room-${LowerCrockfordUlidSchema.parse(roomId)}`;
4804
+ }
4799
4805
  function refineRoomLineage(room, context) {
4800
- const pendingIdentityName = `cowork-room-${room.room_id}`;
4801
- const exactPacketPending = room.state === "provisioning" && room.status === "packet_pending" && room.identity_name === pendingIdentityName && room.invites.length === 0 && room.seats.length === 0 && room.activated_at === void 0 && room.closed_at === void 0;
4806
+ const pendingIdentityName = legacyRoomIdentityName(room.room_id);
4807
+ const currentPendingIdentityName = room.room_name === void 0 ? void 0 : roomIdentityName(room.room_name);
4808
+ const exactPacketPending = room.state === "provisioning" && room.status === "packet_pending" && (room.identity_name === pendingIdentityName || room.identity_name === currentPendingIdentityName) && room.invites.length === 0 && room.seats.length === 0 && room.activated_at === void 0 && room.closed_at === void 0;
4802
4809
  if (room.identity_cid === "" && !exactPacketPending) {
4803
4810
  context.addIssue({
4804
4811
  code: external_exports.ZodIssueCode.custom,
@@ -4924,7 +4931,7 @@ function refineMessageCategory(message, context) {
4924
4931
  }
4925
4932
  }
4926
4933
  }
4927
- var MAX_TEXT_BYTES, MAX_FILE_BYTES, MAX_HISTORY_PAGE_BYTES, MAX_MANAGEMENT_RESPONSE_BYTES, MAX_FILE_NAME_BYTES, MAX_MIME_BYTES, MAX_ROLE_BYTES, MAX_ROOM_NAME_CHARACTERS, NonEmptyStringSchema, PositiveSafeIntegerSchema, LowerCrockfordUlidSchema, Rfc3339Schema, RoomNameSchema, RoleSchema, MissionTextSchema, MessageTextSchema, FileNameSchema, FileMimeSchema, RoomStateSchema, SeatStateSchema, InviteModeSchema, DEFAULT_ROLE, InviteStateSchema, RelayStatusSchema, SeatV1Schema, SeatSchema, RoomInviteSchema, MissionV1Schema, MissionSchema, RoleBriefingSchema, RoomCommonShape, RoomV1Schema, CurrentRoomSchema, RoomSchema, CreateRoomInputSchema, UpdateRoomInputSchema, RoleBriefingSetInputSchema, RoleBriefingDeleteInputSchema, PostMessageInputSchema, AuthorSnapshotSchema, RecordCommonShape, AppendCommonShape, MembershipNoticeSchema, AuthorAliasSchema, MessageShape, RelayIntentShape, RelayResultStatusSchema, RelayResultShape, FileShape, MembershipIntentShape, MembershipResultShape, CloseNoticeIntentShape, CloseNoticeResultShape, MessageRecordSchema, FileRecordSchema, RelayIntentRecordSchema, RelayResultRecordSchema, MembershipIntentRecordSchema, MembershipResultRecordSchema, CloseNoticeIntentRecordSchema, CloseNoticeResultRecordSchema, RawCommunicationRecordSchema, CommunicationRecordSchema, AppendRecordSchema;
4934
+ var MAX_TEXT_BYTES, MAX_FILE_BYTES, MAX_HISTORY_PAGE_BYTES, MAX_MANAGEMENT_RESPONSE_BYTES, MAX_FILE_NAME_BYTES, MAX_MIME_BYTES, MAX_ROLE_BYTES, MAX_ROOM_NAME_CHARACTERS, NonEmptyStringSchema, PositiveSafeIntegerSchema, LowerCrockfordUlidSchema, Rfc3339Schema, RoomNameSchema, ROOM_IDENTITY_PREFIX, RoleSchema, MissionTextSchema, MessageTextSchema, FileNameSchema, FileMimeSchema, RoomStateSchema, SeatStateSchema, InviteModeSchema, DEFAULT_ROLE, InviteStateSchema, RelayStatusSchema, SeatV1Schema, SeatSchema, RoomInviteSchema, MissionV1Schema, MissionSchema, RoleBriefingSchema, RoomCommonShape, RoomV1Schema, CurrentRoomSchema, RoomSchema, CreateRoomInputSchema, UpdateRoomInputSchema, RoleBriefingSetInputSchema, RoleBriefingDeleteInputSchema, PostMessageInputSchema, AuthorSnapshotSchema, RecordCommonShape, AppendCommonShape, MembershipNoticeSchema, AuthorAliasSchema, MessageShape, RelayIntentShape, RelayResultStatusSchema, RelayResultShape, FileShape, MembershipIntentShape, MembershipResultShape, CloseNoticeIntentShape, CloseNoticeResultShape, MessageRecordSchema, FileRecordSchema, RelayIntentRecordSchema, RelayResultRecordSchema, MembershipIntentRecordSchema, MembershipResultRecordSchema, CloseNoticeIntentRecordSchema, CloseNoticeResultRecordSchema, RawCommunicationRecordSchema, CommunicationRecordSchema, AppendRecordSchema;
4928
4935
  var init_contracts = __esm({
4929
4936
  "src/contracts.ts"() {
4930
4937
  "use strict";
@@ -4956,6 +4963,7 @@ var init_contracts = __esm({
4956
4963
  });
4957
4964
  }
4958
4965
  });
4966
+ ROOM_IDENTITY_PREFIX = "ours-cowork-room:";
4959
4967
  RoleSchema = utf8Bounded("role", MAX_ROLE_BYTES);
4960
4968
  MissionTextSchema = utf8Bounded("mission text", MAX_TEXT_BYTES);
4961
4969
  MessageTextSchema = utf8Bounded("message text", MAX_TEXT_BYTES);
@@ -6730,12 +6738,13 @@ var init_service = __esm({
6730
6738
  async createRoom(input) {
6731
6739
  const settings = CreateRoomInputSchema.parse(input);
6732
6740
  const roomId = LowerCrockfordUlidSchema.parse(this.nextRoomId());
6733
- const identityName = `cowork-room-${roomId}`;
6741
+ const roomName = settings.name ?? defaultRoomName(roomId);
6742
+ const identityName = roomIdentityName(roomName);
6734
6743
  return this.lock(roomId, async () => {
6735
6744
  const provisional = RoomSchema.parse({
6736
6745
  version: 2,
6737
6746
  room_id: roomId,
6738
- room_name: settings.name ?? defaultRoomName(roomId),
6747
+ room_name: roomName,
6739
6748
  identity_name: identityName,
6740
6749
  // PacketRegistry needs the durable room directory to exist first. A
6741
6750
  // valid, explicitly provisional value lets startup resume this exact
@@ -7691,7 +7700,7 @@ var init_service = __esm({
7691
7700
  }
7692
7701
  }
7693
7702
  isPacketPending(room) {
7694
- return room.identity_cid === "" && room.state === "provisioning" && room.status === "packet_pending" && room.identity_name === `cowork-room-${room.room_id}`;
7703
+ return room.identity_cid === "" && room.state === "provisioning" && room.status === "packet_pending" && (room.identity_name === legacyRoomIdentityName(room.room_id) || room.identity_name === roomIdentityName(room.room_name));
7695
7704
  }
7696
7705
  now() {
7697
7706
  return external_exports.string().datetime({ offset: true }).parse(this.nowValue());