@promptbook/cli 0.103.0-52 → 0.103.0-54
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/apps/agents-server/README.md +1 -1
- package/apps/agents-server/config.ts +3 -3
- package/apps/agents-server/next.config.ts +1 -1
- package/apps/agents-server/public/sw.js +16 -0
- package/apps/agents-server/src/app/AddAgentButton.tsx +24 -4
- package/apps/agents-server/src/app/actions.ts +15 -13
- package/apps/agents-server/src/app/admin/api-tokens/ApiTokensClient.tsx +186 -0
- package/apps/agents-server/src/app/admin/api-tokens/page.tsx +13 -0
- package/apps/agents-server/src/app/admin/chat-feedback/ChatFeedbackClient.tsx +541 -0
- package/apps/agents-server/src/app/admin/chat-feedback/page.tsx +22 -0
- package/apps/agents-server/src/app/admin/chat-history/ChatHistoryClient.tsx +532 -0
- package/apps/agents-server/src/app/admin/chat-history/page.tsx +21 -0
- package/apps/agents-server/src/app/admin/metadata/MetadataClient.tsx +241 -27
- package/apps/agents-server/src/app/admin/models/page.tsx +22 -0
- package/apps/agents-server/src/app/admin/users/[userId]/UserDetailClient.tsx +131 -0
- package/apps/agents-server/src/app/admin/users/[userId]/page.tsx +21 -0
- package/apps/agents-server/src/app/admin/users/page.tsx +18 -0
- package/apps/agents-server/src/app/agents/[agentName]/AgentChatWrapper.tsx +10 -2
- package/apps/agents-server/src/app/agents/[agentName]/ClearAgentChatFeedbackButton.tsx +63 -0
- package/apps/agents-server/src/app/agents/[agentName]/ClearAgentChatHistoryButton.tsx +63 -0
- package/apps/agents-server/src/app/agents/[agentName]/CloneAgentButton.tsx +41 -0
- package/apps/agents-server/src/app/agents/[agentName]/InstallPwaButton.tsx +74 -0
- package/apps/agents-server/src/app/agents/[agentName]/ServiceWorkerRegister.tsx +24 -0
- package/apps/agents-server/src/app/agents/[agentName]/_utils.ts +19 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/agents/route.ts +67 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/openai/chat/completions/route.ts +176 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/profile/route.ts +3 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/voice/route.ts +177 -0
- package/apps/agents-server/src/app/agents/[agentName]/book/page.tsx +3 -0
- package/apps/agents-server/src/app/agents/[agentName]/book+chat/AgentBookAndChat.tsx +53 -1
- package/apps/agents-server/src/app/agents/[agentName]/generateAgentMetadata.ts +11 -11
- package/apps/agents-server/src/app/agents/[agentName]/history/RestoreVersionButton.tsx +46 -0
- package/apps/agents-server/src/app/agents/[agentName]/history/actions.ts +12 -0
- package/apps/agents-server/src/app/agents/[agentName]/history/page.tsx +62 -0
- package/apps/agents-server/src/app/agents/[agentName]/images/icon-256.png/route.tsx +80 -0
- package/apps/agents-server/src/app/agents/[agentName]/images/screenshot-fullhd.png/route.tsx +92 -0
- package/apps/agents-server/src/app/agents/[agentName]/images/screenshot-phone.png/route.tsx +92 -0
- package/apps/agents-server/src/app/agents/[agentName]/integration/page.tsx +61 -0
- package/apps/agents-server/src/app/agents/[agentName]/opengraph-image.tsx +102 -0
- package/apps/agents-server/src/app/agents/[agentName]/page.tsx +64 -24
- package/apps/agents-server/src/app/api/agents/[agentName]/clone/route.ts +47 -0
- package/apps/agents-server/src/app/api/agents/[agentName]/route.ts +19 -0
- package/apps/agents-server/src/app/api/agents/route.ts +22 -13
- package/apps/agents-server/src/app/api/api-tokens/route.ts +76 -0
- package/apps/agents-server/src/app/api/auth/login/route.ts +6 -44
- package/apps/agents-server/src/app/api/chat-feedback/[id]/route.ts +38 -0
- package/apps/agents-server/src/app/api/chat-feedback/route.ts +157 -0
- package/apps/agents-server/src/app/api/chat-history/[id]/route.ts +37 -0
- package/apps/agents-server/src/app/api/chat-history/route.ts +147 -0
- package/apps/agents-server/src/app/api/federated-agents/route.ts +17 -0
- package/apps/agents-server/src/app/api/upload/route.ts +9 -1
- package/apps/agents-server/src/app/docs/[docId]/page.tsx +63 -0
- package/apps/agents-server/src/app/docs/page.tsx +34 -0
- package/apps/agents-server/src/app/layout.tsx +29 -3
- package/apps/agents-server/src/app/manifest.ts +109 -0
- package/apps/agents-server/src/app/page.tsx +8 -45
- package/apps/agents-server/src/app/recycle-bin/RestoreAgentButton.tsx +40 -0
- package/apps/agents-server/src/app/recycle-bin/actions.ts +27 -0
- package/apps/agents-server/src/app/recycle-bin/page.tsx +58 -0
- package/apps/agents-server/src/app/restricted/page.tsx +33 -0
- package/apps/agents-server/src/app/test/og-image/README.md +1 -0
- package/apps/agents-server/src/app/test/og-image/opengraph-image.tsx +37 -0
- package/apps/agents-server/src/app/test/og-image/page.tsx +22 -0
- package/apps/agents-server/src/components/Footer/Footer.tsx +175 -0
- package/apps/agents-server/src/components/Header/Header.tsx +450 -79
- package/apps/agents-server/src/components/Homepage/AgentCard.tsx +46 -14
- package/apps/agents-server/src/components/Homepage/AgentsList.tsx +58 -0
- package/apps/agents-server/src/components/Homepage/Card.tsx +1 -1
- package/apps/agents-server/src/components/Homepage/ExternalAgentsSection.tsx +21 -0
- package/apps/agents-server/src/components/Homepage/ExternalAgentsSectionClient.tsx +183 -0
- package/apps/agents-server/src/components/Homepage/ModelsSection.tsx +75 -0
- package/apps/agents-server/src/components/LayoutWrapper/LayoutWrapper.tsx +29 -3
- package/apps/agents-server/src/components/LoginDialog/LoginDialog.tsx +18 -17
- package/apps/agents-server/src/components/Portal/Portal.tsx +38 -0
- package/apps/agents-server/src/components/UsersList/UsersList.tsx +82 -131
- package/apps/agents-server/src/components/UsersList/useUsersAdmin.ts +139 -0
- package/apps/agents-server/src/database/metadataDefaults.ts +38 -6
- package/apps/agents-server/src/database/migrations/2025-12-0010-llm-cache.sql +12 -0
- package/apps/agents-server/src/database/migrations/2025-12-0060-api-tokens.sql +13 -0
- package/apps/agents-server/src/database/schema.ts +51 -0
- package/apps/agents-server/src/middleware.ts +193 -92
- package/apps/agents-server/src/tools/$provideCdnForServer.ts +3 -7
- package/apps/agents-server/src/tools/$provideExecutionToolsForServer.ts +10 -1
- package/apps/agents-server/src/tools/$provideServer.ts +2 -2
- package/apps/agents-server/src/utils/authenticateUser.ts +42 -0
- package/apps/agents-server/src/utils/cache/SupabaseCacheStorage.ts +55 -0
- package/apps/agents-server/src/utils/cdn/classes/VercelBlobStorage.ts +63 -0
- package/apps/agents-server/src/utils/chatFeedbackAdmin.ts +96 -0
- package/apps/agents-server/src/utils/chatHistoryAdmin.ts +96 -0
- package/apps/agents-server/src/utils/getEffectiveFederatedServers.ts +22 -0
- package/apps/agents-server/src/utils/getFederatedAgents.ts +31 -8
- package/apps/agents-server/src/utils/getFederatedServersFromMetadata.ts +10 -0
- package/apps/agents-server/src/utils/getVisibleCommitmentDefinitions.ts +12 -0
- package/apps/agents-server/src/utils/isUserAdmin.ts +2 -2
- package/apps/agents-server/vercel.json +7 -0
- package/esm/index.es.js +279 -2
- package/esm/index.es.js.map +1 -1
- package/esm/typings/servers.d.ts +8 -1
- package/esm/typings/src/_packages/components.index.d.ts +2 -0
- package/esm/typings/src/_packages/core.index.d.ts +6 -0
- package/esm/typings/src/_packages/types.index.d.ts +2 -0
- package/esm/typings/src/_packages/utils.index.d.ts +2 -0
- package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +7 -0
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +4 -0
- package/esm/typings/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +12 -0
- package/esm/typings/src/book-components/icons/MicIcon.d.ts +8 -0
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +17 -0
- package/esm/typings/src/commitments/ACTION/ACTION.d.ts +4 -0
- package/esm/typings/src/commitments/DELETE/DELETE.d.ts +4 -0
- package/esm/typings/src/commitments/FORMAT/FORMAT.d.ts +4 -0
- package/esm/typings/src/commitments/GOAL/GOAL.d.ts +4 -0
- package/esm/typings/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +4 -0
- package/esm/typings/src/commitments/MEMORY/MEMORY.d.ts +4 -0
- package/esm/typings/src/commitments/MESSAGE/AgentMessageCommitmentDefinition.d.ts +32 -0
- package/esm/typings/src/commitments/MESSAGE/InitialMessageCommitmentDefinition.d.ts +4 -0
- package/esm/typings/src/commitments/MESSAGE/MESSAGE.d.ts +4 -0
- package/esm/typings/src/commitments/MESSAGE/UserMessageCommitmentDefinition.d.ts +32 -0
- package/esm/typings/src/commitments/META/META.d.ts +4 -0
- package/esm/typings/src/commitments/META_COLOR/META_COLOR.d.ts +4 -0
- package/esm/typings/src/commitments/META_IMAGE/META_IMAGE.d.ts +4 -0
- package/esm/typings/src/commitments/META_LINK/META_LINK.d.ts +4 -0
- package/esm/typings/src/commitments/MODEL/MODEL.d.ts +4 -0
- package/esm/typings/src/commitments/NOTE/NOTE.d.ts +4 -0
- package/esm/typings/src/commitments/PERSONA/PERSONA.d.ts +4 -0
- package/esm/typings/src/commitments/RULE/RULE.d.ts +4 -0
- package/esm/typings/src/commitments/SAMPLE/SAMPLE.d.ts +4 -0
- package/esm/typings/src/commitments/SCENARIO/SCENARIO.d.ts +4 -0
- package/esm/typings/src/commitments/STYLE/STYLE.d.ts +4 -0
- package/esm/typings/src/commitments/_base/BaseCommitmentDefinition.d.ts +5 -0
- package/esm/typings/src/commitments/_base/CommitmentDefinition.d.ts +5 -0
- package/esm/typings/src/commitments/_base/NotYetImplementedCommitmentDefinition.d.ts +4 -0
- package/esm/typings/src/commitments/index.d.ts +20 -1
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +9 -0
- package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +2 -1
- package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +10 -1
- package/esm/typings/src/utils/normalization/normalizeMessageText.d.ts +9 -0
- package/esm/typings/src/utils/normalization/normalizeMessageText.test.d.ts +1 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +279 -2
- package/umd/index.umd.js.map +1 -1
- package/apps/agents-server/src/utils/cdn/classes/DigitalOceanSpaces.ts +0 -119
package/esm/index.es.js
CHANGED
|
@@ -47,12 +47,23 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
47
47
|
* @generated
|
|
48
48
|
* @see https://github.com/webgptorg/promptbook
|
|
49
49
|
*/
|
|
50
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-
|
|
50
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-54';
|
|
51
51
|
/**
|
|
52
52
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
53
53
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
54
54
|
*/
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Core Promptbook server configuration.
|
|
58
|
+
*
|
|
59
|
+
* This server is also used for auto-federation in the Agents Server.
|
|
60
|
+
*/
|
|
61
|
+
const CORE_SERVER = {
|
|
62
|
+
title: 'Promptbook Core',
|
|
63
|
+
description: `Core Promptbook server used for auto-federation`,
|
|
64
|
+
owner: 'AI Web, LLC <legal@ptbk.io> (https://www.ptbk.io/)',
|
|
65
|
+
urls: ['https://core.ptbk.io/'],
|
|
66
|
+
};
|
|
56
67
|
/**
|
|
57
68
|
* Available remote servers for the Promptbook
|
|
58
69
|
*
|
|
@@ -74,6 +85,7 @@ const REMOTE_SERVER_URLS = [
|
|
|
74
85
|
owner: 'AI Web, LLC <legal@ptbk.io> (https://www.ptbk.io/)',
|
|
75
86
|
urls: ['https://s6.ptbk.io/'],
|
|
76
87
|
},
|
|
88
|
+
CORE_SERVER,
|
|
77
89
|
/*
|
|
78
90
|
Note: Working on older version of Promptbook and not supported anymore
|
|
79
91
|
{
|
|
@@ -86,7 +98,6 @@ const REMOTE_SERVER_URLS = [
|
|
|
86
98
|
*/
|
|
87
99
|
];
|
|
88
100
|
/**
|
|
89
|
-
* TODO: [🐱🚀] Auto-federated server from url in here
|
|
90
101
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
91
102
|
*/
|
|
92
103
|
|
|
@@ -20681,12 +20692,15 @@ class OpenAiAssistantExecutionTools extends OpenAiExecutionTools {
|
|
|
20681
20692
|
fileStreams.push(file);
|
|
20682
20693
|
}
|
|
20683
20694
|
else {
|
|
20695
|
+
/*
|
|
20696
|
+
TODO: [🐱🚀] Resolve problem with browser environment
|
|
20684
20697
|
// Assume it's a local file path
|
|
20685
20698
|
// Note: This will work in Node.js environment
|
|
20686
20699
|
// For browser environments, this would need different handling
|
|
20687
20700
|
const fs = await import('fs');
|
|
20688
20701
|
const fileStream = fs.createReadStream(source);
|
|
20689
20702
|
fileStreams.push(fileStream);
|
|
20703
|
+
*/
|
|
20690
20704
|
}
|
|
20691
20705
|
}
|
|
20692
20706
|
catch (error) {
|
|
@@ -20775,12 +20789,15 @@ class OpenAiAssistantExecutionTools extends OpenAiExecutionTools {
|
|
|
20775
20789
|
fileStreams.push(file);
|
|
20776
20790
|
}
|
|
20777
20791
|
else {
|
|
20792
|
+
/*
|
|
20793
|
+
TODO: [🐱🚀] Resolve problem with browser environment
|
|
20778
20794
|
// Assume it's a local file path
|
|
20779
20795
|
// Note: This will work in Node.js environment
|
|
20780
20796
|
// For browser environments, this would need different handling
|
|
20781
20797
|
const fs = await import('fs');
|
|
20782
20798
|
const fileStream = fs.createReadStream(source);
|
|
20783
20799
|
fileStreams.push(fileStream);
|
|
20800
|
+
*/
|
|
20784
20801
|
}
|
|
20785
20802
|
}
|
|
20786
20803
|
catch (error) {
|
|
@@ -22518,6 +22535,12 @@ class ActionCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
22518
22535
|
get description() {
|
|
22519
22536
|
return 'Define agent capabilities and actions it can perform.';
|
|
22520
22537
|
}
|
|
22538
|
+
/**
|
|
22539
|
+
* Icon for this commitment.
|
|
22540
|
+
*/
|
|
22541
|
+
get icon() {
|
|
22542
|
+
return '⚡';
|
|
22543
|
+
}
|
|
22521
22544
|
/**
|
|
22522
22545
|
* Markdown documentation for ACTION commitment.
|
|
22523
22546
|
*/
|
|
@@ -22597,6 +22620,12 @@ class DeleteCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
22597
22620
|
get description() {
|
|
22598
22621
|
return 'Remove or **disregard** certain information, context, or previous commitments.';
|
|
22599
22622
|
}
|
|
22623
|
+
/**
|
|
22624
|
+
* Icon for this commitment.
|
|
22625
|
+
*/
|
|
22626
|
+
get icon() {
|
|
22627
|
+
return '🗑️';
|
|
22628
|
+
}
|
|
22600
22629
|
/**
|
|
22601
22630
|
* Markdown documentation for DELETE commitment.
|
|
22602
22631
|
*/
|
|
@@ -22713,6 +22742,12 @@ class FormatCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
22713
22742
|
get description() {
|
|
22714
22743
|
return 'Specify output structure or formatting requirements.';
|
|
22715
22744
|
}
|
|
22745
|
+
/**
|
|
22746
|
+
* Icon for this commitment.
|
|
22747
|
+
*/
|
|
22748
|
+
get icon() {
|
|
22749
|
+
return '📜';
|
|
22750
|
+
}
|
|
22716
22751
|
/**
|
|
22717
22752
|
* Markdown documentation for FORMAT commitment.
|
|
22718
22753
|
*/
|
|
@@ -22788,6 +22823,12 @@ class GoalCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
22788
22823
|
get description() {
|
|
22789
22824
|
return 'Define main **goals** the AI assistant should achieve, with later goals having higher priority.';
|
|
22790
22825
|
}
|
|
22826
|
+
/**
|
|
22827
|
+
* Icon for this commitment.
|
|
22828
|
+
*/
|
|
22829
|
+
get icon() {
|
|
22830
|
+
return '🎯';
|
|
22831
|
+
}
|
|
22791
22832
|
/**
|
|
22792
22833
|
* Markdown documentation for GOAL commitment.
|
|
22793
22834
|
*/
|
|
@@ -22884,6 +22925,12 @@ class KnowledgeCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
22884
22925
|
get description() {
|
|
22885
22926
|
return 'Add domain **knowledge** via direct text or external sources (RAG).';
|
|
22886
22927
|
}
|
|
22928
|
+
/**
|
|
22929
|
+
* Icon for this commitment.
|
|
22930
|
+
*/
|
|
22931
|
+
get icon() {
|
|
22932
|
+
return '🧠';
|
|
22933
|
+
}
|
|
22887
22934
|
/**
|
|
22888
22935
|
* Markdown documentation for KNOWLEDGE commitment.
|
|
22889
22936
|
*/
|
|
@@ -22985,6 +23032,12 @@ class MemoryCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
22985
23032
|
get description() {
|
|
22986
23033
|
return 'Remember past interactions and user **preferences** for personalized responses.';
|
|
22987
23034
|
}
|
|
23035
|
+
/**
|
|
23036
|
+
* Icon for this commitment.
|
|
23037
|
+
*/
|
|
23038
|
+
get icon() {
|
|
23039
|
+
return '🧠';
|
|
23040
|
+
}
|
|
22988
23041
|
/**
|
|
22989
23042
|
* Markdown documentation for MEMORY commitment.
|
|
22990
23043
|
*/
|
|
@@ -23059,6 +23112,83 @@ class MemoryCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
23059
23112
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
23060
23113
|
*/
|
|
23061
23114
|
|
|
23115
|
+
/**
|
|
23116
|
+
* AGENT MESSAGE commitment definition
|
|
23117
|
+
*
|
|
23118
|
+
* The AGENT MESSAGE commitment defines a message from the agent in the conversation history.
|
|
23119
|
+
* It is used to pre-fill the chat with a conversation history or to provide few-shot examples.
|
|
23120
|
+
*
|
|
23121
|
+
* Example usage in agent source:
|
|
23122
|
+
*
|
|
23123
|
+
* ```book
|
|
23124
|
+
* AGENT MESSAGE What seems to be the issue?
|
|
23125
|
+
* ```
|
|
23126
|
+
*
|
|
23127
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
23128
|
+
*/
|
|
23129
|
+
class AgentMessageCommitmentDefinition extends BaseCommitmentDefinition {
|
|
23130
|
+
constructor() {
|
|
23131
|
+
super('AGENT MESSAGE');
|
|
23132
|
+
}
|
|
23133
|
+
/**
|
|
23134
|
+
* Short one-line description of AGENT MESSAGE.
|
|
23135
|
+
*/
|
|
23136
|
+
get description() {
|
|
23137
|
+
return 'Defines a **message from the agent** in the conversation history.';
|
|
23138
|
+
}
|
|
23139
|
+
/**
|
|
23140
|
+
* Icon for this commitment.
|
|
23141
|
+
*/
|
|
23142
|
+
get icon() {
|
|
23143
|
+
return '🤖';
|
|
23144
|
+
}
|
|
23145
|
+
/**
|
|
23146
|
+
* Markdown documentation for AGENT MESSAGE commitment.
|
|
23147
|
+
*/
|
|
23148
|
+
get documentation() {
|
|
23149
|
+
return spaceTrim$1(`
|
|
23150
|
+
# ${this.type}
|
|
23151
|
+
|
|
23152
|
+
Defines a message from the agent in the conversation history. This is used to pre-fill the chat with a conversation history or to provide few-shot examples.
|
|
23153
|
+
|
|
23154
|
+
## Key aspects
|
|
23155
|
+
|
|
23156
|
+
- Represents a message sent by the agent.
|
|
23157
|
+
- Used for setting up conversation context.
|
|
23158
|
+
- Can be used in conjunction with USER MESSAGE.
|
|
23159
|
+
|
|
23160
|
+
## Examples
|
|
23161
|
+
|
|
23162
|
+
\`\`\`book
|
|
23163
|
+
Conversation History
|
|
23164
|
+
|
|
23165
|
+
USER MESSAGE Hello, I have a problem.
|
|
23166
|
+
AGENT MESSAGE What seems to be the issue?
|
|
23167
|
+
USER MESSAGE My computer is not starting.
|
|
23168
|
+
\`\`\`
|
|
23169
|
+
`);
|
|
23170
|
+
}
|
|
23171
|
+
applyToAgentModelRequirements(requirements, content) {
|
|
23172
|
+
// AGENT MESSAGE is for UI display purposes / conversation history construction
|
|
23173
|
+
// and typically doesn't need to be added to the system prompt or model requirements directly.
|
|
23174
|
+
// It is extracted separately for the chat interface.
|
|
23175
|
+
var _a;
|
|
23176
|
+
const pendingUserMessage = (_a = requirements.metadata) === null || _a === void 0 ? void 0 : _a.pendingUserMessage;
|
|
23177
|
+
if (pendingUserMessage) {
|
|
23178
|
+
const newSample = { question: pendingUserMessage, answer: content };
|
|
23179
|
+
const newSamples = [...(requirements.samples || []), newSample];
|
|
23180
|
+
const newMetadata = { ...requirements.metadata };
|
|
23181
|
+
delete newMetadata.pendingUserMessage;
|
|
23182
|
+
return {
|
|
23183
|
+
...requirements,
|
|
23184
|
+
samples: newSamples,
|
|
23185
|
+
metadata: newMetadata,
|
|
23186
|
+
};
|
|
23187
|
+
}
|
|
23188
|
+
return requirements;
|
|
23189
|
+
}
|
|
23190
|
+
}
|
|
23191
|
+
|
|
23062
23192
|
/**
|
|
23063
23193
|
* INITIAL MESSAGE commitment definition
|
|
23064
23194
|
*
|
|
@@ -23083,6 +23213,12 @@ class InitialMessageCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
23083
23213
|
get description() {
|
|
23084
23214
|
return 'Defines the **initial message** shown to the user when the chat starts.';
|
|
23085
23215
|
}
|
|
23216
|
+
/**
|
|
23217
|
+
* Icon for this commitment.
|
|
23218
|
+
*/
|
|
23219
|
+
get icon() {
|
|
23220
|
+
return '👋';
|
|
23221
|
+
}
|
|
23086
23222
|
/**
|
|
23087
23223
|
* Markdown documentation for INITIAL MESSAGE commitment.
|
|
23088
23224
|
*/
|
|
@@ -23141,6 +23277,12 @@ class MessageCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
23141
23277
|
get description() {
|
|
23142
23278
|
return 'Include actual **messages** the AI assistant has sent during conversation history.';
|
|
23143
23279
|
}
|
|
23280
|
+
/**
|
|
23281
|
+
* Icon for this commitment.
|
|
23282
|
+
*/
|
|
23283
|
+
get icon() {
|
|
23284
|
+
return '💬';
|
|
23285
|
+
}
|
|
23144
23286
|
/**
|
|
23145
23287
|
* Markdown documentation for MESSAGE commitment.
|
|
23146
23288
|
*/
|
|
@@ -23223,6 +23365,73 @@ class MessageCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
23223
23365
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
23224
23366
|
*/
|
|
23225
23367
|
|
|
23368
|
+
/**
|
|
23369
|
+
* USER MESSAGE commitment definition
|
|
23370
|
+
*
|
|
23371
|
+
* The USER MESSAGE commitment defines a message from the user in the conversation history.
|
|
23372
|
+
* It is used to pre-fill the chat with a conversation history or to provide few-shot examples.
|
|
23373
|
+
*
|
|
23374
|
+
* Example usage in agent source:
|
|
23375
|
+
*
|
|
23376
|
+
* ```book
|
|
23377
|
+
* USER MESSAGE Hello, I have a problem.
|
|
23378
|
+
* ```
|
|
23379
|
+
*
|
|
23380
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
23381
|
+
*/
|
|
23382
|
+
class UserMessageCommitmentDefinition extends BaseCommitmentDefinition {
|
|
23383
|
+
constructor() {
|
|
23384
|
+
super('USER MESSAGE');
|
|
23385
|
+
}
|
|
23386
|
+
/**
|
|
23387
|
+
* Short one-line description of USER MESSAGE.
|
|
23388
|
+
*/
|
|
23389
|
+
get description() {
|
|
23390
|
+
return 'Defines a **message from the user** in the conversation history.';
|
|
23391
|
+
}
|
|
23392
|
+
/**
|
|
23393
|
+
* Icon for this commitment.
|
|
23394
|
+
*/
|
|
23395
|
+
get icon() {
|
|
23396
|
+
return '🧑';
|
|
23397
|
+
}
|
|
23398
|
+
/**
|
|
23399
|
+
* Markdown documentation for USER MESSAGE commitment.
|
|
23400
|
+
*/
|
|
23401
|
+
get documentation() {
|
|
23402
|
+
return spaceTrim$1(`
|
|
23403
|
+
# ${this.type}
|
|
23404
|
+
|
|
23405
|
+
Defines a message from the user in the conversation history. This is used to pre-fill the chat with a conversation history or to provide few-shot examples.
|
|
23406
|
+
|
|
23407
|
+
## Key aspects
|
|
23408
|
+
|
|
23409
|
+
- Represents a message sent by the user.
|
|
23410
|
+
- Used for setting up conversation context.
|
|
23411
|
+
- Can be used in conjunction with AGENT MESSAGE.
|
|
23412
|
+
|
|
23413
|
+
## Examples
|
|
23414
|
+
|
|
23415
|
+
\`\`\`book
|
|
23416
|
+
Conversation History
|
|
23417
|
+
|
|
23418
|
+
USER MESSAGE Hello, I have a problem.
|
|
23419
|
+
AGENT MESSAGE What seems to be the issue?
|
|
23420
|
+
USER MESSAGE My computer is not starting.
|
|
23421
|
+
\`\`\`
|
|
23422
|
+
`);
|
|
23423
|
+
}
|
|
23424
|
+
applyToAgentModelRequirements(requirements, content) {
|
|
23425
|
+
return {
|
|
23426
|
+
...requirements,
|
|
23427
|
+
metadata: {
|
|
23428
|
+
...requirements.metadata,
|
|
23429
|
+
pendingUserMessage: content,
|
|
23430
|
+
},
|
|
23431
|
+
};
|
|
23432
|
+
}
|
|
23433
|
+
}
|
|
23434
|
+
|
|
23226
23435
|
/**
|
|
23227
23436
|
* META commitment definition
|
|
23228
23437
|
*
|
|
@@ -23259,6 +23468,12 @@ class MetaCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
23259
23468
|
get description() {
|
|
23260
23469
|
return 'Set meta-information about the agent (IMAGE, LINK, TITLE, DESCRIPTION, etc.).';
|
|
23261
23470
|
}
|
|
23471
|
+
/**
|
|
23472
|
+
* Icon for this commitment.
|
|
23473
|
+
*/
|
|
23474
|
+
get icon() {
|
|
23475
|
+
return 'ℹ️';
|
|
23476
|
+
}
|
|
23262
23477
|
/**
|
|
23263
23478
|
* Markdown documentation for META commitment.
|
|
23264
23479
|
*/
|
|
@@ -23386,6 +23601,12 @@ class MetaColorCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
23386
23601
|
get description() {
|
|
23387
23602
|
return "Set the agent's accent color.";
|
|
23388
23603
|
}
|
|
23604
|
+
/**
|
|
23605
|
+
* Icon for this commitment.
|
|
23606
|
+
*/
|
|
23607
|
+
get icon() {
|
|
23608
|
+
return '🎨';
|
|
23609
|
+
}
|
|
23389
23610
|
/**
|
|
23390
23611
|
* Markdown documentation for META COLOR commitment.
|
|
23391
23612
|
*/
|
|
@@ -23464,6 +23685,12 @@ class MetaImageCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
23464
23685
|
get description() {
|
|
23465
23686
|
return "Set the agent's profile image URL.";
|
|
23466
23687
|
}
|
|
23688
|
+
/**
|
|
23689
|
+
* Icon for this commitment.
|
|
23690
|
+
*/
|
|
23691
|
+
get icon() {
|
|
23692
|
+
return '🖼️';
|
|
23693
|
+
}
|
|
23467
23694
|
/**
|
|
23468
23695
|
* Markdown documentation for META IMAGE commitment.
|
|
23469
23696
|
*/
|
|
@@ -23554,6 +23781,12 @@ class ModelCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
23554
23781
|
get description() {
|
|
23555
23782
|
return 'Enforce AI model requirements including name and technical parameters.';
|
|
23556
23783
|
}
|
|
23784
|
+
/**
|
|
23785
|
+
* Icon for this commitment.
|
|
23786
|
+
*/
|
|
23787
|
+
get icon() {
|
|
23788
|
+
return '⚙️';
|
|
23789
|
+
}
|
|
23557
23790
|
/**
|
|
23558
23791
|
* Markdown documentation for MODEL commitment.
|
|
23559
23792
|
*/
|
|
@@ -23789,6 +24022,12 @@ class NoteCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
23789
24022
|
get description() {
|
|
23790
24023
|
return 'Add developer-facing notes without changing behavior or output.';
|
|
23791
24024
|
}
|
|
24025
|
+
/**
|
|
24026
|
+
* Icon for this commitment.
|
|
24027
|
+
*/
|
|
24028
|
+
get icon() {
|
|
24029
|
+
return '📝';
|
|
24030
|
+
}
|
|
23792
24031
|
/**
|
|
23793
24032
|
* Markdown documentation for NOTE commitment.
|
|
23794
24033
|
*/
|
|
@@ -23891,6 +24130,12 @@ class PersonaCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
23891
24130
|
get description() {
|
|
23892
24131
|
return 'Define who the agent is: background, expertise, and personality.';
|
|
23893
24132
|
}
|
|
24133
|
+
/**
|
|
24134
|
+
* Icon for this commitment.
|
|
24135
|
+
*/
|
|
24136
|
+
get icon() {
|
|
24137
|
+
return '👤';
|
|
24138
|
+
}
|
|
23894
24139
|
/**
|
|
23895
24140
|
* Markdown documentation for PERSONA commitment.
|
|
23896
24141
|
*/
|
|
@@ -24018,6 +24263,12 @@ class RuleCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
24018
24263
|
get description() {
|
|
24019
24264
|
return 'Add behavioral rules the agent must follow.';
|
|
24020
24265
|
}
|
|
24266
|
+
/**
|
|
24267
|
+
* Icon for this commitment.
|
|
24268
|
+
*/
|
|
24269
|
+
get icon() {
|
|
24270
|
+
return '⚖️';
|
|
24271
|
+
}
|
|
24021
24272
|
/**
|
|
24022
24273
|
* Markdown documentation for RULE/RULES commitment.
|
|
24023
24274
|
*/
|
|
@@ -24094,6 +24345,12 @@ class SampleCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
24094
24345
|
get description() {
|
|
24095
24346
|
return 'Provide example responses to guide behavior.';
|
|
24096
24347
|
}
|
|
24348
|
+
/**
|
|
24349
|
+
* Icon for this commitment.
|
|
24350
|
+
*/
|
|
24351
|
+
get icon() {
|
|
24352
|
+
return '🔍';
|
|
24353
|
+
}
|
|
24097
24354
|
/**
|
|
24098
24355
|
* Markdown documentation for SAMPLE/EXAMPLE commitment.
|
|
24099
24356
|
*/
|
|
@@ -24171,6 +24428,12 @@ class ScenarioCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
24171
24428
|
get description() {
|
|
24172
24429
|
return 'Define specific **situations** or contexts for AI responses, with later scenarios having higher priority.';
|
|
24173
24430
|
}
|
|
24431
|
+
/**
|
|
24432
|
+
* Icon for this commitment.
|
|
24433
|
+
*/
|
|
24434
|
+
get icon() {
|
|
24435
|
+
return '🎭';
|
|
24436
|
+
}
|
|
24174
24437
|
/**
|
|
24175
24438
|
* Markdown documentation for SCENARIO commitment.
|
|
24176
24439
|
*/
|
|
@@ -24287,6 +24550,12 @@ class StyleCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
24287
24550
|
get description() {
|
|
24288
24551
|
return 'Control the tone and writing style of responses.';
|
|
24289
24552
|
}
|
|
24553
|
+
/**
|
|
24554
|
+
* Icon for this commitment.
|
|
24555
|
+
*/
|
|
24556
|
+
get icon() {
|
|
24557
|
+
return '🖋️';
|
|
24558
|
+
}
|
|
24290
24559
|
/**
|
|
24291
24560
|
* Markdown documentation for STYLE commitment.
|
|
24292
24561
|
*/
|
|
@@ -24356,6 +24625,12 @@ class NotYetImplementedCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
24356
24625
|
get description() {
|
|
24357
24626
|
return 'Placeholder commitment that appends content verbatim to the system message.';
|
|
24358
24627
|
}
|
|
24628
|
+
/**
|
|
24629
|
+
* Icon for this commitment.
|
|
24630
|
+
*/
|
|
24631
|
+
get icon() {
|
|
24632
|
+
return '🚧';
|
|
24633
|
+
}
|
|
24359
24634
|
/**
|
|
24360
24635
|
* Markdown documentation available at runtime.
|
|
24361
24636
|
*/
|
|
@@ -24436,6 +24711,8 @@ const COMMITMENT_REGISTRY = [
|
|
|
24436
24711
|
new GoalCommitmentDefinition('GOAL'),
|
|
24437
24712
|
new GoalCommitmentDefinition('GOALS'),
|
|
24438
24713
|
new InitialMessageCommitmentDefinition(),
|
|
24714
|
+
new UserMessageCommitmentDefinition(),
|
|
24715
|
+
new AgentMessageCommitmentDefinition(),
|
|
24439
24716
|
new MessageCommitmentDefinition('MESSAGE'),
|
|
24440
24717
|
new MessageCommitmentDefinition('MESSAGES'),
|
|
24441
24718
|
new ScenarioCommitmentDefinition('SCENARIO'),
|