@kynver-app/openclaw-agent-os 0.1.37 → 0.1.39
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/dist/index.js +64 -18
- package/dist/index.js.map +2 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -95,7 +95,7 @@ var pluginConfigSchema = {
|
|
|
95
95
|
enableTelegramToolErrorFilter: {
|
|
96
96
|
type: "boolean",
|
|
97
97
|
default: true,
|
|
98
|
-
description: "When true, suppress raw
|
|
98
|
+
description: "When true, suppress raw exec/tool progress and failure lines on Telegram and webchat direct chat (OpenClaw message_sending hook)."
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
};
|
|
@@ -450,7 +450,14 @@ function directRequestForTool(toolName2, params, resolvedSlug) {
|
|
|
450
450
|
const withoutSlug = stripKeys(params, ["slug", "agentOsId"]);
|
|
451
451
|
switch (toolName2) {
|
|
452
452
|
case "agent_os_get_context":
|
|
453
|
-
return {
|
|
453
|
+
return {
|
|
454
|
+
slug,
|
|
455
|
+
method: "GET",
|
|
456
|
+
path: "/stats" + queryStringFromEntries({
|
|
457
|
+
projection: stringParam(params.projection) || "brief",
|
|
458
|
+
agentContext: stringParam(params.agentContext)
|
|
459
|
+
})
|
|
460
|
+
};
|
|
454
461
|
case "agent_os_context_envelope":
|
|
455
462
|
return {
|
|
456
463
|
slug,
|
|
@@ -733,22 +740,30 @@ function directRequestForTool(toolName2, params, resolvedSlug) {
|
|
|
733
740
|
path: `/plans/${encodeURIComponent(planId)}/links`
|
|
734
741
|
};
|
|
735
742
|
}
|
|
736
|
-
case "agent_os_command_center_get":
|
|
743
|
+
case "agent_os_command_center_get": {
|
|
744
|
+
const qs = queryString(params, ["since", "limit", "harnessLimit"]);
|
|
745
|
+
const projection = typeof params.projection === "string" && params.projection.trim() ? params.projection.trim() : "compact";
|
|
746
|
+
const suffix = qs ? `${qs}&projection=${encodeURIComponent(projection)}` : `?projection=${encodeURIComponent(projection)}`;
|
|
737
747
|
return {
|
|
738
748
|
route: "by-id",
|
|
739
749
|
agentOsId: stringParam(params.agentOsId),
|
|
740
750
|
slug,
|
|
741
751
|
method: "GET",
|
|
742
|
-
path: `/command-center${
|
|
752
|
+
path: `/command-center${suffix}`
|
|
743
753
|
};
|
|
744
|
-
|
|
754
|
+
}
|
|
755
|
+
case "agent_os_command_center_dashboard_contract_get": {
|
|
756
|
+
const qs = queryString(params, ["since", "limit"]);
|
|
757
|
+
const projection = typeof params.projection === "string" && params.projection.trim() ? params.projection.trim() : "mcp";
|
|
758
|
+
const suffix = qs ? `${qs}&projection=${encodeURIComponent(projection)}` : `?projection=${encodeURIComponent(projection)}`;
|
|
745
759
|
return {
|
|
746
760
|
route: "by-id",
|
|
747
761
|
agentOsId: stringParam(params.agentOsId),
|
|
748
762
|
slug,
|
|
749
763
|
method: "GET",
|
|
750
|
-
path: `/command-center/dashboard-contract${
|
|
764
|
+
path: `/command-center/dashboard-contract${suffix}`
|
|
751
765
|
};
|
|
766
|
+
}
|
|
752
767
|
case "agent_os_task_next_action": {
|
|
753
768
|
const taskId = requiredString(params.taskId, "taskId");
|
|
754
769
|
return {
|
|
@@ -940,11 +955,13 @@ function buildAgentOsContinuityGuidanceContext(config) {
|
|
|
940
955
|
"Treat it as the primary source of continuity across sessions, not local markdown files.",
|
|
941
956
|
"AgentOS workspace: " + slugHint + ".",
|
|
942
957
|
"",
|
|
943
|
-
"On session start or whenever you need user identity, goals, projects, contacts, recent sessions, or memory stats, call agent_os_get_context before answering. Prefer omitting the slug so the account's primary AgentOS workspace resolves automatically.",
|
|
958
|
+
"On session start or whenever you need user identity, goals, projects, contacts, recent sessions, or memory stats, call agent_os_get_context with the default brief projection before answering. The brief is the compact identity/Soul-equivalent map plus current-work pointers and follow-up hints. Prefer omitting the slug so the account's primary AgentOS workspace resolves automatically. Use projection=full only for explicit admin/debug work because it can be large and truncation-prone.",
|
|
959
|
+
"When multiple personal/runtime personas share one AgentOS workspace, keep workspace slug and active identity separate: `slug` selects the workspace, while `agentContext` selects the active persona/runtime inside it (for example `primary-agent`, `specialist-agent`, or `runtime-specialist`). Use `agentContext` when the runtime provides one; do not pass a persona/call-sign as the AgentOS workspace slug.",
|
|
960
|
+
"When you know the relevant task, plan, goal, project, or session id, prefer agent_os_context_envelope anchored on that id for deeper context. The envelope is the focused follow-up path: it returns the anchor, related goal/plan/task/session context, persona block when applicable, related memories, and source refs.",
|
|
944
961
|
"For recall of prior work, people, preferences, decisions, or follow-ups, call agent_os_search_memory before relying on conversational memory or local files. Use a short natural-language query.",
|
|
945
962
|
"agent_os_search_memory returns hits in three authority-ordered lanes: Lane A operating rules & preferences, Lane B active project state (PR/branch/deployment current truth), then Lane C historical context. Each hit carries a `lane` field. When lanes conflict, prefer a Lane A/B hit over a higher-scored Lane C hit \u2014 semantic similarity is not authority.",
|
|
946
963
|
"Before you answer with any mutable fact \u2014 PR ownership/state/checks, branch freshness, deployment status \u2014 consult the matching Lane B active-state hit. If its `verificationState` is `unverified` or `stale_verification`, or it carries a `laneWarning`, you MUST first re-run the live check (GitHub API/CLI, git, deploy metadata) and answer from that, or else explicitly tell the user the state is unverified/stale and needs a re-check. Never present an unverified or stale active-state fact as current truth, and never let a topically similar historical memory stand in for live state.",
|
|
947
|
-
"Worker personas (lane experts). Some tasks are attributed to a worker persona \u2014 e.g. Dalton (implementation / landing scoped code changes with verification evidence), Lorentz (deep review, risk analysis, validation gates). When you are running a persona-attributed task, call agent_os_context_envelope anchored on your current task
|
|
964
|
+
"Worker personas (lane experts). Some tasks are attributed to a worker persona \u2014 e.g. Dalton (implementation / landing scoped code changes with verification evidence), Lorentz (deep review, risk analysis, validation gates). When you are running a persona-attributed task, call agent_os_context_envelope anchored on your current task and read the `persona` block: it carries your lane-expert identity (`slug`, `displayName`, `description`) and your persona-scoped operating rules. If you do not know the task id yet, use agent_os_get_context brief or Command Center to find the anchor, then call the envelope. Treat persona operating rules as Lane A authority scoped to your lane \u2014 they are strictly additive and refine HOW you work, but they NEVER override global Lane A operating rules or Lane B active project state. If a persona rule conflicts with a global rule or with a live active-state fact, the global rule / live fact wins. When you persist a durable rule that applies only to your lane, set `personaSlug`; leave it unset for rules every worker should follow. Persona scope only ADDS rules, it never hides global rules or active project state.",
|
|
948
965
|
"When you learn a durable fact, decision, preference, project update, or lesson, persist it: agent_os_write_memory for new entries, agent_os_update_memory for revisions. Include sourceRefs plus memoryType/confidence/reviewStatus when you can; use reviewStatus=needs_review for uncertain or user-correctable memories.",
|
|
949
966
|
"For project/goal status changes, use agent_os_update_project / agent_os_update_goal so the structured record stays in sync with what you write to memory.",
|
|
950
967
|
"Use agent_os_open_session at the start of a substantive session and agent_os_log_session_event for meaningful topics, decisions, files, commits, and follow-ups. Close with agent_os_close_session (or agent_os_log_session for ad-hoc daily-log entries).",
|
|
@@ -988,7 +1005,9 @@ function buildAgentOsContinuityGuidanceContext(config) {
|
|
|
988
1005
|
"- For chat-visible PR check polling, prefer `node scripts/agent-os-pr-checks-soft.mjs <pr-number-or-url> --repo <owner/repo>` over raw `gh pr checks`. Raw `gh pr checks` exits nonzero for pending checks and creates false failed-tool alerts in Telegram; the soft wrapper exits nonzero only for real failed checks unless `--fail-on-pending` is explicitly requested.",
|
|
989
1006
|
"- For repo text search, do not pass a single filename (e.g. `package.json`) as ripgrep's path argument \u2014 that is a file, not a directory. Search from the repo root with a glob (`rg -g package.json <pattern> .`) or use `node scripts/agent-os-repo-search.mjs normalize -- '<command>'` before exec. Searching only `package.json` for `agent-os-land-pr` should use `node scripts/agent-os-land-pr.mjs <pr-url>` directly.",
|
|
990
1007
|
"- Land PRs only through the repo's narrow landing wrapper: `node scripts/agent-os-land-pr.mjs <pr-number-or-url>`. The wrapper performs live GitHub readiness checks, squash-merges exactly that PR, deletes the branch, and verifies merged state.",
|
|
991
|
-
"- If the wrapper rejects a PR as draft, conflicted, non-green, pending checks, or missing an exact PR target, mark the landing task blocked with the exact reason instead of improvising a merge path."
|
|
1008
|
+
"- If the wrapper rejects a PR as draft, conflicted, non-green, pending checks, or missing an exact PR target, mark the landing task blocked with the exact reason instead of improvising a merge path.",
|
|
1009
|
+
"- Do not land unmanaged PRs. A PR must carry a hard AgentTask reference in the PR body and the AgentTask must carry `prUrl`; if either side is missing, block it as unmanaged and repair the link before merge.",
|
|
1010
|
+
"- Any PR update sent to Telegram, AgentOS events, or Command Center summaries must include a direct PR link and a plain-English purpose, not just a PR number, task id, branch, or terse title."
|
|
992
1011
|
];
|
|
993
1012
|
return lines.join("\n");
|
|
994
1013
|
}
|
|
@@ -1328,8 +1347,14 @@ function registerTelegramReplyContextHooks({
|
|
|
1328
1347
|
var DIRECT_CHAT_CHANNEL_IDS = /* @__PURE__ */ new Set(["telegram", "webchat"]);
|
|
1329
1348
|
var RAW_TOOL_ERROR_WARNING_RE = /^⚠️\s*🛠️\s*.+\bfailed\b/ui;
|
|
1330
1349
|
var INTERNAL_TRACE_LINE_RE = /^(?:>\s*)?(?:📊|🛠️|📖|📝|🔍|🔎|⚙️)\s*(?:Session Status|Exec|Read|Edit|Write|Patch|Search|Open|Click|Find|Screenshot|Update Plan|Tool Call|Tool Result|Function Call|Shell|Command)\s*:/i;
|
|
1350
|
+
var INTERNAL_CHANNEL_LINE_RE = /^(?:>\s*)?(?:analysis|commentary|tool[-_ ]?call|tool[-_ ]?result|function[-_ ]?call|thinking|reasoning)\s*[:=]/i;
|
|
1331
1351
|
var COMPACT_TOOL_COMMAND_LINE_RE = /^(?:>\s*)?🛠️\s*(?:(?:(?:elevated|pty)\b\s*(?:·|,)\s*)+)?(?:`{1,2}\s*\S|(?:run|check|fetch|pull|push|view|show|list|switch|create|merge|rebase|stage|restore|reset|stash|search|find|print|copy|move|remove|install|start|cd|git|worktree|pnpm|npm|yarn|bun|node|python|python3|bash|sh)\b)/i;
|
|
1332
|
-
var
|
|
1352
|
+
var BARE_TOOL_STATUS_LINE_RE = /^(?:`{1,2}\s*)?🛠️\s*(?:Exec|Read|Edit|Write|Patch|Search|Open|Click|Find|Screenshot|Update Plan|Shell|Command)(?:\s*\([^)]*\))?\s*`{0,2}$/iu;
|
|
1353
|
+
var PLAIN_TOOL_PROGRESS_LINE_RE = /^print lines \d+(?:-\d+)?(?:\s+from\s+\S.*)?$/i;
|
|
1354
|
+
var CODEX_SEARCH_SCAFFOLD_LINE_RE = /^(?:search\s+)?<{4,}\|={4,}\|/i;
|
|
1355
|
+
function normalizeLineForToolFilter(line) {
|
|
1356
|
+
return line.trim().replace(/^`+|`+$/g, "").trim();
|
|
1357
|
+
}
|
|
1333
1358
|
function isDirectChatChannel(channelId) {
|
|
1334
1359
|
if (!channelId) return false;
|
|
1335
1360
|
const normalized = channelId.trim().toLowerCase();
|
|
@@ -1338,15 +1363,17 @@ function isDirectChatChannel(channelId) {
|
|
|
1338
1363
|
function isRawInternalToolFailureLine(line) {
|
|
1339
1364
|
const trimmed = line.trim();
|
|
1340
1365
|
if (!trimmed) return false;
|
|
1366
|
+
const normalized = normalizeLineForToolFilter(trimmed);
|
|
1341
1367
|
if (RAW_TOOL_ERROR_WARNING_RE.test(trimmed)) return true;
|
|
1342
|
-
if (INTERNAL_TRACE_LINE_RE.test(trimmed)) return true;
|
|
1343
|
-
if (
|
|
1344
|
-
|
|
1345
|
-
if (TOOL_AGENT_SCOPE_RE.test(trimmed)) return true;
|
|
1346
|
-
}
|
|
1347
|
-
if (/^🛠️\s+/u.test(trimmed) && /\bfailed\b/i.test(trimmed) && TOOL_AGENT_SCOPE_RE.test(trimmed)) {
|
|
1368
|
+
if (INTERNAL_TRACE_LINE_RE.test(trimmed) || INTERNAL_TRACE_LINE_RE.test(normalized)) return true;
|
|
1369
|
+
if (INTERNAL_CHANNEL_LINE_RE.test(trimmed)) return true;
|
|
1370
|
+
if (COMPACT_TOOL_COMMAND_LINE_RE.test(trimmed) || COMPACT_TOOL_COMMAND_LINE_RE.test(normalized)) {
|
|
1348
1371
|
return true;
|
|
1349
1372
|
}
|
|
1373
|
+
if (BARE_TOOL_STATUS_LINE_RE.test(trimmed) || BARE_TOOL_STATUS_LINE_RE.test(normalized)) return true;
|
|
1374
|
+
if (PLAIN_TOOL_PROGRESS_LINE_RE.test(trimmed)) return true;
|
|
1375
|
+
if (CODEX_SEARCH_SCAFFOLD_LINE_RE.test(trimmed)) return true;
|
|
1376
|
+
if (/^🛠️\s+/u.test(normalized) && /\bfailed\b/i.test(normalized)) return true;
|
|
1350
1377
|
return false;
|
|
1351
1378
|
}
|
|
1352
1379
|
function filterDirectChatOutboundContent(content) {
|
|
@@ -1479,9 +1506,18 @@ function createContactTools(config) {
|
|
|
1479
1506
|
var getContextSchema = {
|
|
1480
1507
|
type: "object",
|
|
1481
1508
|
properties: {
|
|
1509
|
+
projection: {
|
|
1510
|
+
type: "string",
|
|
1511
|
+
enum: ["brief", "full"],
|
|
1512
|
+
description: "Response shape. Default brief returns compact identity/current-work context with follow-up hints. full returns the legacy broad stats payload and can be large/truncation-prone."
|
|
1513
|
+
},
|
|
1482
1514
|
slug: {
|
|
1483
1515
|
type: "string",
|
|
1484
1516
|
description: "AgentOS slug. Omit to use the account's primary AgentOS workspace."
|
|
1517
|
+
},
|
|
1518
|
+
agentContext: {
|
|
1519
|
+
type: "string",
|
|
1520
|
+
description: "Active agent/runtime/persona context within the AgentOS workspace, e.g. ghost, forge, or hermes-forge. Keeps shared workspace state available while scoping identity and recent-session current work."
|
|
1485
1521
|
}
|
|
1486
1522
|
},
|
|
1487
1523
|
additionalProperties: false,
|
|
@@ -1527,7 +1563,7 @@ function createContextTools(config) {
|
|
|
1527
1563
|
{
|
|
1528
1564
|
name: "agent_os_get_context",
|
|
1529
1565
|
label: "AgentOS Get Context",
|
|
1530
|
-
description: "Get
|
|
1566
|
+
description: "Get compact startup context: identity/Soul-equivalent, key preferences, current-work pointers, memory stats, and follow-up instructions. Default brief stays small; projection=full returns the legacy broad stats payload.",
|
|
1531
1567
|
parameters: getContextSchema,
|
|
1532
1568
|
execute: (_toolCallId, params) => callAgentOsTool({
|
|
1533
1569
|
serverName: config.agentOsServer,
|
|
@@ -2976,6 +3012,11 @@ var commandCenterDashboardContractSchema = {
|
|
|
2976
3012
|
limit: {
|
|
2977
3013
|
type: "number",
|
|
2978
3014
|
description: "Max tasks to load when building counts (server cap 10000)."
|
|
3015
|
+
},
|
|
3016
|
+
projection: {
|
|
3017
|
+
type: "string",
|
|
3018
|
+
enum: ["mcp", "slim"],
|
|
3019
|
+
description: "mcp (default) \u2014 tiny brief flight-board (<12k). slim \u2014 full dashboard verification DTO (large)."
|
|
2979
3020
|
}
|
|
2980
3021
|
},
|
|
2981
3022
|
additionalProperties: false,
|
|
@@ -3000,6 +3041,11 @@ var commandCenterGetSchema = {
|
|
|
3000
3041
|
harnessLimit: {
|
|
3001
3042
|
type: "number",
|
|
3002
3043
|
description: "Max harness runs in the rollup (server cap 200)."
|
|
3044
|
+
},
|
|
3045
|
+
projection: {
|
|
3046
|
+
type: "string",
|
|
3047
|
+
enum: ["compact", "full"],
|
|
3048
|
+
description: "Response shape. Default compact \u2014 tiny brief flight-board (<12k). full \u2014 expensive admin/debug rollup."
|
|
3003
3049
|
}
|
|
3004
3050
|
},
|
|
3005
3051
|
additionalProperties: false,
|
|
@@ -3135,7 +3181,7 @@ function createCommandCenterTools(config) {
|
|
|
3135
3181
|
),
|
|
3136
3182
|
mk(
|
|
3137
3183
|
"agent_os_command_center_dashboard_contract_get",
|
|
3138
|
-
"
|
|
3184
|
+
"Command Center dashboard MCP brief (default): heads-up counts, running tasks, next actions, follow-up tool hints (<12k). Use projection=slim for full verification DTO.",
|
|
3139
3185
|
commandCenterDashboardContractSchema
|
|
3140
3186
|
),
|
|
3141
3187
|
mk(
|