omp-onlyne 0.2.0 → 0.3.0

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
@@ -92,9 +92,9 @@ separate security proposal; leave both at their defaults for the first E2E.
92
92
  the record.
93
93
  - `/onlyne` opens a domain rail, thread sidebar, message flow and domain node list.
94
94
  Threads, messages and nodes scroll independently. The inbox opens from the sidebar.
95
- Posting names the thread's owner and id; clicking an incoming message selects its
96
- message reference for a reply. Reply routing currently follows the original
97
- author and can land in another thread. `/onlyne settings` edits the project
95
+ Posting names the thread's owner and id; clicking a message opens its full body,
96
+ and Reply or Use as recipient are separate actions in that detail. Reply routing
97
+ follows the original author and can land in another thread. `/onlyne settings` edits the project
98
98
  configuration. `/onlyne init` writes a first config and starts the node; with
99
99
  no config, `/onlyne` and `/onlyne settings` open the same bootstrap.
100
100
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omp-onlyne",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Onlyne v3 for OMP: one msg tool, thread-aware attention and SystemOne delivery decisions",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
@@ -39,8 +39,8 @@
39
39
  "test": "bun test"
40
40
  },
41
41
  "dependencies": {
42
- "@onlyne/lib": "^3.1.0",
43
- "@onlyne/node-host": "^3.1.0"
42
+ "@onlyne/lib": "^3.2.0",
43
+ "@onlyne/node-host": "^3.2.0"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@oh-my-pi/pi-agent-core": "*",
@@ -22,10 +22,8 @@ const en = {
22
22
  draftNotFound: "No reply draft is named {id}.",
23
23
  draftNeedsReference: "A reply draft needs in_reply_to {sender,id} or {thread,seq}.",
24
24
  draftSourceUnavailable: "The draft source message is unavailable.",
25
-
26
- contextNotRegistered: "No execution context is registered as {alias}.",
27
- mainSummary: "Main OMP session",
28
- storeClosed: "The Onlyne store is closed.",
25
+ draftNoMatch: "No stored reply draft answers {sender}/{id}. Create the draft first, or pass meta.draft_id.",
26
+ draftNoRecent: "This session has no stored reply draft to send. Create the draft first, or pass meta.draft_id.",
29
27
 
30
28
  todoContextRequired: "A todo decision needs a non-empty context alias.",
31
29
  todoUnknownAction: "The judge returned an unknown todo action: {action}.",
@@ -93,10 +91,8 @@ const zh: Record<keyof typeof en, string> = {
93
91
  draftNotFound: "没有名为 {id} 的回复草稿。",
94
92
  draftNeedsReference: "回复草稿需要 in_reply_to {sender,id} 或 {thread,seq}。",
95
93
  draftSourceUnavailable: "草稿的源消息不可用。",
96
-
97
- contextNotRegistered: "没有注册名为 {alias} 的执行上下文。",
98
- mainSummary: "OMP 主会话",
99
- storeClosed: "Onlyne 存储已关闭。",
94
+ draftNoMatch: "没有回答 {sender}/{id} 的已存回复草稿。请先起草,或传 meta.draft_id。",
95
+ draftNoRecent: "本会话没有可发送的已存回复草稿。请先起草,或传 meta.draft_id。",
100
96
 
101
97
  todoContextRequired: "todo 决策需要非空的上下文别名。",
102
98
  todoUnknownAction: "judge 返回了未知的 todo 动作:{action}。",
package/src/config.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
2
2
  import { dirname, join } from "node:path";
3
- import type { OnlyneConfig } from "./types.ts";
3
+ import type { OnlyneConfig } from "@onlyne/node-host/types";
4
4
  import type { Locale } from "@onlyne/node-host/i18n";
5
- import { hostText as t } from "./host-text.ts";
6
- import { DEFAULT_ACQUISITION, parseAllowBlock, type AcquirePolicy, type AcquisitionPolicy } from "./acquire.ts";
5
+ import { hostText as t } from "@onlyne/node-host/host-text";
6
+ import { DEFAULT_ACQUISITION, parseAllowBlock, type AcquirePolicy, type AcquisitionPolicy } from "@onlyne/node-host/acquire";
7
7
 
8
8
  const CONFIG_RELATIVE_PATH = join(".onlyne", "config.toml");
9
9
  const REGION_PREFIX = "urn:onlyne:region:";
@@ -181,7 +181,9 @@ export function serializeConfig(config: OnlyneConfig): string {
181
181
  );
182
182
  const acquisition = config.acquisition ?? DEFAULT_ACQUISITION;
183
183
  lines.push("", "[acquisition]", `policy = ${tomlString(acquisition.policy)}`);
184
- if (acquisition.allow.length > 0) lines.push(`allow = [${acquisition.allow.map(entry => tomlString(entry)).join(", ")}]`);
184
+ // An empty set is a decision ("approve nobody"), not an absent one: omitting the line
185
+ // would reload it as the default loopback set.
186
+ lines.push(`allow = [${acquisition.allow.map(entry => tomlString(entry)).join(", ")}]`);
185
187
  if (config.discovery?.seeds !== undefined || config.trust !== undefined) {
186
188
  lines.push("", "[discovery]");
187
189
  const seeds = config.discovery?.seeds ?? [];
@@ -145,7 +145,6 @@ const en = {
145
145
  "error.contexts_unreadable": "The target's published contexts cannot be read: {reason}",
146
146
  "error.context_not_published": "The target does not publish an execution context named {alias}.",
147
147
  "error.thread_reference_shape": "meta.thread must be a thread alias or {owner,id}.",
148
- "error.ambiguous_local_thread": "More than one local thread is named {value}.",
149
148
  "error.routing_target": "The decision did not choose a routing target.",
150
149
  "error.needs_answer": "The decision did not say whether this message needs an answer.",
151
150
  "error.registry_unreadable": "The context registry could not be read: {error}",
@@ -163,7 +162,6 @@ const en = {
163
162
  "error.thread_title_required": "thread create needs a title.",
164
163
  "error.thread_reference_required": "thread {op} needs a thread reference.",
165
164
  "error.thread_target_required": "thread {op} needs a target.",
166
- "error.resource_fields": "resource needs owner, id and operation.",
167
165
  "error.read_thread_required": "read {name} needs a thread reference.",
168
166
  "error.read_message_required":
169
167
  "read {name} needs a message reference: meta.message {sender,id} or {thread,seq}.",
@@ -180,7 +178,7 @@ const en = {
180
178
  "error.domain_op": "The judge did not choose a domain operation.",
181
179
  "error.domain_id": "domain {op} needs domain_id.",
182
180
  "error.resource_action_fields":
183
- "A resource action needs meta.resource {owner,id} and meta.operation.",
181
+ "A resource action needs meta.resource {owner,id} and meta.operation. If this call was meant as a message to a peer (including an instruction to change a file on its own node), send it with meta.to or meta.in_reply_to instead.",
184
182
  "error.meta_to_single":
185
183
  "meta.to names one target; pass an array to the tool for several, or send one call per peer.",
186
184
  "error.meta_to_empty": "meta.to must be a non-empty string.",
@@ -360,7 +358,6 @@ const zh: Record<keyof typeof en, string> = {
360
358
  "error.contexts_unreadable": "无法读取目标已发布的上下文:{reason}",
361
359
  "error.context_not_published": "目标未发布名为 {alias} 的执行上下文。",
362
360
  "error.thread_reference_shape": "meta.thread 必须是 thread 别名或 {owner,id}。",
363
- "error.ambiguous_local_thread": "有多个本地 thread 名为 {value}。",
364
361
  "error.routing_target": "决策没有选择路由目标。",
365
362
  "error.needs_answer": "决策没有说明这条消息是否需要答复。",
366
363
  "error.registry_unreadable": "无法读取上下文注册表:{error}",
@@ -374,7 +371,6 @@ const zh: Record<keyof typeof en, string> = {
374
371
  "error.thread_title_required": "thread create 需要一个 title。",
375
372
  "error.thread_reference_required": "thread {op} 需要一个 thread 引用。",
376
373
  "error.thread_target_required": "thread {op} 需要一个目标。",
377
- "error.resource_fields": "resource 需要 owner、id 和 operation。",
378
374
  "error.read_thread_required": "read {name} 需要一个 thread 引用。",
379
375
  "error.read_message_required":
380
376
  "read {name} 需要一条消息引用:meta.message {sender,id} 或 {thread,seq}。",
@@ -390,7 +386,8 @@ const zh: Record<keyof typeof en, string> = {
390
386
  "error.thread_op_target": "judge 选择了 thread {op},但没有目标。",
391
387
  "error.domain_op": "judge 没有选择域操作。",
392
388
  "error.domain_id": "domain {op} 需要 domain_id。",
393
- "error.resource_action_fields": "资源动作需要 meta.resource {owner,id} 和 meta.operation。",
389
+ "error.resource_action_fields":
390
+ "资源动作需要 meta.resource {owner,id} 和 meta.operation。如果这次调用本意是发消息给某个 peer(包括让对方改它自己节点上的文件),请改用 meta.to 或 meta.in_reply_to 发送。",
394
391
  "error.meta_to_single":
395
392
  "meta.to 只能点名一个目标;要发给多个,请向工具传数组,或每个 peer 发一次调用。",
396
393
  "error.meta_to_empty": "meta.to 必须是非空字符串。",