@promptbook/cli 0.112.0 → 0.113.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +45 -29
  2. package/agents/default/developer.book +2 -1
  3. package/apps/agents-server/next.config.ts +21 -0
  4. package/apps/agents-server/src/app/admin/limits/LimitsClient.tsx +1 -1
  5. package/apps/agents-server/src/app/admin/update/UpdateClient.tsx +52 -33
  6. package/apps/agents-server/src/app/api/agent-folders/[folderId]/visibility/route.ts +19 -7
  7. package/apps/agents-server/src/app/api/agents/[agentName]/route.ts +8 -18
  8. package/apps/agents-server/src/app/api/internal/agent-runner-limits/route.ts +1 -1
  9. package/apps/agents-server/src/app/api/v1/agents/[agentId]/route.ts +13 -8
  10. package/apps/agents-server/src/components/AgentProfile/AgentCapabilityChips.tsx +39 -5
  11. package/apps/agents-server/src/components/Homepage/AgentCard.tsx +7 -1
  12. package/apps/agents-server/src/components/Homepage/AgentsList.tsx +3 -0
  13. package/apps/agents-server/src/components/Homepage/AgentsListHeader.tsx +41 -0
  14. package/apps/agents-server/src/components/Homepage/hiddenFolders.ts +104 -0
  15. package/apps/agents-server/src/components/Homepage/useAgentsListQueryState.ts +35 -0
  16. package/apps/agents-server/src/components/Homepage/useAgentsListState.ts +24 -4
  17. package/apps/agents-server/src/constants/serverLimits.ts +19 -0
  18. package/apps/agents-server/src/database/seedCoreAgents.ts +0 -2
  19. package/apps/agents-server/src/database/seedDefaultAgents.ts +0 -2
  20. package/apps/agents-server/src/tools/agent_progress.ts +4 -10
  21. package/apps/agents-server/src/utils/agentVisibility.ts +25 -62
  22. package/apps/agents-server/src/utils/createAgentWithDefaultVisibility.ts +3 -1
  23. package/apps/agents-server/src/utils/externalChatRunner/processExternalUserChatJob.ts +9 -17
  24. package/apps/agents-server/src/utils/localChatRunner/LocalUserChatJobMetadata.ts +15 -5
  25. package/apps/agents-server/src/utils/localChatRunner/processLocalUserChatJob.ts +17 -26
  26. package/apps/agents-server/src/utils/serverLimits.ts +2 -0
  27. package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerCoreAgents.ts +2 -2
  28. package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerDefaultAgents.ts +1 -1
  29. package/apps/agents-server/src/utils/userChat/createUserChatHarnessProgressCard.ts +0 -6
  30. package/apps/agents-server/src/utils/userChat/createUserChatRunnerProgressCard.ts +0 -6
  31. package/apps/agents-server/src/utils/userChat/userChatMessageLifecycle.ts +69 -0
  32. package/apps/agents-server/src/utils/userChat/userChatProgressCard.ts +0 -6
  33. package/apps/agents-server/src/utils/vpsSelfUpdate.ts +138 -24
  34. package/esm/apps/agents-server/src/constants/serverLimits.d.ts +17 -0
  35. package/esm/index.es.js +581 -93
  36. package/esm/index.es.js.map +1 -1
  37. package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages.d.ts +1 -0
  38. package/esm/scripts/run-agent-messages/main/tickAgentMessages.d.ts +1 -0
  39. package/esm/src/_packages/core.index.d.ts +22 -0
  40. package/esm/src/_packages/types.index.d.ts +2 -0
  41. package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -0
  42. package/esm/src/book-2.0/agent-source/agentSourceVisibility.d.ts +97 -0
  43. package/esm/src/book-2.0/agent-source/agentSourceVisibility.test.d.ts +1 -0
  44. package/esm/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +1 -0
  45. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +6 -0
  46. package/esm/src/collection/agent-collection/CreateAgentInput.d.ts +2 -1
  47. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +21 -1
  48. package/esm/src/commitments/META_VISIBILITY/META_VISIBILITY.d.ts +27 -0
  49. package/esm/src/commitments/index.d.ts +2 -1
  50. package/esm/src/version.d.ts +1 -1
  51. package/package.json +1 -1
  52. package/src/_packages/core.index.ts +22 -0
  53. package/src/_packages/types.index.ts +2 -0
  54. package/src/book-2.0/agent-source/AgentBasicInformation.ts +2 -0
  55. package/src/book-2.0/agent-source/agentSourceVisibility.ts +214 -0
  56. package/src/book-2.0/agent-source/parseAgentSource/applyMetaCommitment.ts +17 -0
  57. package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +1 -0
  58. package/src/book-components/BookEditor/BookEditorMonacoTokenization.ts +11 -0
  59. package/src/book-components/BookEditor/useBookEditorMonacoLanguage.ts +7 -3
  60. package/src/cli/cli-commands/agents-server/buildAgentsServer.ts +144 -16
  61. package/src/cli/cli-commands/agents-server/startAgentsServer.ts +22 -2
  62. package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +1 -1
  63. package/src/cli/cli-commands/coder/run.ts +30 -0
  64. package/src/collection/agent-collection/CreateAgentInput.ts +10 -5
  65. package/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.ts +7 -3
  66. package/src/collection/agent-collection/constructors/agent-collection-in-supabase/createAgentPersistenceRecords.ts +7 -4
  67. package/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.ts +44 -8
  68. package/src/commitments/META_VISIBILITY/META_VISIBILITY.ts +78 -0
  69. package/src/commitments/index.ts +2 -0
  70. package/src/other/templates/getTemplatesPipelineCollection.ts +854 -692
  71. package/src/version.ts +2 -2
  72. package/src/versions.txt +1 -0
  73. package/umd/apps/agents-server/src/constants/serverLimits.d.ts +17 -0
  74. package/umd/index.umd.js +581 -93
  75. package/umd/index.umd.js.map +1 -1
  76. package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages.d.ts +1 -0
  77. package/umd/scripts/run-agent-messages/main/tickAgentMessages.d.ts +1 -0
  78. package/umd/src/_packages/core.index.d.ts +22 -0
  79. package/umd/src/_packages/types.index.d.ts +2 -0
  80. package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -0
  81. package/umd/src/book-2.0/agent-source/agentSourceVisibility.d.ts +97 -0
  82. package/umd/src/book-2.0/agent-source/agentSourceVisibility.test.d.ts +1 -0
  83. package/umd/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +1 -0
  84. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +6 -0
  85. package/umd/src/collection/agent-collection/CreateAgentInput.d.ts +2 -1
  86. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +21 -1
  87. package/umd/src/commitments/META_VISIBILITY/META_VISIBILITY.d.ts +27 -0
  88. package/umd/src/commitments/index.d.ts +2 -1
  89. package/umd/src/version.d.ts +1 -1
@@ -0,0 +1,78 @@
1
+ import { spaceTrim } from 'spacetrim';
2
+ import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
3
+ import { TODO_USE } from '../../utils/organization/TODO_USE';
4
+ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
5
+
6
+ /**
7
+ * META VISIBILITY commitment definition.
8
+ *
9
+ * The `META VISIBILITY` commitment stores whether an agent is public, private, or unlisted.
10
+ * Agents Server mirrors this value into the database for efficient filtering, but the book
11
+ * commitment remains the editable source of truth.
12
+ *
13
+ * @private Metadata-only commitment used by Agents Server.
14
+ */
15
+ export class MetaVisibilityCommitmentDefinition extends BaseCommitmentDefinition<'META VISIBILITY'> {
16
+ public constructor() {
17
+ super('META VISIBILITY');
18
+ }
19
+
20
+ /**
21
+ * Short one-line description of META VISIBILITY.
22
+ */
23
+ get description(): string {
24
+ return 'Set whether the agent is private, unlisted, or public.';
25
+ }
26
+
27
+ /**
28
+ * Icon for this commitment.
29
+ */
30
+ get icon(): string {
31
+ return '👁️';
32
+ }
33
+
34
+ /**
35
+ * Markdown documentation for META VISIBILITY commitment.
36
+ */
37
+ get documentation(): string {
38
+ return spaceTrim(`
39
+ # META VISIBILITY
40
+
41
+ Sets the agent visibility used by Agents Server.
42
+
43
+ ## Allowed values
44
+
45
+ - \`PRIVATE\` - accessible only to signed-in users with access.
46
+ - \`UNLISTED\` - accessible by direct link but hidden from public listings.
47
+ - \`PUBLIC\` - visible in public listings and accessible by anyone.
48
+
49
+ ## Key aspects
50
+
51
+ - Does not modify the agent's behavior, system message, or tools.
52
+ - Whitespace and letter case are normalized when persisted.
53
+ - If multiple \`META VISIBILITY\` commitments are present, persistence keeps one normalized value.
54
+ - Agents Server mirrors the value into the database for filtering, but the book is the source of truth.
55
+
56
+ ## Example
57
+
58
+ \`\`\`book
59
+ Helpful Assistant
60
+
61
+ GOAL Be helpful and friendly.
62
+ META VISIBILITY PUBLIC
63
+ \`\`\`
64
+ `);
65
+ }
66
+
67
+ public applyToAgentModelRequirements(
68
+ requirements: AgentModelRequirements,
69
+ content: string,
70
+ ): AgentModelRequirements {
71
+ TODO_USE(content);
72
+
73
+ // META VISIBILITY is metadata only and does not alter model requirements.
74
+ return requirements;
75
+ }
76
+ }
77
+
78
+ // Note: [💞] Ignore a discrepancy between file name and entity name
@@ -28,6 +28,7 @@ import { MetaFontCommitmentDefinition } from './META_FONT/META_FONT';
28
28
  import { MetaImageCommitmentDefinition } from './META_IMAGE/META_IMAGE';
29
29
  import { MetaInputPlaceholderCommitmentDefinition } from './META_INPUT_PLACEHOLDER/META_INPUT_PLACEHOLDER';
30
30
  import { MetaLinkCommitmentDefinition } from './META_LINK/META_LINK';
31
+ import { MetaVisibilityCommitmentDefinition } from './META_VISIBILITY/META_VISIBILITY';
31
32
  import { MetaVoiceCommitmentDefinition } from './META_VOICE/META_VOICE';
32
33
  import { ModelCommitmentDefinition } from './MODEL/MODEL';
33
34
  import { NoteCommitmentDefinition } from './NOTE/NOTE';
@@ -102,6 +103,7 @@ export const COMMITMENT_REGISTRY = [
102
103
  new MetaDomainCommitmentDefinition(),
103
104
  new MetaDisclaimerCommitmentDefinition(),
104
105
  new MetaInputPlaceholderCommitmentDefinition(),
106
+ new MetaVisibilityCommitmentDefinition(),
105
107
  new MetaCommitmentDefinition(),
106
108
  new MetaVoiceCommitmentDefinition(),
107
109
  new NoteCommitmentDefinition('NOTE'),