ptbk 0.113.0-1 → 0.113.0-3

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 CHANGED
@@ -23,13 +23,7 @@ Create persistent AI agents that turn your company's scattered knowledge into ac
23
23
 
24
24
 
25
25
 
26
- [![Vercel](https://img.shields.io/badge/Vercel-Deploy%20Agents%20Server-black?logo=vercel)](https://vercel.com/new/clone?project-name=promptbook-agents-server&repository-name=promptbook-agents-server&repository-url=https%3A%2F%2Fgithub.com%2Fwebgptorg%2Fpromptbook&root-directory=apps%2Fagents-server&demo-title=Promptbook+Agents+Server&demo-description=Persistent+AI+agents+with+a+built-in+admin+UI.+This+deploy+creates+a+Supabase+project+automatically%2C+injects+the+required+database+credentials%2C+and+Promptbook+runs+the+SQL+migrations+on+first+startup.&demo-url=https%3A%2F%2Fgallery.ptbk.io%2F&external-id=https%3A%2F%2Fgithub.com%2Fwebgptorg%2Fpromptbook%2Ftree%2Fmain%2Fapps%2Fagents-server&env=OPENAI_API_KEY%2CADMIN_PASSWORD%2CSUPABASE_AUTO_MIGRATE&envDescription=Supabase+is+created+automatically+by+the+required+Vercel+integration.+Add+OPENAI_API_KEY+from+https%3A%2F%2Fplatform.openai.com%2Fapi-keys%2C+choose+ADMIN_PASSWORD+for+your+first+admin+login%2C+and+leave+SUPABASE_AUTO_MIGRATE+enabled.&envLink=https%3A%2F%2Fgithub.com%2Fwebgptorg%2Fpromptbook%2Fblob%2Fmain%2FREADME.md%23vercel-form-fields&envDefaults=%7B%22SUPABASE_AUTO_MIGRATE%22%3A%22true%22%7D&stores=%5B%7B%22type%22%3A%22integration%22%2C%22integrationSlug%22%3A%22supabase%22%2C%22productSlug%22%3A%22supabase%22%7D%5D)
27
-
28
-
29
-
30
- ### Standalone VPS
31
-
32
- Run the standalone VPS installer only on a fresh server. Interactive mode asks for the installation values:
26
+ Run the standalone VPS installer _(for example on DigitalOcean)_ only on a fresh server. Interactive mode asks for the installation values:
33
27
 
34
28
  ```bash
35
29
  sudo curl -fsSL https://raw.githubusercontent.com/webgptorg/promptbook/refs/heads/main/other/vps/install.sh | bash
@@ -212,8 +206,6 @@ TEAM You are part of the legal team of Paul Smith & Associés, you discuss with
212
206
 
213
207
  </td></tr></table>
214
208
 
215
-
216
-
217
209
  ### Promptbook Ecosystem
218
210
 
219
211
  Promptbook is an ecosystem of tools centered around the **Agents Server** - a production-ready platform for running persistent AI agents.
@@ -236,8 +228,6 @@ The [Promptbook Engine](https://github.com/webgptorg/promptbook) is the open-sou
236
228
 
237
229
 
238
230
 
239
-
240
-
241
231
  ## 💜 The Promptbook Project
242
232
 
243
233
  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:
@@ -275,8 +265,6 @@ Promptbook project is an ecosystem centered around the **Agents Server** - a pla
275
265
  </tbody>
276
266
  </table>
277
267
 
278
-
279
-
280
268
  ### 🌐 Community & Social Media
281
269
 
282
270
  Join our growing community of developers and users:
@@ -333,8 +321,6 @@ Join our growing community of developers and users:
333
321
 
334
322
 
335
323
 
336
-
337
-
338
324
  ## 📚 Documentation
339
325
 
340
326
  See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
@@ -542,8 +528,6 @@ The following glossary is used to clarify certain concepts:
542
528
 
543
529
  _Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
544
530
 
545
-
546
-
547
531
  ### 💯 Core concepts
548
532
 
549
533
  - [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
@@ -6,12 +6,98 @@
6
6
  * Note: [🔺] Purpose of this file is to forward `ptbk` package launches to `@promptbook/cli`
7
7
  */
8
8
 
9
- const { dirname } = require('path');
9
+ const { realpathSync } = require('fs');
10
+ const { dirname, resolve } = require('path');
10
11
 
11
- // Resolve through `promptbook` so the proxy works for both hoisted and nested installs.
12
- const promptbookPackageRoot = dirname(require.resolve('promptbook/package.json'));
13
- const promptbookCliEntrypoint = require.resolve('@promptbook/cli/bin/promptbook-cli.js', {
14
- paths: [promptbookPackageRoot, __dirname],
15
- });
12
+ const PROMPTBOOK_CLI_BIN_PATH = '@promptbook/cli/bin/promptbook-cli.js';
13
+ const PROMPTBOOK_PACKAGE_JSON_PATH = 'promptbook/package.json';
14
+ const PTBK_PACKAGE_JSON_PATH = 'ptbk/package.json';
15
+ const PTBK_PROXY_BIN_PATH = 'bin/promptbook-cli-proxy.js';
16
+ const CURRENT_PACKAGE_ROOT = resolve(__dirname, '..');
16
17
 
17
- require(promptbookCliEntrypoint);
18
+ const localPtbkEntrypoint = resolveLocalPtbkEntrypoint();
19
+
20
+ if (localPtbkEntrypoint !== null) {
21
+ require(localPtbkEntrypoint);
22
+ } else {
23
+ require(resolvePromptbookCliEntrypoint());
24
+ }
25
+
26
+ /**
27
+ * Resolves a cwd-local `ptbk` launcher when this proxy was reached from another install.
28
+ *
29
+ * This keeps `ptbk about` aligned with the project dependency even when another
30
+ * `ptbk` install appears earlier on PATH.
31
+ */
32
+ function resolveLocalPtbkEntrypoint() {
33
+ const localPtbkPackageJsonPath = tryRequireResolve(PTBK_PACKAGE_JSON_PATH, [process.cwd()]);
34
+
35
+ if (localPtbkPackageJsonPath === null) {
36
+ return null;
37
+ }
38
+
39
+ const localPtbkPackageRoot = dirname(localPtbkPackageJsonPath);
40
+
41
+ if (isSameFilesystemPath(localPtbkPackageRoot, CURRENT_PACKAGE_ROOT)) {
42
+ return null;
43
+ }
44
+
45
+ return resolve(localPtbkPackageRoot, PTBK_PROXY_BIN_PATH);
46
+ }
47
+
48
+ /**
49
+ * Resolves the CLI binary from this package graph.
50
+ */
51
+ function resolvePromptbookCliEntrypoint() {
52
+ const directPromptbookCliEntrypoint = tryRequireResolve(PROMPTBOOK_CLI_BIN_PATH, [
53
+ CURRENT_PACKAGE_ROOT,
54
+ __dirname,
55
+ ]);
56
+
57
+ if (directPromptbookCliEntrypoint !== null) {
58
+ return directPromptbookCliEntrypoint;
59
+ }
60
+
61
+ const promptbookPackageRoot = dirname(
62
+ require.resolve(PROMPTBOOK_PACKAGE_JSON_PATH, {
63
+ paths: [CURRENT_PACKAGE_ROOT, __dirname],
64
+ }),
65
+ );
66
+
67
+ return require.resolve(PROMPTBOOK_CLI_BIN_PATH, {
68
+ paths: [promptbookPackageRoot, CURRENT_PACKAGE_ROOT, __dirname],
69
+ });
70
+ }
71
+
72
+ /**
73
+ * Resolves a module path and returns `null` when it cannot be resolved.
74
+ */
75
+ function tryRequireResolve(modulePath, resolvePaths) {
76
+ try {
77
+ return require.resolve(modulePath, { paths: resolvePaths });
78
+ } catch {
79
+ return null;
80
+ }
81
+ }
82
+
83
+ /**
84
+ * Compares filesystem paths after resolving symlinks where possible.
85
+ */
86
+ function isSameFilesystemPath(firstPath, secondPath) {
87
+ return normalizeFilesystemPath(firstPath) === normalizeFilesystemPath(secondPath);
88
+ }
89
+
90
+ /**
91
+ * Normalizes one filesystem path for cross-platform comparisons.
92
+ */
93
+ function normalizeFilesystemPath(path) {
94
+ let resolvedPath = resolve(path);
95
+
96
+ try {
97
+ resolvedPath = realpathSync(resolvedPath);
98
+ } catch {
99
+ // Keep the resolved path when a transient install path cannot be realpathed.
100
+ }
101
+
102
+ return process.platform === 'win32' ? resolvedPath.toLowerCase() : resolvedPath;
103
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ptbk",
3
- "version": "0.113.0-1",
3
+ "version": "0.113.0-3",
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,
@@ -91,10 +91,11 @@
91
91
  "zod": "$zod"
92
92
  },
93
93
  "peerDependencies": {
94
- "@promptbook/core": "0.113.0-1"
94
+ "@promptbook/core": "0.113.0-3"
95
95
  },
96
96
  "dependencies": {
97
- "promptbook": "0.113.0-1"
97
+ "@promptbook/cli": "0.113.0-3",
98
+ "promptbook": "0.113.0-3"
98
99
  },
99
100
  "bin": {
100
101
  "ptbk": "bin/promptbook-cli-proxy.js"