@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/schema.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * parsing untrusted input (JSON/YAML import, Studio editor).
8
8
  */
9
9
  import { z } from "zod";
10
- import { AUTHOR_ASSOCIATIONS, CONTEXT_MODES, DECIDER_CONFIDENCE_FLOOR, DECIDER_MARGIN_FLOOR, DECIDER_MIN_CONFIDENCE, DECIDER_MIN_MARGIN, DECIDER_MODE_REMOVED, DECIDER_PROVIDER_MOVED, EVALUATOR_KINDS, EVAL_POLICIES, MCP_TRANSPORTS, NODE_ACCESS, NODE_ON_FAIL, REQUIRES_ON_FAIL, ROUTE_BY, SAFE_OUTPUT_APPLIERS, SAFE_OUTPUT_EXPIRES_PATTERN, SAFE_OUTPUT_MAX_CEILING, SAFE_OUTPUT_STATES, SAFE_OUTPUT_TYPES, SKILL_CATEGORIES, SKILL_ID_MAX_LENGTH, SKILL_ID_PATTERN, TOOL_ACCESS, TOOL_CLASSES, WORKFLOW_TYPES, } from "./types.js";
10
+ import { AUTHOR_ASSOCIATIONS, CONTEXT_MODES, DECIDER_CONFIDENCE_FLOOR, DECIDER_MARGIN_FLOOR, DECIDER_MIN_CONFIDENCE, DECIDER_MIN_MARGIN, DECIDER_MODE_REMOVED, DECIDER_PROVIDER_MOVED, EVALUATOR_KINDS, EVAL_POLICIES, MCP_TRANSPORTS, NODE_ACCESS, NODE_NATIVE, NODE_ON_FAIL, REQUIRES_ON_FAIL, ROUTE_BY, SAFE_OUTPUT_APPLIERS, SAFE_OUTPUT_EXPIRES_PATTERN, SAFE_OUTPUT_MAX_CEILING, SAFE_OUTPUT_STATES, SAFE_OUTPUT_TYPES, SKILL_CATEGORIES, SKILL_ID_MAX_LENGTH, SKILL_ID_PATTERN, TOOL_ACCESS, TOOL_CLASSES, WORKFLOW_TYPES, } from "./types.js";
11
11
  import { sourceZ } from "./sources.js";
12
12
  import { resolveNodePermissions } from "./node-policy.js";
13
13
  import { workflowInputsZ, WORKFLOW_INPUT_TYPES } from "./inputs.js";
@@ -17,7 +17,7 @@ export { isWhenExpression, whenLabel } from "./when.js";
17
17
  export { sourceZ };
18
18
  export { workflowInputsZ };
19
19
  // ─── Zod Schemas ─────────────────────────────────────────────────
20
- export const jsonSchemaZ = z.record(z.unknown());
20
+ export const jsonSchemaZ = z.record(z.string(), z.unknown());
21
21
  // .strict() to match the published skill JSON Schema's ConfigField
22
22
  // `additionalProperties: false`. Without it Zod silently STRIPPED an unknown
23
23
  // nested key while ajv REJECTED it (the #214/#225 divergence class, missed for
@@ -52,8 +52,8 @@ export const mcpServerConfigZ = z
52
52
  command: z.string().optional(),
53
53
  args: z.array(z.string()).optional(),
54
54
  url: z.string().optional(),
55
- headers: z.record(z.string()).optional(),
56
- env: z.record(z.string()).optional(),
55
+ headers: z.record(z.string(), z.string()).optional(),
56
+ env: z.record(z.string(), z.string()).optional(),
57
57
  })
58
58
  .strict()
59
59
  .refine((c) => c.command || c.url, {
@@ -76,11 +76,11 @@ export const skillZ = z
76
76
  name: z.string(),
77
77
  description: z.string(),
78
78
  category: skillCategoryZ,
79
- config: z.record(configFieldZ).default({}),
79
+ config: z.record(z.string(), configFieldZ).default({}),
80
80
  tools: z.array(toolZ).default([]),
81
81
  instruction: z.string().optional(),
82
82
  mcp: mcpServerConfigZ.optional(),
83
- mcpAliases: z.record(z.array(z.string().min(1)).min(1)).optional(),
83
+ mcpAliases: z.record(z.string(), z.array(z.string().min(1)).min(1)).optional(),
84
84
  })
85
85
  // Strict to match the published skill JSON Schema's
86
86
  // `additionalProperties: false`. Without this an unknown top-level key was
@@ -260,10 +260,11 @@ export const nodePermissionsZ = z.union([
260
260
  access: z.enum(NODE_ACCESS).optional(),
261
261
  deny: z.array(z.enum(TOOL_CLASSES)).min(1).optional(),
262
262
  strict: z.boolean().optional(),
263
+ native: z.enum(NODE_NATIVE).optional(),
263
264
  })
264
265
  .strict()
265
- .refine((p) => p.access !== undefined || p.deny !== undefined || p.strict !== undefined, {
266
- message: "permissions must declare at least one of access, deny, strict",
266
+ .refine((p) => p.access !== undefined || p.deny !== undefined || p.strict !== undefined || p.native !== undefined, {
267
+ message: "permissions must declare at least one of access, deny, strict, native",
267
268
  }),
268
269
  ]);
269
270
  /**
@@ -390,10 +391,10 @@ export const workflowZ = z.object({
390
391
  .regex(/^[1-9]\d*$/, "spec_version must be a positive integer string")
391
392
  .optional(),
392
393
  workflow_type: workflowTypeZ.optional(),
393
- nodes: z.record(nodeZ),
394
+ nodes: z.record(z.string(), nodeZ),
394
395
  edges: z.array(edgeZ),
395
396
  entry: z.string().min(1),
396
- skills: z.record(skillDefinitionZ).default({}),
397
+ skills: z.record(z.string(), skillDefinitionZ).default({}),
397
398
  rules: z.array(sourceZ).optional(),
398
399
  context: z.array(sourceZ).optional(),
399
400
  judge_model: z.string().min(1).optional(),
@@ -998,6 +999,11 @@ export const workflowJsonSchema = {
998
999
  type: "boolean",
999
1000
  description: "Exclusive MCP (only the servers sweny injects), and refuse the node on a harness that cannot enforce the policy.",
1000
1001
  },
1002
+ native: {
1003
+ type: "string",
1004
+ enum: [...NODE_NATIVE],
1005
+ description: "'none' gives the agent no built-in tools and loads no settings, CLAUDE.md or skills from disk; only skill tools reach it. On the workflow it is a ceiling a node cannot lift. A harness that cannot honor it degrades, and refuses the node under strict.",
1006
+ },
1001
1007
  },
1002
1008
  },
1003
1009
  ],
package/dist/sources.d.ts CHANGED
@@ -27,28 +27,14 @@ export type SourceKind = "inline" | "file" | "url";
27
27
  * Runtime validation of `type` against the resolver registry happens later —
28
28
  * the schema stays permissive so new resolvers slot in without schema bumps.
29
29
  */
30
- export declare const sourceZ: z.ZodUnion<[z.ZodString, z.ZodObject<{
30
+ export declare const sourceZ: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
31
31
  inline: z.ZodString;
32
- }, "strict", z.ZodTypeAny, {
33
- inline: string;
34
- }, {
35
- inline: string;
36
- }>, z.ZodObject<{
32
+ }, z.core.$strict>, z.ZodObject<{
37
33
  file: z.ZodString;
38
- }, "strict", z.ZodTypeAny, {
39
- file: string;
40
- }, {
41
- file: string;
42
- }>, z.ZodObject<{
34
+ }, z.core.$strict>, z.ZodObject<{
43
35
  url: z.ZodString;
44
36
  type: z.ZodOptional<z.ZodString>;
45
- }, "strict", z.ZodTypeAny, {
46
- url: string;
47
- type?: string | undefined;
48
- }, {
49
- url: string;
50
- type?: string | undefined;
51
- }>]>;
37
+ }, z.core.$strict>]>;
52
38
  export type ResolvedSource = {
53
39
  content: string;
54
40
  kind: SourceKind;
package/dist/types.d.ts CHANGED
@@ -443,6 +443,13 @@ export interface Node {
443
443
  /** Node access level. `read` = no write-capable tool reaches the agent. */
444
444
  export declare const NODE_ACCESS: readonly ["read", "write"];
445
445
  export type NodeAccess = (typeof NODE_ACCESS)[number];
446
+ /**
447
+ * Built-in tools and settings. `default`: today's behavior. `none`: the agent
448
+ * has no built-in tools at all and loads no settings, CLAUDE.md or skills from
449
+ * disk; only the tools sweny passes (skill tools) reach the model.
450
+ */
451
+ export declare const NODE_NATIVE: readonly ["default", "none"];
452
+ export type NodeNative = (typeof NODE_NATIVE)[number];
446
453
  /** Portable built-in tool classes, compiled per harness (Claude Code: native tool names). */
447
454
  export declare const TOOL_CLASSES: readonly ["shell", "write", "edit", "net", "subagent"];
448
455
  /** Object form of {@link NodePermissions}. */
@@ -452,6 +459,8 @@ export interface NodePermissionsSpec {
452
459
  deny?: (typeof TOOL_CLASSES)[number][];
453
460
  /** Exclusive MCP, and refuse the node on a harness that cannot enforce the policy. */
454
461
  strict?: boolean;
462
+ /** `none`: no built-in tools and no settings sources. A workflow `none` is a ceiling a node cannot lift. */
463
+ native?: NodeNative;
455
464
  }
456
465
  /** `read` / `write` shorthand, or the object form. */
457
466
  export type NodePermissions = NodeAccess | NodePermissionsSpec;
package/dist/types.js CHANGED
@@ -72,6 +72,12 @@ export const MCP_TRANSPORTS = ["stdio", "http"];
72
72
  // ─── Permissions and safe outputs (#365) ─────────────────────────
73
73
  /** Node access level. `read` = no write-capable tool reaches the agent. */
74
74
  export const NODE_ACCESS = ["read", "write"];
75
+ /**
76
+ * Built-in tools and settings. `default`: today's behavior. `none`: the agent
77
+ * has no built-in tools at all and loads no settings, CLAUDE.md or skills from
78
+ * disk; only the tools sweny passes (skill tools) reach the model.
79
+ */
80
+ export const NODE_NATIVE = ["default", "none"];
75
81
  /** Portable built-in tool classes, compiled per harness (Claude Code: native tool names). */
76
82
  export const TOOL_CLASSES = ["shell", "write", "edit", "net", "subagent"];
77
83
  /** Write operations a node may request through `emit_output`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sweny-ai/core",
3
- "version": "0.1.179",
3
+ "version": "0.1.181",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "sweny": "./dist/cli/main.js"
@@ -68,7 +68,7 @@
68
68
  "chalk": "^5",
69
69
  "commander": "^13",
70
70
  "yaml": "^2.9.0",
71
- "zod": "^3.25.76"
71
+ "zod": "^4.0.0"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@anthropic-ai/claude-code": "^2.1.220",