@memberjunction/ai-agents 6.3.0-edge.0 → 6.3.0-edge.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 +8 -5
- package/dist/AgentDataPreloader.d.ts +9 -2
- package/dist/AgentDataPreloader.d.ts.map +1 -1
- package/dist/AgentDataPreloader.js +134 -15
- package/dist/AgentDataPreloader.js.map +1 -1
- package/dist/AgentDecisionService.d.ts +10 -1
- package/dist/AgentDecisionService.d.ts.map +1 -1
- package/dist/AgentDecisionService.js +28 -13
- package/dist/AgentDecisionService.js.map +1 -1
- package/dist/AgentRunner.d.ts +57 -15
- package/dist/AgentRunner.d.ts.map +1 -1
- package/dist/AgentRunner.js +692 -101
- package/dist/AgentRunner.js.map +1 -1
- package/dist/ArtifactToolManager.d.ts +134 -39
- package/dist/ArtifactToolManager.d.ts.map +1 -1
- package/dist/ArtifactToolManager.js +2761 -321
- package/dist/ArtifactToolManager.js.map +1 -1
- package/dist/GovernedArtifactService.d.ts +367 -0
- package/dist/GovernedArtifactService.d.ts.map +1 -0
- package/dist/GovernedArtifactService.js +2569 -0
- package/dist/GovernedArtifactService.js.map +1 -0
- package/dist/PayloadManager.d.ts +46 -0
- package/dist/PayloadManager.d.ts.map +1 -1
- package/dist/PayloadManager.js +284 -66
- package/dist/PayloadManager.js.map +1 -1
- package/dist/SkillMarkdownConverter.d.ts.map +1 -1
- package/dist/SkillMarkdownConverter.js +4 -2
- package/dist/SkillMarkdownConverter.js.map +1 -1
- package/dist/agent-context-injector.d.ts +2 -25
- package/dist/agent-context-injector.d.ts.map +1 -1
- package/dist/agent-context-injector.js +38 -153
- package/dist/agent-context-injector.js.map +1 -1
- package/dist/agent-instance.d.ts +28 -0
- package/dist/agent-instance.d.ts.map +1 -0
- package/dist/agent-instance.js +39 -0
- package/dist/agent-instance.js.map +1 -0
- package/dist/agent-memory-context-builder.d.ts.map +1 -1
- package/dist/agent-memory-context-builder.js +46 -42
- package/dist/agent-memory-context-builder.js.map +1 -1
- package/dist/agent-pre-execution-rag.d.ts.map +1 -1
- package/dist/agent-pre-execution-rag.js +5 -0
- package/dist/agent-pre-execution-rag.js.map +1 -1
- package/dist/agent-run-watchdog.d.ts +38 -6
- package/dist/agent-run-watchdog.d.ts.map +1 -1
- package/dist/agent-run-watchdog.js +75 -13
- package/dist/agent-run-watchdog.js.map +1 -1
- package/dist/agent-types/flow-agent-type.d.ts +6 -1
- package/dist/agent-types/flow-agent-type.d.ts.map +1 -1
- package/dist/agent-types/flow-agent-type.js +30 -7
- package/dist/agent-types/flow-agent-type.js.map +1 -1
- package/dist/agent-types/loop-agent-type.d.ts +4 -0
- package/dist/agent-types/loop-agent-type.d.ts.map +1 -1
- package/dist/agent-types/loop-agent-type.js +29 -0
- package/dist/agent-types/loop-agent-type.js.map +1 -1
- package/dist/artifact-presence-locator.d.ts +132 -0
- package/dist/artifact-presence-locator.d.ts.map +1 -0
- package/dist/artifact-presence-locator.js +472 -0
- package/dist/artifact-presence-locator.js.map +1 -0
- package/dist/artifact-tools/CSVToolLibrary.d.ts +2 -2
- package/dist/artifact-tools/CSVToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/CSVToolLibrary.js +41 -14
- package/dist/artifact-tools/CSVToolLibrary.js.map +1 -1
- package/dist/artifact-tools/DataSnapshotToolLibrary.d.ts +2 -2
- package/dist/artifact-tools/DataSnapshotToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/DataSnapshotToolLibrary.js +53 -21
- package/dist/artifact-tools/DataSnapshotToolLibrary.js.map +1 -1
- package/dist/artifact-tools/DocumentToolLibrary.d.ts +101 -0
- package/dist/artifact-tools/DocumentToolLibrary.d.ts.map +1 -0
- package/dist/artifact-tools/DocumentToolLibrary.js +1846 -0
- package/dist/artifact-tools/DocumentToolLibrary.js.map +1 -0
- package/dist/artifact-tools/DocxToolLibrary.d.ts +2 -4
- package/dist/artifact-tools/DocxToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/DocxToolLibrary.js +42 -30
- package/dist/artifact-tools/DocxToolLibrary.js.map +1 -1
- package/dist/artifact-tools/ExcelToolLibrary.d.ts +2 -3
- package/dist/artifact-tools/ExcelToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/ExcelToolLibrary.js +105 -49
- package/dist/artifact-tools/ExcelToolLibrary.js.map +1 -1
- package/dist/artifact-tools/GenericBinaryToolLibrary.d.ts +2 -2
- package/dist/artifact-tools/GenericBinaryToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/GenericBinaryToolLibrary.js +3 -2
- package/dist/artifact-tools/GenericBinaryToolLibrary.js.map +1 -1
- package/dist/artifact-tools/JSONToolLibrary.d.ts +4 -4
- package/dist/artifact-tools/JSONToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/JSONToolLibrary.js +32 -11
- package/dist/artifact-tools/JSONToolLibrary.js.map +1 -1
- package/dist/artifact-tools/PDFToolLibrary.d.ts +27 -3
- package/dist/artifact-tools/PDFToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/PDFToolLibrary.js +36 -21
- package/dist/artifact-tools/PDFToolLibrary.js.map +1 -1
- package/dist/artifact-tools/SearchResultSetToolLibrary.d.ts +2 -2
- package/dist/artifact-tools/SearchResultSetToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/SearchResultSetToolLibrary.js +83 -24
- package/dist/artifact-tools/SearchResultSetToolLibrary.js.map +1 -1
- package/dist/artifact-tools/SlideDeckToolLibrary.d.ts +50 -0
- package/dist/artifact-tools/SlideDeckToolLibrary.d.ts.map +1 -0
- package/dist/artifact-tools/SlideDeckToolLibrary.js +1617 -0
- package/dist/artifact-tools/SlideDeckToolLibrary.js.map +1 -0
- package/dist/artifact-tools/SpreadsheetToolLibrary.d.ts +87 -0
- package/dist/artifact-tools/SpreadsheetToolLibrary.d.ts.map +1 -0
- package/dist/artifact-tools/SpreadsheetToolLibrary.js +3351 -0
- package/dist/artifact-tools/SpreadsheetToolLibrary.js.map +1 -0
- package/dist/artifact-tools/TextToolLibrary.d.ts +3 -3
- package/dist/artifact-tools/TextToolLibrary.d.ts.map +1 -1
- package/dist/artifact-tools/TextToolLibrary.js +34 -24
- package/dist/artifact-tools/TextToolLibrary.js.map +1 -1
- package/dist/artifact-tools/WhiteboardToolLibrary.d.ts +69 -0
- package/dist/artifact-tools/WhiteboardToolLibrary.d.ts.map +1 -0
- package/dist/artifact-tools/WhiteboardToolLibrary.js +555 -0
- package/dist/artifact-tools/WhiteboardToolLibrary.js.map +1 -0
- package/dist/artifact-tools/artifact-comment-suggestion-helper.d.ts +98 -0
- package/dist/artifact-tools/artifact-comment-suggestion-helper.d.ts.map +1 -0
- package/dist/artifact-tools/artifact-comment-suggestion-helper.js +851 -0
- package/dist/artifact-tools/artifact-comment-suggestion-helper.js.map +1 -0
- package/dist/artifact-tools/artifact-tool-helpers.d.ts +21 -0
- package/dist/artifact-tools/artifact-tool-helpers.d.ts.map +1 -0
- package/dist/artifact-tools/artifact-tool-helpers.js +74 -0
- package/dist/artifact-tools/artifact-tool-helpers.js.map +1 -0
- package/dist/artifact-tools/grepHelper.d.ts +27 -0
- package/dist/artifact-tools/grepHelper.d.ts.map +1 -0
- package/dist/artifact-tools/grepHelper.js +229 -0
- package/dist/artifact-tools/grepHelper.js.map +1 -0
- package/dist/artifact-tools/node-vm-safe-regex.d.ts +10 -0
- package/dist/artifact-tools/node-vm-safe-regex.d.ts.map +1 -0
- package/dist/artifact-tools/node-vm-safe-regex.js +148 -0
- package/dist/artifact-tools/node-vm-safe-regex.js.map +1 -0
- package/dist/base-agent.d.ts +119 -14
- package/dist/base-agent.d.ts.map +1 -1
- package/dist/base-agent.js +529 -112
- package/dist/base-agent.js.map +1 -1
- package/dist/decision-discovery.d.ts +42 -15
- package/dist/decision-discovery.d.ts.map +1 -1
- package/dist/decision-discovery.js +90 -20
- package/dist/decision-discovery.js.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/memory-decision-uses.d.ts +206 -0
- package/dist/memory-decision-uses.d.ts.map +1 -0
- package/dist/memory-decision-uses.js +259 -0
- package/dist/memory-decision-uses.js.map +1 -0
- package/dist/memory-manager-agent.d.ts +66 -6
- package/dist/memory-manager-agent.d.ts.map +1 -1
- package/dist/memory-manager-agent.js +184 -31
- package/dist/memory-manager-agent.js.map +1 -1
- package/dist/memory-note-gate.d.ts +12 -9
- package/dist/memory-note-gate.d.ts.map +1 -1
- package/dist/memory-note-gate.js +16 -11
- package/dist/memory-note-gate.js.map +1 -1
- package/dist/native-tools/agent-tool-circuit-breaker.d.ts +44 -0
- package/dist/native-tools/agent-tool-circuit-breaker.d.ts.map +1 -0
- package/dist/native-tools/agent-tool-circuit-breaker.js +71 -0
- package/dist/native-tools/agent-tool-circuit-breaker.js.map +1 -0
- package/dist/native-tools/agent-tools.d.ts +7 -0
- package/dist/native-tools/agent-tools.d.ts.map +1 -1
- package/dist/native-tools/agent-tools.js.map +1 -1
- package/dist/native-tools/control-tools.d.ts +8 -1
- package/dist/native-tools/control-tools.d.ts.map +1 -1
- package/dist/native-tools/control-tools.js +38 -5
- package/dist/native-tools/control-tools.js.map +1 -1
- package/dist/native-tools/framework-tools.d.ts +3 -3
- package/dist/native-tools/framework-tools.d.ts.map +1 -1
- package/dist/native-tools/framework-tools.js +20 -8
- package/dist/native-tools/framework-tools.js.map +1 -1
- package/dist/payload-path-keys.d.ts +54 -0
- package/dist/payload-path-keys.d.ts.map +1 -0
- package/dist/payload-path-keys.js +126 -0
- package/dist/payload-path-keys.js.map +1 -0
- package/dist/pipeline/template.d.ts +9 -4
- package/dist/pipeline/template.d.ts.map +1 -1
- package/dist/pipeline/template.js +29 -30
- package/dist/pipeline/template.js.map +1 -1
- package/dist/realtime/artifact-workspace-channel-server.d.ts +27 -0
- package/dist/realtime/artifact-workspace-channel-server.d.ts.map +1 -0
- package/dist/realtime/artifact-workspace-channel-server.js +43 -0
- package/dist/realtime/artifact-workspace-channel-server.js.map +1 -0
- package/dist/realtime/bridge-realtime-session-factory.d.ts +2 -2
- package/dist/realtime/bridge-realtime-session-factory.d.ts.map +1 -1
- package/dist/realtime/bridge-realtime-session-factory.js +7 -56
- package/dist/realtime/bridge-realtime-session-factory.js.map +1 -1
- package/dist/realtime/realtime-artifact-helpers.d.ts +37 -0
- package/dist/realtime/realtime-artifact-helpers.d.ts.map +1 -0
- package/dist/realtime/realtime-artifact-helpers.js +150 -0
- package/dist/realtime/realtime-artifact-helpers.js.map +1 -0
- package/dist/realtime/realtime-client-session-service.d.ts +87 -17
- package/dist/realtime/realtime-client-session-service.d.ts.map +1 -1
- package/dist/realtime/realtime-client-session-service.js +259 -39
- package/dist/realtime/realtime-client-session-service.js.map +1 -1
- package/dist/realtime/realtime-coagent-config.d.ts +22 -7
- package/dist/realtime/realtime-coagent-config.d.ts.map +1 -1
- package/dist/realtime/realtime-coagent-config.js +20 -22
- package/dist/realtime/realtime-coagent-config.js.map +1 -1
- package/dist/realtime/realtime-moderator-decision.d.ts +86 -0
- package/dist/realtime/realtime-moderator-decision.d.ts.map +1 -0
- package/dist/realtime/realtime-moderator-decision.js +131 -0
- package/dist/realtime/realtime-moderator-decision.js.map +1 -0
- package/dist/realtime/realtime-tool-broker.d.ts +6 -0
- package/dist/realtime/realtime-tool-broker.d.ts.map +1 -1
- package/dist/realtime/realtime-tool-broker.js +4 -2
- package/dist/realtime/realtime-tool-broker.js.map +1 -1
- package/dist/realtime/realtime-turn-moderator.d.ts +20 -0
- package/dist/realtime/realtime-turn-moderator.d.ts.map +1 -1
- package/dist/realtime/realtime-turn-moderator.js +63 -8
- package/dist/realtime/realtime-turn-moderator.js.map +1 -1
- package/dist/repeated-failing-step.d.ts +50 -0
- package/dist/repeated-failing-step.d.ts.map +1 -0
- package/dist/repeated-failing-step.js +130 -0
- package/dist/repeated-failing-step.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +20 -20
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path-style keys in an {@link AgentPayloadChangeRequest} bucket.
|
|
3
|
+
*
|
|
4
|
+
* A bucket key such as `"meta.title"`, `"dependencies[2].code"` or `"dependencies.[2].code"` names a
|
|
5
|
+
* location inside the payload, not a top-level property. `PayloadManager.ApplyAgentChangeRequest`
|
|
6
|
+
* resolves these keys against the payload before applying the change, so a tool or a model can write
|
|
7
|
+
* one nested field without restating the objects and arrays around it.
|
|
8
|
+
*
|
|
9
|
+
* These helpers are pure: they parse a key, check it against a payload, and build the nested value
|
|
10
|
+
* that the change-request merge already understands.
|
|
11
|
+
*
|
|
12
|
+
* @module payload-path-keys
|
|
13
|
+
*/
|
|
14
|
+
/** One step of a payload path: a property name, or an index into an array. */
|
|
15
|
+
export type PayloadPathSegment = string | number;
|
|
16
|
+
/** The result of checking a parsed path against a payload. */
|
|
17
|
+
export interface ResolvedPayloadPath {
|
|
18
|
+
/** The path, with every step that lands on an array turned into a numeric index. */
|
|
19
|
+
Segments: PayloadPathSegment[];
|
|
20
|
+
/** True when a value is already present at the full path. */
|
|
21
|
+
Exists: boolean;
|
|
22
|
+
/** Why the path cannot be written, when it cannot. */
|
|
23
|
+
Error?: string;
|
|
24
|
+
}
|
|
25
|
+
/** True when a bucket key is written as a path (it contains `.` or `[`). */
|
|
26
|
+
export declare function IsPathKey(key: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Splits a path key into segments. Bracketed numbers (`[2]`) become numeric indexes; every other
|
|
29
|
+
* step stays a string, including a bare number such as the `2` in `"dependencies.2.code"`, which
|
|
30
|
+
* {@link ResolvePayloadPath} turns into an index when it lands on an array.
|
|
31
|
+
*
|
|
32
|
+
* @returns The segments, or null when the key is malformed (for example `"a[b]"` or `"a[1"`).
|
|
33
|
+
*/
|
|
34
|
+
export declare function ParsePathKey(key: string): PayloadPathSegment[] | null;
|
|
35
|
+
/** Formats segments the way people write them: `dependencies[2].code`. */
|
|
36
|
+
export declare function FormatPayloadPath(segments: PayloadPathSegment[]): string;
|
|
37
|
+
/**
|
|
38
|
+
* Walks `segments` through `root` and reports whether the path can be written.
|
|
39
|
+
*
|
|
40
|
+
* - On an array, a step must be an index below the length. The index equal to the length is
|
|
41
|
+
* accepted only as the last step (an append).
|
|
42
|
+
* - On an object, a step is a property name; a missing property is fine and makes the rest of the
|
|
43
|
+
* path new.
|
|
44
|
+
* - Once the path has left the payload, an index is an error: there is no array to index into.
|
|
45
|
+
* - A step through a string, number or other non-container value is an error.
|
|
46
|
+
*/
|
|
47
|
+
export declare function ResolvePayloadPath(root: unknown, segments: PayloadPathSegment[]): ResolvedPayloadPath;
|
|
48
|
+
/**
|
|
49
|
+
* Builds the nested change-request value for a path: `["dependencies", 2, "code"]` with `"X"`
|
|
50
|
+
* becomes `{ dependencies: [ , , { code: "X" } ] }`. The array is sparse; the change-request merge
|
|
51
|
+
* leaves the elements in the holes untouched.
|
|
52
|
+
*/
|
|
53
|
+
export declare function BuildNestedValue(segments: PayloadPathSegment[], leaf: unknown): unknown;
|
|
54
|
+
//# sourceMappingURL=payload-path-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload-path-keys.d.ts","sourceRoot":"","sources":["../src/payload-path-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,8EAA8E;AAC9E,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEjD,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAChC,oFAAoF;IACpF,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,6DAA6D;IAC7D,MAAM,EAAE,OAAO,CAAC;IAChB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAID,4EAA4E;AAC5E,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE9C;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,EAAE,GAAG,IAAI,CASrE;AAED,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,MAAM,CAKxE;AAaD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,GAAG,mBAAmB,CAqCrG;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAavF"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path-style keys in an {@link AgentPayloadChangeRequest} bucket.
|
|
3
|
+
*
|
|
4
|
+
* A bucket key such as `"meta.title"`, `"dependencies[2].code"` or `"dependencies.[2].code"` names a
|
|
5
|
+
* location inside the payload, not a top-level property. `PayloadManager.ApplyAgentChangeRequest`
|
|
6
|
+
* resolves these keys against the payload before applying the change, so a tool or a model can write
|
|
7
|
+
* one nested field without restating the objects and arrays around it.
|
|
8
|
+
*
|
|
9
|
+
* These helpers are pure: they parse a key, check it against a payload, and build the nested value
|
|
10
|
+
* that the change-request merge already understands.
|
|
11
|
+
*
|
|
12
|
+
* @module payload-path-keys
|
|
13
|
+
*/
|
|
14
|
+
const PATH_TOKEN = /\[(\d+)\]|([^.[\]]+)/g;
|
|
15
|
+
/** True when a bucket key is written as a path (it contains `.` or `[`). */
|
|
16
|
+
export function IsPathKey(key) {
|
|
17
|
+
return key.includes('.') || key.includes('[');
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Splits a path key into segments. Bracketed numbers (`[2]`) become numeric indexes; every other
|
|
21
|
+
* step stays a string, including a bare number such as the `2` in `"dependencies.2.code"`, which
|
|
22
|
+
* {@link ResolvePayloadPath} turns into an index when it lands on an array.
|
|
23
|
+
*
|
|
24
|
+
* @returns The segments, or null when the key is malformed (for example `"a[b]"` or `"a[1"`).
|
|
25
|
+
*/
|
|
26
|
+
export function ParsePathKey(key) {
|
|
27
|
+
const segments = [];
|
|
28
|
+
let leftover = key;
|
|
29
|
+
for (const match of key.matchAll(PATH_TOKEN)) {
|
|
30
|
+
segments.push(match[1] !== undefined ? Number(match[1]) : match[2]);
|
|
31
|
+
leftover = leftover.replace(match[0], '');
|
|
32
|
+
}
|
|
33
|
+
const onlySeparatorsLeft = /^\.*$/.test(leftover);
|
|
34
|
+
return segments.length > 0 && onlySeparatorsLeft ? segments : null;
|
|
35
|
+
}
|
|
36
|
+
/** Formats segments the way people write them: `dependencies[2].code`. */
|
|
37
|
+
export function FormatPayloadPath(segments) {
|
|
38
|
+
return segments.reduce((text, segment) => {
|
|
39
|
+
if (typeof segment === 'number')
|
|
40
|
+
return `${text}[${segment}]`;
|
|
41
|
+
return text ? `${text}.${segment}` : segment;
|
|
42
|
+
}, '');
|
|
43
|
+
}
|
|
44
|
+
function isPlainRecord(value) {
|
|
45
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
46
|
+
return false;
|
|
47
|
+
const proto = Object.getPrototypeOf(value);
|
|
48
|
+
return proto === Object.prototype || proto === null;
|
|
49
|
+
}
|
|
50
|
+
function toArrayIndex(segment) {
|
|
51
|
+
if (typeof segment === 'number')
|
|
52
|
+
return segment;
|
|
53
|
+
return /^\d+$/.test(segment) ? Number(segment) : NaN;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Walks `segments` through `root` and reports whether the path can be written.
|
|
57
|
+
*
|
|
58
|
+
* - On an array, a step must be an index below the length. The index equal to the length is
|
|
59
|
+
* accepted only as the last step (an append).
|
|
60
|
+
* - On an object, a step is a property name; a missing property is fine and makes the rest of the
|
|
61
|
+
* path new.
|
|
62
|
+
* - Once the path has left the payload, an index is an error: there is no array to index into.
|
|
63
|
+
* - A step through a string, number or other non-container value is an error.
|
|
64
|
+
*/
|
|
65
|
+
export function ResolvePayloadPath(root, segments) {
|
|
66
|
+
const resolved = [];
|
|
67
|
+
let node = root;
|
|
68
|
+
let exists = true;
|
|
69
|
+
for (let i = 0; i < segments.length; i++) {
|
|
70
|
+
const segment = segments[i];
|
|
71
|
+
const isLast = i === segments.length - 1;
|
|
72
|
+
const here = FormatPayloadPath(resolved) || 'the payload root';
|
|
73
|
+
if (Array.isArray(node)) {
|
|
74
|
+
const index = toArrayIndex(segment);
|
|
75
|
+
if (Number.isNaN(index)) {
|
|
76
|
+
return { Segments: resolved, Exists: false, Error: `'${here}' is an array, so '${segment}' must be an index` };
|
|
77
|
+
}
|
|
78
|
+
if (index > node.length || (index === node.length && !isLast)) {
|
|
79
|
+
return { Segments: resolved, Exists: false, Error: `index ${index} is out of range for '${here}' (${node.length} items)` };
|
|
80
|
+
}
|
|
81
|
+
resolved.push(index);
|
|
82
|
+
exists = index < node.length;
|
|
83
|
+
node = exists ? node[index] : undefined;
|
|
84
|
+
}
|
|
85
|
+
else if (isPlainRecord(node)) {
|
|
86
|
+
if (typeof segment === 'number') {
|
|
87
|
+
return { Segments: resolved, Exists: false, Error: `'${here}' is an object, not an array, so it has no index ${segment}` };
|
|
88
|
+
}
|
|
89
|
+
resolved.push(segment);
|
|
90
|
+
exists = segment in node;
|
|
91
|
+
node = exists ? node[segment] : undefined;
|
|
92
|
+
}
|
|
93
|
+
else if (node === undefined) {
|
|
94
|
+
if (typeof segment === 'number') {
|
|
95
|
+
return { Segments: resolved, Exists: false, Error: `'${here}' does not exist, so it has no index ${segment}` };
|
|
96
|
+
}
|
|
97
|
+
resolved.push(segment);
|
|
98
|
+
exists = false;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
return { Segments: resolved, Exists: false, Error: `'${here}' is ${node === null ? 'null' : `a ${typeof node}`}, so it has no '${segment}'` };
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return { Segments: resolved, Exists: exists };
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Builds the nested change-request value for a path: `["dependencies", 2, "code"]` with `"X"`
|
|
108
|
+
* becomes `{ dependencies: [ , , { code: "X" } ] }`. The array is sparse; the change-request merge
|
|
109
|
+
* leaves the elements in the holes untouched.
|
|
110
|
+
*/
|
|
111
|
+
export function BuildNestedValue(segments, leaf) {
|
|
112
|
+
let value = leaf;
|
|
113
|
+
for (let i = segments.length - 1; i >= 0; i--) {
|
|
114
|
+
const segment = segments[i];
|
|
115
|
+
if (typeof segment === 'number') {
|
|
116
|
+
const array = new Array(segment + 1);
|
|
117
|
+
array[segment] = value;
|
|
118
|
+
value = array;
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
value = { [segment]: value };
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return value;
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=payload-path-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload-path-keys.js","sourceRoot":"","sources":["../src/payload-path-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAeH,MAAM,UAAU,GAAG,uBAAuB,CAAC;AAE3C,4EAA4E;AAC5E,MAAM,UAAU,SAAS,CAAC,GAAW;IACjC,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACpC,MAAM,QAAQ,GAAyB,EAAE,CAAC;IAC1C,IAAI,QAAQ,GAAG,GAAG,CAAC;IACnB,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3C,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;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IAC1B,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5C,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,KAAK,GAAc,IAAI,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;YAChD,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;YACvB,KAAK,GAAG,KAAK,CAAC;QAClB,CAAC;aAAM,CAAC;YACJ,KAAK,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC;QACjC,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -13,13 +13,18 @@ import { PipeValue } from './pipeline.types.js';
|
|
|
13
13
|
export type TemplateScope = Record<string, PipeValue>;
|
|
14
14
|
/**
|
|
15
15
|
* If `s` (ignoring outer whitespace) consists of a single `{{ expression }}` placeholder
|
|
16
|
-
* with no nested braces, returns the trimmed inner expression
|
|
16
|
+
* with no nested braces, returns the trimmed inner expression; otherwise `null`. Index checks
|
|
17
|
+
* rather than a regex, so a long run of whitespace or braces costs linear time
|
|
18
|
+
* (CodeQL js/polynomial-redos).
|
|
17
19
|
*/
|
|
18
20
|
export declare function ExtractWholeTemplateExpression(s: string): string | null;
|
|
19
21
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
22
|
+
* Replace every embedded `{{ expression }}` placeholder in `template`, left to right, with
|
|
23
|
+
* `replaceExpr(trimmedExpression, rawMatch)`. A placeholder opens at `{{` and closes at the first `}`
|
|
24
|
+
* after it, which must be the first of `}}`. Malformed or empty placeholders (unclosed `{{`, empty or
|
|
25
|
+
* all-whitespace `{{ }}`, a single `}`) are kept verbatim, and scanning resumes after them, so a later
|
|
26
|
+
* well-formed placeholder still resolves. The position of the next `}` is remembered across candidate
|
|
27
|
+
* openings, so text full of `{{` with no closing brace is scanned once (CodeQL js/polynomial-redos).
|
|
23
28
|
*/
|
|
24
29
|
export declare function ReplaceEmbeddedTemplateExpressions(template: string, replaceExpr: (expr: string, rawMatch: string) => string): string;
|
|
25
30
|
/** Recursively resolve templates in a tool's `with` params object. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/pipeline/template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAI7C,kFAAkF;AAClF,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/pipeline/template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAI7C,kFAAkF;AAClF,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWvE;AAED;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,CAC9C,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,GACxD,MAAM,CAwBR;AAED,sEAAsE;AACtE,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE5G;AAED,6CAA6C;AAC7C,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE5G;AAuBD,mGAAmG;AACnG,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,SAAS,CAiBrF;AAED,2CAA2C;AAC3C,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,SAAS,CAErF"}
|
|
@@ -2,7 +2,9 @@ import { GetValue } from './path.js';
|
|
|
2
2
|
import { ValueToText } from './coerce.js';
|
|
3
3
|
/**
|
|
4
4
|
* If `s` (ignoring outer whitespace) consists of a single `{{ expression }}` placeholder
|
|
5
|
-
* with no nested braces, returns the trimmed inner expression
|
|
5
|
+
* with no nested braces, returns the trimmed inner expression; otherwise `null`. Index checks
|
|
6
|
+
* rather than a regex, so a long run of whitespace or braces costs linear time
|
|
7
|
+
* (CodeQL js/polynomial-redos).
|
|
6
8
|
*/
|
|
7
9
|
export function ExtractWholeTemplateExpression(s) {
|
|
8
10
|
const trimmed = s.trim();
|
|
@@ -17,40 +19,37 @@ export function ExtractWholeTemplateExpression(s) {
|
|
|
17
19
|
return expr.length > 0 ? expr : null;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
22
|
+
* Replace every embedded `{{ expression }}` placeholder in `template`, left to right, with
|
|
23
|
+
* `replaceExpr(trimmedExpression, rawMatch)`. A placeholder opens at `{{` and closes at the first `}`
|
|
24
|
+
* after it, which must be the first of `}}`. Malformed or empty placeholders (unclosed `{{`, empty or
|
|
25
|
+
* all-whitespace `{{ }}`, a single `}`) are kept verbatim, and scanning resumes after them, so a later
|
|
26
|
+
* well-formed placeholder still resolves. The position of the next `}` is remembered across candidate
|
|
27
|
+
* openings, so text full of `{{` with no closing brace is scanned once (CodeQL js/polynomial-redos).
|
|
23
28
|
*/
|
|
24
29
|
export function ReplaceEmbeddedTemplateExpressions(template, replaceExpr) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
const closeIdx = template.indexOf('}}', openIdx + 2);
|
|
37
|
-
if (closeIdx === -1) {
|
|
38
|
-
result += template.slice(cursor);
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
result += template.slice(cursor, openIdx);
|
|
42
|
-
const rawInner = template.slice(openIdx + 2, closeIdx);
|
|
43
|
-
const expr = rawInner.trim();
|
|
44
|
-
const rawMatch = template.slice(openIdx, closeIdx + 2);
|
|
45
|
-
if (expr.length === 0 || rawInner.includes('}')) {
|
|
46
|
-
result += rawMatch;
|
|
30
|
+
let out = '';
|
|
31
|
+
let copied = 0;
|
|
32
|
+
let nextClose = -1;
|
|
33
|
+
let open = template.indexOf('{{');
|
|
34
|
+
while (open !== -1) {
|
|
35
|
+
if (nextClose < open + 2) {
|
|
36
|
+
nextClose = template.indexOf('}', open + 2);
|
|
37
|
+
if (nextClose === -1) {
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
47
40
|
}
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
if (template[nextClose + 1] === '}') {
|
|
42
|
+
const expr = template.slice(open + 2, nextClose).trim();
|
|
43
|
+
if (expr.length > 0) {
|
|
44
|
+
out += template.slice(copied, open) + replaceExpr(expr, template.slice(open, nextClose + 2));
|
|
45
|
+
copied = nextClose + 2;
|
|
46
|
+
open = template.indexOf('{{', copied);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
50
49
|
}
|
|
51
|
-
|
|
50
|
+
open = template.indexOf('{{', open + 1);
|
|
52
51
|
}
|
|
53
|
-
return
|
|
52
|
+
return out + template.slice(copied);
|
|
54
53
|
}
|
|
55
54
|
/** Recursively resolve templates in a tool's `with` params object. */
|
|
56
55
|
export function ResolveParams(params, scope) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/pipeline/template.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAKvC
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/pipeline/template.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAKvC;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAAC,CAAS;IACpD,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACzB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7E,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACtC,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC7B,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACzC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kCAAkC,CAC9C,QAAgB,EAChB,WAAuD;IAEvD,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,MAAM,GAAG,CAAC,CAAC;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
|
|
3
|
+
*
|
|
4
|
+
* Paired with the browser's `RealtimeArtifactWorkspaceChannel` (`@memberjunction/ng-conversations`)
|
|
5
|
+
* via the `MJ: AI Agent Channels` metadata row `Name: 'ArtifactWorkspace'`
|
|
6
|
+
* (`ServerPluginClass: 'ArtifactWorkspaceChannelServer'`, `ClientPluginClass: 'RealtimeArtifactWorkspaceChannel'`).
|
|
7
|
+
*
|
|
8
|
+
* Uses `ClientOnlyChannelServer` because live editing, outline inspection, and persistence are driven
|
|
9
|
+
* by `GovernedArtifactService` + `MJArtifactCollaborationServer` (`/collaboration/yjs`) and the signed-in
|
|
10
|
+
* user's Angular artifact viewers (`SpreadsheetArtifactViewerPlugin`, `MarkdownArtifactViewerPlugin`,
|
|
11
|
+
* `SlideDeckArtifactViewerPlugin`). The server plugin exists for registry discovery and session policy
|
|
12
|
+
* enforcement; workspace tab management (`open`, `focus`, `show_version`, `refresh`, `close`) and rendered
|
|
13
|
+
* pixel/state awareness are bridged via `@memberjunction/ng-conversations`.
|
|
14
|
+
*
|
|
15
|
+
* @module @memberjunction/ai-agents
|
|
16
|
+
*/
|
|
17
|
+
import { ClientOnlyChannelServer } from './client-only-channel-server.js';
|
|
18
|
+
/** Stable channel name matching the `MJ: AI Agent Channels` metadata seed. */
|
|
19
|
+
export declare const ARTIFACT_WORKSPACE_CHANNEL_NAME = "ArtifactWorkspace";
|
|
20
|
+
export declare class ArtifactWorkspaceChannelServer extends ClientOnlyChannelServer {
|
|
21
|
+
get ChannelName(): string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Tree-shaking prevention for {@link ArtifactWorkspaceChannelServer}'s `@RegisterClass` registration.
|
|
25
|
+
*/
|
|
26
|
+
export declare function LoadArtifactWorkspaceChannelServer(): void;
|
|
27
|
+
//# sourceMappingURL=artifact-workspace-channel-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-workspace-channel-server.d.ts","sourceRoot":"","sources":["../../src/realtime/artifact-workspace-channel-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAE,uBAAuB,EAA+B,MAAM,8BAA8B,CAAC;AAEpG,8EAA8E;AAC9E,eAAO,MAAM,+BAA+B,sBAAsB,CAAC;AAEnE,qBACa,8BAA+B,SAAQ,uBAAuB;IACvE,IAAoB,WAAW,IAAI,MAAM,CAExC;CACJ;AAED;;GAEG;AACH,wBAAgB,kCAAkC,IAAI,IAAI,CAEzD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Server-side channel plugin for the **Artifact Workspace** channel (`ArtifactWorkspace`).
|
|
3
|
+
*
|
|
4
|
+
* Paired with the browser's `RealtimeArtifactWorkspaceChannel` (`@memberjunction/ng-conversations`)
|
|
5
|
+
* via the `MJ: AI Agent Channels` metadata row `Name: 'ArtifactWorkspace'`
|
|
6
|
+
* (`ServerPluginClass: 'ArtifactWorkspaceChannelServer'`, `ClientPluginClass: 'RealtimeArtifactWorkspaceChannel'`).
|
|
7
|
+
*
|
|
8
|
+
* Uses `ClientOnlyChannelServer` because live editing, outline inspection, and persistence are driven
|
|
9
|
+
* by `GovernedArtifactService` + `MJArtifactCollaborationServer` (`/collaboration/yjs`) and the signed-in
|
|
10
|
+
* user's Angular artifact viewers (`SpreadsheetArtifactViewerPlugin`, `MarkdownArtifactViewerPlugin`,
|
|
11
|
+
* `SlideDeckArtifactViewerPlugin`). The server plugin exists for registry discovery and session policy
|
|
12
|
+
* enforcement; workspace tab management (`open`, `focus`, `show_version`, `refresh`, `close`) and rendered
|
|
13
|
+
* pixel/state awareness are bridged via `@memberjunction/ng-conversations`.
|
|
14
|
+
*
|
|
15
|
+
* @module @memberjunction/ai-agents
|
|
16
|
+
*/
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
import { BaseRealtimeChannelServer } from '@memberjunction/ai';
|
|
24
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
25
|
+
import { ClientOnlyChannelServer, LoadClientOnlyChannelServer } from './client-only-channel-server.js';
|
|
26
|
+
/** Stable channel name matching the `MJ: AI Agent Channels` metadata seed. */
|
|
27
|
+
export const ARTIFACT_WORKSPACE_CHANNEL_NAME = 'ArtifactWorkspace';
|
|
28
|
+
let ArtifactWorkspaceChannelServer = class ArtifactWorkspaceChannelServer extends ClientOnlyChannelServer {
|
|
29
|
+
get ChannelName() {
|
|
30
|
+
return ARTIFACT_WORKSPACE_CHANNEL_NAME;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
ArtifactWorkspaceChannelServer = __decorate([
|
|
34
|
+
RegisterClass(BaseRealtimeChannelServer, 'ArtifactWorkspaceChannelServer')
|
|
35
|
+
], ArtifactWorkspaceChannelServer);
|
|
36
|
+
export { ArtifactWorkspaceChannelServer };
|
|
37
|
+
/**
|
|
38
|
+
* Tree-shaking prevention for {@link ArtifactWorkspaceChannelServer}'s `@RegisterClass` registration.
|
|
39
|
+
*/
|
|
40
|
+
export function LoadArtifactWorkspaceChannelServer() {
|
|
41
|
+
LoadClientOnlyChannelServer();
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=artifact-workspace-channel-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-workspace-channel-server.js","sourceRoot":"","sources":["../../src/realtime/artifact-workspace-channel-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAEpG,8EAA8E;AAC9E,MAAM,CAAC,MAAM,+BAA+B,GAAG,mBAAmB,CAAC;AAG5D,IAAM,8BAA8B,GAApC,MAAM,8BAA+B,SAAQ,uBAAuB;IACvE,IAAoB,WAAW;QAC3B,OAAO,+BAA+B,CAAC;IAC3C,CAAC;CACJ,CAAA;AAJY,8BAA8B;IAD1C,aAAa,CAAC,yBAAyB,EAAE,gCAAgC,CAAC;GAC9D,8BAA8B,CAI1C;;AAED;;GAEG;AACH,MAAM,UAAU,kCAAkC;IAC9C,2BAA2B,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* agent reference into a live {@link IRealtimeSession} for a Realtime Bridge. Given an agent id (or name)
|
|
4
4
|
* + a context user + a metadata provider, it:
|
|
5
5
|
* 1. resolves the `MJ: AI Agents` entity from the {@link AIEngine} cache,
|
|
6
|
-
* 2. instantiates the correct {@link BaseAgent} subclass via
|
|
7
|
-
* `AgentRunner` uses), and
|
|
6
|
+
* 2. instantiates the correct {@link BaseAgent} subclass via {@link CreateAgentInstance} (the same
|
|
7
|
+
* path `AgentRunner` uses), and
|
|
8
8
|
* 3. calls {@link BaseAgent.StartBridgeRealtimeSession} to open the raw model session.
|
|
9
9
|
*
|
|
10
10
|
* This is the seam every bridge needs — `LiveKitAgentRoomCoordinator.SetSessionFactory`, and the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-realtime-session-factory.d.ts","sourceRoot":"","sources":["../../src/realtime/bridge-realtime-session-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAqB,mBAAmB,EAAE,sBAAsB,EAAE,gBAAgB,EAAwB,MAAM,oBAAoB,CAAC;AAC3K,OAAO,EAAE,iBAAiB,EAAY,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"bridge-realtime-session-factory.d.ts","sourceRoot":"","sources":["../../src/realtime/bridge-realtime-session-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAqB,mBAAmB,EAAE,sBAAsB,EAAE,gBAAgB,EAAwB,MAAM,oBAAoB,CAAC;AAC3K,OAAO,EAAE,iBAAiB,EAAY,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAO7E,OAAO,EAAgC,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAK5G;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IACzC,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oGAAoG;IACpG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,oGAAoG;IACpG,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sGAAsG;IACtG,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACrC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,yBAAyB,CA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ChC"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* agent reference into a live {@link IRealtimeSession} for a Realtime Bridge. Given an agent id (or name)
|
|
4
4
|
* + a context user + a metadata provider, it:
|
|
5
5
|
* 1. resolves the `MJ: AI Agents` entity from the {@link AIEngine} cache,
|
|
6
|
-
* 2. instantiates the correct {@link BaseAgent} subclass via
|
|
7
|
-
* `AgentRunner` uses), and
|
|
6
|
+
* 2. instantiates the correct {@link BaseAgent} subclass via {@link CreateAgentInstance} (the same
|
|
7
|
+
* path `AgentRunner` uses), and
|
|
8
8
|
* 3. calls {@link BaseAgent.StartBridgeRealtimeSession} to open the raw model session.
|
|
9
9
|
*
|
|
10
10
|
* This is the seam every bridge needs — `LiveKitAgentRoomCoordinator.SetSessionFactory`, and the
|
|
@@ -20,7 +20,7 @@ import { BaseRealtimeModel, MakeAIAPIKeyResolver } from '@memberjunction/ai';
|
|
|
20
20
|
import { Metadata } from '@memberjunction/core';
|
|
21
21
|
import { MJGlobal, UUIDsEqual, IndexByUUID } from '@memberjunction/global';
|
|
22
22
|
import { AIEngine } from '@memberjunction/aiengine';
|
|
23
|
-
import {
|
|
23
|
+
import { CreateAgentInstance } from '../agent-instance.js';
|
|
24
24
|
import { RealtimeClientSessionService } from './realtime-client-session-service.js';
|
|
25
25
|
import { SelectRealtimeVendorForModel } from './realtime-vendor-resolution.js';
|
|
26
26
|
import { RealtimePlatformCredentials, ResolveRealtimePlatformCredentials } from './realtime-platform-credentials.js';
|
|
@@ -42,59 +42,10 @@ export async function CreateBridgeRealtimeSession(ctx) {
|
|
|
42
42
|
throw new Error(`CreateBridgeRealtimeSession: no agent found for AgentID='${ctx.AgentID ?? ''}' / ` +
|
|
43
43
|
`AgentName='${ctx.AgentName ?? ''}'. Ensure the agent exists and the engine is configured.`);
|
|
44
44
|
}
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
|
|
49
|
-
// `AIAgentType.DriverClass` names a **BaseAgentType** subclass — the three shipped values are
|
|
50
|
-
// `LoopAgentType`, `FlowAgentType`, `RealtimeAgentType`. The key needed here is a **BaseAgent**
|
|
51
|
-
// one. Different ClassFactory registries, matched by exact key against the base class NAME, so
|
|
52
|
-
// the type's key resolved nothing here — ever. Dead code that looked alive.
|
|
53
|
-
//
|
|
54
|
-
// What that produced is worth stating precisely, because the wrong story invites the wrong fix:
|
|
55
|
-
// with no registration and no `@RequiresSubclass` marker, `resolveAndInstantiate` returns
|
|
56
|
-
// `new BaseClassConstructor(...)` — a plain `BaseAgent`. So every such seat silently ran the
|
|
57
|
-
// BASE implementation, dropping whatever subclass behaviour it was configured for. It did not
|
|
58
|
-
// run some other agent's class. The only signal was one `console.warn` from
|
|
59
|
-
// `reportResolutionFailure`, deduped per base+key and capped at 3 per base: effectively
|
|
60
|
-
// invisible in a busy log, which is the whole problem.
|
|
61
|
-
//
|
|
62
|
-
// A NULL key is the path that really does hand back somebody else's agent —
|
|
63
|
-
// `GetAllRegistrations` skips the key filter entirely for null, so the highest-priority
|
|
64
|
-
// registered `BaseAgent` subclass wins. That is why the else-branch below constructs
|
|
65
|
-
// `new BaseAgent()` directly instead of calling `CreateInstance(BaseAgent, null)`.
|
|
66
|
-
//
|
|
67
|
-
// Most agents declare no `DriverClass` at all and are meant to run on the base implementation
|
|
68
|
-
// (that is what makes them data rather than code), so an absent one is NOT an error — it is the
|
|
69
|
-
// common case, and the old throw was unreachable only because the wrong-registry lookup always
|
|
70
|
-
// produced a truthy key.
|
|
71
|
-
//
|
|
72
|
-
// Dropping the type fallback loses nothing: agent-type behaviour is resolved separately inside
|
|
73
|
-
// `BaseAgent` via `BaseAgentType.GetAgentTypeInstance`, so a seat on the plain `BaseAgent` still
|
|
74
|
-
// gets Loop/Realtime type semantics.
|
|
75
|
-
// Trimmed like every other externally-sourced string in this file (`RealtimeVoice`,
|
|
76
|
-
// `RealtimeModelID`, `AgentSessionID`): a whitespace-only value is a truthy key that would
|
|
77
|
-
// otherwise reach the ClassFactory and fail with a confusing quoted-blank message.
|
|
78
|
-
const driverClass = agent.DriverClass?.trim() || undefined;
|
|
79
|
-
let instance;
|
|
80
|
-
if (driverClass) {
|
|
81
|
-
// `TryCreateInstance`, not `CreateInstance`: an unresolvable key must be an error here rather
|
|
82
|
-
// than a hollow anchor-base object that answers plausibly and wrongly.
|
|
83
|
-
const resolution = MJGlobal.Instance.ClassFactory.TryCreateInstance(BaseAgent, driverClass);
|
|
84
|
-
instance = resolution.Resolved ? resolution.Instance : null;
|
|
85
|
-
if (!instance) {
|
|
86
|
-
throw new Error(`CreateBridgeRealtimeSession: no BaseAgent subclass is registered as '${driverClass}' ` +
|
|
87
|
-
`(agent '${agent.Name}'). Refusing the base-class fallback: it would run a different ` +
|
|
88
|
-
`agent than the one configured, in this agent's voice.`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
// `new BaseAgent()` and NOT `CreateInstance(BaseAgent, null)`: a null key makes
|
|
93
|
-
// `GetAllRegistrations` skip the key filter, so the factory would return the
|
|
94
|
-
// highest-priority registered subclass — an arbitrary agent. Direct construction is the only
|
|
95
|
-
// form that reliably yields the base implementation.
|
|
96
|
-
instance = new BaseAgent();
|
|
97
|
-
}
|
|
45
|
+
// The agent's own BaseAgent subclass, or the plain BaseAgent when it declares none. Never the
|
|
46
|
+
// agent type's DriverClass (#4111, #4112): see CreateAgentInstance. An unregistered key throws:
|
|
47
|
+
// the base-class fallback would run a different agent than the one configured, in this agent's voice.
|
|
48
|
+
const instance = await CreateAgentInstance(agent);
|
|
98
49
|
return instance.StartBridgeRealtimeSession({
|
|
99
50
|
agent,
|
|
100
51
|
contextUser: ctx.ContextUser,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-realtime-session-factory.js","sourceRoot":"","sources":["../../src/realtime/bridge-realtime-session-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAiC,iBAAiB,EAAiE,oBA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AO,CAAC,IAAI,CAAC,aAAa,CAAC,oBAAoB,EAAE,MAAM,EAAE,IAAI,IAAI,QAAQ,CAAC,KAAK,QAAQ,CAAC;AAC5F,CAAC;AAED,wGAAwG;AACxG,SAAS,kBAAkB,CAAC,GAAiC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;IACxC,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;QACd,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,OAAiB,CAAC,CAAC,CAAC;QACzE,IAAI,IAAI,EAAE,CAAC;YACP,OAAO,IAAI,CAAC;QAChB,CAAC;IACL,CAAC;IACD,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC;QAChB,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAClD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,CAAC;IACvE,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IMetadataProvider, UserInfo } from '@memberjunction/core';
|
|
2
|
+
import { ActionParam } from '@memberjunction/actions-base';
|
|
3
|
+
import { ExecuteAgentResult } from '@memberjunction/ai-core-plus';
|
|
4
|
+
import type { DelegatedRunArtifact } from './realtime-tool-broker.js';
|
|
5
|
+
/**
|
|
6
|
+
* Normalized action names whose successful execution can create or mutate a visible governed artifact
|
|
7
|
+
* for the realtime call overlay. Read-only inspection/discovery actions are intentionally excluded.
|
|
8
|
+
*/
|
|
9
|
+
export declare const MUTATING_OR_CREATING_ARTIFACT_ACTION_NAMES: ReadonlySet<string>;
|
|
10
|
+
/**
|
|
11
|
+
* Extracts artifact descriptors from a direct realtime action execution only when the action
|
|
12
|
+
* succeeded and is an artifact-creating or artifact-mutating action (never on failures or read-only calls).
|
|
13
|
+
*/
|
|
14
|
+
export declare function ExtractDirectActionArtifacts(actionName: string, actionSuccess: boolean, params?: ActionParam[]): DelegatedRunArtifact[] | undefined;
|
|
15
|
+
export interface CollectDelegatedRunArtifactsParams {
|
|
16
|
+
Result: ExecuteAgentResult;
|
|
17
|
+
ContextUser: UserInfo;
|
|
18
|
+
Provider: IMetadataProvider;
|
|
19
|
+
ProcessPayloadArtifacts?: (result: ExecuteAgentResult) => Promise<{
|
|
20
|
+
artifactId: string;
|
|
21
|
+
versionId: string;
|
|
22
|
+
} | null>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Collects touched governed artifacts and non-system payload artifacts from a delegated target agent run
|
|
26
|
+
* for propagation across both server-bridged (`BaseAgent`) and client-direct (`RealtimeClientSessionService`) paths.
|
|
27
|
+
*/
|
|
28
|
+
export declare function CollectDelegatedRunArtifacts(params: CollectDelegatedRunArtifactsParams): Promise<DelegatedRunArtifact[] | undefined>;
|
|
29
|
+
/**
|
|
30
|
+
* Best-effort wrapper around {@link CollectDelegatedRunArtifacts} for realtime delegation paths:
|
|
31
|
+
* preserves `touchedArtifacts` on paused (`AwaitingFeedback`) and failed runs while skipping
|
|
32
|
+
* payload-artifact creation on incomplete runs, and logs errors without failing the delegation response.
|
|
33
|
+
*/
|
|
34
|
+
export declare function CollectDelegatedRunArtifactsSafely(params: CollectDelegatedRunArtifactsParams & {
|
|
35
|
+
logLabel: string;
|
|
36
|
+
}): Promise<DelegatedRunArtifact[] | undefined>;
|
|
37
|
+
//# sourceMappingURL=realtime-artifact-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtime-artifact-helpers.d.ts","sourceRoot":"","sources":["../../src/realtime/realtime-artifact-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAY,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,0CAA0C,EAAE,WAAW,CAAC,MAAM,CAIzE,CAAC;AAgBH;;;GAGG;AACH,wBAAgB,4BAA4B,CACxC,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,OAAO,EACtB,MAAM,CAAC,EAAE,WAAW,EAAE,GACvB,oBAAoB,EAAE,GAAG,SAAS,CA8CpC;AAED,MAAM,WAAW,kCAAkC;IAC/C,MAAM,EAAE,kBAAkB,CAAC;IAC3B,WAAW,EAAE,QAAQ,CAAC;IACtB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,uBAAuB,CAAC,EAAE,CACtB,MAAM,EAAE,kBAAkB,KACzB,OAAO,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;CAClE;AAED;;;GAGG;AACH,wBAAsB,4BAA4B,CAC9C,MAAM,EAAE,kCAAkC,GAC3C,OAAO,CAAC,oBAAoB,EAAE,GAAG,SAAS,CAAC,CAuD7C;AAED;;;;GAIG;AACH,wBAAsB,kCAAkC,CACpD,MAAM,EAAE,kCAAkC,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAClE,OAAO,CAAC,oBAAoB,EAAE,GAAG,SAAS,CAAC,CAqB7C"}
|