@ours.network/cowork 1.1.2 → 1.1.4

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
@@ -15,7 +15,7 @@ The localhost HTTP console has no authentication. Keep it bound to `127.0.0.1`;
15
15
 
16
16
  The same listener describes its own room management REST API: `http://127.0.0.1:3052/openapi.json` is the OpenAPI 3.1 document and `http://127.0.0.1:3052/docs` is the browser UI for it. Both are read-only, load no remote assets, and follow the console's loopback-only exposure rules.
17
17
 
18
- Start or install the shared daemon with `@ours.network/cli` 2.7.0 before starting cowork. Cowork never embeds, starts, stops, or silently substitutes an ours daemon. It uses the SDK-standard shared selection (the default `~/.ours` daemon, `OURS_CONFIG`, or a coherent `OURS_PORT` plus `OURS_STATE_DIR` selection) and fails clearly when that daemon is unavailable or mismatched.
18
+ Start or install the shared daemon with `@ours.network/cli` 2.7.2 before starting cowork. Cowork never embeds, starts, stops, or silently substitutes an ours daemon. It uses the SDK-standard shared selection (the default `~/.ours` daemon, `OURS_CONFIG`, or a coherent `OURS_PORT` plus `OURS_STATE_DIR` selection) and fails clearly when that daemon is unavailable or mismatched.
19
19
 
20
20
  The shared daemon retains application payload history outside its protocol packets: each identity has a `history.sqlite3` database and immutable content-addressed file blobs. Cowork authorizes unread metadata by authenticated CID, reads the corresponding persistent history or blob, durably archives the room item and its complete fan-out, and only then advances that exact SDK unread item. There is no packet-inbox fallback, defer queue, host outbox, or cross-store transaction.
21
21
 
package/dist/cli.js CHANGED
@@ -4061,6 +4061,37 @@ var coerce = {
4061
4061
  };
4062
4062
  var NEVER = INVALID;
4063
4063
 
4064
+ // src/consumer-commands.ts
4065
+ var ConsumerCommandNameSchema = external_exports.string().max(128).regex(/^consumer\.[a-z0-9][a-z0-9.-]*[a-z0-9]$/);
4066
+ var ConsumerDefinitionSchema = external_exports.object({
4067
+ name: ConsumerCommandNameSchema,
4068
+ description: external_exports.string().min(1).max(1024),
4069
+ input_schema: external_exports.record(external_exports.unknown()),
4070
+ handler: external_exports.string().min(1).max(128)
4071
+ }).strict();
4072
+ var StoredConsumerDefinitionSchema = ConsumerDefinitionSchema.extend({
4073
+ source: external_exports.enum(["rest", "local"]),
4074
+ revision: external_exports.number().int().positive().safe()
4075
+ }).strict();
4076
+ var ConsumerConfigurationSchema = external_exports.object({
4077
+ handlers: external_exports.array(external_exports.object({
4078
+ id: external_exports.string().min(1).max(128),
4079
+ url: external_exports.string().url(),
4080
+ token_file: external_exports.string().min(1)
4081
+ }).strict()).max(64),
4082
+ definitions_file: external_exports.string().min(1).optional(),
4083
+ timeout_ms: external_exports.number().int().min(100).max(3e4).default(5e3)
4084
+ }).strict();
4085
+ var MAX_CONSUMER_ARGUMENT_BYTES = 64 * 1024;
4086
+ var MAX_CONSUMER_RESPONSE_BYTES = 256 * 1024;
4087
+ var LocalFileSchema = external_exports.object({
4088
+ version: external_exports.literal(1),
4089
+ rooms: external_exports.array(external_exports.object({
4090
+ room_id: external_exports.string().regex(/^[0-7][0-9a-hjkmnp-tv-z]{25}$/),
4091
+ commands: external_exports.array(ConsumerDefinitionSchema).max(64)
4092
+ }).strict()).max(256)
4093
+ }).strict();
4094
+
4064
4095
  // src/config.ts
4065
4096
  var DIRECTORY_MODE = 448;
4066
4097
  var FILE_MODE = 384;
@@ -4068,6 +4099,7 @@ var NO_FOLLOW = nodeFs.constants.O_NOFOLLOW ?? 0;
4068
4099
  var CoworkConfigSchema = external_exports.object({
4069
4100
  version: external_exports.literal(1),
4070
4101
  stateDir: external_exports.string().min(1),
4102
+ consumer_commands: ConsumerConfigurationSchema.optional(),
4071
4103
  rest: external_exports.object({
4072
4104
  enabled: external_exports.boolean(),
4073
4105
  port: external_exports.number().int().min(1).max(65535)
@@ -4115,6 +4147,7 @@ function loadConfig(env = process.env, io = {}) {
4115
4147
  return CoworkConfigSchema.parse({
4116
4148
  version: 1,
4117
4149
  stateDir: resolve(env.OURS_COWORK_STATE_DIR ?? file.stateDir),
4150
+ ...file.consumer_commands === void 0 ? {} : { consumer_commands: file.consumer_commands },
4118
4151
  rest: {
4119
4152
  enabled: restPort === void 0 ? file.rest.enabled : true,
4120
4153
  port: restPort ?? file.rest.port
@@ -4347,7 +4380,7 @@ var LowerCrockfordUlidSchema = external_exports.string().regex(
4347
4380
  "must be a 26-character lowercase Crockford ULID"
4348
4381
  );
4349
4382
  var ContainerIdSchema = external_exports.string().regex(/^[0-9a-f]{64}$/i, "must be a 64-character hexadecimal CID").transform((value) => value.toUpperCase());
4350
- var RuntimeCommandNameSchema = external_exports.enum(RUNTIME_COMMAND_NAMES);
4383
+ var RuntimeCommandNameSchema = external_exports.union([external_exports.enum(RUNTIME_COMMAND_NAMES), ConsumerCommandNameSchema]);
4351
4384
  var RuntimeCommandGrantSchema = external_exports.object({
4352
4385
  caller_cid: ContainerIdSchema,
4353
4386
  command: RuntimeCommandNameSchema
@@ -4689,6 +4722,8 @@ var CurrentRoomSchema = external_exports.object({
4689
4722
  }),
4690
4723
  /** Operator-managed, default-deny grants for the room identity's runtime commands. */
4691
4724
  command_grants: external_exports.array(RuntimeCommandGrantSchema),
4725
+ consumer_commands: external_exports.array(StoredConsumerDefinitionSchema).max(64).optional(),
4726
+ consumer_commands_revision: external_exports.number().int().nonnegative().safe().optional(),
4692
4727
  lifecycle_request: external_exports.object({
4693
4728
  request_id: external_exports.string().min(1).max(256),
4694
4729
  command: external_exports.enum(["room.close", "room.delete"]),