@bpmsoftwaresolutions/ai-engine-client 1.1.36 → 1.1.37
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/package.json +1 -1
- package/src/index.js +14 -3
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const DEFAULT_TIMEOUT_MS = 30000;
|
|
2
|
-
export const AI_ENGINE_CLIENT_VERSION = '1.1.
|
|
2
|
+
export const AI_ENGINE_CLIENT_VERSION = '1.1.37';
|
|
3
3
|
export const GOVERNED_MUTATION_REQUIRED_CAPABILITIES = [
|
|
4
4
|
'executeVerifiedMutation',
|
|
5
5
|
'post_mutation_verification',
|
|
@@ -114,6 +114,11 @@ function cleanText(value) {
|
|
|
114
114
|
return text || null;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
function looksLikeUuid(value) {
|
|
118
|
+
const text = cleanText(value);
|
|
119
|
+
return Boolean(text && /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(text));
|
|
120
|
+
}
|
|
121
|
+
|
|
117
122
|
function countRoadmapProjectionLines(markdown) {
|
|
118
123
|
const lines = [];
|
|
119
124
|
let inSummary = false;
|
|
@@ -1674,6 +1679,14 @@ export class AIEngineClient {
|
|
|
1674
1679
|
...packetPayload,
|
|
1675
1680
|
imported_by: normalizedImportedBy,
|
|
1676
1681
|
});
|
|
1682
|
+
const packetId = cleanText(importedPacket?.packet_id || importedPacket?.packetId || importedPacket?.implementation_packet_key || importedPacket?.implementationPacketKey || packetPayload.packetId || packetPayload.packet_id);
|
|
1683
|
+
const implementationPacketId = cleanText(importedPacket?.implementation_packet_id || importedPacket?.implementationPacketId);
|
|
1684
|
+
if (!implementationPacketId) {
|
|
1685
|
+
throw new Error('Imported implementation packet response must include implementation_packet_id.');
|
|
1686
|
+
}
|
|
1687
|
+
if (!looksLikeUuid(implementationPacketId)) {
|
|
1688
|
+
throw new Error('Imported implementation packet response returned a non-UUID implementation_packet_id.');
|
|
1689
|
+
}
|
|
1677
1690
|
const projectReference = this._resolveImplementationPacketProjectReference(packetPayload);
|
|
1678
1691
|
if (!projectReference) {
|
|
1679
1692
|
throw new Error('Could not resolve a project reference from the packet payload.');
|
|
@@ -1694,8 +1707,6 @@ export class AIEngineClient {
|
|
|
1694
1707
|
}
|
|
1695
1708
|
const resolvedWorkflowId = await this._resolveImplementationPacketWorkflowId(workflowReference);
|
|
1696
1709
|
const workflowSlug = cleanText(projectSummary.workflow_slug);
|
|
1697
|
-
const packetId = cleanText(importedPacket?.packet_id || importedPacket?.packetId || importedPacket?.implementation_packet_key || importedPacket?.implementationPacketKey || packetPayload.packetId || packetPayload.packet_id);
|
|
1698
|
-
const implementationPacketId = cleanText(importedPacket?.implementation_packet_id || importedPacket?.implementationPacketId || packetId);
|
|
1699
1710
|
|
|
1700
1711
|
const binding = await this.bindImplementationPacketToWorkflow(resolvedWorkflowId, {
|
|
1701
1712
|
packet_id: packetId,
|