@aglyn/plugins-ai 1.0.0-beta.278 → 1.0.0-beta.283

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.
Files changed (76) hide show
  1. package/package.json +17 -17
  2. package/src/lib/activity/ai-activity-actions.d.ts +2 -26
  3. package/src/lib/activity/ai-activity-actions.js +5 -42
  4. package/src/lib/activity/ai-activity-actions.js.map +1 -1
  5. package/src/lib/activity/ai-activity-words.d.ts +42 -0
  6. package/src/lib/activity/ai-activity-words.js +63 -0
  7. package/src/lib/activity/ai-activity-words.js.map +1 -0
  8. package/src/lib/components/ai-insight-card.component.d.ts +2 -6
  9. package/src/lib/components/ai-insight-card.component.js +2 -6
  10. package/src/lib/components/ai-insight-card.component.js.map +1 -1
  11. package/src/lib/components/ai-insight-dialog.component.js +22 -32
  12. package/src/lib/components/ai-insight-dialog.component.js.map +1 -1
  13. package/src/lib/components/ai-job-links.js +15 -0
  14. package/src/lib/components/ai-job-links.js.map +1 -1
  15. package/src/lib/components/assist-panel.component.js +3 -1
  16. package/src/lib/components/assist-panel.component.js.map +1 -1
  17. package/src/lib/jobs/ai-build-capabilities.js +23 -0
  18. package/src/lib/jobs/ai-build-capabilities.js.map +1 -1
  19. package/src/lib/jobs/ai-job-build-step.js +2 -1
  20. package/src/lib/jobs/ai-job-build-step.js.map +1 -1
  21. package/src/lib/jobs/ai-job-import-step.d.ts +1 -0
  22. package/src/lib/jobs/ai-job-import-step.js +17 -11
  23. package/src/lib/jobs/ai-job-import-step.js.map +1 -1
  24. package/src/lib/jobs/ai-job-plan-step.js +3 -2
  25. package/src/lib/jobs/ai-job-plan-step.js.map +1 -1
  26. package/src/lib/jobs/ai-job-privacy-step.d.ts +184 -0
  27. package/src/lib/jobs/ai-job-privacy-step.js +471 -0
  28. package/src/lib/jobs/ai-job-privacy-step.js.map +1 -0
  29. package/src/lib/jobs/ai-site-inspiration.d.ts +10 -0
  30. package/src/lib/jobs/ai-site-inspiration.js +15 -0
  31. package/src/lib/jobs/ai-site-inspiration.js.map +1 -1
  32. package/src/lib/model/ai-insight-ask.d.ts +57 -0
  33. package/src/lib/model/ai-insight-ask.js +64 -0
  34. package/src/lib/model/ai-insight-ask.js.map +1 -0
  35. package/src/lib/model/ai-insight.d.ts +1 -6
  36. package/src/lib/model/ai-insight.js +2 -8
  37. package/src/lib/model/ai-insight.js.map +1 -1
  38. package/src/lib/model/ai-job-activity.js +1 -0
  39. package/src/lib/model/ai-job-activity.js.map +1 -1
  40. package/src/lib/model/ai-jobs.types.d.ts +5 -1
  41. package/src/lib/model/ai-jobs.types.js +1 -0
  42. package/src/lib/model/ai-jobs.types.js.map +1 -1
  43. package/src/lib/model/ai-permissions.js +6 -2
  44. package/src/lib/model/ai-permissions.js.map +1 -1
  45. package/src/lib/model/ai-site-import.d.ts +2 -0
  46. package/src/lib/model/ai-site-import.js +2 -0
  47. package/src/lib/model/ai-site-import.js.map +1 -1
  48. package/src/lib/model/ai-site-kinds.d.ts +10 -28
  49. package/src/lib/model/ai-site-kinds.js +12 -496
  50. package/src/lib/model/ai-site-kinds.js.map +1 -1
  51. package/src/lib/providers/anthropic.js +23 -14
  52. package/src/lib/providers/anthropic.js.map +1 -1
  53. package/src/lib/providers/contract.d.ts +39 -4
  54. package/src/lib/providers/contract.js +28 -0
  55. package/src/lib/providers/contract.js.map +1 -1
  56. package/src/lib/providers/routing.d.ts +3 -0
  57. package/src/lib/providers/routing.js +4 -3
  58. package/src/lib/providers/routing.js.map +1 -1
  59. package/src/lib/runtime/ai-dev-env.d.ts +3 -2
  60. package/src/lib/runtime/ai-dev-env.js +3 -2
  61. package/src/lib/runtime/ai-dev-env.js.map +1 -1
  62. package/src/lib/runtime/ai-page-links.d.ts +5 -2
  63. package/src/lib/runtime/ai-page-links.js +11 -3
  64. package/src/lib/runtime/ai-page-links.js.map +1 -1
  65. package/src/lib/runtime/ai-runtime.js +5 -2
  66. package/src/lib/runtime/ai-runtime.js.map +1 -1
  67. package/src/lib/server/assist-chat.js +58 -30
  68. package/src/lib/server/assist-chat.js.map +1 -1
  69. package/src/lib/server.js +2 -0
  70. package/src/lib/server.js.map +1 -1
  71. package/src/lib/site-import/fixtures/site-import-crawl-recordings.d.ts +3 -1
  72. package/src/lib/site-import/fixtures/site-import-crawl-recordings.js +19 -1
  73. package/src/lib/site-import/fixtures/site-import-crawl-recordings.js.map +1 -1
  74. package/src/lib/site-import/site-import-page.d.ts +2 -2
  75. package/src/lib/site-import/site-import-page.js +11 -1
  76. package/src/lib/site-import/site-import-page.js.map +1 -1
@@ -1,3 +1,4 @@
1
+ import { _ as _async_iterator } from "@swc/helpers/_/_async_iterator";
1
2
  import { _ as _extends } from "@swc/helpers/_/_extends";
2
3
  /**
3
4
  * @license
@@ -1357,38 +1358,65 @@ async function handler(request) {
1357
1358
  try {
1358
1359
  var _ref, _ref1, _ref2, _ref3;
1359
1360
  var _guide_view, _describeView, _body_context;
1360
- for await (const event of upstream){
1361
- if (event.type === 'delta') {
1362
- raw += event.text;
1363
- const visible = visibleAssistText(raw);
1364
- if (visible.length > emitted) {
1365
- emit({
1366
- type: 'delta',
1367
- text: visible.slice(emitted)
1368
- });
1369
- emitted = visible.length;
1361
+ {
1362
+ var _iteratorAbruptCompletion = false, _didIteratorError = false, _iteratorError, _return;
1363
+ try {
1364
+ var _iterator = _async_iterator(upstream);
1365
+ if (_iterator === null || typeof _iterator !== "object" && typeof _iterator !== "function") throw new TypeError("Iterator result is not an object");
1366
+ for(var _next = _iterator.next, _step;; _iteratorAbruptCompletion = false){
1367
+ _step = await Reflect.apply(_next, _iterator, []);
1368
+ if (_step === null || typeof _step !== "object" && typeof _step !== "function") throw new TypeError("Iterator result is not an object");
1369
+ _iteratorAbruptCompletion = !_step.done;
1370
+ if (!_iteratorAbruptCompletion) break;
1371
+ let _value = _step.value;
1372
+ const event = _value;
1373
+ if (event.type === 'delta') {
1374
+ raw += event.text;
1375
+ const visible = visibleAssistText(raw);
1376
+ if (visible.length > emitted) {
1377
+ emit({
1378
+ type: 'delta',
1379
+ text: visible.slice(emitted)
1380
+ });
1381
+ emitted = visible.length;
1382
+ }
1383
+ } else if (event.type === 'error') {
1384
+ // The provider's own words stayed in the log (AGL-2815); the
1385
+ // reader gets the fixed sentence for the verdict.
1386
+ emit({
1387
+ type: 'error',
1388
+ error: upstreamFailureCopy(event.retryable)
1389
+ });
1390
+ } else if (event.type === 'tool') {
1391
+ // The first call only: the tool is offered once per message,
1392
+ // and a second call is the model repeating itself.
1393
+ if (editRung && !editInput && event.name === ASSIST_EDIT_TOOL_NAME) {
1394
+ editInput = event.input;
1395
+ }
1396
+ if (buildRung && !buildInput && event.name === ASSIST_BUILD_TOOL_NAME) {
1397
+ buildInput = event.input;
1398
+ }
1399
+ } else if (event.type === 'done') {
1400
+ var _event_rawOutput;
1401
+ usage = event.usage;
1402
+ stopReason = event.stopReason;
1403
+ rawOutput = (_event_rawOutput = event.rawOutput) != null ? _event_rawOutput : null;
1404
+ }
1370
1405
  }
1371
- } else if (event.type === 'error') {
1372
- // The provider's own words stayed in the log (AGL-2815); the
1373
- // reader gets the fixed sentence for the verdict.
1374
- emit({
1375
- type: 'error',
1376
- error: upstreamFailureCopy(event.retryable)
1377
- });
1378
- } else if (event.type === 'tool') {
1379
- // The first call only: the tool is offered once per message,
1380
- // and a second call is the model repeating itself.
1381
- if (editRung && !editInput && event.name === ASSIST_EDIT_TOOL_NAME) {
1382
- editInput = event.input;
1383
- }
1384
- if (buildRung && !buildInput && event.name === ASSIST_BUILD_TOOL_NAME) {
1385
- buildInput = event.input;
1406
+ } catch (err) {
1407
+ _didIteratorError = true;
1408
+ _iteratorError = err;
1409
+ } finally{
1410
+ try {
1411
+ if (_iteratorAbruptCompletion && (_return = _iterator.return) != null) {
1412
+ _step = await Reflect.apply(_return, _iterator, []);
1413
+ if (_step === null || typeof _step !== "object" && typeof _step !== "function") throw new TypeError("Iterator result is not an object");
1414
+ }
1415
+ } finally{
1416
+ if (_didIteratorError) {
1417
+ throw _iteratorError;
1418
+ }
1386
1419
  }
1387
- } else if (event.type === 'done') {
1388
- var _event_rawOutput;
1389
- usage = event.usage;
1390
- stopReason = event.stopReason;
1391
- rawOutput = (_event_rawOutput = event.rawOutput) != null ? _event_rawOutput : null;
1392
1420
  }
1393
1421
  }
1394
1422
  // End of stream: the fence ambiguity is resolved, so flush the