Metadata-Version: 2.4
Name: dialoghelper
Version: 0.2.45
Summary: Helper functions for solveit dialogs
Author-email: Jeremy Howard <github@jhoward.fastmail.fm>
License-Expression: Apache-2.0
Project-URL: Repository, https://github.com/AnswerDotAI/dialoghelper
Project-URL: Documentation, https://AnswerDotAI.github.io/dialoghelper
Keywords: nbdev,jupyter,notebook,python
Classifier: Natural Language :: English
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aidialog>=0.0.38
Requires-Dist: fastcore>=2.2.34
Requires-Dist: fasttransport>=0.0.2
Requires-Dist: ghapi>=2.0.0
Requires-Dist: ipymini>=0.1.21
Requires-Dist: jupyasyncclient>=0.2.21
Requires-Dist: python-fastllm
Requires-Dist: pyskills>=0.0.35
Requires-Dist: rgapi>=0.1.8
Requires-Dist: toolslm>=0.3.49
Requires-Dist: exhash>=0.3.14
Requires-Dist: safepyrun>=0.0.23
Requires-Dist: ast-grep-cli
Requires-Dist: ast-grep-py
Requires-Dist: restrictedpython
Requires-Dist: restrictedpython-async
Requires-Dist: websockets
Requires-Dist: httpx2
Requires-Dist: comm
Requires-Dist: pillow
Requires-Dist: pyjwt
Requires-Dist: tracefunc
Provides-Extra: dev
Requires-Dist: python-fasthtml; extra == "dev"
Requires-Dist: tracefunc; extra == "dev"
Requires-Dist: nbdev; extra == "dev"
Requires-Dist: rustygate>=0.1.25; extra == "dev"
Dynamic: license-file

# dialoghelper


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Usage

### Installation

Install from [pypi](https://pypi.org/project/dialoghelper/)

``` sh
$ pip install dialoghelper
```

### Documentation

Documentation can be found hosted on this GitHub [repository](https://github.com/AnswerDotAI/dialoghelper)’s [pages](https://AnswerDotAI.github.io/dialoghelper/).

### Dialog identity and filenames

In a gateway kernel, dialoghelper reaches rustygate through a `rustygate` comm, so it needs no URL or token. Outside one, it sends plain HTTP to `RUSTYGATE_URL`. Current-session reads, edits and execution use `dh_settings['kid']`, initialized from `RUSTYGATE_KERNEL_ID`. The gateway owns the notebook binding, and renames and restarts keep the kernel id. When the gateway renames the notebook, it tells the kernel, which updates its cwd and `dh_settings['path']`. [`find_dname()`](https://AnswerDotAI.github.io/dialoghelper/core.html#find_dname) returns the notebook’s current name. Explicit `dname` arguments name notebooks by path.

Dialog names include `.ipynb`; [`find_dname`](https://AnswerDotAI.github.io/dialoghelper/core.html#find_dname) adds it to an input that lacks it, and a trailing slash names a folder instead. Inputs such as `lesson.ipynb` resolve relative to the current dialog’s folder. A leading slash, as in `/project/lesson.ipynb`, addresses the gateway root rather than the disk root. [`find_dname`](https://AnswerDotAI.github.io/dialoghelper/core.html#find_dname) returns gateway-root-relative filenames without a leading slash. [`list_dialogs`](https://AnswerDotAI.github.io/dialoghelper/core.html#list_dialogs) retains notebook extensions and marks folders with a trailing slash.

[`realpath()`](https://AnswerDotAI.github.io/dialoghelper/core.html#realpath) returns the gateway’s on-disk root. `realpath('')` and [`list_dialogs()`](https://AnswerDotAI.github.io/dialoghelper/core.html#list_dialogs) default to the current notebook’s folder. Relative subpaths use that folder even after a notebook rename, not the kernel’s mutable cwd. A leading slash uses the gateway root. [`realpath`](https://AnswerDotAI.github.io/dialoghelper/core.html#realpath) accepts prospective paths without creating them, and works them out in the kernel without a gateway call. `..` can move up within the root, and a path that resolves outside it raises `ValueError`. Notebook-relative paths require a bound kernel.

### Folder-local skills

Solveit activates pyskills from the dialog’s opening folder before loading its tool layer. Put a public `.py` module or package in a `_pyskills/` directory there or in an ancestor. Give it a module docstring. `list_pyskills()` discovers it and ordinary imports load it without an install or entry-point declaration. The nearest local folder wins. Changing cwd or moving a live dialog does not change the selected scope; restart its kernel to use the new location. Function permissions remain separate from discovery.
