Skip to content

Commit a872047

Browse files
authored
Merge pull request #177 from SentienceAPI/rebrand2
rebrand 2 with Predicate*
2 parents f647090 + fa6deb2 commit a872047

12 files changed

Lines changed: 148 additions & 26 deletions

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Changelog
2+
3+
All notable changes to `@predicatelabs/sdk` will be documented in this file.
4+
5+
## Unreleased
6+
7+
### Deprecated
8+
9+
- Soft-deprecated legacy `Sentience*` class names in favor of `Predicate*` names:
10+
- `SentienceBrowser` -> `PredicateBrowser`
11+
- `SentienceAgent` -> `PredicateAgent`
12+
- `SentienceVisualAgent` -> `PredicateVisualAgent`
13+
- `SentienceDebugger` -> `PredicateDebugger`
14+
- `backends.SentienceContext` -> `backends.PredicateContext`
15+
- Legacy names remain supported as runtime aliases for compatibility during a transition window of **1-2 releases**.
16+
17+
### Added
18+
19+
- Runtime alias exports for `Predicate*` counterparts to preserve backwards compatibility while enabling rebrand migration.
20+
21+
### Fixed
22+
23+
- Hardened `search()` in `src/actions.ts` for CI reliability by making `page.waitForLoadState('networkidle')` best-effort with a bounded timeout, preventing flaky timeouts on pages with long-lived background requests.

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,26 @@ npm install @predicatelabs/sdk
3232
npx playwright install chromium
3333
```
3434

35+
## Naming migration (Predicate rebrand)
36+
37+
Use the new `Predicate*` class names for all new code:
38+
39+
- `PredicateBrowser`
40+
- `PredicateAgent`
41+
- `PredicateVisualAgent`
42+
- `PredicateDebugger`
43+
- `backends.PredicateContext`
44+
45+
The legacy `Sentience*` names are still available as runtime aliases for compatibility, but are now soft-deprecated and planned for removal after **1-2 releases**.
46+
47+
Mapping:
48+
49+
- `SentienceBrowser` -> `PredicateBrowser`
50+
- `SentienceAgent` -> `PredicateAgent`
51+
- `SentienceVisualAgent` -> `PredicateVisualAgent`
52+
- `SentienceDebugger` -> `PredicateDebugger`
53+
- `backends.SentienceContext` -> `backends.PredicateContext`
54+
3555
## Conceptual example (why this exists)
3656

3757
- Steps are **gated by verifiable UI assertions**

src/actions.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,13 @@ export async function search(
11341134
const urlBefore = page.url();
11351135
const url = buildSearchUrl(query, engine);
11361136
await browser.goto(url);
1137-
await page.waitForLoadState('networkidle');
1137+
// Some search engines keep long-lived background requests open in CI,
1138+
// so treat networkidle as a best-effort signal instead of a hard requirement.
1139+
try {
1140+
await page.waitForLoadState('networkidle', { timeout: 5000 });
1141+
} catch {
1142+
// no-op: page is already loaded enough for URL/result assertions
1143+
}
11381144

11391145
const durationMs = Date.now() - startTime;
11401146
const urlAfter = page.url();

src/agent.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,3 +535,9 @@ export class SentienceAgent {
535535
}
536536
}
537537
}
538+
539+
/**
540+
* Predicate rebrand alias for SentienceAgent.
541+
* Kept as a runtime alias to avoid breaking existing integrations.
542+
*/
543+
export const PredicateAgent = SentienceAgent;

src/backends/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export {
108108
// SentienceContext (Token-Slasher Context Middleware)
109109
export {
110110
SentienceContext,
111+
PredicateContext,
111112
SentienceContextState,
112113
SentienceContextOptions,
113114
TopElementSelector,

src/backends/sentience-context.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,3 +474,9 @@ export class SentienceContext {
474474
return this._selector;
475475
}
476476
}
477+
478+
/**
479+
* Predicate rebrand alias for SentienceContext.
480+
* Kept as a runtime alias to avoid breaking existing integrations.
481+
*/
482+
export const PredicateContext = SentienceContext;

src/browser.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,3 +1021,9 @@ export class SentienceBrowser implements IBrowser {
10211021
return finalPath;
10221022
}
10231023
}
1024+
1025+
/**
1026+
* Predicate rebrand alias for SentienceBrowser.
1027+
* Kept as a runtime alias to avoid breaking existing integrations.
1028+
*/
1029+
export const PredicateBrowser = SentienceBrowser;

src/debugger.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,9 @@ export class SentienceDebugger {
131131
return new DebuggerAssertionHandle(this, predicate, label, required, true, openedStepId);
132132
}
133133
}
134+
135+
/**
136+
* Predicate rebrand alias for SentienceDebugger.
137+
* Kept as a runtime alias to avoid breaking existing integrations.
138+
*/
139+
export const PredicateDebugger = SentienceDebugger;

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Sentience TypeScript SDK - AI Agent Browser Automation
33
*/
44

5-
export { SentienceBrowser, PermissionPolicy } from './browser';
5+
export { SentienceBrowser, PredicateBrowser, PermissionPolicy } from './browser';
66
export { snapshot, SnapshotOptions, SnapshotGatewayError } from './snapshot';
77
export { query, find, parseSelector } from './query';
88
export {
@@ -46,8 +46,8 @@ export {
4646
AnthropicProvider,
4747
GLMProvider,
4848
} from './llm-provider';
49-
export { SentienceAgent, AgentActResult, HistoryEntry, TokenStats } from './agent';
50-
export { SentienceVisualAgent } from './visual-agent';
49+
export { SentienceAgent, PredicateAgent, AgentActResult, HistoryEntry, TokenStats } from './agent';
50+
export { SentienceVisualAgent, PredicateVisualAgent } from './visual-agent';
5151

5252
// Conversational Agent Layer (v0.3.0+)
5353
export {
@@ -87,7 +87,7 @@ export {
8787
isCollapsed,
8888
} from './verification';
8989
export { AgentRuntime, AssertionHandle, AssertionRecord, EventuallyOptions } from './agent-runtime';
90-
export { SentienceDebugger } from './debugger';
90+
export { SentienceDebugger, PredicateDebugger } from './debugger';
9191
export { RuntimeAgent } from './runtime-agent';
9292
export type { RuntimeStep, StepVerification } from './runtime-agent';
9393
export { parseVisionExecutorAction, executeVisionExecutorAction } from './vision-executor';

src/visual-agent.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,3 +906,9 @@ Return ONLY the integer ID number from the label, nothing else.`;
906906
}
907907
}
908908
}
909+
910+
/**
911+
* Predicate rebrand alias for SentienceVisualAgent.
912+
* Kept as a runtime alias to avoid breaking existing integrations.
913+
*/
914+
export const PredicateVisualAgent = SentienceVisualAgent;

0 commit comments

Comments
 (0)