ptbk 0.119.0-16 → 0.119.0-21
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/README.md +27 -9
- package/dist/book/commitments.d.ts +38 -10
- package/dist/book/commitments.js +61 -17
- package/dist/book/commitments.js.map +1 -1
- package/dist/book/convert.d.ts +36 -0
- package/dist/book/convert.js +156 -0
- package/dist/book/convert.js.map +1 -0
- package/dist/book/parse.d.ts +50 -13
- package/dist/book/parse.js +132 -45
- package/dist/book/parse.js.map +1 -1
- package/dist/book/references.d.ts +12 -4
- package/dist/book/references.js +34 -9
- package/dist/book/references.js.map +1 -1
- package/dist/book/write.d.ts +42 -0
- package/dist/book/write.js +74 -0
- package/dist/book/write.js.map +1 -0
- package/dist/browser/browser.d.ts +122 -12
- package/dist/browser/browser.js +372 -21
- package/dist/browser/browser.js.map +1 -1
- package/dist/browser/recording.d.ts +3 -3
- package/dist/browser/recording.js +5 -5
- package/dist/browser/recording.js.map +1 -1
- package/dist/chats/chat-book.d.ts +105 -0
- package/dist/chats/chat-book.js +180 -0
- package/dist/chats/chat-book.js.map +1 -0
- package/dist/chats/conversation.d.ts +54 -0
- package/dist/chats/conversation.js +188 -0
- package/dist/chats/conversation.js.map +1 -0
- package/dist/chats/local.d.ts +46 -0
- package/dist/chats/local.js +184 -0
- package/dist/chats/local.js.map +1 -0
- package/dist/chats/migration.d.ts +12 -0
- package/dist/chats/migration.js +62 -0
- package/dist/chats/migration.js.map +1 -0
- package/dist/chats/service.d.ts +81 -0
- package/dist/chats/service.js +122 -0
- package/dist/chats/service.js.map +1 -0
- package/dist/chats/store.d.ts +132 -0
- package/dist/chats/store.js +181 -0
- package/dist/chats/store.js.map +1 -0
- package/dist/chats/task-chats.d.ts +52 -0
- package/dist/chats/task-chats.js +96 -0
- package/dist/chats/task-chats.js.map +1 -0
- package/dist/cli/chats.d.ts +45 -0
- package/dist/cli/chats.js +108 -0
- package/dist/cli/chats.js.map +1 -0
- package/dist/cli/commands/add.js +32 -22
- package/dist/cli/commands/add.js.map +1 -1
- package/dist/cli/commands/answer.d.ts +2 -1
- package/dist/cli/commands/answer.js +35 -41
- package/dist/cli/commands/answer.js.map +1 -1
- package/dist/cli/commands/ask.d.ts +7 -0
- package/dist/cli/commands/ask.js +37 -0
- package/dist/cli/commands/ask.js.map +1 -0
- package/dist/cli/commands/boilerplates.js +14 -3
- package/dist/cli/commands/boilerplates.js.map +1 -1
- package/dist/cli/commands/chat.d.ts +9 -0
- package/dist/cli/commands/chat.js +89 -0
- package/dist/cli/commands/chat.js.map +1 -0
- package/dist/cli/commands/dashboard.d.ts +3 -1
- package/dist/cli/commands/dashboard.js +41 -3
- package/dist/cli/commands/dashboard.js.map +1 -1
- package/dist/cli/commands/find.js +6 -8
- package/dist/cli/commands/find.js.map +1 -1
- package/dist/cli/commands/fix.js +4 -6
- package/dist/cli/commands/fix.js.map +1 -1
- package/dist/cli/commands/init.d.ts +0 -1
- package/dist/cli/commands/init.js +38 -38
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/lint.js +16 -2
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/list.js +21 -13
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/migrate.d.ts +2 -1
- package/dist/cli/commands/migrate.js +70 -24
- package/dist/cli/commands/migrate.js.map +1 -1
- package/dist/cli/commands/pause.d.ts +8 -0
- package/dist/cli/commands/pause.js +40 -0
- package/dist/cli/commands/pause.js.map +1 -0
- package/dist/cli/commands/plan.js +6 -9
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/recover.js +7 -3
- package/dist/cli/commands/recover.js.map +1 -1
- package/dist/cli/commands/restart.d.ts +3 -1
- package/dist/cli/commands/restart.js +74 -18
- package/dist/cli/commands/restart.js.map +1 -1
- package/dist/cli/commands/resume.d.ts +8 -0
- package/dist/cli/commands/resume.js +15 -0
- package/dist/cli/commands/resume.js.map +1 -0
- package/dist/cli/commands/run.js +6 -9
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/start.js +40 -36
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/status.d.ts +2 -1
- package/dist/cli/commands/status.js +5 -1
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/stop.d.ts +3 -1
- package/dist/cli/commands/stop.js +18 -8
- package/dist/cli/commands/stop.js.map +1 -1
- package/dist/cli/commands/verify.js +7 -7
- package/dist/cli/commands/verify.js.map +1 -1
- package/dist/cli/common.d.ts +13 -0
- package/dist/cli/common.js +22 -0
- package/dist/cli/common.js.map +1 -1
- package/dist/cli/engine-delegation.d.ts +14 -0
- package/dist/cli/engine-delegation.js +46 -0
- package/dist/cli/engine-delegation.js.map +1 -0
- package/dist/cli/lifecycle.d.ts +40 -0
- package/dist/cli/lifecycle.js +71 -0
- package/dist/cli/lifecycle.js.map +1 -0
- package/dist/cli/registry.js +113 -31
- package/dist/cli/registry.js.map +1 -1
- package/dist/cli/service-view.d.ts +14 -2
- package/dist/cli/service-view.js +46 -5
- package/dist/cli/service-view.js.map +1 -1
- package/dist/cli/sources.js +5 -8
- package/dist/cli/sources.js.map +1 -1
- package/dist/cli/spec.js +1 -1
- package/dist/cli/spec.js.map +1 -1
- package/dist/common/app-data.d.ts +9 -0
- package/dist/common/app-data.js +20 -0
- package/dist/common/app-data.js.map +1 -0
- package/dist/common/errors.d.ts +2 -0
- package/dist/common/errors.js.map +1 -1
- package/dist/common/time.d.ts +6 -0
- package/dist/common/time.js +9 -0
- package/dist/common/time.js.map +1 -1
- package/dist/engine/agenda.d.ts +213 -43
- package/dist/engine/agenda.js +846 -260
- package/dist/engine/agenda.js.map +1 -1
- package/dist/engine/executor.d.ts +23 -7
- package/dist/engine/executor.js +131 -84
- package/dist/engine/executor.js.map +1 -1
- package/dist/engine/generated.d.ts +21 -1
- package/dist/engine/generated.js +36 -21
- package/dist/engine/generated.js.map +1 -1
- package/dist/engine/preview.js +10 -10
- package/dist/engine/preview.js.map +1 -1
- package/dist/engine/prompt.d.ts +16 -4
- package/dist/engine/prompt.js +22 -4
- package/dist/engine/prompt.js.map +1 -1
- package/dist/engine/routing.js +28 -4
- package/dist/engine/routing.js.map +1 -1
- package/dist/engine/snapshot.d.ts +178 -29
- package/dist/engine/state.d.ts +40 -13
- package/dist/engine/state.js +20 -5
- package/dist/engine/state.js.map +1 -1
- package/dist/engine/task-trace.d.ts +35 -7
- package/dist/engine/task-trace.js +74 -15
- package/dist/engine/task-trace.js.map +1 -1
- package/dist/engine/team.d.ts +20 -7
- package/dist/engine/team.js +30 -24
- package/dist/engine/team.js.map +1 -1
- package/dist/engine/traces.d.ts +1 -1
- package/dist/engine/traces.js +1 -1
- package/dist/expert/_main.md +67 -52
- package/dist/expert/agents/_index.md +11 -13
- package/dist/expert/agents/chatter.md +31 -0
- package/dist/expert/agents/consistency.md +6 -11
- package/dist/expert/agents/core-agents.md +9 -7
- package/dist/expert/agents/expert.md +2 -2
- package/dist/expert/agents/fixer.md +24 -0
- package/dist/expert/agents/learning.md +1 -1
- package/dist/expert/agents/non-agents.md +6 -4
- package/dist/expert/agents/teacher.md +1 -1
- package/dist/expert/agents/visual-identity.md +4 -4
- package/dist/expert/book-language/_index.md +9 -8
- package/dist/expert/book-language/commitments/_index.md +23 -3
- package/dist/expert/book-language/commitments/agent.md +11 -0
- package/dist/expert/book-language/commitments/chat-member.md +7 -0
- package/dist/expert/book-language/commitments/chat-message.md +11 -0
- package/dist/expert/book-language/commitments/chat-status.md +7 -0
- package/dist/expert/book-language/commitments/chat.md +11 -0
- package/dist/expert/book-language/commitments/entity.md +9 -0
- package/dist/expert/book-language/commitments/from.md +1 -1
- package/dist/expert/book-language/commitments/goal.md +6 -2
- package/dist/expert/book-language/commitments/link.md +9 -0
- package/dist/expert/book-language/commitments/task-depends-on.md +1 -1
- package/dist/expert/book-language/commitments/task-parent.md +1 -1
- package/dist/expert/book-language/commitments/task.md +7 -3
- package/dist/expert/book-language/commitments/team.md +1 -1
- package/dist/expert/book-language/inheritance.md +2 -2
- package/dist/expert/book-language/references.md +20 -24
- package/dist/expert/book-language/syntax.md +54 -11
- package/dist/expert/cli/acceptance.md +59 -24
- package/dist/expert/cli/api.md +23 -9
- package/dist/expert/cli/authoring.md +6 -4
- package/dist/expert/cli/autonomous-operation.md +3 -3
- package/dist/expert/cli/browser.md +29 -18
- package/dist/expert/cli/channels.md +5 -7
- package/dist/expert/cli/chat-ui.md +32 -0
- package/dist/expert/cli/chats.md +59 -0
- package/dist/expert/cli/cli.md +44 -26
- package/dist/expert/cli/configuration.md +3 -3
- package/dist/expert/cli/controls.md +13 -7
- package/dist/expert/cli/dashboard-details.md +23 -0
- package/dist/expert/cli/dashboard-layout.md +19 -12
- package/dist/expert/cli/dashboard.md +12 -8
- package/dist/expert/cli/execution.md +8 -6
- package/dist/expert/cli/first-task.md +4 -4
- package/dist/expert/cli/generated-names.md +44 -0
- package/dist/expert/cli/git-persistence.md +19 -17
- package/dist/expert/cli/global-dashboard.md +33 -0
- package/dist/expert/cli/goal-discovery.md +1 -1
- package/dist/expert/cli/help.md +1 -1
- package/dist/expert/cli/initialization-ui.md +2 -0
- package/dist/expert/cli/initialization.md +9 -7
- package/dist/expert/cli/interactive-ui.md +9 -5
- package/dist/expert/cli/locking.md +21 -0
- package/dist/expert/cli/migration.md +22 -6
- package/dist/expert/cli/process-modes.md +21 -13
- package/dist/expert/cli/recovery.md +8 -6
- package/dist/expert/cli/recurrence.md +1 -1
- package/dist/expert/cli/rich-input.md +2 -2
- package/dist/expert/cli/service-lifecycle.md +57 -0
- package/dist/expert/cli/start.md +2 -2
- package/dist/expert/cli/status-view.md +16 -12
- package/dist/expert/cli/task-books.md +11 -15
- package/dist/expert/cli/task-identity.md +8 -10
- package/dist/expert/cli/task-markdown.md +6 -10
- package/dist/expert/cli/task-origins.md +3 -1
- package/dist/expert/cli/task-relationships.md +5 -9
- package/dist/expert/cli/team.md +17 -7
- package/dist/expert/cli/terminal.md +20 -12
- package/dist/expert/cli/trace-configuration.md +1 -1
- package/dist/expert/cli/traces.md +19 -23
- package/dist/expert/cli/user-interactions.md +14 -26
- package/dist/expert/cli/workspace.md +15 -9
- package/dist/expert/concepts/engine-and-project.md +11 -0
- package/dist/expert/concepts/project-model.md +39 -0
- package/dist/expert/dictionary.md +21 -15
- package/dist/harness/plugins/claude-code/index.js +1 -0
- package/dist/harness/plugins/claude-code/index.js.map +1 -1
- package/dist/harness/plugins/cline/index.js +1 -0
- package/dist/harness/plugins/cline/index.js.map +1 -1
- package/dist/harness/plugins/openai-codex/index.js +1 -0
- package/dist/harness/plugins/openai-codex/index.js.map +1 -1
- package/dist/harness/plugins/opencode/index.js +1 -0
- package/dist/harness/plugins/opencode/index.js.map +1 -1
- package/dist/harness/types.d.ts +3 -1
- package/dist/project/agents.d.ts +29 -81
- package/dist/project/agents.js +48 -267
- package/dist/project/agents.js.map +1 -1
- package/dist/project/books.d.ts +150 -0
- package/dist/project/books.js +253 -0
- package/dist/project/books.js.map +1 -0
- package/dist/project/config.js +2 -2
- package/dist/project/config.js.map +1 -1
- package/dist/project/defaults.d.ts +35 -6
- package/dist/project/defaults.js +73 -40
- package/dist/project/defaults.js.map +1 -1
- package/dist/project/expert.js +18 -10
- package/dist/project/expert.js.map +1 -1
- package/dist/project/git.d.ts +4 -3
- package/dist/project/git.js +16 -5
- package/dist/project/git.js.map +1 -1
- package/dist/project/setup.d.ts +4 -1
- package/dist/project/setup.js +26 -6
- package/dist/project/setup.js.map +1 -1
- package/dist/service/actions.d.ts +34 -10
- package/dist/service/actions.js +51 -19
- package/dist/service/actions.js.map +1 -1
- package/dist/service/control.d.ts +53 -1
- package/dist/service/control.js +64 -4
- package/dist/service/control.js.map +1 -1
- package/dist/service/discovery.d.ts +133 -0
- package/dist/service/discovery.js +138 -0
- package/dist/service/discovery.js.map +1 -0
- package/dist/service/host.d.ts +8 -1
- package/dist/service/host.js +65 -18
- package/dist/service/host.js.map +1 -1
- package/dist/service/http.d.ts +3 -0
- package/dist/service/http.js +26 -6
- package/dist/service/http.js.map +1 -1
- package/dist/service/launcher.d.ts +66 -13
- package/dist/service/launcher.js +78 -18
- package/dist/service/launcher.js.map +1 -1
- package/dist/service/records.d.ts +12 -2
- package/dist/service/records.js +19 -5
- package/dist/service/records.js.map +1 -1
- package/dist/service/spa/app.css +83 -2
- package/dist/service/spa/app.js +393 -72
- package/dist/service/supervisor.js +7 -1
- package/dist/service/supervisor.js.map +1 -1
- package/dist/service/worker.js +14 -5
- package/dist/service/worker.js.map +1 -1
- package/dist/tasks/authoring.d.ts +3 -5
- package/dist/tasks/authoring.js +6 -7
- package/dist/tasks/authoring.js.map +1 -1
- package/dist/tasks/book-task.d.ts +18 -10
- package/dist/tasks/book-task.js +27 -23
- package/dist/tasks/book-task.js.map +1 -1
- package/dist/tasks/eligibility.d.ts +15 -7
- package/dist/tasks/eligibility.js +41 -14
- package/dist/tasks/eligibility.js.map +1 -1
- package/dist/tasks/identity.d.ts +41 -15
- package/dist/tasks/identity.js +100 -31
- package/dist/tasks/identity.js.map +1 -1
- package/dist/tasks/markdown.d.ts +7 -14
- package/dist/tasks/markdown.js +15 -29
- package/dist/tasks/markdown.js.map +1 -1
- package/dist/tasks/model.d.ts +20 -4
- package/dist/tasks/model.js +17 -0
- package/dist/tasks/model.js.map +1 -1
- package/dist/tasks/sources.d.ts +7 -2
- package/dist/tasks/sources.js +46 -35
- package/dist/tasks/sources.js.map +1 -1
- package/dist/ui/chat-client.d.ts +70 -0
- package/dist/ui/chat-client.js +209 -0
- package/dist/ui/chat-client.js.map +1 -0
- package/dist/ui/dashboard.d.ts +8 -5
- package/dist/ui/dashboard.js +227 -86
- package/dist/ui/dashboard.js.map +1 -1
- package/dist/ui/details.d.ts +64 -0
- package/dist/ui/details.js +175 -0
- package/dist/ui/details.js.map +1 -0
- package/dist/ui/global-dashboard.d.ts +59 -0
- package/dist/ui/global-dashboard.js +307 -0
- package/dist/ui/global-dashboard.js.map +1 -0
- package/dist/ui/status-view.d.ts +7 -0
- package/dist/ui/status-view.js +94 -36
- package/dist/ui/status-view.js.map +1 -1
- package/package.json +1 -1
- package/dist/engine/requests.d.ts +0 -111
- package/dist/engine/requests.js +0 -173
- package/dist/engine/requests.js.map +0 -1
- package/dist/expert/book-language/commitments/task-id.md +0 -9
- package/dist/tasks/prepare.d.ts +0 -33
- package/dist/tasks/prepare.js +0 -90
- package/dist/tasks/prepare.js.map +0 -1
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { type EffectiveSettings } from '../project/config.js';
|
|
2
2
|
import type { Project } from '../project/workspace.js';
|
|
3
3
|
import type { BridgeTool } from '../engine/bridge.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { TaskChats } from '../chats/task-chats.js';
|
|
5
5
|
import type { TaskTrace } from '../engine/task-trace.js';
|
|
6
|
+
import type { BrowserDetailView } from '../engine/snapshot.js';
|
|
7
|
+
import type { ControlOutcome } from '../service/actions.js';
|
|
8
|
+
import { promptbookAppData } from '../common/app-data.js';
|
|
6
9
|
import { BrowserRecorder } from './recording.js';
|
|
7
10
|
/**
|
|
8
11
|
* Locates a Chrome-compatible browser (configuration, `CHROME_PATH`, standard locations, PATH).
|
|
@@ -11,17 +14,67 @@ import { BrowserRecorder } from './recording.js';
|
|
|
11
14
|
*/
|
|
12
15
|
export declare function findBrowserExecutable(settings: EffectiveSettings, env?: NodeJS.ProcessEnv): Promise<string | undefined>;
|
|
13
16
|
/**
|
|
14
|
-
*
|
|
17
|
+
* Where the project's browser profile comes from (saved in ptbk.json as a portable kind, never a machine path for
|
|
18
|
+
* the managed global profile).
|
|
15
19
|
*
|
|
16
20
|
* @private project browser
|
|
17
21
|
*/
|
|
18
|
-
export
|
|
22
|
+
export type BrowserProfileSource = 'global' | 'isolated' | 'user' | 'custom';
|
|
23
|
+
/**
|
|
24
|
+
* Classifies a `browser.profile` value: `global`, `isolated`, `user`, or a custom profile path.
|
|
25
|
+
*
|
|
26
|
+
* @private project browser
|
|
27
|
+
*/
|
|
28
|
+
export declare function browserProfileSource(value: string): BrowserProfileSource;
|
|
29
|
+
export { promptbookAppData };
|
|
30
|
+
/**
|
|
31
|
+
* The dedicated Promptbook-managed browser profile shared by this user's projects (not the user's own Chrome profile).
|
|
32
|
+
*
|
|
33
|
+
* @private project browser
|
|
34
|
+
*/
|
|
35
|
+
export declare function globalBrowserProfile(env?: NodeJS.ProcessEnv): string;
|
|
36
|
+
/**
|
|
37
|
+
* The user's ordinary Chrome user-data directory on this platform.
|
|
38
|
+
*
|
|
39
|
+
* @private project browser
|
|
40
|
+
*/
|
|
41
|
+
export declare function userChromeProfile(env?: NodeJS.ProcessEnv): string;
|
|
42
|
+
/**
|
|
43
|
+
* Resolves the profile directory of the selected source: the managed global profile, the isolated project profile in
|
|
44
|
+
* `.ptbk/`, the user's Chrome profile, or a custom path (relative paths resolve against the project).
|
|
45
|
+
*
|
|
46
|
+
* @private project browser
|
|
47
|
+
*/
|
|
48
|
+
export declare function browserProfileDirectory(project: Project, settings: EffectiveSettings, env?: NodeJS.ProcessEnv): string;
|
|
49
|
+
/**
|
|
50
|
+
* Human description of a `browser.profile` value.
|
|
51
|
+
*
|
|
52
|
+
* @private project browser
|
|
53
|
+
*/
|
|
54
|
+
export declare function describeBrowserProfile(value: string): string;
|
|
19
55
|
/**
|
|
20
56
|
* Checks whether another browser process currently owns a profile (Chrome's singleton lock).
|
|
21
57
|
*
|
|
22
58
|
* @private project browser
|
|
23
59
|
*/
|
|
24
60
|
export declare function profileOwner(profileDirectory: string): Promise<number | undefined>;
|
|
61
|
+
/**
|
|
62
|
+
* Observed health of the project browser (engine-owned diagnosis and recovery; never inferred from configuration).
|
|
63
|
+
*
|
|
64
|
+
* @private project browser
|
|
65
|
+
*/
|
|
66
|
+
export type BrowserHealth = {
|
|
67
|
+
state: BrowserDetailView['state'];
|
|
68
|
+
checkedAt?: string;
|
|
69
|
+
pid?: number;
|
|
70
|
+
profilePath?: string;
|
|
71
|
+
actualMode?: 'headless' | 'headful';
|
|
72
|
+
executable?: string;
|
|
73
|
+
ownership: BrowserDetailView['ownership'];
|
|
74
|
+
lastFailure?: BrowserDetailView['lastFailure'];
|
|
75
|
+
recovery: NonNullable<BrowserDetailView['recovery']>;
|
|
76
|
+
lastAction?: BrowserDetailView['lastAction'];
|
|
77
|
+
};
|
|
25
78
|
/**
|
|
26
79
|
* The project's single shared browser instance (one profile, one automation owner at a time).
|
|
27
80
|
*
|
|
@@ -31,21 +84,73 @@ export declare class ProjectBrowser {
|
|
|
31
84
|
private readonly project;
|
|
32
85
|
private readonly settings;
|
|
33
86
|
private readonly env;
|
|
87
|
+
/** Publishes health changes to every view. */
|
|
88
|
+
private readonly onChange;
|
|
34
89
|
private child?;
|
|
90
|
+
/** Release of the cross-project claim of a shared profile. */
|
|
91
|
+
private releaseClaim?;
|
|
35
92
|
private connection?;
|
|
36
93
|
private sessionId?;
|
|
37
94
|
private note?;
|
|
38
|
-
/**
|
|
95
|
+
/** A launch in progress (concurrent automatic/manual starts share it: never two owners). */
|
|
96
|
+
private launching?;
|
|
97
|
+
/** The current task used the browser (a restart waits for the task boundary). */
|
|
98
|
+
private usedByTask;
|
|
99
|
+
/** A manual restart waits for the current task to release the browser. */
|
|
100
|
+
private pendingRestart;
|
|
101
|
+
/** Observed health, diagnostics and recovery. */
|
|
102
|
+
private health;
|
|
103
|
+
/** Task-linked recording of browser activity (`traces/<task-file-basename>/video/`). */
|
|
39
104
|
readonly recorder: BrowserRecorder;
|
|
40
|
-
constructor(project: Project, settings: () => EffectiveSettings, env: NodeJS.ProcessEnv
|
|
105
|
+
constructor(project: Project, settings: () => EffectiveSettings, env: NodeJS.ProcessEnv,
|
|
106
|
+
/** Publishes health changes to every view. */
|
|
107
|
+
onChange?: () => void);
|
|
108
|
+
/** Updates the observed health and notifies the views. */
|
|
109
|
+
private setHealth;
|
|
110
|
+
/** Records a real launch/connection failure with redacted evidence. */
|
|
111
|
+
private recordFailure;
|
|
112
|
+
/**
|
|
113
|
+
* The browser as the engine sees it: effective profile source and resolved path, requested/actual mode, health,
|
|
114
|
+
* ownership, last failure and recovery. A profile path is diagnostic data, never permission to read its contents.
|
|
115
|
+
*/
|
|
116
|
+
inspect(): BrowserDetailView;
|
|
117
|
+
/** Records the outcome of a manual browser action. */
|
|
118
|
+
private acted;
|
|
119
|
+
/**
|
|
120
|
+
* Diagnostic recheck (no launch, no change): browser executable, profile existence and ownership, and the live
|
|
121
|
+
* connection when the browser runs.
|
|
122
|
+
*/
|
|
123
|
+
recheck(): Promise<ControlOutcome>;
|
|
124
|
+
/** Retries browser startup now (sharing any launch already in progress); a shared profile is released again when idle. */
|
|
125
|
+
retry(): Promise<ControlOutcome>;
|
|
126
|
+
/**
|
|
127
|
+
* Restarts only this project's own browser process, preserving the selected profile and its sessions. While a task
|
|
128
|
+
* uses the browser the restart waits for that task's boundary instead of breaking its work.
|
|
129
|
+
*/
|
|
130
|
+
restart(): Promise<ControlOutcome>;
|
|
131
|
+
/** Performs a restart at a safe boundary. */
|
|
132
|
+
private restartNow;
|
|
133
|
+
/** After a task: performs a deferred restart and releases a shared profile. */
|
|
134
|
+
taskFinished(): Promise<void>;
|
|
135
|
+
/** Handles a lost connection: stops only this project's browser process; the next use relaunches it. */
|
|
136
|
+
private connectionLost;
|
|
41
137
|
/** Associates subsequent browser use with a task attempt for recording. */
|
|
42
138
|
useFor(trace: TaskTrace, attempt: string): Promise<void>;
|
|
43
139
|
/** Unsubscribes the page-transition listener of the current connection. */
|
|
44
140
|
private navigationListener?;
|
|
45
141
|
/** Ensures the browser runs and recording of the attached task has begun. */
|
|
46
142
|
private active;
|
|
47
|
-
/**
|
|
143
|
+
/**
|
|
144
|
+
* Launches (or reuses) the browser and attaches to one page. A technical launch failure is retried automatically
|
|
145
|
+
* within a bound; concurrent callers share one launch, so automatic and manual recovery never start two owners.
|
|
146
|
+
*/
|
|
48
147
|
private ensure;
|
|
148
|
+
/** Bounded automatic launch recovery with recorded attempts, causes and next retry. */
|
|
149
|
+
private launchWithRecovery;
|
|
150
|
+
/** One launch attempt of the configured browser and profile. */
|
|
151
|
+
private launchOnce;
|
|
152
|
+
/** Starts the browser process and attaches to one page. */
|
|
153
|
+
private launch;
|
|
49
154
|
/** Evaluates JavaScript in the page and returns its value. */
|
|
50
155
|
private evaluate;
|
|
51
156
|
/** Text and interactive elements of the current page (elements get stable `ref` numbers). */
|
|
@@ -64,15 +169,20 @@ export declare class ProjectBrowser {
|
|
|
64
169
|
bringToFront(): Promise<string | undefined>;
|
|
65
170
|
/** Stops only the browser process this service launched (never the user's browsers or the profile). */
|
|
66
171
|
close(): void;
|
|
172
|
+
/** Releases this project's claim of a shared profile. */
|
|
173
|
+
private releaseProfile;
|
|
174
|
+
/**
|
|
175
|
+
* After a task: a browser on a shared profile (global, user or custom) is closed so other projects can use the
|
|
176
|
+
* profile; the isolated project profile stays open for the next task.
|
|
177
|
+
*/
|
|
178
|
+
releaseShared(): void;
|
|
67
179
|
}
|
|
68
180
|
/**
|
|
69
181
|
* Browser tools exposed to agents through the ptbk MCP bridge.
|
|
70
182
|
*
|
|
71
183
|
* @private project browser
|
|
72
184
|
*/
|
|
73
|
-
export declare function browserTools(browser: ProjectBrowser,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
agent?: string;
|
|
78
|
-
}, onUserRequest: (request: UserRequest) => void): BridgeTool[];
|
|
185
|
+
export declare function browserTools(browser: ProjectBrowser, chats: TaskChats | undefined, agent: string, onUserChat: (chat: {
|
|
186
|
+
chat: string;
|
|
187
|
+
awaited: number;
|
|
188
|
+
}) => void): BridgeTool[];
|