@openclaw/slack 2026.7.2-beta.7 → 2026.8.1-beta.2

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.
Files changed (78) hide show
  1. package/dist/{account-inspect-DEKpg9Ip.js → account-inspect-Drw2gAiN.js} +1 -1
  2. package/dist/account-inspect-api.js +1 -1
  3. package/dist/{accounts-CHAeNZOX.js → accounts-CK4AVI2_.js} +2 -2
  4. package/dist/{accounts.runtime-BHD4Ma2R.js → accounts.runtime-Cb7QwWBz.js} +1 -1
  5. package/dist/{action-runtime-DfuYoMjG.js → action-runtime-BkGe7ny_.js} +148 -76
  6. package/dist/action-runtime.runtime-D9I6uc0Q.js +2 -0
  7. package/dist/{actions-D3NuJvva.js → actions-BTDXwwE3.js} +85 -44
  8. package/dist/actions.runtime-DLFyUkvg.js +2 -0
  9. package/dist/api.js +15 -15
  10. package/dist/{approval-handler.runtime-BA05P0QT.js → approval-handler.runtime-CJaNzAq2.js} +51 -14
  11. package/dist/{block-text-DkHaoGem.js → block-text-YtiNkqmx.js} +1 -1
  12. package/dist/{channel-B9fVdW3s.js → channel-D_tovcUL.js} +151 -91
  13. package/dist/channel-config-api.js +1 -1
  14. package/dist/channel-plugin-api.js +1 -1
  15. package/dist/{channel-type-DXyos1d2.js → channel-type-B9MSdoGN.js} +9 -8
  16. package/dist/{config-adapter-CxBQH8fq.js → channel.setup-Bch9dYmA.js} +83 -25
  17. package/dist/{config-schema-SgZT6nXV.js → config-schema-xto5jFIx.js} +5 -11
  18. package/dist/{directory-config-CnCIAktf.js → directory-config-CNBz8lJa.js} +3 -3
  19. package/dist/directory-contract-api.js +1 -1
  20. package/dist/{directory-live-DKunWh3A.js → directory-live-CFKUtW9E.js} +13 -22
  21. package/dist/{doctor-contract-CsGH1Dfc.js → doctor-contract-BAy7-EUQ.js} +30 -3
  22. package/dist/doctor-contract-api.js +1 -1
  23. package/dist/{group-policy-NQZti9t-.js → group-policy-c4RP9bjc.js} +248 -163
  24. package/dist/index.js +4 -1
  25. package/dist/{message-tool-api-DkhFpMoy.js → message-tool-api-BykQB4AU.js} +14 -3
  26. package/dist/message-tool-api.js +1 -1
  27. package/dist/{monitor-CmKz0wtI.js → monitor-1nF1NtqT.js} +3 -3
  28. package/dist/{outbound-adapter-BkuMp2Vs.js → outbound-adapter-S81tsswN.js} +19 -17
  29. package/dist/{pipeline.runtime-DgtmuYCP.js → pipeline.runtime-BvYsM5JO.js} +1087 -682
  30. package/dist/{policy-PRysPn23.js → policy-TapwbeaT.js} +18 -14
  31. package/dist/{probe-CgDsSops.js → probe-HoEg_WxB.js} +38 -18
  32. package/dist/{provider-DmRizMZt.js → provider-CDNvBXUi.js} +3422 -2590
  33. package/dist/{relay-source-Blxj8xb4.js → relay-source-C9leF11u.js} +11 -21
  34. package/dist/{replies-4s_Vq_z9.js → replies-CeOfv82I.js} +52 -6
  35. package/dist/{resolve-channels-yEqmM-3I.js → resolve-channels-CNPrxaXY.js} +39 -12
  36. package/dist/{resolve-users-BOrt5K-5.js → resolve-users-Dzomuwnr.js} +28 -5
  37. package/dist/{runtime-api-QMb-Q5Ko.js → runtime-api-Cj9nxBNv.js} +3 -3
  38. package/dist/runtime-api.js +11 -11
  39. package/dist/{scopes-BJSrkAp6.js → scopes-cYXKkrRD.js} +1 -1
  40. package/dist/{send-DsLeZpST.js → send-Nor0iBwY.js} +211 -105
  41. package/dist/{send.runtime-gUdK6V3h.js → send.runtime-BmgNe6S9.js} +1 -1
  42. package/dist/setup-entry.js +1 -4
  43. package/dist/setup-plugin-api.js +1 -1
  44. package/dist/{setup-surface-BeNzrMrJ.js → setup-surface-CbX1-Knh.js} +6 -6
  45. package/dist/{shared-DgIN3Dcr.js → shared-zdT5AMp-.js} +36 -42
  46. package/dist/{slash-dispatch.runtime-zPkyl7dB.js → slash-dispatch.runtime-Bnr9GR1S.js} +1 -1
  47. package/dist/{streaming-compat-3_X-21wW.js → streaming-compat-B-e0mqM0.js} +3 -8
  48. package/dist/{target-parsing-N6lHogYZ.js → target-parsing-BnMD2ZqZ.js} +40 -2
  49. package/dist/{targets-KmjP2E8s.js → targets-Cx5W_n3W.js} +1 -1
  50. package/node_modules/@slack/bolt/node_modules/@types/node/README.md +1 -1
  51. package/node_modules/@slack/bolt/node_modules/@types/node/crypto.d.ts +1 -1
  52. package/node_modules/@slack/bolt/node_modules/@types/node/package.json +2 -2
  53. package/node_modules/@slack/socket-mode/node_modules/@types/node/README.md +1 -1
  54. package/node_modules/@slack/socket-mode/node_modules/@types/node/crypto.d.ts +1 -1
  55. package/node_modules/@slack/socket-mode/node_modules/@types/node/package.json +2 -2
  56. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
  57. package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +1 -1
  58. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
  59. package/node_modules/undici/lib/cache/memory-cache-store.js +54 -9
  60. package/node_modules/undici/lib/cache/sqlite-cache-store.js +7 -1
  61. package/node_modules/undici/lib/core/request.js +12 -1
  62. package/node_modules/undici/lib/dispatcher/client-h1.js +11 -2
  63. package/node_modules/undici/lib/handler/cache-handler.js +246 -64
  64. package/node_modules/undici/lib/handler/cache-revalidation-handler.js +3 -3
  65. package/node_modules/undici/lib/handler/retry-handler.js +24 -0
  66. package/node_modules/undici/lib/interceptor/cache.js +159 -52
  67. package/node_modules/undici/lib/util/cache.js +324 -62
  68. package/node_modules/undici/lib/util/date.js +23 -6
  69. package/node_modules/undici/lib/web/cookies/util.js +79 -9
  70. package/node_modules/undici/package.json +1 -1
  71. package/openclaw.plugin.json +239 -34
  72. package/package.json +9 -9
  73. package/skills/slack/SKILL.md +10 -68
  74. package/dist/action-runtime.runtime-DQErZYpz.js +0 -2
  75. package/dist/actions.runtime-BIRU_G4M.js +0 -2
  76. package/dist/channel.setup-CLP5oTvh.js +0 -56
  77. package/dist/preflight-audio.runtime-D5Bgags0.js +0 -3
  78. package/dist/slash-plugin-commands.runtime-Dosfcx3X.js +0 -2
@@ -6,8 +6,9 @@ const util = require('../core/util')
6
6
  const CacheHandler = require('../handler/cache-handler')
7
7
  const MemoryCacheStore = require('../cache/memory-cache-store')
8
8
  const CacheRevalidationHandler = require('../handler/cache-revalidation-handler')
9
- const { assertCacheStore, assertCacheMethods, makeCacheKey, normalizeHeaders, parseCacheControlHeader } = require('../util/cache.js')
9
+ const { assertCacheStore, assertCacheMethods, makeCacheKey, normalizeHeaders, parseCacheControlHeader, isInvalidOrWildcardVaryHeader } = require('../util/cache.js')
10
10
  const { AbortError } = require('../core/errors.js')
11
+ const { parseHttpDate } = require('../util/date.js')
11
12
 
12
13
  /**
13
14
  * @param {(string | RegExp)[] | undefined} origins
@@ -28,6 +29,44 @@ function assertCacheOrigins (origins, name) {
28
29
 
29
30
  const nop = () => {}
30
31
 
32
+ function trimOWS (value) {
33
+ return value.replace(/^[\t ]+|[\t ]+$/g, '')
34
+ }
35
+
36
+ function arrayIncludes (array, value) {
37
+ for (let i = 0; i < array.length; i++) {
38
+ if (array[i] === value) {
39
+ return true
40
+ }
41
+ }
42
+
43
+ return false
44
+ }
45
+
46
+ function hasPragmaNoCache (headers) {
47
+ const pragma = headers?.pragma
48
+ if (!pragma) {
49
+ return false
50
+ }
51
+
52
+ const values = Array.isArray(pragma) ? pragma : [pragma]
53
+ for (let i = 0; i < values.length; i++) {
54
+ const value = values[i]
55
+ if (typeof value !== 'string') {
56
+ continue
57
+ }
58
+
59
+ const directives = value.split(',')
60
+ for (let j = 0; j < directives.length; j++) {
61
+ if (trimOWS(directives[j]).toLowerCase() === 'no-cache') {
62
+ return true
63
+ }
64
+ }
65
+ }
66
+
67
+ return false
68
+ }
69
+
31
70
  /**
32
71
  * @typedef {(options: import('../../types/dispatcher.d.ts').default.DispatchOptions, handler: import('../../types/dispatcher.d.ts').default.DispatchHandler) => void} DispatchFn
33
72
  */
@@ -57,16 +96,92 @@ function needsRevalidation (result, cacheControlDirectives, { headers = {} }) {
57
96
  return false
58
97
  }
59
98
 
99
+ /**
100
+ * @param {import('../../types/cache-interceptor.d.ts').default.GetResult} result
101
+ * @param {import('../../types/cache-interceptor.d.ts').default.CacheOptions['type']} cacheType
102
+ * @returns {boolean}
103
+ */
104
+ function staleResponseRequiresRevalidation (result, cacheType) {
105
+ return result.cacheControlDirectives?.['must-revalidate'] === true ||
106
+ (cacheType === 'shared' && (
107
+ result.cacheControlDirectives?.['proxy-revalidate'] === true ||
108
+ // https://www.rfc-editor.org/rfc/rfc9111.html#section-5.2.2.10
109
+ // s-maxage implies proxy-revalidate for shared caches.
110
+ result.cacheControlDirectives?.['s-maxage'] !== undefined
111
+ ))
112
+ }
113
+
114
+ /**
115
+ * @param {import('../../types/cache-interceptor.d.ts').default.CacheOptions['type']} cacheType
116
+ * @param {import('../../types/header.d.ts').IncomingHttpHeaders} headers
117
+ * @returns {boolean}
118
+ */
119
+ function revalidationResponseDisallowsCachedReuse (cacheType, headers) {
120
+ if (headers.vary && isInvalidOrWildcardVaryHeader(headers.vary)) {
121
+ return true
122
+ }
123
+
124
+ const cacheControl = headers['cache-control']
125
+ if (!cacheControl) {
126
+ return false
127
+ }
128
+
129
+ const cacheControlDirectives = parseCacheControlHeader(cacheControl)
130
+ return cacheControlDirectives['no-store'] === true ||
131
+ (cacheType === 'shared' && cacheControlDirectives.private === true)
132
+ }
133
+
134
+ function revalidationResponseUpdatesCacheControl (headers) {
135
+ return headers['cache-control'] !== undefined
136
+ }
137
+
138
+ function deleteCachedValue (store, cacheKey) {
139
+ try {
140
+ store.delete(cacheKey)?.catch?.(nop)
141
+ } catch {
142
+ // Fail silently
143
+ }
144
+ }
145
+
146
+ function getUsableLastModified (headers) {
147
+ const lastModified = headers?.['last-modified']
148
+ if (typeof lastModified === 'string' && parseHttpDate(lastModified)) {
149
+ return lastModified
150
+ }
151
+ }
152
+
153
+ function makeRevalidationHeaders (opts, result) {
154
+ const headers = {
155
+ ...opts.headers,
156
+ 'if-modified-since': getUsableLastModified(result.headers) ?? new Date(result.cachedAt).toUTCString()
157
+ }
158
+
159
+ if (result.etag) {
160
+ headers['if-none-match'] = result.etag
161
+ }
162
+
163
+ if (result.vary) {
164
+ for (const key in result.vary) {
165
+ if (result.vary[key] != null) {
166
+ headers[key] = result.vary[key]
167
+ }
168
+ }
169
+ }
170
+
171
+ return headers
172
+ }
173
+
60
174
  /**
61
175
  * @param {import('../../types/cache-interceptor.d.ts').default.GetResult} result
62
176
  * @param {import('../../types/cache-interceptor.d.ts').default.CacheControlDirectives | undefined} cacheControlDirectives
177
+ * @param {import('../../types/cache-interceptor.d.ts').default.CacheOptions['type']} cacheType
63
178
  * @returns {boolean}
64
179
  */
65
- function isStale (result, cacheControlDirectives) {
180
+ function isStale (result, cacheControlDirectives, cacheType) {
66
181
  const now = Date.now()
67
182
  if (now > result.staleAt) {
68
183
  // Response is stale
69
- if (cacheControlDirectives?.['max-stale']) {
184
+ if (!staleResponseRequiresRevalidation(result, cacheType) && cacheControlDirectives?.['max-stale']) {
70
185
  // There's a threshold where we can serve stale responses, let's see if
71
186
  // we're in it
72
187
  // https://www.rfc-editor.org/rfc/rfc9111.html#name-max-stale
@@ -93,11 +208,12 @@ function isStale (result, cacheControlDirectives) {
93
208
  /**
94
209
  * Check if we're within the stale-while-revalidate window for a stale response
95
210
  * @param {import('../../types/cache-interceptor.d.ts').default.GetResult} result
211
+ * @param {import('../../types/cache-interceptor.d.ts').default.CacheOptions['type']} cacheType
96
212
  * @returns {boolean}
97
213
  */
98
- function withinStaleWhileRevalidateWindow (result) {
214
+ function withinStaleWhileRevalidateWindow (result, cacheType) {
99
215
  const staleWhileRevalidate = result.cacheControlDirectives?.['stale-while-revalidate']
100
- if (!staleWhileRevalidate) {
216
+ if (!staleWhileRevalidate || staleResponseRequiresRevalidation(result, cacheType)) {
101
217
  return false
102
218
  }
103
219
 
@@ -267,14 +383,10 @@ function handleResult (
267
383
  }
268
384
 
269
385
  const age = Math.round((now - result.cachedAt) / 1000)
270
- if (reqCacheControl?.['max-age'] && age >= reqCacheControl['max-age']) {
271
- // Response is considered expired for this specific request
272
- // https://www.rfc-editor.org/rfc/rfc9111.html#section-5.2.1.1
273
- return dispatch(opts, handler)
274
- }
386
+ const requestMaxAgeExpired = reqCacheControl?.['max-age'] !== undefined && age >= reqCacheControl['max-age']
275
387
 
276
- const stale = isStale(result, reqCacheControl)
277
- const revalidate = needsRevalidation(result, reqCacheControl, opts)
388
+ const stale = requestMaxAgeExpired || isStale(result, reqCacheControl, globalOpts.type)
389
+ const revalidate = requestMaxAgeExpired || needsRevalidation(result, reqCacheControl, opts)
278
390
 
279
391
  // Check if the response is stale
280
392
  if (stale || revalidate) {
@@ -286,28 +398,13 @@ function handleResult (
286
398
 
287
399
  // RFC 5861: If we're within stale-while-revalidate window, serve stale immediately
288
400
  // and revalidate in background, unless immediate revalidation is necessary
289
- if (!revalidate && withinStaleWhileRevalidateWindow(result)) {
401
+ if (!revalidate && withinStaleWhileRevalidateWindow(result, globalOpts.type)) {
290
402
  // Serve stale response immediately
291
403
  sendCachedValue(handler, opts, result, age, null, true)
292
404
 
293
405
  // Start background revalidation (fire-and-forget)
294
406
  queueMicrotask(() => {
295
- const headers = {
296
- ...opts.headers,
297
- 'if-modified-since': new Date(result.cachedAt).toUTCString()
298
- }
299
-
300
- if (result.etag) {
301
- headers['if-none-match'] = result.etag
302
- }
303
-
304
- if (result.vary) {
305
- for (const key in result.vary) {
306
- if (result.vary[key] != null) {
307
- headers[key] = result.vary[key]
308
- }
309
- }
310
- }
407
+ const headers = makeRevalidationHeaders(opts, result)
311
408
 
312
409
  // Background revalidation - update cache if we get new data
313
410
  dispatch(
@@ -331,28 +428,15 @@ function handleResult (
331
428
  }
332
429
 
333
430
  let withinStaleIfErrorThreshold = false
334
- const staleIfErrorExpiry = result.cacheControlDirectives['stale-if-error'] ?? reqCacheControl?.['stale-if-error']
335
- if (staleIfErrorExpiry) {
336
- withinStaleIfErrorThreshold = now < (result.staleAt + (staleIfErrorExpiry * 1000))
337
- }
338
-
339
- const headers = {
340
- ...opts.headers,
341
- 'if-modified-since': new Date(result.cachedAt).toUTCString()
342
- }
343
-
344
- if (result.etag) {
345
- headers['if-none-match'] = result.etag
346
- }
347
-
348
- if (result.vary) {
349
- for (const key in result.vary) {
350
- if (result.vary[key] != null) {
351
- headers[key] = result.vary[key]
352
- }
431
+ if (!staleResponseRequiresRevalidation(result, globalOpts.type)) {
432
+ const staleIfErrorExpiry = result.cacheControlDirectives['stale-if-error'] ?? reqCacheControl?.['stale-if-error']
433
+ if (staleIfErrorExpiry) {
434
+ withinStaleIfErrorThreshold = now < (result.staleAt + (staleIfErrorExpiry * 1000))
353
435
  }
354
436
  }
355
437
 
438
+ const headers = makeRevalidationHeaders(opts, result)
439
+
356
440
  // We need to revalidate the response
357
441
  return dispatch(
358
442
  {
@@ -360,8 +444,23 @@ function handleResult (
360
444
  headers
361
445
  },
362
446
  new CacheRevalidationHandler(
363
- (success, context) => {
447
+ (success, context, statusCode, headers) => {
364
448
  if (success) {
449
+ if (statusCode === 304) {
450
+ if (revalidationResponseDisallowsCachedReuse(globalOpts.type, headers)) {
451
+ if (util.isStream(result.body)) {
452
+ result.body.on('error', nop).destroy()
453
+ }
454
+
455
+ deleteCachedValue(globalOpts.store, cacheKey)
456
+ return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler))
457
+ }
458
+
459
+ if (revalidationResponseUpdatesCacheControl(headers)) {
460
+ deleteCachedValue(globalOpts.store, cacheKey)
461
+ }
462
+ }
463
+
365
464
  // TODO: successful revalidation should be considered fresh (not give stale warning).
366
465
  sendCachedValue(handler, opts, result, age, context, stale)
367
466
  } else if (util.isStream(result.body)) {
@@ -418,11 +517,17 @@ module.exports = (opts = {}) => {
418
517
  type
419
518
  }
420
519
 
421
- const safeMethodsToNotCache = util.safeHTTPMethods.filter(method => methods.includes(method) === false)
520
+ const safeMethodsToNotCache = []
521
+ for (let i = 0; i < util.safeHTTPMethods.length; i++) {
522
+ const method = util.safeHTTPMethods[i]
523
+ if (!arrayIncludes(methods, method)) {
524
+ safeMethodsToNotCache.push(method)
525
+ }
526
+ }
422
527
 
423
528
  return dispatch => {
424
529
  return (opts, handler) => {
425
- if (!opts.origin || safeMethodsToNotCache.includes(opts.method)) {
530
+ if (!opts.origin || arrayIncludes(safeMethodsToNotCache, opts.method)) {
426
531
  // Not a method we want to cache or we don't have the origin, skip
427
532
  return dispatch(opts, handler)
428
533
  }
@@ -457,7 +562,9 @@ module.exports = (opts = {}) => {
457
562
 
458
563
  const reqCacheControl = opts.headers?.['cache-control']
459
564
  ? parseCacheControlHeader(opts.headers['cache-control'])
460
- : undefined
565
+ : hasPragmaNoCache(opts.headers)
566
+ ? { 'no-cache': true }
567
+ : undefined
461
568
 
462
569
  if (reqCacheControl?.['no-store']) {
463
570
  return dispatch(opts, handler)