Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
scope: '@predicate'
scope: '@predicatesystems'
always-auth: true

- name: Extract version from tag or input
Expand Down Expand Up @@ -158,11 +158,11 @@ jobs:
echo "=== Auth ==="
npm whoami --registry https://registry.npmjs.org
echo ""
echo "=== Scope access (@predicate) ==="
echo "=== Scope access (@predicatesystems) ==="
# npm v10 syntax:
# - `npm access list packages <scope>` checks whether the user can see/publish packages in that scope
# - if you are not a member/owner of the npm org, this typically fails (403/404) which is what we want surfaced
npm access list packages @predicate --registry https://registry.npmjs.org --json
npm access list packages @predicatesystems --registry https://registry.npmjs.org --json
echo ""
echo "=== Sanity: packages visible to current user ==="
npm access list packages "$(npm whoami --registry https://registry.npmjs.org)" --registry https://registry.npmjs.org --json
Expand All @@ -180,11 +180,11 @@ jobs:
tag_name: v${{ steps.version.outputs.version }}
name: Release v${{ steps.version.outputs.version }}
body: |
Release v${{ steps.version.outputs.version }} of @predicate/sdk
Release v${{ steps.version.outputs.version }} of @predicatesystems/sdk

## Installation
```bash
npm install @predicate/sdk@${{ steps.version.outputs.version }}
npm install @predicatesystems/sdk@${{ steps.version.outputs.version }}
```
draft: false
prerelease: false
Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

All notable changes to `@predicate/sdk` will be documented in this file.
All notable changes to `@predicatesystems/sdk` will be documented in this file.

## Unreleased

Expand All @@ -24,7 +24,7 @@ import {
PredicateBrowserAgent,
type RuntimeStep,
LocalLLMProvider, // or OpenAIProvider / AnthropicProvider / DeepInfraProvider
} from '@predicate/sdk';
} from '@predicatesystems/sdk';

const runtime = new AgentRuntime(browserLike, page, tracer);
const llm = new LocalLLMProvider({ model: 'qwen2.5:7b', baseUrl: 'http://localhost:11434/v1' });
Expand Down Expand Up @@ -65,7 +65,7 @@ const agent = new PredicateBrowserAgent({
If you set `captcha.policy="callback"`, you must provide a handler. The SDK does **not** include a public CAPTCHA solver.

```ts
import { HumanHandoffSolver } from '@predicate/sdk';
import { HumanHandoffSolver } from '@predicatesystems/sdk';

const agent = new PredicateBrowserAgent({
runtime,
Expand Down
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The core loop is:
## Install

```bash
npm install @predicate/sdk
npm install @predicatesystems/sdk
npx playwright install chromium
```

Expand All @@ -51,9 +51,9 @@ Use the new `Predicate*` class names for all new code:
## Quickstart: a verification-first loop

```ts
import { PredicateBrowser, AgentRuntime } from '@predicate/sdk';
import { JsonlTraceSink, Tracer } from '@predicate/sdk';
import { exists, urlContains } from '@predicate/sdk';
import { PredicateBrowser, AgentRuntime } from '@predicatesystems/sdk';
import { JsonlTraceSink, Tracer } from '@predicatesystems/sdk';
import { exists, urlContains } from '@predicatesystems/sdk';
import type { Page } from 'playwright';

async function main(): Promise<void> {
Expand Down Expand Up @@ -96,7 +96,13 @@ Key idea: your agent still executes actions — Predicate **snapshots and verifi

```ts
import type { Page } from 'playwright';
import { PredicateDebugger, Tracer, JsonlTraceSink, exists, urlContains } from '@predicate/sdk';
import {
PredicateDebugger,
Tracer,
JsonlTraceSink,
exists,
urlContains,
} from '@predicatesystems/sdk';

async function runExistingAgent(page: Page): Promise<void> {
const tracer = new Tracer('run-123', new JsonlTraceSink('trace.jsonl'));
Expand All @@ -123,7 +129,7 @@ async function runExistingAgent(page: Page): Promise<void> {
If you want Predicate to drive the loop end-to-end, you can use the SDK primitives directly: take a snapshot, select elements, act, then verify.

```ts
import { PredicateBrowser, snapshot, find, typeText, click, waitFor } from '@predicate/sdk';
import { PredicateBrowser, snapshot, find, typeText, click, waitFor } from '@predicatesystems/sdk';

async function loginExample(): Promise<void> {
const browser = new PredicateBrowser();
Expand Down Expand Up @@ -201,7 +207,7 @@ if (!ok) {
## ToolRegistry (LLM-callable tools)

```ts
import { ToolRegistry, registerDefaultTools } from '@predicate/sdk';
import { ToolRegistry, registerDefaultTools } from '@predicatesystems/sdk';

const registry = new ToolRegistry();
registerDefaultTools(registry);
Expand All @@ -213,8 +219,8 @@ const toolsForLLM = registry.llmTools();
Chrome permission prompts are outside the DOM and can be invisible to snapshots. Prefer setting a policy **before navigation**.

```ts
import { PredicateBrowser } from '@predicate/sdk';
import type { PermissionPolicy } from '@predicate/sdk';
import { PredicateBrowser } from '@predicatesystems/sdk';
import type { PermissionPolicy } from '@predicatesystems/sdk';

const policy: PermissionPolicy = {
default: 'clear',
Expand Down Expand Up @@ -248,7 +254,7 @@ If your backend supports it, you can also use ToolRegistry permission tools (`gr
## Downloads (verification predicate)

```ts
import { downloadCompleted } from '@predicate/sdk';
import { downloadCompleted } from '@predicatesystems/sdk';

runtime.assert(downloadCompleted('report.csv'), 'download_ok', true);
```
Expand Down
4 changes: 2 additions & 2 deletions examples/agent-runtime-captcha-strategies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
HumanHandoffSolver,
SentienceBrowser,
VisionSolver,
} from '@predicate/sdk';
import { createTracer } from '@predicate/sdk';
} from '@predicatesystems/sdk';
import { createTracer } from '@predicatesystems/sdk';

async function notifyWebhook(ctx: any): Promise<void> {
console.log(`[captcha] external resolver notified: url=${ctx.url} run_id=${ctx.runId}`);
Expand Down
2 changes: 1 addition & 1 deletion examples/lang-chain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ These examples show how to wrap Sentience TS SDK primitives as LangChain JS tool
Install (example):

```bash
npm install @predicate/sdk @langchain/core zod
npm install @predicatesystems/sdk @langchain/core zod
```

Run:
Expand Down
2 changes: 1 addition & 1 deletion examples/lang-chain/sentience-tools-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Example: Wrap Sentience TS SDK primitives as LangChain JS tools.
*
* Install (example):
* npm install @predicate/sdk @langchain/core zod
* npm install @predicatesystems/sdk @langchain/core zod
*
* Run:
* npx ts-node examples/lang-chain/sentience-tools-demo.ts
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@predicate/sdk",
"name": "@predicatesystems/sdk",
"version": "1.1.0",
"description": "TypeScript SDK for Sentience AI Agent Browser Automation",
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/visual-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ Return ONLY the integer ID number from the label, nothing else.`;
playgroundPath = path.join(cwd, 'playground', 'images');
} else {
// Check if we're in a playground context via module path
const modulePaths = require.resolve.paths('@predicate/sdk') || [];
const modulePaths = require.resolve.paths('@predicatesystems/sdk') || [];
for (const modulePath of modulePaths) {
const potentialPlayground = path.join(modulePath, '..', 'playground', 'images');
if (fs.existsSync(path.dirname(potentialPlayground))) {
Expand Down
Loading