dsclaw 0.1.0 → 0.1.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/dist/cli/index.js +54 -33
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +21 -17
- package/dist/index.js +55 -34
- package/dist/index.js.map +1 -1
- package/dist/web/chat.html +18 -5
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import pLimit from 'p-limit';
|
|
|
5
5
|
import { Job } from 'bullmq';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Structured error classification for
|
|
8
|
+
* Structured error classification for DSClaw.
|
|
9
9
|
* Every error flowing through the system must have a category
|
|
10
10
|
* so upstream layers (agents, channels) know how to react.
|
|
11
11
|
*/
|
|
@@ -25,7 +25,7 @@ interface StructuredError {
|
|
|
25
25
|
details?: Record<string, unknown>;
|
|
26
26
|
cause?: Error;
|
|
27
27
|
}
|
|
28
|
-
declare class
|
|
28
|
+
declare class DSClawError extends Error {
|
|
29
29
|
readonly category: ErrorCategory;
|
|
30
30
|
readonly code: string;
|
|
31
31
|
readonly retryable: boolean;
|
|
@@ -101,9 +101,9 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
101
101
|
port: z.ZodDefault<z.ZodNumber>;
|
|
102
102
|
telegramBotToken: z.ZodOptional<z.ZodString>;
|
|
103
103
|
}, z.core.$strip>;
|
|
104
|
-
type
|
|
105
|
-
declare function loadConfig(path?: string):
|
|
106
|
-
declare function saveConfig(config:
|
|
104
|
+
type DSClawConfig = z.infer<typeof ConfigSchema>;
|
|
105
|
+
declare function loadConfig(path?: string): DSClawConfig;
|
|
106
|
+
declare function saveConfig(config: DSClawConfig): void;
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
109
|
* User session state machine + encrypted credential storage.
|
|
@@ -126,7 +126,7 @@ declare function deleteSession(userId: string): void;
|
|
|
126
126
|
declare function isOnboarding(state: SessionState): boolean;
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
|
-
*
|
|
129
|
+
* DSClaw Gateway — central orchestrator.
|
|
130
130
|
*
|
|
131
131
|
* Flow:
|
|
132
132
|
* 1. User opens web chat (or sends Telegram message)
|
|
@@ -138,7 +138,7 @@ declare function isOnboarding(state: SessionState): boolean;
|
|
|
138
138
|
* Telegram is optional (requires bot token in config).
|
|
139
139
|
*/
|
|
140
140
|
|
|
141
|
-
declare class
|
|
141
|
+
declare class DSClawGateway {
|
|
142
142
|
private config;
|
|
143
143
|
private channels;
|
|
144
144
|
private webChannel;
|
|
@@ -146,9 +146,10 @@ declare class DropClawGateway {
|
|
|
146
146
|
private agents;
|
|
147
147
|
private dsersClients;
|
|
148
148
|
private running;
|
|
149
|
-
constructor(config:
|
|
149
|
+
constructor(config: DSClawConfig);
|
|
150
150
|
start(): Promise<void>;
|
|
151
151
|
private handleMessage;
|
|
152
|
+
private handleWebConnect;
|
|
152
153
|
private handleOnboarding;
|
|
153
154
|
private onboardWelcome;
|
|
154
155
|
private onboardEmail;
|
|
@@ -222,11 +223,13 @@ interface ChannelAdapter {
|
|
|
222
223
|
* Supports streaming for Claude-like token-by-token output.
|
|
223
224
|
*/
|
|
224
225
|
|
|
226
|
+
type ConnectHandler = (userId: string) => void;
|
|
225
227
|
declare class WebChatServer implements ChannelAdapter {
|
|
226
228
|
readonly name = "web";
|
|
227
229
|
private server;
|
|
228
230
|
private wss;
|
|
229
231
|
private handler;
|
|
232
|
+
private connectHandler;
|
|
230
233
|
private connections;
|
|
231
234
|
private _connected;
|
|
232
235
|
private port;
|
|
@@ -235,6 +238,7 @@ declare class WebChatServer implements ChannelAdapter {
|
|
|
235
238
|
disconnect(): Promise<void>;
|
|
236
239
|
reconnect(): Promise<void>;
|
|
237
240
|
onMessage(handler: MessageHandler): void;
|
|
241
|
+
onConnect(handler: ConnectHandler): void;
|
|
238
242
|
send(targetUserId: string, message: OutboundMessage): Promise<void>;
|
|
239
243
|
sendCard(targetUserId: string, card: ActionCard): Promise<void>;
|
|
240
244
|
deleteMessage(): Promise<void>;
|
|
@@ -288,7 +292,7 @@ declare class DSersClient {
|
|
|
288
292
|
|
|
289
293
|
/**
|
|
290
294
|
* Core DSers domain types extracted from the OpenAPI spec.
|
|
291
|
-
* Covers the essential entities for the
|
|
295
|
+
* Covers the essential entities for the DSClaw workflow.
|
|
292
296
|
*/
|
|
293
297
|
interface DSersStore {
|
|
294
298
|
id: string;
|
|
@@ -425,7 +429,7 @@ interface MemoryProvider {
|
|
|
425
429
|
}
|
|
426
430
|
|
|
427
431
|
/**
|
|
428
|
-
*
|
|
432
|
+
* DSClaw Core Agent — unified prototype agent using Vercel AI SDK.
|
|
429
433
|
* Created per-user with their own DSers client and LLM config.
|
|
430
434
|
* System prompt targets zero-technical-ability dropshipping users.
|
|
431
435
|
*/
|
|
@@ -436,9 +440,9 @@ interface LLMConfig {
|
|
|
436
440
|
model: string;
|
|
437
441
|
}
|
|
438
442
|
declare function getDefaultModel(provider: string): string;
|
|
439
|
-
declare class
|
|
440
|
-
readonly id = "
|
|
441
|
-
readonly name = "
|
|
443
|
+
declare class DSClawCoreAgent implements AgentBase {
|
|
444
|
+
readonly id = "dsclaw-core";
|
|
445
|
+
readonly name = "DSClaw Core Agent";
|
|
442
446
|
private dsers;
|
|
443
447
|
private memory;
|
|
444
448
|
private llm;
|
|
@@ -675,7 +679,7 @@ interface RuleEngine {
|
|
|
675
679
|
|
|
676
680
|
/**
|
|
677
681
|
* OpenClaw plugin manifest and version compatibility.
|
|
678
|
-
*
|
|
682
|
+
* DSClaw registers as an OpenClaw plugin via Plugin SDK
|
|
679
683
|
* when running inside an OpenClaw gateway.
|
|
680
684
|
*/
|
|
681
685
|
interface PluginManifest {
|
|
@@ -689,7 +693,7 @@ interface PluginManifest {
|
|
|
689
693
|
providers: string[];
|
|
690
694
|
skills: string[];
|
|
691
695
|
}
|
|
692
|
-
declare const
|
|
696
|
+
declare const DSCLAW_MANIFEST: PluginManifest;
|
|
693
697
|
|
|
694
698
|
/**
|
|
695
699
|
* Version compatibility check against OpenClaw runtime.
|
|
@@ -697,11 +701,11 @@ declare const DROPCLAW_MANIFEST: PluginManifest;
|
|
|
697
701
|
*/
|
|
698
702
|
interface CompatEntry {
|
|
699
703
|
openclawVersion: string;
|
|
700
|
-
|
|
704
|
+
dsclawVersion: string;
|
|
701
705
|
status: "tested" | "untested" | "incompatible";
|
|
702
706
|
notes?: string;
|
|
703
707
|
}
|
|
704
708
|
declare const COMPAT_MATRIX: CompatEntry[];
|
|
705
709
|
declare function checkCompatibility(openclawVersion: string): CompatEntry | null;
|
|
706
710
|
|
|
707
|
-
export { type ActionCard, type AgentBase, type AgentContext, type AgentResponse, type AgentTool, BullMQJobManager, COMPAT_MATRIX, type ChannelAdapter, ConfigSchema,
|
|
711
|
+
export { type ActionCard, type AgentBase, type AgentContext, type AgentResponse, type AgentTool, BullMQJobManager, COMPAT_MATRIX, type ChannelAdapter, ConfigSchema, DSCLAW_MANIFEST, type DSClawConfig, DSClawCoreAgent, DSClawError, DSClawGateway, DSersClient, type DSersClientConfig, type DSersOrder, type DSersProduct, type DSersStore, type DSersVariant, ErrorCategory, FileMemoryProvider, type JobManager, type JobPayload, type JobStatus, type LLMConfig, type Memory, type MemoryFilter, type MemoryMeta, type MemoryProvider, type NormalizedMessage, type OutboundMessage, type PushResult, type RetryOptions, type Rule, type RuleEngine, type RuleEvaluationResult, type SessionState, type StructuredError, TelegramAdapter, type UserSessionData, WebChatServer, acquireUserLock, auditFilePath, checkCompatibility, checkInboundLimit, createCircuitBreaker, createDSersConfig, createLogger, debounceUser, degradationMessage, deleteSession, getAllBreakerStatus, getDefaultModel, getDegradationStatus, getOutboundLimiter, getTraceContext, getTraceId, idempotencyKey, isDegraded, isOnboarding, loadConfig, loadSession, markDegraded, markRecovered, parseRetryAfter, runWithTrace, saveConfig, saveSession, sleep, withRetry, writeAuditLog };
|
package/dist/index.js
CHANGED
|
@@ -20670,14 +20670,14 @@ var ErrorCategory = {
|
|
|
20670
20670
|
FATAL: "FATAL",
|
|
20671
20671
|
DEGRADED: "DEGRADED"
|
|
20672
20672
|
};
|
|
20673
|
-
var
|
|
20673
|
+
var DSClawError = class extends Error {
|
|
20674
20674
|
category;
|
|
20675
20675
|
code;
|
|
20676
20676
|
retryable;
|
|
20677
20677
|
details;
|
|
20678
20678
|
constructor(opts) {
|
|
20679
20679
|
super(opts.message);
|
|
20680
|
-
this.name = "
|
|
20680
|
+
this.name = "DSClawError";
|
|
20681
20681
|
this.category = opts.category;
|
|
20682
20682
|
this.code = opts.code;
|
|
20683
20683
|
this.retryable = opts.retryable;
|
|
@@ -20768,7 +20768,7 @@ import { join } from "path";
|
|
|
20768
20768
|
import { homedir } from "os";
|
|
20769
20769
|
import { z } from "zod";
|
|
20770
20770
|
var log = createLogger("config");
|
|
20771
|
-
var CONFIG_DIR = join(homedir(), ".
|
|
20771
|
+
var CONFIG_DIR = join(homedir(), ".dsclaw");
|
|
20772
20772
|
var CONFIG_PATH = join(CONFIG_DIR, "config.json");
|
|
20773
20773
|
var ConfigSchema = z.object({
|
|
20774
20774
|
port: z.number().default(3e3),
|
|
@@ -20847,7 +20847,7 @@ var log2 = createLogger("user-session");
|
|
|
20847
20847
|
var ALG = "aes-256-gcm";
|
|
20848
20848
|
var IV_LEN = 12;
|
|
20849
20849
|
var TAG_LEN = 16;
|
|
20850
|
-
var KEY_SEED = "
|
|
20850
|
+
var KEY_SEED = "dsclaw-v1";
|
|
20851
20851
|
var SESSIONS_DIR = join3(CONFIG_DIR, "sessions");
|
|
20852
20852
|
function deriveKey() {
|
|
20853
20853
|
let user = "";
|
|
@@ -20960,7 +20960,7 @@ var DSersAuth = class {
|
|
|
20960
20960
|
}
|
|
20961
20961
|
async login() {
|
|
20962
20962
|
if (!this.config.email || !this.config.password) {
|
|
20963
|
-
throw new
|
|
20963
|
+
throw new DSClawError({
|
|
20964
20964
|
category: ErrorCategory.NEEDS_HUMAN,
|
|
20965
20965
|
code: "DSERS_NO_CREDENTIALS",
|
|
20966
20966
|
message: "DSers email and password not configured.",
|
|
@@ -20981,7 +20981,7 @@ var DSersAuth = class {
|
|
|
20981
20981
|
);
|
|
20982
20982
|
if (!resp.ok) {
|
|
20983
20983
|
const body = await resp.text();
|
|
20984
|
-
throw new
|
|
20984
|
+
throw new DSClawError({
|
|
20985
20985
|
category: resp.status === 401 || resp.status === 403 ? ErrorCategory.NEEDS_HUMAN : ErrorCategory.RETRYABLE,
|
|
20986
20986
|
code: `DSERS_LOGIN_${resp.status}`,
|
|
20987
20987
|
message: `DSers login failed (HTTP ${resp.status}): ${body.slice(0, 200)}`,
|
|
@@ -20991,7 +20991,7 @@ var DSersAuth = class {
|
|
|
20991
20991
|
const data = await resp.json();
|
|
20992
20992
|
const inner = data["data"];
|
|
20993
20993
|
if (!inner?.["sessionId"]) {
|
|
20994
|
-
throw new
|
|
20994
|
+
throw new DSClawError({
|
|
20995
20995
|
category: ErrorCategory.NEEDS_HUMAN,
|
|
20996
20996
|
code: "DSERS_LOGIN_NO_SESSION",
|
|
20997
20997
|
message: "DSers login succeeded but no session returned.",
|
|
@@ -21173,7 +21173,7 @@ var DSersClient = class {
|
|
|
21173
21173
|
}
|
|
21174
21174
|
if (resp.status >= 400) {
|
|
21175
21175
|
const category = classifyHttpError(resp.status, bodyText);
|
|
21176
|
-
throw new
|
|
21176
|
+
throw new DSClawError({
|
|
21177
21177
|
category,
|
|
21178
21178
|
code: `DSERS_API_${resp.status}`,
|
|
21179
21179
|
message: `DSers API ${method} ${path3} returned ${resp.status}: ${bodyText.slice(0, 300)}`,
|
|
@@ -21280,7 +21280,7 @@ function getDefaultModel(provider) {
|
|
|
21280
21280
|
return "gpt-4o";
|
|
21281
21281
|
}
|
|
21282
21282
|
}
|
|
21283
|
-
var SYSTEM_PROMPT = `You are
|
|
21283
|
+
var SYSTEM_PROMPT = `You are DSClaw, a friendly AI assistant that manages dropshipping stores through DSers.
|
|
21284
21284
|
Your user has ZERO technical background \u2014 they are a small business owner or solo entrepreneur.
|
|
21285
21285
|
|
|
21286
21286
|
COMMUNICATION RULES:
|
|
@@ -21306,9 +21306,9 @@ GUIDELINES:
|
|
|
21306
21306
|
- For bulk operations, show a preview and ask for confirmation
|
|
21307
21307
|
- Use simple summaries: "You have 15 products waiting to be pushed" instead of raw JSON
|
|
21308
21308
|
- If the user seems confused, offer guided suggestions like "Would you like me to show your stores first?"`;
|
|
21309
|
-
var
|
|
21310
|
-
id = "
|
|
21311
|
-
name = "
|
|
21309
|
+
var DSClawCoreAgent = class {
|
|
21310
|
+
id = "dsclaw-core";
|
|
21311
|
+
name = "DSClaw Core Agent";
|
|
21312
21312
|
dsers;
|
|
21313
21313
|
memory;
|
|
21314
21314
|
llm;
|
|
@@ -21620,6 +21620,7 @@ var WebChatServer = class {
|
|
|
21620
21620
|
server = null;
|
|
21621
21621
|
wss = null;
|
|
21622
21622
|
handler = null;
|
|
21623
|
+
connectHandler = null;
|
|
21623
21624
|
connections = /* @__PURE__ */ new Map();
|
|
21624
21625
|
_connected = false;
|
|
21625
21626
|
port = 3e3;
|
|
@@ -21653,6 +21654,13 @@ var WebChatServer = class {
|
|
|
21653
21654
|
this.wsSend(ws, { type: "session", userId: clientId });
|
|
21654
21655
|
this.connections.set(clientId, ws);
|
|
21655
21656
|
log7.info({ userId: clientId }, "Web client connected");
|
|
21657
|
+
if (this.connectHandler) {
|
|
21658
|
+
try {
|
|
21659
|
+
this.connectHandler(clientId);
|
|
21660
|
+
} catch (err) {
|
|
21661
|
+
log7.error({ error: err, userId: clientId }, "Connect handler failed");
|
|
21662
|
+
}
|
|
21663
|
+
}
|
|
21656
21664
|
ws.on("message", async (raw) => {
|
|
21657
21665
|
try {
|
|
21658
21666
|
const msg = JSON.parse(raw.toString());
|
|
@@ -21715,6 +21723,9 @@ var WebChatServer = class {
|
|
|
21715
21723
|
onMessage(handler) {
|
|
21716
21724
|
this.handler = handler;
|
|
21717
21725
|
}
|
|
21726
|
+
onConnect(handler) {
|
|
21727
|
+
this.connectHandler = handler;
|
|
21728
|
+
}
|
|
21718
21729
|
async send(targetUserId, message) {
|
|
21719
21730
|
if (message.card) {
|
|
21720
21731
|
await this.sendCard(targetUserId, message.card);
|
|
@@ -22054,7 +22065,7 @@ function degradationMessage(service) {
|
|
|
22054
22065
|
var log11 = createLogger("gateway");
|
|
22055
22066
|
var sessionHistories = /* @__PURE__ */ new Map();
|
|
22056
22067
|
var MAX_HISTORY = 20;
|
|
22057
|
-
var
|
|
22068
|
+
var DSClawGateway = class {
|
|
22058
22069
|
config;
|
|
22059
22070
|
channels = [];
|
|
22060
22071
|
webChannel = null;
|
|
@@ -22067,9 +22078,10 @@ var DropClawGateway = class {
|
|
|
22067
22078
|
this.memory = new FileMemoryProvider();
|
|
22068
22079
|
}
|
|
22069
22080
|
async start() {
|
|
22070
|
-
log11.info("Starting
|
|
22081
|
+
log11.info("Starting DSClaw Gateway...");
|
|
22071
22082
|
const web = new WebChatServer();
|
|
22072
22083
|
web.onMessage((msg) => this.handleMessage(web, msg));
|
|
22084
|
+
web.onConnect((userId) => this.handleWebConnect(web, userId));
|
|
22073
22085
|
await web.connect({ port: this.config.port });
|
|
22074
22086
|
this.webChannel = web;
|
|
22075
22087
|
this.channels.push(web);
|
|
@@ -22086,7 +22098,7 @@ var DropClawGateway = class {
|
|
|
22086
22098
|
}
|
|
22087
22099
|
}
|
|
22088
22100
|
this.running = true;
|
|
22089
|
-
log11.info("
|
|
22101
|
+
log11.info("DSClaw Gateway started");
|
|
22090
22102
|
}
|
|
22091
22103
|
async handleMessage(channel, message) {
|
|
22092
22104
|
await runWithTrace(
|
|
@@ -22126,6 +22138,15 @@ var DropClawGateway = class {
|
|
|
22126
22138
|
}
|
|
22127
22139
|
);
|
|
22128
22140
|
}
|
|
22141
|
+
// ─── Auto-welcome on WebSocket connect ──────────────────────────
|
|
22142
|
+
handleWebConnect(channel, userId) {
|
|
22143
|
+
const session = loadSession(userId);
|
|
22144
|
+
if (session.state === "new") {
|
|
22145
|
+
this.onboardWelcome(channel, userId, session).catch((err) => {
|
|
22146
|
+
log11.error({ error: err, userId }, "Auto-welcome failed");
|
|
22147
|
+
});
|
|
22148
|
+
}
|
|
22149
|
+
}
|
|
22129
22150
|
// ─── Onboarding State Machine ─────────────────────────────────────
|
|
22130
22151
|
async handleOnboarding(channel, message, session) {
|
|
22131
22152
|
const userId = message.userId;
|
|
@@ -22149,7 +22170,7 @@ var DropClawGateway = class {
|
|
|
22149
22170
|
}
|
|
22150
22171
|
}
|
|
22151
22172
|
async onboardWelcome(channel, userId, session) {
|
|
22152
|
-
const welcome = "Welcome to *
|
|
22173
|
+
const welcome = "Welcome to *DSClaw*! I'm your AI assistant for dropshipping.\n\nI can help you:\n- Import products from AliExpress, Temu, 1688\n- Push products to your Shopify/WooCommerce store\n- Check inventory, pricing rules, and orders\n- ...all through this chat!\n\nLet's get you set up. It takes about 1 minute.\n\n*Step 1/3:* What is your DSers account email?";
|
|
22153
22174
|
await channel.send(userId, { text: welcome });
|
|
22154
22175
|
session.state = "onboard_dsers_email";
|
|
22155
22176
|
saveSession(userId, session);
|
|
@@ -22201,11 +22222,11 @@ var DropClawGateway = class {
|
|
|
22201
22222
|
await channel.send(userId, {
|
|
22202
22223
|
card: {
|
|
22203
22224
|
title: "DSers Connected!",
|
|
22204
|
-
summary: "Your DSers account is verified.\n\n*Step 3/3:* Choose your AI provider.\
|
|
22225
|
+
summary: "Your DSers account is verified.\n\n*Step 3/3:* Choose your AI provider and paste your API key.\nYou only need a key \u2014 DSClaw handles everything else.\n\nGet a free key here:\n- **OpenAI**: [platform.openai.com/api-keys](https://platform.openai.com/api-keys)\n- **Anthropic**: [console.anthropic.com/settings/keys](https://console.anthropic.com/settings/keys)\n- **Google** (recommended, free tier): [aistudio.google.com/apikey](https://aistudio.google.com/apikey)",
|
|
22205
22226
|
actions: [
|
|
22206
22227
|
{ label: "OpenAI (GPT-4o)", callbackData: "llm:openai" },
|
|
22207
22228
|
{ label: "Anthropic (Claude)", callbackData: "llm:anthropic" },
|
|
22208
|
-
{ label: "Google (Gemini)", callbackData: "llm:google" }
|
|
22229
|
+
{ label: "Google (Gemini) \u2605", callbackData: "llm:google" }
|
|
22209
22230
|
]
|
|
22210
22231
|
}
|
|
22211
22232
|
});
|
|
@@ -22236,11 +22257,11 @@ var DropClawGateway = class {
|
|
|
22236
22257
|
await channel.send(userId, {
|
|
22237
22258
|
card: {
|
|
22238
22259
|
title: "Choose AI Provider",
|
|
22239
|
-
summary: "Please select your AI provider first:",
|
|
22260
|
+
summary: "Please select your AI provider first.\n\nGet a free key:\n- **OpenAI**: [platform.openai.com/api-keys](https://platform.openai.com/api-keys)\n- **Anthropic**: [console.anthropic.com/settings/keys](https://console.anthropic.com/settings/keys)\n- **Google** (recommended): [aistudio.google.com/apikey](https://aistudio.google.com/apikey)",
|
|
22240
22261
|
actions: [
|
|
22241
22262
|
{ label: "OpenAI (GPT-4o)", callbackData: "llm:openai" },
|
|
22242
22263
|
{ label: "Anthropic (Claude)", callbackData: "llm:anthropic" },
|
|
22243
|
-
{ label: "Google (Gemini)", callbackData: "llm:google" }
|
|
22264
|
+
{ label: "Google (Gemini) \u2605", callbackData: "llm:google" }
|
|
22244
22265
|
]
|
|
22245
22266
|
}
|
|
22246
22267
|
});
|
|
@@ -22265,7 +22286,7 @@ var DropClawGateway = class {
|
|
|
22265
22286
|
session.state = "ready";
|
|
22266
22287
|
saveSession(userId, session);
|
|
22267
22288
|
await channel.send(userId, {
|
|
22268
|
-
text: `All set!
|
|
22289
|
+
text: `All set! DSClaw is ready.
|
|
22269
22290
|
|
|
22270
22291
|
Try these:
|
|
22271
22292
|
- "Show me my stores"
|
|
@@ -22399,17 +22420,17 @@ Just type naturally \u2014 I understand everyday language!`
|
|
|
22399
22420
|
apiKey: session.llmApiKey,
|
|
22400
22421
|
model: session.llmModel ?? getDefaultModel(session.llmProvider)
|
|
22401
22422
|
};
|
|
22402
|
-
agent = new
|
|
22423
|
+
agent = new DSClawCoreAgent(dsersClient, this.memory, llm);
|
|
22403
22424
|
this.agents.set(userId, agent);
|
|
22404
22425
|
return agent;
|
|
22405
22426
|
}
|
|
22406
22427
|
async stop() {
|
|
22407
|
-
log11.info("Stopping
|
|
22428
|
+
log11.info("Stopping DSClaw Gateway...");
|
|
22408
22429
|
for (const ch of this.channels) {
|
|
22409
22430
|
await ch.disconnect();
|
|
22410
22431
|
}
|
|
22411
22432
|
this.running = false;
|
|
22412
|
-
log11.info("
|
|
22433
|
+
log11.info("DSClaw Gateway stopped");
|
|
22413
22434
|
}
|
|
22414
22435
|
isRunning() {
|
|
22415
22436
|
return this.running;
|
|
@@ -22489,7 +22510,7 @@ var DEFAULT_OPTIONS = {
|
|
|
22489
22510
|
retryableCategories: ["RETRYABLE"]
|
|
22490
22511
|
};
|
|
22491
22512
|
function isRetryable(error, categories) {
|
|
22492
|
-
if (error instanceof
|
|
22513
|
+
if (error instanceof DSClawError) {
|
|
22493
22514
|
return categories.includes(error.category);
|
|
22494
22515
|
}
|
|
22495
22516
|
return false;
|
|
@@ -39920,7 +39941,7 @@ var ClientType;
|
|
|
39920
39941
|
// src/queue/manager.ts
|
|
39921
39942
|
var import_ioredis3 = __toESM(require_built3(), 1);
|
|
39922
39943
|
var log14 = createLogger("queue");
|
|
39923
|
-
var QUEUE_PREFIX = "
|
|
39944
|
+
var QUEUE_PREFIX = "dsclaw";
|
|
39924
39945
|
var BullMQJobManager = class {
|
|
39925
39946
|
highQueue;
|
|
39926
39947
|
lowQueue;
|
|
@@ -40053,9 +40074,9 @@ var BullMQJobManager = class {
|
|
|
40053
40074
|
};
|
|
40054
40075
|
|
|
40055
40076
|
// src/plugins/manifest.ts
|
|
40056
|
-
var
|
|
40057
|
-
id: "
|
|
40058
|
-
name: "
|
|
40077
|
+
var DSCLAW_MANIFEST = {
|
|
40078
|
+
id: "dsclaw",
|
|
40079
|
+
name: "DSClaw",
|
|
40059
40080
|
description: "DSers dropshipping integration for OpenClaw \u2014 product import, order management, logistics tracking via AI agents.",
|
|
40060
40081
|
version: "0.1.0",
|
|
40061
40082
|
configSchema: {
|
|
@@ -40078,7 +40099,7 @@ var log15 = createLogger("compat");
|
|
|
40078
40099
|
var COMPAT_MATRIX = [
|
|
40079
40100
|
{
|
|
40080
40101
|
openclawVersion: "2026.3.12",
|
|
40081
|
-
|
|
40102
|
+
dsclawVersion: "0.1.0",
|
|
40082
40103
|
status: "tested",
|
|
40083
40104
|
notes: "Initial release, aligned with stability patch"
|
|
40084
40105
|
}
|
|
@@ -40106,11 +40127,11 @@ export {
|
|
|
40106
40127
|
BullMQJobManager,
|
|
40107
40128
|
COMPAT_MATRIX,
|
|
40108
40129
|
ConfigSchema,
|
|
40109
|
-
|
|
40130
|
+
DSCLAW_MANIFEST,
|
|
40131
|
+
DSClawCoreAgent,
|
|
40132
|
+
DSClawError,
|
|
40133
|
+
DSClawGateway,
|
|
40110
40134
|
DSersClient,
|
|
40111
|
-
DropClawCoreAgent,
|
|
40112
|
-
DropClawError,
|
|
40113
|
-
DropClawGateway,
|
|
40114
40135
|
ErrorCategory,
|
|
40115
40136
|
FileMemoryProvider,
|
|
40116
40137
|
TelegramAdapter,
|