@descryy/runtime-identity-grounding 0.3.0 → 0.4.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/dist/element-identity.d.ts +41 -78
- package/dist/element-identity.d.ts.map +1 -1
- package/dist/element-identity.js +59 -64
- package/dist/element-identity.js.map +1 -1
- package/dist/fiber-probe.d.ts +25 -45
- package/dist/fiber-probe.d.ts.map +1 -1
- package/dist/fiber-probe.js +45 -84
- package/dist/fiber-probe.js.map +1 -1
- package/dist/graph-join.d.ts +18 -49
- package/dist/graph-join.d.ts.map +1 -1
- package/dist/graph-join.js +17 -42
- package/dist/graph-join.js.map +1 -1
- package/dist/identity-grounder.d.ts +12 -31
- package/dist/identity-grounder.d.ts.map +1 -1
- package/dist/identity-grounder.js +13 -26
- package/dist/identity-grounder.js.map +1 -1
- package/dist/identity-grounding.d.ts +20 -39
- package/dist/identity-grounding.d.ts.map +1 -1
- package/dist/identity-grounding.js +27 -44
- package/dist/identity-grounding.js.map +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -6
- package/dist/index.js.map +1 -1
- package/dist/owner-stack.d.ts +36 -65
- package/dist/owner-stack.d.ts.map +1 -1
- package/dist/owner-stack.js +33 -62
- package/dist/owner-stack.js.map +1 -1
- package/dist/vue-identity-grounder.d.ts +23 -0
- package/dist/vue-identity-grounder.d.ts.map +1 -0
- package/dist/vue-identity-grounder.js +28 -0
- package/dist/vue-identity-grounder.js.map +1 -0
- package/dist/vue-identity-grounding.d.ts +16 -0
- package/dist/vue-identity-grounding.d.ts.map +1 -0
- package/dist/vue-identity-grounding.js +110 -0
- package/dist/vue-identity-grounding.js.map +1 -0
- package/dist/vue-probe.d.ts +49 -0
- package/dist/vue-probe.d.ts.map +1 -0
- package/dist/vue-probe.js +95 -0
- package/dist/vue-probe.js.map +1 -0
- package/package.json +7 -7
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The decision layer for Vue: raw probe facts in, one `ElementIdentity` out
|
|
3
|
+
* — same contract `identity-grounding.ts`'s `groundFromProbe` holds for
|
|
4
|
+
* React, on the same output vocabulary, so a caller that already branches
|
|
5
|
+
* on `ElementIdentity.outcome` needs no second code path to consume this.
|
|
6
|
+
*
|
|
7
|
+
* Simpler than the React decision layer by construction, not by omission:
|
|
8
|
+
* Vue's runtime gives this package one fact per element (`type.__file`,
|
|
9
|
+
* file-level, no line) rather than React 18's file+line or React 19's
|
|
10
|
+
* compiled-stack-needing-resolution — there is no owner-stack equivalent to
|
|
11
|
+
* inject a resolver for, so this function takes no second argument.
|
|
12
|
+
*/
|
|
13
|
+
import { capabilityFor } from "./element-identity.js";
|
|
14
|
+
export function groundFromVueProbe(probe, selector) {
|
|
15
|
+
if (probe.status === "probe-not-installed") {
|
|
16
|
+
return {
|
|
17
|
+
outcome: "refused",
|
|
18
|
+
selector,
|
|
19
|
+
fiberDistance: 0,
|
|
20
|
+
refusal: "probe-not-installed",
|
|
21
|
+
observedTypeName: null,
|
|
22
|
+
reason: "the Vue identity-grounding reader is not present in this document. `page.addInitScript` only affects " +
|
|
23
|
+
"documents loaded after it is registered, so `install()` must be called before navigating.",
|
|
24
|
+
capability: capabilityFor("unavailable", "the page-side reader was never installed in this document; nothing was inspected."),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
if (probe.status === "element-not-found") {
|
|
28
|
+
return {
|
|
29
|
+
outcome: "refused",
|
|
30
|
+
selector,
|
|
31
|
+
fiberDistance: 0,
|
|
32
|
+
refusal: "element-not-found",
|
|
33
|
+
observedTypeName: null,
|
|
34
|
+
reason: `no element matched "${selector}" in the page's current document.`,
|
|
35
|
+
capability: capabilityFor("unavailable", "the selector matched no element; there was nothing to ground."),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (probe.status === "no-marker") {
|
|
39
|
+
return {
|
|
40
|
+
outcome: "refused",
|
|
41
|
+
selector,
|
|
42
|
+
fiberDistance: 0,
|
|
43
|
+
refusal: "vue-component-marker-absent",
|
|
44
|
+
observedTypeName: null,
|
|
45
|
+
reason: `neither the element matched by "${selector}" nor any of its ancestors carries a __vueParentComponent ` +
|
|
46
|
+
`marker (${probe.ownKeys.length === 0 ? "the element has no own enumerable keys at all" : `own keys: ${probe.ownKeys.join(", ")}`}). ` +
|
|
47
|
+
"Measured against a real Vue 3 build (fixture-apps/vue-identity): this page was not produced by Vue at " +
|
|
48
|
+
"all, OR it was produced by a Vue build where this marker was compiled out — Vue does not distinguish " +
|
|
49
|
+
"the two the way React's still-present-but-stripped production fiber does, so both readings are named " +
|
|
50
|
+
"together rather than one being guessed.",
|
|
51
|
+
capability: capabilityFor("unavailable", "no __vueParentComponent marker on the element or any ancestor."),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const { name, file } = probe.component;
|
|
55
|
+
if (name === null) {
|
|
56
|
+
return {
|
|
57
|
+
outcome: "refused",
|
|
58
|
+
selector,
|
|
59
|
+
fiberDistance: probe.componentDistance,
|
|
60
|
+
refusal: "anonymous-component",
|
|
61
|
+
observedTypeName: null,
|
|
62
|
+
reason: "a Vue component instance was found and its options object carries no `name` — an anonymous component " +
|
|
63
|
+
"definition. Refused rather than reported as nameless: there is no symbol for `resolveSymbolNode` to " +
|
|
64
|
+
"look up and no name a reader could act on.",
|
|
65
|
+
capability: capabilityFor("unavailable", "the owning component has no `name`."),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const component = { name, nameSource: "vue-options-name", kind: "vue-options" };
|
|
69
|
+
if (file === null) {
|
|
70
|
+
return {
|
|
71
|
+
outcome: "component-only",
|
|
72
|
+
selector,
|
|
73
|
+
fiberDistance: probe.componentDistance,
|
|
74
|
+
component,
|
|
75
|
+
componentSource: "vue-parent-component",
|
|
76
|
+
// Vue's instance tree carries no runtime-observable creation-vs-render
|
|
77
|
+
// split the way React's `_debugOwner` vs `return` chain does — see
|
|
78
|
+
// `COMPONENT_SOURCES`'s own doc. Never a guessed second answer.
|
|
79
|
+
renderedBy: null,
|
|
80
|
+
reason: `the component "${name}" was found and it carries no \`__file\` — either it was not compiled by a tool ` +
|
|
81
|
+
"that writes one (`@vitejs/plugin-vue`/`vue-loader`'s devtools convention), or that tool's dev-only " +
|
|
82
|
+
"annotation was stripped for this build. The component is named; its file is not.",
|
|
83
|
+
capability: capabilityFor("degraded", "no `__file` on the component's options object."),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
outcome: "grounded",
|
|
88
|
+
selector,
|
|
89
|
+
fiberDistance: probe.componentDistance,
|
|
90
|
+
component,
|
|
91
|
+
componentSource: "vue-parent-component",
|
|
92
|
+
renderedBy: null,
|
|
93
|
+
sourceLocation: {
|
|
94
|
+
file,
|
|
95
|
+
// Vue's runtime records no creation line anywhere this package can
|
|
96
|
+
// read — not a missed case, the real ceiling of what `__file` alone
|
|
97
|
+
// can answer. See `vue-options-file`'s own doc.
|
|
98
|
+
line: null,
|
|
99
|
+
column: null,
|
|
100
|
+
functionName: name,
|
|
101
|
+
reliability: "self-contained",
|
|
102
|
+
resolvedVia: null,
|
|
103
|
+
},
|
|
104
|
+
authoredSource: true,
|
|
105
|
+
mechanism: "vue-options-file",
|
|
106
|
+
capability: capabilityFor("degraded", "`__file` named the authored file, but Vue's runtime records no creation line to pair with it, so the " +
|
|
107
|
+
"answer is file-level rather than line-level."),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=vue-identity-grounding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue-identity-grounding.js","sourceRoot":"","sources":["../src/vue-identity-grounding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,aAAa,EAAgD,MAAM,uBAAuB,CAAC;AAGpG,MAAM,UAAU,kBAAkB,CAAC,KAAkB,EAAE,QAAgB;IACrE,IAAI,KAAK,CAAC,MAAM,KAAK,qBAAqB,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|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The page-side half of Vue support: reads the marker Vue itself puts on a
|
|
3
|
+
* DOM node and returns **raw facts only** — same discipline as
|
|
4
|
+
* `fiber-probe.ts`, and deliberately a separate module rather than a branch
|
|
5
|
+
* inside it, so the React reader's own tests and this one never share a
|
|
6
|
+
* probe function that could silently start doing both jobs at once.
|
|
7
|
+
*
|
|
8
|
+
* `el.__vueParentComponent` is Vue 3's own internal marker, set when the
|
|
9
|
+
* element is mounted — measured (see `fixture-apps/vue-identity`) present
|
|
10
|
+
* on an unminified dev-mode bundle and **absent entirely** on a minified
|
|
11
|
+
* bundle with devtools support compiled out. That is a real difference from
|
|
12
|
+
* React: a React production fiber is still there, just stripped of
|
|
13
|
+
* `_debug*` fields, so "no fiber" and "production build" are
|
|
14
|
+
* distinguishable there. Here they are not — see
|
|
15
|
+
* `vue-component-marker-absent`'s own doc in `element-identity.ts`.
|
|
16
|
+
*
|
|
17
|
+
* Injected the same way `fiber-probe.ts` is: `page.addInitScript` with a
|
|
18
|
+
* string body (no DOM lib in this repo's `tsconfig.base.json`), installed
|
|
19
|
+
* before the first navigation or the page reports `probe-not-installed`.
|
|
20
|
+
*/
|
|
21
|
+
import type { Page } from "playwright-core";
|
|
22
|
+
export declare const VUE_IDENTITY_GROUNDING_BINDING = "__descryVueIdentityGrounding";
|
|
23
|
+
export interface RawVueComponentDescriptor {
|
|
24
|
+
readonly name: string | null;
|
|
25
|
+
/** `type.__file`, verbatim — the marker `@vitejs/plugin-vue`/`vue-loader` write for their own "open in editor" devtools feature. Null when the options object carries none. */
|
|
26
|
+
readonly file: string | null;
|
|
27
|
+
}
|
|
28
|
+
export type RawVueProbe = {
|
|
29
|
+
readonly status: "probe-not-installed";
|
|
30
|
+
} | {
|
|
31
|
+
readonly status: "element-not-found";
|
|
32
|
+
readonly selector: string;
|
|
33
|
+
} | {
|
|
34
|
+
readonly status: "no-marker";
|
|
35
|
+
readonly selector: string;
|
|
36
|
+
/** Capped own-keys list, same audit purpose `fiber-probe.ts`'s carries. */
|
|
37
|
+
readonly ownKeys: readonly string[];
|
|
38
|
+
} | {
|
|
39
|
+
readonly status: "component";
|
|
40
|
+
readonly selector: string;
|
|
41
|
+
readonly componentDistance: number;
|
|
42
|
+
readonly component: RawVueComponentDescriptor;
|
|
43
|
+
};
|
|
44
|
+
export interface VueIdentityGroundingProbe {
|
|
45
|
+
install(page: Page): Promise<void>;
|
|
46
|
+
probe(page: Page, selector: string): Promise<RawVueProbe>;
|
|
47
|
+
}
|
|
48
|
+
export declare function createVueIdentityGroundingProbe(): VueIdentityGroundingProbe;
|
|
49
|
+
//# sourceMappingURL=vue-probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue-probe.d.ts","sourceRoot":"","sources":["../src/vue-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,eAAO,MAAM,8BAA8B,iCAAiC,CAAC;AAE7E,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,+KAA+K;IAC/K,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAA;CAAE,GAC1C;IAAE,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACnE;IACE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC,GACD;IACE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,yBAAyB,CAAC;CAC/C,CAAC;AAEN,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CAC3D;AAED,wBAAgB,+BAA+B,IAAI,yBAAyB,CAS3E"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The page-side half of Vue support: reads the marker Vue itself puts on a
|
|
3
|
+
* DOM node and returns **raw facts only** — same discipline as
|
|
4
|
+
* `fiber-probe.ts`, and deliberately a separate module rather than a branch
|
|
5
|
+
* inside it, so the React reader's own tests and this one never share a
|
|
6
|
+
* probe function that could silently start doing both jobs at once.
|
|
7
|
+
*
|
|
8
|
+
* `el.__vueParentComponent` is Vue 3's own internal marker, set when the
|
|
9
|
+
* element is mounted — measured (see `fixture-apps/vue-identity`) present
|
|
10
|
+
* on an unminified dev-mode bundle and **absent entirely** on a minified
|
|
11
|
+
* bundle with devtools support compiled out. That is a real difference from
|
|
12
|
+
* React: a React production fiber is still there, just stripped of
|
|
13
|
+
* `_debug*` fields, so "no fiber" and "production build" are
|
|
14
|
+
* distinguishable there. Here they are not — see
|
|
15
|
+
* `vue-component-marker-absent`'s own doc in `element-identity.ts`.
|
|
16
|
+
*
|
|
17
|
+
* Injected the same way `fiber-probe.ts` is: `page.addInitScript` with a
|
|
18
|
+
* string body (no DOM lib in this repo's `tsconfig.base.json`), installed
|
|
19
|
+
* before the first navigation or the page reports `probe-not-installed`.
|
|
20
|
+
*/
|
|
21
|
+
export const VUE_IDENTITY_GROUNDING_BINDING = "__descryVueIdentityGrounding";
|
|
22
|
+
export function createVueIdentityGroundingProbe() {
|
|
23
|
+
return {
|
|
24
|
+
async install(page) {
|
|
25
|
+
await page.addInitScript({ content: probeScriptSource() });
|
|
26
|
+
},
|
|
27
|
+
probe(page, selector) {
|
|
28
|
+
return page.evaluate(probeCallSource(selector));
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** Self-invoking, selector serialised in — same reasoning as `fiber-probe.ts`'s `probeCallSource`. */
|
|
33
|
+
function probeCallSource(selector) {
|
|
34
|
+
return `(() => {
|
|
35
|
+
const grounding = window[${JSON.stringify(VUE_IDENTITY_GROUNDING_BINDING)}];
|
|
36
|
+
if (grounding === undefined || typeof grounding.probe !== "function") {
|
|
37
|
+
return { status: "probe-not-installed" };
|
|
38
|
+
}
|
|
39
|
+
return grounding.probe(${JSON.stringify(selector)});
|
|
40
|
+
})()`;
|
|
41
|
+
}
|
|
42
|
+
/** Cap on the reported own-keys list — same bound `fiber-probe.ts` uses, same reason. */
|
|
43
|
+
const MAX_REPORTED_OWN_KEYS = 32;
|
|
44
|
+
function probeScriptSource() {
|
|
45
|
+
return `(() => {
|
|
46
|
+
function describeInstance(instance) {
|
|
47
|
+
const type = instance && instance.type;
|
|
48
|
+
if (type === null || type === undefined) return { name: null, file: null };
|
|
49
|
+
return {
|
|
50
|
+
name: typeof type.name === "string" && type.name.length > 0 ? type.name : null,
|
|
51
|
+
file: typeof type.__file === "string" && type.__file.length > 0 ? type.__file : null,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
window[${JSON.stringify(VUE_IDENTITY_GROUNDING_BINDING)}] = {
|
|
56
|
+
probe: function (selector) {
|
|
57
|
+
let element;
|
|
58
|
+
try {
|
|
59
|
+
element = document.querySelector(selector);
|
|
60
|
+
} catch (_error) {
|
|
61
|
+
return { status: "element-not-found", selector: selector };
|
|
62
|
+
}
|
|
63
|
+
if (element === null) return { status: "element-not-found", selector: selector };
|
|
64
|
+
|
|
65
|
+
let node = element;
|
|
66
|
+
let distance = 0;
|
|
67
|
+
let instance = null;
|
|
68
|
+
while (node !== null && node !== undefined) {
|
|
69
|
+
if (node.__vueParentComponent !== undefined && node.__vueParentComponent !== null) {
|
|
70
|
+
instance = node.__vueParentComponent;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
node = node.parentElement;
|
|
74
|
+
distance++;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (instance === null) {
|
|
78
|
+
return {
|
|
79
|
+
status: "no-marker",
|
|
80
|
+
selector: selector,
|
|
81
|
+
ownKeys: Object.keys(element).slice(0, ${MAX_REPORTED_OWN_KEYS}),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
status: "component",
|
|
87
|
+
selector: selector,
|
|
88
|
+
componentDistance: distance,
|
|
89
|
+
component: describeInstance(instance),
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
})();`;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=vue-probe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue-probe.js","sourceRoot":"","sources":["../src/vue-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,MAAM,CAAC,MAAM,8BAA8B,GAAG,8BAA8B,CAAC;AA6B7E,MAAM,UAAU,+BAA+B;IAC7C,OAAO;QACL,KAAK,CAAC,OAAO,CAAC,IAAU;YACtB,MAAM,IAAI,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,CAAC,CAAC;QAC7D,CAAC;QACD,KAAK,CAAC,IAAU,EAAE,QAAgB;YAChC,OAAO,IAAI,CAAC,QAAQ,CAAc,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC/D,CAAC;KACF,CAAC;AACJ,CAAC;AAED,sGAAsG;AACtG,SAAS,eAAe,CAAC,QAAgB;IACvC,OAAO;6BACoB,IAAI,CAAC,SAAS,CAAC,8BAA8B,CAAC;;;;2BAIhD,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;KAC9C,CAAC;AACN,CAAC;AAED,yFAAyF;AACzF,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,SAAS,iBAAiB;IACxB,OAAO;;;;;;;;;;WAUE,IAAI,CAAC,SAAS,CAAC,8BAA8B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;mDA0BN,qBAAqB;;;;;;;;;;;;MAYlE,CAAC;AACP,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@descryy/runtime-identity-grounding",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Identity grounding: resolves an on-screen DOM element back to the React component that produced it, and to that component's authored file and line. Injects through @descryy/runtime-browser's existing page.addInitScript seam; refuses by name on a production
|
|
5
|
+
"description": "Identity grounding: resolves an on-screen DOM element back to the React or Vue component that produced it, and to that component's authored file (and, for React, line). createFrameworkAwareGrounder detects which framework actually rendered the page (React's fiber marker, then Vue's component marker, else a named refusal) and grounds through the matching mechanism -- never a default to React. Injects through @descryy/runtime-browser's existing page.addInitScript seam; refuses by name on a production build rather than guessing. Consumed by descry-core's @descryy/mcp (packages/mcp/src/browser/playwright-driver.ts) and descry-desktop's @descry/session (packages/session/src/pipeline/browser-drive.ts).",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=22.5"
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"build": "tsc -b"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@descryy/runtime-contracts": "0.
|
|
28
|
-
"@descryy/runtime-adapter-typescript": "0.
|
|
29
|
-
"@descryy/runtime-browser": "0.
|
|
27
|
+
"@descryy/runtime-contracts": "0.3.3",
|
|
28
|
+
"@descryy/runtime-adapter-typescript": "0.3.4",
|
|
29
|
+
"@descryy/runtime-browser": "0.4.5",
|
|
30
30
|
"playwright-core": "^1.62.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@descryy/runtime-graph-correlator": "
|
|
34
|
-
"@descryy/runtime-controller": "
|
|
33
|
+
"@descryy/runtime-graph-correlator": "0.4.5",
|
|
34
|
+
"@descryy/runtime-controller": "0.3.4"
|
|
35
35
|
}
|
|
36
36
|
}
|