@fro.bot/space-bus 0.3.0 → 0.5.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/README.md +2 -2
- package/dist/config.d.ts +4 -34
- package/dist/config.js +1 -1
- package/dist/contract.d.ts +71 -1671
- package/dist/contract.js +41 -31
- package/dist/core.js +41 -31
- package/dist/format.d.ts +10 -0
- package/dist/format.js +5 -1
- package/dist/index.js +46 -33
- package/dist/mcp.js +56 -35
- package/package.json +2 -2
package/dist/contract.js
CHANGED
|
@@ -1,68 +1,78 @@
|
|
|
1
1
|
// src/contract.ts
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
var sessionSchema = z.
|
|
3
|
+
var sessionSchema = z.looseObject({
|
|
4
4
|
id: z.string(),
|
|
5
5
|
directory: z.string().optional(),
|
|
6
6
|
title: z.string().optional()
|
|
7
|
-
})
|
|
7
|
+
});
|
|
8
8
|
var sessionListSchema = z.array(sessionSchema);
|
|
9
|
-
var sessionStatusMapSchema = z.record(z.string(), z.
|
|
10
|
-
var todoSchema = z.array(z.
|
|
11
|
-
|
|
9
|
+
var sessionStatusMapSchema = z.record(z.string(), z.looseObject({ type: z.string() }));
|
|
10
|
+
var todoSchema = z.array(z.looseObject({
|
|
11
|
+
content: z.string(),
|
|
12
|
+
status: z.string(),
|
|
13
|
+
priority: z.string()
|
|
14
|
+
})).default([]);
|
|
15
|
+
var diffEntrySchema = z.looseObject({
|
|
12
16
|
file: z.string().optional(),
|
|
13
17
|
additions: z.number(),
|
|
14
18
|
deletions: z.number(),
|
|
15
19
|
status: z.string().optional()
|
|
16
|
-
})
|
|
20
|
+
});
|
|
17
21
|
var diffSchema = z.array(diffEntrySchema).default([]);
|
|
18
|
-
var vcsStatusEntrySchema = z.
|
|
22
|
+
var vcsStatusEntrySchema = z.looseObject({
|
|
19
23
|
file: z.string(),
|
|
20
24
|
additions: z.number(),
|
|
21
25
|
deletions: z.number(),
|
|
22
26
|
status: z.string().optional()
|
|
23
|
-
})
|
|
27
|
+
});
|
|
24
28
|
var vcsStatusSchema = z.array(vcsStatusEntrySchema).default([]);
|
|
25
29
|
var turnDiffEntrySchema = diffEntrySchema;
|
|
26
|
-
var turnMessageSchema = z.
|
|
27
|
-
info: z.
|
|
30
|
+
var turnMessageSchema = z.looseObject({
|
|
31
|
+
info: z.looseObject({
|
|
28
32
|
role: z.string(),
|
|
29
|
-
summary: z.
|
|
33
|
+
summary: z.looseObject({
|
|
30
34
|
diffs: z.array(turnDiffEntrySchema).optional()
|
|
31
|
-
}).
|
|
32
|
-
})
|
|
33
|
-
})
|
|
35
|
+
}).optional()
|
|
36
|
+
})
|
|
37
|
+
});
|
|
34
38
|
var turnMessageListSchema = z.array(turnMessageSchema);
|
|
35
|
-
var sessionSummarySchema = z.
|
|
36
|
-
summary: z.
|
|
39
|
+
var sessionSummarySchema = z.looseObject({
|
|
40
|
+
summary: z.looseObject({
|
|
37
41
|
diffs: z.array(turnDiffEntrySchema).optional()
|
|
38
|
-
}).
|
|
39
|
-
})
|
|
40
|
-
var messagePartSchema = z.
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
}).optional()
|
|
43
|
+
});
|
|
44
|
+
var messagePartSchema = z.looseObject({
|
|
45
|
+
type: z.string(),
|
|
46
|
+
text: z.string().optional()
|
|
47
|
+
});
|
|
48
|
+
var messageEnvelopeSchema = z.looseObject({
|
|
49
|
+
info: z.looseObject({ role: z.string() }),
|
|
43
50
|
parts: z.array(messagePartSchema)
|
|
44
|
-
})
|
|
51
|
+
});
|
|
45
52
|
var messageListSchema = z.array(messageEnvelopeSchema);
|
|
46
|
-
var pendingQuestionEntrySchema = z.
|
|
53
|
+
var pendingQuestionEntrySchema = z.looseObject({
|
|
47
54
|
id: z.string(),
|
|
48
55
|
sessionID: z.string(),
|
|
49
|
-
questions: z.array(z.
|
|
56
|
+
questions: z.array(z.looseObject({
|
|
50
57
|
question: z.string().optional(),
|
|
51
|
-
options: z.array(z.
|
|
52
|
-
})
|
|
53
|
-
})
|
|
58
|
+
options: z.array(z.looseObject({ label: z.string().optional() })).optional()
|
|
59
|
+
})).optional()
|
|
60
|
+
});
|
|
54
61
|
var pendingQuestionListSchema = z.array(pendingQuestionEntrySchema);
|
|
55
|
-
var questionEntrySchema = z.
|
|
62
|
+
var questionEntrySchema = z.looseObject({
|
|
63
|
+
id: z.string(),
|
|
64
|
+
sessionID: z.string()
|
|
65
|
+
});
|
|
56
66
|
var questionListSchema = z.array(questionEntrySchema);
|
|
57
|
-
var projectSchema = z.
|
|
67
|
+
var projectSchema = z.looseObject({
|
|
58
68
|
name: z.string(),
|
|
59
69
|
path: z.string(),
|
|
60
70
|
description: z.string(),
|
|
61
71
|
expandedPath: z.string(),
|
|
62
72
|
exists: z.boolean()
|
|
63
|
-
})
|
|
73
|
+
});
|
|
64
74
|
var rosterSchema = z.object({
|
|
65
|
-
server: z.object({ baseUrl: z.
|
|
75
|
+
server: z.object({ baseUrl: z.url() }),
|
|
66
76
|
projects: z.array(projectSchema)
|
|
67
77
|
});
|
|
68
78
|
var credentialsSchema = z.object({
|
package/dist/core.js
CHANGED
|
@@ -1,68 +1,78 @@
|
|
|
1
1
|
// src/contract.ts
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
var sessionSchema = z.
|
|
3
|
+
var sessionSchema = z.looseObject({
|
|
4
4
|
id: z.string(),
|
|
5
5
|
directory: z.string().optional(),
|
|
6
6
|
title: z.string().optional()
|
|
7
|
-
})
|
|
7
|
+
});
|
|
8
8
|
var sessionListSchema = z.array(sessionSchema);
|
|
9
|
-
var sessionStatusMapSchema = z.record(z.string(), z.
|
|
10
|
-
var todoSchema = z.array(z.
|
|
11
|
-
|
|
9
|
+
var sessionStatusMapSchema = z.record(z.string(), z.looseObject({ type: z.string() }));
|
|
10
|
+
var todoSchema = z.array(z.looseObject({
|
|
11
|
+
content: z.string(),
|
|
12
|
+
status: z.string(),
|
|
13
|
+
priority: z.string()
|
|
14
|
+
})).default([]);
|
|
15
|
+
var diffEntrySchema = z.looseObject({
|
|
12
16
|
file: z.string().optional(),
|
|
13
17
|
additions: z.number(),
|
|
14
18
|
deletions: z.number(),
|
|
15
19
|
status: z.string().optional()
|
|
16
|
-
})
|
|
20
|
+
});
|
|
17
21
|
var diffSchema = z.array(diffEntrySchema).default([]);
|
|
18
|
-
var vcsStatusEntrySchema = z.
|
|
22
|
+
var vcsStatusEntrySchema = z.looseObject({
|
|
19
23
|
file: z.string(),
|
|
20
24
|
additions: z.number(),
|
|
21
25
|
deletions: z.number(),
|
|
22
26
|
status: z.string().optional()
|
|
23
|
-
})
|
|
27
|
+
});
|
|
24
28
|
var vcsStatusSchema = z.array(vcsStatusEntrySchema).default([]);
|
|
25
29
|
var turnDiffEntrySchema = diffEntrySchema;
|
|
26
|
-
var turnMessageSchema = z.
|
|
27
|
-
info: z.
|
|
30
|
+
var turnMessageSchema = z.looseObject({
|
|
31
|
+
info: z.looseObject({
|
|
28
32
|
role: z.string(),
|
|
29
|
-
summary: z.
|
|
33
|
+
summary: z.looseObject({
|
|
30
34
|
diffs: z.array(turnDiffEntrySchema).optional()
|
|
31
|
-
}).
|
|
32
|
-
})
|
|
33
|
-
})
|
|
35
|
+
}).optional()
|
|
36
|
+
})
|
|
37
|
+
});
|
|
34
38
|
var turnMessageListSchema = z.array(turnMessageSchema);
|
|
35
|
-
var sessionSummarySchema = z.
|
|
36
|
-
summary: z.
|
|
39
|
+
var sessionSummarySchema = z.looseObject({
|
|
40
|
+
summary: z.looseObject({
|
|
37
41
|
diffs: z.array(turnDiffEntrySchema).optional()
|
|
38
|
-
}).
|
|
39
|
-
})
|
|
40
|
-
var messagePartSchema = z.
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
}).optional()
|
|
43
|
+
});
|
|
44
|
+
var messagePartSchema = z.looseObject({
|
|
45
|
+
type: z.string(),
|
|
46
|
+
text: z.string().optional()
|
|
47
|
+
});
|
|
48
|
+
var messageEnvelopeSchema = z.looseObject({
|
|
49
|
+
info: z.looseObject({ role: z.string() }),
|
|
43
50
|
parts: z.array(messagePartSchema)
|
|
44
|
-
})
|
|
51
|
+
});
|
|
45
52
|
var messageListSchema = z.array(messageEnvelopeSchema);
|
|
46
|
-
var pendingQuestionEntrySchema = z.
|
|
53
|
+
var pendingQuestionEntrySchema = z.looseObject({
|
|
47
54
|
id: z.string(),
|
|
48
55
|
sessionID: z.string(),
|
|
49
|
-
questions: z.array(z.
|
|
56
|
+
questions: z.array(z.looseObject({
|
|
50
57
|
question: z.string().optional(),
|
|
51
|
-
options: z.array(z.
|
|
52
|
-
})
|
|
53
|
-
})
|
|
58
|
+
options: z.array(z.looseObject({ label: z.string().optional() })).optional()
|
|
59
|
+
})).optional()
|
|
60
|
+
});
|
|
54
61
|
var pendingQuestionListSchema = z.array(pendingQuestionEntrySchema);
|
|
55
|
-
var questionEntrySchema = z.
|
|
62
|
+
var questionEntrySchema = z.looseObject({
|
|
63
|
+
id: z.string(),
|
|
64
|
+
sessionID: z.string()
|
|
65
|
+
});
|
|
56
66
|
var questionListSchema = z.array(questionEntrySchema);
|
|
57
|
-
var projectSchema = z.
|
|
67
|
+
var projectSchema = z.looseObject({
|
|
58
68
|
name: z.string(),
|
|
59
69
|
path: z.string(),
|
|
60
70
|
description: z.string(),
|
|
61
71
|
expandedPath: z.string(),
|
|
62
72
|
exists: z.boolean()
|
|
63
|
-
})
|
|
73
|
+
});
|
|
64
74
|
var rosterSchema = z.object({
|
|
65
|
-
server: z.object({ baseUrl: z.
|
|
75
|
+
server: z.object({ baseUrl: z.url() }),
|
|
66
76
|
projects: z.array(projectSchema)
|
|
67
77
|
});
|
|
68
78
|
var credentialsSchema = z.object({
|
package/dist/format.d.ts
CHANGED
|
@@ -5,5 +5,15 @@
|
|
|
5
5
|
import type { DispatchResult, RosterProject, SessionResultResult, SessionStatusResult } from "./core";
|
|
6
6
|
export declare function formatRoster(projects: RosterProject[]): string;
|
|
7
7
|
export declare function formatDispatch(r: DispatchResult): string;
|
|
8
|
+
/** Machine-readable dispatch metadata, shared verbatim by both surfaces
|
|
9
|
+
* (plugin ToolResult.metadata and MCP structuredContent) so the shapes
|
|
10
|
+
* can't drift. `sessionId` and `project` are always populated on
|
|
11
|
+
* DispatchResult (new sessions and both steering modes resolve a project). */
|
|
12
|
+
export type DispatchMetadata = {
|
|
13
|
+
sessionId: string;
|
|
14
|
+
project: string;
|
|
15
|
+
mode: DispatchResult["mode"];
|
|
16
|
+
};
|
|
17
|
+
export declare function dispatchMetadata(r: DispatchResult): DispatchMetadata;
|
|
8
18
|
export declare function formatStatus(r: SessionStatusResult): string;
|
|
9
19
|
export declare function formatResult(r: SessionResultResult): string;
|
package/dist/format.js
CHANGED
|
@@ -20,6 +20,9 @@ function formatDispatch(r) {
|
|
|
20
20
|
return `Follow-up prompt sent to session ${r.sessionId} (${r.project}).`;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
function dispatchMetadata(r) {
|
|
24
|
+
return { sessionId: r.sessionId, project: r.project, mode: r.mode };
|
|
25
|
+
}
|
|
23
26
|
function formatStatus(r) {
|
|
24
27
|
const todoLines = r.todos.length ? r.todos.map((t) => ` - [${t.status}] ${t.content} (${t.priority})`).join(`
|
|
25
28
|
`) : " (none)";
|
|
@@ -55,5 +58,6 @@ export {
|
|
|
55
58
|
formatStatus,
|
|
56
59
|
formatRoster,
|
|
57
60
|
formatResult,
|
|
58
|
-
formatDispatch
|
|
61
|
+
formatDispatch,
|
|
62
|
+
dispatchMetadata
|
|
59
63
|
};
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { homedir } from "node:os";
|
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
var manifestSchema = z.object({
|
|
7
|
-
server: z.object({ baseUrl: z.
|
|
7
|
+
server: z.object({ baseUrl: z.url() }),
|
|
8
8
|
projects: z.array(z.object({
|
|
9
9
|
name: z.string(),
|
|
10
10
|
path: z.string(),
|
|
@@ -82,69 +82,79 @@ function loadContext(directory) {
|
|
|
82
82
|
|
|
83
83
|
// src/contract.ts
|
|
84
84
|
import { z as z2 } from "zod";
|
|
85
|
-
var sessionSchema = z2.
|
|
85
|
+
var sessionSchema = z2.looseObject({
|
|
86
86
|
id: z2.string(),
|
|
87
87
|
directory: z2.string().optional(),
|
|
88
88
|
title: z2.string().optional()
|
|
89
|
-
})
|
|
89
|
+
});
|
|
90
90
|
var sessionListSchema = z2.array(sessionSchema);
|
|
91
|
-
var sessionStatusMapSchema = z2.record(z2.string(), z2.
|
|
92
|
-
var todoSchema = z2.array(z2.
|
|
93
|
-
|
|
91
|
+
var sessionStatusMapSchema = z2.record(z2.string(), z2.looseObject({ type: z2.string() }));
|
|
92
|
+
var todoSchema = z2.array(z2.looseObject({
|
|
93
|
+
content: z2.string(),
|
|
94
|
+
status: z2.string(),
|
|
95
|
+
priority: z2.string()
|
|
96
|
+
})).default([]);
|
|
97
|
+
var diffEntrySchema = z2.looseObject({
|
|
94
98
|
file: z2.string().optional(),
|
|
95
99
|
additions: z2.number(),
|
|
96
100
|
deletions: z2.number(),
|
|
97
101
|
status: z2.string().optional()
|
|
98
|
-
})
|
|
102
|
+
});
|
|
99
103
|
var diffSchema = z2.array(diffEntrySchema).default([]);
|
|
100
|
-
var vcsStatusEntrySchema = z2.
|
|
104
|
+
var vcsStatusEntrySchema = z2.looseObject({
|
|
101
105
|
file: z2.string(),
|
|
102
106
|
additions: z2.number(),
|
|
103
107
|
deletions: z2.number(),
|
|
104
108
|
status: z2.string().optional()
|
|
105
|
-
})
|
|
109
|
+
});
|
|
106
110
|
var vcsStatusSchema = z2.array(vcsStatusEntrySchema).default([]);
|
|
107
111
|
var turnDiffEntrySchema = diffEntrySchema;
|
|
108
|
-
var turnMessageSchema = z2.
|
|
109
|
-
info: z2.
|
|
112
|
+
var turnMessageSchema = z2.looseObject({
|
|
113
|
+
info: z2.looseObject({
|
|
110
114
|
role: z2.string(),
|
|
111
|
-
summary: z2.
|
|
115
|
+
summary: z2.looseObject({
|
|
112
116
|
diffs: z2.array(turnDiffEntrySchema).optional()
|
|
113
|
-
}).
|
|
114
|
-
})
|
|
115
|
-
})
|
|
117
|
+
}).optional()
|
|
118
|
+
})
|
|
119
|
+
});
|
|
116
120
|
var turnMessageListSchema = z2.array(turnMessageSchema);
|
|
117
|
-
var sessionSummarySchema = z2.
|
|
118
|
-
summary: z2.
|
|
121
|
+
var sessionSummarySchema = z2.looseObject({
|
|
122
|
+
summary: z2.looseObject({
|
|
119
123
|
diffs: z2.array(turnDiffEntrySchema).optional()
|
|
120
|
-
}).
|
|
121
|
-
})
|
|
122
|
-
var messagePartSchema = z2.
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
}).optional()
|
|
125
|
+
});
|
|
126
|
+
var messagePartSchema = z2.looseObject({
|
|
127
|
+
type: z2.string(),
|
|
128
|
+
text: z2.string().optional()
|
|
129
|
+
});
|
|
130
|
+
var messageEnvelopeSchema = z2.looseObject({
|
|
131
|
+
info: z2.looseObject({ role: z2.string() }),
|
|
125
132
|
parts: z2.array(messagePartSchema)
|
|
126
|
-
})
|
|
133
|
+
});
|
|
127
134
|
var messageListSchema = z2.array(messageEnvelopeSchema);
|
|
128
|
-
var pendingQuestionEntrySchema = z2.
|
|
135
|
+
var pendingQuestionEntrySchema = z2.looseObject({
|
|
129
136
|
id: z2.string(),
|
|
130
137
|
sessionID: z2.string(),
|
|
131
|
-
questions: z2.array(z2.
|
|
138
|
+
questions: z2.array(z2.looseObject({
|
|
132
139
|
question: z2.string().optional(),
|
|
133
|
-
options: z2.array(z2.
|
|
134
|
-
})
|
|
135
|
-
})
|
|
140
|
+
options: z2.array(z2.looseObject({ label: z2.string().optional() })).optional()
|
|
141
|
+
})).optional()
|
|
142
|
+
});
|
|
136
143
|
var pendingQuestionListSchema = z2.array(pendingQuestionEntrySchema);
|
|
137
|
-
var questionEntrySchema = z2.
|
|
144
|
+
var questionEntrySchema = z2.looseObject({
|
|
145
|
+
id: z2.string(),
|
|
146
|
+
sessionID: z2.string()
|
|
147
|
+
});
|
|
138
148
|
var questionListSchema = z2.array(questionEntrySchema);
|
|
139
|
-
var projectSchema = z2.
|
|
149
|
+
var projectSchema = z2.looseObject({
|
|
140
150
|
name: z2.string(),
|
|
141
151
|
path: z2.string(),
|
|
142
152
|
description: z2.string(),
|
|
143
153
|
expandedPath: z2.string(),
|
|
144
154
|
exists: z2.boolean()
|
|
145
|
-
})
|
|
155
|
+
});
|
|
146
156
|
var rosterSchema = z2.object({
|
|
147
|
-
server: z2.object({ baseUrl: z2.
|
|
157
|
+
server: z2.object({ baseUrl: z2.url() }),
|
|
148
158
|
projects: z2.array(projectSchema)
|
|
149
159
|
});
|
|
150
160
|
var credentialsSchema = z2.object({
|
|
@@ -707,6 +717,9 @@ function formatDispatch(r) {
|
|
|
707
717
|
return `Follow-up prompt sent to session ${r.sessionId} (${r.project}).`;
|
|
708
718
|
}
|
|
709
719
|
}
|
|
720
|
+
function dispatchMetadata(r) {
|
|
721
|
+
return { sessionId: r.sessionId, project: r.project, mode: r.mode };
|
|
722
|
+
}
|
|
710
723
|
function formatStatus(r) {
|
|
711
724
|
const todoLines = r.todos.length ? r.todos.map((t) => ` - [${t.status}] ${t.content} (${t.priority})`).join(`
|
|
712
725
|
`) : " (none)";
|
|
@@ -838,7 +851,7 @@ function makeBusTask(defaultDirectory) {
|
|
|
838
851
|
const r = await dispatch(dispatchArgs, { context });
|
|
839
852
|
if (!r.ok)
|
|
840
853
|
throw new Error(r.error);
|
|
841
|
-
return formatDispatch(r);
|
|
854
|
+
return { output: formatDispatch(r), metadata: dispatchMetadata(r) };
|
|
842
855
|
}
|
|
843
856
|
});
|
|
844
857
|
}
|
package/dist/mcp.js
CHANGED
|
@@ -5,7 +5,7 @@ import { homedir } from "node:os";
|
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
var manifestSchema = z.object({
|
|
8
|
-
server: z.object({ baseUrl: z.
|
|
8
|
+
server: z.object({ baseUrl: z.url() }),
|
|
9
9
|
projects: z.array(z.object({
|
|
10
10
|
name: z.string(),
|
|
11
11
|
path: z.string(),
|
|
@@ -83,69 +83,79 @@ function loadContext(directory) {
|
|
|
83
83
|
|
|
84
84
|
// src/contract.ts
|
|
85
85
|
import { z as z2 } from "zod";
|
|
86
|
-
var sessionSchema = z2.
|
|
86
|
+
var sessionSchema = z2.looseObject({
|
|
87
87
|
id: z2.string(),
|
|
88
88
|
directory: z2.string().optional(),
|
|
89
89
|
title: z2.string().optional()
|
|
90
|
-
})
|
|
90
|
+
});
|
|
91
91
|
var sessionListSchema = z2.array(sessionSchema);
|
|
92
|
-
var sessionStatusMapSchema = z2.record(z2.string(), z2.
|
|
93
|
-
var todoSchema = z2.array(z2.
|
|
94
|
-
|
|
92
|
+
var sessionStatusMapSchema = z2.record(z2.string(), z2.looseObject({ type: z2.string() }));
|
|
93
|
+
var todoSchema = z2.array(z2.looseObject({
|
|
94
|
+
content: z2.string(),
|
|
95
|
+
status: z2.string(),
|
|
96
|
+
priority: z2.string()
|
|
97
|
+
})).default([]);
|
|
98
|
+
var diffEntrySchema = z2.looseObject({
|
|
95
99
|
file: z2.string().optional(),
|
|
96
100
|
additions: z2.number(),
|
|
97
101
|
deletions: z2.number(),
|
|
98
102
|
status: z2.string().optional()
|
|
99
|
-
})
|
|
103
|
+
});
|
|
100
104
|
var diffSchema = z2.array(diffEntrySchema).default([]);
|
|
101
|
-
var vcsStatusEntrySchema = z2.
|
|
105
|
+
var vcsStatusEntrySchema = z2.looseObject({
|
|
102
106
|
file: z2.string(),
|
|
103
107
|
additions: z2.number(),
|
|
104
108
|
deletions: z2.number(),
|
|
105
109
|
status: z2.string().optional()
|
|
106
|
-
})
|
|
110
|
+
});
|
|
107
111
|
var vcsStatusSchema = z2.array(vcsStatusEntrySchema).default([]);
|
|
108
112
|
var turnDiffEntrySchema = diffEntrySchema;
|
|
109
|
-
var turnMessageSchema = z2.
|
|
110
|
-
info: z2.
|
|
113
|
+
var turnMessageSchema = z2.looseObject({
|
|
114
|
+
info: z2.looseObject({
|
|
111
115
|
role: z2.string(),
|
|
112
|
-
summary: z2.
|
|
116
|
+
summary: z2.looseObject({
|
|
113
117
|
diffs: z2.array(turnDiffEntrySchema).optional()
|
|
114
|
-
}).
|
|
115
|
-
})
|
|
116
|
-
})
|
|
118
|
+
}).optional()
|
|
119
|
+
})
|
|
120
|
+
});
|
|
117
121
|
var turnMessageListSchema = z2.array(turnMessageSchema);
|
|
118
|
-
var sessionSummarySchema = z2.
|
|
119
|
-
summary: z2.
|
|
122
|
+
var sessionSummarySchema = z2.looseObject({
|
|
123
|
+
summary: z2.looseObject({
|
|
120
124
|
diffs: z2.array(turnDiffEntrySchema).optional()
|
|
121
|
-
}).
|
|
122
|
-
})
|
|
123
|
-
var messagePartSchema = z2.
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
}).optional()
|
|
126
|
+
});
|
|
127
|
+
var messagePartSchema = z2.looseObject({
|
|
128
|
+
type: z2.string(),
|
|
129
|
+
text: z2.string().optional()
|
|
130
|
+
});
|
|
131
|
+
var messageEnvelopeSchema = z2.looseObject({
|
|
132
|
+
info: z2.looseObject({ role: z2.string() }),
|
|
126
133
|
parts: z2.array(messagePartSchema)
|
|
127
|
-
})
|
|
134
|
+
});
|
|
128
135
|
var messageListSchema = z2.array(messageEnvelopeSchema);
|
|
129
|
-
var pendingQuestionEntrySchema = z2.
|
|
136
|
+
var pendingQuestionEntrySchema = z2.looseObject({
|
|
130
137
|
id: z2.string(),
|
|
131
138
|
sessionID: z2.string(),
|
|
132
|
-
questions: z2.array(z2.
|
|
139
|
+
questions: z2.array(z2.looseObject({
|
|
133
140
|
question: z2.string().optional(),
|
|
134
|
-
options: z2.array(z2.
|
|
135
|
-
})
|
|
136
|
-
})
|
|
141
|
+
options: z2.array(z2.looseObject({ label: z2.string().optional() })).optional()
|
|
142
|
+
})).optional()
|
|
143
|
+
});
|
|
137
144
|
var pendingQuestionListSchema = z2.array(pendingQuestionEntrySchema);
|
|
138
|
-
var questionEntrySchema = z2.
|
|
145
|
+
var questionEntrySchema = z2.looseObject({
|
|
146
|
+
id: z2.string(),
|
|
147
|
+
sessionID: z2.string()
|
|
148
|
+
});
|
|
139
149
|
var questionListSchema = z2.array(questionEntrySchema);
|
|
140
|
-
var projectSchema = z2.
|
|
150
|
+
var projectSchema = z2.looseObject({
|
|
141
151
|
name: z2.string(),
|
|
142
152
|
path: z2.string(),
|
|
143
153
|
description: z2.string(),
|
|
144
154
|
expandedPath: z2.string(),
|
|
145
155
|
exists: z2.boolean()
|
|
146
|
-
})
|
|
156
|
+
});
|
|
147
157
|
var rosterSchema = z2.object({
|
|
148
|
-
server: z2.object({ baseUrl: z2.
|
|
158
|
+
server: z2.object({ baseUrl: z2.url() }),
|
|
149
159
|
projects: z2.array(projectSchema)
|
|
150
160
|
});
|
|
151
161
|
var credentialsSchema = z2.object({
|
|
@@ -708,6 +718,9 @@ function formatDispatch(r) {
|
|
|
708
718
|
return `Follow-up prompt sent to session ${r.sessionId} (${r.project}).`;
|
|
709
719
|
}
|
|
710
720
|
}
|
|
721
|
+
function dispatchMetadata(r) {
|
|
722
|
+
return { sessionId: r.sessionId, project: r.project, mode: r.mode };
|
|
723
|
+
}
|
|
711
724
|
function formatStatus(r) {
|
|
712
725
|
const todoLines = r.todos.length ? r.todos.map((t) => ` - [${t.status}] ${t.content} (${t.priority})`).join(`
|
|
713
726
|
`) : " (none)";
|
|
@@ -844,13 +857,13 @@ function makeBusTask(defaultDirectory) {
|
|
|
844
857
|
const r = await dispatch(dispatchArgs, { context });
|
|
845
858
|
if (!r.ok)
|
|
846
859
|
throw new Error(r.error);
|
|
847
|
-
return formatDispatch(r);
|
|
860
|
+
return { output: formatDispatch(r), metadata: dispatchMetadata(r) };
|
|
848
861
|
}
|
|
849
862
|
});
|
|
850
863
|
}
|
|
851
864
|
|
|
852
865
|
// src/mcp.ts
|
|
853
|
-
var version = "0.
|
|
866
|
+
var version = "0.5.0";
|
|
854
867
|
var server = new McpServer({
|
|
855
868
|
name: "space-bus",
|
|
856
869
|
version
|
|
@@ -880,6 +893,11 @@ server.registerTool("bus_task", {
|
|
|
880
893
|
prompt: z3.string().describe("The prompt to send to the delegated agent"),
|
|
881
894
|
title: z3.string().optional().describe("Optional session title (only used when starting a new session)"),
|
|
882
895
|
sessionId: z3.string().optional().describe("Existing session ID to steer instead of starting a new session")
|
|
896
|
+
},
|
|
897
|
+
outputSchema: {
|
|
898
|
+
sessionId: z3.string().describe("The dispatched or steered session ID"),
|
|
899
|
+
project: z3.string().describe("Manifest project name that owns the session"),
|
|
900
|
+
mode: z3.enum(["new", "question-reply", "follow-up"]).describe("How the prompt was delivered")
|
|
883
901
|
}
|
|
884
902
|
}, async (args) => {
|
|
885
903
|
const dispatchArgs = toDispatchArgs(args);
|
|
@@ -900,7 +918,10 @@ server.registerTool("bus_task", {
|
|
|
900
918
|
const r = await dispatch(dispatchArgs, { context });
|
|
901
919
|
if (!r.ok)
|
|
902
920
|
return { content: [{ type: "text", text: r.error }], isError: true };
|
|
903
|
-
return {
|
|
921
|
+
return {
|
|
922
|
+
content: [{ type: "text", text: formatDispatch(r) }],
|
|
923
|
+
structuredContent: dispatchMetadata(r)
|
|
924
|
+
};
|
|
904
925
|
});
|
|
905
926
|
server.registerTool("bus_status", {
|
|
906
927
|
description: BUS_STATUS_DESCRIPTION,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fro.bot/space-bus",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Space Bus — workspace agent bus for OpenCode. One control agent tasking per-project agents over the OpenCode server API, with an MCP facade for Claude Desktop.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
60
|
-
"zod": "^
|
|
60
|
+
"zod": "^4.4.3"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@opencode-ai/plugin": ">=1.17.13 <2"
|