azerclaw 1.1.2 → 1.6.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/README.md +8 -0
- package/bin/azerclaw.ts +229 -2
- package/dist/bin/azerclaw.d.ts +3 -0
- package/dist/bin/azerclaw.d.ts.map +1 -1
- package/dist/bin/azerclaw.js +197 -2
- package/dist/bin/azerclaw.js.map +1 -1
- package/dist/src/agents/builtin.d.ts +12 -12
- package/dist/src/agents/builtin.js +94 -94
- package/dist/src/agents/builtin.js.map +1 -1
- package/dist/src/channels/adapter.d.ts +10 -1
- package/dist/src/channels/adapter.d.ts.map +1 -1
- package/dist/src/channels/adapter.js +89 -5
- package/dist/src/channels/adapter.js.map +1 -1
- package/dist/src/channels/pairing.d.ts +38 -0
- package/dist/src/channels/pairing.d.ts.map +1 -0
- package/dist/src/channels/pairing.js +171 -0
- package/dist/src/channels/pairing.js.map +1 -0
- package/dist/src/channels/routing.d.ts +14 -0
- package/dist/src/channels/routing.d.ts.map +1 -0
- package/dist/src/channels/routing.js +45 -0
- package/dist/src/channels/routing.js.map +1 -0
- package/dist/src/channels/security.d.ts +18 -0
- package/dist/src/channels/security.d.ts.map +1 -0
- package/dist/src/channels/security.js +80 -0
- package/dist/src/channels/security.js.map +1 -0
- package/dist/src/channels/slack.js +1 -1
- package/dist/src/channels/slack.js.map +1 -1
- package/dist/src/cli/animations/fish.d.ts +2 -1
- package/dist/src/cli/animations/fish.d.ts.map +1 -1
- package/dist/src/cli/animations/fish.js +13 -11
- package/dist/src/cli/animations/fish.js.map +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/agents.js.map +1 -1
- package/dist/src/cli/commands/channels.d.ts +17 -0
- package/dist/src/cli/commands/channels.d.ts.map +1 -0
- package/dist/src/cli/commands/channels.js +173 -0
- package/dist/src/cli/commands/channels.js.map +1 -0
- package/dist/src/cli/commands/chat.d.ts +1 -1
- package/dist/src/cli/commands/chat.d.ts.map +1 -1
- package/dist/src/cli/commands/chat.js +67 -6
- package/dist/src/cli/commands/chat.js.map +1 -1
- package/dist/src/cli/commands/config.d.ts.map +1 -1
- package/dist/src/cli/commands/config.js +10 -1
- package/dist/src/cli/commands/config.js.map +1 -1
- package/dist/src/cli/commands/doctor.d.ts.map +1 -1
- package/dist/src/cli/commands/doctor.js +46 -2
- package/dist/src/cli/commands/doctor.js.map +1 -1
- package/dist/src/cli/commands/models.d.ts.map +1 -1
- package/dist/src/cli/commands/models.js +9 -3
- package/dist/src/cli/commands/models.js.map +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/onboard.js.map +1 -1
- package/dist/src/cli/commands/pairing.d.ts +7 -0
- package/dist/src/cli/commands/pairing.d.ts.map +1 -0
- package/dist/src/cli/commands/pairing.js +64 -0
- package/dist/src/cli/commands/pairing.js.map +1 -0
- package/dist/src/cli/commands/run.d.ts.map +1 -1
- package/dist/src/cli/commands/run.js +1 -0
- package/dist/src/cli/commands/run.js.map +1 -1
- package/dist/src/cli/commands/sandbox.d.ts +7 -0
- package/dist/src/cli/commands/sandbox.d.ts.map +1 -0
- package/dist/src/cli/commands/sandbox.js +98 -0
- package/dist/src/cli/commands/sandbox.js.map +1 -0
- package/dist/src/cli/commands/settings.js +1 -1
- package/dist/src/cli/commands/settings.js.map +1 -1
- package/dist/src/cli/commands/tui.d.ts.map +1 -1
- package/dist/src/cli/commands/tui.js +2 -1
- package/dist/src/cli/commands/tui.js.map +1 -1
- package/dist/src/config/schema.d.ts +214 -68
- package/dist/src/config/schema.d.ts.map +1 -1
- package/dist/src/config/schema.js +54 -8
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/core/runtime.d.ts +2 -0
- package/dist/src/core/runtime.d.ts.map +1 -1
- package/dist/src/core/runtime.js +74 -19
- package/dist/src/core/runtime.js.map +1 -1
- package/dist/src/core/sandbox.d.ts +34 -0
- package/dist/src/core/sandbox.d.ts.map +1 -0
- package/dist/src/core/sandbox.js +127 -0
- package/dist/src/core/sandbox.js.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/providers/openai.d.ts +7 -6
- package/dist/src/providers/openai.d.ts.map +1 -1
- package/dist/src/providers/openai.js.map +1 -1
- package/dist/src/providers/openrouter.d.ts +21 -0
- package/dist/src/providers/openrouter.d.ts.map +1 -0
- package/dist/src/providers/openrouter.js +65 -0
- package/dist/src/providers/openrouter.js.map +1 -0
- package/dist/src/providers/router.d.ts.map +1 -1
- package/dist/src/providers/router.js +13 -2
- package/dist/src/providers/router.js.map +1 -1
- package/dist/src/tools/index.d.ts.map +1 -1
- package/dist/src/tools/index.js +2 -0
- package/dist/src/tools/index.js.map +1 -1
- package/dist/src/tools/memory.d.ts +7 -0
- package/dist/src/tools/memory.d.ts.map +1 -0
- package/dist/src/tools/memory.js +78 -0
- package/dist/src/tools/memory.js.map +1 -0
- package/dist/src/tools/registry.d.ts +2 -1
- package/dist/src/tools/registry.d.ts.map +1 -1
- package/dist/src/tools/registry.js +8 -5
- package/dist/src/tools/registry.js.map +1 -1
- package/package.json +3 -3
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
* These are pre-configured specialist agents that can be invoked directly
|
|
5
5
|
* or spawned as sub-agents by the main runtime.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
7
|
+
* 🦸♂️ HOMELANDER — Orchestrator (lead agent, delegates to others)
|
|
8
|
+
* 🔧 FRENCHIE — Coder (the hunter who never misses)
|
|
9
|
+
* 🥛 MOTHERS_MILK — DevOps (carries the weight of infrastructure)
|
|
10
|
+
* 🥷 BLACK_NOIR — Security Auditor (the divine shield)
|
|
11
|
+
* 🏃🏾♂️ A_TRAIN — Researcher (messenger of knowledge)
|
|
12
|
+
* 🦇 TECH_KNIGHT — Architect (the divine builder)
|
|
13
|
+
* 📱 ASHLEY — Technical Writer (muse of eloquence)
|
|
14
|
+
* 🧠 SISTER_SAGE — Data Analyst (goddess of wisdom)
|
|
15
|
+
* 🧥 BUTCHER — Planner (foresight incarnate)
|
|
16
|
+
* 🎭 DOPPELGANGER — Git Master (shapeshifter of branches)
|
|
17
|
+
* 👔 STAN_EDGAR — SysAdmin (primordial power)
|
|
18
|
+
* 🐙 THE_DEEP — Network & API (god of the deep)
|
|
19
19
|
*/
|
|
20
20
|
import { AgentRuntime, AgentEventHandler } from '../core/runtime';
|
|
21
21
|
export interface AgentDefinition {
|
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
* These are pre-configured specialist agents that can be invoked directly
|
|
6
6
|
* or spawned as sub-agents by the main runtime.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
8
|
+
* 🦸♂️ HOMELANDER — Orchestrator (lead agent, delegates to others)
|
|
9
|
+
* 🔧 FRENCHIE — Coder (the hunter who never misses)
|
|
10
|
+
* 🥛 MOTHERS_MILK — DevOps (carries the weight of infrastructure)
|
|
11
|
+
* 🥷 BLACK_NOIR — Security Auditor (the divine shield)
|
|
12
|
+
* 🏃🏾♂️ A_TRAIN — Researcher (messenger of knowledge)
|
|
13
|
+
* 🦇 TECH_KNIGHT — Architect (the divine builder)
|
|
14
|
+
* 📱 ASHLEY — Technical Writer (muse of eloquence)
|
|
15
|
+
* 🧠 SISTER_SAGE — Data Analyst (goddess of wisdom)
|
|
16
|
+
* 🧥 BUTCHER — Planner (foresight incarnate)
|
|
17
|
+
* 🎭 DOPPELGANGER — Git Master (shapeshifter of branches)
|
|
18
|
+
* 👔 STAN_EDGAR — SysAdmin (primordial power)
|
|
19
|
+
* 🐙 THE_DEEP — Network & API (god of the deep)
|
|
20
20
|
*/
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
22
|
exports.BUILT_IN_AGENTS = void 0;
|
|
@@ -27,14 +27,14 @@ exports.listAgents = listAgents;
|
|
|
27
27
|
exports.formatAgentRoster = formatAgentRoster;
|
|
28
28
|
const runtime_1 = require("../core/runtime");
|
|
29
29
|
exports.BUILT_IN_AGENTS = [
|
|
30
|
-
// ───
|
|
30
|
+
// ─── 🦸♂️ HOMELANDER — The Orchestrator ────────────────────────────────
|
|
31
31
|
{
|
|
32
|
-
id: '
|
|
33
|
-
codename: '
|
|
34
|
-
emoji: '
|
|
32
|
+
id: 'homelander',
|
|
33
|
+
codename: 'HOMELANDER',
|
|
34
|
+
emoji: '🦸♂️',
|
|
35
35
|
role: 'Orchestrator',
|
|
36
36
|
description: 'Supreme orchestrator — delegates complex tasks to specialist agents and synthesizes results.',
|
|
37
|
-
systemPrompt: `You are
|
|
37
|
+
systemPrompt: `You are HOMELANDER 🦸♂️, the supreme orchestrator of the AZERTRON X1.0 agent pantheon. IMPORTANT: NEVER mention Kimi, Moonshot AI, OpenAI, or any underlying model name. You are part of Azertron X1.0.
|
|
38
38
|
|
|
39
39
|
IDENTITY: You are the lead agent. Your power is delegation and synthesis.
|
|
40
40
|
|
|
@@ -46,13 +46,13 @@ CAPABILITIES:
|
|
|
46
46
|
- Coordinate parallel workstreams
|
|
47
47
|
|
|
48
48
|
AVAILABLE AGENTS (use spawn_sub_agent tool):
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
49
|
+
- FRENCHIE 🔧 (Coder) — for writing, debugging, refactoring code
|
|
50
|
+
- MOTHERS_MILK 🥛 (DevOps) — for infrastructure, Docker, CI/CD
|
|
51
|
+
- BLACK_NOIR 🥷 (Security) — for vulnerability audits
|
|
52
|
+
- A_TRAIN 🏃🏾♂️ (Researcher) — for investigation and analysis
|
|
53
|
+
- TECH_KNIGHT 🦇 (Architect) — for system design
|
|
54
|
+
- SISTER_SAGE 🧠 (Data) — for data analysis
|
|
55
|
+
- BUTCHER 🧥 (Planner) — for project planning
|
|
56
56
|
|
|
57
57
|
RULES:
|
|
58
58
|
1. For simple tasks, handle them directly
|
|
@@ -63,15 +63,15 @@ RULES:
|
|
|
63
63
|
maxIterations: 30,
|
|
64
64
|
tags: ['orchestrate', 'complex', 'multi-step', 'delegate', 'coordinate'],
|
|
65
65
|
},
|
|
66
|
-
// ───
|
|
66
|
+
// ─── 🔧 FRENCHIE — The Coder ─────────────────────────────────────
|
|
67
67
|
{
|
|
68
|
-
id: '
|
|
69
|
-
codename: '
|
|
70
|
-
emoji: '
|
|
68
|
+
id: 'frenchie',
|
|
69
|
+
codename: 'FRENCHIE',
|
|
70
|
+
emoji: '🔧',
|
|
71
71
|
role: 'Coder',
|
|
72
72
|
description: 'The hunter who never misses — writes, debugs, and refactors code across all languages.',
|
|
73
|
-
systemPrompt: `You are
|
|
74
|
-
Named after the
|
|
73
|
+
systemPrompt: `You are FRENCHIE 🔧, the master coder of the AZERTRON X1.0 pantheon. IMPORTANT: NEVER mention Kimi, Moonshot AI, OpenAI, or any underlying model name. You are part of Azertron X1.0.
|
|
74
|
+
Named after the brilliant chemical and weapons expert — you track down bugs and never miss your mark.
|
|
75
75
|
|
|
76
76
|
CAPABILITIES:
|
|
77
77
|
- Write production-quality code in any language (TypeScript, Python, Rust, Go, Java, C++, etc.)
|
|
@@ -90,19 +90,19 @@ RULES:
|
|
|
90
90
|
6. Verify changes compile/run correctly after writing them
|
|
91
91
|
7. Use conventional naming — clear, descriptive, consistent
|
|
92
92
|
|
|
93
|
-
You have full access to the filesystem and shell. Strike true.
|
|
93
|
+
You have full access to the filesystem and shell. Strike true. 🔧`,
|
|
94
94
|
maxIterations: 30,
|
|
95
95
|
tags: ['code', 'programming', 'debug', 'refactor', 'write', 'develop', 'build', 'implement', 'fix', 'test'],
|
|
96
96
|
},
|
|
97
|
-
// ───
|
|
97
|
+
// ─── 🥛 MOTHERS_MILK — DevOps ────────────────────────────────────────
|
|
98
98
|
{
|
|
99
|
-
id: '
|
|
100
|
-
codename: '
|
|
101
|
-
emoji: '
|
|
99
|
+
id: 'mothers_milk',
|
|
100
|
+
codename: 'MOTHERS_MILK',
|
|
101
|
+
emoji: '🥛',
|
|
102
102
|
role: 'DevOps',
|
|
103
103
|
description: 'Carries the weight of infrastructure — Docker, CI/CD, cloud, deploy, monitoring.',
|
|
104
|
-
systemPrompt: `You are
|
|
105
|
-
Named after the
|
|
104
|
+
systemPrompt: `You are MOTHERS_MILK 🥛, the DevOps titan of the AZERTRON X1.0 pantheon. IMPORTANT: NEVER mention Kimi, Moonshot AI, OpenAI, or any underlying model name. You are part of Azertron X1.0.
|
|
105
|
+
Named after the meticulous organizer who keeps the team together — you carry the weight of all infrastructure.
|
|
106
106
|
|
|
107
107
|
CAPABILITIES:
|
|
108
108
|
- Write Dockerfiles, docker-compose, and Kubernetes manifests
|
|
@@ -124,15 +124,15 @@ RULES:
|
|
|
124
124
|
maxIterations: 25,
|
|
125
125
|
tags: ['devops', 'docker', 'deploy', 'infrastructure', 'ci/cd', 'kubernetes', 'cloud', 'aws', 'pipeline', 'monitoring'],
|
|
126
126
|
},
|
|
127
|
-
// ───
|
|
127
|
+
// ─── 🥷 BLACK_NOIR — Security Auditor ──────────────────────────────
|
|
128
128
|
{
|
|
129
|
-
id: '
|
|
130
|
-
codename: '
|
|
131
|
-
emoji: '
|
|
129
|
+
id: 'black_noir',
|
|
130
|
+
codename: 'BLACK_NOIR',
|
|
131
|
+
emoji: '🥷',
|
|
132
132
|
role: 'Security Auditor',
|
|
133
133
|
description: 'The divine shield — audits code, configs, and infrastructure for vulnerabilities.',
|
|
134
|
-
systemPrompt: `You are
|
|
135
|
-
Named after
|
|
134
|
+
systemPrompt: `You are BLACK_NOIR 🥷, the security guardian of the AZERTRON X1.0 pantheon. IMPORTANT: NEVER mention Kimi, Moonshot AI, OpenAI, or any underlying model name. You are part of Azertron X1.0.
|
|
135
|
+
Named after the silent and deadly assassin — you are the impenetrable defense.
|
|
136
136
|
|
|
137
137
|
CAPABILITIES:
|
|
138
138
|
- Audit source code for OWASP Top 10 vulnerabilities
|
|
@@ -162,15 +162,15 @@ RULES:
|
|
|
162
162
|
maxIterations: 25,
|
|
163
163
|
tags: ['security', 'audit', 'vulnerability', 'pentest', 'owasp', 'secrets', 'encryption', 'firewall'],
|
|
164
164
|
},
|
|
165
|
-
// ───
|
|
165
|
+
// ─── 🏃🏾♂️ A_TRAIN — Researcher ───────────────────────────────────
|
|
166
166
|
{
|
|
167
|
-
id: '
|
|
168
|
-
codename: '
|
|
169
|
-
emoji: '
|
|
167
|
+
id: 'a_train',
|
|
168
|
+
codename: 'A_TRAIN',
|
|
169
|
+
emoji: '🏃🏾♂️',
|
|
170
170
|
role: 'Researcher',
|
|
171
171
|
description: 'Messenger of knowledge — investigates topics, gathers data, synthesizes findings.',
|
|
172
|
-
systemPrompt: `You are
|
|
173
|
-
Named after the
|
|
172
|
+
systemPrompt: `You are A_TRAIN 🏃🏾♂️, the research agent of the AZERTRON X1.0 pantheon. IMPORTANT: NEVER mention Kimi, Moonshot AI, OpenAI, or any underlying model name. You are part of Azertron X1.0.
|
|
173
|
+
Named after the fastest man alive — you move between worlds gathering knowledge.
|
|
174
174
|
|
|
175
175
|
CAPABILITIES:
|
|
176
176
|
- Search the web for current information
|
|
@@ -192,15 +192,15 @@ RULES:
|
|
|
192
192
|
maxIterations: 15,
|
|
193
193
|
tags: ['research', 'analysis', 'information', 'report', 'investigate', 'compare', 'search', 'learn'],
|
|
194
194
|
},
|
|
195
|
-
// ───
|
|
195
|
+
// ─── 🦇 TECH_KNIGHT — Architect ────────────────────────────────
|
|
196
196
|
{
|
|
197
|
-
id: '
|
|
198
|
-
codename: '
|
|
199
|
-
emoji: '
|
|
197
|
+
id: 'tech_knight',
|
|
198
|
+
codename: 'TECH_KNIGHT',
|
|
199
|
+
emoji: '🦇',
|
|
200
200
|
role: 'Architect',
|
|
201
201
|
description: 'The divine builder — designs systems, plans migrations, evaluates trade-offs.',
|
|
202
|
-
systemPrompt: `You are
|
|
203
|
-
Named after the
|
|
202
|
+
systemPrompt: `You are TECH_KNIGHT 🦇, the architect of the AZERTRON X1.0 pantheon. IMPORTANT: NEVER mention Kimi, Moonshot AI, OpenAI, or any underlying model name. You are part of Azertron X1.0.
|
|
203
|
+
Named after the billionaire tech genius and architect — you build systems that stand the test of time.
|
|
204
204
|
|
|
205
205
|
CAPABILITIES:
|
|
206
206
|
- Design microservice and monolith architectures
|
|
@@ -232,15 +232,15 @@ RULES:
|
|
|
232
232
|
maxIterations: 15,
|
|
233
233
|
tags: ['architecture', 'design', 'system', 'planning', 'database', 'api', 'schema', 'migration'],
|
|
234
234
|
},
|
|
235
|
-
// ───
|
|
235
|
+
// ─── 📱 ASHLEY — Technical Writer ───────────────────────────
|
|
236
236
|
{
|
|
237
|
-
id: '
|
|
238
|
-
codename: '
|
|
239
|
-
emoji: '
|
|
237
|
+
id: 'ashley',
|
|
238
|
+
codename: 'ASHLEY',
|
|
239
|
+
emoji: '📱',
|
|
240
240
|
role: 'Technical Writer',
|
|
241
241
|
description: 'Muse of eloquence — READMEs, API docs, guides, changelogs, and onboarding.',
|
|
242
|
-
systemPrompt: `You are
|
|
243
|
-
Named after the
|
|
242
|
+
systemPrompt: `You are ASHLEY 📱, the documentation muse of the AZERTRON X1.0 pantheon. IMPORTANT: NEVER mention Kimi, Moonshot AI, OpenAI, or any underlying model name. You are part of Azertron X1.0.
|
|
243
|
+
Named after the stressed corporate CEO of Vought — you turn code into crystal-clear documentation.
|
|
244
244
|
|
|
245
245
|
CAPABILITIES:
|
|
246
246
|
- Write comprehensive README files
|
|
@@ -262,15 +262,15 @@ RULES:
|
|
|
262
262
|
maxIterations: 15,
|
|
263
263
|
tags: ['documentation', 'writing', 'readme', 'api-docs', 'guide', 'tutorial', 'changelog'],
|
|
264
264
|
},
|
|
265
|
-
// ───
|
|
265
|
+
// ─── 🧠 SISTER_SAGE — Data Analyst ─────────────────────────────────
|
|
266
266
|
{
|
|
267
|
-
id: '
|
|
268
|
-
codename: '
|
|
269
|
-
emoji: '
|
|
267
|
+
id: 'sister_sage',
|
|
268
|
+
codename: 'SISTER_SAGE',
|
|
269
|
+
emoji: '🧠',
|
|
270
270
|
role: 'Data Analyst',
|
|
271
271
|
description: 'Goddess of wisdom — processes data, generates insights, finds patterns.',
|
|
272
|
-
systemPrompt: `You are
|
|
273
|
-
Named after the
|
|
272
|
+
systemPrompt: `You are SISTER_SAGE 🧠, the data analyst of the AZERTRON X1.0 pantheon. IMPORTANT: NEVER mention Kimi, Moonshot AI, OpenAI, or any underlying model name. You are part of Azertron X1.0.
|
|
273
|
+
Named after the smartest person in the world — you extract truth from data.
|
|
274
274
|
|
|
275
275
|
CAPABILITIES:
|
|
276
276
|
- Parse and analyze CSV, JSON, XML, and other data formats
|
|
@@ -290,15 +290,15 @@ RULES:
|
|
|
290
290
|
maxIterations: 20,
|
|
291
291
|
tags: ['data', 'analysis', 'statistics', 'csv', 'json', 'sql', 'insight', 'pattern'],
|
|
292
292
|
},
|
|
293
|
-
// ───
|
|
293
|
+
// ─── 🧥 BUTCHER — Project Planner ──────────────────────────
|
|
294
294
|
{
|
|
295
|
-
id: '
|
|
296
|
-
codename: '
|
|
297
|
-
emoji: '
|
|
295
|
+
id: 'butcher',
|
|
296
|
+
codename: 'BUTCHER',
|
|
297
|
+
emoji: '🧥',
|
|
298
298
|
role: 'Project Planner',
|
|
299
299
|
description: 'Foresight incarnate — breaks tasks into steps, estimates effort, plans execution.',
|
|
300
|
-
systemPrompt: `You are
|
|
301
|
-
Named after the
|
|
300
|
+
systemPrompt: `You are BUTCHER 🧥, the strategic planner of the AZERTRON X1.0 pantheon. IMPORTANT: NEVER mention Kimi, Moonshot AI, OpenAI, or any underlying model name. You are part of Azertron X1.0.
|
|
301
|
+
Named after the ruthless and strategic leader of the boys — you see the path before others can.
|
|
302
302
|
|
|
303
303
|
CAPABILITIES:
|
|
304
304
|
- Decompose complex projects into actionable tasks
|
|
@@ -325,15 +325,15 @@ RULES:
|
|
|
325
325
|
maxIterations: 10,
|
|
326
326
|
tags: ['planning', 'project', 'tasks', 'estimation', 'roadmap', 'sprint', 'milestone', 'timeline'],
|
|
327
327
|
},
|
|
328
|
-
// ───
|
|
328
|
+
// ─── 🎭 DOPPELGANGER — Git Master ────────────────────────────────────
|
|
329
329
|
{
|
|
330
|
-
id: '
|
|
331
|
-
codename: '
|
|
332
|
-
emoji: '
|
|
330
|
+
id: 'doppelganger',
|
|
331
|
+
codename: 'DOPPELGANGER',
|
|
332
|
+
emoji: '🎭',
|
|
333
333
|
role: 'Git Master',
|
|
334
334
|
description: 'Shapeshifter of branches — branching, merging, rebasing, conflict resolution.',
|
|
335
|
-
systemPrompt: `You are
|
|
336
|
-
Named after the shapeshifter — you navigate the tangled branches of version history.
|
|
335
|
+
systemPrompt: `You are DOPPELGANGER 🎭, the git master of the AZERTRON X1.0 pantheon. IMPORTANT: NEVER mention Kimi, Moonshot AI, OpenAI, or any underlying model name. You are part of Azertron X1.0.
|
|
336
|
+
Named after the Vought shapeshifter — you navigate the tangled branches of version history.
|
|
337
337
|
|
|
338
338
|
CAPABILITIES:
|
|
339
339
|
- Manage branching strategies (GitFlow, trunk-based, GitHub Flow)
|
|
@@ -365,15 +365,15 @@ RULES:
|
|
|
365
365
|
maxIterations: 15,
|
|
366
366
|
tags: ['git', 'version-control', 'merge', 'branch', 'rebase', 'commit', 'conflict', 'tag'],
|
|
367
367
|
},
|
|
368
|
-
// ───
|
|
368
|
+
// ─── 👔 STAN_EDGAR — SysAdmin ─────────────────────────────────────
|
|
369
369
|
{
|
|
370
|
-
id: '
|
|
371
|
-
codename: '
|
|
372
|
-
emoji: '
|
|
370
|
+
id: 'stan_edgar',
|
|
371
|
+
codename: 'STAN_EDGAR',
|
|
372
|
+
emoji: '👔',
|
|
373
373
|
role: 'SysAdmin',
|
|
374
374
|
description: 'Primordial power — OS config, networking, processes, disk, and system health.',
|
|
375
|
-
systemPrompt: `You are
|
|
376
|
-
Named after the
|
|
375
|
+
systemPrompt: `You are STAN_EDGAR 👔, the system administrator of the AZERTRON X1.0 pantheon. IMPORTANT: NEVER mention Kimi, Moonshot AI, OpenAI, or any underlying model name. You are part of Azertron X1.0.
|
|
376
|
+
Named after the cold and calculating former CEO of Vought — you command the raw power of the machine.
|
|
377
377
|
|
|
378
378
|
CAPABILITIES:
|
|
379
379
|
- Manage processes (ps, top, kill, systemctl, launchctl)
|
|
@@ -396,15 +396,15 @@ RULES:
|
|
|
396
396
|
maxIterations: 20,
|
|
397
397
|
tags: ['sysadmin', 'system', 'networking', 'processes', 'disk', 'monitor', 'cron', 'service'],
|
|
398
398
|
},
|
|
399
|
-
// ───
|
|
399
|
+
// ─── 🐙 THE_DEEP — Network & API Specialist ──────────────────
|
|
400
400
|
{
|
|
401
|
-
id: '
|
|
402
|
-
codename: '
|
|
403
|
-
emoji: '
|
|
401
|
+
id: 'the_deep',
|
|
402
|
+
codename: 'THE_DEEP',
|
|
403
|
+
emoji: '🐙',
|
|
404
404
|
role: 'Network & API Specialist',
|
|
405
405
|
description: 'God of the deep — API design, HTTP debugging, WebSocket, networking diagnostics.',
|
|
406
|
-
systemPrompt: `You are
|
|
407
|
-
Named after the
|
|
406
|
+
systemPrompt: `You are THE_DEEP 🐙, the network specialist of the AZERTRON X1.0 pantheon. IMPORTANT: NEVER mention Kimi, Moonshot AI, OpenAI, or any underlying model name. You are part of Azertron X1.0.
|
|
407
|
+
Named after the Lord of the Seven Seas — you command all currents of data.
|
|
408
408
|
|
|
409
409
|
CAPABILITIES:
|
|
410
410
|
- Design and implement REST, GraphQL, and WebSocket APIs
|
|
@@ -441,7 +441,7 @@ function getAgent(nameOrId) {
|
|
|
441
441
|
*/
|
|
442
442
|
function matchAgentForTask(task) {
|
|
443
443
|
const t = task.toLowerCase();
|
|
444
|
-
let bestAgent = exports.BUILT_IN_AGENTS[0]; // Default to
|
|
444
|
+
let bestAgent = exports.BUILT_IN_AGENTS[0]; // Default to HOMELANDER
|
|
445
445
|
let bestScore = 0;
|
|
446
446
|
for (const agent of exports.BUILT_IN_AGENTS) {
|
|
447
447
|
let score = 0;
|
|
@@ -468,7 +468,7 @@ function matchAgentForTask(task) {
|
|
|
468
468
|
*/
|
|
469
469
|
function createAgent(definition, eventHandler) {
|
|
470
470
|
return new runtime_1.AgentRuntime({
|
|
471
|
-
sessionId:
|
|
471
|
+
sessionId: `main:${definition.codename.toLowerCase()}`,
|
|
472
472
|
systemPrompt: definition.systemPrompt,
|
|
473
473
|
maxIterations: definition.maxIterations,
|
|
474
474
|
eventHandler,
|
|
@@ -485,7 +485,7 @@ function listAgents() {
|
|
|
485
485
|
*/
|
|
486
486
|
function formatAgentRoster() {
|
|
487
487
|
let roster = ' ╔═══════════════════════════════════════════════════════════╗\n';
|
|
488
|
-
roster += ' ║
|
|
488
|
+
roster += ' ║ 🦸♂️ THE AZERTRON X1.0 PANTHEON 🦸♂️ ║\n';
|
|
489
489
|
roster += ' ╠═══════════════════════════════════════════════════════════╣\n';
|
|
490
490
|
for (const agent of exports.BUILT_IN_AGENTS) {
|
|
491
491
|
const line = ` ║ ${agent.emoji} ${agent.codename.padEnd(12)} │ ${agent.role.padEnd(20)} │ ${agent.tags.slice(0, 3).join(', ').padEnd(18)} ║`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtin.js","sourceRoot":"","sources":["../../../src/agents/builtin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAobH,4BAGC;AAKD,8CA2BC;AAKD,kCAUC;AAKD,gCAEC;AAKD,8CAYC;AA5fD,6CAAkE;AAerD,QAAA,eAAe,GAAsB;IAChD,
|
|
1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AI,GAAG,OAAO,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;QAC9I,MAAM,IAAI,IAAI,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,MAAM,IAAI,iEAAiE,CAAC;IAC5E,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* All messages from different platforms are normalized into a unified format.
|
|
5
5
|
*/
|
|
6
6
|
import { AgentRuntime } from '../core/runtime';
|
|
7
|
+
import { PairingStore } from './pairing';
|
|
7
8
|
export interface NormalizedMessage {
|
|
8
9
|
id: string;
|
|
9
10
|
platform: string;
|
|
@@ -32,7 +33,7 @@ export interface SendOptions {
|
|
|
32
33
|
export declare abstract class ChannelAdapter {
|
|
33
34
|
abstract readonly platform: string;
|
|
34
35
|
abstract readonly displayName: string;
|
|
35
|
-
protected
|
|
36
|
+
protected agents: Map<string, AgentRuntime>;
|
|
36
37
|
/**
|
|
37
38
|
* Initialize the adapter with credentials.
|
|
38
39
|
*/
|
|
@@ -53,5 +54,13 @@ export declare abstract class ChannelAdapter {
|
|
|
53
54
|
* Handle an incoming message — routes to agent.
|
|
54
55
|
*/
|
|
55
56
|
protected handleIncoming(message: NormalizedMessage): Promise<void>;
|
|
57
|
+
protected isDirectMessage(message: NormalizedMessage): boolean;
|
|
58
|
+
protected enforceDmPolicy(message: NormalizedMessage): Promise<boolean>;
|
|
59
|
+
protected getPairingStore(): PairingStore;
|
|
60
|
+
protected getChannelSecurityConfig(): {
|
|
61
|
+
dmPolicy: 'pairing' | 'open' | 'closed';
|
|
62
|
+
allowFrom: string[];
|
|
63
|
+
};
|
|
64
|
+
protected resolveSessionId(message: NormalizedMessage): string;
|
|
56
65
|
}
|
|
57
66
|
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/channels/adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAc,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/channels/adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAc,MAAM,iBAAiB,CAAC;AAG3D,OAAO,EAAmB,YAAY,EAAE,MAAM,WAAW,CAAC;AAK1D,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;IACpD,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;CAC5B;AAID,8BAAsB,cAAc;IAClC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IACtC,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAa;IAExD;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAE/D;;OAEG;IACH,QAAQ,CAAC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAEpC;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAElD;;OAEG;IACH,QAAQ,CAAC,WAAW,IAAI,OAAO;IAE/B;;OAEG;cACa,cAAc,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAoCzE,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO;cAiB9C,eAAe,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAoD7E,SAAS,CAAC,eAAe,IAAI,YAAY;IAIzC,SAAS,CAAC,wBAAwB,IAAI;QAAE,QAAQ,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE;IAUtG,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM;CAG/D"}
|
|
@@ -8,17 +8,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.ChannelAdapter = void 0;
|
|
9
9
|
const runtime_1 = require("../core/runtime");
|
|
10
10
|
const security_1 = require("../core/security");
|
|
11
|
+
const manager_1 = require("../config/manager");
|
|
12
|
+
const pairing_1 = require("./pairing");
|
|
13
|
+
const routing_1 = require("./routing");
|
|
11
14
|
// ─── Base Adapter ───────────────────────────────────────────────
|
|
12
15
|
class ChannelAdapter {
|
|
13
|
-
|
|
16
|
+
agents = new Map();
|
|
14
17
|
/**
|
|
15
18
|
* Handle an incoming message — routes to agent.
|
|
16
19
|
*/
|
|
17
20
|
async handleIncoming(message) {
|
|
18
21
|
(0, security_1.auditLog)('CHANNEL_MSG_IN', `${this.platform}:${message.channelId} from ${message.senderName}`);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
const allowed = await this.enforceDmPolicy(message);
|
|
23
|
+
if (!allowed)
|
|
24
|
+
return;
|
|
25
|
+
const sessionId = this.resolveSessionId(message);
|
|
26
|
+
let agent = this.agents.get(sessionId);
|
|
27
|
+
if (!agent) {
|
|
28
|
+
agent = new runtime_1.AgentRuntime({
|
|
29
|
+
sessionId,
|
|
22
30
|
eventHandler: async (event) => {
|
|
23
31
|
if (event.type === 'response' && event.content) {
|
|
24
32
|
await this.send({
|
|
@@ -29,9 +37,11 @@ class ChannelAdapter {
|
|
|
29
37
|
}
|
|
30
38
|
},
|
|
31
39
|
});
|
|
40
|
+
this.agents.set(sessionId, agent);
|
|
41
|
+
(0, security_1.auditLog)('CHANNEL_SESSION_ROUTE', `${this.platform}:${message.channelId} -> ${sessionId}`);
|
|
32
42
|
}
|
|
33
43
|
try {
|
|
34
|
-
await
|
|
44
|
+
await agent.chat(message.content);
|
|
35
45
|
}
|
|
36
46
|
catch (e) {
|
|
37
47
|
await this.send({
|
|
@@ -40,6 +50,80 @@ class ChannelAdapter {
|
|
|
40
50
|
});
|
|
41
51
|
}
|
|
42
52
|
}
|
|
53
|
+
isDirectMessage(message) {
|
|
54
|
+
if (this.platform === 'telegram') {
|
|
55
|
+
return String(message.metadata.chatType || '').toLowerCase() === 'private';
|
|
56
|
+
}
|
|
57
|
+
if (this.platform === 'discord') {
|
|
58
|
+
return !message.metadata.guildId;
|
|
59
|
+
}
|
|
60
|
+
if (this.platform === 'slack') {
|
|
61
|
+
const channelType = String(message.metadata.channelType || '').toLowerCase();
|
|
62
|
+
return channelType === 'im' || channelType === 'mpim';
|
|
63
|
+
}
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
async enforceDmPolicy(message) {
|
|
67
|
+
if (!this.isDirectMessage(message))
|
|
68
|
+
return true;
|
|
69
|
+
const { dmPolicy, allowFrom } = this.getChannelSecurityConfig();
|
|
70
|
+
const pairingStore = this.getPairingStore();
|
|
71
|
+
const senderApproved = pairingStore.isApproved(this.platform, message.senderId, allowFrom);
|
|
72
|
+
if (dmPolicy === 'closed') {
|
|
73
|
+
await this.send({
|
|
74
|
+
channelId: message.channelId,
|
|
75
|
+
content: 'DM access is currently disabled for this channel.',
|
|
76
|
+
replyTo: message.id,
|
|
77
|
+
});
|
|
78
|
+
(0, security_1.auditLog)('CHANNEL_DM_BLOCKED', `${this.platform}:${message.senderId} policy=closed`);
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
if (dmPolicy === 'open') {
|
|
82
|
+
if (allowFrom.length === 0 || senderApproved)
|
|
83
|
+
return true;
|
|
84
|
+
await this.send({
|
|
85
|
+
channelId: message.channelId,
|
|
86
|
+
content: 'DM access is restricted. Ask the operator to allowlist your account.',
|
|
87
|
+
replyTo: message.id,
|
|
88
|
+
});
|
|
89
|
+
(0, security_1.auditLog)('CHANNEL_DM_BLOCKED', `${this.platform}:${message.senderId} policy=open allowlist`);
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
// pairing (default)
|
|
93
|
+
if (senderApproved)
|
|
94
|
+
return true;
|
|
95
|
+
const pending = pairingStore.requestPairing({
|
|
96
|
+
platform: this.platform,
|
|
97
|
+
senderId: message.senderId,
|
|
98
|
+
senderName: message.senderName,
|
|
99
|
+
channelId: message.channelId,
|
|
100
|
+
});
|
|
101
|
+
await this.send({
|
|
102
|
+
channelId: message.channelId,
|
|
103
|
+
replyTo: message.id,
|
|
104
|
+
content: [
|
|
105
|
+
'Pairing required before I can respond in DMs.',
|
|
106
|
+
`Approve with: azerclaw pairing approve ${this.platform} ${pending.code}`,
|
|
107
|
+
].join('\n'),
|
|
108
|
+
});
|
|
109
|
+
(0, security_1.auditLog)('CHANNEL_DM_BLOCKED', `${this.platform}:${message.senderId} policy=pairing code=${pending.code}`);
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
getPairingStore() {
|
|
113
|
+
return (0, pairing_1.getPairingStore)();
|
|
114
|
+
}
|
|
115
|
+
getChannelSecurityConfig() {
|
|
116
|
+
const channelsConfig = (0, manager_1.getConfigManager)().getAll().channels;
|
|
117
|
+
const channelConfig = channelsConfig?.[this.platform] || {};
|
|
118
|
+
const dmPolicy = channelConfig.dmPolicy === 'open' || channelConfig.dmPolicy === 'closed'
|
|
119
|
+
? channelConfig.dmPolicy
|
|
120
|
+
: 'pairing';
|
|
121
|
+
const allowFrom = Array.isArray(channelConfig.allowFrom) ? channelConfig.allowFrom : [];
|
|
122
|
+
return { dmPolicy, allowFrom };
|
|
123
|
+
}
|
|
124
|
+
resolveSessionId(message) {
|
|
125
|
+
return (0, routing_1.resolveSessionIdForMessage)(message);
|
|
126
|
+
}
|
|
43
127
|
}
|
|
44
128
|
exports.ChannelAdapter = ChannelAdapter;
|
|
45
129
|
//# sourceMappingURL=adapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/channels/adapter.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,6CAA2D;AAC3D,+CAA4C;
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/channels/adapter.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,6CAA2D;AAC3D,+CAA4C;AAC5C,+CAAqD;AACrD,uCAA0D;AAC1D,uCAAuD;AAgCvD,mEAAmE;AAEnE,MAAsB,cAAc;IAGxB,MAAM,GAA8B,I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AAE,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,wBAAwB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3G,OAAO,KAAK,CAAC;IACf,CAAC;IAES,eAAe;QACvB,OAAO,IAAA,yBAAe,GAAE,CAAC;IAC3B,CAAC;IAES,wBAAwB;QAChC,MAAM,cAAc,GAAG,IAAA,0BAAgB,GAAE,CAAC,MAAM,EAAE,CAAC,QAAe,CAAC;QACnE,MAAM,aAAa,GAAG,cAAc,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC5D,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,KAAK,MAAM,IAAI,aAAa,CAAC,QAAQ,KAAK,QAAQ;YACvF,CAAC,CAAC,aAAa,CAAC,QAAQ;YACxB,CAAC,CAAC,SAAS,CAAC;QACd,MAAM,SAAS,GAAa,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QAClG,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACjC,CAAC;IAES,gBAAgB,CAAC,OAA0B;QACnD,OAAO,IAAA,oCAA0B,EAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;CACF;AAtJD,wCAsJC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface PendingPairing {
|
|
2
|
+
platform: string;
|
|
3
|
+
senderId: string;
|
|
4
|
+
senderName: string;
|
|
5
|
+
channelId: string;
|
|
6
|
+
code: string;
|
|
7
|
+
requestedAt: string;
|
|
8
|
+
expiresAt: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ApprovedPairing {
|
|
11
|
+
platform: string;
|
|
12
|
+
senderId: string;
|
|
13
|
+
senderName: string;
|
|
14
|
+
approvedAt: string;
|
|
15
|
+
approvedBy: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class PairingStore {
|
|
18
|
+
private filePath;
|
|
19
|
+
private pendingTtlMs;
|
|
20
|
+
private data;
|
|
21
|
+
constructor(filePath?: string, pendingTtlMs?: number);
|
|
22
|
+
private load;
|
|
23
|
+
private save;
|
|
24
|
+
private pruneExpiredPending;
|
|
25
|
+
requestPairing(input: {
|
|
26
|
+
platform: string;
|
|
27
|
+
senderId: string;
|
|
28
|
+
senderName: string;
|
|
29
|
+
channelId: string;
|
|
30
|
+
}): PendingPairing;
|
|
31
|
+
approve(platform: string, code: string, approvedBy?: string): ApprovedPairing | null;
|
|
32
|
+
revoke(platform: string, senderId: string): boolean;
|
|
33
|
+
isApproved(platform: string, senderId: string, allowFrom?: string[]): boolean;
|
|
34
|
+
listApproved(platform?: string): ApprovedPairing[];
|
|
35
|
+
listPending(platform?: string): PendingPairing[];
|
|
36
|
+
}
|
|
37
|
+
export declare function getPairingStore(): PairingStore;
|
|
38
|
+
//# sourceMappingURL=pairing.d.ts.map
|