opencode-acp 1.14.11 → 1.14.13-dev.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.
- package/README.md +20 -2
- package/README.zh-CN.md +20 -2
- package/dist/index.js +37 -14
- package/dist/index.js.map +1 -1
- package/dist/lib/config-validation.d.ts.map +1 -1
- package/dist/lib/config.d.ts +1 -1
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/messages/filter/apply.d.ts.map +1 -1
- package/dist/lib/messages/filter/builtin/omo-system-reminder.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -298,10 +298,10 @@ Each level overrides the previous, so project settings take priority over global
|
|
|
298
298
|
},
|
|
299
299
|
// Manual mode: disables autonomous context management,
|
|
300
300
|
// tools only run when explicitly triggered via /acp commands
|
|
301
|
+
// Allow ACP processing in subagent sessions (default: true)
|
|
302
|
+
"allowSubAgents": true,
|
|
301
303
|
// Experimental settings
|
|
302
304
|
"experimental": {
|
|
303
|
-
// Allow ACP processing in subagent sessions
|
|
304
|
-
"allowSubAgents": false,
|
|
305
305
|
// Enable user-editable prompt overrides under dcp-prompts directories
|
|
306
306
|
// When false (default), prompt override files/directories are ignored
|
|
307
307
|
"customPrompts": false,
|
|
@@ -492,6 +492,24 @@ For the complete list with root cause analysis, see the [bug tracker](https://gi
|
|
|
492
492
|
|
|
493
493
|
## Changelog
|
|
494
494
|
|
|
495
|
+
### v1.14.13-dev.1 — Dev Prerelease (1 PR since v1.14.12)
|
|
496
|
+
|
|
497
|
+
Dev prerelease covering PR #276. Published to `dev` npm tag for early testing.
|
|
498
|
+
|
|
499
|
+
**PRs included**:
|
|
500
|
+
- **#276** — Promote `allowSubAgents` from experimental to top-level config field, change default from `false` to `true`. Subagent sessions now get compression by default. Fully backward compatible: old `experimental.allowSubAgents` configs still work (top-level takes priority). Updated all 4 hook sites, schema, config validation, and 6 documentation files. Dual-agent reviewed (Oracle + Explore, both APPROVE).
|
|
501
|
+
|
|
502
|
+
**Install**: `opencode plugin opencode-acp@dev --global`
|
|
503
|
+
|
|
504
|
+
### v1.14.12 — Stable Release (1 PR since v1.14.11)
|
|
505
|
+
|
|
506
|
+
Stable release with the omo-system-reminder filter fix that preserves user content when stripping `<system-reminder>` blocks.
|
|
507
|
+
|
|
508
|
+
**PRs included**:
|
|
509
|
+
- **#271** — Fix (follow-up to #268): `omo-system-reminder` filter v1.2.0 returned `{ action: "drop" }` for ANY user message containing `<system-reminder>`, losing user text when OMO prepends system-reminder blocks to user messages. Rewrote to v1.3.0: strips `<system-reminder>` blocks + OMO markers, preserves remaining user content via `modify`. Pure OMO messages still return `drop`. Phase 2 `keepLastOnly` now applies the filter's actual decision (drop or modify) to older matches instead of unconditional drop. Recent N matches kept fully untouched (semantically correct). Backward compatible with other 3 `keepLastOnly` filters (they only return `drop`). Dual-agent reviewed (Oracle + Explore, both APPROVE).
|
|
510
|
+
|
|
511
|
+
**Install**: `opencode plugin opencode-acp@stable --global`
|
|
512
|
+
|
|
495
513
|
### v1.14.11 — Stable Release (1 PR since v1.14.10)
|
|
496
514
|
|
|
497
515
|
Stable release with the omo-system-reminder filter fix and configurable `keepLast`.
|
package/README.zh-CN.md
CHANGED
|
@@ -253,10 +253,10 @@ ACP 使用自己的配置文件,按以下顺序搜索:
|
|
|
253
253
|
},
|
|
254
254
|
// Manual mode: disables autonomous context management,
|
|
255
255
|
// tools only run when explicitly triggered via /acp commands
|
|
256
|
+
// 允许在子代理会话中运行 ACP(默认:开启)
|
|
257
|
+
"allowSubAgents": true,
|
|
256
258
|
// Experimental settings
|
|
257
259
|
"experimental": {
|
|
258
|
-
// Allow ACP processing in subagent sessions
|
|
259
|
-
"allowSubAgents": false,
|
|
260
260
|
// Enable user-editable prompt overrides under dcp-prompts directories
|
|
261
261
|
// When false (default), prompt override files/directories are ignored
|
|
262
262
|
"customPrompts": false,
|
|
@@ -446,6 +446,24 @@ ACP 是 DCP 的直接替代品。迁移步骤:
|
|
|
446
446
|
|
|
447
447
|
## 更新日志
|
|
448
448
|
|
|
449
|
+
### v1.14.13-dev.1 — Dev 预发布版(v1.14.12 以来 1 个 PR)
|
|
450
|
+
|
|
451
|
+
Dev 预发布版,包含 PR #276。发布到 `dev` npm tag 供早期测试。
|
|
452
|
+
|
|
453
|
+
**包含的 PR**:
|
|
454
|
+
- **#276** — 将 `allowSubAgents` 从实验性参数提升为顶级配置字段,默认值从 `false` 改为 `true`。子 Agent 会话默认开启压缩。完全向后兼容:旧的 `experimental.allowSubAgents` 配置仍然有效(顶级优先)。更新了 4 个 hook 调用点、schema、配置校验和 6 个文档文件。双 Agent Review(Oracle + Explore,均 APPROVE)。
|
|
455
|
+
|
|
456
|
+
**安装**:`opencode plugin opencode-acp@dev --global`
|
|
457
|
+
|
|
458
|
+
### v1.14.12 — 正式版(v1.14.11 以来 1 个 PR)
|
|
459
|
+
|
|
460
|
+
正式版发布,包含 omo-system-reminder 过滤器修复——剥离 `<system-reminder>` 块时保留用户正文。
|
|
461
|
+
|
|
462
|
+
**包含的 PR**:
|
|
463
|
+
- **#271** — 修复(#268 后续):`omo-system-reminder` 过滤器 v1.2.0 对任何含 `<system-reminder>` 的用户消息直接返回 `drop`,当 OMO 将 system-reminder 块注入到用户消息前面时丢失用户正文。改为 v1.3.0:剥离 `<system-reminder>` 块 + OMO 标记,保留剩余用户内容(`modify`)。纯 OMO 消息仍返回 `drop`。Phase 2 `keepLastOnly` 现在对较旧的匹配应用过滤器实际决策(drop 或 modify),不再无条件丢弃。最近 N 条保持不动(语义正确)。与其他 3 个 `keepLastOnly` 过滤器向后兼容(它们只返回 `drop`)。双 Agent Review(Oracle + Explore,全部 APPROVE)。
|
|
464
|
+
|
|
465
|
+
**安装**:`opencode plugin opencode-acp@stable --global`
|
|
466
|
+
|
|
449
467
|
### v1.14.11 — 正式版(v1.14.10 以来 1 个 PR)
|
|
450
468
|
|
|
451
469
|
正式版发布,包含 omo-system-reminder 过滤器修复和可配置 `keepLast`。
|
package/dist/index.js
CHANGED
|
@@ -869,6 +869,7 @@ var VALID_CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
869
869
|
"autoUpdate",
|
|
870
870
|
"debug",
|
|
871
871
|
"showUpdateToasts",
|
|
872
|
+
"allowSubAgents",
|
|
872
873
|
"pruneNotification",
|
|
873
874
|
"pruneNotificationType",
|
|
874
875
|
"experimental",
|
|
@@ -953,6 +954,9 @@ function validateConfigTypes(config) {
|
|
|
953
954
|
if (config.debug !== void 0 && typeof config.debug !== "boolean") {
|
|
954
955
|
errors.push({ key: "debug", expected: "boolean", actual: typeof config.debug });
|
|
955
956
|
}
|
|
957
|
+
if (config.allowSubAgents !== void 0 && typeof config.allowSubAgents !== "boolean") {
|
|
958
|
+
errors.push({ key: "allowSubAgents", expected: "boolean", actual: typeof config.allowSubAgents });
|
|
959
|
+
}
|
|
956
960
|
if (config.pruneNotification !== void 0) {
|
|
957
961
|
const validValues = ["off", "minimal", "detailed"];
|
|
958
962
|
if (!validValues.includes(config.pruneNotification)) {
|
|
@@ -1462,6 +1466,7 @@ var defaultConfig = {
|
|
|
1462
1466
|
enabled: true,
|
|
1463
1467
|
autoUpdate: true,
|
|
1464
1468
|
debug: false,
|
|
1469
|
+
allowSubAgents: true,
|
|
1465
1470
|
pruneNotification: "off",
|
|
1466
1471
|
// [FIX #20] Default to toast — chat-mode notifications inject an empty
|
|
1467
1472
|
// user message that freezes the session on providers that reject empty
|
|
@@ -1472,7 +1477,6 @@ var defaultConfig = {
|
|
|
1472
1477
|
protectedTools: [...DEFAULT_PROTECTED_TOOLS]
|
|
1473
1478
|
},
|
|
1474
1479
|
experimental: {
|
|
1475
|
-
allowSubAgents: false,
|
|
1476
1480
|
customPrompts: false
|
|
1477
1481
|
},
|
|
1478
1482
|
protectedFilePatterns: [],
|
|
@@ -1650,7 +1654,6 @@ function mergeCommands(base, override) {
|
|
|
1650
1654
|
function mergeExperimental(base, override) {
|
|
1651
1655
|
if (override === void 0) return base;
|
|
1652
1656
|
return {
|
|
1653
|
-
allowSubAgents: override.allowSubAgents ?? base.allowSubAgents,
|
|
1654
1657
|
customPrompts: override.customPrompts ?? base.customPrompts
|
|
1655
1658
|
};
|
|
1656
1659
|
}
|
|
@@ -1723,6 +1726,7 @@ function mergeLayer(config, data) {
|
|
|
1723
1726
|
enabled: data.enabled ?? config.enabled,
|
|
1724
1727
|
autoUpdate: data.autoUpdate ?? config.autoUpdate,
|
|
1725
1728
|
debug: data.debug ?? config.debug,
|
|
1729
|
+
allowSubAgents: data.allowSubAgents ?? data.experimental?.allowSubAgents ?? config.allowSubAgents,
|
|
1726
1730
|
pruneNotification: data.pruneNotification ?? config.pruneNotification,
|
|
1727
1731
|
pruneNotificationType: data.pruneNotificationType ?? config.pruneNotificationType,
|
|
1728
1732
|
commands: mergeCommands(config.commands, data.commands),
|
|
@@ -8831,7 +8835,7 @@ import { writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
|
8831
8835
|
import { join as join3 } from "path";
|
|
8832
8836
|
import { existsSync as existsSync3 } from "fs";
|
|
8833
8837
|
import { homedir as homedir3 } from "os";
|
|
8834
|
-
var LOG_VERSION = true ? "1.14.
|
|
8838
|
+
var LOG_VERSION = true ? "1.14.13-dev.1" : "dev";
|
|
8835
8839
|
var Logger = class {
|
|
8836
8840
|
logDir;
|
|
8837
8841
|
enabled;
|
|
@@ -10021,11 +10025,8 @@ function applyMessageFilters(messages, config, logger, ctx) {
|
|
|
10021
10025
|
if (decision.action !== "drop" && decision.action !== "modify") continue;
|
|
10022
10026
|
if (kept < keepCount) {
|
|
10023
10027
|
kept++;
|
|
10024
|
-
if (decision.action === "modify" && decision.text !== void 0) {
|
|
10025
|
-
applyDecision(part, decision, filter.name, i, text);
|
|
10026
|
-
}
|
|
10027
10028
|
} else {
|
|
10028
|
-
applyDecision(part,
|
|
10029
|
+
applyDecision(part, decision, filter.name, i, text);
|
|
10029
10030
|
}
|
|
10030
10031
|
}
|
|
10031
10032
|
}
|
|
@@ -10044,10 +10045,13 @@ function applyMessageFilters(messages, config, logger, ctx) {
|
|
|
10044
10045
|
// lib/messages/filter/builtin/omo-system-reminder.ts
|
|
10045
10046
|
var SYSTEM_REMINDER_OPEN = "<system-reminder>";
|
|
10046
10047
|
var OMO_MARKER = "<!-- OMO_INTERNAL_INITIATOR -->";
|
|
10048
|
+
var PAIRED_BLOCK_RE = /<system-reminder>[\s\S]*?<\/system-reminder>\s*<!-- OMO_INTERNAL_INITIATOR -->/g;
|
|
10049
|
+
var LONE_REMINDER_RE = /<system-reminder>[\s\S]*?<\/system-reminder>/g;
|
|
10050
|
+
var LONE_MARKER_RE = /<!-- OMO_INTERNAL_INITIATOR -->/g;
|
|
10047
10051
|
var OMO_SYSTEM_REMINDER_FILTER = {
|
|
10048
10052
|
name: "omo-system-reminder",
|
|
10049
|
-
version: "1.
|
|
10050
|
-
description: "Keep
|
|
10053
|
+
version: "1.3.0",
|
|
10054
|
+
description: "Keep recent OMO <system-reminder> messages; for older ones, strip blocks but preserve user content",
|
|
10051
10055
|
keepLastOnly: true,
|
|
10052
10056
|
keepLast: 2,
|
|
10053
10057
|
filter(ctx) {
|
|
@@ -10055,7 +10059,26 @@ var OMO_SYSTEM_REMINDER_FILTER = {
|
|
|
10055
10059
|
if (!ctx.text.includes(SYSTEM_REMINDER_OPEN) && !ctx.text.includes(OMO_MARKER)) {
|
|
10056
10060
|
return { action: "keep" };
|
|
10057
10061
|
}
|
|
10058
|
-
|
|
10062
|
+
let modified = ctx.text;
|
|
10063
|
+
let removedBlocks = 0;
|
|
10064
|
+
modified = modified.replace(PAIRED_BLOCK_RE, () => {
|
|
10065
|
+
removedBlocks++;
|
|
10066
|
+
return "";
|
|
10067
|
+
});
|
|
10068
|
+
modified = modified.replace(LONE_REMINDER_RE, () => {
|
|
10069
|
+
removedBlocks++;
|
|
10070
|
+
return "";
|
|
10071
|
+
});
|
|
10072
|
+
modified = modified.replace(LONE_MARKER_RE, "");
|
|
10073
|
+
modified = modified.replace(/\n{3,}/g, "\n\n").trim();
|
|
10074
|
+
if (modified.length === 0) {
|
|
10075
|
+
return { action: "drop", reason: `Pure OMO system-reminder (${removedBlocks} block(s), no user content)` };
|
|
10076
|
+
}
|
|
10077
|
+
return {
|
|
10078
|
+
action: "modify",
|
|
10079
|
+
text: modified,
|
|
10080
|
+
reason: `Stripped ${removedBlocks} OMO system-reminder block(s), preserved user content (${modified.length} chars)`
|
|
10081
|
+
};
|
|
10059
10082
|
}
|
|
10060
10083
|
};
|
|
10061
10084
|
|
|
@@ -10381,7 +10404,7 @@ function createSystemPromptHandler(registry4, logger, config, prompts) {
|
|
|
10381
10404
|
if (state && input.model?.limit?.context) {
|
|
10382
10405
|
state.modelContextLimit = input.model.limit.context;
|
|
10383
10406
|
}
|
|
10384
|
-
if (!state || state.isSubAgent && !config.
|
|
10407
|
+
if (!state || state.isSubAgent && !config.allowSubAgents) {
|
|
10385
10408
|
return;
|
|
10386
10409
|
}
|
|
10387
10410
|
const systemText = output.system.join("\n");
|
|
@@ -10398,7 +10421,7 @@ function createSystemPromptHandler(registry4, logger, config, prompts) {
|
|
|
10398
10421
|
const newPrompt = renderSystemPrompt(
|
|
10399
10422
|
runtimePrompts,
|
|
10400
10423
|
buildProtectedToolsExtension(config.compress.protectedTools),
|
|
10401
|
-
state.isSubAgent && config.
|
|
10424
|
+
state.isSubAgent && config.allowSubAgents
|
|
10402
10425
|
);
|
|
10403
10426
|
if (output.system.length > 0) {
|
|
10404
10427
|
output.system[output.system.length - 1] += "\n\n" + newPrompt;
|
|
@@ -10435,7 +10458,7 @@ function createChatMessageTransformHandler(client, registry4, logger, config, pr
|
|
|
10435
10458
|
await updatePerTurnState(state, logger, messages);
|
|
10436
10459
|
}
|
|
10437
10460
|
syncCompressPermissionState(state, config, hostPermissions, output.messages);
|
|
10438
|
-
if (state.isSubAgent && !config.
|
|
10461
|
+
if (state.isSubAgent && !config.allowSubAgents) {
|
|
10439
10462
|
return;
|
|
10440
10463
|
}
|
|
10441
10464
|
stripHallucinations(output.messages);
|
|
@@ -10872,7 +10895,7 @@ var server = (async (ctx) => {
|
|
|
10872
10895
|
};
|
|
10873
10896
|
}
|
|
10874
10897
|
const toolsToAdd = [];
|
|
10875
|
-
if (config.compress.permission !== "deny" && !config.
|
|
10898
|
+
if (config.compress.permission !== "deny" && !config.allowSubAgents) {
|
|
10876
10899
|
toolsToAdd.push("compress", "decompress", "search_context", "acp_status");
|
|
10877
10900
|
}
|
|
10878
10901
|
if (toolsToAdd.length > 0) {
|