@buyong/pi-devin 0.0.0-stage → 0.1.1

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.
Files changed (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +214 -2
  3. package/index.ts +16 -0
  4. package/package.json +62 -3
  5. package/proto/README.md +78 -0
  6. package/proto/buf/validate/validate.proto +453 -0
  7. package/proto/cel/expr/checked.proto +109 -0
  8. package/proto/cel/expr/eval.proto +44 -0
  9. package/proto/cel/expr/explain.proto +22 -0
  10. package/proto/cel/expr/syntax.proto +119 -0
  11. package/proto/cel/expr/value.proto +47 -0
  12. package/proto/connectext/grpc/status/v1/status.proto +21 -0
  13. package/proto/errorspb/errors.proto +58 -0
  14. package/proto/errorspb/hintdetail.proto +9 -0
  15. package/proto/errorspb/markers.proto +12 -0
  16. package/proto/errorspb/tags.proto +14 -0
  17. package/proto/errorspb/testing.proto +8 -0
  18. package/proto/exa/analytics_pb/analytics.proto +190 -0
  19. package/proto/exa/api_server_pb/api_server.proto +2590 -0
  20. package/proto/exa/auth_pb/auth.proto +21 -0
  21. package/proto/exa/auto_cascade_common_pb/auto_cascade_common.proto +81 -0
  22. package/proto/exa/browser_preview_pb/browser_preview.proto +26 -0
  23. package/proto/exa/bug_checker_pb/bug_checker.proto +24 -0
  24. package/proto/exa/cascade_plugins_pb/cascade_plugins.proto +264 -0
  25. package/proto/exa/chat_client_server_pb/chat_client_server.proto +57 -0
  26. package/proto/exa/chat_pb/chat.proto +452 -0
  27. package/proto/exa/code_edit/code_edit_pb/code_edit.proto +186 -0
  28. package/proto/exa/codeium_common_pb/browser_context.proto +31 -0
  29. package/proto/exa/codeium_common_pb/codeium_common.proto +4183 -0
  30. package/proto/exa/context_module_pb/context_module.proto +174 -0
  31. package/proto/exa/cortex_pb/cortex.proto +3288 -0
  32. package/proto/exa/dev_pb/dev.proto +28 -0
  33. package/proto/exa/diff_action_pb/diff_action.proto +76 -0
  34. package/proto/exa/eval/pr_eval/datasets_pb/datasets.proto +106 -0
  35. package/proto/exa/eval_pb/eval.proto +1318 -0
  36. package/proto/exa/extension_server_pb/extension_server.proto +555 -0
  37. package/proto/exa/file_system_provider_pb/file_system_provider.proto +75 -0
  38. package/proto/exa/index_pb/index.proto +469 -0
  39. package/proto/exa/knowledge_base_pb/knowledge_base.proto +146 -0
  40. package/proto/exa/language_server_pb/language_server.proto +2435 -0
  41. package/proto/exa/model_management_pb/model_management.proto +184 -0
  42. package/proto/exa/opensearch_clients_pb/opensearch_clients.proto +495 -0
  43. package/proto/exa/product_analytics_pb/product_analytics.proto +39 -0
  44. package/proto/exa/prompt_pb/prompt.proto +97 -0
  45. package/proto/exa/reactive_component_pb/reactive_component.proto +98 -0
  46. package/proto/exa/seat_management_pb/seat_management.proto +2910 -0
  47. package/proto/exa/tokenizer_pb/tokenizer.proto +39 -0
  48. package/proto/exa/trainer_pb/config.proto +643 -0
  49. package/proto/exa/tree_sitter/language_data_pb/language_data.proto +14 -0
  50. package/proto/exa/trust_pb/trust.proto +192 -0
  51. package/proto/exa/user_analytics_pb/user_analytics.proto +752 -0
  52. package/proto/google/api/expr/v1alpha1/checked.proto +108 -0
  53. package/proto/google/api/expr/v1alpha1/eval.proto +38 -0
  54. package/proto/google/api/expr/v1alpha1/explain.proto +22 -0
  55. package/proto/google/api/expr/v1alpha1/syntax.proto +126 -0
  56. package/proto/google/api/expr/v1alpha1/value.proto +47 -0
  57. package/proto/google/protobuf/any.proto +15 -0
  58. package/proto/google/protobuf/cpp_features.proto +22 -0
  59. package/proto/google/protobuf/descriptor.proto +473 -0
  60. package/proto/google/protobuf/duration.proto +16 -0
  61. package/proto/google/protobuf/empty.proto +14 -0
  62. package/proto/google/protobuf/go_features.proto +31 -0
  63. package/proto/google/protobuf/struct.proto +34 -0
  64. package/proto/google/protobuf/timestamp.proto +16 -0
  65. package/proto/google/protobuf/wrappers.proto +47 -0
  66. package/proto/google/rpc/status.proto +18 -0
  67. package/proto/grpc/binlog/v1/binarylog.proto +89 -0
  68. package/proto/io/prometheus/client/metrics.proto +103 -0
  69. package/src/core/auth/access.ts +6 -0
  70. package/src/core/auth/index.ts +2 -0
  71. package/src/core/auth/login.ts +177 -0
  72. package/src/core/auth/rest-exchange.ts +35 -0
  73. package/src/core/client.ts +153 -0
  74. package/src/core/index.ts +12 -0
  75. package/src/core/inference/chat.ts +229 -0
  76. package/src/core/inference/images.ts +24 -0
  77. package/src/core/inference/messages.ts +34 -0
  78. package/src/core/inference/retry.ts +68 -0
  79. package/src/core/inference/state.ts +8 -0
  80. package/src/core/models/access.ts +7 -0
  81. package/src/core/models/catalog.ts +35 -0
  82. package/src/core/models/index.ts +4 -0
  83. package/src/core/models/select.ts +43 -0
  84. package/src/core/models/variants.ts +163 -0
  85. package/src/core/protocol/device.ts +73 -0
  86. package/src/core/protocol/fingerprint.ts +59 -0
  87. package/src/core/protocol/http.ts +109 -0
  88. package/src/core/protocol/protobuf.ts +112 -0
  89. package/src/core/protocol/transport.ts +501 -0
  90. package/src/core/types.ts +115 -0
  91. package/src/pi/auth.ts +134 -0
  92. package/src/pi/devin-command.ts +76 -0
  93. package/src/pi/devin-panel.ts +77 -0
  94. package/src/pi/devin-settings.ts +50 -0
  95. package/src/pi/extension.ts +80 -0
  96. package/src/pi/fusion-command.ts +83 -0
  97. package/src/pi/fusion-picker.ts +171 -0
  98. package/src/pi/fusion-settings.ts +44 -0
  99. package/src/pi/lifecycle.ts +217 -0
  100. package/src/pi/messages.ts +107 -0
  101. package/src/pi/models.ts +379 -0
  102. package/src/pi/provider.ts +241 -0
  103. package/src/pi/sidekick-report.ts +42 -0
  104. package/src/pi/sidekick-runtime.ts +287 -0
  105. package/src/pi/sidekick.ts +190 -0
  106. package/src/pi/stream.ts +124 -0
  107. package/src/pi/usage.ts +153 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 buYoung
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,215 @@
1
- # Temporary Holding Version
1
+ # pi-devin
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An **unofficial** provider that lets you use Devin models in [Pi](https://github.com/earendil-works/pi) with your Devin account.
4
+
5
+ > This package is not made or endorsed by Cognition (the company behind Devin). It uses private Devin CLI APIs that can change without notice. You are responsible for judging and accepting any risk of violating the terms of service or having your account restricted.
6
+
7
+ ## Features
8
+
9
+ - Sign in to your Devin account with Pi's `/login` (OAuth). API keys are not used.
10
+ - Pick the Devin models your account can use in `/model`, and the thinking level in `/thinking`.
11
+ - **Devin Fusion**: a lead model hands tasks to a sidekick model.
12
+ - **`/devin`**: view quota and session usage, and change display settings.
13
+
14
+ ## Requirements
15
+
16
+ - Pi and Node.js 22.19.0 or later
17
+ - A Devin account that may use the Devin CLI, with quota left. Without both, you cannot chat even after a successful login.
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ pi install npm:@buyong/pi-devin
23
+ ```
24
+
25
+ Restart Pi, or run `/reload` in a running Pi.
26
+
27
+ ## Checking the installation
28
+
29
+ Run these in a shell from any directory. They need no Devin account and send no requests to Devin.
30
+
31
+ ```bash
32
+ node --version # 22.19.0 or later
33
+ pi --version # tested with 1.3.0
34
+ pi list # "User packages:" includes npm:@buyong/pi-devin and its installed path
35
+ ```
36
+
37
+ Then start `pi` and type the following inside Pi:
38
+
39
+ | Pi input | Expected result |
40
+ | --- | --- |
41
+ | (startup) | No `[Extension issues]` entry that mentions pi-devin |
42
+ | `/devin` | The usage and settings screen opens. Before you log in, it shows `Account quota · not received yet`. It sends no network requests. Press esc to close it. |
43
+ | `/devin-fusion` | Before you log in: the warning `No Devin models are available for Fusion.` After you log in: the two-column lead and sidekick picker. |
44
+ | `/reload`, then `/devin` again | The same screen, with no extension error |
45
+
46
+ The following steps need a Devin account and use its quota:
47
+
48
+ 1. Log in as described in [Getting started](#getting-started). `/model` then lists entries ending in `[devin]`.
49
+ 2. Pick a Devin model and send a short message, such as `Please say hello briefly.` A reply arrives.
50
+ 3. Optional: pick **Devin Fusion** (`fusion`) in `/model` and ask for a small task. The lead calls the `devin_sidekick` tool and uses the sidekick's report in its answer.
51
+
52
+ The source and archive checks for developers are in `verification/README.md` in the [GitHub repository](https://github.com/buYoung/pi-packages/tree/main/apps/pi-devin). They are not included in the npm package.
53
+
54
+ ## Getting started
55
+
56
+ 1. In Pi, run `/login` → **Sign in with an account** → **Devin**.
57
+ 2. Choose browser login or manual entry. With manual entry, paste the one-time code shown on the browser login page. API keys and session tokens are not accepted.
58
+ 3. Once the model list refreshes, pick a Devin model in `/model`.
59
+ 4. If needed, pick a thinking level with `/thinking`. The available levels depend on the model. For example, SWE-2 offers medium, high and max.
60
+ 5. Send a message. From this point on, you use your account quota. Pi runs the tools.
61
+
62
+ ## Model list
63
+
64
+ - The list shows one entry per model family by ID, such as `claude-opus-4.8 [devin]`. The name (`Claude Opus 4.8`) appears under `Model Name` below the selected row.
65
+ - Variants for each thinking level are not listed separately; pick them with `/thinking`. Turning on "Recommended models only" changes the list (see [below](#devin-usage-and-display-settings)).
66
+ - When a family comes in variants with different options, such as Fast Mode, each gets its own entry with the option added to the ID, such as `claude-opus-4.8-fast-mode`.
67
+ - The models and features you see depend on your account.
68
+ - A price of `0` means the cost is unknown, not free.
69
+
70
+ ## `/devin`: usage and display settings
71
+
72
+ Running `/devin` in the TUI shows the following on one screen. Use ↑↓ to move, space or Enter to toggle, and esc to close.
73
+
74
+ - Account quota: daily and weekly remaining-percentage bars, reset times and when the data was fetched
75
+ - Usage in this session: request count and input, output and cache tokens. Sidekick conversations are not included.
76
+ - Run budget: a bar of the model requests used so far by the current (or last) user message, out of the per-message limit (see [Limits and behavior](#limits-and-behavior))
77
+
78
+ There are two toggles, both off by default. Changes apply to all sessions at once.
79
+
80
+ - **Recommended models only**: `/model` shows only the models that have a variant Devin marks as Recommended, plus Devin Fusion. Devin marks single variants such as `swe-2-high`, but the list keeps the model itself (`swe-2`), so you still pick the thinking level with `/thinking`. The recommended level is not applied automatically. If your account has no recommended models, the full list is shown.
81
+ - **Usage in status line**: the TUI footer shows the remaining daily and weekly quota as bars, plus this session's input and output tokens, like `devin day ▕█████████░▏98% week ▕█████████░▏98% · ↑263 ↓49`. A bar turns to the warning color at 40% or less and to the error color at 20% or less.
82
+
83
+ Quota is not live. It is refreshed when you log in and when Pi checks the login right before sending a model request, so the usage of the message you just sent shows up after the next request. `/devin` and the status line send no network requests. Credits, per-request costs and usage history are not shown.
84
+
85
+ If a filter change removes the model you are using from the list, you can keep using it in the current session. When you reopen the session, that model is not restored, so pick a model from the list again.
86
+
87
+ Outside the TUI, such as in RPC mode, change settings with `/devin recommended on|off` and `/devin status on|off`. Without arguments, `/devin` sends quota, usage and settings as a notification.
88
+
89
+ ## Devin Fusion
90
+
91
+ Picking **Devin Fusion** (`fusion`) in `/model` turns on the `devin_sidekick` tool for the lead model. The lead uses this tool to hand tasks to the sidekick model and receive its report. Switching to another model turns the tool off.
92
+
93
+ - The default pair is SWE-2 (lead) and SWE-2 Medium (sidekick). If your account has no SWE-2 Medium, the Fusion entry is not shown.
94
+ - Change the pair with `/devin-fusion`. In the TUI, you pick the lead and sidekick together in two columns. Press tab to switch columns, type to filter and press Enter to save. ★ marks recommended models and ● the saved pair.
95
+ - You can also use arguments: `/devin-fusion <lead model ID> <sidekick model ID>` (for example, `/devin-fusion swe-2 swe-2-high`). The lead is a family ID from the `/model` list; the sidekick is a variant ID with a fixed thinking level. With the TUI picker you do not need to know the IDs. The saved pair applies to all sessions.
96
+ - The lead's thinking level follows `/thinking`.
97
+ - The sidekick runs as a separate Pi process for each lead session. It shares the working directory, active tools and Devin login with the lead.
98
+ - By default, the lead waits for the sidekick's report. If the lead model calls the `devin_sidekick` tool with `block: false`, it continues without waiting, and runs again when the report arrives. Cancelling the lead also stops the sidekick task it was waiting for.
99
+ - The lead receives at most about 131,072 tokens of each sidekick report, counted like Pi's own context estimate (4 characters per token). A longer report is cut at that point, and the cut report ends with the path of a temporary file that holds the complete text (see [Storage locations](#storage-locations)).
100
+ - If you restricted tools with `pi --tools`, include `devin_sidekick` in the list for Fusion to work.
101
+ - With Fusion, the lead and the sidekick each use quota as regular requests to the models they call.
102
+
103
+ ## Limits and behavior
104
+
105
+ | Item | Behavior |
106
+ | --- | --- |
107
+ | Model request budget | Processing one user message calls models up to 8 times by default, including tool follow-ups, retries and auto-compaction. Each sidekick task gets the same limit separately. Change it with `PI_DEVIN_MAX_MODEL_CALLS` (1–100). |
108
+ | Request timeout | Follows the value set by Pi (300 seconds by default). |
109
+ | Prompt cache | Short cache by default. `PI_CACHE_RETENTION=long` is allowed only for models Devin marks with a 24-hour cache; for other models the request is refused before sending. |
110
+ | Images | On supported models, up to 4 MiB per image and 5 MiB in total per message. |
111
+ | Sidekick report | The lead receives at most about 131,072 tokens (524,288 characters) of each report. The complete text of a longer report is saved in a temporary file. |
112
+ | print and JSON modes | These modes do not fetch the model list; they use the list stored by an earlier TUI or RPC session. After logging in, run the TUI or RPC mode once, or `--model devin/<model ID>` is not found. |
113
+
114
+ - On a 401 error, log in again. 403, 429 and timeouts are not treated as an expired login. If logging in again does not help, check your account permissions, quota and network.
115
+ - If an error occurs while a response is streaming, tool calls in that response are not run. Send the message again.
116
+
117
+ ## Device information
118
+
119
+ Like the Devin CLI, requests to the Devin server include device information. On macOS, the package reads the device serial number and network MAC addresses; on other OSes, the MAC addresses and the user name. There is no setting to turn this off.
120
+
121
+ ## Storage locations
122
+
123
+ | Content | Location |
124
+ | --- | --- |
125
+ | Pi login data | Managed by Pi. Default `~/.pi/agent/auth.json` |
126
+ | Package settings | `pi-devin/settings.json` (`/devin`) and `pi-devin/fusion.json` (`/devin-fusion`) in the Pi agent directory |
127
+ | Sidekick conversations | `pi-devin/sidekick/<lead session ID>.jsonl` in the Pi agent directory |
128
+ | Complete text of cut sidekick reports | `pi-devin-sidekick-report-*/report.md` in the system temporary directory, readable only by you. Written only when a report exceeds the limit; the system may delete it later. |
129
+
130
+ The Pi agent directory defaults to `~/.pi/agent` and can be changed with `PI_CODING_AGENT_DIR`.
131
+
132
+ ## Update, logout and removal
133
+
134
+ ```bash
135
+ pi update npm:@buyong/pi-devin # updates only this package (plain `pi update` updates Pi itself)
136
+ pi remove npm:@buyong/pi-devin # removes the package
137
+ ```
138
+
139
+ To log out, run `/logout` → Devin in Pi. This deletes only the login data on this device; it does not end the session on the server.
140
+
141
+ If you installed an exact version, such as `npm:@buyong/pi-devin@0.1.0`, `pi update` keeps that version even though it prints `Updated`. To move to another version, install it explicitly with `pi install npm:@buyong/pi-devin@<version>`.
142
+
143
+ To use the package in one project only, run `pi install npm:@buyong/pi-devin -l` and `pi remove npm:@buyong/pi-devin -l` inside that project. Project packages load only in a trusted project.
144
+
145
+ If you log in with another account, a session used with the previous account returns an error instead of sending its conversation to the new account. Start a new Pi session.
146
+
147
+ ## CLI (optional)
148
+
149
+ You do not need it to use Pi. This repository includes a CLI (`cli.ts`) for checking login and chat without Pi.
150
+
151
+ The CLI is not included in the npm package. Run it from a source checkout.
152
+
153
+ ```bash
154
+ git clone https://github.com/buYoung/pi-packages.git
155
+ cd pi-packages
156
+ pnpm --filter @buyong/pi-devin install --frozen-lockfile --ignore-scripts
157
+ cli=apps/pi-devin/cli.ts
158
+ node "$cli" --help
159
+ node "$cli" login # browser login; opening the browser automatically works only on macOS
160
+ node "$cli" status
161
+ node "$cli" models
162
+ node "$cli" chat --model swe-2-medium --prompt "Please say hello briefly." \
163
+ --allow-model-calls --no-title --no-analytics
164
+ ```
165
+
166
+ - `chat` calls a model only with `--allow-model-calls`. By default, like the Devin CLI, it also sends a title generation request and analytics events. `--no-title` and `--no-analytics` turn these off.
167
+ - If a browser cannot be opened, enter the code yourself with `login --force-manual-token-flow --no-browser`.
168
+ - CLI login data is stored separately from Pi in `~/.local/share/devin-protocol-poc/`. Change the location with `DEVIN_POC_STATE_DIR`.
169
+
170
+ ## Tested environments
171
+
172
+ | Item | Tested with |
173
+ | --- | --- |
174
+ | Pi | 1.3.0 |
175
+ | Node.js | 22.19.0, 24.14.0 |
176
+ | OS | macOS arm64. Linux arm64 passed automated tests only (real Pi screens and a real account were not checked) |
177
+ | Real account | With SWE-2 models: login, model list, chat, thinking level changes, tool calls, Fusion, the recommended model filter, and quota and usage in the `/devin` notification in RPC mode (2026-10-20) |
178
+
179
+ The TUI-only screens (the `/devin` screen, the status line and the Fusion picker) were not checked with a real account. Other Pi versions and Windows were not checked either.
180
+
181
+ ## Schema source and license
182
+
183
+ The code in this package is MIT licensed ([LICENSE](LICENSE)).
184
+
185
+ The protocol schema shipped in `proto/` is based on a descriptor that the third-party repository [leookun/devin-2api](https://github.com/leookun/devin-2api) says it extracted from the Devin CLI. This package then analyzed the protocol itself and added four definitions the base descriptor lacks; they are marked `[added field]`/`[added value]` in the sources and listed in `proto/README.md`. The runtime loads `proto/` directly.
186
+
187
+ leookun/devin-2api is distributed under the MIT License, and its notice is reproduced below as that license requires. The license covers leookun's work; the copyright and distribution rights of the schema it says it extracted from the Devin CLI have not been verified.
188
+
189
+ ```text
190
+ MIT License
191
+
192
+ Copyright (c) 2026 leookun
193
+
194
+ Permission is hereby granted, free of charge, to any person obtaining a copy
195
+ of this software and associated documentation files (the "Software"), to deal
196
+ in the Software without restriction, including without limitation the rights
197
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
198
+ copies of the Software, and to permit persons to whom the Software is
199
+ furnished to do so, subject to the following conditions:
200
+
201
+ The above copyright notice and this permission notice shall be included in all
202
+ copies or substantial portions of the Software.
203
+
204
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
205
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
206
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
207
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
208
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
209
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
210
+ SOFTWARE.
211
+ ```
212
+
213
+ ## Development
214
+
215
+ The source and verification procedures are in the [GitHub repository](https://github.com/buYoung/pi-packages/tree/main/apps/pi-devin). See `verification/README.md` for verification and `proto/README.md` for the schema sources.
package/index.ts ADDED
@@ -0,0 +1,16 @@
1
+ import { getAgentDir, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
+ import { devinSettingsPath, fileDevinSettings } from "./src/pi/devin-settings.ts";
3
+ import { registerDevinExtension } from "./src/pi/extension.ts";
4
+ import { fileFusionSettings, fusionSettingsPath } from "./src/pi/fusion-settings.ts";
5
+ import { modelCallLimit } from "./src/pi/lifecycle.ts";
6
+ import { FUSION_CHILD_ENV } from "./src/pi/sidekick.ts";
7
+
8
+ export default function devinExtension(pi: ExtensionAPI): void {
9
+ const isFusionChild = process.env[FUSION_CHILD_ENV] === "1";
10
+ registerDevinExtension(pi, {
11
+ maxModelCalls: modelCallLimit(process.env.PI_DEVIN_MAX_MODEL_CALLS),
12
+ isFusionChild,
13
+ fusionSettings: isFusionChild ? undefined : fileFusionSettings(fusionSettingsPath(getAgentDir())),
14
+ devinSettings: isFusionChild ? undefined : fileDevinSettings(devinSettingsPath(getAgentDir())),
15
+ });
16
+ }
package/package.json CHANGED
@@ -1,6 +1,65 @@
1
1
  {
2
2
  "name": "@buyong/pi-devin",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "type": "module",
5
+ "description": "Unofficial Pi provider for Devin accounts (OAuth)",
6
+ "license": "MIT",
7
+ "engines": {
8
+ "node": ">=22.19.0"
9
+ },
10
+ "keywords": [
11
+ "pi-package"
12
+ ],
13
+ "files": [
14
+ "index.ts",
15
+ "src/core",
16
+ "src/pi",
17
+ "proto",
18
+ "README.md",
19
+ "LICENSE"
20
+ ],
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/buYoung/pi-packages.git",
24
+ "directory": "apps/pi-devin"
25
+ },
26
+ "homepage": "https://github.com/buYoung/pi-packages/tree/main/apps/pi-devin#readme",
27
+ "bugs": {
28
+ "url": "https://github.com/buYoung/pi-packages/issues"
29
+ },
30
+ "publishConfig": {
31
+ "access": "public",
32
+ "registry": "https://registry.npmjs.org/"
33
+ },
34
+ "pi": {
35
+ "extensions": [
36
+ "./index.ts"
37
+ ],
38
+ "skills": [],
39
+ "prompts": [],
40
+ "themes": []
41
+ },
42
+ "dependencies": {
43
+ "protobufjs": "8.8.1"
44
+ },
45
+ "peerDependencies": {
46
+ "@earendil-works/pi-ai": "*",
47
+ "@earendil-works/pi-coding-agent": "*",
48
+ "@earendil-works/pi-tui": "*"
49
+ },
50
+ "devDependencies": {
51
+ "@bufbuild/buf": "1.74.0",
52
+ "@earendil-works/pi-ai": "1.3.0",
53
+ "@earendil-works/pi-coding-agent": "1.3.0",
54
+ "@earendil-works/pi-tui": "1.3.0",
55
+ "@types/node": "26.6.5",
56
+ "@typescript/native-preview": "7.0.0-dev.20260707.2",
57
+ "@repo/typescript-config": "0.0.0"
58
+ },
59
+ "scripts": {
60
+ "typecheck": "tsgo --noEmit",
61
+ "verify:offline": "node --test tests/*.test.ts",
62
+ "test:unit": "node --test tests/*.test.ts",
63
+ "cli": "node cli.ts"
64
+ }
6
65
  }
@@ -0,0 +1,78 @@
1
+ # proto sources
2
+
3
+ `.proto` sources for the Devin protocol schema. The runtime (`src/core/protocol/protobuf.ts`) parses this directory directly, and the npm package ships it (`files` in `package.json` lists `proto`). `buf` remains a development-only compile check; no built descriptor is shipped.
4
+
5
+ ## Layout
6
+
7
+ - The 63 files of the original FileDescriptorSet keep their original logical paths and import relationships. This includes the dependency files that were in the original, such as `google/protobuf/*`, `google/api/expr/*` and `buf/validate/validate.proto`.
8
+ - Declarations, numbers, labels, proto3 optional, oneofs, maps, reserved ranges, extensions, defaults, custom `json_name` and options were copied from the original as is, including the `buf.validate` custom options.
9
+ - The original has no SourceCodeInfo. The original comments and formatting cannot be recovered, so there are no comments other than the notes on observed additions. Types in the same package use relative names; types from other packages use the fully qualified name with a leading dot (`.exa.codeium_common_pb.Metadata`).
10
+ - The current tree is edited directly and keeps the original logical paths and declaration order. Only the order in 3 files was adjusted so the compiler produces the original declaration order: the added value 7 of `DisplayOption` moved after the base descriptor's values, and the nested messages `Index.RepoStats` and `SourceInfo.Extension` moved before the map fields. Fields, numbers and options match the previously printed tree (the `descriptor-to-proto.mjs` output).
11
+ - This source is now the shipped schema itself. The runtime loads it directly, so edits take effect on the next start. The original third-party descriptor is not shipped and not kept in the package.
12
+
13
+ ## Added definitions
14
+
15
+ Definitions that the base descriptor does not have. This package added them from its own protocol analysis, and they are marked with `[added field]` or `[added value]` comments in the source. The names are this package's DTO names, not the original identifiers. They go into the built descriptor as is, so the runtime does not add them separately. The evidence is in `verification/followup/proto-provenance.json`.
16
+
17
+ | Location | Definition |
18
+ | --- | --- |
19
+ | `exa.api_server_pb.GetChatMessageRequest` | `string client_session_id = 28` |
20
+ | `exa.chat_pb.ChatMessagePrompt` | `string model_uid = 22` |
21
+ | `exa.codeium_common_pb.ModelInfo` | `repeated string aliases = 27` |
22
+ | `exa.codeium_common_pb.DisplayOption` | `DISPLAY_OPTION_WIRE_7 = 7` |
23
+
24
+ ## Verification
25
+
26
+ First install the dev dependencies from the repository root. The compiler is the app's dev dependency `@bufbuild/buf` 1.74.0 (Apache-2.0). Platform binaries come as optional packages and need no install scripts.
27
+
28
+ ```bash
29
+ pnpm --filter @buyong/pi-devin install --frozen-lockfile --ignore-scripts
30
+ ```
31
+
32
+ Run from `apps/pi-devin`.
33
+
34
+ ```bash
35
+ node verification/scripts/verify-proto.mjs --report verification/followup/proto-check.json --mutation-control
36
+ ```
37
+
38
+ Exit 0 means all of the checks below passed. Exit 1 means one of compilation, a wire check or a control failed. Reports are written only to `verification/followup/` or the Node temp directory (`TMPDIR`).
39
+
40
+ 1. The source tree must compile: `buf build proto --as-file-descriptor-set --exclude-source-info` must succeed in a temp directory.
41
+ 2. Bytes produced by the real runtime codecs (`chatRequestCodec`, `chatResponseCodec`, `unaryCodecs`) are decoded and re-encoded with a root parsed from the same source tree, using the 7 preserved capture requests and responses, the model catalog fixture and 4 probes for the additions. The added fields must resolve by name. As a control, with a root parsed from a copy that omits the additions, those fields must disappear or remain as numbers.
42
+ 3. With `--mutation-control`, one field number (`ChatMessagePrompt.signature_type` 18→1018) is changed in a temp copy, and the compiled result must differ from the unmodified build.
43
+
44
+ The byte-for-byte comparison against a shipped descriptor and the optional comparison against the original third-party descriptor were removed when the runtime switched to loading this directory directly. The recorded results remain in `verification/followup/proto-check-08.json` and `verification/followup/proto-check-12.json`, and the normalization rules below document that record.
45
+
46
+ ### Normalization rules (record of the original comparison)
47
+
48
+ | ID | Rule | Applied |
49
+ | --- | --- | --- |
50
+ | N1 | Empty `MethodOptions` (`{}`) in the original are compared as absent. The built shipped file has none either. They look like traces of source-retention options removed before the original was generated, and their values cannot be recovered. | 654 |
51
+ | N2 | Fields without a `json_name` in the original are compared with the default `json_name` the compiler produces. The built shipped file contains the default, and protobufjs does not use it. | 14 |
52
+ | N3 | Files are matched by name. The file order inside the FileDescriptorSet is only reported. | - |
53
+
54
+ The protobufjs 7.6.6 descriptor schema is not used as the reference decoder, because re-encoding the original with it drops custom options and editions fields from 21 files.
55
+
56
+ ## Changing the schema
57
+
58
+ When a new wire definition appears, change the following together.
59
+
60
+ 1. Add the definition with an `[added field]` (or `[added value]` for enums) comment to the relevant `.proto`. Put it after the original declarations so the declaration order stays stable.
61
+ 2. Add the evidence and whether the name is local to `observedAdditions` in `verification/followup/proto-provenance.json`.
62
+ 3. There is no build step: the runtime reads this directory, so edit the sources directly and rerun the verifier.
63
+
64
+ Then run the verifier and save the report under a new per-task name (for example, `proto-check-13.json`) instead of overwriting an earlier report. If the schema changes, redo the artifact verification (06).
65
+
66
+ ## Printing again
67
+
68
+ To view a descriptor's declarations as `.proto` again, pass a new empty directory and an explicit `--descriptor <FileDescriptorSet>`. The tool does not overwrite a non-empty directory, and the output has no `[added …]` comments. The package no longer keeps a built descriptor.
69
+
70
+ ```bash
71
+ node verification/scripts/descriptor-to-proto.mjs --out "$(mktemp -d)/printed"
72
+ ```
73
+
74
+ You can also build just a temporary descriptor.
75
+
76
+ ```bash
77
+ pnpm exec buf build proto --as-file-descriptor-set --exclude-source-info -o "${TMPDIR:-/tmp}/regenerated.binpb"
78
+ ```