@ours.network/cli 1.0.1 → 2.0.1

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.
@@ -8,7 +8,6 @@ var str = (help, required = false, values, valueName = "TEXT", allowEmpty = fals
8
8
  var bool = (help, required = false) => ({ kind: "boolean", help, valueName: "true|false", required });
9
9
  var integer = (help, required = false, positive = false) => ({ kind: "integer", help, valueName: "N", required, positive });
10
10
  var strings = (help, required = false) => ({ kind: "string[]", help, valueName: "VALUE,...", required });
11
- var integers = (help, required = false) => ({ kind: "integer[]", help, valueName: "N,...", required });
12
11
  var none = {};
13
12
  var OPERATION_SPECS = {
14
13
  "create-identity": {
@@ -210,55 +209,55 @@ var OPERATION_SPECS = {
210
209
  }
211
210
  },
212
211
  "list-incoming-messages": { method: "listIncomingMessages", fields: none, summary: "List inbox metadata and status without revealing message bodies.", effects: "Read-only; message status is unchanged." },
213
- "get-messages": { method: "getMessages", fields: none, summary: "Return every unread message body and mark those messages processed.", effects: "Mutates inbox status. This is the only message-body read and is exactly-once unless the returned message IDs are deferred." },
214
- "defer-messages": {
215
- method: "deferMessages",
216
- fields: { msg_ids: integers("Comma-separated numeric message IDs to return to unread state.", true) },
217
- summary: "Return processed messages to the unread queue.",
218
- effects: "Mutates inbox status.",
219
- exampleInput: { msg_ids: [12, 13] }
212
+ "get-messages": {
213
+ method: "getMessages",
214
+ fields: { limit: integer("Maximum unread messages to return (default 50, maximum 200).", false, true) },
215
+ summary: "Return the oldest unread message bodies and mark exactly those rows read.",
216
+ effects: "Mutates SQLite inbox state and then best-effort attempts body-free read receipts."
220
217
  },
221
- "defer-files": {
222
- method: "deferFiles",
223
- fields: { file_ids: integers("Comma-separated numeric file IDs\u2014not wire IDs\u2014to return to unread state.", true) },
224
- summary: "Return processed files to the unread queue.",
225
- effects: "Mutates inbox status; already-unread files are left unchanged.",
226
- exampleInput: { file_ids: [4, 5] }
227
- },
228
- "get-conversation": {
229
- method: "getConversation",
230
- fields: { contact: str("Contact name or container ID.", true, void 0, "CONTACT") },
231
- summary: "Show retained conversation history with one contact, oldest first.",
232
- effects: "Read-only. It is empty when history retention is disabled.",
233
- exampleInput: { contact: "Peer" }
218
+ "list-history": {
219
+ method: "listHistory",
220
+ fields: {
221
+ peer_cid: str("Filter by authenticated peer container ID.", false, void 0, "CID"),
222
+ direction: str("Filter by direction.", false, ["in", "out"], "in|out"),
223
+ before_seq: integer("Return rows before this cursor.", false, true),
224
+ limit: integer("Maximum rows to return (default 50, maximum 200).", false, true)
225
+ },
226
+ summary: "List persistent message history newest first with cursor pagination.",
227
+ effects: "Read-only."
234
228
  },
235
- "get-receipts": {
236
- method: "getReceipts",
237
- fields: { contact: str("Contact name or container ID.", true, void 0, "CONTACT") },
238
- summary: "Show delivered/read receipts received for sent messages.",
239
- effects: "Read-only. Receipts are retained only when conversation history is enabled.",
240
- exampleInput: { contact: "Peer" }
229
+ "get-history-item": {
230
+ method: "getHistoryItem",
231
+ fields: { wire_id: str("Exact message wire ID.", true, void 0, "WIRE_ID") },
232
+ summary: "Look up one persistent message-history item by wire ID.",
233
+ effects: "Read-only."
241
234
  },
242
- "mark-read": {
243
- method: "markRead",
244
- fields: { contact: str("Contact name or container ID.", true, void 0, "CONTACT") },
245
- summary: "Mark unread inbound entries in one conversation as read.",
246
- effects: "Mutates conversation state and sends read receipts for newly marked messages.",
247
- exampleInput: { contact: "Peer" }
235
+ "list-files": {
236
+ method: "listFiles",
237
+ fields: {
238
+ peer_cid: str("Filter by authenticated peer container ID.", false, void 0, "CID"),
239
+ direction: str("Filter by direction.", false, ["in", "out"], "in|out"),
240
+ before_seq: integer("Return rows before this cursor.", false, true),
241
+ limit: integer("Maximum rows to return (default 50, maximum 200).", false, true)
242
+ },
243
+ summary: "List persistent file history newest first with cursor pagination.",
244
+ effects: "Read-only; returns metadata, not bytes."
248
245
  },
249
- "set-conversation-policy": {
250
- method: "setConversationPolicy",
251
- fields: { keep_history: bool("Enable or disable retained conversation history and receipt support.", true) },
252
- summary: "Set conversation-history policy for the bound identity.",
253
- effects: "Writes identity-local policy. Existing contacts learn newly enabled receipt capability on later outbound traffic.",
254
- exampleInput: { keep_history: true }
246
+ "get-file-info": {
247
+ method: "getFileInfo",
248
+ fields: { wire_id: str("Exact file wire ID.", true, void 0, "WIRE_ID") },
249
+ summary: "Look up one persistent file-history item by wire ID.",
250
+ effects: "Read-only; returns metadata, not bytes."
255
251
  },
256
252
  "list-incoming-files": { method: "listIncomingFiles", fields: none, summary: "List incoming-file metadata for authorization.", effects: "Read-only: returns no bytes and does not change file status. Authorize using the authenticated sender ID, not its display name." },
257
253
  "get-files": {
258
254
  method: "getFiles",
259
- fields: { wire_ids: strings("Comma-separated unread file wire IDs; omit to retrieve every unread file.") },
260
- summary: "Write approved unread files into the bound identity\u2019s files directory.",
261
- effects: "Writes received bytes and marks retrieved files processed. An explicit selection must contain 1\u201332 unique 64-hex wire IDs.",
255
+ fields: {
256
+ wire_ids: strings("Comma-separated unread file wire IDs; omit for an oldest-first batch."),
257
+ limit: integer("Maximum files in an unselected batch (default 50, maximum 200).", false, true)
258
+ },
259
+ summary: "Return immutable blob paths for approved unread files.",
260
+ effects: "Marks retrieved SQLite file rows read. An explicit selection must contain 1\u201332 unique 64-hex wire IDs.",
262
261
  exampleInput: { wire_ids: ["0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"] }
263
262
  },
264
263
  version: { method: "version", fields: none, summary: "Show the selected daemon\u2019s version and protocol information.", effects: "Read-only." },
@@ -87,7 +87,7 @@ function childEnvironment(selection) {
87
87
  async function serveDaemon(selection, managed = false) {
88
88
  if (selection.endpoint !== void 0) throw new Error("--endpoint selects a running daemon and cannot be used with daemon serve");
89
89
  Object.assign(process.env, childEnvironment(selection));
90
- const { startDaemon } = await import("./daemon-UUG6P6GK.js");
90
+ const { startDaemon } = await import("./daemon-YCC24SVU.js");
91
91
  const handle = await startDaemon();
92
92
  if (managed) {
93
93
  const response = await fetch(`http://127.0.0.1:${handle.port}/state-dir`);
@@ -118,31 +118,29 @@ var COMMAND_GROUPS = {
118
118
  }
119
119
  },
120
120
  message: {
121
- summary: "Send encrypted text and manage the incoming message queue.",
121
+ summary: "Send encrypted text and consume the SQLite-backed unread queue.",
122
122
  commands: {
123
123
  send: operation("send-message"),
124
124
  list: operation("list-incoming-messages"),
125
- get: operation("get-messages"),
126
- defer: operation("defer-messages")
125
+ get: operation("get-messages")
127
126
  }
128
127
  },
129
128
  file: {
130
- summary: "Send encrypted files and authorize, retrieve, or defer received files.",
129
+ summary: "Send encrypted files and authorize or retrieve received files.",
131
130
  commands: {
132
131
  send: operation("send-file"),
133
132
  list: operation("list-incoming-files"),
134
133
  get: operation("get-files"),
135
- fetch: operation("fetch-file"),
136
- defer: operation("defer-files")
134
+ fetch: operation("fetch-file")
137
135
  }
138
136
  },
139
- conversation: {
140
- summary: "Inspect retained conversations and receipts, mark them read, and set retention policy.",
137
+ history: {
138
+ summary: "Inspect persistent SQLite-backed message and file history.",
141
139
  commands: {
142
- show: operation("get-conversation"),
143
- receipts: operation("get-receipts"),
144
- "mark-read": operation("mark-read"),
145
- policy: operation("set-conversation-policy")
140
+ list: operation("list-history"),
141
+ get: operation("get-history-item"),
142
+ files: operation("list-files"),
143
+ "file-info": operation("get-file-info")
146
144
  }
147
145
  }
148
146
  };
@@ -143,36 +143,34 @@ export declare const COMMAND_GROUPS: {
143
143
  };
144
144
  };
145
145
  readonly message: {
146
- readonly summary: "Send encrypted text and manage the incoming message queue.";
146
+ readonly summary: "Send encrypted text and consume the SQLite-backed unread queue.";
147
147
  readonly commands: {
148
148
  readonly send: OperationCommandSpec;
149
149
  readonly list: OperationCommandSpec;
150
150
  readonly get: OperationCommandSpec;
151
- readonly defer: OperationCommandSpec;
152
151
  };
153
152
  };
154
153
  readonly file: {
155
- readonly summary: "Send encrypted files and authorize, retrieve, or defer received files.";
154
+ readonly summary: "Send encrypted files and authorize or retrieve received files.";
156
155
  readonly commands: {
157
156
  readonly send: OperationCommandSpec;
158
157
  readonly list: OperationCommandSpec;
159
158
  readonly get: OperationCommandSpec;
160
159
  readonly fetch: OperationCommandSpec;
161
- readonly defer: OperationCommandSpec;
162
160
  };
163
161
  };
164
- readonly conversation: {
165
- readonly summary: "Inspect retained conversations and receipts, mark them read, and set retention policy.";
162
+ readonly history: {
163
+ readonly summary: "Inspect persistent SQLite-backed message and file history.";
166
164
  readonly commands: {
167
- readonly show: OperationCommandSpec;
168
- readonly receipts: OperationCommandSpec;
169
- readonly 'mark-read': OperationCommandSpec;
170
- readonly policy: OperationCommandSpec;
165
+ readonly list: OperationCommandSpec;
166
+ readonly get: OperationCommandSpec;
167
+ readonly files: OperationCommandSpec;
168
+ readonly 'file-info': OperationCommandSpec;
171
169
  };
172
170
  };
173
171
  };
174
172
  export type CommandGroup = keyof typeof COMMAND_GROUPS;
175
- export declare const DESTRUCTIVE_OPERATIONS: Set<"version" | "identities" | "unread" | "create-identity" | "create-temporary-identity" | "close-temporary-identity" | "create-root-identity" | "define-local-identity-file" | "choose-identity" | "list-identities" | "current-identity" | "remove-identity" | "release-lease" | "generate-invite" | "list-invites" | "revoke-invite" | "add-contact" | "list-contacts" | "list-local-contact-book" | "set-local-book-policy" | "remove-contact" | "rename-contact" | "respond-to-introduction" | "set-bio" | "set-persona" | "send-message" | "send-file" | "list-incoming-messages" | "get-messages" | "defer-messages" | "defer-files" | "get-conversation" | "get-receipts" | "mark-read" | "set-conversation-policy" | "list-incoming-files" | "get-files" | "state-dir" | "watch-notifications" | "fetch-file">;
176
- export declare const IDENTITY_PREBIND_EXCEPTIONS: Set<"version" | "identities" | "unread" | "create-identity" | "create-temporary-identity" | "close-temporary-identity" | "create-root-identity" | "define-local-identity-file" | "choose-identity" | "list-identities" | "current-identity" | "remove-identity" | "release-lease" | "generate-invite" | "list-invites" | "revoke-invite" | "add-contact" | "list-contacts" | "list-local-contact-book" | "set-local-book-policy" | "remove-contact" | "rename-contact" | "respond-to-introduction" | "set-bio" | "set-persona" | "send-message" | "send-file" | "list-incoming-messages" | "get-messages" | "defer-messages" | "defer-files" | "get-conversation" | "get-receipts" | "mark-read" | "set-conversation-policy" | "list-incoming-files" | "get-files" | "state-dir" | "watch-notifications" | "fetch-file">;
173
+ export declare const DESTRUCTIVE_OPERATIONS: Set<"version" | "identities" | "unread" | "create-identity" | "create-temporary-identity" | "close-temporary-identity" | "create-root-identity" | "define-local-identity-file" | "choose-identity" | "list-identities" | "current-identity" | "remove-identity" | "release-lease" | "generate-invite" | "list-invites" | "revoke-invite" | "add-contact" | "list-contacts" | "list-local-contact-book" | "set-local-book-policy" | "remove-contact" | "rename-contact" | "respond-to-introduction" | "set-bio" | "set-persona" | "send-message" | "send-file" | "list-incoming-messages" | "get-messages" | "list-history" | "get-history-item" | "list-files" | "get-file-info" | "list-incoming-files" | "get-files" | "state-dir" | "watch-notifications" | "fetch-file">;
174
+ export declare const IDENTITY_PREBIND_EXCEPTIONS: Set<"version" | "identities" | "unread" | "create-identity" | "create-temporary-identity" | "close-temporary-identity" | "create-root-identity" | "define-local-identity-file" | "choose-identity" | "list-identities" | "current-identity" | "remove-identity" | "release-lease" | "generate-invite" | "list-invites" | "revoke-invite" | "add-contact" | "list-contacts" | "list-local-contact-book" | "set-local-book-policy" | "remove-contact" | "rename-contact" | "respond-to-introduction" | "set-bio" | "set-persona" | "send-message" | "send-file" | "list-incoming-messages" | "get-messages" | "list-history" | "get-history-item" | "list-files" | "get-file-info" | "list-incoming-files" | "get-files" | "state-dir" | "watch-notifications" | "fetch-file">;
177
175
  export declare function isCommandGroup(value: string): value is CommandGroup;
178
176
  export declare function commandSpec(group: CommandGroup, command: string): CommandSpec | undefined;
package/dist/commands.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  IDENTITY_PREBIND_EXCEPTIONS,
5
5
  commandSpec,
6
6
  isCommandGroup
7
- } from "./chunk-SDNTPCKW.js";
7
+ } from "./chunk-NWRXKQBD.js";
8
8
  export {
9
9
  COMMAND_GROUPS,
10
10
  DESTRUCTIVE_OPERATIONS,
@@ -204,7 +204,7 @@ async function releaseHeld(lock) {
204
204
  async function bootKernel() {
205
205
  const { lock, acquired } = await ensureLock();
206
206
  try {
207
- const { bootWrapper } = await import("./boot-35BOHNSZ.js");
207
+ const { bootWrapper } = await import("./boot-LJ2V4NSS.js");
208
208
  await bootWrapper();
209
209
  } catch (error) {
210
210
  if (acquired) await releaseHeld(lock);
@@ -214,7 +214,7 @@ async function bootKernel() {
214
214
  async function startDaemon(opts = {}) {
215
215
  const { lock, acquired } = await ensureLock();
216
216
  try {
217
- const runtime = await import("./server-TDJBEWTU.js");
217
+ const runtime = await import("./server-2RIEOKDA.js");
218
218
  const { onRuntimeLoaded, ...daemonOptions } = opts;
219
219
  onRuntimeLoaded?.();
220
220
  const handle = await runtime.startDaemon({
package/dist/help.js CHANGED
@@ -3,10 +3,10 @@ import {
3
3
  helpRequestPath,
4
4
  renderHelp,
5
5
  renderTopHelp
6
- } from "./chunk-ZFE47KH3.js";
7
- import "./chunk-QRNZFPNJ.js";
6
+ } from "./chunk-FKSRG5UJ.js";
7
+ import "./chunk-MS4TDUZY.js";
8
8
  import "./chunk-6NFATG6P.js";
9
- import "./chunk-SDNTPCKW.js";
9
+ import "./chunk-NWRXKQBD.js";
10
10
  export {
11
11
  helpHint,
12
12
  helpRequestPath,
package/dist/lifecycle.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  startDaemonManaged,
8
8
  stopDaemonManaged,
9
9
  writeManagedRecord
10
- } from "./chunk-QZIL3IT7.js";
10
+ } from "./chunk-NRPPG3WH.js";
11
11
  import "./chunk-6K2JBKHI.js";
12
12
  export {
13
13
  DAEMON_LOG_FILE,
package/dist/main.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  helpHint,
18
18
  helpRequestPath,
19
19
  renderHelp
20
- } from "./chunk-ZFE47KH3.js";
20
+ } from "./chunk-FKSRG5UJ.js";
21
21
  import {
22
22
  invokeOperation,
23
23
  isOperationName,
@@ -26,7 +26,7 @@ import {
26
26
  operationNames,
27
27
  operationValueFlags,
28
28
  parseOperationJson
29
- } from "./chunk-QRNZFPNJ.js";
29
+ } from "./chunk-MS4TDUZY.js";
30
30
  import {
31
31
  CliUsageError,
32
32
  parseFlags,
@@ -37,13 +37,13 @@ import {
37
37
  IDENTITY_PREBIND_EXCEPTIONS,
38
38
  commandSpec,
39
39
  isCommandGroup
40
- } from "./chunk-SDNTPCKW.js";
40
+ } from "./chunk-NWRXKQBD.js";
41
41
  import {
42
42
  inspectDaemon,
43
43
  serveDaemon,
44
44
  startDaemonManaged,
45
45
  stopDaemonManaged
46
- } from "./chunk-QZIL3IT7.js";
46
+ } from "./chunk-NRPPG3WH.js";
47
47
  import {
48
48
  attachClient,
49
49
  defaultConfigPath,
@@ -54,7 +54,7 @@ import {
54
54
  import { existsSync, readFileSync } from "node:fs";
55
55
  import { homedir } from "node:os";
56
56
  import { join, resolve } from "node:path";
57
- var CLI_VERSION = false ? "0.0.0-dev" : "1.0.1";
57
+ var CLI_VERSION = false ? "0.0.0-dev" : "2.0.1";
58
58
  var COMMON_VALUES = /* @__PURE__ */ new Set(["--endpoint", "--port", "--state-dir", "--config", "--identity"]);
59
59
  var COMMON_BOOLEANS = /* @__PURE__ */ new Set(["--json", "--yes", "--help"]);
60
60
  function selectionFrom(values) {
@@ -315,75 +315,49 @@ export declare const OPERATION_SPECS: {
315
315
  };
316
316
  readonly 'get-messages': {
317
317
  readonly method: "getMessages";
318
- readonly fields: {};
319
- readonly summary: "Return every unread message body and mark those messages processed.";
320
- readonly effects: "Mutates inbox status. This is the only message-body read and is exactly-once unless the returned message IDs are deferred.";
321
- };
322
- readonly 'defer-messages': {
323
- readonly method: "deferMessages";
324
- readonly fields: {
325
- readonly msg_ids: FieldSpec;
326
- };
327
- readonly summary: "Return processed messages to the unread queue.";
328
- readonly effects: "Mutates inbox status.";
329
- readonly exampleInput: {
330
- readonly msg_ids: readonly [12, 13];
331
- };
332
- };
333
- readonly 'defer-files': {
334
- readonly method: "deferFiles";
335
318
  readonly fields: {
336
- readonly file_ids: FieldSpec;
337
- };
338
- readonly summary: "Return processed files to the unread queue.";
339
- readonly effects: "Mutates inbox status; already-unread files are left unchanged.";
340
- readonly exampleInput: {
341
- readonly file_ids: readonly [4, 5];
319
+ readonly limit: FieldSpec;
342
320
  };
321
+ readonly summary: "Return the oldest unread message bodies and mark exactly those rows read.";
322
+ readonly effects: "Mutates SQLite inbox state and then best-effort attempts body-free read receipts.";
343
323
  };
344
- readonly 'get-conversation': {
345
- readonly method: "getConversation";
324
+ readonly 'list-history': {
325
+ readonly method: "listHistory";
346
326
  readonly fields: {
347
- readonly contact: FieldSpec;
348
- };
349
- readonly summary: "Show retained conversation history with one contact, oldest first.";
350
- readonly effects: "Read-only. It is empty when history retention is disabled.";
351
- readonly exampleInput: {
352
- readonly contact: "Peer";
327
+ readonly peer_cid: FieldSpec;
328
+ readonly direction: FieldSpec;
329
+ readonly before_seq: FieldSpec;
330
+ readonly limit: FieldSpec;
353
331
  };
332
+ readonly summary: "List persistent message history newest first with cursor pagination.";
333
+ readonly effects: "Read-only.";
354
334
  };
355
- readonly 'get-receipts': {
356
- readonly method: "getReceipts";
335
+ readonly 'get-history-item': {
336
+ readonly method: "getHistoryItem";
357
337
  readonly fields: {
358
- readonly contact: FieldSpec;
359
- };
360
- readonly summary: "Show delivered/read receipts received for sent messages.";
361
- readonly effects: "Read-only. Receipts are retained only when conversation history is enabled.";
362
- readonly exampleInput: {
363
- readonly contact: "Peer";
338
+ readonly wire_id: FieldSpec;
364
339
  };
340
+ readonly summary: "Look up one persistent message-history item by wire ID.";
341
+ readonly effects: "Read-only.";
365
342
  };
366
- readonly 'mark-read': {
367
- readonly method: "markRead";
343
+ readonly 'list-files': {
344
+ readonly method: "listFiles";
368
345
  readonly fields: {
369
- readonly contact: FieldSpec;
370
- };
371
- readonly summary: "Mark unread inbound entries in one conversation as read.";
372
- readonly effects: "Mutates conversation state and sends read receipts for newly marked messages.";
373
- readonly exampleInput: {
374
- readonly contact: "Peer";
346
+ readonly peer_cid: FieldSpec;
347
+ readonly direction: FieldSpec;
348
+ readonly before_seq: FieldSpec;
349
+ readonly limit: FieldSpec;
375
350
  };
351
+ readonly summary: "List persistent file history newest first with cursor pagination.";
352
+ readonly effects: "Read-only; returns metadata, not bytes.";
376
353
  };
377
- readonly 'set-conversation-policy': {
378
- readonly method: "setConversationPolicy";
354
+ readonly 'get-file-info': {
355
+ readonly method: "getFileInfo";
379
356
  readonly fields: {
380
- readonly keep_history: FieldSpec;
381
- };
382
- readonly summary: "Set conversation-history policy for the bound identity.";
383
- readonly effects: "Writes identity-local policy. Existing contacts learn newly enabled receipt capability on later outbound traffic.";
384
- readonly exampleInput: {
385
- readonly keep_history: true;
357
+ readonly wire_id: FieldSpec;
386
358
  };
359
+ readonly summary: "Look up one persistent file-history item by wire ID.";
360
+ readonly effects: "Read-only; returns metadata, not bytes.";
387
361
  };
388
362
  readonly 'list-incoming-files': {
389
363
  readonly method: "listIncomingFiles";
@@ -395,9 +369,10 @@ export declare const OPERATION_SPECS: {
395
369
  readonly method: "getFiles";
396
370
  readonly fields: {
397
371
  readonly wire_ids: FieldSpec;
372
+ readonly limit: FieldSpec;
398
373
  };
399
- readonly summary: "Write approved unread files into the bound identity’s files directory.";
400
- readonly effects: "Writes received bytes and marks retrieved files processed. An explicit selection must contain 1–32 unique 64-hex wire IDs.";
374
+ readonly summary: "Return immutable blob paths for approved unread files.";
375
+ readonly effects: "Marks retrieved SQLite file rows read. An explicit selection must contain 1–32 unique 64-hex wire IDs.";
401
376
  readonly exampleInput: {
402
377
  readonly wire_ids: readonly ["0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"];
403
378
  };
@@ -9,7 +9,7 @@ import {
9
9
  operationSpec,
10
10
  operationValueFlags,
11
11
  parseOperationJson
12
- } from "./chunk-QRNZFPNJ.js";
12
+ } from "./chunk-MS4TDUZY.js";
13
13
  import "./chunk-6NFATG6P.js";
14
14
  export {
15
15
  OPERATION_SPECS,