@dainprotocol/service-sdk 2.0.76 → 2.0.78
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/service/index.d.ts +4 -0
- package/dist/service/index.js +14 -1
- package/dist/service/index.js.map +1 -1
- package/package.json +14 -15
package/dist/service/index.d.ts
CHANGED
|
@@ -13,6 +13,10 @@ import { forwardTriggerToAutomationCore, type TriggerForwardingConfig, type Trig
|
|
|
13
13
|
import { HITLHandler, routeActionToService, type HITLConfig, type HITLResult } from "./hitl";
|
|
14
14
|
import { ActionableToolBaseSchema, ActionSchema, MetadataSchema, extendActionableSchema, buildActionableTool, validateActionableSchema, type ActionableToolInput, type Action, type AutomationMetadata } from "./actionable-tools";
|
|
15
15
|
import { DirectAuthSetupManager, type DirectAuthAdapter, type OnboardingUI, type PendingSetup, type SetupCompletionResult } from "./direct-auth-setup";
|
|
16
|
+
/**
|
|
17
|
+
* Auto-detect runtime and use appropriate service implementation.
|
|
18
|
+
* Supports Node.js, Deno, and Cloudflare Workers.
|
|
19
|
+
*/
|
|
16
20
|
export declare const defineDAINService: (config: DAINServiceConfig) => DAINService;
|
|
17
21
|
export { defineNodeService, defineDenoService, defineCloudflareService, createNextDainService, createTool, createService, createToolbox, CoreUtils, createOAuth2Tool, createAgent, ProcessHandler, RedisProcessStore, MemoryProcessStore, requireScope, hasScope, hasAllScopes, hasAnyScope, WebhookTriggerRegistry, createWebhookTriggerRegistry, createSimpleTrigger, createTypedTrigger, type WebhookTrigger, type WebhookTriggerDefinition, type WebhookProcessResult, SkillRegistry, createSkillRegistry, createGetSkillTool, type Skill, forwardTriggerToAutomationCore, type TriggerForwardingConfig, type TriggerForwardResult, HITLHandler, routeActionToService, type HITLConfig, type HITLResult, ActionableToolBaseSchema, ActionSchema, MetadataSchema, extendActionableSchema, buildActionableTool, validateActionableSchema, type ActionableToolInput, type Action, type AutomationMetadata, DirectAuthSetupManager, type DirectAuthAdapter, type OnboardingUI, type PendingSetup, type SetupCompletionResult, };
|
|
18
22
|
export * from './types';
|
package/dist/service/index.js
CHANGED
|
@@ -51,8 +51,21 @@ Object.defineProperty(exports, "buildActionableTool", { enumerable: true, get: f
|
|
|
51
51
|
Object.defineProperty(exports, "validateActionableSchema", { enumerable: true, get: function () { return actionable_tools_1.validateActionableSchema; } });
|
|
52
52
|
const direct_auth_setup_1 = require("./direct-auth-setup");
|
|
53
53
|
Object.defineProperty(exports, "DirectAuthSetupManager", { enumerable: true, get: function () { return direct_auth_setup_1.DirectAuthSetupManager; } });
|
|
54
|
+
/**
|
|
55
|
+
* Auto-detect runtime and use appropriate service implementation.
|
|
56
|
+
* Supports Node.js, Deno, and Cloudflare Workers.
|
|
57
|
+
*/
|
|
54
58
|
const defineDAINService = (config) => {
|
|
55
|
-
|
|
59
|
+
// Detect Deno runtime
|
|
60
|
+
if (typeof globalThis.Deno !== 'undefined') {
|
|
61
|
+
return (0, denoService_1.defineDAINService)(config);
|
|
62
|
+
}
|
|
63
|
+
// Detect Node.js runtime (process.versions.node exists)
|
|
64
|
+
if (typeof process !== 'undefined' && process.versions?.node) {
|
|
65
|
+
return (0, nodeService_1.defineDAINService)(config);
|
|
66
|
+
}
|
|
67
|
+
// Default to Cloudflare Workers for other environments
|
|
68
|
+
return (0, cloudflareService_1.defineDAINService)(config);
|
|
56
69
|
};
|
|
57
70
|
exports.defineDAINService = defineDAINService;
|
|
58
71
|
// Re-export all types
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/service/index.ts"],"names":[],"mappings":";AAAA,6BAA6B;;;;AAG7B,+CAAuE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/service/index.ts"],"names":[],"mappings":";AAAA,6BAA6B;;;;AAG7B,+CAAuE;AAyErE,kGAzE4B,+BAAiB,OAyE5B;AAxEnB,+CAAuE;AAyErE,kGAzE4B,+BAAiB,OAyE5B;AAxEnB,2DAAmF;AAyE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E;IAC1E,sBAAsB;IACtB,IAAI,OAAQ,UAAkB,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QACpD,OAAO,IAAA,+BAAiB,EAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,wDAAwD;IACxD,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC7D,OAAO,IAAA,+BAAiB,EAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,uDAAuD;IACvD,OAAO,IAAA,qCAAuB,EAAC,MAAM,CAAC,CAAC;AACzC,CAAC,CAAC;AAbW,QAAA,iBAAiB,qBAa5B;AA4DF,sBAAsB;AACtB,kDAAwB;AAExB,wDAA8B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dainprotocol/service-sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.78",
|
|
4
4
|
"description": "DAIN Service SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -106,14 +106,6 @@
|
|
|
106
106
|
]
|
|
107
107
|
}
|
|
108
108
|
},
|
|
109
|
-
"scripts": {
|
|
110
|
-
"build": "tsc",
|
|
111
|
-
"build:types": "tsc --emitDeclarationOnly",
|
|
112
|
-
"test": "jest",
|
|
113
|
-
"test:watch": "jest --watch",
|
|
114
|
-
"prepublishOnly": "npm run build && npm run build:types",
|
|
115
|
-
"test:streaming": "ts-node src/standalone-streaming-test.ts"
|
|
116
|
-
},
|
|
117
109
|
"keywords": [
|
|
118
110
|
"dain",
|
|
119
111
|
"sdk",
|
|
@@ -129,7 +121,7 @@
|
|
|
129
121
|
"jest": "^29.7.0",
|
|
130
122
|
"ts-jest": "^29.1.5",
|
|
131
123
|
"tweetnacl": "^1.0.3",
|
|
132
|
-
"typescript": "^5.
|
|
124
|
+
"typescript": "^5.9.3"
|
|
133
125
|
},
|
|
134
126
|
"dependencies": {
|
|
135
127
|
"@dainprotocol/oauth2-storage-drizzle": "^0.1.16",
|
|
@@ -146,11 +138,11 @@
|
|
|
146
138
|
"@types/jsonwebtoken": "^9.0.10",
|
|
147
139
|
"@types/supertest": "^6.0.2",
|
|
148
140
|
"ai": "^5.0.87",
|
|
149
|
-
"axios": "^1.
|
|
141
|
+
"axios": "^1.13.2",
|
|
150
142
|
"body-parser": "^1.20.2",
|
|
151
143
|
"bs58": "^5.0.0",
|
|
152
144
|
"express": "^4.19.2",
|
|
153
|
-
"hono": "^4.
|
|
145
|
+
"hono": "^4.11.3",
|
|
154
146
|
"ioredis": "^5.4.1",
|
|
155
147
|
"iron-session": "^8.0.4",
|
|
156
148
|
"json-schema": "^0.4.0",
|
|
@@ -161,11 +153,18 @@
|
|
|
161
153
|
"telegram": "^2.26.16",
|
|
162
154
|
"tslib": "^2.6.3",
|
|
163
155
|
"ws": "^8.18.0",
|
|
164
|
-
"zod": "4.1
|
|
156
|
+
"zod": "4.2.1",
|
|
165
157
|
"zod-to-json-schema": "^3.24.6"
|
|
166
158
|
},
|
|
167
159
|
"files": [
|
|
168
160
|
"dist",
|
|
169
161
|
"README.md"
|
|
170
|
-
]
|
|
171
|
-
|
|
162
|
+
],
|
|
163
|
+
"scripts": {
|
|
164
|
+
"build": "tsc",
|
|
165
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
166
|
+
"test": "jest",
|
|
167
|
+
"test:watch": "jest --watch",
|
|
168
|
+
"test:streaming": "ts-node src/standalone-streaming-test.ts"
|
|
169
|
+
}
|
|
170
|
+
}
|