agent-messenger 2.24.0 → 2.24.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/.claude-plugin/plugin.json +1 -1
- package/.github/workflows/ci.yml +4 -0
- package/bun.lock +0 -71
- package/dist/package.json +4 -4
- package/dist/src/platforms/kakaotalk/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/token-extractor.js +11 -38
- package/dist/src/platforms/kakaotalk/token-extractor.js.map +1 -1
- package/dist/src/platforms/slack/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/auth.js +32 -5
- package/dist/src/platforms/slack/commands/auth.js.map +1 -1
- package/dist/src/platforms/slack/ensure-auth.d.ts +1 -0
- package/dist/src/platforms/slack/ensure-auth.d.ts.map +1 -1
- package/dist/src/platforms/slack/ensure-auth.js +47 -0
- package/dist/src/platforms/slack/ensure-auth.js.map +1 -1
- package/dist/src/platforms/slack/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/slack/token-extractor.js +5 -11
- package/dist/src/platforms/slack/token-extractor.js.map +1 -1
- package/dist/src/shared/chromium/cookie-reader.d.ts.map +1 -1
- package/dist/src/shared/chromium/cookie-reader.js +4 -19
- package/dist/src/shared/chromium/cookie-reader.js.map +1 -1
- package/dist/src/shared/sqlite.d.ts +10 -0
- package/dist/src/shared/sqlite.d.ts.map +1 -0
- package/dist/src/shared/sqlite.js +46 -0
- package/dist/src/shared/sqlite.js.map +1 -0
- package/package.json +4 -4
- package/skills/agent-channeltalk/SKILL.md +1 -1
- package/skills/agent-channeltalkbot/SKILL.md +1 -1
- package/skills/agent-discord/SKILL.md +1 -1
- package/skills/agent-discordbot/SKILL.md +1 -1
- package/skills/agent-instagram/SKILL.md +1 -1
- package/skills/agent-kakaotalk/SKILL.md +1 -1
- package/skills/agent-line/SKILL.md +1 -1
- package/skills/agent-slack/SKILL.md +1 -1
- package/skills/agent-slackbot/SKILL.md +1 -1
- package/skills/agent-teams/SKILL.md +1 -1
- package/skills/agent-telegram/SKILL.md +1 -1
- package/skills/agent-telegrambot/SKILL.md +1 -1
- package/skills/agent-webex/SKILL.md +1 -1
- package/skills/agent-webexbot/SKILL.md +1 -1
- package/skills/agent-wechatbot/SKILL.md +1 -1
- package/skills/agent-whatsapp/SKILL.md +1 -1
- package/skills/agent-whatsappbot/SKILL.md +1 -1
- package/src/platforms/channeltalk/token-extractor.test.ts +2 -2
- package/src/platforms/kakaotalk/token-extractor.ts +13 -36
- package/src/platforms/slack/commands/auth.ts +33 -5
- package/src/platforms/slack/ensure-auth.test.ts +130 -19
- package/src/platforms/slack/ensure-auth.ts +51 -0
- package/src/platforms/slack/token-extractor-node-test.ts +5 -3
- package/src/platforms/slack/token-extractor.ts +4 -11
- package/src/shared/chromium/cookie-reader-node-test.ts +70 -0
- package/src/shared/chromium/cookie-reader-node.test.ts +10 -0
- package/src/shared/chromium/cookie-reader.ts +4 -21
- package/src/shared/sqlite.ts +61 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { createRequire } from 'node:module'
|
|
2
|
+
|
|
3
|
+
const require = createRequire(import.meta.url)
|
|
4
|
+
|
|
5
|
+
export interface ReadonlyStatement {
|
|
6
|
+
get(...params: unknown[]): unknown
|
|
7
|
+
all(...params: unknown[]): unknown[]
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ReadonlyDatabase {
|
|
11
|
+
prepare(sql: string): ReadonlyStatement
|
|
12
|
+
close(): void
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type ReadonlyDatabaseConstructor = new (path: string, options: { readOnly: boolean }) => ReadonlyDatabase
|
|
16
|
+
|
|
17
|
+
// Uses the runtime's built-in driver (bun:sqlite on Bun, node:sqlite on Node >= 22.13)
|
|
18
|
+
// to avoid a native addon dependency.
|
|
19
|
+
//
|
|
20
|
+
// Runtime quirks callers must respect (both drivers behave this way):
|
|
21
|
+
// - BLOB columns are returned as Uint8Array, not Buffer. Wrap with Buffer.from()
|
|
22
|
+
// before any Buffer-specific call (e.g. .toString('utf8'), node:crypto helpers).
|
|
23
|
+
// - node:sqlite throws ERR_OUT_OF_RANGE when reading an INTEGER above
|
|
24
|
+
// Number.MAX_SAFE_INTEGER, so never SELECT raw microsecond timestamps such as
|
|
25
|
+
// Chromium's *_utc columns; use them only in WHERE / ORDER BY clauses.
|
|
26
|
+
export function openReadonlyDatabase(path: string): ReadonlyDatabase {
|
|
27
|
+
if (typeof globalThis.Bun !== 'undefined') {
|
|
28
|
+
const { Database } = require('bun:sqlite')
|
|
29
|
+
return new Database(path, { readonly: true }) as ReadonlyDatabase
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let DatabaseSync: ReadonlyDatabaseConstructor
|
|
33
|
+
// node:sqlite emits a one-time ExperimentalWarning to stderr on load
|
|
34
|
+
// (Node < 24.15) that clutters the CLI's output. Suppress just that warning
|
|
35
|
+
// while loading the module, then restore the original handler.
|
|
36
|
+
const originalEmitWarning = process.emitWarning
|
|
37
|
+
const filteredEmitWarning = (...args: unknown[]): void => {
|
|
38
|
+
const [warning, second] = args
|
|
39
|
+
const name =
|
|
40
|
+
warning instanceof Error
|
|
41
|
+
? warning.name
|
|
42
|
+
: typeof second === 'string'
|
|
43
|
+
? second
|
|
44
|
+
: (second as { type?: string } | undefined)?.type
|
|
45
|
+
const message = warning instanceof Error ? warning.message : String(warning)
|
|
46
|
+
if (name === 'ExperimentalWarning' && message.includes('SQLite')) return
|
|
47
|
+
;(originalEmitWarning as (...forwarded: unknown[]) => void).apply(process, args)
|
|
48
|
+
}
|
|
49
|
+
process.emitWarning = filteredEmitWarning as typeof process.emitWarning
|
|
50
|
+
try {
|
|
51
|
+
DatabaseSync = require('node:sqlite').DatabaseSync
|
|
52
|
+
} catch {
|
|
53
|
+
throw new Error(
|
|
54
|
+
'SQLite support requires Node.js >= 22.13.0 (the built-in node:sqlite module) or Bun. Please upgrade Node.js.',
|
|
55
|
+
)
|
|
56
|
+
} finally {
|
|
57
|
+
process.emitWarning = originalEmitWarning
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return new DatabaseSync(path, { readOnly: true })
|
|
61
|
+
}
|