@tloncorp/openclaw 0.4.2 → 0.6.0
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 +130 -141
- package/dist/index.js +157 -132
- package/dist/index.js.map +1 -1
- package/dist/setup-api.js +2 -2
- package/dist/setup-entry.js +2 -2
- package/dist/setup-entry.js.map +1 -1
- package/dist/src/account-fields.js +7 -3
- package/dist/src/account-fields.js.map +1 -1
- package/dist/src/actions.js +73 -52
- package/dist/src/actions.js.map +1 -1
- package/dist/src/channel.js +51 -39
- package/dist/src/channel.js.map +1 -1
- package/dist/src/channel.runtime.js +61 -32
- package/dist/src/channel.runtime.js.map +1 -1
- package/dist/src/config-schema.js +43 -4
- package/dist/src/config-schema.js.map +1 -1
- package/dist/src/effective-owner.js.map +1 -1
- package/dist/src/gateway-status.js +55 -7
- package/dist/src/gateway-status.js.map +1 -1
- package/dist/src/monitor/approval.js +71 -62
- package/dist/src/monitor/approval.js.map +1 -1
- package/dist/src/monitor/command-auth.js +7 -7
- package/dist/src/monitor/command-auth.js.map +1 -1
- package/dist/src/monitor/command-bridge.js +3 -2
- package/dist/src/monitor/command-bridge.js.map +1 -1
- package/dist/src/monitor/computing-presence.js +76 -12
- package/dist/src/monitor/computing-presence.js.map +1 -1
- package/dist/src/monitor/discovery.js +16 -9
- package/dist/src/monitor/discovery.js.map +1 -1
- package/dist/src/monitor/history.js +130 -21
- package/dist/src/monitor/history.js.map +1 -1
- package/dist/src/monitor/index.js +2766 -2310
- package/dist/src/monitor/index.js.map +1 -1
- package/dist/src/monitor/media.js +106 -78
- package/dist/src/monitor/media.js.map +1 -1
- package/dist/src/monitor/nudge-runner.js +36 -27
- package/dist/src/monitor/nudge-runner.js.map +1 -1
- package/dist/src/monitor/nudge-state.js +7 -11
- package/dist/src/monitor/nudge-state.js.map +1 -1
- package/dist/src/monitor/owner-reply-persistence.js +27 -26
- package/dist/src/monitor/owner-reply-persistence.js.map +1 -1
- package/dist/src/monitor/processed-messages.js.map +1 -1
- package/dist/src/monitor/settings-sync.js +1 -8
- package/dist/src/monitor/settings-sync.js.map +1 -1
- package/dist/src/monitor/utils.js +123 -67
- package/dist/src/monitor/utils.js.map +1 -1
- package/dist/src/nudge-decision.js +40 -43
- package/dist/src/nudge-decision.js.map +1 -1
- package/dist/src/nudge-messages.js +9 -9
- package/dist/src/nudge-scheduler.js.map +1 -1
- package/dist/src/owner-listen-command.js +84 -0
- package/dist/src/owner-listen-command.js.map +1 -0
- package/dist/src/pending-nudge.js.map +1 -1
- package/dist/src/runtime.js +10 -6
- package/dist/src/runtime.js.map +1 -1
- package/dist/src/session-roles.js +2 -1
- package/dist/src/session-roles.js.map +1 -1
- package/dist/src/settings.js +239 -96
- package/dist/src/settings.js.map +1 -1
- package/dist/src/setup-core.js +32 -32
- package/dist/src/setup-core.js.map +1 -1
- package/dist/src/setup-surface.js +19 -19
- package/dist/src/setup-surface.js.map +1 -1
- package/dist/src/shared-state.js +46 -0
- package/dist/src/shared-state.js.map +1 -0
- package/dist/src/targets.js +34 -10
- package/dist/src/targets.js.map +1 -1
- package/dist/src/telemetry.js +17 -14
- package/dist/src/telemetry.js.map +1 -1
- package/dist/src/tlon-binary.js +20 -12
- package/dist/src/tlon-binary.js.map +1 -1
- package/dist/src/tlon-tool-guard.js +5 -5
- package/dist/src/tool-trace.js +17 -13
- package/dist/src/tool-trace.js.map +1 -1
- package/dist/src/types.js +40 -11
- package/dist/src/types.js.map +1 -1
- package/dist/src/urbit/api-client.js +16 -12
- package/dist/src/urbit/api-client.js.map +1 -1
- package/dist/src/urbit/auth.js +9 -9
- package/dist/src/urbit/auth.js.map +1 -1
- package/dist/src/urbit/base-url.js +11 -11
- package/dist/src/urbit/base-url.js.map +1 -1
- package/dist/src/urbit/channel-ops.js +25 -19
- package/dist/src/urbit/channel-ops.js.map +1 -1
- package/dist/src/urbit/context.js +8 -8
- package/dist/src/urbit/context.js.map +1 -1
- package/dist/src/urbit/errors.js +33 -7
- package/dist/src/urbit/errors.js.map +1 -1
- package/dist/src/urbit/fetch.js +3 -3
- package/dist/src/urbit/fetch.js.map +1 -1
- package/dist/src/urbit/http-poke.js +10 -10
- package/dist/src/urbit/http-poke.js.map +1 -1
- package/dist/src/urbit/send.js +27 -23
- package/dist/src/urbit/send.js.map +1 -1
- package/dist/src/urbit/sse-client.js +45 -41
- package/dist/src/urbit/sse-client.js.map +1 -1
- package/dist/src/urbit/story.js +31 -30
- package/dist/src/urbit/story.js.map +1 -1
- package/dist/src/urbit/upload.js +8 -8
- package/dist/src/urbit/upload.js.map +1 -1
- package/dist/src/version.generated.js +2 -1
- package/dist/src/version.generated.js.map +1 -1
- package/openclaw.plugin.json +312 -2
- package/package.json +37 -7
- package/dist/src/heartbeat-telemetry.js +0 -155
- package/dist/src/heartbeat-telemetry.js.map +0 -1
- package/dist/src/nudge-candidate.js +0 -109
- package/dist/src/nudge-candidate.js.map +0 -1
- package/dist/src/onboarding.js +0 -178
- package/dist/src/onboarding.js.map +0 -1
package/openclaw.plugin.json
CHANGED
|
@@ -1,10 +1,320 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "tlon",
|
|
3
|
-
"channels": [
|
|
4
|
-
|
|
3
|
+
"channels": [
|
|
4
|
+
"tlon"
|
|
5
|
+
],
|
|
6
|
+
"contracts": {
|
|
7
|
+
"tools": [
|
|
8
|
+
"tlon"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"skills": [
|
|
12
|
+
"node_modules/@tloncorp/tlon-skill"
|
|
13
|
+
],
|
|
5
14
|
"configSchema": {
|
|
6
15
|
"type": "object",
|
|
7
16
|
"additionalProperties": false,
|
|
8
17
|
"properties": {}
|
|
18
|
+
},
|
|
19
|
+
"channelConfigs": {
|
|
20
|
+
"tlon": {
|
|
21
|
+
"schema": {
|
|
22
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
23
|
+
"type": "object",
|
|
24
|
+
"properties": {
|
|
25
|
+
"name": {
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"enabled": {
|
|
29
|
+
"type": "boolean"
|
|
30
|
+
},
|
|
31
|
+
"ship": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"minLength": 1
|
|
34
|
+
},
|
|
35
|
+
"url": {
|
|
36
|
+
"type": "string"
|
|
37
|
+
},
|
|
38
|
+
"code": {
|
|
39
|
+
"type": "string"
|
|
40
|
+
},
|
|
41
|
+
"network": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"properties": {
|
|
44
|
+
"dangerouslyAllowPrivateNetwork": {
|
|
45
|
+
"type": "boolean"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"additionalProperties": false
|
|
49
|
+
},
|
|
50
|
+
"allowPrivateNetwork": {
|
|
51
|
+
"type": "boolean"
|
|
52
|
+
},
|
|
53
|
+
"groupChannels": {
|
|
54
|
+
"type": "array",
|
|
55
|
+
"items": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"minLength": 1
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"dmAllowlist": {
|
|
61
|
+
"type": "array",
|
|
62
|
+
"items": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"minLength": 1
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"groupInviteAllowlist": {
|
|
68
|
+
"type": "array",
|
|
69
|
+
"items": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"minLength": 1
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"autoDiscoverChannels": {
|
|
75
|
+
"type": "boolean"
|
|
76
|
+
},
|
|
77
|
+
"showModelSignature": {
|
|
78
|
+
"type": "boolean"
|
|
79
|
+
},
|
|
80
|
+
"authorization": {
|
|
81
|
+
"type": "object",
|
|
82
|
+
"properties": {
|
|
83
|
+
"channelRules": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"propertyNames": {
|
|
86
|
+
"type": "string"
|
|
87
|
+
},
|
|
88
|
+
"additionalProperties": {
|
|
89
|
+
"type": "object",
|
|
90
|
+
"properties": {
|
|
91
|
+
"mode": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"enum": [
|
|
94
|
+
"restricted",
|
|
95
|
+
"open"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
"allowedShips": {
|
|
99
|
+
"type": "array",
|
|
100
|
+
"items": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"minLength": 1
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"additionalProperties": false
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"additionalProperties": false
|
|
111
|
+
},
|
|
112
|
+
"defaultAuthorizedShips": {
|
|
113
|
+
"type": "array",
|
|
114
|
+
"items": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"minLength": 1
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"accounts": {
|
|
120
|
+
"type": "object",
|
|
121
|
+
"propertyNames": {
|
|
122
|
+
"type": "string"
|
|
123
|
+
},
|
|
124
|
+
"additionalProperties": {
|
|
125
|
+
"type": "object",
|
|
126
|
+
"properties": {
|
|
127
|
+
"name": {
|
|
128
|
+
"type": "string"
|
|
129
|
+
},
|
|
130
|
+
"enabled": {
|
|
131
|
+
"type": "boolean"
|
|
132
|
+
},
|
|
133
|
+
"ship": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"minLength": 1
|
|
136
|
+
},
|
|
137
|
+
"url": {
|
|
138
|
+
"type": "string"
|
|
139
|
+
},
|
|
140
|
+
"code": {
|
|
141
|
+
"type": "string"
|
|
142
|
+
},
|
|
143
|
+
"network": {
|
|
144
|
+
"type": "object",
|
|
145
|
+
"properties": {
|
|
146
|
+
"dangerouslyAllowPrivateNetwork": {
|
|
147
|
+
"type": "boolean"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"additionalProperties": false
|
|
151
|
+
},
|
|
152
|
+
"allowPrivateNetwork": {
|
|
153
|
+
"type": "boolean"
|
|
154
|
+
},
|
|
155
|
+
"groupChannels": {
|
|
156
|
+
"type": "array",
|
|
157
|
+
"items": {
|
|
158
|
+
"type": "string",
|
|
159
|
+
"minLength": 1
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"dmAllowlist": {
|
|
163
|
+
"type": "array",
|
|
164
|
+
"items": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"minLength": 1
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"groupInviteAllowlist": {
|
|
170
|
+
"type": "array",
|
|
171
|
+
"items": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"minLength": 1
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"autoDiscoverChannels": {
|
|
177
|
+
"type": "boolean"
|
|
178
|
+
},
|
|
179
|
+
"showModelSignature": {
|
|
180
|
+
"type": "boolean"
|
|
181
|
+
},
|
|
182
|
+
"autoAcceptDmInvites": {
|
|
183
|
+
"type": "boolean"
|
|
184
|
+
},
|
|
185
|
+
"autoAcceptGroupInvites": {
|
|
186
|
+
"type": "boolean"
|
|
187
|
+
},
|
|
188
|
+
"ownerShip": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"minLength": 1
|
|
191
|
+
},
|
|
192
|
+
"reactionLevel": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"enum": [
|
|
195
|
+
"off",
|
|
196
|
+
"ack",
|
|
197
|
+
"minimal",
|
|
198
|
+
"extensive"
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
"maxConsecutiveBotResponses": {
|
|
202
|
+
"type": "integer",
|
|
203
|
+
"minimum": 0,
|
|
204
|
+
"maximum": 9007199254740991
|
|
205
|
+
},
|
|
206
|
+
"telemetry": {
|
|
207
|
+
"type": "object",
|
|
208
|
+
"properties": {
|
|
209
|
+
"enabled": {
|
|
210
|
+
"type": "boolean"
|
|
211
|
+
},
|
|
212
|
+
"apiKey": {
|
|
213
|
+
"type": "string",
|
|
214
|
+
"minLength": 1
|
|
215
|
+
},
|
|
216
|
+
"host": {
|
|
217
|
+
"type": "string",
|
|
218
|
+
"minLength": 1
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"additionalProperties": false
|
|
222
|
+
},
|
|
223
|
+
"ownerListenEnabled": {
|
|
224
|
+
"type": "boolean"
|
|
225
|
+
},
|
|
226
|
+
"ownerListenDisabledChannels": {
|
|
227
|
+
"type": "array",
|
|
228
|
+
"items": {
|
|
229
|
+
"type": "string",
|
|
230
|
+
"minLength": 1
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"additionalProperties": false
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
"autoAcceptDmInvites": {
|
|
238
|
+
"type": "boolean"
|
|
239
|
+
},
|
|
240
|
+
"autoAcceptGroupInvites": {
|
|
241
|
+
"type": "boolean"
|
|
242
|
+
},
|
|
243
|
+
"ownerShip": {
|
|
244
|
+
"type": "string",
|
|
245
|
+
"minLength": 1
|
|
246
|
+
},
|
|
247
|
+
"reactionLevel": {
|
|
248
|
+
"type": "string",
|
|
249
|
+
"enum": [
|
|
250
|
+
"off",
|
|
251
|
+
"ack",
|
|
252
|
+
"minimal",
|
|
253
|
+
"extensive"
|
|
254
|
+
]
|
|
255
|
+
},
|
|
256
|
+
"maxConsecutiveBotResponses": {
|
|
257
|
+
"type": "integer",
|
|
258
|
+
"minimum": 0,
|
|
259
|
+
"maximum": 9007199254740991
|
|
260
|
+
},
|
|
261
|
+
"telemetry": {
|
|
262
|
+
"type": "object",
|
|
263
|
+
"properties": {
|
|
264
|
+
"enabled": {
|
|
265
|
+
"type": "boolean"
|
|
266
|
+
},
|
|
267
|
+
"apiKey": {
|
|
268
|
+
"type": "string",
|
|
269
|
+
"minLength": 1
|
|
270
|
+
},
|
|
271
|
+
"host": {
|
|
272
|
+
"type": "string",
|
|
273
|
+
"minLength": 1
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
"additionalProperties": false
|
|
277
|
+
},
|
|
278
|
+
"reengagement": {
|
|
279
|
+
"type": "object",
|
|
280
|
+
"properties": {
|
|
281
|
+
"enabled": {
|
|
282
|
+
"type": "boolean"
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
"additionalProperties": false
|
|
286
|
+
},
|
|
287
|
+
"nudgeActiveHours": {
|
|
288
|
+
"type": "object",
|
|
289
|
+
"properties": {
|
|
290
|
+
"start": {
|
|
291
|
+
"type": "string",
|
|
292
|
+
"minLength": 1
|
|
293
|
+
},
|
|
294
|
+
"end": {
|
|
295
|
+
"type": "string",
|
|
296
|
+
"minLength": 1
|
|
297
|
+
},
|
|
298
|
+
"timezone": {
|
|
299
|
+
"type": "string",
|
|
300
|
+
"minLength": 1
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
"additionalProperties": false
|
|
304
|
+
},
|
|
305
|
+
"ownerListenEnabled": {
|
|
306
|
+
"type": "boolean"
|
|
307
|
+
},
|
|
308
|
+
"ownerListenDisabledChannels": {
|
|
309
|
+
"type": "array",
|
|
310
|
+
"items": {
|
|
311
|
+
"type": "string",
|
|
312
|
+
"minLength": 1
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
"additionalProperties": false
|
|
317
|
+
}
|
|
318
|
+
}
|
|
9
319
|
}
|
|
10
320
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tloncorp/openclaw",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "OpenClaw Tlon/Urbit channel plugin",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/tloncorp/
|
|
8
|
+
"url": "https://github.com/tloncorp/tlon-apps.git",
|
|
9
|
+
"directory": "packages/openclaw"
|
|
9
10
|
},
|
|
10
11
|
"files": [
|
|
11
12
|
"dist/",
|
|
@@ -26,19 +27,48 @@
|
|
|
26
27
|
}
|
|
27
28
|
},
|
|
28
29
|
"scripts": {
|
|
30
|
+
"build": "tsc",
|
|
31
|
+
"postbuild": "node scripts/generate-channel-configs.mjs",
|
|
32
|
+
"clean": "rm -rf dist",
|
|
33
|
+
"dev": "./dev/run.sh",
|
|
34
|
+
"lint": "eslint .",
|
|
35
|
+
"lint:format": "prettier ./ --write",
|
|
36
|
+
"postinstall": "node scripts/generate-version.js",
|
|
37
|
+
"prebuild": "node scripts/generate-version.js",
|
|
38
|
+
"tsc": "tsc --noEmit",
|
|
39
|
+
"test": "vitest run src/",
|
|
40
|
+
"test:all": "vitest run && vitest run --config vitest.integration.config.ts",
|
|
41
|
+
"test:integration": "bash ./test/run.sh",
|
|
42
|
+
"test:integration:dev": "./test/run-dev.sh",
|
|
43
|
+
"test:integration:watch": "./test/run-dev.sh --watch",
|
|
44
|
+
"test:manual": "bash ./test/run-manual.sh",
|
|
45
|
+
"test:security": "vitest run src/security.test.ts",
|
|
46
|
+
"test:watch": "vitest src/",
|
|
29
47
|
"prepare:publish": "npm run build && node scripts/prepare-publish-package.js",
|
|
30
48
|
"pack:publish": "npm run prepare:publish && npm pack .publish",
|
|
31
49
|
"publish:clean": "npm run prepare:publish && npm publish .publish --access public"
|
|
32
50
|
},
|
|
33
51
|
"dependencies": {
|
|
34
|
-
"@tloncorp/api": "
|
|
35
|
-
"@tloncorp/tlon-skill": "
|
|
52
|
+
"@tloncorp/api": "workspace:^",
|
|
53
|
+
"@tloncorp/tlon-skill": "workspace:^",
|
|
36
54
|
"@urbit/aura": "^3.0.0",
|
|
37
55
|
"posthog-node": "^5.28.9",
|
|
38
|
-
"zod": "^4.
|
|
56
|
+
"zod": "^4.4.1"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@types/node": "^25.4.0",
|
|
60
|
+
"dotenv": "^17.2.4",
|
|
61
|
+
"openclaw": "2026.5.7",
|
|
62
|
+
"typescript": "^5.7.0",
|
|
63
|
+
"vite": "^8.0.7",
|
|
64
|
+
"vitest": "^4.0.0",
|
|
65
|
+
"zod": "^4.4.1"
|
|
39
66
|
},
|
|
40
67
|
"peerDependencies": {
|
|
41
|
-
"openclaw": ">=2026.
|
|
68
|
+
"openclaw": ">=2026.4.27"
|
|
69
|
+
},
|
|
70
|
+
"publishConfig": {
|
|
71
|
+
"access": "public"
|
|
42
72
|
},
|
|
43
73
|
"openclaw": {
|
|
44
74
|
"extensions": [
|
|
@@ -56,7 +86,7 @@
|
|
|
56
86
|
"quickstartAllowFrom": true
|
|
57
87
|
},
|
|
58
88
|
"install": {
|
|
59
|
-
"minHostVersion": ">=2026.
|
|
89
|
+
"minHostVersion": ">=2026.4.27",
|
|
60
90
|
"npmSpec": "@tloncorp/openclaw",
|
|
61
91
|
"localPath": "extensions/tlon",
|
|
62
92
|
"defaultChoice": "npm"
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Heartbeat telemetry hook handler logic.
|
|
3
|
-
*
|
|
4
|
-
* Owns heartbeat session tracking and candidate-send classification.
|
|
5
|
-
* Independent of index.ts plugin registration. Does NOT own PostHog emission —
|
|
6
|
-
* that happens in the monitor at confirmation time.
|
|
7
|
-
*/
|
|
8
|
-
import { clearAllCandidates, setCandidateSend } from "./nudge-candidate.js";
|
|
9
|
-
import { normalizeShip } from "./targets.js";
|
|
10
|
-
import { resolveTlonAccount, listTlonAccountIds } from "./types.js";
|
|
11
|
-
// Stage markers from HEARTBEAT.md — retained for optional debugging/validation.
|
|
12
|
-
const STAGE_1_MARKER = "Quick ideas for your week";
|
|
13
|
-
const STAGE_2_MARKER = "A few things I can do for you";
|
|
14
|
-
const STAGE_3_MARKER = "Still here! Here's what I can do";
|
|
15
|
-
/**
|
|
16
|
-
* Derive nudge stage from message content markers.
|
|
17
|
-
* Retained for optional debugging/validation only — NOT the source of truth
|
|
18
|
-
* for nudgeStage (that comes from lastNudgeStage in the settings store).
|
|
19
|
-
*/
|
|
20
|
-
export function deriveNudgeStage(content) {
|
|
21
|
-
const lower = content.toLowerCase();
|
|
22
|
-
if (lower.includes(STAGE_1_MARKER.toLowerCase())) {
|
|
23
|
-
return 1;
|
|
24
|
-
}
|
|
25
|
-
if (lower.includes(STAGE_2_MARKER.toLowerCase())) {
|
|
26
|
-
return 2;
|
|
27
|
-
}
|
|
28
|
-
if (lower.includes(STAGE_3_MARKER.toLowerCase())) {
|
|
29
|
-
return 3;
|
|
30
|
-
}
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
/** TTL for heartbeat sessions (30 minutes). */
|
|
34
|
-
const HEARTBEAT_SESSION_TTL_MS = 30 * 60 * 1000;
|
|
35
|
-
const heartbeatSessions = new Map();
|
|
36
|
-
function cleanupStaleSessions(now = Date.now()) {
|
|
37
|
-
for (const [key, session] of heartbeatSessions) {
|
|
38
|
-
if (now - session.startedAt > HEARTBEAT_SESSION_TTL_MS) {
|
|
39
|
-
heartbeatSessions.delete(key);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
export function createHeartbeatTelemetryHandlers(deps) {
|
|
44
|
-
// Resolve configured account IDs once at creation time for safe accountId resolution.
|
|
45
|
-
const configuredAccountIds = listTlonAccountIds(deps.config);
|
|
46
|
-
function resolveAccountId(contextAccountId) {
|
|
47
|
-
if (contextAccountId) {
|
|
48
|
-
return contextAccountId;
|
|
49
|
-
}
|
|
50
|
-
if (configuredAccountIds.length === 1) {
|
|
51
|
-
return configuredAccountIds[0];
|
|
52
|
-
}
|
|
53
|
-
if (configuredAccountIds.length > 1) {
|
|
54
|
-
deps.logger.warn(`[tlon] heartbeat: message:sent missing accountId with ${configuredAccountIds.length} accounts configured; dropping event`);
|
|
55
|
-
}
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
function resolveOwnerShip(accountId) {
|
|
59
|
-
const effective = deps.getEffectiveOwnerShip(accountId);
|
|
60
|
-
if (effective) {
|
|
61
|
-
return effective;
|
|
62
|
-
}
|
|
63
|
-
const fileConfig = resolveTlonAccount(deps.config, accountId).ownerShip;
|
|
64
|
-
return fileConfig ? normalizeShip(fileConfig) : null;
|
|
65
|
-
}
|
|
66
|
-
const onBeforeAgentStart = (_event, ctx) => {
|
|
67
|
-
if (ctx.messageProvider !== "heartbeat" || !ctx.sessionKey) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
cleanupStaleSessions();
|
|
71
|
-
heartbeatSessions.set(ctx.sessionKey, {
|
|
72
|
-
sessionKey: ctx.sessionKey,
|
|
73
|
-
startedAt: Date.now(),
|
|
74
|
-
provider: null,
|
|
75
|
-
model: null,
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
const onLlmInput = (event, ctx) => {
|
|
79
|
-
if (!ctx.sessionKey) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const session = heartbeatSessions.get(ctx.sessionKey);
|
|
83
|
-
if (!session) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
session.provider = event.provider;
|
|
87
|
-
session.model = event.model;
|
|
88
|
-
};
|
|
89
|
-
const onMessageSent = (event) => {
|
|
90
|
-
if (!event.sessionKey) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
const session = heartbeatSessions.get(event.sessionKey);
|
|
94
|
-
if (!session) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
// Defensive field access — InternalHookEvent.context is Record<string, unknown>
|
|
98
|
-
const ctx = event.context;
|
|
99
|
-
const success = ctx.success;
|
|
100
|
-
const channelId = ctx.channelId;
|
|
101
|
-
const to = ctx.to;
|
|
102
|
-
const content = ctx.content;
|
|
103
|
-
const contextAccountId = ctx.accountId;
|
|
104
|
-
if (!success || channelId !== "tlon") {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
if (typeof to !== "string") {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
const accountId = resolveAccountId(typeof contextAccountId === "string" ? contextAccountId : undefined);
|
|
111
|
-
if (!accountId) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
const ownerShip = resolveOwnerShip(accountId);
|
|
115
|
-
if (!ownerShip) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
const normalizedTo = normalizeShip(to);
|
|
119
|
-
if (normalizedTo !== ownerShip) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
setCandidateSend(accountId, {
|
|
123
|
-
accountId,
|
|
124
|
-
sessionKey: event.sessionKey,
|
|
125
|
-
sentAt: event.timestamp.getTime(),
|
|
126
|
-
ownerShip,
|
|
127
|
-
content: typeof content === "string" ? content : "",
|
|
128
|
-
provider: session.provider,
|
|
129
|
-
model: session.model,
|
|
130
|
-
});
|
|
131
|
-
};
|
|
132
|
-
const onAgentEnd = (_event, ctx) => {
|
|
133
|
-
if (ctx.sessionKey) {
|
|
134
|
-
heartbeatSessions.delete(ctx.sessionKey);
|
|
135
|
-
}
|
|
136
|
-
cleanupStaleSessions();
|
|
137
|
-
};
|
|
138
|
-
const close = () => {
|
|
139
|
-
heartbeatSessions.clear();
|
|
140
|
-
clearAllCandidates();
|
|
141
|
-
};
|
|
142
|
-
return {
|
|
143
|
-
onBeforeAgentStart,
|
|
144
|
-
onLlmInput,
|
|
145
|
-
onMessageSent,
|
|
146
|
-
onAgentEnd,
|
|
147
|
-
close,
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
export const _testing = {
|
|
151
|
-
clearSessions: () => heartbeatSessions.clear(),
|
|
152
|
-
getSessionTtlMs: () => HEARTBEAT_SESSION_TTL_MS,
|
|
153
|
-
getSession: (key) => heartbeatSessions.get(key) ?? null,
|
|
154
|
-
};
|
|
155
|
-
//# sourceMappingURL=heartbeat-telemetry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"heartbeat-telemetry.js","sourceRoot":"","sources":["../../src/heartbeat-telemetry.ts"],"names":[],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J,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,aAAa,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,EAAE;IAC9C,eAAe,EAAE,GAAG,EAAE,CAAC,wBAAwB;IAC/C,UAAU,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI;CAChE,CAAC"}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Candidate send state for two-signal nudge confirmation.
|
|
3
|
-
*
|
|
4
|
-
* A successful `message:sent` to ownerShip during a heartbeat session is stored
|
|
5
|
-
* as a "candidate" here. The candidate is only promoted to a confirmed nudge
|
|
6
|
-
* when it is paired with a matching `lastNudgeStage` settings-store update,
|
|
7
|
-
* regardless of which signal arrives first.
|
|
8
|
-
*
|
|
9
|
-
* Keyed by accountId — each account has at most one candidate at a time.
|
|
10
|
-
*/
|
|
11
|
-
/** TTL for unconfirmed candidates (10 minutes). Longer than the 5-minute settings refresh interval to give the stale-subscription fallback time to deliver a missed lastNudgeStage update. */
|
|
12
|
-
const CANDIDATE_TTL_MS = 10 * 60 * 1000;
|
|
13
|
-
const candidates = new Map();
|
|
14
|
-
const pendingStageSignals = new Map();
|
|
15
|
-
const confirmationCallbacks = new Map();
|
|
16
|
-
function isNudgeStage(stage) {
|
|
17
|
-
return stage === 1 || stage === 2 || stage === 3;
|
|
18
|
-
}
|
|
19
|
-
function cleanupStaleCandidates(now = Date.now()) {
|
|
20
|
-
for (const [key, candidate] of candidates) {
|
|
21
|
-
if (now - candidate.sentAt > CANDIDATE_TTL_MS) {
|
|
22
|
-
candidates.delete(key);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function cleanupStaleStageSignals(now = Date.now()) {
|
|
27
|
-
for (const [key, signal] of pendingStageSignals) {
|
|
28
|
-
if (now - signal.observedAt > CANDIDATE_TTL_MS) {
|
|
29
|
-
pendingStageSignals.delete(key);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function buildConfirmedNudge(candidate, stage) {
|
|
34
|
-
return {
|
|
35
|
-
accountId: candidate.accountId,
|
|
36
|
-
sessionKey: candidate.sessionKey,
|
|
37
|
-
sentAt: candidate.sentAt,
|
|
38
|
-
ownerShip: candidate.ownerShip,
|
|
39
|
-
nudgeStage: stage,
|
|
40
|
-
content: candidate.content,
|
|
41
|
-
provider: candidate.provider,
|
|
42
|
-
model: candidate.model,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
function emitConfirmedNudge(accountId, confirmed) {
|
|
46
|
-
if (confirmed) {
|
|
47
|
-
confirmationCallbacks.get(accountId)?.(confirmed);
|
|
48
|
-
}
|
|
49
|
-
return confirmed;
|
|
50
|
-
}
|
|
51
|
-
function consumePendingConfirmation(accountId) {
|
|
52
|
-
const candidate = candidates.get(accountId);
|
|
53
|
-
const signal = pendingStageSignals.get(accountId);
|
|
54
|
-
if (!candidate || !signal) {
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
candidates.delete(accountId);
|
|
58
|
-
pendingStageSignals.delete(accountId);
|
|
59
|
-
return buildConfirmedNudge(candidate, signal.stage);
|
|
60
|
-
}
|
|
61
|
-
export function setCandidateSend(accountId, candidate) {
|
|
62
|
-
cleanupStaleCandidates();
|
|
63
|
-
cleanupStaleStageSignals();
|
|
64
|
-
// Always keep the most recent candidate — if the same heartbeat session
|
|
65
|
-
// produces multiple owner-targeted sends, we attribute to the latest one.
|
|
66
|
-
candidates.set(accountId, candidate);
|
|
67
|
-
return emitConfirmedNudge(accountId, consumePendingConfirmation(accountId));
|
|
68
|
-
}
|
|
69
|
-
export function getCandidateSend(accountId) {
|
|
70
|
-
cleanupStaleCandidates();
|
|
71
|
-
cleanupStaleStageSignals();
|
|
72
|
-
return candidates.get(accountId) ?? null;
|
|
73
|
-
}
|
|
74
|
-
export function clearCandidateSend(accountId) {
|
|
75
|
-
candidates.delete(accountId);
|
|
76
|
-
pendingStageSignals.delete(accountId);
|
|
77
|
-
}
|
|
78
|
-
/** Clear all candidate state (shutdown cleanup). */
|
|
79
|
-
export function clearAllCandidates() {
|
|
80
|
-
candidates.clear();
|
|
81
|
-
pendingStageSignals.clear();
|
|
82
|
-
}
|
|
83
|
-
export function confirmNudgeCandidate(accountId, lastNudgeStage) {
|
|
84
|
-
cleanupStaleCandidates();
|
|
85
|
-
cleanupStaleStageSignals();
|
|
86
|
-
if (!isNudgeStage(lastNudgeStage)) {
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
pendingStageSignals.set(accountId, {
|
|
90
|
-
stage: lastNudgeStage,
|
|
91
|
-
observedAt: Date.now(),
|
|
92
|
-
});
|
|
93
|
-
return emitConfirmedNudge(accountId, consumePendingConfirmation(accountId));
|
|
94
|
-
}
|
|
95
|
-
export function registerConfirmedNudgeCallback(accountId, cb) {
|
|
96
|
-
confirmationCallbacks.set(accountId, cb);
|
|
97
|
-
}
|
|
98
|
-
export function clearConfirmedNudgeCallback(accountId) {
|
|
99
|
-
confirmationCallbacks.delete(accountId);
|
|
100
|
-
}
|
|
101
|
-
export const _testing = {
|
|
102
|
-
clearAll: () => {
|
|
103
|
-
candidates.clear();
|
|
104
|
-
pendingStageSignals.clear();
|
|
105
|
-
confirmationCallbacks.clear();
|
|
106
|
-
},
|
|
107
|
-
getCandidateTtlMs: () => CANDIDATE_TTL_MS,
|
|
108
|
-
};
|
|
109
|
-
//# sourceMappingURL=nudge-candidate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nudge-candidate.js","sourceRoot":"","sources":["../../src/nudge-candidate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAuBH,8LAA8L;AAC9L,MAAM,gBAAgB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAExC,MAAM,UAAU,GAAG,IAAI,GAAG,EAA0B,CAAC;AACrD,MAAM,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