@verana-labs/vs-agent-sdk 2.0.0-dev.43 → 2.0.0-dev.45
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/build/events/VsAgentEvents.d.ts +1 -8
- package/build/events/VsAgentEvents.js +0 -1
- package/build/events/VsAgentEvents.js.map +1 -1
- package/build/events/VtFlowEvents.d.ts +1 -1
- package/build/events/VtFlowEvents.js +2 -19
- package/build/events/VtFlowEvents.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { VsAgent } from '../agent/VsAgent';
|
|
2
2
|
import type { BaseEvent } from '@credo-ts/core';
|
|
3
|
-
import { BaseMessage, ConnectionStateUpdated, Event, IndexerNotification, MessageReceived,
|
|
3
|
+
import { BaseMessage, ConnectionStateUpdated, Event, IndexerNotification, MessageReceived, PresentationStateUpdated, VtFlowStateUpdated } from '@verana-labs/vs-agent-model';
|
|
4
4
|
export declare enum VsAgentEventTypes {
|
|
5
5
|
ConnectionStateUpdated = "vs-agent-connection-state-updated",
|
|
6
6
|
MessageReceived = "vs-agent-message-received",
|
|
7
|
-
MessageStateUpdated = "vs-agent-message-state-updated",
|
|
8
7
|
PresentationStateUpdated = "vs-agent-presentation-state-updated",
|
|
9
8
|
VtFlowStateUpdated = "vs-agent-vt-flow-state-updated",
|
|
10
9
|
IndexerNotification = "vs-agent-indexer-notification"
|
|
@@ -21,12 +20,6 @@ export interface VsAgentMessageReceivedEvent extends BaseEvent {
|
|
|
21
20
|
event: MessageReceived;
|
|
22
21
|
};
|
|
23
22
|
}
|
|
24
|
-
export interface VsAgentMessageStateUpdatedEvent extends BaseEvent {
|
|
25
|
-
type: typeof VsAgentEventTypes.MessageStateUpdated;
|
|
26
|
-
payload: {
|
|
27
|
-
event: MessageStateUpdated;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
23
|
export interface VsAgentPresentationStateUpdatedEvent extends BaseEvent {
|
|
31
24
|
type: typeof VsAgentEventTypes.PresentationStateUpdated;
|
|
32
25
|
payload: {
|
|
@@ -8,7 +8,6 @@ var VsAgentEventTypes;
|
|
|
8
8
|
(function (VsAgentEventTypes) {
|
|
9
9
|
VsAgentEventTypes["ConnectionStateUpdated"] = "vs-agent-connection-state-updated";
|
|
10
10
|
VsAgentEventTypes["MessageReceived"] = "vs-agent-message-received";
|
|
11
|
-
VsAgentEventTypes["MessageStateUpdated"] = "vs-agent-message-state-updated";
|
|
12
11
|
VsAgentEventTypes["PresentationStateUpdated"] = "vs-agent-presentation-state-updated";
|
|
13
12
|
VsAgentEventTypes["VtFlowStateUpdated"] = "vs-agent-vt-flow-state-updated";
|
|
14
13
|
VsAgentEventTypes["IndexerNotification"] = "vs-agent-indexer-notification";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VsAgentEvents.js","sourceRoot":"","sources":["../../src/events/VsAgentEvents.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"VsAgentEvents.js","sourceRoot":"","sources":["../../src/events/VsAgentEvents.ts"],"names":[],"mappings":";;;AAoDA,gCAKC;AAED,4CAEC;AA1DD,gEAQoC;AAEpC,IAAY,iBAMX;AAND,WAAY,iBAAiB;IAC3B,iFAA4D,CAAA;IAC5D,kEAA6C,CAAA;IAC7C,qFAAgE,CAAA;IAChE,0EAAqD,CAAA;IACrD,0EAAqD,CAAA;AACvD,CAAC,EANW,iBAAiB,iCAAjB,iBAAiB,QAM5B;AAiCD,SAAgB,UAAU,CAAC,OAAoB;IAC7C,OAAO,IAAI,gCAAe,CAAC;QACzB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,OAAO;KACR,CAAC,CAAA;AACJ,CAAC;AAED,SAAgB,gBAAgB,CAAC,KAAc,EAAE,IAAuB,EAAE,KAAY;IACpF,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAA;AAChE,CAAC"}
|
|
@@ -4,30 +4,13 @@ exports.vtFlowEvents = void 0;
|
|
|
4
4
|
const credo_ts_didcomm_vt_flow_1 = require("@verana-labs/credo-ts-didcomm-vt-flow");
|
|
5
5
|
const vs_agent_model_1 = require("@verana-labs/vs-agent-model");
|
|
6
6
|
const VsAgentEvents_1 = require("./VsAgentEvents");
|
|
7
|
-
const vtFlowEvents =
|
|
8
|
-
agent.events.on(credo_ts_didcomm_vt_flow_1.VtFlowEventTypes.VtFlowStateChanged,
|
|
7
|
+
const vtFlowEvents = (agent, logger) => {
|
|
8
|
+
agent.events.on(credo_ts_didcomm_vt_flow_1.VtFlowEventTypes.VtFlowStateChanged, ({ payload }) => {
|
|
9
9
|
logger.debug(`Incoming vtFlow state change: ${payload.vtFlowRecordId}`);
|
|
10
|
-
const record = await agent.modules.vtFlow.findById(payload.vtFlowRecordId);
|
|
11
|
-
if (!record)
|
|
12
|
-
return;
|
|
13
10
|
(0, VsAgentEvents_1.emitVsAgentEvent)(agent, VsAgentEvents_1.VsAgentEventTypes.VtFlowStateUpdated, new vs_agent_model_1.VtFlowStateUpdated({
|
|
14
11
|
vtFlowRecordId: payload.vtFlowRecordId,
|
|
15
|
-
threadId: payload.threadId,
|
|
16
|
-
participantSessionId: payload.participantSessionId,
|
|
17
|
-
connectionId: record.connectionId,
|
|
18
|
-
role: record.role,
|
|
19
|
-
variant: record.variant,
|
|
20
12
|
state: payload.state,
|
|
21
13
|
previousState: payload.previousState,
|
|
22
|
-
participantId: record.participantId,
|
|
23
|
-
schemaId: record.schemaId,
|
|
24
|
-
claims: record.claims,
|
|
25
|
-
credentialExchangeRecordId: record.credentialExchangeRecordId,
|
|
26
|
-
errorMessage: record.errorMessage,
|
|
27
|
-
subprotocolThid: record.subprotocolThid,
|
|
28
|
-
agentParticipantId: record.agentParticipantId,
|
|
29
|
-
walletAgentParticipantId: record.walletAgentParticipantId,
|
|
30
|
-
timestamp: record.updatedAt,
|
|
31
14
|
}));
|
|
32
15
|
});
|
|
33
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VtFlowEvents.js","sourceRoot":"","sources":["../../src/events/VtFlowEvents.ts"],"names":[],"mappings":";;;AAGA,oFAAsG;AACtG,gEAAgE;AAEhE,mDAAqE;AAE9D,MAAM,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"VtFlowEvents.js","sourceRoot":"","sources":["../../src/events/VtFlowEvents.ts"],"names":[],"mappings":";;;AAGA,oFAAsG;AACtG,gEAAgE;AAEhE,mDAAqE;AAE9D,MAAM,YAAY,GAAG,CAAC,KAAc,EAAE,MAAkB,EAAE,EAAE;IACjE,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,2CAAgB,CAAC,kBAAkB,EAAE,CAAC,EAAE,OAAO,EAA2B,EAAE,EAAE;QAC5F,MAAM,CAAC,KAAK,CAAC,iCAAiC,OAAO,CAAC,cAAc,EAAE,CAAC,CAAA;QACvE,IAAA,gCAAgB,EACd,KAAK,EACL,iCAAiB,CAAC,kBAAkB,EACpC,IAAI,mCAAkB,CAAC;YACrB,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,aAAa,EAAE,OAAO,CAAC,aAAa;SACrC,CAAC,CACH,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAbY,QAAA,YAAY,gBAaxB"}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"default": "./build/index.js"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
-
"version": "2.0.0-dev.
|
|
12
|
+
"version": "2.0.0-dev.45",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "https://github.com/verana-labs/vs-agent"
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"didwebvh-ts": "^2.8.0",
|
|
46
46
|
"express": "^4.18.1",
|
|
47
47
|
"tsyringe": "4.8.0",
|
|
48
|
-
"@verana-labs/credo-ts-didcomm-vt-flow": "2.0.0-dev.
|
|
49
|
-
"@verana-labs/vs-agent-model": "2.0.0-dev.
|
|
48
|
+
"@verana-labs/credo-ts-didcomm-vt-flow": "2.0.0-dev.45",
|
|
49
|
+
"@verana-labs/vs-agent-model": "2.0.0-dev.45"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@credo-ts/core": "0.7.1-pr-2704-20260901064803",
|