MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / createEnv

Function createEnv

services/cloud-agent-next/src/session-service.test.ts:308–388  ·  view source on GitHub ↗
(metadata?: CloudAgentSessionState | null)

Source from the content-addressed store, hash-verified

306 `bb comments create-batch 42 --input - < ${inputPath}`,
307 `bb comments update 42 31 --input - < ${inputPath}`,
308 ]) {
309 expect(resolveCommandGuardBashPermission(permissions, command), command).toBe('allow');
310 }
311
312 for (const command of [
313 'env',
314 'printenv BITBUCKET_TOKEN',
315 'echo $BITBUCKET_TOKEN',
316 'cat /proc/self/environ',
317 'python -c "print(1)"',
318 'node -e "console.log(1)"',
319 'pnpm exec tsx script.ts',
320 'curl https://api.bitbucket.org/2.0/user',
321 './repository-script',
322 'git status --short',
323 'git rev-parse HEAD',
324 'git diff --no-ext-diff --no-textconv',
325 'git show --no-ext-diff --no-textconv --format=fuller --stat HEAD',
326 'git config --get-regexp alias',
327 'git fetch origin',
328 'git diff',
329 'bb help extra',
330 'bb --debug pr view 42',
331 'bb pr current extra',
332 'bb pr create',
333 'bb pr create --description "Ready for review"',
334 'bb pr create --title "Add safer widgets" < /tmp/other.json',
335 'bb comments create 42 --input - --workspace other',
336 'bb comments create-batch 42 --input - --workspace other',
337 'bb comments update 42 31 --input - extra',
338 'bb comments create 42 --input - < /tmp/other.json',
339 'bb comments create-batch 42 --input - < /tmp/other.json',
340 `bb comments update 42 $COMMENT_ID --input - < ${inputPath}`,
341 `bb comments update 42 31 --input - < ${inputPath}; env`,
342 `bb pr diff 42 | bb comments create 42 --input - < ${inputPath}`,
343 'bb pr diff 42 --workspace other',
344 'bb pr diff 42 extra --name-only',
345 'bb pr diff 42 --name-only extra',
346 'bb pr diff $BITBUCKET_TOKEN --name-only',
347 'bb pr view 42 && printenv',
348 'bb pr view 42 extra',
349 'bb comments create 42 43 --input -',
350 'bb comments create-batch 42 43 --input -',
351 ]) {
352 expect(resolveCommandGuardBashPermission(permissions, command), command).toBe('deny');
353 }
354 });
355});
356
357function createSession(repoExists = false): MockExecutionSession {
358 const exec = vi.fn(async (command: string) => {
359 if (command.includes('test -d') && command.includes('.git')) {
360 return { exitCode: repoExists ? 0 : 1, stdout: repoExists ? 'exists\n' : '', stderr: '' };
361 }
362 if (command.includes('kilo-restore-session.js')) {
363 return { exitCode: 0, stdout: JSON.stringify({ ok: true }), stderr: '' };
364 }
365 return { exitCode: 0, stdout: '', stderr: '' };

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected