@elizaos/plugin-xr 2.0.3-beta.6 → 2.0.3-beta.7
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/actions/xr-query-vision.d.ts +3 -0
- package/dist/actions/xr-query-vision.d.ts.map +1 -0
- package/dist/actions/xr-query-vision.js +39 -0
- package/dist/actions/xr-query-vision.js.map +1 -0
- package/dist/actions/xr-view-actions.d.ts +18 -0
- package/dist/actions/xr-view-actions.d.ts.map +1 -0
- package/dist/actions/xr-view-actions.js +304 -0
- package/dist/actions/xr-view-actions.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/dist/protocol.d.ts +124 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +18 -0
- package/dist/protocol.js.map +1 -0
- package/dist/providers/xr-context.d.ts +3 -0
- package/dist/providers/xr-context.d.ts.map +1 -0
- package/dist/providers/xr-context.js +34 -0
- package/dist/providers/xr-context.js.map +1 -0
- package/dist/routes/xr-connect.d.ts +3 -0
- package/dist/routes/xr-connect.d.ts.map +1 -0
- package/{src/routes/xr-connect.ts → dist/routes/xr-connect.js} +12 -15
- package/dist/routes/xr-connect.js.map +1 -0
- package/dist/routes/xr-simulator-route.d.ts +8 -0
- package/dist/routes/xr-simulator-route.d.ts.map +1 -0
- package/{src/routes/xr-simulator-route.ts → dist/routes/xr-simulator-route.js} +10 -16
- package/dist/routes/xr-simulator-route.js.map +1 -0
- package/dist/routes/xr-status.d.ts +3 -0
- package/dist/routes/xr-status.d.ts.map +1 -0
- package/{src/routes/xr-status.ts → dist/routes/xr-status.js} +13 -15
- package/dist/routes/xr-status.js.map +1 -0
- package/dist/routes/xr-view-host.d.ts +24 -0
- package/dist/routes/xr-view-host.d.ts.map +1 -0
- package/{src/routes/xr-view-host.ts → dist/routes/xr-view-host.js} +22 -59
- package/dist/routes/xr-view-host.js.map +1 -0
- package/dist/routes/xr-views.d.ts +8 -0
- package/dist/routes/xr-views.d.ts.map +1 -0
- package/dist/routes/xr-views.js +31 -0
- package/dist/routes/xr-views.js.map +1 -0
- package/dist/services/audio-pipeline.d.ts +20 -0
- package/dist/services/audio-pipeline.d.ts.map +1 -0
- package/{src/services/audio-pipeline.ts → dist/services/audio-pipeline.js} +25 -58
- package/dist/services/audio-pipeline.js.map +1 -0
- package/dist/services/vision-pipeline.d.ts +16 -0
- package/dist/services/vision-pipeline.d.ts.map +1 -0
- package/dist/services/vision-pipeline.js +39 -0
- package/dist/services/vision-pipeline.js.map +1 -0
- package/dist/services/xr-session-service.d.ts +50 -0
- package/dist/services/xr-session-service.d.ts.map +1 -0
- package/{src/services/xr-session-service.ts → dist/services/xr-session-service.js} +85 -194
- package/dist/services/xr-session-service.js.map +1 -0
- package/package.json +9 -4
- package/AGENTS.md +0 -151
- package/CLAUDE.md +0 -151
- package/simulator/bun.lock +0 -159
- package/simulator/package.json +0 -28
- package/simulator/src/emulator.ts +0 -174
- package/simulator/src/mock-agent.ts +0 -233
- package/simulator/src/node.ts +0 -9
- package/simulator/src/playwright-fixture.ts +0 -169
- package/simulator/src/types.ts +0 -51
- package/simulator/tsconfig.json +0 -13
- package/simulator/vite.config.ts +0 -25
- package/src/__tests__/audio-pipeline.test.ts +0 -129
- package/src/__tests__/protocol.test.ts +0 -53
- package/src/__tests__/routes-e2e.test.ts +0 -276
- package/src/__tests__/vision-pipeline.test.ts +0 -73
- package/src/__tests__/xr-bundle-coverage.test.ts +0 -303
- package/src/__tests__/xr-feature-parity.test.ts +0 -524
- package/src/__tests__/xr-functional-parity.test.ts +0 -522
- package/src/__tests__/xr-view-host-http.test.ts +0 -239
- package/src/__tests__/xr-view-host.test.ts +0 -174
- package/src/actions/xr-query-vision.ts +0 -64
- package/src/actions/xr-view-actions.ts +0 -386
- package/src/index.ts +0 -55
- package/src/protocol.ts +0 -126
- package/src/providers/xr-context.ts +0 -49
- package/src/routes/xr-views.ts +0 -43
- package/src/services/vision-pipeline.ts +0 -57
- package/tsconfig.build.json +0 -9
- package/tsconfig.json +0 -30
- package/vitest.config.ts +0 -21
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { IAgentRuntime } from "@elizaos/core";
|
|
2
|
-
import { ModelType } from "@elizaos/core";
|
|
3
|
-
import type { XRFrameHeader } from "../protocol.ts";
|
|
4
|
-
|
|
5
|
-
export interface LatestFrame {
|
|
6
|
-
data: Buffer;
|
|
7
|
-
header: XRFrameHeader;
|
|
8
|
-
receivedAt: number;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// A frame older than this is considered stale and won't be described
|
|
12
|
-
const FRAME_MAX_AGE_MS = 10_000;
|
|
13
|
-
|
|
14
|
-
export class VisionPipeline {
|
|
15
|
-
private latest = new Map<string, LatestFrame>();
|
|
16
|
-
|
|
17
|
-
storeFrame(connectionId: string, header: XRFrameHeader, data: Buffer): void {
|
|
18
|
-
this.latest.set(connectionId, { data, header, receivedAt: Date.now() });
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
getLatestFrame(connectionId: string): LatestFrame | undefined {
|
|
22
|
-
const frame = this.latest.get(connectionId);
|
|
23
|
-
if (!frame) return undefined;
|
|
24
|
-
if (Date.now() - frame.receivedAt > FRAME_MAX_AGE_MS) return undefined;
|
|
25
|
-
return frame;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
hasRecentFrame(connectionId: string): boolean {
|
|
29
|
-
return this.getLatestFrame(connectionId) !== undefined;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async describeFrame(
|
|
33
|
-
runtime: IAgentRuntime,
|
|
34
|
-
connectionId: string,
|
|
35
|
-
prompt?: string,
|
|
36
|
-
): Promise<string | null> {
|
|
37
|
-
const frame = this.getLatestFrame(connectionId);
|
|
38
|
-
if (!frame) return null;
|
|
39
|
-
|
|
40
|
-
const dataUrl = `data:image/${frame.header.format};base64,${frame.data.toString("base64")}`;
|
|
41
|
-
|
|
42
|
-
try {
|
|
43
|
-
const description = await runtime.useModel(ModelType.IMAGE_DESCRIPTION, {
|
|
44
|
-
imageUrl: dataUrl,
|
|
45
|
-
prompt: prompt ?? "Describe what you see in this image concisely.",
|
|
46
|
-
});
|
|
47
|
-
return typeof description === "string" ? description : null;
|
|
48
|
-
} catch (err) {
|
|
49
|
-
console.error("[plugin-xr] vision error:", err);
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
clear(connectionId: string): void {
|
|
55
|
-
this.latest.delete(connectionId);
|
|
56
|
-
}
|
|
57
|
-
}
|
package/tsconfig.build.json
DELETED
package/tsconfig.json
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"composite": false,
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"strictNullChecks": true,
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
"types": ["node", "bun"],
|
|
10
|
-
"allowImportingTsExtensions": true,
|
|
11
|
-
"noEmit": true,
|
|
12
|
-
"declaration": false,
|
|
13
|
-
"declarationMap": false,
|
|
14
|
-
"sourceMap": false,
|
|
15
|
-
"paths": {
|
|
16
|
-
"@elizaos/core": ["../../packages/core/src/index.node.ts"],
|
|
17
|
-
"@elizaos/logger": ["../../packages/logger/src/index.ts"],
|
|
18
|
-
"@elizaos/shared": ["../../packages/shared/src/index.ts"],
|
|
19
|
-
"@elizaos/shared/*": ["../../packages/shared/src/*"],
|
|
20
|
-
"@elizaos/*": ["../../node_modules/@elizaos/*"]
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"include": ["src/**/*.ts", "src/**/*.d.ts"],
|
|
24
|
-
"exclude": [
|
|
25
|
-
"src/**/*.stories.ts",
|
|
26
|
-
"src/**/__tests__/**",
|
|
27
|
-
"src/**/*.test.ts",
|
|
28
|
-
"src/**/*.test.tsx"
|
|
29
|
-
]
|
|
30
|
-
}
|
package/vitest.config.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath } from "node:url";
|
|
2
|
-
import { defineConfig } from "vitest/config";
|
|
3
|
-
|
|
4
|
-
const agentApiSourceDir = fileURLToPath(
|
|
5
|
-
new URL("../../packages/agent/src/api/", import.meta.url),
|
|
6
|
-
);
|
|
7
|
-
|
|
8
|
-
export default defineConfig({
|
|
9
|
-
resolve: {
|
|
10
|
-
alias: [
|
|
11
|
-
{
|
|
12
|
-
find: /^@elizaos\/agent\/api\/(.+)$/,
|
|
13
|
-
replacement: `${agentApiSourceDir}$1.ts`,
|
|
14
|
-
},
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
|
-
test: {
|
|
18
|
-
include: ["src/**/*.test.ts", "src/**/__tests__/**/*.test.ts"],
|
|
19
|
-
environment: "node",
|
|
20
|
-
},
|
|
21
|
-
});
|