@agimon-ai/po 0.0.0-alpha.166 → 0.0.0-alpha.167

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.
@@ -22,8 +22,8 @@
22
22
  "packages": [
23
23
  {
24
24
  "name": "@agimon-ai/po-image-gen",
25
- "version": "0.0.0-alpha.164",
26
- "integrity": "sha512-bIi4ahXGIJjdyu1uKboz1bbL6CLrRujC7SQBsOOrq/3ADzmntJMEXPMF/erfWISq2xmK0A7ddFWgXRWmtes3gA=="
25
+ "version": "0.0.0-alpha.165",
26
+ "integrity": "sha512-EKhMO+sg0obNVWMPxPazIDPkhjmQQNLsyzkrH02t3Zanb18nA+CdHd+jPSNKYVkfZgrSwJUbk3xI3mkjBo9zmQ=="
27
27
  }
28
28
  ],
29
29
  "publisher": "Po",
@@ -38,8 +38,8 @@
38
38
  "packages": [
39
39
  {
40
40
  "name": "@agimon-ai/po-team",
41
- "version": "0.0.0-alpha.165",
42
- "integrity": "sha512-6ku8OTmlKcS5kxRVx4QXMfHqzlWTZjLE+arK7UMYpC5AAtsiLoWR0ORKboBovItYdGhL0k/kKR6ClNA6CRQnWg=="
41
+ "version": "0.0.0-alpha.166",
42
+ "integrity": "sha512-kYDV/1WCL6duIFlPXS66lL71olnOwknekXhgJYtwQBmi5SEWNRo8GHrQRLMStKy/qxVOkvq/11pp4n5YMikIlw=="
43
43
  }
44
44
  ],
45
45
  "publisher": "Po",
@@ -54,8 +54,8 @@
54
54
  "packages": [
55
55
  {
56
56
  "name": "@agimon-ai/po-browse",
57
- "version": "0.0.1-alpha.163",
58
- "integrity": "sha512-y1aSozw2YsqwIc/aos1fRkcst40R7e39/UaQwFkMeVOFHV0mhT3s2mnCAg63+OQHBjEf2AAyAEMXH21Fr7nEOA=="
57
+ "version": "0.0.1-alpha.164",
58
+ "integrity": "sha512-XSgQNILVBOyZvs8hpjDecN666NlAxx9f9wgV6Qs0Tgw1qPZMw3hjwIJIOP2pG3ZBHhrIg5InlQ59tYmfMflEOA=="
59
59
  }
60
60
  ],
61
61
  "publisher": "Po",
@@ -70,8 +70,8 @@
70
70
  "packages": [
71
71
  {
72
72
  "name": "@agimon-ai/po-ios",
73
- "version": "0.0.1-alpha.100",
74
- "integrity": "sha512-H5I0QO5d4ptSHZEErBEZGS6ucwmiJk/hPFGp/5gCaZN6qpG6zktOBKH2Ld/nNGMGypXKME3IPw53qOAWDGJ1cA=="
73
+ "version": "0.0.1-alpha.101",
74
+ "integrity": "sha512-ehz51scO/TjJVHqZ3gbEavb5jrrtj4DlpIMpK2BLZGW/pSlC/WmY4bR3x8rqkZp9/0XnZJMsGuJVLppgYl5h7A=="
75
75
  }
76
76
  ],
77
77
  "publisher": "Po",
@@ -86,8 +86,8 @@
86
86
  "packages": [
87
87
  {
88
88
  "name": "@agimon-ai/po-git",
89
- "version": "0.0.0-alpha.165",
90
- "integrity": "sha512-E0pb3GvTvvF1UxWKSgW5yc/lH8s3izQyvrp7GYjtcvKNewWMk3dh5zYuhaBle7zqy1Lxt4XhJdR0EPYpRRfx5g=="
89
+ "version": "0.0.0-alpha.166",
90
+ "integrity": "sha512-dU7vSRCZ4gNr/J/f0FOwTSsKReu+8lXYgYD59RxOnHg8fFEMAKwh3zmgy8/HE5TdVeHlGOd7BIDutxPDU3QYhg=="
91
91
  }
92
92
  ],
93
93
  "publisher": "Po",
@@ -102,8 +102,8 @@
102
102
  "packages": [
103
103
  {
104
104
  "name": "@agimon-ai/po-calendar",
105
- "version": "0.0.1-alpha.124",
106
- "integrity": "sha512-PpWD8L8AmFHerVRnfkIMVuidxJFXMr6GnxWV3SZYm8OZ5K2KVQELmU5tkN6H4xsZwikcyKwmkbKglZg2Hkw2iw=="
105
+ "version": "0.0.1-alpha.125",
106
+ "integrity": "sha512-65WO2NUn6ZLkReCzPO240H2bgkZnlyIOawZ9NxJRE8jQPUWjzEf5a5Bix6HWi9Dcpo2nq2Grm3hqSm7xIV1N4w=="
107
107
  }
108
108
  ],
109
109
  "publisher": "Po",
@@ -118,23 +118,23 @@
118
118
  "packages": [
119
119
  {
120
120
  "name": "@agimon-ai/po-backdrop-bamboo",
121
- "version": "0.0.0-alpha.25",
122
- "integrity": "sha512-uoZaVyJ1V9NpKCE6a+Vdc1SqXB9n+KckLLhJ6YZTjhdHqALNh1+apXAdr3iKi0xiJAXqvYdz13bsitUcHKXF/g=="
121
+ "version": "0.0.0-alpha.26",
122
+ "integrity": "sha512-e+V/BxcVIrF/7iQykvdhDuP9p/pINHmdoYOwiv6d/UG3Q5SYgebBvzv3GsqzmMiZ4gGZXUmCfxWnZY6bbxL01g=="
123
123
  },
124
124
  {
125
125
  "name": "@agimon-ai/po-template-advanced",
126
- "version": "0.0.0-alpha.165",
127
- "integrity": "sha512-jHWe2sPfU2yc8H9dkEKgwbsZ77yl1+Ya24bmbzr+qbLmIG2qeRUv5SWLeuZ4PWrpamqDtzLH1qTUSFxtgbWq6Q=="
126
+ "version": "0.0.0-alpha.166",
127
+ "integrity": "sha512-lP8JAUjRp0P0W3hHWNNCxq2SBjiTa2uyQMRiT9vS1o+o3a/m0kDV4r8p7n+orlcHebQK6Q+qP182ti2FEzZzXQ=="
128
128
  },
129
129
  {
130
130
  "name": "@agimon-ai/po-template-desktop",
131
- "version": "0.0.0-alpha.164",
132
- "integrity": "sha512-chgrm13RobNLOmCni8ee8AUv0tro+H2TIvypzv8b2IxrDDJ9WuVu6vSovker3r1eZv8JxqxlEsJAEa5hF9DcMg=="
131
+ "version": "0.0.0-alpha.165",
132
+ "integrity": "sha512-PolrweezWj8WcO4Vn/Vgn4Zuo07mOIUkzjwgtXEePTixxeXalHGebuPOQ0rD0/vdofuB7x6pxYV+BQ2/mKd7CA=="
133
133
  },
134
134
  {
135
135
  "name": "@agimon-ai/po-template-elegant",
136
- "version": "0.0.0-alpha.165",
137
- "integrity": "sha512-IkAwb+uwaa6S9UqJFkqOjejO/mHXF8eAX/4m+XpR7u+0oqW72XINr8RprHmPUUM+2tXDb8Ku4+c5qfR4O4t3rw=="
136
+ "version": "0.0.0-alpha.166",
137
+ "integrity": "sha512-KlEARqJl4Z9n+qgnez3B+Sh9CxiC97c0avYPnyyjBx8gPKSiFATwvNBxEie1s0QEKU+lTVlPmTt32aqLXr06EA=="
138
138
  }
139
139
  ],
140
140
  "publisher": "Po",
@@ -149,13 +149,13 @@
149
149
  "packages": [
150
150
  {
151
151
  "name": "@agimon-ai/po-gateway",
152
- "version": "0.0.1-alpha.44",
153
- "integrity": "sha512-B7OtWHYsHNxhuhTgGFDtgY8n/acJuRPkpVEfAlXYj9A2OWVWWqLM+Z96AFmFpDbVhfZmeEP1lfxu6Q/YH7uSNw=="
152
+ "version": "0.0.1-alpha.45",
153
+ "integrity": "sha512-jOCxztjTHjb3JhvNfpfQvRNsa4qIEjdFnl+Zd8gL7A3IFug6lJLBxvKKmPjPVW9i0H5rA7RW0YttrNv8a/3Afg=="
154
154
  },
155
155
  {
156
156
  "name": "@agimon-ai/po-model-guidance",
157
- "version": "0.0.0-alpha.165",
158
- "integrity": "sha512-cyfbvnphHkDth9Cv8vrg7zo0xDhrEqEjObmVqH1aAdyOgnIs2ZHP2QcY+rM9sFsoLM30rWeJC2Kb6kh8gdP2/g=="
157
+ "version": "0.0.0-alpha.166",
158
+ "integrity": "sha512-QFDli3yVSLHuhvzNxc4DVb2asukmJHjWrThSVWif1vkLf/keDESHqKb6jxNPlvQx8AKKyL0yeYe3xOERgvo4yw=="
159
159
  }
160
160
  ],
161
161
  "publisher": "Po",
@@ -170,13 +170,13 @@
170
170
  "packages": [
171
171
  {
172
172
  "name": "@agimon-ai/po-auth-server",
173
- "version": "0.0.2-alpha.7",
174
- "integrity": "sha512-ato2jRrrADenq3mx5+KaQ6Lfk4IX7At3R1p7mJrYJ//OKWn9K4eyZWyZhvlgUuU5DXxDXPboA59DGCBCu7iFnQ=="
173
+ "version": "0.0.2-alpha.8",
174
+ "integrity": "sha512-2dXYRA67iutcKbt7E4r+BjXgW4Ur4gkuxBNgUyBgfcNuXKiUjQEV6fm/KhhE6vu2uJIa35b8nnrm0N2jD6OnLQ=="
175
175
  },
176
176
  {
177
177
  "name": "@agimon-ai/po-identity",
178
- "version": "0.0.2-alpha.112",
179
- "integrity": "sha512-GOzNaMtFemgoGTWMFW8zUlBix+IeecjvHJlCVM9hLz2SVnCu5g5uucuOc1Ga65ninP0ilyKxjjFa8WmicC2ybA=="
178
+ "version": "0.0.2-alpha.113",
179
+ "integrity": "sha512-QQCzK9KIA0PHRP++Cf7iHCEHvXQBCOg5hzyylVxKgTrULDpm2sbfwYOCMccaUlmXy80EzlX2XVlfvL65uSkilg=="
180
180
  }
181
181
  ],
182
182
  "publisher": "Po",
@@ -191,8 +191,8 @@
191
191
  "packages": [
192
192
  {
193
193
  "name": "@agimon-ai/po-sandbox",
194
- "version": "0.0.0-alpha.165",
195
- "integrity": "sha512-7Z3JdzGPSbFnEwX9LGxnmkudkpb7nWyfNqW63thVoN8GIcH4An7p1IUNsE2NFYtVbK0Ynv3/CMY13Cl2CSgz4Q=="
194
+ "version": "0.0.0-alpha.166",
195
+ "integrity": "sha512-N1Bt9aljFGUDcR3vPWIZEF0t348QwgBoqnjGKpBwNO6kC3Ls/hw9P6gxr2oBktyhMVzNlHwoP/1kFGtVJtwU2g=="
196
196
  }
197
197
  ],
198
198
  "publisher": "Po",
@@ -207,8 +207,8 @@
207
207
  "packages": [
208
208
  {
209
209
  "name": "@agimon-ai/po-style-system",
210
- "version": "0.0.0-alpha.165",
211
- "integrity": "sha512-OW48BxeO/ugvsHRuUxzomIUTZxvMy7dF0o+ObigKzJc4d6paolIjU5GKhPrZFFYqx/oPuPSpfYayTuKlxSkjYg=="
210
+ "version": "0.0.0-alpha.166",
211
+ "integrity": "sha512-mTvka5cFzsz8Fc3DZTduk4Jshecm1WQN2+4jk/HEjp9YEDKWMEcm7iqfYJpYNWS3JXvo99SjPa+XH+rumArDMg=="
212
212
  }
213
213
  ],
214
214
  "publisher": "Po",
@@ -223,8 +223,8 @@
223
223
  "packages": [
224
224
  {
225
225
  "name": "@agimon-ai/po-task",
226
- "version": "0.0.0-alpha.165",
227
- "integrity": "sha512-gbZCWHf0mHN7A5nQ2YhqBiiSGy4jHKbKva0b+vS2mwOAv2oxIG9xmuhIdDeEnvEa2y6bK94JRfbRKtkPoAzkww=="
226
+ "version": "0.0.0-alpha.166",
227
+ "integrity": "sha512-xCY9+MngL8Xp6dtd1W7EtILzB0j5NhNzWKSYTYARSD63uIc9G+z3mHBclQoqHtvZShPHlXMDb+jazr77egnhVg=="
228
228
  }
229
229
  ],
230
230
  "publisher": "Po",
@@ -239,8 +239,8 @@
239
239
  "packages": [
240
240
  {
241
241
  "name": "@agimon-ai/po-user-feedback",
242
- "version": "0.0.0-alpha.165",
243
- "integrity": "sha512-dgehvhsOGLtk0rkBodC1JZzo4t77jat37S9G8yvc5G+9idHUF7wMDIp0eF6Wrex/pC0WJbR+eMwvkJkXiQK2Sg=="
242
+ "version": "0.0.0-alpha.166",
243
+ "integrity": "sha512-1PdZbXqNOmFG/Pa7R6jsdw5R+Ldz+gH5nbT2oHm/DbPreRQEwnApiYzFOev5nOjRf+PFL00pnzQaSD7efOvr6w=="
244
244
  }
245
245
  ],
246
246
  "publisher": "Po",
@@ -255,8 +255,8 @@
255
255
  "packages": [
256
256
  {
257
257
  "name": "@agimon-ai/po-lint",
258
- "version": "0.0.1-alpha.134",
259
- "integrity": "sha512-3cnDXJAKJtc+JjcVX72CNNfUkuKMCpPymvnUScePCb102w7XgVJ5UAqxBrcLAgb1w3NLlvKh/gsuz4lnNaIstQ=="
258
+ "version": "0.0.1-alpha.135",
259
+ "integrity": "sha512-/AF+23eKLU5l1bPy0S1NFEXVHHIkbZyXfyZZ4bqltuR6YwjtRaAEjKMIQUQPs1L8R/HgnoXAgXzW5NuwQI41ig=="
260
260
  }
261
261
  ],
262
262
  "publisher": "Po",
@@ -271,8 +271,8 @@
271
271
  "packages": [
272
272
  {
273
273
  "name": "@agimon-ai/po-web-search",
274
- "version": "0.0.0-alpha.164",
275
- "integrity": "sha512-DUIGaE0vD9dYblfRP0DMeSeqBMhBWZ693cz3mxZ0QxU4afw5285sEvhrsCXHgTEl4PGiBK+Ks0y+JnJtU2GO5w=="
274
+ "version": "0.0.0-alpha.165",
275
+ "integrity": "sha512-fWmUExP0D9PWehYQSnai9nZ1o4L+TjUg/J8Lf08X/q+clO/JSjXjTlMpMeqVjiLvs1YbCjofYd5WT3BiBeK/nQ=="
276
276
  }
277
277
  ],
278
278
  "publisher": "Po",
@@ -287,8 +287,8 @@
287
287
  "packages": [
288
288
  {
289
289
  "name": "@agimon-ai/po-workflow",
290
- "version": "0.0.0-alpha.165",
291
- "integrity": "sha512-3q+loa+dRJdVTOc2MxBt4KwWEqjm0+gQuOo/Z0xsJ5yexjB1oIyFehbdJ8hnT1WlxbFW0cMJ4ma3X0/9zEkIiw=="
290
+ "version": "0.0.0-alpha.166",
291
+ "integrity": "sha512-JzdghFDl0iT17i5TmHmlxoSIG1G8s7Z3Cykw+SpItHnE2DDM99G46clhwMZ7Xs5Jq3FPrs07wD/AGW/Akl1V3A=="
292
292
  }
293
293
  ],
294
294
  "publisher": "Po",
@@ -298,7 +298,7 @@
298
298
  },
299
299
  "packages": {
300
300
  "@agimon-ai/po": {
301
- "version": "0.0.0-alpha.166",
301
+ "version": "0.0.0-alpha.167",
302
302
  "dependencies": [
303
303
  "@agimon-ai/po-approval",
304
304
  "@agimon-ai/po-artifact",
@@ -324,14 +324,14 @@
324
324
  ]
325
325
  },
326
326
  "@agimon-ai/po-approval": {
327
- "version": "0.0.0-alpha.165",
327
+ "version": "0.0.0-alpha.166",
328
328
  "dependencies": [
329
329
  "@agimon-ai/po-core",
330
330
  "@agimon-ai/po-web-components"
331
331
  ]
332
332
  },
333
333
  "@agimon-ai/po-artifact": {
334
- "version": "0.0.0-alpha.164",
334
+ "version": "0.0.0-alpha.165",
335
335
  "dependencies": [
336
336
  "@agimon-ai/po-core",
337
337
  "@agimon-ai/po-web-components",
@@ -339,14 +339,14 @@
339
339
  ]
340
340
  },
341
341
  "@agimon-ai/po-auth-server": {
342
- "version": "0.0.2-alpha.7",
342
+ "version": "0.0.2-alpha.8",
343
343
  "dependencies": [
344
344
  "@agimon-ai/po-core",
345
345
  "@agimon-ai/po-web-security"
346
346
  ]
347
347
  },
348
348
  "@agimon-ai/po-author": {
349
- "version": "0.0.0-alpha.165",
349
+ "version": "0.0.0-alpha.166",
350
350
  "dependencies": [
351
351
  "@agimon-ai/po-artifact",
352
352
  "@agimon-ai/po-core",
@@ -356,7 +356,7 @@
356
356
  ]
357
357
  },
358
358
  "@agimon-ai/po-autocompact": {
359
- "version": "0.0.0-alpha.165",
359
+ "version": "0.0.0-alpha.166",
360
360
  "dependencies": [
361
361
  "@agimon-ai/po-artifact",
362
362
  "@agimon-ai/po-config",
@@ -365,19 +365,19 @@
365
365
  ]
366
366
  },
367
367
  "@agimon-ai/po-autostop": {
368
- "version": "0.0.0-alpha.165",
368
+ "version": "0.0.0-alpha.166",
369
369
  "dependencies": [
370
370
  "@agimon-ai/po-core"
371
371
  ]
372
372
  },
373
373
  "@agimon-ai/po-backdrop-bamboo": {
374
- "version": "0.0.0-alpha.25",
374
+ "version": "0.0.0-alpha.26",
375
375
  "dependencies": [
376
376
  "@agimon-ai/po-core"
377
377
  ]
378
378
  },
379
379
  "@agimon-ai/po-browse": {
380
- "version": "0.0.1-alpha.163",
380
+ "version": "0.0.1-alpha.164",
381
381
  "dependencies": [
382
382
  "@agimon-ai/po-config",
383
383
  "@agimon-ai/po-core",
@@ -385,11 +385,11 @@
385
385
  ]
386
386
  },
387
387
  "@agimon-ai/po-build": {
388
- "version": "0.0.0-alpha.165",
388
+ "version": "0.0.0-alpha.166",
389
389
  "dependencies": []
390
390
  },
391
391
  "@agimon-ai/po-cache": {
392
- "version": "0.0.0-alpha.165",
392
+ "version": "0.0.0-alpha.166",
393
393
  "dependencies": [
394
394
  "@agimon-ai/po-config",
395
395
  "@agimon-ai/po-core",
@@ -397,7 +397,7 @@
397
397
  ]
398
398
  },
399
399
  "@agimon-ai/po-calendar": {
400
- "version": "0.0.1-alpha.124",
400
+ "version": "0.0.1-alpha.125",
401
401
  "dependencies": [
402
402
  "@agimon-ai/po-config",
403
403
  "@agimon-ai/po-core",
@@ -409,11 +409,11 @@
409
409
  ]
410
410
  },
411
411
  "@agimon-ai/po-claude-bridge": {
412
- "version": "0.1.1-alpha.145",
412
+ "version": "0.1.1-alpha.146",
413
413
  "dependencies": []
414
414
  },
415
415
  "@agimon-ai/po-codemode": {
416
- "version": "0.0.1-alpha.138",
416
+ "version": "0.0.1-alpha.139",
417
417
  "dependencies": [
418
418
  "@agimon-ai/po-config",
419
419
  "@agimon-ai/po-core",
@@ -421,7 +421,7 @@
421
421
  ]
422
422
  },
423
423
  "@agimon-ai/po-computer-use": {
424
- "version": "0.0.0-alpha.165",
424
+ "version": "0.0.0-alpha.166",
425
425
  "dependencies": [
426
426
  "@agimon-ai/po-config",
427
427
  "@agimon-ai/po-core",
@@ -431,26 +431,26 @@
431
431
  ]
432
432
  },
433
433
  "@agimon-ai/po-config": {
434
- "version": "0.0.0-alpha.165",
434
+ "version": "0.0.0-alpha.166",
435
435
  "dependencies": [
436
436
  "@agimon-ai/po-core",
437
437
  "@agimon-ai/po-web-components"
438
438
  ]
439
439
  },
440
440
  "@agimon-ai/po-core": {
441
- "version": "0.0.0-alpha.165",
441
+ "version": "0.0.0-alpha.166",
442
442
  "dependencies": [
443
443
  "@agimon-ai/po-web-security"
444
444
  ]
445
445
  },
446
446
  "@agimon-ai/po-db": {
447
- "version": "0.0.0-alpha.165",
447
+ "version": "0.0.0-alpha.166",
448
448
  "dependencies": [
449
449
  "@agimon-ai/po-core"
450
450
  ]
451
451
  },
452
452
  "@agimon-ai/po-domain": {
453
- "version": "0.0.0-alpha.165",
453
+ "version": "0.0.0-alpha.166",
454
454
  "dependencies": [
455
455
  "@agimon-ai/po-config",
456
456
  "@agimon-ai/po-core",
@@ -460,7 +460,7 @@
460
460
  ]
461
461
  },
462
462
  "@agimon-ai/po-edit": {
463
- "version": "0.0.0-alpha.165",
463
+ "version": "0.0.0-alpha.166",
464
464
  "dependencies": [
465
465
  "@agimon-ai/po-core",
466
466
  "@agimon-ai/po-hashline",
@@ -469,7 +469,7 @@
469
469
  ]
470
470
  },
471
471
  "@agimon-ai/po-file-edit": {
472
- "version": "0.0.0-alpha.165",
472
+ "version": "0.0.0-alpha.166",
473
473
  "dependencies": [
474
474
  "@agimon-ai/po-config",
475
475
  "@agimon-ai/po-core",
@@ -479,13 +479,13 @@
479
479
  ]
480
480
  },
481
481
  "@agimon-ai/po-gateway": {
482
- "version": "0.0.1-alpha.44",
482
+ "version": "0.0.1-alpha.45",
483
483
  "dependencies": [
484
484
  "@agimon-ai/po-core"
485
485
  ]
486
486
  },
487
487
  "@agimon-ai/po-git": {
488
- "version": "0.0.0-alpha.165",
488
+ "version": "0.0.0-alpha.166",
489
489
  "dependencies": [
490
490
  "@agimon-ai/po-core",
491
491
  "@agimon-ai/po-session",
@@ -494,7 +494,7 @@
494
494
  ]
495
495
  },
496
496
  "@agimon-ai/po-goal": {
497
- "version": "0.0.0-alpha.165",
497
+ "version": "0.0.0-alpha.166",
498
498
  "dependencies": [
499
499
  "@agimon-ai/po-core",
500
500
  "@agimon-ai/po-mode",
@@ -503,7 +503,7 @@
503
503
  ]
504
504
  },
505
505
  "@agimon-ai/po-grep": {
506
- "version": "0.0.0-alpha.165",
506
+ "version": "0.0.0-alpha.166",
507
507
  "dependencies": [
508
508
  "@agimon-ai/po-core",
509
509
  "@agimon-ai/po-hashline",
@@ -512,11 +512,11 @@
512
512
  ]
513
513
  },
514
514
  "@agimon-ai/po-hashline": {
515
- "version": "0.0.0-alpha.165",
515
+ "version": "0.0.0-alpha.166",
516
516
  "dependencies": []
517
517
  },
518
518
  "@agimon-ai/po-help": {
519
- "version": "0.0.0-alpha.165",
519
+ "version": "0.0.0-alpha.166",
520
520
  "dependencies": [
521
521
  "@agimon-ai/po-core",
522
522
  "@agimon-ai/po-mode",
@@ -525,14 +525,14 @@
525
525
  ]
526
526
  },
527
527
  "@agimon-ai/po-identity": {
528
- "version": "0.0.2-alpha.112",
528
+ "version": "0.0.2-alpha.113",
529
529
  "dependencies": [
530
530
  "@agimon-ai/po-core",
531
531
  "@agimon-ai/po-web-security"
532
532
  ]
533
533
  },
534
534
  "@agimon-ai/po-image-gen": {
535
- "version": "0.0.0-alpha.164",
535
+ "version": "0.0.0-alpha.165",
536
536
  "dependencies": [
537
537
  "@agimon-ai/po-core",
538
538
  "@agimon-ai/po-web-components",
@@ -540,7 +540,7 @@
540
540
  ]
541
541
  },
542
542
  "@agimon-ai/po-ios": {
543
- "version": "0.0.1-alpha.100",
543
+ "version": "0.0.1-alpha.101",
544
544
  "dependencies": [
545
545
  "@agimon-ai/po-artifact",
546
546
  "@agimon-ai/po-config",
@@ -550,7 +550,7 @@
550
550
  ]
551
551
  },
552
552
  "@agimon-ai/po-lint": {
553
- "version": "0.0.1-alpha.134",
553
+ "version": "0.0.1-alpha.135",
554
554
  "dependencies": [
555
555
  "@agimon-ai/po-config",
556
556
  "@agimon-ai/po-core",
@@ -560,7 +560,7 @@
560
560
  ]
561
561
  },
562
562
  "@agimon-ai/po-log": {
563
- "version": "0.0.0-alpha.165",
563
+ "version": "0.0.0-alpha.166",
564
564
  "dependencies": [
565
565
  "@agimon-ai/po-core",
566
566
  "@agimon-ai/po-web-components",
@@ -568,7 +568,7 @@
568
568
  ]
569
569
  },
570
570
  "@agimon-ai/po-mcp": {
571
- "version": "0.0.0-alpha.165",
571
+ "version": "0.0.0-alpha.166",
572
572
  "dependencies": [
573
573
  "@agimon-ai/po-config",
574
574
  "@agimon-ai/po-core",
@@ -579,30 +579,30 @@
579
579
  ]
580
580
  },
581
581
  "@agimon-ai/po-mcp-proxy": {
582
- "version": "0.0.1-alpha.144",
582
+ "version": "0.0.1-alpha.145",
583
583
  "dependencies": []
584
584
  },
585
585
  "@agimon-ai/po-mode": {
586
- "version": "0.0.0-alpha.165",
586
+ "version": "0.0.0-alpha.166",
587
587
  "dependencies": [
588
588
  "@agimon-ai/po-core"
589
589
  ]
590
590
  },
591
591
  "@agimon-ai/po-model-guidance": {
592
- "version": "0.0.0-alpha.165",
592
+ "version": "0.0.0-alpha.166",
593
593
  "dependencies": [
594
594
  "@agimon-ai/po-config",
595
595
  "@agimon-ai/po-core"
596
596
  ]
597
597
  },
598
598
  "@agimon-ai/po-native-components": {
599
- "version": "0.0.0-alpha.165",
599
+ "version": "0.0.0-alpha.166",
600
600
  "dependencies": [
601
601
  "@agimon-ai/po-web-components"
602
602
  ]
603
603
  },
604
604
  "@agimon-ai/po-native-dashboard": {
605
- "version": "0.0.0-alpha.37",
605
+ "version": "0.0.0-alpha.38",
606
606
  "dependencies": [
607
607
  "@agimon-ai/po-core",
608
608
  "@agimon-ai/po-native-components",
@@ -610,21 +610,21 @@
610
610
  ]
611
611
  },
612
612
  "@agimon-ai/po-network": {
613
- "version": "0.0.2-alpha.112",
613
+ "version": "0.0.2-alpha.113",
614
614
  "dependencies": [
615
615
  "@agimon-ai/po-core",
616
616
  "@agimon-ai/po-web-security"
617
617
  ]
618
618
  },
619
619
  "@agimon-ai/po-notification": {
620
- "version": "0.0.0-alpha.165",
620
+ "version": "0.0.0-alpha.166",
621
621
  "dependencies": [
622
622
  "@agimon-ai/po-autostop",
623
623
  "@agimon-ai/po-core"
624
624
  ]
625
625
  },
626
626
  "@agimon-ai/po-plan": {
627
- "version": "0.0.0-alpha.165",
627
+ "version": "0.0.0-alpha.166",
628
628
  "dependencies": [
629
629
  "@agimon-ai/po-config",
630
630
  "@agimon-ai/po-core",
@@ -634,14 +634,14 @@
634
634
  ]
635
635
  },
636
636
  "@agimon-ai/po-preset": {
637
- "version": "0.0.0-alpha.165",
637
+ "version": "0.0.0-alpha.166",
638
638
  "dependencies": [
639
639
  "@agimon-ai/po-config",
640
640
  "@agimon-ai/po-core"
641
641
  ]
642
642
  },
643
643
  "@agimon-ai/po-profile": {
644
- "version": "0.0.0-alpha.165",
644
+ "version": "0.0.0-alpha.166",
645
645
  "dependencies": [
646
646
  "@agimon-ai/po-config",
647
647
  "@agimon-ai/po-core",
@@ -649,7 +649,7 @@
649
649
  ]
650
650
  },
651
651
  "@agimon-ai/po-prompt": {
652
- "version": "0.0.0-alpha.165",
652
+ "version": "0.0.0-alpha.166",
653
653
  "dependencies": [
654
654
  "@agimon-ai/po-core",
655
655
  "@agimon-ai/po-web-components",
@@ -657,7 +657,7 @@
657
657
  ]
658
658
  },
659
659
  "@agimon-ai/po-read": {
660
- "version": "0.0.0-alpha.165",
660
+ "version": "0.0.0-alpha.166",
661
661
  "dependencies": [
662
662
  "@agimon-ai/po-config",
663
663
  "@agimon-ai/po-core",
@@ -667,7 +667,7 @@
667
667
  ]
668
668
  },
669
669
  "@agimon-ai/po-runner": {
670
- "version": "0.0.0-alpha.165",
670
+ "version": "0.0.0-alpha.166",
671
671
  "dependencies": [
672
672
  "@agimon-ai/po-core",
673
673
  "@agimon-ai/po-ui",
@@ -676,13 +676,13 @@
676
676
  ]
677
677
  },
678
678
  "@agimon-ai/po-sandbox": {
679
- "version": "0.0.0-alpha.165",
679
+ "version": "0.0.0-alpha.166",
680
680
  "dependencies": [
681
681
  "@agimon-ai/po-core"
682
682
  ]
683
683
  },
684
684
  "@agimon-ai/po-scaffold": {
685
- "version": "0.0.0-alpha.165",
685
+ "version": "0.0.0-alpha.166",
686
686
  "dependencies": [
687
687
  "@agimon-ai/po-core",
688
688
  "@agimon-ai/po-web-components",
@@ -690,7 +690,7 @@
690
690
  ]
691
691
  },
692
692
  "@agimon-ai/po-session": {
693
- "version": "0.0.0-alpha.165",
693
+ "version": "0.0.0-alpha.166",
694
694
  "dependencies": [
695
695
  "@agimon-ai/po-config",
696
696
  "@agimon-ai/po-core",
@@ -699,7 +699,7 @@
699
699
  ]
700
700
  },
701
701
  "@agimon-ai/po-skill": {
702
- "version": "0.0.0-alpha.165",
702
+ "version": "0.0.0-alpha.166",
703
703
  "dependencies": [
704
704
  "@agimon-ai/po-config",
705
705
  "@agimon-ai/po-core",
@@ -708,7 +708,7 @@
708
708
  ]
709
709
  },
710
710
  "@agimon-ai/po-space": {
711
- "version": "0.0.1-alpha.8",
711
+ "version": "0.0.1-alpha.9",
712
712
  "dependencies": [
713
713
  "@agimon-ai/po-artifact",
714
714
  "@agimon-ai/po-core",
@@ -717,7 +717,7 @@
717
717
  ]
718
718
  },
719
719
  "@agimon-ai/po-style-system": {
720
- "version": "0.0.0-alpha.165",
720
+ "version": "0.0.0-alpha.166",
721
721
  "dependencies": [
722
722
  "@agimon-ai/po-core",
723
723
  "@agimon-ai/po-web-components",
@@ -725,7 +725,7 @@
725
725
  ]
726
726
  },
727
727
  "@agimon-ai/po-task": {
728
- "version": "0.0.0-alpha.165",
728
+ "version": "0.0.0-alpha.166",
729
729
  "dependencies": [
730
730
  "@agimon-ai/po-core",
731
731
  "@agimon-ai/po-ui",
@@ -733,7 +733,7 @@
733
733
  ]
734
734
  },
735
735
  "@agimon-ai/po-team": {
736
- "version": "0.0.0-alpha.165",
736
+ "version": "0.0.0-alpha.166",
737
737
  "dependencies": [
738
738
  "@agimon-ai/po-cache",
739
739
  "@agimon-ai/po-config",
@@ -745,7 +745,7 @@
745
745
  ]
746
746
  },
747
747
  "@agimon-ai/po-template-advanced": {
748
- "version": "0.0.0-alpha.165",
748
+ "version": "0.0.0-alpha.166",
749
749
  "dependencies": [
750
750
  "@agimon-ai/po-core",
751
751
  "@agimon-ai/po-web-components",
@@ -753,7 +753,7 @@
753
753
  ]
754
754
  },
755
755
  "@agimon-ai/po-template-desktop": {
756
- "version": "0.0.0-alpha.164",
756
+ "version": "0.0.0-alpha.165",
757
757
  "dependencies": [
758
758
  "@agimon-ai/po-core",
759
759
  "@agimon-ai/po-web-components",
@@ -761,7 +761,7 @@
761
761
  ]
762
762
  },
763
763
  "@agimon-ai/po-template-elegant": {
764
- "version": "0.0.0-alpha.165",
764
+ "version": "0.0.0-alpha.166",
765
765
  "dependencies": [
766
766
  "@agimon-ai/po-core",
767
767
  "@agimon-ai/po-web-components",
@@ -769,7 +769,7 @@
769
769
  ]
770
770
  },
771
771
  "@agimon-ai/po-ui": {
772
- "version": "0.0.0-alpha.165",
772
+ "version": "0.0.0-alpha.166",
773
773
  "dependencies": [
774
774
  "@agimon-ai/po-core",
775
775
  "@agimon-ai/po-hashline",
@@ -778,7 +778,7 @@
778
778
  ]
779
779
  },
780
780
  "@agimon-ai/po-user-feedback": {
781
- "version": "0.0.0-alpha.165",
781
+ "version": "0.0.0-alpha.166",
782
782
  "dependencies": [
783
783
  "@agimon-ai/po-core",
784
784
  "@agimon-ai/po-mode",
@@ -787,7 +787,7 @@
787
787
  ]
788
788
  },
789
789
  "@agimon-ai/po-vault": {
790
- "version": "0.0.0-alpha.165",
790
+ "version": "0.0.0-alpha.166",
791
791
  "dependencies": [
792
792
  "@agimon-ai/po-core",
793
793
  "@agimon-ai/po-db",
@@ -796,7 +796,7 @@
796
796
  ]
797
797
  },
798
798
  "@agimon-ai/po-voice": {
799
- "version": "0.0.0-alpha.165",
799
+ "version": "0.0.0-alpha.166",
800
800
  "dependencies": [
801
801
  "@agimon-ai/po-config",
802
802
  "@agimon-ai/po-core",
@@ -809,11 +809,11 @@
809
809
  ]
810
810
  },
811
811
  "@agimon-ai/po-web-components": {
812
- "version": "0.0.0-alpha.165",
812
+ "version": "0.0.0-alpha.166",
813
813
  "dependencies": []
814
814
  },
815
815
  "@agimon-ai/po-web-dashboard": {
816
- "version": "0.0.0-alpha.165",
816
+ "version": "0.0.0-alpha.166",
817
817
  "dependencies": [
818
818
  "@agimon-ai/po-core",
819
819
  "@agimon-ai/po-web-components",
@@ -821,18 +821,18 @@
821
821
  ]
822
822
  },
823
823
  "@agimon-ai/po-web-search": {
824
- "version": "0.0.0-alpha.164",
824
+ "version": "0.0.0-alpha.165",
825
825
  "dependencies": [
826
826
  "@agimon-ai/po-core",
827
827
  "@agimon-ai/po-web-components"
828
828
  ]
829
829
  },
830
830
  "@agimon-ai/po-web-security": {
831
- "version": "0.0.0-alpha.165",
831
+ "version": "0.0.0-alpha.166",
832
832
  "dependencies": []
833
833
  },
834
834
  "@agimon-ai/po-workflow": {
835
- "version": "0.0.0-alpha.165",
835
+ "version": "0.0.0-alpha.166",
836
836
  "dependencies": [
837
837
  "@agimon-ai/po-core",
838
838
  "@agimon-ai/po-ui",
package/dist/package.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.0.0-alpha.166";
2
+ var version = "0.0.0-alpha.167";
3
3
  //#endregion
4
4
  Object.defineProperty(exports, "version", {
5
5
  enumerable: true,
package/dist/package.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.0.0-alpha.166";
2
+ var version = "0.0.0-alpha.167";
3
3
  //#endregion
4
4
  export { version };
5
5
 
@@ -112,6 +112,7 @@ async function bundleCockpitWeb(options) {
112
112
  envDir: false,
113
113
  logLevel: "warn",
114
114
  base: "./",
115
+ root: hostRoot,
115
116
  plugins: [
116
117
  require_webPluginVite.webPluginRuntimeFacadePlugin(hostRoot),
117
118
  react(),
@@ -143,7 +144,7 @@ async function bundleCockpitWeb(options) {
143
144
  }
144
145
  });
145
146
  const manifest = JSON.parse(await node_fs_promises.default.readFile(node_path.default.join(pluginsDir, "manifest.json"), "utf8"));
146
- const manifestRoot = await node_fs_promises.default.realpath(process.cwd());
147
+ const manifestRoot = await node_fs_promises.default.realpath(hostRoot);
147
148
  const closures = new Map(await Promise.all(plugins.map(async (plugin) => {
148
149
  const entryPath = await node_fs_promises.default.realpath(generated.slotEntryPaths[plugin.slot]);
149
150
  return [plugin.slot, manifestClosure(manifest, node_path.default.relative(manifestRoot, entryPath).split(node_path.default.sep).join("/"))];
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.cjs","names":["scanWebPlugins","path","writeSyncWebPluginModules","fs","PLUGIN_ROOTS_FILE","webPluginOverridePlugin","bundleAssetPolicyPlugin","webPluginRuntimeAliases","webPluginCssAlias","webPluginRuntimeFacadePlugin","isWebPluginFacade","WEB_PLUGIN_FACADE_CHUNK","writeWebPluginStyleEntries","BASE_STYLE_ENTRY","pluginStyleEntryName"],"sources":["../../../../src/builders/web/bundle.ts"],"sourcesContent":["import fs from 'node:fs/promises';\nimport path from 'node:path';\n\nimport { bundleAssetPolicyPlugin } from './bundleAssetPolicy';\nimport { PLUGIN_ROOTS_FILE } from './webDevRoots';\nimport {\n BASE_STYLE_ENTRY,\n pluginStyleEntryName,\n writeSyncWebPluginModules,\n writeWebPluginStyleEntries,\n} from './webPluginGenerate';\nimport type { DeclaredWebPlugin } from './webPluginManifest';\nimport { scanWebPlugins } from './webPluginScan';\nimport {\n isWebPluginFacade,\n WEB_PLUGIN_FACADE_CHUNK,\n webPluginCssAlias,\n webPluginOverridePlugin,\n webPluginRuntimeAliases,\n webPluginRuntimeFacadePlugin,\n} from './webPluginVite';\n\n/** Shared runtime packages every plugin's client code must resolve to the host copies. */\nconst DEDUPED_RUNTIMES = [\n 'react',\n 'react-dom',\n '@tanstack/store',\n '@tanstack/react-store',\n '@tanstack/react-router',\n '@agimon-ai/po-core',\n '@agimon-ai/po-web-dashboard',\n '@agimon-ai/po-web-components',\n // The sealed transport is a module singleton whose nonce counters every\n // plugin shares; a second copy would start counting at zero.\n '@agimon-ai/po-web-security',\n // CodeMirror's state and view are singletons in all but name: a document\n // built against one copy is rejected by an editor from the other, and a\n // grammar chunk resolved separately from the editor is exactly how a second\n // copy appears.\n '@codemirror/state',\n '@codemirror/view',\n];\n\nexport interface BundleCockpitWebOptions {\n hostRoot: string;\n /** Package roots to scan for poWeb manifests, usually the installed composition. */\n pluginRoots: readonly string[];\n /** Output directory; receives web/, plugins/, generated/, and pluginRoots.json. */\n outDir: string;\n onNotice?: (message: string) => void;\n}\n\nexport interface BundleCockpitWebResult {\n /** The cockpit shell with the host's own plugins; every other plugin ships in pluginsDir. */\n assetsDir: string;\n /** Standalone session plugin composition artifacts. */\n pluginsDir: string;\n pluginIds: string[];\n /** Every declared plugin copy with its slot and the files its slot entry reaches. */\n plugins: WebPluginBuildRecord[];\n /** The shared content-hashed Tailwind stylesheet below pluginsDir, keyed by slot. */\n pluginStyles: Record<string, string>;\n /** The same shared stylesheet, also loaded by mounts without plugins. */\n baseStyle: string;\n}\n\n/** One plugin copy in a build: its slot entry and the emitted files that entry can load. */\nexport interface WebPluginBuildRecord {\n pluginId: string;\n slot: string;\n packageDir: string;\n isHost: boolean;\n /** Descriptions from the same package manifest used to build this plugin copy. */\n brain?: DeclaredWebPlugin['brain'];\n /** The slot entry module below pluginsDir. */\n entry: string;\n /** Every file the entry reaches through imports, plus the shared stylesheet and its assets. */\n files: string[];\n /** The stylesheets of the entry's static import closure, which a mount loads up front. */\n css: string[];\n}\n\ninterface ManifestChunk {\n file: string;\n imports?: string[];\n dynamicImports?: string[];\n css?: string[];\n assets?: string[];\n}\n\n/**\n * The files one manifest entry reaches: `files` follows static and dynamic imports and holds\n * every chunk, asset, and stylesheet on the way; `css` follows static imports only.\n */\nexport function manifestClosure(\n manifest: Readonly<Record<string, ManifestChunk>>,\n entryKey: string,\n): { entry: string; files: string[]; css: string[] } {\n const chunkOf = (key: string): ManifestChunk => {\n const chunk = manifest[key];\n if (chunk === undefined) throw new Error(`The composition manifest has no chunk '${key}'.`);\n return chunk;\n };\n const files = new Set<string>();\n const visited = new Set<string>();\n const walk = (key: string): void => {\n if (visited.has(key)) return;\n visited.add(key);\n const chunk = chunkOf(key);\n files.add(chunk.file);\n for (const file of [...(chunk.css ?? []), ...(chunk.assets ?? [])]) files.add(file);\n for (const next of [...(chunk.imports ?? []), ...(chunk.dynamicImports ?? [])]) walk(next);\n };\n walk(entryKey);\n const css = new Set<string>();\n const staticVisited = new Set<string>();\n const walkStatic = (key: string): void => {\n if (staticVisited.has(key)) return;\n staticVisited.add(key);\n const chunk = chunkOf(key);\n for (const file of chunk.css ?? []) css.add(file);\n for (const next of chunk.imports ?? []) walkStatic(next);\n };\n walkStatic(entryKey);\n return { entry: chunkOf(entryKey).file, files: [...files], css: [...css] };\n}\n\n/**\n * Builds the cockpit SPA against the installed plugin set.\n *\n * This is what `po sync` calls: manifests come from the given package\n * roots (no hardcoded plugin dependencies anywhere), the generated entry\n * modules are aliased over the committed builtin registry, and Vite compiles\n * the host shell and, separately, each plugin's shipped web source into one\n * ES-module composition with an entry per slot, so each plugin and its assets ship once.\n * The roots file beside\n * the bundle lets the dev server serve the same composition with hot reload.\n */\nexport async function bundleCockpitWeb(options: BundleCockpitWebOptions): Promise<BundleCockpitWebResult> {\n const notice = options.onNotice ?? ((): void => {});\n const hostRoot = options.hostRoot;\n const plugins = await scanWebPlugins(hostRoot, options.pluginRoots, notice);\n notice(\n `bundling the cockpit with ${String(plugins.length)} web plugin(s): ${plugins.map((p) => p.pluginId).join(', ')}`,\n );\n\n const generatedDir = path.join(options.outDir, 'generated');\n const assetsDir = path.join(options.outDir, 'web');\n const pluginsDir = path.join(options.outDir, 'plugins');\n const generated = await writeSyncWebPluginModules(plugins, generatedDir, hostRoot);\n const roots = [...new Set(options.pluginRoots.map((root) => path.resolve(root)))];\n await fs.writeFile(path.join(options.outDir, PLUGIN_ROOTS_FILE), `${JSON.stringify(roots, null, 2)}\\n`);\n\n // Vite and its plugins are regular dependencies so this works from an\n // installed package, not only the workspace.\n const { build } = await import('vite');\n const { default: react } = await import('@vitejs/plugin-react');\n const { default: tailwindcss } = await import('@tailwindcss/vite');\n\n const clientRoot = path.join(hostRoot, 'src', 'web');\n\n // The shell carries only the host's own plugins; the rest load from the composition below.\n await build({\n configFile: false,\n envDir: false,\n logLevel: 'warn',\n root: clientRoot,\n plugins: [webPluginOverridePlugin(clientRoot, generated.shell), react(), tailwindcss(), bundleAssetPolicyPlugin()],\n resolve: {\n dedupe: [...DEDUPED_RUNTIMES],\n alias: [...webPluginRuntimeAliases(clientRoot), webPluginCssAlias(generated.shell)],\n },\n build: {\n outDir: assetsDir,\n emptyOutDir: true,\n sourcemap: false,\n },\n });\n\n // One ES-module composition: an entry per slot exporting its webPlugin, shared chunks\n // between them, and the shared runtime modules read from the page through facades.\n await build({\n configFile: false,\n envDir: false,\n logLevel: 'warn',\n base: './',\n plugins: [webPluginRuntimeFacadePlugin(hostRoot), react(), tailwindcss()],\n resolve: {\n dedupe: [...DEDUPED_RUNTIMES],\n alias: [webPluginCssAlias(generated)],\n },\n build: {\n cssCodeSplit: true,\n modulePreload: false,\n outDir: pluginsDir,\n emptyOutDir: true,\n sourcemap: false,\n assetsInlineLimit: 0,\n manifest: 'manifest.json',\n rollupOptions: {\n input: generated.slotEntryPaths,\n // Each slot entry is loaded for its webPlugin export, so it must keep it.\n preserveEntrySignatures: 'exports-only',\n output: {\n format: 'es',\n entryFileNames: 'slots/[name]-[hash].js',\n chunkFileNames: 'chunks/[name]-[hash].js',\n assetFileNames: 'assets/[name]-[hash][extname]',\n manualChunks: (id) => (isWebPluginFacade(id) ? WEB_PLUGIN_FACADE_CHUNK : undefined),\n },\n },\n },\n });\n const manifest = JSON.parse(await fs.readFile(path.join(pluginsDir, 'manifest.json'), 'utf8')) as Record<\n string,\n ManifestChunk\n >;\n // Manifest keys are the entry sources relative to the build root, which is the working directory.\n const manifestRoot = await fs.realpath(process.cwd());\n const closures = new Map(\n await Promise.all(\n plugins.map(async (plugin) => {\n const entryPath = await fs.realpath(generated.slotEntryPaths[plugin.slot]);\n return [\n plugin.slot,\n manifestClosure(manifest, path.relative(manifestRoot, entryPath).split(path.sep).join('/')),\n ] as const;\n }),\n ),\n );\n\n // One content-hashed Tailwind stylesheet for the shell, fallback template, and all plugins.\n const styles = await writeWebPluginStyleEntries(plugins, generatedDir, hostRoot);\n const stylesRoot = path.dirname(styles.baseEntryPath);\n await build({\n configFile: false,\n envDir: false,\n logLevel: 'warn',\n root: stylesRoot,\n base: './',\n plugins: [tailwindcss()],\n resolve: {\n alias: [{ find: /^\\.\\/webPluginSources\\.generated\\.css$/, replacement: styles.baseSourcesPath }],\n },\n build: {\n cssCodeSplit: true,\n outDir: pluginsDir,\n emptyOutDir: false,\n sourcemap: false,\n assetsInlineLimit: 0,\n manifest: 'styles.manifest.json',\n rollupOptions: {\n input: Object.fromEntries([\n [BASE_STYLE_ENTRY, styles.baseEntryPath],\n ...[...styles.pluginEntryPaths].map(([slot, entry]) => [pluginStyleEntryName(slot), entry]),\n ]),\n output: { assetFileNames: 'assets/[name]-[hash][extname]' },\n },\n },\n });\n const styleManifest = JSON.parse(await fs.readFile(path.join(pluginsDir, 'styles.manifest.json'), 'utf8')) as Record<\n string,\n { file?: string; css?: string[]; assets?: string[] }\n >;\n await fs.rm(path.join(pluginsDir, 'styles.manifest.json'));\n const emitted = (entry: string): { file: string; assets: string[] } => {\n const record = styleManifest[path.relative(stylesRoot, entry).split(path.sep).join('/')];\n const file = record?.file?.endsWith('.css') ? record.file : record?.css?.[0];\n if (file === undefined) throw new Error(`The stylesheet entry '${entry}' emitted no CSS file.`);\n return { file, assets: record?.assets ?? [] };\n };\n const base = emitted(styles.baseEntryPath);\n const slotStyles = new Map(\n plugins.map((plugin) => {\n const entry = styles.pluginEntryPaths.get(plugin.slot);\n return [plugin.slot, entry === undefined ? base : emitted(entry)];\n }),\n );\n const pluginStyles = Object.fromEntries([...slotStyles].map(([slot, style]) => [slot, style.file]));\n await fs.writeFile(path.join(pluginsDir, 'index.html'), '<!doctype html>\\n<title>Po plugin composition</title>\\n');\n\n return {\n assetsDir,\n pluginsDir,\n pluginIds: plugins.map((plugin) => plugin.pluginId),\n plugins: plugins.map((plugin) => {\n const closure = closures.get(plugin.slot);\n const style = slotStyles.get(plugin.slot);\n if (closure === undefined || style === undefined) throw new Error(`The slot '${plugin.slot}' emitted no entry.`);\n return {\n pluginId: plugin.pluginId,\n slot: plugin.slot,\n packageDir: plugin.packageDir,\n isHost: plugin.isHost,\n ...(plugin.brain === undefined ? {} : { brain: plugin.brain }),\n entry: closure.entry,\n // The shared stylesheet and its fonts must be verified for every slot.\n files: [...new Set([...closure.files, style.file, ...style.assets])],\n css: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,IAAI;EACrD,OAAO,CAAC,OAAO,MAAM,UAAU,KAAA,IAAY,OAAO,QAAQ,KAAK,CAAC;CAClE,CAAC,CACH;CACA,MAAM,eAAe,OAAO,YAAY,CAAC,GAAG,UAAU,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW,CAAC,MAAM,MAAM,IAAI,CAAC,CAAC;CAClG,MAAME,iBAAAA,QAAG,UAAUF,UAAAA,QAAK,KAAK,YAAY,YAAY,GAAG,yDAAyD;CAEjH,OAAO;EACL;EACA;EACA,WAAW,QAAQ,KAAK,WAAW,OAAO,QAAQ;EAClD,SAAS,QAAQ,KAAK,WAAW;GAC/B,MAAM,UAAU,SAAS,IAAI,OAAO,IAAI;GACxC,MAAM,QAAQ,WAAW,IAAI,OAAO,IAAI;GACxC,IAAI,YAAY,KAAA,KAAa,UAAU,KAAA,GAAW,MAAM,IAAI,MAAM,aAAa,OAAO,KAAK,oBAAoB;GAC/G,OAAO;IACL,UAAU,OAAO;IACjB,MAAM,OAAO;IACb,YAAY,OAAO;IACnB,QAAQ,OAAO;IACf,GAAI,OAAO,UAAU,KAAA,IAAY,CAAC,IAAI,EAAE,OAAO,OAAO,MAAM;IAC5D,OAAO,QAAQ;IAEf,OAAO,CAAC,mBAAG,IAAI,IAAI;KAAC,GAAG,QAAQ;KAAO,MAAM;KAAM,GAAG,MAAM;IAAM,CAAC,CAAC;IACnE,KAAK,QAAQ;GACf;EACF,CAAC;EACD;EACA,WAAW,KAAK;CAClB;AACF"}
1
+ {"version":3,"file":"bundle.cjs","names":["scanWebPlugins","path","writeSyncWebPluginModules","fs","PLUGIN_ROOTS_FILE","webPluginOverridePlugin","bundleAssetPolicyPlugin","webPluginRuntimeAliases","webPluginCssAlias","webPluginRuntimeFacadePlugin","isWebPluginFacade","WEB_PLUGIN_FACADE_CHUNK","writeWebPluginStyleEntries","BASE_STYLE_ENTRY","pluginStyleEntryName"],"sources":["../../../../src/builders/web/bundle.ts"],"sourcesContent":["import fs from 'node:fs/promises';\nimport path from 'node:path';\n\nimport { bundleAssetPolicyPlugin } from './bundleAssetPolicy';\nimport { PLUGIN_ROOTS_FILE } from './webDevRoots';\nimport {\n BASE_STYLE_ENTRY,\n pluginStyleEntryName,\n writeSyncWebPluginModules,\n writeWebPluginStyleEntries,\n} from './webPluginGenerate';\nimport type { DeclaredWebPlugin } from './webPluginManifest';\nimport { scanWebPlugins } from './webPluginScan';\nimport {\n isWebPluginFacade,\n WEB_PLUGIN_FACADE_CHUNK,\n webPluginCssAlias,\n webPluginOverridePlugin,\n webPluginRuntimeAliases,\n webPluginRuntimeFacadePlugin,\n} from './webPluginVite';\n\n/** Shared runtime packages every plugin's client code must resolve to the host copies. */\nconst DEDUPED_RUNTIMES = [\n 'react',\n 'react-dom',\n '@tanstack/store',\n '@tanstack/react-store',\n '@tanstack/react-router',\n '@agimon-ai/po-core',\n '@agimon-ai/po-web-dashboard',\n '@agimon-ai/po-web-components',\n // The sealed transport is a module singleton whose nonce counters every\n // plugin shares; a second copy would start counting at zero.\n '@agimon-ai/po-web-security',\n // CodeMirror's state and view are singletons in all but name: a document\n // built against one copy is rejected by an editor from the other, and a\n // grammar chunk resolved separately from the editor is exactly how a second\n // copy appears.\n '@codemirror/state',\n '@codemirror/view',\n];\n\nexport interface BundleCockpitWebOptions {\n hostRoot: string;\n /** Package roots to scan for poWeb manifests, usually the installed composition. */\n pluginRoots: readonly string[];\n /** Output directory; receives web/, plugins/, generated/, and pluginRoots.json. */\n outDir: string;\n onNotice?: (message: string) => void;\n}\n\nexport interface BundleCockpitWebResult {\n /** The cockpit shell with the host's own plugins; every other plugin ships in pluginsDir. */\n assetsDir: string;\n /** Standalone session plugin composition artifacts. */\n pluginsDir: string;\n pluginIds: string[];\n /** Every declared plugin copy with its slot and the files its slot entry reaches. */\n plugins: WebPluginBuildRecord[];\n /** The shared content-hashed Tailwind stylesheet below pluginsDir, keyed by slot. */\n pluginStyles: Record<string, string>;\n /** The same shared stylesheet, also loaded by mounts without plugins. */\n baseStyle: string;\n}\n\n/** One plugin copy in a build: its slot entry and the emitted files that entry can load. */\nexport interface WebPluginBuildRecord {\n pluginId: string;\n slot: string;\n packageDir: string;\n isHost: boolean;\n /** Descriptions from the same package manifest used to build this plugin copy. */\n brain?: DeclaredWebPlugin['brain'];\n /** The slot entry module below pluginsDir. */\n entry: string;\n /** Every file the entry reaches through imports, plus the shared stylesheet and its assets. */\n files: string[];\n /** The stylesheets of the entry's static import closure, which a mount loads up front. */\n css: string[];\n}\n\ninterface ManifestChunk {\n file: string;\n imports?: string[];\n dynamicImports?: string[];\n css?: string[];\n assets?: string[];\n}\n\n/**\n * The files one manifest entry reaches: `files` follows static and dynamic imports and holds\n * every chunk, asset, and stylesheet on the way; `css` follows static imports only.\n */\nexport function manifestClosure(\n manifest: Readonly<Record<string, ManifestChunk>>,\n entryKey: string,\n): { entry: string; files: string[]; css: string[] } {\n const chunkOf = (key: string): ManifestChunk => {\n const chunk = manifest[key];\n if (chunk === undefined) throw new Error(`The composition manifest has no chunk '${key}'.`);\n return chunk;\n };\n const files = new Set<string>();\n const visited = new Set<string>();\n const walk = (key: string): void => {\n if (visited.has(key)) return;\n visited.add(key);\n const chunk = chunkOf(key);\n files.add(chunk.file);\n for (const file of [...(chunk.css ?? []), ...(chunk.assets ?? [])]) files.add(file);\n for (const next of [...(chunk.imports ?? []), ...(chunk.dynamicImports ?? [])]) walk(next);\n };\n walk(entryKey);\n const css = new Set<string>();\n const staticVisited = new Set<string>();\n const walkStatic = (key: string): void => {\n if (staticVisited.has(key)) return;\n staticVisited.add(key);\n const chunk = chunkOf(key);\n for (const file of chunk.css ?? []) css.add(file);\n for (const next of chunk.imports ?? []) walkStatic(next);\n };\n walkStatic(entryKey);\n return { entry: chunkOf(entryKey).file, files: [...files], css: [...css] };\n}\n\n/**\n * Builds the cockpit SPA against the installed plugin set.\n *\n * This is what `po sync` calls: manifests come from the given package\n * roots (no hardcoded plugin dependencies anywhere), the generated entry\n * modules are aliased over the committed builtin registry, and Vite compiles\n * the host shell and, separately, each plugin's shipped web source into one\n * ES-module composition with an entry per slot, so each plugin and its assets ship once.\n * The roots file beside\n * the bundle lets the dev server serve the same composition with hot reload.\n */\nexport async function bundleCockpitWeb(options: BundleCockpitWebOptions): Promise<BundleCockpitWebResult> {\n const notice = options.onNotice ?? ((): void => {});\n const hostRoot = options.hostRoot;\n const plugins = await scanWebPlugins(hostRoot, options.pluginRoots, notice);\n notice(\n `bundling the cockpit with ${String(plugins.length)} web plugin(s): ${plugins.map((p) => p.pluginId).join(', ')}`,\n );\n\n const generatedDir = path.join(options.outDir, 'generated');\n const assetsDir = path.join(options.outDir, 'web');\n const pluginsDir = path.join(options.outDir, 'plugins');\n const generated = await writeSyncWebPluginModules(plugins, generatedDir, hostRoot);\n const roots = [...new Set(options.pluginRoots.map((root) => path.resolve(root)))];\n await fs.writeFile(path.join(options.outDir, PLUGIN_ROOTS_FILE), `${JSON.stringify(roots, null, 2)}\\n`);\n\n // Vite and its plugins are regular dependencies so this works from an\n // installed package, not only the workspace.\n const { build } = await import('vite');\n const { default: react } = await import('@vitejs/plugin-react');\n const { default: tailwindcss } = await import('@tailwindcss/vite');\n\n const clientRoot = path.join(hostRoot, 'src', 'web');\n\n // The shell carries only the host's own plugins; the rest load from the composition below.\n await build({\n configFile: false,\n envDir: false,\n logLevel: 'warn',\n root: clientRoot,\n plugins: [webPluginOverridePlugin(clientRoot, generated.shell), react(), tailwindcss(), bundleAssetPolicyPlugin()],\n resolve: {\n dedupe: [...DEDUPED_RUNTIMES],\n alias: [...webPluginRuntimeAliases(clientRoot), webPluginCssAlias(generated.shell)],\n },\n build: {\n outDir: assetsDir,\n emptyOutDir: true,\n sourcemap: false,\n },\n });\n\n // One ES-module composition: an entry per slot exporting its webPlugin, shared chunks\n // between them, and the shared runtime modules read from the page through facades.\n await build({\n configFile: false,\n envDir: false,\n logLevel: 'warn',\n base: './',\n // Deduped runtimes resolve from the build root; the host's copy is the one the page runtime holds,\n // and the one the facades read their export names from. The working directory may not have one.\n root: hostRoot,\n plugins: [webPluginRuntimeFacadePlugin(hostRoot), react(), tailwindcss()],\n resolve: {\n dedupe: [...DEDUPED_RUNTIMES],\n alias: [webPluginCssAlias(generated)],\n },\n build: {\n cssCodeSplit: true,\n modulePreload: false,\n outDir: pluginsDir,\n emptyOutDir: true,\n sourcemap: false,\n assetsInlineLimit: 0,\n manifest: 'manifest.json',\n rollupOptions: {\n input: generated.slotEntryPaths,\n // Each slot entry is loaded for its webPlugin export, so it must keep it.\n preserveEntrySignatures: 'exports-only',\n output: {\n format: 'es',\n entryFileNames: 'slots/[name]-[hash].js',\n chunkFileNames: 'chunks/[name]-[hash].js',\n assetFileNames: 'assets/[name]-[hash][extname]',\n manualChunks: (id) => (isWebPluginFacade(id) ? WEB_PLUGIN_FACADE_CHUNK : undefined),\n },\n },\n },\n });\n const manifest = JSON.parse(await fs.readFile(path.join(pluginsDir, 'manifest.json'), 'utf8')) as Record<\n string,\n ManifestChunk\n >;\n // Manifest keys are the entry sources relative to the build root.\n const manifestRoot = await fs.realpath(hostRoot);\n const closures = new Map(\n await Promise.all(\n plugins.map(async (plugin) => {\n const entryPath = await fs.realpath(generated.slotEntryPaths[plugin.slot]);\n return [\n plugin.slot,\n manifestClosure(manifest, path.relative(manifestRoot, entryPath).split(path.sep).join('/')),\n ] as const;\n }),\n ),\n );\n\n // One content-hashed Tailwind stylesheet for the shell, fallback template, and all plugins.\n const styles = await writeWebPluginStyleEntries(plugins, generatedDir, hostRoot);\n const stylesRoot = path.dirname(styles.baseEntryPath);\n await build({\n configFile: false,\n envDir: false,\n logLevel: 'warn',\n root: stylesRoot,\n base: './',\n plugins: [tailwindcss()],\n resolve: {\n alias: [{ find: /^\\.\\/webPluginSources\\.generated\\.css$/, replacement: styles.baseSourcesPath }],\n },\n build: {\n cssCodeSplit: true,\n outDir: pluginsDir,\n emptyOutDir: false,\n sourcemap: false,\n assetsInlineLimit: 0,\n manifest: 'styles.manifest.json',\n rollupOptions: {\n input: Object.fromEntries([\n [BASE_STYLE_ENTRY, styles.baseEntryPath],\n ...[...styles.pluginEntryPaths].map(([slot, entry]) => [pluginStyleEntryName(slot), entry]),\n ]),\n output: { assetFileNames: 'assets/[name]-[hash][extname]' },\n },\n },\n });\n const styleManifest = JSON.parse(await fs.readFile(path.join(pluginsDir, 'styles.manifest.json'), 'utf8')) as Record<\n string,\n { file?: string; css?: string[]; assets?: string[] }\n >;\n await fs.rm(path.join(pluginsDir, 'styles.manifest.json'));\n const emitted = (entry: string): { file: string; assets: string[] } => {\n const record = styleManifest[path.relative(stylesRoot, entry).split(path.sep).join('/')];\n const file = record?.file?.endsWith('.css') ? record.file : record?.css?.[0];\n if (file === undefined) throw new Error(`The stylesheet entry '${entry}' emitted no CSS file.`);\n return { file, assets: record?.assets ?? [] };\n };\n const base = emitted(styles.baseEntryPath);\n const slotStyles = new Map(\n plugins.map((plugin) => {\n const entry = styles.pluginEntryPaths.get(plugin.slot);\n return [plugin.slot, entry === undefined ? base : emitted(entry)];\n }),\n );\n const pluginStyles = Object.fromEntries([...slotStyles].map(([slot, style]) => [slot, style.file]));\n await fs.writeFile(path.join(pluginsDir, 'index.html'), '<!doctype html>\\n<title>Po plugin composition</title>\\n');\n\n return {\n assetsDir,\n pluginsDir,\n pluginIds: plugins.map((plugin) => plugin.pluginId),\n plugins: plugins.map((plugin) => {\n const closure = closures.get(plugin.slot);\n const style = slotStyles.get(plugin.slot);\n if (closure === undefined || style === undefined) throw new Error(`The slot '${plugin.slot}' emitted no entry.`);\n return {\n pluginId: plugin.pluginId,\n slot: plugin.slot,\n packageDir: plugin.packageDir,\n isHost: plugin.isHost,\n ...(plugin.brain === undefined ? {} : { brain: plugin.brain }),\n entry: closure.entry,\n // The shared stylesheet and its fonts must be verified for every slot.\n files: [...new Set([...closure.files, style.file, ...style.assets])],\n css: closure.css,\n };\n }),\n pluginStyles,\n baseStyle: base.file,\n };\n}\n"],"mappings":";;;;;;;;;;;;AAuBA,MAAM,mBAAmB;CACvB;CACA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MAAM,eAAe,OAAO,YAAY,CAAC,GAAG,UAAU,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW,CAAC,MAAM,MAAM,IAAI,CAAC,CAAC;CAClG,MAAME,iBAAAA,QAAG,UAAUF,UAAAA,QAAK,KAAK,YAAY,YAAY,GAAG,yDAAyD;CAEjH,OAAO;EACL;EACA;EACA,WAAW,QAAQ,KAAK,WAAW,OAAO,QAAQ;EAClD,SAAS,QAAQ,KAAK,WAAW;GAC/B,MAAM,UAAU,SAAS,IAAI,OAAO,IAAI;GACxC,MAAM,QAAQ,WAAW,IAAI,OAAO,IAAI;GACxC,IAAI,YAAY,KAAA,KAAa,UAAU,KAAA,GAAW,MAAM,IAAI,MAAM,aAAa,OAAO,KAAK,oBAAoB;GAC/G,OAAO;IACL,UAAU,OAAO;IACjB,MAAM,OAAO;IACb,YAAY,OAAO;IACnB,QAAQ,OAAO;IACf,GAAI,OAAO,UAAU,KAAA,IAAY,CAAC,IAAI,EAAE,OAAO,OAAO,MAAM;IAC5D,OAAO,QAAQ;IAEf,OAAO,CAAC,mBAAG,IAAI,IAAI;KAAC,GAAG,QAAQ;KAAO,MAAM;KAAM,GAAG,MAAM;IAAM,CAAC,CAAC;IACnE,KAAK,QAAQ;GACf;EACF,CAAC;EACD;EACA,WAAW,KAAK;CAClB;AACF"}
@@ -109,6 +109,7 @@ async function bundleCockpitWeb(options) {
109
109
  envDir: false,
110
110
  logLevel: "warn",
111
111
  base: "./",
112
+ root: hostRoot,
112
113
  plugins: [
113
114
  webPluginRuntimeFacadePlugin(hostRoot),
114
115
  react(),
@@ -140,7 +141,7 @@ async function bundleCockpitWeb(options) {
140
141
  }
141
142
  });
142
143
  const manifest = JSON.parse(await fs.readFile(path.join(pluginsDir, "manifest.json"), "utf8"));
143
- const manifestRoot = await fs.realpath(process.cwd());
144
+ const manifestRoot = await fs.realpath(hostRoot);
144
145
  const closures = new Map(await Promise.all(plugins.map(async (plugin) => {
145
146
  const entryPath = await fs.realpath(generated.slotEntryPaths[plugin.slot]);
146
147
  return [plugin.slot, manifestClosure(manifest, path.relative(manifestRoot, entryPath).split(path.sep).join("/"))];
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.mjs","names":[],"sources":["../../../../src/builders/web/bundle.ts"],"sourcesContent":["import fs from 'node:fs/promises';\nimport path from 'node:path';\n\nimport { bundleAssetPolicyPlugin } from './bundleAssetPolicy';\nimport { PLUGIN_ROOTS_FILE } from './webDevRoots';\nimport {\n BASE_STYLE_ENTRY,\n pluginStyleEntryName,\n writeSyncWebPluginModules,\n writeWebPluginStyleEntries,\n} from './webPluginGenerate';\nimport type { DeclaredWebPlugin } from './webPluginManifest';\nimport { scanWebPlugins } from './webPluginScan';\nimport {\n isWebPluginFacade,\n WEB_PLUGIN_FACADE_CHUNK,\n webPluginCssAlias,\n webPluginOverridePlugin,\n webPluginRuntimeAliases,\n webPluginRuntimeFacadePlugin,\n} from './webPluginVite';\n\n/** Shared runtime packages every plugin's client code must resolve to the host copies. */\nconst DEDUPED_RUNTIMES = [\n 'react',\n 'react-dom',\n '@tanstack/store',\n '@tanstack/react-store',\n '@tanstack/react-router',\n '@agimon-ai/po-core',\n '@agimon-ai/po-web-dashboard',\n '@agimon-ai/po-web-components',\n // The sealed transport is a module singleton whose nonce counters every\n // plugin shares; a second copy would start counting at zero.\n '@agimon-ai/po-web-security',\n // CodeMirror's state and view are singletons in all but name: a document\n // built against one copy is rejected by an editor from the other, and a\n // grammar chunk resolved separately from the editor is exactly how a second\n // copy appears.\n '@codemirror/state',\n '@codemirror/view',\n];\n\nexport interface BundleCockpitWebOptions {\n hostRoot: string;\n /** Package roots to scan for poWeb manifests, usually the installed composition. */\n pluginRoots: readonly string[];\n /** Output directory; receives web/, plugins/, generated/, and pluginRoots.json. */\n outDir: string;\n onNotice?: (message: string) => void;\n}\n\nexport interface BundleCockpitWebResult {\n /** The cockpit shell with the host's own plugins; every other plugin ships in pluginsDir. */\n assetsDir: string;\n /** Standalone session plugin composition artifacts. */\n pluginsDir: string;\n pluginIds: string[];\n /** Every declared plugin copy with its slot and the files its slot entry reaches. */\n plugins: WebPluginBuildRecord[];\n /** The shared content-hashed Tailwind stylesheet below pluginsDir, keyed by slot. */\n pluginStyles: Record<string, string>;\n /** The same shared stylesheet, also loaded by mounts without plugins. */\n baseStyle: string;\n}\n\n/** One plugin copy in a build: its slot entry and the emitted files that entry can load. */\nexport interface WebPluginBuildRecord {\n pluginId: string;\n slot: string;\n packageDir: string;\n isHost: boolean;\n /** Descriptions from the same package manifest used to build this plugin copy. */\n brain?: DeclaredWebPlugin['brain'];\n /** The slot entry module below pluginsDir. */\n entry: string;\n /** Every file the entry reaches through imports, plus the shared stylesheet and its assets. */\n files: string[];\n /** The stylesheets of the entry's static import closure, which a mount loads up front. */\n css: string[];\n}\n\ninterface ManifestChunk {\n file: string;\n imports?: string[];\n dynamicImports?: string[];\n css?: string[];\n assets?: string[];\n}\n\n/**\n * The files one manifest entry reaches: `files` follows static and dynamic imports and holds\n * every chunk, asset, and stylesheet on the way; `css` follows static imports only.\n */\nexport function manifestClosure(\n manifest: Readonly<Record<string, ManifestChunk>>,\n entryKey: string,\n): { entry: string; files: string[]; css: string[] } {\n const chunkOf = (key: string): ManifestChunk => {\n const chunk = manifest[key];\n if (chunk === undefined) throw new Error(`The composition manifest has no chunk '${key}'.`);\n return chunk;\n };\n const files = new Set<string>();\n const visited = new Set<string>();\n const walk = (key: string): void => {\n if (visited.has(key)) return;\n visited.add(key);\n const chunk = chunkOf(key);\n files.add(chunk.file);\n for (const file of [...(chunk.css ?? []), ...(chunk.assets ?? [])]) files.add(file);\n for (const next of [...(chunk.imports ?? []), ...(chunk.dynamicImports ?? [])]) walk(next);\n };\n walk(entryKey);\n const css = new Set<string>();\n const staticVisited = new Set<string>();\n const walkStatic = (key: string): void => {\n if (staticVisited.has(key)) return;\n staticVisited.add(key);\n const chunk = chunkOf(key);\n for (const file of chunk.css ?? []) css.add(file);\n for (const next of chunk.imports ?? []) walkStatic(next);\n };\n walkStatic(entryKey);\n return { entry: chunkOf(entryKey).file, files: [...files], css: [...css] };\n}\n\n/**\n * Builds the cockpit SPA against the installed plugin set.\n *\n * This is what `po sync` calls: manifests come from the given package\n * roots (no hardcoded plugin dependencies anywhere), the generated entry\n * modules are aliased over the committed builtin registry, and Vite compiles\n * the host shell and, separately, each plugin's shipped web source into one\n * ES-module composition with an entry per slot, so each plugin and its assets ship once.\n * The roots file beside\n * the bundle lets the dev server serve the same composition with hot reload.\n */\nexport async function bundleCockpitWeb(options: BundleCockpitWebOptions): Promise<BundleCockpitWebResult> {\n const notice = options.onNotice ?? ((): void => {});\n const hostRoot = options.hostRoot;\n const plugins = await scanWebPlugins(hostRoot, options.pluginRoots, notice);\n notice(\n `bundling the cockpit with ${String(plugins.length)} web plugin(s): ${plugins.map((p) => p.pluginId).join(', ')}`,\n );\n\n const generatedDir = path.join(options.outDir, 'generated');\n const assetsDir = path.join(options.outDir, 'web');\n const pluginsDir = path.join(options.outDir, 'plugins');\n const generated = await writeSyncWebPluginModules(plugins, generatedDir, hostRoot);\n const roots = [...new Set(options.pluginRoots.map((root) => path.resolve(root)))];\n await fs.writeFile(path.join(options.outDir, PLUGIN_ROOTS_FILE), `${JSON.stringify(roots, null, 2)}\\n`);\n\n // Vite and its plugins are regular dependencies so this works from an\n // installed package, not only the workspace.\n const { build } = await import('vite');\n const { default: react } = await import('@vitejs/plugin-react');\n const { default: tailwindcss } = await import('@tailwindcss/vite');\n\n const clientRoot = path.join(hostRoot, 'src', 'web');\n\n // The shell carries only the host's own plugins; the rest load from the composition below.\n await build({\n configFile: false,\n envDir: false,\n logLevel: 'warn',\n root: clientRoot,\n plugins: [webPluginOverridePlugin(clientRoot, generated.shell), react(), tailwindcss(), bundleAssetPolicyPlugin()],\n resolve: {\n dedupe: [...DEDUPED_RUNTIMES],\n alias: [...webPluginRuntimeAliases(clientRoot), webPluginCssAlias(generated.shell)],\n },\n build: {\n outDir: assetsDir,\n emptyOutDir: true,\n sourcemap: false,\n },\n });\n\n // One ES-module composition: an entry per slot exporting its webPlugin, shared chunks\n // between them, and the shared runtime modules read from the page through facades.\n await build({\n configFile: false,\n envDir: false,\n logLevel: 'warn',\n base: './',\n plugins: [webPluginRuntimeFacadePlugin(hostRoot), react(), tailwindcss()],\n resolve: {\n dedupe: [...DEDUPED_RUNTIMES],\n alias: [webPluginCssAlias(generated)],\n },\n build: {\n cssCodeSplit: true,\n modulePreload: false,\n outDir: pluginsDir,\n emptyOutDir: true,\n sourcemap: false,\n assetsInlineLimit: 0,\n manifest: 'manifest.json',\n rollupOptions: {\n input: generated.slotEntryPaths,\n // Each slot entry is loaded for its webPlugin export, so it must keep it.\n preserveEntrySignatures: 'exports-only',\n output: {\n format: 'es',\n entryFileNames: 'slots/[name]-[hash].js',\n chunkFileNames: 'chunks/[name]-[hash].js',\n assetFileNames: 'assets/[name]-[hash][extname]',\n manualChunks: (id) => (isWebPluginFacade(id) ? WEB_PLUGIN_FACADE_CHUNK : undefined),\n },\n },\n },\n });\n const manifest = JSON.parse(await fs.readFile(path.join(pluginsDir, 'manifest.json'), 'utf8')) as Record<\n string,\n ManifestChunk\n >;\n // Manifest keys are the entry sources relative to the build root, which is the working directory.\n const manifestRoot = await fs.realpath(process.cwd());\n const closures = new Map(\n await Promise.all(\n plugins.map(async (plugin) => {\n const entryPath = await fs.realpath(generated.slotEntryPaths[plugin.slot]);\n return [\n plugin.slot,\n manifestClosure(manifest, path.relative(manifestRoot, entryPath).split(path.sep).join('/')),\n ] as const;\n }),\n ),\n );\n\n // One content-hashed Tailwind stylesheet for the shell, fallback template, and all plugins.\n const styles = await writeWebPluginStyleEntries(plugins, generatedDir, hostRoot);\n const stylesRoot = path.dirname(styles.baseEntryPath);\n await build({\n configFile: false,\n envDir: false,\n logLevel: 'warn',\n root: stylesRoot,\n base: './',\n plugins: [tailwindcss()],\n resolve: {\n alias: [{ find: /^\\.\\/webPluginSources\\.generated\\.css$/, replacement: styles.baseSourcesPath }],\n },\n build: {\n cssCodeSplit: true,\n outDir: pluginsDir,\n emptyOutDir: false,\n sourcemap: false,\n assetsInlineLimit: 0,\n manifest: 'styles.manifest.json',\n rollupOptions: {\n input: Object.fromEntries([\n [BASE_STYLE_ENTRY, styles.baseEntryPath],\n ...[...styles.pluginEntryPaths].map(([slot, entry]) => [pluginStyleEntryName(slot), entry]),\n ]),\n output: { assetFileNames: 'assets/[name]-[hash][extname]' },\n },\n },\n });\n const styleManifest = JSON.parse(await fs.readFile(path.join(pluginsDir, 'styles.manifest.json'), 'utf8')) as Record<\n string,\n { file?: string; css?: string[]; assets?: string[] }\n >;\n await fs.rm(path.join(pluginsDir, 'styles.manifest.json'));\n const emitted = (entry: string): { file: string; assets: string[] } => {\n const record = styleManifest[path.relative(stylesRoot, entry).split(path.sep).join('/')];\n const file = record?.file?.endsWith('.css') ? record.file : record?.css?.[0];\n if (file === undefined) throw new Error(`The stylesheet entry '${entry}' emitted no CSS file.`);\n return { file, assets: record?.assets ?? [] };\n };\n const base = emitted(styles.baseEntryPath);\n const slotStyles = new Map(\n plugins.map((plugin) => {\n const entry = styles.pluginEntryPaths.get(plugin.slot);\n return [plugin.slot, entry === undefined ? base : emitted(entry)];\n }),\n );\n const pluginStyles = Object.fromEntries([...slotStyles].map(([slot, style]) => [slot, style.file]));\n await fs.writeFile(path.join(pluginsDir, 'index.html'), '<!doctype html>\\n<title>Po plugin composition</title>\\n');\n\n return {\n assetsDir,\n pluginsDir,\n pluginIds: plugins.map((plugin) => plugin.pluginId),\n plugins: plugins.map((plugin) => {\n const closure = closures.get(plugin.slot);\n const style = slotStyles.get(plugin.slot);\n if (closure === undefined || style === undefined) throw new Error(`The slot '${plugin.slot}' emitted no entry.`);\n return {\n pluginId: plugin.pluginId,\n slot: plugin.slot,\n packageDir: plugin.packageDir,\n isHost: plugin.isHost,\n ...(plugin.brain === undefined ? {} : { brain: plugin.brain }),\n entry: closure.entry,\n // The shared stylesheet and its fonts must be verified for every slot.\n files: [...new Set([...closure.files, style.file, ...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OAAO;EACL;EACA;EACA,WAAW,QAAQ,KAAK,WAAW,OAAO,QAAQ;EAClD,SAAS,QAAQ,KAAK,WAAW;GAC/B,MAAM,UAAU,SAAS,IAAI,OAAO,IAAI;GACxC,MAAM,QAAQ,WAAW,IAAI,OAAO,IAAI;GACxC,IAAI,YAAY,KAAA,KAAa,UAAU,KAAA,GAAW,MAAM,IAAI,MAAM,aAAa,OAAO,KAAK,oBAAoB;GAC/G,OAAO;IACL,UAAU,OAAO;IACjB,MAAM,OAAO;IACb,YAAY,OAAO;IACnB,QAAQ,OAAO;IACf,GAAI,OAAO,UAAU,KAAA,IAAY,CAAC,IAAI,EAAE,OAAO,OAAO,MAAM;IAC5D,OAAO,QAAQ;IAEf,OAAO,CAAC,mBAAG,IAAI,IAAI;KAAC,GAAG,QAAQ;KAAO,MAAM;KAAM,GAAG,MAAM;IAAM,CAAC,CAAC;IACnE,KAAK,QAAQ;GACf;EACF,CAAC;EACD;EACA,WAAW,KAAK;CAClB;AACF"}
1
+ {"version":3,"file":"bundle.mjs","names":[],"sources":["../../../../src/builders/web/bundle.ts"],"sourcesContent":["import fs from 'node:fs/promises';\nimport path from 'node:path';\n\nimport { bundleAssetPolicyPlugin } from './bundleAssetPolicy';\nimport { PLUGIN_ROOTS_FILE } from './webDevRoots';\nimport {\n BASE_STYLE_ENTRY,\n pluginStyleEntryName,\n writeSyncWebPluginModules,\n writeWebPluginStyleEntries,\n} from './webPluginGenerate';\nimport type { DeclaredWebPlugin } from './webPluginManifest';\nimport { scanWebPlugins } from './webPluginScan';\nimport {\n isWebPluginFacade,\n WEB_PLUGIN_FACADE_CHUNK,\n webPluginCssAlias,\n webPluginOverridePlugin,\n webPluginRuntimeAliases,\n webPluginRuntimeFacadePlugin,\n} from './webPluginVite';\n\n/** Shared runtime packages every plugin's client code must resolve to the host copies. */\nconst DEDUPED_RUNTIMES = [\n 'react',\n 'react-dom',\n '@tanstack/store',\n '@tanstack/react-store',\n '@tanstack/react-router',\n '@agimon-ai/po-core',\n '@agimon-ai/po-web-dashboard',\n '@agimon-ai/po-web-components',\n // The sealed transport is a module singleton whose nonce counters every\n // plugin shares; a second copy would start counting at zero.\n '@agimon-ai/po-web-security',\n // CodeMirror's state and view are singletons in all but name: a document\n // built against one copy is rejected by an editor from the other, and a\n // grammar chunk resolved separately from the editor is exactly how a second\n // copy appears.\n '@codemirror/state',\n '@codemirror/view',\n];\n\nexport interface BundleCockpitWebOptions {\n hostRoot: string;\n /** Package roots to scan for poWeb manifests, usually the installed composition. */\n pluginRoots: readonly string[];\n /** Output directory; receives web/, plugins/, generated/, and pluginRoots.json. */\n outDir: string;\n onNotice?: (message: string) => void;\n}\n\nexport interface BundleCockpitWebResult {\n /** The cockpit shell with the host's own plugins; every other plugin ships in pluginsDir. */\n assetsDir: string;\n /** Standalone session plugin composition artifacts. */\n pluginsDir: string;\n pluginIds: string[];\n /** Every declared plugin copy with its slot and the files its slot entry reaches. */\n plugins: WebPluginBuildRecord[];\n /** The shared content-hashed Tailwind stylesheet below pluginsDir, keyed by slot. */\n pluginStyles: Record<string, string>;\n /** The same shared stylesheet, also loaded by mounts without plugins. */\n baseStyle: string;\n}\n\n/** One plugin copy in a build: its slot entry and the emitted files that entry can load. */\nexport interface WebPluginBuildRecord {\n pluginId: string;\n slot: string;\n packageDir: string;\n isHost: boolean;\n /** Descriptions from the same package manifest used to build this plugin copy. */\n brain?: DeclaredWebPlugin['brain'];\n /** The slot entry module below pluginsDir. */\n entry: string;\n /** Every file the entry reaches through imports, plus the shared stylesheet and its assets. */\n files: string[];\n /** The stylesheets of the entry's static import closure, which a mount loads up front. */\n css: string[];\n}\n\ninterface ManifestChunk {\n file: string;\n imports?: string[];\n dynamicImports?: string[];\n css?: string[];\n assets?: string[];\n}\n\n/**\n * The files one manifest entry reaches: `files` follows static and dynamic imports and holds\n * every chunk, asset, and stylesheet on the way; `css` follows static imports only.\n */\nexport function manifestClosure(\n manifest: Readonly<Record<string, ManifestChunk>>,\n entryKey: string,\n): { entry: string; files: string[]; css: string[] } {\n const chunkOf = (key: string): ManifestChunk => {\n const chunk = manifest[key];\n if (chunk === undefined) throw new Error(`The composition manifest has no chunk '${key}'.`);\n return chunk;\n };\n const files = new Set<string>();\n const visited = new Set<string>();\n const walk = (key: string): void => {\n if (visited.has(key)) return;\n visited.add(key);\n const chunk = chunkOf(key);\n files.add(chunk.file);\n for (const file of [...(chunk.css ?? []), ...(chunk.assets ?? [])]) files.add(file);\n for (const next of [...(chunk.imports ?? []), ...(chunk.dynamicImports ?? [])]) walk(next);\n };\n walk(entryKey);\n const css = new Set<string>();\n const staticVisited = new Set<string>();\n const walkStatic = (key: string): void => {\n if (staticVisited.has(key)) return;\n staticVisited.add(key);\n const chunk = chunkOf(key);\n for (const file of chunk.css ?? []) css.add(file);\n for (const next of chunk.imports ?? []) walkStatic(next);\n };\n walkStatic(entryKey);\n return { entry: chunkOf(entryKey).file, files: [...files], css: [...css] };\n}\n\n/**\n * Builds the cockpit SPA against the installed plugin set.\n *\n * This is what `po sync` calls: manifests come from the given package\n * roots (no hardcoded plugin dependencies anywhere), the generated entry\n * modules are aliased over the committed builtin registry, and Vite compiles\n * the host shell and, separately, each plugin's shipped web source into one\n * ES-module composition with an entry per slot, so each plugin and its assets ship once.\n * The roots file beside\n * the bundle lets the dev server serve the same composition with hot reload.\n */\nexport async function bundleCockpitWeb(options: BundleCockpitWebOptions): Promise<BundleCockpitWebResult> {\n const notice = options.onNotice ?? ((): void => {});\n const hostRoot = options.hostRoot;\n const plugins = await scanWebPlugins(hostRoot, options.pluginRoots, notice);\n notice(\n `bundling the cockpit with ${String(plugins.length)} web plugin(s): ${plugins.map((p) => p.pluginId).join(', ')}`,\n );\n\n const generatedDir = path.join(options.outDir, 'generated');\n const assetsDir = path.join(options.outDir, 'web');\n const pluginsDir = path.join(options.outDir, 'plugins');\n const generated = await writeSyncWebPluginModules(plugins, generatedDir, hostRoot);\n const roots = [...new Set(options.pluginRoots.map((root) => path.resolve(root)))];\n await fs.writeFile(path.join(options.outDir, PLUGIN_ROOTS_FILE), `${JSON.stringify(roots, null, 2)}\\n`);\n\n // Vite and its plugins are regular dependencies so this works from an\n // installed package, not only the workspace.\n const { build } = await import('vite');\n const { default: react } = await import('@vitejs/plugin-react');\n const { default: tailwindcss } = await import('@tailwindcss/vite');\n\n const clientRoot = path.join(hostRoot, 'src', 'web');\n\n // The shell carries only the host's own plugins; the rest load from the composition below.\n await build({\n configFile: false,\n envDir: false,\n logLevel: 'warn',\n root: clientRoot,\n plugins: [webPluginOverridePlugin(clientRoot, generated.shell), react(), tailwindcss(), bundleAssetPolicyPlugin()],\n resolve: {\n dedupe: [...DEDUPED_RUNTIMES],\n alias: [...webPluginRuntimeAliases(clientRoot), webPluginCssAlias(generated.shell)],\n },\n build: {\n outDir: assetsDir,\n emptyOutDir: true,\n sourcemap: false,\n },\n });\n\n // One ES-module composition: an entry per slot exporting its webPlugin, shared chunks\n // between them, and the shared runtime modules read from the page through facades.\n await build({\n configFile: false,\n envDir: false,\n logLevel: 'warn',\n base: './',\n // Deduped runtimes resolve from the build root; the host's copy is the one the page runtime holds,\n // and the one the facades read their export names from. The working directory may not have one.\n root: hostRoot,\n plugins: [webPluginRuntimeFacadePlugin(hostRoot), react(), tailwindcss()],\n resolve: {\n dedupe: [...DEDUPED_RUNTIMES],\n alias: [webPluginCssAlias(generated)],\n },\n build: {\n cssCodeSplit: true,\n modulePreload: false,\n outDir: pluginsDir,\n emptyOutDir: true,\n sourcemap: false,\n assetsInlineLimit: 0,\n manifest: 'manifest.json',\n rollupOptions: {\n input: generated.slotEntryPaths,\n // Each slot entry is loaded for its webPlugin export, so it must keep it.\n preserveEntrySignatures: 'exports-only',\n output: {\n format: 'es',\n entryFileNames: 'slots/[name]-[hash].js',\n chunkFileNames: 'chunks/[name]-[hash].js',\n assetFileNames: 'assets/[name]-[hash][extname]',\n manualChunks: (id) => (isWebPluginFacade(id) ? WEB_PLUGIN_FACADE_CHUNK : undefined),\n },\n },\n },\n });\n const manifest = JSON.parse(await fs.readFile(path.join(pluginsDir, 'manifest.json'), 'utf8')) as Record<\n string,\n ManifestChunk\n >;\n // Manifest keys are the entry sources relative to the build root.\n const manifestRoot = await fs.realpath(hostRoot);\n const closures = new Map(\n await Promise.all(\n plugins.map(async (plugin) => {\n const entryPath = await fs.realpath(generated.slotEntryPaths[plugin.slot]);\n return [\n plugin.slot,\n manifestClosure(manifest, path.relative(manifestRoot, entryPath).split(path.sep).join('/')),\n ] as const;\n }),\n ),\n );\n\n // One content-hashed Tailwind stylesheet for the shell, fallback template, and all plugins.\n const styles = await writeWebPluginStyleEntries(plugins, generatedDir, hostRoot);\n const stylesRoot = path.dirname(styles.baseEntryPath);\n await build({\n configFile: false,\n envDir: false,\n logLevel: 'warn',\n root: stylesRoot,\n base: './',\n plugins: [tailwindcss()],\n resolve: {\n alias: [{ find: /^\\.\\/webPluginSources\\.generated\\.css$/, replacement: styles.baseSourcesPath }],\n },\n build: {\n cssCodeSplit: true,\n outDir: pluginsDir,\n emptyOutDir: false,\n sourcemap: false,\n assetsInlineLimit: 0,\n manifest: 'styles.manifest.json',\n rollupOptions: {\n input: Object.fromEntries([\n [BASE_STYLE_ENTRY, styles.baseEntryPath],\n ...[...styles.pluginEntryPaths].map(([slot, entry]) => [pluginStyleEntryName(slot), entry]),\n ]),\n output: { assetFileNames: 'assets/[name]-[hash][extname]' },\n },\n },\n });\n const styleManifest = JSON.parse(await fs.readFile(path.join(pluginsDir, 'styles.manifest.json'), 'utf8')) as Record<\n string,\n { file?: string; css?: string[]; assets?: string[] }\n >;\n await fs.rm(path.join(pluginsDir, 'styles.manifest.json'));\n const emitted = (entry: string): { file: string; assets: string[] } => {\n const record = styleManifest[path.relative(stylesRoot, entry).split(path.sep).join('/')];\n const file = record?.file?.endsWith('.css') ? record.file : record?.css?.[0];\n if (file === undefined) throw new Error(`The stylesheet entry '${entry}' emitted no CSS file.`);\n return { file, assets: record?.assets ?? [] };\n };\n const base = emitted(styles.baseEntryPath);\n const slotStyles = new Map(\n plugins.map((plugin) => {\n const entry = styles.pluginEntryPaths.get(plugin.slot);\n return [plugin.slot, entry === undefined ? base : emitted(entry)];\n }),\n );\n const pluginStyles = Object.fromEntries([...slotStyles].map(([slot, style]) => [slot, style.file]));\n await fs.writeFile(path.join(pluginsDir, 'index.html'), '<!doctype html>\\n<title>Po plugin composition</title>\\n');\n\n return {\n assetsDir,\n pluginsDir,\n pluginIds: plugins.map((plugin) => plugin.pluginId),\n plugins: plugins.map((plugin) => {\n const closure = closures.get(plugin.slot);\n const style = slotStyles.get(plugin.slot);\n if (closure === undefined || style === undefined) throw new Error(`The slot '${plugin.slot}' emitted no entry.`);\n return {\n pluginId: plugin.pluginId,\n slot: plugin.slot,\n packageDir: plugin.packageDir,\n isHost: plugin.isHost,\n ...(plugin.brain === undefined ? {} : { brain: plugin.brain }),\n entry: closure.entry,\n // The shared stylesheet and its fonts must be verified for every slot.\n files: [...new Set([...closure.files, style.file, ...style.assets])],\n css: closure.css,\n };\n }),\n pluginStyles,\n baseStyle: base.file,\n };\n}\n"],"mappings":";;;;;;;;;AAuBA,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CAKA;CACA;AACF;;;;;AAqDA,SAAgB,gBACd,UACA,UACmD;CACnD,MAAM,WAAW,QAA+B;EAC9C,MAAM,QAAQ,SAAS;EACvB,IAAI,UAAU,KAAA,GAAW,MAAM,IAAI,MAAM,0CAA0C,IAAI,GAAG;EAC1F,OAAO;CACT;CACA,MAAM,wBAAQ,IAAI,IAAY;CAC9B,MAAM,0BAAU,IAAI,IAAY;CAChC,MAAM,QAAQ,QAAsB;EAClC,IAAI,QAAQ,IAAI,GAAG,GAAG;EACtB,QAAQ,IAAI,GAAG;EACf,MAAM,QAAQ,QAAQ,GAAG;EACzB,MAAM,IAAI,MAAM,IAAI;EACpB,KAAK,MAAM,QAAQ,CAAC,GAAI,MAAM,OAAO,CAAC,GAAI,GAAI,MAAM,UAAU,CAAC,C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1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/po",
3
- "version": "0.0.0-alpha.166",
3
+ "version": "0.0.0-alpha.167",
4
4
  "description": "Opinionated, composable agent harness for scoped tools, skills, MCP servers, and developer workflows.",
5
5
  "keywords": [
6
6
  "agent-harness",
@@ -177,28 +177,28 @@
177
177
  "registry": "https://registry.npmjs.org/"
178
178
  },
179
179
  "dependencies": {
180
- "@agimon-ai/po-approval": "0.0.0-alpha.165",
181
- "@agimon-ai/po-artifact": "0.0.0-alpha.164",
182
- "@agimon-ai/po-autostop": "0.0.0-alpha.165",
183
- "@agimon-ai/po-cache": "0.0.0-alpha.165",
184
- "@agimon-ai/po-config": "0.0.0-alpha.165",
185
- "@agimon-ai/po-core": "0.0.0-alpha.165",
186
- "@agimon-ai/po-db": "0.0.0-alpha.165",
187
- "@agimon-ai/po-domain": "0.0.0-alpha.165",
188
- "@agimon-ai/po-logsink": "0.0.1-alpha.147",
189
- "@agimon-ai/po-mcp-proxy": "0.0.1-alpha.144",
190
- "@agimon-ai/po-mode": "0.0.0-alpha.165",
191
- "@agimon-ai/po-native-components": "0.0.0-alpha.165",
192
- "@agimon-ai/po-network": "0.0.2-alpha.112",
193
- "@agimon-ai/po-notification": "0.0.0-alpha.165",
194
- "@agimon-ai/po-preset": "0.0.0-alpha.165",
195
- "@agimon-ai/po-profile": "0.0.0-alpha.165",
196
- "@agimon-ai/po-session": "0.0.0-alpha.165",
197
- "@agimon-ai/po-skill": "0.0.0-alpha.165",
198
- "@agimon-ai/po-ui": "0.0.0-alpha.165",
199
- "@agimon-ai/po-vault": "0.0.0-alpha.165",
200
- "@agimon-ai/po-web-components": "0.0.0-alpha.165",
201
- "@agimon-ai/po-web-security": "0.0.0-alpha.165",
180
+ "@agimon-ai/po-approval": "0.0.0-alpha.166",
181
+ "@agimon-ai/po-artifact": "0.0.0-alpha.165",
182
+ "@agimon-ai/po-autostop": "0.0.0-alpha.166",
183
+ "@agimon-ai/po-cache": "0.0.0-alpha.166",
184
+ "@agimon-ai/po-config": "0.0.0-alpha.166",
185
+ "@agimon-ai/po-core": "0.0.0-alpha.166",
186
+ "@agimon-ai/po-db": "0.0.0-alpha.166",
187
+ "@agimon-ai/po-domain": "0.0.0-alpha.166",
188
+ "@agimon-ai/po-logsink": "0.0.1-alpha.148",
189
+ "@agimon-ai/po-mcp-proxy": "0.0.1-alpha.145",
190
+ "@agimon-ai/po-mode": "0.0.0-alpha.166",
191
+ "@agimon-ai/po-native-components": "0.0.0-alpha.166",
192
+ "@agimon-ai/po-network": "0.0.2-alpha.113",
193
+ "@agimon-ai/po-notification": "0.0.0-alpha.166",
194
+ "@agimon-ai/po-preset": "0.0.0-alpha.166",
195
+ "@agimon-ai/po-profile": "0.0.0-alpha.166",
196
+ "@agimon-ai/po-session": "0.0.0-alpha.166",
197
+ "@agimon-ai/po-skill": "0.0.0-alpha.166",
198
+ "@agimon-ai/po-ui": "0.0.0-alpha.166",
199
+ "@agimon-ai/po-vault": "0.0.0-alpha.166",
200
+ "@agimon-ai/po-web-components": "0.0.0-alpha.166",
201
+ "@agimon-ai/po-web-security": "0.0.0-alpha.166",
202
202
  "@deepseek-ai/cordis": "4.0.5",
203
203
  "@earendil-works/pi-agent-core": "1.5.1",
204
204
  "@earendil-works/pi-coding-agent": "1.5.1",
@@ -220,10 +220,10 @@
220
220
  "yaml": "2.9.1"
221
221
  },
222
222
  "devDependencies": {
223
- "@agimon-ai/po-auth-server": "0.0.2-alpha.7",
224
- "@agimon-ai/po-calendar": "0.0.1-alpha.124",
225
- "@agimon-ai/po-runner": "0.0.0-alpha.165",
226
- "@agimon-ai/vibe-lint-plugin-po-cli": "0.0.0-alpha.165",
223
+ "@agimon-ai/po-auth-server": "0.0.2-alpha.8",
224
+ "@agimon-ai/po-calendar": "0.0.1-alpha.125",
225
+ "@agimon-ai/po-runner": "0.0.0-alpha.166",
226
+ "@agimon-ai/vibe-lint-plugin-po-cli": "0.0.0-alpha.166",
227
227
  "@earendil-works/pi-ai": "1.5.1",
228
228
  "@modelcontextprotocol/ext-apps": "2.0.3",
229
229
  "@modelcontextprotocol/server": "2.3.1",