@agimon-ai/po 0.0.0-alpha.79 → 0.0.0-alpha.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalog/index.json +59 -59
- package/dist/package.cjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/src/builders/native/index.cjs +15 -10
- package/dist/src/builders/native/index.cjs.map +1 -1
- package/dist/src/builders/native/index.d.mts.map +1 -1
- package/dist/src/builders/native/index.mjs +15 -10
- package/dist/src/builders/native/index.mjs.map +1 -1
- package/dist/src/builders/server/runtime.cjs +0 -1
- package/dist/src/builders/server/runtime.cjs.map +1 -1
- package/dist/src/builders/server/runtime.mjs +0 -1
- package/dist/src/builders/server/runtime.mjs.map +1 -1
- package/dist/src/builders/web/webPluginManifest.cjs +6 -7
- package/dist/src/builders/web/webPluginManifest.cjs.map +1 -1
- package/dist/src/builders/web/webPluginManifest.d.mts +4 -5
- package/dist/src/builders/web/webPluginManifest.d.mts.map +1 -1
- package/dist/src/builders/web/webPluginManifest.mjs +6 -7
- package/dist/src/builders/web/webPluginManifest.mjs.map +1 -1
- package/package.json +27 -27
package/dist/catalog/index.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": 1,
|
|
3
3
|
"packages": {
|
|
4
4
|
"@agimon-ai/po": {
|
|
5
|
-
"version": "0.0.0-alpha.
|
|
5
|
+
"version": "0.0.0-alpha.81",
|
|
6
6
|
"dependencies": [
|
|
7
7
|
"@agimon-ai/po-approval",
|
|
8
8
|
"@agimon-ai/po-artifact",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
]
|
|
29
29
|
},
|
|
30
30
|
"@agimon-ai/po-approval": {
|
|
31
|
-
"version": "0.0.0-alpha.
|
|
31
|
+
"version": "0.0.0-alpha.80",
|
|
32
32
|
"dependencies": [
|
|
33
33
|
"@agimon-ai/po-core",
|
|
34
34
|
"@agimon-ai/po-web-components"
|
|
35
35
|
]
|
|
36
36
|
},
|
|
37
37
|
"@agimon-ai/po-artifact": {
|
|
38
|
-
"version": "0.0.0-alpha.
|
|
38
|
+
"version": "0.0.0-alpha.79",
|
|
39
39
|
"dependencies": [
|
|
40
40
|
"@agimon-ai/po-core",
|
|
41
41
|
"@agimon-ai/po-web-components",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
45
|
"@agimon-ai/po-author": {
|
|
46
|
-
"version": "0.0.0-alpha.
|
|
46
|
+
"version": "0.0.0-alpha.80",
|
|
47
47
|
"dependencies": [
|
|
48
48
|
"@agimon-ai/po-artifact",
|
|
49
49
|
"@agimon-ai/po-core",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
]
|
|
54
54
|
},
|
|
55
55
|
"@agimon-ai/po-autocompact": {
|
|
56
|
-
"version": "0.0.0-alpha.
|
|
56
|
+
"version": "0.0.0-alpha.80",
|
|
57
57
|
"dependencies": [
|
|
58
58
|
"@agimon-ai/po-artifact",
|
|
59
59
|
"@agimon-ai/po-config",
|
|
@@ -62,24 +62,24 @@
|
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
64
|
"@agimon-ai/po-autostop": {
|
|
65
|
-
"version": "0.0.0-alpha.
|
|
65
|
+
"version": "0.0.0-alpha.80",
|
|
66
66
|
"dependencies": [
|
|
67
67
|
"@agimon-ai/po-core"
|
|
68
68
|
]
|
|
69
69
|
},
|
|
70
70
|
"@agimon-ai/po-browse": {
|
|
71
|
-
"version": "0.0.1-alpha.
|
|
71
|
+
"version": "0.0.1-alpha.78",
|
|
72
72
|
"dependencies": [
|
|
73
73
|
"@agimon-ai/po-core",
|
|
74
74
|
"@agimon-ai/po-web-components"
|
|
75
75
|
]
|
|
76
76
|
},
|
|
77
77
|
"@agimon-ai/po-build": {
|
|
78
|
-
"version": "0.0.0-alpha.
|
|
78
|
+
"version": "0.0.0-alpha.80",
|
|
79
79
|
"dependencies": []
|
|
80
80
|
},
|
|
81
81
|
"@agimon-ai/po-cache": {
|
|
82
|
-
"version": "0.0.0-alpha.
|
|
82
|
+
"version": "0.0.0-alpha.80",
|
|
83
83
|
"dependencies": [
|
|
84
84
|
"@agimon-ai/po-config",
|
|
85
85
|
"@agimon-ai/po-core",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
]
|
|
88
88
|
},
|
|
89
89
|
"@agimon-ai/po-calendar": {
|
|
90
|
-
"version": "0.0.1-alpha.
|
|
90
|
+
"version": "0.0.1-alpha.39",
|
|
91
91
|
"dependencies": [
|
|
92
92
|
"@agimon-ai/po-config",
|
|
93
93
|
"@agimon-ai/po-core",
|
|
@@ -98,11 +98,11 @@
|
|
|
98
98
|
]
|
|
99
99
|
},
|
|
100
100
|
"@agimon-ai/po-claude-bridge": {
|
|
101
|
-
"version": "0.1.1-alpha.
|
|
101
|
+
"version": "0.1.1-alpha.60",
|
|
102
102
|
"dependencies": []
|
|
103
103
|
},
|
|
104
104
|
"@agimon-ai/po-codemode": {
|
|
105
|
-
"version": "0.0.1-alpha.
|
|
105
|
+
"version": "0.0.1-alpha.53",
|
|
106
106
|
"dependencies": [
|
|
107
107
|
"@agimon-ai/po-config",
|
|
108
108
|
"@agimon-ai/po-core",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
]
|
|
111
111
|
},
|
|
112
112
|
"@agimon-ai/po-computer-use": {
|
|
113
|
-
"version": "0.0.0-alpha.
|
|
113
|
+
"version": "0.0.0-alpha.80",
|
|
114
114
|
"dependencies": [
|
|
115
115
|
"@agimon-ai/po-config",
|
|
116
116
|
"@agimon-ai/po-core",
|
|
@@ -120,26 +120,26 @@
|
|
|
120
120
|
]
|
|
121
121
|
},
|
|
122
122
|
"@agimon-ai/po-config": {
|
|
123
|
-
"version": "0.0.0-alpha.
|
|
123
|
+
"version": "0.0.0-alpha.80",
|
|
124
124
|
"dependencies": [
|
|
125
125
|
"@agimon-ai/po-core",
|
|
126
126
|
"@agimon-ai/po-web-components"
|
|
127
127
|
]
|
|
128
128
|
},
|
|
129
129
|
"@agimon-ai/po-core": {
|
|
130
|
-
"version": "0.0.0-alpha.
|
|
130
|
+
"version": "0.0.0-alpha.80",
|
|
131
131
|
"dependencies": [
|
|
132
132
|
"@agimon-ai/po-web-security"
|
|
133
133
|
]
|
|
134
134
|
},
|
|
135
135
|
"@agimon-ai/po-db": {
|
|
136
|
-
"version": "0.0.0-alpha.
|
|
136
|
+
"version": "0.0.0-alpha.80",
|
|
137
137
|
"dependencies": [
|
|
138
138
|
"@agimon-ai/po-core"
|
|
139
139
|
]
|
|
140
140
|
},
|
|
141
141
|
"@agimon-ai/po-domain": {
|
|
142
|
-
"version": "0.0.0-alpha.
|
|
142
|
+
"version": "0.0.0-alpha.80",
|
|
143
143
|
"dependencies": [
|
|
144
144
|
"@agimon-ai/po-config",
|
|
145
145
|
"@agimon-ai/po-core",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
]
|
|
148
148
|
},
|
|
149
149
|
"@agimon-ai/po-edit": {
|
|
150
|
-
"version": "0.0.0-alpha.
|
|
150
|
+
"version": "0.0.0-alpha.80",
|
|
151
151
|
"dependencies": [
|
|
152
152
|
"@agimon-ai/po-core",
|
|
153
153
|
"@agimon-ai/po-hashline",
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
]
|
|
157
157
|
},
|
|
158
158
|
"@agimon-ai/po-file-edit": {
|
|
159
|
-
"version": "0.0.0-alpha.
|
|
159
|
+
"version": "0.0.0-alpha.80",
|
|
160
160
|
"dependencies": [
|
|
161
161
|
"@agimon-ai/po-config",
|
|
162
162
|
"@agimon-ai/po-core",
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
]
|
|
167
167
|
},
|
|
168
168
|
"@agimon-ai/po-git": {
|
|
169
|
-
"version": "0.0.0-alpha.
|
|
169
|
+
"version": "0.0.0-alpha.80",
|
|
170
170
|
"dependencies": [
|
|
171
171
|
"@agimon-ai/po-core",
|
|
172
172
|
"@agimon-ai/po-session",
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
]
|
|
176
176
|
},
|
|
177
177
|
"@agimon-ai/po-goal": {
|
|
178
|
-
"version": "0.0.0-alpha.
|
|
178
|
+
"version": "0.0.0-alpha.80",
|
|
179
179
|
"dependencies": [
|
|
180
180
|
"@agimon-ai/po-core",
|
|
181
181
|
"@agimon-ai/po-minor-mode",
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
]
|
|
185
185
|
},
|
|
186
186
|
"@agimon-ai/po-grep": {
|
|
187
|
-
"version": "0.0.0-alpha.
|
|
187
|
+
"version": "0.0.0-alpha.80",
|
|
188
188
|
"dependencies": [
|
|
189
189
|
"@agimon-ai/po-core",
|
|
190
190
|
"@agimon-ai/po-hashline",
|
|
@@ -193,11 +193,11 @@
|
|
|
193
193
|
]
|
|
194
194
|
},
|
|
195
195
|
"@agimon-ai/po-hashline": {
|
|
196
|
-
"version": "0.0.0-alpha.
|
|
196
|
+
"version": "0.0.0-alpha.80",
|
|
197
197
|
"dependencies": []
|
|
198
198
|
},
|
|
199
199
|
"@agimon-ai/po-help": {
|
|
200
|
-
"version": "0.0.0-alpha.
|
|
200
|
+
"version": "0.0.0-alpha.80",
|
|
201
201
|
"dependencies": [
|
|
202
202
|
"@agimon-ai/po-core",
|
|
203
203
|
"@agimon-ai/po-minor-mode",
|
|
@@ -205,14 +205,14 @@
|
|
|
205
205
|
]
|
|
206
206
|
},
|
|
207
207
|
"@agimon-ai/po-identity": {
|
|
208
|
-
"version": "0.0.2-alpha.
|
|
208
|
+
"version": "0.0.2-alpha.27",
|
|
209
209
|
"dependencies": [
|
|
210
210
|
"@agimon-ai/po-core",
|
|
211
211
|
"@agimon-ai/po-web-security"
|
|
212
212
|
]
|
|
213
213
|
},
|
|
214
214
|
"@agimon-ai/po-image-gen": {
|
|
215
|
-
"version": "0.0.0-alpha.
|
|
215
|
+
"version": "0.0.0-alpha.79",
|
|
216
216
|
"dependencies": [
|
|
217
217
|
"@agimon-ai/po-core",
|
|
218
218
|
"@agimon-ai/po-web-components",
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
]
|
|
221
221
|
},
|
|
222
222
|
"@agimon-ai/po-ios": {
|
|
223
|
-
"version": "0.0.1-alpha.
|
|
223
|
+
"version": "0.0.1-alpha.15",
|
|
224
224
|
"dependencies": [
|
|
225
225
|
"@agimon-ai/po-artifact",
|
|
226
226
|
"@agimon-ai/po-config",
|
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
]
|
|
231
231
|
},
|
|
232
232
|
"@agimon-ai/po-log": {
|
|
233
|
-
"version": "0.0.0-alpha.
|
|
233
|
+
"version": "0.0.0-alpha.80",
|
|
234
234
|
"dependencies": [
|
|
235
235
|
"@agimon-ai/po-core",
|
|
236
236
|
"@agimon-ai/po-web-components",
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
]
|
|
239
239
|
},
|
|
240
240
|
"@agimon-ai/po-major-mode": {
|
|
241
|
-
"version": "0.0.0-alpha.
|
|
241
|
+
"version": "0.0.0-alpha.80",
|
|
242
242
|
"dependencies": [
|
|
243
243
|
"@agimon-ai/po-config",
|
|
244
244
|
"@agimon-ai/po-core",
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
]
|
|
247
247
|
},
|
|
248
248
|
"@agimon-ai/po-mcp": {
|
|
249
|
-
"version": "0.0.0-alpha.
|
|
249
|
+
"version": "0.0.0-alpha.80",
|
|
250
250
|
"dependencies": [
|
|
251
251
|
"@agimon-ai/po-config",
|
|
252
252
|
"@agimon-ai/po-core",
|
|
@@ -257,43 +257,43 @@
|
|
|
257
257
|
]
|
|
258
258
|
},
|
|
259
259
|
"@agimon-ai/po-mcp-proxy": {
|
|
260
|
-
"version": "0.0.1-alpha.
|
|
260
|
+
"version": "0.0.1-alpha.59",
|
|
261
261
|
"dependencies": []
|
|
262
262
|
},
|
|
263
263
|
"@agimon-ai/po-minor-mode": {
|
|
264
|
-
"version": "0.0.0-alpha.
|
|
264
|
+
"version": "0.0.0-alpha.80",
|
|
265
265
|
"dependencies": [
|
|
266
266
|
"@agimon-ai/po-core"
|
|
267
267
|
]
|
|
268
268
|
},
|
|
269
269
|
"@agimon-ai/po-model-guidance": {
|
|
270
|
-
"version": "0.0.0-alpha.
|
|
270
|
+
"version": "0.0.0-alpha.80",
|
|
271
271
|
"dependencies": [
|
|
272
272
|
"@agimon-ai/po-config",
|
|
273
273
|
"@agimon-ai/po-core"
|
|
274
274
|
]
|
|
275
275
|
},
|
|
276
276
|
"@agimon-ai/po-native-components": {
|
|
277
|
-
"version": "0.0.0-alpha.
|
|
277
|
+
"version": "0.0.0-alpha.80",
|
|
278
278
|
"dependencies": [
|
|
279
279
|
"@agimon-ai/po-web-components"
|
|
280
280
|
]
|
|
281
281
|
},
|
|
282
282
|
"@agimon-ai/po-network": {
|
|
283
|
-
"version": "0.0.2-alpha.
|
|
283
|
+
"version": "0.0.2-alpha.27",
|
|
284
284
|
"dependencies": [
|
|
285
285
|
"@agimon-ai/po-core",
|
|
286
286
|
"@agimon-ai/po-web-security"
|
|
287
287
|
]
|
|
288
288
|
},
|
|
289
289
|
"@agimon-ai/po-notification": {
|
|
290
|
-
"version": "0.0.0-alpha.
|
|
290
|
+
"version": "0.0.0-alpha.80",
|
|
291
291
|
"dependencies": [
|
|
292
292
|
"@agimon-ai/po-core"
|
|
293
293
|
]
|
|
294
294
|
},
|
|
295
295
|
"@agimon-ai/po-plan": {
|
|
296
|
-
"version": "0.0.0-alpha.
|
|
296
|
+
"version": "0.0.0-alpha.80",
|
|
297
297
|
"dependencies": [
|
|
298
298
|
"@agimon-ai/po-config",
|
|
299
299
|
"@agimon-ai/po-core",
|
|
@@ -303,7 +303,7 @@
|
|
|
303
303
|
]
|
|
304
304
|
},
|
|
305
305
|
"@agimon-ai/po-profile": {
|
|
306
|
-
"version": "0.0.0-alpha.
|
|
306
|
+
"version": "0.0.0-alpha.80",
|
|
307
307
|
"dependencies": [
|
|
308
308
|
"@agimon-ai/po-config",
|
|
309
309
|
"@agimon-ai/po-core",
|
|
@@ -311,7 +311,7 @@
|
|
|
311
311
|
]
|
|
312
312
|
},
|
|
313
313
|
"@agimon-ai/po-prompt": {
|
|
314
|
-
"version": "0.0.0-alpha.
|
|
314
|
+
"version": "0.0.0-alpha.80",
|
|
315
315
|
"dependencies": [
|
|
316
316
|
"@agimon-ai/po-core",
|
|
317
317
|
"@agimon-ai/po-web-components",
|
|
@@ -319,7 +319,7 @@
|
|
|
319
319
|
]
|
|
320
320
|
},
|
|
321
321
|
"@agimon-ai/po-read": {
|
|
322
|
-
"version": "0.0.0-alpha.
|
|
322
|
+
"version": "0.0.0-alpha.80",
|
|
323
323
|
"dependencies": [
|
|
324
324
|
"@agimon-ai/po-config",
|
|
325
325
|
"@agimon-ai/po-core",
|
|
@@ -329,7 +329,7 @@
|
|
|
329
329
|
]
|
|
330
330
|
},
|
|
331
331
|
"@agimon-ai/po-runner": {
|
|
332
|
-
"version": "0.0.0-alpha.
|
|
332
|
+
"version": "0.0.0-alpha.80",
|
|
333
333
|
"dependencies": [
|
|
334
334
|
"@agimon-ai/po-core",
|
|
335
335
|
"@agimon-ai/po-ui",
|
|
@@ -338,13 +338,13 @@
|
|
|
338
338
|
]
|
|
339
339
|
},
|
|
340
340
|
"@agimon-ai/po-sandbox": {
|
|
341
|
-
"version": "0.0.0-alpha.
|
|
341
|
+
"version": "0.0.0-alpha.80",
|
|
342
342
|
"dependencies": [
|
|
343
343
|
"@agimon-ai/po-core"
|
|
344
344
|
]
|
|
345
345
|
},
|
|
346
346
|
"@agimon-ai/po-session": {
|
|
347
|
-
"version": "0.0.0-alpha.
|
|
347
|
+
"version": "0.0.0-alpha.80",
|
|
348
348
|
"dependencies": [
|
|
349
349
|
"@agimon-ai/po-config",
|
|
350
350
|
"@agimon-ai/po-core",
|
|
@@ -352,7 +352,7 @@
|
|
|
352
352
|
]
|
|
353
353
|
},
|
|
354
354
|
"@agimon-ai/po-skill": {
|
|
355
|
-
"version": "0.0.0-alpha.
|
|
355
|
+
"version": "0.0.0-alpha.80",
|
|
356
356
|
"dependencies": [
|
|
357
357
|
"@agimon-ai/po-config",
|
|
358
358
|
"@agimon-ai/po-core",
|
|
@@ -361,7 +361,7 @@
|
|
|
361
361
|
]
|
|
362
362
|
},
|
|
363
363
|
"@agimon-ai/po-style-system": {
|
|
364
|
-
"version": "0.0.0-alpha.
|
|
364
|
+
"version": "0.0.0-alpha.80",
|
|
365
365
|
"dependencies": [
|
|
366
366
|
"@agimon-ai/po-core",
|
|
367
367
|
"@agimon-ai/po-web-components",
|
|
@@ -369,7 +369,7 @@
|
|
|
369
369
|
]
|
|
370
370
|
},
|
|
371
371
|
"@agimon-ai/po-task": {
|
|
372
|
-
"version": "0.0.0-alpha.
|
|
372
|
+
"version": "0.0.0-alpha.80",
|
|
373
373
|
"dependencies": [
|
|
374
374
|
"@agimon-ai/po-core",
|
|
375
375
|
"@agimon-ai/po-ui",
|
|
@@ -377,7 +377,7 @@
|
|
|
377
377
|
]
|
|
378
378
|
},
|
|
379
379
|
"@agimon-ai/po-team": {
|
|
380
|
-
"version": "0.0.0-alpha.
|
|
380
|
+
"version": "0.0.0-alpha.80",
|
|
381
381
|
"dependencies": [
|
|
382
382
|
"@agimon-ai/po-cache",
|
|
383
383
|
"@agimon-ai/po-config",
|
|
@@ -389,7 +389,7 @@
|
|
|
389
389
|
]
|
|
390
390
|
},
|
|
391
391
|
"@agimon-ai/po-template-advanced": {
|
|
392
|
-
"version": "0.0.0-alpha.
|
|
392
|
+
"version": "0.0.0-alpha.80",
|
|
393
393
|
"dependencies": [
|
|
394
394
|
"@agimon-ai/po-core",
|
|
395
395
|
"@agimon-ai/po-web-components",
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
]
|
|
398
398
|
},
|
|
399
399
|
"@agimon-ai/po-template-elegant": {
|
|
400
|
-
"version": "0.0.0-alpha.
|
|
400
|
+
"version": "0.0.0-alpha.80",
|
|
401
401
|
"dependencies": [
|
|
402
402
|
"@agimon-ai/po-core",
|
|
403
403
|
"@agimon-ai/po-web-components",
|
|
@@ -405,7 +405,7 @@
|
|
|
405
405
|
]
|
|
406
406
|
},
|
|
407
407
|
"@agimon-ai/po-ui": {
|
|
408
|
-
"version": "0.0.0-alpha.
|
|
408
|
+
"version": "0.0.0-alpha.80",
|
|
409
409
|
"dependencies": [
|
|
410
410
|
"@agimon-ai/po-core",
|
|
411
411
|
"@agimon-ai/po-hashline",
|
|
@@ -414,7 +414,7 @@
|
|
|
414
414
|
]
|
|
415
415
|
},
|
|
416
416
|
"@agimon-ai/po-user-feedback": {
|
|
417
|
-
"version": "0.0.0-alpha.
|
|
417
|
+
"version": "0.0.0-alpha.80",
|
|
418
418
|
"dependencies": [
|
|
419
419
|
"@agimon-ai/po-core",
|
|
420
420
|
"@agimon-ai/po-minor-mode",
|
|
@@ -423,14 +423,14 @@
|
|
|
423
423
|
]
|
|
424
424
|
},
|
|
425
425
|
"@agimon-ai/po-vault": {
|
|
426
|
-
"version": "0.0.0-alpha.
|
|
426
|
+
"version": "0.0.0-alpha.80",
|
|
427
427
|
"dependencies": [
|
|
428
428
|
"@agimon-ai/po-core",
|
|
429
429
|
"@agimon-ai/po-db"
|
|
430
430
|
]
|
|
431
431
|
},
|
|
432
432
|
"@agimon-ai/po-vibe-lint": {
|
|
433
|
-
"version": "0.0.1-alpha.
|
|
433
|
+
"version": "0.0.1-alpha.49",
|
|
434
434
|
"dependencies": [
|
|
435
435
|
"@agimon-ai/po-config",
|
|
436
436
|
"@agimon-ai/po-core",
|
|
@@ -440,7 +440,7 @@
|
|
|
440
440
|
]
|
|
441
441
|
},
|
|
442
442
|
"@agimon-ai/po-voice": {
|
|
443
|
-
"version": "0.0.0-alpha.
|
|
443
|
+
"version": "0.0.0-alpha.80",
|
|
444
444
|
"dependencies": [
|
|
445
445
|
"@agimon-ai/po-config",
|
|
446
446
|
"@agimon-ai/po-core",
|
|
@@ -452,11 +452,11 @@
|
|
|
452
452
|
]
|
|
453
453
|
},
|
|
454
454
|
"@agimon-ai/po-web-components": {
|
|
455
|
-
"version": "0.0.0-alpha.
|
|
455
|
+
"version": "0.0.0-alpha.80",
|
|
456
456
|
"dependencies": []
|
|
457
457
|
},
|
|
458
458
|
"@agimon-ai/po-web-dashboard": {
|
|
459
|
-
"version": "0.0.0-alpha.
|
|
459
|
+
"version": "0.0.0-alpha.80",
|
|
460
460
|
"dependencies": [
|
|
461
461
|
"@agimon-ai/po-core",
|
|
462
462
|
"@agimon-ai/po-web-components",
|
|
@@ -464,18 +464,18 @@
|
|
|
464
464
|
]
|
|
465
465
|
},
|
|
466
466
|
"@agimon-ai/po-web-search": {
|
|
467
|
-
"version": "0.0.0-alpha.
|
|
467
|
+
"version": "0.0.0-alpha.79",
|
|
468
468
|
"dependencies": [
|
|
469
469
|
"@agimon-ai/po-core",
|
|
470
470
|
"@agimon-ai/po-web-components"
|
|
471
471
|
]
|
|
472
472
|
},
|
|
473
473
|
"@agimon-ai/po-web-security": {
|
|
474
|
-
"version": "0.0.0-alpha.
|
|
474
|
+
"version": "0.0.0-alpha.80",
|
|
475
475
|
"dependencies": []
|
|
476
476
|
},
|
|
477
477
|
"@agimon-ai/po-workflow": {
|
|
478
|
-
"version": "0.0.0-alpha.
|
|
478
|
+
"version": "0.0.0-alpha.80",
|
|
479
479
|
"dependencies": [
|
|
480
480
|
"@agimon-ai/po-core",
|
|
481
481
|
"@agimon-ai/po-ui",
|
package/dist/package.cjs
CHANGED
package/dist/package.mjs
CHANGED
|
@@ -20,8 +20,8 @@ let rolldown = require("rolldown");
|
|
|
20
20
|
* runs rolldown in process: the input is already built per package, so each bundle only joins
|
|
21
21
|
* that package's files and checks that every bare import is one the shell provides.
|
|
22
22
|
*/
|
|
23
|
-
/** Bumped
|
|
24
|
-
const GLOBAL_NATIVE_BUILD_FORMAT = "global-native-
|
|
23
|
+
/** Bumped when build output or package-copy admission changes, so an old record is never reused. */
|
|
24
|
+
const GLOBAL_NATIVE_BUILD_FORMAT = "global-native-5";
|
|
25
25
|
const PLUGINS_DIRECTORY = "plugins";
|
|
26
26
|
const UI_MODULE = "@agimon-ai/po-native-components";
|
|
27
27
|
const HOST_MODULES = new Set(_agimon_ai_po_core_native.NATIVE_HOST_MODULE_IDS);
|
|
@@ -214,14 +214,19 @@ async function bundleNativePlugins(plugins, outDir, onNotice) {
|
|
|
214
214
|
await node_fs_promises.default.mkdir(pluginsDirectory, { recursive: true });
|
|
215
215
|
const entries = {};
|
|
216
216
|
const failures = [];
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
217
|
+
const bundled = /* @__PURE__ */ new Set();
|
|
218
|
+
for (const plugin of plugins) {
|
|
219
|
+
if (bundled.has(plugin.pluginId)) continue;
|
|
220
|
+
bundled.add(plugin.pluginId);
|
|
221
|
+
try {
|
|
222
|
+
const file = pluginModuleFile(plugin.pluginId);
|
|
223
|
+
await node_fs_promises.default.writeFile(node_path.default.join(pluginsDirectory, file), await bundleNativeModule(node_path.default.join(plugin.packageDir, plugin.client.entry), false, onNotice));
|
|
224
|
+
entries[plugin.pluginId] = file;
|
|
225
|
+
} catch (error) {
|
|
226
|
+
const message = `native plugin '${plugin.pluginId}' could not be built: ${error instanceof Error ? error.message : String(error)}`;
|
|
227
|
+
failures.push(message);
|
|
228
|
+
onNotice(message);
|
|
229
|
+
}
|
|
225
230
|
}
|
|
226
231
|
if (Object.keys(entries).length === 0) throw new Error(failures.join("\n"));
|
|
227
232
|
return entries;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["NATIVE_HOST_MODULE_IDS","path","scanWebPlugins","createRequire","globalBuildKey","readBuildJson","crypto","fs","NATIVE_COMPOSITION_MAX_BYTES","singleFlightBuild","buildKeyDirectory","mountWebPluginIds"],"sources":["../../../../src/builders/native/index.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs/promises';\nimport { createRequire } from 'node:module';\nimport path from 'node:path';\n\nimport { NATIVE_HOST_MODULE_IDS } from '@agimon-ai/po-core/native';\nimport type { FileSystem } from '@agimon-ai/po-core/platform';\nimport type { GlobalNativeBuild } from '@agimon-ai/po-core/webCompositions';\nimport { NATIVE_COMPOSITION_MAX_BYTES } from '@agimon-ai/po-web-security';\nimport { type PluginContext, rolldown } from 'rolldown';\n\nimport { buildKeyDirectory, globalBuildKey, mountWebPluginIds, readBuildJson, singleFlightBuild } from '../web';\nimport type { DeclaredWebPlugin } from '../web/webPluginManifest';\nimport { scanWebPlugins } from '../web/webPluginScan';\n\n/**\n * The global native build: each package's `poNative` client bundled into its own CommonJS module\n * the po-native shell verifies and evaluates against its own host modules, one plugin at a time.\n *\n * It shares the web build's key, temporary directory, rename and `build.json` handling, and\n * runs rolldown in process: the input is already built per package, so each bundle only joins\n * that package's files and checks that every bare import is one the shell provides.\n */\n\n/** Bumped whenever the build's output layout changes, so an old layout is never reused. */\nconst GLOBAL_NATIVE_BUILD_FORMAT = 'global-native-4';\nconst PLUGINS_DIRECTORY = 'plugins';\nconst UI_MODULE = '@agimon-ai/po-native-components';\nconst HOST_MODULES: ReadonlySet<string> = new Set(NATIVE_HOST_MODULE_IDS);\n\n/** One build's record: the publishable build plus each plugin's package, for resolving a mount's plugins. */\nexport interface GlobalNativeBuildRecord extends GlobalNativeBuild {\n plugins: { pluginId: string; packageDir: string; isHost: boolean }[];\n}\n\nexport interface GlobalNativeBuildInput {\n /** Po's global home; builds land in `<home>/build/native/<key>/`. */\n poHome: string;\n files?: FileSystem;\n /** The union of every scope's package roots; roots without a poNative block are ignored. */\n pluginRoots: readonly string[];\n onNotice?: (message: string) => void;\n}\n\nexport type GlobalNativeBuildResult =\n | { status: 'built' | 'cached'; build: GlobalNativeBuildRecord }\n | { status: 'skipped'; reason: string }\n | { status: 'failed'; reason: string };\n\ntype ResolvedGlobalNativeBuild =\n | {\n status: 'resolved';\n plugins: DeclaredWebPlugin[];\n key: string;\n uiEntry: string;\n buildsRoot: string;\n directory: string;\n }\n | { status: 'skipped'; reason: string }\n | { status: 'failed'; reason: string };\n\n/** The build key for these plugin roots and where its build lives, without building anything. */\nasync function resolveGlobalNativeBuild(input: GlobalNativeBuildInput): Promise<ResolvedGlobalNativeBuild> {\n const pluginRoots = [...new Set(input.pluginRoots.map((root) => path.resolve(root)))].sort();\n let plugins: DeclaredWebPlugin[];\n let key: string;\n try {\n plugins = await scanWebPlugins(undefined, pluginRoots, input.onNotice ?? ((): void => {}), 'poNative');\n if (plugins.length === 0)\n return { status: 'skipped', reason: 'no package declares a native plugin; no native composition is published' };\n const resolve = createRequire(import.meta.url).resolve;\n const uiPackages = [UI_MODULE, '@agimon-ai/po-web-components'].map((name) => {\n const packageDir = path.dirname(resolve(`${name}/package.json`));\n return {\n pluginId: name,\n slot: name,\n registrationOrder: 0,\n packageDir,\n packageName: name,\n isHost: false,\n client: { entry: path.relative(packageDir, resolve(name)) },\n scopes: [],\n } satisfies DeclaredWebPlugin;\n });\n key = await globalBuildKey(\n `${GLOBAL_NATIVE_BUILD_FORMAT}:${JSON.stringify(NATIVE_HOST_MODULE_IDS)}`,\n undefined,\n [...plugins, ...uiPackages],\n input.files,\n );\n } catch (error) {\n return { status: 'failed', reason: error instanceof Error ? error.message : String(error) };\n }\n const buildsRoot = path.join(input.poHome, 'build', 'native');\n return {\n status: 'resolved',\n plugins,\n key,\n buildsRoot,\n directory: path.join(buildsRoot, key),\n uiEntry: createRequire(import.meta.url).resolve(UI_MODULE),\n };\n}\n\nasync function readBuildRecord(directory: string, files?: FileSystem): Promise<GlobalNativeBuildRecord | undefined> {\n const record = await readBuildJson<Omit<GlobalNativeBuildRecord, 'pluginsDirectory'>>(directory, files);\n if (record === undefined) return undefined;\n return { ...record, pluginsDirectory: path.join(directory, PLUGINS_DIRECTORY) };\n}\n\n/** The complete global native build of one key, or undefined when it is not there. Never builds. */\nexport async function readGlobalNativeBuildRecord(\n poHome: string,\n key: string,\n files?: FileSystem,\n): Promise<GlobalNativeBuildRecord | undefined> {\n return readBuildRecord(path.join(poHome, 'build', 'native', key), files);\n}\n\nconst isBareSpecifier = (source: string): boolean =>\n !source.startsWith('.') && !source.startsWith('\\0') && !path.isAbsolute(source);\n\n/** One plugin's module file name: a hash of its id, so any id is a safe top-level asset path. */\nconst pluginModuleFile = (pluginId: string): string =>\n `${crypto.createHash('sha256').update(pluginId).digest('hex').slice(0, 32)}.js`;\n\n/** Checks the tree-shaken ESM imports before the CommonJS body can run, including on older shells. */\nfunction nativeImportGuard(program: ReturnType<PluginContext['parse']>): string {\n const requirements = new Map<string, Set<string>>();\n const namespaces = new Map<string, string>();\n const requireExport = (module: string, name?: string) => {\n const names = requirements.get(module) ?? new Set<string>();\n if (name !== undefined) names.add(name);\n requirements.set(module, names);\n };\n for (const statement of program.body) {\n if (statement.type === 'ImportDeclaration') {\n const module = statement.source.value;\n requireExport(module);\n for (const specifier of statement.specifiers) {\n if (specifier.type === 'ImportNamespaceSpecifier') namespaces.set(specifier.local.name, module);\n else\n requireExport(\n module,\n specifier.type === 'ImportDefaultSpecifier'\n ? 'default'\n : specifier.imported.type === 'Identifier'\n ? specifier.imported.name\n : specifier.imported.value,\n );\n }\n } else if (statement.type === 'ExportNamedDeclaration' && statement.source !== null) {\n for (const specifier of statement.specifiers)\n requireExport(\n statement.source.value,\n specifier.local.type === 'Identifier' ? specifier.local.name : specifier.local.value,\n );\n } else if (statement.type === 'ExportAllDeclaration') {\n throw new Error('Native modules must name their external re-exports.');\n }\n }\n const visit = (value: unknown, parent?: Record<string, unknown>, key?: string): void => {\n if (Array.isArray(value)) {\n for (const item of value) visit(item, parent, key);\n return;\n }\n if (typeof value !== 'object' || value === null) return;\n const node = value as Record<string, unknown>;\n if (node.type === 'ImportExpression')\n throw new Error('Native external dynamic imports are unsupported; use named ESM imports.');\n if (\n node.type === 'CallExpression' &&\n /^(?:__)?require(?:\\$\\d+)?$/u.test(String((node.callee as { name?: string })?.name))\n ) {\n throw new Error('Native external CommonJS require is unsupported; use named ESM imports.');\n }\n if (node.type === 'Identifier' && namespaces.has(String(node.name))) {\n const module = namespaces.get(String(node.name))!;\n if (\n parent?.type === 'ImportNamespaceSpecifier' ||\n (key === 'property' && parent?.computed === false) ||\n (key === 'key' && parent?.computed === false)\n )\n return;\n if (parent?.type !== 'MemberExpression' || key !== 'object') {\n throw new Error(`Native namespace '${String(node.name)}' must use static member access.`);\n }\n const property = parent.property as { type: string; name?: string; value?: unknown };\n const name = parent.computed === false ? property.name : property.type === 'Literal' ? property.value : undefined;\n if (typeof name !== 'string')\n throw new Error(`Native namespace '${String(node.name)}' has dynamic member access.`);\n requireExport(module, name);\n }\n for (const [childKey, child] of Object.entries(node))\n if (childKey !== 'start' && childKey !== 'end') visit(child, node, childKey);\n };\n visit(program);\n const entries = [...requirements].map(([module, names]) => [module, [...names].sort()]);\n return `;(function(requirements) {\n function fail(id, name) {\n var error = new Error('Update Po: missing ' + id + (name === null ? '' : '.' + name));\n error.name = 'PoIncompatible';\n error.code = 'PO_INCOMPATIBLE';\n error.module = id;\n error.export = name;\n throw error;\n }\n for (var i = 0; i < requirements.length; i++) {\n var id = requirements[i][0], names = requirements[i][1], value;\n try { value = require(id); } catch (cause) { fail(id, null); }\n for (var j = 0; j < names.length; j++) {\n var name = names[j];\n if (value == null || (name === 'default' ? value.__esModule && value.default === undefined : value[name] === undefined)) fail(id, name);\n }\n }\n})(${JSON.stringify(entries)});\\n`;\n}\n\n/** Bundles a native module. Only the shared UI module may bundle ordinary JS dependencies. */\nasync function bundleNativeModule(entry: string, ui: boolean, onNotice: (message: string) => void): Promise<string> {\n let guard = '';\n const bundle = await rolldown({\n input: await fs.realpath(entry),\n cwd: path.dirname(entry),\n platform: 'neutral',\n external: (id) => HOST_MODULES.has(id) && !(ui && id === UI_MODULE),\n onLog: (level, log) => {\n if (level === 'warn') onNotice(log.message);\n },\n plugins: [\n {\n name: 'po-native-host-modules',\n resolveId(source, importer) {\n if (importer === undefined || !isBareSpecifier(source) || ui) return null;\n if (HOST_MODULES.has(source)) return { id: source, external: true };\n this.error(\n `'${source}' imported by ${importer} is not a native host module; a native plugin may import only: ${NATIVE_HOST_MODULE_IDS.join(', ')}.`,\n );\n },\n renderChunk(code, _chunk, options) {\n if (options.format === 'es') guard = nativeImportGuard(this.parse(code));\n return null;\n },\n },\n ],\n });\n try {\n const esm = await bundle.generate({ format: 'es', codeSplitting: false, exports: 'named' });\n const [entryChunk] = esm.output;\n if (esm.output.length !== 1 || entryChunk.type !== 'chunk') throw new Error('A native module must be one JS file.');\n // .mjs inputs force Node default-import semantics. Our require map instead supplies Metro modules.\n const commonjs = await rolldown({\n input: '\\0po-native-module.js',\n platform: 'neutral',\n external: (id) => HOST_MODULES.has(id),\n plugins: [\n {\n name: 'po-native-commonjs',\n resolveId: (id) => (id === '\\0po-native-module.js' ? id : null),\n load: (id) => (id === '\\0po-native-module.js' ? entryChunk.code : null),\n },\n ],\n });\n let code: string;\n try {\n const { output } = await commonjs.generate({ format: 'cjs', codeSplitting: false, exports: 'named' });\n const [chunk] = output;\n if (output.length !== 1 || chunk.type !== 'chunk') throw new Error('A native module must be one JS file.');\n code = chunk.code;\n } finally {\n await commonjs.close();\n }\n const source = guard + code;\n const bytes = Buffer.byteLength(source);\n if (bytes > NATIVE_COMPOSITION_MAX_BYTES)\n throw new Error(\n `The native plugin is ${String(bytes)} bytes, over the ${String(NATIVE_COMPOSITION_MAX_BYTES)} byte limit.`,\n );\n return source;\n } finally {\n await bundle.close();\n }\n}\n\n/**\n * Bundles each plugin into `<outDir>/plugins/<hash>.js` and returns `pluginId -> module file`. A plugin\n * that fails to bundle is named in a notice and left out; the build fails only when none bundles.\n */\nasync function bundleNativePlugins(\n plugins: readonly DeclaredWebPlugin[],\n outDir: string,\n onNotice: (message: string) => void,\n): Promise<Record<string, string>> {\n const pluginsDirectory = path.join(outDir, PLUGINS_DIRECTORY);\n await fs.mkdir(pluginsDirectory, { recursive: true });\n const entries: Record<string, string> = {};\n const failures: string[] = [];\n for (const plugin of plugins) {\n try {\n const file = pluginModuleFile(plugin.pluginId);\n await fs.writeFile(\n path.join(pluginsDirectory, file),\n await bundleNativeModule(path.join(plugin.packageDir, plugin.client.entry), false, onNotice),\n );\n entries[plugin.pluginId] = file;\n } catch (error) {\n const message = `native plugin '${plugin.pluginId}' could not be built: ${error instanceof Error ? error.message : String(error)}`;\n failures.push(message);\n onNotice(message);\n }\n }\n if (Object.keys(entries).length === 0) throw new Error(failures.join('\\n'));\n return entries;\n}\n\n/** Whether the global native build for these plugin roots exists, for a check that must not build. */\nexport async function readGlobalNativeBuildStatus(\n input: GlobalNativeBuildInput,\n): Promise<\n | { status: 'current' | 'missing'; key: string }\n | { status: 'skipped'; reason: string }\n | { status: 'failed'; reason: string }\n> {\n const resolved = await resolveGlobalNativeBuild(input);\n if (resolved.status !== 'resolved') return resolved;\n return {\n status: (await readBuildRecord(resolved.directory, input.files)) === undefined ? 'missing' : 'current',\n key: resolved.key,\n };\n}\n\n/**\n * Ensures the one global native build for the given plugin roots exists and returns it.\n *\n * The output is `<home>/build/native/<key>/plugins/<hash>.js`, one module per plugin, built in a\n * temporary directory and renamed into place; an existing key builds nothing.\n */\nexport async function ensureGlobalNativeBuild(input: GlobalNativeBuildInput): Promise<GlobalNativeBuildResult> {\n const notice = input.onNotice ?? ((): void => {});\n const resolved = await resolveGlobalNativeBuild(input);\n if (resolved.status !== 'resolved') return resolved;\n const { plugins, key, buildsRoot, directory, uiEntry } = resolved;\n const existing = await readBuildRecord(directory, input.files);\n if (existing !== undefined) return { status: 'cached', build: existing };\n return singleFlightBuild(key, async (): Promise<GlobalNativeBuildResult> => {\n try {\n await buildKeyDirectory(buildsRoot, key, directory, async (temporary) => {\n const pluginEntries = await bundleNativePlugins(plugins, temporary, notice);\n const uiFile = 'ui.js';\n const uiSource = await bundleNativeModule(uiEntry, true, notice);\n await fs.writeFile(path.join(temporary, PLUGINS_DIRECTORY, uiFile), uiSource);\n notice(`native UI module: ${String(Buffer.byteLength(uiSource))} bytes`);\n return {\n key,\n pluginEntries,\n uiEntry: uiFile,\n plugins: plugins.map(({ pluginId, packageDir, isHost }) => ({ pluginId, packageDir, isHost })),\n };\n });\n const build = await readBuildRecord(directory, input.files);\n if (build === undefined) throw new Error(`The native build '${key}' was not recorded.`);\n return { status: 'built', build };\n } catch (error) {\n return { status: 'failed', reason: error instanceof Error ? error.message : String(error) };\n }\n });\n}\n\n/** The `poNative.pluginId` values a mount runs: those of its own package roots. */\nexport const mountNativePluginIds: (build: GlobalNativeBuildRecord, packageRoots: readonly string[]) => string[] =\n mountWebPluginIds;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,6BAA6B;AACnC,MAAM,oBAAoB;AAC1B,MAAM,YAAY;AAClB,MAAM,eAAoC,IAAI,IAAIA,0BAAAA,sBAAsB;;AAkCxE,eAAe,yBAAyB,OAAmE;CACzG,MAAM,cAAc,CAAC,GAAG,IAAI,IAAI,MAAM,YAAY,KAAK,SAASC,UAAAA,QAAK,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK;CAC3F,IAAI;CACJ,IAAI;CACJ,IAAI;EACF,UAAU,MAAMC,sBAAAA,eAAe,KAAA,GAAW,aAAa,MAAM,mBAAyB,CAAC,IAAI,UAAU;EACrG,IAAI,QAAQ,WAAW,GACrB,OAAO;GAAE,QAAQ;GAAW,QAAQ;EAA0E;EAChH,MAAM,WAAA,GAAUC,YAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B,CAAC,CAAC;EAC/C,MAAM,aAAa,CAAC,WAAW,8BAA8B,CAAC,CAAC,KAAK,SAAS;GAC3E,MAAM,aAAaF,UAAAA,QAAK,QAAQ,QAAQ,GAAG,KAAK,cAAc,CAAC;GAC/D,OAAO;IACL,UAAU;IACV,MAAM;IACN,mBAAmB;IACnB;IACA,aAAa;IACb,QAAQ;IACR,QAAQ,EAAE,OAAOA,UAAAA,QAAK,SAAS,YAAY,QAAQ,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,MAAM,EAAE,SAAS,KAAK,YAAY,WAAW,YAAY;CACzD,MAAM,WAAW,MAAM,gBAAgB,WAAW,MAAM,KAAK;CAC7D,IAAI,aAAa,KAAA,GAAW,OAAO;EAAE,QAAQ;EAAU,OAAO;CAAS;CACvE,OAAOQ,cAAAA,kBAAkB,KAAK,YAA8C;EAC1E,IAAI;GACF,MAAMC,cAAAA,kBAAkB,YAAY,KAAK,WAAW,OAAO,cAAc;IACvE,MAAM,gBAAgB,MAAM,oBAAoB,SAAS,WAAW,MAAM;IAC1E,MAAM,SAAS;IACf,MAAM,WAAW,MAAM,mBAAmB,SAAS,MAAM,MAAM;IAC/D,MAAMH,iBAAAA,QAAG,UAAUN,UAAAA,QAAK,KAAK,WAAW,mBAAmB,MAAM,GAAG,QAAQ;IAC5E,OAAO,qBAAqB,OAAO,OAAO,WAAW,QAAQ,CAAC,EAAE,OAAO;IACvE,OAAO;KACL;KACA;KACA,SAAS;KACT,SAAS,QAAQ,KAAK,EAAE,UAAU,YAAY,cAAc;MAAE;MAAU;MAAY;KAAO,EAAE;IAC/F;GACF,CAAC;GACD,MAAM,QAAQ,MAAM,gBAAgB,WAAW,MAAM,KAAK;GAC1D,IAAI,UAAU,KAAA,GAAW,MAAM,IAAI,MAAM,qBAAqB,IAAI,oBAAoB;GACtF,OAAO;IAAE,QAAQ;IAAS;GAAM;EAClC,SAAS,OAAO;GACd,OAAO;IAAE,QAAQ;IAAU,QAAQ,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;GAAE;EAC5F;CACF,CAAC;AACH;;AAGA,MAAa,uBACXU,cAAAA"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["NATIVE_HOST_MODULE_IDS","path","scanWebPlugins","createRequire","globalBuildKey","readBuildJson","crypto","fs","NATIVE_COMPOSITION_MAX_BYTES","singleFlightBuild","buildKeyDirectory","mountWebPluginIds"],"sources":["../../../../src/builders/native/index.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs/promises';\nimport { createRequire } from 'node:module';\nimport path from 'node:path';\n\nimport { NATIVE_HOST_MODULE_IDS } from '@agimon-ai/po-core/native';\nimport type { FileSystem } from '@agimon-ai/po-core/platform';\nimport type { GlobalNativeBuild } from '@agimon-ai/po-core/webCompositions';\nimport { NATIVE_COMPOSITION_MAX_BYTES } from '@agimon-ai/po-web-security';\nimport { type PluginContext, rolldown } from 'rolldown';\n\nimport { buildKeyDirectory, globalBuildKey, mountWebPluginIds, readBuildJson, singleFlightBuild } from '../web';\nimport type { DeclaredWebPlugin } from '../web/webPluginManifest';\nimport { scanWebPlugins } from '../web/webPluginScan';\n\n/**\n * The global native build: each package's `poNative` client bundled into its own CommonJS module\n * the po-native shell verifies and evaluates against its own host modules, one plugin at a time.\n *\n * It shares the web build's key, temporary directory, rename and `build.json` handling, and\n * runs rolldown in process: the input is already built per package, so each bundle only joins\n * that package's files and checks that every bare import is one the shell provides.\n */\n\n/** Bumped when build output or package-copy admission changes, so an old record is never reused. */\nconst GLOBAL_NATIVE_BUILD_FORMAT = 'global-native-5';\nconst PLUGINS_DIRECTORY = 'plugins';\nconst UI_MODULE = '@agimon-ai/po-native-components';\nconst HOST_MODULES: ReadonlySet<string> = new Set(NATIVE_HOST_MODULE_IDS);\n\n/** One build's record: the publishable build plus each plugin's package, for resolving a mount's plugins. */\nexport interface GlobalNativeBuildRecord extends GlobalNativeBuild {\n plugins: { pluginId: string; packageDir: string; isHost: boolean }[];\n}\n\nexport interface GlobalNativeBuildInput {\n /** Po's global home; builds land in `<home>/build/native/<key>/`. */\n poHome: string;\n files?: FileSystem;\n /** The union of every scope's package roots; roots without a poNative block are ignored. */\n pluginRoots: readonly string[];\n onNotice?: (message: string) => void;\n}\n\nexport type GlobalNativeBuildResult =\n | { status: 'built' | 'cached'; build: GlobalNativeBuildRecord }\n | { status: 'skipped'; reason: string }\n | { status: 'failed'; reason: string };\n\ntype ResolvedGlobalNativeBuild =\n | {\n status: 'resolved';\n plugins: DeclaredWebPlugin[];\n key: string;\n uiEntry: string;\n buildsRoot: string;\n directory: string;\n }\n | { status: 'skipped'; reason: string }\n | { status: 'failed'; reason: string };\n\n/** The build key for these plugin roots and where its build lives, without building anything. */\nasync function resolveGlobalNativeBuild(input: GlobalNativeBuildInput): Promise<ResolvedGlobalNativeBuild> {\n const pluginRoots = [...new Set(input.pluginRoots.map((root) => path.resolve(root)))].sort();\n let plugins: DeclaredWebPlugin[];\n let key: string;\n try {\n plugins = await scanWebPlugins(undefined, pluginRoots, input.onNotice ?? ((): void => {}), 'poNative');\n if (plugins.length === 0)\n return { status: 'skipped', reason: 'no package declares a native plugin; no native composition is published' };\n const resolve = createRequire(import.meta.url).resolve;\n const uiPackages = [UI_MODULE, '@agimon-ai/po-web-components'].map((name) => {\n const packageDir = path.dirname(resolve(`${name}/package.json`));\n return {\n pluginId: name,\n slot: name,\n registrationOrder: 0,\n packageDir,\n packageName: name,\n isHost: false,\n client: { entry: path.relative(packageDir, resolve(name)) },\n scopes: [],\n } satisfies DeclaredWebPlugin;\n });\n key = await globalBuildKey(\n `${GLOBAL_NATIVE_BUILD_FORMAT}:${JSON.stringify(NATIVE_HOST_MODULE_IDS)}`,\n undefined,\n [...plugins, ...uiPackages],\n input.files,\n );\n } catch (error) {\n return { status: 'failed', reason: error instanceof Error ? error.message : String(error) };\n }\n const buildsRoot = path.join(input.poHome, 'build', 'native');\n return {\n status: 'resolved',\n plugins,\n key,\n buildsRoot,\n directory: path.join(buildsRoot, key),\n uiEntry: createRequire(import.meta.url).resolve(UI_MODULE),\n };\n}\n\nasync function readBuildRecord(directory: string, files?: FileSystem): Promise<GlobalNativeBuildRecord | undefined> {\n const record = await readBuildJson<Omit<GlobalNativeBuildRecord, 'pluginsDirectory'>>(directory, files);\n if (record === undefined) return undefined;\n return { ...record, pluginsDirectory: path.join(directory, PLUGINS_DIRECTORY) };\n}\n\n/** The complete global native build of one key, or undefined when it is not there. Never builds. */\nexport async function readGlobalNativeBuildRecord(\n poHome: string,\n key: string,\n files?: FileSystem,\n): Promise<GlobalNativeBuildRecord | undefined> {\n return readBuildRecord(path.join(poHome, 'build', 'native', key), files);\n}\n\nconst isBareSpecifier = (source: string): boolean =>\n !source.startsWith('.') && !source.startsWith('\\0') && !path.isAbsolute(source);\n\n/** One plugin's module file name: a hash of its id, so any id is a safe top-level asset path. */\nconst pluginModuleFile = (pluginId: string): string =>\n `${crypto.createHash('sha256').update(pluginId).digest('hex').slice(0, 32)}.js`;\n\n/** Checks the tree-shaken ESM imports before the CommonJS body can run, including on older shells. */\nfunction nativeImportGuard(program: ReturnType<PluginContext['parse']>): string {\n const requirements = new Map<string, Set<string>>();\n const namespaces = new Map<string, string>();\n const requireExport = (module: string, name?: string) => {\n const names = requirements.get(module) ?? new Set<string>();\n if (name !== undefined) names.add(name);\n requirements.set(module, names);\n };\n for (const statement of program.body) {\n if (statement.type === 'ImportDeclaration') {\n const module = statement.source.value;\n requireExport(module);\n for (const specifier of statement.specifiers) {\n if (specifier.type === 'ImportNamespaceSpecifier') namespaces.set(specifier.local.name, module);\n else\n requireExport(\n module,\n specifier.type === 'ImportDefaultSpecifier'\n ? 'default'\n : specifier.imported.type === 'Identifier'\n ? specifier.imported.name\n : specifier.imported.value,\n );\n }\n } else if (statement.type === 'ExportNamedDeclaration' && statement.source !== null) {\n for (const specifier of statement.specifiers)\n requireExport(\n statement.source.value,\n specifier.local.type === 'Identifier' ? specifier.local.name : specifier.local.value,\n );\n } else if (statement.type === 'ExportAllDeclaration') {\n throw new Error('Native modules must name their external re-exports.');\n }\n }\n const visit = (value: unknown, parent?: Record<string, unknown>, key?: string): void => {\n if (Array.isArray(value)) {\n for (const item of value) visit(item, parent, key);\n return;\n }\n if (typeof value !== 'object' || value === null) return;\n const node = value as Record<string, unknown>;\n if (node.type === 'ImportExpression')\n throw new Error('Native external dynamic imports are unsupported; use named ESM imports.');\n if (\n node.type === 'CallExpression' &&\n /^(?:__)?require(?:\\$\\d+)?$/u.test(String((node.callee as { name?: string })?.name))\n ) {\n throw new Error('Native external CommonJS require is unsupported; use named ESM imports.');\n }\n if (node.type === 'Identifier' && namespaces.has(String(node.name))) {\n const module = namespaces.get(String(node.name))!;\n if (\n parent?.type === 'ImportNamespaceSpecifier' ||\n (key === 'property' && parent?.computed === false) ||\n (key === 'key' && parent?.computed === false)\n )\n return;\n if (parent?.type !== 'MemberExpression' || key !== 'object') {\n throw new Error(`Native namespace '${String(node.name)}' must use static member access.`);\n }\n const property = parent.property as { type: string; name?: string; value?: unknown };\n const name = parent.computed === false ? property.name : property.type === 'Literal' ? property.value : undefined;\n if (typeof name !== 'string')\n throw new Error(`Native namespace '${String(node.name)}' has dynamic member access.`);\n requireExport(module, name);\n }\n for (const [childKey, child] of Object.entries(node))\n if (childKey !== 'start' && childKey !== 'end') visit(child, node, childKey);\n };\n visit(program);\n const entries = [...requirements].map(([module, names]) => [module, [...names].sort()]);\n return `;(function(requirements) {\n function fail(id, name) {\n var error = new Error('Update Po: missing ' + id + (name === null ? '' : '.' + name));\n error.name = 'PoIncompatible';\n error.code = 'PO_INCOMPATIBLE';\n error.module = id;\n error.export = name;\n throw error;\n }\n for (var i = 0; i < requirements.length; i++) {\n var id = requirements[i][0], names = requirements[i][1], value;\n try { value = require(id); } catch (cause) { fail(id, null); }\n for (var j = 0; j < names.length; j++) {\n var name = names[j];\n if (value == null || (name === 'default' ? value.__esModule && value.default === undefined : value[name] === undefined)) fail(id, name);\n }\n }\n})(${JSON.stringify(entries)});\\n`;\n}\n\n/** Bundles a native module. Only the shared UI module may bundle ordinary JS dependencies. */\nasync function bundleNativeModule(entry: string, ui: boolean, onNotice: (message: string) => void): Promise<string> {\n let guard = '';\n const bundle = await rolldown({\n input: await fs.realpath(entry),\n cwd: path.dirname(entry),\n platform: 'neutral',\n external: (id) => HOST_MODULES.has(id) && !(ui && id === UI_MODULE),\n onLog: (level, log) => {\n if (level === 'warn') onNotice(log.message);\n },\n plugins: [\n {\n name: 'po-native-host-modules',\n resolveId(source, importer) {\n if (importer === undefined || !isBareSpecifier(source) || ui) return null;\n if (HOST_MODULES.has(source)) return { id: source, external: true };\n this.error(\n `'${source}' imported by ${importer} is not a native host module; a native plugin may import only: ${NATIVE_HOST_MODULE_IDS.join(', ')}.`,\n );\n },\n renderChunk(code, _chunk, options) {\n if (options.format === 'es') guard = nativeImportGuard(this.parse(code));\n return null;\n },\n },\n ],\n });\n try {\n const esm = await bundle.generate({ format: 'es', codeSplitting: false, exports: 'named' });\n const [entryChunk] = esm.output;\n if (esm.output.length !== 1 || entryChunk.type !== 'chunk') throw new Error('A native module must be one JS file.');\n // .mjs inputs force Node default-import semantics. Our require map instead supplies Metro modules.\n const commonjs = await rolldown({\n input: '\\0po-native-module.js',\n platform: 'neutral',\n external: (id) => HOST_MODULES.has(id),\n plugins: [\n {\n name: 'po-native-commonjs',\n resolveId: (id) => (id === '\\0po-native-module.js' ? id : null),\n load: (id) => (id === '\\0po-native-module.js' ? entryChunk.code : null),\n },\n ],\n });\n let code: string;\n try {\n const { output } = await commonjs.generate({ format: 'cjs', codeSplitting: false, exports: 'named' });\n const [chunk] = output;\n if (output.length !== 1 || chunk.type !== 'chunk') throw new Error('A native module must be one JS file.');\n code = chunk.code;\n } finally {\n await commonjs.close();\n }\n const source = guard + code;\n const bytes = Buffer.byteLength(source);\n if (bytes > NATIVE_COMPOSITION_MAX_BYTES)\n throw new Error(\n `The native plugin is ${String(bytes)} bytes, over the ${String(NATIVE_COMPOSITION_MAX_BYTES)} byte limit.`,\n );\n return source;\n } finally {\n await bundle.close();\n }\n}\n\n/**\n * Bundles each plugin into `<outDir>/plugins/<hash>.js` and returns `pluginId -> module file`. A plugin\n * that fails to bundle is named in a notice and left out; the build fails only when none bundles.\n */\nasync function bundleNativePlugins(\n plugins: readonly DeclaredWebPlugin[],\n outDir: string,\n onNotice: (message: string) => void,\n): Promise<Record<string, string>> {\n const pluginsDirectory = path.join(outDir, PLUGINS_DIRECTORY);\n await fs.mkdir(pluginsDirectory, { recursive: true });\n const entries: Record<string, string> = {};\n const failures: string[] = [];\n const bundled = new Set<string>();\n for (const plugin of plugins) {\n if (bundled.has(plugin.pluginId)) continue;\n bundled.add(plugin.pluginId);\n try {\n const file = pluginModuleFile(plugin.pluginId);\n await fs.writeFile(\n path.join(pluginsDirectory, file),\n await bundleNativeModule(path.join(plugin.packageDir, plugin.client.entry), false, onNotice),\n );\n entries[plugin.pluginId] = file;\n } catch (error) {\n const message = `native plugin '${plugin.pluginId}' could not be built: ${error instanceof Error ? error.message : String(error)}`;\n failures.push(message);\n onNotice(message);\n }\n }\n if (Object.keys(entries).length === 0) throw new Error(failures.join('\\n'));\n return entries;\n}\n\n/** Whether the global native build for these plugin roots exists, for a check that must not build. */\nexport async function readGlobalNativeBuildStatus(\n input: GlobalNativeBuildInput,\n): Promise<\n | { status: 'current' | 'missing'; key: string }\n | { status: 'skipped'; reason: string }\n | { status: 'failed'; reason: string }\n> {\n const resolved = await resolveGlobalNativeBuild(input);\n if (resolved.status !== 'resolved') return resolved;\n return {\n status: (await readBuildRecord(resolved.directory, input.files)) === undefined ? 'missing' : 'current',\n key: resolved.key,\n };\n}\n\n/**\n * Ensures the one global native build for the given plugin roots exists and returns it.\n *\n * The output is `<home>/build/native/<key>/plugins/<hash>.js`, one module per plugin, built in a\n * temporary directory and renamed into place; an existing key builds nothing.\n */\nexport async function ensureGlobalNativeBuild(input: GlobalNativeBuildInput): Promise<GlobalNativeBuildResult> {\n const notice = input.onNotice ?? ((): void => {});\n const resolved = await resolveGlobalNativeBuild(input);\n if (resolved.status !== 'resolved') return resolved;\n const { plugins, key, buildsRoot, directory, uiEntry } = resolved;\n const existing = await readBuildRecord(directory, input.files);\n if (existing !== undefined) return { status: 'cached', build: existing };\n return singleFlightBuild(key, async (): Promise<GlobalNativeBuildResult> => {\n try {\n await buildKeyDirectory(buildsRoot, key, directory, async (temporary) => {\n const pluginEntries = await bundleNativePlugins(plugins, temporary, notice);\n const uiFile = 'ui.js';\n const uiSource = await bundleNativeModule(uiEntry, true, notice);\n await fs.writeFile(path.join(temporary, PLUGINS_DIRECTORY, uiFile), uiSource);\n notice(`native UI module: ${String(Buffer.byteLength(uiSource))} bytes`);\n return {\n key,\n pluginEntries,\n uiEntry: uiFile,\n plugins: plugins.map(({ pluginId, packageDir, isHost }) => ({ pluginId, packageDir, isHost })),\n };\n });\n const build = await readBuildRecord(directory, input.files);\n if (build === undefined) throw new Error(`The native build '${key}' was not recorded.`);\n return { status: 'built', build };\n } catch (error) {\n return { status: 'failed', reason: error instanceof Error ? error.message : String(error) };\n }\n });\n}\n\n/** The `poNative.pluginId` values a mount runs: those of its own package roots. */\nexport const mountNativePluginIds: (build: GlobalNativeBuildRecord, packageRoots: readonly string[]) => string[] =\n mountWebPluginIds;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,6BAA6B;AACnC,MAAM,oBAAoB;AAC1B,MAAM,YAAY;AAClB,MAAM,eAAoC,IAAI,IAAIA,0BAAAA,sBAAsB;;AAkCxE,eAAe,yBAAyB,OAAmE;CACzG,MAAM,cAAc,CAAC,GAAG,IAAI,IAAI,MAAM,YAAY,KAAK,SAASC,UAAAA,QAAK,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK;CAC3F,IAAI;CACJ,IAAI;CACJ,IAAI;EACF,UAAU,MAAMC,sBAAAA,eAAe,KAAA,GAAW,aAAa,MAAM,mBAAyB,CAAC,IAAI,UAAU;EACrG,IAAI,QAAQ,WAAW,GACrB,OAAO;GAAE,QAAQ;GAAW,QAAQ;EAA0E;EAChH,MAAM,WAAA,GAAUC,YAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B,CAAC,CAAC;EAC/C,MAAM,aAAa,CAAC,WAAW,8BAA8B,CAAC,CAAC,KAAK,SAAS;GAC3E,MAAM,aAAaF,UAAAA,QAAK,QAAQ,QAAQ,GAAG,KAAK,cAAc,CAAC;GAC/D,OAAO;IACL,UA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|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/builders/native/index.ts"],"mappings":";;;;iBA+BiB,gCAAgC;EAC/C;IAAW;IAAkB;IAAoB;;;iBAGlC;;EAEf;EACA,QAAQ;;EAER;EACA,YAAY;;YAGF;EACN;EAA4B,OAAO;;EACnC;EAAmB;;EACnB;EAAkB;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/builders/native/index.ts"],"mappings":";;;;iBA+BiB,gCAAgC;EAC/C;IAAW;IAAkB;IAAoB;;;iBAGlC;;EAEf;EACA,QAAQ;;EAER;EACA,YAAY;;YAGF;EACN;EAA4B,OAAO;;EACnC;EAAmB;;EACnB;EAAkB;;;;;;;;wBAqSF,wBAAwB,OAAO,yBAAyB,QAAQ"}
|