larkin 0.2.93 → 0.3.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.
package/README.md CHANGED
@@ -22,7 +22,7 @@ npm install -g larkin
22
22
  larkin --version
23
23
  ```
24
24
 
25
- Standalone binaries for macOS, Linux, and Windows (x64) are attached to every [GitHub Release](https://github.com/eddiearc/larkin/releases) for environments without Bun or npm. Windows binaries are cross-compiled; their runtime behavior has not been end-to-end verified on a Windows host.
25
+ Standalone binaries for macOS, Linux, and Windows (x64) are attached to every [GitHub Release](https://github.com/eddiearc/larkin/releases) for environments without Bun or npm. The Windows 11 x64 core path has passed native end-to-end startup verification. Pull requests and releases also have a blocking native Windows gate that verifies the standalone executable's manifest and SHA-256 before checking its version, help output, and embedded Dashboard over HTTP.
26
26
 
27
27
  ## Usage
28
28
 
@@ -36,12 +36,42 @@ The rest of this document uses the short `larkin` form; it works as-is after `np
36
36
 
37
37
  Run `larkin --help` or `larkin config --help` for the available commands and configuration options. Local configuration is stored under `~/.larkin` by default; set `LARKIN_CONFIG_DIR` to use another directory.
38
38
 
39
+ ### Feishu message links
40
+
41
+ Feishu clients do not reliably render Markdown links such as `[label](URL)` as clickable in text or Markdown messages. When a recipient must be able to open a link, keep the complete bare HTTPS URL visible, for example: Issue 115 — https://github.com/eddiearc/larkin/issues/115. A label may accompany it, but must not replace the bare URL. Larkin does not rewrite exact, verbatim, or user-authored message bodies to enforce this guidance.
42
+
39
43
  During setup, a new Agent is offered Pi first, followed by Codex and Claude Code. Pi can use an existing
40
44
  official `pi` installation or the official Pi runtime bundled in Larkin. The bundled option supports
41
45
  DeepSeek, Kimi/Moonshot, MiniMax, Zhipu/BigModel, and a custom OpenAI-compatible Base URL. Provider keys
42
46
  are stored only in the selected Agent's private provider directory, not in the ordinary Agent config. Setup
43
47
  also discovers every API-key and OAuth/subscription login exposed by the pinned official Pi registry and
44
48
  delegates those flows to Pi. Use `larkin pi-auth status` or `larkin pi-auth logout <provider>` to manage them.
49
+ The builtin Pi runtime loads Larkin's two supported extensions inline: background subagents and the 60-second
50
+ foreground bash timeout guard are enabled without writing extension files or arguments. A compatible external
51
+ Pi installation keeps the existing explicit `-e` extension path.
52
+
53
+ ### Windows support boundary and optional autostart
54
+
55
+ Windows 11 x64 core support covers the standalone CLI, local Runtime Host startup, builtin Pi RPC with the
56
+ inline extensions above, and the embedded Dashboard. Provider authentication, the official `lark-cli`, and
57
+ external Codex, Claude Code, or Pi executables remain separately installed dependencies; secret-bearing live
58
+ channel/provider tests are intentionally outside the hosted Windows CI gate.
59
+
60
+ An Administrator account can optionally start Larkin at that account's interactive logon with Task Scheduler.
61
+ From an elevated PowerShell prompt, adjust the executable and working-directory paths first:
62
+
63
+ ```powershell
64
+ $Exe = 'C:\Tools\Larkin\larkin.exe'
65
+ $WorkDir = 'C:\Tools\Larkin'
66
+ $Action = New-ScheduledTaskAction -Execute $Exe -Argument 'start' -WorkingDirectory $WorkDir
67
+ $Trigger = New-ScheduledTaskTrigger -AtLogOn -User $env:USERNAME
68
+ Register-ScheduledTask -TaskName 'Larkin Runtime Host' -Action $Action -Trigger $Trigger `
69
+ -Description 'Start Larkin for this Administrator account at logon' -RunLevel Highest
70
+ ```
71
+
72
+ This is an optional per-user Administrator-logon task, not SYSTEM boot support or a Windows service. Keep the
73
+ account profile available because Larkin stores its state there. Release executables are currently unsigned;
74
+ normal Windows security policy and SmartScreen decisions still apply.
45
75
 
46
76
  For supported Feishu cloud-document comments (`doc`, `docx`, `sheet`, and `file`), the safe default accepts only comments or replies that @ the Bot. Document comments never reuse IM `require`/`free` settings. An explicit platform-verified application-dimension Bot subscription accepts every supported comment event that Feishu actually delivers, whether or not it mentions the Bot. Larkin stores accepted comments as `kind=document_comment` canonical Inbox events and wakes the Bot's persistent Agent. Replies are bound back to the exact comment; whole-document comments use Feishu's top-level fallback. `larkin setup --comment-subscription application` makes the broad trigger surface explicit, creates the Bot subscription through the official `lark-cli` structured API, and then verifies it with the read-only platform status API. `--comment-subscription none` explicitly removes that application subscription and verifies removal. Until positive status verification, only @Bot comments enter the Inbox. Setup requests `docs:document.comment:create` for both in-thread replies and whole-document `create_v2` fallback, while retaining `drive:drive` for event/read support. `larkin agents` reports event readiness, reply-scope readiness, subscription mode/status/dimension, arrivals, and read failures.
47
77
 
@@ -4,7 +4,7 @@ Generated at release time from Larkin's installed runtime dependency closure.
4
4
  Development-only dependencies are intentionally excluded. Packages without a bundled license file
5
5
  use an explicitly audited, version- and hash-pinned license source and remain identified by locked package name and version.
6
6
 
7
- Runtime package versions: 208
7
+ Runtime package versions: 212
8
8
 
9
9
  | Package | Version | Relationship | Declared license | License texts (SHA-256) | Lock integrity |
10
10
  | --- | ---: | --- | --- | --- | --- |
@@ -89,6 +89,7 @@ Runtime package versions: 208
89
89
  | @radix-ui/react-use-effect-event | 0.0.5 | runtime transitive | MIT | LICENSE (0e80a2d229d2fd4fc7e8636142ec5d0ff0bc031f14c15b682e2ac01dfd5b5138) | sha512-7cshFL8HGS/7HEiHH+9kL9HBwp2sa9yX18Knwek6KYWmXwM7pegMgta2AXMQKI+rq3JnfSj9x8wYqFMTdG1Jgg== |
90
90
  | @radix-ui/react-use-layout-effect | 1.1.4 | runtime transitive | MIT | LICENSE (0e80a2d229d2fd4fc7e8636142ec5d0ff0bc031f14c15b682e2ac01dfd5b5138) | sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw== |
91
91
  | @silvia-odwyer/photon-node | 0.3.4 | runtime transitive | Apache-2.0 | LICENSE.md (db5502bc3655d2665d535496106117b522be88275d3ae459185fa20fa087a9b9) | sha512-bnly4BKB3KDTFxrUIcgCLbaeVVS8lrAkri1pEzskpmxu9MdfGQTy8b8EgcD83ywD3RPMsIulY8xJH5Awa+t9fA== |
92
+ | @sinclair/typebox | 0.34.52 | runtime transitive | MIT | license (411f1c560755e27b3dec9622c13b8b7a3ec1c83f4ffb8c56a8847528aa96911a) | sha512-XiMQh7qqVlxZzcVD+kkGMNGMzcTrDMLWI7S4x7z1MkCkbDPrekpZXEUK0eZqZFMuHQg2a2DZOcDIh9o5v3Gonw== |
92
93
  | @smithy/core | 3.31.1 | runtime transitive | Apache-2.0 | LICENSE (07364a5f7d0177a59a05a0002187431f8f899320983c0dc049d72df015e8064c) | sha512-CyogUINxvi7C7LDsh8Syo6hVJOT9ckz4rG8dRZfTJ8r91HkMY59PnNooaj7WcHyxEkxPfBAmbgztZU+xTo76lg== |
93
94
  | @smithy/credential-provider-imds | 4.4.16 | runtime transitive | Apache-2.0 | LICENSE (b659ef9e3ce8fe45329e05916c9c8bb98b436a16f4d4730a8946eec83e3950fe) | sha512-QfuLWAkLzptffFW980AFeHZFdqds2B64rpEd3uJ6lgs3xVn9QegGMUgUcj+4d7dRrAsya3r58ZKpku97WcFb4w== |
94
95
  | @smithy/fetch-http-handler | 5.6.13 | runtime transitive | Apache-2.0 | LICENSE (b659ef9e3ce8fe45329e05916c9c8bb98b436a16f4d4730a8946eec83e3950fe) | sha512-4fW86pEUOMbrD5nkbyl/tTvPHHWJFbuB2odl6ps9lWfHoXf9HWh3Q/Smh59qH1g7+c/BSZghX6bbUk4gsiMs8A== |
@@ -99,6 +100,7 @@ Runtime package versions: 208
99
100
  | @smithy/types | 4.16.1 | runtime transitive | Apache-2.0 | LICENSE (07364a5f7d0177a59a05a0002187431f8f899320983c0dc049d72df015e8064c) | sha512-0JFs3V2y2M9tKW5na/qxe69Zv+uxLMO7QBbhxF/FHu/Gp2NFZAAL9tWl9PU02xxo07pb3G9FTyjNc6D5uZrJIg== |
100
101
  | @smithy/util-buffer-from | 2.2.0 | runtime transitive | Apache-2.0 | LICENSE (b659ef9e3ce8fe45329e05916c9c8bb98b436a16f4d4730a8946eec83e3950fe) | sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA== |
101
102
  | @smithy/util-utf8 | 2.3.0 | runtime transitive | Apache-2.0 | LICENSE (b659ef9e3ce8fe45329e05916c9c8bb98b436a16f4d4730a8946eec83e3950fe) | sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A== |
103
+ | @tintinweb/pi-subagents | 0.14.3 | runtime direct | MIT | LICENSE (e7d9d11c28cce34f09dc7d2b0a3a6609ccba5fbc8e926e6d1bfdf060930e9f05) | sha512-iDqeadh6114AZvw8HYe1PEq8M0MZ9czJKTAIsklCPUbV9vUMS+g/LAV0vW3O9PiBXKNJh8hkrY8L6iIr8XNEqA== |
102
104
  | agent-base | 6.0.2 | runtime transitive | MIT | AUDITED-agent-base@9.0.0-LICENSE (71368fd0f5b4129191e9afcd1e1ef2dc89a9090d3e4d80bbab92dafd032b3bef) | sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== |
103
105
  | agent-base | 7.1.4 | runtime transitive | MIT | LICENSE (71368fd0f5b4129191e9afcd1e1ef2dc89a9090d3e4d80bbab92dafd032b3bef) | sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ== |
104
106
  | agent-base | 9.0.0 | runtime transitive | MIT | LICENSE (71368fd0f5b4129191e9afcd1e1ef2dc89a9090d3e4d80bbab92dafd032b3bef) | sha512-TQf59BsZnytt8GdJKLPfUZ54g/iaUL2OWDSFCCvMOhsHduDQxO8xC4PNeyIkVcA5KwL2phPSv0douC0fgWzmnA== |
@@ -115,6 +117,7 @@ Runtime package versions: 208
115
117
  | call-bound | 1.0.4 | runtime transitive | MIT | LICENSE (5e325595b4ea8cfec3802f545b1def5d7b73e4a5b8e9ba63e32a320f67732292) | sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg== |
116
118
  | chalk | 5.6.2 | runtime transitive | MIT | license (5c932d88256b4ab958f64a856fa48e8bd1f55bc1d96b8149c65689e0c61789d3) | sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA== |
117
119
  | combined-stream | 1.0.8 | runtime transitive | MIT | License (47eb8ca82c798246774946d1be0f9aa08f025fa8325ced0947aeeb4c05fe5547) | sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== |
120
+ | croner | 10.0.1 | runtime transitive | MIT | LICENSE (ad9aa40aaab4bee08121a0180096cc6a72abf29e19e606328b66c0178f41d267) | sha512-ixNtAJndqh173VQ4KodSdJEI6nuioBWI0V1ITNKhZZsO0pEMoDxz539T4FTTbSZ/xIOSuDnzxLVRqBVSvPNE2g== |
118
121
  | cross-spawn | 7.0.6 | runtime transitive | MIT | LICENSE (aaa78451b6fecd1b9c4594c796c133c0e90cad100372ff8bc6de615e9ef9adf1) | sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== |
119
122
  | data-uri-to-buffer | 4.0.1 | runtime transitive | MIT | AUDITED-package-declared-MIT (508a77d2e7b51d98adeed32648ad124b7b30241a8e70b2e72c99f92d8e5874d1) | sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== |
120
123
  | debug | 4.4.3 | runtime transitive | MIT | LICENSE (23eb8602cd5902bcfca56b23aa08e8672a809f5a12eaf8bb56abfa9d44e1a4fd) | sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA== |
@@ -173,6 +176,7 @@ Runtime package versions: 208
173
176
  | minimatch | 10.2.5 | runtime transitive | BlueOak-1.0.0 | LICENSE.md (2c7c5d22ed5a8ee968c64757710979afcd77438c48b4a265b94e615babd8a901) | sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg== |
174
177
  | minipass | 7.1.3 | runtime transitive | BlueOak-1.0.0 | LICENSE.md (8a1af140fdfbf5afd3df27f7e662f989c5b963a300020dfafce42033cae9e004) | sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A== |
175
178
  | ms | 2.1.3 | runtime transitive | MIT | license.md (1662fae9b5314d11cf51284e2dcd1f006a354f7343f08712a730fcff9a359801) | sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== |
179
+ | nanoid | 5.1.16 | runtime transitive | MIT | LICENSE (4383cb2c3608397ce7a4159502614ed66890f8999c2a9c056dd3b1024d6721f0) | sha512-kVrnsrJqMR8+oLJnGEmSWw9BivK5mt7H3FZatVRjrc5wGqFYuBxX1yG7+A7Gi5AefkX6t/oCkizcQgpu0cY1dQ== |
176
180
  | node-domexception | 1.0.0 | runtime transitive | MIT | LICENSE (8ec1386f7f078b0c7cd25341cd80f332df902371cda9f40c10ec2b4007b420b7) | sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== |
177
181
  | node-fetch | 3.3.2 | runtime transitive | MIT | LICENSE.md (182caebbe3ce0187afa7e320d2e6038994705af419176219b959c248c984c329) | sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA== |
178
182
  | object-inspect | 1.13.4 | runtime transitive | MIT | LICENSE (bd40cc437e28a3ad7bef2ad34e6b72e757b182e67bda1acadbab4ef0476f8232) | sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew== |
@@ -1277,6 +1281,33 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1277
1281
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1278
1282
  SOFTWARE.
1279
1283
 
1284
+ --- SHA-256 411f1c560755e27b3dec9622c13b8b7a3ec1c83f4ffb8c56a8847528aa96911a ---
1285
+ TypeBox
1286
+
1287
+ Json Schema Type Builder with Static Type Resolution for TypeScript
1288
+
1289
+ The MIT License (MIT)
1290
+
1291
+ Copyright (c) 2017-2026 Haydn Paterson
1292
+
1293
+ Permission is hereby granted, free of charge, to any person obtaining a copy
1294
+ of this software and associated documentation files (the "Software"), to deal
1295
+ in the Software without restriction, including without limitation the rights
1296
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1297
+ copies of the Software, and to permit persons to whom the Software is
1298
+ furnished to do so, subject to the following conditions:
1299
+
1300
+ The above copyright notice and this permission notice shall be included in
1301
+ all copies or substantial portions of the Software.
1302
+
1303
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1304
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1305
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1306
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1307
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1308
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1309
+ THE SOFTWARE.
1310
+
1280
1311
  --- SHA-256 4186c3f89c23f27b4c0caab574737c49ee5137c36a3c103484feaca4aeec2310 ---
1281
1312
  Apache License
1282
1313
  Version 2.0, January 2004
@@ -1503,6 +1534,28 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1503
1534
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1504
1535
  SOFTWARE.
1505
1536
 
1537
+ --- SHA-256 4383cb2c3608397ce7a4159502614ed66890f8999c2a9c056dd3b1024d6721f0 ---
1538
+ The MIT License (MIT)
1539
+
1540
+ Copyright 2017 Andrey Sitnik <andrey@sitnik.es>
1541
+
1542
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
1543
+ this software and associated documentation files (the "Software"), to deal in
1544
+ the Software without restriction, including without limitation the rights to
1545
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
1546
+ the Software, and to permit persons to whom the Software is furnished to do so,
1547
+ subject to the following conditions:
1548
+
1549
+ The above copyright notice and this permission notice shall be included in all
1550
+ copies or substantial portions of the Software.
1551
+
1552
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1553
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
1554
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
1555
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
1556
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1557
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1558
+
1506
1559
  --- SHA-256 46231df5a7733c3f52f11b71f3df61813007745b62b09031acfb45fb42d75082 ---
1507
1560
  MIT License
1508
1561
 
@@ -3522,6 +3575,29 @@ SOFTWARE.
3522
3575
  See the License for the specific language governing permissions and
3523
3576
  limitations under the License.
3524
3577
 
3578
+ --- SHA-256 ad9aa40aaab4bee08121a0180096cc6a72abf29e19e606328b66c0178f41d267 ---
3579
+ The MIT License (MIT)
3580
+
3581
+ Copyright (c) 2015-2021 Hexagon <github.com/Hexagon>
3582
+
3583
+ Permission is hereby granted, free of charge, to any person obtaining a copy
3584
+ of this software and associated documentation files (the "Software"), to deal
3585
+ in the Software without restriction, including without limitation the rights
3586
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
3587
+ copies of the Software, and to permit persons to whom the Software is
3588
+ furnished to do so, subject to the following conditions:
3589
+
3590
+ The above copyright notice and this permission notice shall be included in all
3591
+ copies or substantial portions of the Software.
3592
+
3593
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3594
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3595
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3596
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3597
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3598
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3599
+ SOFTWARE.
3600
+
3525
3601
  --- SHA-256 b495047bd93a9b06913511076f504daba17d5bbeb3e0650f3bb53a4220329c57 ---
3526
3602
  ISC License
3527
3603
 
@@ -5279,6 +5355,29 @@ Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors
5279
5355
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5280
5356
  THE SOFTWARE.
5281
5357
 
5358
+ --- SHA-256 e7d9d11c28cce34f09dc7d2b0a3a6609ccba5fbc8e926e6d1bfdf060930e9f05 ---
5359
+ MIT License
5360
+
5361
+ Copyright (c) 2026 tintinweb
5362
+
5363
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5364
+ of this software and associated documentation files (the "Software"), to deal
5365
+ in the Software without restriction, including without limitation the rights
5366
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5367
+ copies of the Software, and to permit persons to whom the Software is
5368
+ furnished to do so, subject to the following conditions:
5369
+
5370
+ The above copyright notice and this permission notice shall be included in all
5371
+ copies or substantial portions of the Software.
5372
+
5373
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5374
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
5375
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
5376
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
5377
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
5378
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
5379
+ SOFTWARE.
5380
+
5282
5381
  --- SHA-256 e7dc37bf662d7f786efcb46c545615e70c1daf458a38385521c63cf6607cdfe1 ---
5283
5382
  BSD 3-Clause License
5284
5383
 
@@ -16,7 +16,7 @@ const agent_cli_capabilities_js_1 = require("./agent-cli-capabilities.cjs");
16
16
  * 5. 版本化:每次实质改动 bump LARKIN_STANDING_PROMPT_VERSION,并同步 eval 数据集/graders/断言。
17
17
  * 6. 用 eval 验证:行为变化必须配套固定场景 + rubric(evals/*、test/support/*-grader.mjs、live 测试)。
18
18
  */
19
- exports.LARKIN_STANDING_PROMPT_VERSION = "larkin-standing-v19";
19
+ exports.LARKIN_STANDING_PROMPT_VERSION = "larkin-standing-v20";
20
20
  /**
21
21
  * Agent 间协作唤醒引导(issue #75):纯文本 @ 不会产生飞书 mention 事件,
22
22
  * 必须由模型直接构造真实的 mention 元素;`--mention` 扩展参数已移除。
@@ -132,7 +132,9 @@ class ContextPromptBuilder {
132
132
  "Only a real Feishu `message_id` beginning with `om_` may be passed to `+messages-reply`; `rem_`, `redeliver_`, and every other synthetic ID must never be replied to. Send with a confirmed `chat_id` and never guess a chat id from a display name.",
133
133
  "Before every send/reply/card write, Larkin probes the exact chat or thread history with the current Bot identity. A nonzero `freshness_conflict` includes bounded unseen context and direct-acks that cursor; reconsider it, then retry the ordinary command. Larkin never saves the blocked message body as a draft.",
134
134
  "For regular textual message bodies, default to `--markdown`, including brief single-line replies, so Feishu renders Markdown structure instead of showing its markers literally.",
135
+ "When a URL must be visible, clickable, or openable by the recipient, include the complete bare `https://...` URL as visible text. Do not rely solely on `[label](URL)`, because Feishu client rendering is unreliable. A label may also be included, but the bare URL must remain present.",
135
136
  "Use native `--text` only when plain text or verbatim preservation is explicitly needed, such as logs, code, or exact whitespace. Both `--markdown` and `--text` remain supported in the Larkin Runtime.",
137
+ "Never rewrite or normalize an exact or verbatim user-supplied body to expose a URL; the existing exact-content paths remain authoritative and preserve the supplied body unchanged.",
136
138
  "For exact text supplied directly in the current instruction or Inbox event, pass the body unchanged as one literal `--text` argument. A direct literal must not use command substitution, backticks, `eval`, `echo`, or an unquoted variable; if it cannot be represented safely, stop and report the limitation instead of normalizing it.",
137
139
  "An explicit exact or verbatim direct literal uses `--text` and overrides the regular markdown default.",
138
140
  `For a common exact send with a confirmed chat id, use the complete schematic recipe \`${executable} im +messages-send --chat-id <confirmed_chat_id> --text '<exact_body_as_one_literal_argument>' --json\`; replace each placeholder with the corresponding confirmed or exact literal value.`,
@@ -13,7 +13,7 @@ import { agentCliPromptCapabilities } from "./agent-cli-capabilities.mjs";
13
13
  * 5. 版本化:每次实质改动 bump LARKIN_STANDING_PROMPT_VERSION,并同步 eval 数据集/graders/断言。
14
14
  * 6. 用 eval 验证:行为变化必须配套固定场景 + rubric(evals/*、test/support/*-grader.mjs、live 测试)。
15
15
  */
16
- export const LARKIN_STANDING_PROMPT_VERSION = "larkin-standing-v19";
16
+ export const LARKIN_STANDING_PROMPT_VERSION = "larkin-standing-v20";
17
17
  /**
18
18
  * Agent 间协作唤醒引导(issue #75):纯文本 @ 不会产生飞书 mention 事件,
19
19
  * 必须由模型直接构造真实的 mention 元素;`--mention` 扩展参数已移除。
@@ -129,7 +129,9 @@ export class ContextPromptBuilder {
129
129
  "Only a real Feishu `message_id` beginning with `om_` may be passed to `+messages-reply`; `rem_`, `redeliver_`, and every other synthetic ID must never be replied to. Send with a confirmed `chat_id` and never guess a chat id from a display name.",
130
130
  "Before every send/reply/card write, Larkin probes the exact chat or thread history with the current Bot identity. A nonzero `freshness_conflict` includes bounded unseen context and direct-acks that cursor; reconsider it, then retry the ordinary command. Larkin never saves the blocked message body as a draft.",
131
131
  "For regular textual message bodies, default to `--markdown`, including brief single-line replies, so Feishu renders Markdown structure instead of showing its markers literally.",
132
+ "When a URL must be visible, clickable, or openable by the recipient, include the complete bare `https://...` URL as visible text. Do not rely solely on `[label](URL)`, because Feishu client rendering is unreliable. A label may also be included, but the bare URL must remain present.",
132
133
  "Use native `--text` only when plain text or verbatim preservation is explicitly needed, such as logs, code, or exact whitespace. Both `--markdown` and `--text` remain supported in the Larkin Runtime.",
134
+ "Never rewrite or normalize an exact or verbatim user-supplied body to expose a URL; the existing exact-content paths remain authoritative and preserve the supplied body unchanged.",
133
135
  "For exact text supplied directly in the current instruction or Inbox event, pass the body unchanged as one literal `--text` argument. A direct literal must not use command substitution, backticks, `eval`, `echo`, or an unquoted variable; if it cannot be represented safely, stop and report the limitation instead of normalizing it.",
134
136
  "An explicit exact or verbatim direct literal uses `--text` and overrides the regular markdown default.",
135
137
  `For a common exact send with a confirmed chat id, use the complete schematic recipe \`${executable} im +messages-send --chat-id <confirmed_chat_id> --text '<exact_body_as_one_literal_argument>' --json\`; replace each placeholder with the corresponding confirmed or exact literal value.`,
@@ -52,7 +52,12 @@ async function dispatchInternal(mode, rest) {
52
52
  case "pi-rpc": {
53
53
  const { prepareBuiltinPiPackageAssets } = await import("../runtime/builtin-pi-assets.mjs");
54
54
  prepareBuiltinPiPackageAssets();
55
- await import("@earendil-works/pi-coding-agent/rpc-entry");
55
+ process.title = "pi-rpc";
56
+ process.env.PI_CODING_AGENT = "true";
57
+ process.emitWarning = (() => { });
58
+ const { main: piMain } = await import("@earendil-works/pi-coding-agent");
59
+ const { invokeBuiltinPiRpc } = await import("../runtime/pi-inline-extensions.mjs");
60
+ await invokeBuiltinPiRpc(piMain, rest);
56
61
  return;
57
62
  }
58
63
  case "pi-auth":
@@ -2,15 +2,16 @@ import { createBashToolDefinition } from "@earendil-works/pi-coding-agent";
2
2
  /**
3
3
  * pi bash 工具超时护栏扩展。
4
4
  *
5
- * 由 larkin 通过 `pi --extension/-e <bundle>` 注入,覆盖内置 `bash` 工具:
5
+ * 由 Larkin 向 builtin Pi 传入 inline factory,或通过 external Pi 的
6
+ * `pi --extension/-e <bundle>` 注入,覆盖内置 `bash` 工具:
6
7
  * - 无论模型是否传 `timeout`,都强制收窄到 <= MAX_BASH_SECONDS(默认 60s),
7
8
  * 避免单个 bash 调用无限期占住整个 agent 回合(issue #55)。
8
9
  * - 超时时 pi 会杀掉整个进程树(不残留卡死子进程,issue #56 的进程堆积),
9
10
  * 并在返回的错误里明确提示:长任务必须改用后台 subagent
10
11
  * (Agent(run_in_background: true),来自 pi-subagents 扩展)。
11
12
  *
12
- * 这是 pi 扩展,运行在 pi 进程内部;larkin 主进程不加载本模块(只通过
13
- * build.mjs 单独 bundle 成单文件后注入)。pi-* 保持 external。
13
+ * 这是 pi 扩展,运行在 Pi RPC 子进程内部;build.mjs 仍为 external Pi
14
+ * 单独产出注入 bundle。
14
15
  */
15
16
  /** 前台 bash 的硬性上限(秒)。issue #55 建议默认 60s。 */
16
17
  const MAX_BASH_SECONDS = 60;
@@ -1,15 +1,14 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
- import { BUNDLED_PI_VERSION } from "./pi-provider-config.mjs";
5
- import { parsePiVersion, piVersionSupportsSubagents, probeExternalPiVersion } from "./pi-subagent-injection.mjs";
4
+ import { piVersionSupportsSubagents, probeExternalPiVersion } from "./pi-subagent-injection.mjs";
6
5
  /**
7
6
  * pi-bash-timeout 扩展注入(bash 60s 超时护栏,issue #55/#56)。
8
7
  *
9
8
  * 分发:构建期把 src/runtime/pi-bash-timeout-extension.ts bundle 成单文件
10
- * `dist/runtime/pi-bash-timeout.bundle.js`(pi-* 包 external),运行时通过
11
- * `pi --extension/-e` 显式注入 —— builtin 与 external(用户 pi CLI)走同一
12
- * 路径,不碰用户 ~/.pi 配置。与 pi-subagents 共享同一个 pi 版本门槛。
9
+ * `dist/runtime/pi-bash-timeout.bundle.js`(pi-* 包 external),运行时仅向 external
10
+ * (用户 pi CLI)通过 `pi --extension/-e` 显式注入,不碰用户 ~/.pi 配置。
11
+ * Builtin Pi 直接接收静态 factory。与 pi-subagents 共享同一个 external 版本门槛。
13
12
  */
14
13
  /** 把 embedded bundle 落盘到 <configDir>/providers/pi/extensions/(0700/0600)。无 embedded 资产返回 null。 */
15
14
  export function materializeEmbeddedPiBashTimeoutBundle(configDir) {
@@ -46,15 +45,10 @@ export function bundledPiBashTimeoutExtensionPath(configDir) {
46
45
  }
47
46
  return materializeEmbeddedPiBashTimeoutBundle(configDir);
48
47
  }
49
- /**
50
- * 注入决策:builtin 恒注入(内嵌 pi 版本固定);external 需探测版本(与
51
- * pi-subagents 同门槛 >= 0.80.0,保证 createBashToolDefinition 可用)。
52
- * 返回 `-e` 参数值,或 null(产物缺失或版本不达标)。
53
- */
48
+ /** External Pi 需满足 >= 0.80.0;返回 bundle 路径或 null。 */
54
49
  export function resolvePiBashTimeoutExtensionArg(input, probeVersion = () => probeExternalPiVersion(input.piCommand, input.env), resolveBundle = () => bundledPiBashTimeoutExtensionPath(input.env.LARKIN_CONFIG_DIR)) {
55
50
  const bundle = resolveBundle();
56
51
  if (!bundle)
57
52
  return null;
58
- const version = input.distribution === "builtin" ? parsePiVersion(BUNDLED_PI_VERSION) : probeVersion();
59
- return piVersionSupportsSubagents(version) ? bundle : null;
53
+ return piVersionSupportsSubagents(probeVersion()) ? bundle : null;
60
54
  }
@@ -0,0 +1,13 @@
1
+ import subagentsExtension from "@tintinweb/pi-subagents/dist/index.js";
2
+ import bashTimeoutExtension from "./pi-bash-timeout-extension.mjs";
3
+ /** Builtin Pi extensions are loaded as code, never through Pi's path/data-URL loader. */
4
+ export const BUILTIN_PI_EXTENSION_FACTORIES = Object.freeze([
5
+ subagentsExtension,
6
+ bashTimeoutExtension,
7
+ ]);
8
+ /** Invoke Pi RPC with Larkin's builtin-only extension factories. */
9
+ export async function invokeBuiltinPiRpc(piMain, rest) {
10
+ await piMain(["--mode", "rpc", ...rest], {
11
+ extensionFactories: [...BUILTIN_PI_EXTENSION_FACTORIES],
12
+ });
13
+ }
@@ -2,14 +2,13 @@ import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import { spawnSync } from "node:child_process";
4
4
  import { fileURLToPath } from "node:url";
5
- import { BUNDLED_PI_VERSION } from "./pi-provider-config.mjs";
6
5
  /**
7
6
  * pi-subagents 扩展注入。
8
7
  *
9
8
  * 分发:构建期把 @tintinweb/pi-subagents bundle 成单文件
10
- * `dist/runtime/pi-subagents.bundle.js`(pi-* 包 external),运行时通过
11
- * `pi --extension/-e` 显式注入 —— builtin(binary-entry pi-rpc)与 external
12
- * (用户 pi CLI)走同一路径,不碰用户 ~/.pi 配置。
9
+ * `dist/runtime/pi-subagents.bundle.js`(pi-* 包 external),运行时仅向 external
10
+ * (用户 pi CLI)通过 `pi --extension/-e` 显式注入,不碰用户 ~/.pi 配置。
11
+ * Builtin Pi 直接接收静态 factory,不经过本文件或 Pi 的路径加载器。
13
12
  *
14
13
  * 版本门槛:pi-subagents peerDependency 要求 @earendil-works/pi-* >= 0.80.0;
15
14
  * external 的 pi 版本低于 0.80 时不注入(降级为无 subagent 能力)。
@@ -70,21 +69,13 @@ export function piVersionSupportsSubagents(version) {
70
69
  return false;
71
70
  return version.major > 0 || (version.major === 0 && version.minor >= 80);
72
71
  }
73
- /**
74
- * 解析 `pi --version`(external 专用;builtin 用 BUNDLED_PI_VERSION 常量,无需探测)。
75
- * 返回 null 表示无法确认版本(视为不支持,不注入)。
76
- */
72
+ /** 解析 external `pi --version`;无法确认版本时视为不支持,不注入。 */
77
73
  export function probeExternalPiVersion(piCommand, env) {
78
74
  const result = spawnSync(piCommand, ["--version"], { env, encoding: "utf8", timeout: 5_000, maxBuffer: 64 * 1024 });
79
75
  if (result.error || result.status !== 0)
80
76
  return null;
81
77
  return parsePiVersion(String(result.stdout || result.stderr || ""));
82
78
  }
83
- /**
84
- * 注入决策:builtin 恒注入(内嵌 pi 版本固定 BUNDLED_PI_VERSION);external 需探测版本。
85
- * 返回 `-e` 参数值(扩展 bundle 路径),或 null(不注入:产物缺失或版本不达标)。
86
- * `probeVersion` 仅供测试注入;缺省时 external 用 probeExternalPiVersion 探测。
87
- */
88
79
  /**
89
80
  * 用户 pi 是否已自行安装 pi-subagents(settings.json packages 或包目录)。
90
81
  * 已装时 Larkin 不再 -e 注入,避免同名工具(Agent/get_subagent_result/steer_subagent)
@@ -122,8 +113,7 @@ export function resolvePiSubagentExtensionArg(input, probeVersion = () => probeE
122
113
  if (!bundle)
123
114
  return null;
124
115
  // 用户已自行安装同款扩展时跳过注入,避免工具名重复注册冲突。
125
- if (input.distribution === "external" && userPiAlreadyHasSubagentsExtension(input.env))
116
+ if (userPiAlreadyHasSubagentsExtension(input.env))
126
117
  return null;
127
- const version = input.distribution === "builtin" ? parsePiVersion(BUNDLED_PI_VERSION) : probeVersion();
128
- return piVersionSupportsSubagents(version) ? bundle : null;
118
+ return piVersionSupportsSubagents(probeVersion()) ? bundle : null;
129
119
  }
@@ -9,7 +9,6 @@ import { internalCommandSpec } from "../app/internal-command.mjs";
9
9
  import { piAgentDirectory } from "./pi-provider-config.mjs";
10
10
  import { resolvePiSubagentExtensionArg } from "./pi-subagent-injection.mjs";
11
11
  import { resolvePiBashTimeoutExtensionArg } from "./pi-bash-timeout-injection.mjs";
12
- import { isWindows } from "../platform/secure-metadata.mjs";
13
12
  import { classifyRuntimePrerequisite, probeNativeRuntimeReadiness, providerAuthenticationFailureReadiness, RuntimePrerequisiteError, } from "./runtime-readiness.mjs";
14
13
  class EventSession {
15
14
  listeners = new Set();
@@ -795,6 +794,21 @@ class PiRpcBackend {
795
794
  return () => { offEvent(); offFailure(); };
796
795
  }
797
796
  }
797
+ export function resolvePiProcessExtensionArgs(input, resolvers = {}) {
798
+ // Builtin factories are passed directly to Pi main on every platform. The platform
799
+ // field makes that invariant explicit and testable without changing process.platform.
800
+ if (input.distribution === "builtin")
801
+ return [];
802
+ const resolverInput = { distribution: "external", piCommand: input.piCommand, env: input.env };
803
+ const args = [];
804
+ const subagents = (resolvers.subagents ?? resolvePiSubagentExtensionArg)(resolverInput);
805
+ if (subagents)
806
+ args.push("-e", subagents);
807
+ const bashTimeout = (resolvers.bashTimeout ?? resolvePiBashTimeoutExtensionArg)(resolverInput);
808
+ if (bashTimeout)
809
+ args.push("-e", bashTimeout);
810
+ return args;
811
+ }
798
812
  async function createPiRpcBackend(input, dependencies, spawn) {
799
813
  const stateRoot = input.stateDir ?? path.join(input.workspaceDir, ".larkin");
800
814
  const runtimeDir = path.join(stateRoot, "runtime");
@@ -821,21 +835,12 @@ async function createPiRpcBackend(input, dependencies, spawn) {
821
835
  mergedEnv.PI_CODING_AGENT_DIR = piAgentDirectory(mergedEnv.LARKIN_CONFIG_DIR, input.agentId);
822
836
  mergedEnv.PI_TELEMETRY = "0";
823
837
  }
824
- const subagentExtension = builtin && isWindows ? null : resolvePiSubagentExtensionArg({
825
- distribution: builtin ? "builtin" : "external",
826
- piCommand: command,
827
- env: mergedEnv,
828
- });
829
- if (subagentExtension)
830
- commandArgs.push("-e", subagentExtension);
831
- // bash 60s 超时护栏(issue #55/#56):与 pi-subagents 一起注入,两者工具名不冲突。
832
- const bashTimeoutExtension = builtin && isWindows ? null : resolvePiBashTimeoutExtensionArg({
838
+ commandArgs.push(...(dependencies.resolvePiProcessExtensionArgs ?? resolvePiProcessExtensionArgs)({
833
839
  distribution: builtin ? "builtin" : "external",
834
840
  piCommand: command,
835
841
  env: mergedEnv,
836
- });
837
- if (bashTimeoutExtension)
838
- commandArgs.push("-e", bashTimeoutExtension);
842
+ platform: process.platform,
843
+ }));
839
844
  const child = spawn(command, commandArgs, {
840
845
  cwd: input.workspaceDir,
841
846
  env: mergedEnv,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "larkin",
3
- "version": "0.2.93",
3
+ "version": "0.3.1",
4
4
  "private": false,
5
5
  "larkinPackageRole": "npm-published",
6
6
  "files": [
@@ -74,6 +74,8 @@
74
74
  "test:eval:authoritative-freshness-gate": "bun test --max-concurrency 1 test/unit/evals/authoritative-freshness-gate.test.mjs",
75
75
  "test:eval:agent-experience-v6": "bun test --max-concurrency 1 test/unit/evals/agent-experience-v6.test.mjs",
76
76
  "test:eval:mention-construction": "bun run build && LARKIN_RUN_MENTION_CONSTRUCTION_EVAL=1 bun test --max-concurrency 1 test/live/mention-construction-agent-eval.test.mjs",
77
+ "test:eval:clickable-link-delivery": "bun run build && bun test --max-concurrency 1 test/unit/evals/clickable-link-delivery.test.mjs",
78
+ "test:eval:clickable-link-delivery:native": "bun run build && LARKIN_RUN_CLICKABLE_LINK_DELIVERY_EVAL=1 bun test --max-concurrency 1 test/live/clickable-link-delivery-agent-eval.test.mjs",
77
79
  "test:eval:public-contribution-governance": "bun test --max-concurrency 1 test/unit/evals/public-contribution-governance.test.mjs",
78
80
  "test:live:public-contribution-governance": "bun test --max-concurrency 1 test/live/public-contribution-governance-live.test.mjs",
79
81
  "test:eval:authoritative-freshness-gate:native": "bun run build && LARKIN_RUN_AUTHORITATIVE_FRESHNESS_EVAL=1 bun test --max-concurrency 1 test/live/authoritative-freshness-gate-agent-eval.test.mjs",
@@ -83,6 +85,7 @@
83
85
  },
84
86
  "dependencies": {
85
87
  "@earendil-works/pi-coding-agent": "0.83.0",
88
+ "@tintinweb/pi-subagents": "0.14.3",
86
89
  "@larksuite/channel": "^0.4.0",
87
90
  "@opentelemetry/api": "^1.9.1",
88
91
  "@opentelemetry/resources": "^2.10.0",
@@ -101,7 +104,6 @@
101
104
  "@testing-library/jest-dom": "^7.0.0",
102
105
  "@testing-library/react": "^16.3.2",
103
106
  "@testing-library/user-event": "^14.6.1",
104
- "@tintinweb/pi-subagents": "0.14.3",
105
107
  "@types/node": "^26.1.1",
106
108
  "@types/react": "19.2.14",
107
109
  "@types/react-dom": "19.2.3",