matterbridge-lg-thinq-plugin 0.1.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/.claude/CLAUDE.md +43 -0
- package/.claude/agents/compiler.md +91 -0
- package/.claude/agents/direct-executor.md +98 -0
- package/.claude/agents/documenter.md +78 -0
- package/.claude/agents/finalizer.md +233 -0
- package/.claude/agents/implementer.md +112 -0
- package/.claude/agents/investigator.md +100 -0
- package/.claude/agents/release-manager.md +203 -0
- package/.claude/agents/reviewer.md +131 -0
- package/.claude/agents/technical-architect.md +403 -0
- package/.claude/agents/test-writer.md +159 -0
- package/.claude/agents/wiki-manager.md +147 -0
- package/.claude/instructions/agent-prompts.md +90 -0
- package/.claude/instructions/shared-rules.md +11 -0
- package/.claude/instructions/team-orchestrator-policy.md +165 -0
- package/.claude/memory.md +186 -0
- package/.claude/output-styles/engineer-manager.md +38 -0
- package/.claude/settings.json +40 -0
- package/.claude/settings.local.json +30 -0
- package/.claude/skills/load-policy/SKILL.md +13 -0
- package/.claude/skills/ref-idea/SKILL.md +44 -0
- package/.claude/skills/status-of/SKILL.md +38 -0
- package/.claude/skills/workspace-console/SKILL.md +49 -0
- package/.claude/statusline-command.sh +130 -0
- package/.claude/statusline.md +53 -0
- package/.claude/templates/approval-packet.template.html +171 -0
- package/.claude/templates/reference-workspaces.md +16 -0
- package/.claude/tools/cli-runner-server.cjs +220 -0
- package/.claude/tools/discord-send-server.cjs +188 -0
- package/.claude/tools/github-release-server.cjs +181 -0
- package/.claude/tools/glob-grep-server.cjs +267 -0
- package/.claude/tools/read-log-server.cjs +175 -0
- package/.github/codeql/codeql-config.yml +14 -0
- package/.github/workflows/build.yml +54 -0
- package/.github/workflows/codeql.yml +59 -0
- package/.github/workflows/coverage.yml +70 -0
- package/.github/workflows/publish.yml +103 -0
- package/.mcp.json +34 -0
- package/CHANGELOG.md +195 -0
- package/LICENSE +21 -0
- package/dist/cli/commands/devices.js +52 -0
- package/dist/cli/commands/energy.js +122 -0
- package/dist/cli/commands/login.js +54 -0
- package/dist/cli/help.js +50 -0
- package/dist/cli/main.js +56 -0
- package/dist/cli/session.js +13 -0
- package/dist/cli/types.js +1 -0
- package/dist/cli/utils.js +29 -0
- package/dist/cli.js +2 -0
- package/dist/constants/index.js +1 -0
- package/dist/core/domain/entities/ThinqDevice.js +43 -0
- package/dist/core/domain/value-objects/AirConditionerCapabilities.js +22 -0
- package/dist/core/domain/value-objects/ThinqFilterState.js +35 -0
- package/dist/core/domain/value-objects/ThinqSnapshot.js +125 -0
- package/dist/errors/AuthenticationError.js +26 -0
- package/dist/errors/BaseError.js +23 -0
- package/dist/errors/index.js +2 -0
- package/dist/model/LgThinkqPluginPlatformConfig.js +23 -0
- package/dist/model/LgThinqPluginPlatformConfig.js +23 -0
- package/dist/module.js +212 -0
- package/dist/platform/deviceRegistry.js +26 -0
- package/dist/platform/platformConfigManager.js +89 -0
- package/dist/platform/platformState.js +9 -0
- package/dist/platform/thinq/thinqAirConditionerCommandHandlers.js +190 -0
- package/dist/platform/thinq/thinqAirConditionerEndpointFactory.js +53 -0
- package/dist/platform/thinq/thinqAirConditionerFilterResetCommandHandler.js +54 -0
- package/dist/platform/thinq/thinqAirConditionerFilterStateSync.js +19 -0
- package/dist/platform/thinq/thinqAirConditionerStateSync.js +205 -0
- package/dist/platform/thinq/thinqDeviceConfigReconciler.js +26 -0
- package/dist/platform/thinq/thinqDeviceConfigurator.js +124 -0
- package/dist/platform/thinq/thinqDeviceDiscovery.js +33 -0
- package/dist/platform/thinq/thinqWasherCommandHandlers.js +54 -0
- package/dist/platform/thinq/thinqWasherEndpointFactory.js +6 -0
- package/dist/platform/thinq/thinqWasherStateSync.js +31 -0
- package/dist/platform/thinq/thinqWasherStopCommandResolver.js +38 -0
- package/dist/services/authentication/AccountAuthStrategy.js +135 -0
- package/dist/services/authentication/AuthContext.js +1 -0
- package/dist/services/authentication/AuthenticationCoordinator.js +29 -0
- package/dist/services/authentication/IAuthStrategy.js +1 -0
- package/dist/services/authentication/TokenAuthStrategy.js +27 -0
- package/dist/services/authentication/UserDataRepository.js +32 -0
- package/dist/services/thinq/gateway.js +61 -0
- package/dist/services/thinq/mqtt/mqttCertificate.js +63 -0
- package/dist/services/thinq/mqtt/mqttConnectionEvents.js +37 -0
- package/dist/services/thinq/mqtt/mqttKeyRepository.js +33 -0
- package/dist/services/thinq/mqtt/mqttRetry.js +25 -0
- package/dist/services/thinq/mqtt/thinqMqttListener.js +97 -0
- package/dist/services/thinq/serviceContainer.js +73 -0
- package/dist/services/thinq/session.js +48 -0
- package/dist/services/thinq/thinqApiClient.js +258 -0
- package/dist/services/thinq/thinqDeviceService.js +75 -0
- package/dist/services/thinq/thinqFilterMonitoringService.js +40 -0
- package/dist/settings.js +9 -0
- package/dist/tests/helpers/testUtils.js +87 -0
- package/dist/utils/mask.js +39 -0
- package/docs/README_CLI.md +166 -0
- package/eslint.config.js +194 -0
- package/matterbridge-lg-thinq-plugin.config.json +27 -0
- package/matterbridge-lg-thinq-plugin.schema.json +520 -0
- package/package.json +107 -0
- package/prettier.config.js +49 -0
- package/scripts/parse-junit-failures.mjs +45 -0
- package/scripts/parse-tsc-failures.mjs +48 -0
- package/scripts/run-build-local-summary.mjs +29 -0
- package/scripts/run-format-summary.mjs +36 -0
- package/scripts/run-lint-fix-summary.mjs +38 -0
- package/scripts/run-precommit-summary.mjs +94 -0
- package/src/cli/commands/devices.ts +67 -0
- package/src/cli/commands/energy.ts +160 -0
- package/src/cli/commands/login.ts +74 -0
- package/src/cli/help.ts +53 -0
- package/src/cli/main.ts +66 -0
- package/src/cli/session.ts +15 -0
- package/src/cli/types.ts +10 -0
- package/src/cli/utils.ts +30 -0
- package/src/cli.ts +3 -0
- package/src/constants/index.ts +8 -0
- package/src/core/domain/entities/ThinqDevice.test.ts +224 -0
- package/src/core/domain/entities/ThinqDevice.ts +74 -0
- package/src/core/domain/value-objects/AirConditionerCapabilities.ts +50 -0
- package/src/core/domain/value-objects/ThinqFilterState.ts +50 -0
- package/src/core/domain/value-objects/ThinqSnapshot.ts +162 -0
- package/src/errors/AuthenticationError.ts +37 -0
- package/src/errors/BaseError.ts +38 -0
- package/src/errors/index.ts +24 -0
- package/src/model/LgThinqPluginPlatformConfig.ts +94 -0
- package/src/module.ts +298 -0
- package/src/platform/deviceRegistry.ts +58 -0
- package/src/platform/platformConfigManager.ts +133 -0
- package/src/platform/platformState.ts +16 -0
- package/src/platform/thinq/thinqAirConditionerCommandHandlers.ts +291 -0
- package/src/platform/thinq/thinqAirConditionerEndpointFactory.ts +145 -0
- package/src/platform/thinq/thinqAirConditionerFilterResetCommandHandler.ts +96 -0
- package/src/platform/thinq/thinqAirConditionerFilterStateSync.ts +42 -0
- package/src/platform/thinq/thinqAirConditionerStateSync.ts +343 -0
- package/src/platform/thinq/thinqDeviceConfigReconciler.ts +42 -0
- package/src/platform/thinq/thinqDeviceConfigurator.test.ts +90 -0
- package/src/platform/thinq/thinqDeviceConfigurator.ts +191 -0
- package/src/platform/thinq/thinqDeviceDiscovery.test.ts +173 -0
- package/src/platform/thinq/thinqDeviceDiscovery.ts +51 -0
- package/src/platform/thinq/thinqWasherCommandHandlers.ts +120 -0
- package/src/platform/thinq/thinqWasherEndpointFactory.ts +37 -0
- package/src/platform/thinq/thinqWasherStateSync.ts +60 -0
- package/src/platform/thinq/thinqWasherStopCommandResolver.ts +62 -0
- package/src/services/authentication/AccountAuthStrategy.test.ts +358 -0
- package/src/services/authentication/AccountAuthStrategy.ts +209 -0
- package/src/services/authentication/AuthContext.ts +19 -0
- package/src/services/authentication/AuthenticationCoordinator.test.ts +217 -0
- package/src/services/authentication/AuthenticationCoordinator.ts +59 -0
- package/src/services/authentication/IAuthStrategy.ts +10 -0
- package/src/services/authentication/TokenAuthStrategy.test.ts +167 -0
- package/src/services/authentication/TokenAuthStrategy.ts +40 -0
- package/src/services/authentication/UserDataRepository.test.ts +149 -0
- package/src/services/authentication/UserDataRepository.ts +46 -0
- package/src/services/thinq/gateway.ts +86 -0
- package/src/services/thinq/mqtt/mqttCertificate.test.ts +344 -0
- package/src/services/thinq/mqtt/mqttCertificate.ts +102 -0
- package/src/services/thinq/mqtt/mqttConnectionEvents.test.ts +276 -0
- package/src/services/thinq/mqtt/mqttConnectionEvents.ts +76 -0
- package/src/services/thinq/mqtt/mqttKeyRepository.test.ts +164 -0
- package/src/services/thinq/mqtt/mqttKeyRepository.ts +43 -0
- package/src/services/thinq/mqtt/mqttRetry.test.ts +239 -0
- package/src/services/thinq/mqtt/mqttRetry.ts +43 -0
- package/src/services/thinq/mqtt/thinqMqttListener.test.ts +349 -0
- package/src/services/thinq/mqtt/thinqMqttListener.ts +120 -0
- package/src/services/thinq/serviceContainer.test.ts +203 -0
- package/src/services/thinq/serviceContainer.ts +105 -0
- package/src/services/thinq/session.test.ts +287 -0
- package/src/services/thinq/session.ts +69 -0
- package/src/services/thinq/thinqApiClient.test.ts +702 -0
- package/src/services/thinq/thinqApiClient.ts +418 -0
- package/src/services/thinq/thinqDeviceService.test.ts +415 -0
- package/src/services/thinq/thinqDeviceService.ts +101 -0
- package/src/services/thinq/thinqFilterMonitoringService.test.ts +264 -0
- package/src/services/thinq/thinqFilterMonitoringService.ts +53 -0
- package/src/settings.ts +18 -0
- package/src/tests/cli/commands/devices.test.ts +293 -0
- package/src/tests/cli/commands/login.test.ts +240 -0
- package/src/tests/cli/help.test.ts +46 -0
- package/src/tests/cli/main.test.ts +214 -0
- package/src/tests/cli/session.test.ts +198 -0
- package/src/tests/cli/utils.test.ts +194 -0
- package/src/tests/core/domain/value-objects/AirConditionerCapabilities.test.ts +685 -0
- package/src/tests/core/domain/value-objects/ThinqFilterState.test.ts +210 -0
- package/src/tests/core/domain/value-objects/ThinqSnapshot.test.ts +1035 -0
- package/src/tests/helpers/testUtils.ts +118 -0
- package/src/tests/model/LgThinqPluginPlatformConfig.test.ts +81 -0
- package/src/tests/platform/deviceRegistry.test.ts +177 -0
- package/src/tests/platform/platformConfigManager.test.ts +790 -0
- package/src/tests/platform/platformState.test.ts +41 -0
- package/src/tests/platform/thinq/thinqAirConditionerCommandHandlers.test.ts +879 -0
- package/src/tests/platform/thinq/thinqAirConditionerEndpointFactory.test.ts +993 -0
- package/src/tests/platform/thinq/thinqAirConditionerFilterResetCommandHandler.test.ts +508 -0
- package/src/tests/platform/thinq/thinqAirConditionerFilterStateSync.test.ts +212 -0
- package/src/tests/platform/thinq/thinqAirConditionerStateSync.test.ts +1586 -0
- package/src/tests/platform/thinq/thinqDeviceConfigReconciler.test.ts +269 -0
- package/src/tests/platform/thinq/thinqDeviceConfigurator.test.ts +492 -0
- package/src/tests/platform/thinq/thinqWasherCommandHandlers.test.ts +594 -0
- package/src/tests/platform/thinq/thinqWasherEndpointFactory.test.ts +84 -0
- package/src/tests/platform/thinq/thinqWasherStateSync.test.ts +373 -0
- package/src/tests/platform/thinq/thinqWasherStopCommandResolver.test.ts +392 -0
- package/src/tests/settings.test.ts +33 -0
- package/src/utils/mask.ts +50 -0
- package/tsconfig.base.json +25 -0
- package/tsconfig.json +9 -0
- package/tsconfig.production.json +13 -0
- package/tsconfig.vitest.json +5 -0
- package/vite.config.ts +43 -0
- package/wiki/memory-archive.md +12 -0
- package/wiki/reference-workspaces.md +23 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// MCP stdio server — streams a (possibly huge) log file and returns only the
|
|
4
|
+
// lines matching a keyword, capped. Avoids Read/Grep loading entire logs
|
|
5
|
+
// (some run 100k+ lines) into context. Node built-ins only; no npm deps.
|
|
6
|
+
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const readline = require('readline');
|
|
9
|
+
|
|
10
|
+
const DEFAULT_MAX_LINES = 50;
|
|
11
|
+
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// Transport helpers
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
function send(obj) {
|
|
17
|
+
process.stdout.write(JSON.stringify(obj) + '\n');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function sendResult(id, content) {
|
|
21
|
+
send({
|
|
22
|
+
jsonrpc: '2.0',
|
|
23
|
+
id,
|
|
24
|
+
result: {
|
|
25
|
+
content: [{ type: 'text', text: content }],
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function sendError(id, code, message) {
|
|
31
|
+
send({
|
|
32
|
+
jsonrpc: '2.0',
|
|
33
|
+
id,
|
|
34
|
+
error: { code, message },
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
// ReadLog tool implementation
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
|
|
42
|
+
async function readLog({ filePath, keyword, maxLines }) {
|
|
43
|
+
if (!filePath) {
|
|
44
|
+
return 'Error: "filePath" is required.';
|
|
45
|
+
}
|
|
46
|
+
if (!keyword) {
|
|
47
|
+
return 'Error: "keyword" is required.';
|
|
48
|
+
}
|
|
49
|
+
if (!fs.existsSync(filePath)) {
|
|
50
|
+
return `Error: file not found: ${filePath}`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const cap = Number.isFinite(maxLines) && maxLines > 0 ? Math.floor(maxLines) : DEFAULT_MAX_LINES;
|
|
54
|
+
|
|
55
|
+
let pattern;
|
|
56
|
+
try {
|
|
57
|
+
pattern = new RegExp(keyword, 'i');
|
|
58
|
+
} catch (err) {
|
|
59
|
+
return `Error: invalid keyword regex: ${err.message}`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const matches = [];
|
|
63
|
+
let total = 0;
|
|
64
|
+
|
|
65
|
+
await new Promise((resolve, reject) => {
|
|
66
|
+
const rl = readline.createInterface({
|
|
67
|
+
input: fs.createReadStream(filePath, { encoding: 'utf8' }),
|
|
68
|
+
crlfDelay: Infinity,
|
|
69
|
+
});
|
|
70
|
+
rl.on('line', (line) => {
|
|
71
|
+
if (pattern.test(line)) {
|
|
72
|
+
total += 1;
|
|
73
|
+
matches.push(line);
|
|
74
|
+
if (matches.length > cap) {
|
|
75
|
+
matches.shift();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
rl.on('close', resolve);
|
|
80
|
+
rl.on('error', reject);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const header = `MATCHES: ${total} (showing last ${matches.length})`;
|
|
84
|
+
if (matches.length === 0) {
|
|
85
|
+
return header;
|
|
86
|
+
}
|
|
87
|
+
return `${header}\n${matches.join('\n')}`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
// Tool definitions
|
|
92
|
+
// ---------------------------------------------------------------------------
|
|
93
|
+
|
|
94
|
+
const TOOL_DEFINITIONS = [
|
|
95
|
+
{
|
|
96
|
+
name: 'ReadLog',
|
|
97
|
+
description:
|
|
98
|
+
'Filter a log file by keyword without loading the whole file into context (some logs run 100k+ lines). Streams the file and returns only matching lines, capped to maxLines (default 50, showing the most recent matches). Only use when the user has provided the log file path AND confirmed the keyword for that specific request — log files only, never source code.',
|
|
99
|
+
inputSchema: {
|
|
100
|
+
type: 'object',
|
|
101
|
+
properties: {
|
|
102
|
+
filePath: { type: 'string', description: 'Path to the log file to search' },
|
|
103
|
+
keyword: { type: 'string', description: 'Case-insensitive keyword or regex to match against each line' },
|
|
104
|
+
maxLines: { type: 'number', description: 'Max matching lines to return (default 50, most recent first)' },
|
|
105
|
+
},
|
|
106
|
+
required: ['filePath', 'keyword'],
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
];
|
|
110
|
+
|
|
111
|
+
// ---------------------------------------------------------------------------
|
|
112
|
+
// Request dispatcher
|
|
113
|
+
// ---------------------------------------------------------------------------
|
|
114
|
+
|
|
115
|
+
function handleRequest(req) {
|
|
116
|
+
const { id, method, params } = req;
|
|
117
|
+
|
|
118
|
+
// Notifications (no id) — no response
|
|
119
|
+
if (id === undefined || id === null) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (method === 'initialize') {
|
|
124
|
+
send({
|
|
125
|
+
jsonrpc: '2.0',
|
|
126
|
+
id,
|
|
127
|
+
result: {
|
|
128
|
+
protocolVersion: '2024-11-05',
|
|
129
|
+
serverInfo: { name: 'read-log-server', version: '1.0.0' },
|
|
130
|
+
capabilities: { tools: {} },
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (method === 'tools/list') {
|
|
137
|
+
send({
|
|
138
|
+
jsonrpc: '2.0',
|
|
139
|
+
id,
|
|
140
|
+
result: { tools: TOOL_DEFINITIONS },
|
|
141
|
+
});
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (method === 'tools/call') {
|
|
146
|
+
const { name, arguments: args } = params || {};
|
|
147
|
+
if (name !== 'ReadLog') {
|
|
148
|
+
sendError(id, -32601, `Unknown tool: ${name}`);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
readLog(args || {})
|
|
152
|
+
.then((text) => sendResult(id, text))
|
|
153
|
+
.catch((err) => sendResult(id, `Error: ${err.message}`));
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
sendError(id, -32601, `Method not found: ${method}`);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// ---------------------------------------------------------------------------
|
|
161
|
+
// Main — read newline-delimited JSON from stdin
|
|
162
|
+
// ---------------------------------------------------------------------------
|
|
163
|
+
|
|
164
|
+
const rl = readline.createInterface({ input: process.stdin, crlfDelay: Infinity });
|
|
165
|
+
|
|
166
|
+
rl.on('line', (line) => {
|
|
167
|
+
const trimmed = line.trim();
|
|
168
|
+
if (!trimmed) return;
|
|
169
|
+
try {
|
|
170
|
+
const req = JSON.parse(trimmed);
|
|
171
|
+
handleRequest(req);
|
|
172
|
+
} catch (_) {
|
|
173
|
+
// Malformed JSON — ignore
|
|
174
|
+
}
|
|
175
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: Build, lint and test
|
|
2
|
+
|
|
3
|
+
permissions:
|
|
4
|
+
contents: read
|
|
5
|
+
pull-requests: read
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
branches:
|
|
10
|
+
- main
|
|
11
|
+
pull_request:
|
|
12
|
+
types: [opened, synchronize, reopened, edited]
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
16
|
+
cancel-in-progress: true
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
vitest:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
|
|
22
|
+
strategy:
|
|
23
|
+
fail-fast: false
|
|
24
|
+
matrix:
|
|
25
|
+
node-version: [24.x, 25.x]
|
|
26
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
27
|
+
|
|
28
|
+
steps:
|
|
29
|
+
- name: Checkout code
|
|
30
|
+
uses: actions/checkout@v4
|
|
31
|
+
|
|
32
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
33
|
+
uses: actions/setup-node@v4
|
|
34
|
+
with:
|
|
35
|
+
node-version: ${{ matrix.node-version }}
|
|
36
|
+
registry-url: 'https://registry.npmjs.org/'
|
|
37
|
+
|
|
38
|
+
- name: Clean cache
|
|
39
|
+
run: npm cache clean --force
|
|
40
|
+
|
|
41
|
+
- name: Verify Node.js and Npm versions
|
|
42
|
+
run: node -v && npm -v
|
|
43
|
+
|
|
44
|
+
- name: Install dependencies
|
|
45
|
+
run: npm ci && npm run precondition && npm run deepClean && npm install && npm link matterbridge
|
|
46
|
+
|
|
47
|
+
- name: Lint the project
|
|
48
|
+
run: npm run lint
|
|
49
|
+
|
|
50
|
+
- name: Test the project
|
|
51
|
+
run: npm run test
|
|
52
|
+
|
|
53
|
+
- name: Build (optional)
|
|
54
|
+
run: npm run build
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: CodeQL Analysis
|
|
2
|
+
|
|
3
|
+
permissions:
|
|
4
|
+
contents: read
|
|
5
|
+
security-events: write
|
|
6
|
+
actions: read
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
branches: [main]
|
|
11
|
+
pull_request:
|
|
12
|
+
branches: [main]
|
|
13
|
+
schedule:
|
|
14
|
+
- cron: '0 4 * * 1'
|
|
15
|
+
workflow_dispatch:
|
|
16
|
+
|
|
17
|
+
concurrency:
|
|
18
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
19
|
+
cancel-in-progress: true
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
analyze:
|
|
23
|
+
name: Analyze (javascript-typescript)
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
timeout-minutes: 30
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout
|
|
29
|
+
uses: actions/checkout@v4
|
|
30
|
+
|
|
31
|
+
- name: Initialize CodeQL
|
|
32
|
+
uses: github/codeql-action/init@v4
|
|
33
|
+
with:
|
|
34
|
+
languages: javascript-typescript
|
|
35
|
+
queries: security-extended
|
|
36
|
+
config-file: .github/codeql/codeql-config.yml
|
|
37
|
+
|
|
38
|
+
- name: Setup Node (LTS)
|
|
39
|
+
uses: actions/setup-node@v4
|
|
40
|
+
with:
|
|
41
|
+
node-version: 22
|
|
42
|
+
cache: npm
|
|
43
|
+
|
|
44
|
+
- name: Install dependencies
|
|
45
|
+
run: npm ci
|
|
46
|
+
|
|
47
|
+
- name: Pre build steps
|
|
48
|
+
run: |
|
|
49
|
+
npm run precondition
|
|
50
|
+
npm run deepClean
|
|
51
|
+
npm link matterbridge
|
|
52
|
+
|
|
53
|
+
- name: Build
|
|
54
|
+
run: npm run build
|
|
55
|
+
|
|
56
|
+
- name: Analyze
|
|
57
|
+
uses: github/codeql-action/analyze@v4
|
|
58
|
+
with:
|
|
59
|
+
category: '/language:javascript-typescript'
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
name: Analyze code coverage
|
|
2
|
+
|
|
3
|
+
permissions:
|
|
4
|
+
contents: read
|
|
5
|
+
pull-requests: read
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
branches:
|
|
10
|
+
- main
|
|
11
|
+
pull_request:
|
|
12
|
+
types: [opened, synchronize, reopened, edited]
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
16
|
+
cancel-in-progress: true
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
coverage:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout code
|
|
24
|
+
uses: actions/checkout@v4
|
|
25
|
+
|
|
26
|
+
- name: Use Node.js
|
|
27
|
+
uses: actions/setup-node@v4
|
|
28
|
+
with:
|
|
29
|
+
node-version: '24.x'
|
|
30
|
+
registry-url: 'https://registry.npmjs.org/'
|
|
31
|
+
|
|
32
|
+
- name: Clean cache
|
|
33
|
+
run: npm cache clean --force
|
|
34
|
+
|
|
35
|
+
- name: Verify Node.js version
|
|
36
|
+
run: node -v
|
|
37
|
+
|
|
38
|
+
- name: Verify Npm version
|
|
39
|
+
run: npm -v
|
|
40
|
+
|
|
41
|
+
- name: Install dependencies
|
|
42
|
+
run: npm ci
|
|
43
|
+
|
|
44
|
+
- name: Install dependencies
|
|
45
|
+
run: npm run precondition && npm run deepClean && npm install && npm link matterbridge
|
|
46
|
+
|
|
47
|
+
- name: Lint the project
|
|
48
|
+
run: npm run lint
|
|
49
|
+
|
|
50
|
+
- name: Test the project
|
|
51
|
+
run: npm run test:report
|
|
52
|
+
|
|
53
|
+
- name: Upload test results to Codecov
|
|
54
|
+
if: ${{ !cancelled() }}
|
|
55
|
+
uses: codecov/codecov-action@v5
|
|
56
|
+
with:
|
|
57
|
+
report_type: test_results
|
|
58
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
59
|
+
|
|
60
|
+
- name: Test with coverage
|
|
61
|
+
run: npm run test -- --coverage
|
|
62
|
+
|
|
63
|
+
- name: Upload coverage reports to Codecov
|
|
64
|
+
uses: codecov/codecov-action@v5
|
|
65
|
+
with:
|
|
66
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
67
|
+
slug: RinDevJunior/matterbridge-lg-thinq-plugin
|
|
68
|
+
|
|
69
|
+
- name: Build (optional)
|
|
70
|
+
run: npm run build
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [created]
|
|
6
|
+
|
|
7
|
+
concurrency:
|
|
8
|
+
group: npm-publish
|
|
9
|
+
cancel-in-progress: false
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
id-token: write # needed for npm trusted publishing (OIDC)
|
|
14
|
+
actions: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
publish-release:
|
|
18
|
+
name: Publish release to npm
|
|
19
|
+
if: github.event.release.prerelease == false
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout repository
|
|
24
|
+
uses: actions/checkout@v4
|
|
25
|
+
with:
|
|
26
|
+
ref: main
|
|
27
|
+
|
|
28
|
+
- name: Setup Node.js 24.x
|
|
29
|
+
uses: actions/setup-node@v4
|
|
30
|
+
with:
|
|
31
|
+
node-version: '24.x'
|
|
32
|
+
cache: npm
|
|
33
|
+
|
|
34
|
+
- name: Verify Node.js version
|
|
35
|
+
run: node -v
|
|
36
|
+
|
|
37
|
+
- name: Verify Npm version
|
|
38
|
+
run: npm -v
|
|
39
|
+
|
|
40
|
+
- name: Clone matterbridge repo branch main
|
|
41
|
+
run: npm run precondition
|
|
42
|
+
|
|
43
|
+
- name: Install plugin dependencies
|
|
44
|
+
run: npm ci --no-fund --no-audit
|
|
45
|
+
|
|
46
|
+
- name: Link matterbridge in the project
|
|
47
|
+
run: npm link matterbridge --no-fund --no-audit
|
|
48
|
+
|
|
49
|
+
- name: Build the plugin
|
|
50
|
+
run: npm run build
|
|
51
|
+
|
|
52
|
+
- name: Lint the plugin
|
|
53
|
+
run: npm run lint
|
|
54
|
+
|
|
55
|
+
- name: Test the plugin
|
|
56
|
+
run: npm run test
|
|
57
|
+
|
|
58
|
+
- name: Publish to npm with trusted publishing / OIDC
|
|
59
|
+
run: npm publish --provenance --access public --tag latest
|
|
60
|
+
|
|
61
|
+
publish-release-candidate:
|
|
62
|
+
name: Publish release candidate to npm
|
|
63
|
+
if: github.event.release.prerelease == true
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
|
|
66
|
+
steps:
|
|
67
|
+
- name: Checkout repository
|
|
68
|
+
uses: actions/checkout@v4
|
|
69
|
+
with:
|
|
70
|
+
ref: ${{ github.event.release.tag_name }}
|
|
71
|
+
|
|
72
|
+
- name: Setup Node.js 24.x
|
|
73
|
+
uses: actions/setup-node@v4
|
|
74
|
+
with:
|
|
75
|
+
node-version: '24.x'
|
|
76
|
+
cache: npm
|
|
77
|
+
|
|
78
|
+
- name: Verify Node.js version
|
|
79
|
+
run: node -v
|
|
80
|
+
|
|
81
|
+
- name: Verify Npm version
|
|
82
|
+
run: npm -v
|
|
83
|
+
|
|
84
|
+
- name: Install matterbridge
|
|
85
|
+
run: npm run precondition
|
|
86
|
+
|
|
87
|
+
- name: Install plugin dependencies
|
|
88
|
+
run: npm ci --no-fund --no-audit
|
|
89
|
+
|
|
90
|
+
- name: Link matterbridge in the project
|
|
91
|
+
run: npm link matterbridge --no-fund --no-audit
|
|
92
|
+
|
|
93
|
+
- name: Build the plugin
|
|
94
|
+
run: npm run build
|
|
95
|
+
|
|
96
|
+
- name: Lint the plugin
|
|
97
|
+
run: npm run lint
|
|
98
|
+
|
|
99
|
+
- name: Test the plugin
|
|
100
|
+
run: npm run test
|
|
101
|
+
|
|
102
|
+
- name: Publish to npm with trusted publishing / OIDC
|
|
103
|
+
run: npm publish --provenance --access public --tag dev
|
package/.mcp.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"codegraph": {
|
|
4
|
+
"type": "stdio",
|
|
5
|
+
"command": "codegraph",
|
|
6
|
+
"args": ["serve", "--mcp"]
|
|
7
|
+
},
|
|
8
|
+
"glob-grep": {
|
|
9
|
+
"type": "stdio",
|
|
10
|
+
"command": "node",
|
|
11
|
+
"args": [".claude/tools/glob-grep-server.cjs"]
|
|
12
|
+
},
|
|
13
|
+
"cli-runner": {
|
|
14
|
+
"type": "stdio",
|
|
15
|
+
"command": "node",
|
|
16
|
+
"args": [".claude/tools/cli-runner-server.cjs"]
|
|
17
|
+
},
|
|
18
|
+
"read-log": {
|
|
19
|
+
"type": "stdio",
|
|
20
|
+
"command": "node",
|
|
21
|
+
"args": [".claude/tools/read-log-server.cjs"]
|
|
22
|
+
},
|
|
23
|
+
"discord-send": {
|
|
24
|
+
"type": "stdio",
|
|
25
|
+
"command": "node",
|
|
26
|
+
"args": [".claude/tools/discord-send-server.cjs"]
|
|
27
|
+
},
|
|
28
|
+
"github-release": {
|
|
29
|
+
"type": "stdio",
|
|
30
|
+
"command": "node",
|
|
31
|
+
"args": [".claude/tools/github-release-server.cjs"]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|