@primero.ai/temporal-graph-tools 1.2.0 → 1.2.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/README.md +3 -1
- package/dist/examples/mastra-ai-workflow/activities/classify-outage-with-ai.d.ts.map +1 -1
- package/dist/examples/mastra-ai-workflow/activities/classify-outage-with-ai.js +10 -4
- package/dist/examples/mastra-ai-workflow/activities/draft-response-with-ai.js +1 -1
- package/dist/examples/mastra-ai-workflow/activities/submit-response.d.ts.map +1 -1
- package/dist/src/bundler.js +2 -2
- package/dist/src/mastra/create-activity-with-mastra.d.ts.map +1 -1
- package/dist/src/mastra/create-activity-with-mastra.js +3 -1
- package/dist/src/workflow/collection.d.ts.map +1 -1
- package/package.json +17 -17
package/README.md
CHANGED
|
@@ -49,7 +49,9 @@ const fetchUserProfile = createActivity(
|
|
|
49
49
|
return { profile: { id: userId, name: `User ${userId}` } }
|
|
50
50
|
},
|
|
51
51
|
async ({ context, execute }) => {
|
|
52
|
-
console.log(
|
|
52
|
+
console.log(
|
|
53
|
+
`[mastra] node=${context?.node.key} stage=${context?.node.stageIndex}`,
|
|
54
|
+
)
|
|
53
55
|
return execute()
|
|
54
56
|
},
|
|
55
57
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classify-outage-with-ai.d.ts","sourceRoot":"","sources":["../../../../examples/mastra-ai-workflow/activities/classify-outage-with-ai.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG,SAAS,GAAG,SAAS,CAAA;AACjE,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAA;AAErD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,YAAY,CAAA;IACpB,OAAO,EAAE,aAAa,CAAA;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;
|
|
1
|
+
{"version":3,"file":"classify-outage-with-ai.d.ts","sourceRoot":"","sources":["../../../../examples/mastra-ai-workflow/activities/classify-outage-with-ai.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG,SAAS,GAAG,SAAS,CAAA;AACjE,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAA;AAErD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,YAAY,CAAA;IACpB,OAAO,EAAE,aAAa,CAAA;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AA0FD,eAAO,MAAM,oBAAoB,gIAqDhC,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _a;
|
|
2
|
-
import { createActivityWithMastra, } from '@primero.ai/temporal-graph-tools';
|
|
3
2
|
import { openai } from '@ai-sdk/openai';
|
|
4
3
|
import { z } from 'zod';
|
|
4
|
+
import { createActivityWithMastra, } from '@primero.ai/temporal-graph-tools';
|
|
5
5
|
function logMastraContext(context) {
|
|
6
6
|
var _a, _b, _c, _d, _e;
|
|
7
7
|
if (!(context === null || context === void 0 ? void 0 : context.node)) {
|
|
@@ -11,17 +11,23 @@ function logMastraContext(context) {
|
|
|
11
11
|
}
|
|
12
12
|
function inferIntent(message) {
|
|
13
13
|
const normalized = message.toLowerCase();
|
|
14
|
-
if (normalized.includes('invoice') ||
|
|
14
|
+
if (normalized.includes('invoice') ||
|
|
15
|
+
normalized.includes('refund') ||
|
|
16
|
+
normalized.includes('charge')) {
|
|
15
17
|
return 'billing';
|
|
16
18
|
}
|
|
17
|
-
if (normalized.includes('password') ||
|
|
19
|
+
if (normalized.includes('password') ||
|
|
20
|
+
normalized.includes('login') ||
|
|
21
|
+
normalized.includes('2fa')) {
|
|
18
22
|
return 'account';
|
|
19
23
|
}
|
|
20
24
|
return 'connectivity';
|
|
21
25
|
}
|
|
22
26
|
function inferUrgency(message) {
|
|
23
27
|
const normalized = message.toLowerCase();
|
|
24
|
-
if (normalized.includes('urgent') ||
|
|
28
|
+
if (normalized.includes('urgent') ||
|
|
29
|
+
normalized.includes('down') ||
|
|
30
|
+
normalized.includes('cannot work')) {
|
|
25
31
|
return 'high';
|
|
26
32
|
}
|
|
27
33
|
if (normalized.includes('soon') || normalized.includes('today')) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _a;
|
|
2
|
-
import { createActivityWithMastra, } from '@primero.ai/temporal-graph-tools';
|
|
3
2
|
import { openai } from '@ai-sdk/openai';
|
|
4
3
|
import { z } from 'zod';
|
|
4
|
+
import { createActivityWithMastra, } from '@primero.ai/temporal-graph-tools';
|
|
5
5
|
function logMastraContext(context) {
|
|
6
6
|
var _a, _b, _c, _d, _e;
|
|
7
7
|
if (!(context === null || context === void 0 ? void 0 : context.node)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit-response.d.ts","sourceRoot":"","sources":["../../../../examples/mastra-ai-workflow/activities/submit-response.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,IAAI,CAAA;IACX,QAAQ,EAAE,aAAa,CAAA;CACxB,CAAA;AAYD,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"submit-response.d.ts","sourceRoot":"","sources":["../../../../examples/mastra-ai-workflow/activities/submit-response.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,IAAI,CAAA;IACX,QAAQ,EAAE,aAAa,CAAA;CACxB,CAAA;AAYD,eAAO,MAAM,cAAc,4HAa1B,CAAA"}
|
package/dist/src/bundler.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { isAbsolute, resolve, join } from 'node:path';
|
|
2
1
|
import { createHash } from 'node:crypto';
|
|
3
|
-
import { mkdtemp, rm, writeFile } from 'node:fs/promises';
|
|
4
2
|
import { existsSync } from 'node:fs';
|
|
3
|
+
import { mkdtemp, rm, writeFile } from 'node:fs/promises';
|
|
5
4
|
import { createRequire } from 'node:module';
|
|
6
5
|
import { tmpdir } from 'node:os';
|
|
6
|
+
import { isAbsolute, join, resolve } from 'node:path';
|
|
7
7
|
import { buildWorkflowBundleCode } from './workflow-bundler.js';
|
|
8
8
|
import { collectWorkflowBuildResults } from './workflow/collection.js';
|
|
9
9
|
let cachedEsbuild;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-activity-with-mastra.d.ts","sourceRoot":"","sources":["../../../src/mastra/create-activity-with-mastra.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"create-activity-with-mastra.d.ts","sourceRoot":"","sources":["../../../src/mastra/create-activity-with-mastra.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,2BAA2B,EAChC,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,aAAa,CAAA;AACpB,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAA;AAE3B,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,qBAAqB,CAAA;IACjC,YAAY,CAAC,EAAE,mBA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,MAAM,EAAE,OAAO,EAAE,EAAE,SAAS,MAAM,EACzE,OAAO,EAAE,qCAAqC,CAAC,EAAE,CAAC,EAClD,OAAO,EAAE,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9C,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA"}
|
|
@@ -32,7 +32,9 @@ export function createActivityWithMastra(options, handler) {
|
|
|
32
32
|
return createActivity(wrappedActivity);
|
|
33
33
|
}
|
|
34
34
|
const config = {
|
|
35
|
-
...(hasInlineConfig
|
|
35
|
+
...(hasInlineConfig
|
|
36
|
+
? Object.fromEntries(inlineConfigEntries)
|
|
37
|
+
: {}),
|
|
36
38
|
...(options.id !== undefined ? { id: options.id } : {}),
|
|
37
39
|
};
|
|
38
40
|
return createActivity(wrappedActivity, config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../src/workflow/collection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,mBAAmB,EACnB,6BAA6B,EAE9B,MAAM,aAAa,CAAA;AAGpB,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,SAAS,mBAAmB,EAAE,GACtC,6BAA6B,
|
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../src/workflow/collection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,mBAAmB,EACnB,6BAA6B,EAE9B,MAAM,aAAa,CAAA;AAGpB,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,SAAS,mBAAmB,EAAE,GACtC,6BAA6B,CAgE/B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primero.ai/temporal-graph-tools",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Utilities for working with DAG workflows.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"homepage": "https://github.com/primero-ai/temporal-graph-tools#readme",
|
|
@@ -76,33 +76,33 @@
|
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@ai-sdk/openai": "^3.0.30",
|
|
78
78
|
"@mastra/core": "^1.4.0",
|
|
79
|
-
"@temporalio/activity": "^1.
|
|
80
|
-
"@temporalio/client": "1.
|
|
81
|
-
"@temporalio/worker": "1.
|
|
82
|
-
"@temporalio/workflow": "1.
|
|
83
|
-
"lodash": "^4.17.
|
|
84
|
-
"zod": "4.
|
|
79
|
+
"@temporalio/activity": "^1.15.0",
|
|
80
|
+
"@temporalio/client": "1.15.0",
|
|
81
|
+
"@temporalio/worker": "1.15.0",
|
|
82
|
+
"@temporalio/workflow": "1.15.0",
|
|
83
|
+
"lodash": "^4.17.23",
|
|
84
|
+
"zod": "4.3.6"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/lodash": "^4.17.23",
|
|
88
|
-
"tsx": "^4.
|
|
89
|
-
"@eslint/js": "^
|
|
90
|
-
"dotenv": "^17.
|
|
88
|
+
"tsx": "^4.21.0",
|
|
89
|
+
"@eslint/js": "^10.0.1",
|
|
90
|
+
"dotenv": "^17.3.1",
|
|
91
91
|
"dotenv-cli": "^11.0.0",
|
|
92
|
-
"@ianvs/prettier-plugin-sort-imports": "^4.7.
|
|
93
|
-
"@types/node": "^25.
|
|
94
|
-
"esbuild": "^0.27.
|
|
95
|
-
"eslint": "^
|
|
92
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.7.1",
|
|
93
|
+
"@types/node": "^25.2.3",
|
|
94
|
+
"esbuild": "^0.27.3",
|
|
95
|
+
"eslint": "^10.0.0",
|
|
96
96
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
97
97
|
"eslint-plugin-import": "^2.32.0",
|
|
98
|
-
"prettier": "^3.8.
|
|
98
|
+
"prettier": "^3.8.1",
|
|
99
99
|
"prettier-plugin-tailwindcss": "^0.7.2",
|
|
100
100
|
"typescript": "^5.9.3",
|
|
101
|
-
"typescript-eslint": "^8.
|
|
101
|
+
"typescript-eslint": "^8.56.0"
|
|
102
102
|
},
|
|
103
103
|
"engines": {
|
|
104
104
|
"node": ">=18"
|
|
105
105
|
},
|
|
106
106
|
"module": "dist/src/index.js",
|
|
107
|
-
"packageManager": "bun@1.3.
|
|
107
|
+
"packageManager": "bun@1.3.9"
|
|
108
108
|
}
|