@task-shepherd/agent 1.0.2

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,139 @@
1
+ import { z } from 'zod';
2
+ // Analysis schemas for structured Claude output
3
+ export const AnalysisStrengthSchema = z.object({
4
+ title: z.string(),
5
+ description: z.string(),
6
+ impact: z.enum(['low', 'medium', 'high']),
7
+ evidence: z.array(z.string()).optional()
8
+ });
9
+ export const AnalysisWeaknessSchema = z.object({
10
+ title: z.string(),
11
+ description: z.string(),
12
+ severity: z.enum(['low', 'medium', 'high']),
13
+ affected_areas: z.array(z.string()).optional(),
14
+ improvement_effort: z.enum(['minimal', 'moderate', 'significant']).optional()
15
+ });
16
+ export const AnalysisRiskSchema = z.object({
17
+ title: z.string(),
18
+ description: z.string(),
19
+ probability: z.enum(['low', 'medium', 'high']),
20
+ impact: z.enum(['low', 'medium', 'high']),
21
+ mitigation_strategy: z.string().optional()
22
+ });
23
+ export const AnalysisOpportunitySchema = z.object({
24
+ title: z.string(),
25
+ description: z.string(),
26
+ potential_value: z.enum(['low', 'medium', 'high']),
27
+ implementation_complexity: z.enum(['simple', 'moderate', 'complex']).optional()
28
+ });
29
+ export const ScoreWithReasoningSchema = z.object({
30
+ score: z.number().min(0).max(100),
31
+ reasoning: z.string()
32
+ });
33
+ export const RecommendationSchema = z.object({
34
+ id: z.string(),
35
+ category: z.enum(['requirements', 'architecture', 'security', 'performance', 'maintainability', 'testing']),
36
+ title: z.string(),
37
+ description: z.string(),
38
+ implementation_guide: z.string().optional(),
39
+ priority: z.enum(['low', 'medium', 'high', 'critical']),
40
+ estimated_effort: z.string().optional(),
41
+ business_impact: z.string().optional(),
42
+ technical_complexity: z.enum(['simple', 'moderate', 'complex']).optional()
43
+ });
44
+ export const ExplicitRequirementSchema = z.object({
45
+ requirement: z.string(),
46
+ source_text: z.string(),
47
+ confidence: z.enum(['high', 'medium', 'low'])
48
+ });
49
+ export const InferredRequirementSchema = z.object({
50
+ requirement: z.string(),
51
+ rationale: z.string(),
52
+ domain_pattern: z.string(),
53
+ priority: z.enum(['critical', 'high', 'medium', 'low'])
54
+ });
55
+ export const NonFunctionalRequirementSchema = z.object({
56
+ category: z.string(),
57
+ requirement: z.string(),
58
+ industry_standard: z.boolean(),
59
+ customization_needed: z.boolean()
60
+ });
61
+ export const ClarificationQuestionSchema = z.object({
62
+ category: z.string(),
63
+ question: z.string(),
64
+ impact_if_unclear: z.string(),
65
+ suggested_default: z.string()
66
+ });
67
+ export const SuggestedProductRequirementsSchema = z.object({
68
+ explicit_requirements: z.array(ExplicitRequirementSchema),
69
+ inferred_functional_requirements: z.array(InferredRequirementSchema),
70
+ suggested_non_functional_requirements: z.array(NonFunctionalRequirementSchema),
71
+ requirements_clarification_questions: z.array(ClarificationQuestionSchema)
72
+ });
73
+ // Feature Gap Analysis schemas
74
+ export const FeatureGapSchema = z.object({
75
+ feature: z.string(),
76
+ priority: z.enum(['critical', 'high', 'medium', 'low']),
77
+ rationale: z.string(),
78
+ suggested_approach: z.string(),
79
+ estimated_effort: z.string()
80
+ });
81
+ export const MissingNonFunctionalRequirementSchema = z.object({
82
+ requirement: z.string(),
83
+ category: z.enum(['security', 'performance', 'accessibility', 'monitoring', 'documentation', 'testing', 'deployment']),
84
+ impact: z.string(),
85
+ recommendation: z.string()
86
+ });
87
+ export const FeatureGapAnalysisSchema = z.object({
88
+ missing_core_features: z.array(FeatureGapSchema),
89
+ missing_non_functional_requirements: z.array(MissingNonFunctionalRequirementSchema)
90
+ });
91
+ // Timeline schema for implementation plans
92
+ export const TimelinePhaseSchema = z.object({
93
+ id: z.string(),
94
+ name: z.string(),
95
+ description: z.string(),
96
+ duration_weeks: z.number(),
97
+ start_week: z.number(),
98
+ dependencies: z.array(z.string()).optional(),
99
+ deliverables: z.array(z.string()).optional(),
100
+ key_milestones: z.array(z.string()).optional(),
101
+ resources_required: z.array(z.string()).optional(),
102
+ risks: z.array(z.string()).optional()
103
+ });
104
+ export const TimelineSchema = z.object({
105
+ total_duration_weeks: z.number(),
106
+ phases: z.array(TimelinePhaseSchema)
107
+ });
108
+ export const ProjectAnalysisSchema = z.object({
109
+ project_id: z.string(),
110
+ analysis_type: z.enum(['project_review', 'development_plan', 'story_implementation']),
111
+ executive_summary: z.string(),
112
+ analysis: z.object({
113
+ strengths: z.array(AnalysisStrengthSchema),
114
+ weaknesses: z.array(AnalysisWeaknessSchema),
115
+ risks: z.array(AnalysisRiskSchema),
116
+ opportunities: z.array(AnalysisOpportunitySchema)
117
+ }),
118
+ scores: z.object({
119
+ completeness: ScoreWithReasoningSchema,
120
+ clarity: ScoreWithReasoningSchema,
121
+ feasibility: ScoreWithReasoningSchema,
122
+ overall: ScoreWithReasoningSchema
123
+ }),
124
+ recommendations: z.array(RecommendationSchema),
125
+ suggested_product_requirements: SuggestedProductRequirementsSchema,
126
+ feature_gap_analysis: FeatureGapAnalysisSchema.optional(),
127
+ metadata: z.object({
128
+ analysis_duration_seconds: z.number(),
129
+ claude_model: z.string(),
130
+ confidence_level: z.number().min(0).max(1),
131
+ analysis_timestamp: z.string(),
132
+ reviewer_notes: z.string().optional()
133
+ })
134
+ });
135
+ // Extended schema for implementation plans with timeline
136
+ export const ImplementationPlanSchema = ProjectAnalysisSchema.extend({
137
+ analysis_type: z.literal('implementation_plan'),
138
+ timeline: TimelineSchema
139
+ });
package/package.json ADDED
@@ -0,0 +1,125 @@
1
+ {
2
+ "name": "@task-shepherd/agent",
3
+ "version": "1.0.2",
4
+ "description": "Simplified AI agent service for Task Shepherd project analysis",
5
+ "main": "dist/index.js",
6
+ "bin": {
7
+ "task-shepherd-agent": "dist/cli/index.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "mcp-agent",
12
+ "README.md",
13
+ "LICENSE.md"
14
+ ],
15
+ "engines": {
16
+ "node": ">=18.0.0"
17
+ },
18
+ "scripts": {
19
+ "dev": "ts-node-dev --respawn --transpile-only src/index.ts",
20
+ "build": "node build.js",
21
+ "build:dev": "node build-dev.js",
22
+ "build:tsc": "tsc",
23
+ "build:prod": "npm run build && npm run build:web",
24
+ "start": "node dist/index.js",
25
+ "type-check": "tsc --noEmit",
26
+ "lint": "eslint src/**/*.ts --fix",
27
+ "kill": "(lsof -ti:8547,8548 | xargs kill -9 2>/dev/null) || pkill -f 'node.*agent|ts-node-dev.*agent' || echo 'AI agent service stopped'",
28
+ "test": "jest",
29
+ "prepublishOnly": "npm run build",
30
+ "test:workqueue": "jest --config jest.workqueue.config.js",
31
+ "test:workqueue:watch": "jest --config jest.workqueue.config.js --watch",
32
+ "test:workqueue:coverage": "jest --config jest.workqueue.config.js --coverage",
33
+ "dev:web": "cd web && npm run dev",
34
+ "build:web": "cd web && npm run build",
35
+ "dev:all": "concurrently \"npm run dev\" \"npm run dev:web\"",
36
+ "codegen": "graphql-codegen --config codegen.yml",
37
+ "agent:init": "ts-node src/cli/index.ts init",
38
+ "agent:status": "ts-node src/cli/index.ts status",
39
+ "reset:config": "node reset-org-config.js",
40
+ "agent:identity:show": "ts-node src/cli/index.ts identity show",
41
+ "agent:identity:reset": "ts-node src/cli/index.ts identity reset",
42
+ "agent:identity:strategies": "ts-node src/cli/index.ts identity strategies",
43
+ "agent:heartbeat:test": "ts-node src/cli/index.ts heartbeat test",
44
+ "agent:config:validate": "ts-node src/cli/index.ts config validate",
45
+ "agent:config:show": "ts-node src/cli/index.ts config show",
46
+ "agent:cli:help": "ts-node src/cli/index.ts --help"
47
+ },
48
+ "dependencies": {
49
+ "@anthropic-ai/sdk": "^0.56.0",
50
+ "@graphql-typed-document-node/core": "^3.2.0",
51
+ "@task-shepherd/shared": "*",
52
+ "chalk": "^4.1.2",
53
+ "commander": "^11.0.0",
54
+ "compression": "^1.7.4",
55
+ "cors": "^2.8.5",
56
+ "dotenv": "^16.3.1",
57
+ "express": "^4.18.2",
58
+ "glob": "^11.0.3",
59
+ "graphql": "^16.8.0",
60
+ "graphql-request": "^6.1.0",
61
+ "graphql-ws": "^6.0.5",
62
+ "helmet": "^7.0.0",
63
+ "joi": "^17.9.2",
64
+ "prompts": "^2.4.2",
65
+ "semver": "^7.5.4",
66
+ "sqlite3": "^5.1.6",
67
+ "uuid": "^11.1.0",
68
+ "winston": "^3.10.0",
69
+ "ws": "^8.14.2",
70
+ "zod": "^3.22.4"
71
+ },
72
+ "devDependencies": {
73
+ "@graphql-codegen/cli": "^5.0.0",
74
+ "@graphql-codegen/client-preset": "^4.1.0",
75
+ "@graphql-codegen/introspection": "^4.0.0",
76
+ "@graphql-codegen/typed-document-node": "^5.0.1",
77
+ "@graphql-codegen/typescript": "^4.0.1",
78
+ "@graphql-codegen/typescript-operations": "^4.0.1",
79
+ "@types/compression": "^1.7.2",
80
+ "@types/cors": "^2.8.13",
81
+ "@types/express": "^4.17.17",
82
+ "@types/glob": "^8.1.0",
83
+ "@types/jest": "^30.0.0",
84
+ "@types/nock": "^10.0.3",
85
+ "@types/node": "^20.4.5",
86
+ "@types/prompts": "^2.4.9",
87
+ "@types/semver": "^7.5.4",
88
+ "@types/uuid": "^9.0.8",
89
+ "@types/ws": "^8.5.8",
90
+ "@typescript-eslint/eslint-plugin": "^6.2.0",
91
+ "@typescript-eslint/parser": "^6.2.0",
92
+ "concurrently": "^8.2.0",
93
+ "esbuild": "^0.19.0",
94
+ "eslint": "^8.45.0",
95
+ "javascript-obfuscator": "^4.1.1",
96
+ "jest": "^29.6.1",
97
+ "nock": "^14.0.7",
98
+ "ts-jest": "^29.1.1",
99
+ "ts-node-dev": "^2.0.0",
100
+ "typescript": "^5.1.6"
101
+ },
102
+ "keywords": [
103
+ "ai",
104
+ "project-analysis",
105
+ "claude",
106
+ "task-management",
107
+ "ai-agent",
108
+ "project-management",
109
+ "code-analysis"
110
+ ],
111
+ "author": "Task Shepherd Team",
112
+ "license": "SEE LICENSE IN LICENSE.md",
113
+ "repository": {
114
+ "type": "git",
115
+ "url": "https://github.com/taskshepherd/task-shepherd.git",
116
+ "directory": "packages/agent"
117
+ },
118
+ "bugs": {
119
+ "url": "https://github.com/taskshepherd/task-shepherd/issues"
120
+ },
121
+ "homepage": "https://taskshepherd.com",
122
+ "publishConfig": {
123
+ "access": "public"
124
+ }
125
+ }