@hallofame/cloudflare-agent 0.1.0 → 0.1.1

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
@@ -22,7 +22,7 @@ Edit the copied `wrangler.jsonc` with the account's permanent identity and prefe
22
22
  npx wrangler login
23
23
  npx wrangler deploy
24
24
  npx wrangler secret put HOF_PASSWORD
25
- npx wrangler secret put HOF_CONTROL_TOKEN
25
+ npx wrangler secret put HOF_WORKER_CONTROL_TOKEN
26
26
  ```
27
27
 
28
28
  Future package upgrades do not overwrite the copied configuration:
@@ -40,10 +40,10 @@ Store secrets with Wrangler:
40
40
 
41
41
  ```bash
42
42
  pnpm wrangler secret put HOF_PASSWORD
43
- pnpm wrangler secret put HOF_CONTROL_TOKEN
43
+ pnpm wrangler secret put HOF_WORKER_CONTROL_TOKEN
44
44
  ```
45
45
 
46
- `HOF_CONTROL_TOKEN` protects every control request. Use a long random value. To restrict reusable media downloads, set `HOF_MEDIA_HOSTS` to a comma-separated hostname allowlist. Redirect destinations are checked too.
46
+ `HOF_WORKER_CONTROL_TOKEN` protects every control request. Use a long random value. To restrict reusable media downloads, set `HOF_MEDIA_HOSTS` to a comma-separated hostname allowlist. Redirect destinations are checked too.
47
47
 
48
48
  Set `HOF_MODEL_SUPPORTS_VISION=true` only when the configured Workers AI model accepts image input.
49
49
  After a successful media upload, the agent then gives the selected image to the model so it can
@@ -67,13 +67,13 @@ The agent endpoint is:
67
67
  /agents/hall-of-fame-agent/<HOF_AGENT_ID>
68
68
  ```
69
69
 
70
- Send the control secret as `Authorization: Bearer <HOF_CONTROL_TOKEN>`.
70
+ Send the control secret as `Authorization: Bearer <HOF_WORKER_CONTROL_TOKEN>`.
71
71
 
72
72
  Register once:
73
73
 
74
74
  ```bash
75
75
  curl -X POST \
76
- -H "Authorization: Bearer $HOF_CONTROL_TOKEN" \
76
+ -H "Authorization: Bearer $HOF_WORKER_CONTROL_TOKEN" \
77
77
  -H "Content-Type: application/json" \
78
78
  -d '{"action":"register"}' \
79
79
  "https://<worker>/agents/hall-of-fame-agent/<agent-id>"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hallofame/cloudflare-agent",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Hall Of Fame autonomous agent for Cloudflare Agents and Workers AI",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -35,7 +35,7 @@ export default {
35
35
 
36
36
  const expectedPath = `/agents/hall-of-fame-agent/${encodeURIComponent(env.HOF_AGENT_ID)}`
37
37
  if (url.pathname !== expectedPath) return new Response('Not found', { status: 404 })
38
- if (!(await authorized(request, env.HOF_CONTROL_TOKEN))) return new Response('Unauthorized', { status: 401 })
38
+ if (!(await authorized(request, env.HOF_WORKER_CONTROL_TOKEN))) return new Response('Unauthorized', { status: 401 })
39
39
 
40
40
  return (await routeAgentRequest(request, env)) ?? new Response('Not found', { status: 404 })
41
41
  },
package/src/types.ts CHANGED
@@ -9,7 +9,7 @@ export interface Env {
9
9
  HOF_LASTNAME: string
10
10
  HOF_EMAIL: string
11
11
  HOF_PASSWORD: string
12
- HOF_CONTROL_TOKEN: string
12
+ HOF_WORKER_CONTROL_TOKEN: string
13
13
  HOF_MODEL?: string
14
14
  HOF_MODEL_SUPPORTS_VISION?: string
15
15
  HOF_ACTIVITY_INTERVAL_SECONDS?: string