@senpi/runtime 1.0.95-dev.runtime-phase-2.20260424100011 → 1.0.95-dev.runtime-phase-2.20260424100720

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 CHANGED
@@ -16,6 +16,8 @@ Event-driven automated trading plugin for OpenClaw. Orchestrates scanners, LLM-b
16
16
  openclaw plugins install @senpi-ai/runtime
17
17
  ```
18
18
 
19
+ **Custom installs (Git checkout, `dist/`-only copy, or Docker without devDependencies):** run `npm install` in the package root (or `npm ci --omit=dev` from a lockfile) so `node_modules` includes runtime dependencies. The runtime uses **TypeBox** at load time for scanner option validation (`@sinclair/typebox` / `@sinclair/typebox/value`); if that package is missing, the gateway will fail to load the plugin with `Cannot find module '@sinclair/typebox/value'`.
20
+
19
21
  ## Configure
20
22
 
21
23
  Add the plugin to your OpenClaw config (e.g. `~/.openclaw/openclaw.json` or via `openclaw config set`). Use the plugin **id** `@senpi-ai/runtime` as the key:
@@ -1,6 +1,26 @@
1
+ /**
2
+ * TypeBox `Value` helpers for scanner `paramsSchema` / options validation.
3
+ *
4
+ * **Package dependency:** this module imports `@sinclair/typebox` and
5
+ * `@sinclair/typebox/value` at runtime. They must be listed in **dependencies**
6
+ * (not only devDependencies) so production installs and OpenClaw extension
7
+ * layouts that omit dev deps still resolve `node_modules/@sinclair/typebox`.
8
+ */
1
9
  import type { TSchema } from "@sinclair/typebox";
2
- /** Returns true when a value conforms to the provided TypeBox schema. */
10
+ /**
11
+ * Returns whether `value` satisfies `schema` via TypeBox `Value.Check`.
12
+ *
13
+ * @param schema - TypeBox schema, or `undefined` (treated as valid for any value)
14
+ * @param value - User-provided object to validate
15
+ * @returns `true` if there is no schema or `Value.Check` succeeds
16
+ */
3
17
  export declare function isSchemaValueValid(schema: TSchema | undefined, value: unknown): boolean;
4
- /** Formats the first TypeBox validation error into a compact human-readable string. */
18
+ /**
19
+ * Returns a short, single-line description of the first TypeBox error for `value` against `schema`.
20
+ *
21
+ * @param schema - TypeBox schema (required; use after `isSchemaValueValid` fails)
22
+ * @param value - The same value that failed `Value.Check`
23
+ * @returns Path and message from `Value.Errors(...).First()`, or a fallback string
24
+ */
5
25
  export declare function describeSchemaValidationError(schema: TSchema, value: unknown): string;
6
26
  //# sourceMappingURL=schema-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema-utils.d.ts","sourceRoot":"","sources":["../../src/scanners/schema-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGjD,yEAAyE;AACzE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,KAAK,EAAE,OAAO,GACb,OAAO,CAKT;AAED,uFAAuF;AACvF,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,OAAO,GACb,MAAM,CAGR"}
1
+ {"version":3,"file":"schema-utils.d.ts","sourceRoot":"","sources":["../../src/scanners/schema-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGjD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,KAAK,EAAE,OAAO,GACb,OAAO,CAKT;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,OAAO,GACb,MAAM,CAGR"}
@@ -1,12 +1,24 @@
1
1
  import { Value } from "@sinclair/typebox/value";
2
- /** Returns true when a value conforms to the provided TypeBox schema. */
2
+ /**
3
+ * Returns whether `value` satisfies `schema` via TypeBox `Value.Check`.
4
+ *
5
+ * @param schema - TypeBox schema, or `undefined` (treated as valid for any value)
6
+ * @param value - User-provided object to validate
7
+ * @returns `true` if there is no schema or `Value.Check` succeeds
8
+ */
3
9
  export function isSchemaValueValid(schema, value) {
4
10
  if (!schema) {
5
11
  return true;
6
12
  }
7
13
  return Value.Check(schema, value);
8
14
  }
9
- /** Formats the first TypeBox validation error into a compact human-readable string. */
15
+ /**
16
+ * Returns a short, single-line description of the first TypeBox error for `value` against `schema`.
17
+ *
18
+ * @param schema - TypeBox schema (required; use after `isSchemaValueValid` fails)
19
+ * @param value - The same value that failed `Value.Check`
20
+ * @returns Path and message from `Value.Errors(...).First()`, or a fallback string
21
+ */
10
22
  export function describeSchemaValidationError(schema, value) {
11
23
  const firstError = Value.Errors(schema, value).First();
12
24
  return firstError ? `${firstError.path} ${firstError.message}` : "Unknown reason";
@@ -1 +1 @@
1
- {"version":3,"file":"schema-utils.js","sourceRoot":"","sources":["../../src/scanners/schema-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD,yEAAyE;AACzE,MAAM,UAAU,kBAAkB,CAChC,MAA2B,EAC3B,KAAc;IAEd,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACpC,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,6BAA6B,CAC3C,MAAe,EACf,KAAc;IAEd,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC;IACvD,OAAO,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AACpF,CAAC"}
1
+ {"version":3,"file":"schema-utils.js","sourceRoot":"","sources":["../../src/scanners/schema-utils.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAA2B,EAC3B,KAAc;IAEd,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACpC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,6BAA6B,CAC3C,MAAe,EACf,KAAc;IAEd,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC;IACvD,OAAO,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AACpF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@senpi/runtime",
3
- "version": "1.0.95-dev.runtime-phase-2.20260424100011",
3
+ "version": "1.0.95-dev.runtime-phase-2.20260424100720",
4
4
  "description": "Senpi runtime plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -31,6 +31,7 @@
31
31
  "dependencies": {
32
32
  "@anthropic-ai/sdk": "^0.39.0",
33
33
  "@modelcontextprotocol/sdk": "^1.0.0",
34
+ "@sinclair/typebox": "^0.34.0",
34
35
  "dotenv": "^16.4.5",
35
36
  "mcporter": "^0.7.3",
36
37
  "yaml": "^2.8.0",
@@ -40,7 +41,6 @@
40
41
  "openclaw": ">=2026.2.0"
41
42
  },
42
43
  "devDependencies": {
43
- "@sinclair/typebox": "^0.34.0",
44
44
  "@types/node": "^22.0.0",
45
45
  "typescript": "^5.7.0",
46
46
  "vitest": "^3.0.0"