@roll-agent/browser-use-agent 0.9.1 → 0.10.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/SKILL.md +31 -32
- package/dist/diagnostics/effective-env.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/reply-authority/prepared-reply-store.d.ts +19 -0
- package/dist/reply-authority/reply-preview-visual.d.ts +15 -0
- package/dist/reply-authority/schemas.d.ts +11 -11
- package/dist/tools/zhipin-generate-reply-preview.d.ts +32 -0
- package/dist/tools/zhipin-send-prepared-reply.d.ts +7 -0
- package/dist/tools/zhipin-send-reply.d.ts +22 -1
- package/package.json +4 -3
- package/references/env.yaml +7 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type PreparedReplyRecord = {
|
|
2
|
+
readonly preparedReplyId: string;
|
|
3
|
+
readonly signedEnvelope: string;
|
|
4
|
+
readonly suggestedReply: string;
|
|
5
|
+
readonly stage: string;
|
|
6
|
+
readonly confidence: number;
|
|
7
|
+
readonly expiresAt: number;
|
|
8
|
+
readonly requestId?: string;
|
|
9
|
+
};
|
|
10
|
+
export type PreparedReplyConsumeResult = {
|
|
11
|
+
readonly ok: true;
|
|
12
|
+
readonly record: PreparedReplyRecord;
|
|
13
|
+
} | {
|
|
14
|
+
readonly ok: false;
|
|
15
|
+
readonly reason: "not_found" | "expired" | "consumed";
|
|
16
|
+
};
|
|
17
|
+
export declare function savePreparedReply(input: Omit<PreparedReplyRecord, "preparedReplyId">, nowSeconds?: number): PreparedReplyRecord;
|
|
18
|
+
export declare function consumePreparedReply(preparedReplyId: string, nowSeconds?: number): PreparedReplyConsumeResult;
|
|
19
|
+
export declare function resetPreparedReplyStoreForTests(): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type NativePreviewTarget = {
|
|
2
|
+
evaluateJson<T = unknown>(expression: string): Promise<T>;
|
|
3
|
+
};
|
|
4
|
+
export declare class NativeReplyPreviewVisualSession {
|
|
5
|
+
private readonly target;
|
|
6
|
+
constructor(target: NativePreviewTarget);
|
|
7
|
+
begin(label: string): Promise<boolean>;
|
|
8
|
+
updateStatus(label: string): Promise<boolean>;
|
|
9
|
+
updateDraft(draftText: string, provisional: boolean): Promise<boolean>;
|
|
10
|
+
complete(label: string, finalReply: string): Promise<boolean>;
|
|
11
|
+
fail(label: string): Promise<boolean>;
|
|
12
|
+
clear(): Promise<boolean>;
|
|
13
|
+
private render;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -47,6 +47,12 @@ export declare const ReplyAuthorityEnvelopePayloadSchema: z.ZodObject<{
|
|
|
47
47
|
platform: "zhipin";
|
|
48
48
|
conversationId: string;
|
|
49
49
|
candidateId: string;
|
|
50
|
+
tenantId: string;
|
|
51
|
+
recruiterBinding: {
|
|
52
|
+
platform: "zhipin";
|
|
53
|
+
username: string;
|
|
54
|
+
accountId?: string | undefined;
|
|
55
|
+
};
|
|
50
56
|
v: 2;
|
|
51
57
|
iss: "reply-authority-service";
|
|
52
58
|
kid: string;
|
|
@@ -54,18 +60,18 @@ export declare const ReplyAuthorityEnvelopePayloadSchema: z.ZodObject<{
|
|
|
54
60
|
iat: number;
|
|
55
61
|
exp: number;
|
|
56
62
|
aud: "browser-use-agent/zhipin_send_reply";
|
|
57
|
-
tenantId: string;
|
|
58
63
|
reply: string;
|
|
59
64
|
policyVersion: string;
|
|
65
|
+
}, {
|
|
66
|
+
platform: "zhipin";
|
|
67
|
+
conversationId: string;
|
|
68
|
+
candidateId: string;
|
|
69
|
+
tenantId: string;
|
|
60
70
|
recruiterBinding: {
|
|
61
71
|
platform: "zhipin";
|
|
62
72
|
username: string;
|
|
63
73
|
accountId?: string | undefined;
|
|
64
74
|
};
|
|
65
|
-
}, {
|
|
66
|
-
platform: "zhipin";
|
|
67
|
-
conversationId: string;
|
|
68
|
-
candidateId: string;
|
|
69
75
|
v: 2;
|
|
70
76
|
iss: "reply-authority-service";
|
|
71
77
|
kid: string;
|
|
@@ -73,14 +79,8 @@ export declare const ReplyAuthorityEnvelopePayloadSchema: z.ZodObject<{
|
|
|
73
79
|
iat: number;
|
|
74
80
|
exp: number;
|
|
75
81
|
aud: "browser-use-agent/zhipin_send_reply";
|
|
76
|
-
tenantId: string;
|
|
77
82
|
reply: string;
|
|
78
83
|
policyVersion: string;
|
|
79
|
-
recruiterBinding: {
|
|
80
|
-
platform: "zhipin";
|
|
81
|
-
username: string;
|
|
82
|
-
accountId?: string | undefined;
|
|
83
|
-
};
|
|
84
84
|
}>;
|
|
85
85
|
export declare const ReplyAuthorityPublicKeySchema: z.ZodObject<{
|
|
86
86
|
kid: z.ZodString;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { streamGenerateSignedReply } from "@roll-agent/reply-authority-client";
|
|
2
|
+
import { NativeVisualActivitySession } from "../native-visual-activity-session.ts";
|
|
3
|
+
import { openZhipinNativePagePort } from "../pages/zhipin/native-page.ts";
|
|
4
|
+
import type { ZhipinNativePagePort } from "../pages/zhipin/native-page.ts";
|
|
5
|
+
import { savePreparedReply } from "../reply-authority/prepared-reply-store.ts";
|
|
6
|
+
import { NativeReplyPreviewVisualSession } from "../reply-authority/reply-preview-visual.ts";
|
|
7
|
+
type NativeVisualActivitySessionLike = Pick<NativeVisualActivitySession, "begin" | "highlightSelector" | "succeed" | "fail">;
|
|
8
|
+
type ReplyPreviewVisualSessionLike = Pick<NativeReplyPreviewVisualSession, "begin" | "updateStatus" | "updateDraft" | "complete" | "fail">;
|
|
9
|
+
type ZhipinGenerateReplyPreviewDeps = {
|
|
10
|
+
readonly openNativePagePort: typeof openZhipinNativePagePort;
|
|
11
|
+
readonly createNativeVisualActivitySession: (page: ZhipinNativePagePort) => NativeVisualActivitySessionLike;
|
|
12
|
+
readonly createReplyPreviewVisualSession: (page: ZhipinNativePagePort) => ReplyPreviewVisualSessionLike;
|
|
13
|
+
readonly streamGenerateSignedReply: typeof streamGenerateSignedReply;
|
|
14
|
+
readonly savePreparedReply: typeof savePreparedReply;
|
|
15
|
+
};
|
|
16
|
+
export declare function setZhipinGenerateReplyPreviewDepsForTests(override: Partial<ZhipinGenerateReplyPreviewDeps> | undefined): void;
|
|
17
|
+
export declare const zhipinGenerateReplyPreview: import("@roll-agent/sdk").ToolDefinition<{
|
|
18
|
+
index?: number | undefined;
|
|
19
|
+
conversationId?: string | undefined;
|
|
20
|
+
candidateName?: string | undefined;
|
|
21
|
+
maxMessages?: number | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
success: boolean;
|
|
24
|
+
error?: string | undefined;
|
|
25
|
+
requestId?: string | undefined;
|
|
26
|
+
suggestedReply?: string | undefined;
|
|
27
|
+
confidence?: number | undefined;
|
|
28
|
+
stage?: string | undefined;
|
|
29
|
+
preparedReplyId?: string | undefined;
|
|
30
|
+
expiresAt?: number | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
export {};
|
|
@@ -1,14 +1,35 @@
|
|
|
1
|
+
import type { AgentContext } from "@roll-agent/sdk";
|
|
2
|
+
import { z } from "zod";
|
|
1
3
|
import { NativeVisualActivitySession } from "../native-visual-activity-session.ts";
|
|
2
4
|
import { openZhipinNativePagePort } from "../pages/zhipin/native-page.ts";
|
|
3
5
|
import type { ZhipinNativePagePort } from "../pages/zhipin/native-page.ts";
|
|
4
6
|
import { getReplyAuthorityKeysLoaded } from "../runtime-holder.ts";
|
|
7
|
+
declare const OutputSchema: z.ZodObject<{
|
|
8
|
+
success: z.ZodBoolean;
|
|
9
|
+
sentMessage: z.ZodString;
|
|
10
|
+
error: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
success: boolean;
|
|
13
|
+
sentMessage: string;
|
|
14
|
+
error?: string | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
success: boolean;
|
|
17
|
+
sentMessage: string;
|
|
18
|
+
error?: string | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
export type ZhipinSendReplyResult = z.infer<typeof OutputSchema>;
|
|
5
21
|
type NativeVisualActivitySessionLike = Pick<NativeVisualActivitySession, "begin" | "previewMouseMotion" | "succeed" | "fail">;
|
|
6
|
-
type ZhipinSendReplyDeps = {
|
|
22
|
+
export type ZhipinSendReplyDeps = {
|
|
7
23
|
readonly getReplyAuthorityKeysLoaded: typeof getReplyAuthorityKeysLoaded;
|
|
8
24
|
readonly openNativePagePort: typeof openZhipinNativePagePort;
|
|
9
25
|
readonly createNativeVisualActivitySession: (page: ZhipinNativePagePort) => NativeVisualActivitySessionLike;
|
|
10
26
|
};
|
|
11
27
|
export declare function setZhipinSendReplyDepsForTests(override: Partial<ZhipinSendReplyDeps> | undefined): void;
|
|
28
|
+
export declare function sendSignedZhipinReply(input: {
|
|
29
|
+
readonly signedEnvelope: string;
|
|
30
|
+
readonly candidateName?: string | undefined;
|
|
31
|
+
readonly index?: number | undefined;
|
|
32
|
+
}, ctx: AgentContext): Promise<ZhipinSendReplyResult>;
|
|
12
33
|
export declare const zhipinSendReply: import("@roll-agent/sdk").ToolDefinition<{
|
|
13
34
|
signedEnvelope: string;
|
|
14
35
|
index?: number | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roll-agent/browser-use-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -45,8 +45,9 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"zod": "^3.25.76",
|
|
48
|
-
"@roll-agent/
|
|
49
|
-
"@roll-agent/sdk": "0.1.6"
|
|
48
|
+
"@roll-agent/reply-authority-client": "0.1.1",
|
|
49
|
+
"@roll-agent/sdk": "0.1.6",
|
|
50
|
+
"@roll-agent/browser": "0.3.1"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
53
|
"@types/node": "^22.0.0"
|
package/references/env.yaml
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
required:
|
|
2
|
+
- name: REPLY_AUTHORITY_URL
|
|
3
|
+
purpose: Reply Authority Service API base URL;`zhipin_generate_reply_preview` 使用 SSE 直接生成并展示回复
|
|
4
|
+
example: https://reply-authority.duliday.com
|
|
5
|
+
- name: REPLY_AUTHORITY_BEARER_TOKEN
|
|
6
|
+
purpose: 调用 Reply Authority Service `POST /generate-signed-reply` 的 Bearer token;只用于生成 prepared reply,不会返回给 orchestrator
|
|
7
|
+
example: token_xxx
|
|
2
8
|
- name: REPLY_AUTHORITY_KEYS_URL
|
|
3
|
-
purpose: Reply Authority Service 公钥分发端点;`
|
|
9
|
+
purpose: Reply Authority Service 公钥分发端点;`zhipin_send_prepared_reply` 启动预热和本地 Ed25519 验签都依赖它
|
|
4
10
|
example: https://reply-authority.duliday.com/.well-known/reply-authority-keys
|
|
5
11
|
- name: RECRUITMENT_EVENTS_DEFAULT_AGENT_ID
|
|
6
12
|
purpose: 单 browser-use 实例 / 单 Boss 账号部署下的默认招聘业务 Agent ID;招聘事件默认启用,上报时必须用它做归因
|