@opencode/console 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Anomaly Innovations, Inc.
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,38 @@
1
- # Temporary Holding Version
1
+ # @opencode/console
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
+ Connects Claude Code and Pi to an OpenCode Console workspace. They then use the workspace's models, MCP servers,
4
+ skills and instructions, and their tool calls follow the workspace's policies. OpenCode connects to Console on its own,
5
+ so OpenCode users don't need this package.
6
+
7
+ ## Set up Claude Code
8
+
9
+ ```sh
10
+ npx @opencode/console setup claude-code
11
+ ```
12
+
13
+ Setup opens your browser to sign in and pick a workspace, then writes Claude Code's user settings. It needs Node.js 22
14
+ or later. To update, run `npx @opencode/console@latest setup claude-code`.
15
+
16
+ ## Set up Pi
17
+
18
+ ```sh
19
+ npx @opencode/console setup pi
20
+ ```
21
+
22
+ The package is also a Pi package, so `pi install npm:@opencode/console` works too; run `npx @opencode/console login`
23
+ once after it.
24
+
25
+ ## Other commands
26
+
27
+ ```sh
28
+ npx @opencode/console status # Show the sign-in, workspace and config
29
+ npx @opencode/console setup claude-code --remove # Undo the Claude Code setup and keep the sign-in
30
+ npx @opencode/console setup pi --remove # Undo the Pi setup and keep the sign-in
31
+ npx @opencode/console logout # Sign out
32
+ ```
33
+
34
+ To use a personal or service account key instead of signing in, for example in CI, set `OPENCODE_API_KEY`.
35
+ `npx @opencode/console help` lists every command.
36
+
37
+ The [Claude Code guide](https://opencode.ai/console/integrations/claude-code) explains what setup changes and how
38
+ workspace policies apply to Claude Code.
@@ -0,0 +1,547 @@
1
+ # Third-party licenses
2
+
3
+ `@opencode/console` bundles these packages.
4
+
5
+ ## @effect/platform-node-shared@4.1.2
6
+
7
+ MIT License
8
+
9
+ Copyright (c) 2023 Effectful Technologies Inc
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+
29
+ ## @effect/platform-node@4.1.2
30
+
31
+ MIT License
32
+
33
+ Copyright (c) 2023 Effectful Technologies Inc
34
+
35
+ Permission is hereby granted, free of charge, to any person obtaining a copy
36
+ of this software and associated documentation files (the "Software"), to deal
37
+ in the Software without restriction, including without limitation the rights
38
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
39
+ copies of the Software, and to permit persons to whom the Software is
40
+ furnished to do so, subject to the following conditions:
41
+
42
+ The above copyright notice and this permission notice shall be included in all
43
+ copies or substantial portions of the Software.
44
+
45
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
46
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
48
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
49
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
50
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
51
+ SOFTWARE.
52
+
53
+ ## @opencode/core@0.0.0-dev-831, @opencode/schema@0.0.0-dev-831, @opencode/util@0.0.0-dev-831
54
+
55
+ MIT License
56
+
57
+ Copyright (c) 2025 opencode
58
+
59
+ Permission is hereby granted, free of charge, to any person obtaining a copy
60
+ of this software and associated documentation files (the "Software"), to deal
61
+ in the Software without restriction, including without limitation the rights
62
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
63
+ copies of the Software, and to permit persons to whom the Software is
64
+ furnished to do so, subject to the following conditions:
65
+
66
+ The above copyright notice and this permission notice shall be included in all
67
+ copies or substantial portions of the Software.
68
+
69
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
70
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
71
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
72
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
73
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
74
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
75
+ SOFTWARE.
76
+
77
+ ## balanced-match@4.0.4
78
+
79
+ (MIT)
80
+
81
+ Original code Copyright Julian Gruber <julian@juliangruber.com>
82
+
83
+ Port to TypeScript Copyright Isaac Z. Schlueter <i@izs.me>
84
+
85
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
86
+ this software and associated documentation files (the "Software"), to deal in
87
+ the Software without restriction, including without limitation the rights to
88
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
89
+ of the Software, and to permit persons to whom the Software is furnished to do
90
+ so, subject to the following conditions:
91
+
92
+ The above copyright notice and this permission notice shall be included in all
93
+ copies or substantial portions of the Software.
94
+
95
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
96
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
97
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
98
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
99
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
100
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
101
+ SOFTWARE.
102
+
103
+ ## brace-expansion@5.0.12
104
+
105
+ MIT License
106
+
107
+ Copyright Julian Gruber <julian@juliangruber.com>
108
+
109
+ TypeScript port Copyright Isaac Z. Schlueter <i@izs.me>
110
+
111
+ Permission is hereby granted, free of charge, to any person obtaining a copy
112
+ of this software and associated documentation files (the "Software"), to deal
113
+ in the Software without restriction, including without limitation the rights
114
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
115
+ copies of the Software, and to permit persons to whom the Software is
116
+ furnished to do so, subject to the following conditions:
117
+
118
+ The above copyright notice and this permission notice shall be included in all
119
+ copies or substantial portions of the Software.
120
+
121
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
122
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
123
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
124
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
125
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
126
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
127
+ SOFTWARE.
128
+
129
+ ## bundle-name@4.1.0
130
+
131
+ MIT License
132
+
133
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
134
+
135
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
136
+
137
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
138
+
139
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
140
+
141
+ ## default-browser-id@5.0.1
142
+
143
+ MIT License
144
+
145
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
146
+
147
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
148
+
149
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
150
+
151
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
152
+
153
+ ## default-browser@5.5.1
154
+
155
+ MIT License
156
+
157
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
158
+
159
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
160
+
161
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
162
+
163
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
164
+
165
+ ## define-lazy-prop@3.0.0
166
+
167
+ MIT License
168
+
169
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
170
+
171
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
172
+
173
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
174
+
175
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
176
+
177
+ ## effect@4.1.2
178
+
179
+ MIT License
180
+
181
+ Copyright (c) 2023 Effectful Technologies Inc
182
+
183
+ Permission is hereby granted, free of charge, to any person obtaining a copy
184
+ of this software and associated documentation files (the "Software"), to deal
185
+ in the Software without restriction, including without limitation the rights
186
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
187
+ copies of the Software, and to permit persons to whom the Software is
188
+ furnished to do so, subject to the following conditions:
189
+
190
+ The above copyright notice and this permission notice shall be included in all
191
+ copies or substantial portions of the Software.
192
+
193
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
194
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
195
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
196
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
197
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
198
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
199
+ SOFTWARE.
200
+
201
+ ## glob@13.0.5
202
+
203
+ All packages under `src/` are licensed according to the terms in
204
+ their respective `LICENSE` or `LICENSE.md` files.
205
+
206
+ The remainder of this project is licensed under the Blue Oak
207
+ Model License, as follows:
208
+
209
+ -----
210
+
211
+ # Blue Oak Model License
212
+
213
+ Version 1.0.0
214
+
215
+ ## Purpose
216
+
217
+ This license gives everyone as much permission to work with
218
+ this software as possible, while protecting contributors
219
+ from liability.
220
+
221
+ ## Acceptance
222
+
223
+ In order to receive this license, you must agree to its
224
+ rules. The rules of this license are both obligations
225
+ under that agreement and conditions to your license.
226
+ You must not do anything with this software that triggers
227
+ a rule that you cannot or will not follow.
228
+
229
+ ## Copyright
230
+
231
+ Each contributor licenses you to do everything with this
232
+ software that would otherwise infringe that contributor's
233
+ copyright in it.
234
+
235
+ ## Notices
236
+
237
+ You must ensure that everyone who gets a copy of
238
+ any part of this software from you, with or without
239
+ changes, also gets the text of this license or a link to
240
+ <https://blueoakcouncil.org/license/1.0.0>.
241
+
242
+ ## Excuse
243
+
244
+ If anyone notifies you in writing that you have not
245
+ complied with [Notices](#notices), you can keep your
246
+ license by taking all practical steps to comply within 30
247
+ days after the notice. If you do not do so, your license
248
+ ends immediately.
249
+
250
+ ## Patent
251
+
252
+ Each contributor licenses you to do everything with this
253
+ software that would otherwise infringe any patent claims
254
+ they can license or become able to license.
255
+
256
+ ## Reliability
257
+
258
+ No contributor can revoke this license.
259
+
260
+ ## No Liability
261
+
262
+ ***As far as the law allows, this software comes as is,
263
+ without any warranty or condition, and no contributor
264
+ will be liable to anyone for any damages related to this
265
+ software or this license, under any kind of legal claim.***
266
+
267
+ ## is-docker@3.0.0
268
+
269
+ MIT License
270
+
271
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
272
+
273
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
274
+
275
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
276
+
277
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
278
+
279
+ ## is-in-ssh@1.0.0
280
+
281
+ MIT License
282
+
283
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
284
+
285
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
286
+
287
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
288
+
289
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
290
+
291
+ ## is-inside-container@1.0.0
292
+
293
+ MIT License
294
+
295
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
296
+
297
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
298
+
299
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
300
+
301
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
302
+
303
+ ## is-wsl@3.1.1
304
+
305
+ MIT License
306
+
307
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
308
+
309
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
310
+
311
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
312
+
313
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
314
+
315
+ ## isexe@4.0.0
316
+
317
+ # Blue Oak Model License
318
+
319
+ Version 1.0.0
320
+
321
+ ## Purpose
322
+
323
+ This license gives everyone as much permission to work with
324
+ this software as possible, while protecting contributors
325
+ from liability.
326
+
327
+ ## Acceptance
328
+
329
+ In order to receive this license, you must agree to its
330
+ rules. The rules of this license are both obligations
331
+ under that agreement and conditions to your license.
332
+ You must not do anything with this software that triggers
333
+ a rule that you cannot or will not follow.
334
+
335
+ ## Copyright
336
+
337
+ Each contributor licenses you to do everything with this
338
+ software that would otherwise infringe that contributor's
339
+ copyright in it.
340
+
341
+ ## Notices
342
+
343
+ You must ensure that everyone who gets a copy of
344
+ any part of this software from you, with or without
345
+ changes, also gets the text of this license or a link to
346
+ <https://blueoakcouncil.org/license/1.0.0>.
347
+
348
+ ## Excuse
349
+
350
+ If anyone notifies you in writing that you have not
351
+ complied with [Notices](#notices), you can keep your
352
+ license by taking all practical steps to comply within 30
353
+ days after the notice. If you do not do so, your license
354
+ ends immediately.
355
+
356
+ ## Patent
357
+
358
+ Each contributor licenses you to do everything with this
359
+ software that would otherwise infringe any patent claims
360
+ they can license or become able to license.
361
+
362
+ ## Reliability
363
+
364
+ No contributor can revoke this license.
365
+
366
+ ## No Liability
367
+
368
+ ***As far as the law allows, this software comes as is,
369
+ without any warranty or condition, and no contributor
370
+ will be liable to anyone for any damages related to this
371
+ software or this license, under any kind of legal claim.***
372
+
373
+ ## mime-db@1.54.0
374
+
375
+ (The MIT License)
376
+
377
+ Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
378
+ Copyright (c) 2015-2022 Douglas Christopher Wilson <doug@somethingdoug.com>
379
+
380
+ Permission is hereby granted, free of charge, to any person obtaining
381
+ a copy of this software and associated documentation files (the
382
+ 'Software'), to deal in the Software without restriction, including
383
+ without limitation the rights to use, copy, modify, merge, publish,
384
+ distribute, sublicense, and/or sell copies of the Software, and to
385
+ permit persons to whom the Software is furnished to do so, subject to
386
+ the following conditions:
387
+
388
+ The above copyright notice and this permission notice shall be
389
+ included in all copies or substantial portions of the Software.
390
+
391
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
392
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
393
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
394
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
395
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
396
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
397
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
398
+
399
+ ## mime-types@3.0.2
400
+
401
+ (The MIT License)
402
+
403
+ Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
404
+ Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
405
+
406
+ Permission is hereby granted, free of charge, to any person obtaining
407
+ a copy of this software and associated documentation files (the
408
+ 'Software'), to deal in the Software without restriction, including
409
+ without limitation the rights to use, copy, modify, merge, publish,
410
+ distribute, sublicense, and/or sell copies of the Software, and to
411
+ permit persons to whom the Software is furnished to do so, subject to
412
+ the following conditions:
413
+
414
+ The above copyright notice and this permission notice shall be
415
+ included in all copies or substantial portions of the Software.
416
+
417
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
418
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
419
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
420
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
421
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
422
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
423
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
424
+
425
+ ## minimatch@10.2.5
426
+
427
+ # Blue Oak Model License
428
+
429
+ Version 1.0.0
430
+
431
+ ## Purpose
432
+
433
+ This license gives everyone as much permission to work with
434
+ this software as possible, while protecting contributors
435
+ from liability.
436
+
437
+ ## Acceptance
438
+
439
+ In order to receive this license, you must agree to its
440
+ rules. The rules of this license are both obligations
441
+ under that agreement and conditions to your license.
442
+ You must not do anything with this software that triggers
443
+ a rule that you cannot or will not follow.
444
+
445
+ ## Copyright
446
+
447
+ Each contributor licenses you to do everything with this
448
+ software that would otherwise infringe that contributor's
449
+ copyright in it.
450
+
451
+ ## Notices
452
+
453
+ You must ensure that everyone who gets a copy of
454
+ any part of this software from you, with or without
455
+ changes, also gets the text of this license or a link to
456
+ <https://blueoakcouncil.org/license/1.0.0>.
457
+
458
+ ## Excuse
459
+
460
+ If anyone notifies you in writing that you have not
461
+ complied with [Notices](#notices), you can keep your
462
+ license by taking all practical steps to comply within 30
463
+ days after the notice. If you do not do so, your license
464
+ ends immediately.
465
+
466
+ ## Patent
467
+
468
+ Each contributor licenses you to do everything with this
469
+ software that would otherwise infringe any patent claims
470
+ they can license or become able to license.
471
+
472
+ ## Reliability
473
+
474
+ No contributor can revoke this license.
475
+
476
+ ## No Liability
477
+
478
+ **_As far as the law allows, this software comes as is,
479
+ without any warranty or condition, and no contributor
480
+ will be liable to anyone for any damages related to this
481
+ software or this license, under any kind of legal claim._**
482
+
483
+ ## open@11.0.4
484
+
485
+ MIT License
486
+
487
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
488
+
489
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
490
+
491
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
492
+
493
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
494
+
495
+ ## powershell-utils@0.2.1
496
+
497
+ MIT License
498
+
499
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
500
+
501
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
502
+
503
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
504
+
505
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
506
+
507
+ ## run-applescript@7.1.0
508
+
509
+ MIT License
510
+
511
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
512
+
513
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
514
+
515
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
516
+
517
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
518
+
519
+ ## which@6.0.1
520
+
521
+ The ISC License
522
+
523
+ Copyright (c) Isaac Z. Schlueter and Contributors
524
+
525
+ Permission to use, copy, modify, and/or distribute this software for any
526
+ purpose with or without fee is hereby granted, provided that the above
527
+ copyright notice and this permission notice appear in all copies.
528
+
529
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
530
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
531
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
532
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
533
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
534
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
535
+ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
536
+
537
+ ## wsl-utils@1.0.1
538
+
539
+ MIT License
540
+
541
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
542
+
543
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
544
+
545
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
546
+
547
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ import{Hi,Eo,wo,Pr,ko,Co,Io,Ao,Rr,wn,Mr,To,qi,Wi,Oo,_o,kn,Wn,ot,Bs,Po,Ro,Mo}from"./chunk-41p6m0xy.js";import"./chunk-g6d8xejf.js";import"./chunk-z2kmm4pm.js";import"./chunk-gtf5exm1.js";import"./chunk-sbec97g3.js";import"./chunk-dsk7ztf6.js";import"./chunk-6tene1pb.js";import"./chunk-1mfjsp5r.js";import"./chunk-ke4nwx54.js";import"./chunk-yjw665b0.js";import"./chunk-5x5fc0mq.js";import"./chunk-jqhy4pzf.js";export{Mo as Pi,Pr as Unreadable,ko as checks,ot as config,kn as decide,Wn as decisions,wo as defaultModel,wn as directory,Ao as instructions,To as manifest,Rr as manifestFile,Po as models,Mr as modelsFile,Hi as paths,Eo as providers,_o as refresh,Bs as refreshStale,Wi as remove,Oo as session,qi as setup,Io as skillCommand,Ro as skills,Co as userBash};
@@ -0,0 +1 @@
1
+ import{oi,si}from"./chunk-jqhy4pzf.js";import{W,re,G,Gr,Ve,ht,De,Ft,Ss,Nt,pi,oe,Ms,Er,kr,go,Ds,Yi,Qi}from"./chunk-nva98fq1.js";export{oi as Brand,De as Cause,pi as Clock,re as Context,ht as Data,Er as DateTime,Ve as Duration,oe as Effect,Ft as Exit,Ms as Fiber,Qi as FileSystem,Nt as Layer,W as Option,si as Path,Gr as Record,G as Result,Yi as Schema,kr as SchemaGetter,go as SchemaTransformation,Ss as Scope,Ds as Struct};
@@ -0,0 +1,2 @@
1
+ import{Xo,Yn,es,ts,Lr,ss}from"./chunk-ke4nwx54.js";import{tn,At,ze,he,Re,me}from"./chunk-5x5fc0mq.js";import{w,D,xe,at,T,q,g,Dt,fr,hi,L,gr,J,se}from"./chunk-nva98fq1.js";var Qo={};w(Qo,{ConsoleCredentials:()=>Qo,fresh:()=>Qt,login:()=>Ji,logout:()=>Vi,organization:()=>In,owner:()=>Je,read:()=>je,stored:()=>Ur});import{createHash as c}from"node:crypto";var d=J(se(Yn)),f=300000;function je(e){let n=e.env.OPENCODE_API_KEY;if(!n)return Ur(e);let o=e.env.OPENCODE_CONSOLE_SERVER?.trim();if(!o)return{type:"key",server:Xo,key:n};let r=ss(o);if(!r)throw Error(`OPENCODE_CONSOLE_SERVER isn't a Console URL: ${o}. Use an https:// URL, or http:// only for localhost.`);return{type:"key",server:r,key:n}}function Ur(e){let n=i(e);if(n.corrupt)throw Error(`The sign-in in ${tn(e)} can't be read. Run \`npx @opencode/console login\` to replace it or \`npx @opencode/console logout\` to remove it.`);return n.credential}function Je(e){return JSON.stringify([e.server,e.type==="key"?c("sha256").update(e.key).digest("hex").slice(0,16):e.accountID,e.type==="oauth"?e.orgID:void 0])}function In(e){return e.type==="oauth"?e.orgName:void 0}var Ji=L("ConsoleCredentials.login")(function*(e,n){let o=yield*es(n.server);yield*n.prompt(o);let r=yield*o.callback,t=yield*ze(e,T(()=>{let l=i(e).credential;if(Re(tn(e),JSON.stringify(r)),!l||Je(l)!==Je(r))me(At(e));return l}));if(t)yield*Lr(t).pipe(Dt);return r}),Qt=L("ConsoleCredentials.fresh")(function*(e){let n=je(e);if(!n||n.type==="key"||!(yield*s(n)))return n;let o=yield*ze(e,q(function*(){let r=Ur(e);if(!r||!(yield*s(r)))return r;let t=yield*ts(r).pipe(fr(xe(30)));if(i(e).credential?.refresh!==r.refresh)return Ur(e);return Re(tn(e),JSON.stringify(t)),t})).pipe(hi);return yield*gr(o)}),Vi=L("ConsoleCredentials.logout")(function*(e){let n=yield*ze(e,T(()=>{let o=i(e).credential;return me(tn(e)),me(At(e)),o}));if(!n)return!1;return yield*Lr(n).pipe(Dt),!0});function s(e){return at.pipe(g((n)=>e.expires-f<=n))}function i(e){let n=he(tn(e));if(n===void 0)return{};let o=D(d(n));return o?{credential:o}:{corrupt:!0}}
2
+ export{je,Ur,Je,In,Ji,Qt,Vi,Qo};
@@ -0,0 +1,6 @@
1
+ import{pt,zr}from"./chunk-yjw665b0.js";import{er}from"./chunk-ke4nwx54.js";import{us,ls,ze,he,ps,Re,me,ft}from"./chunk-5x5fc0mq.js";import{je,Je}from"./chunk-1mfjsp5r.js";import{Uo,Gt,Jt,Lo,Nr,Ct,jo,z,Vt,Zt,Gn,Jn}from"./chunk-gtf5exm1.js";import{Fo}from"./chunk-g6d8xejf.js";import{Vn,Vo}from"./chunk-dsk7ztf6.js";import{Ho,qo,Yt}from"./chunk-sbec97g3.js";import{Fr,Do}from"./chunk-z2kmm4pm.js";import{st}from"./chunk-bgqw45qt.js";import{w,Me,D,cn,_e,T,dr,be,Ln,J,C,F,t,E,n,y,se}from"./chunk-nva98fq1.js";var Mo={};w(Mo,{Pi:()=>Mo,Unreadable:()=>Pr,checks:()=>ko,config:()=>ot,decide:()=>kn,decisions:()=>Wn,defaultModel:()=>wo,directory:()=>wn,instructions:()=>Ao,manifest:()=>To,manifestFile:()=>Rr,models:()=>Po,modelsFile:()=>Mr,paths:()=>Hi,providers:()=>Eo,refresh:()=>_o,refreshStale:()=>Bs,remove:()=>Wi,session:()=>Oo,setup:()=>qi,skillCommand:()=>Io,skills:()=>Ro,userBash:()=>Co});import{createHash as j}from"node:crypto";import{rmSync as O}from"node:fs";import b from"node:os";import u from"node:path";import{fileURLToPath as W}from"node:url";function Hi(e=process.env,o=b.homedir()){let r=e.PI_CODING_AGENT_DIR?.trim(),s=r?u.resolve(r==="~"?o:r.startsWith("~/")?u.join(o,r.slice(2)):r):u.join(o,".pi","agent");return{agent:s,settings:u.join(s,"settings.json")}}function Eo(e,o){return[...Map.groupBy(Fr(e).flatMap((s)=>A(s,o)??[]),(s)=>s.provider)].map(([s,i])=>({id:s,name:e[s]?.name??s,models:i}))}function wo(e){let o=Fr(e).filter((s)=>P(s)!==void 0),r=Do(o,"sonnet","opus","haiku");return r&&{provider:r.provider,id:r.id}}var S={messages:"anthropic-messages",responses:"openai-responses","chat-completions":"openai-completions","generate-content":"google-generative-ai"};function P(e){let o=z(e.entry.api),r=Object.keys(S).find((i)=>(i in o)),s=r&&Vt(z(o[r]).base_url);return r&&s?{api:S[r],baseURL:s}:void 0}function A(e,o){let r=P(e);if(!r)return;let s=r.api,i=o(e.provider,e.id,s),c=i?.api===s?i:void 0,d=e.entry,p=z(d.limit),a=z(z(d.cost).text),l=z(a.input),m=z(l.cache),x=z(d.modalities).input,k=z(z(d.capabilities).reasoning).supported;return{...s==="openai-completions"?{compat:I}:{},...c,id:e.id,name:Vt(d.name)??c?.name??e.id,api:s,provider:e.provider,baseUrl:s==="anthropic-messages"?r.baseURL.replace(/\/v1\/?$/,""):r.baseURL,reasoning:typeof k==="boolean"?k:c?.reasoning??!1,input:Array.isArray(x)?x.some((v)=>typeof v==="string"&&v.startsWith("image"))?["text","image"]:["text"]:c?.input??["text"],cost:{input:f(l.price)??c?.cost.input??0,output:f(z(a.output).price)??c?.cost.output??0,cacheRead:f(m.read)??c?.cost.cacheRead??0,cacheWrite:f(_(m.write))??f(_(z(m.explicit).write))??c?.cost.cacheWrite??0},contextWindow:f(p.context)??c?.contextWindow??128000,maxTokens:f(p.output)??c?.maxTokens??16384,headers:{...c?.headers,"x-opencode-plugin":`opencode-console/${st}`}}}var I={supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"};function _(e){return typeof e==="object"&&e!==null?Object.values(e)[0]:e}function f(e){return typeof e==="number"&&Number.isFinite(e)?e:void 0}class Pr extends Error{}function ko(e,o){let r=(a,l,m={})=>({action:a,resources:l,directory:o.cwd,...m}),s=e.toolName,i=(a)=>{let l=e.input[a];return typeof l==="string"&&l!==""?l:void 0},c=(a)=>{let l=i(a);if(l===void 0)throw new Pr(`${s}'s input has no ${a}`);return l},d=o.home??b.homedir(),p=(a)=>g(c(a),d);if(s.startsWith("mcp__"))return U(s,o.server).map((a)=>r(a.action,a.resources,a));switch(s){case"bash":return[r("shell",[c("command")],{shell:"bash"})];case"powershell":return[r("shell",[c("command")],{shell:"pwsh"})];case"read":{let a=p("path"),l=o.skills&&R(o.skills,u.resolve(o.cwd,a));return[l?r("skill",[l]):r("read",[a])]}case"write":case"edit":return[r("edit",[p("path")])];case"ls":return[r("read",[g(i("path")??".",d)])];case"grep":case"find":{let a=i("path");return[r(s==="find"?"glob":"grep",[c("pattern")],a===void 0?{}:{path:g(a,d)})]}case"read_mcp_resource":return[r("mcp.use",[c("server")])];case"list_mcp_resources":case"list_mcp_resource_templates":{let a=i("server"),l=o.servers??[];return[r("mcp.use",a?[a]:l.length>0?l:["*"])]}default:return[r(s.toLowerCase(),["*"])]}}function g(e,o){let r=e.replace(/[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g," "),s=r.startsWith("@")?r.slice(1):r,i=s==="~"?o:s.startsWith("~/")?u.join(o,s.slice(2)):s;return i.startsWith("file://")?W(i):i}function R(e,o){let r=u.relative(u.resolve(e),o);if(r===""||r.startsWith("..")||u.isAbsolute(r))return;return r.split(u.sep)[0]}function U(e,o){let r=o&&`mcp__${o.replace(/[^A-Za-z0-9_]/g,"_")}__`,s=e.match(/^mcp__(.+?)__(.+)$/),i=o??s?.[1];if(!i)throw new Pr(`Can't tell which MCP server ${e} belongs to`);let c=r&&e.startsWith(r)?e.slice(r.length):o?void 0:s?.[2],d=o!==void 0,p=c===void 0||/_[0-9a-f]{8}$/.test(e);return[{action:"mcp.use",resources:[i],...d?{}:{folded:!0}},p?{action:`${i}_`,resources:["*"],truncated:!0}:{action:`${i}_${c}`,resources:["*"],folded:!0}]}function Co(e){return{action:"shell",resources:[e.command],directory:e.cwd,shell:"bash"}}function Io(e){return e.match(/^\/skill:([^\s]+)/)?.[1]}function Ao(e){if(e.length===0)return;return e.map((o)=>`## ${o.name}
2
+
3
+ ${o.content.trim()}`).join(`
4
+
5
+ `)}var M=n({paths:n({agent:t,settings:t}),extension:t,created:E,...Uo}),Rr=(e)=>u.join(e.data,"pi.json"),wn=(e)=>u.join(e.data,"pi"),Mr=(e)=>u.join(e.cache,"pi-models.json");function To(e){let o=Rr(e),r=he(o);if(r===void 0)return;let s=D(J(se(M))(r));if(!s)throw Error(`${o} can't be read, so Pi was left as it is. Delete it and run setup again.`);return s}function qi(e,o){let r=To(e),s=r?.created??he(o.paths.settings)===void 0,i=Gt(o.paths.settings)??{};if(!r)jo(o.paths.settings);let c=Array.isArray(i.extensions)?i.extensions:[];i.extensions=[...c.filter((p)=>p!==r?.extension&&p!==o.extension),o.extension];let d=Lo(i,o.model?{defaultProvider:o.model.provider,defaultModel:o.model.id}:{},r,!0);Jt(o.paths.settings,i,384),Re(Rr(e),JSON.stringify(M.make({paths:o.paths,extension:o.extension,created:s,...d})))}function Wi(e){let o=To(e);if(!o)return!1;let r=Gt(o.paths.settings);if(r){let i=(Array.isArray(r.extensions)?r.extensions:[]).filter((c)=>c!==o.extension);if(i.length>0)r.extensions=i;else delete r.extensions;if(Object.keys(o.originals).forEach((c)=>Nr(r,c,o)),Object.keys(r).length===0&&o.created)me(o.paths.settings);else Jt(o.paths.settings,r)}return me(Ct(o.paths.settings)),O(wn(e),{recursive:!0,force:!0}),me(Mr(e)),me(Rr(e)),!0}function Oo(e={}){let o=Ho({version:st,harness:e.harness}).pipe(cn(zr)),r=e.fetch;return{store:e.store??us(),run:(s)=>Ln(r?s.pipe(dr(o),be(pt,r)):s.pipe(dr(o)))}}var h=new WeakMap;function _o(e){let o=h.get(e);if(o)return o;let r=e.run(qo(e.store)).finally(()=>h.delete(e));return h.set(e,r),r}async function kn(e,o){return(await Wn(e,o)).find((r)=>r.effect==="deny")}async function Wn(e,o){let r=je(e.store),s=Vo(r,r&&await ot(e));return Ln(_e(o,(i)=>Fo(s,i)))}async function ot(e){let o=je(e.store);if(!o)return;let r=Je(o),s=Yt(e.store,r);if(!s)await new Promise((i)=>{let c=setTimeout(i,3000);c.unref?.(),_o(e).catch(()=>{return}).finally(()=>{clearTimeout(c),i()})});else if(Vn(s,Date.now()))Bs(e);return Yt(e.store,r)}function Bs(e){let o=ls(e.store),r=ps(o);if(r!==void 0&&Date.now()-r<30000)return!1;return Re(o,""),_o(e).catch(()=>{return}),!0}var L=n({owner:t,providers:t,document:y(t,F)}),N=y(t,n({name:C(t),models:y(t,y(t,F))}));async function Po(e){let o=je(e.store),r=await ot(e);if(!o||!r?.config)return;let s=Je(o),i=j("sha256").update(JSON.stringify(r.config.providers??null)).digest("hex"),c=D(J(se(L))(he(Mr(e.store))??"")),d=c?.owner===s&&c.providers===i?c.document:void 0,p=d&&D(J(N)(d));if(p)return p;let a=await e.run(er(o));return Re(Mr(e.store),JSON.stringify({owner:s,providers:i,document:a})),a}var B=y(t,t);async function Ro(e){let o=je(e.store),r=await ot(e),s=u.join(wn(e.store),"skills"),i=u.join(wn(e.store),"skills.json");if(!o||!r?.config)return s;let c=Zt(r.config).skills,d=Me(J(se(B))(he(i)??""),()=>({})),p=await e.run(Gn(o,s,c,d));return await Ln(ze(e.store,T(()=>{ft(s),Re(i,JSON.stringify(Jn(s,c,p,d).skills))}))),s}
6
+ export{Hi,Eo,wo,Pr,ko,Co,Io,Ao,Rr,wn,Mr,To,qi,Wi,Oo,_o,kn,Wn,ot,Bs,Po,Ro,Mo};
@@ -0,0 +1 @@
1
+ import{Xo,Zn,Yn,Js,Vs,Qn,An,Xn,Zs,es,ts,Lr,ns,er,rs,os,ss,is}from"./chunk-ke4nwx54.js";import"./chunk-yjw665b0.js";import"./chunk-jqhy4pzf.js";export{is as ConsoleClient,Xn as DeviceSignInFailed,Yn as OAuth,An as SignedOut,Qn as SsoRequired,es as authorize,Zn as clientID,Xo as defaultServer,ns as fetchConfig,er as fetchModels,rs as fetchSkill,os as fetchSkillBlob,Zs as headers,ss as normalizeServer,ts as refresh,Lr as revoke,Js as signedOutMessage,Vs as ssoMessage};
@@ -0,0 +1 @@
1
+ import{Zt,Kn,Gn,Jn,Hs,zo}from"./chunk-gtf5exm1.js";import"./chunk-ke4nwx54.js";import"./chunk-yjw665b0.js";import"./chunk-5x5fc0mq.js";import"./chunk-jqhy4pzf.js";export{zo as Library,Gn as fetchChanged,Zt as library,Kn as servers,Hs as skillMarkdown,Jn as write};