@senpi/runtime 3.0.81 → 3.0.83
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/actions/decision-engine.d.ts +16 -0
- package/dist/actions/decision-engine.d.ts.map +1 -1
- package/dist/actions/decision-engine.js +137 -1
- package/dist/actions/decision-engine.js.map +1 -1
- package/dist/cli/guide-commands.d.ts.map +1 -1
- package/dist/cli/guide-commands.js +33 -0
- package/dist/cli/guide-commands.js.map +1 -1
- package/dist/cli/senpi-commands.d.ts.map +1 -1
- package/dist/cli/senpi-commands.js +12 -0
- package/dist/cli/senpi-commands.js.map +1 -1
- package/dist/cli/update-command.d.ts +70 -0
- package/dist/cli/update-command.d.ts.map +1 -0
- package/dist/cli/update-command.js +132 -0
- package/dist/cli/update-command.js.map +1 -0
- package/dist/dsl/plugin/index.d.ts +35 -1
- package/dist/dsl/plugin/index.d.ts.map +1 -1
- package/dist/dsl/plugin/index.js +62 -7
- package/dist/dsl/plugin/index.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +87 -6
- package/dist/index.js.map +1 -1
- package/dist/runtime/effective-config.d.ts +67 -0
- package/dist/runtime/effective-config.d.ts.map +1 -0
- package/dist/runtime/effective-config.js +324 -0
- package/dist/runtime/effective-config.js.map +1 -0
- package/dist/runtime/lifecycle-events.d.ts +19 -0
- package/dist/runtime/lifecycle-events.d.ts.map +1 -1
- package/dist/runtime/lifecycle-events.js +27 -0
- package/dist/runtime/lifecycle-events.js.map +1 -1
- package/dist/runtime/rebuild-errors.d.ts +26 -0
- package/dist/runtime/rebuild-errors.d.ts.map +1 -0
- package/dist/runtime/rebuild-errors.js +36 -0
- package/dist/runtime/rebuild-errors.js.map +1 -0
- package/dist/runtime/run.d.ts +10 -0
- package/dist/runtime/run.d.ts.map +1 -1
- package/dist/runtime/run.js +13 -1
- package/dist/runtime/run.js.map +1 -1
- package/dist/runtime/runtime.d.ts +99 -1
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +321 -127
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/update-apply-deps.d.ts +43 -0
- package/dist/runtime/update-apply-deps.d.ts.map +1 -0
- package/dist/runtime/update-apply-deps.js +62 -0
- package/dist/runtime/update-apply-deps.js.map +1 -0
- package/dist/runtime/update-handler.d.ts +158 -0
- package/dist/runtime/update-handler.d.ts.map +1 -0
- package/dist/runtime/update-handler.js +252 -0
- package/dist/runtime/update-handler.js.map +1 -0
- package/dist/runtime/update-plan.d.ts +60 -0
- package/dist/runtime/update-plan.d.ts.map +1 -0
- package/dist/runtime/update-plan.js +164 -0
- package/dist/runtime/update-plan.js.map +1 -0
- package/dist/runtime/update-register.d.ts +72 -0
- package/dist/runtime/update-register.d.ts.map +1 -0
- package/dist/runtime/update-register.js +146 -0
- package/dist/runtime/update-register.js.map +1 -0
- package/dist/runtime/update-report.d.ts +93 -0
- package/dist/runtime/update-report.d.ts.map +1 -0
- package/dist/runtime/update-report.js +133 -0
- package/dist/runtime/update-report.js.map +1 -0
- package/dist/skills-manager/manifest.d.ts.map +1 -1
- package/dist/skills-manager/manifest.js +1 -0
- package/dist/skills-manager/manifest.js.map +1 -1
- package/dist/skills-manager/skills-manifest.json +1 -0
- package/dist/utils/event-catalog.d.ts +26 -0
- package/dist/utils/event-catalog.d.ts.map +1 -1
- package/dist/utils/event-catalog.js +1 -0
- package/dist/utils/event-catalog.js.map +1 -1
- package/dist/widgets/errors.d.ts +3 -15
- package/dist/widgets/errors.d.ts.map +1 -1
- package/dist/widgets/errors.js +3 -20
- package/dist/widgets/errors.js.map +1 -1
- package/dist/widgets/index.d.ts +3 -10
- package/dist/widgets/index.d.ts.map +1 -1
- package/dist/widgets/index.js +3 -6
- package/dist/widgets/index.js.map +1 -1
- package/dist/widgets/registry.d.ts.map +1 -1
- package/dist/widgets/registry.js +10 -3
- package/dist/widgets/registry.js.map +1 -1
- package/dist/widgets/tool.d.ts +6 -9
- package/dist/widgets/tool.d.ts.map +1 -1
- package/dist/widgets/tool.js +37 -147
- package/dist/widgets/tool.js.map +1 -1
- package/dist/widgets/types.d.ts +20 -58
- package/dist/widgets/types.d.ts.map +1 -1
- package/dist/widgets/types.js +4 -4
- package/dist/widgets/widgets/fund-user-wallet.d.ts +4 -5
- package/dist/widgets/widgets/fund-user-wallet.d.ts.map +1 -1
- package/dist/widgets/widgets/fund-user-wallet.js +27 -67
- package/dist/widgets/widgets/fund-user-wallet.js.map +1 -1
- package/openclaw.plugin.json +1 -4
- package/package.json +2 -3
- package/dist/widgets/strategy-lookup.d.ts +0 -39
- package/dist/widgets/strategy-lookup.d.ts.map +0 -1
- package/dist/widgets/strategy-lookup.js +0 -70
- package/dist/widgets/strategy-lookup.js.map +0 -1
- package/dist/widgets/widgets/fund-strategy-wallet.d.ts +0 -13
- package/dist/widgets/widgets/fund-strategy-wallet.d.ts.map +0 -1
- package/dist/widgets/widgets/fund-strategy-wallet.js +0 -139
- package/dist/widgets/widgets/fund-strategy-wallet.js.map +0 -1
- package/skills/senpi-widgets/SKILL.md +0 -167
package/dist/widgets/errors.d.ts
CHANGED
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
3
|
-
*
|
|
4
|
-
* the
|
|
5
|
-
* to retry with the same args; a model told the first is expected to change them.
|
|
2
|
+
* The one way a `show_widget` call fails on purpose: the args are wrong. It
|
|
3
|
+
* reaches the model as a tool error and carries the offending field names, so
|
|
4
|
+
* the WARN log and the model see the same list.
|
|
6
5
|
*/
|
|
7
|
-
/** Carries the offending field names so the WARN log and the model see the same list. */
|
|
8
6
|
export declare class WidgetValidationError extends Error {
|
|
9
7
|
readonly widgetType: string;
|
|
10
8
|
readonly fields: string[];
|
|
11
9
|
constructor(message: string, widgetType: string, fields: string[]);
|
|
12
10
|
}
|
|
13
|
-
/**
|
|
14
|
-
* A check the widget needs could not be completed — the backend timed out,
|
|
15
|
-
* answered unusably, or is not wired in. The args are not blamed: they were
|
|
16
|
-
* never judged.
|
|
17
|
-
*/
|
|
18
|
-
export declare class WidgetLookupError extends Error {
|
|
19
|
-
readonly widgetType: string;
|
|
20
|
-
readonly cause?: unknown | undefined;
|
|
21
|
-
constructor(message: string, widgetType: string, cause?: unknown | undefined);
|
|
22
|
-
}
|
|
23
11
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/widgets/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/widgets/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAG5C,QAAQ,CAAC,UAAU,EAAE,MAAM;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE;gBAFzB,OAAO,EAAE,MAAM,EACN,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EAAE;CAK5B"}
|
package/dist/widgets/errors.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
3
|
-
*
|
|
4
|
-
* the
|
|
5
|
-
* to retry with the same args; a model told the first is expected to change them.
|
|
2
|
+
* The one way a `show_widget` call fails on purpose: the args are wrong. It
|
|
3
|
+
* reaches the model as a tool error and carries the offending field names, so
|
|
4
|
+
* the WARN log and the model see the same list.
|
|
6
5
|
*/
|
|
7
|
-
/** Carries the offending field names so the WARN log and the model see the same list. */
|
|
8
6
|
export class WidgetValidationError extends Error {
|
|
9
7
|
widgetType;
|
|
10
8
|
fields;
|
|
@@ -15,19 +13,4 @@ export class WidgetValidationError extends Error {
|
|
|
15
13
|
this.name = "WidgetValidationError";
|
|
16
14
|
}
|
|
17
15
|
}
|
|
18
|
-
/**
|
|
19
|
-
* A check the widget needs could not be completed — the backend timed out,
|
|
20
|
-
* answered unusably, or is not wired in. The args are not blamed: they were
|
|
21
|
-
* never judged.
|
|
22
|
-
*/
|
|
23
|
-
export class WidgetLookupError extends Error {
|
|
24
|
-
widgetType;
|
|
25
|
-
cause;
|
|
26
|
-
constructor(message, widgetType, cause) {
|
|
27
|
-
super(message);
|
|
28
|
-
this.widgetType = widgetType;
|
|
29
|
-
this.cause = cause;
|
|
30
|
-
this.name = "WidgetLookupError";
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
16
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/widgets/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/widgets/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAGnC;IACA;IAHX,YACE,OAAe,EACN,UAAkB,EAClB,MAAgB;QAEzB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHN,eAAU,GAAV,UAAU,CAAQ;QAClB,WAAM,GAAN,MAAM,CAAU;QAGzB,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF"}
|
package/dist/widgets/index.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WidgetLogger } from "./types.js";
|
|
2
2
|
export { WIDGET_SPECS, buildWidgetRegistry } from "./registry.js";
|
|
3
3
|
export type { WidgetRegistry, WidgetsConfig } from "./registry.js";
|
|
4
|
-
export {
|
|
5
|
-
export { STRATEGY_LOOKUP_TIMEOUT_MS, createSenpiStrategyLookup, isWalletAddress, } from "./strategy-lookup.js";
|
|
6
|
-
export type { StrategyLister } from "./strategy-lookup.js";
|
|
4
|
+
export { WidgetValidationError } from "./errors.js";
|
|
7
5
|
export { SHOW_WIDGET_TOOL_NAME, buildShowWidgetDescription, buildShowWidgetParameters, createShowWidgetTool, } from "./tool.js";
|
|
8
6
|
export type { ShowWidgetTool, ShowWidgetToolResult } from "./tool.js";
|
|
9
|
-
export type { RegisteredWidget,
|
|
7
|
+
export type { RegisteredWidget, WidgetPayload, WidgetResult, WidgetSpec } from "./types.js";
|
|
10
8
|
/** The slice of the OpenClaw plugin API this module needs. */
|
|
11
9
|
export interface WidgetToolPluginApi {
|
|
12
10
|
registerTool(tool: (ctx: {
|
|
@@ -21,11 +19,6 @@ export interface RegisterShowWidgetToolOptions {
|
|
|
21
19
|
/** The plugin config `widgets` block: `{ "<widget_type>": boolean }`. */
|
|
22
20
|
widgetsConfig?: unknown;
|
|
23
21
|
logger?: WidgetLogger;
|
|
24
|
-
/**
|
|
25
|
-
* Backend the address-validating widgets check against. Omitting it does not
|
|
26
|
-
* loosen them: they refuse the call rather than render an unverified card.
|
|
27
|
-
*/
|
|
28
|
-
strategies?: StrategyLookup;
|
|
29
22
|
}
|
|
30
23
|
/**
|
|
31
24
|
* Register `show_widget` as a plugin tool factory.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/widgets/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/widgets/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAClE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE5F,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,YAAY,CACV,IAAI,EAAE,CAAC,GAAG,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,EAC9C,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAC9C,IAAI,CAAC;CACT;AAED,MAAM,WAAW,6BAA6B;IAC5C,GAAG,EAAE,mBAAmB,CAAC;IACzB,yEAAyE;IACzE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CA0BtF"}
|
package/dist/widgets/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { buildWidgetRegistry } from "./registry.js";
|
|
2
2
|
import { SHOW_WIDGET_TOOL_NAME, buildShowWidgetParameters, createShowWidgetTool, } from "./tool.js";
|
|
3
3
|
export { WIDGET_SPECS, buildWidgetRegistry } from "./registry.js";
|
|
4
|
-
export {
|
|
5
|
-
export { STRATEGY_LOOKUP_TIMEOUT_MS, createSenpiStrategyLookup, isWalletAddress, } from "./strategy-lookup.js";
|
|
4
|
+
export { WidgetValidationError } from "./errors.js";
|
|
6
5
|
export { SHOW_WIDGET_TOOL_NAME, buildShowWidgetDescription, buildShowWidgetParameters, createShowWidgetTool, } from "./tool.js";
|
|
7
6
|
/**
|
|
8
7
|
* Register `show_widget` as a plugin tool factory.
|
|
@@ -14,21 +13,19 @@ export { SHOW_WIDGET_TOOL_NAME, buildShowWidgetDescription, buildShowWidgetParam
|
|
|
14
13
|
*/
|
|
15
14
|
export function registerShowWidgetTool(options) {
|
|
16
15
|
const { api, logger } = options;
|
|
16
|
+
// A duplicate widget_type throws here, at registration, where src/index.ts
|
|
17
|
+
// turns it into a WARN rather than failing every agent turn.
|
|
17
18
|
const registry = buildWidgetRegistry(options.widgetsConfig);
|
|
18
19
|
const enabled = registry.enabledTypes();
|
|
19
20
|
if (enabled.length === 0) {
|
|
20
21
|
logger?.warn("[senpi-widgets] every widget type is disabled in plugin config — show_widget not registered");
|
|
21
22
|
return false;
|
|
22
23
|
}
|
|
23
|
-
// Build the schema once here so a bad spec (duplicate field name declared with
|
|
24
|
-
// conflicting types, a field named widget_type) fails registration, where
|
|
25
|
-
// src/index.ts turns it into a WARN, rather than every agent turn.
|
|
26
24
|
buildShowWidgetParameters(registry);
|
|
27
25
|
api.registerTool((ctx) => createShowWidgetTool({
|
|
28
26
|
registry,
|
|
29
27
|
logger,
|
|
30
28
|
sessionId: ctx?.sessionId,
|
|
31
|
-
strategies: options.strategies,
|
|
32
29
|
}), { names: [SHOW_WIDGET_TOOL_NAME] });
|
|
33
30
|
logger?.info(`[senpi-widgets] ${SHOW_WIDGET_TOOL_NAME} registered | widget_types=${enabled.join(",")}`);
|
|
34
31
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/widgets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAElE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/widgets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAElE,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,WAAW,CAAC;AAmBnB;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAsC;IAC3E,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAChC,2EAA2E;IAC3E,6DAA6D;IAC7D,MAAM,QAAQ,GAAG,mBAAmB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC;IACxC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,EAAE,IAAI,CACV,6FAA6F,CAC9F,CAAC;QACF,OAAO,KAAK,CAAC;IACf,CAAC;IACD,yBAAyB,CAAC,QAAQ,CAAC,CAAC;IACpC,GAAG,CAAC,YAAY,CACd,CAAC,GAA2B,EAAE,EAAE,CAC9B,oBAAoB,CAAC;QACnB,QAAQ;QACR,MAAM;QACN,SAAS,EAAE,GAAG,EAAE,SAAS;KAC1B,CAAC,EACJ,EAAE,KAAK,EAAE,CAAC,qBAAqB,CAAC,EAAE,CACnC,CAAC;IACF,MAAM,EAAE,IAAI,CACV,mBAAmB,qBAAqB,8BAA8B,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAC1F,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/widgets/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/widgets/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG/D;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAAyB,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpD,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,GAAG,IAAI,SAAS,gBAAgB,EAAE,CAAC;IACnC,yEAAyE;IACzE,OAAO,IAAI,SAAS,gBAAgB,EAAE,CAAC;IACvC,+CAA+C;IAC/C,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAAC;IACtD,YAAY,IAAI,MAAM,EAAE,CAAC;CAC1B;AAED,wBAAgB,mBAAmB,CACjC,MAAM,CAAC,EAAE,OAAO,EAChB,KAAK,GAAE,SAAS,UAAU,EAAiB,GAC1C,cAAc,CAyBhB"}
|
package/dist/widgets/registry.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { fundStrategyWalletSpec } from "./widgets/fund-strategy-wallet.js";
|
|
2
1
|
import { fundUserWalletSpec } from "./widgets/fund-user-wallet.js";
|
|
3
2
|
/**
|
|
4
3
|
* Every widget type this plugin can render. Adding one here adds it to the
|
|
5
4
|
* `show_widget` enum, to the generated tool description, and to the config
|
|
6
5
|
* gate — the tool name and the manifest are untouched.
|
|
7
6
|
*/
|
|
8
|
-
export const WIDGET_SPECS = [fundUserWalletSpec
|
|
7
|
+
export const WIDGET_SPECS = [fundUserWalletSpec];
|
|
9
8
|
export function buildWidgetRegistry(config, specs = WIDGET_SPECS) {
|
|
10
9
|
const gate = config && typeof config === "object" && !Array.isArray(config)
|
|
11
10
|
? config
|
|
@@ -14,7 +13,15 @@ export function buildWidgetRegistry(config, specs = WIDGET_SPECS) {
|
|
|
14
13
|
...spec,
|
|
15
14
|
enabled: gate?.[spec.widgetType] !== false,
|
|
16
15
|
}));
|
|
17
|
-
const byType = new Map(
|
|
16
|
+
const byType = new Map();
|
|
17
|
+
for (const widget of widgets) {
|
|
18
|
+
// The enum and this map both key on the type, so a duplicate would shadow a
|
|
19
|
+
// widget and put the same value in the enum twice instead of failing.
|
|
20
|
+
if (byType.has(widget.widgetType)) {
|
|
21
|
+
throw new Error(`show_widget: two widget specs declare widget_type "${widget.widgetType}"`);
|
|
22
|
+
}
|
|
23
|
+
byType.set(widget.widgetType, widget);
|
|
24
|
+
}
|
|
18
25
|
const enabled = widgets.filter((w) => w.enabled);
|
|
19
26
|
return {
|
|
20
27
|
all: () => widgets,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/widgets/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/widgets/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,kBAAkB,CAAC,CAAC;AAmBxE,MAAM,UAAU,mBAAmB,CACjC,MAAgB,EAChB,QAA+B,YAAY;IAE3C,MAAM,IAAI,GACR,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAC5D,CAAC,CAAE,MAAkC;QACrC,CAAC,CAAC,SAAS,CAAC;IAChB,MAAM,OAAO,GAAuB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACvD,GAAG,IAAI;QACP,OAAO,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,KAAK;KAC3C,CAAC,CAAC,CAAC;IACJ,MAAM,MAAM,GAAG,IAAI,GAAG,EAA4B,CAAC;IACnD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,4EAA4E;QAC5E,sEAAsE;QACtE,IAAI,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,sDAAsD,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC;QAC9F,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACxC,CAAC;IACD,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACjD,OAAO;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO;QAClB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO;QACtB,GAAG,EAAE,CAAC,UAAkB,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC;QACnD,YAAY,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;KACrD,CAAC;AACJ,CAAC"}
|
package/dist/widgets/tool.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { WidgetRegistry } from "./registry.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { WidgetLogger, WidgetPayload } from "./types.js";
|
|
3
3
|
/**
|
|
4
4
|
* The plugin's single agent tool. The name is static — new widget types are
|
|
5
5
|
* new `widget_type` enum values, never new tools — so it is declared once in
|
|
@@ -24,22 +24,19 @@ export interface CreateShowWidgetToolOptions {
|
|
|
24
24
|
logger?: WidgetLogger;
|
|
25
25
|
/** Ephemeral session id from the plugin tool factory context; logged only. */
|
|
26
26
|
sessionId?: string;
|
|
27
|
-
/** Backend a widget validates addresses against. Absent = those widgets fail closed. */
|
|
28
|
-
strategies?: StrategyLookup;
|
|
29
27
|
}
|
|
30
28
|
/**
|
|
31
|
-
* Tool description, generated from the enabled specs.
|
|
32
|
-
* model
|
|
33
|
-
* the
|
|
29
|
+
* Tool description, generated from the enabled specs. Nothing else teaches the
|
|
30
|
+
* model about these cards, so this text carries the condition that should make
|
|
31
|
+
* it call the tool, not just the shape of the call.
|
|
34
32
|
*/
|
|
35
33
|
export declare function buildShowWidgetDescription(registry: WidgetRegistry): string;
|
|
36
34
|
/**
|
|
37
35
|
* Declared JSON schema: one flat object, no unions at any depth.
|
|
38
36
|
*
|
|
39
37
|
* OpenClaw flattens top-level unions, Gemini flattens nested ones, and OpenAI
|
|
40
|
-
* strict mode rejects a schema containing one anywhere
|
|
41
|
-
*
|
|
42
|
-
* per-widget requiredness is enforced in `execute()`.
|
|
38
|
+
* strict mode rejects a schema containing one anywhere. `widget_type` is the
|
|
39
|
+
* only parameter, and it is required.
|
|
43
40
|
*/
|
|
44
41
|
export declare function buildShowWidgetParameters(registry: WidgetRegistry): Record<string, unknown>;
|
|
45
42
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/widgets/tool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/widgets/tool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAoB,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AAInD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC7E;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,cAAc,CAAC;IACzB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CAsB3E;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiB3F;AAmED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,cAAc,CAkCzF"}
|
package/dist/widgets/tool.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WidgetValidationError } from "./errors.js";
|
|
2
2
|
/**
|
|
3
3
|
* The plugin's single agent tool. The name is static — new widget types are
|
|
4
4
|
* new `widget_type` enum values, never new tools — so it is declared once in
|
|
@@ -6,38 +6,31 @@ import { WidgetLookupError, WidgetValidationError } from "./errors.js";
|
|
|
6
6
|
*/
|
|
7
7
|
export const SHOW_WIDGET_TOOL_NAME = "show_widget";
|
|
8
8
|
const WIDGET_TYPE_PARAM = "widget_type";
|
|
9
|
-
function fieldLine(field) {
|
|
10
|
-
const parts = [`${field.required ? "required" : "optional"} ${field.type}`];
|
|
11
|
-
if (field.maxLength !== undefined)
|
|
12
|
-
parts.push(`max ${field.maxLength} chars`);
|
|
13
|
-
return ` ${field.name} (${parts.join(", ")}): ${field.description}`;
|
|
14
|
-
}
|
|
15
9
|
/**
|
|
16
|
-
* Tool description, generated from the enabled specs.
|
|
17
|
-
* model
|
|
18
|
-
* the
|
|
10
|
+
* Tool description, generated from the enabled specs. Nothing else teaches the
|
|
11
|
+
* model about these cards, so this text carries the condition that should make
|
|
12
|
+
* it call the tool, not just the shape of the call.
|
|
19
13
|
*/
|
|
20
14
|
export function buildShowWidgetDescription(registry) {
|
|
21
15
|
const widgets = registry.enabled();
|
|
16
|
+
if (widgets.length === 0) {
|
|
17
|
+
return "Render a Senpi UI card in the user's chat.\n\nNo widget types are enabled on this deployment.";
|
|
18
|
+
}
|
|
22
19
|
const lines = [
|
|
23
|
-
"Render a Senpi UI card in the user's chat,
|
|
20
|
+
"Render a Senpi UI card in the user's chat. The card is live UI: its button runs the flow, so showing it is how the user acts.",
|
|
24
21
|
"",
|
|
25
|
-
|
|
22
|
+
"Call it yourself as part of your answer — the user does not have to ask for a card. Each type below states when to call it; the examples illustrate that rule, they are not a checklist to match.",
|
|
26
23
|
"",
|
|
24
|
+
`Pass ${WIDGET_TYPE_PARAM} and nothing else.`,
|
|
25
|
+
"",
|
|
26
|
+
"Widget types:",
|
|
27
27
|
];
|
|
28
|
-
if (widgets.length === 0) {
|
|
29
|
-
lines.push("No widget types are enabled on this deployment.");
|
|
30
|
-
return lines.join("\n");
|
|
31
|
-
}
|
|
32
|
-
lines.push("Widget types:");
|
|
33
28
|
for (const widget of widgets) {
|
|
34
29
|
lines.push(`- ${widget.widgetType}: ${widget.description}`);
|
|
35
|
-
lines.push(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
lines.push(...widget.fields.map(fieldLine));
|
|
30
|
+
lines.push(` when: ${widget.callWhen}`);
|
|
31
|
+
lines.push(` not this card: ${widget.notFor}`);
|
|
32
|
+
lines.push(" for example:");
|
|
33
|
+
lines.push(...widget.examples.map((example) => ` - ${example}`));
|
|
41
34
|
}
|
|
42
35
|
return lines.join("\n");
|
|
43
36
|
}
|
|
@@ -45,60 +38,23 @@ export function buildShowWidgetDescription(registry) {
|
|
|
45
38
|
* Declared JSON schema: one flat object, no unions at any depth.
|
|
46
39
|
*
|
|
47
40
|
* OpenClaw flattens top-level unions, Gemini flattens nested ones, and OpenAI
|
|
48
|
-
* strict mode rejects a schema containing one anywhere
|
|
49
|
-
*
|
|
50
|
-
* per-widget requiredness is enforced in `execute()`.
|
|
41
|
+
* strict mode rejects a schema containing one anywhere. `widget_type` is the
|
|
42
|
+
* only parameter, and it is required.
|
|
51
43
|
*/
|
|
52
44
|
export function buildShowWidgetParameters(registry) {
|
|
53
45
|
const widgets = registry.enabled();
|
|
54
46
|
if (widgets.length === 0) {
|
|
55
47
|
throw new Error("show_widget has no enabled widget types; do not register the tool");
|
|
56
48
|
}
|
|
57
|
-
const properties = {
|
|
58
|
-
[WIDGET_TYPE_PARAM]: {
|
|
59
|
-
type: "string",
|
|
60
|
-
enum: widgets.map((w) => w.widgetType),
|
|
61
|
-
description: "Which widget to render.",
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
// Fields shared by several widget types collapse into one property, so the
|
|
65
|
-
// shared property has to admit every owner's input: per-widget limits are
|
|
66
|
-
// enforced in execute(), and a declared bound stricter than one owner's would
|
|
67
|
-
// make the provider reject a call that execute() would have accepted.
|
|
68
|
-
const owners = new Map();
|
|
69
|
-
for (const widget of widgets) {
|
|
70
|
-
for (const field of widget.fields) {
|
|
71
|
-
if (field.name === WIDGET_TYPE_PARAM) {
|
|
72
|
-
throw new Error(`show_widget: ${widget.widgetType} declares a field named "${WIDGET_TYPE_PARAM}", which is the discriminator`);
|
|
73
|
-
}
|
|
74
|
-
const entry = owners.get(field.name);
|
|
75
|
-
if (entry) {
|
|
76
|
-
entry.types.push(widget.widgetType);
|
|
77
|
-
entry.fields.push(field);
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
owners.set(field.name, { types: [widget.widgetType], fields: [field] });
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
for (const [name, { types, fields }] of owners) {
|
|
84
|
-
const valueTypes = [...new Set(fields.map((f) => f.type))];
|
|
85
|
-
if (valueTypes.length > 1) {
|
|
86
|
-
throw new Error(`show_widget: field "${name}" is declared as ${valueTypes.join(" and ")} by ${types.join(", ")}; one schema property cannot be both`);
|
|
87
|
-
}
|
|
88
|
-
const property = { type: valueTypes[0] };
|
|
89
|
-
const bounds = fields.map((f) => f.maxLength);
|
|
90
|
-
if (bounds.every((b) => b !== undefined)) {
|
|
91
|
-
property.maxLength = Math.max(...bounds);
|
|
92
|
-
}
|
|
93
|
-
property.description =
|
|
94
|
-
types.length === 1
|
|
95
|
-
? `${fields[0].description} Accepted by: ${types[0]}.`
|
|
96
|
-
: fields.map((f, i) => `${types[i]}: ${f.description}`).join(" ");
|
|
97
|
-
properties[name] = property;
|
|
98
|
-
}
|
|
99
49
|
return {
|
|
100
50
|
type: "object",
|
|
101
|
-
properties
|
|
51
|
+
properties: {
|
|
52
|
+
[WIDGET_TYPE_PARAM]: {
|
|
53
|
+
type: "string",
|
|
54
|
+
enum: widgets.map((w) => w.widgetType),
|
|
55
|
+
description: "Which card to render.",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
102
58
|
required: [WIDGET_TYPE_PARAM],
|
|
103
59
|
additionalProperties: false,
|
|
104
60
|
};
|
|
@@ -134,76 +90,16 @@ function resolveWidget(registry, args) {
|
|
|
134
90
|
return widget;
|
|
135
91
|
}
|
|
136
92
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
93
|
+
* The tool takes one argument, so any other key is a field the model invented.
|
|
94
|
+
* Every one is named in a single message: the correction is the same for all of
|
|
95
|
+
* them, and the model can apply it in one retry.
|
|
140
96
|
*/
|
|
141
|
-
function
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
WIDGET_TYPE_PARAM,
|
|
147
|
-
...widget.fields.map((f) => f.name),
|
|
148
|
-
...guarded.map((f) => f.name),
|
|
149
|
-
]);
|
|
150
|
-
const problems = [];
|
|
151
|
-
const offending = [];
|
|
152
|
-
const unexpected = Object.keys(args).filter((key) => !allowed.has(key));
|
|
153
|
-
if (unexpected.length > 0) {
|
|
154
|
-
offending.push(...unexpected);
|
|
155
|
-
// Guarded names are parseable but not on offer, so they stay out of this list.
|
|
156
|
-
const offered = [WIDGET_TYPE_PARAM, ...widget.fields.map((f) => f.name)];
|
|
157
|
-
problems.push(`unexpected fields: ${unexpected.join(", ")} (allowed: ${offered.join(", ")})`);
|
|
158
|
-
}
|
|
159
|
-
const missing = [];
|
|
160
|
-
const invalid = [];
|
|
161
|
-
const values = {};
|
|
162
|
-
// A guarded field goes to the handler exactly as it arrived. Its answer is
|
|
163
|
-
// "drop this field", which is the same for every value, so complaining about
|
|
164
|
-
// the type or the length first would only buy a retry that corrects a field
|
|
165
|
-
// the model then has to remove anyway.
|
|
166
|
-
for (const field of guarded) {
|
|
167
|
-
const value = Object.hasOwn(args, field.name) ? args[field.name] : undefined;
|
|
168
|
-
if (value !== undefined && value !== null)
|
|
169
|
-
values[field.name] = value;
|
|
170
|
-
}
|
|
171
|
-
for (const field of widget.fields) {
|
|
172
|
-
// Own keys only: an inherited `reason`/`toString` must not read as a value
|
|
173
|
-
// the caller passed, since the unexpected-key check above only sees own keys.
|
|
174
|
-
const value = Object.hasOwn(args, field.name) ? args[field.name] : undefined;
|
|
175
|
-
if (value === undefined || value === null) {
|
|
176
|
-
if (field.required)
|
|
177
|
-
missing.push(field.name);
|
|
178
|
-
continue;
|
|
179
|
-
}
|
|
180
|
-
if (typeof value !== "string") {
|
|
181
|
-
invalid.push(`${field.name} (must be a ${field.type})`);
|
|
182
|
-
continue;
|
|
183
|
-
}
|
|
184
|
-
if (value.trim().length === 0) {
|
|
185
|
-
invalid.push(`${field.name} (must be a non-empty ${field.type}; omit it instead)`);
|
|
186
|
-
continue;
|
|
187
|
-
}
|
|
188
|
-
if (field.maxLength !== undefined && value.length > field.maxLength) {
|
|
189
|
-
invalid.push(`${field.name} (${value.length} chars, limit is ${field.maxLength})`);
|
|
190
|
-
continue;
|
|
191
|
-
}
|
|
192
|
-
values[field.name] = value;
|
|
193
|
-
}
|
|
194
|
-
if (missing.length > 0) {
|
|
195
|
-
offending.push(...missing);
|
|
196
|
-
problems.push(`missing required fields: ${missing.join(", ")}`);
|
|
197
|
-
}
|
|
198
|
-
if (invalid.length > 0) {
|
|
199
|
-
offending.push(...invalid.map((entry) => entry.split(" ")[0]));
|
|
200
|
-
problems.push(`invalid fields: ${invalid.join(", ")}`);
|
|
201
|
-
}
|
|
202
|
-
if (problems.length > 0) {
|
|
203
|
-
throw new WidgetValidationError(`show_widget failed for ${WIDGET_TYPE_PARAM} "${widget.widgetType}": ${problems.join("; ")}. ` +
|
|
204
|
-
"Fix the named fields and call show_widget again with the same widget_type.", widget.widgetType, offending);
|
|
205
|
-
}
|
|
206
|
-
return values;
|
|
97
|
+
function rejectExtraFields(widget, args) {
|
|
98
|
+
const unexpected = Object.keys(args).filter((key) => key !== WIDGET_TYPE_PARAM);
|
|
99
|
+
if (unexpected.length === 0)
|
|
100
|
+
return;
|
|
101
|
+
throw new WidgetValidationError(`show_widget failed for ${WIDGET_TYPE_PARAM} "${widget.widgetType}": unexpected fields: ` +
|
|
102
|
+
`${unexpected.join(", ")}. show_widget takes ${WIDGET_TYPE_PARAM} only — drop them and call it again.`, widget.widgetType, unexpected);
|
|
207
103
|
}
|
|
208
104
|
/**
|
|
209
105
|
* Build the `show_widget` tool for one agent turn. `sessionId` comes from the
|
|
@@ -211,9 +107,8 @@ function validateFields(widget, args) {
|
|
|
211
107
|
* result depends on it.
|
|
212
108
|
*/
|
|
213
109
|
export function createShowWidgetTool(options) {
|
|
214
|
-
const { registry, logger, sessionId
|
|
110
|
+
const { registry, logger, sessionId } = options;
|
|
215
111
|
const session = sessionId ?? "(unknown)";
|
|
216
|
-
const ctx = { strategies };
|
|
217
112
|
return {
|
|
218
113
|
name: SHOW_WIDGET_TOOL_NAME,
|
|
219
114
|
description: buildShowWidgetDescription(registry),
|
|
@@ -222,8 +117,8 @@ export function createShowWidgetTool(options) {
|
|
|
222
117
|
try {
|
|
223
118
|
const args = toArgs(params);
|
|
224
119
|
const widget = resolveWidget(registry, args);
|
|
225
|
-
|
|
226
|
-
const result = await widget.handler(
|
|
120
|
+
rejectExtraFields(widget, args);
|
|
121
|
+
const result = await widget.handler();
|
|
227
122
|
logger?.info(`[senpi-widgets] widget shown | widget_type=${widget.widgetType} widget_version=${widget.widgetVersion} session=${session}`);
|
|
228
123
|
return {
|
|
229
124
|
content: [{ type: "text", text: result.text }],
|
|
@@ -234,11 +129,6 @@ export function createShowWidgetTool(options) {
|
|
|
234
129
|
if (err instanceof WidgetValidationError) {
|
|
235
130
|
logger?.warn(`[senpi-widgets] validation failed | widget_type=${err.widgetType} fields=${err.fields.join(",")} session=${session} | ${err.message}`);
|
|
236
131
|
}
|
|
237
|
-
else if (err instanceof WidgetLookupError) {
|
|
238
|
-
// The args were never judged — this is a backend problem, and it is the
|
|
239
|
-
// only signal that a card the user asked for could not be built.
|
|
240
|
-
logger?.warn(`[senpi-widgets] lookup failed | widget_type=${err.widgetType} session=${session} | ${err.message} | cause=${err.cause instanceof Error ? err.cause.message : String(err.cause ?? "(none)")}`);
|
|
241
|
-
}
|
|
242
132
|
else {
|
|
243
133
|
logger?.error?.(`[senpi-widgets] unhandled failure | session=${session} | ${err instanceof Error ? err.message : String(err)}`);
|
|
244
134
|
}
|
package/dist/widgets/tool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../src/widgets/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../src/widgets/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAIpD;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,a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