@promptbook/types 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.
- package/README.md +45 -29
- package/esm/src/_packages/core.index.d.ts +22 -0
- package/esm/src/_packages/types.index.d.ts +2 -0
- package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -0
- package/esm/src/book-2.0/agent-source/agentSourceVisibility.d.ts +97 -0
- package/esm/src/book-2.0/agent-source/agentSourceVisibility.test.d.ts +1 -0
- package/esm/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +1 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +6 -0
- package/esm/src/collection/agent-collection/CreateAgentInput.d.ts +2 -1
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +21 -1
- package/esm/src/commitments/META_VISIBILITY/META_VISIBILITY.d.ts +27 -0
- package/esm/src/commitments/index.d.ts +2 -1
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/src/_packages/core.index.d.ts +22 -0
- package/umd/src/_packages/types.index.d.ts +2 -0
- package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -0
- package/umd/src/book-2.0/agent-source/agentSourceVisibility.d.ts +97 -0
- package/umd/src/book-2.0/agent-source/agentSourceVisibility.test.d.ts +1 -0
- package/umd/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +1 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +6 -0
- package/umd/src/collection/agent-collection/CreateAgentInput.d.ts +2 -1
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +21 -1
- package/umd/src/commitments/META_VISIBILITY/META_VISIBILITY.d.ts +27 -0
- package/umd/src/commitments/index.d.ts +2 -1
- package/umd/src/version.d.ts +1 -1
package/README.md
CHANGED
|
@@ -41,14 +41,17 @@ Non-interactive mode takes defaults from command-line options. When `--openai-ap
|
|
|
41
41
|
sudo curl -fsSL https://raw.githubusercontent.com/webgptorg/promptbook/refs/heads/main/other/vps/install.sh | bash -s -- \
|
|
42
42
|
--non-interactive \
|
|
43
43
|
--yes-i-understand-that-script-should-be-run-on-fresh-server \
|
|
44
|
-
--domain
|
|
45
|
-
--openai-api-key sk-proj-
|
|
46
|
-
--sentry-dsn https://abc@def.ingest.de.sentry.io/123 \
|
|
44
|
+
--domain my-server.com \
|
|
45
|
+
--openai-api-key sk-proj-xxx \
|
|
47
46
|
--admin-password xxx
|
|
48
47
|
```
|
|
49
48
|
|
|
50
49
|
|
|
51
50
|
|
|
51
|
+
<blockquote style="color: #ff8811">
|
|
52
|
+
<b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.
|
|
53
|
+
</blockquote>
|
|
54
|
+
|
|
52
55
|
## 📦 Package `@promptbook/types`
|
|
53
56
|
|
|
54
57
|
- Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
@@ -324,7 +327,7 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
|
324
327
|
|
|
325
328
|
Promptbook lets you create **persistent AI agents** that work on real goals for your company. The [**Agents Server**](https://gallery.ptbk.io/) is the heart of the project - a place where your AI agents live, remember context, collaborate in teams, and get things done.
|
|
326
329
|
|
|
327
|
-
Nowadays, the biggest challenge for most business applications isn't the raw capabilities of AI models. Large language models such as GPT-5.
|
|
330
|
+
Nowadays, the biggest challenge for most business applications isn't the raw capabilities of AI models. Large language models such as Claude Mythos, GPT-5.6 or Kimi K2.7 are incredibly capable.
|
|
328
331
|
|
|
329
332
|
The main challenge lies in **managing the context**, providing rules and knowledge, and narrowing the personality.
|
|
330
333
|
|
|
@@ -332,17 +335,20 @@ In Promptbook, you define your agents **using simple Books** - a human-readable
|
|
|
332
335
|
|
|
333
336
|
<table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
|
|
334
337
|
|
|
335
|
-
**<ins>
|
|
338
|
+
**<ins>Lawyer</ins>**<br/>
|
|
336
339
|
<br/>
|
|
337
|
-
|
|
340
|
+
GOAL You are a company lawyer.<br/>
|
|
338
341
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
339
|
-
|
|
342
|
+
Respond to incoming legal inquiries via email and keep the company website updated with the latest legal policies.<br/>
|
|
343
|
+
<br/>
|
|
340
344
|
**RULE** You are knowledgeable, professional, and detail-oriented.<br/>
|
|
341
345
|
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
342
346
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
347
|
+
<br/>
|
|
348
|
+
USE EMAIL<br/>
|
|
349
|
+
USE BROWSER<br/>
|
|
350
|
+
<br/>
|
|
351
|
+
TEAM You are part of the legal team of Paul Smith & Associés, you discuss with {Emily White}, the head of the compliance department. {George Brown} is expert in corporate law and {Sophia Black} is expert in labor law.<br/>
|
|
346
352
|
|
|
347
353
|
</td></tr></table>
|
|
348
354
|
|
|
@@ -375,12 +381,12 @@ Goals define what the agent should actively work toward. Unlike a chatbot that o
|
|
|
375
381
|
|
|
376
382
|
<table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
|
|
377
383
|
|
|
378
|
-
**<ins>
|
|
384
|
+
**<ins>Company Lawyer</ins>**<br/>
|
|
379
385
|
<br/>
|
|
380
|
-
|
|
386
|
+
GOAL<br/>
|
|
381
387
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
382
|
-
|
|
383
|
-
|
|
388
|
+
GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
|
|
389
|
+
GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
|
|
384
390
|
|
|
385
391
|
</td></tr></table>
|
|
386
392
|
|
|
@@ -398,8 +404,8 @@ Promptbook Engine will automatically enforce this knowledge during interactions.
|
|
|
398
404
|
<br/>
|
|
399
405
|
**PERSONA** You are a company lawyer.<br/>
|
|
400
406
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
401
|
-
|
|
402
|
-
|
|
407
|
+
GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
|
|
408
|
+
GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
|
|
403
409
|
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
404
410
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
405
411
|
|
|
@@ -417,8 +423,8 @@ Depending on rule strictness, Promptbook will either propagate it to the prompt
|
|
|
417
423
|
<br/>
|
|
418
424
|
**PERSONA** You are a company lawyer.<br/>
|
|
419
425
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
420
|
-
|
|
421
|
-
|
|
426
|
+
GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
|
|
427
|
+
GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
|
|
422
428
|
**RULE** Always ensure compliance with local laws and regulations.<br/>
|
|
423
429
|
**RULE** Never provide legal advice outside your area of expertise.<br/>
|
|
424
430
|
**RULE** Never provide legal advice about criminal law.<br/>
|
|
@@ -439,16 +445,16 @@ These are what turn a chatbot into a persistent agent that actually does work.
|
|
|
439
445
|
<br/>
|
|
440
446
|
**PERSONA** You are a company lawyer.<br/>
|
|
441
447
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
442
|
-
|
|
443
|
-
|
|
448
|
+
GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
|
|
449
|
+
GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
|
|
444
450
|
**RULE** Always ensure compliance with local laws and regulations.<br/>
|
|
445
451
|
**RULE** Never provide legal advice outside your area of expertise.<br/>
|
|
446
452
|
**RULE** Never provide legal advice about criminal law.<br/>
|
|
447
453
|
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
448
454
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
455
|
+
USE EMAIL<br/>
|
|
456
|
+
USE BROWSER<br/>
|
|
457
|
+
USE SEARCH ENGINE<br/>
|
|
452
458
|
|
|
453
459
|
</td></tr></table>
|
|
454
460
|
|
|
@@ -462,20 +468,22 @@ Team commitment allows you to define the team structure and advisory fellow memb
|
|
|
462
468
|
<br/>
|
|
463
469
|
**PERSONA** You are a company lawyer.<br/>
|
|
464
470
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
465
|
-
|
|
466
|
-
|
|
471
|
+
GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
|
|
472
|
+
GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
|
|
467
473
|
**RULE** Always ensure compliance with local laws and regulations.<br/>
|
|
468
474
|
**RULE** Never provide legal advice outside your area of expertise.<br/>
|
|
469
475
|
**RULE** Never provide legal advice about criminal law.<br/>
|
|
470
476
|
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
471
477
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
478
|
+
USE EMAIL<br/>
|
|
479
|
+
USE BROWSER<br/>
|
|
480
|
+
USE SEARCH ENGINE<br/>
|
|
481
|
+
TEAM You are part of the legal team of Paul Smith & Associés, you discuss with {Emily White}, the head of the compliance department. {George Brown} is expert in corporate law and {Sophia Black} is expert in labor law.<br/>
|
|
476
482
|
|
|
477
483
|
</td></tr></table>
|
|
478
484
|
|
|
485
|
+
|
|
486
|
+
|
|
479
487
|
### Promptbook Ecosystem
|
|
480
488
|
|
|
481
489
|
Promptbook is an ecosystem of tools centered around the **Agents Server** - a production-ready platform for running persistent AI agents.
|
|
@@ -498,6 +506,8 @@ The [Promptbook Engine](https://github.com/webgptorg/promptbook) is the open-sou
|
|
|
498
506
|
|
|
499
507
|
|
|
500
508
|
|
|
509
|
+
|
|
510
|
+
|
|
501
511
|
## 💜 The Promptbook Project
|
|
502
512
|
|
|
503
513
|
Promptbook project is an ecosystem centered around the **Agents Server** - a platform for creating, deploying, and running persistent AI agents. Following is a list of the most important pieces of the project:
|
|
@@ -535,6 +545,8 @@ Promptbook project is an ecosystem centered around the **Agents Server** - a pla
|
|
|
535
545
|
</tbody>
|
|
536
546
|
</table>
|
|
537
547
|
|
|
548
|
+
|
|
549
|
+
|
|
538
550
|
### 🌐 Community & Social Media
|
|
539
551
|
|
|
540
552
|
Join our growing community of developers and users:
|
|
@@ -591,6 +603,8 @@ Join our growing community of developers and users:
|
|
|
591
603
|
|
|
592
604
|
|
|
593
605
|
|
|
606
|
+
|
|
607
|
+
|
|
594
608
|
## 📚 Documentation
|
|
595
609
|
|
|
596
610
|
See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
|
|
@@ -798,6 +812,8 @@ The following glossary is used to clarify certain concepts:
|
|
|
798
812
|
|
|
799
813
|
_Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
|
|
800
814
|
|
|
815
|
+
|
|
816
|
+
|
|
801
817
|
### 💯 Core concepts
|
|
802
818
|
|
|
803
819
|
- [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
|
+
import { AGENT_VISIBILITY_VALUES } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
3
|
+
import type { AgentVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
4
|
+
import { DEFAULT_AGENT_VISIBILITY } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
5
|
+
import { isAgentVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
6
|
+
import { normalizeAgentVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
7
|
+
import { parseAgentVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
8
|
+
import { parseAgentVisibilityStrict } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
9
|
+
import { parseAgentSourceVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
10
|
+
import { isPublicAgentVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
11
|
+
import { getNextAgentVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
12
|
+
import { setAgentSourceVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
2
13
|
import { computeAgentHash } from '../book-2.0/agent-source/computeAgentHash';
|
|
3
14
|
import { createAgentModelRequirements } from '../book-2.0/agent-source/createAgentModelRequirements';
|
|
4
15
|
import type { CreateAgentModelRequirementsOptions } from '../book-2.0/agent-source/CreateAgentModelRequirementsOptions';
|
|
@@ -224,6 +235,17 @@ import { $generateBookBoilerplate } from '../utils/random/$generateBookBoilerpla
|
|
|
224
235
|
import { CORE_AGENTS_SERVER_WELL_KNOWN_AGENT_NAMES } from '../../servers';
|
|
225
236
|
import { PUBLIC_AGENTS_SERVERS } from '../../servers';
|
|
226
237
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
238
|
+
export { AGENT_VISIBILITY_VALUES };
|
|
239
|
+
export type { AgentVisibility };
|
|
240
|
+
export { DEFAULT_AGENT_VISIBILITY };
|
|
241
|
+
export { isAgentVisibility };
|
|
242
|
+
export { normalizeAgentVisibility };
|
|
243
|
+
export { parseAgentVisibility };
|
|
244
|
+
export { parseAgentVisibilityStrict };
|
|
245
|
+
export { parseAgentSourceVisibility };
|
|
246
|
+
export { isPublicAgentVisibility };
|
|
247
|
+
export { getNextAgentVisibility };
|
|
248
|
+
export { setAgentSourceVisibility };
|
|
227
249
|
export { computeAgentHash };
|
|
228
250
|
export { createAgentModelRequirements };
|
|
229
251
|
export type { CreateAgentModelRequirementsOptions };
|
|
@@ -2,6 +2,7 @@ import type { BookParameter } from '../book-2.0/agent-source/AgentBasicInformati
|
|
|
2
2
|
import type { AgentCapability } from '../book-2.0/agent-source/AgentBasicInformation';
|
|
3
3
|
import type { AgentBasicInformation } from '../book-2.0/agent-source/AgentBasicInformation';
|
|
4
4
|
import type { AgentModelRequirements } from '../book-2.0/agent-source/AgentModelRequirements';
|
|
5
|
+
import type { AgentVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
5
6
|
import type { CreateAgentModelRequirementsOptions } from '../book-2.0/agent-source/CreateAgentModelRequirementsOptions';
|
|
6
7
|
import type { string_book } from '../book-2.0/agent-source/string_book';
|
|
7
8
|
import type { BookNodeAgentSource } from '../book-3.0/BookNodeAgentSource';
|
|
@@ -444,6 +445,7 @@ export type { BookParameter };
|
|
|
444
445
|
export type { AgentCapability };
|
|
445
446
|
export type { AgentBasicInformation };
|
|
446
447
|
export type { AgentModelRequirements };
|
|
448
|
+
export type { AgentVisibility };
|
|
447
449
|
export type { CreateAgentModelRequirementsOptions };
|
|
448
450
|
export type { string_book };
|
|
449
451
|
export type { BookNodeAgentSource };
|
|
@@ -4,6 +4,7 @@ import type { string_agent_url } from '../../types/string_agent_url';
|
|
|
4
4
|
import type { string_fonts } from '../../types/string_markdown';
|
|
5
5
|
import type { string_color } from '../../types/string_person_fullname';
|
|
6
6
|
import type { string_url_image } from '../../types/string_url_image';
|
|
7
|
+
import type { AgentVisibility } from './agentSourceVisibility';
|
|
7
8
|
/**
|
|
8
9
|
* Unified parameter representation that supports two different notations:
|
|
9
10
|
* 1. @Parameter - single word parameter starting with @
|
|
@@ -97,6 +98,7 @@ export type AgentBasicInformation = {
|
|
|
97
98
|
font?: string_fonts;
|
|
98
99
|
color?: string_color;
|
|
99
100
|
voice?: string;
|
|
101
|
+
visibility?: AgentVisibility;
|
|
100
102
|
[key: string]: string | undefined;
|
|
101
103
|
};
|
|
102
104
|
/**
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { string_book } from './string_book';
|
|
2
|
+
/**
|
|
3
|
+
* Supported visibility states for persisted agents.
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/core`
|
|
6
|
+
*/
|
|
7
|
+
export declare const AGENT_VISIBILITY_VALUES: readonly ["PRIVATE", "UNLISTED", "PUBLIC"];
|
|
8
|
+
/**
|
|
9
|
+
* Canonical visibility union for agents.
|
|
10
|
+
*
|
|
11
|
+
* @public exported from `@promptbook/core`
|
|
12
|
+
*/
|
|
13
|
+
export type AgentVisibility = (typeof AGENT_VISIBILITY_VALUES)[number];
|
|
14
|
+
/**
|
|
15
|
+
* Fallback visibility used when no valid value is configured.
|
|
16
|
+
*
|
|
17
|
+
* @public exported from `@promptbook/core`
|
|
18
|
+
*/
|
|
19
|
+
export declare const DEFAULT_AGENT_VISIBILITY: AgentVisibility;
|
|
20
|
+
/**
|
|
21
|
+
* Returns `true` when the value is one of supported visibility states.
|
|
22
|
+
*
|
|
23
|
+
* @param value - Raw value to validate.
|
|
24
|
+
* @returns Whether the value is a valid `AgentVisibility`.
|
|
25
|
+
*
|
|
26
|
+
* @public exported from `@promptbook/core`
|
|
27
|
+
*/
|
|
28
|
+
export declare function isAgentVisibility(value: unknown): value is AgentVisibility;
|
|
29
|
+
/**
|
|
30
|
+
* Normalizes raw visibility text into a supported value.
|
|
31
|
+
*
|
|
32
|
+
* @param value - Raw visibility value.
|
|
33
|
+
* @returns Normalized visibility, or `null` when invalid.
|
|
34
|
+
*
|
|
35
|
+
* @public exported from `@promptbook/core`
|
|
36
|
+
*/
|
|
37
|
+
export declare function normalizeAgentVisibility(value: unknown): AgentVisibility | null;
|
|
38
|
+
/**
|
|
39
|
+
* Parses visibility from an unknown value with a safe fallback.
|
|
40
|
+
*
|
|
41
|
+
* @param value - Raw visibility value.
|
|
42
|
+
* @param fallback - Fallback when the value is invalid.
|
|
43
|
+
* @returns Parsed visibility.
|
|
44
|
+
*
|
|
45
|
+
* @public exported from `@promptbook/core`
|
|
46
|
+
*/
|
|
47
|
+
export declare function parseAgentVisibility(value: unknown, fallback?: AgentVisibility): AgentVisibility;
|
|
48
|
+
/**
|
|
49
|
+
* Parses visibility and throws when the value is not supported.
|
|
50
|
+
*
|
|
51
|
+
* @param value - Raw visibility value.
|
|
52
|
+
* @param sourceLabel - Human-readable source used in the error message.
|
|
53
|
+
* @returns Parsed visibility.
|
|
54
|
+
*
|
|
55
|
+
* @public exported from `@promptbook/core`
|
|
56
|
+
*/
|
|
57
|
+
export declare function parseAgentVisibilityStrict(value: unknown, sourceLabel?: string): AgentVisibility;
|
|
58
|
+
/**
|
|
59
|
+
* Extracts the last `META VISIBILITY` value from an agent source.
|
|
60
|
+
*
|
|
61
|
+
* @param agentSource - Raw book source.
|
|
62
|
+
* @param options - Strict parsing options.
|
|
63
|
+
* @returns Normalized visibility, or `null` when no commitment is present.
|
|
64
|
+
*
|
|
65
|
+
* @public exported from `@promptbook/core`
|
|
66
|
+
*/
|
|
67
|
+
export declare function parseAgentSourceVisibility(agentSource: string_book, options?: {
|
|
68
|
+
readonly isStrict?: boolean;
|
|
69
|
+
}): AgentVisibility | null;
|
|
70
|
+
/**
|
|
71
|
+
* Returns whether an agent should be listed publicly in anonymous views.
|
|
72
|
+
*
|
|
73
|
+
* @param visibility - Agent visibility to evaluate.
|
|
74
|
+
* @returns `true` for publicly listed agents.
|
|
75
|
+
*
|
|
76
|
+
* @public exported from `@promptbook/core`
|
|
77
|
+
*/
|
|
78
|
+
export declare function isPublicAgentVisibility(visibility: AgentVisibility | null | undefined): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Returns the next visibility in UI rotation order.
|
|
81
|
+
*
|
|
82
|
+
* @param visibility - Current visibility.
|
|
83
|
+
* @returns Next visibility value.
|
|
84
|
+
*
|
|
85
|
+
* @public exported from `@promptbook/core`
|
|
86
|
+
*/
|
|
87
|
+
export declare function getNextAgentVisibility(visibility: AgentVisibility | null | undefined): AgentVisibility;
|
|
88
|
+
/**
|
|
89
|
+
* Inserts or replaces the `META VISIBILITY` commitment in a book source.
|
|
90
|
+
*
|
|
91
|
+
* @param agentSource - Raw book source.
|
|
92
|
+
* @param visibility - Visibility to persist.
|
|
93
|
+
* @returns Source with exactly one normalized `META VISIBILITY` line.
|
|
94
|
+
*
|
|
95
|
+
* @public exported from `@promptbook/core`
|
|
96
|
+
*/
|
|
97
|
+
export declare function setAgentSourceVisibility(agentSource: string_book, visibility: AgentVisibility): string_book;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -19,6 +19,7 @@ export declare const BookEditorMonacoTokenization: {
|
|
|
19
19
|
AGENT_URL_REFERENCE_REGEX: RegExp;
|
|
20
20
|
AGENT_REFERENCE_TOKEN_REGEX: RegExp;
|
|
21
21
|
AGENT_REFERENCE_BRACED_REGEX: RegExp;
|
|
22
|
+
NON_AGENT_REFERENCE_INLINE_AT_TOKEN_REGEX: RegExp;
|
|
22
23
|
AGENT_REFERENCE_HIGHLIGHT_REGEXES: readonly [RegExp, RegExp, RegExp];
|
|
23
24
|
extractAgentReferenceValue: (token: string) => string;
|
|
24
25
|
resolveAgentReferenceToUrl: (referenceValue: string) => string | null;
|
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
* @private internal constant of `ptbk agents-server`
|
|
7
7
|
*/
|
|
8
8
|
export declare const PTBK_AGENTS_SERVER_NODE_MODULES_PATH_ENV = "PTBK_AGENTS_SERVER_NODE_MODULES_PATH";
|
|
9
|
+
/**
|
|
10
|
+
* Environment variable consumed by `apps/agents-server/next.config.ts` to throttle build workers.
|
|
11
|
+
*
|
|
12
|
+
* @private internal constant of `ptbk agents-server`
|
|
13
|
+
*/
|
|
14
|
+
export declare const PTBK_AGENTS_SERVER_BUILD_WORKER_COUNT_ENV = "PTBK_AGENTS_SERVER_BUILD_WORKER_COUNT";
|
|
9
15
|
/**
|
|
10
16
|
* Environment variable used only by the CLI-owned production build.
|
|
11
17
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { string_book } from '../../book-2.0/agent-source/string_book';
|
|
2
|
+
import { type AgentVisibility } from '../../book-2.0/agent-source/agentSourceVisibility';
|
|
2
3
|
import type { LlmToolDefinition } from '../../types/LlmToolDefinition';
|
|
3
4
|
/**
|
|
4
5
|
* Supported visibility options for agent creation.
|
|
@@ -11,7 +12,7 @@ export declare const CREATE_AGENT_VISIBILITY_VALUES: readonly ["PRIVATE", "UNLIS
|
|
|
11
12
|
*
|
|
12
13
|
* @private shared create-agent contract
|
|
13
14
|
*/
|
|
14
|
-
export type CreateAgentVisibility =
|
|
15
|
+
export type CreateAgentVisibility = AgentVisibility;
|
|
15
16
|
/**
|
|
16
17
|
* Canonical input payload for creating one persisted agent entity.
|
|
17
18
|
*
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import type { AgentBasicInformation } from '../../../../book-2.0/agent-source/AgentBasicInformation';
|
|
2
|
+
import { type AgentVisibility } from '../../../../book-2.0/agent-source/agentSourceVisibility';
|
|
2
3
|
import type { string_book } from '../../../../book-2.0/agent-source/string_book';
|
|
3
4
|
import type { string_agent_permanent_id } from '../../../../types/string_agent_name';
|
|
5
|
+
/**
|
|
6
|
+
* Options used while preparing a source for persistence.
|
|
7
|
+
*
|
|
8
|
+
* @private shared persistence helper for `AgentCollectionInSupabase`
|
|
9
|
+
*/
|
|
10
|
+
export type PrepareAgentSourceForPersistenceOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* Visibility value that should be written into the book when present.
|
|
13
|
+
*/
|
|
14
|
+
readonly visibility?: AgentVisibility | null;
|
|
15
|
+
/**
|
|
16
|
+
* Whether `visibility` should replace an existing `META VISIBILITY` commitment.
|
|
17
|
+
*/
|
|
18
|
+
readonly isVisibilityOverride?: boolean;
|
|
19
|
+
};
|
|
4
20
|
/**
|
|
5
21
|
* Prepared agent source payload ready for database persistence.
|
|
6
22
|
*
|
|
@@ -22,6 +38,10 @@ export type PreparedAgentSourceForPersistence = {
|
|
|
22
38
|
* Permanent id extracted from the original source before stripping `META ID`.
|
|
23
39
|
*/
|
|
24
40
|
readonly permanentId: string_agent_permanent_id | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Visibility parsed from the normalized source.
|
|
43
|
+
*/
|
|
44
|
+
readonly visibility: AgentVisibility | undefined;
|
|
25
45
|
};
|
|
26
46
|
/**
|
|
27
47
|
* Normalizes one agent source before persistence.
|
|
@@ -33,4 +53,4 @@ export type PreparedAgentSourceForPersistence = {
|
|
|
33
53
|
*
|
|
34
54
|
* @private shared persistence helper for `AgentCollectionInSupabase`
|
|
35
55
|
*/
|
|
36
|
-
export declare function prepareAgentSourceForPersistence(agentSource: string_book): PreparedAgentSourceForPersistence;
|
|
56
|
+
export declare function prepareAgentSourceForPersistence(agentSource: string_book, options?: PrepareAgentSourceForPersistenceOptions): PreparedAgentSourceForPersistence;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
|
+
/**
|
|
4
|
+
* META VISIBILITY commitment definition.
|
|
5
|
+
*
|
|
6
|
+
* The `META VISIBILITY` commitment stores whether an agent is public, private, or unlisted.
|
|
7
|
+
* Agents Server mirrors this value into the database for efficient filtering, but the book
|
|
8
|
+
* commitment remains the editable source of truth.
|
|
9
|
+
*
|
|
10
|
+
* @private Metadata-only commitment used by Agents Server.
|
|
11
|
+
*/
|
|
12
|
+
export declare class MetaVisibilityCommitmentDefinition extends BaseCommitmentDefinition<'META VISIBILITY'> {
|
|
13
|
+
constructor();
|
|
14
|
+
/**
|
|
15
|
+
* Short one-line description of META VISIBILITY.
|
|
16
|
+
*/
|
|
17
|
+
get description(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Icon for this commitment.
|
|
20
|
+
*/
|
|
21
|
+
get icon(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Markdown documentation for META VISIBILITY commitment.
|
|
24
|
+
*/
|
|
25
|
+
get documentation(): string;
|
|
26
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
27
|
+
}
|
|
@@ -25,6 +25,7 @@ import { MetaFontCommitmentDefinition } from './META_FONT/META_FONT';
|
|
|
25
25
|
import { MetaImageCommitmentDefinition } from './META_IMAGE/META_IMAGE';
|
|
26
26
|
import { MetaInputPlaceholderCommitmentDefinition } from './META_INPUT_PLACEHOLDER/META_INPUT_PLACEHOLDER';
|
|
27
27
|
import { MetaLinkCommitmentDefinition } from './META_LINK/META_LINK';
|
|
28
|
+
import { MetaVisibilityCommitmentDefinition } from './META_VISIBILITY/META_VISIBILITY';
|
|
28
29
|
import { MetaVoiceCommitmentDefinition } from './META_VOICE/META_VOICE';
|
|
29
30
|
import { ModelCommitmentDefinition } from './MODEL/MODEL';
|
|
30
31
|
import { NoteCommitmentDefinition } from './NOTE/NOTE';
|
|
@@ -61,4 +62,4 @@ import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplemented
|
|
|
61
62
|
*
|
|
62
63
|
* @private Use functions to access commitments instead of this array directly
|
|
63
64
|
*/
|
|
64
|
-
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, MetaAvatarCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaDomainCommitmentDefinition, MetaDisclaimerCommitmentDefinition, MetaInputPlaceholderCommitmentDefinition, MetaCommitmentDefinition, MetaVoiceCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, InternalMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageSuffixCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, WalletCommitmentDefinition, WalletCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, TeamCommitmentDefinition, UseBrowserCommitmentDefinition, UseDeepSearchCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseSpawnCommitmentDefinition, UseTimeoutCommitmentDefinition, UseTimeCommitmentDefinition, UseUserLocationCommitmentDefinition, UseCalendarCommitmentDefinition, UseEmailCommitmentDefinition, UsePopupCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseMcpCommitmentDefinition, UsePrivacyCommitmentDefinition, UseProjectCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
65
|
+
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, MetaAvatarCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaDomainCommitmentDefinition, MetaDisclaimerCommitmentDefinition, MetaInputPlaceholderCommitmentDefinition, MetaVisibilityCommitmentDefinition, MetaCommitmentDefinition, MetaVoiceCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, InternalMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageSuffixCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, WalletCommitmentDefinition, WalletCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, TeamCommitmentDefinition, UseBrowserCommitmentDefinition, UseDeepSearchCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseSpawnCommitmentDefinition, UseTimeoutCommitmentDefinition, UseTimeCommitmentDefinition, UseUserLocationCommitmentDefinition, UseCalendarCommitmentDefinition, UseEmailCommitmentDefinition, UsePopupCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseMcpCommitmentDefinition, UsePrivacyCommitmentDefinition, UseProjectCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
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`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.113.0-0",
|
|
4
4
|
"description": "Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -96,6 +96,6 @@
|
|
|
96
96
|
"types": "./esm/src/_packages/types.index.d.ts",
|
|
97
97
|
"typings": "./esm/src/_packages/types.index.d.ts",
|
|
98
98
|
"peerDependencies": {
|
|
99
|
-
"@promptbook/core": "0.
|
|
99
|
+
"@promptbook/core": "0.113.0-0"
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
|
+
import { AGENT_VISIBILITY_VALUES } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
3
|
+
import type { AgentVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
4
|
+
import { DEFAULT_AGENT_VISIBILITY } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
5
|
+
import { isAgentVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
6
|
+
import { normalizeAgentVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
7
|
+
import { parseAgentVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
8
|
+
import { parseAgentVisibilityStrict } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
9
|
+
import { parseAgentSourceVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
10
|
+
import { isPublicAgentVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
11
|
+
import { getNextAgentVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
12
|
+
import { setAgentSourceVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
2
13
|
import { computeAgentHash } from '../book-2.0/agent-source/computeAgentHash';
|
|
3
14
|
import { createAgentModelRequirements } from '../book-2.0/agent-source/createAgentModelRequirements';
|
|
4
15
|
import type { CreateAgentModelRequirementsOptions } from '../book-2.0/agent-source/CreateAgentModelRequirementsOptions';
|
|
@@ -224,6 +235,17 @@ import { $generateBookBoilerplate } from '../utils/random/$generateBookBoilerpla
|
|
|
224
235
|
import { CORE_AGENTS_SERVER_WELL_KNOWN_AGENT_NAMES } from '../../servers';
|
|
225
236
|
import { PUBLIC_AGENTS_SERVERS } from '../../servers';
|
|
226
237
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
238
|
+
export { AGENT_VISIBILITY_VALUES };
|
|
239
|
+
export type { AgentVisibility };
|
|
240
|
+
export { DEFAULT_AGENT_VISIBILITY };
|
|
241
|
+
export { isAgentVisibility };
|
|
242
|
+
export { normalizeAgentVisibility };
|
|
243
|
+
export { parseAgentVisibility };
|
|
244
|
+
export { parseAgentVisibilityStrict };
|
|
245
|
+
export { parseAgentSourceVisibility };
|
|
246
|
+
export { isPublicAgentVisibility };
|
|
247
|
+
export { getNextAgentVisibility };
|
|
248
|
+
export { setAgentSourceVisibility };
|
|
227
249
|
export { computeAgentHash };
|
|
228
250
|
export { createAgentModelRequirements };
|
|
229
251
|
export type { CreateAgentModelRequirementsOptions };
|
|
@@ -2,6 +2,7 @@ import type { BookParameter } from '../book-2.0/agent-source/AgentBasicInformati
|
|
|
2
2
|
import type { AgentCapability } from '../book-2.0/agent-source/AgentBasicInformation';
|
|
3
3
|
import type { AgentBasicInformation } from '../book-2.0/agent-source/AgentBasicInformation';
|
|
4
4
|
import type { AgentModelRequirements } from '../book-2.0/agent-source/AgentModelRequirements';
|
|
5
|
+
import type { AgentVisibility } from '../book-2.0/agent-source/agentSourceVisibility';
|
|
5
6
|
import type { CreateAgentModelRequirementsOptions } from '../book-2.0/agent-source/CreateAgentModelRequirementsOptions';
|
|
6
7
|
import type { string_book } from '../book-2.0/agent-source/string_book';
|
|
7
8
|
import type { BookNodeAgentSource } from '../book-3.0/BookNodeAgentSource';
|
|
@@ -444,6 +445,7 @@ export type { BookParameter };
|
|
|
444
445
|
export type { AgentCapability };
|
|
445
446
|
export type { AgentBasicInformation };
|
|
446
447
|
export type { AgentModelRequirements };
|
|
448
|
+
export type { AgentVisibility };
|
|
447
449
|
export type { CreateAgentModelRequirementsOptions };
|
|
448
450
|
export type { string_book };
|
|
449
451
|
export type { BookNodeAgentSource };
|
|
@@ -4,6 +4,7 @@ import type { string_agent_url } from '../../types/string_agent_url';
|
|
|
4
4
|
import type { string_fonts } from '../../types/string_markdown';
|
|
5
5
|
import type { string_color } from '../../types/string_person_fullname';
|
|
6
6
|
import type { string_url_image } from '../../types/string_url_image';
|
|
7
|
+
import type { AgentVisibility } from './agentSourceVisibility';
|
|
7
8
|
/**
|
|
8
9
|
* Unified parameter representation that supports two different notations:
|
|
9
10
|
* 1. @Parameter - single word parameter starting with @
|
|
@@ -97,6 +98,7 @@ export type AgentBasicInformation = {
|
|
|
97
98
|
font?: string_fonts;
|
|
98
99
|
color?: string_color;
|
|
99
100
|
voice?: string;
|
|
101
|
+
visibility?: AgentVisibility;
|
|
100
102
|
[key: string]: string | undefined;
|
|
101
103
|
};
|
|
102
104
|
/**
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { string_book } from './string_book';
|
|
2
|
+
/**
|
|
3
|
+
* Supported visibility states for persisted agents.
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/core`
|
|
6
|
+
*/
|
|
7
|
+
export declare const AGENT_VISIBILITY_VALUES: readonly ["PRIVATE", "UNLISTED", "PUBLIC"];
|
|
8
|
+
/**
|
|
9
|
+
* Canonical visibility union for agents.
|
|
10
|
+
*
|
|
11
|
+
* @public exported from `@promptbook/core`
|
|
12
|
+
*/
|
|
13
|
+
export type AgentVisibility = (typeof AGENT_VISIBILITY_VALUES)[number];
|
|
14
|
+
/**
|
|
15
|
+
* Fallback visibility used when no valid value is configured.
|
|
16
|
+
*
|
|
17
|
+
* @public exported from `@promptbook/core`
|
|
18
|
+
*/
|
|
19
|
+
export declare const DEFAULT_AGENT_VISIBILITY: AgentVisibility;
|
|
20
|
+
/**
|
|
21
|
+
* Returns `true` when the value is one of supported visibility states.
|
|
22
|
+
*
|
|
23
|
+
* @param value - Raw value to validate.
|
|
24
|
+
* @returns Whether the value is a valid `AgentVisibility`.
|
|
25
|
+
*
|
|
26
|
+
* @public exported from `@promptbook/core`
|
|
27
|
+
*/
|
|
28
|
+
export declare function isAgentVisibility(value: unknown): value is AgentVisibility;
|
|
29
|
+
/**
|
|
30
|
+
* Normalizes raw visibility text into a supported value.
|
|
31
|
+
*
|
|
32
|
+
* @param value - Raw visibility value.
|
|
33
|
+
* @returns Normalized visibility, or `null` when invalid.
|
|
34
|
+
*
|
|
35
|
+
* @public exported from `@promptbook/core`
|
|
36
|
+
*/
|
|
37
|
+
export declare function normalizeAgentVisibility(value: unknown): AgentVisibility | null;
|
|
38
|
+
/**
|
|
39
|
+
* Parses visibility from an unknown value with a safe fallback.
|
|
40
|
+
*
|
|
41
|
+
* @param value - Raw visibility value.
|
|
42
|
+
* @param fallback - Fallback when the value is invalid.
|
|
43
|
+
* @returns Parsed visibility.
|
|
44
|
+
*
|
|
45
|
+
* @public exported from `@promptbook/core`
|
|
46
|
+
*/
|
|
47
|
+
export declare function parseAgentVisibility(value: unknown, fallback?: AgentVisibility): AgentVisibility;
|
|
48
|
+
/**
|
|
49
|
+
* Parses visibility and throws when the value is not supported.
|
|
50
|
+
*
|
|
51
|
+
* @param value - Raw visibility value.
|
|
52
|
+
* @param sourceLabel - Human-readable source used in the error message.
|
|
53
|
+
* @returns Parsed visibility.
|
|
54
|
+
*
|
|
55
|
+
* @public exported from `@promptbook/core`
|
|
56
|
+
*/
|
|
57
|
+
export declare function parseAgentVisibilityStrict(value: unknown, sourceLabel?: string): AgentVisibility;
|
|
58
|
+
/**
|
|
59
|
+
* Extracts the last `META VISIBILITY` value from an agent source.
|
|
60
|
+
*
|
|
61
|
+
* @param agentSource - Raw book source.
|
|
62
|
+
* @param options - Strict parsing options.
|
|
63
|
+
* @returns Normalized visibility, or `null` when no commitment is present.
|
|
64
|
+
*
|
|
65
|
+
* @public exported from `@promptbook/core`
|
|
66
|
+
*/
|
|
67
|
+
export declare function parseAgentSourceVisibility(agentSource: string_book, options?: {
|
|
68
|
+
readonly isStrict?: boolean;
|
|
69
|
+
}): AgentVisibility | null;
|
|
70
|
+
/**
|
|
71
|
+
* Returns whether an agent should be listed publicly in anonymous views.
|
|
72
|
+
*
|
|
73
|
+
* @param visibility - Agent visibility to evaluate.
|
|
74
|
+
* @returns `true` for publicly listed agents.
|
|
75
|
+
*
|
|
76
|
+
* @public exported from `@promptbook/core`
|
|
77
|
+
*/
|
|
78
|
+
export declare function isPublicAgentVisibility(visibility: AgentVisibility | null | undefined): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Returns the next visibility in UI rotation order.
|
|
81
|
+
*
|
|
82
|
+
* @param visibility - Current visibility.
|
|
83
|
+
* @returns Next visibility value.
|
|
84
|
+
*
|
|
85
|
+
* @public exported from `@promptbook/core`
|
|
86
|
+
*/
|
|
87
|
+
export declare function getNextAgentVisibility(visibility: AgentVisibility | null | undefined): AgentVisibility;
|
|
88
|
+
/**
|
|
89
|
+
* Inserts or replaces the `META VISIBILITY` commitment in a book source.
|
|
90
|
+
*
|
|
91
|
+
* @param agentSource - Raw book source.
|
|
92
|
+
* @param visibility - Visibility to persist.
|
|
93
|
+
* @returns Source with exactly one normalized `META VISIBILITY` line.
|
|
94
|
+
*
|
|
95
|
+
* @public exported from `@promptbook/core`
|
|
96
|
+
*/
|
|
97
|
+
export declare function setAgentSourceVisibility(agentSource: string_book, visibility: AgentVisibility): string_book;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -19,6 +19,7 @@ export declare const BookEditorMonacoTokenization: {
|
|
|
19
19
|
AGENT_URL_REFERENCE_REGEX: RegExp;
|
|
20
20
|
AGENT_REFERENCE_TOKEN_REGEX: RegExp;
|
|
21
21
|
AGENT_REFERENCE_BRACED_REGEX: RegExp;
|
|
22
|
+
NON_AGENT_REFERENCE_INLINE_AT_TOKEN_REGEX: RegExp;
|
|
22
23
|
AGENT_REFERENCE_HIGHLIGHT_REGEXES: readonly [RegExp, RegExp, RegExp];
|
|
23
24
|
extractAgentReferenceValue: (token: string) => string;
|
|
24
25
|
resolveAgentReferenceToUrl: (referenceValue: string) => string | null;
|
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
* @private internal constant of `ptbk agents-server`
|
|
7
7
|
*/
|
|
8
8
|
export declare const PTBK_AGENTS_SERVER_NODE_MODULES_PATH_ENV = "PTBK_AGENTS_SERVER_NODE_MODULES_PATH";
|
|
9
|
+
/**
|
|
10
|
+
* Environment variable consumed by `apps/agents-server/next.config.ts` to throttle build workers.
|
|
11
|
+
*
|
|
12
|
+
* @private internal constant of `ptbk agents-server`
|
|
13
|
+
*/
|
|
14
|
+
export declare const PTBK_AGENTS_SERVER_BUILD_WORKER_COUNT_ENV = "PTBK_AGENTS_SERVER_BUILD_WORKER_COUNT";
|
|
9
15
|
/**
|
|
10
16
|
* Environment variable used only by the CLI-owned production build.
|
|
11
17
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { string_book } from '../../book-2.0/agent-source/string_book';
|
|
2
|
+
import { type AgentVisibility } from '../../book-2.0/agent-source/agentSourceVisibility';
|
|
2
3
|
import type { LlmToolDefinition } from '../../types/LlmToolDefinition';
|
|
3
4
|
/**
|
|
4
5
|
* Supported visibility options for agent creation.
|
|
@@ -11,7 +12,7 @@ export declare const CREATE_AGENT_VISIBILITY_VALUES: readonly ["PRIVATE", "UNLIS
|
|
|
11
12
|
*
|
|
12
13
|
* @private shared create-agent contract
|
|
13
14
|
*/
|
|
14
|
-
export type CreateAgentVisibility =
|
|
15
|
+
export type CreateAgentVisibility = AgentVisibility;
|
|
15
16
|
/**
|
|
16
17
|
* Canonical input payload for creating one persisted agent entity.
|
|
17
18
|
*
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import type { AgentBasicInformation } from '../../../../book-2.0/agent-source/AgentBasicInformation';
|
|
2
|
+
import { type AgentVisibility } from '../../../../book-2.0/agent-source/agentSourceVisibility';
|
|
2
3
|
import type { string_book } from '../../../../book-2.0/agent-source/string_book';
|
|
3
4
|
import type { string_agent_permanent_id } from '../../../../types/string_agent_name';
|
|
5
|
+
/**
|
|
6
|
+
* Options used while preparing a source for persistence.
|
|
7
|
+
*
|
|
8
|
+
* @private shared persistence helper for `AgentCollectionInSupabase`
|
|
9
|
+
*/
|
|
10
|
+
export type PrepareAgentSourceForPersistenceOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* Visibility value that should be written into the book when present.
|
|
13
|
+
*/
|
|
14
|
+
readonly visibility?: AgentVisibility | null;
|
|
15
|
+
/**
|
|
16
|
+
* Whether `visibility` should replace an existing `META VISIBILITY` commitment.
|
|
17
|
+
*/
|
|
18
|
+
readonly isVisibilityOverride?: boolean;
|
|
19
|
+
};
|
|
4
20
|
/**
|
|
5
21
|
* Prepared agent source payload ready for database persistence.
|
|
6
22
|
*
|
|
@@ -22,6 +38,10 @@ export type PreparedAgentSourceForPersistence = {
|
|
|
22
38
|
* Permanent id extracted from the original source before stripping `META ID`.
|
|
23
39
|
*/
|
|
24
40
|
readonly permanentId: string_agent_permanent_id | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Visibility parsed from the normalized source.
|
|
43
|
+
*/
|
|
44
|
+
readonly visibility: AgentVisibility | undefined;
|
|
25
45
|
};
|
|
26
46
|
/**
|
|
27
47
|
* Normalizes one agent source before persistence.
|
|
@@ -33,4 +53,4 @@ export type PreparedAgentSourceForPersistence = {
|
|
|
33
53
|
*
|
|
34
54
|
* @private shared persistence helper for `AgentCollectionInSupabase`
|
|
35
55
|
*/
|
|
36
|
-
export declare function prepareAgentSourceForPersistence(agentSource: string_book): PreparedAgentSourceForPersistence;
|
|
56
|
+
export declare function prepareAgentSourceForPersistence(agentSource: string_book, options?: PrepareAgentSourceForPersistenceOptions): PreparedAgentSourceForPersistence;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
|
+
/**
|
|
4
|
+
* META VISIBILITY commitment definition.
|
|
5
|
+
*
|
|
6
|
+
* The `META VISIBILITY` commitment stores whether an agent is public, private, or unlisted.
|
|
7
|
+
* Agents Server mirrors this value into the database for efficient filtering, but the book
|
|
8
|
+
* commitment remains the editable source of truth.
|
|
9
|
+
*
|
|
10
|
+
* @private Metadata-only commitment used by Agents Server.
|
|
11
|
+
*/
|
|
12
|
+
export declare class MetaVisibilityCommitmentDefinition extends BaseCommitmentDefinition<'META VISIBILITY'> {
|
|
13
|
+
constructor();
|
|
14
|
+
/**
|
|
15
|
+
* Short one-line description of META VISIBILITY.
|
|
16
|
+
*/
|
|
17
|
+
get description(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Icon for this commitment.
|
|
20
|
+
*/
|
|
21
|
+
get icon(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Markdown documentation for META VISIBILITY commitment.
|
|
24
|
+
*/
|
|
25
|
+
get documentation(): string;
|
|
26
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
27
|
+
}
|
|
@@ -25,6 +25,7 @@ import { MetaFontCommitmentDefinition } from './META_FONT/META_FONT';
|
|
|
25
25
|
import { MetaImageCommitmentDefinition } from './META_IMAGE/META_IMAGE';
|
|
26
26
|
import { MetaInputPlaceholderCommitmentDefinition } from './META_INPUT_PLACEHOLDER/META_INPUT_PLACEHOLDER';
|
|
27
27
|
import { MetaLinkCommitmentDefinition } from './META_LINK/META_LINK';
|
|
28
|
+
import { MetaVisibilityCommitmentDefinition } from './META_VISIBILITY/META_VISIBILITY';
|
|
28
29
|
import { MetaVoiceCommitmentDefinition } from './META_VOICE/META_VOICE';
|
|
29
30
|
import { ModelCommitmentDefinition } from './MODEL/MODEL';
|
|
30
31
|
import { NoteCommitmentDefinition } from './NOTE/NOTE';
|
|
@@ -61,4 +62,4 @@ import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplemented
|
|
|
61
62
|
*
|
|
62
63
|
* @private Use functions to access commitments instead of this array directly
|
|
63
64
|
*/
|
|
64
|
-
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, MetaAvatarCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaDomainCommitmentDefinition, MetaDisclaimerCommitmentDefinition, MetaInputPlaceholderCommitmentDefinition, MetaCommitmentDefinition, MetaVoiceCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, InternalMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageSuffixCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, WalletCommitmentDefinition, WalletCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, TeamCommitmentDefinition, UseBrowserCommitmentDefinition, UseDeepSearchCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseSpawnCommitmentDefinition, UseTimeoutCommitmentDefinition, UseTimeCommitmentDefinition, UseUserLocationCommitmentDefinition, UseCalendarCommitmentDefinition, UseEmailCommitmentDefinition, UsePopupCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseMcpCommitmentDefinition, UsePrivacyCommitmentDefinition, UseProjectCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
65
|
+
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, MetaAvatarCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaDomainCommitmentDefinition, MetaDisclaimerCommitmentDefinition, MetaInputPlaceholderCommitmentDefinition, MetaVisibilityCommitmentDefinition, MetaCommitmentDefinition, MetaVoiceCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, InternalMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageSuffixCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, WalletCommitmentDefinition, WalletCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, TeamCommitmentDefinition, UseBrowserCommitmentDefinition, UseDeepSearchCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseSpawnCommitmentDefinition, UseTimeoutCommitmentDefinition, UseTimeCommitmentDefinition, UseUserLocationCommitmentDefinition, UseCalendarCommitmentDefinition, UseEmailCommitmentDefinition, UsePopupCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseMcpCommitmentDefinition, UsePrivacyCommitmentDefinition, UseProjectCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
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`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|