@canivel/ralph 0.2.0 → 0.2.3
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/.agents/ralph/PROMPT_build.md +126 -126
- package/.agents/ralph/agents.sh +17 -15
- package/.agents/ralph/config.sh +25 -25
- package/.agents/ralph/log-activity.sh +15 -15
- package/.agents/ralph/loop.sh +1027 -1001
- package/.agents/ralph/references/CONTEXT_ENGINEERING.md +126 -126
- package/.agents/ralph/references/GUARDRAILS.md +174 -174
- package/AGENTS.md +20 -20
- package/README.md +270 -266
- package/bin/ralph +766 -765
- package/diagram.svg +55 -55
- package/examples/commands.md +46 -46
- package/package.json +39 -39
- package/skills/commit/SKILL.md +219 -219
- package/skills/commit/references/commit_examples.md +292 -292
- package/skills/dev-browser/SKILL.md +211 -211
- package/skills/dev-browser/bun.lock +443 -443
- package/skills/dev-browser/package-lock.json +2988 -2988
- package/skills/dev-browser/package.json +31 -31
- package/skills/dev-browser/references/scraping.md +155 -155
- package/skills/dev-browser/scripts/start-relay.ts +32 -32
- package/skills/dev-browser/scripts/start-server.ts +117 -117
- package/skills/dev-browser/server.sh +24 -24
- package/skills/dev-browser/src/client.ts +474 -474
- package/skills/dev-browser/src/index.ts +287 -287
- package/skills/dev-browser/src/relay.ts +731 -731
- package/skills/dev-browser/src/snapshot/__tests__/snapshot.test.ts +223 -223
- package/skills/dev-browser/src/snapshot/browser-script.ts +877 -877
- package/skills/dev-browser/src/snapshot/index.ts +14 -14
- package/skills/dev-browser/src/snapshot/inject.ts +13 -13
- package/skills/dev-browser/src/types.ts +34 -34
- package/skills/dev-browser/tsconfig.json +36 -36
- package/skills/dev-browser/vitest.config.ts +12 -12
- package/skills/prd/SKILL.md +235 -235
- package/tests/agent-loops.mjs +79 -79
- package/tests/agent-ping.mjs +39 -39
- package/tests/audit.md +56 -56
- package/tests/cli-smoke.mjs +47 -47
- package/tests/real-agents.mjs +127 -127
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ARIA Snapshot module for dev-browser.
|
|
3
|
-
*
|
|
4
|
-
* Provides Playwright-compatible ARIA snapshots with cross-connection ref persistence.
|
|
5
|
-
* Refs are stored on window.__devBrowserRefs and survive across Playwright reconnections.
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* import { getSnapshotScript } from './snapshot';
|
|
9
|
-
* const script = getSnapshotScript();
|
|
10
|
-
* await page.evaluate(script);
|
|
11
|
-
* // Now window.__devBrowser_getAISnapshot() and window.__devBrowser_selectSnapshotRef(ref) are available
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
export { getSnapshotScript, clearSnapshotScriptCache } from "./browser-script";
|
|
1
|
+
/**
|
|
2
|
+
* ARIA Snapshot module for dev-browser.
|
|
3
|
+
*
|
|
4
|
+
* Provides Playwright-compatible ARIA snapshots with cross-connection ref persistence.
|
|
5
|
+
* Refs are stored on window.__devBrowserRefs and survive across Playwright reconnections.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* import { getSnapshotScript } from './snapshot';
|
|
9
|
+
* const script = getSnapshotScript();
|
|
10
|
+
* await page.evaluate(script);
|
|
11
|
+
* // Now window.__devBrowser_getAISnapshot() and window.__devBrowser_selectSnapshotRef(ref) are available
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export { getSnapshotScript, clearSnapshotScriptCache } from "./browser-script";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Injectable snapshot script for browser context.
|
|
3
|
-
*
|
|
4
|
-
* This module provides the getSnapshotScript function that returns a
|
|
5
|
-
* self-contained JavaScript string for injection into browser contexts.
|
|
6
|
-
*
|
|
7
|
-
* The script is injected via page.evaluate() and exposes:
|
|
8
|
-
* - window.__devBrowser_getAISnapshot(): Returns ARIA snapshot YAML
|
|
9
|
-
* - window.__devBrowser_selectSnapshotRef(ref): Returns element for given ref
|
|
10
|
-
* - window.__devBrowserRefs: Map of ref -> Element (persists across connections)
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
export { getSnapshotScript, clearSnapshotScriptCache } from "./browser-script";
|
|
1
|
+
/**
|
|
2
|
+
* Injectable snapshot script for browser context.
|
|
3
|
+
*
|
|
4
|
+
* This module provides the getSnapshotScript function that returns a
|
|
5
|
+
* self-contained JavaScript string for injection into browser contexts.
|
|
6
|
+
*
|
|
7
|
+
* The script is injected via page.evaluate() and exposes:
|
|
8
|
+
* - window.__devBrowser_getAISnapshot(): Returns ARIA snapshot YAML
|
|
9
|
+
* - window.__devBrowser_selectSnapshotRef(ref): Returns element for given ref
|
|
10
|
+
* - window.__devBrowserRefs: Map of ref -> Element (persists across connections)
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export { getSnapshotScript, clearSnapshotScriptCache } from "./browser-script";
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
// API request/response types - shared between client and server
|
|
2
|
-
|
|
3
|
-
export interface ServeOptions {
|
|
4
|
-
port?: number;
|
|
5
|
-
headless?: boolean;
|
|
6
|
-
cdpPort?: number;
|
|
7
|
-
/** Directory to store persistent browser profiles (cookies, localStorage, etc.) */
|
|
8
|
-
profileDir?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface ViewportSize {
|
|
12
|
-
width: number;
|
|
13
|
-
height: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface GetPageRequest {
|
|
17
|
-
name: string;
|
|
18
|
-
/** Optional viewport size for new pages */
|
|
19
|
-
viewport?: ViewportSize;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface GetPageResponse {
|
|
23
|
-
wsEndpoint: string;
|
|
24
|
-
name: string;
|
|
25
|
-
targetId: string; // CDP target ID for reliable page matching
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface ListPagesResponse {
|
|
29
|
-
pages: string[];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface ServerInfoResponse {
|
|
33
|
-
wsEndpoint: string;
|
|
34
|
-
}
|
|
1
|
+
// API request/response types - shared between client and server
|
|
2
|
+
|
|
3
|
+
export interface ServeOptions {
|
|
4
|
+
port?: number;
|
|
5
|
+
headless?: boolean;
|
|
6
|
+
cdpPort?: number;
|
|
7
|
+
/** Directory to store persistent browser profiles (cookies, localStorage, etc.) */
|
|
8
|
+
profileDir?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ViewportSize {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface GetPageRequest {
|
|
17
|
+
name: string;
|
|
18
|
+
/** Optional viewport size for new pages */
|
|
19
|
+
viewport?: ViewportSize;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface GetPageResponse {
|
|
23
|
+
wsEndpoint: string;
|
|
24
|
+
name: string;
|
|
25
|
+
targetId: string; // CDP target ID for reliable page matching
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ListPagesResponse {
|
|
29
|
+
pages: string[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface ServerInfoResponse {
|
|
33
|
+
wsEndpoint: string;
|
|
34
|
+
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
// Environment setup & latest features
|
|
4
|
-
"lib": ["ESNext"],
|
|
5
|
-
"target": "ESNext",
|
|
6
|
-
"module": "Preserve",
|
|
7
|
-
"moduleDetection": "force",
|
|
8
|
-
"jsx": "react-jsx",
|
|
9
|
-
"allowJs": true,
|
|
10
|
-
|
|
11
|
-
// Bundler mode
|
|
12
|
-
"moduleResolution": "bundler",
|
|
13
|
-
"allowImportingTsExtensions": true,
|
|
14
|
-
"verbatimModuleSyntax": true,
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
|
|
17
|
-
// Path aliases
|
|
18
|
-
"baseUrl": ".",
|
|
19
|
-
"paths": {
|
|
20
|
-
"@/*": ["./src/*"]
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
// Best practices
|
|
24
|
-
"strict": true,
|
|
25
|
-
"skipLibCheck": true,
|
|
26
|
-
"noFallthroughCasesInSwitch": true,
|
|
27
|
-
"noUncheckedIndexedAccess": true,
|
|
28
|
-
"noImplicitOverride": true,
|
|
29
|
-
|
|
30
|
-
// Some stricter flags (disabled by default)
|
|
31
|
-
"noUnusedLocals": false,
|
|
32
|
-
"noUnusedParameters": false,
|
|
33
|
-
"noPropertyAccessFromIndexSignature": false
|
|
34
|
-
},
|
|
35
|
-
"include": ["src/**/*", "scripts/**/*"]
|
|
36
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// Environment setup & latest features
|
|
4
|
+
"lib": ["ESNext"],
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"module": "Preserve",
|
|
7
|
+
"moduleDetection": "force",
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
|
|
11
|
+
// Bundler mode
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"verbatimModuleSyntax": true,
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
|
|
17
|
+
// Path aliases
|
|
18
|
+
"baseUrl": ".",
|
|
19
|
+
"paths": {
|
|
20
|
+
"@/*": ["./src/*"]
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// Best practices
|
|
24
|
+
"strict": true,
|
|
25
|
+
"skipLibCheck": true,
|
|
26
|
+
"noFallthroughCasesInSwitch": true,
|
|
27
|
+
"noUncheckedIndexedAccess": true,
|
|
28
|
+
"noImplicitOverride": true,
|
|
29
|
+
|
|
30
|
+
// Some stricter flags (disabled by default)
|
|
31
|
+
"noUnusedLocals": false,
|
|
32
|
+
"noUnusedParameters": false,
|
|
33
|
+
"noPropertyAccessFromIndexSignature": false
|
|
34
|
+
},
|
|
35
|
+
"include": ["src/**/*", "scripts/**/*"]
|
|
36
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineConfig } from "vitest/config";
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
test: {
|
|
5
|
-
globals: true,
|
|
6
|
-
environment: "node",
|
|
7
|
-
include: ["src/**/*.test.ts"],
|
|
8
|
-
testTimeout: 60000, // Playwright tests can be slow
|
|
9
|
-
hookTimeout: 60000,
|
|
10
|
-
teardownTimeout: 60000,
|
|
11
|
-
},
|
|
12
|
-
});
|
|
1
|
+
import { defineConfig } from "vitest/config";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
test: {
|
|
5
|
+
globals: true,
|
|
6
|
+
environment: "node",
|
|
7
|
+
include: ["src/**/*.test.ts"],
|
|
8
|
+
testTimeout: 60000, // Playwright tests can be slow
|
|
9
|
+
hookTimeout: 60000,
|
|
10
|
+
teardownTimeout: 60000,
|
|
11
|
+
},
|
|
12
|
+
});
|