@chatbridge/provider 0.1.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/LICENSE +21 -0
- package/README.md +3 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +5 -0
- package/package.json +32 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 7milch
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Page } from "playwright-core";
|
|
2
|
+
/**
|
|
3
|
+
* A Provider implements all service-specific browser behaviour for one
|
|
4
|
+
* web chat AI service. The framework owns the browser lifecycle and auth
|
|
5
|
+
* state; the provider owns URLs, selectors, and completion detection.
|
|
6
|
+
*/
|
|
7
|
+
export interface Provider {
|
|
8
|
+
/** Identifier; also names the auth-state storage file. */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Chat page URL; the runtime navigates here before startNewChat. */
|
|
11
|
+
chatUrl: string;
|
|
12
|
+
/** Navigate to the login page (called during `auth login`, headful). */
|
|
13
|
+
navigateToLogin(page: Page): Promise<void>;
|
|
14
|
+
/** Login-completion check; also the auth-validity check at startup. */
|
|
15
|
+
isLoggedIn(page: Page): Promise<boolean>;
|
|
16
|
+
/** Bring the page to a state where a new chat can start. */
|
|
17
|
+
startNewChat(page: Page): Promise<void>;
|
|
18
|
+
/** Submit the prompt. */
|
|
19
|
+
sendMessage(page: Page, prompt: string): Promise<void>;
|
|
20
|
+
/** Wait for response completion and return the response text. */
|
|
21
|
+
waitForResponse(page: Page): Promise<string>;
|
|
22
|
+
}
|
|
23
|
+
/** Identity helper: gives provider authors type inference and a future
|
|
24
|
+
* validation hook without any runtime cost today. */
|
|
25
|
+
export declare function defineProvider(provider: Provider): Provider;
|
|
26
|
+
export type { Page };
|
package/dist/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chatbridge/provider",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Provider contract for chatbridge: service-specific browser behaviour behind one interface",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/7milch/chatbridge-cli.git",
|
|
9
|
+
"directory": "packages/provider"
|
|
10
|
+
},
|
|
11
|
+
"keywords": ["chatbridge", "playwright", "chat", "provider"],
|
|
12
|
+
"type": "module",
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=20"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": ["dist", "README.md", "LICENSE"],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"playwright-core": ">=1.48 <2"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"playwright-core": "1.63.0"
|
|
31
|
+
}
|
|
32
|
+
}
|