waygraph 0.15.44 → 0.15.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/analysis/coverage-gap.d.ts +1 -1
  2. package/dist/analysis/coverage-gap.js +1 -1
  3. package/dist/analysis/graph.js +1 -1
  4. package/dist/auto-session/helpers.d.ts +2 -2
  5. package/dist/auto-session/session.js +2 -2
  6. package/dist/cli/usage.d.ts +1 -1
  7. package/dist/commands/session.js +5 -5
  8. package/dist/index.d.ts +4 -4
  9. package/dist/index.js +2 -2
  10. package/dist/session/auto-explore-run.d.ts +37 -0
  11. package/dist/session/auto-explore-run.js +670 -0
  12. package/dist/session/auto-explore.d.ts +57 -0
  13. package/dist/session/auto-explore.js +376 -0
  14. package/dist/session/auto-session-ipc.d.ts +150 -0
  15. package/dist/session/auto-session-ipc.js +499 -0
  16. package/dist/session/block-inject.d.ts +21 -0
  17. package/dist/session/block-inject.js +97 -0
  18. package/dist/session/browser.d.ts +15 -0
  19. package/dist/session/browser.js +29 -0
  20. package/dist/session/overlay-beacon.d.ts +44 -0
  21. package/dist/session/overlay-beacon.js +85 -0
  22. package/dist/session/pilot.d.ts +54 -0
  23. package/dist/session/pilot.js +80 -0
  24. package/dist/traverse/run.js +2 -2
  25. package/examples/saucedemo/.waygraph-auto/00b0c55c.log +22 -0
  26. package/examples/saucedemo/.waygraph-auto/00e5d037.log +5 -0
  27. package/examples/saucedemo/.waygraph-auto/015be8f6.log +6 -0
  28. package/examples/saucedemo/.waygraph-auto/026e188e.log +0 -0
  29. package/examples/saucedemo/.waygraph-auto/07845ed1.log +0 -0
  30. package/examples/saucedemo/.waygraph-auto/0c19e232.log +5 -0
  31. package/examples/saucedemo/.waygraph-auto/1122c13c.log +0 -0
  32. package/examples/saucedemo/.waygraph-auto/2b9b56fc.log +20 -0
  33. package/examples/saucedemo/.waygraph-auto/30a5c848.log +20 -0
  34. package/examples/saucedemo/.waygraph-auto/33a50dc0.log +0 -0
  35. package/examples/saucedemo/.waygraph-auto/3a208bb8.log +20 -0
  36. package/examples/saucedemo/.waygraph-auto/3e3c0f3b.log +0 -0
  37. package/examples/saucedemo/.waygraph-auto/756fd326.log +20 -0
  38. package/examples/saucedemo/.waygraph-auto/78043767.log +20 -0
  39. package/examples/saucedemo/.waygraph-auto/976394cd.log +20 -0
  40. package/examples/saucedemo/.waygraph-auto/9d827954.log +20 -0
  41. package/examples/saucedemo/.waygraph-auto/a4f8d355.log +20 -0
  42. package/examples/saucedemo/.waygraph-auto/af2fae12.log +0 -0
  43. package/examples/saucedemo/.waygraph-auto/b0752c49.log +0 -0
  44. package/examples/saucedemo/.waygraph-auto/b14811d7.log +6 -0
  45. package/examples/saucedemo/.waygraph-auto/c9d76e32.log +0 -0
  46. package/examples/saucedemo/.waygraph-auto/cc989184.log +20 -0
  47. package/examples/saucedemo/.waygraph-auto/e5127c03.log +22 -0
  48. package/package.json +1 -1
  49. package/templates/agents/waygraph-author.agent.md +24 -51
  50. package/templates/agents/waygraph-planner.agent.md +12 -5
@@ -1,4 +1,4 @@
1
- import type { BlockEntry } from "../auto-explore.js";
1
+ import type { BlockEntry } from "../session/auto-explore.js";
2
2
  /** Collect selector strings from NavClick blocks and Block/*Sel source files. */
3
3
  export declare function collectKnownInteractionSelectors(projectDir: string, library: {
4
4
  navBlocks: BlockEntry[];
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { readFileSync, readdirSync, statSync } from "node:fs";
7
7
  import { join } from "node:path";
8
- import { exploreRoots } from "../block-inject.js";
8
+ import { exploreRoots } from "../session/block-inject.js";
9
9
  const SELECTOR_LITERAL = /(?:locator|visible|click|fill|press|selector|getByRole)\(\s*['"`]([^'"`]+)['"`]/g;
10
10
  const HASH_ID = /#([a-zA-Z][\w-]*)/g;
11
11
  const DATA_TEST = /\[data-test(?:-id)?(?:=["'`][^"'`]+["'`])?\]/g;
@@ -1,7 +1,7 @@
1
1
  import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
2
2
  import { join, dirname, relative, resolve } from "node:path";
3
3
  import { matchBlocksSelect, } from "../blocks-select.js";
4
- import { exploreRoots, injectTaggedFile } from "../block-inject.js";
4
+ import { exploreRoots, injectTaggedFile } from "../session/block-inject.js";
5
5
  /**
6
6
  * Renders a `WaygraphGraph` as Mermaid `stateDiagram-v2` text - paste
7
7
  * straight into a `.md` file's ```mermaid fence or a live editor. `"*"`
@@ -1,6 +1,6 @@
1
1
  import type { StubPhaseResult } from "../highlights.js";
2
- import type { BlockEntry, ExploreMenu } from "../auto-explore.js";
3
- import type { PickResult } from "../auto-explore-run.js";
2
+ import type { BlockEntry, ExploreMenu } from "../session/auto-explore.js";
3
+ import type { PickResult } from "../session/auto-explore-run.js";
4
4
  /** True when a stub-phase result actually carries authored content worth keeping. */
5
5
  export declare function stubPhaseHasContent(r: StubPhaseResult): boolean;
6
6
  export interface SessionSnapshotEdge {
@@ -1,10 +1,10 @@
1
1
  // Split out of the former 1,078-line auto-session.ts (see src/ARCHITECTURE.md). Behavior unchanged.
2
2
  import { CONSOLE_LOG_MAX_ENTRIES, FULL_MODE_DEFAULT_DEPTH, FULL_MODE_MAX_NODES, FULL_MODE_MAX_TEXT_LENGTH, TRACE_MAX_STEPS, buildSessionSnapshot, parsePick, stubFilePath, stubPhaseHasContent, walkFullDom } from "./helpers.js";
3
3
  import { instrumentPilotActions, installPersistentPilotOverlay, showPilotActivity, showPilotFixtures, showPilotVision, phaseToOverlayFixtures, describeOverlayFixtures, updatePilotOverlay } from "../pilot-overlay.js";
4
- import { buildExploreContext, buildExploreMenu } from "../auto-explore.js";
4
+ import { buildExploreContext, buildExploreMenu } from "../session/auto-explore.js";
5
5
  import { MemPage } from "../mem-page.js";
6
6
  import { Engine } from "../engine.js";
7
- import { detectHere, ensureLivePage, ensureMem, resolveBaseUrl, runOneBlock, seedDefaultMem } from "../auto-explore-run.js";
7
+ import { detectHere, ensureLivePage, ensureMem, resolveBaseUrl, runOneBlock, seedDefaultMem } from "../session/auto-explore-run.js";
8
8
  import { collectKnownInteractionSelectors, unmappedInteractionsPageScript } from "../analysis/coverage-gap.js";
9
9
  import { runStubPhase } from "../highlights.js";
10
10
  import { verboseLog } from "../verbose-log.js";
@@ -1,4 +1,4 @@
1
- import type { SessionMeta } from "../browser.js";
1
+ import type { SessionMeta } from "../session/browser.js";
2
2
  export declare function printBrowserUsage(): void;
3
3
  export declare function printBrowserSessionsList(sessions: SessionMeta[], projectDir: string): void;
4
4
  export declare function usage(): void;
@@ -4,14 +4,14 @@ import { applyRunFlags, looksLikeFlowFileRef, parseRunFlags, resolveBaseUrl } fr
4
4
  import { runChain } from "../cli/run-chain.js";
5
5
  import { runChainAuto } from "./check.js";
6
6
  import { resolve } from "node:path";
7
- import { browserStart, listBrowserSessions, stopAllBrowserSessions, stopBrowserSession } from "../browser.js";
7
+ import { browserStart, listBrowserSessions, stopAllBrowserSessions, stopBrowserSession } from "../session/browser.js";
8
8
  import { existsSync, statSync } from "node:fs";
9
- import { resolveInjectRoots } from "../block-inject.js";
10
- import { requestSession, resolveSessionMeta, runAttachLoop, runAutoServeCommand, spawnDetachedSession } from "../auto-session-ipc.js";
11
- import { pilotAttach, pilotStart } from "../pilot.js";
9
+ import { resolveInjectRoots } from "../session/block-inject.js";
10
+ import { requestSession, resolveSessionMeta, runAttachLoop, runAutoServeCommand, spawnDetachedSession } from "../session/auto-session-ipc.js";
11
+ import { pilotAttach, pilotStart } from "../session/pilot.js";
12
12
  import { parseHighlightShorthand } from "../highlights/shorthand.js";
13
13
  import { isFileSelectToken, parseBlocksSelect } from "../blocks-select.js";
14
- import { runAutoExplore } from "../auto-explore-run.js";
14
+ import { runAutoExplore } from "../session/auto-explore-run.js";
15
15
  import { discoverGraph, findOrphanBlocks, toMermaid } from "../analysis/graph.js";
16
16
  export async function sessionCase(args, command) {
17
17
  if (command === "browser") {
package/dist/index.d.ts CHANGED
@@ -21,9 +21,9 @@ export { runTraverse } from "./traverse/run.js";
21
21
  export type { TraverseOptions, TraverseSessionMode, TraverseWorkerResult, } from "./traverse/run.js";
22
22
  export { buildCoverageReport, collectGraphEdgeKeys, defaultCoverageOutPath, formatCoverageLine, normalizeHitKey, parseMinEdgeCoverage, writeCoverageReport, } from "./traverse/coverage.js";
23
23
  export type { TraverseCoverageReport } from "./traverse/coverage.js";
24
- export { WG_UI_SEL, WG_READY_PANEL_SEL, WG_READY_AUTO_SEL, WG_READY_BANNER_SEL, readWgOverlayBeacon, readWgOverlayBeaconInPage, assertWgOverlayReady, } from "./overlay-beacon.js";
25
- export type { WgModalKind, WgBeaconRow } from "./overlay-beacon.js";
24
+ export { WG_UI_SEL, WG_READY_PANEL_SEL, WG_READY_AUTO_SEL, WG_READY_BANNER_SEL, readWgOverlayBeacon, readWgOverlayBeaconInPage, assertWgOverlayReady, } from "./session/overlay-beacon.js";
25
+ export type { WgModalKind, WgBeaconRow } from "./session/overlay-beacon.js";
26
26
  export { AutoSession, stubFilePath } from "./auto-session.js";
27
27
  export type { AutoSessionInit, SessionSnapshot, SessionSnapshotEdge, SessionSnapshotSection, ApplyPickResult, ApplyPathResult, TraceStep, ConsoleLogEntry, StorageSnapshot, ServiceWorkerRegistrationInfo, CookieInfo, StubFileKind, } from "./auto-session.js";
28
- export { pilotStart } from "./pilot.js";
29
- export type { PilotStartResult } from "./pilot.js";
28
+ export { pilotStart } from "./session/pilot.js";
29
+ export type { PilotStartResult } from "./session/pilot.js";
package/dist/index.js CHANGED
@@ -11,6 +11,6 @@ export { isFileSelectToken, parseBlocksSelect, matchBlocksSelect, globToRegExp,
11
11
  export { EdgeLeaseCoordinator } from "./traverse/lease.js";
12
12
  export { runTraverse } from "./traverse/run.js";
13
13
  export { buildCoverageReport, collectGraphEdgeKeys, defaultCoverageOutPath, formatCoverageLine, normalizeHitKey, parseMinEdgeCoverage, writeCoverageReport, } from "./traverse/coverage.js";
14
- export { WG_UI_SEL, WG_READY_PANEL_SEL, WG_READY_AUTO_SEL, WG_READY_BANNER_SEL, readWgOverlayBeacon, readWgOverlayBeaconInPage, assertWgOverlayReady, } from "./overlay-beacon.js";
14
+ export { WG_UI_SEL, WG_READY_PANEL_SEL, WG_READY_AUTO_SEL, WG_READY_BANNER_SEL, readWgOverlayBeacon, readWgOverlayBeaconInPage, assertWgOverlayReady, } from "./session/overlay-beacon.js";
15
15
  export { AutoSession, stubFilePath } from "./auto-session.js";
16
- export { pilotStart } from "./pilot.js";
16
+ export { pilotStart } from "./session/pilot.js";
@@ -0,0 +1,37 @@
1
+ import type { Page, BrowserContext } from "@playwright/test";
2
+ import { Engine } from "../engine.js";
3
+ import { MemPage } from "../mem-page.js";
4
+ import { type BlockEntry } from "./auto-explore.js";
5
+ import type { Checkpoint } from "../types.js";
6
+ export interface AutoExploreOptions {
7
+ /** Terminal menu (browser still runs for act()). Default false = headful picker panel. */
8
+ cli?: boolean;
9
+ baseURL?: string;
10
+ /** Initial URL when the page is blank (defaults to baseURL). */
11
+ startUrl?: string;
12
+ /** Phase C: glob / regex / bare `--blocks` file select for discovery. */
13
+ blocksSelect?: import("../blocks-select.js").BlocksSelect;
14
+ }
15
+ export declare function resolveBaseUrl(projectDir: string): string | undefined;
16
+ export declare function detectHere(page: Page, navBlocks: BlockEntry[]): Promise<string | null>;
17
+ export declare function ensureLivePage(context: BrowserContext, page: Page, startUrl: string | undefined): Promise<Page>;
18
+ /**
19
+ * Saucedemo-only defaults. Exact key names only — never substring `"login"`.
20
+ * A consumer's own `key<string>("login-email")` must stay unset here, or it
21
+ * silently gets a saucedemo credentials object instead of its own default.
22
+ */
23
+ export declare function defaultMemValueForKey(keyName: string): unknown | undefined;
24
+ /** Pre-seed known demo keys (saucedemo creds) so headful/cli do not stop for mem forms. */
25
+ export declare function seedDefaultMem(library: Map<string, BlockEntry>, mem: MemPage): void;
26
+ export declare function ensureMem(entry: BlockEntry, mem: MemPage, cli: boolean): Promise<void>;
27
+ export declare function runOneBlock(engine: Engine, entry: BlockEntry, context: BrowserContext, page: Page, mem: MemPage, headful: boolean): Promise<Checkpoint<string>>;
28
+ export type PickResult = {
29
+ type: "pick";
30
+ index: number;
31
+ } | {
32
+ type: "quit";
33
+ };
34
+ /**
35
+ * Interactive waygraph auto: locate current Checkpoint, list runnable Blocks, pick one, repeat.
36
+ */
37
+ export declare function runAutoExplore(projectDir: string, options?: AutoExploreOptions): Promise<void>;