@robota-sdk/agent-sdk 3.0.0-beta.7 → 3.0.0-beta.9

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.
@@ -96,7 +96,7 @@ function buildToolsSection(descriptions) {
96
96
  return lines.join("\n");
97
97
  }
98
98
  function buildSystemPrompt(params) {
99
- const { agentsMd, claudeMd, toolDescriptions, trustLevel, projectInfo } = params;
99
+ const { agentsMd, claudeMd, toolDescriptions, trustLevel, projectInfo, cwd } = params;
100
100
  const sections = [];
101
101
  sections.push(
102
102
  [
@@ -106,6 +106,10 @@ function buildSystemPrompt(params) {
106
106
  "Always be precise, follow existing code conventions, and prefer minimal changes."
107
107
  ].join("\n")
108
108
  );
109
+ if (cwd) {
110
+ sections.push(`## Working Directory
111
+ \`${cwd}\``);
112
+ }
109
113
  sections.push(buildProjectSection(projectInfo));
110
114
  sections.push(
111
115
  [
@@ -181,14 +185,27 @@ function createSession(options) {
181
185
  claudeMd: options.context.claudeMd,
182
186
  toolDescriptions: options.toolDescriptions ?? DEFAULT_TOOL_DESCRIPTIONS,
183
187
  trustLevel: options.config.defaultTrustLevel,
184
- projectInfo: options.projectInfo ?? { type: "unknown", language: "unknown" }
188
+ projectInfo: options.projectInfo ?? { type: "unknown", language: "unknown" },
189
+ cwd: process.cwd()
185
190
  });
191
+ const defaultAllow = [
192
+ "Read(.agents/**)",
193
+ "Read(.claude/**)",
194
+ "Read(.robota/**)",
195
+ "Glob(.agents/**)",
196
+ "Glob(.claude/**)",
197
+ "Glob(.robota/**)"
198
+ ];
199
+ const mergedPermissions = {
200
+ allow: [...defaultAllow, ...options.config.permissions.allow ?? []],
201
+ deny: options.config.permissions.deny ?? []
202
+ };
186
203
  return new import_agent_sessions.Session({
187
204
  tools,
188
205
  provider,
189
206
  systemMessage,
190
207
  terminal: options.terminal,
191
- permissions: options.config.permissions,
208
+ permissions: mergedPermissions,
192
209
  hooks: options.config.hooks,
193
210
  permissionMode: options.permissionMode,
194
211
  defaultTrustLevel: options.config.defaultTrustLevel,
@@ -235,6 +235,8 @@ interface ISystemPromptParams {
235
235
  trustLevel: TTrustLevel;
236
236
  /** Detected project metadata */
237
237
  projectInfo: IProjectInfo;
238
+ /** Current working directory */
239
+ cwd?: string;
238
240
  }
239
241
  /**
240
242
  * Assemble the full system prompt string from the provided parameters.
@@ -235,6 +235,8 @@ interface ISystemPromptParams {
235
235
  trustLevel: TTrustLevel;
236
236
  /** Detected project metadata */
237
237
  projectInfo: IProjectInfo;
238
+ /** Current working directory */
239
+ cwd?: string;
238
240
  }
239
241
  /**
240
242
  * Assemble the full system prompt string from the provided parameters.
@@ -34,7 +34,7 @@ function buildToolsSection(descriptions) {
34
34
  return lines.join("\n");
35
35
  }
36
36
  function buildSystemPrompt(params) {
37
- const { agentsMd, claudeMd, toolDescriptions, trustLevel, projectInfo } = params;
37
+ const { agentsMd, claudeMd, toolDescriptions, trustLevel, projectInfo, cwd } = params;
38
38
  const sections = [];
39
39
  sections.push(
40
40
  [
@@ -44,6 +44,10 @@ function buildSystemPrompt(params) {
44
44
  "Always be precise, follow existing code conventions, and prefer minimal changes."
45
45
  ].join("\n")
46
46
  );
47
+ if (cwd) {
48
+ sections.push(`## Working Directory
49
+ \`${cwd}\``);
50
+ }
47
51
  sections.push(buildProjectSection(projectInfo));
48
52
  sections.push(
49
53
  [
@@ -128,14 +132,27 @@ function createSession(options) {
128
132
  claudeMd: options.context.claudeMd,
129
133
  toolDescriptions: options.toolDescriptions ?? DEFAULT_TOOL_DESCRIPTIONS,
130
134
  trustLevel: options.config.defaultTrustLevel,
131
- projectInfo: options.projectInfo ?? { type: "unknown", language: "unknown" }
135
+ projectInfo: options.projectInfo ?? { type: "unknown", language: "unknown" },
136
+ cwd: process.cwd()
132
137
  });
138
+ const defaultAllow = [
139
+ "Read(.agents/**)",
140
+ "Read(.claude/**)",
141
+ "Read(.robota/**)",
142
+ "Glob(.agents/**)",
143
+ "Glob(.claude/**)",
144
+ "Glob(.robota/**)"
145
+ ];
146
+ const mergedPermissions = {
147
+ allow: [...defaultAllow, ...options.config.permissions.allow ?? []],
148
+ deny: options.config.permissions.deny ?? []
149
+ };
133
150
  return new Session({
134
151
  tools,
135
152
  provider,
136
153
  systemMessage,
137
154
  terminal: options.terminal,
138
- permissions: options.config.permissions,
155
+ permissions: mergedPermissions,
139
156
  hooks: options.config.hooks,
140
157
  permissionMode: options.permissionMode,
141
158
  defaultTrustLevel: options.config.defaultTrustLevel,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robota-sdk/agent-sdk",
3
- "version": "3.0.0-beta.7",
3
+ "version": "3.0.0-beta.9",
4
4
  "description": "Programmatic SDK for building AI agents with Robota — provides Session, query(), built-in tools, permissions, hooks, and context loading",
5
5
  "type": "module",
6
6
  "main": "dist/node/index.js",
@@ -24,10 +24,10 @@
24
24
  "dependencies": {
25
25
  "chalk": "^5.3.0",
26
26
  "zod": "^3.24.0",
27
- "@robota-sdk/agent-core": "3.0.0-beta.7",
28
- "@robota-sdk/agent-provider-anthropic": "3.0.0-beta.7",
29
- "@robota-sdk/agent-sessions": "3.0.0-beta.7",
30
- "@robota-sdk/agent-tools": "3.0.0-beta.7"
27
+ "@robota-sdk/agent-core": "3.0.0-beta.9",
28
+ "@robota-sdk/agent-provider-anthropic": "3.0.0-beta.9",
29
+ "@robota-sdk/agent-sessions": "3.0.0-beta.9",
30
+ "@robota-sdk/agent-tools": "3.0.0-beta.9"
31
31
  },
32
32
  "devDependencies": {
33
33
  "rimraf": "^5.0.5",