threadwire 0.1.20 → 0.1.21
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/CHANGELOG.md +15 -0
- package/docs/development-container.md +52 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- Make the checked-in development container portable and secure for direct
|
|
6
|
+
native Kimi: runtime paths (`DEV_CONTAINER_HOME`, `KIMI_CODE_HOME`) are
|
|
7
|
+
explicit, portable, and absolute instead of hard-coded `/home/dev`; the
|
|
8
|
+
immutable agent context mounts from the named external Docker volume
|
|
9
|
+
`AGENT_CONTEXT_VOLUME` rather than a host path; agent-context links for Kimi
|
|
10
|
+
go to the configured `KIMI_CODE_HOME`, which may differ from the dev home;
|
|
11
|
+
direct Kimi auth mounts from the named external volume `KIMI_AUTH_VOLUME`
|
|
12
|
+
only as narrow subpaths under the configurable `KIMI_AUTH_VOLUME_SUBPATH`
|
|
13
|
+
(default `.kimi-code`; `credentials` writable, `config.toml` and `device_id`
|
|
14
|
+
read-only) in the normal `app` service; a dedicated profiled `kimi-auth`
|
|
15
|
+
service bypasses the normal dev entrypoint, mounts the full auth volume root
|
|
16
|
+
writable, bootstraps the configured subpath, and runs `kimi login` for
|
|
17
|
+
interactive authentication/refresh. The Kimi Code CLI in the dev image is
|
|
18
|
+
pinned to `0.34.0` with the same integrity verification used in production.
|
|
19
|
+
Production runtime files remain unchanged.
|
|
5
20
|
- Resolve native Kimi through the normal `PATH` (`kimi`) instead of requiring
|
|
6
21
|
`/usr/local/bin/kimi`; `THREADWIRE_KIMI_BIN` remains the explicit override.
|
|
7
22
|
- Resolve native Codex through `THREADWIRE_CODEX_BIN` or normal `PATH` lookup,
|
|
@@ -6,14 +6,22 @@ installs Codex CLI, Claude Code CLI, the official Kimi Code CLI, OpenCode,
|
|
|
6
6
|
`oc-codex-multi-auth`, `@ai-sdk/openai-compatible`, and `@ai-sdk/xai` during the
|
|
7
7
|
Docker build. Runtime setup never downloads a plugin through `npx`.
|
|
8
8
|
|
|
9
|
-
## Source paths
|
|
9
|
+
## Source paths and volumes
|
|
10
10
|
|
|
11
11
|
All source paths in `.env` are required and have no checked-in host defaults:
|
|
12
12
|
|
|
13
|
-
- `DEV_HOME_PATH` is the complete dedicated development home. It
|
|
14
|
-
owner of OpenCode database, session, log, and cache state.
|
|
13
|
+
- `DEV_HOME_PATH` is the complete dedicated development home on the host. It
|
|
14
|
+
remains the owner of OpenCode database, session, log, and cache state.
|
|
15
|
+
- `DEV_CONTAINER_HOME` is the absolute container path where `DEV_HOME_PATH` is
|
|
16
|
+
bind-mounted writable. The Threadwire checkout is expected at
|
|
17
|
+
`${DEV_CONTAINER_HOME}/threadwire`.
|
|
18
|
+
- `KIMI_CODE_HOME` is the absolute container path for the direct Kimi Code CLI
|
|
19
|
+
home. It must be a strict descendant of `DEV_CONTAINER_HOME` (for example
|
|
20
|
+
`${DEV_CONTAINER_HOME}/.kimi-code`) so the dev home bind remains the only
|
|
21
|
+
writable home mount. The Kimi auth volume's `credentials`, `config.toml`, and
|
|
22
|
+
`device_id` are mounted beneath this path.
|
|
15
23
|
- `GH_CONFIG_SOURCE_PATH` is the GitHub CLI config directory and mounts
|
|
16
|
-
read-only
|
|
24
|
+
read-only at `${DEV_CONTAINER_HOME}/.config/gh`.
|
|
17
25
|
- `CODEX_AUTH_SOURCE_PATH` is native Codex's `auth.json` and mounts read-write
|
|
18
26
|
so OAuth refreshes persist to its canonical owner.
|
|
19
27
|
- `OPENCODE_AUTH_SOURCE_PATH` is OpenCode's native `auth.json`. DeepSeek, xAI,
|
|
@@ -23,14 +31,52 @@ All source paths in `.env` are required and have no checked-in host defaults:
|
|
|
23
31
|
containing the OpenAI OAuth file and global account pool. It mounts
|
|
24
32
|
read-write as a directory because pool updates use atomic sibling-file
|
|
25
33
|
replacement.
|
|
26
|
-
- `
|
|
27
|
-
read-only
|
|
34
|
+
- `AGENT_CONTEXT_VOLUME` is the name of the external Docker volume that holds
|
|
35
|
+
the immutable agent-context snapshot. It mounts read-only at
|
|
36
|
+
`/opt/agent-context`.
|
|
37
|
+
- `KIMI_AUTH_VOLUME` is the name of the external Docker volume that holds the
|
|
38
|
+
direct Kimi Code auth store.
|
|
39
|
+
- `KIMI_AUTH_VOLUME_SUBPATH` is the directory inside `KIMI_AUTH_VOLUME` that
|
|
40
|
+
contains the Kimi Code CLI home (default `.kimi-code`). The volume root may
|
|
41
|
+
hold other state, so the app mounts `credentials`, `config.toml`, and
|
|
42
|
+
`device_id` from this subpath.
|
|
28
43
|
|
|
29
44
|
Hermes owns the canonical credential files. Do not copy them into the checkout,
|
|
30
45
|
the image, or project-keyed task-home files. The app sets
|
|
31
46
|
`CODEX_AUTH_PER_PROJECT_ACCOUNTS=0`, so `oc-codex-multi-auth` uses its one
|
|
32
47
|
global mounted account pool rather than creating per-project credential copies.
|
|
33
48
|
|
|
49
|
+
## Kimi auth
|
|
50
|
+
|
|
51
|
+
The normal `app` service mounts only narrow subpaths of the Kimi auth volume,
|
|
52
|
+
all under `${KIMI_AUTH_VOLUME_SUBPATH:-.kimi-code}`:
|
|
53
|
+
|
|
54
|
+
- `${KIMI_AUTH_VOLUME_SUBPATH:-.kimi-code}/credentials` → `${KIMI_CODE_HOME}/credentials` read-write
|
|
55
|
+
- `${KIMI_AUTH_VOLUME_SUBPATH:-.kimi-code}/config.toml` → `${KIMI_CODE_HOME}/config.toml` read-only
|
|
56
|
+
- `${KIMI_AUTH_VOLUME_SUBPATH:-.kimi-code}/device_id` → `${KIMI_CODE_HOME}/device_id` read-only
|
|
57
|
+
|
|
58
|
+
The normal app never receives a full writable Kimi auth home. Because the
|
|
59
|
+
read-only `config.toml` and `device_id` file subpaths must already exist in the
|
|
60
|
+
volume, a fresh `KIMI_AUTH_VOLUME` must be initialized before `app` starts.
|
|
61
|
+
|
|
62
|
+
Interactive Kimi login and refresh use the dedicated `kimi-auth` service, which
|
|
63
|
+
bypasses the normal dev entrypoint:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
docker compose -f compose.dev.yaml up --build home-init
|
|
67
|
+
docker compose -f compose.dev.yaml --profile kimi-auth run --rm kimi-auth
|
|
68
|
+
docker compose -f compose.dev.yaml --profile app up --detach
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
This mounts the full `KIMI_AUTH_VOLUME` root writable at `/var/lib/kimi-auth`.
|
|
72
|
+
The service starts as `root` only to create
|
|
73
|
+
`${KIMI_AUTH_VOLUME_SUBPATH:-.kimi-code}` and its `credentials` directory in a
|
|
74
|
+
fresh root-owned external volume, `chown`s them to UID/GID `1000`, drops to
|
|
75
|
+
`1000:1000`, sets
|
|
76
|
+
`KIMI_CODE_HOME=/var/lib/kimi-auth/${KIMI_AUTH_VOLUME_SUBPATH:-.kimi-code}`,
|
|
77
|
+
and runs `kimi login`. It does not mount project source, GitHub auth, agent
|
|
78
|
+
context, Codex, or OpenCode credentials.
|
|
79
|
+
|
|
34
80
|
## OpenCode catalog
|
|
35
81
|
|
|
36
82
|
The image-owned `/usr/local/share/threadwire-dev/opencode.json` is root-owned,
|