@senpi-ai/runtime 3.0.179 → 3.0.188

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.
Files changed (163) hide show
  1. package/dist/actions/llm-decision/openclaw-llm-decision.d.ts +8 -0
  2. package/dist/actions/llm-decision/openclaw-llm-decision.d.ts.map +1 -1
  3. package/dist/actions/llm-decision/openclaw-llm-decision.js +56 -1
  4. package/dist/actions/llm-decision/openclaw-llm-decision.js.map +1 -1
  5. package/dist/approvals/approval-store.d.ts +37 -7
  6. package/dist/approvals/approval-store.d.ts.map +1 -1
  7. package/dist/approvals/approval-store.js +127 -23
  8. package/dist/approvals/approval-store.js.map +1 -1
  9. package/dist/approvals/telemetry.d.ts +28 -3
  10. package/dist/approvals/telemetry.d.ts.map +1 -1
  11. package/dist/approvals/telemetry.js +8 -4
  12. package/dist/approvals/telemetry.js.map +1 -1
  13. package/dist/approvals/tool-approval-gate.d.ts +85 -0
  14. package/dist/approvals/tool-approval-gate.d.ts.map +1 -1
  15. package/dist/approvals/tool-approval-gate.js +197 -15
  16. package/dist/approvals/tool-approval-gate.js.map +1 -1
  17. package/dist/approvals/turn-context.d.ts +296 -0
  18. package/dist/approvals/turn-context.d.ts.map +1 -0
  19. package/dist/approvals/turn-context.js +594 -0
  20. package/dist/approvals/turn-context.js.map +1 -0
  21. package/dist/cli/guide-commands.d.ts.map +1 -1
  22. package/dist/cli/guide-commands.js +18 -3
  23. package/dist/cli/guide-commands.js.map +1 -1
  24. package/dist/cli/senpi-commands.d.ts.map +1 -1
  25. package/dist/cli/senpi-commands.js +80 -5
  26. package/dist/cli/senpi-commands.js.map +1 -1
  27. package/dist/deploy/job.d.ts +32 -0
  28. package/dist/deploy/job.d.ts.map +1 -1
  29. package/dist/deploy/job.js +72 -7
  30. package/dist/deploy/job.js.map +1 -1
  31. package/dist/deploy/register.d.ts +12 -0
  32. package/dist/deploy/register.d.ts.map +1 -1
  33. package/dist/deploy/register.js +85 -2
  34. package/dist/deploy/register.js.map +1 -1
  35. package/dist/dsl/monitor/dsl-failure-events.d.ts +38 -2
  36. package/dist/dsl/monitor/dsl-failure-events.d.ts.map +1 -1
  37. package/dist/dsl/monitor/dsl-failure-events.js +67 -4
  38. package/dist/dsl/monitor/dsl-failure-events.js.map +1 -1
  39. package/dist/dsl/monitor/process-one-position.d.ts.map +1 -1
  40. package/dist/dsl/monitor/process-one-position.js +25 -1
  41. package/dist/dsl/monitor/process-one-position.js.map +1 -1
  42. package/dist/host/openclaw-host.d.ts +138 -0
  43. package/dist/host/openclaw-host.d.ts.map +1 -0
  44. package/dist/host/openclaw-host.js +177 -0
  45. package/dist/host/openclaw-host.js.map +1 -0
  46. package/dist/host/plugin-logger.d.ts +99 -0
  47. package/dist/host/plugin-logger.d.ts.map +1 -0
  48. package/dist/host/plugin-logger.js +142 -0
  49. package/dist/host/plugin-logger.js.map +1 -0
  50. package/dist/index.d.ts +56 -7
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +695 -161
  53. package/dist/index.js.map +1 -1
  54. package/dist/runtime/auto-update/coordinator.d.ts +220 -0
  55. package/dist/runtime/auto-update/coordinator.d.ts.map +1 -1
  56. package/dist/runtime/auto-update/coordinator.js +715 -22
  57. package/dist/runtime/auto-update/coordinator.js.map +1 -1
  58. package/dist/runtime/auto-update/gateway-restart.d.ts +60 -1
  59. package/dist/runtime/auto-update/gateway-restart.d.ts.map +1 -1
  60. package/dist/runtime/auto-update/gateway-restart.js +95 -21
  61. package/dist/runtime/auto-update/gateway-restart.js.map +1 -1
  62. package/dist/runtime/auto-update/idle-gate.d.ts +175 -0
  63. package/dist/runtime/auto-update/idle-gate.d.ts.map +1 -0
  64. package/dist/runtime/auto-update/idle-gate.js +229 -0
  65. package/dist/runtime/auto-update/idle-gate.js.map +1 -0
  66. package/dist/runtime/auto-update/install-results.d.ts +130 -0
  67. package/dist/runtime/auto-update/install-results.d.ts.map +1 -0
  68. package/dist/runtime/auto-update/install-results.js +264 -0
  69. package/dist/runtime/auto-update/install-results.js.map +1 -0
  70. package/dist/runtime/auto-update/money-call-tracker.d.ts +36 -0
  71. package/dist/runtime/auto-update/money-call-tracker.d.ts.map +1 -0
  72. package/dist/runtime/auto-update/money-call-tracker.js +129 -0
  73. package/dist/runtime/auto-update/money-call-tracker.js.map +1 -0
  74. package/dist/runtime/auto-update/register-idle-gate.d.ts +70 -0
  75. package/dist/runtime/auto-update/register-idle-gate.d.ts.map +1 -0
  76. package/dist/runtime/auto-update/register-idle-gate.js +127 -0
  77. package/dist/runtime/auto-update/register-idle-gate.js.map +1 -0
  78. package/dist/runtime/auto-update/run-update-command.d.ts +13 -0
  79. package/dist/runtime/auto-update/run-update-command.d.ts.map +1 -1
  80. package/dist/runtime/auto-update/run-update-command.js +18 -0
  81. package/dist/runtime/auto-update/run-update-command.js.map +1 -1
  82. package/dist/runtime/auto-update/state-store.d.ts +14 -1
  83. package/dist/runtime/auto-update/state-store.d.ts.map +1 -1
  84. package/dist/runtime/auto-update/state-store.js +37 -3
  85. package/dist/runtime/auto-update/state-store.js.map +1 -1
  86. package/dist/runtime/auto-update/types.d.ts +52 -0
  87. package/dist/runtime/auto-update/types.d.ts.map +1 -1
  88. package/dist/runtime/auto-update/types.js.map +1 -1
  89. package/dist/runtime/auto-update/update-marker.d.ts +95 -0
  90. package/dist/runtime/auto-update/update-marker.d.ts.map +1 -0
  91. package/dist/runtime/auto-update/update-marker.js +185 -0
  92. package/dist/runtime/auto-update/update-marker.js.map +1 -0
  93. package/dist/runtime/auto-update/update-schedule.d.ts +67 -0
  94. package/dist/runtime/auto-update/update-schedule.d.ts.map +1 -0
  95. package/dist/runtime/auto-update/update-schedule.js +91 -0
  96. package/dist/runtime/auto-update/update-schedule.js.map +1 -0
  97. package/dist/runtime/decision-errors.d.ts +7 -0
  98. package/dist/runtime/decision-errors.d.ts.map +1 -1
  99. package/dist/runtime/decision-errors.js +15 -0
  100. package/dist/runtime/decision-errors.js.map +1 -1
  101. package/dist/runtime/process-state.d.ts +168 -0
  102. package/dist/runtime/process-state.d.ts.map +1 -0
  103. package/dist/runtime/process-state.js +81 -0
  104. package/dist/runtime/process-state.js.map +1 -0
  105. package/dist/runtime/reconcile-state.d.ts.map +1 -1
  106. package/dist/runtime/reconcile-state.js +18 -4
  107. package/dist/runtime/reconcile-state.js.map +1 -1
  108. package/dist/runtime/strategy-registry.d.ts +16 -0
  109. package/dist/runtime/strategy-registry.d.ts.map +1 -1
  110. package/dist/runtime/strategy-registry.js +7 -3
  111. package/dist/runtime/strategy-registry.js.map +1 -1
  112. package/dist/runtime/update-apply-deps.d.ts +5 -3
  113. package/dist/runtime/update-apply-deps.d.ts.map +1 -1
  114. package/dist/runtime/update-apply-deps.js +15 -3
  115. package/dist/runtime/update-apply-deps.js.map +1 -1
  116. package/dist/senpi/client.d.ts +29 -0
  117. package/dist/senpi/client.d.ts.map +1 -1
  118. package/dist/senpi/client.js +71 -2
  119. package/dist/senpi/client.js.map +1 -1
  120. package/dist/telemetry/metrics.d.ts +15 -1
  121. package/dist/telemetry/metrics.d.ts.map +1 -1
  122. package/dist/telemetry/metrics.js +25 -1
  123. package/dist/telemetry/metrics.js.map +1 -1
  124. package/dist/telemetry/otel-sdk.d.ts +12 -0
  125. package/dist/telemetry/otel-sdk.d.ts.map +1 -1
  126. package/dist/telemetry/otel-sdk.js +47 -1
  127. package/dist/telemetry/otel-sdk.js.map +1 -1
  128. package/dist/telemetry/spans/span-hooks.d.ts +18 -1
  129. package/dist/telemetry/spans/span-hooks.d.ts.map +1 -1
  130. package/dist/telemetry/spans/span-hooks.js +306 -96
  131. package/dist/telemetry/spans/span-hooks.js.map +1 -1
  132. package/dist/telemetry/tool-plane.d.ts +2 -0
  133. package/dist/telemetry/tool-plane.d.ts.map +1 -1
  134. package/dist/telemetry/tool-plane.js +1 -0
  135. package/dist/telemetry/tool-plane.js.map +1 -1
  136. package/dist/test-setup.js +7 -1
  137. package/dist/test-setup.js.map +1 -1
  138. package/dist/tool-surface/crib-cache.d.ts +21 -0
  139. package/dist/tool-surface/crib-cache.d.ts.map +1 -0
  140. package/dist/tool-surface/crib-cache.js +54 -0
  141. package/dist/tool-surface/crib-cache.js.map +1 -0
  142. package/dist/tool-surface/crib-hook.d.ts +78 -0
  143. package/dist/tool-surface/crib-hook.d.ts.map +1 -0
  144. package/dist/tool-surface/crib-hook.js +225 -0
  145. package/dist/tool-surface/crib-hook.js.map +1 -0
  146. package/dist/tool-surface/crib-sheet.d.ts +56 -0
  147. package/dist/tool-surface/crib-sheet.d.ts.map +1 -0
  148. package/dist/tool-surface/crib-sheet.js +129 -0
  149. package/dist/tool-surface/crib-sheet.js.map +1 -0
  150. package/dist/tool-surface/mcp-tool-source.d.ts +64 -0
  151. package/dist/tool-surface/mcp-tool-source.d.ts.map +1 -0
  152. package/dist/tool-surface/mcp-tool-source.js +189 -0
  153. package/dist/tool-surface/mcp-tool-source.js.map +1 -0
  154. package/dist/utils/event-catalog.d.ts +144 -6
  155. package/dist/utils/event-catalog.d.ts.map +1 -1
  156. package/dist/utils/event-catalog.js +25 -0
  157. package/dist/utils/event-catalog.js.map +1 -1
  158. package/dist/widgets/tool.d.ts +9 -0
  159. package/dist/widgets/tool.d.ts.map +1 -1
  160. package/dist/widgets/tool.js +1 -0
  161. package/dist/widgets/tool.js.map +1 -1
  162. package/openclaw.plugin.json +11 -1
  163. package/package.json +5 -2
@@ -0,0 +1,177 @@
1
+ /**
2
+ * Facts about the OpenClaw host the runtime plugin is loaded into.
3
+ *
4
+ * The runtime ships one build to a mixed fleet: OpenClaw 2026.5.7 (protocol 3),
5
+ * 2026.5.12 (protocol 4, still the legacy plugin runtime) and 2026.10.x (the
6
+ * "modern" line). Several surfaces differ between the lines (the config write
7
+ * helpers, the `subagent_spawning` hook, tool search and its dispatcher), so
8
+ * every version-specific change in the runtime branches on the answers here.
9
+ *
10
+ * Everything in this module is pure or reads only what the host hands the
11
+ * plugin at registration. It does no I/O.
12
+ */
13
+ /**
14
+ * First OpenClaw release treated as "modern" (strict config schema,
15
+ * `runtime.config.mutateConfigFile` only, tool search, no
16
+ * `subagent_spawning`). It is the same threshold the senpi-agent wrapper uses
17
+ * (`src/lib/openclawVersion.js`, `MODERN_SINCE = [2026, 8, 1]`), so the
18
+ * wrapper and the runtime always agree on which line a box runs.
19
+ */
20
+ export const MODERN_OPENCLAW_SINCE = "2026.8.1";
21
+ const MODERN_SINCE_PARTS = [2026, 8, 1];
22
+ /**
23
+ * Parses the leading `YYYY.M.D` of an OpenClaw version string.
24
+ *
25
+ * Accepts an optional `v` prefix and any suffix (`-beta.3`, build metadata),
26
+ * so `2026.10.4`, `2026.10.4-beta.1` and `v2026.10.4` all parse to
27
+ * `[2026, 10, 4]`.
28
+ *
29
+ * @param raw - The version string, as `api.runtime.version` reports it.
30
+ * @returns The three numeric parts, or `null` when the string does not start
31
+ * with a date-shaped version.
32
+ */
33
+ function parseOpenClawVersion(raw) {
34
+ const m = raw.trim().match(/^v?(\d{4})\.(\d{1,2})\.(\d{1,3})/);
35
+ if (!m)
36
+ return null;
37
+ return [Number(m[1]), Number(m[2]), Number(m[3])];
38
+ }
39
+ /**
40
+ * Whether a host version is on the modern line (`>= 2026.8.1`).
41
+ *
42
+ * A missing or unparsable version is treated as legacy on purpose: legacy
43
+ * behaviour is what the runtime did before it knew about 10.x, and a wrong
44
+ * "modern" guess on a 5.x box would switch off paths 5.x relies on (for
45
+ * example the `writeConfigFile` restart).
46
+ *
47
+ * @param version - Host version, typically from {@link hostOpenClawVersion}.
48
+ * @returns `true` only for a parsable version at or above
49
+ * {@link MODERN_OPENCLAW_SINCE}.
50
+ */
51
+ export function isModernOpenClawHost(version) {
52
+ if (typeof version !== "string")
53
+ return false;
54
+ const parts = parseOpenClawVersion(version);
55
+ if (!parts)
56
+ return false;
57
+ for (let i = 0; i < 3; i++) {
58
+ if (parts[i] !== MODERN_SINCE_PARTS[i])
59
+ return parts[i] > MODERN_SINCE_PARTS[i];
60
+ }
61
+ return true;
62
+ }
63
+ /**
64
+ * Returns the host's OpenClaw version as the plugin runtime reports it
65
+ * (`api.runtime.version`: 5.7 `src/plugins/runtime/types-core.ts:96`, 10.10
66
+ * `:344`).
67
+ *
68
+ * @param api - The plugin API, or any object with the same shape.
69
+ * @returns The version string, or `undefined` when the host does not expose
70
+ * one (or exposes a non-string).
71
+ */
72
+ export function hostOpenClawVersion(api) {
73
+ const version = api.runtime?.version;
74
+ return typeof version === "string" ? version : undefined;
75
+ }
76
+ /**
77
+ * Reads the host's **live** OpenClaw config.
78
+ *
79
+ * `api.config` is the snapshot taken when the plugin registered, so it goes
80
+ * stale after a hot reload or a `config.patch`. `api.runtime.config.current()`
81
+ * returns the config the gateway is running with right now (present on 5.7,
82
+ * 5.12 and 10.x). This prefers `current()` and falls back to the snapshot only
83
+ * when `current` is missing or throws (a test double, or a host mid-reload).
84
+ *
85
+ * @param api - The plugin API.
86
+ * @returns The live config object, or the registration snapshot, or
87
+ * `undefined` when neither exists. The value is the host's own object and
88
+ * must be treated as read-only.
89
+ */
90
+ export function readLiveHostConfig(api) {
91
+ const current = api.runtime?.config?.current;
92
+ if (typeof current === "function") {
93
+ try {
94
+ return current.call(api.runtime?.config);
95
+ }
96
+ catch {
97
+ // fall through to the registration snapshot
98
+ }
99
+ }
100
+ return api.config;
101
+ }
102
+ /**
103
+ * Small local record guard, matching OpenClaw's `isRecord` (a non-null,
104
+ * non-array object).
105
+ */
106
+ function isRecord(value) {
107
+ return typeof value === "object" && value !== null && !Array.isArray(value);
108
+ }
109
+ /**
110
+ * Resolves the tool-search mode from a whole OpenClaw config, mirroring the
111
+ * host's own resolver (10.10 `src/agents/tool-search-config.ts:12-42`; same
112
+ * semantics as 10.4, where the boolean shortcut was written out).
113
+ *
114
+ * - `tools.toolSearch` `undefined` or `true` → `"tools"`; `false` → `"off"`.
115
+ * - An object: `enabled` is the boolean when given, else true only when some
116
+ * key other than `enabled` is set (so `{}` is `"off"`); `mode` is
117
+ * `"directory"` only when it equals `"directory"`, else `"tools"`.
118
+ * - Any other value (string, array, number) → `"off"`.
119
+ *
120
+ * On a 5.x host the key does not exist and the result is meaningless; callers
121
+ * gate on {@link isModernOpenClawHost} first.
122
+ *
123
+ * @param config - The whole OpenClaw config (for example from
124
+ * {@link readLiveHostConfig}).
125
+ * @returns The mode the host would resolve for this config.
126
+ */
127
+ export function resolveToolSearchMode(config) {
128
+ const tools = isRecord(config) && isRecord(config.tools) ? config.tools : undefined;
129
+ const toolSearch = tools?.toolSearch;
130
+ let raw;
131
+ if (toolSearch === undefined || typeof toolSearch === "boolean") {
132
+ raw = { enabled: toolSearch ?? true };
133
+ }
134
+ else {
135
+ raw = isRecord(toolSearch) ? toolSearch : {};
136
+ }
137
+ const configured = Object.keys(raw).some((key) => key !== "enabled");
138
+ const enabled = typeof raw.enabled === "boolean" ? raw.enabled : configured;
139
+ if (!enabled)
140
+ return "off";
141
+ return raw.mode === "directory" ? "directory" : "tools";
142
+ }
143
+ let hostFacts;
144
+ /**
145
+ * Records the host facts for this process. Called once at the top of plugin
146
+ * registration, before any version-gated hook is registered.
147
+ *
148
+ * A second call (the gateway re-registers the plugin on a reload) replaces the
149
+ * record, so the facts always describe the api of the latest registration.
150
+ *
151
+ * @param api - The plugin API handed to `register(api)`.
152
+ * @returns The stored record.
153
+ */
154
+ export function initOpenClawHost(api) {
155
+ const version = hostOpenClawVersion(api);
156
+ hostFacts = {
157
+ version,
158
+ modern: isModernOpenClawHost(version),
159
+ currentConfig: () => readLiveHostConfig(api),
160
+ };
161
+ return hostFacts;
162
+ }
163
+ /**
164
+ * Returns the host record stored by {@link initOpenClawHost}.
165
+ *
166
+ * @returns The record, or `undefined` before registration (unit tests, the
167
+ * standalone `run()` entry, scripts). Callers treat `undefined` as "not on
168
+ * an OpenClaw host" and keep their legacy behaviour.
169
+ */
170
+ export function getOpenClawHost() {
171
+ return hostFacts;
172
+ }
173
+ /** Clears the process-wide host record. Tests only. */
174
+ export function resetOpenClawHostForTests() {
175
+ hostFacts = undefined;
176
+ }
177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C,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/C,CAAC;IACD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC;IACrE,MAAM,OAAO,GAAG,OAAO,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;IAC5E,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,OAAO,GAAG,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC;AAC1D,CAAC;AAkBD,IAAI,SAAwC,CAAC;AAE7C;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAoB;IACnD,MAAM,OAAO,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACzC,SAAS,GAAG;QACV,OAAO;QACP,MAAM,EAAE,oBAAoB,CAAC,OAAO,CAAC;QACrC,aAAa,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,GAAG,CAAC;KAC7C,CAAC;IACF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,yBAAyB;IACvC,SAAS,GAAG,SAAS,CAAC;AACxB,CAAC"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * The loggers `register()` hands its subsystems, built on the host's `api.logger`.
3
+ *
4
+ * Two host-line differences shape them:
5
+ *
6
+ * - **`--json` CLI calls.** A CLI call that promises one JSON document on stdout cannot have startup
7
+ * chatter on stdout. OpenClaw 5.7 and 5.12 write plugin `api.logger.info` to stdout, so the
8
+ * runtime reroutes it to `console.error` there. OpenClaw 2026.5.20 and later (every modern host)
9
+ * route plugin logs to stderr themselves under `--json` (openclaw #84741,
10
+ * `src/cli/json-output-mode.ts`), and keep filing them at their real level. On those hosts the
11
+ * reroute only did harm: OpenClaw's console capture files every `console.error` line in the
12
+ * gateway file log at ERROR, so each `openclaw senpi … --json` call wrote its 13 registration
13
+ * lines as errors (dev E2E finding F5).
14
+ * - **Event visibility.** `auto_update.*` events go to the OTel logger only. A box with no
15
+ * collector (dev, or a prod box whose exporter is down) keeps no copy of them, and the human
16
+ * lines the coordinator logs lack the event fields (`apply_ms`, the install-result fields).
17
+ * On a modern host each event is therefore also written to the gateway log as one
18
+ * `key=value` line (dev E2E finding F8).
19
+ */
20
+ import { type EventName } from "../utils/event-catalog.js";
21
+ import { type EventOptions, type Logger } from "../utils/logger.js";
22
+ /**
23
+ * The host logger shape the runtime relies on (`api.logger`). Declared locally so the plugin does
24
+ * not depend on the openclaw package at compile time.
25
+ */
26
+ export interface PluginLogger {
27
+ info(...args: unknown[]): void;
28
+ warn(...args: unknown[]): void;
29
+ error(message: unknown, meta?: unknown): void;
30
+ }
31
+ /** A coordinator logger: the host logger plus the event catalog's `event()`. */
32
+ export type EventPluginLogger = PluginLogger & {
33
+ event: Logger["event"];
34
+ };
35
+ /**
36
+ * Builds the logger every `register()` subsystem uses.
37
+ *
38
+ * Info lines go to `hostLogger.info` except in a `--json` CLI call on a host that does not keep
39
+ * plugin logs off stdout itself (5.x); there they go to `console.error` so the JSON document on
40
+ * stdout stays parseable. Warnings and errors always go to the host logger unchanged.
41
+ *
42
+ * @param hostLogger - `api.logger`.
43
+ * @param opts.jsonMode - Whether this process is a `--json` CLI call (`process.argv` has `--json`).
44
+ * @param opts.hostRoutesJsonLogsToStderr - Whether the host already routes plugin logs to stderr
45
+ * under `--json`. True on every modern (>= 2026.8.1) host; false on 5.7 and 5.12, and when the
46
+ * host version is unknown, which keeps the rerouted (safe for stdout) behaviour.
47
+ * @returns The logger. Nothing is written at construction.
48
+ */
49
+ export declare function createRegisterPluginLogger(hostLogger: PluginLogger, opts: {
50
+ jsonMode: boolean;
51
+ hostRoutesJsonLogsToStderr: boolean;
52
+ }): PluginLogger;
53
+ /** Options for {@link withEventLogger}. */
54
+ export interface WithEventLoggerOptions {
55
+ /**
56
+ * When set, every event is also written to `pluginLogger` (the gateway log) as one line from
57
+ * {@link formatEventLogLine}, starting with this tag (e.g. `[senpi-auto-update]`). Omitted, events
58
+ * reach the OTel logger only, which is the 5.x behaviour.
59
+ */
60
+ mirrorTag?: string;
61
+ }
62
+ /**
63
+ * A coordinator logger: info/warn/error route through `pluginLogger` unchanged (the gateway's own
64
+ * sink), and `event()` goes to a dedicated OTel-backed logger tagged `tag`. `PluginLogger`
65
+ * (api.logger) predates the event catalog and has no `event()`, so coordinators that emit
66
+ * first-class events (auto-update, skills-manager) get this split.
67
+ *
68
+ * With `mirrorTag`, `event()` also writes the event to `pluginLogger` after the OTel emit, at the
69
+ * event's effective level (the catalog level is a floor, as in `Logger.event`). The mirror is
70
+ * best-effort: a throwing host logger never disturbs the OTel emit or the caller.
71
+ *
72
+ * @param pluginLogger - The register logger (see {@link createRegisterPluginLogger}).
73
+ * @param tag - Namespace of the OTel event logger.
74
+ * @param opts - See {@link WithEventLoggerOptions}.
75
+ * @returns The coordinator logger.
76
+ */
77
+ export declare function withEventLogger(pluginLogger: PluginLogger, tag: string, opts?: WithEventLoggerOptions): EventPluginLogger;
78
+ /** Longest line {@link formatEventLogLine} returns; the tail is replaced by `…`. */
79
+ export declare const EVENT_LOG_LINE_MAX_CHARS = 2000;
80
+ /**
81
+ * Renders one catalogued event as a single grep-able log line:
82
+ * `<tag> event=<name> key=value …`.
83
+ *
84
+ * - Attribute keys drop the event's own `senpi.<namespace>.` prefix
85
+ * (`senpi.auto_update.apply_ms` → `apply_ms` for `auto_update.applied`); other keys stay whole.
86
+ * - Values with spaces, `=`, quotes or nothing in them are JSON-quoted; numbers and booleans are
87
+ * written as is. Attributes are written in the order the call site set them.
88
+ * - `redact` fields are never written: they are free text that is only safe after the async PII
89
+ * redaction the OTel path runs, and this line is written synchronously.
90
+ * - An event that bears an `error` gets `err=` with the error's message (first line, capped).
91
+ * - The body is not written: the coordinators already log their human text beside the event.
92
+ *
93
+ * @param tag - Line prefix, e.g. `[senpi-auto-update]`.
94
+ * @param name - The event name.
95
+ * @param opts - The event options as passed to `Logger.event`.
96
+ * @returns The line, at most {@link EVENT_LOG_LINE_MAX_CHARS} characters.
97
+ */
98
+ export declare function formatEventLogLine<N extends EventName>(tag: string, name: N, opts: EventOptions<N>): string;
99
+ //# sourceMappingURL=plugin-logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-logger.d.ts","sourceRoot":"","sources":["../../src/host/plugin-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC9F,OAAO,EAAgB,KAAK,YAAY,EAAE,KAAK,MAAM,EAAiB,MAAM,oBAAoB,CAAC;AAEjG;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC/B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC/B,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/C;AAED,gFAAgF;AAChF,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;CAAE,CAAC;AAE1E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,YAAY,EACxB,IAAI,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,0BAA0B,EAAE,OAAO,CAAA;CAAE,GAC/D,YAAY,CASd;AAED,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,sBAA2B,GAChC,iBAAiB,CAqBnB;AAUD,oFAAoF;AACpF,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAK7C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,MAAM,CAc3G"}
@@ -0,0 +1,142 @@
1
+ /**
2
+ * The loggers `register()` hands its subsystems, built on the host's `api.logger`.
3
+ *
4
+ * Two host-line differences shape them:
5
+ *
6
+ * - **`--json` CLI calls.** A CLI call that promises one JSON document on stdout cannot have startup
7
+ * chatter on stdout. OpenClaw 5.7 and 5.12 write plugin `api.logger.info` to stdout, so the
8
+ * runtime reroutes it to `console.error` there. OpenClaw 2026.5.20 and later (every modern host)
9
+ * route plugin logs to stderr themselves under `--json` (openclaw #84741,
10
+ * `src/cli/json-output-mode.ts`), and keep filing them at their real level. On those hosts the
11
+ * reroute only did harm: OpenClaw's console capture files every `console.error` line in the
12
+ * gateway file log at ERROR, so each `openclaw senpi … --json` call wrote its 13 registration
13
+ * lines as errors (dev E2E finding F5).
14
+ * - **Event visibility.** `auto_update.*` events go to the OTel logger only. A box with no
15
+ * collector (dev, or a prod box whose exporter is down) keeps no copy of them, and the human
16
+ * lines the coordinator logs lack the event fields (`apply_ms`, the install-result fields).
17
+ * On a modern host each event is therefore also written to the gateway log as one
18
+ * `key=value` line (dev E2E finding F8).
19
+ */
20
+ import { canonicalSeverity } from "../utils/event-catalog.js";
21
+ import { createLogger } from "../utils/logger.js";
22
+ /**
23
+ * Builds the logger every `register()` subsystem uses.
24
+ *
25
+ * Info lines go to `hostLogger.info` except in a `--json` CLI call on a host that does not keep
26
+ * plugin logs off stdout itself (5.x); there they go to `console.error` so the JSON document on
27
+ * stdout stays parseable. Warnings and errors always go to the host logger unchanged.
28
+ *
29
+ * @param hostLogger - `api.logger`.
30
+ * @param opts.jsonMode - Whether this process is a `--json` CLI call (`process.argv` has `--json`).
31
+ * @param opts.hostRoutesJsonLogsToStderr - Whether the host already routes plugin logs to stderr
32
+ * under `--json`. True on every modern (>= 2026.8.1) host; false on 5.7 and 5.12, and when the
33
+ * host version is unknown, which keeps the rerouted (safe for stdout) behaviour.
34
+ * @returns The logger. Nothing is written at construction.
35
+ */
36
+ export function createRegisterPluginLogger(hostLogger, opts) {
37
+ const rerouteInfo = opts.jsonMode && !opts.hostRoutesJsonLogsToStderr;
38
+ return {
39
+ // No added prefix: the messages already carry their own `[senpi-runtime]` /
40
+ // `[senpi-tool-approvals]` tag, and prepending another produced doubled labels on stderr.
41
+ info: (...args) => (rerouteInfo ? console.error(...args) : hostLogger.info(...args)),
42
+ warn: (...args) => hostLogger.warn(...args),
43
+ error: (message, meta) => hostLogger.error(message, meta),
44
+ };
45
+ }
46
+ /**
47
+ * A coordinator logger: info/warn/error route through `pluginLogger` unchanged (the gateway's own
48
+ * sink), and `event()` goes to a dedicated OTel-backed logger tagged `tag`. `PluginLogger`
49
+ * (api.logger) predates the event catalog and has no `event()`, so coordinators that emit
50
+ * first-class events (auto-update, skills-manager) get this split.
51
+ *
52
+ * With `mirrorTag`, `event()` also writes the event to `pluginLogger` after the OTel emit, at the
53
+ * event's effective level (the catalog level is a floor, as in `Logger.event`). The mirror is
54
+ * best-effort: a throwing host logger never disturbs the OTel emit or the caller.
55
+ *
56
+ * @param pluginLogger - The register logger (see {@link createRegisterPluginLogger}).
57
+ * @param tag - Namespace of the OTel event logger.
58
+ * @param opts - See {@link WithEventLoggerOptions}.
59
+ * @returns The coordinator logger.
60
+ */
61
+ export function withEventLogger(pluginLogger, tag, opts = {}) {
62
+ const eventLogger = createLogger(tag);
63
+ const { mirrorTag } = opts;
64
+ return {
65
+ info: (...args) => pluginLogger.info(...args),
66
+ warn: (...args) => pluginLogger.warn(...args),
67
+ error: (message, meta) => pluginLogger.error(message, meta),
68
+ event: (name, level, eventOpts) => {
69
+ eventLogger.event(name, level, eventOpts);
70
+ if (mirrorTag === undefined)
71
+ return;
72
+ try {
73
+ const line = formatEventLogLine(mirrorTag, name, eventOpts);
74
+ const effective = effectiveLevel(name, level);
75
+ if (effective === "error")
76
+ pluginLogger.error(line);
77
+ else if (effective === "warn")
78
+ pluginLogger.warn(line);
79
+ else
80
+ pluginLogger.info(line);
81
+ }
82
+ catch {
83
+ // The mirror is a convenience copy; it must never break the event emit or its caller.
84
+ }
85
+ },
86
+ };
87
+ }
88
+ const LEVEL_ORDER = { debug: 0, info: 1, warn: 2, error: 3 };
89
+ /** The catalog severity is a floor: a caller may escalate an event but never demote it. */
90
+ function effectiveLevel(name, level) {
91
+ const canonical = canonicalSeverity(name);
92
+ return LEVEL_ORDER[level] >= LEVEL_ORDER[canonical] ? level : canonical;
93
+ }
94
+ /** Longest line {@link formatEventLogLine} returns; the tail is replaced by `…`. */
95
+ export const EVENT_LOG_LINE_MAX_CHARS = 2000;
96
+ /** Longest `err=` value {@link formatEventLogLine} writes. */
97
+ const EVENT_LOG_ERR_MAX_CHARS = 300;
98
+ /**
99
+ * Renders one catalogued event as a single grep-able log line:
100
+ * `<tag> event=<name> key=value …`.
101
+ *
102
+ * - Attribute keys drop the event's own `senpi.<namespace>.` prefix
103
+ * (`senpi.auto_update.apply_ms` → `apply_ms` for `auto_update.applied`); other keys stay whole.
104
+ * - Values with spaces, `=`, quotes or nothing in them are JSON-quoted; numbers and booleans are
105
+ * written as is. Attributes are written in the order the call site set them.
106
+ * - `redact` fields are never written: they are free text that is only safe after the async PII
107
+ * redaction the OTel path runs, and this line is written synchronously.
108
+ * - An event that bears an `error` gets `err=` with the error's message (first line, capped).
109
+ * - The body is not written: the coordinators already log their human text beside the event.
110
+ *
111
+ * @param tag - Line prefix, e.g. `[senpi-auto-update]`.
112
+ * @param name - The event name.
113
+ * @param opts - The event options as passed to `Logger.event`.
114
+ * @returns The line, at most {@link EVENT_LOG_LINE_MAX_CHARS} characters.
115
+ */
116
+ export function formatEventLogLine(tag, name, opts) {
117
+ const parts = [`${tag} event=${name}`];
118
+ const ownPrefix = `senpi.${name.split(".")[0]}.`;
119
+ const attributes = (opts.attributes ?? {});
120
+ for (const [key, value] of Object.entries(attributes)) {
121
+ if (value === undefined)
122
+ continue;
123
+ const shortKey = key.startsWith(ownPrefix) ? key.slice(ownPrefix.length) : key;
124
+ parts.push(`${shortKey}=${formatValue(value)}`);
125
+ }
126
+ if (opts.error !== undefined) {
127
+ parts.push(`err=${formatValue(errorMessage(opts.error))}`);
128
+ }
129
+ const line = parts.join(" ");
130
+ return line.length > EVENT_LOG_LINE_MAX_CHARS ? `${line.slice(0, EVENT_LOG_LINE_MAX_CHARS - 1)}…` : line;
131
+ }
132
+ function formatValue(value) {
133
+ if (typeof value !== "string")
134
+ return String(value);
135
+ return value.length === 0 || /[\s="]/.test(value) ? JSON.stringify(value) : value;
136
+ }
137
+ function errorMessage(error) {
138
+ const raw = error instanceof Error ? error.message : String(error);
139
+ const firstLine = raw.split("\n", 1)[0] ?? "";
140
+ return firstLine.length > EVENT_LOG_ERR_MAX_CHARS ? `${firstLine.slice(0, EVENT_LOG_ERR_MAX_CHARS - 1)}…` : firstLine;
141
+ }
142
+ //# sourceMappingURL=plugin-logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-logger.js","sourceRoot":"","sources":["../../src/host/plugin-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,iBAAiB,EAAkC,MAAM,2BAA2B,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAiD,MAAM,oBAAoB,CAAC;AAejG;;;;;;;;;;;;;GAaG;A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AC,CAAC,CAAC,KAAK,CAAC;AACpF,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,MAAM,GAAG,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnE,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9C,OAAO,SAAS,CAAC,MAAM,GAAG,uBAAuB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,uBAAuB,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;AACxH,CAAC"}
package/dist/index.d.ts CHANGED
@@ -14,6 +14,7 @@
14
14
  import { type StrategiesBroadcastFn } from "./runtime/strategies-telemetry.js";
15
15
  import type { SenpiEventBus } from "./dsl/events/index.js";
16
16
  import { type ToolApprovalsMode } from "./approvals/tool-approval-gate.js";
17
+ import { type PluginLogger } from "./host/plugin-logger.js";
17
18
  /** Initialize all core features (DSL, risk, health) on the given event bus. */
18
19
  export declare function initCore(bus: SenpiEventBus): void;
19
20
  export { initDsl, DslPlugin, dslLogger, setDslLogLevel, parseDslPluginConfig, DslConfigValidationError, dslValidationIssue, EVENTS as DslEvents, DSL_EVENTS, } from "./dsl/index.js";
@@ -65,6 +66,14 @@ export interface SenpiRuntimePluginConfig {
65
66
  * tool is not registered at all.
66
67
  */
67
68
  widgets?: Record<string, boolean>;
69
+ /**
70
+ * OpenClaw 10.x tool-surface aids (src/tool-surface/). `crib: false` turns
71
+ * off the `senpi__` crib sheet prepended in tool-search directory mode;
72
+ * absent or `true` keeps it on. Ignored on 5.x hosts.
73
+ */
74
+ toolSurface?: {
75
+ crib?: boolean;
76
+ };
68
77
  skillsManager?: {
69
78
  enabled?: boolean;
70
79
  /**
@@ -100,11 +109,6 @@ export interface SenpiRuntimePluginConfig {
100
109
  }>;
101
110
  };
102
111
  }
103
- interface PluginLogger {
104
- info(...args: unknown[]): void;
105
- warn(...args: unknown[]): void;
106
- error(message: unknown, meta?: unknown): void;
107
- }
108
112
  /**
109
113
  * Mirrors openclaw's `OperatorScope` union (gateway/operator-scopes.ts).
110
114
  * Declared locally because openclaw's plugin-sdk does not re-export this type
@@ -122,13 +126,47 @@ interface PluginApi {
122
126
  pluginConfig?: Record<string, unknown>;
123
127
  logger: PluginLogger;
124
128
  config?: Record<string, unknown>;
129
+ /**
130
+ * Which registration pass this is (5.7 `src/plugins/types.ts:2242`, 10.10
131
+ * `src/plugins/plugin-registration.types.ts:503`). `"cli-metadata"` is the
132
+ * pass that only collects CLI command roots; on 10.x `runtime` throws on any
133
+ * read in it. Absent on hosts that predate the field.
134
+ */
135
+ registrationMode?: string;
125
136
  runtime: {
137
+ /**
138
+ * Host OpenClaw version (`PluginRuntimeCore.version`). Read once at
139
+ * registration by `initOpenClawHost` (src/host/openclaw-host.ts) to decide
140
+ * between the legacy (5.x) and modern (>= 2026.8.1) code paths.
141
+ */
142
+ version?: string;
126
143
  state: {
127
144
  resolveStateDir(): string;
128
145
  };
129
146
  config?: {
130
- loadConfig(): Promise<unknown>;
131
- writeConfigFile(config: unknown): Promise<void>;
147
+ /** Live config snapshot; present on 5.7, 5.12 and 10.x. */
148
+ current?(): unknown;
149
+ /**
150
+ * Focused config write with an explicit follow-up (10.10
151
+ * `src/plugins/runtime/types-core.ts:348-370`; `afterWrite` shape from
152
+ * `src/config/runtime-snapshot.ts:54-57`). The only write helper on 10.x.
153
+ */
154
+ mutateConfigFile?(params: {
155
+ afterWrite: {
156
+ mode: "auto";
157
+ } | {
158
+ mode: "restart";
159
+ reason: string;
160
+ } | {
161
+ mode: "none";
162
+ reason: string;
163
+ };
164
+ mutate: (draft: Record<string, unknown>) => void;
165
+ }): Promise<unknown>;
166
+ /** 5.x only; removed on 10.x (first gone in 2026.7.2-beta.4). */
167
+ loadConfig?(): Promise<unknown>;
168
+ /** 5.x only; removed on 10.x (Box A on 10.10: `hasWriteConfigFile:false`). */
169
+ writeConfigFile?(config: unknown): Promise<void>;
132
170
  };
133
171
  };
134
172
  registerService(service: {
@@ -172,6 +210,17 @@ interface PluginApi {
172
210
  timeoutMs?: number;
173
211
  }): void;
174
212
  }
213
+ /**
214
+ * Clears the process-state latch for the 5.x "cannot classify runs" notice
215
+ * (`legacyTurnClassificationNoticeLogged`). Tests only.
216
+ *
217
+ * The latch lives in the process state so a plugin reload (which re-registers the plugin and
218
+ * restarts its service in the same process, from a new copy of this module) does not repeat the
219
+ * notice. The 5.x case is a host-version limit with no config fix, so one info line per process is
220
+ * the whole message; the fixable 10.x case stays an ERROR at every registration and does not read
221
+ * this latch.
222
+ */
223
+ export declare function resetLegacyTurnClassificationNoticeForTests(): void;
175
224
  /**
176
225
  * OpenClaw plugin entry.
177
226
  * Boots from internal registry (installed_runtimes.json) in stateDir; does not read runtime list from config.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAiBH,OAAO,EAA6B,KAAK,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AA+C1G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAoB3D,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,mCAAmC,CAAC;AAuC3C,+EAA+E;AAC/E,wBAAgB,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAIjD;AAGD,OAAO,EACL,OAAO,EACP,SAAS,EACT,SAAS,EACT,cAAc,EACd,oBAAoB,EACpB,wBAAwB,EACxB,kBAAkB,EAClB,MAAM,IAAI,SAAS,EACnB,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,QAAQ,EACR,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,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