@flame0510/project-aether 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/README.md +3 -1
  2. package/agent-templates/README.md +42 -22
  3. package/agent-templates/base-image/Dockerfile +42 -33
  4. package/agent-templates/base-image/entrypoint.sh +67 -12
  5. package/app/agents/BrowserAccessSection.tsx +510 -0
  6. package/app/agents/ChannelManager.tsx +19 -11
  7. package/app/agents/ImageDownloadBanner.tsx +53 -19
  8. package/app/agents/ModelSection.tsx +316 -0
  9. package/app/agents/PageClient.tsx +708 -167
  10. package/app/agents/UpdateSection.tsx +300 -0
  11. package/app/agents/create/PageClient.tsx +11 -49
  12. package/app/agents/create/page.tsx +8 -21
  13. package/app/api/agents/[id]/backup/route.ts +26 -69
  14. package/app/api/agents/[id]/channels/pairing/route.ts +3 -3
  15. package/app/api/agents/[id]/channels/telegram/route.ts +2 -2
  16. package/app/api/agents/[id]/cold-backup/route.ts +56 -0
  17. package/app/api/agents/[id]/devices/route.ts +126 -0
  18. package/app/api/agents/[id]/invite-link/route.ts +53 -0
  19. package/app/api/agents/[id]/lifecycle/route.ts +3 -0
  20. package/app/api/agents/[id]/model/route.ts +113 -0
  21. package/app/api/agents/[id]/open-control-ui/route.ts +58 -0
  22. package/app/api/agents/[id]/recreate/route.ts +33 -187
  23. package/app/api/agents/[id]/restart/route.ts +5 -0
  24. package/app/api/agents/[id]/restore/route.ts +40 -70
  25. package/app/api/agents/[id]/route.ts +38 -169
  26. package/app/api/agents/[id]/update/rollback/route.ts +30 -0
  27. package/app/api/agents/[id]/update/route.ts +50 -0
  28. package/app/api/agents/activity-summary/route.ts +67 -0
  29. package/app/api/agents/create/route.ts +91 -145
  30. package/app/api/agents/devices-summary/route.ts +37 -0
  31. package/app/api/agents/download-image/route.ts +16 -9
  32. package/app/api/agents/image-status/route.ts +31 -111
  33. package/app/api/agents/models-summary/route.ts +163 -0
  34. package/app/api/agents/route.ts +25 -49
  35. package/app/api/agents/token/route.ts +33 -10
  36. package/app/api/assistant/route.ts +37 -16
  37. package/app/api/gateway/agent/route.ts +37 -6
  38. package/app/api/gateway/provider/balance/route.ts +5 -2
  39. package/app/api/gateway/provider/keys.ts +13 -1
  40. package/app/api/gateway/provider/route.ts +43 -12
  41. package/app/api/gateway/sync.ts +335 -76
  42. package/app/api/models/route.ts +28 -34
  43. package/app/api/provider/auth.ts +65 -0
  44. package/app/api/provider/upstream.ts +9 -2
  45. package/app/api/provider/v1/chat/completions/route.ts +22 -16
  46. package/app/api/provider/v1/models/route.ts +26 -133
  47. package/app/api/setup/agent-image/route.ts +14 -42
  48. package/app/components/DashboardToolbar.tsx +1 -1
  49. package/app/components/PulseChat.tsx +25 -39
  50. package/app/components/ui/RemoveButton.tsx +46 -0
  51. package/app/components/ui/Select.tsx +3 -2
  52. package/app/components/ui/index.ts +1 -0
  53. package/app/credentials/PageClient.tsx +2 -2
  54. package/app/gateway/PageClient.tsx +253 -674
  55. package/app/globals.css +8 -0
  56. package/app/lib/models-context.tsx +43 -7
  57. package/app/wizard/useWizard.ts +6 -1
  58. package/bin/rev4a.js +116 -50
  59. package/daemon.js +6 -6
  60. package/docs/ARCHITECTURE.md +110 -12
  61. package/docs/FRONTEND-ARCHITECTURE.md +31 -2
  62. package/docs/REV4A.md +93 -33
  63. package/docs/dev/API-REFERENCE.md +723 -178
  64. package/docs/dev/DATABASE.md +96 -0
  65. package/docs/dev/GATEWAY.md +250 -93
  66. package/docs/dev/PROVIDERS.md +26 -13
  67. package/docs/rag/DATA-FRESHNESS.md +59 -28
  68. package/docs/rag/GLOSSARY.md +27 -16
  69. package/docs/rag/REV4A-OVERVIEW.md +37 -25
  70. package/docs/rag/WHAT-I-CAN-ANSWER.md +10 -8
  71. package/instrumentation.ts +52 -1
  72. package/lib/agent-busy.ts +21 -0
  73. package/lib/agent-devices.ts +361 -0
  74. package/lib/agent-edit-state.ts +108 -0
  75. package/lib/agent-edit.ts +157 -0
  76. package/lib/agent-images.ts +375 -0
  77. package/lib/agent-ports-server.ts +27 -0
  78. package/lib/agent-ports.ts +68 -0
  79. package/lib/agent-readiness.ts +110 -0
  80. package/lib/agent-recreate-state.ts +108 -0
  81. package/lib/agent-recreate.ts +305 -0
  82. package/lib/agent-restore-state.ts +107 -0
  83. package/lib/agent-restore.ts +135 -0
  84. package/lib/agent-setup.ts +66 -17
  85. package/lib/agent-update-state.ts +122 -0
  86. package/lib/agent-update.ts +448 -0
  87. package/lib/agent-versions.json +14 -0
  88. package/lib/agent-versions.ts +80 -0
  89. package/lib/buildAgentImage.ts +88 -290
  90. package/lib/channelManager.ts +153 -64
  91. package/lib/cold-backup.ts +354 -0
  92. package/lib/container-file.ts +27 -0
  93. package/lib/credentials/delivery.ts +3 -3
  94. package/lib/db-bootstrap.mjs +76 -0
  95. package/lib/docker-utils.ts +3 -3
  96. package/lib/model-catalogue.ts +140 -27
  97. package/lib/provider-balance.ts +33 -12
  98. package/lib/rev4a-paths.ts +0 -21
  99. package/model-pricing.json +118 -110
  100. package/models.config.json +27 -12
  101. package/package.json +1 -1
  102. package/app/api/gateway/route.ts +0 -191
@@ -0,0 +1,46 @@
1
+ 'use client';
2
+
3
+ /**
4
+ * Remove an item from a list.
5
+ *
6
+ * A small `×` at the end of a row, rather than a "Remove" label: the word reads
7
+ * as an action already carried out, which is wrong wherever the change only
8
+ * lands on save.
9
+ *
10
+ * One style everywhere — the `danger` treatment the credentials page already
11
+ * used. Whether the removal is immediate or pending is said in the tooltip, not
12
+ * in the colour: two tones for the same gesture made the button look like two
13
+ * different controls.
14
+ *
15
+ * Deliberately separate from dismissing a dialog, which looks similar and means
16
+ * something else. See rule 8 in docs/FRONTEND-ARCHITECTURE.md.
17
+ */
18
+ import { Button } from './Button';
19
+
20
+ export function RemoveButton({
21
+ onClick,
22
+ label,
23
+ disabled,
24
+ title,
25
+ }: {
26
+ onClick: () => void;
27
+ /** What is being removed. Becomes the accessible name: "Remove <label>". */
28
+ label: string;
29
+ disabled?: boolean;
30
+ /** Override when the consequence is worth spelling out, e.g. a pending edit. */
31
+ title?: string;
32
+ }) {
33
+ return (
34
+ <Button
35
+ type="button"
36
+ variant="danger"
37
+ size="sm"
38
+ disabled={disabled}
39
+ aria-label={`Remove ${label}`}
40
+ title={title ?? `Remove ${label}`}
41
+ onClick={onClick}
42
+ >
43
+ ×
44
+ </Button>
45
+ );
46
+ }
@@ -5,7 +5,8 @@ import { useId, type SelectHTMLAttributes, type ReactNode } from 'react';
5
5
  interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
6
6
  label?: string;
7
7
  error?: string;
8
- options: { value: string; label: ReactNode }[];
8
+ /** `disabled` shows a value that exists but may not be chosen, e.g. a current setting no longer on offer. */
9
+ options: { value: string; label: ReactNode; disabled?: boolean }[];
9
10
  }
10
11
 
11
12
  export function Select({ label, error, options, id, className = '', ...rest }: SelectProps) {
@@ -17,7 +18,7 @@ export function Select({ label, error, options, id, className = '', ...rest }: S
17
18
  {label && <label className="ui-field__label" htmlFor={selectId}>{label}</label>}
18
19
  <select id={selectId} className={`ui-select ${error ? 'ui-select--error' : ''} ${className}`} {...rest}>
19
20
  {options.map((o) => (
20
- <option key={o.value} value={o.value}>{o.label}</option>
21
+ <option key={o.value} value={o.value} disabled={o.disabled}>{o.label}</option>
21
22
  ))}
22
23
  </select>
23
24
  {error && <div className="ui-field__error">{error}</div>}
@@ -1,6 +1,7 @@
1
1
  export * from './ConfirmModal';
2
2
  export * from './Badge';
3
3
  export * from './Button';
4
+ export * from './RemoveButton';
4
5
  export * from './FilterBar';
5
6
  export * from './Input';
6
7
  export * from './LoadingSpinner';
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { useState, useEffect, useCallback, useRef } from 'react';
4
- import { Page, PageHeader, Button, Modal, Input, Pill } from '@/app/components/ui';
4
+ import { Page, PageHeader, Button, Modal, Input, Pill, RemoveButton } from '@/app/components/ui';
5
5
  import { CredentialCardsSkeleton, AgentSyncRowsSkeleton } from '@/app/components/Skeleton';
6
6
  import type { CredentialProfile } from '@/lib/credentials/vault';
7
7
  import type { CredentialProviderDef } from '@/lib/credentials/providers';
@@ -499,7 +499,7 @@ export default function CredentialsPageClient() {
499
499
  && !detectFailed
500
500
  && !detectData.some((d) => d.error)
501
501
  && !detectData.some((d) => d.matchedProfiles?.some((m) => m.profileId === p.id)) && (
502
- <Button type="button" variant="danger" size="sm" disabled={!!busy} onClick={() => setDeleteId(p.id)}>×</Button>
502
+ <RemoveButton label={p.label ?? p.id} disabled={!!busy} onClick={() => setDeleteId(p.id)} />
503
503
  )}
504
504
  </div>
505
505
  </div>