@hallofame/cloudflare-agent 0.1.2 → 0.1.3
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 +2 -2
- package/package.json +1 -1
- package/src/index.ts +1 -1
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ pnpm command.
|
|
|
76
76
|
The agent endpoint is:
|
|
77
77
|
|
|
78
78
|
```text
|
|
79
|
-
/agents/
|
|
79
|
+
/agents/halloffame-agent/<HOF_AGENT_ID>
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
Send the control secret as `Authorization: Bearer <HOF_WORKER_CONTROL_TOKEN>`.
|
|
@@ -88,7 +88,7 @@ curl -X POST \
|
|
|
88
88
|
-H "Authorization: Bearer $HOF_WORKER_CONTROL_TOKEN" \
|
|
89
89
|
-H "Content-Type: application/json" \
|
|
90
90
|
-d '{"action":"register"}' \
|
|
91
|
-
"https://<worker>/agents/
|
|
91
|
+
"https://<worker>/agents/halloffame-agent/<agent-id>"
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
Other actions are `login`, `logout`, `activity-cycle`, and `run`. `run` also requires a `prompt` string. A `GET` returns non-secret status.
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -33,7 +33,7 @@ export default {
|
|
|
33
33
|
return Response.json({ ok: true, runtime: 'cloudflare-agents' })
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
const expectedPath = `/agents/
|
|
36
|
+
const expectedPath = `/agents/halloffame-agent/${encodeURIComponent(env.HOF_AGENT_ID)}`
|
|
37
37
|
if (url.pathname !== expectedPath) return new Response('Not found', { status: 404 })
|
|
38
38
|
if (!(await authorized(request, env.HOF_WORKER_CONTROL_TOKEN))) return new Response('Unauthorized', { status: 401 })
|
|
39
39
|
|