@memberjunction/task-graph 0.0.0 → 6.1.0-edge.2

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.
Files changed (51) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +167 -27
  3. package/dist/DispatcherConditionEvaluator.d.ts +10 -0
  4. package/dist/DispatcherConditionEvaluator.d.ts.map +1 -0
  5. package/dist/DispatcherConditionEvaluator.js +27 -0
  6. package/dist/DispatcherConditionEvaluator.js.map +1 -0
  7. package/dist/TaskClaimStore.d.ts +125 -0
  8. package/dist/TaskClaimStore.d.ts.map +1 -0
  9. package/dist/TaskClaimStore.js +223 -0
  10. package/dist/TaskClaimStore.js.map +1 -0
  11. package/dist/TaskGraphDispatcher.d.ts +548 -0
  12. package/dist/TaskGraphDispatcher.d.ts.map +1 -0
  13. package/dist/TaskGraphDispatcher.js +2232 -0
  14. package/dist/TaskGraphDispatcher.js.map +1 -0
  15. package/dist/TaskGraphService.d.ts +247 -0
  16. package/dist/TaskGraphService.d.ts.map +1 -0
  17. package/dist/TaskGraphService.js +753 -0
  18. package/dist/TaskGraphService.js.map +1 -0
  19. package/dist/TaskGraphSubmitterImpl.d.ts +7 -0
  20. package/dist/TaskGraphSubmitterImpl.d.ts.map +1 -0
  21. package/dist/TaskGraphSubmitterImpl.js +52 -0
  22. package/dist/TaskGraphSubmitterImpl.js.map +1 -0
  23. package/dist/TaskLoopExecutor.d.ts +62 -0
  24. package/dist/TaskLoopExecutor.d.ts.map +1 -0
  25. package/dist/TaskLoopExecutor.js +248 -0
  26. package/dist/TaskLoopExecutor.js.map +1 -0
  27. package/dist/WorkflowSpecSync.d.ts +197 -0
  28. package/dist/WorkflowSpecSync.d.ts.map +1 -0
  29. package/dist/WorkflowSpecSync.js +474 -0
  30. package/dist/WorkflowSpecSync.js.map +1 -0
  31. package/dist/index.d.ts +19 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +19 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/operations/TaskGraphOperations.d.ts +39 -0
  36. package/dist/operations/TaskGraphOperations.d.ts.map +1 -0
  37. package/dist/operations/TaskGraphOperations.js +168 -0
  38. package/dist/operations/TaskGraphOperations.js.map +1 -0
  39. package/dist/operations/WorkflowDraftOperation.d.ts +37 -0
  40. package/dist/operations/WorkflowDraftOperation.d.ts.map +1 -0
  41. package/dist/operations/WorkflowDraftOperation.js +141 -0
  42. package/dist/operations/WorkflowDraftOperation.js.map +1 -0
  43. package/dist/operations/WorkflowOperations.d.ts +22 -0
  44. package/dist/operations/WorkflowOperations.d.ts.map +1 -0
  45. package/dist/operations/WorkflowOperations.js +99 -0
  46. package/dist/operations/WorkflowOperations.js.map +1 -0
  47. package/dist/types.d.ts +328 -0
  48. package/dist/types.d.ts.map +1 -0
  49. package/dist/types.js +9 -0
  50. package/dist/types.js.map +1 -0
  51. package/package.json +36 -8
@@ -0,0 +1,328 @@
1
+ /**
2
+ * @fileoverview Contracts for task-graph submission and durable execution.
3
+ * @module @memberjunction/task-graph
4
+ */
5
+ import { IMetadataProvider, UserInfo } from '@memberjunction/core';
6
+ /**
7
+ * Mints a fresh metadata/data provider.
8
+ *
9
+ * The dispatcher runs outside any HTTP request and executes tasks concurrently, so it must never
10
+ * share one provider — and therefore one transaction scope — across parallel work. Rather than
11
+ * import MJServer (which would invert the dependency: MJServer depends on this package, not the
12
+ * reverse), the host supplies a factory. MJServer's implementation wraps the same
13
+ * `createPerRequestProviders` machinery that already mints a provider per request over the shared
14
+ * connection pool, which is proven cheap at request scale.
15
+ *
16
+ * Contract: every call returns a provider safe to use on its own transaction scope. Callers are
17
+ * responsible for nothing beyond using it — pooling and lifetime are the host's concern.
18
+ */
19
+ export type ProviderFactory = {
20
+ CreateProvider(): Promise<IMetadataProvider>;
21
+ };
22
+ /**
23
+ * Runs one agent for one task node.
24
+ *
25
+ * Abstracted rather than taking `AgentRunner` directly so the dispatcher can be unit-tested without
26
+ * standing up the agent framework, and so a host with a different execution strategy (a queue, a
27
+ * remote worker) can supply its own.
28
+ */
29
+ export type TaskAgentRunner = {
30
+ RunAgentForTask(params: TaskAgentRunParams): Promise<TaskAgentRunResult>;
31
+ };
32
+ /** Everything running one action for one task node needs. */
33
+ export type TaskActionRunParams = {
34
+ TaskID: string;
35
+ ActionID: string;
36
+ /** Structured input from `Task.InputPayload` — for durable entity-action dispatch, the redacted params. */
37
+ InputPayload: unknown;
38
+ /** Outputs of this node's satisfied prerequisites, in the same shape agent nodes receive. */
39
+ DependencyOutputs: Map<string, unknown>;
40
+ Provider: IMetadataProvider;
41
+ ContextUser: UserInfo;
42
+ };
43
+ /** The outcome of one action node. */
44
+ export type TaskActionRunResult = {
45
+ Success: boolean;
46
+ Output?: unknown;
47
+ ErrorMessage?: string;
48
+ /**
49
+ * The `MJ: Action Execution Logs` row this run produced.
50
+ *
51
+ * Carried so the step can record it, which is what lets a workflow's action offer "view the
52
+ * execution log" the way an ordinary agent run step does. Optional because a runner that
53
+ * cannot produce one is limited, not broken.
54
+ */
55
+ ActionLogID?: string;
56
+ };
57
+ /**
58
+ * Runs one action for one task node.
59
+ *
60
+ * The third execution shape, beside agents and people. Abstracted for the same reason
61
+ * {@link TaskAgentRunner} is: the dispatcher must stay unit-testable without standing up the action
62
+ * engine, and this package must not import it — `@memberjunction/actions` depends on the entity
63
+ * layer this one also builds on, and reaching for it here would make every consumer of durable
64
+ * execution load the action engine too.
65
+ *
66
+ * **A host with no action runner is not broken, it is limited.** Action nodes stay Pending on it,
67
+ * which is visible in the Tasks UI, rather than being marked failed — a task nobody in this
68
+ * deployment can run is not the same as a task that ran and did not work.
69
+ */
70
+ export type TaskActionRunner = {
71
+ RunActionForTask(params: TaskActionRunParams): Promise<TaskActionRunResult>;
72
+ };
73
+ /** Everything running one prompt for one task node needs. */
74
+ export type TaskPromptRunParams = {
75
+ TaskID: string;
76
+ PromptID: string;
77
+ /** Structured input from `Task.InputPayload`, after the node's input mapping. */
78
+ InputPayload: unknown;
79
+ /** Outputs of this node's satisfied prerequisites, in the same shape agent nodes receive. */
80
+ DependencyOutputs: Map<string, unknown>;
81
+ /** Template parameters declared on the node's configuration. */
82
+ TemplateParameters?: Record<string, string>;
83
+ Provider: IMetadataProvider;
84
+ ContextUser: UserInfo;
85
+ };
86
+ /** The outcome of one prompt node. */
87
+ export type TaskPromptRunResult = {
88
+ Success: boolean;
89
+ /** The parsed JSON response, deep-merged into the payload by the dispatcher. */
90
+ Output?: unknown;
91
+ ErrorMessage?: string;
92
+ /** The `MJ: AI Prompt Runs` row, for provenance. */
93
+ PromptRunID?: string;
94
+ /**
95
+ * Set when the prompt asked to end the workflow and say something to a person.
96
+ *
97
+ * A prompt is the one node kind that can decide the workflow is *done* — it is the only one
98
+ * doing open-ended reasoning. The dispatcher honours it by skipping the remaining tasks and
99
+ * settling the parent Complete with this message, rather than treating an early finish as an
100
+ * abandoned graph.
101
+ */
102
+ ChatMessage?: string;
103
+ };
104
+ /**
105
+ * Runs one prompt for one task node.
106
+ *
107
+ * The fourth execution shape, and abstracted for the same reason as the others: this package must
108
+ * stay unit-testable without standing up the AI engine, and must not import it — the prompt runner
109
+ * lives in MJServer where the engine already does.
110
+ *
111
+ * **A host with no prompt runner is limited, not broken.** Prompt nodes stay Pending and visible,
112
+ * exactly like action nodes without an action runner.
113
+ */
114
+ export type TaskPromptRunner = {
115
+ RunPromptForTask(params: TaskPromptRunParams): Promise<TaskPromptRunResult>;
116
+ };
117
+ /** What happened to a task or a graph, as a closed set a consumer can branch on. */
118
+ export type TaskGraphFrameKind =
119
+ /** A task was claimed by an instance and is about to run. */
120
+ 'TaskStarted'
121
+ /** A task finished successfully. */
122
+ | 'TaskCompleted'
123
+ /** A task failed. `ErrorMessage` says why. */
124
+ | 'TaskFailed'
125
+ /** A task was blocked because a prerequisite failed or became unreachable. */
126
+ | 'TaskBlocked'
127
+ /**
128
+ * A task was NOT TAKEN because another branch of an exclusive fan-out won.
129
+ *
130
+ * Distinct from `TaskBlocked` on purpose: blocked means something went wrong upstream and the
131
+ * viewer should look for a cause; skipped means the workflow chose a different route and there
132
+ * is nothing to investigate. Rendering them the same would send people hunting for bugs that do
133
+ * not exist.
134
+ */
135
+ | 'TaskSkipped'
136
+ /** A human task became actionable and is waiting on its assignee. */
137
+ | 'TaskAwaitingHuman'
138
+ /** Every node has reached a terminal state; `Status` is the graph's rolled-up outcome. */
139
+ | 'GraphSettled';
140
+ /**
141
+ * One thing that happened, addressed by the graph it happened in.
142
+ *
143
+ * **Addressed by `ParentTaskID`, deliberately not by session.** A durable graph outlives the tab
144
+ * that submitted it — it may be started by a schedule with no session at all, and a user who
145
+ * refreshes mid-run should still see the rest. Keying on the graph means "watch this workflow run"
146
+ * works for anyone permitted to read it, whenever they arrive.
147
+ *
148
+ * Frames are **semantic, not cache invalidations**: a consumer renders "step 3 of 7 running" from
149
+ * the frame itself rather than re-reading rows and diffing them to guess what changed.
150
+ */
151
+ export type TaskGraphFrame = {
152
+ Kind: TaskGraphFrameKind;
153
+ /** The graph this happened in — the subscription key. */
154
+ ParentTaskID: string;
155
+ /**
156
+ * Who the graph belongs to, from the parent's durable metadata.
157
+ *
158
+ * Carried on the frame rather than looked up by the consumer because a consumer's delivery
159
+ * filter runs per frame and synchronously — a database round trip there would make watching a
160
+ * run cost more than running it. Absent means the graph predates ownership being recorded, and
161
+ * a consumer that authorizes on it should fail closed rather than broadcast.
162
+ */
163
+ OwnerUserID?: string | null;
164
+ /** The node it happened to. Absent on `GraphSettled`, which is about the graph itself. */
165
+ TaskID?: string;
166
+ /** Node name, so a consumer can label the frame without loading the row. */
167
+ TaskName?: string;
168
+ /** The task's (or, for `GraphSettled`, the graph's) status after the event. */
169
+ Status?: string;
170
+ /** Failure detail on `TaskFailed`. */
171
+ ErrorMessage?: string;
172
+ /** For a human task, who it is waiting on. */
173
+ AssignedUserID?: string;
174
+ /** How many nodes have reached a terminal state, and out of how many. */
175
+ CompletedCount?: number;
176
+ TotalCount?: number;
177
+ };
178
+ /**
179
+ * Receives dispatcher lifecycle frames.
180
+ *
181
+ * Optional, and a host that supplies none loses nothing but visibility — the dispatcher's behavior
182
+ * is identical either way. Abstracted for the same reason execution and continuation are: publishing
183
+ * to subscribers is a transport concern, and this package must not acquire a dependency on the
184
+ * transport layer to gain observability.
185
+ *
186
+ * Implementations MUST NOT throw and MUST NOT block: a frame is an announcement about work, never a
187
+ * step of it, so a broken observer must not be able to stall or fail a graph.
188
+ */
189
+ export type TaskGraphObserver = {
190
+ OnFrame(frame: TaskGraphFrame): void;
191
+ };
192
+ /** Everything an executor needs to run a single task node. */
193
+ export type TaskAgentRunParams = {
194
+ /** The task row being executed. */
195
+ TaskID: string;
196
+ /**
197
+ * The agent run that submitted this graph, when there was one.
198
+ *
199
+ * Becomes the spawned run's `ParentRunID`, which is what makes a workflow's total cost a single
200
+ * indexed sum over `RootParentRunID` instead of a walk. Null for a graph nobody's run submitted
201
+ * — a schedule, MCP, or a person — and that is a real case, not a missing value.
202
+ *
203
+ * Note this is a run→run link: the task graph sits BETWEEN the two conceptually but cannot be
204
+ * the parent, because the column points at a run. The graph is recovered through
205
+ * `Task.AgentRunID` and `Task.ParentID`.
206
+ */
207
+ SubmittingAgentRunID?: string | null;
208
+ /**
209
+ * How many continuation hops led to this run, from the graph's own metadata.
210
+ *
211
+ * Carried so the chain is BOUNDED. A flow that dispatches a graph containing itself recurses
212
+ * forever otherwise: each spawned run starts at depth zero, so `MAX_REINVOKE_DEPTH` compares
213
+ * against a permanent zero and never fires. The cap exists; this is what feeds it.
214
+ */
215
+ ContinuationDepth?: number;
216
+ /** Agent assigned to the task. */
217
+ AgentID: string;
218
+ /** Parsed `Task.InputPayload`, if any. */
219
+ InputPayload: unknown;
220
+ /** Parsed `OutputPayload` of each completed dependency, keyed by that task's ID. */
221
+ DependencyOutputs: Map<string, unknown>;
222
+ /** Provider minted for this task alone — never shared with a sibling. */
223
+ Provider: IMetadataProvider;
224
+ /** User the work runs as. */
225
+ ContextUser: UserInfo;
226
+ };
227
+ /** Outcome of running one task node. */
228
+ export type TaskAgentRunResult = {
229
+ Success: boolean;
230
+ /** Structured output to persist to `Task.OutputPayload`. */
231
+ Output?: unknown;
232
+ /** Failure detail to persist to `Task.ErrorMessage`. */
233
+ ErrorMessage?: string;
234
+ /** The `MJ: AI Agent Runs` row that executed this task, for `Task.AgentRunID`. */
235
+ AgentRunID?: string;
236
+ };
237
+ /**
238
+ * Delivers a finished graph's outcome, per its `continuation` mode.
239
+ *
240
+ * Abstracted for the same reason agent execution is: the dispatcher knows *when* a graph has
241
+ * settled and *what* it produced, but posting into a conversation and starting a fresh agent turn
242
+ * are host concerns. Injecting them keeps this package free of both the conversation layer and the
243
+ * agent framework — a dependency on the latter would be circular, since agents submit graphs.
244
+ *
245
+ * A host that implements neither still gets correct behavior: the dispatcher logs the outcome and
246
+ * marks it delivered, so a graph never silently repeats its completion.
247
+ */
248
+ export type TaskContinuationDeliverer = {
249
+ /** Posts the results into the conversation the graph answers. */
250
+ PostMessage(params: TaskContinuationParams): Promise<void>;
251
+ /**
252
+ * Starts the submitting agent a fresh turn carrying the outcome.
253
+ *
254
+ * Optional: a host with no agent framework loaded (a worker, a test) legitimately cannot do
255
+ * this, and the dispatcher degrades to `PostMessage` rather than dropping the completion.
256
+ */
257
+ Reinvoke?(params: TaskContinuationParams): Promise<void>;
258
+ };
259
+ /** Everything a continuation needs to say what happened. */
260
+ export type TaskContinuationParams = {
261
+ ParentTaskID: string;
262
+ WorkflowName: string;
263
+ /** Conversation the graph answers, when it came from a conversational channel. */
264
+ ConversationDetailID: string | null;
265
+ /** The agent run that emitted the graph — the target of a `reinvoke`. */
266
+ SubmittedByAgentRunID: string | null;
267
+ /** How many continuation hops preceded this one, so a re-submitted graph can carry depth + 1. */
268
+ ReinvokeDepth: number;
269
+ /**
270
+ * Per-task outcome. Deliberately carries a `summary` and an `outputRef`, not inline payloads —
271
+ * a ten-task graph's full outputs would swamp the continuation turn's context window, and the
272
+ * agent can pull what it actually needs by task ID.
273
+ */
274
+ Tasks: Array<{
275
+ TaskID: string;
276
+ Name: string;
277
+ Status: string;
278
+ Summary?: string;
279
+ ErrorMessage?: string;
280
+ }>;
281
+ /** One-line human-readable roll-up. */
282
+ Summary: string;
283
+ };
284
+ /** Tuning knobs for the durable dispatcher. */
285
+ export type TaskGraphDispatcherConfig = {
286
+ /**
287
+ * Identifies this dispatcher instance in `Task.ClaimedBy`. Must be stable for the process
288
+ * lifetime and distinct per instance — it is what lets reconciliation tell "my orphaned work"
289
+ * from "another instance's live work".
290
+ */
291
+ InstanceID: string;
292
+ /**
293
+ * How long a claim is honored before reconciliation may reclaim the task.
294
+ *
295
+ * Generous by default: the cost of a too-short TTL is a *duplicate execution* (a healthy but
296
+ * slow task gets reclaimed while still running), whereas the cost of a too-long TTL is merely
297
+ * delayed recovery after a crash. Long-running tasks extend it by heartbeat, so the TTL only
298
+ * has to exceed the heartbeat interval by a comfortable margin.
299
+ */
300
+ ClaimTTLSeconds: number;
301
+ /** How often an in-flight task extends its own claim. Must be well below `ClaimTTLSeconds`. */
302
+ HeartbeatIntervalSeconds: number;
303
+ /** Maximum tasks executed concurrently by this instance. */
304
+ MaxConcurrentTasks: number;
305
+ /**
306
+ * How often to look for claimable work.
307
+ *
308
+ * Five seconds is the right production default — a graph's steps are agent runs measured in
309
+ * seconds to minutes, so polling faster buys latency nobody perceives and costs a query per
310
+ * instance per tick. It is configurable rather than fixed because the correct value genuinely
311
+ * differs by host: a test harness driving a graph to completion should not wait five seconds per
312
+ * node, and a deployment running many short tasks may want tighter latency.
313
+ */
314
+ PollIntervalSeconds: number;
315
+ /** How often the reconciliation sweep runs. */
316
+ ReconciliationIntervalSeconds: number;
317
+ };
318
+ /** Defaults chosen so a heartbeat has several chances to land before a claim lapses. */
319
+ export declare const DEFAULT_DISPATCHER_CONFIG: Omit<TaskGraphDispatcherConfig, 'InstanceID'>;
320
+ /** Why a reconciliation sweep touched a task — logged loudly, never silently corrected. */
321
+ export type ReconciliationAction = 'ExpiredClaimReleased' | 'OrphanedInProgressReleased' | 'StaleClaimCleared';
322
+ /** One normalization the sweep performed. */
323
+ export type ReconciliationEvent = {
324
+ TaskID: string;
325
+ Action: ReconciliationAction;
326
+ Detail: string;
327
+ };
328
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B,cAAc,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAChD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B,eAAe,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC5E,CAAC;AAEF,6DAA6D;AAC7D,MAAM,MAAM,mBAAmB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,2GAA2G;IAC3G,YAAY,EAAE,OAAO,CAAC;IACtB,6FAA6F;IAC7F,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,WAAW,EAAE,QAAQ,CAAC;CACzB,CAAC;AAEF,sCAAsC;AACtC,MAAM,MAAM,mBAAmB,GAAG;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,gBAAgB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB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,EAAE,IAAI,CAAC,yBAAyB,EAAE,YAAY,CAMnF,CAAC;AAEF,2FAA2F;AAC3F,MAAM,MAAM,oBAAoB,GAC1B,sBAAsB,GACtB,4BAA4B,GAC5B,mBAAmB,CAAC;AAE1B,6CAA6C;AAC7C,MAAM,MAAM,mBAAmB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,oBAAoB,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,9 @@
1
+ /** Defaults chosen so a heartbeat has several chances to land before a claim lapses. */
2
+ export const DEFAULT_DISPATCHER_CONFIG = {
3
+ ClaimTTLSeconds: 300,
4
+ HeartbeatIntervalSeconds: 60,
5
+ MaxConcurrentTasks: 5,
6
+ PollIntervalSeconds: 5,
7
+ ReconciliationIntervalSeconds: 120,
8
+ };
9
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAmVA,wFAAwF;AACxF,MAAM,CAAC,MAAM,yBAAyB,GAAkD;IACpF,eAAe,EAAE,GAAG;IACpB,wBAAwB,EAAE,EAAE;IAC5B,kBAAkB,EAAE,CAAC;IACrB,mBAAmB,EAAE,CAAC;IACtB,6BAA6B,EAAE,GAAG;CACrC,CAAC"}
package/package.json CHANGED
@@ -1,10 +1,38 @@
1
1
  {
2
2
  "name": "@memberjunction/task-graph",
3
- "version": "0.0.0",
4
- "description": "OIDC trusted publishing setup package for @memberjunction/task-graph",
5
- "keywords": [
6
- "oidc",
7
- "trusted-publishing",
8
- "setup"
9
- ]
10
- }
3
+ "type": "module",
4
+ "version": "6.1.0-edge.2",
5
+ "description": "MemberJunction: Task Graph - producer-agnostic submission and durable execution of dependency-ordered task graphs",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "/dist"
10
+ ],
11
+ "author": "MemberJunction.com",
12
+ "license": "ISC",
13
+ "dependencies": {
14
+ "@memberjunction/actions-base": "6.1.0-edge.2",
15
+ "@memberjunction/ai-agents": "6.1.0-edge.2",
16
+ "@memberjunction/ai-core-plus": "6.1.0-edge.2",
17
+ "@memberjunction/ai-prompts": "6.1.0-edge.2",
18
+ "@memberjunction/aiengine": "6.1.0-edge.2",
19
+ "@memberjunction/core": "6.1.0-edge.2",
20
+ "@memberjunction/core-entities": "6.1.0-edge.2",
21
+ "@memberjunction/global": "6.1.0-edge.2",
22
+ "@memberjunction/notifications": "6.1.0-edge.2"
23
+ },
24
+ "devDependencies": {
25
+ "@types/node": "24.10.11",
26
+ "typescript": "^5.9.3",
27
+ "vitest": "^3.2.4"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "https://github.com/MemberJunction/MJ"
32
+ },
33
+ "scripts": {
34
+ "build": "tsc && tsc-alias -f",
35
+ "watch": "tsc --watch",
36
+ "test": "vitest run"
37
+ }
38
+ }