opencode-gateway 0.2.8 → 0.2.9
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 +26 -0
- package/dist/cli.js +18 -4
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,6 +51,17 @@ opencode serve
|
|
|
51
51
|
state_db = "/home/you/.local/share/opencode-gateway/state.db"
|
|
52
52
|
# log_level = "warn"
|
|
53
53
|
|
|
54
|
+
# Optional mailbox batching and route overrides.
|
|
55
|
+
# [gateway.mailbox]
|
|
56
|
+
# batch_replies = false
|
|
57
|
+
# batch_window_ms = 1500
|
|
58
|
+
#
|
|
59
|
+
# [[gateway.mailbox.routes]]
|
|
60
|
+
# channel = "telegram"
|
|
61
|
+
# target = "6212645712"
|
|
62
|
+
# topic = "12345"
|
|
63
|
+
# mailbox_key = "shared:telegram:dev"
|
|
64
|
+
|
|
54
65
|
[cron]
|
|
55
66
|
enabled = true
|
|
56
67
|
tick_seconds = 5
|
|
@@ -60,9 +71,15 @@ max_concurrent_runs = 1
|
|
|
60
71
|
enabled = false
|
|
61
72
|
bot_token_env = "TELEGRAM_BOT_TOKEN"
|
|
62
73
|
poll_timeout_seconds = 25
|
|
74
|
+
# Configure at least one allowlist when Telegram is enabled.
|
|
63
75
|
allowed_chats = []
|
|
64
76
|
allowed_users = []
|
|
65
77
|
|
|
78
|
+
[[memory.entries]]
|
|
79
|
+
path = "USER.md"
|
|
80
|
+
description = "Persistent user profile and preference memory. Keep this file accurate and concise. Record stable preferences, communication style, workflow habits, project conventions, tool constraints, review expectations, and other recurring facts that should shape future assistance. Update it proactively when you learn something durable about the user. Do not store one-off task details or transient context here."
|
|
81
|
+
inject_content = true
|
|
82
|
+
|
|
66
83
|
[[memory.entries]]
|
|
67
84
|
path = "memory/project.md"
|
|
68
85
|
description = "Project conventions and long-lived context"
|
|
@@ -85,6 +102,13 @@ export TELEGRAM_BOT_TOKEN="..."
|
|
|
85
102
|
Gateway plugin logs are off by default. Set `gateway.log_level` to `error`,
|
|
86
103
|
`warn`, `info`, or `debug` to emit that level and anything above it.
|
|
87
104
|
|
|
105
|
+
Mailbox rules:
|
|
106
|
+
|
|
107
|
+
- `gateway.mailbox.batch_replies` defaults to `false`
|
|
108
|
+
- `gateway.mailbox.batch_window_ms` defaults to `1500`
|
|
109
|
+
- `gateway.mailbox.routes` lets multiple ingress targets share one logical mailbox/session
|
|
110
|
+
- each route needs `channel`, `target`, optional `topic`, and a `mailbox_key`
|
|
111
|
+
|
|
88
112
|
Memory rules:
|
|
89
113
|
|
|
90
114
|
- all entries inject their configured path and description
|
|
@@ -95,4 +119,6 @@ Memory rules:
|
|
|
95
119
|
text files
|
|
96
120
|
- relative paths are resolved from `opencode-gateway-workspace`
|
|
97
121
|
- absolute paths are still allowed
|
|
122
|
+
- missing files and directories are created automatically on load
|
|
123
|
+
- the default template includes `USER.md` as persistent user-profile memory
|
|
98
124
|
- memory is injected only into gateway-managed sessions
|
package/dist/cli.js
CHANGED
|
@@ -387,6 +387,18 @@ function buildGatewayConfigTemplate(stateDbPath) {
|
|
|
387
387
|
`state_db = "${escapeTomlString(stateDbPath)}"`,
|
|
388
388
|
'# log_level = "warn"',
|
|
389
389
|
"",
|
|
390
|
+
"# Optional mailbox settings.",
|
|
391
|
+
"# [gateway.mailbox]",
|
|
392
|
+
"# batch_replies = false",
|
|
393
|
+
"# batch_window_ms = 1500",
|
|
394
|
+
"#",
|
|
395
|
+
"# Optional route overrides. Matching ingress targets can share one mailbox/session.",
|
|
396
|
+
"# [[gateway.mailbox.routes]]",
|
|
397
|
+
'# channel = "telegram"',
|
|
398
|
+
'# target = "6212645712"',
|
|
399
|
+
'# topic = "12345"',
|
|
400
|
+
'# mailbox_key = "shared:telegram:dev"',
|
|
401
|
+
"",
|
|
390
402
|
"[cron]",
|
|
391
403
|
"enabled = true",
|
|
392
404
|
"tick_seconds = 5",
|
|
@@ -397,16 +409,18 @@ function buildGatewayConfigTemplate(stateDbPath) {
|
|
|
397
409
|
"enabled = false",
|
|
398
410
|
'bot_token_env = "TELEGRAM_BOT_TOKEN"',
|
|
399
411
|
"poll_timeout_seconds = 25",
|
|
412
|
+
"# Configure at least one allowlist when Telegram is enabled.",
|
|
400
413
|
"allowed_chats = []",
|
|
401
414
|
"allowed_users = []",
|
|
402
415
|
"",
|
|
403
416
|
"# Optional long-lived memory sources injected into gateway-managed sessions.",
|
|
404
417
|
"# Relative paths are resolved from opencode-gateway-workspace.",
|
|
418
|
+
"# Missing files and directories are created automatically.",
|
|
405
419
|
"#",
|
|
406
|
-
"
|
|
407
|
-
'
|
|
408
|
-
'
|
|
409
|
-
"
|
|
420
|
+
"[[memory.entries]]",
|
|
421
|
+
'path = "USER.md"',
|
|
422
|
+
'description = "Persistent user profile and preference memory. Keep this file accurate and concise. Record stable preferences, communication style, workflow habits, project conventions, tool constraints, review expectations, and other recurring facts that should shape future assistance. Update it proactively when you learn something durable about the user. Do not store one-off task details or transient context here."',
|
|
423
|
+
"inject_content = true",
|
|
410
424
|
"#",
|
|
411
425
|
"# [[memory.entries]]",
|
|
412
426
|
'# path = "memory/notes"',
|
package/dist/index.js
CHANGED
|
@@ -16179,7 +16179,7 @@ async function readMemoryEntry(value, index, workspaceDirPath) {
|
|
|
16179
16179
|
}
|
|
16180
16180
|
throw new Error(`${field}.path must point to a regular file or directory`);
|
|
16181
16181
|
}
|
|
16182
|
-
async function ensurePathMetadata(path, displayPath, entry,
|
|
16182
|
+
async function ensurePathMetadata(path, displayPath, entry, _field) {
|
|
16183
16183
|
try {
|
|
16184
16184
|
return await stat(path);
|
|
16185
16185
|
} catch (error) {
|