agent-messenger 2.19.3 → 2.19.5
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/README.md +8 -0
- package/dist/package.json +1 -1
- package/dist/src/platforms/line/client.d.ts +6 -1
- package/dist/src/platforms/line/client.d.ts.map +1 -1
- package/dist/src/platforms/line/client.js +65 -12
- package/dist/src/platforms/line/client.js.map +1 -1
- package/dist/src/platforms/line/index.d.ts +1 -1
- package/dist/src/platforms/line/index.d.ts.map +1 -1
- package/dist/src/platforms/line/index.js.map +1 -1
- package/dist/src/platforms/line/listener.d.ts.map +1 -1
- package/dist/src/platforms/line/listener.js +24 -4
- package/dist/src/platforms/line/listener.js.map +1 -1
- package/dist/src/platforms/line/types.d.ts +13 -0
- package/dist/src/platforms/line/types.d.ts.map +1 -1
- package/dist/src/platforms/line/types.js +6 -0
- package/dist/src/platforms/line/types.js.map +1 -1
- package/dist/src/vendor/linejs/_dist/client/login.d.ts +2 -1
- package/dist/src/vendor/linejs/client/login.js +3 -2
- package/dist/src/vendor/linejs/client/login.test.ts +11 -0
- package/package.json +1 -1
- 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-line/references/common-patterns.md +9 -3
- 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-wechatbot/SKILL.md +1 -1
- package/skills/agent-whatsapp/SKILL.md +1 -1
- package/skills/agent-whatsappbot/SKILL.md +1 -1
- package/src/platforms/line/client.test.ts +36 -0
- package/src/platforms/line/client.ts +79 -13
- package/src/platforms/line/index.test.ts +10 -0
- package/src/platforms/line/index.ts +1 -0
- package/src/platforms/line/listener.test.ts +59 -0
- package/src/platforms/line/listener.ts +26 -6
- package/src/platforms/line/types.test.ts +17 -0
- package/src/platforms/line/types.ts +13 -0
- package/src/platforms/slack/commands/auth.test.ts +16 -6
- package/src/platforms/slack/token-extractor.test.ts +34 -7
- package/src/vendor/linejs/_dist/client/login.d.ts +2 -1
- package/src/vendor/linejs/client/login.js +3 -2
- package/src/vendor/linejs/client/login.test.ts +11 -0
|
@@ -12,6 +12,7 @@ import { ExtractedWorkspace, TokenExtractor } from './token-extractor'
|
|
|
12
12
|
|
|
13
13
|
const tempDirs: string[] = []
|
|
14
14
|
const originalAgentBrowserProfile = process.env.AGENT_BROWSER_PROFILE
|
|
15
|
+
const originalLocalAppData = process.env.LOCALAPPDATA
|
|
15
16
|
|
|
16
17
|
afterEach(() => {
|
|
17
18
|
if (originalAgentBrowserProfile) {
|
|
@@ -20,12 +21,34 @@ afterEach(() => {
|
|
|
20
21
|
delete process.env.AGENT_BROWSER_PROFILE
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
if (originalLocalAppData) {
|
|
25
|
+
process.env.LOCALAPPDATA = originalLocalAppData
|
|
26
|
+
} else {
|
|
27
|
+
delete process.env.LOCALAPPDATA
|
|
28
|
+
}
|
|
29
|
+
|
|
23
30
|
for (const dir of tempDirs) {
|
|
24
31
|
rmSync(dir, { recursive: true, force: true })
|
|
25
32
|
}
|
|
26
33
|
tempDirs.length = 0
|
|
27
34
|
})
|
|
28
35
|
|
|
36
|
+
async function extractDesktopOnly(extractor: TokenExtractor): Promise<ExtractedWorkspace[]> {
|
|
37
|
+
const extractFromBrowsersSpy = spyOn(TokenExtractor.prototype, 'extractFromBrowsers').mockResolvedValue([])
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
return await extractor.extract()
|
|
41
|
+
} finally {
|
|
42
|
+
extractFromBrowsersSpy.mockRestore()
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function useEmptyWindowsBrowserRoot(): void {
|
|
47
|
+
const browserRoot = mkdtempSync(join(tmpdir(), 'empty-browser-root-'))
|
|
48
|
+
tempDirs.push(browserRoot)
|
|
49
|
+
process.env.LOCALAPPDATA = browserRoot
|
|
50
|
+
}
|
|
51
|
+
|
|
29
52
|
function createCookiesDb(
|
|
30
53
|
dbPath: string,
|
|
31
54
|
cookies: { name: string; value: string; encrypted_value: Uint8Array; host_key: string; last_access_utc: number }[],
|
|
@@ -60,7 +83,7 @@ describe('TokenExtractor token deduplication', () => {
|
|
|
60
83
|
|
|
61
84
|
// when
|
|
62
85
|
const extractor = new TokenExtractor('darwin', slackDir)
|
|
63
|
-
const result = await extractor
|
|
86
|
+
const result = await extractDesktopOnly(extractor)
|
|
64
87
|
|
|
65
88
|
// then — first token wins, but team name is upgraded
|
|
66
89
|
expect(result.length).toBe(1)
|
|
@@ -383,7 +406,7 @@ describe('TokenExtractor debug logging', () => {
|
|
|
383
406
|
|
|
384
407
|
// when
|
|
385
408
|
const extractor = new TokenExtractor('darwin', slackDir, undefined, debugLog)
|
|
386
|
-
await extractor
|
|
409
|
+
await extractDesktopOnly(extractor)
|
|
387
410
|
|
|
388
411
|
// then — should have emitted debug messages
|
|
389
412
|
expect(messages.length).toBeGreaterThan(0)
|
|
@@ -397,7 +420,7 @@ describe('TokenExtractor debug logging', () => {
|
|
|
397
420
|
|
|
398
421
|
// when — then — should not throw
|
|
399
422
|
const extractor = new TokenExtractor('darwin', slackDir)
|
|
400
|
-
const result = await extractor
|
|
423
|
+
const result = await extractDesktopOnly(extractor)
|
|
401
424
|
expect(result).toEqual([])
|
|
402
425
|
})
|
|
403
426
|
})
|
|
@@ -576,7 +599,7 @@ describe('TokenExtractor Windows DPAPI', () => {
|
|
|
576
599
|
|
|
577
600
|
// when
|
|
578
601
|
const extractor = new TestTokenExtractor('win32', slackDir)
|
|
579
|
-
const result = await extractor
|
|
602
|
+
const result = await extractDesktopOnly(extractor)
|
|
580
603
|
|
|
581
604
|
// then
|
|
582
605
|
expect(result).toEqual([
|
|
@@ -711,7 +734,7 @@ describe('TokenExtractor IndexedDB blob files', () => {
|
|
|
711
734
|
|
|
712
735
|
// when
|
|
713
736
|
const extractor = new TokenExtractor('darwin', slackDir)
|
|
714
|
-
const result = await extractor
|
|
737
|
+
const result = await extractDesktopOnly(extractor)
|
|
715
738
|
|
|
716
739
|
// then
|
|
717
740
|
expect(result.length).toBe(0)
|
|
@@ -802,17 +825,21 @@ describe('TokenExtractor getWorkspaceDomains', () => {
|
|
|
802
825
|
|
|
803
826
|
describe('TokenExtractor browser fallback', () => {
|
|
804
827
|
it('extractFromBrowsers returns empty array when no browser profiles have tokens', async () => {
|
|
828
|
+
useEmptyWindowsBrowserRoot()
|
|
829
|
+
|
|
805
830
|
const slackDir = mkdtempSync(join(tmpdir(), 'slack-nonexistent-'))
|
|
806
831
|
tempDirs.push(slackDir)
|
|
807
832
|
rmSync(slackDir, { recursive: true, force: true })
|
|
808
833
|
|
|
809
|
-
const extractor = new TokenExtractor('
|
|
834
|
+
const extractor = new TokenExtractor('win32', slackDir)
|
|
810
835
|
const result = await extractor.extractFromBrowsers()
|
|
811
836
|
expect(result).toEqual([])
|
|
812
837
|
})
|
|
813
838
|
|
|
814
839
|
it('resolves Local State from agent-browser profile root for encrypted cookies', async () => {
|
|
815
840
|
// given
|
|
841
|
+
useEmptyWindowsBrowserRoot()
|
|
842
|
+
|
|
816
843
|
const agentBrowserProfile = mkdtempSync(join(tmpdir(), 'agent-browser-slack-profile-'))
|
|
817
844
|
tempDirs.push(agentBrowserProfile)
|
|
818
845
|
process.env.AGENT_BROWSER_PROFILE = agentBrowserProfile
|
|
@@ -839,7 +866,7 @@ describe('TokenExtractor browser fallback', () => {
|
|
|
839
866
|
|
|
840
867
|
try {
|
|
841
868
|
// when
|
|
842
|
-
const extractor = new TokenExtractor('
|
|
869
|
+
const extractor = new TokenExtractor('win32', join(agentBrowserProfile, 'missing-desktop'))
|
|
843
870
|
const result = await extractor.extractFromBrowsers()
|
|
844
871
|
|
|
845
872
|
// then
|
|
@@ -34,8 +34,9 @@ export interface WithPasswordOptions {
|
|
|
34
34
|
email: string;
|
|
35
35
|
password: string;
|
|
36
36
|
/** @default 114514 */ pincode?: string;
|
|
37
|
+
/** @default true */ e2ee?: boolean;
|
|
37
38
|
onPincodeRequest(pin: string): void | Promise<void>;
|
|
38
39
|
}
|
|
39
40
|
export declare const loginWithPassword: (opts: WithPasswordOptions, init: InitOptions) => Promise<Client>;
|
|
40
41
|
export declare const loginWithAuthToken: (authToken: string, init: InitOptions) => Promise<Client>;
|
|
41
|
-
//# sourceMappingURL=login.d.ts.map
|
|
42
|
+
//# sourceMappingURL=login.d.ts.map
|
|
@@ -22,7 +22,8 @@ export const loginWithPassword = async (opts, init)=>{
|
|
|
22
22
|
await base.loginProcess.withPassword({
|
|
23
23
|
email: opts.email,
|
|
24
24
|
password: opts.password,
|
|
25
|
-
pincode: opts.pincode
|
|
25
|
+
pincode: opts.pincode,
|
|
26
|
+
e2ee: opts.e2ee
|
|
26
27
|
});
|
|
27
28
|
await base.loginProcess.ready();
|
|
28
29
|
return new Client(base);
|
|
@@ -33,4 +34,4 @@ export const loginWithAuthToken = async (authToken, init)=>{
|
|
|
33
34
|
await base.loginProcess.ready();
|
|
34
35
|
return new Client(base);
|
|
35
36
|
};
|
|
36
|
-
//# sourceMappingURL=login.js.map
|
|
37
|
+
//# sourceMappingURL=login.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises'
|
|
2
|
+
|
|
3
|
+
import { describe, expect, it } from 'bun:test'
|
|
4
|
+
|
|
5
|
+
describe('linejs login wrappers', () => {
|
|
6
|
+
it('passes E2EE option through password login', async () => {
|
|
7
|
+
const source = await readFile(new URL('./login.js', import.meta.url), 'utf8')
|
|
8
|
+
|
|
9
|
+
expect(source).toContain('e2ee: opts.e2ee')
|
|
10
|
+
})
|
|
11
|
+
})
|