@useorgx/openclaw-plugin 0.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.
@@ -0,0 +1,182 @@
1
+ /**
2
+ * OrgX Clawdbot Plugin — Shared Types
3
+ *
4
+ * Types for the plugin's API client and tool interfaces.
5
+ * Mirrors the server-side types in orgx/lib/client-integration/types.ts
6
+ */
7
+ export interface OrgXConfig {
8
+ /** OrgX API key */
9
+ apiKey: string;
10
+ /** OrgX user ID for X-Orgx-User-Id header */
11
+ userId: string;
12
+ /** OrgX API base URL */
13
+ baseUrl: string;
14
+ /** Background sync interval in ms */
15
+ syncIntervalMs: number;
16
+ /** Plugin enabled */
17
+ enabled: boolean;
18
+ }
19
+ export interface OrgSnapshot {
20
+ /** Active initiatives */
21
+ initiatives: Initiative[];
22
+ /** Agent states */
23
+ agents: AgentState[];
24
+ /** Active tasks across workstreams */
25
+ activeTasks: TaskSummary[];
26
+ /** Pending decisions needing attention */
27
+ pendingDecisions: Decision[];
28
+ /** Last sync timestamp */
29
+ syncedAt: string;
30
+ }
31
+ export interface Initiative {
32
+ id: string;
33
+ title: string;
34
+ status: string;
35
+ progress?: number;
36
+ workstreams?: string[];
37
+ }
38
+ export interface AgentState {
39
+ id: string;
40
+ name: string;
41
+ domain: string;
42
+ status: "active" | "idle" | "throttled";
43
+ currentTask?: string;
44
+ lastActive?: string;
45
+ }
46
+ export interface TaskSummary {
47
+ id: string;
48
+ title: string;
49
+ status: string;
50
+ domain?: string;
51
+ modelTier?: ModelTier;
52
+ assignee?: string;
53
+ }
54
+ export interface Decision {
55
+ id: string;
56
+ title: string;
57
+ urgency: "low" | "medium" | "high";
58
+ context?: string;
59
+ }
60
+ export interface SyncPayload {
61
+ /** Client-side memory snapshot */
62
+ memory?: string;
63
+ /** Today's session log */
64
+ dailyLog?: string;
65
+ /** Decisions made this session */
66
+ decisions?: Array<{
67
+ id: string;
68
+ action: "approved" | "rejected";
69
+ note?: string;
70
+ }>;
71
+ }
72
+ export interface SyncResponse {
73
+ /** Active initiatives summary */
74
+ initiatives: Array<{
75
+ id: string;
76
+ title: string;
77
+ status: string;
78
+ }>;
79
+ /** In-progress tasks */
80
+ activeTasks: Array<{
81
+ id: string;
82
+ title: string;
83
+ status: string;
84
+ domain?: string;
85
+ modelTier: ModelTier;
86
+ }>;
87
+ /** Pending decisions needing attention */
88
+ pendingDecisions: Array<{
89
+ id: string;
90
+ title: string;
91
+ urgency: "low" | "medium" | "high";
92
+ }>;
93
+ /** Quality stats per domain */
94
+ qualityStats: QualityStats[];
95
+ /** Model routing policy */
96
+ modelPolicy: ModelRoutingPolicy;
97
+ /** Server timestamp */
98
+ syncedAt: string;
99
+ }
100
+ export type ModelTier = "opus" | "sonnet" | "local";
101
+ export type TaskComplexity = "planning" | "execution" | "routine";
102
+ export interface ModelRouting {
103
+ tier: ModelTier;
104
+ reason: string;
105
+ complexity: TaskComplexity;
106
+ estimatedTokens: number;
107
+ }
108
+ export interface ModelRoutingPolicy {
109
+ planningPatterns: string[];
110
+ executionPatterns: string[];
111
+ routinePatterns: string[];
112
+ domainOverrides: Record<string, ModelTier>;
113
+ budget: {
114
+ dailyUsd: number;
115
+ opusMaxPercentage: number;
116
+ localMinPercentage: number;
117
+ };
118
+ }
119
+ export interface QualityScore {
120
+ taskId: string;
121
+ domain: string;
122
+ score: number;
123
+ notes?: string;
124
+ scoredBy?: "human" | "auto" | "peer";
125
+ }
126
+ export interface QualityStats {
127
+ domain: string;
128
+ totalTasks: number;
129
+ avgScore: number;
130
+ recentTrend: "improving" | "stable" | "declining";
131
+ isThrottled: boolean;
132
+ throttleReason?: string;
133
+ }
134
+ export interface SpawnGuardResult {
135
+ allowed: boolean;
136
+ modelTier: ModelTier;
137
+ checks: {
138
+ rateLimit: {
139
+ passed: boolean;
140
+ current: number;
141
+ max: number;
142
+ };
143
+ qualityGate: {
144
+ passed: boolean;
145
+ score: number;
146
+ threshold: number;
147
+ };
148
+ taskAssigned: {
149
+ passed: boolean;
150
+ taskId?: string;
151
+ status?: string;
152
+ };
153
+ };
154
+ blockedReason?: string;
155
+ }
156
+ export interface Entity {
157
+ id: string;
158
+ type: string;
159
+ title: string;
160
+ summary?: string;
161
+ status?: string;
162
+ parentId?: string;
163
+ createdAt?: string;
164
+ updatedAt?: string;
165
+ [key: string]: unknown;
166
+ }
167
+ export interface EntityCreatePayload {
168
+ title: string;
169
+ summary?: string;
170
+ status?: string;
171
+ parentId?: string;
172
+ [key: string]: unknown;
173
+ }
174
+ export interface EntityUpdatePayload {
175
+ [key: string]: unknown;
176
+ }
177
+ export interface EntityListFilters {
178
+ status?: string;
179
+ limit?: number;
180
+ [key: string]: unknown;
181
+ }
182
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,WAAW,UAAU;IACzB,mBAAmB;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,qBAAqB;IACrB,OAAO,EAAE,OAAO,CAAC;CAClB;AAMD,MAAM,WAAW,WAAW;IAC1B,yBAAyB;IACzB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,mBAAmB;IACnB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,sCAAsC;IACtC,WAAW,EAAE,WAAW,EAAE,CAAC;IAC3B,0CAA0C;IAC1C,gBAAgB,EAAE,QAAQ,EAAE,CAAC;IAC7B,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC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;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
package/dist/types.js ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * OrgX Clawdbot Plugin — Shared Types
3
+ *
4
+ * Types for the plugin's API client and tool interfaces.
5
+ * Mirrors the server-side types in orgx/lib/client-integration/types.ts
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,73 @@
1
+ {
2
+ "id": "orgx",
3
+ "name": "OrgX Integration",
4
+ "version": "1.0.0",
5
+ "description": "Connects Clawdbot to OrgX for agent orchestration, quality gates, and model routing",
6
+ "entry": "./dist/index.js",
7
+ "author": "OrgX Team",
8
+ "license": "MIT",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/orgx/orgx"
12
+ },
13
+ "engines": {
14
+ "node": ">=18.0.0"
15
+ },
16
+ "capabilities": {
17
+ "tools": true,
18
+ "services": true,
19
+ "cli": true,
20
+ "http": true
21
+ },
22
+ "configSchema": {
23
+ "type": "object",
24
+ "properties": {
25
+ "apiKey": {
26
+ "type": "string",
27
+ "description": "OrgX API key for authentication"
28
+ },
29
+ "baseUrl": {
30
+ "type": "string",
31
+ "default": "https://www.useorgx.com",
32
+ "description": "OrgX API base URL"
33
+ },
34
+ "syncIntervalMs": {
35
+ "type": "number",
36
+ "default": 300000,
37
+ "description": "Background sync interval in milliseconds (default: 5 minutes)"
38
+ },
39
+ "enabled": {
40
+ "type": "boolean",
41
+ "default": true,
42
+ "description": "Enable or disable the OrgX plugin"
43
+ },
44
+ "dashboardEnabled": {
45
+ "type": "boolean",
46
+ "default": true,
47
+ "description": "Enable the OrgX live dashboard at /orgx/live"
48
+ }
49
+ },
50
+ "required": []
51
+ },
52
+ "uiHints": {
53
+ "apiKey": {
54
+ "label": "OrgX API Key",
55
+ "sensitive": true,
56
+ "placeholder": "orgx_..."
57
+ },
58
+ "baseUrl": {
59
+ "label": "OrgX API Base URL",
60
+ "placeholder": "https://www.useorgx.com"
61
+ },
62
+ "syncIntervalMs": {
63
+ "label": "Sync Interval (ms)",
64
+ "placeholder": "300000"
65
+ },
66
+ "enabled": {
67
+ "label": "Enable Plugin"
68
+ },
69
+ "dashboardEnabled": {
70
+ "label": "Enable Live Dashboard"
71
+ }
72
+ }
73
+ }
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@useorgx/openclaw-plugin",
3
+ "version": "0.1.0",
4
+ "description": "OrgX plugin for OpenClaw — agent orchestration, quality gates, model routing, and live dashboard",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./types": {
15
+ "types": "./dist/types.d.ts",
16
+ "import": "./dist/types.js"
17
+ },
18
+ "./api": {
19
+ "types": "./dist/api.d.ts",
20
+ "import": "./dist/api.js"
21
+ }
22
+ },
23
+ "openclaw": {
24
+ "plugin": true,
25
+ "entry": "./dist/index.js"
26
+ },
27
+ "files": [
28
+ "dist/",
29
+ "dashboard/dist/",
30
+ "openclaw.plugin.json",
31
+ "README.md"
32
+ ],
33
+ "scripts": {
34
+ "typecheck": "tsc --noEmit",
35
+ "build": "tsc",
36
+ "clean": "rm -rf dist",
37
+ "prepublishOnly": "npm run build"
38
+ },
39
+ "keywords": [
40
+ "openclaw",
41
+ "openclaw-plugin",
42
+ "orgx",
43
+ "agent-orchestration",
44
+ "mcp",
45
+ "ai-agents",
46
+ "quality-gates",
47
+ "model-routing"
48
+ ],
49
+ "author": "OrgX Team <team@useorgx.com>",
50
+ "license": "MIT",
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "https://github.com/useorgx/openclaw-plugin.git"
54
+ },
55
+ "homepage": "https://useorgx.com",
56
+ "bugs": {
57
+ "url": "https://github.com/useorgx/openclaw-plugin/issues"
58
+ },
59
+ "engines": {
60
+ "node": ">=18.0.0"
61
+ },
62
+ "peerDependencies": {
63
+ "openclaw": ">=2026.1.0"
64
+ },
65
+ "peerDependenciesMeta": {
66
+ "openclaw": {
67
+ "optional": true
68
+ }
69
+ },
70
+ "devDependencies": {
71
+ "@types/node": "^20.19.30",
72
+ "typescript": "^5.9.3"
73
+ }
74
+ }