priiisk 0.22.0-linux-x64 → 0.22.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.
package/README.md CHANGED
@@ -1,3 +1,170 @@
1
- # priiisk for linux x64
1
+ # priiisk
2
2
 
3
- Platform build of priiisk, installed automatically as an optional dependency of the `priiisk` command. There is nothing to run here directly.
3
+ [Русская версия](./README.ru.md)
4
+
5
+ A camp of long-lived worker agents. An orchestrator hires them, assigns work,
6
+ and keeps control; a human watches through the cabin and steps in only when
7
+ needed.
8
+
9
+ A worker is a live session, not a one-shot process: it keeps a role, a model, a
10
+ thinking level, a tool set, and a transcript that survives a restart.
11
+
12
+ **Under active development.** Commands, configuration and stored state change
13
+ between releases, sometimes without a transition path: a camp started by an
14
+ older build may refuse to resume, and a config that worked yesterday may be
15
+ rejected as a whole. Expect breakage and read the release you install.
16
+
17
+ ## Install
18
+
19
+ ```sh
20
+ npm install -g priiisk
21
+ priiisk --version
22
+ ```
23
+
24
+ No separate runtime: the camp lives inside the executable. linux and macOS, x64
25
+ and arm64.
26
+
27
+ ## After install
28
+
29
+ `priiisk` with no arguments — the same as `priiisk status` — is the camp
30
+ state: whether a camp is up, the roster, pending questions and elevation
31
+ requests. `priiisk survey` is the command map and the usual order of work.
32
+ When nothing is running, start with `camp up`.
33
+
34
+ Commands that report state accept `--json`. The camp is polled by request, not
35
+ by reading a screen. `priiisk --help` lists the rest; `priiisk <command> --help`
36
+ lists the arguments of one command.
37
+
38
+ ## Quick start
39
+
40
+ `camp up` starts the camp as a detached process and, when the terminal it was
41
+ typed in can draw, opens the cabin there. The camp keeps running when the cabin
42
+ closes; `camp open` brings it back. Hire needs at least one model alias in the
43
+ config; see [Configuration](#configuration).
44
+
45
+ ```sh
46
+ priiisk camp up
47
+ priiisk hire "Look into the failing tests" --role prospector
48
+ priiisk status prospector-quiet-harbor
49
+ priiisk asks
50
+ priiisk answer prospector-quiet-harbor
51
+ priiisk camp down
52
+ ```
53
+
54
+ Hire generates an alias (`<role>-<adjective>-<noun>`) unless you pass `--alias`.
55
+ Use the name hire printed — `prospector-quiet-harbor` above is only an example.
56
+ The first assignment is optional: omit it and the worker waits in `idle` for
57
+ `priiisk send`.
58
+
59
+ One project root is one camp, one socket, and one orchestrator.
60
+
61
+ ## Access modes
62
+
63
+ Access mode is a set of operation classes the worker may receive. It is chosen
64
+ at hire and does not change on a live worker. `equip` may narrow what is
65
+ handed out, but it cannot raise this ceiling.
66
+
67
+ | mode | classes | in practice |
68
+ | --- | --- | --- |
69
+ | `read-only` | read | files, search, read-only catalog binaries; no shell |
70
+ | `execute` | read, execute | plus a shell for checks; `edit` and `write` are not handed out |
71
+ | `read-write` | read, write | file edits through tools; no shell |
72
+ | `all` | all three | the full set |
73
+
74
+ The tool itself declares its class. Built-in roles: `prospector` is
75
+ `read-only`, `assayer` is `execute`, `wright` is `all`.
76
+
77
+ `execute` does not forbid writes. A started command writes everything the
78
+ process user can write. That is role discipline, not isolation.
79
+
80
+ ## Elevation
81
+
82
+ A one-off step outside the hired mode is a grant, not a question. The worker
83
+ names the class it lacks (`read`, `write`, or `execute`) and a reason. The
84
+ orchestrator answers with `priiisk grant <id>` or `priiisk grant <id> --deny`.
85
+ An allow opens a window until the worker finishes the turn by returning a
86
+ result; interrupt, error, and retry do not close it. The next need is a new
87
+ request. The hired mode does not change.
88
+
89
+ ## Worker workspace
90
+
91
+ `priiisk hire --workspace worktree` creates a named workspace with its own
92
+ working tree and branch. Hire a second worker into it by name:
93
+ `priiisk hire --workspace <name>`. A reviewer can then read the writer's work
94
+ before any merge. It is not a sandbox: the object database, refs, repository
95
+ config, hooks, and the user permissions of the same repository stay shared.
96
+ Dismissal is cooperative. Take the finished work with an ordinary `git merge`.
97
+
98
+ `priiisk workspace list` shows who lives in which workspace.
99
+ `priiisk workspace forget <name>` removes an empty named workspace.
100
+ `priiisk workspace sweep` lists orphan trees left after a crash: an empty named
101
+ workspace is not an orphan. `--confirm` deletes only trees that are clean and
102
+ whose branch is already reachable from another ref. A dirty tree and a tree
103
+ with an unmerged branch stay put.
104
+
105
+ ## Configuration
106
+
107
+ The camp reads one user TOML file: `$XDG_CONFIG_HOME/priiisk/config.toml`, or
108
+ `~/.config/priiisk/config.toml` when `XDG_CONFIG_HOME` is unset.
109
+
110
+ The file is checked as a whole. An unknown field is rejected. There are no
111
+ silently ignored settings.
112
+
113
+ ### Before the first camp: the agent runtime comes first
114
+
115
+ priiisk runs workers on the pi agent runtime and **inherits its providers,
116
+ models and authentication**. It stores no tokens and copies no model registry,
117
+ so a model exists for the camp only if it already exists there.
118
+
119
+ That makes the order fixed, and it is easy to get wrong:
120
+
121
+ 1. Sign in to pi and connect the providers you intend to use. Adding a provider
122
+ or renewing its authentication is done with pi, not here.
123
+ 2. Ask pi which `provider/model` references are actually available to you. The
124
+ camp accepts an exact reference, not a family or a display name.
125
+ 3. Map those references to short aliases in the priiisk config below, and use
126
+ the aliases in roles and presets.
127
+ 4. Run `priiisk doctor`. It confirms that every configured alias resolves in the
128
+ pi catalog and that authentication for it is available — by reading the
129
+ catalog, without sending a prompt or spending anything.
130
+
131
+ Skipping the first two steps is the usual first failure: the config is valid
132
+ TOML, the camp starts, and the first hire dies because the model reference
133
+ belongs to no one.
134
+
135
+ A minimal file. Replace both `id` values before `camp up`; the placeholders below are only the required `provider/model` shape:
136
+
137
+ ```toml
138
+ schemaVersion = 2
139
+
140
+ [defaults]
141
+ model = "strong"
142
+ thinking = "medium"
143
+
144
+ [models.strong]
145
+ id = "provider/model"
146
+
147
+ [models.fast]
148
+ id = "provider/model"
149
+
150
+ [roles.assayer]
151
+ description = "Review worker"
152
+ model = "strong"
153
+ thinking = "high"
154
+ access = "execute"
155
+
156
+ [hirePresets.safe-review]
157
+ description = "Review without a shell"
158
+ role = "assayer"
159
+ access = "read-only"
160
+ ```
161
+
162
+ Replace both `id` values with models from your agent runtime. `defaults.model`
163
+ and `defaults.thinking` are required. A hire preset may name a built-in role
164
+ (`wright`, `assayer`, `prospector`) and then tighten access.
165
+
166
+ A repository may keep `.priiisk/config.toml` and override policy from the user
167
+ file: models, roles, hire presets, skill groups, defaults, and workspace. It
168
+ does not read MCP server definitions or the external-binary catalog from the
169
+ repository: those fields name what the camp will start, so taking them from a
170
+ clone would run someone else's code on the first hire.
package/README.ru.md ADDED
@@ -0,0 +1,174 @@
1
+ # priiisk
2
+
3
+ [English version](./README.md)
4
+
5
+ Управляемый лагерь долгоживущих worker-агентов. Оркестратор нанимает воркеров,
6
+ дает им задания и держит управление; человек наблюдает через кабину и
7
+ вмешивается только когда нужно.
8
+
9
+ Воркер — не одноразовый процесс, а живая session: у него есть роль, модель,
10
+ уровень мышления, свой набор инструментов и transcript, который переживает
11
+ перезапуск.
12
+
13
+ **Идет активная разработка.** Команды, конфигурация и сохраненное состояние
14
+ меняются между выпусками, иногда без переходного пути: лагерь, поднятый прежней
15
+ сборкой, может отказаться восстанавливаться, а вчерашний конфиг — быть
16
+ отклоненным целиком. Ломаться будет; читайте тот выпуск, который ставите.
17
+
18
+ ## Установка
19
+
20
+ ```sh
21
+ npm install -g priiisk
22
+ priiisk --version
23
+ ```
24
+
25
+ Отдельный рантайм ставить не нужно: лагерь целиком лежит внутри исполняемого
26
+ файла. Поддержаны linux и macOS, x64 и arm64.
27
+
28
+ ## После установки
29
+
30
+ `priiisk` без аргументов — то же, что `priiisk status` — это состояние лагеря:
31
+ поднят ли он, кто в ростере, какие вопросы и просьбы о повышении ждут ответа.
32
+ `priiisk survey` — карта команд и обычный порядок работы. Если лагеря нет,
33
+ его поднимают `camp up`.
34
+
35
+ Команды, отвечающие состоянием, понимают `--json`. Лагерь опрашивается
36
+ запросом, а не чтением экрана. `priiisk --help` перечисляет остальные команды,
37
+ `priiisk <команда> --help` — аргументы каждой.
38
+
39
+ ## Быстрый старт
40
+
41
+ `camp up` поднимает лагерь отсоединенным процессом и, если терминал вызова
42
+ умеет рисовать, открывает в нем кабину. Закрытие кабины лагеря не касается,
43
+ вернуть вид — `camp open`. Для найма в конфиге нужна хотя бы одна модель; см.
44
+ [Настройка](#настройка).
45
+
46
+ ```sh
47
+ priiisk camp up
48
+ priiisk hire "Разбери падение тестов" --role prospector
49
+ priiisk status prospector-quiet-harbor
50
+ priiisk asks
51
+ priiisk answer prospector-quiet-harbor
52
+ priiisk camp down
53
+ ```
54
+
55
+ Hire сам генерирует алиас (`<роль>-<прилагательное>-<существительное>`), если не
56
+ передан `--alias`. Дальше используйте имя, которое напечатал hire —
57
+ `prospector-quiet-harbor` здесь только пример. Первое задание необязательно:
58
+ без него воркер ждет в `idle` команды `priiisk send`.
59
+
60
+ Лагерь привязан к каноническому корню репозитория: один проект — один лагерь,
61
+ один сокет, один управляющий оркестратор.
62
+
63
+ ## Режимы доступа
64
+
65
+ Режим доступа — множество классов операций, которые воркер может получить. Он
66
+ задается при найме и на живом воркере не меняется. `equip` сужает выдачу
67
+ внутри потолка режима и никогда его не поднимает.
68
+
69
+ | режим | классы | на практике |
70
+ | --- | --- | --- |
71
+ | `read-only` | чтение | файлы, поиск, читающие бинари каталога; оболочки нет |
72
+ | `execute` | чтение, исполнение | плюс оболочка для проверок; `edit` и `write` не выданы |
73
+ | `read-write` | чтение, запись | правка файлов инструментами; оболочки нет |
74
+ | `all` | все три | полный набор |
75
+
76
+ Класс объявляет сам инструмент. Встроенные роли: `prospector` — `read-only`,
77
+ `assayer` — `execute`, `wright` — `all`.
78
+
79
+ `execute` не запрещает запись. Запущенная команда пишет все, что доступно
80
+ пользователю процесса. Это дисциплина роли, а не изоляция.
81
+
82
+ ## Повышение полномочий
83
+
84
+ Разовый выход за нанятый режим — это просьба о повышении, а не вопрос. Воркер
85
+ называет недостающий класс (`read`, `write` или `execute`) и обоснование.
86
+ Оркестратор отвечает `priiisk grant <id>` или `priiisk grant <id> --deny`.
87
+ Разрешение открывает окно до конца хода, пока воркер не вернет результат;
88
+ прерывание, ошибка и повтор окно не закрывают. Следующая надобность — новая
89
+ просьба. Нанятый режим при этом не меняется.
90
+
91
+ ## Рабочее пространство воркера
92
+
93
+ `priiisk hire --workspace worktree` создает именованное пространство с
94
+ собственным деревом и веткой. Второго воркера сажают туда по имени:
95
+ `priiisk hire --workspace <name>`. Так проверяющий читает работу пишущего до
96
+ слияния. Это не песочница: object database, refs, конфигурация репозитория,
97
+ hooks и права пользователя того же репозитория остаются общими. Закрытие
98
+ кооперативное. Готовую работу забирают обычным `git merge`.
99
+
100
+ `priiisk workspace list` показывает, кто в каком пространстве живет.
101
+ `priiisk workspace forget <name>` убирает пустое именованное пространство.
102
+ `priiisk workspace sweep` показывает осиротевшие деревья после сбоя: пустое
103
+ именованное пространство сиротой не считается. `--confirm` удаляет только
104
+ чистые деревья, чья ветка уже достижима из другой ссылки. Грязное дерево и
105
+ дерево с невлитой веткой команда оставляет на месте.
106
+
107
+ ## Настройка
108
+
109
+ Лагерь читает один пользовательский TOML-файл:
110
+ `$XDG_CONFIG_HOME/priiisk/config.toml`, а если `XDG_CONFIG_HOME` не задан —
111
+ `~/.config/priiisk/config.toml`.
112
+
113
+ Файл проходит строгую проверку целиком. Неизвестное поле отклоняется.
114
+ Молчаливо игнорируемых настроек нет.
115
+
116
+ ### Перед первым лагерем: сначала агент-рантайм
117
+
118
+ priiisk исполняет воркеров рантаймом pi и **наследует его провайдеров, модели и
119
+ авторизацию**. Своих токенов он не хранит и чужой реестр моделей не копирует:
120
+ модель существует для лагеря только если она уже существует там.
121
+
122
+ Отсюда жесткий порядок, который легко нарушить:
123
+
124
+ 1. Войти в pi и подключить провайдеров, которыми собираетесь пользоваться.
125
+ Добавление провайдера и продление авторизации делаются средствами pi, а не
126
+ отсюда.
127
+ 2. Узнать у pi, какие ссылки `provider/model` вам действительно доступны.
128
+ Лагерь принимает точную ссылку, а не семейство и не отображаемое имя.
129
+ 3. Связать эти ссылки короткими алиасами в конфиге ниже и пользоваться в ролях
130
+ и пресетах алиасами.
131
+ 4. Выполнить `priiisk doctor`. Он подтверждает, что каждый алиас резолвится в
132
+ каталоге pi и что авторизация для него есть, — чтением каталога, без отправки
133
+ запроса и без трат.
134
+
135
+ Пропуск первых двух шагов — обычный первый отказ: конфиг проходит проверку,
136
+ лагерь поднимается, а первый наем умирает, потому что ссылка на модель никому
137
+ не принадлежит.
138
+
139
+ Минимальный файл. Перед `camp up` подставьте оба `id`; плейсхолдеры ниже — только обязательная форма `provider/model`:
140
+
141
+ ```toml
142
+ schemaVersion = 2
143
+
144
+ [defaults]
145
+ model = "strong"
146
+ thinking = "medium"
147
+
148
+ [models.strong]
149
+ id = "provider/model"
150
+
151
+ [models.fast]
152
+ id = "provider/model"
153
+
154
+ [roles.assayer]
155
+ description = "Review worker"
156
+ model = "strong"
157
+ thinking = "high"
158
+ access = "execute"
159
+
160
+ [hirePresets.safe-review]
161
+ description = "Review without a shell"
162
+ role = "assayer"
163
+ access = "read-only"
164
+ ```
165
+
166
+ Подставьте в оба `id` модели из своего агент-рантайма. `defaults.model` и
167
+ `defaults.thinking` обязательны. Пресет найма может назвать встроенную роль
168
+ (`wright`, `assayer`, `prospector`) и сузить доступ.
169
+
170
+ Репозиторий может держать `.priiisk/config.toml` и переопределять им политику
171
+ из пользовательского файла: модели, роли, пресеты найма, группы навыков,
172
+ defaults и workspace. Определения MCP-серверов и каталог внешних бинарей из
173
+ репозитория не читаются: эти поля задают то, что лагерь запустит, и чтение их
174
+ из клона означало бы исполнение чужого кода при первом же `hire`.
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ * The installed `priiisk` command. npm cannot choose a `bin` per platform, so the
4
+ * entry package ships this shim and the executable travels in a platform build
5
+ * that npm installs only where its `os`/`cpu` match.
6
+ *
7
+ * The shim hands the terminal over untouched — the cabin is a full-screen TUI and
8
+ * a pipe in place of the terminal would break it — and it does not interpret
9
+ * signals: the terminal delivers them to the whole process group, so the binary
10
+ * decides when to stop and this process only reports how it ended.
11
+ */
12
+ import { spawn } from "node:child_process";
13
+ import { existsSync } from "node:fs";
14
+ import { createRequire } from "node:module";
15
+ import { dirname, join } from "node:path";
16
+
17
+ /*
18
+ * An alias, not a registry name: the entry package installs the platform build
19
+ * under this name from a version of `priiisk` itself. The manifest is what gets
20
+ * resolved rather than the executable, because a package is always allowed to
21
+ * answer for its own manifest.
22
+ */
23
+ const platformPackage = `priiisk-${process.platform}-${process.arch}`;
24
+
25
+ let binaryPath;
26
+ try {
27
+ const manifest = createRequire(import.meta.url).resolve(`${platformPackage}/package.json`);
28
+ binaryPath = join(dirname(manifest), "bin", "priiisk");
29
+ } catch {
30
+ binaryPath = undefined;
31
+ }
32
+
33
+ if (binaryPath === undefined || !existsSync(binaryPath)) {
34
+ process.stderr.write(
35
+ `priiisk: no executable for ${process.platform} ${process.arch}.\n` +
36
+ `The platform build ${platformPackage} is missing. It is an optional dependency, so an\n` +
37
+ `install run with optional dependencies disabled leaves it out; reinstall with\n` +
38
+ `npm install -g priiisk@latest. If nothing exists for this platform, it is not published.\n`,
39
+ );
40
+ process.exit(1);
41
+ }
42
+
43
+ const child = spawn(binaryPath, process.argv.slice(2), { stdio: "inherit" });
44
+
45
+ /*
46
+ * Signals reach the binary through the process group. Ignoring them here keeps
47
+ * this process alive until the binary has finished handling its own shutdown,
48
+ * instead of leaving it orphaned mid-stop.
49
+ */
50
+ for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) process.on(signal, () => {});
51
+
52
+ child.on("error", (error) => {
53
+ process.stderr.write(`priiisk: cannot start ${binaryPath}: ${error.message}\n`);
54
+ process.exit(1);
55
+ });
56
+
57
+ child.on("exit", (code, signal) => {
58
+ if (signal !== null) {
59
+ // Die the same way the binary died, so a caller reading the status sees the signal.
60
+ process.removeAllListeners(signal);
61
+ process.kill(process.pid, signal);
62
+ return;
63
+ }
64
+ process.exit(code ?? 0);
65
+ });
package/package.json CHANGED
@@ -1,15 +1,23 @@
1
1
  {
2
2
  "name": "priiisk",
3
- "version": "0.22.0-linux-x64",
4
- "description": "priiisk executable for linux x64",
5
- "os": [
6
- "linux"
7
- ],
8
- "cpu": [
9
- "x64"
10
- ],
3
+ "version": "0.22.0",
4
+ "description": "CLI for running and observing a camp of collaborating agents",
5
+ "type": "module",
6
+ "bin": {
7
+ "priiisk": "./bin/priiisk.mjs"
8
+ },
11
9
  "files": [
12
- "bin/priiisk",
13
- "README.md"
14
- ]
10
+ "bin/priiisk.mjs",
11
+ "README.md",
12
+ "README.ru.md"
13
+ ],
14
+ "engines": {
15
+ "node": ">=20"
16
+ },
17
+ "optionalDependencies": {
18
+ "priiisk-linux-x64": "npm:priiisk@0.22.0-linux-x64",
19
+ "priiisk-linux-arm64": "npm:priiisk@0.22.0-linux-arm64",
20
+ "priiisk-darwin-x64": "npm:priiisk@0.22.0-darwin-x64",
21
+ "priiisk-darwin-arm64": "npm:priiisk@0.22.0-darwin-arm64"
22
+ }
15
23
  }
package/bin/priiisk DELETED
Binary file