# assistant: Make scripting a first-class concept instead of a tool \(\#26338\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/e298301b408a7d759f7e3774f5017ca80be48673)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: e298301b408a7d759f7e3774f5017ca80be48673

Requested commit: e298301b408a7d759f7e3774f5017ca80be48673

Commit: e298301b408a7d759f7e3774f5017ca80be48673

Tree: 60e501e01b477dcfb6b9605eeed2b6c3bbe49493

Author: Agus Zubiaga

Committer: GitHub

## Message

```
assistant: Make scripting a first-class concept instead of a tool (#26338)

This PR makes refactors the scripting functionality to be a first-class
concept of the assistant instead of a generic tool, which will allow us
to build a more customized experience.

- The tool prompt has been slightly tweaked and is now included as a
system message in all conversations. I'm getting decent results, but now
that it isn't in the tools framework, it will probably require more
refining.

- The model will now include an `<eval ...>` tag at the end of the
message with the script. We parse this tag incrementally as it streams
in so that we can indicate that we are generating a script before we see
the closing `</eval>` tag. Later, this will help us interpret the script
as it arrives also.

- Threads now hold a `ScriptSession` entity which manages the state of
all scripts (from parsing to exited) in a centralized way, and will
later collect all script operations so they can be displayed in the UI.

- `script_tool` has been renamed to `assistant_scripting` 

- Script source now opens in a regular read-only buffer  

Note: We still need to handle persistence properly

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
```

## Parents

- [ed6bf7f161c6af6e10354faacb8b643a55c80b27](https://git.cafe/gitcafe/zed/commit/ed6bf7f161c6af6e10354faacb8b643a55c80b27?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/e298301b408a7d759f7e3774f5017ca80be48673?format=markdown)
