@qontinui/ui-bridge-wrapper 0.4.1 → 0.5.0
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 +12 -4
- package/dist/capture-specs-cli.cjs +56 -26
- package/dist/capture-specs-cli.cjs.map +1 -1
- package/dist/cli-args.d.ts +11 -1
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/index.cjs +43 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +43 -16
- package/dist/index.js.map +1 -1
- package/dist/inject-cli.cjs +145 -29
- package/dist/inject-cli.cjs.map +1 -1
- package/dist/inject-cli.d.ts +29 -1
- package/dist/inject-cli.d.ts.map +1 -1
- package/dist/login-drive.d.ts.map +1 -1
- package/dist/login-web-cli.cjs +184 -34
- package/dist/login-web-cli.cjs.map +1 -1
- package/dist/login-web-cli.d.ts +5 -1
- package/dist/login-web-cli.d.ts.map +1 -1
- package/dist/react/index.cjs +4 -4
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +4 -4
- package/dist/react/index.js.map +1 -1
- package/dist/session-storage-capture.d.ts +78 -0
- package/dist/session-storage-capture.d.ts.map +1 -0
- package/dist/transports/headless.d.ts +16 -0
- package/dist/transports/headless.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/login-web-cli.d.ts
CHANGED
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
* The arg parsing, validation, and URL classifiers are exported pure functions
|
|
51
51
|
* so they can be unit-tested without spawning a browser or calling `main()`.
|
|
52
52
|
*/
|
|
53
|
-
export declare const USAGE = "ui-bridge-login-web \u2014 automated web login via the UI Bridge injected transport\n\nRequired (one of):\n --email <e> / --password <p> Credentials. Falls back to env\n UIB_LOGIN_EMAIL / UIB_LOGIN_PASSWORD.\n\nOptions:\n --url <pageUrl> App login URL (default https://qontinui.io/login).\n Prefer a ?next=<urlencoded-path> form so the\n authed landing is deterministic.\n --success <pathSubstring> Pathname substring the authed landing must\n contain (default /dashboard). Matched against the\n PATHNAME only \u2014 query/fragment excluded.\n --timeout <ms> Per-redirect-hop wait budget (default 60000).\n --headed Launch a visible window (default headless).\n --post-login-click <css> Click this selector ONCE on the authed landing\n (e.g. [data-testid='co-pilot-consent-allow']).\n Non-fatal when the target never appears.\n --expect-text <comma-list> Assert the authed page's body text contains EVERY\n comma-separated entry. Missing entries fail the\n exit code; the result JSON lists expectFound /\n expectMissing. Matched case-sensitively.\n --scroll-to <text> Before screenshotting, scroll the first element\n containing this text into view (non-fatal if absent).\n --screenshot <path> Write a full-page PNG of the authed landing to\n <path> (captured BEFORE the --expect-text check, so\n a failing assertion still leaves a diagnostic image).\n --keep-open On success, park the authed session until SIGINT/\n SIGTERM instead of closing the browser.\n --quiet Suppress human-readable stderr logs (the JSON\n result line still prints).\n --help, -h Print this help and exit.\n\nPrerequisites (packaged bin): the optional @qontinui/ui-bridge-headless peer must\nbe installed AND Chromium available (run `npx playwright install chromium` once,\nor set PLAYWRIGHT_BROWSERS_PATH). Git Bash callers: prefix MSYS_NO_PATHCONV=1 so\na leading-slash --success value is not rewritten into a Windows path.\n\nExamples:\n ui-bridge-login-web --url \"https://qontinui.io/login?next=%2Fbuild%2Fworkflows\" \\\n --success /build/workflows\n ui-bridge-login-web --url \"https://qontinui.io/login?next=%2Fco-pilot\" \\\n --success /co-pilot --post-login-click \"[data-testid='co-pilot-consent-allow']\" --keep-open\n ui-bridge-login-web --url \"https://qontinui.io/login?next=%2Foperations\" \\\n --success /operations --expect-text \"option2-actions-outage-drill,metric_threshold\" \\\n --screenshot out.png\n";
|
|
53
|
+
export declare const USAGE = "ui-bridge-login-web \u2014 automated web login via the UI Bridge injected transport\n\nRequired (one of):\n --email <e> / --password <p> Credentials. Falls back to env\n UIB_LOGIN_EMAIL / UIB_LOGIN_PASSWORD.\n\nOptions:\n --url <pageUrl> App login URL (default https://qontinui.io/login).\n Prefer a ?next=<urlencoded-path> form so the\n authed landing is deterministic.\n --success <pathSubstring> Pathname substring the authed landing must\n contain (default /dashboard). Matched against the\n PATHNAME only \u2014 query/fragment excluded.\n --timeout <ms> Per-redirect-hop wait budget (default 60000).\n --headed Launch a visible window (default headless).\n --post-login-click <css> Click this selector ONCE on the authed landing\n (e.g. [data-testid='co-pilot-consent-allow']).\n Non-fatal when the target never appears.\n --expect-text <comma-list> Assert the authed page's body text contains EVERY\n comma-separated entry. Missing entries fail the\n exit code; the result JSON lists expectFound /\n expectMissing. Matched case-sensitively.\n --scroll-to <text> Before screenshotting, scroll the first element\n containing this text into view (non-fatal if absent).\n --screenshot <path> Write a full-page PNG of the authed landing to\n <path> (captured BEFORE the --expect-text check, so\n a failing assertion still leaves a diagnostic image).\n --storage-state-out <path> On a confirmed-authed landing, write a Playwright\n storageState JSON (cookies + localStorage) to <path>,\n PLUS a custom __sessionStorage key (origin \u2192 kv) so\n cold replays land authed on apps that keep their\n token in sessionStorage (e.g. qontinui-web).\n Feed it to 'ui-bridge-inject --storage-state <path>'\n to drive a login-walled page MANY times without\n re-driving the hosted-UI login each run.\n --keep-open On success, park the authed session until SIGINT/\n SIGTERM instead of closing the browser.\n --quiet Suppress human-readable stderr logs (the JSON\n result line still prints).\n --help, -h Print this help and exit.\n\nPrerequisites (packaged bin): the optional @qontinui/ui-bridge-headless peer must\nbe installed AND Chromium available (run `npx playwright install chromium` once,\nor set PLAYWRIGHT_BROWSERS_PATH). Git Bash callers: prefix MSYS_NO_PATHCONV=1 so\na leading-slash --success value is not rewritten into a Windows path.\n\nExamples:\n ui-bridge-login-web --url \"https://qontinui.io/login?next=%2Fbuild%2Fworkflows\" \\\n --success /build/workflows\n ui-bridge-login-web --url \"https://qontinui.io/login?next=%2Fco-pilot\" \\\n --success /co-pilot --post-login-click \"[data-testid='co-pilot-consent-allow']\" --keep-open\n ui-bridge-login-web --url \"https://qontinui.io/login?next=%2Foperations\" \\\n --success /operations --expect-text \"option2-actions-outage-drill,metric_threshold\" \\\n --screenshot out.png\n # Capture a reusable auth artifact, then drive a login-walled page with it:\n ui-bridge-login-web --url \"https://qontinui.io/login?next=%2Fadmin%2Fcoord%2Fonboarding\" \\\n --success /admin/coord/onboarding --storage-state-out auth.json\n ui-bridge-inject --url https://qontinui.io/admin/coord/onboarding \\\n --storage-state auth.json --exec 'getControlSnapshot {}'\n";
|
|
54
54
|
/** Parsed, validated CLI arguments. */
|
|
55
55
|
export interface LoginCliArgs {
|
|
56
56
|
url: string;
|
|
@@ -68,6 +68,8 @@ export interface LoginCliArgs {
|
|
|
68
68
|
scrollToText: string | null;
|
|
69
69
|
/** Optional path to write a full-page screenshot of the authed landing. */
|
|
70
70
|
screenshotPath: string | null;
|
|
71
|
+
/** Optional path to write a Playwright storageState JSON of the authed context. */
|
|
72
|
+
storageStateOut: string | null;
|
|
71
73
|
keepOpen: boolean;
|
|
72
74
|
/** Suppress human-readable stderr logs (the JSON result line still prints). */
|
|
73
75
|
quiet: boolean;
|
|
@@ -105,6 +107,8 @@ export interface LoginResult {
|
|
|
105
107
|
expectMissing?: string[];
|
|
106
108
|
/** Path the screenshot was written to, or null (present only when --screenshot was given). */
|
|
107
109
|
screenshotPath?: string | null;
|
|
110
|
+
/** Path the storageState artifact was written to, or null (present only when --storage-state-out was given). */
|
|
111
|
+
storageStatePath?: string | null;
|
|
108
112
|
error?: string;
|
|
109
113
|
}
|
|
110
114
|
//# sourceMappingURL=login-web-cli.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-web-cli.d.ts","sourceRoot":"","sources":["../src/login-web-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;
|
|
1
|
+
{"version":3,"file":"login-web-cli.d.ts","sourceRoot":"","sources":["../src/login-web-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAqBH,eAAO,MAAM,KAAK,khIA2DjB,CAAC;AAEF,uCAAuC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,gBAAgB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,sGAAsG;IACtG,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,sEAAsE;IACtE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,8FAA8F;IAC9F,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gHAAgH;IAChH,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
package/dist/react/index.cjs
CHANGED
|
@@ -44,16 +44,16 @@ var DEFAULT_ALLOWED = ["api", "headless", "headed", "live"];
|
|
|
44
44
|
function useTransportSelector(options = {}) {
|
|
45
45
|
const allowed = options.allowedKinds ?? DEFAULT_ALLOWED;
|
|
46
46
|
const initial = options.initialKind ?? allowed[0] ?? "api";
|
|
47
|
-
const [kind,
|
|
48
|
-
const
|
|
47
|
+
const [kind, setKind] = react.useState(initial);
|
|
48
|
+
const selectKind = react.useCallback(
|
|
49
49
|
(next) => {
|
|
50
50
|
if (!allowed.includes(next)) return;
|
|
51
|
-
|
|
51
|
+
setKind(next);
|
|
52
52
|
options.onChange?.(next);
|
|
53
53
|
},
|
|
54
54
|
[allowed, options]
|
|
55
55
|
);
|
|
56
|
-
return { kind, setKind, allowedKinds: allowed };
|
|
56
|
+
return { kind, setKind: selectKind, allowedKinds: allowed };
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
exports.WrapperAppShell = WrapperAppShell;
|
package/dist/react/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/useWrapperStatus.ts","../../src/react/WrapperAppShell.tsx","../../src/react/useTransportSelector.ts"],"names":["useSyncExternalStore","jsxs","jsx","useState","useCallback"],"mappings":";;;;;;AAYO,SAAS,iBAAiB,SAAA,EAAqD;AACpF,EAAA,OAAOA,0BAAA;AAAA,IACL,CAAC,aAAA,KAAkB,SAAA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KACF;AAAA,oBACAA,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,aAAA,IAAiB,gCAAiC,QAAA,EAAS;AAAA,GAAA,EAC9E,CAAA;AAEJ;ACpBA,IAAM,eAAA,GAAmD,CAAC,KAAA,EAAO,UAAA,EAAY,UAAU,MAAM,CAAA;AAEtF,SAAS,oBAAA,CACd,OAAA,GAAuC,EAAC,EACZ;AAC5B,EAAA,MAAM,OAAA,GAAU,QAAQ,YAAA,IAAgB,eAAA;AACxC,EAAA,MAAM,OAAA,GAAU,OAAA,CAAQ,WAAA,IAAe,OAAA,CAAQ,CAAC,CAAA,IAAK,KAAA;AACrD,EAAA,MAAM,CAAC,IAAA,EAAM,
|
|
1
|
+
{"version":3,"sources":["../../src/react/useWrapperStatus.ts","../../src/react/WrapperAppShell.tsx","../../src/react/useTransportSelector.ts"],"names":["useSyncExternalStore","jsxs","jsx","useState","useCallback"],"mappings":";;;;;;AAYO,SAAS,iBAAiB,SAAA,EAAqD;AACpF,EAAA,OAAOA,0BAAA;AAAA,IACL,CAAC,aAAA,KAAkB,SAAA,CAAU,cAAA,CAAe,MAAM,eAAe,CAAA;AAAA,IACjE,MAAM,SAAA,CAAU,MAAA;AAAA,IAChB,MAAM,SAAA,CAAU;AAAA,GAClB;AACF;ACSO,SAAS,gBAAgB,KAAA,EAA2C;AACzE,EAAA,MAAM,EAAE,SAAA,EAAW,KAAA,EAAO,QAAA,EAAU,eAAA,EAAiB,eAAc,GAAI,KAAA;AACvE,EAAA,MAAM,MAAA,GAAS,iBAAiB,SAAS,CAAA;AAEzC,EAAA,uBACEC,eAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,wBAAA,EAAyB,eAAa,MAAA,EACnD,QAAA,EAAA;AAAA,oBAAAA,eAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,WAAW,eAAA,IAAmB,gCAAA;AAAA,QAC9B,KAAA,EAAO;AAAA,UACL,OAAA,EAAS,MAAA;AAAA,UACT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MAAA,IAAI,CAAC,OAAA,CAAQ,QAAA,CAAS,IAAI,CAAA,EAAG;AAC7B,MAAA,OAAA,CAAQ,IAAI,CAAA;AACZ,MAAA,OAAA,CAAQ,WAAW,IAAI,CAAA;AAAA,IACzB,CAAA;AAAA,IACA,CAAC,SAAS,OAAO;AAAA,GACnB;AAEA,EAAA,OAAO,EAAE,IAAA,EAAM,OAAA,EAAS,UAAA,EAAY,cAAc,OAAA,EAAQ;AAC5D","file":"index.cjs","sourcesContent":["/**\n * `useWrapperStatus`\n *\n * Subscribe to a transport's status transitions. Returns the current\n * status string; re-renders whenever the transport fires `onStatusChange`.\n * Uses `useSyncExternalStore` for tearing-free updates under React 18+\n * concurrent rendering.\n */\n\nimport { useSyncExternalStore } from 'react';\nimport type { WrapperTransport, WrapperTransportStatus } from '../types.js';\n\nexport function useWrapperStatus(transport: WrapperTransport): WrapperTransportStatus {\n return useSyncExternalStore(\n (onStoreChange) => transport.onStatusChange(() => onStoreChange()),\n () => transport.status,\n () => transport.status\n );\n}\n","/**\n * `WrapperAppShell`\n *\n * Very small default chrome for wrapper apps — shows the wrapper title, the\n * transport kind, and the current status. Designed to be rendered by a\n * wrapper's root React component; wrappers that want richer chrome should\n * skip this and build their own.\n *\n * Intentionally unstyled (inline minimal styles only) so a wrapper's\n * stylesheet can target the class names.\n */\n\nimport type { ReactElement, ReactNode } from 'react';\nimport type { WrapperTransport } from '../types.js';\nimport { useWrapperStatus } from './useWrapperStatus.js';\n\nexport interface WrapperAppShellProps {\n transport: WrapperTransport;\n title: string;\n /** Optional child content rendered inside `<main>`. */\n children?: ReactNode;\n /** Override the header class name. */\n headerClassName?: string;\n /** Override the main class name. */\n mainClassName?: string;\n}\n\nexport function WrapperAppShell(props: WrapperAppShellProps): ReactElement {\n const { transport, title, children, headerClassName, mainClassName } = props;\n const status = useWrapperStatus(transport);\n\n return (\n <div className=\"qontinui-wrapper-shell\" data-status={status}>\n <header\n className={headerClassName ?? 'qontinui-wrapper-shell__header'}\n style={{\n display: 'flex',\n alignItems: 'baseline',\n gap: '0.75rem',\n padding: '0.5rem 1rem',\n borderBottom: '1px solid rgba(0,0,0,0.1)',\n }}\n >\n <h1 className=\"qontinui-wrapper-shell__title\" style={{ fontSize: '1rem', margin: 0 }}>\n {title}\n </h1>\n <span className=\"qontinui-wrapper-shell__meta\" style={{ fontSize: '0.8rem', opacity: 0.7 }}>\n transport: <code>{transport.kind}</code> · status: <code>{status}</code>\n </span>\n </header>\n <main className={mainClassName ?? 'qontinui-wrapper-shell__main'}>{children}</main>\n </div>\n );\n}\n","/**\n * `useTransportSelector`\n *\n * Small `useState`-backed selector for wrapper UIs that let users flip\n * between transport kinds at runtime (e.g. a \"Run in headless / headed /\n * via runner\" toggle on a wrapper's launch screen).\n *\n * Not tied to any transport instance — this is purely UI state. The\n * consumer is responsible for recreating the transport with the new kind\n * when the value changes.\n */\n\nimport { useCallback, useState } from 'react';\nimport type { WrapperTransportKind } from '../types.js';\n\nexport interface UseTransportSelectorOptions {\n /** Initial kind. Defaults to `\"api\"`. */\n initialKind?: WrapperTransportKind;\n /**\n * Restrict the selectable kinds. Default = all four. Useful when a\n * wrapper can't support one (e.g. pure-api wrappers hiding headless).\n */\n allowedKinds?: readonly WrapperTransportKind[];\n /** Callback fired whenever the kind changes. */\n onChange?: (kind: WrapperTransportKind) => void;\n}\n\nexport interface UseTransportSelectorReturn {\n kind: WrapperTransportKind;\n setKind: (next: WrapperTransportKind) => void;\n allowedKinds: readonly WrapperTransportKind[];\n}\n\nconst DEFAULT_ALLOWED: readonly WrapperTransportKind[] = ['api', 'headless', 'headed', 'live'];\n\nexport function useTransportSelector(\n options: UseTransportSelectorOptions = {}\n): UseTransportSelectorReturn {\n const allowed = options.allowedKinds ?? DEFAULT_ALLOWED;\n const initial = options.initialKind ?? allowed[0] ?? 'api';\n const [kind, setKind] = useState<WrapperTransportKind>(initial);\n\n const selectKind = useCallback(\n (next: WrapperTransportKind) => {\n if (!allowed.includes(next)) return;\n setKind(next);\n options.onChange?.(next);\n },\n [allowed, options]\n );\n\n return { kind, setKind: selectKind, allowedKinds: allowed };\n}\n"]}
|
package/dist/react/index.js
CHANGED
|
@@ -42,16 +42,16 @@ var DEFAULT_ALLOWED = ["api", "headless", "headed", "live"];
|
|
|
42
42
|
function useTransportSelector(options = {}) {
|
|
43
43
|
const allowed = options.allowedKinds ?? DEFAULT_ALLOWED;
|
|
44
44
|
const initial = options.initialKind ?? allowed[0] ?? "api";
|
|
45
|
-
const [kind,
|
|
46
|
-
const
|
|
45
|
+
const [kind, setKind] = useState(initial);
|
|
46
|
+
const selectKind = useCallback(
|
|
47
47
|
(next) => {
|
|
48
48
|
if (!allowed.includes(next)) return;
|
|
49
|
-
|
|
49
|
+
setKind(next);
|
|
50
50
|
options.onChange?.(next);
|
|
51
51
|
},
|
|
52
52
|
[allowed, options]
|
|
53
53
|
);
|
|
54
|
-
return { kind, setKind, allowedKinds: allowed };
|
|
54
|
+
return { kind, setKind: selectKind, allowedKinds: allowed };
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
export { WrapperAppShell, useTransportSelector, useWrapperStatus };
|
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/useWrapperStatus.ts","../../src/react/WrapperAppShell.tsx","../../src/react/useTransportSelector.ts"],"names":[],"mappings":";;;;AAYO,SAAS,iBAAiB,SAAA,EAAqD;AACpF,EAAA,OAAO,oBAAA;AAAA,IACL,CAAC,aAAA,KAAkB,SAAA,CAAU,cAAA,CAAe,MAAM,eAAe,CAAA;AAAA,IACjE,MAAM,SAAA,CAAU,MAAA;AAAA,IAChB,MAAM,SAAA,CAAU;AAAA,GAClB;AACF;ACSO,SAAS,gBAAgB,KAAA,EAA2C;AACzE,EAAA,MAAM,EAAE,SAAA,EAAW,KAAA,EAAO,QAAA,EAAU,eAAA,EAAiB,eAAc,GAAI,KAAA;AACvE,EAAA,MAAM,MAAA,GAAS,iBAAiB,SAAS,C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gB,eAAA;AACxC,EAAA,MAAM,OAAA,GAAU,OAAA,CAAQ,WAAA,IAAe,OAAA,CAAQ,CAAC,CAAA,IAAK,KAAA;AACrD,EAAA,MAAM,CAAC,IAAA,EAAM,
|
|
1
|
+
{"version":3,"sources":["../../src/react/useWrapperStatus.ts","../../src/react/WrapperAppShell.tsx","../../src/react/useTransportSelector.ts"],"names":[],"mappings":";;;;AAYO,SAAS,iBAAiB,SAAA,EAAqD;AACpF,EAAA,OAAO,oBAAA;AAAA,IACL,CAAC,aAAA,KAAkB,SAAA,CAAU,cAAA,CAAe,MAAM,eAAe,CAAA;AAAA,IACjE,MAAM,SAAA,CAAU,MAAA;AAAA,IAChB,MAAM,SAAA,CAAU;AAAA,GAClB;AACF;ACSO,SAAS,gBAAgB,KAAA,EAA2C;AACzE,EAAA,MAAM,EAAE,SAAA,EAAW,KAAA,EAAO,QAAA,EAAU,eAAA,EAAiB,eAAc,GAAI,KAAA;AACvE,EAAA,MAAM,MAAA,GAAS,iBAAiB,SAAS,CAAA;AAEzC,EAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,wBAAA,EAAyB,eAAa,MAAA,EACnD,QAAA,EAAA;AAAA,oBAAA,IAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,WAAW,eAAA,IAAmB,gCAAA;AAAA,QAC9B,KAAA,EAAO;AAAA,UACL,OAAA,EAAS,MAAA;AAAA,UACT,UAAA,EAAY,UAAA;AAAA,UACZ,GAAA,EAAK,SAAA;AAAA,UACL,OAAA,EAAS,aAAA;AAAA,UACT,YAAA,EAAc;AAAA,SAChB;AAAA,QAEA,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,+BAAA,EAAgC,KAAA,EAAO,EAAE,UAAU,MAAA,EAAQ,MAAA,EAAQ,CAAA,EAAE,EAChF,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,0BACA,IAAA,CAAC,MAAA,EAA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ions. Returns the current\n * status string; re-renders whenever the transport fires `onStatusChange`.\n * Uses `useSyncExternalStore` for tearing-free updates under React 18+\n * concurrent rendering.\n */\n\nimport { useSyncExternalStore } from 'react';\nimport type { WrapperTransport, WrapperTransportStatus } from '../types.js';\n\nexport function useWrapperStatus(transport: WrapperTransport): WrapperTransportStatus {\n return useSyncExternalStore(\n (onStoreChange) => transport.onStatusChange(() => onStoreChange()),\n () => transport.status,\n () => transport.status\n );\n}\n","/**\n * `WrapperAppShell`\n *\n * Very small default chrome for wrapper apps — shows the wrapper title, the\n * transport kind, and the current status. Designed to be rendered by a\n * wrapper's root React component; wrappers that want richer chrome should\n * skip this and build their own.\n *\n * Intentionally unstyled (inline minimal styles only) so a wrapper's\n * stylesheet can target the class names.\n */\n\nimport type { ReactElement, ReactNode } from 'react';\nimport type { WrapperTransport } from '../types.js';\nimport { useWrapperStatus } from './useWrapperStatus.js';\n\nexport interface WrapperAppShellProps {\n transport: WrapperTransport;\n title: string;\n /** Optional child content rendered inside `<main>`. */\n children?: ReactNode;\n /** Override the header class name. */\n headerClassName?: string;\n /** Override the main class name. */\n mainClassName?: string;\n}\n\nexport function WrapperAppShell(props: WrapperAppShellProps): ReactElement {\n const { transport, title, children, headerClassName, mainClassName } = props;\n const status = useWrapperStatus(transport);\n\n return (\n <div className=\"qontinui-wrapper-shell\" data-status={status}>\n <header\n className={headerClassName ?? 'qontinui-wrapper-shell__header'}\n style={{\n display: 'flex',\n alignItems: 'baseline',\n gap: '0.75rem',\n padding: '0.5rem 1rem',\n borderBottom: '1px solid rgba(0,0,0,0.1)',\n }}\n >\n <h1 className=\"qontinui-wrapper-shell__title\" style={{ fontSize: '1rem', margin: 0 }}>\n {title}\n </h1>\n <span className=\"qontinui-wrapper-shell__meta\" style={{ fontSize: '0.8rem', opacity: 0.7 }}>\n transport: <code>{transport.kind}</code> · status: <code>{status}</code>\n </span>\n </header>\n <main className={mainClassName ?? 'qontinui-wrapper-shell__main'}>{children}</main>\n </div>\n );\n}\n","/**\n * `useTransportSelector`\n *\n * Small `useState`-backed selector for wrapper UIs that let users flip\n * between transport kinds at runtime (e.g. a \"Run in headless / headed /\n * via runner\" toggle on a wrapper's launch screen).\n *\n * Not tied to any transport instance — this is purely UI state. The\n * consumer is responsible for recreating the transport with the new kind\n * when the value changes.\n */\n\nimport { useCallback, useState } from 'react';\nimport type { WrapperTransportKind } from '../types.js';\n\nexport interface UseTransportSelectorOptions {\n /** Initial kind. Defaults to `\"api\"`. */\n initialKind?: WrapperTransportKind;\n /**\n * Restrict the selectable kinds. Default = all four. Useful when a\n * wrapper can't support one (e.g. pure-api wrappers hiding headless).\n */\n allowedKinds?: readonly WrapperTransportKind[];\n /** Callback fired whenever the kind changes. */\n onChange?: (kind: WrapperTransportKind) => void;\n}\n\nexport interface UseTransportSelectorReturn {\n kind: WrapperTransportKind;\n setKind: (next: WrapperTransportKind) => void;\n allowedKinds: readonly WrapperTransportKind[];\n}\n\nconst DEFAULT_ALLOWED: readonly WrapperTransportKind[] = ['api', 'headless', 'headed', 'live'];\n\nexport function useTransportSelector(\n options: UseTransportSelectorOptions = {}\n): UseTransportSelectorReturn {\n const allowed = options.allowedKinds ?? DEFAULT_ALLOWED;\n const initial = options.initialKind ?? allowed[0] ?? 'api';\n const [kind, setKind] = useState<WrapperTransportKind>(initial);\n\n const selectKind = useCallback(\n (next: WrapperTransportKind) => {\n if (!allowed.includes(next)) return;\n setKind(next);\n options.onChange?.(next);\n },\n [allowed, options]\n );\n\n return { kind, setKind: selectKind, allowedKinds: allowed };\n}\n"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* sessionStorage capture-side helper for `ui-bridge-login-web --storage-state-out`.
|
|
3
|
+
*
|
|
4
|
+
* Playwright's `storageState` captures only cookies + localStorage — never
|
|
5
|
+
* sessionStorage. Apps that keep their auth token in sessionStorage
|
|
6
|
+
* (qontinui-web stores `auth_bearer_access_token` there) therefore lose auth on
|
|
7
|
+
* a cold `ui-bridge-inject --storage-state` replay. To close the gap we fold the
|
|
8
|
+
* authed page's sessionStorage into the artifact under a custom top-level
|
|
9
|
+
* `__sessionStorage` key (origin → key/value map). The launcher
|
|
10
|
+
* (@qontinui/ui-bridge-headless) strips that key before `newContext` and
|
|
11
|
+
* replays it via an init-script.
|
|
12
|
+
*
|
|
13
|
+
* This merge helper is local to the wrapper (rather than imported from the
|
|
14
|
+
* optional `@qontinui/ui-bridge-headless` peer) so it carries NO static
|
|
15
|
+
* dependency on that peer — a `--help` invocation of the bin must not eagerly
|
|
16
|
+
* resolve a package an api-only consumer never installed. It is a pure function
|
|
17
|
+
* so it is unit-tested without a browser. The launcher owns the symmetric
|
|
18
|
+
* restore-side `splitSessionStorageArtifact`.
|
|
19
|
+
*/
|
|
20
|
+
/** A single origin's sessionStorage as a flat key→value map. */
|
|
21
|
+
export type SessionStorageKV = Record<string, string>;
|
|
22
|
+
/** origin → its sessionStorage key→value map. */
|
|
23
|
+
export type SessionStorageMap = Record<string, SessionStorageKV>;
|
|
24
|
+
/** The custom top-level key under which sessionStorage rides in the artifact. */
|
|
25
|
+
export declare const SESSION_STORAGE_KEY = "__sessionStorage";
|
|
26
|
+
/** A Playwright `storageState` artifact, possibly extended with `__sessionStorage`. */
|
|
27
|
+
export interface StorageStateArtifact {
|
|
28
|
+
cookies?: unknown;
|
|
29
|
+
origins?: unknown;
|
|
30
|
+
__sessionStorage?: SessionStorageMap;
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Fold a captured sessionStorage map for `origin` into the parsed storageState
|
|
35
|
+
* `artifact`, returning the SAME object (mutated) for convenience. Only the
|
|
36
|
+
* supplied origin's entry is set/overwritten; sessionStorage already recorded
|
|
37
|
+
* for OTHER origins is preserved. Backward-compatible: a legacy artifact gains
|
|
38
|
+
* the new key without disturbing cookies/origins.
|
|
39
|
+
*/
|
|
40
|
+
export declare function mergeSessionStorageIntoArtifact(artifact: StorageStateArtifact, origin: string, kv: SessionStorageKV): StorageStateArtifact;
|
|
41
|
+
/**
|
|
42
|
+
* Derive the origin to key a frame's sessionStorage by from its URL. Returns
|
|
43
|
+
* `null` for `about:blank`, opaque (`data:`/`blob:`/sandboxed), or unparseable
|
|
44
|
+
* URLs — callers skip those frames.
|
|
45
|
+
*/
|
|
46
|
+
export declare function frameOrigin(frameUrl: string): string | null;
|
|
47
|
+
/** One frame's capture: its URL plus the sessionStorage it yielded (or null when access threw). */
|
|
48
|
+
export interface FrameSessionStorage {
|
|
49
|
+
url: string;
|
|
50
|
+
/** The frame's sessionStorage, or `null` when the `evaluate` threw (cross-origin/restricted). */
|
|
51
|
+
kv: SessionStorageKV | null;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Build a multi-origin `{ origin -> kv }` map from per-frame captures (the
|
|
55
|
+
* result of iterating `page.frames()` and reading each frame's sessionStorage).
|
|
56
|
+
*
|
|
57
|
+
* Rules — keep these consistent with the restore side (`location.origin` lookup):
|
|
58
|
+
* - Frames whose origin is opaque/empty/`about:blank`, or whose capture threw
|
|
59
|
+
* (`kv === null`), are skipped.
|
|
60
|
+
* - Multiple frames sharing one origin are MERGED into that origin's single
|
|
61
|
+
* entry. Merge order follows input order and **LATER frames' keys win** on a
|
|
62
|
+
* key collision (last-write-wins) — same-origin frames share one
|
|
63
|
+
* sessionStorage partition in the browser, so collisions should carry the
|
|
64
|
+
* same value anyway; last-write-wins is the deterministic tie-break.
|
|
65
|
+
*
|
|
66
|
+
* Pure + browser-free so it is unit-tested directly.
|
|
67
|
+
*/
|
|
68
|
+
export declare function buildMultiOriginSessionStorageMap(frames: readonly FrameSessionStorage[]): SessionStorageMap;
|
|
69
|
+
/**
|
|
70
|
+
* Fold a whole multi-origin sessionStorage map into the artifact, preserving any
|
|
71
|
+
* origins already recorded that are NOT present in `map`. For each origin in
|
|
72
|
+
* `map`, that origin's entry is set/overwritten (same per-origin semantics as
|
|
73
|
+
* {@link mergeSessionStorageIntoArtifact}, applied for each origin). Returns the
|
|
74
|
+
* SAME (mutated) object. Backward-compatible: the `__sessionStorage` shape is
|
|
75
|
+
* unchanged (origin → kv) — a single-origin map yields exactly the legacy shape.
|
|
76
|
+
*/
|
|
77
|
+
export declare function mergeMultiOriginSessionStorageIntoArtifact(artifact: StorageStateArtifact, map: SessionStorageMap): StorageStateArtifact;
|
|
78
|
+
//# sourceMappingURL=session-storage-capture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-storage-capture.d.ts","sourceRoot":"","sources":["../src/session-storage-capture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,gEAAgE;AAChE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEtD,iDAAiD;AACjD,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAEjE,iFAAiF;AACjF,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AAEtD,uFAAuF;AACvF,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,oBAAoB,EAC9B,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,gBAAgB,GACnB,oBAAoB,CAOtB;AAWD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO3D;AAED,mGAAmG;AACnG,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,iGAAiG;IACjG,EAAE,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC7B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,SAAS,mBAAmB,EAAE,GACrC,iBAAiB,CASnB;AAED;;;;;;;GAOG;AACH,wBAAgB,0CAA0C,CACxD,QAAQ,EAAE,oBAAoB,EAC9B,GAAG,EAAE,iBAAiB,GACrB,oBAAoB,CAWtB"}
|
|
@@ -35,6 +35,22 @@ export interface HeadlessTransportOptions {
|
|
|
35
35
|
userAgent?: string;
|
|
36
36
|
/** Forward browser console/page errors to the Node process stderr. */
|
|
37
37
|
forwardConsole?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Extra Chromium command-line arguments passed through to
|
|
40
|
+
* `chromium.launch({ args })` (e.g. the LNA-disable flags needed to fetch
|
|
41
|
+
* a loopback relay from an https page). Plan 2026-06-12 item 2.
|
|
42
|
+
*/
|
|
43
|
+
launchArgs?: string[];
|
|
44
|
+
/**
|
|
45
|
+
* Path to a Playwright `storageState` JSON file (cookies + localStorage)
|
|
46
|
+
* to seed the browser context with before the first navigation. Lets a
|
|
47
|
+
* previously-captured authenticated session (e.g. from
|
|
48
|
+
* `ui-bridge-login-web --storage-state-out`) carry past a login wall so an
|
|
49
|
+
* autonomous loop can drive a login-walled page repeatedly without
|
|
50
|
+
* re-driving the hosted-UI login. Threaded to `launchHeadlessTab`'s
|
|
51
|
+
* `storageStatePath`.
|
|
52
|
+
*/
|
|
53
|
+
storageStatePath?: string;
|
|
38
54
|
}
|
|
39
55
|
/** Context shape delivered to each headless/headed handler. */
|
|
40
56
|
export interface HeadlessContext {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headless.d.ts","sourceRoot":"","sources":["../../src/transports/headless.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAA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AkGxC;;;;OAIG;cACa,gBAAgB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAIrD;;;OAGG;cACa,WAAW,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;cAIvC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;cAOxB,YAAY,IAAI,OAAO,CAAC,eAAe,CAAC;CAgBzD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qontinui/ui-bridge-wrapper",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Runtime for building UI Bridge wrapper apps — transport-agnostic semantic actions.",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@qontinui/ui-bridge": "^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0 || ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^0.14.0 || ^0.15.0",
|
|
56
|
+
"@qontinui/ui-bridge": "^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0 || ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^0.14.0 || ^0.15.0 || ^0.16.0 || ^0.17.0 || ^0.18.0 || ^0.19.0 || ^0.20.0",
|
|
57
57
|
"@qontinui/ui-bridge-headless": "*",
|
|
58
58
|
"react": "^18.0.0 || ^19.0.0"
|
|
59
59
|
},
|