@agimon-ai/po 0.0.0-alpha.206 → 0.0.0-alpha.208

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.
@@ -25,8 +25,8 @@
25
25
  "packages": [
26
26
  {
27
27
  "name": "@agimon-ai/po-image-gen",
28
- "version": "0.0.0-alpha.204",
29
- "integrity": "sha512-/h1Y+aP73f0OChelU6t2NBGgD35eZZoA6/IfRzv/3qfxRQzL0IvlFoNy8dfu+86EqImI9l+BWhveiBIvPx/NTQ=="
28
+ "version": "0.0.0-alpha.206",
29
+ "integrity": "sha512-I0ve7PfagMM1gYqLMsZO7FyHdVpGYzVaAeN+oSIYZuoSoglJ9xqZfNNciYhpIKj9f84OAiW8ToxAC+cQOp8xuw=="
30
30
  }
31
31
  ],
32
32
  "publisher": "Po",
@@ -41,8 +41,8 @@
41
41
  "packages": [
42
42
  {
43
43
  "name": "@agimon-ai/po-spreadsheet",
44
- "version": "0.0.1-alpha.17",
45
- "integrity": "sha512-8cqf/ZG+cLZDSF9Flf7hNbET6Phq7yZSXP+5/nAldzOZdxlxF9N8yi4jUS7TTHBZltLP6NqFLHyazYE50iZ+Ww=="
44
+ "version": "0.0.1-alpha.19",
45
+ "integrity": "sha512-Wsh0p/tjM5BbmqzjXlcQN9nX079KqIUeeZmSQLMX9EJjTLvOCnqsZNu6X+WHXOjSzCUAx5K3m2wxKXrQ6DD5Tg=="
46
46
  }
47
47
  ],
48
48
  "publisher": "Po",
@@ -57,8 +57,8 @@
57
57
  "packages": [
58
58
  {
59
59
  "name": "@agimon-ai/po-team",
60
- "version": "0.0.0-alpha.205",
61
- "integrity": "sha512-eB4kvTlXxxH5hMULSkg9mSq0YgT41r//H1exZz/87N0NDnYgfoWuphWh++b41P0SjE9Xv2b8O5nhcrz4HQrkcw=="
60
+ "version": "0.0.0-alpha.207",
61
+ "integrity": "sha512-PfHvxcSKyjpQ6qQ6aDzBZQej+ZCpg44vLwwkVxbD/njDehUwvEjsx2u07/iKpK0ZDS2E9nDR2REr5HbtzfllTA=="
62
62
  }
63
63
  ],
64
64
  "publisher": "Po",
@@ -73,8 +73,8 @@
73
73
  "packages": [
74
74
  {
75
75
  "name": "@agimon-ai/po-browse",
76
- "version": "0.0.1-alpha.203",
77
- "integrity": "sha512-MVVKs/GHqmkB6l+HyxLjnwyug2lIXFBluExDFaLiVsuHIOfcXyMddtftdx1eVu5gb+QhbEXoYBMloFb492AToQ=="
76
+ "version": "0.0.1-alpha.205",
77
+ "integrity": "sha512-HlRhd9W4UNTl1+XDaQhb3Nztr4E2hiDpu0ug4Wn5+c9akMs7Z3seSKBSRNaY/LTIfalDoFfIX+IND1927hP/vQ=="
78
78
  }
79
79
  ],
80
80
  "publisher": "Po",
@@ -89,8 +89,8 @@
89
89
  "packages": [
90
90
  {
91
91
  "name": "@agimon-ai/po-ios",
92
- "version": "0.0.1-alpha.140",
93
- "integrity": "sha512-9SjjKto8GAjNoME81/KqMSelQM2Z61mGAn14cGgYIT6JnwReg+rdOjhoPop+MQuKM/FFCcYs8ox41FHafVkr2Q=="
92
+ "version": "0.0.1-alpha.142",
93
+ "integrity": "sha512-2TEunbKJCX6GvYoHw3oe59wgl3pDliG3OaYS4aQR8QZWr5nDdUJiE9F+bymxgFsPoXXnmcqms9BNys/Z5ZGvtA=="
94
94
  }
95
95
  ],
96
96
  "publisher": "Po",
@@ -105,8 +105,8 @@
105
105
  "packages": [
106
106
  {
107
107
  "name": "@agimon-ai/po-git",
108
- "version": "0.0.0-alpha.205",
109
- "integrity": "sha512-cPwrLXYYw6B9YFgKWLG6WSY6GcVrl9dsEaBHQ1wvGzseRfTI1PqqhKeOP5XL6jx2z36CuefCd3zeHuYpqFENpA=="
108
+ "version": "0.0.0-alpha.207",
109
+ "integrity": "sha512-IkWEcGts7VzlieX7kwJ/GiDm9IEilEc0+1v8H/8k7bojK6mDivMDAFI4kHgf3hyn5t+XU012OqOWgl/UiW96/g=="
110
110
  }
111
111
  ],
112
112
  "publisher": "Po",
@@ -121,8 +121,8 @@
121
121
  "packages": [
122
122
  {
123
123
  "name": "@agimon-ai/po-calendar",
124
- "version": "0.0.1-alpha.164",
125
- "integrity": "sha512-t7hB4Ku4qWxPjqJ6lbNbv0L3Y00fJlFU3pCRtE9eVtuEMe3dE/6OaIvXuQPne+Qe7yjPg3UFhXrm/PlPIxvabA=="
124
+ "version": "0.0.1-alpha.166",
125
+ "integrity": "sha512-rOj4t1z48q55o4LrT9+NukFs16tE91J0LRvBXRGaSCiX/aua+TWng2bJVVVpkekP7Ff4wyXYXzHbnZRX2DuZSg=="
126
126
  }
127
127
  ],
128
128
  "publisher": "Po",
@@ -137,23 +137,23 @@
137
137
  "packages": [
138
138
  {
139
139
  "name": "@agimon-ai/po-backdrop-bamboo",
140
- "version": "0.0.0-alpha.65",
141
- "integrity": "sha512-NkI7fWkJCeSyOPt8UDKQjceamarTaExbgOQ29opr2jhsaNeyAi3k2Gsl0cUFbm+LPCEevW6A7vmillk8HuIJYg=="
140
+ "version": "0.0.0-alpha.67",
141
+ "integrity": "sha512-cDf2eMl0OAB2wN2qopsv2EVFaVYw/aUVhDcS7mTrtDV6BRIotwM08PdxCewszuRzSkHnPmQhxqc37CzCmwTotA=="
142
142
  },
143
143
  {
144
144
  "name": "@agimon-ai/po-template-advanced",
145
- "version": "0.0.0-alpha.205",
146
- "integrity": "sha512-nfQEgMAZZ25wNgiM8ZQ9YVk61liSjx6qbvcVMTADvo03jkUqSvpH3cuoNLTGfKyJq3aeQbXqKZPvzmtWk5Dgcw=="
145
+ "version": "0.0.0-alpha.207",
146
+ "integrity": "sha512-GJakQ/lLQilQo9bZYcOfNzFw1Rkucw93gOkBH2eiKBS+0fLnVGvU022a4+yYUUr9zhIO48OYGeANxUv0GHYxsA=="
147
147
  },
148
148
  {
149
149
  "name": "@agimon-ai/po-template-desktop",
150
- "version": "0.0.0-alpha.204",
151
- "integrity": "sha512-99xWxbLLbY83mxkdXVlgNwhTfXgH/0UJsQ0lm9csUZaAQNZTNKeiUYQE2NaFVmJjgVkuHjz4gXOp+L6O12fLyw=="
150
+ "version": "0.0.0-alpha.206",
151
+ "integrity": "sha512-jYcqN1C8/DlSl+lonCGhJQfbac6E9baU/XgNwPyGH8imvpvw6CcBX2TaK4IJSyTUs0CB7tc6q9HZWGAv2qt8Cw=="
152
152
  },
153
153
  {
154
154
  "name": "@agimon-ai/po-template-elegant",
155
- "version": "0.0.0-alpha.205",
156
- "integrity": "sha512-5Qt7ScxAlGkngrmfuDMpZIu7iflMpN8rSFhuZ2kvHi7ThpFePPkUdf4uug4DWXvMDgdQ83KohZA/Ks96XUmJEg=="
155
+ "version": "0.0.0-alpha.207",
156
+ "integrity": "sha512-TOADIVc8VmUQ1BbNjjmLQ3uIBrfKQQ7g0uNVfElwxiCipCG07qZgHhqMEdad5fGdi+nJ1viaBpGS5mMKGuBGRA=="
157
157
  }
158
158
  ],
159
159
  "publisher": "Po",
@@ -168,13 +168,13 @@
168
168
  "packages": [
169
169
  {
170
170
  "name": "@agimon-ai/po-lang-vi",
171
- "version": "0.0.1-alpha.9",
172
- "integrity": "sha512-PhJfQVq3kQfGqtFtKnS8X8y+f3fhfLsUbNBsjPP7l6rbsXGhN30U37WFZD8QOLjq7fljsDR3ypXdzXZ+7kH0SQ=="
171
+ "version": "0.0.1-alpha.11",
172
+ "integrity": "sha512-xBsrNqYoIOI5xBUyb803tDnPbKRy4cWCMbqnCs4/owRykeDUDAfMfKFn/r3XtsYupoLnaVqdjBYrCRGngBHWbg=="
173
173
  },
174
174
  {
175
175
  "name": "@agimon-ai/po-lang-zh",
176
- "version": "0.0.1-alpha.10",
177
- "integrity": "sha512-Vip7I63cm0kI9GN56f30Y+5mray0cgRAFBpSTxJPDXCEL/g/x1e/PJ+gbQl/CLWVDEE7MAac7AlZj8cY9gAWKA=="
176
+ "version": "0.0.1-alpha.12",
177
+ "integrity": "sha512-n8Thh+56LC8N7CB9Ts/RPWXIgh6KOcJHAQ6Pc+hgEmsSzain44i38beQlnjDEmfsp1lvJ30iJT7UkMEtI8TvQg=="
178
178
  }
179
179
  ],
180
180
  "publisher": "Po",
@@ -189,13 +189,13 @@
189
189
  "packages": [
190
190
  {
191
191
  "name": "@agimon-ai/po-gateway",
192
- "version": "0.0.1-alpha.84",
193
- "integrity": "sha512-n5aXwKYDuz1nj+tJ0DujyPOU0rqEijO+kFSCEsNZtCr0cUoR2R6YCGvbigV2Hi1zHViTkXQFMHwP5QZRDXAvmw=="
192
+ "version": "0.0.1-alpha.86",
193
+ "integrity": "sha512-p+KAI6lPbXmxOYWrIbJQzGgKGhwz/TcFdEgjoayC9NN1rmMIGgsXomlNIewSTz9zEvLIJkQW/AMW/zyyA47GUw=="
194
194
  },
195
195
  {
196
196
  "name": "@agimon-ai/po-model-guidance",
197
- "version": "0.0.0-alpha.205",
198
- "integrity": "sha512-6QWOKxnN4oqPV0g9DYzhhwLqcG2ZDDCNQV53OspDiftMOtmJ4ZQ8NUDAQQNnzE5UhofCAUS/lbmtK0GN/n9PqA=="
197
+ "version": "0.0.0-alpha.207",
198
+ "integrity": "sha512-ldWFZKs7qosKZPvfzFi9bjOOgx37bYMYUAyw/wnt8ao5WLMY0WLsIAU/Yh28CYYlVVds2nbWBr0OjOjokT6MDg=="
199
199
  }
200
200
  ],
201
201
  "publisher": "Po",
@@ -210,13 +210,13 @@
210
210
  "packages": [
211
211
  {
212
212
  "name": "@agimon-ai/po-auth-server",
213
- "version": "0.0.2-alpha.47",
214
- "integrity": "sha512-oGHVBPp+dwwCEIjlO7xhIOOLR2pwlmaQKgBadW+kL4e2OYt2W43OJKDJsxRRBNsA9dXskmrX6KmZewKeBTf33g=="
213
+ "version": "0.0.2-alpha.49",
214
+ "integrity": "sha512-zFeaY7f+2f9M7+ThGcq7sBnMhwHeNpgr6ZCAMqj1oxA5MLth80gvVG9xW9zD+/1TVL2c5oETbJxcdh1OZASGrg=="
215
215
  },
216
216
  {
217
217
  "name": "@agimon-ai/po-identity",
218
- "version": "0.0.2-alpha.152",
219
- "integrity": "sha512-9pslaieAGDZmnHtkm6sxlRws1+6xuvTFr0elRQRYv4PNkongnOX40VF+v9eppWm0IaAQ4NB70InC5TCKhujL7Q=="
218
+ "version": "0.0.2-alpha.154",
219
+ "integrity": "sha512-G0Y7EC7RhQmUWv/b3+ijb9Gc8LPcMeAX8n3vGIyq1oFbd3WRxUZRF5FrmRjBboci2ANtZ4xZ/087E3IgXTiYtA=="
220
220
  }
221
221
  ],
222
222
  "publisher": "Po",
@@ -231,8 +231,8 @@
231
231
  "packages": [
232
232
  {
233
233
  "name": "@agimon-ai/po-sandbox",
234
- "version": "0.0.0-alpha.205",
235
- "integrity": "sha512-/sFDMhKGzIQEotGIXt749ZYfB00cSpuco22+HV7KLg5XALmceFkziNP4Xua9+IupaJGjtU7Ja91AG39wtwsexg=="
234
+ "version": "0.0.0-alpha.207",
235
+ "integrity": "sha512-S1hHtYnmiTspN91/1fQ9g7W5uQ4HAIwiZoUwNXQ+m0ti8zlwUPEratgBueEH+BqoIhqNruyxo+Jm9lGH8D0+7A=="
236
236
  }
237
237
  ],
238
238
  "publisher": "Po",
@@ -247,8 +247,8 @@
247
247
  "packages": [
248
248
  {
249
249
  "name": "@agimon-ai/po-style-system",
250
- "version": "0.0.0-alpha.205",
251
- "integrity": "sha512-8Jj9QbzFE/4pgtYVGXsECjAlTDGJVXD+unRDfQbV2suUejsqrO33Y3CdeurwDWUw0aYdUGDEudt3bDY0x0iw+g=="
250
+ "version": "0.0.0-alpha.207",
251
+ "integrity": "sha512-DngCWeq3yjfYlrIcH2odlswxnwWzO0uKeOHtE2Qm3718CLFO32ooHC1o+NfXDCBFqyvB8Jw2fvqBQC9vRRtP1w=="
252
252
  }
253
253
  ],
254
254
  "publisher": "Po",
@@ -263,8 +263,8 @@
263
263
  "packages": [
264
264
  {
265
265
  "name": "@agimon-ai/po-task",
266
- "version": "0.0.0-alpha.205",
267
- "integrity": "sha512-NyB2UH2Me6NDMNT7nNX1l+6duE/VGDNB3QPXYEQoMlpbAuxeiGMKkfoXu4PDeSf4pUAfoda8hpig+2zTjnlMzA=="
266
+ "version": "0.0.0-alpha.207",
267
+ "integrity": "sha512-t7d/5u9tyHGz6qe0HiqUPcxHHWBdqj7S/0pOkZrJBiILmcBDLioxAuq0TexHsxPOFeh76ExXY8FFIUx5Hon7vA=="
268
268
  }
269
269
  ],
270
270
  "publisher": "Po",
@@ -279,8 +279,8 @@
279
279
  "packages": [
280
280
  {
281
281
  "name": "@agimon-ai/po-user-feedback",
282
- "version": "0.0.0-alpha.205",
283
- "integrity": "sha512-jZsq5GBDcxk4F5BHaellpyTZZ9IbBMf4RHfnkTXxGc2lBHnuvTXx7pVnAunzjWNUtid2r75IgW0mffJkasBuBA=="
282
+ "version": "0.0.0-alpha.207",
283
+ "integrity": "sha512-HhsBuHHEFN+P9c3RajEfcKNI8AbR6EUa7mBeOHE2aWJXqu95Q9V/uPk1UtPKsu8nFeBBKWGlMoek55yltSXXfw=="
284
284
  }
285
285
  ],
286
286
  "publisher": "Po",
@@ -295,8 +295,8 @@
295
295
  "packages": [
296
296
  {
297
297
  "name": "@agimon-ai/po-lint",
298
- "version": "0.0.1-alpha.174",
299
- "integrity": "sha512-wying0WXvMgEtMONaJijRApVnAdUfWw5+6D8nBuODmnon7BEqfeLTQpUtYTxn2HouJqzyKaXxDY3v6yBQ9Cs7Q=="
298
+ "version": "0.0.1-alpha.176",
299
+ "integrity": "sha512-NFOhKG29OH6g26pq0BMgC5IrHaVQRX8NurLkXNmW4Bpj+N5iQS92jtKZBAaQ07NJJGmuiPS9WnifR4eyyLzUEA=="
300
300
  }
301
301
  ],
302
302
  "publisher": "Po",
@@ -311,8 +311,8 @@
311
311
  "packages": [
312
312
  {
313
313
  "name": "@agimon-ai/po-web-search",
314
- "version": "0.0.0-alpha.204",
315
- "integrity": "sha512-O8TKamk1EsWC0d1YOmrscc1PuhZMpTPCvczLgBFEXu5LFSLHuiILHZezfqNEO9cGRKC1jjLnAuKRGrfOR3+8dA=="
314
+ "version": "0.0.0-alpha.206",
315
+ "integrity": "sha512-c3YgvI870Nr4LbsnlLDrXk9i1YA9H/9btpK0++ayOCyXNmJImdoPirlwQBkeW7RX5NIUVNhLkM/DKe7Nnty+Ew=="
316
316
  }
317
317
  ],
318
318
  "publisher": "Po",
@@ -327,8 +327,8 @@
327
327
  "packages": [
328
328
  {
329
329
  "name": "@agimon-ai/po-workflow",
330
- "version": "0.0.0-alpha.205",
331
- "integrity": "sha512-JzFZp/PdM7Z+dnDD3qR6GoHc8Y/ZrtF//wE/wSQhUVo0IzSbw8ebXqgbYPbQt8M0FGVeMUXDSoDi8ZKkycAKoA=="
330
+ "version": "0.0.0-alpha.207",
331
+ "integrity": "sha512-WHOesXZgyXX9JdJelvbHitqU+/3Uo6+GLPHgCzP35rHXWPqRnP+pNFUFQAMr1k3819BOTjmLEnFt5fj9ldoiDg=="
332
332
  }
333
333
  ],
334
334
  "publisher": "Po",
@@ -338,7 +338,7 @@
338
338
  },
339
339
  "packages": {
340
340
  "@agimon-ai/po": {
341
- "version": "0.0.0-alpha.206",
341
+ "version": "0.0.0-alpha.208",
342
342
  "dependencies": [
343
343
  "@agimon-ai/po-approval",
344
344
  "@agimon-ai/po-artifact",
@@ -371,18 +371,18 @@
371
371
  ]
372
372
  },
373
373
  "@agimon-ai/po-antigravity-bridge": {
374
- "version": "0.1.1-alpha.184",
374
+ "version": "0.1.1-alpha.186",
375
375
  "dependencies": []
376
376
  },
377
377
  "@agimon-ai/po-approval": {
378
- "version": "0.0.0-alpha.204",
378
+ "version": "0.0.0-alpha.206",
379
379
  "dependencies": [
380
380
  "@agimon-ai/po-core",
381
381
  "@agimon-ai/po-web-components"
382
382
  ]
383
383
  },
384
384
  "@agimon-ai/po-artifact": {
385
- "version": "0.0.0-alpha.204",
385
+ "version": "0.0.0-alpha.206",
386
386
  "dependencies": [
387
387
  "@agimon-ai/po-config",
388
388
  "@agimon-ai/po-core",
@@ -391,14 +391,14 @@
391
391
  ]
392
392
  },
393
393
  "@agimon-ai/po-auth-server": {
394
- "version": "0.0.2-alpha.47",
394
+ "version": "0.0.2-alpha.49",
395
395
  "dependencies": [
396
396
  "@agimon-ai/po-core",
397
397
  "@agimon-ai/po-web-security"
398
398
  ]
399
399
  },
400
400
  "@agimon-ai/po-author": {
401
- "version": "0.0.0-alpha.205",
401
+ "version": "0.0.0-alpha.207",
402
402
  "dependencies": [
403
403
  "@agimon-ai/po-artifact",
404
404
  "@agimon-ai/po-core",
@@ -407,7 +407,7 @@
407
407
  ]
408
408
  },
409
409
  "@agimon-ai/po-autocompact": {
410
- "version": "0.0.0-alpha.205",
410
+ "version": "0.0.0-alpha.207",
411
411
  "dependencies": [
412
412
  "@agimon-ai/po-artifact",
413
413
  "@agimon-ai/po-config",
@@ -416,19 +416,20 @@
416
416
  ]
417
417
  },
418
418
  "@agimon-ai/po-autostop": {
419
- "version": "0.0.0-alpha.205",
419
+ "version": "0.0.0-alpha.207",
420
420
  "dependencies": [
421
421
  "@agimon-ai/po-core"
422
422
  ]
423
423
  },
424
424
  "@agimon-ai/po-backdrop-bamboo": {
425
- "version": "0.0.0-alpha.65",
425
+ "version": "0.0.0-alpha.67",
426
426
  "dependencies": [
427
- "@agimon-ai/po-core"
427
+ "@agimon-ai/po-core",
428
+ "@agimon-ai/po-web-components"
428
429
  ]
429
430
  },
430
431
  "@agimon-ai/po-browse": {
431
- "version": "0.0.1-alpha.203",
432
+ "version": "0.0.1-alpha.205",
432
433
  "dependencies": [
433
434
  "@agimon-ai/po-config",
434
435
  "@agimon-ai/po-core",
@@ -436,11 +437,11 @@
436
437
  ]
437
438
  },
438
439
  "@agimon-ai/po-build": {
439
- "version": "0.0.0-alpha.205",
440
+ "version": "0.0.0-alpha.207",
440
441
  "dependencies": []
441
442
  },
442
443
  "@agimon-ai/po-cache": {
443
- "version": "0.0.0-alpha.205",
444
+ "version": "0.0.0-alpha.207",
444
445
  "dependencies": [
445
446
  "@agimon-ai/po-config",
446
447
  "@agimon-ai/po-core",
@@ -448,7 +449,7 @@
448
449
  ]
449
450
  },
450
451
  "@agimon-ai/po-calendar": {
451
- "version": "0.0.1-alpha.164",
452
+ "version": "0.0.1-alpha.166",
452
453
  "dependencies": [
453
454
  "@agimon-ai/po-config",
454
455
  "@agimon-ai/po-core",
@@ -461,11 +462,11 @@
461
462
  ]
462
463
  },
463
464
  "@agimon-ai/po-claude-bridge": {
464
- "version": "0.1.1-alpha.185",
465
+ "version": "0.1.1-alpha.187",
465
466
  "dependencies": []
466
467
  },
467
468
  "@agimon-ai/po-codemode": {
468
- "version": "0.0.1-alpha.178",
469
+ "version": "0.0.1-alpha.180",
469
470
  "dependencies": [
470
471
  "@agimon-ai/po-config",
471
472
  "@agimon-ai/po-core",
@@ -473,7 +474,7 @@
473
474
  ]
474
475
  },
475
476
  "@agimon-ai/po-computer-use": {
476
- "version": "0.0.0-alpha.205",
477
+ "version": "0.0.0-alpha.207",
477
478
  "dependencies": [
478
479
  "@agimon-ai/po-config",
479
480
  "@agimon-ai/po-core",
@@ -483,30 +484,30 @@
483
484
  ]
484
485
  },
485
486
  "@agimon-ai/po-config": {
486
- "version": "0.0.0-alpha.205",
487
+ "version": "0.0.0-alpha.207",
487
488
  "dependencies": [
488
489
  "@agimon-ai/po-core",
489
490
  "@agimon-ai/po-web-components"
490
491
  ]
491
492
  },
492
493
  "@agimon-ai/po-core": {
493
- "version": "0.0.0-alpha.205",
494
+ "version": "0.0.0-alpha.207",
494
495
  "dependencies": [
495
496
  "@agimon-ai/po-web-security"
496
497
  ]
497
498
  },
498
499
  "@agimon-ai/po-db": {
499
- "version": "0.0.0-alpha.205",
500
+ "version": "0.0.0-alpha.207",
500
501
  "dependencies": [
501
502
  "@agimon-ai/po-core"
502
503
  ]
503
504
  },
504
505
  "@agimon-ai/po-deploy": {
505
- "version": "0.0.2-alpha.34",
506
+ "version": "0.0.2-alpha.36",
506
507
  "dependencies": []
507
508
  },
508
509
  "@agimon-ai/po-domain": {
509
- "version": "0.0.0-alpha.205",
510
+ "version": "0.0.0-alpha.207",
510
511
  "dependencies": [
511
512
  "@agimon-ai/po-config",
512
513
  "@agimon-ai/po-core",
@@ -516,7 +517,7 @@
516
517
  ]
517
518
  },
518
519
  "@agimon-ai/po-edit": {
519
- "version": "0.0.0-alpha.205",
520
+ "version": "0.0.0-alpha.207",
520
521
  "dependencies": [
521
522
  "@agimon-ai/po-core",
522
523
  "@agimon-ai/po-hashline",
@@ -525,14 +526,14 @@
525
526
  ]
526
527
  },
527
528
  "@agimon-ai/po-federation": {
528
- "version": "0.0.0-alpha.205",
529
+ "version": "0.0.0-alpha.207",
529
530
  "dependencies": [
530
531
  "@agimon-ai/po-core",
531
532
  "@agimon-ai/po-web-security"
532
533
  ]
533
534
  },
534
535
  "@agimon-ai/po-file-edit": {
535
- "version": "0.0.0-alpha.205",
536
+ "version": "0.0.0-alpha.207",
536
537
  "dependencies": [
537
538
  "@agimon-ai/po-config",
538
539
  "@agimon-ai/po-core",
@@ -542,13 +543,13 @@
542
543
  ]
543
544
  },
544
545
  "@agimon-ai/po-gateway": {
545
- "version": "0.0.1-alpha.84",
546
+ "version": "0.0.1-alpha.86",
546
547
  "dependencies": [
547
548
  "@agimon-ai/po-core"
548
549
  ]
549
550
  },
550
551
  "@agimon-ai/po-git": {
551
- "version": "0.0.0-alpha.205",
552
+ "version": "0.0.0-alpha.207",
552
553
  "dependencies": [
553
554
  "@agimon-ai/po-core",
554
555
  "@agimon-ai/po-session",
@@ -558,7 +559,7 @@
558
559
  ]
559
560
  },
560
561
  "@agimon-ai/po-goal": {
561
- "version": "0.0.0-alpha.205",
562
+ "version": "0.0.0-alpha.207",
562
563
  "dependencies": [
563
564
  "@agimon-ai/po-core",
564
565
  "@agimon-ai/po-mode",
@@ -567,7 +568,7 @@
567
568
  ]
568
569
  },
569
570
  "@agimon-ai/po-grep": {
570
- "version": "0.0.0-alpha.205",
571
+ "version": "0.0.0-alpha.207",
571
572
  "dependencies": [
572
573
  "@agimon-ai/po-core",
573
574
  "@agimon-ai/po-hashline",
@@ -576,11 +577,11 @@
576
577
  ]
577
578
  },
578
579
  "@agimon-ai/po-hashline": {
579
- "version": "0.0.0-alpha.205",
580
+ "version": "0.0.0-alpha.207",
580
581
  "dependencies": []
581
582
  },
582
583
  "@agimon-ai/po-help": {
583
- "version": "0.0.0-alpha.205",
584
+ "version": "0.0.0-alpha.207",
584
585
  "dependencies": [
585
586
  "@agimon-ai/po-core",
586
587
  "@agimon-ai/po-mode",
@@ -589,14 +590,14 @@
589
590
  ]
590
591
  },
591
592
  "@agimon-ai/po-identity": {
592
- "version": "0.0.2-alpha.152",
593
+ "version": "0.0.2-alpha.154",
593
594
  "dependencies": [
594
595
  "@agimon-ai/po-core",
595
596
  "@agimon-ai/po-web-security"
596
597
  ]
597
598
  },
598
599
  "@agimon-ai/po-image-gen": {
599
- "version": "0.0.0-alpha.204",
600
+ "version": "0.0.0-alpha.206",
600
601
  "dependencies": [
601
602
  "@agimon-ai/po-core",
602
603
  "@agimon-ai/po-web-components",
@@ -604,7 +605,7 @@
604
605
  ]
605
606
  },
606
607
  "@agimon-ai/po-infinite-canvas": {
607
- "version": "0.0.0-alpha.205",
608
+ "version": "0.0.0-alpha.207",
608
609
  "dependencies": [
609
610
  "@agimon-ai/po-artifact",
610
611
  "@agimon-ai/po-author",
@@ -614,7 +615,7 @@
614
615
  ]
615
616
  },
616
617
  "@agimon-ai/po-ios": {
617
- "version": "0.0.1-alpha.140",
618
+ "version": "0.0.1-alpha.142",
618
619
  "dependencies": [
619
620
  "@agimon-ai/po-artifact",
620
621
  "@agimon-ai/po-config",
@@ -624,25 +625,25 @@
624
625
  ]
625
626
  },
626
627
  "@agimon-ai/po-lang": {
627
- "version": "0.0.1-alpha.10",
628
+ "version": "0.0.1-alpha.12",
628
629
  "dependencies": [
629
630
  "@agimon-ai/po-core"
630
631
  ]
631
632
  },
632
633
  "@agimon-ai/po-lang-vi": {
633
- "version": "0.0.1-alpha.9",
634
+ "version": "0.0.1-alpha.11",
634
635
  "dependencies": [
635
636
  "@agimon-ai/po-core"
636
637
  ]
637
638
  },
638
639
  "@agimon-ai/po-lang-zh": {
639
- "version": "0.0.1-alpha.10",
640
+ "version": "0.0.1-alpha.12",
640
641
  "dependencies": [
641
642
  "@agimon-ai/po-core"
642
643
  ]
643
644
  },
644
645
  "@agimon-ai/po-lint": {
645
- "version": "0.0.1-alpha.174",
646
+ "version": "0.0.1-alpha.176",
646
647
  "dependencies": [
647
648
  "@agimon-ai/po-config",
648
649
  "@agimon-ai/po-core",
@@ -652,7 +653,7 @@
652
653
  ]
653
654
  },
654
655
  "@agimon-ai/po-log": {
655
- "version": "0.0.0-alpha.205",
656
+ "version": "0.0.0-alpha.207",
656
657
  "dependencies": [
657
658
  "@agimon-ai/po-core",
658
659
  "@agimon-ai/po-web-components",
@@ -660,7 +661,7 @@
660
661
  ]
661
662
  },
662
663
  "@agimon-ai/po-mcp": {
663
- "version": "0.0.0-alpha.205",
664
+ "version": "0.0.0-alpha.207",
664
665
  "dependencies": [
665
666
  "@agimon-ai/po-config",
666
667
  "@agimon-ai/po-core",
@@ -671,30 +672,30 @@
671
672
  ]
672
673
  },
673
674
  "@agimon-ai/po-mcp-proxy": {
674
- "version": "0.0.1-alpha.184",
675
+ "version": "0.0.1-alpha.186",
675
676
  "dependencies": []
676
677
  },
677
678
  "@agimon-ai/po-mode": {
678
- "version": "0.0.0-alpha.205",
679
+ "version": "0.0.0-alpha.207",
679
680
  "dependencies": [
680
681
  "@agimon-ai/po-core"
681
682
  ]
682
683
  },
683
684
  "@agimon-ai/po-model-guidance": {
684
- "version": "0.0.0-alpha.205",
685
+ "version": "0.0.0-alpha.207",
685
686
  "dependencies": [
686
687
  "@agimon-ai/po-config",
687
688
  "@agimon-ai/po-core"
688
689
  ]
689
690
  },
690
691
  "@agimon-ai/po-native-components": {
691
- "version": "0.0.0-alpha.205",
692
+ "version": "0.0.0-alpha.207",
692
693
  "dependencies": [
693
694
  "@agimon-ai/po-web-components"
694
695
  ]
695
696
  },
696
697
  "@agimon-ai/po-native-dashboard": {
697
- "version": "0.0.0-alpha.77",
698
+ "version": "0.0.0-alpha.79",
698
699
  "dependencies": [
699
700
  "@agimon-ai/po-core",
700
701
  "@agimon-ai/po-native-components",
@@ -702,14 +703,14 @@
702
703
  ]
703
704
  },
704
705
  "@agimon-ai/po-network": {
705
- "version": "0.0.2-alpha.152",
706
+ "version": "0.0.2-alpha.154",
706
707
  "dependencies": [
707
708
  "@agimon-ai/po-core",
708
709
  "@agimon-ai/po-web-security"
709
710
  ]
710
711
  },
711
712
  "@agimon-ai/po-notification": {
712
- "version": "0.0.0-alpha.205",
713
+ "version": "0.0.0-alpha.207",
713
714
  "dependencies": [
714
715
  "@agimon-ai/po-autostop",
715
716
  "@agimon-ai/po-config",
@@ -717,7 +718,7 @@
717
718
  ]
718
719
  },
719
720
  "@agimon-ai/po-plan": {
720
- "version": "0.0.0-alpha.205",
721
+ "version": "0.0.0-alpha.207",
721
722
  "dependencies": [
722
723
  "@agimon-ai/po-config",
723
724
  "@agimon-ai/po-core",
@@ -727,14 +728,14 @@
727
728
  ]
728
729
  },
729
730
  "@agimon-ai/po-preset": {
730
- "version": "0.0.0-alpha.205",
731
+ "version": "0.0.0-alpha.207",
731
732
  "dependencies": [
732
733
  "@agimon-ai/po-config",
733
734
  "@agimon-ai/po-core"
734
735
  ]
735
736
  },
736
737
  "@agimon-ai/po-profile": {
737
- "version": "0.0.0-alpha.205",
738
+ "version": "0.0.0-alpha.207",
738
739
  "dependencies": [
739
740
  "@agimon-ai/po-config",
740
741
  "@agimon-ai/po-core",
@@ -744,7 +745,7 @@
744
745
  ]
745
746
  },
746
747
  "@agimon-ai/po-prompt": {
747
- "version": "0.0.0-alpha.205",
748
+ "version": "0.0.0-alpha.207",
748
749
  "dependencies": [
749
750
  "@agimon-ai/po-core",
750
751
  "@agimon-ai/po-web-components",
@@ -752,7 +753,7 @@
752
753
  ]
753
754
  },
754
755
  "@agimon-ai/po-read": {
755
- "version": "0.0.0-alpha.205",
756
+ "version": "0.0.0-alpha.207",
756
757
  "dependencies": [
757
758
  "@agimon-ai/po-config",
758
759
  "@agimon-ai/po-core",
@@ -762,7 +763,7 @@
762
763
  ]
763
764
  },
764
765
  "@agimon-ai/po-remote": {
765
- "version": "0.0.0-alpha.205",
766
+ "version": "0.0.0-alpha.207",
766
767
  "dependencies": [
767
768
  "@agimon-ai/po-core",
768
769
  "@agimon-ai/po-federation",
@@ -771,7 +772,7 @@
771
772
  ]
772
773
  },
773
774
  "@agimon-ai/po-runner": {
774
- "version": "0.0.0-alpha.205",
775
+ "version": "0.0.0-alpha.207",
775
776
  "dependencies": [
776
777
  "@agimon-ai/po-core",
777
778
  "@agimon-ai/po-ui",
@@ -780,13 +781,13 @@
780
781
  ]
781
782
  },
782
783
  "@agimon-ai/po-sandbox": {
783
- "version": "0.0.0-alpha.205",
784
+ "version": "0.0.0-alpha.207",
784
785
  "dependencies": [
785
786
  "@agimon-ai/po-core"
786
787
  ]
787
788
  },
788
789
  "@agimon-ai/po-scaffold": {
789
- "version": "0.0.0-alpha.205",
790
+ "version": "0.0.0-alpha.207",
790
791
  "dependencies": [
791
792
  "@agimon-ai/po-core",
792
793
  "@agimon-ai/po-web-components",
@@ -794,7 +795,7 @@
794
795
  ]
795
796
  },
796
797
  "@agimon-ai/po-session": {
797
- "version": "0.0.0-alpha.205",
798
+ "version": "0.0.0-alpha.207",
798
799
  "dependencies": [
799
800
  "@agimon-ai/po-approval",
800
801
  "@agimon-ai/po-config",
@@ -804,7 +805,7 @@
804
805
  ]
805
806
  },
806
807
  "@agimon-ai/po-session-mcp": {
807
- "version": "0.0.0-alpha.205",
808
+ "version": "0.0.0-alpha.207",
808
809
  "dependencies": [
809
810
  "@agimon-ai/po-core",
810
811
  "@agimon-ai/po-web-components",
@@ -812,7 +813,7 @@
812
813
  ]
813
814
  },
814
815
  "@agimon-ai/po-skill": {
815
- "version": "0.0.0-alpha.205",
816
+ "version": "0.0.0-alpha.207",
816
817
  "dependencies": [
817
818
  "@agimon-ai/po-config",
818
819
  "@agimon-ai/po-core",
@@ -821,7 +822,7 @@
821
822
  ]
822
823
  },
823
824
  "@agimon-ai/po-space": {
824
- "version": "0.0.1-alpha.48",
825
+ "version": "0.0.1-alpha.50",
825
826
  "dependencies": [
826
827
  "@agimon-ai/po-artifact",
827
828
  "@agimon-ai/po-core",
@@ -830,11 +831,11 @@
830
831
  ]
831
832
  },
832
833
  "@agimon-ai/po-sparo": {
833
- "version": "0.0.2-alpha.8",
834
+ "version": "0.0.2-alpha.10",
834
835
  "dependencies": []
835
836
  },
836
837
  "@agimon-ai/po-spreadsheet": {
837
- "version": "0.0.1-alpha.17",
838
+ "version": "0.0.1-alpha.19",
838
839
  "dependencies": [
839
840
  "@agimon-ai/po-artifact",
840
841
  "@agimon-ai/po-author",
@@ -844,7 +845,7 @@
844
845
  ]
845
846
  },
846
847
  "@agimon-ai/po-style-system": {
847
- "version": "0.0.0-alpha.205",
848
+ "version": "0.0.0-alpha.207",
848
849
  "dependencies": [
849
850
  "@agimon-ai/po-author",
850
851
  "@agimon-ai/po-core",
@@ -853,7 +854,7 @@
853
854
  ]
854
855
  },
855
856
  "@agimon-ai/po-task": {
856
- "version": "0.0.0-alpha.205",
857
+ "version": "0.0.0-alpha.207",
857
858
  "dependencies": [
858
859
  "@agimon-ai/po-core",
859
860
  "@agimon-ai/po-ui",
@@ -862,7 +863,7 @@
862
863
  ]
863
864
  },
864
865
  "@agimon-ai/po-team": {
865
- "version": "0.0.0-alpha.205",
866
+ "version": "0.0.0-alpha.207",
866
867
  "dependencies": [
867
868
  "@agimon-ai/po-cache",
868
869
  "@agimon-ai/po-config",
@@ -874,7 +875,7 @@
874
875
  ]
875
876
  },
876
877
  "@agimon-ai/po-template-advanced": {
877
- "version": "0.0.0-alpha.205",
878
+ "version": "0.0.0-alpha.207",
878
879
  "dependencies": [
879
880
  "@agimon-ai/po-core",
880
881
  "@agimon-ai/po-web-components",
@@ -882,7 +883,7 @@
882
883
  ]
883
884
  },
884
885
  "@agimon-ai/po-template-desktop": {
885
- "version": "0.0.0-alpha.204",
886
+ "version": "0.0.0-alpha.206",
886
887
  "dependencies": [
887
888
  "@agimon-ai/po-core",
888
889
  "@agimon-ai/po-web-components",
@@ -890,7 +891,7 @@
890
891
  ]
891
892
  },
892
893
  "@agimon-ai/po-template-elegant": {
893
- "version": "0.0.0-alpha.205",
894
+ "version": "0.0.0-alpha.207",
894
895
  "dependencies": [
895
896
  "@agimon-ai/po-core",
896
897
  "@agimon-ai/po-web-components",
@@ -898,7 +899,7 @@
898
899
  ]
899
900
  },
900
901
  "@agimon-ai/po-ui": {
901
- "version": "0.0.0-alpha.205",
902
+ "version": "0.0.0-alpha.207",
902
903
  "dependencies": [
903
904
  "@agimon-ai/po-core",
904
905
  "@agimon-ai/po-hashline",
@@ -907,7 +908,7 @@
907
908
  ]
908
909
  },
909
910
  "@agimon-ai/po-user-feedback": {
910
- "version": "0.0.0-alpha.205",
911
+ "version": "0.0.0-alpha.207",
911
912
  "dependencies": [
912
913
  "@agimon-ai/po-core",
913
914
  "@agimon-ai/po-mode",
@@ -916,7 +917,7 @@
916
917
  ]
917
918
  },
918
919
  "@agimon-ai/po-vault": {
919
- "version": "0.0.0-alpha.205",
920
+ "version": "0.0.0-alpha.207",
920
921
  "dependencies": [
921
922
  "@agimon-ai/po-core",
922
923
  "@agimon-ai/po-db",
@@ -925,7 +926,7 @@
925
926
  ]
926
927
  },
927
928
  "@agimon-ai/po-voice": {
928
- "version": "0.0.0-alpha.205",
929
+ "version": "0.0.0-alpha.207",
929
930
  "dependencies": [
930
931
  "@agimon-ai/po-config",
931
932
  "@agimon-ai/po-core",
@@ -938,7 +939,7 @@
938
939
  ]
939
940
  },
940
941
  "@agimon-ai/po-wake": {
941
- "version": "0.0.1-alpha.17",
942
+ "version": "0.0.1-alpha.19",
942
943
  "dependencies": [
943
944
  "@agimon-ai/po-core",
944
945
  "@agimon-ai/po-db",
@@ -946,11 +947,11 @@
946
947
  ]
947
948
  },
948
949
  "@agimon-ai/po-web-components": {
949
- "version": "0.0.0-alpha.205",
950
+ "version": "0.0.0-alpha.207",
950
951
  "dependencies": []
951
952
  },
952
953
  "@agimon-ai/po-web-dashboard": {
953
- "version": "0.0.0-alpha.205",
954
+ "version": "0.0.0-alpha.207",
954
955
  "dependencies": [
955
956
  "@agimon-ai/po-core",
956
957
  "@agimon-ai/po-web-components",
@@ -958,18 +959,18 @@
958
959
  ]
959
960
  },
960
961
  "@agimon-ai/po-web-search": {
961
- "version": "0.0.0-alpha.204",
962
+ "version": "0.0.0-alpha.206",
962
963
  "dependencies": [
963
964
  "@agimon-ai/po-core",
964
965
  "@agimon-ai/po-web-components"
965
966
  ]
966
967
  },
967
968
  "@agimon-ai/po-web-security": {
968
- "version": "0.0.0-alpha.205",
969
+ "version": "0.0.0-alpha.207",
969
970
  "dependencies": []
970
971
  },
971
972
  "@agimon-ai/po-workflow": {
972
- "version": "0.0.0-alpha.205",
973
+ "version": "0.0.0-alpha.207",
973
974
  "dependencies": [
974
975
  "@agimon-ai/po-approval",
975
976
  "@agimon-ai/po-config",
package/dist/package.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.0.0-alpha.206";
2
+ var version = "0.0.0-alpha.208";
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.206";
2
+ var version = "0.0.0-alpha.208";
3
3
  //#endregion
4
4
  export { version };
5
5
 
@@ -62,10 +62,26 @@ async function loadedBuild(key, file, files) {
62
62
  if (loadedBuilds.size > 4 && oldest !== void 0) loadedBuilds.delete(oldest);
63
63
  return build;
64
64
  }
65
+ /**
66
+ * Keys by candidate list. The bundler hands every session of a root the same list until a sync or watched change
67
+ * invalidates it, so sessions opening together hash the widget packages once instead of once each.
68
+ */
69
+ const keysByCandidates = /* @__PURE__ */ new WeakMap();
70
+ function sharedMcpAppKey(candidates, files) {
71
+ let key = keysByCandidates.get(candidates);
72
+ if (key === void 0) {
73
+ key = mcpAppKey(candidates, void 0, files);
74
+ keysByCandidates.set(candidates, key);
75
+ key.catch(() => {
76
+ if (keysByCandidates.get(candidates) === key) keysByCandidates.delete(candidates);
77
+ });
78
+ }
79
+ return key;
80
+ }
65
81
  /** Reads sync's build without building. A missing HTML file returns only its expected key. */
66
82
  async function readMcpAppBuild(input) {
67
83
  const files = input.files ?? (0, _agimon_ai_po_core_nodePlatform.createNodePlatform)().env(input.poHome);
68
- const key = await mcpAppKey(input.candidates, void 0, files);
84
+ const key = await sharedMcpAppKey(input.candidates, files);
69
85
  if (key === void 0) return void 0;
70
86
  try {
71
87
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"mcpAppBuild.cjs","names":["getOrThrow","BACKGROUND_CONTEXT","path","createNodePlatform","crypto","statSignature","snapshotFiles","mcpAppInputs","pathExists","bundleMcpApp"],"sources":["../../../../src/builders/server/mcpAppBuild.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport path from 'node:path';\n\nimport { createNodePlatform } from '@agimon-ai/po-core/nodePlatform';\nimport { BACKGROUND_CONTEXT, type FileSystem, getOrThrow, pathExists } from '@agimon-ai/po-core/platform';\n\nimport { bundleMcpApp, mcpAppInputs, type McpAppSource } from './mcpApp';\nimport type { McpPluginCandidate } from './mcpBundle';\nimport { snapshotFiles, statSignature } from './packageUrl';\n\nexport interface McpAppBuild {\n readonly key: string;\n readonly file: string;\n readonly html: string;\n readonly sha256: string;\n}\n\nexport interface McpAppBuildInput {\n readonly files?: FileSystem;\n readonly poHome: string;\n readonly candidates: readonly McpPluginCandidate[];\n /** Test seam; defaults to `bundleMcpApp`. */\n readonly bundle?: typeof bundleMcpApp;\n}\n\nasync function widgetSources(candidates: readonly McpPluginCandidate[], files: FileSystem): Promise<McpAppSource[]> {\n const sources: McpAppSource[] = [];\n for (const { declaration } of candidates) {\n if (!declaration.ui || declaration.ui.widgets.length === 0) continue;\n const root = getOrThrow(await files.canonicalPath(declaration.packageDir, BACKGROUND_CONTEXT));\n const file = getOrThrow(await files.canonicalPath(path.resolve(root, declaration.ui.dist), BACKGROUND_CONTEXT));\n const relative = path.relative(root, file);\n if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative))\n throw new Error(`MCP UI entry escapes package: ${declaration.packageName}`);\n sources.push({ file, widgets: declaration.ui.widgets });\n }\n return sources;\n}\n\n/** Content key over every widget package's files, so any source change moves it. */\nexport async function mcpAppKey(\n candidates: readonly McpPluginCandidate[],\n inputs?: readonly string[],\n files: FileSystem = createNodePlatform().env(process.cwd()),\n): Promise<string | undefined> {\n const hash = crypto.createHash('sha256');\n let any = false;\n for (const { declaration } of candidates) {\n if (!declaration.ui || declaration.ui.widgets.length === 0) continue;\n any = true;\n const root = getOrThrow(await files.canonicalPath(declaration.packageDir, BACKGROUND_CONTEXT));\n const entry = path.resolve(root, declaration.ui.dist);\n hash.update(`${declaration.packageName}\\0${root}\\0${declaration.ui.widgets.join(',')}\\0`);\n hash.update(await statSignature(root, await snapshotFiles(root, entry, files), files));\n hash.update('\\n');\n }\n if (!any) return undefined;\n for (const file of [...(inputs ?? (await mcpAppInputs())), import.meta.filename].sort()) {\n hash.update(`${file}\\0`);\n hash.update(\n crypto\n .createHash('sha256')\n .update(getOrThrow(await files.readBinaryFile(file, BACKGROUND_CONTEXT)))\n .digest(),\n );\n }\n return hash.digest('hex').slice(0, 32);\n}\n\nfunction mcpAppFile(poHome: string, key: string): string {\n return path.join(poHome, 'build', 'mcp-app', key, 'index.html');\n}\n\n// A published build never changes, so every session shares one copy of its HTML (about 1.7 MB).\n// Rebuilds publish new keys, so only the most recent few stay cached.\nconst loadedBuilds = new Map<string, McpAppBuild>();\n\nasync function loadedBuild(key: string, file: string, files: FileSystem): Promise<McpAppBuild> {\n const cached = loadedBuilds.get(file);\n if (cached !== undefined) return cached;\n const html = getOrThrow(await files.readTextFile(file, BACKGROUND_CONTEXT));\n const build = { key, file, html, sha256: crypto.createHash('sha256').update(html).digest('hex') };\n loadedBuilds.set(file, build);\n const [oldest] = loadedBuilds.keys();\n if (loadedBuilds.size > 4 && oldest !== undefined) loadedBuilds.delete(oldest);\n return build;\n}\n\n/** Reads sync's build without building. A missing HTML file returns only its expected key. */\nexport async function readMcpAppBuild(\n input: Pick<McpAppBuildInput, 'poHome' | 'candidates' | 'files'>,\n): Promise<{ key: string; build?: McpAppBuild } | undefined> {\n const files = input.files ?? createNodePlatform().env(input.poHome);\n const key = await mcpAppKey(input.candidates, undefined, files);\n if (key === undefined) return undefined;\n try {\n return { key, build: await loadedBuild(key, mcpAppFile(input.poHome, key), files) };\n } catch (error) {\n if (error instanceof Error && 'code' in error && error.code === 'not_found') return { key };\n throw error;\n }\n}\n\n/** Builds into a temporary sibling and atomically publishes the immutable HTML. */\nexport async function ensureMcpAppBuild(input: McpAppBuildInput): Promise<McpAppBuild | undefined> {\n const files = input.files ?? createNodePlatform().env(input.poHome);\n const key = await mcpAppKey(input.candidates, undefined, files);\n if (key === undefined) return undefined;\n const file = mcpAppFile(input.poHome, key);\n const directory = path.dirname(file);\n const parent = path.dirname(directory);\n if (!(await pathExists(files, file, BACKGROUND_CONTEXT))) {\n getOrThrow(await files.createDir(parent, { recursive: true }, BACKGROUND_CONTEXT));\n const temporary = path.join(parent, `.${key}-${crypto.randomUUID()}`);\n getOrThrow(await files.createDir(temporary, undefined, BACKGROUND_CONTEXT));\n try {\n const built = await (input.bundle ?? bundleMcpApp)(await widgetSources(input.candidates, files), temporary);\n if (built === undefined) return undefined;\n getOrThrow(\n await files.writeFile(\n path.join(temporary, 'index.html'),\n getOrThrow(await files.readBinaryFile(path.join(temporary, built.file), BACKGROUND_CONTEXT)),\n BACKGROUND_CONTEXT,\n ),\n );\n try {\n getOrThrow(await files.renameFile(temporary, directory, BACKGROUND_CONTEXT));\n } catch (error) {\n // A concurrent build of the same key already published it.\n if (!(await pathExists(files, file, BACKGROUND_CONTEXT))) throw error;\n }\n } finally {\n getOrThrow(await files.remove(temporary, { recursive: true, force: true }, BACKGROUND_CONTEXT));\n }\n }\n return loadedBuild(key, file, files);\n}\n"],"mappings":";;;;;;;;;;AAyBA,eAAe,cAAc,YAA2C,OAA4C;CAClH,MAAM,UAA0B,CAAC;CACjC,KAAK,MAAM,EAAE,iBAAiB,YAAY;EACxC,IAAI,CAAC,YAAY,MAAM,YAAY,GAAG,QAAQ,WAAW,GAAG;EAC5D,MAAM,QAAA,GAAOA,4BAAAA,WAAAA,CAAW,MAAM,MAAM,cAAc,YAAY,YAAYC,4BAAAA,kBAAkB,CAAC;EAC7F,MAAM,QAAA,GAAOD,4BAAAA,WAAAA,CAAW,MAAM,MAAM,cAAcE,UAAAA,QAAK,QAAQ,MAAM,YAAY,GAAG,IAAI,GAAGD,4BAAAA,kBAAkB,CAAC;EAC9G,MAAM,WAAWC,UAAAA,QAAK,SAAS,MAAM,IAAI;EACzC,IAAI,aAAa,QAAQ,SAAS,WAAW,KAAKA,UAAAA,QAAK,KAAK,KAAKA,UAAAA,QAAK,WAAW,QAAQ,GACvF,MAAM,IAAI,MAAM,iCAAiC,YAAY,aAAa;EAC5E,QAAQ,KAAK;GAAE;GAAM,SAAS,YAAY,GAAG;EAAQ,CAAC;CACxD;CACA,OAAO;AACT;;AAGA,eAAsB,UACpB,YACA,QACA,SAAA,GAAoBC,gCAAAA,mBAAAA,CAAmB,CAAC,CAAC,IAAI,QAAQ,IAAI,CAAC,GAC7B;CAC7B,MAAM,OAAOC,YAAAA,QAAO,WAAW,QAAQ;CACvC,IAAI,MAAM;CACV,KAAK,MAAM,EAAE,iBAAiB,YAAY;EACxC,IAAI,CAAC,YAAY,MAAM,YAAY,GAAG,QAAQ,WAAW,GAAG;EAC5D,MAAM;EACN,MAAM,QAAA,GAAOJ,4BAAAA,WAAAA,CAAW,MAAM,MAAM,cAAc,YAAY,YAAYC,4BAAAA,kBAAkB,CAAC;EAC7F,MAAM,QAAQC,UAAAA,QAAK,Q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H,4BAAAA,kBAAkB,CAAC;EAC1E,IAAI;GACF,MAAM,QAAQ,OAAO,MAAM,UAAUQ,eAAAA,aAAAA,CAAc,MAAM,cAAc,MAAM,YAAY,KAAK,GAAG,SAAS;GAC1G,IAAI,UAAU,KAAA,GAAW,OAAO,KAAA;GAChC,CAAA,GAAA,4BAAA,WAAA,CACE,MAAM,MAAM,UACVP,UAAAA,QAAK,KAAK,WAAW,YAAY,IAAA,GACjCF,4BAAAA,WAAAA,CAAW,MAAM,MAAM,eAAeE,UAAAA,QAAK,KAAK,WAAW,MAAM,IAAI,GAAGD,4BAAAA,kBAAkB,CAAC,GAC3FA,4BAAAA,kBACF,CACF;GACA,IAAI;IACF,CAAA,GAAA,4BAAA,WAAA,CAAW,MAAM,MAAM,WAAW,WAAW,WAAWA,4BAAAA,kBAAkB,CAAC;GAC7E,SAAS,OAAO;IAEd,IAAI,CAAE,OAAA,GAAMO,4BAAAA,WAAAA,CAAW,OAAO,MAAMP,4BAAAA,kBAAkB,GAAI,MAAM;GAClE;EACF,UAAU;GACR,CAAA,GAAA,4BAAA,WAAA,CAAW,MAAM,MAAM,OAAO,WAAW;IAAE,WAAW;IAAM,OAAO;GAAK,GAAGA,4BAAAA,kBAAkB,CAAC;EAChG;CACF;CACA,OAAO,YAAY,KAAK,MAAM,KAAK;AACrC"}
1
+ {"version":3,"file":"mcpAppBuild.cjs","names":["getOrThrow","BACKGROUND_CONTEXT","path","createNodePlatform","crypto","statSignature","snapshotFiles","mcpAppInputs","pathExists","bundleMcpApp"],"sources":["../../../../src/builders/server/mcpAppBuild.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport path from 'node:path';\n\nimport { createNodePlatform } from '@agimon-ai/po-core/nodePlatform';\nimport { BACKGROUND_CONTEXT, type FileSystem, getOrThrow, pathExists } from '@agimon-ai/po-core/platform';\n\nimport { bundleMcpApp, mcpAppInputs, type McpAppSource } from './mcpApp';\nimport type { McpPluginCandidate } from './mcpBundle';\nimport { snapshotFiles, statSignature } from './packageUrl';\n\nexport interface McpAppBuild {\n readonly key: string;\n readonly file: string;\n readonly html: string;\n readonly sha256: string;\n}\n\nexport interface McpAppBuildInput {\n readonly files?: FileSystem;\n readonly poHome: string;\n readonly candidates: readonly McpPluginCandidate[];\n /** Test seam; defaults to `bundleMcpApp`. */\n readonly bundle?: typeof bundleMcpApp;\n}\n\nasync function widgetSources(candidates: readonly McpPluginCandidate[], files: FileSystem): Promise<McpAppSource[]> {\n const sources: McpAppSource[] = [];\n for (const { declaration } of candidates) {\n if (!declaration.ui || declaration.ui.widgets.length === 0) continue;\n const root = getOrThrow(await files.canonicalPath(declaration.packageDir, BACKGROUND_CONTEXT));\n const file = getOrThrow(await files.canonicalPath(path.resolve(root, declaration.ui.dist), BACKGROUND_CONTEXT));\n const relative = path.relative(root, file);\n if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative))\n throw new Error(`MCP UI entry escapes package: ${declaration.packageName}`);\n sources.push({ file, widgets: declaration.ui.widgets });\n }\n return sources;\n}\n\n/** Content key over every widget package's files, so any source change moves it. */\nexport async function mcpAppKey(\n candidates: readonly McpPluginCandidate[],\n inputs?: readonly string[],\n files: FileSystem = createNodePlatform().env(process.cwd()),\n): Promise<string | undefined> {\n const hash = crypto.createHash('sha256');\n let any = false;\n for (const { declaration } of candidates) {\n if (!declaration.ui || declaration.ui.widgets.length === 0) continue;\n any = true;\n const root = getOrThrow(await files.canonicalPath(declaration.packageDir, BACKGROUND_CONTEXT));\n const entry = path.resolve(root, declaration.ui.dist);\n hash.update(`${declaration.packageName}\\0${root}\\0${declaration.ui.widgets.join(',')}\\0`);\n hash.update(await statSignature(root, await snapshotFiles(root, entry, files), files));\n hash.update('\\n');\n }\n if (!any) return undefined;\n for (const file of [...(inputs ?? (await mcpAppInputs())), import.meta.filename].sort()) {\n hash.update(`${file}\\0`);\n hash.update(\n crypto\n .createHash('sha256')\n .update(getOrThrow(await files.readBinaryFile(file, BACKGROUND_CONTEXT)))\n .digest(),\n );\n }\n return hash.digest('hex').slice(0, 32);\n}\n\nfunction mcpAppFile(poHome: string, key: string): string {\n return path.join(poHome, 'build', 'mcp-app', key, 'index.html');\n}\n\n// A published build never changes, so every session shares one copy of its HTML (about 1.7 MB).\n// Rebuilds publish new keys, so only the most recent few stay cached.\nconst loadedBuilds = new Map<string, McpAppBuild>();\n\nasync function loadedBuild(key: string, file: string, files: FileSystem): Promise<McpAppBuild> {\n const cached = loadedBuilds.get(file);\n if (cached !== undefined) return cached;\n const html = getOrThrow(await files.readTextFile(file, BACKGROUND_CONTEXT));\n const build = { key, file, html, sha256: crypto.createHash('sha256').update(html).digest('hex') };\n loadedBuilds.set(file, build);\n const [oldest] = loadedBuilds.keys();\n if (loadedBuilds.size > 4 && oldest !== undefined) loadedBuilds.delete(oldest);\n return build;\n}\n\n/**\n * Keys by candidate list. The bundler hands every session of a root the same list until a sync or watched change\n * invalidates it, so sessions opening together hash the widget packages once instead of once each.\n */\nconst keysByCandidates = new WeakMap<readonly McpPluginCandidate[], Promise<string | undefined>>();\n\nfunction sharedMcpAppKey(candidates: readonly McpPluginCandidate[], files: FileSystem): Promise<string | undefined> {\n let key = keysByCandidates.get(candidates);\n if (key === undefined) {\n key = mcpAppKey(candidates, undefined, files);\n keysByCandidates.set(candidates, key);\n // A failed read is retried by the next session rather than remembered.\n key.catch(() => {\n if (keysByCandidates.get(candidates) === key) keysByCandidates.delete(candidates);\n });\n }\n return key;\n}\n\n/** Reads sync's build without building. A missing HTML file returns only its expected key. */\nexport async function readMcpAppBuild(\n input: Pick<McpAppBuildInput, 'poHome' | 'candidates' | 'files'>,\n): Promise<{ key: string; build?: McpAppBuild } | undefined> {\n const files = input.files ?? createNodePlatform().env(input.poHome);\n const key = await sharedMcpAppKey(input.candidates, files);\n if (key === undefined) return undefined;\n try {\n return { key, build: await loadedBuild(key, mcpAppFile(input.poHome, key), files) };\n } catch (error) {\n if (error instanceof Error && 'code' in error && error.code === 'not_found') return { key };\n throw error;\n }\n}\n\n/** Builds into a temporary sibling and atomically publishes the immutable HTML. */\nexport async function ensureMcpAppBuild(input: McpAppBuildInput): Promise<McpAppBuild | undefined> {\n const files = input.files ?? createNodePlatform().env(input.poHome);\n const key = await mcpAppKey(input.candidates, undefined, files);\n if (key === undefined) return undefined;\n const file = mcpAppFile(input.poHome, key);\n const directory = path.dirname(file);\n const parent = path.dirname(directory);\n if (!(await pathExists(files, file, BACKGROUND_CONTEXT))) {\n getOrThrow(await files.createDir(parent, { recursive: true }, BACKGROUND_CONTEXT));\n const temporary = path.join(parent, `.${key}-${crypto.randomUUID()}`);\n getOrThrow(await files.createDir(temporary, undefined, BACKGROUND_CONTEXT));\n try {\n const built = await (input.bundle ?? bundleMcpApp)(await widgetSources(input.candidates, files), temporary);\n if (built === undefined) return undefined;\n getOrThrow(\n await files.writeFile(\n path.join(temporary, 'index.html'),\n getOrThrow(await files.readBinaryFile(path.join(temporary, built.file), BACKGROUND_CONTEXT)),\n BACKGROUND_CONTEXT,\n ),\n );\n try {\n getOrThrow(await files.renameFile(temporary, directory, BACKGROUND_CONTEXT));\n } catch (error) {\n // A concurrent build of the same key already published it.\n if (!(await pathExists(files, file, BACKGROUND_CONTEXT))) throw error;\n }\n } finally {\n getOrThrow(await files.remove(temporary, { recursive: true, force: true }, BACKGROUND_CONTEXT));\n }\n }\n return loadedBuild(key, file, files);\n}\n"],"mappings":";;;;;;;;;;AAyBA,eAAe,cAAc,YAA2C,OAA4C;CAClH,MAAM,UAA0B,CAAC;CACjC,KAAK,MAAM,EAAE,iBAAiB,YAAY;EACxC,IAAI,CAAC,YAAY,MAAM,YAAY,GAAG,QAAQ,WAAW,GAAG;EAC5D,MAAM,QAAA,GAAOA,4BAAAA,WAAAA,CAAW,MAAM,MAAM,cAAc,YAAY,YAAYC,4BAAAA,kBAAkB,CAAC;EAC7F,MAAM,QAAA,GAAOD,4BAAAA,WAAAA,CAAW,MAAM,MAAM,cAAcE,UAAAA,QAAK,QAAQ,MAAM,YAAY,GAAG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GAAW,OAAO,KAAA;GAChC,CAAA,GAAA,4BAAA,WAAA,CACE,MAAM,MAAM,UACVP,UAAAA,QAAK,KAAK,WAAW,YAAY,IAAA,GACjCF,4BAAAA,WAAAA,CAAW,MAAM,MAAM,eAAeE,UAAAA,QAAK,KAAK,WAAW,MAAM,IAAI,GAAGD,4BAAAA,kBAAkB,CAAC,GAC3FA,4BAAAA,kBACF,CACF;GACA,IAAI;IACF,CAAA,GAAA,4BAAA,WAAA,CAAW,MAAM,MAAM,WAAW,WAAW,WAAWA,4BAAAA,kBAAkB,CAAC;GAC7E,SAAS,OAAO;IAEd,IAAI,CAAE,OAAA,GAAMO,4BAAAA,WAAAA,CAAW,OAAO,MAAMP,4BAAAA,kBAAkB,GAAI,MAAM;GAClE;EACF,UAAU;GACR,CAAA,GAAA,4BAAA,WAAA,CAAW,MAAM,MAAM,OAAO,WAAW;IAAE,WAAW;IAAM,OAAO;GAAK,GAAGA,4BAAAA,kBAAkB,CAAC;EAChG;CACF;CACA,OAAO,YAAY,KAAK,MAAM,KAAK;AACrC"}
@@ -1 +1 @@
1
- {"version":3,"file":"mcpAppBuild.d.mts","names":[],"sources":["../../../../src/builders/server/mcpAppBuild.ts"],"mappings":";;;;iBAUiB;WACN;WACA;WACA;WACA;;iBAGM;WACN,QAAQ;WACR;WACA,qBAAqB;;WAErB,gBAAgB;;;wBAkFL,kBAAkB,OAAO,mBAAmB,QAAQ"}
1
+ {"version":3,"file":"mcpAppBuild.d.mts","names":[],"sources":["../../../../src/builders/server/mcpAppBuild.ts"],"mappings":";;;;iBAUiB;WACN;WACA;WACA;WACA;;iBAGM;WACN,QAAQ;WACR;WACA,qBAAqB;;WAErB,gBAAgB;;;wBAqGL,kBAAkB,OAAO,mBAAmB,QAAQ"}
@@ -59,10 +59,26 @@ async function loadedBuild(key, file, files) {
59
59
  if (loadedBuilds.size > 4 && oldest !== void 0) loadedBuilds.delete(oldest);
60
60
  return build;
61
61
  }
62
+ /**
63
+ * Keys by candidate list. The bundler hands every session of a root the same list until a sync or watched change
64
+ * invalidates it, so sessions opening together hash the widget packages once instead of once each.
65
+ */
66
+ const keysByCandidates = /* @__PURE__ */ new WeakMap();
67
+ function sharedMcpAppKey(candidates, files) {
68
+ let key = keysByCandidates.get(candidates);
69
+ if (key === void 0) {
70
+ key = mcpAppKey(candidates, void 0, files);
71
+ keysByCandidates.set(candidates, key);
72
+ key.catch(() => {
73
+ if (keysByCandidates.get(candidates) === key) keysByCandidates.delete(candidates);
74
+ });
75
+ }
76
+ return key;
77
+ }
62
78
  /** Reads sync's build without building. A missing HTML file returns only its expected key. */
63
79
  async function readMcpAppBuild(input) {
64
80
  const files = input.files ?? createNodePlatform().env(input.poHome);
65
- const key = await mcpAppKey(input.candidates, void 0, files);
81
+ const key = await sharedMcpAppKey(input.candidates, files);
66
82
  if (key === void 0) return void 0;
67
83
  try {
68
84
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"mcpAppBuild.mjs","names":[],"sources":["../../../../src/builders/server/mcpAppBuild.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport path from 'node:path';\n\nimport { createNodePlatform } from '@agimon-ai/po-core/nodePlatform';\nimport { BACKGROUND_CONTEXT, type FileSystem, getOrThrow, pathExists } from '@agimon-ai/po-core/platform';\n\nimport { bundleMcpApp, mcpAppInputs, type McpAppSource } from './mcpApp';\nimport type { McpPluginCandidate } from './mcpBundle';\nimport { snapshotFiles, statSignature } from './packageUrl';\n\nexport interface McpAppBuild {\n readonly key: string;\n readonly file: string;\n readonly html: string;\n readonly sha256: string;\n}\n\nexport interface McpAppBuildInput {\n readonly files?: FileSystem;\n readonly poHome: string;\n readonly candidates: readonly McpPluginCandidate[];\n /** Test seam; defaults to `bundleMcpApp`. */\n readonly bundle?: typeof bundleMcpApp;\n}\n\nasync function widgetSources(candidates: readonly McpPluginCandidate[], files: FileSystem): Promise<McpAppSource[]> {\n const sources: McpAppSource[] = [];\n for (const { declaration } of candidates) {\n if (!declaration.ui || declaration.ui.widgets.length === 0) continue;\n const root = getOrThrow(await files.canonicalPath(declaration.packageDir, BACKGROUND_CONTEXT));\n const file = getOrThrow(await files.canonicalPath(path.resolve(root, declaration.ui.dist), BACKGROUND_CONTEXT));\n const relative = path.relative(root, file);\n if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative))\n throw new Error(`MCP UI entry escapes package: ${declaration.packageName}`);\n sources.push({ file, widgets: declaration.ui.widgets });\n }\n return sources;\n}\n\n/** Content key over every widget package's files, so any source change moves it. */\nexport async function mcpAppKey(\n candidates: readonly McpPluginCandidate[],\n inputs?: readonly string[],\n files: FileSystem = createNodePlatform().env(process.cwd()),\n): Promise<string | undefined> {\n const hash = crypto.createHash('sha256');\n let any = false;\n for (const { declaration } of candidates) {\n if (!declaration.ui || declaration.ui.widgets.length === 0) continue;\n any = true;\n const root = getOrThrow(await files.canonicalPath(declaration.packageDir, BACKGROUND_CONTEXT));\n const entry = path.resolve(root, declaration.ui.dist);\n hash.update(`${declaration.packageName}\\0${root}\\0${declaration.ui.widgets.join(',')}\\0`);\n hash.update(await statSignature(root, await snapshotFiles(root, entry, files), files));\n hash.update('\\n');\n }\n if (!any) return undefined;\n for (const file of [...(inputs ?? (await mcpAppInputs())), import.meta.filename].sort()) {\n hash.update(`${file}\\0`);\n hash.update(\n crypto\n .createHash('sha256')\n .update(getOrThrow(await files.readBinaryFile(file, BACKGROUND_CONTEXT)))\n .digest(),\n );\n }\n return hash.digest('hex').slice(0, 32);\n}\n\nfunction mcpAppFile(poHome: string, key: string): string {\n return path.join(poHome, 'build', 'mcp-app', key, 'index.html');\n}\n\n// A published build never changes, so every session shares one copy of its HTML (about 1.7 MB).\n// Rebuilds publish new keys, so only the most recent few stay cached.\nconst loadedBuilds = new Map<string, McpAppBuild>();\n\nasync function loadedBuild(key: string, file: string, files: FileSystem): Promise<McpAppBuild> {\n const cached = loadedBuilds.get(file);\n if (cached !== undefined) return cached;\n const html = getOrThrow(await files.readTextFile(file, BACKGROUND_CONTEXT));\n const build = { key, file, html, sha256: crypto.createHash('sha256').update(html).digest('hex') };\n loadedBuilds.set(file, build);\n const [oldest] = loadedBuilds.keys();\n if (loadedBuilds.size > 4 && oldest !== undefined) loadedBuilds.delete(oldest);\n return build;\n}\n\n/** Reads sync's build without building. A missing HTML file returns only its expected key. */\nexport async function readMcpAppBuild(\n input: Pick<McpAppBuildInput, 'poHome' | 'candidates' | 'files'>,\n): Promise<{ key: string; build?: McpAppBuild } | undefined> {\n const files = input.files ?? createNodePlatform().env(input.poHome);\n const key = await mcpAppKey(input.candidates, undefined, files);\n if (key === undefined) return undefined;\n try {\n return { key, build: await loadedBuild(key, mcpAppFile(input.poHome, key), files) };\n } catch (error) {\n if (error instanceof Error && 'code' in error && error.code === 'not_found') return { key };\n throw error;\n }\n}\n\n/** Builds into a temporary sibling and atomically publishes the immutable HTML. */\nexport async function ensureMcpAppBuild(input: McpAppBuildInput): Promise<McpAppBuild | undefined> {\n const files = input.files ?? createNodePlatform().env(input.poHome);\n const key = await mcpAppKey(input.candidates, undefined, files);\n if (key === undefined) return undefined;\n const file = mcpAppFile(input.poHome, key);\n const directory = path.dirname(file);\n const parent = path.dirname(directory);\n if (!(await pathExists(files, file, BACKGROUND_CONTEXT))) {\n getOrThrow(await files.createDir(parent, { recursive: true }, BACKGROUND_CONTEXT));\n const temporary = path.join(parent, `.${key}-${crypto.randomUUID()}`);\n getOrThrow(await files.createDir(temporary, undefined, BACKGROUND_CONTEXT));\n try {\n const built = await (input.bundle ?? bundleMcpApp)(await widgetSources(input.candidates, files), temporary);\n if (built === undefined) return undefined;\n getOrThrow(\n await files.writeFile(\n path.join(temporary, 'index.html'),\n getOrThrow(await files.readBinaryFile(path.join(temporary, built.file), BACKGROUND_CONTEXT)),\n BACKGROUND_CONTEXT,\n ),\n );\n try {\n getOrThrow(await files.renameFile(temporary, directory, BACKGROUND_CONTEXT));\n } catch (error) {\n // A concurrent build of the same key already published it.\n if (!(await pathExists(files, file, BACKGROUND_CONTEXT))) throw error;\n }\n } finally {\n getOrThrow(await files.remove(temporary, { recursive: true, force: true }, BACKGROUND_CONTEXT));\n }\n }\n return loadedBuild(key, file, files);\n}\n"],"mappings":";;;;;;;AAyBA,eAAe,cAAc,YAA2C,OAA4C;CAClH,MAAM,UAA0B,CAAC;CACjC,KAAK,MAAM,EAAE,iBAAiB,YAAY;EACxC,IAAI,CAAC,YAAY,MAAM,YAAY,GAAG,QAAQ,WAAW,GAAG;EAC5D,MAAM,OAAO,WAAW,MAAM,MAAM,cAAc,YAAY,YAAY,kBAAkB,CAAC;EAC7F,MAAM,OAAO,WAAW,MAAM,MAAM,cAAc,KAAK,QAAQ,MAAM,YAAY,GAAG,IAAI,GAAG,kBAAkB,CAAC;EAC9G,MAAM,WAAW,KAAK,SAAS,MAAM,IAAI;EACzC,IAAI,aAAa,QAAQ,SAAS,WAAW,KAAK,KAAK,KAAK,KAAK,KAAK,WAAW,QAAQ,GACvF,MAAM,IAAI,MAAM,iCAAiC,YAAY,aAAa;EAC5E,QAAQ,KAAK;GAAE;GAAM,SAAS,YAAY,GAAG;EAAQ,CAAC;CACxD;CACA,OAAO;AACT;;AAGA,eAAsB,UACpB,YACA,QACA,QAAoB,mBAAmB,CAAC,CAAC,IAAI,QAAQ,IAAI,CAAC,GAC7B;CAC7B,MAAM,OAAO,OAAO,WAAW,QAAQ;CACvC,IAAI,MAAM;CACV,KAAK,MAAM,EAAE,iBAAiB,YAAY;EACxC,IAAI,CAAC,YAAY,MAAM,YAAY,GAAG,QAAQ,WAAW,GAAG;EAC5D,MAAM;EACN,MAAM,OAAO,WAAW,MAAM,MAAM,cAAc,YAAY,YAAY,kBAAkB,CAAC;EAC7F,MAAM,QAAQ,KAAK,QAAQ,MAAM,YAAY,GAAG,IAAI;EACpD,KAAK,OAAO,GAAG,YAAY,YAAY,IAAI,KAAK,IAAI,YAAY,GAAG,QAAQ,KAAK,GAAG,EAAE,GAAG;EACxF,KAAK,OAAO,MAAM,cAAc,MAAM,MAAM,cA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I,MAAM;GAClE;EACF,UAAU;GACR,WAAW,MAAM,MAAM,OAAO,WAAW;IAAE,WAAW;IAAM,OAAO;GAAK,GAAG,kBAAkB,CAAC;EAChG;CACF;CACA,OAAO,YAAY,KAAK,MAAM,KAAK;AACrC"}
1
+ {"version":3,"file":"mcpAppBuild.mjs","names":[],"sources":["../../../../src/builders/server/mcpAppBuild.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport path from 'node:path';\n\nimport { createNodePlatform } from '@agimon-ai/po-core/nodePlatform';\nimport { BACKGROUND_CONTEXT, type FileSystem, getOrThrow, pathExists } from '@agimon-ai/po-core/platform';\n\nimport { bundleMcpApp, mcpAppInputs, type McpAppSource } from './mcpApp';\nimport type { McpPluginCandidate } from './mcpBundle';\nimport { snapshotFiles, statSignature } from './packageUrl';\n\nexport interface McpAppBuild {\n readonly key: string;\n readonly file: string;\n readonly html: string;\n readonly sha256: string;\n}\n\nexport interface McpAppBuildInput {\n readonly files?: FileSystem;\n readonly poHome: string;\n readonly candidates: readonly McpPluginCandidate[];\n /** Test seam; defaults to `bundleMcpApp`. */\n readonly bundle?: typeof bundleMcpApp;\n}\n\nasync function widgetSources(candidates: readonly McpPluginCandidate[], files: FileSystem): Promise<McpAppSource[]> {\n const sources: McpAppSource[] = [];\n for (const { declaration } of candidates) {\n if (!declaration.ui || declaration.ui.widgets.length === 0) continue;\n const root = getOrThrow(await files.canonicalPath(declaration.packageDir, BACKGROUND_CONTEXT));\n const file = getOrThrow(await files.canonicalPath(path.resolve(root, declaration.ui.dist), BACKGROUND_CONTEXT));\n const relative = path.relative(root, file);\n if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative))\n throw new Error(`MCP UI entry escapes package: ${declaration.packageName}`);\n sources.push({ file, widgets: declaration.ui.widgets });\n }\n return sources;\n}\n\n/** Content key over every widget package's files, so any source change moves it. */\nexport async function mcpAppKey(\n candidates: readonly McpPluginCandidate[],\n inputs?: readonly string[],\n files: FileSystem = createNodePlatform().env(process.cwd()),\n): Promise<string | undefined> {\n const hash = crypto.createHash('sha256');\n let any = false;\n for (const { declaration } of candidates) {\n if (!declaration.ui || declaration.ui.widgets.length === 0) continue;\n any = true;\n const root = getOrThrow(await files.canonicalPath(declaration.packageDir, BACKGROUND_CONTEXT));\n const entry = path.resolve(root, declaration.ui.dist);\n hash.update(`${declaration.packageName}\\0${root}\\0${declaration.ui.widgets.join(',')}\\0`);\n hash.update(await statSignature(root, await snapshotFiles(root, entry, files), files));\n hash.update('\\n');\n }\n if (!any) return undefined;\n for (const file of [...(inputs ?? (await mcpAppInputs())), import.meta.filename].sort()) {\n hash.update(`${file}\\0`);\n hash.update(\n crypto\n .createHash('sha256')\n .update(getOrThrow(await files.readBinaryFile(file, BACKGROUND_CONTEXT)))\n .digest(),\n );\n }\n return hash.digest('hex').slice(0, 32);\n}\n\nfunction mcpAppFile(poHome: string, key: string): string {\n return path.join(poHome, 'build', 'mcp-app', key, 'index.html');\n}\n\n// A published build never changes, so every session shares one copy of its HTML (about 1.7 MB).\n// Rebuilds publish new keys, so only the most recent few stay cached.\nconst loadedBuilds = new Map<string, McpAppBuild>();\n\nasync function loadedBuild(key: string, file: string, files: FileSystem): Promise<McpAppBuild> {\n const cached = loadedBuilds.get(file);\n if (cached !== undefined) return cached;\n const html = getOrThrow(await files.readTextFile(file, BACKGROUND_CONTEXT));\n const build = { key, file, html, sha256: crypto.createHash('sha256').update(html).digest('hex') };\n loadedBuilds.set(file, build);\n const [oldest] = loadedBuilds.keys();\n if (loadedBuilds.size > 4 && oldest !== undefined) loadedBuilds.delete(oldest);\n return build;\n}\n\n/**\n * Keys by candidate list. The bundler hands every session of a root the same list until a sync or watched change\n * invalidates it, so sessions opening together hash the widget packages once instead of once each.\n */\nconst keysByCandidates = new WeakMap<readonly McpPluginCandidate[], Promise<string | undefined>>();\n\nfunction sharedMcpAppKey(candidates: readonly McpPluginCandidate[], files: FileSystem): Promise<string | undefined> {\n let key = keysByCandidates.get(candidates);\n if (key === undefined) {\n key = mcpAppKey(candidates, undefined, files);\n keysByCandidates.set(candidates, key);\n // A failed read is retried by the next session rather than remembered.\n key.catch(() => {\n if (keysByCandidates.get(candidates) === key) keysByCandidates.delete(candidates);\n });\n }\n return key;\n}\n\n/** Reads sync's build without building. A missing HTML file returns only its expected key. */\nexport async function readMcpAppBuild(\n input: Pick<McpAppBuildInput, 'poHome' | 'candidates' | 'files'>,\n): Promise<{ key: string; build?: McpAppBuild } | undefined> {\n const files = input.files ?? createNodePlatform().env(input.poHome);\n const key = await sharedMcpAppKey(input.candidates, files);\n if (key === undefined) return undefined;\n try {\n return { key, build: await loadedBuild(key, mcpAppFile(input.poHome, key), files) };\n } catch (error) {\n if (error instanceof Error && 'code' in error && error.code === 'not_found') return { key };\n throw error;\n }\n}\n\n/** Builds into a temporary sibling and atomically publishes the immutable HTML. */\nexport async function ensureMcpAppBuild(input: McpAppBuildInput): Promise<McpAppBuild | undefined> {\n const files = input.files ?? createNodePlatform().env(input.poHome);\n const key = await mcpAppKey(input.candidates, undefined, files);\n if (key === undefined) return undefined;\n const file = mcpAppFile(input.poHome, key);\n const directory = path.dirname(file);\n const parent = path.dirname(directory);\n if (!(await pathExists(files, file, BACKGROUND_CONTEXT))) {\n getOrThrow(await files.createDir(parent, { recursive: true }, BACKGROUND_CONTEXT));\n const temporary = path.join(parent, `.${key}-${crypto.randomUUID()}`);\n getOrThrow(await files.createDir(temporary, undefined, BACKGROUND_CONTEXT));\n try {\n const built = await (input.bundle ?? bundleMcpApp)(await widgetSources(input.candidates, files), temporary);\n if (built === undefined) return undefined;\n getOrThrow(\n await files.writeFile(\n path.join(temporary, 'index.html'),\n getOrThrow(await files.readBinaryFile(path.join(temporary, built.file), BACKGROUND_CONTEXT)),\n BACKGROUND_CONTEXT,\n ),\n );\n try {\n getOrThrow(await files.renameFile(temporary, directory, BACKGROUND_CONTEXT));\n } catch (error) {\n // A concurrent build of the same key already published it.\n if (!(await pathExists(files, file, BACKGROUND_CONTEXT))) throw error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AAU,KAAA,GAAW,OAAO,KAAA;GAChC,WACE,MAAM,MAAM,UACV,KAAK,KAAK,WAAW,YAAY,GACjC,WAAW,MAAM,MAAM,eAAe,KAAK,KAAK,WAAW,MAAM,IAAI,GAAG,kBAAkB,CAAC,GAC3F,kBACF,CACF;GACA,IAAI;IACF,WAAW,MAAM,MAAM,WAAW,WAAW,WAAW,kBAAkB,CAAC;GAC7E,SAAS,OAAO;IAEd,IAAI,CAAE,MAAM,WAAW,OAAO,MAAM,kBAAkB,GAAI,MAAM;GAClE;EACF,UAAU;GACR,WAAW,MAAM,MAAM,OAAO,WAAW;IAAE,WAAW;IAAM,OAAO;GAAK,GAAG,kBAAkB,CAAC;EAChG;CACF;CACA,OAAO,YAAY,KAAK,MAAM,KAAK;AACrC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/po",
3
- "version": "0.0.0-alpha.206",
3
+ "version": "0.0.0-alpha.208",
4
4
  "description": "Opinionated, composable agent harness for scoped tools, skills, MCP servers, and developer workflows.",
5
5
  "keywords": [
6
6
  "agent-harness",
@@ -177,35 +177,35 @@
177
177
  "registry": "https://registry.npmjs.org/"
178
178
  },
179
179
  "dependencies": {
180
- "@agimon-ai/po-approval": "0.0.0-alpha.204",
181
- "@agimon-ai/po-artifact": "0.0.0-alpha.204",
182
- "@agimon-ai/po-author": "0.0.0-alpha.205",
183
- "@agimon-ai/po-autostop": "0.0.0-alpha.205",
184
- "@agimon-ai/po-cache": "0.0.0-alpha.205",
185
- "@agimon-ai/po-config": "0.0.0-alpha.205",
186
- "@agimon-ai/po-core": "0.0.0-alpha.205",
187
- "@agimon-ai/po-db": "0.0.0-alpha.205",
188
- "@agimon-ai/po-domain": "0.0.0-alpha.205",
189
- "@agimon-ai/po-federation": "0.0.0-alpha.205",
190
- "@agimon-ai/po-infinite-canvas": "0.0.0-alpha.205",
191
- "@agimon-ai/po-lang": "0.0.1-alpha.10",
192
- "@agimon-ai/po-logsink": "0.0.1-alpha.187",
193
- "@agimon-ai/po-mcp-proxy": "0.0.1-alpha.184",
194
- "@agimon-ai/po-mode": "0.0.0-alpha.205",
195
- "@agimon-ai/po-native-components": "0.0.0-alpha.205",
196
- "@agimon-ai/po-network": "0.0.2-alpha.152",
197
- "@agimon-ai/po-notification": "0.0.0-alpha.205",
198
- "@agimon-ai/po-preset": "0.0.0-alpha.205",
199
- "@agimon-ai/po-profile": "0.0.0-alpha.205",
200
- "@agimon-ai/po-remote": "0.0.0-alpha.205",
201
- "@agimon-ai/po-session": "0.0.0-alpha.205",
202
- "@agimon-ai/po-session-mcp": "0.0.0-alpha.205",
203
- "@agimon-ai/po-skill": "0.0.0-alpha.205",
204
- "@agimon-ai/po-ui": "0.0.0-alpha.205",
205
- "@agimon-ai/po-vault": "0.0.0-alpha.205",
206
- "@agimon-ai/po-wake": "0.0.1-alpha.17",
207
- "@agimon-ai/po-web-components": "0.0.0-alpha.205",
208
- "@agimon-ai/po-web-security": "0.0.0-alpha.205",
180
+ "@agimon-ai/po-approval": "0.0.0-alpha.206",
181
+ "@agimon-ai/po-artifact": "0.0.0-alpha.206",
182
+ "@agimon-ai/po-author": "0.0.0-alpha.207",
183
+ "@agimon-ai/po-autostop": "0.0.0-alpha.207",
184
+ "@agimon-ai/po-cache": "0.0.0-alpha.207",
185
+ "@agimon-ai/po-config": "0.0.0-alpha.207",
186
+ "@agimon-ai/po-core": "0.0.0-alpha.207",
187
+ "@agimon-ai/po-db": "0.0.0-alpha.207",
188
+ "@agimon-ai/po-domain": "0.0.0-alpha.207",
189
+ "@agimon-ai/po-federation": "0.0.0-alpha.207",
190
+ "@agimon-ai/po-infinite-canvas": "0.0.0-alpha.207",
191
+ "@agimon-ai/po-lang": "0.0.1-alpha.12",
192
+ "@agimon-ai/po-logsink": "0.0.1-alpha.189",
193
+ "@agimon-ai/po-mcp-proxy": "0.0.1-alpha.186",
194
+ "@agimon-ai/po-mode": "0.0.0-alpha.207",
195
+ "@agimon-ai/po-native-components": "0.0.0-alpha.207",
196
+ "@agimon-ai/po-network": "0.0.2-alpha.154",
197
+ "@agimon-ai/po-notification": "0.0.0-alpha.207",
198
+ "@agimon-ai/po-preset": "0.0.0-alpha.207",
199
+ "@agimon-ai/po-profile": "0.0.0-alpha.207",
200
+ "@agimon-ai/po-remote": "0.0.0-alpha.207",
201
+ "@agimon-ai/po-session": "0.0.0-alpha.207",
202
+ "@agimon-ai/po-session-mcp": "0.0.0-alpha.207",
203
+ "@agimon-ai/po-skill": "0.0.0-alpha.207",
204
+ "@agimon-ai/po-ui": "0.0.0-alpha.207",
205
+ "@agimon-ai/po-vault": "0.0.0-alpha.207",
206
+ "@agimon-ai/po-wake": "0.0.1-alpha.19",
207
+ "@agimon-ai/po-web-components": "0.0.0-alpha.207",
208
+ "@agimon-ai/po-web-security": "0.0.0-alpha.207",
209
209
  "@deepseek-ai/cordis": "4.0.5",
210
210
  "@earendil-works/pi-agent-core": "1.6.1",
211
211
  "@earendil-works/pi-coding-agent": "1.6.1",
@@ -227,10 +227,10 @@
227
227
  "yaml": "2.9.1"
228
228
  },
229
229
  "devDependencies": {
230
- "@agimon-ai/po-auth-server": "0.0.2-alpha.47",
231
- "@agimon-ai/po-calendar": "0.0.1-alpha.164",
232
- "@agimon-ai/po-runner": "0.0.0-alpha.205",
233
- "@agimon-ai/vibe-lint-plugin-po-cli": "0.0.0-alpha.205",
230
+ "@agimon-ai/po-auth-server": "0.0.2-alpha.49",
231
+ "@agimon-ai/po-calendar": "0.0.1-alpha.166",
232
+ "@agimon-ai/po-runner": "0.0.0-alpha.207",
233
+ "@agimon-ai/vibe-lint-plugin-po-cli": "0.0.0-alpha.207",
234
234
  "@earendil-works/pi-ai": "1.6.1",
235
235
  "@modelcontextprotocol/ext-apps": "2.0.3",
236
236
  "@modelcontextprotocol/server": "2.3.1",
@@ -9,7 +9,7 @@ Inside this monorepo:
9
9
  - Choose the package tier before scaffolding.
10
10
  - Keep Po-to-Po dependencies as `workspace:*`.
11
11
  - Use the repository-pinned published versions for Cordis, Pi, Vibe-Lint, and other foundation packages.
12
- - Set `sourceTemplate` to `po-extension` and follow the package's inherited Vibe-Lint rules.
12
+ - Set `sourceTemplate` to `po-extension` and follow the package's inherited Po Lint rules.
13
13
 
14
14
  Outside this monorepo:
15
15