@amalgm/agents 0.2.3-main.34436102487 → 0.2.3-main.34938538647
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/PURPOSE.md +3 -0
- package/dist/bundles/install.js +1 -1
- package/dist/config/schema.js +3 -1
- package/dist/config/store.js +3 -3
- package/dist/config/types.d.ts +2 -1
- package/dist/definition.js +3 -0
- package/dist/tool-exposure.d.ts +3 -0
- package/dist/tool-exposure.js +17 -0
- package/dist/types.d.ts +1 -0
- package/package.json +4 -4
package/PURPOSE.md
CHANGED
|
@@ -67,6 +67,9 @@ locked dependency graph on the supported Node toolchain.
|
|
|
67
67
|
immutable revision; native imports never ingest credentials or MCP config.
|
|
68
68
|
9. A portable bundle is accepted only when its flat graph is derivable from
|
|
69
69
|
its canonical records and every element is reachable from a declared head.
|
|
70
|
+
10. An agent revision owns its exact tool/action selection and direct, search,
|
|
71
|
+
or hidden exposure overrides. Configuration, export, import, and execution
|
|
72
|
+
preserve that selection; editing it never mutates the parent Toolbox.
|
|
70
73
|
|
|
71
74
|
## Consequences
|
|
72
75
|
|
package/dist/bundles/install.js
CHANGED
|
@@ -35,7 +35,7 @@ export async function installAgentBundle(agents, input, options = {}) {
|
|
|
35
35
|
authRef: options.authRef || null,
|
|
36
36
|
instructions: entry.config.instructions,
|
|
37
37
|
resources: { files: [], skills: [], subagents: [] },
|
|
38
|
-
toolbox: { toolIds: entry.config.loadout.toolIds, actionIds: [] },
|
|
38
|
+
toolbox: { toolIds: entry.config.loadout.toolIds, actionIds: [], exposure: entry.config.loadout.exposure ?? {} },
|
|
39
39
|
metadata: { installedFromBundle: bundle.bundleId },
|
|
40
40
|
});
|
|
41
41
|
idMap.set(entry.sourceAgentId, agent.id);
|
package/dist/config/schema.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { normalizeToolExposure } from '../tool-exposure.js';
|
|
1
2
|
import crypto from 'node:crypto';
|
|
2
3
|
import { isObject } from '../json.js';
|
|
3
4
|
function text(value) {
|
|
@@ -113,7 +114,8 @@ function loadout(value, fallback) {
|
|
|
113
114
|
|| source.selected || source.tools;
|
|
114
115
|
const explicit = ['toolIds', 'selectedToolIds', 'selected', 'tools']
|
|
115
116
|
.some((key) => Object.hasOwn(raw, key));
|
|
116
|
-
|
|
117
|
+
const exposure = normalizeToolExposure(raw.exposure ?? prior.exposure);
|
|
118
|
+
return { toolIds: uniqueStrings(explicit ? aliases(raw) : aliases(prior)), ...(exposure ? { exposure } : {}) };
|
|
117
119
|
}
|
|
118
120
|
// Engine reference: amalgm-mcp/agent-config/schema.js.
|
|
119
121
|
export function normalizeAgentConfig(input = {}, fallback = {}) {
|
package/dist/config/store.js
CHANGED
|
@@ -16,7 +16,7 @@ export function configFromAgent(agent) {
|
|
|
16
16
|
agentId: agent.id,
|
|
17
17
|
instructions: agent.definition.instructions,
|
|
18
18
|
skills: agent.definition.resources.skills,
|
|
19
|
-
loadout: { toolIds: agent.definition.toolbox.toolIds },
|
|
19
|
+
loadout: { toolIds: [...agent.definition.toolbox.toolIds, ...agent.definition.toolbox.actionIds], exposure: agent.definition.toolbox.exposure },
|
|
20
20
|
subagents: agent.definition.resources.subagents,
|
|
21
21
|
});
|
|
22
22
|
const skillRefs = stored.skills.filter((item) => item.enabled).map((item) => item.name || item.id);
|
|
@@ -28,7 +28,7 @@ export function configFromAgent(agent) {
|
|
|
28
28
|
? stored.instructions : agent.definition.instructions,
|
|
29
29
|
skills: same(skillRefs, agent.definition.resources.skills)
|
|
30
30
|
? stored.skills : agent.definition.resources.skills,
|
|
31
|
-
loadout: { toolIds: agent.definition.toolbox.toolIds },
|
|
31
|
+
loadout: { toolIds: [...agent.definition.toolbox.toolIds, ...agent.definition.toolbox.actionIds], exposure: agent.definition.toolbox.exposure },
|
|
32
32
|
subagents: same(subagentRefs, agent.definition.resources.subagents)
|
|
33
33
|
? stored.subagents : agent.definition.resources.subagents,
|
|
34
34
|
}, stored);
|
|
@@ -49,7 +49,7 @@ export function updateAgentConfig(agents, agentId, patch) {
|
|
|
49
49
|
skills: config.skills.filter((item) => item.enabled).map((item) => item.name || item.id),
|
|
50
50
|
subagents: config.subagents.filter((item) => item.enabled).map((item) => item.agentId),
|
|
51
51
|
},
|
|
52
|
-
toolbox: { toolIds: config.loadout.toolIds },
|
|
52
|
+
toolbox: { toolIds: config.loadout.toolIds, actionIds: [], exposure: config.loadout.exposure ?? {} },
|
|
53
53
|
metadata,
|
|
54
54
|
};
|
|
55
55
|
return { agent: agents.updateAgent(agentId, projected), config };
|
package/dist/config/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { JsonObject } from '../types.js';
|
|
1
|
+
import type { JsonObject, ToolboxLoadoutRef } from '../types.js';
|
|
2
2
|
export interface ConfigSkill {
|
|
3
3
|
id: string;
|
|
4
4
|
name: string;
|
|
@@ -36,6 +36,7 @@ export interface AgentConfig {
|
|
|
36
36
|
skills: ConfigSkill[];
|
|
37
37
|
loadout: {
|
|
38
38
|
toolIds: string[];
|
|
39
|
+
exposure?: ToolboxLoadoutRef['exposure'];
|
|
39
40
|
};
|
|
40
41
|
hooks: ConfigHook[];
|
|
41
42
|
subagents: ConfigSubagent[];
|
package/dist/definition.js
CHANGED
|
@@ -2,6 +2,7 @@ import crypto from 'node:crypto';
|
|
|
2
2
|
import { AgentError } from './errors.js';
|
|
3
3
|
import { canonicalJson, isObject } from './json.js';
|
|
4
4
|
import { requireId } from './ids.js';
|
|
5
|
+
import { normalizeToolExposure } from './tool-exposure.js';
|
|
5
6
|
function text(value, fallback = '') {
|
|
6
7
|
return typeof value === 'string' ? value.trim() : fallback;
|
|
7
8
|
}
|
|
@@ -42,6 +43,7 @@ export function normalizeDefinition(input) {
|
|
|
42
43
|
const resources = isObject(input.resources) ? input.resources : {};
|
|
43
44
|
const toolbox = isObject(input.toolbox) ? input.toolbox : {};
|
|
44
45
|
const workspace = isObject(input.workspace) ? input.workspace : {};
|
|
46
|
+
const exposure = normalizeToolExposure(toolbox.exposure);
|
|
45
47
|
return {
|
|
46
48
|
id,
|
|
47
49
|
name,
|
|
@@ -58,6 +60,7 @@ export function normalizeDefinition(input) {
|
|
|
58
60
|
toolbox: {
|
|
59
61
|
toolIds: strings(toolbox.toolIds),
|
|
60
62
|
actionIds: strings(toolbox.actionIds),
|
|
63
|
+
...(exposure ? { exposure } : {}),
|
|
61
64
|
},
|
|
62
65
|
workspace: { cwd: text(workspace.cwd) || null },
|
|
63
66
|
metadata: object(input.metadata),
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AgentError } from './errors.js';
|
|
2
|
+
import { isObject } from './json.js';
|
|
3
|
+
/** Agents retains exposure references; Tools owns their execution meaning. */
|
|
4
|
+
export function normalizeToolExposure(value) {
|
|
5
|
+
if (value === undefined)
|
|
6
|
+
return undefined;
|
|
7
|
+
if (!isObject(value))
|
|
8
|
+
throw new AgentError('invalid_input', 'Tool exposure must be an object');
|
|
9
|
+
const exposure = {};
|
|
10
|
+
for (const [id, mode] of Object.entries(value).sort(([a], [b]) => a.localeCompare(b))) {
|
|
11
|
+
if (!id.trim() || (mode !== 'direct' && mode !== 'search' && mode !== 'hidden')) {
|
|
12
|
+
throw new AgentError('invalid_input', `Invalid tool exposure: ${id}`);
|
|
13
|
+
}
|
|
14
|
+
exposure[id] = mode;
|
|
15
|
+
}
|
|
16
|
+
return Object.keys(exposure).length ? exposure : undefined;
|
|
17
|
+
}
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amalgm/agents",
|
|
3
|
-
"version": "0.2.3-main.
|
|
3
|
+
"version": "0.2.3-main.34938538647",
|
|
4
4
|
"description": "Local-first agent identities, installations, and immutable revisions.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"private": false,
|
|
@@ -89,11 +89,11 @@
|
|
|
89
89
|
"package.json"
|
|
90
90
|
]
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "12e22e748e1b324ac8180cca461133663fa31612",
|
|
93
93
|
"amalgmSource": {
|
|
94
94
|
"repository": "amalgm-inc/amalgm-agents",
|
|
95
95
|
"branch": "main",
|
|
96
|
-
"commit": "
|
|
97
|
-
"occurrence": "
|
|
96
|
+
"commit": "12e22e748e1b324ac8180cca461133663fa31612",
|
|
97
|
+
"occurrence": "34938538647"
|
|
98
98
|
}
|
|
99
99
|
}
|