@promptbook/markdown-utils 0.112.0-11 → 0.112.0-12
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/esm/index.es.js +1 -1
- package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +1 -1
- package/esm/src/book-components/Chat/Chat/ChatToolCallModal.test.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +4 -0
- package/esm/src/book-components/Chat/utils/getToolCallChipletInfo.timeout.test.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +123 -0
- package/esm/src/book-components/Chat/utils/timeoutToolCallPresentation.test.d.ts +1 -0
- package/esm/src/commitments/USE_CALENDAR/USE_CALENDAR.d.ts +42 -0
- package/esm/src/commitments/USE_CALENDAR/USE_CALENDAR.test.d.ts +1 -0
- package/esm/src/commitments/USE_CALENDAR/UseCalendarToolNames.d.ts +13 -0
- package/esm/src/commitments/USE_CALENDAR/UseCalendarWallet.d.ts +9 -0
- package/esm/src/commitments/USE_CALENDAR/calendarReference.d.ts +68 -0
- package/esm/src/commitments/USE_CALENDAR/callGoogleCalendarApi.d.ts +19 -0
- package/esm/src/commitments/USE_CALENDAR/createUseCalendarToolFunctions.d.ts +8 -0
- package/esm/src/commitments/USE_CALENDAR/createUseCalendarTools.d.ts +7 -0
- package/esm/src/commitments/USE_CALENDAR/getUseCalendarToolTitles.d.ts +7 -0
- package/esm/src/commitments/USE_CALENDAR/normalizeConfiguredCalendars.d.ts +19 -0
- package/esm/src/commitments/USE_CALENDAR/resolveUseCalendarToolRuntimeOrWalletCredentialResult.d.ts +34 -0
- package/esm/src/commitments/_common/toolRuntimeContext.d.ts +9 -0
- package/esm/src/commitments/index.d.ts +2 -1
- package/esm/src/executables/apps/locateVscode.d.ts +7 -0
- package/esm/src/executables/apps/locateVscode.test.d.ts +1 -0
- package/esm/src/executables/browsers/locateBrowser.d.ts +10 -0
- package/esm/src/executables/browsers/locateBrowser.test.d.ts +1 -0
- package/esm/src/executables/browsers/locateChrome.d.ts +7 -0
- package/esm/src/executables/browsers/locateChrome.test.d.ts +1 -0
- package/esm/src/executables/browsers/locateDefaultSystemBrowser.d.ts +10 -0
- package/esm/src/executables/browsers/locateDefaultSystemBrowser.test.d.ts +1 -0
- package/esm/src/executables/browsers/locateEdge.d.ts +7 -0
- package/esm/src/executables/browsers/locateEdge.test.d.ts +1 -0
- package/esm/src/executables/browsers/locateFirefox.d.ts +7 -0
- package/esm/src/executables/browsers/locateFirefox.test.d.ts +1 -0
- package/esm/src/executables/browsers/locateInternetExplorer.d.ts +7 -0
- package/esm/src/executables/browsers/locateInternetExplorer.test.d.ts +1 -0
- package/esm/src/executables/browsers/locateSafari.d.ts +7 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +1 -1
- package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +1 -1
- package/umd/src/book-components/Chat/Chat/ChatToolCallModal.test.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +4 -0
- package/umd/src/book-components/Chat/utils/getToolCallChipletInfo.timeout.test.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +123 -0
- package/umd/src/book-components/Chat/utils/timeoutToolCallPresentation.test.d.ts +1 -0
- package/umd/src/commitments/USE_CALENDAR/USE_CALENDAR.d.ts +42 -0
- package/umd/src/commitments/USE_CALENDAR/USE_CALENDAR.test.d.ts +1 -0
- package/umd/src/commitments/USE_CALENDAR/UseCalendarToolNames.d.ts +13 -0
- package/umd/src/commitments/USE_CALENDAR/UseCalendarWallet.d.ts +9 -0
- package/umd/src/commitments/USE_CALENDAR/calendarReference.d.ts +68 -0
- package/umd/src/commitments/USE_CALENDAR/callGoogleCalendarApi.d.ts +19 -0
- package/umd/src/commitments/USE_CALENDAR/createUseCalendarToolFunctions.d.ts +8 -0
- package/umd/src/commitments/USE_CALENDAR/createUseCalendarTools.d.ts +7 -0
- package/umd/src/commitments/USE_CALENDAR/getUseCalendarToolTitles.d.ts +7 -0
- package/umd/src/commitments/USE_CALENDAR/normalizeConfiguredCalendars.d.ts +19 -0
- package/umd/src/commitments/USE_CALENDAR/resolveUseCalendarToolRuntimeOrWalletCredentialResult.d.ts +34 -0
- package/umd/src/commitments/_common/toolRuntimeContext.d.ts +9 -0
- package/umd/src/commitments/index.d.ts +2 -1
- package/umd/src/executables/apps/locateVscode.d.ts +7 -0
- package/umd/src/executables/apps/locateVscode.test.d.ts +1 -0
- package/umd/src/executables/browsers/locateBrowser.d.ts +10 -0
- package/umd/src/executables/browsers/locateBrowser.test.d.ts +1 -0
- package/umd/src/executables/browsers/locateChrome.d.ts +7 -0
- package/umd/src/executables/browsers/locateChrome.test.d.ts +1 -0
- package/umd/src/executables/browsers/locateDefaultSystemBrowser.d.ts +10 -0
- package/umd/src/executables/browsers/locateDefaultSystemBrowser.test.d.ts +1 -0
- package/umd/src/executables/browsers/locateEdge.d.ts +7 -0
- package/umd/src/executables/browsers/locateEdge.test.d.ts +1 -0
- package/umd/src/executables/browsers/locateFirefox.d.ts +7 -0
- package/umd/src/executables/browsers/locateFirefox.test.d.ts +1 -0
- package/umd/src/executables/browsers/locateInternetExplorer.d.ts +7 -0
- package/umd/src/executables/browsers/locateInternetExplorer.test.d.ts +1 -0
- package/umd/src/executables/browsers/locateSafari.d.ts +7 -0
- package/umd/src/version.d.ts +1 -1
package/esm/index.es.js
CHANGED
|
@@ -23,7 +23,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
23
23
|
* @generated
|
|
24
24
|
* @see https://github.com/webgptorg/promptbook
|
|
25
25
|
*/
|
|
26
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
26
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-12';
|
|
27
27
|
/**
|
|
28
28
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
29
29
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -31,7 +31,7 @@ export type AgentCapability = {
|
|
|
31
31
|
/**
|
|
32
32
|
* The type of the capability
|
|
33
33
|
*/
|
|
34
|
-
type: 'browser' | 'search-engine' | 'knowledge' | 'timeout' | 'time' | 'user-location' | 'inheritance' | 'import' | 'image-generator' | 'team' | 'email' | 'popup' | 'privacy' | 'project' | 'wallet';
|
|
34
|
+
type: 'browser' | 'search-engine' | 'knowledge' | 'timeout' | 'time' | 'user-location' | 'inheritance' | 'import' | 'image-generator' | 'team' | 'email' | 'popup' | 'privacy' | 'project' | 'calendar' | 'wallet';
|
|
35
35
|
/**
|
|
36
36
|
* The label to display for this capability
|
|
37
37
|
*/
|
|
@@ -25,6 +25,10 @@ type ToolCallDetailsOptions = {
|
|
|
25
25
|
* Chat button color for fallback styling.
|
|
26
26
|
*/
|
|
27
27
|
buttonColor: WithTake<Color>;
|
|
28
|
+
/**
|
|
29
|
+
* Requests switching the modal into advanced technical mode.
|
|
30
|
+
*/
|
|
31
|
+
onRequestAdvancedView?: () => void;
|
|
28
32
|
};
|
|
29
33
|
/**
|
|
30
34
|
* Renders the detail view for a single tool call.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { TODO_any } from '../../../utils/organization/TODO_any';
|
|
2
|
+
/**
|
|
3
|
+
* Action performed by timeout tools.
|
|
4
|
+
*
|
|
5
|
+
* @private internal timeout-chat type
|
|
6
|
+
*/
|
|
7
|
+
export type TimeoutToolCallAction = 'set' | 'cancel';
|
|
8
|
+
/**
|
|
9
|
+
* Friendly presentation payload derived from timeout tool arguments and result.
|
|
10
|
+
*
|
|
11
|
+
* @private internal utility of `<Chat/>`
|
|
12
|
+
*/
|
|
13
|
+
export type TimeoutToolCallPresentation = {
|
|
14
|
+
/**
|
|
15
|
+
* Timeout action represented by this tool call.
|
|
16
|
+
*/
|
|
17
|
+
readonly action: TimeoutToolCallAction;
|
|
18
|
+
/**
|
|
19
|
+
* Timeout operation status from tool result.
|
|
20
|
+
*/
|
|
21
|
+
readonly status: string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Requested timeout duration in milliseconds.
|
|
24
|
+
*/
|
|
25
|
+
readonly milliseconds: number | null;
|
|
26
|
+
/**
|
|
27
|
+
* Optional timeout identifier returned by runtime.
|
|
28
|
+
*/
|
|
29
|
+
readonly timeoutId: string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Optional custom timeout wake-up message.
|
|
32
|
+
*/
|
|
33
|
+
readonly message: string | null;
|
|
34
|
+
/**
|
|
35
|
+
* Parsed due date for scheduled timeout.
|
|
36
|
+
*/
|
|
37
|
+
readonly dueAtDate: Date | null;
|
|
38
|
+
/**
|
|
39
|
+
* Exact due timestamp in ISO UTC format.
|
|
40
|
+
*/
|
|
41
|
+
readonly dueAtIsoUtc: string | null;
|
|
42
|
+
/**
|
|
43
|
+
* Local timezone used for user-facing rendering.
|
|
44
|
+
*/
|
|
45
|
+
readonly localTimezone: string;
|
|
46
|
+
/**
|
|
47
|
+
* Compact duration label used by timeout chips.
|
|
48
|
+
*/
|
|
49
|
+
readonly compactDurationLabel: string | null;
|
|
50
|
+
/**
|
|
51
|
+
* Long duration label used by timeout detail popup copy.
|
|
52
|
+
*/
|
|
53
|
+
readonly humanDurationLabel: string | null;
|
|
54
|
+
/**
|
|
55
|
+
* Relative time label resolved from due date and current time.
|
|
56
|
+
*/
|
|
57
|
+
readonly relativeDueLabel: string | null;
|
|
58
|
+
/**
|
|
59
|
+
* Localized due time for friendly popups.
|
|
60
|
+
*/
|
|
61
|
+
readonly localDueTimeLabel: string | null;
|
|
62
|
+
/**
|
|
63
|
+
* Localized due date for friendly popups.
|
|
64
|
+
*/
|
|
65
|
+
readonly localDueDateLabel: string | null;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Inputs required to derive timeout presentation metadata.
|
|
69
|
+
*
|
|
70
|
+
* @private internal timeout-chat type
|
|
71
|
+
*/
|
|
72
|
+
type ResolveTimeoutToolCallPresentationOptions = {
|
|
73
|
+
/**
|
|
74
|
+
* Tool name being rendered.
|
|
75
|
+
*/
|
|
76
|
+
readonly toolCallName: string;
|
|
77
|
+
/**
|
|
78
|
+
* Parsed tool arguments.
|
|
79
|
+
*/
|
|
80
|
+
readonly args: Record<string, TODO_any>;
|
|
81
|
+
/**
|
|
82
|
+
* Parsed raw tool result payload.
|
|
83
|
+
*/
|
|
84
|
+
readonly resultRaw: TODO_any;
|
|
85
|
+
/**
|
|
86
|
+
* Current date used to calculate relative labels.
|
|
87
|
+
*/
|
|
88
|
+
readonly currentDate?: Date;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Determines whether a tool name belongs to the timeout commitment.
|
|
92
|
+
*
|
|
93
|
+
* @private internal utility of `<Chat/>`
|
|
94
|
+
*/
|
|
95
|
+
export declare function isTimeoutToolCallName(toolName: string): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Resolves friendly timeout presentation metadata from one tool call payload.
|
|
98
|
+
*
|
|
99
|
+
* @private internal utility of `<Chat/>`
|
|
100
|
+
*/
|
|
101
|
+
export declare function resolveTimeoutToolCallPresentation(options: ResolveTimeoutToolCallPresentationOptions): TimeoutToolCallPresentation | null;
|
|
102
|
+
/**
|
|
103
|
+
* Builds concise chip text for timeout tool calls.
|
|
104
|
+
*
|
|
105
|
+
* @private internal utility of `<Chat/>`
|
|
106
|
+
*/
|
|
107
|
+
export declare function buildTimeoutToolCallChipLabel(presentation: TimeoutToolCallPresentation): string;
|
|
108
|
+
/**
|
|
109
|
+
* Builds the primary timeout sentence shown in default modal view.
|
|
110
|
+
*
|
|
111
|
+
* @private internal utility of `<Chat/>`
|
|
112
|
+
*/
|
|
113
|
+
export declare function buildTimeoutToolPrimarySentence(presentation: TimeoutToolCallPresentation): string;
|
|
114
|
+
/**
|
|
115
|
+
* Builds one default-view scheduling sentence with local-time and relative context.
|
|
116
|
+
*
|
|
117
|
+
* @private internal utility of `<Chat/>`
|
|
118
|
+
*/
|
|
119
|
+
export declare function buildTimeoutToolScheduleSentence(presentation: TimeoutToolCallPresentation): string | null;
|
|
120
|
+
export {};
|
|
121
|
+
/**
|
|
122
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
123
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { string_javascript_name } from '../../_packages/types.index';
|
|
2
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
3
|
+
import type { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
|
|
4
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
5
|
+
/**
|
|
6
|
+
* USE CALENDAR commitment definition.
|
|
7
|
+
*
|
|
8
|
+
* `USE CALENDAR` enables calendar tooling so the agent can read and manage events
|
|
9
|
+
* in one configured Google Calendar.
|
|
10
|
+
*
|
|
11
|
+
* Authentication is expected through runtime context provided by the host app UI.
|
|
12
|
+
* Hosts can provide manual wallet tokens or host-managed OAuth tokens.
|
|
13
|
+
*
|
|
14
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
15
|
+
*/
|
|
16
|
+
export declare class UseCalendarCommitmentDefinition extends BaseCommitmentDefinition<'USE CALENDAR'> {
|
|
17
|
+
constructor();
|
|
18
|
+
/**
|
|
19
|
+
* Short one-line description of USE CALENDAR.
|
|
20
|
+
*/
|
|
21
|
+
get description(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Icon for this commitment.
|
|
24
|
+
*/
|
|
25
|
+
get icon(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Markdown documentation for USE CALENDAR commitment.
|
|
28
|
+
*/
|
|
29
|
+
get documentation(): string;
|
|
30
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
31
|
+
/**
|
|
32
|
+
* Gets human-readable titles for tool functions provided by this commitment.
|
|
33
|
+
*/
|
|
34
|
+
getToolTitles(): Record<string_javascript_name, string>;
|
|
35
|
+
/**
|
|
36
|
+
* Gets calendar tool function implementations.
|
|
37
|
+
*/
|
|
38
|
+
getToolFunctions(): Record<string_javascript_name, ToolFunction>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
42
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Names of tools used by the USE CALENDAR commitment.
|
|
3
|
+
*
|
|
4
|
+
* @private constant of UseCalendarCommitmentDefinition
|
|
5
|
+
*/
|
|
6
|
+
export declare const UseCalendarToolNames: {
|
|
7
|
+
readonly listEvents: string;
|
|
8
|
+
readonly getEvent: string;
|
|
9
|
+
readonly createEvent: string;
|
|
10
|
+
readonly updateEvent: string;
|
|
11
|
+
readonly deleteEvent: string;
|
|
12
|
+
readonly inviteGuests: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wallet metadata used by USE CALENDAR when resolving Google Calendar credentials.
|
|
3
|
+
*
|
|
4
|
+
* @private constant of UseCalendarCommitmentDefinition
|
|
5
|
+
*/
|
|
6
|
+
export declare const UseCalendarWallet: {
|
|
7
|
+
readonly service: "google_calendar";
|
|
8
|
+
readonly key: "use-calendar-google-token";
|
|
9
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default Google Calendar OAuth scopes when commitment content does not list any.
|
|
3
|
+
*
|
|
4
|
+
* @private internal USE CALENDAR constant
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEFAULT_GOOGLE_CALENDAR_SCOPES: readonly ["https://www.googleapis.com/auth/calendar"];
|
|
7
|
+
/**
|
|
8
|
+
* Calendar provider types currently supported by USE CALENDAR.
|
|
9
|
+
*
|
|
10
|
+
* @private internal utility of USE CALENDAR commitment
|
|
11
|
+
*/
|
|
12
|
+
export type CalendarProviderType = 'google';
|
|
13
|
+
/**
|
|
14
|
+
* Canonical calendar reference resolved from commitment content.
|
|
15
|
+
*
|
|
16
|
+
* @private internal utility of USE CALENDAR commitment
|
|
17
|
+
*/
|
|
18
|
+
export type CalendarReference = {
|
|
19
|
+
provider: CalendarProviderType;
|
|
20
|
+
url: string;
|
|
21
|
+
calendarId: string;
|
|
22
|
+
scopes: string[];
|
|
23
|
+
tokenRef?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Parsed `USE CALENDAR` payload.
|
|
27
|
+
*
|
|
28
|
+
* @private internal utility of USE CALENDAR commitment
|
|
29
|
+
*/
|
|
30
|
+
export type ParsedUseCalendarCommitmentContent = {
|
|
31
|
+
calendar: CalendarReference | null;
|
|
32
|
+
calendarUrlRaw: string | null;
|
|
33
|
+
instructions: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Parses one Google Calendar URL/reference into canonical details.
|
|
37
|
+
*
|
|
38
|
+
* Supported input forms:
|
|
39
|
+
* - `https://calendar.google.com/...`
|
|
40
|
+
* - `calendar.google.com/...`
|
|
41
|
+
*
|
|
42
|
+
* @private internal utility of USE CALENDAR commitment
|
|
43
|
+
*/
|
|
44
|
+
export declare function parseGoogleCalendarReference(rawReference: string): CalendarReference | null;
|
|
45
|
+
/**
|
|
46
|
+
* Parses `USE CALENDAR` commitment content into calendar reference + optional instructions.
|
|
47
|
+
*
|
|
48
|
+
* @private internal utility of USE CALENDAR commitment
|
|
49
|
+
*/
|
|
50
|
+
export declare function parseUseCalendarCommitmentContent(content: string): ParsedUseCalendarCommitmentContent;
|
|
51
|
+
/**
|
|
52
|
+
* Extracts canonical calendar references from parsed commitments.
|
|
53
|
+
*
|
|
54
|
+
* @private internal utility of USE CALENDAR commitment
|
|
55
|
+
*/
|
|
56
|
+
export declare function extractUseCalendarReferencesFromCommitments(commitments: ReadonlyArray<{
|
|
57
|
+
type: string;
|
|
58
|
+
content: string;
|
|
59
|
+
}>): CalendarReference[];
|
|
60
|
+
/**
|
|
61
|
+
* Attempts to resolve one concrete Google Calendar id from URL.
|
|
62
|
+
*
|
|
63
|
+
* @private internal utility of USE CALENDAR commitment
|
|
64
|
+
*/
|
|
65
|
+
export declare function parseGoogleCalendarIdFromUrl(url: URL): string | null;
|
|
66
|
+
/**
|
|
67
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
68
|
+
*/
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for one Google Calendar API call.
|
|
3
|
+
*
|
|
4
|
+
* @private type of callGoogleCalendarApi
|
|
5
|
+
*/
|
|
6
|
+
type CallGoogleCalendarApiOptions = {
|
|
7
|
+
method: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
8
|
+
path: string;
|
|
9
|
+
query?: Record<string, string>;
|
|
10
|
+
body?: Record<string, unknown>;
|
|
11
|
+
allowNotFound?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Runs one Google Calendar API request and parses JSON response payload.
|
|
15
|
+
*
|
|
16
|
+
* @private function of UseCalendarCommitmentDefinition
|
|
17
|
+
*/
|
|
18
|
+
export declare function callGoogleCalendarApi<TResponse = unknown>(accessToken: string, options: CallGoogleCalendarApiOptions): Promise<TResponse | null>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { string_javascript_name } from '../../_packages/types.index';
|
|
2
|
+
import type { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
|
|
3
|
+
/**
|
|
4
|
+
* Gets Google Calendar tool function implementations.
|
|
5
|
+
*
|
|
6
|
+
* @private function of UseCalendarCommitmentDefinition
|
|
7
|
+
*/
|
|
8
|
+
export declare function createUseCalendarToolFunctions(): Record<string_javascript_name, ToolFunction>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LlmToolDefinition } from '../../types/LlmToolDefinition';
|
|
2
|
+
/**
|
|
3
|
+
* Adds USE CALENDAR tool definitions while keeping already registered tools untouched.
|
|
4
|
+
*
|
|
5
|
+
* @private function of UseCalendarCommitmentDefinition
|
|
6
|
+
*/
|
|
7
|
+
export declare function createUseCalendarTools(existingTools: ReadonlyArray<LlmToolDefinition>): Array<LlmToolDefinition>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { string_javascript_name } from '../../_packages/types.index';
|
|
2
|
+
/**
|
|
3
|
+
* Gets human-readable tool labels for USE CALENDAR functions.
|
|
4
|
+
*
|
|
5
|
+
* @private function of UseCalendarCommitmentDefinition
|
|
6
|
+
*/
|
|
7
|
+
export declare function getUseCalendarToolTitles(): Record<string_javascript_name, string>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CalendarProviderType } from './calendarReference';
|
|
2
|
+
/**
|
|
3
|
+
* Normalized calendar definition persisted in USE CALENDAR metadata.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of USE CALENDAR commitment
|
|
6
|
+
*/
|
|
7
|
+
export type ConfiguredCalendar = {
|
|
8
|
+
provider: CalendarProviderType;
|
|
9
|
+
url: string;
|
|
10
|
+
calendarId: string;
|
|
11
|
+
scopes: string[];
|
|
12
|
+
tokenRef?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Normalizes unknown metadata payload into a typed list of configured calendars.
|
|
16
|
+
*
|
|
17
|
+
* @private internal utility of USE CALENDAR commitment
|
|
18
|
+
*/
|
|
19
|
+
export declare function normalizeConfiguredCalendars(rawCalendars: unknown): ConfiguredCalendar[];
|
package/esm/src/commitments/USE_CALENDAR/resolveUseCalendarToolRuntimeOrWalletCredentialResult.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type CalendarReference } from './calendarReference';
|
|
2
|
+
/**
|
|
3
|
+
* Shared hidden arguments potentially injected into any USE CALENDAR tool call.
|
|
4
|
+
*
|
|
5
|
+
* @private type of UseCalendarCommitmentDefinition
|
|
6
|
+
*/
|
|
7
|
+
export type UseCalendarToolArgsBase = {
|
|
8
|
+
calendarUrl?: string;
|
|
9
|
+
__promptbookToolRuntimeContext?: unknown;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Resolved runtime payload used by USE CALENDAR tools.
|
|
13
|
+
*
|
|
14
|
+
* @private type of resolveUseCalendarToolRuntimeOrWalletCredentialResult
|
|
15
|
+
*/
|
|
16
|
+
type UseCalendarResolvedRuntime = {
|
|
17
|
+
calendarReference: CalendarReference;
|
|
18
|
+
accessToken: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Runtime resolution result for USE CALENDAR tools.
|
|
22
|
+
*
|
|
23
|
+
* @private type of UseCalendarCommitmentDefinition
|
|
24
|
+
*/
|
|
25
|
+
export type UseCalendarToolRuntimeResolution = UseCalendarResolvedRuntime | {
|
|
26
|
+
walletResult: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Resolves calendar runtime or returns a wallet-credential-required payload when missing.
|
|
30
|
+
*
|
|
31
|
+
* @private function of UseCalendarCommitmentDefinition
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveUseCalendarToolRuntimeOrWalletCredentialResult(args: UseCalendarToolArgsBase): UseCalendarToolRuntimeResolution;
|
|
34
|
+
export {};
|
|
@@ -85,6 +85,15 @@ export type ToolRuntimeContext = {
|
|
|
85
85
|
smtpCredential?: string;
|
|
86
86
|
fromAddress?: string;
|
|
87
87
|
};
|
|
88
|
+
calendars?: {
|
|
89
|
+
googleAccessToken?: string;
|
|
90
|
+
connections?: Array<{
|
|
91
|
+
provider: string;
|
|
92
|
+
url: string;
|
|
93
|
+
calendarId: string;
|
|
94
|
+
scopes?: string[];
|
|
95
|
+
}>;
|
|
96
|
+
};
|
|
88
97
|
spawn?: {
|
|
89
98
|
depth?: number;
|
|
90
99
|
parentRunId?: string;
|
|
@@ -37,6 +37,7 @@ import { TeamCommitmentDefinition } from './TEAM/TEAM';
|
|
|
37
37
|
import { TemplateCommitmentDefinition } from './TEMPLATE/TEMPLATE';
|
|
38
38
|
import { UseCommitmentDefinition } from './USE/USE';
|
|
39
39
|
import { UseBrowserCommitmentDefinition } from './USE_BROWSER/USE_BROWSER';
|
|
40
|
+
import { UseCalendarCommitmentDefinition } from './USE_CALENDAR/USE_CALENDAR';
|
|
40
41
|
import { UseEmailCommitmentDefinition } from './USE_EMAIL/USE_EMAIL';
|
|
41
42
|
import { UseImageGeneratorCommitmentDefinition } from './USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR';
|
|
42
43
|
import { UseMcpCommitmentDefinition } from './USE_MCP/USE_MCP';
|
|
@@ -58,7 +59,7 @@ import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplemented
|
|
|
58
59
|
*
|
|
59
60
|
* @private Use functions to access commitments instead of this array directly
|
|
60
61
|
*/
|
|
61
|
-
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, LanguageCommitmentDefinition, LanguageCommitmentDefinition, WritingSampleCommitmentDefinition, WritingRulesCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, TemplateCommitmentDefinition, TemplateCommitmentDefinition, FromCommitmentDefinition, ImportCommitmentDefinition, ImportCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, ComponentCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaDomainCommitmentDefinition, MetaDisclaimerCommitmentDefinition, MetaInputPlaceholderCommitmentDefinition, MetaCommitmentDefinition, MetaVoiceCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, InternalMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageSuffixCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, TeamCommitmentDefinition, UseBrowserCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseSpawnCommitmentDefinition, UseTimeoutCommitmentDefinition, UseTimeCommitmentDefinition, UseUserLocationCommitmentDefinition, UseEmailCommitmentDefinition, UsePopupCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseMcpCommitmentDefinition, UsePrivacyCommitmentDefinition, UseProjectCommitmentDefinition, UseCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
62
|
+
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, LanguageCommitmentDefinition, LanguageCommitmentDefinition, WritingSampleCommitmentDefinition, WritingRulesCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, TemplateCommitmentDefinition, TemplateCommitmentDefinition, FromCommitmentDefinition, ImportCommitmentDefinition, ImportCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, ComponentCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaDomainCommitmentDefinition, MetaDisclaimerCommitmentDefinition, MetaInputPlaceholderCommitmentDefinition, MetaCommitmentDefinition, MetaVoiceCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, InternalMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageSuffixCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, TeamCommitmentDefinition, UseBrowserCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseSpawnCommitmentDefinition, UseTimeoutCommitmentDefinition, UseTimeCommitmentDefinition, UseUserLocationCommitmentDefinition, UseCalendarCommitmentDefinition, UseEmailCommitmentDefinition, UsePopupCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseMcpCommitmentDefinition, UsePrivacyCommitmentDefinition, UseProjectCommitmentDefinition, UseCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
62
63
|
/**
|
|
63
64
|
* TODO: [🧠] Maybe create through standardized $register
|
|
64
65
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { string_executable_path } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* @@@
|
|
4
|
+
*
|
|
5
|
+
* @param browser It can be "default", "chrome", "firefox", "safari", "ie", "msie", "edge" or "msedge" or executable path to the browser
|
|
6
|
+
* @returns executable path to browser
|
|
7
|
+
*
|
|
8
|
+
* @private within the repository
|
|
9
|
+
*/
|
|
10
|
+
export declare function locateBrowser(browser: string): Promise<string_executable_path | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { string_executable_path } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* @@@
|
|
4
|
+
*
|
|
5
|
+
* @param browser It can be "default", "chrome", "firefox", "safari", "ie", "msie", "edge" or "msedge" or executable path to the browser
|
|
6
|
+
* @returns executable path to browser
|
|
7
|
+
*
|
|
8
|
+
* @private within the repository
|
|
9
|
+
*/
|
|
10
|
+
export declare function locateDefaultSystemBrowser(): Promise<string_executable_path | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/src/version.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
|
|
|
15
15
|
export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
|
|
16
16
|
/**
|
|
17
17
|
* Represents the version string of the Promptbook engine.
|
|
18
|
-
* It follows semantic versioning (e.g., `0.112.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.112.0-11`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
package/umd/index.umd.js
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* @generated
|
|
25
25
|
* @see https://github.com/webgptorg/promptbook
|
|
26
26
|
*/
|
|
27
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
27
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-12';
|
|
28
28
|
/**
|
|
29
29
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
30
30
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -31,7 +31,7 @@ export type AgentCapability = {
|
|
|
31
31
|
/**
|
|
32
32
|
* The type of the capability
|
|
33
33
|
*/
|
|
34
|
-
type: 'browser' | 'search-engine' | 'knowledge' | 'timeout' | 'time' | 'user-location' | 'inheritance' | 'import' | 'image-generator' | 'team' | 'email' | 'popup' | 'privacy' | 'project' | 'wallet';
|
|
34
|
+
type: 'browser' | 'search-engine' | 'knowledge' | 'timeout' | 'time' | 'user-location' | 'inheritance' | 'import' | 'image-generator' | 'team' | 'email' | 'popup' | 'privacy' | 'project' | 'calendar' | 'wallet';
|
|
35
35
|
/**
|
|
36
36
|
* The label to display for this capability
|
|
37
37
|
*/
|
|
@@ -25,6 +25,10 @@ type ToolCallDetailsOptions = {
|
|
|
25
25
|
* Chat button color for fallback styling.
|
|
26
26
|
*/
|
|
27
27
|
buttonColor: WithTake<Color>;
|
|
28
|
+
/**
|
|
29
|
+
* Requests switching the modal into advanced technical mode.
|
|
30
|
+
*/
|
|
31
|
+
onRequestAdvancedView?: () => void;
|
|
28
32
|
};
|
|
29
33
|
/**
|
|
30
34
|
* Renders the detail view for a single tool call.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { TODO_any } from '../../../utils/organization/TODO_any';
|
|
2
|
+
/**
|
|
3
|
+
* Action performed by timeout tools.
|
|
4
|
+
*
|
|
5
|
+
* @private internal timeout-chat type
|
|
6
|
+
*/
|
|
7
|
+
export type TimeoutToolCallAction = 'set' | 'cancel';
|
|
8
|
+
/**
|
|
9
|
+
* Friendly presentation payload derived from timeout tool arguments and result.
|
|
10
|
+
*
|
|
11
|
+
* @private internal utility of `<Chat/>`
|
|
12
|
+
*/
|
|
13
|
+
export type TimeoutToolCallPresentation = {
|
|
14
|
+
/**
|
|
15
|
+
* Timeout action represented by this tool call.
|
|
16
|
+
*/
|
|
17
|
+
readonly action: TimeoutToolCallAction;
|
|
18
|
+
/**
|
|
19
|
+
* Timeout operation status from tool result.
|
|
20
|
+
*/
|
|
21
|
+
readonly status: string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Requested timeout duration in milliseconds.
|
|
24
|
+
*/
|
|
25
|
+
readonly milliseconds: number | null;
|
|
26
|
+
/**
|
|
27
|
+
* Optional timeout identifier returned by runtime.
|
|
28
|
+
*/
|
|
29
|
+
readonly timeoutId: string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Optional custom timeout wake-up message.
|
|
32
|
+
*/
|
|
33
|
+
readonly message: string | null;
|
|
34
|
+
/**
|
|
35
|
+
* Parsed due date for scheduled timeout.
|
|
36
|
+
*/
|
|
37
|
+
readonly dueAtDate: Date | null;
|
|
38
|
+
/**
|
|
39
|
+
* Exact due timestamp in ISO UTC format.
|
|
40
|
+
*/
|
|
41
|
+
readonly dueAtIsoUtc: string | null;
|
|
42
|
+
/**
|
|
43
|
+
* Local timezone used for user-facing rendering.
|
|
44
|
+
*/
|
|
45
|
+
readonly localTimezone: string;
|
|
46
|
+
/**
|
|
47
|
+
* Compact duration label used by timeout chips.
|
|
48
|
+
*/
|
|
49
|
+
readonly compactDurationLabel: string | null;
|
|
50
|
+
/**
|
|
51
|
+
* Long duration label used by timeout detail popup copy.
|
|
52
|
+
*/
|
|
53
|
+
readonly humanDurationLabel: string | null;
|
|
54
|
+
/**
|
|
55
|
+
* Relative time label resolved from due date and current time.
|
|
56
|
+
*/
|
|
57
|
+
readonly relativeDueLabel: string | null;
|
|
58
|
+
/**
|
|
59
|
+
* Localized due time for friendly popups.
|
|
60
|
+
*/
|
|
61
|
+
readonly localDueTimeLabel: string | null;
|
|
62
|
+
/**
|
|
63
|
+
* Localized due date for friendly popups.
|
|
64
|
+
*/
|
|
65
|
+
readonly localDueDateLabel: string | null;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Inputs required to derive timeout presentation metadata.
|
|
69
|
+
*
|
|
70
|
+
* @private internal timeout-chat type
|
|
71
|
+
*/
|
|
72
|
+
type ResolveTimeoutToolCallPresentationOptions = {
|
|
73
|
+
/**
|
|
74
|
+
* Tool name being rendered.
|
|
75
|
+
*/
|
|
76
|
+
readonly toolCallName: string;
|
|
77
|
+
/**
|
|
78
|
+
* Parsed tool arguments.
|
|
79
|
+
*/
|
|
80
|
+
readonly args: Record<string, TODO_any>;
|
|
81
|
+
/**
|
|
82
|
+
* Parsed raw tool result payload.
|
|
83
|
+
*/
|
|
84
|
+
readonly resultRaw: TODO_any;
|
|
85
|
+
/**
|
|
86
|
+
* Current date used to calculate relative labels.
|
|
87
|
+
*/
|
|
88
|
+
readonly currentDate?: Date;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Determines whether a tool name belongs to the timeout commitment.
|
|
92
|
+
*
|
|
93
|
+
* @private internal utility of `<Chat/>`
|
|
94
|
+
*/
|
|
95
|
+
export declare function isTimeoutToolCallName(toolName: string): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Resolves friendly timeout presentation metadata from one tool call payload.
|
|
98
|
+
*
|
|
99
|
+
* @private internal utility of `<Chat/>`
|
|
100
|
+
*/
|
|
101
|
+
export declare function resolveTimeoutToolCallPresentation(options: ResolveTimeoutToolCallPresentationOptions): TimeoutToolCallPresentation | null;
|
|
102
|
+
/**
|
|
103
|
+
* Builds concise chip text for timeout tool calls.
|
|
104
|
+
*
|
|
105
|
+
* @private internal utility of `<Chat/>`
|
|
106
|
+
*/
|
|
107
|
+
export declare function buildTimeoutToolCallChipLabel(presentation: TimeoutToolCallPresentation): string;
|
|
108
|
+
/**
|
|
109
|
+
* Builds the primary timeout sentence shown in default modal view.
|
|
110
|
+
*
|
|
111
|
+
* @private internal utility of `<Chat/>`
|
|
112
|
+
*/
|
|
113
|
+
export declare function buildTimeoutToolPrimarySentence(presentation: TimeoutToolCallPresentation): string;
|
|
114
|
+
/**
|
|
115
|
+
* Builds one default-view scheduling sentence with local-time and relative context.
|
|
116
|
+
*
|
|
117
|
+
* @private internal utility of `<Chat/>`
|
|
118
|
+
*/
|
|
119
|
+
export declare function buildTimeoutToolScheduleSentence(presentation: TimeoutToolCallPresentation): string | null;
|
|
120
|
+
export {};
|
|
121
|
+
/**
|
|
122
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
123
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { string_javascript_name } from '../../_packages/types.index';
|
|
2
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
3
|
+
import type { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
|
|
4
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
5
|
+
/**
|
|
6
|
+
* USE CALENDAR commitment definition.
|
|
7
|
+
*
|
|
8
|
+
* `USE CALENDAR` enables calendar tooling so the agent can read and manage events
|
|
9
|
+
* in one configured Google Calendar.
|
|
10
|
+
*
|
|
11
|
+
* Authentication is expected through runtime context provided by the host app UI.
|
|
12
|
+
* Hosts can provide manual wallet tokens or host-managed OAuth tokens.
|
|
13
|
+
*
|
|
14
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
15
|
+
*/
|
|
16
|
+
export declare class UseCalendarCommitmentDefinition extends BaseCommitmentDefinition<'USE CALENDAR'> {
|
|
17
|
+
constructor();
|
|
18
|
+
/**
|
|
19
|
+
* Short one-line description of USE CALENDAR.
|
|
20
|
+
*/
|
|
21
|
+
get description(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Icon for this commitment.
|
|
24
|
+
*/
|
|
25
|
+
get icon(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Markdown documentation for USE CALENDAR commitment.
|
|
28
|
+
*/
|
|
29
|
+
get documentation(): string;
|
|
30
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
31
|
+
/**
|
|
32
|
+
* Gets human-readable titles for tool functions provided by this commitment.
|
|
33
|
+
*/
|
|
34
|
+
getToolTitles(): Record<string_javascript_name, string>;
|
|
35
|
+
/**
|
|
36
|
+
* Gets calendar tool function implementations.
|
|
37
|
+
*/
|
|
38
|
+
getToolFunctions(): Record<string_javascript_name, ToolFunction>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
42
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Names of tools used by the USE CALENDAR commitment.
|
|
3
|
+
*
|
|
4
|
+
* @private constant of UseCalendarCommitmentDefinition
|
|
5
|
+
*/
|
|
6
|
+
export declare const UseCalendarToolNames: {
|
|
7
|
+
readonly listEvents: string;
|
|
8
|
+
readonly getEvent: string;
|
|
9
|
+
readonly createEvent: string;
|
|
10
|
+
readonly updateEvent: string;
|
|
11
|
+
readonly deleteEvent: string;
|
|
12
|
+
readonly inviteGuests: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wallet metadata used by USE CALENDAR when resolving Google Calendar credentials.
|
|
3
|
+
*
|
|
4
|
+
* @private constant of UseCalendarCommitmentDefinition
|
|
5
|
+
*/
|
|
6
|
+
export declare const UseCalendarWallet: {
|
|
7
|
+
readonly service: "google_calendar";
|
|
8
|
+
readonly key: "use-calendar-google-token";
|
|
9
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default Google Calendar OAuth scopes when commitment content does not list any.
|
|
3
|
+
*
|
|
4
|
+
* @private internal USE CALENDAR constant
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEFAULT_GOOGLE_CALENDAR_SCOPES: readonly ["https://www.googleapis.com/auth/calendar"];
|
|
7
|
+
/**
|
|
8
|
+
* Calendar provider types currently supported by USE CALENDAR.
|
|
9
|
+
*
|
|
10
|
+
* @private internal utility of USE CALENDAR commitment
|
|
11
|
+
*/
|
|
12
|
+
export type CalendarProviderType = 'google';
|
|
13
|
+
/**
|
|
14
|
+
* Canonical calendar reference resolved from commitment content.
|
|
15
|
+
*
|
|
16
|
+
* @private internal utility of USE CALENDAR commitment
|
|
17
|
+
*/
|
|
18
|
+
export type CalendarReference = {
|
|
19
|
+
provider: CalendarProviderType;
|
|
20
|
+
url: string;
|
|
21
|
+
calendarId: string;
|
|
22
|
+
scopes: string[];
|
|
23
|
+
tokenRef?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Parsed `USE CALENDAR` payload.
|
|
27
|
+
*
|
|
28
|
+
* @private internal utility of USE CALENDAR commitment
|
|
29
|
+
*/
|
|
30
|
+
export type ParsedUseCalendarCommitmentContent = {
|
|
31
|
+
calendar: CalendarReference | null;
|
|
32
|
+
calendarUrlRaw: string | null;
|
|
33
|
+
instructions: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Parses one Google Calendar URL/reference into canonical details.
|
|
37
|
+
*
|
|
38
|
+
* Supported input forms:
|
|
39
|
+
* - `https://calendar.google.com/...`
|
|
40
|
+
* - `calendar.google.com/...`
|
|
41
|
+
*
|
|
42
|
+
* @private internal utility of USE CALENDAR commitment
|
|
43
|
+
*/
|
|
44
|
+
export declare function parseGoogleCalendarReference(rawReference: string): CalendarReference | null;
|
|
45
|
+
/**
|
|
46
|
+
* Parses `USE CALENDAR` commitment content into calendar reference + optional instructions.
|
|
47
|
+
*
|
|
48
|
+
* @private internal utility of USE CALENDAR commitment
|
|
49
|
+
*/
|
|
50
|
+
export declare function parseUseCalendarCommitmentContent(content: string): ParsedUseCalendarCommitmentContent;
|
|
51
|
+
/**
|
|
52
|
+
* Extracts canonical calendar references from parsed commitments.
|
|
53
|
+
*
|
|
54
|
+
* @private internal utility of USE CALENDAR commitment
|
|
55
|
+
*/
|
|
56
|
+
export declare function extractUseCalendarReferencesFromCommitments(commitments: ReadonlyArray<{
|
|
57
|
+
type: string;
|
|
58
|
+
content: string;
|
|
59
|
+
}>): CalendarReference[];
|
|
60
|
+
/**
|
|
61
|
+
* Attempts to resolve one concrete Google Calendar id from URL.
|
|
62
|
+
*
|
|
63
|
+
* @private internal utility of USE CALENDAR commitment
|
|
64
|
+
*/
|
|
65
|
+
export declare function parseGoogleCalendarIdFromUrl(url: URL): string | null;
|
|
66
|
+
/**
|
|
67
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
68
|
+
*/
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for one Google Calendar API call.
|
|
3
|
+
*
|
|
4
|
+
* @private type of callGoogleCalendarApi
|
|
5
|
+
*/
|
|
6
|
+
type CallGoogleCalendarApiOptions = {
|
|
7
|
+
method: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
8
|
+
path: string;
|
|
9
|
+
query?: Record<string, string>;
|
|
10
|
+
body?: Record<string, unknown>;
|
|
11
|
+
allowNotFound?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Runs one Google Calendar API request and parses JSON response payload.
|
|
15
|
+
*
|
|
16
|
+
* @private function of UseCalendarCommitmentDefinition
|
|
17
|
+
*/
|
|
18
|
+
export declare function callGoogleCalendarApi<TResponse = unknown>(accessToken: string, options: CallGoogleCalendarApiOptions): Promise<TResponse | null>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { string_javascript_name } from '../../_packages/types.index';
|
|
2
|
+
import type { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
|
|
3
|
+
/**
|
|
4
|
+
* Gets Google Calendar tool function implementations.
|
|
5
|
+
*
|
|
6
|
+
* @private function of UseCalendarCommitmentDefinition
|
|
7
|
+
*/
|
|
8
|
+
export declare function createUseCalendarToolFunctions(): Record<string_javascript_name, ToolFunction>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LlmToolDefinition } from '../../types/LlmToolDefinition';
|
|
2
|
+
/**
|
|
3
|
+
* Adds USE CALENDAR tool definitions while keeping already registered tools untouched.
|
|
4
|
+
*
|
|
5
|
+
* @private function of UseCalendarCommitmentDefinition
|
|
6
|
+
*/
|
|
7
|
+
export declare function createUseCalendarTools(existingTools: ReadonlyArray<LlmToolDefinition>): Array<LlmToolDefinition>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { string_javascript_name } from '../../_packages/types.index';
|
|
2
|
+
/**
|
|
3
|
+
* Gets human-readable tool labels for USE CALENDAR functions.
|
|
4
|
+
*
|
|
5
|
+
* @private function of UseCalendarCommitmentDefinition
|
|
6
|
+
*/
|
|
7
|
+
export declare function getUseCalendarToolTitles(): Record<string_javascript_name, string>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CalendarProviderType } from './calendarReference';
|
|
2
|
+
/**
|
|
3
|
+
* Normalized calendar definition persisted in USE CALENDAR metadata.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of USE CALENDAR commitment
|
|
6
|
+
*/
|
|
7
|
+
export type ConfiguredCalendar = {
|
|
8
|
+
provider: CalendarProviderType;
|
|
9
|
+
url: string;
|
|
10
|
+
calendarId: string;
|
|
11
|
+
scopes: string[];
|
|
12
|
+
tokenRef?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Normalizes unknown metadata payload into a typed list of configured calendars.
|
|
16
|
+
*
|
|
17
|
+
* @private internal utility of USE CALENDAR commitment
|
|
18
|
+
*/
|
|
19
|
+
export declare function normalizeConfiguredCalendars(rawCalendars: unknown): ConfiguredCalendar[];
|
package/umd/src/commitments/USE_CALENDAR/resolveUseCalendarToolRuntimeOrWalletCredentialResult.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type CalendarReference } from './calendarReference';
|
|
2
|
+
/**
|
|
3
|
+
* Shared hidden arguments potentially injected into any USE CALENDAR tool call.
|
|
4
|
+
*
|
|
5
|
+
* @private type of UseCalendarCommitmentDefinition
|
|
6
|
+
*/
|
|
7
|
+
export type UseCalendarToolArgsBase = {
|
|
8
|
+
calendarUrl?: string;
|
|
9
|
+
__promptbookToolRuntimeContext?: unknown;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Resolved runtime payload used by USE CALENDAR tools.
|
|
13
|
+
*
|
|
14
|
+
* @private type of resolveUseCalendarToolRuntimeOrWalletCredentialResult
|
|
15
|
+
*/
|
|
16
|
+
type UseCalendarResolvedRuntime = {
|
|
17
|
+
calendarReference: CalendarReference;
|
|
18
|
+
accessToken: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Runtime resolution result for USE CALENDAR tools.
|
|
22
|
+
*
|
|
23
|
+
* @private type of UseCalendarCommitmentDefinition
|
|
24
|
+
*/
|
|
25
|
+
export type UseCalendarToolRuntimeResolution = UseCalendarResolvedRuntime | {
|
|
26
|
+
walletResult: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Resolves calendar runtime or returns a wallet-credential-required payload when missing.
|
|
30
|
+
*
|
|
31
|
+
* @private function of UseCalendarCommitmentDefinition
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveUseCalendarToolRuntimeOrWalletCredentialResult(args: UseCalendarToolArgsBase): UseCalendarToolRuntimeResolution;
|
|
34
|
+
export {};
|
|
@@ -85,6 +85,15 @@ export type ToolRuntimeContext = {
|
|
|
85
85
|
smtpCredential?: string;
|
|
86
86
|
fromAddress?: string;
|
|
87
87
|
};
|
|
88
|
+
calendars?: {
|
|
89
|
+
googleAccessToken?: string;
|
|
90
|
+
connections?: Array<{
|
|
91
|
+
provider: string;
|
|
92
|
+
url: string;
|
|
93
|
+
calendarId: string;
|
|
94
|
+
scopes?: string[];
|
|
95
|
+
}>;
|
|
96
|
+
};
|
|
88
97
|
spawn?: {
|
|
89
98
|
depth?: number;
|
|
90
99
|
parentRunId?: string;
|
|
@@ -37,6 +37,7 @@ import { TeamCommitmentDefinition } from './TEAM/TEAM';
|
|
|
37
37
|
import { TemplateCommitmentDefinition } from './TEMPLATE/TEMPLATE';
|
|
38
38
|
import { UseCommitmentDefinition } from './USE/USE';
|
|
39
39
|
import { UseBrowserCommitmentDefinition } from './USE_BROWSER/USE_BROWSER';
|
|
40
|
+
import { UseCalendarCommitmentDefinition } from './USE_CALENDAR/USE_CALENDAR';
|
|
40
41
|
import { UseEmailCommitmentDefinition } from './USE_EMAIL/USE_EMAIL';
|
|
41
42
|
import { UseImageGeneratorCommitmentDefinition } from './USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR';
|
|
42
43
|
import { UseMcpCommitmentDefinition } from './USE_MCP/USE_MCP';
|
|
@@ -58,7 +59,7 @@ import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplemented
|
|
|
58
59
|
*
|
|
59
60
|
* @private Use functions to access commitments instead of this array directly
|
|
60
61
|
*/
|
|
61
|
-
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, LanguageCommitmentDefinition, LanguageCommitmentDefinition, WritingSampleCommitmentDefinition, WritingRulesCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, TemplateCommitmentDefinition, TemplateCommitmentDefinition, FromCommitmentDefinition, ImportCommitmentDefinition, ImportCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, ComponentCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaDomainCommitmentDefinition, MetaDisclaimerCommitmentDefinition, MetaInputPlaceholderCommitmentDefinition, MetaCommitmentDefinition, MetaVoiceCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, InternalMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageSuffixCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, TeamCommitmentDefinition, UseBrowserCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseSpawnCommitmentDefinition, UseTimeoutCommitmentDefinition, UseTimeCommitmentDefinition, UseUserLocationCommitmentDefinition, UseEmailCommitmentDefinition, UsePopupCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseMcpCommitmentDefinition, UsePrivacyCommitmentDefinition, UseProjectCommitmentDefinition, UseCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
62
|
+
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, LanguageCommitmentDefinition, LanguageCommitmentDefinition, WritingSampleCommitmentDefinition, WritingRulesCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, TemplateCommitmentDefinition, TemplateCommitmentDefinition, FromCommitmentDefinition, ImportCommitmentDefinition, ImportCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, ComponentCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaDomainCommitmentDefinition, MetaDisclaimerCommitmentDefinition, MetaInputPlaceholderCommitmentDefinition, MetaCommitmentDefinition, MetaVoiceCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, InternalMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageSuffixCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, TeamCommitmentDefinition, UseBrowserCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseSpawnCommitmentDefinition, UseTimeoutCommitmentDefinition, UseTimeCommitmentDefinition, UseUserLocationCommitmentDefinition, UseCalendarCommitmentDefinition, UseEmailCommitmentDefinition, UsePopupCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseMcpCommitmentDefinition, UsePrivacyCommitmentDefinition, UseProjectCommitmentDefinition, UseCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
62
63
|
/**
|
|
63
64
|
* TODO: [🧠] Maybe create through standardized $register
|
|
64
65
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { string_executable_path } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* @@@
|
|
4
|
+
*
|
|
5
|
+
* @param browser It can be "default", "chrome", "firefox", "safari", "ie", "msie", "edge" or "msedge" or executable path to the browser
|
|
6
|
+
* @returns executable path to browser
|
|
7
|
+
*
|
|
8
|
+
* @private within the repository
|
|
9
|
+
*/
|
|
10
|
+
export declare function locateBrowser(browser: string): Promise<string_executable_path | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { string_executable_path } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* @@@
|
|
4
|
+
*
|
|
5
|
+
* @param browser It can be "default", "chrome", "firefox", "safari", "ie", "msie", "edge" or "msedge" or executable path to the browser
|
|
6
|
+
* @returns executable path to browser
|
|
7
|
+
*
|
|
8
|
+
* @private within the repository
|
|
9
|
+
*/
|
|
10
|
+
export declare function locateDefaultSystemBrowser(): Promise<string_executable_path | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/umd/src/version.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
|
|
|
15
15
|
export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
|
|
16
16
|
/**
|
|
17
17
|
* Represents the version string of the Promptbook engine.
|
|
18
|
-
* It follows semantic versioning (e.g., `0.112.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.112.0-11`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|