@aexol/spectral 0.9.191 → 0.9.193
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/agent/agents.d.ts +2 -1
- package/dist/agent/agents.d.ts.map +1 -1
- package/dist/agent/agents.js +42 -2
- package/dist/generated/zeus/const.d.ts.map +1 -1
- package/dist/generated/zeus/const.js +1 -0
- package/dist/generated/zeus/index.d.ts +4 -0
- package/dist/generated/zeus/index.d.ts.map +1 -1
- package/dist/relay/dispatcher.d.ts.map +1 -1
- package/dist/relay/dispatcher.js +17 -9
- package/dist/sdk/coding-agent/core/agent-session.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/agent-session.js +9 -2
- package/dist/sdk/coding-agent/utils/shell.d.ts +9 -0
- package/dist/sdk/coding-agent/utils/shell.d.ts.map +1 -1
- package/dist/sdk/coding-agent/utils/shell.js +18 -0
- package/dist/server/agent-bridge.d.ts +6 -0
- package/dist/server/agent-bridge.d.ts.map +1 -1
- package/dist/server/agent-bridge.js +29 -5
- package/dist/server/handlers/agent-settings.js +1 -1
- package/dist/server/handlers/sessions.d.ts +4 -4
- package/dist/server/handlers/sessions.d.ts.map +1 -1
- package/dist/server/handlers/sessions.js +26 -8
- package/dist/server/session-stream.d.ts +36 -1
- package/dist/server/session-stream.d.ts.map +1 -1
- package/dist/server/session-stream.js +181 -11
- package/dist/server/wire.d.ts +66 -0
- package/dist/server/wire.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/agent/agents.d.ts
CHANGED
|
@@ -6,13 +6,14 @@ export interface AgentConfig {
|
|
|
6
6
|
mode: AgentMode;
|
|
7
7
|
model?: string;
|
|
8
8
|
systemPrompt: string;
|
|
9
|
-
source: "user" | "project" | "cloud";
|
|
9
|
+
source: "user" | "project" | "cloud" | "system";
|
|
10
10
|
filePath: string;
|
|
11
11
|
}
|
|
12
12
|
export interface AgentDiscoveryResult {
|
|
13
13
|
agents: AgentConfig[];
|
|
14
14
|
projectAgentsDir: string | null;
|
|
15
15
|
}
|
|
16
|
+
export declare const SYSTEM_AGENTS: AgentConfig[];
|
|
16
17
|
export declare function setCloudAgents(agents: AgentConfig[], teamId?: string): void;
|
|
17
18
|
/**
|
|
18
19
|
* Outcome of a cloud-agent refresh. Lets callers react to auth rejection
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/agent/agents.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AACrD,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AAC/C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/agent/agents.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AACrD,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AAC/C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;IAChD,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;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,cAAc,GAAG,OAAO,GAAG,QAAQ,CAC7D,GAAG,IAAI,GACP,MAAM,GAAG,SAAS,CAQpB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,IAAI,CACT,WAAW,EACX,MAAM,GAAG,aAAa,GAAG,cAAc,GAAG,OAAO,GAAG,QAAQ,CAC7D,GAAG,IAAI,GACP,MAAM,CAgBR"}
|
package/dist/agent/agents.js
CHANGED
|
@@ -3,6 +3,40 @@ import * as path from "node:path";
|
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import { getAgentDir, parseFrontmatter } from "../sdk/coding-agent/index.js";
|
|
5
5
|
import { classifyGraphqlError, createBackendClient, graphqlErrorMessage, scalars, } from "../generated/graphql-client.js";
|
|
6
|
+
export const SYSTEM_AGENTS = [
|
|
7
|
+
{
|
|
8
|
+
name: "ghost",
|
|
9
|
+
description: "Built-in orchestrator primary agent that delegates work to researcher, executor, and reviewer subagents.",
|
|
10
|
+
mode: "primary",
|
|
11
|
+
systemPrompt: "You are ghost, the built-in system orchestrator. Plan the work, then delegate by calling the `subagent` tool with one of your subagents, then integrate the results into a coherent outcome.\n\nYour subagents (call them via the `subagent` tool, e.g. subagent(agent=\"researcher\", task=\"...\")):\n- `researcher` — investigate the codebase, read code and documentation, and report precise, cited findings without making changes.\n- `executor` — implement the requested changes minimally and safely, run verification, and report exactly what changed with evidence.\n- `reviewer` — review proposed or implemented changes for correctness, edge cases, security, and consistency with the codebase.\n\nDelegate the actual work to the appropriate subagent instead of doing it yourself; use `researcher` for research/investigation, `executor` for implementation, and `reviewer` for review.",
|
|
12
|
+
source: "system",
|
|
13
|
+
filePath: "system:ghost",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: "researcher",
|
|
17
|
+
description: "Built-in system subagent that researches code, documentation, and context for ghost.",
|
|
18
|
+
mode: "subagent",
|
|
19
|
+
systemPrompt: "You are the researcher subagent for ghost. Gather relevant context, read code and documentation, and report precise, cited findings without making changes.",
|
|
20
|
+
source: "system",
|
|
21
|
+
filePath: "system:researcher",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "executor",
|
|
25
|
+
description: "Built-in system subagent that implements changes and runs verification for ghost.",
|
|
26
|
+
mode: "subagent",
|
|
27
|
+
systemPrompt: "You are the executor subagent for ghost. Implement the requested changes minimally and safely, run the relevant verification commands, and report exactly what changed and the evidence.",
|
|
28
|
+
source: "system",
|
|
29
|
+
filePath: "system:executor",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "reviewer",
|
|
33
|
+
description: "Built-in system subagent that reviews changes for correctness, safety, and quality for ghost.",
|
|
34
|
+
mode: "subagent",
|
|
35
|
+
systemPrompt: "You are the reviewer subagent for ghost. Review the proposed and implemented changes for correctness, edge cases, security, and consistency with the codebase, then report concrete findings and any required fixes.",
|
|
36
|
+
source: "system",
|
|
37
|
+
filePath: "system:reviewer",
|
|
38
|
+
},
|
|
39
|
+
];
|
|
6
40
|
function loadAgentsFromDir(dir, source) {
|
|
7
41
|
const agents = [];
|
|
8
42
|
if (!fs.existsSync(dir))
|
|
@@ -86,12 +120,14 @@ export async function refreshCloudAgents(opts) {
|
|
|
86
120
|
model: true,
|
|
87
121
|
mode: true,
|
|
88
122
|
scope: true,
|
|
123
|
+
source: true,
|
|
89
124
|
},
|
|
90
125
|
],
|
|
91
126
|
});
|
|
92
127
|
const fetched = result.agents ?? [];
|
|
93
128
|
const agents = fetched
|
|
94
|
-
.filter((a) =>
|
|
129
|
+
.filter((a) => a.source !== "SYSTEM" &&
|
|
130
|
+
typeof a.name === "string" &&
|
|
95
131
|
typeof a.description === "string" &&
|
|
96
132
|
typeof a.systemPrompt === "string")
|
|
97
133
|
.map((a) => ({
|
|
@@ -164,6 +200,8 @@ export function discoverAgents(cwd, scope, agentDir, teamId) {
|
|
|
164
200
|
? getCloudAgentCache(teamId ?? LEGACY_CLOUD_TEAM).agents
|
|
165
201
|
: [];
|
|
166
202
|
const agentMap = new Map();
|
|
203
|
+
for (const agent of SYSTEM_AGENTS)
|
|
204
|
+
agentMap.set(agent.name, agent);
|
|
167
205
|
for (const agent of cloudAgents)
|
|
168
206
|
agentMap.set(agent.name, agent);
|
|
169
207
|
for (const agent of projectAgents)
|
|
@@ -242,7 +280,9 @@ export function agentMetadataBlock(agent) {
|
|
|
242
280
|
? "cloud backend (managed in Aexol Studio; not a local file)"
|
|
243
281
|
: agent.source === "project"
|
|
244
282
|
? "project file (.spectral/agents)"
|
|
245
|
-
:
|
|
283
|
+
: agent.source === "system"
|
|
284
|
+
? "built-in system agent (read-only)"
|
|
285
|
+
: "user file (~/.spectral/agents)";
|
|
246
286
|
lines.push(`Source: ${sourceLabel}`);
|
|
247
287
|
return `\n\n## Agent metadata\n${lines.map((l) => `- ${l}`).join("\n")}`;
|
|
248
288
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../../src/generated/zeus/const.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAC,GAAG,CAkyB5C,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../../src/generated/zeus/const.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAC,GAAG,CAkyB5C,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAC,GAAG,CAmmC1C,CAAA;AAED,eAAO,MAAM,GAAG;;;;CAIf,CAAA"}
|
|
@@ -735,6 +735,7 @@ export type ValueTypes = {
|
|
|
735
735
|
mode?: boolean | `@${string}`;
|
|
736
736
|
scope?: boolean | `@${string}`;
|
|
737
737
|
source?: boolean | `@${string}`;
|
|
738
|
+
readonly?: boolean | `@${string}`;
|
|
738
739
|
createdAt?: boolean | `@${string}`;
|
|
739
740
|
updatedAt?: boolean | `@${string}`;
|
|
740
741
|
parent?: ValueTypes["Agent"];
|
|
@@ -3056,6 +3057,7 @@ export type ResolverInputTypes = {
|
|
|
3056
3057
|
mode?: boolean | `@${string}`;
|
|
3057
3058
|
scope?: boolean | `@${string}`;
|
|
3058
3059
|
source?: boolean | `@${string}`;
|
|
3060
|
+
readonly?: boolean | `@${string}`;
|
|
3059
3061
|
createdAt?: boolean | `@${string}`;
|
|
3060
3062
|
updatedAt?: boolean | `@${string}`;
|
|
3061
3063
|
parent?: ResolverInputTypes["Agent"];
|
|
@@ -5284,6 +5286,7 @@ export type ModelTypes = {
|
|
|
5284
5286
|
mode: ModelTypes["AgentMode"];
|
|
5285
5287
|
scope: ModelTypes["PresetScope"];
|
|
5286
5288
|
source: ModelTypes["AgentSource"];
|
|
5289
|
+
readonly: boolean;
|
|
5287
5290
|
createdAt: ModelTypes["DateTime"];
|
|
5288
5291
|
updatedAt: ModelTypes["DateTime"];
|
|
5289
5292
|
parent?: ModelTypes["Agent"] | undefined | null;
|
|
@@ -6984,6 +6987,7 @@ export type GraphQLTypes = {
|
|
|
6984
6987
|
mode: GraphQLTypes["AgentMode"];
|
|
6985
6988
|
scope: GraphQLTypes["PresetScope"];
|
|
6986
6989
|
source: GraphQLTypes["AgentSource"];
|
|
6990
|
+
readonly: boolean;
|
|
6987
6991
|
createdAt: GraphQLTypes["DateTime"];
|
|
6988
6992
|
updatedAt: GraphQLTypes["DateTime"];
|
|
6989
6993
|
parent?: GraphQLTypes["Agent"] | undefined | null;
|