@google/gemini-cli 0.57.0-preview.1 → 0.58.0-preview.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.
Files changed (74) hide show
  1. package/bundle/{chunk-3BVBON3V.js → chunk-2BLMLPHM.js} +1 -1
  2. package/bundle/{chunk-GK7NUJ35.js → chunk-2DH4DX65.js} +1 -1
  3. package/bundle/{chunk-ZMPGHLGO.js → chunk-2XOTT2FI.js} +2 -2
  4. package/bundle/{chunk-S5UX3QS5.js → chunk-4FKXMALD.js} +3 -3
  5. package/bundle/{chunk-O7SBKM7M.js → chunk-4KFMA4KD.js} +242 -106
  6. package/bundle/{chunk-UMQE7UC6.js → chunk-6EGII27G.js} +3 -3
  7. package/bundle/{chunk-VBK54QCZ.js → chunk-7HQEQECM.js} +1 -1
  8. package/bundle/{chunk-RLDNUS35.js → chunk-BOI2NL3I.js} +1 -1
  9. package/bundle/{chunk-EAK33LFP.js → chunk-CNAVMEMA.js} +1 -1
  10. package/bundle/{chunk-AKCYXG7C.js → chunk-E7K62ODO.js} +7 -7
  11. package/bundle/{chunk-ALVDOQNA.js → chunk-FJTXPUG2.js} +1 -1
  12. package/bundle/{chunk-4ALCU2HQ.js → chunk-FMLOQLUD.js} +5 -8
  13. package/bundle/{chunk-MBWROXYM.js → chunk-GNLIR4RW.js} +2 -2
  14. package/bundle/{chunk-GMQ6QNZB.js → chunk-JCGNL7TH.js} +1 -1
  15. package/bundle/{chunk-65C235NM.js → chunk-JO5YRKX4.js} +7 -7
  16. package/bundle/{chunk-3NPMAHLX.js → chunk-JPMNKIVX.js} +1 -1
  17. package/bundle/{chunk-NPOI4K6X.js → chunk-M33HH4UA.js} +14468 -7648
  18. package/bundle/{chunk-NQ4RH42O.js → chunk-OEY2TDVE.js} +8 -9
  19. package/bundle/{chunk-W23OOD2C.js → chunk-PGYTXBPD.js} +3 -3
  20. package/bundle/{chunk-SCBVGZXH.js → chunk-PXFYRLFH.js} +1 -1
  21. package/bundle/{chunk-Q73BPF7A.js → chunk-RBQHWQSS.js} +1 -1
  22. package/bundle/{chunk-G65GW52B.js → chunk-TYMOJXZO.js} +181 -45
  23. package/bundle/{chunk-FHDRG5U4.js → chunk-WE4JKUV6.js} +54 -67
  24. package/bundle/{chunk-NMMXRZ53.js → chunk-WHCFVERV.js} +2 -2
  25. package/bundle/{cleanup-2W5DPMY3.js → cleanup-KTXX3JEU.js} +2 -2
  26. package/bundle/{cleanup-OTHE7RNU.js → cleanup-NLNXSTS6.js} +2 -2
  27. package/bundle/{cleanup-SM67K64R.js → cleanup-RW3JYSTT.js} +2 -2
  28. package/bundle/{core-US34OW5M.js → core-SU4ABXSV.js} +3 -1
  29. package/bundle/{dist-5TYMQVIZ.js → core-WFITWJMX.js} +3 -1
  30. package/bundle/{devtoolsService-GU2GQSOF.js → devtoolsService-BUAVSMN6.js} +2 -2
  31. package/bundle/{devtoolsService-5J53UK6Z.js → devtoolsService-MNBGW66M.js} +2 -2
  32. package/bundle/{devtoolsService-JBFUXTCT.js → devtoolsService-P42LXPJX.js} +3 -4
  33. package/bundle/{dist-OWKHVWTR.js → dist-2CGQYGZC.js} +3 -1
  34. package/bundle/docs/changelogs/preview.md +78 -94
  35. package/bundle/{gemini-LSMTDETS.js → gemini-3PHRRMWS.js} +266 -20
  36. package/bundle/{gemini-W2B6CLJC.js → gemini-BUCCXM4N.js} +450 -220
  37. package/bundle/{gemini-3M22N2C3.js → gemini-VIRT6VT3.js} +266 -20
  38. package/bundle/gemini.js +7 -7
  39. package/bundle/{interactiveCli-LQJM6LRE.js → interactiveCli-BP2ZFGLX.js} +8 -9
  40. package/bundle/{interactiveCli-L3ZXOVEV.js → interactiveCli-GGARXT6P.js} +296 -316
  41. package/bundle/{interactiveCli-D6H37PJQ.js → interactiveCli-N6VXS5Z4.js} +8 -9
  42. package/bundle/{liteRtServerManager-3BY6TBHG.js → liteRtServerManager-L46MRFSW.js} +4 -4
  43. package/bundle/{liteRtServerManager-C5WZRQUF.js → liteRtServerManager-QUODN3RR.js} +4 -4
  44. package/bundle/{liteRtServerManager-IGKUGGP4.js → liteRtServerManager-YLOGF7RQ.js} +4 -4
  45. package/bundle/{oauth2-provider-KSRLPOK3.js → oauth2-provider-BKWSLZJ6.js} +1 -1
  46. package/bundle/{oauth2-provider-VHNLCU4Y.js → oauth2-provider-IIC2YPC5.js} +72 -38
  47. package/bundle/{oauth2-provider-RWKTMYJF.js → oauth2-provider-KVIL4ITH.js} +1 -1
  48. package/bundle/policies/write.toml +10 -2
  49. package/bundle/sandbox-macos-permissive-open.sb +50 -0
  50. package/bundle/sandbox-macos-permissive-proxied.sb +50 -0
  51. package/bundle/sandbox-macos-restrictive-open.sb +50 -1
  52. package/bundle/sandbox-macos-restrictive-proxied.sb +50 -0
  53. package/bundle/sandbox-macos-strict-open.sb +50 -0
  54. package/bundle/sandbox-macos-strict-proxied.sb +50 -0
  55. package/bundle/{start-EXAQFM4Y.js → start-2365H4YX.js} +6 -6
  56. package/bundle/{start-IPZF32E3.js → start-VPQOFEIR.js} +6 -6
  57. package/bundle/{start-SVNTSNHV.js → start-Y7LKFE47.js} +6 -6
  58. package/package.json +1 -1
  59. package/bundle/chunk-4SNEOO5E.js +0 -398
  60. package/bundle/chunk-LNXGFWGZ.js +0 -17332
  61. package/bundle/chunk-QJP6CMLN.js +0 -118
  62. package/bundle/chunk-SWQAIZEQ.js +0 -102506
  63. package/bundle/chunk-VGGWKRAC.js +0 -154
  64. package/bundle/chunk-WDFSF5L4.js +0 -397601
  65. package/bundle/chunk-XESAM7IL.js +0 -512
  66. package/bundle/chunk-Y3APL4PE.js +0 -1571
  67. package/bundle/cleanup-XAUT5CMD.js +0 -32
  68. package/bundle/devtoolsService-V46GUHRF.js +0 -4359
  69. package/bundle/dist-V5VJYW6J.js +0 -2180
  70. package/bundle/gemini-OZOYJF22.js +0 -17091
  71. package/bundle/interactiveCli-RGOYDSMH.js +0 -34984
  72. package/bundle/liteRtServerManager-IJ4I2PZA.js +0 -65
  73. package/bundle/oauth2-provider-ZT4OFVMK.js +0 -235
  74. package/bundle/start-ZXU5BFZY.js +0 -18
@@ -157,10 +157,10 @@ import {
157
157
  widestLineFromStyledChars,
158
158
  wordBreakStyledChars,
159
159
  wrapStyledChars
160
- } from "./chunk-FHDRG5U4.js";
160
+ } from "./chunk-JO5YRKX4.js";
161
161
  import {
162
162
  require_source
163
- } from "./chunk-Y3APL4PE.js";
163
+ } from "./chunk-PXFYRLFH.js";
164
164
  import {
165
165
  appEvents
166
166
  } from "./chunk-5PS3AYFU.js";
@@ -214,24 +214,24 @@ import {
214
214
  stripAnsi,
215
215
  stripUnsafeCharacters,
216
216
  toCodePoints
217
- } from "./chunk-GK7NUJ35.js";
217
+ } from "./chunk-2DH4DX65.js";
218
218
  import {
219
219
  handleAutoUpdate,
220
220
  isDevelopment,
221
221
  relaunchApp,
222
222
  setUpdateHandler
223
- } from "./chunk-MBWROXYM.js";
223
+ } from "./chunk-GNLIR4RW.js";
224
224
  import {
225
225
  isTodoList,
226
226
  mapCoreStatusToDisplayStatus,
227
227
  require_react
228
- } from "./chunk-XESAM7IL.js";
228
+ } from "./chunk-JCGNL7TH.js";
229
229
  import {
230
230
  registerCleanup,
231
231
  removeCleanup,
232
232
  runExitCleanup,
233
233
  setupTtyCheck
234
- } from "./chunk-3NPMAHLX.js";
234
+ } from "./chunk-CNAVMEMA.js";
235
235
  import {
236
236
  ACTIVATE_SKILL_TOOL_NAME,
237
237
  AGENT_TOOL_NAME,
@@ -437,7 +437,7 @@ import {
437
437
  validatePlanContent,
438
438
  validatePlanPath,
439
439
  writeToStdout
440
- } from "./chunk-G65GW52B.js";
440
+ } from "./chunk-TYMOJXZO.js";
441
441
  import "./chunk-664ZODQF.js";
442
442
  import "./chunk-IUUIT4SU.js";
443
443
  import "./chunk-TUDYL3X4.js";
@@ -28541,7 +28541,6 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28541
28541
  geminiClient.getHistory().slice(0, targetLength)
28542
28542
  );
28543
28543
  }
28544
- historyLengthAfterUserPromptRef.current = void 0;
28545
28544
  }
28546
28545
  const callIdsToMarkAsSubmitted2 = geminiTools.map(
28547
28546
  (toolCall) => toolCall.request.callId
@@ -33965,7 +33964,7 @@ ${queuedText}` : queuedText;
33965
33964
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33966
33965
  if (settings.merged.general.devtools) {
33967
33966
  void (async () => {
33968
- const { toggleDevToolsPanel } = await import("./devtoolsService-JBFUXTCT.js");
33967
+ const { toggleDevToolsPanel } = await import("./devtoolsService-BUAVSMN6.js");
33969
33968
  await toggleDevToolsPanel(
33970
33969
  config,
33971
33970
  showErrorDetails,
@@ -3,11 +3,11 @@ import {
3
3
  DEFAULT_PORT,
4
4
  getBinaryPath,
5
5
  isServerRunning
6
- } from "./chunk-ALVDOQNA.js";
7
- import "./chunk-VBK54QCZ.js";
6
+ } from "./chunk-FJTXPUG2.js";
7
+ import "./chunk-OEY2TDVE.js";
8
8
  import {
9
9
  debugLogger
10
- } from "./chunk-O7SBKM7M.js";
10
+ } from "./chunk-4KFMA4KD.js";
11
11
  import "./chunk-664ZODQF.js";
12
12
  import "./chunk-IUUIT4SU.js";
13
13
  import "./chunk-TUDYL3X4.js";
@@ -41,7 +41,7 @@ var LiteRtServerManager = class {
41
41
  `[LiteRtServerManager] Auto-starting LiteRT server on port ${port}...`
42
42
  );
43
43
  try {
44
- const { startServer } = await import("./start-EXAQFM4Y.js");
44
+ const { startServer } = await import("./start-2365H4YX.js");
45
45
  const started = await startServer(binaryPath, port);
46
46
  if (started) {
47
47
  debugLogger.log(`[LiteRtServerManager] Server started on port ${port}`);
@@ -3,11 +3,11 @@ import {
3
3
  DEFAULT_PORT,
4
4
  getBinaryPath,
5
5
  isServerRunning
6
- } from "./chunk-LNXGFWGZ.js";
7
- import "./chunk-GMQ6QNZB.js";
6
+ } from "./chunk-2DH4DX65.js";
7
+ import "./chunk-JCGNL7TH.js";
8
8
  import {
9
9
  debugLogger
10
- } from "./chunk-WDFSF5L4.js";
10
+ } from "./chunk-TYMOJXZO.js";
11
11
  import "./chunk-664ZODQF.js";
12
12
  import "./chunk-IUUIT4SU.js";
13
13
  import "./chunk-TUDYL3X4.js";
@@ -41,7 +41,7 @@ var LiteRtServerManager = class {
41
41
  `[LiteRtServerManager] Auto-starting LiteRT server on port ${port}...`
42
42
  );
43
43
  try {
44
- const { startServer } = await import("./start-SVNTSNHV.js");
44
+ const { startServer } = await import("./start-Y7LKFE47.js");
45
45
  const started = await startServer(binaryPath, port);
46
46
  if (started) {
47
47
  debugLogger.log(`[LiteRtServerManager] Server started on port ${port}`);
@@ -3,11 +3,11 @@ import {
3
3
  DEFAULT_PORT,
4
4
  getBinaryPath,
5
5
  isServerRunning
6
- } from "./chunk-GK7NUJ35.js";
7
- import "./chunk-XESAM7IL.js";
6
+ } from "./chunk-FMLOQLUD.js";
7
+ import "./chunk-7HQEQECM.js";
8
8
  import {
9
9
  debugLogger
10
- } from "./chunk-G65GW52B.js";
10
+ } from "./chunk-M33HH4UA.js";
11
11
  import "./chunk-664ZODQF.js";
12
12
  import "./chunk-IUUIT4SU.js";
13
13
  import "./chunk-TUDYL3X4.js";
@@ -41,7 +41,7 @@ var LiteRtServerManager = class {
41
41
  `[LiteRtServerManager] Auto-starting LiteRT server on port ${port}...`
42
42
  );
43
43
  try {
44
- const { startServer } = await import("./start-ZXU5BFZY.js");
44
+ const { startServer } = await import("./start-VPQOFEIR.js");
45
45
  const started = await startServer(binaryPath, port);
46
46
  if (started) {
47
47
  debugLogger.log(`[LiteRtServerManager] Server started on port ${port}`);
@@ -16,7 +16,7 @@ import {
16
16
  openBrowserSecurely,
17
17
  refreshAccessToken,
18
18
  startCallbackServer
19
- } from "./chunk-O7SBKM7M.js";
19
+ } from "./chunk-M33HH4UA.js";
20
20
  import "./chunk-664ZODQF.js";
21
21
  import "./chunk-IUUIT4SU.js";
22
22
  import "./chunk-TUDYL3X4.js";
@@ -16,35 +16,35 @@ import {
16
16
  openBrowserSecurely,
17
17
  refreshAccessToken,
18
18
  startCallbackServer
19
- } from "./chunk-NPOI4K6X.js";
19
+ } from "./chunk-4KFMA4KD.js";
20
20
  import "./chunk-664ZODQF.js";
21
21
  import "./chunk-IUUIT4SU.js";
22
22
  import "./chunk-TUDYL3X4.js";
23
23
  import "./chunk-34MYV7JD.js";
24
24
 
25
- // packages/core/dist/src/agents/auth-provider/oauth2-provider.js
25
+ // packages/core/src/agents/auth-provider/oauth2-provider.ts
26
26
  var OAuth2AuthProvider = class extends BaseA2AAuthProvider {
27
- config;
28
- agentName;
29
- agentCardUrl;
30
- type = "oauth2";
31
- tokenStorage;
32
- cachedToken = null;
33
- /** Resolved OAuth URLs — may come from config or agent card. */
34
- authorizationUrl;
35
- tokenUrl;
36
- scopes;
37
27
  constructor(config, agentName, agentCard, agentCardUrl) {
38
28
  super();
39
29
  this.config = config;
40
30
  this.agentName = agentName;
41
31
  this.agentCardUrl = agentCardUrl;
42
- this.tokenStorage = new MCPOAuthTokenStorage(Storage.getA2AOAuthTokensPath(), "gemini-cli-a2a");
32
+ this.tokenStorage = new MCPOAuthTokenStorage(
33
+ Storage.getA2AOAuthTokensPath(),
34
+ "gemini-cli-a2a"
35
+ );
43
36
  this.authorizationUrl = config.authorization_url;
44
37
  this.tokenUrl = config.token_url;
45
38
  this.scopes = config.scopes;
46
39
  this.mergeAgentCardDefaults(agentCard);
47
40
  }
41
+ type = "oauth2";
42
+ tokenStorage;
43
+ cachedToken = null;
44
+ /** Resolved OAuth URLs — may come from config or agent card. */
45
+ authorizationUrl;
46
+ tokenUrl;
47
+ scopes;
48
48
  /**
49
49
  * Initialize the provider by loading any persisted token from storage.
50
50
  * Also discovers OAuth URLs from the agent card if not yet resolved.
@@ -56,7 +56,9 @@ var OAuth2AuthProvider = class extends BaseA2AAuthProvider {
56
56
  const credentials = await this.tokenStorage.getCredentials(this.agentName);
57
57
  if (credentials && !this.tokenStorage.isTokenExpired(credentials.token)) {
58
58
  this.cachedToken = credentials.token;
59
- debugLogger.debug(`[OAuth2AuthProvider] Loaded valid cached token for "${this.agentName}"`);
59
+ debugLogger.debug(
60
+ `[OAuth2AuthProvider] Loaded valid cached token for "${this.agentName}"`
61
+ );
60
62
  }
61
63
  }
62
64
  /**
@@ -69,16 +71,25 @@ var OAuth2AuthProvider = class extends BaseA2AAuthProvider {
69
71
  }
70
72
  if (this.cachedToken?.refreshToken && this.tokenUrl && this.config.client_id) {
71
73
  try {
72
- const refreshed = await refreshAccessToken({
73
- clientId: this.config.client_id,
74
- clientSecret: this.config.client_secret,
75
- scopes: this.scopes
76
- }, this.cachedToken.refreshToken, this.tokenUrl);
77
- this.cachedToken = this.toOAuthToken(refreshed, this.cachedToken.refreshToken);
74
+ const refreshed = await refreshAccessToken(
75
+ {
76
+ clientId: this.config.client_id,
77
+ clientSecret: this.config.client_secret,
78
+ scopes: this.scopes
79
+ },
80
+ this.cachedToken.refreshToken,
81
+ this.tokenUrl
82
+ );
83
+ this.cachedToken = this.toOAuthToken(
84
+ refreshed,
85
+ this.cachedToken.refreshToken
86
+ );
78
87
  await this.persistToken();
79
88
  return { Authorization: `Bearer ${this.cachedToken.accessToken}` };
80
89
  } catch (error) {
81
- debugLogger.debug(`[OAuth2AuthProvider] Refresh failed, falling back to interactive flow: ${getErrorMessage(error)}`);
90
+ debugLogger.debug(
91
+ `[OAuth2AuthProvider] Refresh failed, falling back to interactive flow: ${getErrorMessage(error)}`
92
+ );
82
93
  await this.tokenStorage.deleteCredentials(this.agentName);
83
94
  }
84
95
  }
@@ -97,7 +108,9 @@ var OAuth2AuthProvider = class extends BaseA2AAuthProvider {
97
108
  return void 0;
98
109
  }
99
110
  this.authRetryCount++;
100
- debugLogger.debug("[OAuth2AuthProvider] Auth failure, clearing token and re-authenticating");
111
+ debugLogger.debug(
112
+ "[OAuth2AuthProvider] Auth failure, clearing token and re-authenticating"
113
+ );
101
114
  this.cachedToken = null;
102
115
  await this.tokenStorage.deleteCredentials(this.agentName);
103
116
  return this.headers();
@@ -110,8 +123,7 @@ var OAuth2AuthProvider = class extends BaseA2AAuthProvider {
110
123
  * `securitySchemes` when not already provided via user config.
111
124
  */
112
125
  mergeAgentCardDefaults(agentCard) {
113
- if (!agentCard?.securitySchemes)
114
- return;
126
+ if (!agentCard?.securitySchemes) return;
115
127
  for (const scheme of Object.values(agentCard.securitySchemes)) {
116
128
  if (scheme.type === "oauth2" && scheme.flows.authorizationCode) {
117
129
  const flow = scheme.flows.authorizationCode;
@@ -127,15 +139,18 @@ var OAuth2AuthProvider = class extends BaseA2AAuthProvider {
127
139
  * (which normalizes proto-format cards) and extract OAuth2 URLs.
128
140
  */
129
141
  async fetchAgentCardDefaults() {
130
- if (!this.agentCardUrl)
131
- return;
142
+ if (!this.agentCardUrl) return;
132
143
  try {
133
- debugLogger.debug(`[OAuth2AuthProvider] Fetching agent card from ${this.agentCardUrl}`);
144
+ debugLogger.debug(
145
+ `[OAuth2AuthProvider] Fetching agent card from ${this.agentCardUrl}`
146
+ );
134
147
  const resolver = new DefaultAgentCardResolver();
135
148
  const card = await resolver.resolve(this.agentCardUrl, "");
136
149
  this.mergeAgentCardDefaults(card);
137
150
  } catch (error) {
138
- debugLogger.warn(`[OAuth2AuthProvider] Could not fetch agent card for OAuth URL discovery: ${getErrorMessage(error)}`);
151
+ debugLogger.warn(
152
+ `[OAuth2AuthProvider] Could not fetch agent card for OAuth URL discovery: ${getErrorMessage(error)}`
153
+ );
139
154
  }
140
155
  }
141
156
  /**
@@ -143,10 +158,14 @@ var OAuth2AuthProvider = class extends BaseA2AAuthProvider {
143
158
  */
144
159
  async authenticateInteractively() {
145
160
  if (!this.config.client_id) {
146
- throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires a client_id. Add client_id to the auth config in your agent definition.`);
161
+ throw new Error(
162
+ `OAuth2 authentication for agent "${this.agentName}" requires a client_id. Add client_id to the auth config in your agent definition.`
163
+ );
147
164
  }
148
165
  if (!this.authorizationUrl || !this.tokenUrl) {
149
- throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires authorization_url and token_url. Provide them in the auth config or ensure the agent card exposes an oauth2 security scheme.`);
166
+ throw new Error(
167
+ `OAuth2 authentication for agent "${this.agentName}" requires authorization_url and token_url. Provide them in the auth config or ensure the agent card exposes an oauth2 security scheme.`
168
+ );
150
169
  }
151
170
  const flowConfig = {
152
171
  clientId: this.config.client_id,
@@ -165,25 +184,36 @@ var OAuth2AuthProvider = class extends BaseA2AAuthProvider {
165
184
  redirectPort,
166
185
  /* resource= */
167
186
  void 0
187
+ // No MCP resource parameter for A2A.
188
+ );
189
+ const consent = await getConsentForOauth(
190
+ `Authentication required for A2A agent: '${this.agentName}'.`
168
191
  );
169
- const consent = await getConsentForOauth(`Authentication required for A2A agent: '${this.agentName}'.`);
170
192
  if (!consent) {
171
193
  throw new FatalCancellationError("Authentication cancelled by user.");
172
194
  }
173
- coreEvents.emitFeedback("info", `\u2192 Opening your browser for OAuth sign-in...
195
+ coreEvents.emitFeedback(
196
+ "info",
197
+ `\u2192 Opening your browser for OAuth sign-in...
174
198
 
175
199
  If the browser does not open, copy and paste this URL into your browser:
176
200
  ${authUrl}
177
201
 
178
202
  \u{1F4A1} TIP: Triple-click to select the entire URL, then copy and paste it into your browser.
179
- \u26A0\uFE0F Make sure to copy the COMPLETE URL - it may wrap across multiple lines.`);
203
+ \u26A0\uFE0F Make sure to copy the COMPLETE URL - it may wrap across multiple lines.`
204
+ );
180
205
  try {
181
206
  await openBrowserSecurely(authUrl);
182
207
  } catch (error) {
183
- debugLogger.warn("Failed to open browser automatically:", getErrorMessage(error));
208
+ debugLogger.warn(
209
+ "Failed to open browser automatically:",
210
+ getErrorMessage(error)
211
+ );
184
212
  }
185
213
  const { code } = await callbackServer.response;
186
- debugLogger.debug("\u2713 Authorization code received, exchanging for tokens...");
214
+ debugLogger.debug(
215
+ "\u2713 Authorization code received, exchanging for tokens..."
216
+ );
187
217
  const tokenResponse = await exchangeCodeForToken(
188
218
  flowConfig,
189
219
  code,
@@ -220,9 +250,13 @@ ${authUrl}
220
250
  * Persist the current cached token to disk.
221
251
  */
222
252
  async persistToken() {
223
- if (!this.cachedToken)
224
- return;
225
- await this.tokenStorage.saveToken(this.agentName, this.cachedToken, this.config.client_id, this.tokenUrl);
253
+ if (!this.cachedToken) return;
254
+ await this.tokenStorage.saveToken(
255
+ this.agentName,
256
+ this.cachedToken,
257
+ this.config.client_id,
258
+ this.tokenUrl
259
+ );
226
260
  }
227
261
  };
228
262
  export {
@@ -16,7 +16,7 @@ import {
16
16
  openBrowserSecurely,
17
17
  refreshAccessToken,
18
18
  startCallbackServer
19
- } from "./chunk-WDFSF5L4.js";
19
+ } from "./chunk-TYMOJXZO.js";
20
20
  import "./chunk-664ZODQF.js";
21
21
  import "./chunk-IUUIT4SU.js";
22
22
  import "./chunk-TUDYL3X4.js";
@@ -39,7 +39,11 @@ decision = "allow"
39
39
  priority = 15
40
40
  modes = ["autoEdit"]
41
41
 
42
- [rule.safety_checker]
42
+ [[safety_checker]]
43
+ toolName = "replace"
44
+ priority = 15
45
+ modes = ["autoEdit"]
46
+ [safety_checker.checker]
43
47
  type = "in-process"
44
48
  name = "allowed-path"
45
49
  required_context = ["environment"]
@@ -68,7 +72,11 @@ decision = "allow"
68
72
  priority = 15
69
73
  modes = ["autoEdit"]
70
74
 
71
- [rule.safety_checker]
75
+ [[safety_checker]]
76
+ toolName = "write_file"
77
+ priority = 15
78
+ modes = ["autoEdit"]
79
+ [safety_checker.checker]
72
80
  type = "in-process"
73
81
  name = "allowed-path"
74
82
  required_context = ["environment"]
@@ -133,3 +133,53 @@
133
133
 
134
134
  ;; allow all outbound network traffic
135
135
  (allow network-outbound)
136
+
137
+ ;; Block Docker & container daemon UNIX domain sockets (read & write)
138
+ (deny file-read* file-write*
139
+ (literal "/var/run/docker.sock")
140
+ (literal "/var/run/docker.sock.raw")
141
+ (literal "/private/var/run/docker.sock")
142
+ (literal "/private/var/run/docker.sock.raw")
143
+ (subpath "/var/run/docker")
144
+ (subpath "/private/var/run/docker")
145
+ (subpath "/Users/Shared/.docker")
146
+ (subpath (string-append (param "HOME_DIR") "/.docker/run"))
147
+ (subpath (string-append (param "HOME_DIR") "/.docker/desktop"))
148
+ (subpath (string-append (param "HOME_DIR") "/.colima"))
149
+ (subpath (string-append (param "HOME_DIR") "/.orbstack/run"))
150
+ (subpath (string-append (param "HOME_DIR") "/.rd"))
151
+ )
152
+
153
+ ;; Block container CLI and daemon binaries from execution
154
+ (deny process-exec
155
+ (literal "/usr/local/bin/docker")
156
+ (literal "/usr/local/bin/dockerd")
157
+ (literal "/usr/local/bin/docker-compose")
158
+ (literal "/usr/bin/docker")
159
+ (literal "/opt/homebrew/bin/docker")
160
+ (literal "/opt/homebrew/bin/dockerd")
161
+ (literal "/opt/homebrew/bin/docker-compose")
162
+ (literal "/opt/homebrew/bin/podman")
163
+ (literal "/usr/local/bin/podman")
164
+ (literal "/opt/homebrew/bin/colima")
165
+ (literal "/usr/local/bin/colima")
166
+ (literal "/opt/homebrew/bin/orb")
167
+ (literal "/Applications/Docker.app/Contents/Resources/bin/docker")
168
+ (subpath "/Applications/Docker.app/Contents/MacOS/")
169
+ (subpath "/Applications/OrbStack.app/Contents/MacOS/")
170
+ (subpath "/Applications/Rancher Desktop.app/Contents/MacOS/")
171
+ )
172
+
173
+ ;; Block com.docker.* and container manager Mach lookup / XPC services
174
+ (deny mach-lookup
175
+ (xpc-service-name-prefix "com.docker.")
176
+ (global-name-prefix "com.docker.")
177
+ (global-name-prefix "dev.kdrag0n.OrbStack")
178
+ )
179
+
180
+ ;; Block Docker POSIX Shared Memory
181
+ (deny ipc-posix-shm*
182
+ (ipc-posix-name-prefix "docker")
183
+ (ipc-posix-name-prefix "com.docker.")
184
+ )
185
+
@@ -136,3 +136,53 @@
136
136
  ;; set `GEMINI_SANDBOX_PROXY_COMMAND=<command>` to run proxy alongside sandbox
137
137
  ;; proxy must listen on :::8877 (see docs/examples/proxy-script.md)
138
138
  (allow network-outbound (remote tcp "localhost:8877"))
139
+
140
+ ;; Block Docker & container daemon UNIX domain sockets (read & write)
141
+ (deny file-read* file-write*
142
+ (literal "/var/run/docker.sock")
143
+ (literal "/var/run/docker.sock.raw")
144
+ (literal "/private/var/run/docker.sock")
145
+ (literal "/private/var/run/docker.sock.raw")
146
+ (subpath "/var/run/docker")
147
+ (subpath "/private/var/run/docker")
148
+ (subpath "/Users/Shared/.docker")
149
+ (subpath (string-append (param "HOME_DIR") "/.docker/run"))
150
+ (subpath (string-append (param "HOME_DIR") "/.docker/desktop"))
151
+ (subpath (string-append (param "HOME_DIR") "/.colima"))
152
+ (subpath (string-append (param "HOME_DIR") "/.orbstack/run"))
153
+ (subpath (string-append (param "HOME_DIR") "/.rd"))
154
+ )
155
+
156
+ ;; Block container CLI and daemon binaries from execution
157
+ (deny process-exec
158
+ (literal "/usr/local/bin/docker")
159
+ (literal "/usr/local/bin/dockerd")
160
+ (literal "/usr/local/bin/docker-compose")
161
+ (literal "/usr/bin/docker")
162
+ (literal "/opt/homebrew/bin/docker")
163
+ (literal "/opt/homebrew/bin/dockerd")
164
+ (literal "/opt/homebrew/bin/docker-compose")
165
+ (literal "/opt/homebrew/bin/podman")
166
+ (literal "/usr/local/bin/podman")
167
+ (literal "/opt/homebrew/bin/colima")
168
+ (literal "/usr/local/bin/colima")
169
+ (literal "/opt/homebrew/bin/orb")
170
+ (literal "/Applications/Docker.app/Contents/Resources/bin/docker")
171
+ (subpath "/Applications/Docker.app/Contents/MacOS/")
172
+ (subpath "/Applications/OrbStack.app/Contents/MacOS/")
173
+ (subpath "/Applications/Rancher Desktop.app/Contents/MacOS/")
174
+ )
175
+
176
+ ;; Block com.docker.* and container manager Mach lookup / XPC services
177
+ (deny mach-lookup
178
+ (xpc-service-name-prefix "com.docker.")
179
+ (global-name-prefix "com.docker.")
180
+ (global-name-prefix "dev.kdrag0n.OrbStack")
181
+ )
182
+
183
+ ;; Block Docker POSIX Shared Memory
184
+ (deny ipc-posix-shm*
185
+ (ipc-posix-name-prefix "docker")
186
+ (ipc-posix-name-prefix "com.docker.")
187
+ )
188
+
@@ -92,4 +92,53 @@
92
92
  (allow network-inbound (local ip "localhost:9229"))
93
93
 
94
94
  ;; allow all outbound network traffic
95
- (allow network-outbound)
95
+ (allow network-outbound)
96
+
97
+ ;; Block Docker & container daemon UNIX domain sockets (read & write)
98
+ (deny file-read* file-write*
99
+ (literal "/var/run/docker.sock")
100
+ (literal "/var/run/docker.sock.raw")
101
+ (literal "/private/var/run/docker.sock")
102
+ (literal "/private/var/run/docker.sock.raw")
103
+ (subpath "/var/run/docker")
104
+ (subpath "/private/var/run/docker")
105
+ (subpath "/Users/Shared/.docker")
106
+ (subpath (string-append (param "HOME_DIR") "/.docker/run"))
107
+ (subpath (string-append (param "HOME_DIR") "/.docker/desktop"))
108
+ (subpath (string-append (param "HOME_DIR") "/.colima"))
109
+ (subpath (string-append (param "HOME_DIR") "/.orbstack/run"))
110
+ (subpath (string-append (param "HOME_DIR") "/.rd"))
111
+ )
112
+
113
+ ;; Block container CLI and daemon binaries from execution
114
+ (deny process-exec
115
+ (literal "/usr/local/bin/docker")
116
+ (literal "/usr/local/bin/dockerd")
117
+ (literal "/usr/local/bin/docker-compose")
118
+ (literal "/usr/bin/docker")
119
+ (literal "/opt/homebrew/bin/docker")
120
+ (literal "/opt/homebrew/bin/dockerd")
121
+ (literal "/opt/homebrew/bin/docker-compose")
122
+ (literal "/opt/homebrew/bin/podman")
123
+ (literal "/usr/local/bin/podman")
124
+ (literal "/opt/homebrew/bin/colima")
125
+ (literal "/usr/local/bin/colima")
126
+ (literal "/opt/homebrew/bin/orb")
127
+ (literal "/Applications/Docker.app/Contents/Resources/bin/docker")
128
+ (subpath "/Applications/Docker.app/Contents/MacOS/")
129
+ (subpath "/Applications/OrbStack.app/Contents/MacOS/")
130
+ (subpath "/Applications/Rancher Desktop.app/Contents/MacOS/")
131
+ )
132
+
133
+ ;; Block com.docker.* and container manager Mach lookup / XPC services
134
+ (deny mach-lookup
135
+ (xpc-service-name-prefix "com.docker.")
136
+ (global-name-prefix "com.docker.")
137
+ (global-name-prefix "dev.kdrag0n.OrbStack")
138
+ )
139
+
140
+ ;; Block Docker POSIX Shared Memory
141
+ (deny ipc-posix-shm*
142
+ (ipc-posix-name-prefix "docker")
143
+ (ipc-posix-name-prefix "com.docker.")
144
+ )
@@ -95,3 +95,53 @@
95
95
  ;; set `GEMINI_SANDBOX_PROXY_COMMAND=<command>` to run proxy alongside sandbox
96
96
  ;; proxy must listen on :::8877 (see docs/examples/proxy-script.md)
97
97
  (allow network-outbound (remote tcp "localhost:8877"))
98
+
99
+ ;; Block Docker & container daemon UNIX domain sockets (read & write)
100
+ (deny file-read* file-write*
101
+ (literal "/var/run/docker.sock")
102
+ (literal "/var/run/docker.sock.raw")
103
+ (literal "/private/var/run/docker.sock")
104
+ (literal "/private/var/run/docker.sock.raw")
105
+ (subpath "/var/run/docker")
106
+ (subpath "/private/var/run/docker")
107
+ (subpath "/Users/Shared/.docker")
108
+ (subpath (string-append (param "HOME_DIR") "/.docker/run"))
109
+ (subpath (string-append (param "HOME_DIR") "/.docker/desktop"))
110
+ (subpath (string-append (param "HOME_DIR") "/.colima"))
111
+ (subpath (string-append (param "HOME_DIR") "/.orbstack/run"))
112
+ (subpath (string-append (param "HOME_DIR") "/.rd"))
113
+ )
114
+
115
+ ;; Block container CLI and daemon binaries from execution
116
+ (deny process-exec
117
+ (literal "/usr/local/bin/docker")
118
+ (literal "/usr/local/bin/dockerd")
119
+ (literal "/usr/local/bin/docker-compose")
120
+ (literal "/usr/bin/docker")
121
+ (literal "/opt/homebrew/bin/docker")
122
+ (literal "/opt/homebrew/bin/dockerd")
123
+ (literal "/opt/homebrew/bin/docker-compose")
124
+ (literal "/opt/homebrew/bin/podman")
125
+ (literal "/usr/local/bin/podman")
126
+ (literal "/opt/homebrew/bin/colima")
127
+ (literal "/usr/local/bin/colima")
128
+ (literal "/opt/homebrew/bin/orb")
129
+ (literal "/Applications/Docker.app/Contents/Resources/bin/docker")
130
+ (subpath "/Applications/Docker.app/Contents/MacOS/")
131
+ (subpath "/Applications/OrbStack.app/Contents/MacOS/")
132
+ (subpath "/Applications/Rancher Desktop.app/Contents/MacOS/")
133
+ )
134
+
135
+ ;; Block com.docker.* and container manager Mach lookup / XPC services
136
+ (deny mach-lookup
137
+ (xpc-service-name-prefix "com.docker.")
138
+ (global-name-prefix "com.docker.")
139
+ (global-name-prefix "dev.kdrag0n.OrbStack")
140
+ )
141
+
142
+ ;; Block Docker POSIX Shared Memory
143
+ (deny ipc-posix-shm*
144
+ (ipc-posix-name-prefix "docker")
145
+ (ipc-posix-name-prefix "com.docker.")
146
+ )
147
+
@@ -128,3 +128,53 @@
128
128
 
129
129
  ;; allow all outbound network traffic
130
130
  (allow network-outbound)
131
+
132
+ ;; Block Docker & container daemon UNIX domain sockets (read & write)
133
+ (deny file-read* file-write*
134
+ (literal "/var/run/docker.sock")
135
+ (literal "/var/run/docker.sock.raw")
136
+ (literal "/private/var/run/docker.sock")
137
+ (literal "/private/var/run/docker.sock.raw")
138
+ (subpath "/var/run/docker")
139
+ (subpath "/private/var/run/docker")
140
+ (subpath "/Users/Shared/.docker")
141
+ (subpath (string-append (param "HOME_DIR") "/.docker/run"))
142
+ (subpath (string-append (param "HOME_DIR") "/.docker/desktop"))
143
+ (subpath (string-append (param "HOME_DIR") "/.colima"))
144
+ (subpath (string-append (param "HOME_DIR") "/.orbstack/run"))
145
+ (subpath (string-append (param "HOME_DIR") "/.rd"))
146
+ )
147
+
148
+ ;; Block container CLI and daemon binaries from execution
149
+ (deny process-exec
150
+ (literal "/usr/local/bin/docker")
151
+ (literal "/usr/local/bin/dockerd")
152
+ (literal "/usr/local/bin/docker-compose")
153
+ (literal "/usr/bin/docker")
154
+ (literal "/opt/homebrew/bin/docker")
155
+ (literal "/opt/homebrew/bin/dockerd")
156
+ (literal "/opt/homebrew/bin/docker-compose")
157
+ (literal "/opt/homebrew/bin/podman")
158
+ (literal "/usr/local/bin/podman")
159
+ (literal "/opt/homebrew/bin/colima")
160
+ (literal "/usr/local/bin/colima")
161
+ (literal "/opt/homebrew/bin/orb")
162
+ (literal "/Applications/Docker.app/Contents/Resources/bin/docker")
163
+ (subpath "/Applications/Docker.app/Contents/MacOS/")
164
+ (subpath "/Applications/OrbStack.app/Contents/MacOS/")
165
+ (subpath "/Applications/Rancher Desktop.app/Contents/MacOS/")
166
+ )
167
+
168
+ ;; Block com.docker.* and container manager Mach lookup / XPC services
169
+ (deny mach-lookup
170
+ (xpc-service-name-prefix "com.docker.")
171
+ (global-name-prefix "com.docker.")
172
+ (global-name-prefix "dev.kdrag0n.OrbStack")
173
+ )
174
+
175
+ ;; Block Docker POSIX Shared Memory
176
+ (deny ipc-posix-shm*
177
+ (ipc-posix-name-prefix "docker")
178
+ (ipc-posix-name-prefix "com.docker.")
179
+ )
180
+