@breign/db-schemas 0.1.51 → 0.1.52

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.
@@ -39,6 +39,7 @@ export type Agent = {
39
39
  maxToolSteps?: number;
40
40
  contextualKnowledgeConversation?: ContextualKnowledgeConversationConfig;
41
41
  memoryConfiguration?: AgentMemoryConfiguration;
42
+ sandboxConfiguration?: AgentSandboxConfiguration;
42
43
  speechToText?: SpeechToTextConfig;
43
44
  };
44
45
  export type AgentMemoryConfiguration = {
@@ -46,6 +47,17 @@ export type AgentMemoryConfiguration = {
46
47
  agentMemoryEnabled?: boolean;
47
48
  organizationMemoryEnabled?: boolean;
48
49
  };
50
+ export type AgentSandboxNetworkConfiguration = {
51
+ enabled?: boolean;
52
+ allowedUrlPrefixes?: string[];
53
+ allowedMethods?: ('GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS')[];
54
+ };
55
+ export type AgentSandboxConfiguration = {
56
+ enabled?: boolean;
57
+ pythonEnabled?: boolean;
58
+ network?: AgentSandboxNetworkConfiguration;
59
+ workspaceScope?: 'conversation' | 'agentUser';
60
+ };
49
61
  export type ContextualKnowledgeConversationBackend = 'weaviate' | 'qdrant' | 'colpali';
50
62
  export type ContextualKnowledgeConversationConfig = {
51
63
  enabled: boolean;
@@ -33,6 +33,7 @@ export type ConversationMessage = {
33
33
  id: string;
34
34
  text: string;
35
35
  }[];
36
+ workspaceFiles?: string[];
36
37
  flowNode?: string;
37
38
  flowNodeRequirementsChecked?: boolean;
38
39
  flowNodeRequirementsMet?: boolean;
@@ -17,3 +17,4 @@ export * from './skill';
17
17
  export * from './scheduled-task';
18
18
  export * from './scheduled-task-run';
19
19
  export * from './speech-to-text';
20
+ export * from './workspace-file';
@@ -33,3 +33,4 @@ __exportStar(require("./skill"), exports);
33
33
  __exportStar(require("./scheduled-task"), exports);
34
34
  __exportStar(require("./scheduled-task-run"), exports);
35
35
  __exportStar(require("./speech-to-text"), exports);
36
+ __exportStar(require("./workspace-file"), exports);
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Persistent agent workspace — one row per virtual file under /home/user/.
3
+ *
4
+ * Shared between brain-api (storage adapters + Bash_exec sandbox) and any other
5
+ * consumer. The path is a virtual filesystem key (e.g. '/home/user/rapport.md');
6
+ * identity (organisationId / conversationId / agentId / userId) never comes from
7
+ * the path, always from the server-side chat context.
8
+ *
9
+ * Content is UTF-8 text only: it is stored in a `text` column, which cannot hold
10
+ * a NUL byte. The invariant is enforced at write time inside the sandbox
11
+ * filesystem, not here.
12
+ */
13
+ export type WorkspaceFile = {
14
+ id: string;
15
+ /**
16
+ * British spelling "organisationId" — aligned with Agent.organisationId
17
+ * (domain + Mongo storage). In PostgreSQL the COLUMN is organizationId ("z"),
18
+ * mapped inside the PG adapter (cf. agents-pg.adapter.ts).
19
+ */
20
+ organisationId: string;
21
+ /** Set for the 'conversation' scope (phase 1). Mutually exclusive with agentId/userId. */
22
+ conversationId?: string;
23
+ /** Set for the 'agentUser' scope. Mutually exclusive with conversationId. */
24
+ agentId?: string;
25
+ /** Set for the 'agentUser' scope. Mutually exclusive with conversationId. */
26
+ userId?: string;
27
+ /** e.g. '/home/user/rapport.md' — validated server-side, never by the model alone. */
28
+ path: string;
29
+ content: string;
30
+ /** utf8 byte length — avoids a length() on every listing. */
31
+ size: number;
32
+ mimeType: string;
33
+ /** Optimistic lock — incremented on every write. Also used as the canvas ETag. */
34
+ version: number;
35
+ createdAt: string;
36
+ updatedAt: string;
37
+ };
38
+ /** Listing entry: never carries the content. */
39
+ export type WorkspaceFileEntry = Pick<WorkspaceFile, 'path' | 'size' | 'mimeType' | 'version' | 'updatedAt'>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breign/db-schemas",
3
- "version": "0.1.51",
3
+ "version": "0.1.52",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -34,6 +34,7 @@ export type Agent = {
34
34
  maxToolSteps?: number;
35
35
  contextualKnowledgeConversation?: ContextualKnowledgeConversationConfig;
36
36
  memoryConfiguration?: AgentMemoryConfiguration;
37
+ sandboxConfiguration?: AgentSandboxConfiguration;
37
38
  speechToText?: SpeechToTextConfig;
38
39
  };
39
40
 
@@ -43,6 +44,19 @@ export type AgentMemoryConfiguration = {
43
44
  organizationMemoryEnabled?: boolean;
44
45
  };
45
46
 
47
+ export type AgentSandboxNetworkConfiguration = {
48
+ enabled?: boolean;
49
+ allowedUrlPrefixes?: string[];
50
+ allowedMethods?: ('GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS')[];
51
+ };
52
+
53
+ export type AgentSandboxConfiguration = {
54
+ enabled?: boolean;
55
+ pythonEnabled?: boolean;
56
+ network?: AgentSandboxNetworkConfiguration;
57
+ workspaceScope?: 'conversation' | 'agentUser';
58
+ };
59
+
46
60
  export type ContextualKnowledgeConversationBackend = 'weaviate' | 'qdrant' | 'colpali';
47
61
 
48
62
  export type ContextualKnowledgeConversationConfig = {
@@ -32,6 +32,7 @@ export type ConversationMessage = {
32
32
  id: string;
33
33
  text: string;
34
34
  }[];
35
+ workspaceFiles?: string[];
35
36
  flowNode?: string;
36
37
  flowNodeRequirementsChecked?: boolean;
37
38
  flowNodeRequirementsMet?: boolean;
@@ -17,3 +17,4 @@ export * from './skill';
17
17
  export * from './scheduled-task';
18
18
  export * from './scheduled-task-run';
19
19
  export * from './speech-to-text';
20
+ export * from './workspace-file';
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Persistent agent workspace — one row per virtual file under /home/user/.
3
+ *
4
+ * Shared between brain-api (storage adapters + Bash_exec sandbox) and any other
5
+ * consumer. The path is a virtual filesystem key (e.g. '/home/user/rapport.md');
6
+ * identity (organisationId / conversationId / agentId / userId) never comes from
7
+ * the path, always from the server-side chat context.
8
+ *
9
+ * Content is UTF-8 text only: it is stored in a `text` column, which cannot hold
10
+ * a NUL byte. The invariant is enforced at write time inside the sandbox
11
+ * filesystem, not here.
12
+ */
13
+ export type WorkspaceFile = {
14
+ id: string;
15
+ /**
16
+ * British spelling "organisationId" — aligned with Agent.organisationId
17
+ * (domain + Mongo storage). In PostgreSQL the COLUMN is organizationId ("z"),
18
+ * mapped inside the PG adapter (cf. agents-pg.adapter.ts).
19
+ */
20
+ organisationId: string;
21
+ /** Set for the 'conversation' scope (phase 1). Mutually exclusive with agentId/userId. */
22
+ conversationId?: string;
23
+ /** Set for the 'agentUser' scope. Mutually exclusive with conversationId. */
24
+ agentId?: string;
25
+ /** Set for the 'agentUser' scope. Mutually exclusive with conversationId. */
26
+ userId?: string;
27
+ /** e.g. '/home/user/rapport.md' — validated server-side, never by the model alone. */
28
+ path: string;
29
+ content: string;
30
+ /** utf8 byte length — avoids a length() on every listing. */
31
+ size: number;
32
+ mimeType: string;
33
+ /** Optimistic lock — incremented on every write. Also used as the canvas ETag. */
34
+ version: number;
35
+ createdAt: string;
36
+ updatedAt: string;
37
+ };
38
+
39
+ /** Listing entry: never carries the content. */
40
+ export type WorkspaceFileEntry = Pick<
41
+ WorkspaceFile,
42
+ 'path' | 'size' | 'mimeType' | 'version' | 'updatedAt'
43
+ >;