@agntk/core 0.1.2 → 0.3.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 +56 -90
- package/dist/advanced/index.d.ts +9 -2
- package/dist/advanced/index.d.ts.map +1 -1
- package/dist/advanced/index.js +13 -2
- package/dist/advanced/index.js.map +1 -1
- package/dist/agent.d.ts +27 -31
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +251 -280
- package/dist/agent.js.map +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +16 -4
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/loader.d.ts +14 -6
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +38 -16
- package/dist/config/loader.js.map +1 -1
- package/dist/config/schema.d.ts +52 -52
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +1 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/evals/runner.js +16 -9
- package/dist/evals/runner.js.map +1 -1
- package/dist/evals/types.d.ts +1 -1
- package/dist/evals/types.d.ts.map +1 -1
- package/dist/guardrails/runner.d.ts.map +1 -1
- package/dist/guardrails/runner.js +4 -0
- package/dist/guardrails/runner.js.map +1 -1
- package/dist/index.d.ts +9 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -10
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +24 -1
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +50 -4
- package/dist/models.js.map +1 -1
- package/dist/observability/langfuse.d.ts +2 -2
- package/dist/observability/langfuse.d.ts.map +1 -1
- package/dist/observability/langfuse.js +39 -17
- package/dist/observability/langfuse.js.map +1 -1
- package/dist/presets/sub-agent-configs.d.ts +11 -3
- package/dist/presets/sub-agent-configs.d.ts.map +1 -1
- package/dist/presets/sub-agent-configs.js +5 -10
- package/dist/presets/sub-agent-configs.js.map +1 -1
- package/dist/presets/tools.d.ts +3 -3
- package/dist/provider-resolver.d.ts +38 -0
- package/dist/provider-resolver.d.ts.map +1 -0
- package/dist/provider-resolver.js +142 -0
- package/dist/provider-resolver.js.map +1 -0
- package/dist/reflection.d.ts +5 -2
- package/dist/reflection.d.ts.map +1 -1
- package/dist/reflection.js +8 -3
- package/dist/reflection.js.map +1 -1
- package/dist/skills/loader.d.ts +18 -0
- package/dist/skills/loader.d.ts.map +1 -1
- package/dist/skills/loader.js +58 -2
- package/dist/skills/loader.js.map +1 -1
- package/dist/system-detect.d.ts +59 -0
- package/dist/system-detect.d.ts.map +1 -0
- package/dist/system-detect.js +193 -0
- package/dist/system-detect.js.map +1 -0
- package/dist/tools/file/tools.d.ts.map +1 -1
- package/dist/tools/file/tools.js +30 -1
- package/dist/tools/file/tools.js.map +1 -1
- package/dist/tools/index.d.ts +0 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +0 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/plan/tools.d.ts +1 -1
- package/dist/tools/plan/types.d.ts +2 -2
- package/dist/tools/progress/index.d.ts +1 -1
- package/dist/tools/shell/background.d.ts.map +1 -1
- package/dist/tools/shell/background.js +45 -3
- package/dist/tools/shell/background.js.map +1 -1
- package/dist/tools/shell/tools.d.ts.map +1 -1
- package/dist/tools/shell/tools.js +9 -2
- package/dist/tools/shell/tools.js.map +1 -1
- package/dist/tools/spawn-agent/index.d.ts +7 -9
- package/dist/tools/spawn-agent/index.d.ts.map +1 -1
- package/dist/tools/spawn-agent/index.js +2 -4
- package/dist/tools/spawn-agent/index.js.map +1 -1
- package/dist/tools/utils/shell.d.ts +14 -0
- package/dist/tools/utils/shell.d.ts.map +1 -1
- package/dist/tools/utils/shell.js +171 -12
- package/dist/tools/utils/shell.js.map +1 -1
- package/dist/types/agent.d.ts +75 -195
- package/dist/types/agent.d.ts.map +1 -1
- package/dist/types/agent.js +4 -2
- package/dist/types/agent.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/usage-limits.d.ts +1 -1
- package/dist/usage-limits.js +1 -1
- package/dist/workflow/index.d.ts +1 -5
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/index.js +1 -9
- package/dist/workflow/index.js.map +1 -1
- package/dist/wrappers/best-of-n.d.ts +1 -1
- package/dist/wrappers/best-of-n.d.ts.map +1 -1
- package/dist/wrappers/best-of-n.js +11 -6
- package/dist/wrappers/best-of-n.js.map +1 -1
- package/package.json +4 -14
- package/dist/pool/index.d.ts +0 -7
- package/dist/pool/index.d.ts.map +0 -1
- package/dist/pool/index.js +0 -6
- package/dist/pool/index.js.map +0 -1
- package/dist/pool/specialist-pool.d.ts +0 -59
- package/dist/pool/specialist-pool.d.ts.map +0 -1
- package/dist/pool/specialist-pool.js +0 -224
- package/dist/pool/specialist-pool.js.map +0 -1
- package/dist/pool/tools.d.ts +0 -63
- package/dist/pool/tools.d.ts.map +0 -1
- package/dist/pool/tools.js +0 -83
- package/dist/pool/tools.js.map +0 -1
- package/dist/pool/types.d.ts +0 -79
- package/dist/pool/types.d.ts.map +0 -1
- package/dist/pool/types.js +0 -5
- package/dist/pool/types.js.map +0 -1
- package/dist/presets/index.d.ts +0 -5
- package/dist/presets/index.d.ts.map +0 -1
- package/dist/presets/index.js +0 -5
- package/dist/presets/index.js.map +0 -1
- package/dist/presets/role-registry.d.ts +0 -41
- package/dist/presets/role-registry.d.ts.map +0 -1
- package/dist/presets/role-registry.js +0 -213
- package/dist/presets/role-registry.js.map +0 -1
- package/dist/presets/roles.d.ts +0 -105
- package/dist/presets/roles.d.ts.map +0 -1
- package/dist/presets/roles.js +0 -207
- package/dist/presets/roles.js.map +0 -1
- package/dist/tools/factory.d.ts +0 -109
- package/dist/tools/factory.d.ts.map +0 -1
- package/dist/tools/factory.js +0 -166
- package/dist/tools/factory.js.map +0 -1
- package/dist/workflow/builders/adapt.d.ts +0 -20
- package/dist/workflow/builders/adapt.d.ts.map +0 -1
- package/dist/workflow/builders/adapt.js +0 -33
- package/dist/workflow/builders/adapt.js.map +0 -1
- package/dist/workflow/builders/index.d.ts +0 -8
- package/dist/workflow/builders/index.d.ts.map +0 -1
- package/dist/workflow/builders/index.js +0 -7
- package/dist/workflow/builders/index.js.map +0 -1
- package/dist/workflow/builders/parallel.d.ts +0 -25
- package/dist/workflow/builders/parallel.d.ts.map +0 -1
- package/dist/workflow/builders/parallel.js +0 -60
- package/dist/workflow/builders/parallel.js.map +0 -1
- package/dist/workflow/builders/pipeline.d.ts +0 -22
- package/dist/workflow/builders/pipeline.d.ts.map +0 -1
- package/dist/workflow/builders/pipeline.js +0 -48
- package/dist/workflow/builders/pipeline.js.map +0 -1
- package/dist/workflow/builders/types.d.ts +0 -54
- package/dist/workflow/builders/types.d.ts.map +0 -1
- package/dist/workflow/builders/types.js +0 -5
- package/dist/workflow/builders/types.js.map +0 -1
- package/dist/workflow/schedulers.d.ts +0 -231
- package/dist/workflow/schedulers.d.ts.map +0 -1
- package/dist/workflow/schedulers.js +0 -250
- package/dist/workflow/schedulers.js.map +0 -1
- package/dist/workflow/team/create-team.d.ts +0 -34
- package/dist/workflow/team/create-team.d.ts.map +0 -1
- package/dist/workflow/team/create-team.js +0 -242
- package/dist/workflow/team/create-team.js.map +0 -1
- package/dist/workflow/team/index.d.ts +0 -9
- package/dist/workflow/team/index.d.ts.map +0 -1
- package/dist/workflow/team/index.js +0 -8
- package/dist/workflow/team/index.js.map +0 -1
- package/dist/workflow/team/machines.d.ts +0 -152
- package/dist/workflow/team/machines.d.ts.map +0 -1
- package/dist/workflow/team/machines.js +0 -197
- package/dist/workflow/team/machines.js.map +0 -1
- package/dist/workflow/team/task-board.d.ts +0 -47
- package/dist/workflow/team/task-board.d.ts.map +0 -1
- package/dist/workflow/team/task-board.js +0 -111
- package/dist/workflow/team/task-board.js.map +0 -1
- package/dist/workflow/team/tools.d.ts +0 -66
- package/dist/workflow/team/tools.d.ts.map +0 -1
- package/dist/workflow/team/tools.js +0 -100
- package/dist/workflow/team/tools.js.map +0 -1
- package/dist/workflow/team/types.d.ts +0 -109
- package/dist/workflow/team/types.d.ts.map +0 -1
- package/dist/workflow/team/types.js +0 -5
- package/dist/workflow/team/types.js.map +0 -1
- package/dist/workflow/templates.d.ts +0 -71
- package/dist/workflow/templates.d.ts.map +0 -1
- package/dist/workflow/templates.js +0 -132
- package/dist/workflow/templates.js.map +0 -1
package/dist/pool/tools.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview AI SDK tools for SpecialistPool interaction.
|
|
3
|
-
*
|
|
4
|
-
* - spawn_specialist: Spawn or reuse a cached domain specialist.
|
|
5
|
-
* - list_specialists: List all cached specialists and their state.
|
|
6
|
-
*/
|
|
7
|
-
import { z } from 'zod';
|
|
8
|
-
import { tool } from 'ai';
|
|
9
|
-
// ============================================================================
|
|
10
|
-
// spawn_specialist
|
|
11
|
-
// ============================================================================
|
|
12
|
-
export function createSpawnSpecialistTool(pool) {
|
|
13
|
-
return tool({
|
|
14
|
-
description: 'Spawn or reuse a cached domain specialist. If a specialist for the given domain ' +
|
|
15
|
-
'already exists and has not expired, it is reused. Otherwise a new specialist is created ' +
|
|
16
|
-
'with the specified role, skills, and instructions.',
|
|
17
|
-
inputSchema: z.object({
|
|
18
|
-
domain: z.string().describe('Domain/specialty name (used as cache key).'),
|
|
19
|
-
role: z
|
|
20
|
-
.enum(['generic', 'coder', 'researcher', 'analyst'])
|
|
21
|
-
.optional()
|
|
22
|
-
.describe('Agent role. Default: generic.'),
|
|
23
|
-
skills: z
|
|
24
|
-
.array(z.string())
|
|
25
|
-
.optional()
|
|
26
|
-
.describe('Skill directory paths or skill names to inject.'),
|
|
27
|
-
instructions: z
|
|
28
|
-
.string()
|
|
29
|
-
.optional()
|
|
30
|
-
.describe('Custom system prompt instructions for this specialist.'),
|
|
31
|
-
prompt: z.string().describe('The prompt/task to send to the specialist.'),
|
|
32
|
-
}),
|
|
33
|
-
execute: async ({ domain, role, skills, instructions, prompt }) => {
|
|
34
|
-
const cached = await pool.spawn({ domain, role, skills, instructions });
|
|
35
|
-
const response = await pool.generate(domain, prompt);
|
|
36
|
-
return {
|
|
37
|
-
domain: cached.domain,
|
|
38
|
-
response,
|
|
39
|
-
useCount: cached.useCount,
|
|
40
|
-
skills: cached.agent.skills,
|
|
41
|
-
fromCache: cached.useCount > 1,
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
// ============================================================================
|
|
47
|
-
// list_specialists
|
|
48
|
-
// ============================================================================
|
|
49
|
-
export function createListSpecialistsTool(pool) {
|
|
50
|
-
return tool({
|
|
51
|
-
description: 'List all cached specialists in the pool with their domain, age, usage count, ' +
|
|
52
|
-
'history length, and expiration status.',
|
|
53
|
-
inputSchema: z.object({}),
|
|
54
|
-
execute: async () => {
|
|
55
|
-
const specialists = pool.list();
|
|
56
|
-
return {
|
|
57
|
-
count: specialists.length,
|
|
58
|
-
specialists: specialists.map((s) => ({
|
|
59
|
-
domain: s.domain,
|
|
60
|
-
useCount: s.useCount,
|
|
61
|
-
historyLength: s.historyLength,
|
|
62
|
-
expired: s.expired,
|
|
63
|
-
skills: s.skills,
|
|
64
|
-
ageMs: Date.now() - s.createdAt,
|
|
65
|
-
lastUsedMs: Date.now() - s.lastUsedAt,
|
|
66
|
-
})),
|
|
67
|
-
};
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
// ============================================================================
|
|
72
|
-
// Factory
|
|
73
|
-
// ============================================================================
|
|
74
|
-
/**
|
|
75
|
-
* Create all pool tools for use with an Agent's tool set.
|
|
76
|
-
*/
|
|
77
|
-
export function createPoolTools(pool) {
|
|
78
|
-
return {
|
|
79
|
-
spawn_specialist: createSpawnSpecialistTool(pool),
|
|
80
|
-
list_specialists: createListSpecialistsTool(pool),
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=tools.js.map
|
package/dist/p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ClD,OAAO;QACL,gBAAgB,EAAE,yBAAyB,CAAC,IAAI,CAAC;QACjD,gBAAgB,EAAE,yBAAyB,CAAC,IAAI,CAAC;KAClD,CAAC;AACJ,CAAC"}
|
package/dist/pool/types.d.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Types for the SpecialistPool.
|
|
3
|
-
*/
|
|
4
|
-
import type { AgentOptions, AgentRole } from '../types/agent.js';
|
|
5
|
-
/** History management strategy for cached specialists. */
|
|
6
|
-
export type HistoryStrategy = 'full' | 'sliding-window' | 'summary';
|
|
7
|
-
/** Configuration for a specialist in the pool. */
|
|
8
|
-
export interface SpecialistConfig {
|
|
9
|
-
/** Domain/specialty name (used as cache key). */
|
|
10
|
-
domain: string;
|
|
11
|
-
/** Agent role. Default: 'generic'. */
|
|
12
|
-
role?: AgentRole;
|
|
13
|
-
/** Skills to inject (directory paths or skill names). */
|
|
14
|
-
skills?: string[];
|
|
15
|
-
/** Custom system prompt (appended to role prompt + skills). */
|
|
16
|
-
instructions?: string;
|
|
17
|
-
/** History strategy for conversation continuity. Default: 'full'. */
|
|
18
|
-
historyStrategy?: HistoryStrategy;
|
|
19
|
-
/** Max messages for sliding-window strategy. Default: 20. */
|
|
20
|
-
historyWindowSize?: number;
|
|
21
|
-
/** Additional agent options. */
|
|
22
|
-
agentOptions?: Partial<AgentOptions>;
|
|
23
|
-
}
|
|
24
|
-
/** A cached specialist entry. */
|
|
25
|
-
export interface CachedSpecialist {
|
|
26
|
-
/** Domain name. */
|
|
27
|
-
domain: string;
|
|
28
|
-
/** The specialist agent. */
|
|
29
|
-
agent: SpecialistAgent;
|
|
30
|
-
/** When this specialist was created. */
|
|
31
|
-
createdAt: number;
|
|
32
|
-
/** When this specialist was last used. */
|
|
33
|
-
lastUsedAt: number;
|
|
34
|
-
/** Number of times this specialist has been used. */
|
|
35
|
-
useCount: number;
|
|
36
|
-
/** Conversation history (for stateful specialists). */
|
|
37
|
-
history: ConversationMessage[];
|
|
38
|
-
}
|
|
39
|
-
/** A message in conversation history. */
|
|
40
|
-
export interface ConversationMessage {
|
|
41
|
-
role: 'user' | 'assistant';
|
|
42
|
-
content: string;
|
|
43
|
-
timestamp: number;
|
|
44
|
-
}
|
|
45
|
-
/** A specialist agent with metadata. */
|
|
46
|
-
export interface SpecialistAgent {
|
|
47
|
-
/** Generate a response. */
|
|
48
|
-
generate: (input: {
|
|
49
|
-
prompt: string;
|
|
50
|
-
}) => Promise<{
|
|
51
|
-
text: string;
|
|
52
|
-
[key: string]: unknown;
|
|
53
|
-
}>;
|
|
54
|
-
/** The domain this specialist serves. */
|
|
55
|
-
domain: string;
|
|
56
|
-
/** Skills loaded for this specialist. */
|
|
57
|
-
skills: string[];
|
|
58
|
-
}
|
|
59
|
-
/** Configuration for the SpecialistPool. */
|
|
60
|
-
export interface SpecialistPoolConfig {
|
|
61
|
-
/** Maximum number of cached specialists. Default: 10. */
|
|
62
|
-
maxAgents?: number;
|
|
63
|
-
/** TTL for cached specialists (ms). Default: 30 minutes. */
|
|
64
|
-
ttlMs?: number;
|
|
65
|
-
/** Default history strategy. Default: 'full'. */
|
|
66
|
-
defaultHistoryStrategy?: HistoryStrategy;
|
|
67
|
-
/** Default sliding-window size. Default: 20. */
|
|
68
|
-
defaultWindowSize?: number;
|
|
69
|
-
/** Factory function to create agent instances. */
|
|
70
|
-
createAgent: (options: AgentOptions) => {
|
|
71
|
-
generate: (input: {
|
|
72
|
-
prompt: string;
|
|
73
|
-
}) => Promise<{
|
|
74
|
-
text: string;
|
|
75
|
-
[key: string]: unknown;
|
|
76
|
-
}>;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/pool/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/pool/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,E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E,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC,CAAC;IAC3F,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,4CAA4C;AAC5C,MAAM,WAAW,oBAAoB;IACnC,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,sBAAsB,CAAC,EAAE,eAAe,CAAC;IACzC,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kDAAkD;IAClD,WAAW,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK;QAAE,QAAQ,EAAE,CAAC,KAAK,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,KAAK,OAAO,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC;CACxI"}
|
package/dist/pool/types.js
DELETED
package/dist/pool/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/pool/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/dist/presets/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @agntk/core - Presets Module Index
|
|
3
|
-
*/
|
|
4
|
-
export { roleConfigs, rolePrompts, systemPrompts, roleCallOptionsSchemas, AGENT_ROLES, SPAWNED_AGENT_CONTEXT, buildSpawnedAgentPrompt, getRoleSystemPrompt, getRoleCallOptionsSchema, type AgentRole, type RoleConfig, } from './roles.js';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/presets/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,WAAW,EACX,WAAW,EACX,aAAa,EACb,sBAAsB,EACtB,WAAW,EACX,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,KAAK,SAAS,EACd,KAAK,UAAU,GAChB,MAAM,SAAS,CAAC"}
|
package/dist/presets/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @agntk/core - Presets Module Index
|
|
3
|
-
*/
|
|
4
|
-
export { roleConfigs, rolePrompts, systemPrompts, roleCallOptionsSchemas, AGENT_ROLES, SPAWNED_AGENT_CONTEXT, buildSpawnedAgentPrompt, getRoleSystemPrompt, getRoleCallOptionsSchema, } from './roles.js';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/presets/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,WAAW,EACX,WAAW,EACX,aAAa,EACb,sBAAsB,EACtB,WAAW,EACX,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,GAGzB,MAAM,SAAS,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Role Registry - manages built-in and custom roles.
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
export interface RoleDefinition {
|
|
6
|
-
/** System prompt for this role */
|
|
7
|
-
systemPrompt: string;
|
|
8
|
-
/** Zod schema for call options */
|
|
9
|
-
callOptionsSchema?: z.ZodType;
|
|
10
|
-
/** Default tools to include */
|
|
11
|
-
defaultTools?: string[];
|
|
12
|
-
/** Recommended model tier */
|
|
13
|
-
recommendedModel?: 'fast' | 'standard' | 'reasoning' | 'powerful';
|
|
14
|
-
}
|
|
15
|
-
declare const BASE_SYSTEM_PROMPT = "You are an AI assistant with access to tools for completing tasks.\n\n**Guidelines:**\n- Be direct and concise in your responses\n- Use tools when they would help accomplish the task\n- Explain your reasoning when making decisions\n- Ask for clarification if the request is ambiguous\n- Complete tasks step by step, validating progress";
|
|
16
|
-
/**
|
|
17
|
-
* Register a role in the registry.
|
|
18
|
-
*/
|
|
19
|
-
export declare function registerRole(name: string, definition: RoleDefinition): void;
|
|
20
|
-
/**
|
|
21
|
-
* Get a role from the registry.
|
|
22
|
-
* Falls back to built-in roles, then generic.
|
|
23
|
-
* Templates are applied to the system prompt.
|
|
24
|
-
*/
|
|
25
|
-
export declare function getRole(name: string): RoleDefinition;
|
|
26
|
-
/**
|
|
27
|
-
* Get all registered role names.
|
|
28
|
-
*/
|
|
29
|
-
export declare function getAllRoleNames(): string[];
|
|
30
|
-
/**
|
|
31
|
-
* Check if a role exists.
|
|
32
|
-
*/
|
|
33
|
-
export declare function hasRole(name: string): boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Reset the registry (for testing).
|
|
36
|
-
*/
|
|
37
|
-
export declare function resetRoleRegistry(): void;
|
|
38
|
-
export declare const SPAWNED_AGENT_CONTEXT = "\n# Context: Spawned Sub-Agent\n\nYou are running as a sub-agent spawned by a parent agent to handle a delegated task.\n\n**Constraints:**\n- The delegate tool is disabled to prevent infinite recursion\n- Focus on completing the delegated task autonomously\n";
|
|
39
|
-
export declare function buildSpawnedAgentPrompt(role: string): string;
|
|
40
|
-
export { BASE_SYSTEM_PROMPT };
|
|
41
|
-
//# sourceMappingURL=role-registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"role-registry.d.ts","sourceRoot":"","sources":["../../src/presets/role-registry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,MAAM,WAAW,cAAc;IAC7B,kCAAkC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,iBAAiB,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IAC9B,+BAA+B;IAC/B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,6BAA6B;IAC7B,gBAAgB,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;CACnE;AAaD,QAAA,MAAM,kBAAkB,oVAO2B,CAAC;AA0FpD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,GAAG,IAAI,CAG3E;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAoBpD;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAK1C;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAG7C;AA2CD;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAGxC;AAMD,eAAO,MAAM,qBAAqB,uQAQjC,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG5D;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Role Registry - manages built-in and custom roles.
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
import { createLogger } from '@agntk/logger';
|
|
6
|
-
import { getConfig } from '../config/index.js';
|
|
7
|
-
import { applyTemplate } from '../prompts/template.js';
|
|
8
|
-
const log = createLogger('@agntk/core:roles');
|
|
9
|
-
// ============================================================================
|
|
10
|
-
// Registry State
|
|
11
|
-
// ============================================================================
|
|
12
|
-
const roleRegistry = new Map();
|
|
13
|
-
let configRolesLoaded = false;
|
|
14
|
-
// ============================================================================
|
|
15
|
-
// Base System Prompt
|
|
16
|
-
// ============================================================================
|
|
17
|
-
const BASE_SYSTEM_PROMPT = `You are an AI assistant with access to tools for completing tasks.
|
|
18
|
-
|
|
19
|
-
**Guidelines:**
|
|
20
|
-
- Be direct and concise in your responses
|
|
21
|
-
- Use tools when they would help accomplish the task
|
|
22
|
-
- Explain your reasoning when making decisions
|
|
23
|
-
- Ask for clarification if the request is ambiguous
|
|
24
|
-
- Complete tasks step by step, validating progress`;
|
|
25
|
-
// ============================================================================
|
|
26
|
-
// Built-in Role Prompts
|
|
27
|
-
// ============================================================================
|
|
28
|
-
const ROLE_PROMPTS = {
|
|
29
|
-
generic: '',
|
|
30
|
-
researcher: `
|
|
31
|
-
# Role: Research Specialist
|
|
32
|
-
|
|
33
|
-
You excel at gathering, verifying, and synthesizing information from multiple sources.
|
|
34
|
-
|
|
35
|
-
**Core competencies:**
|
|
36
|
-
- Web search and documentation retrieval
|
|
37
|
-
- Cross-referencing claims across sources
|
|
38
|
-
- Distinguishing fact from speculation
|
|
39
|
-
- Summarizing complex topics clearly
|
|
40
|
-
|
|
41
|
-
**Quality standards:**
|
|
42
|
-
- Cite sources for factual claims
|
|
43
|
-
- Explicitly state confidence levels
|
|
44
|
-
- Acknowledge when information is incomplete`,
|
|
45
|
-
coder: `
|
|
46
|
-
# Role: Software Engineer
|
|
47
|
-
|
|
48
|
-
You write production-quality code that integrates cleanly with existing systems.
|
|
49
|
-
|
|
50
|
-
**Core competencies:**
|
|
51
|
-
- Reading and understanding existing codebases
|
|
52
|
-
- Writing clean, maintainable code
|
|
53
|
-
- Testing and validation
|
|
54
|
-
- Debugging and error diagnosis
|
|
55
|
-
|
|
56
|
-
**Quality standards:**
|
|
57
|
-
- Follow patterns established in the codebase
|
|
58
|
-
- Write tests for new functionality
|
|
59
|
-
- Consistent formatting with the codebase
|
|
60
|
-
- Meaningful variable and function names`,
|
|
61
|
-
analyst: `
|
|
62
|
-
# Role: Data Analyst
|
|
63
|
-
|
|
64
|
-
You analyze information to extract insights and support decision-making.
|
|
65
|
-
|
|
66
|
-
**Core competencies:**
|
|
67
|
-
- Pattern recognition across datasets
|
|
68
|
-
- Statistical reasoning
|
|
69
|
-
- Hypothesis formation and testing
|
|
70
|
-
- Clear communication of findings
|
|
71
|
-
|
|
72
|
-
**Quality standards:**
|
|
73
|
-
- Distinguish correlation from causation
|
|
74
|
-
- Quantify uncertainty in conclusions
|
|
75
|
-
- Consider alternative explanations`,
|
|
76
|
-
};
|
|
77
|
-
// ============================================================================
|
|
78
|
-
// Built-in Roles
|
|
79
|
-
// ============================================================================
|
|
80
|
-
const BUILT_IN_ROLES = {
|
|
81
|
-
generic: {
|
|
82
|
-
systemPrompt: BASE_SYSTEM_PROMPT,
|
|
83
|
-
defaultTools: ['shell', 'glob', 'grep'],
|
|
84
|
-
recommendedModel: 'standard',
|
|
85
|
-
},
|
|
86
|
-
researcher: {
|
|
87
|
-
systemPrompt: `${BASE_SYSTEM_PROMPT}\n${ROLE_PROMPTS.researcher}`,
|
|
88
|
-
defaultTools: ['glob', 'grep', 'deep_reasoning'],
|
|
89
|
-
recommendedModel: 'standard',
|
|
90
|
-
},
|
|
91
|
-
coder: {
|
|
92
|
-
systemPrompt: `${BASE_SYSTEM_PROMPT}\n${ROLE_PROMPTS.coder}`,
|
|
93
|
-
defaultTools: ['shell', 'glob', 'grep'],
|
|
94
|
-
recommendedModel: 'powerful',
|
|
95
|
-
},
|
|
96
|
-
analyst: {
|
|
97
|
-
systemPrompt: `${BASE_SYSTEM_PROMPT}\n${ROLE_PROMPTS.analyst}`,
|
|
98
|
-
defaultTools: ['glob', 'grep', 'deep_reasoning'],
|
|
99
|
-
recommendedModel: 'standard',
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
|
-
// ============================================================================
|
|
103
|
-
// Registry Functions
|
|
104
|
-
// ============================================================================
|
|
105
|
-
/**
|
|
106
|
-
* Register a role in the registry.
|
|
107
|
-
*/
|
|
108
|
-
export function registerRole(name, definition) {
|
|
109
|
-
log.debug('Registering role', { name, hasPrompt: !!definition.systemPrompt });
|
|
110
|
-
roleRegistry.set(name, definition);
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Get a role from the registry.
|
|
114
|
-
* Falls back to built-in roles, then generic.
|
|
115
|
-
* Templates are applied to the system prompt.
|
|
116
|
-
*/
|
|
117
|
-
export function getRole(name) {
|
|
118
|
-
loadConfigRoles();
|
|
119
|
-
let role;
|
|
120
|
-
// Check registry first
|
|
121
|
-
if (roleRegistry.has(name)) {
|
|
122
|
-
role = roleRegistry.get(name);
|
|
123
|
-
}
|
|
124
|
-
else if (name in BUILT_IN_ROLES) {
|
|
125
|
-
role = BUILT_IN_ROLES[name];
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
log.warn('Unknown role, using generic', { role: name });
|
|
129
|
-
role = BUILT_IN_ROLES.generic;
|
|
130
|
-
}
|
|
131
|
-
// Apply template substitution
|
|
132
|
-
return {
|
|
133
|
-
...role,
|
|
134
|
-
systemPrompt: applyTemplate(role.systemPrompt),
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Get all registered role names.
|
|
139
|
-
*/
|
|
140
|
-
export function getAllRoleNames() {
|
|
141
|
-
loadConfigRoles();
|
|
142
|
-
const builtIn = Object.keys(BUILT_IN_ROLES);
|
|
143
|
-
const custom = Array.from(roleRegistry.keys());
|
|
144
|
-
return [...new Set([...builtIn, ...custom])];
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Check if a role exists.
|
|
148
|
-
*/
|
|
149
|
-
export function hasRole(name) {
|
|
150
|
-
loadConfigRoles();
|
|
151
|
-
return roleRegistry.has(name) || name in BUILT_IN_ROLES;
|
|
152
|
-
}
|
|
153
|
-
// ============================================================================
|
|
154
|
-
// Config Loading
|
|
155
|
-
// ============================================================================
|
|
156
|
-
/**
|
|
157
|
-
* Load roles from config file (called lazily on first access).
|
|
158
|
-
*/
|
|
159
|
-
function loadConfigRoles() {
|
|
160
|
-
if (configRolesLoaded)
|
|
161
|
-
return;
|
|
162
|
-
configRolesLoaded = true;
|
|
163
|
-
const config = getConfig();
|
|
164
|
-
const roles = config.roles;
|
|
165
|
-
if (!roles)
|
|
166
|
-
return;
|
|
167
|
-
for (const [name, roleConfig] of Object.entries(roles)) {
|
|
168
|
-
if (!roleConfig)
|
|
169
|
-
continue;
|
|
170
|
-
// Build the full prompt
|
|
171
|
-
let systemPrompt = roleConfig.systemPrompt ?? '';
|
|
172
|
-
// If it's an override of a built-in role, inherit the base
|
|
173
|
-
if (name in BUILT_IN_ROLES && !roleConfig.systemPrompt) {
|
|
174
|
-
systemPrompt = BUILT_IN_ROLES[name].systemPrompt;
|
|
175
|
-
}
|
|
176
|
-
else if (systemPrompt && !systemPrompt.includes('Guidelines:')) {
|
|
177
|
-
// Prepend base prompt if custom prompt doesn't include it
|
|
178
|
-
systemPrompt = `${BASE_SYSTEM_PROMPT}\n\n${systemPrompt}`;
|
|
179
|
-
}
|
|
180
|
-
const definition = {
|
|
181
|
-
systemPrompt,
|
|
182
|
-
defaultTools: roleConfig.defaultTools,
|
|
183
|
-
recommendedModel: roleConfig.recommendedModel,
|
|
184
|
-
};
|
|
185
|
-
log.info('Loading role from config', { name });
|
|
186
|
-
registerRole(name, definition);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Reset the registry (for testing).
|
|
191
|
-
*/
|
|
192
|
-
export function resetRoleRegistry() {
|
|
193
|
-
roleRegistry.clear();
|
|
194
|
-
configRolesLoaded = false;
|
|
195
|
-
}
|
|
196
|
-
// ============================================================================
|
|
197
|
-
// Helpers for backward compatibility
|
|
198
|
-
// ============================================================================
|
|
199
|
-
export const SPAWNED_AGENT_CONTEXT = `
|
|
200
|
-
# Context: Spawned Sub-Agent
|
|
201
|
-
|
|
202
|
-
You are running as a sub-agent spawned by a parent agent to handle a delegated task.
|
|
203
|
-
|
|
204
|
-
**Constraints:**
|
|
205
|
-
- The delegate tool is disabled to prevent infinite recursion
|
|
206
|
-
- Focus on completing the delegated task autonomously
|
|
207
|
-
`;
|
|
208
|
-
export function buildSpawnedAgentPrompt(role) {
|
|
209
|
-
const def = getRole(role);
|
|
210
|
-
return `${def.systemPrompt}\n${SPAWNED_AGENT_CONTEXT}`;
|
|
211
|
-
}
|
|
212
|
-
export { BASE_SYSTEM_PROMPT };
|
|
213
|
-
//# sourceMappingURL=role-registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"role-registry.js","sourceRoot":"","sources":["../../src/presets/role-registry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,GAAG,GAAG,YAAY,CAAC,mBAAmB,CAAC,CAAC;AAiB9C,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E,MAAM,YAAY,GAAG,IAAI,GAAG,EAA0B,CAAC;AACvD,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAE9B,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E,MAAM,kBAAkB,GAAG;;;;;;;mDAOwB,CAAC;AAEpD,+EAA+E;AAC/E,wBAAwB;AACxB,+EAA+E;AAE/E,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,EAAE;IAEX,UAAU,EAAE;;;;;;;;;;;;;;6CAc+B;IAE3C,KAAK,EAAE;;;;;;;;;;;;;;;yCAegC;IAEvC,OAAO,EAAE;;;;;;;;;;;;;;oCAcyB;CACnC,CAAC;AAEF,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E,MAAM,cAAc,GAAmC;IACrD,OAAO,EAAE;QACP,YAAY,EAAE,kBAAkB;QAChC,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC;QACvC,gBAAgB,EAAE,UAAU;KAC7B;IACD,UAAU,EAAE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cAAc,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;YACvD,YAAY,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC;QACnD,CAAC;aAAM,IAAI,YAAY,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;YACjE,0DAA0D;YAC1D,YAAY,GAAG,GAAG,kBAAkB,OAAO,YAAY,EAAE,CAAC;QAC5D,CAAC;QAED,MAAM,UAAU,GAAmB;YACjC,YAAY;YACZ,YAAY,EAAE,UAAU,CAAC,YAAY;YACrC,gBAAgB,EAAE,UAAU,CAAC,gBAAsD;SACpF,CAAC;QAEF,GAAG,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/C,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACjC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,YAAY,CAAC,KAAK,EAAE,CAAC;IACrB,iBAAiB,GAAG,KAAK,CAAC;AAC5B,CAAC;AAED,+EAA+E;AAC/E,qCAAqC;AACrC,+EAA+E;AAE/E,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;CAQpC,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,IAAY;IAClD,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,OAAO,GAAG,GAAG,CAAC,YAAY,KAAK,qBAAqB,EAAE,CAAC;AACzD,CAAC;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
package/dist/presets/roles.d.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @agntk/core - Role Configurations
|
|
3
|
-
*
|
|
4
|
-
* Agent role presets with system prompts and call options.
|
|
5
|
-
* Adapted from packages/core/src/agents/roles.ts
|
|
6
|
-
*/
|
|
7
|
-
import { z } from 'zod';
|
|
8
|
-
export declare const SPAWNED_AGENT_CONTEXT = "\n# Context: Spawned Sub-Agent\n\nYou are running as a sub-agent spawned by a parent agent to handle a delegated task.\n\n**Constraints:**\n- The delegate tool is disabled to prevent infinite recursion\n- You still have access to fs, shell, web, memory, and task tools\n- Focus on completing the delegated task, then call task_complete\n\nWork autonomously until the task is complete.";
|
|
9
|
-
export declare const rolePrompts: {
|
|
10
|
-
generic: string;
|
|
11
|
-
researcher: string;
|
|
12
|
-
coder: string;
|
|
13
|
-
analyst: string;
|
|
14
|
-
};
|
|
15
|
-
export declare const systemPrompts: {
|
|
16
|
-
generic: string;
|
|
17
|
-
researcher: string;
|
|
18
|
-
coder: string;
|
|
19
|
-
analyst: string;
|
|
20
|
-
};
|
|
21
|
-
export type AgentRole = keyof typeof systemPrompts;
|
|
22
|
-
export declare const AGENT_ROLES: readonly ["generic", "researcher", "coder", "analyst"];
|
|
23
|
-
export declare const roleCallOptionsSchemas: {
|
|
24
|
-
generic: z.ZodObject<{
|
|
25
|
-
userId: z.ZodOptional<z.ZodString>;
|
|
26
|
-
sessionId: z.ZodOptional<z.ZodString>;
|
|
27
|
-
workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
28
|
-
}, "strip", z.ZodTypeAny, {
|
|
29
|
-
workspaceRoot?: string | undefined;
|
|
30
|
-
sessionId?: string | undefined;
|
|
31
|
-
userId?: string | undefined;
|
|
32
|
-
}, {
|
|
33
|
-
workspaceRoot?: string | undefined;
|
|
34
|
-
sessionId?: string | undefined;
|
|
35
|
-
userId?: string | undefined;
|
|
36
|
-
}>;
|
|
37
|
-
researcher: z.ZodObject<{
|
|
38
|
-
userId: z.ZodOptional<z.ZodString>;
|
|
39
|
-
sessionId: z.ZodOptional<z.ZodString>;
|
|
40
|
-
workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
41
|
-
searchDepth: z.ZodOptional<z.ZodEnum<["shallow", "deep"]>>;
|
|
42
|
-
sourceTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
43
|
-
}, "strip", z.ZodTypeAny, {
|
|
44
|
-
workspaceRoot?: string | undefined;
|
|
45
|
-
sessionId?: string | undefined;
|
|
46
|
-
userId?: string | undefined;
|
|
47
|
-
searchDepth?: "shallow" | "deep" | undefined;
|
|
48
|
-
sourceTypes?: string[] | undefined;
|
|
49
|
-
}, {
|
|
50
|
-
workspaceRoot?: string | undefined;
|
|
51
|
-
sessionId?: string | undefined;
|
|
52
|
-
userId?: string | undefined;
|
|
53
|
-
searchDepth?: "shallow" | "deep" | undefined;
|
|
54
|
-
sourceTypes?: string[] | undefined;
|
|
55
|
-
}>;
|
|
56
|
-
coder: z.ZodObject<{
|
|
57
|
-
userId: z.ZodOptional<z.ZodString>;
|
|
58
|
-
sessionId: z.ZodOptional<z.ZodString>;
|
|
59
|
-
workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
60
|
-
language: z.ZodOptional<z.ZodString>;
|
|
61
|
-
testingStrategy: z.ZodOptional<z.ZodEnum<["unit", "integration", "both", "none"]>>;
|
|
62
|
-
}, "strip", z.ZodTypeAny, {
|
|
63
|
-
workspaceRoot?: string | undefined;
|
|
64
|
-
sessionId?: string | undefined;
|
|
65
|
-
userId?: string | undefined;
|
|
66
|
-
language?: string | undefined;
|
|
67
|
-
testingStrategy?: "none" | "unit" | "integration" | "both" | undefined;
|
|
68
|
-
}, {
|
|
69
|
-
workspaceRoot?: string | undefined;
|
|
70
|
-
sessionId?: string | undefined;
|
|
71
|
-
userId?: string | undefined;
|
|
72
|
-
language?: string | undefined;
|
|
73
|
-
testingStrategy?: "none" | "unit" | "integration" | "both" | undefined;
|
|
74
|
-
}>;
|
|
75
|
-
analyst: z.ZodObject<{
|
|
76
|
-
userId: z.ZodOptional<z.ZodString>;
|
|
77
|
-
sessionId: z.ZodOptional<z.ZodString>;
|
|
78
|
-
workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
79
|
-
analysisType: z.ZodOptional<z.ZodEnum<["exploratory", "confirmatory"]>>;
|
|
80
|
-
outputFormat: z.ZodOptional<z.ZodEnum<["summary", "detailed", "visual"]>>;
|
|
81
|
-
}, "strip", z.ZodTypeAny, {
|
|
82
|
-
workspaceRoot?: string | undefined;
|
|
83
|
-
sessionId?: string | undefined;
|
|
84
|
-
userId?: string | undefined;
|
|
85
|
-
analysisType?: "exploratory" | "confirmatory" | undefined;
|
|
86
|
-
outputFormat?: "summary" | "detailed" | "visual" | undefined;
|
|
87
|
-
}, {
|
|
88
|
-
workspaceRoot?: string | undefined;
|
|
89
|
-
sessionId?: string | undefined;
|
|
90
|
-
userId?: string | undefined;
|
|
91
|
-
analysisType?: "exploratory" | "confirmatory" | undefined;
|
|
92
|
-
outputFormat?: "summary" | "detailed" | "visual" | undefined;
|
|
93
|
-
}>;
|
|
94
|
-
};
|
|
95
|
-
export interface RoleConfig {
|
|
96
|
-
systemPrompt: string;
|
|
97
|
-
callOptionsSchema: z.ZodType;
|
|
98
|
-
defaultTools?: string[];
|
|
99
|
-
recommendedModel?: string;
|
|
100
|
-
}
|
|
101
|
-
export declare const roleConfigs: Record<AgentRole, RoleConfig>;
|
|
102
|
-
export declare function buildSpawnedAgentPrompt(role: AgentRole): string;
|
|
103
|
-
export declare function getRoleSystemPrompt(role: AgentRole): string;
|
|
104
|
-
export declare function getRoleCallOptionsSchema(role: AgentRole): z.ZodType;
|
|
105
|
-
//# sourceMappingURL=roles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/presets/roles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,qBAAqB,qYAUY,CAAC;AAE/C,eAAO,MAAM,WAAW;;;;;CA+EvB,CAAC;AAsCF,eAAO,MAAM,aAAa;;;;;CAKzB,CAAC;AAMF,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,aAAa,CAAC;AACnD,eAAO,MAAM,WAAW,wDAAyD,CAAC;AAMlF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BlC,CAAC;AAMF,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,SAAS,EAAE,UAAU,CAyBrD,CAAC;AAMF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE/D;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE3D;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,SAAS,GAAG,CAAC,CAAC,OAAO,CAEnE"}
|