@minded-ai/mindedjs 1.0.53-patch6 → 1.0.54
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/agent.d.ts +12 -17
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +21 -78
- package/dist/agent.js.map +1 -1
- package/dist/edges/edgeFactory.d.ts +3 -1
- package/dist/edges/edgeFactory.d.ts.map +1 -1
- package/dist/edges/edgeFactory.js +2 -2
- package/dist/edges/edgeFactory.js.map +1 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internalTools/appActionRunnerTool.d.ts.map +1 -1
- package/dist/internalTools/appActionRunnerTool.js +1 -1
- package/dist/internalTools/appActionRunnerTool.js.map +1 -1
- package/dist/nodes/addAppToolNode.d.ts +3 -1
- package/dist/nodes/addAppToolNode.d.ts.map +1 -1
- package/dist/nodes/addAppToolNode.js +2 -2
- package/dist/nodes/addAppToolNode.js.map +1 -1
- package/dist/nodes/addPromptNode.d.ts +3 -1
- package/dist/nodes/addPromptNode.d.ts.map +1 -1
- package/dist/nodes/addPromptNode.js +2 -3
- package/dist/nodes/addPromptNode.js.map +1 -1
- package/dist/nodes/addToolRunNode.d.ts +3 -1
- package/dist/nodes/addToolRunNode.d.ts.map +1 -1
- package/dist/nodes/addToolRunNode.js +2 -2
- package/dist/nodes/addToolRunNode.js.map +1 -1
- package/dist/nodes/nodeFactory.d.ts +3 -1
- package/dist/nodes/nodeFactory.d.ts.map +1 -1
- package/dist/nodes/nodeFactory.js +3 -3
- package/dist/nodes/nodeFactory.js.map +1 -1
- package/dist/pii-gateway/gateway.d.ts +17 -0
- package/dist/pii-gateway/gateway.d.ts.map +1 -0
- package/dist/pii-gateway/gateway.js +77 -0
- package/dist/pii-gateway/gateway.js.map +1 -0
- package/dist/pii-gateway/index.d.ts +4 -0
- package/dist/pii-gateway/index.d.ts.map +1 -0
- package/dist/pii-gateway/index.js +14 -0
- package/dist/pii-gateway/index.js.map +1 -0
- package/dist/pii-gateway/proxy.d.ts +80 -0
- package/dist/pii-gateway/proxy.d.ts.map +1 -0
- package/dist/pii-gateway/proxy.js +106 -0
- package/dist/pii-gateway/proxy.js.map +1 -0
- package/dist/pii-gateway/types.d.ts +27 -0
- package/dist/pii-gateway/types.d.ts.map +1 -0
- package/dist/{types/Voice.types.js → pii-gateway/types.js} +1 -1
- package/dist/pii-gateway/types.js.map +1 -0
- package/dist/platform/config.d.ts +0 -3
- package/dist/platform/config.d.ts.map +1 -1
- package/dist/platform/config.js +1 -18
- package/dist/platform/config.js.map +1 -1
- package/dist/platform/mindedConnection.d.ts +4 -4
- package/dist/platform/mindedConnection.d.ts.map +1 -1
- package/dist/platform/mindedConnection.js +5 -8
- package/dist/platform/mindedConnection.js.map +1 -1
- package/dist/platform/mindedConnectionTypes.d.ts +17 -53
- package/dist/platform/mindedConnectionTypes.d.ts.map +1 -1
- package/dist/platform/mindedConnectionTypes.js +3 -11
- package/dist/platform/mindedConnectionTypes.js.map +1 -1
- package/dist/platform/piiGateway/gateway.d.ts +16 -0
- package/dist/platform/piiGateway/gateway.d.ts.map +1 -0
- package/dist/platform/piiGateway/gateway.js +76 -0
- package/dist/platform/piiGateway/gateway.js.map +1 -0
- package/dist/platform/piiGateway/index.d.ts +3 -0
- package/dist/platform/piiGateway/index.d.ts.map +1 -0
- package/dist/platform/piiGateway/index.js +7 -0
- package/dist/platform/piiGateway/index.js.map +1 -0
- package/dist/platform/piiGateway/proxy.d.ts +20 -0
- package/dist/platform/piiGateway/proxy.d.ts.map +1 -0
- package/dist/platform/piiGateway/proxy.js +24 -0
- package/dist/platform/piiGateway/proxy.js.map +1 -0
- package/dist/platform/piiGateway/types.d.ts +27 -0
- package/dist/platform/piiGateway/types.d.ts.map +1 -0
- package/dist/platform/piiGateway/types.js +3 -0
- package/dist/platform/piiGateway/types.js.map +1 -0
- package/dist/types/Agent.types.d.ts +0 -13
- package/dist/types/Agent.types.d.ts.map +1 -1
- package/dist/types/Agent.types.js.map +1 -1
- package/dist/types/Flows.types.d.ts +2 -15
- package/dist/types/Flows.types.d.ts.map +1 -1
- package/dist/types/Flows.types.js +0 -1
- package/dist/types/Flows.types.js.map +1 -1
- package/dist/types/LangGraph.types.d.ts +1 -0
- package/dist/types/LangGraph.types.d.ts.map +1 -1
- package/dist/types/LangGraph.types.js +1 -0
- package/dist/types/LangGraph.types.js.map +1 -1
- package/dist/types/Tools.types.d.ts +8 -6
- package/dist/types/Tools.types.d.ts.map +1 -1
- package/package.json +2 -5
- package/src/agent.ts +42 -97
- package/src/edges/edgeFactory.ts +4 -1
- package/src/index.ts +14 -7
- package/src/internalTools/appActionRunnerTool.ts +53 -50
- package/src/nodes/addAppToolNode.ts +4 -1
- package/src/nodes/addPromptNode.ts +5 -4
- package/src/nodes/addToolRunNode.ts +4 -2
- package/src/nodes/nodeFactory.ts +7 -4
- package/src/platform/config.ts +1 -21
- package/src/platform/mindedConnection.ts +9 -15
- package/src/platform/mindedConnectionTypes.ts +16 -61
- package/src/platform/piiGateway/gateway.ts +97 -0
- package/src/platform/piiGateway/index.ts +5 -0
- package/src/platform/piiGateway/types.ts +29 -0
- package/src/types/Agent.types.ts +0 -14
- package/src/types/Flows.types.ts +1 -15
- package/src/types/LangGraph.types.ts +1 -0
- package/src/types/Tools.types.ts +9 -3
- package/dist/types/Voice.types.d.ts +0 -5
- package/dist/types/Voice.types.d.ts.map +0 -1
- package/dist/types/Voice.types.js.map +0 -1
- package/dist/voice/elevenLabsUtils.d.ts +0 -70
- package/dist/voice/elevenLabsUtils.d.ts.map +0 -1
- package/dist/voice/elevenLabsUtils.js +0 -20
- package/dist/voice/elevenLabsUtils.js.map +0 -1
- package/dist/voice/voiceSession.d.ts +0 -47
- package/dist/voice/voiceSession.d.ts.map +0 -1
- package/dist/voice/voiceSession.js +0 -214
- package/dist/voice/voiceSession.js.map +0 -1
- package/src/types/Voice.types.ts +0 -4
- package/src/voice/elevenLabsUtils.ts +0 -101
- package/src/voice/voiceSession.ts +0 -257
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addToolRunNode.js","sourceRoot":"","sources":["../../src/nodes/addToolRunNode.ts"],"names":[],"mappings":";;;;;;AAKA,iDAA8D;AAG9D,mGAA2E;
|
|
1
|
+
{"version":3,"file":"addToolRunNode.js","sourceRoot":"","sources":["../../src/nodes/addToolRunNode.ts"],"names":[],"mappings":";;;;;;AAKA,iDAA8D;AAG9D,mGAA2E;AAYpE,MAAM,oBAAoB,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,GAAG,QAAQ,UAAU,CAAC;AAAnE,QAAA,oBAAoB,wBAA+C;AAEzE,MAAM,cAAc,GAAG,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,KAAK,EAAwB,EAAE,EAAE;IAClH,MAAM,QAAQ,GAAiB,KAAK,EAAE,KAAmC,EAAE,EAAE;QAC3E,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC1E,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,mBAAmB,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC1D,CAAC;QAED,MAAM,cAAc,GAAG,KAAK,EAAE,KAAwC,EAAE,EAAE;YACxE,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;gBACpE,OAAO,QAAQ,IAAI,EAAE,CAAC;YACxB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;gBAC7C,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC,CAAC;QACF,MAAM,IAAI,GAAG,IAAA,YAAa,EAAC,cAAc,EAAE;YACzC,IAAI,EAAE,WAAW,CAAC,IAAI;YACtB,WAAW,EAAE,WAAW,CAAC,WAAW;YACpC,MAAM,EAAE,WAAW,CAAC,KAAK;SAC1B,CAAC,CAAC;QAEH,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAQ,CAAC;QACrE,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;QACD,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACrE,MAAM,UAAU,GAAG,IAAA,mCAAyB,EAAC,eAA8B,CAAC,CAAC;QAC7E,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC;IAC7D,CAAC,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,IAAA,4BAAoB,EAAC,kBAAkB,CAAC,EAAE,QAAQ,CAAC,CAAC;IAClE,KAAK,CAAC,OAAO,CAAC,kBAAyB,EAAE,IAAA,4BAAoB,EAAC,kBAAkB,CAAQ,CAAC,CAAC;AAC5F,CAAC,CAAC;AAjCW,QAAA,cAAc,kBAiCzB"}
|
|
@@ -4,11 +4,13 @@ import { Tool } from '../types/Tools.types';
|
|
|
4
4
|
import { AgentEventRequestPayloads } from '../events/AgentEvents';
|
|
5
5
|
import { EmitSignature } from '../types/Agent.types';
|
|
6
6
|
import { LLMProviders } from '../types/LLM.types';
|
|
7
|
-
|
|
7
|
+
import { Agent } from '../agent';
|
|
8
|
+
export declare const nodeFactory: ({ graph, node, tools, llm, emit, agent, }: {
|
|
8
9
|
graph: PreCompiledGraph;
|
|
9
10
|
node: Node;
|
|
10
11
|
tools: Tool<any, any>[];
|
|
11
12
|
llm: (typeof LLMProviders)[keyof typeof LLMProviders];
|
|
12
13
|
emit: EmitSignature<any, keyof AgentEventRequestPayloads<any>>;
|
|
14
|
+
agent: Agent;
|
|
13
15
|
}) => void;
|
|
14
16
|
//# sourceMappingURL=nodeFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeFactory.d.ts","sourceRoot":"","sources":["../../src/nodes/nodeFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,IAAI,EAAY,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAG5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"nodeFactory.d.ts","sourceRoot":"","sources":["../../src/nodes/nodeFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,IAAI,EAAY,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAG5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAOjC,eAAO,MAAM,WAAW,GAAI,2CAOzB;IACD,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACxB,GAAG,EAAE,CAAC,OAAO,YAAY,EAAE,MAAM,OAAO,YAAY,CAAC,CAAC;IACtD,IAAI,EAAE,aAAa,CAAC,GAAG,EAAE,MAAM,yBAAyB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,KAAK,EAAE,KAAK,CAAC;CACd,SAqBA,CAAC"}
|
|
@@ -10,7 +10,7 @@ const addJunctionNode = ({ graph, node }) => {
|
|
|
10
10
|
const callback = async () => { };
|
|
11
11
|
graph.addNode(node.name, callback);
|
|
12
12
|
};
|
|
13
|
-
const nodeFactory = ({ graph, node, tools, llm, emit, }) => {
|
|
13
|
+
const nodeFactory = ({ graph, node, tools, llm, emit, agent, }) => {
|
|
14
14
|
const nodeType = node.type;
|
|
15
15
|
switch (nodeType) {
|
|
16
16
|
case Flows_types_1.NodeType.TRIGGER:
|
|
@@ -23,10 +23,10 @@ const nodeFactory = ({ graph, node, tools, llm, emit, }) => {
|
|
|
23
23
|
addJunctionNode({ graph, node });
|
|
24
24
|
break;
|
|
25
25
|
case Flows_types_1.NodeType.APP_TOOL:
|
|
26
|
-
(0, addAppToolNode_1.addAppToolNode)({ graph, node, llm });
|
|
26
|
+
(0, addAppToolNode_1.addAppToolNode)({ graph, node, llm, agent });
|
|
27
27
|
break;
|
|
28
28
|
case Flows_types_1.NodeType.PROMPT_NODE:
|
|
29
|
-
(0, addPromptNode_1.addPromptNode)({ graph, node, tools, llm, emit });
|
|
29
|
+
(0, addPromptNode_1.addPromptNode)({ graph, node, tools, llm, emit, agent });
|
|
30
30
|
break;
|
|
31
31
|
default:
|
|
32
32
|
throw new Error(`Unsupported node type: ${nodeType}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeFactory.js","sourceRoot":"","sources":["../../src/nodes/nodeFactory.ts"],"names":[],"mappings":";;;AACA,sDAAoE;AAGpE,+CAA4C;AAC5C,mDAAgD;AAGhD,qDAAkD;AAClD,qDAAkD;
|
|
1
|
+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ACR;YACE,MAAM,IAAI,KAAK,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC,CAAC;AAnCW,QAAA,WAAW,eAmCtB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MindedConnection } from '../platform/mindedConnection';
|
|
2
|
+
import { HttpRequestConfig, HttpResponse, PIIGatewayInstance } from './types';
|
|
3
|
+
export declare class PIIGateway implements PIIGatewayInstance {
|
|
4
|
+
private mindedConnection;
|
|
5
|
+
private sessionId;
|
|
6
|
+
constructor(mindedConnection: MindedConnection, sessionId: string);
|
|
7
|
+
private makeRequest;
|
|
8
|
+
get<T = any>(url: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
9
|
+
post<T = any>(url: string, data?: any, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
10
|
+
put<T = any>(url: string, data?: any, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
11
|
+
delete<T = any>(url: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
12
|
+
patch<T = any>(url: string, data?: any, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
13
|
+
head<T = any>(url: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
14
|
+
options<T = any>(url: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
15
|
+
request<T = any>(config: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=gateway.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../src/pii-gateway/gateway.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE9E,qBAAa,UAAW,YAAW,kBAAkB;IACnD,OAAO,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AG,GAAG,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAI5E"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PIIGateway = void 0;
|
|
4
|
+
const uuid_1 = require("uuid");
|
|
5
|
+
const mindedConnectionTypes_1 = require("../platform/mindedConnectionTypes");
|
|
6
|
+
class PIIGateway {
|
|
7
|
+
constructor(mindedConnection, sessionId) {
|
|
8
|
+
this.mindedConnection = mindedConnection;
|
|
9
|
+
this.sessionId = sessionId;
|
|
10
|
+
}
|
|
11
|
+
async makeRequest(method, url, data, config) {
|
|
12
|
+
var _a;
|
|
13
|
+
if (!((_a = this.mindedConnection) === null || _a === void 0 ? void 0 : _a.isConnected)) {
|
|
14
|
+
throw new Error('Minded connection is not established. PII-secured HTTP requests require a connection to the Minded platform.');
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
const requestId = (0, uuid_1.v4)();
|
|
18
|
+
const requestPayload = {
|
|
19
|
+
type: mindedConnectionTypes_1.MindedConnectionSocketMessageType.PII_HTTP_REQUEST,
|
|
20
|
+
requestId,
|
|
21
|
+
method,
|
|
22
|
+
url,
|
|
23
|
+
headers: config === null || config === void 0 ? void 0 : config.headers,
|
|
24
|
+
params: config === null || config === void 0 ? void 0 : config.params,
|
|
25
|
+
data,
|
|
26
|
+
sessionId: this.sessionId,
|
|
27
|
+
};
|
|
28
|
+
const response = await this.mindedConnection.awaitEmit(mindedConnectionTypes_1.MindedConnectionSocketMessageType.PII_HTTP_REQUEST, requestPayload, 30000);
|
|
29
|
+
if (response.error) {
|
|
30
|
+
throw new Error(`HTTP request failed: ${response.error}`);
|
|
31
|
+
}
|
|
32
|
+
// Verify that the response requestId matches our request
|
|
33
|
+
if (response.requestId && response.requestId !== requestId) {
|
|
34
|
+
console.warn(`Response requestId (${response.requestId}) does not match request requestId (${requestId})`);
|
|
35
|
+
}
|
|
36
|
+
// Return generic HttpResponse format
|
|
37
|
+
return {
|
|
38
|
+
data: response.data,
|
|
39
|
+
status: response.status || 200,
|
|
40
|
+
statusText: response.statusText || 'OK',
|
|
41
|
+
headers: response.headers || {},
|
|
42
|
+
config: config || {},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
throw new Error(`Secure HTTP request failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async get(url, config) {
|
|
50
|
+
return this.makeRequest('GET', url, undefined, config);
|
|
51
|
+
}
|
|
52
|
+
async post(url, data, config) {
|
|
53
|
+
return this.makeRequest('POST', url, data, config);
|
|
54
|
+
}
|
|
55
|
+
async put(url, data, config) {
|
|
56
|
+
return this.makeRequest('PUT', url, data, config);
|
|
57
|
+
}
|
|
58
|
+
async delete(url, config) {
|
|
59
|
+
return this.makeRequest('DELETE', url, undefined, config);
|
|
60
|
+
}
|
|
61
|
+
async patch(url, data, config) {
|
|
62
|
+
return this.makeRequest('PATCH', url, data, config);
|
|
63
|
+
}
|
|
64
|
+
async head(url, config) {
|
|
65
|
+
return this.makeRequest('HEAD', url, undefined, config);
|
|
66
|
+
}
|
|
67
|
+
async options(url, config) {
|
|
68
|
+
return this.makeRequest('OPTIONS', url, undefined, config);
|
|
69
|
+
}
|
|
70
|
+
async request(config) {
|
|
71
|
+
var _a;
|
|
72
|
+
const method = (((_a = config.method) === null || _a === void 0 ? void 0 : _a.toUpperCase()) || 'GET');
|
|
73
|
+
return this.makeRequest(method, config.url || '', config.data, config);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.PIIGateway = PIIGateway;
|
|
77
|
+
//# sourceMappingURL=gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../src/pii-gateway/gateway.ts"],"names":[],"mappings":";;;AAA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AC;IACzD,CAAC;IAED,KAAK,CAAC,IAAI,CAAU,GAAW,EAAE,MAA0B;QACzD,OAAO,IAAI,CAAC,WAAW,CAAI,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,OAAO,CAAU,GAAW,EAAE,MAA0B;QAC5D,OAAO,IAAI,CAAC,WAAW,CAAI,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAChE,CAAC;IAED,KAAK,CAAC,OAAO,CAAU,MAAyB;;QAC9C,MAAM,MAAM,GAAG,CAAC,CAAA,MAAA,MAAM,CAAC,MAAM,0CAAE,WAAW,EAAE,KAAI,KAAK,CAAQ,CAAC;QAC9D,OAAO,IAAI,CAAC,WAAW,CAAI,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,EAAE,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5E,CAAC;CACF;AA5FD,gCA4FC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { HttpRequestConfig, HttpResponse, PIIGatewayInstance } from './types';
|
|
2
|
+
export { PIIGateway } from './gateway';
|
|
3
|
+
export { piiGateway, getPIIGateway, createPIIGateway, _setGlobalPIIGateway, _clearGlobalPIIGateway } from './proxy';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pii-gateway/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGnF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGvC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports._clearGlobalPIIGateway = exports._setGlobalPIIGateway = exports.createPIIGateway = exports.getPIIGateway = exports.piiGateway = exports.PIIGateway = void 0;
|
|
4
|
+
// Export core gateway class
|
|
5
|
+
var gateway_1 = require("./gateway");
|
|
6
|
+
Object.defineProperty(exports, "PIIGateway", { enumerable: true, get: function () { return gateway_1.PIIGateway; } });
|
|
7
|
+
// Export proxy and management functions
|
|
8
|
+
var proxy_1 = require("./proxy");
|
|
9
|
+
Object.defineProperty(exports, "piiGateway", { enumerable: true, get: function () { return proxy_1.piiGateway; } });
|
|
10
|
+
Object.defineProperty(exports, "getPIIGateway", { enumerable: true, get: function () { return proxy_1.getPIIGateway; } });
|
|
11
|
+
Object.defineProperty(exports, "createPIIGateway", { enumerable: true, get: function () { return proxy_1.createPIIGateway; } });
|
|
12
|
+
Object.defineProperty(exports, "_setGlobalPIIGateway", { enumerable: true, get: function () { return proxy_1._setGlobalPIIGateway; } });
|
|
13
|
+
Object.defineProperty(exports, "_clearGlobalPIIGateway", { enumerable: true, get: function () { return proxy_1._clearGlobalPIIGateway; } });
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pii-gateway/index.ts"],"names":[],"mappings":";;;AAGA,4BAA4B;AAC5B,qCAAuC;AAA9B,qGAAA,UAAU,OAAA;AAEnB,wCAAwC;AACxC,iCAAoH;AAA3G,mGAAA,UAAU,OAAA;AAAE,sGAAA,aAAa,OAAA;AAAE,yGAAA,gBAAgB,OAAA;AAAE,6GAAA,oBAAoB,OAAA;AAAE,+GAAA,sBAAsB,OAAA"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { MindedConnection } from '../platform/mindedConnection';
|
|
2
|
+
import { PIIGatewayInstance } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Global PII Gateway that is automatically initialized when a trigger with sessionId is received.
|
|
5
|
+
* This provides seamless access to PII masking capabilities within workflows and custom tools.
|
|
6
|
+
*
|
|
7
|
+
* The gateway acts as a proxy that automatically uses the current session's PII context.
|
|
8
|
+
* All standard HTTP methods (get, post, put, delete, patch, head, options, request) are available.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { piiGateway } from '@minded-ai/mindedjs';
|
|
13
|
+
*
|
|
14
|
+
* // Within a custom tool or workflow (after trigger is received)
|
|
15
|
+
* async function fetchUserData() {
|
|
16
|
+
* const response = await piiGateway.get('/api/user/profile');
|
|
17
|
+
* return response.data;
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* // POST request
|
|
21
|
+
* const createResponse = await piiGateway.post('/api/users', {
|
|
22
|
+
* name: 'John Doe',
|
|
23
|
+
* email: 'john@example.com'
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const piiGateway: PIIGatewayInstance;
|
|
28
|
+
/**
|
|
29
|
+
* Get the global PII Gateway instance that is automatically initialized when a trigger with sessionId is received.
|
|
30
|
+
* This provides seamless access to PII masking capabilities within workflows and custom tools.
|
|
31
|
+
*
|
|
32
|
+
* @returns The PII Gateway instance for the current session
|
|
33
|
+
* @throws {Error} When no active session or PII gateway is not initialized
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* import { getPIIGateway } from '@minded-ai/mindedjs';
|
|
38
|
+
*
|
|
39
|
+
* // Within a custom tool or workflow (after trigger is received)
|
|
40
|
+
* async function fetchUserData() {
|
|
41
|
+
* const piiGateway = getPIIGateway();
|
|
42
|
+
* const response = await piiGateway.get('/api/user/profile');
|
|
43
|
+
* return response.data;
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function getPIIGateway(): PIIGatewayInstance;
|
|
48
|
+
/**
|
|
49
|
+
* Create a PII Gateway instance with a specific Minded connection and session ID.
|
|
50
|
+
* This is used internally by the Agent and for advanced use cases.
|
|
51
|
+
*
|
|
52
|
+
* @param mindedConnection - The Minded connection to use for the requests
|
|
53
|
+
* @param sessionId - Session ID for PII context (required for proper masking)
|
|
54
|
+
* @returns A PII Gateway instance
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* import { createPIIGateway } from '@minded-ai/mindedjs';
|
|
59
|
+
*
|
|
60
|
+
* const piiGateway = createPIIGateway(mindedConnection, 'session-123');
|
|
61
|
+
* const response = await piiGateway.get('/api/data');
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function createPIIGateway(mindedConnection: MindedConnection, sessionId: string): PIIGatewayInstance;
|
|
65
|
+
/**
|
|
66
|
+
* Internal function used by the Agent to set the global PII gateway when a trigger is received.
|
|
67
|
+
* This ensures the PII masking is automatically available to SDK users.
|
|
68
|
+
*
|
|
69
|
+
* @internal
|
|
70
|
+
* @param mindedConnection - The Minded connection to use
|
|
71
|
+
* @param sessionId - The session ID from the trigger
|
|
72
|
+
*/
|
|
73
|
+
export declare function _setGlobalPIIGateway(mindedConnection: MindedConnection, sessionId: string): void;
|
|
74
|
+
/**
|
|
75
|
+
* Internal function to clear the global PII gateway.
|
|
76
|
+
*
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
export declare function _clearGlobalPIIGateway(): void;
|
|
80
|
+
//# sourceMappingURL=proxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/pii-gateway/proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAM7C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,UAAU,EAAE,kBAOvB,CAAC;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,IAAI,kBAAkB,CAKlD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,GAAG,kBAAkB,CAE1G;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAEhG;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.piiGateway = void 0;
|
|
4
|
+
exports.getPIIGateway = getPIIGateway;
|
|
5
|
+
exports.createPIIGateway = createPIIGateway;
|
|
6
|
+
exports._setGlobalPIIGateway = _setGlobalPIIGateway;
|
|
7
|
+
exports._clearGlobalPIIGateway = _clearGlobalPIIGateway;
|
|
8
|
+
const gateway_1 = require("./gateway");
|
|
9
|
+
// Global PII gateway instance that gets automatically set when triggers are received
|
|
10
|
+
let globalPIIGateway = null;
|
|
11
|
+
/**
|
|
12
|
+
* Global PII Gateway that is automatically initialized when a trigger with sessionId is received.
|
|
13
|
+
* This provides seamless access to PII masking capabilities within workflows and custom tools.
|
|
14
|
+
*
|
|
15
|
+
* The gateway acts as a proxy that automatically uses the current session's PII context.
|
|
16
|
+
* All standard HTTP methods (get, post, put, delete, patch, head, options, request) are available.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* import { piiGateway } from '@minded-ai/mindedjs';
|
|
21
|
+
*
|
|
22
|
+
* // Within a custom tool or workflow (after trigger is received)
|
|
23
|
+
* async function fetchUserData() {
|
|
24
|
+
* const response = await piiGateway.get('/api/user/profile');
|
|
25
|
+
* return response.data;
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* // POST request
|
|
29
|
+
* const createResponse = await piiGateway.post('/api/users', {
|
|
30
|
+
* name: 'John Doe',
|
|
31
|
+
* email: 'john@example.com'
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
exports.piiGateway = new Proxy({}, {
|
|
36
|
+
get(target, prop) {
|
|
37
|
+
if (!globalPIIGateway) {
|
|
38
|
+
throw new Error('PII Gateway is not available. Ensure a trigger with sessionId has been received first.');
|
|
39
|
+
}
|
|
40
|
+
return globalPIIGateway[prop];
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* Get the global PII Gateway instance that is automatically initialized when a trigger with sessionId is received.
|
|
45
|
+
* This provides seamless access to PII masking capabilities within workflows and custom tools.
|
|
46
|
+
*
|
|
47
|
+
* @returns The PII Gateway instance for the current session
|
|
48
|
+
* @throws {Error} When no active session or PII gateway is not initialized
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* import { getPIIGateway } from '@minded-ai/mindedjs';
|
|
53
|
+
*
|
|
54
|
+
* // Within a custom tool or workflow (after trigger is received)
|
|
55
|
+
* async function fetchUserData() {
|
|
56
|
+
* const piiGateway = getPIIGateway();
|
|
57
|
+
* const response = await piiGateway.get('/api/user/profile');
|
|
58
|
+
* return response.data;
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
function getPIIGateway() {
|
|
63
|
+
if (!globalPIIGateway) {
|
|
64
|
+
throw new Error('PII Gateway is not available. Ensure a trigger with sessionId has been received first.');
|
|
65
|
+
}
|
|
66
|
+
return globalPIIGateway;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Create a PII Gateway instance with a specific Minded connection and session ID.
|
|
70
|
+
* This is used internally by the Agent and for advanced use cases.
|
|
71
|
+
*
|
|
72
|
+
* @param mindedConnection - The Minded connection to use for the requests
|
|
73
|
+
* @param sessionId - Session ID for PII context (required for proper masking)
|
|
74
|
+
* @returns A PII Gateway instance
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* import { createPIIGateway } from '@minded-ai/mindedjs';
|
|
79
|
+
*
|
|
80
|
+
* const piiGateway = createPIIGateway(mindedConnection, 'session-123');
|
|
81
|
+
* const response = await piiGateway.get('/api/data');
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
function createPIIGateway(mindedConnection, sessionId) {
|
|
85
|
+
return new gateway_1.PIIGateway(mindedConnection, sessionId);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Internal function used by the Agent to set the global PII gateway when a trigger is received.
|
|
89
|
+
* This ensures the PII masking is automatically available to SDK users.
|
|
90
|
+
*
|
|
91
|
+
* @internal
|
|
92
|
+
* @param mindedConnection - The Minded connection to use
|
|
93
|
+
* @param sessionId - The session ID from the trigger
|
|
94
|
+
*/
|
|
95
|
+
function _setGlobalPIIGateway(mindedConnection, sessionId) {
|
|
96
|
+
globalPIIGateway = new gateway_1.PIIGateway(mindedConnection, sessionId);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Internal function to clear the global PII gateway.
|
|
100
|
+
*
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
function _clearGlobalPIIGateway() {
|
|
104
|
+
globalPIIGateway = null;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../../src/pii-gateway/proxy.ts"],"names":[],"mappings":";;;AA2DA,sCAKC;AAkBD,4CAEC;AAUD,oDAEC;AAOD,wDAEC;AAvGD,uCAAuC;AAEvC,qFAAqF;AACrF,IAAI,gBAAgB,GAAsB,IAAI,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACU,QAAA,UAAU,GAAuB,IAAI,KAAK,CAAC,EAAwB,EAAE;IAChF,GAAG,CAAC,MAAM,EAAE,IAAI;QACd,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,wFAAwF,CAAC,CAAC;QAC5G,CAAC;QACD,OAAQ,gBAAwB,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACF,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,aAAa;IAC3B,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,wFAAwF,CAAC,CAAC;IAC5G,CAAC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,gBAAgB,CAAC,gBAAkC,EAAE,SAAiB;IACpF,OAAO,IAAI,oBAAU,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,oBAAoB,CAAC,gBAAkC,EAAE,SAAiB;IACxF,gBAAgB,GAAG,IAAI,oBAAU,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;AACjE,CAAC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB;IACpC,gBAAgB,GAAG,IAAI,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface HttpRequestConfig {
|
|
2
|
+
method?: string;
|
|
3
|
+
url?: string;
|
|
4
|
+
headers?: Record<string, string>;
|
|
5
|
+
params?: Record<string, any>;
|
|
6
|
+
data?: any;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
export interface HttpResponse<T = any> {
|
|
11
|
+
data: T;
|
|
12
|
+
status: number;
|
|
13
|
+
statusText: string;
|
|
14
|
+
headers: Record<string, string>;
|
|
15
|
+
config: HttpRequestConfig;
|
|
16
|
+
}
|
|
17
|
+
export interface PIIGatewayInstance {
|
|
18
|
+
get<T = any>(url: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
19
|
+
post<T = any>(url: string, data?: any, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
20
|
+
put<T = any>(url: string, data?: any, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
21
|
+
delete<T = any>(url: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
22
|
+
patch<T = any>(url: string, data?: any, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
23
|
+
head<T = any>(url: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
24
|
+
options<T = any>(url: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
25
|
+
request<T = any>(config: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/pii-gateway/types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,GAAG;IACnC,IAAI,EAAE,CAAC,CAAC;IACR,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AAED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AC,CAAC,CAAC,CAAC,CAAC;CACvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/pii-gateway/types.ts"],"names":[],"mappings":""}
|
|
@@ -5,9 +5,6 @@ type MindedConfig = {
|
|
|
5
5
|
token: string | null;
|
|
6
6
|
runLocally: boolean;
|
|
7
7
|
isDeployed: boolean;
|
|
8
|
-
dashboardConnected: boolean;
|
|
9
|
-
elevenLabsKey: string | null;
|
|
10
|
-
elevenLabsAgentId: string | null;
|
|
11
8
|
};
|
|
12
9
|
export declare const getConfig: () => MindedConfig;
|
|
13
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/platform/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/platform/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,WAAW,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,SAAS,QAAO,YA4C5B,CAAC"}
|
package/dist/platform/config.js
CHANGED
|
@@ -3,9 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getConfig = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const dotenv_1 = require("dotenv");
|
|
6
|
-
|
|
7
|
-
console.log(`Loading config from ${path}`);
|
|
8
|
-
(0, dotenv_1.config)({ path });
|
|
6
|
+
(0, dotenv_1.config)({ path: (0, path_1.resolve)(__dirname, '../../.env') });
|
|
9
7
|
const getConfig = () => {
|
|
10
8
|
const environment = process.env.NODE_ENV || 'sandbox';
|
|
11
9
|
switch (environment) {
|
|
@@ -16,9 +14,6 @@ const getConfig = () => {
|
|
|
16
14
|
token: process.env.MINDED_CONNECTION_TOKEN || '',
|
|
17
15
|
runLocally: process.env.RUN_LOCALLY !== 'false',
|
|
18
16
|
isDeployed: process.env.IS_DEPLOYED_AGENT === 'true',
|
|
19
|
-
dashboardConnected: false,
|
|
20
|
-
elevenLabsKey: process.env.ELEVEN_LABS_API_KEY || null,
|
|
21
|
-
elevenLabsAgentId: process.env.ELEVEN_LABS_AGENT_ID || null,
|
|
22
17
|
};
|
|
23
18
|
case 'development':
|
|
24
19
|
return {
|
|
@@ -27,9 +22,6 @@ const getConfig = () => {
|
|
|
27
22
|
token: process.env.MINDED_CONNECTION_TOKEN || '',
|
|
28
23
|
runLocally: process.env.RUN_LOCALLY === 'true',
|
|
29
24
|
isDeployed: process.env.IS_DEPLOYED_AGENT === 'true',
|
|
30
|
-
dashboardConnected: true,
|
|
31
|
-
elevenLabsKey: process.env.ELEVEN_LABS_API_KEY || null,
|
|
32
|
-
elevenLabsAgentId: process.env.ELEVEN_LABS_AGENT_ID || 'Iyr6DCOj80AdvVEVHSGt',
|
|
33
25
|
};
|
|
34
26
|
case 'sandbox-staging':
|
|
35
27
|
return {
|
|
@@ -38,9 +30,6 @@ const getConfig = () => {
|
|
|
38
30
|
token: process.env.MINDED_CONNECTION_TOKEN || '',
|
|
39
31
|
runLocally: false,
|
|
40
32
|
isDeployed: process.env.IS_DEPLOYED_AGENT === 'true',
|
|
41
|
-
elevenLabsKey: process.env.ELEVEN_LABS_API_KEY || null,
|
|
42
|
-
dashboardConnected: true,
|
|
43
|
-
elevenLabsAgentId: process.env.ELEVEN_LABS_AGENT_ID || 'agent_01jye194psezr909nwec27m2t9',
|
|
44
33
|
};
|
|
45
34
|
case 'sandbox':
|
|
46
35
|
return {
|
|
@@ -49,9 +38,6 @@ const getConfig = () => {
|
|
|
49
38
|
token: process.env.MINDED_CONNECTION_TOKEN || '',
|
|
50
39
|
runLocally: false,
|
|
51
40
|
isDeployed: process.env.IS_DEPLOYED_AGENT === 'true',
|
|
52
|
-
elevenLabsKey: process.env.ELEVEN_LABS_API_KEY || null,
|
|
53
|
-
dashboardConnected: true,
|
|
54
|
-
elevenLabsAgentId: process.env.ELEVEN_LABS_AGENT_ID || 'agent_01jye194psezr909nwec27m2t9',
|
|
55
41
|
};
|
|
56
42
|
case 'production':
|
|
57
43
|
return {
|
|
@@ -60,9 +46,6 @@ const getConfig = () => {
|
|
|
60
46
|
token: process.env.MINDED_CONNECTION_TOKEN || '',
|
|
61
47
|
runLocally: false,
|
|
62
48
|
isDeployed: process.env.IS_DEPLOYED_AGENT === 'true',
|
|
63
|
-
elevenLabsKey: process.env.ELEVEN_LABS_API_KEY || null,
|
|
64
|
-
dashboardConnected: false,
|
|
65
|
-
elevenLabsAgentId: process.env.ELEVEN_LABS_AGENT_ID || 'agent_01jye1ajkaf17axpcxg220qwcm',
|
|
66
49
|
};
|
|
67
50
|
}
|
|
68
51
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/platform/config.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,mCAAgC;AAEhC,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/platform/config.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,mCAAgC;AAEhC,IAAA,eAAM,EAAC,EAAE,IAAI,EAAE,IAAA,cAAO,EAAC,SAAS,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC;AAU5C,MAAM,SAAS,GAAG,GAAiB,EAAE;IAC1C,MAAM,WAAW,GAAI,OAAO,CAAC,GAAG,CAAC,QAAwB,IAAI,SAAS,CAAC;IACvE,QAAQ,WAAW,EAAE,CAAC;QACpB,KAAK,MAAM;YACT,OAAO;gBACL,OAAO,EAAE,uBAAuB;gB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K,MAAM;aACrD,CAAC;IACN,CAAC;AACH,CAAC,CAAC;AA5CW,QAAA,SAAS,aA4CpB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { BaseMindedConnectionSocketMessage, MindedConnectionSocketMessageType
|
|
1
|
+
import { BaseMindedConnectionSocketMessage, MindedConnectionSocketMessageType } from './mindedConnectionTypes';
|
|
2
2
|
export declare class MindedConnection {
|
|
3
3
|
private socket;
|
|
4
4
|
listeners: {
|
|
5
|
-
[key: string]: ((message: BaseMindedConnectionSocketMessage
|
|
5
|
+
[key: string]: ((message: BaseMindedConnectionSocketMessage) => void)[];
|
|
6
6
|
};
|
|
7
7
|
get isConnected(): boolean;
|
|
8
|
-
on: (event: MindedConnectionSocketMessageType, callback: (message: BaseMindedConnectionSocketMessage
|
|
9
|
-
emit:
|
|
8
|
+
on: (event: MindedConnectionSocketMessageType, callback: (message: BaseMindedConnectionSocketMessage) => void) => void;
|
|
9
|
+
emit: (event: MindedConnectionSocketMessageType, message: BaseMindedConnectionSocketMessage) => void;
|
|
10
10
|
awaitEmit: <T, R>(event: MindedConnectionSocketMessageType, message: T, timeoutMs?: number) => Promise<R>;
|
|
11
11
|
private connect;
|
|
12
12
|
start(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mindedConnection.d.ts","sourceRoot":"","sources":["../../src/platform/mindedConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,iCAAiC,EAAE,
|
|
1
|
+
{"version":3,"file":"mindedConnection.d.ts","sourceRoot":"","sources":["../../src/platform/mindedConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,iCAAiC,EAAE,MAAM,yBAAyB,CAAC;AAI/G,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAuB;IACrC,SAAS,EAAE;QACT,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,iCAAiC,KAAK,IAAI,CAAC,EAAE,CAAC;KACzE,CAAM;IAEP,IAAW,WAAW,IAAI,OAAO,CAEhC;IAEM,EAAE,GAAI,OAAO,iCAAiC,EAAE,UAAU,CAAC,OAAO,EAAE,iCAAiC,KAAK,IAAI,UAKnH;IAEK,IAAI,GAAI,OAAO,iCAAiC,EAAE,SAAS,iCAAiC,UAIjG;IAEK,SAAS,GAAU,CAAC,EAAE,CAAC,EAAE,OAAO,iCAAiC,EAAE,SAAS,CAAC,EAAE,YAAW,MAAa,KAAG,OAAO,CAAC,CAAC,CAAC,CAuBzH;YAEY,OAAO;IAgER,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAOpC"}
|
|
@@ -26,7 +26,7 @@ class MindedConnection {
|
|
|
26
26
|
return new Promise((resolve, reject) => {
|
|
27
27
|
// Set up timeout
|
|
28
28
|
const timeout = setTimeout(() => {
|
|
29
|
-
reject(new Error(`Acknowledgement timeout after ${timeoutMs}ms
|
|
29
|
+
reject(new Error(`Acknowledgement timeout after ${timeoutMs}ms`));
|
|
30
30
|
}, timeoutMs);
|
|
31
31
|
// Emit with acknowledgement callback
|
|
32
32
|
this.socket.emit(event, (0, flatted_1.stringify)(message), (response) => {
|
|
@@ -63,8 +63,8 @@ class MindedConnection {
|
|
|
63
63
|
resolve();
|
|
64
64
|
});
|
|
65
65
|
this.socket.on('connect_error', () => {
|
|
66
|
-
console.error('
|
|
67
|
-
reject(new Error('
|
|
66
|
+
console.error('Failed to connect to minded platform');
|
|
67
|
+
reject(new Error('Failed to connect to minded platform'));
|
|
68
68
|
});
|
|
69
69
|
this.socket.on('disconnect', () => {
|
|
70
70
|
console.log('Disconnected from local debugging socket');
|
|
@@ -84,15 +84,12 @@ class MindedConnection {
|
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
// Listen for specific message types
|
|
87
|
-
this.socket.onAny((event, message
|
|
87
|
+
this.socket.onAny((event, message) => {
|
|
88
88
|
if (this.listeners[event]) {
|
|
89
89
|
this.listeners[event].forEach((listener) => {
|
|
90
|
-
listener(message
|
|
90
|
+
listener(message);
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
-
else {
|
|
94
|
-
console.warn({ message: 'No listeners found for event', event });
|
|
95
|
-
}
|
|
96
93
|
});
|
|
97
94
|
// Handle process termination
|
|
98
95
|
process.on('SIGINT', () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mindedConnection.js","sourceRoot":"","sources":["../../src/platform/mindedConnection.ts"],"names":[],"mappings":";;;AAAA,uDAA8C;AAE9C,qCAAoC;AACpC,qCAAqC;AAErC,MAAa,gBAAgB;IAA7B;QACU,WAAM,GAAkB,IAAI,CAAC;QACrC,cAAS,GAEL,EAAE,CAAC;QAMA,OAAE,GAAG,CAAC,KAAwC,EAAE,
|
|
1
|
+
{"version":3,"file":"mindedConnection.js","sourceRoot":"","sources":["../../src/platform/mindedConnection.ts"],"names":[],"mappings":";;;AAAA,uDAA8C;AAE9C,qCAAoC;AACpC,qCAAqC;AAErC,MAAa,gBAAgB;IAA7B;QACU,WAAM,GAAkB,IAAI,CAAC;QACrC,cAAS,GAEL,EAAE,CAAC;QAMA,OAAE,GAAG,CAAC,KAAwC,EAAE,QAA8D,EAAE,EAAE;YACvH,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC3B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YAC7B,CAAC;YACD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,CAAC,CAAC;QAEK,SAAI,GAAG,CAAC,KAAwC,EAAE,OAA0C,EAAE,EAAE;YACrG,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YACnC,CAAC;QACH,CAAC,CAAC;QAEK,cAAS,GAAG,KAAK,EAAQ,K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