@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/cli",
|
|
3
|
-
"version": "0.103.0-
|
|
3
|
+
"version": "0.103.0-54",
|
|
4
4
|
"description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"@azure/openai": "1.0.0-beta.13",
|
|
100
100
|
"@mozilla/readability": "0.6.0",
|
|
101
101
|
"bottleneck": "2.19.5",
|
|
102
|
-
"colors": "
|
|
102
|
+
"colors": "1.4.0",
|
|
103
103
|
"commander": "12.0.0",
|
|
104
104
|
"crypto": "1.0.1",
|
|
105
105
|
"crypto-js": "4.2.0",
|
package/umd/index.umd.js
CHANGED
|
@@ -56,12 +56,23 @@
|
|
|
56
56
|
* @generated
|
|
57
57
|
* @see https://github.com/webgptorg/promptbook
|
|
58
58
|
*/
|
|
59
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-
|
|
59
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-54';
|
|
60
60
|
/**
|
|
61
61
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
62
62
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
63
63
|
*/
|
|
64
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Core Promptbook server configuration.
|
|
67
|
+
*
|
|
68
|
+
* This server is also used for auto-federation in the Agents Server.
|
|
69
|
+
*/
|
|
70
|
+
const CORE_SERVER = {
|
|
71
|
+
title: 'Promptbook Core',
|
|
72
|
+
description: `Core Promptbook server used for auto-federation`,
|
|
73
|
+
owner: 'AI Web, LLC <legal@ptbk.io> (https://www.ptbk.io/)',
|
|
74
|
+
urls: ['https://core.ptbk.io/'],
|
|
75
|
+
};
|
|
65
76
|
/**
|
|
66
77
|
* Available remote servers for the Promptbook
|
|
67
78
|
*
|
|
@@ -83,6 +94,7 @@
|
|
|
83
94
|
owner: 'AI Web, LLC <legal@ptbk.io> (https://www.ptbk.io/)',
|
|
84
95
|
urls: ['https://s6.ptbk.io/'],
|
|
85
96
|
},
|
|
97
|
+
CORE_SERVER,
|
|
86
98
|
/*
|
|
87
99
|
Note: Working on older version of Promptbook and not supported anymore
|
|
88
100
|
{
|
|
@@ -95,7 +107,6 @@
|
|
|
95
107
|
*/
|
|
96
108
|
];
|
|
97
109
|
/**
|
|
98
|
-
* TODO: [🐱🚀] Auto-federated server from url in here
|
|
99
110
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
100
111
|
*/
|
|
101
112
|
|
|
@@ -20690,12 +20701,15 @@
|
|
|
20690
20701
|
fileStreams.push(file);
|
|
20691
20702
|
}
|
|
20692
20703
|
else {
|
|
20704
|
+
/*
|
|
20705
|
+
TODO: [🐱🚀] Resolve problem with browser environment
|
|
20693
20706
|
// Assume it's a local file path
|
|
20694
20707
|
// Note: This will work in Node.js environment
|
|
20695
20708
|
// For browser environments, this would need different handling
|
|
20696
20709
|
const fs = await import('fs');
|
|
20697
20710
|
const fileStream = fs.createReadStream(source);
|
|
20698
20711
|
fileStreams.push(fileStream);
|
|
20712
|
+
*/
|
|
20699
20713
|
}
|
|
20700
20714
|
}
|
|
20701
20715
|
catch (error) {
|
|
@@ -20784,12 +20798,15 @@
|
|
|
20784
20798
|
fileStreams.push(file);
|
|
20785
20799
|
}
|
|
20786
20800
|
else {
|
|
20801
|
+
/*
|
|
20802
|
+
TODO: [🐱🚀] Resolve problem with browser environment
|
|
20787
20803
|
// Assume it's a local file path
|
|
20788
20804
|
// Note: This will work in Node.js environment
|
|
20789
20805
|
// For browser environments, this would need different handling
|
|
20790
20806
|
const fs = await import('fs');
|
|
20791
20807
|
const fileStream = fs.createReadStream(source);
|
|
20792
20808
|
fileStreams.push(fileStream);
|
|
20809
|
+
*/
|
|
20793
20810
|
}
|
|
20794
20811
|
}
|
|
20795
20812
|
catch (error) {
|
|
@@ -22527,6 +22544,12 @@
|
|
|
22527
22544
|
get description() {
|
|
22528
22545
|
return 'Define agent capabilities and actions it can perform.';
|
|
22529
22546
|
}
|
|
22547
|
+
/**
|
|
22548
|
+
* Icon for this commitment.
|
|
22549
|
+
*/
|
|
22550
|
+
get icon() {
|
|
22551
|
+
return '⚡';
|
|
22552
|
+
}
|
|
22530
22553
|
/**
|
|
22531
22554
|
* Markdown documentation for ACTION commitment.
|
|
22532
22555
|
*/
|
|
@@ -22606,6 +22629,12 @@
|
|
|
22606
22629
|
get description() {
|
|
22607
22630
|
return 'Remove or **disregard** certain information, context, or previous commitments.';
|
|
22608
22631
|
}
|
|
22632
|
+
/**
|
|
22633
|
+
* Icon for this commitment.
|
|
22634
|
+
*/
|
|
22635
|
+
get icon() {
|
|
22636
|
+
return '🗑️';
|
|
22637
|
+
}
|
|
22609
22638
|
/**
|
|
22610
22639
|
* Markdown documentation for DELETE commitment.
|
|
22611
22640
|
*/
|
|
@@ -22722,6 +22751,12 @@
|
|
|
22722
22751
|
get description() {
|
|
22723
22752
|
return 'Specify output structure or formatting requirements.';
|
|
22724
22753
|
}
|
|
22754
|
+
/**
|
|
22755
|
+
* Icon for this commitment.
|
|
22756
|
+
*/
|
|
22757
|
+
get icon() {
|
|
22758
|
+
return '📜';
|
|
22759
|
+
}
|
|
22725
22760
|
/**
|
|
22726
22761
|
* Markdown documentation for FORMAT commitment.
|
|
22727
22762
|
*/
|
|
@@ -22797,6 +22832,12 @@
|
|
|
22797
22832
|
get description() {
|
|
22798
22833
|
return 'Define main **goals** the AI assistant should achieve, with later goals having higher priority.';
|
|
22799
22834
|
}
|
|
22835
|
+
/**
|
|
22836
|
+
* Icon for this commitment.
|
|
22837
|
+
*/
|
|
22838
|
+
get icon() {
|
|
22839
|
+
return '🎯';
|
|
22840
|
+
}
|
|
22800
22841
|
/**
|
|
22801
22842
|
* Markdown documentation for GOAL commitment.
|
|
22802
22843
|
*/
|
|
@@ -22893,6 +22934,12 @@
|
|
|
22893
22934
|
get description() {
|
|
22894
22935
|
return 'Add domain **knowledge** via direct text or external sources (RAG).';
|
|
22895
22936
|
}
|
|
22937
|
+
/**
|
|
22938
|
+
* Icon for this commitment.
|
|
22939
|
+
*/
|
|
22940
|
+
get icon() {
|
|
22941
|
+
return '🧠';
|
|
22942
|
+
}
|
|
22896
22943
|
/**
|
|
22897
22944
|
* Markdown documentation for KNOWLEDGE commitment.
|
|
22898
22945
|
*/
|
|
@@ -22994,6 +23041,12 @@
|
|
|
22994
23041
|
get description() {
|
|
22995
23042
|
return 'Remember past interactions and user **preferences** for personalized responses.';
|
|
22996
23043
|
}
|
|
23044
|
+
/**
|
|
23045
|
+
* Icon for this commitment.
|
|
23046
|
+
*/
|
|
23047
|
+
get icon() {
|
|
23048
|
+
return '🧠';
|
|
23049
|
+
}
|
|
22997
23050
|
/**
|
|
22998
23051
|
* Markdown documentation for MEMORY commitment.
|
|
22999
23052
|
*/
|
|
@@ -23068,6 +23121,83 @@
|
|
|
23068
23121
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
23069
23122
|
*/
|
|
23070
23123
|
|
|
23124
|
+
/**
|
|
23125
|
+
* AGENT MESSAGE commitment definition
|
|
23126
|
+
*
|
|
23127
|
+
* The AGENT MESSAGE commitment defines a message from the agent in the conversation history.
|
|
23128
|
+
* It is used to pre-fill the chat with a conversation history or to provide few-shot examples.
|
|
23129
|
+
*
|
|
23130
|
+
* Example usage in agent source:
|
|
23131
|
+
*
|
|
23132
|
+
* ```book
|
|
23133
|
+
* AGENT MESSAGE What seems to be the issue?
|
|
23134
|
+
* ```
|
|
23135
|
+
*
|
|
23136
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
23137
|
+
*/
|
|
23138
|
+
class AgentMessageCommitmentDefinition extends BaseCommitmentDefinition {
|
|
23139
|
+
constructor() {
|
|
23140
|
+
super('AGENT MESSAGE');
|
|
23141
|
+
}
|
|
23142
|
+
/**
|
|
23143
|
+
* Short one-line description of AGENT MESSAGE.
|
|
23144
|
+
*/
|
|
23145
|
+
get description() {
|
|
23146
|
+
return 'Defines a **message from the agent** in the conversation history.';
|
|
23147
|
+
}
|
|
23148
|
+
/**
|
|
23149
|
+
* Icon for this commitment.
|
|
23150
|
+
*/
|
|
23151
|
+
get icon() {
|
|
23152
|
+
return '🤖';
|
|
23153
|
+
}
|
|
23154
|
+
/**
|
|
23155
|
+
* Markdown documentation for AGENT MESSAGE commitment.
|
|
23156
|
+
*/
|
|
23157
|
+
get documentation() {
|
|
23158
|
+
return spaceTrim.spaceTrim(`
|
|
23159
|
+
# ${this.type}
|
|
23160
|
+
|
|
23161
|
+
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.
|
|
23162
|
+
|
|
23163
|
+
## Key aspects
|
|
23164
|
+
|
|
23165
|
+
- Represents a message sent by the agent.
|
|
23166
|
+
- Used for setting up conversation context.
|
|
23167
|
+
- Can be used in conjunction with USER MESSAGE.
|
|
23168
|
+
|
|
23169
|
+
## Examples
|
|
23170
|
+
|
|
23171
|
+
\`\`\`book
|
|
23172
|
+
Conversation History
|
|
23173
|
+
|
|
23174
|
+
USER MESSAGE Hello, I have a problem.
|
|
23175
|
+
AGENT MESSAGE What seems to be the issue?
|
|
23176
|
+
USER MESSAGE My computer is not starting.
|
|
23177
|
+
\`\`\`
|
|
23178
|
+
`);
|
|
23179
|
+
}
|
|
23180
|
+
applyToAgentModelRequirements(requirements, content) {
|
|
23181
|
+
// AGENT MESSAGE is for UI display purposes / conversation history construction
|
|
23182
|
+
// and typically doesn't need to be added to the system prompt or model requirements directly.
|
|
23183
|
+
// It is extracted separately for the chat interface.
|
|
23184
|
+
var _a;
|
|
23185
|
+
const pendingUserMessage = (_a = requirements.metadata) === null || _a === void 0 ? void 0 : _a.pendingUserMessage;
|
|
23186
|
+
if (pendingUserMessage) {
|
|
23187
|
+
const newSample = { question: pendingUserMessage, answer: content };
|
|
23188
|
+
const newSamples = [...(requirements.samples || []), newSample];
|
|
23189
|
+
const newMetadata = { ...requirements.metadata };
|
|
23190
|
+
delete newMetadata.pendingUserMessage;
|
|
23191
|
+
return {
|
|
23192
|
+
...requirements,
|
|
23193
|
+
samples: newSamples,
|
|
23194
|
+
metadata: newMetadata,
|
|
23195
|
+
};
|
|
23196
|
+
}
|
|
23197
|
+
return requirements;
|
|
23198
|
+
}
|
|
23199
|
+
}
|
|
23200
|
+
|
|
23071
23201
|
/**
|
|
23072
23202
|
* INITIAL MESSAGE commitment definition
|
|
23073
23203
|
*
|
|
@@ -23092,6 +23222,12 @@
|
|
|
23092
23222
|
get description() {
|
|
23093
23223
|
return 'Defines the **initial message** shown to the user when the chat starts.';
|
|
23094
23224
|
}
|
|
23225
|
+
/**
|
|
23226
|
+
* Icon for this commitment.
|
|
23227
|
+
*/
|
|
23228
|
+
get icon() {
|
|
23229
|
+
return '👋';
|
|
23230
|
+
}
|
|
23095
23231
|
/**
|
|
23096
23232
|
* Markdown documentation for INITIAL MESSAGE commitment.
|
|
23097
23233
|
*/
|
|
@@ -23150,6 +23286,12 @@
|
|
|
23150
23286
|
get description() {
|
|
23151
23287
|
return 'Include actual **messages** the AI assistant has sent during conversation history.';
|
|
23152
23288
|
}
|
|
23289
|
+
/**
|
|
23290
|
+
* Icon for this commitment.
|
|
23291
|
+
*/
|
|
23292
|
+
get icon() {
|
|
23293
|
+
return '💬';
|
|
23294
|
+
}
|
|
23153
23295
|
/**
|
|
23154
23296
|
* Markdown documentation for MESSAGE commitment.
|
|
23155
23297
|
*/
|
|
@@ -23232,6 +23374,73 @@
|
|
|
23232
23374
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
23233
23375
|
*/
|
|
23234
23376
|
|
|
23377
|
+
/**
|
|
23378
|
+
* USER MESSAGE commitment definition
|
|
23379
|
+
*
|
|
23380
|
+
* The USER MESSAGE commitment defines a message from the user in the conversation history.
|
|
23381
|
+
* It is used to pre-fill the chat with a conversation history or to provide few-shot examples.
|
|
23382
|
+
*
|
|
23383
|
+
* Example usage in agent source:
|
|
23384
|
+
*
|
|
23385
|
+
* ```book
|
|
23386
|
+
* USER MESSAGE Hello, I have a problem.
|
|
23387
|
+
* ```
|
|
23388
|
+
*
|
|
23389
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
23390
|
+
*/
|
|
23391
|
+
class UserMessageCommitmentDefinition extends BaseCommitmentDefinition {
|
|
23392
|
+
constructor() {
|
|
23393
|
+
super('USER MESSAGE');
|
|
23394
|
+
}
|
|
23395
|
+
/**
|
|
23396
|
+
* Short one-line description of USER MESSAGE.
|
|
23397
|
+
*/
|
|
23398
|
+
get description() {
|
|
23399
|
+
return 'Defines a **message from the user** in the conversation history.';
|
|
23400
|
+
}
|
|
23401
|
+
/**
|
|
23402
|
+
* Icon for this commitment.
|
|
23403
|
+
*/
|
|
23404
|
+
get icon() {
|
|
23405
|
+
return '🧑';
|
|
23406
|
+
}
|
|
23407
|
+
/**
|
|
23408
|
+
* Markdown documentation for USER MESSAGE commitment.
|
|
23409
|
+
*/
|
|
23410
|
+
get documentation() {
|
|
23411
|
+
return spaceTrim.spaceTrim(`
|
|
23412
|
+
# ${this.type}
|
|
23413
|
+
|
|
23414
|
+
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.
|
|
23415
|
+
|
|
23416
|
+
## Key aspects
|
|
23417
|
+
|
|
23418
|
+
- Represents a message sent by the user.
|
|
23419
|
+
- Used for setting up conversation context.
|
|
23420
|
+
- Can be used in conjunction with AGENT MESSAGE.
|
|
23421
|
+
|
|
23422
|
+
## Examples
|
|
23423
|
+
|
|
23424
|
+
\`\`\`book
|
|
23425
|
+
Conversation History
|
|
23426
|
+
|
|
23427
|
+
USER MESSAGE Hello, I have a problem.
|
|
23428
|
+
AGENT MESSAGE What seems to be the issue?
|
|
23429
|
+
USER MESSAGE My computer is not starting.
|
|
23430
|
+
\`\`\`
|
|
23431
|
+
`);
|
|
23432
|
+
}
|
|
23433
|
+
applyToAgentModelRequirements(requirements, content) {
|
|
23434
|
+
return {
|
|
23435
|
+
...requirements,
|
|
23436
|
+
metadata: {
|
|
23437
|
+
...requirements.metadata,
|
|
23438
|
+
pendingUserMessage: content,
|
|
23439
|
+
},
|
|
23440
|
+
};
|
|
23441
|
+
}
|
|
23442
|
+
}
|
|
23443
|
+
|
|
23235
23444
|
/**
|
|
23236
23445
|
* META commitment definition
|
|
23237
23446
|
*
|
|
@@ -23268,6 +23477,12 @@
|
|
|
23268
23477
|
get description() {
|
|
23269
23478
|
return 'Set meta-information about the agent (IMAGE, LINK, TITLE, DESCRIPTION, etc.).';
|
|
23270
23479
|
}
|
|
23480
|
+
/**
|
|
23481
|
+
* Icon for this commitment.
|
|
23482
|
+
*/
|
|
23483
|
+
get icon() {
|
|
23484
|
+
return 'ℹ️';
|
|
23485
|
+
}
|
|
23271
23486
|
/**
|
|
23272
23487
|
* Markdown documentation for META commitment.
|
|
23273
23488
|
*/
|
|
@@ -23395,6 +23610,12 @@
|
|
|
23395
23610
|
get description() {
|
|
23396
23611
|
return "Set the agent's accent color.";
|
|
23397
23612
|
}
|
|
23613
|
+
/**
|
|
23614
|
+
* Icon for this commitment.
|
|
23615
|
+
*/
|
|
23616
|
+
get icon() {
|
|
23617
|
+
return '🎨';
|
|
23618
|
+
}
|
|
23398
23619
|
/**
|
|
23399
23620
|
* Markdown documentation for META COLOR commitment.
|
|
23400
23621
|
*/
|
|
@@ -23473,6 +23694,12 @@
|
|
|
23473
23694
|
get description() {
|
|
23474
23695
|
return "Set the agent's profile image URL.";
|
|
23475
23696
|
}
|
|
23697
|
+
/**
|
|
23698
|
+
* Icon for this commitment.
|
|
23699
|
+
*/
|
|
23700
|
+
get icon() {
|
|
23701
|
+
return '🖼️';
|
|
23702
|
+
}
|
|
23476
23703
|
/**
|
|
23477
23704
|
* Markdown documentation for META IMAGE commitment.
|
|
23478
23705
|
*/
|
|
@@ -23563,6 +23790,12 @@
|
|
|
23563
23790
|
get description() {
|
|
23564
23791
|
return 'Enforce AI model requirements including name and technical parameters.';
|
|
23565
23792
|
}
|
|
23793
|
+
/**
|
|
23794
|
+
* Icon for this commitment.
|
|
23795
|
+
*/
|
|
23796
|
+
get icon() {
|
|
23797
|
+
return '⚙️';
|
|
23798
|
+
}
|
|
23566
23799
|
/**
|
|
23567
23800
|
* Markdown documentation for MODEL commitment.
|
|
23568
23801
|
*/
|
|
@@ -23798,6 +24031,12 @@
|
|
|
23798
24031
|
get description() {
|
|
23799
24032
|
return 'Add developer-facing notes without changing behavior or output.';
|
|
23800
24033
|
}
|
|
24034
|
+
/**
|
|
24035
|
+
* Icon for this commitment.
|
|
24036
|
+
*/
|
|
24037
|
+
get icon() {
|
|
24038
|
+
return '📝';
|
|
24039
|
+
}
|
|
23801
24040
|
/**
|
|
23802
24041
|
* Markdown documentation for NOTE commitment.
|
|
23803
24042
|
*/
|
|
@@ -23900,6 +24139,12 @@
|
|
|
23900
24139
|
get description() {
|
|
23901
24140
|
return 'Define who the agent is: background, expertise, and personality.';
|
|
23902
24141
|
}
|
|
24142
|
+
/**
|
|
24143
|
+
* Icon for this commitment.
|
|
24144
|
+
*/
|
|
24145
|
+
get icon() {
|
|
24146
|
+
return '👤';
|
|
24147
|
+
}
|
|
23903
24148
|
/**
|
|
23904
24149
|
* Markdown documentation for PERSONA commitment.
|
|
23905
24150
|
*/
|
|
@@ -24027,6 +24272,12 @@
|
|
|
24027
24272
|
get description() {
|
|
24028
24273
|
return 'Add behavioral rules the agent must follow.';
|
|
24029
24274
|
}
|
|
24275
|
+
/**
|
|
24276
|
+
* Icon for this commitment.
|
|
24277
|
+
*/
|
|
24278
|
+
get icon() {
|
|
24279
|
+
return '⚖️';
|
|
24280
|
+
}
|
|
24030
24281
|
/**
|
|
24031
24282
|
* Markdown documentation for RULE/RULES commitment.
|
|
24032
24283
|
*/
|
|
@@ -24103,6 +24354,12 @@
|
|
|
24103
24354
|
get description() {
|
|
24104
24355
|
return 'Provide example responses to guide behavior.';
|
|
24105
24356
|
}
|
|
24357
|
+
/**
|
|
24358
|
+
* Icon for this commitment.
|
|
24359
|
+
*/
|
|
24360
|
+
get icon() {
|
|
24361
|
+
return '🔍';
|
|
24362
|
+
}
|
|
24106
24363
|
/**
|
|
24107
24364
|
* Markdown documentation for SAMPLE/EXAMPLE commitment.
|
|
24108
24365
|
*/
|
|
@@ -24180,6 +24437,12 @@
|
|
|
24180
24437
|
get description() {
|
|
24181
24438
|
return 'Define specific **situations** or contexts for AI responses, with later scenarios having higher priority.';
|
|
24182
24439
|
}
|
|
24440
|
+
/**
|
|
24441
|
+
* Icon for this commitment.
|
|
24442
|
+
*/
|
|
24443
|
+
get icon() {
|
|
24444
|
+
return '🎭';
|
|
24445
|
+
}
|
|
24183
24446
|
/**
|
|
24184
24447
|
* Markdown documentation for SCENARIO commitment.
|
|
24185
24448
|
*/
|
|
@@ -24296,6 +24559,12 @@
|
|
|
24296
24559
|
get description() {
|
|
24297
24560
|
return 'Control the tone and writing style of responses.';
|
|
24298
24561
|
}
|
|
24562
|
+
/**
|
|
24563
|
+
* Icon for this commitment.
|
|
24564
|
+
*/
|
|
24565
|
+
get icon() {
|
|
24566
|
+
return '🖋️';
|
|
24567
|
+
}
|
|
24299
24568
|
/**
|
|
24300
24569
|
* Markdown documentation for STYLE commitment.
|
|
24301
24570
|
*/
|
|
@@ -24365,6 +24634,12 @@
|
|
|
24365
24634
|
get description() {
|
|
24366
24635
|
return 'Placeholder commitment that appends content verbatim to the system message.';
|
|
24367
24636
|
}
|
|
24637
|
+
/**
|
|
24638
|
+
* Icon for this commitment.
|
|
24639
|
+
*/
|
|
24640
|
+
get icon() {
|
|
24641
|
+
return '🚧';
|
|
24642
|
+
}
|
|
24368
24643
|
/**
|
|
24369
24644
|
* Markdown documentation available at runtime.
|
|
24370
24645
|
*/
|
|
@@ -24445,6 +24720,8 @@
|
|
|
24445
24720
|
new GoalCommitmentDefinition('GOAL'),
|
|
24446
24721
|
new GoalCommitmentDefinition('GOALS'),
|
|
24447
24722
|
new InitialMessageCommitmentDefinition(),
|
|
24723
|
+
new UserMessageCommitmentDefinition(),
|
|
24724
|
+
new AgentMessageCommitmentDefinition(),
|
|
24448
24725
|
new MessageCommitmentDefinition('MESSAGE'),
|
|
24449
24726
|
new MessageCommitmentDefinition('MESSAGES'),
|
|
24450
24727
|
new ScenarioCommitmentDefinition('SCENARIO'),
|