@antelopejs/dms-ai 0.1.4 → 0.1.5
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/README.md +48 -29
- package/dist/channels/bridge.d.ts +2 -8
- package/dist/channels/bridge.js +26 -42
- package/dist/channels/bridge.js.map +1 -1
- package/dist/channels/channel-service.d.ts +2 -2
- package/dist/channels/channel-service.js +12 -31
- package/dist/channels/channel-service.js.map +1 -1
- package/dist/channels/registry.d.ts +2 -2
- package/dist/channels/registry.js +7 -7
- package/dist/channels/registry.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.js +8 -1
- package/dist/config.js.map +1 -1
- package/dist/constants/channels.d.ts +5 -10
- package/dist/constants/channels.js +6 -10
- package/dist/constants/channels.js.map +1 -1
- package/dist/constants/sidecar.d.ts +2 -1
- package/dist/constants/sidecar.js +3 -2
- package/dist/constants/sidecar.js.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/lifecycle/build-id.d.ts +1 -0
- package/dist/lifecycle/build-id.js +32 -0
- package/dist/lifecycle/build-id.js.map +1 -0
- package/dist/lifecycle/sidecar-socket.d.ts +1 -1
- package/dist/lifecycle/sidecar-socket.js +2 -2
- package/dist/lifecycle/sidecar-socket.js.map +1 -1
- package/dist/lifecycle/spawn-sidecar.d.ts +0 -1
- package/dist/lifecycle/spawn-sidecar.js +5 -27
- package/dist/lifecycle/spawn-sidecar.js.map +1 -1
- package/dist/routes/channels.d.ts +3 -3
- package/dist/routes/channels.js +11 -12
- package/dist/routes/channels.js.map +1 -1
- package/dist/routes/index.d.ts +0 -1
- package/dist/routes/index.js +0 -1
- package/dist/routes/index.js.map +1 -1
- package/frontend-vue/.prettierignore +3 -0
- package/frontend-vue/.prettierrc +10 -0
- package/frontend-vue/app/chat/components/ChatView.vue +582 -0
- package/frontend-vue/app/chat/components/ComposerInput.vue +742 -0
- package/frontend-vue/app/chat/components/ConnectionBanner.vue +105 -0
- package/frontend-vue/app/chat/components/ConversationDrawer.vue +266 -0
- package/frontend-vue/app/chat/components/MarkdownContent.vue +196 -0
- package/frontend-vue/app/chat/components/MessageList.vue +474 -0
- package/frontend-vue/app/chat/components/PermissionRequests.vue +323 -0
- package/frontend-vue/app/chat/components/QuestionPrompt.vue +275 -0
- package/frontend-vue/app/chat/components/QueuedMessages.vue +109 -0
- package/frontend-vue/app/chat/components/TodoList.vue +291 -0
- package/frontend-vue/app/chat/components/ToolCallEntry.vue +218 -0
- package/frontend-vue/app/chat/components/ToolCluster.vue +282 -0
- package/frontend-vue/app/chat/composables/useChatChannel.ts +116 -0
- package/frontend-vue/app/chat/composables/useConversation.ts +838 -0
- package/frontend-vue/app/chat/composables/useConversationId.ts +34 -0
- package/frontend-vue/app/chat/composables/useConversationList.ts +56 -0
- package/frontend-vue/app/chat/composables/usePermissionQueue.ts +59 -0
- package/frontend-vue/app/chat/composables/useQuestionQueue.ts +50 -0
- package/frontend-vue/app/chat/composables/useRunClock.ts +28 -0
- package/frontend-vue/app/chat/composables/useSettings.ts +67 -0
- package/frontend-vue/app/chat/constants/attachments.ts +16 -0
- package/frontend-vue/app/chat/constants/connection-banner.ts +7 -0
- package/frontend-vue/app/chat/constants/conversation-drawer.ts +13 -0
- package/frontend-vue/app/chat/constants/conversation.ts +75 -0
- package/frontend-vue/app/chat/constants/permissions.ts +50 -0
- package/frontend-vue/app/chat/constants/protocol.ts +48 -0
- package/frontend-vue/app/chat/constants/run-status.ts +50 -0
- package/frontend-vue/app/chat/constants/settings.ts +60 -0
- package/frontend-vue/app/chat/types/conversation.ts +87 -0
- package/frontend-vue/app/chat/types/permission.ts +7 -0
- package/frontend-vue/app/chat/types/question.ts +17 -0
- package/frontend-vue/app/chat/types/settings.ts +27 -0
- package/frontend-vue/app/chat/utils/attachments.ts +62 -0
- package/frontend-vue/app/chat/utils/format.ts +14 -0
- package/frontend-vue/app/chat/utils/ids.ts +34 -0
- package/frontend-vue/app/chat/utils/markdown.ts +188 -0
- package/frontend-vue/app/chat/utils/run-status.ts +90 -0
- package/frontend-vue/app/chat/utils/todos.ts +64 -0
- package/frontend-vue/app/chat/utils/tool-summary.ts +53 -0
- package/frontend-vue/app/components/ActivityView.vue +34 -34
- package/frontend-vue/app/components/ChatPanel.vue +276 -0
- package/frontend-vue/app/components/SettingsView.vue +120 -112
- package/frontend-vue/app/components/SkillsView.vue +55 -53
- package/frontend-vue/app/plugins/ai.client.ts +145 -129
- package/frontend-vue/app/runtime/assistant-session.ts +21 -0
- package/frontend-vue/app/runtime/backoff.ts +11 -14
- package/frontend-vue/app/runtime/channel-client.ts +130 -141
- package/frontend-vue/app/runtime/chat-transport.ts +25 -55
- package/frontend-vue/app/runtime/constants.ts +69 -59
- package/frontend-vue/app/runtime/current-page.ts +49 -15
- package/frontend-vue/app/runtime/event-stream.ts +35 -35
- package/frontend-vue/app/runtime/frame-router.ts +30 -0
- package/frontend-vue/app/runtime/header-action.ts +18 -18
- package/frontend-vue/app/runtime/host-commands.ts +57 -56
- package/frontend-vue/app/runtime/listeners.ts +31 -0
- package/frontend-vue/app/runtime/navigation-complete.ts +7 -7
- package/frontend-vue/app/runtime/overlay-prefs.ts +36 -36
- package/frontend-vue/app/runtime/panel-state.ts +88 -0
- package/frontend-vue/app/runtime/session-gate.ts +8 -8
- package/frontend-vue/app/runtime/shortcuts.ts +12 -12
- package/frontend-vue/app/runtime/sidecar-status.ts +61 -61
- package/frontend-vue/app/runtime/typed-message.ts +11 -0
- package/frontend-vue/dms.frontend.ts +12 -12
- package/frontend-vue/eslint.config.mjs +13 -13
- package/frontend-vue/package.json +11 -4
- package/frontend-vue/pnpm-lock.yaml +298 -96
- package/frontend-vue/tests/backoff.test.ts +26 -30
- package/frontend-vue/tests/channel-client.test.ts +187 -188
- package/frontend-vue/tests/chat/markdown.test.ts +271 -0
- package/frontend-vue/tests/chat/useChatChannel.test.ts +124 -0
- package/frontend-vue/tests/chat/useConversation.test.ts +283 -0
- package/frontend-vue/tests/chat-panel.test.ts +354 -0
- package/frontend-vue/tests/chat-transport.test.ts +84 -57
- package/frontend-vue/tests/host-commands.test.ts +126 -87
- package/frontend-vue/tests/navigation.test.ts +65 -34
- package/frontend-vue/tests/overlay-prefs.test.ts +49 -49
- package/frontend-vue/tests/panel-state.test.ts +58 -0
- package/frontend-vue/tests/session-gate.test.ts +33 -33
- package/frontend-vue/tests/sidecar-guest.test.ts +46 -46
- package/frontend-vue/tests/sidecar-status.test.ts +29 -29
- package/frontend-vue/tsconfig.chat.json +16 -0
- package/frontend-vue/vitest.config.ts +6 -4
- package/package.json +5 -5
- package/sidecar/dist/agent/effective-mode.d.ts +2 -2
- package/sidecar/dist/agent/effective-mode.js +1 -1
- package/sidecar/dist/agent/effective-mode.js.map +1 -1
- package/sidecar/dist/agent/host-context.js +7 -9
- package/sidecar/dist/agent/host-context.js.map +1 -1
- package/sidecar/dist/agent/permission-bus.d.ts +1 -1
- package/sidecar/dist/agent/permission-bus.js +2 -2
- package/sidecar/dist/agent/permission-bus.js.map +1 -1
- package/sidecar/dist/agent/provider.d.ts +2 -2
- package/sidecar/dist/agent/question-bus.d.ts +1 -1
- package/sidecar/dist/agent/question-bus.js +2 -2
- package/sidecar/dist/agent/question-bus.js.map +1 -1
- package/sidecar/dist/agent/runner.d.ts +2 -2
- package/sidecar/dist/agent/runner.js +24 -8
- package/sidecar/dist/agent/runner.js.map +1 -1
- package/sidecar/dist/agent/session.d.ts +2 -2
- package/sidecar/dist/agent/session.js +49 -9
- package/sidecar/dist/agent/session.js.map +1 -1
- package/sidecar/dist/agent/switching-runner.js +10 -5
- package/sidecar/dist/agent/switching-runner.js.map +1 -1
- package/sidecar/dist/agent/turn-end-reasons.d.ts +2 -0
- package/sidecar/dist/agent/turn-end-reasons.js +6 -1
- package/sidecar/dist/agent/turn-end-reasons.js.map +1 -1
- package/sidecar/dist/constants/agent.d.ts +4 -1
- package/sidecar/dist/constants/agent.js +4 -1
- package/sidecar/dist/constants/agent.js.map +1 -1
- package/sidecar/dist/constants/cli.d.ts +0 -1
- package/sidecar/dist/constants/cli.js +0 -1
- package/sidecar/dist/constants/cli.js.map +1 -1
- package/sidecar/dist/constants/codex.d.ts +5 -2
- package/sidecar/dist/constants/codex.js +5 -2
- package/sidecar/dist/constants/codex.js.map +1 -1
- package/sidecar/dist/constants/http.d.ts +0 -9
- package/sidecar/dist/constants/http.js +0 -19
- package/sidecar/dist/constants/http.js.map +1 -1
- package/sidecar/dist/constants/mcp.d.ts +1 -1
- package/sidecar/dist/constants/mcp.js +1 -1
- package/sidecar/dist/constants/mcp.js.map +1 -1
- package/sidecar/dist/constants/paths.d.ts +0 -1
- package/sidecar/dist/constants/paths.js +0 -1
- package/sidecar/dist/constants/paths.js.map +1 -1
- package/sidecar/dist/constants/ws.d.ts +3 -4
- package/sidecar/dist/constants/ws.js +3 -4
- package/sidecar/dist/constants/ws.js.map +1 -1
- package/sidecar/dist/index.d.ts +0 -1
- package/sidecar/dist/index.js +6 -10
- package/sidecar/dist/index.js.map +1 -1
- package/sidecar/dist/mcp/tools/find-pages-using.js +5 -10
- package/sidecar/dist/mcp/tools/find-pages-using.js.map +1 -1
- package/sidecar/dist/mcp/types.d.ts +1 -1
- package/sidecar/dist/pages/page-filepath.d.ts +4 -0
- package/sidecar/dist/pages/page-filepath.js +28 -0
- package/sidecar/dist/pages/page-filepath.js.map +1 -0
- package/sidecar/dist/prompts/agent.d.ts +1 -1
- package/sidecar/dist/prompts/agent.js +1 -1
- package/sidecar/dist/prompts/agent.js.map +1 -1
- package/sidecar/dist/protocol/events.js +2 -2
- package/sidecar/dist/protocol/events.js.map +1 -1
- package/sidecar/dist/protocol/messages.d.ts +4 -15
- package/sidecar/dist/protocol/messages.js +4 -11
- package/sidecar/dist/protocol/messages.js.map +1 -1
- package/sidecar/dist/providers/claude/config.d.ts +2 -2
- package/sidecar/dist/providers/claude/config.js +2 -2
- package/sidecar/dist/providers/claude/config.js.map +1 -1
- package/sidecar/dist/providers/claude/provider.js +1 -1
- package/sidecar/dist/providers/claude/provider.js.map +1 -1
- package/sidecar/dist/providers/codex/config.d.ts +3 -2
- package/sidecar/dist/providers/codex/config.js +3 -3
- package/sidecar/dist/providers/codex/config.js.map +1 -1
- package/sidecar/dist/providers/codex/process.js +107 -74
- package/sidecar/dist/providers/codex/process.js.map +1 -1
- package/sidecar/dist/providers/codex/provider.js +68 -31
- package/sidecar/dist/providers/codex/provider.js.map +1 -1
- package/sidecar/dist/providers/codex/skills.d.ts +1 -0
- package/sidecar/dist/providers/codex/skills.js +4 -1
- package/sidecar/dist/providers/codex/skills.js.map +1 -1
- package/sidecar/dist/providers/codex/stop.d.ts +4 -0
- package/sidecar/dist/providers/codex/stop.js +71 -0
- package/sidecar/dist/providers/codex/stop.js.map +1 -0
- package/sidecar/dist/server/{iframe-socket-registry.d.ts → chat-socket-registry.d.ts} +3 -2
- package/sidecar/dist/server/{iframe-socket-registry.js → chat-socket-registry.js} +4 -3
- package/sidecar/dist/server/chat-socket-registry.js.map +1 -0
- package/sidecar/dist/server/client-auth.js +2 -14
- package/sidecar/dist/server/client-auth.js.map +1 -1
- package/sidecar/dist/server/host-command-router.d.ts +5 -0
- package/sidecar/dist/server/host-command-router.js +4 -0
- package/sidecar/dist/server/host-command-router.js.map +1 -0
- package/sidecar/dist/server/host-socket-registry.d.ts +1 -1
- package/sidecar/dist/server/host-socket-registry.js +16 -13
- package/sidecar/dist/server/host-socket-registry.js.map +1 -1
- package/sidecar/dist/server/http.d.ts +0 -1
- package/sidecar/dist/server/http.js +1 -44
- package/sidecar/dist/server/http.js.map +1 -1
- package/sidecar/dist/server/routing.d.ts +5 -6
- package/sidecar/dist/server/routing.js +18 -28
- package/sidecar/dist/server/routing.js.map +1 -1
- package/sidecar/dist/server/ws.d.ts +2 -2
- package/sidecar/dist/server/ws.js +41 -39
- package/sidecar/dist/server/ws.js.map +1 -1
- package/sidecar/dist/state/host-state.d.ts +10 -2
- package/sidecar/dist/state/host-state.js +13 -3
- package/sidecar/dist/state/host-state.js.map +1 -1
- package/sidecar/dist/state/settings-store.js +2 -2
- package/sidecar/dist/state/settings-store.js.map +1 -1
- package/sidecar/dist/state/settings-types.d.ts +3 -3
- package/sidecar/dist/state/settings-types.js +1 -1
- package/sidecar/dist/state/settings-types.js.map +1 -1
- package/sidecar/package.json +3 -5
- package/dist/chatbox/passthrough.d.ts +0 -3
- package/dist/chatbox/passthrough.js +0 -53
- package/dist/chatbox/passthrough.js.map +0 -1
- package/dist/constants/chatbox.d.ts +0 -10
- package/dist/constants/chatbox.js +0 -35
- package/dist/constants/chatbox.js.map +0 -1
- package/dist/routes/chatbox.d.ts +0 -7
- package/dist/routes/chatbox.js +0 -47
- package/dist/routes/chatbox.js.map +0 -1
- package/frontend-vue/app/runtime/overlay.ts +0 -400
- package/frontend-vue/app/runtime/theme-bridge.ts +0 -189
- package/sidecar/chatbox/dist/assets/index-C8u7mkHn.css +0 -1
- package/sidecar/chatbox/dist/assets/index-tdZvY7ee.js +0 -52
- package/sidecar/chatbox/dist/index.html +0 -13
- package/sidecar/dist/server/iframe-socket-registry.js.map +0 -1
package/README.md
CHANGED
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
An AntelopeJS DMS development assistant. It adds an owner-only AI workspace to the dashboard and
|
|
10
10
|
runs a coding agent in a local sidecar that can inspect the loaded modules and their declared skills,
|
|
11
|
-
edit the host project, and stream activity back to the dashboard.
|
|
12
|
-
|
|
11
|
+
edit the host project, and stream activity back to the dashboard. The chat is a panel of the
|
|
12
|
+
dashboard itself: it stays open across page navigations, follows the dashboard's theme, and is toggled
|
|
13
|
+
from the header or with Ctrl+Shift+K (⌘⇧K on macOS). Claude Code drives it by default; OpenAI's Codex
|
|
14
|
+
is selectable once its CLI is installed.
|
|
13
15
|
|
|
14
16
|
## Installation
|
|
15
17
|
|
|
@@ -35,34 +37,50 @@ therefore works wherever the dashboard does — another machine on the LAN, Tail
|
|
|
35
37
|
the frontend port, a reverse proxy or a gateway — and the sidecar's port and client credential stay on
|
|
36
38
|
the server.
|
|
37
39
|
|
|
38
|
-
| Route (owner only)
|
|
39
|
-
|
|
|
40
|
-
| `GET /ai/
|
|
41
|
-
| `POST /ai/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Browsers keep at most six HTTP/1.1
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
`DMS_COOKIE_SECURE=false`, or the browser drops the
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
40
|
+
| Route (owner only) | Purpose |
|
|
41
|
+
| ----------------------------------------- | --------------------------------------------------------------------------- |
|
|
42
|
+
| `GET /ai/channel/events` | The tab's one event stream: the sidecar frames for the dashboard and chat. |
|
|
43
|
+
| `POST /ai/channel/:connectionId/messages` | One client message, relayed to that stream's sidecar socket. |
|
|
44
|
+
|
|
45
|
+
Each stream is bridged to a single sidecar socket, which the dashboard identifies as the host (the
|
|
46
|
+
current page, the agent's navigation requests) and as the chat. Browsers keep at most six HTTP/1.1
|
|
47
|
+
connections per origin, and every dashboard tab already holds two long-lived ones for the DMS. The
|
|
48
|
+
assistant adds its stream only in the visible tab whose panel is open, which leaves two dashboard tabs
|
|
49
|
+
usable side by side; over HTTPS with HTTP/2 the limit goes away. Over plain HTTP on an address other
|
|
50
|
+
than `localhost`, start the frontend server with `DMS_COOKIE_SECURE=false`, or the browser drops the
|
|
51
|
+
`Secure` session cookie.
|
|
52
|
+
|
|
53
|
+
## Model output in the dashboard
|
|
54
|
+
|
|
55
|
+
The chat renders model output inside the dashboard, next to the owner's session, and that output can
|
|
56
|
+
carry a prompt injection read from a file or a page. So nothing the agent writes is trusted as markup:
|
|
57
|
+
|
|
58
|
+
- Markdown is rendered with raw HTML off, then sanitized by a DOMPurify instance of the chat's own
|
|
59
|
+
(hooks do not leak to the dashboard's), against an allowlist: text formatting, lists, quotes, code,
|
|
60
|
+
tables and links, and no attribute but `href`, `title`, `target`, `rel` and `start` — no `style`,
|
|
61
|
+
`class`, `id` or event handler.
|
|
62
|
+
- Links only go to `http`, `https`, `mailto` or a page of the dashboard, never `javascript:` or
|
|
63
|
+
`data:`, and open in a new tab with `rel="noopener noreferrer"`.
|
|
64
|
+
- An image the model writes is shown as a link: loading it on its own could send what the agent read
|
|
65
|
+
to its address.
|
|
66
|
+
- The agent can only navigate the dashboard to one of its own pages.
|
|
67
|
+
|
|
68
|
+
## Sidecar
|
|
69
|
+
|
|
70
|
+
The sidecar is an agent server only: `/health`, the settings, metrics and skills routes the backend
|
|
71
|
+
proxies, the MCP endpoint of its agents, and one WebSocket endpoint, `/ws`, which only accepts the
|
|
72
|
+
client credential as a `Bearer` header. It serves no page or asset. Run by hand (`node
|
|
73
|
+
sidecar/dist/index.js --port 0 --root <dir>`), it keeps its standalone default for the backend
|
|
74
|
+
origin, which is how its tests drive it.
|
|
55
75
|
|
|
56
76
|
## Configuration
|
|
57
77
|
|
|
58
|
-
|
|
59
|
-
(`http://localhost:5010`
|
|
60
|
-
already has.
|
|
78
|
+
The key is optional. Left out, the sidecar keeps the default it uses when run standalone
|
|
79
|
+
(`http://localhost:5010`), which is the behaviour every existing project already has.
|
|
61
80
|
|
|
62
81
|
| Key | What it is |
|
|
63
82
|
| ------------ | ------------------------------------------------------------------------------ |
|
|
64
83
|
| `backendUrl` | Origin the sidecar calls the DMS backend on — its pages registry, logs and builder clients. |
|
|
65
|
-
| `hostOrigin` | Origin the DMS frontend is served from. |
|
|
66
84
|
|
|
67
85
|
The api module publishes the origin it actually reserved, so `backendUrl` should reference it rather
|
|
68
86
|
than repeat a port that may already be taken:
|
|
@@ -74,16 +92,12 @@ export default defineConfig({
|
|
|
74
92
|
source: { type: "package", package: "@antelopejs/dms-ai" },
|
|
75
93
|
config: {
|
|
76
94
|
backendUrl: "${@api.API_LOCAL_BASE_URL}",
|
|
77
|
-
hostOrigin: "http://localhost:3001",
|
|
78
95
|
},
|
|
79
96
|
},
|
|
80
97
|
},
|
|
81
98
|
});
|
|
82
99
|
```
|
|
83
100
|
|
|
84
|
-
`hostOrigin` is the *frontend* origin, which the api module cannot publish: write it out, using the
|
|
85
|
-
same value as `dms`'s `clientBaseUrl`.
|
|
86
|
-
|
|
87
101
|
## Agent providers
|
|
88
102
|
|
|
89
103
|
The assistant runs on either Claude Code or Codex, picked in the AI settings page. Both go through
|
|
@@ -154,14 +168,19 @@ of the app-server with it.
|
|
|
154
168
|
|
|
155
169
|
## Vue frontend
|
|
156
170
|
|
|
157
|
-
The module registers `frontend-vue` through `AddFrontendModule` with the Vue 3 renderer. The host DMS
|
|
171
|
+
The module registers `frontend-vue` through `AddFrontendModule` with the Vue 3 renderer. The host DMS
|
|
172
|
+
supplies authentication, shared state, Nuxt UI and the icons. The chat panel, `DmsAiChatPanel`, is
|
|
173
|
+
rendered among the dashboard's persistent overlays (`dms-app-overlays`), so it lives through Inertia
|
|
174
|
+
navigations; its code is under `frontend-vue/app/chat`. The renderer bundles the icons it finds in
|
|
175
|
+
`.vue` files, so an icon name belongs in the component that shows it.
|
|
158
176
|
|
|
159
177
|
## Development
|
|
160
178
|
|
|
161
|
-
Install dependencies and run the backend and
|
|
179
|
+
Install dependencies and run the backend, sidecar and dashboard checks from the repository root:
|
|
162
180
|
|
|
163
181
|
```bash
|
|
164
182
|
pnpm install
|
|
183
|
+
pnpm --dir frontend-vue install
|
|
165
184
|
pnpm build
|
|
166
185
|
pnpm build:sidecar
|
|
167
186
|
pnpm test
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import WebSocket from "ws";
|
|
2
|
-
import { type ChannelName } from "../constants/channels";
|
|
3
2
|
import type { SseStream } from "./sse-stream";
|
|
4
3
|
export interface ChannelBridge {
|
|
5
4
|
id: string;
|
|
6
5
|
userId: string;
|
|
7
|
-
channel: ChannelName;
|
|
8
6
|
forward: (message: Buffer) => Promise<boolean>;
|
|
9
7
|
close: () => void;
|
|
10
8
|
}
|
|
11
|
-
export interface ChannelSocket {
|
|
12
|
-
channel: ChannelName;
|
|
13
|
-
socket: WebSocket;
|
|
14
|
-
}
|
|
15
9
|
export interface BridgeOptions {
|
|
16
10
|
userId: string;
|
|
17
|
-
|
|
11
|
+
socket: WebSocket;
|
|
18
12
|
stream: SseStream;
|
|
19
13
|
onOpened: (bridge: ChannelBridge) => void;
|
|
20
14
|
onClosed: (bridge: ChannelBridge) => void;
|
|
21
15
|
}
|
|
22
|
-
export declare function
|
|
16
|
+
export declare function openBridge(options: BridgeOptions): ChannelBridge;
|
package/dist/channels/bridge.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.openBridge = openBridge;
|
|
7
7
|
const node_crypto_1 = require("node:crypto");
|
|
8
8
|
const ws_1 = __importDefault(require("ws"));
|
|
9
9
|
const channels_1 = require("../constants/channels");
|
|
@@ -22,11 +22,10 @@ function forwardTo(socket, message) {
|
|
|
22
22
|
socket.send(message, { binary: false }, (error) => resolve(!error));
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
function relayFrames(
|
|
26
|
-
const { socket, bridge } = opened;
|
|
25
|
+
function relayFrames(socket, stream) {
|
|
27
26
|
let isPaused = false;
|
|
28
27
|
socket.on("message", (data) => {
|
|
29
|
-
if (stream.send(
|
|
28
|
+
if (stream.send(channels_1.CHANNEL_EVENTS.FRAME, rawDataToText(data)))
|
|
30
29
|
return;
|
|
31
30
|
if (stream.isClosed() || isPaused)
|
|
32
31
|
return;
|
|
@@ -38,50 +37,35 @@ function relayFrames(opened, stream) {
|
|
|
38
37
|
});
|
|
39
38
|
});
|
|
40
39
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
stream.send(channels_1.CHANNEL_EVENTS.READY, JSON.stringify({ connections }));
|
|
44
|
-
}
|
|
45
|
-
function openBridges(options) {
|
|
46
|
-
const { stream } = options;
|
|
40
|
+
function openBridge(options) {
|
|
41
|
+
const { socket, stream } = options;
|
|
47
42
|
let isOpen = true;
|
|
48
|
-
|
|
43
|
+
function teardown() {
|
|
49
44
|
if (!isOpen)
|
|
50
45
|
return;
|
|
51
46
|
isOpen = false;
|
|
52
47
|
stream.close();
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
options.onClosed(bridge);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
const opened = options.sockets.map(({ channel, socket }) => ({
|
|
59
|
-
socket,
|
|
60
|
-
bridge: {
|
|
61
|
-
id: (0, node_crypto_1.randomUUID)(),
|
|
62
|
-
userId: options.userId,
|
|
63
|
-
channel,
|
|
64
|
-
forward: (message) => forwardTo(socket, message),
|
|
65
|
-
close: teardown,
|
|
66
|
-
},
|
|
67
|
-
}));
|
|
68
|
-
for (const { bridge } of opened)
|
|
69
|
-
options.onOpened(bridge);
|
|
70
|
-
for (const { socket } of opened) {
|
|
71
|
-
socket.on("error", () => undefined);
|
|
72
|
-
socket.once("close", () => {
|
|
73
|
-
if (!isOpen)
|
|
74
|
-
return;
|
|
75
|
-
stream.send(channels_1.CHANNEL_EVENTS.SIDECAR_DOWN, EMPTY_PAYLOAD);
|
|
76
|
-
teardown();
|
|
77
|
-
});
|
|
48
|
+
socket.close(channels_1.BRIDGE_CLOSE_CODE);
|
|
49
|
+
options.onClosed(bridge);
|
|
78
50
|
}
|
|
51
|
+
const bridge = {
|
|
52
|
+
id: (0, node_crypto_1.randomUUID)(),
|
|
53
|
+
userId: options.userId,
|
|
54
|
+
forward: (message) => forwardTo(socket, message),
|
|
55
|
+
close: teardown,
|
|
56
|
+
};
|
|
57
|
+
options.onOpened(bridge);
|
|
58
|
+
socket.on("error", () => undefined);
|
|
59
|
+
socket.once("close", () => {
|
|
60
|
+
if (!isOpen)
|
|
61
|
+
return;
|
|
62
|
+
stream.send(channels_1.CHANNEL_EVENTS.SIDECAR_DOWN, EMPTY_PAYLOAD);
|
|
63
|
+
teardown();
|
|
64
|
+
});
|
|
79
65
|
stream.onClose(teardown);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
socket.resume();
|
|
85
|
-
return opened.map(({ bridge }) => bridge);
|
|
66
|
+
relayFrames(socket, stream);
|
|
67
|
+
stream.send(channels_1.CHANNEL_EVENTS.READY, JSON.stringify({ connectionId: bridge.id }));
|
|
68
|
+
socket.resume();
|
|
69
|
+
return bridge;
|
|
86
70
|
}
|
|
87
71
|
//# sourceMappingURL=bridge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../src/channels/bridge.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../src/channels/bridge.ts"],"names":[],"mappings":";;;;;AA4DA,gCA+BC;AA3FD,6CAAyC;AACzC,4CAA6C;AAC7C,oDAA0E;AAG1E,MAAM,aAAa,GAAG,IAAI,CAAC;AAqB3B,SAAS,aAAa,CAAC,IAAa;IAClC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACrE,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,SAAS,CAAC,MAAiB,EAAE,OAAe;IACnD,IAAI,MAAM,CAAC,UAAU,KAAK,YAAS,CAAC,IAAI;QAAE,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACxE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,E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O,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;QAChD,KAAK,EAAE,QAAQ;KAChB,CAAC;IACF,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACzB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACpC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE;QACxB,IAAI,CAAC,MAAM;YAAE,OAAO;QACpB,MAAM,CAAC,IAAI,CAAC,yBAAc,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;QACxD,QAAQ,EAAE,CAAC;IACb,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,MAAM,CAAC,IAAI,CACT,yBAAc,CAAC,KAAK,EACpB,IAAI,CAAC,SAAS,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAC5C,CAAC;IACF,MAAM,CAAC,MAAM,EAAE,CAAC;IAChB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTTPResult, type RequestContext } from "@antelopejs/interface-api";
|
|
2
2
|
import type WebSocket from "ws";
|
|
3
|
-
export type SidecarConnector = (
|
|
4
|
-
export declare function openChannel(ctx: RequestContext,
|
|
3
|
+
export type SidecarConnector = () => Promise<WebSocket>;
|
|
4
|
+
export declare function openChannel(ctx: RequestContext, userId: string, connect?: SidecarConnector): Promise<HTTPResult | undefined>;
|
|
5
5
|
export declare function postChannelMessage(connectionId: string, userId: string, message: Buffer): Promise<HTTPResult>;
|
|
@@ -9,46 +9,27 @@ const sidecar_socket_1 = require("../lifecycle/sidecar-socket");
|
|
|
9
9
|
const bridge_1 = require("./bridge");
|
|
10
10
|
const registry_1 = require("./registry");
|
|
11
11
|
const sse_stream_1 = require("./sse-stream");
|
|
12
|
-
const UNKNOWN_CHANNEL = { error: "unknown_channel" };
|
|
13
12
|
const UNKNOWN_CONNECTION = { error: "unknown_connection" };
|
|
14
13
|
const TOO_MANY_STREAMS = { error: "too_many_streams" };
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (new Set(names).size !== names.length)
|
|
21
|
-
return null;
|
|
22
|
-
if (!names.every(isChannelName))
|
|
14
|
+
async function tryConnect(connect) {
|
|
15
|
+
try {
|
|
16
|
+
return await connect();
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
23
19
|
return null;
|
|
24
|
-
return names;
|
|
25
|
-
}
|
|
26
|
-
async function connectAll(connect, channels) {
|
|
27
|
-
const attempts = await Promise.allSettled(channels.map((channel) => connect(channels_1.CHANNEL_SIDECAR_PATHS[channel])));
|
|
28
|
-
const sockets = attempts.flatMap((attempt, index) => attempt.status === "fulfilled"
|
|
29
|
-
? [{ channel: channels[index], socket: attempt.value }]
|
|
30
|
-
: []);
|
|
31
|
-
if (sockets.length === channels.length)
|
|
32
|
-
return sockets;
|
|
33
|
-
for (const { socket } of sockets)
|
|
34
|
-
socket.terminate();
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
async function openChannel(ctx, channels, userId, connect = sidecar_socket_1.connectSidecarSocket) {
|
|
38
|
-
const names = parseChannels(channels);
|
|
39
|
-
if (names === null) {
|
|
40
|
-
return new interface_api_1.HTTPResult(channels_1.CHANNEL_STATUS.NOT_FOUND, UNKNOWN_CHANNEL);
|
|
41
20
|
}
|
|
42
|
-
|
|
21
|
+
}
|
|
22
|
+
async function openChannel(ctx, userId, connect = sidecar_socket_1.connectSidecarSocket) {
|
|
23
|
+
if (!(0, registry_1.reserveSocket)(userId, channels_1.CHANNEL_MAX_SOCKETS_PER_USER)) {
|
|
43
24
|
return new interface_api_1.HTTPResult(channels_1.CHANNEL_STATUS.TOO_MANY_REQUESTS, TOO_MANY_STREAMS);
|
|
44
25
|
}
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
26
|
+
const socket = await tryConnect(connect).finally(() => (0, registry_1.releaseSocket)(userId));
|
|
27
|
+
if (socket === null) {
|
|
47
28
|
return new interface_api_1.HTTPResult(channels_1.CHANNEL_STATUS.SERVICE_UNAVAILABLE, sidecar_1.SIDECAR_UNAVAILABLE_BODY);
|
|
48
29
|
}
|
|
49
|
-
(0, bridge_1.
|
|
30
|
+
(0, bridge_1.openBridge)({
|
|
50
31
|
userId,
|
|
51
|
-
|
|
32
|
+
socket,
|
|
52
33
|
stream: (0, sse_stream_1.openSseStream)(ctx),
|
|
53
34
|
onOpened: registry_1.trackBridge,
|
|
54
35
|
onClosed: registry_1.forgetBridge,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel-service.js","sourceRoot":"","sources":["../../src/channels/channel-service.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"channel-service.js","sourceRoot":"","sources":["../../src/channels/channel-service.ts"],"names":[],"mappings":";;AAwCA,kCAuBC;AAOD,gDAgBC;AAtFD,6DAA4E;AAE5E,oDAG+B;AAC/B,kDAAgE;AAChE,gEAAmE;AACnE,qCAAsC;AACtC,yCAMoB;AACpB,6CAA6C;AAK7C,MAAM,kBAAkB,GAAG,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC;AAC3D,MAAM,gBAAgB,GAAG,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC;AAEvD,KAAK,UAAU,UAAU,CACvB,OAAyB;IAEzB,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,EAAE,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAQM,KAAK,UAAU,WAAW,CAC/B,GAAmB,EACnB,MAAc,EACd,UAA4B,qCAAoB;IAEhD,IAAI,CAAC,IAAA,wBAAa,EAAC,MAAM,EAAE,uCAA4B,CAAC,EAAE,CAAC;QACzD,OAAO,IAAI,0BAAU,CAAC,yBAAc,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;IAC5E,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAA,wBAAa,EAAC,MAAM,CAAC,CAAC,CAAC;IAC9E,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,IAAI,0BAAU,CACnB,yBAAc,CAAC,mBAAmB,EAClC,kCAAwB,CACzB,CAAC;IACJ,CAAC;IACD,IAAA,mBAAU,EAAC;QACT,MAAM;QACN,MAAM;QACN,MAAM,EAAE,IAAA,0BAAa,EAAC,GAAG,CAAC;QAC1B,QAAQ,EAAE,sBAAW;QACrB,QAAQ,EAAE,uBAAY;KACvB,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC;AAOM,KAAK,UAAU,kBAAkB,CACtC,YAAoB,EACpB,MAAc,EACd,OAAe;IAEf,MAAM,MAAM,GAAG,IAAA,0BAAe,EAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IACrD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,IAAI,0BAAU,CAAC,yBAAc,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;IACtE,CAAC;IACD,IAAI,CAAC,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;QACrC,OAAO,IAAI,0BAAU,CACnB,yBAAc,CAAC,mBAAmB,EAClC,kCAAwB,CACzB,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,0BAAU,CAAC,yBAAc,CAAC,QAAQ,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChannelBridge } from "./bridge";
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
2
|
+
export declare function reserveSocket(userId: string, limit: number): boolean;
|
|
3
|
+
export declare function releaseSocket(userId: string): void;
|
|
4
4
|
export declare function trackBridge(bridge: ChannelBridge): void;
|
|
5
5
|
export declare function forgetBridge(bridge: ChannelBridge): void;
|
|
6
6
|
export declare function findOwnedBridge(connectionId: string, userId: string): ChannelBridge | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.reserveSocket = reserveSocket;
|
|
4
|
+
exports.releaseSocket = releaseSocket;
|
|
5
5
|
exports.trackBridge = trackBridge;
|
|
6
6
|
exports.forgetBridge = forgetBridge;
|
|
7
7
|
exports.findOwnedBridge = findOwnedBridge;
|
|
@@ -16,14 +16,14 @@ function openSocketsOf(userId) {
|
|
|
16
16
|
}
|
|
17
17
|
return count;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
if (openSocketsOf(userId)
|
|
19
|
+
function reserveSocket(userId, limit) {
|
|
20
|
+
if (openSocketsOf(userId) >= limit)
|
|
21
21
|
return false;
|
|
22
|
-
pendingSockets.set(userId, (pendingSockets.get(userId) ?? 0) +
|
|
22
|
+
pendingSockets.set(userId, (pendingSockets.get(userId) ?? 0) + 1);
|
|
23
23
|
return true;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
const left = (pendingSockets.get(userId) ?? 0) -
|
|
25
|
+
function releaseSocket(userId) {
|
|
26
|
+
const left = (pendingSockets.get(userId) ?? 0) - 1;
|
|
27
27
|
if (left > 0)
|
|
28
28
|
pendingSockets.set(userId, left);
|
|
29
29
|
else
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/channels/registry.ts"],"names":[],"mappings":";;AAcA,
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/channels/registry.ts"],"names":[],"mappings":";;AAcA,sCAIC;AAGD,sCAIC;AAED,kCAEC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B,eAAe,CAC7B,YAAoB,EACpB,MAAc;IAEd,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACzC,OAAO,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACxD,CAAC;AAGD,SAAgB,eAAe;IAC7B,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,MAAM,EAAE;QAAE,MAAM,CAAC,KAAK,EAAE,CAAC;IACtD,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ export interface AIConfig {
|
|
|
3
3
|
hostOrigin?: string;
|
|
4
4
|
}
|
|
5
5
|
export declare function parseConfig(raw: unknown): AIConfig;
|
|
6
|
+
export declare function hasDeprecatedHostOrigin(raw: unknown): boolean;
|
|
6
7
|
export declare function setConfig(config: AIConfig): void;
|
|
7
8
|
export declare function getConfig(): AIConfig;
|
package/dist/config.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseConfig = parseConfig;
|
|
4
|
+
exports.hasDeprecatedHostOrigin = hasDeprecatedHostOrigin;
|
|
4
5
|
exports.setConfig = setConfig;
|
|
5
6
|
exports.getConfig = getConfig;
|
|
6
|
-
const CONFIG_KEYS = ["backendUrl"
|
|
7
|
+
const CONFIG_KEYS = ["backendUrl"];
|
|
8
|
+
const DEPRECATED_HOST_ORIGIN_KEY = "hostOrigin";
|
|
7
9
|
let current = {};
|
|
8
10
|
function readOrigin(raw, key) {
|
|
9
11
|
const value = raw[key];
|
|
@@ -24,6 +26,11 @@ function parseConfig(raw) {
|
|
|
24
26
|
}
|
|
25
27
|
return parsed;
|
|
26
28
|
}
|
|
29
|
+
function hasDeprecatedHostOrigin(raw) {
|
|
30
|
+
if (raw === null || typeof raw !== "object")
|
|
31
|
+
return false;
|
|
32
|
+
return (raw[DEPRECATED_HOST_ORIGIN_KEY] !== undefined);
|
|
33
|
+
}
|
|
27
34
|
function setConfig(config) {
|
|
28
35
|
current = config;
|
|
29
36
|
}
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;AA+BA,kCASC;AAKD,0DAKC;AAED,8BAEC;AAED,8BAEC;AA9CD,MAAM,WAAW,GAAG,CAAC,YAAY,CAAU,CAAC;AAC5C,MAAM,0BAA0B,GAAG,YAAY,CAAC;AAEhD,IAAI,OAAO,GAAa,EAAE,CAAC;AAE3B,SAAS,UAAU,CACjB,GAA4B,EAC5B,GAAW;IAEX,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AAClD,CAAC;AAMD,SAAgB,WAAW,CAAC,GAAY;IACtC,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IACvD,MAAM,MAAM,GAAG,GAA8B,CAAC;IAC9C,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACvC,IAAI,MAAM,KAAK,SAAS;YAAE,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;IACjD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAKD,SAAgB,uBAAuB,CAAC,GAAY;IAClD,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC1D,OAAO,CACJ,GAA+B,CAAC,0BAA0B,CAAC,KAAK,SAAS,CAC3E,CAAC;AACJ,CAAC;AAED,SAAgB,SAAS,CAAC,MAAgB;IACxC,OAAO,GAAG,MAAM,CAAC;AACnB,CAAC;AAED,SAAgB,SAAS;IACvB,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const CHANNEL_EVENTS_ROUTE = "
|
|
1
|
+
export declare const CHANNEL_ROUTE_PREFIX = "/ai/channel";
|
|
2
|
+
export declare const CHANNEL_EVENTS_ROUTE = "/events";
|
|
3
3
|
export declare const CHANNEL_MESSAGES_ROUTE = "/:connectionId/messages";
|
|
4
|
-
export declare const CHANNELS_PARAM = "channels";
|
|
5
4
|
export declare const CONNECTION_ID_PARAM = "connectionId";
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const CHANNEL_SIDECAR_PATHS: {
|
|
8
|
-
readonly host: "/ws/host";
|
|
9
|
-
readonly chat: "/ws/iframe";
|
|
10
|
-
};
|
|
11
|
-
export type ChannelName = keyof typeof CHANNEL_SIDECAR_PATHS;
|
|
5
|
+
export declare const SIDECAR_SOCKET_PATH = "/ws";
|
|
12
6
|
export declare const CHANNEL_EVENTS: {
|
|
13
7
|
readonly READY: "ready";
|
|
8
|
+
readonly FRAME: "message";
|
|
14
9
|
readonly SIDECAR_DOWN: "sidecar_down";
|
|
15
10
|
};
|
|
16
11
|
export declare const SSE_CONTENT_TYPE = "text/event-stream";
|
|
@@ -19,7 +14,7 @@ export declare const SSE_KEEPALIVE_INTERVAL_MS = 15000;
|
|
|
19
14
|
export declare const SSE_KEEPALIVE_FRAME = ": keepalive\n\n";
|
|
20
15
|
export declare const SSE_HEADERS: Readonly<Record<string, string>>;
|
|
21
16
|
export declare const CHANNEL_MESSAGE_MAX_BYTES: number;
|
|
22
|
-
export declare const CHANNEL_MAX_SOCKETS_PER_USER =
|
|
17
|
+
export declare const CHANNEL_MAX_SOCKETS_PER_USER = 8;
|
|
23
18
|
export declare const CHANNEL_PENDING_MESSAGES_MAX_BYTES: number;
|
|
24
19
|
export declare const CHANNEL_STATUS: {
|
|
25
20
|
readonly ACCEPTED: 204;
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BRIDGE_CLOSE_CODE = exports.CHANNEL_STATUS = exports.CHANNEL_PENDING_MESSAGES_MAX_BYTES = exports.CHANNEL_MAX_SOCKETS_PER_USER = exports.CHANNEL_MESSAGE_MAX_BYTES = exports.SSE_HEADERS = exports.SSE_KEEPALIVE_FRAME = exports.SSE_KEEPALIVE_INTERVAL_MS = exports.SSE_OK_STATUS = exports.SSE_CONTENT_TYPE = exports.CHANNEL_EVENTS = exports.
|
|
3
|
+
exports.BRIDGE_CLOSE_CODE = exports.CHANNEL_STATUS = exports.CHANNEL_PENDING_MESSAGES_MAX_BYTES = exports.CHANNEL_MAX_SOCKETS_PER_USER = exports.CHANNEL_MESSAGE_MAX_BYTES = exports.SSE_HEADERS = exports.SSE_KEEPALIVE_FRAME = exports.SSE_KEEPALIVE_INTERVAL_MS = exports.SSE_OK_STATUS = exports.SSE_CONTENT_TYPE = exports.CHANNEL_EVENTS = exports.SIDECAR_SOCKET_PATH = exports.CONNECTION_ID_PARAM = exports.CHANNEL_MESSAGES_ROUTE = exports.CHANNEL_EVENTS_ROUTE = exports.CHANNEL_ROUTE_PREFIX = void 0;
|
|
4
4
|
const sidecar_1 = require("./sidecar");
|
|
5
|
-
exports.
|
|
6
|
-
exports.CHANNEL_EVENTS_ROUTE = "
|
|
5
|
+
exports.CHANNEL_ROUTE_PREFIX = "/ai/channel";
|
|
6
|
+
exports.CHANNEL_EVENTS_ROUTE = "/events";
|
|
7
7
|
exports.CHANNEL_MESSAGES_ROUTE = "/:connectionId/messages";
|
|
8
|
-
exports.CHANNELS_PARAM = "channels";
|
|
9
8
|
exports.CONNECTION_ID_PARAM = "connectionId";
|
|
10
|
-
exports.
|
|
11
|
-
exports.CHANNEL_SIDECAR_PATHS = {
|
|
12
|
-
host: "/ws/host",
|
|
13
|
-
chat: "/ws/iframe",
|
|
14
|
-
};
|
|
9
|
+
exports.SIDECAR_SOCKET_PATH = "/ws";
|
|
15
10
|
exports.CHANNEL_EVENTS = {
|
|
16
11
|
READY: "ready",
|
|
12
|
+
FRAME: "message",
|
|
17
13
|
SIDECAR_DOWN: "sidecar_down",
|
|
18
14
|
};
|
|
19
15
|
exports.SSE_CONTENT_TYPE = "text/event-stream";
|
|
@@ -26,7 +22,7 @@ exports.SSE_HEADERS = {
|
|
|
26
22
|
Connection: "keep-alive",
|
|
27
23
|
};
|
|
28
24
|
exports.CHANNEL_MESSAGE_MAX_BYTES = 384 * 1024 * 1024;
|
|
29
|
-
exports.CHANNEL_MAX_SOCKETS_PER_USER =
|
|
25
|
+
exports.CHANNEL_MAX_SOCKETS_PER_USER = 8;
|
|
30
26
|
exports.CHANNEL_PENDING_MESSAGES_MAX_BYTES = 2 * exports.CHANNEL_MESSAGE_MAX_BYTES;
|
|
31
27
|
exports.CHANNEL_STATUS = {
|
|
32
28
|
ACCEPTED: 204,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../../src/constants/channels.ts"],"names":[],"mappings":";;;AAAA,uCAAuD;AAG1C,QAAA,
|
|
1
|
+
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../../src/constants/channels.ts"],"names":[],"mappings":";;;AAAA,uCAAuD;AAG1C,QAAA,oBAAoB,GAAG,aAAa,CAAC;AACrC,QAAA,oBAAoB,GAAG,SAAS,CAAC;AACjC,QAAA,sBAAsB,GAAG,yBAAyB,CAAC;AACnD,QAAA,mBAAmB,GAAG,cAAc,CAAC;AAQrC,QAAA,mBAAmB,GAAG,KAAK,CAAC;AAE5B,QAAA,cAAc,GAAG;IAC5B,KAAK,EAAE,OAAO;IAEd,KAAK,EAAE,SAAS;IAChB,YAAY,EAAE,cAAc;CACpB,CAAC;AAEE,QAAA,gBAAgB,GAAG,mBAAmB,CAAC;AACvC,QAAA,aAAa,GAAG,GAAG,CAAC;AACpB,QAAA,yBAAyB,GAAG,MAAM,CAAC;AACnC,QAAA,mBAAmB,GAAG,iBAAiB,CAAC;AACxC,QAAA,WAAW,GAAqC;IAC3D,eAAe,EAAE,wBAAwB;IACzC,mBAAmB,EAAE,IAAI;IACzB,UAAU,EAAE,YAAY;CACzB,CAAC;AAOW,QAAA,yBAAyB,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AAG9C,QAAA,4BAA4B,GAAG,CAAC,CAAC;AAOjC,QAAA,kCAAkC,GAAG,CAAC,GAAG,iCAAyB,CAAC;AAEnE,QAAA,cAAc,GAAG;IAC5B,QAAQ,EAAE,GAAG;IACb,SAAS,EAAE,GAAG;IACd,iBAAiB,EAAE,GAAG;IACtB,mBAAmB,EAAE,oCAA0B;CACvC,CAAC;AAGE,QAAA,iBAAiB,GAAG,IAAI,CAAC"}
|
|
@@ -19,12 +19,13 @@ export declare const SIDECAR_MODULE_ROOTS_FLAG = "--module-roots";
|
|
|
19
19
|
export declare const SIDECAR_SKILL_DIRS_FLAG = "--skill-dirs";
|
|
20
20
|
export declare const SIDECAR_BUILDER_FLAG = "--builder-enabled";
|
|
21
21
|
export declare const SIDECAR_BACKEND_URL_FLAG = "--backend-url";
|
|
22
|
-
export declare const SIDECAR_HOST_ORIGIN_FLAG = "--host-origin";
|
|
23
22
|
export declare const MODULE_ROOTS_TIMEOUT_MS = 3000;
|
|
24
23
|
export declare const SIDECAR_DIST_EXTENSION = ".js";
|
|
24
|
+
export declare const SIDECAR_BUILD_ID_HASH_ALGORITHM = "sha256";
|
|
25
25
|
export declare const SIDECAR_LOOPBACK_HOST = "127.0.0.1";
|
|
26
26
|
export declare const SIDECAR_AUTH_HEADER = "x-dms-ai-token";
|
|
27
27
|
export declare const SIDECAR_UNAVAILABLE_STATUS = 503;
|
|
28
28
|
export declare const SIDECAR_UNAVAILABLE_BODY: {
|
|
29
29
|
error: string;
|
|
30
30
|
};
|
|
31
|
+
export declare const HOST_ORIGIN_DEPRECATION_WARNING = "[dms-ai] the \"hostOrigin\" config option is deprecated and ignored: remove it from the module config.";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SIDECAR_UNAVAILABLE_BODY = exports.SIDECAR_UNAVAILABLE_STATUS = exports.SIDECAR_AUTH_HEADER = exports.SIDECAR_LOOPBACK_HOST = exports.
|
|
3
|
+
exports.HOST_ORIGIN_DEPRECATION_WARNING = exports.SIDECAR_UNAVAILABLE_BODY = exports.SIDECAR_UNAVAILABLE_STATUS = exports.SIDECAR_AUTH_HEADER = exports.SIDECAR_LOOPBACK_HOST = exports.SIDECAR_BUILD_ID_HASH_ALGORITHM = exports.SIDECAR_DIST_EXTENSION = exports.MODULE_ROOTS_TIMEOUT_MS = exports.SIDECAR_BACKEND_URL_FLAG = exports.SIDECAR_BUILDER_FLAG = exports.SIDECAR_SKILL_DIRS_FLAG = exports.SIDECAR_MODULE_ROOTS_FLAG = exports.SIDECAR_BUILD_ID_FLAG = exports.SIDECAR_LOCK_POLL_INTERVAL_MS = exports.SIDECAR_HEALTH_TIMEOUT_MS = exports.SIDECAR_HEALTH_PATH = exports.SIDECAR_LOG_FILE_NAME = exports.SIDECAR_LOCK_FILE_NAME = exports.SIDECAR_CACHE_DIR_SEGMENTS = exports.SIDECAR_SUCCESS_EXIT_CODE = exports.SIDECAR_DIST_REL = exports.SIDECAR_ENV_DISABLE_KEY = exports.SIDECAR_DISABLED_FLAG = exports.SIDECAR_LOG_PREFIX = exports.SIDECAR_RESPAWN_DELAY_MS = exports.SIDECAR_RESPAWN_WINDOW_MS = exports.SIDECAR_RESPAWN_MAX = exports.SIDECAR_SPAWN_TIMEOUT_MS = exports.SIDECAR_BIN_NAME = void 0;
|
|
4
4
|
exports.SIDECAR_BIN_NAME = "dms-ai-sidecar";
|
|
5
5
|
exports.SIDECAR_SPAWN_TIMEOUT_MS = 10_000;
|
|
6
6
|
exports.SIDECAR_RESPAWN_MAX = 3;
|
|
@@ -26,11 +26,12 @@ exports.SIDECAR_MODULE_ROOTS_FLAG = "--module-roots";
|
|
|
26
26
|
exports.SIDECAR_SKILL_DIRS_FLAG = "--skill-dirs";
|
|
27
27
|
exports.SIDECAR_BUILDER_FLAG = "--builder-enabled";
|
|
28
28
|
exports.SIDECAR_BACKEND_URL_FLAG = "--backend-url";
|
|
29
|
-
exports.SIDECAR_HOST_ORIGIN_FLAG = "--host-origin";
|
|
30
29
|
exports.MODULE_ROOTS_TIMEOUT_MS = 3_000;
|
|
31
30
|
exports.SIDECAR_DIST_EXTENSION = ".js";
|
|
31
|
+
exports.SIDECAR_BUILD_ID_HASH_ALGORITHM = "sha256";
|
|
32
32
|
exports.SIDECAR_LOOPBACK_HOST = "127.0.0.1";
|
|
33
33
|
exports.SIDECAR_AUTH_HEADER = "x-dms-ai-token";
|
|
34
34
|
exports.SIDECAR_UNAVAILABLE_STATUS = 503;
|
|
35
35
|
exports.SIDECAR_UNAVAILABLE_BODY = { error: "sidecar_unavailable" };
|
|
36
|
+
exports.HOST_ORIGIN_DEPRECATION_WARNING = `${exports.SIDECAR_LOG_PREFIX} the "hostOrigin" config option is deprecated and ignored: remove it from the module config.`;
|
|
36
37
|
//# sourceMappingURL=sidecar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidecar.js","sourceRoot":"","sources":["../../src/constants/sidecar.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,gBAAgB,CAAC;AACpC,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AA,gBAAgB,GAAG,6BAA6B,CAAC;AACjD,QAAA,yBAAyB,GAAG,CAAC,CAAC;AAC9B,QAAA,0BAA0B,GAAG;IACxC,cAAc;IACd,QAAQ;IACR,QAAQ;CACA,CAAC;AACE,QAAA,sBAAsB,GAAG,cAAc,CAAC;AACxC,QAAA,qBAAqB,GAAG,aAAa,CAAC;AACtC,QAAA,mBAAmB,GAAG,SAAS,CAAC;AAChC,QAAA,yBAAyB,GAAG,IAAI,CAAC;AACjC,QAAA,6BAA6B,GAAG,GAAG,CAAC;AACpC,QAAA,qBAAqB,GAAG,YAAY,CAAC;AACrC,QAAA,yBAAyB,GAAG,gBAAgB,CAAC;AAC7C,QAAA,uBAAuB,GAAG,cAAc,CAAC;AACzC,QAAA,oBAAoB,GAAG,mBAAmB,CAAC;AAC3C,QAAA,wBAAwB,GAAG,eAAe,CAAC;AAC3C,QAAA,uBAAuB,GAAG,KAAK,CAAC;AAChC,QAAA,sBAAsB,GAAG,KAAK,CAAC;AAC/B,QAAA,+BAA+B,GAAG,QAAQ,CAAC;AAC3C,QAAA,qBAAqB,GAAG,WAAW,CAAC;AACpC,QAAA,mBAAmB,GAAG,gBAAgB,CAAC;AAGvC,QAAA,0BAA0B,GAAG,GAAG,CAAC;AACjC,QAAA,wBAAwB,GAAG,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC;AAC5D,QAAA,+BAA+B,GAAG,GAAG,0BAAkB,8FAA8F,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,15 @@ const spawn_sidecar_1 = require("./lifecycle/spawn-sidecar");
|
|
|
20
20
|
const log_buffer_1 = require("./logging/log-buffer");
|
|
21
21
|
require("./pages");
|
|
22
22
|
require("./routes");
|
|
23
|
+
let hasWarnedHostOrigin = false;
|
|
24
|
+
function warnDeprecatedHostOrigin(config) {
|
|
25
|
+
if (hasWarnedHostOrigin || !(0, config_1.hasDeprecatedHostOrigin)(config))
|
|
26
|
+
return;
|
|
27
|
+
hasWarnedHostOrigin = true;
|
|
28
|
+
logging_1.Logging.Warn(sidecar_1.HOST_ORIGIN_DEPRECATION_WARNING);
|
|
29
|
+
}
|
|
23
30
|
function construct(config) {
|
|
31
|
+
warnDeprecatedHostOrigin(config);
|
|
24
32
|
(0, config_1.setConfig)((0, config_1.parseConfig)(config));
|
|
25
33
|
}
|
|
26
34
|
async function start() {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAmCA,8BAGC;AAED,sBAyBC;AAOD,0BAEC;AA1ED,0DAA6B;AAC7B,gEAA6D;AAC7D,yDAAmE;AACnE,iDAAwD;AACxD,kDAAsD;AACtD,qCAKkB;AAClB,iEAIqC;AACrC,iDAG6B;AAC7B,2DAA8D;AAC9D,6DAAgE;AAChE,6DAAyD;AACzD,qDAAuD;AACvD,mBAAiB;AACjB,oBAAkB;AAElB,IAAI,mBAAmB,GAAG,KAAK,CAAC;AAEhC,SAAS,wBAAwB,CAAC,MAAe;IAC/C,IAAI,mBAAmB,IAAI,CAAC,IAAA,gCAAuB,EAAC,MAAM,CAAC;QAAE,OAAO;IACpE,mBAAmB,GAAG,IAAI,CAAC;IAC3B,iBAAO,CAAC,IAAI,CAAC,yCAA+B,CAAC,CAAC;AAChD,CAAC;AAED,SAAgB,SAAS,CAAC,MAAe;IACvC,wBAAwB,CAAC,MAAM,CAAC,CAAC;IACjC,IAAA,kBAAS,EAAC,IAAA,oBAAW,EAAC,MAAM,CAAC,CAAC,CAAC;AACjC,CAAC;AAEM,KAAK,UAAU,KAAK;IACzB,IAAA,4BAAe,GAAE,CAAC;IAClB,MAAM,IAAA,wBAAiB,EAAC;QACtB,IAAI,EAAE,sCAAoB;QAC1B,UAAU,EAAE,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE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