@patrax/office-viz 1.0.1 → 1.1.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.
- package/dist/index.d.ts +22 -102
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +214 -297
- package/dist/index.js.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +4 -2
- package/ui/dist/assets/index-De-lbeLZ.css +1 -0
- package/ui/dist/assets/index-mbMMnW8q.js +34 -0
- package/ui/dist/assets/index-mbMMnW8q.js.map +1 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/index-DglNlTuL.js +0 -44
- package/ui/dist/assets/index-DglNlTuL.js.map +0 -1
- package/ui/dist/assets/index-Dm9OFqqZ.css +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,110 +2,30 @@
|
|
|
2
2
|
* OpenClaw Office Visualization Plugin
|
|
3
3
|
*
|
|
4
4
|
* Displays running agents as animated pixel art characters in a virtual office.
|
|
5
|
+
* Uses the real OpenClaw plugin SDK interface.
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
animationSpeed: number;
|
|
7
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
8
|
+
interface PluginLogger {
|
|
9
|
+
info(msg: string): void;
|
|
10
|
+
warn(msg: string): void;
|
|
11
|
+
error(msg: string): void;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
interface OpenClawPluginApi {
|
|
14
|
+
pluginConfig?: Record<string, unknown>;
|
|
15
|
+
logger: PluginLogger;
|
|
16
|
+
registerHttpRoute(params: {
|
|
17
|
+
path: string;
|
|
18
|
+
auth: 'gateway' | 'plugin';
|
|
19
|
+
match?: 'exact' | 'prefix';
|
|
20
|
+
handler: (req: IncomingMessage, res: ServerResponse) => Promise<boolean> | boolean;
|
|
21
|
+
}): void;
|
|
22
|
+
on(event: string, handler: (...args: any[]) => any): void;
|
|
23
|
+
}
|
|
24
|
+
declare const plugin: {
|
|
14
25
|
id: string;
|
|
15
26
|
name: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
model?: string;
|
|
21
|
-
channel?: string;
|
|
22
|
-
}
|
|
23
|
-
export interface OpenClawContext {
|
|
24
|
-
config: OfficeVizConfig;
|
|
25
|
-
http: {
|
|
26
|
-
get(path: string, handler: (req: Request) => Response | Promise<Response>): void;
|
|
27
|
-
post(path: string, handler: (req: Request) => Response | Promise<Response>): void;
|
|
28
|
-
};
|
|
29
|
-
events: {
|
|
30
|
-
on(event: string, handler: (data: unknown) => void): void;
|
|
31
|
-
off(event: string, handler: (data: unknown) => void): void;
|
|
32
|
-
};
|
|
33
|
-
sessions: {
|
|
34
|
-
list(): Promise<Array<{
|
|
35
|
-
id: string;
|
|
36
|
-
channel?: string;
|
|
37
|
-
model?: string;
|
|
38
|
-
status: string;
|
|
39
|
-
lastActivity?: number;
|
|
40
|
-
}>>;
|
|
41
|
-
};
|
|
42
|
-
presence: {
|
|
43
|
-
list(): Promise<Array<{
|
|
44
|
-
instanceId?: string;
|
|
45
|
-
deviceId?: string;
|
|
46
|
-
host?: string;
|
|
47
|
-
mode?: string;
|
|
48
|
-
lastInputSeconds?: number;
|
|
49
|
-
}>>;
|
|
50
|
-
};
|
|
51
|
-
logger: {
|
|
52
|
-
info(msg: string): void;
|
|
53
|
-
warn(msg: string): void;
|
|
54
|
-
error(msg: string): void;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Office Visualization Plugin
|
|
59
|
-
*/
|
|
60
|
-
export declare class OfficeVizPlugin {
|
|
61
|
-
private ctx;
|
|
62
|
-
private agents;
|
|
63
|
-
private uiDistPath;
|
|
64
|
-
constructor(ctx: OpenClawContext);
|
|
65
|
-
/**
|
|
66
|
-
* Initialize the plugin
|
|
67
|
-
*/
|
|
68
|
-
init(): Promise<void>;
|
|
69
|
-
/**
|
|
70
|
-
* Register HTTP routes for the visualization
|
|
71
|
-
*/
|
|
72
|
-
private registerRoutes;
|
|
73
|
-
/**
|
|
74
|
-
* Serve static files from the UI dist folder
|
|
75
|
-
*/
|
|
76
|
-
private serveStaticFile;
|
|
77
|
-
/**
|
|
78
|
-
* Get content type for file extension
|
|
79
|
-
*/
|
|
80
|
-
private getContentType;
|
|
81
|
-
/**
|
|
82
|
-
* Serve a fallback UI when the dist folder doesn't exist
|
|
83
|
-
*/
|
|
84
|
-
private serveFallbackUI;
|
|
85
|
-
/**
|
|
86
|
-
* Subscribe to OpenClaw events for real-time updates
|
|
87
|
-
*/
|
|
88
|
-
private subscribeToEvents;
|
|
89
|
-
/**
|
|
90
|
-
* Generate a friendly name for an agent
|
|
91
|
-
*/
|
|
92
|
-
private generateAgentName;
|
|
93
|
-
/**
|
|
94
|
-
* Sync agents from current sessions
|
|
95
|
-
*/
|
|
96
|
-
private syncAgents;
|
|
97
|
-
/**
|
|
98
|
-
* Add or update an agent
|
|
99
|
-
*/
|
|
100
|
-
private addOrUpdateAgent;
|
|
101
|
-
/**
|
|
102
|
-
* Cleanup on shutdown
|
|
103
|
-
*/
|
|
104
|
-
destroy(): Promise<void>;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Plugin entry point
|
|
108
|
-
* Called by OpenClaw when loading the plugin
|
|
109
|
-
*/
|
|
110
|
-
export default function (ctx: OpenClawContext): Promise<OfficeVizPlugin>;
|
|
27
|
+
description: string;
|
|
28
|
+
register(api: OpenClawPluginApi): void;
|
|
29
|
+
};
|
|
30
|
+
export default plugin;
|
|
111
31
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAOhE,UAAU,YAAY;IACpB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,UAAU,iBAAiB;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,MAAM,EAAE,YAAY,CAAA;IACpB,iBAAiB,CAAC,MAAM,EAAE;QACxB,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAA;QAC1B,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;QAC1B,OAAO,EAAE,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAA;KACnF,GAAG,IAAI,CAAA;IACR,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GAAG,IAAI,CAAA;CAC1D;AAuID,QAAA,MAAM,MAAM;;;;kBAKI,iBAAiB;CA6KhC,CAAA;AAED,eAAe,MAAM,CAAA"}
|