@promptbook/cli 0.112.0-136 → 0.112.0-137
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 +20 -0
- package/apps/agents-server/src/app/api/internal/agent-runner-limits/route.ts +2 -1
- package/apps/agents-server/src/app/api/internal/user-chat-jobs/run/route.ts +2 -1
- package/apps/agents-server/src/utils/localChatRunner/processLocalUserChatJob.ts +1 -1
- package/apps/agents-server/src/utils/session.ts +2 -1
- package/esm/index.es.js +1 -1
- package/esm/index.es.js.map +1 -1
- package/esm/src/utils/isTimingSafeEqualString.d.ts +25 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/commitments/_common/teamInternalAgentAccess.ts +2 -1
- package/src/other/templates/getTemplatesPipelineCollection.ts +826 -802
- package/src/utils/isTimingSafeEqualString.ts +43 -0
- package/src/version.ts +2 -2
- package/src/versions.txt +1 -0
- package/umd/index.umd.js +1 -1
- package/umd/index.umd.js.map +1 -1
- package/umd/src/utils/isTimingSafeEqualString.d.ts +25 -0
- package/umd/src/version.d.ts +1 -1
package/README.md
CHANGED
|
@@ -27,6 +27,26 @@ Create persistent AI agents that turn your company's scattered knowledge into ac
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
+
### Standalone VPS
|
|
31
|
+
|
|
32
|
+
Run the standalone VPS installer only on a fresh server. Interactive mode asks for the installation values:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
sudo curl -fsSL https://raw.githubusercontent.com/webgptorg/promptbook/refs/heads/main/other/vps/install.sh | bash
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Non-interactive mode takes defaults from command-line options and skips initial code-runner CLI setup, which can be configured later from the UI or SSH:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
sudo curl -fsSL https://raw.githubusercontent.com/webgptorg/promptbook/refs/heads/main/other/vps/install.sh | bash -s -- \
|
|
42
|
+
--non-interactive \
|
|
43
|
+
--yes-i-understand-that-script-should-be-run-on-fresh-server \
|
|
44
|
+
--domain s24.ptbk.io \
|
|
45
|
+
--openai-api-key sk-proj-abcdef \
|
|
46
|
+
--sentry-dsn https://abc@def.ingest.de.sentry.io/123 \
|
|
47
|
+
--admin-password xxx
|
|
48
|
+
```
|
|
49
|
+
|
|
30
50
|
|
|
31
51
|
|
|
32
52
|
<blockquote style="color: #ff8811">
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NextResponse } from 'next/server';
|
|
2
|
+
import { isTimingSafeEqualString } from '../../../../../../../src/utils/isTimingSafeEqualString';
|
|
2
3
|
import { resolveUserChatWorkerInternalToken } from '@/src/utils/userChat';
|
|
3
4
|
import { getLocalAgentRunnerLimits } from '@/src/utils/serverLimits';
|
|
4
5
|
|
|
@@ -47,5 +48,5 @@ async function handleAgentRunnerLimitsRequest(request: Request) {
|
|
|
47
48
|
*/
|
|
48
49
|
function isAuthorizedInternalWorkerRequest(request: Request): boolean {
|
|
49
50
|
const token = request.headers.get('x-user-chat-worker-token');
|
|
50
|
-
return token
|
|
51
|
+
return isTimingSafeEqualString(token, resolveUserChatWorkerInternalToken());
|
|
51
52
|
}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
triggerUserChatJobWorker,
|
|
6
6
|
} from '@/src/utils/userChat';
|
|
7
7
|
import { after, NextResponse } from 'next/server';
|
|
8
|
+
import { isTimingSafeEqualString } from '../../../../../../../../src/utils/isTimingSafeEqualString';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Allows one worker invocation to run for the platform maximum.
|
|
@@ -101,5 +102,5 @@ function isAuthorizedUserChatWorkerRequest(request: Request): boolean {
|
|
|
101
102
|
*/
|
|
102
103
|
function isAuthorizedInternalWorkerRequest(request: Request): boolean {
|
|
103
104
|
const token = request.headers.get('x-user-chat-worker-token');
|
|
104
|
-
return token
|
|
105
|
+
return isTimingSafeEqualString(token, resolveUserChatWorkerInternalToken());
|
|
105
106
|
}
|
|
@@ -223,7 +223,7 @@ async function synchronizeLocalUserChatJob(
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
const failedFileContent = await readOptionalTextFile(join(agentDirectoryPath, metadata.failedPath));
|
|
226
|
-
if (failedFileContent !== null) {
|
|
226
|
+
if (failedFileContent !== null && job.status !== 'FAILED') {
|
|
227
227
|
const failureReason = parseLocalChatFailedMessageBook({
|
|
228
228
|
bookContent: failedFileContent,
|
|
229
229
|
expectedMessagesBeforeAnswer: metadata.expectedMessagesBeforeAnswer,
|
|
@@ -3,6 +3,7 @@ import { cookies, headers } from 'next/headers';
|
|
|
3
3
|
import { cache } from 'react';
|
|
4
4
|
import { spaceTrim } from 'spacetrim';
|
|
5
5
|
import { EnvironmentMismatchError } from '../../../../src/errors/EnvironmentMismatchError';
|
|
6
|
+
import { isTimingSafeEqualString } from '../../../../src/utils/isTimingSafeEqualString';
|
|
6
7
|
import { isStandaloneVpsRawIpBootstrapActive } from './standaloneVpsRawIpBootstrap';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -153,7 +154,7 @@ export function parseSessionToken(token: string | null | undefined): SessionUser
|
|
|
153
154
|
const payload = Buffer.from(payloadBase64, 'base64').toString('utf-8');
|
|
154
155
|
const expectedSignature = createHmac('sha256', getSessionSigningKey()).update(payload).digest('hex');
|
|
155
156
|
|
|
156
|
-
if (signature
|
|
157
|
+
if (!isTimingSafeEqualString(signature, expectedSignature)) {
|
|
157
158
|
return null;
|
|
158
159
|
}
|
|
159
160
|
|
package/esm/index.es.js
CHANGED
|
@@ -59,7 +59,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
59
59
|
* @generated
|
|
60
60
|
* @see https://github.com/webgptorg/promptbook
|
|
61
61
|
*/
|
|
62
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
62
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-137';
|
|
63
63
|
/**
|
|
64
64
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
65
65
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|