@superblocksteam/shared 0.9562.5 → 0.9563.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 (154) hide show
  1. package/dist/constants.js +2 -1
  2. package/dist/constants.js.map +1 -1
  3. package/dist/constants.test.js +9 -1
  4. package/dist/constants.test.js.map +1 -1
  5. package/dist/index.d.ts +1 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/org-features/index.d.ts +44 -0
  10. package/dist/org-features/index.d.ts.map +1 -0
  11. package/dist/org-features/index.js +73 -0
  12. package/dist/org-features/index.js.map +1 -0
  13. package/dist/org-features/index.test.d.ts +2 -0
  14. package/dist/org-features/index.test.d.ts.map +1 -0
  15. package/dist/org-features/index.test.js +39 -0
  16. package/dist/org-features/index.test.js.map +1 -0
  17. package/dist/plugins/templates/bigquery.d.ts.map +1 -1
  18. package/dist/plugins/templates/bigquery.js +225 -1
  19. package/dist/plugins/templates/bigquery.js.map +1 -1
  20. package/dist/plugins/templates/databricks.d.ts.map +1 -1
  21. package/dist/plugins/templates/databricks.js +10 -0
  22. package/dist/plugins/templates/databricks.js.map +1 -1
  23. package/dist/plugins/templates/salesforce.d.ts +4 -0
  24. package/dist/plugins/templates/salesforce.d.ts.map +1 -1
  25. package/dist/plugins/templates/salesforce.js +207 -18
  26. package/dist/plugins/templates/salesforce.js.map +1 -1
  27. package/dist/plugins/templates/shared/auth.d.ts +12 -1
  28. package/dist/plugins/templates/shared/auth.d.ts.map +1 -1
  29. package/dist/plugins/templates/shared/auth.js +19 -4
  30. package/dist/plugins/templates/shared/auth.js.map +1 -1
  31. package/dist/socket/protocol.d.ts +4 -1
  32. package/dist/socket/protocol.d.ts.map +1 -1
  33. package/dist/socket/tracedSocket.d.ts +15 -0
  34. package/dist/socket/tracedSocket.d.ts.map +1 -1
  35. package/dist/socket/tracedSocket.js +15 -0
  36. package/dist/socket/tracedSocket.js.map +1 -1
  37. package/dist/types/ai/index.d.ts +2 -1
  38. package/dist/types/ai/index.d.ts.map +1 -1
  39. package/dist/types/ai/index.js +1 -0
  40. package/dist/types/ai/index.js.map +1 -1
  41. package/dist/types/datasource/auth.d.ts +1 -0
  42. package/dist/types/datasource/auth.d.ts.map +1 -1
  43. package/dist/types/datasource/auth.js +2 -0
  44. package/dist/types/datasource/auth.js.map +1 -1
  45. package/dist/types/datasource/index.d.ts +17 -6
  46. package/dist/types/datasource/index.d.ts.map +1 -1
  47. package/dist/types/datasource/index.js.map +1 -1
  48. package/dist/types/fact/fact.d.ts +52 -0
  49. package/dist/types/fact/fact.d.ts.map +1 -0
  50. package/dist/types/fact/fact.js +20 -0
  51. package/dist/types/fact/fact.js.map +1 -0
  52. package/dist/types/index.d.ts +1 -0
  53. package/dist/types/index.d.ts.map +1 -1
  54. package/dist/types/index.js +1 -0
  55. package/dist/types/index.js.map +1 -1
  56. package/dist/types/integration/index.d.ts +6 -2
  57. package/dist/types/integration/index.d.ts.map +1 -1
  58. package/dist/types/integration/index.js +6 -2
  59. package/dist/types/integration/index.js.map +1 -1
  60. package/dist/types/organization/index.d.ts +5 -1
  61. package/dist/types/organization/index.d.ts.map +1 -1
  62. package/dist/types/organization/index.js +7 -3
  63. package/dist/types/organization/index.js.map +1 -1
  64. package/dist/types/rbac/index.d.ts +6 -0
  65. package/dist/types/rbac/index.d.ts.map +1 -1
  66. package/dist/types/rbac/index.js +6 -1
  67. package/dist/types/rbac/index.js.map +1 -1
  68. package/dist-esm/constants.js +2 -1
  69. package/dist-esm/constants.js.map +1 -1
  70. package/dist-esm/constants.test.js +9 -1
  71. package/dist-esm/constants.test.js.map +1 -1
  72. package/dist-esm/index.d.ts +1 -0
  73. package/dist-esm/index.d.ts.map +1 -1
  74. package/dist-esm/index.js +1 -0
  75. package/dist-esm/index.js.map +1 -1
  76. package/dist-esm/org-features/index.d.ts +44 -0
  77. package/dist-esm/org-features/index.d.ts.map +1 -0
  78. package/dist-esm/org-features/index.js +69 -0
  79. package/dist-esm/org-features/index.js.map +1 -0
  80. package/dist-esm/org-features/index.test.d.ts +2 -0
  81. package/dist-esm/org-features/index.test.d.ts.map +1 -0
  82. package/dist-esm/org-features/index.test.js +37 -0
  83. package/dist-esm/org-features/index.test.js.map +1 -0
  84. package/dist-esm/plugins/templates/bigquery.d.ts.map +1 -1
  85. package/dist-esm/plugins/templates/bigquery.js +226 -2
  86. package/dist-esm/plugins/templates/bigquery.js.map +1 -1
  87. package/dist-esm/plugins/templates/databricks.d.ts.map +1 -1
  88. package/dist-esm/plugins/templates/databricks.js +10 -0
  89. package/dist-esm/plugins/templates/databricks.js.map +1 -1
  90. package/dist-esm/plugins/templates/salesforce.d.ts +4 -0
  91. package/dist-esm/plugins/templates/salesforce.d.ts.map +1 -1
  92. package/dist-esm/plugins/templates/salesforce.js +193 -4
  93. package/dist-esm/plugins/templates/salesforce.js.map +1 -1
  94. package/dist-esm/plugins/templates/shared/auth.d.ts +12 -1
  95. package/dist-esm/plugins/templates/shared/auth.d.ts.map +1 -1
  96. package/dist-esm/plugins/templates/shared/auth.js +17 -2
  97. package/dist-esm/plugins/templates/shared/auth.js.map +1 -1
  98. package/dist-esm/socket/protocol.d.ts +4 -1
  99. package/dist-esm/socket/protocol.d.ts.map +1 -1
  100. package/dist-esm/socket/tracedSocket.d.ts +15 -0
  101. package/dist-esm/socket/tracedSocket.d.ts.map +1 -1
  102. package/dist-esm/socket/tracedSocket.js +15 -0
  103. package/dist-esm/socket/tracedSocket.js.map +1 -1
  104. package/dist-esm/types/ai/index.d.ts +2 -1
  105. package/dist-esm/types/ai/index.d.ts.map +1 -1
  106. package/dist-esm/types/ai/index.js +1 -0
  107. package/dist-esm/types/ai/index.js.map +1 -1
  108. package/dist-esm/types/datasource/auth.d.ts +1 -0
  109. package/dist-esm/types/datasource/auth.d.ts.map +1 -1
  110. package/dist-esm/types/datasource/auth.js +2 -0
  111. package/dist-esm/types/datasource/auth.js.map +1 -1
  112. package/dist-esm/types/datasource/index.d.ts +17 -6
  113. package/dist-esm/types/datasource/index.d.ts.map +1 -1
  114. package/dist-esm/types/datasource/index.js.map +1 -1
  115. package/dist-esm/types/fact/fact.d.ts +52 -0
  116. package/dist-esm/types/fact/fact.d.ts.map +1 -0
  117. package/dist-esm/types/fact/fact.js +17 -0
  118. package/dist-esm/types/fact/fact.js.map +1 -0
  119. package/dist-esm/types/index.d.ts +1 -0
  120. package/dist-esm/types/index.d.ts.map +1 -1
  121. package/dist-esm/types/index.js +1 -0
  122. package/dist-esm/types/index.js.map +1 -1
  123. package/dist-esm/types/integration/index.d.ts +6 -2
  124. package/dist-esm/types/integration/index.d.ts.map +1 -1
  125. package/dist-esm/types/integration/index.js +6 -2
  126. package/dist-esm/types/integration/index.js.map +1 -1
  127. package/dist-esm/types/organization/index.d.ts +5 -1
  128. package/dist-esm/types/organization/index.d.ts.map +1 -1
  129. package/dist-esm/types/organization/index.js +6 -2
  130. package/dist-esm/types/organization/index.js.map +1 -1
  131. package/dist-esm/types/rbac/index.d.ts +6 -0
  132. package/dist-esm/types/rbac/index.d.ts.map +1 -1
  133. package/dist-esm/types/rbac/index.js +6 -1
  134. package/dist-esm/types/rbac/index.js.map +1 -1
  135. package/package.json +2 -2
  136. package/src/constants.test.ts +9 -1
  137. package/src/constants.ts +2 -1
  138. package/src/index.ts +1 -0
  139. package/src/org-features/index.test.ts +42 -0
  140. package/src/org-features/index.ts +74 -0
  141. package/src/plugins/templates/bigquery.ts +240 -3
  142. package/src/plugins/templates/databricks.ts +10 -0
  143. package/src/plugins/templates/salesforce.ts +205 -4
  144. package/src/plugins/templates/shared/auth.ts +19 -1
  145. package/src/socket/protocol.ts +4 -1
  146. package/src/socket/tracedSocket.ts +15 -0
  147. package/src/types/ai/index.ts +2 -1
  148. package/src/types/datasource/auth.ts +2 -0
  149. package/src/types/datasource/index.ts +18 -6
  150. package/src/types/fact/fact.ts +56 -0
  151. package/src/types/index.ts +1 -0
  152. package/src/types/integration/index.ts +10 -2
  153. package/src/types/organization/index.ts +9 -3
  154. package/src/types/rbac/index.ts +6 -1
@@ -12,7 +12,8 @@ export type AiChatMessageDto = {
12
12
  * System event trigger types for AI operations without prompt_id
13
13
  */
14
14
  export enum AiSystemTriggerType {
15
- COMMIT_MESSAGE = 'commit_message'
15
+ COMMIT_MESSAGE = 'commit_message',
16
+ FACT_METADATA = 'fact_metadata'
16
17
  }
17
18
 
18
19
  /**
@@ -100,6 +100,8 @@ export enum IntegrationAuthType {
100
100
  OAUTH2_IMPLICIT = 'oauth-implicit',
101
101
  OAUTH2_PASSWORD = 'oauth-pword',
102
102
  OAUTH2_TOKEN_EXCHANGE = 'oauth-token-exchange',
103
+ // since proto does not support hyphens
104
+ OAUTH2_TOKEN_EXCHANGE_PROTO = 'oauthTokenExchange',
103
105
  FIREBASE = 'Firebase',
104
106
  BEARER = 'bearer',
105
107
  API_KEY = 'api-key',
@@ -168,6 +168,20 @@ type AWSDatasourceConfiguration = BaseDatasourceConfiguration & {
168
168
  };
169
169
 
170
170
  type BigqueryDatasourceConfiguration = BaseDatasourceConfiguration & {
171
+ connectionType?: 'fields' | 'service-account-key' | IntegrationAuthType.OAUTH2_TOKEN_EXCHANGE;
172
+ authTypeField?: string;
173
+ authConfig?: {
174
+ tokenUrl?: string;
175
+ audience?: string;
176
+ scope?: string;
177
+ subjectTokenType?: string;
178
+ subjectTokenSource?: string;
179
+ subjectTokenSourceStaticToken?: string;
180
+ workforcePoolId?: string;
181
+ workforceProviderId?: string;
182
+ projectId?: string;
183
+ billingProjectNumber?: string;
184
+ };
171
185
  authentication?: {
172
186
  custom?: {
173
187
  googleServiceAccount?: Property;
@@ -448,12 +462,10 @@ export type OracleDbDatasourceConfiguration = Pick<OracleDbPlugin.Plugin, 'name'
448
462
  // this will be populated by orchestrator, and it will be used by plugin.execute | metadata | test
449
463
  // so the plugin will get ready-to-use oauth token. This is needed until we figure out a way to pass token
450
464
  // to plugin.metadata and plugin.test
451
- export type SalesforceDatasourceConfiguration = {
452
- authType?: AuthType;
453
- authConfig?: {
454
- authToken?: string;
455
- useFixedPasswordCreds?: boolean;
456
- };
465
+ export type SalesforceDatasourceConfiguration = AuthenticatedDatasourceConfig & {
466
+ // if set, will be set to 'connection.auth.method.case'
467
+ authTypeField?: string;
468
+ authTypeOnBehalfOfToken?: string;
457
469
  } & Pick<SalesforcePlugin.Plugin, 'name' | 'connection'>;
458
470
 
459
471
  export type DatasourceConfiguration = (
@@ -0,0 +1,56 @@
1
+ export enum FactEntityScope {
2
+ ORG = 'org',
3
+ USER = 'user',
4
+ INTEGRATION = 'integration'
5
+ }
6
+
7
+ export enum FactAccessType {
8
+ ALWAYS_INJECT = 'always_inject', // Core memory - always in system prompt
9
+ ON_DEMAND = 'on_demand' // Skills - LLM retrieves via tool call
10
+ }
11
+
12
+ export enum FactCreatedSource {
13
+ MANUAL = 'manual',
14
+ AGENT = 'agent'
15
+ }
16
+
17
+ export interface FactDto {
18
+ id: string;
19
+ name: string;
20
+ description: string;
21
+ content: string;
22
+ metadata?: Record<string, unknown>;
23
+ entityScope: FactEntityScope;
24
+ entityId: string;
25
+ accessType: FactAccessType;
26
+ isEnabled: boolean;
27
+ isApproved: boolean;
28
+ approvedBy?: string;
29
+ createdBy?: string;
30
+ createdSource?: FactCreatedSource;
31
+ createdAt: string;
32
+ updatedAt: string;
33
+ }
34
+
35
+ /**
36
+ * FactListQuery for Socket RPC protocol.
37
+ *
38
+ * NOTE: This type is intentionally duplicated from @superblocksteam/schemas to avoid
39
+ * a circular dependency. The schemas package cannot depend on shared, and the socket
40
+ * protocol in shared needs this type. Keep in sync with packages/schemas/src/schemas/FactListQuery.ts.
41
+ */
42
+ export type FactListQuery = {
43
+ entityScope?: FactEntityScope;
44
+ entityId?: string;
45
+ accessType?: FactAccessType;
46
+ isEnabled?: boolean;
47
+ limit?: number;
48
+ offset?: number;
49
+ sortBy?: 'name' | 'created_at' | 'updated_at';
50
+ sortOrder?: 'asc' | 'desc';
51
+ search?: string;
52
+ };
53
+
54
+ export interface ListFactsResponse {
55
+ facts: FactDto[];
56
+ }
@@ -1,4 +1,5 @@
1
1
  export * from './agent/index.js';
2
+ export * from './fact/fact.js';
2
3
  export * from './api/index.js';
3
4
  export * from './application/index.js';
4
5
  export * from './audit/index.js';
@@ -105,6 +105,7 @@ export class SupersetIntegrationDto extends IntegrationBaseDto {
105
105
  metadata: ResourceMetadata;
106
106
  permissions?: ActionTypeEnum[];
107
107
  creator?: CreatorDto;
108
+ enabledForV2?: boolean;
108
109
 
109
110
  constructor({
110
111
  id,
@@ -123,7 +124,8 @@ export class SupersetIntegrationDto extends IntegrationBaseDto {
123
124
  readOnly,
124
125
  editable,
125
126
  permissions,
126
- creator
127
+ creator,
128
+ enabledForV2
127
129
  }: {
128
130
  id: string;
129
131
  created: Date;
@@ -142,6 +144,7 @@ export class SupersetIntegrationDto extends IntegrationBaseDto {
142
144
  editable: boolean;
143
145
  permissions?: ActionTypeEnum[];
144
146
  creator?: CreatorDto;
147
+ enabledForV2?: boolean;
145
148
  }) {
146
149
  super();
147
150
  this.id = id;
@@ -170,6 +173,7 @@ export class SupersetIntegrationDto extends IntegrationBaseDto {
170
173
  });
171
174
  this.permissions = permissions;
172
175
  this.creator = creator;
176
+ this.enabledForV2 = enabledForV2;
173
177
  }
174
178
  }
175
179
 
@@ -181,6 +185,7 @@ export class IntegrationDto extends IntegrationBaseDto {
181
185
  configurations: IntegrationConfigurationDto[];
182
186
  slug?: string;
183
187
  ownerEmail?: string;
188
+ enabledForV2?: boolean;
184
189
 
185
190
  constructor({
186
191
  id,
@@ -194,7 +199,8 @@ export class IntegrationDto extends IntegrationBaseDto {
194
199
  isUserConfigured,
195
200
  ownerEmail,
196
201
  kind,
197
- slug
202
+ slug,
203
+ enabledForV2
198
204
  }: {
199
205
  id: string;
200
206
  created: Date;
@@ -208,6 +214,7 @@ export class IntegrationDto extends IntegrationBaseDto {
208
214
  ownerEmail?: string;
209
215
  kind: IntegrationKind;
210
216
  slug?: string;
217
+ enabledForV2?: boolean;
211
218
  }) {
212
219
  super();
213
220
  this.id = id;
@@ -222,5 +229,6 @@ export class IntegrationDto extends IntegrationBaseDto {
222
229
  this.ownerEmail = ownerEmail;
223
230
  this.kind = kind;
224
231
  this.slug = slug;
232
+ this.enabledForV2 = enabledForV2;
225
233
  }
226
234
  }
@@ -1,4 +1,4 @@
1
- import { Domain } from '../../index.js';
1
+ import { Domain, OrgVersionType } from '../../index.js';
2
2
  import { IHomepageApplicationV2Dto } from '../application/index.js';
3
3
  import { Billing } from '../billing/index.js';
4
4
  import { GroupBrief } from '../group/index.js';
@@ -7,10 +7,14 @@ import { Profile } from '../profile/index.js';
7
7
  import { Agent, AgentType } from './agent.js';
8
8
 
9
9
  export const SUPERBLOCKS_CLOUD_AGENT_ORG_NAME = 'cloudagent.superblocks';
10
- // for server tests
10
+ // for server tests (V2 orgs)
11
11
  export const SUPERBLOCKS_TEST_ORG_NAME = 'superblocksservertest.com';
12
- // for server tests
12
+ // for server tests (V2 orgs)
13
13
  export const SUPERBLOCKS_TEST_ORG_NAME2 = 'superblocksservertest2.com';
14
+ // for server tests (V1 orgs)
15
+ export const SUPERBLOCKS_TEST_ORG_V1_NAME = 'superblocksservertest-orgv1.com';
16
+ // for server tests (V1 orgs)
17
+ export const SUPERBLOCKS_TEST_ORG_V1_NAME2 = 'superblocksservertest2-orgv1.com';
14
18
  // for manual testing
15
19
  export const SUPERBLOCKS_MANUAL_TEST_ORG_NAME = 'superblockstest.com';
16
20
  export const SUPERBLOCKS_SUPPORT = 'Superblocks Support';
@@ -32,6 +36,7 @@ export interface Organization {
32
36
  billing: Billing;
33
37
  profiles?: Profile[];
34
38
  created: Date;
39
+ version?: OrgVersionType;
35
40
  }
36
41
 
37
42
  export type OrgBriefDto = {
@@ -51,6 +56,7 @@ export interface IOrganizationDto {
51
56
  agents: Agent[] | undefined;
52
57
  pluginExecutionVersions: PluginExecutionVersions;
53
58
  minExternalAgentVersion: string;
59
+ version?: OrgVersionType;
54
60
  }
55
61
 
56
62
  export interface IOrganizationApplicationsV2Dto {
@@ -144,6 +144,7 @@ export enum ResourceTypeEnum {
144
144
  ORGANIZATION = 'org',
145
145
  // ORGANIZATION_REQUESTS = 'org.requests',
146
146
  ORGANIZATION_USERS = 'org.users',
147
+ ORG_KNOWLEDGE = 'org_knowledge',
147
148
  PROFILES = 'profiles',
148
149
  REPOSITORIES = 'repos',
149
150
  ROLES = 'roles',
@@ -270,8 +271,12 @@ export const ActionTypeByResourceType = {
270
271
  RUN: ActionTypeEnum.RUN,
271
272
  SHARE: ActionTypeEnum.SHARE,
272
273
  UPDATE: ActionTypeEnum.UPDATE
274
+ },
275
+ ORG_KNOWLEDGE: {
276
+ CREATE: ActionTypeEnum.CREATE,
277
+ UPDATE: ActionTypeEnum.UPDATE,
278
+ DELETE: ActionTypeEnum.DELETE
273
279
  }
274
- // TODO Adds as needed
275
280
  } as const;
276
281
 
277
282
  type ResourceBrief = {