@open-mercato/ai-assistant 0.6.4-develop.4270.1.a614eb18e6 → 0.6.4-develop.4282.1.4d95e85930
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.
|
@@ -1,12 +1,47 @@
|
|
|
1
1
|
const features = [
|
|
2
2
|
{ id: "ai_assistant.view", title: "View AI Assistant Settings", module: "ai_assistant" },
|
|
3
|
-
{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
{
|
|
3
|
+
{
|
|
4
|
+
id: "ai_assistant.settings.manage",
|
|
5
|
+
title: "Manage AI Assistant Settings",
|
|
6
|
+
module: "ai_assistant",
|
|
7
|
+
dependsOn: ["ai_assistant.view"]
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
id: "ai_assistant.conversations.manage",
|
|
11
|
+
title: "Manage AI Assistant Conversations",
|
|
12
|
+
module: "ai_assistant",
|
|
13
|
+
dependsOn: ["ai_assistant.view"]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: "ai_assistant.conversations.share",
|
|
17
|
+
title: "Share AI Assistant Conversations",
|
|
18
|
+
module: "ai_assistant",
|
|
19
|
+
dependsOn: ["ai_assistant.view"]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "ai_assistant.mcp.serve",
|
|
23
|
+
title: "Start MCP Server",
|
|
24
|
+
module: "ai_assistant",
|
|
25
|
+
dependsOn: ["ai_assistant.view"]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "ai_assistant.tools.list",
|
|
29
|
+
title: "List MCP Tools",
|
|
30
|
+
module: "ai_assistant",
|
|
31
|
+
dependsOn: ["ai_assistant.view"]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "ai_assistant.mcp_servers.view",
|
|
35
|
+
title: "View MCP Server Configurations",
|
|
36
|
+
module: "ai_assistant",
|
|
37
|
+
dependsOn: ["ai_assistant.view"]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "ai_assistant.mcp_servers.manage",
|
|
41
|
+
title: "Manage MCP Server Configurations",
|
|
42
|
+
module: "ai_assistant",
|
|
43
|
+
dependsOn: ["ai_assistant.mcp_servers.view"]
|
|
44
|
+
}
|
|
10
45
|
];
|
|
11
46
|
var acl_default = features;
|
|
12
47
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/modules/ai_assistant/acl.ts"],
|
|
4
|
-
"sourcesContent": ["export const features = [\n { id: 'ai_assistant.view', title: 'View AI Assistant Settings', module: 'ai_assistant' },\n {
|
|
5
|
-
"mappings": "AAAO,MAAM,WAAW;AAAA,EACtB,EAAE,IAAI,qBAAqB,OAAO,8BAA8B,QAAQ,eAAe;AAAA,EACvF,
|
|
4
|
+
"sourcesContent": ["export const features = [\n { id: 'ai_assistant.view', title: 'View AI Assistant Settings', module: 'ai_assistant' },\n {\n id: 'ai_assistant.settings.manage',\n title: 'Manage AI Assistant Settings',\n module: 'ai_assistant',\n dependsOn: ['ai_assistant.view'],\n },\n {\n id: 'ai_assistant.conversations.manage',\n title: 'Manage AI Assistant Conversations',\n module: 'ai_assistant',\n dependsOn: ['ai_assistant.view'],\n },\n {\n id: 'ai_assistant.conversations.share',\n title: 'Share AI Assistant Conversations',\n module: 'ai_assistant',\n dependsOn: ['ai_assistant.view'],\n },\n {\n id: 'ai_assistant.mcp.serve',\n title: 'Start MCP Server',\n module: 'ai_assistant',\n dependsOn: ['ai_assistant.view'],\n },\n {\n id: 'ai_assistant.tools.list',\n title: 'List MCP Tools',\n module: 'ai_assistant',\n dependsOn: ['ai_assistant.view'],\n },\n {\n id: 'ai_assistant.mcp_servers.view',\n title: 'View MCP Server Configurations',\n module: 'ai_assistant',\n dependsOn: ['ai_assistant.view'],\n },\n {\n id: 'ai_assistant.mcp_servers.manage',\n title: 'Manage MCP Server Configurations',\n module: 'ai_assistant',\n dependsOn: ['ai_assistant.mcp_servers.view'],\n },\n]\n\nexport default features\n"],
|
|
5
|
+
"mappings": "AAAO,MAAM,WAAW;AAAA,EACtB,EAAE,IAAI,qBAAqB,OAAO,8BAA8B,QAAQ,eAAe;AAAA,EACvF;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW,CAAC,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW,CAAC,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW,CAAC,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW,CAAC,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW,CAAC,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW,CAAC,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW,CAAC,+BAA+B;AAAA,EAC7C;AACF;AAEA,IAAO,cAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/ai-assistant",
|
|
3
|
-
"version": "0.6.4-develop.
|
|
3
|
+
"version": "0.6.4-develop.4282.1.4d95e85930",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.0.0"
|
|
@@ -98,16 +98,16 @@
|
|
|
98
98
|
"zod-to-json-schema": "^3.25.2"
|
|
99
99
|
},
|
|
100
100
|
"peerDependencies": {
|
|
101
|
-
"@open-mercato/shared": "0.6.4-develop.
|
|
102
|
-
"@open-mercato/ui": "0.6.4-develop.
|
|
101
|
+
"@open-mercato/shared": "0.6.4-develop.4282.1.4d95e85930",
|
|
102
|
+
"@open-mercato/ui": "0.6.4-develop.4282.1.4d95e85930",
|
|
103
103
|
"react": "^19.0.0",
|
|
104
104
|
"react-dom": "^19.0.0",
|
|
105
105
|
"zod": ">=3.23.0"
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
|
-
"@open-mercato/cli": "0.6.4-develop.
|
|
109
|
-
"@open-mercato/shared": "0.6.4-develop.
|
|
110
|
-
"@open-mercato/ui": "0.6.4-develop.
|
|
108
|
+
"@open-mercato/cli": "0.6.4-develop.4282.1.4d95e85930",
|
|
109
|
+
"@open-mercato/shared": "0.6.4-develop.4282.1.4d95e85930",
|
|
110
|
+
"@open-mercato/ui": "0.6.4-develop.4282.1.4d95e85930",
|
|
111
111
|
"@types/react": "^19.2.15",
|
|
112
112
|
"@types/react-dom": "^19.2.3",
|
|
113
113
|
"react": "19.2.6",
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** @jest-environment node */
|
|
2
|
+
|
|
3
|
+
import { describe, test, expect } from '@jest/globals'
|
|
4
|
+
import {
|
|
5
|
+
resolveAclDependencyDiagnostics,
|
|
6
|
+
type FeatureDescriptor,
|
|
7
|
+
} from '@open-mercato/shared/security/aclDependencies'
|
|
8
|
+
import { features as aiAssistantFeatures } from '../acl'
|
|
9
|
+
import { setup } from '../setup'
|
|
10
|
+
|
|
11
|
+
const descriptors: FeatureDescriptor[] = aiAssistantFeatures as FeatureDescriptor[]
|
|
12
|
+
const aiAssistantIds = descriptors.map((feature) => feature.id)
|
|
13
|
+
|
|
14
|
+
describe('ai_assistant ACL dependency declarations', () => {
|
|
15
|
+
test('declares dependsOn only against features registered in the catalog (no unknown references)', () => {
|
|
16
|
+
const diagnostics = resolveAclDependencyDiagnostics(aiAssistantIds, descriptors)
|
|
17
|
+
const ownUnknown = diagnostics.unknownReferences.filter((ref) =>
|
|
18
|
+
ref.feature.startsWith('ai_assistant.'),
|
|
19
|
+
)
|
|
20
|
+
expect(ownUnknown).toEqual([])
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
test('resolves cleanly with no missing deps when every feature is granted', () => {
|
|
24
|
+
const diagnostics = resolveAclDependencyDiagnostics(aiAssistantIds, descriptors)
|
|
25
|
+
const ownMissing = diagnostics.missingDependencies.filter((dep) =>
|
|
26
|
+
dep.feature.startsWith('ai_assistant.'),
|
|
27
|
+
)
|
|
28
|
+
expect(ownMissing).toEqual([])
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
test('every internal dependency target stays within the ai_assistant feature set', () => {
|
|
32
|
+
const knownIds = new Set(aiAssistantIds)
|
|
33
|
+
const deps = descriptors.flatMap((feature) => feature.dependsOn ?? [])
|
|
34
|
+
for (const dep of deps) {
|
|
35
|
+
expect(knownIds.has(dep)).toBe(true)
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
test('manage features depend on their view-grained counterpart', () => {
|
|
40
|
+
const settingsManage = descriptors.find((f) => f.id === 'ai_assistant.settings.manage')
|
|
41
|
+
const mcpServersManage = descriptors.find((f) => f.id === 'ai_assistant.mcp_servers.manage')
|
|
42
|
+
expect(settingsManage?.dependsOn).toContain('ai_assistant.view')
|
|
43
|
+
expect(mcpServersManage?.dependsOn).toContain('ai_assistant.mcp_servers.view')
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
test('conversations.share depends on ai_assistant.view, not conversations.manage', () => {
|
|
47
|
+
// setup.ts grants employees `conversations.share` without `conversations.manage`,
|
|
48
|
+
// so the share dependency must resolve against the view feature only — otherwise
|
|
49
|
+
// the employee default would surface a missing-dependency warning at edit time.
|
|
50
|
+
const share = descriptors.find((f) => f.id === 'ai_assistant.conversations.share')
|
|
51
|
+
expect(share?.dependsOn).toEqual(['ai_assistant.view'])
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
test('default role grants resolve without missing dependencies', () => {
|
|
55
|
+
const adminFeatures = (setup.defaultRoleFeatures?.admin ?? []) as string[]
|
|
56
|
+
const employeeFeatures = (setup.defaultRoleFeatures?.employee ?? []) as string[]
|
|
57
|
+
|
|
58
|
+
const adminDiagnostics = resolveAclDependencyDiagnostics(adminFeatures, descriptors)
|
|
59
|
+
expect(adminDiagnostics.missingDependencies).toEqual([])
|
|
60
|
+
|
|
61
|
+
const employeeDiagnostics = resolveAclDependencyDiagnostics(employeeFeatures, descriptors)
|
|
62
|
+
expect(employeeDiagnostics.missingDependencies).toEqual([])
|
|
63
|
+
})
|
|
64
|
+
})
|
|
@@ -1,12 +1,47 @@
|
|
|
1
1
|
export const features = [
|
|
2
2
|
{ id: 'ai_assistant.view', title: 'View AI Assistant Settings', module: 'ai_assistant' },
|
|
3
|
-
{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
{
|
|
3
|
+
{
|
|
4
|
+
id: 'ai_assistant.settings.manage',
|
|
5
|
+
title: 'Manage AI Assistant Settings',
|
|
6
|
+
module: 'ai_assistant',
|
|
7
|
+
dependsOn: ['ai_assistant.view'],
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
id: 'ai_assistant.conversations.manage',
|
|
11
|
+
title: 'Manage AI Assistant Conversations',
|
|
12
|
+
module: 'ai_assistant',
|
|
13
|
+
dependsOn: ['ai_assistant.view'],
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: 'ai_assistant.conversations.share',
|
|
17
|
+
title: 'Share AI Assistant Conversations',
|
|
18
|
+
module: 'ai_assistant',
|
|
19
|
+
dependsOn: ['ai_assistant.view'],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: 'ai_assistant.mcp.serve',
|
|
23
|
+
title: 'Start MCP Server',
|
|
24
|
+
module: 'ai_assistant',
|
|
25
|
+
dependsOn: ['ai_assistant.view'],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'ai_assistant.tools.list',
|
|
29
|
+
title: 'List MCP Tools',
|
|
30
|
+
module: 'ai_assistant',
|
|
31
|
+
dependsOn: ['ai_assistant.view'],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'ai_assistant.mcp_servers.view',
|
|
35
|
+
title: 'View MCP Server Configurations',
|
|
36
|
+
module: 'ai_assistant',
|
|
37
|
+
dependsOn: ['ai_assistant.view'],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 'ai_assistant.mcp_servers.manage',
|
|
41
|
+
title: 'Manage MCP Server Configurations',
|
|
42
|
+
module: 'ai_assistant',
|
|
43
|
+
dependsOn: ['ai_assistant.mcp_servers.view'],
|
|
44
|
+
},
|
|
10
45
|
]
|
|
11
46
|
|
|
12
47
|
export default features
|