@prefactor/openclaw 0.0.3 → 0.0.5

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
@@ -13,9 +13,9 @@ Enable the plugin in `~/.openclaw/.openclaw.json`:
13
13
  "prefactor": {
14
14
  "enabled": true,
15
15
  "config": {
16
- "agentId": "$PREFACTOR_AGENT_ID",
17
- "apiKey": "$PREFACTOR_API_KEY",
18
- "apiUrl": "$PREFACTOR_API_URL",
16
+ "agentId": "${PREFACTOR_AGENT_ID}",
17
+ "apiToken": "${PREFACTOR_API_TOKEN}",
18
+ "apiUrl": "${PREFACTOR_API_URL}",
19
19
  }
20
20
  }
21
21
  }
@@ -43,9 +43,9 @@ openclaw plugins enable prefactor
43
43
  openclaw plugins disable prefactor
44
44
 
45
45
  # Configuration
46
- openclaw config set plugins.entries.prefactor.config.agentId "<your_agent_id>"
47
- openclaw config set plugins.entries.prefactor.config.apiKey "<your_api_key>"
48
- openclaw config set plugins.entries.prefactor.config.apiUrl "<prefacor_api_url>"
46
+ openclaw config set plugins.entries.prefactor.config.agentId "${PREFACTOR_AGENT_ID}"
47
+ openclaw config set plugins.entries.prefactor.config.apiToken "${PREFACTOR_API_TOKEN}"
48
+ openclaw config set plugins.entries.prefactor.config.apiUrl "${PREFACTOR_API_URL}"
49
49
  ```
50
50
 
51
51
  ## Overview
package/dist/index.cjs CHANGED
@@ -4945,7 +4945,7 @@ function createSessionStateManager(agent, logger, config) {
4945
4945
  // packages/openclaw/package.json
4946
4946
  var package_default = {
4947
4947
  name: "@prefactor/openclaw",
4948
- version: "0.0.3",
4948
+ version: "0.0.4",
4949
4949
  description: "OpenClaw lifecycle event monitoring and instrumentation for Prefactor",
4950
4950
  type: "module",
4951
4951
  main: "./dist/index.cjs",
@@ -4995,24 +4995,29 @@ var package_default = {
4995
4995
  // packages/openclaw/index.ts
4996
4996
  var prefactorConfigSchema = exports_external.object({
4997
4997
  apiUrl: exports_external.string().optional(),
4998
- apiKey: exports_external.string().optional(),
4998
+ apiToken: exports_external.string().optional(),
4999
4999
  agentId: exports_external.string().optional(),
5000
5000
  agentVersion: exports_external.string().optional().default("default"),
5001
5001
  logLevel: exports_external.enum(["debug", "info", "warn", "error"]).optional().default("info"),
5002
5002
  userInteractionTimeoutMinutes: exports_external.number().int().positive().optional().default(5),
5003
5003
  sessionTimeoutHours: exports_external.number().int().positive().optional().default(24)
5004
5004
  }).strict();
5005
+ var defaultConfig = {
5006
+ apiUrl: process.env.PREFACTOR_API_URL,
5007
+ apiToken: process.env.PREFACTOR_API_TOKEN,
5008
+ agentId: process.env.PREFACTOR_AGENT_ID
5009
+ };
5005
5010
  function register(api) {
5006
- const config = prefactorConfigSchema.parse(api.pluginConfig);
5011
+ const config = prefactorConfigSchema.parse(api.pluginConfig || defaultConfig);
5007
5012
  const logLevel = config.logLevel;
5008
5013
  const logger = createLogger(logLevel);
5009
5014
  let agent = null;
5010
5015
  let agentInitialized = false;
5011
- if (config.apiUrl && config.apiKey && config.agentId) {
5016
+ if (config.apiUrl && config.apiToken && config.agentId) {
5012
5017
  try {
5013
5018
  const agentConfig = {
5014
5019
  apiUrl: config.apiUrl,
5015
- apiToken: config.apiKey,
5020
+ apiToken: config.apiToken,
5016
5021
  agentId: config.agentId,
5017
5022
  openclawVersion: api.version || "unknown",
5018
5023
  pluginVersion: package_default.version,
@@ -5037,7 +5042,7 @@ function register(api) {
5037
5042
  logger.warn("prefactor_agent_not_configured", {
5038
5043
  missing: [
5039
5044
  !config.apiUrl && "apiUrl",
5040
- !config.apiKey && "apiKey",
5045
+ !config.apiToken && "apiToken",
5041
5046
  !config.agentId && "agentId"
5042
5047
  ].filter(Boolean)
5043
5048
  });
@@ -5241,4 +5246,4 @@ Timestamp: ${new Date(startTime).toISOString()}`
5241
5246
  });
5242
5247
  }
5243
5248
 
5244
- //# debugId=4694534263C2DB4B64756E2164756E21
5249
+ //# debugId=D4B18AF97BDA921864756E2164756E21
package/dist/index.js CHANGED
@@ -4925,7 +4925,7 @@ function createSessionStateManager(agent, logger, config) {
4925
4925
  // packages/openclaw/package.json
4926
4926
  var package_default = {
4927
4927
  name: "@prefactor/openclaw",
4928
- version: "0.0.3",
4928
+ version: "0.0.4",
4929
4929
  description: "OpenClaw lifecycle event monitoring and instrumentation for Prefactor",
4930
4930
  type: "module",
4931
4931
  main: "./dist/index.cjs",
@@ -4975,24 +4975,29 @@ var package_default = {
4975
4975
  // packages/openclaw/index.ts
4976
4976
  var prefactorConfigSchema = exports_external.object({
4977
4977
  apiUrl: exports_external.string().optional(),
4978
- apiKey: exports_external.string().optional(),
4978
+ apiToken: exports_external.string().optional(),
4979
4979
  agentId: exports_external.string().optional(),
4980
4980
  agentVersion: exports_external.string().optional().default("default"),
4981
4981
  logLevel: exports_external.enum(["debug", "info", "warn", "error"]).optional().default("info"),
4982
4982
  userInteractionTimeoutMinutes: exports_external.number().int().positive().optional().default(5),
4983
4983
  sessionTimeoutHours: exports_external.number().int().positive().optional().default(24)
4984
4984
  }).strict();
4985
+ var defaultConfig = {
4986
+ apiUrl: process.env.PREFACTOR_API_URL,
4987
+ apiToken: process.env.PREFACTOR_API_TOKEN,
4988
+ agentId: process.env.PREFACTOR_AGENT_ID
4989
+ };
4985
4990
  function register(api) {
4986
- const config = prefactorConfigSchema.parse(api.pluginConfig);
4991
+ const config = prefactorConfigSchema.parse(api.pluginConfig || defaultConfig);
4987
4992
  const logLevel = config.logLevel;
4988
4993
  const logger = createLogger(logLevel);
4989
4994
  let agent = null;
4990
4995
  let agentInitialized = false;
4991
- if (config.apiUrl && config.apiKey && config.agentId) {
4996
+ if (config.apiUrl && config.apiToken && config.agentId) {
4992
4997
  try {
4993
4998
  const agentConfig = {
4994
4999
  apiUrl: config.apiUrl,
4995
- apiToken: config.apiKey,
5000
+ apiToken: config.apiToken,
4996
5001
  agentId: config.agentId,
4997
5002
  openclawVersion: api.version || "unknown",
4998
5003
  pluginVersion: package_default.version,
@@ -5017,7 +5022,7 @@ function register(api) {
5017
5022
  logger.warn("prefactor_agent_not_configured", {
5018
5023
  missing: [
5019
5024
  !config.apiUrl && "apiUrl",
5020
- !config.apiKey && "apiKey",
5025
+ !config.apiToken && "apiToken",
5021
5026
  !config.agentId && "agentId"
5022
5027
  ].filter(Boolean)
5023
5028
  });
@@ -5224,4 +5229,4 @@ export {
5224
5229
  register as default
5225
5230
  };
5226
5231
 
5227
- //# debugId=8B9E14C244A7ABE564756E2164756E21
5232
+ //# debugId=E04062F21E7C9CFC64756E2164756E21
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "prefactor",
3
3
  "name": "@prefactor/openclaw",
4
- "version": "0.0.3",
4
+ "version": "0.0.6",
5
5
  "description": "Comprehensive lifecycle event monitoring and instrumentation for OpenClaw",
6
6
  "runtime": "node",
7
7
  "entry": "./index.ts",
@@ -12,9 +12,9 @@
12
12
  "type": "string",
13
13
  "description": "Prefactor API URL (e.g., https://api.prefactor.dev)"
14
14
  },
15
- "apiKey": {
15
+ "apiToken": {
16
16
  "type": "string",
17
- "description": "Prefactor API key for authentication"
17
+ "description": "Prefactor API token for authentication"
18
18
  },
19
19
  "agentId": {
20
20
  "type": "string",
@@ -52,9 +52,9 @@
52
52
  "label": "Prefactor API URL",
53
53
  "placeholder": "https://api.prefactor.dev"
54
54
  },
55
- "apiKey": {
56
- "label": "Prefactor API Key",
57
- "placeholder": "sk_...",
55
+ "apiToken": {
56
+ "label": "Prefactor API token",
57
+ "placeholder": "yout-api-token",
58
58
  "sensitive": true
59
59
  },
60
60
  "agentId": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prefactor/openclaw",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "OpenClaw lifecycle event monitoring and instrumentation for Prefactor",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -31,7 +31,7 @@
31
31
  "monitoring"
32
32
  ],
33
33
  "dependencies": {
34
- "@prefactor/core": "0.2.5",
34
+ "@prefactor/core": "0.2.6",
35
35
  "zod": "^3.23.0"
36
36
  },
37
37
  "devDependencies": {