opalserve 0.1.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 (158) hide show
  1. package/.env.example +19 -0
  2. package/AGENTS.md +23 -0
  3. package/README.md +109 -0
  4. package/config/servers.example.yaml +67 -0
  5. package/config/servers.yaml +2 -0
  6. package/dist/cli/discover.d.ts +3 -0
  7. package/dist/cli/discover.d.ts.map +1 -0
  8. package/dist/cli/discover.js +160 -0
  9. package/dist/cli/discover.js.map +1 -0
  10. package/dist/cli/index.d.ts +3 -0
  11. package/dist/cli/index.d.ts.map +1 -0
  12. package/dist/cli/index.js +32 -0
  13. package/dist/cli/index.js.map +1 -0
  14. package/dist/connectors/base.d.ts +49 -0
  15. package/dist/connectors/base.d.ts.map +1 -0
  16. package/dist/connectors/base.js +45 -0
  17. package/dist/connectors/base.js.map +1 -0
  18. package/dist/connectors/custom.d.ts +19 -0
  19. package/dist/connectors/custom.d.ts.map +1 -0
  20. package/dist/connectors/custom.js +129 -0
  21. package/dist/connectors/custom.js.map +1 -0
  22. package/dist/connectors/github.d.ts +18 -0
  23. package/dist/connectors/github.d.ts.map +1 -0
  24. package/dist/connectors/github.js +188 -0
  25. package/dist/connectors/github.js.map +1 -0
  26. package/dist/connectors/google-drive.d.ts +18 -0
  27. package/dist/connectors/google-drive.d.ts.map +1 -0
  28. package/dist/connectors/google-drive.js +209 -0
  29. package/dist/connectors/google-drive.js.map +1 -0
  30. package/dist/connectors/index.d.ts +11 -0
  31. package/dist/connectors/index.d.ts.map +1 -0
  32. package/dist/connectors/index.js +76 -0
  33. package/dist/connectors/index.js.map +1 -0
  34. package/dist/connectors/postgres.d.ts +18 -0
  35. package/dist/connectors/postgres.d.ts.map +1 -0
  36. package/dist/connectors/postgres.js +140 -0
  37. package/dist/connectors/postgres.js.map +1 -0
  38. package/dist/connectors/slack.d.ts +18 -0
  39. package/dist/connectors/slack.d.ts.map +1 -0
  40. package/dist/connectors/slack.js +181 -0
  41. package/dist/connectors/slack.js.map +1 -0
  42. package/dist/core/auth.d.ts +26 -0
  43. package/dist/core/auth.d.ts.map +1 -0
  44. package/dist/core/auth.js +81 -0
  45. package/dist/core/auth.js.map +1 -0
  46. package/dist/core/registry.d.ts +33 -0
  47. package/dist/core/registry.d.ts.map +1 -0
  48. package/dist/core/registry.js +237 -0
  49. package/dist/core/registry.js.map +1 -0
  50. package/dist/core/tokenizer.d.ts +16 -0
  51. package/dist/core/tokenizer.d.ts.map +1 -0
  52. package/dist/core/tokenizer.js +29 -0
  53. package/dist/core/tokenizer.js.map +1 -0
  54. package/dist/governance/audit.d.ts +27 -0
  55. package/dist/governance/audit.d.ts.map +1 -0
  56. package/dist/governance/audit.js +149 -0
  57. package/dist/governance/audit.js.map +1 -0
  58. package/dist/governance/index.d.ts +5 -0
  59. package/dist/governance/index.d.ts.map +1 -0
  60. package/dist/governance/index.js +5 -0
  61. package/dist/governance/index.js.map +1 -0
  62. package/dist/governance/policy.d.ts +20 -0
  63. package/dist/governance/policy.d.ts.map +1 -0
  64. package/dist/governance/policy.js +162 -0
  65. package/dist/governance/policy.js.map +1 -0
  66. package/dist/governance/rate-limiter.d.ts +20 -0
  67. package/dist/governance/rate-limiter.d.ts.map +1 -0
  68. package/dist/governance/rate-limiter.js +73 -0
  69. package/dist/governance/rate-limiter.js.map +1 -0
  70. package/dist/governance/types.d.ts +246 -0
  71. package/dist/governance/types.d.ts.map +1 -0
  72. package/dist/governance/types.js +72 -0
  73. package/dist/governance/types.js.map +1 -0
  74. package/dist/identity/access-control.d.ts +15 -0
  75. package/dist/identity/access-control.d.ts.map +1 -0
  76. package/dist/identity/access-control.js +81 -0
  77. package/dist/identity/access-control.js.map +1 -0
  78. package/dist/identity/index.d.ts +4 -0
  79. package/dist/identity/index.d.ts.map +1 -0
  80. package/dist/identity/index.js +4 -0
  81. package/dist/identity/index.js.map +1 -0
  82. package/dist/identity/manager.d.ts +29 -0
  83. package/dist/identity/manager.d.ts.map +1 -0
  84. package/dist/identity/manager.js +167 -0
  85. package/dist/identity/manager.js.map +1 -0
  86. package/dist/identity/types.d.ts +237 -0
  87. package/dist/identity/types.d.ts.map +1 -0
  88. package/dist/identity/types.js +80 -0
  89. package/dist/identity/types.js.map +1 -0
  90. package/dist/index.d.ts +13 -0
  91. package/dist/index.d.ts.map +1 -0
  92. package/dist/index.js +10 -0
  93. package/dist/index.js.map +1 -0
  94. package/dist/registry/server.d.ts +14 -0
  95. package/dist/registry/server.d.ts.map +1 -0
  96. package/dist/registry/server.js +173 -0
  97. package/dist/registry/server.js.map +1 -0
  98. package/dist/types/index.d.ts +639 -0
  99. package/dist/types/index.d.ts.map +1 -0
  100. package/dist/types/index.js +76 -0
  101. package/dist/types/index.js.map +1 -0
  102. package/dist/utils/config.d.ts +29 -0
  103. package/dist/utils/config.d.ts.map +1 -0
  104. package/dist/utils/config.js +47 -0
  105. package/dist/utils/config.js.map +1 -0
  106. package/dist/utils/index.d.ts +7 -0
  107. package/dist/utils/index.d.ts.map +1 -0
  108. package/dist/utils/index.js +44 -0
  109. package/dist/utils/index.js.map +1 -0
  110. package/dist/workflow/engine.d.ts +18 -0
  111. package/dist/workflow/engine.d.ts.map +1 -0
  112. package/dist/workflow/engine.js +155 -0
  113. package/dist/workflow/engine.js.map +1 -0
  114. package/dist/workflow/index.d.ts +4 -0
  115. package/dist/workflow/index.d.ts.map +1 -0
  116. package/dist/workflow/index.js +4 -0
  117. package/dist/workflow/index.js.map +1 -0
  118. package/dist/workflow/templates.d.ts +4 -0
  119. package/dist/workflow/templates.d.ts.map +1 -0
  120. package/dist/workflow/templates.js +218 -0
  121. package/dist/workflow/templates.js.map +1 -0
  122. package/dist/workflow/types.d.ts +255 -0
  123. package/dist/workflow/types.d.ts.map +1 -0
  124. package/dist/workflow/types.js +48 -0
  125. package/dist/workflow/types.js.map +1 -0
  126. package/eslint.config.js +25 -0
  127. package/package.json +78 -0
  128. package/src/cli/discover.ts +223 -0
  129. package/src/cli/index.ts +40 -0
  130. package/src/connectors/base.ts +75 -0
  131. package/src/connectors/custom.ts +139 -0
  132. package/src/connectors/github.ts +195 -0
  133. package/src/connectors/google-drive.ts +217 -0
  134. package/src/connectors/index.ts +86 -0
  135. package/src/connectors/postgres.ts +148 -0
  136. package/src/connectors/slack.ts +188 -0
  137. package/src/core/auth.ts +109 -0
  138. package/src/core/registry.ts +301 -0
  139. package/src/core/tokenizer.ts +40 -0
  140. package/src/governance/audit.ts +182 -0
  141. package/src/governance/index.ts +4 -0
  142. package/src/governance/policy.ts +187 -0
  143. package/src/governance/rate-limiter.ts +95 -0
  144. package/src/governance/types.ts +100 -0
  145. package/src/identity/access-control.ts +119 -0
  146. package/src/identity/index.ts +3 -0
  147. package/src/identity/manager.ts +207 -0
  148. package/src/identity/types.ts +91 -0
  149. package/src/index.ts +16 -0
  150. package/src/registry/server.ts +195 -0
  151. package/src/types/index.ts +128 -0
  152. package/src/utils/config.ts +78 -0
  153. package/src/utils/index.ts +47 -0
  154. package/src/workflow/engine.ts +187 -0
  155. package/src/workflow/index.ts +3 -0
  156. package/src/workflow/templates.ts +220 -0
  157. package/src/workflow/types.ts +89 -0
  158. package/tsconfig.json +25 -0
@@ -0,0 +1,81 @@
1
+ export class AccessControl {
2
+ checkToolAccess(context, tool) {
3
+ if (context.permissions.includes('admin')) {
4
+ return { allowed: true, reason: 'Admin has full access' };
5
+ }
6
+ const toolId = tool.id;
7
+ if (context.constraints.deniedTools?.some((pattern) => toolId === pattern || (typeof pattern === 'string' && toolId.includes(pattern.replace('*', ''))))) {
8
+ return { allowed: false, reason: 'Tool is explicitly denied' };
9
+ }
10
+ if (context.constraints.allowedTools?.length &&
11
+ !context.constraints.allowedTools.some((pattern) => toolId === pattern || (typeof pattern === 'string' && toolId.includes(pattern.replace('*', ''))))) {
12
+ return { allowed: false, reason: 'Tool not in allowed list' };
13
+ }
14
+ const serverAccess = this.checkServerAccess(context, { id: tool.serverId });
15
+ if (!serverAccess.allowed) {
16
+ return { allowed: false, reason: `Server access denied: ${serverAccess.reason}` };
17
+ }
18
+ const hasCapability = tool.capabilities.some(cap => context.permissions.includes(`tools:${cap}`) ||
19
+ context.permissions.includes('tools:execute'));
20
+ if (!hasCapability) {
21
+ return { allowed: false, reason: 'Missing required capability' };
22
+ }
23
+ return {
24
+ allowed: true,
25
+ reason: 'Access granted',
26
+ constraints: {
27
+ maxTools: context.constraints.maxToolsPerRequest,
28
+ timeout: tool.contextRequirements?.maxTokens ? tool.contextRequirements.maxTokens * 10 : 60000,
29
+ },
30
+ };
31
+ }
32
+ checkServerAccess(context, server) {
33
+ if (context.permissions.includes('admin')) {
34
+ return { allowed: true, reason: 'Admin has full access' };
35
+ }
36
+ const serverId = server.id;
37
+ if (context.constraints.deniedServers?.includes(serverId)) {
38
+ return { allowed: false, reason: 'Server is explicitly denied' };
39
+ }
40
+ if (context.constraints.allowedServers?.length &&
41
+ !context.constraints.allowedServers.includes(serverId)) {
42
+ return { allowed: false, reason: 'Server not in allowed list' };
43
+ }
44
+ return { allowed: true, reason: 'Server access granted' };
45
+ }
46
+ checkPermission(context, permission) {
47
+ if (context.permissions.includes('admin') || context.permissions.includes(permission)) {
48
+ return { allowed: true, reason: 'Permission granted' };
49
+ }
50
+ return { allowed: false, reason: `Missing permission: ${permission}` };
51
+ }
52
+ checkRateLimit(context, currentCount, window) {
53
+ const limit = window === 'minute'
54
+ ? context.constraints.rateLimitPerMinute
55
+ : context.constraints.rateLimitPerHour;
56
+ if (!limit) {
57
+ return { allowed: true, reason: 'No rate limit configured' };
58
+ }
59
+ if (currentCount >= limit) {
60
+ return {
61
+ allowed: false,
62
+ reason: `Rate limit exceeded: ${currentCount}/${limit} per ${window}`,
63
+ };
64
+ }
65
+ return { allowed: true, reason: 'Within rate limit' };
66
+ }
67
+ sanitizeContext(context, tool) {
68
+ const sanitized = {
69
+ agentId: context.agentId,
70
+ agentName: context.agentName,
71
+ agentType: context.agentType,
72
+ permissions: context.permissions.filter((p) => tool.capabilities.some(c => p.includes(c) || p === 'admin' || p === 'tools:execute')),
73
+ constraints: {
74
+ maxToolsPerRequest: Math.min(context.constraints.maxToolsPerRequest || 10, tool.contextRequirements?.maxTokens ? 5 : 10),
75
+ },
76
+ metadata: {},
77
+ };
78
+ return sanitized;
79
+ }
80
+ }
81
+ //# sourceMappingURL=access-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-control.js","sourceRoot":"","sources":["../../src/identity/access-control.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,aAAa;IACxB,eAAe,CAAC,OAAwB,EAAE,IAAU;QAClD,IAAI,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC1C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC;QAC5D,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;QAEvB,IAAI,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,OAAgB,EAAE,EAAE,CAC7D,MAAM,KAAK,OAAO,IAAI,CAAC,OAAO,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CACjG,EAAE,CAAC;YACF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,2BAA2B,EAAE,CAAC;QACjE,CAAC;QAED,IAAI,OAAO,CAAC,WAAW,CAAC,YAAY,EAAE,MAAM;YACxC,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,OAAgB,EAAE,EAAE,CAC1D,MAAM,KAAK,OAAO,IAAI,CAAC,OAAO,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CACjG,EAAE,CAAC;YACN,OAAO,EAAE,OAAO,E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AAK;gBACd,MAAM,EAAE,wBAAwB,YAAY,IAAI,KAAK,QAAQ,MAAM,EAAE;aACtE,CAAC;QACJ,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC;IACxD,CAAC;IAED,eAAe,CAAC,OAAwB,EAAE,IAAU;QAClD,MAAM,SAAS,GAA4B;YACzC,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAa,EAAE,EAAE,CACxD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,eAAe,CAAC,CACrF;YACD,WAAW,EAAE;gBACX,kBAAkB,EAAE,IAAI,CAAC,GAAG,CAC1B,OAAO,CAAC,WAAW,CAAC,kBAA4B,IAAI,EAAE,EACtD,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAC7C;aACF;YACD,QAAQ,EAAE,EAAE;SACb,CAAC;QAEF,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ export { IdentityManager } from './manager.js';
2
+ export { AccessControl, type AccessDecision } from './access-control.js';
3
+ export * from './types.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACzE,cAAc,YAAY,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { IdentityManager } from './manager.js';
2
+ export { AccessControl } from './access-control.js';
3
+ export * from './types.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAuB,MAAM,qBAAqB,CAAC;AACzE,cAAc,YAAY,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { Identity, Role, Permission, IdentityContext } from './types.js';
2
+ export declare class IdentityManager {
3
+ private identities;
4
+ private roles;
5
+ private jwtSecret;
6
+ constructor(jwtSecret: string);
7
+ private initializeDefaultRoles;
8
+ registerIdentity(identity: Identity): void;
9
+ getIdentity(id: string): Identity | undefined;
10
+ getAllIdentities(): Identity[];
11
+ deleteIdentity(id: string): boolean;
12
+ registerRole(role: Role): void;
13
+ getRole(id: string): Role | undefined;
14
+ getAllRoles(): Role[];
15
+ getEffectivePermissions(identityId: string): Permission[];
16
+ hasPermission(identityId: string, permission: Permission): boolean;
17
+ canAccessTool(identityId: string, toolId: string): boolean;
18
+ canAccessServer(identityId: string, serverId: string): boolean;
19
+ createContext(identityId: string, options?: {
20
+ sessionId?: string;
21
+ requestId?: string;
22
+ }): IdentityContext | null;
23
+ generateToken(identityId: string, options?: {
24
+ sessionId?: string;
25
+ expiresInSeconds?: number;
26
+ }): string | null;
27
+ verifyToken(token: string): IdentityContext | null;
28
+ }
29
+ //# sourceMappingURL=manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/identity/manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE9E,qBAAa,eAAe;IAC1B,OAAO,CAAC,UAAU,CAAoC;IACtD,OAAO,C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ret;
6
+ constructor(jwtSecret) {
7
+ this.jwtSecret = jwtSecret;
8
+ this.initializeDefaultRoles();
9
+ }
10
+ initializeDefaultRoles() {
11
+ const defaultRoles = [
12
+ {
13
+ id: 'admin',
14
+ name: 'Administrator',
15
+ description: 'Full access to all resources',
16
+ permissions: ['admin', 'tools:read', 'tools:write', 'tools:execute', 'servers:read', 'servers:write', 'workflows:read', 'workflows:write', 'workflows:execute'],
17
+ createdAt: new Date().toISOString(),
18
+ updatedAt: new Date().toISOString(),
19
+ },
20
+ {
21
+ id: 'developer',
22
+ name: 'Developer',
23
+ description: 'Can read and execute tools, manage workflows',
24
+ permissions: ['tools:read', 'tools:execute', 'servers:read', 'workflows:read', 'workflows:write', 'workflows:execute'],
25
+ createdAt: new Date().toISOString(),
26
+ updatedAt: new Date().toISOString(),
27
+ },
28
+ {
29
+ id: 'viewer',
30
+ name: 'Viewer',
31
+ description: 'Read-only access to tools and workflows',
32
+ permissions: ['tools:read', 'servers:read', 'workflows:read'],
33
+ createdAt: new Date().toISOString(),
34
+ updatedAt: new Date().toISOString(),
35
+ },
36
+ {
37
+ id: 'service',
38
+ name: 'Service Account',
39
+ description: 'Automated service with limited permissions',
40
+ permissions: ['tools:read', 'tools:execute', 'workflows:read', 'workflows:execute'],
41
+ createdAt: new Date().toISOString(),
42
+ updatedAt: new Date().toISOString(),
43
+ },
44
+ ];
45
+ for (const role of defaultRoles) {
46
+ this.roles.set(role.id, role);
47
+ }
48
+ }
49
+ registerIdentity(identity) {
50
+ this.identities.set(identity.id, identity);
51
+ }
52
+ getIdentity(id) {
53
+ return this.identities.get(id);
54
+ }
55
+ getAllIdentities() {
56
+ return Array.from(this.identities.values());
57
+ }
58
+ deleteIdentity(id) {
59
+ return this.identities.delete(id);
60
+ }
61
+ registerRole(role) {
62
+ this.roles.set(role.id, role);
63
+ }
64
+ getRole(id) {
65
+ return this.roles.get(id);
66
+ }
67
+ getAllRoles() {
68
+ return Array.from(this.roles.values());
69
+ }
70
+ getEffectivePermissions(identityId) {
71
+ const identity = this.identities.get(identityId);
72
+ if (!identity)
73
+ return [];
74
+ const permissions = new Set(identity.permissions);
75
+ for (const roleId of identity.roleIds) {
76
+ const role = this.roles.get(roleId);
77
+ if (role) {
78
+ for (const permission of role.permissions) {
79
+ permissions.add(permission);
80
+ }
81
+ }
82
+ }
83
+ return Array.from(permissions);
84
+ }
85
+ hasPermission(identityId, permission) {
86
+ const permissions = this.getEffectivePermissions(identityId);
87
+ if (permissions.includes('admin'))
88
+ return true;
89
+ return permissions.includes(permission);
90
+ }
91
+ canAccessTool(identityId, toolId) {
92
+ const identity = this.identities.get(identityId);
93
+ if (!identity)
94
+ return false;
95
+ if (identity.constraints.allowedTools?.length) {
96
+ return identity.constraints.allowedTools.some(pattern => toolId === pattern || toolId.includes(pattern.replace('*', '')));
97
+ }
98
+ if (identity.constraints.deniedTools?.length) {
99
+ return !identity.constraints.deniedTools.some(pattern => toolId === pattern || toolId.includes(pattern.replace('*', '')));
100
+ }
101
+ return true;
102
+ }
103
+ canAccessServer(identityId, serverId) {
104
+ const identity = this.identities.get(identityId);
105
+ if (!identity)
106
+ return false;
107
+ if (identity.constraints.allowedServers?.length) {
108
+ return identity.constraints.allowedServers.includes(serverId);
109
+ }
110
+ if (identity.constraints.deniedServers?.length) {
111
+ return !identity.constraints.deniedServers.includes(serverId);
112
+ }
113
+ return true;
114
+ }
115
+ createContext(identityId, options) {
116
+ const identity = this.identities.get(identityId);
117
+ if (!identity)
118
+ return null;
119
+ const permissions = this.getEffectivePermissions(identityId);
120
+ const now = new Date().toISOString();
121
+ return {
122
+ agentId: identity.id,
123
+ agentName: identity.name,
124
+ agentType: identity.type,
125
+ requestId: options?.requestId || `req-${Date.now()}`,
126
+ permissions,
127
+ constraints: identity.constraints,
128
+ metadata: identity.metadata,
129
+ issuedAt: now,
130
+ expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),
131
+ };
132
+ }
133
+ generateToken(identityId, options) {
134
+ const context = this.createContext(identityId, { sessionId: options?.sessionId });
135
+ if (!context)
136
+ return null;
137
+ const expiresIn = options?.expiresInSeconds || 86400;
138
+ return jwt.sign({
139
+ agentId: context.agentId,
140
+ agentName: context.agentName,
141
+ agentType: context.agentType,
142
+ permissions: context.permissions,
143
+ constraints: context.constraints,
144
+ metadata: context.metadata,
145
+ }, this.jwtSecret, { expiresIn });
146
+ }
147
+ verifyToken(token) {
148
+ try {
149
+ const payload = jwt.verify(token, this.jwtSecret);
150
+ return {
151
+ agentId: payload.agentId,
152
+ agentName: payload.agentName,
153
+ agentType: payload.agentType,
154
+ requestId: payload.iat ? `req-${payload.iat}` : `req-${Date.now()}`,
155
+ permissions: payload.permissions,
156
+ constraints: payload.constraints,
157
+ metadata: payload.metadata,
158
+ issuedAt: new Date(payload.iat * 1000).toISOString(),
159
+ expiresAt: new Date(payload.exp * 1000).toISOString(),
160
+ };
161
+ }
162
+ catch {
163
+ return null;
164
+ }
165
+ }
166
+ }
167
+ //# sourceMappingURL=manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/identity/manager.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,cAAc,CAAC;AAG/B,MAAM,OAAO,eAAe;IAClB,UAAU,GAA0B,IAAI,GAAG,EAAE,CAAC;IAC9C,KAAK,GAAsB,IAAI,GAAG,EAAE,CAAC;IACrC,SAAS,CAAS;IAE1B,YAAY,SAAiB;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,sBAAsB,EAAE,CAAC;IAChC,CAAC;IAEO,sBAAsB;QAC5B,MAAM,YAAY,GAAW;YAC3B;gBACE,EAAE,EAAE,OAAO;gBACX,IAAI,EAAE,eAAe;gBACrB,WAAW,EAAE,8BAA8B;gBAC3C,WAAW,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,iB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;QACF,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,237 @@
1
+ import { z } from 'zod';
2
+ export declare const PermissionSchema: z.ZodEnum<["tools:read", "tools:write", "tools:execute", "servers:read", "servers:write", "workflows:read", "workflows:write", "workflows:execute", "admin"]>;
3
+ export declare const RoleSchema: z.ZodObject<{
4
+ id: z.ZodString;
5
+ name: z.ZodString;
6
+ description: z.ZodString;
7
+ permissions: z.ZodDefault<z.ZodArray<z.ZodEnum<["tools:read", "tools:write", "tools:execute", "servers:read", "servers:write", "workflows:read", "workflows:write", "workflows:execute", "admin"]>, "many">>;
8
+ parentRoleId: z.ZodOptional<z.ZodString>;
9
+ createdAt: z.ZodString;
10
+ updatedAt: z.ZodString;
11
+ }, "strip", z.ZodTypeAny, {
12
+ id: string;
13
+ name: string;
14
+ description: string;
15
+ createdAt: string;
16
+ updatedAt: string;
17
+ permissions: ("admin" | "tools:read" | "tools:write" | "tools:execute" | "servers:read" | "servers:write" | "workflows:read" | "workflows:write" | "workflows:execute")[];
18
+ parentRoleId?: string | undefined;
19
+ }, {
20
+ id: string;
21
+ name: string;
22
+ description: string;
23
+ createdAt: string;
24
+ updatedAt: string;
25
+ permissions?: ("admin" | "tools:read" | "tools:write" | "tools:execute" | "servers:read" | "servers:write" | "workflows:read" | "workflows:write" | "workflows:execute")[] | undefined;
26
+ parentRoleId?: string | undefined;
27
+ }>;
28
+ export declare const AgentIdentitySchema: z.ZodObject<{
29
+ id: z.ZodString;
30
+ name: z.ZodString;
31
+ type: z.ZodEnum<["user", "agent", "service", "system"]>;
32
+ description: z.ZodOptional<z.ZodString>;
33
+ roleIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
34
+ permissions: z.ZodDefault<z.ZodArray<z.ZodEnum<["tools:read", "tools:write", "tools:execute", "servers:read", "servers:write", "workflows:read", "workflows:write", "workflows:execute", "admin"]>, "many">>;
35
+ constraints: z.ZodDefault<z.ZodObject<{
36
+ maxToolsPerRequest: z.ZodDefault<z.ZodNumber>;
37
+ maxConcurrentExecutions: z.ZodDefault<z.ZodNumber>;
38
+ allowedServers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
39
+ deniedServers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
40
+ allowedTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
41
+ deniedTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
42
+ rateLimitPerMinute: z.ZodOptional<z.ZodNumber>;
43
+ rateLimitPerHour: z.ZodOptional<z.ZodNumber>;
44
+ }, "strip", z.ZodTypeAny, {
45
+ maxToolsPerRequest: number;
46
+ maxConcurrentExecutions: number;
47
+ allowedServers?: string[] | undefined;
48
+ deniedServers?: string[] | undefined;
49
+ allowedTools?: string[] | undefined;
50
+ deniedTools?: string[] | undefined;
51
+ rateLimitPerMinute?: number | undefined;
52
+ rateLimitPerHour?: number | undefined;
53
+ }, {
54
+ maxToolsPerRequest?: number | undefined;
55
+ maxConcurrentExecutions?: number | undefined;
56
+ allowedServers?: string[] | undefined;
57
+ deniedServers?: string[] | undefined;
58
+ allowedTools?: string[] | undefined;
59
+ deniedTools?: string[] | undefined;
60
+ rateLimitPerMinute?: number | undefined;
61
+ rateLimitPerHour?: number | undefined;
62
+ }>>;
63
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
64
+ trustLevel: z.ZodDefault<z.ZodEnum<["untrusted", "low", "medium", "high", "fully-trusted"]>>;
65
+ createdAt: z.ZodString;
66
+ updatedAt: z.ZodString;
67
+ lastActiveAt: z.ZodOptional<z.ZodString>;
68
+ }, "strip", z.ZodTypeAny, {
69
+ id: string;
70
+ name: string;
71
+ type: "user" | "agent" | "service" | "system";
72
+ metadata: Record<string, any>;
73
+ createdAt: string;
74
+ updatedAt: string;
75
+ permissions: ("admin" | "tools:read" | "tools:write" | "tools:execute" | "servers:read" | "servers:write" | "workflows:read" | "workflows:write" | "workflows:execute")[];
76
+ roleIds: string[];
77
+ constraints: {
78
+ maxToolsPerRequest: number;
79
+ maxConcurrentExecutions: number;
80
+ allowedServers?: string[] | undefined;
81
+ deniedServers?: string[] | undefined;
82
+ allowedTools?: string[] | undefined;
83
+ deniedTools?: string[] | undefined;
84
+ rateLimitPerMinute?: number | undefined;
85
+ rateLimitPerHour?: number | undefined;
86
+ };
87
+ trustLevel: "untrusted" | "low" | "medium" | "high" | "fully-trusted";
88
+ description?: string | undefined;
89
+ lastActiveAt?: string | undefined;
90
+ }, {
91
+ id: string;
92
+ name: string;
93
+ type: "user" | "agent" | "service" | "system";
94
+ createdAt: string;
95
+ updatedAt: string;
96
+ description?: string | undefined;
97
+ metadata?: Record<string, any> | undefined;
98
+ permissions?: ("admin" | "tools:read" | "tools:write" | "tools:execute" | "servers:read" | "servers:write" | "workflows:read" | "workflows:write" | "workflows:execute")[] | undefined;
99
+ roleIds?: string[] | undefined;
100
+ constraints?: {
101
+ maxToolsPerRequest?: number | undefined;
102
+ maxConcurrentExecutions?: number | undefined;
103
+ allowedServers?: string[] | undefined;
104
+ deniedServers?: string[] | undefined;
105
+ allowedTools?: string[] | undefined;
106
+ deniedTools?: string[] | undefined;
107
+ rateLimitPerMinute?: number | undefined;
108
+ rateLimitPerHour?: number | undefined;
109
+ } | undefined;
110
+ trustLevel?: "untrusted" | "low" | "medium" | "high" | "fully-trusted" | undefined;
111
+ lastActiveAt?: string | undefined;
112
+ }>;
113
+ export declare const IdentityContextSchema: z.ZodObject<{
114
+ agentId: z.ZodString;
115
+ agentName: z.ZodString;
116
+ agentType: z.ZodEnum<["user", "agent", "service", "system"]>;
117
+ sessionId: z.ZodOptional<z.ZodString>;
118
+ requestId: z.ZodString;
119
+ permissions: z.ZodDefault<z.ZodArray<z.ZodEnum<["tools:read", "tools:write", "tools:execute", "servers:read", "servers:write", "workflows:read", "workflows:write", "workflows:execute", "admin"]>, "many">>;
120
+ constraints: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
121
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
122
+ issuedAt: z.ZodString;
123
+ expiresAt: z.ZodOptional<z.ZodString>;
124
+ }, "strip", z.ZodTypeAny, {
125
+ metadata: Record<string, any>;
126
+ agentId: string;
127
+ permissions: ("admin" | "tools:read" | "tools:write" | "tools:execute" | "servers:read" | "servers:write" | "workflows:read" | "workflows:write" | "workflows:execute")[];
128
+ constraints: Record<string, any>;
129
+ agentName: string;
130
+ agentType: "user" | "agent" | "service" | "system";
131
+ requestId: string;
132
+ issuedAt: string;
133
+ sessionId?: string | undefined;
134
+ expiresAt?: string | undefined;
135
+ }, {
136
+ agentId: string;
137
+ agentName: string;
138
+ agentType: "user" | "agent" | "service" | "system";
139
+ requestId: string;
140
+ issuedAt: string;
141
+ metadata?: Record<string, any> | undefined;
142
+ permissions?: ("admin" | "tools:read" | "tools:write" | "tools:execute" | "servers:read" | "servers:write" | "workflows:read" | "workflows:write" | "workflows:execute")[] | undefined;
143
+ constraints?: Record<string, any> | undefined;
144
+ sessionId?: string | undefined;
145
+ expiresAt?: string | undefined;
146
+ }>;
147
+ export type Permission = z.infer<typeof PermissionSchema>;
148
+ export type Role = z.infer<typeof RoleSchema>;
149
+ export type AgentIdentity = z.infer<typeof IdentitySchema>;
150
+ export type IdentityContext = z.infer<typeof IdentityContextSchema>;
151
+ export declare const IdentitySchema: z.ZodObject<{
152
+ id: z.ZodString;
153
+ name: z.ZodString;
154
+ type: z.ZodEnum<["user", "agent", "service", "system"]>;
155
+ description: z.ZodOptional<z.ZodString>;
156
+ roleIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
157
+ permissions: z.ZodDefault<z.ZodArray<z.ZodEnum<["tools:read", "tools:write", "tools:execute", "servers:read", "servers:write", "workflows:read", "workflows:write", "workflows:execute", "admin"]>, "many">>;
158
+ constraints: z.ZodDefault<z.ZodObject<{
159
+ maxToolsPerRequest: z.ZodDefault<z.ZodNumber>;
160
+ maxConcurrentExecutions: z.ZodDefault<z.ZodNumber>;
161
+ allowedServers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
162
+ deniedServers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
163
+ allowedTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
164
+ deniedTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
165
+ rateLimitPerMinute: z.ZodOptional<z.ZodNumber>;
166
+ rateLimitPerHour: z.ZodOptional<z.ZodNumber>;
167
+ }, "strip", z.ZodTypeAny, {
168
+ maxToolsPerRequest: number;
169
+ maxConcurrentExecutions: number;
170
+ allowedServers?: string[] | undefined;
171
+ deniedServers?: string[] | undefined;
172
+ allowedTools?: string[] | undefined;
173
+ deniedTools?: string[] | undefined;
174
+ rateLimitPerMinute?: number | undefined;
175
+ rateLimitPerHour?: number | undefined;
176
+ }, {
177
+ maxToolsPerRequest?: number | undefined;
178
+ maxConcurrentExecutions?: number | undefined;
179
+ allowedServers?: string[] | undefined;
180
+ deniedServers?: string[] | undefined;
181
+ allowedTools?: string[] | undefined;
182
+ deniedTools?: string[] | undefined;
183
+ rateLimitPerMinute?: number | undefined;
184
+ rateLimitPerHour?: number | undefined;
185
+ }>>;
186
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
187
+ trustLevel: z.ZodDefault<z.ZodEnum<["untrusted", "low", "medium", "high", "fully-trusted"]>>;
188
+ createdAt: z.ZodString;
189
+ updatedAt: z.ZodString;
190
+ lastActiveAt: z.ZodOptional<z.ZodString>;
191
+ }, "strip", z.ZodTypeAny, {
192
+ id: string;
193
+ name: string;
194
+ type: "user" | "agent" | "service" | "system";
195
+ metadata: Record<string, any>;
196
+ createdAt: string;
197
+ updatedAt: string;
198
+ permissions: ("admin" | "tools:read" | "tools:write" | "tools:execute" | "servers:read" | "servers:write" | "workflows:read" | "workflows:write" | "workflows:execute")[];
199
+ roleIds: string[];
200
+ constraints: {
201
+ maxToolsPerRequest: number;
202
+ maxConcurrentExecutions: number;
203
+ allowedServers?: string[] | undefined;
204
+ deniedServers?: string[] | undefined;
205
+ allowedTools?: string[] | undefined;
206
+ deniedTools?: string[] | undefined;
207
+ rateLimitPerMinute?: number | undefined;
208
+ rateLimitPerHour?: number | undefined;
209
+ };
210
+ trustLevel: "untrusted" | "low" | "medium" | "high" | "fully-trusted";
211
+ description?: string | undefined;
212
+ lastActiveAt?: string | undefined;
213
+ }, {
214
+ id: string;
215
+ name: string;
216
+ type: "user" | "agent" | "service" | "system";
217
+ createdAt: string;
218
+ updatedAt: string;
219
+ description?: string | undefined;
220
+ metadata?: Record<string, any> | undefined;
221
+ permissions?: ("admin" | "tools:read" | "tools:write" | "tools:execute" | "servers:read" | "servers:write" | "workflows:read" | "workflows:write" | "workflows:execute")[] | undefined;
222
+ roleIds?: string[] | undefined;
223
+ constraints?: {
224
+ maxToolsPerRequest?: number | undefined;
225
+ maxConcurrentExecutions?: number | undefined;
226
+ allowedServers?: string[] | undefined;
227
+ deniedServers?: string[] | undefined;
228
+ allowedTools?: string[] | undefined;
229
+ deniedTools?: string[] | undefined;
230
+ rateLimitPerMinute?: number | undefined;
231
+ rateLimitPerHour?: number | undefined;
232
+ } | undefined;
233
+ trustLevel?: "untrusted" | "low" | "medium" | "high" | "fully-trusted" | undefined;
234
+ lastActiveAt?: string | undefined;
235
+ }>;
236
+ export type Identity = z.infer<typeof IdentitySchema>;
237
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/identity/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB,+JAU3B,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;EAQrB,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsB9B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWhC,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC3D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -0,0 +1,80 @@
1
+ import { z } from 'zod';
2
+ export const PermissionSchema = z.enum([
3
+ 'tools:read',
4
+ 'tools:write',
5
+ 'tools:execute',
6
+ 'servers:read',
7
+ 'servers:write',
8
+ 'workflows:read',
9
+ 'workflows:write',
10
+ 'workflows:execute',
11
+ 'admin',
12
+ ]);
13
+ export const RoleSchema = z.object({
14
+ id: z.string(),
15
+ name: z.string(),
16
+ description: z.string(),
17
+ permissions: z.array(PermissionSchema).default([]),
18
+ parentRoleId: z.string().optional(),
19
+ createdAt: z.string(),
20
+ updatedAt: z.string(),
21
+ });
22
+ export const AgentIdentitySchema = z.object({
23
+ id: z.string(),
24
+ name: z.string(),
25
+ type: z.enum(['user', 'agent', 'service', 'system']),
26
+ description: z.string().optional(),
27
+ roleIds: z.array(z.string()).default([]),
28
+ permissions: z.array(PermissionSchema).default([]),
29
+ constraints: z.object({
30
+ maxToolsPerRequest: z.number().default(10),
31
+ maxConcurrentExecutions: z.number().default(5),
32
+ allowedServers: z.array(z.string()).optional(),
33
+ deniedServers: z.array(z.string()).optional(),
34
+ allowedTools: z.array(z.string()).optional(),
35
+ deniedTools: z.array(z.string()).optional(),
36
+ rateLimitPerMinute: z.number().optional(),
37
+ rateLimitPerHour: z.number().optional(),
38
+ }).default({}),
39
+ metadata: z.record(z.any()).default({}),
40
+ trustLevel: z.enum(['untrusted', 'low', 'medium', 'high', 'fully-trusted']).default('medium'),
41
+ createdAt: z.string(),
42
+ updatedAt: z.string(),
43
+ lastActiveAt: z.string().optional(),
44
+ });
45
+ export const IdentityContextSchema = z.object({
46
+ agentId: z.string(),
47
+ agentName: z.string(),
48
+ agentType: z.enum(['user', 'agent', 'service', 'system']),
49
+ sessionId: z.string().optional(),
50
+ requestId: z.string(),
51
+ permissions: z.array(PermissionSchema).default([]),
52
+ constraints: z.record(z.any()).default({}),
53
+ metadata: z.record(z.any()).default({}),
54
+ issuedAt: z.string(),
55
+ expiresAt: z.string().optional(),
56
+ });
57
+ export const IdentitySchema = z.object({
58
+ id: z.string(),
59
+ name: z.string(),
60
+ type: z.enum(['user', 'agent', 'service', 'system']),
61
+ description: z.string().optional(),
62
+ roleIds: z.array(z.string()).default([]),
63
+ permissions: z.array(PermissionSchema).default([]),
64
+ constraints: z.object({
65
+ maxToolsPerRequest: z.number().default(10),
66
+ maxConcurrentExecutions: z.number().default(5),
67
+ allowedServers: z.array(z.string()).optional(),
68
+ deniedServers: z.array(z.string()).optional(),
69
+ allowedTools: z.array(z.string()).optional(),
70
+ deniedTools: z.array(z.string()).optional(),
71
+ rateLimitPerMinute: z.number().optional(),
72
+ rateLimitPerHour: z.number().optional(),
73
+ }).default({}),
74
+ metadata: z.record(z.any()).default({}),
75
+ trustLevel: z.enum(['untrusted', 'low', 'medium', 'high', 'fully-trusted']).default('medium'),
76
+ createdAt: z.string(),
77
+ updatedAt: z.string(),
78
+ lastActiveAt: z.string().optional(),
79
+ });
80
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/identity/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC;IACrC,YAAY;IACZ,aAAa;IACb,eAAe;IACf,cAAc;IACd,eAAe;IACf,gBAAgB;IAChB,iBAAiB;IACjB,mBAAmB;IACnB,OAAO;CACR,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAClD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IACpD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACxC,WAAW,EAAE,CAAC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