zidane 1.2.0 → 1.4.0

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/tools.js CHANGED
@@ -1,14 +1,17 @@
1
1
  import {
2
2
  createSpawnTool,
3
+ init_tools,
3
4
  listFiles,
4
5
  readFile,
5
6
  shell,
6
7
  spawn,
7
8
  validateToolArgs,
8
9
  writeFile
9
- } from "./chunk-27EP7HB3.js";
10
+ } from "./chunk-YCH7G7YC.js";
10
11
  import "./chunk-26LIQARN.js";
12
+ import "./chunk-PRNQ7DXE.js";
11
13
  import "./chunk-PNKVD2UK.js";
14
+ init_tools();
12
15
  export {
13
16
  createSpawnTool,
14
17
  listFiles,
@@ -52,6 +52,16 @@ interface SessionMessage {
52
52
  role: 'user' | 'assistant';
53
53
  content: SessionContentBlock[];
54
54
  }
55
+ interface SessionTurn {
56
+ /** UUID — generated by the store if it provides generateTurnId, else crypto.randomUUID() */
57
+ id: string;
58
+ role: 'user' | 'assistant' | 'system';
59
+ content: SessionContentBlock[];
60
+ /** Token usage — only present on assistant turns */
61
+ usage?: TurnUsage;
62
+ /** Unix timestamp (Date.now()) when the turn was created */
63
+ createdAt: number;
64
+ }
55
65
  interface AgentRunOptions {
56
66
  model?: string;
57
67
  prompt: string;
@@ -91,4 +101,4 @@ interface ChildRunStats {
91
101
  stats: AgentStats;
92
102
  }
93
103
 
94
- export type { AgentRunOptions as A, ChildRunStats as C, ImageContent as I, McpServerConfig as M, SessionContentBlock as S, ThinkingLevel as T, AgentStats as a, SessionMessage as b, ToolExecutionMode as c, TurnUsage as d };
104
+ export type { AgentRunOptions as A, ChildRunStats as C, ImageContent as I, McpServerConfig as M, SessionContentBlock as S, ThinkingLevel as T, AgentStats as a, SessionMessage as b, SessionTurn as c, ToolExecutionMode as d, TurnUsage as e };
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Execution context types.
3
+ *
4
+ * An execution context defines *where* and *how* an agent's tools run.
5
+ * The agent loop and tools interact through this interface without knowing
6
+ * whether they're running in-process, in a Docker container, or in a
7
+ * remote sandbox.
8
+ */
9
+ interface ContextCapabilities {
10
+ /** Can execute shell commands */
11
+ shell: boolean;
12
+ /** Can read/write files in a workspace */
13
+ filesystem: boolean;
14
+ /** Can make outbound network requests */
15
+ network: boolean;
16
+ /** Has GPU access */
17
+ gpu: boolean;
18
+ }
19
+ /** Opaque handle to a running execution context instance */
20
+ interface ExecutionHandle {
21
+ id: string;
22
+ type: ContextType;
23
+ /** Working directory within the context */
24
+ cwd: string;
25
+ }
26
+ interface ExecResult {
27
+ stdout: string;
28
+ stderr: string;
29
+ exitCode: number;
30
+ }
31
+ interface SpawnConfig {
32
+ /** Working directory (created if it doesn't exist) */
33
+ cwd?: string;
34
+ /** Environment variables */
35
+ env?: Record<string, string>;
36
+ /** Docker image (only for 'docker' context) */
37
+ image?: string;
38
+ /** Resource limits */
39
+ limits?: {
40
+ /** Memory limit in MB */
41
+ memory?: number;
42
+ /** CPU limit (e.g. '1.0' = 1 core) */
43
+ cpu?: string;
44
+ /** Timeout in seconds for the entire context lifetime */
45
+ timeout?: number;
46
+ };
47
+ /** Sandbox provider config (only for 'sandbox' context) */
48
+ sandbox?: {
49
+ provider: string;
50
+ apiKey?: string;
51
+ [key: string]: unknown;
52
+ };
53
+ }
54
+ type ContextType = 'process' | 'docker' | 'sandbox';
55
+ interface ExecutionContext {
56
+ /** Context type identifier */
57
+ readonly type: ContextType;
58
+ /** What this context supports */
59
+ readonly capabilities: ContextCapabilities;
60
+ /** Spawn a new execution environment */
61
+ spawn: (config?: SpawnConfig) => Promise<ExecutionHandle>;
62
+ /** Execute a shell command in the context */
63
+ exec: (handle: ExecutionHandle, command: string, options?: {
64
+ cwd?: string;
65
+ env?: Record<string, string>;
66
+ timeout?: number;
67
+ }) => Promise<ExecResult>;
68
+ /** Read a file from the context's filesystem */
69
+ readFile: (handle: ExecutionHandle, path: string) => Promise<string>;
70
+ /** Write a file to the context's filesystem */
71
+ writeFile: (handle: ExecutionHandle, path: string, content: string) => Promise<void>;
72
+ /** List files in a directory */
73
+ listFiles: (handle: ExecutionHandle, path: string) => Promise<string[]>;
74
+ /** Destroy the execution environment and clean up resources */
75
+ destroy: (handle: ExecutionHandle) => Promise<void>;
76
+ }
77
+
78
+ /**
79
+ * Types for the Agent Skills system.
80
+ *
81
+ * Follows the Agent Skills open standard (agentskills.io/specification).
82
+ */
83
+ interface SkillResource {
84
+ /** Relative path from skill directory */
85
+ path: string;
86
+ /** Resource type inferred from directory */
87
+ type: 'script' | 'reference' | 'asset' | 'other';
88
+ }
89
+ interface SkillConfig {
90
+ /** Skill name: 1-64 chars, lowercase alphanumeric + hyphens */
91
+ name: string;
92
+ /** What the skill does and when to use it (1-1024 chars) */
93
+ description: string;
94
+ /** The SKILL.md body content (after YAML frontmatter) */
95
+ instructions: string;
96
+ /** Absolute path to SKILL.md (undefined for inline skills) */
97
+ location?: string;
98
+ /** Skill directory path for resolving relative references */
99
+ baseDir?: string;
100
+ /** License identifier or reference */
101
+ license?: string;
102
+ /** Environment requirements */
103
+ compatibility?: string;
104
+ /** Arbitrary key-value metadata */
105
+ metadata?: Record<string, string>;
106
+ /** Pre-approved tool names (experimental) */
107
+ allowedTools?: string[];
108
+ /** Bundled resource files discovered in the skill directory */
109
+ resources?: SkillResource[];
110
+ /** Model override when this skill is active */
111
+ model?: string;
112
+ /** Thinking/reasoning level override when this skill is active */
113
+ thinking?: 'off' | 'minimal' | 'low' | 'medium' | 'high';
114
+ /**
115
+ * Glob patterns that limit when this skill auto-activates.
116
+ * When set, the skill is only included in the catalog when
117
+ * the agent is working with files matching these patterns.
118
+ */
119
+ paths?: string[];
120
+ }
121
+ interface SkillsConfig {
122
+ /**
123
+ * Control which skills are active.
124
+ * - `true` (default): all discovered skills are enabled
125
+ * - `false` or `[]`: fully disable the skills system (no resolution, no catalog, no hooks)
126
+ * - `string[]`: allowlist — only skills with matching names are enabled
127
+ */
128
+ enabled?: boolean | string[];
129
+ /** Directories to scan for SKILL.md files */
130
+ scan?: string[];
131
+ /** Dynamic skills written to disk at agent start, then loaded normally */
132
+ write?: SkillConfig[];
133
+ /** Tool name the agent should use to read skill files (default: 'read_file') */
134
+ readToolName?: string;
135
+ /** Skill names to exclude from the catalog */
136
+ exclude?: string[];
137
+ /** Skip default scan paths (~/.agents/skills, .zidane/skills, etc.) */
138
+ skipDefaultPaths?: boolean;
139
+ }
140
+
141
+ export type { ContextCapabilities as C, ExecutionContext as E, SpawnConfig as S, ExecResult as a, ContextType as b, ExecutionHandle as c, SkillConfig as d, SkillResource as e, SkillsConfig as f };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zidane",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "an agent that goes straight to the goal",
5
5
  "type": "module",
6
6
  "private": false,
@@ -38,6 +38,10 @@
38
38
  "./session": {
39
39
  "import": "./dist/session.js",
40
40
  "types": "./dist/session.d.ts"
41
+ },
42
+ "./skills": {
43
+ "import": "./dist/skills.js",
44
+ "types": "./dist/skills.d.ts"
41
45
  }
42
46
  },
43
47
  "main": "./dist/index.js",
@@ -1,45 +0,0 @@
1
- import {
2
- init_spawn,
3
- listFiles,
4
- readFile,
5
- shell,
6
- spawn_exports,
7
- writeFile
8
- } from "./chunk-27EP7HB3.js";
9
- import {
10
- __toCommonJS
11
- } from "./chunk-PNKVD2UK.js";
12
-
13
- // src/harnesses/basic.ts
14
- var basicTools = { shell, readFile, writeFile, listFiles };
15
- var _spawn;
16
- function getSpawn() {
17
- if (!_spawn) {
18
- _spawn = (init_spawn(), __toCommonJS(spawn_exports)).spawn;
19
- }
20
- return _spawn;
21
- }
22
- var spawnProxy = {
23
- get spec() {
24
- return getSpawn().spec;
25
- },
26
- execute(input, ctx) {
27
- return getSpawn().execute(input, ctx);
28
- }
29
- };
30
- var basic_default = defineHarness({
31
- name: "basic",
32
- system: "You are a helpful assistant with access to shell, file reading, file writing, directory listing, and sub-agent spawning tools. Use them to accomplish tasks in the project directory.",
33
- tools: { ...basicTools, spawn: spawnProxy }
34
- });
35
-
36
- // src/harnesses/index.ts
37
- function defineHarness(config) {
38
- return config;
39
- }
40
-
41
- export {
42
- basicTools,
43
- basic_default,
44
- defineHarness
45
- };