@codemcp/ade-core 0.2.4 → 0.2.6
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/dist/catalog/facets/autonomy.js +3 -46
- package/dist/index.d.ts +1 -1
- package/dist/resolver.js +1 -5
- package/dist/types.d.ts +0 -8
- package/package.json +1 -1
|
@@ -1,46 +1,3 @@
|
|
|
1
|
-
const ALL_CAPABILITIES = [
|
|
2
|
-
"read",
|
|
3
|
-
"edit_write",
|
|
4
|
-
"search_list",
|
|
5
|
-
"bash_safe",
|
|
6
|
-
"bash_unsafe",
|
|
7
|
-
"web",
|
|
8
|
-
"task_agent"
|
|
9
|
-
];
|
|
10
|
-
function capabilityMap(defaultDecision, overrides = {}) {
|
|
11
|
-
return Object.fromEntries(ALL_CAPABILITIES.map((capability) => [
|
|
12
|
-
capability,
|
|
13
|
-
overrides[capability] ?? defaultDecision
|
|
14
|
-
]));
|
|
15
|
-
}
|
|
16
|
-
function autonomyPolicy(profile) {
|
|
17
|
-
switch (profile) {
|
|
18
|
-
case "rigid":
|
|
19
|
-
return {
|
|
20
|
-
profile,
|
|
21
|
-
capabilities: capabilityMap("ask")
|
|
22
|
-
};
|
|
23
|
-
case "sensible-defaults":
|
|
24
|
-
return {
|
|
25
|
-
profile,
|
|
26
|
-
capabilities: capabilityMap("ask", {
|
|
27
|
-
read: "allow",
|
|
28
|
-
edit_write: "allow",
|
|
29
|
-
search_list: "allow",
|
|
30
|
-
bash_safe: "allow",
|
|
31
|
-
task_agent: "allow",
|
|
32
|
-
web: "ask"
|
|
33
|
-
})
|
|
34
|
-
};
|
|
35
|
-
case "max-autonomy":
|
|
36
|
-
return {
|
|
37
|
-
profile,
|
|
38
|
-
capabilities: capabilityMap("allow", {
|
|
39
|
-
web: "ask"
|
|
40
|
-
})
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
1
|
export const autonomyFacet = {
|
|
45
2
|
id: "autonomy",
|
|
46
3
|
label: "Autonomy",
|
|
@@ -55,7 +12,7 @@ export const autonomyFacet = {
|
|
|
55
12
|
recipe: [
|
|
56
13
|
{
|
|
57
14
|
writer: "permission-policy",
|
|
58
|
-
config:
|
|
15
|
+
config: { profile: "rigid" }
|
|
59
16
|
}
|
|
60
17
|
]
|
|
61
18
|
},
|
|
@@ -66,7 +23,7 @@ export const autonomyFacet = {
|
|
|
66
23
|
recipe: [
|
|
67
24
|
{
|
|
68
25
|
writer: "permission-policy",
|
|
69
|
-
config:
|
|
26
|
+
config: { profile: "sensible-defaults" }
|
|
70
27
|
}
|
|
71
28
|
]
|
|
72
29
|
},
|
|
@@ -77,7 +34,7 @@ export const autonomyFacet = {
|
|
|
77
34
|
recipe: [
|
|
78
35
|
{
|
|
79
36
|
writer: "permission-policy",
|
|
80
|
-
config:
|
|
37
|
+
config: { profile: "max-autonomy" }
|
|
81
38
|
}
|
|
82
39
|
]
|
|
83
40
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { type Catalog, type Facet, type Option, type Provision, type DocsetDef } from "./types.js";
|
|
2
|
-
export { type LogicalConfig, type McpServerEntry, type CliAction, type KnowledgeSource, type SkillDefinition, type InlineSkill, type ExternalSkill, type GitHook, type PermissionPolicy, type AutonomyProfile
|
|
2
|
+
export { type LogicalConfig, type McpServerEntry, type CliAction, type KnowledgeSource, type SkillDefinition, type InlineSkill, type ExternalSkill, type GitHook, type PermissionPolicy, type AutonomyProfile } from "./types.js";
|
|
3
3
|
export { type ResolutionContext, type ResolvedFacet } from "./types.js";
|
|
4
4
|
export { type UserConfig, type LockFile } from "./types.js";
|
|
5
5
|
export { type ProvisionWriter } from "./types.js";
|
package/dist/resolver.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -44,16 +44,8 @@ export interface GitHook {
|
|
|
44
44
|
script: string;
|
|
45
45
|
}
|
|
46
46
|
export type AutonomyProfile = "rigid" | "sensible-defaults" | "max-autonomy";
|
|
47
|
-
export type PermissionDecision = "ask" | "allow" | "deny";
|
|
48
|
-
export type AutonomyCapability = "read" | "edit_write" | "search_list" | "bash_safe" | "bash_unsafe" | "web" | "task_agent";
|
|
49
|
-
/**
|
|
50
|
-
* @deprecated Harness-specific tool-level rules are no longer produced by core.
|
|
51
|
-
* Kept temporarily as a compatibility type for downstream packages.
|
|
52
|
-
*/
|
|
53
|
-
export type PermissionRule = PermissionDecision | Record<string, PermissionDecision>;
|
|
54
47
|
export interface PermissionPolicy extends Record<string, unknown> {
|
|
55
48
|
profile: AutonomyProfile;
|
|
56
|
-
capabilities: Record<AutonomyCapability, PermissionDecision>;
|
|
57
49
|
}
|
|
58
50
|
export interface LogicalConfig extends Record<string, unknown> {
|
|
59
51
|
mcp_servers: McpServerEntry[];
|