@opengate/openclaw 0.1.1 → 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/dist/index.js +23 -3
- package/openclaw.plugin.json +42 -32
- package/package.json +7 -2
- package/skills/opengate/SKILL.md +16 -0
package/dist/index.js
CHANGED
|
@@ -199,12 +199,14 @@ function formatEvent(event) {
|
|
|
199
199
|
`New task assigned to you${taskRef}`,
|
|
200
200
|
event.priority ? `Priority: ${event.priority}` : null,
|
|
201
201
|
event.tags?.length ? `Tags: ${event.tags.join(", ")}` : null,
|
|
202
|
+
event.repo_url ? `Repo: ${event.repo_url}` : null,
|
|
202
203
|
"",
|
|
203
204
|
"Next steps:",
|
|
204
205
|
"1. Use `get_task` to read the full task details",
|
|
205
|
-
"2. Use `
|
|
206
|
-
"3. Use `
|
|
207
|
-
"4. Use `
|
|
206
|
+
event.project_id ? "2. Use `get_workspace_info` to set up project workspace" : null,
|
|
207
|
+
"3. Use `search_knowledge` to check for relevant project knowledge",
|
|
208
|
+
"4. Use `claim_task` to start working on it",
|
|
209
|
+
"5. Use `post_comment` to share your planned approach"
|
|
208
210
|
].filter((line) => line !== null).join("\n");
|
|
209
211
|
case "task.comment":
|
|
210
212
|
return [
|
|
@@ -294,6 +296,22 @@ function formatNotificationSummary(notifications) {
|
|
|
294
296
|
}
|
|
295
297
|
|
|
296
298
|
// src/index.ts
|
|
299
|
+
var PKG_VERSION = "0.1.1";
|
|
300
|
+
async function checkForUpdate() {
|
|
301
|
+
try {
|
|
302
|
+
const res = await fetch("https://registry.npmjs.org/@opengate/openclaw/latest", {
|
|
303
|
+
headers: { "Accept": "application/json" },
|
|
304
|
+
signal: AbortSignal.timeout(5e3)
|
|
305
|
+
});
|
|
306
|
+
if (!res.ok) return;
|
|
307
|
+
const data = await res.json();
|
|
308
|
+
const latest = data.version;
|
|
309
|
+
if (latest && latest !== PKG_VERSION) {
|
|
310
|
+
console.log(`[opengate-bridge] Update available: ${PKG_VERSION} \u2192 ${latest}. Run: openclaw plugins update`);
|
|
311
|
+
}
|
|
312
|
+
} catch {
|
|
313
|
+
}
|
|
314
|
+
}
|
|
297
315
|
var DEFAULT_POLL_INTERVAL_MS = 6e5;
|
|
298
316
|
var SESSION_KEY = "opengate:inbox";
|
|
299
317
|
function register(api, config) {
|
|
@@ -322,6 +340,8 @@ function register(api, config) {
|
|
|
322
340
|
console.log(
|
|
323
341
|
`[opengate-bridge] Starting in ${mode} mode (url: ${config.url})`
|
|
324
342
|
);
|
|
343
|
+
checkForUpdate().catch(() => {
|
|
344
|
+
});
|
|
325
345
|
if (mode === "websocket") {
|
|
326
346
|
wsClient = new WsClient(
|
|
327
347
|
{
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,36 +1,46 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"name": "
|
|
4
|
-
"displayName": "OpenGate Bridge",
|
|
2
|
+
"id": "openclaw",
|
|
3
|
+
"name": "OpenGate",
|
|
5
4
|
"description": "Real-time push notifications from OpenGate to agents via HTTP polling or WebSocket",
|
|
6
|
-
"version": "0.1.
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
5
|
+
"version": "0.1.2",
|
|
6
|
+
"configSchema": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"url": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "OpenGate server URL",
|
|
13
|
+
"default": "https://opengate.sh"
|
|
14
|
+
},
|
|
15
|
+
"apiKey": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Agent API key (tf_... format)"
|
|
18
|
+
},
|
|
19
|
+
"mode": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "Notification mode: 'polling' (default) or 'websocket'",
|
|
22
|
+
"enum": [
|
|
23
|
+
"polling",
|
|
24
|
+
"websocket"
|
|
25
|
+
],
|
|
26
|
+
"default": "polling"
|
|
27
|
+
},
|
|
28
|
+
"pollIntervalMs": {
|
|
29
|
+
"type": "number",
|
|
30
|
+
"description": "Polling interval in milliseconds (only used in polling mode)",
|
|
31
|
+
"default": 600000
|
|
32
|
+
},
|
|
33
|
+
"projectId": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "Optional project ID to filter notifications"
|
|
36
|
+
}
|
|
13
37
|
},
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"enum": ["polling", "websocket"],
|
|
23
|
-
"default": "polling"
|
|
24
|
-
},
|
|
25
|
-
"pollIntervalMs": {
|
|
26
|
-
"type": "number",
|
|
27
|
-
"description": "Polling interval in milliseconds (only used in polling mode)",
|
|
28
|
-
"default": 600000
|
|
29
|
-
},
|
|
30
|
-
"projectId": {
|
|
31
|
-
"type": "string",
|
|
32
|
-
"description": "Optional project ID to filter notifications",
|
|
33
|
-
"required": false
|
|
34
|
-
}
|
|
35
|
-
}
|
|
38
|
+
"required": [
|
|
39
|
+
"url",
|
|
40
|
+
"apiKey"
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"skills": [
|
|
44
|
+
"skills/opengate"
|
|
45
|
+
]
|
|
36
46
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengate/openclaw",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "OpenClaw plugin for OpenGate
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "OpenClaw plugin for OpenGate \u2014 real-time agent notifications via HTTP polling or WebSocket",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
"engines": {
|
|
27
27
|
"node": ">=18"
|
|
28
28
|
},
|
|
29
|
+
"openclaw": {
|
|
30
|
+
"extensions": [
|
|
31
|
+
"./dist/index.js"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
29
34
|
"publishConfig": {
|
|
30
35
|
"access": "public"
|
|
31
36
|
}
|
package/skills/opengate/SKILL.md
CHANGED
|
@@ -61,6 +61,21 @@ Pay attention to:
|
|
|
61
61
|
- **Context** — structured data from previous work or the task creator
|
|
62
62
|
- **Dependencies** — tasks that must complete before this one
|
|
63
63
|
|
|
64
|
+
### 2.5 Set Up Project Workspace
|
|
65
|
+
|
|
66
|
+
If the task's context contains `repo_url` (auto-enriched from project settings):
|
|
67
|
+
|
|
68
|
+
1. Call `get_workspace_info(project_id)` for repo URL and suggested path
|
|
69
|
+
2. If repo not yet cloned: `git clone <repo_url> <workspace_path>`
|
|
70
|
+
3. If already cloned: `cd <workspace_path> && git fetch origin`
|
|
71
|
+
4. Create feature branch: `git checkout -b task/<task_id_short> <default_branch>`
|
|
72
|
+
|
|
73
|
+
**Isolation rules:**
|
|
74
|
+
- Each project gets its own directory under `~/.opengate/workspaces/`
|
|
75
|
+
- NEVER work on files outside the active project's workspace
|
|
76
|
+
- NEVER mix changes from different projects
|
|
77
|
+
- If `repo_url` is null, the project is not code-related — skip this step
|
|
78
|
+
|
|
64
79
|
### 3. Fetch Project Knowledge
|
|
65
80
|
|
|
66
81
|
**Always search the knowledge base before starting work.** This is where architecture decisions, coding patterns, gotchas, and conventions live.
|
|
@@ -108,6 +123,7 @@ Store useful artifacts like:
|
|
|
108
123
|
- Key decisions and their rationale
|
|
109
124
|
- Configuration values or environment details
|
|
110
125
|
- Links to PRs, commits, or external resources
|
|
126
|
+
- Feature branch name (e.g. `task/<task_id_short>`) for workspace continuity
|
|
111
127
|
|
|
112
128
|
### 9. Complete the Task
|
|
113
129
|
|