@sweny-ai/core 0.1.179 → 0.1.181
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/harness/capabilities.js +1 -0
- package/dist/harness/claude-code.d.ts +1 -1
- package/dist/harness/claude-code.js +5 -0
- package/dist/harness/policy.js +4 -0
- package/dist/harness/types.d.ts +8 -0
- package/dist/inputs.d.ts +9 -28
- package/dist/inputs.js +1 -1
- package/dist/node-policy.d.ts +3 -2
- package/dist/node-policy.js +9 -2
- package/dist/schema.d.ts +675 -3040
- package/dist/schema.js +16 -10
- package/dist/sources.d.ts +4 -18
- package/dist/types.d.ts +9 -0
- package/dist/types.js +6 -0
- package/package.json +2 -2
|
@@ -19,6 +19,7 @@ export const CLAUDE_CODE_CAPABILITIES = {
|
|
|
19
19
|
usage: { tokens: true, costUsd: true, live: true, liveUnits: ["tokens"] },
|
|
20
20
|
cancel: "signal",
|
|
21
21
|
resume: false,
|
|
22
|
+
nativeNone: true,
|
|
22
23
|
};
|
|
23
24
|
/**
|
|
24
25
|
* Codex (`codex exec --json`), declared from the openai/codex source at
|
|
@@ -276,4 +276,4 @@ export type ClaudeClient = ClaudeCodeHarness;
|
|
|
276
276
|
*
|
|
277
277
|
* @internal Exported for the tool bridge parity test (#414).
|
|
278
278
|
*/
|
|
279
|
-
export declare function coreToolToSdkTool(coreTool: Tool, defaultCtx: ToolContext): import("@anthropic-ai/claude-agent-sdk").SdkMcpToolDefinition<Record<string, import("zod").ZodType<
|
|
279
|
+
export declare function coreToolToSdkTool(coreTool: Tool, defaultCtx: ToolContext): import("@anthropic-ai/claude-agent-sdk").SdkMcpToolDefinition<Record<string, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>>>;
|
|
@@ -360,6 +360,7 @@ export class ClaudeCodeHarness {
|
|
|
360
360
|
readOnly,
|
|
361
361
|
disallowedTools: disallowedTools.length > 0 ? disallowedTools : undefined,
|
|
362
362
|
strictMcp: mcpWithheld(readOnly, req.agentAccess) || policy.strict || policy.exclusiveMcp === true,
|
|
363
|
+
nativeNone: policy.nativeNone === true,
|
|
363
364
|
sandboxMode: policy.sandbox,
|
|
364
365
|
agentAccess: {
|
|
365
366
|
envVars: req.agentAccess?.envVars ?? [],
|
|
@@ -569,6 +570,10 @@ export class ClaudeCodeHarness {
|
|
|
569
570
|
strictMcpConfig: true,
|
|
570
571
|
settingSources: [],
|
|
571
572
|
...(disallowedTools && disallowedTools.length > 0 ? { disallowedTools } : {}),
|
|
573
|
+
// permissions.native: none. `tools: []` removes every built-in tool whatever its
|
|
574
|
+
// name; `settingSources: []` loads no user, project or local settings, CLAUDE.md or skills
|
|
575
|
+
// (already the default above since #497; kept so the policy value states its whole contract).
|
|
576
|
+
...(opts.nativeNone ? { tools: [], settingSources: [] } : {}),
|
|
572
577
|
// CC-08: ask the SDK to produce validated structured output when the
|
|
573
578
|
// node declares an output schema. The SDK then returns the parsed
|
|
574
579
|
// value on `result.structured_output`, which we prefer over the
|
package/dist/harness/policy.js
CHANGED
|
@@ -96,6 +96,10 @@ export function policyGate(caps, policy, wrappers = {}) {
|
|
|
96
96
|
unenforced.push(`disallowed_tools [${policy.nativeDeny.join(", ")}]: harness has no tools by these names`);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
+
// `permissions.native: none`: no built-in tools and no settings sources.
|
|
100
|
+
if (policy.nativeNone && caps.nativeNone !== true) {
|
|
101
|
+
unenforced.push("native none: harness cannot run a node with no built-in tools and no settings sources");
|
|
102
|
+
}
|
|
99
103
|
// Exclusive MCP (`permissions.strict`): only the servers sweny passes may
|
|
100
104
|
// load, never the user's own config. A harness that cannot exclude them
|
|
101
105
|
// cannot honor it, so strict refuses the node.
|
package/dist/harness/types.d.ts
CHANGED
|
@@ -50,6 +50,8 @@ export interface HarnessCapabilities {
|
|
|
50
50
|
};
|
|
51
51
|
cancel: "signal" | "rpc" | "kill";
|
|
52
52
|
resume: boolean;
|
|
53
|
+
/** The harness can run a node with no built-in tools and no settings sources. Absent means false. */
|
|
54
|
+
nativeNone?: boolean;
|
|
53
55
|
}
|
|
54
56
|
/** What a node is allowed to do, compiled per adapter by the harness. */
|
|
55
57
|
export interface NodePolicy {
|
|
@@ -69,6 +71,12 @@ export interface NodePolicy {
|
|
|
69
71
|
* cannot honor it: reported in `degraded`, refused under `strict`.
|
|
70
72
|
*/
|
|
71
73
|
exclusiveMcp?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* The agent gets no built-in tools and loads no settings from disk
|
|
76
|
+
* (`permissions.native: none`). A harness whose `nativeNone` capability is
|
|
77
|
+
* not true cannot honor it: reported in `degraded`, refused under `strict`.
|
|
78
|
+
*/
|
|
79
|
+
nativeNone?: boolean;
|
|
72
80
|
/**
|
|
73
81
|
* Turn budget for the run. Set by adapters whose `turnLimit` is not native,
|
|
74
82
|
* so the gate reports how the budget is kept (watchdog) or that it is not.
|
package/dist/inputs.d.ts
CHANGED
|
@@ -69,37 +69,18 @@ export interface WorkflowInputField {
|
|
|
69
69
|
}
|
|
70
70
|
/** Declared input contract for a workflow. Keys are field names. */
|
|
71
71
|
export type WorkflowInputs = Record<string, WorkflowInputField>;
|
|
72
|
-
export declare const workflowInputsZ: z.ZodRecord<z.ZodString, z.
|
|
73
|
-
type: z.ZodEnum<
|
|
72
|
+
export declare const workflowInputsZ: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
73
|
+
type: z.ZodEnum<{
|
|
74
|
+
string: "string";
|
|
75
|
+
number: "number";
|
|
76
|
+
boolean: "boolean";
|
|
77
|
+
"string[]": "string[]";
|
|
78
|
+
}>;
|
|
74
79
|
description: z.ZodOptional<z.ZodString>;
|
|
75
80
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
76
81
|
default: z.ZodOptional<z.ZodUnknown>;
|
|
77
|
-
enum: z.ZodOptional<z.ZodArray<z.ZodUnknown
|
|
78
|
-
},
|
|
79
|
-
type: "string" | "number" | "boolean" | "string[]";
|
|
80
|
-
description?: string | undefined;
|
|
81
|
-
required?: boolean | undefined;
|
|
82
|
-
default?: unknown;
|
|
83
|
-
enum?: unknown[] | undefined;
|
|
84
|
-
}, {
|
|
85
|
-
type: "string" | "number" | "boolean" | "string[]";
|
|
86
|
-
description?: string | undefined;
|
|
87
|
-
required?: boolean | undefined;
|
|
88
|
-
default?: unknown;
|
|
89
|
-
enum?: unknown[] | undefined;
|
|
90
|
-
}>, {
|
|
91
|
-
type: "string" | "number" | "boolean" | "string[]";
|
|
92
|
-
description?: string | undefined;
|
|
93
|
-
required?: boolean | undefined;
|
|
94
|
-
default?: unknown;
|
|
95
|
-
enum?: unknown[] | undefined;
|
|
96
|
-
}, {
|
|
97
|
-
type: "string" | "number" | "boolean" | "string[]";
|
|
98
|
-
description?: string | undefined;
|
|
99
|
-
required?: boolean | undefined;
|
|
100
|
-
default?: unknown;
|
|
101
|
-
enum?: unknown[] | undefined;
|
|
102
|
-
}>>;
|
|
82
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
83
|
+
}, z.core.$strict>>;
|
|
103
84
|
/** A single validation error against the declared input contract. */
|
|
104
85
|
export interface InputValidationError {
|
|
105
86
|
field: string;
|
package/dist/inputs.js
CHANGED
|
@@ -101,7 +101,7 @@ const workflowInputFieldZ = z
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
|
-
export const workflowInputsZ = z.record(workflowInputFieldZ);
|
|
104
|
+
export const workflowInputsZ = z.record(z.string(), workflowInputFieldZ);
|
|
105
105
|
/**
|
|
106
106
|
* Validate the caller's raw input object against the workflow's declared
|
|
107
107
|
* `inputs` block. Applies defaults for omitted optional fields. Surfaces
|
package/dist/node-policy.d.ts
CHANGED
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
* the ceiling for every node; a node may narrow it, never widen it.
|
|
6
6
|
*/
|
|
7
7
|
import type { NodePolicy, ToolClass } from "./harness/types.js";
|
|
8
|
-
import type { Node, NodeAccess, Workflow } from "./types.js";
|
|
8
|
+
import type { Node, NodeAccess, NodeNative, Workflow } from "./types.js";
|
|
9
9
|
export interface ResolvedPermissions {
|
|
10
10
|
access: NodeAccess;
|
|
11
11
|
deny: ToolClass[];
|
|
12
12
|
strict: boolean;
|
|
13
|
+
native?: NodeNative;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Effective permissions for a node.
|
|
@@ -17,7 +18,7 @@ export interface ResolvedPermissions {
|
|
|
17
18
|
* access: the node's own, else `read` when it declares `outputs`, else the
|
|
18
19
|
* workflow's, else `write` (today's behavior). A workflow `read` ceiling wins
|
|
19
20
|
* over a node `write` (the loader rejects that combination; this is the
|
|
20
|
-
* runtime backstop). deny: union. strict: either.
|
|
21
|
+
* runtime backstop). deny: union. strict: either. native: `none` if either says so.
|
|
21
22
|
*/
|
|
22
23
|
export declare function resolveNodePermissions(node: Pick<Node, "permissions" | "outputs">, workflow?: Pick<Workflow, "permissions">): ResolvedPermissions;
|
|
23
24
|
/** True when a node asks for more than the workflow ceiling allows. */
|
package/dist/node-policy.js
CHANGED
|
@@ -15,7 +15,7 @@ function spec(p) {
|
|
|
15
15
|
* access: the node's own, else `read` when it declares `outputs`, else the
|
|
16
16
|
* workflow's, else `write` (today's behavior). A workflow `read` ceiling wins
|
|
17
17
|
* over a node `write` (the loader rejects that combination; this is the
|
|
18
|
-
* runtime backstop). deny: union. strict: either.
|
|
18
|
+
* runtime backstop). deny: union. strict: either. native: `none` if either says so.
|
|
19
19
|
*/
|
|
20
20
|
export function resolveNodePermissions(node, workflow = {}) {
|
|
21
21
|
const wf = spec(workflow.permissions);
|
|
@@ -24,7 +24,13 @@ export function resolveNodePermissions(node, workflow = {}) {
|
|
|
24
24
|
if (wf.access === "read")
|
|
25
25
|
access = "read";
|
|
26
26
|
const deny = [...new Set([...(wf.deny ?? []), ...(own.deny ?? [])])];
|
|
27
|
-
|
|
27
|
+
const none = wf.native === "none" || own.native === "none";
|
|
28
|
+
return {
|
|
29
|
+
access,
|
|
30
|
+
deny,
|
|
31
|
+
strict: wf.strict === true || own.strict === true,
|
|
32
|
+
...(none ? { native: "none" } : {}),
|
|
33
|
+
};
|
|
28
34
|
}
|
|
29
35
|
/** True when a node asks for more than the workflow ceiling allows. */
|
|
30
36
|
export function exceedsPermissionCeiling(node, workflow) {
|
|
@@ -39,5 +45,6 @@ export function buildNodePolicy(opts) {
|
|
|
39
45
|
egress: opts.egress ?? [],
|
|
40
46
|
strict: opts.permissions.strict,
|
|
41
47
|
...(opts.permissions.strict ? { exclusiveMcp: true } : {}),
|
|
48
|
+
...(opts.permissions.native === "none" ? { nativeNone: true } : {}),
|
|
42
49
|
};
|
|
43
50
|
}
|