@cleocode/core 2026.3.73 → 2026.3.74
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/cleo.d.ts.map +1 -1
- package/dist/index.js +485 -176
- package/dist/index.js.map +4 -4
- package/dist/nexus/index.d.ts +2 -0
- package/dist/nexus/index.d.ts.map +1 -1
- package/dist/nexus/workspace.d.ts +128 -0
- package/dist/nexus/workspace.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/cleo.ts +14 -0
- package/src/nexus/index.ts +15 -0
- package/src/nexus/workspace.ts +508 -0
package/dist/nexus/index.d.ts
CHANGED
|
@@ -16,4 +16,6 @@ export { getNexusCacheDir, getNexusHome, type NexusHealthStatus, type NexusPermi
|
|
|
16
16
|
export { getSharingStatus, type SharingStatus, syncGitignore, } from './sharing/index.js';
|
|
17
17
|
export { executeTransfer, previewTransfer } from './transfer.js';
|
|
18
18
|
export type { ImportFromPackageOptions, ImportFromPackageResult, TransferManifest, TransferManifestEntry, TransferMode, TransferOnConflict, TransferOnMissingDep, TransferParams, TransferResult, TransferScope, } from './transfer-types.js';
|
|
19
|
+
export type { ParsedDirective, ProjectACL, RouteResult, WorkspaceAgent, WorkspaceProjectSummary, WorkspaceStatus, } from './workspace.js';
|
|
20
|
+
export { parseDirective, routeDirective, workspaceAgents, workspaceStatus, } from './workspace.js';
|
|
19
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nexus/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EACL,KAAK,sBAAsB,EAC3B,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,UAAU,EAEf,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,SAAS,EACT,KAAK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AM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACjE,YAAY,EACV,wBAAwB,EACxB,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,eAAe,EACf,UAAU,EACV,WAAW,EACX,cAAc,EACd,uBAAuB,EACvB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NEXUS Workspace — Cross-project orchestration operations.
|
|
3
|
+
*
|
|
4
|
+
* Implements ORCH-PLAN Phase B:
|
|
5
|
+
* - B.2: nexus.route(directiveEvent) — dispatch Conduit directives to the correct project
|
|
6
|
+
* - B.3: nexus.workspace.status() — aggregated cross-project task view
|
|
7
|
+
* - B.4: nexus.workspace.agents() — cross-project agent registry view
|
|
8
|
+
*
|
|
9
|
+
* Security: project-level ACL enforced on all routing operations (HIGH-02).
|
|
10
|
+
* Rate limiting: per-agent throttling on route operations (MEDIUM-05).
|
|
11
|
+
* Audit: all routing operations logged (LOW-06).
|
|
12
|
+
*
|
|
13
|
+
* @module nexus/workspace
|
|
14
|
+
*/
|
|
15
|
+
import type { ConduitMessage } from '@cleocode/contracts';
|
|
16
|
+
/** Parsed directive from a Conduit message. */
|
|
17
|
+
export interface ParsedDirective {
|
|
18
|
+
/** The directive verb (claim, done, blocked, action, etc.). */
|
|
19
|
+
verb: string;
|
|
20
|
+
/** Task references extracted from the message (e.g., T042, T1234). */
|
|
21
|
+
taskRefs: string[];
|
|
22
|
+
/** The agent ID that sent the directive. */
|
|
23
|
+
agentId: string;
|
|
24
|
+
/** Original message ID for audit trail. */
|
|
25
|
+
messageId: string;
|
|
26
|
+
/** Timestamp of the directive. */
|
|
27
|
+
timestamp: string;
|
|
28
|
+
}
|
|
29
|
+
/** Result of routing a directive to a project. */
|
|
30
|
+
export interface RouteResult {
|
|
31
|
+
/** Whether the routing succeeded. */
|
|
32
|
+
success: boolean;
|
|
33
|
+
/** The project that was routed to. */
|
|
34
|
+
project: string;
|
|
35
|
+
/** The project's filesystem path. */
|
|
36
|
+
projectPath: string;
|
|
37
|
+
/** The task that was affected. */
|
|
38
|
+
taskId: string;
|
|
39
|
+
/** What operation was performed. */
|
|
40
|
+
operation: string;
|
|
41
|
+
/** Error message if routing failed. */
|
|
42
|
+
error?: string;
|
|
43
|
+
}
|
|
44
|
+
/** Aggregated task status across all projects. */
|
|
45
|
+
export interface WorkspaceStatus {
|
|
46
|
+
/** Total projects in the workspace. */
|
|
47
|
+
projectCount: number;
|
|
48
|
+
/** Per-project task summaries. */
|
|
49
|
+
projects: WorkspaceProjectSummary[];
|
|
50
|
+
/** Aggregated totals. */
|
|
51
|
+
totals: {
|
|
52
|
+
pending: number;
|
|
53
|
+
active: number;
|
|
54
|
+
done: number;
|
|
55
|
+
total: number;
|
|
56
|
+
};
|
|
57
|
+
/** When the status was computed. */
|
|
58
|
+
computedAt: string;
|
|
59
|
+
}
|
|
60
|
+
/** Task summary for a single project. */
|
|
61
|
+
export interface WorkspaceProjectSummary {
|
|
62
|
+
/** Project name. */
|
|
63
|
+
name: string;
|
|
64
|
+
/** Project path. */
|
|
65
|
+
path: string;
|
|
66
|
+
/** Task counts by status. */
|
|
67
|
+
counts: {
|
|
68
|
+
pending: number;
|
|
69
|
+
active: number;
|
|
70
|
+
done: number;
|
|
71
|
+
total: number;
|
|
72
|
+
};
|
|
73
|
+
/** Health status from the Nexus registry. */
|
|
74
|
+
health: string;
|
|
75
|
+
/** Last sync time. */
|
|
76
|
+
lastSync: string;
|
|
77
|
+
}
|
|
78
|
+
/** Agent info aggregated across projects. */
|
|
79
|
+
export interface WorkspaceAgent {
|
|
80
|
+
/** Agent instance ID. */
|
|
81
|
+
agentId: string;
|
|
82
|
+
/** Agent type. */
|
|
83
|
+
agentType: string;
|
|
84
|
+
/** Current status. */
|
|
85
|
+
status: string;
|
|
86
|
+
/** Which project this agent is registered in. */
|
|
87
|
+
project: string;
|
|
88
|
+
/** Current task (if any). */
|
|
89
|
+
taskId: string | null;
|
|
90
|
+
/** Last heartbeat. */
|
|
91
|
+
lastHeartbeat: string;
|
|
92
|
+
}
|
|
93
|
+
/** Project-level ACL entry. */
|
|
94
|
+
export interface ProjectACL {
|
|
95
|
+
/** Agent IDs with write access. */
|
|
96
|
+
authorizedAgents: string[];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Parse a Conduit message into a structured directive.
|
|
100
|
+
*
|
|
101
|
+
* Extracts directive verbs (/claim, /done, /blocked) and task references
|
|
102
|
+
* from the message content and metadata.
|
|
103
|
+
*/
|
|
104
|
+
export declare function parseDirective(message: ConduitMessage): ParsedDirective | null;
|
|
105
|
+
/**
|
|
106
|
+
* Route a Conduit directive to the correct project's CLEO instance.
|
|
107
|
+
*
|
|
108
|
+
* Resolves which project owns the referenced task, checks ACL,
|
|
109
|
+
* and dispatches the appropriate CLEO operation.
|
|
110
|
+
*
|
|
111
|
+
* @param directive - Parsed directive from a Conduit message
|
|
112
|
+
* @returns Array of route results (one per task reference)
|
|
113
|
+
*/
|
|
114
|
+
export declare function routeDirective(directive: ParsedDirective): Promise<RouteResult[]>;
|
|
115
|
+
/**
|
|
116
|
+
* Get aggregated task status across all registered projects.
|
|
117
|
+
*
|
|
118
|
+
* Returns per-project task counts and workspace-wide totals.
|
|
119
|
+
* Respects project permissions — only includes readable projects.
|
|
120
|
+
*/
|
|
121
|
+
export declare function workspaceStatus(): Promise<WorkspaceStatus>;
|
|
122
|
+
/**
|
|
123
|
+
* Get all agents registered across all projects.
|
|
124
|
+
*
|
|
125
|
+
* Queries each project's agent_instances table and returns a unified list.
|
|
126
|
+
*/
|
|
127
|
+
export declare function workspaceAgents(): Promise<WorkspaceAgent[]>;
|
|
128
|
+
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/nexus/workspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAW1D,+CAA+C;AAC/C,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,kDAAkD;AAClD,MAAM,WAAW,WAAW;IAC1B,qCAAqC;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,kDAAkD;AAClD,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IACpC,yBAAyB;IACzB,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,yCAAyC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core",
|
|
3
|
-
"version": "2026.3.
|
|
3
|
+
"version": "2026.3.74",
|
|
4
4
|
"description": "CLEO core business logic kernel — tasks, sessions, memory, orchestration, lifecycle, with bundled SQLite store",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"write-file-atomic": "^6.0.0",
|
|
38
38
|
"yaml": "^2.8.2",
|
|
39
39
|
"zod": "^3.25.76",
|
|
40
|
-
"@cleocode/adapters": "2026.3.
|
|
41
|
-
"@cleocode/agents": "2026.3.
|
|
42
|
-
"@cleocode/
|
|
43
|
-
"@cleocode/
|
|
40
|
+
"@cleocode/adapters": "2026.3.74",
|
|
41
|
+
"@cleocode/agents": "2026.3.74",
|
|
42
|
+
"@cleocode/skills": "2026.3.74",
|
|
43
|
+
"@cleocode/contracts": "2026.3.74"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=24.0.0"
|
package/src/cleo.ts
CHANGED
|
@@ -81,6 +81,13 @@ import {
|
|
|
81
81
|
nexusUnregister,
|
|
82
82
|
} from './nexus/registry.js';
|
|
83
83
|
import { getSharingStatus } from './nexus/sharing/index.js';
|
|
84
|
+
// Nexus workspace (ORCH-PLAN Phase B)
|
|
85
|
+
import {
|
|
86
|
+
parseDirective,
|
|
87
|
+
routeDirective,
|
|
88
|
+
workspaceAgents,
|
|
89
|
+
workspaceStatus,
|
|
90
|
+
} from './nexus/workspace.js';
|
|
84
91
|
// Orchestration
|
|
85
92
|
import {
|
|
86
93
|
analyzeEpic,
|
|
@@ -427,6 +434,13 @@ export class Cleo {
|
|
|
427
434
|
search: (p) => searchAcrossProjects(p.pattern, p.project, p.limit),
|
|
428
435
|
setPermission: (p) => setPermission(p.name, p.level),
|
|
429
436
|
sharingStatus: () => getSharingStatus(),
|
|
437
|
+
route: (message) => {
|
|
438
|
+
const directive = parseDirective(message);
|
|
439
|
+
if (!directive) return Promise.resolve([]);
|
|
440
|
+
return routeDirective(directive);
|
|
441
|
+
},
|
|
442
|
+
workspaceStatus: () => workspaceStatus(),
|
|
443
|
+
workspaceAgents: () => workspaceAgents(),
|
|
430
444
|
};
|
|
431
445
|
}
|
|
432
446
|
|
package/src/nexus/index.ts
CHANGED
|
@@ -112,3 +112,18 @@ export type {
|
|
|
112
112
|
TransferResult,
|
|
113
113
|
TransferScope,
|
|
114
114
|
} from './transfer-types.js';
|
|
115
|
+
export type {
|
|
116
|
+
ParsedDirective,
|
|
117
|
+
ProjectACL,
|
|
118
|
+
RouteResult,
|
|
119
|
+
WorkspaceAgent,
|
|
120
|
+
WorkspaceProjectSummary,
|
|
121
|
+
WorkspaceStatus,
|
|
122
|
+
} from './workspace.js';
|
|
123
|
+
// Workspace - cross-project orchestration (ORCH-PLAN Phase B)
|
|
124
|
+
export {
|
|
125
|
+
parseDirective,
|
|
126
|
+
routeDirective,
|
|
127
|
+
workspaceAgents,
|
|
128
|
+
workspaceStatus,
|
|
129
|
+
} from './workspace.js';
|